diff --git a/DEPS b/DEPS index 72ac2c2..1d3584a4 100644 --- a/DEPS +++ b/DEPS
@@ -249,7 +249,7 @@ # luci-go CIPD package version. # Make sure the revision is uploaded by infra-packagers builder. # https://ci.chromium.org/p/infra-internal/g/infra-packagers/console - 'luci_go': 'git_revision:6ac770095bc0e289138f6f29aa91ff2f4886b81c', + 'luci_go': 'git_revision:2eaf659a45c8945c3e15f202c4e8a734243f8270', # This can be overridden, e.g. with custom_vars, to build clang from HEAD # instead of downloading the prebuilt pinned revision. @@ -300,7 +300,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling Skia # and whatever else without interference from each other. - 'skia_revision': '04db423b4611854c6226737be3a234e9e6c526d0', + 'skia_revision': 'fad440fb762b14ebf7d0d44710960f6bb287a702', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling V8 # and whatever else without interference from each other. @@ -308,7 +308,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling ANGLE # and whatever else without interference from each other. - 'angle_revision': '6d3e587004df6ad6673a857c4d218c452c86a6c2', + 'angle_revision': 'fb32aef5f6c97f150616915c9fbc1cf48e3d350c', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling SwiftShader # and whatever else without interference from each other. @@ -316,7 +316,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling PDFium # and whatever else without interference from each other. - 'pdfium_revision': '753fad158b9f18a324a934b403d8d80d0f97cea8', + 'pdfium_revision': '28eb03ee8c0582d046ecd012c44ef0121c1b4e72', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling BoringSSL # and whatever else without interference from each other. @@ -387,7 +387,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling devtools-frontend # and whatever else without interference from each other. - 'devtools_frontend_revision': '23cde35228250b831d70b63ab76d05ab4d193129', + 'devtools_frontend_revision': 'fe443ad274f891617ffd42c4170fbbda254ebab6', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling libprotobuf-mutator # and whatever else without interference from each other. @@ -427,11 +427,11 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. - 'dawn_revision': '68b4e6460ffba5e8f19d4886b31293838f4b75f8', + 'dawn_revision': '028726497ad38a66c55ef0a7e831d20dc0e026be', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling feed # and whatever else without interference from each other. - 'quiche_revision': '800b8c7e3e3fa26b8d6de040f63441c9d2de6df1', + 'quiche_revision': '514a27478f6cd0b359311cf81c42fb24c1abcb64', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling ios_webkit # and whatever else without interference from each other. @@ -808,7 +808,7 @@ 'src/clank': { 'url': Var('chrome_git') + '/clank/internal/apps.git' + '@' + - '9fc3d4aeb4665ead3f9154305f60041d3a4ac2c7', + 'a1ad702dbc3cd97fdd464f3b34402b545b299096', 'condition': 'checkout_android and checkout_src_internal', }, @@ -1232,13 +1232,13 @@ }, 'src/third_party/depot_tools': - Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + '6463e8c4bba3b6608415c6442b684520e3ec9c5a', + Var('chromium_git') + '/chromium/tools/depot_tools.git' + '@' + '85c13de0becd351c4ad2faeff8bbf88fdc74d038', 'src/third_party/devtools-frontend/src': Var('chromium_git') + '/devtools/devtools-frontend' + '@' + Var('devtools_frontend_revision'), 'src/third_party/devtools-frontend-internal': { - 'url': Var('chrome_git') + '/devtools/devtools-internal.git' + '@' + '4ae3148452ed3df7d1f7aa872c98185686904f6a', + 'url': Var('chrome_git') + '/devtools/devtools-internal.git' + '@' + '4f06f93c00759fd6f84e527946ee6424e65da95b', 'condition': 'checkout_src_internal', }, @@ -1705,7 +1705,7 @@ Var('pdfium_git') + '/pdfium.git' + '@' + Var('pdfium_revision'), 'src/third_party/perfetto': - Var('android_git') + '/platform/external/perfetto.git' + '@' + 'ab5c58d254d434ec35022ff5c8dfa437ff34ac6d', + Var('android_git') + '/platform/external/perfetto.git' + '@' + '603af5820895ff5b344fd8b2b7e90a5336f2de30', 'src/third_party/perl': { 'url': Var('chromium_git') + '/chromium/deps/perl.git' + '@' + '6f3e5028eb65d0b4c5fdd792106ac4c84eee1eb3', @@ -1850,7 +1850,7 @@ 'dep_type': 'cipd', }, - 'src/third_party/vulkan-deps': '{chromium_git}/vulkan-deps@94574e5c2e14614aae7251f26a5492fec966abf0', + 'src/third_party/vulkan-deps': '{chromium_git}/vulkan-deps@84c82fea3f439bcd29b16ce11faa1bb7af96e198', 'src/third_party/vulkan_memory_allocator': Var('chromium_git') + '/external/github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator.git' + '@' + 'ebe84bec02c041d28f902da0214bf442743fc907', @@ -1887,10 +1887,10 @@ Var('chromium_git') + '/external/khronosgroup/webgl.git' + '@' + 'd1b65aa5a88f6efd900604dfcda840154e9f16e2', 'src/third_party/webgpu-cts/src': - Var('chromium_git') + '/external/github.com/gpuweb/cts.git' + '@' + '083b9c132a02c2c70275c7c8ef7f6ee559c6cedb', + Var('chromium_git') + '/external/github.com/gpuweb/cts.git' + '@' + '71d6a776334768915304338e2269b25fc176cea1', 'src/third_party/webrtc': - Var('webrtc_git') + '/src.git' + '@' + '4daa4e6b2f733e18d411ab7fba16ddd3431b3ff0', + Var('webrtc_git') + '/src.git' + '@' + '18898d7db360b1b42d0f3bd7906eb97f4b16ae5c', # Wuffs' canonical repository is at github.com/google/wuffs, but we use # Skia's mirror of Wuffs, the same as in upstream Skia's DEPS file. @@ -1937,7 +1937,7 @@ 'packages': [ { 'package': 'skia/tools/goldctl/linux-amd64', - 'version': 'Y4KbWrn94Q3XMtUG5zAFQkKK2DY32rJV5Grv42AT5qoC', + 'version': 'Axj26GvFKuSjh3j36_dDWFE_8GPzCBI8xMHB55-9KkwC', }, ], 'dep_type': 'cipd', @@ -1947,7 +1947,7 @@ 'packages': [ { 'package': 'skia/tools/goldctl/windows-amd64', - 'version': 'iaI7s2Phd7gvMbflj7i0DWmQtZoGldRf0TTQKnQn2tYC', + 'version': 'RrfT7u4je5UzYBYkRTDnhzRj0rYXgnyrmtB7YrD5I2oC', }, ], 'dep_type': 'cipd', @@ -1958,7 +1958,7 @@ 'packages': [ { 'package': 'skia/tools/goldctl/mac-amd64', - 'version': 'huUbnRIj6CyYWSe88yS4ODBXplfnN9iL6uyI1bzHY7oC', + 'version': 'hPekni-3ILDb_vKt8AQPlSQuAt0AP4oGRbEK5ZKGTZ0C', }, ], 'dep_type': 'cipd', @@ -1969,7 +1969,7 @@ 'packages': [ { 'package': 'skia/tools/goldctl/mac-arm64', - 'version': 'kBju_chgeLThGXBkWpPEZT-bsQwUPPELuxpH0qlQ1yMC', + 'version': 'Uj9i2aXWBfK915rIKB9UfFkjeqqE8FP9jdTvXxamubUC', }, ], 'dep_type': 'cipd', @@ -1980,7 +1980,7 @@ Var('chromium_git') + '/v8/v8.git' + '@' + Var('v8_revision'), 'src-internal': { - 'url': Var('chrome_git') + '/chrome/src-internal.git@0bc68660c6e3cd6fb322f09fe157b08efc080fe0', + 'url': Var('chrome_git') + '/chrome/src-internal.git@26b4899e30ef57c32a4c708e252a4ed038aff8e9', 'condition': 'checkout_src_internal', }, @@ -3992,7 +3992,7 @@ 'src/chrome/app/theme/google_chrome': { 'url': Var('chrome_git') + '/chrome/theme/google_chrome.git' + '@' + - '13d584eaee2cec3996002e39493bc5f3a8523f56', + 'd940f520f467ac79a03152f697d131eeabcd1186', 'condition': 'checkout_src_internal', },
diff --git a/WATCHLISTS b/WATCHLISTS index f42f24b..04de445 100644 --- a/WATCHLISTS +++ b/WATCHLISTS
@@ -1223,6 +1223,17 @@ 'incident_reporting': { 'filepath': 'chrome/browser/safe_browsing/incident_reporting', }, + 'incognito': { + 'filepath': 'chrome/android/java/src/org/chromium/chrome/browser/customtabs/CustomTabIncognitoManager.java'\ + '|chrome/android/java/src/org/chromium/chrome/browser/customtabs/IncognitoCustomTabIntentDataProvider.java'\ + '|chrome/android/java/src/org/chromium/chrome/browser/incognito'\ + '|chrome/android/junit/src/org/chromium/chrome/browser/incognito'\ + '|chrome/android/javatests/src/org/chromium/chrome/browser/incognito'\ + '|chrome/browser/incognito'\ + '|chrome/browser/prefs/incognito_mode_prefs.cc'\ + '|chrome/browser/prefs/pref_service_incognito_allowlist.cc'\ + '|chrome/browser/profiles/incognito_mode_policy_handler.cc'\ + }, 'indexed_db': { 'filepath': 'content/browser/indexed_db|'\ 'content/public/browser/indexed_db|'\ @@ -2754,6 +2765,7 @@ 'kristipark+watch@chromium.org', 'tgupta+watch@chromium.org'], 'incident_reporting': ['grt+watch@chromium.org'], + 'incognito': ['roagarwal+watch@chromium.org'], 'indexed_db': ['jsbell+idb@chromium.org', 'dmurph+watching-idb@chromium.org', 'enne+idb@chromium.org'],
diff --git a/android_webview/browser/aw_javascript_dialog_manager.h b/android_webview/browser/aw_javascript_dialog_manager.h index e66600b0..ed57679 100644 --- a/android_webview/browser/aw_javascript_dialog_manager.h +++ b/android_webview/browser/aw_javascript_dialog_manager.h
@@ -9,6 +9,15 @@ namespace android_webview { +/** + * Implements JavaScriptDialogManager for WebView. + * + * This class is a singleton, but it doesn't store any state, each method just + * calls through to the AwContentsClientBridge tied to the Web Contents. If + * you add state, please consider how this will work with Multi-profile. + * + * Lifetime: Singleton + */ class AwJavaScriptDialogManager : public content::JavaScriptDialogManager { public: AwJavaScriptDialogManager();
diff --git a/android_webview/java/src/org/chromium/android_webview/common/ProductionSupportedFlagList.java b/android_webview/java/src/org/chromium/android_webview/common/ProductionSupportedFlagList.java index 491a239d..3457fd2f 100644 --- a/android_webview/java/src/org/chromium/android_webview/common/ProductionSupportedFlagList.java +++ b/android_webview/java/src/org/chromium/android_webview/common/ProductionSupportedFlagList.java
@@ -392,8 +392,6 @@ Flag.baseFeature(ContentFeatures.PRIVACY_SANDBOX_ADS_AP_IS_OVERRIDE, "When enabled, the following ads APIs will be available: Attribution Reporting," + "FLEDGE, Topics."), - Flag.baseFeature(BlinkFeatures.WEB_RTC_STATS_REPORT_IDL, - "Backs the WebRTC stats report object with generated objects defined in IDL"), Flag.baseFeature(BlinkFeatures.RENDER_BLOCKING_FONTS, "When enabled, blocks rendering on font preloads to reduce CLS. " + "See go/critical-font-analysis"),
diff --git a/ash/system/input_device_settings/input_device_notifier.cc b/ash/system/input_device_settings/input_device_notifier.cc index 4bc3fa2..d9773b3 100644 --- a/ash/system/input_device_settings/input_device_notifier.cc +++ b/ash/system/input_device_settings/input_device_notifier.cc
@@ -211,7 +211,10 @@ template <typename MojomDevicePtr, typename InputDeviceType> void InputDeviceNotifier<MojomDevicePtr, InputDeviceType>:: OnBluetoothAdapterOrDeviceChanged(device::BluetoothDevice* device) { - RefreshDevices(); + // Do nothing as OnBluetoothAdapterOrDeviceChanged is very noisy and causes + // updates to happen many times per second. We expect + // OnInputDeviceConfigurationChanged to include all devices including + // bluetooth devices, so refreshing devices here is unnecessary. } // Template specialization for retrieving the updated device lists for each
diff --git a/ash/user_education/views/help_bubble_view_ash.cc b/ash/user_education/views/help_bubble_view_ash.cc index 40d8befd..55cb4c5 100644 --- a/ash/user_education/views/help_bubble_view_ash.cc +++ b/ash/user_education/views/help_bubble_view_ash.cc
@@ -679,12 +679,6 @@ UpdateRoundedCorners(); } -bool HelpBubbleViewAsh::OnMousePressed(const ui::MouseEvent& event) { - base::RecordAction( - base::UserMetricsAction("InProductHelp.Promos.BubbleClicked")); - return false; -} - std::u16string HelpBubbleViewAsh::GetAccessibleWindowTitle() const { std::u16string result = accessible_name_;
diff --git a/ash/user_education/views/help_bubble_view_ash.h b/ash/user_education/views/help_bubble_view_ash.h index 84708d0..fd189b63 100644 --- a/ash/user_education/views/help_bubble_view_ash.h +++ b/ash/user_education/views/help_bubble_view_ash.h
@@ -23,10 +23,6 @@ #include "ui/views/bubble/bubble_dialog_delegate_view.h" #include "ui/views/controls/button/label_button.h" -namespace ui { -class MouseEvent; -} // namespace ui - namespace views { class ImageView; class Label; @@ -84,7 +80,6 @@ std::unique_ptr<views::NonClientFrameView> CreateNonClientFrameView( views::Widget* widget) override; void OnAnchorBoundsChanged() override; - bool OnMousePressed(const ui::MouseEvent& event) override; std::u16string GetAccessibleWindowTitle() const override; void OnWidgetActivationChanged(views::Widget* widget, bool active) override; void OnWidgetBoundsChanged(views::Widget* widget, const gfx::Rect&) override;
diff --git a/ash/webui/common/resources/BUILD.gn b/ash/webui/common/resources/BUILD.gn index 04519962..6d02969 100644 --- a/ash/webui/common/resources/BUILD.gn +++ b/ash/webui/common/resources/BUILD.gn
@@ -474,12 +474,14 @@ "network/network_choose_mobile.d.ts", "network/network_config.d.ts", "network/network_config_input.d.ts", + "network/network_config_select.d.ts", "network/network_config_toggle.d.ts", "network/network_icon.d.ts", "network/network_ip_config.d.ts", "network/network_list.d.ts", "network/network_list_item.d.ts", "network/network_nameservers.d.ts", + "network/network_password_input.d.ts", "network/network_property_list_mojo.d.ts", "network/network_proxy.d.ts", "network/network_siminfo.d.ts",
diff --git a/ash/webui/common/resources/network/network_config_select.d.ts b/ash/webui/common/resources/network/network_config_select.d.ts new file mode 100644 index 0000000..fcc04d4 --- /dev/null +++ b/ash/webui/common/resources/network/network_config_select.d.ts
@@ -0,0 +1,18 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import {LegacyElementMixin} from 'chrome://resources/polymer/v3_0/polymer/lib/legacy/legacy-element-mixin.js'; + +interface NetworkConfigSelectElement extends LegacyElementMixin, HTMLElement { + items: Array<string|number>; + value: string|number; +} + +declare global { + interface HTMLElementTagNameMap { + 'network-config-select': NetworkConfigSelectElement; + } +} + +export {NetworkConfigSelectElement};
diff --git a/ash/webui/common/resources/network/network_password_input.d.ts b/ash/webui/common/resources/network/network_password_input.d.ts new file mode 100644 index 0000000..b710e9df --- /dev/null +++ b/ash/webui/common/resources/network/network_password_input.d.ts
@@ -0,0 +1,18 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import {LegacyElementMixin} from 'chrome://resources/polymer/v3_0/polymer/lib/legacy/legacy-element-mixin.js'; + +interface NetworkPasswordInputElement extends LegacyElementMixin, HTMLElement { + value: string; + invalid: boolean; +} + +declare global { + interface HTMLElementTagNameMap { + 'network-password-input': NetworkPasswordInputElement; + } +} + +export {NetworkPasswordInputElement};
diff --git a/base/allocator/partition_allocator/.gn b/base/allocator/partition_allocator/.gn deleted file mode 100644 index ee3f918..0000000 --- a/base/allocator/partition_allocator/.gn +++ /dev/null
@@ -1,10 +0,0 @@ -# Copyright 2022 The Chromium Authors -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -# The python interpreter to use by default. On Windows, this will look -# for python3.exe and python3.bat. -script_executable = "python3" - -# The location of the build configuration file. -buildconfig = "//build/config/BUILDCONFIG.gn"
diff --git a/base/allocator/partition_allocator/DEPS b/base/allocator/partition_allocator/DEPS index 4de2f2c..a355baf 100644 --- a/base/allocator/partition_allocator/DEPS +++ b/base/allocator/partition_allocator/DEPS
@@ -2,134 +2,6 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -# PartitionAlloc is planned to be extracted into a standalone library, and -# therefore dependencies need to be strictly controlled and minimized. - -gclient_gn_args_file = 'partition_allocator/build/config/gclient_args.gni' - -# Only these hosts are allowed for dependencies in this DEPS file. -# This is a subset of chromium/src/DEPS's allowed_hosts. -allowed_hosts = [ - 'chromium.googlesource.com', -] - -vars = { - 'chromium_git': 'https://chromium.googlesource.com', -} - -deps = { - 'partition_allocator/build': - Var('chromium_git') + '/chromium/src/build.git', - 'partition_allocator/buildtools': - Var('chromium_git') + '/chromium/src/buildtools.git', - 'partition_allocator/buildtools/clang_format/script': - Var('chromium_git') + - '/external/github.com/llvm/llvm-project/clang/tools/clang-format.git', - 'partition_allocator/buildtools/linux64': { - 'packages': [ - { - 'package': 'gn/gn/linux-${{arch}}', - 'version': 'latest', - } - ], - 'dep_type': 'cipd', - 'condition': 'host_os == "linux"', - }, - 'partition_allocator/buildtools/mac': { - 'packages': [ - { - 'package': 'gn/gn/mac-${{arch}}', - 'version': 'latest', - } - ], - 'dep_type': 'cipd', - 'condition': 'host_os == "mac"', - }, - 'partition_allocator/buildtools/win': { - 'packages': [ - { - 'package': 'gn/gn/windows-amd64', - 'version': 'latest', - } - ], - 'dep_type': 'cipd', - 'condition': 'host_os == "win"', - }, - 'partition_allocator/buildtools/third_party/libc++/trunk': - Var('chromium_git') + '/external/github.com/llvm/llvm-project/libcxx.git', - 'partition_allocator/buildtools/third_party/libc++abi/trunk': - Var('chromium_git') + - '/external/github.com/llvm/llvm-project/libcxxabi.git', - 'partition_allocator/tools/clang': - Var('chromium_git') + '/chromium/src/tools/clang.git', -} - -hooks = [ - { - 'name': 'sysroot_arm', - 'pattern': '.', - 'condition': 'checkout_linux and checkout_arm', - 'action': [ - 'python3', - 'partition_allocator/build/linux/sysroot_scripts/install-sysroot.py', - '--arch=arm'], - }, - { - 'name': 'sysroot_arm64', - 'pattern': '.', - 'condition': 'checkout_linux and checkout_arm64', - 'action': [ - 'python3', - 'partition_allocator/build/linux/sysroot_scripts/install-sysroot.py', - '--arch=arm64'], - }, - { - 'name': 'sysroot_x86', - 'pattern': '.', - 'condition': 'checkout_linux and (checkout_x86 or checkout_x64)', - 'action': [ - 'python3', - 'partition_allocator/build/linux/sysroot_scripts/install-sysroot.py', - '--arch=x86'], - }, - { - 'name': 'sysroot_mips', - 'pattern': '.', - 'condition': 'checkout_linux and checkout_mips', - 'action': [ - 'python3', - 'partition_allocator/build/linux/sysroot_scripts/install-sysroot.py', - '--arch=mips'], - }, - { - 'name': 'sysroot_mips64', - 'pattern': '.', - 'condition': 'checkout_linux and checkout_mips64', - 'action': [ - 'python3', - 'partition_allocator/build/linux/sysroot_scripts/install-sysroot.py', - '--arch=mips64el'], - }, - { - 'name': 'sysroot_x64', - 'pattern': '.', - 'condition': 'checkout_linux and checkout_x64', - 'action': [ - 'python3', - 'partition_allocator/build/linux/sysroot_scripts/install-sysroot.py', - '--arch=x64'], - }, - { - # Update the prebuilt clang toolchain. - # Note: On Win, this should run after win_toolchain, as it may use it. - 'name': 'clang', - 'pattern': '.', - 'action': ['python3', 'partition_allocator/tools/clang/scripts/update.py'], - }, -] - -noparent = True - include_rules = [ "+build/build_config.h", "+build/buildflag.h",
diff --git a/base/allocator/partition_allocator/pointers/raw_ptr.h b/base/allocator/partition_allocator/pointers/raw_ptr.h index cb2af20..344d71f 100644 --- a/base/allocator/partition_allocator/pointers/raw_ptr.h +++ b/base/allocator/partition_allocator/pointers/raw_ptr.h
@@ -1224,7 +1224,6 @@ using iterator_category = std::random_access_iterator_tag; }; -#if defined(_LIBCPP_VERSION) // Specialize std::pointer_traits. The latter is required to obtain the // underlying raw pointer in the std::to_address(pointer) overload. // Implementing the pointer_traits is the standard blessed way to customize @@ -1249,7 +1248,6 @@ return p.get(); } }; -#endif // defined(_LIBCPP_VERSION) } // namespace std
diff --git a/base/ranges/algorithm.h b/base/ranges/algorithm.h index 8aedcc7..4f010bd 100644 --- a/base/ranges/algorithm.h +++ b/base/ranges/algorithm.h
@@ -16,6 +16,7 @@ #include "base/cxx20_is_constant_evaluated.h" #include "base/functional/identity.h" #include "base/functional/invoke.h" +#include "base/memory/raw_ptr_exclusion.h" #include "base/ranges/functional.h" #include "base/ranges/ranges.h" @@ -108,9 +109,15 @@ } private: - Pred& pred_; - Proj1& proj1_; - Proj2& proj2_; + // This field is not a raw_ref<> because it was filtered by the rewriter for: + // #constexpr-ctor-field-initializer + RAW_PTR_EXCLUSION Pred& pred_; + // This field is not a raw_ref<> because it was filtered by the rewriter for: + // #constexpr-ctor-field-initializer + RAW_PTR_EXCLUSION Proj1& proj1_; + // This field is not a raw_ref<> because it was filtered by the rewriter for: + // #constexpr-ctor-field-initializer + RAW_PTR_EXCLUSION Proj2& proj2_; }; // Small wrappers around BinaryPredicateProjector to make the calling side more
diff --git a/buildtools/reclient_cfgs/fetch_reclient_cfgs.py b/buildtools/reclient_cfgs/fetch_reclient_cfgs.py index 2cac273f..4f16de2 100755 --- a/buildtools/reclient_cfgs/fetch_reclient_cfgs.py +++ b/buildtools/reclient_cfgs/fetch_reclient_cfgs.py
@@ -69,7 +69,7 @@ return None return m.group(1) -def GenerateReproxyCfg(reproxy_cfg_template, rbe_instance): +def GenerateReproxyCfg(reproxy_cfg_template, rbe_instance, rbe_project): tmpl_path = os.path.join( THIS_DIR, 'reproxy_cfg_templates', reproxy_cfg_template) logging.info(f'generate reproxy.cfg using {tmpl_path}') @@ -88,6 +88,7 @@ depsscanner_address = "" reproxy_cfg = reproxy_cfg_tmpl.substitute({ 'rbe_instance': rbe_instance, + 'rbe_project': rbe_project, 'reproxy_cfg_template': reproxy_cfg_template, 'depsscanner_address': depsscanner_address, }) @@ -130,15 +131,6 @@ logging.basicConfig(level=logging.WARNING if args.quiet else logging.INFO, format="%(message)s") - - if args.reproxy_cfg_template: - if not args.rbe_instance: - logging.error( - '--rbe_instance is required if --reproxy_cfg_template is set') - return 1 - if not GenerateReproxyCfg(args.reproxy_cfg_template, args.rbe_instance): - return 1 - if not args.rewrapper_cfg_project and not args.rbe_instance: logging.error( 'At least one of --rbe_instance and --rewrapper_cfg_project ' @@ -149,6 +141,15 @@ if not args.rewrapper_cfg_project: rbe_project = RbeProjectFromInstance(args.rbe_instance) + if args.reproxy_cfg_template: + if not args.rbe_instance: + logging.error( + '--rbe_instance is required if --reproxy_cfg_template is set') + return 1 + if not GenerateReproxyCfg( + args.reproxy_cfg_template, args.rbe_instance, rbe_project): + return 1 + logging.info('fetch reclient_cfgs for RBE project %s...' % rbe_project) cipd_prefix = posixpath.join(args.cipd_prefix, rbe_project)
diff --git a/buildtools/reclient_cfgs/reproxy_cfg_templates/reproxy.cfg.template b/buildtools/reclient_cfgs/reproxy_cfg_templates/reproxy.cfg.template index bd889f0..118668d 100644 --- a/buildtools/reclient_cfgs/reproxy_cfg_templates/reproxy.cfg.template +++ b/buildtools/reclient_cfgs/reproxy_cfg_templates/reproxy.cfg.template
@@ -20,3 +20,6 @@ # Always compress artifacts compression_threshold=0 use_batches=false + +# Metric metadata +metrics_namespace=$rbe_project
diff --git a/cc/BUILD.gn b/cc/BUILD.gn index c55566a..5314536 100644 --- a/cc/BUILD.gn +++ b/cc/BUILD.gn
@@ -413,6 +413,7 @@ "trees/proxy_impl.h", "trees/proxy_main.cc", "trees/proxy_main.h", + "trees/raster_capabilities.h", "trees/raster_context_provider_wrapper.cc", "trees/raster_context_provider_wrapper.h", "trees/render_frame_metadata.cc",
diff --git a/cc/metrics/compositor_frame_reporter.cc b/cc/metrics/compositor_frame_reporter.cc index d047e73..9c0fb97 100644 --- a/cc/metrics/compositor_frame_reporter.cc +++ b/cc/metrics/compositor_frame_reporter.cc
@@ -1397,6 +1397,10 @@ } } + if (!had_gesture_scrolls) { + return; + } + TRACE_EVENT("input,input.scrolling", "PresentedFrameInformation", [events_metrics = std::cref(events_metrics_), fling_input_count, normal_input_count](perfetto::EventContext& ctx) { @@ -1404,10 +1408,6 @@ normal_input_count, ctx); }); - if (!had_gesture_scrolls) { - return; - } - const auto end_timestamp = viz_breakdown_.presentation_feedback.timestamp; if (global_trackers_.predictor_jank_tracker) { global_trackers_.predictor_jank_tracker->ReportLatestScrollDelta(
diff --git a/cc/raster/raster_buffer_provider.cc b/cc/raster/raster_buffer_provider.cc index fc1c5460..a19fa24d 100644 --- a/cc/raster/raster_buffer_provider.cc +++ b/cc/raster/raster_buffer_provider.cc
@@ -10,6 +10,7 @@ #include "base/trace_event/trace_event.h" #include "cc/raster/raster_source.h" #include "components/viz/common/resources/platform_color.h" +#include "components/viz/common/resources/shared_image_format_utils.h" #include "skia/ext/legacy_display_globals.h" #include "third_party/skia/include/core/SkAlphaType.h" #include "third_party/skia/include/core/SkBlendMode.h"
diff --git a/cc/tiles/tile_manager_unittest.cc b/cc/tiles/tile_manager_unittest.cc index c098d23..5ddbec06 100644 --- a/cc/tiles/tile_manager_unittest.cc +++ b/cc/tiles/tile_manager_unittest.cc
@@ -46,6 +46,7 @@ #include "cc/tiles/tiling_set_raster_queue_all.h" #include "cc/trees/layer_tree_impl.h" #include "components/viz/common/resources/resource_sizes.h" +#include "components/viz/common/resources/shared_image_format_utils.h" #include "components/viz/test/begin_frame_args_test.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h"
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc index c51ac1fa..1f9966e 100644 --- a/cc/trees/layer_tree_host_impl.cc +++ b/cc/trees/layer_tree_host_impl.cc
@@ -112,6 +112,7 @@ #include "components/viz/common/resources/platform_color.h" #include "components/viz/common/resources/resource_format_utils.h" #include "components/viz/common/resources/shared_image_format.h" +#include "components/viz/common/resources/shared_image_format_utils.h" #include "components/viz/common/traced_value.h" #include "components/viz/common/transition_utils.h" #include "gpu/GLES2/gl2extchromium.h" @@ -478,9 +479,7 @@ compositor_frame_reporting_controller_.get()), lcd_text_metrics_reporter_(LCDTextMetricsReporter::CreateIfNeeded(this)), frame_rate_estimator_(GetTaskRunner()), - contains_srgb_cache_(kContainsSrgbCacheSize), - use_dmsaa_for_tiles_( - base::FeatureList::IsEnabled(features::kUseDMSAAForTiles)) { + contains_srgb_cache_(kContainsSrgbCacheSize) { DCHECK(mutator_host_); mutator_host_->SetMutatorHostClient(this); mutator_events_ = mutator_host_->CreateEvents(); @@ -531,6 +530,9 @@ frame_trackers_.set_custom_tracker_results_added_callback( base::BindRepeating(&LayerTreeHostImpl::NotifyThroughputTrackerResults, weak_factory_.GetWeakPtr())); + + raster_caps_.use_dmsaa_for_tiles = + base::FeatureList::IsEnabled(features::kUseDMSAAForTiles); } LayerTreeHostImpl::~LayerTreeHostImpl() { @@ -2001,13 +2003,17 @@ kMinNumberOfSlowPathsForMSAA) { return 0; } - if (!can_use_msaa_) + if (!raster_caps().can_use_msaa) { return 0; + } if (display_list->HasNonAAPaint()) { - UMA_HISTOGRAM_BOOLEAN("GPU.SupportsDisableMsaa", supports_disable_msaa_); - if (!supports_disable_msaa_ || use_dmsaa_for_tiles_) + UMA_HISTOGRAM_BOOLEAN("GPU.SupportsDisableMsaa", + raster_caps().supports_disable_msaa); + if (!raster_caps().supports_disable_msaa || + raster_caps().use_dmsaa_for_tiles) { return 0; + } } return RequestedMSAASampleCount(); @@ -2658,7 +2664,8 @@ draw_mode, layer_tree_frame_sink_, &resource_provider_, // The hud uses Gpu rasterization if the device is capable, not related // to the content of the web page. - gpu_rasterization_status_ != GpuRasterizationStatus::OFF_DEVICE, + raster_caps().gpu_rasterization_status != + GpuRasterizationStatus::OFF_DEVICE, frame->render_passes); } @@ -2867,9 +2874,10 @@ } bool LayerTreeHostImpl::UpdateGpuRasterizationStatus() { - if (!need_update_gpu_rasterization_status_) + if (!raster_caps().need_update_gpu_rasterization_status) { return false; - need_update_gpu_rasterization_status_ = false; + } + raster_caps_.need_update_gpu_rasterization_status = false; // TODO(danakj): Can we avoid having this run when there's no // LayerTreeFrameSink? @@ -2890,23 +2898,26 @@ if (!gpu_rasterization_enabled) { if (gpu_rasterization_supported) - gpu_rasterization_status_ = GpuRasterizationStatus::OFF_FORCED; + raster_caps_.gpu_rasterization_status = + GpuRasterizationStatus::OFF_FORCED; else - gpu_rasterization_status_ = GpuRasterizationStatus::OFF_DEVICE; + raster_caps_.gpu_rasterization_status = + GpuRasterizationStatus::OFF_DEVICE; } else { use_gpu = true; - gpu_rasterization_status_ = GpuRasterizationStatus::ON; + raster_caps_.gpu_rasterization_status = GpuRasterizationStatus::ON; } - if (use_gpu && !use_gpu_rasterization_) { + if (use_gpu && !raster_caps().use_gpu_rasterization) { if (!gpu_rasterization_supported) { // If GPU rasterization is unusable, e.g. if GlContext could not // be created due to losing the GL context, force use of software // raster. use_gpu = false; - can_use_msaa_ = false; - supports_disable_msaa_ = false; - gpu_rasterization_status_ = GpuRasterizationStatus::OFF_DEVICE; + raster_caps_.can_use_msaa = false; + raster_caps_.supports_disable_msaa = false; + raster_caps_.gpu_rasterization_status = + GpuRasterizationStatus::OFF_DEVICE; } } @@ -2914,14 +2925,15 @@ // settings to take effect. But we don't need to trigger any raster // invalidation in this case since these settings change only if the context // changed. In this case we already re-allocate and re-raster all resources. - if (use_gpu == use_gpu_rasterization_ && can_use_msaa == can_use_msaa_ && - supports_disable_msaa == supports_disable_msaa_) { + if (use_gpu == raster_caps().use_gpu_rasterization && + can_use_msaa == raster_caps().can_use_msaa && + supports_disable_msaa == raster_caps().supports_disable_msaa) { return false; } - use_gpu_rasterization_ = use_gpu; - can_use_msaa_ = can_use_msaa; - supports_disable_msaa_ = supports_disable_msaa; + raster_caps_.use_gpu_rasterization = use_gpu; + raster_caps_.can_use_msaa = can_use_msaa; + raster_caps_.supports_disable_msaa = supports_disable_msaa; return true; } @@ -3617,17 +3629,17 @@ void LayerTreeHostImpl::CreateTileManagerResources() { viz::SharedImageFormat tile_format = TileRasterBufferFormat( settings_, layer_tree_frame_sink_->context_provider(), - use_gpu_rasterization_); + raster_caps().use_gpu_rasterization); const bool gpu_compositing = !!layer_tree_frame_sink_->context_provider(); image_decode_cache_holder_ = std::make_unique<ImageDecodeCacheHolder>( - settings_.enable_shared_image_cache_for_gpu, use_gpu_rasterization_, - gpu_compositing, + settings_.enable_shared_image_cache_for_gpu, + raster_caps().use_gpu_rasterization, gpu_compositing, layer_tree_frame_sink_->worker_context_provider_wrapper(), tile_format, - settings_.decoded_image_working_set_budget_bytes, max_texture_size_, - dark_mode_filter_); + settings_.decoded_image_working_set_budget_bytes, + raster_caps().max_texture_size, dark_mode_filter_); - if (use_gpu_rasterization_) { + if (raster_caps().use_gpu_rasterization) { pending_raster_queries_ = std::make_unique<RasterQueryQueue>( layer_tree_frame_sink_->worker_context_provider()); } @@ -3646,10 +3658,11 @@ tile_manager_.SetResources(resource_pool_.get(), GetImageDecodeCache(), task_graph_runner, raster_buffer_provider_.get(), - use_gpu_rasterization_, + raster_caps().use_gpu_rasterization, pending_raster_queries_.get()); tile_manager_.SetCheckerImagingForceDisabled( - settings_.only_checker_images_with_gpu_raster && !use_gpu_rasterization_); + settings_.only_checker_images_with_gpu_raster && + !raster_caps().use_gpu_rasterization); UpdateTileManagerMemoryPolicy(ActualManagedMemoryPolicy()); } @@ -3667,10 +3680,11 @@ viz::RasterContextProvider* worker_context_provider = layer_tree_frame_sink_->worker_context_provider(); - viz::SharedImageFormat tile_format = TileRasterBufferFormat( - settings_, compositor_context_provider, use_gpu_rasterization_); + viz::SharedImageFormat tile_format = + TileRasterBufferFormat(settings_, compositor_context_provider, + raster_caps().use_gpu_rasterization); - if (use_gpu_rasterization_) { + if (raster_caps().use_gpu_rasterization) { DCHECK(worker_context_provider); return std::make_unique<GpuRasterBufferProvider>( @@ -3890,7 +3904,7 @@ // We don't know if the next LayerTreeFrameSink will support GPU // rasterization. Make sure to clear the flag so that we force a // re-computation. - use_gpu_rasterization_ = false; + raster_caps_.use_gpu_rasterization = false; } bool LayerTreeHostImpl::InitializeFrameSink( @@ -3915,13 +3929,13 @@ if (worker_context_provider) { viz::RasterContextProvider::ScopedRasterContextLock scoped_context( worker_context_provider); - max_texture_size_ = + raster_caps_.max_texture_size = worker_context_provider->ContextCapabilities().max_texture_size; } else if (context_provider) { - max_texture_size_ = + raster_caps_.max_texture_size = context_provider->ContextCapabilities().max_texture_size; } else { - max_texture_size_ = settings_.max_render_buffer_bounds_for_sw; + raster_caps_.max_texture_size = settings_.max_render_buffer_bounds_for_sw; } resource_pool_ = std::make_unique<ResourcePool>( @@ -4616,12 +4630,12 @@ // UIResources are assumed to be rastered in SRGB. const gfx::ColorSpace& color_space = gfx::ColorSpace::CreateSRGB(); - if (source_size.width() > max_texture_size_ || - source_size.height() > max_texture_size_) { + if (source_size.width() > raster_caps().max_texture_size || + source_size.height() > raster_caps().max_texture_size) { // Must resize the bitmap to fit within the max texture size. scaled = true; int edge = std::max(source_size.width(), source_size.height()); - float scale = static_cast<float>(max_texture_size_ - 1) / edge; + float scale = static_cast<float>(raster_caps().max_texture_size - 1) / edge; DCHECK_LT(scale, 1.f); upload_size = gfx::ScaleToCeiledSize(source_size, scale, scale); } @@ -4975,7 +4989,7 @@ } void LayerTreeHostImpl::SetNeedUpdateGpuRasterizationStatus() { - need_update_gpu_rasterization_status_ = true; + raster_caps_.need_update_gpu_rasterization_status = true; } void LayerTreeHostImpl::SetElementFilterMutated( @@ -5268,8 +5282,8 @@ paint_worklet_painter_->HasOngoingDispatch()), static_cast<int>(tile_manager_.IsReadyToActivate()), static_cast<int>(GetActivelyScrollingType()), - static_cast<int>(use_gpu_rasterization_), - static_cast<int>(gpu_rasterization_status_), + static_cast<int>(raster_caps().use_gpu_rasterization), + static_cast<int>(raster_caps().gpu_rasterization_status), static_cast<int>(has_valid_layer_tree_frame_sink_), static_cast<int>(layer_tree_frame_sink_ && layer_tree_frame_sink_->context_provider()),
diff --git a/cc/trees/layer_tree_host_impl.h b/cc/trees/layer_tree_host_impl.h index 591bd72..9abb961 100644 --- a/cc/trees/layer_tree_host_impl.h +++ b/cc/trees/layer_tree_host_impl.h
@@ -54,6 +54,7 @@ #include "cc/trees/managed_memory_policy.h" #include "cc/trees/mutator_host_client.h" #include "cc/trees/presentation_time_callback_buffer.h" +#include "cc/trees/raster_capabilities.h" #include "cc/trees/render_frame_metadata.h" #include "cc/trees/task_runner_provider.h" #include "cc/trees/throttle_decider.h" @@ -105,12 +106,6 @@ class UIResourceBitmap; class Viewport; -enum class GpuRasterizationStatus { - ON, - OFF_FORCED, - OFF_DEVICE, -}; - // LayerTreeHost->Proxy callback interface. class LayerTreeHostImplClient { public: @@ -422,7 +417,7 @@ const gfx::PointF& scroll_offset); void SetNeedUpdateGpuRasterizationStatus(); bool NeedUpdateGpuRasterizationStatusForTesting() const { - return need_update_gpu_rasterization_status_; + return raster_caps().need_update_gpu_rasterization_status; } // ProtectedSequenceSynchronizer implementation. @@ -595,7 +590,7 @@ LayerTreeFrameSink* layer_tree_frame_sink() const { return layer_tree_frame_sink_; } - int max_texture_size() const { return max_texture_size_; } + int max_texture_size() const { return raster_caps().max_texture_size; } void ReleaseLayerTreeFrameSink(); int RequestedMSAASampleCount() const; @@ -603,18 +598,22 @@ virtual bool InitializeFrameSink(LayerTreeFrameSink* layer_tree_frame_sink); TileManager* tile_manager() { return &tile_manager_; } + const RasterCapabilities& raster_caps() const { return raster_caps_; } void GetGpuRasterizationCapabilities(bool* gpu_rasterization_enabled, bool* gpu_rasterization_supported, bool* can_use_msaa, bool* supports_disable_msaa); - bool use_gpu_rasterization() const { return use_gpu_rasterization_; } + bool use_gpu_rasterization() const { + return raster_caps().use_gpu_rasterization; + } GpuRasterizationStatus gpu_rasterization_status() const { - return gpu_rasterization_status_; + return raster_caps().gpu_rasterization_status; } bool create_low_res_tiling() const { - return settings_.create_low_res_tiling && !use_gpu_rasterization_; + return settings_.create_low_res_tiling && + !raster_caps().use_gpu_rasterization; } ResourcePool* resource_pool() { return resource_pool_.get(); } ImageAnimationController* image_animation_controller() { @@ -888,7 +887,7 @@ return paint_worklet_tracker_; } - bool can_use_msaa() const { return can_use_msaa_; } + bool can_use_msaa() const { return raster_caps().can_use_msaa; } Viewport& viewport() const { return *viewport_.get(); } @@ -1095,9 +1094,6 @@ // A pointer used for communicating with and submitting output to the display // compositor. raw_ptr<LayerTreeFrameSink> layer_tree_frame_sink_ = nullptr; - // The maximum size (either width or height) that any texture can be. Also - // holds a reasonable value for software compositing bitmaps. - int max_texture_size_ = 0; // The following scoped variables must not outlive the // |layer_tree_frame_sink_|. @@ -1108,13 +1104,8 @@ std::unique_ptr<viz::ContextCacheController::ScopedVisibility> worker_context_visibility_; - bool can_use_msaa_ = false; - bool supports_disable_msaa_ = false; + RasterCapabilities raster_caps_; - bool need_update_gpu_rasterization_status_ = false; - bool use_gpu_rasterization_ = false; - GpuRasterizationStatus gpu_rasterization_status_ = - GpuRasterizationStatus::OFF_DEVICE; std::unique_ptr<RasterBufferProvider> raster_buffer_provider_; std::unique_ptr<ResourcePool> resource_pool_; std::unique_ptr<RasterQueryQueue> pending_raster_queries_; @@ -1334,8 +1325,6 @@ bool downsample_metrics_ = true; base::MetricsSubSampler metrics_subsampler_; - const bool use_dmsaa_for_tiles_; - // Must be the last member to ensure this is destroyed first in the // destruction order and invalidates all weak pointers. base::WeakPtrFactory<LayerTreeHostImpl> weak_factory_{this};
diff --git a/cc/trees/raster_capabilities.h b/cc/trees/raster_capabilities.h new file mode 100644 index 0000000..b2400f8 --- /dev/null +++ b/cc/trees/raster_capabilities.h
@@ -0,0 +1,38 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CC_TREES_RASTER_CAPABILITIES_H_ +#define CC_TREES_RASTER_CAPABILITIES_H_ + +#include "cc/cc_export.h" + +namespace cc { + +enum class GpuRasterizationStatus { + ON, + OFF_FORCED, + OFF_DEVICE, +}; + +struct CC_EXPORT RasterCapabilities { + RasterCapabilities() = default; + RasterCapabilities(const RasterCapabilities& other) = delete; + RasterCapabilities& operator=(const RasterCapabilities& other) = delete; + ~RasterCapabilities() = default; + + bool can_use_msaa = false; + bool supports_disable_msaa = false; + + bool need_update_gpu_rasterization_status = false; + bool use_gpu_rasterization = false; + GpuRasterizationStatus gpu_rasterization_status = + GpuRasterizationStatus::OFF_DEVICE; + // The maximum size (either width or height) that any texture can be. Also + // holds a reasonable value for software compositing bitmaps. + int max_texture_size = 0; + bool use_dmsaa_for_tiles = false; +}; +} // namespace cc + +#endif // CC_TREES_RASTER_CAPABILITIES_H_
diff --git a/chrome/MAJOR_BRANCH_DATE b/chrome/MAJOR_BRANCH_DATE index 98172b2..3864530 100644 --- a/chrome/MAJOR_BRANCH_DATE +++ b/chrome/MAJOR_BRANCH_DATE
@@ -1 +1 @@ -MAJOR_BRANCH_DATE=2023-04-26 +MAJOR_BRANCH_DATE=2023-05-24
diff --git a/chrome/VERSION b/chrome/VERSION index c0f5bc0e..db9949f0 100644 --- a/chrome/VERSION +++ b/chrome/VERSION
@@ -1,4 +1,4 @@ -MAJOR=115 +MAJOR=116 MINOR=0 -BUILD=5790 +BUILD=5791 PATCH=0
diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn index 6b36b78..d704a1d 100644 --- a/chrome/android/BUILD.gn +++ b/chrome/android/BUILD.gn
@@ -978,6 +978,7 @@ "//chrome/browser/tabpersistence:junit", "//chrome/browser/thumbnail:java", "//chrome/browser/touch_to_fill/common/android:junit", + "//chrome/browser/touch_to_fill/password_generation/android/internal:junit", "//chrome/browser/touch_to_fill/payments/android/internal:junit", "//chrome/browser/ui/android/appmenu:java", "//chrome/browser/ui/android/appmenu/internal:junit",
diff --git a/chrome/app/app_management_strings.grdp b/chrome/app/app_management_strings.grdp index 0102d22..4d5fc8672 100644 --- a/chrome/app/app_management_strings.grdp +++ b/chrome/app/app_management_strings.grdp
@@ -203,4 +203,7 @@ other {Supported file types: <ph name="FILE_TYPE1">{FILE_TYPE1}<ex>TXT</ex></ph>, <ph name="FILE_TYPE2">{FILE_TYPE2}<ex>CSV</ex></ph>, <ph name="FILE_TYPE3">{FILE_TYPE3}<ex>DOC</ex></ph>, <ph name="FILE_TYPE4">{FILE_TYPE4}<ex>DOCX</ex></ph> (<ph name="LINK"><a href="{LINK}"></ph>and {OVERFLOW_COUNT} more<ph name="END_LINK"></a></ph>)} } </message> + <message name="IDS_APP_MANAGEMENT_SUB_APPS_LIST_HEADING" desc="Label for the sub-app section in an app's settings page. The section lists all sub-applications that got installed by the current app. These sub-applications might be installed locally, or streamed from a remote location via the parent app."> + Installed and streamed applications from <ph name="APP_NAME">$1<ex>Citrix</ex></ph> + </message> </grit-part>
diff --git a/chrome/app/app_management_strings_grdp/IDS_APP_MANAGEMENT_SUB_APPS_LIST_HEADING.png.sha1 b/chrome/app/app_management_strings_grdp/IDS_APP_MANAGEMENT_SUB_APPS_LIST_HEADING.png.sha1 new file mode 100644 index 0000000..1ea558ec2 --- /dev/null +++ b/chrome/app/app_management_strings_grdp/IDS_APP_MANAGEMENT_SUB_APPS_LIST_HEADING.png.sha1
@@ -0,0 +1 @@ +895fe2c3ac5ae1c489d17eaf1da7460c43cee01d \ No newline at end of file
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index 23a0a0e..9aa7af3e 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc
@@ -7603,6 +7603,10 @@ #endif // BUILDFLAG(IS_ANDROID) + {"use-client-gmb-interface", flag_descriptions::kUseClientGmbInterfaceName, + flag_descriptions::kUseClientGmbInterfaceDescription, kOsAll, + FEATURE_VALUE_TYPE(features::kUseClientGmbInterface)}, + #if BUILDFLAG(IS_ANDROID) {"use-toast-manager", flag_descriptions::kUseToastManagerName, flag_descriptions::kUseToastManagerDescription, kOsAndroid,
diff --git a/chrome/browser/ash/browser_context_keyed_service_factories.cc b/chrome/browser/ash/browser_context_keyed_service_factories.cc index 979c3f3..c11ff2fd 100644 --- a/chrome/browser/ash/browser_context_keyed_service_factories.cc +++ b/chrome/browser/ash/browser_context_keyed_service_factories.cc
@@ -48,6 +48,7 @@ #include "chrome/browser/ash/file_system_provider/service_factory.h" #include "chrome/browser/ash/fileapi/file_change_service_factory.h" #include "chrome/browser/ash/fileapi/recent_model_factory.h" +#include "chrome/browser/ash/floating_workspace/floating_workspace_service_factory.h" #include "chrome/browser/ash/guest_os/guest_os_mime_types_service_factory.h" #include "chrome/browser/ash/guest_os/guest_os_registry_service_factory.h" #include "chrome/browser/ash/guest_os/guest_os_session_tracker_factory.h" @@ -193,6 +194,7 @@ file_manager::EventRouterFactory::GetInstance(); file_manager::VolumeManagerFactory::GetInstance(); file_system_provider::ServiceFactory::GetInstance(); + FloatingWorkspaceServiceFactory::GetInstance(); full_restore::FullRestoreServiceFactory::GetInstance(); GlanceablesKeyedServiceFactory::GetInstance(); guest_os::GuestOsMimeTypesServiceFactory::GetInstance();
diff --git a/chrome/browser/ash/crosapi/web_app_provider_bridge_browsertest.cc b/chrome/browser/ash/crosapi/web_app_provider_bridge_browsertest.cc index 1375df2..2b42f24b 100644 --- a/chrome/browser/ash/crosapi/web_app_provider_bridge_browsertest.cc +++ b/chrome/browser/ash/crosapi/web_app_provider_bridge_browsertest.cc
@@ -1,6 +1,7 @@ // Copyright 2023 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "ash_requires_lacros_browsertestbase.h" #include "base/test/bind.h" #include "base/test/test_future.h" #include "chrome/browser/ash/crosapi/ash_requires_lacros_browsertestbase.h" @@ -17,6 +18,13 @@ class WebAppProviderBridgeBrowserTest : public AshRequiresLacrosBrowserTestBase { protected: + void SetUp() override { + if (!HasLacrosArgument()) { + GTEST_SKIP() << "Skipping test class because Lacros is not enabled"; + } + AshRequiresLacrosBrowserTestBase::SetUp(); + } + web_app::AppId InstallWebApp(const std::string& start_url, apps::WindowMode mode) { crosapi::mojom::StandaloneBrowserTestControllerAsyncWaiter waiter( @@ -43,10 +51,6 @@ }; IN_PROC_BROWSER_TEST_F(WebAppProviderBridgeBrowserTest, GetSubAppIds) { - if (!HasLacrosArgument()) { - return; - } - web_app::AppId parent_app_id = InstallWebApp("https://www.parent-app.com", apps::WindowMode::kWindow); web_app::AppId sub_app_id_1 = @@ -75,5 +79,39 @@ EXPECT_EQ(2u, results_set.size()); EXPECT_EQ(results_set, expected); } + +IN_PROC_BROWSER_TEST_F(WebAppProviderBridgeBrowserTest, GetSubAppToParentMap) { + web_app::AppId parent_app_id = + InstallWebApp("https://www.parent-app.com", apps::WindowMode::kWindow); + web_app::AppId sub_app_id_1 = + InstallSubApp(parent_app_id, "https://www.parent-app.com/sub-app-1"); + web_app::AppId sub_app_id_2 = + InstallSubApp(parent_app_id, "https://www.parent-app.com/sub-app-2"); + // This app should not appear at all in the result map. + web_app::AppId unrelated_app_id = + InstallWebApp("https://www.unrelated-app.com", apps::WindowMode::kWindow); + + base::flat_map<web_app::AppId, web_app::AppId> expected; + expected[sub_app_id_1] = parent_app_id; + expected[sub_app_id_2] = parent_app_id; + + crosapi::mojom::WebAppProviderBridge* web_app_provider_bridge = + crosapi::CrosapiManager::Get() + ->crosapi_ash() + ->web_app_service_ash() + ->GetWebAppProviderBridge(); + ASSERT_TRUE(web_app_provider_bridge); + + base::test::TestFuture<const base::flat_map<web_app::AppId, web_app::AppId>&> + get_sub_apps_to_parent_map_future; + + web_app_provider_bridge->GetSubAppToParentMap( + get_sub_apps_to_parent_map_future.GetCallback()); + + base::flat_map<web_app::AppId, web_app::AppId> results{ + get_sub_apps_to_parent_map_future.Get()}; + EXPECT_EQ(2u, results.size()); + EXPECT_EQ(results, expected); +} } // namespace } // namespace crosapi
diff --git a/chrome/browser/ash/extensions/file_manager/drivefs_event_router.cc b/chrome/browser/ash/extensions/file_manager/drivefs_event_router.cc index 03a3c500..268599d 100644 --- a/chrome/browser/ash/extensions/file_manager/drivefs_event_router.cc +++ b/chrome/browser/ash/extensions/file_manager/drivefs_event_router.cc
@@ -10,6 +10,7 @@ #include "base/notreached.h" #include "base/strings/strcat.h" #include "base/values.h" +#include "chrome/browser/ash/drive/file_system_util.h" #include "chrome/browser/ash/extensions/file_manager/private_api_util.h" #include "chrome/common/extensions/api/file_manager_private.h" #include "chromeos/ash/components/drivefs/drivefs_pin_manager.h" @@ -45,8 +46,9 @@ } // namespace DriveFsEventRouter::DriveFsEventRouter( + Profile* profile, SystemNotificationManager* notification_manager) - : notification_manager_(notification_manager) {} + : notification_manager_(notification_manager), profile_(profile) {} DriveFsEventRouter::~DriveFsEventRouter() = default; DriveFsEventRouter::SyncingStatusState::SyncingStatusState() = default; @@ -75,6 +77,8 @@ BroadcastTransferEvent(kPinEvent, pin_status); } + path_to_sync_state_.clear(); + dialog_callback_.Reset(); } @@ -147,6 +151,66 @@ pin_status_state_); } +void DriveFsEventRouter::OnItemProgress( + const drivefs::mojom::ProgressEvent& event) { + if (!ash::features::IsInlineSyncStatusProgressEventsEnabled()) { + return; + } + const std::string path = event.path; + + drivefs::SyncStatus status; + if (event.progress == 0) { + status = drivefs::SyncStatus::kQueued; + } else if (event.progress == 100) { + status = drivefs::SyncStatus::kCompleted; + } else { + status = drivefs::SyncStatus::kInProgress; + } + + std::vector<const drivefs::SyncState> filtered_states; + + filtered_states.emplace_back( + drivefs::SyncState{status, static_cast<float>(event.progress) / 100.0f, + base::FilePath(path)}); + + if (status == drivefs::SyncStatus::kCompleted) { + const auto previous_state_iter = path_to_sync_state_.find(path); + const bool was_tracked = previous_state_iter != path_to_sync_state_.end(); + if (was_tracked) { + // Stop tracking completed events but push it to subscribers. + path_to_sync_state_.erase(previous_state_iter); + } else { + // If path wasn't tracked in the first place, don't report its completed + // event to subscribers. + return; + } + } else { + path_to_sync_state_[path] = filtered_states.back(); + } + + std::vector<IndividualFileTransferStatus> statuses; + std::vector<base::FilePath> paths; + + for (const auto& sync_state : filtered_states) { + IndividualFileTransferStatus individual_status; + individual_status.sync_status = ConvertSyncStatus(sync_state.status); + individual_status.progress = sync_state.progress; + statuses.emplace_back(std::move(individual_status)); + paths.emplace_back(sync_state.path); + } + + for (const GURL& url : GetEventListenerURLs(kIndividualTransferEventName)) { + const auto file_urls = ConvertPathsToFileSystemUrls(paths, url); + for (size_t i = 0; i < file_urls.size(); i++) { + statuses[i].file_url = file_urls[i].spec(); + } + // Note: Inline Sync Statuses don't need to differentiate between transfer + // and pin events because they do not display aggregate progress separately + // for each of those two categories. + BroadcastIndividualTransfersEvent(kTransferEvent, statuses); + } +} + void DriveFsEventRouter::BroadcastAggregateTransferEventForItems( const std::vector<const drivefs::mojom::ItemEvent*>& items, const extensions::events::HistogramValue& event_type, @@ -418,4 +482,16 @@ file_manager_private::OnDirectoryChanged::Create(event)); } +drivefs::SyncState DriveFsEventRouter::GetDriveSyncStateForPath( + const base::FilePath& drive_path) { + if (!ash::features::IsInlineSyncStatusProgressEventsEnabled()) { + return drivefs::SyncState::CreateNotFound(drive_path); + } + const auto it = path_to_sync_state_.find(drive_path.AsUTF8Unsafe()); + if (it == path_to_sync_state_.end()) { + return drivefs::SyncState::CreateNotFound(drive_path); + } + return it->second; +} + } // namespace file_manager
diff --git a/chrome/browser/ash/extensions/file_manager/drivefs_event_router.h b/chrome/browser/ash/extensions/file_manager/drivefs_event_router.h index 0ffaa4f..034db30 100644 --- a/chrome/browser/ash/extensions/file_manager/drivefs_event_router.h +++ b/chrome/browser/ash/extensions/file_manager/drivefs_event_router.h
@@ -46,7 +46,8 @@ class DriveFsEventRouter : public drivefs::DriveFsHostObserver, public drive::DriveIntegrationServiceObserver { public: - explicit DriveFsEventRouter(SystemNotificationManager* notification_manager); + DriveFsEventRouter(Profile* profile, + SystemNotificationManager* notification_manager); DriveFsEventRouter(const DriveFsEventRouter&) = delete; ~DriveFsEventRouter() override; @@ -67,6 +68,8 @@ void SuppressNotificationsForFilePath(const base::FilePath& path); void RestoreNotificationsForFilePath(const base::FilePath& path); + drivefs::SyncState GetDriveSyncStateForPath(const base::FilePath& drive_path); + protected: SystemNotificationManager* system_notification_manager() { return notification_manager_; @@ -97,6 +100,7 @@ void OnFilesChanged( const std::vector<drivefs::mojom::FileChange>& changes) override; void OnError(const drivefs::mojom::DriveError& error) override; + void OnItemProgress(const drivefs::mojom::ProgressEvent& event) override; // DriveIntegrationServiceObserver: void OnBulkPinProgress(const drivefs::pinning::Progress& progress) override; @@ -158,6 +162,9 @@ std::set<base::FilePath> ignored_file_paths_; base::OnceCallback<void(drivefs::mojom::DialogResult)> dialog_callback_; + std::map<std::string, drivefs::SyncState> path_to_sync_state_; + raw_ptr<Profile> profile_; + base::WeakPtrFactory<DriveFsEventRouter> weak_ptr_factory_{this}; };
diff --git a/chrome/browser/ash/extensions/file_manager/drivefs_event_router_unittest.cc b/chrome/browser/ash/extensions/file_manager/drivefs_event_router_unittest.cc index 8df442f..2bf9b08 100644 --- a/chrome/browser/ash/extensions/file_manager/drivefs_event_router_unittest.cc +++ b/chrome/browser/ash/extensions/file_manager/drivefs_event_router_unittest.cc
@@ -127,7 +127,9 @@ class TestDriveFsEventRouter : public DriveFsEventRouter { public: - TestDriveFsEventRouter() : DriveFsEventRouter(nullptr) { + TestDriveFsEventRouter() + : DriveFsEventRouter(/*profile=*/nullptr, + /*notification_manager=*/nullptr) { ON_CALL(*this, IsPathWatched).WillByDefault(testing::Return(true)); ON_CALL(*this, GetEventListenerURLs) .WillByDefault(testing::Return(std::set<GURL>{
diff --git a/chrome/browser/ash/extensions/file_manager/event_router.cc b/chrome/browser/ash/extensions/file_manager/event_router.cc index 382bf227..72fa7fd 100644 --- a/chrome/browser/ash/extensions/file_manager/event_router.cc +++ b/chrome/browser/ash/extensions/file_manager/event_router.cc
@@ -363,7 +363,7 @@ Profile* profile, const std::map<base::FilePath, std::unique_ptr<FileWatcher>>* file_watchers) - : DriveFsEventRouter(notification_manager), + : DriveFsEventRouter(profile, notification_manager), profile_(profile), file_watchers_(file_watchers) {} @@ -1430,4 +1430,9 @@ file_manager_private::OnMountableGuestsChanged::Create(guests)); } +drivefs::SyncState EventRouter::GetDriveSyncStateForPath( + const base::FilePath& drive_path) { + return drivefs_event_router_->GetDriveSyncStateForPath(drive_path); +} + } // namespace file_manager
diff --git a/chrome/browser/ash/extensions/file_manager/event_router.h b/chrome/browser/ash/extensions/file_manager/event_router.h index 8bb4280..78b061b 100644 --- a/chrome/browser/ash/extensions/file_manager/event_router.h +++ b/chrome/browser/ash/extensions/file_manager/event_router.h
@@ -32,6 +32,7 @@ #include "chrome/browser/ash/guest_os/public/guest_os_mount_provider_registry.h" #include "chrome/common/extensions/api/file_manager_private.h" #include "chromeos/ash/components/disks/disk_mount_manager.h" +#include "chromeos/ash/components/drivefs/sync_status_tracker.h" #include "chromeos/ash/components/settings/timezone_settings.h" #include "components/arc/intent_helper/arc_intent_helper_observer.h" #include "components/keyed_service/core/keyed_service.h" @@ -197,6 +198,8 @@ // Broadcast to Files app frontend that file tasks might have changed. void BroadcastOnAppsUpdatedEvent(); + drivefs::SyncState GetDriveSyncStateForPath(const base::FilePath& drive_path); + // Use this method for unit tests to bypass checking if there are any SWA // windows. void ForceBroadcastingForTesting(bool enabled) {
diff --git a/chrome/browser/ash/extensions/file_manager/private_api_util.cc b/chrome/browser/ash/extensions/file_manager/private_api_util.cc index 8d116797..635c678 100644 --- a/chrome/browser/ash/extensions/file_manager/private_api_util.cc +++ b/chrome/browser/ash/extensions/file_manager/private_api_util.cc
@@ -18,6 +18,8 @@ #include "base/task/single_thread_task_runner.h" #include "chrome/browser/ash/drive/drive_integration_service.h" #include "chrome/browser/ash/drive/file_system_util.h" +#include "chrome/browser/ash/extensions/file_manager/event_router.h" +#include "chrome/browser/ash/extensions/file_manager/event_router_factory.h" #include "chrome/browser/ash/file_manager/app_id.h" #include "chrome/browser/ash/file_manager/fileapi_util.h" #include "chrome/browser/ash/file_manager/filesystem_api_util.h" @@ -360,9 +362,13 @@ return; } - if (base::FeatureList::IsEnabled(ash::features::kFilesInlineSyncStatus)) { + file_manager::EventRouter* event_router = + file_manager::EventRouterFactory::GetForProfile(running_profile_); + if (ash::features::IsInlineSyncStatusEnabled() && event_router) { drivefs::SyncState sync_state = - integration_service->GetSyncStateForPath(file_system_url_.path()); + ash::features::IsInlineSyncStatusProgressEventsEnabled() + ? event_router->GetDriveSyncStateForPath(file_system_url_.path()) + : integration_service->GetSyncStateForPath(file_system_url_.path()); properties_->progress = sync_state.progress; switch (sync_state.status) { case drivefs::SyncStatus::kQueued:
diff --git a/chrome/browser/ash/extensions/file_manager/system_notification_manager.cc b/chrome/browser/ash/extensions/file_manager/system_notification_manager.cc index 5f50fdf..99974b7 100644 --- a/chrome/browser/ash/extensions/file_manager/system_notification_manager.cc +++ b/chrome/browser/ash/extensions/file_manager/system_notification_manager.cc
@@ -39,6 +39,7 @@ #include "third_party/abseil-cpp/absl/types/optional.h" #include "ui/base/l10n/l10n_util.h" #include "ui/chromeos/strings/grit/ui_chromeos_strings.h" +#include "ui/message_center/public/cpp/notification.h" namespace { @@ -505,6 +506,24 @@ } } +static const char kBulkPinningNotificationId[] = "drive-bulk-pinning-error"; + +void SystemNotificationManager::HandleBulkPinningNotificationClick( + absl::optional<int> button_index) { + if (button_index.has_value()) { + VLOG(1) << "Click on button #" << *button_index; + if (*button_index == 1) { + chrome::SettingsWindowManager::GetInstance()->ShowOSSettings( + profile_, chromeos::settings::mojom::kGoogleDriveSubpagePath); + } + } else { + VLOG(1) << "Click on notification"; + } + + GetNotificationDisplayService()->Close(NotificationHandler::Type::TRANSIENT, + kBulkPinningNotificationId); +} + NotificationPtr SystemNotificationManager::MakeBulkPinningErrorNotification( const Event& event) { // Parse the event args as a bulk-pinning progress struct. @@ -528,9 +547,27 @@ // Not enough space for bulk-pinning. VLOG(1) << "Creating bulk-pinning error notification"; - return CreateNotification( - "drive-bulk-pinning-error", IDS_FILE_BROWSER_DRIVE_SYNC_ERROR_TITLE, - IDS_FILE_BROWSER_BULK_PINNING_NOT_ENOUGH_SPACE_NOTIFICATION); + + // Create notification. + NotificationPtr notification = CreateSystemNotification( + kBulkPinningNotificationId, + GetStringUTF16(IDS_FILE_BROWSER_DRIVE_SYNC_ERROR_TITLE), + GetStringUTF16( + IDS_FILE_BROWSER_BULK_PINNING_NOT_ENOUGH_SPACE_NOTIFICATION), + MakeRefCounted<HandleNotificationClickDelegate>(BindRepeating( + &SystemNotificationManager::HandleBulkPinningNotificationClick, + weak_ptr_factory_.GetWeakPtr()))); + + // Add buttons to the notification. + std::vector<ButtonInfo> buttons; + buttons.reserve(2); + ButtonInfo& dismiss_button = + buttons.emplace_back(GetStringUTF16(IDS_FILE_BROWSER_DISMISS_LABEL)); + dismiss_button.type = message_center::ButtonType::DISMISS; + buttons.emplace_back(GetStringUTF16(IDS_FILE_BROWSER_SETTINGS_LABEL)); + notification->set_buttons(std::move(buttons)); + + return notification; } NotificationPtr SystemNotificationManager::MakeDriveSyncErrorNotification(
diff --git a/chrome/browser/ash/extensions/file_manager/system_notification_manager.h b/chrome/browser/ash/extensions/file_manager/system_notification_manager.h index 3fcdadd9..abba8dc 100644 --- a/chrome/browser/ash/extensions/file_manager/system_notification_manager.h +++ b/chrome/browser/ash/extensions/file_manager/system_notification_manager.h
@@ -194,6 +194,9 @@ file_manager::io_task::IOTaskController* io_task_controller); private: + // Handles clicks on the DriveFS bulk-pinning error notification. + void HandleBulkPinningNotificationClick(absl::optional<int> button_index); + // Make notification for DriveFS bulk-pinning error. NotificationPtr MakeBulkPinningErrorNotification(const Event& event);
diff --git a/chrome/browser/ash/file_manager/file_manager_browsertest_base.cc b/chrome/browser/ash/file_manager/file_manager_browsertest_base.cc index 0716d1b..f3c8899 100644 --- a/chrome/browser/ash/file_manager/file_manager_browsertest_base.cc +++ b/chrome/browser/ash/file_manager/file_manager_browsertest_base.cc
@@ -3383,7 +3383,8 @@ } if (name == "isInlineSyncStatusProgressEventsEnabled") { - *output = options.enable_inline_sync_status_progress_events ? "true" : "false"; + *output = + options.enable_inline_sync_status_progress_events ? "true" : "false"; return; }
diff --git a/chrome/browser/ash/file_manager/file_manager_browsertest_base.h b/chrome/browser/ash/file_manager/file_manager_browsertest_base.h index fc16e5a9..5ac7516 100644 --- a/chrome/browser/ash/file_manager/file_manager_browsertest_base.h +++ b/chrome/browser/ash/file_manager/file_manager_browsertest_base.h
@@ -158,7 +158,8 @@ // Whether test should run with the FilesInlineSyncStatus flag. bool enable_inline_sync_status = false; - // Whether test should run with the FilesInlineSyncStatusProgressEvents flag. + // Whether test should run with the FilesInlineSyncStatusProgressEvents + // flag. bool enable_inline_sync_status_progress_events = false; // Whether test should enable the file transfer connector.
diff --git a/chrome/browser/ash/file_manager/file_manager_string_util.cc b/chrome/browser/ash/file_manager/file_manager_string_util.cc index fd8992a..a25189f 100644 --- a/chrome/browser/ash/file_manager/file_manager_string_util.cc +++ b/chrome/browser/ash/file_manager/file_manager_string_util.cc
@@ -384,6 +384,8 @@ SET_STRING("COMPLETE_LABEL", IDS_FILE_BROWSER_COMPLETE_LABEL); SET_STRING("QUEUED_LABEL", IDS_FILE_BROWSER_QUEUED_LABEL); SET_STRING("IN_PROGRESS_LABEL", IDS_FILE_BROWSER_IN_PROGRESS_LABEL); + SET_STRING("IN_PROGRESS_PERCENTAGE_LABEL", + IDS_FILE_BROWSER_IN_PROGRESS_PERCENTAGE_LABEL); SET_STRING("CONFIGURE_VOLUME_BUTTON_LABEL", IDS_FILE_BROWSER_CONFIGURE_VOLUME_BUTTON_LABEL); SET_STRING("CONFIRM_MOBILE_DATA_USE",
diff --git a/chrome/browser/ash/policy/core/device_attributes_fake.h b/chrome/browser/ash/policy/core/device_attributes_fake.h index 15d23e1..585a787 100644 --- a/chrome/browser/ash/policy/core/device_attributes_fake.h +++ b/chrome/browser/ash/policy/core/device_attributes_fake.h
@@ -83,7 +83,6 @@ std::string fake_enterprise_enrollment_domain_; std::string fake_enterprise_domain_manager_; std::string fake_sso_profile_; - std::string fake_realm_; std::string fake_device_asset_id_; std::string fake_device_serial_number_; std::string fake_machine_name_;
diff --git a/chrome/browser/ash/policy/core/device_cloud_policy_manager_ash.h b/chrome/browser/ash/policy/core/device_cloud_policy_manager_ash.h index 6c27f48a..f1f2538 100644 --- a/chrome/browser/ash/policy/core/device_cloud_policy_manager_ash.h +++ b/chrome/browser/ash/policy/core/device_cloud_policy_manager_ash.h
@@ -198,7 +198,6 @@ void OnStateKeysUpdated(); void NotifyConnected(); - void NotifyDisconnected(); void NotifyGotRegistry(); // Factory function to create the StatusUploader.
diff --git a/chrome/browser/ash/policy/enrollment/enrollment_handler.cc b/chrome/browser/ash/policy/enrollment/enrollment_handler.cc index ccedbc22..4b01becd 100644 --- a/chrome/browser/ash/policy/enrollment/enrollment_handler.cc +++ b/chrome/browser/ash/policy/enrollment/enrollment_handler.cc
@@ -19,7 +19,6 @@ #include "base/time/time.h" #include "chrome/browser/ash/ownership/owner_settings_service_ash.h" #include "chrome/browser/ash/policy/core/device_cloud_policy_store_ash.h" -#include "chrome/browser/ash/policy/core/dm_token_storage.h" #include "chrome/browser/ash/policy/dev_mode/dev_mode_policy_util.h" #include "chrome/browser/ash/policy/enrollment/auto_enrollment_type_checker.h" #include "chrome/browser/ash/policy/enrollment/enrollment_config.h"
diff --git a/chrome/browser/ash/policy/enrollment/enrollment_handler.h b/chrome/browser/ash/policy/enrollment/enrollment_handler.h index 0387b8d..9d831e5 100644 --- a/chrome/browser/ash/policy/enrollment/enrollment_handler.h +++ b/chrome/browser/ash/policy/enrollment/enrollment_handler.h
@@ -41,7 +41,6 @@ namespace policy { class DeviceCloudPolicyStoreAsh; -class DMTokenStorage; class EnrollmentStatus; class ServerBackedStateKeysBroker; class SigningService; @@ -212,7 +211,6 @@ std::unique_ptr<CloudPolicyClient> client_; scoped_refptr<base::SequencedTaskRunner> background_task_runner_; std::unique_ptr<DeviceAccountInitializer> device_account_initializer_; - std::unique_ptr<DMTokenStorage> dm_token_storage_; EnrollmentConfig enrollment_config_; DMAuth dm_auth_;
diff --git a/chrome/browser/ash/preferences.cc b/chrome/browser/ash/preferences.cc index d1c5b05..600b158 100644 --- a/chrome/browser/ash/preferences.cc +++ b/chrome/browser/ash/preferences.cc
@@ -593,6 +593,8 @@ false); registry->RegisterBooleanPref(prefs::kShowDisplaySizeScreenEnabled, true); + + registry->RegisterDictionaryPref(::prefs::kTotalUniqueOsSettingsChanged); } void Preferences::InitUserPrefs(sync_preferences::PrefServiceSyncable* prefs) {
diff --git a/chrome/browser/ash/release_notes/release_notes_storage.cc b/chrome/browser/ash/release_notes/release_notes_storage.cc index 83b57598..b4b11709 100644 --- a/chrome/browser/ash/release_notes/release_notes_storage.cc +++ b/chrome/browser/ash/release_notes/release_notes_storage.cc
@@ -28,7 +28,7 @@ // This stores the latest milestone with new Release Notes content. If the last // milestone the user has seen the notification is before this, a new // notification will be shown. -constexpr int kLastChromeVersionWithReleaseNotes = 114; +constexpr int kLastChromeVersionWithReleaseNotes = 116; constexpr int kTimesToShowSuggestionChip = 3; int GetMilestone() {
diff --git a/chrome/browser/chromeos/extensions/smart_card_provider_private/smart_card_provider_private_api.cc b/chrome/browser/chromeos/extensions/smart_card_provider_private/smart_card_provider_private_api.cc index 1de1619..21162e32 100644 --- a/chrome/browser/chromeos/extensions/smart_card_provider_private/smart_card_provider_private_api.cc +++ b/chrome/browser/chromeos/extensions/smart_card_provider_private/smart_card_provider_private_api.cc
@@ -475,7 +475,7 @@ device::mojom::SmartCardDisposition disposition, DisconnectCallback callback) { auto process_result = - base::BindOnce(&SmartCardProviderPrivateAPI::ProcessDisconnectResult, + base::BindOnce(&SmartCardProviderPrivateAPI::ProcessPlainResult, weak_ptr_factory_.GetWeakPtr()); DispatchEventWithTimeout( @@ -681,12 +681,13 @@ .Run(std::move(status_change_result)); } -void SmartCardProviderPrivateAPI::ProcessCancelResult( +void SmartCardProviderPrivateAPI::ProcessPlainResult( ResultArgs result_args, SmartCardResultPtr result, SmartCardCallback callback) { - CHECK(std::holds_alternative<CancelCallback>(callback)); - std::move(std::get<CancelCallback>(callback)).Run(std::move(result)); + CHECK(std::holds_alternative<std::monostate>(result_args)); + CHECK(std::holds_alternative<PlainCallback>(callback)); + std::move(std::get<PlainCallback>(callback)).Run(std::move(result)); } device::mojom::SmartCardConnectResultPtr @@ -772,14 +773,6 @@ std::move(task).Run(); } -void SmartCardProviderPrivateAPI::ProcessDisconnectResult( - ResultArgs result_args, - device::mojom::SmartCardResultPtr result, - SmartCardCallback callback) { - CHECK(std::holds_alternative<DisconnectCallback>(callback)); - std::move(std::get<DisconnectCallback>(callback)).Run(std::move(result)); -} - void SmartCardProviderPrivateAPI::ProcessDataResult( ResultArgs result_args, device::mojom::SmartCardResultPtr result, @@ -967,7 +960,7 @@ CHECK(!scard_context.is_null()); auto process_result = - base::BindOnce(&SmartCardProviderPrivateAPI::ProcessCancelResult, + base::BindOnce(&SmartCardProviderPrivateAPI::ProcessPlainResult, weak_ptr_factory_.GetWeakPtr()); DispatchEventWithTimeout( @@ -1220,13 +1213,7 @@ ProviderResultCodeToSmartCardResult(params->result_code)) REPORT_RESULT_FUNCTION_IMPL( - Cancel, - ReportResult, - std::monostate(), - ProviderResultCodeToSmartCardResult(params->result_code)) - -REPORT_RESULT_FUNCTION_IMPL( - Disconnect, + Plain, ReportResult, std::monostate(), ProviderResultCodeToSmartCardResult(params->result_code))
diff --git a/chrome/browser/chromeos/extensions/smart_card_provider_private/smart_card_provider_private_api.h b/chrome/browser/chromeos/extensions/smart_card_provider_private/smart_card_provider_private_api.h index ec67d51..971bfaa 100644 --- a/chrome/browser/chromeos/extensions/smart_card_provider_private/smart_card_provider_private_api.h +++ b/chrome/browser/chromeos/extensions/smart_card_provider_private/smart_card_provider_private_api.h
@@ -52,14 +52,17 @@ using DataCallback = base::OnceCallback<void(device::mojom::SmartCardDataResultPtr)>; - using SmartCardCallback = std::variant< - // Cancel, Disconnect - base::OnceCallback<void(device::mojom::SmartCardResultPtr)>, - ListReadersCallback, - GetStatusChangeCallback, - ConnectCallback, - CreateContextCallback, - DataCallback>; + // Common to Cancel, Disconnect, SetAttrib, BeginTransaction and + // EndTransaction + using PlainCallback = + base::OnceCallback<void(device::mojom::SmartCardResultPtr)>; + + using SmartCardCallback = std::variant<PlainCallback, + ListReadersCallback, + GetStatusChangeCallback, + ConnectCallback, + CreateContextCallback, + DataCallback>; using ProcessResultCallback = base::OnceCallback< void(ResultArgs, device::mojom::SmartCardResultPtr, SmartCardCallback)>; @@ -137,16 +140,13 @@ void ProcessGetStatusChangeResult(ResultArgs result_args, device::mojom::SmartCardResultPtr result, SmartCardCallback callback); - void ProcessCancelResult(ResultArgs result_args, - device::mojom::SmartCardResultPtr result, - SmartCardCallback callback); + void ProcessPlainResult(ResultArgs result_args, + device::mojom::SmartCardResultPtr result, + SmartCardCallback callback); void ProcessConnectResult(ContextId scard_context, ResultArgs result_args, device::mojom::SmartCardResultPtr result, SmartCardCallback callback); - void ProcessDisconnectResult(ResultArgs result_args, - device::mojom::SmartCardResultPtr result, - SmartCardCallback callback); void ProcessDataResult(ResultArgs result_args, device::mojom::SmartCardResultPtr result, SmartCardCallback callback); @@ -323,15 +323,15 @@ SMARTCARDPROVIDERPRIVATE_REPORTGETSTATUSCHANGERESULT) }; -class SmartCardProviderPrivateReportCancelResultFunction +class SmartCardProviderPrivateReportPlainResultFunction : public ExtensionFunction { private: // ExtensionFunction: - ~SmartCardProviderPrivateReportCancelResultFunction() override; + ~SmartCardProviderPrivateReportPlainResultFunction() override; ResponseAction Run() override; - DECLARE_EXTENSION_FUNCTION("smartCardProviderPrivate.reportCancelResult", - SMARTCARDPROVIDERPRIVATE_REPORTCANCELRESULT) + DECLARE_EXTENSION_FUNCTION("smartCardProviderPrivate.reportPlainResult", + SMARTCARDPROVIDERPRIVATE_REPORTPLAINRESULT) }; class SmartCardProviderPrivateReportConnectResultFunction @@ -345,17 +345,6 @@ SMARTCARDPROVIDERPRIVATE_REPORTCONNECTRESULT) }; -class SmartCardProviderPrivateReportDisconnectResultFunction - : public ExtensionFunction { - private: - // ExtensionFunction: - ~SmartCardProviderPrivateReportDisconnectResultFunction() override; - ResponseAction Run() override; - - DECLARE_EXTENSION_FUNCTION("smartCardProviderPrivate.reportDisconnectResult", - SMARTCARDPROVIDERPRIVATE_REPORTDISCONNECTRESULT) -}; - class SmartCardProviderPrivateReportDataResultFunction : public ExtensionFunction { private:
diff --git a/chrome/browser/chromeos/extensions/smart_card_provider_private/smart_card_provider_private_apitest.cc b/chrome/browser/chromeos/extensions/smart_card_provider_private/smart_card_provider_private_apitest.cc index 7cb2470..9a095b4 100644 --- a/chrome/browser/chromeos/extensions/smart_card_provider_private/smart_card_provider_private_apitest.cc +++ b/chrome/browser/chromeos/extensions/smart_card_provider_private/smart_card_provider_private_apitest.cc
@@ -676,12 +676,12 @@ function disconnect(requestId, scardHandle, disposition) { if (scardHandle !== validHandle || disposition != "UNPOWER_CARD") { - chrome.smartCardProviderPrivate.reportDisconnectResult(requestId, + chrome.smartCardProviderPrivate.reportPlainResult(requestId, "INVALID_PARAMETER"); return; } validHandle = 0; - chrome.smartCardProviderPrivate.reportDisconnectResult(requestId, + chrome.smartCardProviderPrivate.reportPlainResult(requestId, "SUCCESS"); } )"}); @@ -746,12 +746,12 @@ function disconnect(requestId, scardHandle, disposition) { if (scardHandle !== validHandle) { - chrome.smartCardProviderPrivate.reportDisconnectResult(requestId, + chrome.smartCardProviderPrivate.reportPlainResult(requestId, "INVALID_HANDLE"); return; } validHandle = 0; - chrome.smartCardProviderPrivate.reportDisconnectResult(requestId, + chrome.smartCardProviderPrivate.reportPlainResult(requestId, "SUCCESS"); chrome.test.notifyPass(); } @@ -779,12 +779,12 @@ function cancel(requestId, scardContext) { if (scardContext != 123) { - chrome.smartCardProviderPrivate.reportCancelResult(requestId, + chrome.smartCardProviderPrivate.reportPlainResult(requestId, readerStates, "INVALID_PARAMETER"); return; } - chrome.smartCardProviderPrivate.reportCancelResult(requestId, + chrome.smartCardProviderPrivate.reportPlainResult(requestId, "SUCCESS"); } )"});
diff --git a/chrome/browser/commerce/coupons/coupon_service_unittest.cc b/chrome/browser/commerce/coupons/coupon_service_unittest.cc index b504723..67663131 100644 --- a/chrome/browser/commerce/coupons/coupon_service_unittest.cc +++ b/chrome/browser/commerce/coupons/coupon_service_unittest.cc
@@ -79,9 +79,15 @@ struct CouponDataStruct { const int64_t id; - const GURL& origin; - const std::string& description; - const std::string& coupon_code; + // This field is not a raw_ref<> because it was filtered by the rewriter for: + // #constexpr-ctor-field-initializer + RAW_PTR_EXCLUSION const GURL& origin; + // This field is not a raw_ref<> because it was filtered by the rewriter for: + // #constexpr-ctor-field-initializer + RAW_PTR_EXCLUSION const std::string& description; + // This field is not a raw_ref<> because it was filtered by the rewriter for: + // #constexpr-ctor-field-initializer + RAW_PTR_EXCLUSION const std::string& coupon_code; }; } // namespace
diff --git a/chrome/browser/enterprise/profile_management/saml_response_parser.cc b/chrome/browser/enterprise/profile_management/saml_response_parser.cc index ce202ac..c045d19e 100644 --- a/chrome/browser/enterprise/profile_management/saml_response_parser.cc +++ b/chrome/browser/enterprise/profile_management/saml_response_parser.cc
@@ -110,7 +110,7 @@ base::SequencedTaskRunner::GetCurrentDefault()), callback_(std::move(callback)) { body_consumer_watcher_.Watch( - body_, MOJO_HANDLE_SIGNAL_READABLE | MOJO_HANDLE_SIGNAL_PEER_CLOSED, + *body_, MOJO_HANDLE_SIGNAL_READABLE | MOJO_HANDLE_SIGNAL_PEER_CLOSED, base::BindRepeating(&SAMLResponseParser::OnBodyReady, weak_ptr_factory_.GetWeakPtr())); body_consumer_watcher_.ArmOrNotify(); @@ -121,11 +121,11 @@ void SAMLResponseParser::OnBodyReady(MojoResult) { uint32_t num_bytes = 0; MojoResult result = - body_.ReadData(nullptr, &num_bytes, MOJO_READ_DATA_FLAG_QUERY); + body_->ReadData(nullptr, &num_bytes, MOJO_READ_DATA_FLAG_QUERY); switch (result) { case MOJO_RESULT_OK: { std::string response(num_bytes, '\0'); - body_.ReadData(response.data(), &num_bytes, MOJO_READ_DATA_FLAG_PEEK); + body_->ReadData(response.data(), &num_bytes, MOJO_READ_DATA_FLAG_PEEK); data_decoder::DataDecoder::ParseXmlIsolated( response, data_decoder::mojom::XmlParser::WhitespaceBehavior::
diff --git a/chrome/browser/enterprise/profile_management/saml_response_parser.h b/chrome/browser/enterprise/profile_management/saml_response_parser.h index 8d0885b..f65e061 100644 --- a/chrome/browser/enterprise/profile_management/saml_response_parser.h +++ b/chrome/browser/enterprise/profile_management/saml_response_parser.h
@@ -10,6 +10,7 @@ #include "base/base64.h" #include "base/containers/flat_map.h" #include "base/functional/callback.h" +#include "base/memory/raw_ref.h" #include "content/public/browser/navigation_handle.h" #include "content/public/browser/navigation_throttle.h" #include "mojo/public/cpp/system/simple_watcher.h" @@ -40,7 +41,7 @@ data_decoder::DataDecoder::ValueOrError value_or_error); std::vector<std::string> attributes_; - const mojo::DataPipeConsumerHandle& body_; + const raw_ref<const mojo::DataPipeConsumerHandle> body_; mojo::SimpleWatcher body_consumer_watcher_; base::OnceCallback<void(base::flat_map<std::string, std::string>)> callback_; base::WeakPtrFactory<SAMLResponseParser> weak_ptr_factory_{this};
diff --git a/chrome/browser/feedback/android/family_info_feedback_source.cc b/chrome/browser/feedback/android/family_info_feedback_source.cc index fab8d9f..65e22e9 100644 --- a/chrome/browser/feedback/android/family_info_feedback_source.cc +++ b/chrome/browser/feedback/android/family_info_feedback_source.cc
@@ -75,7 +75,7 @@ } void FamilyInfoFeedbackSource::OnResponse( - KidsExternalFetcherStatus status, + supervised_user::ProtoFetcherStatus status, std::unique_ptr<kids_chrome_management::ListFamilyMembersResponse> response) { if (!status.IsOk()) { @@ -116,7 +116,8 @@ OnComplete(); } -void FamilyInfoFeedbackSource::OnFailure(KidsExternalFetcherStatus status) { +void FamilyInfoFeedbackSource::OnFailure( + supervised_user::ProtoFetcherStatus status) { DLOG(WARNING) << "ListFamilyMembers failed with status: " << status.ToString(); OnComplete();
diff --git a/chrome/browser/feedback/android/family_info_feedback_source.h b/chrome/browser/feedback/android/family_info_feedback_source.h index 8f3d32d..dd09273 100644 --- a/chrome/browser/feedback/android/family_info_feedback_source.h +++ b/chrome/browser/feedback/android/family_info_feedback_source.h
@@ -12,8 +12,8 @@ #include "base/android/scoped_java_ref.h" #include "base/memory/raw_ptr.h" #include "base/process/process_handle.h" -#include "components/supervised_user/core/browser/kids_external_fetcher.h" #include "components/supervised_user/core/browser/proto/kidschromemanagement_messages.pb.h" +#include "components/supervised_user/core/browser/proto_fetcher.h" #include "components/supervised_user/core/browser/supervised_user_service.h" class Profile; @@ -43,20 +43,19 @@ friend class FamilyInfoFeedbackSourceForChildFilterBehaviorTest; void OnResponse( - KidsExternalFetcherStatus status, + supervised_user::ProtoFetcherStatus status, std::unique_ptr<kids_chrome_management::ListFamilyMembersResponse> response); void OnSuccess( const kids_chrome_management::ListFamilyMembersResponse& response); - void OnFailure(KidsExternalFetcherStatus status); + void OnFailure(supervised_user::ProtoFetcherStatus status); // Cleans up following the call to ListFamilyMembers void OnComplete(); raw_ptr<supervised_user::SupervisedUserService> supervised_user_service_; - std::unique_ptr< - KidsExternalFetcher<kids_chrome_management::ListFamilyMembersRequest, - kids_chrome_management::ListFamilyMembersResponse>> + std::unique_ptr<supervised_user::ProtoFetcher< + kids_chrome_management::ListFamilyMembersResponse>> list_family_members_fetcher_; raw_ptr<signin::IdentityManager> identity_manager_; scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory_;
diff --git a/chrome/browser/feedback/android/family_info_feedback_source_unittest.cc b/chrome/browser/feedback/android/family_info_feedback_source_unittest.cc index c62ef47..2006d655 100644 --- a/chrome/browser/feedback/android/family_info_feedback_source_unittest.cc +++ b/chrome/browser/feedback/android/family_info_feedback_source_unittest.cc
@@ -22,9 +22,9 @@ #include "chrome/browser/supervised_user/supervised_user_service_factory.h" #include "chrome/test/test_support_jni_headers/FamilyInfoFeedbackSourceTestBridge_jni.h" #include "components/signin/public/identity_manager/identity_test_environment.h" -#include "components/supervised_user/core/browser/kids_external_fetcher.h" #include "components/supervised_user/core/browser/proto/families_common.pb.h" #include "components/supervised_user/core/browser/proto/kidschromemanagement_messages.pb.h" +#include "components/supervised_user/core/browser/proto_fetcher.h" #include "components/supervised_user/core/browser/supervised_user_service.h" #include "components/supervised_user/core/browser/supervised_user_url_filter.h" #include "content/public/test/browser_task_environment.h" @@ -230,7 +230,7 @@ void OnGetFamilyMembersFailure( base::WeakPtr<FamilyInfoFeedbackSource> feedback_source) { feedback_source->OnFailure( - KidsExternalFetcherStatus::GoogleServiceAuthError( + supervised_user::ProtoFetcherStatus::GoogleServiceAuthError( GoogleServiceAuthError( GoogleServiceAuthError::State::INVALID_GAIA_CREDENTIALS))); }
diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json index 50005edb..ec049289 100644 --- a/chrome/browser/flag-metadata.json +++ b/chrome/browser/flag-metadata.json
@@ -7470,6 +7470,11 @@ "expiry_milestone": 102 }, { + "name": "use-client-gmb-interface", + "owners": [ "vikassoni" ], + "expiry_milestone": 120 + }, + { "name": "use-custom-messages-domain", "owners": [ "azeemarshad", "jonmann" ], // This flag is used for QA and development.
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc index 7a6d4b8..aa14668 100644 --- a/chrome/browser/flag_descriptions.cc +++ b/chrome/browser/flag_descriptions.cc
@@ -243,6 +243,13 @@ "hence have higher thread priority than GPU main. Note that this flag will " "be a no-op when DrDc is disabled."; +const char kUseClientGmbInterfaceName[] = + "Use ClientGmb interface to create GpuMemoryBuffers."; +const char kUseClientGmbInterfaceDescription[] = + " Use new ClientGmb interface to create GpuMemoryBuffers when enabled." + " This is expected to reduce number of IPCs happening while creating " + " GpuMemoryBuffers."; + const char kTextBasedAudioDescriptionName[] = "Enable audio descriptions."; const char kTextBasedAudioDescriptionDescription[] = "When enabled, HTML5 video elements with a 'descriptions' WebVTT track "
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h index a0138e6..70e68fd 100644 --- a/chrome/browser/flag_descriptions.h +++ b/chrome/browser/flag_descriptions.h
@@ -168,6 +168,9 @@ extern const char kEnableDrDcVulkanName[]; +extern const char kUseClientGmbInterfaceName[]; +extern const char kUseClientGmbInterfaceDescription[]; + #if BUILDFLAG(ENABLE_SUPERVISED_USERS) extern const char kWebFilterInterstitialRefreshName[]; extern const char kWebFilterInterstitialRefreshDescription[];
diff --git a/chrome/browser/lacros/web_app_provider_bridge_lacros.cc b/chrome/browser/lacros/web_app_provider_bridge_lacros.cc index 9f07e349..4bb6844 100644 --- a/chrome/browser/lacros/web_app_provider_bridge_lacros.cc +++ b/chrome/browser/lacros/web_app_provider_bridge_lacros.cc
@@ -9,6 +9,7 @@ #include "chrome/browser/browser_process.h" #include "chrome/browser/chromeos/office_web_app/office_web_app.h" #include "chrome/browser/profiles/profile_manager.h" +#include "chrome/browser/web_applications/locks/all_apps_lock.h" #include "chrome/browser/web_applications/locks/app_lock.h" #include "chrome/browser/web_applications/mojom/user_display_mode.mojom.h" #include "chrome/browser/web_applications/web_app_command_scheduler.h" @@ -97,6 +98,15 @@ std::move(callback))); } +void WebAppProviderBridgeLacros::GetSubAppToParentMap( + GetSubAppToParentMapCallback callback) { + g_browser_process->profile_manager()->LoadProfileByPath( + ProfileManager::GetPrimaryUserProfilePath(), + /*incognito=*/false, + base::BindOnce(&WebAppProviderBridgeLacros::GetSubAppToParentMapImpl, + std::move(callback))); +} + // static void WebAppProviderBridgeLacros::WebAppInstalledInArcImpl( mojom::ArcWebAppInstallInfoPtr arc_install_info, @@ -182,4 +192,20 @@ .Then(std::move(callback))); } +// static +void WebAppProviderBridgeLacros::GetSubAppToParentMapImpl( + GetSubAppToParentMapCallback callback, + Profile* profile) { + CHECK(profile); + auto* provider = web_app::WebAppProvider::GetForWebApps(profile); + CHECK(provider); + + provider->scheduler().ScheduleCallbackWithLock<web_app::AllAppsLock>( + "WebAppProviderBridgeLacros::GetSubAppToParentMap", + std::make_unique<web_app::AllAppsLockDescription>(), + base::BindOnce([](web_app::AllAppsLock& lock) { + return lock.registrar().GetSubAppToParentMap(); + }).Then(std::move(callback))); +} + } // namespace crosapi
diff --git a/chrome/browser/lacros/web_app_provider_bridge_lacros.h b/chrome/browser/lacros/web_app_provider_bridge_lacros.h index d6d3d1ad..ce9180b62 100644 --- a/chrome/browser/lacros/web_app_provider_bridge_lacros.h +++ b/chrome/browser/lacros/web_app_provider_bridge_lacros.h
@@ -38,6 +38,7 @@ bool is_renderer_initiated) override; void GetSubAppIds(const web_app::AppId& app_id, GetSubAppIdsCallback callback) override; + void GetSubAppToParentMap(GetSubAppToParentMapCallback callback) override; private: static void WebAppInstalledInArcImpl( @@ -62,6 +63,8 @@ static void GetSubAppIdsImpl(const web_app::AppId& app_id, GetSubAppIdsCallback callback, Profile* profile); + static void GetSubAppToParentMapImpl(GetSubAppToParentMapCallback callback, + Profile* profile); mojo::Receiver<mojom::WebAppProviderBridge> receiver_{this}; };
diff --git a/chrome/browser/media/webrtc/webrtc_browsertest_base.cc b/chrome/browser/media/webrtc/webrtc_browsertest_base.cc index 0ef1e55..5cb8530 100644 --- a/chrome/browser/media/webrtc/webrtc_browsertest_base.cc +++ b/chrome/browser/media/webrtc/webrtc_browsertest_base.cc
@@ -98,24 +98,6 @@ return false; } -std::vector<std::string> JsonArrayToVectorOfStrings( - const std::string& json_array) { - std::vector<std::string> result; - absl::optional<base::Value> value = base::JSONReader::Read(json_array); - if (!value || !value->is_list()) { - ADD_FAILURE(); - return result; - } - - base::Value::List& list = value->GetList(); - result.reserve(list.size()); - for (base::Value& item : list) { - EXPECT_TRUE(item.is_string()); - result.push_back(std::move(item).TakeString()); - } - return result; -} - } // namespace WebRtcTestBase::WebRtcTestBase(): detect_errors_in_javascript_(false) { @@ -519,13 +501,6 @@ EXPECT_EQ("ok-generated-and-cloned", ExecuteJavascript(javascript, tab)); } -std::vector<std::string> WebRtcTestBase::VerifyStatsGeneratedPromise( - content::WebContents* tab) const { - std::string result = ExecuteJavascript("verifyStatsGeneratedPromise()", tab); - EXPECT_TRUE(base::StartsWith(result, "ok-", base::CompareCase::SENSITIVE)); - return JsonArrayToVectorOfStrings(result.substr(3)); -} - scoped_refptr<content::TestStatsReportDictionary> WebRtcTestBase::GetStatsReportDictionary(content::WebContents* tab) const { std::string result = ExecuteJavascript("getStatsReportDictionary()", tab); @@ -549,12 +524,6 @@ return ms; } -std::vector<std::string> WebRtcTestBase::GetMandatoryStatsTypes( - content::WebContents* tab) const { - return JsonArrayToVectorOfStrings( - ExecuteJavascript("getMandatoryStatsTypes()", tab)); -} - void WebRtcTestBase::SetDefaultAudioCodec( content::WebContents* tab, const std::string& audio_codec) const {
diff --git a/chrome/browser/media/webrtc/webrtc_browsertest_base.h b/chrome/browser/media/webrtc/webrtc_browsertest_base.h index 335912b2..d4978ce2 100644 --- a/chrome/browser/media/webrtc/webrtc_browsertest_base.h +++ b/chrome/browser/media/webrtc/webrtc_browsertest_base.h
@@ -216,13 +216,9 @@ void GenerateAndCloneCertificate(content::WebContents* tab, const std::string& keygen_algorithm) const; - std::vector<std::string> VerifyStatsGeneratedPromise( - content::WebContents* tab) const; scoped_refptr<content::TestStatsReportDictionary> GetStatsReportDictionary( content::WebContents* tab) const; double MeasureGetStatsPerformance(content::WebContents* tab) const; - std::vector<std::string> GetMandatoryStatsTypes( - content::WebContents* tab) const; // Change the default audio/video codec in the offer SDP. void SetDefaultAudioCodec(content::WebContents* tab,
diff --git a/chrome/browser/media/webrtc/webrtc_desktop_capture_browsertest.cc b/chrome/browser/media/webrtc/webrtc_desktop_capture_browsertest.cc index 2a249f99..33a3569 100644 --- a/chrome/browser/media/webrtc/webrtc_desktop_capture_browsertest.cc +++ b/chrome/browser/media/webrtc/webrtc_desktop_capture_browsertest.cc
@@ -301,7 +301,6 @@ SetupPeerconnectionWithLocalStream(first_tab); SetupPeerconnectionWithLocalStream(second_tab); NegotiateCall(first_tab, second_tab); - VerifyStatsGeneratedPromise(second_tab); DetectVideoAndHangUp(first_tab, second_tab); }
diff --git a/chrome/browser/media/webrtc/webrtc_interactive_uitest.cc b/chrome/browser/media/webrtc/webrtc_interactive_uitest.cc index 91797b9..cc7dbf0e2 100644 --- a/chrome/browser/media/webrtc/webrtc_interactive_uitest.cc +++ b/chrome/browser/media/webrtc/webrtc_interactive_uitest.cc
@@ -6,7 +6,6 @@ #include "base/memory/raw_ptr.h" #include "base/task/deferred_sequenced_task_runner.h" #include "base/test/bind.h" -#include "base/test/scoped_feature_list.h" #include "build/build_config.h" #include "chrome/browser/media/webrtc/webrtc_browsertest_base.h" #include "chrome/browser/media/webrtc/webrtc_browsertest_common.h" @@ -265,66 +264,12 @@ SetupPeerconnectionWithLocalStream(right_tab_); NegotiateCall(left_tab_, right_tab_); - VerifyStatsGeneratedPromise(left_tab_); EXPECT_EQ(2u, GetPeerToPeerConnectionsCountChangeFromNetworkService()); DetectVideoAndHangUp(); EXPECT_EQ(0u, GetPeerToPeerConnectionsCountChangeFromNetworkService()); } -IN_PROC_BROWSER_TEST_F(WebRtcBrowserTest, - RunsAudioVideoWebRTCCallInTwoTabsGetStatsPromise) { - StartServerAndOpenTabs(); - SetupPeerconnectionWithLocalStream(left_tab_); - SetupPeerconnectionWithLocalStream(right_tab_); - CreateDataChannel(left_tab_, "data"); - CreateDataChannel(right_tab_, "data"); - NegotiateCall(left_tab_, right_tab_); - - std::set<std::string> missing_expected_stats; - for (const std::string& type : GetMandatoryStatsTypes(left_tab_)) { - missing_expected_stats.insert(type); - } - for (const std::string& type : VerifyStatsGeneratedPromise(left_tab_)) { - missing_expected_stats.erase(type); - } - EXPECT_THAT(missing_expected_stats, ::testing::IsEmpty()); - - DetectVideoAndHangUp(); -} - -class WebRtcBrowserTestIdl : public WebRtcBrowserTest { - public: - WebRtcBrowserTestIdl() { - scoped_features_.InitAndEnableFeature( - blink::features::kWebRtcStatsReportIdl); - } - - private: - base::test::ScopedFeatureList scoped_features_; -}; - -IN_PROC_BROWSER_TEST_F(WebRtcBrowserTestIdl, - RunsAudioVideoWebRTCCallInTwoTabsGetStatsPromiseIDL) { - StartServerAndOpenTabs(); - SetupPeerconnectionWithLocalStream(left_tab_); - SetupPeerconnectionWithLocalStream(right_tab_); - CreateDataChannel(left_tab_, "data"); - CreateDataChannel(right_tab_, "data"); - NegotiateCall(left_tab_, right_tab_); - - std::set<std::string> missing_expected_stats; - for (const std::string& type : GetMandatoryStatsTypes(left_tab_)) { - missing_expected_stats.insert(type); - } - for (const std::string& type : VerifyStatsGeneratedPromise(left_tab_)) { - missing_expected_stats.erase(type); - } - EXPECT_THAT(missing_expected_stats, ::testing::IsEmpty()); - - DetectVideoAndHangUp(); -} - IN_PROC_BROWSER_TEST_F( WebRtcBrowserTest, RunsAudioVideoWebRTCCallInTwoTabsEmitsGatheringStateChange) {
diff --git a/chrome/browser/page_load_metrics/observers/javascript_frameworks_ukm_observer.cc b/chrome/browser/page_load_metrics/observers/javascript_frameworks_ukm_observer.cc index d40dd78..60dbe263 100644 --- a/chrome/browser/page_load_metrics/observers/javascript_frameworks_ukm_observer.cc +++ b/chrome/browser/page_load_metrics/observers/javascript_frameworks_ukm_observer.cc
@@ -9,6 +9,7 @@ #include "services/metrics/public/cpp/ukm_recorder.h" #include "third_party/blink/public/common/features.h" #include "third_party/blink/public/common/loader/loading_behavior_flag.h" +#include "third_party/blink/public/mojom/loader/javascript_framework_detection.mojom-forward.h" JavascriptFrameworksUkmObserver::JavascriptFrameworksUkmObserver() = default; @@ -34,13 +35,10 @@ return CONTINUE_OBSERVING; } -void JavascriptFrameworksUkmObserver::OnLoadingBehaviorObserved( +void JavascriptFrameworksUkmObserver::OnJavaScriptFrameworksObserved( content::RenderFrameHost* rfh, - int behavior_flag) { - // This will add bits corresponding to detected frameworks in |behavior_flag| - // to |frameworks_detected_|. It may also add other bits, which we don't care - // about. - frameworks_detected_ |= behavior_flag; + const blink::JavaScriptFrameworkDetectionResult& result) { + framework_detection_result_ = result; } void JavascriptFrameworksUkmObserver::OnComplete( @@ -62,48 +60,72 @@ } void JavascriptFrameworksUkmObserver::RecordJavascriptFrameworkPageLoad() { - ukm::builders::JavascriptFrameworkPageLoad builder( + ukm::builders::JavascriptFrameworkPageLoad detect_builder( GetDelegate().GetPageUkmSourceId()); - using blink::LoadingBehaviorFlag; + using blink::mojom::JavaScriptFramework; - auto is_detected = [&](LoadingBehaviorFlag flag) -> bool { - return (frameworks_detected_ & flag) != 0; + auto is_detected = [&](JavaScriptFramework framework) -> bool { + return framework_detection_result_.detected_versions.contains(framework); }; - builder - .SetGatsbyPageLoad( - is_detected(LoadingBehaviorFlag::kLoadingBehaviorGatsbyFrameworkUsed)) - .SetNextJSPageLoad( - is_detected(LoadingBehaviorFlag::kLoadingBehaviorNextJSFrameworkUsed)) - .SetNuxtJSPageLoad( - is_detected(LoadingBehaviorFlag::kLoadingBehaviorNuxtJSFrameworkUsed)) - .SetSapperPageLoad( - is_detected(LoadingBehaviorFlag::kLoadingBehaviorSapperFrameworkUsed)) - .SetVuePressPageLoad(is_detected( - LoadingBehaviorFlag::kLoadingBehaviorVuePressFrameworkUsed)) - .SetAngularPageLoad(is_detected( - LoadingBehaviorFlag::kLoadingBehaviorAngularFrameworkUsed)) - .SetPreactPageLoad( - is_detected(LoadingBehaviorFlag::kLoadingBehaviorPreactFrameworkUsed)) - .SetReactPageLoad( - is_detected(LoadingBehaviorFlag::kLoadingBehaviorReactFrameworkUsed)) - .SetSveltePageLoad( - is_detected(LoadingBehaviorFlag::kLoadingBehaviorSvelteFrameworkUsed)) - .SetVuePageLoad( - is_detected(LoadingBehaviorFlag::kLoadingBehaviorVueFrameworkUsed)) - .SetDrupalPageLoad( - is_detected(LoadingBehaviorFlag::kLoadingBehaviorDrupalCMSUsed)) - .SetJoomlaPageLoad( - is_detected(LoadingBehaviorFlag::kLoadingBehaviorJoomlaCMSUsed)) - .SetShopifyPageLoad( - is_detected(LoadingBehaviorFlag::kLoadingBehaviorShopifyCMSUsed)) - .SetSquarespacePageLoad( - is_detected(LoadingBehaviorFlag::kLoadingBehaviorSquarespaceCMSUsed)) - .SetWixPageLoad( - is_detected(LoadingBehaviorFlag::kLoadingBehaviorWixCMSUsed)) - .SetWordPressPageLoad( - is_detected(LoadingBehaviorFlag::kLoadingBehaviorWordPressCMSUsed)); - builder.Record(ukm::UkmRecorder::Get()); + + detect_builder.SetAngularPageLoad(is_detected(JavaScriptFramework::kAngular)) + .SetDrupalPageLoad(is_detected(JavaScriptFramework::kDrupal)) + .SetGatsbyPageLoad(is_detected(JavaScriptFramework::kGatsby)) + .SetJoomlaPageLoad(is_detected(JavaScriptFramework::kJoomla)) + .SetNextJSPageLoad(is_detected(JavaScriptFramework::kNext)) + .SetNuxtJSPageLoad(is_detected(JavaScriptFramework::kNuxt)) + .SetPreactPageLoad(is_detected(JavaScriptFramework::kPreact)) + .SetReactPageLoad(is_detected(JavaScriptFramework::kReact)) + .SetSapperPageLoad(is_detected(JavaScriptFramework::kSapper)) + .SetShopifyPageLoad(is_detected(JavaScriptFramework::kShopify)) + .SetSquarespacePageLoad(is_detected(JavaScriptFramework::kSquarespace)) + .SetSveltePageLoad(is_detected(JavaScriptFramework::kSvelte)) + .SetVuePageLoad(is_detected(JavaScriptFramework::kVue)) + .SetVuePressPageLoad(is_detected(JavaScriptFramework::kVuePress)) + .SetWixPageLoad(is_detected(JavaScriptFramework::kWix)) + .SetWordPressPageLoad(is_detected(JavaScriptFramework::kWordPress)); + + detect_builder.Record(ukm::UkmRecorder::Get()); + + ukm::builders::Blink_JavaScriptFramework_Versions versions_builder( + GetDelegate().GetPageUkmSourceId()); + + typedef ukm::builders::Blink_JavaScriptFramework_Versions& ( + ukm::builders::Blink_JavaScriptFramework_Versions::*ValueSetter)(int64_t); + + auto detect_version = [&](JavaScriptFramework framework, ValueSetter setter) { + auto version = + framework_detection_result_.detected_versions.find(framework); + if (version == framework_detection_result_.detected_versions.end() || + version->second == blink::kNoFrameworkVersionDetected) { + return false; + } + + (versions_builder.*setter)(version->second); + return true; + }; + + if (detect_version(JavaScriptFramework::kAngular, + &ukm::builders::Blink_JavaScriptFramework_Versions:: + SetAngularVersion) || + detect_version(JavaScriptFramework::kDrupal, + &ukm::builders::Blink_JavaScriptFramework_Versions:: + SetDrupalVersion) || + detect_version(JavaScriptFramework::kNext, + &ukm::builders::Blink_JavaScriptFramework_Versions:: + SetNextJSVersion) || + detect_version( + JavaScriptFramework::kNuxt, + &ukm::builders::Blink_JavaScriptFramework_Versions::SetNuxtVersion) || + detect_version( + JavaScriptFramework::kVue, + &ukm::builders::Blink_JavaScriptFramework_Versions::SetVueVersion) || + detect_version(JavaScriptFramework::kWordPress, + &ukm::builders::Blink_JavaScriptFramework_Versions:: + SetWordPressVersion)) { + versions_builder.Record(ukm::UkmRecorder::Get()); + } } void JavascriptFrameworksUkmObserver::DidActivatePrerenderedPage(
diff --git a/chrome/browser/page_load_metrics/observers/javascript_frameworks_ukm_observer.h b/chrome/browser/page_load_metrics/observers/javascript_frameworks_ukm_observer.h index 3696bbe..8dff6a7 100644 --- a/chrome/browser/page_load_metrics/observers/javascript_frameworks_ukm_observer.h +++ b/chrome/browser/page_load_metrics/observers/javascript_frameworks_ukm_observer.h
@@ -6,6 +6,7 @@ #define CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_JAVASCRIPT_FRAMEWORKS_UKM_OBSERVER_H_ #include "components/page_load_metrics/browser/page_load_metrics_observer.h" +#include "third_party/blink/public/common/loader/javascript_framework_detection.h" #include "third_party/blink/public/common/loader/loading_behavior_flag.h" // If URL-Keyed-Metrics (UKM) is enabled in the system, this is used to @@ -28,8 +29,9 @@ const GURL& currently_committed_url) override; ObservePolicy OnPrerenderStart(content::NavigationHandle* navigation_handle, const GURL& currently_committed_url) override; - void OnLoadingBehaviorObserved(content::RenderFrameHost* rfh, - int behavior_flag) override; + void OnJavaScriptFrameworksObserved( + content::RenderFrameHost* rfh, + const blink::JavaScriptFrameworkDetectionResult&) override; void OnComplete(const page_load_metrics::mojom::PageLoadTiming&) override; JavascriptFrameworksUkmObserver::ObservePolicy FlushMetricsOnAppEnterBackground( @@ -42,9 +44,7 @@ // frameworks detected. void RecordJavascriptFrameworkPageLoad(); - // Bitmap containing the blink::LoadingBehaviorFlag values corresponding to - // frameworks that are detected. - int32_t frameworks_detected_ = 0; + blink::JavaScriptFrameworkDetectionResult framework_detection_result_; bool is_in_prerendered_page_ = false; };
diff --git a/chrome/browser/page_load_metrics/observers/javascript_frameworks_ukm_observer_browsertest.cc b/chrome/browser/page_load_metrics/observers/javascript_frameworks_ukm_observer_browsertest.cc index 8e8b4aeb..7ff4115 100644 --- a/chrome/browser/page_load_metrics/observers/javascript_frameworks_ukm_observer_browsertest.cc +++ b/chrome/browser/page_load_metrics/observers/javascript_frameworks_ukm_observer_browsertest.cc
@@ -27,8 +27,6 @@ namespace { -using UkmEntry = ukm::builders::JavascriptFrameworkPageLoad; - constexpr char kGatsbyJsPageLoad[] = "GatsbyPageLoad"; constexpr char kNextJsPageLoad[] = "NextJSPageLoad"; constexpr char kNuxtJsPageLoad[] = "NuxtJSPageLoad"; @@ -45,7 +43,7 @@ constexpr char kSquarespacePageLoad[] = "SquarespacePageLoad"; constexpr char kWixPageLoad[] = "WixPageLoad"; constexpr char kWordPressPageLoad[] = "WordPressPageLoad"; -const std::vector<const char*> all_frameworks = { +const std::vector<base::StringPiece> all_frameworks = { kGatsbyJsPageLoad, kNextJsPageLoad, kNuxtJsPageLoad, kSapperPageLoad, kVuePressPageLoad, kAngularPageLoad, kPreactPageLoad, kReactPageLoad, kSveltePageLoad, @@ -79,11 +77,13 @@ https_test_server_->ServeFilesFromSourceDirectory("chrome/test/data"); ASSERT_TRUE(https_test_server_->Start()); } - void ExpectMetricValueForUrl(const GURL& url, - const char* metric_name, - const int expected_value) { - for (auto* entry : - test_ukm_recorder_->GetEntriesByName(UkmEntry::kEntryName)) { + void ExpectMetricValueForUrl( + const GURL& url, + base::StringPiece metric_name, + const int expected_value, + base::StringPiece entry_name = + ukm::builders::JavascriptFrameworkPageLoad::kEntryName) { + for (auto* entry : test_ukm_recorder_->GetEntriesByName(entry_name)) { auto* source = test_ukm_recorder_->GetSourceForSourceId(entry->source_id); if (source && source->url() == url) { test_ukm_recorder_->EntryHasMetric(entry, metric_name); @@ -92,12 +92,14 @@ } } } - void ExpectMetricCountForUrl(const GURL& url, - const char* metric_name, - const int expected_count) { + void ExpectMetricCountForUrl( + const GURL& url, + base::StringPiece metric_name, + const int expected_count, + base::StringPiece entry_name = + ukm::builders::JavascriptFrameworkPageLoad::kEntryName) { int count = 0; - for (auto* entry : - test_ukm_recorder_->GetEntriesByName(UkmEntry::kEntryName)) { + for (auto* entry : test_ukm_recorder_->GetEntriesByName(entry_name)) { auto* source = test_ukm_recorder_->GetSourceForSourceId(entry->source_id); if (source && source->url() == url && test_ukm_recorder_->EntryHasMetric(entry, metric_name)) { @@ -118,7 +120,7 @@ } void RunSingleFrameworkDetectionTest(const std::string& test_url, - const char* framework_name) { + base::StringPiece framework_name) { page_load_metrics::PageLoadMetricsTestWaiter waiter( browser()->tab_strip_model()->GetActiveWebContents()); waiter.AddPageExpectation( @@ -131,6 +133,46 @@ RunFrameworkDetection(all_frameworks, framework_name, url); } + void RunSingleFrameworkVersionDetectionTest( + const std::string& test_url, + base::StringPiece framework, + absl::optional<std::pair<int, int>> expected_version) { + page_load_metrics::PageLoadMetricsTestWaiter waiter( + browser()->tab_strip_model()->GetActiveWebContents()); + waiter.AddPageExpectation( + page_load_metrics::PageLoadMetricsTestWaiter::TimingField::kLoadEvent); + StartHttpsServer(net::EmbeddedTestServer::CERT_OK); + GURL url = https_test_server()->GetURL(test_url); + ASSERT_TRUE(ui_test_utils::NavigateToURL(browser(), url)); + waiter.Wait(); + CloseAllTabs(); + ExpectMetricCountForUrl( + url, framework, expected_version.has_value() ? 1 : 0, + ukm::builders::Blink_JavaScriptFramework_Versions::kEntryName); + if (expected_version.has_value()) { + ExpectMetricValueForUrl( + url, framework, + ((expected_version.value().first & 0xff) << 8) | + (expected_version.value().second & 0xff), + ukm::builders::Blink_JavaScriptFramework_Versions::kEntryName); + } + } + + void RunNoFrameworkVersionNotDetectedTest(const std::string& test_url) { + page_load_metrics::PageLoadMetricsTestWaiter waiter( + browser()->tab_strip_model()->GetActiveWebContents()); + waiter.AddPageExpectation( + page_load_metrics::PageLoadMetricsTestWaiter::TimingField::kLoadEvent); + StartHttpsServer(net::EmbeddedTestServer::CERT_OK); + GURL url = https_test_server()->GetURL(test_url); + ASSERT_TRUE(ui_test_utils::NavigateToURL(browser(), url)); + waiter.Wait(); + CloseAllTabs(); + auto entries = test_ukm_recorder_->GetEntriesByName( + ukm::builders::Blink_JavaScriptFramework_Versions::kEntryName); + EXPECT_TRUE(entries.empty()); + } + void RunSingleFrameworkDetectionTestForFencedFrames( const std::string& test_url) { StartHttpsServer(net::EmbeddedTestServer::CERT_OK); @@ -153,22 +195,23 @@ CloseAllTabs(); // No frameworks should be detected. - for (const char* framework : all_frameworks) { + for (base::StringPiece framework : all_frameworks) { ExpectMetricCountForUrl(mainframe_url, framework, 1); ExpectMetricValueForUrl(mainframe_url, framework, false); } } private: - void RunFrameworkDetection(const std::vector<const char*>& frameworks, - const char* framework_name, + void RunFrameworkDetection(const std::vector<base::StringPiece>& frameworks, + base::StringPiece framework_name, const GURL& url) { - for (const char* framework : frameworks) { + for (base::StringPiece framework : frameworks) { ExpectMetricCountForUrl(url, framework, 1); - if (std::strcmp(framework, framework_name) == 0) + if (framework.compare(framework_name) == 0) { ExpectMetricValueForUrl(url, framework, true); - else + } else { ExpectMetricValueForUrl(url, framework, false); + } } } std::unique_ptr<ukm::TestAutoSetUkmRecorder> test_ukm_recorder_; @@ -187,7 +230,7 @@ ASSERT_TRUE(ui_test_utils::NavigateToURL(browser(), url)); waiter.Wait(); CloseAllTabs(); - for (const char* framework : all_frameworks) { + for (base::StringPiece framework : all_frameworks) { ExpectMetricCountForUrl(url, framework, 1); ExpectMetricValueForUrl(url, framework, false); } @@ -236,7 +279,7 @@ waiter.Wait(); CloseAllTabs(); struct { - const char* name; + base::StringPiece name; const bool in_page; } expected_frameworks[] = {{kGatsbyJsPageLoad, true}, {kNextJsPageLoad, true}, @@ -362,3 +405,65 @@ RunSingleFrameworkDetectionTestForFencedFrames( "/page_load_metrics/gatsby_page.html"); } + +IN_PROC_BROWSER_TEST_F(JavascriptFrameworksUkmObserverBrowserTest, + AngularVersionDetected) { + RunSingleFrameworkVersionDetectionTest( + "/page_load_metrics/framework-version-detection/angular.html", + "AngularVersion", std::make_pair(14, 0)); +} + +IN_PROC_BROWSER_TEST_F(JavascriptFrameworksUkmObserverBrowserTest, + AngularClampedVersionDetected) { + RunSingleFrameworkVersionDetectionTest( + "/page_load_metrics/framework-version-detection/angular-clamped.html", + "AngularVersion", std::make_pair(300, 4000)); +} + +IN_PROC_BROWSER_TEST_F(JavascriptFrameworksUkmObserverBrowserTest, + DrupalVersionDetected) { + RunSingleFrameworkVersionDetectionTest( + "/page_load_metrics/framework-version-detection/drupal.html", + "DrupalVersion", std::make_pair(7, 0)); +} + +IN_PROC_BROWSER_TEST_F(JavascriptFrameworksUkmObserverBrowserTest, + NextJSVersionDetected) { + RunSingleFrameworkVersionDetectionTest( + "/page_load_metrics/framework-version-detection/nextjs.html", + "NextJSVersion", std::make_pair(13, 3)); +} + +IN_PROC_BROWSER_TEST_F(JavascriptFrameworksUkmObserverBrowserTest, + Vue2VersionDetected) { + RunSingleFrameworkVersionDetectionTest( + "/page_load_metrics/framework-version-detection/vue2.html", "VueVersion", + std::make_pair(2, 1)); +} + +IN_PROC_BROWSER_TEST_F(JavascriptFrameworksUkmObserverBrowserTest, + Vue3VersionDetected) { + RunSingleFrameworkVersionDetectionTest( + "/page_load_metrics/framework-version-detection/vue3.html", "VueVersion", + std::make_pair(3, 0)); +} + +IN_PROC_BROWSER_TEST_F(JavascriptFrameworksUkmObserverBrowserTest, + WordPressVersionDetected) { + RunSingleFrameworkVersionDetectionTest( + "/page_load_metrics/framework-version-detection/wordpress.html", + "WordPressVersion", std::make_pair(6, 2)); +} + +IN_PROC_BROWSER_TEST_F(JavascriptFrameworksUkmObserverBrowserTest, + NoFrameworkVersionDetected) { + RunNoFrameworkVersionNotDetectedTest( + "/page_load_metrics/framework-version-detection/not-detected.html"); +} + +IN_PROC_BROWSER_TEST_F(JavascriptFrameworksUkmObserverBrowserTest, + NoFrameworkVersionDetectedBadValues) { + RunNoFrameworkVersionNotDetectedTest( + "/page_load_metrics/framework-version-detection/" + "not-detected-bad-values.html"); +}
diff --git a/chrome/browser/permissions/crowd_deny_safe_browsing_request.h b/chrome/browser/permissions/crowd_deny_safe_browsing_request.h index 6156e20f..36aacd4 100644 --- a/chrome/browser/permissions/crowd_deny_safe_browsing_request.h +++ b/chrome/browser/permissions/crowd_deny_safe_browsing_request.h
@@ -8,7 +8,7 @@ #include <memory> #include "base/functional/callback.h" -#include "base/memory/raw_ptr_exclusion.h" +#include "base/memory/raw_ptr.h" #include "base/memory/ref_counted.h" #include "base/memory/weak_ptr.h" #include "base/time/time.h" @@ -77,9 +77,7 @@ VerdictCallback callback_; // For telemetry purposes. The caller guarantees |clock_| to outlive |this|. - // This field is not a raw_ptr<> because it was filtered by the rewriter for: - // #union - RAW_PTR_EXCLUSION const base::Clock* clock_; + raw_ptr<const base::Clock> clock_; const base::Time request_start_time_; base::WeakPtrFactory<CrowdDenySafeBrowsingRequest> weak_factory_{this};
diff --git a/chrome/browser/resources/settings/chromeos/BUILD.gn b/chrome/browser/resources/settings/chromeos/BUILD.gn index 20163fc..431a42a 100644 --- a/chrome/browser/resources/settings/chromeos/BUILD.gn +++ b/chrome/browser/resources/settings/chromeos/BUILD.gn
@@ -197,6 +197,7 @@ "os_apps_page/app_management_page/pwa_detail_view.ts", "os_apps_page/app_management_page/read_only_permission_item.ts", "os_apps_page/app_management_page/resize_lock_item.ts", + "os_apps_page/app_management_page/sub_apps_item.ts", "os_apps_page/app_management_page/supported_links_dialog.ts", "os_apps_page/app_management_page/supported_links_item.ts", "os_apps_page/app_management_page/supported_links_overlapping_apps_dialog.ts",
diff --git a/chrome/browser/resources/settings/chromeos/internet_page/hotspot_config_dialog.ts b/chrome/browser/resources/settings/chromeos/internet_page/hotspot_config_dialog.ts index 0f306fe..e62dac0 100644 --- a/chrome/browser/resources/settings/chromeos/internet_page/hotspot_config_dialog.ts +++ b/chrome/browser/resources/settings/chromeos/internet_page/hotspot_config_dialog.ts
@@ -21,7 +21,7 @@ import {getTemplate} from './hotspot_config_dialog.html.js'; -enum WiFiSecurityType { +export enum WiFiSecurityType { WPA2 = 'WPA2', WPA3 = 'WPA3', WPA2WPA3 = 'WPA2WPA3',
diff --git a/chrome/browser/resources/settings/chromeos/os_apps_page/app_management_page/actions.ts b/chrome/browser/resources/settings/chromeos/os_apps_page/app_management_page/actions.ts index e400cd0..1a580816 100644 --- a/chrome/browser/resources/settings/chromeos/os_apps_page/app_management_page/actions.ts +++ b/chrome/browser/resources/settings/chromeos/os_apps_page/app_management_page/actions.ts
@@ -30,8 +30,14 @@ value: string | null, }; -export type AppManagementActions = - AddAppAction|ChangeAppAction|RemoveAppAction|UpdateSelectedAppIdAction; +export type UpdateSubAppToParentAppIdAction = Action&{ + name: 'update-sub-app-to-parent-app-id', + subApp: string, + parent: string | null, +}; + +export type AppManagementActions = AddAppAction|ChangeAppAction|RemoveAppAction| + UpdateSelectedAppIdAction|UpdateSubAppToParentAppIdAction; export function addApp(app: App): AddAppAction { return { @@ -61,3 +67,12 @@ value: appId, }; } + +export function updateSubAppToParentAppId( + appId: string, parentAppId: string|null): UpdateSubAppToParentAppIdAction { + return { + name: 'update-sub-app-to-parent-app-id', + subApp: appId, + parent: parentAppId, + }; +}
diff --git a/chrome/browser/resources/settings/chromeos/os_apps_page/app_management_page/api_listener.ts b/chrome/browser/resources/settings/chromeos/os_apps_page/app_management_page/api_listener.ts index 22b6416..a6110f9 100644 --- a/chrome/browser/resources/settings/chromeos/os_apps_page/app_management_page/api_listener.ts +++ b/chrome/browser/resources/settings/chromeos/os_apps_page/app_management_page/api_listener.ts
@@ -16,9 +16,20 @@ async function init() { assert(!initialized); - const {apps: initialApps} = - await AppManagementBrowserProxy.getInstance().handler.getApps(); - const initialState = createInitialState(initialApps); + // Call two async functions and wait for both of them. + const getAppsPromise = + AppManagementBrowserProxy.getInstance().handler.getApps(); + const getSubAppToParentMapPromise = + AppManagementBrowserProxy.getInstance().handler.getSubAppToParentMap(); + + const responses = + await Promise.all([getAppsPromise, getSubAppToParentMapPromise]); + + const {apps: initialApps} = responses[0]; + const {subAppToParentMap: initialSubAppToParentMap} = responses[1]; + + const initialState = + createInitialState(initialApps, initialSubAppToParentMap); AppManagementStore.getInstance().init(initialState); const callbackRouter = AppManagementBrowserProxy.getInstance().callbackRouter;
diff --git a/chrome/browser/resources/settings/chromeos/os_apps_page/app_management_page/pwa_detail_view.html b/chrome/browser/resources/settings/chromeos/os_apps_page/app_management_page/pwa_detail_view.html index b40c4b5..e0e0844 100644 --- a/chrome/browser/resources/settings/chromeos/os_apps_page/app_management_page/pwa_detail_view.html +++ b/chrome/browser/resources/settings/chromeos/os_apps_page/app_management_page/pwa_detail_view.html
@@ -56,4 +56,9 @@ class="permission-card-row" app="[[app_]]"> </app-management-app-details-item> + <app-management-sub-apps-item + id="subAppsItem" + class="permission-card-row" + parent-app="[[app_]]"> + </app-management-sub-apps-item> </div>
diff --git a/chrome/browser/resources/settings/chromeos/os_apps_page/app_management_page/pwa_detail_view.ts b/chrome/browser/resources/settings/chromeos/os_apps_page/app_management_page/pwa_detail_view.ts index e320448..7e431dc 100644 --- a/chrome/browser/resources/settings/chromeos/os_apps_page/app_management_page/pwa_detail_view.ts +++ b/chrome/browser/resources/settings/chromeos/os_apps_page/app_management_page/pwa_detail_view.ts
@@ -4,6 +4,7 @@ import './app_details_item.js'; import './pin_to_shelf_item.js'; import './supported_links_item.js'; +import './sub_apps_item.js'; import './app_management_cros_shared_style.css.js'; import 'chrome://resources/cr_components/app_management/file_handling_item.js'; import 'chrome://resources/cr_components/app_management/icons.html.js';
diff --git a/chrome/browser/resources/settings/chromeos/os_apps_page/app_management_page/reducers.ts b/chrome/browser/resources/settings/chromeos/os_apps_page/app_management_page/reducers.ts index 6fdd297..74ceac01 100644 --- a/chrome/browser/resources/settings/chromeos/os_apps_page/app_management_page/reducers.ts +++ b/chrome/browser/resources/settings/chromeos/os_apps_page/app_management_page/reducers.ts
@@ -75,6 +75,21 @@ } } +function updateSubAppToParentAppId( + subAppToParentAppId: Record<string, string>, + action: AppManagementActions): Record<string, string> { + switch (action.name) { + case 'update-sub-app-to-parent-app-id': + if (action.parent) { + return {...subAppToParentAppId, [action.subApp]: action.parent}; + } + delete subAppToParentAppId[action.subApp]; + return {...subAppToParentAppId}; + default: + return subAppToParentAppId; + } +} + /** * Root reducer for the App Management page. This is called by the store in * response to an action, and the return value is used to update the UI. @@ -85,5 +100,7 @@ return { apps: updateApps(state.apps, action), selectedAppId: updateSelectedAppId(state.selectedAppId, action), + subAppToParentAppId: + updateSubAppToParentAppId(state.subAppToParentAppId, action), }; }
diff --git a/chrome/browser/resources/settings/chromeos/os_apps_page/app_management_page/store.ts b/chrome/browser/resources/settings/chromeos/os_apps_page/app_management_page/store.ts index 56240b5..7f720ae 100644 --- a/chrome/browser/resources/settings/chromeos/os_apps_page/app_management_page/store.ts +++ b/chrome/browser/resources/settings/chromeos/os_apps_page/app_management_page/store.ts
@@ -19,6 +19,9 @@ export interface AppManagementPageState { apps: AppMap; selectedAppId: string|null; + // Maps all apps to their parent's app ID. Apps without a parent are + // not listed in this map. + subAppToParentAppId: Record<string, string>; } let instance: AppManagementStore|null = null;
diff --git a/chrome/browser/resources/settings/chromeos/os_apps_page/app_management_page/sub_apps_item.html b/chrome/browser/resources/settings/chromeos/os_apps_page/app_management_page/sub_apps_item.html new file mode 100644 index 0000000..00ff49a --- /dev/null +++ b/chrome/browser/resources/settings/chromeos/os_apps_page/app_management_page/sub_apps_item.html
@@ -0,0 +1,23 @@ +<style include="app-management-cros-shared-style settings-shared"> + .sub-app-row:last-of-type { + border-bottom: none; + } +</style> +<div class="permission-section-header"> + <div class="header-text">[[getListHeadingString_(parentApp)]]</div> +</div> +<div class="permission-list indented-permission-block"> + <div id="subAppList"> + <template is="dom-repeat" items="[[subApps]]" as="subApp"> + <app-management-app-item app="[[subApp]]" class="sub-app-row"> + <cr-icon-button slot="right-content" + id$="app-subpage-button-[[subApp.id]]" + class="subpage-arrow app-management-item-arrow" + aria-label$="[[subApp.title]]" + role="link" + actionable> + </cr-icon-button> + </app-management-app-item> + </template> + </div> +</div> \ No newline at end of file
diff --git a/chrome/browser/resources/settings/chromeos/os_apps_page/app_management_page/sub_apps_item.ts b/chrome/browser/resources/settings/chromeos/os_apps_page/app_management_page/sub_apps_item.ts new file mode 100644 index 0000000..a9cb3fdf --- /dev/null +++ b/chrome/browser/resources/settings/chromeos/os_apps_page/app_management_page/sub_apps_item.ts
@@ -0,0 +1,75 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'chrome://resources/cr_components/localized_link/localized_link.js'; + +import {App} from 'chrome://resources/cr_components/app_management/app_management.mojom-webui.js'; +import {getSubAppsOfSelectedApp} from 'chrome://resources/cr_components/app_management/util.js'; +import {I18nMixin} from 'chrome://resources/cr_elements/i18n_mixin.js'; +import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; + +import {AppManagementStoreMixin} from './store_mixin.js'; +import {getTemplate} from './sub_apps_item.html.js'; + +const AppManagementSubAppsItemElementBase = + AppManagementStoreMixin(I18nMixin(PolymerElement)); + +class AppManagementSubAppsItemElement extends + AppManagementSubAppsItemElementBase { + static get is() { + return 'app-management-sub-apps-item'; + } + + static get template() { + return getTemplate(); + } + + static get properties() { + return { + parentApp: Object, + + hidden: { + type: Boolean, + computed: 'isHidden_(subApps)', + reflectToAttribute: true, + }, + + subApps: Object, + }; + } + + parentApp: App; + override hidden: boolean; + subApps: App[]; + + override connectedCallback(): void { + super.connectedCallback(); + + this.watch('subApps', state => getSubAppsOfSelectedApp(state)); + + this.updateFromStore(); + } + + private getListHeadingString_(): string { + return this.i18n( + 'appManagementSubAppsListHeading', + this.parentApp.title ? this.parentApp.title : ''); + } + + /** + * The sub app item is not available when an app has no sub apps. + */ + private isHidden_(subApps: App[]): boolean { + return !Array.isArray(subApps) || subApps.length === 0; + } +} + +declare global { + interface HTMLElementTagNameMap { + 'app-management-sub-apps-item': AppManagementSubAppsItemElement; + } +} + +customElements.define( + AppManagementSubAppsItemElement.is, AppManagementSubAppsItemElement);
diff --git a/chrome/browser/resources/settings/chromeos/os_settings.ts b/chrome/browser/resources/settings/chromeos/os_settings.ts index 231d9be..8538148 100644 --- a/chrome/browser/resources/settings/chromeos/os_settings.ts +++ b/chrome/browser/resources/settings/chromeos/os_settings.ts
@@ -61,6 +61,7 @@ import './os_apps_page/app_management_page/pwa_detail_view.js'; import './os_apps_page/app_management_page/app_management_cros_shared_style.css.js'; import './os_apps_page/app_management_page/app_management_cros_shared_vars.css.js'; +import './os_apps_page/app_management_page/sub_apps_item.js'; import './os_apps_page/app_management_page/supported_links_overlapping_apps_dialog.js'; import './os_apps_page/app_management_page/supported_links_dialog.js'; import './os_apps_page/app_management_page/supported_links_item.js'; @@ -126,6 +127,7 @@ export {SettingsPerDeviceTouchpadElement} from './device_page/per_device_touchpad.js'; export {SettingsPerDeviceTouchpadSubsectionElement} from './device_page/per_device_touchpad_subsection.js'; export {OsSettingsCellularSetupDialogElement} from './internet_page/cellular_setup_dialog.js'; +export {HotspotConfigDialogElement, WiFiSecurityType} from './internet_page/hotspot_config_dialog.js'; export {HotspotSummaryItemElement} from './internet_page/hotspot_summary_item.js'; export {InternetPageBrowserProxy, InternetPageBrowserProxyImpl} from './internet_page/internet_page_browser_proxy.js'; export {NetworkSummaryElement} from './internet_page/network_summary.js'; @@ -161,7 +163,7 @@ export {DeviceNameBrowserProxyImpl} from './os_about_page/device_name_browser_proxy.js'; export {DeviceNameState, SetDeviceNameResult} from './os_about_page/device_name_util.js'; export {AndroidAppsBrowserProxyImpl} from './os_apps_page/android_apps_browser_proxy.js'; -export {addApp, changeApp, removeApp, updateSelectedAppId} from './os_apps_page/app_management_page/actions.js'; +export {addApp, changeApp, removeApp, updateSelectedAppId, updateSubAppToParentAppId} from './os_apps_page/app_management_page/actions.js'; export {AppManagementBrowserProxy, AppManagementComponentBrowserProxy} from './os_apps_page/app_management_page/browser_proxy.js'; export {PluginVmBrowserProxyImpl} from './os_apps_page/app_management_page/plugin_vm_page/plugin_vm_browser_proxy.js'; export {reduceAction, updateApps} from './os_apps_page/app_management_page/reducers.js';
diff --git a/chrome/browser/supervised_user/child_accounts/child_account_service.cc b/chrome/browser/supervised_user/child_accounts/child_account_service.cc index 420a473d..626b324c 100644 --- a/chrome/browser/supervised_user/child_accounts/child_account_service.cc +++ b/chrome/browser/supervised_user/child_accounts/child_account_service.cc
@@ -29,9 +29,9 @@ #include "components/signin/public/identity_manager/account_info.h" #include "components/signin/public/identity_manager/accounts_in_cookie_jar_info.h" #include "components/signin/public/identity_manager/tribool.h" -#include "components/supervised_user/core/browser/kids_external_fetcher.h" #include "components/supervised_user/core/browser/proto/families_common.pb.h" #include "components/supervised_user/core/browser/proto/kidschromemanagement_messages.pb.h" +#include "components/supervised_user/core/browser/proto_fetcher.h" #include "components/supervised_user/core/browser/supervised_user_service.h" #include "components/supervised_user/core/browser/supervised_user_settings_service.h" #include "components/supervised_user/core/common/features.h" @@ -230,7 +230,7 @@ } void ChildAccountService::OnResponse( - KidsExternalFetcherStatus status, + supervised_user::ProtoFetcherStatus status, std::unique_ptr<kids_chrome_management::ListFamilyMembersResponse> response) { if (!status.IsOk()) { @@ -339,8 +339,9 @@ ScheduleNextFamilyInfoUpdate(kUpdateInterval); } -void ChildAccountService::OnFailure(KidsExternalFetcherStatus error) { - DLOG(WARNING) << "ListFamilyMembers failed with status " << error.ToString(); +void ChildAccountService::OnFailure( + supervised_user::ProtoFetcherStatus status) { + DLOG(WARNING) << "ListFamilyMembers failed with status " << status.ToString(); family_fetch_backoff_.InformOfRequest(false); ScheduleNextFamilyInfoUpdate(family_fetch_backoff_.GetTimeUntilRelease()); }
diff --git a/chrome/browser/supervised_user/child_accounts/child_account_service.h b/chrome/browser/supervised_user/child_accounts/child_account_service.h index 73e8a76f..dfbc9f64 100644 --- a/chrome/browser/supervised_user/child_accounts/child_account_service.h +++ b/chrome/browser/supervised_user/child_accounts/child_account_service.h
@@ -18,8 +18,8 @@ #include "components/keyed_service/core/keyed_service.h" #include "components/pref_registry/pref_registry_syncable.h" #include "components/signin/public/identity_manager/identity_manager.h" -#include "components/supervised_user/core/browser/kids_external_fetcher.h" #include "components/supervised_user/core/browser/proto/kidschromemanagement_messages.pb.h" +#include "components/supervised_user/core/browser/proto_fetcher.h" #include "components/supervised_user/core/browser/supervised_user_service.h" #include "components/supervised_user/core/common/pref_names.h" #include "net/base/backoff_entry.h" @@ -114,14 +114,14 @@ // Handles all responses from ListFamilyMembers service. void OnResponse( - KidsExternalFetcherStatus status, + supervised_user::ProtoFetcherStatus status, std::unique_ptr<kids_chrome_management::ListFamilyMembersResponse> response); void OnSuccess( const kids_chrome_management::ListFamilyMembersResponse& response); // Handles failed responses and schedules next fetch. - void OnFailure(KidsExternalFetcherStatus status); + void OnFailure(supervised_user::ProtoFetcherStatus status); // IdentityManager::Observer implementation. void OnAccountsInCookieUpdated( @@ -150,9 +150,8 @@ bool active_{false}; - std::unique_ptr< - KidsExternalFetcher<kids_chrome_management::ListFamilyMembersRequest, - kids_chrome_management::ListFamilyMembersResponse>> + std::unique_ptr<supervised_user::ProtoFetcher< + kids_chrome_management::ListFamilyMembersResponse>> list_family_members_fetcher_; // If fetching the family info fails, retry with exponential backoff. base::OneShotTimer family_fetch_timer_;
diff --git a/chrome/browser/supervised_user/kids_chrome_management/kids_management_service.cc b/chrome/browser/supervised_user/kids_chrome_management/kids_management_service.cc index 761059d4..35c790d 100644 --- a/chrome/browser/supervised_user/kids_chrome_management/kids_management_service.cc +++ b/chrome/browser/supervised_user/kids_chrome_management/kids_management_service.cc
@@ -28,9 +28,9 @@ #include "components/signin/public/identity_manager/identity_manager.h" #include "components/signin/public/identity_manager/primary_account_change_event.h" #include "components/signin/public/identity_manager/tribool.h" -#include "components/supervised_user/core/browser/kids_external_fetcher.h" #include "components/supervised_user/core/browser/proto/families_common.pb.h" #include "components/supervised_user/core/browser/proto/kidschromemanagement_messages.pb.h" +#include "components/supervised_user/core/browser/proto_fetcher.h" #include "components/supervised_user/core/browser/supervised_user_service.h" #include "components/supervised_user/core/common/buildflags.h" #include "components/supervised_user/core/common/features.h" @@ -248,7 +248,7 @@ } void KidsManagementService::ConsumeListFamilyMembers( - KidsExternalFetcherStatus status, + supervised_user::ProtoFetcherStatus status, std::unique_ptr<ListFamilyMembersResponse> response) { if (status.IsTransientError()) { list_family_members_backoff_.InformOfRequest(false);
diff --git a/chrome/browser/supervised_user/kids_chrome_management/kids_management_service.h b/chrome/browser/supervised_user/kids_chrome_management/kids_management_service.h index 82246465..0f920b8 100644 --- a/chrome/browser/supervised_user/kids_chrome_management/kids_management_service.h +++ b/chrome/browser/supervised_user/kids_chrome_management/kids_management_service.h
@@ -25,8 +25,8 @@ #include "components/signin/public/identity_manager/account_info.h" #include "components/signin/public/identity_manager/identity_manager.h" #include "components/signin/public/identity_manager/primary_account_change_event.h" -#include "components/supervised_user/core/browser/kids_external_fetcher.h" #include "components/supervised_user/core/browser/proto/kidschromemanagement_messages.pb.h" +#include "components/supervised_user/core/browser/proto_fetcher.h" #include "components/supervised_user/core/browser/supervised_user_service.h" #include "content/public/browser/browser_context.h" #include "net/base/backoff_entry.h" @@ -87,11 +87,10 @@ void AddChildStatusReceivedCallback(base::OnceClosure callback); private: - using ListFamilyMembersFetcher = - KidsExternalFetcher<kids_chrome_management::ListFamilyMembersRequest, - kids_chrome_management::ListFamilyMembersResponse>; + using ListFamilyMembersFetcher = supervised_user::ProtoFetcher< + kids_chrome_management::ListFamilyMembersResponse>; void ConsumeListFamilyMembers( - KidsExternalFetcherStatus status, + supervised_user::ProtoFetcherStatus status, std::unique_ptr<kids_chrome_management::ListFamilyMembersResponse> response);
diff --git a/chrome/browser/sync/test/integration/single_client_nigori_sync_test.cc b/chrome/browser/sync/test/integration/single_client_nigori_sync_test.cc index dca89af..65fd82af 100644 --- a/chrome/browser/sync/test/integration/single_client_nigori_sync_test.cc +++ b/chrome/browser/sync/test/integration/single_client_nigori_sync_test.cc
@@ -1261,17 +1261,9 @@ EXPECT_TRUE(PasswordFormsChecker(0, {password_form1, password_form2}).Wait()); } -// Flakily failing on Mac: https://crbug.com/1447428 -#if BUILDFLAG(IS_MAC) -#define MAYBE_ShoudRecordTrustedVaultErrorShownOnStartupWhenErrorShown \ - DISABLED_ShoudRecordTrustedVaultErrorShownOnStartupWhenErrorShown -#else -#define MAYBE_ShoudRecordTrustedVaultErrorShownOnStartupWhenErrorShown \ - ShoudRecordTrustedVaultErrorShownOnStartupWhenErrorShown -#endif IN_PROC_BROWSER_TEST_F( SingleClientNigoriWithWebApiTest, - MAYBE_ShoudRecordTrustedVaultErrorShownOnStartupWhenErrorShown) { + ShoudRecordTrustedVaultErrorShownOnStartupWhenErrorShown) { // 4 days is an arbitrary value between 3 days and 7 days to allow testing // histogram suffixes. const base::Time migration_time = base::Time::Now() - base::Days(4); @@ -1292,7 +1284,12 @@ ASSERT_TRUE(GetClient(0)->SignInPrimaryAccount()); ASSERT_TRUE(GetClient(0)->AwaitSyncTransportActive()); #endif // !BUILDFLAG(IS_CHROMEOS_ASH) - ASSERT_TRUE(SetupSync()); + // TODO(crbug.com/1448448): SetupSync(WAIT_FOR_COMMITS_TO_COMPLETE) (e.g. with + // default argument) causes test flakiness here due to unrelated issue in + // SharingService. From this test perspective it doesn't matter whether to use + // WAIT_FOR_COMMITS_TO_COMPLETE or WAIT_FOR_SYNC_SETUP_TO_COMPLETE, but it + // would be nice to use default argument once the issue is resolved. + ASSERT_TRUE(SetupSync(WAIT_FOR_SYNC_SETUP_TO_COMPLETE)); ASSERT_TRUE(GetSyncService(0) ->GetUserSettings()
diff --git a/chrome/browser/touch_to_fill/password_generation/android/internal/BUILD.gn b/chrome/browser/touch_to_fill/password_generation/android/internal/BUILD.gn index add0097..3d31eb47 100644 --- a/chrome/browser/touch_to_fill/password_generation/android/internal/BUILD.gn +++ b/chrome/browser/touch_to_fill/password_generation/android/internal/BUILD.gn
@@ -6,16 +6,52 @@ android_library("java") { deps = [ + ":java_resources", "//base:base_java", "//base:jni_java", + "//chrome/browser/autofill/android:java", + "//chrome/browser/password_manager/android:password_manager_resource_provider_java", + "//chrome/browser/touch_to_fill/common/android:java", + "//chrome/browser/touch_to_fill/common/android:java_resources", + "//chrome/browser/ui/android/strings:ui_strings_grd", "//components/browser_ui/bottomsheet/android:java", "//third_party/androidx:androidx_annotation_annotation_java", + "//third_party/androidx:androidx_appcompat_appcompat_resources_java", + "//third_party/androidx:androidx_recyclerview_recyclerview_java", "//ui/android:ui_java", ] - sources = [ "java/src/org/chromium/chrome/browser/touch_to_fill/password_generation/TouchToFillPasswordGenerationBridge.java" ] + sources = [ + "java/src/org/chromium/chrome/browser/touch_to_fill/password_generation/TouchToFillPasswordGenerationBridge.java", + "java/src/org/chromium/chrome/browser/touch_to_fill/password_generation/TouchToFillPasswordGenerationCoordinator.java", + "java/src/org/chromium/chrome/browser/touch_to_fill/password_generation/TouchToFillPasswordGenerationView.java", + ] annotation_processor_deps = [ "//base/android/jni_generator:jni_processor" ] resources_package = "org.chromium.chrome.browser.touch_to_fill.password_generation" } + +android_resources("java_resources") { + deps = [ "//ui/android:ui_java_resources" ] + sources = [ "java/res/layout/touch_to_fill_password_generation.xml" ] +} + +robolectric_library("junit") { + testonly = true + resources_package = + "org.chromium.chrome.browser.touch_to_fill.password_generation" + + sources = [ "java/src/org/chromium/chrome/browser/touch_to_fill/password_generation/TouchToFillPasswordGenerationModuleTest.java" ] + + deps = [ + ":java", + "//base:base_java", + "//base:base_java_test_support", + "//base:base_junit_test_support", + "//chrome/test/android:chrome_java_unit_test_support", + "//components/browser_ui/bottomsheet/android:java", + "//third_party/junit", + "//third_party/mockito:mockito_java", + ] +}
diff --git a/chrome/browser/touch_to_fill/password_generation/android/internal/java/res/layout/touch_to_fill_password_generation.xml b/chrome/browser/touch_to_fill/password_generation/android/internal/java/res/layout/touch_to_fill_password_generation.xml new file mode 100644 index 0000000..bfa75c40 --- /dev/null +++ b/chrome/browser/touch_to_fill/password_generation/android/internal/java/res/layout/touch_to_fill_password_generation.xml
@@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="utf-8"?> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + xmlns:app="http://schemas.android.com/apk/res-auto" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical"> + <ImageView + android:id="@+id/drag_handlebar" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center_horizontal" + android:layout_marginEnd="@dimen/touch_to_fill_sheet_margin_modern" + android:layout_marginStart="@dimen/touch_to_fill_sheet_margin_modern" + android:layout_marginTop="@dimen/ttf_drag_handlebar_margin" + android:layout_marginBottom="@dimen/ttf_drag_handlebar_margin" + android:importantForAccessibility="no" + app:srcCompat="@drawable/drag_handlebar" /> + <ImageView + android:id="@+id/touch_to_fill_sheet_header_image" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_gravity="center_horizontal" + android:importantForAccessibility="no" /> +</LinearLayout> \ No newline at end of file
diff --git a/chrome/browser/touch_to_fill/password_generation/android/internal/java/src/org/chromium/chrome/browser/touch_to_fill/password_generation/TouchToFillPasswordGenerationBridge.java b/chrome/browser/touch_to_fill/password_generation/android/internal/java/src/org/chromium/chrome/browser/touch_to_fill/password_generation/TouchToFillPasswordGenerationBridge.java index c1f882d..e15de84 100644 --- a/chrome/browser/touch_to_fill/password_generation/android/internal/java/src/org/chromium/chrome/browser/touch_to_fill/password_generation/TouchToFillPasswordGenerationBridge.java +++ b/chrome/browser/touch_to_fill/password_generation/android/internal/java/src/org/chromium/chrome/browser/touch_to_fill/password_generation/TouchToFillPasswordGenerationBridge.java
@@ -4,6 +4,8 @@ package org.chromium.chrome.browser.touch_to_fill.password_generation; +import android.content.Context; + import org.chromium.base.annotations.CalledByNative; import org.chromium.components.browser_ui.bottomsheet.BottomSheetController; import org.chromium.components.browser_ui.bottomsheet.BottomSheetControllerProvider; @@ -13,19 +15,23 @@ * JNI wrapper for C++ TouchToFillPasswordGenerationBridge. Delegates calls from native to Java. */ class TouchToFillPasswordGenerationBridge { + private TouchToFillPasswordGenerationCoordinator mCoordinator; + @CalledByNative private static TouchToFillPasswordGenerationBridge create(WindowAndroid windowAndroid) { BottomSheetController bottomSheetController = BottomSheetControllerProvider.from(windowAndroid); - return new TouchToFillPasswordGenerationBridge(bottomSheetController); + Context context = windowAndroid.getContext().get(); + return new TouchToFillPasswordGenerationBridge(context, bottomSheetController); } - private TouchToFillPasswordGenerationBridge(BottomSheetController bottomSheetController) { - // TODO(crbug.com/1421753): create the coordinator. + public TouchToFillPasswordGenerationBridge( + Context context, BottomSheetController bottomSheetController) { + mCoordinator = new TouchToFillPasswordGenerationCoordinator(context, bottomSheetController); } @CalledByNative - private void show() { - // TODO(crbug.com/1421753): implement showing the password generation bottom sheet. + public boolean show() { + return mCoordinator.show(); } }
diff --git a/chrome/browser/touch_to_fill/password_generation/android/internal/java/src/org/chromium/chrome/browser/touch_to_fill/password_generation/TouchToFillPasswordGenerationCoordinator.java b/chrome/browser/touch_to_fill/password_generation/android/internal/java/src/org/chromium/chrome/browser/touch_to_fill/password_generation/TouchToFillPasswordGenerationCoordinator.java new file mode 100644 index 0000000..00776a9 --- /dev/null +++ b/chrome/browser/touch_to_fill/password_generation/android/internal/java/src/org/chromium/chrome/browser/touch_to_fill/password_generation/TouchToFillPasswordGenerationCoordinator.java
@@ -0,0 +1,57 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.chrome.browser.touch_to_fill.password_generation; + +import android.content.Context; + +import androidx.annotation.VisibleForTesting; + +import org.chromium.components.browser_ui.bottomsheet.BottomSheetController; +import org.chromium.components.browser_ui.bottomsheet.BottomSheetController.StateChangeReason; +import org.chromium.components.browser_ui.bottomsheet.BottomSheetObserver; +import org.chromium.components.browser_ui.bottomsheet.EmptyBottomSheetObserver; + +/** + * Coordinates the password generation bottom sheet functionality. It shows the bottom sheet, fills + * in the generated password and handles the bottom sheet dismissal. + */ +class TouchToFillPasswordGenerationCoordinator { + private final TouchToFillPasswordGenerationView mTouchToFillPasswordGenerationView; + private final BottomSheetController mBottomSheetController; + private final BottomSheetObserver mBottomSheetObserver = new EmptyBottomSheetObserver() { + @Override + public void onSheetClosed(@StateChangeReason int reason) { + hide(); + } + }; + + public TouchToFillPasswordGenerationCoordinator( + Context context, BottomSheetController bottomSheetController) { + mBottomSheetController = bottomSheetController; + mTouchToFillPasswordGenerationView = new TouchToFillPasswordGenerationView(context); + } + + /** + * Displays the bottom sheet. + */ + public boolean show() { + mBottomSheetController.addObserver(mBottomSheetObserver); + if (mBottomSheetController.requestShowContent(mTouchToFillPasswordGenerationView, true)) { + return true; + } + mBottomSheetController.removeObserver(mBottomSheetObserver); + return false; + } + + public void hide() { + mBottomSheetController.removeObserver(mBottomSheetObserver); + mBottomSheetController.hideContent(mTouchToFillPasswordGenerationView, true); + } + + @VisibleForTesting + TouchToFillPasswordGenerationView getViewForTesting() { + return mTouchToFillPasswordGenerationView; + } +}
diff --git a/chrome/browser/touch_to_fill/password_generation/android/internal/java/src/org/chromium/chrome/browser/touch_to_fill/password_generation/TouchToFillPasswordGenerationModuleTest.java b/chrome/browser/touch_to_fill/password_generation/android/internal/java/src/org/chromium/chrome/browser/touch_to_fill/password_generation/TouchToFillPasswordGenerationModuleTest.java new file mode 100644 index 0000000..5594ddd --- /dev/null +++ b/chrome/browser/touch_to_fill/password_generation/android/internal/java/src/org/chromium/chrome/browser/touch_to_fill/password_generation/TouchToFillPasswordGenerationModuleTest.java
@@ -0,0 +1,70 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.chrome.browser.touch_to_fill.password_generation; + +import static org.mockito.Mockito.any; +import static org.mockito.Mockito.anyBoolean; +import static org.mockito.Mockito.doNothing; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import android.app.Activity; + +import org.junit.Before; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.ArgumentCaptor; +import org.mockito.Mock; +import org.mockito.MockitoAnnotations; +import org.mockito.junit.MockitoJUnit; +import org.mockito.junit.MockitoRule; +import org.mockito.quality.Strictness; +import org.robolectric.Robolectric; + +import org.chromium.base.test.BaseRobolectricTestRunner; +import org.chromium.base.test.util.Batch; +import org.chromium.components.browser_ui.bottomsheet.BottomSheetController; +import org.chromium.components.browser_ui.bottomsheet.BottomSheetController.StateChangeReason; +import org.chromium.components.browser_ui.bottomsheet.BottomSheetObserver; + +/** Tests for {@link TouchToFillPasswordGenerationBridge} */ +@RunWith(BaseRobolectricTestRunner.class) +@Batch(Batch.PER_CLASS) +public class TouchToFillPasswordGenerationModuleTest { + private TouchToFillPasswordGenerationCoordinator mCoordinator; + private final ArgumentCaptor<BottomSheetObserver> mBottomSheetObserverCaptor = + ArgumentCaptor.forClass(BottomSheetObserver.class); + + @Rule + public MockitoRule mMockitoRule = MockitoJUnit.rule().strictness(Strictness.STRICT_STUBS); + + @Mock + private BottomSheetController mBottomSheetController; + + @Before + public void setUp() { + MockitoAnnotations.openMocks(this); + setUpBottomSheetController(); + mCoordinator = new TouchToFillPasswordGenerationCoordinator( + Robolectric.buildActivity(Activity.class).get(), mBottomSheetController); + } + + private void setUpBottomSheetController() { + when(mBottomSheetController.requestShowContent(any(), anyBoolean())).thenReturn(true); + doNothing().when(mBottomSheetController).addObserver(mBottomSheetObserverCaptor.capture()); + } + + @Test + public void showsAndHidesBottomSheet() { + mCoordinator.show(); + verify(mBottomSheetController).requestShowContent(any(), anyBoolean()); + verify(mBottomSheetController).addObserver(any()); + + mBottomSheetObserverCaptor.getValue().onSheetClosed(StateChangeReason.SWIPE); + verify(mBottomSheetController).hideContent(any(), anyBoolean()); + verify(mBottomSheetController).removeObserver(mBottomSheetObserverCaptor.getValue()); + } +}
diff --git a/chrome/browser/touch_to_fill/password_generation/android/internal/java/src/org/chromium/chrome/browser/touch_to_fill/password_generation/TouchToFillPasswordGenerationView.java b/chrome/browser/touch_to_fill/password_generation/android/internal/java/src/org/chromium/chrome/browser/touch_to_fill/password_generation/TouchToFillPasswordGenerationView.java new file mode 100644 index 0000000..6033d7d --- /dev/null +++ b/chrome/browser/touch_to_fill/password_generation/android/internal/java/src/org/chromium/chrome/browser/touch_to_fill/password_generation/TouchToFillPasswordGenerationView.java
@@ -0,0 +1,98 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.chrome.browser.touch_to_fill.password_generation; + +import android.content.Context; +import android.view.LayoutInflater; +import android.view.View; +import android.widget.ImageView; + +import androidx.annotation.Nullable; +import androidx.appcompat.content.res.AppCompatResources; + +import org.chromium.chrome.browser.password_manager.PasswordManagerResourceProviderFactory; +import org.chromium.components.browser_ui.bottomsheet.BottomSheetContent; + +/** + * This class is responsible for rendering the password generation bottom sheet. It is a View in + * this Model-View-Controller component and doesn't inherit but holds Android Views. + */ +class TouchToFillPasswordGenerationView implements BottomSheetContent { + private final View mContent; + + TouchToFillPasswordGenerationView(Context context) { + mContent = LayoutInflater.from(context).inflate( + R.layout.touch_to_fill_password_generation, null); + ImageView sheetHeaderImage = mContent.findViewById(R.id.touch_to_fill_sheet_header_image); + sheetHeaderImage.setImageDrawable(AppCompatResources.getDrawable( + context, PasswordManagerResourceProviderFactory.create().getPasswordManagerIcon())); + } + + @Override + public View getContentView() { + return mContent; + } + + @Nullable + @Override + public View getToolbarView() { + return null; + } + + @Override + public int getVerticalScrollOffset() { + return 0; + } + + @Override + public void destroy() {} + + @Override + public int getPriority() { + return BottomSheetContent.ContentPriority.HIGH; + } + + @Override + public boolean swipeToDismissEnabled() { + return false; + } + + @Override + public int getSheetContentDescriptionStringId() { + return R.string.password_generation_bottom_sheet_content_description; + } + + @Override + public int getSheetHalfHeightAccessibilityStringId() { + // Half-height is disabled so no need for an accessibility string. + assert false : "This method should not be called"; + return 0; + } + + @Override + public int getSheetFullHeightAccessibilityStringId() { + return R.string.password_generation_bottom_sheet_content_description; + } + + @Override + public int getSheetClosedAccessibilityStringId() { + return R.string.password_generation_bottom_sheet_closed; + } + + @Override + public float getHalfHeightRatio() { + return HeightMode.DISABLED; + } + + @Override + public float getFullHeightRatio() { + return HeightMode.WRAP_CONTENT; + } + + @Override + public int getPeekHeight() { + return HeightMode.DISABLED; + } +}
diff --git a/chrome/browser/touch_to_fill/password_generation/android/touch_to_fill_password_generation_bridge_impl.cc b/chrome/browser/touch_to_fill/password_generation/android/touch_to_fill_password_generation_bridge_impl.cc index f498f0ea..2aa5a097 100644 --- a/chrome/browser/touch_to_fill/password_generation/android/touch_to_fill_password_generation_bridge_impl.cc +++ b/chrome/browser/touch_to_fill/password_generation/android/touch_to_fill_password_generation_bridge_impl.cc
@@ -32,7 +32,6 @@ base::android::AttachCurrentThread(), web_contents->GetNativeView()->GetWindowAndroid()->GetJavaObject())); - Java_TouchToFillPasswordGenerationBridge_show( + return Java_TouchToFillPasswordGenerationBridge_show( base::android::AttachCurrentThread(), java_object_); - return true; }
diff --git a/chrome/browser/ui/BUILD.gn b/chrome/browser/ui/BUILD.gn index 3efe4af..ddc2a5d 100644 --- a/chrome/browser/ui/BUILD.gn +++ b/chrome/browser/ui/BUILD.gn
@@ -3213,6 +3213,10 @@ "webui/settings/ash/files_page/google_drive_page_handler.h", "webui/settings/ash/files_page/google_drive_page_handler_factory.cc", "webui/settings/ash/files_page/google_drive_page_handler_factory.h", + "webui/settings/ash/files_page/one_drive_page_handler.cc", + "webui/settings/ash/files_page/one_drive_page_handler.h", + "webui/settings/ash/files_page/one_drive_page_handler_factory.cc", + "webui/settings/ash/files_page/one_drive_page_handler_factory.h", "webui/settings/ash/files_section.cc", "webui/settings/ash/files_section.h", "webui/settings/ash/fingerprint_handler.cc",
diff --git a/chrome/browser/ui/android/signin/java/res/layout/signin_first_run_landscape_view.xml b/chrome/browser/ui/android/signin/java/res/layout/signin_first_run_landscape_view.xml index c2776b5a..e6adb14 100644 --- a/chrome/browser/ui/android/signin/java/res/layout/signin_first_run_landscape_view.xml +++ b/chrome/browser/ui/android/signin/java/res/layout/signin_first_run_landscape_view.xml
@@ -22,67 +22,83 @@ android:importantForAccessibility="no" android:src="@drawable/fre_product_logo" /> - <LinearLayout - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_marginEnd="60dp" - android:layout_centerVertical="true" - android:layout_toEndOf="@id/fre_logo" - android:orientation="vertical"> - - <LinearLayout - android:layout_width="wrap_content" + <ScrollView + android:layout_width="match_parent" android:layout_height="wrap_content" - android:paddingStart="24dp" - android:paddingBottom="12dp" - android:orientation="vertical"> + android:layout_above="@id/fre_footer_viewgroup" + android:layout_toEndOf="@id/fre_logo" + android:layout_marginEnd="60dp" + android:layout_centerVertical="true" + android:fadeScrollbars="false" + android:fillViewport="true"> - <TextView - android:id="@+id/title" + <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" - android:lineSpacingMultiplier="1.2" - android:gravity="start" - android:text="@string/fre_welcome" - android:textAppearance="@style/TextAppearance.Headline.Primary" /> + android:paddingStart="24dp" + android:paddingBottom="12dp" + android:orientation="vertical"> - <org.chromium.ui.widget.TextViewWithLeading - android:id="@+id/subtitle" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:gravity="start" - android:paddingTop="8dp" - android:textAppearance="@style/TextAppearance.TextMedium.Secondary" - android:visibility="gone" - app:leading="@dimen/text_size_medium_leading" /> - - <FrameLayout - android:id="@+id/fre_browser_managed_by" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginTop="16dp"> - - <include - layout="@layout/fre_tos_privacy_disclaimer" - android:id="@+id/privacy_disclaimer" + <TextView + android:id="@+id/title" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:gravity="start" /> + android:lineSpacingMultiplier="1.2" + android:gravity="start" + android:text="@string/fre_welcome" + android:textAppearance="@style/TextAppearance.Headline.Primary" /> - </FrameLayout> + <org.chromium.ui.widget.TextViewWithLeading + android:id="@+id/subtitle" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:gravity="start" + android:paddingTop="8dp" + android:textAppearance="@style/TextAppearance.TextMedium.Secondary" + android:visibility="gone" + app:leading="@dimen/text_size_medium_leading" /> - <ProgressBar - android:id="@+id/fre_native_and_policy_load_progress_spinner" - style="@style/Widget.AppCompat.ProgressBar" - android:layout_width="32dp" - android:layout_height="32dp" - android:layout_marginTop="20dp" - android:layout_marginBottom="50dp" - android:layout_gravity="center_horizontal" - android:alpha="0.0" /> - </LinearLayout> + <FrameLayout + android:id="@+id/fre_browser_managed_by" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="16dp"> - <include layout="@layout/signin_first_run_bottom_group_view" /> + <include + layout="@layout/fre_tos_privacy_disclaimer" + android:id="@+id/privacy_disclaimer" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:gravity="start" /> + + </FrameLayout> + + <ProgressBar + android:id="@+id/fre_native_and_policy_load_progress_spinner" + style="@style/Widget.AppCompat.ProgressBar" + android:layout_width="32dp" + android:layout_height="32dp" + android:layout_marginTop="20dp" + android:layout_marginBottom="50dp" + android:layout_gravity="center_horizontal" + android:alpha="0.0" /> + + + <include layout="@layout/signin_first_run_bottom_group_view" /> + + </LinearLayout> + + </ScrollView> + + <!-- The footer is hidden during native and policy load. The FrameLayout + acts as an anchor point for the ScrollView above so it can properly + calculate it's height. --> + <FrameLayout + android:id="@+id/fre_footer_viewgroup" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_toEndOf="@id/fre_logo" + android:layout_alignParentBottom="true"> <org.chromium.ui.widget.TextViewWithClickableSpans android:id="@+id/signin_fre_footer" @@ -95,7 +111,7 @@ android:textAppearance="@style/TextAppearance.TextSmall.Secondary" android:text="@string/signin_fre_footer" app:leading="@dimen/text_size_small_leading" /> - </LinearLayout> + </FrameLayout> <FrameLayout android:layout_width="match_parent"
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd index 22371bb0..cb03bb9 100644 --- a/chrome/browser/ui/android/strings/android_chrome_strings.grd +++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd
@@ -5733,6 +5733,14 @@ <message name="IDS_QUICK_DELETE_SNACKBAR_MESSAGE" desc="Text inside the snackbar which is shown once the user confirms deletion via the 'Delete last 15 minutes' option present inside the three dots menu."> Deleted </message> + + <!-- Password generation bottom sheet --> + <message name="IDS_PASSWORD_GENERATION_BOTTOM_SHEET_CONTENT_DESCRIPTION" desc="Accessibility string read when the bottom sheet is opened. It describes that the bottom sheet proposes a generated password to be automatically filled into the sign up form and saved to the Password Manager."> + Strong password suggested. Keyboard hidden. + </message> + <message name="IDS_PASSWORD_GENERATION_BOTTOM_SHEET_CLOSED" desc="Accessibility string read when the password generation bottom sheet is closed."> + Password suggestion is closed. + </message> </messages> </release> </grit>
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_PASSWORD_GENERATION_BOTTOM_SHEET_CLOSED.png.sha1 b/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_PASSWORD_GENERATION_BOTTOM_SHEET_CLOSED.png.sha1 new file mode 100644 index 0000000..6b202643 --- /dev/null +++ b/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_PASSWORD_GENERATION_BOTTOM_SHEET_CLOSED.png.sha1
@@ -0,0 +1 @@ +9b3b02d8e1826dec53026855b37f115e3d73e3b1 \ No newline at end of file
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_PASSWORD_GENERATION_BOTTOM_SHEET_CONTENT_DESCRIPTION.png.sha1 b/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_PASSWORD_GENERATION_BOTTOM_SHEET_CONTENT_DESCRIPTION.png.sha1 new file mode 100644 index 0000000..6b202643 --- /dev/null +++ b/chrome/browser/ui/android/strings/android_chrome_strings_grd/IDS_PASSWORD_GENERATION_BOTTOM_SHEET_CONTENT_DESCRIPTION.png.sha1
@@ -0,0 +1 @@ +9b3b02d8e1826dec53026855b37f115e3d73e3b1 \ No newline at end of file
diff --git a/chrome/browser/ui/browser_tab_strip_tracker.h b/chrome/browser/ui/browser_tab_strip_tracker.h index e084423..8669d461 100644 --- a/chrome/browser/ui/browser_tab_strip_tracker.h +++ b/chrome/browser/ui/browser_tab_strip_tracker.h
@@ -5,7 +5,7 @@ #ifndef CHROME_BROWSER_UI_BROWSER_TAB_STRIP_TRACKER_H_ #define CHROME_BROWSER_UI_BROWSER_TAB_STRIP_TRACKER_H_ -#include "base/memory/raw_ptr_exclusion.h" +#include "base/memory/raw_ptr.h" #include "chrome/browser/ui/browser_list_observer.h" class BrowserTabStripTrackerDelegate; @@ -53,12 +53,8 @@ void OnBrowserAdded(Browser* browser) override; void OnBrowserRemoved(Browser* browser) override; - // This field is not a raw_ptr<> because it was filtered by the rewriter for: - // #union - RAW_PTR_EXCLUSION TabStripModelObserver* const tab_strip_model_observer_; - // This field is not a raw_ptr<> because it was filtered by the rewriter for: - // #union - RAW_PTR_EXCLUSION BrowserTabStripTrackerDelegate* const delegate_; + raw_ptr<TabStripModelObserver> const tab_strip_model_observer_; + raw_ptr<BrowserTabStripTrackerDelegate> const delegate_; bool is_processing_initial_browsers_; };
diff --git a/chrome/browser/ui/content_settings/content_setting_image_model.cc b/chrome/browser/ui/content_settings/content_setting_image_model.cc index 0351510..b7cc963 100644 --- a/chrome/browser/ui/content_settings/content_setting_image_model.cc +++ b/chrome/browser/ui/content_settings/content_setting_image_model.cc
@@ -8,6 +8,7 @@ #include <utility> #include "base/feature_list.h" +#include "base/memory/raw_ptr_exclusion.h" #include "base/metrics/field_trial_params.h" #include "base/metrics/user_metrics.h" #include "base/metrics/user_metrics_action.h" @@ -246,7 +247,9 @@ struct ContentSettingsImageDetails { ContentSettingsType content_type; - const gfx::VectorIcon& icon; + // This field is not a raw_ref<> because it was filtered by the rewriter for: + // #global-scope + RAW_PTR_EXCLUSION const gfx::VectorIcon& icon; int blocked_tooltip_id; int blocked_explanatory_text_id; int accessed_tooltip_id;
diff --git a/chrome/browser/ui/global_media_controls/presentation_request_notification_item.cc b/chrome/browser/ui/global_media_controls/presentation_request_notification_item.cc index 64de862..e1a44d4 100644 --- a/chrome/browser/ui/global_media_controls/presentation_request_notification_item.cc +++ b/chrome/browser/ui/global_media_controls/presentation_request_notification_item.cc
@@ -80,8 +80,8 @@ } PresentationRequestNotificationItem::~PresentationRequestNotificationItem() { - if (provider_.is_bound()) { - provider_->HideItem(); + if (provider_->is_bound()) { + (*provider_)->HideItem(); } } @@ -154,7 +154,7 @@ } void PresentationRequestNotificationItem::UpdatePickerWithMetadata() { - if (!provider_.is_bound()) { + if (!provider_->is_bound()) { return; } // If we have metadata from the media session, use that. @@ -174,16 +174,16 @@ if (web_contents && data.artist.empty()) { data.artist = web_contents->GetTitle(); } - provider_->OnMetadataChanged(data); + (*provider_)->OnMetadataChanged(data); } void PresentationRequestNotificationItem::UpdatePickerWithImages() { - if (!provider_.is_bound()) { + if (!provider_->is_bound()) { return; } - provider_->OnArtworkImageChanged(artwork_image_); + (*provider_)->OnArtworkImageChanged(artwork_image_); if (!favicon_image_.isNull()) { - provider_->OnFaviconImageChanged(favicon_image_); + (*provider_)->OnFaviconImageChanged(favicon_image_); return; } // Otherwise, get one ourselves. @@ -192,12 +192,12 @@ favicon::FaviconDriver* favicon_driver = favicon::ContentFaviconDriver::FromWebContents(web_contents); if (favicon_driver) { - provider_->OnFaviconImageChanged( - favicon_driver->GetFavicon().AsImageSkia()); + (*provider_) + ->OnFaviconImageChanged(favicon_driver->GetFavicon().AsImageSkia()); return; } } - provider_->OnFaviconImageChanged(gfx::ImageSkia()); + (*provider_)->OnFaviconImageChanged(gfx::ImageSkia()); } void PresentationRequestNotificationItem::OnArtworkBitmap(
diff --git a/chrome/browser/ui/global_media_controls/presentation_request_notification_item.h b/chrome/browser/ui/global_media_controls/presentation_request_notification_item.h index 135b027fc0..80f57195 100644 --- a/chrome/browser/ui/global_media_controls/presentation_request_notification_item.h +++ b/chrome/browser/ui/global_media_controls/presentation_request_notification_item.h
@@ -9,6 +9,7 @@ #include <string> #include "base/memory/raw_ptr_exclusion.h" +#include "base/memory/raw_ref.h" #include "base/memory/weak_ptr.h" #include "components/global_media_controls/public/mojom/device_service.mojom.h" #include "components/media_message_center/media_notification_item.h" @@ -108,7 +109,8 @@ gfx::ImageSkia artwork_image_; gfx::ImageSkia favicon_image_; - const mojo::Remote<global_media_controls::mojom::DevicePickerProvider>& + const raw_ref< + const mojo::Remote<global_media_controls::mojom::DevicePickerProvider>> provider_; base::WeakPtrFactory<PresentationRequestNotificationItem> weak_ptr_factory_{
diff --git a/chrome/browser/ui/startup/startup_browser_creator_browsertest.cc b/chrome/browser/ui/startup/startup_browser_creator_browsertest.cc index 4eb6c335..3693d426e 100644 --- a/chrome/browser/ui/startup/startup_browser_creator_browsertest.cc +++ b/chrome/browser/ui/startup/startup_browser_creator_browsertest.cc
@@ -16,7 +16,6 @@ #include "base/json/json_writer.h" #include "base/memory/ptr_util.h" #include "base/memory/raw_ptr.h" -#include "base/memory/raw_ptr_exclusion.h" #include "base/path_service.h" #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" @@ -353,9 +352,7 @@ void OnBrowserRemoved(Browser* browser) override {} - // This field is not a raw_ptr<> because it was filtered by the rewriter for: - // #constexpr-ctor-field-initializer - RAW_PTR_EXCLUSION Browser* added_browser_ = nullptr; + raw_ptr<Browser> added_browser_ = nullptr; }; // Test that when there is a popup as the active browser any requests to
diff --git a/chrome/browser/ui/views/side_panel/read_anything/read_anything_model.h b/chrome/browser/ui/views/side_panel/read_anything/read_anything_model.h index 32f7796..6c776ba 100644 --- a/chrome/browser/ui/views/side_panel/read_anything/read_anything_model.h +++ b/chrome/browser/ui/views/side_panel/read_anything/read_anything_model.h
@@ -9,6 +9,7 @@ #include <string> #include <vector> +#include "base/memory/raw_ptr_exclusion.h" #include "base/observer_list.h" #include "base/observer_list_types.h" #include "base/strings/utf_string_conversions.h" @@ -213,7 +214,9 @@ std::u16string name; // The resources value/identifier for the icon image asset. - const gfx::VectorIcon& icon_asset; + // This field is not a raw_ref<> because it was filtered by the rewriter + // for: #constexpr-ctor-field-initializer + RAW_PTR_EXCLUSION const gfx::VectorIcon& icon_asset; }; bool IsValidIndex(size_t index) override; @@ -251,7 +254,9 @@ std::u16string name; // The resources value/identifier for the icon image asset. - const gfx::VectorIcon& icon_asset; + // This field is not a raw_ref<> because it was filtered by the rewriter + // for: #constexpr-ctor-field-initializer + RAW_PTR_EXCLUSION const gfx::VectorIcon& icon_asset; }; bool IsValidIndex(size_t index) override;
diff --git a/chrome/browser/ui/views/tabs/fade_label_view.cc b/chrome/browser/ui/views/tabs/fade_label_view.cc index 0d41ecc6..2520738 100644 --- a/chrome/browser/ui/views/tabs/fade_label_view.cc +++ b/chrome/browser/ui/views/tabs/fade_label_view.cc
@@ -21,7 +21,7 @@ void FadeLabel::SetData(const FadeLabelViewData& data) { data_ = data; std::u16string text = data.text; - const bool is_filename = data.is_filename; + absl::optional<bool> is_filename = data.is_filename; SetElideBehavior(is_filename ? gfx::NO_ELIDE : gfx::ELIDE_TAIL); if (is_filename) { text = TruncateFilenameToTwoLines(text);
diff --git a/chrome/browser/ui/views/toolbar/toolbar_button.h b/chrome/browser/ui/views/toolbar/toolbar_button.h index 3487f5c..98611b8 100644 --- a/chrome/browser/ui/views/toolbar/toolbar_button.h +++ b/chrome/browser/ui/views/toolbar/toolbar_button.h
@@ -228,8 +228,12 @@ }; struct VectorIcons { - const gfx::VectorIcon& icon; - const gfx::VectorIcon& touch_icon; + // This field is not a raw_ref<> because it was filtered by the rewriter + // for: #constexpr-ctor-field-initializer + RAW_PTR_EXCLUSION const gfx::VectorIcon& icon; + // This field is not a raw_ref<> because it was filtered by the rewriter + // for: #constexpr-ctor-field-initializer + RAW_PTR_EXCLUSION const gfx::VectorIcon& touch_icon; }; void TouchUiChanged();
diff --git a/chrome/browser/ui/views/web_apps/web_app_integration_test_driver.cc b/chrome/browser/ui/views/web_apps/web_app_integration_test_driver.cc index 7f8d903d..5544913 100644 --- a/chrome/browser/ui/views/web_apps/web_app_integration_test_driver.cc +++ b/chrome/browser/ui/views/web_apps/web_app_integration_test_driver.cc
@@ -2332,7 +2332,7 @@ })); // If there are still install sources, the app might not be fully uninstalled, // so this will listen for the removal of the policy install source. - provider()->install_finalizer().SetRemoveManagementTypeCallbackForTesting( + observer.SetWebAppSourceRemovedDelegate( base::BindLambdaForTesting([&](const AppId& app_id) { if (policy_app->id == app_id) { run_loop.Quit(); @@ -3865,14 +3865,14 @@ })); // If there are still install sources, the app might not be fully uninstalled, // so this will listen for the removal of the policy install source. - WebAppProvider* provider = WebAppProvider::GetForTest(profile); - provider->install_finalizer().SetRemoveManagementTypeCallbackForTesting( + observer.SetWebAppSourceRemovedDelegate( base::BindLambdaForTesting([&](const AppId& app_id) { if (id == app_id) { run_loop.Quit(); } })); + WebAppProvider* provider = WebAppProvider::GetForTest(profile); const WebApp* web_app = provider->registrar_unsafe().GetAppById(id); ASSERT_TRUE(web_app);
diff --git a/chrome/browser/ui/webui/app_management/app_management_page_handler.cc b/chrome/browser/ui/webui/app_management/app_management_page_handler.cc index 89c7071e..455c1ce 100644 --- a/chrome/browser/ui/webui/app_management/app_management_page_handler.cc +++ b/chrome/browser/ui/webui/app_management/app_management_page_handler.cc
@@ -24,6 +24,7 @@ #include "chrome/browser/apps/app_service/app_service_proxy_factory.h" #include "chrome/browser/extensions/extension_service.h" #include "chrome/browser/profiles/profile.h" +#include "chrome/browser/web_applications/locks/all_apps_lock.h" #include "chrome/browser/web_applications/os_integration/os_integration_manager.h" #include "chrome/browser/web_applications/web_app_provider.h" #include "chrome/browser/web_applications/web_app_utils.h" @@ -55,6 +56,10 @@ #if BUILDFLAG(IS_CHROMEOS_ASH) #include "ash/components/arc/session/connection_holder.h" #include "chrome/browser/ash/app_list/arc/arc_app_utils.h" +#include "chrome/browser/ash/crosapi/crosapi_ash.h" +#include "chrome/browser/ash/crosapi/crosapi_manager.h" +#include "chrome/browser/ash/crosapi/web_app_service_ash.h" +#include "chromeos/crosapi/mojom/web_app_service.mojom.h" #endif #if BUILDFLAG(IS_WIN) @@ -264,6 +269,39 @@ std::move(callback).Run(std::move(app)); } +void AppManagementPageHandler::GetSubAppToParentMap( + GetSubAppToParentMapCallback callback) { + auto* provider = web_app::WebAppProvider::GetForWebApps(profile_); + if (provider) { + // Web apps are managed in the current process (Ash or Lacros). + provider->scheduler().ScheduleCallbackWithLock<web_app::AllAppsLock>( + "AppManagementPageHandler::GetSubAppToParentMap", + std::make_unique<web_app::AllAppsLockDescription>(), + base::BindOnce([](web_app::AllAppsLock& lock) { + return lock.registrar().GetSubAppToParentMap(); + }).Then(std::move(callback))); + return; + } + +#if BUILDFLAG(IS_CHROMEOS_ASH) + // Web app data needs to be fetched from the Lacros process. + crosapi::mojom::WebAppProviderBridge* web_app_provider_bridge = + crosapi::CrosapiManager::Get() + ->crosapi_ash() + ->web_app_service_ash() + ->GetWebAppProviderBridge(); + if (web_app_provider_bridge) { + web_app_provider_bridge->GetSubAppToParentMap(std::move(callback)); + return; + } + LOG(ERROR) << "Could not find WebAppProviderBridge."; +#endif // BUILDFLAG(IS_CHROMEOS_ASH) + + // Reaching here means that WebAppProviderBridge and WebAppProvider were both + // not found. + std::move(callback).Run(base::flat_map<std::string, std::string>()); +} + void AppManagementPageHandler::GetExtensionAppPermissionMessages( const std::string& app_id, GetExtensionAppPermissionMessagesCallback callback) {
diff --git a/chrome/browser/ui/webui/app_management/app_management_page_handler.h b/chrome/browser/ui/webui/app_management/app_management_page_handler.h index 44ae50879..c80cb61 100644 --- a/chrome/browser/ui/webui/app_management/app_management_page_handler.h +++ b/chrome/browser/ui/webui/app_management/app_management_page_handler.h
@@ -7,6 +7,7 @@ #include "base/memory/raw_ptr.h" #include "base/memory/raw_ref.h" +#include "base/memory/weak_ptr.h" #include "base/scoped_observation.h" #include "build/chromeos_buildflags.h" #include "chrome/browser/web_applications/app_registrar_observer.h" @@ -62,6 +63,7 @@ // app_management::mojom::PageHandler: void GetApps(GetAppsCallback callback) override; void GetApp(const std::string& app_id, GetAppCallback callback) override; + void GetSubAppToParentMap(GetSubAppToParentMapCallback callback) override; void GetExtensionAppPermissionMessages( const std::string& app_id, GetExtensionAppPermissionMessagesCallback callback) override;
diff --git a/chrome/browser/ui/webui/ash/chrome_web_ui_configs_chromeos.cc b/chrome/browser/ui/webui/ash/chrome_web_ui_configs_chromeos.cc index 68e3c7f..907444d 100644 --- a/chrome/browser/ui/webui/ash/chrome_web_ui_configs_chromeos.cc +++ b/chrome/browser/ui/webui/ash/chrome_web_ui_configs_chromeos.cc
@@ -122,8 +122,7 @@ // Consider the following approaches when registering component // WebUIConfigs, in order of preference: // 1. Using a Delegate with MakeComponentConfigWithDelegate, -// 2. Using custom arguments with MakeComponentConfigWithArgs, -// 3. Using a custom MakeConfig() method (least preferred, avoid if possible). +// 2. Using a custom MakeConfig() method (least preferred, avoid if possible). template <class Config, class Controller, class Delegate> std::unique_ptr<content::WebUIConfig> MakeComponentConfigWithDelegate() { @@ -137,33 +136,28 @@ return std::make_unique<Config>(create_controller_func); } -template <class Config, class Controller, typename... Args> -std::unique_ptr<content::WebUIConfig> MakeComponentConfigWithArgs( - Args&&... args) { - CreateWebUIControllerFunc create_controller_func = base::BindRepeating( - [](const std::decay_t<Args>&... args, content::WebUI* web_ui, - const GURL& url) -> std::unique_ptr<content::WebUIController> { - return std::make_unique<Controller>(web_ui, args...); - }, - args...); - - return std::make_unique<Config>(create_controller_func); -} - std::unique_ptr<content::WebUIConfig> MakeConnectivityDiagnosticsUIConfig() { - return MakeComponentConfigWithArgs<ConnectivityDiagnosticsUIConfig, - ConnectivityDiagnosticsUI>( - /* BindNetworkDiagnosticsServiceCallback */ - base::BindRepeating(&network_health::NetworkHealthManager:: - NetworkDiagnosticsServiceCallback), - /* BindNetworkHealthServiceCallback */ - base::BindRepeating( - &network_health::NetworkHealthManager::NetworkHealthServiceCallback), - /* SendFeedbackReportCallback */ - base::BindRepeating( - &chrome::ShowFeedbackDialogForWebUI, - chrome::WebUIFeedbackSource::kConnectivityDiagnostics), - /*show_feedback_button=*/!chrome::IsRunningInAppMode()); + CreateWebUIControllerFunc create_controller_func = base::BindRepeating( + [](content::WebUI* web_ui, + const GURL& url) -> std::unique_ptr<content::WebUIController> { + return std::make_unique<ConnectivityDiagnosticsUI>( + web_ui, + /* BindNetworkDiagnosticsServiceCallback */ + base::BindRepeating(&network_health::NetworkHealthManager:: + NetworkDiagnosticsServiceCallback), + /* BindNetworkHealthServiceCallback */ + base::BindRepeating(&network_health::NetworkHealthManager:: + NetworkHealthServiceCallback), + /* SendFeedbackReportCallback */ + base::BindRepeating( + &chrome::ShowFeedbackDialogForWebUI, + chrome::WebUIFeedbackSource::kConnectivityDiagnostics), + /*show_feedback_button=*/ + !chrome::IsRunningInAppMode()); + }); + + return std::make_unique<ConnectivityDiagnosticsUIConfig>( + create_controller_func); } std::unique_ptr<content::WebUIConfig> MakeDiagnosticsUIConfig() { @@ -204,6 +198,17 @@ return std::make_unique<eche_app::EcheAppUIConfig>(create_controller_func); } +std::unique_ptr<content::WebUIConfig> MakeGuestOSInstallerUIConfig() { + CreateWebUIControllerFunc create_controller_func = base::BindRepeating( + [](content::WebUI* web_ui, + const GURL& url) -> std::unique_ptr<content::WebUIController> { + return std::make_unique<GuestOSInstallerUI>( + web_ui, base::BindRepeating(&guest_os::InstallerDelegateFactory)); + }); + + return std::make_unique<GuestOSInstallerUIConfig>(create_controller_func); +} + void RegisterAshChromeWebUIConfigs() { // Add `WebUIConfig`s for Ash ChromeOS to the list here. // @@ -250,9 +255,7 @@ file_manager::FileManagerUI, ChromeFileManagerUIDelegate>()); map.AddWebUIConfig(std::make_unique<FirmwareUpdateAppUIConfig>()); - map.AddWebUIConfig( - MakeComponentConfigWithArgs<GuestOSInstallerUIConfig, GuestOSInstallerUI>( - base::BindRepeating(&guest_os::InstallerDelegateFactory))); + map.AddWebUIConfig(MakeGuestOSInstallerUIConfig()); map.AddWebUIConfig(std::make_unique<HealthdInternalsUIConfig>()); map.AddWebUIConfig( MakeComponentConfigWithDelegate<HelpAppUIConfig, HelpAppUI,
diff --git a/chrome/browser/ui/webui/ash/edu_account_login_handler.cc b/chrome/browser/ui/webui/ash/edu_account_login_handler.cc index 2ca92a2..89ae727e 100644 --- a/chrome/browser/ui/webui/ash/edu_account_login_handler.cc +++ b/chrome/browser/ui/webui/ash/edu_account_login_handler.cc
@@ -23,8 +23,8 @@ #include "components/image_fetcher/core/image_fetcher_service.h" #include "components/image_fetcher/core/request_metadata.h" #include "components/signin/public/base/avatar_icon_util.h" -#include "components/supervised_user/core/browser/kids_external_fetcher.h" #include "components/supervised_user/core/browser/proto/kidschromemanagement_messages.pb.h" +#include "components/supervised_user/core/browser/proto_fetcher.h" #include "content/public/browser/storage_partition.h" #include "google_apis/gaia/gaia_constants.h" #include "ui/base/resource/resource_bundle.h" @@ -259,7 +259,7 @@ } void EduAccountLoginHandler::OnListFamilyMembersResponse( - KidsExternalFetcherStatus status, + supervised_user::ProtoFetcherStatus status, std::unique_ptr<kids_chrome_management::ListFamilyMembersResponse> response) { if (!status.IsOk()) { @@ -296,7 +296,7 @@ } void EduAccountLoginHandler::OnListFamilyMembersFailure( - KidsExternalFetcherStatus status) { + supervised_user::ProtoFetcherStatus status) { list_family_members_fetcher_.reset(); RejectJavascriptCallback(base::Value(get_parents_callback_id_), base::Value::List());
diff --git a/chrome/browser/ui/webui/ash/edu_account_login_handler.h b/chrome/browser/ui/webui/ash/edu_account_login_handler.h index 5d425d5..b020bebc 100644 --- a/chrome/browser/ui/webui/ash/edu_account_login_handler.h +++ b/chrome/browser/ui/webui/ash/edu_account_login_handler.h
@@ -19,8 +19,8 @@ #include "components/image_fetcher/core/image_fetcher.h" #include "components/signin/public/identity_manager/access_token_info.h" #include "components/signin/public/identity_manager/primary_account_access_token_fetcher.h" -#include "components/supervised_user/core/browser/kids_external_fetcher.h" #include "components/supervised_user/core/browser/proto/kidschromemanagement_messages.pb.h" +#include "components/supervised_user/core/browser/proto_fetcher.h" #include "content/public/browser/web_ui_message_handler.h" #include "google_apis/gaia/gaia_auth_consumer.h" #include "google_apis/gaia/gaia_auth_fetcher.h" @@ -118,12 +118,12 @@ // ListFamilyMembers fetch handlers. void OnListFamilyMembersResponse( - KidsExternalFetcherStatus status, + supervised_user::ProtoFetcherStatus status, std::unique_ptr<kids_chrome_management::ListFamilyMembersResponse> response); void OnListFamilyMembersSuccess( const kids_chrome_management::ListFamilyMembersResponse& response); - void OnListFamilyMembersFailure(KidsExternalFetcherStatus status); + void OnListFamilyMembersFailure(supervised_user::ProtoFetcherStatus status); // ProfileImageFetcher callback void OnParentProfileImagesFetched( @@ -153,9 +153,8 @@ // Reference to NetworkStateInformer that handles changes in network // state. scoped_refptr<NetworkStateInformer> network_state_informer_; - std::unique_ptr< - KidsExternalFetcher<kids_chrome_management::ListFamilyMembersRequest, - kids_chrome_management::ListFamilyMembersResponse>> + std::unique_ptr<supervised_user::ProtoFetcher< + kids_chrome_management::ListFamilyMembersResponse>> list_family_members_fetcher_; std::unique_ptr<ProfileImageFetcher> profile_image_fetcher_;
diff --git a/chrome/browser/ui/webui/ash/edu_account_login_handler_unittest.cc b/chrome/browser/ui/webui/ash/edu_account_login_handler_unittest.cc index e02b483..f6c0de0 100644 --- a/chrome/browser/ui/webui/ash/edu_account_login_handler_unittest.cc +++ b/chrome/browser/ui/webui/ash/edu_account_login_handler_unittest.cc
@@ -19,8 +19,8 @@ #include "components/image_fetcher/core/request_metadata.h" #include "components/signin/public/identity_manager/identity_manager.h" #include "components/signin/public/identity_manager/identity_test_environment.h" -#include "components/supervised_user/core/browser/kids_external_fetcher.h" #include "components/supervised_user/core/browser/proto/kidschromemanagement_messages.pb.h" +#include "components/supervised_user/core/browser/proto_fetcher.h" #include "content/public/test/test_web_ui.h" #include "net/base/net_errors.h" #include "services/network/public/cpp/shared_url_loader_factory.h" @@ -275,7 +275,8 @@ // Simulate failed fetching of family members. handler()->OnListFamilyMembersFailure( - KidsExternalFetcherStatus::HttpStatusOrNetError(net::ERR_IO_PENDING)); + supervised_user::ProtoFetcherStatus::HttpStatusOrNetError( + net::ERR_IO_PENDING)); const content::TestWebUI::CallData& data = *web_ui()->call_data().back(); VerifyJavascriptCallbackResolved(data, callback_id, /*success=*/false);
diff --git a/chrome/browser/ui/webui/autofill_and_password_manager_internals/internals_ui_handler.h b/chrome/browser/ui/webui/autofill_and_password_manager_internals/internals_ui_handler.h index 5ea8a469..1e816f1 100644 --- a/chrome/browser/ui/webui/autofill_and_password_manager_internals/internals_ui_handler.h +++ b/chrome/browser/ui/webui/autofill_and_password_manager_internals/internals_ui_handler.h
@@ -8,7 +8,7 @@ #include <string> #include "base/functional/bind.h" -#include "base/memory/raw_ptr_exclusion.h" +#include "base/memory/raw_ptr.h" #include "components/autofill/core/browser/logging/log_receiver.h" #include "content/public/browser/browsing_data_remover.h" #include "content/public/browser/web_ui_message_handler.h" @@ -49,10 +49,7 @@ private: // Implements content::BrowsingDataRemover::Observer. void OnBrowsingDataRemoverDone(uint64_t failed_data_types) override; - - // This field is not a raw_ptr<> because it was filtered by the rewriter for: - // #union - RAW_PTR_EXCLUSION content::BrowsingDataRemover* remover_; + raw_ptr<content::BrowsingDataRemover> remover_; Callback callback_; };
diff --git a/chrome/browser/ui/webui/settings/ash/apps_section.cc b/chrome/browser/ui/webui/settings/ash/apps_section.cc index 0715f95..8e0d933 100644 --- a/chrome/browser/ui/webui/settings/ash/apps_section.cc +++ b/chrome/browser/ui/webui/settings/ash/apps_section.cc
@@ -286,6 +286,8 @@ {"appManagementPrintingPermissionLabel", IDS_APP_MANAGEMENT_PRINTING}, {"appManagementSearchPrompt", IDS_APP_MANAGEMENT_SEARCH_PROMPT}, {"appManagementStoragePermissionLabel", IDS_APP_MANAGEMENT_STORAGE}, + {"appManagementSubAppsListHeading", + IDS_APP_MANAGEMENT_SUB_APPS_LIST_HEADING}, {"appManagementUninstallLabel", IDS_APP_MANAGEMENT_UNINSTALL_APP}, {"close", IDS_CLOSE}, {"fileHandlingOverflowDialogTitle",
diff --git a/chrome/browser/ui/webui/settings/ash/files_page/mojom/BUILD.gn b/chrome/browser/ui/webui/settings/ash/files_page/mojom/BUILD.gn index 4e77d3d6..e140c15 100644 --- a/chrome/browser/ui/webui/settings/ash/files_page/mojom/BUILD.gn +++ b/chrome/browser/ui/webui/settings/ash/files_page/mojom/BUILD.gn
@@ -8,7 +8,10 @@ assert(is_chromeos_ash) mojom("mojom") { - sources = [ "google_drive_handler.mojom" ] + sources = [ + "google_drive_handler.mojom", + "one_drive_handler.mojom", + ] webui_module_path = "/" use_typescript_sources = true
diff --git a/chrome/browser/ui/webui/settings/ash/files_page/mojom/one_drive_handler.mojom b/chrome/browser/ui/webui/settings/ash/files_page/mojom/one_drive_handler.mojom new file mode 100644 index 0000000..bd2e683 --- /dev/null +++ b/chrome/browser/ui/webui/settings/ash/files_page/mojom/one_drive_handler.mojom
@@ -0,0 +1,26 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module ash.settings.one_drive.mojom; + +// Lives in the browser process. A renderer uses this to create a page handler +// that enables communication between a renderer and the browser process. +interface PageHandlerFactory { + // Creates a PageHandler and connects it up to the Page. + CreatePageHandler(pending_remote<Page> page, + pending_receiver<PageHandler> handler); +}; + +// Lives in the browser process. A renderer uses this to invoke methods that +// are implemented in the browser process. +interface PageHandler { + // Returns the email address associated with the currently connected OneDrive + // account. + GetUserEmailAddress() => (string? email); +}; + +// Interface for the OneDrive settings. Implemented in Javascript and +// used by the page handler to send asynchronous updates. +interface Page { +};
diff --git a/chrome/browser/ui/webui/settings/ash/files_page/one_drive_page_handler.cc b/chrome/browser/ui/webui/settings/ash/files_page/one_drive_page_handler.cc new file mode 100644 index 0000000..93319a3e --- /dev/null +++ b/chrome/browser/ui/webui/settings/ash/files_page/one_drive_page_handler.cc
@@ -0,0 +1,75 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/ui/webui/settings/ash/files_page/one_drive_page_handler.h" + +#include "chrome/browser/ash/file_system_provider/mount_path_util.h" +#include "chrome/browser/ash/file_system_provider/provided_file_system_info.h" +#include "chrome/browser/ash/file_system_provider/provided_file_system_interface.h" +#include "chrome/browser/ash/file_system_provider/service.h" +#include "chrome/browser/ui/webui/ash/cloud_upload/cloud_upload_dialog.h" +#include "chrome/browser/ui/webui/settings/ash/files_page/mojom/one_drive_handler.mojom.h" +#include "third_party/abseil-cpp/absl/types/optional.h" + +namespace ash::settings { + +namespace { +void OnGetEmailAddress( + OneDrivePageHandler::GetUserEmailAddressCallback callback, + const ash::file_system_provider::Actions& actions, + base::File::Error result) { + if (result != base::File::Error::FILE_OK) { + LOG(ERROR) << "Failed to get actions: " << result; + std::move(callback).Run(absl::nullopt); + return; + } + for (const file_system_provider::Action& action : actions) { + if (action.id == cloud_upload::kUserEmailActionId) { + std::move(callback).Run(action.title); + return; + } + } + std::move(callback).Run(absl::nullopt); +} +} // namespace + +OneDrivePageHandler::OneDrivePageHandler( + mojo::PendingReceiver<one_drive::mojom::PageHandler> receiver, + mojo::PendingRemote<one_drive::mojom::Page> page, + Profile* profile) + : profile_(profile), + page_(std::move(page)), + receiver_(this, std::move(receiver)) {} + +OneDrivePageHandler::~OneDrivePageHandler() = default; + +void OneDrivePageHandler::GetUserEmailAddress( + GetUserEmailAddressCallback callback) { + file_system_provider::Service* service = + file_system_provider::Service::Get(profile_); + file_system_provider::ProviderId provider_id = + file_system_provider::ProviderId::CreateFromExtensionId( + file_manager::file_tasks::GetODFSExtensionId(profile_)); + std::vector<file_system_provider::ProvidedFileSystemInfo> + odfs_file_system_infos = + service->GetProvidedFileSystemInfoList(provider_id); + if (odfs_file_system_infos.size() == 0) { + // ODFS is not mounted. + std::move(callback).Run(absl::nullopt); + return; + } + if (odfs_file_system_infos.size() != 1u) { + LOG(ERROR) << "One and only one filesystem should be mounted for the ODFS " + "extension"; + std::move(callback).Run(absl::nullopt); + return; + } + auto* file_system = service->GetProvidedFileSystem( + provider_id, odfs_file_system_infos[0].file_system_id()); + file_system->GetActions( + {base::FilePath("/")}, + base::BindOnce(&OnGetEmailAddress, std::move(callback))); +} + +} // namespace ash::settings
diff --git a/chrome/browser/ui/webui/settings/ash/files_page/one_drive_page_handler.h b/chrome/browser/ui/webui/settings/ash/files_page/one_drive_page_handler.h new file mode 100644 index 0000000..c119583 --- /dev/null +++ b/chrome/browser/ui/webui/settings/ash/files_page/one_drive_page_handler.h
@@ -0,0 +1,45 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_UI_WEBUI_SETTINGS_ASH_FILES_PAGE_ONE_DRIVE_PAGE_HANDLER_H_ +#define CHROME_BROWSER_UI_WEBUI_SETTINGS_ASH_FILES_PAGE_ONE_DRIVE_PAGE_HANDLER_H_ + +#include "base/memory/raw_ptr.h" +#include "base/memory/weak_ptr.h" +#include "chrome/browser/ui/webui/settings/ash/files_page/mojom/one_drive_handler.mojom.h" +#include "mojo/public/cpp/bindings/pending_receiver.h" +#include "mojo/public/cpp/bindings/pending_remote.h" +#include "mojo/public/cpp/bindings/receiver.h" +#include "mojo/public/cpp/bindings/remote.h" + +class Profile; + +namespace ash::settings { + +// Page handler for settings related to OneDrive. +class OneDrivePageHandler : public one_drive::mojom::PageHandler { + public: + OneDrivePageHandler( + mojo::PendingReceiver<one_drive::mojom::PageHandler> receiver, + mojo::PendingRemote<one_drive::mojom::Page> page, + Profile* profile); + + OneDrivePageHandler(const OneDrivePageHandler&) = delete; + OneDrivePageHandler& operator=(const OneDrivePageHandler&) = delete; + + ~OneDrivePageHandler() override; + + private: + // one_drive::mojom::PageHandler: + void GetUserEmailAddress(GetUserEmailAddressCallback callback) override; + + raw_ptr<Profile> profile_; + mojo::Remote<one_drive::mojom::Page> page_; + mojo::Receiver<one_drive::mojom::PageHandler> receiver_{this}; + base::WeakPtrFactory<OneDrivePageHandler> weak_ptr_factory_{this}; +}; + +} // namespace ash::settings + +#endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_ASH_FILES_PAGE_ONE_DRIVE_PAGE_HANDLER_H_
diff --git a/chrome/browser/ui/webui/settings/ash/files_page/one_drive_page_handler_factory.cc b/chrome/browser/ui/webui/settings/ash/files_page/one_drive_page_handler_factory.cc new file mode 100644 index 0000000..381da58 --- /dev/null +++ b/chrome/browser/ui/webui/settings/ash/files_page/one_drive_page_handler_factory.cc
@@ -0,0 +1,33 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/ui/webui/settings/ash/files_page/one_drive_page_handler_factory.h" + +#include <memory> +#include <utility> + +#include "chrome/browser/ui/webui/settings/ash/files_page/mojom/one_drive_handler.mojom.h" + +namespace ash::settings { + +OneDrivePageHandlerFactory::OneDrivePageHandlerFactory( + Profile* profile, + mojo::PendingReceiver<one_drive::mojom::PageHandlerFactory> receiver) + : profile_(profile) { + page_factory_receiver_.Bind(std::move(receiver)); +} + +OneDrivePageHandlerFactory::~OneDrivePageHandlerFactory() = default; + +void OneDrivePageHandlerFactory::CreatePageHandler( + mojo::PendingRemote<one_drive::mojom::Page> page, + mojo::PendingReceiver<one_drive::mojom::PageHandler> receiver) { + DCHECK(page); + DCHECK(!page_handler_); + + page_handler_ = std::make_unique<OneDrivePageHandler>( + std::move(receiver), std::move(page), profile_); +} + +} // namespace ash::settings
diff --git a/chrome/browser/ui/webui/settings/ash/files_page/one_drive_page_handler_factory.h b/chrome/browser/ui/webui/settings/ash/files_page/one_drive_page_handler_factory.h new file mode 100644 index 0000000..36e8d57 --- /dev/null +++ b/chrome/browser/ui/webui/settings/ash/files_page/one_drive_page_handler_factory.h
@@ -0,0 +1,47 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_UI_WEBUI_SETTINGS_ASH_FILES_PAGE_ONE_DRIVE_PAGE_HANDLER_FACTORY_H_ +#define CHROME_BROWSER_UI_WEBUI_SETTINGS_ASH_FILES_PAGE_ONE_DRIVE_PAGE_HANDLER_FACTORY_H_ + +#include <memory> + +#include "chrome/browser/ui/webui/settings/ash/files_page/mojom/one_drive_handler.mojom.h" +#include "chrome/browser/ui/webui/settings/ash/files_page/one_drive_page_handler.h" +#include "mojo/public/cpp/bindings/pending_receiver.h" +#include "mojo/public/cpp/bindings/pending_remote.h" +#include "mojo/public/cpp/bindings/receiver.h" + +class Profile; + +namespace ash::settings { + +class OneDrivePageHandlerFactory : public one_drive::mojom::PageHandlerFactory { + public: + OneDrivePageHandlerFactory( + Profile* profile, + mojo::PendingReceiver<one_drive::mojom::PageHandlerFactory> receiver); + + OneDrivePageHandlerFactory(const OneDrivePageHandlerFactory&) = delete; + OneDrivePageHandlerFactory& operator=(const OneDrivePageHandlerFactory&) = + delete; + + ~OneDrivePageHandlerFactory() override; + + private: + // one_drive::mojom::PageHandlerFactory: + void CreatePageHandler( + mojo::PendingRemote<one_drive::mojom::Page> page, + mojo::PendingReceiver<one_drive::mojom::PageHandler> receiver) override; + + raw_ptr<Profile> profile_; + + std::unique_ptr<OneDrivePageHandler> page_handler_; + mojo::Receiver<one_drive::mojom::PageHandlerFactory> page_factory_receiver_{ + this}; +}; + +} // namespace ash::settings + +#endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_ASH_FILES_PAGE_ONE_DRIVE_PAGE_HANDLER_FACTORY_H_
diff --git a/chrome/browser/ui/webui/settings/ash/os_settings_manager.cc b/chrome/browser/ui/webui/settings/ash/os_settings_manager.cc index 2df8267..f75c04f 100644 --- a/chrome/browser/ui/webui/settings/ash/os_settings_manager.cc +++ b/chrome/browser/ui/webui/settings/ash/os_settings_manager.cc
@@ -5,6 +5,7 @@ #include "chrome/browser/ui/webui/settings/ash/os_settings_manager.h" #include "ash/public/cpp/input_device_settings_controller.h" +#include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/webui/settings/ash/hierarchy.h" #include "chrome/browser/ui/webui/settings/ash/input_device_settings/input_device_settings_provider.h" #include "chrome/browser/ui/webui/settings/ash/os_apps_page/app_notification_handler.h" @@ -49,7 +50,8 @@ hierarchy_(std::make_unique<Hierarchy>(sections_.get())), settings_user_action_tracker_( std::make_unique<SettingsUserActionTracker>(hierarchy_.get(), - sections_.get())), + sections_.get(), + profile->GetPrefs())), search_handler_( std::make_unique<SearchHandler>(search_tag_registry_.get(), sections_.get(),
diff --git a/chrome/browser/ui/webui/settings/ash/search/per_session_settings_user_action_tracker.cc b/chrome/browser/ui/webui/settings/ash/search/per_session_settings_user_action_tracker.cc index 088e9e5..4b1c69f3 100644 --- a/chrome/browser/ui/webui/settings/ash/search/per_session_settings_user_action_tracker.cc +++ b/chrome/browser/ui/webui/settings/ash/search/per_session_settings_user_action_tracker.cc
@@ -5,6 +5,8 @@ #include "chrome/browser/ui/webui/settings/ash/search/per_session_settings_user_action_tracker.h" #include "base/metrics/histogram_functions.h" +#include "base/strings/string_number_conversions.h" +#include "chrome/common/pref_names.h" namespace ash::settings { @@ -32,9 +34,11 @@ } // namespace -PerSessionSettingsUserActionTracker::PerSessionSettingsUserActionTracker() +PerSessionSettingsUserActionTracker::PerSessionSettingsUserActionTracker( + PrefService* pref_service) : metric_start_time_(base::TimeTicks::Now()), - window_last_active_timestamp_(base::TimeTicks::Now()) {} + window_last_active_timestamp_(base::TimeTicks::Now()), + pref_service_(pref_service) {} PerSessionSettingsUserActionTracker::~PerSessionSettingsUserActionTracker() { RecordPageActiveTime(); @@ -44,6 +48,19 @@ base::UmaHistogramCounts1000( "ChromeOS.Settings.NumUniqueSettingsChanged.PerSession", changed_settings_.size()); + + // Record number of unique settings changed in this session. + absl::optional<int> total_unique_settings_changed_count = + UpdateSettingsPrefTotalUniqueChanged(); + + // If the number of total unique setting used increased, flagged by the + // optional variable total_unique_settings_changed_count having a value, add + // the datapoint to the histogram. + if (total_unique_settings_changed_count.has_value()) { + base::UmaHistogramCounts1000( + "ChromeOS.Settings.NumUniqueSettingsChanged.DeviceLifetime", + total_unique_settings_changed_count.value()); + } } void PerSessionSettingsUserActionTracker::RecordPageFocus() { @@ -95,7 +112,8 @@ void PerSessionSettingsUserActionTracker::RecordSettingChange( absl::optional<chromeos::settings::mojom::Setting> setting) { if (setting.has_value()) { - changed_settings_.insert(setting.value()); + changed_settings_.insert( + base::NumberToString(static_cast<int>(setting.value()))); } base::TimeTicks now = base::TimeTicks::Now(); @@ -142,4 +160,33 @@ num_searches_since_start_time_ = 0u; } +absl::optional<int> +PerSessionSettingsUserActionTracker::UpdateSettingsPrefTotalUniqueChanged() { + // Fetch the dictionary from the pref. + base::Value::Dict writeable_dict = + pref_service_->GetDict(prefs::kTotalUniqueOsSettingsChanged).Clone(); + int current_count = writeable_dict.size(); + + // Set the dictionary. + // Value is a constant 1 since we only want to know which Setting has been + // used, not how many times it has been used. + constexpr int value = 1; + for (const std::string& setting_string : changed_settings_) { + if (!writeable_dict.contains(setting_string)) { + writeable_dict.Set(setting_string, value); + } + } + + // Save to pref. + int new_count = writeable_dict.size(); + pref_service_->SetDict(prefs::kTotalUniqueOsSettingsChanged, + std::move(writeable_dict)); + + // If the new size of the pref dictionary is the same as before, we do not + // want to record that in UMA so we will return a nullopt to flag not to add + // to histogram bucket. + return current_count == new_count ? absl::nullopt + : absl::optional<int>{new_count}; +} + } // namespace ash::settings
diff --git a/chrome/browser/ui/webui/settings/ash/search/per_session_settings_user_action_tracker.h b/chrome/browser/ui/webui/settings/ash/search/per_session_settings_user_action_tracker.h index 2ba3e113..9397c8b8 100644 --- a/chrome/browser/ui/webui/settings/ash/search/per_session_settings_user_action_tracker.h +++ b/chrome/browser/ui/webui/settings/ash/search/per_session_settings_user_action_tracker.h
@@ -9,6 +9,7 @@ #include "base/time/time.h" #include "chrome/browser/ui/webui/settings/chromeos/constants/setting.mojom.h" +#include "components/prefs/pref_service.h" #include "third_party/abseil-cpp/absl/types/optional.h" namespace ash::settings { @@ -19,7 +20,7 @@ // should be created for that new session. class PerSessionSettingsUserActionTracker { public: - PerSessionSettingsUserActionTracker(); + explicit PerSessionSettingsUserActionTracker(PrefService* pref_service); PerSessionSettingsUserActionTracker( const PerSessionSettingsUserActionTracker& other) = delete; PerSessionSettingsUserActionTracker& operator=( @@ -40,8 +41,7 @@ void RecordSettingChange(absl::optional<chromeos::settings::mojom::Setting> setting = absl::nullopt); - const std::set<chromeos::settings::mojom::Setting>& - GetChangedSettingsForTesting() { + const std::set<std::string>& GetChangedSettingsForTesting() { return changed_settings_; } const base::TimeDelta& GetTotalTimeSessionActiveForTesting() { @@ -56,6 +56,11 @@ void ResetMetricsCountersAndTimestamp(); + // Returns the size of the pref dict if it changes. Otherwise, no value will + // get returned if if there were no new unique settings changed in the + // session. + absl::optional<int> UpdateSettingsPrefTotalUniqueChanged(); + // Time at which the last setting change metric was recorded since the window // has been focused, or null if no setting change has been recorded since the // window has been focused. Note that if the user blurs the window then @@ -80,7 +85,7 @@ base::TimeTicks last_blur_timestamp_; // Tracks which settings have been changed in this user session - std::set<chromeos::settings::mojom::Setting> changed_settings_; + std::set<std::string> changed_settings_; // Total time the Settings page has been active and in focus from the opening // of the page to closing. Blur events pause the timer. @@ -88,6 +93,8 @@ // The point in time which the Settings page was last active and in focus. base::TimeTicks window_last_active_timestamp_; + + raw_ptr<PrefService> pref_service_; }; } // namespace ash::settings
diff --git a/chrome/browser/ui/webui/settings/ash/search/per_session_settings_user_action_tracker_unittest.cc b/chrome/browser/ui/webui/settings/ash/search/per_session_settings_user_action_tracker_unittest.cc index 0417cc2..9213d8e 100644 --- a/chrome/browser/ui/webui/settings/ash/search/per_session_settings_user_action_tracker_unittest.cc +++ b/chrome/browser/ui/webui/settings/ash/search/per_session_settings_user_action_tracker_unittest.cc
@@ -5,30 +5,53 @@ #include "chrome/browser/ui/webui/settings/ash/search/per_session_settings_user_action_tracker.h" #include "base/test/metrics/histogram_tester.h" -#include "base/test/task_environment.h" #include "base/time/time.h" +#include "chrome/test/base/browser_with_test_window_test.h" +#include "chrome/test/base/testing_browser_process.h" +#include "chrome/test/base/testing_profile.h" +#include "chrome/test/base/testing_profile_manager.h" #include "testing/gtest/include/gtest/gtest.h" +using chromeos::settings::mojom::Setting; + namespace ash::settings { +constexpr char kProfileName[] = "user@gmail.com"; + class PerSessionSettingsUserActionTrackerTest : public testing::Test { protected: PerSessionSettingsUserActionTrackerTest() = default; ~PerSessionSettingsUserActionTrackerTest() override = default; void SetUp() override { - tracker_ = std::make_unique<PerSessionSettingsUserActionTracker>(); + profile_manager_ = std::make_unique<TestingProfileManager>( + TestingBrowserProcess::GetGlobal()); + ASSERT_TRUE(profile_manager_->SetUp()); + testing_profile_ = profile_manager_->CreateTestingProfile(kProfileName); + test_pref_service_ = testing_profile_->GetPrefs(); + tracker_ = std::make_unique<PerSessionSettingsUserActionTracker>( + test_pref_service_); } void TearDown() override { if (tracker_) { tracker_.reset(); } + profile_manager_->DeleteTestingProfile(kProfileName); + testing_profile_ = nullptr; + profile_manager_.reset(); } - base::test::TaskEnvironment task_environment_{ + std::string SettingAsIntString(Setting setting) { + return base::NumberToString(static_cast<int>(setting)); + } + + content::BrowserTaskEnvironment task_environment_{ base::test::TaskEnvironment::TimeSource::MOCK_TIME}; base::HistogramTester histogram_tester_; + TestingProfile* testing_profile_; + raw_ptr<PrefService> test_pref_service_; + std::unique_ptr<TestingProfileManager> profile_manager_; std::unique_ptr<PerSessionSettingsUserActionTracker> tracker_; }; @@ -198,13 +221,13 @@ } TEST_F(PerSessionSettingsUserActionTrackerTest, TestUniqueChangedSettings) { - std::set<chromeos::settings::mojom::Setting> expected_set; + std::set<std::string> expected_set; // Flip the WiFi toggle in Settings, this is a unique Setting that is changing // so the number of unique settings that have been changed increases by 1 for // a total of 1 - tracker_->RecordSettingChange(chromeos::settings::mojom::Setting::kWifiOnOff); - expected_set = {chromeos::settings::mojom::Setting::kWifiOnOff}; + tracker_->RecordSettingChange(Setting::kWifiOnOff); + expected_set = {SettingAsIntString(Setting::kWifiOnOff)}; EXPECT_EQ(expected_set, tracker_->GetChangedSettingsForTesting()); // Destruct tracker_ to trigger recording the data to the histogram. @@ -216,7 +239,8 @@ // Create a new PerSessionSettingsUserActionTracker to imitate a newly opened // Settings page. - tracker_ = std::make_unique<PerSessionSettingsUserActionTracker>(); + tracker_ = + std::make_unique<PerSessionSettingsUserActionTracker>(test_pref_service_); // test that the set has been destructed and cleared appropriately expected_set = {}; @@ -225,11 +249,10 @@ // Flip the Do Not Disturb and WiFi toggles in Settings, this is a unique // Setting that is changing so the number of unique settings that have been // changed increases by 1 for a total of 2 - tracker_->RecordSettingChange( - chromeos::settings::mojom::Setting::kDoNotDisturbOnOff); - tracker_->RecordSettingChange(chromeos::settings::mojom::Setting::kWifiOnOff); - expected_set = {chromeos::settings::mojom::Setting::kDoNotDisturbOnOff, - chromeos::settings::mojom::Setting::kWifiOnOff}; + tracker_->RecordSettingChange(Setting::kDoNotDisturbOnOff); + tracker_->RecordSettingChange(Setting::kWifiOnOff); + expected_set = {SettingAsIntString(Setting::kDoNotDisturbOnOff), + SettingAsIntString(Setting::kWifiOnOff)}; EXPECT_EQ(expected_set, tracker_->GetChangedSettingsForTesting()); // Destruct tracker_ to trigger recording the data to the histogram. @@ -241,17 +264,16 @@ // Create a new PerSessionSettingsUserActionTracker to imitate a newly opened // Settings page. - tracker_ = std::make_unique<PerSessionSettingsUserActionTracker>(); + tracker_ = + std::make_unique<PerSessionSettingsUserActionTracker>(test_pref_service_); // Flip the Do Not Disturb and WiFi toggles. Flip Do Not Disturb toggle again // in Settings, this is not a unique Setting that is changing so the number of // unique settings that have been changed does not increase. The bucket sample // 2 should now have 2 counts. - tracker_->RecordSettingChange( - chromeos::settings::mojom::Setting::kDoNotDisturbOnOff); - tracker_->RecordSettingChange(chromeos::settings::mojom::Setting::kWifiOnOff); - tracker_->RecordSettingChange( - chromeos::settings::mojom::Setting::kDoNotDisturbOnOff); + tracker_->RecordSettingChange(Setting::kDoNotDisturbOnOff); + tracker_->RecordSettingChange(Setting::kWifiOnOff); + tracker_->RecordSettingChange(Setting::kDoNotDisturbOnOff); // expected_set will not change EXPECT_EQ(expected_set, tracker_->GetChangedSettingsForTesting()); @@ -271,6 +293,81 @@ } TEST_F(PerSessionSettingsUserActionTrackerTest, + TestTotalUniqueChangedSettings) { + std::set<std::string> expected_set; + + // Flip the WiFi toggle in Settings, this is a unique Setting that is changing + // so the number of unique settings that have been changed increases by 1 for + // a total of 1 + tracker_->RecordSettingChange(Setting::kWifiOnOff); + expected_set = {SettingAsIntString(Setting::kWifiOnOff)}; + EXPECT_EQ(expected_set, tracker_->GetChangedSettingsForTesting()); + + // Destruct tracker_ to trigger recording the data to the histogram. + tracker_.reset(); + histogram_tester_.ExpectBucketCount( + "ChromeOS.Settings.NumUniqueSettingsChanged.DeviceLifetime", + /*sample=*/1, + /*count=*/1); + + // Create a new PerSessionSettingsUserActionTracker to imitate a newly opened + // Settings page. + tracker_ = + std::make_unique<PerSessionSettingsUserActionTracker>(test_pref_service_); + + // test that the set has been destructed and cleared appropriately + expected_set = {}; + EXPECT_EQ(expected_set, tracker_->GetChangedSettingsForTesting()); + + // Flip the Do Not Disturb and WiFi toggles in Settings, this is a unique + // Setting that is changing so the number of unique settings that have been + // changed increases by 1 for a total of 2 + tracker_->RecordSettingChange(Setting::kDoNotDisturbOnOff); + tracker_->RecordSettingChange(Setting::kWifiOnOff); + expected_set = {SettingAsIntString(Setting::kDoNotDisturbOnOff), + SettingAsIntString(Setting::kWifiOnOff)}; + EXPECT_EQ(expected_set, tracker_->GetChangedSettingsForTesting()); + + // Destruct tracker_ to trigger recording the data to the histogram. + tracker_.reset(); + histogram_tester_.ExpectBucketCount( + "ChromeOS.Settings.NumUniqueSettingsChanged.DeviceLifetime", + /*sample=*/1, + /*count=*/1); + histogram_tester_.ExpectBucketCount( + "ChromeOS.Settings.NumUniqueSettingsChanged.DeviceLifetime", + /*sample=*/2, + /*count=*/1); + + // Create a new PerSessionSettingsUserActionTracker to imitate a newly opened + // Settings page. + tracker_ = + std::make_unique<PerSessionSettingsUserActionTracker>(test_pref_service_); + + // Flip the Do Not Disturb and WiFi toggles. Flip Do Not Disturb toggle again + // in Settings, this is not a unique Setting that is changing so the number of + // unique settings that have been changed does not increase. The bucket sample + // 2 should now have 2 counts. + tracker_->RecordSettingChange(Setting::kDoNotDisturbOnOff); + tracker_->RecordSettingChange(Setting::kWifiOnOff); + tracker_->RecordSettingChange(Setting::kDoNotDisturbOnOff); + // expected_set will not change + EXPECT_EQ(expected_set, tracker_->GetChangedSettingsForTesting()); + + // Destruct tracker_ to trigger recording the data to the histogram. + tracker_.reset(); + + histogram_tester_.ExpectBucketCount( + "ChromeOS.Settings.NumUniqueSettingsChanged.DeviceLifetime", + /*sample=*/1, + /*count=*/1); + histogram_tester_.ExpectBucketCount( + "ChromeOS.Settings.NumUniqueSettingsChanged.DeviceLifetime", + /*sample=*/2, + /*count=*/1); +} + +TEST_F(PerSessionSettingsUserActionTrackerTest, TestNoTimeDeltaOpenCloseSettings) { // Focus on page, close the page immediately. total_time_session_active_ // should be 0 seconds. @@ -340,7 +437,8 @@ // Create a new tracker, focus on page, wait for another 22 seconds to // pass. - tracker_ = std::make_unique<PerSessionSettingsUserActionTracker>(); + tracker_ = + std::make_unique<PerSessionSettingsUserActionTracker>(test_pref_service_); tracker_->RecordPageFocus(); task_environment_.FastForwardBy(base::Seconds(22)); @@ -355,7 +453,8 @@ // Create a new tracker, focus on page, this time wait for 3 seconds to // pass. - tracker_ = std::make_unique<PerSessionSettingsUserActionTracker>(); + tracker_ = + std::make_unique<PerSessionSettingsUserActionTracker>(test_pref_service_); tracker_->RecordPageFocus(); task_environment_.FastForwardBy(base::Seconds(3));
diff --git a/chrome/browser/ui/webui/settings/ash/settings_user_action_tracker.cc b/chrome/browser/ui/webui/settings/ash/settings_user_action_tracker.cc index 3179c17..e8cc354 100644 --- a/chrome/browser/ui/webui/settings/ash/settings_user_action_tracker.cc +++ b/chrome/browser/ui/webui/settings/ash/settings_user_action_tracker.cc
@@ -15,8 +15,9 @@ SettingsUserActionTracker::SettingsUserActionTracker( Hierarchy* hierarchy, - OsSettingsSections* sections) - : hierarchy_(hierarchy), sections_(sections) {} + OsSettingsSections* sections, + PrefService* pref_service) + : hierarchy_(hierarchy), sections_(sections), pref_service_(pref_service) {} SettingsUserActionTracker::~SettingsUserActionTracker() = default; @@ -31,7 +32,7 @@ // New session started, so create a new per session tracker. per_session_tracker_ = - std::make_unique<PerSessionSettingsUserActionTracker>(); + std::make_unique<PerSessionSettingsUserActionTracker>(pref_service_); } void SettingsUserActionTracker::EndCurrentSession() {
diff --git a/chrome/browser/ui/webui/settings/ash/settings_user_action_tracker.h b/chrome/browser/ui/webui/settings/ash/settings_user_action_tracker.h index f973882..1276894 100644 --- a/chrome/browser/ui/webui/settings/ash/settings_user_action_tracker.h +++ b/chrome/browser/ui/webui/settings/ash/settings_user_action_tracker.h
@@ -11,6 +11,7 @@ #include "base/memory/raw_ptr.h" #include "chrome/browser/ui/webui/settings/ash/search/per_session_settings_user_action_tracker.h" #include "chrome/browser/ui/webui/settings/ash/search/user_action_recorder.mojom.h" +#include "components/prefs/pref_service.h" #include "mojo/public/cpp/bindings/pending_receiver.h" #include "mojo/public/cpp/bindings/receiver.h" @@ -24,7 +25,9 @@ // a per section tracker to record metrics in each section. class SettingsUserActionTracker : public mojom::UserActionRecorder { public: - SettingsUserActionTracker(Hierarchy* hierarchy, OsSettingsSections* sections); + SettingsUserActionTracker(Hierarchy* hierarchy, + OsSettingsSections* sections, + PrefService* pref_service); SettingsUserActionTracker(const SettingsUserActionTracker& other) = delete; SettingsUserActionTracker& operator=(const SettingsUserActionTracker& other) = delete; @@ -66,6 +69,7 @@ raw_ptr<Hierarchy, ExperimentalAsh> hierarchy_; raw_ptr<OsSettingsSections, ExperimentalAsh> sections_; + raw_ptr<PrefService> pref_service_; std::unique_ptr<PerSessionSettingsUserActionTracker> per_session_tracker_; mojo::Receiver<mojom::UserActionRecorder> receiver_{this};
diff --git a/chrome/browser/ui/webui/settings/ash/settings_user_action_tracker_unittest.cc b/chrome/browser/ui/webui/settings/ash/settings_user_action_tracker_unittest.cc index 5bba536..574a9cb1 100644 --- a/chrome/browser/ui/webui/settings/ash/settings_user_action_tracker_unittest.cc +++ b/chrome/browser/ui/webui/settings/ash/settings_user_action_tracker_unittest.cc
@@ -12,10 +12,16 @@ #include "chrome/browser/ui/webui/settings/ash/search/per_session_settings_user_action_tracker.h" #include "chrome/browser/ui/webui/settings/ash/search/user_action_recorder.mojom.h" #include "chrome/browser/ui/webui/settings/chromeos/constants/setting.mojom.h" +#include "chrome/test/base/browser_with_test_window_test.h" +#include "chrome/test/base/testing_browser_process.h" +#include "chrome/test/base/testing_profile.h" +#include "chrome/test/base/testing_profile_manager.h" #include "testing/gtest/include/gtest/gtest.h" namespace ash::settings { +constexpr char kProfileName[] = "user@gmail.com"; + namespace mojom { using ::chromeos::settings::mojom::Section; using ::chromeos::settings::mojom::Setting; @@ -25,14 +31,28 @@ protected: SettingsUserActionTrackerTest() : fake_hierarchy_(&fake_sections_), - tracker_(&fake_hierarchy_, &fake_sections_) { + tracker_(&fake_hierarchy_, &fake_sections_, GetTestProfilePref()) { // Initialize per_session_tracker_ manually since BindInterface is never // called on tracker_. tracker_.per_session_tracker_ = - std::make_unique<PerSessionSettingsUserActionTracker>(); + std::make_unique<PerSessionSettingsUserActionTracker>( + testing_profile_->GetPrefs()); } ~SettingsUserActionTrackerTest() override = default; + void SetUpTestingProfile() { + profile_manager_ = std::make_unique<TestingProfileManager>( + TestingBrowserProcess::GetGlobal()); + ASSERT_TRUE(profile_manager_->SetUp()); + testing_profile_ = profile_manager_->CreateTestingProfile(kProfileName); + } + + PrefService* GetTestProfilePref() { + SetUpTestingProfile(); + test_pref_service_ = testing_profile_->GetPrefs(); + return test_pref_service_; + } + // testing::Test: void SetUp() override { fake_hierarchy_.AddSettingMetadata(mojom::Section::kBluetooth, @@ -49,10 +69,18 @@ mojom::Setting::kWifiAddNetwork); } + void TearDown() override { tracker_.per_session_tracker_.reset(); } + + // TestingProfile is bound to the IO thread: + // CurrentlyOn(content::BrowserThread::UI). + content::BrowserTaskEnvironment task_environment_; base::HistogramTester histogram_tester_; FakeOsSettingsSections fake_sections_; + raw_ptr<PrefService> test_pref_service_; FakeHierarchy fake_hierarchy_; + std::unique_ptr<TestingProfileManager> profile_manager_; SettingsUserActionTracker tracker_; + TestingProfile* testing_profile_; }; TEST_F(SettingsUserActionTrackerTest, TestRecordSettingChangedBool) {
diff --git a/chrome/browser/upgrade_detector/installed_version_poller.h b/chrome/browser/upgrade_detector/installed_version_poller.h index 80495fc..e541dbb6 100644 --- a/chrome/browser/upgrade_detector/installed_version_poller.h +++ b/chrome/browser/upgrade_detector/installed_version_poller.h
@@ -8,7 +8,7 @@ #include <memory> #include "base/functional/callback.h" -#include "base/memory/raw_ptr_exclusion.h" +#include "base/memory/raw_ptr.h" #include "base/memory/scoped_refptr.h" #include "base/memory/weak_ptr.h" #include "base/sequence_checker.h" @@ -93,9 +93,7 @@ InstalledAndCriticalVersion installed_version); SEQUENCE_CHECKER(sequence_checker_); - // This field is not a raw_ptr<> because it was filtered by the rewriter for: - // #union - RAW_PTR_EXCLUSION BuildState* const build_state_; + raw_ptr<BuildState> const build_state_; const GetInstalledVersionCallback get_installed_version_; base::OneShotTimer timer_;
diff --git a/chrome/browser/web_applications/BUILD.gn b/chrome/browser/web_applications/BUILD.gn index 115cb51..456b71b5 100644 --- a/chrome/browser/web_applications/BUILD.gn +++ b/chrome/browser/web_applications/BUILD.gn
@@ -184,6 +184,8 @@ "preinstalled_web_apps/preinstalled_web_app_definition_utils.h", "preinstalled_web_apps/preinstalled_web_apps.cc", "preinstalled_web_apps/preinstalled_web_apps.h", + "remove_web_app_job.cc", + "remove_web_app_job.h", "scope_extension_info.cc", "scope_extension_info.h", "user_display_mode.cc", @@ -260,8 +262,6 @@ "web_app_ui_manager.cc", "web_app_ui_manager.h", "web_app_uninstall_and_replace_job.h", - "web_app_uninstall_job.cc", - "web_app_uninstall_job.h", "web_app_utils.cc", "web_app_utils.h", "web_contents/web_app_data_retriever.cc",
diff --git a/chrome/browser/web_applications/commands/web_app_uninstall_command.cc b/chrome/browser/web_applications/commands/web_app_uninstall_command.cc index e275d6acc..90bab879 100644 --- a/chrome/browser/web_applications/commands/web_app_uninstall_command.cc +++ b/chrome/browser/web_applications/commands/web_app_uninstall_command.cc
@@ -14,14 +14,15 @@ #include "base/strings/to_string.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/web_applications/locks/all_apps_lock.h" +#include "chrome/browser/web_applications/remove_web_app_job.h" #include "chrome/browser/web_applications/user_uninstalled_preinstalled_web_app_prefs.h" #include "chrome/browser/web_applications/web_app.h" #include "chrome/browser/web_applications/web_app_constants.h" #include "chrome/browser/web_applications/web_app_id.h" +#include "chrome/browser/web_applications/web_app_install_manager.h" #include "chrome/browser/web_applications/web_app_install_utils.h" #include "chrome/browser/web_applications/web_app_registrar.h" #include "chrome/browser/web_applications/web_app_registry_update.h" -#include "chrome/browser/web_applications/web_app_uninstall_job.h" #include "components/webapps/browser/installable/installable_metrics.h" #include "components/webapps/browser/uninstall_result_code.h" @@ -53,12 +54,12 @@ absl::optional<WebAppManagement::Type> management_type_or_all, webapps::WebappUninstallSource uninstall_source, UninstallWebAppCallback callback, - Profile* profile) + Profile& profile) : WebAppCommandTemplate<AllAppsLock>("WebAppUninstallCommand"), lock_description_(std::make_unique<AllAppsLockDescription>()), app_id_(app_id), callback_(std::move(callback)), - profile_prefs_(profile->GetPrefs()) { + profile_(profile) { // Initializing data for uninstallation tracking. queued_uninstalls_.emplace_back(app_id_, management_type_or_all, uninstall_source); @@ -127,7 +128,7 @@ app->management_to_external_config_map(); auto it = config_map.find(WebAppManagement::kDefault); if (it != config_map.end()) { - UserUninstalledPreinstalledWebAppPrefs(profile_prefs_) + UserUninstalledPreinstalledWebAppPrefs(profile_->GetPrefs()) .Add(app_id, it->second.install_urls); } else { base::UmaHistogramBoolean( @@ -157,11 +158,6 @@ return base::Value(std::move(uninstall_info)); } -void WebAppUninstallCommand::SetRemoveManagementTypeCallbackForTesting( - RemoveManagementTypeCallback callback) { - management_type_removed_callback_for_testing_ = std::move(callback); -} - WebAppUninstallCommand::UninstallInfo::UninstallInfo( AppId app_id, absl::optional<WebAppManagement::Type> management_type_or_all, @@ -212,26 +208,10 @@ const AppId& app_id, webapps::WebappUninstallSource uninstall_source) { QueueSubAppsForUninstallIfAny(app_id); - - auto* web_app = lock_->registrar().GetAppById(app_id); -#if BUILDFLAG(IS_CHROMEOS_LACROS) - absl::optional<base::FilePath> app_profile_path; - if (web_app->chromeos_data().has_value()) { - app_profile_path = web_app->chromeos_data()->app_profile_path; - } -#endif // BUILDFLAG(IS_CHROMEOS_LACROS) - - auto uninstall_job = WebAppUninstallJob::CreateAndStart( - app_id, url::Origin::Create(web_app->start_url()), -#if BUILDFLAG(IS_CHROMEOS_LACROS) - app_profile_path, -#endif // BUILDFLAG(IS_CHROMEOS_LACROS) + apps_pending_uninstall_[app_id] = RemoveWebAppJob::Start( + uninstall_source, app_id, *lock_, profile_.get(), base::BindOnce(&WebAppUninstallCommand::OnSingleUninstallComplete, - weak_factory_.GetWeakPtr(), app_id, uninstall_source), - lock_->os_integration_manager(), lock_->sync_bridge(), - lock_->icon_manager(), lock_->registrar(), lock_->install_manager(), - lock_->translation_manager(), *profile_prefs_, uninstall_source); - apps_pending_uninstall_[app_id] = std::move(uninstall_job); + weak_factory_.GetWeakPtr(), app_id, uninstall_source)); } void WebAppUninstallCommand::QueueSubAppsForUninstallIfAny( @@ -258,27 +238,26 @@ } } - if (management_type_removed_callback_for_testing_) - std::move(management_type_removed_callback_for_testing_).Run(app_id); + lock_->install_manager().NotifyWebAppSourceRemovedForTesting(app_id); // Registering an OS uninstall is also an "uninstall", so the // state is updated for the command. OnSingleUninstallComplete(app_id, uninstall_source, - webapps::UninstallResultCode::kSuccess); + /*success=*/true); } void WebAppUninstallCommand::OnSingleUninstallComplete( const AppId& app_id, webapps::WebappUninstallSource source, - webapps::UninstallResultCode code) { + bool success) { DCHECK(base::Contains(apps_pending_uninstall_, app_id)); apps_pending_uninstall_.erase(app_id); if (source == webapps::WebappUninstallSource::kSync) { - base::UmaHistogramBoolean("Webapp.SyncInitiatedUninstallResult", - code == webapps::UninstallResultCode::kSuccess); + base::UmaHistogramBoolean("Webapp.SyncInitiatedUninstallResult", success); } - uninstall_results_[app_id] = code; + uninstall_results_[app_id] = success ? webapps::UninstallResultCode::kSuccess + : webapps::UninstallResultCode::kError; AppendUninstallResultsToDebugLog(app_id); MaybeFinishUninstallAndDestruct(); }
diff --git a/chrome/browser/web_applications/commands/web_app_uninstall_command.h b/chrome/browser/web_applications/commands/web_app_uninstall_command.h index fba3159..c11d8f5 100644 --- a/chrome/browser/web_applications/commands/web_app_uninstall_command.h +++ b/chrome/browser/web_applications/commands/web_app_uninstall_command.h
@@ -21,7 +21,6 @@ #include "third_party/abseil-cpp/absl/types/optional.h" class Profile; -class PrefService; namespace webapps { enum class UninstallResultCode; @@ -33,7 +32,7 @@ class AllAppsLock; class AllAppsLockDescription; class LockDescription; -class WebAppUninstallJob; +class RemoveWebAppJob; // This command is used to uninstall a web_app. Once started, this command will: // 1. Start maintaining a queue of all app_ids that need to be uninstalled. @@ -52,11 +51,11 @@ // `ExternallyManagedAppManager::SynchronizeInstalledApps()` for more info. // c. If the app being uninstalled is a parent app with multiple sub apps, // all sub app IDs are queued onto the overall uninstallation queue. -// 3. For all other use-cases, a WebAppUninstallJob is initialized and kicked +// 3. For all other use-cases, a RemoveWebAppJob is initialized and kicked // off per app_id. The job is owned by the command, and the command keeps // track of all currently running jobs. // 4. The command ends only when both of the conditions below are successful: -// a. All running WebAppUninstallJobs have been completed. +// a. All running RemoveWebAppJobs have been completed. // b. The queue that was keeping track of app_ids that needed to be // uninstalled is empty. class WebAppUninstallCommand : public WebAppCommandTemplate<AllAppsLock> { @@ -71,7 +70,7 @@ absl::optional<WebAppManagement::Type> management_type_or_all, webapps::WebappUninstallSource uninstall_source, UninstallWebAppCallback callback, - Profile* profile); + Profile& profile); ~WebAppUninstallCommand() override; // WebAppCommandTemplate<AllAppsLock>: @@ -80,9 +79,6 @@ const LockDescription& lock_description() const override; base::Value ToDebugValue() const override; - void SetRemoveManagementTypeCallbackForTesting( - RemoveManagementTypeCallback callback); - private: // Used to store information needed for uninstalling an app with app_id. struct UninstallInfo { @@ -113,7 +109,7 @@ OsHooksErrors os_hooks_errors); void OnSingleUninstallComplete(const AppId& app_id, webapps::WebappUninstallSource source, - webapps::UninstallResultCode code); + bool success); void MaybeFinishUninstallAndDestruct(); std::unique_ptr<AllAppsLockDescription> lock_description_; @@ -122,15 +118,15 @@ const AppId app_id_; base::circular_deque<UninstallInfo> queued_uninstalls_; base::flat_map<AppId, webapps::UninstallResultCode> uninstall_results_; - base::flat_map<AppId, std::unique_ptr<WebAppUninstallJob>> + base::flat_map<AppId, std::unique_ptr<RemoveWebAppJob>> apps_pending_uninstall_; base::Value::Dict debug_log_; bool all_uninstalled_queued_ = false; UninstallWebAppCallback callback_; - RemoveManagementTypeCallback management_type_removed_callback_for_testing_; - raw_ptr<PrefService> profile_prefs_; + // `this` is owned by `profile_`. + raw_ref<Profile> profile_; base::WeakPtrFactory<WebAppUninstallCommand> weak_factory_{this}; };
diff --git a/chrome/browser/web_applications/commands/web_app_uninstall_command_unittest.cc b/chrome/browser/web_applications/commands/web_app_uninstall_command_unittest.cc index 512bb90..e59b4f8 100644 --- a/chrome/browser/web_applications/commands/web_app_uninstall_command_unittest.cc +++ b/chrome/browser/web_applications/commands/web_app_uninstall_command_unittest.cc
@@ -19,6 +19,7 @@ #include "chrome/browser/web_applications/test/test_file_utils.h" #include "chrome/browser/web_applications/test/web_app_install_test_utils.h" #include "chrome/browser/web_applications/test/web_app_test.h" +#include "chrome/browser/web_applications/test/web_app_test_observers.h" #include "chrome/browser/web_applications/test/web_app_test_utils.h" #include "chrome/browser/web_applications/user_uninstalled_preinstalled_web_app_prefs.h" #include "chrome/browser/web_applications/web_app.h" @@ -105,7 +106,7 @@ EXPECT_EQ(webapps::UninstallResultCode::kSuccess, code); loop.Quit(); }), - profile())); + *profile())); loop.Run(); EXPECT_EQ(provider()->registrar_unsafe().GetAppById(app_id), nullptr); @@ -142,7 +143,7 @@ EXPECT_EQ(webapps::UninstallResultCode::kSuccess, code); loop.Quit(); }), - profile())); + *profile())); loop.Run(); EXPECT_EQ(provider()->registrar_unsafe().GetAppById(app_id), nullptr); @@ -178,7 +179,7 @@ EXPECT_EQ(webapps::UninstallResultCode::kError, code); loop.Quit(); }), - profile())); + *profile())); loop.Run(); EXPECT_EQ(provider()->registrar_unsafe().GetAppById(app_id), nullptr); @@ -215,7 +216,7 @@ EXPECT_EQ(webapps::UninstallResultCode::kError, code); loop.Quit(); }), - profile())); + *profile())); loop.Run(); EXPECT_EQ(provider()->registrar_unsafe().GetAppById(app_id), nullptr); @@ -246,7 +247,7 @@ EXPECT_EQ(webapps::UninstallResultCode::kNoAppToUninstall, code); loop.Quit(); }), - profile())); + *profile())); loop.Run(); EXPECT_EQ(provider()->registrar_unsafe().GetAppById(app_id), nullptr); @@ -279,7 +280,7 @@ base::BindLambdaForTesting([&](webapps::UninstallResultCode code) { EXPECT_EQ(webapps::UninstallResultCode::kError, code); }), - profile())); + *profile())); provider()->command_manager().Shutdown(); // App is not uninstalled. @@ -320,7 +321,7 @@ EXPECT_EQ(webapps::UninstallResultCode::kSuccess, code); loop.Quit(); }), - profile())); + *profile())); loop.Run(); EXPECT_EQ(provider()->registrar_unsafe().GetAppById(app_id), nullptr); @@ -358,7 +359,7 @@ EXPECT_EQ(webapps::UninstallResultCode::kSuccess, code); loop.Quit(); }), - profile())); + *profile())); loop.Run(); EXPECT_EQ(provider()->registrar_unsafe().GetAppById(app_id), nullptr); @@ -422,9 +423,10 @@ EXPECT_EQ(webapps::UninstallResultCode::kSuccess, code); run_loop.Quit(); }), - profile()); + *profile()); - command->SetRemoveManagementTypeCallbackForTesting( + WebAppInstallManagerObserverAdapter observer(profile()); + observer.SetWebAppSourceRemovedDelegate( base::BindLambdaForTesting([&](const AppId& app_id) { // The policy source will be removed and WebAppOsUninstallation is // registered. @@ -433,6 +435,7 @@ .GetAppById(app_id) ->IsPolicyInstalledApp()); })); + provider()->command_manager().ScheduleCommand(std::move(command)); run_loop.Run(); } @@ -481,7 +484,7 @@ EXPECT_EQ(webapps::UninstallResultCode::kSuccess, code); loop.Quit(); }), - profile())); + *profile())); loop.Run(); EXPECT_EQ(provider()->registrar_unsafe().GetAppById(app_id), nullptr);
diff --git a/chrome/browser/web_applications/extensions/externally_managed_app_install_task_unittest.cc b/chrome/browser/web_applications/extensions/externally_managed_app_install_task_unittest.cc index 91f6296d..1c97aee 100644 --- a/chrome/browser/web_applications/extensions/externally_managed_app_install_task_unittest.cc +++ b/chrome/browser/web_applications/extensions/externally_managed_app_install_task_unittest.cc
@@ -241,11 +241,6 @@ ++num_reparent_tab_calls_; } - void SetRemoveManagementTypeCallbackForTesting( - base::RepeatingCallback<void(const AppId&)>) override { - NOTIMPLEMENTED(); - } - private: raw_ptr<WebAppRegistrarMutable> registrar_ = nullptr;
diff --git a/chrome/browser/web_applications/externally_installed_web_app_prefs.cc b/chrome/browser/web_applications/externally_installed_web_app_prefs.cc index 3234c2a9..0acffd8 100644 --- a/chrome/browser/web_applications/externally_installed_web_app_prefs.cc +++ b/chrome/browser/web_applications/externally_installed_web_app_prefs.cc
@@ -318,12 +318,11 @@ MigrateExternalPrefDataToPreinstalledPrefs(pref_service, ®istrar, pref_to_app_data); ScopedRegistryUpdate update(sync_bridge); - for (auto it : pref_to_app_data) { - const WebApp* web_app = registrar.GetAppById(it.first); + for (const auto& [app_id, parsed_config_map] : pref_to_app_data) { + const WebApp* web_app = registrar.GetAppById(app_id); if (web_app) { // Sync data across externally installed prefs and web_app DB. - for (auto parsed_info : it.second) { - WebAppManagement::Type& source = parsed_info.first; + for (const auto& [source, parsed_config] : parsed_config_map) { if (!web_app->GetSources().test(source)) continue; @@ -332,29 +331,28 @@ auto map_it = config_map.find(source); // Placeholder migration and metrics logging. if (map_it != config_map.end() && - map_it->second.is_placeholder == - parsed_info.second.is_placeholder) { + map_it->second.is_placeholder == parsed_config.is_placeholder) { LogPlaceholderMigrationState( PlaceholderMigrationState::kPlaceholderInfoAlreadyInSync); } else { - WebApp* updated_app = update->UpdateApp(it.first); + WebApp* updated_app = update->UpdateApp(app_id); updated_app->AddPlaceholderInfoToManagementExternalConfigMap( - source, parsed_info.second.is_placeholder); + source, parsed_config.is_placeholder); LogPlaceholderMigrationState( PlaceholderMigrationState::kPlaceholderInfoMigrated); } // Install URL migration and metrics logging. - for (auto url : parsed_info.second.install_urls) { + for (const GURL& url : parsed_config.install_urls) { DCHECK(url.is_valid()); if (map_it != config_map.end() && base::Contains(map_it->second.install_urls, url)) { LogInstallURLMigrationState( InstallURLMigrationState::kInstallURLAlreadyInSync); } else { - WebApp* updated_app = update->UpdateApp(it.first); - updated_app->AddInstallURLToManagementExternalConfigMap( - parsed_info.first, url); + WebApp* updated_app = update->UpdateApp(app_id); + updated_app->AddInstallURLToManagementExternalConfigMap(source, + url); LogInstallURLMigrationState( InstallURLMigrationState::kInstallURLMigrated); }
diff --git a/chrome/browser/web_applications/preinstalled_web_app_manager.h b/chrome/browser/web_applications/preinstalled_web_app_manager.h index fab16fe6..5037402 100644 --- a/chrome/browser/web_applications/preinstalled_web_app_manager.h +++ b/chrome/browser/web_applications/preinstalled_web_app_manager.h
@@ -186,7 +186,8 @@ std::unique_ptr<DeviceDataInitializedEvent> device_data_initialized_event_; - base::ObserverList<PreinstalledWebAppManager::Observer> observers_; + base::ObserverList<PreinstalledWebAppManager::Observer, /*check_empty=*/true> + observers_; base::WeakPtrFactory<PreinstalledWebAppManager> weak_ptr_factory_{this}; };
diff --git a/chrome/browser/web_applications/remove_web_app_job.cc b/chrome/browser/web_applications/remove_web_app_job.cc new file mode 100644 index 0000000..674e3262 --- /dev/null +++ b/chrome/browser/web_applications/remove_web_app_job.cc
@@ -0,0 +1,181 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/web_applications/remove_web_app_job.h" + +#include <memory> + +#include "base/functional/bind.h" +#include "base/memory/ptr_util.h" +#include "base/metrics/histogram_functions.h" +#include "chrome/browser/web_applications/locks/with_app_resources.h" +#include "chrome/browser/web_applications/os_integration/os_integration_manager.h" +#include "chrome/browser/web_applications/web_app.h" +#include "chrome/browser/web_applications/web_app_icon_manager.h" +#include "chrome/browser/web_applications/web_app_install_finalizer.h" +#include "chrome/browser/web_applications/web_app_install_manager.h" +#include "chrome/browser/web_applications/web_app_registrar.h" +#include "chrome/browser/web_applications/web_app_registry_update.h" +#include "chrome/browser/web_applications/web_app_sync_bridge.h" +#include "chrome/browser/web_applications/web_app_translation_manager.h" +#include "components/webapps/browser/uninstall_result_code.h" + +#if BUILDFLAG(IS_CHROMEOS_LACROS) +#include "base/feature_list.h" +#include "base/functional/callback_helpers.h" +#include "chrome/browser/browser_process.h" +#include "chrome/browser/profiles/profile_attributes_storage.h" +#include "chrome/browser/profiles/profile_manager.h" +#include "chrome/browser/profiles/profile_metrics.h" +#include "chrome/browser/web_applications/web_app_utils.h" +#endif // BUILDFLAG(IS_CHROMEOS_LACROS) + +namespace web_app { + +RemoveWebAppJob::~RemoveWebAppJob() = default; + +std::unique_ptr<RemoveWebAppJob> RemoveWebAppJob::Start( + webapps::WebappUninstallSource uninstall_source, + AppId app_id, + WithAppResources& resources, + Profile& profile, + UninstallCallback callback) { + CHECK(resources.registrar().GetAppById(app_id)); + + auto job = base::WrapUnique(new RemoveWebAppJob( + uninstall_source, app_id, resources, profile, std::move(callback))); + base::WeakPtr<RemoveWebAppJob> job_weak_ptr = + job->weak_ptr_factory_.GetWeakPtr(); + + resources.install_manager().NotifyWebAppWillBeUninstalled(app_id); + + { + // Note: It is supported to re-start an uninstall on startup, so + // `is_uninstalling()` is not checked. It is a class invariant that there + // can never be more than one uninstall task operating on the same web app + // at the same time. + ScopedRegistryUpdate update(&resources.sync_bridge()); + WebApp* app = update->UpdateApp(app_id); + CHECK(app); + app->SetIsUninstalling(true); + } + + auto synchronize_barrier = OsIntegrationManager::GetBarrierForSynchronize( + base::BindOnce(&RemoveWebAppJob::OnOsHooksUninstalled, job_weak_ptr)); + + // TODO(crbug.com/1401125): Remove UninstallAllOsHooks() once OS integration + // sub managers have been implemented. + resources.os_integration_manager().UninstallAllOsHooks(app_id, + synchronize_barrier); + resources.os_integration_manager().Synchronize( + app_id, base::BindOnce(synchronize_barrier, OsHooksErrors())); + + // While sometimes `Synchronize` needs to read icon data, for the uninstall + // case it never needs to be read. Thus, it is safe to schedule this now and + // not after the `Synchronize` call completes. + resources.icon_manager().DeleteData( + app_id, + base::BindOnce(&RemoveWebAppJob::OnIconDataDeleted, job_weak_ptr)); + + resources.translation_manager().DeleteTranslations( + app_id, + base::BindOnce(&RemoveWebAppJob::OnTranslationDataDeleted, job_weak_ptr)); + +#if BUILDFLAG(IS_CHROMEOS_LACROS) + if (ResolveExperimentalWebAppIsolationFeature() == + ExperimentalWebAppIsolationMode::kProfile) { + const WebApp& app = *resources.registrar().GetAppById(app_id); + if (app.chromeos_data() && app.chromeos_data()->app_profile_path) { + const base::FilePath& app_profile_path = + app.chromeos_data()->app_profile_path.value(); + CHECK(Profile::IsWebAppProfilePath(app_profile_path)); + if (g_browser_process->profile_manager() + ->GetProfileAttributesStorage() + .GetProfileAttributesWithPath(app_profile_path)) { + job->pending_app_profile_deletion_ = true; + g_browser_process->profile_manager() + ->GetDeleteProfileHelper() + .MaybeScheduleProfileForDeletion( + app_profile_path, + base::BindOnce(&RemoveWebAppJob::OnWebAppProfileDeleted, + job_weak_ptr), + ProfileMetrics::ProfileDelete::DELETE_PROFILE_USER_MANAGER); + } else { + LOG(ERROR) << "cannot find web app profile at " << app_profile_path; + } + } + } +#endif // BUILDFLAG(IS_CHROMEOS_LACROS) + + return job; +} + +RemoveWebAppJob::RemoveWebAppJob( + webapps::WebappUninstallSource uninstall_source, + AppId app_id, + WithAppResources& resources, + Profile& profile, + UninstallCallback callback) + : uninstall_source_(uninstall_source), + app_id_(app_id), + resources_(resources), + profile_(profile), + callback_(std::move(callback)) {} + +void RemoveWebAppJob::OnOsHooksUninstalled(OsHooksErrors errors) { + CHECK(!done_); + CHECK(!hooks_uninstalled_); + hooks_uninstalled_ = true; + base::UmaHistogramBoolean("WebApp.Uninstall.OsHookSuccess", errors.none()); + errors_ = errors_ || errors.any(); + MaybeFinishUninstall(); +} + +void RemoveWebAppJob::OnIconDataDeleted(bool success) { + CHECK(!done_); + CHECK(!app_data_deleted_); + app_data_deleted_ = true; + base::UmaHistogramBoolean("WebApp.Uninstall.IconDataSuccess", success); + errors_ = errors_ || !success; + MaybeFinishUninstall(); +} + +void RemoveWebAppJob::OnTranslationDataDeleted(bool success) { + CHECK(!done_); + CHECK(!translation_data_deleted_); + translation_data_deleted_ = true; + errors_ = errors_ || !success; + MaybeFinishUninstall(); +} + +void RemoveWebAppJob::OnWebAppProfileDeleted(Profile* profile) { + CHECK(!done_); + CHECK(pending_app_profile_deletion_); + // This must be an isolated web app profile rather than the WebAppProvider + // profile. + CHECK_NE(&profile_.get(), profile); + pending_app_profile_deletion_ = false; + MaybeFinishUninstall(); +} + +void RemoveWebAppJob::MaybeFinishUninstall() { + CHECK(!done_); + if (!hooks_uninstalled_ || !app_data_deleted_ || !translation_data_deleted_ || + pending_app_profile_deletion_) { + return; + } + done_ = true; + + base::UmaHistogramBoolean("WebApp.Uninstall.Result", !errors_); + { + CHECK_NE(resources_->registrar().GetAppById(app_id_), nullptr); + ScopedRegistryUpdate update(&resources_->sync_bridge()); + update->DeleteApp(app_id_); + } + resources_->install_manager().NotifyWebAppUninstalled(app_id_, + uninstall_source_); + std::move(callback_).Run(!errors_); +} + +} // namespace web_app
diff --git a/chrome/browser/web_applications/remove_web_app_job.h b/chrome/browser/web_applications/remove_web_app_job.h new file mode 100644 index 0000000..acd5567 --- /dev/null +++ b/chrome/browser/web_applications/remove_web_app_job.h
@@ -0,0 +1,83 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_WEB_APPLICATIONS_REMOVE_WEB_APP_JOB_H_ +#define CHROME_BROWSER_WEB_APPLICATIONS_REMOVE_WEB_APP_JOB_H_ + +#include <memory> + +#include "base/functional/callback.h" +#include "base/memory/raw_ref.h" +#include "base/memory/weak_ptr.h" +#include "chrome/browser/web_applications/os_integration/os_integration_manager.h" +#include "chrome/browser/web_applications/web_app_id.h" + +namespace webapps { +enum class UninstallResultCode; +enum class WebappUninstallSource; +} // namespace webapps + +class Profile; + +namespace web_app { + +class WithAppResources; + +// Uninstalls a given web app by: +// 1) Unregistering OS hooks. +// 2) Deleting the app from the database. +// 3) Deleting data on disk. +// Extra invariants: +// * There is never more than one uninstall task operating on the same app at +// the same time. +class RemoveWebAppJob { + public: + using UninstallCallback = base::OnceCallback<void(bool success)>; + + static std::unique_ptr<RemoveWebAppJob> Start( + webapps::WebappUninstallSource uninstall_source, + AppId app_id, + WithAppResources& resources, + Profile& profile, + UninstallCallback callback); + + ~RemoveWebAppJob(); + + private: + RemoveWebAppJob(webapps::WebappUninstallSource uninstall_source, + AppId app_id, + WithAppResources& resources, + Profile& profile, + UninstallCallback callback); + + void OnOsHooksUninstalled(OsHooksErrors errors); + void OnIconDataDeleted(bool success); + void OnTranslationDataDeleted(bool success); + void OnWebAppProfileDeleted(Profile* profile); + void MaybeFinishUninstall(); + + webapps::WebappUninstallSource uninstall_source_; + AppId app_id_; + // The RemoveWebAppJob is kicked off by the WebAppUninstallCommand + // and is constructed and destructed well within the lifetime of the + // Uninstall command. This ensures that this class is guaranteed to be + // destructed before any of the WebAppProvider systems shut down. + raw_ref<WithAppResources> resources_; + // `this` is owned by `profile_`. + raw_ref<Profile> profile_; + UninstallCallback callback_; + + bool app_data_deleted_ = false; + bool translation_data_deleted_ = false; + bool hooks_uninstalled_ = false; + bool pending_app_profile_deletion_ = false; + bool errors_ = false; + bool done_ = false; + + base::WeakPtrFactory<RemoveWebAppJob> weak_ptr_factory_{this}; +}; + +} // namespace web_app + +#endif // CHROME_BROWSER_WEB_APPLICATIONS_REMOVE_WEB_APP_JOB_H_
diff --git a/chrome/browser/web_applications/test/fake_install_finalizer.cc b/chrome/browser/web_applications/test/fake_install_finalizer.cc index 7567b13..f6bce686 100644 --- a/chrome/browser/web_applications/test/fake_install_finalizer.cc +++ b/chrome/browser/web_applications/test/fake_install_finalizer.cc
@@ -94,10 +94,6 @@ content::WebContents* web_contents) { ++num_reparent_tab_calls_; } -void FakeInstallFinalizer::SetRemoveManagementTypeCallbackForTesting( - base::RepeatingCallback<void(const AppId&)>) { - NOTIMPLEMENTED(); -} void FakeInstallFinalizer::SetNextFinalizeInstallResult( const AppId& app_id,
diff --git a/chrome/browser/web_applications/test/fake_install_finalizer.h b/chrome/browser/web_applications/test/fake_install_finalizer.h index 45fd6fe..6cd9b04 100644 --- a/chrome/browser/web_applications/test/fake_install_finalizer.h +++ b/chrome/browser/web_applications/test/fake_install_finalizer.h
@@ -50,8 +50,6 @@ void ReparentTab(const AppId& app_id, bool shortcut_created, content::WebContents* web_contents) override; - void SetRemoveManagementTypeCallbackForTesting( - base::RepeatingCallback<void(const AppId&)>) override; void SetNextFinalizeInstallResult(const AppId& app_id, webapps::InstallResultCode code);
diff --git a/chrome/browser/web_applications/test/web_app_test_observers.cc b/chrome/browser/web_applications/test/web_app_test_observers.cc index e273855..72c96c2 100644 --- a/chrome/browser/web_applications/test/web_app_test_observers.cc +++ b/chrome/browser/web_applications/test/web_app_test_observers.cc
@@ -65,6 +65,11 @@ app_manifest_updated_delegate_ = std::move(delegate); } +void WebAppInstallManagerObserverAdapter::SetWebAppSourceRemovedDelegate( + WebAppSourceRemovedDelegate delegate) { + app_source_removed_delegate_ = std::move(delegate); +} + void WebAppInstallManagerObserverAdapter::OnWebAppInstalled( const AppId& app_id) { if (app_installed_delegate_) @@ -101,6 +106,13 @@ observation_.Reset(); } +void WebAppInstallManagerObserverAdapter::OnWebAppSourceRemovedForTesting( + const AppId& app_id) { + if (app_source_removed_delegate_) { + app_source_removed_delegate_.Run(app_id); + } +} + void WebAppInstallManagerObserverAdapter::SignalRunLoopAndStoreAppId( const AppId& app_id) { if (!is_listening_)
diff --git a/chrome/browser/web_applications/test/web_app_test_observers.h b/chrome/browser/web_applications/test/web_app_test_observers.h index dd161092..1b3ed6a 100644 --- a/chrome/browser/web_applications/test/web_app_test_observers.h +++ b/chrome/browser/web_applications/test/web_app_test_observers.h
@@ -53,6 +53,10 @@ base::StringPiece old_name)>; void SetWebAppManifestUpdateDelegate(WebAppManifestUpdateDelegate delegate); + using WebAppSourceRemovedDelegate = + base::RepeatingCallback<void(const AppId& app_id)>; + void SetWebAppSourceRemovedDelegate(WebAppSourceRemovedDelegate delegate); + void OnWebAppInstalled(const AppId& app_id) override; void OnWebAppInstalledWithOsHooks(const AppId& app_id) override; void OnWebAppManifestUpdated(const AppId& app_id, @@ -62,6 +66,7 @@ const AppId& app_id, webapps::WebappUninstallSource uninstall_source) override; void OnWebAppInstallManagerDestroyed() override; + void OnWebAppSourceRemovedForTesting(const AppId& app_id) override; protected: // Helper method for subclasses to allow easy waiting on `wait_loop_`. @@ -84,6 +89,8 @@ private: WebAppWillBeUninstalledDelegate app_will_be_uninstalled_delegate_; + WebAppSourceRemovedDelegate app_source_removed_delegate_; + base::ScopedObservation<WebAppInstallManager, WebAppInstallManagerObserver> observation_{this};
diff --git a/chrome/browser/web_applications/web_app.cc b/chrome/browser/web_applications/web_app.cc index 661cc5a..0e187ff6 100644 --- a/chrome/browser/web_applications/web_app.cc +++ b/chrome/browser/web_applications/web_app.cc
@@ -630,27 +630,28 @@ GURL install_url) { DCHECK_NE(type, WebAppManagement::Type::kSync); DCHECK(install_url.is_valid()); - management_to_external_config_map_[type].install_urls.emplace(install_url); + management_to_external_config_map_[type].install_urls.emplace( + std::move(install_url)); } void WebApp::AddPolicyIdToManagementExternalConfigMap( WebAppManagement::Type type, - const std::string& policy_id) { + std::string policy_id) { DCHECK_NE(type, WebAppManagement::Type::kSync); DCHECK(!policy_id.empty()); management_to_external_config_map_[type].additional_policy_ids.emplace( - policy_id); + std::move(policy_id)); } void WebApp::AddExternalSourceInformation(WebAppManagement::Type type, GURL install_url, bool is_placeholder) { - AddInstallURLToManagementExternalConfigMap(type, install_url); + AddInstallURLToManagementExternalConfigMap(type, std::move(install_url)); AddPlaceholderInfoToManagementExternalConfigMap(type, is_placeholder); } bool WebApp::RemoveInstallUrlForSource(WebAppManagement::Type type, - GURL install_url) { + const GURL& install_url) { if (!management_to_external_config_map_.count(type)) return false;
diff --git a/chrome/browser/web_applications/web_app.h b/chrome/browser/web_applications/web_app.h index c443f9c9..24f0e0bf 100644 --- a/chrome/browser/web_applications/web_app.h +++ b/chrome/browser/web_applications/web_app.h
@@ -455,7 +455,7 @@ // This adds a policy_id per management type (source) for the // ExternalConfigMap. void AddPolicyIdToManagementExternalConfigMap(WebAppManagement::Type type, - const std::string& policy_id); + std::string policy_id); // Encapsulate the addition of install_url and is_placeholder information // for cases where both need to be added. @@ -463,7 +463,8 @@ GURL install_url, bool is_placeholder); - bool RemoveInstallUrlForSource(WebAppManagement::Type type, GURL install_url); + bool RemoveInstallUrlForSource(WebAppManagement::Type type, + const GURL& install_url); // Only used on Mac, determines if the toolbar should be permanently shown // when in fullscreen.
diff --git a/chrome/browser/web_applications/web_app_command_scheduler.cc b/chrome/browser/web_applications/web_app_command_scheduler.cc index 4442257d..3f887be7 100644 --- a/chrome/browser/web_applications/web_app_command_scheduler.cc +++ b/chrome/browser/web_applications/web_app_command_scheduler.cc
@@ -436,7 +436,7 @@ provider_->command_manager().ScheduleCommand( std::make_unique<WebAppUninstallCommand>( app_id, external_install_source, uninstall_source, - std::move(callback), &profile_.get()), + std::move(callback), profile_.get()), location); }
diff --git a/chrome/browser/web_applications/web_app_install_finalizer.cc b/chrome/browser/web_applications/web_app_install_finalizer.cc index f31d9bde..ce64d8c 100644 --- a/chrome/browser/web_applications/web_app_install_finalizer.cc +++ b/chrome/browser/web_applications/web_app_install_finalizer.cc
@@ -395,11 +395,6 @@ started_ = false; } -void WebAppInstallFinalizer::SetRemoveManagementTypeCallbackForTesting( - base::RepeatingCallback<void(const AppId&)> callback) { - management_type_removed_callback_for_testing_ = std::move(callback); -} - void WebAppInstallFinalizer::SetSubsystems( WebAppInstallManager* install_manager, WebAppRegistrar* registrar, @@ -693,18 +688,18 @@ WebAppManagement::Type source, bool is_placeholder, GURL install_url, - const std::vector<std::string>& additional_policy_ids) { + std::vector<std::string> additional_policy_ids) { DCHECK(!(source == WebAppManagement::Type::kSync && is_placeholder)); if (source != WebAppManagement::Type::kSync) { web_app.AddPlaceholderInfoToManagementExternalConfigMap(source, is_placeholder); if (install_url.is_valid()) { - web_app.AddInstallURLToManagementExternalConfigMap(source, install_url); + web_app.AddInstallURLToManagementExternalConfigMap( + source, std::move(install_url)); } - if (!additional_policy_ids.empty()) { - for (const auto& policy_id : additional_policy_ids) { - web_app.AddPolicyIdToManagementExternalConfigMap(source, policy_id); - } + for (const auto& policy_id : additional_policy_ids) { + web_app.AddPolicyIdToManagementExternalConfigMap(source, + std::move(policy_id)); } } } @@ -716,12 +711,7 @@ UninstallWebAppCallback callback) { auto uninstall_command = std::make_unique<WebAppUninstallCommand>( app_id, external_install_source, uninstall_source, std::move(callback), - profile_); - - if (management_type_removed_callback_for_testing_) { - uninstall_command->SetRemoveManagementTypeCallbackForTesting( // IN-TEST - management_type_removed_callback_for_testing_); - } + *profile_); command_manager_->ScheduleCommand(std::move(uninstall_command)); }
diff --git a/chrome/browser/web_applications/web_app_install_finalizer.h b/chrome/browser/web_applications/web_app_install_finalizer.h index e7775dd..b6b0265 100644 --- a/chrome/browser/web_applications/web_app_install_finalizer.h +++ b/chrome/browser/web_applications/web_app_install_finalizer.h
@@ -158,9 +158,6 @@ WebAppCommandManager* command_manager, WebAppOriginAssociationManager* origin_association_manager); - virtual void SetRemoveManagementTypeCallbackForTesting( - base::RepeatingCallback<void(const AppId&)>); - Profile* profile() { return profile_; } const WebAppRegistrar& GetWebAppRegistrar() const; @@ -171,7 +168,7 @@ WebAppManagement::Type source, bool is_placeholder, GURL install_url, - const std::vector<std::string>& additional_policy_ids); + std::vector<std::string> additional_policy_ids); // Used to schedule a WebAppUninstallCommand. The |external_install_source| // field is only required for external app uninstalls to verify OS @@ -263,9 +260,6 @@ const raw_ptr<Profile> profile_; bool started_ = false; - base::RepeatingCallback<void(const AppId& app_id)> - management_type_removed_callback_for_testing_; - base::WeakPtrFactory<WebAppInstallFinalizer> weak_ptr_factory_{this}; };
diff --git a/chrome/browser/web_applications/web_app_install_manager.cc b/chrome/browser/web_applications/web_app_install_manager.cc index 31c591c..ad7184a 100644 --- a/chrome/browser/web_applications/web_app_install_manager.cc +++ b/chrome/browser/web_applications/web_app_install_manager.cc
@@ -121,6 +121,20 @@ // the webapps::WebappInstallSource in this event. } +void WebAppInstallManager::NotifyWebAppInstalledWithOsHooks( + const AppId& app_id) { + for (WebAppInstallManagerObserver& obs : observers_) { + obs.OnWebAppInstalledWithOsHooks(app_id); + } +} + +void WebAppInstallManager::NotifyWebAppSourceRemovedForTesting( + const AppId& app_id) { + for (WebAppInstallManagerObserver& observer : observers_) { + observer.OnWebAppSourceRemovedForTesting(app_id); + } +} + void WebAppInstallManager::NotifyWebAppUninstalled( const AppId& app_id, webapps::WebappUninstallSource uninstall_source) { @@ -150,11 +164,4 @@ } } -void WebAppInstallManager::NotifyWebAppInstalledWithOsHooks( - const AppId& app_id) { - for (WebAppInstallManagerObserver& obs : observers_) { - obs.OnWebAppInstalledWithOsHooks(app_id); - } -} - } // namespace web_app
diff --git a/chrome/browser/web_applications/web_app_install_manager.h b/chrome/browser/web_applications/web_app_install_manager.h index 21e6583..92c0d4c 100644 --- a/chrome/browser/web_applications/web_app_install_manager.h +++ b/chrome/browser/web_applications/web_app_install_manager.h
@@ -38,6 +38,7 @@ virtual void NotifyWebAppInstalled(const AppId& app_id); virtual void NotifyWebAppInstalledWithOsHooks(const AppId& app_id); + virtual void NotifyWebAppSourceRemovedForTesting(const AppId& app_id); virtual void NotifyWebAppUninstalled( const AppId& app_id, webapps::WebappUninstallSource uninstall_source); @@ -69,7 +70,8 @@ bool error_log_updated_ = false; bool error_log_writing_in_progress_ = false; - base::ObserverList<WebAppInstallManagerObserver> observers_; + base::ObserverList<WebAppInstallManagerObserver, /*check_empty=*/true> + observers_; base::WeakPtrFactory<WebAppInstallManager> weak_ptr_factory_{this}; };
diff --git a/chrome/browser/web_applications/web_app_install_manager_observer.h b/chrome/browser/web_applications/web_app_install_manager_observer.h index 9797c13b..c7116d2b 100644 --- a/chrome/browser/web_applications/web_app_install_manager_observer.h +++ b/chrome/browser/web_applications/web_app_install_manager_observer.h
@@ -39,6 +39,10 @@ // Called when the WebAppInstallManager is about to be destroyed. virtual void OnWebAppInstallManagerDestroyed() {} + + // Called after web app's install source is removed, currently only used by + // tests. + virtual void OnWebAppSourceRemovedForTesting(const AppId& app_id) {} }; } // namespace web_app
diff --git a/chrome/browser/web_applications/web_app_registrar.cc b/chrome/browser/web_applications/web_app_registrar.cc index bfb8363..356fe55 100644 --- a/chrome/browser/web_applications/web_app_registrar.cc +++ b/chrome/browser/web_applications/web_app_registrar.cc
@@ -1165,6 +1165,18 @@ return sub_app_ids; } +base::flat_map<AppId, AppId> WebAppRegistrar::GetSubAppToParentMap() const { + base::flat_map<AppId, AppId> parent_app_ids; + + for (const WebApp& app : GetApps()) { + if (app.parent_app_id().has_value()) { + parent_app_ids[app.app_id()] = *app.parent_app_id(); + } + } + + return parent_app_ids; +} + ValueWithPolicy<RunOnOsLoginMode> WebAppRegistrar::GetAppRunOnOsLoginMode( const AppId& app_id) const { RunOnOsLoginPolicy login_policy =
diff --git a/chrome/browser/web_applications/web_app_registrar.h b/chrome/browser/web_applications/web_app_registrar.h index 2e87f03..7f7a817 100644 --- a/chrome/browser/web_applications/web_app_registrar.h +++ b/chrome/browser/web_applications/web_app_registrar.h
@@ -281,6 +281,11 @@ // Gets the IDs for all sub-apps of parent app with id |parent_app_id|. std::vector<AppId> GetAllSubAppIds(const AppId& parent_app_id) const; + // Maps all app IDs to their parent apps' IDs. Maps that do not have a parent + // are omitted. This query should only be called with an AllAppsLock since all + // apps are queried for their parent. + base::flat_map<AppId, AppId> GetSubAppToParentMap() const; + // Returns the "scope" field from the app manifest, or infers a scope from the // "start_url" field if unavailable. Returns an invalid GURL iff the |app_id| // does not refer to an installed web app.
diff --git a/chrome/browser/web_applications/web_app_ui_manager.h b/chrome/browser/web_applications/web_app_ui_manager.h index 21382eec..89e79e7 100644 --- a/chrome/browser/web_applications/web_app_ui_manager.h +++ b/chrome/browser/web_applications/web_app_ui_manager.h
@@ -172,7 +172,7 @@ virtual void TriggerInstallDialog(content::WebContents* web_contents) = 0; private: - base::ObserverList<WebAppUiManagerObserver> observers_; + base::ObserverList<WebAppUiManagerObserver, /*check_empty=*/true> observers_; base::WeakPtrFactory<WebAppUiManager> weak_ptr_factory_{this}; };
diff --git a/chrome/browser/web_applications/web_app_uninstall_job.cc b/chrome/browser/web_applications/web_app_uninstall_job.cc deleted file mode 100644 index c359b11..0000000 --- a/chrome/browser/web_applications/web_app_uninstall_job.cc +++ /dev/null
@@ -1,204 +0,0 @@ -// Copyright 2022 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/web_applications/web_app_uninstall_job.h" - -#include <memory> - -#include "base/functional/bind.h" -#include "base/memory/ptr_util.h" -#include "base/metrics/histogram_functions.h" -#include "chrome/browser/web_applications/os_integration/os_integration_manager.h" -#include "chrome/browser/web_applications/web_app.h" -#include "chrome/browser/web_applications/web_app_icon_manager.h" -#include "chrome/browser/web_applications/web_app_install_finalizer.h" -#include "chrome/browser/web_applications/web_app_install_manager.h" -#include "chrome/browser/web_applications/web_app_registrar.h" -#include "chrome/browser/web_applications/web_app_registry_update.h" -#include "chrome/browser/web_applications/web_app_sync_bridge.h" -#include "chrome/browser/web_applications/web_app_translation_manager.h" -#include "components/webapps/browser/uninstall_result_code.h" - -#if BUILDFLAG(IS_CHROMEOS_LACROS) -#include "base/feature_list.h" -#include "base/functional/callback_helpers.h" -#include "chrome/browser/browser_process.h" -#include "chrome/browser/profiles/profile_attributes_storage.h" -#include "chrome/browser/profiles/profile_manager.h" -#include "chrome/browser/profiles/profile_metrics.h" -#include "chrome/browser/web_applications/web_app_utils.h" -#endif // BUILDFLAG(IS_CHROMEOS_LACROS) - -namespace web_app { - -// static -std::unique_ptr<WebAppUninstallJob> WebAppUninstallJob::CreateAndStart( - const AppId& app_id, - const url::Origin& app_origin, -#if BUILDFLAG(IS_CHROMEOS_LACROS) - const absl::optional<base::FilePath>& app_profile_path, -#endif // BUILDFLAG(IS_CHROMEOS_LACROS) - UninstallCallback callback, - OsIntegrationManager& os_integration_manager, - WebAppSyncBridge& sync_bridge, - WebAppIconManager& icon_manager, - WebAppRegistrar& registrar, - WebAppInstallManager& install_manager, - WebAppTranslationManager& translation_manager, - PrefService& profile_prefs, - webapps::WebappUninstallSource uninstall_source) { - return base::WrapUnique(new WebAppUninstallJob( - app_id, app_origin, -#if BUILDFLAG(IS_CHROMEOS_LACROS) - app_profile_path, -#endif // BUILDFLAG(IS_CHROMEOS_LACROS) - std::move(callback), os_integration_manager, sync_bridge, icon_manager, - registrar, install_manager, translation_manager, profile_prefs, - uninstall_source)); -} - -WebAppUninstallJob::WebAppUninstallJob( - const AppId& app_id, - const url::Origin& app_origin, -#if BUILDFLAG(IS_CHROMEOS_LACROS) - const absl::optional<base::FilePath>& app_profile_path, -#endif // BUILDFLAG(IS_CHROMEOS_LACROS) - UninstallCallback callback, - OsIntegrationManager& os_integration_manager, - WebAppSyncBridge& sync_bridge, - WebAppIconManager& icon_manager, - WebAppRegistrar& registrar, - WebAppInstallManager& install_manager, - WebAppTranslationManager& translation_manager, - PrefService& profile_prefs, - webapps::WebappUninstallSource uninstall_source) - : app_id_(app_id), - callback_(std::move(callback)), - registrar_(®istrar), - sync_bridge_(&sync_bridge), - install_manager_(&install_manager), - uninstall_source_(uninstall_source) { - Start(app_origin, -#if BUILDFLAG(IS_CHROMEOS_LACROS) - app_profile_path, -#endif // BUILDFLAG(IS_CHROMEOS_LACROS) - os_integration_manager, icon_manager, translation_manager, - profile_prefs); -} - -WebAppUninstallJob::~WebAppUninstallJob() = default; - -void WebAppUninstallJob::Start( - const url::Origin& app_origin, -#if BUILDFLAG(IS_CHROMEOS_LACROS) - const absl::optional<base::FilePath>& app_profile_path, -#endif // BUILDFLAG(IS_CHROMEOS_LACROS) - OsIntegrationManager& os_integration_manager, - WebAppIconManager& icon_manager, - WebAppTranslationManager& translation_manager, - PrefService& profile_prefs) { - DCHECK(install_manager_); - - DCHECK(state_ == State::kNotStarted); - state_ = State::kPendingDataDeletion; - - install_manager_->NotifyWebAppWillBeUninstalled(app_id_); - - // Note: It is supported to re-start an uninstall on startup, so - // `is_uninstalling()` is not checked. It is a class invariant that there can - // never be more than one uninstall task operating on the same web app at the - // same time. - { - ScopedRegistryUpdate update(sync_bridge_); - WebApp* app = update->UpdateApp(app_id_); - DCHECK(app); - app->SetIsUninstalling(true); - } - - auto synchronize_barrier = OsIntegrationManager::GetBarrierForSynchronize( - base::BindOnce(&WebAppUninstallJob::OnOsHooksUninstalled, - weak_ptr_factory_.GetWeakPtr())); - - // TODO(crbug.com/1401125): Remove UninstallAllOsHooks() once OS integration - // sub managers have been implemented. - os_integration_manager.UninstallAllOsHooks(app_id_, synchronize_barrier); - os_integration_manager.Synchronize( - app_id_, base::BindOnce(synchronize_barrier, OsHooksErrors())); - - // While sometimes `Synchronize` needs to read icon data, for the uninstall - // case it never needs to be read. Thus, it is safe to schedule this now and - // not after the `Synchronize` call completes. - icon_manager.DeleteData(app_id_, - base::BindOnce(&WebAppUninstallJob::OnIconDataDeleted, - weak_ptr_factory_.GetWeakPtr())); - - translation_manager.DeleteTranslations( - app_id_, base::BindOnce(&WebAppUninstallJob::OnTranslationDataDeleted, - weak_ptr_factory_.GetWeakPtr())); - -#if BUILDFLAG(IS_CHROMEOS_LACROS) - if (ResolveExperimentalWebAppIsolationFeature() == - ExperimentalWebAppIsolationMode::kProfile && - app_profile_path.has_value()) { - CHECK(Profile::IsWebAppProfilePath(app_profile_path.value())); - auto* profile_manager = g_browser_process->profile_manager(); - - // Check whether the profile exists or not before removing it. - if (profile_manager->GetProfileAttributesStorage() - .GetProfileAttributesWithPath(app_profile_path.value())) { - g_browser_process->profile_manager() - ->GetDeleteProfileHelper() - .MaybeScheduleProfileForDeletion( - app_profile_path.value(), base::DoNothing(), - ProfileMetrics::ProfileDelete::DELETE_PROFILE_USER_MANAGER); - } else { - LOG(ERROR) << "cannot find web app profile at " - << app_profile_path.value(); - } - } -#endif // BUILDFLAG(IS_CHROMEOS_LACROS) -} - -void WebAppUninstallJob::OnOsHooksUninstalled(OsHooksErrors errors) { - DCHECK(state_ == State::kPendingDataDeletion); - hooks_uninstalled_ = true; - base::UmaHistogramBoolean("WebApp.Uninstall.OsHookSuccess", errors.none()); - errors_ = errors_ || errors.any(); - MaybeFinishUninstall(); -} - -void WebAppUninstallJob::OnIconDataDeleted(bool success) { - DCHECK(state_ == State::kPendingDataDeletion); - app_data_deleted_ = true; - base::UmaHistogramBoolean("WebApp.Uninstall.IconDataSuccess", success); - errors_ = errors_ || !success; - MaybeFinishUninstall(); -} - -void WebAppUninstallJob::OnTranslationDataDeleted(bool success) { - DCHECK(state_ == State::kPendingDataDeletion); - translation_data_deleted_ = true; - errors_ = errors_ || !success; - MaybeFinishUninstall(); -} - -void WebAppUninstallJob::MaybeFinishUninstall() { - DCHECK(state_ == State::kPendingDataDeletion); - if (!hooks_uninstalled_ || !app_data_deleted_ || !translation_data_deleted_) { - return; - } - state_ = State::kDone; - - base::UmaHistogramBoolean("WebApp.Uninstall.Result", !errors_); - { - DCHECK_NE(registrar_->GetAppById(app_id_), nullptr); - ScopedRegistryUpdate update(sync_bridge_); - update->DeleteApp(app_id_); - } - install_manager_->NotifyWebAppUninstalled(app_id_, uninstall_source_); - std::move(callback_).Run(errors_ ? webapps::UninstallResultCode::kError - : webapps::UninstallResultCode::kSuccess); -} - -} // namespace web_app
diff --git a/chrome/browser/web_applications/web_app_uninstall_job.h b/chrome/browser/web_applications/web_app_uninstall_job.h deleted file mode 100644 index f290077d6..0000000 --- a/chrome/browser/web_applications/web_app_uninstall_job.h +++ /dev/null
@@ -1,129 +0,0 @@ -// Copyright 2022 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_UNINSTALL_JOB_H_ -#define CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_UNINSTALL_JOB_H_ - -#include <memory> - -#include "base/functional/callback.h" -#include "base/memory/raw_ptr.h" -#include "base/memory/weak_ptr.h" -#include "chrome/browser/web_applications/os_integration/os_integration_manager.h" -#include "chrome/browser/web_applications/web_app_id.h" -#include "url/origin.h" - -#if BUILDFLAG(IS_CHROMEOS_LACROS) -#include "base/files/file_path.h" -#include "third_party/abseil-cpp/absl/types/optional.h" -#endif // BUILDFLAG(IS_CHROMEOS_LACROS) - -class PrefService; - -namespace webapps { -enum class UninstallResultCode; -enum class WebappUninstallSource; -} // namespace webapps - -namespace web_app { - -class OsIntegrationManager; -class WebAppIconManager; -class WebAppInstallManager; -class WebAppRegistrar; -class WebAppSyncBridge; -class WebAppTranslationManager; - -// Uninstalls a given web app by: -// 1) Unregistering OS hooks. -// 2) Deleting the app from the database. -// 3) Deleting data on disk. -// Extra invariants: -// * There is never more than one uninstall task operating on the same app at -// the same time. -class WebAppUninstallJob { - public: - using UninstallCallback = - base::OnceCallback<void(webapps::UninstallResultCode)>; - - // static - static std::unique_ptr<WebAppUninstallJob> CreateAndStart( - const AppId& app_id, - const url::Origin& app_origin, -#if BUILDFLAG(IS_CHROMEOS_LACROS) - const absl::optional<base::FilePath>& app_profile_path, -#endif // BUILDFLAG(IS_CHROMEOS_LACROS) - UninstallCallback callback, - OsIntegrationManager& os_integration_manager, - WebAppSyncBridge& sync_bridge, - WebAppIconManager& icon_manager, - WebAppRegistrar& registrar, - WebAppInstallManager& install_manager, - WebAppTranslationManager& translation_manager, - PrefService& profile_prefs, - webapps::WebappUninstallSource uninstall_source); - - ~WebAppUninstallJob(); - - private: - WebAppUninstallJob(const AppId& app_id, - const url::Origin& app_origin, -#if BUILDFLAG(IS_CHROMEOS_LACROS) - const absl::optional<base::FilePath>& app_profile_path, -#endif // BUILDFLAG(IS_CHROMEOS_LACROS) - UninstallCallback callback, - OsIntegrationManager& os_integration_manager, - WebAppSyncBridge& sync_bridge, - WebAppIconManager& icon_manager, - WebAppRegistrar& registrar, - WebAppInstallManager& install_manager, - WebAppTranslationManager& translation_manager, - PrefService& profile_prefs, - webapps::WebappUninstallSource uninstall_source); - - // The given `app_id` must correspond to an app in the `registrar`. - // This modifies the app to set `is_uninstalling()` to true, and delete the - // app from the registry after uninstallation is complete. - void Start(const url::Origin& app_origin, -#if BUILDFLAG(IS_CHROMEOS_LACROS) - const absl::optional<base::FilePath>& app_profile_path, -#endif // BUILDFLAG(IS_CHROMEOS_LACROS) - OsIntegrationManager& os_integration_manager, - WebAppIconManager& icon_manager, - WebAppTranslationManager& translation_manager, - PrefService& profile_prefs); - void OnOsHooksUninstalled(OsHooksErrors errors); - void OnIconDataDeleted(bool success); - void OnTranslationDataDeleted(bool success); - void MaybeFinishUninstall(); - - enum class State { - kNotStarted = 0, - kPendingDataDeletion = 1, - kDone = 2, - } state_ = State::kNotStarted; - - AppId app_id_; - UninstallCallback callback_; - - // The WebAppUninstallJob is kicked off by the WebAppUninstallCommand - // and is constructed and destructed well within the lifetime of the - // Uninstall command. This ensures that this class is guaranteed to be - // destructed before any of the WebAppProvider systems shut down. - raw_ptr<WebAppRegistrar> registrar_; - raw_ptr<WebAppSyncBridge> sync_bridge_; - raw_ptr<WebAppInstallManager> install_manager_; - - webapps::WebappUninstallSource uninstall_source_; - bool app_data_deleted_ = false; - bool translation_data_deleted_ = false; - bool hooks_uninstalled_ = false; - bool errors_ = false; - - base::WeakPtrFactory<WebAppUninstallJob> weak_ptr_factory_{this}; -}; - -} // namespace web_app - -#endif // CHROME_BROWSER_WEB_APPLICATIONS_WEB_APP_UNINSTALL_JOB_H_
diff --git a/chrome/build/lacros-arm.pgo.txt b/chrome/build/lacros-arm.pgo.txt index 1b858d8..bd2a5df 100644 --- a/chrome/build/lacros-arm.pgo.txt +++ b/chrome/build/lacros-arm.pgo.txt
@@ -1 +1 @@ -chrome-chromeos-arm-generic-main-1684843186-dd341c1dae4901f683bab1a2faae7dd03715bdfd.profdata +chrome-chromeos-arm-generic-main-1684886803-20d74b277eb4f27fb43292ceb860880c2b06f39b.profdata
diff --git a/chrome/build/lacros-arm64.pgo.txt b/chrome/build/lacros-arm64.pgo.txt index a1160e0..83728df7 100644 --- a/chrome/build/lacros-arm64.pgo.txt +++ b/chrome/build/lacros-arm64.pgo.txt
@@ -1 +1 @@ -chrome-chromeos-arm64-generic-main-1684843186-54b0745b334fc6d936c55e4bdbc777627914ee75.profdata +chrome-chromeos-arm64-generic-main-1684886803-f6885b00cd17fefe617af20591914693a4a0ed0e.profdata
diff --git a/chrome/build/lacros64.pgo.txt b/chrome/build/lacros64.pgo.txt index 3550725d..87152fb 100644 --- a/chrome/build/lacros64.pgo.txt +++ b/chrome/build/lacros64.pgo.txt
@@ -1 +1 @@ -chrome-chromeos-amd64-generic-main-1684857571-35fa0914b2941546c62053cead1c48f1ad2659ad.profdata +chrome-chromeos-amd64-generic-main-1684887118-2604d8c5a4d02e59ccefa892dc5ab3827d06e8cc.profdata
diff --git a/chrome/build/linux.pgo.txt b/chrome/build/linux.pgo.txt index 3f9872a..16d7622 100644 --- a/chrome/build/linux.pgo.txt +++ b/chrome/build/linux.pgo.txt
@@ -1 +1 @@ -chrome-linux-main-1684864756-9ab147ace0ed71ea016c69410f36a2e38465c266.profdata +chrome-linux-main-1684907930-f057a1d02cc8198a115712d19ee86209762f357b.profdata
diff --git a/chrome/build/mac-arm.pgo.txt b/chrome/build/mac-arm.pgo.txt index 1796400..a9e2e13 100644 --- a/chrome/build/mac-arm.pgo.txt +++ b/chrome/build/mac-arm.pgo.txt
@@ -1 +1 @@ -chrome-mac-arm-main-1684878998-7757382a46c81484542ce86e2b6b18c3e4d5dce0.profdata +chrome-mac-arm-main-1684914986-54075a54b4d666a9c9dd541c8eec848cbeef9466.profdata
diff --git a/chrome/build/mac.pgo.txt b/chrome/build/mac.pgo.txt index b52c6c98..6b58e51b 100644 --- a/chrome/build/mac.pgo.txt +++ b/chrome/build/mac.pgo.txt
@@ -1 +1 @@ -chrome-mac-main-1684843186-20275422f87fd4060045add080e17b05083a03e5.profdata +chrome-mac-main-1684907930-4ac6ec08f1838412b0e13dbfc5354ec7a19d5def.profdata
diff --git a/chrome/build/win32.pgo.txt b/chrome/build/win32.pgo.txt index 50baafa..8555a3e 100644 --- a/chrome/build/win32.pgo.txt +++ b/chrome/build/win32.pgo.txt
@@ -1 +1 @@ -chrome-win32-main-1684875567-8622321110b6e5463a011c39a29284ca07ab3f7e.profdata +chrome-win32-main-1684907930-3c9350542324cef5fae1b4ca3383bd7128447da8.profdata
diff --git a/chrome/build/win64.pgo.txt b/chrome/build/win64.pgo.txt index b873d4d..9096461 100644 --- a/chrome/build/win64.pgo.txt +++ b/chrome/build/win64.pgo.txt
@@ -1 +1 @@ -chrome-win64-main-1684875567-5978a7987679a8c46c492f6dc1bb8ca9a714d1d2.profdata +chrome-win64-main-1684895541-b75d20fec10e1862f07e2d2d5ea4318ec8095291.profdata
diff --git a/chrome/common/extensions/api/file_manager_private.idl b/chrome/common/extensions/api/file_manager_private.idl index f084f47..da455fa40 100644 --- a/chrome/common/extensions/api/file_manager_private.idl +++ b/chrome/common/extensions/api/file_manager_private.idl
@@ -254,7 +254,8 @@ isArbitrarySyncFolder, syncStatus, progress, - shortcut + shortcut, + syncCompletedTime }; // Source of the volume data. @@ -562,6 +563,10 @@ // for Drive syncing. double? progress; + // Time in milliseconds since the epoch when the file last received a + // "completed" sync status. + double? syncCompletedTime; + // True if the entry is a shortcut. boolean? shortcut; };
diff --git a/chrome/common/extensions/api/smart_card_provider_private.idl b/chrome/common/extensions/api/smart_card_provider_private.idl index 96befce..06548ff 100644 --- a/chrome/common/extensions/api/smart_card_provider_private.idl +++ b/chrome/common/extensions/api/smart_card_provider_private.idl
@@ -146,7 +146,7 @@ // Browser requested a SCardCancel call. // Extension must report the result to the browser by calling - // reportCancelResult. + // reportPlainResult. [maxListeners=1] static void onCancelRequested(long requestId, long scardContext); @@ -161,7 +161,7 @@ // Browser requested a SCardDisconnect call. // Extension must report the result to the browser by calling - // reportDisconnectResult. + // reportPlainResult. [maxListeners=1] static void onDisconnectRequested(long requestId, long scardHandle, Disposition disposition); @@ -201,17 +201,15 @@ static void reportGetStatusChangeResult(long requestId, ReaderStateOut[] readerStates, ResultCode resultCode); - // Reports the result of a SCardCancel call. - static void reportCancelResult(long requestId, + // Reports the result of a call which doesn't send back any other + // information. + static void reportPlainResult(long requestId, ResultCode resultCode); // Reports the result of a SCardConnect call. static void reportConnectResult(long requestId, long scardHandle, Protocol activeProtocol, ResultCode resultCode); - // Reports the result of a SCardDisconnect call. - static void reportDisconnectResult(long requestId, ResultCode resultCode); - // Reports the result of a call that sends back data on success. static void reportDataResult(long requestId, ArrayBuffer data, ResultCode resultCode);
diff --git a/chrome/common/pref_names.cc b/chrome/common/pref_names.cc index aaf856b..e14da07d 100644 --- a/chrome/common/pref_names.cc +++ b/chrome/common/pref_names.cc
@@ -1133,6 +1133,18 @@ // Search survey. const char kHatsOsSettingsSearchSurveyIsSelected[] = "hats_os_settings_search_is_selected"; + +// A dictionary storing the string representation of +// chromeos::settings::mojom::Setting IDs for the unique OS Settings changed. +// Implicitly stores the total count of the unique OS Settings changed by each +// user per device. +// Key:string = the int equivalent of the Settings enum +// chromeos::settings::mojom::Setting casted to string. Need to cast to +// string since the keys in a dictionary can only be strings. +// Value:int = constant number 1. It signifies whether that particular Settings +// has been used by the user during the device's lifetime. +const char kTotalUniqueOsSettingsChanged[] = + "settings.total_unique_os_settings_changed"; #endif // BUILDFLAG(IS_CHROMEOS_ASH) #if BUILDFLAG(IS_CHROMEOS)
diff --git a/chrome/common/pref_names.h b/chrome/common/pref_names.h index 48bc5bc..ed9885add 100644 --- a/chrome/common/pref_names.h +++ b/chrome/common/pref_names.h
@@ -358,6 +358,7 @@ extern const char kSystemProxyUserTrafficHostAndPort[]; extern const char kEduCoexistenceArcMigrationCompleted[]; extern const char kSharedStorage[]; +extern const char kTotalUniqueOsSettingsChanged[]; #endif // BUILDFLAG(IS_CHROMEOS_ASH) #if BUILDFLAG(IS_CHROMEOS) extern const char kDeskAPIThirdPartyAccessEnabled[];
diff --git a/chrome/test/data/page_load_metrics/framework-version-detection/angular-clamped.html b/chrome/test/data/page_load_metrics/framework-version-detection/angular-clamped.html new file mode 100644 index 0000000..39d8b5f --- /dev/null +++ b/chrome/test/data/page_load_metrics/framework-version-detection/angular-clamped.html
@@ -0,0 +1,3 @@ +<!DOCTYPE html> +<body> +<div ng-version="300.4000.333.12.x"></div>
diff --git a/chrome/test/data/page_load_metrics/framework-version-detection/angular.html b/chrome/test/data/page_load_metrics/framework-version-detection/angular.html new file mode 100644 index 0000000..d9a1f3d --- /dev/null +++ b/chrome/test/data/page_load_metrics/framework-version-detection/angular.html
@@ -0,0 +1,3 @@ +<!DOCTYPE html> +<body> +<div ng-version="14.0.4"></div>
diff --git a/chrome/test/data/page_load_metrics/framework-version-detection/drupal.html b/chrome/test/data/page_load_metrics/framework-version-detection/drupal.html new file mode 100644 index 0000000..7bedf9b --- /dev/null +++ b/chrome/test/data/page_load_metrics/framework-version-detection/drupal.html
@@ -0,0 +1,4 @@ +<!DOCTYPE html> +<meta name="generator" content="Drupal 7 Something"></script> +<body> +</body>
diff --git a/chrome/test/data/page_load_metrics/framework-version-detection/nextjs.html b/chrome/test/data/page_load_metrics/framework-version-detection/nextjs.html new file mode 100644 index 0000000..d4b5918 --- /dev/null +++ b/chrome/test/data/page_load_metrics/framework-version-detection/nextjs.html
@@ -0,0 +1,8 @@ +<!DOCTYPE html> +<body> +<div id="__next"></div> +<script> + window.__NEXT_DATA__ = {}; + window.next = {version: '13.3.2-canary.11'}; +</script> +</body>
diff --git a/chrome/test/data/page_load_metrics/framework-version-detection/not-detected-bad-values.html b/chrome/test/data/page_load_metrics/framework-version-detection/not-detected-bad-values.html new file mode 100644 index 0000000..d50a7de --- /dev/null +++ b/chrome/test/data/page_load_metrics/framework-version-detection/not-detected-bad-values.html
@@ -0,0 +1,13 @@ +<!DOCTYPE html> +<body> + <div id="__next"></div> + <script> + +// Version should be a string +window.Vue = {version: 3 }; +window.__NEXT_DATA__ = {}; + +// next without "version" key +window.next = {ver_sion: '13.3.2-canary.11'}; + </script> +</body>
diff --git a/chrome/test/data/page_load_metrics/framework-version-detection/not-detected.html b/chrome/test/data/page_load_metrics/framework-version-detection/not-detected.html new file mode 100644 index 0000000..72c0c83 --- /dev/null +++ b/chrome/test/data/page_load_metrics/framework-version-detection/not-detected.html
@@ -0,0 +1,3 @@ +<!DOCTYPE html> +<body> +</body>
diff --git a/chrome/test/data/page_load_metrics/framework-version-detection/vue2.html b/chrome/test/data/page_load_metrics/framework-version-detection/vue2.html new file mode 100644 index 0000000..7b57b53 --- /dev/null +++ b/chrome/test/data/page_load_metrics/framework-version-detection/vue2.html
@@ -0,0 +1,6 @@ +<!DOCTYPE html> +<body> +<script> + window.Vue = {version: "2.1.2" }; +</script> +</body>
diff --git a/chrome/test/data/page_load_metrics/framework-version-detection/vue3.html b/chrome/test/data/page_load_metrics/framework-version-detection/vue3.html new file mode 100644 index 0000000..955ceea --- /dev/null +++ b/chrome/test/data/page_load_metrics/framework-version-detection/vue3.html
@@ -0,0 +1,6 @@ +<!DOCTYPE html> +<body> +<script> + window.__VUE__ = true; +</script> +</body>
diff --git a/chrome/test/data/page_load_metrics/framework-version-detection/wordpress.html b/chrome/test/data/page_load_metrics/framework-version-detection/wordpress.html new file mode 100644 index 0000000..5b1f824 --- /dev/null +++ b/chrome/test/data/page_load_metrics/framework-version-detection/wordpress.html
@@ -0,0 +1,4 @@ +<!DOCTYPE html> +<meta name="generator" content="WordPress 6.2.3"></script> +<body> +</body>
diff --git a/chrome/test/data/webrtc/peerconnection_getstats.js b/chrome/test/data/webrtc/peerconnection_getstats.js index 57e4bf8..0f04d52 100644 --- a/chrome/test/data/webrtc/peerconnection_getstats.js +++ b/chrome/test/data/webrtc/peerconnection_getstats.js
@@ -4,548 +4,10 @@ * found in the LICENSE file. */ -/** - * Constructs an RTCStats dictionary by merging the parent RTCStats object with - * the dictionary of RTCStats members defined for this dictionary. - */ -function RTCStats(parent, membersObject) { - if (parent != null) - Object.assign(this, parent); - Object.assign(this, membersObject); -} - -const Presence = { - MANDATORY: true, - OPTIONAL: false, -}; - -/** - * According to spec, multiple stats dictionaries can have the same - * "RTCStats.type". For example, "track" refers to any of - * RTCSenderVideoTrackAttachmentStats, RTCSenderAudioTrackAttachmentStats, - * RTCReceiverVideoTrackAttachmentStats and - * RTCReceiverAudioTrackAttachmentStats. Inspection is needed to determine which - * dictionary applies to the object; for simplicity, this class merges all of - * the associated dictionaries into a single dictionary. - */ -class MergedRTCStats { - constructor(presence, type, stats) { - this.presence_ = presence; - this.type_ = type; - this.stats_ = stats; - } - - presence() { - return this.presence_; - } - - type() { - return this.type_; - } - - stats() { - return this.stats_; - } - - merge(presence, stats) { - if (presence) - this.presence_ = true; - Object.assign(this.stats_, stats); - } -} - -/** - * Maps "RTCStats.type" values to MergedRTCStats. These are descriptions of - * allowlisted (allowed to be exposed to the web) RTCStats-derived dictionaries, - * see RTCStats definitions below. - * @private - */ -const gStatsAllowlist = new Map(); - -function addRTCStatsToAllowlist(presence, type, stats) { - mergedStats = gStatsAllowlist.get(type); - if (!mergedStats) { - gStatsAllowlist.set(type, new MergedRTCStats(presence, type, stats)); - } else { - mergedStats.merge(presence, stats); - } -} - -/** - * RTCRtpStreamStats - * https://w3c.github.io/webrtc-stats/#streamstats-dict* - * @private - */ -let kRTCRtpStreamStats = new RTCStats(null, { - ssrc: 'number', - isRemote: 'boolean', // Obsolete, type reveals if "remote-" or not. - kind: 'string', - mediaType: 'string', // Obsolete, replaced by |kind|. - transportId: 'string', - codecId: 'string', -}); - -/** - * RTCReceivedRtpStreamStats - * https://w3c.github.io/webrtc-stats/#dom-rtcreceivedrtpstreamstats - * @private - */ -let kRTCReceivedRtpStreamStats = new RTCStats(kRTCRtpStreamStats, { - packetsReceived: 'number', - packetsLost: 'number', - jitter: 'number', - }); - -/* - * RTCInboundRtpStreamStats - * https://w3c.github.io/webrtc-stats/#inboundrtpstats-dict* - * @private - */ -let kRTCInboundRtpStreamStats = new RTCStats(kRTCReceivedRtpStreamStats, { - trackId: 'string', - trackIdentifier: 'string', - mid: 'string', - remoteId: 'string', - framesDecoded: 'number', - keyFramesDecoded: 'number', - qpSum: 'number', - totalDecodeTime: 'number', - totalProcessingDelay: 'number', - totalInterFrameDelay: 'number', - totalSquaredInterFrameDelay: 'number', - freezeCount: 'number', - pauseCount: 'number', - totalFreezesDuration: 'number', - totalPausesDuration: 'number', - lastPacketReceivedTimestamp: 'number', - fecPacketsReceived: 'number', - fecPacketsDiscarded: 'number', - bytesReceived: 'number', - headerBytesReceived: 'number', - packetsDiscarded: 'number', - nackCount: 'number', - firCount: 'number', - pliCount: 'number', - frameWidth: 'number', - frameHeight: 'number', - framesPerSecond: 'number', - jitterBufferDelay: 'number', - jitterBufferTargetDelay: 'number', - jitterBufferMinimumDelay: 'number', - jitterBufferEmittedCount: 'number', - totalSamplesReceived: 'number', - concealedSamples: 'number', - silentConcealedSamples: 'number', - concealmentEvents: 'number', - insertedSamplesForDeceleration: 'number', - removedSamplesForAcceleration: 'number', - audioLevel: 'number', - totalAudioEnergy: 'number', - totalSamplesDuration: 'number', - framesReceived: 'number', - framesDropped: 'number', - estimatedPlayoutTimestamp: 'number', - fractionLost: 'number', // Obsolete, moved to RTCRemoteInboundRtpStreamStats. - decoderImplementation: 'string', - playoutId: 'string', - powerEfficientDecoder: 'boolean', - framesAssembledFromMultiplePackets: 'number', - totalAssemblyTime: 'number', - googTimingFrameInfo: 'string', - retransmittedPacketsReceived: 'number', - retransmittedBytesReceived: 'number', -}); -addRTCStatsToAllowlist( - Presence.MANDATORY, 'inbound-rtp', kRTCInboundRtpStreamStats); - -/* - * RTCRemoteInboundRtpStreamStats - * https://w3c.github.io/webrtc-stats/#remoteinboundrtpstats-dict* - * @private - */ -let kRTCRemoteInboundRtpStreamStats = - new RTCStats(kRTCReceivedRtpStreamStats, { - localId: 'string', - roundTripTime: 'number', - fractionLost: 'number', - totalRoundTripTime: 'number', - roundTripTimeMeasurements: 'number', -}); -// TODO(https://crbug.com/967382): Update the browser_tests to wait for the -// existence of remote-inbound-rtp as well (these are created later than -// outbound-rtp). When this is done, change presence to MANDATORY. -addRTCStatsToAllowlist( - Presence.OPTIONAL, 'remote-inbound-rtp', kRTCRemoteInboundRtpStreamStats); - -/** - * RTCSentRtpStreamStats - * https://w3c.github.io/webrtc-stats/#dom-rtcsentrtpstreamstats - * @private - */ -let kRTCSentRtpStreamStats = new RTCStats(kRTCRtpStreamStats, { - packetsSent: 'number', - bytesSent: 'number', - bytesDiscardedOnSend: 'number', -}); - -/* - * RTCOutboundRtpStreamStats - * https://w3c.github.io/webrtc-stats/#outboundrtpstats-dict* - * @private - */ -let kRTCOutboundRtpStreamStats = new RTCStats(kRTCSentRtpStreamStats, { - trackId: 'string', - mediaSourceId: 'string', - remoteId: 'string', - mid: 'string', - retransmittedPacketsSent: 'number', - retransmittedBytesSent: 'number', - headerBytesSent: 'number', - targetBitrate: 'number', - totalEncodedBytesTarget: 'number', - framesEncoded: 'number', - keyFramesEncoded: 'number', - qpSum: 'number', - totalEncodeTime: 'number', - totalPacketSendDelay: 'number', - qualityLimitationReason: 'string', - qualityLimitationDurations: 'object', - qualityLimitationResolutionChanges: 'number', - nackCount: 'number', - firCount: 'number', - pliCount: 'number', - encoderImplementation: 'string', - rid: 'string', - frameWidth: 'number', - frameHeight: 'number', - framesPerSecond: 'number', - framesSent: 'number', - hugeFramesSent: 'number', - active: 'boolean', - powerEfficientEncoder: 'boolean', - scalabilityMode: 'string', -}); -addRTCStatsToAllowlist( - Presence.MANDATORY, 'outbound-rtp', kRTCOutboundRtpStreamStats); - -/* - * RTCRemoteOutboundRtpStreamStats - * https://w3c.github.io/webrtc-stats/#dom-rtcremoteoutboundrtpstreamstats - * @private - */ -let kRTCRemoteOutboundRtpStreamStats = new RTCStats(kRTCSentRtpStreamStats, { - localId: 'string', - remoteTimestamp: 'number', - reportsSent: 'number', - roundTripTime: 'number', - totalRoundTripTime: 'number', - roundTripTimeMeasurements: 'number', -}); -// TODO(hbos): When remote-outbound-rtp is implemented, make presence MANDATORY. -addRTCStatsToAllowlist( - Presence.OPTIONAL, 'remote-outbound-rtp', kRTCRemoteOutboundRtpStreamStats); - -/** - * RTCMediaSourceStats - * https://w3c.github.io/webrtc-stats/#dom-rtcmediasourcestats - * @private - */ -const kRTCMediaSourceStats = new RTCStats(null, { - trackIdentifier: 'string', - kind: 'string', -}); - -/** - * RTCAudioSourceStats - * https://w3c.github.io/webrtc-stats/#dom-rtcaudiosourcestats - * @private - */ -const kRTCAudioSourceStats = new RTCStats(kRTCMediaSourceStats, { - audioLevel: 'number', - totalAudioEnergy: 'number', - totalSamplesDuration: 'number', - echoReturnLoss: 'number', - echoReturnLossEnhancement: 'number', -}); -addRTCStatsToAllowlist( - Presence.MANDATORY, 'media-source', kRTCAudioSourceStats); - -/** - * RTCVideoSourceStats - * https://w3c.github.io/webrtc-stats/#dom-rtcvideosourcestats - * @private - */ -const kRTCVideoSourceStats = new RTCStats(kRTCMediaSourceStats, { - width: 'number', - height: 'number', - frames: 'number', - framesPerSecond: 'number', -}); -addRTCStatsToAllowlist( - Presence.MANDATORY, 'media-source', kRTCVideoSourceStats); - -/* - * RTCRtpContributingSourceStats - * https://w3c.github.io/webrtc-stats/#dom-rtcrtpcontributingsourcestats - * @private - */ -let kRTCRtpContributingSourceStats = new RTCStats(null, { - contributorSsrc: 'number', - inboundRtpStreamId: 'string', - packetsContributedTo: 'number', - audioLevel: 'number', -}); -// TODO(hbos): When csrc is implemented, make presence MANDATORY. -addRTCStatsToAllowlist( - Presence.OPTIONAL, 'csrc', kRTCRtpContributingSourceStats); - -/* - * RTCCodecStats - * https://w3c.github.io/webrtc-stats/#codec-dict* - * @private - */ -let kRTCCodecStats = new RTCStats(null, { - transportId: 'string', - payloadType: 'number', - mimeType: 'string', - clockRate: 'number', - channels: 'number', - sdpFmtpLine: 'string', -}); -addRTCStatsToAllowlist(Presence.MANDATORY, 'codec', kRTCCodecStats); - -/* - * RTCPeerConnectionStats - * https://w3c.github.io/webrtc-stats/#pcstats-dict* - * @private - */ -let kRTCPeerConnectionStats = new RTCStats(null, { - dataChannelsOpened: 'number', - dataChannelsClosed: 'number', -}); -addRTCStatsToAllowlist( - Presence.MANDATORY, 'peer-connection', kRTCPeerConnectionStats); - -/* - * RTCMediaStreamStats - * https://w3c.github.io/webrtc-stats/#obsolete-rtcmediastreamstats-members - * @private - */ -let kRTCMediaStreamStats = new RTCStats(null, { - streamIdentifier: 'string', - trackIds: 'sequence_string', -}); -// It's OPTIONAL because this dictionary has become obsolete. -addRTCStatsToAllowlist(Presence.OPTIONAL, 'stream', kRTCMediaStreamStats); - -/** - * RTCMediaStreamTrackStats - * https://w3c.github.io/webrtc-stats/#dom-rtcmediastreamtrackstats - * @private - */ -let kRTCMediaStreamTrackStats = new RTCStats('track', { - trackIdentifier: 'string', - remoteSource: 'boolean', - ended: 'boolean', - kind: 'string', - priority: 'string', - detached: 'boolean', // Obsolete, detached stats should fire "onstatsended". - frameWidth: 'number', - frameHeight: 'number', - mediaSourceId: 'string', - framesCaptured: 'number', - framesSent: 'number', - hugeFramesSent: 'number', - estimatedPlayoutTimestamp: 'number', - jitterBufferDelay: 'number', - jitterBufferEmittedCount: 'number', - framesReceived: 'number', - framesDecoded: 'number', - framesDropped: 'number', - audioLevel: 'number', - totalAudioEnergy: 'number', - totalSamplesDuration: 'number', - echoReturnLoss: 'number', - echoReturnLossEnhancement: 'number', - totalSamplesReceived: 'number', - concealedSamples: 'number', - silentConcealedSamples: 'number', - concealmentEvents: 'number', - insertedSamplesForDeceleration: 'number', - removedSamplesForAcceleration: 'number', -}); -// It's OPTIONAL because this dictionary has become obsolete. -addRTCStatsToAllowlist(Presence.OPTIONAL, 'track', kRTCMediaStreamTrackStats); - -/* - * RTCDataChannelStats - * https://w3c.github.io/webrtc-stats/#dcstats-dict* - * @private - */ -let kRTCDataChannelStats = new RTCStats(null, { - label: 'string', - protocol: 'string', - dataChannelIdentifier: 'number', - state: 'string', - messagesSent: 'number', - bytesSent: 'number', - messagesReceived: 'number', - bytesReceived: 'number', -}); -addRTCStatsToAllowlist( - Presence.MANDATORY, 'data-channel', kRTCDataChannelStats); - -/* - * RTCTransportStats - * https://w3c.github.io/webrtc-stats/#transportstats-dict* - * @private - */ -let kRTCTransportStats = new RTCStats(null, { - bytesSent: 'number', - packetsSent: 'number', - bytesReceived: 'number', - packetsReceived: 'number', - rtcpTransportStatsId: 'string', - dtlsState: 'string', - selectedCandidatePairId: 'string', - localCertificateId: 'string', - remoteCertificateId: 'string', - tlsVersion: 'string', - dtlsCipher: 'string', - dtlsRole: 'string', - srtpCipher: 'string', - selectedCandidatePairChanges: 'number', - iceRole: 'string', - iceLocalUsernameFragment: 'string', - iceState: 'string', -}); -addRTCStatsToAllowlist(Presence.MANDATORY, 'transport', kRTCTransportStats); - -/* - * RTCIceCandidateStats - * https://w3c.github.io/webrtc-stats/#icecandidate-dict* - * @private - */ -let kRTCIceCandidateStats = new RTCStats(null, { - transportId: 'string', - isRemote: 'boolean', - networkType: 'string', - ip: 'string', - address: 'string', - port: 'number', - protocol: 'string', - relayProtocol: 'string', - candidateType: 'string', - priority: 'number', - url: 'string', - deleted: 'boolean', - foundation: 'string', - relatedAddress: 'string', - relatedPort: 'number', - usernameFragment: 'string', - tcpType: 'string', -}); -addRTCStatsToAllowlist( - Presence.MANDATORY, 'local-candidate', kRTCIceCandidateStats); -addRTCStatsToAllowlist( - Presence.MANDATORY, 'remote-candidate', kRTCIceCandidateStats); - -/* - * RTCIceCandidatePairStats - * https://w3c.github.io/webrtc-stats/#candidatepair-dict* - * @private - */ -let kRTCIceCandidatePairStats = new RTCStats(null, { - transportId: 'string', - localCandidateId: 'string', - remoteCandidateId: 'string', - state: 'string', - priority: 'number', - nominated: 'boolean', - writable: 'boolean', - packetsSent: 'number', - packetsReceived: 'number', - bytesSent: 'number', - bytesReceived: 'number', - totalRoundTripTime: 'number', - currentRoundTripTime: 'number', - availableOutgoingBitrate: 'number', - availableIncomingBitrate: 'number', - requestsReceived: 'number', - requestsSent: 'number', - responsesReceived: 'number', - responsesSent: 'number', - consentRequestsSent: 'number', - packetsDiscardedOnSend: 'number', - bytesDiscardedOnSend: 'number', - lastPacketReceivedTimestamp: 'number', - lastPacketSentTimestamp: 'number', -}); -addRTCStatsToAllowlist( - Presence.MANDATORY, 'candidate-pair', kRTCIceCandidatePairStats); - -/* - * RTCCertificateStats - * https://w3c.github.io/webrtc-stats/#certificatestats-dict* - * @private - */ -let kRTCCertificateStats = new RTCStats(null, { - fingerprint: 'string', - fingerprintAlgorithm: 'string', - base64Certificate: 'string', - issuerCertificateId: 'string', -}); -addRTCStatsToAllowlist(Presence.MANDATORY, 'certificate', kRTCCertificateStats); - -/* - * RTCAudioPlayoutStats - * https://w3c.github.io/webrtc-stats/#playoutstats-dict* - * @private - */ -let kRTCAudioPlayoutStats = new RTCStats(null, { - kind: 'string', - synthesizedSamplesDuration: 'number', - synthesizedSamplesEvents: 'number', - totalSamplesDuration: 'number', - totalPlayoutDelay: 'number', - totalSamplesCount: 'number', -}); -addRTCStatsToAllowlist(Presence.OPTIONAL, 'media-playout', kRTCAudioPlayoutStats); // Public interface to tests. /** - * Verifies that the promise-based |RTCPeerConnection.getStats| returns stats, - * makes sure that all returned stats have the base RTCStats-members and that - * all stats are allowed by the allowlist. - * - * Returns "ok-" followed by JSON-stringified array of "RTCStats.type" values - * to the test, these being the different types of stats that was returned by - * this call to getStats. - */ -function verifyStatsGeneratedPromise() { - return peerConnection_().getStats() - .then(function(report) { - if (report == null || report.size == 0) - throw new Error('report is null or empty.'); - let statsTypes = new Set(); - let ids = new Set(); - for (let stats of report.values()) { - verifyStatsIsAllowlisted_(stats); - statsTypes.add(stats.type); - if (ids.has(stats.id)) - throw new Error('stats.id is not a unique identifier.'); - ids.add(stats.id); - } - return logAndReturn('ok-' + JSON.stringify( - Array.from(statsTypes.values()))); - }, - function(e) { - throw new Error('Promise was rejected: ' + e); - }); -} - -/** * Gets the result of the promise-based |RTCPeerConnection.getStats| as a * dictionary of RTCStats-dictionaries. * @@ -581,21 +43,6 @@ return peerConnection_().getStats() .then(function(report) { let t1 = performance.now(); - for (let stats of report.values()) { - verifyStatsIsAllowlisted_(stats); - } - for (let mandatoryType of mandatoryStatsTypes()) { - let mandatoryTypeExists = false; - for (let stats of report.values()) { - if (stats.type == mandatoryType) { - mandatoryTypeExists = true; - break; - } - } - if (!mandatoryTypeExists) { - return logAndReturn('Missing mandatory type: ' + mandatoryType); - } - } return logAndReturn('ok-' + (t1 - t0)); }, function(e) { @@ -603,14 +50,6 @@ }); } -/** - * Returns a complete list of mandatory "RTCStats.type" values from the - * allowlist as a JSON-stringified array of strings to the test. - */ -function getMandatoryStatsTypes() { - return logAndReturn(JSON.stringify(Array.from(mandatoryStatsTypes()))); -} - // Internals. /** Gets a set of all mandatory stats types. */
diff --git a/chrome/test/data/webui/app_settings/test_app_management_browser_proxy.ts b/chrome/test/data/webui/app_settings/test_app_management_browser_proxy.ts index 8cb9ff5..a34fd98 100644 --- a/chrome/test/data/webui/app_settings/test_app_management_browser_proxy.ts +++ b/chrome/test/data/webui/app_settings/test_app_management_browser_proxy.ts
@@ -29,6 +29,10 @@ return Promise.resolve({app: this.app_}); } + getSubAppToParentMap() { + return Promise.resolve({subAppToParentMap: {}}); + } + getExtensionAppPermissionMessages(_appId: string) { return Promise.resolve({messages: []}); }
diff --git a/chrome/test/data/webui/settings/chromeos/BUILD.gn b/chrome/test/data/webui/settings/chromeos/BUILD.gn index 2833a96..b45b92f 100644 --- a/chrome/test/data/webui/settings/chromeos/BUILD.gn +++ b/chrome/test/data/webui/settings/chromeos/BUILD.gn
@@ -44,7 +44,6 @@ "fake_system_display.js", "fake_user_action_recorder.js", "fake_users_private.js", - "hotspot_config_dialog_tests.js", "hotspot_subpage_tests.js", "input_page_test.js", "internet_config_test.js", @@ -159,6 +158,7 @@ "guest_os/test_guest_os_browser_proxy.ts", "internet_page/cellular_setup_dialog_test.ts", + "internet_page/hotspot_config_dialog_test.ts", "internet_page/hotspot_summary_item_test.ts", "internet_page/internet_detail_subpage_tests.js", "internet_page/network_summary_item_test.ts",
diff --git a/chrome/test/data/webui/settings/chromeos/app_management/fake_page_handler.ts b/chrome/test/data/webui/settings/chromeos/app_management/fake_page_handler.ts index d6fa209..6f8639df 100644 --- a/chrome/test/data/webui/settings/chromeos/app_management/fake_page_handler.ts +++ b/chrome/test/data/webui/settings/chromeos/app_management/fake_page_handler.ts
@@ -171,6 +171,11 @@ assertNotReached(); } + async getSubAppToParentMap(): + Promise<{subAppToParentMap: {[key: string]: string}}> { + return {subAppToParentMap: {}}; + } + async getExtensionAppPermissionMessages(_appId: string): Promise<{messages: ExtensionAppPermissionMessage[]}> { return {messages: []};
diff --git a/chrome/test/data/webui/settings/chromeos/app_management/pwa_detail_view_test.js b/chrome/test/data/webui/settings/chromeos/app_management/pwa_detail_view_test.js index 983faf36..9d52c2a 100644 --- a/chrome/test/data/webui/settings/chromeos/app_management/pwa_detail_view_test.js +++ b/chrome/test/data/webui/settings/chromeos/app_management/pwa_detail_view_test.js
@@ -4,20 +4,20 @@ 'use strict'; -import {AppManagementStore, updateSelectedAppId} from 'chrome://os-settings/os_settings.js'; +import {AppManagementStore, updateSelectedAppId, updateSubAppToParentAppId} from 'chrome://os-settings/os_settings.js'; import {convertOptionalBoolToBool, getPermissionValueBool} from 'chrome://resources/cr_components/app_management/util.js'; import {setupFakeHandler, replaceStore, replaceBody, getPermissionCrToggleByType, getPermissionToggleByType} from './test_util.js'; suite('<app-management-pwa-detail-view>', function() { - let pwaPermissionView; + let pwaDetailView; let fakeHandler; function getPermissionBoolByType(permissionType) { - return getPermissionValueBool(pwaPermissionView.app_, permissionType); + return getPermissionValueBool(pwaDetailView.app_, permissionType); } async function clickToggle(permissionType) { - getPermissionToggleByType(pwaPermissionView, permissionType).click(); + getPermissionToggleByType(pwaDetailView, permissionType).click(); await fakeHandler.flushPipesForTesting(); } @@ -34,34 +34,33 @@ const app = await fakeHandler.addApp(); AppManagementStore.getInstance().dispatch(updateSelectedAppId(app.id)); - pwaPermissionView = - document.createElement('app-management-pwa-detail-view'); - replaceBody(pwaPermissionView); + pwaDetailView = document.createElement('app-management-pwa-detail-view'); + replaceBody(pwaDetailView); }); test('App is rendered correctly', function() { assertEquals( AppManagementStore.getInstance().data.selectedAppId, - pwaPermissionView.app_.id); + pwaDetailView.app_.id); }); test('toggle permissions', async function() { const checkToggle = async (permissionType) => { assertTrue(getPermissionBoolByType(permissionType)); - assertTrue(getPermissionCrToggleByType(pwaPermissionView, permissionType) - .checked); + assertTrue( + getPermissionCrToggleByType(pwaDetailView, permissionType).checked); // Toggle off. await clickToggle(permissionType); assertFalse(getPermissionBoolByType(permissionType)); - assertFalse(getPermissionCrToggleByType(pwaPermissionView, permissionType) - .checked); + assertFalse( + getPermissionCrToggleByType(pwaDetailView, permissionType).checked); // Toggle on. await clickToggle(permissionType); assertTrue(getPermissionBoolByType(permissionType)); - assertTrue(getPermissionCrToggleByType(pwaPermissionView, permissionType) - .checked); + assertTrue( + getPermissionCrToggleByType(pwaDetailView, permissionType).checked); }; await checkToggle('kNotifications'); @@ -71,7 +70,7 @@ }); test('Pin to shelf toggle', async function() { - const pinToShelfItem = pwaPermissionView.$.pinToShelfSetting; + const pinToShelfItem = pwaDetailView.$.pinToShelfSetting; const toggle = pinToShelfItem.$.toggleRow.$.toggle; assertFalse(toggle.checked); @@ -91,4 +90,39 @@ toggle.checked, convertOptionalBoolToBool(getSelectedAppFromStore().isPinned)); }); + + test('Show sub apps correctly', async function() { + const sub1 = await fakeHandler.addApp(); + const sub2 = await fakeHandler.addApp(); + const parent = await fakeHandler.addApp(); + AppManagementStore.getInstance().dispatch( + updateSubAppToParentAppId(sub1.id, parent.id)); + AppManagementStore.getInstance().dispatch( + updateSubAppToParentAppId(sub2.id, parent.id)); + + await fakeHandler.flushPipesForTesting(); + + const subAppsItem = pwaDetailView.$.subAppsItem; + + // Default app is shown, has neither parents nor sub apps. + assertEquals( + subAppsItem.subApps.length, 0, 'list of sub apps is not empty'); + assertTrue(subAppsItem.hidden, 'list of sub apps should be hidden'); + + // Parent app with two sub apps gets selected. + AppManagementStore.getInstance().dispatch(updateSelectedAppId(parent.id)); + await fakeHandler.flushPipesForTesting(); + + assertEquals( + subAppsItem.subApps.length, 2, 'list of sub apps should show two apps'); + assertFalse(subAppsItem.hidden, 'list of sub apps should not be hidden'); + + // Select a sub app, has one parent and no sub apps of its own. + AppManagementStore.getInstance().dispatch(updateSelectedAppId(sub1.id)); + await fakeHandler.flushPipesForTesting(); + + assertEquals( + subAppsItem.subApps.length, 0, 'list of sub apps is not empty'); + assertTrue(subAppsItem.hidden, 'list of sub apps should be hidden'); + }); });
diff --git a/chrome/test/data/webui/settings/chromeos/hotspot_config_dialog_tests.js b/chrome/test/data/webui/settings/chromeos/hotspot_config_dialog_tests.js deleted file mode 100644 index 7e7e3e0..0000000 --- a/chrome/test/data/webui/settings/chromeos/hotspot_config_dialog_tests.js +++ /dev/null
@@ -1,283 +0,0 @@ -// Copyright 2023 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -import {Router, routes} from 'chrome://os-settings/os_settings.js'; -import {setHotspotConfigForTesting} from 'chrome://resources/ash/common/hotspot/cros_hotspot_config.js'; -import {HotspotAllowStatus, HotspotState, SetHotspotConfigResult, WiFiBand, WiFiSecurityMode} from 'chrome://resources/ash/common/hotspot/cros_hotspot_config.mojom-webui.js'; -import {FakeHotspotConfig} from 'chrome://resources/ash/common/hotspot/fake_hotspot_config.js'; -import {flush} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; -import {assertEquals, assertFalse, assertTrue} from 'chrome://webui-test/chai_assert.js'; -import {eventToPromise} from 'chrome://webui-test/test_util.js'; - -suite('HotspotConfigDialog', function() { - /** @type {?HotspotConfigDialogElement} */ - let hotspotConfigDialog = null; - - /** @type {?CrosHotspotConfigInterface} */ - let hotspotConfig = null; - - /** - * Security types for Hotspot Wi-Fi. - * @enum {string} - */ - const WiFiSecurityType = { - WPA2: 'WPA2', - WPA3: 'WPA3', - WPA2WPA3: 'WPA2WPA3', - }; - - suiteSetup(function() { - hotspotConfig = new FakeHotspotConfig(); - setHotspotConfigForTesting(hotspotConfig); - }); - - teardown(function() { - PolymerTest.clearBody(); - hotspotConfig.reset(); - hotspotConfigDialog.remove(); - hotspotConfigDialog = null; - Router.getInstance().resetRouteForTesting(); - }); - - async function init() { - PolymerTest.clearBody(); - const hotspotInfo = { - state: HotspotState.kDisabled, - allowStatus: HotspotAllowStatus.kAllowed, - allowedWifiSecurityModes: [ - WiFiSecurityMode.kWpa2, - WiFiSecurityMode.kWpa3, - WiFiSecurityMode.kWpa2Wpa3, - ], - config: { - autoDisable: true, - security: WiFiSecurityMode.kWpa2, - ssid: 'test_ssid', - passphrase: 'test_passphrase', - band: WiFiBand.kAutoChoose, - bssidRandomization: true, - }, - }; - hotspotConfigDialog = document.createElement('hotspot-config-dialog'); - hotspotConfig.setFakeHotspotInfo(hotspotInfo); - const response = await hotspotConfig.getHotspotInfo(); - hotspotConfigDialog.hotspotInfo = response.hotspotInfo; - document.body.appendChild(hotspotConfigDialog); - Router.getInstance().navigateTo(routes.HOTSPOT_DETAIL); - await flushAsync(); - } - - function flushAsync() { - flush(); - // Use setTimeout to wait for the next macrotask. - return new Promise(resolve => setTimeout(resolve)); - } - - test('Name input should show and update hotspot SSID', async function() { - await init(); - - const hotspotNameInput = - hotspotConfigDialog.shadowRoot.querySelector('#hotspotName'); - assertTrue(!!hotspotNameInput, 'Hotspot name input doesn\'t exist'); - assertEquals('test_ssid', hotspotNameInput.value); - hotspotNameInput.value = 'new_ssid'; - - const saveBtn = hotspotConfigDialog.shadowRoot.querySelector('#saveButton'); - const cancelBtn = - hotspotConfigDialog.shadowRoot.querySelector('#cancelButton'); - assertFalse(saveBtn.disabled); - assertFalse(cancelBtn.disabled); - - hotspotConfig.setFakeSetHotspotConfigResult( - SetHotspotConfigResult.kSuccess); - saveBtn.click(); - await flushAsync(); - - const response = await hotspotConfig.getHotspotInfo(); - assertEquals('new_ssid', response.hotspotInfo.config.ssid); - }); - - test('Password validation and update hotspot password', async function() { - await init(); - - const hotspotPasswordInput = - hotspotConfigDialog.shadowRoot.querySelector('#hotspotPassword'); - assertTrue(!!hotspotPasswordInput, 'Hotspot password input doesn\'t exist'); - assertEquals('test_passphrase', hotspotPasswordInput.value); - - const saveBtn = hotspotConfigDialog.shadowRoot.querySelector('#saveButton'); - const cancelBtn = - hotspotConfigDialog.shadowRoot.querySelector('#cancelButton'); - - // Verifies that password has to be at least 8 chars long. - hotspotPasswordInput.value = 'short'; - assertTrue(hotspotPasswordInput.invalid); - assertTrue(saveBtn.disabled); - assertFalse(cancelBtn.disabled); - - hotspotPasswordInput.value = 'validlong_password'; - assertFalse(hotspotPasswordInput.invalid); - assertFalse(saveBtn.disabled); - assertFalse(cancelBtn.disabled); - - hotspotConfig.setFakeSetHotspotConfigResult( - SetHotspotConfigResult.kSuccess); - saveBtn.click(); - await flushAsync(); - - const response = await hotspotConfig.getHotspotInfo(); - assertEquals('validlong_password', response.hotspotInfo.config.passphrase); - }); - - test( - 'Security select should show and update hotspot security', - async function() { - await init(); - - const hotspotSecuritySelect = - hotspotConfigDialog.shadowRoot.querySelector('#security'); - assertTrue( - !!hotspotSecuritySelect, 'Hotspot security select doesn\'t exist'); - - assertEquals(WiFiSecurityType.WPA2, hotspotSecuritySelect.value); - assertEquals(3, hotspotSecuritySelect.items.length); - assertEquals(WiFiSecurityType.WPA2, hotspotSecuritySelect.items[0]); - assertEquals(WiFiSecurityType.WPA3, hotspotSecuritySelect.items[1]); - assertEquals(WiFiSecurityType.WPA2WPA3, hotspotSecuritySelect.items[2]); - hotspotSecuritySelect.value = WiFiSecurityType.WPA3; - - const saveBtn = - hotspotConfigDialog.shadowRoot.querySelector('#saveButton'); - const cancelBtn = - hotspotConfigDialog.shadowRoot.querySelector('#cancelButton'); - assertFalse(saveBtn.disabled); - assertFalse(cancelBtn.disabled); - - hotspotConfig.setFakeSetHotspotConfigResult( - SetHotspotConfigResult.kSuccess); - saveBtn.click(); - await flushAsync(); - - const response = await hotspotConfig.getHotspotInfo(); - assertEquals( - WiFiSecurityMode.kWpa3, response.hotspotInfo.config.security); - }); - - test( - 'Hotspot bssid randomization toggle should show and update bssid ' + - 'randomization', - async function() { - await init(); - - const hotspotBssidToggle = - hotspotConfigDialog.shadowRoot.querySelector('#hotspotBssidToggle'); - assertTrue( - !!hotspotBssidToggle, - 'Hotspot Bssid randomization toggle doesn\'t exist'); - assertTrue(hotspotBssidToggle.checked); - - hotspotBssidToggle.click(); - assertFalse(hotspotBssidToggle.checked); - - const saveBtn = - hotspotConfigDialog.shadowRoot.querySelector('#saveButton'); - const cancelBtn = - hotspotConfigDialog.shadowRoot.querySelector('#cancelButton'); - assertFalse(saveBtn.disabled); - assertFalse(cancelBtn.disabled); - - hotspotConfig.setFakeSetHotspotConfigResult( - SetHotspotConfigResult.kSuccess); - saveBtn.click(); - await flushAsync(); - - const response = await hotspotConfig.getHotspotInfo(); - assertFalse(response.hotspotInfo.config.bssidRandomization); - }); - - test( - 'Hotspot extend compatibility toggle should show and update ' + - 'compatibility', - async function() { - await init(); - - const hotspotCompatibilityToggle = - hotspotConfigDialog.shadowRoot.querySelector( - '#hotspotCompatibilityToggle'); - assertTrue( - !!hotspotCompatibilityToggle, - 'Hotspot extend compatibility toggle doesn\'t exist'); - assertFalse(hotspotCompatibilityToggle.checked); - - hotspotCompatibilityToggle.click(); - assertTrue(hotspotCompatibilityToggle.checked); - - const saveBtn = - hotspotConfigDialog.shadowRoot.querySelector('#saveButton'); - const cancelBtn = - hotspotConfigDialog.shadowRoot.querySelector('#cancelButton'); - assertFalse(saveBtn.disabled); - assertFalse(cancelBtn.disabled); - - hotspotConfig.setFakeSetHotspotConfigResult( - SetHotspotConfigResult.kSuccess); - saveBtn.click(); - await flushAsync(); - - const response = await hotspotConfig.getHotspotInfo(); - assertEquals(WiFiBand.k2_4GHz, response.hotspotInfo.config.band); - }); - - test( - 'When save config fails, it should show error message', async function() { - await init(); - - const hotspotNameInput = - hotspotConfigDialog.shadowRoot.querySelector('#hotspotName'); - assertTrue(!!hotspotNameInput, 'Hotspot name input doesn\'t exist'); - assertEquals('test_ssid', hotspotNameInput.value); - hotspotNameInput.value = 'new_ssid'; - - const saveBtn = - hotspotConfigDialog.shadowRoot.querySelector('#saveButton'); - const cancelBtn = - hotspotConfigDialog.shadowRoot.querySelector('#cancelButton'); - let errorMessageElement = - hotspotConfigDialog.shadowRoot.querySelector('#errorMessage'); - assertFalse(saveBtn.disabled); - assertFalse(cancelBtn.disabled); - assertEquals(null, errorMessageElement); - - hotspotConfig.setFakeSetHotspotConfigResult( - SetHotspotConfigResult.kFailedInvalidConfiguration); - saveBtn.click(); - await flushAsync(); - errorMessageElement = - hotspotConfigDialog.shadowRoot.querySelector('#errorMessage'); - assertTrue( - !!errorMessageElement, 'Hotspot error message doesn\'t show'); - assertEquals( - hotspotConfigDialog.i18n( - 'hotspotConfigInvalidConfigurationErrorMessage'), - errorMessageElement.textContent.trim()); - - hotspotConfig.setFakeSetHotspotConfigResult( - SetHotspotConfigResult.kFailedNotLogin); - saveBtn.click(); - await flushAsync(); - errorMessageElement = - hotspotConfigDialog.shadowRoot.querySelector('#errorMessage'); - assertTrue( - !!errorMessageElement, 'Hotspot error message doesn\'t show'); - assertEquals( - hotspotConfigDialog.i18n('hotspotConfigNotLoginErrorMessage'), - errorMessageElement.textContent.trim()); - - cancelBtn.click(); - await flushAsync(); - - const response = await hotspotConfig.getHotspotInfo(); - assertEquals('test_ssid', response.hotspotInfo.config.ssid); - }); -});
diff --git a/chrome/test/data/webui/settings/chromeos/internet_page/hotspot_config_dialog_test.ts b/chrome/test/data/webui/settings/chromeos/internet_page/hotspot_config_dialog_test.ts new file mode 100644 index 0000000..2502cc7 --- /dev/null +++ b/chrome/test/data/webui/settings/chromeos/internet_page/hotspot_config_dialog_test.ts
@@ -0,0 +1,302 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'chrome://os-settings/os_settings.js'; + +import {HotspotConfigDialogElement, Router, routes, WiFiSecurityType} from 'chrome://os-settings/os_settings.js'; +import {setHotspotConfigForTesting} from 'chrome://resources/ash/common/hotspot/cros_hotspot_config.js'; +import {HotspotAllowStatus, HotspotState, SetHotspotConfigResult, WiFiBand, WiFiSecurityMode} from 'chrome://resources/ash/common/hotspot/cros_hotspot_config.mojom-webui.js'; +import {FakeHotspotConfig} from 'chrome://resources/ash/common/hotspot/fake_hotspot_config.js'; +import {NetworkConfigSelectElement} from 'chrome://resources/ash/common/network/network_config_select.js'; +import {NetworkPasswordInputElement} from 'chrome://resources/ash/common/network/network_password_input.js'; +import {flush} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; +import {assertEquals, assertFalse, assertNull, assertTrue} from 'chrome://webui-test/chai_assert.js'; + +suite('<hotspot-config-dialog>', () => { + let hotspotConfigDialog: HotspotConfigDialogElement; + let hotspotConfig: FakeHotspotConfig; + + suiteSetup(() => { + hotspotConfig = new FakeHotspotConfig(); + setHotspotConfigForTesting(hotspotConfig); + }); + + teardown(() => { + hotspotConfig.reset(); + hotspotConfigDialog.remove(); + Router.getInstance().resetRouteForTesting(); + }); + + function flushAsync() { + flush(); + // Use setTimeout to wait for the next macrotask. + return new Promise(resolve => setTimeout(resolve)); + } + + async function init() { + const hotspotInfo = { + state: HotspotState.kDisabled, + allowStatus: HotspotAllowStatus.kAllowed, + allowedWifiSecurityModes: [ + WiFiSecurityMode.kWpa2, + WiFiSecurityMode.kWpa3, + WiFiSecurityMode.kWpa2Wpa3, + ], + config: { + autoDisable: true, + security: WiFiSecurityMode.kWpa2, + ssid: 'test_ssid', + passphrase: 'test_passphrase', + band: WiFiBand.kAutoChoose, + bssidRandomization: true, + }, + clientCount: 0, + }; + hotspotConfigDialog = document.createElement('hotspot-config-dialog'); + hotspotConfig.setFakeHotspotInfo(hotspotInfo); + const response = await hotspotConfig.getHotspotInfo(); + hotspotConfigDialog.hotspotInfo = response.hotspotInfo; + document.body.appendChild(hotspotConfigDialog); + Router.getInstance().navigateTo(routes.HOTSPOT_DETAIL); + await flushAsync(); + } + + test('Name input should show and update hotspot SSID', async () => { + await init(); + + const hotspotNameInput = + hotspotConfigDialog.shadowRoot!.querySelector<HTMLInputElement>( + '#hotspotName'); + assertTrue(!!hotspotNameInput, 'Hotspot name input doesn\'t exist'); + assertEquals('test_ssid', hotspotNameInput.value); + hotspotNameInput.value = 'new_ssid'; + + const saveBtn = + hotspotConfigDialog.shadowRoot!.querySelector<HTMLButtonElement>( + '#saveButton'); + assertTrue(!!saveBtn); + const cancelBtn = + hotspotConfigDialog.shadowRoot!.querySelector<HTMLButtonElement>( + '#cancelButton'); + assertTrue(!!cancelBtn); + assertFalse(saveBtn.disabled); + assertFalse(cancelBtn.disabled); + + hotspotConfig.setFakeSetHotspotConfigResult( + SetHotspotConfigResult.kSuccess); + saveBtn.click(); + await flushAsync(); + + const response = await hotspotConfig.getHotspotInfo(); + assertTrue(!!response.hotspotInfo.config); + assertEquals('new_ssid', response.hotspotInfo.config.ssid); + }); + + test('Password validation and update hotspot password', async () => { + await init(); + + const hotspotPasswordInput = + hotspotConfigDialog.shadowRoot! + .querySelector<NetworkPasswordInputElement>('#hotspotPassword'); + assertTrue(!!hotspotPasswordInput, 'Hotspot password input doesn\'t exist'); + assertEquals('test_passphrase', hotspotPasswordInput.value); + + const saveBtn = + hotspotConfigDialog.shadowRoot!.querySelector<HTMLButtonElement>( + '#saveButton'); + assertTrue(!!saveBtn); + const cancelBtn = + hotspotConfigDialog.shadowRoot!.querySelector<HTMLButtonElement>( + '#cancelButton'); + assertTrue(!!cancelBtn); + + // Verifies that password has to be at least 8 chars long. + hotspotPasswordInput.value = 'short'; + assertTrue(hotspotPasswordInput.invalid); + assertTrue(saveBtn.disabled); + assertFalse(cancelBtn.disabled); + + hotspotPasswordInput.value = 'validlong_password'; + assertFalse(hotspotPasswordInput.invalid); + assertFalse(saveBtn.disabled); + assertFalse(cancelBtn.disabled); + + hotspotConfig.setFakeSetHotspotConfigResult( + SetHotspotConfigResult.kSuccess); + saveBtn.click(); + await flushAsync(); + + const response = await hotspotConfig.getHotspotInfo(); + assertTrue(!!response.hotspotInfo.config); + assertEquals('validlong_password', response.hotspotInfo.config.passphrase); + }); + + test('Security select should show and update hotspot security', async () => { + await init(); + + const hotspotSecuritySelect = + hotspotConfigDialog.shadowRoot! + .querySelector<NetworkConfigSelectElement>('#security'); + assertTrue( + !!hotspotSecuritySelect, 'Hotspot security select doesn\'t exist'); + + assertEquals(WiFiSecurityType.WPA2, hotspotSecuritySelect.value); + assertEquals(3, hotspotSecuritySelect.items.length); + assertEquals(WiFiSecurityType.WPA2, hotspotSecuritySelect.items[0]); + assertEquals(WiFiSecurityType.WPA3, hotspotSecuritySelect.items[1]); + assertEquals(WiFiSecurityType.WPA2WPA3, hotspotSecuritySelect.items[2]); + hotspotSecuritySelect.value = WiFiSecurityType.WPA3; + + const saveBtn = + hotspotConfigDialog.shadowRoot!.querySelector<HTMLButtonElement>( + '#saveButton'); + assertTrue(!!saveBtn); + const cancelBtn = + hotspotConfigDialog.shadowRoot!.querySelector<HTMLButtonElement>( + '#cancelButton'); + assertTrue(!!cancelBtn); + assertFalse(saveBtn.disabled); + assertFalse(cancelBtn.disabled); + + hotspotConfig.setFakeSetHotspotConfigResult( + SetHotspotConfigResult.kSuccess); + saveBtn.click(); + await flushAsync(); + + const response = await hotspotConfig.getHotspotInfo(); + assertTrue(!!response.hotspotInfo.config); + assertEquals(WiFiSecurityMode.kWpa3, response.hotspotInfo.config.security); + }); + + test( + 'Hotspot bssid randomization toggle should show and update bssid ' + + 'randomization', + async () => { + await init(); + + const hotspotBssidToggle = + hotspotConfigDialog.shadowRoot!.querySelector<HTMLInputElement>( + '#hotspotBssidToggle'); + assertTrue( + !!hotspotBssidToggle, + 'Hotspot Bssid randomization toggle doesn\'t exist'); + assertTrue(hotspotBssidToggle.checked); + + hotspotBssidToggle.click(); + assertFalse(hotspotBssidToggle.checked); + + const saveBtn = + hotspotConfigDialog.shadowRoot!.querySelector<HTMLButtonElement>( + '#saveButton'); + assertTrue(!!saveBtn); + const cancelBtn = + hotspotConfigDialog.shadowRoot!.querySelector<HTMLButtonElement>( + '#cancelButton'); + assertTrue(!!cancelBtn); + assertFalse(saveBtn.disabled); + assertFalse(cancelBtn.disabled); + + hotspotConfig.setFakeSetHotspotConfigResult( + SetHotspotConfigResult.kSuccess); + saveBtn.click(); + await flushAsync(); + + const response = await hotspotConfig.getHotspotInfo(); + assertTrue(!!response.hotspotInfo.config); + assertFalse(response.hotspotInfo.config.bssidRandomization); + }); + + test( + 'Hotspot extend compatibility toggle should show and update ' + + 'compatibility', + async () => { + await init(); + + const hotspotCompatibilityToggle = + hotspotConfigDialog.shadowRoot!.querySelector<HTMLInputElement>( + '#hotspotCompatibilityToggle'); + assertTrue( + !!hotspotCompatibilityToggle, + 'Hotspot extend compatibility toggle doesn\'t exist'); + assertFalse(hotspotCompatibilityToggle.checked); + + hotspotCompatibilityToggle.click(); + assertTrue(hotspotCompatibilityToggle.checked); + + const saveBtn = + hotspotConfigDialog.shadowRoot!.querySelector<HTMLButtonElement>( + '#saveButton'); + assertTrue(!!saveBtn); + const cancelBtn = + hotspotConfigDialog.shadowRoot!.querySelector<HTMLButtonElement>( + '#cancelButton'); + assertTrue(!!cancelBtn); + assertFalse(saveBtn.disabled); + assertFalse(cancelBtn.disabled); + + hotspotConfig.setFakeSetHotspotConfigResult( + SetHotspotConfigResult.kSuccess); + saveBtn.click(); + await flushAsync(); + + const response = await hotspotConfig.getHotspotInfo(); + assertTrue(!!response.hotspotInfo.config); + assertEquals(WiFiBand.k2_4GHz, response.hotspotInfo.config.band); + }); + + test('When save config fails, it should show error message', async () => { + await init(); + + const hotspotNameInput = + hotspotConfigDialog.shadowRoot!.querySelector<HTMLInputElement>( + '#hotspotName'); + assertTrue(!!hotspotNameInput, 'Hotspot name input doesn\'t exist'); + assertEquals('test_ssid', hotspotNameInput.value); + hotspotNameInput.value = 'new_ssid'; + + const saveBtn = + hotspotConfigDialog.shadowRoot!.querySelector<HTMLButtonElement>( + '#saveButton'); + assertTrue(!!saveBtn); + const cancelBtn = + hotspotConfigDialog.shadowRoot!.querySelector<HTMLButtonElement>( + '#cancelButton'); + assertTrue(!!cancelBtn); + let errorMessageElement = + hotspotConfigDialog.shadowRoot!.querySelector('#errorMessage'); + assertFalse(saveBtn.disabled); + assertFalse(cancelBtn.disabled); + assertNull(errorMessageElement); + + hotspotConfig.setFakeSetHotspotConfigResult( + SetHotspotConfigResult.kFailedInvalidConfiguration); + saveBtn.click(); + await flushAsync(); + errorMessageElement = + hotspotConfigDialog.shadowRoot!.querySelector('#errorMessage'); + assertTrue(!!errorMessageElement, 'Hotspot error message doesn\'t show'); + assertEquals( + hotspotConfigDialog.i18n( + 'hotspotConfigInvalidConfigurationErrorMessage'), + errorMessageElement.textContent!.trim()); + + hotspotConfig.setFakeSetHotspotConfigResult( + SetHotspotConfigResult.kFailedNotLogin); + saveBtn.click(); + await flushAsync(); + errorMessageElement = + hotspotConfigDialog.shadowRoot!.querySelector('#errorMessage'); + assertTrue(!!errorMessageElement, 'Hotspot error message doesn\'t show'); + assertEquals( + hotspotConfigDialog.i18n('hotspotConfigNotLoginErrorMessage'), + errorMessageElement.textContent!.trim()); + + cancelBtn.click(); + await flushAsync(); + + const response = await hotspotConfig.getHotspotInfo(); + assertTrue(!!response.hotspotInfo.config); + assertEquals('test_ssid', response.hotspotInfo.config.ssid); + }); +});
diff --git a/chrome/test/data/webui/settings/chromeos/os_settings_browsertest.js b/chrome/test/data/webui/settings/chromeos/os_settings_browsertest.js index fb39561a..2c70e01 100644 --- a/chrome/test/data/webui/settings/chromeos/os_settings_browsertest.js +++ b/chrome/test/data/webui/settings/chromeos/os_settings_browsertest.js
@@ -312,11 +312,6 @@ ['GuestOsSharedPaths', 'guest_os/guest_os_shared_paths_test.js'], ['GuestOsSharedUsbDevices', 'guest_os/guest_os_shared_usb_devices_test.js'], [ - 'HotspotConfigDialog', - 'hotspot_config_dialog_tests.js', - {enabled: ['ash::features::kHotspot']}, - ], - [ 'HotspotSubpage', 'hotspot_subpage_tests.js', {enabled: ['ash::features::kHotspot']}, @@ -345,6 +340,11 @@ 'internet_page/cellular_setup_dialog_test.js' ], [ + 'InternetPageHotspotConfigDialog', + 'internet_page/hotspot_config_dialog_test.js', + {enabled: ['ash::features::kHotspot']}, + ], + [ 'InternetPageHotspotSummaryItem', 'internet_page/hotspot_summary_item_test.js', {enabled: ['ash::features::kHotspot']},
diff --git a/chromecast/cast_core/runtime/browser/core_streaming_config_manager.cc b/chromecast/cast_core/runtime/browser/core_streaming_config_manager.cc index 8fbdadb..815b1e6 100644 --- a/chromecast/cast_core/runtime/browser/core_streaming_config_manager.cc +++ b/chromecast/cast_core/runtime/browser/core_streaming_config_manager.cc
@@ -190,6 +190,8 @@ : CoreStreamingConfigManager(std::move(error_cb)) { std::unique_ptr<cast_api_bindings::MessagePort> server; cast_api_bindings::CreatePlatformMessagePortPair(&message_port_, &server); + message_port_->SetReceiver(this); + message_port_service.ConnectToPortAsync(kMediaCapabilitiesBindingName, std::move(server)); }
diff --git a/chromeos/ash/components/drivefs/drivefs_host.cc b/chromeos/ash/components/drivefs/drivefs_host.cc index 2bdbd5fa..6ed59da 100644 --- a/chromeos/ash/components/drivefs/drivefs_host.cc +++ b/chromeos/ash/components/drivefs/drivefs_host.cc
@@ -76,7 +76,7 @@ host_->delegate_->GetURLLoaderFactory()); } - if (base::FeatureList::IsEnabled(ash::features::kFilesInlineSyncStatus)) { + if (ash::features::IsInlineSyncStatusOldEventsEnabled()) { sync_throttle_timer_ = std::make_unique<base::RetainingOneShotTimer>( FROM_HERE, kIndividualSyncStatusIntervalMs, base::BindRepeating( @@ -90,7 +90,7 @@ ~MountState() override { DCHECK_CALLED_ON_VALID_SEQUENCE(host_->sequence_checker_); - if (base::FeatureList::IsEnabled(ash::features::kFilesInlineSyncStatus)) { + if (ash::features::IsInlineSyncStatusOldEventsEnabled()) { sync_throttle_timer_->Stop(); } if (team_drives_fetched_) { @@ -150,7 +150,7 @@ void DispatchBatchIndividualSyncEvents() { DCHECK_CALLED_ON_VALID_SEQUENCE(host_->sequence_checker_); - if (!base::FeatureList::IsEnabled(ash::features::kFilesInlineSyncStatus)) { + if (!ash::features::IsInlineSyncStatusOldEventsEnabled()) { return; } @@ -181,10 +181,16 @@ } } + void OnItemProgress(const mojom::ProgressEventPtr progress_event) override { + for (auto& observer : host_->observers_) { + observer.OnItemProgress(*progress_event); + } + } + void OnSyncingStatusUpdate(mojom::SyncingStatusPtr status) override { DCHECK_CALLED_ON_VALID_SEQUENCE(host_->sequence_checker_); - if (base::FeatureList::IsEnabled(ash::features::kFilesInlineSyncStatus)) { + if (ash::features::IsInlineSyncStatusOldEventsEnabled()) { ResetThrottleTimer(); // Keep track of the syncing paths. @@ -242,7 +248,7 @@ // Reset the timer if it has finished. This will cause individual syncing // status events to be dispatched as soon as the timer finishes again. void ResetThrottleTimer() { - if (base::FeatureList::IsEnabled(ash::features::kFilesInlineSyncStatus) && + if (ash::features::IsInlineSyncStatusOldEventsEnabled() && !sync_throttle_timer_->IsRunning()) { sync_throttle_timer_->Reset(); } @@ -269,7 +275,7 @@ // Verify if we have a valid stable_id. It could be invalid because the // DriveFs version that reports stable_id for DriveErrors hasn't been // uprreved into ChromeOS yet, but it could be due to some actual error. - if (base::FeatureList::IsEnabled(ash::features::kFilesInlineSyncStatus) && + if (ash::features::IsInlineSyncStatusOldEventsEnabled() && error->stable_id > 0) { base::FilePath path = host_->GetMountPath(); if (base::FilePath("/").AppendRelativePath(base::FilePath(error->path),
diff --git a/chromeos/ash/components/drivefs/drivefs_host.h b/chromeos/ash/components/drivefs/drivefs_host.h index 4b3f9267..5f5372e 100644 --- a/chromeos/ash/components/drivefs/drivefs_host.h +++ b/chromeos/ash/components/drivefs/drivefs_host.h
@@ -26,11 +26,9 @@ #include "mojo/public/cpp/bindings/pending_receiver.h" #include "mojo/public/cpp/bindings/pending_remote.h" -namespace ash { -namespace disks { +namespace ash::disks { class DiskMountManager; -} // namespace disks -} // namespace ash +} // namespace ash::disks namespace drive { class DriveNotificationManager;
diff --git a/chromeos/ash/components/drivefs/drivefs_host_observer.h b/chromeos/ash/components/drivefs/drivefs_host_observer.h index d7f015b..5a5b0d5 100644 --- a/chromeos/ash/components/drivefs/drivefs_host_observer.h +++ b/chromeos/ash/components/drivefs/drivefs_host_observer.h
@@ -11,6 +11,7 @@ namespace mojom { class DriveError; class FileChange; +class ProgressEvent; class SyncingStatus; } // namespace mojom @@ -26,6 +27,7 @@ } virtual void OnFilesChanged(const std::vector<mojom::FileChange>& changes) {} virtual void OnError(const mojom::DriveError& error) {} + virtual void OnItemProgress(const mojom::ProgressEvent& event) {} protected: virtual ~DriveFsHostObserver() = default;
diff --git a/chromeos/ash/components/drivefs/drivefs_host_unittest.cc b/chromeos/ash/components/drivefs/drivefs_host_unittest.cc index 2c191fa..9a47fc7 100644 --- a/chromeos/ash/components/drivefs/drivefs_host_unittest.cc +++ b/chromeos/ash/components/drivefs/drivefs_host_unittest.cc
@@ -225,6 +225,7 @@ OnFilesChanged, (const std::vector<mojom::FileChange>& changes)); MOCK_METHOD(void, OnError, (const mojom::DriveError& error)); + MOCK_METHOD(void, OnItemProgress, (const mojom::ProgressEvent& event)); }; class DriveFsHostTest : public ::testing::Test, public mojom::DriveFsBootstrap {
diff --git a/chromeos/ash/components/drivefs/drivefs_session_unittest.cc b/chromeos/ash/components/drivefs/drivefs_session_unittest.cc index be4afb6..c643f73f 100644 --- a/chromeos/ash/components/drivefs/drivefs_session_unittest.cc +++ b/chromeos/ash/components/drivefs/drivefs_session_unittest.cc
@@ -228,6 +228,7 @@ const std::vector<std::string>& scopes, GetAccessTokenCallback callback) override {} void OnSyncingStatusUpdate(mojom::SyncingStatusPtr status) override {} + void OnItemProgress(mojom::ProgressEventPtr item_progress) override {} void OnFilesChanged(std::vector<mojom::FileChangePtr> changes) override {} void OnError(mojom::DriveErrorPtr error) override {} void OnTeamDrivesListReady(
diff --git a/chromeos/ash/components/drivefs/mojom/drivefs.mojom b/chromeos/ash/components/drivefs/mojom/drivefs.mojom index 884fb71..0bd7190 100644 --- a/chromeos/ash/components/drivefs/mojom/drivefs.mojom +++ b/chromeos/ash/components/drivefs/mojom/drivefs.mojom
@@ -230,6 +230,14 @@ // Invoked when the syncing status changes for items that are being tracked by // the mirror stack. OnMirrorSyncingStatusUpdate(SyncingStatus status); + + // Invoked when the syncing status changes for items that are being tracked by + // either the streaming or the mirror stack - with the guarantee that if an + // event is dispatched for a given path, then a "completed" event will also + // eventually be dispatched for the same path (i.e., paths never linger in an + // incompleted state). + // For more details, see: b/269694669 + OnItemProgress(ProgressEvent progress_event); }; [Extensible] @@ -557,6 +565,22 @@ [MinVersion=2] bool is_download = false; }; +// A report of a change in the Sync Progress of a file or folder. +struct ProgressEvent { + // The stable ID used by DriveFS. + int64 stable_id; + + // Absolute path of the file or directory. + string path; + + // Progress given by signed byte, ranging from 0 to 100. + // * 0 progress is considered "queued"; + // * 100 progress is considered "completed"; + // * Anything in between is considered "in progress"; + // * Other values are not defined. + uint8 progress; +}; + struct SyncingStatus { array<ItemEvent> item_events; };
diff --git a/chromeos/crosapi/mojom/web_app_service.mojom b/chromeos/crosapi/mojom/web_app_service.mojom index f0317ef..cab6fbd 100644 --- a/chromeos/crosapi/mojom/web_app_service.mojom +++ b/chromeos/crosapi/mojom/web_app_service.mojom
@@ -30,8 +30,8 @@ // Implemented in lacros-chrome. Allows ash-chrome to modify web app state in // lacros-chrome. -// Next version: 5 -// Next method id: 6 +// Next version: 6 +// Next method id: 7 [Stable, Uuid="84eb46eb-76fe-439c-9fcb-3388492e141d"] interface WebAppProviderBridge { // Called when a web app described by |info| is installed in ARC (Android @@ -70,6 +70,12 @@ url.mojom.Url install_url, url.mojom.Url origin_url, bool is_renderer_initiated); + + // Returns all apps that have a parent app, and maps the apps' IDs to their + // parent app's ID. The key is the sub app's ID, the value is the parent app's + // ID. + [MinVersion=5] + GetSubAppToParentMap@6() => (map<string, string> parent_apps); }; // An interface implemented in ash-chrome. Allows lacros-chrome:
diff --git a/components/autofill/core/browser/data_model/autofill_structured_address_component.cc b/components/autofill/core/browser/data_model/autofill_structured_address_component.cc index 7410ec9b..5738e23 100644 --- a/components/autofill/core/browser/data_model/autofill_structured_address_component.cc +++ b/components/autofill/core/browser/data_model/autofill_structured_address_component.cc
@@ -502,10 +502,10 @@ bool AddressComponent::IsValueCompatibleWithAncestors( const std::u16string& value) const { - bool is_node_compatible = - GetValue().empty() || (GetValue().find(value) != std::string::npos); - return is_node_compatible && - (!parent_ || parent_->IsValueCompatibleWithAncestors(value)); + if (!GetValue().empty()) { + return AreStringTokenCompatible(value, GetValue()); + } + return (!parent_ || parent_->IsValueCompatibleWithAncestors(value)); } bool AddressComponent::IsStructureValid() const { @@ -518,7 +518,7 @@ // information in the components is contained in the unstructured // representation. return base::ranges::all_of(Subcomponents(), [this](const auto* c) { - return GetValue().find(c->GetValue()) != std::u16string::npos; + return AreStringTokenCompatible(c->GetValue(), GetValue()); }); }
diff --git a/components/autofill/core/browser/data_model/autofill_structured_address_component.h b/components/autofill/core/browser/data_model/autofill_structured_address_component.h index d55ddd9..29674c4c 100644 --- a/components/autofill/core/browser/data_model/autofill_structured_address_component.h +++ b/components/autofill/core/browser/data_model/autofill_structured_address_component.h
@@ -530,8 +530,8 @@ // of the subcomponents. Returns true on success and is allowed to fail. bool ParseValueAndAssignSubcomponentsByRegularExpressions(); - // This method verifies that the `value` is compatible with all the node's - // anestors. + // This method verifies that the `value` is token compatible with this node + // and all the node's ancestors. bool IsValueCompatibleWithAncestors(const std::u16string& value) const; // The unstructured value of this component.
diff --git a/components/autofill/core/browser/data_model/autofill_structured_address_component_unittest.cc b/components/autofill/core/browser/data_model/autofill_structured_address_component_unittest.cc index 57db1b2..2b1d802f 100644 --- a/components/autofill/core/browser/data_model/autofill_structured_address_component_unittest.cc +++ b/components/autofill/core/browser/data_model/autofill_structured_address_component_unittest.cc
@@ -1811,46 +1811,11 @@ } TEST(AutofillStructuredAddressAddressComponent, - IsValueCompatibleWithAncestorsNonCompatible) { - AddressNode address; - AddressComponentTestValues test_values = { - {.type = ADDRESS_HOME_STREET_ADDRESS, - .value = "Flat 42, Floor 7, Tagore Road Hostel, 13, Hitech City Rd", - .status = VerificationStatus::kObserved}, - {.type = ADDRESS_HOME_FLOOR, - .value = "Floor 7", - .status = VerificationStatus::kObserved}, - {.type = ADDRESS_HOME_APT_NUM, - .value = "Flat 42", - .status = VerificationStatus::kObserved}}; - - AddressComponentTestValues expectation = { - {.type = ADDRESS_HOME_STREET_ADDRESS, - .value = "Flat 42, Floor 7, Tagore Road Hostel, 13, Hitech City Rd", - .status = VerificationStatus::kObserved}, - // Note that subpremise can not be parsed into "Floor 7 Flat 42" as this - // would not be compatible with ADDRESS_HOME_STREET_ADDRESS. - {.type = ADDRESS_HOME_SUBPREMISE, - .value = "", - .status = VerificationStatus::kNoStatus}, - {.type = ADDRESS_HOME_FLOOR, - .value = "Floor 7", - .status = VerificationStatus::kObserved}, - {.type = ADDRESS_HOME_APT_NUM, - .value = "Flat 42", - .status = VerificationStatus::kObserved}}; - - SetTestValues(&address, test_values); - address.CompleteFullTree(); - VerifyTestValues(&address, expectation); -} - -TEST(AutofillStructuredAddressAddressComponent, IsValueCompatibleWithAncestorsCompatible) { AddressNode address; AddressComponentTestValues test_values = { {.type = ADDRESS_HOME_STREET_ADDRESS, - .value = "Floor 7 Flat 42, Tagore Road Hostel, 13, Hitech City Rd", + .value = "Flat 42, Floor 7, Tagore Road Hostel, 13, Hitech City Rd", .status = VerificationStatus::kObserved}, {.type = ADDRESS_HOME_FLOOR, .value = "Floor 7", @@ -1861,7 +1826,7 @@ AddressComponentTestValues expectation = { {.type = ADDRESS_HOME_STREET_ADDRESS, - .value = "Floor 7 Flat 42, Tagore Road Hostel, 13, Hitech City Rd", + .value = "Flat 42, Floor 7, Tagore Road Hostel, 13, Hitech City Rd", .status = VerificationStatus::kObserved}, {.type = ADDRESS_HOME_SUBPREMISE, .value = "Floor 7 Flat 42",
diff --git a/components/autofill/core/browser/data_model/autofill_structured_address_utils.cc b/components/autofill/core/browser/data_model/autofill_structured_address_utils.cc index c57922b..e141b07 100644 --- a/components/autofill/core/browser/data_model/autofill_structured_address_utils.cc +++ b/components/autofill/core/browser/data_model/autofill_structured_address_utils.cc
@@ -350,6 +350,14 @@ return AreSortedTokensEqual(TokenizeValue(one), TokenizeValue(other)); } +bool AreStringTokenCompatible(const std::u16string& first, + const std::u16string& second) { + SortedTokenComparisonResult result = + CompareSortedTokens(TokenizeValue(NormalizeValue(first)), + TokenizeValue(NormalizeValue(second))); + return result.status == MATCH || result.status == SUBSET; +} + SortedTokenComparisonResult CompareSortedTokens( const std::vector<AddressToken>& first, const std::vector<AddressToken>& second) {
diff --git a/components/autofill/core/browser/data_model/autofill_structured_address_utils.h b/components/autofill/core/browser/data_model/autofill_structured_address_utils.h index c059959..eadd1348 100644 --- a/components/autofill/core/browser/data_model/autofill_structured_address_utils.h +++ b/components/autofill/core/browser/data_model/autofill_structured_address_utils.h
@@ -288,6 +288,11 @@ bool AreStringTokenEquivalent(const std::u16string& one, const std::u16string& other); +// Returns true if all tokens from the first string are contained in the set of +// tokens from the second string. +bool AreStringTokenCompatible(const std::u16string& first, + const std::u16string& second); + // Returns a sorted vector containing the tokens of |value| after |value| was // canonicalized. |value| is tokenized by splitting it by white spaces and // commas.
diff --git a/components/autofill/core/browser/data_model/autofill_structured_address_utils_unittest.cc b/components/autofill/core/browser/data_model/autofill_structured_address_utils_unittest.cc index a157364..cdfcec9 100644 --- a/components/autofill/core/browser/data_model/autofill_structured_address_utils_unittest.cc +++ b/components/autofill/core/browser/data_model/autofill_structured_address_utils_unittest.cc
@@ -232,4 +232,13 @@ EXPECT_EQ(RewriterCache::Rewrite(u"us", u"california"), u"ca"); } +TEST(AutofillStructuredAddressUtils, AreStringTokenCompatible) { + EXPECT_TRUE(AreStringTokenCompatible(u"moto hello", u"hello, moto")); + EXPECT_TRUE(AreStringTokenCompatible(u"moto hello", u"hello, moto cross")); + EXPECT_FALSE( + AreStringTokenCompatible(u"moto hello, extra", u"hello, moto cross")); + EXPECT_TRUE(AreStringTokenCompatible(u"us foo", u"used, foo,us")); + EXPECT_FALSE(AreStringTokenCompatible(u"us foo", u"used, foo")); +} + } // namespace autofill
diff --git a/components/autofill/core/browser/personal_data_manager_cleaner.cc b/components/autofill/core/browser/personal_data_manager_cleaner.cc index 8b9fd03..7abff25 100644 --- a/components/autofill/core/browser/personal_data_manager_cleaner.cc +++ b/components/autofill/core/browser/personal_data_manager_cleaner.cc
@@ -105,9 +105,6 @@ } void PersonalDataManagerCleaner::ApplyAddressFixesAndCleanups() { - // One-time fix, otherwise NOP. - RemoveOrphanAutofillTableRows(); - // Once per major version, otherwise NOP. ApplyDedupingRoutine(); @@ -126,22 +123,6 @@ ClearCreditCardNonSettingsOrigins(); } -void PersonalDataManagerCleaner::RemoveOrphanAutofillTableRows() { - // Don't run if the fix has already been applied. - if (pref_service_->GetBoolean(prefs::kAutofillOrphanRowsRemoved)) - return; - - scoped_refptr<AutofillWebDataService> local_db = - personal_data_manager_->GetLocalDatabase(); - if (!local_db) - return; - - local_db->RemoveOrphanAutofillTableRows(); - - // Set the pref so that this fix is never run again. - pref_service_->SetBoolean(prefs::kAutofillOrphanRowsRemoved, true); -} - void PersonalDataManagerCleaner::RemoveInaccessibleProfileValues() { if (!base::FeatureList::IsEnabled( features::kAutofillRemoveInaccessibleProfileValuesOnStartup)) {
diff --git a/components/autofill/core/browser/personal_data_manager_cleaner.h b/components/autofill/core/browser/personal_data_manager_cleaner.h index 5ec5b11..89fa54ec 100644 --- a/components/autofill/core/browser/personal_data_manager_cleaner.h +++ b/components/autofill/core/browser/personal_data_manager_cleaner.h
@@ -93,10 +93,6 @@ // Applies various fixes and cleanups on autofill credit cards. void ApplyCardFixesAndCleanups(); - // Runs the routine that removes the orphan rows in the autofill tables if - // it's never been done. - void RemoveOrphanAutofillTableRows(); - // Removes settings-inaccessible profiles values from all profiles stored in // the |personal_data_manager_|. void RemoveInaccessibleProfileValues();
diff --git a/components/autofill/core/browser/webdata/autofill_table.cc b/components/autofill/core/browser/webdata/autofill_table.cc index 135a99c..0763c53 100644 --- a/components/autofill/core/browser/webdata/autofill_table.cc +++ b/components/autofill/core/browser/webdata/autofill_table.cc
@@ -1553,10 +1553,11 @@ bool AutofillTable::RemoveAllAutofillProfiles( AutofillProfile::Source profile_source) { - DCHECK(profile_source == AutofillProfile::Source::kAccount); sql::Transaction transaction(db_); - return transaction.Begin() && Delete(db_, kContactInfoTable) && - Delete(db_, kContactInfoTypeTokensTable) && transaction.Commit(); + return transaction.Begin() && + Delete(db_, GetProfileMetadataTable(profile_source)) && + Delete(db_, GetProfileTypeTokensTable(profile_source)) && + transaction.Commit(); } std::unique_ptr<AutofillProfile> AutofillTable::GetAutofillProfile( @@ -2666,7 +2667,7 @@ if (!transaction.Begin()) return false; // Some error, nothing was changed. - ClearAutofillProfiles(); + RemoveAllAutofillProfiles(AutofillProfile::Source::kLocalOrSyncable); bool changed = db_->GetLastChangeCount() > 0; ClearCreditCards(); changed |= db_->GetLastChangeCount() > 0; @@ -2782,11 +2783,6 @@ return true; } -bool AutofillTable::ClearAutofillProfiles() { - return Delete(db_, kLocalAddressesTable) && - Delete(db_, kLocalAddressesTypeTokensTable); -} - bool AutofillTable::ClearCreditCards() { return Delete(db_, kCreditCardsTable); }
diff --git a/components/autofill/core/browser/webdata/autofill_table.h b/components/autofill/core/browser/webdata/autofill_table.h index 48cf4f67..af04cff 100644 --- a/components/autofill/core/browser/webdata/autofill_table.h +++ b/components/autofill/core/browser/webdata/autofill_table.h
@@ -604,9 +604,7 @@ virtual bool RemoveAutofillProfile(const std::string& guid, AutofillProfile::Source profile_source); - // Removes all profiles from the given `profile_source`. Currently this is - // only supported for kAccount profiles, since they are cleared when the Sync - // data types gets disabled. + // Removes all profiles from the given `profile_source`. bool RemoveAllAutofillProfiles(AutofillProfile::Source profile_source); // Retrieves a profile with guid `guid` from `kAutofillProfilesTable` or @@ -772,10 +770,6 @@ bool RemoveOriginURLsModifiedBetween(const base::Time& delete_begin, const base::Time& delete_end); - // Clear all local profiles. - // TODO(crbug.com/1443393): Rename function. - bool ClearAutofillProfiles(); - // Clear all credit cards. bool ClearCreditCards(); @@ -798,13 +792,6 @@ const sync_pb::ModelTypeState& model_type_state) override; bool ClearModelTypeState(syncer::ModelType model_type) override; - // Removes the orphan rows in the autofill_profile_names, - // autofill_profile_emails and autofill_profile_phones table that were not - // removed in the previous implementation of - // RemoveAutofillDataModifiedBetween(see crbug.com/836737). - // TODO(crbug.com/1443393): Remove, since the tables are no longer used. - bool RemoveOrphanAutofillTableRows() { return true; } - // Table migration functions. NB: These do not and should not rely on other // functions in this class. The implementation of a function such as // GetCreditCard may change over time, but MigrateToVersionXX should never
diff --git a/components/autofill/core/browser/webdata/autofill_table_unittest.cc b/components/autofill/core/browser/webdata/autofill_table_unittest.cc index 36d8f2f..da26c6c 100644 --- a/components/autofill/core/browser/webdata/autofill_table_unittest.cc +++ b/components/autofill/core/browser/webdata/autofill_table_unittest.cc
@@ -1019,18 +1019,28 @@ EXPECT_THAT(profiles, ElementsAre(testing::Pointee(account_profile))); } -// Tests that `RemoveAllAutofillProfiles()` cleares all kAccount profiles. -TEST_F(AutofillTableTest, RemoveAllAutofillProfiles_kAccount) { - EXPECT_TRUE(table_->AddAutofillProfile( +// Tests that `RemoveAllAutofillProfiles()` clears all profiles of the given +// source. +TEST_P(AutofillTableProfileTest, RemoveAllAutofillProfiles) { + ASSERT_TRUE(table_->AddAutofillProfile( + AutofillProfile(AutofillProfile::Source::kLocalOrSyncable))); + ASSERT_TRUE(table_->AddAutofillProfile( AutofillProfile(AutofillProfile::Source::kAccount))); - EXPECT_TRUE( - table_->RemoveAllAutofillProfiles(AutofillProfile::Source::kAccount)); + EXPECT_TRUE(table_->RemoveAllAutofillProfiles(profile_source())); + // Expect that the profiles from `profile_source()` are gone. std::vector<std::unique_ptr<AutofillProfile>> profiles; - EXPECT_TRUE(table_->GetAutofillProfiles(&profiles, - AutofillProfile::Source::kAccount)); + ASSERT_TRUE(table_->GetAutofillProfiles(&profiles, profile_source())); EXPECT_TRUE(profiles.empty()); + + // Expect that the profile from the opposite source remains. + const auto other_source = + profile_source() == AutofillProfile::Source::kAccount + ? AutofillProfile::Source::kLocalOrSyncable + : AutofillProfile::Source::kAccount; + ASSERT_TRUE(table_->GetAutofillProfiles(&profiles, other_source)); + EXPECT_EQ(profiles.size(), 1u); } TEST_F(AutofillTableTest, IBAN) {
diff --git a/components/autofill/core/browser/webdata/autofill_webdata_backend_impl.cc b/components/autofill/core/browser/webdata/autofill_webdata_backend_impl.cc index d42c52b..336188d5 100644 --- a/components/autofill/core/browser/webdata/autofill_webdata_backend_impl.cc +++ b/components/autofill/core/browser/webdata/autofill_webdata_backend_impl.cc
@@ -734,13 +734,4 @@ return WebDatabase::COMMIT_NEEDED; } -WebDatabase::State AutofillWebDataBackendImpl::RemoveOrphanAutofillTableRows( - WebDatabase* db) { - DCHECK(owning_task_runner()->RunsTasksInCurrentSequence()); - if (AutofillTable::FromWebDatabase(db)->RemoveOrphanAutofillTableRows()) { - return WebDatabase::COMMIT_NEEDED; - } - return WebDatabase::COMMIT_NOT_NEEDED; -} - } // namespace autofill
diff --git a/components/autofill/core/browser/webdata/autofill_webdata_backend_impl.h b/components/autofill/core/browser/webdata/autofill_webdata_backend_impl.h index c5c0a501..e1452543 100644 --- a/components/autofill/core/browser/webdata/autofill_webdata_backend_impl.h +++ b/components/autofill/core/browser/webdata/autofill_webdata_backend_impl.h
@@ -242,10 +242,6 @@ const base::Time& delete_end, WebDatabase* db); - // Removes the orphan rows in the autofill_profile_names, - // autofill_profile_emails and autofill_profile_phones tables. - WebDatabase::State RemoveOrphanAutofillTableRows(WebDatabase* db); - protected: ~AutofillWebDataBackendImpl() override;
diff --git a/components/autofill/core/browser/webdata/autofill_webdata_service.cc b/components/autofill/core/browser/webdata/autofill_webdata_service.cc index ae0ca3f..d1155383 100644 --- a/components/autofill/core/browser/webdata/autofill_webdata_service.cc +++ b/components/autofill/core/browser/webdata/autofill_webdata_service.cc
@@ -374,13 +374,6 @@ autofill_backend_, delete_begin, delete_end)); } -void AutofillWebDataService::RemoveOrphanAutofillTableRows() { - wdbs_->ScheduleDBTask( - FROM_HERE, - base::BindOnce(&AutofillWebDataBackendImpl::RemoveOrphanAutofillTableRows, - autofill_backend_)); -} - void AutofillWebDataService::AddObserver( AutofillWebDataServiceObserverOnDBSequence* observer) { DCHECK(db_task_runner_->RunsTasksInCurrentSequence());
diff --git a/components/autofill/core/browser/webdata/autofill_webdata_service.h b/components/autofill/core/browser/webdata/autofill_webdata_service.h index e9f01e1..8e7f43ca 100644 --- a/components/autofill/core/browser/webdata/autofill_webdata_service.h +++ b/components/autofill/core/browser/webdata/autofill_webdata_service.h
@@ -212,10 +212,6 @@ void RemoveOriginURLsModifiedBetween(const base::Time& delete_begin, const base::Time& delete_end); - // Removes the orphan rows in the autofill_profile_names, - // autofill_profile_emails and autofill_profile_phones tables. - void RemoveOrphanAutofillTableRows(); - void AddObserver(AutofillWebDataServiceObserverOnDBSequence* observer); void RemoveObserver(AutofillWebDataServiceObserverOnDBSequence* observer);
diff --git a/components/autofill/core/common/autofill_features.cc b/components/autofill/core/common/autofill_features.cc index 2d9f9b7a..9346ef5 100644 --- a/components/autofill/core/common/autofill_features.cc +++ b/components/autofill/core/common/autofill_features.cc
@@ -224,7 +224,7 @@ // Controls if Autofill emits form issues to devtools. BASE_FEATURE(kAutofillEnableDevtoolsIssues, "AutofillEnableDevtoolsIssues", - base::FEATURE_DISABLED_BY_DEFAULT); + base::FEATURE_ENABLED_BY_DEFAULT); // Enables a couple of improvements to credit card expiration date handling: // - The autocomplete attribute values are rationalized with format strings
diff --git a/components/autofill/core/common/autofill_prefs.cc b/components/autofill/core/common/autofill_prefs.cc index aa750a34..2517a02 100644 --- a/components/autofill/core/common/autofill_prefs.cc +++ b/components/autofill/core/common/autofill_prefs.cc
@@ -153,7 +153,6 @@ prefs::kAutofillLastVersionDisusedCreditCardsDeleted, 0); registry->RegisterIntegerPref(prefs::kAutocompleteLastVersionRetentionPolicy, 0); - registry->RegisterBooleanPref(prefs::kAutofillOrphanRowsRemoved, false); registry->RegisterStringPref(prefs::kAutofillUploadEncodingSeed, ""); registry->RegisterDictionaryPref(prefs::kAutofillUploadEvents); registry->RegisterTimePref(prefs::kAutofillUploadEventsLastResetTimestamp, @@ -170,11 +169,14 @@ registry->RegisterBooleanPref( prefs::kAutofillEnabledDeprecated, true, user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); + registry->RegisterBooleanPref(prefs::kAutofillOrphanRowsRemoved, false); } void MigrateDeprecatedAutofillPrefs(PrefService* pref_service) { // Added 09/2022. pref_service->ClearPref(prefs::kAutofillEnabledDeprecated); + // Added 05/2023. + pref_service->ClearPref(prefs::kAutofillOrphanRowsRemoved); } bool IsAutocompleteEnabled(const PrefService* prefs) {
diff --git a/components/autofill/core/common/save_password_progress_logger.cc b/components/autofill/core/common/save_password_progress_logger.cc index 0cdd18b..99928e4 100644 --- a/components/autofill/core/common/save_password_progress_logger.cc +++ b/components/autofill/core/common/save_password_progress_logger.cc
@@ -272,6 +272,8 @@ return "PasswordManager::IsAutomaticSavePromptAvailable"; case SavePasswordProgressLogger::STRING_NO_PROVISIONAL_SAVE_MANAGER: return "No provisional save manager"; + case SavePasswordProgressLogger::STRING_ANOTHER_MANAGER_WAS_SUBMITTED: + return "Another form manager was submitted"; case SavePasswordProgressLogger::STRING_NUMBER_OF_VISIBLE_FORMS: return "Number of visible forms"; case SavePasswordProgressLogger::STRING_PASSWORD_FORM_REAPPEARED:
diff --git a/components/autofill/core/common/save_password_progress_logger.h b/components/autofill/core/common/save_password_progress_logger.h index 10540b4..947d6127 100644 --- a/components/autofill/core/common/save_password_progress_logger.h +++ b/components/autofill/core/common/save_password_progress_logger.h
@@ -82,6 +82,7 @@ STRING_ON_ASK_USER_OR_SAVE_PASSWORD, STRING_CAN_PROVISIONAL_MANAGER_SAVE_METHOD, STRING_NO_PROVISIONAL_SAVE_MANAGER, + STRING_ANOTHER_MANAGER_WAS_SUBMITTED, STRING_NUMBER_OF_VISIBLE_FORMS, STRING_PASSWORD_FORM_REAPPEARED, STRING_SAVING_DISABLED,
diff --git a/components/history/core/browser/url_row.h b/components/history/core/browser/url_row.h index 6fd63550..f96ed78a 100644 --- a/components/history/core/browser/url_row.h +++ b/components/history/core/browser/url_row.h
@@ -10,6 +10,7 @@ #include <string> #include <vector> +#include "base/memory/raw_ptr_exclusion.h" #include "base/time/time.h" #include "components/query_parser/snippet.h" #include "third_party/abseil-cpp/absl/types/optional.h" @@ -110,7 +111,9 @@ } private: - const GURL& url_; + // This field is not a raw_ref<> because it was filtered by the rewriter + // for: #constexpr-ctor-field-initializer + RAW_PTR_EXCLUSION const GURL& url_; }; protected:
diff --git a/components/omnibox/browser/url_index_private_data.h b/components/omnibox/browser/url_index_private_data.h index fa25486..2672ce599 100644 --- a/components/omnibox/browser/url_index_private_data.h +++ b/components/omnibox/browser/url_index_private_data.h
@@ -14,6 +14,7 @@ #include "base/containers/stack.h" #include "base/files/file_path.h" #include "base/gtest_prod_util.h" +#include "base/memory/raw_ptr_exclusion.h" #include "base/memory/ref_counted.h" #include "base/time/time.h" #include "components/history/core/browser/history_service.h" @@ -206,7 +207,9 @@ bool operator()(const HistoryID h1, const HistoryID h2); private: - const HistoryInfoMap& history_info_map_; + // This field is not a raw_ref<> because it was filtered by the rewriter + // for: #constexpr-ctor-field-initializer + RAW_PTR_EXCLUSION const HistoryInfoMap& history_info_map_; }; // Information about a URL host aggregated from all URLs of that host. Used to
diff --git a/components/page_load_metrics/browser/observers/assert_page_load_metrics_observer.h b/components/page_load_metrics/browser/observers/assert_page_load_metrics_observer.h index f040619..ba226ed46 100644 --- a/components/page_load_metrics/browser/observers/assert_page_load_metrics_observer.h +++ b/components/page_load_metrics/browser/observers/assert_page_load_metrics_observer.h
@@ -153,6 +153,9 @@ const page_load_metrics::mojom::CpuTiming& timing) override {} void OnLoadingBehaviorObserved(content::RenderFrameHost* rfh, int behavior_flags) override {} + void OnJavaScriptFrameworksObserved( + content::RenderFrameHost* rfh, + const blink::JavaScriptFrameworkDetectionResult&) override {} void OnFeaturesUsageObserved( content::RenderFrameHost* rfh, const std::vector<blink::UseCounterFeature>& features) override {}
diff --git a/components/page_load_metrics/browser/page_load_metrics_forward_observer.cc b/components/page_load_metrics/browser/page_load_metrics_forward_observer.cc index fd715f8..1c8480d 100644 --- a/components/page_load_metrics/browser/page_load_metrics_forward_observer.cc +++ b/components/page_load_metrics/browser/page_load_metrics_forward_observer.cc
@@ -227,11 +227,15 @@ void PageLoadMetricsForwardObserver::OnFirstInputInPage( const mojom::PageLoadTiming& timing) {} -// OnLoadingBehaviorObserved is called through PageLoadTracker::UpdateMetrics. -// So, the event is always forwarded at the PageLoadTracker layer. +// OnLoadingBehaviorObserved and OnJavaScriptFrameworksObserved are called +// through PageLoadTracker::UpdateMetrics. So, the event is always forwarded at +// the PageLoadTracker layer. void PageLoadMetricsForwardObserver::OnLoadingBehaviorObserved( content::RenderFrameHost* rfh, int behavior_flags) {} +void PageLoadMetricsForwardObserver::OnJavaScriptFrameworksObserved( + content::RenderFrameHost* rfh, + const blink::JavaScriptFrameworkDetectionResult&) {} void PageLoadMetricsForwardObserver::OnFeaturesUsageObserved( content::RenderFrameHost* rfh,
diff --git a/components/page_load_metrics/browser/page_load_metrics_forward_observer.h b/components/page_load_metrics/browser/page_load_metrics_forward_observer.h index b330026..f7c1e467 100644 --- a/components/page_load_metrics/browser/page_load_metrics_forward_observer.h +++ b/components/page_load_metrics/browser/page_load_metrics_forward_observer.h
@@ -105,6 +105,9 @@ void OnFirstInputInPage(const mojom::PageLoadTiming& timing) override; void OnLoadingBehaviorObserved(content::RenderFrameHost* rfh, int behavior_flags) override; + void OnJavaScriptFrameworksObserved( + content::RenderFrameHost* rfh, + const blink::JavaScriptFrameworkDetectionResult&) override; void OnFeaturesUsageObserved( content::RenderFrameHost* rfh, const std::vector<blink::UseCounterFeature>& features) override;
diff --git a/components/page_load_metrics/browser/page_load_metrics_observer.h b/components/page_load_metrics/browser/page_load_metrics_observer.h index c974f44..01f71f9 100644 --- a/components/page_load_metrics/browser/page_load_metrics_observer.h +++ b/components/page_load_metrics/browser/page_load_metrics_observer.h
@@ -24,6 +24,10 @@ #include "third_party/blink/public/common/use_counter/use_counter_feature.h" #include "url/gurl.h" +namespace blink { +struct JavaScriptFrameworkDetectionResult; +} // namespace blink + namespace page_load_metrics { // Information related to whether an associated action, such as a navigation or @@ -182,6 +186,9 @@ void OnFirstInputInPage(const mojom::PageLoadTiming& timing) override {} void OnLoadingBehaviorObserved(content::RenderFrameHost* rfh, int behavior_flags) override {} + void OnJavaScriptFrameworksObserved( + content::RenderFrameHost* rfh, + const blink::JavaScriptFrameworkDetectionResult&) override {} void OnFeaturesUsageObserved( content::RenderFrameHost* rfh, const std::vector<blink::UseCounterFeature>& features) override {}
diff --git a/components/page_load_metrics/browser/page_load_metrics_observer_interface.h b/components/page_load_metrics/browser/page_load_metrics_observer_interface.h index b7532a3..907f312 100644 --- a/components/page_load_metrics/browser/page_load_metrics_observer_interface.h +++ b/components/page_load_metrics/browser/page_load_metrics_observer_interface.h
@@ -22,6 +22,10 @@ #include "url/gurl.h" +namespace blink { +struct JavaScriptFrameworkDetectionResult; +} // namespace blink + namespace content { class NavigationHandle; class RenderFrameHost; @@ -416,6 +420,10 @@ virtual void OnLoadingBehaviorObserved(content::RenderFrameHost* rfh, int behavior_flags) = 0; + virtual void OnJavaScriptFrameworksObserved( + content::RenderFrameHost* rfh, + const blink::JavaScriptFrameworkDetectionResult&) = 0; + // Invoked when new use counter features are observed across all frames. virtual void OnFeaturesUsageObserved( content::RenderFrameHost* rfh,
diff --git a/components/page_load_metrics/browser/page_load_tracker.cc b/components/page_load_metrics/browser/page_load_tracker.cc index 75bf056..7c45a94 100644 --- a/components/page_load_metrics/browser/page_load_tracker.cc +++ b/components/page_load_metrics/browser/page_load_tracker.cc
@@ -1013,6 +1013,8 @@ for (const auto& observer : observers_) { observer->OnLoadingBehaviorObserved(nullptr, GetMainFrameMetadata().behavior_flags); + observer->OnJavaScriptFrameworksObserved( + nullptr, GetMainFrameMetadata().framework_detection_result); } }
diff --git a/components/page_load_metrics/common/page_load_metrics.mojom b/components/page_load_metrics/common/page_load_metrics.mojom index 80b2272..fbe99ea 100644 --- a/components/page_load_metrics/common/page_load_metrics.mojom +++ b/components/page_load_metrics/common/page_load_metrics.mojom
@@ -7,6 +7,8 @@ import "ui/gfx/geometry/mojom/geometry.mojom"; import "mojo/public/mojom/base/shared_memory.mojom"; import "mojo/public/mojom/base/time.mojom"; +import + "third_party/blink/public/mojom/loader/javascript_framework_detection.mojom"; import "services/network/public/mojom/request_priority.mojom"; import "third_party/blink/public/mojom/use_counter/metrics/web_feature.mojom"; import "third_party/blink/public/mojom/use_counter/use_counter_feature.mojom"; @@ -228,6 +230,9 @@ // is only populated for the main frame, for the first time // each rectangle is initially computed and for any subsequent changes. map<int32, gfx.mojom.Rect> main_frame_image_ad_rects; + + // Detected versions of JavaScript frameworks in the page. + blink.mojom.JavaScriptFrameworkDetectionResult framework_detection_result; }; struct SubresourceLoadMetrics {
diff --git a/components/page_load_metrics/renderer/metrics_render_frame_observer.cc b/components/page_load_metrics/renderer/metrics_render_frame_observer.cc index fc01d66..d67e6705 100644 --- a/components/page_load_metrics/renderer/metrics_render_frame_observer.cc +++ b/components/page_load_metrics/renderer/metrics_render_frame_observer.cc
@@ -141,6 +141,13 @@ page_timing_metrics_sender_->DidObserveLoadingBehavior(behavior); } +void MetricsRenderFrameObserver::DidObserveJavaScriptFrameworks( + const blink::JavaScriptFrameworkDetectionResult& result) { + if (page_timing_metrics_sender_) { + page_timing_metrics_sender_->DidObserveJavaScriptFrameworks(result); + } +} + void MetricsRenderFrameObserver::DidObserveSubresourceLoad( const blink::SubresourceLoadMetrics& subresource_load_metrics) { if (page_timing_metrics_sender_)
diff --git a/components/page_load_metrics/renderer/metrics_render_frame_observer.h b/components/page_load_metrics/renderer/metrics_render_frame_observer.h index a9c326a0..fbccfd70 100644 --- a/components/page_load_metrics/renderer/metrics_render_frame_observer.h +++ b/components/page_load_metrics/renderer/metrics_render_frame_observer.h
@@ -26,6 +26,10 @@ class OneShotTimer; } // namespace base +namespace blink { +struct JavaScriptFrameworkDetectionResult; +} // namespace blink + namespace page_load_metrics { class PageTimingMetricsSender; @@ -57,6 +61,8 @@ blink::UserInteractionType interaction_type) override; void DidChangeCpuTiming(base::TimeDelta time) override; void DidObserveLoadingBehavior(blink::LoadingBehaviorFlag behavior) override; + void DidObserveJavaScriptFrameworks( + const blink::JavaScriptFrameworkDetectionResult&) override; void DidObserveSubresourceLoad( const blink::SubresourceLoadMetrics& subresource_load_metrics) override; void DidObserveNewFeatureUsage(
diff --git a/components/page_load_metrics/renderer/page_timing_metrics_sender.cc b/components/page_load_metrics/renderer/page_timing_metrics_sender.cc index d5f3f20e..1a89bad 100644 --- a/components/page_load_metrics/renderer/page_timing_metrics_sender.cc +++ b/components/page_load_metrics/renderer/page_timing_metrics_sender.cc
@@ -18,6 +18,7 @@ #include "services/network/public/cpp/url_loader_completion_status.h" #include "services/network/public/mojom/url_response_head.mojom.h" #include "third_party/blink/public/common/features.h" +#include "third_party/blink/public/mojom/loader/javascript_framework_detection.mojom-forward.h" #include "third_party/blink/public/mojom/use_counter/metrics/web_feature.mojom-shared.h" #include "third_party/blink/public/mojom/use_counter/use_counter_feature.mojom-shared.h" #include "ui/gfx/geometry/rect.h" @@ -85,6 +86,12 @@ EnsureSendTimer(); } +void PageTimingMetricsSender::DidObserveJavaScriptFrameworks( + const blink::JavaScriptFrameworkDetectionResult& result) { + metadata_->framework_detection_result = result; + EnsureSendTimer(); +} + void PageTimingMetricsSender::DidObserveSubresourceLoad( const blink::SubresourceLoadMetrics& subresource_load_metrics) { if (subresource_load_metrics_ &&
diff --git a/components/page_load_metrics/renderer/page_timing_metrics_sender.h b/components/page_load_metrics/renderer/page_timing_metrics_sender.h index 62e98f407..2a83b3e 100644 --- a/components/page_load_metrics/renderer/page_timing_metrics_sender.h +++ b/components/page_load_metrics/renderer/page_timing_metrics_sender.h
@@ -25,6 +25,10 @@ class OneShotTimer; } // namespace base +namespace blink { +struct JavaScriptFrameworkDetectionResult; +} // namespace blink + namespace network { struct URLLoaderCompletionStatus; } // namespace network @@ -51,6 +55,8 @@ ~PageTimingMetricsSender(); void DidObserveLoadingBehavior(blink::LoadingBehaviorFlag behavior); + void DidObserveJavaScriptFrameworks( + const blink::JavaScriptFrameworkDetectionResult&); void DidObserveSubresourceLoad( const blink::SubresourceLoadMetrics& subresource_load_metrics); void DidObserveNewFeatureUsage(const blink::UseCounterFeature& feature);
diff --git a/components/password_manager/core/browser/password_manager.cc b/components/password_manager/core/browser/password_manager.cc index 1eeb2e7..042ec37 100644 --- a/components/password_manager/core/browser/password_manager.cc +++ b/components/password_manager/core/browser/password_manager.cc
@@ -587,7 +587,7 @@ const autofill::FormData& form_data) { PasswordFormManager* manager = GetMatchedManager(driver, form_data.unique_renderer_id); - if (!manager || !manager->is_submitted() || + if (!manager || !IsAutomaticSavePromptAvailable(manager) || !manager->GetSubmittedForm()->IsLikelyChangePasswordForm()) { return; } @@ -935,7 +935,8 @@ } #endif -bool PasswordManager::IsAutomaticSavePromptAvailable() { +bool PasswordManager::IsAutomaticSavePromptAvailable( + PasswordFormManager* form_manager) { std::unique_ptr<BrowserSavePasswordProgressLogger> logger; if (password_manager_util::IsLoggingActive(client_)) { logger = std::make_unique<BrowserSavePasswordProgressLogger>( @@ -952,6 +953,15 @@ return false; } + // As OnLoginSuccessful always works with the result of GetSubmittedManager(), + // consider only that form manager when a specific |form_manager| is provided. + if (form_manager && (form_manager != submitted_manager)) { + if (logger) { + logger->LogMessage(Logger::STRING_ANOTHER_MANAGER_WAS_SUBMITTED); + } + return false; + } + if (submitted_manager->GetFormFetcher()->GetState() == FormFetcher::State::WAITING) { // We have a provisional save manager, but it didn't finish matching yet. @@ -1071,9 +1081,9 @@ } PasswordFormManager* submitted_manager = GetSubmittedManager(); - DCHECK(submitted_manager); + CHECK(submitted_manager); const PasswordForm* submitted_form = submitted_manager->GetSubmittedForm(); - DCHECK(submitted_form); + CHECK(submitted_form); client_->MaybeReportEnterpriseLoginEvent( submitted_form->url, submitted_form->IsFederatedCredential(), submitted_form->federation_origin, @@ -1132,7 +1142,7 @@ submitted_manager->GetSubmittedForm()->url.SchemeIsCryptographic()); // If the form is eligible only for saving fallback, it shouldn't go here. - DCHECK(!submitted_manager->GetPendingCredentials().only_for_fallback); + CHECK(!submitted_manager->GetPendingCredentials().only_for_fallback); if (ShouldPromptUserToSavePassword(*submitted_manager)) { if (logger) @@ -1451,7 +1461,7 @@ } // If the manager was set to be submitted, either prior to this function call // or on provisional save above, consider submission successful. - if (form_manager->is_submitted()) { + if (IsAutomaticSavePromptAvailable(form_manager)) { OnLoginSuccessful(); return true; }
diff --git a/components/password_manager/core/browser/password_manager.h b/components/password_manager/core/browser/password_manager.h index f0a94bc6..e36ff47 100644 --- a/components/password_manager/core/browser/password_manager.h +++ b/components/password_manager/core/browser/password_manager.h
@@ -221,8 +221,10 @@ // Returns true if there is a form manager for a submitted form and this form // manager contains the submitted credentials suitable for automatic save - // prompt, not for manual fallback only. - bool IsAutomaticSavePromptAvailable(); + // prompt, not for manual fallback only. If a specific |form_manager| is + // queried, returns true iff the submitted manager matches |form_manager|. + bool IsAutomaticSavePromptAvailable( + PasswordFormManager* form_manager = nullptr); // Returns true if there already exists a provisionally saved password form // from the origin |origin|, but with a different and secure scheme.
diff --git a/components/password_manager/core/browser/password_manager_unittest.cc b/components/password_manager/core/browser/password_manager_unittest.cc index 241a5d8..e900ec817 100644 --- a/components/password_manager/core/browser/password_manager_unittest.cc +++ b/components/password_manager/core/browser/password_manager_unittest.cc
@@ -4024,7 +4024,7 @@ PasswordForm saved_match(MakeSavedForm()); store_->AddLogin(saved_match); - // Create FormData for a form with 1 password field and process it. + // Create FormData for a form with 3 password fields and process it. FormData form_data; form_data.unique_renderer_id = FormRendererId(0); form_data.url = test_form_url_; @@ -4070,6 +4070,37 @@ EXPECT_EQ(saved_match.username_value, votes_uploader.suggested_username()); } +TEST_F(PasswordManagerTest, + SubmissionDetectedOnClearedForm_OnlySavingFallback) { + base::test::ScopedFeatureList feature_list; + EXPECT_CALL(client_, IsSavingAndFillingEnabled).WillRepeatedly(Return(true)); + PasswordForm saved_match(MakeSavedForm()); + store_->AddLogin(saved_match); + + // Create FormData for a form with 1 password field and process it. + FormData form_data; + form_data.unique_renderer_id = FormRendererId(0); + form_data.url = test_form_url_; + + FormFieldData password_field; + password_field.form_control_type = "password"; + password_field.unique_renderer_id = FieldRendererId(1); + password_field.name = u"one-time-code"; + password_field.value = u"123456"; + form_data.fields.push_back(password_field); + + manager()->OnPasswordFormsParsed(&driver_, {form_data}); + task_environment_.RunUntilIdle(); + ASSERT_TRUE(manager()->form_managers().front()); + + manager()->OnInformAboutUserInput(&driver_, form_data); + + // Don't expect an automatic prompt. Only the manual fallback for saving is + // available. + EXPECT_CALL(client_, PromptUserToSaveOrUpdatePasswordPtr).Times(0); + manager()->OnPasswordFormCleared(&driver_, form_data); +} + // Similar test as above with fields that have empty names. TEST_F(PasswordManagerTest, SubmissionDetectedOnClearedNamelessForm) { constexpr char16_t kEmptyName[] = u"";
diff --git a/components/policy/resources/templates/policy_definitions/Miscellaneous/EventPathEnabled.yaml b/components/policy/resources/templates/policy_definitions/Miscellaneous/EventPathEnabled.yaml index 9da06eb5..7250353 100644 --- a/components/policy/resources/templates/policy_definitions/Miscellaneous/EventPathEnabled.yaml +++ b/components/policy/resources/templates/policy_definitions/Miscellaneous/EventPathEnabled.yaml
@@ -1,5 +1,6 @@ caption: Re-enable the Event.path API until M115. default: null +deprecated: true desc: |2- Starting in M109, the non-standard API Event.path will be removed to improve web compatibility. This policy re-enables the API until M115.
diff --git a/components/services/screen_ai/screen_ai_service_impl.cc b/components/services/screen_ai/screen_ai_service_impl.cc index 4f1bd32..582540b 100644 --- a/components/services/screen_ai/screen_ai_service_impl.cc +++ b/components/services/screen_ai/screen_ai_service_impl.cc
@@ -31,20 +31,6 @@ namespace { -// These values are persisted to logs. Entries should not be renumbered and -// numeric values should never be reused. -// TODO(crbug.com/1278249): Deprecate these enums and add a new set of booleans -// for each outcome (library load, OCR init, Main Content init). -enum class ScreenAILoadLibraryResult { - kAllOk = 0, - kDeprecatedVisualAnnotationFailed = 1, - kMainContentExtractionFailed = 2, - kLayoutExtractionFailed = 3, - kOcrFailed = 4, - kFunctionsLoadFailed = 5, - kMaxValue = kFunctionsLoadFailed, -}; - // Returns an empty result if load fails. std::unique_ptr<ScreenAILibraryWrapper> LoadLibrary( const base::FilePath& library_path) { @@ -52,10 +38,11 @@ std::unique_ptr<ScreenAILibraryWrapper> library = std::make_unique<ScreenAILibraryWrapper>(); - if (!library->Load(library_path)) { - base::UmaHistogramEnumeration( - "Accessibility.ScreenAI.LoadLibraryResult", - ScreenAILoadLibraryResult::kFunctionsLoadFailed); + bool load_sucessful = library->Load(library_path); + base::UmaHistogramBoolean("Accessibility.ScreenAI.Library.Initialized", + load_sucessful); + + if (!load_sucessful) { library.reset(); return library; } @@ -74,8 +61,6 @@ library->EnableDebugMode(); } - base::UmaHistogramEnumeration("Accessibility.ScreenAI.LoadLibraryResult", - ScreenAILoadLibraryResult::kAllOk); return library; } @@ -161,10 +146,11 @@ InitializeMainContentExtractionCallback callback, std::unique_ptr<ScreenAILibraryWrapper::MainContentExtractionModelData> model_data) { - if (!library_->InitMainContentExtraction(*model_data)) { - base::UmaHistogramEnumeration( - "Accessibility.ScreenAI.LoadLibraryResult", - ScreenAILoadLibraryResult::kMainContentExtractionFailed); + bool init_successful = library_->InitMainContentExtraction(*model_data); + base::UmaHistogramBoolean( + "Accessibility.ScreenAI.MainContentExtraction.Initialized", + init_successful); + if (!init_successful) { std::move(callback).Run(false); return; } @@ -191,9 +177,10 @@ base::Process::TerminateCurrentProcessImmediately(-1); } - if (!library_->InitOCR(library_path.DirName())) { - base::UmaHistogramEnumeration("Accessibility.ScreenAI.LoadLibraryResult", - ScreenAILoadLibraryResult::kOcrFailed); + bool init_successful = library_->InitOCR(library_path.DirName()); + base::UmaHistogramBoolean("Accessibility.ScreenAI.OCR.Initalized", + init_successful); + if (!init_successful) { std::move(callback).Run(false); return; }
diff --git a/components/supervised_user/core/browser/BUILD.gn b/components/supervised_user/core/browser/BUILD.gn index 3e67f60..cf41dd0 100644 --- a/components/supervised_user/core/browser/BUILD.gn +++ b/components/supervised_user/core/browser/BUILD.gn
@@ -8,13 +8,12 @@ static_library("fetcher") { sources = [ - "kids_access_token_fetcher.cc", - "kids_access_token_fetcher.h", - "kids_external_fetcher.cc", - "kids_external_fetcher.h", - "kids_external_fetcher_config.cc", - "kids_external_fetcher_config.h", - "kids_external_fetcher_requests.h", + "api_access_token_fetcher.cc", + "api_access_token_fetcher.h", + "fetcher_config.cc", + "fetcher_config.h", + "proto_fetcher.cc", + "proto_fetcher.h", ] deps = [ "//base", @@ -111,10 +110,10 @@ source_set("unit_tests") { testonly = true sources = [ - "kids_access_token_fetcher_unittest.cc", - "kids_external_fetcher_unittest.cc", + "api_access_token_fetcher_unittest.cc", "kids_management_url_checker_client_unittest.cc", "parental_control_metrics_unittest.cc", + "proto_fetcher_unittest.cc", "remote_web_approvals_manager_unittest.cc", "supervised_user_error_page_unittest.cc", "supervised_user_metrics_service_unittest.cc",
diff --git a/components/supervised_user/core/browser/kids_access_token_fetcher.cc b/components/supervised_user/core/browser/api_access_token_fetcher.cc similarity index 81% rename from components/supervised_user/core/browser/kids_access_token_fetcher.cc rename to components/supervised_user/core/browser/api_access_token_fetcher.cc index 23785a8..6c84b75 100644 --- a/components/supervised_user/core/browser/kids_access_token_fetcher.cc +++ b/components/supervised_user/core/browser/api_access_token_fetcher.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/supervised_user/core/browser/kids_access_token_fetcher.h" +#include "components/supervised_user/core/browser/api_access_token_fetcher.h" #include <memory> #include <utility> @@ -18,6 +18,7 @@ #include "google_apis/gaia/google_service_auth_error.h" #include "google_apis/gaia/oauth2_access_token_manager.h" +namespace supervised_user { namespace { base::expected<signin::AccessTokenInfo, GoogleServiceAuthError> @@ -31,7 +32,7 @@ } // namespace -KidsAccessTokenFetcher::KidsAccessTokenFetcher( +ApiAccessTokenFetcher::ApiAccessTokenFetcher( signin::IdentityManager& identity_manager, Consumer consumer) : consumer_(std::move(consumer)) { @@ -40,21 +41,22 @@ primary_account_access_token_fetcher_ = std::make_unique<signin::PrimaryAccountAccessTokenFetcher>( "family_info_fetcher", &identity_manager, Scopes(), - base::BindOnce(&KidsAccessTokenFetcher::OnAccessTokenFetchComplete, + base::BindOnce(&ApiAccessTokenFetcher::OnAccessTokenFetchComplete, base::Unretained(this)), signin::PrimaryAccountAccessTokenFetcher::Mode::kWaitUntilAvailable, signin::ConsentLevel::kSignin); } -KidsAccessTokenFetcher::~KidsAccessTokenFetcher() = default; +ApiAccessTokenFetcher::~ApiAccessTokenFetcher() = default; -void KidsAccessTokenFetcher::OnAccessTokenFetchComplete( +void ApiAccessTokenFetcher::OnAccessTokenFetchComplete( GoogleServiceAuthError error, signin::AccessTokenInfo access_token_info) { std::move(consumer_).Run(ToSingleReturnValue(error, access_token_info)); } -const OAuth2AccessTokenManager::ScopeSet& KidsAccessTokenFetcher::Scopes() { +const OAuth2AccessTokenManager::ScopeSet& ApiAccessTokenFetcher::Scopes() { static auto nonce = base::NoDestructor<OAuth2AccessTokenManager::ScopeSet>{ {GaiaConstants::kKidFamilyReadonlyOAuth2Scope}}; return *nonce; } +} // namespace supervised_user
diff --git a/components/supervised_user/core/browser/kids_access_token_fetcher.h b/components/supervised_user/core/browser/api_access_token_fetcher.h similarity index 70% rename from components/supervised_user/core/browser/kids_access_token_fetcher.h rename to components/supervised_user/core/browser/api_access_token_fetcher.h index 01aed46..8985d2fa 100644 --- a/components/supervised_user/core/browser/kids_access_token_fetcher.h +++ b/components/supervised_user/core/browser/api_access_token_fetcher.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef COMPONENTS_SUPERVISED_USER_CORE_BROWSER_KIDS_ACCESS_TOKEN_FETCHER_H_ -#define COMPONENTS_SUPERVISED_USER_CORE_BROWSER_KIDS_ACCESS_TOKEN_FETCHER_H_ +#ifndef COMPONENTS_SUPERVISED_USER_CORE_BROWSER_API_ACCESS_TOKEN_FETCHER_H_ +#define COMPONENTS_SUPERVISED_USER_CORE_BROWSER_API_ACCESS_TOKEN_FETCHER_H_ #include <memory> @@ -17,9 +17,11 @@ #include "google_apis/gaia/google_service_auth_error.h" #include "google_apis/gaia/oauth2_access_token_manager.h" +namespace supervised_user { + // Responsible for initialising the access token workflow. Executes the // consuming callback when the fetch is done, and then becomes disposable. -class KidsAccessTokenFetcher { +class ApiAccessTokenFetcher { public: // For convenience, the interface of signin::PrimaryAccountAccessTokenFetcher // is wrapped into one value, so the decision how to handle errors is up to @@ -27,12 +29,12 @@ using Consumer = base::OnceCallback<void( base::expected<signin::AccessTokenInfo, GoogleServiceAuthError>)>; // Non copyable. - KidsAccessTokenFetcher() = delete; - explicit KidsAccessTokenFetcher(signin::IdentityManager& identity_manager, - Consumer consumer); - KidsAccessTokenFetcher(const KidsAccessTokenFetcher&) = delete; - KidsAccessTokenFetcher& operator=(const KidsAccessTokenFetcher&) = delete; - ~KidsAccessTokenFetcher(); + ApiAccessTokenFetcher() = delete; + explicit ApiAccessTokenFetcher(signin::IdentityManager& identity_manager, + Consumer consumer); + ApiAccessTokenFetcher(const ApiAccessTokenFetcher&) = delete; + ApiAccessTokenFetcher& operator=(const ApiAccessTokenFetcher&) = delete; + ~ApiAccessTokenFetcher(); private: void OnAccessTokenFetchComplete(GoogleServiceAuthError error, @@ -43,4 +45,6 @@ primary_account_access_token_fetcher_; }; -#endif // COMPONENTS_SUPERVISED_USER_CORE_BROWSER_KIDS_ACCESS_TOKEN_FETCHER_H_ +} // namespace supervised_user + +#endif // COMPONENTS_SUPERVISED_USER_CORE_BROWSER_API_ACCESS_TOKEN_FETCHER_H_
diff --git a/components/supervised_user/core/browser/kids_access_token_fetcher_unittest.cc b/components/supervised_user/core/browser/api_access_token_fetcher_unittest.cc similarity index 82% rename from components/supervised_user/core/browser/kids_access_token_fetcher_unittest.cc rename to components/supervised_user/core/browser/api_access_token_fetcher_unittest.cc index f5c4cb6e..40926084 100644 --- a/components/supervised_user/core/browser/kids_access_token_fetcher_unittest.cc +++ b/components/supervised_user/core/browser/api_access_token_fetcher_unittest.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/supervised_user/core/browser/kids_access_token_fetcher.h" +#include "components/supervised_user/core/browser/api_access_token_fetcher.h" #include "base/functional/bind.h" #include "base/functional/callback.h" @@ -18,6 +18,7 @@ #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" +namespace supervised_user { namespace { using ::base::BindOnce; @@ -33,14 +34,14 @@ using ::signin::IdentityTestEnvironment; using ::testing::Test; -class KidsAccessTokenFetcherTest : public Test { +class ApiAccessTokenFetcherTest : public Test { protected: // A pinhole class that allows to verify the fetch result. class Receiver { public: using FetchResultType = expected<AccessTokenInfo, GoogleServiceAuthError>; // The closure is safe to use if `this` pointer outlives its ::Run. - KidsAccessTokenFetcher::Consumer Receive() { + ApiAccessTokenFetcher::Consumer Receive() { return BindOnce(&Receiver::Set, Unretained(this)); } @@ -55,12 +56,12 @@ IdentityTestEnvironment identity_test_env_; }; -TEST_F(KidsAccessTokenFetcherTest, ReadToken) { +TEST_F(ApiAccessTokenFetcherTest, ReadToken) { AccountInfo account = identity_test_env_.MakePrimaryAccountAvailable( "bob@example.com", ConsentLevel::kSignin); Receiver receiver; - KidsAccessTokenFetcher service(*identity_test_env_.identity_manager(), - receiver.Receive()); + ApiAccessTokenFetcher service(*identity_test_env_.identity_manager(), + receiver.Receive()); identity_test_env_.WaitForAccessTokenRequestIfNecessaryAndRespondWithToken( "expected_access_token", Time::Max()); @@ -68,12 +69,12 @@ EXPECT_EQ(receiver.Get().value().token, "expected_access_token"); } -TEST_F(KidsAccessTokenFetcherTest, AuthError) { +TEST_F(ApiAccessTokenFetcherTest, AuthError) { AccountInfo account = identity_test_env_.MakePrimaryAccountAvailable( "bob@example.com", ConsentLevel::kSignin); Receiver receiver; - KidsAccessTokenFetcher service(*identity_test_env_.identity_manager(), - receiver.Receive()); + ApiAccessTokenFetcher service(*identity_test_env_.identity_manager(), + receiver.Receive()); identity_test_env_.WaitForAccessTokenRequestIfNecessaryAndRespondWithError( GoogleServiceAuthError( @@ -84,3 +85,4 @@ } } // namespace +} // namespace supervised_user
diff --git a/components/supervised_user/core/browser/kids_external_fetcher_config.cc b/components/supervised_user/core/browser/fetcher_config.cc similarity index 95% rename from components/supervised_user/core/browser/kids_external_fetcher_config.cc rename to components/supervised_user/core/browser/fetcher_config.cc index b92dadb..31e5a3a 100644 --- a/components/supervised_user/core/browser/kids_external_fetcher_config.cc +++ b/components/supervised_user/core/browser/fetcher_config.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/supervised_user/core/browser/kids_external_fetcher_config.h" +#include "components/supervised_user/core/browser/fetcher_config.h" #include <string>
diff --git a/components/supervised_user/core/browser/kids_external_fetcher_config.h b/components/supervised_user/core/browser/fetcher_config.h similarity index 83% rename from components/supervised_user/core/browser/kids_external_fetcher_config.h rename to components/supervised_user/core/browser/fetcher_config.h index 45b4e84e..c7bb7aa 100644 --- a/components/supervised_user/core/browser/kids_external_fetcher_config.h +++ b/components/supervised_user/core/browser/fetcher_config.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef COMPONENTS_SUPERVISED_USER_CORE_BROWSER_KIDS_EXTERNAL_FETCHER_CONFIG_H_ -#define COMPONENTS_SUPERVISED_USER_CORE_BROWSER_KIDS_EXTERNAL_FETCHER_CONFIG_H_ +#ifndef COMPONENTS_SUPERVISED_USER_CORE_BROWSER_FETCHER_CONFIG_H_ +#define COMPONENTS_SUPERVISED_USER_CORE_BROWSER_FETCHER_CONFIG_H_ #include <string> @@ -19,7 +19,7 @@ net::NetworkTrafficAnnotationTag ListFamilyMembersTag(); } // namespace annotations -// Configuration bundle for the KidsExternalFetcher. +// Configuration bundle for the ProtoFetcher. struct FetcherConfig { // TODO(b/276898959): add kPost option. enum class Method { kGet }; @@ -52,4 +52,4 @@ }; } // namespace supervised_user -#endif // COMPONENTS_SUPERVISED_USER_CORE_BROWSER_KIDS_EXTERNAL_FETCHER_CONFIG_H_ +#endif // COMPONENTS_SUPERVISED_USER_CORE_BROWSER_FETCHER_CONFIG_H_
diff --git a/components/supervised_user/core/browser/fetcher_config_test_utils.cc b/components/supervised_user/core/browser/fetcher_config_test_utils.cc index 1c26398..60d08d71 100644 --- a/components/supervised_user/core/browser/fetcher_config_test_utils.cc +++ b/components/supervised_user/core/browser/fetcher_config_test_utils.cc
@@ -5,7 +5,7 @@ #include "components/supervised_user/core/browser/fetcher_config_test_utils.h" #include "base/logging.h" -#include "components/supervised_user/core/browser/kids_external_fetcher_config.h" +#include "components/supervised_user/core/browser/fetcher_config.h" #include "net/traffic_annotation/network_traffic_annotation.h" #include "url/gurl.h"
diff --git a/components/supervised_user/core/browser/fetcher_config_test_utils.h b/components/supervised_user/core/browser/fetcher_config_test_utils.h index d78d96d..9721ab2 100644 --- a/components/supervised_user/core/browser/fetcher_config_test_utils.h +++ b/components/supervised_user/core/browser/fetcher_config_test_utils.h
@@ -6,11 +6,11 @@ #ifndef COMPONENTS_SUPERVISED_USER_CORE_BROWSER_FETCHER_CONFIG_TEST_UTILS_H_ #define COMPONENTS_SUPERVISED_USER_CORE_BROWSER_FETCHER_CONFIG_TEST_UTILS_H_ -#include "components/supervised_user/core/browser/kids_external_fetcher_config.h" +#include "components/supervised_user/core/browser/fetcher_config.h" namespace supervised_user { -// Test utility for overriding configurations for KidsExternalFetcher. +// Test utility for overriding configurations for ProtoFetcher. class FetcherTestConfigBuilder { public: static FetcherTestConfigBuilder FromConfig(const FetcherConfig& from_config);
diff --git a/components/supervised_user/core/browser/kids_external_fetcher_requests.h b/components/supervised_user/core/browser/kids_external_fetcher_requests.h deleted file mode 100644 index 096d4d7..0000000 --- a/components/supervised_user/core/browser/kids_external_fetcher_requests.h +++ /dev/null
@@ -1,31 +0,0 @@ -// Copyright 2023 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef COMPONENTS_SUPERVISED_USER_CORE_BROWSER_KIDS_EXTERNAL_FETCHER_REQUESTS_H_ -#define COMPONENTS_SUPERVISED_USER_CORE_BROWSER_KIDS_EXTERNAL_FETCHER_REQUESTS_H_ - -#include "base/strings/strcat.h" -#include "components/supervised_user/core/browser/kids_external_fetcher_config.h" -#include "components/supervised_user/core/browser/proto/kidschromemanagement_messages.pb.h" -#include "url/gurl.h" - -namespace supervised_user { - -// Determines the response type. See go/system-parameters to see list of -// possible One Platform system params. -constexpr base::StringPiece kSystemParameters("alt=proto"); - -// Creates a requests for kids management api which is independent from the -// current profile (doesn't take Profile* parameter). It also adds query -// parameter that configures the remote endpoint to respond with a protocol -// buffer message. -template <typename RequestType> -GURL CreateRequestUrl(const FetcherConfig& config) { - return GURL(config.service_endpoint) - .Resolve(base::StrCat({config.service_path, "?", kSystemParameters})); -} - -} // namespace supervised_user - -#endif
diff --git a/components/supervised_user/core/browser/kids_external_fetcher.cc b/components/supervised_user/core/browser/proto_fetcher.cc similarity index 65% rename from components/supervised_user/core/browser/kids_external_fetcher.cc rename to components/supervised_user/core/browser/proto_fetcher.cc index ea287fe..90dff2a 100644 --- a/components/supervised_user/core/browser/kids_external_fetcher.cc +++ b/components/supervised_user/core/browser/proto_fetcher.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/supervised_user/core/browser/kids_external_fetcher.h" +#include "components/supervised_user/core/browser/proto_fetcher.h" #include <memory> #include <string> @@ -21,9 +21,9 @@ #include "base/types/expected.h" #include "components/signin/public/identity_manager/access_token_info.h" #include "components/signin/public/identity_manager/identity_manager.h" -#include "components/supervised_user/core/browser/kids_access_token_fetcher.h" -#include "components/supervised_user/core/browser/kids_external_fetcher_config.h" -#include "components/supervised_user/core/browser/kids_external_fetcher_requests.h" +#include "components/supervised_user/core/browser/api_access_token_fetcher.h" +#include "components/supervised_user/core/browser/fetcher_config.h" +#include "components/supervised_user/core/browser/proto/kidschromemanagement_messages.pb.h" #include "components/supervised_user/core/common/supervised_user_constants.h" #include "google_apis/gaia/google_service_auth_error.h" #include "net/http/http_status_code.h" @@ -31,8 +31,10 @@ #include "services/network/public/cpp/resource_request.h" #include "services/network/public/cpp/simple_url_loader.h" #include "services/network/public/mojom/url_response_head.mojom.h" +#include "third_party/protobuf/src/google/protobuf/message_lite.h" #include "url/gurl.h" +namespace supervised_user { namespace { // Controls the retry count of the simple url loader. const int kNumFamilyInfoFetcherRetries = 1; @@ -81,14 +83,26 @@ std::string CreateAuthorizationHeader( const signin::AccessTokenInfo& access_token_info) { // Do not use StringPiece with StringPrintf, see crbug/1444165 - return base::StrCat( - {supervised_user::kAuthorizationHeader, " ", access_token_info.token}); + return base::StrCat({kAuthorizationHeader, " ", access_token_info.token}); +} + +// Determines the response type. See go/system-parameters to see list of +// possible One Platform system params. +constexpr base::StringPiece kSystemParameters("alt=proto"); + +// Creates a requests for kids management api which is independent from the +// current profile (doesn't take Profile* parameter). It also adds query +// parameter that configures the remote endpoint to respond with a protocol +// buffer message. +GURL CreateRequestUrl(const FetcherConfig& config) { + return GURL(config.service_endpoint) + .Resolve(base::StrCat({config.service_path, "?", kSystemParameters})); } // TODO(b/276898959): Support payload for POST requests. std::unique_ptr<network::SimpleURLLoader> InitializeSimpleUrlLoader( const signin::AccessTokenInfo access_token_info, - const supervised_user::FetcherConfig& fetcher_config, + const FetcherConfig& fetcher_config, const GURL& url) { std::unique_ptr<ResourceRequest> resource_request = std::make_unique<ResourceRequest>(); @@ -110,20 +124,21 @@ // A fetcher with underlying network::SharedURLLoaderFactory. // Internally, it's a two-phase process: first the access token is fetched, and // if applicable, the remote service is called and the response is processed. -template <typename Request, typename Response> -class FetcherImpl final : public KidsExternalFetcher<Request, Response> { +template <typename Response> +class FetcherImpl final : public ProtoFetcher<Response> { private: - using Callback = typename KidsExternalFetcher<Request, Response>::Callback; + using Callback = typename ProtoFetcher<Response>::Callback; public: FetcherImpl() = delete; explicit FetcherImpl( IdentityManager& identity_manager, scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory, - const supervised_user::FetcherConfig& fetcher_config, + const google::protobuf::MessageLite& request, + const FetcherConfig& fetcher_config, Callback callback) - : config_(fetcher_config) { - access_token_fetcher_ = std::make_unique<KidsAccessTokenFetcher>( + : payload_(request.SerializeAsString()), config_(fetcher_config) { + access_token_fetcher_ = std::make_unique<ApiAccessTokenFetcher>( identity_manager, BindOnce(&FetcherImpl::OnAccessTokenFetchComplete, Unretained(this), url_loader_factory, @@ -136,8 +151,7 @@ FetcherImpl& operator=(const FetcherImpl&) = delete; private: - void RecordStabilityMetrics(TimeDelta latency, - KidsExternalFetcherStatus status) { + void RecordStabilityMetrics(TimeDelta latency, ProtoFetcherStatus status) { UmaHistogramEnumeration(GetMetricKey("Status"), status.state()); UmaHistogramTimes(GetMetricKey("Latency"), latency); UmaHistogramTimes(GetMetricKey("Latency", status.ToMetricEnumLabel()), @@ -146,14 +160,13 @@ void WrapCallbackWithMetrics(Callback callback, TimeTicks start_time, - KidsExternalFetcherStatus status, + ProtoFetcherStatus status, std::unique_ptr<Response> response) { TimeDelta latency = TimeTicks::Now() - start_time; RecordStabilityMetrics(latency, status); // Record additional metrics for various failures. - if (status.state() == - KidsExternalFetcherStatus::State::HTTP_STATUS_OR_NET_ERROR) { + if (status.state() == ProtoFetcherStatus::State::HTTP_STATUS_OR_NET_ERROR) { UmaHistogramSparse(GetMetricKey("HttpStatusOrNetError"), status.http_status_or_net_error().value()); } @@ -187,16 +200,14 @@ if (!access_token.has_value()) { std::move(callback_with_metrics) - .Run(KidsExternalFetcherStatus::GoogleServiceAuthError( - access_token.error()), + .Run(ProtoFetcherStatus::GoogleServiceAuthError(access_token.error()), std::make_unique<Response>()); return; } // TODO(b/276898959): add optional payload for POST requests. simple_url_loader_ = InitializeSimpleUrlLoader( - access_token.value(), config_, - supervised_user::CreateRequestUrl<Request>(config_)); + access_token.value(), config_, CreateRequestUrl(config_)); simple_url_loader_->DownloadToStringOfUnboundedSizeUntilCrashAndDie( url_loader_factory.get(), @@ -212,7 +223,7 @@ std::unique_ptr<std::string> response_body) { if (!IsLoadingSuccessful(*simple_url_loader_) || !HasHttpOkResponse(*simple_url_loader_)) { - std::move(callback).Run(KidsExternalFetcherStatus::HttpStatusOrNetError( + std::move(callback).Run(ProtoFetcherStatus::HttpStatusOrNetError( HttpStatusOrNetError(*simple_url_loader_)), nullptr); return; @@ -220,71 +231,69 @@ std::unique_ptr<Response> response = std::make_unique<Response>(); if (!response->ParseFromString(*response_body)) { - std::move(callback).Run(KidsExternalFetcherStatus::InvalidResponse(), - nullptr); + std::move(callback).Run(ProtoFetcherStatus::InvalidResponse(), nullptr); return; } - CHECK(response) << "KidsExternalFetcherStatus::Ok implies non-empty " - "response (which is always a valid message)."; - std::move(callback).Run(std::move(KidsExternalFetcherStatus::Ok()), + CHECK(response) << "ProtoFetcherStatus::Ok implies non-empty response " + "(which is always a valid message)."; + std::move(callback).Run(std::move(ProtoFetcherStatus::Ok()), std::move(response)); } - std::unique_ptr<KidsAccessTokenFetcher> access_token_fetcher_; + std::unique_ptr<ApiAccessTokenFetcher> access_token_fetcher_; std::unique_ptr<network::SimpleURLLoader> simple_url_loader_; - const supervised_user::FetcherConfig config_; + const std::string payload_; + const FetcherConfig config_; }; } // namespace // Main constructor, referenced by the rest. -KidsExternalFetcherStatus::KidsExternalFetcherStatus( +ProtoFetcherStatus::ProtoFetcherStatus( State state, class GoogleServiceAuthError google_service_auth_error) : state_(state), google_service_auth_error_(google_service_auth_error) {} -KidsExternalFetcherStatus::~KidsExternalFetcherStatus() = default; +ProtoFetcherStatus::~ProtoFetcherStatus() = default; -KidsExternalFetcherStatus::KidsExternalFetcherStatus(State state) - : state_(state) { +ProtoFetcherStatus::ProtoFetcherStatus(State state) : state_(state) { DCHECK(state != State::GOOGLE_SERVICE_AUTH_ERROR); } -KidsExternalFetcherStatus::KidsExternalFetcherStatus( +ProtoFetcherStatus::ProtoFetcherStatus( HttpStatusOrNetErrorType http_status_or_net_error) : state_(State::HTTP_STATUS_OR_NET_ERROR), http_status_or_net_error_(http_status_or_net_error) {} -KidsExternalFetcherStatus::KidsExternalFetcherStatus( +ProtoFetcherStatus::ProtoFetcherStatus( class GoogleServiceAuthError google_service_auth_error) - : KidsExternalFetcherStatus(GOOGLE_SERVICE_AUTH_ERROR, - google_service_auth_error) {} - -KidsExternalFetcherStatus::KidsExternalFetcherStatus( - const KidsExternalFetcherStatus& other) = default; -KidsExternalFetcherStatus& KidsExternalFetcherStatus::operator=( - const KidsExternalFetcherStatus& other) = default; - -KidsExternalFetcherStatus KidsExternalFetcherStatus::Ok() { - return KidsExternalFetcherStatus(State::OK); + : ProtoFetcherStatus(GOOGLE_SERVICE_AUTH_ERROR, google_service_auth_error) { } -KidsExternalFetcherStatus KidsExternalFetcherStatus::GoogleServiceAuthError( + +ProtoFetcherStatus::ProtoFetcherStatus(const ProtoFetcherStatus& other) = + default; +ProtoFetcherStatus& ProtoFetcherStatus::operator=( + const ProtoFetcherStatus& other) = default; + +ProtoFetcherStatus ProtoFetcherStatus::Ok() { + return ProtoFetcherStatus(State::OK); +} +ProtoFetcherStatus ProtoFetcherStatus::GoogleServiceAuthError( class GoogleServiceAuthError error) { - return KidsExternalFetcherStatus(error); + return ProtoFetcherStatus(error); } -KidsExternalFetcherStatus KidsExternalFetcherStatus::HttpStatusOrNetError( +ProtoFetcherStatus ProtoFetcherStatus::HttpStatusOrNetError( int http_status_or_net_error) { - return KidsExternalFetcherStatus( - HttpStatusOrNetErrorType(http_status_or_net_error)); + return ProtoFetcherStatus(HttpStatusOrNetErrorType(http_status_or_net_error)); } -KidsExternalFetcherStatus KidsExternalFetcherStatus::InvalidResponse() { - return KidsExternalFetcherStatus(State::INVALID_RESPONSE); +ProtoFetcherStatus ProtoFetcherStatus::InvalidResponse() { + return ProtoFetcherStatus(State::INVALID_RESPONSE); } -KidsExternalFetcherStatus KidsExternalFetcherStatus::DataError() { - return KidsExternalFetcherStatus(State::DATA_ERROR); +ProtoFetcherStatus ProtoFetcherStatus::DataError() { + return ProtoFetcherStatus(State::DATA_ERROR); } -bool KidsExternalFetcherStatus::IsOk() const { +bool ProtoFetcherStatus::IsOk() const { return state_ == State::OK; } -bool KidsExternalFetcherStatus::IsTransientError() const { +bool ProtoFetcherStatus::IsTransientError() const { if (state_ == State::HTTP_STATUS_OR_NET_ERROR) { return true; } @@ -293,7 +302,7 @@ } return false; } -bool KidsExternalFetcherStatus::IsPersistentError() const { +bool ProtoFetcherStatus::IsPersistentError() const { if (state_ == State::INVALID_RESPONSE) { return true; } @@ -306,71 +315,70 @@ return false; } -std::string KidsExternalFetcherStatus::ToString() const { +std::string ProtoFetcherStatus::ToString() const { switch (state_) { - case KidsExternalFetcherStatus::OK: - return "KidsExternalFetcherStatus::OK"; - case KidsExternalFetcherStatus::GOOGLE_SERVICE_AUTH_ERROR: - return base::StrCat( - {"KidsExternalFetcherStatus::GOOGLE_SERVICE_AUTH_ERROR: ", - google_service_auth_error().ToString()}); - case KidsExternalFetcherStatus::HTTP_STATUS_OR_NET_ERROR: + case ProtoFetcherStatus::OK: + return "ProtoFetcherStatus::OK"; + case ProtoFetcherStatus::GOOGLE_SERVICE_AUTH_ERROR: + return base::StrCat({"ProtoFetcherStatus::GOOGLE_SERVICE_AUTH_ERROR: ", + google_service_auth_error().ToString()}); + case ProtoFetcherStatus::HTTP_STATUS_OR_NET_ERROR: return base::StringPrintf( - "KidsExternalFetcherStatus::HTTP_STATUS_OR_NET_ERROR: %d", + "ProtoFetcherStatus::HTTP_STATUS_OR_NET_ERROR: %d", http_status_or_net_error_.value()); - case KidsExternalFetcherStatus::INVALID_RESPONSE: - return "KidsExternalFetcherStatus::INVALID_RESPONSE"; - case KidsExternalFetcherStatus::DATA_ERROR: - return "KidsExternalFetcherStatus::DATA_ERROR"; + case ProtoFetcherStatus::INVALID_RESPONSE: + return "ProtoFetcherStatus::INVALID_RESPONSE"; + case ProtoFetcherStatus::DATA_ERROR: + return "ProtoFetcherStatus::DATA_ERROR"; } } // The returned value must match one of the labels in -// chromium/src/tools/metrics/histograms/enums.xml://enum[@name='KidsExternalFetcherStatus'], +// chromium/src/tools/metrics/histograms/enums.xml://enum[@name='ProtoFetcherStatus'], // and should be reflected in tokens in histogram defined for this fetcher. // See example at // tools/metrics/histograms/metadata/signin/histograms.xml://histogram[@name='Signin.ListFamilyMembersRequest.{Status}.*'] -std::string KidsExternalFetcherStatus::ToMetricEnumLabel() const { +std::string ProtoFetcherStatus::ToMetricEnumLabel() const { switch (state_) { - case KidsExternalFetcherStatus::OK: + case ProtoFetcherStatus::OK: return "NoError"; - case KidsExternalFetcherStatus::GOOGLE_SERVICE_AUTH_ERROR: + case ProtoFetcherStatus::GOOGLE_SERVICE_AUTH_ERROR: return "AuthError"; - case KidsExternalFetcherStatus::HTTP_STATUS_OR_NET_ERROR: + case ProtoFetcherStatus::HTTP_STATUS_OR_NET_ERROR: return "HttpStatusOrNetError"; - case KidsExternalFetcherStatus::INVALID_RESPONSE: + case ProtoFetcherStatus::INVALID_RESPONSE: return "ParseError"; - case KidsExternalFetcherStatus::DATA_ERROR: + case ProtoFetcherStatus::DATA_ERROR: return "DataError"; } } -KidsExternalFetcherStatus::State KidsExternalFetcherStatus::state() const { +ProtoFetcherStatus::State ProtoFetcherStatus::state() const { return state_; } -KidsExternalFetcherStatus::HttpStatusOrNetErrorType -KidsExternalFetcherStatus::http_status_or_net_error() const { +ProtoFetcherStatus::HttpStatusOrNetErrorType +ProtoFetcherStatus::http_status_or_net_error() const { return http_status_or_net_error_; } -const GoogleServiceAuthError& -KidsExternalFetcherStatus::google_service_auth_error() const { +const GoogleServiceAuthError& ProtoFetcherStatus::google_service_auth_error() + const { return google_service_auth_error_; } // Fetcher factories. -std::unique_ptr< - KidsExternalFetcher<kids_chrome_management::ListFamilyMembersRequest, - kids_chrome_management::ListFamilyMembersResponse>> +std::unique_ptr<ProtoFetcher<kids_chrome_management::ListFamilyMembersResponse>> FetchListFamilyMembers( IdentityManager& identity_manager, scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory, - KidsExternalFetcher< - kids_chrome_management::ListFamilyMembersRequest, - kids_chrome_management::ListFamilyMembersResponse>::Callback callback, - const supervised_user::FetcherConfig& config) { + ProtoFetcher<kids_chrome_management::ListFamilyMembersResponse>::Callback + callback, + const FetcherConfig& config) { return std::make_unique< - FetcherImpl<kids_chrome_management::ListFamilyMembersRequest, - kids_chrome_management::ListFamilyMembersResponse>>( - identity_manager, url_loader_factory, config, std::move(callback)); + FetcherImpl<kids_chrome_management::ListFamilyMembersResponse>>( + identity_manager, url_loader_factory, + kids_chrome_management::ListFamilyMembersRequest(), config, + std::move(callback)); } + +} // namespace supervised_user
diff --git a/components/supervised_user/core/browser/kids_external_fetcher.h b/components/supervised_user/core/browser/proto_fetcher.h similarity index 66% rename from components/supervised_user/core/browser/kids_external_fetcher.h rename to components/supervised_user/core/browser/proto_fetcher.h index b8f4b18..dd4d66d 100644 --- a/components/supervised_user/core/browser/kids_external_fetcher.h +++ b/components/supervised_user/core/browser/proto_fetcher.h
@@ -2,8 +2,8 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef COMPONENTS_SUPERVISED_USER_CORE_BROWSER_KIDS_EXTERNAL_FETCHER_H_ -#define COMPONENTS_SUPERVISED_USER_CORE_BROWSER_KIDS_EXTERNAL_FETCHER_H_ +#ifndef COMPONENTS_SUPERVISED_USER_CORE_BROWSER_PROTO_FETCHER_H_ +#define COMPONENTS_SUPERVISED_USER_CORE_BROWSER_PROTO_FETCHER_H_ #include <string> @@ -12,17 +12,18 @@ #include "base/strings/string_piece.h" #include "base/types/strong_alias.h" #include "components/signin/public/identity_manager/identity_manager.h" -#include "components/supervised_user/core/browser/kids_external_fetcher_config.h" +#include "components/supervised_user/core/browser/fetcher_config.h" #include "components/supervised_user/core/browser/proto/kidschromemanagement_messages.pb.h" #include "google_apis/gaia/google_service_auth_error.h" #include "services/network/public/cpp/shared_url_loader_factory.h" #include "url/gurl.h" +namespace supervised_user { // ----------------------------------------------------------------------------- // Usage documentation // ----------------------------------------------------------------------------- // -// Overview: KidsExternalFetcher provides an interface for generic fetchers that +// Overview: ProtoFetcher provides an interface for generic fetchers that // use classes to represent Request and Response objects. The default mechanism // under the hood takes care of the fetch process, including: // * obtaining the right access token, @@ -30,19 +31,18 @@ // * submitting metrics. // // If you want to create new fetcher factory method, then some -// details must be provided in order to enable fetching for said <Request, -// Response> pair. The new fetcher factory should have at least the following -// arguments: signin::IdentityManager, network::SharedURLLoaderFactory, -// consuming callback and must reference a static configuration. +// details must be provided in order to enable fetching for said Response. The +// new fetcher factory should have at least the following arguments: +// signin::IdentityManager, network::SharedURLLoaderFactory, consuming callback +// and must reference a static configuration. // -// The static configuration should be placed in the -// kids_external_fetcher_config.h module. +// The static configuration should be placed in the fetcher_config.h module. // Holds the status of the fetch. The callback's response will be set iff the // status is ok. // These values are persisted to logs. Entries should not be renumbered and // numeric values should never be reused. -class KidsExternalFetcherStatus { +class ProtoFetcherStatus { public: using HttpStatusOrNetErrorType = base::StrongAlias<class HttpStatusOrNetErrorTag, int>; @@ -65,26 +65,25 @@ // Status might be used in base::expected context as possible error, since it // contains two error-enabled attributes which are copyable / assignable. - KidsExternalFetcherStatus(const KidsExternalFetcherStatus&); - KidsExternalFetcherStatus& operator=(const KidsExternalFetcherStatus&); + ProtoFetcherStatus(const ProtoFetcherStatus&); + ProtoFetcherStatus& operator=(const ProtoFetcherStatus&); - ~KidsExternalFetcherStatus(); - KidsExternalFetcherStatus() = delete; + ~ProtoFetcherStatus(); + ProtoFetcherStatus() = delete; - // Convenience creators instead of exposing KidsExternalFetcherStatus(State - // state). - static KidsExternalFetcherStatus Ok(); - static KidsExternalFetcherStatus GoogleServiceAuthError( + // Convenience creators instead of exposing ProtoFetcherStatus(State state). + static ProtoFetcherStatus Ok(); + static ProtoFetcherStatus GoogleServiceAuthError( GoogleServiceAuthError error); // The copy follows the interface of // https://source.chromium.org/chromium/chromium/src/+/main:components/signin/public/identity_manager/primary_account_access_token_fetcher.h;l=241;drc=8ba1bad80dc22235693a0dd41fe55c0fd2dbdabd - static KidsExternalFetcherStatus HttpStatusOrNetError( + static ProtoFetcherStatus HttpStatusOrNetError( int value = 0); // Either net::Error (negative numbers, 0 denotes // success) or HTTP status. - static KidsExternalFetcherStatus InvalidResponse(); - static KidsExternalFetcherStatus DataError(); + static ProtoFetcherStatus InvalidResponse(); + static ProtoFetcherStatus DataError(); - // KidsExternalFetcherStatus::IsOk iff google_service_auth_error_.state() == + // ProtoFetcherStatus::IsOk iff google_service_auth_error_.state() == // NONE and state_ == NONE bool IsOk() const; // Indicates whether the status is not ok, but is worth retrying because it @@ -106,16 +105,15 @@ private: // Disallows impossible states. - explicit KidsExternalFetcherStatus(State state); - explicit KidsExternalFetcherStatus( + explicit ProtoFetcherStatus(State state); + explicit ProtoFetcherStatus( HttpStatusOrNetErrorType http_status_or_net_error); - explicit KidsExternalFetcherStatus( + explicit ProtoFetcherStatus( class GoogleServiceAuthError google_service_auth_error); // Implies State == // GOOGLE_SERVICE_AUTH_ERROR - KidsExternalFetcherStatus( - State state, - class GoogleServiceAuthError google_service_auth_error); + ProtoFetcherStatus(State state, + class GoogleServiceAuthError google_service_auth_error); State state_; HttpStatusOrNetErrorType http_status_or_net_error_{ @@ -126,26 +124,24 @@ // Use instance of Fetcher to start request and write the result onto the // receiving delegate. Every instance of Fetcher is disposable and should be // used only once. -template <typename Request, typename Response> -class KidsExternalFetcher { +template <typename Response> +class ProtoFetcher { public: - using Callback = base::OnceCallback<void(KidsExternalFetcherStatus, - std::unique_ptr<Response>)>; - virtual ~KidsExternalFetcher() = default; + using Callback = + base::OnceCallback<void(ProtoFetcherStatus, std::unique_ptr<Response>)>; + virtual ~ProtoFetcher() = default; }; // Creates a disposable instance of an access token consumer that will fetch // list of family members. -std::unique_ptr< - KidsExternalFetcher<kids_chrome_management::ListFamilyMembersRequest, - kids_chrome_management::ListFamilyMembersResponse>> +std::unique_ptr<ProtoFetcher<kids_chrome_management::ListFamilyMembersResponse>> FetchListFamilyMembers( signin::IdentityManager& identity_manager, scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory, - KidsExternalFetcher< - kids_chrome_management::ListFamilyMembersRequest, - kids_chrome_management::ListFamilyMembersResponse>::Callback callback, - const supervised_user::FetcherConfig& config = - supervised_user::kListFamilyMembersConfig); + ProtoFetcher<kids_chrome_management::ListFamilyMembersResponse>::Callback + callback, + const FetcherConfig& config = kListFamilyMembersConfig); -#endif // COMPONENTS_SUPERVISED_USER_CORE_BROWSER_KIDS_EXTERNAL_FETCHER_H_ +} // namespace supervised_user + +#endif // COMPONENTS_SUPERVISED_USER_CORE_BROWSER_PROTO_FETCHER_H_
diff --git a/components/supervised_user/core/browser/kids_external_fetcher_unittest.cc b/components/supervised_user/core/browser/proto_fetcher_unittest.cc similarity index 74% rename from components/supervised_user/core/browser/kids_external_fetcher_unittest.cc rename to components/supervised_user/core/browser/proto_fetcher_unittest.cc index c48aa17..34382770 100644 --- a/components/supervised_user/core/browser/kids_external_fetcher_unittest.cc +++ b/components/supervised_user/core/browser/proto_fetcher_unittest.cc
@@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "components/supervised_user/core/browser/kids_external_fetcher.h" +#include "components/supervised_user/core/browser/proto_fetcher.h" #include <memory> #include <string> @@ -12,8 +12,8 @@ #include "base/time/time.h" #include "base/types/expected.h" #include "components/signin/public/identity_manager/identity_test_environment.h" +#include "components/supervised_user/core/browser/fetcher_config.h" #include "components/supervised_user/core/browser/fetcher_config_test_utils.h" -#include "components/supervised_user/core/browser/kids_external_fetcher_config.h" #include "components/supervised_user/core/browser/proto/kidschromemanagement_messages.pb.h" #include "google_apis/gaia/google_service_auth_error.h" #include "net/base/net_errors.h" @@ -25,6 +25,7 @@ #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" +namespace supervised_user { namespace { using ::base::BindOnce; @@ -36,16 +37,13 @@ using ::network::TestURLLoaderFactory; using ::signin::ConsentLevel; using ::signin::IdentityTestEnvironment; -using ::supervised_user::FetcherConfig; -using ::supervised_user::FetcherTestConfigBuilder; using ::testing::Test; -// Tests the Kids External API fetchers functionality. -class KidsExternalFetcherTest : public Test { +// Tests the kidsmanagement/v1 proto client. +class ProtoFetcherTest : public Test { protected: FetcherConfig test_fetcher_config_ = - FetcherTestConfigBuilder::FromConfig( - supervised_user::kListFamilyMembersConfig) + FetcherTestConfigBuilder::FromConfig(kListFamilyMembersConfig) .WithServiceEndpoint("http://example.com") .Build(); network::TestURLLoaderFactory test_url_loader_factory_; @@ -53,15 +51,15 @@ IdentityTestEnvironment identity_test_env_; }; -template <typename Request, typename Response> +template <typename Response> class Receiver { public: - const base::expected<std::unique_ptr<Response>, KidsExternalFetcherStatus>& + const base::expected<std::unique_ptr<Response>, ProtoFetcherStatus>& GetResult() const { return result_; } - void Receive(KidsExternalFetcherStatus fetch_status, + void Receive(ProtoFetcherStatus fetch_status, std::unique_ptr<Response> response) { if (!fetch_status.IsOk()) { result_ = base::unexpected(fetch_status); @@ -71,20 +69,19 @@ } private: - base::expected<std::unique_ptr<Response>, KidsExternalFetcherStatus> result_; + base::expected<std::unique_ptr<Response>, ProtoFetcherStatus> result_; }; -TEST_F(KidsExternalFetcherTest, AcceptsRequests) { +TEST_F(ProtoFetcherTest, AcceptsRequests) { AccountInfo account = identity_test_env_.MakePrimaryAccountAvailable( "bob@gmail.com", ConsentLevel::kSignin); - Receiver<ListFamilyMembersRequest, ListFamilyMembersResponse> receiver; + Receiver<ListFamilyMembersResponse> receiver; ListFamilyMembersResponse response; auto fetcher = FetchListFamilyMembers( *identity_test_env_.identity_manager(), test_url_loader_factory_.GetSafeWeakWrapper(), - BindOnce(&Receiver<ListFamilyMembersRequest, - ListFamilyMembersResponse>::Receive, + BindOnce(&Receiver<ListFamilyMembersResponse>::Receive, base::Unretained(&receiver)), test_fetcher_config_); identity_test_env_.WaitForAccessTokenRequestIfNecessaryAndRespondWithToken( @@ -102,16 +99,15 @@ ASSERT_TRUE(receiver.GetResult().has_value()); } -TEST_F(KidsExternalFetcherTest, NoAccessToken) { +TEST_F(ProtoFetcherTest, NoAccessToken) { AccountInfo account = identity_test_env_.MakePrimaryAccountAvailable( "bob@gmail.com", ConsentLevel::kSignin); - Receiver<ListFamilyMembersRequest, ListFamilyMembersResponse> receiver; + Receiver<ListFamilyMembersResponse> receiver; auto fetcher = FetchListFamilyMembers( *identity_test_env_.identity_manager(), test_url_loader_factory_.GetSafeWeakWrapper(), - BindOnce(&Receiver<ListFamilyMembersRequest, - ListFamilyMembersResponse>::Receive, + BindOnce(&Receiver<ListFamilyMembersResponse>::Receive, base::Unretained(&receiver)), test_fetcher_config_); identity_test_env_.WaitForAccessTokenRequestIfNecessaryAndRespondWithError( @@ -120,21 +116,20 @@ EXPECT_EQ(test_url_loader_factory_.NumPending(), 0); EXPECT_EQ(receiver.GetResult().error().state(), - KidsExternalFetcherStatus::State::GOOGLE_SERVICE_AUTH_ERROR); + ProtoFetcherStatus::State::GOOGLE_SERVICE_AUTH_ERROR); EXPECT_EQ(receiver.GetResult().error().google_service_auth_error().state(), GoogleServiceAuthError::State::INVALID_GAIA_CREDENTIALS); } -TEST_F(KidsExternalFetcherTest, HandlesMalformedResponse) { +TEST_F(ProtoFetcherTest, HandlesMalformedResponse) { AccountInfo account = identity_test_env_.MakePrimaryAccountAvailable( "bob@gmail.com", ConsentLevel::kSignin); - Receiver<ListFamilyMembersRequest, ListFamilyMembersResponse> receiver; + Receiver<ListFamilyMembersResponse> receiver; auto fetcher = FetchListFamilyMembers( *identity_test_env_.identity_manager(), test_url_loader_factory_.GetSafeWeakWrapper(), - BindOnce(&Receiver<ListFamilyMembersRequest, - ListFamilyMembersResponse>::Receive, + BindOnce(&Receiver<ListFamilyMembersResponse>::Receive, base::Unretained(&receiver)), test_fetcher_config_); identity_test_env_.WaitForAccessTokenRequestIfNecessaryAndRespondWithToken( @@ -152,21 +147,20 @@ pending_request->request.url.spec(), malformed_value); EXPECT_FALSE(receiver.GetResult().has_value()); EXPECT_EQ(receiver.GetResult().error().state(), - KidsExternalFetcherStatus::State::INVALID_RESPONSE); + ProtoFetcherStatus::State::INVALID_RESPONSE); } // crbug/1444165: Do not use StringPrintf with StringPiece, c-strings are // expected. -TEST_F(KidsExternalFetcherTest, CreatesToken) { +TEST_F(ProtoFetcherTest, CreatesToken) { AccountInfo account = identity_test_env_.MakePrimaryAccountAvailable( "bob@gmail.com", ConsentLevel::kSignin); - Receiver<ListFamilyMembersRequest, ListFamilyMembersResponse> receiver; + Receiver<ListFamilyMembersResponse> receiver; auto fetcher = FetchListFamilyMembers( *identity_test_env_.identity_manager(), test_url_loader_factory_.GetSafeWeakWrapper(), - BindOnce(&Receiver<ListFamilyMembersRequest, - ListFamilyMembersResponse>::Receive, + BindOnce(&Receiver<ListFamilyMembersResponse>::Receive, base::Unretained(&receiver)), test_fetcher_config_); @@ -185,16 +179,15 @@ EXPECT_EQ(authorization_header, "Bearer token"); } -TEST_F(KidsExternalFetcherTest, HandlesServerError) { +TEST_F(ProtoFetcherTest, HandlesServerError) { AccountInfo account = identity_test_env_.MakePrimaryAccountAvailable( "bob@gmail.com", ConsentLevel::kSignin); - Receiver<ListFamilyMembersRequest, ListFamilyMembersResponse> receiver; + Receiver<ListFamilyMembersResponse> receiver; auto fetcher = FetchListFamilyMembers( *identity_test_env_.identity_manager(), test_url_loader_factory_.GetSafeWeakWrapper(), - BindOnce(&Receiver<ListFamilyMembersRequest, - ListFamilyMembersResponse>::Receive, + BindOnce(&Receiver<ListFamilyMembersResponse>::Receive, base::Unretained(&receiver)), test_fetcher_config_); @@ -213,10 +206,11 @@ net::HTTP_BAD_REQUEST); EXPECT_FALSE(receiver.GetResult().has_value()); EXPECT_EQ(receiver.GetResult().error().state(), - KidsExternalFetcherStatus::State::HTTP_STATUS_OR_NET_ERROR); - EXPECT_EQ(receiver.GetResult().error().http_status_or_net_error(), - KidsExternalFetcherStatus::HttpStatusOrNetErrorType( - net::HTTP_BAD_REQUEST)); + ProtoFetcherStatus::State::HTTP_STATUS_OR_NET_ERROR); + EXPECT_EQ( + receiver.GetResult().error().http_status_or_net_error(), + ProtoFetcherStatus::HttpStatusOrNetErrorType(net::HTTP_BAD_REQUEST)); } } // namespace +} // namespace supervised_user
diff --git a/components/supervised_user/core/browser/supervised_user_error_page_unittest.cc b/components/supervised_user/core/browser/supervised_user_error_page_unittest.cc index b6443abc..d6148ca 100644 --- a/components/supervised_user/core/browser/supervised_user_error_page_unittest.cc +++ b/components/supervised_user/core/browser/supervised_user_error_page_unittest.cc
@@ -4,6 +4,7 @@ #include "components/supervised_user/core/browser/supervised_user_error_page.h" +#include "base/memory/raw_ptr_exclusion.h" #include "base/strings/utf_string_conversions.h" #include "base/test/scoped_feature_list.h" #include "components/grit/components_resources.h" @@ -57,12 +58,14 @@ struct BuildHtmlTestParameter { bool allow_access_requests; - const std::string& profile_image_url; - const std::string& profile_image_url2; - const std::string& custodian; - const std::string& custodian_email; - const std::string& second_custodian; - const std::string& second_custodian_email; + // These fields are not a raw_ref<> because they were filtered by the rewriter + // for: #constexpr-ctor-field-initializer, global-scope + RAW_PTR_EXCLUSION const std::string& profile_image_url; + RAW_PTR_EXCLUSION const std::string& profile_image_url2; + RAW_PTR_EXCLUSION const std::string& custodian; + RAW_PTR_EXCLUSION const std::string& custodian_email; + RAW_PTR_EXCLUSION const std::string& second_custodian; + RAW_PTR_EXCLUSION const std::string& second_custodian_email; FilteringBehaviorReason reason; bool has_two_parents; bool is_web_filter_interstitial_refresh_enabled;
diff --git a/components/sync_device_info/device_info_sync_bridge.cc b/components/sync_device_info/device_info_sync_bridge.cc index 4f3c19a..fe25228 100644 --- a/components/sync_device_info/device_info_sync_bridge.cc +++ b/components/sync_device_info/device_info_sync_bridge.cc
@@ -16,7 +16,6 @@ #include "base/functional/callback_helpers.h" #include "base/location.h" #include "base/logging.h" -#include "base/metrics/histogram_functions.h" #include "base/observer_list.h" #include "base/time/time.h" #include "components/sync/base/model_type.h" @@ -484,14 +483,9 @@ device_info_synced_callback_list_.clear(); } - if (has_tombstone_for_local_device) { - const bool should_reupload_device_info = !reuploaded_on_tombstone_; - base::UmaHistogramBoolean("Sync.LocalDeviceInfoDeletionReuploaded", - should_reupload_device_info); - if (should_reupload_device_info) { - SendLocalData(); - reuploaded_on_tombstone_ = true; - } + if (has_tombstone_for_local_device && !reuploaded_on_tombstone_) { + SendLocalData(); + reuploaded_on_tombstone_ = true; } return absl::nullopt;
diff --git a/components/user_education/views/help_bubble_view.cc b/components/user_education/views/help_bubble_view.cc index 0981746..a523680c 100644 --- a/components/user_education/views/help_bubble_view.cc +++ b/components/user_education/views/help_bubble_view.cc
@@ -673,12 +673,6 @@ GetWidget()->Close(); } -bool HelpBubbleView::OnMousePressed(const ui::MouseEvent& event) { - base::RecordAction( - base::UserMetricsAction("InProductHelp.Promos.BubbleClicked")); - return false; -} - std::u16string HelpBubbleView::GetAccessibleWindowTitle() const { std::u16string result = accessible_name_;
diff --git a/components/user_education/views/help_bubble_view.h b/components/user_education/views/help_bubble_view.h index 7b6e2dc2..9bc3cae 100644 --- a/components/user_education/views/help_bubble_view.h +++ b/components/user_education/views/help_bubble_view.h
@@ -22,10 +22,6 @@ #include "ui/views/bubble/bubble_dialog_delegate_view.h" #include "ui/views/controls/button/label_button.h" -namespace ui { -class MouseEvent; -} // namespace ui - namespace views { class ImageView; class Label; @@ -85,7 +81,6 @@ protected: // BubbleDialogDelegateView: - bool OnMousePressed(const ui::MouseEvent& event) override; std::u16string GetAccessibleWindowTitle() const override; void OnWidgetActivationChanged(views::Widget* widget, bool active) override; void OnThemeChanged() override;
diff --git a/components/viz/common/BUILD.gn b/components/viz/common/BUILD.gn index 1f604cf5e..fcfa2d6f8 100644 --- a/components/viz/common/BUILD.gn +++ b/components/viz/common/BUILD.gn
@@ -45,6 +45,8 @@ "resources/resource_format_utils.cc", "resources/resource_format_utils.h", "resources/resource_sizes.h", + "resources/shared_image_format_utils.cc", + "resources/shared_image_format_utils.h", "viz_resource_format_export.h", ]
diff --git a/components/viz/common/resources/resource_format_utils.cc b/components/viz/common/resources/resource_format_utils.cc index bdf9c42..869dc84 100644 --- a/components/viz/common/resources/resource_format_utils.cc +++ b/components/viz/common/resources/resource_format_utils.cc
@@ -18,78 +18,6 @@ namespace viz { -SkColorType ToClosestSkColorType(bool gpu_compositing, - SharedImageFormat format) { - CHECK(format.is_single_plane()); - - if (!gpu_compositing) { - // TODO(crbug.com/986405): Remove this assumption and have clients tag - // resources with the correct format. - // In software compositing we lazily use RGBA_8888 throughout the system, - // but actual pixel encodings are the native skia bit ordering, which can be - // RGBA or BGRA. - return kN32_SkColorType; - } - - switch (format.resource_format()) { - case RGBA_4444: - return kARGB_4444_SkColorType; - case RGBA_8888: - return kRGBA_8888_SkColorType; - case BGRA_8888: - return kBGRA_8888_SkColorType; - case ALPHA_8: - return kAlpha_8_SkColorType; - case BGR_565: - case RGB_565: - return kRGB_565_SkColorType; - case LUMINANCE_8: - return kGray_8_SkColorType; - case RGBX_8888: - case BGRX_8888: - case ETC1: - return kRGB_888x_SkColorType; - case P010: -#if BUILDFLAG(IS_APPLE) - DLOG(ERROR) << "Sampling of P010 resources must be done per-plane."; -#endif - return kRGBA_1010102_SkColorType; - case RGBA_1010102: - // This intentionally returns kRGBA_1010102_SkColorType for BGRA_1010102 - // even though kBGRA_1010102_SkColorType exists. It should only be used on - // macOS (outside of tests). - case BGRA_1010102: - return kRGBA_1010102_SkColorType; - - // YUV images are sampled as RGB. - case YVU_420: - case YUV_420_BIPLANAR: -#if BUILDFLAG(IS_APPLE) - DLOG(ERROR) << "Sampling of YUV_420 resources must be done per-plane."; -#endif - return kRGB_888x_SkColorType; - case YUVA_420_TRIPLANAR: -#if BUILDFLAG(IS_APPLE) - DLOG(ERROR) << "Sampling of YUVA_420 resources must be done per-plane."; -#endif - return kRGBA_8888_SkColorType; - case RED_8: - return kAlpha_8_SkColorType; - case R16_EXT: - return kA16_unorm_SkColorType; - case RG16_EXT: - return kR16G16_unorm_SkColorType; - // Use kN32_SkColorType if there is no corresponding SkColorType. - case LUMINANCE_F16: - return kN32_SkColorType; - case RG_88: - return kR8G8_unorm_SkColorType; - case RGBA_F16: - return kRGBA_F16_SkColorType; - } - NOTREACHED_NORETURN(); -} - ResourceFormat SkColorTypeToResourceFormat(SkColorType color_type) { switch (color_type) { case kARGB_4444_SkColorType: @@ -133,12 +61,6 @@ NOTREACHED_NORETURN(); } -SharedImageFormat SkColorTypeToSinglePlaneSharedImageFormat( - SkColorType color_type) { - return SharedImageFormat::SinglePlane( - SkColorTypeToResourceFormat(color_type)); -} - int BitsPerPixel(ResourceFormat format) { switch (format) { case RGBA_F16: @@ -553,55 +475,4 @@ } #endif -SkColorType ToClosestSkColorType(bool gpu_compositing, - SharedImageFormat format, - int plane_index) { - CHECK(format.IsValidPlaneIndex(plane_index)); - if (!gpu_compositing) { - // TODO(crbug.com/986405): Remove this assumption and have clients tag - // resources with the correct format. - // In software compositing we lazily use RGBA_8888 throughout the system, - // but actual pixel encodings are the native skia bit ordering, which can be - // RGBA or BGRA. - return kN32_SkColorType; - } - if (format.is_single_plane()) { - return ToClosestSkColorType(gpu_compositing, format); - } - - auto plane_config = format.plane_config(); - auto channel_format = format.channel_format(); - if (format.PrefersExternalSampler()) { - switch (channel_format) { - case SharedImageFormat::ChannelFormat::k8: - return plane_config == SharedImageFormat::PlaneConfig::kY_UV_A - ? kRGBA_8888_SkColorType - : kRGB_888x_SkColorType; - case SharedImageFormat::ChannelFormat::k10: - return kRGBA_1010102_SkColorType; - case SharedImageFormat::ChannelFormat::k16: - return kR16G16B16A16_unorm_SkColorType; - case SharedImageFormat::ChannelFormat::k16F: - return kRGBA_F16_SkColorType; - } - } else { - // No external sampling, format is per plane. - int num_channels = format.NumChannelsInPlane(plane_index); - DCHECK_GT(num_channels, 0); - DCHECK_LE(num_channels, 2); - switch (channel_format) { - case SharedImageFormat::ChannelFormat::k8: - return num_channels == 1 ? kAlpha_8_SkColorType - : kR8G8_unorm_SkColorType; - case SharedImageFormat::ChannelFormat::k10: - case SharedImageFormat::ChannelFormat::k16: - return num_channels == 1 ? kA16_unorm_SkColorType - : kR16G16_unorm_SkColorType; - case SharedImageFormat::ChannelFormat::k16F: - return num_channels == 1 ? kA16_float_SkColorType - : kR16G16_float_SkColorType; - } - } -} - } // namespace viz
diff --git a/components/viz/common/resources/resource_format_utils.h b/components/viz/common/resources/resource_format_utils.h index 94cf534..01d9250 100644 --- a/components/viz/common/resources/resource_format_utils.h +++ b/components/viz/common/resources/resource_format_utils.h
@@ -20,31 +20,10 @@ namespace viz { -// Returns the closest SkColorType for a given single planar `format`. -// -// NOTE: The formats BGRX_8888, BGR_565 and BGRA_1010102 return a SkColorType -// with R/G channels reversed. This is because from GPU perspective, GL format -// is always RGBA and there is no difference between RGBA/BGRA. Also, these -// formats should not be used for software SkImages/SkSurfaces. -VIZ_RESOURCE_FORMAT_EXPORT SkColorType -ToClosestSkColorType(bool gpu_compositing, SharedImageFormat format); - -// Returns the closest SkColorType for a given `format` and `plane_index`. For -// single planar formats (eg. RGBA) the plane_index must be zero and it's -// equivalent to calling function above. -VIZ_RESOURCE_FORMAT_EXPORT SkColorType -ToClosestSkColorType(bool gpu_compositing, - SharedImageFormat format, - int plane_index); - VIZ_RESOURCE_FORMAT_EXPORT int BitsPerPixel(ResourceFormat format); VIZ_RESOURCE_FORMAT_EXPORT ResourceFormat SkColorTypeToResourceFormat(SkColorType color_type); -// Returns the single-plane SharedImageFormat corresponding to `color_type.` -VIZ_RESOURCE_FORMAT_EXPORT SharedImageFormat -SkColorTypeToSinglePlaneSharedImageFormat(SkColorType color_type); - // The following functions use unsigned int instead of GLenum, since including // third_party/khronos/GLES2/gl2.h causes redefinition errors as // macros/functions defined in it conflict with macros/functions defined in
diff --git a/components/viz/common/resources/resource_format_utils_unittest.cc b/components/viz/common/resources/resource_format_utils_unittest.cc index 90a0026d..b5d3c0e 100644 --- a/components/viz/common/resources/resource_format_utils_unittest.cc +++ b/components/viz/common/resources/resource_format_utils_unittest.cc
@@ -5,6 +5,7 @@ #include <vector> #include "components/viz/common/resources/resource_format_utils.h" +#include "components/viz/common/resources/shared_image_format_utils.h" #include "testing/gtest/include/gtest/gtest.h" namespace viz {
diff --git a/components/viz/common/resources/shared_image_format_utils.cc b/components/viz/common/resources/shared_image_format_utils.cc new file mode 100644 index 0000000..65a9744 --- /dev/null +++ b/components/viz/common/resources/shared_image_format_utils.cc
@@ -0,0 +1,144 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "components/viz/common/resources/shared_image_format_utils.h" + +#include "base/check_op.h" +#include "base/logging.h" +#include "base/notreached.h" +#include "components/viz/common/resources/resource_format.h" +#include "components/viz/common/resources/resource_format_utils.h" + +namespace viz { + +SkColorType ToClosestSkColorType(bool gpu_compositing, + SharedImageFormat format) { + CHECK(format.is_single_plane()); + + if (!gpu_compositing) { + // TODO(crbug.com/986405): Remove this assumption and have clients tag + // resources with the correct format. + // In software compositing we lazily use RGBA_8888 throughout the system, + // but actual pixel encodings are the native skia bit ordering, which can be + // RGBA or BGRA. + return kN32_SkColorType; + } + + switch (format.resource_format()) { + case RGBA_4444: + return kARGB_4444_SkColorType; + case RGBA_8888: + return kRGBA_8888_SkColorType; + case BGRA_8888: + return kBGRA_8888_SkColorType; + case ALPHA_8: + return kAlpha_8_SkColorType; + case BGR_565: + case RGB_565: + return kRGB_565_SkColorType; + case LUMINANCE_8: + return kGray_8_SkColorType; + case RGBX_8888: + case BGRX_8888: + case ETC1: + return kRGB_888x_SkColorType; + case P010: +#if BUILDFLAG(IS_APPLE) + DLOG(ERROR) << "Sampling of P010 resources must be done per-plane."; +#endif + return kRGBA_1010102_SkColorType; + case RGBA_1010102: + // This intentionally returns kRGBA_1010102_SkColorType for BGRA_1010102 + // even though kBGRA_1010102_SkColorType exists. It should only be used on + // macOS (outside of tests). + case BGRA_1010102: + return kRGBA_1010102_SkColorType; + + // YUV images are sampled as RGB. + case YVU_420: + case YUV_420_BIPLANAR: +#if BUILDFLAG(IS_APPLE) + DLOG(ERROR) << "Sampling of YUV_420 resources must be done per-plane."; +#endif + return kRGB_888x_SkColorType; + case YUVA_420_TRIPLANAR: +#if BUILDFLAG(IS_APPLE) + DLOG(ERROR) << "Sampling of YUVA_420 resources must be done per-plane."; +#endif + return kRGBA_8888_SkColorType; + case RED_8: + return kAlpha_8_SkColorType; + case R16_EXT: + return kA16_unorm_SkColorType; + case RG16_EXT: + return kR16G16_unorm_SkColorType; + // Use kN32_SkColorType if there is no corresponding SkColorType. + case LUMINANCE_F16: + return kN32_SkColorType; + case RG_88: + return kR8G8_unorm_SkColorType; + case RGBA_F16: + return kRGBA_F16_SkColorType; + } + NOTREACHED_NORETURN(); +} + +SkColorType ToClosestSkColorType(bool gpu_compositing, + SharedImageFormat format, + int plane_index) { + CHECK(format.IsValidPlaneIndex(plane_index)); + if (!gpu_compositing) { + // TODO(crbug.com/986405): Remove this assumption and have clients tag + // resources with the correct format. + // In software compositing we lazily use RGBA_8888 throughout the system, + // but actual pixel encodings are the native skia bit ordering, which can be + // RGBA or BGRA. + return kN32_SkColorType; + } + if (format.is_single_plane()) { + return ToClosestSkColorType(gpu_compositing, format); + } + + auto plane_config = format.plane_config(); + auto channel_format = format.channel_format(); + if (format.PrefersExternalSampler()) { + switch (channel_format) { + case SharedImageFormat::ChannelFormat::k8: + return plane_config == SharedImageFormat::PlaneConfig::kY_UV_A + ? kRGBA_8888_SkColorType + : kRGB_888x_SkColorType; + case SharedImageFormat::ChannelFormat::k10: + return kRGBA_1010102_SkColorType; + case SharedImageFormat::ChannelFormat::k16: + return kR16G16B16A16_unorm_SkColorType; + case SharedImageFormat::ChannelFormat::k16F: + return kRGBA_F16_SkColorType; + } + } else { + // No external sampling, format is per plane. + int num_channels = format.NumChannelsInPlane(plane_index); + DCHECK_GT(num_channels, 0); + DCHECK_LE(num_channels, 2); + switch (channel_format) { + case SharedImageFormat::ChannelFormat::k8: + return num_channels == 1 ? kAlpha_8_SkColorType + : kR8G8_unorm_SkColorType; + case SharedImageFormat::ChannelFormat::k10: + case SharedImageFormat::ChannelFormat::k16: + return num_channels == 1 ? kA16_unorm_SkColorType + : kR16G16_unorm_SkColorType; + case SharedImageFormat::ChannelFormat::k16F: + return num_channels == 1 ? kA16_float_SkColorType + : kR16G16_float_SkColorType; + } + } +} + +SharedImageFormat SkColorTypeToSinglePlaneSharedImageFormat( + SkColorType color_type) { + return SharedImageFormat::SinglePlane( + SkColorTypeToResourceFormat(color_type)); +} + +} // namespace viz
diff --git a/components/viz/common/resources/shared_image_format_utils.h b/components/viz/common/resources/shared_image_format_utils.h new file mode 100644 index 0000000..504c9bc --- /dev/null +++ b/components/viz/common/resources/shared_image_format_utils.h
@@ -0,0 +1,37 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef COMPONENTS_VIZ_COMMON_RESOURCES_SHARED_IMAGE_FORMAT_UTILS_H_ +#define COMPONENTS_VIZ_COMMON_RESOURCES_SHARED_IMAGE_FORMAT_UTILS_H_ + +#include "components/viz/common/resources/shared_image_format.h" +#include "components/viz/common/viz_resource_format_export.h" +#include "third_party/skia/include/core/SkColorType.h" + +namespace viz { + +// Returns the closest SkColorType for a given single planar `format`. +// +// NOTE: The formats BGRX_8888, BGR_565 and BGRA_1010102 return a SkColorType +// with R/G channels reversed. This is because from GPU perspective, GL format +// is always RGBA and there is no difference between RGBA/BGRA. Also, these +// formats should not be used for software SkImages/SkSurfaces. +VIZ_RESOURCE_FORMAT_EXPORT SkColorType +ToClosestSkColorType(bool gpu_compositing, SharedImageFormat format); + +// Returns the closest SkColorType for a given `format` and `plane_index`. For +// single planar formats (eg. RGBA) the plane_index must be zero and it's +// equivalent to calling function above. +VIZ_RESOURCE_FORMAT_EXPORT SkColorType +ToClosestSkColorType(bool gpu_compositing, + SharedImageFormat format, + int plane_index); + +// Returns the single-plane SharedImageFormat corresponding to `color_type.` +VIZ_RESOURCE_FORMAT_EXPORT SharedImageFormat +SkColorTypeToSinglePlaneSharedImageFormat(SkColorType color_type); + +} // namespace viz + +#endif // COMPONENTS_VIZ_COMMON_RESOURCES_SHARED_IMAGE_FORMAT_UTILS_H_
diff --git a/components/viz/service/display/renderer_pixeltest.cc b/components/viz/service/display/renderer_pixeltest.cc index 52d282a..548264e 100644 --- a/components/viz/service/display/renderer_pixeltest.cc +++ b/components/viz/service/display/renderer_pixeltest.cc
@@ -38,8 +38,8 @@ #include "components/viz/common/quads/texture_draw_quad.h" #include "components/viz/common/quads/yuv_video_draw_quad.h" #include "components/viz/common/resources/bitmap_allocation.h" -#include "components/viz/common/resources/resource_format_utils.h" #include "components/viz/common/resources/shared_image_format.h" +#include "components/viz/common/resources/shared_image_format_utils.h" #include "components/viz/common/switches.h" #include "components/viz/service/display/delegated_ink_point_pixel_test_helper.h" #include "components/viz/service/display/software_renderer.h"
diff --git a/components/viz/service/display_embedder/image_context_impl.cc b/components/viz/service/display_embedder/image_context_impl.cc index 31ddc81..f2e237e 100644 --- a/components/viz/service/display_embedder/image_context_impl.cc +++ b/components/viz/service/display_embedder/image_context_impl.cc
@@ -8,7 +8,7 @@ #include "base/check.h" #include "base/check_op.h" -#include "components/viz/common/resources/resource_format_utils.h" +#include "components/viz/common/resources/shared_image_format_utils.h" #include "gpu/command_buffer/common/shared_image_usage.h" #include "gpu/command_buffer/service/mailbox_manager.h" #include "gpu/command_buffer/service/shared_context_state.h"
diff --git a/components/viz/service/display_embedder/output_presenter_gl.cc b/components/viz/service/display_embedder/output_presenter_gl.cc index 5ae98fc7..d2b9fd6 100644 --- a/components/viz/service/display_embedder/output_presenter_gl.cc +++ b/components/viz/service/display_embedder/output_presenter_gl.cc
@@ -14,7 +14,7 @@ #include "base/task/single_thread_task_runner.h" #include "build/build_config.h" #include "components/viz/common/features.h" -#include "components/viz/common/resources/resource_format_utils.h" +#include "components/viz/common/resources/shared_image_format_utils.h" #include "components/viz/service/display_embedder/skia_output_surface_dependency.h" #include "gpu/command_buffer/common/shared_image_usage.h" #include "gpu/command_buffer/service/shared_context_state.h"
diff --git a/components/viz/service/display_embedder/skia_output_surface_impl.cc b/components/viz/service/display_embedder/skia_output_surface_impl.cc index 4bbe1dd..3ca9ed3f 100644 --- a/components/viz/service/display_embedder/skia_output_surface_impl.cc +++ b/components/viz/service/display_embedder/skia_output_surface_impl.cc
@@ -25,6 +25,7 @@ #include "components/viz/common/frame_sinks/copy_output_request.h" #include "components/viz/common/frame_sinks/copy_output_util.h" #include "components/viz/common/resources/resource_format_utils.h" +#include "components/viz/common/resources/shared_image_format_utils.h" #include "components/viz/service/display/external_use_client.h" #include "components/viz/service/display/output_surface_client.h" #include "components/viz/service/display/output_surface_frame.h" @@ -467,10 +468,15 @@ SkImageInfo image_info = SkImageInfo::Make(gfx::SizeToSkISize(size_), color_type_, kPremul_SkAlphaType, sk_color_space_); + // Surfaceless output devices allocate shared image behind the scenes. On + // the GPU thread this is treated same as regular IOSurfaces for the + // purpose of creating Graphite TextureInfo i.e. it will have CopySrc and + // CopyDst usage. So don't treat it like a root surface which generally + // won't have or support those usages. + const bool is_root_surface = !capabilities_.supports_surfaceless; skgpu::graphite::TextureInfo texture_info = gpu::GetGraphiteTextureInfo( dependency_->gr_context_type(), format_, /*plane_index=*/0, - /*mipmapped=*/false, - /*root_surface=*/!capabilities_.supports_surfaceless); + /*mipmapped=*/false, is_root_surface); CHECK(texture_info.isValid()); current_paint_.emplace(graphite_recorder_, image_info, texture_info); } else {
diff --git a/components/viz/test/fake_skia_output_surface.cc b/components/viz/test/fake_skia_output_surface.cc index fac4dc44..5f3b128 100644 --- a/components/viz/test/fake_skia_output_surface.cc +++ b/components/viz/test/fake_skia_output_surface.cc
@@ -15,7 +15,7 @@ #include "build/build_config.h" #include "components/viz/common/frame_sinks/copy_output_request.h" #include "components/viz/common/frame_sinks/copy_output_util.h" -#include "components/viz/common/resources/resource_format_utils.h" +#include "components/viz/common/resources/shared_image_format_utils.h" #include "components/viz/service/display/output_surface_client.h" #include "components/viz/service/display/output_surface_frame.h" #include "gpu/GLES2/gl2extchromium.h"
diff --git a/content/browser/attribution_reporting/attribution_config.cc b/content/browser/attribution_reporting/attribution_config.cc index 59d58b3..e3729db 100644 --- a/content/browser/attribution_reporting/attribution_config.cc +++ b/content/browser/attribution_reporting/attribution_config.cc
@@ -6,22 +6,10 @@ #include <cmath> -#include "base/metrics/field_trial_params.h" #include "base/time/time.h" -#include "third_party/blink/public/common/features.h" namespace content { -namespace { - -const base::FeatureParam<int> kMaxReportingOriginsPerSiteParam{ - &blink::features::kConversionMeasurement, - "max_reporting_origins_per_source_reporting_site", - AttributionConfig::RateLimitConfig:: - kDefaultMaxReportingOriginsPerSourceReportingSite}; - -} - bool AttributionConfig::Validate() const { if (max_sources_per_origin <= 0) { return false; @@ -66,11 +54,6 @@ return true; } -int AttributionConfig::RateLimitConfig:: - GetMaxSourceReportingOriginsPerReportingSite() const { - return kMaxReportingOriginsPerSiteParam.Get(); -} - bool AttributionConfig::EventLevelLimit::Validate() const { if (navigation_source_trigger_data_cardinality == 0u) { return false;
diff --git a/content/browser/attribution_reporting/attribution_config.h b/content/browser/attribution_reporting/attribution_config.h index 3c5e127..44a7bfe 100644 --- a/content/browser/attribution_reporting/attribution_config.h +++ b/content/browser/attribution_reporting/attribution_config.h
@@ -35,12 +35,6 @@ // site, reporting site> in `time_window`. int64_t max_attributions = 100; - static constexpr int kDefaultMaxReportingOriginsPerSourceReportingSite = 1; - - base::TimeDelta origins_per_site_window = base::Days(1); - - int GetMaxSourceReportingOriginsPerReportingSite() const; - // When adding new members, the corresponding `Validate()` definition and // `operator==()` definition in `attribution_interop_parser_unittest.cc` // should also be updated.
diff --git a/content/browser/attribution_reporting/attribution_interop_parser_unittest.cc b/content/browser/attribution_reporting/attribution_interop_parser_unittest.cc index 83180ae1..a2c68fc 100644 --- a/content/browser/attribution_reporting/attribution_interop_parser_unittest.cc +++ b/content/browser/attribution_reporting/attribution_interop_parser_unittest.cc
@@ -51,8 +51,7 @@ const auto tie = [](const AttributionConfig::RateLimitConfig& config) { return std::make_tuple( config.time_window, config.max_source_registration_reporting_origins, - config.max_attribution_reporting_origins, config.max_attributions, - config.origins_per_site_window); + config.max_attribution_reporting_origins, config.max_attributions); }; return tie(a) == tie(b); }
diff --git a/content/browser/attribution_reporting/attribution_storage_sql.cc b/content/browser/attribution_reporting/attribution_storage_sql.cc index e986768..a764ef7 100644 --- a/content/browser/attribution_reporting/attribution_storage_sql.cc +++ b/content/browser/attribution_reporting/attribution_storage_sql.cc
@@ -719,20 +719,6 @@ return StoreSourceResult(StorableSource::Result::kInternalError); } - switch (rate_limit_table_.SourceAllowedForReportingOriginPerSiteLimit( - &db_, source, source_time)) { - case RateLimitResult::kAllowed: - break; - case RateLimitResult::kNotAllowed: - // TODO(https://crbug.com/1448330): Report a different result - // type for this limit to avoid overlap with the other reporting - // origin limit. - return StoreSourceResult( - StorableSource::Result::kExcessiveReportingOrigins); - case RateLimitResult::kError: - return StoreSourceResult(StorableSource::Result::kInternalError); - } - sql::Transaction transaction(&db_); if (!transaction.Begin()) { return StoreSourceResult(StorableSource::Result::kInternalError);
diff --git a/content/browser/attribution_reporting/attribution_storage_sql_query_plans_unittest.cc b/content/browser/attribution_reporting/attribution_storage_sql_query_plans_unittest.cc index 61ddccf..5ec15ea 100644 --- a/content/browser/attribution_reporting/attribution_storage_sql_query_plans_unittest.cc +++ b/content/browser/attribution_reporting/attribution_storage_sql_query_plans_unittest.cc
@@ -204,15 +204,6 @@ {"source_site", "reporting_site"})); } -TEST_F(AttributionSqlQueryPlanTest, kRateLimitSourceReportingOriginsBySiteSql) { - const auto plan = GetPlan( - attribution_queries::kRateLimitSelectSourceReportingOriginsBySiteSql); - ASSERT_TRUE(plan.has_value()); - EXPECT_THAT(plan.value(), - UsesIndex("rate_limit_source_site_reporting_site_idx", - {"source_site", "reporting_site"})); -} - TEST_F(AttributionSqlQueryPlanTest, kRateLimitSelectReportingOriginsSql) { const auto plan = GetPlan(attribution_queries::kRateLimitSelectReportingOriginsSql);
diff --git a/content/browser/attribution_reporting/attribution_storage_unittest.cc b/content/browser/attribution_reporting/attribution_storage_unittest.cc index 5e272e3..33242ee 100644 --- a/content/browser/attribution_reporting/attribution_storage_unittest.cc +++ b/content/browser/attribution_reporting/attribution_storage_unittest.cc
@@ -3599,37 +3599,4 @@ MaybeCreateAndStoreAggregatableReport(trigger)); } -TEST_F(AttributionStorageTest, MaxSourceReportingOriginsPerSite) { - auto store_source = [&](std::string source, std::string reporting) { - storage()->StoreSource( - SourceBuilder() - .SetSourceOrigin(*SuitableOrigin::Deserialize(source)) - .SetReportingOrigin(*SuitableOrigin::Deserialize(reporting)) - .SetExpiry(base::Days(2)) - .Build()); - }; - store_source("https://a.test", "https://reporter.test"); - EXPECT_THAT(storage()->GetActiveSources(), SizeIs(1)); - - store_source("https://a.test", "https://a.reporter.test"); - EXPECT_THAT(storage()->GetActiveSources(), SizeIs(1)); - - store_source("https://b.test", "https://a.reporter.test"); - EXPECT_THAT(storage()->GetActiveSources(), SizeIs(2)); - - store_source("https://b.test", "https://otherreporter.test"); - EXPECT_THAT(storage()->GetActiveSources(), SizeIs(3)); - - task_environment_.FastForwardBy(base::Days(1)); - - // After 1 day a new origin can be used. - store_source("https://a.test", "https://a.reporter.test"); - EXPECT_THAT(storage()->GetActiveSources(), SizeIs(4)); - - // The reporter used on the first day can't be used even though it is - // repeated. - store_source("https://a.test", "https://reporter.test"); - EXPECT_THAT(storage()->GetActiveSources(), SizeIs(4)); -} - } // namespace content
diff --git a/content/browser/attribution_reporting/rate_limit_table.cc b/content/browser/attribution_reporting/rate_limit_table.cc index 0826c11..a040f71 100644 --- a/content/browser/attribution_reporting/rate_limit_table.cc +++ b/content/browser/attribution_reporting/rate_limit_table.cc
@@ -241,51 +241,6 @@ source.registration().destination_set.destinations()); } -RateLimitResult RateLimitTable::SourceAllowedForReportingOriginPerSiteLimit( - sql::Database* db, - const StorableSource& source, - base::Time source_time) { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - - size_t max_origins = - static_cast<size_t>(delegate_->GetRateLimits() - .GetMaxSourceReportingOriginsPerReportingSite()); - - base::Time min_timestamp = - source_time - delegate_->GetRateLimits().origins_per_site_window; - - sql::Statement statement(db->GetCachedStatement( - SQL_FROM_HERE, - attribution_queries::kRateLimitSelectSourceReportingOriginsBySiteSql)); - statement.BindString(0, source.common_info().source_site().Serialize()); - statement.BindString( - 1, - net::SchemefulSite(source.common_info().reporting_origin()).Serialize()); - statement.BindTime(2, min_timestamp); - - std::string serialized_reporting_origin = - source.common_info().reporting_origin().Serialize(); - std::set<std::string> reporting_origins; - while (statement.Step()) { - std::string origin = statement.ColumnString(0); - - if (origin == serialized_reporting_origin) { - return RateLimitResult::kAllowed; - } - - reporting_origins.insert(std::move(origin)); - if (reporting_origins.size() == max_origins) { - return RateLimitResult::kNotAllowed; - } - } - - if (!statement.Succeeded()) { - return RateLimitResult::kError; - } - - return RateLimitResult::kAllowed; -} - RateLimitResult RateLimitTable::SourceAllowedForDestinationLimit( sql::Database* db, const StorableSource& source,
diff --git a/content/browser/attribution_reporting/rate_limit_table.h b/content/browser/attribution_reporting/rate_limit_table.h index 286575a9..158a766 100644 --- a/content/browser/attribution_reporting/rate_limit_table.h +++ b/content/browser/attribution_reporting/rate_limit_table.h
@@ -83,11 +83,6 @@ const StorableSource& source, base::Time source_time); - [[nodiscard]] RateLimitResult SourceAllowedForReportingOriginPerSiteLimit( - sql::Database* db, - const StorableSource& source, - base::Time source_time); - [[nodiscard]] RateLimitResult SourceAllowedForDestinationLimit( sql::Database* db, const StorableSource& source,
diff --git a/content/browser/attribution_reporting/rate_limit_table_unittest.cc b/content/browser/attribution_reporting/rate_limit_table_unittest.cc index 979568d..23757863 100644 --- a/content/browser/attribution_reporting/rate_limit_table_unittest.cc +++ b/content/browser/attribution_reporting/rate_limit_table_unittest.cc
@@ -17,7 +17,6 @@ #include "base/files/file_util.h" #include "base/functional/bind.h" #include "base/functional/callback_helpers.h" -#include "base/test/scoped_feature_list.h" #include "base/test/task_environment.h" #include "base/time/time.h" #include "components/attribution_reporting/source_type.mojom.h" @@ -34,7 +33,6 @@ #include "sql/statement.h" #include "testing/gtest/include/gtest/gtest.h" #include "third_party/abseil-cpp/absl/types/optional.h" -#include "third_party/blink/public/common/features.h" #include "third_party/blink/public/common/storage_key/storage_key.h" namespace content { @@ -231,13 +229,6 @@ &db_, input.NewSourceBuilder().Build(), input.time); } - [[nodiscard]] RateLimitResult SourceAllowedForReportingOriginPerSiteLimit( - const RateLimitInput& input) { - CHECK_EQ(input.scope, RateLimitScope::kSource); - return table_.SourceAllowedForReportingOriginPerSiteLimit( - &db_, input.NewSourceBuilder().Build(), input.time); - } - [[nodiscard]] RateLimitResult SourceAllowedForDestinationLimit( const RateLimitInput& input) { CHECK_EQ(input.scope, RateLimitScope::kSource); @@ -489,75 +480,6 @@ SourceAllowedForReportingOriginLimit(input_2)); } -TEST_F(RateLimitTableTest, - SourceAllowedForReportingOriginPerSourceReportingSiteLimit) { - constexpr base::TimeDelta kTimeWindow = base::Days(1); - delegate_.set_rate_limits({ - .max_attribution_reporting_origins = std::numeric_limits<int64_t>::max(), - .max_attributions = std::numeric_limits<int64_t>::max(), - .origins_per_site_window = kTimeWindow, - }); - - const base::Time now = base::Time::Now(); - - const struct { - const char* source_origin; - const char* destination_origin; - const char* reporting_origin; - RateLimitResult expected; - } kRateLimitsToAdd[] = { - {"https://a.s1.test", "https://d1.test", "https://a.r.test", - RateLimitResult::kAllowed}, - // Different reporting origin, same reporting site. - {"https://a.s1.test", "https://d1.test", "https://b.r.test", - RateLimitResult::kNotAllowed}, - // Different source origin, same source site. - {"https://b.s1.test", "https://d1.test", "https://b.r.test", - RateLimitResult::kNotAllowed}, - // Different destination, destination not part of limit. - {"https://a.s1.test", "https://d2.test", "https://c.r.test", - RateLimitResult::kNotAllowed}, - // Different source site. - {"https://s2.test", "https://d1.test", "https://b.r.test", - RateLimitResult::kAllowed}, - // Different reporting site. - {"https://a.s1.test", "https://d1.test", "https://b.r2.test", - RateLimitResult::kAllowed}}; - - for (const auto& rate_limit : kRateLimitsToAdd) { - auto input = RateLimitInput::Source(rate_limit.source_origin, - rate_limit.destination_origin, - rate_limit.reporting_origin, now); - - ASSERT_EQ(rate_limit.expected, - SourceAllowedForReportingOriginPerSiteLimit(input)) - << input; - - if (rate_limit.expected == RateLimitResult::kAllowed) { - ASSERT_TRUE(AddRateLimitForSource(input)) << input; - } - } - - task_environment_.FastForwardBy(kTimeWindow); - - // This is allowed because the original rows for the tuple have fallen out of - // the time window. - const auto input_1 = - RateLimitInput::Source("https://a.s1.test", "https://d1.test", - "https://b.r.test", base::Time::Now()); - ASSERT_EQ(RateLimitResult::kAllowed, - SourceAllowedForReportingOriginPerSiteLimit(input_1)); - ASSERT_TRUE(AddRateLimitForSource(input_1)) << input_1; - - // The reporting origin from the first window is not allowed after a new - // origin was used in this window. - const auto input_2 = - RateLimitInput::Source("https://a.s1.test", "https://d1.test", - "https://a.r.test", base::Time::Now()); - ASSERT_EQ(RateLimitResult::kNotAllowed, - SourceAllowedForReportingOriginPerSiteLimit(input_2)); -} - TEST_F(RateLimitTableTest, AttributionAllowedForReportingOriginLimit) { constexpr base::TimeDelta kTimeWindow = base::Days(1); delegate_.set_rate_limits({ @@ -1087,57 +1009,4 @@ EXPECT_THAT(keys, ElementsAre(expected_1, expected_2)); } -class RateLimitTableFieldTrialLimitsTest : public RateLimitTableTest { - public: - RateLimitTableFieldTrialLimitsTest() { - feature_list_.InitWithFeaturesAndParameters( - {{blink::features::kConversionMeasurement, - {{"max_reporting_origins_per_source_reporting_site", "2"}}}}, - /*disabled_features=*/{}); - } - - private: - base::test::ScopedFeatureList feature_list_; -}; - -TEST_F(RateLimitTableFieldTrialLimitsTest, - SourceAllowedForReportingOriginPerSourceReportingSiteLimit) { - constexpr base::TimeDelta kTimeWindow = base::Days(1); - delegate_.set_rate_limits({ - .max_attribution_reporting_origins = std::numeric_limits<int64_t>::max(), - .max_attributions = std::numeric_limits<int64_t>::max(), - .origins_per_site_window = kTimeWindow, - }); - - const base::Time now = base::Time::Now(); - - const struct { - const char* source_origin; - const char* destination_origin; - const char* reporting_origin; - RateLimitResult expected; - } kRateLimitsToAdd[] = {{"https://a.s1.test", "https://d1.test", - "https://a.r.test", RateLimitResult::kAllowed}, - // Different reporting origin, same reporting site. - {"https://a.s1.test", "https://d1.test", - "https://b.r.test", RateLimitResult::kAllowed}, - // Different reporting origin, same reporting site. - {"https://a.s1.test", "https://d1.test", - "https://c.r.test", RateLimitResult::kNotAllowed}}; - - for (const auto& rate_limit : kRateLimitsToAdd) { - auto input = RateLimitInput::Source(rate_limit.source_origin, - rate_limit.destination_origin, - rate_limit.reporting_origin, now); - - ASSERT_EQ(rate_limit.expected, - SourceAllowedForReportingOriginPerSiteLimit(input)) - << input; - - if (rate_limit.expected == RateLimitResult::kAllowed) { - ASSERT_TRUE(AddRateLimitForSource(input)) << input; - } - } -} - } // namespace content
diff --git a/content/browser/attribution_reporting/sql_queries.h b/content/browser/attribution_reporting/sql_queries.h index a7a8fbd..69547b5e 100644 --- a/content/browser/attribution_reporting/sql_queries.h +++ b/content/browser/attribution_reporting/sql_queries.h
@@ -6,7 +6,6 @@ #define CONTENT_BROWSER_ATTRIBUTION_REPORTING_SQL_QUERIES_H_ #include "content/browser/attribution_reporting/attribution_reporting.mojom.h" -#include "content/browser/attribution_reporting/rate_limit_table.h" namespace content::attribution_queries { @@ -184,15 +183,6 @@ "AND destination_site=? " "AND time>?"; -static_assert(static_cast<int>(RateLimitTable::Scope::kSource) == 0, - "update `scope=0` clause below"); -inline constexpr const char kRateLimitSelectSourceReportingOriginsBySiteSql[] = - "SELECT reporting_origin FROM rate_limits " - "WHERE scope=0 " - "AND source_site=?" - "AND reporting_site=? " - "AND time>?"; - inline constexpr const char kDeleteRateLimitRangeSql[] = "DELETE FROM rate_limits WHERE" "(time BETWEEN ?1 AND ?2)OR"
diff --git a/content/browser/interest_group/ad_auction_service_impl_unittest.cc b/content/browser/interest_group/ad_auction_service_impl_unittest.cc index 66dee5c..9c3163a 100644 --- a/content/browser/interest_group/ad_auction_service_impl_unittest.cc +++ b/content/browser/interest_group/ad_auction_service_impl_unittest.cc
@@ -14,6 +14,7 @@ #include "base/feature_list.h" #include "base/functional/bind.h" #include "base/memory/raw_ptr.h" +#include "base/memory/raw_ref.h" #include "base/memory/scoped_refptr.h" #include "base/run_loop.h" #include "base/strings/string_number_conversions.h" @@ -4805,83 +4806,83 @@ struct TestCase { const std::string update_contents; - const blink::InterestGroup& expected_group; + const raw_ref<const blink::InterestGroup> expected_group; } kTestCases[] = { // *** // ads renderURL // *** {R"("ads": [{"renderUrl": "https://example.com/render"}])", - updated_interest_group_ads}, + raw_ref(updated_interest_group_ads)}, {R"("ads": [{"renderUrl": "https://example.com/render", "renderURL": "https://example.com/render"}])", - updated_interest_group_ads}, + raw_ref(updated_interest_group_ads)}, {R"("ads": [{"renderUrl": "https://example.com/render", "renderURL": "https://example.com/render2"}])", - initial_interest_group}, - {R"("ads": [{}])", initial_interest_group}, + raw_ref(initial_interest_group)}, + {R"("ads": [{}])", raw_ref(initial_interest_group)}, // *** // adComponents renderURL // *** {R"("adComponents": [{"renderUrl": "https://example.com/render"}])", - updated_interest_group_ad_components}, + raw_ref(updated_interest_group_ad_components)}, {R"("adComponents": [{"renderUrl": "https://example.com/render", "renderURL": "https://example.com/render"}])", - updated_interest_group_ad_components}, + raw_ref(updated_interest_group_ad_components)}, {R"("adComponents": [{"renderUrl": "https://example.com/render", "renderURL": "https://example.com/render2"}])", - initial_interest_group}, - {R"("adComponents": [{}])", initial_interest_group}, + raw_ref(initial_interest_group)}, + {R"("adComponents": [{}])", raw_ref(initial_interest_group)}, // *** // biddingLogicURL // *** {base::StringPrintf(R"("biddingLogicUrl": "%s/bidding.js")", kOriginStringA), - updated_interest_group_bidding_logic_url}, + raw_ref(updated_interest_group_bidding_logic_url)}, {base::StringPrintf(R"("biddingLogicURL": "%s/bidding.js")", kOriginStringA), - updated_interest_group_bidding_logic_url}, + raw_ref(updated_interest_group_bidding_logic_url)}, {base::StringPrintf(R"("biddingLogicUrl": "%s/bidding.js",)" R"("biddingLogicURL": "%s/bidding.js")", kOriginStringA, kOriginStringA), - updated_interest_group_bidding_logic_url}, + raw_ref(updated_interest_group_bidding_logic_url)}, {base::StringPrintf(R"("biddingLogicUrl": "%s/bidding.js",)" R"("biddingLogicURL": "%s/bidding2.js")", kOriginStringA, kOriginStringA), - initial_interest_group}, + raw_ref(initial_interest_group)}, // *** // biddingWasmHelperURL // *** {base::StringPrintf(R"("biddingWasmHelperUrl": "%s/bidding.wasm")", kOriginStringA), - updated_interest_group_bidding_wasm_helper_url}, + raw_ref(updated_interest_group_bidding_wasm_helper_url)}, {base::StringPrintf(R"("biddingWasmHelperURL": "%s/bidding.wasm")", kOriginStringA), - updated_interest_group_bidding_wasm_helper_url}, + raw_ref(updated_interest_group_bidding_wasm_helper_url)}, {base::StringPrintf(R"("biddingWasmHelperUrl": "%s/bidding.wasm",)" R"("biddingWasmHelperURL": "%s/bidding.wasm")", kOriginStringA, kOriginStringA), - updated_interest_group_bidding_wasm_helper_url}, + raw_ref(updated_interest_group_bidding_wasm_helper_url)}, {base::StringPrintf(R"("biddingWasmHelperUrl": "%s/bidding.wasm",)" R"("biddingWasmHelperURL": "%s/bidding2.wasm")", kOriginStringA, kOriginStringA), - initial_interest_group}, + raw_ref(initial_interest_group)}, // *** // trustedBiddingSignalsURL // *** {base::StringPrintf(R"("trustedBiddingSignalsUrl": "%s/signals.json")", kOriginStringA), - updated_interest_group_trusted_bidding_signals_url}, + raw_ref(updated_interest_group_trusted_bidding_signals_url)}, {base::StringPrintf(R"("trustedBiddingSignalsURL": "%s/signals.json")", kOriginStringA), - updated_interest_group_trusted_bidding_signals_url}, + raw_ref(updated_interest_group_trusted_bidding_signals_url)}, {base::StringPrintf(R"("trustedBiddingSignalsUrl": "%s/signals.json",)" R"("trustedBiddingSignalsURL": "%s/signals.json")", kOriginStringA, kOriginStringA), - updated_interest_group_trusted_bidding_signals_url}, + raw_ref(updated_interest_group_trusted_bidding_signals_url)}, {base::StringPrintf(R"("trustedBiddingSignalsUrl": "%s/signals.json",)" R"("trustedBiddingSignalsURL": "%s/signals2.json")", kOriginStringA, kOriginStringA), - initial_interest_group}, + raw_ref(initial_interest_group)}, }; for (const auto& test_case : kTestCases) { @@ -4900,7 +4901,7 @@ GetInterestGroupsForOwner(kOriginA); ASSERT_EQ(groups.size(), 1u); EXPECT_TRUE( - groups[0].interest_group.IsEqualForTesting(test_case.expected_group)); + groups[0].interest_group.IsEqualForTesting(*test_case.expected_group)); // Reset for the next iteration. JoinInterestGroupAndFlush(initial_interest_group);
diff --git a/content/browser/loader/loader_browsertest.cc b/content/browser/loader/loader_browsertest.cc index 0dd16eb..dcf89eab 100644 --- a/content/browser/loader/loader_browsertest.cc +++ b/content/browser/loader/loader_browsertest.cc
@@ -765,7 +765,7 @@ std::unique_ptr<URLLoaderInterceptor> interceptor_; }; -IN_PROC_BROWSER_TEST_F(RequestDataBrowserTest, DISABLED_Basic) { +IN_PROC_BROWSER_TEST_F(RequestDataBrowserTest, Basic) { GURL top_url(embedded_test_server()->GetURL("/page_with_subresources.html")); url::Origin top_origin = url::Origin::Create(top_url);
diff --git a/content/browser/shape_detection/shape_detection_browsertest.cc b/content/browser/shape_detection/shape_detection_browsertest.cc index 2d54712e..5cc9c121 100644 --- a/content/browser/shape_detection/shape_detection_browsertest.cc +++ b/content/browser/shape_detection/shape_detection_browsertest.cc
@@ -3,6 +3,7 @@ // found in the LICENSE file. #include "base/command_line.h" +#include "base/memory/raw_ptr_exclusion.h" #include "base/strings/string_tokenizer.h" #include "build/build_config.h" #include "content/public/common/content_switches.h" @@ -23,7 +24,10 @@ struct TestParameters { const std::string detector_name; const std::string image_path; - const std::vector<std::vector<float>>& expected_bounding_boxes; + // This field is not a raw_ref<> because it was filtered by the rewriter for: + // #constexpr-ctor-field-initializer, global-scope + RAW_PTR_EXCLUSION const std::vector<std::vector<float>>& + expected_bounding_boxes; } const kTestParameters[] = { {"FaceDetector", "/blank.jpg", std::vector<std::vector<float>>{}}, {"FaceDetector",
diff --git a/content/gpu/gpu_main.cc b/content/gpu/gpu_main.cc index a399e1ba..c641da1 100644 --- a/content/gpu/gpu_main.cc +++ b/content/gpu/gpu_main.cc
@@ -460,7 +460,7 @@ sandbox_options.accelerated_video_encode_enabled = !gpu_prefs.disable_accelerated_video_encode; -#if BUILDFLAG(IS_CHROMEOS) +#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_LINUX) // Video decoding of many video streams can use thousands of FDs as well as // Exo clients like Lacros. // See https://crbug.com/1417237
diff --git a/content/public/renderer/render_frame_observer.h b/content/public/renderer/render_frame_observer.h index fef4c8e..5c08d822 100644 --- a/content/public/renderer/render_frame_observer.h +++ b/content/public/renderer/render_frame_observer.h
@@ -43,6 +43,7 @@ class WebString; class WebURLRequest; class WebWorkerFetchContext; +struct JavaScriptFrameworkDetectionResult; } // namespace blink namespace gfx { @@ -213,6 +214,11 @@ // load. This is used for metrics collection. virtual void DidObserveLoadingBehavior(blink::LoadingBehaviorFlag behavior) {} + // Notification when the renderer performed framework detection during a page + // load. This is used for metrics collection. + virtual void DidObserveJavaScriptFrameworks( + const blink::JavaScriptFrameworkDetectionResult&) {} + // Notification when the renderer uses subresources. // It is called when there is a subresouce load. The reported values via // arguments are cumulative. They are NOT a difference from the previous call.
diff --git a/content/renderer/pepper/pepper_graphics_2d_host.cc b/content/renderer/pepper/pepper_graphics_2d_host.cc index f0bed0b..bdbe1e0d 100644 --- a/content/renderer/pepper/pepper_graphics_2d_host.cc +++ b/content/renderer/pepper/pepper_graphics_2d_host.cc
@@ -22,6 +22,7 @@ #include "components/viz/common/resources/bitmap_allocation.h" #include "components/viz/common/resources/resource_sizes.h" #include "components/viz/common/resources/shared_bitmap.h" +#include "components/viz/common/resources/shared_image_format_utils.h" #include "content/public/renderer/ppapi_gfx_conversion.h" #include "content/public/renderer/render_thread.h" #include "content/public/renderer/renderer_ppapi_host.h"
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc index 8bf6b5d..3134ee7 100644 --- a/content/renderer/render_frame_impl.cc +++ b/content/renderer/render_frame_impl.cc
@@ -4354,6 +4354,13 @@ observer.DidObserveLoadingBehavior(behavior); } +void RenderFrameImpl::DidObserveJavaScriptFrameworks( + const blink::JavaScriptFrameworkDetectionResult& result) { + for (auto& observer : observers_) { + observer.DidObserveJavaScriptFrameworks(result); + } +} + void RenderFrameImpl::DidObserveSubresourceLoad( const blink::SubresourceLoadMetrics& subresource_load_metrics) { for (auto& observer : observers_)
diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h index 0c8628f..9ea70ed 100644 --- a/content/renderer/render_frame_impl.h +++ b/content/renderer/render_frame_impl.h
@@ -134,6 +134,7 @@ class WebString; class WebURL; struct FramePolicy; +struct JavaScriptFrameworkDetectionResult; } // namespace blink namespace gfx { @@ -598,6 +599,8 @@ blink::UserInteractionType interaction_type) override; void DidChangeCpuTiming(base::TimeDelta time) override; void DidObserveLoadingBehavior(blink::LoadingBehaviorFlag behavior) override; + void DidObserveJavaScriptFrameworks( + const blink::JavaScriptFrameworkDetectionResult&) override; void DidObserveSubresourceLoad( const blink::SubresourceLoadMetrics& subresource_load_metrics) override; void DidObserveNewFeatureUsage(
diff --git a/content/test/content_test_bundle_data.filelist b/content/test/content_test_bundle_data.filelist index 4cc31c8..777039e 100644 --- a/content/test/content_test_bundle_data.filelist +++ b/content/test/content_test_bundle_data.filelist
@@ -5454,6 +5454,8 @@ data/empty.html data/empty404.html data/empty404.html.mock-http-headers +data/empty-script.js +data/empty-style.css data/event-latency-animation.html data/fedcm/accounts_endpoint.json data/fedcm/client_metadata_endpoint.json @@ -5902,6 +5904,7 @@ data/iframe_clipped.html data/iframe_out_of_view.html data/image.jpg +data/image-inline.png data/indexeddb/blobs_use_quota.html data/indexeddb/blocked_explicit_commit.html data/indexeddb/blocked_explicit_commit.js
diff --git a/content/test/data/attribution_reporting/interop/rate_limit_max_attribution_reporting_endpoints.json b/content/test/data/attribution_reporting/interop/rate_limit_max_attribution_reporting_endpoints.json index abbb6351..289782a 100644 --- a/content/test/data/attribution_reporting/interop/rate_limit_max_attribution_reporting_endpoints.json +++ b/content/test/data/attribution_reporting/interop/rate_limit_max_attribution_reporting_endpoints.json
@@ -22,7 +22,6 @@ } }] }, - // Will not be registered due to the origin per reporting site restriction. { "timestamp": "1643235573000", "registration_request": { @@ -32,15 +31,13 @@ }, "responses": [{ "url": "https://reporter.test/register-source", - "debug_permission": true, "response": { "Attribution-Reporting-Register-Source": { "destination": [ "https://example.destination.test", "https://another-destination.test" ], - "source_event_id": "111", - "debug_reporting": true + "source_event_id": "111" } } }] @@ -142,7 +139,7 @@ } }] }, - // Won't result in a report as the source wasn't registered. + // Should result in an event-level report. { "timestamp": "1643235574000", "registration_request": { @@ -162,7 +159,8 @@ } }] }, - // Will result in a report. + // Should not result in an event-level report due to the reporting origin + // limit. { "timestamp": "1643235576000", "registration_request": { @@ -275,63 +273,83 @@ ] }, "output": { - "event_level_results": [ { - "payload": { - "attribution_destination": "https://another-destination.test", - "randomized_trigger_rate": 0.0024263, - "scheduled_report_time": "1643411979", - "source_event_id": "333", - "source_type": "navigation", - "trigger_data": "5" - }, - "report_time": "1643411979000", - "report_url": "https://another-reporter.test/.well-known/attribution-reporting/report-event-attribution" - },{ - "payload": { - "attribution_destination": "https://destination.test", - "randomized_trigger_rate": 0.0024263, - "scheduled_report_time": "1643411975", - "source_event_id": "999", - "source_type": "navigation", - "trigger_data": "2" - }, - "report_time": "1643411975000", - "report_url": "https://example.reporter.test/.well-known/attribution-reporting/report-event-attribution" - }, { - "payload": { - "attribution_destination": "https://destination.test", - "randomized_trigger_rate": 0.0024263, - "scheduled_report_time": "1643411977", - "source_event_id": "222", - "source_type": "navigation", - "trigger_data": "6" - }, - "report_time": "1643411977000", - "report_url": "https://another-reporter.test/.well-known/attribution-reporting/report-event-attribution" - } ], - "verbose_debug_reports": [ { - "payload": [ { - "body": { - "attribution_destination": "https://destination.test", - "limit": "1", - "source_event_id": "444", - "source_site": "https://source.test" - }, - "type": "trigger-reporting-origin-limit" - } ], - "report_time": "1643235582000", - "report_url": "https://another-reporter.test/.well-known/attribution-reporting/debug/verbose" - }, { - "payload": [ { - "body": { + "event_level_results": [ + { + "payload": { "attribution_destination": [ "https://another-destination.test", "https://destination.test" ], + "randomized_trigger_rate": 0.0024263, + "scheduled_report_time": "1643411973", "source_event_id": "111", - "source_site": "https://source.test" + "source_type": "navigation", + "trigger_data": "7" }, - "type": "source-success" - } ], - "report_time": "1643235573000", - "report_url": "https://reporter.test/.well-known/attribution-reporting/debug/verbose" - } ] + "report_url": "https://reporter.test/.well-known/attribution-reporting/report-event-attribution", + "report_time": "1643411973000" + }, + { + "payload": { + "attribution_destination": "https://destination.test", + "randomized_trigger_rate": 0.0024263, + "scheduled_report_time": "1643411977", + "source_event_id": "222", + "source_type": "navigation", + "trigger_data": "6" + }, + "report_url": "https://another-reporter.test/.well-known/attribution-reporting/report-event-attribution", + "report_time": "1643411977000" + }, + { + "payload": { + "attribution_destination": "https://another-destination.test", + "randomized_trigger_rate": 0.0024263, + "scheduled_report_time": "1643411979", + "source_event_id": "333", + "source_type": "navigation", + "trigger_data": "5" + }, + "report_url": "https://another-reporter.test/.well-known/attribution-reporting/report-event-attribution", + "report_time": "1643411979000" + }, + { + "payload": { + "attribution_destination": "https://destination.test", + "randomized_trigger_rate": 0.0000025, + "scheduled_report_time": "1645831181", + "source_event_id": "444", + "source_type": "event", + "trigger_data": "1" + }, + "report_url": "https://another-reporter.test/.well-known/attribution-reporting/report-event-attribution", + "report_time": "1645831181000" + } + ], + "verbose_debug_reports": [ + { + "payload": [ { + "body": { + "attribution_destination": "https://destination.test", + "limit": "1", + "source_event_id": "999", + "source_site": "https://source.test" + }, + "type": "trigger-reporting-origin-limit" + } ], + "report_time": "1643235576000", + "report_url": "https://example.reporter.test/.well-known/attribution-reporting/debug/verbose" + }, + { + "payload": [ { + "body": { + "attribution_destination": "https://destination.test", + "limit": "1", + "source_event_id": "444", + "source_site": "https://source.test" + }, + "type": "trigger-reporting-origin-limit" + } ], + "report_time": "1643235582000", + "report_url": "https://another-reporter.test/.well-known/attribution-reporting/debug/verbose" + } + ] } }
diff --git a/content/test/data/empty-script.js b/content/test/data/empty-script.js new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/content/test/data/empty-script.js
diff --git a/content/test/data/empty-style.css b/content/test/data/empty-style.css new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/content/test/data/empty-style.css
diff --git a/content/test/data/image-inline.png b/content/test/data/image-inline.png new file mode 100644 index 0000000..4498dd2 --- /dev/null +++ b/content/test/data/image-inline.png Binary files differ
diff --git a/content/test/data/page_with_subresources.html b/content/test/data/page_with_subresources.html index 314cdba..c544e1ed 100644 --- a/content/test/data/page_with_subresources.html +++ b/content/test/data/page_with_subresources.html
@@ -1,16 +1,16 @@ <!DOCTYPE html> <html> <head> - <link rel="stylesheet" href="style"></link> + <link rel="stylesheet" href="empty-style.css"></link> <link rel="prefetch" href="prefetch"></link> </head> <body> - <img src="image-inline"> + <img src="image-inline.png"> <a href="javascript:" ping="ping">link</a> <!-- All script-based loading at the bottom to avoid duplicating requests due to the preload scanner --> - <script src="script"></script> + <script src="empty-script.js"></script> <script> // <img> var i = document.createElement('img');
diff --git a/extensions/browser/extension_function_histogram_value.h b/extensions/browser/extension_function_histogram_value.h index fb1f7ac..dae76b9 100644 --- a/extensions/browser/extension_function_histogram_value.h +++ b/extensions/browser/extension_function_histogram_value.h
@@ -1829,14 +1829,14 @@ PASSWORDSPRIVATE_SHOWEXPORTEDFILEINSHELL = 1766, FILEMANAGERPRIVATE_TOGGLEBULKPINNING = 1767, SMARTCARDPROVIDERPRIVATE_REPORTCONNECTRESULT = 1768, - SMARTCARDPROVIDERPRIVATE_REPORTDISCONNECTRESULT = 1769, + DELETED_SMARTCARDPROVIDERPRIVATE_REPORTDISCONNECTRESULT = 1769, WMDESKSPRIVATE_GETDESKBYID = 1770, AUTOFILLPRIVATE_ISVALIDIBAN = 1771, ACCESSIBILITY_PRIVATE_ISLACROSPRIMARY = 1772, POWER_REPORTACTIVITY = 1773, PASSWORDSPRIVATE_CONTINUEIMPORT = 1774, PASSWORDSPRIVATE_RESETIMPORTER = 1775, - SMARTCARDPROVIDERPRIVATE_REPORTCANCELRESULT = 1776, + SMARTCARDPROVIDERPRIVATE_REPORTPLAINRESULT = 1776, RUNTIME_GETCONTEXTS = 1777, OS_EVENTS_ISEVENTSUPPORTED = 1778, OS_EVENTS_STARTCAPTURINGEVENTS = 1779,
diff --git a/gpu/command_buffer/client/mapped_memory.h b/gpu/command_buffer/client/mapped_memory.h index f7252f7..171391c 100644 --- a/gpu/command_buffer/client/mapped_memory.h +++ b/gpu/command_buffer/client/mapped_memory.h
@@ -13,7 +13,6 @@ #include "base/bits.h" #include "base/functional/bind.h" #include "base/memory/raw_ptr.h" -#include "base/memory/raw_ptr_exclusion.h" #include "base/trace_event/memory_dump_provider.h" #include "gpu/command_buffer/client/fenced_allocator.h" #include "gpu/command_buffer/common/buffer.h" @@ -278,19 +277,13 @@ void Reset(uint32_t new_size); private: - // This field is not a raw_ptr<> because it was filtered by the rewriter for: - // #union - RAW_PTR_EXCLUSION void* buffer_; + raw_ptr<void> buffer_; uint32_t size_; int32_t shm_id_; uint32_t shm_offset_; bool flush_after_release_; - // This field is not a raw_ptr<> because it was filtered by the rewriter for: - // #union - RAW_PTR_EXCLUSION CommandBufferHelper* helper_; - // This field is not a raw_ptr<> because it was filtered by the rewriter for: - // #union - RAW_PTR_EXCLUSION MappedMemoryManager* mapped_memory_manager_; + raw_ptr<CommandBufferHelper> helper_; + raw_ptr<MappedMemoryManager> mapped_memory_manager_; }; } // namespace gpu
diff --git a/gpu/command_buffer/client/transfer_buffer.cc b/gpu/command_buffer/client/transfer_buffer.cc index 81a3848..bfe37ea 100644 --- a/gpu/command_buffer/client/transfer_buffer.cc +++ b/gpu/command_buffer/client/transfer_buffer.cc
@@ -332,7 +332,7 @@ bool ScopedTransferBufferPtr::BelongsToBuffer(char* memory) const { if (!buffer_) return false; - char* start = reinterpret_cast<char*>(buffer_); + char* start = static_cast<char*>(buffer_.get()); char* end = start + size_; return memory >= start && memory <= end; }
diff --git a/gpu/command_buffer/client/transfer_buffer.h b/gpu/command_buffer/client/transfer_buffer.h index 727d7e4..29be30e4 100644 --- a/gpu/command_buffer/client/transfer_buffer.h +++ b/gpu/command_buffer/client/transfer_buffer.h
@@ -13,7 +13,6 @@ #include "base/compiler_specific.h" #include "base/containers/circular_deque.h" #include "base/memory/raw_ptr.h" -#include "base/memory/raw_ptr_exclusion.h" #include "base/unguessable_token.h" #include "gpu/command_buffer/client/ring_buffer.h" #include "gpu/command_buffer/common/buffer.h" @@ -240,16 +239,10 @@ void Shrink(unsigned int new_size); private: - // This field is not a raw_ptr<> because it was filtered by the rewriter for: - // #union - RAW_PTR_EXCLUSION void* buffer_; + raw_ptr<void> buffer_; unsigned int size_; - // This field is not a raw_ptr<> because it was filtered by the rewriter for: - // #union - RAW_PTR_EXCLUSION CommandBufferHelper* helper_; - // This field is not a raw_ptr<> because it was filtered by the rewriter for: - // #union - RAW_PTR_EXCLUSION TransferBufferInterface* transfer_buffer_; + raw_ptr<CommandBufferHelper> helper_; + raw_ptr<TransferBufferInterface> transfer_buffer_; }; template <typename T>
diff --git a/gpu/command_buffer/service/DEPS b/gpu/command_buffer/service/DEPS index f6471a3..3e63497 100644 --- a/gpu/command_buffer/service/DEPS +++ b/gpu/command_buffer/service/DEPS
@@ -13,5 +13,6 @@ "+components/viz/common/resources/resource_format_utils.h", "+components/viz/common/resources/resource_sizes.h", "+components/viz/common/resources/shared_image_format.h", + "+components/viz/common/resources/shared_image_format_utils.h", "+ui/ozone/buildflags.h", ]
diff --git a/gpu/command_buffer/service/gr_cache_controller.h b/gpu/command_buffer/service/gr_cache_controller.h index 82de4b4..8f74285 100644 --- a/gpu/command_buffer/service/gr_cache_controller.h +++ b/gpu/command_buffer/service/gr_cache_controller.h
@@ -6,7 +6,7 @@ #define GPU_COMMAND_BUFFER_SERVICE_GR_CACHE_CONTROLLER_H_ #include "base/cancelable_callback.h" -#include "base/memory/raw_ptr_exclusion.h" +#include "base/memory/raw_ptr.h" #include "base/task/single_thread_task_runner.h" #include "gpu/gpu_gles2_export.h" @@ -48,9 +48,7 @@ // cache. uint64_t current_idle_id_ = 0u; base::CancelableOnceClosure purge_gr_cache_cb_; - // This field is not a raw_ptr<> because it was filtered by the rewriter for: - // #union - RAW_PTR_EXCLUSION SharedContextState* context_state_; + raw_ptr<SharedContextState> context_state_; scoped_refptr<base::SingleThreadTaskRunner> task_runner_; };
diff --git a/gpu/command_buffer/service/gr_shader_cache.h b/gpu/command_buffer/service/gr_shader_cache.h index c5a94e9..3f64bfcf 100644 --- a/gpu/command_buffer/service/gr_shader_cache.h +++ b/gpu/command_buffer/service/gr_shader_cache.h
@@ -10,7 +10,7 @@ #include "base/containers/lru_cache.h" #include "base/hash/hash.h" #include "base/memory/memory_pressure_listener.h" -#include "base/memory/raw_ptr_exclusion.h" +#include "base/memory/raw_ptr.h" #include "base/synchronization/lock.h" #include "base/threading/platform_thread.h" #include "base/threading/thread_checker.h" @@ -41,9 +41,7 @@ ~ScopedCacheUse(); private: - // This field is not a raw_ptr<> because it was filtered by the rewriter - // for: #union - RAW_PTR_EXCLUSION GrShaderCache* cache_; + raw_ptr<GrShaderCache> cache_; }; GrShaderCache(size_t max_cache_size_bytes, Client* client); @@ -129,9 +127,7 @@ size_t cache_size_limit_ GUARDED_BY(lock_) = 0u; size_t curr_size_bytes_ GUARDED_BY(lock_) = 0u; Store store_ GUARDED_BY(lock_); - // This field is not a raw_ptr<> because it was filtered by the rewriter for: - // #union - RAW_PTR_EXCLUSION Client* const client_ GUARDED_BY(lock_); + raw_ptr<Client> const client_ GUARDED_BY(lock_); base::flat_set<int32_t> client_ids_to_cache_on_disk_ GUARDED_BY(lock_); // Multiple threads and hence multiple clients can be accessing the shader
diff --git a/gpu/command_buffer/service/raster_decoder.cc b/gpu/command_buffer/service/raster_decoder.cc index bf124128..d3a2ab5 100644 --- a/gpu/command_buffer/service/raster_decoder.cc +++ b/gpu/command_buffer/service/raster_decoder.cc
@@ -30,7 +30,7 @@ #include "cc/paint/paint_op_buffer.h" #include "cc/paint/transfer_cache_deserialize_helper.h" #include "cc/paint/transfer_cache_entry.h" -#include "components/viz/common/resources/resource_format_utils.h" +#include "components/viz/common/resources/shared_image_format_utils.h" #include "gpu/command_buffer/common/capabilities.h" #include "gpu/command_buffer/common/command_buffer_id.h" #include "gpu/command_buffer/common/constants.h"
diff --git a/gpu/command_buffer/service/shared_image/angle_vulkan_image_backing.cc b/gpu/command_buffer/service/shared_image/angle_vulkan_image_backing.cc index fb8e5bc6..64f8741 100644 --- a/gpu/command_buffer/service/shared_image/angle_vulkan_image_backing.cc +++ b/gpu/command_buffer/service/shared_image/angle_vulkan_image_backing.cc
@@ -6,7 +6,7 @@ #include "base/logging.h" #include "components/viz/common/gpu/vulkan_context_provider.h" -#include "components/viz/common/resources/resource_format_utils.h" +#include "components/viz/common/resources/shared_image_format_utils.h" #include "gpu/command_buffer/common/shared_image_usage.h" #include "gpu/command_buffer/service/shared_image/gl_texture_image_backing_helper.h" #include "gpu/command_buffer/service/shared_image/shared_image_format_service_utils.h"
diff --git a/gpu/command_buffer/service/shared_image/d3d_image_backing_factory_unittest.cc b/gpu/command_buffer/service/shared_image/d3d_image_backing_factory_unittest.cc index a80bd051..06115e48 100644 --- a/gpu/command_buffer/service/shared_image/d3d_image_backing_factory_unittest.cc +++ b/gpu/command_buffer/service/shared_image/d3d_image_backing_factory_unittest.cc
@@ -17,6 +17,7 @@ #include "cc/test/pixel_test_utils.h" #include "components/viz/common/resources/resource_format_utils.h" #include "components/viz/common/resources/shared_image_format.h" +#include "components/viz/common/resources/shared_image_format_utils.h" #include "gpu/command_buffer/common/shared_image_usage.h" #include "gpu/command_buffer/service/dxgi_shared_handle_manager.h" #include "gpu/command_buffer/service/shared_context_state.h"
diff --git a/gpu/command_buffer/service/shared_image/dcomp_surface_image_backing.cc b/gpu/command_buffer/service/shared_image/dcomp_surface_image_backing.cc index 91a128d..a39129d 100644 --- a/gpu/command_buffer/service/shared_image/dcomp_surface_image_backing.cc +++ b/gpu/command_buffer/service/shared_image/dcomp_surface_image_backing.cc
@@ -6,7 +6,7 @@ #include "base/metrics/histogram_functions.h" #include "base/trace_event/trace_event.h" -#include "components/viz/common/resources/resource_format_utils.h" +#include "components/viz/common/resources/shared_image_format_utils.h" #include "gpu/command_buffer/common/shared_image_usage.h" #include "gpu/command_buffer/service/shared_context_state.h" #include "gpu/command_buffer/service/shared_image/d3d_image_backing_factory.h"
diff --git a/gpu/command_buffer/service/shared_image/external_vk_image_backing.cc b/gpu/command_buffer/service/shared_image/external_vk_image_backing.cc index 3a903a2..f77fe468 100644 --- a/gpu/command_buffer/service/shared_image/external_vk_image_backing.cc +++ b/gpu/command_buffer/service/shared_image/external_vk_image_backing.cc
@@ -8,7 +8,7 @@ #include <vector> #include "base/bits.h" -#include "base/memory/raw_ptr_exclusion.h" +#include "base/memory/raw_ptr.h" #include "build/build_config.h" #include "components/viz/common/resources/resource_format_utils.h" #include "components/viz/common/resources/resource_sizes.h" @@ -78,9 +78,7 @@ GLuint id() const { return id_; } private: - // This field is not a raw_ptr<> because it was filtered by the rewriter for: - // #union - RAW_PTR_EXCLUSION gl::GLApi* const api_; + raw_ptr<gl::GLApi> const api_; GLuint id_; };
diff --git a/gpu/command_buffer/service/shared_image/external_vk_image_skia_representation.cc b/gpu/command_buffer/service/shared_image/external_vk_image_skia_representation.cc index 25da699..7d8a369 100644 --- a/gpu/command_buffer/service/shared_image/external_vk_image_skia_representation.cc +++ b/gpu/command_buffer/service/shared_image/external_vk_image_skia_representation.cc
@@ -6,7 +6,7 @@ #include <utility> -#include "components/viz/common/resources/resource_format_utils.h" +#include "components/viz/common/resources/shared_image_format_utils.h" #include "gpu/vulkan/vulkan_fence_helper.h" #include "gpu/vulkan/vulkan_implementation.h" #include "gpu/vulkan/vulkan_util.h"
diff --git a/gpu/command_buffer/service/shared_image/gl_texture_common_representations.cc b/gpu/command_buffer/service/shared_image/gl_texture_common_representations.cc index efb6237..eebc1c8 100644 --- a/gpu/command_buffer/service/shared_image/gl_texture_common_representations.cc +++ b/gpu/command_buffer/service/shared_image/gl_texture_common_representations.cc
@@ -4,7 +4,7 @@ #include "gpu/command_buffer/service/shared_image/gl_texture_common_representations.h" -#include "components/viz/common/resources/resource_format_utils.h" +#include "components/viz/common/resources/shared_image_format_utils.h" #include "gpu/command_buffer/service/shared_context_state.h" #include "gpu/command_buffer/service/skia_utils.h" #include "third_party/skia/include/core/SkColorSpace.h"
diff --git a/gpu/command_buffer/service/shared_image/iosurface_image_backing.mm b/gpu/command_buffer/service/shared_image/iosurface_image_backing.mm index 9d1fac6..0d825db5 100644 --- a/gpu/command_buffer/service/shared_image/iosurface_image_backing.mm +++ b/gpu/command_buffer/service/shared_image/iosurface_image_backing.mm
@@ -10,6 +10,7 @@ #include "components/viz/common/gpu/dawn_context_provider.h" #include "components/viz/common/resources/resource_format_utils.h" #include "components/viz/common/resources/resource_sizes.h" +#include "components/viz/common/resources/shared_image_format_utils.h" #include "gpu/command_buffer/common/shared_image_trace_utils.h" #include "gpu/command_buffer/common/shared_image_usage.h" #include "gpu/command_buffer/service/shared_context_state.h"
diff --git a/gpu/command_buffer/service/shared_image/raw_draw_image_backing.cc b/gpu/command_buffer/service/shared_image/raw_draw_image_backing.cc index 884e35d..c98f10d 100644 --- a/gpu/command_buffer/service/shared_image/raw_draw_image_backing.cc +++ b/gpu/command_buffer/service/shared_image/raw_draw_image_backing.cc
@@ -8,6 +8,7 @@ #include "base/types/optional_util.h" #include "cc/paint/paint_op_buffer.h" #include "components/viz/common/resources/resource_sizes.h" +#include "components/viz/common/resources/shared_image_format_utils.h" #include "gpu/command_buffer/common/shared_image_usage.h" #include "gpu/command_buffer/service/shared_context_state.h" #include "gpu/command_buffer/service/shared_image/shared_image_representation.h"
diff --git a/gpu/command_buffer/service/shared_image/shared_image_backing.cc b/gpu/command_buffer/service/shared_image/shared_image_backing.cc index 93bf70c2..76d0208 100644 --- a/gpu/command_buffer/service/shared_image/shared_image_backing.cc +++ b/gpu/command_buffer/service/shared_image/shared_image_backing.cc
@@ -8,7 +8,7 @@ #include "base/ranges/algorithm.h" #include "base/trace_event/process_memory_dump.h" #include "build/build_config.h" -#include "components/viz/common/resources/resource_format_utils.h" +#include "components/viz/common/resources/shared_image_format_utils.h" #include "gpu/command_buffer/common/mailbox.h" #include "gpu/command_buffer/common/shared_image_trace_utils.h" #include "gpu/command_buffer/common/shared_image_usage.h"
diff --git a/gpu/command_buffer/service/shared_image/shared_image_representation.cc b/gpu/command_buffer/service/shared_image/shared_image_representation.cc index 9de216c..6b985cb 100644 --- a/gpu/command_buffer/service/shared_image/shared_image_representation.cc +++ b/gpu/command_buffer/service/shared_image/shared_image_representation.cc
@@ -8,6 +8,7 @@ #include "base/strings/stringprintf.h" #include "build/build_config.h" #include "components/viz/common/resources/resource_format_utils.h" +#include "components/viz/common/resources/shared_image_format_utils.h" #include "gpu/command_buffer/service/shared_context_state.h" #include "gpu/command_buffer/service/shared_image/shared_image_format_service_utils.h" #include "gpu/command_buffer/service/texture_manager.h"
diff --git a/gpu/command_buffer/service/shared_image/shared_image_test_base.cc b/gpu/command_buffer/service/shared_image/shared_image_test_base.cc index 7ddacff..3b24b44 100644 --- a/gpu/command_buffer/service/shared_image/shared_image_test_base.cc +++ b/gpu/command_buffer/service/shared_image/shared_image_test_base.cc
@@ -10,6 +10,7 @@ #include "cc/test/pixel_comparator.h" #include "cc/test/pixel_test_utils.h" #include "components/viz/common/resources/resource_format_utils.h" +#include "components/viz/common/resources/shared_image_format_utils.h" #include "gpu/command_buffer/service/service_utils.h" #include "gpu/command_buffer/service/shared_image/shared_image_representation.h" #include "third_party/skia/include/core/SkImage.h"
diff --git a/gpu/command_buffer/service/shared_image/shared_memory_image_backing.cc b/gpu/command_buffer/service/shared_image/shared_memory_image_backing.cc index af8b065..9b6b2d4 100644 --- a/gpu/command_buffer/service/shared_image/shared_memory_image_backing.cc +++ b/gpu/command_buffer/service/shared_image/shared_memory_image_backing.cc
@@ -9,6 +9,7 @@ #include "base/notreached.h" #include "base/trace_event/process_memory_dump.h" #include "components/viz/common/resources/resource_sizes.h" +#include "components/viz/common/resources/shared_image_format_utils.h" #include "gpu/command_buffer/common/mailbox.h" #include "gpu/command_buffer/common/shared_image_trace_utils.h" #include "gpu/command_buffer/service/memory_tracking.h"
diff --git a/gpu/command_buffer/service/shared_image/skia_gl_image_representation.cc b/gpu/command_buffer/service/shared_image/skia_gl_image_representation.cc index efc6e254..de39e1c 100644 --- a/gpu/command_buffer/service/shared_image/skia_gl_image_representation.cc +++ b/gpu/command_buffer/service/shared_image/skia_gl_image_representation.cc
@@ -7,6 +7,7 @@ #include "base/check_op.h" #include "base/memory/ptr_util.h" #include "components/viz/common/resources/resource_format_utils.h" +#include "components/viz/common/resources/shared_image_format_utils.h" #include "gpu/command_buffer/service/shared_context_state.h" #include "gpu/command_buffer/service/shared_image/shared_image_format_service_utils.h" #include "gpu/command_buffer/service/skia_utils.h"
diff --git a/gpu/command_buffer/service/shared_image/skia_graphite_dawn_image_representation.cc b/gpu/command_buffer/service/shared_image/skia_graphite_dawn_image_representation.cc index b4dbe102..8e6ddc4 100644 --- a/gpu/command_buffer/service/shared_image/skia_graphite_dawn_image_representation.cc +++ b/gpu/command_buffer/service/shared_image/skia_graphite_dawn_image_representation.cc
@@ -7,7 +7,7 @@ #include "base/logging.h" #include "base/memory/ptr_util.h" #include "components/viz/common/gpu/dawn_context_provider.h" -#include "components/viz/common/resources/resource_format_utils.h" +#include "components/viz/common/resources/shared_image_format_utils.h" #include "gpu/command_buffer/service/shared_context_state.h" #include "third_party/skia/include/core/SkColorSpace.h" #include "third_party/skia/include/core/SkSurface.h"
diff --git a/gpu/command_buffer/service/shared_image/skia_vk_android_image_representation.cc b/gpu/command_buffer/service/shared_image/skia_vk_android_image_representation.cc index ff54269..fec4558 100644 --- a/gpu/command_buffer/service/shared_image/skia_vk_android_image_representation.cc +++ b/gpu/command_buffer/service/shared_image/skia_vk_android_image_representation.cc
@@ -7,7 +7,7 @@ #include <utility> #include "components/viz/common/gpu/vulkan_context_provider.h" -#include "components/viz/common/resources/resource_format_utils.h" +#include "components/viz/common/resources/shared_image_format_utils.h" #include "gpu/command_buffer/common/shared_image_usage.h" #include "gpu/command_buffer/service/mailbox_manager.h" #include "gpu/command_buffer/service/memory_tracking.h"
diff --git a/gpu/command_buffer/service/shared_image/skia_vk_ozone_image_representation.cc b/gpu/command_buffer/service/shared_image/skia_vk_ozone_image_representation.cc index 9988627..708e192 100644 --- a/gpu/command_buffer/service/shared_image/skia_vk_ozone_image_representation.cc +++ b/gpu/command_buffer/service/shared_image/skia_vk_ozone_image_representation.cc
@@ -7,7 +7,7 @@ #include <utility> #include "components/viz/common/gpu/vulkan_context_provider.h" -#include "components/viz/common/resources/resource_format_utils.h" +#include "components/viz/common/resources/shared_image_format_utils.h" #include "gpu/command_buffer/common/shared_image_usage.h" #include "gpu/command_buffer/service/external_semaphore_pool.h" #include "gpu/command_buffer/service/memory_tracking.h"
diff --git a/gpu/command_buffer/service/shared_image/wrapped_graphite_texture_backing.cc b/gpu/command_buffer/service/shared_image/wrapped_graphite_texture_backing.cc index fdc31791..ea91207 100644 --- a/gpu/command_buffer/service/shared_image/wrapped_graphite_texture_backing.cc +++ b/gpu/command_buffer/service/shared_image/wrapped_graphite_texture_backing.cc
@@ -7,7 +7,7 @@ #include <utility> #include "base/logging.h" -#include "components/viz/common/resources/resource_format_utils.h" +#include "components/viz/common/resources/shared_image_format_utils.h" #include "gpu/command_buffer/common/shared_image_usage.h" #include "gpu/command_buffer/service/shared_image/shared_image_format_service_utils.h" #include "gpu/command_buffer/service/shared_image/shared_image_representation.h"
diff --git a/gpu/command_buffer/service/shared_image/wrapped_sk_image_backing.cc b/gpu/command_buffer/service/shared_image/wrapped_sk_image_backing.cc index 954a3b2fc..b47aff7 100644 --- a/gpu/command_buffer/service/shared_image/wrapped_sk_image_backing.cc +++ b/gpu/command_buffer/service/shared_image/wrapped_sk_image_backing.cc
@@ -9,7 +9,7 @@ #include "base/logging.h" #include "base/task/bind_post_task.h" #include "base/task/single_thread_task_runner.h" -#include "components/viz/common/resources/resource_format_utils.h" +#include "components/viz/common/resources/shared_image_format_utils.h" #include "gpu/command_buffer/common/shared_image_usage.h" #include "gpu/command_buffer/service/shared_context_state.h" #include "gpu/command_buffer/service/shared_image/shared_image_representation.h"
diff --git a/gpu/command_buffer/service/shared_image/wrapped_sk_image_backing_factory.cc b/gpu/command_buffer/service/shared_image/wrapped_sk_image_backing_factory.cc index cf64fee58..2f2fdfbf 100644 --- a/gpu/command_buffer/service/shared_image/wrapped_sk_image_backing_factory.cc +++ b/gpu/command_buffer/service/shared_image/wrapped_sk_image_backing_factory.cc
@@ -7,8 +7,8 @@ #include "base/memory/scoped_refptr.h" #include "base/types/pass_key.h" #include "build/build_config.h" -#include "components/viz/common/resources/resource_format_utils.h" #include "components/viz/common/resources/shared_image_format.h" +#include "components/viz/common/resources/shared_image_format_utils.h" #include "gpu/command_buffer/common/shared_image_usage.h" #include "gpu/command_buffer/service/feature_info.h" #include "gpu/command_buffer/service/shared_context_state.h"
diff --git a/gpu/config/gpu_finch_features.cc b/gpu/config/gpu_finch_features.cc index 0d9a374..1a0a17d50 100644 --- a/gpu/config/gpu_finch_features.cc +++ b/gpu/config/gpu_finch_features.cc
@@ -376,6 +376,13 @@ "UseGpuSchedulerDfs", base::FEATURE_DISABLED_BY_DEFAULT); +// Use the ClientGmb interface to create GpuMemoryBuffers. This is supposed to +// reduce number of IPCs happening while creating GpuMemoryBuffers by allowing +// Renderers to do IPC directly to GPU process. +BASE_FEATURE(kUseClientGmbInterface, + "UseClientGmbInterface", + base::FEATURE_DISABLED_BY_DEFAULT); + // Enable YUV<->RGB conversion for video clients through passthrough command // decoder. BASE_FEATURE(kPassthroughYuvRgbConversion,
diff --git a/gpu/config/gpu_finch_features.h b/gpu/config/gpu_finch_features.h index b34516a0..77d6fb26e 100644 --- a/gpu/config/gpu_finch_features.h +++ b/gpu/config/gpu_finch_features.h
@@ -80,6 +80,8 @@ GPU_EXPORT BASE_DECLARE_FEATURE(kUseGpuSchedulerDfs); +GPU_EXPORT BASE_DECLARE_FEATURE(kUseClientGmbInterface); + #if BUILDFLAG(IS_ANDROID) // This flag is use additionally with kEnableDrDc to enable the feature for // vulkan enabled android devices.
diff --git a/ios/build/chrome_build.gni b/ios/build/chrome_build.gni index 5e7abb51..53929b9 100644 --- a/ios/build/chrome_build.gni +++ b/ios/build/chrome_build.gni
@@ -32,7 +32,7 @@ ios_enable_lockscreen_widget = true # Enable iOS shortcut widget in WidgetKit extension. - ios_enable_shortcuts_widget = false + ios_enable_shortcuts_widget = true # Label of the target providing implementation for AccountVerificationProvider. # Overridden when using the Google-internal repository to build Chrome on iOS.
diff --git a/ios/chrome/browser/passwords/password_controller_unittest.mm b/ios/chrome/browser/passwords/password_controller_unittest.mm index d2baed81..41ab3300 100644 --- a/ios/chrome/browser/passwords/password_controller_unittest.mm +++ b/ios/chrome/browser/passwords/password_controller_unittest.mm
@@ -2063,6 +2063,32 @@ FieldRendererId(), std::string()); } +// Tests that prompt is not shown automatically if the form is eligible only for +// manual fallback for saving. +TEST_F(PasswordControllerTest, + DetectNoSubmissionOnRemovedFormForManualFallback) { + ON_CALL(*store_, GetLogins) + .WillByDefault(WithArg<1>(InvokeEmptyConsumerWithForms(store_.get()))); + LoadHtml(@"" + "<form id='form1'>" + " <input id='username' type='text'>" + " <input id='one-time-code' type='password'>" + "</form>"); + WaitForFormManagersCreation(); + + std::string mainFrameID = GetMainWebFrameId(); + + SimulateUserTyping("form1", FormRendererId(1), "username", FieldRendererId(2), + "john", mainFrameID); + SimulateUserTyping("form1", FormRendererId(1), "one-time-code", + FieldRendererId(3), "123456", mainFrameID); + + EXPECT_CALL(*weak_client_, PromptUserToSaveOrUpdatePasswordPtr).Times(0); + + SimulateFormActivityObserverSignal("password_form_removed", FormRendererId(1), + FieldRendererId(), std::string()); +} + // Tests that submission is detected on removal of the form that had user input. TEST_F(PasswordControllerTest, DetectSubmissionOnIFrameDetach) { ON_CALL(*store_, GetLogins)
diff --git a/ios/chrome/browser/shared/public/features/features.mm b/ios/chrome/browser/shared/public/features/features.mm index 9051f8a..f1cda14 100644 --- a/ios/chrome/browser/shared/public/features/features.mm +++ b/ios/chrome/browser/shared/public/features/features.mm
@@ -208,7 +208,7 @@ BASE_FEATURE(kAddToHomeScreen, "AddToHomeScreen", - base::FEATURE_DISABLED_BY_DEFAULT); + base::FEATURE_ENABLED_BY_DEFAULT); const char kAddToHomeScreenDisableIncognitoParam[] = "AddToHomeScreenDisableIncognitoParam"; @@ -221,7 +221,7 @@ return true; } return !base::GetFieldTrialParamByFeatureAsBool( - kAddToHomeScreen, kAddToHomeScreenDisableIncognitoParam, false); + kAddToHomeScreen, kAddToHomeScreenDisableIncognitoParam, true); } BASE_FEATURE(kNewNTPOmniboxLayout,
diff --git a/ios/chrome/browser/ui/overlays/BUILD.gn b/ios/chrome/browser/ui/overlays/BUILD.gn index 9e4c6303..6f863678 100644 --- a/ios/chrome/browser/ui/overlays/BUILD.gn +++ b/ios/chrome/browser/ui/overlays/BUILD.gn
@@ -10,7 +10,6 @@ sources = [ "overlay_container_coordinator+initialization.h", "overlay_container_coordinator.mm", - "overlay_coordinator_factory+initialization.h", "overlay_coordinator_factory.mm", "overlay_presentation_context_coordinator.h", "overlay_presentation_context_coordinator.mm", @@ -39,9 +38,14 @@ "//ios/chrome/browser/overlays", "//ios/chrome/browser/shared/coordinator/chrome_coordinator", "//ios/chrome/browser/ui/fullscreen", - "//ios/chrome/browser/ui/overlays/infobar_banner", - "//ios/chrome/browser/ui/overlays/infobar_modal", - "//ios/chrome/browser/ui/overlays/web_content_area", + "//ios/chrome/browser/ui/overlays/infobar_banner:coordinators", + "//ios/chrome/browser/ui/overlays/infobar_banner/translate:coordinators", + "//ios/chrome/browser/ui/overlays/infobar_modal/autofill_address_profile", + "//ios/chrome/browser/ui/overlays/infobar_modal/passwords", + "//ios/chrome/browser/ui/overlays/infobar_modal/permissions", + "//ios/chrome/browser/ui/overlays/infobar_modal/save_card", + "//ios/chrome/browser/ui/overlays/infobar_modal/translate", + "//ios/chrome/browser/ui/overlays/web_content_area/alerts", "//ios/chrome/common/ui/util", ] }
diff --git a/ios/chrome/browser/ui/overlays/infobar_banner/BUILD.gn b/ios/chrome/browser/ui/overlays/infobar_banner/BUILD.gn index 1cddf6e..e4724a0 100644 --- a/ios/chrome/browser/ui/overlays/infobar_banner/BUILD.gn +++ b/ios/chrome/browser/ui/overlays/infobar_banner/BUILD.gn
@@ -2,18 +2,6 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -source_set("infobar_banner") { - public = [ "infobar_banner_supported_overlay_coordinator_classes.h" ] - sources = [ "infobar_banner_supported_overlay_coordinator_classes.mm" ] - - configs += [ "//build/config/compiler:enable_arc" ] - - deps = [ - ":coordinators", - "//ios/chrome/browser/ui/overlays/infobar_banner/translate:coordinators", - ] -} - source_set("coordinators") { sources = [ "infobar_banner_overlay_coordinator.h",
diff --git a/ios/chrome/browser/ui/overlays/infobar_banner/infobar_banner_supported_overlay_coordinator_classes.h b/ios/chrome/browser/ui/overlays/infobar_banner/infobar_banner_supported_overlay_coordinator_classes.h deleted file mode 100644 index 80c5a17..0000000 --- a/ios/chrome/browser/ui/overlays/infobar_banner/infobar_banner_supported_overlay_coordinator_classes.h +++ /dev/null
@@ -1,18 +0,0 @@ -// Copyright 2019 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef IOS_CHROME_BROWSER_UI_OVERLAYS_INFOBAR_BANNER_INFOBAR_BANNER_SUPPORTED_OVERLAY_COORDINATOR_CLASSES_H_ -#define IOS_CHROME_BROWSER_UI_OVERLAYS_INFOBAR_BANNER_INFOBAR_BANNER_SUPPORTED_OVERLAY_COORDINATOR_CLASSES_H_ - -#import <Foundation/Foundation.h> - -namespace infobar_banner { - -// Returns the supported OverlayRequestCoordinator classes for -// OverlayModality::kInfobarBanner. -NSArray<Class>* GetSupportedOverlayCoordinatorClasses(); - -} // infobar_banner - -#endif // IOS_CHROME_BROWSER_UI_OVERLAYS_INFOBAR_BANNER_INFOBAR_BANNER_SUPPORTED_OVERLAY_COORDINATOR_CLASSES_H_
diff --git a/ios/chrome/browser/ui/overlays/infobar_banner/infobar_banner_supported_overlay_coordinator_classes.mm b/ios/chrome/browser/ui/overlays/infobar_banner/infobar_banner_supported_overlay_coordinator_classes.mm deleted file mode 100644 index b4e5b04..0000000 --- a/ios/chrome/browser/ui/overlays/infobar_banner/infobar_banner_supported_overlay_coordinator_classes.mm +++ /dev/null
@@ -1,23 +0,0 @@ -// Copyright 2019 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import "ios/chrome/browser/ui/overlays/infobar_banner/infobar_banner_supported_overlay_coordinator_classes.h" - -#import "ios/chrome/browser/ui/overlays/infobar_banner/infobar_banner_overlay_coordinator.h" -#import "ios/chrome/browser/ui/overlays/infobar_banner/translate/translate_infobar_placeholder_overlay_coordinator.h" - -#if !defined(__has_feature) || !__has_feature(objc_arc) -#error "This file requires ARC support." -#endif - -namespace infobar_banner { - -NSArray<Class>* GetSupportedOverlayCoordinatorClasses() { - return @[ - [InfobarBannerOverlayCoordinator class], - [TranslateInfobarPlaceholderOverlayCoordinator class] - ]; -} - -} // infobar_banner
diff --git a/ios/chrome/browser/ui/overlays/infobar_modal/BUILD.gn b/ios/chrome/browser/ui/overlays/infobar_modal/BUILD.gn index 8f3542e..835ab11f 100644 --- a/ios/chrome/browser/ui/overlays/infobar_modal/BUILD.gn +++ b/ios/chrome/browser/ui/overlays/infobar_modal/BUILD.gn
@@ -2,21 +2,6 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -source_set("infobar_modal") { - public = [ "infobar_modal_supported_overlay_coordinator_classes.h" ] - sources = [ "infobar_modal_supported_overlay_coordinator_classes.mm" ] - - configs += [ "//build/config/compiler:enable_arc" ] - - deps = [ - "//ios/chrome/browser/ui/overlays/infobar_modal/autofill_address_profile", - "//ios/chrome/browser/ui/overlays/infobar_modal/passwords", - "//ios/chrome/browser/ui/overlays/infobar_modal/permissions", - "//ios/chrome/browser/ui/overlays/infobar_modal/save_card", - "//ios/chrome/browser/ui/overlays/infobar_modal/translate", - ] -} - source_set("coordinators") { sources = [ "infobar_modal_overlay_coordinator+modal_configuration.h",
diff --git a/ios/chrome/browser/ui/overlays/infobar_modal/infobar_modal_supported_overlay_coordinator_classes.h b/ios/chrome/browser/ui/overlays/infobar_modal/infobar_modal_supported_overlay_coordinator_classes.h deleted file mode 100644 index 3e334fe..0000000 --- a/ios/chrome/browser/ui/overlays/infobar_modal/infobar_modal_supported_overlay_coordinator_classes.h +++ /dev/null
@@ -1,18 +0,0 @@ -// Copyright 2019 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef IOS_CHROME_BROWSER_UI_OVERLAYS_INFOBAR_MODAL_INFOBAR_MODAL_SUPPORTED_OVERLAY_COORDINATOR_CLASSES_H_ -#define IOS_CHROME_BROWSER_UI_OVERLAYS_INFOBAR_MODAL_INFOBAR_MODAL_SUPPORTED_OVERLAY_COORDINATOR_CLASSES_H_ - -#import <Foundation/Foundation.h> - -namespace infobar_modal { - -// Returns the supported OverlayRequestCoordinator classes for -// OverlayModality::kInfobarModal. -NSArray<Class>* GetSupportedOverlayCoordinatorClasses(); - -} // infobar_modal - -#endif // IOS_CHROME_BROWSER_UI_OVERLAYS_INFOBAR_MODAL_INFOBAR_MODAL_SUPPORTED_OVERLAY_COORDINATOR_CLASSES_H_
diff --git a/ios/chrome/browser/ui/overlays/infobar_modal/infobar_modal_supported_overlay_coordinator_classes.mm b/ios/chrome/browser/ui/overlays/infobar_modal/infobar_modal_supported_overlay_coordinator_classes.mm deleted file mode 100644 index b77ca76..0000000 --- a/ios/chrome/browser/ui/overlays/infobar_modal/infobar_modal_supported_overlay_coordinator_classes.mm +++ /dev/null
@@ -1,34 +0,0 @@ -// Copyright 2019 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import "ios/chrome/browser/ui/overlays/infobar_modal/infobar_modal_supported_overlay_coordinator_classes.h" - -#import "ios/chrome/browser/ui/overlays/infobar_modal/autofill_address_profile/save_address_profile_infobar_modal_overlay_coordinator.h" -#import "ios/chrome/browser/ui/overlays/infobar_modal/passwords/password_infobar_modal_overlay_coordinator.h" -#import "ios/chrome/browser/ui/overlays/infobar_modal/permissions/permissions_infobar_modal_overlay_coordinator.h" -#import "ios/chrome/browser/ui/overlays/infobar_modal/save_card/save_card_infobar_modal_overlay_coordinator.h" -#import "ios/chrome/browser/ui/overlays/infobar_modal/translate/translate_infobar_modal_overlay_coordinator.h" - -#if !defined(__has_feature) || !__has_feature(objc_arc) -#error "This file requires ARC support." -#endif - -namespace infobar_modal { - -NSArray<Class>* GetSupportedOverlayCoordinatorClasses() { - NSMutableArray<Class>* coordinatorClasses = - [[NSMutableArray alloc] initWithArray:@[ - [PasswordInfobarModalOverlayCoordinator class], - [SaveAddressProfileInfobarModalOverlayCoordinator class], - [SaveCardInfobarModalOverlayCoordinator class], - [TranslateInfobarModalOverlayCoordinator class], - ]]; - if (@available(iOS 15.0, *)) { - [coordinatorClasses - addObject:[PermissionsInfobarModalOverlayCoordinator class]]; - } - return [coordinatorClasses copy]; -} - -} // infobar_modal
diff --git a/ios/chrome/browser/ui/overlays/overlay_coordinator_factory+initialization.h b/ios/chrome/browser/ui/overlays/overlay_coordinator_factory+initialization.h deleted file mode 100644 index f2e9ed7e..0000000 --- a/ios/chrome/browser/ui/overlays/overlay_coordinator_factory+initialization.h +++ /dev/null
@@ -1,18 +0,0 @@ -// Copyright 2019 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef IOS_CHROME_BROWSER_UI_OVERLAYS_OVERLAY_COORDINATOR_FACTORY_INITIALIZATION_H_ -#define IOS_CHROME_BROWSER_UI_OVERLAYS_OVERLAY_COORDINATOR_FACTORY_INITIALIZATION_H_ - -#import "ios/chrome/browser/ui/overlays/overlay_coordinator_factory.h" - -@interface OverlayRequestCoordinatorFactory (Initialization) -// Initializer for a factory that supports the OverlayRequestCoordinator types -// in `supportedOverlayClasses`. -- (instancetype)initWithBrowser:(Browser*)browser - supportedOverlayRequestCoordinatorClasses: - (NSArray<Class>*)supportedOverlayClasses; -@end - -#endif // IOS_CHROME_BROWSER_UI_OVERLAYS_OVERLAY_COORDINATOR_FACTORY_INITIALIZATION_H_
diff --git a/ios/chrome/browser/ui/overlays/overlay_coordinator_factory.h b/ios/chrome/browser/ui/overlays/overlay_coordinator_factory.h index 3fdbfd6..d5c45fd 100644 --- a/ios/chrome/browser/ui/overlays/overlay_coordinator_factory.h +++ b/ios/chrome/browser/ui/overlays/overlay_coordinator_factory.h
@@ -18,12 +18,10 @@ // coordinators for a request. @interface OverlayRequestCoordinatorFactory : NSObject -// Returns a coordinator factory for `browser` at `modality`. -+ (instancetype)factoryForBrowser:(Browser*)browser - modality:(OverlayModality)modality; - -// OverlayRequestCoordinatorFactory must be fetched using -// |+factoryForBrowser:modality:`. +// Designated initializer. +- (instancetype)initWithBrowser:(Browser*)browser + modality:(OverlayModality)modality + NS_DESIGNATED_INITIALIZER; - (instancetype)init NS_UNAVAILABLE; // Returns whether the OverlayRequestCoordinator subclass responsible for
diff --git a/ios/chrome/browser/ui/overlays/overlay_coordinator_factory.mm b/ios/chrome/browser/ui/overlays/overlay_coordinator_factory.mm index a819125..26e5b9b1 100644 --- a/ios/chrome/browser/ui/overlays/overlay_coordinator_factory.mm +++ b/ios/chrome/browser/ui/overlays/overlay_coordinator_factory.mm
@@ -9,54 +9,34 @@ #import "base/check.h" #import "base/notreached.h" #import "ios/chrome/browser/overlays/public/overlay_request_support.h" -#import "ios/chrome/browser/ui/overlays/infobar_banner/infobar_banner_supported_overlay_coordinator_classes.h" -#import "ios/chrome/browser/ui/overlays/infobar_modal/infobar_modal_supported_overlay_coordinator_classes.h" -#import "ios/chrome/browser/ui/overlays/overlay_coordinator_factory+initialization.h" +#import "ios/chrome/browser/ui/overlays/infobar_banner/infobar_banner_overlay_coordinator.h" +#import "ios/chrome/browser/ui/overlays/infobar_banner/translate/translate_infobar_placeholder_overlay_coordinator.h" +#import "ios/chrome/browser/ui/overlays/infobar_modal/autofill_address_profile/save_address_profile_infobar_modal_overlay_coordinator.h" +#import "ios/chrome/browser/ui/overlays/infobar_modal/passwords/password_infobar_modal_overlay_coordinator.h" +#import "ios/chrome/browser/ui/overlays/infobar_modal/permissions/permissions_infobar_modal_overlay_coordinator.h" +#import "ios/chrome/browser/ui/overlays/infobar_modal/save_card/save_card_infobar_modal_overlay_coordinator.h" +#import "ios/chrome/browser/ui/overlays/infobar_modal/translate/translate_infobar_modal_overlay_coordinator.h" #import "ios/chrome/browser/ui/overlays/overlay_request_coordinator.h" -#import "ios/chrome/browser/ui/overlays/web_content_area/web_content_area_supported_overlay_coordinator_classes.h" +#import "ios/chrome/browser/ui/overlays/web_content_area/alerts/alert_overlay_coordinator.h" #if !defined(__has_feature) || !__has_feature(objc_arc) #error "This file requires ARC support." #endif -@interface OverlayRequestCoordinatorFactory () -// The Browser passed on initialization. -@property(nonatomic, readonly) Browser* browser; -// The OverlayRequestCoordinator subclasses that are supported at the modality -// associated with this coordinator factory. -@property(nonatomic, readonly) - NSArray<Class>* supportedOverlayRequestCoordinatorClasses; -@end +@implementation OverlayRequestCoordinatorFactory { + Browser* _browser; + OverlayModality _modality; +} -@implementation OverlayRequestCoordinatorFactory +- (instancetype)initWithBrowser:(Browser*)browser + modality:(OverlayModality)modality { + if (self = [super init]) { + _browser = browser; + DCHECK(_browser); -+ (instancetype)factoryForBrowser:(Browser*)browser - modality:(OverlayModality)modality { - DCHECK(browser); - NSArray<Class>* supportedCoordinatorClasses = @[]; - switch (modality) { - case OverlayModality::kTesting: - // Use TestOverlayRequestCoordinatorFactory to create factories for - // OverlayModality::kTesting. - // TODO(crbug.com/1056837): Remove requirement once modalities are - // converted to no longer use enums. - NOTREACHED(); - break; - case OverlayModality::kWebContentArea: - supportedCoordinatorClasses = - web_content_area::GetSupportedOverlayCoordinatorClasses(); - break; - case OverlayModality::kInfobarBanner: - supportedCoordinatorClasses = - infobar_banner::GetSupportedOverlayCoordinatorClasses(); - break; - case OverlayModality::kInfobarModal: - supportedCoordinatorClasses = - infobar_modal::GetSupportedOverlayCoordinatorClasses(); - break; + _modality = modality; } - return [[self alloc] initWithBrowser:browser - supportedOverlayRequestCoordinatorClasses:supportedCoordinatorClasses]; + return self; } - (BOOL)coordinatorForRequestUsesChildViewController:(OverlayRequest*)request { @@ -70,7 +50,7 @@ baseViewController:(UIViewController*)baseViewController { return [[[self coordinatorClassForRequest:request] alloc] initWithBaseViewController:baseViewController - browser:self.browser + browser:_browser request:request delegate:delegate]; } @@ -79,31 +59,53 @@ // Returns the OverlayRequestCoordinator subclass responsible for showing // `request`'s overlay UI. +// TODO(crbug.com/1447483): Clean the switch when the default flow is added. - (Class)coordinatorClassForRequest:(OverlayRequest*)request { - NSArray<Class>* supportedClasses = - self.supportedOverlayRequestCoordinatorClasses; - for (Class coordinatorClass in supportedClasses) { - if ([coordinatorClass requestSupport]->IsRequestSupported(request)) - return coordinatorClass; + switch (_modality) { + case OverlayModality::kTesting: + // Use TestOverlayRequestCoordinatorFactory to create factories for + // OverlayModality::kTesting. + // TODO(crbug.com/1056837): Remove requirement once modalities are + // converted to no longer use enums. + NOTREACHED() << "Received unsupported modality."; + break; + return nil; + case OverlayModality::kWebContentArea: + return [AlertOverlayCoordinator class]; + case OverlayModality::kInfobarBanner: + if ([TranslateInfobarPlaceholderOverlayCoordinator requestSupport] + ->IsRequestSupported(request)) { + return [TranslateInfobarPlaceholderOverlayCoordinator class]; + } + return [InfobarBannerOverlayCoordinator class]; + case OverlayModality::kInfobarModal: + if ([PasswordInfobarModalOverlayCoordinator requestSupport] + ->IsRequestSupported(request)) { + return [PasswordInfobarModalOverlayCoordinator class]; + } + if ([SaveCardInfobarModalOverlayCoordinator requestSupport] + ->IsRequestSupported(request)) { + return [SaveCardInfobarModalOverlayCoordinator class]; + } + if ([SaveAddressProfileInfobarModalOverlayCoordinator requestSupport] + ->IsRequestSupported(request)) { + return [SaveAddressProfileInfobarModalOverlayCoordinator class]; + } + if ([TranslateInfobarModalOverlayCoordinator requestSupport] + ->IsRequestSupported(request)) { + return [TranslateInfobarModalOverlayCoordinator class]; + } + if (@available(iOS 15.0, *)) { + if ([PermissionsInfobarModalOverlayCoordinator requestSupport] + ->IsRequestSupported(request)) { + return [PermissionsInfobarModalOverlayCoordinator class]; + } + } + break; } - NOTREACHED() << "Received unsupported request type."; + return nil; -} - -@end - -@implementation OverlayRequestCoordinatorFactory (Initialization) - -- (instancetype)initWithBrowser:(Browser*)browser - supportedOverlayRequestCoordinatorClasses: - (NSArray<Class>*)supportedOverlayClasses { - if (self = [super init]) { - _browser = browser; - DCHECK(_browser); - _supportedOverlayRequestCoordinatorClasses = supportedOverlayClasses; - DCHECK(_supportedOverlayRequestCoordinatorClasses.count); - } - return self; + NOTREACHED() << "Received unsupported request type."; } @end
diff --git a/ios/chrome/browser/ui/overlays/overlay_presentation_context_impl.mm b/ios/chrome/browser/ui/overlays/overlay_presentation_context_impl.mm index 7f53488..44f18b65 100644 --- a/ios/chrome/browser/ui/overlays/overlay_presentation_context_impl.mm +++ b/ios/chrome/browser/ui/overlays/overlay_presentation_context_impl.mm
@@ -59,8 +59,8 @@ auto& ui_delegate = ui_delegates_[modality]; if (!ui_delegate) { OverlayRequestCoordinatorFactory* factory = - [OverlayRequestCoordinatorFactory factoryForBrowser:browser_ - modality:modality]; + [[OverlayRequestCoordinatorFactory alloc] initWithBrowser:browser_ + modality:modality]; ui_delegate = base::WrapUnique( new OverlayPresentationContextImpl(browser_, modality, factory)); }
diff --git a/ios/chrome/browser/ui/overlays/test/test_overlay_presentation_context.mm b/ios/chrome/browser/ui/overlays/test/test_overlay_presentation_context.mm index 092a5cf..58a430622 100644 --- a/ios/chrome/browser/ui/overlays/test/test_overlay_presentation_context.mm +++ b/ios/chrome/browser/ui/overlays/test/test_overlay_presentation_context.mm
@@ -15,6 +15,7 @@ browser, OverlayModality::kTesting, [[TestOverlayRequestCoordinatorFactory alloc] - initWithBrowser:browser]) {} + initWithBrowser:browser + modality:OverlayModality::kTesting]) {} TestOverlayPresentationContext::~TestOverlayPresentationContext() = default;
diff --git a/ios/chrome/browser/ui/overlays/test/test_overlay_request_coordinator_factory.h b/ios/chrome/browser/ui/overlays/test/test_overlay_request_coordinator_factory.h index d519cee..f6693186 100644 --- a/ios/chrome/browser/ui/overlays/test/test_overlay_request_coordinator_factory.h +++ b/ios/chrome/browser/ui/overlays/test/test_overlay_request_coordinator_factory.h
@@ -13,9 +13,7 @@ // OverlayModality is converted from an enum to a class. @interface TestOverlayRequestCoordinatorFactory : OverlayRequestCoordinatorFactory -// Initializer for a factory that vends OverlayRequestCoordinators for `browser` -// at OverlayModality::kTesting. -- (instancetype)initWithBrowser:(Browser*)browser; + @end #endif // IOS_CHROME_BROWSER_UI_OVERLAYS_TEST_TEST_OVERLAY_REQUEST_COORDINATOR_FACTORY_H_
diff --git a/ios/chrome/browser/ui/overlays/test/test_overlay_request_coordinator_factory.mm b/ios/chrome/browser/ui/overlays/test/test_overlay_request_coordinator_factory.mm index bbebbd7..b23fffd5 100644 --- a/ios/chrome/browser/ui/overlays/test/test_overlay_request_coordinator_factory.mm +++ b/ios/chrome/browser/ui/overlays/test/test_overlay_request_coordinator_factory.mm
@@ -4,7 +4,7 @@ #import "ios/chrome/browser/ui/overlays/test/test_overlay_request_coordinator_factory.h" -#import "ios/chrome/browser/ui/overlays/overlay_coordinator_factory+initialization.h" +#import "ios/chrome/browser/overlays/public/overlay_request_support.h" #import "ios/chrome/browser/ui/overlays/test_modality/test_contained_overlay_coordinator.h" #import "ios/chrome/browser/ui/overlays/test_modality/test_presented_overlay_coordinator.h" @@ -14,11 +14,13 @@ @implementation TestOverlayRequestCoordinatorFactory -- (instancetype)initWithBrowser:(Browser*)browser { - return [super initWithBrowser:browser - supportedOverlayRequestCoordinatorClasses: - @ [[TestContainedOverlayCoordinator class], - [TestPresentedOverlayCoordinator class]]]; +- (Class)coordinatorClassForRequest:(OverlayRequest*)request { + if ([TestContainedOverlayCoordinator requestSupport]->IsRequestSupported( + request)) { + return [TestContainedOverlayCoordinator class]; + } else { + return [TestPresentedOverlayCoordinator class]; + } } @end
diff --git a/ios/chrome/browser/ui/overlays/web_content_area/BUILD.gn b/ios/chrome/browser/ui/overlays/web_content_area/BUILD.gn deleted file mode 100644 index f462f94..0000000 --- a/ios/chrome/browser/ui/overlays/web_content_area/BUILD.gn +++ /dev/null
@@ -1,16 +0,0 @@ -# Copyright 2020 The Chromium Authors -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -source_set("web_content_area") { - public = [ "web_content_area_supported_overlay_coordinator_classes.h" ] - sources = [ "web_content_area_supported_overlay_coordinator_classes.mm" ] - - configs += [ "//build/config/compiler:enable_arc" ] - - deps = [ - "//base", - "//ios/chrome/browser/ui/overlays:coordinators", - "//ios/chrome/browser/ui/overlays/web_content_area/alerts", - ] -}
diff --git a/ios/chrome/browser/ui/overlays/web_content_area/web_content_area_supported_overlay_coordinator_classes.h b/ios/chrome/browser/ui/overlays/web_content_area/web_content_area_supported_overlay_coordinator_classes.h deleted file mode 100644 index 6a239a2..0000000 --- a/ios/chrome/browser/ui/overlays/web_content_area/web_content_area_supported_overlay_coordinator_classes.h +++ /dev/null
@@ -1,18 +0,0 @@ -// Copyright 2019 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef IOS_CHROME_BROWSER_UI_OVERLAYS_WEB_CONTENT_AREA_WEB_CONTENT_AREA_SUPPORTED_OVERLAY_COORDINATOR_CLASSES_H_ -#define IOS_CHROME_BROWSER_UI_OVERLAYS_WEB_CONTENT_AREA_WEB_CONTENT_AREA_SUPPORTED_OVERLAY_COORDINATOR_CLASSES_H_ - -#import <Foundation/Foundation.h> - -namespace web_content_area { - -// Returns the supported OverlayRequestCoordinator classes for -// OverlayModality::kWebContentArea. -NSArray<Class>* GetSupportedOverlayCoordinatorClasses(); - -} // web_content_area - -#endif // IOS_CHROME_BROWSER_UI_OVERLAYS_WEB_CONTENT_AREA_WEB_CONTENT_AREA_SUPPORTED_OVERLAY_COORDINATOR_CLASSES_H_
diff --git a/ios/chrome/browser/ui/overlays/web_content_area/web_content_area_supported_overlay_coordinator_classes.mm b/ios/chrome/browser/ui/overlays/web_content_area/web_content_area_supported_overlay_coordinator_classes.mm deleted file mode 100644 index e9c60a0..0000000 --- a/ios/chrome/browser/ui/overlays/web_content_area/web_content_area_supported_overlay_coordinator_classes.mm +++ /dev/null
@@ -1,19 +0,0 @@ -// Copyright 2019 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import "ios/chrome/browser/ui/overlays/web_content_area/web_content_area_supported_overlay_coordinator_classes.h" - -#import "ios/chrome/browser/ui/overlays/web_content_area/alerts/alert_overlay_coordinator.h" - -#if !defined(__has_feature) || !__has_feature(objc_arc) -#error "This file requires ARC support." -#endif - -namespace web_content_area { - -NSArray<Class>* GetSupportedOverlayCoordinatorClasses() { - return @[ [AlertOverlayCoordinator class] ]; -} - -} // web_content_area
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_grid/grid/grid_view_controller.mm b/ios/chrome/browser/ui/tab_switcher/tab_grid/grid/grid_view_controller.mm index e1e53c92..2809b48 100644 --- a/ios/chrome/browser/ui/tab_switcher/tab_grid/grid/grid_view_controller.mm +++ b/ios/chrome/browser/ui/tab_switcher/tab_grid/grid/grid_view_controller.mm
@@ -58,10 +58,10 @@ #error "This file requires ARC support." #endif -class ScrollingTimeLogger { +class ScopedScrollingTimeLogger { public: - ScrollingTimeLogger() : start_(base::TimeTicks::Now()) {} - ~ScrollingTimeLogger() { + ScopedScrollingTimeLogger() : start_(base::TimeTicks::Now()) {} + ~ScopedScrollingTimeLogger() { base::TimeDelta duration = base::TimeTicks::Now() - start_; base::UmaHistogramTimes("IOS.TabSwitcher.TimeSpentScrolling", duration); } @@ -197,7 +197,7 @@ @implementation GridViewController { // Tracks when the grid view is scrolling. Create a new instance to start // timing and reset to stop and log the associated time histogram. - std::unique_ptr<ScrollingTimeLogger> _scrollingTimeLogger; + std::unique_ptr<ScopedScrollingTimeLogger> _scopedScrollingTimeLogger; } @synthesize thumbStripEnabled = _thumbStripEnabled; @@ -1147,18 +1147,18 @@ - (void)scrollViewWillBeginDragging:(UIScrollView*)scrollView { [self.delegate gridViewControllerWillBeginDragging:self]; base::RecordAction(base::UserMetricsAction("MobileTabGridUserScrolled")); - _scrollingTimeLogger = std::make_unique<ScrollingTimeLogger>(); + _scopedScrollingTimeLogger = std::make_unique<ScopedScrollingTimeLogger>(); } - (void)scrollViewDidEndDragging:(UIScrollView*)scrollView willDecelerate:(BOOL)decelerate { if (!decelerate) { - _scrollingTimeLogger = nullptr; + _scopedScrollingTimeLogger = nullptr; } } - (void)scrollViewDidEndDecelerating:(UIScrollView*)scrollView { - _scrollingTimeLogger = nullptr; + _scopedScrollingTimeLogger = nullptr; } - (void)scrollViewDidScrollToTop:(UIScrollView*)scrollView {
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_grid/inactive_tabs/inactive_tabs_coordinator.h b/ios/chrome/browser/ui/tab_switcher/tab_grid/inactive_tabs/inactive_tabs_coordinator.h index 8dac446..c36eef64d 100644 --- a/ios/chrome/browser/ui/tab_switcher/tab_grid/inactive_tabs/inactive_tabs_coordinator.h +++ b/ios/chrome/browser/ui/tab_switcher/tab_grid/inactive_tabs/inactive_tabs_coordinator.h
@@ -25,14 +25,16 @@ @end -// Handles interaction with the inactive tabs view controller. +// Handles interaction for Inactive Tabs. // // This coordinator lifetime starts when the regular tab grid is started, and -// stops only when the regular tab grid is stopped. `start` creates the relevant -// objects (VC, mediator, etc.), but doesn't show the VC. Call `show`/`hide` to -// display/hide the inactive tabs grid. By having this coordinator alive, the -// mediator can react to "Close All" signals, and the VC can be re-shown as is -// (i.e. same scroll position). +// stops only when the regular tab grid is stopped. `start` creates the mediator +// but not the VC. By having this coordinator and its mediator always alive, the +// mediator can react to "Close All" signals even when the Inactive Tabs UI is +// not shown. +// The VC (i.e. Inactive Tabs UI) is created and shown when calling `show`, and +// hidden and destroyed when calling `hide`. This can be called multiple times. +// TODO(crbug.com/1448025): Keep the scrolling position between showings. @interface InactiveTabsCoordinator : ChromeCoordinator // The GridCommands receiver handling "Close All"-related commands.
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_grid/inactive_tabs/inactive_tabs_coordinator.mm b/ios/chrome/browser/ui/tab_switcher/tab_grid/inactive_tabs/inactive_tabs_coordinator.mm index 33d1f71..fe9fe53c 100644 --- a/ios/chrome/browser/ui/tab_switcher/tab_grid/inactive_tabs/inactive_tabs_coordinator.mm +++ b/ios/chrome/browser/ui/tab_switcher/tab_grid/inactive_tabs/inactive_tabs_coordinator.mm
@@ -184,6 +184,30 @@ - (void)start { [super start]; + // Create the mediator. + SessionRestorationBrowserAgent* sessionRestorationBrowserAgent = + SessionRestorationBrowserAgent::FromBrowser(self.browser); + SnapshotBrowserAgent* snapshotBrowserAgent = + SnapshotBrowserAgent::FromBrowser(self.browser); + sessions::TabRestoreService* tabRestoreService = + IOSChromeTabRestoreServiceFactory::GetForBrowserState( + self.browser->GetBrowserState()); + + self.mediator = [[InactiveTabsMediator alloc] + initWithWebStateList:self.browser->GetWebStateList() + prefService:GetApplicationContext()->GetLocalState() + sessionRestorationAgent:sessionRestorationBrowserAgent + snapshotAgent:snapshotBrowserAgent + tabRestoreService:tabRestoreService]; +} + +- (void)show { + if (self.showing) { + return; + } + self.showing = YES; + base::RecordAction(base::UserMetricsAction("MobileInactiveTabGridEntered")); + // Create the view controller. self.viewController = [[InactiveTabsViewController alloc] init]; self.viewController.delegate = self; @@ -196,32 +220,9 @@ edgeSwipeRecognizer.edges = UIRectEdgeLeft; [self.viewController.view addGestureRecognizer:edgeSwipeRecognizer]; - // Create the mediator. - SessionRestorationBrowserAgent* sessionRestorationBrowserAgent = - SessionRestorationBrowserAgent::FromBrowser(self.browser); - SnapshotBrowserAgent* snapshotBrowserAgent = - SnapshotBrowserAgent::FromBrowser(self.browser); - sessions::TabRestoreService* tabRestoreService = - IOSChromeTabRestoreServiceFactory::GetForBrowserState( - self.browser->GetBrowserState()); - - self.mediator = [[InactiveTabsMediator alloc] - initWithConsumer:self.viewController.gridViewController - webStateList:self.browser->GetWebStateList() - prefService:GetApplicationContext()->GetLocalState() - sessionRestorationAgent:sessionRestorationBrowserAgent - snapshotAgent:snapshotBrowserAgent - tabRestoreService:tabRestoreService]; + self.mediator.consumer = self.viewController.gridViewController; self.viewController.gridViewController.menuProvider = _menuProvider; -} - -- (void)show { - if (self.showing) { - return; - } - self.showing = YES; - base::RecordAction(base::UserMetricsAction("MobileInactiveTabGridEntered")); // Add the Inactive Tabs view controller to the hierarchy. UIView* baseView = self.baseViewController.view; @@ -614,6 +615,8 @@ [self.baseViewSnapshot removeFromSuperview]; self.baseViewSnapshot = nil; self.showing = NO; + self.mediator.consumer = nil; + self.viewController = nil; }]; }
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_grid/inactive_tabs/inactive_tabs_mediator.h b/ios/chrome/browser/ui/tab_switcher/tab_grid/inactive_tabs/inactive_tabs_mediator.h index 41d88edc..9de787db 100644 --- a/ios/chrome/browser/ui/tab_switcher/tab_grid/inactive_tabs/inactive_tabs_mediator.h +++ b/ios/chrome/browser/ui/tab_switcher/tab_grid/inactive_tabs/inactive_tabs_mediator.h
@@ -24,22 +24,24 @@ // interactions. @interface InactiveTabsMediator : NSObject <GridCommands> +// `consumer` receives `webStateList` and Inactive Tabs info updates. +@property(nonatomic, weak) id<TabCollectionConsumer, InactiveTabsInfoConsumer> + consumer; + // Initializer with: -// `consumer` as the receiver of `webStateList` updates. -// `prefService` the preference service from the application context. -// `sessionRestorationAgent` the session restoration browser agent from the -// inactive browser. `snapshotAgent` the snapshot browser agent from the -// inactive browser. `tabRestoreService` the service that holds the recently -// closed tabs. -- (instancetype)initWithConsumer: - (id<TabCollectionConsumer, InactiveTabsInfoConsumer>) - consumer - webStateList:(WebStateList*)webStateList - prefService:(PrefService*)prefService - sessionRestorationAgent: - (SessionRestorationBrowserAgent*)sessionRestorationAgent - snapshotAgent:(SnapshotBrowserAgent*)snapshotAgent - tabRestoreService:(sessions::TabRestoreService*)tabRestoreService +// - `webStateList`: the list of tabs to observe. +// - `prefService`: the preference service from the application context. +// - `sessionRestorationAgent`: the session restoration browser agent from the +// inactive browser. +// - `snapshotAgent`: the snapshot browser agent from the inactive browser. +// - `tabRestoreService`: the service that holds the recently closed tabs. +- (instancetype)initWithWebStateList:(WebStateList*)webStateList + prefService:(PrefService*)prefService + sessionRestorationAgent: + (SessionRestorationBrowserAgent*)sessionRestorationAgent + snapshotAgent:(SnapshotBrowserAgent*)snapshotAgent + tabRestoreService: + (sessions::TabRestoreService*)tabRestoreService NS_DESIGNATED_INITIALIZER; - (instancetype)init NS_UNAVAILABLE;
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_grid/inactive_tabs/inactive_tabs_mediator.mm b/ios/chrome/browser/ui/tab_switcher/tab_grid/inactive_tabs/inactive_tabs_mediator.mm index e87f765..45251ddf 100644 --- a/ios/chrome/browser/ui/tab_switcher/tab_grid/inactive_tabs/inactive_tabs_mediator.mm +++ b/ios/chrome/browser/ui/tab_switcher/tab_grid/inactive_tabs/inactive_tabs_mediator.mm
@@ -87,8 +87,6 @@ PrefObserverDelegate, SnapshotCacheObserver, WebStateListObserving> { - // The UI consumer to which updates are made. - __weak id<TabCollectionConsumer, InactiveTabsInfoConsumer> _consumer; // The list of inactive tabs. WebStateList* _webStateList; // The snapshot cache of _webStateList. @@ -123,17 +121,14 @@ @implementation InactiveTabsMediator -- (instancetype) - initWithConsumer: - (id<TabCollectionConsumer, InactiveTabsInfoConsumer>)consumer - webStateList:(WebStateList*)webStateList - prefService:(PrefService*)prefService - sessionRestorationAgent: - (SessionRestorationBrowserAgent*)sessionRestorationAgent - snapshotAgent:(SnapshotBrowserAgent*)snapshotAgent - tabRestoreService:(sessions::TabRestoreService*)tabRestoreService { +- (instancetype)initWithWebStateList:(WebStateList*)webStateList + prefService:(PrefService*)prefService + sessionRestorationAgent: + (SessionRestorationBrowserAgent*)sessionRestorationAgent + snapshotAgent:(SnapshotBrowserAgent*)snapshotAgent + tabRestoreService: + (sessions::TabRestoreService*)tabRestoreService { CHECK(IsInactiveTabsAvailable()); - CHECK(consumer); CHECK(webStateList); CHECK(prefService); CHECK(sessionRestorationAgent); @@ -142,7 +137,6 @@ CHECK(tabRestoreService); self = [super init]; if (self) { - _consumer = consumer; _webStateList = webStateList; // Observe the web state list. @@ -169,12 +163,6 @@ _prefObserverBridge->ObserveChangesForPreference( prefs::kInactiveTabsTimeThreshold, &_prefChangeRegistrar); - // Push the tabs to the consumer. - PopulateConsumerItems(_consumer, _webStateList); - // Push the info to the consumer. - NSInteger daysThreshold = InactiveTabsTimeThreshold().InDays(); - [_consumer updateInactiveTabsDaysThreshold:daysThreshold]; - _snapshotCache = snapshotAgent->snapshot_cache(); [_snapshotCache addObserver:self]; @@ -189,6 +177,21 @@ [_snapshotCache removeObserver:self]; } +- (void)setConsumer: + (id<TabCollectionConsumer, InactiveTabsInfoConsumer>)consumer { + if (_consumer == consumer) { + return; + } + + _consumer = consumer; + + // Push the tabs to the consumer. + PopulateConsumerItems(_consumer, _webStateList); + // Push the info to the consumer. + NSInteger daysThreshold = InactiveTabsTimeThreshold().InDays(); + [_consumer updateInactiveTabsDaysThreshold:daysThreshold]; +} + - (NSInteger)numberOfItems { return _webStateList->count(); }
diff --git a/media/capture/video/chromeos/display_rotation_observer.cc b/media/capture/video/chromeos/display_rotation_observer.cc index 24fbf9e..038d801 100644 --- a/media/capture/video/chromeos/display_rotation_observer.cc +++ b/media/capture/video/chromeos/display_rotation_observer.cc
@@ -13,10 +13,10 @@ // static scoped_refptr<ScreenObserverDelegate> ScreenObserverDelegate::Create( - DisplayRotationObserver* observer, + base::WeakPtr<DisplayRotationObserver> observer, scoped_refptr<base::SingleThreadTaskRunner> display_task_runner) { auto delegate = base::WrapRefCounted( - new ScreenObserverDelegate(observer, display_task_runner)); + new ScreenObserverDelegate(std::move(observer), display_task_runner)); display_task_runner->PostTask( FROM_HERE, base::BindOnce(&ScreenObserverDelegate::AddObserverOnDisplayThread, @@ -25,9 +25,9 @@ } ScreenObserverDelegate::ScreenObserverDelegate( - DisplayRotationObserver* observer, + base::WeakPtr<DisplayRotationObserver> observer, scoped_refptr<base::SingleThreadTaskRunner> display_task_runner) - : observer_(observer), + : observer_(std::move(observer)), display_task_runner_(std::move(display_task_runner)), delegate_task_runner_(base::SingleThreadTaskRunner::GetCurrentDefault()) { }
diff --git a/media/capture/video/chromeos/display_rotation_observer.h b/media/capture/video/chromeos/display_rotation_observer.h index 59cb1abd..1a960be1 100644 --- a/media/capture/video/chromeos/display_rotation_observer.h +++ b/media/capture/video/chromeos/display_rotation_observer.h
@@ -27,7 +27,7 @@ public base::RefCountedThreadSafe<ScreenObserverDelegate> { public: static scoped_refptr<ScreenObserverDelegate> Create( - DisplayRotationObserver* observer, + base::WeakPtr<DisplayRotationObserver> observer, scoped_refptr<base::SingleThreadTaskRunner> display_task_runner); ScreenObserverDelegate() = delete; @@ -42,7 +42,7 @@ friend class base::RefCountedThreadSafe<ScreenObserverDelegate>; ScreenObserverDelegate( - DisplayRotationObserver* observer, + base::WeakPtr<DisplayRotationObserver> observer, scoped_refptr<base::SingleThreadTaskRunner> display_task_runner); ~ScreenObserverDelegate() override; @@ -57,7 +57,7 @@ void SendDisplayRotation(const display::Display& display); void SendDisplayRotationOnCaptureThread(const display::Display& display); - raw_ptr<DisplayRotationObserver, ExperimentalAsh> observer_; + base::WeakPtr<DisplayRotationObserver> observer_; absl::optional<display::ScopedDisplayObserver> display_observer_;
diff --git a/media/capture/video/chromeos/video_capture_device_chromeos_delegate.cc b/media/capture/video/chromeos/video_capture_device_chromeos_delegate.cc index 3627dd35..d12be9f 100644 --- a/media/capture/video/chromeos/video_capture_device_chromeos_delegate.cc +++ b/media/capture/video/chromeos/video_capture_device_chromeos_delegate.cc
@@ -108,8 +108,6 @@ capture_task_runner_(base::SingleThreadTaskRunner::GetCurrentDefault()), camera_device_ipc_thread_(std::string("CameraDeviceIpcThread") + device_descriptor.device_id), - screen_observer_delegate_( - ScreenObserverDelegate::Create(this, ui_task_runner)), lens_facing_(device_descriptor.facing), // External cameras have lens_facing as MEDIA_VIDEO_FACING_NONE. // We don't want to rotate the frame even if the device rotates. @@ -122,20 +120,21 @@ power_manager_client_proxy_( base::MakeRefCounted<PowerManagerClientProxy>()) { power_manager_client_proxy_->Init(weak_ptr_factory_.GetWeakPtr(), - capture_task_runner_, - std::move(ui_task_runner)); + capture_task_runner_, ui_task_runner); + screen_observer_delegate_ = ScreenObserverDelegate::Create( + weak_ptr_factory_.GetWeakPtr(), ui_task_runner); } -VideoCaptureDeviceChromeOSDelegate::~VideoCaptureDeviceChromeOSDelegate() = - default; +VideoCaptureDeviceChromeOSDelegate::~VideoCaptureDeviceChromeOSDelegate() { + screen_observer_delegate_->RemoveObserver(); + power_manager_client_proxy_->Shutdown(); + camera_hal_delegate_->DisableAllVirtualDevices(); +} void VideoCaptureDeviceChromeOSDelegate::Shutdown() { DCHECK(capture_task_runner_->BelongsToCurrentThread()); if (!HasDeviceClient()) { DCHECK(!camera_device_ipc_thread_.IsRunning()); - screen_observer_delegate_->RemoveObserver(); - power_manager_client_proxy_->Shutdown(); - camera_hal_delegate_->DisableAllVirtualDevices(); capture_task_runner_->PostTask(FROM_HERE, std::move(cleanup_callback_)); } }
diff --git a/media/muxers/mp4_box_writer.h b/media/muxers/mp4_box_writer.h index 0e23c3e..40873127 100644 --- a/media/muxers/mp4_box_writer.h +++ b/media/muxers/mp4_box_writer.h
@@ -8,6 +8,7 @@ #include <memory> #include <vector> +#include "base/memory/raw_ref.h" #include "base/sequence_checker.h" #include "media/base/media_export.h" #include "media/formats/mp4/fourccs.h" @@ -46,10 +47,10 @@ void AddChildBox(std::unique_ptr<Mp4BoxWriter> box_writer); // Get the Mp4MuxerContext object. - const Mp4MuxerContext& context() const { return context_; } + const Mp4MuxerContext& context() const { return *context_; } private: - const Mp4MuxerContext& context_; + const raw_ref<const Mp4MuxerContext> context_; std::vector<std::unique_ptr<Mp4BoxWriter>> child_boxes_; SEQUENCE_CHECKER(sequence_checker_); };
diff --git a/media/muxers/mp4_movie_box_writer.h b/media/muxers/mp4_movie_box_writer.h index f4bd804..c507c64 100644 --- a/media/muxers/mp4_movie_box_writer.h +++ b/media/muxers/mp4_movie_box_writer.h
@@ -5,6 +5,7 @@ #ifndef MEDIA_MUXERS_MP4_MOVIE_BOX_WRITER_H_ #define MEDIA_MUXERS_MP4_MOVIE_BOX_WRITER_H_ +#include "base/memory/raw_ptr_exclusion.h" #include "base/sequence_checker.h" #include "media/base/media_export.h" #include "media/formats/mp4/fourccs.h" @@ -30,6 +31,8 @@ SEQUENCE_CHECKER(sequence_checker_); \ } +// |box_| field is not a raw_ref<> because it was filtered by the rewriter +// for: #macro #define DECLARE_MP4_BOX_WRITER_CLASS(class_name, box_type) \ class MEDIA_EXPORT class_name : public Mp4BoxWriter { \ public: \ @@ -40,7 +43,7 @@ void Write(BoxByteStream& writer) override; \ \ private: \ - const box_type& box_; \ + RAW_PTR_EXCLUSION const box_type& box_; \ SEQUENCE_CHECKER(sequence_checker_); \ }
diff --git a/media/renderers/video_frame_rgba_to_yuva_converter.cc b/media/renderers/video_frame_rgba_to_yuva_converter.cc index a71a5c9..ecc3717 100644 --- a/media/renderers/video_frame_rgba_to_yuva_converter.cc +++ b/media/renderers/video_frame_rgba_to_yuva_converter.cc
@@ -9,6 +9,7 @@ #include "base/memory/raw_ptr.h" #include "components/viz/common/gpu/raster_context_provider.h" #include "components/viz/common/resources/resource_format_utils.h" +#include "components/viz/common/resources/shared_image_format_utils.h" #include "gpu/command_buffer/client/raster_interface.h" #include "gpu/command_buffer/client/shared_image_interface.h" #include "gpu/command_buffer/common/mailbox_holder.h"
diff --git a/mojo/public/cpp/bindings/connector.h b/mojo/public/cpp/bindings/connector.h index 1a3291a..72f8281b8 100644 --- a/mojo/public/cpp/bindings/connector.h +++ b/mojo/public/cpp/bindings/connector.h
@@ -236,10 +236,21 @@ class ActiveDispatchTracker; class RunLoopNestingObserver; - // Callback of mojo::SimpleWatcher. - void OnWatcherHandleReady(MojoResult result); - // Callback of SyncHandleWatcher. - void OnSyncHandleWatcherHandleReady(MojoResult result); + // Callback given to SimpleWatcher to dispatch events for pipe activity. + // + // We pass the Connector's static interface name here as a parameter, ensuring + // that if Chrome crashes within this method, the crash dump will include the + // address of the interface name string in some accessible place such as a + // register or nearby stack location. We do this to help pinpoint application + // bugs which destroy bindings endpoints from the wrong thread, as this can + // result in Connector destruction racing with execution of a WeakPtr-bound + // OnWatcherHandleReady task. + void OnWatcherHandleReady(const char* interface_name, MojoResult result); + + // Callback of SyncHandleWatcher. See notes on OnWatcherHandleReady() + // regarding the `interface_name` argument. + void OnSyncHandleWatcherHandleReady(const char* interface_name, + MojoResult result); void OnHandleReadyInternal(MojoResult result);
diff --git a/mojo/public/cpp/bindings/lib/connector.cc b/mojo/public/cpp/bindings/lib/connector.cc index aa57eee..c4d71cb5 100644 --- a/mojo/public/cpp/bindings/lib/connector.cc +++ b/mojo/public/cpp/bindings/lib/connector.cc
@@ -10,6 +10,7 @@ #include "base/check_op.h" #include "base/compiler_specific.h" +#include "base/debug/alias.h" #include "base/functional/bind.h" #include "base/location.h" #include "base/memory/ptr_util.h" @@ -407,11 +408,21 @@ return DispatchMessage(std::move(message)); } -void Connector::OnWatcherHandleReady(MojoResult result) { +void Connector::OnWatcherHandleReady(const char* interface_name, + MojoResult result) { + // NOTE: `interface_name` always points to static string data, so it's useful + // to alias without copying to the stack. + base::debug::Alias(&interface_name); + OnHandleReadyInternal(result); } -void Connector::OnSyncHandleWatcherHandleReady(MojoResult result) { +void Connector::OnSyncHandleWatcherHandleReady(const char* interface_name, + MojoResult result) { + // NOTE: `interface_name` always points to static string data, so it's useful + // to alias without copying to the stack. + base::debug::Alias(&interface_name); + base::WeakPtr<Connector> weak_self(weak_self_); sync_handle_watcher_callback_count_++; @@ -456,14 +467,14 @@ MojoResult rv = handle_watcher_->Watch( message_pipe_.get(), MOJO_HANDLE_SIGNAL_READABLE, base::BindRepeating(&Connector::OnWatcherHandleReady, - base::Unretained(this))); + base::Unretained(this), interface_name_)); if (rv != MOJO_RESULT_OK) { // If the watch failed because the handle is invalid or its conditions can // no longer be met, we signal the error asynchronously to avoid reentry. task_runner_->PostTask( - FROM_HERE, - base::BindOnce(&Connector::OnWatcherHandleReady, weak_self_, rv)); + FROM_HERE, base::BindOnce(&Connector::OnWatcherHandleReady, weak_self_, + interface_name_, rv)); } else { handle_watcher_->ArmOrNotify(); } @@ -684,7 +695,7 @@ sync_watcher_ = std::make_unique<SyncHandleWatcher>( message_pipe_.get(), MOJO_HANDLE_SIGNAL_READABLE, base::BindRepeating(&Connector::OnSyncHandleWatcherHandleReady, - base::Unretained(this))); + base::Unretained(this), interface_name_)); } } // namespace mojo
diff --git a/mojo/public/cpp/bindings/tests/direct_receiver_unittest.cc b/mojo/public/cpp/bindings/tests/direct_receiver_unittest.cc index 60fb1c1..bdd2447 100644 --- a/mojo/public/cpp/bindings/tests/direct_receiver_unittest.cc +++ b/mojo/public/cpp/bindings/tests/direct_receiver_unittest.cc
@@ -9,6 +9,7 @@ #include "base/functional/bind.h" #include "base/memory/raw_ptr.h" +#include "base/memory/raw_ref.h" #include "base/message_loop/message_pump_type.h" #include "base/synchronization/waitable_event.h" #include "base/test/bind.h" @@ -164,7 +165,7 @@ base::RunLoop wait_loop; service_.AsyncCall(&ServiceImpl::GetReceiverPortal) .Then(base::BindLambdaForTesting([&](IpczHandle portal) { - test_.WaitForDirectRemoteLink(portal); + test_->WaitForDirectRemoteLink(portal); wait_loop.Quit(); })); wait_loop.Run(); @@ -177,7 +178,7 @@ } private: - DirectReceiverTest& test_; + const raw_ref<DirectReceiverTest> test_; base::Thread impl_thread_{"Impl Thread"}; base::SequenceBound<ServiceImpl> service_; };
diff --git a/net/dns/public/doh_provider_entry.h b/net/dns/public/doh_provider_entry.h index 1c328d3..8c8e9b3 100644 --- a/net/dns/public/doh_provider_entry.h +++ b/net/dns/public/doh_provider_entry.h
@@ -10,6 +10,7 @@ #include <vector> #include "base/feature_list.h" +#include "base/memory/raw_ptr_exclusion.h" #include "base/strings/string_piece.h" #include "net/base/ip_address.h" #include "net/base/net_export.h" @@ -65,7 +66,9 @@ }; std::string provider; - const base::Feature& feature; + // This field is not a raw_ref<> because it was filtered by the rewriter for: + // #global-scope + RAW_PTR_EXCLUSION const base::Feature& feature; // A provider_id_for_histogram is required for entries that are intended to // be visible in the UI. absl::optional<DohProviderIdForHistogram> provider_id_for_histogram;
diff --git a/net/http/http_auth_cache.cc b/net/http/http_auth_cache.cc index 659c9d1..4ae53634 100644 --- a/net/http/http_auth_cache.cc +++ b/net/http/http_auth_cache.cc
@@ -6,6 +6,7 @@ #include "base/containers/cxx20_erase.h" #include "base/logging.h" +#include "base/memory/raw_ptr_exclusion.h" #include "base/metrics/histogram_macros.h" #include "base/strings/string_util.h" #include "url/scheme_host_port.h" @@ -61,7 +62,9 @@ bool operator() (const std::string& x) const { return IsEnclosingPath(path, x); } - const std::string& path; + // This field is not a raw_ref<> because it was filtered by the rewriter for: + // #constexpr-ctor-field-initializer + RAW_PTR_EXCLUSION const std::string& path; }; } // namespace
diff --git a/net/quic/quic_chromium_packet_writer.cc b/net/quic/quic_chromium_packet_writer.cc index 3491f678..33b595fc 100644 --- a/net/quic/quic_chromium_packet_writer.cc +++ b/net/quic/quic_chromium_packet_writer.cc
@@ -125,7 +125,8 @@ size_t buf_len, const quic::QuicIpAddress& self_address, const quic::QuicSocketAddress& peer_address, - quic::PerPacketOptions* /*options*/) { + quic::PerPacketOptions* /*options*/, + const quic::QuicPacketWriterParams& /*params*/) { CHECK(!IsWriteBlocked()); SetPacket(buffer, buf_len); return WritePacketToSocketImpl(); @@ -230,6 +231,8 @@ delegate_->OnWriteError(rv); else if (!force_write_blocked_) delegate_->OnWriteUnblocked(); + + socket_->SetDontClose(false); } bool QuicChromiumPacketWriter::MaybeRetryAfterWriteError(int rv) { @@ -247,6 +250,7 @@ weak_factory_.GetWeakPtr())); retry_count_++; write_in_progress_ = true; + socket_->SetDontClose(true); return true; } @@ -263,6 +267,10 @@ return false; } +bool QuicChromiumPacketWriter::SupportsEcn() const { + return false; +} + quic::QuicPacketBuffer QuicChromiumPacketWriter::GetNextWriteLocation( const quic::QuicIpAddress& self_address, const quic::QuicSocketAddress& peer_address) {
diff --git a/net/quic/quic_chromium_packet_writer.h b/net/quic/quic_chromium_packet_writer.h index f7c7e477..4846f9a 100644 --- a/net/quic/quic_chromium_packet_writer.h +++ b/net/quic/quic_chromium_packet_writer.h
@@ -87,11 +87,13 @@ void WritePacketToSocket(scoped_refptr<ReusableIOBuffer> packet); // quic::QuicPacketWriter - quic::WriteResult WritePacket(const char* buffer, - size_t buf_len, - const quic::QuicIpAddress& self_address, - const quic::QuicSocketAddress& peer_address, - quic::PerPacketOptions* options) override; + quic::WriteResult WritePacket( + const char* buffer, + size_t buf_len, + const quic::QuicIpAddress& self_address, + const quic::QuicSocketAddress& peer_address, + quic::PerPacketOptions* options, + const quic::QuicPacketWriterParams& params) override; bool IsWriteBlocked() const override; void SetWritable() override; absl::optional<int> MessageTooBigErrorCode() const override; @@ -99,6 +101,7 @@ const quic::QuicSocketAddress& peer_address) const override; bool SupportsReleaseTime() const override; bool IsBatchMode() const override; + bool SupportsEcn() const override; quic::QuicPacketBuffer GetNextWriteLocation( const quic::QuicIpAddress& self_address, const quic::QuicSocketAddress& peer_address) override;
diff --git a/net/socket/datagram_client_socket.h b/net/socket/datagram_client_socket.h index 4c07731..fb1934b3 100644 --- a/net/socket/datagram_client_socket.h +++ b/net/socket/datagram_client_socket.h
@@ -87,6 +87,11 @@ // Set iOS Network Service Type for socket option SO_NET_SERVICE_TYPE. // No-op by default. virtual void SetIOSNetworkServiceType(int ios_network_service_type) {} + + // Set "don't close" flag for socket. + // No-op by default. + // TODO(nidhijaju): Remove this method once crbug.com/1383390 is fixed. + virtual void SetDontClose(bool dont_close) {} }; } // namespace net
diff --git a/net/socket/udp_client_socket.cc b/net/socket/udp_client_socket.cc index ca4a277..d8c8c08 100644 --- a/net/socket/udp_client_socket.cc +++ b/net/socket/udp_client_socket.cc
@@ -27,16 +27,18 @@ int UDPClientSocket::Connect(const IPEndPoint& address) { CHECK(!connect_called_); - if (connect_using_network_ != handles::kInvalidNetworkHandle) + if (connect_using_network_ != handles::kInvalidNetworkHandle) { return ConnectUsingNetwork(connect_using_network_, address); + } connect_called_ = true; int rv = OK; if (!adopted_opened_socket_) { rv = socket_.Open(address.GetFamily()); } - if (rv != OK) + if (rv != OK) { return rv; + } return socket_.Connect(address); } @@ -44,8 +46,9 @@ const IPEndPoint& address) { CHECK(!connect_called_); connect_called_ = true; - if (!NetworkChangeNotifier::AreNetworkHandlesSupported()) + if (!NetworkChangeNotifier::AreNetworkHandlesSupported()) { return ERR_NOT_IMPLEMENTED; + } int rv = OK; if (!adopted_opened_socket_) { rv = socket_.Open(address.GetFamily()); @@ -54,8 +57,9 @@ return rv; } rv = socket_.BindToNetwork(network); - if (rv != OK) + if (rv != OK) { return rv; + } network_ = network; return socket_.Connect(address); } @@ -63,14 +67,16 @@ int UDPClientSocket::ConnectUsingDefaultNetwork(const IPEndPoint& address) { CHECK(!connect_called_); connect_called_ = true; - if (!NetworkChangeNotifier::AreNetworkHandlesSupported()) + if (!NetworkChangeNotifier::AreNetworkHandlesSupported()) { return ERR_NOT_IMPLEMENTED; + } int rv = OK; if (!adopted_opened_socket_) { rv = socket_.Open(address.GetFamily()); } - if (rv != OK) + if (rv != OK) { return rv; + } // Calling connect() will bind a socket to the default network, however there // is no way to determine what network the socket got bound to. The // alternative is to query what the default network is and bind the socket to @@ -81,17 +87,20 @@ handles::NetworkHandle network; for (int attempt = 0; attempt < 2; attempt++) { network = NetworkChangeNotifier::GetDefaultNetwork(); - if (network == handles::kInvalidNetworkHandle) + if (network == handles::kInvalidNetworkHandle) { return ERR_INTERNET_DISCONNECTED; + } rv = socket_.BindToNetwork(network); // |network| may have disconnected between the call to GetDefaultNetwork() // and the call to BindToNetwork(). Loop only if this is the case (|rv| will // be ERR_NETWORK_CHANGED). - if (rv != ERR_NETWORK_CHANGED) + if (rv != ERR_NETWORK_CHANGED) { break; + } } - if (rv != OK) + if (rv != OK) { return rv; + } network_ = network; return socket_.Connect(address); } @@ -202,4 +211,10 @@ return rv; } +void UDPClientSocket::SetDontClose(bool dont_close) { +#if BUILDFLAG(IS_POSIX) + socket_.SetDontClose(dont_close); +#endif +} + } // namespace net
diff --git a/net/socket/udp_client_socket.h b/net/socket/udp_client_socket.h index 6e3875b..d95caea 100644 --- a/net/socket/udp_client_socket.h +++ b/net/socket/udp_client_socket.h
@@ -78,6 +78,7 @@ int SetMulticastInterface(uint32_t interface_index) override; void SetIOSNetworkServiceType(int ios_network_service_type) override; + void SetDontClose(bool dont_close) override; // Takes ownership of an opened but unconnected and unbound `socket`. This // method must be called after UseNonBlockingIO, otherwise the adopted socket
diff --git a/net/socket/udp_socket_posix.cc b/net/socket/udp_socket_posix.cc index 120ce58..95bee11 100644 --- a/net/socket/udp_socket_posix.cc +++ b/net/socket/udp_socket_posix.cc
@@ -259,6 +259,7 @@ void UDPSocketPosix::Close() { DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); + CHECK(!dont_close_); owned_socket_count_.Reset(); @@ -1112,4 +1113,8 @@ return OK; } +void UDPSocketPosix::SetDontClose(bool dont_close) { + dont_close_ = dont_close; +} + } // namespace net
diff --git a/net/socket/udp_socket_posix.h b/net/socket/udp_socket_posix.h index a0cb1e2..01f07d5 100644 --- a/net/socket/udp_socket_posix.h +++ b/net/socket/udp_socket_posix.h
@@ -291,10 +291,11 @@ return experimental_recv_optimization_enabled_; } + // Sets "don't close" flag for the socket. + void SetDontClose(bool dont_close); + private: - enum SocketOptions { - SOCKET_OPTION_MULTICAST_LOOP = 1 << 0 - }; + enum SocketOptions { SOCKET_OPTION_MULTICAST_LOOP = 1 << 0 }; class ReadWatcher : public base::MessagePumpForIO::FdWatcher { public: @@ -473,6 +474,9 @@ // UDPSocket is destroyed. OwnedUDPSocketCount owned_socket_count_; + // Flag to signify if |socket_| should not be closed. + bool dont_close_ = false; + THREAD_CHECKER(thread_checker_); };
diff --git a/net/tools/quic/quic_simple_server_packet_writer.cc b/net/tools/quic/quic_simple_server_packet_writer.cc index bebfe87..90d00b01 100644 --- a/net/tools/quic/quic_simple_server_packet_writer.cc +++ b/net/tools/quic/quic_simple_server_packet_writer.cc
@@ -51,7 +51,8 @@ size_t buf_len, const quic::QuicIpAddress& self_address, const quic::QuicSocketAddress& peer_address, - quic::PerPacketOptions* options) { + quic::PerPacketOptions* options, + const quic::QuicPacketWriterParams& params) { scoped_refptr<StringIOBuffer> buf = base::MakeRefCounted<StringIOBuffer>(std::string(buffer, buf_len)); DCHECK(!IsWriteBlocked()); @@ -90,6 +91,10 @@ return false; } +bool QuicSimpleServerPacketWriter::SupportsEcn() const { + return false; +} + quic::QuicPacketBuffer QuicSimpleServerPacketWriter::GetNextWriteLocation( const quic::QuicIpAddress& self_address, const quic::QuicSocketAddress& peer_address) {
diff --git a/net/tools/quic/quic_simple_server_packet_writer.h b/net/tools/quic/quic_simple_server_packet_writer.h index 3ca2bfd..5685784d 100644 --- a/net/tools/quic/quic_simple_server_packet_writer.h +++ b/net/tools/quic/quic_simple_server_packet_writer.h
@@ -37,11 +37,13 @@ ~QuicSimpleServerPacketWriter() override; - quic::WriteResult WritePacket(const char* buffer, - size_t buf_len, - const quic::QuicIpAddress& self_address, - const quic::QuicSocketAddress& peer_address, - quic::PerPacketOptions* options) override; + quic::WriteResult WritePacket( + const char* buffer, + size_t buf_len, + const quic::QuicIpAddress& self_address, + const quic::QuicSocketAddress& peer_address, + quic::PerPacketOptions* options, + const quic::QuicPacketWriterParams& params) override; void OnWriteComplete(int rv); @@ -53,6 +55,7 @@ const quic::QuicSocketAddress& peer_address) const override; bool SupportsReleaseTime() const override; bool IsBatchMode() const override; + bool SupportsEcn() const override; quic::QuicPacketBuffer GetNextWriteLocation( const quic::QuicIpAddress& self_address, const quic::QuicSocketAddress& peer_address) override;
diff --git a/services/network/public/cpp/ip_address_space_util.h b/services/network/public/cpp/ip_address_space_util.h index 714764ec..7c37e21 100644 --- a/services/network/public/cpp/ip_address_space_util.h +++ b/services/network/public/cpp/ip_address_space_util.h
@@ -8,6 +8,7 @@ #include <vector> #include "base/component_export.h" +#include "base/memory/raw_ptr_exclusion.h" #include "base/strings/string_piece_forward.h" #include "services/network/public/mojom/ip_address_space.mojom-forward.h" #include "services/network/public/mojom/parsed_headers.mojom-forward.h" @@ -86,9 +87,15 @@ const net::IPEndPoint& remote_endpoint); ~CalculateClientAddressSpaceParams(); - const std::vector<GURL>& url_list_via_service_worker; - const mojom::ParsedHeadersPtr& parsed_headers; - const net::IPEndPoint& remote_endpoint; + // This field is not a raw_ref<> because it was filtered by the rewriter for: + // #constexpr-ctor-field-initializer + RAW_PTR_EXCLUSION const std::vector<GURL>& url_list_via_service_worker; + // This field is not a raw_ref<> because it was filtered by the rewriter for: + // #constexpr-ctor-field-initializer + RAW_PTR_EXCLUSION const mojom::ParsedHeadersPtr& parsed_headers; + // This field is not a raw_ref<> because it was filtered by the rewriter for: + // #constexpr-ctor-field-initializer + RAW_PTR_EXCLUSION const net::IPEndPoint& remote_endpoint; }; // Given a request URL and `params`, this function calculates the
diff --git a/testing/buildbot/chrome.json b/testing/buildbot/chrome.json index af9805a..ea3688b8 100644 --- a/testing/buildbot/chrome.json +++ b/testing/buildbot/chrome.json
@@ -1702,6 +1702,7 @@ "enable": true, "has_native_resultdb_integration": true }, + "shards": 2, "swarming": {}, "tast_expr": "(\"group:mainline\" && (\"dep:lacros_stable\" || \"dep:lacros\") && !informational)", "test": "lacros_all_tast_tests", @@ -1719,6 +1720,7 @@ "enable": true, "has_native_resultdb_integration": true }, + "shards": 2, "swarming": {}, "tast_expr": "(\"group:mainline\" && (\"dep:lacros_stable\" || \"dep:lacros\") && !informational)", "test": "lacros_all_tast_tests", @@ -1736,6 +1738,7 @@ "enable": true, "has_native_resultdb_integration": true }, + "shards": 2, "swarming": {}, "tast_expr": "(\"group:mainline\" && (\"dep:lacros_stable\" || \"dep:lacros\") && !informational)", "test": "lacros_all_tast_tests", @@ -1753,6 +1756,7 @@ "enable": true, "has_native_resultdb_integration": true }, + "shards": 2, "swarming": {}, "tast_expr": "(\"group:mainline\" && (\"dep:lacros_stable\" || \"dep:lacros\") && !informational)", "test": "lacros_all_tast_tests", @@ -1770,6 +1774,7 @@ "enable": true, "has_native_resultdb_integration": true }, + "shards": 2, "swarming": {}, "tast_expr": "(\"group:mainline\" && (\"dep:lacros_stable\" || \"dep:lacros\") && !informational)", "test": "lacros_all_tast_tests", @@ -1787,6 +1792,7 @@ "enable": true, "has_native_resultdb_integration": true }, + "shards": 2, "swarming": {}, "tast_expr": "(\"group:mainline\" && (\"dep:lacros_stable\" || \"dep:lacros\") && !informational)", "test": "lacros_all_tast_tests", @@ -1804,6 +1810,7 @@ "enable": true, "has_native_resultdb_integration": true }, + "shards": 2, "swarming": {}, "tast_expr": "(\"group:mainline\" && (\"dep:lacros_stable\" || \"dep:lacros\") && !informational)", "test": "lacros_all_tast_tests", @@ -1821,6 +1828,7 @@ "enable": true, "has_native_resultdb_integration": true }, + "shards": 2, "swarming": {}, "tast_expr": "(\"group:mainline\" && (\"dep:lacros_stable\" || \"dep:lacros\") && !informational)", "test": "lacros_all_tast_tests", @@ -1873,6 +1881,7 @@ "enable": true, "has_native_resultdb_integration": true }, + "shards": 2, "swarming": {}, "tast_expr": "(\"group:mainline\" && (\"dep:lacros_stable\" || \"dep:lacros\") && !informational)", "test": "lacros_all_tast_tests", @@ -1890,6 +1899,7 @@ "enable": true, "has_native_resultdb_integration": true }, + "shards": 2, "swarming": {}, "tast_expr": "(\"group:mainline\" && (\"dep:lacros_stable\" || \"dep:lacros\") && !informational)", "test": "lacros_all_tast_tests", @@ -1907,6 +1917,7 @@ "enable": true, "has_native_resultdb_integration": true }, + "shards": 2, "swarming": {}, "tast_expr": "(\"group:mainline\" && (\"dep:lacros_stable\" || \"dep:lacros\") && !informational)", "test": "lacros_all_tast_tests", @@ -1924,6 +1935,7 @@ "enable": true, "has_native_resultdb_integration": true }, + "shards": 2, "swarming": {}, "tast_expr": "(\"group:mainline\" && (\"dep:lacros_stable\" || \"dep:lacros\") && !informational)", "test": "lacros_all_tast_tests", @@ -1976,6 +1988,7 @@ "enable": true, "has_native_resultdb_integration": true }, + "shards": 2, "swarming": {}, "tast_expr": "(\"group:mainline\" && (\"dep:lacros_stable\" || \"dep:lacros\") && !informational)", "test": "lacros_all_tast_tests",
diff --git a/testing/buildbot/chromium.chromiumos.json b/testing/buildbot/chromium.chromiumos.json index 3ec45df..136e627 100644 --- a/testing/buildbot/chromium.chromiumos.json +++ b/testing/buildbot/chromium.chromiumos.json
@@ -1491,6 +1491,7 @@ "enable": true, "has_native_resultdb_integration": true }, + "shards": 2, "swarming": {}, "tast_expr": "(\"group:mainline\" && (\"dep:lacros_stable\" || \"dep:lacros\") && !informational)", "test": "lacros_all_tast_tests", @@ -1512,6 +1513,7 @@ "enable": true, "has_native_resultdb_integration": true }, + "shards": 2, "swarming": {}, "tast_expr": "(\"group:mainline\" && (\"dep:lacros_stable\" || \"dep:lacros\") && !informational)", "test": "lacros_all_tast_tests", @@ -1533,6 +1535,7 @@ "enable": true, "has_native_resultdb_integration": true }, + "shards": 2, "swarming": {}, "tast_expr": "(\"group:mainline\" && (\"dep:lacros_stable\" || \"dep:lacros\") && !informational)", "test": "lacros_all_tast_tests", @@ -1554,6 +1557,7 @@ "enable": true, "has_native_resultdb_integration": true }, + "shards": 2, "swarming": {}, "tast_expr": "(\"group:mainline\" && (\"dep:lacros_stable\" || \"dep:lacros\") && !informational)", "test": "lacros_all_tast_tests", @@ -1651,6 +1655,7 @@ "enable": true, "has_native_resultdb_integration": true }, + "shards": 2, "swarming": {}, "tast_expr": "(\"group:mainline\" && (\"dep:lacros_stable\" || \"dep:lacros\") && !informational)", "test": "lacros_all_tast_tests", @@ -1681,6 +1686,7 @@ "enable": true, "has_native_resultdb_integration": true }, + "shards": 2, "swarming": {}, "tast_expr": "(\"group:mainline\" && (\"dep:lacros_stable\" || \"dep:lacros\") && !informational)", "test": "lacros_all_tast_tests",
diff --git a/testing/buildbot/chromium.fyi.json b/testing/buildbot/chromium.fyi.json index 05614e1..74bffa7d 100644 --- a/testing/buildbot/chromium.fyi.json +++ b/testing/buildbot/chromium.fyi.json
@@ -37406,6 +37406,7 @@ "enable": true, "has_native_resultdb_integration": true }, + "shards": 2, "swarming": {}, "tast_expr": "(\"group:mainline\" && (\"dep:lacros_stable\" || \"dep:lacros\") && !informational)", "test": "lacros_all_tast_tests", @@ -37427,6 +37428,7 @@ "enable": true, "has_native_resultdb_integration": true }, + "shards": 2, "swarming": {}, "tast_expr": "(\"group:mainline\" && (\"dep:lacros_stable\" || \"dep:lacros\") && !informational)", "test": "lacros_all_tast_tests", @@ -37452,6 +37454,7 @@ "enable": true, "has_native_resultdb_integration": true }, + "shards": 2, "swarming": {}, "tast_expr": "(\"group:mainline\" && (\"dep:lacros_stable\" || \"dep:lacros\") && !informational)", "test": "lacros_all_tast_tests", @@ -37470,6 +37473,7 @@ "enable": true, "has_native_resultdb_integration": true }, + "shards": 2, "swarming": {}, "tast_expr": "(\"group:mainline\" && (\"dep:lacros_stable\" || \"dep:lacros\") && !informational)", "test": "lacros_all_tast_tests", @@ -37495,6 +37499,7 @@ "enable": true, "has_native_resultdb_integration": true }, + "shards": 2, "swarming": {}, "tast_expr": "(\"group:mainline\" && (\"dep:lacros_stable\" || \"dep:lacros\") && !informational)", "test": "lacros_all_tast_tests", @@ -37515,6 +37520,7 @@ "enable": true, "has_native_resultdb_integration": true }, + "shards": 2, "swarming": {}, "tast_expr": "(\"group:mainline\" && (\"dep:lacros_stable\" || \"dep:lacros\") && !informational)", "test": "lacros_all_tast_tests", @@ -37533,6 +37539,7 @@ "enable": true, "has_native_resultdb_integration": true }, + "shards": 2, "swarming": {}, "tast_expr": "(\"group:mainline\" && (\"dep:lacros_stable\" || \"dep:lacros\") && !informational)", "test": "lacros_all_tast_tests",
diff --git a/testing/buildbot/filters/BUILD.gn b/testing/buildbot/filters/BUILD.gn index 55b70e3..dbc6ffd9 100644 --- a/testing/buildbot/filters/BUILD.gn +++ b/testing/buildbot/filters/BUILD.gn
@@ -68,6 +68,7 @@ "//testing/buildbot/filters/mac.mac12-arm64-rel.browser_tests.filter", "//testing/buildbot/filters/ozone-linux.wayland_browser_tests.filter", "//testing/buildbot/filters/pixel_tests.filter", + "//testing/buildbot/filters/release_ready/linux64-rel-ready.browser_tests.p0.filter", "//testing/buildbot/filters/webrtc_functional.browser_tests.filter", "//testing/buildbot/filters/win.win-rel-cft.browser_tests.filter", ]
diff --git a/testing/buildbot/filters/release_ready/linux64-rel-ready.browser_tests.p0.filter b/testing/buildbot/filters/release_ready/linux64-rel-ready.browser_tests.p0.filter new file mode 100644 index 0000000..75ea802 --- /dev/null +++ b/testing/buildbot/filters/release_ready/linux64-rel-ready.browser_tests.p0.filter
@@ -0,0 +1,26 @@ +# TODO(crbug.com/1433395) Reword below requirement once green +# release is in production. +# This filter is for the P0 tests of Green Release, which must run +# and pass for the commit to create release tag. +# +# As of 23Q2, green release is still under development and below +# tests are picked up for experiments. Eventually, tests added +# here should: +# 1 complete in a reasonable time with little flakiness +# 2 map to a release outage or P0 issue +# 3 have clear ownership and SLO committed by the owners +AccessibilityLabelsBrowserTest.NewWebContents +AutofillCounterTest.CreditCards +ExtensionTabsTest.GetWindow +StartupBrowserCreatorTest.LaunchMultipleLockedProfiles +StartupBrowserCreatorTest.OpenAppUrlShortcut +StartupBrowserCreatorTest.OpenURLsPopup +StartupBrowserCreatorTest.RestoreWithNoStartupWindow +StartupBrowserCreatorTest.StartupURLsForTwoProfiles +StartupBrowserCreatorTest.StartupURLsOnNewWindow +StartupBrowserCreatorTest.UpdateWithTwoProfiles + +# Tests added for crbug.com/1424368: +All/SystemAccessProcessPrintBrowserTest.UpdatePrintSettingsPrintableArea/0 +All/SystemAccessProcessPrintBrowserTest.UpdatePrintSettingsPrintableArea/1 +All/SystemAccessProcessPrintBrowserTest.UpdatePrintSettingsPrintableArea/2
diff --git a/testing/buildbot/test_suites.pyl b/testing/buildbot/test_suites.pyl index 075d433..b02814c 100644 --- a/testing/buildbot/test_suites.pyl +++ b/testing/buildbot/test_suites.pyl
@@ -4036,6 +4036,7 @@ 'tast_expr': '("group:mainline" && ("dep:lacros_stable" || "dep:lacros") && !informational)', 'timeout_sec': 10800, 'test_level_retries': 2, + 'shards': 2, 'mixins': [ 'has_native_resultdb_integration', ],
diff --git a/testing/buildbot/tryserver.chromium.chromiumos.json b/testing/buildbot/tryserver.chromium.chromiumos.json index dc6193a..11952db 100644 --- a/testing/buildbot/tryserver.chromium.chromiumos.json +++ b/testing/buildbot/tryserver.chromium.chromiumos.json
@@ -19,6 +19,7 @@ "enable": true, "has_native_resultdb_integration": true }, + "shards": 2, "swarming": {}, "tast_expr": "(\"group:mainline\" && (\"dep:lacros_stable\" || \"dep:lacros\") && !informational)", "test": "lacros_all_tast_tests", @@ -40,6 +41,7 @@ "enable": true, "has_native_resultdb_integration": true }, + "shards": 2, "swarming": {}, "tast_expr": "(\"group:mainline\" && (\"dep:lacros_stable\" || \"dep:lacros\") && !informational)", "test": "lacros_all_tast_tests", @@ -61,6 +63,7 @@ "enable": true, "has_native_resultdb_integration": true }, + "shards": 2, "swarming": {}, "tast_expr": "(\"group:mainline\" && (\"dep:lacros_stable\" || \"dep:lacros\") && !informational)", "test": "lacros_all_tast_tests", @@ -82,6 +85,7 @@ "enable": true, "has_native_resultdb_integration": true }, + "shards": 2, "swarming": {}, "tast_expr": "(\"group:mainline\" && (\"dep:lacros_stable\" || \"dep:lacros\") && !informational)", "test": "lacros_all_tast_tests",
diff --git a/testing/variations/fieldtrial_testing_config.json b/testing/variations/fieldtrial_testing_config.json index 9b1f0df..336a28cc 100644 --- a/testing/variations/fieldtrial_testing_config.json +++ b/testing/variations/fieldtrial_testing_config.json
@@ -1099,26 +1099,6 @@ ] } ], - "AutofillEnableDevtoolsIssues": [ - { - "platforms": [ - "android", - "chromeos", - "chromeos_lacros", - "linux", - "mac", - "windows" - ], - "experiments": [ - { - "name": "Enabled", - "enable_features": [ - "AutofillEnableDevtoolsIssues" - ] - } - ] - } - ], "AutofillEnableExpirationDateImprovements": [ { "platforms": [ @@ -6763,24 +6743,6 @@ ] } ], - "IOSAddToHomeScreen": [ - { - "platforms": [ - "ios" - ], - "experiments": [ - { - "name": "Enabled", - "params": { - "AddToHomeScreenDisableIncognitoParam": "true" - }, - "enable_features": [ - "AddToHomeScreen" - ] - } - ] - } - ], "IOSAppStoreRating": [ { "platforms": [ @@ -14093,6 +14055,27 @@ ] } ], + "V8CompileHints3": [ + { + "platforms": [ + "windows" + ], + "experiments": [ + { + "name": "Disabled", + "disable_features": [ + "ProduceCompileHints" + ] + }, + { + "name": "Enabled", + "enable_features": [ + "ProduceCompileHints" + ] + } + ] + } + ], "V8ConcurrentSparkplug": [ { "platforms": [
diff --git a/third_party/blink/common/features.cc b/third_party/blink/common/features.cc index bc8570d3..dc7af52 100644 --- a/third_party/blink/common/features.cc +++ b/third_party/blink/common/features.cc
@@ -1770,10 +1770,6 @@ "max-fcp-delay", 100); -BASE_FEATURE(kWebRtcStatsReportIdl, - "WebRtcStatsReportIdl", - base::FEATURE_ENABLED_BY_DEFAULT); - BASE_FEATURE(kQuoteEmptySecChUaStringHeadersConsistently, "QuoteEmptySecChUaStringHeadersConsistently", base::FEATURE_ENABLED_BY_DEFAULT);
diff --git a/third_party/blink/public/common/BUILD.gn b/third_party/blink/public/common/BUILD.gn index 7496523..4712e60 100644 --- a/third_party/blink/public/common/BUILD.gn +++ b/third_party/blink/public/common/BUILD.gn
@@ -210,6 +210,7 @@ "link_to_text/link_to_text_mojom_traits.h", "loader/http_body_element_type.h", "loader/inter_process_time_ticks_converter.h", + "loader/javascript_framework_detection.h", "loader/loader_constants.h", "loader/loading_behavior_flag.h", "loader/mime_sniffing_throttle.h",
diff --git a/third_party/blink/public/common/features.h b/third_party/blink/public/common/features.h index d61d6da..8531e9c3 100644 --- a/third_party/blink/public/common/features.h +++ b/third_party/blink/public/common/features.h
@@ -1027,9 +1027,6 @@ // See https://crbug.com/1393246. BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kExtendScriptResourceLifetime); -// Use WebIDL instead of iteration to populate RTCStatsReport. -BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kWebRtcStatsReportIdl); - // Makes preloaded fonts render-blocking up to the limits below. // See https://crbug.com/1412861 BLINK_COMMON_EXPORT BASE_DECLARE_FEATURE(kRenderBlockingFonts);
diff --git a/third_party/blink/public/common/loader/javascript_framework_detection.h b/third_party/blink/public/common/loader/javascript_framework_detection.h new file mode 100644 index 0000000..d8262ae3 --- /dev/null +++ b/third_party/blink/public/common/loader/javascript_framework_detection.h
@@ -0,0 +1,29 @@ +#ifndef THIRD_PARTY_BLINK_PUBLIC_COMMON_LOADER_JAVASCRIPT_FRAMEWORK_DETECTION_H_ +#define THIRD_PARTY_BLINK_PUBLIC_COMMON_LOADER_JAVASCRIPT_FRAMEWORK_DETECTION_H_ + +#include <cstdint> +#include <map> + +#include "third_party/blink/public/mojom/loader/javascript_framework_detection.mojom-shared.h" + +namespace blink { + +// The existence of a framework might be detected, without a detected version. +static constexpr int64_t kNoFrameworkVersionDetected = 0; +using mojom::JavaScriptFramework; + +// A map containing versions of detected frameworks. +// Frameworks that are not detected at all would not appear in the map, while +// frameworks that are detected without a version would have a value of +// kNoFrameworkVersionDetected. +struct JavaScriptFrameworkDetectionResult { + std::map<JavaScriptFramework, int16_t> detected_versions; +}; + +inline bool operator==(const JavaScriptFrameworkDetectionResult& a, + const JavaScriptFrameworkDetectionResult& b) { + return a.detected_versions == b.detected_versions; +} + +} // namespace blink +#endif // THIRD_PARTY_BLINK_PUBLIC_COMMON_LOADER_JAVASCRIPT_FRAMEWORK_DETECTION_H_
diff --git a/third_party/blink/public/common/loader/javascript_framework_detection_mojom_traits.h b/third_party/blink/public/common/loader/javascript_framework_detection_mojom_traits.h new file mode 100644 index 0000000..a400e27 --- /dev/null +++ b/third_party/blink/public/common/loader/javascript_framework_detection_mojom_traits.h
@@ -0,0 +1,33 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef THIRD_PARTY_BLINK_PUBLIC_COMMON_LOADER_JAVASCRIPT_FRAMEWORK_DETECTION_MOJOM_TRAITS_H_ +#define THIRD_PARTY_BLINK_PUBLIC_COMMON_LOADER_JAVASCRIPT_FRAMEWORK_DETECTION_MOJOM_TRAITS_H_ + +#include "build/build_config.h" +#include "mojo/public/cpp/bindings/enum_traits.h" +#include "mojo/public/cpp/bindings/struct_traits.h" +#include "third_party/blink/public/common/common_export.h" +#include "third_party/blink/public/common/loader/javascript_framework_detection.h" + +namespace mojo { + +template <> +struct BLINK_COMMON_EXPORT + StructTraits<blink::mojom::JavaScriptFrameworkDetectionResultDataView, + blink::JavaScriptFrameworkDetectionResult> { + static const std::map<blink::JavaScriptFramework, int16_t>& detected_versions( + const blink::JavaScriptFrameworkDetectionResult& r) { + return r.detected_versions; + } + + static bool Read(blink::mojom::JavaScriptFrameworkDetectionResultDataView r, + blink::JavaScriptFrameworkDetectionResult* out) { + return r.ReadDetectedVersions(&out->detected_versions); + } +}; + +} // namespace mojo + +#endif // THIRD_PARTY_BLINK_PUBLIC_COMMON_LOADER_JAVASCRIPT_FRAMEWORK_DETECTION_MOJOM_TRAITS_H_
diff --git a/third_party/blink/public/common/loader/loading_behavior_flag.h b/third_party/blink/public/common/loader/loading_behavior_flag.h index 9042faa..173296e7 100644 --- a/third_party/blink/public/common/loader/loading_behavior_flag.h +++ b/third_party/blink/public/common/loader/loading_behavior_flag.h
@@ -39,51 +39,18 @@ kLoadingBehaviorSubresourceFilterMatch = 1 << 6, // Indicates that the page is an AMP document, with <html amp> tag. kLoadingBehaviorAmpDocumentLoaded = 1 << 7, - // Indicates that the page uses the Next.js JavaScript framework (via a - // window variable). - kLoadingBehaviorNextJSFrameworkUsed = 1 << 8, // Indicates that an async script was ready to execute before the script // element's node document has finished parsing. - kLoadingBehaviorAsyncScriptReadyBeforeDocumentFinishedParsing = 1 << 9, + kLoadingBehaviorAsyncScriptReadyBeforeDocumentFinishedParsing = 1 << 8, // Indicates that competing low priority requests were delayed. See // https://crbug.com/1112515 for details. - kLoadingBehaviorCompetingLowPriorityRequestsDelayed = 1 << 10, - // Indicates that the page uses the NuxtJS JavaScript framework. - kLoadingBehaviorNuxtJSFrameworkUsed = 1 << 11, - // Indicates that the page uses the VuePress JavaScript framework. - kLoadingBehaviorVuePressFrameworkUsed = 1 << 12, - // Indicates that the page uses the Sapper JavaScript framework. - kLoadingBehaviorSapperFrameworkUsed = 1 << 13, - // Indicates that the page uses the Gatsby JavaScript framework. - kLoadingBehaviorGatsbyFrameworkUsed = 1 << 14, - // Indicates that the page uses the Angular JavaScript framework. - kLoadingBehaviorAngularFrameworkUsed = 1 << 15, - // Indicates that the page uses the Vue JavaScript framework. - kLoadingBehaviorVueFrameworkUsed = 1 << 16, - // Indicates that the page uses the Svelte JavaScript framework. - kLoadingBehaviorSvelteFrameworkUsed = 1 << 17, - // Indicates that the page uses the Preact JavaScript framework. - kLoadingBehaviorPreactFrameworkUsed = 1 << 18, - // Indicates that the page uses the React JavaScript framework. - kLoadingBehaviorReactFrameworkUsed = 1 << 19, + kLoadingBehaviorCompetingLowPriorityRequestsDelayed = 1 << 9, // Indicates that the page is controlled by a Service Worker, but // the fetch handler is considered skippable. - kLoadingBehaviorServiceWorkerFetchHandlerSkippable = 1 << 20, + kLoadingBehaviorServiceWorkerFetchHandlerSkippable = 1 << 10, // Indicates that the main resource fetch for the page controlled by // a service worker at the navigation time fallback to network. - kLoadingBehaviorServiceWorkerMainResourceFetchFallback = 1 << 21, - // Indicates that the page uses the Drupal CMS. - kLoadingBehaviorDrupalCMSUsed = 1 << 22, - // Indicates that the page uses the Joomla CMS. - kLoadingBehaviorJoomlaCMSUsed = 1 << 23, - // Indicates that the page uses the Shopify CMS. - kLoadingBehaviorShopifyCMSUsed = 1 << 24, - // Indicates that the page uses the Squarespace CMS. - kLoadingBehaviorSquarespaceCMSUsed = 1 << 25, - // Indicates that the page uses the Wix CMS. - kLoadingBehaviorWixCMSUsed = 1 << 26, - // Indicates that the page uses the WordPress CMS. - kLoadingBehaviorWordPressCMSUsed = 1 << 27, + kLoadingBehaviorServiceWorkerMainResourceFetchFallback = 1 << 11, }; } // namespace blink
diff --git a/third_party/blink/public/mojom/BUILD.gn b/third_party/blink/public/mojom/BUILD.gn index 67bed5ea..4ee4bb9 100644 --- a/third_party/blink/public/mojom/BUILD.gn +++ b/third_party/blink/public/mojom/BUILD.gn
@@ -110,6 +110,7 @@ "loader/code_cache.mojom", "loader/content_security_notifier.mojom", "loader/fetch_client_settings_object.mojom", + "loader/javascript_framework_detection.mojom", "loader/keep_alive_handle.mojom", "loader/keep_alive_handle_factory.mojom", "loader/mixed_content.mojom", @@ -537,6 +538,15 @@ { types = [ { + mojom = "blink.mojom.JavaScriptFrameworkDetectionResult" + cpp = "::blink::JavaScriptFrameworkDetectionResult" + }, + ] + traits_headers = [ "//third_party/blink/public/common/loader/javascript_framework_detection_mojom_traits.h" ] + }, + { + types = [ + { mojom = "blink.mojom.SHA256HashValue" cpp = "::net::SHA256HashValue" },
diff --git a/third_party/blink/public/mojom/loader/javascript_framework_detection.mojom b/third_party/blink/public/mojom/loader/javascript_framework_detection.mojom new file mode 100644 index 0000000..a865ef0 --- /dev/null +++ b/third_party/blink/public/mojom/loader/javascript_framework_detection.mojom
@@ -0,0 +1,40 @@ +// Copyright 2023 The Chromium Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module blink.mojom; + +// JS Frameworks (& CMSes) are detected at load time. This helps us correlate +// performance metrics (and other metrics) with the existence and version of +// frameworks on the page. +enum JavaScriptFramework { + kNuxt, + kVuePress, + kSapper, + kGatsby, + kNext, + kAngular, + kVue, + kSvelte, + kPreact, + kReact, + kDrupal, + kJoomla, + kShopify, + kSquarespace, + kWix, + kWordPress, +}; + +// This struct is typemapped to blink::JavaScriptFrameworkDetectionResult. +// JS Frameworks are detected in blink at load time, and reported to UKM via +// the PageLoadMetrics mechanism in the browser process. +struct JavaScriptFrameworkDetectionResult { + // A map containing versions of detected frameworks. + // Frameworks that are not detected at all would not appear in the map, while + // frameworks that are detected without a version would have a value of + // kNoFrameworkVersionDetected, see javascript_framework_detection.h. + // The version value is in the format of 0xMMmm (M = Major, m = minor). + // Patch versions etc. are not expressed. + map<JavaScriptFramework, int16> detected_versions; +};
diff --git a/third_party/blink/public/web/web_local_frame_client.h b/third_party/blink/public/web/web_local_frame_client.h index b9ab9b4..5b141002 100644 --- a/third_party/blink/public/web/web_local_frame_client.h +++ b/third_party/blink/public/web/web_local_frame_client.h
@@ -138,6 +138,7 @@ class WebView; struct FramePolicy; struct Impression; +struct JavaScriptFrameworkDetectionResult; struct WebConsoleMessage; struct ContextMenuData; struct WebPictureInPictureWindowOptions; @@ -578,6 +579,11 @@ // use for segregated histograms. virtual void DidObserveLoadingBehavior(LoadingBehaviorFlag) {} + // Blink detected a JavaScript framework that the browser process will use for + // UKM. + virtual void DidObserveJavaScriptFrameworks( + const JavaScriptFrameworkDetectionResult&) {} + // A subresource load is observed. // It is called when there is a subresouce load. The reported values via // arguments are cumulative. They are NOT a difference from the previous call.
diff --git a/third_party/blink/renderer/bindings/generated_in_modules.gni b/third_party/blink/renderer/bindings/generated_in_modules.gni index d0a440d..30fbc369 100644 --- a/third_party/blink/renderer/bindings/generated_in_modules.gni +++ b/third_party/blink/renderer/bindings/generated_in_modules.gni
@@ -925,10 +925,6 @@ "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_rtc_insertable_streams.h", "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_rtc_media_source_stats.cc", "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_rtc_media_source_stats.h", - "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_rtc_media_stream_stats.cc", - "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_rtc_media_stream_stats.h", - "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_rtc_media_stream_track_stats.cc", - "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_rtc_media_stream_track_stats.h", "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_rtc_offer_answer_options.cc", "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_rtc_offer_answer_options.h", "$root_gen_dir/third_party/blink/renderer/bindings/modules/v8/v8_rtc_offer_options.cc",
diff --git a/third_party/blink/renderer/core/css/container_query_evaluator.cc b/third_party/blink/renderer/core/css/container_query_evaluator.cc index 85185c0..085c914 100644 --- a/third_party/blink/renderer/core/css/container_query_evaluator.cc +++ b/third_party/blink/renderer/core/css/container_query_evaluator.cc
@@ -132,6 +132,13 @@ return false; } + if (selects_size) { + match_result.SetDependsOnSizeContainerQueries(); + } + if (selects_style) { + match_result.SetDependsOnStyleContainerQueries(); + } + Element* starting_element = selects_size ? context.container : style_container_candidate; Element* container = CachedContainer(starting_element, query.Selector(),
diff --git a/third_party/blink/renderer/core/css/element_rule_collector.cc b/third_party/blink/renderer/core/css/element_rule_collector.cc index 3832de1..2fba5a9 100644 --- a/third_party/blink/renderer/core/css/element_rule_collector.cc +++ b/third_party/blink/renderer/core/css/element_rule_collector.cc
@@ -540,13 +540,6 @@ const ContainerQuery* container_query = container_query_seeker.Seek(rule_data.GetPosition()); if (container_query) { - if (container_query->Selector().SelectsSizeContainers()) { - result_.SetDependsOnSizeContainerQueries(); - } - if (container_query->Selector().SelectsStyleContainers()) { - result_.SetDependsOnStyleContainerQueries(); - } - // If we are matching pseudo elements like a ::before rule when computing // the styles of the originating element, we don't know whether the // container will be the originating element or not. There is not enough @@ -574,6 +567,24 @@ } continue; } + } else { + // We are skipping container query matching for pseudo element selectors + // when not actually matching style for the pseudo element itself. Still + // we need to keep track of size/style query dependencies since query + // changes may cause pseudo elements to start being generated. + bool selects_size = false; + bool selects_style = false; + for (const ContainerQuery* current = container_query; current; + current = current->Parent()) { + selects_size |= current->Selector().SelectsSizeContainers(); + selects_style |= current->Selector().SelectsStyleContainers(); + } + if (selects_size) { + result_.SetDependsOnSizeContainerQueries(); + } + if (selects_style) { + result_.SetDependsOnStyleContainerQueries(); + } } }
diff --git a/third_party/blink/renderer/core/fragment_directive/text_directive_options.idl b/third_party/blink/renderer/core/fragment_directive/text_directive_options.idl index f9d60398..b8275f0 100644 --- a/third_party/blink/renderer/core/fragment_directive/text_directive_options.idl +++ b/third_party/blink/renderer/core/fragment_directive/text_directive_options.idl
@@ -4,9 +4,7 @@ // https://github.com/WICG/ScrollToTextFragment -[ - RuntimeEnabled=TextFragmentAPI -] dictionary TextDirectiveOptions { +dictionary TextDirectiveOptions { DOMString prefix; DOMString textStart; DOMString textEnd;
diff --git a/third_party/blink/renderer/core/frame/directive.idl b/third_party/blink/renderer/core/frame/directive.idl index 50c8d28..ec86abb 100644 --- a/third_party/blink/renderer/core/frame/directive.idl +++ b/third_party/blink/renderer/core/frame/directive.idl
@@ -3,9 +3,7 @@ // found in the LICENSE file. // https://github.com/WICG/ScrollToTextFragment -[ - RuntimeEnabled=TextFragmentAPI -] enum DirectiveType { "text" }; +enum DirectiveType { "text" }; [ Exposed=Window,
diff --git a/third_party/blink/renderer/core/frame/local_frame_client.h b/third_party/blink/renderer/core/frame/local_frame_client.h index e5ad0659..077631b 100644 --- a/third_party/blink/renderer/core/frame/local_frame_client.h +++ b/third_party/blink/renderer/core/frame/local_frame_client.h
@@ -116,6 +116,7 @@ class ResourceLoadInfoNotifierWrapper; enum class SyncCondition; struct Impression; +struct JavaScriptFrameworkDetectionResult; struct MobileFriendliness; namespace scheduler { @@ -221,6 +222,10 @@ // propogates renderer loading behavior to the browser process for histograms. virtual void DidObserveLoadingBehavior(LoadingBehaviorFlag) {} + // propagates framework detection info to the browser process for histograms. + virtual void DidObserveJavaScriptFrameworks( + const JavaScriptFrameworkDetectionResult&) {} + // Will be called when a sub resource load happens. virtual void DidObserveSubresourceLoad( const SubresourceLoadMetrics& subresource_load_metrics) {}
diff --git a/third_party/blink/renderer/core/frame/local_frame_client_impl.cc b/third_party/blink/renderer/core/frame/local_frame_client_impl.cc index 482615f..6f1bcd63 100644 --- a/third_party/blink/renderer/core/frame/local_frame_client_impl.cc +++ b/third_party/blink/renderer/core/frame/local_frame_client_impl.cc
@@ -756,6 +756,11 @@ web_frame_->Client()->DidObserveLoadingBehavior(behavior); } +void LocalFrameClientImpl::DidObserveJavaScriptFrameworks( + const JavaScriptFrameworkDetectionResult& result) { + web_frame_->Client()->DidObserveJavaScriptFrameworks(result); +} + void LocalFrameClientImpl::DidObserveSubresourceLoad( const SubresourceLoadMetrics& subresource_load_metrics) { if (web_frame_->Client()) {
diff --git a/third_party/blink/renderer/core/frame/local_frame_client_impl.h b/third_party/blink/renderer/core/frame/local_frame_client_impl.h index 13af123..d8eed5e6 100644 --- a/third_party/blink/renderer/core/frame/local_frame_client_impl.h +++ b/third_party/blink/renderer/core/frame/local_frame_client_impl.h
@@ -156,6 +156,8 @@ UserInteractionType interaction_type) override; void DidChangeCpuTiming(base::TimeDelta) override; void DidObserveLoadingBehavior(LoadingBehaviorFlag) override; + void DidObserveJavaScriptFrameworks( + const JavaScriptFrameworkDetectionResult&) override; void DidObserveSubresourceLoad( const SubresourceLoadMetrics& subresource_load_metrics) override; void DidObserveNewFeatureUsage(const UseCounterFeature&) override;
diff --git a/third_party/blink/renderer/core/frame/pending_beacon.idl b/third_party/blink/renderer/core/frame/pending_beacon.idl index f65fafc..d5289853 100644 --- a/third_party/blink/renderer/core/frame/pending_beacon.idl +++ b/third_party/blink/renderer/core/frame/pending_beacon.idl
@@ -4,9 +4,9 @@ // https://github.com/WICG/pending-beacon/blob/main/README.md -[RuntimeEnabled = PendingBeaconAPI] enum BeaconMethod { "POST", "GET" }; +enum BeaconMethod { "POST", "GET" }; -[RuntimeEnabled = PendingBeaconAPI] dictionary PendingBeaconOptions { +dictionary PendingBeaconOptions { long backgroundTimeout = -1; long timeout = -1; };
diff --git a/third_party/blink/renderer/core/html/canvas/high_dynamic_range_options.idl b/third_party/blink/renderer/core/html/canvas/high_dynamic_range_options.idl index cac60527..9338f02 100644 --- a/third_party/blink/renderer/core/html/canvas/high_dynamic_range_options.idl +++ b/third_party/blink/renderer/core/html/canvas/high_dynamic_range_options.idl
@@ -8,7 +8,6 @@ }; // SMPTE ST 2086 color volume metadata. -[RuntimeEnabled=CanvasHDR] dictionary CanvasSmpteSt2086Metadata { required float redPrimaryX; required float redPrimaryY; @@ -22,7 +21,6 @@ required float maximumLuminance; }; -[RuntimeEnabled=CanvasHDR] dictionary CanvasHighDynamicRangeOptions { CanvasHighDynamicRangeMode mode = "default";
diff --git a/third_party/blink/renderer/core/loader/document_loader.cc b/third_party/blink/renderer/core/loader/document_loader.cc index c2eb91a..09ce6b7b 100644 --- a/third_party/blink/renderer/core/loader/document_loader.cc +++ b/third_party/blink/renderer/core/loader/document_loader.cc
@@ -763,6 +763,14 @@ } } +void DocumentLoader::DidObserveJavaScriptFrameworks( + const JavaScriptFrameworkDetectionResult& result) { + if (frame_) { + DCHECK_GE(state_, kCommitted); + GetLocalFrameClient().DidObserveJavaScriptFrameworks(result); + } +} + // static WebHistoryCommitType LoadTypeToCommitType(WebFrameLoadType type) { switch (type) {
diff --git a/third_party/blink/renderer/core/loader/document_loader.h b/third_party/blink/renderer/core/loader/document_loader.h index 45eea68..f974e3b 100644 --- a/third_party/blink/renderer/core/loader/document_loader.h +++ b/third_party/blink/renderer/core/loader/document_loader.h
@@ -113,6 +113,7 @@ class SerializedScriptValue; class SubresourceFilter; class WebServiceWorkerNetworkProvider; +struct JavaScriptFrameworkDetectionResult; namespace scheduler { class TaskAttributionId; @@ -228,6 +229,8 @@ void DidChangePerformanceTiming(); void DidObserveInputDelay(base::TimeDelta input_delay); void DidObserveLoadingBehavior(LoadingBehaviorFlag); + void DidObserveJavaScriptFrameworks( + const JavaScriptFrameworkDetectionResult&); // https://html.spec.whatwg.org/multipage/history.html#url-and-history-update-steps void RunURLAndHistoryUpdateSteps(const KURL&,
diff --git a/third_party/blink/renderer/core/script/detect_javascript_frameworks.cc b/third_party/blink/renderer/core/script/detect_javascript_frameworks.cc index 8f3ce57..c3650895 100644 --- a/third_party/blink/renderer/core/script/detect_javascript_frameworks.cc +++ b/third_party/blink/renderer/core/script/detect_javascript_frameworks.cc
@@ -5,9 +5,8 @@ #include "third_party/blink/renderer/core/script/detect_javascript_frameworks.h" #include "base/feature_list.h" -#include "services/metrics/public/cpp/ukm_builders.h" -#include "services/metrics/public/cpp/ukm_source_id.h" #include "third_party/blink/public/common/features.h" +#include "third_party/blink/public/common/loader/javascript_framework_detection.h" #include "third_party/blink/public/common/loader/loading_behavior_flag.h" #include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_core.h" #include "third_party/blink/renderer/core/dom/document.h" @@ -63,40 +62,50 @@ } inline void CheckIdMatches(Document& document, - int& loading_behavior_flag, + JavaScriptFrameworkDetectionResult& result, bool& has_nextjs_id) { DEFINE_STATIC_LOCAL(AtomicString, kReactId, ("react-root")); - if (IsFrameworkIDUsed(document, kGatsbyId)) - loading_behavior_flag |= kLoadingBehaviorGatsbyFrameworkUsed; - if (IsFrameworkIDUsed(document, kNextjsId)) + if (IsFrameworkIDUsed(document, kGatsbyId)) { + result.detected_versions[JavaScriptFramework::kGatsby] = + kNoFrameworkVersionDetected; + } + if (IsFrameworkIDUsed(document, kNextjsId)) { has_nextjs_id = true; - if (IsFrameworkIDUsed(document, kReactId)) - loading_behavior_flag |= kLoadingBehaviorReactFrameworkUsed; + } + if (IsFrameworkIDUsed(document, kReactId)) { + result.detected_versions[JavaScriptFramework::kReact] = + kNoFrameworkVersionDetected; + } } inline void CheckAttributeMatches(const Element& element, - int& loading_behavior_flag, + JavaScriptFrameworkDetectionResult& result, AtomicString& detected_ng_version) { DEFINE_STATIC_LOCAL(QualifiedName, ng_version, (g_null_atom, "ng-version", g_null_atom)); DEFINE_STATIC_LOCAL(QualifiedName, data_reactroot, (g_null_atom, "data-reactroot", g_null_atom)); static constexpr char kSvelte[] = "svelte-"; + if (element.FastHasAttribute(data_reactroot)) { + result.detected_versions[JavaScriptFramework::kReact] = + kNoFrameworkVersionDetected; + } + if (element.GetClassAttribute().StartsWith(kSvelte)) { + result.detected_versions[JavaScriptFramework::kSvelte] = + kNoFrameworkVersionDetected; + } if (element.FastHasAttribute(ng_version)) { - loading_behavior_flag |= kLoadingBehaviorAngularFrameworkUsed; + result.detected_versions[JavaScriptFramework::kAngular] = + kNoFrameworkVersionDetected; detected_ng_version = element.FastGetAttribute(ng_version); } - if (element.FastHasAttribute(data_reactroot)) - loading_behavior_flag |= kLoadingBehaviorReactFrameworkUsed; - if (element.GetClassAttribute().StartsWith(kSvelte)) - loading_behavior_flag |= kLoadingBehaviorSvelteFrameworkUsed; } inline void CheckPropertyMatches(Element& element, DOMDataStore& dom_data_store, v8::Local<v8::Context> context, v8::Isolate* isolate, - int& loading_behavior_flag) { + JavaScriptFrameworkDetectionResult& result) { v8::Local<v8::Object> v8_element = dom_data_store.Get(&element, isolate); if (v8_element.IsEmpty()) return; @@ -118,100 +127,89 @@ } AtomicString key_value = ToCoreAtomicString(key.As<v8::String>()); if (key_value == vue_string || key_value == vue_app_string) { - loading_behavior_flag |= kLoadingBehaviorVueFrameworkUsed; + result.detected_versions[JavaScriptFramework::kVue] = + kNoFrameworkVersionDetected; } else if (key_value == k_string) { - loading_behavior_flag |= kLoadingBehaviorPreactFrameworkUsed; + result.detected_versions[JavaScriptFramework::kPreact] = + kNoFrameworkVersionDetected; } else if (key_value == reactRootContainer_string) { - loading_behavior_flag |= kLoadingBehaviorReactFrameworkUsed; + result.detected_versions[JavaScriptFramework::kReact] = + kNoFrameworkVersionDetected; } else if (key_value.StartsWith(reactListening_string) || key_value.StartsWith(reactFiber_string)) { - loading_behavior_flag |= kLoadingBehaviorReactFrameworkUsed; + result.detected_versions[JavaScriptFramework::kReact] = + kNoFrameworkVersionDetected; } } } -inline void CheckGlobalPropertyMatches(v8::Local<v8::Context> context, - v8::Isolate* isolate, - int& loading_behavior_flag, - bool& has_nextjs_id) { +inline void CheckGlobalPropertyMatches( + v8::Local<v8::Context> context, + v8::Isolate* isolate, + JavaScriptFrameworkDetectionResult& result, + bool& has_nextjs_id) { static constexpr char kVueData[] = "Vue"; static constexpr char kVue3Data[] = "__VUE__"; static constexpr char kReactData[] = "React"; - if (has_nextjs_id && IsFrameworkVariableUsed(context, kNextjsData)) - loading_behavior_flag |= kLoadingBehaviorNextJSFrameworkUsed; - if (IsFrameworkVariableUsed(context, kNuxtjsData)) - loading_behavior_flag |= kLoadingBehaviorNuxtJSFrameworkUsed; - if (IsFrameworkVariableUsed(context, kSapperData)) - loading_behavior_flag |= kLoadingBehaviorSapperFrameworkUsed; - if (IsFrameworkVariableUsed(context, kVuepressData)) - loading_behavior_flag |= kLoadingBehaviorVuePressFrameworkUsed; + if (has_nextjs_id && IsFrameworkVariableUsed(context, kNextjsData)) { + result.detected_versions[JavaScriptFramework::kNext] = + kNoFrameworkVersionDetected; + } + if (IsFrameworkVariableUsed(context, kNuxtjsData)) { + result.detected_versions[JavaScriptFramework::kNuxt] = + kNoFrameworkVersionDetected; + } + if (IsFrameworkVariableUsed(context, kSapperData)) { + result.detected_versions[JavaScriptFramework::kSapper] = + kNoFrameworkVersionDetected; + } + if (IsFrameworkVariableUsed(context, kVuepressData)) { + result.detected_versions[JavaScriptFramework::kVuePress] = + kNoFrameworkVersionDetected; + } if (IsFrameworkVariableUsed(context, kVueData) || IsFrameworkVariableUsed(context, kVue3Data)) { - loading_behavior_flag |= kLoadingBehaviorVueFrameworkUsed; + result.detected_versions[JavaScriptFramework::kVue] = + kNoFrameworkVersionDetected; } // TODO(npm): Add check for window.React.Component, not just window.React. - if (IsFrameworkVariableUsed(context, kReactData)) - loading_behavior_flag |= kLoadingBehaviorReactFrameworkUsed; + if (IsFrameworkVariableUsed(context, kReactData)) { + result.detected_versions[JavaScriptFramework::kReact] = + kNoFrameworkVersionDetected; + } if (IsFrameworkVariableUsed(context, kShopify)) { - loading_behavior_flag |= kLoadingBehaviorShopifyCMSUsed; + result.detected_versions[JavaScriptFramework::kShopify] = + kNoFrameworkVersionDetected; } if (IsFrameworkVariableUsed(context, kSquarespace)) { - loading_behavior_flag |= kLoadingBehaviorSquarespaceCMSUsed; + result.detected_versions[JavaScriptFramework::kSquarespace] = + kNoFrameworkVersionDetected; } } -void DidObserveLoadingBehaviors(Document& document, int loading_behavior_flag) { - // TODO(npm): ideally we'd be able to surface multiple loading behaviors to - // the document loader at once. - static constexpr LoadingBehaviorFlag flags[] = { - kLoadingBehaviorAngularFrameworkUsed, - kLoadingBehaviorGatsbyFrameworkUsed, - kLoadingBehaviorNextJSFrameworkUsed, - kLoadingBehaviorNextJSFrameworkUsed, - kLoadingBehaviorNuxtJSFrameworkUsed, - kLoadingBehaviorPreactFrameworkUsed, - kLoadingBehaviorReactFrameworkUsed, - kLoadingBehaviorSapperFrameworkUsed, - kLoadingBehaviorSvelteFrameworkUsed, - kLoadingBehaviorVueFrameworkUsed, - kLoadingBehaviorVuePressFrameworkUsed, - kLoadingBehaviorDrupalCMSUsed, - kLoadingBehaviorJoomlaCMSUsed, - kLoadingBehaviorShopifyCMSUsed, - kLoadingBehaviorSquarespaceCMSUsed, - kLoadingBehaviorWixCMSUsed, - kLoadingBehaviorWordPressCMSUsed, - }; - for (LoadingBehaviorFlag flag : flags) { - if (loading_behavior_flag & flag) { - document.Loader()->DidObserveLoadingBehavior(flag); - } - } -} - -absl::optional<int64_t> ExtractVersion(v8::Local<v8::RegExp> regexp, - v8::Local<v8::Context> context, - v8::Local<v8::Value> version) { +int64_t ExtractVersion(v8::Local<v8::RegExp> regexp, + v8::Local<v8::Context> context, + v8::Local<v8::Value> version) { v8::Local<v8::Object> groups; v8::Local<v8::Value> major; v8::Local<v8::Value> minor; bool success = regexp->Exec(context, version.As<v8::String>()).ToLocal(&groups); if (!success || !groups->IsArray()) { - return absl::nullopt; + return kNoFrameworkVersionDetected; } v8::Local<v8::Array> groups_array = groups.As<v8::Array>(); if (!groups_array->Get(context, 1).ToLocal(&major) || !groups_array->Get(context, 2).ToLocal(&minor) || !major->IsString() || !minor->IsString()) { - return absl::nullopt; + return kNoFrameworkVersionDetected; } v8::Local<v8::Value> major_number; v8::Local<v8::Value> minor_number; if (!major->ToNumber(context).ToLocal(&major_number) || !minor->ToNumber(context).ToLocal(&minor_number)) { - return absl::nullopt; + return kNoFrameworkVersionDetected; } // Major & minor versions are clamped to 8bits to avoid using this as a @@ -223,21 +221,14 @@ void DetectFrameworkVersions(Document& document, v8::Local<v8::Context> context, v8::Isolate* isolate, - int& loading_behavior_flags, + JavaScriptFrameworkDetectionResult& result, const AtomicString& detected_ng_version) { - if (!document.UkmRecorder() || - document.UkmSourceID() == ukm::kInvalidSourceId) { - return; - } - ukm::builders::Blink_JavaScriptFramework_Versions builder( - document.UkmSourceID()); v8::Local<v8::Object> global = context->Global(); static constexpr char kVersionPattern[] = "([0-9]+)\\.([0-9]+)"; v8::Local<v8::RegExp> version_regexp = v8::RegExp::New(context, V8AtomicString(isolate, kVersionPattern), v8::RegExp::kNone) .ToLocalChecked(); - bool detected = false; auto SafeGetProperty = [&](v8::Local<v8::Value> object, const char* prop_name) -> v8::Local<v8::Value> { @@ -255,34 +246,28 @@ return value; }; - if (loading_behavior_flags & kLoadingBehaviorNextJSFrameworkUsed) { + if (result.detected_versions.contains(JavaScriptFramework::kNext)) { static constexpr char kNext[] = "next"; static constexpr char kVersion[] = "version"; + int64_t version = kNoFrameworkVersionDetected; v8::Local<v8::Value> version_string = SafeGetProperty(SafeGetProperty(global, kNext), kVersion); if (!version_string.IsEmpty() && version_string->IsString()) { - absl::optional<int64_t> version = - ExtractVersion(version_regexp, context, version_string); - if (version.has_value()) { - detected = true; - builder.SetNextJSVersion(version.value()); - } + version = ExtractVersion(version_regexp, context, version_string); } + + result.detected_versions[JavaScriptFramework::kNext] = version; } if (!detected_ng_version.IsNull()) { - absl::optional<int64_t> version = ExtractVersion( + result.detected_versions[JavaScriptFramework::kAngular] = ExtractVersion( version_regexp, context, v8::String::NewFromUtf8(isolate, detected_ng_version.GetString().Utf8().c_str()) .FromMaybe(v8::String::Empty(isolate))); - if (version.has_value()) { - detected = true; - builder.SetAngularVersion(version.value()); - } } - if (loading_behavior_flags & kLoadingBehaviorVueFrameworkUsed) { + if (result.detected_versions.contains(JavaScriptFramework::kVue)) { static constexpr char kVue2[] = "Vue"; static constexpr char kVersion[] = "version"; if (global->HasRealNamedProperty(context, V8AtomicString(isolate, kVue2)) @@ -290,12 +275,8 @@ v8::Local<v8::Value> version_string = SafeGetProperty(SafeGetProperty(global, kVue2), kVersion); if (!version_string.IsEmpty() && version_string->IsString()) { - absl::optional<int64_t> version = + result.detected_versions[JavaScriptFramework::kVue] = ExtractVersion(version_regexp, context, version_string); - if (version.has_value()) { - detected = true; - builder.SetVueVersion(version.value()); - } } } else { static constexpr char kVue3[] = "__VUE__"; @@ -303,9 +284,7 @@ if (global->HasRealNamedProperty(context, V8AtomicString(isolate, kVue3)) .To(&vue3) && vue3) { - detected = true; - // Vue3.x doesn't provide a detectable minor version number. - builder.SetVueVersion(0x300); + result.detected_versions[JavaScriptFramework::kVue] = 0x300; } } } @@ -324,9 +303,11 @@ const AtomicString& content = generator_meta->Content(); if (!content.empty()) { if (content.StartsWith("Wix")) { - loading_behavior_flags |= kLoadingBehaviorWixCMSUsed; + result.detected_versions[JavaScriptFramework::kWix] = + kNoFrameworkVersionDetected; } else if (content.StartsWith("Joomla")) { - loading_behavior_flags |= kLoadingBehaviorJoomlaCMSUsed; + result.detected_versions[JavaScriptFramework::kJoomla] = + kNoFrameworkVersionDetected; } else { constexpr char wordpress_prefix[] = "WordPress "; constexpr size_t wordpress_prefix_length = @@ -335,13 +316,9 @@ if (content.StartsWith(wordpress_prefix)) { String version_string = String(content).Substring(wordpress_prefix_length); - absl::optional<int64_t> version = ExtractVersion( - version_regexp, context, V8String(isolate, version_string)); - if (version) { - detected = true; - loading_behavior_flags |= kLoadingBehaviorWordPressCMSUsed; - builder.SetWordPressVersion(version.value()); - } + result.detected_versions[JavaScriptFramework::kWordPress] = + ExtractVersion(version_regexp, context, + V8String(isolate, version_string)); } constexpr char drupal_prefix[] = "Drupal "; @@ -355,26 +332,19 @@ version_string.Substring(0, version_string.Find(" ")); bool ok = true; int version = trimmed.ToInt(&ok); - if (ok) { - detected = true; - loading_behavior_flags |= kLoadingBehaviorDrupalCMSUsed; - builder.SetDrupalVersion((version & 0xff) << 8); - } + result.detected_versions[JavaScriptFramework::kDrupal] = + ok ? ((version & 0xff) << 8) : kNoFrameworkVersionDetected; } } } } - - if (detected) { - builder.Record(document.UkmRecorder()); - } } void TraverseTreeForFrameworks(Document& document, v8::Local<v8::Context> context) { v8::Isolate* isolate = context->GetIsolate(); v8::TryCatch try_catch(isolate); - int loading_behavior_flag = kLoadingBehaviorNone; + JavaScriptFrameworkDetectionResult result; AtomicString detected_ng_version; bool has_nextjs_id = false; if (!document.documentElement()) @@ -382,17 +352,15 @@ DOMDataStore& dom_data_store = DOMWrapperWorld::MainWorld().DomDataStore(); for (Element& element : ElementTraversal::InclusiveDescendantsOf(*document.documentElement())) { - CheckAttributeMatches(element, loading_behavior_flag, detected_ng_version); - CheckPropertyMatches(element, dom_data_store, context, isolate, - loading_behavior_flag); + CheckAttributeMatches(element, result, detected_ng_version); + CheckPropertyMatches(element, dom_data_store, context, isolate, result); } - CheckIdMatches(document, loading_behavior_flag, has_nextjs_id); - CheckGlobalPropertyMatches(context, isolate, loading_behavior_flag, - has_nextjs_id); - DCHECK(!try_catch.HasCaught()); - DetectFrameworkVersions(document, context, isolate, loading_behavior_flag, + CheckIdMatches(document, result, has_nextjs_id); + CheckGlobalPropertyMatches(context, isolate, result, has_nextjs_id); + DetectFrameworkVersions(document, context, isolate, result, detected_ng_version); - DidObserveLoadingBehaviors(document, loading_behavior_flag); + DCHECK(!try_catch.HasCaught()); + document.Loader()->DidObserveJavaScriptFrameworks(result); } } // namespace
diff --git a/third_party/blink/renderer/core/view_transition/view_transition_callback.idl b/third_party/blink/renderer/core/view_transition/view_transition_callback.idl index a2636c0..7e5d82c 100644 --- a/third_party/blink/renderer/core/view_transition/view_transition_callback.idl +++ b/third_party/blink/renderer/core/view_transition/view_transition_callback.idl
@@ -4,7 +4,6 @@ // TODO(vmpstr): Rename this to UpdateDOMCallback [ - RuntimeEnabled=ViewTransition, SupportsTaskAttribution ] callback ViewTransitionCallback = Promise<void>();
diff --git a/third_party/blink/renderer/modules/clipboard/clipboard.idl b/third_party/blink/renderer/modules/clipboard/clipboard.idl index 4bda310..31b5fa6 100644 --- a/third_party/blink/renderer/modules/clipboard/clipboard.idl +++ b/third_party/blink/renderer/modules/clipboard/clipboard.idl
@@ -4,7 +4,6 @@ // https://w3c.github.io/clipboard-apis/#clipboard-interface -[RuntimeEnabled=ClipboardUnsanitizedContent] dictionary ClipboardUnsanitizedFormats { sequence<DOMString> unsanitized; };
diff --git a/third_party/blink/renderer/modules/credentialmanagement/identity_claim_requirement.idl b/third_party/blink/renderer/modules/credentialmanagement/identity_claim_requirement.idl index 37c4b45..f19cedd 100644 --- a/third_party/blink/renderer/modules/credentialmanagement/identity_claim_requirement.idl +++ b/third_party/blink/renderer/modules/credentialmanagement/identity_claim_requirement.idl
@@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -[RuntimeEnabled=FedCmSelectiveDisclosure] dictionary IdentityClaimRequirement { // Controls the optionality of the attribute. // NOTE: "required" is a reserved WebIDL keyword, so we prefix it with
diff --git a/third_party/blink/renderer/modules/credentialmanagement/identity_credential_request_options.idl b/third_party/blink/renderer/modules/credentialmanagement/identity_credential_request_options.idl index b631da0..1a00bd5 100644 --- a/third_party/blink/renderer/modules/credentialmanagement/identity_credential_request_options.idl +++ b/third_party/blink/renderer/modules/credentialmanagement/identity_credential_request_options.idl
@@ -3,7 +3,6 @@ // found in the LICENSE file. // https://github.com/fedidcg/FedCM/blob/main/proposals/context-api.md -[RuntimeEnabled=FedCmRpContext] enum IdentityCredentialRequestOptionsContext { "signin", "signup",
diff --git a/third_party/blink/renderer/modules/credentialmanagement/identity_provider.idl b/third_party/blink/renderer/modules/credentialmanagement/identity_provider.idl index 445c9e0..8548dd8 100644 --- a/third_party/blink/renderer/modules/credentialmanagement/identity_provider.idl +++ b/third_party/blink/renderer/modules/credentialmanagement/identity_provider.idl
@@ -2,10 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -[ - SecureContext, - RuntimeEnabled=FedCmUserInfo -] dictionary IdentityUserInfo { +dictionary IdentityUserInfo { USVString email; USVString name; USVString given_name;
diff --git a/third_party/blink/renderer/modules/credentialmanagement/identity_standard_claims.idl b/third_party/blink/renderer/modules/credentialmanagement/identity_standard_claims.idl index dd50791..4eff1f8 100644 --- a/third_party/blink/renderer/modules/credentialmanagement/identity_standard_claims.idl +++ b/third_party/blink/renderer/modules/credentialmanagement/identity_standard_claims.idl
@@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -[RuntimeEnabled=FedCmSelectiveDisclosure] dictionary IdentityStandardClaims { // The standard identity claims is derived and kept consistent with the <form> // autocomplete spec.
diff --git a/third_party/blink/renderer/modules/formatted_text/formatted_text.idl b/third_party/blink/renderer/modules/formatted_text/formatted_text.idl index 3a2f167..07542568 100644 --- a/third_party/blink/renderer/modules/formatted_text/formatted_text.idl +++ b/third_party/blink/renderer/modules/formatted_text/formatted_text.idl
@@ -2,9 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -[ - RuntimeEnabled=FormattedText -] dictionary FormattedTextRun { DOMString? text; DOMString? style;
diff --git a/third_party/blink/renderer/modules/peerconnection/fake_rtc_rtp_transceiver_impl.cc b/third_party/blink/renderer/modules/peerconnection/fake_rtc_rtp_transceiver_impl.cc index c98fb13..f01601a 100644 --- a/third_party/blink/renderer/modules/peerconnection/fake_rtc_rtp_transceiver_impl.cc +++ b/third_party/blink/renderer/modules/peerconnection/fake_rtc_rtp_transceiver_impl.cc
@@ -102,10 +102,7 @@ NOTIMPLEMENTED(); } -void FakeRTCRtpSenderImpl::GetStats( - RTCStatsReportCallback, - const Vector<webrtc::NonStandardGroupId>&, - bool is_track_stats_deprecation_trial_enabled) { +void FakeRTCRtpSenderImpl::GetStats(RTCStatsReportCallback) { NOTIMPLEMENTED(); } @@ -165,10 +162,7 @@ return {}; } -void FakeRTCRtpReceiverImpl::GetStats( - RTCStatsReportCallback, - const Vector<webrtc::NonStandardGroupId>&, - bool is_track_stats_deprecation_trial_enabled) { +void FakeRTCRtpReceiverImpl::GetStats(RTCStatsReportCallback) { NOTIMPLEMENTED(); }
diff --git a/third_party/blink/renderer/modules/peerconnection/fake_rtc_rtp_transceiver_impl.h b/third_party/blink/renderer/modules/peerconnection/fake_rtc_rtp_transceiver_impl.h index dca94c2a..4e899bf 100644 --- a/third_party/blink/renderer/modules/peerconnection/fake_rtc_rtp_transceiver_impl.h +++ b/third_party/blink/renderer/modules/peerconnection/fake_rtc_rtp_transceiver_impl.h
@@ -49,9 +49,7 @@ void SetParameters(Vector<webrtc::RtpEncodingParameters>, absl::optional<webrtc::DegradationPreference>, blink::RTCVoidRequest*) override; - void GetStats(RTCStatsReportCallback, - const Vector<webrtc::NonStandardGroupId>&, - bool is_track_stats_deprecation_trial_enabled) override; + void GetStats(RTCStatsReportCallback) override; void SetStreams(const Vector<String>& stream_ids) override; private: @@ -77,9 +75,7 @@ MediaStreamComponent* Track() const override; Vector<String> StreamIds() const override; Vector<std::unique_ptr<RTCRtpSource>> GetSources() override; - void GetStats(RTCStatsReportCallback, - const Vector<webrtc::NonStandardGroupId>&, - bool is_track_stats_deprecation_trial_enabled) override; + void GetStats(RTCStatsReportCallback) override; std::unique_ptr<webrtc::RtpParameters> GetParameters() const override; void SetJitterBufferMinimumDelay( absl::optional<double> delay_seconds) override;
diff --git a/third_party/blink/renderer/modules/peerconnection/mock_rtc_peer_connection_handler_platform.cc b/third_party/blink/renderer/modules/peerconnection/mock_rtc_peer_connection_handler_platform.cc index 5b99192..6dff12b 100644 --- a/third_party/blink/renderer/modules/peerconnection/mock_rtc_peer_connection_handler_platform.cc +++ b/third_party/blink/renderer/modules/peerconnection/mock_rtc_peer_connection_handler_platform.cc
@@ -91,9 +91,7 @@ void SetParameters(Vector<webrtc::RtpEncodingParameters>, absl::optional<webrtc::DegradationPreference>, RTCVoidRequest*) override {} - void GetStats(RTCStatsReportCallback, - const Vector<webrtc::NonStandardGroupId>&, - bool is_track_stats_deprecation_trial_enabled) override {} + void GetStats(RTCStatsReportCallback) override {} void SetStreams(const Vector<String>& stream_ids) override {} private: @@ -154,9 +152,7 @@ Vector<std::unique_ptr<RTCRtpSource>> GetSources() override { return Vector<std::unique_ptr<RTCRtpSource>>(); } - void GetStats(RTCStatsReportCallback, - const Vector<webrtc::NonStandardGroupId>&, - bool is_track_stats_deprecation_trial_enabled) override {} + void GetStats(RTCStatsReportCallback) override {} std::unique_ptr<webrtc::RtpParameters> GetParameters() const override { return nullptr; } @@ -331,10 +327,7 @@ void MockRTCPeerConnectionHandlerPlatform::GetStats(RTCStatsRequest*) {} -void MockRTCPeerConnectionHandlerPlatform::GetStats( - RTCStatsReportCallback, - const Vector<webrtc::NonStandardGroupId>&, - bool is_track_stats_deprecation_trial_enabled) {} +void MockRTCPeerConnectionHandlerPlatform::GetStats(RTCStatsReportCallback) {} webrtc::RTCErrorOr<std::unique_ptr<RTCRtpTransceiverPlatform>> MockRTCPeerConnectionHandlerPlatform::AddTransceiverWithTrack(
diff --git a/third_party/blink/renderer/modules/peerconnection/mock_rtc_peer_connection_handler_platform.h b/third_party/blink/renderer/modules/peerconnection/mock_rtc_peer_connection_handler_platform.h index b6858c5..394a4d0 100644 --- a/third_party/blink/renderer/modules/peerconnection/mock_rtc_peer_connection_handler_platform.h +++ b/third_party/blink/renderer/modules/peerconnection/mock_rtc_peer_connection_handler_platform.h
@@ -80,9 +80,7 @@ void AddIceCandidate(RTCVoidRequest*, RTCIceCandidatePlatform*) override; void RestartIce() override; void GetStats(RTCStatsRequest*) override; - void GetStats(RTCStatsReportCallback, - const Vector<webrtc::NonStandardGroupId>&, - bool is_track_stats_deprecation_trial_enabled) override; + void GetStats(RTCStatsReportCallback) override; webrtc::RTCErrorOr<std::unique_ptr<RTCRtpTransceiverPlatform>> AddTransceiverWithTrack(MediaStreamComponent*, const webrtc::RtpTransceiverInit&) override;
diff --git a/third_party/blink/renderer/modules/peerconnection/rtc_codec_specifics.idl b/third_party/blink/renderer/modules/peerconnection/rtc_codec_specifics.idl index dfdfc571..e79992e 100644 --- a/third_party/blink/renderer/modules/peerconnection/rtc_codec_specifics.idl +++ b/third_party/blink/renderer/modules/peerconnection/rtc_codec_specifics.idl
@@ -5,7 +5,6 @@ // TODO(https://crbug.com/webrtc/14709): Support more codecs. typedef RTCCodecSpecificsVP8 RTCCodecSpecifics; -[Serializable] dictionary RTCCodecSpecificsVP8 { boolean nonReference; short pictureId;
diff --git a/third_party/blink/renderer/modules/peerconnection/rtc_encoded_video_frame_metadata.idl b/third_party/blink/renderer/modules/peerconnection/rtc_encoded_video_frame_metadata.idl index 8a38938..bc72893 100644 --- a/third_party/blink/renderer/modules/peerconnection/rtc_encoded_video_frame_metadata.idl +++ b/third_party/blink/renderer/modules/peerconnection/rtc_encoded_video_frame_metadata.idl
@@ -19,7 +19,6 @@ "required", }; -[Serializable] dictionary RTCEncodedVideoFrameMetadata { // Encoding related metadata long long frameId;
diff --git a/third_party/blink/renderer/modules/peerconnection/rtc_peer_connection.cc b/third_party/blink/renderer/modules/peerconnection/rtc_peer_connection.cc index 24786791..4863f75 100644 --- a/third_party/blink/renderer/modules/peerconnection/rtc_peer_connection.cc +++ b/third_party/blink/renderer/modules/peerconnection/rtc_peer_connection.cc
@@ -1746,12 +1746,8 @@ // while leaving the associated promise pending as specified. resolver->Detach(); } else { - bool is_track_stats_deprecation_trial_enabled = - RuntimeEnabledFeatures::RTCLegacyTrackStatsEnabled(context); peer_handler_->GetStats(WTF::BindOnce(WebRTCStatsReportCallbackResolver, - WrapPersistent(resolver)), - GetExposedGroupIds(script_state), - is_track_stats_deprecation_trial_enabled); + WrapPersistent(resolver))); } return promise; }
diff --git a/third_party/blink/renderer/modules/peerconnection/rtc_peer_connection_handler.cc b/third_party/blink/renderer/modules/peerconnection/rtc_peer_connection_handler.cc index 59c57c9..76fa9380 100644 --- a/third_party/blink/renderer/modules/peerconnection/rtc_peer_connection_handler.cc +++ b/third_party/blink/renderer/modules/peerconnection/rtc_peer_connection_handler.cc
@@ -490,14 +490,11 @@ void GetRTCStatsOnSignalingThread( const scoped_refptr<base::SingleThreadTaskRunner>& main_thread, rtc::scoped_refptr<webrtc::PeerConnectionInterface> native_peer_connection, - RTCStatsReportCallbackInternal callback, - const Vector<webrtc::NonStandardGroupId>& exposed_group_ids, - bool is_track_stats_deprecation_trial_enabled) { + RTCStatsReportCallbackInternal callback) { TRACE_EVENT0("webrtc", "GetRTCStatsOnSignalingThread"); native_peer_connection->GetStats( CreateRTCStatsCollectorCallback( - main_thread, ConvertToBaseOnceCallback(std::move(callback)), - exposed_group_ids, is_track_stats_deprecation_trial_enabled) + main_thread, ConvertToBaseOnceCallback(std::move(callback))) .get()); } @@ -1644,17 +1641,13 @@ level, observer, std::move(selector))); } -void RTCPeerConnectionHandler::GetStats( - RTCStatsReportCallback callback, - const Vector<webrtc::NonStandardGroupId>& exposed_group_ids, - bool is_track_stats_deprecation_trial_enabled) { +void RTCPeerConnectionHandler::GetStats(RTCStatsReportCallback callback) { DCHECK(task_runner_->RunsTasksInCurrentSequence()); PostCrossThreadTask( *signaling_thread().get(), FROM_HERE, - CrossThreadBindOnce( - &GetRTCStatsOnSignalingThread, task_runner_, native_peer_connection_, - CrossThreadBindOnce(std::move(callback)), exposed_group_ids, - is_track_stats_deprecation_trial_enabled)); + CrossThreadBindOnce(&GetRTCStatsOnSignalingThread, task_runner_, + native_peer_connection_, + CrossThreadBindOnce(std::move(callback)))); } webrtc::RTCErrorOr<std::unique_ptr<RTCRtpTransceiverPlatform>>
diff --git a/third_party/blink/renderer/modules/peerconnection/rtc_peer_connection_handler.h b/third_party/blink/renderer/modules/peerconnection/rtc_peer_connection_handler.h index 8b3e82e..aef2947 100644 --- a/third_party/blink/renderer/modules/peerconnection/rtc_peer_connection_handler.h +++ b/third_party/blink/renderer/modules/peerconnection/rtc_peer_connection_handler.h
@@ -206,10 +206,7 @@ virtual void RestartIce(); virtual void GetStats(RTCStatsRequest* request); - virtual void GetStats( - RTCStatsReportCallback callback, - const Vector<webrtc::NonStandardGroupId>& exposed_group_ids, - bool is_track_stats_deprecation_trial_enabled); + virtual void GetStats(RTCStatsReportCallback callback); virtual webrtc::RTCErrorOr<std::unique_ptr<RTCRtpTransceiverPlatform>> AddTransceiverWithTrack(MediaStreamComponent* component, const webrtc::RtpTransceiverInit& init);
diff --git a/third_party/blink/renderer/modules/peerconnection/rtc_peer_connection_handler_test.cc b/third_party/blink/renderer/modules/peerconnection/rtc_peer_connection_handler_test.cc index 71214c4..7d10dff 100644 --- a/third_party/blink/renderer/modules/peerconnection/rtc_peer_connection_handler_test.cc +++ b/third_party/blink/renderer/modules/peerconnection/rtc_peer_connection_handler_test.cc
@@ -915,139 +915,6 @@ StopAllTracks(local_stream); } -TEST_F(RTCPeerConnectionHandlerTest, GetRTCStats) { - rtc::scoped_refptr<webrtc::RTCStatsReport> report = - webrtc::RTCStatsReport::Create(webrtc::Timestamp::Micros(42)); - - report->AddStats( - std::unique_ptr<const webrtc::RTCStats>(new webrtc::RTCTestStats( - "RTCUndefinedStats", webrtc::Timestamp::Micros(1000)))); - - std::unique_ptr<webrtc::RTCTestStats> stats_defined_members( - new webrtc::RTCTestStats("RTCDefinedStats", - webrtc::Timestamp::Micros(2000))); - stats_defined_members->m_bool = true; - stats_defined_members->m_int32 = 42; - stats_defined_members->m_uint32 = 42; - stats_defined_members->m_int64 = 42; - stats_defined_members->m_uint64 = 42; - stats_defined_members->m_double = 42.0; - stats_defined_members->m_string = "42"; - stats_defined_members->m_sequence_bool = ToSequence<bool>(true); - stats_defined_members->m_sequence_int32 = ToSequence<int32_t>(42); - stats_defined_members->m_sequence_uint32 = ToSequence<uint32_t>(42); - stats_defined_members->m_sequence_int64 = ToSequence<int64_t>(42); - stats_defined_members->m_sequence_uint64 = ToSequence<uint64_t>(42); - stats_defined_members->m_sequence_double = ToSequence<double>(42); - stats_defined_members->m_sequence_string = ToSequence<std::string>("42"); - stats_defined_members->m_map_string_uint64 = ToMap<uint64_t>("42", 42); - stats_defined_members->m_map_string_double = ToMap<double>("42", 42.0); - report->AddStats( - std::unique_ptr<const webrtc::RTCStats>(stats_defined_members.release())); - - pc_handler_->native_peer_connection()->SetGetStatsReport(report.get()); - std::unique_ptr<RTCStatsReportPlatform> result; - pc_handler_->GetStats( - base::BindOnce(OnStatsDelivered, &result, - blink::scheduler::GetSingleThreadTaskRunnerForTesting()), - {}, false); - RunMessageLoopsUntilIdle(); - EXPECT_TRUE(result); - - int undefined_stats_count = 0; - int defined_stats_count = 0; - for (std::unique_ptr<RTCStatsWrapper> stats = result->Next(); stats; - stats = result->Next()) { - EXPECT_EQ(stats->GetType().Utf8(), webrtc::RTCTestStats::kType); - if (stats->Id().Utf8() == "RTCUndefinedStats") { - ++undefined_stats_count; - EXPECT_EQ(stats->TimestampMs(), 1.0); - for (size_t i = 0; i < stats->MembersCount(); ++i) { - EXPECT_FALSE(stats->GetMember(i)->IsDefined()); - } - } else if (stats->Id().Utf8() == "RTCDefinedStats") { - ++defined_stats_count; - EXPECT_EQ(stats->TimestampMs(), 2.0); - std::set<webrtc::RTCStatsMemberInterface::Type> members; - for (size_t i = 0; i < stats->MembersCount(); ++i) { - std::unique_ptr<RTCStatsMember> member = stats->GetMember(i); - // TODO(hbos): A WebRTC-change is adding new members, this would cause - // not all members to be defined. This if-statement saves Chromium from - // crashing. As soon as the change has been rolled in, I will update - // this test. crbug.com/627816 - if (!member->IsDefined()) - continue; - EXPECT_TRUE(member->IsDefined()); - members.insert(member->GetType()); - switch (member->GetType()) { - case webrtc::RTCStatsMemberInterface::kBool: - EXPECT_EQ(member->ValueBool(), true); - break; - case webrtc::RTCStatsMemberInterface::kInt32: - EXPECT_EQ(member->ValueInt32(), static_cast<int32_t>(42)); - break; - case webrtc::RTCStatsMemberInterface::kUint32: - EXPECT_EQ(member->ValueUint32(), static_cast<uint32_t>(42)); - break; - case webrtc::RTCStatsMemberInterface::kInt64: - EXPECT_EQ(member->ValueInt64(), static_cast<int64_t>(42)); - break; - case webrtc::RTCStatsMemberInterface::kUint64: - EXPECT_EQ(member->ValueUint64(), static_cast<uint64_t>(42)); - break; - case webrtc::RTCStatsMemberInterface::kDouble: - EXPECT_EQ(member->ValueDouble(), 42.0); - break; - case webrtc::RTCStatsMemberInterface::kString: - EXPECT_EQ(member->ValueString(), "42"); - break; - case webrtc::RTCStatsMemberInterface::kSequenceBool: - ExpectSequenceEquals(member->ValueSequenceBool(), true); - break; - case webrtc::RTCStatsMemberInterface::kSequenceInt32: - ExpectSequenceEquals(member->ValueSequenceInt32(), - static_cast<int32_t>(42)); - break; - case webrtc::RTCStatsMemberInterface::kSequenceUint32: - ExpectSequenceEquals(member->ValueSequenceUint32(), - static_cast<uint32_t>(42)); - break; - case webrtc::RTCStatsMemberInterface::kSequenceInt64: - ExpectSequenceEquals(member->ValueSequenceInt64(), - static_cast<int64_t>(42)); - break; - case webrtc::RTCStatsMemberInterface::kSequenceUint64: - ExpectSequenceEquals(member->ValueSequenceUint64(), - static_cast<uint64_t>(42)); - break; - case webrtc::RTCStatsMemberInterface::kSequenceDouble: - ExpectSequenceEquals(member->ValueSequenceDouble(), 42.0); - break; - case webrtc::RTCStatsMemberInterface::kSequenceString: - ExpectSequenceEquals(member->ValueSequenceString(), - String::FromUTF8("42")); - break; - case webrtc::RTCStatsMemberInterface::kMapStringUint64: - ExpectMapEquals(member->ValueMapStringUint64(), - String::FromUTF8("42"), static_cast<uint64_t>(42)); - break; - case webrtc::RTCStatsMemberInterface::kMapStringDouble: - ExpectMapEquals(member->ValueMapStringDouble(), - String::FromUTF8("42"), 42.0); - break; - default: - NOTREACHED(); - } - } - EXPECT_EQ(members.size(), static_cast<size_t>(16)); - } else { - NOTREACHED(); - } - } - EXPECT_EQ(undefined_stats_count, 1); - EXPECT_EQ(defined_stats_count, 1); -} - TEST_F(RTCPeerConnectionHandlerTest, OnConnectionChange) { testing::InSequence sequence;
diff --git a/third_party/blink/renderer/modules/peerconnection/rtc_rtp_receiver.cc b/third_party/blink/renderer/modules/peerconnection/rtc_rtp_receiver.cc index c64d8b4..e52c7702 100644 --- a/third_party/blink/renderer/modules/peerconnection/rtc_rtp_receiver.cc +++ b/third_party/blink/renderer/modules/peerconnection/rtc_rtp_receiver.cc
@@ -127,13 +127,8 @@ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); auto* resolver = MakeGarbageCollected<ScriptPromiseResolver>(script_state); ScriptPromise promise = resolver->Promise(); - bool is_track_stats_deprecation_trial_enabled = - RuntimeEnabledFeatures::RTCLegacyTrackStatsEnabled( - ExecutionContext::From(script_state)); receiver_->GetStats(WTF::BindOnce(WebRTCStatsReportCallbackResolver, - WrapPersistent(resolver)), - GetExposedGroupIds(script_state), - is_track_stats_deprecation_trial_enabled); + WrapPersistent(resolver))); return promise; }
diff --git a/third_party/blink/renderer/modules/peerconnection/rtc_rtp_receiver_impl.cc b/third_party/blink/renderer/modules/peerconnection/rtc_rtp_receiver_impl.cc index 751b026..d76519d 100644 --- a/third_party/blink/renderer/modules/peerconnection/rtc_rtp_receiver_impl.cc +++ b/third_party/blink/renderer/modules/peerconnection/rtc_rtp_receiver_impl.cc
@@ -191,14 +191,11 @@ return sources; } - void GetStats(RTCStatsReportCallback callback, - const Vector<webrtc::NonStandardGroupId>& exposed_group_ids, - bool is_track_stats_deprecation_trial_enabled) { + void GetStats(RTCStatsReportCallback callback) { signaling_task_runner_->PostTask( FROM_HERE, base::BindOnce(&RTCRtpReceiverInternal::GetStatsOnSignalingThread, this, - std::move(callback), exposed_group_ids, - is_track_stats_deprecation_trial_enabled)); + std::move(callback))); } std::unique_ptr<webrtc::RtpParameters> GetParameters() { @@ -228,16 +225,12 @@ DCHECK(main_task_runner_->BelongsToCurrentThread()); } - void GetStatsOnSignalingThread( - RTCStatsReportCallback callback, - const Vector<webrtc::NonStandardGroupId>& exposed_group_ids, - bool is_track_stats_deprecation_trial_enabled) { + void GetStatsOnSignalingThread(RTCStatsReportCallback callback) { native_peer_connection_->GetStats( rtc::scoped_refptr<webrtc::RtpReceiverInterface>( webrtc_receiver_.get()), - CreateRTCStatsCollectorCallback( - main_task_runner_, std::move(callback), exposed_group_ids, - is_track_stats_deprecation_trial_enabled)); + CreateRTCStatsCollectorCallback(main_task_runner_, + std::move(callback))); } const rtc::scoped_refptr<webrtc::PeerConnectionInterface> @@ -338,12 +331,8 @@ return internal_->GetSources(); } -void RTCRtpReceiverImpl::GetStats( - RTCStatsReportCallback callback, - const Vector<webrtc::NonStandardGroupId>& exposed_group_ids, - bool is_track_stats_deprecation_trial_enabled) { - internal_->GetStats(std::move(callback), exposed_group_ids, - is_track_stats_deprecation_trial_enabled); +void RTCRtpReceiverImpl::GetStats(RTCStatsReportCallback callback) { + internal_->GetStats(std::move(callback)); } std::unique_ptr<webrtc::RtpParameters> RTCRtpReceiverImpl::GetParameters()
diff --git a/third_party/blink/renderer/modules/peerconnection/rtc_rtp_receiver_impl.h b/third_party/blink/renderer/modules/peerconnection/rtc_rtp_receiver_impl.h index c5d0c0b..ce53f73 100644 --- a/third_party/blink/renderer/modules/peerconnection/rtc_rtp_receiver_impl.h +++ b/third_party/blink/renderer/modules/peerconnection/rtc_rtp_receiver_impl.h
@@ -133,9 +133,7 @@ MediaStreamComponent* Track() const override; Vector<String> StreamIds() const override; Vector<std::unique_ptr<RTCRtpSource>> GetSources() override; - void GetStats(RTCStatsReportCallback, - const Vector<webrtc::NonStandardGroupId>&, - bool is_track_stats_deprecation_trial_enabled) override; + void GetStats(RTCStatsReportCallback) override; std::unique_ptr<webrtc::RtpParameters> GetParameters() const override; void SetJitterBufferMinimumDelay( absl::optional<double> delay_seconds) override;
diff --git a/third_party/blink/renderer/modules/peerconnection/rtc_rtp_receiver_impl_test.cc b/third_party/blink/renderer/modules/peerconnection/rtc_rtp_receiver_impl_test.cc index 4cfadec6..1bc3f90 100644 --- a/third_party/blink/renderer/modules/peerconnection/rtc_rtp_receiver_impl_test.cc +++ b/third_party/blink/renderer/modules/peerconnection/rtc_rtp_receiver_impl_test.cc
@@ -86,7 +86,7 @@ scoped_refptr<blink::TestWebRTCStatsReportObtainer> GetStats() { scoped_refptr<blink::TestWebRTCStatsReportObtainer> obtainer = base::MakeRefCounted<TestWebRTCStatsReportObtainer>(); - receiver_->GetStats(obtainer->GetStatsCallbackWrapper(), {}, false); + receiver_->GetStats(obtainer->GetStatsCallbackWrapper()); return obtainer; } @@ -164,12 +164,6 @@ // Wait for the report, this performs the necessary run-loop. auto* report = obtainer->WaitForReport(); EXPECT_TRUE(report); - - // Verify dummy value. - EXPECT_EQ(report->Size(), 1u); - auto stats = report->GetStats(blink::WebString::FromUTF8("stats-id")); - EXPECT_TRUE(stats); - EXPECT_EQ(stats->TimestampMs(), 1.234); } TEST_F(RTCRtpReceiverImplTest, CreateReceiverWithInsertableStreams) {
diff --git a/third_party/blink/renderer/modules/peerconnection/rtc_rtp_sender.cc b/third_party/blink/renderer/modules/peerconnection/rtc_rtp_sender.cc index 1982745..bffc4f73 100644 --- a/third_party/blink/renderer/modules/peerconnection/rtc_rtp_sender.cc +++ b/third_party/blink/renderer/modules/peerconnection/rtc_rtp_sender.cc
@@ -781,13 +781,8 @@ DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); auto* resolver = MakeGarbageCollected<ScriptPromiseResolver>(script_state); ScriptPromise promise = resolver->Promise(); - bool is_track_stats_deprecation_trial_enabled = - RuntimeEnabledFeatures::RTCLegacyTrackStatsEnabled( - ExecutionContext::From(script_state)); sender_->GetStats(WTF::BindOnce(WebRTCStatsReportCallbackResolver, - WrapPersistent(resolver)), - GetExposedGroupIds(script_state), - is_track_stats_deprecation_trial_enabled); + WrapPersistent(resolver))); return promise; }
diff --git a/third_party/blink/renderer/modules/peerconnection/rtc_rtp_sender_impl.cc b/third_party/blink/renderer/modules/peerconnection/rtc_rtp_sender_impl.cc index 62caf80b..193d200 100644 --- a/third_party/blink/renderer/modules/peerconnection/rtc_rtp_sender_impl.cc +++ b/third_party/blink/renderer/modules/peerconnection/rtc_rtp_sender_impl.cc
@@ -302,15 +302,12 @@ CrossThreadBindOnce(std::move(callback)))); } - void GetStats(RTCStatsReportCallback callback, - const Vector<webrtc::NonStandardGroupId>& exposed_group_ids, - bool is_track_stats_deprecation_trial_enabled) { + void GetStats(RTCStatsReportCallback callback) { PostCrossThreadTask( *signaling_task_runner_.get(), FROM_HERE, CrossThreadBindOnce( &RTCRtpSenderImpl::RTCRtpSenderInternal::GetStatsOnSignalingThread, - WrapRefCounted(this), CrossThreadBindOnce(std::move(callback)), - exposed_group_ids, is_track_stats_deprecation_trial_enabled)); + WrapRefCounted(this), CrossThreadBindOnce(std::move(callback)))); } bool RemoveFromPeerConnection(webrtc::PeerConnectionInterface* pc) { @@ -382,15 +379,11 @@ using RTCStatsReportCallbackInternal = CrossThreadOnceFunction<void(std::unique_ptr<RTCStatsReportPlatform>)>; - void GetStatsOnSignalingThread( - RTCStatsReportCallbackInternal callback, - const Vector<webrtc::NonStandardGroupId>& exposed_group_ids, - bool is_track_stats_deprecation_trial_enabled) { + void GetStatsOnSignalingThread(RTCStatsReportCallbackInternal callback) { native_peer_connection_->GetStats( rtc::scoped_refptr<webrtc::RtpSenderInterface>(webrtc_sender_.get()), CreateRTCStatsCollectorCallback( - main_task_runner_, ConvertToBaseOnceCallback(std::move(callback)), - exposed_group_ids, is_track_stats_deprecation_trial_enabled)); + main_task_runner_, ConvertToBaseOnceCallback(std::move(callback)))); } void SetParametersOnSignalingThread( @@ -538,12 +531,8 @@ WTF::BindOnce(&OnSetParametersCompleted, WrapPersistent(request))); } -void RTCRtpSenderImpl::GetStats( - RTCStatsReportCallback callback, - const Vector<webrtc::NonStandardGroupId>& exposed_group_ids, - bool is_track_stats_deprecation_trial_enabled) { - internal_->GetStats(std::move(callback), exposed_group_ids, - is_track_stats_deprecation_trial_enabled); +void RTCRtpSenderImpl::GetStats(RTCStatsReportCallback callback) { + internal_->GetStats(std::move(callback)); } void RTCRtpSenderImpl::SetStreams(const Vector<String>& stream_ids) {
diff --git a/third_party/blink/renderer/modules/peerconnection/rtc_rtp_sender_impl.h b/third_party/blink/renderer/modules/peerconnection/rtc_rtp_sender_impl.h index 820ac0f..4d2a506 100644 --- a/third_party/blink/renderer/modules/peerconnection/rtc_rtp_sender_impl.h +++ b/third_party/blink/renderer/modules/peerconnection/rtc_rtp_sender_impl.h
@@ -148,9 +148,7 @@ void SetParameters(Vector<webrtc::RtpEncodingParameters>, absl::optional<webrtc::DegradationPreference>, blink::RTCVoidRequest*) override; - void GetStats(RTCStatsReportCallback, - const Vector<webrtc::NonStandardGroupId>&, - bool is_track_stats_deprecation_trial_enabled) override; + void GetStats(RTCStatsReportCallback) override; void SetStreams(const Vector<String>& stream_ids) override; RTCEncodedAudioStreamTransformer* GetEncodedAudioStreamTransformer() const override;
diff --git a/third_party/blink/renderer/modules/peerconnection/rtc_rtp_sender_impl_test.cc b/third_party/blink/renderer/modules/peerconnection/rtc_rtp_sender_impl_test.cc index 1b951cb..4c5cd64 100644 --- a/third_party/blink/renderer/modules/peerconnection/rtc_rtp_sender_impl_test.cc +++ b/third_party/blink/renderer/modules/peerconnection/rtc_rtp_sender_impl_test.cc
@@ -124,7 +124,7 @@ scoped_refptr<blink::TestWebRTCStatsReportObtainer> CallGetStats() { scoped_refptr<blink::TestWebRTCStatsReportObtainer> obtainer = base::MakeRefCounted<TestWebRTCStatsReportObtainer>(); - sender_->GetStats(obtainer->GetStatsCallbackWrapper(), {}, false); + sender_->GetStats(obtainer->GetStatsCallbackWrapper()); return obtainer; } @@ -236,12 +236,6 @@ // Wait for the report, this performs the necessary run-loop. auto* report = obtainer->WaitForReport(); EXPECT_TRUE(report); - - // Verify dummy value. - EXPECT_EQ(report->Size(), 1u); - auto stats = report->GetStats(blink::WebString::FromUTF8("stats-id")); - EXPECT_TRUE(stats); - EXPECT_EQ(stats->TimestampMs(), 1.234); } TEST_F(RTCRtpSenderImplTest, CopiedSenderSharesInternalStates) {
diff --git a/third_party/blink/renderer/modules/peerconnection/rtc_stats_report.cc b/third_party/blink/renderer/modules/peerconnection/rtc_stats_report.cc index 9bca32d4..d58e179d 100644 --- a/third_party/blink/renderer/modules/peerconnection/rtc_stats_report.cc +++ b/third_party/blink/renderer/modules/peerconnection/rtc_stats_report.cc
@@ -76,87 +76,6 @@ return window && IsCapturing(window); } -v8::Local<v8::Object> RTCStatsToV8Object(ScriptState* script_state, - const RTCStatsWrapper* stats) { - V8ObjectBuilder builder(script_state); - - builder.AddString("id", stats->Id()); - builder.AddNumber("timestamp", stats->TimestampMs()); - builder.AddString("type", stats->GetType()); - - const bool expose_hardware_caps = ExposeHardwareCapabilityStats(script_state); - - for (size_t i = 0; i < stats->MembersCount(); ++i) { - std::unique_ptr<RTCStatsMember> member = stats->GetMember(i); - if (!member->IsDefined() || - (!expose_hardware_caps && - member->Restriction() == - RTCStatsMember::ExposureRestriction::kHardwareCapability)) { - continue; - } - String name = member->GetName(); - switch (member->GetType()) { - case webrtc::RTCStatsMemberInterface::kBool: - builder.AddBoolean(name, member->ValueBool()); - break; - case webrtc::RTCStatsMemberInterface::kInt32: - builder.AddNumber(name, static_cast<double>(member->ValueInt32())); - break; - case webrtc::RTCStatsMemberInterface::kUint32: - builder.AddNumber(name, static_cast<double>(member->ValueUint32())); - break; - case webrtc::RTCStatsMemberInterface::kInt64: - builder.AddNumber(name, static_cast<double>(member->ValueInt64())); - break; - case webrtc::RTCStatsMemberInterface::kUint64: - builder.AddNumber(name, static_cast<double>(member->ValueUint64())); - break; - case webrtc::RTCStatsMemberInterface::kDouble: - builder.AddNumber(name, member->ValueDouble()); - break; - case webrtc::RTCStatsMemberInterface::kString: - builder.AddString(name, member->ValueString()); - break; - case webrtc::RTCStatsMemberInterface::kSequenceBool: { - builder.Add(name, member->ValueSequenceBool()); - break; - } - case webrtc::RTCStatsMemberInterface::kSequenceInt32: - builder.Add(name, member->ValueSequenceInt32()); - break; - case webrtc::RTCStatsMemberInterface::kSequenceUint32: - builder.Add(name, member->ValueSequenceUint32()); - break; - case webrtc::RTCStatsMemberInterface::kSequenceInt64: - builder.Add(name, member->ValueSequenceInt64()); - break; - case webrtc::RTCStatsMemberInterface::kSequenceUint64: - builder.Add(name, member->ValueSequenceUint64()); - break; - case webrtc::RTCStatsMemberInterface::kSequenceDouble: - builder.Add(name, member->ValueSequenceDouble()); - break; - case webrtc::RTCStatsMemberInterface::kSequenceString: - builder.Add(name, member->ValueSequenceString()); - break; - case webrtc::RTCStatsMemberInterface::kMapStringUint64: - builder.Add( - name, HashMapToValue(script_state, member->ValueMapStringUint64())); - break; - case webrtc::RTCStatsMemberInterface::kMapStringDouble: - builder.Add( - name, HashMapToValue(script_state, member->ValueMapStringDouble())); - break; - default: - NOTREACHED(); - } - } - - v8::Local<v8::Object> v8_object = builder.V8Value(); - CHECK(!v8_object.IsEmpty()); - return v8_object; -} - RTCCodecStats* ToV8Stat(ScriptState* script_state, const webrtc::RTCCodecStats& webrtc_stat) { RTCCodecStats* v8_codec = @@ -185,8 +104,7 @@ RTCInboundRtpStreamStats* ToV8Stat( ScriptState* script_state, const webrtc::RTCInboundRtpStreamStats& webrtc_stat, - bool expose_hardware_caps, - bool unship_deprecated_stats) { + bool expose_hardware_caps) { RTCInboundRtpStreamStats* v8_stat = MakeGarbageCollected<RTCInboundRtpStreamStats>( script_state->GetIsolate()); @@ -205,9 +123,6 @@ if (webrtc_stat.codec_id.is_defined()) { v8_stat->setCodecId(String::FromUTF8(*webrtc_stat.codec_id)); } - if (!unship_deprecated_stats && webrtc_stat.track_id.is_defined()) { - v8_stat->setTrackId(String::FromUTF8(*webrtc_stat.track_id)); - } // RTCReceivedRtpStreamStats if (webrtc_stat.packets_lost.is_defined()) { v8_stat->setPacketsLost(*webrtc_stat.packets_lost); @@ -395,8 +310,7 @@ RTCRemoteInboundRtpStreamStats* ToV8Stat( ScriptState* script_state, - const webrtc::RTCRemoteInboundRtpStreamStats& webrtc_stat, - bool unship_deprecated_stats) { + const webrtc::RTCRemoteInboundRtpStreamStats& webrtc_stat) { RTCRemoteInboundRtpStreamStats* v8_stat = MakeGarbageCollected<RTCRemoteInboundRtpStreamStats>( script_state->GetIsolate()); @@ -415,10 +329,6 @@ if (webrtc_stat.codec_id.is_defined()) { v8_stat->setCodecId(String::FromUTF8(*webrtc_stat.codec_id)); } - // RTCRtpStreamStats legacy stats - if (!unship_deprecated_stats && webrtc_stat.track_id.is_defined()) { - v8_stat->setTrackId(String::FromUTF8(*webrtc_stat.track_id)); - } // RTCReceivedRtpStreamStats if (webrtc_stat.packets_lost.is_defined()) { v8_stat->setPacketsLost(*webrtc_stat.packets_lost); @@ -449,8 +359,7 @@ RTCOutboundRtpStreamStats* ToV8Stat( ScriptState* script_state, const webrtc::RTCOutboundRtpStreamStats& webrtc_stat, - bool expose_hardware_caps, - bool unship_deprecated_stats) { + bool expose_hardware_caps) { RTCOutboundRtpStreamStats* v8_stat = MakeGarbageCollected<RTCOutboundRtpStreamStats>( script_state->GetIsolate()); @@ -469,10 +378,6 @@ if (webrtc_stat.codec_id.is_defined()) { v8_stat->setCodecId(String::FromUTF8(*webrtc_stat.codec_id)); } - // RTCRtpStreamStats legacy stats - if (!unship_deprecated_stats && webrtc_stat.track_id.is_defined()) { - v8_stat->setTrackId(String::FromUTF8(*webrtc_stat.track_id)); - } // RTCSentRtpStreamStats if (webrtc_stat.packets_sent.is_defined()) { v8_stat->setPacketsSent(*webrtc_stat.packets_sent); @@ -589,8 +494,7 @@ RTCRemoteOutboundRtpStreamStats* ToV8Stat( ScriptState* script_state, - const webrtc::RTCRemoteOutboundRtpStreamStats& webrtc_stat, - bool unship_deprecated_stats) { + const webrtc::RTCRemoteOutboundRtpStreamStats& webrtc_stat) { RTCRemoteOutboundRtpStreamStats* v8_stat = MakeGarbageCollected<RTCRemoteOutboundRtpStreamStats>( script_state->GetIsolate()); @@ -609,10 +513,6 @@ if (webrtc_stat.codec_id.is_defined()) { v8_stat->setCodecId(String::FromUTF8(*webrtc_stat.codec_id)); } - // RTCRtpStreamStats legacy stats - if (!unship_deprecated_stats && webrtc_stat.track_id.is_defined()) { - v8_stat->setTrackId(String::FromUTF8(*webrtc_stat.track_id)); - } // RTCSendRtpStreamStats if (webrtc_stat.packets_sent.is_defined()) { v8_stat->setPacketsSent(*webrtc_stat.packets_sent); @@ -1024,153 +924,26 @@ return v8_stat; } -// https://w3c.github.io/webrtc-stats/#obsolete-rtcmediastreamstats-members -// TODO(https://crbug.com/1374215): Delete when "track" and "stream" have been -// unshipped. -RTCMediaStreamStats* ToV8Stat( - ScriptState* script_state, - const webrtc::DEPRECATED_RTCMediaStreamStats& webrtc_stat) { - RTCMediaStreamStats* v8_stat = - MakeGarbageCollected<RTCMediaStreamStats>(script_state->GetIsolate()); - if (webrtc_stat.stream_identifier.is_defined()) { - v8_stat->setStreamIdentifier( - String::FromUTF8(*webrtc_stat.stream_identifier)); - } - if (webrtc_stat.track_ids.is_defined()) { - Vector<String> track_ids; - for (const std::string& track_id : *webrtc_stat.track_ids) { - track_ids.emplace_back(String::FromUTF8(track_id)); - } - v8_stat->setTrackIds(std::move(track_ids)); - } - return v8_stat; -} - -// https://w3c.github.io/webrtc-stats/#obsolete-rtcmediastreamtrackstats-members -// TODO(https://crbug.com/1374215): Delete when "track" and "stream" have been -// unshipped. -RTCMediaStreamTrackStats* ToV8Stat( - ScriptState* script_state, - const webrtc::DEPRECATED_RTCMediaStreamTrackStats& webrtc_stat) { - RTCMediaStreamTrackStats* v8_stat = - MakeGarbageCollected<RTCMediaStreamTrackStats>( - script_state->GetIsolate()); - if (webrtc_stat.track_identifier.is_defined()) { - v8_stat->setTrackIdentifier( - String::FromUTF8(*webrtc_stat.track_identifier)); - } - if (webrtc_stat.ended.is_defined()) { - v8_stat->setEnded(*webrtc_stat.ended); - } - if (webrtc_stat.kind.is_defined()) { - v8_stat->setKind(String::FromUTF8(*webrtc_stat.kind)); - } - if (webrtc_stat.remote_source.is_defined()) { - v8_stat->setRemoteSource(*webrtc_stat.remote_source); - } - if (webrtc_stat.jitter_buffer_delay.is_defined()) { - v8_stat->setJitterBufferDelay(*webrtc_stat.jitter_buffer_delay); - } - if (webrtc_stat.jitter_buffer_emitted_count.is_defined()) { - v8_stat->setJitterBufferEmittedCount( - *webrtc_stat.jitter_buffer_emitted_count); - } - // Audio-only, send and receive side. - if (webrtc_stat.audio_level.is_defined()) { - v8_stat->setAudioLevel(*webrtc_stat.audio_level); - } - if (webrtc_stat.total_audio_energy.is_defined()) { - v8_stat->setTotalAudioEnergy(*webrtc_stat.total_audio_energy); - } - if (webrtc_stat.total_samples_duration.is_defined()) { - v8_stat->setTotalSamplesDuration(*webrtc_stat.total_samples_duration); - } - // Audio-only, send side. - if (webrtc_stat.echo_return_loss.is_defined()) { - v8_stat->setEchoReturnLoss(*webrtc_stat.echo_return_loss); - } - if (webrtc_stat.echo_return_loss_enhancement.is_defined()) { - v8_stat->setEchoReturnLossEnhancement( - *webrtc_stat.echo_return_loss_enhancement); - } - // Audio-only, receive side. - if (webrtc_stat.total_samples_received.is_defined()) { - v8_stat->setTotalSamplesReceived(*webrtc_stat.total_samples_received); - } - if (webrtc_stat.concealed_samples.is_defined()) { - v8_stat->setConcealedSamples(*webrtc_stat.concealed_samples); - } - if (webrtc_stat.silent_concealed_samples.is_defined()) { - v8_stat->setSilentConcealedSamples(*webrtc_stat.silent_concealed_samples); - } - if (webrtc_stat.concealment_events.is_defined()) { - v8_stat->setConcealmentEvents(*webrtc_stat.concealment_events); - } - if (webrtc_stat.inserted_samples_for_deceleration.is_defined()) { - v8_stat->setInsertedSamplesForDeceleration( - *webrtc_stat.inserted_samples_for_deceleration); - } - if (webrtc_stat.removed_samples_for_acceleration.is_defined()) { - v8_stat->setRemovedSamplesForAcceleration( - *webrtc_stat.removed_samples_for_acceleration); - } - // Video-only, send and receive side. - if (webrtc_stat.frame_width.is_defined()) { - v8_stat->setFrameWidth(*webrtc_stat.frame_width); - } - if (webrtc_stat.frame_height.is_defined()) { - v8_stat->setFrameHeight(*webrtc_stat.frame_height); - } - // Video-only, send side. - if (webrtc_stat.frames_sent.is_defined()) { - v8_stat->setFramesSent(*webrtc_stat.frames_sent); - } - if (webrtc_stat.huge_frames_sent.is_defined()) { - v8_stat->setHugeFramesSent(*webrtc_stat.huge_frames_sent); - } - // Video-only, receive side. - if (webrtc_stat.frames_received.is_defined()) { - v8_stat->setFramesReceived(*webrtc_stat.frames_received); - } - if (webrtc_stat.frames_decoded.is_defined()) { - v8_stat->setFramesDecoded(*webrtc_stat.frames_decoded); - } - if (webrtc_stat.frames_dropped.is_defined()) { - v8_stat->setFramesDropped(*webrtc_stat.frames_dropped); - } - // Non-standard and obsolete stats. - if (webrtc_stat.media_source_id.is_defined()) { - v8_stat->setMediaSourceId(String::FromUTF8(*webrtc_stat.media_source_id)); - } - if (webrtc_stat.detached.is_defined()) { - v8_stat->setDetached(*webrtc_stat.detached); - } - return v8_stat; -} - RTCStats* RTCStatsToIDL(ScriptState* script_state, const webrtc::RTCStats& stat, - bool expose_hardware_caps, - bool unship_deprecated_stats) { + bool expose_hardware_caps) { RTCStats* v8_stats = nullptr; if (strcmp(stat.type(), "codec") == 0) { v8_stats = ToV8Stat(script_state, stat.cast_to<webrtc::RTCCodecStats>()); } else if (strcmp(stat.type(), "inbound-rtp") == 0) { v8_stats = ToV8Stat(script_state, stat.cast_to<webrtc::RTCInboundRtpStreamStats>(), - expose_hardware_caps, unship_deprecated_stats); + expose_hardware_caps); } else if (strcmp(stat.type(), "outbound-rtp") == 0) { v8_stats = ToV8Stat(script_state, stat.cast_to<webrtc::RTCOutboundRtpStreamStats>(), - expose_hardware_caps, unship_deprecated_stats); + expose_hardware_caps); } else if (strcmp(stat.type(), "remote-inbound-rtp") == 0) { v8_stats = ToV8Stat(script_state, - stat.cast_to<webrtc::RTCRemoteInboundRtpStreamStats>(), - unship_deprecated_stats); + stat.cast_to<webrtc::RTCRemoteInboundRtpStreamStats>()); } else if (strcmp(stat.type(), "remote-outbound-rtp") == 0) { - v8_stats = ToV8Stat(script_state, - stat.cast_to<webrtc::RTCRemoteOutboundRtpStreamStats>(), - unship_deprecated_stats); + v8_stats = ToV8Stat( + script_state, stat.cast_to<webrtc::RTCRemoteOutboundRtpStreamStats>()); } else if (strcmp(stat.type(), "media-source") == 0) { // Type media-source indicates a parent type. The actual stats are based on // the kind. @@ -1197,19 +970,6 @@ } else if (strcmp(stat.type(), "data-channel") == 0) { v8_stats = ToV8Stat(script_state, stat.cast_to<webrtc::RTCDataChannelStats>()); - } else if (strcmp(stat.type(), "stream") == 0) { - if (unship_deprecated_stats) { - return nullptr; - } - v8_stats = ToV8Stat(script_state, - stat.cast_to<webrtc::DEPRECATED_RTCMediaStreamStats>()); - } else if (strcmp(stat.type(), "track") == 0) { - if (unship_deprecated_stats) { - return nullptr; - } - v8_stats = - ToV8Stat(script_state, - stat.cast_to<webrtc::DEPRECATED_RTCMediaStreamTrackStats>()); } else if (strcmp(stat.type(), "transport") == 0) { v8_stats = ToV8Stat(script_state, stat.cast_to<webrtc::RTCTransportStats>()); @@ -1240,25 +1000,14 @@ : public PairSyncIterable<RTCStatsReport>::IterationSource { public: explicit RTCStatsReportIterationSource( - std::unique_ptr<RTCStatsReportPlatform> report, - bool use_web_idl) - : report_(std::move(report)), use_web_idl_(use_web_idl) {} + std::unique_ptr<RTCStatsReportPlatform> report) + : report_(std::move(report)) {} bool FetchNextItem(ScriptState* script_state, String& key, ScriptValue& value, ExceptionState& exception_state) override { - if (use_web_idl_) { - return FetchNextItemIdl(script_state, key, value, exception_state); - } - std::unique_ptr<RTCStatsWrapper> stats = report_->Next(); - if (!stats) { - return false; - } - key = stats->Id(); - value = ScriptValue(script_state->GetIsolate(), - RTCStatsToV8Object(script_state, stats.get())); - return true; + return FetchNextItemIdl(script_state, key, value, exception_state); } bool FetchNextItemIdl(ScriptState* script_state, @@ -1271,8 +1020,7 @@ RTCStats* v8_stat = nullptr; // Loop until a stat can be converted. while (rtc_stats) { - v8_stat = RTCStatsToIDL(script_state, *rtc_stats, expose_hardware_caps, - report_->unship_deprecated_stats()); + v8_stat = RTCStatsToIDL(script_state, *rtc_stats, expose_hardware_caps); if (v8_stat) { break; } @@ -1289,32 +1037,12 @@ private: std::unique_ptr<RTCStatsReportPlatform> report_; - const bool use_web_idl_; }; } // namespace -Vector<webrtc::NonStandardGroupId> GetExposedGroupIds( - const ScriptState* script_state) { - const ExecutionContext* context = ExecutionContext::From(script_state); - DCHECK(context->IsContextThread()); - Vector<webrtc::NonStandardGroupId> enabled_origin_trials; - if (RuntimeEnabledFeatures::RtcAudioJitterBufferMaxPacketsEnabled(context)) { - enabled_origin_trials.emplace_back( - webrtc::NonStandardGroupId::kRtcAudioJitterBufferMaxPackets); - } - if (RuntimeEnabledFeatures::RTCStatsRelativePacketArrivalDelayEnabled( - context)) { - enabled_origin_trials.emplace_back( - webrtc::NonStandardGroupId::kRtcStatsRelativePacketArrivalDelay); - } - return enabled_origin_trials; -} - RTCStatsReport::RTCStatsReport(std::unique_ptr<RTCStatsReportPlatform> report) - : report_(std::move(report)), - use_web_idl_( - base::FeatureList::IsEnabled(features::kWebRtcStatsReportIdl)) {} + : report_(std::move(report)) {} uint32_t RTCStatsReport::size() const { return base::saturated_cast<uint32_t>(report_->Size()); @@ -1323,7 +1051,7 @@ PairSyncIterable<RTCStatsReport>::IterationSource* RTCStatsReport::CreateIterationSource(ScriptState*, ExceptionState&) { return MakeGarbageCollected<RTCStatsReportIterationSource>( - report_->CopyHandle(), use_web_idl_); + report_->CopyHandle()); } bool RTCStatsReport::GetMapEntryIdl(ScriptState* script_state, @@ -1336,8 +1064,7 @@ } RTCStats* v8_stats = RTCStatsToIDL( - script_state, *stats, ExposeHardwareCapabilityStats(script_state), - report_->unship_deprecated_stats()); + script_state, *stats, ExposeHardwareCapabilityStats(script_state)); if (!v8_stats) { return false; } @@ -1350,16 +1077,7 @@ const String& key, ScriptValue& value, ExceptionState& exception_state) { - if (use_web_idl_) { - return GetMapEntryIdl(script_state, key, value, exception_state); - } - std::unique_ptr<RTCStatsWrapper> stats = report_->GetStats(key); - if (!stats) { - return false; - } - value = ScriptValue(script_state->GetIsolate(), - RTCStatsToV8Object(script_state, stats.get())); - return true; + return GetMapEntryIdl(script_state, key, value, exception_state); } } // namespace blink
diff --git a/third_party/blink/renderer/modules/peerconnection/rtc_stats_report.h b/third_party/blink/renderer/modules/peerconnection/rtc_stats_report.h index dbdcc3bb..8c555860 100644 --- a/third_party/blink/renderer/modules/peerconnection/rtc_stats_report.h +++ b/third_party/blink/renderer/modules/peerconnection/rtc_stats_report.h
@@ -16,11 +16,6 @@ namespace blink { -// Returns the group ids for non-standardized members which should be exposed -// based on what Origin Trials are running. -Vector<webrtc::NonStandardGroupId> GetExposedGroupIds( - const ScriptState* script_state); - // https://w3c.github.io/webrtc-pc/#rtcstatsreport-object class RTCStatsReport final : public ScriptWrappable, public Maplike<RTCStatsReport> { @@ -47,7 +42,6 @@ ExceptionState&); std::unique_ptr<RTCStatsReportPlatform> report_; - const bool use_web_idl_; }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/peerconnection/rtc_stats_report.idl b/third_party/blink/renderer/modules/peerconnection/rtc_stats_report.idl index e739d06..d55a0c7 100644 --- a/third_party/blink/renderer/modules/peerconnection/rtc_stats_report.idl +++ b/third_party/blink/renderer/modules/peerconnection/rtc_stats_report.idl
@@ -19,8 +19,6 @@ "media-playout", "peer-connection", "data-channel", - "stream", - "track", "transport", "candidate-pair", "local-candidate", @@ -58,7 +56,6 @@ DOMString transportId; DOMString codecId; // Non-standard and obsolete stats. - DOMString trackId; DOMString mediaType; }; @@ -361,63 +358,3 @@ "vpn", "unknown" }; - -// ----- Obsolete Stats ----- - -// https://w3c.github.io/webrtc-stats/#obsolete-rtcmediastreamstats-members -// TODO(https://crbug.com/1374215): Delete when "track" and "stream" have been unshipped. -dictionary RTCMediaStreamStats : RTCStats { - DOMString streamIdentifier; - sequence<DOMString> trackIds; -}; - -// https://w3c.github.io/webrtc-stats/#obsolete-rtcmediastreamtrackstats-members -// TODO(https://crbug.com/1374215): Delete when "track" and "stream" have been unshipped. -dictionary RTCMediaStreamTrackStats : RTCStats { - DOMString trackIdentifier; - boolean ended; - required DOMString kind; - // Not implemented: RTCPriorityType priority; - boolean remoteSource; - // Not implemented: DOMHighResTimeStamp estimatedPlayoutTimestamp; - double jitterBufferDelay; - unsigned long long jitterBufferEmittedCount; - - // Audio-only, send and receive side. - double audioLevel; - double totalAudioEnergy; - double totalSamplesDuration; - - // Audio-only, send side. - double echoReturnLoss; - double echoReturnLossEnhancement; - - // Audio-only, receive side. - unsigned long long totalSamplesReceived; - unsigned long long concealedSamples; - unsigned long long silentConcealedSamples; - unsigned long long concealmentEvents; - unsigned long long insertedSamplesForDeceleration; - unsigned long long removedSamplesForAcceleration; - - // Video-only, send and receive side. - unsigned long frameWidth; - unsigned long frameHeight; - // Not implemented: double framesPerSecond; - - // Video-only, send side. - // Not implemented: unsigned long keyFramesSent; - // Not implemented: unsigned long framesCaptured; - unsigned long framesSent; - unsigned long hugeFramesSent; - - // Video-only, receive side. - // Not implemented: unsigned long keyFramesReceived; - unsigned long framesReceived; - unsigned long framesDecoded; - unsigned long framesDropped; - - // Non-standard and obsolete stats. - DOMString mediaSourceId; - boolean detached; -};
diff --git a/third_party/blink/renderer/modules/presentation/presentation_source.idl b/third_party/blink/renderer/modules/presentation/presentation_source.idl index 9d144d1..4dfd825b 100644 --- a/third_party/blink/renderer/modules/presentation/presentation_source.idl +++ b/third_party/blink/renderer/modules/presentation/presentation_source.idl
@@ -34,7 +34,6 @@ "mirroring", }; -[RuntimeEnabled=SiteInitiatedMirroring] dictionary PresentationSource { required PresentationSourceType type;
diff --git a/third_party/blink/renderer/modules/private_attribution/private_attribution.idl b/third_party/blink/renderer/modules/private_attribution/private_attribution.idl index 73c34899..95a2de1 100644 --- a/third_party/blink/renderer/modules/private_attribution/private_attribution.idl +++ b/third_party/blink/renderer/modules/private_attribution/private_attribution.idl
@@ -26,7 +26,6 @@ DOMString publicKey; }; -[Serializable] dictionary PrivateAttributionNetwork { unsigned long id;
diff --git a/third_party/blink/renderer/modules/webaudio/audio_context.idl b/third_party/blink/renderer/modules/webaudio/audio_context.idl index b06be19..6ade0a9 100644 --- a/third_party/blink/renderer/modules/webaudio/audio_context.idl +++ b/third_party/blink/renderer/modules/webaudio/audio_context.idl
@@ -30,7 +30,7 @@ "playback" }; -[RuntimeEnabled=AudioContextSetSinkId] dictionary AudioSinkOptions { +dictionary AudioSinkOptions { required AudioSinkType type; };
diff --git a/third_party/blink/renderer/modules/webcodecs/audio_data_output_callback.idl b/third_party/blink/renderer/modules/webcodecs/audio_data_output_callback.idl index c21ab3d..3975013 100644 --- a/third_party/blink/renderer/modules/webcodecs/audio_data_output_callback.idl +++ b/third_party/blink/renderer/modules/webcodecs/audio_data_output_callback.idl
@@ -4,5 +4,4 @@ // https://github.com/WICG/web-codecs -[RuntimeEnabled=WebCodecs] callback AudioDataOutputCallback = void(AudioData output);
diff --git a/third_party/blink/renderer/modules/webcodecs/encoded_audio_chunk_output_callback.idl b/third_party/blink/renderer/modules/webcodecs/encoded_audio_chunk_output_callback.idl index 09aa6d57..9f69867d 100644 --- a/third_party/blink/renderer/modules/webcodecs/encoded_audio_chunk_output_callback.idl +++ b/third_party/blink/renderer/modules/webcodecs/encoded_audio_chunk_output_callback.idl
@@ -4,6 +4,5 @@ // https://github.com/WICG/web-codecs -[RuntimeEnabled=WebCodecs] callback EncodedAudioChunkOutputCallback = void(EncodedAudioChunk output, optional EncodedAudioChunkMetadata metadata = {});
diff --git a/third_party/blink/renderer/modules/webcodecs/video_frame_output_callback.idl b/third_party/blink/renderer/modules/webcodecs/video_frame_output_callback.idl index f757d5e1a..89739e7 100644 --- a/third_party/blink/renderer/modules/webcodecs/video_frame_output_callback.idl +++ b/third_party/blink/renderer/modules/webcodecs/video_frame_output_callback.idl
@@ -4,5 +4,4 @@ // https://github.com/WICG/web-codecs -[RuntimeEnabled=WebCodecs] callback VideoFrameOutputCallback = void(VideoFrame output);
diff --git a/third_party/blink/renderer/modules/webcodecs/webcodecs_error_callback.idl b/third_party/blink/renderer/modules/webcodecs/webcodecs_error_callback.idl index e0eaba9c..59f454e 100644 --- a/third_party/blink/renderer/modules/webcodecs/webcodecs_error_callback.idl +++ b/third_party/blink/renderer/modules/webcodecs/webcodecs_error_callback.idl
@@ -4,5 +4,4 @@ // https://github.com/WICG/web-codecs -[RuntimeEnabled=WebCodecs] callback WebCodecsErrorCallback = void(DOMException error);
diff --git a/third_party/blink/renderer/modules/webgpu/DEPS b/third_party/blink/renderer/modules/webgpu/DEPS index 4f959b1..e5c5d30b 100644 --- a/third_party/blink/renderer/modules/webgpu/DEPS +++ b/third_party/blink/renderer/modules/webgpu/DEPS
@@ -2,7 +2,7 @@ "+cc/layers/texture_layer.h", "+cc/layers/texture_layer_client.h", "+cc/resources/cross_thread_shared_bitmap.h", - "+components/viz/common/resources/resource_format_utils.h", + "+components/viz/common/resources/shared_image_format_utils.h", "+gpu/command_buffer/common/mailbox.h", "+gpu/command_buffer/common/shared_image_usage.h", "+gpu/command_buffer/common/sync_token.h",
diff --git a/third_party/blink/renderer/modules/webgpu/gpu_canvas_context.cc b/third_party/blink/renderer/modules/webgpu/gpu_canvas_context.cc index e44743f1..e6ee221 100644 --- a/third_party/blink/renderer/modules/webgpu/gpu_canvas_context.cc +++ b/third_party/blink/renderer/modules/webgpu/gpu_canvas_context.cc
@@ -4,7 +4,7 @@ #include "third_party/blink/renderer/modules/webgpu/gpu_canvas_context.h" -#include "components/viz/common/resources/resource_format_utils.h" +#include "components/viz/common/resources/shared_image_format_utils.h" #include "gpu/command_buffer/client/raster_interface.h" #include "third_party/blink/renderer/bindings/core/v8/v8_union_htmlcanvaselement_offscreencanvas.h" #include "third_party/blink/renderer/bindings/modules/v8/v8_gpu_canvas_alpha_mode.h"
diff --git a/third_party/blink/renderer/modules/xr/xr_hit_test_options_init.idl b/third_party/blink/renderer/modules/xr/xr_hit_test_options_init.idl index 2d2a94a..55eb83c 100644 --- a/third_party/blink/renderer/modules/xr/xr_hit_test_options_init.idl +++ b/third_party/blink/renderer/modules/xr/xr_hit_test_options_init.idl
@@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -[RuntimeEnabled=WebXRHitTestEntityTypes] enum XRHitTestTrackableType { "point", "plane"
diff --git a/third_party/blink/renderer/platform/BUILD.gn b/third_party/blink/renderer/platform/BUILD.gn index ed90c5a..d494f5c 100644 --- a/third_party/blink/renderer/platform/BUILD.gn +++ b/third_party/blink/renderer/platform/BUILD.gn
@@ -2172,7 +2172,6 @@ "peerconnection/rtc_encoded_audio_stream_transformer_test.cc", "peerconnection/rtc_encoded_video_stream_transformer_test.cc", "peerconnection/rtc_rtp_source_test.cc", - "peerconnection/rtc_stats_test.cc", "peerconnection/rtc_video_decoder_adapter_test.cc", "peerconnection/rtc_video_decoder_factory_test.cc", "peerconnection/rtc_video_decoder_stream_adapter_test.cc",
diff --git a/third_party/blink/renderer/platform/graphics/canvas_resource.cc b/third_party/blink/renderer/platform/graphics/canvas_resource.cc index 4e740d7..de431c4 100644 --- a/third_party/blink/renderer/platform/graphics/canvas_resource.cc +++ b/third_party/blink/renderer/platform/graphics/canvas_resource.cc
@@ -14,6 +14,7 @@ #include "components/viz/common/resources/bitmap_allocation.h" #include "components/viz/common/resources/resource_format_utils.h" #include "components/viz/common/resources/shared_image_format.h" +#include "components/viz/common/resources/shared_image_format_utils.h" #include "components/viz/common/resources/transferable_resource.h" #include "gpu/GLES2/gl2extchromium.h" #include "gpu/command_buffer/client/gpu_memory_buffer_manager.h"
diff --git a/third_party/blink/renderer/platform/graphics/canvas_resource_provider.cc b/third_party/blink/renderer/platform/graphics/canvas_resource_provider.cc index 298e8411..732f766 100644 --- a/third_party/blink/renderer/platform/graphics/canvas_resource_provider.cc +++ b/third_party/blink/renderer/platform/graphics/canvas_resource_provider.cc
@@ -18,6 +18,7 @@ #include "cc/paint/display_item_list.h" #include "cc/tiles/software_image_decode_cache.h" #include "components/viz/common/resources/resource_format_utils.h" +#include "components/viz/common/resources/shared_image_format_utils.h" #include "gpu/GLES2/gl2extchromium.h" #include "gpu/command_buffer/client/raster_interface.h" #include "gpu/command_buffer/common/capabilities.h"
diff --git a/third_party/blink/renderer/platform/graphics/gpu/drawing_buffer.cc b/third_party/blink/renderer/platform/graphics/gpu/drawing_buffer.cc index d2560cd7..ed3b49b 100644 --- a/third_party/blink/renderer/platform/graphics/gpu/drawing_buffer.cc +++ b/third_party/blink/renderer/platform/graphics/gpu/drawing_buffer.cc
@@ -45,6 +45,7 @@ #include "components/viz/common/resources/resource_sizes.h" #include "components/viz/common/resources/shared_bitmap.h" #include "components/viz/common/resources/shared_image_format.h" +#include "components/viz/common/resources/shared_image_format_utils.h" #include "components/viz/common/resources/transferable_resource.h" #include "gpu/command_buffer/client/context_support.h" #include "gpu/command_buffer/client/gpu_memory_buffer_manager.h"
diff --git a/third_party/blink/renderer/platform/graphics/gpu/image_layer_bridge.cc b/third_party/blink/renderer/platform/graphics/gpu/image_layer_bridge.cc index 1985e3da..88442f8 100644 --- a/third_party/blink/renderer/platform/graphics/gpu/image_layer_bridge.cc +++ b/third_party/blink/renderer/platform/graphics/gpu/image_layer_bridge.cc
@@ -10,6 +10,7 @@ #include "components/viz/common/resources/bitmap_allocation.h" #include "components/viz/common/resources/resource_format_utils.h" #include "components/viz/common/resources/shared_bitmap.h" +#include "components/viz/common/resources/shared_image_format_utils.h" #include "components/viz/common/resources/transferable_resource.h" #include "gpu/command_buffer/client/gles2_interface.h" #include "gpu/command_buffer/client/shared_image_interface.h"
diff --git a/third_party/blink/renderer/platform/graphics/static_bitmap_image_to_video_frame_copier.cc b/third_party/blink/renderer/platform/graphics/static_bitmap_image_to_video_frame_copier.cc index 048732b..0d0e9e2 100644 --- a/third_party/blink/renderer/platform/graphics/static_bitmap_image_to_video_frame_copier.cc +++ b/third_party/blink/renderer/platform/graphics/static_bitmap_image_to_video_frame_copier.cc
@@ -7,7 +7,7 @@ #include "base/functional/callback_helpers.h" #include "base/trace_event/trace_event.h" #include "build/build_config.h" -#include "components/viz/common/resources/resource_format_utils.h" +#include "components/viz/common/resources/shared_image_format_utils.h" #include "gpu/command_buffer/client/raster_interface.h" #include "media/base/video_frame.h" #include "media/base/video_util.h"
diff --git a/third_party/blink/renderer/platform/peerconnection/rtc_rtp_receiver_platform.h b/third_party/blink/renderer/platform/peerconnection/rtc_rtp_receiver_platform.h index 29a45f9..58674bb6 100644 --- a/third_party/blink/renderer/platform/peerconnection/rtc_rtp_receiver_platform.h +++ b/third_party/blink/renderer/platform/peerconnection/rtc_rtp_receiver_platform.h
@@ -45,9 +45,7 @@ // If called from any other thread than the WebRTC worker thread, this causes // a block-invoke by the PROXY. virtual Vector<std::unique_ptr<RTCRtpSource>> GetSources() = 0; - virtual void GetStats(RTCStatsReportCallback, - const Vector<webrtc::NonStandardGroupId>&, - bool is_track_stats_deprecation_trial_enabled) = 0; + virtual void GetStats(RTCStatsReportCallback) = 0; virtual std::unique_ptr<webrtc::RtpParameters> GetParameters() const = 0; virtual void SetJitterBufferMinimumDelay( absl::optional<double> delay_seconds) = 0;
diff --git a/third_party/blink/renderer/platform/peerconnection/rtc_rtp_sender_platform.h b/third_party/blink/renderer/platform/peerconnection/rtc_rtp_sender_platform.h index 6d70ff3..ecf96ff 100644 --- a/third_party/blink/renderer/platform/peerconnection/rtc_rtp_sender_platform.h +++ b/third_party/blink/renderer/platform/peerconnection/rtc_rtp_sender_platform.h
@@ -53,9 +53,7 @@ virtual void SetParameters(Vector<webrtc::RtpEncodingParameters>, absl::optional<webrtc::DegradationPreference>, RTCVoidRequest*) = 0; - virtual void GetStats(RTCStatsReportCallback, - const Vector<webrtc::NonStandardGroupId>&, - bool is_track_stats_deprecation_trial_enabled) = 0; + virtual void GetStats(RTCStatsReportCallback) = 0; virtual void SetStreams(const Vector<String>& stream_ids) = 0; virtual RTCEncodedAudioStreamTransformer* GetEncodedAudioStreamTransformer() const {
diff --git a/third_party/blink/renderer/platform/peerconnection/rtc_stats.cc b/third_party/blink/renderer/platform/peerconnection/rtc_stats.cc index 7814d02..db87eb44 100644 --- a/third_party/blink/renderer/platform/peerconnection/rtc_stats.cc +++ b/third_party/blink/renderer/platform/peerconnection/rtc_stats.cc
@@ -26,92 +26,22 @@ namespace blink { -// TODO(https://crbug.com/webrtc/14175): When "track" stats no longer exist in -// the lower layer, delete all the filtering mechanisms gated by this flag since -// that filtering will become a NO-OP when "track" no longer exists. -BASE_FEATURE(WebRtcUnshipDeprecatedStats, - "WebRtcUnshipDeprecatedStats", - base::FEATURE_ENABLED_BY_DEFAULT); - namespace { -bool MemberIsReferenceToDeprecated( - const webrtc::RTCStatsMemberInterface* member) { - // ID references are strings with a defined value. - if (member->type() != webrtc::RTCStatsMemberInterface::Type::kString || - !member->is_defined()) { - return false; - } - const char* member_name = member->name(); - size_t len = strlen(member_name); - // ID referenced end with "Id" by naming convention. - if (len < 2 || member_name[len - 2] != 'I' || member_name[len - 1] != 'd') - return false; - const std::string& id_reference = - *member->cast_to<webrtc::RTCStatsMember<std::string>>(); - // starts_with() - return id_reference.rfind("DEPRECATED_", 0) == 0; -} - -// Members are surfaced if one of the following is true: -// - They're standardized and if `unship_deprecated_stats` is true they aren't -// references to a deprecated object. -// - There is an active origin trial exposing that particular member. -// - There is an active feature exposing non-standard stats. -std::vector<const webrtc::RTCStatsMemberInterface*> FilterMembers( - std::vector<const webrtc::RTCStatsMemberInterface*> stats_members, - const Vector<webrtc::NonStandardGroupId>& exposed_group_ids, - bool unship_deprecated_stats) { - if (base::FeatureList::IsEnabled( - blink::features::kWebRtcExposeNonStandardStats)) { - return stats_members; - } - base::EraseIf( - stats_members, [&exposed_group_ids, &unship_deprecated_stats]( - const webrtc::RTCStatsMemberInterface* member) { - if (member->is_standardized()) { - // Standard members are only erased when filtering out "DEPRECATED_" - // ID references. - return unship_deprecated_stats && - MemberIsReferenceToDeprecated(member); - } - // Non-standard members are erased unless part of the exposed groups. - const std::vector<webrtc::NonStandardGroupId>& ids = - member->group_ids(); - for (const webrtc::NonStandardGroupId& id : exposed_group_ids) { - if (base::Contains(ids, id)) { - return false; - } - } - return true; - }); - return stats_members; -} - -template <typename T> -Vector<T> ToWTFVector(const std::vector<T>& vector) { - Vector<T> wtf_vector(base::checked_cast<WTF::wtf_size_t>(vector.size())); - std::move(vector.begin(), vector.end(), wtf_vector.begin()); - return wtf_vector; -} - -bool ShouldExposeStatsObject(const webrtc::RTCStats& stats, - bool unship_deprecated_stats) { - if (!unship_deprecated_stats) - return true; +// TODO(https://crbug.com/webrtc/14175): When "track" stats no longer exist in +// the lower layer, checking for "DEPRECATED_" is no longer needed. +bool ShouldExposeStatsObject(const webrtc::RTCStats& stats) { // !starts_with() return stats.id().rfind("DEPRECATED_", 0) != 0; } size_t CountExposedStatsObjects( - const scoped_refptr<const webrtc::RTCStatsReport>& stats_report, - bool unship_deprecated_stats) { - if (!unship_deprecated_stats) - return stats_report->size(); + const scoped_refptr<const webrtc::RTCStatsReport>& stats_report) { size_t count = 0u; for (const auto& stats : *stats_report) { - if (ShouldExposeStatsObject(stats, unship_deprecated_stats)) + if (ShouldExposeStatsObject(stats)) { ++count; + } } return count; } @@ -119,19 +49,11 @@ } // namespace RTCStatsReportPlatform::RTCStatsReportPlatform( - const scoped_refptr<const webrtc::RTCStatsReport>& stats_report, - const Vector<webrtc::NonStandardGroupId>& exposed_group_ids, - bool is_track_stats_deprecation_trial_enabled) - : is_track_stats_deprecation_trial_enabled_( - is_track_stats_deprecation_trial_enabled), - unship_deprecated_stats_( - base::FeatureList::IsEnabled(WebRtcUnshipDeprecatedStats) && - !is_track_stats_deprecation_trial_enabled_), - stats_report_(stats_report), + const scoped_refptr<const webrtc::RTCStatsReport>& stats_report) + : stats_report_(stats_report), it_(stats_report_->begin()), end_(stats_report_->end()), - exposed_group_ids_(exposed_group_ids), - size_(CountExposedStatsObjects(stats_report, unship_deprecated_stats_)) { + size_(CountExposedStatsObjects(stats_report)) { DCHECK(stats_report_); } @@ -139,30 +61,7 @@ std::unique_ptr<RTCStatsReportPlatform> RTCStatsReportPlatform::CopyHandle() const { - return std::make_unique<RTCStatsReportPlatform>( - stats_report_, exposed_group_ids_, - is_track_stats_deprecation_trial_enabled_); -} - -std::unique_ptr<RTCStatsWrapper> RTCStatsReportPlatform::GetStats( - const String& id) const { - const webrtc::RTCStats* stats = stats_report_->Get(id.Utf8()); - if (!stats || !ShouldExposeStatsObject(*stats, unship_deprecated_stats_)) - return std::unique_ptr<RTCStatsWrapper>(); - return std::make_unique<RTCStatsWrapper>( - stats_report_, stats, exposed_group_ids_, unship_deprecated_stats_); -} - -std::unique_ptr<RTCStatsWrapper> RTCStatsReportPlatform::Next() { - while (it_ != end_) { - const webrtc::RTCStats& next = *it_; - ++it_; - if (ShouldExposeStatsObject(next, unship_deprecated_stats_)) { - return std::make_unique<RTCStatsWrapper>( - stats_report_, &next, exposed_group_ids_, unship_deprecated_stats_); - } - } - return std::unique_ptr<RTCStatsWrapper>(); + return std::make_unique<RTCStatsReportPlatform>(stats_report_); } const webrtc::RTCStats* RTCStatsReportPlatform::NextStats() { @@ -178,215 +77,19 @@ return size_; } -RTCStatsWrapper::RTCStatsWrapper( - const scoped_refptr<const webrtc::RTCStatsReport>& stats_owner, - const webrtc::RTCStats* stats, - const Vector<webrtc::NonStandardGroupId>& exposed_group_ids, - bool unship_deprecated_stats) - : stats_owner_(stats_owner), - stats_(stats), - stats_members_(FilterMembers(stats->Members(), - exposed_group_ids, - unship_deprecated_stats)) { - DCHECK(stats_owner_); - DCHECK(stats_); - DCHECK(stats_owner_->Get(stats_->id())); -} - -RTCStatsWrapper::~RTCStatsWrapper() = default; - -String RTCStatsWrapper::Id() const { - return String::FromUTF8(stats_->id()); -} - -String RTCStatsWrapper::GetType() const { - return String::FromUTF8(stats_->type()); -} - -double RTCStatsWrapper::TimestampMs() const { - // The timestamp unit is milliseconds but we want decimal - // precision so we convert ourselves. - return stats_->timestamp().us() / - static_cast<double>(base::Time::kMicrosecondsPerMillisecond); -} - -size_t RTCStatsWrapper::MembersCount() const { - return stats_members_.size(); -} - -std::unique_ptr<RTCStatsMember> RTCStatsWrapper::GetMember(size_t i) const { - DCHECK_LT(i, stats_members_.size()); - return std::make_unique<RTCStatsMember>(stats_owner_, stats_members_[i]); -} - -RTCStatsMember::RTCStatsMember( - const scoped_refptr<const webrtc::RTCStatsReport>& stats_owner, - const webrtc::RTCStatsMemberInterface* member) - : stats_owner_(stats_owner), member_(member) { - DCHECK(stats_owner_); - DCHECK(member_); -} - -RTCStatsMember::~RTCStatsMember() = default; - -String RTCStatsMember::GetName() const { - return String::FromUTF8(member_->name()); -} - -webrtc::RTCStatsMemberInterface::Type RTCStatsMember::GetType() const { - return member_->type(); -} - -bool RTCStatsMember::IsDefined() const { - return member_->is_defined(); -} - -bool RTCStatsMember::ValueBool() const { - DCHECK(IsDefined()); - return *member_->cast_to<webrtc::RTCStatsMember<bool>>(); -} - -int32_t RTCStatsMember::ValueInt32() const { - DCHECK(IsDefined()); - return *member_->cast_to<webrtc::RTCStatsMember<int32_t>>(); -} - -uint32_t RTCStatsMember::ValueUint32() const { - DCHECK(IsDefined()); - return *member_->cast_to<webrtc::RTCStatsMember<uint32_t>>(); -} - -int64_t RTCStatsMember::ValueInt64() const { - DCHECK(IsDefined()); - return *member_->cast_to<webrtc::RTCStatsMember<int64_t>>(); -} - -uint64_t RTCStatsMember::ValueUint64() const { - DCHECK(IsDefined()); - return *member_->cast_to<webrtc::RTCStatsMember<uint64_t>>(); -} - -double RTCStatsMember::ValueDouble() const { - DCHECK(IsDefined()); - return *member_->cast_to<webrtc::RTCStatsMember<double>>(); -} - -String RTCStatsMember::ValueString() const { - DCHECK(IsDefined()); - return String::FromUTF8( - *member_->cast_to<webrtc::RTCStatsMember<std::string>>()); -} - -Vector<bool> RTCStatsMember::ValueSequenceBool() const { - DCHECK(IsDefined()); - const std::vector<bool> vector = - *member_->cast_to<webrtc::RTCStatsMember<std::vector<bool>>>(); - return ToWTFVector(vector); -} - -Vector<int32_t> RTCStatsMember::ValueSequenceInt32() const { - DCHECK(IsDefined()); - const std::vector<int32_t> vector = - *member_->cast_to<webrtc::RTCStatsMember<std::vector<int32_t>>>(); - return ToWTFVector(vector); -} - -Vector<uint32_t> RTCStatsMember::ValueSequenceUint32() const { - DCHECK(IsDefined()); - const std::vector<uint32_t> vector = - *member_->cast_to<webrtc::RTCStatsMember<std::vector<uint32_t>>>(); - return ToWTFVector(vector); -} - -Vector<int64_t> RTCStatsMember::ValueSequenceInt64() const { - DCHECK(IsDefined()); - const std::vector<int64_t> vector = - *member_->cast_to<webrtc::RTCStatsMember<std::vector<int64_t>>>(); - return ToWTFVector(vector); -} - -Vector<uint64_t> RTCStatsMember::ValueSequenceUint64() const { - DCHECK(IsDefined()); - const std::vector<uint64_t> vector = - *member_->cast_to<webrtc::RTCStatsMember<std::vector<uint64_t>>>(); - return ToWTFVector(vector); -} - -Vector<double> RTCStatsMember::ValueSequenceDouble() const { - DCHECK(IsDefined()); - const std::vector<double> vector = - *member_->cast_to<webrtc::RTCStatsMember<std::vector<double>>>(); - return ToWTFVector(vector); -} - -Vector<String> RTCStatsMember::ValueSequenceString() const { - DCHECK(IsDefined()); - const std::vector<std::string>& sequence = - *member_->cast_to<webrtc::RTCStatsMember<std::vector<std::string>>>(); - Vector<String> wtf_sequence(base::checked_cast<wtf_size_t>(sequence.size())); - for (wtf_size_t i = 0; i < wtf_sequence.size(); ++i) - wtf_sequence[i] = String::FromUTF8(sequence[i]); - return wtf_sequence; -} - -HashMap<String, uint64_t> RTCStatsMember::ValueMapStringUint64() const { - DCHECK(IsDefined()); - const std::map<std::string, uint64_t>& map = - *member_ - ->cast_to<webrtc::RTCStatsMember<std::map<std::string, uint64_t>>>(); - HashMap<String, uint64_t> wtf_map; - wtf_map.ReserveCapacityForSize(base::checked_cast<unsigned>(map.size())); - for (auto& elem : map) { - wtf_map.insert(String::FromUTF8(elem.first), elem.second); - } - return wtf_map; -} - -HashMap<String, double> RTCStatsMember::ValueMapStringDouble() const { - DCHECK(IsDefined()); - const std::map<std::string, double>& map = - *member_ - ->cast_to<webrtc::RTCStatsMember<std::map<std::string, double>>>(); - HashMap<String, double> wtf_map; - wtf_map.ReserveCapacityForSize(base::checked_cast<unsigned>(map.size())); - for (auto& elem : map) { - wtf_map.insert(String::FromUTF8(elem.first), elem.second); - } - return wtf_map; -} - -RTCStatsMember::ExposureRestriction RTCStatsMember::Restriction() const { - switch (member_->exposure_criteria()) { - case webrtc::StatExposureCriteria::kHardwareCapability: - return ExposureRestriction::kHardwareCapability; - case webrtc::StatExposureCriteria::kAlways: - default: - return ExposureRestriction::kNone; - } -} - rtc::scoped_refptr<webrtc::RTCStatsCollectorCallback> CreateRTCStatsCollectorCallback( scoped_refptr<base::SingleThreadTaskRunner> main_thread, - RTCStatsReportCallback callback, - const Vector<webrtc::NonStandardGroupId>& exposed_group_ids, - bool is_track_stats_deprecation_trial_enabled) { + RTCStatsReportCallback callback) { return rtc::scoped_refptr<RTCStatsCollectorCallbackImpl>( new rtc::RefCountedObject<RTCStatsCollectorCallbackImpl>( - std::move(main_thread), std::move(callback), exposed_group_ids, - is_track_stats_deprecation_trial_enabled)); + std::move(main_thread), std::move(callback))); } RTCStatsCollectorCallbackImpl::RTCStatsCollectorCallbackImpl( scoped_refptr<base::SingleThreadTaskRunner> main_thread, - RTCStatsReportCallback callback, - const Vector<webrtc::NonStandardGroupId>& exposed_group_ids, - bool is_track_stats_deprecation_trial_enabled) - : main_thread_(std::move(main_thread)), - callback_(std::move(callback)), - exposed_group_ids_(exposed_group_ids), - is_track_stats_deprecation_trial_enabled_( - is_track_stats_deprecation_trial_enabled) {} + RTCStatsReportCallback callback) + : main_thread_(std::move(main_thread)), callback_(std::move(callback)) {} RTCStatsCollectorCallbackImpl::~RTCStatsCollectorCallbackImpl() { DCHECK(!callback_); @@ -408,8 +111,7 @@ DCHECK(callback_); // Make sure the callback is destroyed in the main thread as well. std::move(callback_).Run(std::make_unique<RTCStatsReportPlatform>( - base::WrapRefCounted(report.get()), exposed_group_ids_, - is_track_stats_deprecation_trial_enabled_)); + base::WrapRefCounted(report.get()))); } } // namespace blink
diff --git a/third_party/blink/renderer/platform/peerconnection/rtc_stats.h b/third_party/blink/renderer/platform/peerconnection/rtc_stats.h index 76a5a45..f68089af 100644 --- a/third_party/blink/renderer/platform/peerconnection/rtc_stats.h +++ b/third_party/blink/renderer/platform/peerconnection/rtc_stats.h
@@ -29,24 +29,15 @@ namespace blink { -class RTCStatsWrapper; -class RTCStatsMember; - PLATFORM_EXPORT BASE_DECLARE_FEATURE(WebRtcUnshipDeprecatedStats); -// Wrapper around a webrtc::RTCStatsReport. Filters out any stats objects that -// aren't listed in the allow list. |filter| controls whether to include only -// standard members (RTCStatsMemberInterface::is_standardized return true) or -// not (RTCStatsMemberInterface::is_standardized return false). -// -// Note: This class is named |RTCStatsReportPlatform| not to collide with class -// |RTCStatsReport|, from renderer/modules/peerconnection/rtc_stats_report.cc|h. +// A thin wrapper around a webrtc::RTCStatsReport. +// TODO(https://crbug.com/1443999): Delete this class, it does not provide any +// value anymore and blink is allowed to use webrtc classes directly. class PLATFORM_EXPORT RTCStatsReportPlatform { public: RTCStatsReportPlatform( - const scoped_refptr<const webrtc::RTCStatsReport>& stats_report, - const Vector<webrtc::NonStandardGroupId>& exposed_group_ids, - bool is_track_stats_deprecation_trial_enabled); + const scoped_refptr<const webrtc::RTCStatsReport>& stats_report); virtual ~RTCStatsReportPlatform(); // Creates a new report object that is a handle to the same underlying stats @@ -54,93 +45,20 @@ // useful when needing multiple iterators. std::unique_ptr<RTCStatsReportPlatform> CopyHandle() const; - // Gets stats object by |id|, or null if no stats with that |id| exists. - std::unique_ptr<RTCStatsWrapper> GetStats(const String& id) const; - - // The next stats object, or null if the end has been reached. - std::unique_ptr<RTCStatsWrapper> Next(); - const webrtc::RTCStatsReport& stats_report() const { return *stats_report_; } - bool unship_deprecated_stats() const { return unship_deprecated_stats_; } const webrtc::RTCStats* NextStats(); // The number of stats objects. size_t Size() const; private: - const bool is_track_stats_deprecation_trial_enabled_; - const bool unship_deprecated_stats_; const scoped_refptr<const webrtc::RTCStatsReport> stats_report_; webrtc::RTCStatsReport::ConstIterator it_; const webrtc::RTCStatsReport::ConstIterator end_; - Vector<webrtc::NonStandardGroupId> exposed_group_ids_; // Number of allowlisted webrtc::RTCStats in |stats_report_|. const size_t size_; }; -class PLATFORM_EXPORT RTCStatsWrapper { - public: - RTCStatsWrapper( - const scoped_refptr<const webrtc::RTCStatsReport>& stats_owner, - const webrtc::RTCStats* stats, - const Vector<webrtc::NonStandardGroupId>& exposed_group_ids, - bool unship_deprecated_stats); - virtual ~RTCStatsWrapper(); - - String Id() const; - String GetType() const; - double TimestampMs() const; - - size_t MembersCount() const; - std::unique_ptr<RTCStatsMember> GetMember(size_t i) const; - - private: - // Reference to keep the report that owns |stats_| alive. - const scoped_refptr<const webrtc::RTCStatsReport> stats_owner_; - // Pointer to a stats object that is owned by |stats_owner_|. - const webrtc::RTCStats* const stats_; - // Members of the |stats_| object, equivalent to |stats_->Members()|. - const std::vector<const webrtc::RTCStatsMemberInterface*> stats_members_ - ALLOW_DISCOURAGED_TYPE("Matches webrtc::RTCStats::Members()"); -}; - -class PLATFORM_EXPORT RTCStatsMember { - public: - RTCStatsMember(const scoped_refptr<const webrtc::RTCStatsReport>& stats_owner, - const webrtc::RTCStatsMemberInterface* member); - virtual ~RTCStatsMember(); - - String GetName() const; - webrtc::RTCStatsMemberInterface::Type GetType() const; - bool IsDefined() const; - - bool ValueBool() const; - int32_t ValueInt32() const; - uint32_t ValueUint32() const; - int64_t ValueInt64() const; - uint64_t ValueUint64() const; - double ValueDouble() const; - String ValueString() const; - Vector<bool> ValueSequenceBool() const; - Vector<int32_t> ValueSequenceInt32() const; - Vector<uint32_t> ValueSequenceUint32() const; - Vector<int64_t> ValueSequenceInt64() const; - Vector<uint64_t> ValueSequenceUint64() const; - Vector<double> ValueSequenceDouble() const; - Vector<String> ValueSequenceString() const; - HashMap<String, uint64_t> ValueMapStringUint64() const; - HashMap<String, double> ValueMapStringDouble() const; - - enum class ExposureRestriction { kNone, kHardwareCapability }; - ExposureRestriction Restriction() const; - - private: - // Reference to keep the report that owns |member_|'s stats object alive. - const scoped_refptr<const webrtc::RTCStatsReport> stats_owner_; - // Pointer to member of a stats object that is owned by |stats_owner_|. - const webrtc::RTCStatsMemberInterface* const member_; -}; - using RTCStatsReportCallback = base::OnceCallback<void(std::unique_ptr<RTCStatsReportPlatform>)>; @@ -148,9 +66,7 @@ rtc::scoped_refptr<webrtc::RTCStatsCollectorCallback> CreateRTCStatsCollectorCallback( scoped_refptr<base::SingleThreadTaskRunner> main_thread, - RTCStatsReportCallback callback, - const Vector<webrtc::NonStandardGroupId>& exposed_group_ids, - bool is_track_stats_deprecation_trial_enabled); + RTCStatsReportCallback callback); // A stats collector callback. // It is invoked on the WebRTC signaling thread and will post a task to invoke @@ -165,9 +81,7 @@ protected: RTCStatsCollectorCallbackImpl( scoped_refptr<base::SingleThreadTaskRunner> main_thread, - RTCStatsReportCallback callback, - const Vector<webrtc::NonStandardGroupId>& exposed_group_ids, - bool is_track_stats_deprecation_trial_enabled); + RTCStatsReportCallback callback); ~RTCStatsCollectorCallbackImpl() override; void OnStatsDeliveredOnMainThread( @@ -175,8 +89,6 @@ const scoped_refptr<base::SingleThreadTaskRunner> main_thread_; RTCStatsReportCallback callback_; - Vector<webrtc::NonStandardGroupId> exposed_group_ids_; - bool is_track_stats_deprecation_trial_enabled_; }; } // namespace blink
diff --git a/third_party/blink/renderer/platform/peerconnection/rtc_stats_test.cc b/third_party/blink/renderer/platform/peerconnection/rtc_stats_test.cc deleted file mode 100644 index 7c8f4854..0000000 --- a/third_party/blink/renderer/platform/peerconnection/rtc_stats_test.cc +++ /dev/null
@@ -1,293 +0,0 @@ -// Copyright 2016 The Chromium Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include <memory> - -#include "third_party/blink/renderer/platform/peerconnection/rtc_stats.h" - -#include "base/test/scoped_feature_list.h" -#include "testing/gtest/include/gtest/gtest.h" -#include "third_party/blink/public/common/features.h" -#include "third_party/blink/renderer/platform/peerconnection/rtc_stats.h" -#include "third_party/webrtc/api/stats/rtc_stats.h" -#include "third_party/webrtc/api/stats/rtc_stats_report.h" -#include "third_party/webrtc/stats/test/rtc_test_stats.h" - -namespace blink { - -namespace { - -// Stats object with both a standard and non-standard member, used for the test -// below. -class TestStats : public webrtc::RTCStats { - public: - WEBRTC_RTCSTATS_DECL(); - - TestStats(const std::string& id, webrtc::Timestamp timestamp); - ~TestStats() override = default; - - webrtc::RTCStatsMember<int32_t> standardized; - webrtc::RTCNonStandardStatsMember<int32_t> non_standardized; - webrtc::RTCStatsMember<std::string> foo_id; - webrtc::RTCRestrictedStatsMember< - bool, - webrtc::StatExposureCriteria::kHardwareCapability> - hw_stat; -}; - -WEBRTC_RTCSTATS_IMPL(TestStats, - webrtc::RTCStats, - "teststats", - &standardized, - &non_standardized, - &foo_id, - &hw_stat) - -TestStats::TestStats(const std::string& id, webrtc::Timestamp timestamp) - : RTCStats(id, timestamp), - standardized("standardized"), - non_standardized("non_standardized", - {webrtc::NonStandardGroupId::kGroupIdForTesting}), - foo_id("fooId"), - hw_stat("hwStat") {} - -bool MemberIsDefined(const RTCStatsWrapper& stats, const char* name) { - for (size_t i = 0; i < stats.MembersCount(); ++i) { - std::unique_ptr<RTCStatsMember> member = stats.GetMember(i); - if (member->GetName() == name && member->IsDefined()) { - return true; - } - } - return false; -} - -} // namespace - -TEST(RTCStatsTest, ReportSizeAndGetter) { - const char* kFirstId = "FirstId"; - const char* kSecondId = "SecondId"; - - rtc::scoped_refptr<webrtc::RTCStatsReport> webrtc_report = - webrtc::RTCStatsReport::Create(webrtc::Timestamp::Micros(42)); - webrtc_report->AddStats(std::make_unique<webrtc::RTCTestStats>( - kFirstId, webrtc::Timestamp::Micros(42))); - webrtc_report->AddStats(std::make_unique<webrtc::RTCTestStats>( - kSecondId, webrtc::Timestamp::Micros(42))); - - RTCStatsReportPlatform report(webrtc_report.get(), {}, false); - EXPECT_EQ(report.Size(), 2u); - EXPECT_TRUE(report.GetStats(kFirstId)); - EXPECT_TRUE(report.GetStats(kSecondId)); -} - -TEST(RTCStatsTest, Iterator) { - const char* kFirstId = "FirstId"; - const char* kSecondId = "SecondId"; - - rtc::scoped_refptr<webrtc::RTCStatsReport> webrtc_report = - webrtc::RTCStatsReport::Create(webrtc::Timestamp::Micros(42)); - webrtc_report->AddStats(std::make_unique<webrtc::RTCTestStats>( - kFirstId, webrtc::Timestamp::Micros(42))); - webrtc_report->AddStats(std::make_unique<webrtc::RTCTestStats>( - kSecondId, webrtc::Timestamp::Micros(42))); - - RTCStatsReportPlatform report(webrtc_report.get(), {}, false); - EXPECT_EQ(report.Size(), 2u); - - std::unique_ptr<RTCStatsWrapper> stats = report.Next(); - EXPECT_TRUE(stats); - EXPECT_EQ(stats->Id(), kFirstId); - stats = report.Next(); - EXPECT_TRUE(stats); - EXPECT_EQ(stats->Id(), kSecondId); - EXPECT_FALSE(report.Next()); -} - -// Similar to how only allowlisted stats objects should be surfaced, only -// standardized members of the allowlisted objects should be surfaced. -TEST(RTCStatsTest, OnlyIncludeStandarizedMembers) { - rtc::scoped_refptr<webrtc::RTCStatsReport> webrtc_report = - webrtc::RTCStatsReport::Create(webrtc::Timestamp::Micros(42)); - webrtc_report->AddStats( - std::make_unique<TestStats>("id", webrtc::Timestamp::Micros(0))); - - // TestStats has three members, but the non-standard member should be filtered - // out. - RTCStatsReportPlatform report(webrtc_report.get(), {}, false); - std::unique_ptr<RTCStatsWrapper> stats = report.Next(); - ASSERT_NE(nullptr, stats); - ASSERT_EQ(3u, stats->MembersCount()); - EXPECT_EQ("standardized", stats->GetMember(0)->GetName()); - EXPECT_EQ("fooId", stats->GetMember(1)->GetName()); -} - -TEST(RTCStatsTest, IncludeAllMembers) { - rtc::scoped_refptr<webrtc::RTCStatsReport> webrtc_report = - webrtc::RTCStatsReport::Create(webrtc::Timestamp::Micros(7)); - webrtc_report->AddStats( - std::make_unique<TestStats>("id", webrtc::Timestamp::Micros(0))); - - // Include both standard and non-standard member. - RTCStatsReportPlatform report( - webrtc_report.get(), - Vector<webrtc::NonStandardGroupId>{ - webrtc::NonStandardGroupId::kGroupIdForTesting}, - false); - std::unique_ptr<RTCStatsWrapper> stats = report.GetStats("id"); - ASSERT_NE(nullptr, stats); - ASSERT_EQ(4u, stats->MembersCount()); - EXPECT_EQ("standardized", stats->GetMember(0)->GetName()); - EXPECT_EQ("non_standardized", stats->GetMember(1)->GetName()); - EXPECT_EQ("fooId", stats->GetMember(2)->GetName()); -} - -TEST(RTCStatsTest, IncludeAllMembersFeatureFlag) { - base::test::ScopedFeatureList feature_list; - feature_list.InitAndEnableFeature( - blink::features::kWebRtcExposeNonStandardStats); - - rtc::scoped_refptr<webrtc::RTCStatsReport> webrtc_report = - webrtc::RTCStatsReport::Create(webrtc::Timestamp::Micros(7)); - webrtc_report->AddStats( - std::make_unique<TestStats>("id", webrtc::Timestamp::Micros(0))); - - // Include both standard and non-standard member. - RTCStatsReportPlatform report( - webrtc_report.get(), - Vector<webrtc::NonStandardGroupId>{ - webrtc::NonStandardGroupId::kGroupIdForTesting}, - false); - std::unique_ptr<RTCStatsWrapper> stats = report.GetStats("id"); - ASSERT_NE(nullptr, stats); - ASSERT_EQ(4u, stats->MembersCount()); - EXPECT_EQ("standardized", stats->GetMember(0)->GetName()); - EXPECT_EQ("non_standardized", stats->GetMember(1)->GetName()); - EXPECT_EQ("fooId", stats->GetMember(2)->GetName()); -} - -TEST(RTCStatsTest, CopyHandle) { - rtc::scoped_refptr<webrtc::RTCStatsReport> webrtc_report = - webrtc::RTCStatsReport::Create(webrtc::Timestamp::Micros(17)); - webrtc_report->AddStats( - std::make_unique<TestStats>("id", webrtc::Timestamp::Micros(0))); - - // Check that filtering options are preserved during copy. - RTCStatsReportPlatform standard_members_report(webrtc_report.get(), {}, - false); - std::unique_ptr<RTCStatsReportPlatform> standard_members_copy = - standard_members_report.CopyHandle(); - - ASSERT_EQ(3u, standard_members_report.GetStats("id")->MembersCount()); - ASSERT_EQ(3u, standard_members_copy->GetStats("id")->MembersCount()); - - RTCStatsReportPlatform all_members_report( - webrtc_report.get(), - Vector<webrtc::NonStandardGroupId>{ - webrtc::NonStandardGroupId::kGroupIdForTesting}, - false); - std::unique_ptr<RTCStatsReportPlatform> all_members_copy = - all_members_report.CopyHandle(); - ASSERT_EQ(4u, all_members_report.GetStats("id")->MembersCount()); - ASSERT_EQ(4u, all_members_copy->GetStats("id")->MembersCount()); -} - -TEST(RTCStatsTest, ExcludeDeprecated) { - base::test::ScopedFeatureList feature_list; - feature_list.InitAndEnableFeature(blink::WebRtcUnshipDeprecatedStats); - - rtc::scoped_refptr<webrtc::RTCStatsReport> webrtc_report = - webrtc::RTCStatsReport::Create(webrtc::Timestamp::Micros(1234)); - { - auto stats_with_deprecated_foo_id = std::make_unique<TestStats>( - "NotDeprecated_a", webrtc::Timestamp::Micros(1234)); - stats_with_deprecated_foo_id->foo_id = "DEPRECATED_b"; - webrtc_report->AddStats(std::move(stats_with_deprecated_foo_id)); - } - webrtc_report->AddStats(std::make_unique<TestStats>( - "DEPRECATED_b", webrtc::Timestamp::Micros(1234))); - { - auto stats_with_non_deprecated_foo_id = std::make_unique<TestStats>( - "NotDeprecated_c", webrtc::Timestamp::Micros(1234)); - stats_with_non_deprecated_foo_id->foo_id = "NotDeprecated_a"; - webrtc_report->AddStats(std::move(stats_with_non_deprecated_foo_id)); - } - - RTCStatsReportPlatform report(webrtc_report.get(), {}, false); - EXPECT_FALSE(report.GetStats("DEPRECATED_b")); - EXPECT_EQ(report.Size(), 2u); - EXPECT_TRUE(report.Next()); - EXPECT_TRUE(report.Next()); - EXPECT_FALSE(report.Next()); - - auto stats_with_deprecated_foo_id = report.GetStats("NotDeprecated_a"); - ASSERT_TRUE(stats_with_deprecated_foo_id); - // fooId is excluded because it is an "Id" member with a "DEPRECATED_" - // reference. - EXPECT_EQ(stats_with_deprecated_foo_id->MembersCount(), 2u); - EXPECT_EQ(stats_with_deprecated_foo_id->GetMember(0)->GetName(), - "standardized"); - - auto stats_with_non_deprecated_foo_id = report.GetStats("NotDeprecated_c"); - ASSERT_TRUE(stats_with_deprecated_foo_id); - // fooId is included, it's not referencing anything deprecated. - EXPECT_EQ(stats_with_non_deprecated_foo_id->MembersCount(), 3u); - EXPECT_EQ(stats_with_non_deprecated_foo_id->GetMember(0)->GetName(), - "standardized"); - EXPECT_EQ(stats_with_non_deprecated_foo_id->GetMember(1)->GetName(), "fooId"); -} - -TEST(RTCStatsTest, FlagsControllingDeprecation) { - rtc::scoped_refptr<webrtc::RTCStatsReport> webrtc_report = - webrtc::RTCStatsReport::Create(webrtc::Timestamp::Micros(1234)); - auto webrtc_test_stats = - std::make_unique<TestStats>("test", webrtc::Timestamp::Micros(1234)); - webrtc_test_stats->foo_id = "DEPRECATED_reference"; - webrtc_report->AddStats(std::move(webrtc_test_stats)); - - // WebRtcUnshipDeprecatedStats is enabled-by-default. - { - RTCStatsReportPlatform report( - webrtc_report.get(), {}, - /*is_track_stats_deprecation_trial_enabled=*/false); - std::unique_ptr<RTCStatsWrapper> test_stats = report.GetStats("test"); - EXPECT_FALSE(MemberIsDefined(*test_stats, "fooId")); - } - // Deprecated stats are accessible when disabling WebRtcUnshipDeprecatedStats. - { - base::test::ScopedFeatureList feature_list; - feature_list.InitAndDisableFeature(blink::WebRtcUnshipDeprecatedStats); - RTCStatsReportPlatform report( - webrtc_report.get(), {}, - /*is_track_stats_deprecation_trial_enabled=*/false); - std::unique_ptr<RTCStatsWrapper> test_stats = report.GetStats("test"); - EXPECT_TRUE(MemberIsDefined(*test_stats, "fooId")); - } - // Deprecated stats are accessible when - // `is_track_stats_deprecation_trial_enabled` is true. - { - RTCStatsReportPlatform report( - webrtc_report.get(), {}, - /*is_track_stats_deprecation_trial_enabled=*/true); - std::unique_ptr<RTCStatsWrapper> test_stats = report.GetStats("test"); - EXPECT_TRUE(MemberIsDefined(*test_stats, "fooId")); - } -} - -TEST(RTCStatsTest, StatsExposingHardwareCapabilitiesAreMarked) { - rtc::scoped_refptr<webrtc::RTCStatsReport> webrtc_report = - webrtc::RTCStatsReport::Create(webrtc::Timestamp::Micros(1234)); - - auto stats = std::make_unique<TestStats>("id", webrtc::Timestamp::Micros(0)); - stats->hw_stat = true; - webrtc_report->AddStats(std::move(stats)); - - RTCStatsReportPlatform report(webrtc_report.get(), {}, false); - auto stats_from_report = report.GetStats("id"); - ASSERT_TRUE(stats_from_report); - EXPECT_EQ(stats_from_report->MembersCount(), 3u); - EXPECT_EQ(stats_from_report->GetMember(2)->Restriction(), - RTCStatsMember::ExposureRestriction::kHardwareCapability); -} - -} // namespace blink
diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5 b/third_party/blink/renderer/platform/runtime_enabled_features.json5 index 1ab7dbae..0123bc0e 100644 --- a/third_party/blink/renderer/platform/runtime_enabled_features.json5 +++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5
@@ -1147,7 +1147,7 @@ // `text-wrap: pretty`. crbug.com/1432798 { name: "CSSTextWrapPretty", - status: "test", + status: "experimental", depends_on: ["CSSTextWrap", "CSSWhiteSpaceShorthand"], }, // Support for CSS Toggles, https://tabatkins.github.io/css-toggle/
diff --git a/third_party/blink/web_tests/TestExpectations b/third_party/blink/web_tests/TestExpectations index 8c68539..7e6267b 100644 --- a/third_party/blink/web_tests/TestExpectations +++ b/third_party/blink/web_tests/TestExpectations
@@ -2888,6 +2888,7 @@ crbug.com/626703 [ Win ] virtual/partitioned-cookies/http/tests/inspector-protocol/network/disabled-cache-navigation.js [ Failure ] # ====== New tests from wpt-importer added here ====== +crbug.com/626703 [ Win10.20h2 ] external/wpt/video-rvfc/request-video-frame-callback-webrtc.https.html [ Timeout ] crbug.com/626703 [ Mac13 ] external/wpt/webrtc-encoded-transform/RTCPeerConnection-insertable-streams-simulcast.https.html [ Timeout ] crbug.com/626703 [ Mac13 ] external/wpt/html/semantics/links/hyperlink-auditing/headers.optional.html [ Timeout ] crbug.com/626703 [ Mac13 ] virtual/threaded-prefer-compositing/external/wpt/scroll-animations/scroll-timelines/effect-updateTiming.html [ Timeout ]
diff --git a/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json b/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json index 4e12477..2c1eae3 100644 --- a/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json +++ b/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json
@@ -75570,6 +75570,19 @@ {} ] ], + "anchor-scroll-update-007.html": [ + "b08bcc53ee7326615b7d3fc8ef2e8de9bbae9b63", + [ + null, + [ + [ + "/css/css-anchor-position/reference/anchor-scroll-ref.html", + "==" + ] + ], + {} + ] + ], "anchor-scroll-vlr.html": [ "82d167f48d9521348459b67b75e5877616672663", [ @@ -272683,11 +272696,11 @@ "support": { ".cache": { "gitignore2.json": [ - "927318b11ea254be3d25856c5990e6bc8db998ce", + "b4e5bb6ce7b6475dff3b9cf7457b328775fffc9d", [] ], "mtime.json": [ - "5bf005c165c533ae54f2f4ac7c82c07836094119", + "8d59046695020372fb9bad36c0ce6643437417d5", [] ] }, @@ -276922,6 +276935,10 @@ "96c2089d6566b370f7e65d1455e202933ea80436", [] ], + "webkit-linear-gradient-line-top.html.ini": [ + "d603af620684a3f4ca3c316a32e3971cf3c47c0c", + [] + ], "webkit-text-fill-color-property-001-ref.html": [ "8d9b8cc22e77bd92873e9846780add24cbc61e32", [] @@ -281532,6 +281549,10 @@ "e8d83bf3e8f35c97694c3a8ff9567352b8988996", [] ], + "border-bottom-005.xht.ini": [ + "7424e526e7a7eb70a34e8d2e567620bb608cacf0", + [] + ], "border-bottom-016-ref.xht": [ "c092b38d90ffc99c0f0c59020c3b4b8ce565fd00", [] @@ -330290,6 +330311,10 @@ "71e29e5563f053261425cc3d928a38ed0769ca39", [] ], + "kind-of-widget-fallback-input-search-border-top-style-001.html.ini": [ + "7e1c4b8d58815db61b77c2274e8869dd9894acc5", + [] + ], "kind-of-widget-fallback-input-search-border-top-width-001.html.ini": [ "76b6d163e644fc909c9b51fe448b3c9603aee423", [] @@ -330571,7 +330596,7 @@ [] ], "kind-of-widget-fallback-input-text-background-clip-001.html.ini": [ - "528aae0793db2f63c6c141252e7421d1c7633401", + "60e01f931bf547881710609500874f881998de70", [] ], "kind-of-widget-fallback-input-text-background-image-001.html.ini": [ @@ -330906,6 +330931,10 @@ "281ada39f9f5246188aa5de1bea16d461a646971", [] ], + "kind-of-widget-fallback-textarea-border-image-slice-001.html.ini": [ + "6d7cf94ee314b362ba691007cc096af350ff18bf", + [] + ], "kind-of-widget-fallback-textarea-border-image-source-001.html.ini": [ "7ab06ede5e4578ee34c04676699dd37957e38ff5", [] @@ -338461,6 +338490,14 @@ "f277097263e7acf6f2e7b40fa810231c61b00e63", [] ], + "dynamic-range-expected.txt": [ + "2e9b7ca7874909c5096b1ff816af9b0bf7459181", + [] + ], + "dynamic-range.html.ini": [ + "3f26b2853b9231563fa0a0f68c838a803de3072a", + [] + ], "inverted-colors-expected.txt": [ "907ecd3eb20bfc25bcac45b4f3ca9b7fe9867562", [] @@ -358328,7 +358365,7 @@ [] ], "iframe-popup.https.html.ini": [ - "91a6ef0f5d6ceecf9002ba3c898d6e14f671932e", + "3f3e7d640a03731294734d7f02e38d6abc935bde", [] ], "iframe-popup.https_3-4-expected.txt": [ @@ -369276,7 +369313,7 @@ [] ], "bdi-neutral-wrapped.html.ini": [ - "7566fd6786aba036f6cbba439d412cfe6c08ee7e", + "b5f92a7b4765fffd103bba8c0c164c84cc69553d", [] ], "bdi-paragraph-level-container-ref.html": [ @@ -380597,7 +380634,7 @@ [] ], "modulepreload-as.html.ini": [ - "3038b11e94087fe31378e9c93bd21ac303d94c9e", + "c2f5fe09dec6d76271ce288e04ca0b6c12567db7", [] ], "modulepreload-expected.txt": [ @@ -384044,7 +384081,7 @@ [] ], "scroll-timeline-inline-orientation.html.ini": [ - "1bab2fe7a65bb134c541cf8294677d0b39154fd0", + "0f803ae1562b0a5acd37bacd3bb23ddd8d921df1", [] ], "support": { @@ -388703,10 +388740,6 @@ "a220b7b72f1467d05a18fc9961a5b21e09b8b852", [] ], - "prefetch.https-expected.txt": [ - "e0a8051c9e629eec1a311af429d4fdfb3b1b2e94", - [] - ], "prefetch.https.html.ini": [ "ef1c0dd1379e3c0798d3b598ca84bffd4ffa3aa0", [] @@ -472670,7 +472703,7 @@ ] ], "dynamic-range.html": [ - "babe1b9f0d44089da93f20e307638b1264d4c702", + "75b3015b8e76298767c19dfbaf775a53c8d9b706", [ null, {} @@ -500034,7 +500067,7 @@ ] ], "integrity.sub.any.js": [ - "56dbd4909f6a43e489ee5b6c50054d2b44d0709e", + "e3cfd1b2f6e66629cccfafac9d2b55f1e1505787", [ "fetch/api/basic/integrity.sub.any.html", {
diff --git a/third_party/blink/web_tests/external/wpt/compat/webkit-linear-gradient-line-top.html.ini b/third_party/blink/web_tests/external/wpt/compat/webkit-linear-gradient-line-top.html.ini new file mode 100644 index 0000000..d603af6 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/compat/webkit-linear-gradient-line-top.html.ini
@@ -0,0 +1,3 @@ +[webkit-linear-gradient-line-top.html] + expected: + if (product == "content_shell") and (os == "mac") and (port == "mac13-arm64"): FAIL
diff --git a/third_party/blink/web_tests/external/wpt/css/CSS2/borders/border-bottom-005.xht.ini b/third_party/blink/web_tests/external/wpt/css/CSS2/borders/border-bottom-005.xht.ini new file mode 100644 index 0000000..7424e52 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/CSS2/borders/border-bottom-005.xht.ini
@@ -0,0 +1,3 @@ +[border-bottom-005.xht] + expected: + if (product == "content_shell") and (os == "mac") and (port == "mac13-arm64"): FAIL
diff --git a/third_party/blink/web_tests/external/wpt/css/css-contain/container-queries/nested-size-style-container-invalidation.html b/third_party/blink/web_tests/external/wpt/css/css-contain/container-queries/nested-size-style-container-invalidation.html new file mode 100644 index 0000000..8d04bf5 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-contain/container-queries/nested-size-style-container-invalidation.html
@@ -0,0 +1,40 @@ +<!DOCTYPE html> +<title>Nested size/style @container-dependent elements respond to container size changes</title> +<link rel="help" href="https://drafts.csswg.org/css-contain-3/#size-container"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="support/cq-testcommon.js"></script> +<style> + #container { + container-type: size; + width: 1000px; + } + #container.narrow { + width: 600px; + } + #target { + color: red; + } + @container (width < 800px) { + @container style(--foo: bar) { + #target { color: green; } + } + } +</style> +<div id="container"> + <div style="--foo: bar"> + <div id="target">Green?</div> + </div> +</div> +<script> + setup(() => assert_implements_container_queries()); + + test(() => { + assert_equals(getComputedStyle(target).color, "rgb(255, 0, 0)"); + }, "Initially red"); + + test(() => { + container.className = "narrow"; + assert_equals(getComputedStyle(target).color, "rgb(0, 128, 0)"); + }, "Green after reducing width"); +</script>
diff --git a/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-input-search-border-top-style-001.html.ini b/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-input-search-border-top-style-001.html.ini new file mode 100644 index 0000000..7e1c4b8 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-input-search-border-top-style-001.html.ini
@@ -0,0 +1,3 @@ +[kind-of-widget-fallback-input-search-border-top-style-001.html] + expected: + if (product == "content_shell") and (os == "mac") and (port == "mac12"): FAIL
diff --git a/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-input-text-background-clip-001.html.ini b/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-input-text-background-clip-001.html.ini index 528aae0..60e01f9 100644 --- a/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-input-text-background-clip-001.html.ini +++ b/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-input-text-background-clip-001.html.ini
@@ -1,3 +1,4 @@ [kind-of-widget-fallback-input-text-background-clip-001.html] expected: if (product == "content_shell") and (os == "win"): FAIL + if (product == "content_shell") and (os == "linux"): FAIL
diff --git a/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-textarea-border-image-slice-001.html.ini b/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-textarea-border-image-slice-001.html.ini new file mode 100644 index 0000000..6d7cf94 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-ui/compute-kind-widget-generated/kind-of-widget-fallback-textarea-border-image-slice-001.html.ini
@@ -0,0 +1,3 @@ +[kind-of-widget-fallback-textarea-border-image-slice-001.html] + expected: + if (product == "content_shell") and (os == "mac") and (port == "mac11"): FAIL
diff --git a/third_party/blink/web_tests/external/wpt/css/mediaqueries/dynamic-range-expected.txt b/third_party/blink/web_tests/external/wpt/css/mediaqueries/dynamic-range-expected.txt new file mode 100644 index 0000000..2e9b7ca7 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/mediaqueries/dynamic-range-expected.txt
@@ -0,0 +1,26 @@ +This is a testharness.js-based test. +PASS Should be known: '(dynamic-range: standard)' +PASS Should be known: '(dynamic-range: high)' +PASS Should be known: '(video-dynamic-range: standard)' +PASS Should be known: '(video-dynamic-range: high)' +FAIL Should be known: '(dynamic-range)' assert_true: expected true got false +FAIL Should be known: '(video-dynamic-range)' assert_true: expected true got false +PASS Should be parseable: '(dynamic-range: 0)' +PASS Should be unknown: '(dynamic-range: 0)' +PASS Should be parseable: '(dynamic-range: 10px)' +PASS Should be unknown: '(dynamic-range: 10px)' +PASS Should be parseable: '(dynamic-range: invalid)' +PASS Should be unknown: '(dynamic-range: invalid)' +PASS Should be parseable: '(video-dynamic-range: 0)' +PASS Should be unknown: '(video-dynamic-range: 0)' +PASS Should be parseable: '(video-dynamic-range: 10px)' +PASS Should be unknown: '(video-dynamic-range: 10px)' +PASS Should be parseable: '(video-dynamic-range: invalid)' +PASS Should be unknown: '(video-dynamic-range: invalid)' +PASS Check that dynamic-range evaluates to false in the boolean context +PASS Check that video-dynamic-range evaluates to false in the boolean context +PASS Check that dynamic-range always matches 'standard' +PASS Check that video-dynamic-range always matches 'standard' +PASS Check that video-dynamic-range is not 'invalid' +Harness: the test ran to completion. +
diff --git a/third_party/blink/web_tests/external/wpt/css/mediaqueries/dynamic-range.html b/third_party/blink/web_tests/external/wpt/css/mediaqueries/dynamic-range.html index babe1b9..75b3015 100644 --- a/third_party/blink/web_tests/external/wpt/css/mediaqueries/dynamic-range.html +++ b/third_party/blink/web_tests/external/wpt/css/mediaqueries/dynamic-range.html
@@ -10,16 +10,27 @@ query_should_be_known("(video-dynamic-range: standard)"); query_should_be_known("(video-dynamic-range: high)"); -query_should_be_unknown("(dynamic-range)"); +query_should_be_known("(dynamic-range)"); +query_should_be_known("(video-dynamic-range)"); + query_should_be_unknown("(dynamic-range: 0)"); query_should_be_unknown("(dynamic-range: 10px)"); query_should_be_unknown("(dynamic-range: invalid)"); -query_should_be_unknown("(video-dynamic-range)"); query_should_be_unknown("(video-dynamic-range: 0)"); query_should_be_unknown("(video-dynamic-range: 10px)"); query_should_be_unknown("(video-dynamic-range: invalid)"); test(() => { + let match_boolean = window.matchMedia("(dynamic-range)"); + assert_false(match_boolean.matches); +}, "Check that dynamic-range evaluates to false in the boolean context"); + +test(() => { + let match_boolean = window.matchMedia("(video-dynamic-range)"); + assert_false(match_boolean.matches); +}, "Check that video-dynamic-range evaluates to false in the boolean context"); + +test(() => { let match_standard = window.matchMedia("(dynamic-range: standard)"); assert_true(match_standard.matches); }, "Check that dynamic-range always matches 'standard'");
diff --git a/third_party/blink/web_tests/external/wpt/css/mediaqueries/dynamic-range.html.ini b/third_party/blink/web_tests/external/wpt/css/mediaqueries/dynamic-range.html.ini new file mode 100644 index 0000000..3f26b285 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/mediaqueries/dynamic-range.html.ini
@@ -0,0 +1,6 @@ +[dynamic-range.html] + [Should be known: '(dynamic-range)'] + expected: FAIL + + [Should be known: '(video-dynamic-range)'] + expected: FAIL
diff --git a/third_party/blink/web_tests/external/wpt/fetch/api/basic/integrity.sub.any.js b/third_party/blink/web_tests/external/wpt/fetch/api/basic/integrity.sub.any.js index 56dbd490..e3cfd1b 100644 --- a/third_party/blink/web_tests/external/wpt/fetch/api/basic/integrity.sub.any.js +++ b/third_party/blink/web_tests/external/wpt/fetch/api/basic/integrity.sub.any.js
@@ -28,6 +28,9 @@ const topSha256 = "sha256-KHIDZcXnR2oBHk9DrAA+5fFiR6JjudYjqoXtMR1zvzk="; const topSha384 = "sha384-MgZYnnAzPM/MjhqfOIMfQK5qcFvGZsGLzx4Phd7/A8fHTqqLqXqKo8cNzY3xEPTL"; const topSha512 = "sha512-D6yns0qxG0E7+TwkevZ4Jt5t7Iy3ugmAajG/dlf6Pado1JqTyneKXICDiqFIkLMRExgtvg8PlxbKTkYfRejSOg=="; +const topSha512wrongpadding = "sha512-D6yns0qxG0E7+TwkevZ4Jt5t7Iy3ugmAajG/dlf6Pado1JqTyneKXICDiqFIkLMRExgtvg8PlxbKTkYfRejSOg"; +const topSha512base64url = "sha512-D6yns0qxG0E7-TwkevZ4Jt5t7Iy3ugmAajG_dlf6Pado1JqTyneKXICDiqFIkLMRExgtvg8PlxbKTkYfRejSOg=="; +const topSha512base64url_nopadding = "sha512-D6yns0qxG0E7-TwkevZ4Jt5t7Iy3ugmAajG_dlf6Pado1JqTyneKXICDiqFIkLMRExgtvg8PlxbKTkYfRejSOg"; const invalidSha256 = "sha256-dKUcPOn/AlUjWIwcHeHNqYXPlvyGiq+2dWOdFcE+24I="; const invalidSha512 = "sha512-oUceBRNxPxnY60g/VtPCj2syT4wo4EZh2CgYdWy9veW8+OsReTXoh7dizMGZafvx9+QhMS39L/gIkxnPIn41Zg=="; @@ -38,13 +41,20 @@ const corsUrl2 = `https://{{host}}:{{ports[https][0]}}${path}` integrity("Empty string integrity", url, "", /* initRequestMode */ undefined, - /* shouldPass */ true); + /* shouldPass */ true); integrity("SHA-256 integrity", url, topSha256, /* initRequestMode */ undefined, /* shouldPass */ true); integrity("SHA-384 integrity", url, topSha384, /* initRequestMode */ undefined, /* shouldPass */ true); integrity("SHA-512 integrity", url, topSha512, /* initRequestMode */ undefined, /* shouldPass */ true); +integrity("SHA-512 integrity with missing padding", url, topSha512wrongpadding, + /* initRequestMode */ undefined, /* shouldPass */ true); +integrity("SHA-512 integrity base64url encoded", url, topSha512base64url, + /* initRequestMode */ undefined, /* shouldPass */ true); +integrity("SHA-512 integrity base64url encoded with missing padding", url, + topSha512base64url_nopadding, /* initRequestMode */ undefined, + /* shouldPass */ true); integrity("Invalid integrity", url, invalidSha256, /* initRequestMode */ undefined, /* shouldPass */ false); integrity("Multiple integrities: valid stronger than invalid", url,
diff --git a/third_party/blink/web_tests/external/wpt/html/cross-origin-opener-policy/tentative/restrict-properties/iframe-popup.https.html.ini b/third_party/blink/web_tests/external/wpt/html/cross-origin-opener-policy/tentative/restrict-properties/iframe-popup.https.html.ini index 91a6ef0f..3f3e7d6 100644 --- a/third_party/blink/web_tests/external/wpt/html/cross-origin-opener-policy/tentative/restrict-properties/iframe-popup.https.html.ini +++ b/third_party/blink/web_tests/external/wpt/html/cross-origin-opener-policy/tentative/restrict-properties/iframe-popup.https.html.ini
@@ -80,7 +80,7 @@ [iframe-popup.https.html?9-last] expected: - if product == "chrome": [OK, CRASH] + if product == "chrome": ERROR [COOP: restrict-properties to popup COOP: restrict-properties via an iframe, with cross origin iframe, cross origin popup with anchor] expected: FAIL
diff --git a/third_party/blink/web_tests/external/wpt/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-wrapped.html.ini b/third_party/blink/web_tests/external/wpt/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-wrapped.html.ini index 7566fd6..b5f92a7 100644 --- a/third_party/blink/web_tests/external/wpt/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-wrapped.html.ini +++ b/third_party/blink/web_tests/external/wpt/html/semantics/text-level-semantics/the-bdi-element/bdi-neutral-wrapped.html.ini
@@ -1,3 +1,4 @@ [bdi-neutral-wrapped.html] expected: + if (product == "content_shell") and (os == "mac") and (port == "mac11"): FAIL if (product == "content_shell") and (os == "linux") and (flag_specific == "disable-site-isolation-trials"): FAIL
diff --git a/third_party/blink/web_tests/external/wpt/preload/modulepreload-as.html.ini b/third_party/blink/web_tests/external/wpt/preload/modulepreload-as.html.ini index 3038b11..c2f5fe0 100644 --- a/third_party/blink/web_tests/external/wpt/preload/modulepreload-as.html.ini +++ b/third_party/blink/web_tests/external/wpt/preload/modulepreload-as.html.ini
@@ -1,181 +1,183 @@ [modulepreload-as.html] expected: - if (product == "content_shell") and (os == "mac") and (port == "mac13-arm64"): ERROR - if (product == "content_shell") and (os == "mac") and (port == "mac12-arm64"): [ERROR, OK] - if (product == "content_shell") and (os == "mac") and (port == "mac13"): [ERROR, OK] + if (product == "content_shell") and (os == "mac") and (port == "mac10.15"): OK + if (product == "content_shell") and (os == "mac") and (port == "mac13-arm64"): [ERROR, OK] + if (product == "content_shell") and (os == "mac") and (port == "mac12"): OK + if (product == "content_shell") and (os == "mac") and (port == "mac11"): OK if (product == "content_shell") and (os == "win") and (port == "win11"): TIMEOUT - if (product == "content_shell") and (os == "win") and (port == "win10.20h2"): [ERROR, OK] - if (product == "content_shell") and (os == "linux") and (flag_specific == ""): [ERROR, TIMEOUT] - if (product == "content_shell") and (os == "linux") and (flag_specific == "disable-site-isolation-trials"): ERROR - if product == "chrome": ERROR + if product == "chrome": [ERROR, TIMEOUT] + ERROR + [Modulepreload with as=""] + expected: + if product == "chrome": [PASS, TIMEOUT] + [Modulepreload with as="audio"] expected: - if (product == "content_shell") and (os == "win") and (port == "win10.20h2"): [FAIL, PASS] + if product == "chrome": [FAIL, TIMEOUT, NOTRUN] FAIL [Modulepreload with as="audioworklet"] - expected: FAIL + expected: + if product == "chrome": [FAIL, NOTRUN] + FAIL [Modulepreload with as="document"] expected: - if (product == "content_shell") and (os == "mac") and (port == "mac13"): [FAIL, PASS] - if (product == "content_shell") and (os == "win") and (port == "win10.20h2"): [FAIL, PASS] + if product == "chrome": [FAIL, NOTRUN] FAIL [Modulepreload with as="embed"] expected: - if (product == "content_shell") and (os == "win") and (port == "win10.20h2"): [FAIL, PASS] - if (product == "content_shell") and (os == "linux") and (flag_specific == ""): [PASS, FAIL] - if (product == "content_shell") and (os == "mac") and (port == "mac13"): [FAIL, PASS] - if (product == "content_shell") and (os == "mac") and (port == "mac13-arm64"): PASS - if product == "chrome": PASS + if (product == "content_shell") and (os == "linux") and (flag_specific == ""): PASS + if product == "chrome": [FAIL, NOTRUN, PASS] FAIL [Modulepreload with as="fetch"] expected: - if (product == "content_shell") and (os == "mac") and (port == "mac13"): [FAIL, PASS] - if (product == "content_shell") and (os == "mac") and (port == "mac10.15"): FAIL - if (product == "content_shell") and (os == "mac") and (port == "mac11"): FAIL - if (product == "content_shell") and (os == "mac") and (port == "mac12"): FAIL - if (product == "content_shell") and (os == "mac") and (port == "mac12-arm64"): [FAIL, PASS] - if (product == "content_shell") and (os == "win") and (port == "win10.20h2"): [PASS, FAIL] + if (product == "content_shell") and (os == "win") and (port == "win10.20h2"): PASS + if (product == "content_shell") and (os == "win") and (port == "win11"): PASS + if (product == "content_shell") and (os == "mac") and (port == "mac13-arm64"): [PASS, FAIL] + if (product == "content_shell") and (os == "linux"): PASS + if product == "chrome": [PASS, NOTRUN] + FAIL [Modulepreload with as="font"] expected: - if (product == "content_shell") and (os == "win") and (port == "win10.20h2"): [FAIL, PASS] if (product == "content_shell") and (os == "win") and (port == "win11"): PASS - if (product == "content_shell") and (os == "linux") and (flag_specific == ""): [FAIL, PASS] - if (product == "content_shell") and (os == "mac") and (port == "mac12-arm64"): [FAIL, PASS] - if (product == "content_shell") and (os == "mac") and (port == "mac13"): [FAIL, PASS] - if (product == "content_shell") and (os == "mac") and (port == "mac13-arm64"): PASS - if product == "chrome": PASS + if product == "chrome": [PASS, FAIL, NOTRUN] FAIL [Modulepreload with as="frame"] expected: - if (product == "content_shell") and (os == "linux") and (flag_specific == ""): [FAIL, PASS] - if (product == "content_shell") and (os == "mac") and (port == "mac12-arm64"): [FAIL, PASS] - if (product == "content_shell") and (os == "mac") and (port == "mac13"): [FAIL, PASS] - if (product == "content_shell") and (os == "mac") and (port == "mac10.15"): FAIL - if (product == "content_shell") and (os == "mac") and (port == "mac11"): FAIL - if (product == "content_shell") and (os == "mac") and (port == "mac12"): FAIL - if (product == "content_shell") and (os == "win") and (port == "win10.20h2"): [FAIL, PASS] + if (product == "content_shell") and (os == "linux") and (flag_specific == "disable-site-isolation-trials"): PASS + if (product == "content_shell") and (os == "win") and (port == "win11"): PASS + if product == "chrome": [PASS, NOTRUN] + FAIL [Modulepreload with as="iMaGe"] expected: - if (product == "content_shell") and (os == "win") and (port == "win10.20h2"): [PASS, FAIL] if (product == "content_shell") and (os == "mac") and (port == "mac10.15"): FAIL - if (product == "content_shell") and (os == "mac") and (port == "mac12-arm64"): [PASS, FAIL] - if (product == "content_shell") and (os == "mac") and (port == "mac12"): FAIL if (product == "content_shell") and (os == "mac") and (port == "mac11"): FAIL - if (product == "content_shell") and (os == "mac") and (port == "mac13"): [FAIL, PASS] + if (product == "content_shell") and (os == "mac") and (port == "mac13"): FAIL + if (product == "content_shell") and (os == "mac") and (port == "mac12"): FAIL + if (product == "content_shell") and (os == "mac") and (port == "mac13-arm64"): [PASS, FAIL] + if product == "chrome": [PASS, NOTRUN, FAIL] [Modulepreload with as="iframe"] expected: - if (product == "content_shell") and (os == "mac") and (port == "mac12-arm64"): [FAIL, PASS] - if (product == "content_shell") and (os == "mac") and (port == "mac13"): [FAIL, PASS] + if (product == "content_shell") and (os == "win") and (port == "win10.20h2"): PASS if (product == "content_shell") and (os == "win") and (port == "win11"): PASS - if (product == "content_shell") and (os == "win") and (port == "win10.20h2"): [PASS, FAIL] - if (product == "content_shell") and (os == "linux") and (flag_specific == ""): [FAIL, PASS] if (product == "content_shell") and (os == "linux") and (flag_specific == "disable-site-isolation-trials"): PASS - if product == "chrome": PASS + if product == "chrome": [PASS, NOTRUN] FAIL [Modulepreload with as="image"] expected: - if (product == "content_shell") and (os == "win") and (port == "win10.20h2"): [PASS, FAIL] - if (product == "content_shell") and (os == "win") and (port == "win11"): PASS - if (product == "content_shell") and (os == "linux") and (flag_specific == ""): [PASS, FAIL] - if (product == "content_shell") and (os == "linux") and (flag_specific == "disable-site-isolation-trials"): PASS - if (product == "content_shell") and (os == "mac") and (port == "mac12-arm64"): [PASS, FAIL] - if (product == "content_shell") and (os == "mac") and (port == "mac13"): [FAIL, PASS] - if product == "chrome": PASS - FAIL + if (product == "content_shell") and (os == "mac") and (port == "mac11"): FAIL + if (product == "content_shell") and (os == "mac") and (port == "mac10.15"): FAIL + if (product == "content_shell") and (os == "mac") and (port == "mac13"): FAIL + if (product == "content_shell") and (os == "mac") and (port == "mac13-arm64"): [FAIL, PASS] + if (product == "content_shell") and (os == "mac") and (port == "mac12"): FAIL + if product == "chrome": [PASS, NOTRUN] [Modulepreload with as="invalid-dest"] - expected: FAIL + expected: + if product == "chrome": [FAIL, NOTRUN] + FAIL [Modulepreload with as="manifest"] expected: - if (product == "content_shell") and (os == "win") and (port == "win10.20h2"): [PASS, FAIL] + if (product == "content_shell") and (os == "mac") and (port == "mac13-arm64"): [FAIL, PASS] + if (product == "content_shell") and (os == "win") and (port == "win10.20h2"): PASS if (product == "content_shell") and (os == "win") and (port == "win11"): PASS - if (product == "content_shell") and (os == "linux") and (flag_specific == ""): [PASS, FAIL] if (product == "content_shell") and (os == "linux") and (flag_specific == "disable-site-isolation-trials"): PASS - if (product == "content_shell") and (os == "mac") and (port == "mac13"): [FAIL, PASS] - if (product == "content_shell") and (os == "mac") and (port == "mac12-arm64"): [FAIL, PASS] - if product == "chrome": PASS + if (product == "content_shell") and (os == "linux") and (flag_specific == ""): PASS + if product == "chrome": [PASS, NOTRUN] FAIL [Modulepreload with as="object"] expected: - if (product == "content_shell") and (os == "win") and (port == "win10.20h2"): [PASS, FAIL] if (product == "content_shell") and (os == "mac") and (port == "mac11"): FAIL if (product == "content_shell") and (os == "mac") and (port == "mac10.15"): FAIL + if (product == "content_shell") and (os == "mac") and (port == "mac13-arm64"): [PASS, FAIL] if (product == "content_shell") and (os == "mac") and (port == "mac12"): FAIL - if (product == "content_shell") and (os == "mac") and (port == "mac12-arm64"): [PASS, FAIL] - if (product == "content_shell") and (os == "mac") and (port == "mac13"): [PASS, FAIL] + if product == "chrome": [PASS, NOTRUN] [Modulepreload with as="paintworklet"] - expected: FAIL + expected: + if product == "chrome": [FAIL, NOTRUN] + FAIL [Modulepreload with as="report"] expected: - if (product == "content_shell") and (os == "win") and (port == "win10.20h2"): [PASS, FAIL] - if (product == "content_shell") and (os == "mac") and (port == "mac10.15"): FAIL - if (product == "content_shell") and (os == "mac") and (port == "mac12-arm64"): [PASS, FAIL] + if (product == "content_shell") and (os == "mac") and (port == "mac13-arm64"): [PASS, FAIL] if (product == "content_shell") and (os == "mac") and (port == "mac12"): FAIL - if (product == "content_shell") and (os == "mac") and (port == "mac13"): [PASS, FAIL] + if (product == "content_shell") and (os == "mac") and (port == "mac10.15"): FAIL if (product == "content_shell") and (os == "mac") and (port == "mac11"): FAIL + if product == "chrome": [PASS, NOTRUN] + + [Modulepreload with as="sCrIpT"] + expected: + if product == "chrome": [PASS, NOTRUN] + + [Modulepreload with as="script"] + expected: + if product == "chrome": [PASS, NOTRUN] [Modulepreload with as="serviceworker"] - expected: FAIL + expected: + if product == "chrome": [FAIL, NOTRUN] + FAIL [Modulepreload with as="sharedworker"] - expected: FAIL + expected: + if product == "chrome": [FAIL, NOTRUN] + FAIL [Modulepreload with as="style"] expected: - if (product == "content_shell") and (os == "win") and (port == "win10.20h2"): [PASS, FAIL] + if (product == "content_shell") and (os == "win") and (port == "win10.20h2"): PASS + if (product == "content_shell") and (os == "mac") and (port == "mac13-arm64"): [FAIL, PASS] if (product == "content_shell") and (os == "linux") and (flag_specific == "disable-site-isolation-trials"): PASS - if (product == "content_shell") and (os == "linux") and (flag_specific == ""): [FAIL, PASS] - if (product == "content_shell") and (os == "mac") and (port == "mac12-arm64"): [FAIL, PASS] - if product == "chrome": PASS + if product == "chrome": [FAIL, PASS, NOTRUN] FAIL [Modulepreload with as="track"] expected: - if (product == "content_shell") and (os == "win") and (port == "win10.20h2"): [PASS, FAIL] - if (product == "content_shell") and (os == "linux") and (flag_specific == ""): [PASS, FAIL] + if (product == "content_shell") and (os == "win") and (port == "win10.20h2"): PASS + if (product == "content_shell") and (os == "mac") and (port == "mac13-arm64"): [FAIL, PASS] + if (product == "content_shell") and (os == "linux") and (flag_specific == ""): PASS if (product == "content_shell") and (os == "linux") and (flag_specific == "disable-site-isolation-trials"): PASS - if product == "chrome": PASS + if product == "chrome": [FAIL, PASS, NOTRUN] FAIL [Modulepreload with as="video"] expected: - if (product == "content_shell") and (os == "linux") and (flag_specific == ""): [PASS, FAIL] + if (product == "content_shell") and (os == "win") and (port == "win10.20h2"): PASS + if (product == "content_shell") and (os == "mac") and (port == "mac13-arm64"): [FAIL, PASS] if (product == "content_shell") and (os == "linux") and (flag_specific == "disable-site-isolation-trials"): PASS - if (product == "content_shell") and (os == "mac") and (port == "mac13-arm64"): PASS - if (product == "content_shell") and (os == "win") and (port == "win10.20h2"): [PASS, FAIL] - if product == "chrome": PASS + if (product == "content_shell") and (os == "linux") and (flag_specific == ""): PASS + if product == "chrome": [PASS, NOTRUN, FAIL] FAIL [Modulepreload with as="webidentity"] expected: + if (product == "content_shell") and (os == "linux") and (flag_specific == ""): PASS if (product == "content_shell") and (os == "linux") and (flag_specific == "disable-site-isolation-trials"): PASS - if (product == "content_shell") and (os == "linux") and (flag_specific == ""): [PASS, FAIL] - if (product == "content_shell") and (os == "win") and (port == "win10.20h2"): [PASS, FAIL] - if (product == "content_shell") and (os == "mac") and (port == "mac12-arm64"): [FAIL, PASS] - if product == "chrome": PASS + if (product == "content_shell") and (os == "mac") and (port == "mac13-arm64"): [FAIL, PASS] + if (product == "content_shell") and (os == "win") and (port == "win10.20h2"): PASS + if product == "chrome": [PASS, NOTRUN, FAIL] FAIL [Modulepreload with as="worker"] - expected: FAIL + expected: + if product == "chrome": [FAIL, NOTRUN] + FAIL [Modulepreload with as="xslt"] expected: - if (product == "content_shell") and (os == "linux") and (flag_specific == ""): PASS - if (product == "content_shell") and (os == "linux") and (flag_specific == "disable-site-isolation-trials"): PASS - if (product == "content_shell") and (os == "win") and (port == "win10.20h2"): [PASS, FAIL] - if (product == "content_shell") and (os == "mac") and (port == "mac12-arm64"): [FAIL, PASS] - if product == "chrome": PASS + if (product == "content_shell") and (os == "mac") and (port == "mac13-arm64"): [FAIL, PASS] + if (product == "content_shell") and (os == "win") and (port == "win10.20h2"): PASS + if (product == "content_shell") and (os == "linux"): PASS + if product == "chrome": [PASS, NOTRUN, FAIL] FAIL
diff --git a/third_party/blink/web_tests/external/wpt/scroll-animations/css/scroll-timeline-inline-orientation.html.ini b/third_party/blink/web_tests/external/wpt/scroll-animations/css/scroll-timeline-inline-orientation.html.ini index 1bab2fe..0f803ae 100644 --- a/third_party/blink/web_tests/external/wpt/scroll-animations/css/scroll-timeline-inline-orientation.html.ini +++ b/third_party/blink/web_tests/external/wpt/scroll-animations/css/scroll-timeline-inline-orientation.html.ini
@@ -1,4 +1,5 @@ [scroll-timeline-inline-orientation.html] expected: - if (product == "content_shell") and (os == "mac") and (port == "mac12"): FAIL + if (product == "content_shell") and (os == "mac") and (port == "mac13-arm64"): FAIL if (product == "content_shell") and (os == "mac") and (port == "mac13"): FAIL + if (product == "content_shell") and (os == "mac") and (port == "mac12"): FAIL
diff --git a/third_party/blink/web_tests/wpt_internal/attribution-reporting/multi-registration.sub.https.html b/third_party/blink/web_tests/wpt_internal/attribution-reporting/multi-registration.sub.https.html index 5d29e760..36d2ced 100644 --- a/third_party/blink/web_tests/wpt_internal/attribution-reporting/multi-registration.sub.https.html +++ b/third_party/blink/web_tests/wpt_internal/attribution-reporting/multi-registration.sub.https.html
@@ -13,14 +13,12 @@ registerAttributionSrcByImg([ createRedirectChain([ { - reportingOrigin: otherReportingOrigin, source: { destination: 'https://{{host}}', source_event_id: '1', }, }, { - reportingOrigin: otherReportingOrigin, trigger: { event_trigger_data: [{trigger_data: '0'}], }, @@ -44,14 +42,19 @@ ].join(' ')); { + const payload = await pollEventLevelReports(); + assert_equals(payload.reports.length, 1); + const report = JSON.parse(payload.reports[0].body); + assert_equals(report.source_event_id, '1'); + assert_equals(report.trigger_data, '0'); + } + + { const payload = await pollEventLevelReports(otherReportingOrigin); - assert_greater_than(payload.reports.length, 0); - // TODO(johnidel): Ideally we could use multiple origins to verify the - // report contents, however the remote origin is treated as same-site - // to the default reporting origin, and the API forbids multiple - // different reporting origins for the same-site. This causes - // the registrations of sources and triggers to be racy so we can't - // verify 2 reports are received. + assert_equals(payload.reports.length, 1); + const report = JSON.parse(payload.reports[0].body); + assert_equals(report.source_event_id, '2'); + assert_equals(report.trigger_data, '1'); } }, 'Multi-registration succeeds.'); </script>
diff --git a/third_party/blink/web_tests/wpt_internal/framework-detection/detect-angular-clamped.html b/third_party/blink/web_tests/wpt_internal/framework-detection/detect-angular-clamped.html deleted file mode 100644 index c409b0b..0000000 --- a/third_party/blink/web_tests/wpt_internal/framework-detection/detect-angular-clamped.html +++ /dev/null
@@ -1,9 +0,0 @@ -<!DOCTYPE html> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<script src="resources/test-framework-version.js"></script> -<body> -<div ng-version="300.4000.333.12.x"></div> -<script> - test_framework_version("Angular",`${300 & 0xff}.${4000 & 0xff}`); -</script>
diff --git a/third_party/blink/web_tests/wpt_internal/framework-detection/detect-angular-clamped.html.ini b/third_party/blink/web_tests/wpt_internal/framework-detection/detect-angular-clamped.html.ini deleted file mode 100644 index 48518853..0000000 --- a/third_party/blink/web_tests/wpt_internal/framework-detection/detect-angular-clamped.html.ini +++ /dev/null
@@ -1,4 +0,0 @@ -[detect-angular-clamped.html] - [Test framework version for Angular (default)] - expected: - if product == "chrome": FAIL
diff --git a/third_party/blink/web_tests/wpt_internal/framework-detection/detect-angular.html b/third_party/blink/web_tests/wpt_internal/framework-detection/detect-angular.html deleted file mode 100644 index 38a96773..0000000 --- a/third_party/blink/web_tests/wpt_internal/framework-detection/detect-angular.html +++ /dev/null
@@ -1,9 +0,0 @@ -<!DOCTYPE html> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<script src="resources/test-framework-version.js"></script> -<body> -<div ng-version="14.0.4"></div> -<script> - test_framework_version("Angular", "14.0"); -</script>
diff --git a/third_party/blink/web_tests/wpt_internal/framework-detection/detect-angular.html.ini b/third_party/blink/web_tests/wpt_internal/framework-detection/detect-angular.html.ini deleted file mode 100644 index 042ac5d..0000000 --- a/third_party/blink/web_tests/wpt_internal/framework-detection/detect-angular.html.ini +++ /dev/null
@@ -1,4 +0,0 @@ -[detect-angular.html] - [Test framework version for Angular (default)] - expected: - if product == "chrome": FAIL
diff --git a/third_party/blink/web_tests/wpt_internal/framework-detection/detect-drupal.html b/third_party/blink/web_tests/wpt_internal/framework-detection/detect-drupal.html deleted file mode 100644 index 089d477..0000000 --- a/third_party/blink/web_tests/wpt_internal/framework-detection/detect-drupal.html +++ /dev/null
@@ -1,10 +0,0 @@ -<!DOCTYPE html> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<script src="resources/test-framework-version.js"></script> -<meta name="generator" content="Drupal 7 Something"></script> -<body> -<script> - test_framework_version("Drupal", '7.0'); -</script> -</body>
diff --git a/third_party/blink/web_tests/wpt_internal/framework-detection/detect-drupal.html.ini b/third_party/blink/web_tests/wpt_internal/framework-detection/detect-drupal.html.ini deleted file mode 100644 index 155a834..0000000 --- a/third_party/blink/web_tests/wpt_internal/framework-detection/detect-drupal.html.ini +++ /dev/null
@@ -1,4 +0,0 @@ -[detect-drupal.html] - [Test framework version for Drupal (default)] - expected: - if product == "chrome": FAIL
diff --git a/third_party/blink/web_tests/wpt_internal/framework-detection/detect-nextjs.html b/third_party/blink/web_tests/wpt_internal/framework-detection/detect-nextjs.html deleted file mode 100644 index 5302f12..0000000 --- a/third_party/blink/web_tests/wpt_internal/framework-detection/detect-nextjs.html +++ /dev/null
@@ -1,12 +0,0 @@ -<!DOCTYPE html> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<script src="resources/test-framework-version.js"></script> -<body> -<div id="__next"></div> -<script> - window.__NEXT_DATA__ = {}; - window.next = {version: '13.3.2-canary.11'}; - test_framework_version("NextJS", '13.3'); -</script> -</body>
diff --git a/third_party/blink/web_tests/wpt_internal/framework-detection/detect-nextjs.html.ini b/third_party/blink/web_tests/wpt_internal/framework-detection/detect-nextjs.html.ini deleted file mode 100644 index 00ad837..0000000 --- a/third_party/blink/web_tests/wpt_internal/framework-detection/detect-nextjs.html.ini +++ /dev/null
@@ -1,4 +0,0 @@ -[detect-nextjs.html] - [Test framework version for NextJS (default)] - expected: - if product == "chrome": FAIL
diff --git a/third_party/blink/web_tests/wpt_internal/framework-detection/detect-vue2.html b/third_party/blink/web_tests/wpt_internal/framework-detection/detect-vue2.html deleted file mode 100644 index efc9e29..0000000 --- a/third_party/blink/web_tests/wpt_internal/framework-detection/detect-vue2.html +++ /dev/null
@@ -1,10 +0,0 @@ -<!DOCTYPE html> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<script src="resources/test-framework-version.js"></script> -<body> -<script> - window.Vue = {version: "2.1.2" }; - test_framework_version("Vue", "2.1"); -</script> -</body>
diff --git a/third_party/blink/web_tests/wpt_internal/framework-detection/detect-vue2.html.ini b/third_party/blink/web_tests/wpt_internal/framework-detection/detect-vue2.html.ini deleted file mode 100644 index 5e2eec3..0000000 --- a/third_party/blink/web_tests/wpt_internal/framework-detection/detect-vue2.html.ini +++ /dev/null
@@ -1,4 +0,0 @@ -[detect-vue2.html] - [Test framework version for Vue (default)] - expected: - if product == "chrome": FAIL
diff --git a/third_party/blink/web_tests/wpt_internal/framework-detection/detect-vue3.html b/third_party/blink/web_tests/wpt_internal/framework-detection/detect-vue3.html deleted file mode 100644 index d1f6be1..0000000 --- a/third_party/blink/web_tests/wpt_internal/framework-detection/detect-vue3.html +++ /dev/null
@@ -1,10 +0,0 @@ -<!DOCTYPE html> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<script src="resources/test-framework-version.js"></script> -<body> -<script> - window.__VUE__ = true; - test_framework_version("Vue", "3.0"); -</script> -</body>
diff --git a/third_party/blink/web_tests/wpt_internal/framework-detection/detect-vue3.html.ini b/third_party/blink/web_tests/wpt_internal/framework-detection/detect-vue3.html.ini deleted file mode 100644 index 7e44542..0000000 --- a/third_party/blink/web_tests/wpt_internal/framework-detection/detect-vue3.html.ini +++ /dev/null
@@ -1,4 +0,0 @@ -[detect-vue3.html] - [Test framework version for Vue (default)] - expected: - if product == "chrome": FAIL
diff --git a/third_party/blink/web_tests/wpt_internal/framework-detection/detect-wordpress.html b/third_party/blink/web_tests/wpt_internal/framework-detection/detect-wordpress.html deleted file mode 100644 index 8022396f..0000000 --- a/third_party/blink/web_tests/wpt_internal/framework-detection/detect-wordpress.html +++ /dev/null
@@ -1,10 +0,0 @@ -<!DOCTYPE html> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<script src="resources/test-framework-version.js"></script> -<meta name="generator" content="WordPress 6.2.3"></script> -<body> -<script> - test_framework_version("WordPress", '6.2'); -</script> -</body>
diff --git a/third_party/blink/web_tests/wpt_internal/framework-detection/detect-wordpress.html.ini b/third_party/blink/web_tests/wpt_internal/framework-detection/detect-wordpress.html.ini deleted file mode 100644 index a6dbd05..0000000 --- a/third_party/blink/web_tests/wpt_internal/framework-detection/detect-wordpress.html.ini +++ /dev/null
@@ -1,4 +0,0 @@ -[detect-wordpress.html] - [Test framework version for WordPress (default)] - expected: - if product == "chrome": FAIL
diff --git a/third_party/blink/web_tests/wpt_internal/framework-detection/not-detected-bad-values.html b/third_party/blink/web_tests/wpt_internal/framework-detection/not-detected-bad-values.html deleted file mode 100644 index 8b5bc41..0000000 --- a/third_party/blink/web_tests/wpt_internal/framework-detection/not-detected-bad-values.html +++ /dev/null
@@ -1,28 +0,0 @@ -<!DOCTYPE html> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<script> - -</script> -<body> - <div id="__next"></div> - <script> - -// Version should be a string -window.Vue = {version: 3 }; -window.__NEXT_DATA__ = {}; - -// next without "version" key -window.next = {ver_sion: '13.3.2-canary.11'}; - -promise_test(async t => { - const recorder = internals.initializeUKMRecorder(); - await new Promise(resolve => window.addEventListener("load", resolve)); - await new Promise(resolve => t.step_timeout(resolve)); - const entries = recorder.getMetrics( - "JavascriptFrameworkVersions", - ["NextJSVersion", "AngularVersion", "NuxtVersion", "VueVersion"]); - assert_equals(entries.length, 0); -}, "With semi-invalid indicators, no framework should be detected"); - </script> -</body>
diff --git a/third_party/blink/web_tests/wpt_internal/framework-detection/not-detected-bad-values.html.ini b/third_party/blink/web_tests/wpt_internal/framework-detection/not-detected-bad-values.html.ini deleted file mode 100644 index 557849a1..0000000 --- a/third_party/blink/web_tests/wpt_internal/framework-detection/not-detected-bad-values.html.ini +++ /dev/null
@@ -1,4 +0,0 @@ -[not-detected-bad-values.html] - [With semi-invalid indicators, no framework should be detected] - expected: - if product == "chrome": FAIL
diff --git a/third_party/blink/web_tests/wpt_internal/framework-detection/not-detected.html b/third_party/blink/web_tests/wpt_internal/framework-detection/not-detected.html deleted file mode 100644 index a8ce5b8..0000000 --- a/third_party/blink/web_tests/wpt_internal/framework-detection/not-detected.html +++ /dev/null
@@ -1,19 +0,0 @@ -<!DOCTYPE html> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> -<script> - -</script> -<body> - <script> -promise_test(async t => { - const recorder = internals.initializeUKMRecorder(); - await new Promise(resolve => window.addEventListener("load", resolve)); - await new Promise(resolve => t.step_timeout(resolve)); - const entries = recorder.getMetrics( - "JavascriptFrameworkVersions", - ["NextJSVersion", "AngularVersion", "NuxtVersion", "VueVersion"]); - assert_equals(entries.length, 0); -}, "By default, no framework should be detected"); - </script> -</body>
diff --git a/third_party/blink/web_tests/wpt_internal/framework-detection/not-detected.html.ini b/third_party/blink/web_tests/wpt_internal/framework-detection/not-detected.html.ini deleted file mode 100644 index 291097f..0000000 --- a/third_party/blink/web_tests/wpt_internal/framework-detection/not-detected.html.ini +++ /dev/null
@@ -1,4 +0,0 @@ -[not-detected.html] - [By default, no framework should be detected] - expected: - if product == "chrome": FAIL
diff --git a/third_party/blink/web_tests/wpt_internal/framework-detection/resources/test-framework-version.js b/third_party/blink/web_tests/wpt_internal/framework-detection/resources/test-framework-version.js deleted file mode 100644 index eb32460..0000000 --- a/third_party/blink/web_tests/wpt_internal/framework-detection/resources/test-framework-version.js +++ /dev/null
@@ -1,16 +0,0 @@ - -async function test_framework_version(framework, expected_decimal, variant = "default") { - promise_test(async t => { - const [major, minor] = expected_decimal.split('.').map(n => +n); - const framework_version = `${framework}Version`; - const recorder = internals.initializeUKMRecorder(); - await new Promise(resolve => window.addEventListener("load", resolve)); - await new Promise(resolve => t.step_timeout(resolve)); - const entries = recorder.getMetrics( - "Blink.JavaScriptFramework.Versions", [framework_version]); - console.log(JSON.stringify(entries)); - assert_equals(entries.length, 1); - const metrics = entries[0]; - assert_equals(metrics[framework_version], (major << 8) | minor); - }, `Test framework version for ${framework} (${variant})`); -}
diff --git a/third_party/closure_compiler/externs/file_manager_private.js b/third_party/closure_compiler/externs/file_manager_private.js index 17b52fc..fd361cae 100644 --- a/third_party/closure_compiler/externs/file_manager_private.js +++ b/third_party/closure_compiler/externs/file_manager_private.js
@@ -286,6 +286,7 @@ SYNC_STATUS: 'syncStatus', PROGRESS: 'progress', SHORTCUT: 'shortcut', + SYNC_COMPLETED_TIME: 'syncCompletedTime', }; /** @@ -533,7 +534,8 @@ * isArbitrarySyncFolder: (boolean|undefined), * syncStatus: (!chrome.fileManagerPrivate.SyncStatus|undefined), * progress: (number|undefined), - * shortcut: (boolean|undefined) + * shortcut: (boolean|undefined), + * syncCompletedTime: (number|undefined) * }} */ chrome.fileManagerPrivate.EntryProperties; @@ -1016,7 +1018,7 @@ * of MIME types and URLs may contain duplicates. Additionally, the list of MIME * types can be empty. |descriptor| The unique identifier of task to mark as * default. |entries| Array of selected entries to extract path extensions from. - * |mimeTypes| Array of selected file MIME types. |callback| +\ * |mimeTypes| Array of selected file MIME types. |callback| * @param {!chrome.fileManagerPrivate.FileTaskDescriptor} descriptor * @param {!Array<Entry>} entries * @param {!Array<string>} mimeTypes
diff --git a/third_party/material_web_components/BUILD.gn b/third_party/material_web_components/BUILD.gn index 5998e734..712abc9 100644 --- a/third_party/material_web_components/BUILD.gn +++ b/third_party/material_web_components/BUILD.gn
@@ -15,242 +15,189 @@ chrome_resources_dir = "${root_gen_dir}/ui/webui/resources/tsc/mwc" material_files = [ - "@material/web/dialog/lib/dialog-styles.css.js", + "@material/web/linearprogress/lib/linear-progress.js", + "@material/web/linearprogress/lib/linear-progress-styles.css.js", + "@material/web/linearprogress/linear-progress.js", "@material/web/dialog/lib/dialog.js", + "@material/web/dialog/lib/dialog-styles.css.js", "@material/web/dialog/dialog.js", "@material/web/icon/lib/icon.js", "@material/web/icon/lib/icon-styles.css.js", "@material/web/icon/icon.js", - "@material/web/badge/badge.js", - "@material/web/badge/lib/badge.js", "@material/web/badge/lib/badge-styles.css.js", - "@material/web/list/list-item-avatar.js", - "@material/web/list/list.js", - "@material/web/list/lib/icon/list-item-icon.js", - "@material/web/list/lib/icon/list-item-icon-styles.css.js", - "@material/web/list/lib/avatar/list-item-avatar.js", - "@material/web/list/lib/avatar/list-item-avatar-styles.css.js", - "@material/web/list/lib/list.js", - "@material/web/list/lib/image/list-item-image.js", - "@material/web/list/lib/image/list-item-image-styles.css.js", + "@material/web/badge/lib/badge.js", + "@material/web/badge/badge.js", + "@material/web/aria/delegate.js", + "@material/web/aria/aria.js", "@material/web/list/lib/listitemlink/list-item-link.js", - "@material/web/list/lib/video/list-item-video-styles.css.js", - "@material/web/list/lib/video/list-item-video.js", - "@material/web/list/lib/listitem/list-item-private-styles.css.js", "@material/web/list/lib/listitem/list-item-styles.css.js", + "@material/web/list/lib/listitem/forced-colors-styles.css.js", "@material/web/list/lib/listitem/list-item.js", + "@material/web/list/lib/list.js", "@material/web/list/lib/list-styles.css.js", - "@material/web/list/list-item-video.js", - "@material/web/list/list-item-link.js", - "@material/web/list/list-item-icon.js", - "@material/web/list/list-item-image.js", "@material/web/list/list-item.js", - "@material/web/segmentedbuttonset/lib/outlined-styles.css.js", - "@material/web/segmentedbuttonset/lib/segmented-button-set.js", - "@material/web/segmentedbuttonset/lib/outlined-segmented-button-set.js", + "@material/web/list/list.js", + "@material/web/list/list-item-link.js", "@material/web/segmentedbuttonset/lib/shared-styles.css.js", + "@material/web/segmentedbuttonset/lib/outlined-styles.css.js", + "@material/web/segmentedbuttonset/lib/outlined-segmented-button-set.js", + "@material/web/segmentedbuttonset/lib/segmented-button-set.js", "@material/web/segmentedbuttonset/outlined-segmented-button-set.js", + "@material/web/circularprogress/lib/circular-progress-styles.css.js", + "@material/web/circularprogress/lib/circular-progress.js", + "@material/web/circularprogress/circular-progress.js", "@material/web/motion/animation.js", - "@material/web/ripple/lib/ripple-styles.css.js", "@material/web/ripple/lib/ripple.js", - "@material/web/ripple/directive.js", + "@material/web/ripple/lib/ripple-styles.css.js", "@material/web/ripple/ripple.js", - "@material/web/divider/lib/divider-styles.css.js", + "@material/web/ripple/directive.js", "@material/web/divider/lib/divider.js", + "@material/web/divider/lib/divider-styles.css.js", "@material/web/divider/divider.js", - "@material/web/menu/menu.js", - "@material/web/menu/lib/menu.js", + "@material/web/menu/lib/types.js", "@material/web/menu/lib/menu-styles.css.js", - "@material/web/menu/lib/menuitem/menu-item-private-styles.css.js", - "@material/web/menu/lib/menuitem/menu-item.js", "@material/web/menu/lib/menuitem/menu-item-styles.css.js", + "@material/web/menu/lib/menuitem/forced-colors-styles.css.js", + "@material/web/menu/lib/menuitem/menu-item.js", + "@material/web/menu/lib/menu.js", + "@material/web/menu/lib/submenuitem/sub-menu-item.js", + "@material/web/menu/lib/forced-colors-styles.css.js", + "@material/web/menu/lib/surfacePositionController.js", "@material/web/menu/lib/shared.js", "@material/web/menu/lib/typeaheadController.js", - "@material/web/menu/lib/submenuitem/sub-menu-item.js", "@material/web/menu/lib/menuitemlink/menu-item-link.js", - "@material/web/menu/lib/types.js", - "@material/web/menu/lib/surfacePositionController.js", + "@material/web/menu/menu.js", "@material/web/menu/menu-item-link.js", "@material/web/menu/menu-item.js", "@material/web/menu/sub-menu-item.js", - "@material/web/chips/action/link-action.js", - "@material/web/chips/action/lib/link-action.js", - "@material/web/chips/action/lib/presentational-action.js", - "@material/web/chips/action/lib/events.js", - "@material/web/chips/action/lib/delete-action.js", - "@material/web/chips/action/lib/primary-action.js", - "@material/web/chips/action/lib/selectable-action.js", - "@material/web/chips/action/lib/action.js", - "@material/web/chips/action/lib/types.js", - "@material/web/chips/action/lib/constants.js", - "@material/web/chips/action/presentational-action.js", - "@material/web/chips/action/delete-action.js", - "@material/web/chips/action/primary-action.js", - "@material/web/chips/action/selectable-action.js", - "@material/web/chips/chipset/lib/foundation.js", - "@material/web/chips/chipset/lib/adapter.js", - "@material/web/chips/chipset/lib/types.js", - "@material/web/chips/chipset/lib/constants.js", - "@material/web/chips/chip/lib/selectable-chip.js", - "@material/web/chips/chip/lib/link-chip.js", - "@material/web/chips/chip/lib/action-chip.js", - "@material/web/chips/chip/lib/chip.js", - "@material/web/chips/chip/lib/foundation.js", - "@material/web/chips/chip/lib/adapter.js", - "@material/web/chips/chip/lib/types.js", - "@material/web/chips/chip/lib/animationframe.js", - "@material/web/chips/chip/lib/presentational-chip.js", - "@material/web/chips/chip/lib/constants.js", - "@material/web/segmentedbutton/lib/outlined-styles.css.js", + "@material/web/chips/lib/filter-styles.css.js", + "@material/web/chips/lib/elevated-styles.css.js", + "@material/web/chips/lib/filter-chip.js", + "@material/web/chips/lib/assist-styles.css.js", + "@material/web/chips/lib/assist-chip.js", + "@material/web/chips/lib/suggestion-chip.js", + "@material/web/chips/lib/shared-styles.css.js", + "@material/web/chips/lib/chip.js", + "@material/web/chips/lib/suggestion-styles.css.js", + "@material/web/chips/filter-chip.js", + "@material/web/chips/assist-chip.js", + "@material/web/chips/suggestion-chip.js", "@material/web/segmentedbutton/lib/shared-styles.css.js", - "@material/web/segmentedbutton/lib/segmented-button.js", "@material/web/segmentedbutton/lib/outlined-segmented-button.js", + "@material/web/segmentedbutton/lib/outlined-styles.css.js", + "@material/web/segmentedbutton/lib/segmented-button.js", "@material/web/segmentedbutton/outlined-segmented-button.js", - "@material/web/button/tonal-link-button.js", - "@material/web/button/elevated-link-button.js", - "@material/web/button/lib/button.js", - "@material/web/button/lib/tonal-link-button.js", - "@material/web/button/lib/outlined-styles.css.js", - "@material/web/button/lib/elevated-link-button.js", - "@material/web/button/lib/elevated-styles.css.js", - "@material/web/button/lib/tonal-styles.css.js", - "@material/web/button/lib/link-button.js", - "@material/web/button/lib/filled-styles.css.js", - "@material/web/button/lib/text-link-button.js", - "@material/web/button/lib/tonal-button.js", - "@material/web/button/lib/filled-button.js", - "@material/web/button/lib/state.js", - "@material/web/button/lib/filled-link-button.js", - "@material/web/button/lib/elevated-button.js", - "@material/web/button/lib/shared-styles.css.js", - "@material/web/button/lib/outlined-button.js", - "@material/web/button/lib/outlined-link-button.js", - "@material/web/button/lib/shared-elevation-styles.css.js", - "@material/web/button/lib/text-styles.css.js", - "@material/web/button/lib/text-button.js", - "@material/web/button/text-link-button.js", - "@material/web/button/tonal-button.js", - "@material/web/button/filled-button.js", - "@material/web/button/filled-link-button.js", - "@material/web/button/elevated-button.js", + "@material/web/slider/lib/slider-styles.css.js", + "@material/web/slider/lib/forced-colors-styles.css.js", + "@material/web/slider/lib/slider.js", + "@material/web/slider/slider.js", "@material/web/button/outlined-button.js", - "@material/web/button/outlined-link-button.js", + "@material/web/button/lib/elevated-styles.css.js", + "@material/web/button/lib/outlined-button.js", + "@material/web/button/lib/filled-styles.css.js", + "@material/web/button/lib/button.js", + "@material/web/button/lib/filled-button.js", + "@material/web/button/lib/shared-styles.css.js", + "@material/web/button/lib/shared-elevation-styles.css.js", + "@material/web/button/lib/elevated-button.js", + "@material/web/button/lib/text-styles.css.js", + "@material/web/button/lib/outlined-styles.css.js", + "@material/web/button/lib/tonal-button.js", + "@material/web/button/lib/tonal-styles.css.js", + "@material/web/button/lib/text-button.js", + "@material/web/button/filled-button.js", + "@material/web/button/elevated-button.js", + "@material/web/button/tonal-button.js", "@material/web/button/text-button.js", - "@material/web/menusurface/lib/menu-surface.js", - "@material/web/menusurface/lib/foundation.js", - "@material/web/menusurface/lib/menu-surface-styles.css.js", - "@material/web/menusurface/lib/adapter.js", - "@material/web/menusurface/lib/types.js", - "@material/web/menusurface/lib/constants.js", - "@material/web/menusurface/menu-surface.js", - "@material/web/tokens/v0_152/index.test.css.js", - "@material/web/tokens/v0_152/lib.test.css.js", + "@material/web/tokens/v0_172/index.test.css.js", + "@material/web/tokens/v0_172/lib.test.css.js", "@material/web/localization/localize.js", - "@material/web/focus/strong-focus.js", - "@material/web/focus/lib/focus-ring-styles.css.js", "@material/web/focus/lib/focus-ring.js", + "@material/web/focus/lib/focus-ring-styles.css.js", "@material/web/focus/focus-ring.js", - "@material/web/controller/events.js", - "@material/web/controller/action-controller.js", - "@material/web/controller/observer.js", - "@material/web/controller/observer-foundation.js", - "@material/web/controller/foundation.js", "@material/web/controller/form-associated.js", + "@material/web/controller/events.js", + "@material/web/controller/is-rtl.js", "@material/web/controller/form-controller.js", "@material/web/controller/string-converter.js", - "@material/web/controller/is-rtl.js", "@material/web/controller/shim-label-activation.js", - "@material/web/switch/lib/switch-styles.css.js", - "@material/web/switch/lib/switch.js", "@material/web/switch/switch.js", - "@material/web/textfield/lib/outlined-styles.css.js", + "@material/web/switch/lib/switch.js", + "@material/web/switch/lib/switch-styles.css.js", + "@material/web/textfield/filled-text-field.js", + "@material/web/textfield/outlined-text-field.js", + "@material/web/textfield/lib/filled-text-field.js", "@material/web/textfield/lib/outlined-text-field.js", "@material/web/textfield/lib/filled-styles.css.js", "@material/web/textfield/lib/outlined-forced-colors-styles.css.js", - "@material/web/textfield/lib/shared-styles.css.js", - "@material/web/textfield/lib/filled-text-field.js", "@material/web/textfield/lib/filled-forced-colors-styles.css.js", + "@material/web/textfield/lib/shared-styles.css.js", + "@material/web/textfield/lib/outlined-styles.css.js", "@material/web/textfield/lib/text-field.js", - "@material/web/textfield/outlined-text-field.js", - "@material/web/textfield/filled-text-field.js", - "@material/web/decorators/aria-property.js", - "@material/web/decorators/bound.js", - "@material/web/navigationdrawer/navigation-drawer.js", - "@material/web/navigationdrawer/lib/navigation-drawer.js", - "@material/web/navigationdrawer/lib/navigation-drawer-styles.css.js", "@material/web/navigationdrawer/lib/navigation-drawer-modal.js", - "@material/web/navigationdrawer/lib/navigation-drawer-modal-styles.css.js", + "@material/web/navigationdrawer/lib/navigation-drawer.js", "@material/web/navigationdrawer/lib/shared-styles.css.js", + "@material/web/navigationdrawer/lib/navigation-drawer-modal-styles.css.js", + "@material/web/navigationdrawer/lib/navigation-drawer-styles.css.js", "@material/web/navigationdrawer/navigation-drawer-modal.js", - "@material/web/fab/lib/fab-shared-styles.css.js", - "@material/web/fab/lib/fab-extended.js", - "@material/web/fab/lib/fab-extended-styles.css.js", - "@material/web/fab/lib/fab.js", - "@material/web/fab/lib/fab-shared.js", + "@material/web/navigationdrawer/navigation-drawer.js", "@material/web/fab/lib/fab-styles.css.js", - "@material/web/fab/fab-extended.js", + "@material/web/fab/lib/shared-styles.css.js", + "@material/web/fab/lib/fab.js", + "@material/web/fab/lib/fab-branded-styles.css.js", + "@material/web/fab/lib/forced-colors-styles.css.js", + "@material/web/fab/lib/shared.js", "@material/web/fab/fab.js", - "@material/web/elevation/lib/elevation-styles.css.js", - "@material/web/elevation/lib/elevation.js", + "@material/web/fab/branded-fab.js", "@material/web/elevation/elevation.js", - "@material/web/checkbox/checkbox.js", - "@material/web/checkbox/lib/checkbox.js", - "@material/web/checkbox/lib/forced-colors-styles.css.js", + "@material/web/elevation/lib/elevation.js", + "@material/web/elevation/lib/elevation-styles.css.js", "@material/web/checkbox/lib/checkbox-styles.css.js", - "@material/web/field/outlined-field.js", - "@material/web/field/lib/outlined-styles.css.js", - "@material/web/field/lib/outlined-field.js", - "@material/web/field/lib/filled-field.js", + "@material/web/checkbox/lib/forced-colors-styles.css.js", + "@material/web/checkbox/lib/checkbox.js", + "@material/web/checkbox/checkbox.js", "@material/web/field/lib/filled-styles.css.js", - "@material/web/field/lib/field.js", + "@material/web/field/lib/outlined-field.js", "@material/web/field/lib/shared-styles.css.js", + "@material/web/field/lib/outlined-styles.css.js", + "@material/web/field/lib/filled-field.js", + "@material/web/field/lib/field.js", + "@material/web/field/outlined-field.js", "@material/web/field/filled-field.js", - "@material/web/iconbutton/outlined-icon-button-toggle.js", + "@material/web/iconbutton/lib/filled-tonal-styles.css.js", + "@material/web/iconbutton/lib/filled-styles.css.js", + "@material/web/iconbutton/lib/shared-styles.css.js", + "@material/web/iconbutton/lib/standard-styles.css.js", "@material/web/iconbutton/lib/outlined-styles.css.js", "@material/web/iconbutton/lib/icon-button.js", - "@material/web/iconbutton/lib/filled-styles.css.js", - "@material/web/iconbutton/lib/link-icon-button.js", - "@material/web/iconbutton/lib/standard-styles.css.js", - "@material/web/iconbutton/lib/icon-button-toggle.js", - "@material/web/iconbutton/lib/shared-styles.css.js", - "@material/web/iconbutton/lib/filled-tonal-styles.css.js", - "@material/web/iconbutton/filled-link-icon-button.js", - "@material/web/iconbutton/outlined-link-icon-button.js", - "@material/web/iconbutton/standard-icon-button-toggle.js", - "@material/web/iconbutton/standard-link-icon-button.js", - "@material/web/iconbutton/filled-icon-button.js", - "@material/web/iconbutton/filled-tonal-icon-button-toggle.js", - "@material/web/iconbutton/filled-tonal-link-icon-button.js", - "@material/web/iconbutton/filled-icon-button-toggle.js", - "@material/web/iconbutton/outlined-icon-button.js", "@material/web/iconbutton/standard-icon-button.js", + "@material/web/iconbutton/filled-icon-button.js", + "@material/web/iconbutton/outlined-icon-button.js", "@material/web/iconbutton/filled-tonal-icon-button.js", - "@material/web/autocomplete/outlined-autocomplete.js", - "@material/web/autocomplete/lib/autocompletesurface/autocomplete-surface-styles.css.js", - "@material/web/autocomplete/lib/autocompletesurface/autocomplete-surface.js", - "@material/web/autocomplete/lib/outlined-styles.css.js", - "@material/web/autocomplete/lib/autocompleteitem/autocomplete-item.js", - "@material/web/autocomplete/lib/autocompletelist/autocomplete-list.js", - "@material/web/autocomplete/lib/autocompletelist/autocomplete-list-styles.css.js", - "@material/web/autocomplete/lib/filled-styles.css.js", - "@material/web/autocomplete/lib/autocomplete.js", - "@material/web/autocomplete/lib/shared-styles.css.js", - "@material/web/autocomplete/autocomplete-list.js", - "@material/web/autocomplete/autocomplete-surface.js", - "@material/web/autocomplete/autocomplete-item.js", - "@material/web/autocomplete/filled-autocomplete.js", + "@material/web/select/filled-select.js", + "@material/web/select/lib/filled-select.js", + "@material/web/select/lib/outlined-forced-colors-styles.css.js", + "@material/web/select/lib/outlined-select-styles.css.js", + "@material/web/select/lib/filled-forced-colors-styles.css.js", + "@material/web/select/lib/shared-styles.css.js", + "@material/web/select/lib/outlined-select.js", + "@material/web/select/lib/select.js", + "@material/web/select/lib/shared.js", + "@material/web/select/lib/filled-select-styles.css.js", + "@material/web/select/lib/selectoption/select-option.js", + "@material/web/select/outlined-select.js", + "@material/web/select/select-option.js", + "@material/web/navigationbar/lib/state.js", "@material/web/navigationbar/lib/navigation-bar-styles.css.js", "@material/web/navigationbar/lib/navigation-bar.js", - "@material/web/navigationbar/lib/state.js", "@material/web/navigationbar/lib/constants.js", "@material/web/navigationbar/navigation-bar.js", - "@material/web/actionelement/action-element.js", - "@material/web/navigationtab/lib/navigation-tab-styles.css.js", - "@material/web/navigationtab/lib/state.js", "@material/web/navigationtab/lib/navigation-tab.js", + "@material/web/navigationtab/lib/state.js", + "@material/web/navigationtab/lib/navigation-tab-styles.css.js", "@material/web/navigationtab/navigation-tab.js", - "@material/web/radio/lib/forced-colors-styles.css.js", "@material/web/radio/lib/single-selection-controller.js", + "@material/web/radio/lib/forced-colors-styles.css.js", "@material/web/radio/lib/radio.js", "@material/web/radio/lib/radio-styles.css.js", "@material/web/radio/radio.js", @@ -356,6 +303,10 @@ "components-chromium/node_modules/@lit/reactive-element/decorators/custom-element.d.ts", "components-chromium/node_modules/@lit/reactive-element/reactive-controller.d.ts", "components-chromium/node_modules/@lit/reactive-element/css-tag.d.ts", + "components-chromium/node_modules/@material/web/linearprogress/lib/linear-progress-styles.css.d.ts", + "components-chromium/node_modules/@material/web/linearprogress/lib/linear-progress.d.ts", + "components-chromium/node_modules/@material/web/linearprogress/linear-progress.d.ts", + "components-chromium/node_modules/@material/web/linearprogress/harness.d.ts", "components-chromium/node_modules/@material/web/dialog/lib/dialog-styles.css.d.ts", "components-chromium/node_modules/@material/web/dialog/lib/dialog.d.ts", "components-chromium/node_modules/@material/web/dialog/dialog.d.ts", @@ -366,27 +317,17 @@ "components-chromium/node_modules/@material/web/badge/badge.d.ts", "components-chromium/node_modules/@material/web/badge/lib/badge.d.ts", "components-chromium/node_modules/@material/web/badge/lib/badge-styles.css.d.ts", - "components-chromium/node_modules/@material/web/list/list-item-avatar.d.ts", + "components-chromium/node_modules/@material/web/aria/delegate.d.ts", + "components-chromium/node_modules/@material/web/aria/aria.d.ts", "components-chromium/node_modules/@material/web/list/list.d.ts", - "components-chromium/node_modules/@material/web/list/lib/icon/list-item-icon.d.ts", - "components-chromium/node_modules/@material/web/list/lib/icon/list-item-icon-styles.css.d.ts", - "components-chromium/node_modules/@material/web/list/lib/avatar/list-item-avatar.d.ts", - "components-chromium/node_modules/@material/web/list/lib/avatar/list-item-avatar-styles.css.d.ts", "components-chromium/node_modules/@material/web/list/lib/list.d.ts", - "components-chromium/node_modules/@material/web/list/lib/image/list-item-image.d.ts", - "components-chromium/node_modules/@material/web/list/lib/image/list-item-image-styles.css.d.ts", "components-chromium/node_modules/@material/web/list/lib/listitemlink/list-item-link.d.ts", - "components-chromium/node_modules/@material/web/list/lib/video/list-item-video-styles.css.d.ts", - "components-chromium/node_modules/@material/web/list/lib/video/list-item-video.d.ts", - "components-chromium/node_modules/@material/web/list/lib/listitem/list-item-private-styles.css.d.ts", + "components-chromium/node_modules/@material/web/list/lib/listitem/forced-colors-styles.css.d.ts", "components-chromium/node_modules/@material/web/list/lib/listitem/list-item-styles.css.d.ts", "components-chromium/node_modules/@material/web/list/lib/listitem/harness.d.ts", "components-chromium/node_modules/@material/web/list/lib/listitem/list-item.d.ts", "components-chromium/node_modules/@material/web/list/lib/list-styles.css.d.ts", - "components-chromium/node_modules/@material/web/list/list-item-video.d.ts", "components-chromium/node_modules/@material/web/list/list-item-link.d.ts", - "components-chromium/node_modules/@material/web/list/list-item-icon.d.ts", - "components-chromium/node_modules/@material/web/list/list-item-image.d.ts", "components-chromium/node_modules/@material/web/list/harness.d.ts", "components-chromium/node_modules/@material/web/list/list-item.d.ts", "components-chromium/node_modules/@material/web/segmentedbuttonset/lib/outlined-styles.css.d.ts", @@ -394,6 +335,10 @@ "components-chromium/node_modules/@material/web/segmentedbuttonset/lib/outlined-segmented-button-set.d.ts", "components-chromium/node_modules/@material/web/segmentedbuttonset/lib/shared-styles.css.d.ts", "components-chromium/node_modules/@material/web/segmentedbuttonset/outlined-segmented-button-set.d.ts", + "components-chromium/node_modules/@material/web/circularprogress/lib/circular-progress-styles.css.d.ts", + "components-chromium/node_modules/@material/web/circularprogress/lib/circular-progress.d.ts", + "components-chromium/node_modules/@material/web/circularprogress/circular-progress.d.ts", + "components-chromium/node_modules/@material/web/circularprogress/harness.d.ts", "components-chromium/node_modules/@material/web/motion/animation.d.ts", "components-chromium/node_modules/@material/web/ripple/lib/ripple-styles.css.d.ts", "components-chromium/node_modules/@material/web/ripple/lib/ripple.d.ts", @@ -405,10 +350,11 @@ "components-chromium/node_modules/@material/web/menu/menu.d.ts", "components-chromium/node_modules/@material/web/menu/lib/menu.d.ts", "components-chromium/node_modules/@material/web/menu/lib/menu-styles.css.d.ts", - "components-chromium/node_modules/@material/web/menu/lib/menuitem/menu-item-private-styles.css.d.ts", + "components-chromium/node_modules/@material/web/menu/lib/menuitem/forced-colors-styles.css.d.ts", "components-chromium/node_modules/@material/web/menu/lib/menuitem/menu-item.d.ts", "components-chromium/node_modules/@material/web/menu/lib/menuitem/menu-item-styles.css.d.ts", "components-chromium/node_modules/@material/web/menu/lib/menuitem/harness.d.ts", + "components-chromium/node_modules/@material/web/menu/lib/forced-colors-styles.css.d.ts", "components-chromium/node_modules/@material/web/menu/lib/shared.d.ts", "components-chromium/node_modules/@material/web/menu/lib/typeaheadController.d.ts", "components-chromium/node_modules/@material/web/menu/lib/submenuitem/sub-menu-item.d.ts", @@ -420,89 +366,54 @@ "components-chromium/node_modules/@material/web/menu/menu-item.d.ts", "components-chromium/node_modules/@material/web/menu/sub-menu-item.d.ts", "components-chromium/node_modules/@material/web/menu/harness.d.ts", - "components-chromium/node_modules/@material/web/chips/action/link-action.d.ts", - "components-chromium/node_modules/@material/web/chips/action/lib/link-action.d.ts", - "components-chromium/node_modules/@material/web/chips/action/lib/presentational-action.d.ts", - "components-chromium/node_modules/@material/web/chips/action/lib/events.d.ts", - "components-chromium/node_modules/@material/web/chips/action/lib/delete-action.d.ts", - "components-chromium/node_modules/@material/web/chips/action/lib/primary-action.d.ts", - "components-chromium/node_modules/@material/web/chips/action/lib/selectable-action.d.ts", - "components-chromium/node_modules/@material/web/chips/action/lib/action.d.ts", - "components-chromium/node_modules/@material/web/chips/action/lib/types.d.ts", - "components-chromium/node_modules/@material/web/chips/action/lib/constants.d.ts", - "components-chromium/node_modules/@material/web/chips/action/presentational-action.d.ts", - "components-chromium/node_modules/@material/web/chips/action/delete-action.d.ts", - "components-chromium/node_modules/@material/web/chips/action/primary-action.d.ts", - "components-chromium/node_modules/@material/web/chips/action/selectable-action.d.ts", - "components-chromium/node_modules/@material/web/chips/chipset/lib/foundation.d.ts", - "components-chromium/node_modules/@material/web/chips/chipset/lib/adapter.d.ts", - "components-chromium/node_modules/@material/web/chips/chipset/lib/types.d.ts", - "components-chromium/node_modules/@material/web/chips/chipset/lib/constants.d.ts", - "components-chromium/node_modules/@material/web/chips/chip/lib/selectable-chip.d.ts", - "components-chromium/node_modules/@material/web/chips/chip/lib/link-chip.d.ts", - "components-chromium/node_modules/@material/web/chips/chip/lib/action-chip.d.ts", - "components-chromium/node_modules/@material/web/chips/chip/lib/chip.d.ts", - "components-chromium/node_modules/@material/web/chips/chip/lib/foundation.d.ts", - "components-chromium/node_modules/@material/web/chips/chip/lib/adapter.d.ts", - "components-chromium/node_modules/@material/web/chips/chip/lib/types.d.ts", - "components-chromium/node_modules/@material/web/chips/chip/lib/animationframe.d.ts", - "components-chromium/node_modules/@material/web/chips/chip/lib/presentational-chip.d.ts", - "components-chromium/node_modules/@material/web/chips/chip/lib/constants.d.ts", + "components-chromium/node_modules/@material/web/chips/filter-chip.d.ts", + "components-chromium/node_modules/@material/web/chips/lib/filter-chip.d.ts", + "components-chromium/node_modules/@material/web/chips/lib/elevated-styles.css.d.ts", + "components-chromium/node_modules/@material/web/chips/lib/suggestion-styles.css.d.ts", + "components-chromium/node_modules/@material/web/chips/lib/suggestion-chip.d.ts", + "components-chromium/node_modules/@material/web/chips/lib/shared-styles.css.d.ts", + "components-chromium/node_modules/@material/web/chips/lib/chip.d.ts", + "components-chromium/node_modules/@material/web/chips/lib/assist-chip.d.ts", + "components-chromium/node_modules/@material/web/chips/lib/assist-styles.css.d.ts", + "components-chromium/node_modules/@material/web/chips/lib/filter-styles.css.d.ts", + "components-chromium/node_modules/@material/web/chips/suggestion-chip.d.ts", + "components-chromium/node_modules/@material/web/chips/assist-chip.d.ts", "components-chromium/node_modules/@material/web/segmentedbutton/lib/outlined-styles.css.d.ts", "components-chromium/node_modules/@material/web/segmentedbutton/lib/shared-styles.css.d.ts", "components-chromium/node_modules/@material/web/segmentedbutton/lib/segmented-button.d.ts", "components-chromium/node_modules/@material/web/segmentedbutton/lib/outlined-segmented-button.d.ts", "components-chromium/node_modules/@material/web/segmentedbutton/outlined-segmented-button.d.ts", - "components-chromium/node_modules/@material/web/button/tonal-link-button.d.ts", - "components-chromium/node_modules/@material/web/button/elevated-link-button.d.ts", + "components-chromium/node_modules/@material/web/slider/lib/forced-colors-styles.css.d.ts", + "components-chromium/node_modules/@material/web/slider/lib/slider-styles.css.d.ts", + "components-chromium/node_modules/@material/web/slider/lib/slider.d.ts", + "components-chromium/node_modules/@material/web/slider/harness.d.ts", + "components-chromium/node_modules/@material/web/slider/slider.d.ts", "components-chromium/node_modules/@material/web/button/lib/button.d.ts", - "components-chromium/node_modules/@material/web/button/lib/tonal-link-button.d.ts", "components-chromium/node_modules/@material/web/button/lib/outlined-styles.css.d.ts", - "components-chromium/node_modules/@material/web/button/lib/elevated-link-button.d.ts", "components-chromium/node_modules/@material/web/button/lib/elevated-styles.css.d.ts", "components-chromium/node_modules/@material/web/button/lib/tonal-styles.css.d.ts", - "components-chromium/node_modules/@material/web/button/lib/link-button.d.ts", "components-chromium/node_modules/@material/web/button/lib/filled-styles.css.d.ts", - "components-chromium/node_modules/@material/web/button/lib/text-link-button.d.ts", "components-chromium/node_modules/@material/web/button/lib/tonal-button.d.ts", "components-chromium/node_modules/@material/web/button/lib/filled-button.d.ts", - "components-chromium/node_modules/@material/web/button/lib/state.d.ts", - "components-chromium/node_modules/@material/web/button/lib/filled-link-button.d.ts", "components-chromium/node_modules/@material/web/button/lib/elevated-button.d.ts", "components-chromium/node_modules/@material/web/button/lib/shared-styles.css.d.ts", "components-chromium/node_modules/@material/web/button/lib/outlined-button.d.ts", - "components-chromium/node_modules/@material/web/button/lib/outlined-link-button.d.ts", "components-chromium/node_modules/@material/web/button/lib/shared-elevation-styles.css.d.ts", "components-chromium/node_modules/@material/web/button/lib/text-styles.css.d.ts", "components-chromium/node_modules/@material/web/button/lib/text-button.d.ts", - "components-chromium/node_modules/@material/web/button/text-link-button.d.ts", "components-chromium/node_modules/@material/web/button/tonal-button.d.ts", "components-chromium/node_modules/@material/web/button/filled-button.d.ts", - "components-chromium/node_modules/@material/web/button/filled-link-button.d.ts", "components-chromium/node_modules/@material/web/button/elevated-button.d.ts", "components-chromium/node_modules/@material/web/button/outlined-button.d.ts", - "components-chromium/node_modules/@material/web/button/outlined-link-button.d.ts", "components-chromium/node_modules/@material/web/button/harness.d.ts", "components-chromium/node_modules/@material/web/button/text-button.d.ts", - "components-chromium/node_modules/@material/web/menusurface/lib/menu-surface.d.ts", - "components-chromium/node_modules/@material/web/menusurface/lib/foundation.d.ts", - "components-chromium/node_modules/@material/web/menusurface/lib/menu-surface-styles.css.d.ts", - "components-chromium/node_modules/@material/web/menusurface/lib/adapter.d.ts", - "components-chromium/node_modules/@material/web/menusurface/lib/types.d.ts", - "components-chromium/node_modules/@material/web/menusurface/lib/constants.d.ts", - "components-chromium/node_modules/@material/web/menusurface/menu-surface.d.ts", - "components-chromium/node_modules/@material/web/tokens/v0_152/index.test.css.d.ts", - "components-chromium/node_modules/@material/web/tokens/v0_152/lib.test.css.d.ts", + "components-chromium/node_modules/@material/web/tokens/v0_172/index.test.css.d.ts", + "components-chromium/node_modules/@material/web/tokens/v0_172/lib.test.css.d.ts", "components-chromium/node_modules/@material/web/localization/localize.d.ts", - "components-chromium/node_modules/@material/web/focus/strong-focus.d.ts", "components-chromium/node_modules/@material/web/focus/lib/focus-ring-styles.css.d.ts", "components-chromium/node_modules/@material/web/focus/lib/focus-ring.d.ts", "components-chromium/node_modules/@material/web/focus/focus-ring.d.ts", "components-chromium/node_modules/@material/web/controller/events.d.ts", - "components-chromium/node_modules/@material/web/controller/action-controller.d.ts", - "components-chromium/node_modules/@material/web/controller/observer.d.ts", - "components-chromium/node_modules/@material/web/controller/observer-foundation.d.ts", - "components-chromium/node_modules/@material/web/controller/foundation.d.ts", "components-chromium/node_modules/@material/web/controller/form-associated.d.ts", "components-chromium/node_modules/@material/web/controller/form-controller.d.ts", "components-chromium/node_modules/@material/web/controller/string-converter.d.ts", @@ -523,8 +434,6 @@ "components-chromium/node_modules/@material/web/textfield/outlined-text-field.d.ts", "components-chromium/node_modules/@material/web/textfield/filled-text-field.d.ts", "components-chromium/node_modules/@material/web/textfield/harness.d.ts", - "components-chromium/node_modules/@material/web/decorators/aria-property.d.ts", - "components-chromium/node_modules/@material/web/decorators/bound.d.ts", "components-chromium/node_modules/@material/web/navigationdrawer/navigation-drawer.d.ts", "components-chromium/node_modules/@material/web/navigationdrawer/lib/navigation-drawer.d.ts", "components-chromium/node_modules/@material/web/navigationdrawer/lib/navigation-drawer-styles.css.d.ts", @@ -532,13 +441,13 @@ "components-chromium/node_modules/@material/web/navigationdrawer/lib/navigation-drawer-modal-styles.css.d.ts", "components-chromium/node_modules/@material/web/navigationdrawer/lib/shared-styles.css.d.ts", "components-chromium/node_modules/@material/web/navigationdrawer/navigation-drawer-modal.d.ts", - "components-chromium/node_modules/@material/web/fab/lib/fab-shared-styles.css.d.ts", - "components-chromium/node_modules/@material/web/fab/lib/fab-extended.d.ts", - "components-chromium/node_modules/@material/web/fab/lib/fab-extended-styles.css.d.ts", + "components-chromium/node_modules/@material/web/fab/branded-fab.d.ts", + "components-chromium/node_modules/@material/web/fab/lib/forced-colors-styles.css.d.ts", + "components-chromium/node_modules/@material/web/fab/lib/shared.d.ts", "components-chromium/node_modules/@material/web/fab/lib/fab.d.ts", - "components-chromium/node_modules/@material/web/fab/lib/fab-shared.d.ts", + "components-chromium/node_modules/@material/web/fab/lib/shared-styles.css.d.ts", + "components-chromium/node_modules/@material/web/fab/lib/fab-branded-styles.css.d.ts", "components-chromium/node_modules/@material/web/fab/lib/fab-styles.css.d.ts", - "components-chromium/node_modules/@material/web/fab/fab-extended.d.ts", "components-chromium/node_modules/@material/web/fab/fab.d.ts", "components-chromium/node_modules/@material/web/fab/harness.d.ts", "components-chromium/node_modules/@material/web/elevation/lib/elevation-styles.css.d.ts", @@ -558,50 +467,38 @@ "components-chromium/node_modules/@material/web/field/lib/shared-styles.css.d.ts", "components-chromium/node_modules/@material/web/field/filled-field.d.ts", "components-chromium/node_modules/@material/web/field/harness.d.ts", - "components-chromium/node_modules/@material/web/iconbutton/outlined-icon-button-toggle.d.ts", "components-chromium/node_modules/@material/web/iconbutton/lib/outlined-styles.css.d.ts", "components-chromium/node_modules/@material/web/iconbutton/lib/icon-button.d.ts", "components-chromium/node_modules/@material/web/iconbutton/lib/filled-styles.css.d.ts", - "components-chromium/node_modules/@material/web/iconbutton/lib/link-icon-button.d.ts", "components-chromium/node_modules/@material/web/iconbutton/lib/standard-styles.css.d.ts", - "components-chromium/node_modules/@material/web/iconbutton/lib/icon-button-toggle.d.ts", "components-chromium/node_modules/@material/web/iconbutton/lib/shared-styles.css.d.ts", "components-chromium/node_modules/@material/web/iconbutton/lib/filled-tonal-styles.css.d.ts", - "components-chromium/node_modules/@material/web/iconbutton/filled-link-icon-button.d.ts", - "components-chromium/node_modules/@material/web/iconbutton/outlined-link-icon-button.d.ts", - "components-chromium/node_modules/@material/web/iconbutton/standard-icon-button-toggle.d.ts", - "components-chromium/node_modules/@material/web/iconbutton/standard-link-icon-button.d.ts", "components-chromium/node_modules/@material/web/iconbutton/filled-icon-button.d.ts", - "components-chromium/node_modules/@material/web/iconbutton/filled-tonal-icon-button-toggle.d.ts", - "components-chromium/node_modules/@material/web/iconbutton/filled-tonal-link-icon-button.d.ts", - "components-chromium/node_modules/@material/web/iconbutton/filled-icon-button-toggle.d.ts", "components-chromium/node_modules/@material/web/iconbutton/outlined-icon-button.d.ts", "components-chromium/node_modules/@material/web/iconbutton/standard-icon-button.d.ts", "components-chromium/node_modules/@material/web/iconbutton/harness.d.ts", "components-chromium/node_modules/@material/web/iconbutton/filled-tonal-icon-button.d.ts", - "components-chromium/node_modules/@material/web/autocomplete/outlined-autocomplete.d.ts", - "components-chromium/node_modules/@material/web/autocomplete/lib/autocompletesurface/autocomplete-surface-styles.css.d.ts", - "components-chromium/node_modules/@material/web/autocomplete/lib/autocompletesurface/autocomplete-surface.d.ts", - "components-chromium/node_modules/@material/web/autocomplete/lib/outlined-styles.css.d.ts", - "components-chromium/node_modules/@material/web/autocomplete/lib/autocompleteitem/autocomplete-item.d.ts", - "components-chromium/node_modules/@material/web/autocomplete/lib/autocompleteitem/harness.d.ts", - "components-chromium/node_modules/@material/web/autocomplete/lib/autocompletelist/autocomplete-list.d.ts", - "components-chromium/node_modules/@material/web/autocomplete/lib/autocompletelist/harness.d.ts", - "components-chromium/node_modules/@material/web/autocomplete/lib/autocompletelist/autocomplete-list-styles.css.d.ts", - "components-chromium/node_modules/@material/web/autocomplete/lib/filled-styles.css.d.ts", - "components-chromium/node_modules/@material/web/autocomplete/lib/autocomplete.d.ts", - "components-chromium/node_modules/@material/web/autocomplete/lib/shared-styles.css.d.ts", - "components-chromium/node_modules/@material/web/autocomplete/autocomplete-list.d.ts", - "components-chromium/node_modules/@material/web/autocomplete/autocomplete-surface.d.ts", - "components-chromium/node_modules/@material/web/autocomplete/autocomplete-item.d.ts", - "components-chromium/node_modules/@material/web/autocomplete/filled-autocomplete.d.ts", + "components-chromium/node_modules/@material/web/select/lib/filled-select-styles.css.d.ts", + "components-chromium/node_modules/@material/web/select/lib/outlined-forced-colors-styles.css.d.ts", + "components-chromium/node_modules/@material/web/select/lib/shared.d.ts", + "components-chromium/node_modules/@material/web/select/lib/outlined-select-styles.css.d.ts", + "components-chromium/node_modules/@material/web/select/lib/select.d.ts", + "components-chromium/node_modules/@material/web/select/lib/outlined-select.d.ts", + "components-chromium/node_modules/@material/web/select/lib/filled-select.d.ts", + "components-chromium/node_modules/@material/web/select/lib/shared-styles.css.d.ts", + "components-chromium/node_modules/@material/web/select/lib/filled-forced-colors-styles.css.d.ts", + "components-chromium/node_modules/@material/web/select/lib/selectoption/harness.d.ts", + "components-chromium/node_modules/@material/web/select/lib/selectoption/select-option.d.ts", + "components-chromium/node_modules/@material/web/select/outlined-select.d.ts", + "components-chromium/node_modules/@material/web/select/filled-select.d.ts", + "components-chromium/node_modules/@material/web/select/harness.d.ts", + "components-chromium/node_modules/@material/web/select/select-option.d.ts", "components-chromium/node_modules/@material/web/navigationbar/lib/navigation-bar-styles.css.d.ts", "components-chromium/node_modules/@material/web/navigationbar/lib/navigation-bar.d.ts", "components-chromium/node_modules/@material/web/navigationbar/lib/state.d.ts", "components-chromium/node_modules/@material/web/navigationbar/lib/constants.d.ts", "components-chromium/node_modules/@material/web/navigationbar/navigation-bar.d.ts", "components-chromium/node_modules/@material/web/navigationbar/harness.d.ts", - "components-chromium/node_modules/@material/web/actionelement/action-element.d.ts", "components-chromium/node_modules/@material/web/types/keys.d.ts", "components-chromium/node_modules/@material/web/types/aria.d.ts", "components-chromium/node_modules/@material/web/navigationtab/lib/navigation-tab-styles.css.d.ts", @@ -618,6 +515,57 @@ "components-chromium/node_modules/lit-element/index.d.ts", "components-chromium/node_modules/lit-element/lit-element.d.ts", "components-chromium/node_modules/lit-element/decorators.d.ts", + "components-chromium/node_modules/safevalues/index.d.ts", + "components-chromium/node_modules/safevalues/environment/dev.d.ts", + "components-chromium/node_modules/safevalues/builders/style_sheet_builders.d.ts", + "components-chromium/node_modules/safevalues/builders/html_sanitizer/html_sanitizer_builder.d.ts", + "components-chromium/node_modules/safevalues/builders/html_sanitizer/no_clobber.d.ts", + "components-chromium/node_modules/safevalues/builders/html_sanitizer/html_sanitizer.d.ts", + "components-chromium/node_modules/safevalues/builders/html_sanitizer/inert_fragment.d.ts", + "components-chromium/node_modules/safevalues/builders/html_sanitizer/sanitizer_table/sanitizer_table.d.ts", + "components-chromium/node_modules/safevalues/builders/html_sanitizer/sanitizer_table/default_sanitizer_table.d.ts", + "components-chromium/node_modules/safevalues/builders/sensitive_attributes.d.ts", + "components-chromium/node_modules/safevalues/builders/script_builders.d.ts", + "components-chromium/node_modules/safevalues/builders/url_sanitizer.d.ts", + "components-chromium/node_modules/safevalues/builders/attribute_builders.d.ts", + "components-chromium/node_modules/safevalues/builders/resource_url_builders.d.ts", + "components-chromium/node_modules/safevalues/builders/html_builders.d.ts", + "components-chromium/node_modules/safevalues/builders/style_builders.d.ts", + "components-chromium/node_modules/safevalues/dom/index.d.ts", + "components-chromium/node_modules/safevalues/dom/elements/button.d.ts", + "components-chromium/node_modules/safevalues/dom/elements/input.d.ts", + "components-chromium/node_modules/safevalues/dom/elements/form.d.ts", + "components-chromium/node_modules/safevalues/dom/elements/anchor.d.ts", + "components-chromium/node_modules/safevalues/dom/elements/link.d.ts", + "components-chromium/node_modules/safevalues/dom/elements/style.d.ts", + "components-chromium/node_modules/safevalues/dom/elements/base.d.ts", + "components-chromium/node_modules/safevalues/dom/elements/area.d.ts", + "components-chromium/node_modules/safevalues/dom/elements/embed.d.ts", + "components-chromium/node_modules/safevalues/dom/elements/object.d.ts", + "components-chromium/node_modules/safevalues/dom/elements/iframe.d.ts", + "components-chromium/node_modules/safevalues/dom/elements/svg_use.d.ts", + "components-chromium/node_modules/safevalues/dom/elements/script.d.ts", + "components-chromium/node_modules/safevalues/dom/elements/element.d.ts", + "components-chromium/node_modules/safevalues/dom/globals/range.d.ts", + "components-chromium/node_modules/safevalues/dom/globals/window.d.ts", + "components-chromium/node_modules/safevalues/dom/globals/location.d.ts", + "components-chromium/node_modules/safevalues/dom/globals/worker.d.ts", + "components-chromium/node_modules/safevalues/dom/globals/url.d.ts", + "components-chromium/node_modules/safevalues/dom/globals/service_worker_container.d.ts", + "components-chromium/node_modules/safevalues/dom/globals/document.d.ts", + "components-chromium/node_modules/safevalues/dom/globals/dom_parser.d.ts", + "components-chromium/node_modules/safevalues/dom/globals/global.d.ts", + "components-chromium/node_modules/safevalues/internals/string_literal.d.ts", + "components-chromium/node_modules/safevalues/internals/attribute_impl.d.ts", + "components-chromium/node_modules/safevalues/internals/html_impl.d.ts", + "components-chromium/node_modules/safevalues/internals/script_impl.d.ts", + "components-chromium/node_modules/safevalues/internals/trusted_types.d.ts", + "components-chromium/node_modules/safevalues/internals/resource_url_impl.d.ts", + "components-chromium/node_modules/safevalues/internals/style_sheet_impl.d.ts", + "components-chromium/node_modules/safevalues/internals/secrets.d.ts", + "components-chromium/node_modules/safevalues/internals/style_impl.d.ts", + "components-chromium/node_modules/safevalues/restricted/reviewed.d.ts", + "components-chromium/node_modules/safevalues/restricted/legacy.d.ts", "components-chromium/node_modules/lit/async-directive.d.ts", "components-chromium/node_modules/lit/index.d.ts", "components-chromium/node_modules/lit/html.d.ts",
diff --git a/third_party/material_web_components/components-chromium/node_modules/.package-lock.json b/third_party/material_web_components/components-chromium/node_modules/.package-lock.json index aeb28b6..163e47f 100644 --- a/third_party/material_web_components/components-chromium/node_modules/.package-lock.json +++ b/third_party/material_web_components/components-chromium/node_modules/.package-lock.json
@@ -18,11 +18,12 @@ } }, "node_modules/@material/web": { - "version": "1.0.0-pre.2", - "resolved": "https://registry.npmjs.org/@material/web/-/web-1.0.0-pre.2.tgz", - "integrity": "sha512-Fq0zBNvLw6uZ1v9/ntZtEviuVA3+4ynt6No4s+VlpHlfvGGoS2BnGxWqx4pIPNuIxAUt0LIK19caFtuxdu4S2A==", + "version": "1.0.0-pre.8", + "resolved": "https://registry.npmjs.org/@material/web/-/web-1.0.0-pre.8.tgz", + "integrity": "sha512-CafOQw/C23SP1DlJVYDbs2Cm9Ct4QV7RxjxMBiWhaqlhqfDyXVpnZnKlTVzD5dVDKZyUu3vHsWK7Y/N8P66DYQ==", "dependencies": { "lit": "^2.3.0", + "safevalues": "^0.4.3", "tslib": "^2.4.0" } }, @@ -58,6 +59,11 @@ "@types/trusted-types": "^2.0.2" } }, + "node_modules/safevalues": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/safevalues/-/safevalues-0.4.3.tgz", + "integrity": "sha512-pNCNTkx3xs7G5YJ/9CoeZZVUSPRjH0SEPM0QI5Z1FZRlLBviTFWlNKPs8PTvZvERV0gO7ie/t/Zc0S96JS4Xew==" + }, "node_modules/tslib": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz",
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/LICENSE b/third_party/material_web_components/components-chromium/node_modules/@material/web/LICENSE index d645695..710c1e7 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/LICENSE +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/LICENSE
@@ -187,7 +187,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [yyyy] [name of copyright owner] + Copyright 2018-2023 Google, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/actionelement/action-element.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/actionelement/action-element.d.ts deleted file mode 100644 index 42322484..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/actionelement/action-element.d.ts +++ /dev/null
@@ -1,79 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { LitElement } from 'lit'; -import { ActionController, ActionControllerHost, BeginPressConfig, EndPressConfig } from '../controller/action-controller.js'; -export { BeginPressConfig, EndPressConfig }; -/** - * @soyCompatible - * - * ActionElement is a base class that provides a handy starting point for using - * ActionController. Subclasses should add the event handlers on the interactive - * node in the template, and override `beginPress` and `endPress` to handle - * pressed state, ripple interaction, and any other "press" interaction. - */ -export declare abstract class ActionElement extends LitElement implements ActionControllerHost { - /** - * ActionController needs to know if the component is disabled, so subclasses - * must implement a `disabled` property. - */ - abstract disabled: boolean; - protected actionController: ActionController; - /** - * Hook method called when we've confirmed that the gesture is intended to be - * a press. Subclasses should change the visual state of the control to - * 'active' at this point, and possibly fire an event. Subclasses should - * override this method if more needs to be done. - * - * @param options `positionEvent` is the Event that is considered the - * beginning of the press. Null if this was a keyboard interaction. - */ - beginPress(options: BeginPressConfig): void; - /** - * Hook method called when the control goes from a pressed to unpressed - * state. - * - * @param options If `cancelled` is true, means the user canceled the action. - * Subclasses which trigger events on endPress() should check the value - * of this flag, and modify their behavior accordingly. - */ - endPress({ cancelled, actionData }: EndPressConfig): void; - /** - * Hook method for the ActionController. - * Subclasses should add this method as an event handler on the interactive - * template element with `@pointerdown="${this.handlePointerDown}"` - */ - handlePointerDown(e: PointerEvent): void; - /** - * Hook method for the ActionController. - * Subclasses should add this method as an event handler on the interactive - * template element with `@pointerup="${this.handlePointerUp}"` - */ - handlePointerUp(e: PointerEvent): void; - /** - * Hook method for the ActionController. - * Subclasses should add this method as an event handler on the interactive - * template element with `@pointercancel="${this.handlePointerCancel}"` - */ - handlePointerCancel(e: PointerEvent): void; - /** - * Hook method for the ActionController. - * Subclasses should add this method as an event handler on the interactive - * template element with `@pointerleave="${this.handlePointerleave}"` - */ - handlePointerLeave(e: PointerEvent): void; - /** - * Hook method for the ActionController. - * Subclasses should add this method as an event handler on the interactive - * template element with `@click="${this.handleClick}"` - */ - handleClick(e: MouseEvent): void; - /** - * Hook method for the ActionController. - * Subclasses should add this method as an event handler on the interactive - * template element with `@contextmenu="${this.handleContextMenu}"` - */ - handleContextMenu(): void; -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/actionelement/action-element.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/actionelement/action-element.js deleted file mode 100644 index 380a204f..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/actionelement/action-element.js +++ /dev/null
@@ -1,97 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { LitElement } from 'lit'; -import { ActionController } from '../controller/action-controller.js'; -/** - * @soyCompatible - * - * ActionElement is a base class that provides a handy starting point for using - * ActionController. Subclasses should add the event handlers on the interactive - * node in the template, and override `beginPress` and `endPress` to handle - * pressed state, ripple interaction, and any other "press" interaction. - */ -export class ActionElement extends LitElement { - constructor() { - super(...arguments); - this.actionController = new ActionController(this); - } - /** - * Hook method called when we've confirmed that the gesture is intended to be - * a press. Subclasses should change the visual state of the control to - * 'active' at this point, and possibly fire an event. Subclasses should - * override this method if more needs to be done. - * - * @param options `positionEvent` is the Event that is considered the - * beginning of the press. Null if this was a keyboard interaction. - */ - beginPress(options) { } - /** - * Hook method called when the control goes from a pressed to unpressed - * state. - * - * @param options If `cancelled` is true, means the user canceled the action. - * Subclasses which trigger events on endPress() should check the value - * of this flag, and modify their behavior accordingly. - */ - endPress({ cancelled, actionData }) { - if (!cancelled) { - this.dispatchEvent(new CustomEvent('action', { - detail: actionData, - bubbles: true, - composed: true, - })); - } - } - /** - * Hook method for the ActionController. - * Subclasses should add this method as an event handler on the interactive - * template element with `@pointerdown="${this.handlePointerDown}"` - */ - handlePointerDown(e) { - this.actionController.pointerDown(e); - } - /** - * Hook method for the ActionController. - * Subclasses should add this method as an event handler on the interactive - * template element with `@pointerup="${this.handlePointerUp}"` - */ - handlePointerUp(e) { - this.actionController.pointerUp(e); - } - /** - * Hook method for the ActionController. - * Subclasses should add this method as an event handler on the interactive - * template element with `@pointercancel="${this.handlePointerCancel}"` - */ - handlePointerCancel(e) { - this.actionController.pointerCancel(e); - } - /** - * Hook method for the ActionController. - * Subclasses should add this method as an event handler on the interactive - * template element with `@pointerleave="${this.handlePointerleave}"` - */ - handlePointerLeave(e) { - this.actionController.pointerLeave(e); - } - /** - * Hook method for the ActionController. - * Subclasses should add this method as an event handler on the interactive - * template element with `@click="${this.handleClick}"` - */ - handleClick(e) { - this.actionController.click(e); - } - /** - * Hook method for the ActionController. - * Subclasses should add this method as an event handler on the interactive - * template element with `@contextmenu="${this.handleContextMenu}"` - */ - handleContextMenu() { - this.actionController.contextMenu(); - } -} -//# sourceMappingURL=action-element.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/aria/aria.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/aria/aria.d.ts new file mode 100644 index 0000000..bdb3bc80e --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/aria/aria.d.ts
@@ -0,0 +1,43 @@ +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +/** + * Accessibility Object Model reflective aria property name types. + */ +export type ARIAProperty = Exclude<keyof ARIAMixin, 'role'>; +/** + * Accessibility Object Model reflective aria properties. + */ +export declare const ARIA_PROPERTIES: ARIAProperty[]; +/** + * Accessibility Object Model aria attribute name types. + */ +export type ARIAAttribute = ARIAPropertyToAttribute<ARIAProperty>; +/** + * Accessibility Object Model aria attributes. + */ +export declare const ARIA_ATTRIBUTES: ("aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-current" | "aria-disabled" | "aria-expanded" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext")[]; +/** + * Checks if an attribute is one of the AOM aria attributes. + * + * @example + * isAriaAttribute('aria-label'); // true + * + * @param attribute The attribute to check. + * @return True if the attribute is an aria attribute, or false if not. + */ +export declare function isAriaAttribute(attribute: string): attribute is ARIAAttribute; +/** + * Converts an AOM aria property into its corresponding attribute. + * + * @example + * ariaPropertyToAttribute('ariaLabel'); // 'aria-label' + * + * @param property The aria property. + * @return The aria attribute. + */ +export declare function ariaPropertyToAttribute<K extends ARIAProperty | 'role'>(property: K): ARIAPropertyToAttribute<K>; +type ARIAPropertyToAttribute<K extends string> = K extends `aria${infer Suffix}Element${infer OptS}` ? `aria-${Lowercase<Suffix>}` : K extends `aria${infer Suffix}` ? `aria-${Lowercase<Suffix>}` : K; +export {};
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/aria/aria.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/aria/aria.js new file mode 100644 index 0000000..133b46d --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/aria/aria.js
@@ -0,0 +1,80 @@ +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +/** + * Accessibility Object Model reflective aria properties. + */ +export const ARIA_PROPERTIES = [ + 'ariaAtomic', + 'ariaAutoComplete', + 'ariaBusy', + 'ariaChecked', + 'ariaColCount', + 'ariaColIndex', + 'ariaColSpan', + 'ariaCurrent', + 'ariaDisabled', + 'ariaExpanded', + 'ariaHasPopup', + 'ariaHidden', + 'ariaInvalid', + 'ariaKeyShortcuts', + 'ariaLabel', + 'ariaLevel', + 'ariaLive', + 'ariaModal', + 'ariaMultiLine', + 'ariaMultiSelectable', + 'ariaOrientation', + 'ariaPlaceholder', + 'ariaPosInSet', + 'ariaPressed', + 'ariaReadOnly', + 'ariaRequired', + 'ariaRoleDescription', + 'ariaRowCount', + 'ariaRowIndex', + 'ariaRowSpan', + 'ariaSelected', + 'ariaSetSize', + 'ariaSort', + 'ariaValueMax', + 'ariaValueMin', + 'ariaValueNow', + 'ariaValueText', +]; +/** + * Accessibility Object Model aria attributes. + */ +export const ARIA_ATTRIBUTES = ARIA_PROPERTIES.map(ariaPropertyToAttribute); +/** + * Checks if an attribute is one of the AOM aria attributes. + * + * @example + * isAriaAttribute('aria-label'); // true + * + * @param attribute The attribute to check. + * @return True if the attribute is an aria attribute, or false if not. + */ +export function isAriaAttribute(attribute) { + return attribute.startsWith('aria-'); +} +/** + * Converts an AOM aria property into its corresponding attribute. + * + * @example + * ariaPropertyToAttribute('ariaLabel'); // 'aria-label' + * + * @param property The aria property. + * @return The aria attribute. + */ +export function ariaPropertyToAttribute(property) { + return property + .replace('aria', 'aria-') + // IDREF attributes also include an "Element" or "Elements" suffix + .replace(/Elements?/g, '') + .toLowerCase(); +} +//# sourceMappingURL=aria.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/aria/delegate.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/aria/delegate.d.ts new file mode 100644 index 0000000..8702985 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/aria/delegate.d.ts
@@ -0,0 +1,37 @@ +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import { ReactiveElement } from 'lit'; +/** + * Sets up a `ReactiveElement` constructor to enable updates when delegating + * aria attributes. Elements may bind `this.aria*` properties to `aria-*` + * attributes in their render functions. + * + * This function will: + * - Call `requestUpdate()` when an aria attribute changes. + * - Add `role="presentation"` to the host. + * + * NOTE: The following features are not currently supported: + * - Delegating IDREF attributes (ex: `aria-labelledby`, `aria-controls`) + * - Delegating the `role` attribute + * + * @example + * class XButton extends LitElement { + * static { + * requestUpdateOnAriaChange(this); + * } + * + * protected override render() { + * return html` + * <button aria-label=${this.ariaLabel || nothing}> + * <slot></slot> + * </button> + * `; + * } + * } + * + * @param ctor The `ReactiveElement` constructor to patch. + */ +export declare function requestUpdateOnAriaChange(ctor: typeof ReactiveElement): void;
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/aria/delegate.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/aria/delegate.js new file mode 100644 index 0000000..4f7228b8 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/aria/delegate.js
@@ -0,0 +1,53 @@ +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import { ARIA_PROPERTIES, ariaPropertyToAttribute } from './aria.js'; +/** + * Sets up a `ReactiveElement` constructor to enable updates when delegating + * aria attributes. Elements may bind `this.aria*` properties to `aria-*` + * attributes in their render functions. + * + * This function will: + * - Call `requestUpdate()` when an aria attribute changes. + * - Add `role="presentation"` to the host. + * + * NOTE: The following features are not currently supported: + * - Delegating IDREF attributes (ex: `aria-labelledby`, `aria-controls`) + * - Delegating the `role` attribute + * + * @example + * class XButton extends LitElement { + * static { + * requestUpdateOnAriaChange(this); + * } + * + * protected override render() { + * return html` + * <button aria-label=${this.ariaLabel || nothing}> + * <slot></slot> + * </button> + * `; + * } + * } + * + * @param ctor The `ReactiveElement` constructor to patch. + */ +export function requestUpdateOnAriaChange(ctor) { + for (const ariaProperty of ARIA_PROPERTIES) { + ctor.createProperty(ariaProperty, { + attribute: ariaPropertyToAttribute(ariaProperty), + reflect: true, + }); + } + ctor.addInitializer(element => { + const controller = { + hostConnected() { + element.setAttribute('role', 'presentation'); + } + }; + element.addController(controller); + }); +} +//# sourceMappingURL=delegate.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/autocomplete-item.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/autocomplete-item.d.ts deleted file mode 100644 index 9f660ce..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/autocomplete-item.d.ts +++ /dev/null
@@ -1,19 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { AutocompleteItem } from './lib/autocompleteitem/autocomplete-item.js'; -declare global { - interface HTMLElementTagNameMap { - 'md-autocomplete-item': MdAutocompleteItem; - } -} -/** - * @soyCompatible - * @final - * @suppress {visibility} - */ -export declare class MdAutocompleteItem extends AutocompleteItem { - static styles: import("lit").CSSResult[]; -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/autocomplete-item.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/autocomplete-item.js deleted file mode 100644 index 1779db6..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/autocomplete-item.js +++ /dev/null
@@ -1,22 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { __decorate } from "tslib"; -import { customElement } from 'lit/decorators.js'; -import { styles } from '../list/lib/listitem/list-item-styles.css.js'; -import { AutocompleteItem } from './lib/autocompleteitem/autocomplete-item.js'; -/** - * @soyCompatible - * @final - * @suppress {visibility} - */ -let MdAutocompleteItem = class MdAutocompleteItem extends AutocompleteItem { -}; -MdAutocompleteItem.styles = [styles]; -MdAutocompleteItem = __decorate([ - customElement('md-autocomplete-item') -], MdAutocompleteItem); -export { MdAutocompleteItem }; -//# sourceMappingURL=autocomplete-item.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/autocomplete-list.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/autocomplete-list.d.ts deleted file mode 100644 index 7ca2466..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/autocomplete-list.d.ts +++ /dev/null
@@ -1,19 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { AutocompleteList } from './lib/autocompletelist/autocomplete-list.js'; -declare global { - interface HTMLElementTagNameMap { - 'md-autocomplete-list': MdAutocompleteList; - } -} -/** - * @soyCompatible - * @final - * @suppress {visibility} - */ -export declare class MdAutocompleteList extends AutocompleteList { - static styles: import("lit").CSSResult[]; -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/autocomplete-list.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/autocomplete-list.js deleted file mode 100644 index 28be4756..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/autocomplete-list.js +++ /dev/null
@@ -1,23 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { __decorate } from "tslib"; -import { customElement } from 'lit/decorators.js'; -import { styles } from '../list/lib/list-styles.css.js'; -import { AutocompleteList } from './lib/autocompletelist/autocomplete-list.js'; -import { styles as autocompleteStyles } from './lib/autocompletelist/autocomplete-list-styles.css.js'; -/** - * @soyCompatible - * @final - * @suppress {visibility} - */ -let MdAutocompleteList = class MdAutocompleteList extends AutocompleteList { -}; -MdAutocompleteList.styles = [styles, autocompleteStyles]; -MdAutocompleteList = __decorate([ - customElement('md-autocomplete-list') -], MdAutocompleteList); -export { MdAutocompleteList }; -//# sourceMappingURL=autocomplete-list.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/autocomplete-surface.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/autocomplete-surface.d.ts deleted file mode 100644 index 4b975668..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/autocomplete-surface.d.ts +++ /dev/null
@@ -1,19 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { AutocompleteSurface } from './lib/autocompletesurface/autocomplete-surface.js'; -declare global { - interface HTMLElementTagNameMap { - 'md-autocomplete-surface': MdAutocompleteSurface; - } -} -/** - * @soyCompatible - * @final - * @suppress {visibility} - */ -export declare class MdAutocompleteSurface extends AutocompleteSurface { - static styles: import("lit").CSSResult[]; -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/autocomplete-surface.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/autocomplete-surface.js deleted file mode 100644 index 772af57..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/autocomplete-surface.js +++ /dev/null
@@ -1,23 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { __decorate } from "tslib"; -import { customElement } from 'lit/decorators.js'; -import { styles } from '../menusurface/lib/menu-surface-styles.css.js'; -import { AutocompleteSurface } from './lib/autocompletesurface/autocomplete-surface.js'; -import { styles as autocompleteStyles } from './lib/autocompletesurface/autocomplete-surface-styles.css.js'; -/** - * @soyCompatible - * @final - * @suppress {visibility} - */ -let MdAutocompleteSurface = class MdAutocompleteSurface extends AutocompleteSurface { -}; -MdAutocompleteSurface.styles = [styles, autocompleteStyles]; -MdAutocompleteSurface = __decorate([ - customElement('md-autocomplete-surface') -], MdAutocompleteSurface); -export { MdAutocompleteSurface }; -//# sourceMappingURL=autocomplete-surface.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/filled-autocomplete.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/filled-autocomplete.d.ts deleted file mode 100644 index 090d6fa..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/filled-autocomplete.d.ts +++ /dev/null
@@ -1,30 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import '../field/filled-field.js'; -import './autocomplete-list.js'; -import './autocomplete-surface.js'; -import { ClassInfo } from 'lit/directives/class-map.js'; -import { Autocomplete } from './lib/autocomplete.js'; -declare global { - interface HTMLElementTagNameMap { - 'md-filled-autocomplete': MdFilledAutocomplete; - } -} -/** - * @soyCompatible - * @final - * @suppress {visibility} - */ -export declare class MdFilledAutocomplete extends Autocomplete { - static styles: import("lit").CSSResult[]; - protected readonly listTag: import("lit-html/static.js").StaticValue; - protected readonly menuSurfaceTag: import("lit-html/static.js").StaticValue; - protected readonly fieldTag: import("lit-html/static.js").StaticValue; - /** @soyTemplate */ - protected getAutocompleteRenderClasses(): ClassInfo; - /** @soyTemplate */ - protected getRenderClasses(): ClassInfo; -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/filled-autocomplete.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/filled-autocomplete.js deleted file mode 100644 index b3fb37b..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/filled-autocomplete.js +++ /dev/null
@@ -1,53 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { __decorate } from "tslib"; -import '../field/filled-field.js'; -import './autocomplete-list.js'; -import './autocomplete-surface.js'; -import { customElement } from 'lit/decorators.js'; -import { literal } from 'lit/static-html.js'; -import { styles as filledForcedColorsStyles } from '../textfield/lib/filled-forced-colors-styles.css.js'; -import { styles as filledStyles } from '../textfield/lib/filled-styles.css.js'; -import { styles as sharedStyles } from '../textfield/lib/shared-styles.css.js'; -import { Autocomplete } from './lib/autocomplete.js'; -import { styles as autocompleteStyles } from './lib/filled-styles.css.js'; -import { styles as sharedAutocompleteStyles } from './lib/shared-styles.css.js'; -/** - * @soyCompatible - * @final - * @suppress {visibility} - */ -let MdFilledAutocomplete = class MdFilledAutocomplete extends Autocomplete { - constructor() { - super(...arguments); - this.listTag = literal `md-autocomplete-list`; - this.menuSurfaceTag = literal `md-autocomplete-surface`; - this.fieldTag = literal `md-filled-field`; - } - /** @soyTemplate */ - getAutocompleteRenderClasses() { - return { - ...super.getAutocompleteRenderClasses(), - 'md3-autocomplete--filled': true, - }; - } - /** @soyTemplate */ - getRenderClasses() { - return { - ...super.getRenderClasses(), - 'md3-text-field--filled': true, - }; - } -}; -MdFilledAutocomplete.styles = [ - sharedStyles, filledStyles, filledForcedColorsStyles, - sharedAutocompleteStyles, autocompleteStyles -]; -MdFilledAutocomplete = __decorate([ - customElement('md-filled-autocomplete') -], MdFilledAutocomplete); -export { MdFilledAutocomplete }; -//# sourceMappingURL=filled-autocomplete.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/autocomplete.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/autocomplete.d.ts deleted file mode 100644 index a3f6c26..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/autocomplete.d.ts +++ /dev/null
@@ -1,54 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { PropertyValues, TemplateResult } from 'lit'; -import { ClassInfo } from 'lit/directives/class-map.js'; -import { StaticValue } from 'lit/static-html.js'; -import { TextField } from '../../textfield/lib/text-field.js'; -import { AutocompleteItem } from './autocompleteitem/autocomplete-item.js'; -import { AutocompleteList } from './autocompletelist/autocomplete-list.js'; -import { AutocompleteSurface } from './autocompletesurface/autocomplete-surface.js'; -/** @soyCompatible */ -export declare abstract class Autocomplete extends TextField { - static shadowRootOptions: ShadowRootInit; - readonly role = "combobox"; - readonly ariaAutoComplete = "list"; - /** - * The ID prefix for the item elements, used for SSR. - */ - itemIdPrefix: string; - protected abstract readonly menuSurfaceTag: StaticValue; - protected abstract readonly listTag: StaticValue; - menuSurface?: AutocompleteSurface | null; - list?: AutocompleteList | null; - protected slottedItems?: AutocompleteItem[]; - value: string; - protected selectedItem: AutocompleteItem | null; - /** @soyTemplate */ - render(): TemplateResult; - /** @soyTemplate */ - protected getAutocompleteRenderClasses(): ClassInfo; - protected updated(changedProperties: PropertyValues): void; - firstUpdated(changedProperties: PropertyValues): void; - /** @soyTemplate */ - protected renderMenuSurface(): TemplateResult; - isOpen(): boolean; - open(): void; - close(): void; - protected handleClicked(event: PointerEvent): void; - protected handleFocusout(): void; - protected handleAction(event: CustomEvent<{ - item: AutocompleteItem; - }>): void; - protected handleKeydown(event: KeyboardEvent): void; - protected handleKeyup(event: KeyboardEvent): void; - /** - * When selectedItem is updated, item prefixes and aria-selected status will - * be updated along with scrolling the selected item into view, if needed. - */ - private updateSelectedItem; - private getPreviousItem; - private getNextItem; -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/autocomplete.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/autocomplete.js deleted file mode 100644 index 0a1d286..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/autocomplete.js +++ /dev/null
@@ -1,266 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { __decorate, __metadata } from "tslib"; -import { html } from 'lit'; -import { property, query, queryAssignedElements, state } from 'lit/decorators.js'; -import { classMap } from 'lit/directives/class-map.js'; -import { html as staticHtml } from 'lit/static-html.js'; -import { TextField } from '../../textfield/lib/text-field.js'; -import { AutocompleteItem } from './autocompleteitem/autocomplete-item.js'; -import { AutocompleteList } from './autocompletelist/autocomplete-list.js'; -import { AutocompleteSurface } from './autocompletesurface/autocomplete-surface.js'; -/** @soyCompatible */ -export class Autocomplete extends TextField { - constructor() { - super(...arguments); - this.role = 'combobox'; - this.ariaAutoComplete = 'list'; - /** - * The ID prefix for the item elements, used for SSR. - */ - this.itemIdPrefix = 'autocomplete-item'; - this.value = ''; - this.selectedItem = null; - } - /** @soyTemplate */ - render() { - return html `<div class="md3-autocomplete ${classMap(this.getAutocompleteRenderClasses())}" - @click=${this.handleClicked} - @focusout=${this.handleFocusout} - @action=${this.handleAction} - @input=${this.handleInput} - @keydown=${this.handleKeydown} - @keyup=${this.handleKeyup}> - ${super.render()} - ${this.renderMenuSurface()}</div>`; - } - /** @soyTemplate */ - getAutocompleteRenderClasses() { - return {}; - } - updated(changedProperties) { - super.updated(changedProperties); - if (changedProperties.has('selectedItem')) { - this.updateSelectedItem(); - // TODO(b/265209253): implement - // this.ariaActiveDescendant = this.selectedItem?.itemId ?? null; - } - if (changedProperties.has('value')) { - this.dispatchEvent(new CustomEvent('autocomplete-value-changed', { detail: { value: this.value }, bubbles: true, composed: true })); - } - } - firstUpdated(changedProperties) { - console.warn('<md-autocomplete> is not yet implemented.'); - super.firstUpdated(changedProperties); - this.menuSurface.anchor = this; - } - /** @soyTemplate */ - renderMenuSurface() { - return staticHtml `<${this.menuSurfaceTag} - class="md3-autocomplete__menu-surface"> - <${this.listTag} class="md3-autocomplete__list"> - <slot></slot> - </${this.listTag}> - </${this.menuSurfaceTag}>`; - } - isOpen() { - return this.menuSurface?.open || false; - } - open() { - this.menuSurface?.show(); - this.ariaExpanded = 'true'; - } - close() { - this.menuSurface?.close(); - this.selectedItem = null; - this.ariaExpanded = 'false'; - } - handleClicked(event) { - // When clicking the list (not items nor text field) the menu should stay - // open. - if (this.isOpen() && - event.target?.parentNode !== this.menuSurface) { - this.close(); - } - else { - this.open(); - } - } - handleFocusout() { - if (this.matches(':focus-within')) { - this.getInput().focus(); - return; - } - this.close(); - this.focused = false; - } - handleAction(event) { - const detail = event.detail; - this.value = detail.item.headline; - } - handleKeydown(event) { - let bubble = true; - const altKey = event.altKey; - switch (event.key) { - case 'Enter': - if (this.selectedItem) { - this.value = this.selectedItem.headline; - } - this.close(); - bubble = false; - break; - case 'ArrowDown': - if (!this.slottedItems) - return; - if (this.slottedItems.length) { - if (this.selectedItem) { - this.selectedItem = this.getNextItem(); - } - else { - this.open(); - if (!altKey) { - this.selectedItem = this.slottedItems[0]; - } - } - } - bubble = false; - break; - case 'ArrowUp': - if (!this.slottedItems) - return; - if (this.slottedItems.length) { - if (this.selectedItem) { - this.selectedItem = this.getPreviousItem(); - } - else { - this.open(); - if (!altKey) { - this.selectedItem = - this.slottedItems[this.slottedItems.length - 1]; - } - } - } - bubble = false; - break; - case 'Escape': - if (this.isOpen()) { - this.close(); - } - else { - this.value = ''; - } - this.selectedItem = null; - bubble = false; - break; - case 'Tab': - if (this.selectedItem) { - this.value = this.selectedItem.headline; - } - this.close(); - break; - case 'Home': - this.setSelectionRange(0, 0); - this.selectedItem = null; - bubble = false; - break; - case 'End': - this.setSelectionRange(this.value.length, this.value.length); - this.selectedItem = null; - bubble = false; - break; - default: - break; - } - if (bubble) - return; - event.stopPropagation(); - event.preventDefault(); - } - handleKeyup(event) { - let bubble = true; - switch (event.key) { - case 'Backspace': - case 'ArrowLeft': - case 'ArrowRight': - this.selectedItem = null; - bubble = false; - break; - default: - break; - } - if (bubble) - return; - event.stopPropagation(); - event.preventDefault(); - } - /** - * When selectedItem is updated, item prefixes and aria-selected status will - * be updated along with scrolling the selected item into view, if needed. - */ - updateSelectedItem() { - if (!this.slottedItems) - return; - this.slottedItems.forEach((item, index) => { - // TODO(b/265209253): implement - // item.itemId = `${this.itemIdPrefix}-${index}`; - if (this.selectedItem && item === this.selectedItem && this.list) { - item.ariaSelected = 'true'; - // Scroll into view - if (this.list.scrollTop + this.list.offsetHeight < - item.offsetTop + item.offsetHeight) { - this.list.scrollTop = - item.offsetTop + item.offsetHeight - this.list.offsetHeight; - } - else if (this.list.scrollTop > item.offsetTop + 2) { - this.list.scrollTop = item.offsetTop; - } - } - else { - item.ariaSelected = 'false'; - } - }); - } - getPreviousItem() { - if (!this.slottedItems) - return null; - const index = this.selectedItem ? this.slottedItems.indexOf(this.selectedItem) : 0; - const length = this.slottedItems.length; - return this.slottedItems[(index - 1 + length) % length]; - } - getNextItem() { - if (!this.slottedItems) - return null; - const index = this.selectedItem ? this.slottedItems.indexOf(this.selectedItem) : 0; - const length = this.slottedItems.length; - return this.slottedItems[(index + 1) % length]; - } -} -Autocomplete.shadowRootOptions = { mode: 'open', delegatesFocus: true }; -__decorate([ - property({ type: String }), - __metadata("design:type", Object) -], Autocomplete.prototype, "itemIdPrefix", void 0); -__decorate([ - query('.md3-autocomplete__menu-surface'), - __metadata("design:type", AutocompleteSurface) -], Autocomplete.prototype, "menuSurface", void 0); -__decorate([ - query('.md3-autocomplete__list'), - __metadata("design:type", AutocompleteList) -], Autocomplete.prototype, "list", void 0); -__decorate([ - queryAssignedElements({ flatten: true }), - __metadata("design:type", Array) -], Autocomplete.prototype, "slottedItems", void 0); -__decorate([ - property({ type: String }), - __metadata("design:type", Object) -], Autocomplete.prototype, "value", void 0); -__decorate([ - state(), - __metadata("design:type", AutocompleteItem) -], Autocomplete.prototype, "selectedItem", void 0); -//# sourceMappingURL=autocomplete.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/autocompleteitem/autocomplete-item.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/autocompleteitem/autocomplete-item.d.ts deleted file mode 100644 index ec9cf7ea..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/autocompleteitem/autocomplete-item.d.ts +++ /dev/null
@@ -1,11 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { ListItemEl } from '../../../list/lib/listitem/list-item.js'; -import { ARIARole } from '../../../types/aria.js'; -/** Base class for autocomplete item component. */ -export declare class AutocompleteItem extends ListItemEl { - role: ARIARole; -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/autocompleteitem/autocomplete-item.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/autocompleteitem/autocomplete-item.js deleted file mode 100644 index 7f536034..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/autocompleteitem/autocomplete-item.js +++ /dev/null
@@ -1,14 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { ListItemEl } from '../../../list/lib/listitem/list-item.js'; -/** Base class for autocomplete item component. */ -export class AutocompleteItem extends ListItemEl { - constructor() { - super(...arguments); - this.role = 'option'; - } -} -//# sourceMappingURL=autocomplete-item.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/autocompletelist/autocomplete-list-styles.css.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/autocompletelist/autocomplete-list-styles.css.d.ts deleted file mode 100644 index 1c75ade..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/autocompletelist/autocomplete-list-styles.css.d.ts +++ /dev/null
@@ -1 +0,0 @@ -export declare const styles: import("lit").CSSResult;
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/autocompletelist/autocomplete-list-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/autocompletelist/autocomplete-list-styles.css.js deleted file mode 100644 index 902dd3e..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/autocompletelist/autocomplete-list-styles.css.js +++ /dev/null
@@ -1,9 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { css } from 'lit'; -export const styles = css `.md3-autocomplete-list{min-width:unset}/*# sourceMappingURL=autocomplete-list-styles.css.map */ -`; -//# sourceMappingURL=autocomplete-list-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/autocompletelist/autocomplete-list.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/autocompletelist/autocomplete-list.d.ts deleted file mode 100644 index 807524a..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/autocompletelist/autocomplete-list.d.ts +++ /dev/null
@@ -1,14 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { ClassInfo } from 'lit/directives/class-map.js'; -import { List } from '../../../list/lib/list.js'; -import { ARIARole } from '../../../types/aria.js'; -/** Base class for autocomplete list component. */ -export declare class AutocompleteList extends List { - role: ARIARole; - /** @soyTemplate */ - protected getListClasses(): ClassInfo; -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/autocompletelist/autocomplete-list.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/autocompletelist/autocomplete-list.js deleted file mode 100644 index d94431ea..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/autocompletelist/autocomplete-list.js +++ /dev/null
@@ -1,21 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { List } from '../../../list/lib/list.js'; -/** Base class for autocomplete list component. */ -export class AutocompleteList extends List { - constructor() { - super(...arguments); - this.role = 'listbox'; - } - /** @soyTemplate */ - getListClasses() { - return { - ...super.getListClasses(), - 'md3-autocomplete-list': true, - }; - } -} -//# sourceMappingURL=autocomplete-list.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/autocompletelist/harness.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/autocompletelist/harness.d.ts deleted file mode 100644 index 12a0d21..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/autocompletelist/harness.d.ts +++ /dev/null
@@ -1,11 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { ListHarness } from '../../../list/harness.js'; -/** - * Test harness for autocomplete list. - */ -export declare class AutocompleteListHarness extends ListHarness { -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/autocompletesurface/autocomplete-surface-styles.css.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/autocompletesurface/autocomplete-surface-styles.css.d.ts deleted file mode 100644 index 1c75ade..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/autocompletesurface/autocomplete-surface-styles.css.d.ts +++ /dev/null
@@ -1 +0,0 @@ -export declare const styles: import("lit").CSSResult;
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/autocompletesurface/autocomplete-surface-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/autocompletesurface/autocomplete-surface-styles.css.js deleted file mode 100644 index 160ee90..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/autocompletesurface/autocomplete-surface-styles.css.js +++ /dev/null
@@ -1,9 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { css } from 'lit'; -export const styles = css `.md3-autocomplete-surface{width:100%}/*# sourceMappingURL=autocomplete-surface-styles.css.map */ -`; -//# sourceMappingURL=autocomplete-surface-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/autocompletesurface/autocomplete-surface.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/autocompletesurface/autocomplete-surface.d.ts deleted file mode 100644 index 5eaad39d..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/autocompletesurface/autocomplete-surface.d.ts +++ /dev/null
@@ -1,13 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { ClassInfo } from 'lit/directives/class-map.js'; -import { MenuSurface } from '../../../menusurface/lib/menu-surface.js'; -/** Base class for autocomplete surface component. */ -export declare class AutocompleteSurface extends MenuSurface { - stayOpenOnBodyClick: boolean; - /** @soyTemplate */ - protected getRenderClasses(): ClassInfo; -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/autocompletesurface/autocomplete-surface.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/autocompletesurface/autocomplete-surface.js deleted file mode 100644 index df36c38..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/autocompletesurface/autocomplete-surface.js +++ /dev/null
@@ -1,21 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { MenuSurface } from '../../../menusurface/lib/menu-surface.js'; -/** Base class for autocomplete surface component. */ -export class AutocompleteSurface extends MenuSurface { - constructor() { - super(...arguments); - this.stayOpenOnBodyClick = true; - } - /** @soyTemplate */ - getRenderClasses() { - return { - ...super.getRenderClasses(), - 'md3-autocomplete-surface': true, - }; - } -} -//# sourceMappingURL=autocomplete-surface.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/filled-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/filled-styles.css.js deleted file mode 100644 index f8d441a..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/filled-styles.css.js +++ /dev/null
@@ -1,9 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { css } from 'lit'; -export const styles = css `:host{--_text-field-container-shape-start-start: var(--md-filled-autocomplete-text-field-container-shape-start-start, 4px);--_text-field-container-shape-start-end: var(--md-filled-autocomplete-text-field-container-shape-start-end, 4px);--_text-field-container-shape-end-end: var(--md-filled-autocomplete-text-field-container-shape-end-end, 0px);--_text-field-container-shape-end-start: var(--md-filled-autocomplete-text-field-container-shape-end-start, 0px);--_menu-cascading-menu-indicator-icon-color: var(--md-filled-autocomplete-menu-cascading-menu-indicator-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_menu-cascading-menu-indicator-icon-size: var(--md-filled-autocomplete-menu-cascading-menu-indicator-icon-size, 24px);--_menu-container-color: var(--md-filled-autocomplete-menu-container-color, var(--md-sys-color-surface, #fffbfe));--_menu-container-elevation: var(--md-filled-autocomplete-menu-container-elevation, 2);--_menu-container-shadow-color: var(--md-filled-autocomplete-menu-container-shadow-color, var(--md-sys-color-shadow, #000));--_menu-container-shape: var(--md-filled-autocomplete-menu-container-shape, 4px);--_menu-container-surface-tint-layer-color: var(--md-filled-autocomplete-menu-container-surface-tint-layer-color, var(--md-sys-color-primary, #6750a4));--_menu-divider-color: var(--md-filled-autocomplete-menu-divider-color, var(--md-sys-color-surface-variant, #e7e0ec));--_menu-divider-height: var(--md-filled-autocomplete-menu-divider-height, 1px);--_menu-list-item-container-height: var(--md-filled-autocomplete-menu-list-item-container-height, 48px);--_menu-list-item-label-text-color: var(--md-filled-autocomplete-menu-list-item-label-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_menu-list-item-label-text-font: var(--md-filled-autocomplete-menu-list-item-label-text-font, Roboto);--_menu-list-item-label-text-line-height: var(--md-filled-autocomplete-menu-list-item-label-text-line-height, 1.25rem);--_menu-list-item-label-text-size: var(--md-filled-autocomplete-menu-list-item-label-text-size, 0.875rem);--_menu-list-item-label-text-tracking: var(--md-filled-autocomplete-menu-list-item-label-text-tracking, 0.006rem);--_menu-list-item-label-text-type: var(--md-filled-autocomplete-menu-list-item-label-text-type, 500 0.875rem / 1.25rem Roboto);--_menu-list-item-label-text-weight: var(--md-filled-autocomplete-menu-list-item-label-text-weight, 500);--_menu-list-item-selected-container-color: var(--md-filled-autocomplete-menu-list-item-selected-container-color, var(--md-sys-color-surface-variant, #e7e0ec));--_text-field-active-indicator-color: var(--md-filled-autocomplete-text-field-active-indicator-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-active-indicator-height: var(--md-filled-autocomplete-text-field-active-indicator-height, 1px);--_text-field-caret-color: var(--md-filled-autocomplete-text-field-caret-color, var(--md-sys-color-primary, #6750a4));--_text-field-container-color: var(--md-filled-autocomplete-text-field-container-color, var(--md-sys-color-surface-variant, #e7e0ec));--_text-field-disabled-active-indicator-color: var(--md-filled-autocomplete-text-field-disabled-active-indicator-color, var(--md-sys-color-on-surface, #1c1b1f));--_text-field-disabled-active-indicator-height: var(--md-filled-autocomplete-text-field-disabled-active-indicator-height, 1px);--_text-field-disabled-active-indicator-opacity: var(--md-filled-autocomplete-text-field-disabled-active-indicator-opacity, 0.38);--_text-field-disabled-container-color: var(--md-filled-autocomplete-text-field-disabled-container-color, var(--md-sys-color-on-surface, #1c1b1f));--_text-field-disabled-container-opacity: var(--md-filled-autocomplete-text-field-disabled-container-opacity, 0.04);--_text-field-disabled-input-text-color: var(--md-filled-autocomplete-text-field-disabled-input-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_text-field-disabled-input-text-opacity: var(--md-filled-autocomplete-text-field-disabled-input-text-opacity, 0.38);--_text-field-disabled-label-text-color: var(--md-filled-autocomplete-text-field-disabled-label-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_text-field-disabled-label-text-opacity: var(--md-filled-autocomplete-text-field-disabled-label-text-opacity, 0.38);--_text-field-disabled-leading-icon-color: var(--md-filled-autocomplete-text-field-disabled-leading-icon-color, var(--md-sys-color-on-surface, #1c1b1f));--_text-field-disabled-leading-icon-opacity: var(--md-filled-autocomplete-text-field-disabled-leading-icon-opacity, 0.38);--_text-field-disabled-supporting-text-color: var(--md-filled-autocomplete-text-field-disabled-supporting-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_text-field-disabled-supporting-text-opacity: var(--md-filled-autocomplete-text-field-disabled-supporting-text-opacity, 0.38);--_text-field-disabled-trailing-icon-color: var(--md-filled-autocomplete-text-field-disabled-trailing-icon-color, var(--md-sys-color-on-surface, #1c1b1f));--_text-field-disabled-trailing-icon-opacity: var(--md-filled-autocomplete-text-field-disabled-trailing-icon-opacity, 0.38);--_text-field-error-active-indicator-color: var(--md-filled-autocomplete-text-field-error-active-indicator-color, var(--md-sys-color-error, #b3261e));--_text-field-error-focus-active-indicator-color: var(--md-filled-autocomplete-text-field-error-focus-active-indicator-color, var(--md-sys-color-error, #b3261e));--_text-field-error-focus-caret-color: var(--md-filled-autocomplete-text-field-error-focus-caret-color, var(--md-sys-color-error, #b3261e));--_text-field-error-focus-input-text-color: var(--md-filled-autocomplete-text-field-error-focus-input-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_text-field-error-focus-label-text-color: var(--md-filled-autocomplete-text-field-error-focus-label-text-color, var(--md-sys-color-error, #b3261e));--_text-field-error-focus-leading-icon-color: var(--md-filled-autocomplete-text-field-error-focus-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-error-focus-supporting-text-color: var(--md-filled-autocomplete-text-field-error-focus-supporting-text-color, var(--md-sys-color-error, #b3261e));--_text-field-error-focus-trailing-icon-color: var(--md-filled-autocomplete-text-field-error-focus-trailing-icon-color, var(--md-sys-color-error, #b3261e));--_text-field-error-hover-active-indicator-color: var(--md-filled-autocomplete-text-field-error-hover-active-indicator-color, var(--md-sys-color-on-error-container, #410e0b));--_text-field-error-hover-input-text-color: var(--md-filled-autocomplete-text-field-error-hover-input-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_text-field-error-hover-label-text-color: var(--md-filled-autocomplete-text-field-error-hover-label-text-color, var(--md-sys-color-on-error-container, #410e0b));--_text-field-error-hover-leading-icon-color: var(--md-filled-autocomplete-text-field-error-hover-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-error-hover-state-layer-color: var(--md-filled-autocomplete-text-field-error-hover-state-layer-color, var(--md-sys-color-on-surface, #1c1b1f));--_text-field-error-hover-state-layer-opacity: var(--md-filled-autocomplete-text-field-error-hover-state-layer-opacity, 0.08);--_text-field-error-hover-supporting-text-color: var(--md-filled-autocomplete-text-field-error-hover-supporting-text-color, var(--md-sys-color-error, #b3261e));--_text-field-error-hover-trailing-icon-color: var(--md-filled-autocomplete-text-field-error-hover-trailing-icon-color, var(--md-sys-color-on-error-container, #410e0b));--_text-field-error-input-text-color: var(--md-filled-autocomplete-text-field-error-input-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_text-field-error-label-text-color: var(--md-filled-autocomplete-text-field-error-label-text-color, var(--md-sys-color-error, #b3261e));--_text-field-error-leading-icon-color: var(--md-filled-autocomplete-text-field-error-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-error-supporting-text-color: var(--md-filled-autocomplete-text-field-error-supporting-text-color, var(--md-sys-color-error, #b3261e));--_text-field-error-trailing-icon-color: var(--md-filled-autocomplete-text-field-error-trailing-icon-color, var(--md-sys-color-error, #b3261e));--_text-field-focus-active-indicator-color: var(--md-filled-autocomplete-text-field-focus-active-indicator-color, var(--md-sys-color-primary, #6750a4));--_text-field-focus-active-indicator-height: var(--md-filled-autocomplete-text-field-focus-active-indicator-height, 2px);--_text-field-focus-input-text-color: var(--md-filled-autocomplete-text-field-focus-input-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_text-field-focus-label-text-color: var(--md-filled-autocomplete-text-field-focus-label-text-color, var(--md-sys-color-primary, #6750a4));--_text-field-focus-leading-icon-color: var(--md-filled-autocomplete-text-field-focus-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-focus-supporting-text-color: var(--md-filled-autocomplete-text-field-focus-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-focus-trailing-icon-color: var(--md-filled-autocomplete-text-field-focus-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-hover-active-indicator-color: var(--md-filled-autocomplete-text-field-hover-active-indicator-color, var(--md-sys-color-on-surface, #1c1b1f));--_text-field-hover-active-indicator-height: var(--md-filled-autocomplete-text-field-hover-active-indicator-height, 1px);--_text-field-hover-input-text-color: var(--md-filled-autocomplete-text-field-hover-input-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_text-field-hover-label-text-color: var(--md-filled-autocomplete-text-field-hover-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-hover-leading-icon-color: var(--md-filled-autocomplete-text-field-hover-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-hover-state-layer-color: var(--md-filled-autocomplete-text-field-hover-state-layer-color, var(--md-sys-color-on-surface, #1c1b1f));--_text-field-hover-state-layer-opacity: var(--md-filled-autocomplete-text-field-hover-state-layer-opacity, 0.08);--_text-field-hover-supporting-text-color: var(--md-filled-autocomplete-text-field-hover-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-hover-trailing-icon-color: var(--md-filled-autocomplete-text-field-hover-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-input-text-color: var(--md-filled-autocomplete-text-field-input-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_text-field-input-text-font: var(--md-filled-autocomplete-text-field-input-text-font, Roboto);--_text-field-input-text-line-height: var(--md-filled-autocomplete-text-field-input-text-line-height, 1.5rem);--_text-field-input-text-size: var(--md-filled-autocomplete-text-field-input-text-size, 1rem);--_text-field-input-text-tracking: var(--md-filled-autocomplete-text-field-input-text-tracking, 0.031rem);--_text-field-input-text-type: var(--md-filled-autocomplete-text-field-input-text-type, 400 1rem / 1.5rem Roboto);--_text-field-input-text-weight: var(--md-filled-autocomplete-text-field-input-text-weight, 400);--_text-field-label-text-color: var(--md-filled-autocomplete-text-field-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-label-text-font: var(--md-filled-autocomplete-text-field-label-text-font, Roboto);--_text-field-label-text-line-height: var(--md-filled-autocomplete-text-field-label-text-line-height, 1.5rem);--_text-field-label-text-populated-line-height: var(--md-filled-autocomplete-text-field-label-text-populated-line-height, 1rem);--_text-field-label-text-populated-size: var(--md-filled-autocomplete-text-field-label-text-populated-size, 0.75rem);--_text-field-label-text-size: var(--md-filled-autocomplete-text-field-label-text-size, 1rem);--_text-field-label-text-tracking: var(--md-filled-autocomplete-text-field-label-text-tracking, 0.031rem);--_text-field-label-text-type: var(--md-filled-autocomplete-text-field-label-text-type, 400 1rem / 1.5rem Roboto);--_text-field-label-text-weight: var(--md-filled-autocomplete-text-field-label-text-weight, 400);--_text-field-leading-icon-color: var(--md-filled-autocomplete-text-field-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-leading-icon-size: var(--md-filled-autocomplete-text-field-leading-icon-size, 20px);--_text-field-supporting-text-color: var(--md-filled-autocomplete-text-field-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-supporting-text-font: var(--md-filled-autocomplete-text-field-supporting-text-font, Roboto);--_text-field-supporting-text-line-height: var(--md-filled-autocomplete-text-field-supporting-text-line-height, 1rem);--_text-field-supporting-text-size: var(--md-filled-autocomplete-text-field-supporting-text-size, 0.75rem);--_text-field-supporting-text-tracking: var(--md-filled-autocomplete-text-field-supporting-text-tracking, 0.025rem);--_text-field-supporting-text-type: var(--md-filled-autocomplete-text-field-supporting-text-type, 400 0.75rem / 1rem Roboto);--_text-field-supporting-text-weight: var(--md-filled-autocomplete-text-field-supporting-text-weight, 400);--_text-field-trailing-icon-color: var(--md-filled-autocomplete-text-field-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-trailing-icon-size: var(--md-filled-autocomplete-text-field-trailing-icon-size, 24px)}.md3-text-field{--md-filled-text-field-active-indicator-color:var(--_text-field-active-indicator-color);--md-filled-text-field-active-indicator-height:var(--_text-field-active-indicator-height);--md-filled-text-field-caret-color:var(--_text-field-caret-color);--md-filled-text-field-container-color:var(--_text-field-container-color);--md-filled-text-field-disabled-active-indicator-color:var(--_text-field-disabled-active-indicator-color);--md-filled-text-field-disabled-active-indicator-height:var(--_text-field-disabled-active-indicator-height);--md-filled-text-field-disabled-active-indicator-opacity:var(--_text-field-disabled-active-indicator-opacity);--md-filled-text-field-disabled-container-color:var(--_text-field-disabled-container-color);--md-filled-text-field-disabled-container-opacity:var(--_text-field-disabled-container-opacity);--md-filled-text-field-disabled-input-text-color:var(--_text-field-disabled-input-text-color);--md-filled-text-field-disabled-input-text-opacity:var(--_text-field-disabled-input-text-opacity);--md-filled-text-field-disabled-label-text-color:var(--_text-field-disabled-label-text-color);--md-filled-text-field-disabled-label-text-opacity:var(--_text-field-disabled-label-text-opacity);--md-filled-text-field-disabled-leading-icon-color:var(--_text-field-disabled-leading-icon-color);--md-filled-text-field-disabled-leading-icon-opacity:var(--_text-field-disabled-leading-icon-opacity);--md-filled-text-field-disabled-supporting-text-color:var(--_text-field-disabled-supporting-text-color);--md-filled-text-field-disabled-supporting-text-opacity:var(--_text-field-disabled-supporting-text-opacity);--md-filled-text-field-disabled-trailing-icon-color:var(--_text-field-disabled-trailing-icon-color);--md-filled-text-field-disabled-trailing-icon-opacity:var(--_text-field-disabled-trailing-icon-opacity);--md-filled-text-field-error-active-indicator-color:var(--_text-field-error-active-indicator-color);--md-filled-text-field-error-focus-active-indicator-color:var(--_text-field-error-focus-active-indicator-color);--md-filled-text-field-error-focus-caret-color:var(--_text-field-error-focus-caret-color);--md-filled-text-field-error-focus-input-text-color:var(--_text-field-error-focus-input-text-color);--md-filled-text-field-error-focus-label-text-color:var(--_text-field-error-focus-label-text-color);--md-filled-text-field-error-focus-leading-icon-color:var(--_text-field-error-focus-leading-icon-color);--md-filled-text-field-error-focus-supporting-text-color:var(--_text-field-error-focus-supporting-text-color);--md-filled-text-field-error-focus-trailing-icon-color:var(--_text-field-error-focus-trailing-icon-color);--md-filled-text-field-error-hover-active-indicator-color:var(--_text-field-error-hover-active-indicator-color);--md-filled-text-field-error-hover-input-text-color:var(--_text-field-error-hover-input-text-color);--md-filled-text-field-error-hover-label-text-color:var(--_text-field-error-hover-label-text-color);--md-filled-text-field-error-hover-leading-icon-color:var(--_text-field-error-hover-leading-icon-color);--md-filled-text-field-error-hover-state-layer-color:var(--_text-field-error-hover-state-layer-color);--md-filled-text-field-error-hover-state-layer-opacity:var(--_text-field-error-hover-state-layer-opacity);--md-filled-text-field-error-hover-supporting-text-color:var(--_text-field-error-hover-supporting-text-color);--md-filled-text-field-error-hover-trailing-icon-color:var(--_text-field-error-hover-trailing-icon-color);--md-filled-text-field-error-input-text-color:var(--_text-field-error-input-text-color);--md-filled-text-field-error-label-text-color:var(--_text-field-error-label-text-color);--md-filled-text-field-error-leading-icon-color:var(--_text-field-error-leading-icon-color);--md-filled-text-field-error-supporting-text-color:var(--_text-field-error-supporting-text-color);--md-filled-text-field-error-trailing-icon-color:var(--_text-field-error-trailing-icon-color);--md-filled-text-field-focus-active-indicator-color:var(--_text-field-focus-active-indicator-color);--md-filled-text-field-focus-active-indicator-height:var(--_text-field-focus-active-indicator-height);--md-filled-text-field-focus-input-text-color:var(--_text-field-focus-input-text-color);--md-filled-text-field-focus-label-text-color:var(--_text-field-focus-label-text-color);--md-filled-text-field-focus-leading-icon-color:var(--_text-field-focus-leading-icon-color);--md-filled-text-field-focus-supporting-text-color:var(--_text-field-focus-supporting-text-color);--md-filled-text-field-focus-trailing-icon-color:var(--_text-field-focus-trailing-icon-color);--md-filled-text-field-hover-active-indicator-color:var(--_text-field-hover-active-indicator-color);--md-filled-text-field-hover-active-indicator-height:var(--_text-field-hover-active-indicator-height);--md-filled-text-field-hover-input-text-color:var(--_text-field-hover-input-text-color);--md-filled-text-field-hover-label-text-color:var(--_text-field-hover-label-text-color);--md-filled-text-field-hover-leading-icon-color:var(--_text-field-hover-leading-icon-color);--md-filled-text-field-hover-state-layer-color:var(--_text-field-hover-state-layer-color);--md-filled-text-field-hover-state-layer-opacity:var(--_text-field-hover-state-layer-opacity);--md-filled-text-field-hover-supporting-text-color:var(--_text-field-hover-supporting-text-color);--md-filled-text-field-hover-trailing-icon-color:var(--_text-field-hover-trailing-icon-color);--md-filled-text-field-input-text-color:var(--_text-field-input-text-color);--md-filled-text-field-input-text-font:var(--_text-field-input-text-font);--md-filled-text-field-input-text-line-height:var(--_text-field-input-text-line-height);--md-filled-text-field-input-text-size:var(--_text-field-input-text-size);--md-filled-text-field-input-text-tracking:var(--_text-field-input-text-tracking);--md-filled-text-field-input-text-type:var(--_text-field-input-text-type);--md-filled-text-field-input-text-weight:var(--_text-field-input-text-weight);--md-filled-text-field-label-text-color:var(--_text-field-label-text-color);--md-filled-text-field-label-text-font:var(--_text-field-label-text-font);--md-filled-text-field-label-text-line-height:var(--_text-field-label-text-line-height);--md-filled-text-field-label-text-populated-line-height:var(--_text-field-label-text-populated-line-height);--md-filled-text-field-label-text-populated-size:var(--_text-field-label-text-populated-size);--md-filled-text-field-label-text-size:var(--_text-field-label-text-size);--md-filled-text-field-label-text-tracking:var(--_text-field-label-text-tracking);--md-filled-text-field-label-text-type:var(--_text-field-label-text-type);--md-filled-text-field-label-text-weight:var(--_text-field-label-text-weight);--md-filled-text-field-leading-icon-color:var(--_text-field-leading-icon-color);--md-filled-text-field-leading-icon-size:var(--_text-field-leading-icon-size);--md-filled-text-field-supporting-text-color:var(--_text-field-supporting-text-color);--md-filled-text-field-supporting-text-font:var(--_text-field-supporting-text-font);--md-filled-text-field-supporting-text-line-height:var(--_text-field-supporting-text-line-height);--md-filled-text-field-supporting-text-size:var(--_text-field-supporting-text-size);--md-filled-text-field-supporting-text-tracking:var(--_text-field-supporting-text-tracking);--md-filled-text-field-supporting-text-weight:var(--_text-field-supporting-text-weight);--md-filled-text-field-trailing-icon-color:var(--_text-field-trailing-icon-color);--md-filled-text-field-trailing-icon-size:var(--_text-field-trailing-icon-size);--md-filled-field-container-shape-start-start:var(--_text-field-container-shape-start-start);--md-filled-field-container-shape-start-end:var(--_text-field-container-shape-start-end);--md-filled-field-container-shape-end-end:var(--_text-field-container-shape-end-end);--md-filled-field-container-shape-end-start:var(--_text-field-container-shape-end-start)}.md3-autocomplete__menu-surface{--md-menu-surface-container-elevation:var(--_menu-container-elevation);--md-menu-surface-container-shape:var(--_menu-container-shape);--md-menu-surface-container-shadow-color:var(--_menu-container-shadow-color)}/*# sourceMappingURL=filled-styles.css.map */ -`; -//# sourceMappingURL=filled-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/outlined-styles.css.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/outlined-styles.css.d.ts deleted file mode 100644 index 1c75ade..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/outlined-styles.css.d.ts +++ /dev/null
@@ -1 +0,0 @@ -export declare const styles: import("lit").CSSResult;
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/outlined-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/outlined-styles.css.js deleted file mode 100644 index bbec25a..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/outlined-styles.css.js +++ /dev/null
@@ -1,9 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { css } from 'lit'; -export const styles = css `:host{--_text-field-container-shape-start-start: var(--md-outlined-autocomplete-text-field-container-shape-start-start, 4px);--_text-field-container-shape-start-end: var(--md-outlined-autocomplete-text-field-container-shape-start-end, 4px);--_text-field-container-shape-end-end: var(--md-outlined-autocomplete-text-field-container-shape-end-end, 4px);--_text-field-container-shape-end-start: var(--md-outlined-autocomplete-text-field-container-shape-end-start, 4px);--_menu-cascading-menu-indicator-icon-color: var(--md-outlined-autocomplete-menu-cascading-menu-indicator-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_menu-cascading-menu-indicator-icon-size: var(--md-outlined-autocomplete-menu-cascading-menu-indicator-icon-size, 24px);--_menu-container-color: var(--md-outlined-autocomplete-menu-container-color, var(--md-sys-color-surface, #fffbfe));--_menu-container-elevation: var(--md-outlined-autocomplete-menu-container-elevation, 2);--_menu-container-shadow-color: var(--md-outlined-autocomplete-menu-container-shadow-color, var(--md-sys-color-shadow, #000));--_menu-container-shape: var(--md-outlined-autocomplete-menu-container-shape, 4px);--_menu-container-surface-tint-layer-color: var(--md-outlined-autocomplete-menu-container-surface-tint-layer-color, var(--md-sys-color-primary, #6750a4));--_menu-divider-color: var(--md-outlined-autocomplete-menu-divider-color, var(--md-sys-color-surface-variant, #e7e0ec));--_menu-divider-height: var(--md-outlined-autocomplete-menu-divider-height, 1px);--_menu-list-item-container-height: var(--md-outlined-autocomplete-menu-list-item-container-height, 48px);--_menu-list-item-label-text-color: var(--md-outlined-autocomplete-menu-list-item-label-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_menu-list-item-label-text-font: var(--md-outlined-autocomplete-menu-list-item-label-text-font, Roboto);--_menu-list-item-label-text-line-height: var(--md-outlined-autocomplete-menu-list-item-label-text-line-height, 1.25rem);--_menu-list-item-label-text-size: var(--md-outlined-autocomplete-menu-list-item-label-text-size, 0.875rem);--_menu-list-item-label-text-tracking: var(--md-outlined-autocomplete-menu-list-item-label-text-tracking, 0.006rem);--_menu-list-item-label-text-type: var(--md-outlined-autocomplete-menu-list-item-label-text-type, 500 0.875rem / 1.25rem Roboto);--_menu-list-item-label-text-weight: var(--md-outlined-autocomplete-menu-list-item-label-text-weight, 500);--_menu-list-item-selected-container-color: var(--md-outlined-autocomplete-menu-list-item-selected-container-color, var(--md-sys-color-surface-variant, #e7e0ec));--_text-field-caret-color: var(--md-outlined-autocomplete-text-field-caret-color, var(--md-sys-color-primary, #6750a4));--_text-field-container-color: var(--md-outlined-autocomplete-text-field-container-color, var(--md-sys-color-surface-variant, #e7e0ec));--_text-field-disabled-input-text-color: var(--md-outlined-autocomplete-text-field-disabled-input-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_text-field-disabled-input-text-opacity: var(--md-outlined-autocomplete-text-field-disabled-input-text-opacity, 0.38);--_text-field-disabled-label-text-color: var(--md-outlined-autocomplete-text-field-disabled-label-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_text-field-disabled-label-text-opacity: var(--md-outlined-autocomplete-text-field-disabled-label-text-opacity, 0.38);--_text-field-disabled-leading-icon-color: var(--md-outlined-autocomplete-text-field-disabled-leading-icon-color, var(--md-sys-color-on-surface, #1c1b1f));--_text-field-disabled-leading-icon-opacity: var(--md-outlined-autocomplete-text-field-disabled-leading-icon-opacity, 0.38);--_text-field-disabled-outline-color: var(--md-outlined-autocomplete-text-field-disabled-outline-color, var(--md-sys-color-on-surface, #1c1b1f));--_text-field-disabled-outline-opacity: var(--md-outlined-autocomplete-text-field-disabled-outline-opacity, 0.12);--_text-field-disabled-outline-width: var(--md-outlined-autocomplete-text-field-disabled-outline-width, 1px);--_text-field-disabled-supporting-text-color: var(--md-outlined-autocomplete-text-field-disabled-supporting-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_text-field-disabled-supporting-text-opacity: var(--md-outlined-autocomplete-text-field-disabled-supporting-text-opacity, 0.38);--_text-field-disabled-trailing-icon-color: var(--md-outlined-autocomplete-text-field-disabled-trailing-icon-color, var(--md-sys-color-on-surface, #1c1b1f));--_text-field-disabled-trailing-icon-opacity: var(--md-outlined-autocomplete-text-field-disabled-trailing-icon-opacity, 0.38);--_text-field-error-focus-caret-color: var(--md-outlined-autocomplete-text-field-error-focus-caret-color, var(--md-sys-color-error, #b3261e));--_text-field-error-focus-input-text-color: var(--md-outlined-autocomplete-text-field-error-focus-input-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_text-field-error-focus-label-text-color: var(--md-outlined-autocomplete-text-field-error-focus-label-text-color, var(--md-sys-color-error, #b3261e));--_text-field-error-focus-leading-icon-color: var(--md-outlined-autocomplete-text-field-error-focus-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-error-focus-outline-color: var(--md-outlined-autocomplete-text-field-error-focus-outline-color, var(--md-sys-color-error, #b3261e));--_text-field-error-focus-supporting-text-color: var(--md-outlined-autocomplete-text-field-error-focus-supporting-text-color, var(--md-sys-color-error, #b3261e));--_text-field-error-focus-trailing-icon-color: var(--md-outlined-autocomplete-text-field-error-focus-trailing-icon-color, var(--md-sys-color-error, #b3261e));--_text-field-error-hover-input-text-color: var(--md-outlined-autocomplete-text-field-error-hover-input-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_text-field-error-hover-label-text-color: var(--md-outlined-autocomplete-text-field-error-hover-label-text-color, var(--md-sys-color-on-error-container, #410e0b));--_text-field-error-hover-leading-icon-color: var(--md-outlined-autocomplete-text-field-error-hover-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-error-hover-outline-color: var(--md-outlined-autocomplete-text-field-error-hover-outline-color, var(--md-sys-color-on-error-container, #410e0b));--_text-field-error-hover-state-layer-color: var(--md-outlined-autocomplete-text-field-error-hover-state-layer-color, var(--md-sys-color-on-surface, #1c1b1f));--_text-field-error-hover-state-layer-opacity: var(--md-outlined-autocomplete-text-field-error-hover-state-layer-opacity, 0.08);--_text-field-error-hover-supporting-text-color: var(--md-outlined-autocomplete-text-field-error-hover-supporting-text-color, var(--md-sys-color-error, #b3261e));--_text-field-error-hover-trailing-icon-color: var(--md-outlined-autocomplete-text-field-error-hover-trailing-icon-color, var(--md-sys-color-on-error-container, #410e0b));--_text-field-error-input-text-color: var(--md-outlined-autocomplete-text-field-error-input-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_text-field-error-label-text-color: var(--md-outlined-autocomplete-text-field-error-label-text-color, var(--md-sys-color-error, #b3261e));--_text-field-error-leading-icon-color: var(--md-outlined-autocomplete-text-field-error-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-error-outline-color: var(--md-outlined-autocomplete-text-field-error-outline-color, var(--md-sys-color-error, #b3261e));--_text-field-error-supporting-text-color: var(--md-outlined-autocomplete-text-field-error-supporting-text-color, var(--md-sys-color-error, #b3261e));--_text-field-error-trailing-icon-color: var(--md-outlined-autocomplete-text-field-error-trailing-icon-color, var(--md-sys-color-error, #b3261e));--_text-field-focus-input-text-color: var(--md-outlined-autocomplete-text-field-focus-input-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_text-field-focus-label-text-color: var(--md-outlined-autocomplete-text-field-focus-label-text-color, var(--md-sys-color-primary, #6750a4));--_text-field-focus-leading-icon-color: var(--md-outlined-autocomplete-text-field-focus-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-focus-outline-color: var(--md-outlined-autocomplete-text-field-focus-outline-color, var(--md-sys-color-primary, #6750a4));--_text-field-focus-outline-width: var(--md-outlined-autocomplete-text-field-focus-outline-width, 2px);--_text-field-focus-supporting-text-color: var(--md-outlined-autocomplete-text-field-focus-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-focus-trailing-icon-color: var(--md-outlined-autocomplete-text-field-focus-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-hover-input-text-color: var(--md-outlined-autocomplete-text-field-hover-input-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_text-field-hover-label-text-color: var(--md-outlined-autocomplete-text-field-hover-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-hover-leading-icon-color: var(--md-outlined-autocomplete-text-field-hover-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-hover-outline-color: var(--md-outlined-autocomplete-text-field-hover-outline-color, var(--md-sys-color-on-surface, #1c1b1f));--_text-field-hover-outline-width: var(--md-outlined-autocomplete-text-field-hover-outline-width, 1px);--_text-field-hover-state-layer-color: var(--md-outlined-autocomplete-text-field-hover-state-layer-color, var(--md-sys-color-on-surface, #1c1b1f));--_text-field-hover-state-layer-opacity: var(--md-outlined-autocomplete-text-field-hover-state-layer-opacity, 0.08);--_text-field-hover-supporting-text-color: var(--md-outlined-autocomplete-text-field-hover-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-hover-trailing-icon-color: var(--md-outlined-autocomplete-text-field-hover-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-input-text-color: var(--md-outlined-autocomplete-text-field-input-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_text-field-input-text-font: var(--md-outlined-autocomplete-text-field-input-text-font, Roboto);--_text-field-input-text-line-height: var(--md-outlined-autocomplete-text-field-input-text-line-height, 1.5rem);--_text-field-input-text-size: var(--md-outlined-autocomplete-text-field-input-text-size, 1rem);--_text-field-input-text-tracking: var(--md-outlined-autocomplete-text-field-input-text-tracking, 0.031rem);--_text-field-input-text-type: var(--md-outlined-autocomplete-text-field-input-text-type, 400 1rem / 1.5rem Roboto);--_text-field-input-text-weight: var(--md-outlined-autocomplete-text-field-input-text-weight, 400);--_text-field-label-text-color: var(--md-outlined-autocomplete-text-field-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-label-text-font: var(--md-outlined-autocomplete-text-field-label-text-font, Roboto);--_text-field-label-text-line-height: var(--md-outlined-autocomplete-text-field-label-text-line-height, 1.5rem);--_text-field-label-text-populated-line-height: var(--md-outlined-autocomplete-text-field-label-text-populated-line-height, 1rem);--_text-field-label-text-populated-size: var(--md-outlined-autocomplete-text-field-label-text-populated-size, 0.75rem);--_text-field-label-text-size: var(--md-outlined-autocomplete-text-field-label-text-size, 1rem);--_text-field-label-text-tracking: var(--md-outlined-autocomplete-text-field-label-text-tracking, 0.031rem);--_text-field-label-text-type: var(--md-outlined-autocomplete-text-field-label-text-type, 400 1rem / 1.5rem Roboto);--_text-field-label-text-weight: var(--md-outlined-autocomplete-text-field-label-text-weight, 400);--_text-field-leading-icon-color: var(--md-outlined-autocomplete-text-field-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-leading-icon-size: var(--md-outlined-autocomplete-text-field-leading-icon-size, 24px);--_text-field-outline-color: var(--md-outlined-autocomplete-text-field-outline-color, var(--md-sys-color-outline, #79747e));--_text-field-outline-width: var(--md-outlined-autocomplete-text-field-outline-width, 1px);--_text-field-supporting-text-color: var(--md-outlined-autocomplete-text-field-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-supporting-text-font: var(--md-outlined-autocomplete-text-field-supporting-text-font, Roboto);--_text-field-supporting-text-line-height: var(--md-outlined-autocomplete-text-field-supporting-text-line-height, 1rem);--_text-field-supporting-text-size: var(--md-outlined-autocomplete-text-field-supporting-text-size, 0.75rem);--_text-field-supporting-text-tracking: var(--md-outlined-autocomplete-text-field-supporting-text-tracking, 0.025rem);--_text-field-supporting-text-type: var(--md-outlined-autocomplete-text-field-supporting-text-type, 400 0.75rem / 1rem Roboto);--_text-field-supporting-text-weight: var(--md-outlined-autocomplete-text-field-supporting-text-weight, 400);--_text-field-trailing-icon-color: var(--md-outlined-autocomplete-text-field-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-trailing-icon-size: var(--md-outlined-autocomplete-text-field-trailing-icon-size, 24px);--_text-field-container-shape: var(--md-outlined-autocomplete-text-field-container-shape, 4px)}.md3-text-field{--md-outlined-text-field-caret-color:var(--_text-field-caret-color);--md-outlined-text-field-disabled-input-text-color:var(--_text-field-disabled-input-text-color);--md-outlined-text-field-disabled-input-text-opacity:var(--_text-field-disabled-input-text-opacity);--md-outlined-text-field-disabled-label-text-color:var(--_text-field-disabled-label-text-color);--md-outlined-text-field-disabled-label-text-opacity:var(--_text-field-disabled-label-text-opacity);--md-outlined-text-field-disabled-leading-icon-color:var(--_text-field-disabled-leading-icon-color);--md-outlined-text-field-disabled-leading-icon-opacity:var(--_text-field-disabled-leading-icon-opacity);--md-outlined-text-field-disabled-outline-color:var(--_text-field-disabled-outline-color);--md-outlined-text-field-disabled-outline-opacity:var(--_text-field-disabled-outline-opacity);--md-outlined-text-field-disabled-outline-width:var(--_text-field-disabled-outline-width);--md-outlined-text-field-disabled-supporting-text-color:var(--_text-field-disabled-supporting-text-color);--md-outlined-text-field-disabled-supporting-text-opacity:var(--_text-field-disabled-supporting-text-opacity);--md-outlined-text-field-disabled-trailing-icon-color:var(--_text-field-disabled-trailing-icon-color);--md-outlined-text-field-disabled-trailing-icon-opacity:var(--_text-field-disabled-trailing-icon-opacity);--md-outlined-text-field-error-focus-caret-color:var(--_text-field-error-focus-caret-color);--md-outlined-text-field-error-focus-input-text-color:var(--_text-field-error-focus-input-text-color);--md-outlined-text-field-error-focus-label-text-color:var(--_text-field-error-focus-label-text-color);--md-outlined-text-field-error-focus-leading-icon-color:var(--_text-field-error-focus-leading-icon-color);--md-outlined-text-field-error-focus-outline-color:var(--_text-field-error-focus-outline-color);--md-outlined-text-field-error-focus-supporting-text-color:var(--_text-field-error-focus-supporting-text-color);--md-outlined-text-field-error-focus-trailing-icon-color:var(--_text-field-error-focus-trailing-icon-color);--md-outlined-text-field-error-hover-input-text-color:var(--_text-field-error-hover-input-text-color);--md-outlined-text-field-error-hover-label-text-color:var(--_text-field-error-hover-label-text-color);--md-outlined-text-field-error-hover-leading-icon-color:var(--_text-field-error-hover-leading-icon-color);--md-outlined-text-field-error-hover-outline-color:var(--_text-field-error-hover-outline-color);--md-outlined-text-field-error-hover-supporting-text-color:var(--_text-field-error-hover-supporting-text-color);--md-outlined-text-field-error-hover-trailing-icon-color:var(--_text-field-error-hover-trailing-icon-color);--md-outlined-text-field-error-input-text-color:var(--_text-field-error-input-text-color);--md-outlined-text-field-error-label-text-color:var(--_text-field-error-label-text-color);--md-outlined-text-field-error-leading-icon-color:var(--_text-field-error-leading-icon-color);--md-outlined-text-field-error-outline-color:var(--_text-field-error-outline-color);--md-outlined-text-field-error-supporting-text-color:var(--_text-field-error-supporting-text-color);--md-outlined-text-field-error-trailing-icon-color:var(--_text-field-error-trailing-icon-color);--md-outlined-text-field-focus-input-text-color:var(--_text-field-focus-input-text-color);--md-outlined-text-field-focus-label-text-color:var(--_text-field-focus-label-text-color);--md-outlined-text-field-focus-leading-icon-color:var(--_text-field-focus-leading-icon-color);--md-outlined-text-field-focus-outline-color:var(--_text-field-focus-outline-color);--md-outlined-text-field-focus-outline-width:var(--_text-field-focus-outline-width);--md-outlined-text-field-focus-supporting-text-color:var(--_text-field-focus-supporting-text-color);--md-outlined-text-field-focus-trailing-icon-color:var(--_text-field-focus-trailing-icon-color);--md-outlined-text-field-hover-input-text-color:var(--_text-field-hover-input-text-color);--md-outlined-text-field-hover-label-text-color:var(--_text-field-hover-label-text-color);--md-outlined-text-field-hover-leading-icon-color:var(--_text-field-hover-leading-icon-color);--md-outlined-text-field-hover-outline-color:var(--_text-field-hover-outline-color);--md-outlined-text-field-hover-outline-width:var(--_text-field-hover-outline-width);--md-outlined-text-field-hover-supporting-text-color:var(--_text-field-hover-supporting-text-color);--md-outlined-text-field-hover-trailing-icon-color:var(--_text-field-hover-trailing-icon-color);--md-outlined-text-field-input-text-color:var(--_text-field-input-text-color);--md-outlined-text-field-input-text-font:var(--_text-field-input-text-font);--md-outlined-text-field-input-text-line-height:var(--_text-field-input-text-line-height);--md-outlined-text-field-input-text-size:var(--_text-field-input-text-size);--md-outlined-text-field-input-text-tracking:var(--_text-field-input-text-tracking);--md-outlined-text-field-input-text-type:var(--_text-field-input-text-type);--md-outlined-text-field-input-text-weight:var(--_text-field-input-text-weight);--md-outlined-text-field-label-text-color:var(--_text-field-label-text-color);--md-outlined-text-field-label-text-font:var(--_text-field-label-text-font);--md-outlined-text-field-label-text-line-height:var(--_text-field-label-text-line-height);--md-outlined-text-field-label-text-populated-line-height:var(--_text-field-label-text-populated-line-height);--md-outlined-text-field-label-text-populated-size:var(--_text-field-label-text-populated-size);--md-outlined-text-field-label-text-size:var(--_text-field-label-text-size);--md-outlined-text-field-label-text-tracking:var(--_text-field-label-text-tracking);--md-outlined-text-field-label-text-type:var(--_text-field-label-text-type);--md-outlined-text-field-label-text-weight:var(--_text-field-label-text-weight);--md-outlined-text-field-leading-icon-color:var(--_text-field-leading-icon-color);--md-outlined-text-field-leading-icon-size:var(--_text-field-leading-icon-size);--md-outlined-text-field-outline-color:var(--_text-field-outline-color);--md-outlined-text-field-outline-width:var(--_text-field-outline-width);--md-outlined-text-field-supporting-text-color:var(--_text-field-supporting-text-color);--md-outlined-text-field-supporting-text-font:var(--_text-field-supporting-text-font);--md-outlined-text-field-supporting-text-line-height:var(--_text-field-supporting-text-line-height);--md-outlined-text-field-supporting-text-size:var(--_text-field-supporting-text-size);--md-outlined-text-field-supporting-text-tracking:var(--_text-field-supporting-text-tracking);--md-outlined-text-field-supporting-text-weight:var(--_text-field-supporting-text-weight);--md-outlined-text-field-trailing-icon-color:var(--_text-field-trailing-icon-color);--md-outlined-text-field-trailing-icon-size:var(--_text-field-trailing-icon-size);--md-outlined-field-container-shape-start-start:var(--_text-field-container-shape-start-start);--md-outlined-field-container-shape-start-end:var(--_text-field-container-shape-start-end);--md-outlined-field-container-shape-end-end:var(--_text-field-container-shape-end-end);--md-outlined-field-container-shape-end-start:var(--_text-field-container-shape-end-start)}.md3-autocomplete__menu-surface{--md-menu-surface-container-elevation:var(--_menu-container-elevation);--md-menu-surface-container-shape:var(--_menu-container-shape);--md-menu-surface-container-shadow-color:var(--_menu-container-shadow-color)}/*# sourceMappingURL=outlined-styles.css.map */ -`; -//# sourceMappingURL=outlined-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/shared-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/shared-styles.css.js deleted file mode 100644 index e795239..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/shared-styles.css.js +++ /dev/null
@@ -1,9 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { css } from 'lit'; -export const styles = css `.md3-autocomplete{display:inline-flex;flex:1}/*# sourceMappingURL=shared-styles.css.map */ -`; -//# sourceMappingURL=shared-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/outlined-autocomplete.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/outlined-autocomplete.d.ts deleted file mode 100644 index 891f7e9c..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/outlined-autocomplete.d.ts +++ /dev/null
@@ -1,30 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import '../field/outlined-field.js'; -import './autocomplete-list.js'; -import './autocomplete-surface.js'; -import { ClassInfo } from 'lit/directives/class-map.js'; -import { Autocomplete } from './lib/autocomplete.js'; -declare global { - interface HTMLElementTagNameMap { - 'md-outlined-autocomplete': MdOutlinedAutocomplete; - } -} -/** - * @soyCompatible - * @final - * @suppress {visibility} - */ -export declare class MdOutlinedAutocomplete extends Autocomplete { - static styles: import("lit").CSSResult[]; - protected readonly listTag: import("lit-html/static.js").StaticValue; - protected readonly menuSurfaceTag: import("lit-html/static.js").StaticValue; - protected readonly fieldTag: import("lit-html/static.js").StaticValue; - /** @soyTemplate */ - protected getAutocompleteRenderClasses(): ClassInfo; - /** @soyTemplate */ - protected getRenderClasses(): ClassInfo; -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/outlined-autocomplete.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/outlined-autocomplete.js deleted file mode 100644 index a743671..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/outlined-autocomplete.js +++ /dev/null
@@ -1,53 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { __decorate } from "tslib"; -import '../field/outlined-field.js'; -import './autocomplete-list.js'; -import './autocomplete-surface.js'; -import { customElement } from 'lit/decorators.js'; -import { literal } from 'lit/static-html.js'; -import { styles as outlinedForcedColorsStyles } from '../textfield/lib/outlined-forced-colors-styles.css.js'; -import { styles as outlinedStyles } from '../textfield/lib/outlined-styles.css.js'; -import { styles as sharedStyles } from '../textfield/lib/shared-styles.css.js'; -import { Autocomplete } from './lib/autocomplete.js'; -import { styles as autocompleteStyles } from './lib/outlined-styles.css.js'; -import { styles as sharedAutocompleteStyles } from './lib/shared-styles.css.js'; -/** - * @soyCompatible - * @final - * @suppress {visibility} - */ -let MdOutlinedAutocomplete = class MdOutlinedAutocomplete extends Autocomplete { - constructor() { - super(...arguments); - this.listTag = literal `md-autocomplete-list`; - this.menuSurfaceTag = literal `md-autocomplete-surface`; - this.fieldTag = literal `md-outlined-field`; - } - /** @soyTemplate */ - getAutocompleteRenderClasses() { - return { - ...super.getAutocompleteRenderClasses(), - 'md3-autocomplete--outlined': true, - }; - } - /** @soyTemplate */ - getRenderClasses() { - return { - ...super.getRenderClasses(), - 'md3-text-field--outlined': true, - }; - } -}; -MdOutlinedAutocomplete.styles = [ - sharedStyles, outlinedStyles, outlinedForcedColorsStyles, - sharedAutocompleteStyles, autocompleteStyles -]; -MdOutlinedAutocomplete = __decorate([ - customElement('md-outlined-autocomplete') -], MdOutlinedAutocomplete); -export { MdOutlinedAutocomplete }; -//# sourceMappingURL=outlined-autocomplete.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/badge/badge.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/badge/badge.d.ts index f2cfc24..cf28a9c 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/badge/badge.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/badge/badge.d.ts
@@ -10,7 +10,6 @@ } } /** - * @soyCompatible * @final * @suppress {visibility} */
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/badge/badge.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/badge/badge.js index 9211bac5..78d6665 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/badge/badge.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/badge/badge.js
@@ -8,7 +8,6 @@ import { Badge } from './lib/badge.js'; import { styles } from './lib/badge-styles.css.js'; /** - * @soyCompatible * @final * @suppress {visibility} */
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/badge/lib/badge-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/badge/lib/badge-styles.css.js index 9bc0663..ceda1ddd 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/badge/lib/badge-styles.css.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/badge/lib/badge-styles.css.js
@@ -4,6 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ import { css } from 'lit'; -export const styles = css `:host{--_color: var(--md-badge-color, var(--md-sys-color-error, #b3261e));--_large-color: var(--md-badge-large-color, var(--md-sys-color-error, #b3261e));--_large-label-text-color: var(--md-badge-large-label-text-color, var(--md-sys-color-on-error, #fff));--_large-label-text-font: var(--md-badge-large-label-text-font, Roboto);--_large-label-text-line-height: var(--md-badge-large-label-text-line-height, 1rem);--_large-label-text-size: var(--md-badge-large-label-text-size, 0.688rem);--_large-label-text-tracking: var(--md-badge-large-label-text-tracking, 0.031rem);--_large-label-text-weight: var(--md-badge-large-label-text-weight, 500);--_large-shape: var(--md-badge-large-shape, 9999px);--_large-size: var(--md-badge-large-size, 16px);--_shape: var(--md-badge-shape, 9999px);--_size: var(--md-badge-size, 6px)}.md3-badge{inset-inline-start:50%;margin-inline-start:6px;margin-block-start:4px;position:absolute;inset-block-start:0px;background-color:var(--_color);border-radius:var(--_shape);height:var(--_size)}.md3-badge:not(.md3-badge--large){width:var(--_size)}.md3-badge.md3-badge--large{display:flex;flex-direction:column;justify-content:center;margin-inline-start:2px;margin-block-start:1px;background-color:var(--_large-color);border-radius:var(--_large-shape);height:var(--_large-size);min-width:var(--_large-size);color:var(--_large-label-text-color)}.md3-badge.md3-badge--large .md3-badge__value{padding:0px 4px}.md3-badge__value{font-family:var(--_large-label-text-font);font-size:var(--_large-label-text-size);letter-spacing:var(--_large-label-text-tracking);line-height:var(--_large-label-text-line-height);font-weight:var(--_large-label-text-weight)}/*# sourceMappingURL=badge-styles.css.map */ +export const styles = css `:host{--_color: var(--md-badge-color, var(--md-sys-color-error, #b3261e));--_large-color: var(--md-badge-large-color, var(--md-sys-color-error, #b3261e));--_large-label-text-color: var(--md-badge-large-label-text-color, var(--md-sys-color-on-error, #fff));--_large-label-text-type: var(--md-badge-large-label-text-type, var(--md-sys-typescale-label-small, 500 0.688rem / 1rem var(--md-ref-typeface-plain, Roboto)));--_large-shape: var(--md-badge-large-shape, 9999px);--_large-size: var(--md-badge-large-size, 16px);--_shape: var(--md-badge-shape, 9999px);--_size: var(--md-badge-size, 6px)}.md3-badge{inset-inline-start:50%;margin-inline-start:6px;margin-block-start:4px;position:absolute;inset-block-start:0px;background-color:var(--_color);border-radius:var(--_shape);height:var(--_size)}.md3-badge:not(.md3-badge--large){width:var(--_size)}.md3-badge.md3-badge--large{display:flex;flex-direction:column;justify-content:center;margin-inline-start:2px;margin-block-start:1px;background-color:var(--_large-color);border-radius:var(--_large-shape);height:var(--_large-size);min-width:var(--_large-size);color:var(--_large-label-text-color)}.md3-badge.md3-badge--large .md3-badge__value{padding:0px 4px}.md3-badge__value{font:var(--_large-label-text-type)}/*# sourceMappingURL=badge-styles.css.map */ `; //# sourceMappingURL=badge-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/badge/lib/badge.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/badge/lib/badge.d.ts index b097263..3225ffc 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/badge/lib/badge.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/badge/lib/badge.d.ts
@@ -3,13 +3,11 @@ * Copyright 2022 Google LLC * SPDX-License-Identifier: Apache-2.0 */ -import { LitElement, TemplateResult } from 'lit'; -import { ClassInfo } from 'lit/directives/class-map.js'; -/** @soyCompatible */ +import { LitElement } from 'lit'; +/** + * TODO(b/265340196): add docs + */ export declare class Badge extends LitElement { value: string; - /** @soyTemplate */ - protected render(): TemplateResult; - /** @soyTemplate */ - protected getRenderClasses(): ClassInfo; + protected render(): import("lit-html").TemplateResult<1>; }
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/badge/lib/badge.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/badge/lib/badge.js index 6e0fd89..e40651e3 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/badge/lib/badge.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/badge/lib/badge.js
@@ -3,29 +3,26 @@ * Copyright 2022 Google LLC * SPDX-License-Identifier: Apache-2.0 */ -import { __decorate, __metadata } from "tslib"; +import { __decorate } from "tslib"; import { html, LitElement } from 'lit'; import { property } from 'lit/decorators.js'; import { classMap } from 'lit/directives/class-map.js'; -/** @soyCompatible */ +/** + * TODO(b/265340196): add docs + */ export class Badge extends LitElement { constructor() { super(...arguments); this.value = ''; } - /** @soyTemplate */ render() { - return html `<div class="md3-badge ${classMap(this.getRenderClasses())}"><p class="md3-badge__value">${this.value}</p></div>`; - } - /** @soyTemplate */ - getRenderClasses() { - return { - 'md3-badge--large': this.value, - }; + const classes = { 'md3-badge--large': this.value }; + return html `<div class="md3-badge ${classMap(classes)}"> + <p class="md3-badge__value">${this.value}</p> + </div>`; } } __decorate([ - property({ type: String }), - __metadata("design:type", Object) + property() ], Badge.prototype, "value", void 0); //# sourceMappingURL=badge.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/elevated-link-button.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/button/elevated-link-button.d.ts deleted file mode 100644 index 4c0a777..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/elevated-link-button.d.ts +++ /dev/null
@@ -1,36 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { ElevatedLinkButton } from './lib/elevated-link-button.js'; -declare global { - interface HTMLElementTagNameMap { - 'md-elevated-link-button': MdElevatedLinkButton; - } -} -/** - * @summary Buttons help people take action, such as sending an email, sharing a - * document, or liking a comment. This is a linkable variant. - * - * @description - * __Emphasis:__ Medium emphasis – For important actions that don’t distract - * from other onscreen elements. - * - * __Rationale:__ Elevated buttons are essentially filled buttons with a lighter - * background color and a shadow. To prevent shadow creep, only use them when - * absolutely necessary, such as when the button requires visual separation from - * a patterned background. - * - * __Example usages:__ - * - Reply - * - View all - * - Add to cart - * - Take out of trash - * - * @final - * @suppress {visibility} - */ -export declare class MdElevatedLinkButton extends ElevatedLinkButton { - static styles: import("lit").CSSResult[]; -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/elevated-link-button.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/button/elevated-link-button.js deleted file mode 100644 index 63007d13..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/elevated-link-button.js +++ /dev/null
@@ -1,41 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { __decorate } from "tslib"; -import { customElement } from 'lit/decorators.js'; -import { ElevatedLinkButton } from './lib/elevated-link-button.js'; -import { styles as elevatedStyles } from './lib/elevated-styles.css.js'; -import { styles as sharedElevationStyles } from './lib/shared-elevation-styles.css.js'; -import { styles as sharedStyles } from './lib/shared-styles.css.js'; -/** - * @summary Buttons help people take action, such as sending an email, sharing a - * document, or liking a comment. This is a linkable variant. - * - * @description - * __Emphasis:__ Medium emphasis – For important actions that don’t distract - * from other onscreen elements. - * - * __Rationale:__ Elevated buttons are essentially filled buttons with a lighter - * background color and a shadow. To prevent shadow creep, only use them when - * absolutely necessary, such as when the button requires visual separation from - * a patterned background. - * - * __Example usages:__ - * - Reply - * - View all - * - Add to cart - * - Take out of trash - * - * @final - * @suppress {visibility} - */ -let MdElevatedLinkButton = class MdElevatedLinkButton extends ElevatedLinkButton { -}; -MdElevatedLinkButton.styles = [sharedStyles, sharedElevationStyles, elevatedStyles]; -MdElevatedLinkButton = __decorate([ - customElement('md-elevated-link-button') -], MdElevatedLinkButton); -export { MdElevatedLinkButton }; -//# sourceMappingURL=elevated-link-button.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/filled-link-button.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/button/filled-link-button.d.ts deleted file mode 100644 index 1b9b0646..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/filled-link-button.d.ts +++ /dev/null
@@ -1,34 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { FilledLinkButton } from './lib/filled-link-button.js'; -declare global { - interface HTMLElementTagNameMap { - 'md-filled-link-button': MdFilledLinkButton; - } -} -/** - * @summary Buttons help people take action, such as sending an email, sharing a - * document, or liking a comment. This is a linkable variant. - * - * @description - * __Emphasis:__ High emphasis – For the primary, most important, or most common - * action on a screen - * - * __Rationale:__ The filled button’s contrasting surface color makes it the - * most prominent button after the FAB. It’s used for final or unblocking - * actions in a flow. - * - * __Example usages:__ - * - Save - * - Confirm - * - Done - * - * @final - * @suppress {visibility} - */ -export declare class MdFilledLinkButton extends FilledLinkButton { - static styles: import("lit").CSSResult[]; -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/filled-link-button.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/button/filled-link-button.js deleted file mode 100644 index 8fa5875..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/filled-link-button.js +++ /dev/null
@@ -1,39 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { __decorate } from "tslib"; -import { customElement } from 'lit/decorators.js'; -import { FilledLinkButton } from './lib/filled-link-button.js'; -import { styles as filledStyles } from './lib/filled-styles.css.js'; -import { styles as sharedElevationStyles } from './lib/shared-elevation-styles.css.js'; -import { styles as sharedStyles } from './lib/shared-styles.css.js'; -/** - * @summary Buttons help people take action, such as sending an email, sharing a - * document, or liking a comment. This is a linkable variant. - * - * @description - * __Emphasis:__ High emphasis – For the primary, most important, or most common - * action on a screen - * - * __Rationale:__ The filled button’s contrasting surface color makes it the - * most prominent button after the FAB. It’s used for final or unblocking - * actions in a flow. - * - * __Example usages:__ - * - Save - * - Confirm - * - Done - * - * @final - * @suppress {visibility} - */ -let MdFilledLinkButton = class MdFilledLinkButton extends FilledLinkButton { -}; -MdFilledLinkButton.styles = [sharedStyles, sharedElevationStyles, filledStyles]; -MdFilledLinkButton = __decorate([ - customElement('md-filled-link-button') -], MdFilledLinkButton); -export { MdFilledLinkButton }; -//# sourceMappingURL=filled-link-button.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/button.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/button.d.ts index e36ee7a..2d3dd7c 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/button.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/button.d.ts
@@ -5,20 +5,26 @@ */ import '../../focus/focus-ring.js'; import '../../ripple/ripple.js'; -import { LitElement, TemplateResult } from 'lit'; -import { ClassInfo } from 'lit/directives/class-map.js'; -import { MdRipple } from '../../ripple/ripple.js'; -import { ARIAHasPopup } from '../../types/aria.js'; -import { ButtonState } from './state.js'; -export declare abstract class Button extends LitElement implements ButtonState { +import { LitElement, nothing, TemplateResult } from 'lit'; +/** + * A button component. + */ +export declare abstract class Button extends LitElement { static shadowRootOptions: ShadowRootInit; - ariaHasPopup: ARIAHasPopup; - ariaLabel: string; /** * Whether or not the button is disabled. */ disabled: boolean; /** + * The URL that the link button points to. + */ + href?: string; + /** + * Where to display the linked `href` URL for a link button. Common options + * include `_blank` to open in a new tab. + */ + target?: string; + /** * Whether to render the icon at the inline end of the label rather than the * inline start. * @@ -26,10 +32,6 @@ */ trailingIcon: boolean; /** - * The button's visible label. - */ - label: string; - /** * Whether to display the icon or not. */ hasIcon: boolean; @@ -39,30 +41,29 @@ * submissions. */ preventClickDefault: boolean; - protected buttonElement: HTMLElement; - protected ripple: Promise<MdRipple | null>; - protected showFocusRing: boolean; - protected showRipple: boolean; - protected assignedIcons: HTMLElement[]; + private readonly buttonElement; + private readonly ripple; + private showRipple; + private readonly assignedIcons; constructor(); - private readonly handleActivationClick; focus(): void; blur(): void; - protected readonly getRipple: () => Promise<MdRipple>; - protected render(): TemplateResult; - protected getRenderClasses(): ClassInfo; - protected renderTouchTarget(): TemplateResult; - protected renderElevation(): TemplateResult; - protected renderRipple: () => TemplateResult<1>; - protected renderOutline(): TemplateResult; - protected renderFocusRing(): TemplateResult; - protected renderLabel(): TemplateResult; - protected renderLeadingIcon(): TemplateResult | string; - protected renderTrailingIcon(): TemplateResult | string; - protected renderIcon(): TemplateResult; - protected handlePointerDown(e: PointerEvent): void; - protected handleClick(e: MouseEvent): void; - protected handleFocus(): void; - protected handleBlur(): void; - protected handleSlotChange(): void; + protected render(): TemplateResult<2 | 1>; + protected getRenderClasses(): { + 'md3-button--icon-leading': boolean; + 'md3-button--icon-trailing': boolean; + }; + protected renderElevation(): TemplateResult | typeof nothing; + protected renderOutline(): TemplateResult | typeof nothing; + private renderTouchTarget; + private readonly handleActivationClick; + private readonly getRipple; + private readonly renderRipple; + private renderFocusRing; + private renderLabel; + private renderLeadingIcon; + private renderTrailingIcon; + private renderIcon; + private handleClick; + private handleSlotChange; }
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/button.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/button.js index fd3f0d4..7422c44 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/button.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/button.js
@@ -3,20 +3,21 @@ * Copyright 2019 Google LLC * SPDX-License-Identifier: Apache-2.0 */ -import { __decorate, __metadata } from "tslib"; -// This is required for @ariaProperty -// tslint:disable:no-new-decorators +var _a; +import { __decorate } from "tslib"; import '../../focus/focus-ring.js'; import '../../ripple/ripple.js'; -import { html, LitElement, nothing } from 'lit'; +import { html, isServer, LitElement, nothing } from 'lit'; import { property, query, queryAssignedElements, queryAsync, state } from 'lit/decorators.js'; import { classMap } from 'lit/directives/class-map.js'; import { when } from 'lit/directives/when.js'; +import { html as staticHtml, literal } from 'lit/static-html.js'; +import { requestUpdateOnAriaChange } from '../../aria/delegate.js'; import { dispatchActivationClick, isActivationClick } from '../../controller/events.js'; -import { ariaProperty } from '../../decorators/aria-property.js'; -import { pointerPress, shouldShowStrongFocus } from '../../focus/strong-focus.js'; import { ripple } from '../../ripple/directive.js'; -// tslint:disable-next-line:enforce-comments-on-exported-symbols +/** + * A button component. + */ export class Button extends LitElement { constructor() { super(); @@ -32,10 +33,6 @@ */ this.trailingIcon = false; /** - * The button's visible label. - */ - this.label = ''; - /** * Whether to display the icon or not. */ this.hasIcon = false; @@ -45,10 +42,9 @@ * submissions. */ this.preventClickDefault = false; - this.showFocusRing = false; this.showRipple = false; this.handleActivationClick = (event) => { - if (!isActivationClick((event))) { + if (!isActivationClick((event)) || !this.buttonElement) { return; } this.focus(); @@ -61,27 +57,34 @@ this.renderRipple = () => { return html `<md-ripple class="md3-button__ripple" ?disabled="${this.disabled}"></md-ripple>`; }; - this.addEventListener('click', this.handleActivationClick); + if (!isServer) { + this.addEventListener('click', this.handleActivationClick); + } } focus() { - this.buttonElement.focus(); + this.buttonElement?.focus(); } blur() { - this.buttonElement.blur(); + this.buttonElement?.blur(); } render() { - // TODO(b/237283903): Replace ifDefined(... || undefined) with ifTruthy(...) - return html ` - <button - class="md3-button ${classMap(this.getRenderClasses())}" - ?disabled="${this.disabled}" - aria-label="${this.ariaLabel || nothing}" - aria-haspopup="${this.ariaHasPopup || nothing}" - @pointerdown="${this.handlePointerDown}" - @focus="${this.handleFocus}" - @blur="${this.handleBlur}" - @click="${this.handleClick}" - ${ripple(this.getRipple)}> + // Link buttons may not be disabled + const isDisabled = this.disabled && !this.href; + const button = this.href ? literal `a` : literal `button`; + // Needed for closure conformance + const { ariaLabel, ariaHasPopup, ariaExpanded } = this; + return staticHtml ` + <${button} + class="md3-button ${classMap(this.getRenderClasses())}" + ?disabled=${isDisabled} + aria-label="${ariaLabel || nothing}" + aria-haspopup="${ariaHasPopup || nothing}" + aria-expanded="${ariaExpanded || nothing}" + href=${this.href || nothing} + target=${this.target || nothing} + @click="${this.handleClick}" + ${ripple(this.getRipple)} + > ${this.renderFocusRing()} ${this.renderElevation()} ${when(this.showRipple, this.renderRipple)} @@ -90,7 +93,7 @@ ${this.renderLeadingIcon()} ${this.renderLabel()} ${this.renderTrailingIcon()} - </button>`; + </${button}>`; } getRenderClasses() { return { @@ -98,100 +101,74 @@ 'md3-button--icon-trailing': this.trailingIcon && this.hasIcon, }; } + renderElevation() { + return nothing; + } + renderOutline() { + return nothing; + } renderTouchTarget() { return html ` <span class="md3-button__touch"></span> `; } - renderElevation() { - return html ``; - } - renderOutline() { - return html ``; - } renderFocusRing() { - return html `<md-focus-ring .visible="${this.showFocusRing}"></md-focus-ring>`; + return html `<md-focus-ring></md-focus-ring>`; } renderLabel() { - return html `<span class="md3-button__label">${this.label}</span>`; + return html `<span class="md3-button__label"><slot></slot></span>`; } renderLeadingIcon() { - return this.trailingIcon ? '' : this.renderIcon(); + return this.trailingIcon ? nothing : this.renderIcon(); } renderTrailingIcon() { - return this.trailingIcon ? this.renderIcon() : ''; + return this.trailingIcon ? this.renderIcon() : nothing; } renderIcon() { return html `<slot name="icon" @slotchange="${this.handleSlotChange}"></slot>`; } - handlePointerDown(e) { - pointerPress(); - this.showFocusRing = shouldShowStrongFocus(); - } handleClick(e) { if (this.preventClickDefault) { e.preventDefault(); } } - handleFocus() { - this.showFocusRing = shouldShowStrongFocus(); - } - handleBlur() { - this.showFocusRing = false; - } handleSlotChange() { this.hasIcon = this.assignedIcons.length > 0; } } +_a = Button; +(() => { + requestUpdateOnAriaChange(_a); +})(); Button.shadowRootOptions = { mode: 'open', delegatesFocus: true }; __decorate([ - property({ type: String, attribute: 'data-aria-has-popup', noAccessor: true }), - ariaProperty, - __metadata("design:type", String) -], Button.prototype, "ariaHasPopup", void 0); -__decorate([ - property({ type: String, attribute: 'data-aria-label', noAccessor: true }), - ariaProperty, - __metadata("design:type", String) -], Button.prototype, "ariaLabel", void 0); -__decorate([ - property({ type: Boolean, reflect: true }), - __metadata("design:type", Object) + property({ type: Boolean, reflect: true }) ], Button.prototype, "disabled", void 0); __decorate([ - property({ type: Boolean, attribute: 'trailingicon' }), - __metadata("design:type", Object) + property() +], Button.prototype, "href", void 0); +__decorate([ + property() +], Button.prototype, "target", void 0); +__decorate([ + property({ type: Boolean, attribute: 'trailingicon' }) ], Button.prototype, "trailingIcon", void 0); __decorate([ - property({ type: String }), - __metadata("design:type", Object) -], Button.prototype, "label", void 0); -__decorate([ - property({ type: Boolean }), - __metadata("design:type", Object) + property({ type: Boolean }) ], Button.prototype, "hasIcon", void 0); __decorate([ - property({ type: Boolean }), - __metadata("design:type", Object) + property({ type: Boolean }) ], Button.prototype, "preventClickDefault", void 0); __decorate([ - query('.md3-button'), - __metadata("design:type", HTMLElement) + query('.md3-button') ], Button.prototype, "buttonElement", void 0); __decorate([ - queryAsync('md-ripple'), - __metadata("design:type", Promise) + queryAsync('md-ripple') ], Button.prototype, "ripple", void 0); __decorate([ - state(), - __metadata("design:type", Object) -], Button.prototype, "showFocusRing", void 0); -__decorate([ - state(), - __metadata("design:type", Object) + state() ], Button.prototype, "showRipple", void 0); __decorate([ - queryAssignedElements({ slot: 'icon', flatten: true }), - __metadata("design:type", Array) + queryAssignedElements({ slot: 'icon', flatten: true }) ], Button.prototype, "assignedIcons", void 0); //# sourceMappingURL=button.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/elevated-button.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/elevated-button.d.ts index e44b407..08bec9b2 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/elevated-button.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/elevated-button.d.ts
@@ -4,10 +4,15 @@ * SPDX-License-Identifier: Apache-2.0 */ import '../../elevation/elevation.js'; -import { TemplateResult } from 'lit'; -import { ClassInfo } from 'lit/directives/class-map.js'; import { Button } from './button.js'; +/** + * An elevated button component. + */ export declare class ElevatedButton extends Button { - protected getRenderClasses(): ClassInfo; - protected renderElevation(): TemplateResult; + protected getRenderClasses(): { + 'md3-button--elevated': boolean; + 'md3-button--icon-leading': boolean; + 'md3-button--icon-trailing': boolean; + }; + protected renderElevation(): import("lit-html").TemplateResult<1>; }
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/elevated-button.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/elevated-button.js index 07b24249..c221ab0 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/elevated-button.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/elevated-button.js
@@ -6,7 +6,9 @@ import '../../elevation/elevation.js'; import { html } from 'lit'; import { Button } from './button.js'; -// tslint:disable-next-line:enforce-comments-on-exported-symbols +/** + * An elevated button component. + */ export class ElevatedButton extends Button { getRenderClasses() { return { @@ -15,7 +17,7 @@ }; } renderElevation() { - return html `<md-elevation shadow surface></md-elevation>`; + return html `<md-elevation></md-elevation>`; } } //# sourceMappingURL=elevated-button.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/elevated-link-button.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/elevated-link-button.d.ts deleted file mode 100644 index f568868..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/elevated-link-button.d.ts +++ /dev/null
@@ -1,13 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import '../../elevation/elevation.js'; -import { TemplateResult } from 'lit'; -import { ClassInfo } from 'lit/directives/class-map.js'; -import { LinkButton } from './link-button.js'; -export declare class ElevatedLinkButton extends LinkButton { - protected getRenderClasses(): ClassInfo; - protected renderElevation(): TemplateResult; -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/elevated-link-button.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/elevated-link-button.js deleted file mode 100644 index 4c5909b..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/elevated-link-button.js +++ /dev/null
@@ -1,21 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import '../../elevation/elevation.js'; -import { html } from 'lit'; -import { LinkButton } from './link-button.js'; -// tslint:disable-next-line:enforce-comments-on-exported-symbols -export class ElevatedLinkButton extends LinkButton { - getRenderClasses() { - return { - ...super.getRenderClasses(), - 'md3-button--elevated': true, - }; - } - renderElevation() { - return html `<md-elevation shadow surface></md-elevation>`; - } -} -//# sourceMappingURL=elevated-link-button.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/elevated-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/elevated-styles.css.js index 02daf15..f630737 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/elevated-styles.css.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/elevated-styles.css.js
@@ -4,6 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ import { css } from 'lit'; -export const styles = css `:host{--_container-shape-start-start: var(--md-elevated-button-container-shape-start-start, 9999px);--_container-shape-start-end: var(--md-elevated-button-container-shape-start-end, 9999px);--_container-shape-end-end: var(--md-elevated-button-container-shape-end-end, 9999px);--_container-shape-end-start: var(--md-elevated-button-container-shape-end-start, 9999px);--_container-color: var(--md-elevated-button-container-color, var(--md-sys-color-surface, #fffbfe));--_container-elevation: var(--md-elevated-button-container-elevation, 1);--_container-height: var(--md-elevated-button-container-height, 40px);--_container-shadow-color: var(--md-elevated-button-container-shadow-color, var(--md-sys-color-shadow, #000));--_container-surface-tint-layer-color: var(--md-elevated-button-container-surface-tint-layer-color, var(--md-sys-color-primary, #6750a4));--_disabled-container-color: var(--md-elevated-button-disabled-container-color, rgb(var(--md-sys-color-on-surface-rgb, 28, 27, 31), 0.12));--_disabled-container-elevation: var(--md-elevated-button-disabled-container-elevation, 0);--_disabled-label-text-color: var(--md-elevated-button-disabled-label-text-color, rgb(var(--md-sys-color-on-surface-rgb, 28, 27, 31), 0.38));--_focus-container-elevation: var(--md-elevated-button-focus-container-elevation, 1);--_focus-label-text-color: var(--md-elevated-button-focus-label-text-color, var(--md-sys-color-primary, #6750a4));--_focus-state-layer-color: var(--md-elevated-button-focus-state-layer-color, var(--md-sys-color-primary, #6750a4));--_focus-state-layer-opacity: var(--md-elevated-button-focus-state-layer-opacity, 0.12);--_hover-container-elevation: var(--md-elevated-button-hover-container-elevation, 2);--_hover-label-text-color: var(--md-elevated-button-hover-label-text-color, var(--md-sys-color-primary, #6750a4));--_hover-state-layer-color: var(--md-elevated-button-hover-state-layer-color, var(--md-sys-color-primary, #6750a4));--_hover-state-layer-opacity: var(--md-elevated-button-hover-state-layer-opacity, 0.08);--_label-text-color: var(--md-elevated-button-label-text-color, var(--md-sys-color-primary, #6750a4));--_label-text-font: var(--md-elevated-button-label-text-font, Roboto);--_label-text-line-height: var(--md-elevated-button-label-text-line-height, 1.25rem);--_label-text-size: var(--md-elevated-button-label-text-size, 0.875rem);--_label-text-tracking: var(--md-elevated-button-label-text-tracking, 0.006rem);--_label-text-type: var(--md-elevated-button-label-text-type, 500 0.875rem / 1.25rem Roboto);--_label-text-weight: var(--md-elevated-button-label-text-weight, 500);--_pressed-container-elevation: var(--md-elevated-button-pressed-container-elevation, 1);--_pressed-label-text-color: var(--md-elevated-button-pressed-label-text-color, var(--md-sys-color-primary, #6750a4));--_pressed-state-layer-color: var(--md-elevated-button-pressed-state-layer-color, var(--md-sys-color-primary, #6750a4));--_pressed-state-layer-opacity: var(--md-elevated-button-pressed-state-layer-opacity, 0.12);--_with-icon-disabled-icon-color: var(--md-elevated-button-with-icon-disabled-icon-color, rgb(var(--md-sys-color-on-surface-rgb, 28, 27, 31), 0.38));--_with-icon-focus-icon-color: var(--md-elevated-button-with-icon-focus-icon-color, var(--md-sys-color-primary, #6750a4));--_with-icon-hover-icon-color: var(--md-elevated-button-with-icon-hover-icon-color, var(--md-sys-color-primary, #6750a4));--_with-icon-icon-color: var(--md-elevated-button-with-icon-icon-color, var(--md-sys-color-primary, #6750a4));--_with-icon-icon-size: var(--md-elevated-button-with-icon-icon-size, 18px);--_with-icon-pressed-icon-color: var(--md-elevated-button-with-icon-pressed-icon-color, var(--md-sys-color-primary, #6750a4));--_spacing-leading: var(--md-elevated-button-spacing-leading, 24px);--_spacing-trailing: var(--md-elevated-button-spacing-trailing, 24px);--_with-icon-spacing-leading: var(--md-elevated-button-with-icon-spacing-leading, 16px);--_with-icon-spacing-trailing: var(--md-elevated-button-with-icon-spacing-trailing, 24px);--_with-trailing-icon-spacing-leading: var(--md-elevated-button-with-trailing-icon-spacing-leading, 24px);--_with-trailing-icon-spacing-trailing: var(--md-elevated-button-with-trailing-icon-spacing-trailing, 16px)}/*# sourceMappingURL=elevated-styles.css.map */ +export const styles = css `:host{--_container-color: var(--md-elevated-button-container-color, var(--md-sys-color-surface-container-low, #f7f2fa));--_container-elevation: var(--md-elevated-button-container-elevation, 1);--_container-height: var(--md-elevated-button-container-height, 40px);--_container-shadow-color: var(--md-elevated-button-container-shadow-color, var(--md-sys-color-shadow, #000));--_container-shape: var(--md-elevated-button-container-shape, 9999px);--_disabled-container-color: var(--md-elevated-button-disabled-container-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-container-elevation: var(--md-elevated-button-disabled-container-elevation, 0);--_disabled-container-opacity: var(--md-elevated-button-disabled-container-opacity, 0.12);--_disabled-label-text-color: var(--md-elevated-button-disabled-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-label-text-opacity: var(--md-elevated-button-disabled-label-text-opacity, 0.38);--_focus-container-elevation: var(--md-elevated-button-focus-container-elevation, 1);--_focus-label-text-color: var(--md-elevated-button-focus-label-text-color, var(--md-sys-color-primary, #6750a4));--_focus-state-layer-color: var(--md-elevated-button-focus-state-layer-color, var(--md-sys-color-primary, #6750a4));--_focus-state-layer-opacity: var(--md-elevated-button-focus-state-layer-opacity, 0.12);--_hover-container-elevation: var(--md-elevated-button-hover-container-elevation, 2);--_hover-label-text-color: var(--md-elevated-button-hover-label-text-color, var(--md-sys-color-primary, #6750a4));--_hover-state-layer-color: var(--md-elevated-button-hover-state-layer-color, var(--md-sys-color-primary, #6750a4));--_hover-state-layer-opacity: var(--md-elevated-button-hover-state-layer-opacity, 0.08);--_label-text-color: var(--md-elevated-button-label-text-color, var(--md-sys-color-primary, #6750a4));--_label-text-type: var(--md-elevated-button-label-text-type, var(--md-sys-typescale-label-large, 500 0.875rem / 1.25rem var(--md-ref-typeface-plain, Roboto)));--_pressed-container-elevation: var(--md-elevated-button-pressed-container-elevation, 1);--_pressed-label-text-color: var(--md-elevated-button-pressed-label-text-color, var(--md-sys-color-primary, #6750a4));--_pressed-state-layer-color: var(--md-elevated-button-pressed-state-layer-color, var(--md-sys-color-primary, #6750a4));--_pressed-state-layer-opacity: var(--md-elevated-button-pressed-state-layer-opacity, 0.12);--_with-icon-disabled-icon-color: var(--md-elevated-button-with-icon-disabled-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_with-icon-disabled-icon-opacity: var(--md-elevated-button-with-icon-disabled-icon-opacity, 0.38);--_with-icon-focus-icon-color: var(--md-elevated-button-with-icon-focus-icon-color, var(--md-sys-color-primary, #6750a4));--_with-icon-hover-icon-color: var(--md-elevated-button-with-icon-hover-icon-color, var(--md-sys-color-primary, #6750a4));--_with-icon-icon-color: var(--md-elevated-button-with-icon-icon-color, var(--md-sys-color-primary, #6750a4));--_with-icon-icon-size: var(--md-elevated-button-with-icon-icon-size, 18px);--_with-icon-pressed-icon-color: var(--md-elevated-button-with-icon-pressed-icon-color, var(--md-sys-color-primary, #6750a4));--_spacing-leading: var(--md-elevated-button-spacing-leading, 24px);--_spacing-trailing: var(--md-elevated-button-spacing-trailing, 24px);--_with-icon-spacing-leading: var(--md-elevated-button-with-icon-spacing-leading, 16px);--_with-icon-spacing-trailing: var(--md-elevated-button-with-icon-spacing-trailing, 24px);--_with-trailing-icon-spacing-leading: var(--md-elevated-button-with-trailing-icon-spacing-leading, 24px);--_with-trailing-icon-spacing-trailing: var(--md-elevated-button-with-trailing-icon-spacing-trailing, 16px);--_container-shape-start-start: var( --md-elevated-button-container-shape-start-start, var(--_container-shape) );--_container-shape-start-end: var( --md-elevated-button-container-shape-start-end, var(--_container-shape) );--_container-shape-end-end: var( --md-elevated-button-container-shape-end-end, var(--_container-shape) );--_container-shape-end-start: var( --md-elevated-button-container-shape-end-start, var(--_container-shape) )}/*# sourceMappingURL=elevated-styles.css.map */ `; //# sourceMappingURL=elevated-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/filled-button.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/filled-button.d.ts index 859a07c7..1c51e8a 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/filled-button.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/filled-button.d.ts
@@ -4,11 +4,15 @@ * SPDX-License-Identifier: Apache-2.0 */ import '../../elevation/elevation.js'; -import { TemplateResult } from 'lit'; -import { ClassInfo } from 'lit/directives/class-map.js'; import { Button } from './button.js'; +/** + * A filled button component. + */ export declare class FilledButton extends Button { - protected getRenderClasses(): ClassInfo; - /** @soyTemplate */ - protected renderElevation(): TemplateResult; + protected getRenderClasses(): { + 'md3-button--filled': boolean; + 'md3-button--icon-leading': boolean; + 'md3-button--icon-trailing': boolean; + }; + protected renderElevation(): import("lit-html").TemplateResult<1>; }
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/filled-button.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/filled-button.js index 7f2d794..046110e 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/filled-button.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/filled-button.js
@@ -6,7 +6,9 @@ import '../../elevation/elevation.js'; import { html } from 'lit'; import { Button } from './button.js'; -// tslint:disable-next-line:enforce-comments-on-exported-symbols +/** + * A filled button component. + */ export class FilledButton extends Button { getRenderClasses() { return { @@ -14,9 +16,8 @@ 'md3-button--filled': true, }; } - /** @soyTemplate */ renderElevation() { - return html `<md-elevation shadow surface></md-elevation>`; + return html `<md-elevation></md-elevation>`; } } //# sourceMappingURL=filled-button.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/filled-link-button.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/filled-link-button.d.ts deleted file mode 100644 index d3d730a1..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/filled-link-button.d.ts +++ /dev/null
@@ -1,14 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import '../../elevation/elevation.js'; -import { TemplateResult } from 'lit'; -import { ClassInfo } from 'lit/directives/class-map.js'; -import { LinkButton } from './link-button.js'; -export declare class FilledLinkButton extends LinkButton { - protected getRenderClasses(): ClassInfo; - /** @soyTemplate */ - protected renderElevation(): TemplateResult; -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/filled-link-button.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/filled-link-button.js deleted file mode 100644 index 84fad4ea..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/filled-link-button.js +++ /dev/null
@@ -1,22 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import '../../elevation/elevation.js'; -import { html } from 'lit'; -import { LinkButton } from './link-button.js'; -// tslint:disable-next-line:enforce-comments-on-exported-symbols -export class FilledLinkButton extends LinkButton { - getRenderClasses() { - return { - ...super.getRenderClasses(), - 'md3-button--filled': true, - }; - } - /** @soyTemplate */ - renderElevation() { - return html `<md-elevation shadow surface></md-elevation>`; - } -} -//# sourceMappingURL=filled-link-button.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/filled-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/filled-styles.css.js index c39ccd7..601a4c1 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/filled-styles.css.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/filled-styles.css.js
@@ -4,6 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ import { css } from 'lit'; -export const styles = css `:host{--_container-shape-start-start: var(--md-filled-button-container-shape-start-start, 9999px);--_container-shape-start-end: var(--md-filled-button-container-shape-start-end, 9999px);--_container-shape-end-end: var(--md-filled-button-container-shape-end-end, 9999px);--_container-shape-end-start: var(--md-filled-button-container-shape-end-start, 9999px);--_container-color: var(--md-filled-button-container-color, var(--md-sys-color-primary, #6750a4));--_container-elevation: var(--md-filled-button-container-elevation, 0);--_container-height: var(--md-filled-button-container-height, 40px);--_container-shadow-color: var(--md-filled-button-container-shadow-color, var(--md-sys-color-shadow, #000));--_disabled-container-color: var(--md-filled-button-disabled-container-color, rgb(var(--md-sys-color-on-surface-rgb, 28, 27, 31), 0.12));--_disabled-container-elevation: var(--md-filled-button-disabled-container-elevation, 0);--_disabled-label-text-color: var(--md-filled-button-disabled-label-text-color, rgb(var(--md-sys-color-on-surface-rgb, 28, 27, 31), 0.38));--_focus-container-elevation: var(--md-filled-button-focus-container-elevation, 0);--_focus-label-text-color: var(--md-filled-button-focus-label-text-color, var(--md-sys-color-on-primary, #fff));--_focus-state-layer-color: var(--md-filled-button-focus-state-layer-color, var(--md-sys-color-on-primary, #fff));--_focus-state-layer-opacity: var(--md-filled-button-focus-state-layer-opacity, 0.12);--_hover-container-elevation: var(--md-filled-button-hover-container-elevation, 1);--_hover-label-text-color: var(--md-filled-button-hover-label-text-color, var(--md-sys-color-on-primary, #fff));--_hover-state-layer-color: var(--md-filled-button-hover-state-layer-color, var(--md-sys-color-on-primary, #fff));--_hover-state-layer-opacity: var(--md-filled-button-hover-state-layer-opacity, 0.08);--_label-text-color: var(--md-filled-button-label-text-color, var(--md-sys-color-on-primary, #fff));--_label-text-font: var(--md-filled-button-label-text-font, Roboto);--_label-text-line-height: var(--md-filled-button-label-text-line-height, 1.25rem);--_label-text-size: var(--md-filled-button-label-text-size, 0.875rem);--_label-text-tracking: var(--md-filled-button-label-text-tracking, 0.006rem);--_label-text-type: var(--md-filled-button-label-text-type, 500 0.875rem / 1.25rem Roboto);--_label-text-weight: var(--md-filled-button-label-text-weight, 500);--_pressed-container-elevation: var(--md-filled-button-pressed-container-elevation, 0);--_pressed-label-text-color: var(--md-filled-button-pressed-label-text-color, var(--md-sys-color-on-primary, #fff));--_pressed-state-layer-color: var(--md-filled-button-pressed-state-layer-color, var(--md-sys-color-on-primary, #fff));--_pressed-state-layer-opacity: var(--md-filled-button-pressed-state-layer-opacity, 0.12);--_with-icon-disabled-icon-color: var(--md-filled-button-with-icon-disabled-icon-color, rgb(var(--md-sys-color-on-surface-rgb, 28, 27, 31), 0.38));--_with-icon-focus-icon-color: var(--md-filled-button-with-icon-focus-icon-color, var(--md-sys-color-on-primary, #fff));--_with-icon-hover-icon-color: var(--md-filled-button-with-icon-hover-icon-color, var(--md-sys-color-on-primary, #fff));--_with-icon-icon-color: var(--md-filled-button-with-icon-icon-color, var(--md-sys-color-on-primary, #fff));--_with-icon-icon-size: var(--md-filled-button-with-icon-icon-size, 18px);--_with-icon-pressed-icon-color: var(--md-filled-button-with-icon-pressed-icon-color, var(--md-sys-color-on-primary, #fff));--_spacing-leading: var(--md-filled-button-spacing-leading, 24px);--_spacing-trailing: var(--md-filled-button-spacing-trailing, 24px);--_with-icon-spacing-leading: var(--md-filled-button-with-icon-spacing-leading, 16px);--_with-icon-spacing-trailing: var(--md-filled-button-with-icon-spacing-trailing, 24px);--_with-trailing-icon-spacing-leading: var(--md-filled-button-with-trailing-icon-spacing-leading, 24px);--_with-trailing-icon-spacing-trailing: var(--md-filled-button-with-trailing-icon-spacing-trailing, 16px)}/*# sourceMappingURL=filled-styles.css.map */ +export const styles = css `:host{--_container-color: var(--md-filled-button-container-color, var(--md-sys-color-primary, #6750a4));--_container-elevation: var(--md-filled-button-container-elevation, 0);--_container-height: var(--md-filled-button-container-height, 40px);--_container-shadow-color: var(--md-filled-button-container-shadow-color, var(--md-sys-color-shadow, #000));--_container-shape: var(--md-filled-button-container-shape, 9999px);--_disabled-container-color: var(--md-filled-button-disabled-container-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-container-elevation: var(--md-filled-button-disabled-container-elevation, 0);--_disabled-container-opacity: var(--md-filled-button-disabled-container-opacity, 0.12);--_disabled-label-text-color: var(--md-filled-button-disabled-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-label-text-opacity: var(--md-filled-button-disabled-label-text-opacity, 0.38);--_focus-container-elevation: var(--md-filled-button-focus-container-elevation, 0);--_focus-label-text-color: var(--md-filled-button-focus-label-text-color, var(--md-sys-color-on-primary, #fff));--_focus-state-layer-color: var(--md-filled-button-focus-state-layer-color, var(--md-sys-color-on-primary, #fff));--_focus-state-layer-opacity: var(--md-filled-button-focus-state-layer-opacity, 0.12);--_hover-container-elevation: var(--md-filled-button-hover-container-elevation, 1);--_hover-label-text-color: var(--md-filled-button-hover-label-text-color, var(--md-sys-color-on-primary, #fff));--_hover-state-layer-color: var(--md-filled-button-hover-state-layer-color, var(--md-sys-color-on-primary, #fff));--_hover-state-layer-opacity: var(--md-filled-button-hover-state-layer-opacity, 0.08);--_label-text-color: var(--md-filled-button-label-text-color, var(--md-sys-color-on-primary, #fff));--_label-text-type: var(--md-filled-button-label-text-type, var(--md-sys-typescale-label-large, 500 0.875rem / 1.25rem var(--md-ref-typeface-plain, Roboto)));--_pressed-container-elevation: var(--md-filled-button-pressed-container-elevation, 0);--_pressed-label-text-color: var(--md-filled-button-pressed-label-text-color, var(--md-sys-color-on-primary, #fff));--_pressed-state-layer-color: var(--md-filled-button-pressed-state-layer-color, var(--md-sys-color-on-primary, #fff));--_pressed-state-layer-opacity: var(--md-filled-button-pressed-state-layer-opacity, 0.12);--_with-icon-disabled-icon-color: var(--md-filled-button-with-icon-disabled-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_with-icon-disabled-icon-opacity: var(--md-filled-button-with-icon-disabled-icon-opacity, 0.38);--_with-icon-focus-icon-color: var(--md-filled-button-with-icon-focus-icon-color, var(--md-sys-color-on-primary, #fff));--_with-icon-hover-icon-color: var(--md-filled-button-with-icon-hover-icon-color, var(--md-sys-color-on-primary, #fff));--_with-icon-icon-color: var(--md-filled-button-with-icon-icon-color, var(--md-sys-color-on-primary, #fff));--_with-icon-icon-size: var(--md-filled-button-with-icon-icon-size, 18px);--_with-icon-pressed-icon-color: var(--md-filled-button-with-icon-pressed-icon-color, var(--md-sys-color-on-primary, #fff));--_spacing-leading: var(--md-filled-button-spacing-leading, 24px);--_spacing-trailing: var(--md-filled-button-spacing-trailing, 24px);--_with-icon-spacing-leading: var(--md-filled-button-with-icon-spacing-leading, 16px);--_with-icon-spacing-trailing: var(--md-filled-button-with-icon-spacing-trailing, 24px);--_with-trailing-icon-spacing-leading: var(--md-filled-button-with-trailing-icon-spacing-leading, 24px);--_with-trailing-icon-spacing-trailing: var(--md-filled-button-with-trailing-icon-spacing-trailing, 16px);--_container-shape-start-start: var( --md-filled-button-container-shape-start-start, var(--_container-shape) );--_container-shape-start-end: var( --md-filled-button-container-shape-start-end, var(--_container-shape) );--_container-shape-end-end: var( --md-filled-button-container-shape-end-end, var(--_container-shape) );--_container-shape-end-start: var( --md-filled-button-container-shape-end-start, var(--_container-shape) )}/*# sourceMappingURL=filled-styles.css.map */ `; //# sourceMappingURL=filled-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/link-button.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/link-button.d.ts deleted file mode 100644 index e64334e..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/link-button.d.ts +++ /dev/null
@@ -1,24 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { TemplateResult } from 'lit'; -import { ClassInfo } from 'lit/directives/class-map.js'; -import { Button } from './button.js'; -export declare abstract class LinkButton extends Button { - /** - * Sets the underlying `HTMLAnchorElement`'s `href` resource attribute. - */ - href: string; - /** - * Sets the underlying `HTMLAnchorElement`'s `target` attribute. - */ - target: string; - /** - * Link buttons cannot be disabled. - */ - disabled: boolean; - protected getRenderClasses(): ClassInfo; - protected render(): TemplateResult; -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/link-button.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/link-button.js deleted file mode 100644 index fd9beb47c..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/link-button.js +++ /dev/null
@@ -1,59 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { __decorate, __metadata } from "tslib"; -import { html } from 'lit'; -import { property } from 'lit/decorators.js'; -import { classMap } from 'lit/directives/class-map.js'; -import { ifDefined } from 'lit/directives/if-defined.js'; -import { when } from 'lit/directives/when.js'; -import { ripple } from '../../ripple/directive.js'; -import { Button } from './button.js'; -// tslint:disable-next-line:enforce-comments-on-exported-symbols -export class LinkButton extends Button { - constructor() { - super(...arguments); - /** - * Link buttons cannot be disabled. - */ - this.disabled = false; - } - // Note: link buttons cannot have trailing icons. - getRenderClasses() { - return { - 'md3-button--icon-leading': this.hasIcon, - }; - } - render() { - return html ` - <span class="md3-link-button-wrapper"> - <a class="md3-button ${classMap(this.getRenderClasses())}" - href="${ifDefined(this.href)}" - target="${ifDefined(this.target)}" - aria-label="${ifDefined(this.ariaLabel)}" - @focus="${this.handleFocus}" - @blur="${this.handleBlur}" - @pointerdown="${this.handlePointerDown}" - @click="${this.handleClick}" - ${ripple(this.getRipple)}> - ${this.renderFocusRing()} - ${this.renderElevation()} - ${when(this.showRipple, this.renderRipple)} - ${this.renderOutline()} - ${this.renderTouchTarget()} - ${this.renderIcon()} - ${this.renderLabel()}</a> - </span>`; - } -} -__decorate([ - property({ type: String }), - __metadata("design:type", String) -], LinkButton.prototype, "href", void 0); -__decorate([ - property({ type: String }), - __metadata("design:type", String) -], LinkButton.prototype, "target", void 0); -//# sourceMappingURL=link-button.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/outlined-button.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/outlined-button.d.ts index 36f89ac..4176e97 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/outlined-button.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/outlined-button.d.ts
@@ -3,10 +3,15 @@ * Copyright 2021 Google LLC * SPDX-License-Identifier: Apache-2.0 */ -import { TemplateResult } from 'lit'; -import { ClassInfo } from 'lit/directives/class-map.js'; import { Button } from './button.js'; +/** + * An outlined button component. + */ export declare class OutlinedButton extends Button { - protected getRenderClasses(): ClassInfo; - protected renderOutline(): TemplateResult; + protected getRenderClasses(): { + 'md3-button--outlined': boolean; + 'md3-button--icon-leading': boolean; + 'md3-button--icon-trailing': boolean; + }; + protected renderOutline(): import("lit-html").TemplateResult<1>; }
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/outlined-button.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/outlined-button.js index ee8bb6b..8822e618 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/outlined-button.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/outlined-button.js
@@ -5,7 +5,9 @@ */ import { html } from 'lit'; import { Button } from './button.js'; -// tslint:disable-next-line:enforce-comments-on-exported-symbols +/** + * An outlined button component. + */ export class OutlinedButton extends Button { getRenderClasses() { return {
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/outlined-link-button.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/outlined-link-button.d.ts deleted file mode 100644 index de0965a..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/outlined-link-button.d.ts +++ /dev/null
@@ -1,12 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { TemplateResult } from 'lit'; -import { ClassInfo } from 'lit/directives/class-map.js'; -import { LinkButton } from './link-button.js'; -export declare class OutlinedLinkButton extends LinkButton { - protected getRenderClasses(): ClassInfo; - protected renderOutline(): TemplateResult; -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/outlined-link-button.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/outlined-link-button.js deleted file mode 100644 index 28c3a75a..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/outlined-link-button.js +++ /dev/null
@@ -1,20 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { html } from 'lit'; -import { LinkButton } from './link-button.js'; -// tslint:disable-next-line:enforce-comments-on-exported-symbols -export class OutlinedLinkButton extends LinkButton { - getRenderClasses() { - return { - ...super.getRenderClasses(), - 'md3-button--outlined': true, - }; - } - renderOutline() { - return html `<span class="md3-button__outline"></span>`; - } -} -//# sourceMappingURL=outlined-link-button.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/outlined-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/outlined-styles.css.js index a38776f1..01814f9 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/outlined-styles.css.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/outlined-styles.css.js
@@ -4,6 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ import { css } from 'lit'; -export const styles = css `:host{--_container-shape-start-start: var(--md-outlined-button-container-shape-start-start, 9999px);--_container-shape-start-end: var(--md-outlined-button-container-shape-start-end, 9999px);--_container-shape-end-end: var(--md-outlined-button-container-shape-end-end, 9999px);--_container-shape-end-start: var(--md-outlined-button-container-shape-end-start, 9999px);--_container-height: var(--md-outlined-button-container-height, 40px);--_disabled-label-text-color: var(--md-outlined-button-disabled-label-text-color, rgb(var(--md-sys-color-on-surface-rgb, 28, 27, 31), 0.38));--_disabled-outline-color: var(--md-outlined-button-disabled-outline-color, rgb(var(--md-sys-color-on-surface-rgb, 28, 27, 31), 0.12));--_focus-label-text-color: var(--md-outlined-button-focus-label-text-color, var(--md-sys-color-primary, #6750a4));--_focus-outline-color: var(--md-outlined-button-focus-outline-color, var(--md-sys-color-primary, #6750a4));--_focus-state-layer-color: var(--md-outlined-button-focus-state-layer-color, var(--md-sys-color-primary, #6750a4));--_focus-state-layer-opacity: var(--md-outlined-button-focus-state-layer-opacity, 0.12);--_hover-label-text-color: var(--md-outlined-button-hover-label-text-color, var(--md-sys-color-primary, #6750a4));--_hover-outline-color: var(--md-outlined-button-hover-outline-color, var(--md-sys-color-outline, #79747e));--_hover-state-layer-color: var(--md-outlined-button-hover-state-layer-color, var(--md-sys-color-primary, #6750a4));--_hover-state-layer-opacity: var(--md-outlined-button-hover-state-layer-opacity, 0.08);--_label-text-color: var(--md-outlined-button-label-text-color, var(--md-sys-color-primary, #6750a4));--_label-text-font: var(--md-outlined-button-label-text-font, Roboto);--_label-text-line-height: var(--md-outlined-button-label-text-line-height, 1.25rem);--_label-text-size: var(--md-outlined-button-label-text-size, 0.875rem);--_label-text-tracking: var(--md-outlined-button-label-text-tracking, 0.006rem);--_label-text-type: var(--md-outlined-button-label-text-type, 500 0.875rem / 1.25rem Roboto);--_label-text-weight: var(--md-outlined-button-label-text-weight, 500);--_outline-color: var(--md-outlined-button-outline-color, var(--md-sys-color-outline, #79747e));--_outline-width: var(--md-outlined-button-outline-width, 1px);--_pressed-label-text-color: var(--md-outlined-button-pressed-label-text-color, var(--md-sys-color-primary, #6750a4));--_pressed-outline-color: var(--md-outlined-button-pressed-outline-color, var(--md-sys-color-outline, #79747e));--_pressed-state-layer-color: var(--md-outlined-button-pressed-state-layer-color, var(--md-sys-color-primary, #6750a4));--_pressed-state-layer-opacity: var(--md-outlined-button-pressed-state-layer-opacity, 0.12);--_with-icon-disabled-icon-color: var(--md-outlined-button-with-icon-disabled-icon-color, rgb(var(--md-sys-color-on-surface-rgb, 28, 27, 31), 0.38));--_with-icon-focus-icon-color: var(--md-outlined-button-with-icon-focus-icon-color, var(--md-sys-color-primary, #6750a4));--_with-icon-hover-icon-color: var(--md-outlined-button-with-icon-hover-icon-color, var(--md-sys-color-primary, #6750a4));--_with-icon-icon-color: var(--md-outlined-button-with-icon-icon-color, var(--md-sys-color-primary, #6750a4));--_with-icon-icon-size: var(--md-outlined-button-with-icon-icon-size, 18px);--_with-icon-pressed-icon-color: var(--md-outlined-button-with-icon-pressed-icon-color, var(--md-sys-color-primary, #6750a4));--_spacing-leading: var(--md-outlined-button-spacing-leading, 24px);--_spacing-trailing: var(--md-outlined-button-spacing-trailing, 24px);--_with-icon-spacing-leading: var(--md-outlined-button-with-icon-spacing-leading, 16px);--_with-icon-spacing-trailing: var(--md-outlined-button-with-icon-spacing-trailing, 24px);--_with-trailing-icon-spacing-leading: var(--md-outlined-button-with-trailing-icon-spacing-leading, 24px);--_with-trailing-icon-spacing-trailing: var(--md-outlined-button-with-trailing-icon-spacing-trailing, 16px)}.md3-button__outline{inset:0;border-style:solid;position:absolute;box-sizing:border-box;border-color:var(--_outline-color);border-start-start-radius:var(--_container-shape-start-start);border-start-end-radius:var(--_container-shape-start-end);border-end-start-radius:var(--_container-shape-end-start);border-end-end-radius:var(--_container-shape-end-end)}.md3-button:active .md3-button__outline{border-color:var(--_pressed-outline-color)}.md3-button:disabled .md3-button__outline{border-color:var(--_disabled-outline-color)}.md3-button__outline,.md3-button__ripple{border-width:var(--_outline-width)}.md3-button__ripple{inline-size:calc(100% - 2*var(--_outline-width));block-size:calc(100% - 2*var(--_outline-width));border-style:solid;border-color:rgba(0,0,0,0)}/*# sourceMappingURL=outlined-styles.css.map */ +export const styles = css `:host{--_container-height: var(--md-outlined-button-container-height, 40px);--_container-shape: var(--md-outlined-button-container-shape, 9999px);--_disabled-label-text-color: var(--md-outlined-button-disabled-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-label-text-opacity: var(--md-outlined-button-disabled-label-text-opacity, 0.38);--_disabled-outline-color: var(--md-outlined-button-disabled-outline-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-outline-opacity: var(--md-outlined-button-disabled-outline-opacity, 0.12);--_focus-label-text-color: var(--md-outlined-button-focus-label-text-color, var(--md-sys-color-primary, #6750a4));--_focus-outline-color: var(--md-outlined-button-focus-outline-color, var(--md-sys-color-primary, #6750a4));--_focus-state-layer-color: var(--md-outlined-button-focus-state-layer-color, var(--md-sys-color-primary, #6750a4));--_focus-state-layer-opacity: var(--md-outlined-button-focus-state-layer-opacity, 0.12);--_hover-label-text-color: var(--md-outlined-button-hover-label-text-color, var(--md-sys-color-primary, #6750a4));--_hover-outline-color: var(--md-outlined-button-hover-outline-color, var(--md-sys-color-outline, #79747e));--_hover-state-layer-color: var(--md-outlined-button-hover-state-layer-color, var(--md-sys-color-primary, #6750a4));--_hover-state-layer-opacity: var(--md-outlined-button-hover-state-layer-opacity, 0.08);--_label-text-color: var(--md-outlined-button-label-text-color, var(--md-sys-color-primary, #6750a4));--_label-text-type: var(--md-outlined-button-label-text-type, var(--md-sys-typescale-label-large, 500 0.875rem / 1.25rem var(--md-ref-typeface-plain, Roboto)));--_outline-color: var(--md-outlined-button-outline-color, var(--md-sys-color-outline, #79747e));--_outline-width: var(--md-outlined-button-outline-width, 1px);--_pressed-label-text-color: var(--md-outlined-button-pressed-label-text-color, var(--md-sys-color-primary, #6750a4));--_pressed-outline-color: var(--md-outlined-button-pressed-outline-color, var(--md-sys-color-outline, #79747e));--_pressed-state-layer-color: var(--md-outlined-button-pressed-state-layer-color, var(--md-sys-color-primary, #6750a4));--_pressed-state-layer-opacity: var(--md-outlined-button-pressed-state-layer-opacity, 0.12);--_with-icon-disabled-icon-color: var(--md-outlined-button-with-icon-disabled-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_with-icon-disabled-icon-opacity: var(--md-outlined-button-with-icon-disabled-icon-opacity, 0.38);--_with-icon-focus-icon-color: var(--md-outlined-button-with-icon-focus-icon-color, var(--md-sys-color-primary, #6750a4));--_with-icon-hover-icon-color: var(--md-outlined-button-with-icon-hover-icon-color, var(--md-sys-color-primary, #6750a4));--_with-icon-icon-color: var(--md-outlined-button-with-icon-icon-color, var(--md-sys-color-primary, #6750a4));--_with-icon-icon-size: var(--md-outlined-button-with-icon-icon-size, 18px);--_with-icon-pressed-icon-color: var(--md-outlined-button-with-icon-pressed-icon-color, var(--md-sys-color-primary, #6750a4));--_spacing-leading: var(--md-outlined-button-spacing-leading, 24px);--_spacing-trailing: var(--md-outlined-button-spacing-trailing, 24px);--_with-icon-spacing-leading: var(--md-outlined-button-with-icon-spacing-leading, 16px);--_with-icon-spacing-trailing: var(--md-outlined-button-with-icon-spacing-trailing, 24px);--_with-trailing-icon-spacing-leading: var(--md-outlined-button-with-trailing-icon-spacing-leading, 24px);--_with-trailing-icon-spacing-trailing: var(--md-outlined-button-with-trailing-icon-spacing-trailing, 16px);--_container-shape-start-start: var( --md-outlined-button-container-shape-start-start, var(--_container-shape) );--_container-shape-start-end: var( --md-outlined-button-container-shape-start-end, var(--_container-shape) );--_container-shape-end-end: var( --md-outlined-button-container-shape-end-end, var(--_container-shape) );--_container-shape-end-start: var( --md-outlined-button-container-shape-end-start, var(--_container-shape) )}.md3-button__outline{inset:0;border-style:solid;position:absolute;box-sizing:border-box;border-color:var(--_outline-color);border-start-start-radius:var(--_container-shape-start-start);border-start-end-radius:var(--_container-shape-start-end);border-end-start-radius:var(--_container-shape-end-start);border-end-end-radius:var(--_container-shape-end-end)}.md3-button:active .md3-button__outline{border-color:var(--_pressed-outline-color)}.md3-button:disabled .md3-button__outline{border-color:var(--_disabled-outline-color);opacity:var(--_disabled-outline-opacity)}.md3-button__outline,.md3-button__ripple{border-width:var(--_outline-width)}.md3-button__ripple{inline-size:calc(100% - 2*var(--_outline-width));block-size:calc(100% - 2*var(--_outline-width));border-style:solid;border-color:rgba(0,0,0,0)}/*# sourceMappingURL=outlined-styles.css.map */ `; //# sourceMappingURL=outlined-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/shared-elevation-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/shared-elevation-styles.css.js index 22940bd..0b95efd 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/shared-elevation-styles.css.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/shared-elevation-styles.css.js
@@ -4,6 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ import { css } from 'lit'; -export const styles = css `md-elevation{inset:0;position:absolute}.md3-button{--md-elevation-duration:280ms;--md-elevation-level:var(--_container-elevation);--md-elevation-shadow-color:var(--_container-shadow-color);--md-elevation-surface-tint:var(--_container-surface-tint-layer-color)}.md3-button:focus{--md-elevation-level:var(--_focus-container-elevation)}.md3-button:hover{--md-elevation-level:var(--_hover-container-elevation)}.md3-button:active{--md-elevation-level:var(--_pressed-container-elevation)}.md3-button:disabled{--md-elevation-level:var(--_disabled-container-elevation)}/*# sourceMappingURL=shared-elevation-styles.css.map */ +export const styles = css `md-elevation{transition-duration:280ms}.md3-button{--md-elevation-level:var(--_container-elevation);--md-elevation-shadow-color:var(--_container-shadow-color)}.md3-button:focus{--md-elevation-level:var(--_focus-container-elevation)}.md3-button:hover{--md-elevation-level:var(--_hover-container-elevation)}.md3-button:active{--md-elevation-level:var(--_pressed-container-elevation)}.md3-button:disabled{--md-elevation-level:var(--_disabled-container-elevation)}/*# sourceMappingURL=shared-elevation-styles.css.map */ `; //# sourceMappingURL=shared-elevation-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/shared-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/shared-styles.css.js index 4561f36..d31d536 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/shared-styles.css.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/shared-styles.css.js
@@ -4,6 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ import { css } from 'lit'; -export const styles = css `:host{display:inline-flex;outline:none;-webkit-tap-highlight-color:rgba(0,0,0,0);vertical-align:top;--md-ripple-hover-state-layer-color:var(--_hover-state-layer-color);--md-ripple-focus-state-layer-color:var(--_focus-state-layer-color);--md-ripple-pressed-state-layer-color:var(--_pressed-state-layer-color);--md-ripple-hover-state-layer-opacity:var(--_hover-state-layer-opacity);--md-ripple-focus-state-layer-opacity:var(--_focus-state-layer-opacity);--md-ripple-pressed-state-layer-opacity:var(--_pressed-state-layer-opacity);--md-focus-ring-shape-start-start:var(--_container-shape-start-start);--md-focus-ring-shape-start-end:var(--_container-shape-start-end);--md-focus-ring-shape-end-end:var(--_container-shape-end-end);--md-focus-ring-shape-end-start:var(--_container-shape-end-start)}:host([disabled]){cursor:default;pointer-events:none}.md3-button{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;min-inline-size:64px;border:none;outline:none;line-height:inherit;user-select:none;-webkit-appearance:none;vertical-align:middle;background:rgba(0,0,0,0);text-decoration:none;inline-size:100%;position:relative;z-index:0;block-size:var(--_container-height);font-family:var(--_label-text-font);font-size:var(--_label-text-size);letter-spacing:var(--_label-text-tracking);font-weight:var(--_label-text-weight);background-color:var(--_container-color);color:var(--_label-text-color);padding-inline-start:var(--_spacing-leading);padding-inline-end:var(--_spacing-trailing);gap:8px}.md3-button::-moz-focus-inner{padding:0;border:0}.md3-button:hover{color:var(--_hover-label-text-color);cursor:pointer}.md3-button:focus{color:var(--_focus-label-text-color)}.md3-button:active{color:var(--_pressed-label-text-color);outline:none}.md3-button:disabled{background-color:var(--_disabled-container-color);color:var(--_disabled-label-text-color)}@media(forced-colors: active){.md3-button::before{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;border:1px solid rgba(0,0,0,0);border-radius:inherit;content:"";pointer-events:none}}.md3-button,.md3-button__ripple{border-start-start-radius:var(--_container-shape-start-start);border-start-end-radius:var(--_container-shape-start-end);border-end-start-radius:var(--_container-shape-end-start);border-end-end-radius:var(--_container-shape-end-end)}md-elevation,.md3-button__ripple{z-index:-1}.md3-button--icon-leading{padding-inline-start:var(--_with-icon-spacing-leading);padding-inline-end:var(--_with-icon-spacing-trailing)}.md3-button--icon-trailing{padding-inline-start:var(--_with-trailing-icon-spacing-leading);padding-inline-end:var(--_with-trailing-icon-spacing-trailing)}.md3-link-button-wrapper{inline-size:100%}.md3-button ::slotted([slot=icon]){display:inline-flex;position:relative;writing-mode:horizontal-tb;color:var(--_with-icon-icon-color);font-size:var(--_with-icon-icon-size);inline-size:var(--_with-icon-icon-size);block-size:var(--_with-icon-icon-size)}.md3-button:hover ::slotted([slot=icon]){color:var(--_with-icon-hover-icon-color)}.md3-button:focus ::slotted([slot=icon]){color:var(--_with-icon-focus-icon-color)}.md3-button:active ::slotted([slot=icon]){color:var(--_with-icon-pressed-icon-color)}.md3-button:disabled ::slotted([slot=icon]){color:var(--_with-icon-disabled-icon-color)}.md3-button__touch{position:absolute;top:50%;height:48px;left:0;right:0;transform:translateY(-50%)}/*# sourceMappingURL=shared-styles.css.map */ +export const styles = css `:root{--md-filled-button-container-shape-start-start: 12px;--md-filled-button-container-shape: 8px}:host{display:inline-flex;outline:none;-webkit-tap-highlight-color:rgba(0,0,0,0);vertical-align:top;--md-ripple-hover-color:var(--_hover-state-layer-color);--md-ripple-focus-color:var(--_focus-state-layer-color);--md-ripple-pressed-color:var(--_pressed-state-layer-color);--md-ripple-hover-opacity:var(--_hover-state-layer-opacity);--md-ripple-focus-opacity:var(--_focus-state-layer-opacity);--md-ripple-pressed-opacity:var(--_pressed-state-layer-opacity);--md-focus-ring-shape-start-start: var(--_container-shape-start-start);--md-focus-ring-shape-start-end: var(--_container-shape-start-end);--md-focus-ring-shape-end-end: var(--_container-shape-end-end);--md-focus-ring-shape-end-start: var(--_container-shape-end-start)}:host([disabled]){cursor:default;pointer-events:none}.md3-button{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;min-inline-size:64px;border:none;outline:none;user-select:none;-webkit-appearance:none;vertical-align:middle;background:rgba(0,0,0,0);text-decoration:none;inline-size:100%;position:relative;z-index:0;block-size:var(--_container-height);font:var(--_label-text-type);color:var(--_label-text-color);padding-inline-start:var(--_spacing-leading);padding-inline-end:var(--_spacing-trailing);gap:8px}.md3-button::before{background-color:var(--_container-color);border-radius:inherit;content:"";inset:0;position:absolute}.md3-button::-moz-focus-inner{padding:0;border:0}.md3-button:hover{color:var(--_hover-label-text-color);cursor:pointer}.md3-button:focus{color:var(--_focus-label-text-color)}.md3-button:active{color:var(--_pressed-label-text-color);outline:none}.md3-button:disabled .md3-button__label{color:var(--_disabled-label-text-color);opacity:var(--_disabled-label-text-opacity)}.md3-button:disabled::before{background-color:var(--_disabled-container-color);opacity:var(--_disabled-container-opacity)}@media(forced-colors: active){.md3-button::before{position:absolute;box-sizing:border-box;width:100%;height:100%;top:0;left:0;border:1px solid rgba(0,0,0,0);border-radius:inherit;content:"";pointer-events:none}}.md3-button,.md3-button__ripple{border-start-start-radius:var(--_container-shape-start-start);border-start-end-radius:var(--_container-shape-start-end);border-end-start-radius:var(--_container-shape-end-start);border-end-end-radius:var(--_container-shape-end-end)}.md3-button::after,.md3-button::before,md-elevation,.md3-button__ripple{z-index:-1}.md3-button--icon-leading{padding-inline-start:var(--_with-icon-spacing-leading);padding-inline-end:var(--_with-icon-spacing-trailing)}.md3-button--icon-trailing{padding-inline-start:var(--_with-trailing-icon-spacing-leading);padding-inline-end:var(--_with-trailing-icon-spacing-trailing)}.md3-link-button-wrapper{inline-size:100%}.md3-button ::slotted([slot=icon]){display:inline-flex;position:relative;writing-mode:horizontal-tb;fill:currentColor;color:var(--_with-icon-icon-color);font-size:var(--_with-icon-icon-size);inline-size:var(--_with-icon-icon-size);block-size:var(--_with-icon-icon-size)}.md3-button:hover ::slotted([slot=icon]){color:var(--_with-icon-hover-icon-color)}.md3-button:focus ::slotted([slot=icon]){color:var(--_with-icon-focus-icon-color)}.md3-button:active ::slotted([slot=icon]){color:var(--_with-icon-pressed-icon-color)}.md3-button:disabled ::slotted([slot=icon]){color:var(--_with-icon-disabled-icon-color);opacity:var(--_with-icon-disabled-icon-opacity)}.md3-button__touch{position:absolute;top:50%;height:48px;left:0;right:0;transform:translateY(-50%)}/*# sourceMappingURL=shared-styles.css.map */ `; //# sourceMappingURL=shared-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/state.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/state.d.ts deleted file mode 100644 index 2a2e0f7..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/state.d.ts +++ /dev/null
@@ -1,10 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -export interface ButtonState { - disabled: boolean; - label: string; - trailingIcon: boolean; -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/state.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/state.js deleted file mode 100644 index 7d22570..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/state.js +++ /dev/null
@@ -1,7 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -export {}; -//# sourceMappingURL=state.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/text-button.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/text-button.d.ts index c7eaca0..e2034a2 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/text-button.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/text-button.d.ts
@@ -3,8 +3,14 @@ * Copyright 2021 Google LLC * SPDX-License-Identifier: Apache-2.0 */ -import { ClassInfo } from 'lit/directives/class-map.js'; import { Button } from './button.js'; +/** + * A text button component. + */ export declare class TextButton extends Button { - protected getRenderClasses(): ClassInfo; + protected getRenderClasses(): { + 'md3-button--text': boolean; + 'md3-button--icon-leading': boolean; + 'md3-button--icon-trailing': boolean; + }; }
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/text-button.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/text-button.js index 1a3ac4a..6f9164fd 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/text-button.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/text-button.js
@@ -4,7 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ import { Button } from './button.js'; -// tslint:disable-next-line:enforce-comments-on-exported-symbols +/** + * A text button component. + */ export class TextButton extends Button { getRenderClasses() { return {
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/text-link-button.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/text-link-button.d.ts deleted file mode 100644 index 33c408f..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/text-link-button.d.ts +++ /dev/null
@@ -1,10 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { ClassInfo } from 'lit/directives/class-map.js'; -import { LinkButton } from './link-button.js'; -export declare class TextLinkButton extends LinkButton { - protected getRenderClasses(): ClassInfo; -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/text-link-button.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/text-link-button.js deleted file mode 100644 index 8f4d38e..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/text-link-button.js +++ /dev/null
@@ -1,16 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { LinkButton } from './link-button.js'; -// tslint:disable-next-line:enforce-comments-on-exported-symbols -export class TextLinkButton extends LinkButton { - getRenderClasses() { - return { - ...super.getRenderClasses(), - 'md3-button--text': true, - }; - } -} -//# sourceMappingURL=text-link-button.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/text-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/text-styles.css.js index 45c16b0..ffeca58f 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/text-styles.css.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/text-styles.css.js
@@ -4,6 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ import { css } from 'lit'; -export const styles = css `:host{--_container-shape-start-start: var(--md-text-button-container-shape-start-start, 9999px);--_container-shape-start-end: var(--md-text-button-container-shape-start-end, 9999px);--_container-shape-end-end: var(--md-text-button-container-shape-end-end, 9999px);--_container-shape-end-start: var(--md-text-button-container-shape-end-start, 9999px);--_container-height: var(--md-text-button-container-height, 40px);--_disabled-label-text-color: var(--md-text-button-disabled-label-text-color, rgb(var(--md-sys-color-on-surface-rgb, 28, 27, 31), 0.38));--_focus-label-text-color: var(--md-text-button-focus-label-text-color, var(--md-sys-color-primary, #6750a4));--_focus-state-layer-color: var(--md-text-button-focus-state-layer-color, var(--md-sys-color-primary, #6750a4));--_focus-state-layer-opacity: var(--md-text-button-focus-state-layer-opacity, 0.12);--_hover-label-text-color: var(--md-text-button-hover-label-text-color, var(--md-sys-color-primary, #6750a4));--_hover-state-layer-color: var(--md-text-button-hover-state-layer-color, var(--md-sys-color-primary, #6750a4));--_hover-state-layer-opacity: var(--md-text-button-hover-state-layer-opacity, 0.08);--_label-text-color: var(--md-text-button-label-text-color, var(--md-sys-color-primary, #6750a4));--_label-text-font: var(--md-text-button-label-text-font, Roboto);--_label-text-line-height: var(--md-text-button-label-text-line-height, 1.25rem);--_label-text-size: var(--md-text-button-label-text-size, 0.875rem);--_label-text-tracking: var(--md-text-button-label-text-tracking, 0.006rem);--_label-text-type: var(--md-text-button-label-text-type, 500 0.875rem / 1.25rem Roboto);--_label-text-weight: var(--md-text-button-label-text-weight, 500);--_pressed-label-text-color: var(--md-text-button-pressed-label-text-color, var(--md-sys-color-primary, #6750a4));--_pressed-state-layer-color: var(--md-text-button-pressed-state-layer-color, var(--md-sys-color-primary, #6750a4));--_pressed-state-layer-opacity: var(--md-text-button-pressed-state-layer-opacity, 0.12);--_with-icon-disabled-icon-color: var(--md-text-button-with-icon-disabled-icon-color, rgb(var(--md-sys-color-on-surface-rgb, 28, 27, 31), 0.38));--_with-icon-focus-icon-color: var(--md-text-button-with-icon-focus-icon-color, var(--md-sys-color-primary, #6750a4));--_with-icon-hover-icon-color: var(--md-text-button-with-icon-hover-icon-color, var(--md-sys-color-primary, #6750a4));--_with-icon-icon-color: var(--md-text-button-with-icon-icon-color, var(--md-sys-color-primary, #6750a4));--_with-icon-icon-size: var(--md-text-button-with-icon-icon-size, 18px);--_with-icon-pressed-icon-color: var(--md-text-button-with-icon-pressed-icon-color, var(--md-sys-color-primary, #6750a4));--_spacing-leading: var(--md-text-button-spacing-leading, 12px);--_spacing-trailing: var(--md-text-button-spacing-trailing, 12px);--_with-icon-spacing-leading: var(--md-text-button-with-icon-spacing-leading, 12px);--_with-icon-spacing-trailing: var(--md-text-button-with-icon-spacing-trailing, 16px);--_with-trailing-icon-spacing-leading: var(--md-text-button-with-trailing-icon-spacing-leading, 16px);--_with-trailing-icon-spacing-trailing: var(--md-text-button-with-trailing-icon-spacing-trailing, 12px)}/*# sourceMappingURL=text-styles.css.map */ +export const styles = css `:host{--_container-height: var(--md-text-button-container-height, 40px);--_container-shape: var(--md-text-button-container-shape, 9999px);--_disabled-label-text-color: var(--md-text-button-disabled-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-label-text-opacity: var(--md-text-button-disabled-label-text-opacity, 0.38);--_focus-label-text-color: var(--md-text-button-focus-label-text-color, var(--md-sys-color-primary, #6750a4));--_focus-state-layer-color: var(--md-text-button-focus-state-layer-color, var(--md-sys-color-primary, #6750a4));--_focus-state-layer-opacity: var(--md-text-button-focus-state-layer-opacity, 0.12);--_hover-label-text-color: var(--md-text-button-hover-label-text-color, var(--md-sys-color-primary, #6750a4));--_hover-state-layer-color: var(--md-text-button-hover-state-layer-color, var(--md-sys-color-primary, #6750a4));--_hover-state-layer-opacity: var(--md-text-button-hover-state-layer-opacity, 0.08);--_label-text-color: var(--md-text-button-label-text-color, var(--md-sys-color-primary, #6750a4));--_label-text-type: var(--md-text-button-label-text-type, var(--md-sys-typescale-label-large, 500 0.875rem / 1.25rem var(--md-ref-typeface-plain, Roboto)));--_pressed-label-text-color: var(--md-text-button-pressed-label-text-color, var(--md-sys-color-primary, #6750a4));--_pressed-state-layer-color: var(--md-text-button-pressed-state-layer-color, var(--md-sys-color-primary, #6750a4));--_pressed-state-layer-opacity: var(--md-text-button-pressed-state-layer-opacity, 0.12);--_with-icon-disabled-icon-color: var(--md-text-button-with-icon-disabled-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_with-icon-disabled-icon-opacity: var(--md-text-button-with-icon-disabled-icon-opacity, 0.38);--_with-icon-focus-icon-color: var(--md-text-button-with-icon-focus-icon-color, var(--md-sys-color-primary, #6750a4));--_with-icon-hover-icon-color: var(--md-text-button-with-icon-hover-icon-color, var(--md-sys-color-primary, #6750a4));--_with-icon-icon-color: var(--md-text-button-with-icon-icon-color, var(--md-sys-color-primary, #6750a4));--_with-icon-icon-size: var(--md-text-button-with-icon-icon-size, 18px);--_with-icon-pressed-icon-color: var(--md-text-button-with-icon-pressed-icon-color, var(--md-sys-color-primary, #6750a4));--_spacing-leading: var(--md-text-button-spacing-leading, 12px);--_spacing-trailing: var(--md-text-button-spacing-trailing, 12px);--_with-icon-spacing-leading: var(--md-text-button-with-icon-spacing-leading, 12px);--_with-icon-spacing-trailing: var(--md-text-button-with-icon-spacing-trailing, 16px);--_with-trailing-icon-spacing-leading: var(--md-text-button-with-trailing-icon-spacing-leading, 16px);--_with-trailing-icon-spacing-trailing: var(--md-text-button-with-trailing-icon-spacing-trailing, 12px);--_container-color: none;--_disabled-container-color: none;--_disabled-container-opacity: 0;--_container-shape-start-start: var( --md-text-button-container-shape-start-start, var(--_container-shape) );--_container-shape-start-end: var( --md-text-button-container-shape-start-end, var(--_container-shape) );--_container-shape-end-end: var( --md-text-button-container-shape-end-end, var(--_container-shape) );--_container-shape-end-start: var( --md-text-button-container-shape-end-start, var(--_container-shape) )}/*# sourceMappingURL=text-styles.css.map */ `; //# sourceMappingURL=text-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/tonal-button.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/tonal-button.d.ts index f7f27c2..01ba7ef5 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/tonal-button.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/tonal-button.d.ts
@@ -4,11 +4,15 @@ * SPDX-License-Identifier: Apache-2.0 */ import '../../elevation/elevation.js'; -import { TemplateResult } from 'lit'; -import { ClassInfo } from 'lit/directives/class-map.js'; import { Button } from './button.js'; +/** + * A tonal button component. + */ export declare class TonalButton extends Button { - protected getRenderClasses(): ClassInfo; - /** @soyTemplate */ - protected renderElevation(): TemplateResult; + protected getRenderClasses(): { + 'md3-button--tonal': boolean; + 'md3-button--icon-leading': boolean; + 'md3-button--icon-trailing': boolean; + }; + protected renderElevation(): import("lit-html").TemplateResult<1>; }
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/tonal-button.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/tonal-button.js index ad28cfe..e18b4ad 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/tonal-button.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/tonal-button.js
@@ -6,7 +6,9 @@ import '../../elevation/elevation.js'; import { html } from 'lit'; import { Button } from './button.js'; -// tslint:disable-next-line:enforce-comments-on-exported-symbols +/** + * A tonal button component. + */ export class TonalButton extends Button { getRenderClasses() { return { @@ -14,9 +16,8 @@ 'md3-button--tonal': true, }; } - /** @soyTemplate */ renderElevation() { - return html `<md-elevation shadow></md-elevation>`; + return html `<md-elevation></md-elevation>`; } } //# sourceMappingURL=tonal-button.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/tonal-link-button.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/tonal-link-button.d.ts deleted file mode 100644 index 3f69e84..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/tonal-link-button.d.ts +++ /dev/null
@@ -1,14 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import '../../elevation/elevation.js'; -import { TemplateResult } from 'lit'; -import { ClassInfo } from 'lit/directives/class-map.js'; -import { LinkButton } from './link-button.js'; -export declare class TonalLinkButton extends LinkButton { - protected getRenderClasses(): ClassInfo; - /** @soyTemplate */ - protected renderElevation(): TemplateResult; -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/tonal-link-button.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/tonal-link-button.js deleted file mode 100644 index b63b500..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/tonal-link-button.js +++ /dev/null
@@ -1,22 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import '../../elevation/elevation.js'; -import { html } from 'lit'; -import { LinkButton } from './link-button.js'; -// tslint:disable-next-line:enforce-comments-on-exported-symbols -export class TonalLinkButton extends LinkButton { - getRenderClasses() { - return { - ...super.getRenderClasses(), - 'md3-button--tonal': true, - }; - } - /** @soyTemplate */ - renderElevation() { - return html `<md-elevation shadow></md-elevation>`; - } -} -//# sourceMappingURL=tonal-link-button.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/tonal-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/tonal-styles.css.js index e7ef0052..69699368 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/tonal-styles.css.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/button/lib/tonal-styles.css.js
@@ -4,6 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ import { css } from 'lit'; -export const styles = css `:host{--_container-shape-start-start: var(--md-tonal-button-container-shape-start-start, 9999px);--_container-shape-start-end: var(--md-tonal-button-container-shape-start-end, 9999px);--_container-shape-end-end: var(--md-tonal-button-container-shape-end-end, 9999px);--_container-shape-end-start: var(--md-tonal-button-container-shape-end-start, 9999px);--_container-color: var(--md-tonal-button-container-color, var(--md-sys-color-secondary-container, #e8def8));--_container-elevation: var(--md-tonal-button-container-elevation, 0);--_container-height: var(--md-tonal-button-container-height, 40px);--_container-shadow-color: var(--md-tonal-button-container-shadow-color, var(--md-sys-color-shadow, #000));--_disabled-container-color: var(--md-tonal-button-disabled-container-color, rgb(var(--md-sys-color-on-surface-rgb, 28, 27, 31), 0.12));--_disabled-container-elevation: var(--md-tonal-button-disabled-container-elevation, 0);--_disabled-label-text-color: var(--md-tonal-button-disabled-label-text-color, rgb(var(--md-sys-color-on-surface-rgb, 28, 27, 31), 0.38));--_focus-container-elevation: var(--md-tonal-button-focus-container-elevation, 0);--_focus-label-text-color: var(--md-tonal-button-focus-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_focus-state-layer-color: var(--md-tonal-button-focus-state-layer-color, var(--md-sys-color-on-secondary-container, #1d192b));--_focus-state-layer-opacity: var(--md-tonal-button-focus-state-layer-opacity, 0.12);--_hover-container-elevation: var(--md-tonal-button-hover-container-elevation, 1);--_hover-label-text-color: var(--md-tonal-button-hover-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_hover-state-layer-color: var(--md-tonal-button-hover-state-layer-color, var(--md-sys-color-on-secondary-container, #1d192b));--_hover-state-layer-opacity: var(--md-tonal-button-hover-state-layer-opacity, 0.08);--_label-text-color: var(--md-tonal-button-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_label-text-font: var(--md-tonal-button-label-text-font, Roboto);--_label-text-line-height: var(--md-tonal-button-label-text-line-height, 1.25rem);--_label-text-size: var(--md-tonal-button-label-text-size, 0.875rem);--_label-text-tracking: var(--md-tonal-button-label-text-tracking, 0.006rem);--_label-text-type: var(--md-tonal-button-label-text-type, 500 0.875rem / 1.25rem Roboto);--_label-text-weight: var(--md-tonal-button-label-text-weight, 500);--_pressed-container-elevation: var(--md-tonal-button-pressed-container-elevation, 0);--_pressed-label-text-color: var(--md-tonal-button-pressed-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_pressed-state-layer-color: var(--md-tonal-button-pressed-state-layer-color, var(--md-sys-color-on-secondary-container, #1d192b));--_pressed-state-layer-opacity: var(--md-tonal-button-pressed-state-layer-opacity, 0.12);--_with-icon-disabled-icon-color: var(--md-tonal-button-with-icon-disabled-icon-color, rgb(var(--md-sys-color-on-surface-rgb, 28, 27, 31), 0.38));--_with-icon-focus-icon-color: var(--md-tonal-button-with-icon-focus-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_with-icon-hover-icon-color: var(--md-tonal-button-with-icon-hover-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_with-icon-icon-color: var(--md-tonal-button-with-icon-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_with-icon-icon-size: var(--md-tonal-button-with-icon-icon-size, 18px);--_with-icon-pressed-icon-color: var(--md-tonal-button-with-icon-pressed-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_spacing-leading: var(--md-tonal-button-spacing-leading, 24px);--_spacing-trailing: var(--md-tonal-button-spacing-trailing, 24px);--_with-icon-spacing-leading: var(--md-tonal-button-with-icon-spacing-leading, 16px);--_with-icon-spacing-trailing: var(--md-tonal-button-with-icon-spacing-trailing, 24px);--_with-trailing-icon-spacing-leading: var(--md-tonal-button-with-trailing-icon-spacing-leading, 24px);--_with-trailing-icon-spacing-trailing: var(--md-tonal-button-with-trailing-icon-spacing-trailing, 16px)}/*# sourceMappingURL=tonal-styles.css.map */ +export const styles = css `:host{--_container-color: var(--md-tonal-button-container-color, var(--md-sys-color-secondary-container, #e8def8));--_container-elevation: var(--md-tonal-button-container-elevation, 0);--_container-height: var(--md-tonal-button-container-height, 40px);--_container-shadow-color: var(--md-tonal-button-container-shadow-color, var(--md-sys-color-shadow, #000));--_container-shape: var(--md-tonal-button-container-shape, 9999px);--_disabled-container-color: var(--md-tonal-button-disabled-container-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-container-elevation: var(--md-tonal-button-disabled-container-elevation, 0);--_disabled-container-opacity: var(--md-tonal-button-disabled-container-opacity, 0.12);--_disabled-label-text-color: var(--md-tonal-button-disabled-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-label-text-opacity: var(--md-tonal-button-disabled-label-text-opacity, 0.38);--_focus-container-elevation: var(--md-tonal-button-focus-container-elevation, 0);--_focus-label-text-color: var(--md-tonal-button-focus-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_focus-state-layer-color: var(--md-tonal-button-focus-state-layer-color, var(--md-sys-color-on-secondary-container, #1d192b));--_focus-state-layer-opacity: var(--md-tonal-button-focus-state-layer-opacity, 0.12);--_hover-container-elevation: var(--md-tonal-button-hover-container-elevation, 1);--_hover-label-text-color: var(--md-tonal-button-hover-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_hover-state-layer-color: var(--md-tonal-button-hover-state-layer-color, var(--md-sys-color-on-secondary-container, #1d192b));--_hover-state-layer-opacity: var(--md-tonal-button-hover-state-layer-opacity, 0.08);--_label-text-color: var(--md-tonal-button-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_label-text-type: var(--md-tonal-button-label-text-type, var(--md-sys-typescale-label-large, 500 0.875rem / 1.25rem var(--md-ref-typeface-plain, Roboto)));--_pressed-container-elevation: var(--md-tonal-button-pressed-container-elevation, 0);--_pressed-label-text-color: var(--md-tonal-button-pressed-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_pressed-state-layer-color: var(--md-tonal-button-pressed-state-layer-color, var(--md-sys-color-on-secondary-container, #1d192b));--_pressed-state-layer-opacity: var(--md-tonal-button-pressed-state-layer-opacity, 0.12);--_with-icon-disabled-icon-color: var(--md-tonal-button-with-icon-disabled-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_with-icon-disabled-icon-opacity: var(--md-tonal-button-with-icon-disabled-icon-opacity, 0.38);--_with-icon-focus-icon-color: var(--md-tonal-button-with-icon-focus-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_with-icon-hover-icon-color: var(--md-tonal-button-with-icon-hover-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_with-icon-icon-color: var(--md-tonal-button-with-icon-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_with-icon-icon-size: var(--md-tonal-button-with-icon-icon-size, 18px);--_with-icon-pressed-icon-color: var(--md-tonal-button-with-icon-pressed-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_spacing-leading: var(--md-tonal-button-spacing-leading, 24px);--_spacing-trailing: var(--md-tonal-button-spacing-trailing, 24px);--_with-icon-spacing-leading: var(--md-tonal-button-with-icon-spacing-leading, 16px);--_with-icon-spacing-trailing: var(--md-tonal-button-with-icon-spacing-trailing, 24px);--_with-trailing-icon-spacing-leading: var(--md-tonal-button-with-trailing-icon-spacing-leading, 24px);--_with-trailing-icon-spacing-trailing: var(--md-tonal-button-with-trailing-icon-spacing-trailing, 16px);--_container-shape-start-start: var( --md-tonal-button-container-shape-start-start, var(--_container-shape) );--_container-shape-start-end: var( --md-tonal-button-container-shape-start-end, var(--_container-shape) );--_container-shape-end-end: var( --md-tonal-button-container-shape-end-end, var(--_container-shape) );--_container-shape-end-start: var( --md-tonal-button-container-shape-end-start, var(--_container-shape) )}/*# sourceMappingURL=tonal-styles.css.map */ `; //# sourceMappingURL=tonal-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/outlined-link-button.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/button/outlined-link-button.d.ts deleted file mode 100644 index 313dbad9..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/outlined-link-button.d.ts +++ /dev/null
@@ -1,36 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { OutlinedLinkButton } from './lib/outlined-link-button.js'; -declare global { - interface HTMLElementTagNameMap { - 'md-outlined-link-button': MdOutlinedLinkButton; - } -} -/** - * @summary Buttons help people take action, such as sending an email, sharing a - * document, or liking a comment. This is a linkable variant. - * - * @description - * __Emphasis:__ Medium emphasis – For important actions that don’t distract - * from other onscreen elements. - * - * __Rationale:__ Use an outlined button for actions that need attention but - * aren’t the primary action, such as “See all” or “Add to cart.” This is also - * the button to use for giving someone the opportunity to change their mind or - * escape a flow. - * - * __Example usages:__ - * - Reply - * - View all - * - Add to cart - * - Take out of trash - * - * @final - * @suppress {visibility} - */ -export declare class MdOutlinedLinkButton extends OutlinedLinkButton { - static styles: import("lit").CSSResult[]; -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/outlined-link-button.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/button/outlined-link-button.js deleted file mode 100644 index 281c239..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/outlined-link-button.js +++ /dev/null
@@ -1,40 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { __decorate } from "tslib"; -import { customElement } from 'lit/decorators.js'; -import { OutlinedLinkButton } from './lib/outlined-link-button.js'; -import { styles as outlinedStyles } from './lib/outlined-styles.css.js'; -import { styles as sharedStyles } from './lib/shared-styles.css.js'; -/** - * @summary Buttons help people take action, such as sending an email, sharing a - * document, or liking a comment. This is a linkable variant. - * - * @description - * __Emphasis:__ Medium emphasis – For important actions that don’t distract - * from other onscreen elements. - * - * __Rationale:__ Use an outlined button for actions that need attention but - * aren’t the primary action, such as “See all” or “Add to cart.” This is also - * the button to use for giving someone the opportunity to change their mind or - * escape a flow. - * - * __Example usages:__ - * - Reply - * - View all - * - Add to cart - * - Take out of trash - * - * @final - * @suppress {visibility} - */ -let MdOutlinedLinkButton = class MdOutlinedLinkButton extends OutlinedLinkButton { -}; -MdOutlinedLinkButton.styles = [sharedStyles, outlinedStyles]; -MdOutlinedLinkButton = __decorate([ - customElement('md-outlined-link-button') -], MdOutlinedLinkButton); -export { MdOutlinedLinkButton }; -//# sourceMappingURL=outlined-link-button.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/text-link-button.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/button/text-link-button.d.ts deleted file mode 100644 index 129fc98f..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/text-link-button.d.ts +++ /dev/null
@@ -1,34 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { TextLinkButton } from './lib/text-link-button.js'; -declare global { - interface HTMLElementTagNameMap { - 'md-text-link-button': MdTextLinkButton; - } -} -/** - * @summary Buttons help people take action, such as sending an email, sharing a - * document, or liking a comment. This is a linkable variant. - * - * @description - * __Emphasis:__ Low emphasis – For optional or supplementary actions with the - * least amount of prominence - * - * __Rationale:__ Text buttons have less visual prominence, so should be used - * for low emphasis actions, such as an alternative option. - * - * __Example usages:__ - * - Learn more - * - View all - * - Change account - * - Turn on - * - * @final - * @suppress {visibility} - */ -export declare class MdTextLinkButton extends TextLinkButton { - static styles: import("lit").CSSResult[]; -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/text-link-button.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/button/text-link-button.js deleted file mode 100644 index 5018b4d..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/text-link-button.js +++ /dev/null
@@ -1,38 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { __decorate } from "tslib"; -import { customElement } from 'lit/decorators.js'; -import { styles as sharedStyles } from './lib/shared-styles.css.js'; -import { TextLinkButton } from './lib/text-link-button.js'; -import { styles as textStyles } from './lib/text-styles.css.js'; -/** - * @summary Buttons help people take action, such as sending an email, sharing a - * document, or liking a comment. This is a linkable variant. - * - * @description - * __Emphasis:__ Low emphasis – For optional or supplementary actions with the - * least amount of prominence - * - * __Rationale:__ Text buttons have less visual prominence, so should be used - * for low emphasis actions, such as an alternative option. - * - * __Example usages:__ - * - Learn more - * - View all - * - Change account - * - Turn on - * - * @final - * @suppress {visibility} - */ -let MdTextLinkButton = class MdTextLinkButton extends TextLinkButton { -}; -MdTextLinkButton.styles = [sharedStyles, textStyles]; -MdTextLinkButton = __decorate([ - customElement('md-text-link-button') -], MdTextLinkButton); -export { MdTextLinkButton }; -//# sourceMappingURL=text-link-button.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/tonal-link-button.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/button/tonal-link-button.d.ts deleted file mode 100644 index 38215c24..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/tonal-link-button.d.ts +++ /dev/null
@@ -1,35 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { TonalLinkButton } from './lib/tonal-link-button.js'; -declare global { - interface HTMLElementTagNameMap { - 'md-tonal-link-button': MdTonalLinkButton; - } -} -/** - * @summary Buttons help people take action, such as sending an email, sharing a - * document, or liking a comment. This is a linkable variant. - * - * @description - * __Emphasis:__ Medium emphasis – For important actions that don’t distract - * from other onscreen elements. - * - * __Rationale:__ Filled tonal buttons have a lighter background color and - * darker label color, making them less visually prominent than a regular, - * filled button. They’re still used for final or unblocking actions in a flow, - * but do so with less emphasis. - * - * __Example usages:__ - * - Save - * - Confirm - * - Done - * - * @final - * @suppress {visibility} - */ -export declare class MdTonalLinkButton extends TonalLinkButton { - static styles: import("lit").CSSResult[]; -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/tonal-link-button.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/button/tonal-link-button.js deleted file mode 100644 index 52b34ba..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/button/tonal-link-button.js +++ /dev/null
@@ -1,40 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { __decorate } from "tslib"; -import { customElement } from 'lit/decorators.js'; -import { styles as sharedElevationStyles } from './lib/shared-elevation-styles.css.js'; -import { styles as sharedStyles } from './lib/shared-styles.css.js'; -import { TonalLinkButton } from './lib/tonal-link-button.js'; -import { styles as tonalStyles } from './lib/tonal-styles.css.js'; -/** - * @summary Buttons help people take action, such as sending an email, sharing a - * document, or liking a comment. This is a linkable variant. - * - * @description - * __Emphasis:__ Medium emphasis – For important actions that don’t distract - * from other onscreen elements. - * - * __Rationale:__ Filled tonal buttons have a lighter background color and - * darker label color, making them less visually prominent than a regular, - * filled button. They’re still used for final or unblocking actions in a flow, - * but do so with less emphasis. - * - * __Example usages:__ - * - Save - * - Confirm - * - Done - * - * @final - * @suppress {visibility} - */ -let MdTonalLinkButton = class MdTonalLinkButton extends TonalLinkButton { -}; -MdTonalLinkButton.styles = [sharedStyles, sharedElevationStyles, tonalStyles]; -MdTonalLinkButton = __decorate([ - customElement('md-tonal-link-button') -], MdTonalLinkButton); -export { MdTonalLinkButton }; -//# sourceMappingURL=tonal-link-button.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/checkbox/lib/checkbox-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/checkbox/lib/checkbox-styles.css.js index d183f35..77ba6f9 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/checkbox/lib/checkbox-styles.css.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/checkbox/lib/checkbox-styles.css.js
@@ -4,6 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ import { css } from 'lit'; -export const styles = css `:host{--_container-height: var(--md-checkbox-container-height, 18px);--_container-shape: var(--md-checkbox-container-shape, 2px);--_container-width: var(--md-checkbox-container-width, 18px);--_error-focus-state-layer-color: var(--md-checkbox-error-focus-state-layer-color, var(--md-sys-color-error, #b3261e));--_error-hover-state-layer-color: var(--md-checkbox-error-hover-state-layer-color, var(--md-sys-color-error, #b3261e));--_error-hover-state-layer-opacity: var(--md-checkbox-error-hover-state-layer-opacity, 0.08);--_error-pressed-state-layer-color: var(--md-checkbox-error-pressed-state-layer-color, var(--md-sys-color-error, #b3261e));--_error-pressed-state-layer-opacity: var(--md-checkbox-error-pressed-state-layer-opacity, 0.12);--_icon-size: var(--md-checkbox-icon-size, 18px);--_selected-container-color: var(--md-checkbox-selected-container-color, var(--md-sys-color-primary, #6750a4));--_selected-disabled-container-color: var(--md-checkbox-selected-disabled-container-color, var(--md-sys-color-on-surface, #1c1b1f));--_selected-disabled-container-opacity: var(--md-checkbox-selected-disabled-container-opacity, 0.38);--_selected-disabled-icon-color: var(--md-checkbox-selected-disabled-icon-color, var(--md-sys-color-surface, #fffbfe));--_selected-error-container-color: var(--md-checkbox-selected-error-container-color, var(--md-sys-color-error, #b3261e));--_selected-error-focus-container-color: var(--md-checkbox-selected-error-focus-container-color, var(--md-sys-color-error, #b3261e));--_selected-error-focus-icon-color: var(--md-checkbox-selected-error-focus-icon-color, var(--md-sys-color-on-error, #fff));--_selected-error-hover-container-color: var(--md-checkbox-selected-error-hover-container-color, var(--md-sys-color-error, #b3261e));--_selected-error-hover-icon-color: var(--md-checkbox-selected-error-hover-icon-color, var(--md-sys-color-on-error, #fff));--_selected-error-icon-color: var(--md-checkbox-selected-error-icon-color, var(--md-sys-color-on-error, #fff));--_selected-error-pressed-container-color: var(--md-checkbox-selected-error-pressed-container-color, var(--md-sys-color-error, #b3261e));--_selected-error-pressed-icon-color: var(--md-checkbox-selected-error-pressed-icon-color, var(--md-sys-color-on-error, #fff));--_selected-focus-container-color: var(--md-checkbox-selected-focus-container-color, var(--md-sys-color-primary, #6750a4));--_selected-focus-icon-color: var(--md-checkbox-selected-focus-icon-color, var(--md-sys-color-on-primary, #fff));--_selected-focus-state-layer-color: var(--md-checkbox-selected-focus-state-layer-color, var(--md-sys-color-primary, #6750a4));--_selected-focus-state-layer-opacity: var(--md-checkbox-selected-focus-state-layer-opacity, 0.12);--_selected-hover-container-color: var(--md-checkbox-selected-hover-container-color, var(--md-sys-color-primary, #6750a4));--_selected-hover-icon-color: var(--md-checkbox-selected-hover-icon-color, var(--md-sys-color-on-primary, #fff));--_selected-hover-state-layer-color: var(--md-checkbox-selected-hover-state-layer-color, var(--md-sys-color-primary, #6750a4));--_selected-hover-state-layer-opacity: var(--md-checkbox-selected-hover-state-layer-opacity, 0.08);--_selected-icon-color: var(--md-checkbox-selected-icon-color, var(--md-sys-color-on-primary, #fff));--_selected-pressed-container-color: var(--md-checkbox-selected-pressed-container-color, var(--md-sys-color-primary, #6750a4));--_selected-pressed-icon-color: var(--md-checkbox-selected-pressed-icon-color, var(--md-sys-color-on-primary, #fff));--_selected-pressed-state-layer-color: var(--md-checkbox-selected-pressed-state-layer-color, var(--md-sys-color-on-surface, #1c1b1f));--_selected-pressed-state-layer-opacity: var(--md-checkbox-selected-pressed-state-layer-opacity, 0.12);--_state-layer-shape: var(--md-checkbox-state-layer-shape, 9999px);--_state-layer-size: var(--md-checkbox-state-layer-size, 40px);--_unselected-disabled-container-opacity: var(--md-checkbox-unselected-disabled-container-opacity, 0.38);--_unselected-disabled-outline-color: var(--md-checkbox-unselected-disabled-outline-color, var(--md-sys-color-on-surface, #1c1b1f));--_unselected-disabled-outline-width: var(--md-checkbox-unselected-disabled-outline-width, 2px);--_unselected-error-focus-outline-color: var(--md-checkbox-unselected-error-focus-outline-color, var(--md-sys-color-error, #b3261e));--_unselected-error-focus-outline-width: var(--md-checkbox-unselected-error-focus-outline-width, 2px);--_unselected-error-hover-outline-color: var(--md-checkbox-unselected-error-hover-outline-color, var(--md-sys-color-error, #b3261e));--_unselected-error-hover-outline-width: var(--md-checkbox-unselected-error-hover-outline-width, 2px);--_unselected-error-outline-color: var(--md-checkbox-unselected-error-outline-color, var(--md-sys-color-error, #b3261e));--_unselected-error-pressed-outline-color: var(--md-checkbox-unselected-error-pressed-outline-color, var(--md-sys-color-error, #b3261e));--_unselected-error-pressed-outline-width: var(--md-checkbox-unselected-error-pressed-outline-width, 2px);--_unselected-focus-outline-color: var(--md-checkbox-unselected-focus-outline-color, var(--md-sys-color-on-surface, #1c1b1f));--_unselected-focus-outline-width: var(--md-checkbox-unselected-focus-outline-width, 2px);--_unselected-focus-state-layer-color: var(--md-checkbox-unselected-focus-state-layer-color, var(--md-sys-color-on-surface, #1c1b1f));--_unselected-focus-state-layer-opacity: var(--md-checkbox-unselected-focus-state-layer-opacity, 0.12);--_unselected-hover-outline-color: var(--md-checkbox-unselected-hover-outline-color, var(--md-sys-color-on-surface, #1c1b1f));--_unselected-hover-outline-width: var(--md-checkbox-unselected-hover-outline-width, 2px);--_unselected-hover-state-layer-color: var(--md-checkbox-unselected-hover-state-layer-color, var(--md-sys-color-on-surface, #1c1b1f));--_unselected-hover-state-layer-opacity: var(--md-checkbox-unselected-hover-state-layer-opacity, 0.08);--_unselected-outline-color: var(--md-checkbox-unselected-outline-color, var(--md-sys-color-on-surface-variant, #49454f));--_unselected-outline-width: var(--md-checkbox-unselected-outline-width, 2px);--_unselected-pressed-outline-color: var(--md-checkbox-unselected-pressed-outline-color, var(--md-sys-color-on-surface, #1c1b1f));--_unselected-pressed-outline-width: var(--md-checkbox-unselected-pressed-outline-width, 2px);--_unselected-pressed-state-layer-color: var(--md-checkbox-unselected-pressed-state-layer-color, var(--md-sys-color-primary, #6750a4));--_unselected-pressed-state-layer-opacity: var(--md-checkbox-unselected-pressed-state-layer-opacity, 0.12);border-radius:var(--_container-shape);display:inline-flex;height:48px;position:relative;vertical-align:top;width:48px;-webkit-tap-highlight-color:rgba(0,0,0,0)}input{appearance:none;inset:0;margin:0;outline:none;position:absolute;opacity:0;block-size:100%;inline-size:100%}.container{border-radius:inherit;height:100%;position:relative;width:100%}.outline,.background,md-ripple,.icon{inset:0;margin:auto;position:absolute}.outline,.background{border-radius:inherit;height:var(--_container-height);width:var(--_container-width)}.outline{border-color:var(--_unselected-outline-color);border-style:solid;border-width:var(--_unselected-outline-width);box-sizing:border-box}.background{background-color:var(--_selected-container-color)}.background,.icon{opacity:0;transition-duration:150ms,50ms;transition-property:transform,opacity;transition-timing-function:cubic-bezier(0.3, 0, 0.8, 0.15),linear;transform:scale(0.6)}.selected .background,.selected .icon{opacity:1;transition-duration:350ms,50ms;transition-timing-function:cubic-bezier(0.05, 0.7, 0.1, 1),linear;transform:scale(1)}md-focus-ring{--md-focus-ring-shape-start-start:9999px;--md-focus-ring-shape-start-end:9999px;--md-focus-ring-shape-end-end:9999px;--md-focus-ring-shape-end-start:9999px;--md-focus-ring-offset-vertical:-2px;--md-focus-ring-offset-horizontal:-2px}md-ripple{height:var(--_state-layer-size);width:var(--_state-layer-size);--md-ripple-focus-state-layer-color:var(--_unselected-focus-state-layer-color);--md-ripple-focus-state-layer-opacity:var(--_unselected-focus-state-layer-opacity);--md-ripple-hover-state-layer-color:var(--_unselected-hover-state-layer-color);--md-ripple-hover-state-layer-opacity:var(--_unselected-hover-state-layer-opacity);--md-ripple-pressed-state-layer-color:var(--_unselected-pressed-state-layer-color);--md-ripple-pressed-state-layer-opacity:var(--_unselected-pressed-state-layer-opacity);--md-ripple-state-layer-shape:var(--_state-layer-shape)}.selected md-ripple{--md-ripple-focus-state-layer-color:var(--_selected-focus-state-layer-color);--md-ripple-focus-state-layer-opacity:var(--_selected-focus-state-layer-opacity);--md-ripple-hover-state-layer-color:var(--_selected-hover-state-layer-color);--md-ripple-hover-state-layer-opacity:var(--_selected-hover-state-layer-opacity);--md-ripple-pressed-state-layer-color:var(--_selected-pressed-state-layer-color);--md-ripple-pressed-state-layer-opacity:var(--_selected-pressed-state-layer-opacity)}.error md-ripple{--md-ripple-focus-state-layer-color:var(--_error-focus-state-layer-color);--md-ripple-hover-state-layer-color:var(--_error-hover-state-layer-color);--md-ripple-hover-state-layer-opacity:var(--_error-hover-state-layer-opacity);--md-ripple-pressed-state-layer-color:var(--_error-pressed-state-layer-color);--md-ripple-pressed-state-layer-opacity:var(--_error-pressed-state-layer-opacity)}.icon{fill:var(--_selected-icon-color);height:var(--_icon-size);width:var(--_icon-size)}.mark.short{height:2px;transition-property:transform,height;width:2px}.mark.long{height:2px;transition-property:transform,width;width:10px}.mark{animation-duration:150ms;animation-timing-function:cubic-bezier(0.3, 0, 0.8, 0.15);transition-duration:150ms;transition-timing-function:cubic-bezier(0.3, 0, 0.8, 0.15)}.selected .mark{animation-duration:350ms;animation-timing-function:cubic-bezier(0.05, 0.7, 0.1, 1);transition-duration:350ms;transition-timing-function:cubic-bezier(0.05, 0.7, 0.1, 1)}.checked .mark,.prev-checked.unselected .mark{transform:scaleY(-1) translate(7px, -14px) rotate(45deg)}.checked .mark.short,.prev-checked.unselected .mark.short{height:5.6568542495px}.checked .mark.long,.prev-checked.unselected .mark.long{width:11.313708499px}.indeterminate .mark,.prev-indeterminate.unselected .mark{transform:scaleY(-1) translate(4px, -10px) rotate(0deg)}.prev-unselected .mark{transition-property:none}.prev-unselected.checked .mark.long{animation-name:prev-unselected-to-checked}@keyframes prev-unselected-to-checked{from{width:0}}.error .outline{border-color:var(--_unselected-error-outline-color)}.error .background{background:var(--_selected-error-container-color)}.error .icon{fill:var(--_selected-error-icon-color)}:host(:hover) .outline{border-color:var(--_unselected-hover-outline-color);border-width:var(--_unselected-hover-outline-width)}:host(:hover) .background{background:var(--_selected-hover-container-color)}:host(:hover) .icon{fill:var(--_selected-hover-icon-color)}:host(:hover) .error .outline{border-color:var(--_unselected-error-hover-outline-color);border-width:var(--_unselected-error-hover-outline-width)}:host(:hover) .error .background{background:var(--_selected-error-hover-container-color)}:host(:hover) .error .icon{fill:var(--_selected-error-hover-icon-color)}:host(:focus-within) .outline{border-color:var(--_unselected-focus-outline-color);border-width:var(--_unselected-focus-outline-width)}:host(:focus-within) .background{background:var(--_selected-focus-container-color)}:host(:focus-within) .icon{fill:var(--_selected-focus-icon-color)}:host(:focus-within) .error .outline{border-color:var(--_unselected-error-focus-outline-color);border-width:var(--_unselected-error-focus-outline-width)}:host(:focus-within) .error .background{background:var(--_selected-error-focus-container-color)}:host(:focus-within) .error .icon{fill:var(--_selected-error-focus-icon-color)}:host(:active) .outline{border-color:var(--_unselected-pressed-outline-color);border-width:var(--_unselected-pressed-outline-width)}:host(:active) .background{background:var(--_selected-pressed-container-color)}:host(:active) .icon{fill:var(--_selected-pressed-icon-color)}:host(:active) .error .outline{border-color:var(--_unselected-error-pressed-outline-color);border-width:var(--_unselected-error-pressed-outline-width)}:host(:active) .error .background{background:var(--_selected-error-pressed-container-color)}:host(:active) .error .icon{fill:var(--_selected-error-pressed-icon-color)}:host([disabled]) .background,:host([disabled]) .icon,:host([disabled]) .mark,.prev-disabled .background,.prev-disabled .icon,.prev-disabled .mark{animation-duration:0s;transition-duration:0s}:host([disabled]) .outline{border-color:var(--_unselected-disabled-outline-color);border-width:var(--_unselected-disabled-outline-width);opacity:var(--_unselected-disabled-container-opacity)}:host([disabled]) .selected .outline{visibility:hidden}:host([disabled]) .selected .background{background:var(--_selected-disabled-container-color);opacity:var(--_selected-disabled-container-opacity)}:host([disabled]) .icon{fill:var(--_selected-disabled-icon-color)}/*# sourceMappingURL=checkbox-styles.css.map */ +export const styles = css `:host{--_container-shape: var(--md-checkbox-container-shape, 2px);--_container-size: var(--md-checkbox-container-size, 18px);--_error-focus-state-layer-color: var(--md-checkbox-error-focus-state-layer-color, var(--md-sys-color-error, #b3261e));--_error-focus-state-layer-opacity: var(--md-checkbox-error-focus-state-layer-opacity, 0.12);--_error-hover-state-layer-color: var(--md-checkbox-error-hover-state-layer-color, var(--md-sys-color-error, #b3261e));--_error-hover-state-layer-opacity: var(--md-checkbox-error-hover-state-layer-opacity, 0.08);--_error-pressed-state-layer-color: var(--md-checkbox-error-pressed-state-layer-color, var(--md-sys-color-error, #b3261e));--_error-pressed-state-layer-opacity: var(--md-checkbox-error-pressed-state-layer-opacity, 0.12);--_icon-size: var(--md-checkbox-icon-size, 18px);--_selected-container-color: var(--md-checkbox-selected-container-color, var(--md-sys-color-primary, #6750a4));--_selected-disabled-container-color: var(--md-checkbox-selected-disabled-container-color, var(--md-sys-color-on-surface, #1d1b20));--_selected-disabled-container-opacity: var(--md-checkbox-selected-disabled-container-opacity, 0.38);--_selected-disabled-icon-color: var(--md-checkbox-selected-disabled-icon-color, var(--md-sys-color-surface, #fef7ff));--_selected-error-container-color: var(--md-checkbox-selected-error-container-color, var(--md-sys-color-error, #b3261e));--_selected-error-focus-container-color: var(--md-checkbox-selected-error-focus-container-color, var(--md-sys-color-error, #b3261e));--_selected-error-focus-icon-color: var(--md-checkbox-selected-error-focus-icon-color, var(--md-sys-color-on-error, #fff));--_selected-error-hover-container-color: var(--md-checkbox-selected-error-hover-container-color, var(--md-sys-color-error, #b3261e));--_selected-error-hover-icon-color: var(--md-checkbox-selected-error-hover-icon-color, var(--md-sys-color-on-error, #fff));--_selected-error-icon-color: var(--md-checkbox-selected-error-icon-color, var(--md-sys-color-on-error, #fff));--_selected-error-pressed-container-color: var(--md-checkbox-selected-error-pressed-container-color, var(--md-sys-color-error, #b3261e));--_selected-error-pressed-icon-color: var(--md-checkbox-selected-error-pressed-icon-color, var(--md-sys-color-on-error, #fff));--_selected-focus-container-color: var(--md-checkbox-selected-focus-container-color, var(--md-sys-color-primary, #6750a4));--_selected-focus-icon-color: var(--md-checkbox-selected-focus-icon-color, var(--md-sys-color-on-primary, #fff));--_selected-focus-state-layer-color: var(--md-checkbox-selected-focus-state-layer-color, var(--md-sys-color-primary, #6750a4));--_selected-focus-state-layer-opacity: var(--md-checkbox-selected-focus-state-layer-opacity, 0.12);--_selected-hover-container-color: var(--md-checkbox-selected-hover-container-color, var(--md-sys-color-primary, #6750a4));--_selected-hover-icon-color: var(--md-checkbox-selected-hover-icon-color, var(--md-sys-color-on-primary, #fff));--_selected-hover-state-layer-color: var(--md-checkbox-selected-hover-state-layer-color, var(--md-sys-color-primary, #6750a4));--_selected-hover-state-layer-opacity: var(--md-checkbox-selected-hover-state-layer-opacity, 0.08);--_selected-icon-color: var(--md-checkbox-selected-icon-color, var(--md-sys-color-on-primary, #fff));--_selected-pressed-container-color: var(--md-checkbox-selected-pressed-container-color, var(--md-sys-color-primary, #6750a4));--_selected-pressed-icon-color: var(--md-checkbox-selected-pressed-icon-color, var(--md-sys-color-on-primary, #fff));--_selected-pressed-state-layer-color: var(--md-checkbox-selected-pressed-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_selected-pressed-state-layer-opacity: var(--md-checkbox-selected-pressed-state-layer-opacity, 0.12);--_state-layer-shape: var(--md-checkbox-state-layer-shape, 9999px);--_state-layer-size: var(--md-checkbox-state-layer-size, 40px);--_unselected-disabled-container-opacity: var(--md-checkbox-unselected-disabled-container-opacity, 0.38);--_unselected-disabled-outline-color: var(--md-checkbox-unselected-disabled-outline-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-disabled-outline-width: var(--md-checkbox-unselected-disabled-outline-width, 2px);--_unselected-error-focus-outline-color: var(--md-checkbox-unselected-error-focus-outline-color, var(--md-sys-color-error, #b3261e));--_unselected-error-hover-outline-color: var(--md-checkbox-unselected-error-hover-outline-color, var(--md-sys-color-error, #b3261e));--_unselected-error-outline-color: var(--md-checkbox-unselected-error-outline-color, var(--md-sys-color-error, #b3261e));--_unselected-error-pressed-outline-color: var(--md-checkbox-unselected-error-pressed-outline-color, var(--md-sys-color-error, #b3261e));--_unselected-focus-outline-color: var(--md-checkbox-unselected-focus-outline-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-focus-outline-width: var(--md-checkbox-unselected-focus-outline-width, 2px);--_unselected-focus-state-layer-color: var(--md-checkbox-unselected-focus-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-focus-state-layer-opacity: var(--md-checkbox-unselected-focus-state-layer-opacity, 0.12);--_unselected-hover-outline-color: var(--md-checkbox-unselected-hover-outline-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-hover-outline-width: var(--md-checkbox-unselected-hover-outline-width, 2px);--_unselected-hover-state-layer-color: var(--md-checkbox-unselected-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-hover-state-layer-opacity: var(--md-checkbox-unselected-hover-state-layer-opacity, 0.08);--_unselected-outline-color: var(--md-checkbox-unselected-outline-color, var(--md-sys-color-on-surface-variant, #49454f));--_unselected-outline-width: var(--md-checkbox-unselected-outline-width, 2px);--_unselected-pressed-outline-color: var(--md-checkbox-unselected-pressed-outline-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-pressed-outline-width: var(--md-checkbox-unselected-pressed-outline-width, 2px);--_unselected-pressed-state-layer-color: var(--md-checkbox-unselected-pressed-state-layer-color, var(--md-sys-color-primary, #6750a4));--_unselected-pressed-state-layer-opacity: var(--md-checkbox-unselected-pressed-state-layer-opacity, 0.12);--_container-shape-start-start: var( --md-checkbox-container-shape-start-start, var(--_container-shape) );--_container-shape-start-end: var( --md-checkbox-container-shape-start-end, var(--_container-shape) );--_container-shape-end-end: var( --md-checkbox-container-shape-end-end, var(--_container-shape) );--_container-shape-end-start: var( --md-checkbox-container-shape-end-start, var(--_container-shape) );border-start-start-radius:var(--_container-shape-start-start);border-start-end-radius:var(--_container-shape-start-end);border-end-end-radius:var(--_container-shape-end-end);border-end-start-radius:var(--_container-shape-end-start);display:inline-flex;height:48px;position:relative;vertical-align:top;width:48px;-webkit-tap-highlight-color:rgba(0,0,0,0);--md-focus-ring-offset: -2px}input{appearance:none;inset:0;margin:0;outline:none;position:absolute;opacity:0;block-size:100%;inline-size:100%}.container{border-radius:inherit;height:100%;position:relative;width:100%}.outline,.background,md-ripple,.icon{inset:0;margin:auto;position:absolute}.outline,.background{border-radius:inherit;height:var(--_container-size);width:var(--_container-size)}.outline{border-color:var(--_unselected-outline-color);border-style:solid;border-width:var(--_unselected-outline-width);box-sizing:border-box}.background{background-color:var(--_selected-container-color)}.background,.icon{opacity:0;transition-duration:150ms,50ms;transition-property:transform,opacity;transition-timing-function:cubic-bezier(0.3, 0, 0.8, 0.15),linear;transform:scale(0.6)}.selected .background,.selected .icon{opacity:1;transition-duration:350ms,50ms;transition-timing-function:cubic-bezier(0.05, 0.7, 0.1, 1),linear;transform:scale(1)}md-ripple{height:var(--_state-layer-size);width:var(--_state-layer-size);--md-ripple-focus-color:var(--_unselected-focus-state-layer-color);--md-ripple-focus-opacity:var(--_unselected-focus-state-layer-opacity);--md-ripple-hover-color:var(--_unselected-hover-state-layer-color);--md-ripple-hover-opacity:var(--_unselected-hover-state-layer-opacity);--md-ripple-pressed-color:var(--_unselected-pressed-state-layer-color);--md-ripple-pressed-opacity:var(--_unselected-pressed-state-layer-opacity);--md-ripple-shape:var(--_state-layer-shape)}.selected md-ripple{--md-ripple-focus-color:var(--_selected-focus-state-layer-color);--md-ripple-focus-opacity:var(--_selected-focus-state-layer-opacity);--md-ripple-hover-color:var(--_selected-hover-state-layer-color);--md-ripple-hover-opacity:var(--_selected-hover-state-layer-opacity);--md-ripple-pressed-color:var(--_selected-pressed-state-layer-color);--md-ripple-pressed-opacity:var(--_selected-pressed-state-layer-opacity)}.error md-ripple{--md-ripple-focus-color:var(--_error-focus-state-layer-color);--md-ripple-focus-opacity:var(--_error-focus-state-layer-opacity);--md-ripple-hover-color:var(--_error-hover-state-layer-color);--md-ripple-hover-opacity:var(--_error-hover-state-layer-opacity);--md-ripple-pressed-color:var(--_error-pressed-state-layer-color);--md-ripple-pressed-opacity:var(--_error-pressed-state-layer-opacity)}.icon{fill:var(--_selected-icon-color);height:var(--_icon-size);width:var(--_icon-size)}.mark.short{height:2px;transition-property:transform,height;width:2px}.mark.long{height:2px;transition-property:transform,width;width:10px}.mark{animation-duration:150ms;animation-timing-function:cubic-bezier(0.3, 0, 0.8, 0.15);transition-duration:150ms;transition-timing-function:cubic-bezier(0.3, 0, 0.8, 0.15)}.selected .mark{animation-duration:350ms;animation-timing-function:cubic-bezier(0.05, 0.7, 0.1, 1);transition-duration:350ms;transition-timing-function:cubic-bezier(0.05, 0.7, 0.1, 1)}.checked .mark,.prev-checked.unselected .mark{transform:scaleY(-1) translate(7px, -14px) rotate(45deg)}.checked .mark.short,.prev-checked.unselected .mark.short{height:5.6568542495px}.checked .mark.long,.prev-checked.unselected .mark.long{width:11.313708499px}.indeterminate .mark,.prev-indeterminate.unselected .mark{transform:scaleY(-1) translate(4px, -10px) rotate(0deg)}.prev-unselected .mark{transition-property:none}.prev-unselected.checked .mark.long{animation-name:prev-unselected-to-checked}@keyframes prev-unselected-to-checked{from{width:0}}.error .outline{border-color:var(--_unselected-error-outline-color)}.error .background{background:var(--_selected-error-container-color)}.error .icon{fill:var(--_selected-error-icon-color)}:host(:hover) .outline{border-color:var(--_unselected-hover-outline-color);border-width:var(--_unselected-hover-outline-width)}:host(:hover) .background{background:var(--_selected-hover-container-color)}:host(:hover) .icon{fill:var(--_selected-hover-icon-color)}:host(:hover) .error .outline{border-color:var(--_unselected-error-hover-outline-color)}:host(:hover) .error .background{background:var(--_selected-error-hover-container-color)}:host(:hover) .error .icon{fill:var(--_selected-error-hover-icon-color)}:host(:focus-within) .outline{border-color:var(--_unselected-focus-outline-color);border-width:var(--_unselected-focus-outline-width)}:host(:focus-within) .background{background:var(--_selected-focus-container-color)}:host(:focus-within) .icon{fill:var(--_selected-focus-icon-color)}:host(:focus-within) .error .outline{border-color:var(--_unselected-error-focus-outline-color)}:host(:focus-within) .error .background{background:var(--_selected-error-focus-container-color)}:host(:focus-within) .error .icon{fill:var(--_selected-error-focus-icon-color)}:host(:active) .outline{border-color:var(--_unselected-pressed-outline-color);border-width:var(--_unselected-pressed-outline-width)}:host(:active) .background{background:var(--_selected-pressed-container-color)}:host(:active) .icon{fill:var(--_selected-pressed-icon-color)}:host(:active) .error .outline{border-color:var(--_unselected-error-pressed-outline-color)}:host(:active) .error .background{background:var(--_selected-error-pressed-container-color)}:host(:active) .error .icon{fill:var(--_selected-error-pressed-icon-color)}:host([disabled]) .background,:host([disabled]) .icon,:host([disabled]) .mark,.prev-disabled .background,.prev-disabled .icon,.prev-disabled .mark{animation-duration:0s;transition-duration:0s}:host([disabled]) .outline{border-color:var(--_unselected-disabled-outline-color);border-width:var(--_unselected-disabled-outline-width);opacity:var(--_unselected-disabled-container-opacity)}:host([disabled]) .selected .outline{visibility:hidden}:host([disabled]) .selected .background{background:var(--_selected-disabled-container-color);opacity:var(--_selected-disabled-container-opacity)}:host([disabled]) .icon{fill:var(--_selected-disabled-icon-color)}/*# sourceMappingURL=checkbox-styles.css.map */ `; //# sourceMappingURL=checkbox-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/checkbox/lib/checkbox.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/checkbox/lib/checkbox.d.ts index e93a76d..daaa92d 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/checkbox/lib/checkbox.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/checkbox/lib/checkbox.d.ts
@@ -5,7 +5,7 @@ */ import '../../focus/focus-ring.js'; import '../../ripple/ripple.js'; -import { LitElement, PropertyValues, TemplateResult } from 'lit'; +import { LitElement, PropertyValues } from 'lit'; import { getFormValue } from '../../controller/form-controller.js'; /** * A checkbox component. @@ -47,23 +47,18 @@ * The associated form element with which this element's value will submit. */ get form(): HTMLFormElement; - ariaLabel: string; private prevChecked; private prevDisabled; private prevIndeterminate; private readonly ripple; private readonly input; - private showFocusRing; private showRipple; constructor(); focus(): void; [getFormValue](): string; protected update(changed: PropertyValues<Checkbox>): void; - protected render(): TemplateResult; - private handleBlur; + protected render(): import("lit-html").TemplateResult<1>; private handleChange; - private handleFocus; - private handlePointerDown; private readonly getRipple; private readonly renderRipple; }
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/checkbox/lib/checkbox.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/checkbox/lib/checkbox.js index 233cd01..36037a2 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/checkbox/lib/checkbox.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/checkbox/lib/checkbox.js
@@ -3,23 +3,29 @@ * Copyright 2019 Google LLC * SPDX-License-Identifier: Apache-2.0 */ -import { __decorate, __metadata } from "tslib"; +var _a; +import { __decorate } from "tslib"; import '../../focus/focus-ring.js'; import '../../ripple/ripple.js'; -import { html, LitElement, nothing } from 'lit'; +import { html, isServer, LitElement, nothing } from 'lit'; import { property, query, queryAsync, state } from 'lit/decorators.js'; import { classMap } from 'lit/directives/class-map.js'; import { when } from 'lit/directives/when.js'; +import { requestUpdateOnAriaChange } from '../../aria/delegate.js'; import { dispatchActivationClick, isActivationClick, redispatchEvent } from '../../controller/events.js'; import { FormController, getFormValue } from '../../controller/form-controller.js'; import { stringConverter } from '../../controller/string-converter.js'; -import { ariaProperty } from '../../decorators/aria-property.js'; -import { pointerPress, shouldShowStrongFocus } from '../../focus/strong-focus.js'; import { ripple } from '../../ripple/directive.js'; /** * A checkbox component. */ export class Checkbox extends LitElement { + /** + * The associated form element with which this element's value will submit. + */ + get form() { + return this.closest('form'); + } constructor() { super(); /** @@ -53,7 +59,6 @@ this.prevChecked = false; this.prevDisabled = false; this.prevIndeterminate = false; - this.showFocusRing = false; this.showRipple = false; this.getRipple = () => { this.showRipple = true; @@ -63,19 +68,15 @@ return html `<md-ripple ?disabled=${this.disabled} unbounded></md-ripple>`; }; this.addController(new FormController(this)); - this.addEventListener('click', (event) => { - if (!isActivationClick(event)) { - return; - } - this.focus(); - dispatchActivationClick(this.input); - }); - } - /** - * The associated form element with which this element's value will submit. - */ - get form() { - return this.closest('form'); + if (!isServer) { + this.addEventListener('click', (event) => { + if (!isActivationClick(event)) { + return; + } + this.focus(); + dispatchActivationClick(this.input); + }); + } } focus() { this.input?.focus(); @@ -110,11 +111,13 @@ 'prev-indeterminate': prevIndeterminate, 'prev-disabled': this.prevDisabled, }); + // Needed for closure conformance + const { ariaLabel } = this; return html ` <div class="container ${containerClasses}"> <div class="outline"></div> <div class="background"></div> - <md-focus-ring .visible=${this.showFocusRing}></md-focus-ring> + <md-focus-ring for="input"></md-focus-ring> ${when(this.showRipple, this.renderRipple)} <svg class="icon" viewBox="0 0 18 18"> <rect class="mark short" /> @@ -122,21 +125,16 @@ </svg> </div> <input type="checkbox" + id="input" aria-checked=${isIndeterminate ? 'mixed' : nothing} - aria-label=${this.ariaLabel || nothing} + aria-label=${ariaLabel || nothing} ?disabled=${this.disabled} .indeterminate=${this.indeterminate} .checked=${this.checked} - @blur=${this.handleBlur} @change=${this.handleChange} - @focus=${this.handleFocus} - @pointerdown=${this.handlePointerDown} ${ripple(this.getRipple)} > - `; - } - handleBlur() { - this.showFocusRing = false; + `; } handleChange(event) { const target = event.target; @@ -144,74 +142,49 @@ this.indeterminate = target.indeterminate; redispatchEvent(this, event); } - handleFocus() { - this.showFocusRing = shouldShowStrongFocus(); - } - handlePointerDown() { - pointerPress(); - this.showFocusRing = shouldShowStrongFocus(); - } } +_a = Checkbox; +(() => { + requestUpdateOnAriaChange(_a); +})(); /** * @nocollapse */ Checkbox.formAssociated = true; __decorate([ - property({ type: Boolean, reflect: true }), - __metadata("design:type", Object) + property({ type: Boolean, reflect: true }) ], Checkbox.prototype, "checked", void 0); __decorate([ - property({ type: Boolean, reflect: true }), - __metadata("design:type", Object) + property({ type: Boolean, reflect: true }) ], Checkbox.prototype, "disabled", void 0); __decorate([ - property({ type: Boolean, reflect: true }), - __metadata("design:type", Object) + property({ type: Boolean, reflect: true }) ], Checkbox.prototype, "error", void 0); __decorate([ - property({ type: Boolean, reflect: true }), - __metadata("design:type", Object) + property({ type: Boolean, reflect: true }) ], Checkbox.prototype, "indeterminate", void 0); __decorate([ - property(), - __metadata("design:type", Object) + property() ], Checkbox.prototype, "value", void 0); __decorate([ - property({ type: String, reflect: true, converter: stringConverter }), - __metadata("design:type", Object) + property({ reflect: true, converter: stringConverter }) ], Checkbox.prototype, "name", void 0); __decorate([ - ariaProperty // tslint:disable-line:no-new-decorators - , - property({ type: String, attribute: 'data-aria-label', noAccessor: true }), - __metadata("design:type", String) -], Checkbox.prototype, "ariaLabel", void 0); -__decorate([ - state(), - __metadata("design:type", Object) + state() ], Checkbox.prototype, "prevChecked", void 0); __decorate([ - state(), - __metadata("design:type", Object) + state() ], Checkbox.prototype, "prevDisabled", void 0); __decorate([ - state(), - __metadata("design:type", Object) + state() ], Checkbox.prototype, "prevIndeterminate", void 0); __decorate([ - queryAsync('md-ripple'), - __metadata("design:type", Promise) + queryAsync('md-ripple') ], Checkbox.prototype, "ripple", void 0); __decorate([ - query('input'), - __metadata("design:type", HTMLInputElement) + query('input') ], Checkbox.prototype, "input", void 0); __decorate([ - state(), - __metadata("design:type", Object) -], Checkbox.prototype, "showFocusRing", void 0); -__decorate([ - state(), - __metadata("design:type", Object) + state() ], Checkbox.prototype, "showRipple", void 0); //# sourceMappingURL=checkbox.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/checkbox/lib/forced-colors-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/checkbox/lib/forced-colors-styles.css.js index 6e21f69f..e785dae0 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/checkbox/lib/forced-colors-styles.css.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/checkbox/lib/forced-colors-styles.css.js
@@ -4,6 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ import { css } from 'lit'; -export const styles = css `@media(forced-colors: active){:host{--md-checkbox-selected-container-color:CanvasText;--md-checkbox-selected-disabled-container-color:GrayText;--md-checkbox-selected-disabled-container-opacity:1;--md-checkbox-selected-disabled-icon-color:Canvas;--md-checkbox-selected-error-container-color:CanvasText;--md-checkbox-selected-error-focus-container-color:CanvasText;--md-checkbox-selected-error-focus-icon-color:Canvas;--md-checkbox-selected-error-hover-container-color:CanvasText;--md-checkbox-selected-error-hover-icon-color:Canvas;--md-checkbox-selected-error-icon-color:Canvas;--md-checkbox-selected-error-pressed-container-color:CanvasText;--md-checkbox-selected-error-pressed-icon-color:Canvas;--md-checkbox-selected-focus-container-color:CanvasText;--md-checkbox-selected-focus-icon-color:Canvas;--md-checkbox-selected-hover-container-color:CanvasText;--md-checkbox-selected-hover-icon-color:Canvas;--md-checkbox-selected-icon-color:Canvas;--md-checkbox-selected-pressed-container-color:CanvasText;--md-checkbox-selected-pressed-icon-color:Canvas;--md-checkbox-unselected-disabled-container-opacity:1;--md-checkbox-unselected-disabled-outline-color:GrayText;--md-checkbox-unselected-error-focus-outline-color:CanvasText;--md-checkbox-unselected-error-hover-outline-color:CanvasText;--md-checkbox-unselected-error-outline-color:CanvasText;--md-checkbox-unselected-error-pressed-outline-color:CanvasText;--md-checkbox-unselected-focus-outline-color:CanvasText;--md-checkbox-unselected-hover-outline-color:CanvasText;--md-checkbox-unselected-outline-color:CanvasText;--md-checkbox-unselected-pressed-outline-color:CanvasText}}/*# sourceMappingURL=forced-colors-styles.css.map */ +export const styles = css `@media(forced-colors: active){:host{--md-checkbox-selected-container-color: CanvasText;--md-checkbox-selected-disabled-container-color: GrayText;--md-checkbox-selected-disabled-container-opacity: 1;--md-checkbox-selected-disabled-icon-color: Canvas;--md-checkbox-selected-error-container-color: CanvasText;--md-checkbox-selected-error-focus-container-color: CanvasText;--md-checkbox-selected-error-focus-icon-color: Canvas;--md-checkbox-selected-error-hover-container-color: CanvasText;--md-checkbox-selected-error-hover-icon-color: Canvas;--md-checkbox-selected-error-icon-color: Canvas;--md-checkbox-selected-error-pressed-container-color: CanvasText;--md-checkbox-selected-error-pressed-icon-color: Canvas;--md-checkbox-selected-focus-container-color: CanvasText;--md-checkbox-selected-focus-icon-color: Canvas;--md-checkbox-selected-hover-container-color: CanvasText;--md-checkbox-selected-hover-icon-color: Canvas;--md-checkbox-selected-icon-color: Canvas;--md-checkbox-selected-pressed-container-color: CanvasText;--md-checkbox-selected-pressed-icon-color: Canvas;--md-checkbox-unselected-disabled-container-opacity: 1;--md-checkbox-unselected-disabled-outline-color: GrayText;--md-checkbox-unselected-error-focus-outline-color: CanvasText;--md-checkbox-unselected-error-hover-outline-color: CanvasText;--md-checkbox-unselected-error-outline-color: CanvasText;--md-checkbox-unselected-error-pressed-outline-color: CanvasText;--md-checkbox-unselected-focus-outline-color: CanvasText;--md-checkbox-unselected-hover-outline-color: CanvasText;--md-checkbox-unselected-outline-color: CanvasText;--md-checkbox-unselected-pressed-outline-color: CanvasText}}/*# sourceMappingURL=forced-colors-styles.css.map */ `; //# sourceMappingURL=forced-colors-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/delete-action.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/delete-action.d.ts deleted file mode 100644 index 2fc46a78..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/delete-action.d.ts +++ /dev/null
@@ -1,18 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { DeleteAction } from './lib/delete-action.js'; -declare global { - interface HTMLElementTagNameMap { - 'md-delete-action': MdDeleteAction; - } -} -/** - * @soyCompatible - * @final - * @suppress {visibility} - */ -export declare class MdDeleteAction extends DeleteAction { -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/delete-action.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/delete-action.js deleted file mode 100644 index d82fb9c..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/delete-action.js +++ /dev/null
@@ -1,20 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { __decorate } from "tslib"; -import { customElement } from 'lit/decorators.js'; -import { DeleteAction } from './lib/delete-action.js'; -/** - * @soyCompatible - * @final - * @suppress {visibility} - */ -let MdDeleteAction = class MdDeleteAction extends DeleteAction { -}; -MdDeleteAction = __decorate([ - customElement('md-delete-action') -], MdDeleteAction); -export { MdDeleteAction }; -//# sourceMappingURL=delete-action.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/lib/action.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/lib/action.d.ts deleted file mode 100644 index 72a4936e..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/lib/action.d.ts +++ /dev/null
@@ -1,47 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import '../../../focus/focus-ring.js'; -import '../../../ripple/ripple.js'; -import { TemplateResult } from 'lit'; -import { ClassInfo } from 'lit/directives/class-map.js'; -import { ActionElement, BeginPressConfig, EndPressConfig } from '../../../actionelement/action-element.js'; -import { MdRipple } from '../../../ripple/ripple.js'; -/** - * Base class for all actions. - * @soyCompatible - */ -export declare abstract class Action extends ActionElement { - isDeletable: boolean; - isFocusable: boolean; - isTouchable: boolean; - disabled: boolean; - showFocusRing: boolean; - ripple?: MdRipple | null; - /** @soyPrefixAttribute */ - ariaLabel: string; - /** @soyTemplate */ - protected getRootClasses(): ClassInfo; - /** @soyTemplate */ - protected getRippleClasses(): ClassInfo; - /** @soyTemplate */ - protected renderTouchTarget(): TemplateResult; - /** @soyTemplate */ - protected renderRipple(): TemplateResult; - /** @soyTemplate */ - protected renderFocusRing(): TemplateResult; - protected handleFocus(): void; - protected handleBlur(): void; - beginPress({ positionEvent }: BeginPressConfig): void; - endPress(options: EndPressConfig): void; - protected handlePointerEnter(e: PointerEvent): void; - handlePointerLeave(e: PointerEvent): void; - handlePointerDown(e: PointerEvent): void; - handleClick(e: MouseEvent): void; - protected handleKeyDown(e: KeyboardEvent): void; - protected getInteractionEvent(): string; - private dispatchCustomEvent; - private isRTL; -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/lib/action.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/lib/action.js deleted file mode 100644 index 613def5e..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/lib/action.js +++ /dev/null
@@ -1,162 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { __decorate, __metadata } from "tslib"; -import '../../../focus/focus-ring.js'; -import '../../../ripple/ripple.js'; -import { html } from 'lit'; -import { property, query, state } from 'lit/decorators.js'; -import { classMap } from 'lit/directives/class-map.js'; -import { ActionElement } from '../../../actionelement/action-element.js'; -import { ariaProperty } from '../../../decorators/aria-property.js'; -import { pointerPress, shouldShowStrongFocus } from '../../../focus/strong-focus.js'; -import { MdRipple } from '../../../ripple/ripple.js'; -import { Md3ChipActionEventType } from './events.js'; -/** - * Base class for all actions. - * @soyCompatible - */ -export class Action extends ActionElement { - constructor() { - super(...arguments); - this.isDeletable = false; - this.isFocusable = false; - this.isTouchable = false; - this.disabled = false; - this.showFocusRing = false; - } - /** @soyTemplate */ - getRootClasses() { - return { - 'md3-chip__action': true, - }; - } - /** @soyTemplate */ - getRippleClasses() { - return { - 'md3-chip__ripple': true, - }; - } - /** @soyTemplate */ - renderTouchTarget() { - return this.isTouchable ? - html `<span class="md3-chip__action-touch"></span>` : - html ``; - } - /** @soyTemplate */ - renderRipple() { - return html ` - <md-ripple class="${classMap(this.getRippleClasses())}" - ?disabled="${this.disabled}"> - </md-ripple>`; - } - /** @soyTemplate */ - renderFocusRing() { - return html ` - <md-focus-ring .visible="${this.showFocusRing}"></md-focus-ring>`; - } - handleFocus() { - this.showFocusRing = shouldShowStrongFocus(); - } - handleBlur() { - this.showFocusRing = false; - } - beginPress({ positionEvent }) { - this.ripple?.beginPress(positionEvent); - } - endPress(options) { - super.endPress(options); - this.ripple?.endPress(); - if (!options.cancelled) { - this.dispatchCustomEvent(this.getInteractionEvent()); - } - } - handlePointerEnter(e) { - this.ripple?.beginHover(e); - } - handlePointerLeave(e) { - super.handlePointerLeave(e); - this.ripple?.endHover(); - } - handlePointerDown(e) { - super.handlePointerDown(e); - pointerPress(); - this.showFocusRing = shouldShowStrongFocus(); - } - handleClick(e) { - super.handleClick(e); - this.dispatchCustomEvent(this.getInteractionEvent()); - } - handleKeyDown(e) { - switch (e.key) { - case 'Enter': - case ' ': - this.dispatchCustomEvent(this.getInteractionEvent()); - break; - case 'Delete': - case 'Backspace': - if (this.isDeletable) { - this.dispatchCustomEvent(Md3ChipActionEventType.DELETE); - } - break; - case 'ArrowLeft': - this.dispatchCustomEvent(this.isRTL() ? Md3ChipActionEventType.NAVIGATE_TO_NEXT : - Md3ChipActionEventType.NAVIGATE_TO_PREV); - break; - case 'ArrowRight': - this.dispatchCustomEvent(this.isRTL() ? Md3ChipActionEventType.NAVIGATE_TO_PREV : - Md3ChipActionEventType.NAVIGATE_TO_NEXT); - break; - case 'Home': - this.dispatchCustomEvent(Md3ChipActionEventType.NAVIGATE_TO_FIRST); - break; - case 'End': - this.dispatchCustomEvent(Md3ChipActionEventType.NAVIGATE_TO_LAST); - break; - default: - // Unhandled key, do nothing. - } - } - getInteractionEvent() { - return Md3ChipActionEventType.SELECT; - } - dispatchCustomEvent(eventType) { - this.dispatchEvent(new CustomEvent(eventType, { bubbles: true, composed: true })); - } - isRTL() { - return getComputedStyle(this).getPropertyValue('direction') === 'rtl'; - } -} -__decorate([ - property({ type: Boolean, reflect: true }), - __metadata("design:type", Object) -], Action.prototype, "isDeletable", void 0); -__decorate([ - property({ type: Boolean, reflect: true }), - __metadata("design:type", Object) -], Action.prototype, "isFocusable", void 0); -__decorate([ - property({ type: Boolean, reflect: true }), - __metadata("design:type", Object) -], Action.prototype, "isTouchable", void 0); -__decorate([ - property({ type: Boolean, reflect: true }), - __metadata("design:type", Object) -], Action.prototype, "disabled", void 0); -__decorate([ - state(), - __metadata("design:type", Object) -], Action.prototype, "showFocusRing", void 0); -__decorate([ - query('md-ripple'), - __metadata("design:type", MdRipple) -], Action.prototype, "ripple", void 0); -__decorate([ - ariaProperty // tslint:disable-line:no-new-decorators - , - property({ type: String, attribute: 'aria-label' }), - __metadata("design:type", String) -], Action.prototype, "ariaLabel", void 0); -//# sourceMappingURL=action.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/lib/constants.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/lib/constants.d.ts deleted file mode 100644 index ec7ecc09..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/lib/constants.d.ts +++ /dev/null
@@ -1,62 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -/** - * MDCChipActionCssClasses provides the classes to be queried and manipulated on - * the root. - */ -export declare enum MDCChipActionCssClasses { - PRIMARY_ACTION = "md3-evolution-chip__action--primary", - TRAILING_ACTION = "md3-evolution-chip__action--trailing", - CHIP_ROOT = "md3-evolution-chip" -} -/** - * MDCChipActionInteractionTrigger provides detail of the different triggers for - * action interactions. - */ -export declare enum MDCChipActionInteractionTrigger { - UNSPECIFIED = 0, - CLICK = 1, - BACKSPACE_KEY = 2, - DELETE_KEY = 3, - SPACEBAR_KEY = 4, - ENTER_KEY = 5 -} -/** - * MDCChipActionType provides the different types of available actions. - */ -export declare enum MDCChipActionType { - UNSPECIFIED = 0, - PRIMARY = 1, - TRAILING = 2 -} -/** - * MDCChipActionEvents provides the different events emitted by the action. - */ -export declare enum MDCChipActionEvents { - INTERACTION = "MDCChipAction:interaction", - NAVIGATION = "MDCChipAction:navigation" -} -/** - * MDCChipActionFocusBehavior provides configurations for focusing or unfocusing - * an action. - */ -export declare enum MDCChipActionFocusBehavior { - FOCUSABLE = 0, - FOCUSABLE_AND_FOCUSED = 1, - NOT_FOCUSABLE = 2 -} -/** - * MDCChipActionAttributes provides the HTML attributes used by the foundation. - */ -export declare enum MDCChipActionAttributes { - ARIA_DISABLED = "aria-disabled", - ARIA_HIDDEN = "aria-hidden", - ARIA_SELECTED = "aria-selected", - DATA_DELETABLE = "data-mdc-deletable", - DISABLED = "disabled", - ROLE = "role", - TAB_INDEX = "tabindex" -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/lib/constants.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/lib/constants.js deleted file mode 100644 index b0fe16c..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/lib/constants.js +++ /dev/null
@@ -1,69 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -/** - * MDCChipActionCssClasses provides the classes to be queried and manipulated on - * the root. - */ -export var MDCChipActionCssClasses; -(function (MDCChipActionCssClasses) { - MDCChipActionCssClasses["PRIMARY_ACTION"] = "md3-evolution-chip__action--primary"; - MDCChipActionCssClasses["TRAILING_ACTION"] = "md3-evolution-chip__action--trailing"; - MDCChipActionCssClasses["CHIP_ROOT"] = "md3-evolution-chip"; -})(MDCChipActionCssClasses || (MDCChipActionCssClasses = {})); -/** - * MDCChipActionInteractionTrigger provides detail of the different triggers for - * action interactions. - */ -export var MDCChipActionInteractionTrigger; -(function (MDCChipActionInteractionTrigger) { - MDCChipActionInteractionTrigger[MDCChipActionInteractionTrigger["UNSPECIFIED"] = 0] = "UNSPECIFIED"; - MDCChipActionInteractionTrigger[MDCChipActionInteractionTrigger["CLICK"] = 1] = "CLICK"; - MDCChipActionInteractionTrigger[MDCChipActionInteractionTrigger["BACKSPACE_KEY"] = 2] = "BACKSPACE_KEY"; - MDCChipActionInteractionTrigger[MDCChipActionInteractionTrigger["DELETE_KEY"] = 3] = "DELETE_KEY"; - MDCChipActionInteractionTrigger[MDCChipActionInteractionTrigger["SPACEBAR_KEY"] = 4] = "SPACEBAR_KEY"; - MDCChipActionInteractionTrigger[MDCChipActionInteractionTrigger["ENTER_KEY"] = 5] = "ENTER_KEY"; -})(MDCChipActionInteractionTrigger || (MDCChipActionInteractionTrigger = {})); -/** - * MDCChipActionType provides the different types of available actions. - */ -export var MDCChipActionType; -(function (MDCChipActionType) { - MDCChipActionType[MDCChipActionType["UNSPECIFIED"] = 0] = "UNSPECIFIED"; - MDCChipActionType[MDCChipActionType["PRIMARY"] = 1] = "PRIMARY"; - MDCChipActionType[MDCChipActionType["TRAILING"] = 2] = "TRAILING"; -})(MDCChipActionType || (MDCChipActionType = {})); -/** - * MDCChipActionEvents provides the different events emitted by the action. - */ -export var MDCChipActionEvents; -(function (MDCChipActionEvents) { - MDCChipActionEvents["INTERACTION"] = "MDCChipAction:interaction"; - MDCChipActionEvents["NAVIGATION"] = "MDCChipAction:navigation"; -})(MDCChipActionEvents || (MDCChipActionEvents = {})); -/** - * MDCChipActionFocusBehavior provides configurations for focusing or unfocusing - * an action. - */ -export var MDCChipActionFocusBehavior; -(function (MDCChipActionFocusBehavior) { - MDCChipActionFocusBehavior[MDCChipActionFocusBehavior["FOCUSABLE"] = 0] = "FOCUSABLE"; - MDCChipActionFocusBehavior[MDCChipActionFocusBehavior["FOCUSABLE_AND_FOCUSED"] = 1] = "FOCUSABLE_AND_FOCUSED"; - MDCChipActionFocusBehavior[MDCChipActionFocusBehavior["NOT_FOCUSABLE"] = 2] = "NOT_FOCUSABLE"; -})(MDCChipActionFocusBehavior || (MDCChipActionFocusBehavior = {})); -/** - * MDCChipActionAttributes provides the HTML attributes used by the foundation. - */ -export var MDCChipActionAttributes; -(function (MDCChipActionAttributes) { - MDCChipActionAttributes["ARIA_DISABLED"] = "aria-disabled"; - MDCChipActionAttributes["ARIA_HIDDEN"] = "aria-hidden"; - MDCChipActionAttributes["ARIA_SELECTED"] = "aria-selected"; - MDCChipActionAttributes["DATA_DELETABLE"] = "data-mdc-deletable"; - MDCChipActionAttributes["DISABLED"] = "disabled"; - MDCChipActionAttributes["ROLE"] = "role"; - MDCChipActionAttributes["TAB_INDEX"] = "tabindex"; -})(MDCChipActionAttributes || (MDCChipActionAttributes = {})); -//# sourceMappingURL=constants.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/lib/delete-action.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/lib/delete-action.d.ts deleted file mode 100644 index 3499fcf4a..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/lib/delete-action.d.ts +++ /dev/null
@@ -1,20 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { TemplateResult } from 'lit'; -import { ClassInfo } from 'lit/directives/class-map.js'; -import { Action } from './action.js'; -/** @soyCompatible */ -export declare class DeleteAction extends Action { - /** @soyTemplate */ - protected render(): TemplateResult; - /** @soyTemplate */ - protected getRootClasses(): ClassInfo; - /** @soyTemplate */ - protected getRippleClasses(): ClassInfo; - /** @soyTemplate */ - private renderDeleteIcon; - getInteractionEvent(): string; -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/lib/delete-action.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/lib/delete-action.js deleted file mode 100644 index 1e527662..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/lib/delete-action.js +++ /dev/null
@@ -1,65 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { html } from 'lit'; -import { classMap } from 'lit/directives/class-map.js'; -import { ifDefined } from 'lit/directives/if-defined.js'; -import { Action } from './action.js'; -import { Md3ChipActionEventType } from './events.js'; -/** @soyCompatible */ -export class DeleteAction extends Action { - /** @soyTemplate */ - render() { - return html ` - <button class="${classMap(this.getRootClasses())}" - aria-label="${ifDefined(this.ariaLabel)}" - tabindex="${this.isFocusable ? 0 : -1}" - type="button" - @focus="${this.handleFocus}" - @blur="${this.handleBlur}" - @pointerenter="${this.handlePointerEnter}" - @pointerleave="${this.handlePointerLeave}" - @pointerdown="${this.handlePointerDown}" - @pointerup="${this.handlePointerUp}" - @pointercancel="${this.handlePointerCancel}" - @click="${this.handleClick}" - @contextmenu="${this.handleContextMenu}" - @keydown="${this.handleKeyDown}"> - ${this.renderTouchTarget()} - ${this.renderRipple()} - ${this.renderFocusRing()} - ${this.renderDeleteIcon()} - </button>`; - } - /** @soyTemplate */ - getRootClasses() { - return { - ...super.getRootClasses(), - 'md3-chip__action--delete': true, - }; - } - /** @soyTemplate */ - getRippleClasses() { - return { - ...super.getRippleClasses(), - 'md3-chip__ripple--delete': true, - }; - } - /** @soyTemplate */ - renderDeleteIcon() { - return html ` - <span class="md3-chip__icon md3-chip__icon--delete" aria-hidden="true"> - <svg xmlns="http://www.w3.org/2000/svg" - height="24" width="24" fill="#041E49"> - <path d="M6.4 19 5 17.6l5.6-5.6L5 6.4 6.4 5l5.6 5.6L17.6 5 19 6.4 - 13.4 12l5.6 5.6-1.4 1.4-5.6-5.6Z"/> - </svg> - </span>`; - } - getInteractionEvent() { - return Md3ChipActionEventType.DELETE; - } -} -//# sourceMappingURL=delete-action.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/lib/events.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/lib/events.d.ts deleted file mode 100644 index b131537d..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/lib/events.d.ts +++ /dev/null
@@ -1,14 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -/** Events emitted by the action. */ -export declare enum Md3ChipActionEventType { - DELETE = "chip-action-delete", - SELECT = "chip-action-select", - NAVIGATE_TO_PREV = "chip-action-navigate-to-prev", - NAVIGATE_TO_NEXT = "chip-action-navigate-to-next", - NAVIGATE_TO_FIRST = "chip-action-navigate-to-first", - NAVIGATE_TO_LAST = "chip-action-navigate-to-last" -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/lib/events.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/lib/events.js deleted file mode 100644 index 3069a0d4..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/lib/events.js +++ /dev/null
@@ -1,16 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -/** Events emitted by the action. */ -export var Md3ChipActionEventType; -(function (Md3ChipActionEventType) { - Md3ChipActionEventType["DELETE"] = "chip-action-delete"; - Md3ChipActionEventType["SELECT"] = "chip-action-select"; - Md3ChipActionEventType["NAVIGATE_TO_PREV"] = "chip-action-navigate-to-prev"; - Md3ChipActionEventType["NAVIGATE_TO_NEXT"] = "chip-action-navigate-to-next"; - Md3ChipActionEventType["NAVIGATE_TO_FIRST"] = "chip-action-navigate-to-first"; - Md3ChipActionEventType["NAVIGATE_TO_LAST"] = "chip-action-navigate-to-last"; -})(Md3ChipActionEventType || (Md3ChipActionEventType = {})); -//# sourceMappingURL=events.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/lib/link-action.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/lib/link-action.d.ts deleted file mode 100644 index 48f094c..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/lib/link-action.d.ts +++ /dev/null
@@ -1,19 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { TemplateResult } from 'lit'; -import { EndPressConfig } from '../../../actionelement/action-element.js'; -import { PrimaryAction } from './primary-action.js'; -/** @soyCompatible */ -export declare class LinkAction extends PrimaryAction { - href: string; - target: string; - /** - * @soyTemplate - * @soyAttributes linkAttributes: .md3-chip__action - */ - protected render(): TemplateResult; - endPress(options: EndPressConfig): void; -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/lib/link-action.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/lib/link-action.js deleted file mode 100644 index ba85ba6..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/lib/link-action.js +++ /dev/null
@@ -1,55 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { __decorate, __metadata } from "tslib"; -import { html } from 'lit'; -import { property } from 'lit/decorators.js'; -import { classMap } from 'lit/directives/class-map.js'; -import { ifDefined } from 'lit/directives/if-defined.js'; -import { PrimaryAction } from './primary-action.js'; -/** @soyCompatible */ -export class LinkAction extends PrimaryAction { - /** - * @soyTemplate - * @soyAttributes linkAttributes: .md3-chip__action - */ - render() { - return html ` - <span class="action-link"> - <a class="${classMap(this.getRootClasses())}" - aria-label="${ifDefined(this.ariaLabel)}" - href="${ifDefined(this.href)}" - target="${ifDefined(this.target)}" - tabindex="${this.isFocusable ? 0 : -1}" - @focus="${this.handleFocus}" - @blur="${this.handleBlur}" - @pointerenter="${this.handlePointerEnter}" - @pointerleave="${this.handlePointerLeave}" - @pointerdown="${this.handlePointerDown}" - @pointerup="${this.handlePointerUp}" - @pointercancel="${this.handlePointerCancel}" - @contextmenu="${this.handleContextMenu}"> - ${this.renderTouchTarget()} - ${this.renderRipple()} - ${this.renderFocusRing()} - ${this.renderGraphic()} - ${this.renderLabel()} - </a> - </span>`; - } - endPress(options) { - super.endPress(options); - this.ripple?.endPress(); - } -} -__decorate([ - property({ type: String }), - __metadata("design:type", String) -], LinkAction.prototype, "href", void 0); -__decorate([ - property({ type: String }), - __metadata("design:type", String) -], LinkAction.prototype, "target", void 0); -//# sourceMappingURL=link-action.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/lib/presentational-action.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/lib/presentational-action.d.ts deleted file mode 100644 index 65da6e1f..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/lib/presentational-action.d.ts +++ /dev/null
@@ -1,15 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { TemplateResult } from 'lit'; -import { ClassInfo } from 'lit/directives/class-map.js'; -import { PrimaryAction } from './primary-action.js'; -/** @soyCompatible */ -export declare class PresentationalAction extends PrimaryAction { - /** @soyTemplate */ - protected render(): TemplateResult; - /** @soyTemplate */ - protected getRootClasses(): ClassInfo; -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/lib/presentational-action.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/lib/presentational-action.js deleted file mode 100644 index 0d6e084..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/lib/presentational-action.js +++ /dev/null
@@ -1,30 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { html } from 'lit'; -import { classMap } from 'lit/directives/class-map.js'; -import { ifDefined } from 'lit/directives/if-defined.js'; -import { PrimaryAction } from './primary-action.js'; -/** @soyCompatible */ -export class PresentationalAction extends PrimaryAction { - /** @soyTemplate */ - render() { - return html ` - <span class="${classMap(this.getRootClasses())}" - aria-label="${ifDefined(this.ariaLabel)}" - role="presentation"> - ${this.renderGraphic()} - ${this.renderLabel()} - </span>`; - } - /** @soyTemplate */ - getRootClasses() { - return { - ...super.getRootClasses(), - 'md3-chip__action--presentational': true, - }; - } -} -//# sourceMappingURL=presentational-action.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/lib/primary-action.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/lib/primary-action.d.ts deleted file mode 100644 index a1af08ae..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/lib/primary-action.d.ts +++ /dev/null
@@ -1,28 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { TemplateResult } from 'lit'; -import { ClassInfo } from 'lit/directives/class-map.js'; -import { Action } from './action.js'; -/** - * Base class for all primary actions: Presentational, Selectable, Link - * @soyCompatible - */ -export declare class PrimaryAction extends Action { - label: string; - icon: string; - /** @soyTemplate */ - protected render(): TemplateResult; - /** @soyTemplate */ - protected getRootClasses(): ClassInfo; - /** @soyTemplate */ - protected getRippleClasses(): ClassInfo; - /** @soyTemplate */ - protected renderGraphic(): TemplateResult; - /** @soyTemplate */ - protected renderIcon(): TemplateResult; - /** @soyTemplate */ - protected renderLabel(): TemplateResult; -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/lib/primary-action.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/lib/primary-action.js deleted file mode 100644 index 5ee8f398..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/lib/primary-action.js +++ /dev/null
@@ -1,88 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { __decorate, __metadata } from "tslib"; -import { html } from 'lit'; -import { property } from 'lit/decorators.js'; -import { classMap } from 'lit/directives/class-map.js'; -import { ifDefined } from 'lit/directives/if-defined.js'; -import { Action } from './action.js'; -/** - * Base class for all primary actions: Presentational, Selectable, Link - * @soyCompatible - */ -export class PrimaryAction extends Action { - constructor() { - super(...arguments); - this.label = ''; - this.icon = ''; - } - /** @soyTemplate */ - render() { - return html ` - <span class="${classMap(this.getRootClasses())}" - aria-label="${ifDefined(this.ariaLabel)}" - tabindex="${this.isFocusable ? 0 : -1}" - type="button" - ?disabled="${this.disabled}" - @focus="${this.handleFocus}" - @blur="${this.handleBlur}" - @pointerenter="${this.handlePointerEnter}" - @pointerleave="${this.handlePointerLeave}" - @pointerdown="${this.handlePointerDown}" - @pointerup="${this.handlePointerUp}" - @pointercancel="${this.handlePointerCancel}" - @click="${this.handleClick}" - @contextmenu="${this.handleContextMenu}" - @keydown="${this.handleKeyDown}"> - ${this.renderTouchTarget()} - ${this.renderRipple()} - ${this.renderFocusRing()} - ${this.renderGraphic()} - ${this.renderLabel()} - </span>`; - } - /** @soyTemplate */ - getRootClasses() { - return { - ...super.getRootClasses(), - 'md3-chip__action--primary': true, - }; - } - /** @soyTemplate */ - getRippleClasses() { - return { - ...super.getRippleClasses(), - 'md3-chip__ripple--primary': true, - }; - } - /** @soyTemplate */ - renderGraphic() { - return this.icon ? html ` - <span class="md3-chip__graphic"> - ${this.renderIcon()} - </span>` : html ``; - } - /** @soyTemplate */ - renderIcon() { - return html ` - <span class="md3-chip__icon md3-chip__icon--primary material-icons"> - ${this.icon} - </span>`; - } - /** @soyTemplate */ - renderLabel() { - return html `<span class="md3-chip__text-label">${this.label}</span>`; - } -} -__decorate([ - property({ type: String }), - __metadata("design:type", Object) -], PrimaryAction.prototype, "label", void 0); -__decorate([ - property({ type: String }), - __metadata("design:type", Object) -], PrimaryAction.prototype, "icon", void 0); -//# sourceMappingURL=primary-action.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/lib/selectable-action.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/lib/selectable-action.d.ts deleted file mode 100644 index 305a453f..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/lib/selectable-action.d.ts +++ /dev/null
@@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { TemplateResult } from 'lit'; -import { PrimaryAction } from './primary-action.js'; -/** @soyCompatible */ -export declare class SelectableAction extends PrimaryAction { - selected: boolean; - /** @soyTemplate */ - protected render(): TemplateResult; - /** @soyTemplate */ - protected renderGraphic(): TemplateResult; - /** @soyTemplate */ - private renderCheckMark; -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/lib/selectable-action.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/lib/selectable-action.js deleted file mode 100644 index e45787d..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/lib/selectable-action.js +++ /dev/null
@@ -1,67 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { __decorate, __metadata } from "tslib"; -import { html } from 'lit'; -import { property } from 'lit/decorators.js'; -import { classMap } from 'lit/directives/class-map.js'; -import { ifDefined } from 'lit/directives/if-defined.js'; -import { PrimaryAction } from './primary-action.js'; -/** @soyCompatible */ -export class SelectableAction extends PrimaryAction { - constructor() { - super(...arguments); - this.selected = false; - } - /** @soyTemplate */ - render() { - return html ` - <span class="${classMap(this.getRootClasses())}" - aria-label="${ifDefined(this.ariaLabel)}" - aria-selected="${this.selected}" - aria-disabled="${this.disabled}" - tabindex="${this.isFocusable ? 0 : -1}" - role="option" - @focus="${this.handleFocus}" - @blur="${this.handleBlur}" - @pointerenter="${this.handlePointerEnter}" - @pointerleave="${this.handlePointerLeave}" - @pointerdown="${this.handlePointerDown}" - @pointerup="${this.handlePointerUp}" - @pointercancel="${this.handlePointerCancel}" - @click="${this.handleClick}" - @contextmenu="${this.handleContextMenu}" - @keydown="${this.handleKeyDown}"> - ${this.renderTouchTarget()} - ${this.renderRipple()} - ${this.renderFocusRing()} - ${this.renderGraphic()} - ${this.renderLabel()} - </span>`; - } - /** @soyTemplate */ - renderGraphic() { - return html ` - <span class="md3-chip__graphic"> - ${this.icon ? this.renderIcon() : ''} - ${this.renderCheckMark()} - </span>`; - } - /** @soyTemplate */ - renderCheckMark() { - return html ` - <span class="md3-chip__checkmark"> - <svg class="md3-chip__checkmark-svg" viewBox="-2 -3 30 30"> - <path class="md3-chip__checkmark-path" fill="none" stroke="black" - d="M1.73,12.91 8.1,19.28 22.79,4.59" /> - </svg> - </span>`; - } -} -__decorate([ - property({ type: Boolean, reflect: true }), - __metadata("design:type", Object) -], SelectableAction.prototype, "selected", void 0); -//# sourceMappingURL=selectable-action.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/lib/types.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/lib/types.d.ts deleted file mode 100644 index 91d8780..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/lib/types.d.ts +++ /dev/null
@@ -1,23 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { MDCChipActionInteractionTrigger, MDCChipActionType } from './constants.js'; -/** - * MDCChipActionInteractionEventDetail provides the details for the interaction - * event. - */ -export interface MDCChipActionInteractionEventDetail { - actionID: string; - source: MDCChipActionType; - trigger: MDCChipActionInteractionTrigger; -} -/** - * MDCChipActionNavigationEventDetail provides the details for the navigation - * event. - */ -export interface MDCChipActionNavigationEventDetail { - source: MDCChipActionType; - key: string; -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/lib/types.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/lib/types.js deleted file mode 100644 index ba75424e..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/lib/types.js +++ /dev/null
@@ -1,7 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -export {}; -//# sourceMappingURL=types.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/link-action.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/link-action.d.ts deleted file mode 100644 index fe65e2c..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/link-action.d.ts +++ /dev/null
@@ -1,18 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { LinkAction } from './lib/link-action.js'; -declare global { - interface HTMLElementTagNameMap { - 'md-link-action': MdLinkAction; - } -} -/** - * @soyCompatible - * @final - * @suppress {visibility} - */ -export declare class MdLinkAction extends LinkAction { -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/link-action.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/link-action.js deleted file mode 100644 index c277c2c..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/link-action.js +++ /dev/null
@@ -1,20 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { __decorate } from "tslib"; -import { customElement } from 'lit/decorators.js'; -import { LinkAction } from './lib/link-action.js'; -/** - * @soyCompatible - * @final - * @suppress {visibility} - */ -let MdLinkAction = class MdLinkAction extends LinkAction { -}; -MdLinkAction = __decorate([ - customElement('md-link-action') -], MdLinkAction); -export { MdLinkAction }; -//# sourceMappingURL=link-action.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/presentational-action.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/presentational-action.d.ts deleted file mode 100644 index ee20c4c1..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/presentational-action.d.ts +++ /dev/null
@@ -1,18 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { PresentationalAction } from './lib/presentational-action.js'; -declare global { - interface HTMLElementTagNameMap { - 'md-presentational-action': MdPresentationalAction; - } -} -/** - * @soyCompatible - * @final - * @suppress {visibility} - */ -export declare class MdPresentationalAction extends PresentationalAction { -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/presentational-action.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/presentational-action.js deleted file mode 100644 index cfd0558f..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/presentational-action.js +++ /dev/null
@@ -1,20 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { __decorate } from "tslib"; -import { customElement } from 'lit/decorators.js'; -import { PresentationalAction } from './lib/presentational-action.js'; -/** - * @soyCompatible - * @final - * @suppress {visibility} - */ -let MdPresentationalAction = class MdPresentationalAction extends PresentationalAction { -}; -MdPresentationalAction = __decorate([ - customElement('md-presentational-action') -], MdPresentationalAction); -export { MdPresentationalAction }; -//# sourceMappingURL=presentational-action.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/primary-action.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/primary-action.d.ts deleted file mode 100644 index 1c0156aa..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/primary-action.d.ts +++ /dev/null
@@ -1,18 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { PrimaryAction } from './lib/primary-action.js'; -declare global { - interface HTMLElementTagNameMap { - 'md-primary-action': MdPrimaryAction; - } -} -/** - * @soyCompatible - * @final - * @suppress {visibility} - */ -export declare class MdPrimaryAction extends PrimaryAction { -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/primary-action.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/primary-action.js deleted file mode 100644 index cf4925d..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/primary-action.js +++ /dev/null
@@ -1,20 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { __decorate } from "tslib"; -import { customElement } from 'lit/decorators.js'; -import { PrimaryAction } from './lib/primary-action.js'; -/** - * @soyCompatible - * @final - * @suppress {visibility} - */ -let MdPrimaryAction = class MdPrimaryAction extends PrimaryAction { -}; -MdPrimaryAction = __decorate([ - customElement('md-primary-action') -], MdPrimaryAction); -export { MdPrimaryAction }; -//# sourceMappingURL=primary-action.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/selectable-action.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/selectable-action.d.ts deleted file mode 100644 index d9318b4..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/selectable-action.d.ts +++ /dev/null
@@ -1,18 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { SelectableAction } from './lib/selectable-action.js'; -declare global { - interface HTMLElementTagNameMap { - 'md-selectable-action': MdSelectableAction; - } -} -/** - * @soyCompatible - * @final - * @suppress {visibility} - */ -export declare class MdSelectableAction extends SelectableAction { -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/selectable-action.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/selectable-action.js deleted file mode 100644 index 26c0a99..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/action/selectable-action.js +++ /dev/null
@@ -1,20 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { __decorate } from "tslib"; -import { customElement } from 'lit/decorators.js'; -import { SelectableAction } from './lib/selectable-action.js'; -/** - * @soyCompatible - * @final - * @suppress {visibility} - */ -let MdSelectableAction = class MdSelectableAction extends SelectableAction { -}; -MdSelectableAction = __decorate([ - customElement('md-selectable-action') -], MdSelectableAction); -export { MdSelectableAction }; -//# sourceMappingURL=selectable-action.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/assist-chip.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/assist-chip.d.ts new file mode 100644 index 0000000..3e2803b0 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/assist-chip.d.ts
@@ -0,0 +1,20 @@ +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import { AssistChip } from './lib/assist-chip.js'; +declare global { + interface HTMLElementTagNameMap { + 'md-assist-chip': MdAssistChip; + } +} +/** + * TODO(b/243982145): add docs + * + * @final + * @suppress {visibility} + */ +export declare class MdAssistChip extends AssistChip { + static styles: import("lit").CSSResult[]; +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/assist-chip.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/assist-chip.js new file mode 100644 index 0000000..dfcd6fd --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/assist-chip.js
@@ -0,0 +1,25 @@ +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import { __decorate } from "tslib"; +import { customElement } from 'lit/decorators.js'; +import { AssistChip } from './lib/assist-chip.js'; +import { styles } from './lib/assist-styles.css.js'; +import { styles as elevatedStyles } from './lib/elevated-styles.css.js'; +import { styles as sharedStyles } from './lib/shared-styles.css.js'; +/** + * TODO(b/243982145): add docs + * + * @final + * @suppress {visibility} + */ +let MdAssistChip = class MdAssistChip extends AssistChip { +}; +MdAssistChip.styles = [sharedStyles, elevatedStyles, styles]; +MdAssistChip = __decorate([ + customElement('md-assist-chip') +], MdAssistChip); +export { MdAssistChip }; +//# sourceMappingURL=assist-chip.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chip/lib/action-chip.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chip/lib/action-chip.d.ts deleted file mode 100644 index 6fc68059..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chip/lib/action-chip.d.ts +++ /dev/null
@@ -1,18 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import '../../action/primary-action.js'; -import { TemplateResult } from 'lit'; -import { Chip } from './chip.js'; -/** @soyCompatible */ -export declare class ActionChip extends Chip { - /** - * @soyTemplate - * @soyAttributes attributes: .md3-chip - */ - protected render(): TemplateResult; - /** @soyTemplate */ - private renderPrimaryAction; -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chip/lib/action-chip.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chip/lib/action-chip.js deleted file mode 100644 index 47570f9..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chip/lib/action-chip.js +++ /dev/null
@@ -1,39 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import '../../action/primary-action.js'; -import { html } from 'lit'; -import { classMap } from 'lit/directives/class-map.js'; -import { Chip } from './chip.js'; -/** @soyCompatible */ -export class ActionChip extends Chip { - /** - * @soyTemplate - * @soyAttributes attributes: .md3-chip - */ - render() { - return html ` - <span class="${classMap(this.getRootClasses())}" role="row"> - ${this.renderOverlay()} - <span class="md3-chip__cell md3-chip__cell--primary" role="gridcell"> - ${this.renderPrimaryAction()} - </span> - ${this.renderDeleteAction()} - </span>`; - } - /** @soyTemplate */ - renderPrimaryAction() { - return html ` - <md-primary-action - ?disabled=${this.disabled} - ?isFocusable=${this.isFocusable} - ?isTouchable=${this.isTouchable} - .icon=${this.icon} - .label=${this.label} - .ariaLabel=${this.ariaLabel}> - </md-primary-action>`; - } -} -//# sourceMappingURL=action-chip.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chip/lib/adapter.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chip/lib/adapter.d.ts deleted file mode 100644 index cc21d952..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chip/lib/adapter.d.ts +++ /dev/null
@@ -1,50 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { MDCChipActionFocusBehavior, MDCChipActionType } from '../../action/lib/constants.js'; -import { MDCChipAttributes, MDCChipCssClasses, MDCChipEvents } from './constants.js'; -/** - * Defines the shape of the adapter expected by the foundation. - * Implement this adapter for your framework of choice to delegate updates to - * the component in your framework of choice. See architecture documentation - * for more details. - * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md - */ -export interface MDCChipAdapter { - /** Adds the given class to the root element. */ - addClass(className: MDCChipCssClasses): void; - /** Emits the given event with the given detail. */ - emitEvent<D extends object>(eventName: MDCChipEvents, eventDetail: D): void; - /** Returns the child actions provided by the chip. */ - getActions(): MDCChipActionType[]; - /** Returns the value for the given attribute, if it exists. */ - getAttribute(attrName: MDCChipAttributes): string | null; - /** Returns the ID of the root element. */ - getElementID(): string; - /** Returns the offset width of the root element. */ - getOffsetWidth(): number; - /** Returns true if the root element has the given class. */ - hasClass(className: MDCChipCssClasses): boolean; - /** Proxies to the MDCChipAction#isSelectable method. */ - isActionSelectable(action: MDCChipActionType): boolean; - /** Proxies to the MDCChipAction#isSelected method. */ - isActionSelected(action: MDCChipActionType): boolean; - /** Proxies to the MDCChipAction#isFocusable method. */ - isActionFocusable(action: MDCChipActionType): boolean; - /** Proxies to the MDCChipAction#isDisabled method. */ - isActionDisabled(action: MDCChipActionType): boolean; - /** Returns true if the text direction is right-to-left. */ - isRTL(): boolean; - /** Removes the given class from the root element. */ - removeClass(className: MDCChipCssClasses): void; - /** Proxies to the MDCChipAction#setDisabled method. */ - setActionDisabled(action: MDCChipActionType, isDisabled: boolean): void; - /** Proxies to the MDCChipAction#setFocus method. */ - setActionFocus(action: MDCChipActionType, behavior: MDCChipActionFocusBehavior): void; - /** Proxies to the MDCChipAction#setSelected method. */ - setActionSelected(action: MDCChipActionType, isSelected: boolean): void; - /** Sets the style property to the given value. */ - setStyleProperty(property: string, value: string): void; -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chip/lib/adapter.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chip/lib/adapter.js deleted file mode 100644 index d2fffb0..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chip/lib/adapter.js +++ /dev/null
@@ -1,7 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -export {}; -//# sourceMappingURL=adapter.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chip/lib/animationframe.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chip/lib/animationframe.d.ts deleted file mode 100644 index ea1cf33..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chip/lib/animationframe.d.ts +++ /dev/null
@@ -1,31 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -/** - * AnimationFrame provides a user-friendly abstraction around requesting - * and canceling animation frames. - */ -export declare class AnimationFrame { - private readonly rafIDs; - /** - * Requests an animation frame. Cancels any existing frame with the same key. - * @param {string} key The key for this callback. - * @param {FrameRequestCallback} callback The callback to be executed. - */ - request(key: string, callback: FrameRequestCallback): void; - /** - * Cancels a queued callback with the given key. - * @param {string} key The key for this callback. - */ - cancel(key: string): void; - /** - * Cancels all queued callback. - */ - cancelAll(): void; - /** - * Returns the queue of unexecuted callback keys. - */ - getQueue(): string[]; -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chip/lib/animationframe.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chip/lib/animationframe.js deleted file mode 100644 index e8ddb67..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chip/lib/animationframe.js +++ /dev/null
@@ -1,66 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -// TODO: Remove in favor of AnimationSignal -/** - * AnimationFrame provides a user-friendly abstraction around requesting - * and canceling animation frames. - */ -export class AnimationFrame { - constructor() { - this.rafIDs = new Map(); - } - /** - * Requests an animation frame. Cancels any existing frame with the same key. - * @param {string} key The key for this callback. - * @param {FrameRequestCallback} callback The callback to be executed. - */ - request(key, callback) { - this.cancel(key); - const frameID = requestAnimationFrame((frame) => { - this.rafIDs.delete(key); - // Callback must come *after* the key is deleted so that nested calls to - // request with the same key are not deleted. - callback(frame); - }); - this.rafIDs.set(key, frameID); - } - /** - * Cancels a queued callback with the given key. - * @param {string} key The key for this callback. - */ - cancel(key) { - const rafID = this.rafIDs.get(key); - if (rafID) { - cancelAnimationFrame(rafID); - this.rafIDs.delete(key); - } - } - /** - * Cancels all queued callback. - */ - cancelAll() { - // Need to use forEach because it's the only iteration method supported - // by IE11. Suppress the underscore because we don't need it. - // tslint:disable-next-line:enforce-name-casing - this.rafIDs.forEach((_, key) => { - this.cancel(key); - }); - } - /** - * Returns the queue of unexecuted callback keys. - */ - getQueue() { - const queue = []; - // Need to use forEach because it's the only iteration method supported - // by IE11. Suppress the underscore because we don't need it. - // tslint:disable-next-line:enforce-name-casing - this.rafIDs.forEach((_, key) => { - queue.push(key); - }); - return queue; - } -} -//# sourceMappingURL=animationframe.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chip/lib/chip.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chip/lib/chip.d.ts deleted file mode 100644 index 42a56e3f..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chip/lib/chip.d.ts +++ /dev/null
@@ -1,43 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import '../../../elevation/elevation.js'; -import '../../action/delete-action.js'; -import { TemplateResult } from 'lit'; -import { ClassInfo } from 'lit/directives/class-map.js'; -import { ActionElement } from '../../../actionelement/action-element.js'; -/** Defines the border type of a chip. */ -export declare enum BorderType { - ELEVATED = "ELEVATED", - HAIRLINE = "HAIRLINE" -} -/** Defines the shape of the vertical edge of a chip. */ -export declare enum EdgeType { - ROUNDED = "ROUNDED", - STRAIGHT = "STRAIGHT" -} -/** @soyCompatible */ -export declare abstract class Chip extends ActionElement { - isFocusable: boolean; - isTouchable: boolean; - disabled: boolean; - hasAvatar: boolean; - hasDeleteAction: boolean; - icon: string; - label: string; - borderType: BorderType; - edgeType: EdgeType; - addedAnnouncement: string; - removedAnnouncement: string; - closeActionAriaLabel: string; - /** @soyPrefixAttribute */ - ariaLabel: string; - /** @soyTemplate */ - protected getRootClasses(): ClassInfo; - /** @soyTemplate */ - protected renderOverlay(): TemplateResult; - /** @soyTemplate */ - protected renderDeleteAction(): TemplateResult; -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chip/lib/chip.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chip/lib/chip.js deleted file mode 100644 index 495949a..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chip/lib/chip.js +++ /dev/null
@@ -1,134 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { __decorate, __metadata } from "tslib"; -import '../../../elevation/elevation.js'; -import '../../action/delete-action.js'; -import { html } from 'lit'; -import { property } from 'lit/decorators.js'; -import { ActionElement } from '../../../actionelement/action-element.js'; -import { ariaProperty } from '../../../decorators/aria-property.js'; -/** Defines the border type of a chip. */ -export var BorderType; -(function (BorderType) { - BorderType["ELEVATED"] = "ELEVATED"; - BorderType["HAIRLINE"] = "HAIRLINE"; -})(BorderType || (BorderType = {})); -/** Defines the shape of the vertical edge of a chip. */ -export var EdgeType; -(function (EdgeType) { - EdgeType["ROUNDED"] = "ROUNDED"; - EdgeType["STRAIGHT"] = "STRAIGHT"; -})(EdgeType || (EdgeType = {})); -/** @soyCompatible */ -export class Chip extends ActionElement { - constructor() { - super(...arguments); - this.isFocusable = false; - this.isTouchable = false; - this.disabled = false; - this.hasAvatar = false; - this.hasDeleteAction = false; - this.icon = ''; - this.label = ''; - this.borderType = BorderType.HAIRLINE; - this.edgeType = EdgeType.ROUNDED; - this.addedAnnouncement = ''; - this.removedAnnouncement = ''; - this.closeActionAriaLabel = ''; - } - /** @soyTemplate */ - getRootClasses() { - const hasIcon = this.icon.trim().length > 0; - return { - 'md3-chip': true, - 'md3-chip--disabled': this.disabled, - 'md3-chip--touch': this.isTouchable, - 'md3-chip--with-primary-graphic': hasIcon, - 'md3-chip--with-primary-icon': hasIcon, - 'md3-chip--with-avatar': this.hasAvatar, - 'md3-chip--with-delete-action': this.hasDeleteAction, - }; - } - /** @soyTemplate */ - renderOverlay() { - return this.borderType === BorderType.ELEVATED ? - html `<md-elevation aria-hidden="true" shadow surface></md-elevation>` : - html ``; - } - /** @soyTemplate */ - renderDeleteAction() { - if (!this.hasDeleteAction) { - return html ``; - } - else { - return html ` - <span class="md3-chip__cell md3-chip__cell--delete" - role="gridcell"> - <md-delete-action - ?disabled=${this.disabled} - ?isFocusable=${this.isFocusable} - ?isTouchable=${this.isTouchable} - .ariaLabel=${this.closeActionAriaLabel}> - </md-delete-action> - </span>`; - } - } -} -__decorate([ - property({ type: Boolean, reflect: true }), - __metadata("design:type", Object) -], Chip.prototype, "isFocusable", void 0); -__decorate([ - property({ type: Boolean, reflect: true }), - __metadata("design:type", Object) -], Chip.prototype, "isTouchable", void 0); -__decorate([ - property({ type: Boolean, reflect: true }), - __metadata("design:type", Object) -], Chip.prototype, "disabled", void 0); -__decorate([ - property({ type: Boolean, reflect: true }), - __metadata("design:type", Object) -], Chip.prototype, "hasAvatar", void 0); -__decorate([ - property({ type: Boolean, reflect: true }), - __metadata("design:type", Object) -], Chip.prototype, "hasDeleteAction", void 0); -__decorate([ - property({ type: String }), - __metadata("design:type", Object) -], Chip.prototype, "icon", void 0); -__decorate([ - property({ type: String }), - __metadata("design:type", Object) -], Chip.prototype, "label", void 0); -__decorate([ - property({ type: String }), - __metadata("design:type", Object) -], Chip.prototype, "borderType", void 0); -__decorate([ - property({ type: String }), - __metadata("design:type", Object) -], Chip.prototype, "edgeType", void 0); -__decorate([ - property({ type: String }), - __metadata("design:type", Object) -], Chip.prototype, "addedAnnouncement", void 0); -__decorate([ - property({ type: String }), - __metadata("design:type", Object) -], Chip.prototype, "removedAnnouncement", void 0); -__decorate([ - property({ type: String }), - __metadata("design:type", Object) -], Chip.prototype, "closeActionAriaLabel", void 0); -__decorate([ - ariaProperty // tslint:disable-line:no-new-decorators - , - property({ type: String, attribute: 'aria-label' }), - __metadata("design:type", String) -], Chip.prototype, "ariaLabel", void 0); -//# sourceMappingURL=chip.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chip/lib/constants.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chip/lib/constants.d.ts deleted file mode 100644 index 90d0556c..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chip/lib/constants.d.ts +++ /dev/null
@@ -1,43 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -/** - * MDCChipCssClasses provides the named constants for class names. - */ -export declare enum MDCChipCssClasses { - SELECTING = "md3-chip--selecting", - DESELECTING = "md3-chip--deselecting", - SELECTING_WITH_PRIMARY_ICON = "md3-chip--selecting-with-primary-icon", - DESELECTING_WITH_PRIMARY_ICON = "md3-chip--deselecting-with-primary-icon", - DISABLED = "md3-chip--disabled", - ENTER = "md3n-chip--enter", - EXIT = "md3-chip--exit", - SELECTED = "md3-chip--selected", - HIDDEN = "md3-chip--hidden", - WITH_PRIMARY_ICON = "md3-chip--with-primary-icon" -} -/** - * MDCChipEvents provides the named constants for emitted events. - */ -export declare enum MDCChipEvents { - INTERACTION = "MDCChip:interaction", - NAVIGATION = "MDCChip:navigation", - ANIMATION = "MDCChip:animation" -} -/** - * MDCChipAttributes provides the named constants for strings used by the - * foundation. - */ -export declare enum MDCChipAttributes { - DATA_REMOVED_ANNOUNCEMENT = "data-md3-removed-announcement", - DATA_ADDED_ANNOUNCEMENT = "data-md3-added-announcement" -} -/** - * MDCChipAnimation provides the names of runnable animations. - */ -export declare enum MDCChipAnimation { - ENTER = "md3-chip-enter", - EXIT = "md3-chip-exit" -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chip/lib/constants.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chip/lib/constants.js deleted file mode 100644 index 987abd69..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chip/lib/constants.js +++ /dev/null
@@ -1,48 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -/** - * MDCChipCssClasses provides the named constants for class names. - */ -export var MDCChipCssClasses; -(function (MDCChipCssClasses) { - MDCChipCssClasses["SELECTING"] = "md3-chip--selecting"; - MDCChipCssClasses["DESELECTING"] = "md3-chip--deselecting"; - MDCChipCssClasses["SELECTING_WITH_PRIMARY_ICON"] = "md3-chip--selecting-with-primary-icon"; - MDCChipCssClasses["DESELECTING_WITH_PRIMARY_ICON"] = "md3-chip--deselecting-with-primary-icon"; - MDCChipCssClasses["DISABLED"] = "md3-chip--disabled"; - MDCChipCssClasses["ENTER"] = "md3n-chip--enter"; - MDCChipCssClasses["EXIT"] = "md3-chip--exit"; - MDCChipCssClasses["SELECTED"] = "md3-chip--selected"; - MDCChipCssClasses["HIDDEN"] = "md3-chip--hidden"; - MDCChipCssClasses["WITH_PRIMARY_ICON"] = "md3-chip--with-primary-icon"; -})(MDCChipCssClasses || (MDCChipCssClasses = {})); -/** - * MDCChipEvents provides the named constants for emitted events. - */ -export var MDCChipEvents; -(function (MDCChipEvents) { - MDCChipEvents["INTERACTION"] = "MDCChip:interaction"; - MDCChipEvents["NAVIGATION"] = "MDCChip:navigation"; - MDCChipEvents["ANIMATION"] = "MDCChip:animation"; -})(MDCChipEvents || (MDCChipEvents = {})); -/** - * MDCChipAttributes provides the named constants for strings used by the - * foundation. - */ -export var MDCChipAttributes; -(function (MDCChipAttributes) { - MDCChipAttributes["DATA_REMOVED_ANNOUNCEMENT"] = "data-md3-removed-announcement"; - MDCChipAttributes["DATA_ADDED_ANNOUNCEMENT"] = "data-md3-added-announcement"; -})(MDCChipAttributes || (MDCChipAttributes = {})); -/** - * MDCChipAnimation provides the names of runnable animations. - */ -export var MDCChipAnimation; -(function (MDCChipAnimation) { - MDCChipAnimation["ENTER"] = "md3-chip-enter"; - MDCChipAnimation["EXIT"] = "md3-chip-exit"; -})(MDCChipAnimation || (MDCChipAnimation = {})); -//# sourceMappingURL=constants.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chip/lib/foundation.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chip/lib/foundation.d.ts deleted file mode 100644 index 6590792..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chip/lib/foundation.d.ts +++ /dev/null
@@ -1,41 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { MDCChipActionFocusBehavior, MDCChipActionType } from '../../action/lib/constants.js'; -import { MDCChipAdapter } from './adapter.js'; -import { MDCChipAnimation } from './constants.js'; -import { ActionInteractionEvent, ActionNavigationEvent } from './types.js'; -/** - * MDCChipFoundation provides a foundation for all chips. - */ -export declare class MDCChipFoundation { - private readonly adapter; - static get defaultAdapter(): MDCChipAdapter; - private readonly animFrame; - constructor(adapter?: Partial<MDCChipAdapter>); - destroy(): void; - getElementID(): string; - setDisabled(isDisabled: boolean): void; - isDisabled(): boolean; - getActions(): MDCChipActionType[]; - isActionFocusable(action: MDCChipActionType): boolean; - isActionSelectable(action: MDCChipActionType): boolean; - isActionSelected(action: MDCChipActionType): boolean; - setActionFocus(action: MDCChipActionType, focus: MDCChipActionFocusBehavior): void; - setActionSelected(action: MDCChipActionType, isSelected: boolean): void; - startAnimation(animation: MDCChipAnimation): void; - handleAnimationEnd(event: AnimationEvent): void; - handleTransitionEnd(): void; - handleActionInteraction({ detail }: ActionInteractionEvent): void; - handleActionNavigation({ detail }: ActionNavigationEvent): void; - private directionFromKey; - private navigateActions; - private shouldRemove; - private getRemovedAnnouncement; - private getAddedAnnouncement; - private animateSelection; - private resetAnimationStyles; - private updateSelectionStyles; -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chip/lib/foundation.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chip/lib/foundation.js deleted file mode 100644 index 86fe963..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chip/lib/foundation.js +++ /dev/null
@@ -1,255 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { MDCChipActionFocusBehavior, MDCChipActionInteractionTrigger, MDCChipActionType } from '../../action/lib/constants.js'; -import { AnimationFrame } from './animationframe.js'; -import { MDCChipAnimation, MDCChipAttributes, MDCChipCssClasses, MDCChipEvents } from './constants.js'; -var Direction; -(function (Direction) { - Direction[Direction["UNSPECIFIED"] = 0] = "UNSPECIFIED"; - Direction[Direction["LEFT"] = 1] = "LEFT"; - Direction[Direction["RIGHT"] = 2] = "RIGHT"; -})(Direction || (Direction = {})); -var AnimationKeys; -(function (AnimationKeys) { - AnimationKeys["SELECTION"] = "selection"; - AnimationKeys["EXIT"] = "exit"; -})(AnimationKeys || (AnimationKeys = {})); -/** - * MDCChipFoundation provides a foundation for all chips. - */ -export class MDCChipFoundation { - constructor(adapter) { - this.adapter = { ...MDCChipFoundation.defaultAdapter, ...adapter }; - this.animFrame = new AnimationFrame(); - } - static get defaultAdapter() { - return { - addClass: () => undefined, - emitEvent: () => undefined, - getActions: () => [], - getAttribute: () => null, - getElementID: () => '', - getOffsetWidth: () => 0, - hasClass: () => false, - isActionDisabled: () => false, - isActionFocusable: () => false, - isActionSelectable: () => false, - isActionSelected: () => false, - isRTL: () => false, - removeClass: () => undefined, - setActionDisabled: () => undefined, - setActionFocus: () => undefined, - setActionSelected: () => undefined, - setStyleProperty: () => undefined, - }; - } - destroy() { - this.animFrame.cancelAll(); - } - getElementID() { - return this.adapter.getElementID(); - } - setDisabled(isDisabled) { - const actions = this.getActions(); - for (const action of actions) { - this.adapter.setActionDisabled(action, isDisabled); - } - if (isDisabled) { - this.adapter.addClass(MDCChipCssClasses.DISABLED); - } - else { - this.adapter.removeClass(MDCChipCssClasses.DISABLED); - } - } - isDisabled() { - const actions = this.getActions(); - for (const action of actions) { - if (this.adapter.isActionDisabled(action)) { - return true; - } - } - return false; - } - getActions() { - return this.adapter.getActions(); - } - isActionFocusable(action) { - return this.adapter.isActionFocusable(action); - } - isActionSelectable(action) { - return this.adapter.isActionSelectable(action); - } - isActionSelected(action) { - return this.adapter.isActionSelected(action); - } - setActionFocus(action, focus) { - this.adapter.setActionFocus(action, focus); - } - setActionSelected(action, isSelected) { - this.adapter.setActionSelected(action, isSelected); - this.animateSelection(isSelected); - } - startAnimation(animation) { - if (animation === MDCChipAnimation.ENTER) { - this.adapter.addClass(MDCChipCssClasses.ENTER); - return; - } - if (animation === MDCChipAnimation.EXIT) { - this.adapter.addClass(MDCChipCssClasses.EXIT); - return; - } - } - handleAnimationEnd(event) { - const { animationName } = event; - if (animationName === MDCChipAnimation.ENTER) { - this.adapter.removeClass(MDCChipCssClasses.ENTER); - this.adapter.emitEvent(MDCChipEvents.ANIMATION, { - chipID: this.getElementID(), - animation: MDCChipAnimation.ENTER, - addedAnnouncement: this.getAddedAnnouncement(), - isComplete: true, - }); - return; - } - if (animationName === MDCChipAnimation.EXIT) { - this.adapter.removeClass(MDCChipCssClasses.EXIT); - this.adapter.addClass(MDCChipCssClasses.HIDDEN); - const width = this.adapter.getOffsetWidth(); - this.adapter.setStyleProperty('width', `${width}px`); - // Wait two frames so the width gets applied correctly. - this.animFrame.request(AnimationKeys.EXIT, () => { - this.animFrame.request(AnimationKeys.EXIT, () => { - this.adapter.setStyleProperty('width', '0'); - }); - }); - } - } - handleTransitionEnd() { - if (!this.adapter.hasClass(MDCChipCssClasses.HIDDEN)) - return; - this.adapter.emitEvent(MDCChipEvents.ANIMATION, { - chipID: this.getElementID(), - animation: MDCChipAnimation.EXIT, - removedAnnouncement: this.getRemovedAnnouncement(), - isComplete: true, - }); - } - handleActionInteraction({ detail }) { - const { source, actionID } = detail; - const isSelectable = this.adapter.isActionSelectable(source); - const isSelected = this.adapter.isActionSelected(source); - this.adapter.emitEvent(MDCChipEvents.INTERACTION, { - chipID: this.getElementID(), - shouldRemove: this.shouldRemove(detail), - actionID, - isSelectable, - isSelected, - source, - }); - } - handleActionNavigation({ detail }) { - const { source, key } = detail; - const isRTL = this.adapter.isRTL(); - const isTrailingActionFocusable = this.adapter.isActionFocusable(MDCChipActionType.TRAILING); - const isPrimaryActionFocusable = this.adapter.isActionFocusable(MDCChipActionType.PRIMARY); - const dir = this.directionFromKey(key, isRTL); - const shouldNavigateToTrailing = source === MDCChipActionType.PRIMARY && - dir === Direction.RIGHT && isTrailingActionFocusable; - const shouldNavigateToPrimary = source === MDCChipActionType.TRAILING && - dir === Direction.LEFT && isPrimaryActionFocusable; - if (shouldNavigateToTrailing) { - this.navigateActions({ from: source, to: MDCChipActionType.TRAILING }); - return; - } - if (shouldNavigateToPrimary) { - this.navigateActions({ from: source, to: MDCChipActionType.PRIMARY }); - return; - } - this.adapter.emitEvent(MDCChipEvents.NAVIGATION, { - chipID: this.getElementID(), - isRTL, - source, - key, - }); - } - directionFromKey(key, isRTL) { - const isLeftKey = key === 'ArrowLeft'; - const isRightKey = key === 'ArrowRight'; - if (!isRTL && isLeftKey || isRTL && isRightKey) { - return Direction.LEFT; - } - if (!isRTL && isRightKey || isRTL && isLeftKey) { - return Direction.RIGHT; - } - return Direction.UNSPECIFIED; - } - navigateActions(nav) { - this.adapter.setActionFocus(nav.from, MDCChipActionFocusBehavior.NOT_FOCUSABLE); - this.adapter.setActionFocus(nav.to, MDCChipActionFocusBehavior.FOCUSABLE_AND_FOCUSED); - } - shouldRemove({ source, trigger }) { - if (trigger === MDCChipActionInteractionTrigger.BACKSPACE_KEY || - trigger === MDCChipActionInteractionTrigger.DELETE_KEY) { - return true; - } - return source === MDCChipActionType.TRAILING; - } - getRemovedAnnouncement() { - const msg = this.adapter.getAttribute(MDCChipAttributes.DATA_REMOVED_ANNOUNCEMENT); - return msg || undefined; - } - getAddedAnnouncement() { - const msg = this.adapter.getAttribute(MDCChipAttributes.DATA_ADDED_ANNOUNCEMENT); - return msg || undefined; - } - animateSelection(isSelected) { - this.resetAnimationStyles(); - // Wait two frames to ensure the animation classes are unset - this.animFrame.request(AnimationKeys.SELECTION, () => { - this.animFrame.request(AnimationKeys.SELECTION, () => { - this.updateSelectionStyles(isSelected); - }); - }); - } - resetAnimationStyles() { - this.adapter.removeClass(MDCChipCssClasses.SELECTING); - this.adapter.removeClass(MDCChipCssClasses.DESELECTING); - this.adapter.removeClass(MDCChipCssClasses.SELECTING_WITH_PRIMARY_ICON); - this.adapter.removeClass(MDCChipCssClasses.DESELECTING_WITH_PRIMARY_ICON); - } - updateSelectionStyles(isSelected) { - const hasIcon = this.adapter.hasClass(MDCChipCssClasses.WITH_PRIMARY_ICON); - if (hasIcon && isSelected) { - this.adapter.addClass(MDCChipCssClasses.SELECTING_WITH_PRIMARY_ICON); - this.animFrame.request(AnimationKeys.SELECTION, () => { - this.adapter.addClass(MDCChipCssClasses.SELECTED); - }); - return; - } - if (hasIcon && !isSelected) { - this.adapter.addClass(MDCChipCssClasses.DESELECTING_WITH_PRIMARY_ICON); - this.animFrame.request(AnimationKeys.SELECTION, () => { - this.adapter.removeClass(MDCChipCssClasses.SELECTED); - }); - return; - } - if (isSelected) { - this.adapter.addClass(MDCChipCssClasses.SELECTING); - this.animFrame.request(AnimationKeys.SELECTION, () => { - this.adapter.addClass(MDCChipCssClasses.SELECTED); - }); - return; - } - if (!isSelected) { - this.adapter.addClass(MDCChipCssClasses.DESELECTING); - this.animFrame.request(AnimationKeys.SELECTION, () => { - this.adapter.removeClass(MDCChipCssClasses.SELECTED); - }); - return; - } - } -} -//# sourceMappingURL=foundation.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chip/lib/link-chip.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chip/lib/link-chip.d.ts deleted file mode 100644 index d5f78ff..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chip/lib/link-chip.d.ts +++ /dev/null
@@ -1,21 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import '../../action/link-action.js'; -import { TemplateResult } from 'lit'; -import { Chip } from './chip.js'; -/** @soyCompatible */ -export declare class LinkChip extends Chip { - href: string; - target: string; - /** - * @soyTemplate - * @soyAttributes attributes: .md3-chip - * @soyAttributes linkAttributes: .md3-chip__action - */ - protected render(): TemplateResult; - /** @soyTemplate */ - private renderPrimaryAction; -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chip/lib/link-chip.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chip/lib/link-chip.js deleted file mode 100644 index 0f75c314e..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chip/lib/link-chip.js +++ /dev/null
@@ -1,53 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { __decorate, __metadata } from "tslib"; -// import '@material/web/chips/action.js'; -import '../../action/link-action.js'; -import { html } from 'lit'; -import { property } from 'lit/decorators.js'; -import { classMap } from 'lit/directives/class-map.js'; -import { Chip } from './chip.js'; -/** @soyCompatible */ -export class LinkChip extends Chip { - /** - * @soyTemplate - * @soyAttributes attributes: .md3-chip - * @soyAttributes linkAttributes: .md3-chip__action - */ - render() { - return html ` - <span class="${classMap(this.getRootClasses())}" role="row"> - ${this.renderOverlay()} - <span class="md3-chip__cell md3-chip__cell--primary" role="gridcell"> - ${this.renderPrimaryAction()} - </span> - ${this.renderDeleteAction()} - </span>`; - } - /** @soyTemplate */ - renderPrimaryAction() { - return html ` - <md-link-action - ?disabled=${this.disabled} - ?isFocusable=${this.isFocusable} - ?isTouchable=${this.isTouchable} - .icon=${this.icon} - .label=${this.label} - .ariaLabel=${this.ariaLabel} - .href=${this.href} - .target=${this.target}> - </md-link-action>`; - } -} -__decorate([ - property({ type: String }), - __metadata("design:type", String) -], LinkChip.prototype, "href", void 0); -__decorate([ - property({ type: String }), - __metadata("design:type", String) -], LinkChip.prototype, "target", void 0); -//# sourceMappingURL=link-chip.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chip/lib/presentational-chip.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chip/lib/presentational-chip.d.ts deleted file mode 100644 index 96654736..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chip/lib/presentational-chip.d.ts +++ /dev/null
@@ -1,18 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import '../../action/presentational-action.js'; -import { TemplateResult } from 'lit'; -import { Chip } from './chip.js'; -/** @soyCompatible */ -export declare class PresentationalChip extends Chip { - /** - * @soyTemplate - * @soyAttributes attributes: .md3-chip - */ - protected render(): TemplateResult; - /** @soyTemplate */ - private renderPrimaryAction; -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chip/lib/presentational-chip.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chip/lib/presentational-chip.js deleted file mode 100644 index d1a1df88..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chip/lib/presentational-chip.js +++ /dev/null
@@ -1,39 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import '../../action/presentational-action.js'; -import { html } from 'lit'; -import { classMap } from 'lit/directives/class-map.js'; -import { Chip } from './chip.js'; -/** @soyCompatible */ -export class PresentationalChip extends Chip { - /** - * @soyTemplate - * @soyAttributes attributes: .md3-chip - */ - render() { - return html ` - <span class="${classMap(this.getRootClasses())}" role="row"> - ${this.renderOverlay()} - <span class="md3-chip__cell md3-chip__cell--primary" role="gridcell"> - ${this.renderPrimaryAction()} - </span> - ${this.renderDeleteAction()} - </span>`; - } - /** @soyTemplate */ - renderPrimaryAction() { - return html ` - <md-presentational-action - ?disabled=${this.disabled} - ?isFocusable=${this.isFocusable} - ?isTouchable=${this.isTouchable} - .icon=${this.icon} - .label=${this.label} - .ariaLabel=${this.ariaLabel}> - </md-presentational-action>`; - } -} -//# sourceMappingURL=presentational-chip.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chip/lib/selectable-chip.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chip/lib/selectable-chip.d.ts deleted file mode 100644 index 438fbd7..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chip/lib/selectable-chip.d.ts +++ /dev/null
@@ -1,22 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import '../../action/selectable-action.js'; -import { TemplateResult } from 'lit'; -import { ClassInfo } from 'lit/directives/class-map.js'; -import { Chip } from './chip.js'; -/** @soyCompatible */ -export declare class SelectableChip extends Chip { - selected: boolean; - /** - * @soyTemplate - * @soyAttributes attributes: .md3-chip - */ - protected render(): TemplateResult; - /** @soyTemplate */ - protected getRootClasses(): ClassInfo; - /** @soyTemplate */ - private renderPrimaryAction; -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chip/lib/selectable-chip.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chip/lib/selectable-chip.js deleted file mode 100644 index 34e5dec5..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chip/lib/selectable-chip.js +++ /dev/null
@@ -1,57 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { __decorate, __metadata } from "tslib"; -import '../../action/selectable-action.js'; -import { html } from 'lit'; -import { property } from 'lit/decorators.js'; -import { classMap } from 'lit/directives/class-map.js'; -import { Chip } from './chip.js'; -/** @soyCompatible */ -export class SelectableChip extends Chip { - constructor() { - super(...arguments); - this.selected = false; - } - /** - * @soyTemplate - * @soyAttributes attributes: .md3-chip - */ - render() { - return html ` - <span class="${classMap(this.getRootClasses())}" role="presentation"> - ${this.renderOverlay()} - ${this.renderPrimaryAction()} - ${this.renderDeleteAction()} - </span>`; - } - /** @soyTemplate */ - getRootClasses() { - return { - ...super.getRootClasses(), - 'md3-chip--with-primary-graphic': true, - 'md3-chip--selectable': true, - 'md3-chip--selected': this.selected, - }; - } - /** @soyTemplate */ - renderPrimaryAction() { - return html ` - <md-selectable-action - ?disabled=${this.disabled} - ?selected=${this.selected} - ?isFocusable=${this.isFocusable} - ?isTouchable=${this.isTouchable} - .icon=${this.icon} - .label=${this.label} - .ariaLabel=${this.ariaLabel}> - </md-selectable-action>`; - } -} -__decorate([ - property({ type: Boolean, reflect: true }), - __metadata("design:type", Object) -], SelectableChip.prototype, "selected", void 0); -//# sourceMappingURL=selectable-chip.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chip/lib/types.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chip/lib/types.d.ts deleted file mode 100644 index 7863eb2..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chip/lib/types.d.ts +++ /dev/null
@@ -1,42 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { MDCChipActionType } from '../../action/lib/constants.js'; -import { MDCChipActionInteractionEventDetail, MDCChipActionNavigationEventDetail } from '../../action/lib/types.js'; -import { MDCChipAnimation } from './constants.js'; -/** MDCChipInteractionEventDetail provides details for the interaction event. */ -export interface MDCChipInteractionEventDetail { - actionID: string; - chipID: string; - source: MDCChipActionType; - shouldRemove: boolean; - isSelectable: boolean; - isSelected: boolean; -} -/** MDCChipNavigationEventDetail provides details for the navigation event. */ -export interface MDCChipNavigationEventDetail { - chipID: string; - source: MDCChipActionType; - key: string; - isRTL: boolean; -} -/** - * MDCChipAnimationEventDetail provides details for the animation event. - */ -export interface MDCChipAnimationEventDetail { - chipID: string; - animation: MDCChipAnimation; - isComplete: boolean; - addedAnnouncement?: string; - removedAnnouncement?: string; -} -/** - * MDCChipActionInteractionEvent is the custom event for the interaction event. - */ -export declare type ActionInteractionEvent = CustomEvent<MDCChipActionInteractionEventDetail>; -/** - * MDCChipActionInteractionEvent is the custom event for the interaction event. - */ -export declare type ActionNavigationEvent = CustomEvent<MDCChipActionNavigationEventDetail>;
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chip/lib/types.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chip/lib/types.js deleted file mode 100644 index ba75424e..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chip/lib/types.js +++ /dev/null
@@ -1,7 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -export {}; -//# sourceMappingURL=types.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chipset/lib/adapter.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chipset/lib/adapter.d.ts deleted file mode 100644 index 0fbc8ea1..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chipset/lib/adapter.d.ts +++ /dev/null
@@ -1,45 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { MDCChipActionFocusBehavior, MDCChipActionType } from '../../action/lib/constants.js'; -import { MDCChipAnimation } from '../../chip/lib/constants.js'; -import { MDCChipSetAttributes, MDCChipSetEvents } from './constants.js'; -/** - * Defines the shape of the adapter expected by the foundation. - * Implement this adapter for your framework of choice to delegate updates to - * the component in your framework of choice. See architecture documentation - * for more details. - * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md - */ -export interface MDCChipSetAdapter { - /** Announces the message via an aria-live region */ - announceMessage(message: string): void; - /** Emits the given event with the given detail. */ - emitEvent<D extends object>(eventName: MDCChipSetEvents, eventDetail: D): void; - /** Returns the value for the given attribute, if it exists. */ - getAttribute(attrName: MDCChipSetAttributes): string | null; - /** Returns the actions provided by the child chip at the given index. */ - getChipActionsAtIndex(index: number): MDCChipActionType[]; - /** Returns the number of child chips. */ - getChipCount(): number; - /** Returns the ID of the chip at the given index. */ - getChipIdAtIndex(index: number): string; - /** Returns the index of the child chip with the matching ID. */ - getChipIndexById(chipID: string): number; - /** Proxies to the MDCChip#isActionFocusable method. */ - isChipFocusableAtIndex(index: number, actionType: MDCChipActionType): boolean; - /** Proxies to the MDCChip#isActionSelectable method. */ - isChipSelectableAtIndex(index: number, actionType: MDCChipActionType): boolean; - /** Proxies to the MDCChip#isActionSelected method. */ - isChipSelectedAtIndex(index: number, actionType: MDCChipActionType): boolean; - /** Removes the chip at the given index. */ - removeChipAtIndex(index: number): void; - /** Proxies to the MDCChip#setActionFocus method. */ - setChipFocusAtIndex(index: number, action: MDCChipActionType, focus: MDCChipActionFocusBehavior): void; - /** Proxies to the MDCChip#setActionSelected method. */ - setChipSelectedAtIndex(index: number, actionType: MDCChipActionType, isSelected: boolean): void; - /** Starts the chip animation at the given index. */ - startChipAnimationAtIndex(index: number, animation: MDCChipAnimation): void; -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chipset/lib/adapter.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chipset/lib/adapter.js deleted file mode 100644 index d2fffb0..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chipset/lib/adapter.js +++ /dev/null
@@ -1,7 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -export {}; -//# sourceMappingURL=adapter.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chipset/lib/constants.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chipset/lib/constants.d.ts deleted file mode 100644 index 0865a981..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chipset/lib/constants.d.ts +++ /dev/null
@@ -1,26 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -/** - * MDCChipSetAttributes provides the named constants for attributes used by the - * foundation. - */ -export declare enum MDCChipSetAttributes { - ARIA_MULTISELECTABLE = "aria-multiselectable" -} -/** - * MDCChipSetCssClasses provides the named constants for class names. - */ -export declare enum MDCChipSetCssClasses { - CHIP = "md3-chip" -} -/** - * MDCChipSetEvents provides the constants for emitted events. - */ -export declare enum MDCChipSetEvents { - INTERACTION = "MDCChipSet:interaction", - REMOVAL = "MDCChipSet:removal", - SELECTION = "MDCChipSet:selection" -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chipset/lib/constants.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chipset/lib/constants.js deleted file mode 100644 index 736d923c..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chipset/lib/constants.js +++ /dev/null
@@ -1,30 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -/** - * MDCChipSetAttributes provides the named constants for attributes used by the - * foundation. - */ -export var MDCChipSetAttributes; -(function (MDCChipSetAttributes) { - MDCChipSetAttributes["ARIA_MULTISELECTABLE"] = "aria-multiselectable"; -})(MDCChipSetAttributes || (MDCChipSetAttributes = {})); -/** - * MDCChipSetCssClasses provides the named constants for class names. - */ -export var MDCChipSetCssClasses; -(function (MDCChipSetCssClasses) { - MDCChipSetCssClasses["CHIP"] = "md3-chip"; -})(MDCChipSetCssClasses || (MDCChipSetCssClasses = {})); -/** - * MDCChipSetEvents provides the constants for emitted events. - */ -export var MDCChipSetEvents; -(function (MDCChipSetEvents) { - MDCChipSetEvents["INTERACTION"] = "MDCChipSet:interaction"; - MDCChipSetEvents["REMOVAL"] = "MDCChipSet:removal"; - MDCChipSetEvents["SELECTION"] = "MDCChipSet:selection"; -})(MDCChipSetEvents || (MDCChipSetEvents = {})); -//# sourceMappingURL=constants.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chipset/lib/foundation.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chipset/lib/foundation.d.ts deleted file mode 100644 index e3865a05..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chipset/lib/foundation.d.ts +++ /dev/null
@@ -1,68 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { MDCChipActionType } from '../../action/lib/constants.js'; -import { MDCChipSetAdapter } from './adapter.js'; -import { ChipAnimationEvent, ChipInteractionEvent, ChipNavigationEvent } from './types.js'; -/** - * MDCChipSetFoundation provides a foundation for all chips. - */ -export declare class MDCChipSetFoundation { - private readonly adapter; - static get defaultAdapter(): MDCChipSetAdapter; - constructor(adapter?: Partial<MDCChipSetAdapter>); - handleChipAnimation({ detail }: ChipAnimationEvent): void; - handleChipInteraction({ detail }: ChipInteractionEvent): void; - handleChipNavigation({ detail }: ChipNavigationEvent): void; - /** Returns the unique selected indexes of the chips. */ - getSelectedChipIndexes(): ReadonlySet<number>; - /** Sets the selected state of the chip at the given index and action. */ - setChipSelected(index: number, action: MDCChipActionType, isSelected: boolean): void; - /** Returns the selected state of the chip at the given index and action. */ - isChipSelected(index: number, action: MDCChipActionType): boolean; - /** Removes the chip at the given index. */ - removeChip(index: number): void; - addChip(index: number): void; - /** - * Increments to find the first focusable chip. - */ - private focusNextChipFrom; - /** - * Decrements to find the first focusable chip. Takes an optional target - * action that can be used to focus the first matching focusable action. - */ - private focusPrevChipFrom; - /** Returns the appropriate focusable action, or null if none exist. */ - private getFocusableAction; - /** - * Returs the first focusable action, regardless of type, or null if no - * focusable actions exist. - */ - private getFirstFocusableAction; - /** - * If the actions contain a focusable action that matches the target action, - * return that. Otherwise, return the first focusable action, or null if no - * focusable action exists. - */ - private getMatchingFocusableAction; - private focusChip; - private supportsMultiSelect; - private setSelection; - private removeAfterAnimation; - /** - * Find the first focusable action by moving bidirectionally horizontally - * from the start index. - * - * Given chip set [A, B, C, D, E, F, G]... - * Let's say we remove chip "F". We don't know where the nearest focusable - * action is since any of them could be disabled. The nearest focusable - * action could be E, it could be G, it could even be A. To find it, we - * start from the source index (5 for "F" in this case) and move out - * horizontally, checking each chip at each index. - * - */ - private focusNearestFocusableAction; - private getNearestFocusableAction; -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chipset/lib/foundation.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chipset/lib/foundation.js deleted file mode 100644 index 25964af..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chipset/lib/foundation.js +++ /dev/null
@@ -1,314 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { MDCChipActionFocusBehavior, MDCChipActionType } from '../../action/lib/constants.js'; -import { MDCChipAnimation } from '../../chip/lib/constants.js'; -import { MDCChipSetAttributes, MDCChipSetEvents } from './constants.js'; -var Operator; -(function (Operator) { - Operator[Operator["INCREMENT"] = 0] = "INCREMENT"; - Operator[Operator["DECREMENT"] = 1] = "DECREMENT"; -})(Operator || (Operator = {})); -/** - * MDCChipSetFoundation provides a foundation for all chips. - */ -export class MDCChipSetFoundation { - constructor(adapter) { - this.adapter = { ...MDCChipSetFoundation.defaultAdapter, ...adapter }; - } - static get defaultAdapter() { - return { - announceMessage: () => undefined, - emitEvent: () => undefined, - getAttribute: () => null, - getChipActionsAtIndex: () => [], - getChipCount: () => 0, - getChipIdAtIndex: () => '', - getChipIndexById: () => 0, - isChipFocusableAtIndex: () => false, - isChipSelectableAtIndex: () => false, - isChipSelectedAtIndex: () => false, - removeChipAtIndex: () => { }, - setChipFocusAtIndex: () => undefined, - setChipSelectedAtIndex: () => undefined, - startChipAnimationAtIndex: () => undefined, - }; - } - handleChipAnimation({ detail }) { - const { chipID, animation, isComplete, addedAnnouncement, removedAnnouncement } = detail; - const index = this.adapter.getChipIndexById(chipID); - if (animation === MDCChipAnimation.EXIT && isComplete) { - if (removedAnnouncement) { - this.adapter.announceMessage(removedAnnouncement); - } - this.removeAfterAnimation(index, chipID); - return; - } - if (animation === MDCChipAnimation.ENTER && isComplete && - addedAnnouncement) { - this.adapter.announceMessage(addedAnnouncement); - return; - } - } - handleChipInteraction({ detail }) { - const { source, chipID, isSelectable, isSelected, shouldRemove } = detail; - const index = this.adapter.getChipIndexById(chipID); - if (shouldRemove) { - this.removeChip(index); - return; - } - this.focusChip(index, source, MDCChipActionFocusBehavior.FOCUSABLE); - this.adapter.emitEvent(MDCChipSetEvents.INTERACTION, { - chipIndex: index, - chipID, - }); - if (isSelectable) { - this.setSelection(index, source, !isSelected); - } - } - handleChipNavigation({ detail }) { - const { chipID, key, isRTL, source } = detail; - const index = this.adapter.getChipIndexById(chipID); - const toNextChip = (key === 'ArrowRight' && !isRTL) || (key === 'ArrowLeft' && isRTL); - if (toNextChip) { - // Start from the next chip so we increment the index - this.focusNextChipFrom(index + 1); - return; - } - const toPreviousChip = (key === 'ArrowLeft' && !isRTL) || (key === 'ArrowRight' && isRTL); - if (toPreviousChip) { - // Start from the previous chip so we decrement the index - this.focusPrevChipFrom(index - 1); - return; - } - if (key === 'ArrowDown') { - // Start from the next chip so we increment the index - this.focusNextChipFrom(index + 1, source); - return; - } - if (key === 'ArrowUp') { - // Start from the previous chip so we decrement the index - this.focusPrevChipFrom(index - 1, source); - return; - } - if (key === 'Home') { - this.focusNextChipFrom(0, source); - return; - } - if (key === 'End') { - this.focusPrevChipFrom(this.adapter.getChipCount() - 1, source); - return; - } - } - /** Returns the unique selected indexes of the chips. */ - getSelectedChipIndexes() { - const selectedIndexes = new Set(); - const chipCount = this.adapter.getChipCount(); - for (let i = 0; i < chipCount; i++) { - const actions = this.adapter.getChipActionsAtIndex(i); - for (const action of actions) { - if (this.adapter.isChipSelectedAtIndex(i, action)) { - selectedIndexes.add(i); - } - } - } - return selectedIndexes; - } - /** Sets the selected state of the chip at the given index and action. */ - setChipSelected(index, action, isSelected) { - if (this.adapter.isChipSelectableAtIndex(index, action)) { - this.setSelection(index, action, isSelected); - } - } - /** Returns the selected state of the chip at the given index and action. */ - isChipSelected(index, action) { - return this.adapter.isChipSelectedAtIndex(index, action); - } - /** Removes the chip at the given index. */ - removeChip(index) { - // Early exit if the index is out of bounds - if (index >= this.adapter.getChipCount() || index < 0) - return; - this.adapter.startChipAnimationAtIndex(index, MDCChipAnimation.EXIT); - this.adapter.emitEvent(MDCChipSetEvents.REMOVAL, { - chipID: this.adapter.getChipIdAtIndex(index), - chipIndex: index, - isComplete: false, - }); - } - addChip(index) { - // Early exit if the index is out of bounds - if (index >= this.adapter.getChipCount() || index < 0) - return; - this.adapter.startChipAnimationAtIndex(index, MDCChipAnimation.ENTER); - } - /** - * Increments to find the first focusable chip. - */ - focusNextChipFrom(startIndex, targetAction) { - const chipCount = this.adapter.getChipCount(); - for (let i = startIndex; i < chipCount; i++) { - const focusableAction = this.getFocusableAction(i, Operator.INCREMENT, targetAction); - if (focusableAction) { - this.focusChip(i, focusableAction, MDCChipActionFocusBehavior.FOCUSABLE_AND_FOCUSED); - return; - } - } - } - /** - * Decrements to find the first focusable chip. Takes an optional target - * action that can be used to focus the first matching focusable action. - */ - focusPrevChipFrom(startIndex, targetAction) { - for (let i = startIndex; i > -1; i--) { - const focusableAction = this.getFocusableAction(i, Operator.DECREMENT, targetAction); - if (focusableAction) { - this.focusChip(i, focusableAction, MDCChipActionFocusBehavior.FOCUSABLE_AND_FOCUSED); - return; - } - } - } - /** Returns the appropriate focusable action, or null if none exist. */ - getFocusableAction(index, op, targetAction) { - const actions = this.adapter.getChipActionsAtIndex(index); - // Reverse the actions if decrementing - if (op === Operator.DECREMENT) - actions.reverse(); - if (targetAction) { - return this.getMatchingFocusableAction(index, actions, targetAction); - } - return this.getFirstFocusableAction(index, actions); - } - /** - * Returs the first focusable action, regardless of type, or null if no - * focusable actions exist. - */ - getFirstFocusableAction(index, actions) { - for (const action of actions) { - if (this.adapter.isChipFocusableAtIndex(index, action)) { - return action; - } - } - return null; - } - /** - * If the actions contain a focusable action that matches the target action, - * return that. Otherwise, return the first focusable action, or null if no - * focusable action exists. - */ - getMatchingFocusableAction(index, actions, targetAction) { - let focusableAction = null; - for (const action of actions) { - if (this.adapter.isChipFocusableAtIndex(index, action)) { - focusableAction = action; - } - // Exit and return the focusable action if it matches the target - if (focusableAction === targetAction) { - return focusableAction; - } - } - return focusableAction; - } - focusChip(index, action, focus) { - this.adapter.setChipFocusAtIndex(index, action, focus); - const chipCount = this.adapter.getChipCount(); - for (let i = 0; i < chipCount; i++) { - const actions = this.adapter.getChipActionsAtIndex(i); - for (const chipAction of actions) { - // Skip the action and index provided since we set it above - if (chipAction === action && i === index) - continue; - this.adapter.setChipFocusAtIndex(i, chipAction, MDCChipActionFocusBehavior.NOT_FOCUSABLE); - } - } - } - supportsMultiSelect() { - return this.adapter.getAttribute(MDCChipSetAttributes.ARIA_MULTISELECTABLE) === 'true'; - } - setSelection(index, action, isSelected) { - this.adapter.setChipSelectedAtIndex(index, action, isSelected); - this.adapter.emitEvent(MDCChipSetEvents.SELECTION, { - chipID: this.adapter.getChipIdAtIndex(index), - chipIndex: index, - isSelected, - }); - // Early exit if we support multi-selection - if (this.supportsMultiSelect()) { - return; - } - // If we get here, we ony support single selection. This means we need to - // unselect all chips - const chipCount = this.adapter.getChipCount(); - for (let i = 0; i < chipCount; i++) { - const actions = this.adapter.getChipActionsAtIndex(i); - for (const chipAction of actions) { - // Skip the action and index provided since we set it above - if (chipAction === action && i === index) - continue; - this.adapter.setChipSelectedAtIndex(i, chipAction, false); - } - } - } - removeAfterAnimation(index, chipID) { - this.adapter.removeChipAtIndex(index); - this.adapter.emitEvent(MDCChipSetEvents.REMOVAL, { - chipIndex: index, - isComplete: true, - chipID, - }); - const chipCount = this.adapter.getChipCount(); - // Early exit if we have an empty chip set - if (chipCount <= 0) - return; - this.focusNearestFocusableAction(index); - } - /** - * Find the first focusable action by moving bidirectionally horizontally - * from the start index. - * - * Given chip set [A, B, C, D, E, F, G]... - * Let's say we remove chip "F". We don't know where the nearest focusable - * action is since any of them could be disabled. The nearest focusable - * action could be E, it could be G, it could even be A. To find it, we - * start from the source index (5 for "F" in this case) and move out - * horizontally, checking each chip at each index. - * - */ - focusNearestFocusableAction(index) { - const chipCount = this.adapter.getChipCount(); - let decrIndex = index; - let incrIndex = index; - while (decrIndex > -1 || incrIndex < chipCount) { - const focusAction = this.getNearestFocusableAction(decrIndex, incrIndex, MDCChipActionType.TRAILING); - if (focusAction) { - this.focusChip(focusAction.index, focusAction.action, MDCChipActionFocusBehavior.FOCUSABLE_AND_FOCUSED); - return; - } - decrIndex--; - incrIndex++; - } - } - getNearestFocusableAction(decrIndex, incrIndex, actionType) { - const decrAction = this.getFocusableAction(decrIndex, Operator.DECREMENT, actionType); - if (decrAction) { - return { - index: decrIndex, - action: decrAction, - }; - } - // Early exit if the incremented and decremented indices are identical - if (incrIndex === decrIndex) - return null; - const incrAction = this.getFocusableAction(incrIndex, Operator.INCREMENT, actionType); - if (incrAction) { - return { - index: incrIndex, - action: incrAction, - }; - } - return null; - } -} -//# sourceMappingURL=foundation.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chipset/lib/types.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chipset/lib/types.d.ts deleted file mode 100644 index 94526aa1..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chipset/lib/types.d.ts +++ /dev/null
@@ -1,41 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { MDCChipAnimationEventDetail, MDCChipInteractionEventDetail, MDCChipNavigationEventDetail } from '../../chip/lib/types.js'; -/** - * MDCChipSetInteractionEventDetail provides detail about the interaction event. - */ -export interface MDCChipSetInteractionEventDetail { - chipID: string; - chipIndex: number; -} -/** - * MDCChipSetRemovalEventDetail provides detail about the removal event. - */ -export interface MDCChipSetRemovalEventDetail { - chipID: string; - chipIndex: number; - isComplete: boolean; -} -/** - * MDCChipSetSelectionEventDetail provides detail about the selection event. - */ -export interface MDCChipSetSelectionEventDetail { - chipID: string; - chipIndex: number; - isSelected: boolean; -} -/** - * ChipInteractionEvent is the custom event for the interaction event. - */ -export declare type ChipInteractionEvent = CustomEvent<MDCChipInteractionEventDetail>; -/** - * ChipNavigationEvent is the custom event for the navigation event. - */ -export declare type ChipNavigationEvent = CustomEvent<MDCChipNavigationEventDetail>; -/** - * ChipAnimationEvent is the custom event for the animation event. - */ -export declare type ChipAnimationEvent = CustomEvent<MDCChipAnimationEventDetail>;
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chipset/lib/types.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chipset/lib/types.js deleted file mode 100644 index ba75424e..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/chipset/lib/types.js +++ /dev/null
@@ -1,7 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -export {}; -//# sourceMappingURL=types.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/filter-chip.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/filter-chip.d.ts new file mode 100644 index 0000000..900050a --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/filter-chip.d.ts
@@ -0,0 +1,20 @@ +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import { FilterChip } from './lib/filter-chip.js'; +declare global { + interface HTMLElementTagNameMap { + 'md-filter-chip': MdFilterChip; + } +} +/** + * TODO(b/243982145): add docs + * + * @final + * @suppress {visibility} + */ +export declare class MdFilterChip extends FilterChip { + static styles: import("lit").CSSResult[]; +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/filter-chip.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/filter-chip.js new file mode 100644 index 0000000..815b835 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/filter-chip.js
@@ -0,0 +1,25 @@ +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import { __decorate } from "tslib"; +import { customElement } from 'lit/decorators.js'; +import { styles as elevatedStyles } from './lib/elevated-styles.css.js'; +import { FilterChip } from './lib/filter-chip.js'; +import { styles } from './lib/filter-styles.css.js'; +import { styles as sharedStyles } from './lib/shared-styles.css.js'; +/** + * TODO(b/243982145): add docs + * + * @final + * @suppress {visibility} + */ +let MdFilterChip = class MdFilterChip extends FilterChip { +}; +MdFilterChip.styles = [sharedStyles, elevatedStyles, styles]; +MdFilterChip = __decorate([ + customElement('md-filter-chip') +], MdFilterChip); +export { MdFilterChip }; +//# sourceMappingURL=filter-chip.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/lib/assist-chip.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/lib/assist-chip.d.ts new file mode 100644 index 0000000..5cd3fad --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/lib/assist-chip.d.ts
@@ -0,0 +1,23 @@ +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import '../../elevation/elevation.js'; +import { Chip } from './chip.js'; +/** + * An assist chip component. + */ +export declare class AssistChip extends Chip { + elevated: boolean; + href: string; + target: '_blank' | '_parent' | '_self' | '_top' | ''; + protected get primaryFocusFor(): "link" | "button"; + protected get primaryRippleDisabled(): boolean; + protected getContainerClasses(): { + disabled: boolean; + elevated: boolean; + }; + protected renderPrimaryAction(): import("lit-html").TemplateResult<1>; + protected renderOutline(): import("lit-html").TemplateResult<1>; +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/lib/assist-chip.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/lib/assist-chip.js new file mode 100644 index 0000000..9fd863d --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/lib/assist-chip.js
@@ -0,0 +1,76 @@ +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import { __decorate } from "tslib"; +import '../../elevation/elevation.js'; +import { html, nothing } from 'lit'; +import { property } from 'lit/decorators.js'; +import { ripple } from '../../ripple/directive.js'; +import { Chip } from './chip.js'; +/** + * An assist chip component. + */ +export class AssistChip extends Chip { + constructor() { + super(...arguments); + this.elevated = false; + this.href = ''; + this.target = ''; + } + get primaryFocusFor() { + return this.href ? 'link' : 'button'; + } + get primaryRippleDisabled() { + // Link chips cannot be disabled + return !this.href && this.disabled; + } + getContainerClasses() { + return { + ...super.getContainerClasses(), + // Link chips cannot be disabled + disabled: !this.href && this.disabled, + elevated: this.elevated, + }; + } + renderPrimaryAction() { + const { ariaLabel } = this; + if (this.href) { + return html ` + <a class="action" + id="link" + aria-label=${ariaLabel || nothing} + href=${this.href} + target=${this.target || nothing} + ${ripple(this.getPrimaryRipple)} + >${this.renderContent()}</a> + `; + } + return html ` + <button class="action" + id="button" + aria-label=${ariaLabel || nothing} + ?disabled=${this.disabled} + type="button" + ${ripple(this.getPrimaryRipple)} + >${this.renderContent()}</button> + `; + } + renderOutline() { + if (this.elevated) { + return html `<md-elevation></md-elevation>`; + } + return super.renderOutline(); + } +} +__decorate([ + property({ type: Boolean }) +], AssistChip.prototype, "elevated", void 0); +__decorate([ + property() +], AssistChip.prototype, "href", void 0); +__decorate([ + property() +], AssistChip.prototype, "target", void 0); +//# sourceMappingURL=assist-chip.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/filled-styles.css.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/lib/assist-styles.css.d.ts similarity index 100% copy from third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/filled-styles.css.d.ts copy to third_party/material_web_components/components-chromium/node_modules/@material/web/chips/lib/assist-styles.css.d.ts
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/lib/assist-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/lib/assist-styles.css.js new file mode 100644 index 0000000..4700b77 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/lib/assist-styles.css.js
@@ -0,0 +1,9 @@ +/** + * @license + * Copyright 2022 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import { css } from 'lit'; +export const styles = css `:host{--_container-height: 32px;--_container-shape: 8px;--_disabled-label-text-color: var(--md-sys-color-on-surface, #1d1b20);--_disabled-label-text-opacity: 0.38;--_elevated-container-color: var(--md-sys-color-surface-container-low, #f7f2fa);--_elevated-container-elevation: 1;--_elevated-container-shadow-color: var(--md-sys-color-shadow, #000);--_elevated-disabled-container-color: var(--md-sys-color-on-surface, #1d1b20);--_elevated-disabled-container-elevation: 0;--_elevated-disabled-container-opacity: 0.12;--_elevated-focus-container-elevation: 1;--_elevated-hover-container-elevation: 2;--_elevated-pressed-container-elevation: 1;--_focus-label-text-color: var(--md-sys-color-on-surface, #1d1b20);--_focus-state-layer-color: var(--md-sys-color-on-surface, #1d1b20);--_focus-state-layer-opacity: 0.12;--_hover-label-text-color: var(--md-sys-color-on-surface, #1d1b20);--_hover-state-layer-color: var(--md-sys-color-on-surface, #1d1b20);--_hover-state-layer-opacity: 0.08;--_label-text-color: var(--md-sys-color-on-surface, #1d1b20);--_label-text-type: var(--md-sys-typescale-label-large, 500 0.875rem / 1.25rem var(--md-ref-typeface-plain, Roboto));--_pressed-label-text-color: var(--md-sys-color-on-surface, #1d1b20);--_pressed-state-layer-color: var(--md-sys-color-on-surface, #1d1b20);--_pressed-state-layer-opacity: 0.12;--_disabled-outline-color: var(--md-sys-color-on-surface, #1d1b20);--_disabled-outline-opacity: 0.12;--_focus-outline-color: var(--md-sys-color-on-surface, #1d1b20);--_outline-color: var(--md-sys-color-outline, #79747e);--_outline-width: 1px;--_disabled-leading-icon-color: var(--md-sys-color-on-surface, #1d1b20);--_disabled-leading-icon-opacity: 0.38;--_focus-leading-icon-color: var(--md-sys-color-primary, #6750a4);--_hover-leading-icon-color: var(--md-sys-color-primary, #6750a4);--_leading-icon-color: var(--md-sys-color-primary, #6750a4);--_icon-size: 18px;--_pressed-leading-icon-color: var(--md-sys-color-primary, #6750a4);--_container-shape-start-start: var( --md-assist-chip-container-shape-start-start, var(--_container-shape) );--_container-shape-start-end: var( --md-assist-chip-container-shape-start-end, var(--_container-shape) );--_container-shape-end-end: var( --md-assist-chip-container-shape-end-end, var(--_container-shape) );--_container-shape-end-start: var( --md-assist-chip-container-shape-end-start, var(--_container-shape) )}/*# sourceMappingURL=assist-styles.css.map */ +`; +//# sourceMappingURL=assist-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/lib/chip.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/lib/chip.d.ts new file mode 100644 index 0000000..197055189 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/lib/chip.d.ts
@@ -0,0 +1,37 @@ +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import '../../focus/focus-ring.js'; +import '../../ripple/ripple.js'; +import { LitElement, nothing, TemplateResult } from 'lit'; +import { MdRipple } from '../../ripple/ripple.js'; +/** + * A chip component. + */ +export declare abstract class Chip extends LitElement { + disabled: boolean; + label: string; + /** + * The `id` of the action the primary focus ring is for. + */ + protected abstract readonly primaryFocusFor: string; + /** + * Whether or not the primary ripple is disabled (defaults to `disabled`). + * Some chip actions such as links cannot be disabled. + */ + protected get primaryRippleDisabled(): boolean; + private showPrimaryRipple; + private readonly primaryRipple; + protected render(): TemplateResult<1>; + protected getContainerClasses(): { + disabled: boolean; + }; + protected renderContent(): TemplateResult<1>; + protected abstract renderPrimaryAction(): TemplateResult; + protected renderTrailingAction(): TemplateResult | typeof nothing; + protected renderOutline(): TemplateResult<1>; + protected renderLeadingIcon(): TemplateResult; + protected getPrimaryRipple: () => Promise<MdRipple>; +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/lib/chip.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/lib/chip.js new file mode 100644 index 0000000..d634218 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/lib/chip.js
@@ -0,0 +1,89 @@ +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +var _a; +import { __decorate } from "tslib"; +import '../../focus/focus-ring.js'; +import '../../ripple/ripple.js'; +import { html, LitElement, nothing } from 'lit'; +import { property, queryAsync, state } from 'lit/decorators.js'; +import { classMap } from 'lit/directives/class-map.js'; +import { requestUpdateOnAriaChange } from '../../aria/delegate.js'; +/** + * A chip component. + */ +export class Chip extends LitElement { + constructor() { + super(...arguments); + this.disabled = false; + this.label = ''; + this.showPrimaryRipple = false; + this.getPrimaryRipple = () => { + this.showPrimaryRipple = true; + return this.primaryRipple; + }; + } + /** + * Whether or not the primary ripple is disabled (defaults to `disabled`). + * Some chip actions such as links cannot be disabled. + */ + get primaryRippleDisabled() { + return this.disabled; + } + render() { + const primaryRipple = this.showPrimaryRipple ? + html `<md-ripple ?disabled=${this.primaryRippleDisabled}></md-ripple>` : + nothing; + const primaryFocus = html `<md-focus-ring for=${this.primaryFocusFor}></md-focus-ring>`; + return html ` + <div class="container ${classMap(this.getContainerClasses())}"> + ${this.renderOutline()} + ${primaryFocus} + ${primaryRipple} + ${this.renderPrimaryAction()} + ${this.renderTrailingAction()} + </div> + `; + } + getContainerClasses() { + return { + disabled: this.disabled, + }; + } + renderContent() { + return html ` + <span class="icon"> + ${this.renderLeadingIcon()} + </span> + <span class="label">${this.label}</span> + `; + } + renderTrailingAction() { + return nothing; + } + renderOutline() { + return html `<span class="outline"></span>`; + } + renderLeadingIcon() { + return html `<slot name="icon"></slot>`; + } +} +_a = Chip; +(() => { + requestUpdateOnAriaChange(_a); +})(); +__decorate([ + property({ type: Boolean }) +], Chip.prototype, "disabled", void 0); +__decorate([ + property() +], Chip.prototype, "label", void 0); +__decorate([ + state() +], Chip.prototype, "showPrimaryRipple", void 0); +__decorate([ + queryAsync('md-ripple') +], Chip.prototype, "primaryRipple", void 0); +//# sourceMappingURL=chip.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/filled-styles.css.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/lib/elevated-styles.css.d.ts similarity index 100% rename from third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/filled-styles.css.d.ts rename to third_party/material_web_components/components-chromium/node_modules/@material/web/chips/lib/elevated-styles.css.d.ts
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/lib/elevated-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/lib/elevated-styles.css.js new file mode 100644 index 0000000..f9e82ef3 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/lib/elevated-styles.css.js
@@ -0,0 +1,9 @@ +/** + * @license + * Copyright 2022 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import { css } from 'lit'; +export const styles = css `.elevated{--md-elevation-level:var(--_elevated-container-elevation);--md-elevation-shadow-color:var(--_elevated-container-shadow-color)}.elevated::before{background:var(--_elevated-container-color)}.elevated:hover{--md-elevation-level:var(--_elevated-hover-container-elevation)}.elevated:focus-within{--md-elevation-level:var(--_elevated-focus-container-elevation)}.elevated:active{--md-elevation-level:var(--_elevated-pressed-container-elevation)}.elevated.disabled{--md-elevation-level:var(--_elevated-disabled-container-elevation)}.elevated.disabled::before{background:var(--_elevated-disabled-container-color);opacity:var(--_elevated-disabled-container-opacity)}/*# sourceMappingURL=elevated-styles.css.map */ +`; +//# sourceMappingURL=elevated-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/lib/filter-chip.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/lib/filter-chip.d.ts new file mode 100644 index 0000000..43f6d87 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/lib/filter-chip.d.ts
@@ -0,0 +1,26 @@ +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import '../../elevation/elevation.js'; +import { PropertyValues } from 'lit'; +import { Chip } from './chip.js'; +/** + * A filter chip component. + */ +export declare class FilterChip extends Chip { + elevated: boolean; + selected: boolean; + protected get primaryFocusFor(): string; + constructor(); + protected updated(changedProperties: PropertyValues<FilterChip>): void; + protected getContainerClasses(): { + elevated: boolean; + selected: boolean; + disabled: boolean; + }; + protected renderPrimaryAction(): import("lit-html").TemplateResult<1>; + protected renderLeadingIcon(): import("lit-html").TemplateResult<2 | 1>; + protected renderOutline(): import("lit-html").TemplateResult<1>; +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/lib/filter-chip.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/lib/filter-chip.js new file mode 100644 index 0000000..ab9f121 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/lib/filter-chip.js
@@ -0,0 +1,80 @@ +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import { __decorate } from "tslib"; +import '../../elevation/elevation.js'; +import { html, nothing, svg } from 'lit'; +import { property } from 'lit/decorators.js'; +import { ripple } from '../../ripple/directive.js'; +import { Chip } from './chip.js'; +/** + * A filter chip component. + */ +export class FilterChip extends Chip { + get primaryFocusFor() { + return 'option'; + } + constructor() { + super(); + this.elevated = false; + this.selected = false; + this.addEventListener('click', () => { + if (this.disabled) { + return; + } + this.selected = !this.selected; + }); + } + updated(changedProperties) { + if (changedProperties.has('selected') && + changedProperties.get('selected') !== undefined) { + // Dispatch when `selected` changes, except for the first update. + this.dispatchEvent(new Event('change', { bubbles: true })); + } + } + getContainerClasses() { + return { + ...super.getContainerClasses(), + elevated: this.elevated, + selected: this.selected, + }; + } + renderPrimaryAction() { + const { ariaLabel } = this; + return html ` + <button class="action" + id="option" + aria-label=${ariaLabel || nothing} + aria-selected=${this.selected} + ?disabled=${this.disabled || nothing} + role="option" + ${ripple(this.getPrimaryRipple)} + >${this.renderContent()}</button> + `; + } + renderLeadingIcon() { + if (!this.selected) { + return super.renderLeadingIcon(); + } + return svg ` + <svg class="checkmark" viewBox="0 0 18 18" aria-hidden="true"> + <path d="M6.75012 12.1274L3.62262 8.99988L2.55762 10.0574L6.75012 14.2499L15.7501 5.24988L14.6926 4.19238L6.75012 12.1274Z" /> + </svg> + `; + } + renderOutline() { + if (this.elevated) { + return html `<md-elevation></md-elevation>`; + } + return super.renderOutline(); + } +} +__decorate([ + property({ type: Boolean }) +], FilterChip.prototype, "elevated", void 0); +__decorate([ + property({ type: Boolean }) +], FilterChip.prototype, "selected", void 0); +//# sourceMappingURL=filter-chip.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/filled-styles.css.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/lib/filter-styles.css.d.ts similarity index 100% copy from third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/filled-styles.css.d.ts copy to third_party/material_web_components/components-chromium/node_modules/@material/web/chips/lib/filter-styles.css.d.ts
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/lib/filter-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/lib/filter-styles.css.js new file mode 100644 index 0000000..949b973 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/lib/filter-styles.css.js
@@ -0,0 +1,9 @@ +/** + * @license + * Copyright 2022 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import { css } from 'lit'; +export const styles = css `:host{--_container-height: var(--md-filter-chip-container-height, 32px);--_container-shape: var(--md-filter-chip-container-shape, 8px);--_disabled-label-text-color: var(--md-filter-chip-disabled-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-label-text-opacity: var(--md-filter-chip-disabled-label-text-opacity, 0.38);--_elevated-container-elevation: var(--md-filter-chip-elevated-container-elevation, 1);--_elevated-container-shadow-color: var(--md-filter-chip-elevated-container-shadow-color, var(--md-sys-color-shadow, #000));--_elevated-disabled-container-color: var(--md-filter-chip-elevated-disabled-container-color, var(--md-sys-color-on-surface, #1d1b20));--_elevated-disabled-container-elevation: var(--md-filter-chip-elevated-disabled-container-elevation, 0);--_elevated-disabled-container-opacity: var(--md-filter-chip-elevated-disabled-container-opacity, 0.12);--_elevated-focus-container-elevation: var(--md-filter-chip-elevated-focus-container-elevation, 1);--_elevated-hover-container-elevation: var(--md-filter-chip-elevated-hover-container-elevation, 2);--_elevated-pressed-container-elevation: var(--md-filter-chip-elevated-pressed-container-elevation, 1);--_elevated-selected-container-color: var(--md-filter-chip-elevated-selected-container-color, var(--md-sys-color-secondary-container, #e8def8));--_label-text-type: var(--md-filter-chip-label-text-type, var(--md-sys-typescale-label-large, 500 0.875rem / 1.25rem var(--md-ref-typeface-plain, Roboto)));--_selected-focus-label-text-color: var(--md-filter-chip-selected-focus-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-focus-state-layer-color: var(--md-filter-chip-selected-focus-state-layer-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-focus-state-layer-opacity: var(--md-filter-chip-selected-focus-state-layer-opacity, 0.12);--_selected-hover-label-text-color: var(--md-filter-chip-selected-hover-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-hover-state-layer-color: var(--md-filter-chip-selected-hover-state-layer-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-hover-state-layer-opacity: var(--md-filter-chip-selected-hover-state-layer-opacity, 0.08);--_selected-label-text-color: var(--md-filter-chip-selected-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-pressed-label-text-color: var(--md-filter-chip-selected-pressed-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-pressed-state-layer-color: var(--md-filter-chip-selected-pressed-state-layer-color, var(--md-sys-color-on-surface-variant, #49454f));--_selected-pressed-state-layer-opacity: var(--md-filter-chip-selected-pressed-state-layer-opacity, 0.12);--_elevated-container-color: var(--md-filter-chip-elevated-container-color, var(--md-sys-color-surface-container-low, #f7f2fa));--_disabled-outline-color: var(--md-filter-chip-disabled-outline-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-outline-opacity: var(--md-filter-chip-disabled-outline-opacity, 0.12);--_disabled-selected-container-color: var(--md-filter-chip-disabled-selected-container-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-selected-container-opacity: var(--md-filter-chip-disabled-selected-container-opacity, 0.12);--_focus-outline-color: var(--md-filter-chip-focus-outline-color, var(--md-sys-color-on-surface-variant, #49454f));--_outline-color: var(--md-filter-chip-outline-color, var(--md-sys-color-outline, #79747e));--_outline-width: var(--md-filter-chip-outline-width, 1px);--_selected-container-color: var(--md-filter-chip-selected-container-color, var(--md-sys-color-secondary-container, #e8def8));--_selected-outline-width: var(--md-filter-chip-selected-outline-width, 0px);--_focus-label-text-color: var(--md-filter-chip-focus-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-state-layer-color: var(--md-filter-chip-focus-state-layer-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-state-layer-opacity: var(--md-filter-chip-focus-state-layer-opacity, 0.12);--_hover-label-text-color: var(--md-filter-chip-hover-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-state-layer-color: var(--md-filter-chip-hover-state-layer-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-state-layer-opacity: var(--md-filter-chip-hover-state-layer-opacity, 0.08);--_label-text-color: var(--md-filter-chip-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_pressed-label-text-color: var(--md-filter-chip-pressed-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_pressed-state-layer-color: var(--md-filter-chip-pressed-state-layer-color, var(--md-sys-color-on-secondary-container, #1d192b));--_pressed-state-layer-opacity: var(--md-filter-chip-pressed-state-layer-opacity, 0.12);--_icon-size: var(--md-filter-chip-icon-size, 18px);--_disabled-leading-icon-color: var(--md-filter-chip-disabled-leading-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-leading-icon-opacity: var(--md-filter-chip-disabled-leading-icon-opacity, 0.38);--_selected-focus-leading-icon-color: var(--md-filter-chip-selected-focus-leading-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-hover-leading-icon-color: var(--md-filter-chip-selected-hover-leading-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-leading-icon-color: var(--md-filter-chip-selected-leading-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-pressed-leading-icon-color: var(--md-filter-chip-selected-pressed-leading-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_focus-leading-icon-color: var(--md-filter-chip-focus-leading-icon-color, var(--md-sys-color-primary, #6750a4));--_hover-leading-icon-color: var(--md-filter-chip-hover-leading-icon-color, var(--md-sys-color-primary, #6750a4));--_leading-icon-color: var(--md-filter-chip-leading-icon-color, var(--md-sys-color-primary, #6750a4));--_pressed-leading-icon-color: var(--md-filter-chip-pressed-leading-icon-color, var(--md-sys-color-primary, #6750a4));--_disabled-trailing-icon-color: var(--md-filter-chip-disabled-trailing-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-trailing-icon-opacity: var(--md-filter-chip-disabled-trailing-icon-opacity, 0.38);--_selected-focus-trailing-icon-color: var(--md-filter-chip-selected-focus-trailing-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-hover-trailing-icon-color: var(--md-filter-chip-selected-hover-trailing-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-pressed-trailing-icon-color: var(--md-filter-chip-selected-pressed-trailing-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-trailing-icon-color: var(--md-filter-chip-selected-trailing-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_focus-trailing-icon-color: var(--md-filter-chip-focus-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-trailing-icon-color: var(--md-filter-chip-hover-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_pressed-trailing-icon-color: var(--md-filter-chip-pressed-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_trailing-icon-color: var(--md-filter-chip-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_container-shape-start-start: var( --md-filter-chip-container-shape-start-start, var(--_container-shape) );--_container-shape-start-end: var( --md-filter-chip-container-shape-start-end, var(--_container-shape) );--_container-shape-end-end: var( --md-filter-chip-container-shape-end-end, var(--_container-shape) );--_container-shape-end-start: var( --md-filter-chip-container-shape-end-start, var(--_container-shape) )}.selected{--md-ripple-focus-color:var(--_selected-focus-state-layer-color);--md-ripple-focus-opacity:var(--_selected-focus-state-layer-opacity);--md-ripple-hover-color:var(--_selected-hover-state-layer-color);--md-ripple-hover-opacity:var(--_selected-hover-state-layer-opacity);--md-ripple-pressed-color:var(--_selected-pressed-state-layer-color);--md-ripple-pressed-opacity:var(--_selected-pressed-state-layer-opacity)}.selected .icon{width:var(--_icon-size)}.checkmark{inset:0;opacity:0;position:absolute}.selected .checkmark{opacity:1}.selected::before{background:var(--_selected-container-color)}.selected .outline{border-width:var(--_selected-outline-width)}.selected.elevated::before{background:var(--_elevated-selected-container-color)}.selected.disabled::before{background:var(--_disabled-selected-container-color);opacity:var(--_disabled-selected-container-opacity)}.selected .label{color:var(--_selected-label-text-color)}.selected:hover .label{color:var(--_selected-hover-label-text-color)}.selected:focus .label{color:var(--_selected-focus-label-text-color)}.selected:active .label{color:var(--_selected-pressed-label-text-color)}.selected .icon{color:var(--_selected-leading-icon-color)}.selected:hover .icon{color:var(--_selected-hover-leading-icon-color)}.selected:focus .icon{color:var(--_selected-focus-leading-icon-color)}.selected:active .icon{color:var(--_selected-pressed-leading-icon-color)}.icon.trailing{color:var(--_trailing-icon-color)}:hover .icon.trailing{color:var(--_hover-trailing-icon-color)}:focus .icon.trailing{color:var(--_focus-trailing-icon-color)}:active .icon.trailing{color:var(--_pressed-trailing-icon-color)}.disabled .icon.trailing{color:var(--_disabled-trailing-icon-color);opacity:var(--_disabled-trailing-icon-opacity)}.selected .icon.trailing{color:var(--_selected-trailing-icon-color)}.selected:hover .icon.trailing{color:var(--_selected-hover-trailing-icon-color)}.selected:focus .icon.trailing{color:var(--_selected-focus-trailing-icon-color)}.selected:active .icon.trailing{color:var(--_selected-pressed-trailing-icon-color)}/*# sourceMappingURL=filter-styles.css.map */ +`; +//# sourceMappingURL=filter-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/shared-styles.css.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/lib/shared-styles.css.d.ts similarity index 100% rename from third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/shared-styles.css.d.ts rename to third_party/material_web_components/components-chromium/node_modules/@material/web/chips/lib/shared-styles.css.d.ts
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/lib/shared-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/lib/shared-styles.css.js new file mode 100644 index 0000000..29b6b6c --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/lib/shared-styles.css.js
@@ -0,0 +1,9 @@ +/** + * @license + * Copyright 2022 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import { css } from 'lit'; +export const styles = css `:host{border-start-start-radius:var(--_container-shape-start-start);border-start-end-radius:var(--_container-shape-start-end);border-end-start-radius:var(--_container-shape-end-start);border-end-end-radius:var(--_container-shape-end-end);display:inline-flex;height:var(--_container-height);--md-ripple-focus-color:var(--_focus-state-layer-color);--md-ripple-focus-opacity:var(--_focus-state-layer-opacity);--md-ripple-hover-color:var(--_hover-state-layer-color);--md-ripple-hover-opacity:var(--_hover-state-layer-opacity);--md-ripple-pressed-color:var(--_pressed-state-layer-color);--md-ripple-pressed-opacity:var(--_pressed-state-layer-opacity);--md-focus-ring-shape-start-start: var(--_container-shape-start-start);--md-focus-ring-shape-start-end: var(--_container-shape-start-end);--md-focus-ring-shape-end-end: var(--_container-shape-end-end);--md-focus-ring-shape-end-start: var(--_container-shape-end-start)}.container{border-radius:inherit;box-sizing:border-box;display:flex;height:100%;position:relative;width:100%}.container::before{border-radius:inherit;content:"";inset:0;pointer-events:none;position:absolute}.container:not(.disabled){cursor:pointer}.container.disabled{pointer-events:none}.action{align-items:baseline;appearance:none;background:none;border:none;border-radius:inherit;display:flex;outline:none;padding:0;text-decoration:none}.action:first-of-type{padding-inline-start:8px}.action:last-of-type{padding-inline-end:8px}.outline{border:var(--_outline-width) solid var(--_outline-color);border-radius:inherit;inset:0;pointer-events:none;position:absolute}:focus .outline{border-color:var(--_focus-outline-color)}.disabled .outline{border-color:var(--_disabled-outline-color);opacity:var(--_disabled-outline-opacity)}md-ripple{border-radius:inherit}.label,.icon{z-index:1}.label{align-items:center;color:var(--_label-text-color);display:flex;font:var(--_label-text-type);height:100%;padding:0 8px;text-overflow:ellipsis;user-select:none;white-space:nowrap}:hover .label{color:var(--_hover-label-text-color)}:focus .label{color:var(--_focus-label-text-color)}:active .label{color:var(--_pressed-label-text-color)}.disabled .label{color:var(--_disabled-label-text-color);opacity:var(--_disabled-label-text-opacity)}.icon{align-self:center;color:var(--_leading-icon-color);height:var(--_icon-size);position:relative}.icon ::slotted(*){font-size:var(--_icon-size);height:var(--_icon-size);width:var(--_icon-size)}:hover .icon{color:var(--_hover-leading-icon-color)}:focus .icon{color:var(--_focus-leading-icon-color)}:active .icon{color:var(--_pressed-leading-icon-color)}.disabled .icon{color:var(--_disabled-leading-icon-color);opacity:var(--_disabled-leading-icon-opacity)}/*# sourceMappingURL=shared-styles.css.map */ +`; +//# sourceMappingURL=shared-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/lib/suggestion-chip.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/lib/suggestion-chip.d.ts new file mode 100644 index 0000000..4166810c --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/lib/suggestion-chip.d.ts
@@ -0,0 +1,11 @@ +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import { AssistChip } from './assist-chip.js'; +/** + * A suggestion chip component. + */ +export declare class SuggestionChip extends AssistChip { +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/lib/suggestion-chip.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/lib/suggestion-chip.js new file mode 100644 index 0000000..ea827b3 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/lib/suggestion-chip.js
@@ -0,0 +1,14 @@ +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import { AssistChip } from './assist-chip.js'; +/** + * A suggestion chip component. + */ +export class SuggestionChip extends AssistChip { +} +// Note: assist and suggestion chips are functionally identical with different +// tokens. +//# sourceMappingURL=suggestion-chip.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/fab-shared-styles.css.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/lib/suggestion-styles.css.d.ts similarity index 100% copy from third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/fab-shared-styles.css.d.ts copy to third_party/material_web_components/components-chromium/node_modules/@material/web/chips/lib/suggestion-styles.css.d.ts
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/lib/suggestion-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/lib/suggestion-styles.css.js new file mode 100644 index 0000000..f3286d7 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/lib/suggestion-styles.css.js
@@ -0,0 +1,9 @@ +/** + * @license + * Copyright 2022 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import { css } from 'lit'; +export const styles = css `:host{--_container-height: 32px;--_container-shape: 8px;--_disabled-label-text-color: var(--md-sys-color-on-surface, #1d1b20);--_disabled-label-text-opacity: 0.38;--_elevated-container-color: var(--md-sys-color-surface-container-low, #f7f2fa);--_elevated-container-elevation: 1;--_elevated-container-shadow-color: var(--md-sys-color-shadow, #000);--_elevated-disabled-container-color: var(--md-sys-color-on-surface, #1d1b20);--_elevated-disabled-container-elevation: 0;--_elevated-disabled-container-opacity: 0.12;--_elevated-focus-container-elevation: 1;--_elevated-hover-container-elevation: 2;--_elevated-pressed-container-elevation: 1;--_focus-label-text-color: var(--md-sys-color-on-surface-variant, #49454f);--_focus-state-layer-color: var(--md-sys-color-on-surface-variant, #49454f);--_focus-state-layer-opacity: 0.12;--_hover-label-text-color: var(--md-sys-color-on-surface-variant, #49454f);--_hover-state-layer-color: var(--md-sys-color-on-surface-variant, #49454f);--_hover-state-layer-opacity: 0.08;--_label-text-color: var(--md-sys-color-on-surface-variant, #49454f);--_label-text-type: var(--md-sys-typescale-label-large, 500 0.875rem / 1.25rem var(--md-ref-typeface-plain, Roboto));--_pressed-label-text-color: var(--md-sys-color-on-surface-variant, #49454f);--_pressed-state-layer-color: var(--md-sys-color-on-surface-variant, #49454f);--_pressed-state-layer-opacity: 0.12;--_disabled-outline-color: var(--md-sys-color-on-surface, #1d1b20);--_disabled-outline-opacity: 0.12;--_focus-outline-color: var(--md-sys-color-on-surface-variant, #49454f);--_outline-color: var(--md-sys-color-outline, #79747e);--_outline-width: 1px;--_disabled-leading-icon-color: var(--md-sys-color-on-surface, #1d1b20);--_disabled-leading-icon-opacity: 0.38;--_focus-leading-icon-color: var(--md-sys-color-primary, #6750a4);--_hover-leading-icon-color: var(--md-sys-color-primary, #6750a4);--_leading-icon-color: var(--md-sys-color-primary, #6750a4);--_pressed-leading-icon-color: var(--md-sys-color-primary, #6750a4);--_icon-size: 18px;--_container-shape-start-start: var( --md-suggestion-chip-container-shape-start-start, var(--_container-shape) );--_container-shape-start-end: var( --md-suggestion-chip-container-shape-start-end, var(--_container-shape) );--_container-shape-end-end: var( --md-suggestion-chip-container-shape-end-end, var(--_container-shape) );--_container-shape-end-start: var( --md-suggestion-chip-container-shape-end-start, var(--_container-shape) )}/*# sourceMappingURL=suggestion-styles.css.map */ +`; +//# sourceMappingURL=suggestion-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/suggestion-chip.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/suggestion-chip.d.ts new file mode 100644 index 0000000..dd36c72 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/suggestion-chip.d.ts
@@ -0,0 +1,20 @@ +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import { SuggestionChip } from './lib/suggestion-chip.js'; +declare global { + interface HTMLElementTagNameMap { + 'md-suggestion-chip': MdSuggestionChip; + } +} +/** + * TODO(b/243982145): add docs + * + * @final + * @suppress {visibility} + */ +export declare class MdSuggestionChip extends SuggestionChip { + static styles: import("lit").CSSResult[]; +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/suggestion-chip.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/suggestion-chip.js new file mode 100644 index 0000000..d57df7ef --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/chips/suggestion-chip.js
@@ -0,0 +1,25 @@ +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import { __decorate } from "tslib"; +import { customElement } from 'lit/decorators.js'; +import { styles as elevatedStyles } from './lib/elevated-styles.css.js'; +import { styles as sharedStyles } from './lib/shared-styles.css.js'; +import { SuggestionChip } from './lib/suggestion-chip.js'; +import { styles } from './lib/suggestion-styles.css.js'; +/** + * TODO(b/243982145): add docs + * + * @final + * @suppress {visibility} + */ +let MdSuggestionChip = class MdSuggestionChip extends SuggestionChip { +}; +MdSuggestionChip.styles = [sharedStyles, elevatedStyles, styles]; +MdSuggestionChip = __decorate([ + customElement('md-suggestion-chip') +], MdSuggestionChip); +export { MdSuggestionChip }; +//# sourceMappingURL=suggestion-chip.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/circularprogress/circular-progress.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/circularprogress/circular-progress.d.ts new file mode 100644 index 0000000..0816205 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/circularprogress/circular-progress.d.ts
@@ -0,0 +1,24 @@ +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import { CircularProgress } from './lib/circular-progress.js'; +declare global { + interface HTMLElementTagNameMap { + 'md-circular-progress': MdCircularProgress; + } +} +/** + * @summary Circular progress indicators display progress by animating along an + * invisible circular track in a clockwise direction. They can be applied + * directly to a surface, such as a button or card. + * + * @description + * Progress indicators inform users about the status of ongoing processes. + * - Determinate indicators display how long a process will take. + * - Indeterminate indicators express an unspecified amount of wait time. + */ +export declare class MdCircularProgress extends CircularProgress { + static styles: import("lit").CSSResult[]; +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/circularprogress/circular-progress.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/circularprogress/circular-progress.js new file mode 100644 index 0000000..6a2350ab --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/circularprogress/circular-progress.js
@@ -0,0 +1,27 @@ +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import { __decorate } from "tslib"; +import { customElement } from 'lit/decorators.js'; +import { CircularProgress } from './lib/circular-progress.js'; +import { styles } from './lib/circular-progress-styles.css.js'; +/** + * @summary Circular progress indicators display progress by animating along an + * invisible circular track in a clockwise direction. They can be applied + * directly to a surface, such as a button or card. + * + * @description + * Progress indicators inform users about the status of ongoing processes. + * - Determinate indicators display how long a process will take. + * - Indeterminate indicators express an unspecified amount of wait time. + */ +let MdCircularProgress = class MdCircularProgress extends CircularProgress { +}; +MdCircularProgress.styles = [styles]; +MdCircularProgress = __decorate([ + customElement('md-circular-progress') +], MdCircularProgress); +export { MdCircularProgress }; +//# sourceMappingURL=circular-progress.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/circularprogress/harness.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/circularprogress/harness.d.ts new file mode 100644 index 0000000..a0fa7c441 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/circularprogress/harness.d.ts
@@ -0,0 +1,13 @@ +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import { Harness } from '../testing/harness.js'; +import { CircularProgress } from './lib/circular-progress.js'; +/** + * Test harness for circular-progress. + */ +export declare class CircularProgressHarness extends Harness<CircularProgress> { + getInteractiveElement(): Promise<HTMLElement>; +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/filled-styles.css.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/circularprogress/lib/circular-progress-styles.css.d.ts similarity index 100% copy from third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/filled-styles.css.d.ts copy to third_party/material_web_components/components-chromium/node_modules/@material/web/circularprogress/lib/circular-progress-styles.css.d.ts
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/circularprogress/lib/circular-progress-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/circularprogress/lib/circular-progress-styles.css.js new file mode 100644 index 0000000..bcbef7d --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/circularprogress/lib/circular-progress-styles.css.js
@@ -0,0 +1,9 @@ +/** + * @license + * Copyright 2022 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import { css } from 'lit'; +export const styles = css `:host{--_active-indicator-color: var(--md-circular-progress-active-indicator-color, var(--md-sys-color-primary, #6750a4));--_active-indicator-width: var(--md-circular-progress-active-indicator-width, 8.3333333333);--_four-color-active-indicator-four-color: var(--md-circular-progress-four-color-active-indicator-four-color, var(--md-sys-color-tertiary-container, #ffd8e4));--_four-color-active-indicator-one-color: var(--md-circular-progress-four-color-active-indicator-one-color, var(--md-sys-color-primary, #6750a4));--_four-color-active-indicator-three-color: var(--md-circular-progress-four-color-active-indicator-three-color, var(--md-sys-color-tertiary, #7d5260));--_four-color-active-indicator-two-color: var(--md-circular-progress-four-color-active-indicator-two-color, var(--md-sys-color-primary-container, #eaddff));--_size: var(--md-circular-progress-size, 48px);display:inline-flex;vertical-align:middle;min-block-size:var(--_size);min-inline-size:var(--_size);position:relative;align-items:center;justify-content:center;contain:strict;content-visibility:auto}.circular-progress{flex:1;align-self:stretch;margin:4px}.circular-progress,.spinner,.left,.right,.circle,svg,.track,.progress{position:absolute;inset:0}svg{transform:rotate(-90deg)}circle{cx:50%;cy:50%;r:calc(50%*(1 - var(--_active-indicator-width)/100));stroke-width:calc(var(--_active-indicator-width)*1%);stroke-dasharray:100;fill:rgba(0,0,0,0)}.progress{transition:stroke-dashoffset 500ms cubic-bezier(0, 0, 0.2, 1);stroke:var(--_active-indicator-color)}.track{stroke:rgba(0,0,0,0)}.circular-progress.indeterminate{will-change:transform;animation:linear infinite linear-rotate;animation-duration:1568.2352941176ms}.spinner{will-change:transform;animation:infinite both rotate-arc;animation-duration:5332ms;animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1)}.left{overflow:hidden;inset:0 50% 0 0}.right{overflow:hidden;inset:0 0 0 50%}.circle{box-sizing:border-box;border-radius:50%;border:solid calc(var(--_active-indicator-width)/100*(var(--_size) - 8px));border-color:var(--_active-indicator-color) var(--_active-indicator-color) rgba(0,0,0,0) rgba(0,0,0,0);will-change:transform;animation:expand-arc;animation-iteration-count:infinite;animation-fill-mode:both;animation-duration:1333ms,5332ms;animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1)}.four-color .circle{animation-name:expand-arc,four-color}.left .circle{rotate:135deg;inset:0 -100% 0 0}.right .circle{rotate:100deg;inset:0 0 0 -100%;animation-delay:-666.5ms,0ms}@media screen and (forced-colors: active){.progress{stroke:CanvasText}.circle{border-color:CanvasText CanvasText Canvas Canvas}}@keyframes expand-arc{0%{transform:rotate(265deg)}50%{transform:rotate(130deg)}100%{transform:rotate(265deg)}}@keyframes rotate-arc{12.5%{transform:rotate(135deg)}25%{transform:rotate(270deg)}37.5%{transform:rotate(405deg)}50%{transform:rotate(540deg)}62.5%{transform:rotate(675deg)}75%{transform:rotate(810deg)}87.5%{transform:rotate(945deg)}100%{transform:rotate(1080deg)}}@keyframes linear-rotate{to{transform:rotate(360deg)}}@keyframes four-color{0%{border-top-color:var(--_four-color-active-indicator-one-color);border-right-color:var(--_four-color-active-indicator-one-color)}15%{border-top-color:var(--_four-color-active-indicator-one-color);border-right-color:var(--_four-color-active-indicator-one-color)}25%{border-top-color:var(--_four-color-active-indicator-two-color);border-right-color:var(--_four-color-active-indicator-two-color)}40%{border-top-color:var(--_four-color-active-indicator-two-color);border-right-color:var(--_four-color-active-indicator-two-color)}50%{border-top-color:var(--_four-color-active-indicator-three-color);border-right-color:var(--_four-color-active-indicator-three-color)}65%{border-top-color:var(--_four-color-active-indicator-three-color);border-right-color:var(--_four-color-active-indicator-three-color)}75%{border-top-color:var(--_four-color-active-indicator-four-color);border-right-color:var(--_four-color-active-indicator-four-color)}90%{border-top-color:var(--_four-color-active-indicator-four-color);border-right-color:var(--_four-color-active-indicator-four-color)}100%{border-top-color:var(--_four-color-active-indicator-one-color);border-right-color:var(--_four-color-active-indicator-one-color)}}/*# sourceMappingURL=circular-progress-styles.css.map */ +`; +//# sourceMappingURL=circular-progress-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/circularprogress/lib/circular-progress.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/circularprogress/lib/circular-progress.d.ts new file mode 100644 index 0000000..e172d4d --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/circularprogress/lib/circular-progress.d.ts
@@ -0,0 +1,27 @@ +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import { LitElement } from 'lit'; +/** + * A circular progress component. + */ +export declare class CircularProgress extends LitElement { + /** + * Progress to display, a fraction between 0 and 1. + */ + progress: number; + /** + * Whether or not to display an animated spinner representing indeterminate + * progress. + */ + indeterminate: boolean; + /** + * Whether or not to render indeterminate mode using 4 colors instead of one. + */ + fourColor: boolean; + protected render(): import("lit-html").TemplateResult<1>; + private renderDeterminateContainer; + private renderIndeterminateContainer; +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/circularprogress/lib/circular-progress.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/circularprogress/lib/circular-progress.js new file mode 100644 index 0000000..c6e5c12 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/circularprogress/lib/circular-progress.js
@@ -0,0 +1,94 @@ +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +var _a; +import { __decorate } from "tslib"; +import { html, LitElement, nothing } from 'lit'; +import { property } from 'lit/decorators.js'; +import { classMap } from 'lit/directives/class-map.js'; +import { requestUpdateOnAriaChange } from '../../aria/delegate.js'; +/** + * A circular progress component. + */ +export class CircularProgress extends LitElement { + constructor() { + super(...arguments); + /** + * Progress to display, a fraction between 0 and 1. + */ + this.progress = 0; + /** + * Whether or not to display an animated spinner representing indeterminate + * progress. + */ + this.indeterminate = false; + /** + * Whether or not to render indeterminate mode using 4 colors instead of one. + */ + this.fourColor = false; + } + render() { + const classes = { + 'indeterminate': this.indeterminate, + 'four-color': this.fourColor + }; + // Needed for closure conformance + const { ariaLabel } = this; + return html ` + <div + class="circular-progress ${classMap(classes)}" + role="progressbar" + aria-label="${ariaLabel || nothing}" + aria-valuemin="0" + aria-valuemax="1" + aria-valuenow="${this.indeterminate ? nothing : this.progress}"> + ${this.indeterminate ? this.renderIndeterminateContainer() : + this.renderDeterminateContainer()} + </div> + <slot></slot>`; + } + // Determinate mode is rendered with an svg so the progress arc can be + // easily animated via stroke-dashoffset. + renderDeterminateContainer() { + const dashOffset = (1 - this.progress) * 100; + // note, dash-array/offset are relative to Setting `pathLength` but + // Chrome seems to render this inaccurately and using a large viewbox helps. + const pathLength = 100; + return html `<svg viewBox="0 0 4800 4800"> + <circle class="track" pathLength="${pathLength}"></circle> + <circle class="progress" pathLength="${pathLength}" stroke-dashoffset="${dashOffset}"></circle> + </svg>`; + } + // Indeterminate mode rendered with 2 bordered-divs. The borders are + // clipped into half circles by their containers. The divs are then carefully + // animated to produce changes to the spinner arc size. + // This approach has 4.5x the FPS of rendering via svg on Chrome 111. + // See https://lit.dev/playground/#gist=febb773565272f75408ab06a0eb49746. + renderIndeterminateContainer() { + return html ` + <div class="spinner"> + <div class="left"> + <div class="circle"></div> + </div> + <div class="right"> + <div class="circle"></div> + </div> + </div>`; + } +} +_a = CircularProgress; +(() => { + requestUpdateOnAriaChange(_a); +})(); +__decorate([ + property({ type: Number }) +], CircularProgress.prototype, "progress", void 0); +__decorate([ + property({ type: Boolean }) +], CircularProgress.prototype, "indeterminate", void 0); +__decorate([ + property({ type: Boolean, attribute: 'four-color' }) +], CircularProgress.prototype, "fourColor", void 0); +//# sourceMappingURL=circular-progress.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/controller/action-controller.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/controller/action-controller.d.ts deleted file mode 100644 index b0d4399..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/controller/action-controller.d.ts +++ /dev/null
@@ -1,147 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { ReactiveController, ReactiveControllerHost } from 'lit'; -/** - * Delay time from touchstart to when element#beginPress is invoked. - */ -export declare const TOUCH_DELAY_MS = 150; -/** - * Delay time from beginning to wait for synthetic mouse events till giving up. - */ -export declare const WAIT_FOR_MOUSE_CLICK_MS = 500; -/** - * Interface for argument to beginPress. - */ -export interface BeginPressConfig { - /** - * Event that was recorded at the start of the interaction. - * `null` if the press happened via keyboard. - */ - positionEvent: Event | null; -} -/** - * Interface for argument to endPress. - */ -export interface EndPressConfig { - /** - * `true` if the press was cancelled. - */ - cancelled: boolean; - /** - * Data object to pass along to clients in the `action` event, if relevant. - */ - actionData?: {}; -} -/** - * The necessary interface for using an ActionController - */ -export interface ActionControllerHost extends ReactiveControllerHost, HTMLElement { - disabled: boolean; - /** - * Determines if pointerdown or click events containing modifier keys should - * be ignored. - */ - ignoreClicksWithModifiers?: boolean; - /** - * Called when a user interaction is determined to be a press. - */ - beginPress(config: BeginPressConfig): void; - /** - * Called when a press ends or is cancelled. - */ - endPress(config: EndPressConfig): void; -} -/** - * ActionController normalizes user interaction on components and distills it - * into calling `beginPress` and `endPress` on the component. - * - * `beginPress` is a good hook to affect visuals for pressed state, including - * ripple. - * - * `endPress` is a good hook for firing events based on user interaction, and - * cleaning up the pressed visual state. - * - * A component using an ActionController need only implement the ActionElement - * interface and add the ActionController's event listeners to understand user - * interaction. - */ -export declare class ActionController implements ReactiveController { - private readonly element; - constructor(element: ActionControllerHost); - private get disabled(); - private get ignoreClicksWithModifiers(); - private phase; - private touchTimer; - private clickTimer; - private lastPositionEvent; - private pressed; - private checkBoundsAfterContextMenu; - private setPhase; - /** - * Calls beginPress and then endPress. Allows us to programmatically click - * on the element. - */ - private press; - /** - * Call `beginPress` on element with triggering event, if applicable. - */ - private beginPress; - /** - * Call `endPress` on element, and clean up timers. - */ - private endPress; - private cleanup; - /** - * Call `endPress` with cancelled state on element, and cleanup timers. - */ - private cancelPress; - private isTouch; - private touchDelayFinished; - private waitForClick; - /** - * Check if event should trigger actions on the element. - */ - private shouldRespondToEvent; - /** - * Check if the event is within the bounds of the element. - * - * This is only needed for the "stuck" contextmenu longpress on Chrome. - */ - private inBounds; - private eventHasModifiers; - /** - * Cancel interactions if the element is removed from the DOM. - */ - hostDisconnected(): void; - /** - * If the element becomes disabled, cancel interactions. - */ - hostUpdated(): void; - /** - * Pointer down event handler. - */ - pointerDown: (e: PointerEvent) => void; - /** - * Pointer up event handler. - */ - pointerUp: (e: PointerEvent) => void; - /** - * Click event handler. - */ - click: (e: MouseEvent) => void; - /** - * Pointer leave event handler. - */ - pointerLeave: (e: PointerEvent) => void; - /** - * Pointer cancel event handler. - */ - pointerCancel: (e: PointerEvent) => void; - /** - * Contextmenu event handler. - */ - contextMenu: () => void; -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/controller/action-controller.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/controller/action-controller.js deleted file mode 100644 index 8e76830..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/controller/action-controller.js +++ /dev/null
@@ -1,286 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -/** - * Enumeration to keep track of the lifecycle of a touch event. - */ -// State transition diagram: -// +-----------------------------+ -// | v -// | +------+------ WAITING_FOR_MOUSE_CLICK<----+ -// | | | ^ | -// | V | | | -// => INACTIVE -> TOUCH_DELAY -> RELEASING HOLDING -// | ^ -// | | -// +-----------------------------------+ -var Phase; -(function (Phase) { - // Initial state of the control, no touch in progress. - // Transitions: - // on touch down: transition to TOUCH_DELAY. - // on mouse down: transition to WAITING_FOR_MOUSE_CLICK. - Phase["INACTIVE"] = "INACTIVE"; - // Touch down has been received, waiting to determine if it's a swipe. - // Transitions: - // on touch up: beginPress(); transition to RELEASING. - // on cancel: transition to INACTIVE. - // after TOUCH_DELAY_MS: beginPress(); transition to HOLDING. - Phase["TOUCH_DELAY"] = "TOUCH_DELAY"; - // A touch has been deemed to be a press - // Transitions: - // on pointerup: endPress(); transition to WAITING_FOR_MOUSE_CLICK. - Phase["HOLDING"] = "HOLDING"; - // The user has released the mouse / touch, but we want to delay calling - // endPress for a little bit to avoid double clicks. - // Transitions: - // mouse sequence after debounceDelay: endPress(); transition to INACTIVE - // when in touch sequence: transitions directly to WAITING_FOR_MOUSE_CLICK - Phase["RELEASING"] = "RELEASING"; - // The user has touched, but we want to delay endPress until synthetic mouse - // click event occurs. Stay in this state for a fixed amount of time before - // giving up and transitioning into rest state. - // Transitions: - // on click: endPress(); transition to INACTIVE. - // after WAIT_FOR_MOUSE_CLICK_MS: transition to INACTIVE. - Phase["WAITING_FOR_MOUSE_CLICK"] = "WAITING_FOR_MOUSE_CLICK"; -})(Phase || (Phase = {})); -/** - * Delay time from touchstart to when element#beginPress is invoked. - */ -export const TOUCH_DELAY_MS = 150; -/** - * Delay time from beginning to wait for synthetic mouse events till giving up. - */ -export const WAIT_FOR_MOUSE_CLICK_MS = 500; -/** - * ActionController normalizes user interaction on components and distills it - * into calling `beginPress` and `endPress` on the component. - * - * `beginPress` is a good hook to affect visuals for pressed state, including - * ripple. - * - * `endPress` is a good hook for firing events based on user interaction, and - * cleaning up the pressed visual state. - * - * A component using an ActionController need only implement the ActionElement - * interface and add the ActionController's event listeners to understand user - * interaction. - */ -export class ActionController { - constructor(element) { - this.element = element; - this.phase = Phase.INACTIVE; - this.touchTimer = null; - this.clickTimer = null; - this.lastPositionEvent = null; - this.pressed = false; - this.checkBoundsAfterContextMenu = false; - // event listeners - /** - * Pointer down event handler. - */ - this.pointerDown = (e) => { - if (!this.shouldRespondToEvent(e) || this.phase !== Phase.INACTIVE) { - return; - } - if (this.isTouch(e)) { - // after a longpress contextmenu event, an extra `pointerdown` can be - // dispatched to the pressed element. Check that the down is within - // bounds of the element in this case. - if (this.checkBoundsAfterContextMenu && !this.inBounds(e)) { - return; - } - this.checkBoundsAfterContextMenu = false; - this.lastPositionEvent = e; - this.setPhase(Phase.TOUCH_DELAY); - this.touchTimer = setTimeout(() => { - this.touchDelayFinished(); - }, TOUCH_DELAY_MS); - } - else { - const leftButtonPressed = e.button === 0; - if (!leftButtonPressed || - (this.ignoreClicksWithModifiers && this.eventHasModifiers(e))) { - return; - } - this.setPhase(Phase.WAITING_FOR_MOUSE_CLICK); - this.beginPress(e); - } - }; - /** - * Pointer up event handler. - */ - this.pointerUp = (e) => { - if (!this.isTouch(e) || !this.shouldRespondToEvent(e)) { - return; - } - if (this.phase === Phase.HOLDING) { - this.waitForClick(); - } - else if (this.phase === Phase.TOUCH_DELAY) { - this.setPhase(Phase.RELEASING); - this.beginPress(); - this.waitForClick(); - } - }; - /** - * Click event handler. - */ - this.click = (e) => { - if (this.disabled || - (this.ignoreClicksWithModifiers && this.eventHasModifiers(e))) { - return; - } - if (this.phase === Phase.WAITING_FOR_MOUSE_CLICK) { - this.endPress(); - this.setPhase(Phase.INACTIVE); - return; - } - // keyboard synthesized click event - if (this.phase === Phase.INACTIVE && !this.pressed) { - this.press(); - } - }; - /** - * Pointer leave event handler. - */ - this.pointerLeave = (e) => { - // cancel a held press that moves outside the element - if (this.shouldRespondToEvent(e) && !this.isTouch(e) && this.pressed) { - this.cancelPress(); - } - }; - /** - * Pointer cancel event handler. - */ - this.pointerCancel = (e) => { - if (this.shouldRespondToEvent(e)) { - this.cancelPress(); - } - }; - /** - * Contextmenu event handler. - */ - this.contextMenu = () => { - if (!this.disabled) { - this.checkBoundsAfterContextMenu = true; - this.cancelPress(); - } - }; - this.element.addController(this); - } - get disabled() { - return this.element.disabled; - } - get ignoreClicksWithModifiers() { - return this.element.ignoreClicksWithModifiers ?? false; - } - setPhase(newPhase) { - this.phase = newPhase; - } - /** - * Calls beginPress and then endPress. Allows us to programmatically click - * on the element. - */ - press() { - this.beginPress(/* positionEvent= */ null); - this.setPhase(Phase.INACTIVE); - this.endPress(); - } - /** - * Call `beginPress` on element with triggering event, if applicable. - */ - beginPress(positionEvent = this.lastPositionEvent) { - this.pressed = true; - this.element.beginPress({ positionEvent }); - } - /** - * Call `endPress` on element, and clean up timers. - */ - endPress() { - this.pressed = false; - this.element.endPress({ cancelled: false }); - this.cleanup(); - } - cleanup() { - if (this.touchTimer) { - clearTimeout(this.touchTimer); - } - this.touchTimer = null; - if (this.clickTimer) { - clearTimeout(this.clickTimer); - } - this.clickTimer = null; - this.lastPositionEvent = null; - } - /** - * Call `endPress` with cancelled state on element, and cleanup timers. - */ - cancelPress() { - this.pressed = false; - this.cleanup(); - if (this.phase === Phase.TOUCH_DELAY) { - this.setPhase(Phase.INACTIVE); - } - else if (this.phase !== Phase.INACTIVE) { - this.setPhase(Phase.INACTIVE); - this.element.endPress({ cancelled: true }); - } - } - isTouch(e) { - return e.pointerType === 'touch'; - } - touchDelayFinished() { - if (this.phase !== Phase.TOUCH_DELAY) { - return; - } - this.setPhase(Phase.HOLDING); - this.beginPress(); - } - waitForClick() { - this.setPhase(Phase.WAITING_FOR_MOUSE_CLICK); - this.clickTimer = setTimeout(() => { - // If a click event does not occur, clean up the interaction state. - if (this.phase === Phase.WAITING_FOR_MOUSE_CLICK) { - this.cancelPress(); - } - }, WAIT_FOR_MOUSE_CLICK_MS); - } - /** - * Check if event should trigger actions on the element. - */ - shouldRespondToEvent(e) { - return !this.disabled && e.isPrimary; - } - /** - * Check if the event is within the bounds of the element. - * - * This is only needed for the "stuck" contextmenu longpress on Chrome. - */ - inBounds(ev) { - const { top, left, bottom, right } = this.element.getBoundingClientRect(); - const { x, y } = ev; - return x >= left && x <= right && y >= top && y <= bottom; - } - eventHasModifiers(e) { - return e.altKey || e.ctrlKey || e.shiftKey || e.metaKey; - } - /** - * Cancel interactions if the element is removed from the DOM. - */ - hostDisconnected() { - this.cancelPress(); - } - /** - * If the element becomes disabled, cancel interactions. - */ - hostUpdated() { - if (this.disabled) { - this.cancelPress(); - } - } -} -//# sourceMappingURL=action-controller.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/controller/events.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/controller/events.js index 979773c..6c2f62c5 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/controller/events.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/controller/events.js
@@ -92,6 +92,10 @@ */ export function isActivationClick(event) { // Event must start at the event target. + if (event.currentTarget !== event.target) { + return false; + } + // Event must not be retargeted from shadowRoot. if (event.composedPath()[0] !== event.target) { return false; }
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/controller/form-controller.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/controller/form-controller.d.ts index 50816f8..3fca739 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/controller/form-controller.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/controller/form-controller.d.ts
@@ -62,5 +62,5 @@ constructor(element: FormElement); hostConnected(): void; hostDisconnected(): void; - private formDataListener; + private readonly formDataListener; }
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/controller/form-controller.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/controller/form-controller.js index 8a46435..e716ae36 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/controller/form-controller.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/controller/form-controller.js
@@ -3,8 +3,6 @@ * Copyright 2021 Google LLC * SPDX-License-Identifier: Apache-2.0 */ -import { __decorate, __metadata } from "tslib"; -import { bound } from '../decorators/bound.js'; import { isFormAssociated } from './form-associated.js'; import { shimLabelSupport, SUPPORTS_FACE_LABEL } from './shim-label-activation.js'; /** @@ -30,6 +28,27 @@ */ constructor(element) { this.element = element; + this.formDataListener = (event) => { + if (this.element.disabled) { + // Check for truthiness since some elements may not support disabling. + return; + } + const value = this.element[getFormValue](); + // If given a `FormData` instance, append all values to the form. This + // allows elements to customize what is added beyond a single name/value + // pair. + if (value instanceof FormData) { + for (const [key, dataValue] of value) { + event.formData.append(key, dataValue); + } + return; + } + // Do not associate the value with the form if there is no value or no name. + if (value === null || !this.element.name) { + return; + } + event.formData.append(this.element.name, value); + }; } hostConnected() { // If the component internals are not in Shadow DOM, subscribing to form @@ -51,32 +70,5 @@ hostDisconnected() { this.form?.removeEventListener('formdata', this.formDataListener); } - formDataListener(event) { - if (this.element.disabled) { - // Check for truthiness since some elements may not support disabling. - return; - } - const value = this.element[getFormValue](); - // If given a `FormData` instance, append all values to the form. This - // allows elements to customize what is added beyond a single name/value - // pair. - if (value instanceof FormData) { - for (const [key, dataValue] of value) { - event.formData.append(key, dataValue); - } - return; - } - // Do not associate the value with the form if there is no value or no name. - if (value === null || !this.element.name) { - return; - } - event.formData.append(this.element.name, value); - } } -__decorate([ - bound, - __metadata("design:type", Function), - __metadata("design:paramtypes", [FormDataEvent]), - __metadata("design:returntype", void 0) -], FormController.prototype, "formDataListener", null); //# sourceMappingURL=form-controller.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/controller/foundation.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/controller/foundation.d.ts deleted file mode 100644 index 76414bb8..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/controller/foundation.d.ts +++ /dev/null
@@ -1,24 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -/** - * Legacy stateful foundation class for components. - */ -export declare class Foundation<Adapter extends object> { - protected adapter: Adapter; - constructor(adapter: Adapter); - protected init(): void; -} -/** - * The constructor for a foundation. - */ -export interface FoundationConstructor<Adapter extends object> { - new (adapter: Adapter): Foundation<Adapter>; - readonly prototype: Foundation<Adapter>; -} -/** - * Retrieves the adapter type from the provided foundation type. - */ -export declare type AdapterOf<FoundationType> = FoundationType extends Foundation<infer A> ? A : never;
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/controller/foundation.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/controller/foundation.js deleted file mode 100644 index df8803a..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/controller/foundation.js +++ /dev/null
@@ -1,18 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -/** - * Legacy stateful foundation class for components. - */ -export class Foundation { - constructor(adapter) { - this.adapter = adapter; - this.init(); - } - init() { - // Subclasses should override this method to perform initialization routines - } -} -//# sourceMappingURL=foundation.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/controller/observer-foundation.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/controller/observer-foundation.d.ts deleted file mode 100644 index a2d5340..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/controller/observer-foundation.d.ts +++ /dev/null
@@ -1,25 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { Foundation } from './foundation.js'; -import { ObserverRecord } from './observer.js'; -/** - * Legacy observer foundation class for components. - */ -export declare class ObserverFoundation<Adapter extends object> extends Foundation<Adapter> { - /** - * Observe a target's properties for changes using the provided map of - * property names and observer functions. - * - * @template T The target type. - * @param target - The target to observe. - * @param observers - An object whose keys are target properties and values - * are observer functions that are called when the associated property - * changes. - * @return A cleanup function that can be called to unobserve the - * target. - */ - protected observe<T extends object>(target: T, observers: ObserverRecord<T, this>): () => void; -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/controller/observer-foundation.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/controller/observer-foundation.js deleted file mode 100644 index e89beb6..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/controller/observer-foundation.js +++ /dev/null
@@ -1,37 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { Foundation } from './foundation.js'; -import { observeProperty } from './observer.js'; -/** - * Legacy observer foundation class for components. - */ -export class ObserverFoundation extends Foundation { - /** - * Observe a target's properties for changes using the provided map of - * property names and observer functions. - * - * @template T The target type. - * @param target - The target to observe. - * @param observers - An object whose keys are target properties and values - * are observer functions that are called when the associated property - * changes. - * @return A cleanup function that can be called to unobserve the - * target. - */ - observe(target, observers) { - const cleanup = []; - for (const property of Object.keys(observers)) { - const observer = observers[property].bind(this); - cleanup.push(observeProperty(target, property, observer)); - } - return () => { - for (const cleanupFn of cleanup) { - cleanupFn(); - } - }; - } -} -//# sourceMappingURL=observer-foundation.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/controller/observer.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/controller/observer.d.ts deleted file mode 100644 index bc6e53a..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/controller/observer.d.ts +++ /dev/null
@@ -1,52 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -/** - * A function used to observe property changes on a target. - * - * @template T The observed target type. - * @template K The observed property. - * @template This The `this` context of the observer function. - * @param current - The current value of the property. - * @param previous - The previous value of the property. - */ -export declare type Observer<T extends object, K extends keyof T = keyof T, This = unknown> = (this: This, current: T[K], previous: T[K]) => void; -/** - * An object map whose keys are properties of a target to observe and values - * are `Observer` functions for each property. - * - * @template T The observed target type. - * @template This The `this` context of observer functions. - */ -export declare type ObserverRecord<T extends object, This = unknown> = { - [K in keyof T]?: Observer<T, K, This>; -}; -/** - * Observe a target's property for changes. When a property changes, the - * provided `Observer` function will be invoked with the properties current and - * previous values. - * - * The returned cleanup function will stop listening to changes for the - * provided `Observer`. - * - * @template T The observed target type. - * @template K The observed property. - * @param target - The target to observe. - * @param property - The property of the target to observe. - * @param observer - An observer function to invoke each time the property - * changes. - * @return A cleanup function that will stop observing changes for the provided - * `Observer`. - */ -export declare function observeProperty<T extends object, K extends keyof T>(target: T, property: K, observer: Observer<T, K>): () => void; -/** - * Enables or disables all observers for a provided target. Changes to observed - * properties will not call any observers when disabled. - * - * @template T The observed target type. - * @param target - The target to enable or disable observers for. - * @param enabled - True to enable or false to disable observers. - */ -export declare function setObserversEnabled<T extends object>(target: T, enabled: boolean): void;
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/controller/observer.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/controller/observer.js deleted file mode 100644 index 469f51c..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/controller/observer.js +++ /dev/null
@@ -1,149 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -const isTargetObservers = Symbol(); -const isEnabled = Symbol(); -const getObservers = Symbol(); -/** - * Observe a target's property for changes. When a property changes, the - * provided `Observer` function will be invoked with the properties current and - * previous values. - * - * The returned cleanup function will stop listening to changes for the - * provided `Observer`. - * - * @template T The observed target type. - * @template K The observed property. - * @param target - The target to observe. - * @param property - The property of the target to observe. - * @param observer - An observer function to invoke each time the property - * changes. - * @return A cleanup function that will stop observing changes for the provided - * `Observer`. - */ -export function observeProperty(target, property, observer) { - const observerPrototype = installObserver(target); - const observers = observerPrototype[getObservers](property); - observers.push(observer); - return () => { - observers.splice(observers.indexOf(observer), 1); - }; -} -/** - * Installs a `TargetObservers` for the provided target (if not already - * installed). - * - * A target's `TargetObservers` is installed as a Proxy on the target's - * prototype. - * - * @template T The observed target type. - * @param obj - The target to observe. - * @return The installed `TargetObservers` for the provided target. - */ -function installObserver(obj) { - const prototype = Object.getPrototypeOf(obj); - if (prototype[isTargetObservers]) { - return prototype; - } - // Proxy prototypes will not trap plain properties (not a getter/setter) that - // are already defined. They only work on new plain properties. - // We can work around this by deleting the properties, installing the Proxy, - // then re-setting the properties. - const existingKeyValues = new Map(); - const keys = Object.getOwnPropertyNames(obj); - for (const key of keys) { - const descriptor = getDescriptor(obj, key); - if (descriptor && descriptor.writable) { - existingKeyValues.set(key, descriptor.value); - delete obj[key]; - } - } - const proxy = new Proxy(Object.create(prototype), { - get(target, key, receiver) { - return Reflect.get(target, key, receiver); - }, - set(target, key, newValue, receiver) { - const isTargetObserversKey = key === isTargetObservers || - key === isEnabled || key === getObservers; - const previous = Reflect.get(target, key, receiver); - // If a key has an existing setter, invoke it with the receiver to - // preserve the correct `this` context. - // Otherwise, the key is either a new or existing plain property and - // should be set on the target. Setting a plain property on the - // receiver will cause the proxy to no longer be able to observe it. - const descriptor = getDescriptor(target, key); - if (descriptor?.set) { - Reflect.set(target, key, newValue, receiver); - } - else { - Reflect.set(target, key, newValue); - } - if (!isTargetObserversKey && proxy[isEnabled] && - newValue !== previous) { - for (const observer of proxy[getObservers](key)) { - observer(newValue, previous); - } - } - return true; - } - }); - proxy[isTargetObservers] = true; - proxy[isEnabled] = true; - const observersMap = new Map(); - proxy[getObservers] = (key) => { - const observers = observersMap.get(key) || []; - if (!observersMap.has(key)) { - observersMap.set(key, observers); - } - return observers; - }; - Object.setPrototypeOf(obj, proxy); - // Re-set plain pre-existing properties so that the Proxy can trap them - for (const [key, value] of existingKeyValues.entries()) { - obj[key] = value; - } - return proxy; -} -/** - * Enables or disables all observers for a provided target. Changes to observed - * properties will not call any observers when disabled. - * - * @template T The observed target type. - * @param target - The target to enable or disable observers for. - * @param enabled - True to enable or false to disable observers. - */ -export function setObserversEnabled(target, enabled) { - const prototype = Object.getPrototypeOf(target); - if (prototype[isTargetObservers]) { - prototype[isEnabled] = enabled; - } -} -/** - * Retrieves the descriptor for a property from the provided target. This - * function will walk up the target's prototype chain to search for the - * descriptor. - * - * @template T The target type. - * @template K The property type. - * @param target - The target to retrieve a descriptor from. - * @param property - The name of the property to retrieve a descriptor for. - * @return the descriptor, or undefined if it does not exist. Keep in mind that - * plain properties may not have a descriptor defined. - */ -function getDescriptor(target, property) { - let descriptorTarget = target; - let descriptor; - while (descriptorTarget) { - descriptor = Object.getOwnPropertyDescriptor(descriptorTarget, property); - if (descriptor) { - break; - } - // Walk up the instance's prototype chain in case the property is declared - // on a superclass. - descriptorTarget = Object.getPrototypeOf(descriptorTarget); - } - return descriptor; -} -//# sourceMappingURL=observer.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/decorators/aria-property.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/decorators/aria-property.d.ts deleted file mode 100644 index 73889a2e..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/decorators/aria-property.d.ts +++ /dev/null
@@ -1,32 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { ReactiveElement } from 'lit'; -/** - * A property decorator that helps proxy an aria attribute to an internal node. - * - * This decorator is only intended for use with ARIAMixin properties, - * such as `ariaLabel`, to help with screen readers. - * - * This decorator will remove the host `aria-*` attribute at runtime and add it - * to a `data-aria-*` attribute to avoid screenreader conflicts between the - * host and internal node. - * - * `@ariaProperty` decorated properties should sync with LitElement to the - * `data-aria-*` attribute, not the native `aria-*` attribute. - * - * @example - * ```ts - * class MyElement extends LitElement { - * \@ariaProperty - * // TODO(b/210730484): replace with @soyParam annotation - * \@property({ type: String, attribute: 'data-aria-label', noAccessor: true}) - * ariaLabel!: string; - * } - * ``` - * @category Decorator - * @ExportDecoratedItems - */ -export declare function ariaProperty<E extends ReactiveElement, K extends keyof E & (`aria${string}` | 'role')>(prototype: E, property: K): void;
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/decorators/aria-property.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/decorators/aria-property.js deleted file mode 100644 index ed719dd..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/decorators/aria-property.js +++ /dev/null
@@ -1,99 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -/** - * A property decorator that helps proxy an aria attribute to an internal node. - * - * This decorator is only intended for use with ARIAMixin properties, - * such as `ariaLabel`, to help with screen readers. - * - * This decorator will remove the host `aria-*` attribute at runtime and add it - * to a `data-aria-*` attribute to avoid screenreader conflicts between the - * host and internal node. - * - * `@ariaProperty` decorated properties should sync with LitElement to the - * `data-aria-*` attribute, not the native `aria-*` attribute. - * - * @example - * ```ts - * class MyElement extends LitElement { - * \@ariaProperty - * // TODO(b/210730484): replace with @soyParam annotation - * \@property({ type: String, attribute: 'data-aria-label', noAccessor: true}) - * ariaLabel!: string; - * } - * ``` - * @category Decorator - * @ExportDecoratedItems - */ -export function ariaProperty(prototype, property) { - // Replace the ARIAMixin property with data-* attribute syncing instead of - // using the native aria-* attribute reflection. This preserves the attribute - // for SSR and avoids screenreader conflicts after delegating the attribute - // to a child node. - Object.defineProperty(prototype, property, { - configurable: true, - enumerable: true, - get() { - return this.dataset[property] ?? ''; - }, - set(value) { - // Coerce non-string values to a string - const strValue = String(value ?? ''); - if (strValue) { - this.dataset[property] = strValue; - } - else { - delete this.dataset[property]; - } - // lit will call this setter whenever the data-* attribute changes. - // However, this.dataset[property] will automatically be updated to the - // current value. To avoid bugs, always request an update regardless of - // the old value. - this.requestUpdate(); - } - }); - // Define an internal property that syncs from the `aria-*` attribute with lit - // and delegates to the real ARIAMixin property, which renders an update. - // This property will immediately remove the `aria-*` attribute, which doesn't - // work well with SSR (which is why there's a separate synced property). - const internalAriaProperty = Symbol(property); - // "ariaLabel" -> "aria-label" / "ariaLabelledBy" -> "aria-labelledby" - const ariaAttribute = property.replace('aria', 'aria-').toLowerCase(); - const constructor = prototype.constructor; - let removingAttribute = false; - Object.defineProperty(prototype, internalAriaProperty, { - get() { - // tslint is failing here, but the types are correct (ARIAMixin - // properties do not obfuscate with closure) - // tslint:disable-next-line:no-dict-access-on-struct-type - return this[property]; - }, - set(value) { - if (removingAttribute) { - // Ignore this update, which is triggered below - return; - } - // Set the ARIAMixin property, which will sync the `data-*` attribute - // and trigger rendering if the value changed. - // tslint is failing here, but the types are correct (ARIAMixin - // properties do not obfuscate with closure) - // tslint:disable-next-line:no-dict-access-on-struct-type - this[property] = value; - // Remove the `aria-*` attribute, which will call this setter again with - // the incorrect value. Ignore these updates. - removingAttribute = true; - this.removeAttribute(ariaAttribute); - removingAttribute = false; - } - }); - // Tell lit to observe the `aria-*` attribute and set the internal property, - // which acts as a "aria-* attribute changed" observer. - constructor.createProperty(internalAriaProperty, { - attribute: ariaAttribute, - noAccessor: true, - }); -} -//# sourceMappingURL=aria-property.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/decorators/bound.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/decorators/bound.d.ts deleted file mode 100644 index dde64dbc..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/decorators/bound.d.ts +++ /dev/null
@@ -1,40 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { FunctionKeys } from '../types/keys.js'; -/** - * Binds a class's method to its instance. - * - * @example - * class MyClass { - * \@bound - * foo() { return this; } - * } - * - * const instance = new MyClass(); - * const reference = instance.foo; - * foo(); // MyClass - * - * @category Decorator - * @ExportDecoratedItems - */ -export declare function bound<V extends Function>(target: object, propertyKey: string | symbol, methodDescriptor: TypedPropertyDescriptor<V>): TypedPropertyDescriptor<V>; -/** - * Binds a class's function property to its instance. - * - * @example - * class MyClass { - * \@bound - * foo = function(this: MyClass) { return this; } - * } - * - * const instance = new MyClass(); - * const reference = instance.foo; - * foo(); // MyClass - * - * @category Decorator - * @ExportDecoratedItems - */ -export declare function bound<T extends object>(target: T, propertyKey: FunctionKeys<T>): any;
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/decorators/bound.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/decorators/bound.js deleted file mode 100644 index d83ec28a..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/decorators/bound.js +++ /dev/null
@@ -1,49 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -export function bound(target, propertyKey, methodDescriptor) { - const descriptor = methodDescriptor || { - configurable: true, - enumerable: true, - writable: true, - }; - const memoizedBoundValues = new WeakMap(); - let get; - let set; - if (descriptor.get || descriptor.writable) { - get = function () { - const self = this; // Needed for closure conformance - if (descriptor.get) { - // Separate variables needed for closure conformance - const getter = descriptor.get; - const value = getter.call(self); - return value.bind(self); - } - if (!memoizedBoundValues.has(self)) { - const bound = (descriptor.value || self[propertyKey])?.bind(self); - memoizedBoundValues.set(self, bound); - return bound; - } - return memoizedBoundValues.get(self); - }; - } - if (descriptor.set || descriptor.writable) { - set = function (value) { - const self = this; // Needed for closure conformance - value = value.bind(self); - if (descriptor.set) { - descriptor.set.call(self, value); - } - memoizedBoundValues.set(self, value); - }; - } - return { - get, - set, - configurable: descriptor.configurable, - enumerable: descriptor.enumerable, - }; -} -//# sourceMappingURL=bound.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/dialog/harness.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/dialog/harness.d.ts index a20bed89..04d3ad2 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/dialog/harness.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/dialog/harness.d.ts
@@ -10,8 +10,8 @@ */ export declare class DialogHarness extends Harness<Dialog> { getInteractiveElement(): Promise<HTMLDialogElement>; - isOpening(): Promise<boolean>; - isClosing(): Promise<boolean>; + isOpening(): boolean; + isClosing(): boolean; transitionComplete(): Promise<void>; isDialogVisible(): Promise<boolean>; isScrimVisible(): Promise<boolean>;
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/dialog/lib/dialog-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/dialog/lib/dialog-styles.css.js index 5c0ab8b2..2558272d 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/dialog/lib/dialog-styles.css.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/dialog/lib/dialog-styles.css.js
@@ -4,6 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ import { css } from 'lit'; -export const styles = css `:host{--_container-color: var(--md-dialog-container-color, var(--md-sys-color-surface, #fffbfe));--_container-elevation: var(--md-dialog-container-elevation, 6);--_container-shape: var(--md-dialog-container-shape, 28px);--_container-surface-tint-layer-color: var(--md-dialog-container-surface-tint-layer-color, var(--md-sys-color-primary, #6750a4));--_headline-color: var(--md-dialog-headline-color, var(--md-sys-color-on-surface, #1c1b1f));--_headline-font: var(--md-dialog-headline-font, Roboto);--_headline-line-height: var(--md-dialog-headline-line-height, 2rem);--_headline-size: var(--md-dialog-headline-size, 1.5rem);--_headline-tracking: var(--md-dialog-headline-tracking, 0rem);--_headline-weight: var(--md-dialog-headline-weight, 400);--_supporting-text-color: var(--md-dialog-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_supporting-text-font: var(--md-dialog-supporting-text-font, Roboto);--_supporting-text-line-height: var(--md-dialog-supporting-text-line-height, 1.25rem);--_supporting-text-size: var(--md-dialog-supporting-text-size, 0.875rem);--_supporting-text-tracking: var(--md-dialog-supporting-text-tracking, 0.016rem);--_supporting-text-weight: var(--md-dialog-supporting-text-weight, 400);--_with-icon-icon-color: var(--md-dialog-with-icon-icon-color, var(--md-sys-color-secondary, #625b71));--_with-icon-icon-size: var(--md-dialog-with-icon-icon-size, 24px);--_container-max-inline-size: var(--md-dialog-container-max-inline-size, min(560px, 100% - 48px));--_container-min-inline-size: var(--md-dialog-container-min-inline-size, 280px);--_container-max-block-size: var(--md-dialog-container-max-block-size, min(560px, 100% - 48px));--_container-min-block-size: var(--md-dialog-container-min-block-size, 140px);--_container-inset-inline-start: var(--md-dialog-container-inset-inline-start, auto);--_container-inset-inline-end: var(--md-dialog-container-inset-inline-end, auto);--_container-inset-block-start: var(--md-dialog-container-inset-block-start, auto);--_container-inset-block-end: var(--md-dialog-container-inset-block-end, auto);--_opening-transition-duration: var(--md-dialog-opening-transition-duration, 400ms);--_opening-transition-easing: var(--md-dialog-opening-transition-easing, cubic-bezier(0.05, 0.7, 0.1, 1));--_closing-transition-duration: var(--md-dialog-closing-transition-duration, 200ms);--_closing-transition-easing: var(--md-dialog-closing-transition-easing, cubic-bezier(0.3, 0, 0.8, 0.15));--_scrim-color: var(--md-dialog-scrim-color, rgba(0, 0, 0, 0.32));--_container-block-padding: var(--md-dialog-container-block-padding, 24px);--_container-inline-padding: var(--md-dialog-container-inline-padding, 24px);--_header-spacing: var(--md-dialog-header-spacing, 16px);--_action-spacing: var(--md-dialog-action-spacing, 8px);--_content-block-start-spacing: var(--md-dialog-content-block-start-spacing, 16px);--_content-block-end-spacing: var(--md-dialog-content-block-end-spacing, 24px);--_with-divider-divider-height: var(--md-dialog-with-divider-divider-height, 1px);--_with-divider-divider-color: var(--md-dialog-with-divider-divider-color, var(--md-sys-color-outline, #79747e));--_fullscreen-header-block-size: var(--md-dialog-fullscreen-header-block-size, 56px);--_fullscreen-footer-block-size: var(--md-dialog-fullscreen-footer-block-size, 56px);--_fullscreen-container-block-padding: var(--md-dialog-fullscreen-container-block-padding, 8px);--_container-drag-inline-start: initial;--_container-drag-block-start: initial}@media(prefers-reduced-motion: reduce){:host{--_opening-transition-duration: 0;--_closing-transition-duration: 0}}.dialog{position:fixed;align-items:center;justify-content:center;box-sizing:border-box;inset:0;block-size:100vh;inline-size:100vw;max-block-size:100vh;max-inline-size:100vw;border:none;background:rgba(0,0,0,0);padding:0;margin:0;overflow:clip}.dialog:not(:modal){z-index:10000;pointer-events:none}.dialog[open]{display:flex}.dialog::backdrop{background:none}.dialog::before{content:"";position:absolute;z-index:-1;inset:0;block-size:100vh;inline-size:100vw;pointer-events:none}:host([modeless]) .dialog:before{display:none}.container{position:absolute;inset-inline-start:var(--_container-drag-inline-start, var(--_container-inset-inline-start));inset-inline-end:var(--_container-inset-inline-end);inset-block-start:var(--_container-drag-block-start, var(--_container-inset-block-start));inset-block-end:var(--_container-inset-block-end);background-color:var(--_container-color);border-radius:var(--_container-shape);display:flex;flex-direction:column;box-sizing:border-box;pointer-events:auto;min-block-size:var(--_container-min-block-size);max-block-size:var(--_container-max-block-size);min-inline-size:var(--_container-min-inline-size);max-inline-size:var(--_container-max-inline-size);padding-block-start:var(--_container-block-padding);padding-block-end:var(--_container-block-padding)}md-elevation{position:absolute;inset:0;pointer-events:none;border-radius:inherit;--md-elevation-level: var(--_container-elevation);--md-elevation-surface-tine-color: var( --_container-surface-tint-layer-color )}.container>*{box-sizing:border-box;padding-inline-start:var(--_container-inline-padding);padding-inline-end:var(--_container-inline-padding)}.header{display:flex;flex-direction:column;align-items:center;gap:var(--_header-spacing);-webkit-font-smoothing:antialiased;color:var(--_headline-color);font-family:var(--_headline-font);line-height:var(--_headline-line-height);font-size:var(--_headline-size);letter-spacing:var(--_headline-tracking);font-weight:var(--_headline-weight)}.content{flex:1;overflow:auto;margin-block-start:var(--_content-block-start-spacing);margin-block-end:var(--_content-block-end-spacing);-webkit-font-smoothing:antialiased;color:var(--_supporting-text-color);font-family:var(--_supporting-text-font);line-height:var(--_supporting-text-line-height);font-size:var(--_supporting-text-size);letter-spacing:var(--_supporting-text-tracking);font-weight:var(--_supporting-text-weight)}.footer{display:flex;position:relative;flex-wrap:wrap;align-items:center;justify-content:flex-end;box-sizing:border-box;gap:var(--_action-spacing)}.footerHidden{--_content-block-end-spacing: 0px}.footerHidden .footer{display:none}.stacked .footer{flex-direction:column;align-items:flex-end}.scrollable .content{border-block-start:var(--_with-divider-divider-height) solid rgba(0,0,0,0);border-block-end:var(--_with-divider-divider-height) solid rgba(0,0,0,0)}.scroll-divider-header .content{border-block-start-color:var(--_with-divider-divider-color)}.scroll-divider-footer:not(.footerHidden) .content{border-block-end-color:var(--_with-divider-divider-color)}.dragging{user-select:none;cursor:move;touch-action:none}.container{will-change:transform,opacity;transition-property:transform;overflow:hidden}.container>*{transition-timing-function:inherit;transition-duration:inherit;transition-property:opacity,transform;will-change:transform,opacity;opacity:0}:host([transition][showing-open]) .container>*{opacity:1;transform:none}:host([transition][showing-open]) .container{opacity:1;transform:none}.dialog::before{transition:background-color linear;background-color:rgba(0,0,0,0)}:host([showing-open]) .dialog::before{background-color:var(--_scrim-color)}:host([opening]) .dialog::before{transition-duration:calc(var(--_opening-transition-duration)/2)}:host([closing]) .dialog::before{transition-duration:calc(var(--_closing-transition-duration)/2)}:host([opening]) .container{transition-duration:var(--_opening-transition-duration);transition-timing-function:var(--_opening-transition-easing)}:host([closing]) .container{transition-duration:var(--_closing-transition-duration);transition-timing-function:var(--_closing-transition-easing)}:host([trasition][closing]) .container>*{transform:none;opacity:0}:host([transition=grow-down]){--_opening-transform: scale(1, 0.1) translateY(-20%);--_closing-transform: scale(1, 0.9) translateY(-10%);--_origin: top;--_opening-content-transform: scale(1, 2);--_origin-footer: bottom}:host([transition=grow-up]){--_opening-transform: scale(1, 0.1) translateY(20%);--_closing-transform: scale(1, 0.9) translateY(10%);--_origin: bottom;--_opening-content-transform: scale(1, 2);--_origin-footer: bottom}:host([transition=grow-left]){--_opening-transform: scale(0.1, 1) translateX(20%);--_closing-transform: scale(0.9, 1) translateX(10%);--_origin: right;--_opening-content-transform: none;--_origin-footer: none}:host([transition=grow-right]){--_opening-transform: scale(0.1, 1) translateX(-20%);--_closing-transform: scale(0.9, 1) translateX(-10%);--_origin: left;--_opening-content-transform: none;--_origin-footer: none}:host([transition^=grow-]) .container{transform-origin:var(--_origin);transform:var(--_opening-transform)}:host([transition^=grow-]) .container>*{transform-origin:var(--_origin);transform:var(--_opening-content-transform)}:host([transition^=grow-]) .footer{transform-origin:var(--_origin-footer)}:host([transition^=grow-][closing]){transform:var(--_closing-transform)}:host([transition=shrink]) .container{transform:scale(1.2)}:host([transition=grow]) .container{transform:scale(0.8)}:host([transition=shrink][closing]) .container,:host([transition=grow][closing]) .container{transition-duration:0;transform:none}:host([showing-fullscreen]){--_container-max-block-size: none;--_container-max-inline-size: none}:host([showing-fullscreen]) .container{block-size:100vh;inline-size:100vw;border-radius:0px;padding-block-start:0;padding-block-end:0}:host([showing-fullscreen]) .header{justify-content:space-between;flex-direction:row;max-block-size:var(--_fullscreen-header-block-size);padding-block-start:var(--_fullscreen-container-block-padding);padding-inline:4px;--_header-spacing: 4px}:host([showing-fullscreen]) .content{margin-block-start:0;margin-block-end:0}:host([showing-fullscreen]) .footer{max-block-size:var(--_fullscreen-footer-block-size);padding-block-end:var(--_fullscreen-container-block-padding)}:host([showing-fullscreen]) .scroll-divider-footer .content{border-block-end-color:rgba(0,0,0,0)}@media screen and (forced-colors: active),(-ms-high-contrast: active){.container{outline:windowtext solid 2px}}[name=headline-prefix]::slotted(*),[name=headline-suffix]::slotted(*){color:var(--_with-icon-icon-color);font-size:var(--_with-icon-icon-size)}[name=header]::slotted(*){flex:1;align-self:stretch;display:flex;align-items:center}:host([showing-fullscreen]) [name=headline]::slotted(*){flex:1}/*# sourceMappingURL=dialog-styles.css.map */ +export const styles = css `:host{--_container-color: var(--md-dialog-container-color, var(--md-sys-color-surface-container-high, #ece6f0));--_container-elevation: var(--md-dialog-container-elevation, 3);--_container-shape: var(--md-dialog-container-shape, 28px);--_headline-color: var(--md-dialog-headline-color, var(--md-sys-color-on-surface, #1d1b20));--_headline-type: var(--md-dialog-headline-type, var(--md-sys-typescale-headline-small, 400 1.5rem / 2rem var(--md-ref-typeface-brand, Roboto)));--_supporting-text-color: var(--md-dialog-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_supporting-text-type: var(--md-dialog-supporting-text-type, 400 0.875rem / 1.25rem var(--md-ref-typeface-plain, Roboto));--_with-icon-icon-color: var(--md-dialog-with-icon-icon-color, var(--md-sys-color-secondary, #625b71));--_with-icon-icon-size: var(--md-dialog-with-icon-icon-size, 24px);--_container-max-inline-size: var(--md-dialog-container-max-inline-size, min(560px, 100% - 48px));--_container-min-inline-size: var(--md-dialog-container-min-inline-size, 280px);--_container-max-block-size: var(--md-dialog-container-max-block-size, min(560px, 100% - 48px));--_container-min-block-size: var(--md-dialog-container-min-block-size, 140px);--_container-inset-inline-start: var(--md-dialog-container-inset-inline-start, auto);--_container-inset-inline-end: var(--md-dialog-container-inset-inline-end, auto);--_container-inset-block-start: var(--md-dialog-container-inset-block-start, auto);--_container-inset-block-end: var(--md-dialog-container-inset-block-end, auto);--_opening-transition-duration: var(--md-dialog-opening-transition-duration, 400ms);--_opening-transition-easing: var(--md-dialog-opening-transition-easing, cubic-bezier(0.05, 0.7, 0.1, 1));--_closing-transition-duration: var(--md-dialog-closing-transition-duration, 200ms);--_closing-transition-easing: var(--md-dialog-closing-transition-easing, cubic-bezier(0.3, 0, 0.8, 0.15));--_scrim-color: var(--md-dialog-scrim-color, rgba(0, 0, 0, 0.32));--_container-block-padding: var(--md-dialog-container-block-padding, 24px);--_container-inline-padding: var(--md-dialog-container-inline-padding, 24px);--_header-spacing: var(--md-dialog-header-spacing, 16px);--_action-spacing: var(--md-dialog-action-spacing, 8px);--_content-block-start-spacing: var(--md-dialog-content-block-start-spacing, 16px);--_content-block-end-spacing: var(--md-dialog-content-block-end-spacing, 24px);--_with-divider-divider-height: var(--md-dialog-with-divider-divider-height, 1px);--_with-divider-divider-color: var(--md-dialog-with-divider-divider-color, var(--md-sys-color-outline, #79747e));--_fullscreen-header-block-size: var(--md-dialog-fullscreen-header-block-size, 56px);--_fullscreen-footer-block-size: var(--md-dialog-fullscreen-footer-block-size, 56px);--_fullscreen-container-block-padding: var(--md-dialog-fullscreen-container-block-padding, 8px);--_container-drag-inline-start: initial;--_container-drag-block-start: initial}@media(prefers-reduced-motion: reduce){:host{--_opening-transition-duration: 0;--_closing-transition-duration: 0}}.dialog{position:fixed;align-items:center;justify-content:center;box-sizing:border-box;inset:0;block-size:100dvh;inline-size:100dvw;max-block-size:100dvh;max-inline-size:100dvw;border:none;background:rgba(0,0,0,0);padding:0;margin:0;overflow:clip}.dialog:not(:modal){z-index:10000;pointer-events:none}.dialog[open]{display:flex}.dialog::backdrop{background:none}.dialog::before{content:"";position:absolute;z-index:-1;inset:0;block-size:100dvh;inline-size:100dvw;pointer-events:none}:host([modeless]) .dialog:before{display:none}.container{position:absolute;inset-inline-start:var(--_container-drag-inline-start, var(--_container-inset-inline-start));inset-inline-end:var(--_container-inset-inline-end);inset-block-start:var(--_container-drag-block-start, var(--_container-inset-block-start));inset-block-end:var(--_container-inset-block-end);background-color:var(--_container-color);border-radius:var(--_container-shape);display:flex;flex-direction:column;box-sizing:border-box;pointer-events:auto;min-block-size:var(--_container-min-block-size);max-block-size:var(--_container-max-block-size);min-inline-size:var(--_container-min-inline-size);max-inline-size:var(--_container-max-inline-size);padding-block-start:var(--_container-block-padding);padding-block-end:var(--_container-block-padding)}md-elevation{--md-elevation-level:var(--_container-elevation)}.container>*{box-sizing:border-box;padding-inline-start:var(--_container-inline-padding);padding-inline-end:var(--_container-inline-padding)}.header{display:flex;flex-direction:column;align-items:center;gap:var(--_header-spacing);-webkit-font-smoothing:antialiased;color:var(--_headline-color);font:var(--_headline-type)}.content{flex:1;overflow:auto;margin-block-start:var(--_content-block-start-spacing);margin-block-end:var(--_content-block-end-spacing);-webkit-font-smoothing:antialiased;color:var(--_supporting-text-color);font:var(--_supporting-text-type)}.footer{display:flex;position:relative;flex-wrap:wrap;align-items:center;justify-content:flex-end;box-sizing:border-box;gap:var(--_action-spacing)}.footerHidden{--_content-block-end-spacing: 0px}.footerHidden .footer{display:none}.stacked .footer{flex-direction:column;align-items:flex-end}.scrollable .content{border-block-start:var(--_with-divider-divider-height) solid rgba(0,0,0,0);border-block-end:var(--_with-divider-divider-height) solid rgba(0,0,0,0)}.scroll-divider-header .content{border-block-start-color:var(--_with-divider-divider-color)}.scroll-divider-footer:not(.footerHidden) .content{border-block-end-color:var(--_with-divider-divider-color)}.dragging{user-select:none;cursor:move;touch-action:none}.container{will-change:transform,opacity;transition-property:transform;overflow:hidden}.container>*{transition-timing-function:inherit;transition-duration:inherit;transition-property:opacity,transform;will-change:transform,opacity;opacity:0}:host([transition][showing-open]) .container>*{opacity:1;transform:none}:host([transition][showing-open]) .container{opacity:1;transform:none}.dialog::before{transition:background-color linear;background-color:rgba(0,0,0,0)}:host([showing-open]) .dialog::before{background-color:var(--_scrim-color)}:host([opening]) .dialog::before{transition-duration:calc(var(--_opening-transition-duration)/2)}:host([closing]) .dialog::before{transition-duration:calc(var(--_closing-transition-duration)/2)}:host([opening]) .container{transition-duration:var(--_opening-transition-duration);transition-timing-function:var(--_opening-transition-easing)}:host([closing]) .container{transition-duration:var(--_closing-transition-duration);transition-timing-function:var(--_closing-transition-easing)}:host([trasition][closing]) .container>*{transform:none;opacity:0}:host([transition=grow-down]){--_opening-transform: scale(1, 0.1) translateY(-20%);--_closing-transform: scale(1, 0.9) translateY(-10%);--_origin: top;--_opening-content-transform: scale(1, 2);--_origin-footer: bottom}:host([transition=grow-up]){--_opening-transform: scale(1, 0.1) translateY(20%);--_closing-transform: scale(1, 0.9) translateY(10%);--_origin: bottom;--_opening-content-transform: scale(1, 2);--_origin-footer: bottom}:host([transition=grow-left]){--_opening-transform: scale(0.1, 1) translateX(20%);--_closing-transform: scale(0.9, 1) translateX(10%);--_origin: right;--_opening-content-transform: none;--_origin-footer: none}:host([transition=grow-right]){--_opening-transform: scale(0.1, 1) translateX(-20%);--_closing-transform: scale(0.9, 1) translateX(-10%);--_origin: left;--_opening-content-transform: none;--_origin-footer: none}:host([transition^=grow-]) .container{transform-origin:var(--_origin);transform:var(--_opening-transform)}:host([transition^=grow-]) .container>*{transform-origin:var(--_origin);transform:var(--_opening-content-transform)}:host([transition^=grow-]) .footer{transform-origin:var(--_origin-footer)}:host([transition^=grow-][closing]){transform:var(--_closing-transform)}:host([transition=shrink]) .container{transform:scale(1.2)}:host([transition=grow]) .container{transform:scale(0.8)}:host([transition=shrink][closing]) .container,:host([transition=grow][closing]) .container{transition-duration:0;transform:none}:host([showing-fullscreen]){--_container-max-block-size: none;--_container-max-inline-size: none}:host([showing-fullscreen]) .container{block-size:100dvh;inline-size:100dvw;border-radius:0px;padding-block-start:0;padding-block-end:0}:host([showing-fullscreen]) .header{justify-content:space-between;flex-direction:row;max-block-size:var(--_fullscreen-header-block-size);padding-block-start:var(--_fullscreen-container-block-padding);padding-inline:4px;--_header-spacing: 4px}:host([showing-fullscreen]) .content{margin-block-start:0;margin-block-end:0}:host([showing-fullscreen]) .footer{max-block-size:var(--_fullscreen-footer-block-size);padding-block-end:var(--_fullscreen-container-block-padding)}:host([showing-fullscreen]) .scroll-divider-footer .content{border-block-end-color:rgba(0,0,0,0)}@media screen and (forced-colors: active),(-ms-high-contrast: active){.container{outline:windowtext solid 2px}}[name=headline-prefix]::slotted(*),[name=headline-suffix]::slotted(*){color:var(--_with-icon-icon-color);font-size:var(--_with-icon-icon-size)}[name=header]::slotted(*){flex:1;align-self:stretch;display:flex;align-items:center}:host([showing-fullscreen]) [name=headline]::slotted(*){flex:1}/*# sourceMappingURL=dialog-styles.css.map */ `; //# sourceMappingURL=dialog-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/dialog/lib/dialog.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/dialog/lib/dialog.d.ts index f13dcaf5..4028eb6 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/dialog/lib/dialog.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/dialog/lib/dialog.d.ts
@@ -173,18 +173,18 @@ */ private reflectStateProp; private dialogClosedResolver?; - protected performTransition(shouldDispatchAction: boolean): Promise<void>; - protected dispatchActionEvent(type: string): void; + private performTransition; + private dispatchActionEvent; private fullscreenQuery?; private fullscreenQueryListener; - protected updateFullscreen(): void; - protected handleDialogDismiss(e: Event): void; - protected handleDialogClick(e: Event): void; - protected handleContentScroll(): void; - protected getFocusElement(): HTMLElement | null; + private updateFullscreen; + private handleDialogDismiss; + private handleDialogClick; + private handleContentScroll; + private getFocusElement; focus(): void; blur(): void; - protected canStartDrag(e: PointerEvent): boolean; - protected handlePointerMove(e: PointerEvent): void; - protected handleDragEnd(e: PointerEvent): void; + private canStartDrag; + private handlePointerMove; + private handleDragEnd; }
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/dialog/lib/dialog.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/dialog/lib/dialog.js index 759ed166..cd5a0ca 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/dialog/lib/dialog.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/dialog/lib/dialog.js
@@ -3,7 +3,7 @@ * Copyright 2023 Google LLC * SPDX-License-Identifier: Apache-2.0 */ -import { __decorate, __metadata } from "tslib"; +import { __decorate } from "tslib"; import '../../elevation/elevation.js'; import { html, LitElement } from 'lit'; import { property, query, state } from 'lit/decorators.js'; @@ -196,7 +196,7 @@ } } getContentScrollInfo() { - if (!this.hasUpdated) { + if (!this.hasUpdated || !this.contentElement) { return { isScrollable: false, isAtScrollTop: true, isAtScrollBottom: true }; } const { scrollTop, scrollHeight, offsetHeight, clientHeight } = this.contentElement; @@ -229,6 +229,7 @@ @pointermove=${this.handlePointerMove} @pointerup=${this.handleDragEnd} > + <md-elevation></md-elevation> <header class="header"> <slot name="header"> <slot name="headline-prefix"></slot> @@ -242,7 +243,6 @@ <footer class="footer"> <slot name="footer"></slot> </footer> - <md-elevation surface></md-elevation> </div> </dialog>`; } @@ -280,8 +280,7 @@ // prevent body scrolling early only when opening to avoid layout // shift when closing. if (!this.modeless && this.open) { - this.constructor - .setDocumentScrollingDisabled(this.open); + Dialog.setDocumentScrollingDisabled(this.open); } if (this.open) { this.contentElement.scrollTop = 0; @@ -327,12 +326,16 @@ } // Compute desired transition duration. const duration = msFromTimeCSSValue(getComputedStyle(this).getPropertyValue(this.open ? OPENING_TRANSITION_PROP : CLOSING_TRANSITION_PROP)); - await new Promise(r => { - setTimeout(r, duration); - }); + let promise = this.updateComplete; + if (duration > 0) { + promise = new Promise((r) => { + setTimeout(r, duration); + }); + } + await promise; this.opening = false; this.closing = false; - if (!this.open && this.dialogElement.open) { + if (!this.open && this.dialogElement?.open) { // Closing the dialog triggers an asynchronous `close` event. // It's important to wait for this event to fire since it changes the // state of `open` to false. @@ -345,12 +348,11 @@ const closedPromise = new Promise(resolve => { this.dialogClosedResolver = resolve; }); - this.dialogElement.close(this.currentAction || this.defaultAction); + this.dialogElement?.close(this.currentAction || this.defaultAction); await closedPromise; // enable scrolling late to avoid layout shift when closing if (!this.modeless) { - this.constructor - .setDocumentScrollingDisabled(this.open); + Dialog.setDocumentScrollingDisabled(this.open); } } // Focus initial element. @@ -399,7 +401,8 @@ } this.currentAction = e.target.getAttribute(this.actionAttribute) ?? - (!this.modeless && !e.composedPath().includes(this.containerElement) ? + (!this.modeless && this.containerElement && + !e.composedPath().includes(this.containerElement) ? this.scrimClickAction : ''); if (this.currentAction !== '') { @@ -431,13 +434,13 @@ } canStartDrag(e) { if (this.draggable === false || e.defaultPrevented || !(e.buttons & 1) || - !e.composedPath().includes(this.headerElement)) { + !this.headerElement || !e.composedPath().includes(this.headerElement)) { return false; } return true; } handlePointerMove(e) { - if (!this.dragging && !this.canStartDrag(e)) { + if (!this.dragging && !this.canStartDrag(e) || !this.containerElement) { return; } const { top, left, height, width } = this.containerElement.getBoundingClientRect(); @@ -461,106 +464,82 @@ if (!this.dragging) { return; } - this.containerElement.releasePointerCapture(e.pointerId); + this.containerElement?.releasePointerCapture(e.pointerId); this.dragging = false; this.dragInfo = undefined; } } Dialog.preventedScrollingCount = 0; __decorate([ - property({ type: Boolean }), - __metadata("design:type", Object) + property({ type: Boolean }) ], Dialog.prototype, "open", void 0); __decorate([ - property({ type: Boolean }), - __metadata("design:type", Object) + property({ type: Boolean }) ], Dialog.prototype, "fullscreen", void 0); __decorate([ - property({ type: String }), - __metadata("design:type", Object) + property() ], Dialog.prototype, "fullscreenBreakpoint", void 0); __decorate([ - property({ type: Boolean }), - __metadata("design:type", Object) + property({ type: Boolean }) ], Dialog.prototype, "footerHidden", void 0); __decorate([ - property({ type: Boolean }), - __metadata("design:type", Object) + property({ type: Boolean }) ], Dialog.prototype, "stacked", void 0); __decorate([ - property(), - __metadata("design:type", Object) + property() ], Dialog.prototype, "defaultAction", void 0); __decorate([ - property(), - __metadata("design:type", Object) + property() ], Dialog.prototype, "actionAttribute", void 0); __decorate([ - property(), - __metadata("design:type", Object) + property() ], Dialog.prototype, "focusAttribute", void 0); __decorate([ - property({ type: String }), - __metadata("design:type", Object) + property() ], Dialog.prototype, "scrimClickAction", void 0); __decorate([ - property({ type: String }), - __metadata("design:type", Object) + property() ], Dialog.prototype, "escapeKeyAction", void 0); __decorate([ - property({ type: Boolean, reflect: true }), - __metadata("design:type", Object) + property({ type: Boolean, reflect: true }) ], Dialog.prototype, "modeless", void 0); __decorate([ - property({ type: Boolean }), - __metadata("design:type", Object) + property({ type: Boolean }) ], Dialog.prototype, "draggable", void 0); __decorate([ - query('.dialog', true), - __metadata("design:type", HTMLDialogElement) + query('.dialog', true) ], Dialog.prototype, "dialogElement", void 0); __decorate([ - query('slot[name=footer]', true), - __metadata("design:type", HTMLSlotElement) + query('slot[name=footer]', true) ], Dialog.prototype, "footerSlot", void 0); __decorate([ - query('slot:not([name])', true), - __metadata("design:type", HTMLSlotElement) + query('slot:not([name])', true) ], Dialog.prototype, "contentSlot", void 0); __decorate([ - query(`.content`, true), - __metadata("design:type", HTMLDivElement) + query(`.content`, true) ], Dialog.prototype, "contentElement", void 0); __decorate([ - query(`.container`, true), - __metadata("design:type", HTMLDivElement) + query(`.container`, true) ], Dialog.prototype, "containerElement", void 0); __decorate([ - query(`.header`, true), - __metadata("design:type", HTMLDivElement) + query(`.header`, true) ], Dialog.prototype, "headerElement", void 0); __decorate([ - state(), - __metadata("design:type", Object) + state() ], Dialog.prototype, "showingFullscreen", void 0); __decorate([ - state(), - __metadata("design:type", Object) + state() ], Dialog.prototype, "showingOpen", void 0); __decorate([ - state(), - __metadata("design:type", Object) + state() ], Dialog.prototype, "opening", void 0); __decorate([ - state(), - __metadata("design:type", Object) + state() ], Dialog.prototype, "closing", void 0); __decorate([ - property({ reflect: true }), - __metadata("design:type", Object) + property({ reflect: true }) ], Dialog.prototype, "transition", void 0); __decorate([ - state(), - __metadata("design:type", Object) + state() ], Dialog.prototype, "dragging", void 0); //# sourceMappingURL=dialog.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/divider/lib/divider.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/divider/lib/divider.js index 4b29fa5..956fd13b 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/divider/lib/divider.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/divider/lib/divider.js
@@ -3,7 +3,7 @@ * Copyright 2023 Google LLC * SPDX-License-Identifier: Apache-2.0 */ -import { __decorate, __metadata } from "tslib"; +import { __decorate } from "tslib"; import { LitElement } from 'lit'; import { property } from 'lit/decorators.js'; /** @@ -27,15 +27,12 @@ } } __decorate([ - property({ type: Boolean, reflect: true }), - __metadata("design:type", Object) + property({ type: Boolean, reflect: true }) ], Divider.prototype, "inset", void 0); __decorate([ - property({ type: Boolean, reflect: true, attribute: 'inset-start' }), - __metadata("design:type", Object) + property({ type: Boolean, reflect: true, attribute: 'inset-start' }) ], Divider.prototype, "insetStart", void 0); __decorate([ - property({ type: Boolean, reflect: true, attribute: 'inset-end' }), - __metadata("design:type", Object) + property({ type: Boolean, reflect: true, attribute: 'inset-end' }) ], Divider.prototype, "insetEnd", void 0); //# sourceMappingURL=divider.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/elevation/lib/elevation-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/elevation/lib/elevation-styles.css.js index 546ef36..e11988c3 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/elevation/lib/elevation-styles.css.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/elevation/lib/elevation-styles.css.js
@@ -4,6 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ import { css } from 'lit'; -export const styles = css `:host{--_duration: var(--md-elevation-duration, 0s);--_easing: var(--md-elevation-easing, cubic-bezier(0.2, 0, 0, 1));--_level: var(--md-elevation-level, 0);--_shadow-color: var(--md-elevation-shadow-color, var(--md-sys-color-shadow, #000));--_surface-tint: var(--md-elevation-surface-tint, var(--md-sys-color-primary, #6750a4));border-radius:inherit;display:flex;position:relative}:host(:not([surface])) .surface,:host(:not([shadow])) .shadow{display:none}.surface,.shadow,.shadow::before,.shadow::after{border-radius:inherit;content:"";inset:0;position:absolute;transition-property:box-shadow,opacity;transition-duration:var(--_duration);transition-timing-function:var(--_easing)}.shadow::before{box-shadow:0px calc(1px*(clamp(0,var(--_level),1) + clamp(0,var(--_level) - 3,1) + 2*clamp(0,var(--_level) - 4,1))) calc(1px*(2*clamp(0,var(--_level),1) + clamp(0,var(--_level) - 2,1) + clamp(0,var(--_level) - 4,1))) 0px var(--_shadow-color);opacity:.3}.shadow::after{opacity:.15;box-shadow:0px calc(1px*(clamp(0,var(--_level),1) + clamp(0,var(--_level) - 1,1) + 2*clamp(0,var(--_level) - 2,3))) calc(1px*(3*clamp(0,var(--_level),2) + 2*clamp(0,var(--_level) - 2,3))) calc(1px*(clamp(0,var(--_level),4) + 2*clamp(0,var(--_level) - 4,1))) var(--_shadow-color)}.surface{background:var(--_surface-tint);opacity:calc(clamp(0,var(--_level),.05) + clamp(0,var(--_level) - 1,.03) + clamp(0,var(--_level) - 2,.03) + clamp(0,var(--_level) - 3,.01) + clamp(0,var(--_level) - 4,.02))}/*# sourceMappingURL=elevation-styles.css.map */ +export const styles = css `:host{--_level: var(--md-elevation-level, 0);--_shadow-color: var(--md-elevation-shadow-color, var(--md-sys-color-shadow, #000));display:flex;pointer-events:none}:host,.shadow,.shadow::before,.shadow::after{border-radius:inherit;inset:0;position:absolute;transition-duration:inherit;transition-timing-function:inherit}.shadow::before,.shadow::after{content:"";transition-property:box-shadow,opacity}.shadow::before{box-shadow:0px calc(1px*(clamp(0,var(--_level),1) + clamp(0,var(--_level) - 3,1) + 2*clamp(0,var(--_level) - 4,1))) calc(1px*(2*clamp(0,var(--_level),1) + clamp(0,var(--_level) - 2,1) + clamp(0,var(--_level) - 4,1))) 0px var(--_shadow-color);opacity:.3}.shadow::after{box-shadow:0px calc(1px*(clamp(0,var(--_level),1) + clamp(0,var(--_level) - 1,1) + 2*clamp(0,var(--_level) - 2,3))) calc(1px*(3*clamp(0,var(--_level),2) + 2*clamp(0,var(--_level) - 2,3))) calc(1px*(clamp(0,var(--_level),4) + 2*clamp(0,var(--_level) - 4,1))) var(--_shadow-color);opacity:.15}/*# sourceMappingURL=elevation-styles.css.map */ `; //# sourceMappingURL=elevation-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/elevation/lib/elevation.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/elevation/lib/elevation.d.ts index ccdb9871..5b455a7 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/elevation/lib/elevation.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/elevation/lib/elevation.d.ts
@@ -8,13 +8,5 @@ * A component for elevation. */ export declare class Elevation extends LitElement { - /** - * Whether or not the elevation level should display a shadow. - */ - shadow: boolean; - /** - * Whether or not the elevation level should display a surface tint color. - */ - surface: boolean; - render(): import("lit-html").TemplateResult<1>; + protected render(): import("lit-html").TemplateResult<1>; }
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/elevation/lib/elevation.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/elevation/lib/elevation.js index e397b8a..9b34becb 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/elevation/lib/elevation.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/elevation/lib/elevation.js
@@ -3,37 +3,13 @@ * Copyright 2022 Google LLC * SPDX-License-Identifier: Apache-2.0 */ -import { __decorate, __metadata } from "tslib"; import { html, LitElement } from 'lit'; -import { property } from 'lit/decorators.js'; /** * A component for elevation. */ export class Elevation extends LitElement { - constructor() { - super(...arguments); - /** - * Whether or not the elevation level should display a shadow. - */ - this.shadow = false; - /** - * Whether or not the elevation level should display a surface tint color. - */ - this.surface = false; - } render() { - return html ` - <span class="surface"></span> - <span class="shadow"></span> - `; + return html `<span class="shadow"></span>`; } } -__decorate([ - property({ type: Boolean, reflect: true }), - __metadata("design:type", Object) -], Elevation.prototype, "shadow", void 0); -__decorate([ - property({ type: Boolean, reflect: true }), - __metadata("design:type", Object) -], Elevation.prototype, "surface", void 0); //# sourceMappingURL=elevation.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/branded-fab.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/branded-fab.d.ts new file mode 100644 index 0000000..eeedfd58 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/branded-fab.d.ts
@@ -0,0 +1,56 @@ +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import { Fab, Variant } from './lib/fab.js'; +export { FabSize } from './lib/shared.js'; +declare global { + interface HTMLElementTagNameMap { + 'md-branded-fab': MdBrandedFab; + } +} +/** + * @summary Floating action buttons (FABs) help people take primary actions. + * They’re used to represent the most important action on a screen, such as + * Create or Reply. + * + * @description + * __Emphasis:__ High emphasis – For the primary, most important, or most common + * action on a screen + * + * __Rationale:__ The FAB remains the default component for a screen’s primary + * action. It comes in three sizes: small FAB, FAB, and large FAB. The extended + * FAB’s wider format and text label give it more visual prominence than a FAB. + * It’s often used on larger screens where a FAB would seem too small. Branded + * FABs are used to specifically call attention to branded logo icons. + * + * __Example usages:__ + * - FAB + * - Create + * - Compose + * - Extended FAB + * - Create + * - Compose + * - New Thread + * - New File + * + * @final + * @suppress {visibility} + */ +export declare class MdBrandedFab extends Fab { + /** + * Branded FABs have no variants + */ + variant: Variant; + getRenderClasses(): { + primary: boolean; + secondary: boolean; + tertiary: boolean; + small: boolean; + lowered: boolean; + large: boolean; + extended: boolean; + }; + static styles: import("lit").CSSResult[]; +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/branded-fab.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/branded-fab.js new file mode 100644 index 0000000..7644a7d --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/branded-fab.js
@@ -0,0 +1,56 @@ +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import { __decorate } from "tslib"; +import { customElement } from 'lit/decorators.js'; +import { Fab } from './lib/fab.js'; +import { styles } from './lib/fab-branded-styles.css.js'; +import { styles as forcedColors } from './lib/forced-colors-styles.css.js'; +import { styles as sharedStyles } from './lib/shared-styles.css.js'; +/** + * @summary Floating action buttons (FABs) help people take primary actions. + * They’re used to represent the most important action on a screen, such as + * Create or Reply. + * + * @description + * __Emphasis:__ High emphasis – For the primary, most important, or most common + * action on a screen + * + * __Rationale:__ The FAB remains the default component for a screen’s primary + * action. It comes in three sizes: small FAB, FAB, and large FAB. The extended + * FAB’s wider format and text label give it more visual prominence than a FAB. + * It’s often used on larger screens where a FAB would seem too small. Branded + * FABs are used to specifically call attention to branded logo icons. + * + * __Example usages:__ + * - FAB + * - Create + * - Compose + * - Extended FAB + * - Create + * - Compose + * - New Thread + * - New File + * + * @final + * @suppress {visibility} + */ +let MdBrandedFab = class MdBrandedFab extends Fab { + getRenderClasses() { + return { + ...super.getRenderClasses(), + 'primary': false, + 'secondary': false, + 'tertiary': false, + 'small': false, + }; + } +}; +MdBrandedFab.styles = [sharedStyles, styles, forcedColors]; +MdBrandedFab = __decorate([ + customElement('md-branded-fab') +], MdBrandedFab); +export { MdBrandedFab }; +//# sourceMappingURL=branded-fab.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/fab-extended.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/fab-extended.d.ts deleted file mode 100644 index 8795a690..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/fab-extended.d.ts +++ /dev/null
@@ -1,23 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import '../icon/icon.js'; -import { TemplateResult } from 'lit'; -import { FabExtended } from './lib/fab-extended.js'; -declare global { - interface HTMLElementTagNameMap { - 'md-fab-extended': MdFabExtended; - } -} -/** - * @soyCompatible - * @final - * @suppress {visibility} - */ -export declare class MdFabExtended extends FabExtended { - static styles: import("lit").CSSResult[]; - /** @soyTemplate */ - protected renderIcon(icon: string): TemplateResult | string; -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/fab-extended.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/fab-extended.js deleted file mode 100644 index bd61980..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/fab-extended.js +++ /dev/null
@@ -1,29 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { __decorate } from "tslib"; -import '../icon/icon.js'; -import { html } from 'lit'; -import { customElement } from 'lit/decorators.js'; -import { FabExtended } from './lib/fab-extended.js'; -import { styles as extendedStyles } from './lib/fab-extended-styles.css.js'; -import { styles as sharedStyles } from './lib/fab-shared-styles.css.js'; -/** - * @soyCompatible - * @final - * @suppress {visibility} - */ -let MdFabExtended = class MdFabExtended extends FabExtended { - /** @soyTemplate */ - renderIcon(icon) { - return icon ? html `<md-icon class="md3-fab__icon">${icon}</md-icon>` : ''; - } -}; -MdFabExtended.styles = [sharedStyles, extendedStyles]; -MdFabExtended = __decorate([ - customElement('md-fab-extended') -], MdFabExtended); -export { MdFabExtended }; -//# sourceMappingURL=fab-extended.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/fab.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/fab.d.ts index e3c5a7502..b46eaaf 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/fab.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/fab.d.ts
@@ -3,21 +3,41 @@ * Copyright 2022 Google LLC * SPDX-License-Identifier: Apache-2.0 */ -import '../icon/icon.js'; -import { TemplateResult } from 'lit'; import { Fab } from './lib/fab.js'; +export { Variant } from './lib/fab.js'; +export { FabSize } from './lib/shared.js'; declare global { interface HTMLElementTagNameMap { 'md-fab': MdFab; } } /** - * @soyCompatible + * @summary Floating action buttons (FABs) help people take primary actions. + * They’re used to represent the most important action on a screen, such as + * Create or Reply. + * + * @description + * __Emphasis:__ High emphasis – For the primary, most important, or most common + * action on a screen + * + * __Rationale:__ The FAB remains the default component for a screen’s primary + * action. It comes in three sizes: small FAB, FAB, and large FAB. The extended + * FAB’s wider format and text label give it more visual prominence than a FAB. + * It’s often used on larger screens where a FAB would seem too small. + * + * __Example usages:__ + * - FAB + * - Create + * - Compose + * - Extended FAB + * - Create + * - Compose + * - New Thread + * - New File + * * @final * @suppress {visibility} */ export declare class MdFab extends Fab { static styles: import("lit").CSSResult[]; - /** @soyTemplate */ - protected renderIcon(icon: string): TemplateResult | string; }
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/fab.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/fab.js index 161e31d..dae87ab3 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/fab.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/fab.js
@@ -4,24 +4,41 @@ * SPDX-License-Identifier: Apache-2.0 */ import { __decorate } from "tslib"; -import '../icon/icon.js'; -import { html } from 'lit'; import { customElement } from 'lit/decorators.js'; import { Fab } from './lib/fab.js'; -import { styles as sharedStyles } from './lib/fab-shared-styles.css.js'; -import { styles as fabStyles } from './lib/fab-styles.css.js'; +import { styles } from './lib/fab-styles.css.js'; +import { styles as forcedColors } from './lib/forced-colors-styles.css.js'; +import { styles as sharedStyles } from './lib/shared-styles.css.js'; /** - * @soyCompatible + * @summary Floating action buttons (FABs) help people take primary actions. + * They’re used to represent the most important action on a screen, such as + * Create or Reply. + * + * @description + * __Emphasis:__ High emphasis – For the primary, most important, or most common + * action on a screen + * + * __Rationale:__ The FAB remains the default component for a screen’s primary + * action. It comes in three sizes: small FAB, FAB, and large FAB. The extended + * FAB’s wider format and text label give it more visual prominence than a FAB. + * It’s often used on larger screens where a FAB would seem too small. + * + * __Example usages:__ + * - FAB + * - Create + * - Compose + * - Extended FAB + * - Create + * - Compose + * - New Thread + * - New File + * * @final * @suppress {visibility} */ let MdFab = class MdFab extends Fab { - /** @soyTemplate */ - renderIcon(icon) { - return icon ? html `<md-icon class="md3-fab__icon">${icon}</md-icon>` : ''; - } }; -MdFab.styles = [sharedStyles, fabStyles]; +MdFab.styles = [sharedStyles, styles, forcedColors]; MdFab = __decorate([ customElement('md-fab') ], MdFab);
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/harness.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/harness.d.ts index 02c9cb9..cb59a0c 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/harness.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/harness.d.ts
@@ -5,10 +5,9 @@ */ import { Harness } from '../testing/harness.js'; import { Fab } from './lib/fab.js'; -import { FabExtended } from './lib/fab-extended.js'; /** * Test harness for floating action buttons. */ -export declare class FabHarness extends Harness<Fab | FabExtended> { +export declare class FabHarness extends Harness<Fab> { getInteractiveElement(): Promise<HTMLButtonElement>; }
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/fab-extended-styles.css.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/fab-branded-styles.css.d.ts similarity index 100% rename from third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/fab-extended-styles.css.d.ts rename to third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/fab-branded-styles.css.d.ts
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/fab-branded-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/fab-branded-styles.css.js new file mode 100644 index 0000000..89385d1 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/fab-branded-styles.css.js
@@ -0,0 +1,9 @@ +/** + * @license + * Copyright 2022 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import { css } from 'lit'; +export const styles = css `:host{--_container-color: var(--md-fab-branded-container-color, var(--md-sys-color-surface-container-high, #ece6f0));--_container-elevation: var(--md-fab-branded-container-elevation, 3);--_container-height: var(--md-fab-branded-container-height, 56px);--_container-shadow-color: var(--md-fab-branded-container-shadow-color, var(--md-sys-color-shadow, #000));--_container-shape: var(--md-fab-branded-container-shape, 16px);--_container-width: var(--md-fab-branded-container-width, 56px);--_focus-container-elevation: var(--md-fab-branded-focus-container-elevation, 3);--_focus-state-layer-color: var(--md-fab-branded-focus-state-layer-color, var(--md-sys-color-primary, #6750a4));--_focus-state-layer-opacity: var(--md-fab-branded-focus-state-layer-opacity, 0.12);--_hover-container-elevation: var(--md-fab-branded-hover-container-elevation, 4);--_hover-state-layer-color: var(--md-fab-branded-hover-state-layer-color, var(--md-sys-color-primary, #6750a4));--_hover-state-layer-opacity: var(--md-fab-branded-hover-state-layer-opacity, 0.08);--_icon-size: var(--md-fab-branded-icon-size, 36px);--_lowered-container-color: var(--md-fab-branded-lowered-container-color, var(--md-sys-color-surface-container-low, #f7f2fa));--_lowered-container-elevation: var(--md-fab-branded-lowered-container-elevation, 1);--_lowered-focus-container-elevation: var(--md-fab-branded-lowered-focus-container-elevation, 1);--_lowered-hover-container-elevation: var(--md-fab-branded-lowered-hover-container-elevation, 2);--_lowered-pressed-container-elevation: var(--md-fab-branded-lowered-pressed-container-elevation, 1);--_pressed-container-elevation: var(--md-fab-branded-pressed-container-elevation, 3);--_pressed-state-layer-color: var(--md-fab-branded-pressed-state-layer-color, var(--md-sys-color-primary, #6750a4));--_pressed-state-layer-opacity: var(--md-fab-branded-pressed-state-layer-opacity, 0.12);--_focus-label-text-color: var(--md-fab-branded-focus-label-text-color, var(--md-sys-color-primary, #6750a4));--_hover-label-text-color: var(--md-fab-branded-hover-label-text-color, var(--md-sys-color-primary, #6750a4));--_label-text-color: var(--md-fab-branded-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_label-text-type: var(--md-fab-branded-label-text-type, var(--md-sys-typescale-label-large, 500 0.875rem / 1.25rem var(--md-ref-typeface-plain, Roboto)));--_large-container-height: var(--md-fab-branded-large-container-height, 96px);--_large-container-shape: var(--md-fab-branded-large-container-shape, 28px);--_large-container-width: var(--md-fab-branded-large-container-width, 96px);--_large-icon-size: var(--md-fab-branded-large-icon-size, 48px);--_pressed-label-text-color: var(--md-fab-branded-pressed-label-text-color, var(--md-sys-color-primary, #6750a4));--_container-shape-start-start: var( --md-fab-branded-container-shape-start-start, var(--_container-shape) );--_container-shape-start-end: var( --md-fab-branded-container-shape-start-end, var(--_container-shape) );--_container-shape-end-end: var( --md-fab-branded-container-shape-end-end, var(--_container-shape) );--_container-shape-end-start: var( --md-fab-branded-container-shape-end-start, var(--_container-shape) );--_large-container-shape-start-start: var( --md-fab-branded-large-container-shape-start-start, var(--_large-container-shape) );--_large-container-shape-start-end: var( --md-fab-branded-large-container-shape-start-end, var(--_large-container-shape) );--_large-container-shape-end-end: var( --md-fab-branded-large-container-shape-end-end, var(--_large-container-shape) );--_large-container-shape-end-start: var( --md-fab-branded-large-container-shape-end-start, var(--_large-container-shape) )}/*# sourceMappingURL=fab-branded-styles.css.map */ +`; +//# sourceMappingURL=fab-branded-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/fab-extended-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/fab-extended-styles.css.js deleted file mode 100644 index 224c69e..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/fab-extended-styles.css.js +++ /dev/null
@@ -1,9 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { css } from 'lit'; -export const styles = css `:host{--_container-color: var(--md-fab-extended-container-color, var(--md-sys-color-surface, #fffbfe));--_container-elevation: var(--md-fab-extended-container-elevation, 3);--_container-height: var(--md-fab-extended-container-height, 56px);--_container-shadow-color: var(--md-fab-extended-container-shadow-color, var(--md-sys-color-shadow, #000));--_container-shape: var(--md-fab-extended-container-shape, 16px);--_container-surface-tint-layer-color: var(--md-fab-extended-container-surface-tint-layer-color, var(--md-sys-color-primary, #6750a4));--_focus-container-elevation: var(--md-fab-extended-focus-container-elevation, 3);--_focus-icon-color: var(--md-fab-extended-focus-icon-color, var(--md-sys-color-primary, #6750a4));--_focus-label-text-color: var(--md-fab-extended-focus-label-text-color, var(--md-sys-color-primary, #6750a4));--_focus-state-layer-color: var(--md-fab-extended-focus-state-layer-color, var(--md-sys-color-primary, #6750a4));--_focus-state-layer-opacity: var(--md-fab-extended-focus-state-layer-opacity, 0.12);--_hover-container-elevation: var(--md-fab-extended-hover-container-elevation, 4);--_hover-icon-color: var(--md-fab-extended-hover-icon-color, var(--md-sys-color-primary, #6750a4));--_hover-label-text-color: var(--md-fab-extended-hover-label-text-color, var(--md-sys-color-primary, #6750a4));--_hover-state-layer-color: var(--md-fab-extended-hover-state-layer-color, var(--md-sys-color-primary, #6750a4));--_hover-state-layer-opacity: var(--md-fab-extended-hover-state-layer-opacity, 0.08);--_icon-color: var(--md-fab-extended-icon-color, var(--md-sys-color-primary, #6750a4));--_icon-size: var(--md-fab-extended-icon-size, 24px);--_label-text-color: var(--md-fab-extended-label-text-color, var(--md-sys-color-primary, #6750a4));--_label-text-font: var(--md-fab-extended-label-text-font, Roboto);--_label-text-line-height: var(--md-fab-extended-label-text-line-height, 1.25rem);--_label-text-size: var(--md-fab-extended-label-text-size, 0.875rem);--_label-text-tracking: var(--md-fab-extended-label-text-tracking, 0.006rem);--_label-text-type: var(--md-fab-extended-label-text-type, 500 0.875rem / 1.25rem Roboto);--_label-text-weight: var(--md-fab-extended-label-text-weight, 500);--_lowered-container-elevation: var(--md-fab-extended-lowered-container-elevation, 1);--_lowered-focus-container-elevation: var(--md-fab-extended-lowered-focus-container-elevation, 1);--_lowered-hover-container-elevation: var(--md-fab-extended-lowered-hover-container-elevation, 2);--_lowered-pressed-container-elevation: var(--md-fab-extended-lowered-pressed-container-elevation, 1);--_pressed-container-elevation: var(--md-fab-extended-pressed-container-elevation, 3);--_pressed-icon-color: var(--md-fab-extended-pressed-icon-color, var(--md-sys-color-primary, #6750a4));--_pressed-label-text-color: var(--md-fab-extended-pressed-label-text-color, var(--md-sys-color-primary, #6750a4));--_pressed-state-layer-color: var(--md-fab-extended-pressed-state-layer-color, var(--md-sys-color-primary, #6750a4));--_pressed-state-layer-opacity: var(--md-fab-extended-pressed-state-layer-opacity, 0.12)}.md3-fab--extended{box-sizing:border-box;padding-inline-start:16px;padding-inline-end:20px;height:var(--_container-height);font-family:var(--_label-text-font);line-height:var(--_label-text-line-height);font-size:var(--_label-text-size);font-weight:var(--_label-text-weight);letter-spacing:var(--_label-text-tracking)}.md3-fab__label{padding-inline-start:12px;color:var(--_label-text-color)}.md3-fab:hover .md3-fab__label{color:var(--_hover-label-text-color)}.md3-fab:focus .md3-fab__label{color:var(--_focus-label-text-color)}.md3-fab:active .md3-fab__label{color:var(--_pressed-label-text-color)}@media(forced-colors: active){.md3-fab--extended{padding-inline-start:15px;padding-inline-end:19px}}/*# sourceMappingURL=fab-extended-styles.css.map */ -`; -//# sourceMappingURL=fab-extended-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/fab-extended.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/fab-extended.d.ts deleted file mode 100644 index 204503a..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/fab-extended.d.ts +++ /dev/null
@@ -1,19 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { TemplateResult } from 'lit'; -import { ClassInfo } from 'lit/directives/class-map.js'; -import { FabShared } from './fab-shared.js'; -/** - * @soyCompatible - */ -export declare class FabExtended extends FabShared { - /** @soyTemplate */ - protected getRenderClasses(): ClassInfo; - /** @soyTemplate */ - protected renderIcon(icon: string): TemplateResult | string; - /** @soyTemplate */ - protected renderLabel(): TemplateResult; -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/fab-extended.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/fab-extended.js deleted file mode 100644 index 07d6153..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/fab-extended.js +++ /dev/null
@@ -1,28 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { html } from 'lit'; -import { FabShared } from './fab-shared.js'; -/** - * @soyCompatible - */ -export class FabExtended extends FabShared { - /** @soyTemplate */ - getRenderClasses() { - return { - ...super.getRenderClasses(), - 'md3-fab--extended': true, - }; - } - /** @soyTemplate */ - renderIcon(icon) { - return ''; - } - /** @soyTemplate */ - renderLabel() { - return html `<span class="md3-fab__label">${this.label}</span>`; - } -} -//# sourceMappingURL=fab-extended.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/fab-shared-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/fab-shared-styles.css.js deleted file mode 100644 index 4742af5..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/fab-shared-styles.css.js +++ /dev/null
@@ -1,9 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { css } from 'lit'; -export const styles = css `:host{display:inline-flex;outline:none;-webkit-tap-highlight-color:rgba(0,0,0,0);vertical-align:top}:host([disabled]){cursor:default;pointer-events:none}.md3-fab{display:inline-flex;border:none;outline:none;user-select:none;-webkit-appearance:none;vertical-align:middle;text-decoration:none;align-items:center;justify-content:center;position:relative;z-index:0;background-color:var(--_container-color);--md-focus-ring-shape-start-start:var(--_container-shape);--md-focus-ring-shape-start-end:var(--_container-shape);--md-focus-ring-shape-end-end:var(--_container-shape);--md-focus-ring-shape-end-start:var(--_container-shape);--md-ripple-hover-state-layer-color:var(--_hover-state-layer-color);--md-ripple-focus-state-layer-color:var(--_focus-state-layer-color);--md-ripple-pressed-state-layer-color:var(--_pressed-state-layer-color);--md-ripple-hover-state-layer-opacity:var(--_hover-state-layer-opacity);--md-ripple-focus-state-layer-opacity:var(--_focus-state-layer-opacity);--md-ripple-pressed-state-layer-opacity:var(--_pressed-state-layer-opacity);--md-elevation-duration:280ms;--md-elevation-level:var(--_container-elevation);--md-elevation-shadow-color:var(--_container-shadow-color);--md-elevation-surface-tint:var(--_container-surface-tint-layer-color)}.md3-fab.md3-fab--lowered{--md-elevation-level:var(--_lowered-container-elevation)}.md3-fab:focus{--md-elevation-level:var(--_focus-container-elevation)}.md3-fab:focus.md3-fab--lowered{--md-elevation-level:var(--_lowered-focus-container-elevation)}.md3-fab:hover{cursor:pointer;--md-elevation-level:var(--_hover-container-elevation)}.md3-fab:hover.md3-fab--lowered{--md-elevation-level:var(--_lowered-hover-container-elevation)}.md3-fab:active{outline:none;--md-elevation-level:var(--_pressed-container-elevation)}.md3-fab:active.md3-fab--lowered{--md-elevation-level:var(--_lowered-pressed-container-elevation)}md-elevation{inset:0;position:absolute;z-index:-1}.md3-fab__ripple{overflow:hidden;z-index:-1}.md3-fab,.md3-fab__ripple{border-radius:var(--_container-shape)}.md3-fab__icon{display:inline-flex}.md3-fab__touch{position:absolute;top:50%;height:48px;left:50%;width:48px;transform:translate(-50%, -50%)}.md3-fab__icon ::slotted(*),.md3-fab__icon{color:var(--_icon-color);font-size:var(--_icon-size);height:var(--_icon-size);width:var(--_icon-size)}.md3-fab:hover .md3-fab__icon ::slotted(*),.md3-fab:hover .md3-fab__icon{color:var(--_hover-icon-color)}.md3-fab:focus .md3-fab__icon ::slotted(*),.md3-fab:focus .md3-fab__icon{color:var(--_focus-icon-color)}.md3-fab:active .md3-fab__icon ::slotted(*),.md3-fab:active .md3-fab__icon{color:var(--_pressed-icon-color)}@media(forced-colors: active){.md3-fab{--md-focus-ring-offset-vertical:3px;--md-focus-ring-offset-horizontal:3px;border:1px solid ButtonText}}/*# sourceMappingURL=fab-shared-styles.css.map */ -`; -//# sourceMappingURL=fab-shared-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/fab-shared.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/fab-shared.d.ts deleted file mode 100644 index 66a5500..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/fab-shared.d.ts +++ /dev/null
@@ -1,51 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import '../../elevation/elevation.js'; -import '../../focus/focus-ring.js'; -import '../../ripple/ripple.js'; -import { TemplateResult } from 'lit'; -import { ClassInfo } from 'lit/directives/class-map.js'; -import { ActionElement, BeginPressConfig, EndPressConfig } from '../../actionelement/action-element.js'; -import { MdRipple } from '../../ripple/ripple.js'; -/** - * @soyCompatible - */ -export declare abstract class FabShared extends ActionElement { - static shadowRootOptions: ShadowRootInit; - disabled: boolean; - icon: string; - label: string; - lowered: boolean; - reducedTouchTarget: boolean; - ripple: MdRipple; - protected showFocusRing: boolean; - /** - * @soyTemplate - * @soyClasses fabClasses: .md3-fab - */ - protected render(): TemplateResult; - /** @soyTemplate */ - protected getRenderClasses(): ClassInfo; - /** @soyTemplate */ - protected abstract renderIcon(icon: string): TemplateResult | string; - /** @soyTemplate */ - protected renderTouchTarget(): TemplateResult; - /** @soyTemplate */ - protected renderLabel(): TemplateResult | string; - /** @soyTemplate */ - protected renderElevation(): TemplateResult; - /** @soyTemplate */ - protected renderRipple(): TemplateResult; - /** @soyTemplate */ - protected renderFocusRing(): TemplateResult; - beginPress({ positionEvent }: BeginPressConfig): void; - endPress(options: EndPressConfig): void; - handlePointerDown(e: PointerEvent): void; - protected handlePointerEnter(e: PointerEvent): void; - handlePointerLeave(e: PointerEvent): void; - protected handleFocus(): void; - protected handleBlur(): void; -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/fab-shared.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/fab-shared.js deleted file mode 100644 index 048da2e5..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/fab-shared.js +++ /dev/null
@@ -1,139 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { __decorate, __metadata } from "tslib"; -import '../../elevation/elevation.js'; -import '../../focus/focus-ring.js'; -import '../../ripple/ripple.js'; -import { html } from 'lit'; -import { property, query, state } from 'lit/decorators.js'; -import { classMap } from 'lit/directives/class-map.js'; -import { ActionElement } from '../../actionelement/action-element.js'; -import { pointerPress, shouldShowStrongFocus } from '../../focus/strong-focus.js'; -import { MdRipple } from '../../ripple/ripple.js'; -/** - * @soyCompatible - */ -export class FabShared extends ActionElement { - constructor() { - super(...arguments); - this.disabled = false; - this.icon = ''; - this.label = ''; - this.lowered = false; - this.reducedTouchTarget = false; - this.showFocusRing = false; - } - /** - * @soyTemplate - * @soyClasses fabClasses: .md3-fab - */ - render() { - const ariaLabel = this.label ? this.label : this.icon; - return html ` - <button - class="md3-fab md3-surface ${classMap(this.getRenderClasses())}" - ?disabled="${this.disabled}" - aria-label="${ariaLabel}" - @focus="${this.handleFocus}" - @blur="${this.handleBlur}" - @pointerdown="${this.handlePointerDown}" - @pointerup="${this.handlePointerUp}" - @pointercancel="${this.handlePointerCancel}" - @pointerleave="${this.handlePointerLeave}" - @pointerenter="${this.handlePointerEnter}" - @click="${this.handleClick}" - @contextmenu="${this.handleContextMenu}"> - ${this.renderElevation()} - ${this.renderFocusRing()} - ${this.renderRipple()} - <span class="md3-fab__icon"> - <slot name="icon">${this.renderIcon(this.icon)}</slot> - </span> - ${this.renderLabel()} - ${this.renderTouchTarget()} - </button>`; - } - /** @soyTemplate */ - getRenderClasses() { - return { 'md3-fab--lowered': this.lowered }; - } - /** @soyTemplate */ - renderTouchTarget() { - return this.reducedTouchTarget ? html `` : - html `<div class="md3-fab__touch"></div>`; - } - /** @soyTemplate */ - renderLabel() { - return ''; - } - /** @soyTemplate */ - renderElevation() { - return html `<md-elevation shadow surface></md-elevation>`; - } - /** @soyTemplate */ - renderRipple() { - return html `<md-ripple class="md3-fab__ripple" ?disabled="${this.disabled}"></md-ripple>`; - } - /** @soyTemplate */ - renderFocusRing() { - return html `<md-focus-ring .visible="${this.showFocusRing}"></md-focus-ring>`; - } - beginPress({ positionEvent }) { - this.ripple.beginPress(positionEvent); - } - endPress(options) { - this.ripple.endPress(); - super.endPress(options); - } - handlePointerDown(e) { - super.handlePointerDown(e); - pointerPress(); - this.showFocusRing = shouldShowStrongFocus(); - } - handlePointerEnter(e) { - this.ripple.beginHover(e); - } - handlePointerLeave(e) { - super.handlePointerLeave(e); - this.ripple.endHover(); - } - handleFocus() { - this.showFocusRing = shouldShowStrongFocus(); - } - handleBlur() { - this.showFocusRing = false; - } -} -FabShared.shadowRootOptions = { mode: 'open', delegatesFocus: true }; -__decorate([ - property({ type: Boolean }), - __metadata("design:type", Object) -], FabShared.prototype, "disabled", void 0); -__decorate([ - property(), - __metadata("design:type", Object) -], FabShared.prototype, "icon", void 0); -__decorate([ - property(), - __metadata("design:type", Object) -], FabShared.prototype, "label", void 0); -__decorate([ - property({ type: Boolean }), - __metadata("design:type", Object) -], FabShared.prototype, "lowered", void 0); -__decorate([ - property({ type: Boolean }), - __metadata("design:type", Object) -], FabShared.prototype, "reducedTouchTarget", void 0); -__decorate([ - query('md-ripple'), - __metadata("design:type", MdRipple) -], FabShared.prototype, "ripple", void 0); -__decorate([ - state(), - __metadata("design:type", Object) -], FabShared.prototype, "showFocusRing", void 0); -//# sourceMappingURL=fab-shared.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/fab-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/fab-styles.css.js index fbbab40..eda135d2 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/fab-styles.css.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/fab-styles.css.js
@@ -4,6 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ import { css } from 'lit'; -export const styles = css `:host{--_container-color: var(--md-fab-container-color, var(--md-sys-color-surface, #fffbfe));--_container-elevation: var(--md-fab-container-elevation, 3);--_container-height: var(--md-fab-container-height, 56px);--_container-shadow-color: var(--md-fab-container-shadow-color, var(--md-sys-color-shadow, #000));--_container-shape: var(--md-fab-container-shape, 16px);--_container-surface-tint-layer-color: var(--md-fab-container-surface-tint-layer-color, var(--md-sys-color-primary, #6750a4));--_container-width: var(--md-fab-container-width, 56px);--_focus-container-elevation: var(--md-fab-focus-container-elevation, 3);--_focus-icon-color: var(--md-fab-focus-icon-color, var(--md-sys-color-primary, #6750a4));--_focus-state-layer-color: var(--md-fab-focus-state-layer-color, var(--md-sys-color-primary, #6750a4));--_focus-state-layer-opacity: var(--md-fab-focus-state-layer-opacity, 0.12);--_hover-container-elevation: var(--md-fab-hover-container-elevation, 4);--_hover-icon-color: var(--md-fab-hover-icon-color, var(--md-sys-color-primary, #6750a4));--_hover-state-layer-color: var(--md-fab-hover-state-layer-color, var(--md-sys-color-primary, #6750a4));--_hover-state-layer-opacity: var(--md-fab-hover-state-layer-opacity, 0.08);--_icon-color: var(--md-fab-icon-color, var(--md-sys-color-primary, #6750a4));--_icon-size: var(--md-fab-icon-size, 24px);--_lowered-container-elevation: var(--md-fab-lowered-container-elevation, 1);--_lowered-focus-container-elevation: var(--md-fab-lowered-focus-container-elevation, 1);--_lowered-hover-container-elevation: var(--md-fab-lowered-hover-container-elevation, 2);--_lowered-pressed-container-elevation: var(--md-fab-lowered-pressed-container-elevation, 1);--_pressed-container-elevation: var(--md-fab-pressed-container-elevation, 3);--_pressed-icon-color: var(--md-fab-pressed-icon-color, var(--md-sys-color-primary, #6750a4));--_pressed-state-layer-color: var(--md-fab-pressed-state-layer-color, var(--md-sys-color-primary, #6750a4));--_pressed-state-layer-opacity: var(--md-fab-pressed-state-layer-opacity, 0.12)}.md3-fab{width:var(--_container-width);height:var(--_container-height)}.md3-fab--regular{padding:0}/*# sourceMappingURL=fab-styles.css.map */ +export const styles = css `:host{--_container-color: var(--md-fab-container-color, var(--md-sys-color-surface-container-high, #ece6f0));--_container-elevation: var(--md-fab-container-elevation, 3);--_container-height: var(--md-fab-container-height, 56px);--_container-shadow-color: var(--md-fab-container-shadow-color, var(--md-sys-color-shadow, #000));--_container-shape: var(--md-fab-container-shape, 16px);--_container-width: var(--md-fab-container-width, 56px);--_focus-container-elevation: var(--md-fab-focus-container-elevation, 3);--_focus-icon-color: var(--md-fab-focus-icon-color, var(--md-sys-color-primary, #6750a4));--_focus-state-layer-color: var(--md-fab-focus-state-layer-color, var(--md-sys-color-primary, #6750a4));--_focus-state-layer-opacity: var(--md-fab-focus-state-layer-opacity, 0.12);--_hover-container-elevation: var(--md-fab-hover-container-elevation, 4);--_hover-icon-color: var(--md-fab-hover-icon-color, var(--md-sys-color-primary, #6750a4));--_hover-state-layer-color: var(--md-fab-hover-state-layer-color, var(--md-sys-color-primary, #6750a4));--_hover-state-layer-opacity: var(--md-fab-hover-state-layer-opacity, 0.08);--_icon-color: var(--md-fab-icon-color, var(--md-sys-color-primary, #6750a4));--_icon-size: var(--md-fab-icon-size, 24px);--_lowered-container-color: var(--md-fab-lowered-container-color, var(--md-sys-color-surface-container-low, #f7f2fa));--_lowered-container-elevation: var(--md-fab-lowered-container-elevation, 1);--_lowered-focus-container-elevation: var(--md-fab-lowered-focus-container-elevation, 1);--_lowered-hover-container-elevation: var(--md-fab-lowered-hover-container-elevation, 2);--_lowered-pressed-container-elevation: var(--md-fab-lowered-pressed-container-elevation, 1);--_pressed-container-elevation: var(--md-fab-pressed-container-elevation, 3);--_pressed-icon-color: var(--md-fab-pressed-icon-color, var(--md-sys-color-primary, #6750a4));--_pressed-state-layer-color: var(--md-fab-pressed-state-layer-color, var(--md-sys-color-primary, #6750a4));--_pressed-state-layer-opacity: var(--md-fab-pressed-state-layer-opacity, 0.12);--_focus-label-text-color: var(--md-fab-focus-label-text-color, var(--md-sys-color-primary, #6750a4));--_hover-label-text-color: var(--md-fab-hover-label-text-color, var(--md-sys-color-primary, #6750a4));--_label-text-color: var(--md-fab-label-text-color, var(--md-sys-color-primary, #6750a4));--_label-text-type: var(--md-fab-label-text-type, var(--md-sys-typescale-label-large, 500 0.875rem / 1.25rem var(--md-ref-typeface-plain, Roboto)));--_large-container-height: var(--md-fab-large-container-height, 96px);--_large-container-shape: var(--md-fab-large-container-shape, 28px);--_large-container-width: var(--md-fab-large-container-width, 96px);--_large-icon-size: var(--md-fab-large-icon-size, 36px);--_pressed-label-text-color: var(--md-fab-pressed-label-text-color, var(--md-sys-color-primary, #6750a4));--_primary-container-color: var(--md-fab-primary-container-color, var(--md-sys-color-primary-container, #eaddff));--_primary-focus-icon-color: var(--md-fab-primary-focus-icon-color, var(--md-sys-color-on-primary-container, #21005d));--_primary-focus-label-text-color: var(--md-fab-primary-focus-label-text-color, var(--md-sys-color-on-primary-container, #21005d));--_primary-focus-state-layer-color: var(--md-fab-primary-focus-state-layer-color, var(--md-sys-color-on-primary-container, #21005d));--_primary-hover-icon-color: var(--md-fab-primary-hover-icon-color, var(--md-sys-color-on-primary-container, #21005d));--_primary-hover-label-text-color: var(--md-fab-primary-hover-label-text-color, var(--md-sys-color-on-primary-container, #21005d));--_primary-hover-state-layer-color: var(--md-fab-primary-hover-state-layer-color, var(--md-sys-color-on-primary-container, #21005d));--_primary-icon-color: var(--md-fab-primary-icon-color, var(--md-sys-color-on-primary-container, #21005d));--_primary-label-text-color: var(--md-fab-primary-label-text-color, var(--md-sys-color-on-primary-container, #21005d));--_primary-pressed-icon-color: var(--md-fab-primary-pressed-icon-color, var(--md-sys-color-on-primary-container, #21005d));--_primary-pressed-label-text-color: var(--md-fab-primary-pressed-label-text-color, var(--md-sys-color-on-primary-container, #21005d));--_primary-pressed-state-layer-color: var(--md-fab-primary-pressed-state-layer-color, var(--md-sys-color-on-primary-container, #21005d));--_secondary-container-color: var(--md-fab-secondary-container-color, var(--md-sys-color-secondary-container, #e8def8));--_secondary-focus-icon-color: var(--md-fab-secondary-focus-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_secondary-focus-label-text-color: var(--md-fab-secondary-focus-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_secondary-focus-state-layer-color: var(--md-fab-secondary-focus-state-layer-color, var(--md-sys-color-on-secondary-container, #1d192b));--_secondary-hover-icon-color: var(--md-fab-secondary-hover-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_secondary-hover-label-text-color: var(--md-fab-secondary-hover-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_secondary-hover-state-layer-color: var(--md-fab-secondary-hover-state-layer-color, var(--md-sys-color-on-secondary-container, #1d192b));--_secondary-icon-color: var(--md-fab-secondary-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_secondary-label-text-color: var(--md-fab-secondary-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_secondary-pressed-icon-color: var(--md-fab-secondary-pressed-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_secondary-pressed-label-text-color: var(--md-fab-secondary-pressed-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_secondary-pressed-state-layer-color: var(--md-fab-secondary-pressed-state-layer-color, var(--md-sys-color-on-secondary-container, #1d192b));--_small-container-height: var(--md-fab-small-container-height, 40px);--_small-container-shape: var(--md-fab-small-container-shape, 12px);--_small-container-width: var(--md-fab-small-container-width, 40px);--_small-icon-size: var(--md-fab-small-icon-size, 24px);--_tertiary-container-color: var(--md-fab-tertiary-container-color, var(--md-sys-color-tertiary-container, #ffd8e4));--_tertiary-focus-icon-color: var(--md-fab-tertiary-focus-icon-color, var(--md-sys-color-on-tertiary-container, #31111d));--_tertiary-focus-label-text-color: var(--md-fab-tertiary-focus-label-text-color, var(--md-sys-color-on-tertiary-container, #31111d));--_tertiary-focus-state-layer-color: var(--md-fab-tertiary-focus-state-layer-color, var(--md-sys-color-on-tertiary-container, #31111d));--_tertiary-hover-icon-color: var(--md-fab-tertiary-hover-icon-color, var(--md-sys-color-on-tertiary-container, #31111d));--_tertiary-hover-label-text-color: var(--md-fab-tertiary-hover-label-text-color, var(--md-sys-color-on-tertiary-container, #31111d));--_tertiary-hover-state-layer-color: var(--md-fab-tertiary-hover-state-layer-color, var(--md-sys-color-on-tertiary-container, #31111d));--_tertiary-icon-color: var(--md-fab-tertiary-icon-color, var(--md-sys-color-on-tertiary-container, #31111d));--_tertiary-label-text-color: var(--md-fab-tertiary-label-text-color, var(--md-sys-color-on-tertiary-container, #31111d));--_tertiary-pressed-icon-color: var(--md-fab-tertiary-pressed-icon-color, var(--md-sys-color-on-tertiary-container, #31111d));--_tertiary-pressed-label-text-color: var(--md-fab-tertiary-pressed-label-text-color, var(--md-sys-color-on-tertiary-container, #31111d));--_tertiary-pressed-state-layer-color: var(--md-fab-tertiary-pressed-state-layer-color, var(--md-sys-color-on-tertiary-container, #31111d));--_container-shape-start-start: var( --md-fab-container-shape-start-start, var(--_container-shape) );--_container-shape-start-end: var( --md-fab-container-shape-start-end, var(--_container-shape) );--_container-shape-end-end: var( --md-fab-container-shape-end-end, var(--_container-shape) );--_container-shape-end-start: var( --md-fab-container-shape-end-start, var(--_container-shape) );--_large-container-shape-start-start: var( --md-fab-large-container-shape-start-start, var(--_large-container-shape) );--_large-container-shape-start-end: var( --md-fab-large-container-shape-start-end, var(--_large-container-shape) );--_large-container-shape-end-end: var( --md-fab-large-container-shape-end-end, var(--_large-container-shape) );--_large-container-shape-end-start: var( --md-fab-large-container-shape-end-start, var(--_large-container-shape) );--_small-container-shape-start-start: var( --md-fab-small-container-shape-start-start, var(--_small-container-shape) );--_small-container-shape-start-end: var( --md-fab-small-container-shape-start-end, var(--_small-container-shape) );--_small-container-shape-end-end: var( --md-fab-small-container-shape-end-end, var(--_small-container-shape) );--_small-container-shape-end-start: var( --md-fab-small-container-shape-end-start, var(--_small-container-shape) )}.fab .icon ::slotted(*){color:var(--_icon-color)}.fab:focus{color:var(--_focus-icon-color)}.fab:hover{color:var(--_hover-icon-color)}.fab:active{color:var(--_pressed-icon-color)}.fab.primary{background-color:var(--_primary-container-color);--md-ripple-hover-color:var(--_primary-hover-state-layer-color);--md-ripple-focus-color:var(--_primary-focus-state-layer-color);--md-ripple-pressed-color:var(--_primary-pressed-state-layer-color)}.fab.primary .icon ::slotted(*){color:var(--_primary-icon-color)}.fab.primary:focus{color:var(--_primary-focus-icon-color)}.fab.primary:hover{color:var(--_primary-hover-icon-color)}.fab.primary:active{color:var(--_primary-pressed-icon-color)}.fab.primary .label{color:var(--_primary-label-text-color)}.fab:hover .fab.primary .label{color:var(--_primary-hover-label-text-color)}.fab:focus .fab.primary .label{color:var(--_primary-focus-label-text-color)}.fab:active .fab.primary .label{color:var(--_primary-pressed-label-text-color)}.fab.secondary{background-color:var(--_secondary-container-color);--md-ripple-hover-color:var(--_secondary-hover-state-layer-color);--md-ripple-focus-color:var(--_secondary-focus-state-layer-color);--md-ripple-pressed-color:var(--_secondary-pressed-state-layer-color)}.fab.secondary .icon ::slotted(*){color:var(--_secondary-icon-color)}.fab.secondary:focus{color:var(--_secondary-focus-icon-color)}.fab.secondary:hover{color:var(--_secondary-hover-icon-color)}.fab.secondary:active{color:var(--_secondary-pressed-icon-color)}.fab.secondary .label{color:var(--_secondary-label-text-color)}.fab:hover .fab.secondary .label{color:var(--_secondary-hover-label-text-color)}.fab:focus .fab.secondary .label{color:var(--_secondary-focus-label-text-color)}.fab:active .fab.secondary .label{color:var(--_secondary-pressed-label-text-color)}.fab.tertiary{background-color:var(--_tertiary-container-color);--md-ripple-hover-color:var(--_tertiary-hover-state-layer-color);--md-ripple-focus-color:var(--_tertiary-focus-state-layer-color);--md-ripple-pressed-color:var(--_tertiary-pressed-state-layer-color)}.fab.tertiary .icon ::slotted(*){color:var(--_tertiary-icon-color)}.fab.tertiary:focus{color:var(--_tertiary-focus-icon-color)}.fab.tertiary:hover{color:var(--_tertiary-hover-icon-color)}.fab.tertiary:active{color:var(--_tertiary-pressed-icon-color)}.fab.tertiary .label{color:var(--_tertiary-label-text-color)}.fab:hover .fab.tertiary .label{color:var(--_tertiary-hover-label-text-color)}.fab:focus .fab.tertiary .label{color:var(--_tertiary-focus-label-text-color)}.fab:active .fab.tertiary .label{color:var(--_tertiary-pressed-label-text-color)}.fab.small{width:var(--_small-container-width);height:var(--_small-container-height)}.fab.small .icon ::slotted(*){width:var(--_small-icon-size);height:var(--_small-icon-size);font-size:var(--_small-icon-size)}.fab.small,.fab.small .ripple{border-start-start-radius:var(--_small-container-shape-start-start);border-start-end-radius:var(--_small-container-shape-start-end);border-end-start-radius:var(--_small-container-shape-end-start);border-end-end-radius:var(--_small-container-shape-end-end);--md-focus-ring-shape-start-start: var(--_small-container-shape-start-start);--md-focus-ring-shape-start-end: var(--_small-container-shape-start-end);--md-focus-ring-shape-end-end: var(--_small-container-shape-end-end);--md-focus-ring-shape-end-start: var(--_small-container-shape-end-start)}/*# sourceMappingURL=fab-styles.css.map */ `; //# sourceMappingURL=fab-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/fab.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/fab.d.ts index d9b5ac1b..0bbe698 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/fab.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/fab.d.ts
@@ -1,17 +1,25 @@ /** * @license - * Copyright 2022 Google LLC + * Copyright 2023 Google LLC * SPDX-License-Identifier: Apache-2.0 */ -import { TemplateResult } from 'lit'; -import { ClassInfo } from 'lit/directives/class-map.js'; -import { FabShared } from './fab-shared.js'; +import { SharedFab } from './shared.js'; /** - * @soyCompatible + * The variants available to non-branded FABs. */ -export declare class Fab extends FabShared { - /** @soyTemplate */ - protected getRenderClasses(): ClassInfo; - /** @soyTemplate */ - protected renderIcon(icon: string): TemplateResult | string; +export type Variant = 'surface' | 'primary' | 'secondary' | 'tertiary'; +export declare class Fab extends SharedFab { + /** + * The FAB color variant to render. + */ + variant: Variant; + getRenderClasses(): { + primary: boolean; + secondary: boolean; + tertiary: boolean; + lowered: boolean; + small: boolean; + large: boolean; + extended: boolean; + }; }
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/fab.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/fab.js index 3279257..fea61ff 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/fab.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/fab.js
@@ -1,23 +1,30 @@ /** * @license - * Copyright 2022 Google LLC + * Copyright 2023 Google LLC * SPDX-License-Identifier: Apache-2.0 */ -import { FabShared } from './fab-shared.js'; -/** - * @soyCompatible - */ -export class Fab extends FabShared { - /** @soyTemplate */ +import { __decorate } from "tslib"; +import { property } from 'lit/decorators.js'; +import { SharedFab } from './shared.js'; +// tslint:disable-next-line:enforce-comments-on-exported-symbols +export class Fab extends SharedFab { + constructor() { + super(...arguments); + /** + * The FAB color variant to render. + */ + this.variant = 'surface'; + } getRenderClasses() { return { ...super.getRenderClasses(), - 'md3-fab--regular': true, + 'primary': this.variant === 'primary', + 'secondary': this.variant === 'secondary', + 'tertiary': this.variant === 'tertiary', }; } - /** @soyTemplate */ - renderIcon(icon) { - return ''; - } } +__decorate([ + property() +], Fab.prototype, "variant", void 0); //# sourceMappingURL=fab.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/fab-extended-styles.css.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/forced-colors-styles.css.d.ts similarity index 100% copy from third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/fab-extended-styles.css.d.ts copy to third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/forced-colors-styles.css.d.ts
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/forced-colors-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/forced-colors-styles.css.js new file mode 100644 index 0000000..95802b3 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/forced-colors-styles.css.js
@@ -0,0 +1,9 @@ +/** + * @license + * Copyright 2022 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import { css } from 'lit'; +export const styles = css `@media(forced-colors: active){.fab{--md-focus-ring-offset: 3px;border:1px solid ButtonText}.fab.extended{padding-inline-start:15px;padding-inline-end:19px}}/*# sourceMappingURL=forced-colors-styles.css.map */ +`; +//# sourceMappingURL=forced-colors-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/fab-shared-styles.css.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/shared-styles.css.d.ts similarity index 100% rename from third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/fab-shared-styles.css.d.ts rename to third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/shared-styles.css.d.ts
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/shared-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/shared-styles.css.js new file mode 100644 index 0000000..69dbcb8b --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/shared-styles.css.js
@@ -0,0 +1,9 @@ +/** + * @license + * Copyright 2022 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import { css } from 'lit'; +export const styles = css `:host{--md-ripple-hover-opacity:var(--_hover-state-layer-opacity);--md-ripple-focus-opacity:var(--_focus-state-layer-opacity);--md-ripple-pressed-opacity:var(--_pressed-state-layer-opacity);display:inline-flex}.fab,.icon,.icon ::slotted(*){display:flex}.fab{align-items:center;justify-content:center;vertical-align:middle;padding:0;position:relative;height:var(--_container-height);transition-property:background-color;border-width:0px;outline:none;z-index:0;--md-elevation-level:var(--_container-elevation);--md-elevation-shadow-color:var(--_container-shadow-color);background-color:var(--_container-color);--md-ripple-hover-color:var(--_hover-state-layer-color);--md-ripple-focus-color:var(--_focus-state-layer-color);--md-ripple-pressed-color:var(--_pressed-state-layer-color)}.fab.extended{width:inherit;box-sizing:border-box;padding-inline-start:16px;padding-inline-end:20px}.fab:not(.extended){width:var(--_container-width)}.fab.large{width:var(--_large-container-width);height:var(--_large-container-height)}.fab.large .icon ::slotted(*){width:var(--_large-icon-size);height:var(--_large-icon-size);font-size:var(--_large-icon-size)}.fab.large,.fab.large .ripple{border-start-start-radius:var(--_large-container-shape-start-start);border-start-end-radius:var(--_large-container-shape-start-end);border-end-start-radius:var(--_large-container-shape-end-start);border-end-end-radius:var(--_large-container-shape-end-end);--md-focus-ring-shape-start-start: var(--_large-container-shape-start-start);--md-focus-ring-shape-start-end: var(--_large-container-shape-start-end);--md-focus-ring-shape-end-end: var(--_large-container-shape-end-end);--md-focus-ring-shape-end-start: var(--_large-container-shape-end-start)}.fab:focus{--md-elevation-level:var(--_focus-container-elevation)}.fab:hover{--md-elevation-level:var(--_hover-container-elevation)}.fab:active{--md-elevation-level:var(--_pressed-container-elevation)}.fab.lowered{background-color:var(--_lowered-container-color);--md-elevation-level:var(--_lowered-container-elevation)}.fab.lowered:focus{--md-elevation-level:var(--_lowered-focus-container-elevation)}.fab.lowered:hover{--md-elevation-level:var(--_lowered-hover-container-elevation)}.fab.lowered:active{--md-elevation-level:var(--_lowered-pressed-container-elevation)}.fab .label{color:var(--_label-text-color)}.fab:hover .fab .label{color:var(--_hover-label-text-color)}.fab:focus .fab .label{color:var(--_focus-label-text-color)}.fab:active .fab .label{color:var(--_pressed-label-text-color)}.label{padding-inline-start:12px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font:var(--_label-text-type)}.ripple{overflow:hidden}.ripple,md-elevation{z-index:-1}.touch-target{position:absolute;top:50%;height:48px;left:50%;width:48px;transform:translate(-50%, -50%)}md-elevation,.fab{transition-duration:280ms;transition-timing-function:cubic-bezier(0.2, 0, 0, 1)}.fab,.ripple{border-start-start-radius:var(--_container-shape-start-start);border-start-end-radius:var(--_container-shape-start-end);border-end-start-radius:var(--_container-shape-end-start);border-end-end-radius:var(--_container-shape-end-end);--md-focus-ring-shape-start-start: var(--_container-shape-start-start);--md-focus-ring-shape-start-end: var(--_container-shape-start-end);--md-focus-ring-shape-end-end: var(--_container-shape-end-end);--md-focus-ring-shape-end-start: var(--_container-shape-end-start)}.icon ::slotted(*){width:var(--_icon-size);height:var(--_icon-size);font-size:var(--_icon-size)}/*# sourceMappingURL=shared-styles.css.map */ +`; +//# sourceMappingURL=shared-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/shared.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/shared.d.ts new file mode 100644 index 0000000..f2450f3 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/shared.d.ts
@@ -0,0 +1,49 @@ +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import '../../elevation/elevation.js'; +import '../../focus/focus-ring.js'; +import '../../ripple/ripple.js'; +import { LitElement } from 'lit'; +/** + * Sizes variants available to non-extended FABs. + */ +export type FabSize = 'medium' | 'small' | 'large'; +export declare abstract class SharedFab extends LitElement { + static shadowRootOptions: ShadowRootInit; + /** + * The size of the FAB. + * + * NOTE: Branded FABs cannot be sized to `small`, and Extended FABs do not + * have different sizes. + */ + size: FabSize; + /** + * The text to display on the FAB. + */ + label: string; + /** + * Lowers the FAB's elevation. + */ + lowered: boolean; + /** + * Lowers the FAB's elevation and places it into the `lowered` state. + */ + reducedTouchTarget: boolean; + private showRipple; + private readonly ripple; + private readonly getRipple; + protected render(): import("lit-html").TemplateResult<1>; + protected getRenderClasses(): { + lowered: boolean; + small: boolean; + large: boolean; + extended: boolean; + }; + private renderTouchTarget; + private renderLabel; + private renderIcon; + private readonly renderRipple; +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/shared.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/shared.js new file mode 100644 index 0000000..82021b050 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/shared.js
@@ -0,0 +1,113 @@ +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +var _a; +import { __decorate } from "tslib"; +import '../../elevation/elevation.js'; +import '../../focus/focus-ring.js'; +import '../../ripple/ripple.js'; +import { html, LitElement, nothing } from 'lit'; +import { property, queryAsync, state } from 'lit/decorators.js'; +import { classMap } from 'lit/directives/class-map.js'; +import { when } from 'lit/directives/when.js'; +import { requestUpdateOnAriaChange } from '../../aria/delegate.js'; +import { ripple } from '../../ripple/directive.js'; +// tslint:disable-next-line:enforce-comments-on-exported-symbols +export class SharedFab extends LitElement { + constructor() { + super(...arguments); + /** + * The size of the FAB. + * + * NOTE: Branded FABs cannot be sized to `small`, and Extended FABs do not + * have different sizes. + */ + this.size = 'medium'; + /** + * The text to display on the FAB. + */ + this.label = ''; + /** + * Lowers the FAB's elevation. + */ + this.lowered = false; + /** + * Lowers the FAB's elevation and places it into the `lowered` state. + */ + this.reducedTouchTarget = false; + this.showRipple = false; + this.getRipple = () => { + this.showRipple = true; + return this.ripple; + }; + this.renderRipple = () => { + return html `<md-ripple class="ripple"></md-ripple>`; + }; + } + render() { + // Needed for closure conformance + const { ariaLabel } = this; + return html ` + <button + class="fab ${classMap(this.getRenderClasses())}" + aria-label=${ariaLabel || nothing} + ${ripple(this.getRipple)}> + <md-elevation></md-elevation> + <md-focus-ring></md-focus-ring> + ${when(this.showRipple, this.renderRipple)} + ${this.renderTouchTarget()} + ${this.renderIcon()} + ${this.renderLabel()} + </button>`; + } + getRenderClasses() { + const isExtended = !!this.label; + return { + 'lowered': this.lowered, + 'small': this.size === 'small' && !isExtended, + 'large': this.size === 'large' && !isExtended, + 'extended': isExtended, + }; + } + renderTouchTarget() { + return this.reducedTouchTarget ? html `` : + html `<div class="touch-target"></div>`; + } + renderLabel() { + return this.label ? html `<span class="label">${this.label}</span>` : ''; + } + renderIcon() { + return html `<span class="icon"> + <slot name="icon"></slot> + </span>`; + } +} +_a = SharedFab; +(() => { + requestUpdateOnAriaChange(_a); +})(); +SharedFab.shadowRootOptions = { + mode: 'open', + delegatesFocus: true, +}; +__decorate([ + property() +], SharedFab.prototype, "size", void 0); +__decorate([ + property() +], SharedFab.prototype, "label", void 0); +__decorate([ + property({ type: Boolean }) +], SharedFab.prototype, "lowered", void 0); +__decorate([ + property({ type: Boolean }) +], SharedFab.prototype, "reducedTouchTarget", void 0); +__decorate([ + state() +], SharedFab.prototype, "showRipple", void 0); +__decorate([ + queryAsync('md-ripple') +], SharedFab.prototype, "ripple", void 0); +//# sourceMappingURL=shared.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/field/filled-field.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/field/filled-field.d.ts index 78c18ad..a537e83 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/field/filled-field.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/field/filled-field.d.ts
@@ -10,7 +10,7 @@ } } /** - * @soyCompatible + * TODO(b/228525797): add docs * @final * @suppress {visibility} */
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/field/filled-field.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/field/filled-field.js index b20a24e..408eb2d 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/field/filled-field.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/field/filled-field.js
@@ -9,7 +9,7 @@ import { styles as filledStyles } from './lib/filled-styles.css.js'; import { styles as sharedStyles } from './lib/shared-styles.css.js'; /** - * @soyCompatible + * TODO(b/228525797): add docs * @final * @suppress {visibility} */
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/field/lib/field.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/field/lib/field.d.ts index 80f073d..5cbe69b1 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/field/lib/field.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/field/lib/field.d.ts
@@ -4,14 +4,17 @@ * SPDX-License-Identifier: Apache-2.0 */ import { LitElement, PropertyValues, TemplateResult } from 'lit'; -import { ClassInfo } from 'lit/directives/class-map.js'; -/** @soyCompatible */ -export declare class Field extends LitElement { +import { SurfacePositionTarget } from '../../menu/lib/surfacePositionController.js'; +/** + * A field component. + */ +export declare class Field extends LitElement implements SurfacePositionTarget { disabled: boolean; error: boolean; focused: boolean; label?: string; populated: boolean; + resizable: boolean; required: boolean; /** * Whether or not the field has leading content. @@ -21,34 +24,18 @@ * Whether or not the field has trailing content. */ hasEnd: boolean; - protected isAnimating: boolean; - protected readonly labelAnimationSignal: import("../../motion/animation.js").AnimationSignal; - protected readonly floatingLabelEl: Promise<HTMLElement>; - protected readonly restingLabelEl: Promise<HTMLElement>; - /** @soyTemplate */ - render(): TemplateResult; - /** @soyTemplate */ - protected renderContainer(): TemplateResult; - /** @soyTemplate */ - protected getRenderClasses(): ClassInfo; - /** @soyTemplate */ - protected renderContainerContents(): TemplateResult; - /** @soyTemplate */ - protected renderMiddleContents(): TemplateResult; - /** @soyTemplate */ - protected renderFloatingLabel(): TemplateResult; - /** @soyTemplate */ - protected renderRestingLabel(): TemplateResult; - /** @soyTemplate */ - protected renderLabelText(): string; - /** @soyTemplate */ - protected renderSupportingText(): TemplateResult; + private isAnimating; + private labelAnimation?; + private readonly floatingLabelEl; + private readonly restingLabelEl; + private readonly containerEl; protected update(props: PropertyValues<Field>): void; - protected animateLabelIfNeeded({ wasFocused, wasPopulated }: { - wasFocused?: boolean; - wasPopulated?: boolean; - }): Promise<void>; - protected getLabelKeyframes(): Promise<{ - transform: string; - }[]>; + protected render(): TemplateResult<1>; + protected renderBackground?(): TemplateResult; + protected renderIndicator?(): TemplateResult; + protected renderOutline?(floatingLabel: TemplateResult): TemplateResult; + private renderLabel; + private animateLabelIfNeeded; + private getLabelKeyframes; + getSurfacePositionClientRect(): DOMRect; }
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/field/lib/field.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/field/lib/field.js index 3fe2e0b4..2c6d4d62 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/field/lib/field.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/field/lib/field.js
@@ -3,12 +3,14 @@ * Copyright 2021 Google LLC * SPDX-License-Identifier: Apache-2.0 */ -import { __decorate, __metadata } from "tslib"; -import { html, LitElement } from 'lit'; -import { property, queryAsync, state } from 'lit/decorators.js'; +import { __decorate } from "tslib"; +import { html, LitElement, nothing } from 'lit'; +import { property, query, state } from 'lit/decorators.js'; import { classMap } from 'lit/directives/class-map.js'; -import { createAnimationSignal, EASING } from '../../motion/animation.js'; -/** @soyCompatible */ +import { EASING } from '../../motion/animation.js'; +/** + * A field component. + */ export class Field extends LitElement { constructor() { super(...arguments); @@ -16,6 +18,7 @@ this.error = false; this.focused = false; this.populated = false; + this.resizable = false; this.required = false; /** * Whether or not the field has leading content. @@ -26,100 +29,6 @@ */ this.hasEnd = false; this.isAnimating = false; - this.labelAnimationSignal = createAnimationSignal(); - } - /** @soyTemplate */ - render() { - return html ` - <span class="md3-field ${classMap(this.getRenderClasses())}"> - ${this.renderContainer()} - ${this.renderSupportingText()} - </span> - `; - } - /** @soyTemplate */ - renderContainer() { - return html ` - <span class="md3-field__container"> - ${this.renderContainerContents()} - </span> - `; - } - /** @soyTemplate */ - getRenderClasses() { - return { - 'md3-field--disabled': this.disabled, - 'md3-field--error': this.error, - 'md3-field--focused': this.focused, - 'md3-field--with-start': this.hasStart, - 'md3-field--with-end': this.hasEnd, - 'md3-field--populated': this.populated, - 'md3-field--required': this.required, - 'md3-field--no-label': !this.label, - }; - } - /** @soyTemplate */ - renderContainerContents() { - return html ` - <span class="md3-field__start"> - <slot name="start"></slot> - </span> - <span class="md3-field__middle">${this.renderMiddleContents()}</span> - <span class="md3-field__end"> - <slot name="end"></slot> - </span> - `; - } - /** @soyTemplate */ - renderMiddleContents() { - return html ` - <span class="md3-field__content"><slot></slot></span> - `; - } - /** @soyTemplate */ - renderFloatingLabel() { - const visible = (this.focused || this.populated) && !this.isAnimating; - /** @classMap */ - const classes = { 'md3-field__label--hidden': !visible }; - return html ` - <span class="md3-field__label md3-field__label--floating ${classMap(classes)}" - aria-hidden=${!visible} - >${this.renderLabelText()}</span> - `; - // TODO(b/217441842): Create shared function once argument bug is fixed - // return this.renderLabel(LabelType.FLOATING); - } - /** @soyTemplate */ - renderRestingLabel() { - const visible = !(this.focused || this.populated) || this.isAnimating; - /** @classMap */ - const classes = { 'md3-field__label--hidden': !visible }; - return html ` - <span class="md3-field__label md3-field__label--resting ${classMap(classes)}" - aria-hidden=${!visible} - >${this.renderLabelText()}</span> - `; - // TODO(b/217441842): Create shared function once argument bug is fixed - // return this.renderLabel(LabelType.RESTING); - } - /** @soyTemplate */ - renderLabelText() { - const labelText = this.label ?? ''; - const optionalAsterisk = this.required && labelText ? '*' : ''; - return labelText + optionalAsterisk; - } - /** @soyTemplate */ - renderSupportingText() { - return html ` - <span class="md3-field__supporting-text"> - <span class="md3-field__supporting-text-start"> - <slot name="supporting-text"></slot> - </span> - <span class="md3-field__supporting-text-end"> - <slot name="supporting-text-end"></slot> - </span> - </span> - `; } update(props) { // Client-side property updates @@ -135,7 +44,81 @@ }); super.update(props); } - async animateLabelIfNeeded({ wasFocused, wasPopulated }) { + render() { + const floatingLabel = this.renderLabel(/*isFloating*/ true); + const restingLabel = this.renderLabel(/*isFloating*/ false); + const outline = this.renderOutline?.(floatingLabel); + const classes = { + 'disabled': this.disabled, + 'error': this.error && !this.disabled, + 'focused': this.focused, + 'with-start': this.hasStart, + 'with-end': this.hasEnd, + 'populated': this.populated, + 'resizable': this.resizable, + 'required': this.required, + 'no-label': !this.label, + }; + return html ` + <div class="field ${classMap(classes)}"> + <div class="container-overflow"> + ${outline} + ${this.renderBackground?.()} + ${this.renderIndicator?.()} + <div class="container"> + <div class="start"> + <slot name="start"></slot> + </div> + <div class="middle"> + ${restingLabel} + ${outline ? nothing : floatingLabel} + <div class="content"> + <slot></slot> + </div> + </div> + <div class="end"> + <slot name="end"></slot> + </div> + </div> + </div> + + <div class="supporting-text"> + <div class="supporting-text-start"> + <slot name="supporting-text"></slot> + </div> + <div class="supporting-text-end"> + <slot name="supporting-text-end"></slot> + </div> + </div> + </div> + `; + } + renderLabel(isFloating) { + let visible; + if (isFloating) { + // Floating label is visible when focused/populated or when animating. + visible = this.focused || this.populated || this.isAnimating; + } + else { + // Resting label is visible when unfocused. It is never visible while + // animating. + visible = !this.focused && !this.populated && !this.isAnimating; + } + const classes = { + 'hidden': !visible, + 'floating': isFloating, + 'resting': !isFloating, + }; + let labelText = this.label ?? ''; + // Add '*' if a label is present and the field is required + labelText += this.required && labelText ? '*' : ''; + return html ` + <span class="label ${classMap(classes)}" + aria-hidden=${!visible} + >${labelText}</span> + `; + } + animateLabelIfNeeded({ wasFocused, wasPopulated }) { if (!this.label) { return; } @@ -147,18 +130,12 @@ return; } this.isAnimating = true; - const signal = this.labelAnimationSignal.start(); + this.labelAnimation?.cancel(); // Only one label is visible at a time for clearer text rendering. - // The resting label is visible and used during animation. At the end of the - // animation, it will either remain visible (if resting) or hide and the - // floating label will be shown. - const labelEl = await this.restingLabelEl; - const keyframes = await this.getLabelKeyframes(); - if (signal.aborted) { - // Don't animate if this animation was requested to stop while getting - // the label element or calculating keyframes - return; - } + // The floating label is visible and used during animation. At the end of + // the animation, it will either remain visible (if floating) or hide and + // the resting label will be shown. + // // We don't use forward filling because if the dimensions of the text field // change (leading icon removed, density changes, etc), then the animation // will be inaccurate. @@ -166,86 +143,94 @@ // Re-calculating the animation each time will prevent any visual glitches // from appearing. // TODO(b/241113345): use animation tokens - const animation = labelEl.animate(keyframes, { duration: 150, easing: EASING.STANDARD }); - signal.addEventListener('abort', () => { - // Cancel if requested (another animation starts playing). - animation.cancel(); - }); - animation.addEventListener('finish', () => { + this.labelAnimation = this.floatingLabelEl?.animate(this.getLabelKeyframes(), { duration: 150, easing: EASING.STANDARD }); + this.labelAnimation?.addEventListener('finish', () => { // At the end of the animation, update the visible label. this.isAnimating = false; - this.labelAnimationSignal.finish(); }); } - async getLabelKeyframes() { - const floatingLabelEl = await this.floatingLabelEl; - const restingLabelEl = await this.restingLabelEl; - const { x: floatingX, y: floatingY, width: floatingWidth, height: floatingHeight } = floatingLabelEl.getBoundingClientRect(); - const { x: restingX, y: restingY, width: restingWidth, height: restingHeight } = restingLabelEl.getBoundingClientRect(); + getLabelKeyframes() { + const { floatingLabelEl, restingLabelEl } = this; + if (!floatingLabelEl || !restingLabelEl) { + return []; + } + const { x: floatingX, y: floatingY, height: floatingHeight } = floatingLabelEl.getBoundingClientRect(); + const { x: restingX, y: restingY, height: restingHeight } = restingLabelEl.getBoundingClientRect(); + const floatingScrollWidth = floatingLabelEl.scrollWidth; + const restingScrollWidth = restingLabelEl.scrollWidth; // Scale by width ratio instead of font size since letter-spacing will scale // incorrectly. Using the width we can better approximate the adjusted - // scale and compensate for tracking. - const scale = floatingWidth / restingWidth; - const xDelta = floatingX - restingX; + // scale and compensate for tracking and overflow. + // (use scrollWidth instead of width to account for clipped labels) + const scale = restingScrollWidth / floatingScrollWidth; + const xDelta = restingX - floatingX; // The line-height of the resting and floating label are different. When - // we move the resting label up to the floating label's position, it won't + // we move the floating label down to the resting label's position, it won't // exactly match because of this. We need to adjust by half of what the - // final scaled resting label's height will be. - const yDelta = floatingY - restingY + - Math.round((floatingHeight - restingHeight * scale) / 2); - // Create the two transforms: resting to floating (using the calculations - // above), and floating to resting (re-setting the transform to initial + // final scaled floating label's height will be. + const yDelta = restingY - floatingY + + Math.round((restingHeight - floatingHeight * scale) / 2); + // Create the two transforms: floating to resting (using the calculations + // above), and resting to floating (re-setting the transform to initial // values). - const floatTransform = `translateX(${xDelta}px) translateY(calc(-50% + ${yDelta}px)) scale(${scale})`; - const restTransform = `translateX(0) translateY(-50%) scale(1)`; + const restTransform = `translateX(${xDelta}px) translateY(${yDelta}px) scale(${scale})`; + const floatTransform = `translateX(0) translateY(0) scale(1)`; + // Constrain the floating labels width to a scaled percentage of the + // resting label's width. This will prevent long clipped labels from + // overflowing the container. + const restingClientWidth = restingLabelEl.clientWidth; + const isRestingClipped = restingScrollWidth > restingClientWidth; + const width = isRestingClipped ? `${restingClientWidth / scale}px` : ''; if (this.focused || this.populated) { - return [{ transform: restTransform }, { transform: floatTransform }]; + return [ + { transform: restTransform, width }, { transform: floatTransform, width } + ]; } - return [{ transform: floatTransform }, { transform: restTransform }]; + return [ + { transform: floatTransform, width }, { transform: restTransform, width } + ]; + } + getSurfacePositionClientRect() { + return this.containerEl.getBoundingClientRect(); } } __decorate([ - property({ type: Boolean }), - __metadata("design:type", Object) + property({ type: Boolean }) ], Field.prototype, "disabled", void 0); __decorate([ - property({ type: Boolean }), - __metadata("design:type", Object) + property({ type: Boolean }) ], Field.prototype, "error", void 0); __decorate([ - property({ type: Boolean }), - __metadata("design:type", Object) + property({ type: Boolean }) ], Field.prototype, "focused", void 0); __decorate([ - property({ type: String }), - __metadata("design:type", String) + property() ], Field.prototype, "label", void 0); __decorate([ - property({ type: Boolean }), - __metadata("design:type", Object) + property({ type: Boolean }) ], Field.prototype, "populated", void 0); __decorate([ - property({ type: Boolean }), - __metadata("design:type", Object) + property({ type: Boolean }) +], Field.prototype, "resizable", void 0); +__decorate([ + property({ type: Boolean }) ], Field.prototype, "required", void 0); __decorate([ - property({ type: Boolean }), - __metadata("design:type", Object) + property({ type: Boolean }) ], Field.prototype, "hasStart", void 0); __decorate([ - property({ type: Boolean }), - __metadata("design:type", Object) + property({ type: Boolean }) ], Field.prototype, "hasEnd", void 0); __decorate([ - state(), - __metadata("design:type", Object) + state() ], Field.prototype, "isAnimating", void 0); __decorate([ - queryAsync('.md3-field__label--floating'), - __metadata("design:type", Promise) + query('.label.floating') ], Field.prototype, "floatingLabelEl", void 0); __decorate([ - queryAsync('.md3-field__label--resting'), - __metadata("design:type", Promise) + query('.label.resting') ], Field.prototype, "restingLabelEl", void 0); +__decorate([ + query('.container') +], Field.prototype, "containerEl", void 0); //# sourceMappingURL=field.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/field/lib/filled-field.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/field/lib/filled-field.d.ts index a79a934..e035026 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/field/lib/filled-field.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/field/lib/filled-field.d.ts
@@ -3,22 +3,11 @@ * Copyright 2021 Google LLC * SPDX-License-Identifier: Apache-2.0 */ -import { PropertyValues, TemplateResult } from 'lit'; -import { ClassInfo } from 'lit/directives/class-map.js'; import { Field } from './field.js'; -/** @soyCompatible */ +/** + * A filled field component. + */ export declare class FilledField extends Field { - protected strokeTransformOrigin: string; - /** @soyTemplate */ - protected getRenderClasses(): ClassInfo; - /** @soyTemplate */ - protected renderContainer(): TemplateResult; - /** @soyTemplate */ - protected renderContainerContents(): TemplateResult; - /** @soyTemplate */ - protected renderMiddleContents(): TemplateResult; - /** @bubbleWizEvent */ - protected handleClick(event: MouseEvent | TouchEvent): void; - protected update(props: PropertyValues<this>): void; - protected updateStrokeTransformOrigin(event?: MouseEvent | TouchEvent): Promise<void>; + protected renderBackground(): import("lit-html").TemplateResult<1>; + protected renderIndicator(): import("lit-html").TemplateResult<1>; }
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/field/lib/filled-field.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/field/lib/filled-field.js index 56d8ff77..b42e383 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/field/lib/filled-field.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/field/lib/filled-field.js
@@ -3,82 +3,20 @@ * Copyright 2021 Google LLC * SPDX-License-Identifier: Apache-2.0 */ -import { __decorate, __metadata } from "tslib"; import { html } from 'lit'; -import { state } from 'lit/decorators.js'; -import { styleMap } from 'lit/directives/style-map.js'; import { Field } from './field.js'; -/** @soyCompatible */ +/** + * A filled field component. + */ export class FilledField extends Field { - constructor() { - super(...arguments); - this.strokeTransformOrigin = ''; - } - /** @soyTemplate */ - getRenderClasses() { - return { - ...super.getRenderClasses(), - 'md3-field--filled': true, - }; - } - /** @soyTemplate */ - renderContainer() { + renderBackground() { return html ` - <span class="md3-field__container" @click=${this.handleClick}> - ${this.renderContainerContents()} - </span> + <div class="background"></div> + <div class="state-layer"></div> `; } - /** @soyTemplate */ - renderContainerContents() { - /** @styleMap */ - const strokeStyle = { transformOrigin: this.strokeTransformOrigin }; - return html ` - <span class="md3-field__state-layer"></span> - ${super.renderContainerContents()} - <span class="md3-field__active-indicator" - style="${styleMap(strokeStyle)}"></span> - `; - } - /** @soyTemplate */ - renderMiddleContents() { - return html ` - ${this.renderFloatingLabel()} - ${this.renderRestingLabel()} - ${super.renderMiddleContents()} - `; - } - /** @bubbleWizEvent */ - handleClick(event) { - if (this.disabled) { - return; - } - this.updateStrokeTransformOrigin(event); - } - update(props) { - // Upon losing focus, the stroke resets to expanding from the center, such - // as when re-focusing with a keyboard. - const unfocusing = props.has('focused') && !this.focused; - if (unfocusing) { - this.updateStrokeTransformOrigin(); - } - super.update(props); - } - async updateStrokeTransformOrigin(event) { - let transformOrigin = ''; - if (event) { - // Can't use instanceof TouchEvent since Firefox does not provide the - // constructor globally. - const isTouchEvent = 'touches' in event; - const eventX = isTouchEvent ? event.touches[0].clientX : event.clientX; - const rootRect = this.getBoundingClientRect(); - transformOrigin = `${eventX - rootRect.x}px`; - } - this.strokeTransformOrigin = transformOrigin; + renderIndicator() { + return html `<div class="active-indicator"></div>`; } } -__decorate([ - state(), - __metadata("design:type", Object) -], FilledField.prototype, "strokeTransformOrigin", void 0); //# sourceMappingURL=filled-field.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/field/lib/filled-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/field/lib/filled-styles.css.js index d6293c1..0a8a8872 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/field/lib/filled-styles.css.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/field/lib/filled-styles.css.js
@@ -4,6 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ import { css } from 'lit'; -export const styles = css `:host{--_container-shape-start-start: var(--md-filled-field-container-shape-start-start, 4px);--_container-shape-start-end: var(--md-filled-field-container-shape-start-end, 4px);--_container-shape-end-end: var(--md-filled-field-container-shape-end-end, 0px);--_container-shape-end-start: var(--md-filled-field-container-shape-end-start, 0px);--_active-indicator-color: var(--md-filled-field-active-indicator-color, var(--md-sys-color-on-surface-variant, #49454f));--_active-indicator-height: var(--md-filled-field-active-indicator-height, 1px);--_container-color: var(--md-filled-field-container-color, var(--md-sys-color-surface-variant, #e7e0ec));--_disabled-active-indicator-color: var(--md-filled-field-disabled-active-indicator-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-active-indicator-height: var(--md-filled-field-disabled-active-indicator-height, 1px);--_disabled-active-indicator-opacity: var(--md-filled-field-disabled-active-indicator-opacity, 0.38);--_disabled-container-color: var(--md-filled-field-disabled-container-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-container-opacity: var(--md-filled-field-disabled-container-opacity, 0.04);--_disabled-label-text-color: var(--md-filled-field-disabled-label-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-label-text-opacity: var(--md-filled-field-disabled-label-text-opacity, 0.38);--_disabled-leading-icon-color: var(--md-filled-field-disabled-leading-icon-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-leading-icon-opacity: var(--md-filled-field-disabled-leading-icon-opacity, 0.38);--_disabled-supporting-text-color: var(--md-filled-field-disabled-supporting-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-supporting-text-opacity: var(--md-filled-field-disabled-supporting-text-opacity, 0.38);--_disabled-trailing-icon-color: var(--md-filled-field-disabled-trailing-icon-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-trailing-icon-opacity: var(--md-filled-field-disabled-trailing-icon-opacity, 0.38);--_error-active-indicator-color: var(--md-filled-field-error-active-indicator-color, var(--md-sys-color-error, #b3261e));--_error-focus-active-indicator-color: var(--md-filled-field-error-focus-active-indicator-color, var(--md-sys-color-error, #b3261e));--_error-focus-label-text-color: var(--md-filled-field-error-focus-label-text-color, var(--md-sys-color-error, #b3261e));--_error-focus-leading-icon-color: var(--md-filled-field-error-focus-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-focus-supporting-text-color: var(--md-filled-field-error-focus-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-focus-trailing-icon-color: var(--md-filled-field-error-focus-trailing-icon-color, var(--md-sys-color-error, #b3261e));--_error-hover-active-indicator-color: var(--md-filled-field-error-hover-active-indicator-color, var(--md-sys-color-on-error-container, #410e0b));--_error-hover-label-text-color: var(--md-filled-field-error-hover-label-text-color, var(--md-sys-color-on-error-container, #410e0b));--_error-hover-leading-icon-color: var(--md-filled-field-error-hover-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-hover-state-layer-color: var(--md-filled-field-error-hover-state-layer-color, var(--md-sys-color-on-surface, #1c1b1f));--_error-hover-state-layer-opacity: var(--md-filled-field-error-hover-state-layer-opacity, 0.08);--_error-hover-supporting-text-color: var(--md-filled-field-error-hover-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-hover-trailing-icon-color: var(--md-filled-field-error-hover-trailing-icon-color, var(--md-sys-color-on-error-container, #410e0b));--_error-label-text-color: var(--md-filled-field-error-label-text-color, var(--md-sys-color-error, #b3261e));--_error-leading-icon-color: var(--md-filled-field-error-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-supporting-text-color: var(--md-filled-field-error-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-trailing-icon-color: var(--md-filled-field-error-trailing-icon-color, var(--md-sys-color-error, #b3261e));--_focus-active-indicator-color: var(--md-filled-field-focus-active-indicator-color, var(--md-sys-color-primary, #6750a4));--_focus-active-indicator-height: var(--md-filled-field-focus-active-indicator-height, 2px);--_focus-label-text-color: var(--md-filled-field-focus-label-text-color, var(--md-sys-color-primary, #6750a4));--_focus-leading-icon-color: var(--md-filled-field-focus-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-supporting-text-color: var(--md-filled-field-focus-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-trailing-icon-color: var(--md-filled-field-focus-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-active-indicator-color: var(--md-filled-field-hover-active-indicator-color, var(--md-sys-color-on-surface, #1c1b1f));--_hover-active-indicator-height: var(--md-filled-field-hover-active-indicator-height, 1px);--_hover-label-text-color: var(--md-filled-field-hover-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-leading-icon-color: var(--md-filled-field-hover-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-state-layer-color: var(--md-filled-field-hover-state-layer-color, var(--md-sys-color-on-surface, #1c1b1f));--_hover-state-layer-opacity: var(--md-filled-field-hover-state-layer-opacity, 0.08);--_hover-supporting-text-color: var(--md-filled-field-hover-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-trailing-icon-color: var(--md-filled-field-hover-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_label-text-color: var(--md-filled-field-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_label-text-font: var(--md-filled-field-label-text-font, Roboto);--_label-text-line-height: var(--md-filled-field-label-text-line-height, 1.5rem);--_label-text-populated-line-height: var(--md-filled-field-label-text-populated-line-height, 1rem);--_label-text-populated-size: var(--md-filled-field-label-text-populated-size, 0.75rem);--_label-text-size: var(--md-filled-field-label-text-size, 1rem);--_label-text-tracking: var(--md-filled-field-label-text-tracking, 0.031rem);--_label-text-weight: var(--md-filled-field-label-text-weight, 400);--_leading-icon-color: var(--md-filled-field-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_leading-icon-size: var(--md-filled-field-leading-icon-size, 24px);--_supporting-text-color: var(--md-filled-field-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_supporting-text-font: var(--md-filled-field-supporting-text-font, Roboto);--_supporting-text-line-height: var(--md-filled-field-supporting-text-line-height, 1rem);--_supporting-text-size: var(--md-filled-field-supporting-text-size, 0.75rem);--_supporting-text-tracking: var(--md-filled-field-supporting-text-tracking, 0.025rem);--_supporting-text-weight: var(--md-filled-field-supporting-text-weight, 400);--_trailing-icon-color: var(--md-filled-field-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_trailing-icon-size: var(--md-filled-field-trailing-icon-size, 24px);--_container-padding-horizontal: var(--md-filled-field-container-padding-horizontal, 16px);--_container-padding-vertical: var(--md-filled-field-container-padding-vertical, 16px);--_content-color: var(--md-filled-field-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-content-color: var(--md-filled-field-disabled-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-content-opacity: var(--md-filled-field-disabled-content-opacity, 0.38);--_error-content-color: var(--md-filled-field-error-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_error-focus-content-color: var(--md-filled-field-error-focus-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_error-hover-content-color: var(--md-filled-field-error-hover-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_focus-content-color: var(--md-filled-field-focus-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_hover-content-color: var(--md-filled-field-hover-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_supporting-text-padding: var(--md-filled-field-supporting-text-padding, 16px);--_supporting-text-padding-top: var(--md-filled-field-supporting-text-padding-top, 4px);--_with-label-container-padding-vertical: var(--md-filled-field-with-label-container-padding-vertical, 8px);--_label-text-populated-font: ;--_label-text-populated-tracking: ;--_label-text-populated-weight: }.md3-field__container{border-start-start-radius:var(--_container-shape-start-start);border-start-end-radius:var(--_container-shape-start-end);border-end-end-radius:var(--_container-shape-end-end);border-end-start-radius:var(--_container-shape-end-start);overflow:hidden;z-index:0}.md3-field__container::before{background:var(--_container-color)}.md3-field__container::after{visibility:hidden}.md3-field__container::before,.md3-field__container::after{border-radius:inherit;content:"";display:flex;height:100%;position:absolute;width:100%;z-index:-1}.md3-field__label--floating{position:absolute;top:0}.md3-field__state-layer{border-radius:inherit;height:100%;position:absolute;width:100%;visibility:hidden;z-index:-1}.md3-field:not(.md3-field--disabled):hover .md3-field__state-layer{visibility:visible}.md3-field__active-indicator{inset:auto 0 0 0;pointer-events:none;position:absolute;width:100%}.md3-field__active-indicator::before,.md3-field__active-indicator::after{border-bottom:var(--_active-indicator-height) solid var(--_active-indicator-color);inset:auto 0 0 0;content:"";position:absolute;width:100%}.md3-field__active-indicator::after{opacity:0;transform:scaleX(0);transform-origin:inherit;transition:opacity 150ms cubic-bezier(0.4, 0, 0.2, 1),transform 0s ease 150ms}.md3-field--focused .md3-field__active-indicator::after{opacity:1;transform:scaleX(1);transition:transform 150ms cubic-bezier(0.4, 0, 0.2, 1)}.md3-field:not(.md3-field--with-start) .md3-field__start{padding-inline-start:var(--_container-padding-horizontal)}.md3-field:not(.md3-field--with-end) .md3-field__end{padding-inline-end:var(--_container-padding-horizontal)}.md3-field:not(.md3-field--no-label) .md3-field__container{padding-bottom:var(--_with-label-container-padding-vertical);padding-top:var(--_with-label-container-padding-vertical)}.md3-field:not(.md3-field--no-label) .md3-field__middle{padding-top:var(--_label-text-populated-line-height)}:hover .md3-field__active-indicator::before{border-bottom-color:var(--_hover-active-indicator-color);border-bottom-width:var(--_hover-active-indicator-height)}:hover .md3-field__state-layer{background:var(--_hover-state-layer-color);opacity:var(--_hover-state-layer-opacity)}.md3-field__active-indicator::after{border-bottom-color:var(--_focus-active-indicator-color);border-bottom-width:var(--_focus-active-indicator-height)}.md3-field--disabled .md3-field__active-indicator::before{border-bottom-color:var(--_disabled-active-indicator-color);border-bottom-width:var(--_disabled-active-indicator-height);opacity:var(--_disabled-active-indicator-opacity)}.md3-field--disabled .md3-field__container::before{background:var(--_disabled-container-color);opacity:var(--_disabled-container-opacity)}.md3-field--error:not(.md3-field--disabled) .md3-field__active-indicator::before{border-bottom-color:var(--_error-active-indicator-color)}.md3-field--error:not(.md3-field--disabled):hover .md3-field__active-indicator::before{border-bottom-color:var(--_error-hover-active-indicator-color)}.md3-field--error:not(.md3-field--disabled):hover .md3-field__state-layer{background:var(--_error-hover-state-layer-color);opacity:var(--_error-hover-state-layer-opacity)}.md3-field--error:not(.md3-field--disabled) .md3-field__active-indicator::after{border-bottom-color:var(--_error-focus-active-indicator-color)}/*# sourceMappingURL=filled-styles.css.map */ +export const styles = css `:host{--_active-indicator-color: var(--md-filled-field-active-indicator-color, var(--md-sys-color-on-surface-variant, #49454f));--_active-indicator-height: var(--md-filled-field-active-indicator-height, 1px);--_container-color: var(--md-filled-field-container-color, var(--md-sys-color-surface-container-highest, #e6e0e9));--_container-padding-horizontal: var(--md-filled-field-container-padding-horizontal, 16px);--_container-padding-vertical: var(--md-filled-field-container-padding-vertical, 16px);--_container-shape-start-start: var( --md-filled-field-container-shape-start-start, var(--md-filled-field-container-shape, 4px) );--_container-shape-start-end: var( --md-filled-field-container-shape-start-end, var(--md-filled-field-container-shape, 4px) );--_container-shape-end-end: var( --md-filled-field-container-shape-end-end, var(--md-filled-field-container-shape, 0px) );--_container-shape-end-start: var( --md-filled-field-container-shape-end-start, var(--md-filled-field-container-shape, 0px) );--_content-color: var(--md-filled-field-content-color, var(--md-sys-color-on-surface, #1d1b20));--_content-type: var(--md-filled-field-content-type, 400 1rem / 1.5rem var(--md-ref-typeface-plain, Roboto));--_disabled-active-indicator-color: var(--md-filled-field-disabled-active-indicator-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-active-indicator-height: var(--md-filled-field-disabled-active-indicator-height, 1px);--_disabled-active-indicator-opacity: var(--md-filled-field-disabled-active-indicator-opacity, 0.38);--_disabled-container-color: var(--md-filled-field-disabled-container-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-container-opacity: var(--md-filled-field-disabled-container-opacity, 0.04);--_disabled-content-color: var(--md-filled-field-disabled-content-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-content-opacity: var(--md-filled-field-disabled-content-opacity, 0.38);--_disabled-label-text-color: var(--md-filled-field-disabled-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-label-text-opacity: var(--md-filled-field-disabled-label-text-opacity, 0.38);--_disabled-leading-content-color: var(--md-filled-field-disabled-leading-content-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-leading-content-opacity: var(--md-filled-field-disabled-leading-content-opacity, 0.38);--_disabled-supporting-text-color: var(--md-filled-field-disabled-supporting-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-supporting-text-opacity: var(--md-filled-field-disabled-supporting-text-opacity, 0.38);--_disabled-trailing-content-color: var(--md-filled-field-disabled-trailing-content-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-trailing-content-opacity: var(--md-filled-field-disabled-trailing-content-opacity, 0.38);--_error-active-indicator-color: var(--md-filled-field-error-active-indicator-color, var(--md-sys-color-error, #b3261e));--_error-content-color: var(--md-filled-field-error-content-color, var(--md-sys-color-on-surface, #1d1b20));--_error-focus-active-indicator-color: var(--md-filled-field-error-focus-active-indicator-color, var(--md-sys-color-error, #b3261e));--_error-focus-content-color: var(--md-filled-field-error-focus-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-focus-label-text-color: var(--md-filled-field-error-focus-label-text-color, var(--md-sys-color-error, #b3261e));--_error-focus-leading-content-color: var(--md-filled-field-error-focus-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-focus-supporting-text-color: var(--md-filled-field-error-focus-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-focus-trailing-content-color: var(--md-filled-field-error-focus-trailing-content-color, var(--md-sys-color-error, #b3261e));--_error-hover-active-indicator-color: var(--md-filled-field-error-hover-active-indicator-color, var(--md-sys-color-on-error-container, #410e0b));--_error-hover-content-color: var(--md-filled-field-error-hover-content-color, var(--md-sys-color-on-surface, #1d1b20));--_error-hover-label-text-color: var(--md-filled-field-error-hover-label-text-color, var(--md-sys-color-on-error-container, #410e0b));--_error-hover-leading-content-color: var(--md-filled-field-error-hover-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-hover-state-layer-color: var(--md-filled-field-error-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_error-hover-state-layer-opacity: var(--md-filled-field-error-hover-state-layer-opacity, 0.08);--_error-hover-supporting-text-color: var(--md-filled-field-error-hover-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-hover-trailing-content-color: var(--md-filled-field-error-hover-trailing-content-color, var(--md-sys-color-on-error-container, #410e0b));--_error-label-text-color: var(--md-filled-field-error-label-text-color, var(--md-sys-color-error, #b3261e));--_error-leading-content-color: var(--md-filled-field-error-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-supporting-text-color: var(--md-filled-field-error-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-trailing-content-color: var(--md-filled-field-error-trailing-content-color, var(--md-sys-color-error, #b3261e));--_focus-active-indicator-color: var(--md-filled-field-focus-active-indicator-color, var(--md-sys-color-primary, #6750a4));--_focus-active-indicator-height: var(--md-filled-field-focus-active-indicator-height, 2px);--_focus-content-color: var(--md-filled-field-focus-content-color, var(--md-sys-color-on-surface, #1d1b20));--_focus-label-text-color: var(--md-filled-field-focus-label-text-color, var(--md-sys-color-primary, #6750a4));--_focus-leading-content-color: var(--md-filled-field-focus-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-supporting-text-color: var(--md-filled-field-focus-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-trailing-content-color: var(--md-filled-field-focus-trailing-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-active-indicator-color: var(--md-filled-field-hover-active-indicator-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-active-indicator-height: var(--md-filled-field-hover-active-indicator-height, 1px);--_hover-content-color: var(--md-filled-field-hover-content-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-label-text-color: var(--md-filled-field-hover-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-leading-content-color: var(--md-filled-field-hover-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-state-layer-color: var(--md-filled-field-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-state-layer-opacity: var(--md-filled-field-hover-state-layer-opacity, 0.08);--_hover-supporting-text-color: var(--md-filled-field-hover-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-trailing-content-color: var(--md-filled-field-hover-trailing-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_label-text-color: var(--md-filled-field-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_label-text-populated-line-height: var(--md-filled-field-label-text-populated-line-height, 1rem);--_label-text-populated-size: var(--md-filled-field-label-text-populated-size, 0.75rem);--_label-text-type: var(--md-filled-field-label-text-type, 400 1rem / 1.5rem var(--md-ref-typeface-plain, Roboto));--_leading-content-color: var(--md-filled-field-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_supporting-text-color: var(--md-filled-field-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_supporting-text-padding: var(--md-filled-field-supporting-text-padding, 16px);--_supporting-text-padding-top: var(--md-filled-field-supporting-text-padding-top, 4px);--_supporting-text-type: var(--md-filled-field-supporting-text-type, 400 0.75rem / 1rem var(--md-ref-typeface-plain, Roboto));--_trailing-content-color: var(--md-filled-field-trailing-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_with-label-container-padding-vertical: var(--md-filled-field-with-label-container-padding-vertical, 8px)}.background,.state-layer{border-radius:inherit;inset:0;pointer-events:none;position:absolute}.background{background:var(--_container-color)}.state-layer{visibility:hidden}.field:not(.disabled):hover .state-layer{visibility:visible}.label.floating{position:absolute;top:0}.active-indicator{inset:auto 0 0 0;pointer-events:none;position:absolute;width:100%}.active-indicator::before,.active-indicator::after{border-bottom:var(--_active-indicator-height) solid var(--_active-indicator-color);inset:auto 0 0 0;content:"";position:absolute;width:100%}.active-indicator::after{opacity:0;transition:opacity 150ms cubic-bezier(0.2, 0, 0, 1)}.focused .active-indicator::after{opacity:1}.field:not(.with-start) .start{padding-inline-start:var(--_container-padding-horizontal)}.field:not(.with-end) .end{padding-inline-end:var(--_container-padding-horizontal)}.field:not(.no-label) .container{padding-bottom:var(--_with-label-container-padding-vertical);padding-top:var(--_with-label-container-padding-vertical)}.field:not(.no-label) .middle{padding-top:var(--_label-text-populated-line-height)}:hover .active-indicator::before{border-bottom-color:var(--_hover-active-indicator-color);border-bottom-width:var(--_hover-active-indicator-height)}.active-indicator::after{border-bottom-color:var(--_focus-active-indicator-color);border-bottom-width:var(--_focus-active-indicator-height)}:hover .state-layer{background:var(--_hover-state-layer-color);opacity:var(--_hover-state-layer-opacity)}.disabled .active-indicator::before{border-bottom-color:var(--_disabled-active-indicator-color);border-bottom-width:var(--_disabled-active-indicator-height);opacity:var(--_disabled-active-indicator-opacity)}.disabled .background{background:var(--_disabled-container-color);opacity:var(--_disabled-container-opacity)}.error .active-indicator::before{border-bottom-color:var(--_error-active-indicator-color)}.error:hover .active-indicator::before{border-bottom-color:var(--_error-hover-active-indicator-color)}.error:hover .state-layer{background:var(--_error-hover-state-layer-color);opacity:var(--_error-hover-state-layer-opacity)}.error .active-indicator::after{border-bottom-color:var(--_error-focus-active-indicator-color)}/*# sourceMappingURL=filled-styles.css.map */ `; //# sourceMappingURL=filled-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/field/lib/outlined-field.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/field/lib/outlined-field.d.ts index 1d5089ce..fe5cc43 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/field/lib/outlined-field.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/field/lib/outlined-field.d.ts
@@ -4,16 +4,10 @@ * SPDX-License-Identifier: Apache-2.0 */ import { TemplateResult } from 'lit'; -import { ClassInfo } from 'lit/directives/class-map.js'; import { Field } from './field.js'; -/** @soyCompatible */ +/** + * An outlined field component. + */ export declare class OutlinedField extends Field { - /** @soyTemplate */ - protected getRenderClasses(): ClassInfo; - /** @soyTemplate */ - protected renderContainerContents(): TemplateResult; - /** @soyTemplate */ - protected renderOutline(): TemplateResult; - /** @soyTemplate */ - protected renderMiddleContents(): TemplateResult; + protected renderOutline(floatingLabel: TemplateResult): TemplateResult<1>; }
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/field/lib/outlined-field.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/field/lib/outlined-field.js index 7a87de0..8e9891fa 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/field/lib/outlined-field.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/field/lib/outlined-field.js
@@ -5,41 +5,21 @@ */ import { html } from 'lit'; import { Field } from './field.js'; -/** @soyCompatible */ +/** + * An outlined field component. + */ export class OutlinedField extends Field { - /** @soyTemplate */ - getRenderClasses() { - return { - ...super.getRenderClasses(), - 'md3-field--outlined': true, - }; - } - /** @soyTemplate */ - renderContainerContents() { + renderOutline(floatingLabel) { return html ` - ${this.renderOutline()} - ${super.renderContainerContents()} - `; - } - /** @soyTemplate */ - renderOutline() { - return html ` - <span class="md3-field__outline"> - <span class="md3-field__outline-start"></span> - <span class="md3-field__outline-notch"> - <span class="md3-field__outline-panel-inactive"></span> - <span class="md3-field__outline-panel-active"></span> - ${this.renderFloatingLabel()} - </span> - <span class="md3-field__outline-end"></span> - </span> - `; - } - /** @soyTemplate */ - renderMiddleContents() { - return html ` - ${this.renderRestingLabel()} - ${super.renderMiddleContents()} + <div class="outline"> + <div class="outline-start"></div> + <div class="outline-notch"> + <div class="outline-panel-inactive"></div> + <div class="outline-panel-active"></div> + <div class="outline-label">${floatingLabel}</div> + </div> + <div class="outline-end"></div> + </div> `; } }
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/field/lib/outlined-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/field/lib/outlined-styles.css.js index 56449134a..e9ac4a39 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/field/lib/outlined-styles.css.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/field/lib/outlined-styles.css.js
@@ -4,6 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ import { css } from 'lit'; -export const styles = css `:host{--_container-shape-start-start: var(--md-outlined-field-container-shape-start-start, 4px);--_container-shape-start-end: var(--md-outlined-field-container-shape-start-end, 4px);--_container-shape-end-end: var(--md-outlined-field-container-shape-end-end, 4px);--_container-shape-end-start: var(--md-outlined-field-container-shape-end-start, 4px);--_disabled-label-text-color: var(--md-outlined-field-disabled-label-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-label-text-opacity: var(--md-outlined-field-disabled-label-text-opacity, 0.38);--_disabled-leading-icon-color: var(--md-outlined-field-disabled-leading-icon-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-leading-icon-opacity: var(--md-outlined-field-disabled-leading-icon-opacity, 0.38);--_disabled-outline-color: var(--md-outlined-field-disabled-outline-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-outline-opacity: var(--md-outlined-field-disabled-outline-opacity, 0.12);--_disabled-outline-width: var(--md-outlined-field-disabled-outline-width, 1px);--_disabled-supporting-text-color: var(--md-outlined-field-disabled-supporting-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-supporting-text-opacity: var(--md-outlined-field-disabled-supporting-text-opacity, 0.38);--_disabled-trailing-icon-color: var(--md-outlined-field-disabled-trailing-icon-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-trailing-icon-opacity: var(--md-outlined-field-disabled-trailing-icon-opacity, 0.38);--_error-focus-label-text-color: var(--md-outlined-field-error-focus-label-text-color, var(--md-sys-color-error, #b3261e));--_error-focus-leading-icon-color: var(--md-outlined-field-error-focus-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-focus-outline-color: var(--md-outlined-field-error-focus-outline-color, var(--md-sys-color-error, #b3261e));--_error-focus-supporting-text-color: var(--md-outlined-field-error-focus-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-focus-trailing-icon-color: var(--md-outlined-field-error-focus-trailing-icon-color, var(--md-sys-color-error, #b3261e));--_error-hover-label-text-color: var(--md-outlined-field-error-hover-label-text-color, var(--md-sys-color-on-error-container, #410e0b));--_error-hover-leading-icon-color: var(--md-outlined-field-error-hover-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-hover-outline-color: var(--md-outlined-field-error-hover-outline-color, var(--md-sys-color-on-error-container, #410e0b));--_error-hover-supporting-text-color: var(--md-outlined-field-error-hover-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-hover-trailing-icon-color: var(--md-outlined-field-error-hover-trailing-icon-color, var(--md-sys-color-on-error-container, #410e0b));--_error-label-text-color: var(--md-outlined-field-error-label-text-color, var(--md-sys-color-error, #b3261e));--_error-leading-icon-color: var(--md-outlined-field-error-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-outline-color: var(--md-outlined-field-error-outline-color, var(--md-sys-color-error, #b3261e));--_error-supporting-text-color: var(--md-outlined-field-error-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-trailing-icon-color: var(--md-outlined-field-error-trailing-icon-color, var(--md-sys-color-error, #b3261e));--_focus-label-text-color: var(--md-outlined-field-focus-label-text-color, var(--md-sys-color-primary, #6750a4));--_focus-leading-icon-color: var(--md-outlined-field-focus-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-outline-color: var(--md-outlined-field-focus-outline-color, var(--md-sys-color-primary, #6750a4));--_focus-outline-width: var(--md-outlined-field-focus-outline-width, 2px);--_focus-supporting-text-color: var(--md-outlined-field-focus-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-trailing-icon-color: var(--md-outlined-field-focus-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-label-text-color: var(--md-outlined-field-hover-label-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_hover-leading-icon-color: var(--md-outlined-field-hover-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-outline-color: var(--md-outlined-field-hover-outline-color, var(--md-sys-color-on-surface, #1c1b1f));--_hover-outline-width: var(--md-outlined-field-hover-outline-width, 1px);--_hover-supporting-text-color: var(--md-outlined-field-hover-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-trailing-icon-color: var(--md-outlined-field-hover-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_label-text-color: var(--md-outlined-field-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_label-text-font: var(--md-outlined-field-label-text-font, Roboto);--_label-text-line-height: var(--md-outlined-field-label-text-line-height, 1.5rem);--_label-text-populated-line-height: var(--md-outlined-field-label-text-populated-line-height, 1rem);--_label-text-populated-size: var(--md-outlined-field-label-text-populated-size, 0.75rem);--_label-text-size: var(--md-outlined-field-label-text-size, 1rem);--_label-text-tracking: var(--md-outlined-field-label-text-tracking, 0.031rem);--_label-text-weight: var(--md-outlined-field-label-text-weight, 400);--_leading-icon-color: var(--md-outlined-field-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_leading-icon-size: var(--md-outlined-field-leading-icon-size, 24px);--_outline-color: var(--md-outlined-field-outline-color, var(--md-sys-color-outline, #79747e));--_outline-width: var(--md-outlined-field-outline-width, 1px);--_supporting-text-color: var(--md-outlined-field-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_supporting-text-font: var(--md-outlined-field-supporting-text-font, Roboto);--_supporting-text-line-height: var(--md-outlined-field-supporting-text-line-height, 1rem);--_supporting-text-size: var(--md-outlined-field-supporting-text-size, 0.75rem);--_supporting-text-tracking: var(--md-outlined-field-supporting-text-tracking, 0.025rem);--_supporting-text-weight: var(--md-outlined-field-supporting-text-weight, 400);--_trailing-icon-color: var(--md-outlined-field-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_trailing-icon-size: var(--md-outlined-field-trailing-icon-size, 24px);--_container-padding-horizontal: var(--md-outlined-field-container-padding-horizontal, 16px);--_container-padding-vertical: var(--md-outlined-field-container-padding-vertical, 16px);--_content-color: var(--md-outlined-field-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-content-color: var(--md-outlined-field-disabled-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-content-opacity: var(--md-outlined-field-disabled-content-opacity, 0.38);--_error-content-color: var(--md-outlined-field-error-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_error-focus-content-color: var(--md-outlined-field-error-focus-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_error-hover-content-color: var(--md-outlined-field-error-hover-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_focus-content-color: var(--md-outlined-field-focus-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_hover-content-color: var(--md-outlined-field-hover-content-color, var(--md-sys-color-on-surface, #1c1b1f));--_label-text-padding-bottom: var(--md-outlined-field-label-text-padding-bottom, 8px);--_outline-label-padding: var(--md-outlined-field-outline-label-padding, 4px);--_supporting-text-padding: var(--md-outlined-field-supporting-text-padding, 16px);--_supporting-text-padding-top: var(--md-outlined-field-supporting-text-padding-top, 4px);--_label-text-populated-font: ;--_label-text-populated-tracking: ;--_label-text-populated-weight: }.md3-field__outline{border-start-start-radius:var(--_container-shape-start-start);border-start-end-radius:var(--_container-shape-start-end);border-end-end-radius:var(--_container-shape-end-end);border-end-start-radius:var(--_container-shape-end-start);border-color:var(--_outline-color);color:var(--_outline-color);display:flex;pointer-events:none;height:100%;position:absolute;width:100%}.md3-field__outline-start::before,.md3-field__outline-start::after,.md3-field__outline-panel-inactive::before,.md3-field__outline-panel-inactive::after,.md3-field__outline-panel-active::before,.md3-field__outline-panel-active::after,.md3-field__outline-end::before,.md3-field__outline-end::after{border:inherit;content:"";inset:0;position:absolute}.md3-field__outline-start,.md3-field__outline-end{border:inherit;border-radius:inherit;box-sizing:border-box;position:relative}.md3-field__outline-start::before,.md3-field__outline-start::after,.md3-field__outline-end::before,.md3-field__outline-end::after{border-bottom-style:solid;border-top-style:solid}.md3-field__outline-start::after,.md3-field__outline-end::after{opacity:0;transition:opacity 150ms cubic-bezier(0.4, 0, 0.2, 1)}.md3-field--focused .md3-field__outline-start::after,.md3-field--focused .md3-field__outline-end::after{opacity:1}.md3-field__outline-start::before,.md3-field__outline-start::after{border-inline-start-style:solid;border-inline-end-style:none;border-start-start-radius:inherit;border-start-end-radius:0;border-end-start-radius:inherit;border-end-end-radius:0;margin-inline-end:var(--_outline-label-padding)}.md3-field__outline-end{flex-grow:1;margin-inline-start:calc(-1*var(--_outline-label-padding))}.md3-field__outline-end::before,.md3-field__outline-end::after{border-inline-start-style:none;border-inline-end-style:solid;border-start-start-radius:0;border-start-end-radius:inherit;border-end-start-radius:0;border-end-end-radius:inherit}.md3-field__outline-notch{align-items:flex-start;border:inherit;display:flex;margin-inline-start:calc(-1*var(--_outline-label-padding));margin-inline-end:var(--_outline-label-padding);max-width:calc(100% - 2*var(--_container-padding-horizontal));padding:0 var(--_outline-label-padding);position:relative}.md3-field--no-label .md3-field__outline-notch{display:none}.md3-field__outline-panel-inactive,.md3-field__outline-panel-active{border:inherit;border-bottom-style:solid;inset:0;position:absolute}.md3-field__outline-panel-inactive::before,.md3-field__outline-panel-inactive::after,.md3-field__outline-panel-active::before,.md3-field__outline-panel-active::after{border-top-style:solid;border-bottom:none;bottom:auto;transform:scaleX(1);transition:transform 150ms cubic-bezier(0.4, 0, 0.2, 1)}.md3-field__outline-panel-inactive::before,.md3-field__outline-panel-active::before{right:50%;transform-origin:top left}.md3-field__outline-panel-inactive::after,.md3-field__outline-panel-active::after{left:50%;transform-origin:top right}.md3-field--populated .md3-field__outline-panel-inactive::before,.md3-field--populated .md3-field__outline-panel-inactive::after,.md3-field--focused .md3-field__outline-panel-inactive::before,.md3-field--focused .md3-field__outline-panel-inactive::after,.md3-field--populated .md3-field__outline-panel-active::before,.md3-field--populated .md3-field__outline-panel-active::after,.md3-field--focused .md3-field__outline-panel-active::before,.md3-field--focused .md3-field__outline-panel-active::after{transform:scaleX(0)}.md3-field__outline-panel-active{opacity:0;transition:opacity 150ms cubic-bezier(0.4, 0, 0.2, 1)}.md3-field--focused .md3-field__outline-panel-active{opacity:1}.md3-field__label--floating{transform:translateY(calc(-100% + var(--_label-text-padding-bottom)))}.md3-field__outline-start,.md3-field:not(.md3-field--with-start) .md3-field__start{padding-inline-start:max(var(--_container-padding-horizontal),max(var(--_container-shape-start-start),var(--_container-shape-end-start)) + var(--_outline-label-padding))}.md3-field:not(.md3-field--with-end) .md3-field__end{padding-inline-end:max(var(--_container-padding-horizontal),max(var(--_container-shape-start-end),var(--_container-shape-end-end)))}.md3-field__outline-start::before,.md3-field__outline-end::before,.md3-field__outline-panel-inactive,.md3-field__outline-panel-inactive::before,.md3-field__outline-panel-inactive::after{border-width:var(--_outline-width)}:hover .md3-field__outline{border-color:var(--_hover-outline-color);color:var(--_hover-outline-color)}:hover .md3-field__outline-start::before,:hover .md3-field__outline-end::before,:hover .md3-field__outline-panel-inactive,:hover .md3-field__outline-panel-inactive::before,:hover .md3-field__outline-panel-inactive::after{border-width:var(--_hover-outline-width)}.md3-field--focused .md3-field__outline{border-color:var(--_focus-outline-color);color:var(--_focus-outline-color)}.md3-field__outline-start::after,.md3-field__outline-end::after,.md3-field__outline-panel-active,.md3-field__outline-panel-active::before,.md3-field__outline-panel-active::after{border-width:var(--_focus-outline-width)}.md3-field--disabled .md3-field__outline{border-color:var(--_disabled-outline-color);color:var(--_disabled-outline-color)}.md3-field--disabled .md3-field__outline-start,.md3-field--disabled .md3-field__outline-end,.md3-field--disabled .md3-field__outline-panel-inactive{opacity:var(--_disabled-outline-opacity)}.md3-field--disabled .md3-field__outline-start::before,.md3-field--disabled .md3-field__outline-end::before,.md3-field--disabled .md3-field__outline-panel-inactive,.md3-field--disabled .md3-field__outline-panel-inactive::before,.md3-field--disabled .md3-field__outline-panel-inactive::after{border-width:var(--_disabled-outline-width)}.md3-field--error:not(.md3-field--disabled) .md3-field__outline{border-color:var(--_error-outline-color);color:var(--_error-outline-color)}.md3-field--error:not(.md3-field--disabled):hover .md3-field__outline{border-color:var(--_error-hover-outline-color);color:var(--_error-hover-outline-color)}.md3-field--error:not(.md3-field--disabled).md3-field--focused .md3-field__outline{border-color:var(--_error-focus-outline-color);color:var(--_error-focus-outline-color)}/*# sourceMappingURL=outlined-styles.css.map */ +export const styles = css `:host{--_container-padding-horizontal: var(--md-outlined-field-container-padding-horizontal, 16px);--_container-padding-vertical: var(--md-outlined-field-container-padding-vertical, 16px);--_container-shape: var(--md-outlined-field-container-shape, 4px);--_content-color: var(--md-outlined-field-content-color, var(--md-sys-color-on-surface, #1d1b20));--_content-type: var(--md-outlined-field-content-type, 400 1rem / 1.5rem var(--md-ref-typeface-plain, Roboto));--_disabled-content-color: var(--md-outlined-field-disabled-content-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-content-opacity: var(--md-outlined-field-disabled-content-opacity, 0.38);--_disabled-label-text-color: var(--md-outlined-field-disabled-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-label-text-opacity: var(--md-outlined-field-disabled-label-text-opacity, 0.38);--_disabled-leading-content-color: var(--md-outlined-field-disabled-leading-content-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-leading-content-opacity: var(--md-outlined-field-disabled-leading-content-opacity, 0.38);--_disabled-outline-color: var(--md-outlined-field-disabled-outline-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-outline-opacity: var(--md-outlined-field-disabled-outline-opacity, 0.12);--_disabled-outline-width: var(--md-outlined-field-disabled-outline-width, 1px);--_disabled-supporting-text-color: var(--md-outlined-field-disabled-supporting-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-supporting-text-opacity: var(--md-outlined-field-disabled-supporting-text-opacity, 0.38);--_disabled-trailing-content-color: var(--md-outlined-field-disabled-trailing-content-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-trailing-content-opacity: var(--md-outlined-field-disabled-trailing-content-opacity, 0.38);--_error-content-color: var(--md-outlined-field-error-content-color, var(--md-sys-color-on-surface, #1d1b20));--_error-focus-content-color: var(--md-outlined-field-error-focus-content-color, var(--md-sys-color-on-surface, #1d1b20));--_error-focus-label-text-color: var(--md-outlined-field-error-focus-label-text-color, var(--md-sys-color-error, #b3261e));--_error-focus-leading-content-color: var(--md-outlined-field-error-focus-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-focus-outline-color: var(--md-outlined-field-error-focus-outline-color, var(--md-sys-color-error, #b3261e));--_error-focus-supporting-text-color: var(--md-outlined-field-error-focus-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-focus-trailing-content-color: var(--md-outlined-field-error-focus-trailing-content-color, var(--md-sys-color-error, #b3261e));--_error-hover-content-color: var(--md-outlined-field-error-hover-content-color, var(--md-sys-color-on-surface, #1d1b20));--_error-hover-label-text-color: var(--md-outlined-field-error-hover-label-text-color, var(--md-sys-color-on-error-container, #410e0b));--_error-hover-leading-content-color: var(--md-outlined-field-error-hover-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-hover-outline-color: var(--md-outlined-field-error-hover-outline-color, var(--md-sys-color-on-error-container, #410e0b));--_error-hover-supporting-text-color: var(--md-outlined-field-error-hover-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-hover-trailing-content-color: var(--md-outlined-field-error-hover-trailing-content-color, var(--md-sys-color-on-error-container, #410e0b));--_error-label-text-color: var(--md-outlined-field-error-label-text-color, var(--md-sys-color-error, #b3261e));--_error-leading-content-color: var(--md-outlined-field-error-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-outline-color: var(--md-outlined-field-error-outline-color, var(--md-sys-color-error, #b3261e));--_error-supporting-text-color: var(--md-outlined-field-error-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-trailing-content-color: var(--md-outlined-field-error-trailing-content-color, var(--md-sys-color-error, #b3261e));--_focus-content-color: var(--md-outlined-field-focus-content-color, var(--md-sys-color-on-surface, #1d1b20));--_focus-label-text-color: var(--md-outlined-field-focus-label-text-color, var(--md-sys-color-primary, #6750a4));--_focus-leading-content-color: var(--md-outlined-field-focus-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-outline-color: var(--md-outlined-field-focus-outline-color, var(--md-sys-color-primary, #6750a4));--_focus-outline-width: var(--md-outlined-field-focus-outline-width, 2px);--_focus-supporting-text-color: var(--md-outlined-field-focus-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-trailing-content-color: var(--md-outlined-field-focus-trailing-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-content-color: var(--md-outlined-field-hover-content-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-label-text-color: var(--md-outlined-field-hover-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-leading-content-color: var(--md-outlined-field-hover-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-outline-color: var(--md-outlined-field-hover-outline-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-outline-width: var(--md-outlined-field-hover-outline-width, 1px);--_hover-supporting-text-color: var(--md-outlined-field-hover-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-trailing-content-color: var(--md-outlined-field-hover-trailing-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_label-text-color: var(--md-outlined-field-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_label-text-padding-bottom: var(--md-outlined-field-label-text-padding-bottom, 8px);--_label-text-populated-line-height: var(--md-outlined-field-label-text-populated-line-height, 1rem);--_label-text-populated-size: var(--md-outlined-field-label-text-populated-size, 0.75rem);--_label-text-type: var(--md-outlined-field-label-text-type, 400 1rem / 1.5rem var(--md-ref-typeface-plain, Roboto));--_leading-content-color: var(--md-outlined-field-leading-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_outline-color: var(--md-outlined-field-outline-color, var(--md-sys-color-outline, #79747e));--_outline-label-padding: var(--md-outlined-field-outline-label-padding, 4px);--_outline-width: var(--md-outlined-field-outline-width, 1px);--_supporting-text-color: var(--md-outlined-field-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_supporting-text-padding: var(--md-outlined-field-supporting-text-padding, 16px);--_supporting-text-padding-top: var(--md-outlined-field-supporting-text-padding-top, 4px);--_supporting-text-type: var(--md-outlined-field-supporting-text-type, 400 0.75rem / 1rem var(--md-ref-typeface-plain, Roboto));--_trailing-content-color: var(--md-outlined-field-trailing-content-color, var(--md-sys-color-on-surface-variant, #49454f));--_container-shape-start-start: var( --md-outlined-field-container-shape-start-start, var(--_container-shape) );--_container-shape-start-end: var( --md-outlined-field-container-shape-start-end, var(--_container-shape) );--_container-shape-end-end: var( --md-outlined-field-container-shape-end-end, var(--_container-shape) );--_container-shape-end-start: var( --md-outlined-field-container-shape-end-start, var(--_container-shape) )}.outline{border-color:var(--_outline-color);border-radius:inherit;color:var(--_outline-color);display:flex;pointer-events:none;height:100%;position:absolute;width:100%}.outline-start::before,.outline-start::after,.outline-panel-inactive::before,.outline-panel-inactive::after,.outline-panel-active::before,.outline-panel-active::after,.outline-end::before,.outline-end::after{border:inherit;content:"";inset:0;position:absolute}.outline-start,.outline-end{border:inherit;border-radius:inherit;box-sizing:border-box;position:relative}.outline-start::before,.outline-start::after,.outline-end::before,.outline-end::after{border-bottom-style:solid;border-top-style:solid}.outline-start::after,.outline-end::after{opacity:0;transition:opacity 150ms cubic-bezier(0.2, 0, 0, 1)}.focused .outline-start::after,.focused .outline-end::after{opacity:1}.outline-start::before,.outline-start::after{border-inline-start-style:solid;border-inline-end-style:none;border-start-start-radius:inherit;border-start-end-radius:0;border-end-start-radius:inherit;border-end-end-radius:0;margin-inline-end:var(--_outline-label-padding)}.outline-end{flex-grow:1;margin-inline-start:calc(-1*var(--_outline-label-padding))}.outline-end::before,.outline-end::after{border-inline-start-style:none;border-inline-end-style:solid;border-start-start-radius:0;border-start-end-radius:inherit;border-end-start-radius:0;border-end-end-radius:inherit}.outline-notch{align-items:flex-start;border:inherit;display:flex;margin-inline-start:calc(-1*var(--_outline-label-padding));margin-inline-end:var(--_outline-label-padding);max-width:calc(100% - 2*var(--_container-padding-horizontal));padding:0 var(--_outline-label-padding);position:relative}.no-label .outline-notch{display:none}.outline-panel-inactive,.outline-panel-active{border:inherit;border-bottom-style:solid;inset:0;position:absolute}.outline-panel-inactive::before,.outline-panel-inactive::after,.outline-panel-active::before,.outline-panel-active::after{border-top-style:solid;border-bottom:none;bottom:auto;transform:scaleX(1);transition:transform 150ms cubic-bezier(0.2, 0, 0, 1)}.outline-panel-inactive::before,.outline-panel-active::before{right:50%;transform-origin:top left}.outline-panel-inactive::after,.outline-panel-active::after{left:50%;transform-origin:top right}.populated .outline-panel-inactive::before,.populated .outline-panel-inactive::after,.populated .outline-panel-active::before,.populated .outline-panel-active::after,.focused .outline-panel-inactive::before,.focused .outline-panel-inactive::after,.focused .outline-panel-active::before,.focused .outline-panel-active::after{transform:scaleX(0)}.outline-panel-active{opacity:0;transition:opacity 150ms cubic-bezier(0.2, 0, 0, 1)}.focused .outline-panel-active{opacity:1}.outline-label{display:flex;max-width:100%;transform:translateY(calc(-100% + var(--_label-text-padding-bottom)))}.outline-start,.field:not(.with-start) .start{padding-inline-start:max(var(--_container-padding-horizontal),max(var(--_container-shape-start-start),var(--_container-shape-end-start)) + var(--_outline-label-padding))}.field:not(.with-end) .end{padding-inline-end:max(var(--_container-padding-horizontal),max(var(--_container-shape-start-end),var(--_container-shape-end-end)))}.outline-start::before,.outline-end::before,.outline-panel-inactive,.outline-panel-inactive::before,.outline-panel-inactive::after{border-width:var(--_outline-width)}:hover .outline{border-color:var(--_hover-outline-color);color:var(--_hover-outline-color)}:hover .outline-start::before,:hover .outline-end::before,:hover .outline-panel-inactive,:hover .outline-panel-inactive::before,:hover .outline-panel-inactive::after{border-width:var(--_hover-outline-width)}.focused .outline{border-color:var(--_focus-outline-color);color:var(--_focus-outline-color)}.outline-start::after,.outline-end::after,.outline-panel-active,.outline-panel-active::before,.outline-panel-active::after{border-width:var(--_focus-outline-width)}.disabled .outline{border-color:var(--_disabled-outline-color);color:var(--_disabled-outline-color)}.disabled .outline-start,.disabled .outline-end,.disabled .outline-panel-inactive{opacity:var(--_disabled-outline-opacity)}.disabled .outline-start::before,.disabled .outline-end::before,.disabled .outline-panel-inactive,.disabled .outline-panel-inactive::before,.disabled .outline-panel-inactive::after{border-width:var(--_disabled-outline-width)}.error .outline{border-color:var(--_error-outline-color);color:var(--_error-outline-color)}.error:hover .outline{border-color:var(--_error-hover-outline-color);color:var(--_error-hover-outline-color)}.error.focused .outline{border-color:var(--_error-focus-outline-color);color:var(--_error-focus-outline-color)}/*# sourceMappingURL=outlined-styles.css.map */ `; //# sourceMappingURL=outlined-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/field/lib/shared-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/field/lib/shared-styles.css.js index 60b0594..a1a29e7 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/field/lib/shared-styles.css.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/field/lib/shared-styles.css.js
@@ -4,6 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ import { css } from 'lit'; -export const styles = css `:host{display:inline-flex}.md3-field{display:inline-flex;flex:1;flex-direction:column;writing-mode:horizontal-tb}.md3-field__container{align-items:center;box-sizing:border-box;display:flex;flex:1;flex-basis:var(--_container-height);padding-top:var(--_container-padding-vertical);padding-bottom:var(--_container-padding-vertical);position:relative}.md3-field--disabled{pointer-events:none}.md3-field--with-start .md3-field__start,.md3-field--with-end .md3-field__end{min-width:48px}.md3-field--with-start .md3-field__start{margin-inline-end:4px}.md3-field--with-end .md3-field__end{margin-inline-start:4px}.md3-field__start,.md3-field__middle,.md3-field__end{display:flex;align-items:center;box-sizing:border-box;height:100%;position:relative}.md3-field__start,.md3-field__end{justify-content:center}.md3-field__middle{align-self:baseline;flex:1}.md3-field__content{display:flex;flex:1;opacity:0;transition:opacity 83ms cubic-bezier(0.4, 0, 0.2, 1);color:var(--_content-color)}.md3-field--no-label .md3-field__content,.md3-field--focused .md3-field__content,.md3-field--populated .md3-field__content{opacity:1;transition-delay:67ms}.md3-field--disabled.md3-field--no-label .md3-field__content,.md3-field--disabled.md3-field--focused .md3-field__content,.md3-field--disabled.md3-field--populated .md3-field__content{opacity:var(--_disabled-content-opacity)}:hover .md3-field__content{color:var(--_hover-content-color)}.md3-field--focused .md3-field__content{color:var(--_focus-content-color)}.md3-field--disabled .md3-field__content{color:var(--_disabled-content-color)}.md3-field--error:not(.md3-field--disabled) .md3-field__content{color:var(--_error-content-color)}.md3-field--error:not(.md3-field--disabled):hover .md3-field__content{color:var(--_error-hover-content-color)}.md3-field--error:not(.md3-field--disabled).md3-field--focused .md3-field__content{color:var(--_error-focus-content-color)}.md3-field__label{color:var(--_label-text-color);overflow:hidden;max-width:100%;pointer-events:none;text-overflow:ellipsis;white-space:nowrap;z-index:1;font-family:var(--_label-text-font);font-weight:var(--_label-text-weight);letter-spacing:var(--_label-text-tracking)}.md3-field__label--resting{position:absolute;top:50%;transform:translateY(-50%);transform-origin:top left;font-size:var(--_label-text-size);line-height:var(--_label-text-line-height)}.md3-field__label--floating{font-size:var(--_label-text-populated-size);line-height:var(--_label-text-populated-line-height)}.md3-field__label--hidden{opacity:0}.md3-field--no-label .md3-field__label{display:none}:hover .md3-field__label{color:var(--_hover-label-text-color)}.md3-field--focused .md3-field__label{color:var(--_focus-label-text-color)}.md3-field--disabled .md3-field__label{color:var(--_disabled-label-text-color)}.md3-field--disabled .md3-field__label:not(.md3-field__label--hidden){opacity:var(--_disabled-label-text-opacity)}.md3-field--error:not(.md3-field--disabled) .md3-field__label{color:var(--_error-label-text-color)}.md3-field--error:not(.md3-field--disabled):hover .md3-field__label{color:var(--_error-hover-label-text-color)}.md3-field--error:not(.md3-field--disabled).md3-field--focused .md3-field__label{color:var(--_error-focus-label-text-color)}.md3-field__supporting-text{color:var(--_supporting-text-color);display:flex;justify-content:space-between;padding:0 var(--_supporting-text-padding);font-family:var(--_supporting-text-font);font-size:var(--_supporting-text-size);font-weight:var(--_supporting-text-weight);letter-spacing:var(--_supporting-text-tracking);line-height:var(--_supporting-text-line-height)}.md3-field__supporting-text-start,.md3-field__supporting-text-end{display:flex}.md3-field__supporting-text-start ::slotted(:not(:empty)),.md3-field__supporting-text-end ::slotted(:not(:empty)){padding-top:var(--_supporting-text-padding-top)}.md3-field__supporting-text-end ::slotted(:not(:empty)){padding-inline-start:var(--_supporting-text-padding)}:hover .md3-field__supporting-text{color:var(--_hover-supporting-text-color)}.md3-field--focus .md3-field__supporting-text{color:var(--_focus-supporting-text-color)}.md3-field--disabled .md3-field__supporting-text{color:var(--_disabled-supporting-text-color);opacity:var(--_disabled-supporting-text-opacity)}.md3-field--error:not(.md3-field--disabled) .md3-field__supporting-text{color:var(--_error-supporting-text-color)}.md3-field--error:not(.md3-field--disabled):hover .md3-field__supporting-text{color:var(--_error-hover-supporting-text-color)}.md3-field--error:not(.md3-field--disabled).md3-field--focus .md3-field__supporting-text{color:var(--_error-focus-supporting-text-color)}/*# sourceMappingURL=shared-styles.css.map */ +export const styles = css `:host{display:inline-flex}.field{display:flex;flex:1;flex-direction:column;writing-mode:horizontal-tb;max-width:100%}.container-overflow{border-start-start-radius:var(--_container-shape-start-start);border-start-end-radius:var(--_container-shape-start-end);border-end-end-radius:var(--_container-shape-end-end);border-end-start-radius:var(--_container-shape-end-start);display:flex;position:relative}.container{align-items:center;border-radius:inherit;display:flex;flex:1;min-width:min-content;overflow:hidden;padding-top:var(--_container-padding-vertical);padding-bottom:var(--_container-padding-vertical);position:relative}.resizable .container{resize:both}.disabled{pointer-events:none}.start,.middle,.end{display:flex;box-sizing:border-box;height:100%;position:relative}.start{color:var(--_leading-content-color)}.end{color:var(--_trailing-content-color)}.start,.end{align-items:center;justify-content:center}.with-start .start,.with-end .end{min-width:48px}.with-start .start{margin-inline-end:4px}.with-end .end{margin-inline-start:4px}.middle{align-items:stretch;align-self:baseline;flex:1}.content{color:var(--_content-color);display:flex;flex:1;font:var(--_content-type);opacity:0;transition:opacity 83ms cubic-bezier(0.2, 0, 0, 1)}.no-label .content,.focused .content,.populated .content{opacity:1;transition-delay:67ms}:hover .content{color:var(--_hover-content-color)}:hover .start{color:var(--_hover-leading-content-color)}:hover .end{color:var(--_hover-trailing-content-color)}.focused .content{color:var(--_focus-content-color)}.focused .start{color:var(--_focus-leading-content-color)}.focused .end{color:var(--_focus-trailing-content-color)}.disabled .content{color:var(--_disabled-content-color)}.disabled.no-label .content,.disabled.focused .content,.disabled.populated .content{opacity:var(--_disabled-content-opacity)}.disabled .start{color:var(--_disabled-leading-content-color);opacity:var(--_disabled-leading-content-opacity)}.disabled .end{color:var(--_disabled-trailing-content-color);opacity:var(--_disabled-trailing-content-opacity)}.error .content{color:var(--_error-content-color)}.error .start{color:var(--_error-leading-content-color)}.error .end{color:var(--_error-trailing-content-color)}.error:hover .content{color:var(--_error-hover-content-color)}.error:hover .start{color:var(--_error-hover-leading-content-color)}.error:hover .end{color:var(--_error-hover-trailing-content-color)}.error.focused .content{color:var(--_error-focus-content-color)}.error.focused .start{color:var(--_error-focus-leading-content-color)}.error.focused .end{color:var(--_error-focus-trailing-content-color)}.label{color:var(--_label-text-color);overflow:hidden;max-width:100%;pointer-events:none;text-overflow:ellipsis;white-space:nowrap;z-index:1;font:var(--_label-text-type)}.label.resting{position:absolute;top:50%;transform:translateY(-50%)}.label.floating{font-size:var(--_label-text-populated-size);line-height:var(--_label-text-populated-line-height);transform-origin:top left}.label.hidden{opacity:0}.no-label .label{display:none}:hover .label{color:var(--_hover-label-text-color)}.focused .label{color:var(--_focus-label-text-color)}.disabled .label{color:var(--_disabled-label-text-color)}.disabled .label:not(.hidden){opacity:var(--_disabled-label-text-opacity)}.error .label{color:var(--_error-label-text-color)}.error:hover .label{color:var(--_error-hover-label-text-color)}.error.focused .label{color:var(--_error-focus-label-text-color)}.supporting-text{color:var(--_supporting-text-color);display:flex;justify-content:space-between;padding:0 var(--_supporting-text-padding);font:var(--_supporting-text-type)}.supporting-text-start,.supporting-text-end{display:flex}.supporting-text-start ::slotted(:not(:empty)),.supporting-text-end ::slotted(:not(:empty)){padding-top:var(--_supporting-text-padding-top)}.supporting-text-end ::slotted(:not(:empty)){padding-inline-start:var(--_supporting-text-padding)}:hover .supporting-text{color:var(--_hover-supporting-text-color)}.focus .supporting-text{color:var(--_focus-supporting-text-color)}.disabled .supporting-text{color:var(--_disabled-supporting-text-color);opacity:var(--_disabled-supporting-text-opacity)}.error .supporting-text{color:var(--_error-supporting-text-color)}.error:hover .supporting-text{color:var(--_error-hover-supporting-text-color)}.error.focus .supporting-text{color:var(--_error-focus-supporting-text-color)}/*# sourceMappingURL=shared-styles.css.map */ `; //# sourceMappingURL=shared-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/field/outlined-field.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/field/outlined-field.d.ts index 29fbd2cc..91e2c6f5 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/field/outlined-field.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/field/outlined-field.d.ts
@@ -10,7 +10,7 @@ } } /** - * @soyCompatible + * TODO(b/228525797): add docs * @final * @suppress {visibility} */
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/field/outlined-field.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/field/outlined-field.js index 441b9280..1f93795 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/field/outlined-field.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/field/outlined-field.js
@@ -9,7 +9,7 @@ import { styles as outlinedStyles } from './lib/outlined-styles.css.js'; import { styles as sharedStyles } from './lib/shared-styles.css.js'; /** - * @soyCompatible + * TODO(b/228525797): add docs * @final * @suppress {visibility} */
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/focus/focus-ring.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/focus/focus-ring.d.ts index 1c0f0df..509d068a 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/focus/focus-ring.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/focus/focus-ring.d.ts
@@ -10,7 +10,8 @@ } } /** - * @soyCompatible + * TODO(b/267336424): add docs + * * @final * @suppress {visibility} */
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/focus/focus-ring.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/focus/focus-ring.js index a8eeeed..6df43f8 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/focus/focus-ring.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/focus/focus-ring.js
@@ -8,7 +8,8 @@ import { FocusRing } from './lib/focus-ring.js'; import { styles } from './lib/focus-ring-styles.css.js'; /** - * @soyCompatible + * TODO(b/267336424): add docs + * * @final * @suppress {visibility} */
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/focus/lib/focus-ring-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/focus/lib/focus-ring-styles.css.js index a187b9a9..32fad38 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/focus/lib/focus-ring-styles.css.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/focus/lib/focus-ring-styles.css.js
@@ -4,6 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ import { css } from 'lit'; -export const styles = css `:host{--_shape-start-start: var(--md-focus-ring-shape-start-start, 9999px);--_shape-start-end: var(--md-focus-ring-shape-start-end, 9999px);--_shape-end-end: var(--md-focus-ring-shape-end-end, 9999px);--_shape-end-start: var(--md-focus-ring-shape-end-start, 9999px);--_offset-vertical: var(--md-focus-ring-offset-vertical, 2px);--_offset-horizontal: var(--md-focus-ring-offset-horizontal, 2px);--_width: var(--md-focus-ring-width, 3px);--_color: var(--md-focus-ring-color, var(--md-sys-color-secondary, #625b71));display:none;position:absolute;box-sizing:border-box;pointer-events:none;border:var(--_width) solid var(--_color);border-start-start-radius:var(--_shape-start-start);border-start-end-radius:var(--_shape-start-end);border-end-start-radius:var(--_shape-end-start);border-end-end-radius:var(--_shape-end-end);inset:calc(-1*(var(--_offset-vertical) + var(--_width))) calc(-1*(var(--_offset-horizontal) + var(--_width)))}:host([visible]){display:flex}/*# sourceMappingURL=focus-ring-styles.css.map */ +export const styles = css `:host{--_active-width: var(--md-focus-ring-active-width, 8px);--_color: var(--md-focus-ring-color, var(--md-sys-color-secondary, #625b71));--_duration: var(--md-focus-ring-duration, 600ms);--_offset: var(--md-focus-ring-offset, 2px);--_shape: var(--md-focus-ring-shape, 9999px);--_width: var(--md-focus-ring-width, 3px);--_shape-start-start: var(--md-focus-ring-shape-start-start, var(--_shape));--_shape-start-end: var(--md-focus-ring-shape-start-end, var(--_shape));--_shape-end-end: var(--md-focus-ring-shape-end-end, var(--_shape));--_shape-end-start: var(--md-focus-ring-shape-end-start, var(--_shape));animation-duration:var(--_duration);animation-timing-function:cubic-bezier(0.2, 0, 0, 1);border-end-end-radius:calc(var(--_offset) + var(--_shape-end-end));border-end-start-radius:calc(var(--_offset) + var(--_shape-end-start));border-start-end-radius:calc(var(--_offset) + var(--_shape-start-end));border-start-start-radius:calc(var(--_offset) + var(--_shape-start-start));box-shadow:inset 0 0 0 0 currentColor;box-sizing:border-box;color:var(--_color);display:none;inset:calc(-1*(var(--_offset) + 1px));outline-offset:-1px;outline:var(--_width) solid currentColor;pointer-events:none;position:absolute}:host([visible]){display:flex;animation-name:focus-ring}@keyframes focus-ring{from{outline-width:0px}25%{box-shadow:inset 0 0 0 calc(var(--_active-width)/2) currentColor;outline-width:calc(var(--_active-width)/2)}}@media(prefers-reduced-motion){:host{animation:none}}/*# sourceMappingURL=focus-ring-styles.css.map */ `; //# sourceMappingURL=focus-ring-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/focus/lib/focus-ring.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/focus/lib/focus-ring.d.ts index a4c127c8..75783d8 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/focus/lib/focus-ring.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/focus/lib/focus-ring.d.ts
@@ -3,23 +3,70 @@ * Copyright 2021 Google LLC * SPDX-License-Identifier: Apache-2.0 */ -import { LitElement } from 'lit'; +import { LitElement, PropertyValues } from 'lit'; /** - * @summary An accessible, themable ring designed to be shown on - * `:focus-visible`. - * - * @description - * An accessible, themable ring designed to be shown on focus-visible. - * Focus ring is designed to be controlled by the `strong-focus` module in the - * same package. - * - * In most cases, `visible` should be set to - * `shouldShowStrongFocus()` on `focus` and `pointerdown` (see `pointerPress()` - * documentation in the `strong-focus` module), and `false` on `blur`. + * A focus ring component. */ export declare class FocusRing extends LitElement { /** * Makes the focus ring visible. */ visible: boolean; + /** + * Reflects the value of the `for` attribute, which is the ID of the focus + * ring's associated control element. + * + * Use this when the focus ring's associated element is not a parent element. + * + * To manually control a focus ring, set its `for` attribute to `""`. + * + * @example + * ```html + * <div class="container"> + * <md-focus-ring for="interactive"></md-focus-ring> + * <button id="interactive">Action</button> + * </div> + * ``` + * + * @example + * ```html + * <button class="manually-controlled"> + * <md-focus-ring visible for=""></md-focus-ring> + * </button> + * ``` + */ + htmlFor: string | null; + /** + * The element that controls the visibility of the focus ring. It is one of: + * + * - The element referenced by the `for` attribute. + * - The element provided to `.attach(element)` + * - The parent element. + * - `null` if the focus ring is not controlled. + */ + get control(): HTMLElement; + private currentControl; + /** + * Attaches the focus ring to an interactive element. + * + * @param control The element that controls the focus ring. + */ + attach(control: HTMLElement): void; + /** + * Detaches the focus ring from its current interactive element. + */ + detach(): void; + connectedCallback(): void; + disconnectedCallback(): void; + protected updated(changedProperties: PropertyValues<FocusRing>): void; + /** + * @private + */ + handleEvent(event: FocusRingEvent): void; + private setCurrentControl; } +declare const HANDLED_BY_FOCUS_RING: unique symbol; +interface FocusRingEvent extends Event { + [HANDLED_BY_FOCUS_RING]: true; +} +export {};
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/focus/lib/focus-ring.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/focus/lib/focus-ring.js index ab781ae..a6d27dc 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/focus/lib/focus-ring.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/focus/lib/focus-ring.js
@@ -3,21 +3,11 @@ * Copyright 2021 Google LLC * SPDX-License-Identifier: Apache-2.0 */ -import { __decorate, __metadata } from "tslib"; +import { __decorate } from "tslib"; import { LitElement } from 'lit'; import { property } from 'lit/decorators.js'; /** - * @summary An accessible, themable ring designed to be shown on - * `:focus-visible`. - * - * @description - * An accessible, themable ring designed to be shown on focus-visible. - * Focus ring is designed to be controlled by the `strong-focus` module in the - * same package. - * - * In most cases, `visible` should be set to - * `shouldShowStrongFocus()` on `focus` and `pointerdown` (see `pointerPress()` - * documentation in the `strong-focus` module), and `false` on `blur`. + * A focus ring component. */ export class FocusRing extends LitElement { constructor() { @@ -26,10 +16,124 @@ * Makes the focus ring visible. */ this.visible = false; + /** + * Reflects the value of the `for` attribute, which is the ID of the focus + * ring's associated control element. + * + * Use this when the focus ring's associated element is not a parent element. + * + * To manually control a focus ring, set its `for` attribute to `""`. + * + * @example + * ```html + * <div class="container"> + * <md-focus-ring for="interactive"></md-focus-ring> + * <button id="interactive">Action</button> + * </div> + * ``` + * + * @example + * ```html + * <button class="manually-controlled"> + * <md-focus-ring visible for=""></md-focus-ring> + * </button> + * ``` + */ + this.htmlFor = null; + this.currentControl = null; + } + /** + * The element that controls the visibility of the focus ring. It is one of: + * + * - The element referenced by the `for` attribute. + * - The element provided to `.attach(element)` + * - The parent element. + * - `null` if the focus ring is not controlled. + */ + get control() { + if (this.hasAttribute('for')) { + if (!this.htmlFor) { + return null; + } + return this.getRootNode() + .querySelector(`#${this.htmlFor}`); + } + return this.currentControl || this.parentElement; + } + /** + * Attaches the focus ring to an interactive element. + * + * @param control The element that controls the focus ring. + */ + attach(control) { + if (control === this.currentControl) { + return; + } + this.setCurrentControl(control); + // When imperatively attaching the focus ring, remove the `for` attribute so + // that the attached control is used instead of a referenced one. + this.removeAttribute('for'); + } + /** + * Detaches the focus ring from its current interactive element. + */ + detach() { + this.setCurrentControl(null); + // When imperatively detaching, add an empty `for=""` attribute. This will + // ensure the control is `null` rather than the `parentElement`. + this.setAttribute('for', ''); + } + connectedCallback() { + super.connectedCallback(); + this.setCurrentControl(this.control); + } + disconnectedCallback() { + super.disconnectedCallback(); + this.setCurrentControl(null); + } + updated(changedProperties) { + if (changedProperties.has('htmlFor')) { + const { control } = this; + if (control) { + this.setCurrentControl(control); + } + } + } + /** + * @private + */ + handleEvent(event) { + if (event[HANDLED_BY_FOCUS_RING]) { + // This ensures the focus ring does not activate when multiple focus rings + // are used within a single component. + return; + } + switch (event.type) { + default: + return; + case 'focusin': + this.visible = this.control?.matches(':focus-visible') ?? false; + break; + case 'focusout': + case 'pointerdown': + this.visible = false; + break; + } + event[HANDLED_BY_FOCUS_RING] = true; + } + setCurrentControl(control) { + for (const event of ['focusin', 'focusout', 'pointerdown']) { + this.currentControl?.removeEventListener(event, this); + control?.addEventListener(event, this); + } + this.currentControl = control; } } __decorate([ - property({ type: Boolean, reflect: true }), - __metadata("design:type", Object) + property({ type: Boolean, reflect: true }) ], FocusRing.prototype, "visible", void 0); +__decorate([ + property({ attribute: 'for', reflect: true }) +], FocusRing.prototype, "htmlFor", void 0); +const HANDLED_BY_FOCUS_RING = Symbol('handledByFocusRing'); //# sourceMappingURL=focus-ring.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/focus/strong-focus.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/focus/strong-focus.d.ts deleted file mode 100644 index 89c0f62..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/focus/strong-focus.d.ts +++ /dev/null
@@ -1,45 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -interface StrongFocus { - visible: boolean; - setVisible(visible: boolean): void; -} -/** - * Set up integration with alternate global focus tracking object - * - * @param focusGlobal A global focus object to coordinate between multiple - * systems - * @param enableKeydownHandler Set to true to let StrongFocusService listen for - * keyboard navigation - */ -export declare function setup(focusGlobal: StrongFocus, enableKeydownHandler?: boolean): void; -/** - * Returns `true` if the component should show strong focus. - * - * By default, strong focus is shown only on keyboard navigation, and not on - * pointer interaction. - */ -export declare function shouldShowStrongFocus(): boolean; -/** - * Control if strong focus should always be shown on component focus - * - * Defaults to `false` - * - * @param force Forces strong focus on the page. Disables strong focus if false. - */ -export declare function setForceStrongFocus(force: boolean): void; -/** - * If `true`, strong focus is always shown - */ -export declare function isStrongFocusForced(): boolean; -/** - * Components should call this when a user interacts with a component with a - * pointing device. - * - * By default, this will prevent the strong focus from being shown. - */ -export declare function pointerPress(): void; -export {};
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/focus/strong-focus.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/focus/strong-focus.js deleted file mode 100644 index b6575002..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/focus/strong-focus.js +++ /dev/null
@@ -1,86 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -class FocusGlobal { - constructor() { - this.visible = false; - } - setVisible(visible) { - this.visible = visible; - } -} -/** - * This object can be overwritten by the `setup()` function to use a different - * focus coordination object. - */ -let focusObject = new FocusGlobal(); -/** - * Set of keyboard event codes that correspond to keyboard navigation - */ -const KEYBOARD_NAVIGATION_KEYS = new Set(['Tab', 'ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown']); -function keydownHandler(e) { - if (KEYBOARD_NAVIGATION_KEYS.has(e.key)) { - focusObject.setVisible(true); - } -} -/** - * Set up integration with alternate global focus tracking object - * - * @param focusGlobal A global focus object to coordinate between multiple - * systems - * @param enableKeydownHandler Set to true to let StrongFocusService listen for - * keyboard navigation - */ -export function setup(focusGlobal, enableKeydownHandler = false) { - focusObject = focusGlobal; - if (enableKeydownHandler) { - window.addEventListener('keydown', keydownHandler); - } - else { - window.removeEventListener('keydown', keydownHandler); - } -} -/** - * Setting for always showing strong focus - * - * Defaults to false, controlled by `setForceStrongFocus` - */ -let alwaysStrong = false; -/** - * Returns `true` if the component should show strong focus. - * - * By default, strong focus is shown only on keyboard navigation, and not on - * pointer interaction. - */ -export function shouldShowStrongFocus() { - return alwaysStrong || focusObject.visible; -} -/** - * Control if strong focus should always be shown on component focus - * - * Defaults to `false` - * - * @param force Forces strong focus on the page. Disables strong focus if false. - */ -export function setForceStrongFocus(force) { - alwaysStrong = force; -} -/** - * If `true`, strong focus is always shown - */ -export function isStrongFocusForced() { - return alwaysStrong; -} -/** - * Components should call this when a user interacts with a component with a - * pointing device. - * - * By default, this will prevent the strong focus from being shown. - */ -export function pointerPress() { - focusObject.setVisible(false); -} -setup(focusObject, true); -//# sourceMappingURL=strong-focus.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/icon/icon.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/icon/icon.d.ts index 2ae0565..3d2ddd87 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/icon/icon.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/icon/icon.d.ts
@@ -10,7 +10,6 @@ } } /** - * @soyCompatible * @final * @suppress {visibility} */
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/icon/icon.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/icon/icon.js index 8ffb027..a1c66f5 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/icon/icon.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/icon/icon.js
@@ -8,7 +8,6 @@ import { Icon } from './lib/icon.js'; import { styles } from './lib/icon-styles.css.js'; /** - * @soyCompatible * @final * @suppress {visibility} */
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/icon/lib/icon-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/icon/lib/icon-styles.css.js index 7242790f..4e783c1 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/icon/lib/icon-styles.css.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/icon/lib/icon-styles.css.js
@@ -4,6 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ import { css } from 'lit'; -export const styles = css `:host{--_color: var(--md-icon-color, inherit);--_font: var(--md-icon-font, "Material Icons");--_font-variation-settings: var(--md-icon-font-variation-settings, inherit);--_size: var(--md-icon-size, 24px);--_weight: var(--md-icon-weight, 400);display:inline-flex;color:var(--_color);font-family:var(--_font);font-weight:var(--_weight);font-style:normal;font-size:var(--_size);font-variation-settings:var(--_font-varation-settings);line-height:1;letter-spacing:normal;text-transform:none;white-space:nowrap;word-wrap:normal;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale}span ::slotted(svg){fill:currentColor}span ::slotted(*){height:var(--_size);width:var(--_size)}/*# sourceMappingURL=icon-styles.css.map */ +export const styles = css `:host{--_color: var(--md-icon-color, inherit);--_font: var(--md-icon-font, "Material Symbols Outlined");--_font-variation-settings: var(--md-icon-font-variation-settings, inherit);--_size: var(--md-icon-size, 24px);--_weight: var(--md-icon-weight, 400);display:inline-flex;color:var(--_color);font-family:var(--_font);font-weight:var(--_weight);font-style:normal;font-size:var(--_size);font-variation-settings:var(--_font-variation-settings);line-height:1;overflow:hidden;letter-spacing:normal;text-transform:none;white-space:nowrap;word-wrap:normal;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale}span ::slotted(svg){fill:currentColor}span ::slotted(*){height:var(--_size);width:var(--_size)}/*# sourceMappingURL=icon-styles.css.map */ `; //# sourceMappingURL=icon-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/icon/lib/icon.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/icon/lib/icon.d.ts index 2576747..662640c 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/icon/lib/icon.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/icon/lib/icon.d.ts
@@ -3,9 +3,10 @@ * Copyright 2022 Google LLC * SPDX-License-Identifier: Apache-2.0 */ -import { LitElement, TemplateResult } from 'lit'; -/** @soyCompatible */ +import { LitElement } from 'lit'; +/** + * TODO(b/265336902): add docs + */ export declare class Icon extends LitElement { - /** @soyTemplate */ - protected render(): TemplateResult; + protected render(): import("lit-html").TemplateResult<1>; }
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/icon/lib/icon.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/icon/lib/icon.js index 10634a28..d342983 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/icon/lib/icon.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/icon/lib/icon.js
@@ -4,9 +4,10 @@ * SPDX-License-Identifier: Apache-2.0 */ import { html, LitElement } from 'lit'; -/** @soyCompatible */ +/** + * TODO(b/265336902): add docs + */ export class Icon extends LitElement { - /** @soyTemplate */ render() { return html `<span><slot></slot></span>`; }
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/filled-icon-button-toggle.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/filled-icon-button-toggle.d.ts deleted file mode 100644 index 71e3d13..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/filled-icon-button-toggle.d.ts +++ /dev/null
@@ -1,31 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { ClassInfo } from 'lit/directives/class-map.js'; -import { IconButtonToggle } from './lib/icon-button-toggle.js'; -declare global { - interface HTMLElementTagNameMap { - 'md-filled-icon-button-toggle': MdFilledIconButtonToggle; - } -} -/** - * @summary Icon buttons help people take supplementary actions with a single - * tap. This variant can toggle between icons. - * - * @description - * __Emphasis:__ Low emphasis – For optional or supplementary actions with the - * least amount of prominence. - * - * __Rationale:__ The most compact and unobtrusive type of button, icon buttons - * are used for optional supplementary actions such as "Bookmark" or "Star." - * - * __Example usages:__ - * - Add to Favorites - * - Print - */ -export declare class MdFilledIconButtonToggle extends IconButtonToggle { - static styles: import("lit").CSSResult[]; - protected getRenderClasses(): ClassInfo; -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/filled-icon-button-toggle.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/filled-icon-button-toggle.js deleted file mode 100644 index 55a782d..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/filled-icon-button-toggle.js +++ /dev/null
@@ -1,40 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { __decorate } from "tslib"; -import { customElement } from 'lit/decorators.js'; -import { styles } from './lib/filled-styles.css.js'; -import { IconButtonToggle } from './lib/icon-button-toggle.js'; -import { styles as sharedStyles } from './lib/shared-styles.css.js'; -/** - * @summary Icon buttons help people take supplementary actions with a single - * tap. This variant can toggle between icons. - * - * @description - * __Emphasis:__ Low emphasis – For optional or supplementary actions with the - * least amount of prominence. - * - * __Rationale:__ The most compact and unobtrusive type of button, icon buttons - * are used for optional supplementary actions such as "Bookmark" or "Star." - * - * __Example usages:__ - * - Add to Favorites - * - Print - */ -let MdFilledIconButtonToggle = class MdFilledIconButtonToggle extends IconButtonToggle { - getRenderClasses() { - return { - ...super.getRenderClasses(), - 'md3-icon-button--filled': true, - 'md3-icon-button--toggle-filled': true, - }; - } -}; -MdFilledIconButtonToggle.styles = [sharedStyles, styles]; -MdFilledIconButtonToggle = __decorate([ - customElement('md-filled-icon-button-toggle') -], MdFilledIconButtonToggle); -export { MdFilledIconButtonToggle }; -//# sourceMappingURL=filled-icon-button-toggle.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/filled-icon-button.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/filled-icon-button.d.ts index 768dc14..fa55620 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/filled-icon-button.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/filled-icon-button.d.ts
@@ -3,7 +3,6 @@ * Copyright 2022 Google LLC * SPDX-License-Identifier: Apache-2.0 */ -import { ClassInfo } from 'lit/directives/class-map.js'; import { IconButton } from './lib/icon-button.js'; declare global { interface HTMLElementTagNameMap { @@ -27,5 +26,10 @@ */ export declare class MdFilledIconButton extends IconButton { static styles: import("lit").CSSResult[]; - protected getRenderClasses(): ClassInfo; + protected getRenderClasses(): { + 'md3-icon-button--filled': boolean; + 'md3-icon-button--toggle-filled': boolean; + 'md3-icon-button--flip-icon': boolean; + 'md3-icon-button--selected': boolean; + }; }
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/filled-icon-button.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/filled-icon-button.js index f48b0603..90e5d89 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/filled-icon-button.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/filled-icon-button.js
@@ -28,6 +28,7 @@ return { ...super.getRenderClasses(), 'md3-icon-button--filled': true, + 'md3-icon-button--toggle-filled': this.toggle, }; } };
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/filled-link-icon-button.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/filled-link-icon-button.d.ts deleted file mode 100644 index 90d394d5..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/filled-link-icon-button.d.ts +++ /dev/null
@@ -1,31 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { ClassInfo } from 'lit/directives/class-map.js'; -import { LinkIconButton } from './lib/link-icon-button.js'; -declare global { - interface HTMLElementTagNameMap { - 'md-filled-link-icon-button': MdFilledLinkIconButton; - } -} -/** - * @summary Icon buttons help people take supplementary actions with a single - * tap. This is a linkable variant. - * - * @description - * __Emphasis:__ Low emphasis – For optional or supplementary actions with the - * least amount of prominence. - * - * __Rationale:__ The most compact and unobtrusive type of button, icon buttons - * are used for optional supplementary actions such as "Bookmark" or "Star." - * - * __Example usages:__ - * - Add to Favorites - * - Print - */ -export declare class MdFilledLinkIconButton extends LinkIconButton { - static styles: import("lit").CSSResult[]; - protected getRenderClasses(): ClassInfo; -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/filled-link-icon-button.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/filled-link-icon-button.js deleted file mode 100644 index 079c99e3..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/filled-link-icon-button.js +++ /dev/null
@@ -1,39 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { __decorate } from "tslib"; -import { customElement } from 'lit/decorators.js'; -import { styles } from './lib/filled-styles.css.js'; -import { LinkIconButton } from './lib/link-icon-button.js'; -import { styles as sharedStyles } from './lib/shared-styles.css.js'; -/** - * @summary Icon buttons help people take supplementary actions with a single - * tap. This is a linkable variant. - * - * @description - * __Emphasis:__ Low emphasis – For optional or supplementary actions with the - * least amount of prominence. - * - * __Rationale:__ The most compact and unobtrusive type of button, icon buttons - * are used for optional supplementary actions such as "Bookmark" or "Star." - * - * __Example usages:__ - * - Add to Favorites - * - Print - */ -let MdFilledLinkIconButton = class MdFilledLinkIconButton extends LinkIconButton { - getRenderClasses() { - return { - ...super.getRenderClasses(), - 'md3-icon-button--filled': true, - }; - } -}; -MdFilledLinkIconButton.styles = [sharedStyles, styles]; -MdFilledLinkIconButton = __decorate([ - customElement('md-filled-link-icon-button') -], MdFilledLinkIconButton); -export { MdFilledLinkIconButton }; -//# sourceMappingURL=filled-link-icon-button.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/filled-tonal-icon-button-toggle.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/filled-tonal-icon-button-toggle.d.ts deleted file mode 100644 index a0a15f6..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/filled-tonal-icon-button-toggle.d.ts +++ /dev/null
@@ -1,31 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { ClassInfo } from 'lit/directives/class-map.js'; -import { IconButtonToggle } from './lib/icon-button-toggle.js'; -declare global { - interface HTMLElementTagNameMap { - 'md-filled-tonal-icon-button-toggle': MdFilledTonalIconButtonToggle; - } -} -/** - * @summary Icon buttons help people take supplementary actions with a single - * tap. This variant can toggle between icons. - * - * @description - * __Emphasis:__ Low emphasis – For optional or supplementary actions with the - * least amount of prominence. - * - * __Rationale:__ The most compact and unobtrusive type of button, icon buttons - * are used for optional supplementary actions such as "Bookmark" or "Star." - * - * __Example usages:__ - * - Add to Favorites - * - Print - */ -export declare class MdFilledTonalIconButtonToggle extends IconButtonToggle { - static styles: import("lit").CSSResult[]; - protected getRenderClasses(): ClassInfo; -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/filled-tonal-icon-button-toggle.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/filled-tonal-icon-button-toggle.js deleted file mode 100644 index 5cc014a..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/filled-tonal-icon-button-toggle.js +++ /dev/null
@@ -1,40 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { __decorate } from "tslib"; -import { customElement } from 'lit/decorators.js'; -import { styles } from './lib/filled-tonal-styles.css.js'; -import { IconButtonToggle } from './lib/icon-button-toggle.js'; -import { styles as sharedStyles } from './lib/shared-styles.css.js'; -/** - * @summary Icon buttons help people take supplementary actions with a single - * tap. This variant can toggle between icons. - * - * @description - * __Emphasis:__ Low emphasis – For optional or supplementary actions with the - * least amount of prominence. - * - * __Rationale:__ The most compact and unobtrusive type of button, icon buttons - * are used for optional supplementary actions such as "Bookmark" or "Star." - * - * __Example usages:__ - * - Add to Favorites - * - Print - */ -let MdFilledTonalIconButtonToggle = class MdFilledTonalIconButtonToggle extends IconButtonToggle { - getRenderClasses() { - return { - ...super.getRenderClasses(), - 'md3-icon-button--filled-tonal': true, - 'md3-icon-button--toggle-filled-tonal': true, - }; - } -}; -MdFilledTonalIconButtonToggle.styles = [sharedStyles, styles]; -MdFilledTonalIconButtonToggle = __decorate([ - customElement('md-filled-tonal-icon-button-toggle') -], MdFilledTonalIconButtonToggle); -export { MdFilledTonalIconButtonToggle }; -//# sourceMappingURL=filled-tonal-icon-button-toggle.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/filled-tonal-icon-button.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/filled-tonal-icon-button.d.ts index c0b5945..6c987dd0 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/filled-tonal-icon-button.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/filled-tonal-icon-button.d.ts
@@ -3,7 +3,6 @@ * Copyright 2022 Google LLC * SPDX-License-Identifier: Apache-2.0 */ -import { ClassInfo } from 'lit/directives/class-map.js'; import { IconButton } from './lib/icon-button.js'; declare global { interface HTMLElementTagNameMap { @@ -27,5 +26,10 @@ */ export declare class MdFilledTonalIconButton extends IconButton { static styles: import("lit").CSSResult[]; - protected getRenderClasses(): ClassInfo; + protected getRenderClasses(): { + 'md3-icon-button--filled-tonal': boolean; + 'md3-icon-button--toggle-filled-tonal': boolean; + 'md3-icon-button--flip-icon': boolean; + 'md3-icon-button--selected': boolean; + }; }
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/filled-tonal-icon-button.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/filled-tonal-icon-button.js index dc22466f..280e76f4 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/filled-tonal-icon-button.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/filled-tonal-icon-button.js
@@ -28,6 +28,7 @@ return { ...super.getRenderClasses(), 'md3-icon-button--filled-tonal': true, + 'md3-icon-button--toggle-filled-tonal': this.toggle, }; } };
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/filled-tonal-link-icon-button.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/filled-tonal-link-icon-button.d.ts deleted file mode 100644 index 057baee..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/filled-tonal-link-icon-button.d.ts +++ /dev/null
@@ -1,31 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { ClassInfo } from 'lit/directives/class-map.js'; -import { LinkIconButton } from './lib/link-icon-button.js'; -declare global { - interface HTMLElementTagNameMap { - 'md-filled-tonal-link-icon-button': MdFilledTonalLinkIconButton; - } -} -/** - * @summary Icon buttons help people take supplementary actions with a single - * tap. This is a linkable variant. - * - * @description - * __Emphasis:__ Low emphasis – For optional or supplementary actions with the - * least amount of prominence. - * - * __Rationale:__ The most compact and unobtrusive type of button, icon buttons - * are used for optional supplementary actions such as "Bookmark" or "Star." - * - * __Example usages:__ - * - Add to Favorites - * - Print - */ -export declare class MdFilledTonalLinkIconButton extends LinkIconButton { - static styles: import("lit").CSSResult[]; - protected getRenderClasses(): ClassInfo; -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/filled-tonal-link-icon-button.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/filled-tonal-link-icon-button.js deleted file mode 100644 index 8a18244..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/filled-tonal-link-icon-button.js +++ /dev/null
@@ -1,39 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { __decorate } from "tslib"; -import { customElement } from 'lit/decorators.js'; -import { styles } from './lib/filled-tonal-styles.css.js'; -import { LinkIconButton } from './lib/link-icon-button.js'; -import { styles as sharedStyles } from './lib/shared-styles.css.js'; -/** - * @summary Icon buttons help people take supplementary actions with a single - * tap. This is a linkable variant. - * - * @description - * __Emphasis:__ Low emphasis – For optional or supplementary actions with the - * least amount of prominence. - * - * __Rationale:__ The most compact and unobtrusive type of button, icon buttons - * are used for optional supplementary actions such as "Bookmark" or "Star." - * - * __Example usages:__ - * - Add to Favorites - * - Print - */ -let MdFilledTonalLinkIconButton = class MdFilledTonalLinkIconButton extends LinkIconButton { - getRenderClasses() { - return { - ...super.getRenderClasses(), - 'md3-icon-button--filled-tonal': true, - }; - } -}; -MdFilledTonalLinkIconButton.styles = [sharedStyles, styles]; -MdFilledTonalLinkIconButton = __decorate([ - customElement('md-filled-tonal-link-icon-button') -], MdFilledTonalLinkIconButton); -export { MdFilledTonalLinkIconButton }; -//# sourceMappingURL=filled-tonal-link-icon-button.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/harness.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/harness.d.ts index 7710a28..e9c7768 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/harness.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/harness.d.ts
@@ -5,10 +5,9 @@ */ import { Harness } from '../testing/harness.js'; import { IconButton } from './lib/icon-button.js'; -import { IconButtonToggle } from './lib/icon-button-toggle.js'; /** * Test harness for icon buttons. */ -export declare class IconButtonHarness extends Harness<IconButton | IconButtonToggle> { - protected getInteractiveElement(): Promise<HTMLElement>; +export declare class IconButtonHarness extends Harness<IconButton> { + protected getInteractiveElement(): Promise<HTMLAnchorElement | HTMLButtonElement>; }
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/lib/filled-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/lib/filled-styles.css.js index 721f64bc..db29553 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/lib/filled-styles.css.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/lib/filled-styles.css.js
@@ -4,6 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ import { css } from 'lit'; -export const styles = css `:host{--_container-shape-start-start: var(--md-filled-icon-button-container-shape-start-start, 9999px);--_container-shape-start-end: var(--md-filled-icon-button-container-shape-start-end, 9999px);--_container-shape-end-end: var(--md-filled-icon-button-container-shape-end-end, 9999px);--_container-shape-end-start: var(--md-filled-icon-button-container-shape-end-start, 9999px);--_container-color: var(--md-filled-icon-button-container-color, var(--md-sys-color-primary, #6750a4));--_container-size: var(--md-filled-icon-button-container-size, 40px);--_disabled-container-color: var(--md-filled-icon-button-disabled-container-color, rgb(var(--md-sys-color-on-surface-rgb, 28, 27, 31), 0.12));--_disabled-icon-color: var(--md-filled-icon-button-disabled-icon-color, rgb(var(--md-sys-color-on-surface-rgb, 28, 27, 31), 0.38));--_focus-icon-color: var(--md-filled-icon-button-focus-icon-color, var(--md-sys-color-on-primary, #fff));--_focus-state-layer-color: var(--md-filled-icon-button-focus-state-layer-color, var(--md-sys-color-on-primary, #fff));--_focus-state-layer-opacity: var(--md-filled-icon-button-focus-state-layer-opacity, 0.12);--_hover-icon-color: var(--md-filled-icon-button-hover-icon-color, var(--md-sys-color-on-primary, #fff));--_hover-state-layer-color: var(--md-filled-icon-button-hover-state-layer-color, var(--md-sys-color-on-primary, #fff));--_hover-state-layer-opacity: var(--md-filled-icon-button-hover-state-layer-opacity, 0.08);--_icon-color: var(--md-filled-icon-button-icon-color, var(--md-sys-color-on-primary, #fff));--_icon-size: var(--md-filled-icon-button-icon-size, 24px);--_pressed-icon-color: var(--md-filled-icon-button-pressed-icon-color, var(--md-sys-color-on-primary, #fff));--_pressed-state-layer-color: var(--md-filled-icon-button-pressed-state-layer-color, var(--md-sys-color-on-primary, #fff));--_pressed-state-layer-opacity: var(--md-filled-icon-button-pressed-state-layer-opacity, 0.12);--_selected-container-color: var(--md-filled-icon-button-selected-container-color, var(--md-sys-color-primary, #6750a4));--_toggle-selected-focus-icon-color: var(--md-filled-icon-button-toggle-selected-focus-icon-color, var(--md-sys-color-on-primary, #fff));--_toggle-selected-focus-state-layer-color: var(--md-filled-icon-button-toggle-selected-focus-state-layer-color, var(--md-sys-color-on-primary, #fff));--_toggle-selected-hover-icon-color: var(--md-filled-icon-button-toggle-selected-hover-icon-color, var(--md-sys-color-on-primary, #fff));--_toggle-selected-hover-state-layer-color: var(--md-filled-icon-button-toggle-selected-hover-state-layer-color, var(--md-sys-color-on-primary, #fff));--_toggle-selected-icon-color: var(--md-filled-icon-button-toggle-selected-icon-color, var(--md-sys-color-on-primary, #fff));--_toggle-selected-pressed-icon-color: var(--md-filled-icon-button-toggle-selected-pressed-icon-color, var(--md-sys-color-on-primary, #fff));--_toggle-selected-pressed-state-layer-color: var(--md-filled-icon-button-toggle-selected-pressed-state-layer-color, var(--md-sys-color-on-primary, #fff));--_toggle-unselected-focus-icon-color: var(--md-filled-icon-button-toggle-unselected-focus-icon-color, var(--md-sys-color-primary, #6750a4));--_toggle-unselected-focus-state-layer-color: var(--md-filled-icon-button-toggle-unselected-focus-state-layer-color, var(--md-sys-color-primary, #6750a4));--_toggle-unselected-hover-icon-color: var(--md-filled-icon-button-toggle-unselected-hover-icon-color, var(--md-sys-color-primary, #6750a4));--_toggle-unselected-hover-state-layer-color: var(--md-filled-icon-button-toggle-unselected-hover-state-layer-color, var(--md-sys-color-primary, #6750a4));--_toggle-unselected-icon-color: var(--md-filled-icon-button-toggle-unselected-icon-color, var(--md-sys-color-primary, #6750a4));--_toggle-unselected-pressed-icon-color: var(--md-filled-icon-button-toggle-unselected-pressed-icon-color, var(--md-sys-color-primary, #6750a4));--_toggle-unselected-pressed-state-layer-color: var(--md-filled-icon-button-toggle-unselected-pressed-state-layer-color, var(--md-sys-color-primary, #6750a4));--_unselected-container-color: var(--md-filled-icon-button-unselected-container-color, var(--md-sys-color-surface-variant, #e7e0ec));--md-focus-ring-shape-start-start:var(--_container-shape-start-start);--md-focus-ring-shape-start-end:var(--_container-shape-start-end);--md-focus-ring-shape-end-end:var(--_container-shape-end-end);--md-focus-ring-shape-end-start:var(--_container-shape-end-start)}.md3-icon-button{background-color:var(--_container-color);color:var(--_icon-color);--md-ripple-focus-state-layer-color:var(--_focus-state-layer-color);--md-ripple-focus-state-layer-opacity:var(--_focus-state-layer-opacity);--md-ripple-hover-state-layer-color:var(--_hover-state-layer-color);--md-ripple-hover-state-layer-opacity:var(--_hover-state-layer-opacity);--md-ripple-pressed-state-layer-color:var(--_pressed-state-layer-color);--md-ripple-pressed-state-layer-opacity:var(--_pressed-state-layer-opacity)}.md3-icon-button:hover{color:var(--_hover-icon-color)}.md3-icon-button:focus{color:var(--_focus-icon-color)}.md3-icon-button:active{color:var(--_pressed-icon-color)}.md3-icon-button:disabled{background-color:var(--_disabled-container-color);color:var(--_disabled-icon-color)}.md3-icon-button--toggle-filled{--md-ripple-focus-state-layer-color:var(--_toggle-unselected-focus-state-layer-color);--md-ripple-hover-state-layer-color:var(--_toggle-unselected-hover-state-layer-color);--md-ripple-pressed-state-layer-color:var(--_toggle-unselected-pressed-state-layer-color)}.md3-icon-button--toggle-filled:not(:disabled){background-color:var(--_unselected-container-color);color:var(--_toggle-unselected-icon-color)}.md3-icon-button--toggle-filled:not(:disabled):hover{color:var(--_toggle-unselected-hover-icon-color)}.md3-icon-button--toggle-filled:not(:disabled):focus{color:var(--_toggle-unselected-focus-icon-color)}.md3-icon-button--toggle-filled:not(:disabled):active{color:var(--_toggle-unselected-pressed-icon-color)}.md3-icon-button--selected{--md-ripple-focus-state-layer-color:var(--_toggle-selected-focus-state-layer-color);--md-ripple-hover-state-layer-color:var(--_toggle-selected-hover-state-layer-color);--md-ripple-pressed-state-layer-color:var(--_toggle-selected-pressed-state-layer-color)}.md3-icon-button--selected:not(:disabled){background-color:var(--_selected-container-color);color:var(--_toggle-selected-icon-color)}.md3-icon-button--selected:not(:disabled):hover{color:var(--_toggle-selected-hover-icon-color)}.md3-icon-button--selected:not(:disabled):focus{color:var(--_toggle-selected-focus-icon-color)}.md3-icon-button--selected:not(:disabled):active{color:var(--_toggle-selected-pressed-icon-color)}/*# sourceMappingURL=filled-styles.css.map */ +export const styles = css `:host{--_container-color: var(--md-filled-icon-button-container-color, var(--md-sys-color-primary, #6750a4));--_container-shape: var(--md-filled-icon-button-container-shape, 9999px);--_container-size: var(--md-filled-icon-button-container-size, 40px);--_disabled-container-color: var(--md-filled-icon-button-disabled-container-color, rgb(var(--md-sys-color-on-surface-rgb, 29, 27, 32), 0.12));--_disabled-icon-color: var(--md-filled-icon-button-disabled-icon-color, rgb(var(--md-sys-color-on-surface-rgb, 29, 27, 32), 0.38));--_focus-icon-color: var(--md-filled-icon-button-focus-icon-color, var(--md-sys-color-on-primary, #fff));--_focus-state-layer-color: var(--md-filled-icon-button-focus-state-layer-color, var(--md-sys-color-on-primary, #fff));--_focus-state-layer-opacity: var(--md-filled-icon-button-focus-state-layer-opacity, 0.12);--_hover-icon-color: var(--md-filled-icon-button-hover-icon-color, var(--md-sys-color-on-primary, #fff));--_hover-state-layer-color: var(--md-filled-icon-button-hover-state-layer-color, var(--md-sys-color-on-primary, #fff));--_hover-state-layer-opacity: var(--md-filled-icon-button-hover-state-layer-opacity, 0.08);--_icon-color: var(--md-filled-icon-button-icon-color, var(--md-sys-color-on-primary, #fff));--_icon-size: var(--md-filled-icon-button-icon-size, 24px);--_pressed-icon-color: var(--md-filled-icon-button-pressed-icon-color, var(--md-sys-color-on-primary, #fff));--_pressed-state-layer-color: var(--md-filled-icon-button-pressed-state-layer-color, var(--md-sys-color-on-primary, #fff));--_pressed-state-layer-opacity: var(--md-filled-icon-button-pressed-state-layer-opacity, 0.12);--_selected-container-color: var(--md-filled-icon-button-selected-container-color, var(--md-sys-color-primary, #6750a4));--_toggle-selected-focus-icon-color: var(--md-filled-icon-button-toggle-selected-focus-icon-color, var(--md-sys-color-on-primary, #fff));--_toggle-selected-focus-state-layer-color: var(--md-filled-icon-button-toggle-selected-focus-state-layer-color, var(--md-sys-color-on-primary, #fff));--_toggle-selected-hover-icon-color: var(--md-filled-icon-button-toggle-selected-hover-icon-color, var(--md-sys-color-on-primary, #fff));--_toggle-selected-hover-state-layer-color: var(--md-filled-icon-button-toggle-selected-hover-state-layer-color, var(--md-sys-color-on-primary, #fff));--_toggle-selected-icon-color: var(--md-filled-icon-button-toggle-selected-icon-color, var(--md-sys-color-on-primary, #fff));--_toggle-selected-pressed-icon-color: var(--md-filled-icon-button-toggle-selected-pressed-icon-color, var(--md-sys-color-on-primary, #fff));--_toggle-selected-pressed-state-layer-color: var(--md-filled-icon-button-toggle-selected-pressed-state-layer-color, var(--md-sys-color-on-primary, #fff));--_toggle-unselected-focus-icon-color: var(--md-filled-icon-button-toggle-unselected-focus-icon-color, var(--md-sys-color-primary, #6750a4));--_toggle-unselected-focus-state-layer-color: var(--md-filled-icon-button-toggle-unselected-focus-state-layer-color, var(--md-sys-color-primary, #6750a4));--_toggle-unselected-hover-icon-color: var(--md-filled-icon-button-toggle-unselected-hover-icon-color, var(--md-sys-color-primary, #6750a4));--_toggle-unselected-hover-state-layer-color: var(--md-filled-icon-button-toggle-unselected-hover-state-layer-color, var(--md-sys-color-primary, #6750a4));--_toggle-unselected-icon-color: var(--md-filled-icon-button-toggle-unselected-icon-color, var(--md-sys-color-primary, #6750a4));--_toggle-unselected-pressed-icon-color: var(--md-filled-icon-button-toggle-unselected-pressed-icon-color, var(--md-sys-color-primary, #6750a4));--_toggle-unselected-pressed-state-layer-color: var(--md-filled-icon-button-toggle-unselected-pressed-state-layer-color, var(--md-sys-color-primary, #6750a4));--_unselected-container-color: var(--md-filled-icon-button-unselected-container-color, var(--md-sys-color-surface-container-highest, #e6e0e9));--_container-shape-start-start: var( --md-filled-icon-button-container-shape-start-start, var(--_container-shape) );--_container-shape-start-end: var( --md-filled-icon-button-container-shape-start-end, var(--_container-shape) );--_container-shape-end-end: var( --md-filled-icon-button-container-shape-end-end, var(--_container-shape) );--_container-shape-end-start: var( --md-filled-icon-button-container-shape-end-start, var(--_container-shape) )}.md3-icon-button{background-color:var(--_container-color);color:var(--_icon-color);--md-ripple-focus-color:var(--_focus-state-layer-color);--md-ripple-focus-opacity:var(--_focus-state-layer-opacity);--md-ripple-hover-color:var(--_hover-state-layer-color);--md-ripple-hover-opacity:var(--_hover-state-layer-opacity);--md-ripple-pressed-color:var(--_pressed-state-layer-color);--md-ripple-pressed-opacity:var(--_pressed-state-layer-opacity)}.md3-icon-button:hover{color:var(--_hover-icon-color)}.md3-icon-button:focus{color:var(--_focus-icon-color)}.md3-icon-button:active{color:var(--_pressed-icon-color)}.md3-icon-button:disabled{background-color:var(--_disabled-container-color);color:var(--_disabled-icon-color)}.md3-icon-button--toggle-filled{--md-ripple-focus-color:var(--_toggle-unselected-focus-state-layer-color);--md-ripple-hover-color:var(--_toggle-unselected-hover-state-layer-color);--md-ripple-pressed-color:var(--_toggle-unselected-pressed-state-layer-color)}.md3-icon-button--toggle-filled:not(:disabled){background-color:var(--_unselected-container-color);color:var(--_toggle-unselected-icon-color)}.md3-icon-button--toggle-filled:not(:disabled):hover{color:var(--_toggle-unselected-hover-icon-color)}.md3-icon-button--toggle-filled:not(:disabled):focus{color:var(--_toggle-unselected-focus-icon-color)}.md3-icon-button--toggle-filled:not(:disabled):active{color:var(--_toggle-unselected-pressed-icon-color)}.md3-icon-button--selected{--md-ripple-focus-color:var(--_toggle-selected-focus-state-layer-color);--md-ripple-hover-color:var(--_toggle-selected-hover-state-layer-color);--md-ripple-pressed-color:var(--_toggle-selected-pressed-state-layer-color)}.md3-icon-button--selected:not(:disabled){background-color:var(--_selected-container-color);color:var(--_toggle-selected-icon-color)}.md3-icon-button--selected:not(:disabled):hover{color:var(--_toggle-selected-hover-icon-color)}.md3-icon-button--selected:not(:disabled):focus{color:var(--_toggle-selected-focus-icon-color)}.md3-icon-button--selected:not(:disabled):active{color:var(--_toggle-selected-pressed-icon-color)}/*# sourceMappingURL=filled-styles.css.map */ `; //# sourceMappingURL=filled-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/lib/filled-tonal-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/lib/filled-tonal-styles.css.js index c02a2fe..ee2212d 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/lib/filled-tonal-styles.css.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/lib/filled-tonal-styles.css.js
@@ -4,6 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ import { css } from 'lit'; -export const styles = css `:host{--_container-shape-start-start: var(--md-filled-tonal-icon-button-container-shape-start-start, 9999px);--_container-shape-start-end: var(--md-filled-tonal-icon-button-container-shape-start-end, 9999px);--_container-shape-end-end: var(--md-filled-tonal-icon-button-container-shape-end-end, 9999px);--_container-shape-end-start: var(--md-filled-tonal-icon-button-container-shape-end-start, 9999px);--_container-color: var(--md-filled-tonal-icon-button-container-color, var(--md-sys-color-secondary-container, #e8def8));--_container-size: var(--md-filled-tonal-icon-button-container-size, 40px);--_disabled-container-color: var(--md-filled-tonal-icon-button-disabled-container-color, rgb(var(--md-sys-color-on-surface-rgb, 28, 27, 31), 0.12));--_disabled-icon-color: var(--md-filled-tonal-icon-button-disabled-icon-color, rgb(var(--md-sys-color-on-surface-rgb, 28, 27, 31), 0.38));--_focus-icon-color: var(--md-filled-tonal-icon-button-focus-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_focus-state-layer-color: var(--md-filled-tonal-icon-button-focus-state-layer-color, var(--md-sys-color-on-secondary-container, #1d192b));--_focus-state-layer-opacity: var(--md-filled-tonal-icon-button-focus-state-layer-opacity, 0.12);--_hover-icon-color: var(--md-filled-tonal-icon-button-hover-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_hover-state-layer-color: var(--md-filled-tonal-icon-button-hover-state-layer-color, var(--md-sys-color-on-secondary-container, #1d192b));--_hover-state-layer-opacity: var(--md-filled-tonal-icon-button-hover-state-layer-opacity, 0.08);--_icon-color: var(--md-filled-tonal-icon-button-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_icon-size: var(--md-filled-tonal-icon-button-icon-size, 24px);--_pressed-icon-color: var(--md-filled-tonal-icon-button-pressed-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_pressed-state-layer-color: var(--md-filled-tonal-icon-button-pressed-state-layer-color, var(--md-sys-color-on-secondary-container, #1d192b));--_pressed-state-layer-opacity: var(--md-filled-tonal-icon-button-pressed-state-layer-opacity, 0.12);--_selected-container-color: var(--md-filled-tonal-icon-button-selected-container-color, var(--md-sys-color-secondary-container, #e8def8));--_toggle-selected-focus-icon-color: var(--md-filled-tonal-icon-button-toggle-selected-focus-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_toggle-selected-focus-state-layer-color: var(--md-filled-tonal-icon-button-toggle-selected-focus-state-layer-color, var(--md-sys-color-on-secondary-container, #1d192b));--_toggle-selected-hover-icon-color: var(--md-filled-tonal-icon-button-toggle-selected-hover-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_toggle-selected-hover-state-layer-color: var(--md-filled-tonal-icon-button-toggle-selected-hover-state-layer-color, var(--md-sys-color-on-secondary-container, #1d192b));--_toggle-selected-icon-color: var(--md-filled-tonal-icon-button-toggle-selected-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_toggle-selected-pressed-icon-color: var(--md-filled-tonal-icon-button-toggle-selected-pressed-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_toggle-selected-pressed-state-layer-color: var(--md-filled-tonal-icon-button-toggle-selected-pressed-state-layer-color, var(--md-sys-color-on-secondary-container, #1d192b));--_toggle-unselected-focus-icon-color: var(--md-filled-tonal-icon-button-toggle-unselected-focus-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_toggle-unselected-focus-state-layer-color: var(--md-filled-tonal-icon-button-toggle-unselected-focus-state-layer-color, var(--md-sys-color-on-surface-variant, #49454f));--_toggle-unselected-hover-icon-color: var(--md-filled-tonal-icon-button-toggle-unselected-hover-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_toggle-unselected-hover-state-layer-color: var(--md-filled-tonal-icon-button-toggle-unselected-hover-state-layer-color, var(--md-sys-color-on-surface-variant, #49454f));--_toggle-unselected-icon-color: var(--md-filled-tonal-icon-button-toggle-unselected-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_toggle-unselected-pressed-icon-color: var(--md-filled-tonal-icon-button-toggle-unselected-pressed-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_toggle-unselected-pressed-state-layer-color: var(--md-filled-tonal-icon-button-toggle-unselected-pressed-state-layer-color, var(--md-sys-color-on-surface-variant, #49454f));--_unselected-container-color: var(--md-filled-tonal-icon-button-unselected-container-color, var(--md-sys-color-surface-variant, #e7e0ec));--md-focus-ring-shape-start-start:var(--_container-shape-start-start);--md-focus-ring-shape-start-end:var(--_container-shape-start-end);--md-focus-ring-shape-end-end:var(--_container-shape-end-end);--md-focus-ring-shape-end-start:var(--_container-shape-end-start)}.md3-icon-button{background-color:var(--_container-color);color:var(--_icon-color);--md-ripple-focus-state-layer-color:var(--_focus-state-layer-color);--md-ripple-focus-state-layer-opacity:var(--_focus-state-layer-opacity);--md-ripple-hover-state-layer-color:var(--_hover-state-layer-color);--md-ripple-hover-state-layer-opacity:var(--_hover-state-layer-opacity);--md-ripple-pressed-state-layer-color:var(--_pressed-state-layer-color);--md-ripple-pressed-state-layer-opacity:var(--_pressed-state-layer-opacity)}.md3-icon-button:hover{color:var(--_hover-icon-color)}.md3-icon-button:focus{color:var(--_focus-icon-color)}.md3-icon-button:active{color:var(--_pressed-icon-color)}.md3-icon-button:disabled{background-color:var(--_disabled-container-color);color:var(--_disabled-icon-color)}.md3-icon-button--toggle-filled-tonal{--md-ripple-focus-state-layer-color:var(--_toggle-unselected-focus-state-layer-color);--md-ripple-hover-state-layer-color:var(--_toggle-unselected-hover-state-layer-color);--md-ripple-pressed-state-layer-color:var(--_toggle-unselected-pressed-state-layer-color)}.md3-icon-button--toggle-filled-tonal:not(:disabled){background-color:var(--_unselected-container-color);color:var(--_toggle-unselected-icon-color)}.md3-icon-button--toggle-filled-tonal:not(:disabled):hover{color:var(--_toggle-unselected-hover-icon-color)}.md3-icon-button--toggle-filled-tonal:not(:disabled):focus{color:var(--_toggle-unselected-focus-icon-color)}.md3-icon-button--toggle-filled-tonal:not(:disabled):active{color:var(--_toggle-unselected-pressed-icon-color)}.md3-icon-button--selected{--md-ripple-focus-state-layer-color:var(--_toggle-selected-focus-state-layer-color);--md-ripple-hover-state-layer-color:var(--_toggle-selected-hover-state-layer-color);--md-ripple-pressed-state-layer-color:var(--_toggle-selected-pressed-state-layer-color)}.md3-icon-button--selected:not(:disabled){background-color:var(--_selected-container-color);color:var(--_toggle-selected-icon-color)}.md3-icon-button--selected:not(:disabled):hover{color:var(--_toggle-selected-hover-icon-color)}.md3-icon-button--selected:not(:disabled):focus{color:var(--_toggle-selected-focus-icon-color)}.md3-icon-button--selected:not(:disabled):active{color:var(--_toggle-selected-pressed-icon-color)}/*# sourceMappingURL=filled-tonal-styles.css.map */ +export const styles = css `:host{--_container-color: var(--md-filled-tonal-icon-button-container-color, var(--md-sys-color-secondary-container, #e8def8));--_container-shape: var(--md-filled-tonal-icon-button-container-shape, 9999px);--_container-size: var(--md-filled-tonal-icon-button-container-size, 40px);--_disabled-container-color: var(--md-filled-tonal-icon-button-disabled-container-color, rgb(var(--md-sys-color-on-surface-rgb, 29, 27, 32), 0.12));--_disabled-icon-color: var(--md-filled-tonal-icon-button-disabled-icon-color, rgb(var(--md-sys-color-on-surface-rgb, 29, 27, 32), 0.38));--_focus-icon-color: var(--md-filled-tonal-icon-button-focus-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_focus-state-layer-color: var(--md-filled-tonal-icon-button-focus-state-layer-color, var(--md-sys-color-on-secondary-container, #1d192b));--_focus-state-layer-opacity: var(--md-filled-tonal-icon-button-focus-state-layer-opacity, 0.12);--_hover-icon-color: var(--md-filled-tonal-icon-button-hover-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_hover-state-layer-color: var(--md-filled-tonal-icon-button-hover-state-layer-color, var(--md-sys-color-on-secondary-container, #1d192b));--_hover-state-layer-opacity: var(--md-filled-tonal-icon-button-hover-state-layer-opacity, 0.08);--_icon-color: var(--md-filled-tonal-icon-button-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_icon-size: var(--md-filled-tonal-icon-button-icon-size, 24px);--_pressed-icon-color: var(--md-filled-tonal-icon-button-pressed-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_pressed-state-layer-color: var(--md-filled-tonal-icon-button-pressed-state-layer-color, var(--md-sys-color-on-secondary-container, #1d192b));--_pressed-state-layer-opacity: var(--md-filled-tonal-icon-button-pressed-state-layer-opacity, 0.12);--_selected-container-color: var(--md-filled-tonal-icon-button-selected-container-color, var(--md-sys-color-secondary-container, #e8def8));--_toggle-selected-focus-icon-color: var(--md-filled-tonal-icon-button-toggle-selected-focus-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_toggle-selected-focus-state-layer-color: var(--md-filled-tonal-icon-button-toggle-selected-focus-state-layer-color, var(--md-sys-color-on-secondary-container, #1d192b));--_toggle-selected-hover-icon-color: var(--md-filled-tonal-icon-button-toggle-selected-hover-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_toggle-selected-hover-state-layer-color: var(--md-filled-tonal-icon-button-toggle-selected-hover-state-layer-color, var(--md-sys-color-on-secondary-container, #1d192b));--_toggle-selected-icon-color: var(--md-filled-tonal-icon-button-toggle-selected-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_toggle-selected-pressed-icon-color: var(--md-filled-tonal-icon-button-toggle-selected-pressed-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_toggle-selected-pressed-state-layer-color: var(--md-filled-tonal-icon-button-toggle-selected-pressed-state-layer-color, var(--md-sys-color-on-secondary-container, #1d192b));--_toggle-unselected-focus-icon-color: var(--md-filled-tonal-icon-button-toggle-unselected-focus-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_toggle-unselected-focus-state-layer-color: var(--md-filled-tonal-icon-button-toggle-unselected-focus-state-layer-color, var(--md-sys-color-on-surface-variant, #49454f));--_toggle-unselected-hover-icon-color: var(--md-filled-tonal-icon-button-toggle-unselected-hover-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_toggle-unselected-hover-state-layer-color: var(--md-filled-tonal-icon-button-toggle-unselected-hover-state-layer-color, var(--md-sys-color-on-surface-variant, #49454f));--_toggle-unselected-icon-color: var(--md-filled-tonal-icon-button-toggle-unselected-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_toggle-unselected-pressed-icon-color: var(--md-filled-tonal-icon-button-toggle-unselected-pressed-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_toggle-unselected-pressed-state-layer-color: var(--md-filled-tonal-icon-button-toggle-unselected-pressed-state-layer-color, var(--md-sys-color-on-surface-variant, #49454f));--_unselected-container-color: var(--md-filled-tonal-icon-button-unselected-container-color, var(--md-sys-color-surface-container-highest, #e6e0e9));--_container-shape-start-start: var( --md-filled-tonal-icon-button-container-shape-start-start, var(--_container-shape) );--_container-shape-start-end: var( --md-filled-tonal-icon-button-container-shape-start-end, var(--_container-shape) );--_container-shape-end-end: var( --md-filled-tonal-icon-button-container-shape-end-end, var(--_container-shape) );--_container-shape-end-start: var( --md-filled-tonal-icon-button-container-shape-end-start, var(--_container-shape) )}.md3-icon-button{background-color:var(--_container-color);color:var(--_icon-color);--md-ripple-focus-color:var(--_focus-state-layer-color);--md-ripple-focus-opacity:var(--_focus-state-layer-opacity);--md-ripple-hover-color:var(--_hover-state-layer-color);--md-ripple-hover-opacity:var(--_hover-state-layer-opacity);--md-ripple-pressed-color:var(--_pressed-state-layer-color);--md-ripple-pressed-opacity:var(--_pressed-state-layer-opacity)}.md3-icon-button:hover{color:var(--_hover-icon-color)}.md3-icon-button:focus{color:var(--_focus-icon-color)}.md3-icon-button:active{color:var(--_pressed-icon-color)}.md3-icon-button:disabled{background-color:var(--_disabled-container-color);color:var(--_disabled-icon-color)}.md3-icon-button--toggle-filled-tonal{--md-ripple-focus-color:var(--_toggle-unselected-focus-state-layer-color);--md-ripple-hover-color:var(--_toggle-unselected-hover-state-layer-color);--md-ripple-pressed-color:var(--_toggle-unselected-pressed-state-layer-color)}.md3-icon-button--toggle-filled-tonal:not(:disabled){background-color:var(--_unselected-container-color);color:var(--_toggle-unselected-icon-color)}.md3-icon-button--toggle-filled-tonal:not(:disabled):hover{color:var(--_toggle-unselected-hover-icon-color)}.md3-icon-button--toggle-filled-tonal:not(:disabled):focus{color:var(--_toggle-unselected-focus-icon-color)}.md3-icon-button--toggle-filled-tonal:not(:disabled):active{color:var(--_toggle-unselected-pressed-icon-color)}.md3-icon-button--selected{--md-ripple-focus-color:var(--_toggle-selected-focus-state-layer-color);--md-ripple-hover-color:var(--_toggle-selected-hover-state-layer-color);--md-ripple-pressed-color:var(--_toggle-selected-pressed-state-layer-color)}.md3-icon-button--selected:not(:disabled){background-color:var(--_selected-container-color);color:var(--_toggle-selected-icon-color)}.md3-icon-button--selected:not(:disabled):hover{color:var(--_toggle-selected-hover-icon-color)}.md3-icon-button--selected:not(:disabled):focus{color:var(--_toggle-selected-focus-icon-color)}.md3-icon-button--selected:not(:disabled):active{color:var(--_toggle-selected-pressed-icon-color)}/*# sourceMappingURL=filled-tonal-styles.css.map */ `; //# sourceMappingURL=filled-tonal-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/lib/icon-button-toggle.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/lib/icon-button-toggle.d.ts deleted file mode 100644 index 37a90de..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/lib/icon-button-toggle.d.ts +++ /dev/null
@@ -1,34 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import '../../focus/focus-ring.js'; -import '../../icon/icon.js'; -import '../../ripple/ripple.js'; -import { TemplateResult } from 'lit'; -import { ClassInfo } from 'lit/directives/class-map.js'; -import { IconButton } from './icon-button.js'; -/** - * @fires change {Event} - * Dispatched whenever `selected` is changed via user click - * - * @fires input {InputEvent} - * Dispatched whenever `selected` is changed via user click - */ -export declare class IconButtonToggle extends IconButton { - /** - * The `aria-label` of the button when the toggle button is selected. - */ - ariaLabelSelected: string; - /** - * Sets the selected state. When false, displays the default icon. When true, - * displays the `selectedIcon`, or the default icon If no `selectedIcon` is - * provided. - */ - selected: boolean; - protected render(): TemplateResult; - protected renderSelectedIcon(): TemplateResult<1>; - protected getRenderClasses(): ClassInfo; - protected handleClick(): void; -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/lib/icon-button-toggle.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/lib/icon-button-toggle.js deleted file mode 100644 index 729905b..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/lib/icon-button-toggle.js +++ /dev/null
@@ -1,87 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { __decorate, __metadata } from "tslib"; -// Required for @ariaProperty -// tslint:disable:no-new-decorators -import '../../focus/focus-ring.js'; -import '../../icon/icon.js'; -import '../../ripple/ripple.js'; -import { html, nothing } from 'lit'; -import { property } from 'lit/decorators.js'; -import { classMap } from 'lit/directives/class-map.js'; -import { when } from 'lit/directives/when.js'; -import { ripple } from '../../ripple/directive.js'; -import { IconButton } from './icon-button.js'; -/** - * @fires change {Event} - * Dispatched whenever `selected` is changed via user click - * - * @fires input {InputEvent} - * Dispatched whenever `selected` is changed via user click - */ -export class IconButtonToggle extends IconButton { - constructor() { - super(...arguments); - /** - * Sets the selected state. When false, displays the default icon. When true, - * displays the `selectedIcon`, or the default icon If no `selectedIcon` is - * provided. - */ - this.selected = false; - } - render() { - const hasToggledAriaLabel = this.ariaLabel && this.ariaLabelSelected; - const ariaPressedValue = hasToggledAriaLabel ? nothing : this.selected; - const ariaLabelValue = (hasToggledAriaLabel && this.selected) ? - this.ariaLabelSelected : - this.ariaLabel; - return html `<button - class="md3-icon-button ${classMap(this.getRenderClasses())}" - aria-pressed="${ariaPressedValue}" - aria-label="${ariaLabelValue || nothing}" - ?disabled="${this.disabled}" - @focus="${this.handleFocus}" - @blur="${this.handleBlur}" - @pointerdown="${this.handlePointerDown}" - @click="${this.handleClick}" - ${ripple(this.getRipple)}> - ${this.renderFocusRing()} - ${when(this.showRipple, this.renderRipple)} - ${this.renderTouchTarget()} - ${!this.selected ? this.renderIcon() : nothing} - ${this.selected ? this.renderSelectedIcon() : nothing} - </button>`; - } - renderSelectedIcon() { - // Use default slot as fallback to not require specifying multiple icons - return html `<md-icon class="md3-icon-button__icon md3-icon-button__icon--selected"><slot name="selectedIcon"><slot></slot></slot></md-icon>`; - } - getRenderClasses() { - return { - ...super.getRenderClasses(), - 'md3-icon-button--selected': this.selected, - }; - } - handleClick() { - if (this.disabled) { - return; - } - this.selected = !this.selected; - this.dispatchEvent(new InputEvent('input', { bubbles: true, composed: true })); - // Bubbles but does not compose to mimic native browser <input> & <select> - // Additionally, native change event is not an InputEvent. - this.dispatchEvent(new Event('change', { bubbles: true })); - } -} -__decorate([ - property({ type: String }), - __metadata("design:type", String) -], IconButtonToggle.prototype, "ariaLabelSelected", void 0); -__decorate([ - property({ type: Boolean, reflect: true }), - __metadata("design:type", Object) -], IconButtonToggle.prototype, "selected", void 0); -//# sourceMappingURL=icon-button-toggle.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/lib/icon-button.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/lib/icon-button.d.ts index 73769d2..72328e5b 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/lib/icon-button.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/lib/icon-button.d.ts
@@ -6,10 +6,7 @@ import '../../focus/focus-ring.js'; import '../../icon/icon.js'; import '../../ripple/ripple.js'; -import { LitElement, TemplateResult } from 'lit'; -import { ClassInfo } from 'lit/directives/class-map.js'; -import { MdRipple } from '../../ripple/ripple.js'; -import { ARIAHasPopup } from '../../types/aria.js'; +import { LitElement } from 'lit'; export declare class IconButton extends LitElement { /** * Disables the icon button and makes it non-interactive. @@ -19,22 +16,48 @@ * Flips the icon if it is in an RTL context at startup. */ flipIconInRtl: boolean; - protected flipIcon: boolean; - ariaLabel: string; - ariaHasPopup: ARIAHasPopup; - protected buttonElement: HTMLElement; - protected ripple: Promise<MdRipple | null>; - protected showFocusRing: boolean; - protected showRipple: boolean; - protected getRipple: () => Promise<MdRipple>; - protected readonly renderRipple: () => TemplateResult<1>; - protected render(): TemplateResult; - protected getRenderClasses(): ClassInfo; - protected renderIcon(): TemplateResult; - protected renderTouchTarget(): TemplateResult; - protected renderFocusRing(): TemplateResult; + /** + * Sets the underlying `HTMLAnchorElement`'s `href` resource attribute. + */ + href: string; + /** + * Sets the underlying `HTMLAnchorElement`'s `target` attribute. + */ + target: string; + /** + * The `aria-label` of the button when the button is toggleable and selected. + */ + selectedAriaLabel: string; + /** + * When true, the button will toggle between selected and unselected + * states + */ + toggle: boolean; + /** + * Sets the selected state. When false, displays the default icon. When true, + * displays the `selectedIcon`, or the default icon If no `selectedIcon` is + * provided. + */ + selected: boolean; + private readonly ripple; + private showRipple; + private flipIcon; + private readonly getRipple; + private readonly renderRipple; + /** + * Link buttons cannot be disabled. + */ + willUpdate(): void; + protected render(): import("lit-html").TemplateResult<2 | 1>; + private renderLink; + protected getRenderClasses(): { + 'md3-icon-button--flip-icon': boolean; + 'md3-icon-button--selected': boolean; + }; + private renderIcon; + private renderSelectedIcon; + private renderTouchTarget; + private renderFocusRing; connectedCallback(): void; - handlePointerDown(): void; - protected handleFocus(): void; - protected handleBlur(): void; + private handleClick; }
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/lib/icon-button.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/lib/icon-button.js index a158b75b..042d7316 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/lib/icon-button.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/lib/icon-button.js
@@ -3,20 +3,18 @@ * Copyright 2018 Google LLC * SPDX-License-Identifier: Apache-2.0 */ -import { __decorate, __metadata } from "tslib"; -// This is required for @ariaProperty -// tslint:disable:no-new-decorators +var _a; +import { __decorate } from "tslib"; import '../../focus/focus-ring.js'; import '../../icon/icon.js'; import '../../ripple/ripple.js'; -import { html, LitElement } from 'lit'; -import { property, query, queryAsync, state } from 'lit/decorators.js'; +import { html, LitElement, nothing } from 'lit'; +import { property, queryAsync, state } from 'lit/decorators.js'; import { classMap } from 'lit/directives/class-map.js'; -import { ifDefined } from 'lit/directives/if-defined.js'; import { when } from 'lit/directives/when.js'; +import { html as staticHtml, literal } from 'lit/static-html.js'; +import { requestUpdateOnAriaChange } from '../../aria/delegate.js'; import { isRtl } from '../../controller/is-rtl.js'; -import { ariaProperty } from '../../decorators/aria-property.js'; -import { pointerPress, shouldShowStrongFocus } from '../../focus/strong-focus.js'; import { ripple } from '../../ripple/directive.js'; // tslint:disable-next-line:enforce-comments-on-exported-symbols export class IconButton extends LitElement { @@ -30,100 +28,152 @@ * Flips the icon if it is in an RTL context at startup. */ this.flipIconInRtl = false; - this.flipIcon = isRtl(this, this.flipIconInRtl); - this.showFocusRing = false; + /** + * Sets the underlying `HTMLAnchorElement`'s `href` resource attribute. + */ + this.href = ''; + /** + * Sets the underlying `HTMLAnchorElement`'s `target` attribute. + */ + this.target = ''; + /** + * When true, the button will toggle between selected and unselected + * states + */ + this.toggle = false; + /** + * Sets the selected state. When false, displays the default icon. When true, + * displays the `selectedIcon`, or the default icon If no `selectedIcon` is + * provided. + */ + this.selected = false; this.showRipple = false; + this.flipIcon = isRtl(this, this.flipIconInRtl); this.getRipple = () => { this.showRipple = true; return this.ripple; }; this.renderRipple = () => { - return html `<md-ripple ?disabled="${this.disabled}"></md-ripple>`; + return html `<md-ripple ?disabled="${!this.href && this.disabled}"></md-ripple>`; }; } + /** + * Link buttons cannot be disabled. + */ + willUpdate() { + if (this.href) { + this.disabled = false; + } + } render() { - return html `<button + const tag = this.href ? literal `div` : literal `button`; + // Needed for closure conformance + const { ariaLabel, ariaHasPopup, ariaExpanded } = this; + const hasToggledAriaLabel = ariaLabel && this.selectedAriaLabel; + const ariaPressedValue = hasToggledAriaLabel ? nothing : this.selected; + let ariaLabelValue = nothing; + if (!this.href) { + ariaLabelValue = (hasToggledAriaLabel && this.selected) ? + this.selectedAriaLabel : + ariaLabel; + } + return staticHtml `<${tag} class="md3-icon-button ${classMap(this.getRenderClasses())}" - aria-label="${ifDefined(this.ariaLabel)}" - aria-haspopup="${ifDefined(this.ariaHasPopup)}" - ?disabled="${this.disabled}" - @focus="${this.handleFocus}" - @blur="${this.handleBlur}" - @pointerdown="${this.handlePointerDown}" + id="button" + aria-label="${ariaLabelValue || nothing}" + aria-haspopup="${!this.href && ariaHasPopup || nothing}" + aria-expanded="${!this.href && ariaExpanded || nothing}" + aria-pressed="${ariaPressedValue}" + ?disabled="${!this.href && this.disabled}" + @click="${this.handleClick}" ${ripple(this.getRipple)}> ${this.renderFocusRing()} ${when(this.showRipple, this.renderRipple)} - ${this.renderIcon()} + ${!this.selected ? this.renderIcon() : nothing} + ${this.selected ? this.renderSelectedIcon() : nothing} ${this.renderTouchTarget()} - </button>`; + ${this.href && this.renderLink()} + </${tag}>`; + } + renderLink() { + // Needed for closure conformance + const { ariaLabel } = this; + return html ` + <a class="md3-icon-button__link" + id="link" + href="${this.href}" + target="${this.target || nothing}" + aria-label="${ariaLabel || nothing}" + ${ripple(this.getRipple)} + ></a> + `; } getRenderClasses() { return { 'md3-icon-button--flip-icon': this.flipIcon, + 'md3-icon-button--selected': this.toggle && this.selected, }; } renderIcon() { - // Note, it's important not to render the icon property as a slot fallback - // to avoid any whitespace from overridding it. return html `<md-icon class="md3-icon-button__icon"><slot></slot></md-icon>`; } + renderSelectedIcon() { + // Use default slot as fallback to not require specifying multiple icons + return html `<md-icon class="md3-icon-button__icon md3-icon-button__icon--selected"><slot name="selectedIcon"><slot></slot></slot></md-icon>`; + } renderTouchTarget() { return html `<span class="md3-icon-button__touch"></span>`; } renderFocusRing() { - return html `<md-focus-ring .visible="${this.showFocusRing}"></md-focus-ring>`; + return html `<md-focus-ring for=${this.href ? 'link' : 'button'}></md-focus-ring>`; } connectedCallback() { this.flipIcon = isRtl(this, this.flipIconInRtl); super.connectedCallback(); } - handlePointerDown() { - pointerPress(); - this.showFocusRing = shouldShowStrongFocus(); - } - handleFocus() { - this.showFocusRing = shouldShowStrongFocus(); - } - handleBlur() { - this.showFocusRing = false; + handleClick() { + if (!this.toggle || this.disabled) { + return; + } + this.selected = !this.selected; + this.dispatchEvent(new InputEvent('input', { bubbles: true, composed: true })); + // Bubbles but does not compose to mimic native browser <input> & <select> + // Additionally, native change event is not an InputEvent. + this.dispatchEvent(new Event('change', { bubbles: true })); } } +_a = IconButton; +(() => { + requestUpdateOnAriaChange(_a); +})(); __decorate([ - property({ type: Boolean, reflect: true }), - __metadata("design:type", Object) + property({ type: Boolean, reflect: true }) ], IconButton.prototype, "disabled", void 0); __decorate([ - property({ type: Boolean }), - __metadata("design:type", Object) + property({ type: Boolean }) ], IconButton.prototype, "flipIconInRtl", void 0); __decorate([ - state(), - __metadata("design:type", Boolean) -], IconButton.prototype, "flipIcon", void 0); + property() +], IconButton.prototype, "href", void 0); __decorate([ - ariaProperty, - property({ type: String, attribute: 'data-aria-label' }), - __metadata("design:type", String) -], IconButton.prototype, "ariaLabel", void 0); + property() +], IconButton.prototype, "target", void 0); __decorate([ - ariaProperty, - property({ type: String, attribute: 'data-aria-haspopup' }), - __metadata("design:type", String) -], IconButton.prototype, "ariaHasPopup", void 0); + property({ attribute: 'selected-aria-label', reflect: true }) +], IconButton.prototype, "selectedAriaLabel", void 0); __decorate([ - query('button'), - __metadata("design:type", HTMLElement) -], IconButton.prototype, "buttonElement", void 0); + property({ type: Boolean }) +], IconButton.prototype, "toggle", void 0); __decorate([ - queryAsync('md-ripple'), - __metadata("design:type", Promise) + property({ type: Boolean, reflect: true }) +], IconButton.prototype, "selected", void 0); +__decorate([ + queryAsync('md-ripple') ], IconButton.prototype, "ripple", void 0); __decorate([ - state(), - __metadata("design:type", Object) -], IconButton.prototype, "showFocusRing", void 0); -__decorate([ - state(), - __metadata("design:type", Object) + state() ], IconButton.prototype, "showRipple", void 0); +__decorate([ + state() +], IconButton.prototype, "flipIcon", void 0); //# sourceMappingURL=icon-button.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/lib/link-icon-button.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/lib/link-icon-button.d.ts deleted file mode 100644 index 3a593bd..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/lib/link-icon-button.d.ts +++ /dev/null
@@ -1,23 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { TemplateResult } from 'lit'; -import { IconButton } from './icon-button.js'; -export declare class LinkIconButton extends IconButton { - /** - * Sets the underlying `HTMLAnchorElement`'s `href` resource attribute. - */ - linkHref: string; - /** - * Sets the underlying `HTMLAnchorElement`'s `target` attribute. - */ - linkTarget: string; - /** - * Link buttons cannot be disabled. - */ - disabled: boolean; - willUpdate(): void; - protected render(): TemplateResult; -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/lib/link-icon-button.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/lib/link-icon-button.js deleted file mode 100644 index be2f12f..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/lib/link-icon-button.js +++ /dev/null
@@ -1,58 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { __decorate, __metadata } from "tslib"; -import { html } from 'lit'; -import { property } from 'lit/decorators.js'; -import { classMap } from 'lit/directives/class-map.js'; -import { ifDefined } from 'lit/directives/if-defined.js'; -import { when } from 'lit/directives/when.js'; -import { ripple } from '../../ripple/directive.js'; -import { IconButton } from './icon-button.js'; -// tslint:disable-next-line:enforce-comments-on-exported-symbols -export class LinkIconButton extends IconButton { - constructor() { - super(...arguments); - /** - * Sets the underlying `HTMLAnchorElement`'s `href` resource attribute. - */ - this.linkHref = ''; - /** - * Link buttons cannot be disabled. - */ - this.disabled = false; - } - willUpdate() { - this.disabled = false; - } - render() { - return html `<div - class="md3-icon-button ${classMap(this.getRenderClasses())}" - @focus="${this.handleFocus}" - @blur="${this.handleBlur}" - @pointerdown="${this.handlePointerDown}" - ${ripple(this.getRipple)}> - ${this.renderFocusRing()} - ${when(this.showRipple, this.renderRipple)} - ${this.renderIcon()} - ${this.renderTouchTarget()} - <a class="md3-icon-button__link" href="${this.linkHref}" - target="${ifDefined(this.linkTarget)}" - aria-label="${ifDefined(this.ariaLabel)}" - @focus="${this.handleFocus}" - @blur="${this.handleBlur}"> - </a> - </div>`; - } -} -__decorate([ - property({ type: String }), - __metadata("design:type", Object) -], LinkIconButton.prototype, "linkHref", void 0); -__decorate([ - property({ type: String }), - __metadata("design:type", String) -], LinkIconButton.prototype, "linkTarget", void 0); -//# sourceMappingURL=link-icon-button.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/lib/outlined-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/lib/outlined-styles.css.js index e560c27a..be15622e 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/lib/outlined-styles.css.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/lib/outlined-styles.css.js
@@ -4,6 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ import { css } from 'lit'; -export const styles = css `:host{--_container-shape-start-start: var(--md-outlined-icon-button-container-shape-start-start, 9999px);--_container-shape-start-end: var(--md-outlined-icon-button-container-shape-start-end, 9999px);--_container-shape-end-end: var(--md-outlined-icon-button-container-shape-end-end, 9999px);--_container-shape-end-start: var(--md-outlined-icon-button-container-shape-end-start, 9999px);--_container-size: var(--md-outlined-icon-button-container-size, 40px);--_disabled-icon-color: var(--md-outlined-icon-button-disabled-icon-color, rgb(var(--md-sys-color-on-surface-rgb, 28, 27, 31), 0.38));--_disabled-selected-container-color: var(--md-outlined-icon-button-disabled-selected-container-color, rgb(var(--md-sys-color-on-surface-rgb, 28, 27, 31), 0.12));--_disabled-unselected-outline-color: var(--md-outlined-icon-button-disabled-unselected-outline-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-unselected-outline-opacity: var(--md-outlined-icon-button-disabled-unselected-outline-opacity, 0.12);--_focus-state-layer-opacity: var(--md-outlined-icon-button-focus-state-layer-opacity, 0.08);--_hover-state-layer-opacity: var(--md-outlined-icon-button-hover-state-layer-opacity, 0.08);--_icon-size: var(--md-outlined-icon-button-icon-size, 24px);--_pressed-state-layer-opacity: var(--md-outlined-icon-button-pressed-state-layer-opacity, 0.12);--_selected-container-color: var(--md-outlined-icon-button-selected-container-color, var(--md-sys-color-inverse-surface, #313033));--_selected-focus-icon-color: var(--md-outlined-icon-button-selected-focus-icon-color, var(--md-sys-color-inverse-on-surface, #f4eff4));--_selected-focus-state-layer-color: var(--md-outlined-icon-button-selected-focus-state-layer-color, var(--md-sys-color-inverse-on-surface, #f4eff4));--_selected-hover-icon-color: var(--md-outlined-icon-button-selected-hover-icon-color, var(--md-sys-color-inverse-on-surface, #f4eff4));--_selected-hover-state-layer-color: var(--md-outlined-icon-button-selected-hover-state-layer-color, var(--md-sys-color-inverse-on-surface, #f4eff4));--_selected-icon-color: var(--md-outlined-icon-button-selected-icon-color, var(--md-sys-color-inverse-on-surface, #f4eff4));--_selected-pressed-icon-color: var(--md-outlined-icon-button-selected-pressed-icon-color, var(--md-sys-color-inverse-on-surface, #f4eff4));--_selected-pressed-state-layer-color: var(--md-outlined-icon-button-selected-pressed-state-layer-color, var(--md-sys-color-inverse-on-surface, #f4eff4));--_unselected-focus-icon-color: var(--md-outlined-icon-button-unselected-focus-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_unselected-focus-state-layer-color: var(--md-outlined-icon-button-unselected-focus-state-layer-color, var(--md-sys-color-on-surface-variant, #49454f));--_unselected-hover-icon-color: var(--md-outlined-icon-button-unselected-hover-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_unselected-hover-state-layer-color: var(--md-outlined-icon-button-unselected-hover-state-layer-color, var(--md-sys-color-on-surface-variant, #49454f));--_unselected-icon-color: var(--md-outlined-icon-button-unselected-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_unselected-outline-color: var(--md-outlined-icon-button-unselected-outline-color, var(--md-sys-color-outline, #79747e));--_unselected-outline-width: var(--md-outlined-icon-button-unselected-outline-width, 1px);--_unselected-pressed-icon-color: var(--md-outlined-icon-button-unselected-pressed-icon-color, var(--md-sys-color-on-surface, #1c1b1f));--_unselected-pressed-state-layer-color: var(--md-outlined-icon-button-unselected-pressed-state-layer-color, var(--md-sys-color-on-surface, #1c1b1f));--md-focus-ring-shape-start-start:var(--_container-shape-start-start);--md-focus-ring-shape-start-end:var(--_container-shape-start-end);--md-focus-ring-shape-end-end:var(--_container-shape-end-end);--md-focus-ring-shape-end-start:var(--_container-shape-end-start)}.md3-icon-button--outlined{background-color:rgba(0,0,0,0);color:var(--_unselected-icon-color);--md-ripple-focus-state-layer-color:var(--_unselected-focus-state-layer-color);--md-ripple-focus-state-layer-opacity:var(--_focus-state-layer-opacity);--md-ripple-hover-state-layer-color:var(--_unselected-hover-state-layer-color);--md-ripple-hover-state-layer-opacity:var(--_hover-state-layer-opacity);--md-ripple-pressed-state-layer-color:var(--_unselected-pressed-state-layer-color);--md-ripple-pressed-state-layer-opacity:var(--_pressed-state-layer-opacity)}.md3-icon-button--outlined::before{border-color:var(--_unselected-outline-color);border-width:var(--_unselected-outline-width)}.md3-icon-button--outlined:hover{color:var(--_unselected-hover-icon-color)}.md3-icon-button--outlined:focus{color:var(--_unselected-focus-icon-color)}.md3-icon-button--outlined:active{color:var(--_unselected-pressed-icon-color)}.md3-icon-button--outlined:disabled{color:var(--_disabled-icon-color)}.md3-icon-button--outlined:disabled::before{border-color:var(--_disabled-unselected-outline-color);opacity:var(--_disabled-unselected-outline-opacity)}.md3-icon-button--outlined::before{block-size:100%;border-style:solid;border-radius:inherit;box-sizing:border-box;content:"";inline-size:100%;inset:0;pointer-events:none;position:absolute}.md3-icon-button--outlined.md3-icon-button--selected::before{border-width:0}.md3-icon-button--selected{--md-ripple-focus-state-layer-color:var(--_selected-focus-state-layer-color);--md-ripple-focus-state-layer-opacity:var(--_focus-state-layer-opacity);--md-ripple-hover-state-layer-color:var(--_selected-hover-state-layer-color);--md-ripple-hover-state-layer-opacity:var(--_hover-state-layer-opacity);--md-ripple-pressed-state-layer-color:var(--_selected-pressed-state-layer-color);--md-ripple-pressed-state-layer-opacity:var(--_pressed-state-layer-opacity)}.md3-icon-button--selected:not(:disabled){background-color:var(--_selected-container-color);color:var(--_selected-icon-color)}.md3-icon-button--selected:not(:disabled):hover{color:var(--_selected-hover-icon-color)}.md3-icon-button--selected:not(:disabled):focus{color:var(--_selected-focus-icon-color)}.md3-icon-button--selected:not(:disabled):active{color:var(--_selected-pressed-icon-color)}.md3-icon-button--selected:disabled{background-color:var(--_disabled-selected-container-color)}@media(forced-colors: active){.md3-icon-button--selected::before{border-color:var(--_unselected-outline-color);border-width:var(--_unselected-outline-width)}.md3-icon-button--selected:disabled::before{border-color:var(--_disabled-unselected-outline-color);opacity:var(--_disabled-unselected-outline-opacity)}}/*# sourceMappingURL=outlined-styles.css.map */ +export const styles = css `:host{--_container-shape: var(--md-outlined-icon-button-container-shape, 9999px);--_container-size: var(--md-outlined-icon-button-container-size, 40px);--_disabled-icon-color: var(--md-outlined-icon-button-disabled-icon-color, rgb(var(--md-sys-color-on-surface-rgb, 29, 27, 32), 0.38));--_disabled-selected-container-color: var(--md-outlined-icon-button-disabled-selected-container-color, rgb(var(--md-sys-color-on-surface-rgb, 29, 27, 32), 0.12));--_disabled-unselected-outline-color: var(--md-outlined-icon-button-disabled-unselected-outline-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-unselected-outline-opacity: var(--md-outlined-icon-button-disabled-unselected-outline-opacity, 0.12);--_focus-state-layer-opacity: var(--md-outlined-icon-button-focus-state-layer-opacity, 0.08);--_hover-state-layer-opacity: var(--md-outlined-icon-button-hover-state-layer-opacity, 0.08);--_icon-size: var(--md-outlined-icon-button-icon-size, 24px);--_pressed-state-layer-opacity: var(--md-outlined-icon-button-pressed-state-layer-opacity, 0.12);--_selected-container-color: var(--md-outlined-icon-button-selected-container-color, var(--md-sys-color-inverse-surface, #322f35));--_selected-focus-icon-color: var(--md-outlined-icon-button-selected-focus-icon-color, var(--md-sys-color-inverse-on-surface, #f5eff7));--_selected-focus-state-layer-color: var(--md-outlined-icon-button-selected-focus-state-layer-color, var(--md-sys-color-inverse-on-surface, #f5eff7));--_selected-hover-icon-color: var(--md-outlined-icon-button-selected-hover-icon-color, var(--md-sys-color-inverse-on-surface, #f5eff7));--_selected-hover-state-layer-color: var(--md-outlined-icon-button-selected-hover-state-layer-color, var(--md-sys-color-inverse-on-surface, #f5eff7));--_selected-icon-color: var(--md-outlined-icon-button-selected-icon-color, var(--md-sys-color-inverse-on-surface, #f5eff7));--_selected-pressed-icon-color: var(--md-outlined-icon-button-selected-pressed-icon-color, var(--md-sys-color-inverse-on-surface, #f5eff7));--_selected-pressed-state-layer-color: var(--md-outlined-icon-button-selected-pressed-state-layer-color, var(--md-sys-color-inverse-on-surface, #f5eff7));--_unselected-focus-icon-color: var(--md-outlined-icon-button-unselected-focus-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_unselected-focus-state-layer-color: var(--md-outlined-icon-button-unselected-focus-state-layer-color, var(--md-sys-color-on-surface-variant, #49454f));--_unselected-hover-icon-color: var(--md-outlined-icon-button-unselected-hover-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_unselected-hover-state-layer-color: var(--md-outlined-icon-button-unselected-hover-state-layer-color, var(--md-sys-color-on-surface-variant, #49454f));--_unselected-icon-color: var(--md-outlined-icon-button-unselected-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_unselected-outline-color: var(--md-outlined-icon-button-unselected-outline-color, var(--md-sys-color-outline, #79747e));--_unselected-outline-width: var(--md-outlined-icon-button-unselected-outline-width, 1px);--_unselected-pressed-icon-color: var(--md-outlined-icon-button-unselected-pressed-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-pressed-state-layer-color: var(--md-outlined-icon-button-unselected-pressed-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_container-shape-start-start: var( --md-outlined-icon-button-container-shape-start-start, var(--_container-shape) );--_container-shape-start-end: var( --md-outlined-icon-button-container-shape-start-end, var(--_container-shape) );--_container-shape-end-end: var( --md-outlined-icon-button-container-shape-end-end, var(--_container-shape) );--_container-shape-end-start: var( --md-outlined-icon-button-container-shape-end-start, var(--_container-shape) )}.md3-icon-button--outlined{background-color:rgba(0,0,0,0);color:var(--_unselected-icon-color);--md-ripple-focus-color:var(--_unselected-focus-state-layer-color);--md-ripple-focus-opacity:var(--_focus-state-layer-opacity);--md-ripple-hover-color:var(--_unselected-hover-state-layer-color);--md-ripple-hover-opacity:var(--_hover-state-layer-opacity);--md-ripple-pressed-color:var(--_unselected-pressed-state-layer-color);--md-ripple-pressed-opacity:var(--_pressed-state-layer-opacity)}.md3-icon-button--outlined::before{border-color:var(--_unselected-outline-color);border-width:var(--_unselected-outline-width)}.md3-icon-button--outlined:hover{color:var(--_unselected-hover-icon-color)}.md3-icon-button--outlined:focus{color:var(--_unselected-focus-icon-color)}.md3-icon-button--outlined:active{color:var(--_unselected-pressed-icon-color)}.md3-icon-button--outlined:disabled{color:var(--_disabled-icon-color)}.md3-icon-button--outlined:disabled::before{border-color:var(--_disabled-unselected-outline-color);opacity:var(--_disabled-unselected-outline-opacity)}.md3-icon-button--outlined::before{block-size:100%;border-style:solid;border-radius:inherit;box-sizing:border-box;content:"";inline-size:100%;inset:0;pointer-events:none;position:absolute}.md3-icon-button--outlined.md3-icon-button--selected::before{border-width:0}.md3-icon-button--selected{--md-ripple-focus-color:var(--_selected-focus-state-layer-color);--md-ripple-focus-opacity:var(--_focus-state-layer-opacity);--md-ripple-hover-color:var(--_selected-hover-state-layer-color);--md-ripple-hover-opacity:var(--_hover-state-layer-opacity);--md-ripple-pressed-color:var(--_selected-pressed-state-layer-color);--md-ripple-pressed-opacity:var(--_pressed-state-layer-opacity)}.md3-icon-button--selected:not(:disabled){background-color:var(--_selected-container-color);color:var(--_selected-icon-color)}.md3-icon-button--selected:not(:disabled):hover{color:var(--_selected-hover-icon-color)}.md3-icon-button--selected:not(:disabled):focus{color:var(--_selected-focus-icon-color)}.md3-icon-button--selected:not(:disabled):active{color:var(--_selected-pressed-icon-color)}.md3-icon-button--selected:disabled{background-color:var(--_disabled-selected-container-color)}@media(forced-colors: active){.md3-icon-button--selected::before{border-color:var(--_unselected-outline-color);border-width:var(--_unselected-outline-width)}.md3-icon-button--selected:disabled::before{border-color:var(--_disabled-unselected-outline-color);opacity:var(--_disabled-unselected-outline-opacity)}}/*# sourceMappingURL=outlined-styles.css.map */ `; //# sourceMappingURL=outlined-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/lib/shared-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/lib/shared-styles.css.js index 4d64996..23e823e 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/lib/shared-styles.css.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/lib/shared-styles.css.js
@@ -4,6 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ import { css } from 'lit'; -export const styles = css `:host{display:inline-flex;outline:none;-webkit-tap-highlight-color:rgba(0,0,0,0);height:max(48px,var(--_container-size));width:max(48px,var(--_container-size));align-items:center;justify-content:center}:host([disabled]){pointer-events:none}.md3-icon-button{align-items:center;border:none;box-sizing:border-box;cursor:pointer;display:flex;justify-content:center;outline:none;position:relative;text-decoration:none;user-select:none;z-index:0;height:var(--_container-size);width:var(--_container-size);border-start-start-radius:var(--_container-shape-start-start);border-start-end-radius:var(--_container-shape-start-end);border-end-start-radius:var(--_container-shape-end-start);border-end-end-radius:var(--_container-shape-end-end)}.md3-icon-button__icon{--md-icon-size:var(--_icon-size);--md-icon-weight:inherit}md-ripple{z-index:-1;border-start-start-radius:var(--_container-shape-start-start);border-start-end-radius:var(--_container-shape-start-end);border-end-start-radius:var(--_container-shape-end-start);border-end-end-radius:var(--_container-shape-end-end)}.md3-icon-button--flip-icon .md3-icon-button__icon{transform:scaleX(-1)}.md3-icon-button__icon{display:inline-flex}.md3-icon-button__link{height:100%;outline:none;position:absolute;width:100%}.md3-icon-button__touch{position:absolute;top:50%;height:48px;left:50%;width:48px;transform:translate(-50%, -50%)}/*# sourceMappingURL=shared-styles.css.map */ +export const styles = css `:host{display:inline-flex;outline:none;-webkit-tap-highlight-color:rgba(0,0,0,0);height:var(--_container-size);width:var(--_container-size);justify-content:center;--md-focus-ring-shape-start-start: var(--_container-shape-start-start);--md-focus-ring-shape-start-end: var(--_container-shape-start-end);--md-focus-ring-shape-end-end: var(--_container-shape-end-end);--md-focus-ring-shape-end-start: var(--_container-shape-end-start)}:host([disabled]){pointer-events:none}.md3-icon-button{align-items:center;border:none;box-sizing:border-box;cursor:pointer;display:flex;justify-content:center;outline:none;position:relative;text-decoration:none;user-select:none;z-index:0;flex:1;border-start-start-radius:var(--_container-shape-start-start);border-start-end-radius:var(--_container-shape-start-end);border-end-start-radius:var(--_container-shape-end-start);border-end-end-radius:var(--_container-shape-end-end)}.md3-icon-button__icon{--md-icon-size:var(--_icon-size);--md-icon-weight:inherit}md-ripple{z-index:-1;border-start-start-radius:var(--_container-shape-start-start);border-start-end-radius:var(--_container-shape-start-end);border-end-start-radius:var(--_container-shape-end-start);border-end-end-radius:var(--_container-shape-end-end)}.md3-icon-button--flip-icon .md3-icon-button__icon{transform:scaleX(-1)}.md3-icon-button__icon{display:inline-flex}.md3-icon-button__link{height:100%;outline:none;position:absolute;width:100%}.md3-icon-button__touch{position:absolute;top:50%;height:48px;left:50%;width:48px;transform:translate(-50%, -50%)}/*# sourceMappingURL=shared-styles.css.map */ `; //# sourceMappingURL=shared-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/lib/standard-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/lib/standard-styles.css.js index 49bc45a..4eb6c723 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/lib/standard-styles.css.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/lib/standard-styles.css.js
@@ -4,6 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ import { css } from 'lit'; -export const styles = css `:host{--_state-layer-shape-start-start: var(--md-icon-button-state-layer-shape-start-start, 9999px);--_state-layer-shape-start-end: var(--md-icon-button-state-layer-shape-start-end, 9999px);--_state-layer-shape-end-end: var(--md-icon-button-state-layer-shape-end-end, 9999px);--_state-layer-shape-end-start: var(--md-icon-button-state-layer-shape-end-start, 9999px);--_disabled-icon-color: var(--md-icon-button-disabled-icon-color, rgb(var(--md-sys-color-on-surface-rgb, 28, 27, 31), 0.38));--_icon-size: var(--md-icon-button-icon-size, 24px);--_selected-focus-icon-color: var(--md-icon-button-selected-focus-icon-color, var(--md-sys-color-primary, #6750a4));--_selected-focus-state-layer-color: var(--md-icon-button-selected-focus-state-layer-color, var(--md-sys-color-primary, #6750a4));--_selected-focus-state-layer-opacity: var(--md-icon-button-selected-focus-state-layer-opacity, 0.12);--_selected-hover-icon-color: var(--md-icon-button-selected-hover-icon-color, var(--md-sys-color-primary, #6750a4));--_selected-hover-state-layer-color: var(--md-icon-button-selected-hover-state-layer-color, var(--md-sys-color-primary, #6750a4));--_selected-hover-state-layer-opacity: var(--md-icon-button-selected-hover-state-layer-opacity, 0.08);--_selected-icon-color: var(--md-icon-button-selected-icon-color, var(--md-sys-color-primary, #6750a4));--_selected-pressed-icon-color: var(--md-icon-button-selected-pressed-icon-color, var(--md-sys-color-primary, #6750a4));--_selected-pressed-state-layer-color: var(--md-icon-button-selected-pressed-state-layer-color, var(--md-sys-color-primary, #6750a4));--_selected-pressed-state-layer-opacity: var(--md-icon-button-selected-pressed-state-layer-opacity, 0.12);--_state-layer-size: var(--md-icon-button-state-layer-size, 40px);--_unselected-focus-icon-color: var(--md-icon-button-unselected-focus-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_unselected-focus-state-layer-color: var(--md-icon-button-unselected-focus-state-layer-color, var(--md-sys-color-on-surface-variant, #49454f));--_unselected-focus-state-layer-opacity: var(--md-icon-button-unselected-focus-state-layer-opacity, 0.12);--_unselected-hover-icon-color: var(--md-icon-button-unselected-hover-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_unselected-hover-state-layer-color: var(--md-icon-button-unselected-hover-state-layer-color, var(--md-sys-color-on-surface-variant, #49454f));--_unselected-hover-state-layer-opacity: var(--md-icon-button-unselected-hover-state-layer-opacity, 0.08);--_unselected-icon-color: var(--md-icon-button-unselected-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_unselected-pressed-icon-color: var(--md-icon-button-unselected-pressed-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_unselected-pressed-state-layer-color: var(--md-icon-button-unselected-pressed-state-layer-color, var(--md-sys-color-on-surface-variant, #49454f));--_unselected-pressed-state-layer-opacity: var(--md-icon-button-unselected-pressed-state-layer-opacity, 0.12);height:max(48px,var(--_state-layer-size));width:max(48px,var(--_state-layer-size));--md-focus-ring-shape-start-start:var(--_state-layer-shape-start-start);--md-focus-ring-shape-start-end:var(--_state-layer-shape-start-end);--md-focus-ring-shape-end-end:var(--_state-layer-shape-end-end);--md-focus-ring-shape-end-start:var(--_state-layer-shape-end-start)}.md3-icon-button--standard{background-color:rgba(0,0,0,0);color:var(--_unselected-icon-color);height:var(--_state-layer-size);width:var(--_state-layer-size);--md-ripple-focus-state-layer-color:var(--_unselected-focus-state-layer-color);--md-ripple-focus-state-layer-opacity:var(--_unselected-focus-state-layer-opacity);--md-ripple-hover-state-layer-color:var(--_unselected-hover-state-layer-color);--md-ripple-hover-state-layer-opacity:var(--_unselected-hover-state-layer-opacity);--md-ripple-pressed-state-layer-color:var(--_unselected-pressed-state-layer-color);--md-ripple-pressed-state-layer-opacity:var(--_unselected-pressed-state-layer-opacity);--md-ripple-state-layer-shape:var(--_state-layer-shape-start-start)}.md3-icon-button--standard:hover{color:var(--_unselected-hover-icon-color)}.md3-icon-button--standard:focus{color:var(--_unselected-focus-icon-color)}.md3-icon-button--standard:active{color:var(--_unselected-pressed-icon-color)}.md3-icon-button--standard:disabled{color:var(--_disabled-icon-color)}.md3-icon-button--selected{--md-ripple-focus-state-layer-color:var(--_selected-focus-state-layer-color);--md-ripple-focus-state-layer-opacity:var(--_selected-focus-state-layer-opacity);--md-ripple-hover-state-layer-color:var(--_selected-hover-state-layer-color);--md-ripple-hover-state-layer-opacity:var(--_selected-hover-state-layer-opacity);--md-ripple-pressed-state-layer-color:var(--_selected-pressed-state-layer-color);--md-ripple-pressed-state-layer-opacity:var(--_selected-pressed-state-layer-opacity)}.md3-icon-button--selected:not(:disabled){color:var(--_selected-icon-color)}.md3-icon-button--selected:not(:disabled):hover{color:var(--_selected-hover-icon-color)}.md3-icon-button--selected:not(:disabled):focus{color:var(--_selected-focus-icon-color)}.md3-icon-button--selected:not(:disabled):active{color:var(--_selected-pressed-icon-color)}/*# sourceMappingURL=standard-styles.css.map */ +export const styles = css `:host{--_disabled-icon-color: var(--md-icon-button-disabled-icon-color, rgb(var(--md-sys-color-on-surface-rgb, 29, 27, 32), 0.38));--_icon-size: var(--md-icon-button-icon-size, 24px);--_selected-focus-icon-color: var(--md-icon-button-selected-focus-icon-color, var(--md-sys-color-primary, #6750a4));--_selected-focus-state-layer-color: var(--md-icon-button-selected-focus-state-layer-color, var(--md-sys-color-primary, #6750a4));--_selected-focus-state-layer-opacity: var(--md-icon-button-selected-focus-state-layer-opacity, 0.12);--_selected-hover-icon-color: var(--md-icon-button-selected-hover-icon-color, var(--md-sys-color-primary, #6750a4));--_selected-hover-state-layer-color: var(--md-icon-button-selected-hover-state-layer-color, var(--md-sys-color-primary, #6750a4));--_selected-hover-state-layer-opacity: var(--md-icon-button-selected-hover-state-layer-opacity, 0.08);--_selected-icon-color: var(--md-icon-button-selected-icon-color, var(--md-sys-color-primary, #6750a4));--_selected-pressed-icon-color: var(--md-icon-button-selected-pressed-icon-color, var(--md-sys-color-primary, #6750a4));--_selected-pressed-state-layer-color: var(--md-icon-button-selected-pressed-state-layer-color, var(--md-sys-color-primary, #6750a4));--_selected-pressed-state-layer-opacity: var(--md-icon-button-selected-pressed-state-layer-opacity, 0.12);--_state-layer-shape: var(--md-icon-button-state-layer-shape, 9999px);--_state-layer-size: var(--md-icon-button-state-layer-size, 40px);--_unselected-focus-icon-color: var(--md-icon-button-unselected-focus-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_unselected-focus-state-layer-color: var(--md-icon-button-unselected-focus-state-layer-color, var(--md-sys-color-on-surface-variant, #49454f));--_unselected-focus-state-layer-opacity: var(--md-icon-button-unselected-focus-state-layer-opacity, 0.12);--_unselected-hover-icon-color: var(--md-icon-button-unselected-hover-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_unselected-hover-state-layer-color: var(--md-icon-button-unselected-hover-state-layer-color, var(--md-sys-color-on-surface-variant, #49454f));--_unselected-hover-state-layer-opacity: var(--md-icon-button-unselected-hover-state-layer-opacity, 0.08);--_unselected-icon-color: var(--md-icon-button-unselected-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_unselected-pressed-icon-color: var(--md-icon-button-unselected-pressed-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_unselected-pressed-state-layer-color: var(--md-icon-button-unselected-pressed-state-layer-color, var(--md-sys-color-on-surface-variant, #49454f));--_unselected-pressed-state-layer-opacity: var(--md-icon-button-unselected-pressed-state-layer-opacity, 0.12);height:var(--_state-layer-size);width:var(--_state-layer-size);--md-focus-ring-shape: var(--_state-layer-shape)}.md3-icon-button--standard{background-color:rgba(0,0,0,0);color:var(--_unselected-icon-color);--md-ripple-focus-color:var(--_unselected-focus-state-layer-color);--md-ripple-focus-opacity:var(--_unselected-focus-state-layer-opacity);--md-ripple-hover-color:var(--_unselected-hover-state-layer-color);--md-ripple-hover-opacity:var(--_unselected-hover-state-layer-opacity);--md-ripple-pressed-color:var(--_unselected-pressed-state-layer-color);--md-ripple-pressed-opacity:var(--_unselected-pressed-state-layer-opacity);--md-ripple-shape:var(--_state-layer-shape)}.md3-icon-button--standard:hover{color:var(--_unselected-hover-icon-color)}.md3-icon-button--standard:focus{color:var(--_unselected-focus-icon-color)}.md3-icon-button--standard:active{color:var(--_unselected-pressed-icon-color)}.md3-icon-button--standard:disabled{color:var(--_disabled-icon-color)}.md3-icon-button--selected{--md-ripple-focus-color:var(--_selected-focus-state-layer-color);--md-ripple-focus-opacity:var(--_selected-focus-state-layer-opacity);--md-ripple-hover-color:var(--_selected-hover-state-layer-color);--md-ripple-hover-opacity:var(--_selected-hover-state-layer-opacity);--md-ripple-pressed-color:var(--_selected-pressed-state-layer-color);--md-ripple-pressed-opacity:var(--_selected-pressed-state-layer-opacity)}.md3-icon-button--selected:not(:disabled){color:var(--_selected-icon-color)}.md3-icon-button--selected:not(:disabled):hover{color:var(--_selected-hover-icon-color)}.md3-icon-button--selected:not(:disabled):focus{color:var(--_selected-focus-icon-color)}.md3-icon-button--selected:not(:disabled):active{color:var(--_selected-pressed-icon-color)}/*# sourceMappingURL=standard-styles.css.map */ `; //# sourceMappingURL=standard-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/outlined-icon-button-toggle.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/outlined-icon-button-toggle.d.ts deleted file mode 100644 index 9b524f2..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/outlined-icon-button-toggle.d.ts +++ /dev/null
@@ -1,31 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { ClassInfo } from 'lit/directives/class-map.js'; -import { IconButtonToggle } from './lib/icon-button-toggle.js'; -declare global { - interface HTMLElementTagNameMap { - 'md-outlined-icon-button-toggle': MdOutlinedIconButtonToggle; - } -} -/** - * @summary Icon buttons help people take supplementary actions with a single - * tap. This variant can toggle between icons. - * - * @description - * __Emphasis:__ Low emphasis – For optional or supplementary actions with the - * least amount of prominence. - * - * __Rationale:__ The most compact and unobtrusive type of button, icon buttons - * are used for optional supplementary actions such as "Bookmark" or "Star." - * - * __Example usages:__ - * - Add to Favorites - * - Print - */ -export declare class MdOutlinedIconButtonToggle extends IconButtonToggle { - static styles: import("lit").CSSResult[]; - protected getRenderClasses(): ClassInfo; -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/outlined-icon-button-toggle.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/outlined-icon-button-toggle.js deleted file mode 100644 index 8a0ffd9..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/outlined-icon-button-toggle.js +++ /dev/null
@@ -1,39 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { __decorate } from "tslib"; -import { customElement } from 'lit/decorators.js'; -import { IconButtonToggle } from './lib/icon-button-toggle.js'; -import { styles } from './lib/outlined-styles.css.js'; -import { styles as sharedStyles } from './lib/shared-styles.css.js'; -/** - * @summary Icon buttons help people take supplementary actions with a single - * tap. This variant can toggle between icons. - * - * @description - * __Emphasis:__ Low emphasis – For optional or supplementary actions with the - * least amount of prominence. - * - * __Rationale:__ The most compact and unobtrusive type of button, icon buttons - * are used for optional supplementary actions such as "Bookmark" or "Star." - * - * __Example usages:__ - * - Add to Favorites - * - Print - */ -let MdOutlinedIconButtonToggle = class MdOutlinedIconButtonToggle extends IconButtonToggle { - getRenderClasses() { - return { - ...super.getRenderClasses(), - 'md3-icon-button--outlined': true, - }; - } -}; -MdOutlinedIconButtonToggle.styles = [sharedStyles, styles]; -MdOutlinedIconButtonToggle = __decorate([ - customElement('md-outlined-icon-button-toggle') -], MdOutlinedIconButtonToggle); -export { MdOutlinedIconButtonToggle }; -//# sourceMappingURL=outlined-icon-button-toggle.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/outlined-icon-button.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/outlined-icon-button.d.ts index faec57c..2b2d56b 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/outlined-icon-button.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/outlined-icon-button.d.ts
@@ -3,7 +3,6 @@ * Copyright 2022 Google LLC * SPDX-License-Identifier: Apache-2.0 */ -import { ClassInfo } from 'lit/directives/class-map.js'; import { IconButton } from './lib/icon-button.js'; declare global { interface HTMLElementTagNameMap { @@ -27,5 +26,9 @@ */ export declare class MdOutlinedIconButton extends IconButton { static styles: import("lit").CSSResult[]; - protected getRenderClasses(): ClassInfo; + protected getRenderClasses(): { + 'md3-icon-button--outlined': boolean; + 'md3-icon-button--flip-icon': boolean; + 'md3-icon-button--selected': boolean; + }; }
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/outlined-link-icon-button.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/outlined-link-icon-button.d.ts deleted file mode 100644 index cd61099d..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/outlined-link-icon-button.d.ts +++ /dev/null
@@ -1,31 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { ClassInfo } from 'lit/directives/class-map.js'; -import { LinkIconButton } from './lib/link-icon-button.js'; -declare global { - interface HTMLElementTagNameMap { - 'md-outlined-link-icon-button': MdOutlinedLinkIconButton; - } -} -/** - * @summary Icon buttons help people take supplementary actions with a single - * tap. This is a linkable variant. - * - * @description - * __Emphasis:__ Low emphasis – For optional or supplementary actions with the - * least amount of prominence. - * - * __Rationale:__ The most compact and unobtrusive type of button, icon buttons - * are used for optional supplementary actions such as "Bookmark" or "Star." - * - * __Example usages:__ - * - Add to Favorites - * - Print - */ -export declare class MdOutlinedLinkIconButton extends LinkIconButton { - static styles: import("lit").CSSResult[]; - protected getRenderClasses(): ClassInfo; -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/outlined-link-icon-button.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/outlined-link-icon-button.js deleted file mode 100644 index 861069d..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/outlined-link-icon-button.js +++ /dev/null
@@ -1,39 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { __decorate } from "tslib"; -import { customElement } from 'lit/decorators.js'; -import { LinkIconButton } from './lib/link-icon-button.js'; -import { styles } from './lib/outlined-styles.css.js'; -import { styles as sharedStyles } from './lib/shared-styles.css.js'; -/** - * @summary Icon buttons help people take supplementary actions with a single - * tap. This is a linkable variant. - * - * @description - * __Emphasis:__ Low emphasis – For optional or supplementary actions with the - * least amount of prominence. - * - * __Rationale:__ The most compact and unobtrusive type of button, icon buttons - * are used for optional supplementary actions such as "Bookmark" or "Star." - * - * __Example usages:__ - * - Add to Favorites - * - Print - */ -let MdOutlinedLinkIconButton = class MdOutlinedLinkIconButton extends LinkIconButton { - getRenderClasses() { - return { - ...super.getRenderClasses(), - 'md3-icon-button--outlined': true, - }; - } -}; -MdOutlinedLinkIconButton.styles = [sharedStyles, styles]; -MdOutlinedLinkIconButton = __decorate([ - customElement('md-outlined-link-icon-button') -], MdOutlinedLinkIconButton); -export { MdOutlinedLinkIconButton }; -//# sourceMappingURL=outlined-link-icon-button.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/standard-icon-button-toggle.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/standard-icon-button-toggle.d.ts deleted file mode 100644 index eb2870fb..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/standard-icon-button-toggle.d.ts +++ /dev/null
@@ -1,31 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { ClassInfo } from 'lit/directives/class-map.js'; -import { IconButtonToggle } from './lib/icon-button-toggle.js'; -declare global { - interface HTMLElementTagNameMap { - 'md-standard-icon-button-toggle': MdStandardIconButtonToggle; - } -} -/** - * @summary Icon buttons help people take supplementary actions with a single - * tap. This variant can toggle between icons. - * - * @description - * __Emphasis:__ Low emphasis – For optional or supplementary actions with the - * least amount of prominence. - * - * __Rationale:__ The most compact and unobtrusive type of button, icon buttons - * are used for optional supplementary actions such as "Bookmark" or "Star." - * - * __Example usages:__ - * - Add to Favorites - * - Print - */ -export declare class MdStandardIconButtonToggle extends IconButtonToggle { - static styles: import("lit").CSSResult[]; - protected getRenderClasses(): ClassInfo; -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/standard-icon-button-toggle.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/standard-icon-button-toggle.js deleted file mode 100644 index ff0fe7f..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/standard-icon-button-toggle.js +++ /dev/null
@@ -1,39 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { __decorate } from "tslib"; -import { customElement } from 'lit/decorators.js'; -import { IconButtonToggle } from './lib/icon-button-toggle.js'; -import { styles as sharedStyles } from './lib/shared-styles.css.js'; -import { styles } from './lib/standard-styles.css.js'; -/** - * @summary Icon buttons help people take supplementary actions with a single - * tap. This variant can toggle between icons. - * - * @description - * __Emphasis:__ Low emphasis – For optional or supplementary actions with the - * least amount of prominence. - * - * __Rationale:__ The most compact and unobtrusive type of button, icon buttons - * are used for optional supplementary actions such as "Bookmark" or "Star." - * - * __Example usages:__ - * - Add to Favorites - * - Print - */ -let MdStandardIconButtonToggle = class MdStandardIconButtonToggle extends IconButtonToggle { - getRenderClasses() { - return { - ...super.getRenderClasses(), - 'md3-icon-button--standard': true, - }; - } -}; -MdStandardIconButtonToggle.styles = [sharedStyles, styles]; -MdStandardIconButtonToggle = __decorate([ - customElement('md-standard-icon-button-toggle') -], MdStandardIconButtonToggle); -export { MdStandardIconButtonToggle }; -//# sourceMappingURL=standard-icon-button-toggle.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/standard-icon-button.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/standard-icon-button.d.ts index 2bc3c10b..4293fdc 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/standard-icon-button.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/standard-icon-button.d.ts
@@ -3,7 +3,6 @@ * Copyright 2021 Google LLC * SPDX-License-Identifier: Apache-2.0 */ -import { ClassInfo } from 'lit/directives/class-map.js'; import { IconButton } from './lib/icon-button.js'; declare global { interface HTMLElementTagNameMap { @@ -27,5 +26,9 @@ */ export declare class MdStandardIconButton extends IconButton { static styles: import("lit").CSSResult[]; - protected getRenderClasses(): ClassInfo; + protected getRenderClasses(): { + 'md3-icon-button--standard': boolean; + 'md3-icon-button--flip-icon': boolean; + 'md3-icon-button--selected': boolean; + }; }
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/standard-link-icon-button.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/standard-link-icon-button.d.ts deleted file mode 100644 index f6dfa0b9..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/standard-link-icon-button.d.ts +++ /dev/null
@@ -1,31 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { ClassInfo } from 'lit/directives/class-map.js'; -import { LinkIconButton } from './lib/link-icon-button.js'; -declare global { - interface HTMLElementTagNameMap { - 'md-standard-link-icon-button': MdStandardLinkIconButton; - } -} -/** - * @summary Icon buttons help people take supplementary actions with a single - * tap. This is a linkable variant. - * - * @description - * __Emphasis:__ Low emphasis – For optional or supplementary actions with the - * least amount of prominence. - * - * __Rationale:__ The most compact and unobtrusive type of button, icon buttons - * are used for optional supplementary actions such as "Bookmark" or "Star." - * - * __Example usages:__ - * - Add to Favorites - * - Print - */ -export declare class MdStandardLinkIconButton extends LinkIconButton { - static styles: import("lit").CSSResult[]; - protected getRenderClasses(): ClassInfo; -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/standard-link-icon-button.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/standard-link-icon-button.js deleted file mode 100644 index cc768dd..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/iconbutton/standard-link-icon-button.js +++ /dev/null
@@ -1,39 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { __decorate } from "tslib"; -import { customElement } from 'lit/decorators.js'; -import { LinkIconButton } from './lib/link-icon-button.js'; -import { styles as sharedStyles } from './lib/shared-styles.css.js'; -import { styles } from './lib/standard-styles.css.js'; -/** - * @summary Icon buttons help people take supplementary actions with a single - * tap. This is a linkable variant. - * - * @description - * __Emphasis:__ Low emphasis – For optional or supplementary actions with the - * least amount of prominence. - * - * __Rationale:__ The most compact and unobtrusive type of button, icon buttons - * are used for optional supplementary actions such as "Bookmark" or "Star." - * - * __Example usages:__ - * - Add to Favorites - * - Print - */ -let MdStandardLinkIconButton = class MdStandardLinkIconButton extends LinkIconButton { - getRenderClasses() { - return { - ...super.getRenderClasses(), - 'md3-icon-button--standard': true, - }; - } -}; -MdStandardLinkIconButton.styles = [sharedStyles, styles]; -MdStandardLinkIconButton = __decorate([ - customElement('md-standard-link-icon-button') -], MdStandardLinkIconButton); -export { MdStandardLinkIconButton }; -//# sourceMappingURL=standard-link-icon-button.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/linearprogress/harness.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/linearprogress/harness.d.ts new file mode 100644 index 0000000..e02a2ed --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/linearprogress/harness.d.ts
@@ -0,0 +1,13 @@ +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import { Harness } from '../testing/harness.js'; +import { LinearProgress } from './lib/linear-progress.js'; +/** + * Test harness for linear-progress. + */ +export declare class LinearProgressHarness extends Harness<LinearProgress> { + getInteractiveElement(): Promise<HTMLElement>; +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/filled-styles.css.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/linearprogress/lib/linear-progress-styles.css.d.ts similarity index 100% copy from third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/filled-styles.css.d.ts copy to third_party/material_web_components/components-chromium/node_modules/@material/web/linearprogress/lib/linear-progress-styles.css.d.ts
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/linearprogress/lib/linear-progress-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/linearprogress/lib/linear-progress-styles.css.js new file mode 100644 index 0000000..f89b0e2 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/linearprogress/lib/linear-progress-styles.css.js
@@ -0,0 +1,9 @@ +/** + * @license + * Copyright 2022 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import { css } from 'lit'; +export const styles = css `:host{--_active-indicator-color: var(--md-linear-progress-active-indicator-color, var(--md-sys-color-primary, #6750a4));--_active-indicator-height: var(--md-linear-progress-active-indicator-height, 4px);--_four-color-active-indicator-four-color: var(--md-linear-progress-four-color-active-indicator-four-color, var(--md-sys-color-tertiary-container, #ffd8e4));--_four-color-active-indicator-one-color: var(--md-linear-progress-four-color-active-indicator-one-color, var(--md-sys-color-primary, #6750a4));--_four-color-active-indicator-three-color: var(--md-linear-progress-four-color-active-indicator-three-color, var(--md-sys-color-tertiary, #7d5260));--_four-color-active-indicator-two-color: var(--md-linear-progress-four-color-active-indicator-two-color, var(--md-sys-color-primary-container, #eaddff));--_track-color: var(--md-linear-progress-track-color, var(--md-sys-color-surface-container-highest, #e6e0e9));--_track-height: var(--md-linear-progress-track-height, 4px);--_track-shape: var(--md-linear-progress-track-shape, 0px);display:block;position:relative;min-inline-size:80px;block-size:var(--_track-height);content-visibility:auto;contain:strict}.linear-progress,.track,.buffer-bar,.bar,.bar-inner{position:absolute}.linear-progress{inset:0;outline:rgba(0,0,0,0) solid 1px;border-radius:var(--_track-shape);overflow:hidden;display:flex;align-items:center}.bar{animation:none;inline-size:100%;block-size:var(--_active-indicator-height);transform-origin:left center;will-change:transform;transition:transform 250ms cubic-bezier(0.4, 0, 0.6, 1)}.secondary-bar{display:none}.bar-inner{inset:0;animation:none;background:var(--_active-indicator-color)}.buffer-bar{background:var(--_track-color);inset:0;will-change:transform;transition:transform 250ms cubic-bezier(0.4, 0, 0.6, 1);transform-origin:left center}.track{inset:0;will-change:transform;animation:linear infinite 250ms;animation-name:buffering;background:0/calc(var(--_track-height) / 2 * 5) 100% radial-gradient(circle at calc(var(--_track-height) / 2 * 2), var(--_track-color) 0, var(--_track-color) calc(var(--_track-height) / 2), transparent calc(var(--_track-height) / 2))}.indeterminate .bar{transition:none}.indeterminate .primary-bar{inset-inline-start:-145.167%}.indeterminate .secondary-bar{inset-inline-start:-54.8889%;display:block}.indeterminate .track{display:none}.indeterminate.animation-ready .primary-bar{will-change:transform;animation:linear infinite 2s;animation-name:primary-indeterminate-translate}.indeterminate.animation-ready .primary-bar>.bar-inner{will-change:transform;animation:linear infinite 2s primary-indeterminate-scale}.indeterminate.animation-ready.four-colors .primary-bar>.bar-inner{animation-name:primary-indeterminate-scale,four-colors;animation-duration:2s,4s}.indeterminate.animation-ready .secondary-bar{will-change:transform;animation:linear infinite 2s;animation-name:secondary-indeterminate-translate}.indeterminate.animation-ready .secondary-bar>.bar-inner{will-change:transform;animation:linear infinite 2s secondary-indeterminate-scale}.indeterminate.animation-ready.four-colors .secondary-bar>.bar-inner{animation-name:secondary-indeterminate-scale,four-colors;animation-duration:2s,4s}:host-context([dir=rtl]) .linear-progress .bar{transform-origin:right center}:host-context([dir=rtl]) .linear-progress .buffer-bar{transform-origin:right center}:host-context([dir=rtl]) .linear-progress .track{animation-name:buffering-rtl}:host-context([dir=rtl]) .linear-progress.indeterminate.animation-ready .primary-bar{animation-name:primary-indeterminate-translate-rtl}:host-context([dir=rtl]) .linear-progress.indeterminate.animation-ready .secondary-bar{animation-name:secondary-indeterminate-translate-rtl}:host([dir=rtl]) .linear-progress .bar{transform-origin:right center}:host([dir=rtl]) .linear-progress .buffer-bar{transform-origin:right center}:host([dir=rtl]) .linear-progress .track{animation-name:buffering-rtl}:host([dir=rtl]) .linear-progress.indeterminate.animation-ready .primary-bar{animation-name:primary-indeterminate-translate-rtl}:host([dir=rtl]) .linear-progress.indeterminate.animation-ready .secondary-bar{animation-name:secondary-indeterminate-translate-rtl}.linear-progress:dir(rtl) .bar{transform-origin:right center}.linear-progress:dir(rtl) .buffer-bar{transform-origin:right center}.linear-progress:dir(rtl) .track{animation-name:buffering-rtl}.linear-progress:dir(rtl).indeterminate.animation-ready .primary-bar{animation-name:primary-indeterminate-translate-rtl}.linear-progress:dir(rtl).indeterminate.animation-ready .secondary-bar{animation-name:secondary-indeterminate-translate-rtl}@keyframes primary-indeterminate-scale{0%{transform:scaleX(0.08)}36.65%{animation-timing-function:cubic-bezier(0.334731, 0.12482, 0.785844, 1);transform:scaleX(0.08)}69.15%{animation-timing-function:cubic-bezier(0.06, 0.11, 0.6, 1);transform:scaleX(0.661479)}100%{transform:scaleX(0.08)}}@keyframes secondary-indeterminate-scale{0%{animation-timing-function:cubic-bezier(0.205028, 0.057051, 0.57661, 0.453971);transform:scaleX(0.08)}19.15%{animation-timing-function:cubic-bezier(0.152313, 0.196432, 0.648374, 1.00432);transform:scaleX(0.457104)}44.15%{animation-timing-function:cubic-bezier(0.257759, -0.003163, 0.211762, 1.38179);transform:scaleX(0.72796)}100%{transform:scaleX(0.08)}}@keyframes buffering{0%{transform:translateX(calc(1 * calc(var(--_track-height) / 2 * 5)))}}@keyframes primary-indeterminate-translate{0%{transform:translateX(0px)}20%{animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);transform:translateX(0px)}59.15%{animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);transform:translateX(calc(1 * 83.6714%))}100%{transform:translateX(calc(1 * 200.611%))}}@keyframes secondary-indeterminate-translate{0%{animation-timing-function:cubic-bezier(0.15, 0, 0.515058, 0.409685);transform:translateX(0px)}25%{animation-timing-function:cubic-bezier(0.31033, 0.284058, 0.8, 0.733712);transform:translateX(calc(1 * 37.6519%))}48.35%{animation-timing-function:cubic-bezier(0.4, 0.627035, 0.6, 0.902026);transform:translateX(calc(1 * 84.3862%))}100%{transform:translateX(calc(1 * 160.278%))}}@keyframes buffering-rtl{0%{transform:translateX(calc(-1 * calc(var(--_track-height) / 2 * 5)))}}@keyframes primary-indeterminate-translate-rtl{0%{transform:translateX(0px)}20%{animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);transform:translateX(0px)}59.15%{animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);transform:translateX(calc(-1 * 83.6714%))}100%{transform:translateX(calc(-1 * 200.611%))}}@keyframes secondary-indeterminate-translate-rtl{0%{animation-timing-function:cubic-bezier(0.15, 0, 0.515058, 0.409685);transform:translateX(0px)}25%{animation-timing-function:cubic-bezier(0.31033, 0.284058, 0.8, 0.733712);transform:translateX(calc(-1 * 37.6519%))}48.35%{animation-timing-function:cubic-bezier(0.4, 0.627035, 0.6, 0.902026);transform:translateX(calc(-1 * 84.3862%))}100%{transform:translateX(calc(-1 * 160.278%))}}@keyframes four-colors{0%{background:var(--_four-color-active-indicator-one-color)}15%{background:var(--_four-color-active-indicator-one-color)}25%{background:var(--_four-color-active-indicator-two-color)}40%{background:var(--_four-color-active-indicator-two-color)}50%{background:var(--_four-color-active-indicator-three-color)}65%{background:var(--_four-color-active-indicator-three-color)}75%{background:var(--_four-color-active-indicator-four-color)}90%{background:var(--_four-color-active-indicator-four-color)}100%{background:var(--_four-color-active-indicator-one-color)}}@media screen and (forced-colors: active){.linear-progress{--_active-indicator-color: canvastext;--_track-color: graytext;border:1px solid canvastext}.indeterminate.linear-progress{--_track-color: canvas}}/*# sourceMappingURL=linear-progress-styles.css.map */ +`; +//# sourceMappingURL=linear-progress-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/linearprogress/lib/linear-progress.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/linearprogress/lib/linear-progress.d.ts new file mode 100644 index 0000000..00fe0d8 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/linearprogress/lib/linear-progress.d.ts
@@ -0,0 +1,35 @@ +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import { LitElement } from 'lit'; +/** + * A linear progress component. + */ +export declare class LinearProgress extends LitElement { + /** + * Whether or not to render indeterminate progress in an animated state. + */ + indeterminate: boolean; + /** + * Progress to display, a fraction between 0 and 1. + */ + progress: number; + /** + * Buffer amount to display, a fraction between 0 and 1. + */ + buffer: number; + /** + * Whether or not to render indeterminate mode using 4 colors instead of one. + * + */ + fourColors: boolean; + private readonly rootEl; + private animationReady; + private resizeObserver; + protected render(): import("lit-html").TemplateResult<1>; + connectedCallback(): Promise<void>; + disconnectedCallback(): void; + private restartAnimation; +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/linearprogress/lib/linear-progress.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/linearprogress/lib/linear-progress.js new file mode 100644 index 0000000..12af143 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/linearprogress/lib/linear-progress.js
@@ -0,0 +1,127 @@ +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +var _a; +import { __decorate } from "tslib"; +import { html, LitElement, nothing } from 'lit'; +import { property, query, state } from 'lit/decorators.js'; +import { classMap } from 'lit/directives/class-map.js'; +import { styleMap } from 'lit/directives/style-map.js'; +import { requestUpdateOnAriaChange } from '../../aria/delegate.js'; +/** + * A linear progress component. + */ +export class LinearProgress extends LitElement { + constructor() { + super(...arguments); + /** + * Whether or not to render indeterminate progress in an animated state. + */ + this.indeterminate = false; + /** + * Progress to display, a fraction between 0 and 1. + */ + this.progress = 0; + /** + * Buffer amount to display, a fraction between 0 and 1. + */ + this.buffer = 1; + /** + * Whether or not to render indeterminate mode using 4 colors instead of one. + * + */ + this.fourColors = false; + this.animationReady = true; + this.resizeObserver = null; + } + // Note, the indeterminate animation is rendered with transform %'s + // Previously, this was optimized to use px calculated with the resizeObserver + // due to a now fixed Chrome bug: crbug.com/389359. + render() { + const rootClasses = { + 'indeterminate': this.indeterminate, + 'animation-ready': this.animationReady, + 'four-colors': this.fourColors + }; + const progressStyles = { + transform: `scaleX(${(this.indeterminate ? 1 : this.progress) * 100}%)` + }; + const bufferStyles = { + transform: `scaleX(${(this.indeterminate ? 1 : this.buffer) * 100}%)` + }; + // Needed for closure conformance + const { ariaLabel } = this; + return html ` + <div + role="progressbar" + class="linear-progress ${classMap(rootClasses)}" + aria-label="${ariaLabel || nothing}" + aria-valuemin="0" + aria-valuemax="1" + aria-valuenow="${this.indeterminate ? nothing : this.progress}"> + <div class="track"></div> + <div class="buffer-bar" style=${styleMap(bufferStyles)}></div> + <div class="bar primary-bar" style=${styleMap(progressStyles)}> + <div class="bar-inner"></div> + </div> + <div class="bar secondary-bar"> + <div class="bar-inner"></div> + </div> + </div>`; + } + async connectedCallback() { + super.connectedCallback(); + // wait for rendering. + await this.updateComplete; + if (this.resizeObserver) { + return; + } + this.resizeObserver = new ResizeObserver(() => { + if (this.indeterminate) { + this.restartAnimation(); + } + }); + this.resizeObserver.observe(this.rootEl); + } + disconnectedCallback() { + if (this.resizeObserver) { + this.resizeObserver.disconnect(); + this.resizeObserver = null; + } + super.disconnectedCallback(); + } + // When size changes, restart the animation + // to avoid jank. + async restartAnimation() { + await this.updateComplete; + this.animationReady = false; + await new Promise(requestAnimationFrame); + this.animationReady = true; + await this.updateComplete; + } +} +_a = LinearProgress; +(() => { + requestUpdateOnAriaChange(_a); +})(); +__decorate([ + property({ type: Boolean }) +], LinearProgress.prototype, "indeterminate", void 0); +__decorate([ + property({ type: Number }) +], LinearProgress.prototype, "progress", void 0); +__decorate([ + property({ type: Number }) +], LinearProgress.prototype, "buffer", void 0); +__decorate([ + property({ type: Boolean, attribute: 'four-colors' }) +], LinearProgress.prototype, "fourColors", void 0); +__decorate([ + query('.linear-progress') +], LinearProgress.prototype, "rootEl", void 0); +__decorate([ + state() +], LinearProgress.prototype, "animationReady", void 0); +//# sourceMappingURL=linear-progress.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/linearprogress/linear-progress.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/linearprogress/linear-progress.d.ts new file mode 100644 index 0000000..64d5a0f3 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/linearprogress/linear-progress.d.ts
@@ -0,0 +1,23 @@ +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import { LinearProgress } from './lib/linear-progress.js'; +declare global { + interface HTMLElementTagNameMap { + 'md-linear-progress': MdLinearProgress; + } +} +/** + * @summary Linear progress indicators display progress by animating along the + * length of a fixed, visible track. + * + * @description + * Progress indicators inform users about the status of ongoing processes. + * - Determinate indicators display how long a process will take. + * - Indeterminate indicators express an unspecified amount of wait time. + */ +export declare class MdLinearProgress extends LinearProgress { + static styles: import("lit").CSSResult[]; +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/linearprogress/linear-progress.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/linearprogress/linear-progress.js new file mode 100644 index 0000000..4245198 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/linearprogress/linear-progress.js
@@ -0,0 +1,26 @@ +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import { __decorate } from "tslib"; +import { customElement } from 'lit/decorators.js'; +import { LinearProgress } from './lib/linear-progress.js'; +import { styles } from './lib/linear-progress-styles.css.js'; +/** + * @summary Linear progress indicators display progress by animating along the + * length of a fixed, visible track. + * + * @description + * Progress indicators inform users about the status of ongoing processes. + * - Determinate indicators display how long a process will take. + * - Indeterminate indicators express an unspecified amount of wait time. + */ +let MdLinearProgress = class MdLinearProgress extends LinearProgress { +}; +MdLinearProgress.styles = [styles]; +MdLinearProgress = __decorate([ + customElement('md-linear-progress') +], MdLinearProgress); +export { MdLinearProgress }; +//# sourceMappingURL=linear-progress.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/harness.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/list/harness.d.ts index efc68489..021035a 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/harness.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/list/harness.d.ts
@@ -6,6 +6,7 @@ import { Harness } from '../testing/harness.js'; import { List } from './lib/list.js'; import { ListItemHarness } from './lib/listitem/harness.js'; +export { ListItemHarness } from './lib/listitem/harness.js'; /** * Test harness for list. */
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/avatar/list-item-avatar-styles.css.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/avatar/list-item-avatar-styles.css.d.ts deleted file mode 100644 index 1c75ade..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/avatar/list-item-avatar-styles.css.d.ts +++ /dev/null
@@ -1 +0,0 @@ -export declare const styles: import("lit").CSSResult;
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/avatar/list-item-avatar-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/avatar/list-item-avatar-styles.css.js deleted file mode 100644 index 6989952c0..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/avatar/list-item-avatar-styles.css.js +++ /dev/null
@@ -1,9 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { css } from 'lit'; -export const styles = css `:host{--_list-item-leading-avatar-color: var(--md-list-list-item-leading-avatar-color, var(--md-sys-color-primary-container, #eaddff));--_list-item-leading-avatar-shape: var(--md-list-list-item-leading-avatar-shape, 9999px);--_list-item-leading-avatar-size: var(--md-list-list-item-leading-avatar-size, 40px)}.md3-list-item__avatar{border-radius:var(--_list-item-leading-avatar-shape);display:inline-flex;height:var(--_list-item-leading-avatar-size);margin-inline-start:16px;width:var(--_list-item-leading-avatar-size)}/*# sourceMappingURL=list-item-avatar-styles.css.map */ -`; -//# sourceMappingURL=list-item-avatar-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/avatar/list-item-avatar.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/avatar/list-item-avatar.d.ts deleted file mode 100644 index 126fbcd7..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/avatar/list-item-avatar.d.ts +++ /dev/null
@@ -1,21 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { LitElement, TemplateResult } from 'lit'; -export declare class ListItemAvatar extends LitElement { - /** - * The image `src` for the avatar - */ - avatar: string; - /** - * The image `alt`. - */ - altText: string; - /** - * The image `loading` attribute. - */ - loading: 'eager' | 'lazy'; - render(): TemplateResult; -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/avatar/list-item-avatar.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/avatar/list-item-avatar.js deleted file mode 100644 index b852b20..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/avatar/list-item-avatar.js +++ /dev/null
@@ -1,48 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { __decorate, __metadata } from "tslib"; -import { html, LitElement, nothing } from 'lit'; -import { property } from 'lit/decorators.js'; -// tslint:disable-next-line:enforce-comments-on-exported-symbols -export class ListItemAvatar extends LitElement { - constructor() { - super(...arguments); - /** - * The image `src` for the avatar - */ - this.avatar = ''; - /** - * The image `alt`. - */ - this.altText = ''; - /** - * The image `loading` attribute. - */ - this.loading = 'eager'; - } - render() { - return html ` - <img - src="${this.avatar}" - alt="${this.altText || nothing}" - loading="${this.loading}" - class="md3-list-item__avatar" /> - `; - } -} -__decorate([ - property(), - __metadata("design:type", Object) -], ListItemAvatar.prototype, "avatar", void 0); -__decorate([ - property(), - __metadata("design:type", Object) -], ListItemAvatar.prototype, "altText", void 0); -__decorate([ - property(), - __metadata("design:type", String) -], ListItemAvatar.prototype, "loading", void 0); -//# sourceMappingURL=list-item-avatar.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/icon/list-item-icon-styles.css.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/icon/list-item-icon-styles.css.d.ts deleted file mode 100644 index 1c75ade..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/icon/list-item-icon-styles.css.d.ts +++ /dev/null
@@ -1 +0,0 @@ -export declare const styles: import("lit").CSSResult;
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/icon/list-item-icon-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/icon/list-item-icon-styles.css.js deleted file mode 100644 index b9f334c..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/icon/list-item-icon-styles.css.js +++ /dev/null
@@ -1,9 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { css } from 'lit'; -export const styles = css `:host{--_list-item-icon-color: var(--md-list-item-icon-list-item-icon-color, #000);--_list-item-icon-size: var(--md-list-item-icon-list-item-icon-size, 0);--_list-item-icon-opacity: var(--md-list-item-icon-list-item-icon-opacity, 1);display:inline-flex}.md3-list-item__icon{color:var(--_list-item-icon-color);opacity:var(--_list-item-icon-opacity);font-family:"Material Icons";font-weight:normal;font-style:normal;font-size:var(--_list-item-icon-size);line-height:1;letter-spacing:normal;text-transform:none;display:inline-flex;white-space:nowrap;word-wrap:normal;direction:ltr;height:100%;width:100%;padding-inline-start:16px;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;-moz-osx-font-smoothing:grayscale;font-feature-settings:"liga"}/*# sourceMappingURL=list-item-icon-styles.css.map */ -`; -//# sourceMappingURL=list-item-icon-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/icon/list-item-icon.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/icon/list-item-icon.d.ts deleted file mode 100644 index 159e73b..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/icon/list-item-icon.d.ts +++ /dev/null
@@ -1,9 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { LitElement, TemplateResult } from 'lit'; -export declare class ListItemIcon extends LitElement { - render(): TemplateResult; -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/icon/list-item-icon.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/icon/list-item-icon.js deleted file mode 100644 index 8718002..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/icon/list-item-icon.js +++ /dev/null
@@ -1,15 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { html, LitElement } from 'lit'; -// tslint:disable-next-line:enforce-comments-on-exported-symbols -export class ListItemIcon extends LitElement { - render() { - return html ` - <span class="md3-list-item__icon"><slot></slot></span> - `; - } -} -//# sourceMappingURL=list-item-icon.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/image/list-item-image-styles.css.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/image/list-item-image-styles.css.d.ts deleted file mode 100644 index 1c75ade..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/image/list-item-image-styles.css.d.ts +++ /dev/null
@@ -1 +0,0 @@ -export declare const styles: import("lit").CSSResult;
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/image/list-item-image-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/image/list-item-image-styles.css.js deleted file mode 100644 index 9279c18a..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/image/list-item-image-styles.css.js +++ /dev/null
@@ -1,9 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { css } from 'lit'; -export const styles = css `:host{--_list-item-leading-image-height: var(--md-list-item-image-list-item-leading-image-height, 56px);--_list-item-leading-image-width: var(--md-list-item-image-list-item-leading-image-width, 56px);--_list-item-leading-image-shape: var(--md-list-item-image-list-item-leading-image-shape, 0px)}.md3-list-item__image{display:inline-flex;margin-block-end:8px;margin-block-start:8px;margin-inline-start:16px;height:var(--_list-item-leading-image-height);width:var(--_list-item-leading-image-width);border-radius:var(--_list-item-leading-image-shape)}/*# sourceMappingURL=list-item-image-styles.css.map */ -`; -//# sourceMappingURL=list-item-image-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/image/list-item-image.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/image/list-item-image.d.ts deleted file mode 100644 index 989d0db..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/image/list-item-image.d.ts +++ /dev/null
@@ -1,21 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { LitElement, TemplateResult } from 'lit'; -export declare class ListItemImage extends LitElement { - /** - * The image `src`. - */ - image: string; - /** - * The image `alt`. - */ - altText: string; - /** - * The image `loading` attribute. - */ - loading: 'eager' | 'lazy'; - render(): TemplateResult; -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/image/list-item-image.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/image/list-item-image.js deleted file mode 100644 index 8ddc945..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/image/list-item-image.js +++ /dev/null
@@ -1,48 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { __decorate, __metadata } from "tslib"; -import { html, LitElement, nothing } from 'lit'; -import { property } from 'lit/decorators.js'; -// tslint:disable-next-line:enforce-comments-on-exported-symbols -export class ListItemImage extends LitElement { - constructor() { - super(...arguments); - /** - * The image `src`. - */ - this.image = ''; - /** - * The image `alt`. - */ - this.altText = ''; - /** - * The image `loading` attribute. - */ - this.loading = 'eager'; - } - render() { - return html ` - <img - src="${this.image}" - alt="${this.altText || nothing}" - loading=${this.loading} - class="md3-list-item__image" /> - `; - } -} -__decorate([ - property(), - __metadata("design:type", Object) -], ListItemImage.prototype, "image", void 0); -__decorate([ - property(), - __metadata("design:type", Object) -], ListItemImage.prototype, "altText", void 0); -__decorate([ - property(), - __metadata("design:type", String) -], ListItemImage.prototype, "loading", void 0); -//# sourceMappingURL=list-item-image.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/list-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/list-styles.css.js index 901948a..6621255c 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/list-styles.css.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/list-styles.css.js
@@ -4,6 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ import { css } from 'lit'; -export const styles = css `:host{--_container-color: var(--md-list-container-color, var(--md-sys-color-surface, #fffbfe));color:unset}.md3-list{background-color:var(--_container-color);display:block;list-style-type:none;margin:0;min-width:300px;outline:none;padding:8px 0;position:relative}/*# sourceMappingURL=list-styles.css.map */ +export const styles = css `:host{--_container-color: var(--md-list-container-color, var(--md-sys-color-surface, #fef7ff));color:unset;min-width:300px}.md3-list{background-color:var(--_container-color);border-radius:inherit;display:block;list-style-type:none;margin:0;min-width:inherit;outline:none;padding:8px 0;position:relative}/*# sourceMappingURL=list-styles.css.map */ `; //# sourceMappingURL=list-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/list.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/list.d.ts index fafa8f1..2672d3f 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/list.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/list.d.ts
@@ -3,20 +3,17 @@ * Copyright 2021 Google LLC * SPDX-License-Identifier: Apache-2.0 */ -import { LitElement, TemplateResult } from 'lit'; -import { ClassInfo } from 'lit/directives/class-map.js'; +import { LitElement } from 'lit'; import { ARIARole } from '../../types/aria.js'; import { ListItem } from './listitem/list-item.js'; export declare class List extends LitElement { static shadowRootOptions: ShadowRootInit; - ariaLabel: string; - ariaActivedescendant: string; - role: ARIARole; + type: ARIARole | ''; /** * The tabindex of the underlying list. */ listTabIndex: number; - listRoot: HTMLElement; + listRoot: HTMLElement | null; /** * An array of activatable and disableable list items. Queries every assigned * element that has the `md-list-item` attribute. @@ -26,19 +23,15 @@ * children / directly slotted elements. */ items: ListItem[]; - render(): TemplateResult; + protected render(): import("lit-html").TemplateResult<1>; /** * Renders the main list element. */ - protected renderList(): TemplateResult<1>; - /** - * The classes to be applied to the underlying list. - */ - protected getListClasses(): ClassInfo; + private renderList; /** * The content to be slotted into the list. */ - protected renderContent(): TemplateResult<1>; + private renderContent; /** * Handles keyboard navigation in the list. * @@ -105,7 +98,7 @@ * @param index {{index: number}} The index to search from. * @returns The next activatable item or `null` if none are activatable. */ - protected static getNextItem<T extends ListItem>(items: T[], index: number): T; + private static getNextItem; /** * Retrieves the the previous non-disabled item of a given array of items. * @@ -113,5 +106,5 @@ * @param index {{index: number}} The index to search from. * @returns The previous activatable item or `null` if none are activatable. */ - protected static getPrevItem<T extends ListItem>(items: T[], index: number): T; + private static getPrevItem; }
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/list.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/list.js index 3a1aee62..9957557 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/list.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/list.js
@@ -3,14 +3,11 @@ * Copyright 2021 Google LLC * SPDX-License-Identifier: Apache-2.0 */ -import { __decorate, __metadata } from "tslib"; -// Required for @ariaProperty -// tslint:disable:no-new-decorators -import { html, LitElement } from 'lit'; +var _a; +import { __decorate } from "tslib"; +import { html, LitElement, nothing } from 'lit'; import { property, query, queryAssignedElements } from 'lit/decorators.js'; -import { classMap } from 'lit/directives/class-map.js'; -import { ifDefined } from 'lit/directives/if-defined.js'; -import { ariaProperty } from '../../decorators/aria-property.js'; +import { requestUpdateOnAriaChange } from '../../aria/delegate.js'; const NAVIGABLE_KEYS = { ArrowDown: 'ArrowDown', ArrowUp: 'ArrowUp', @@ -25,8 +22,7 @@ export class List extends LitElement { constructor() { super(...arguments); - // @ts-ignore(b/264292293): Use `override` with TS 4.9+ - this.role = 'list'; + this.type = 'list'; /** * The tabindex of the underlying list. */ @@ -39,11 +35,13 @@ * Renders the main list element. */ renderList() { + // Needed for closure conformance + const { ariaLabel } = this; return html ` - <ul class="md3-list ${classMap(this.getListClasses())}" - aria-label="${ifDefined(this.ariaLabel)}" + <ul class="md3-list" + aria-label=${ariaLabel || nothing} tabindex=${this.listTabIndex} - role=${this.role} + role=${this.type || nothing} @keydown=${this.handleKeydown} > ${this.renderContent()} @@ -51,12 +49,6 @@ `; } /** - * The classes to be applied to the underlying list. - */ - getListClasses() { - return {}; - } - /** * The content to be slotted into the list. */ renderContent() { @@ -162,7 +154,7 @@ return activeItem; } focus() { - this.listRoot.focus(); + this.listRoot?.focus(); } /** * Retrieves the the first activated item of a given array of items. @@ -248,34 +240,21 @@ return null; } } +_a = List; +(() => { + requestUpdateOnAriaChange(_a); +})(); List.shadowRootOptions = { mode: 'open', delegatesFocus: true }; __decorate([ - ariaProperty, - property({ type: String, attribute: 'data-aria-label', noAccessor: true }), - __metadata("design:type", String) -], List.prototype, "ariaLabel", void 0); + property() +], List.prototype, "type", void 0); __decorate([ - ariaProperty, - property({ type: String, attribute: 'data-aria-activedescendant', noAccessor: true }), - __metadata("design:type", String) -], List.prototype, "ariaActivedescendant", void 0); -__decorate([ - ariaProperty - // tslint:disable-next-line - , - property({ type: String, attribute: 'data-role', noAccessor: true }), - __metadata("design:type", String) -], List.prototype, "role", void 0); -__decorate([ - property({ type: Number }), - __metadata("design:type", Number) + property({ type: Number }) ], List.prototype, "listTabIndex", void 0); __decorate([ - query('.md3-list'), - __metadata("design:type", HTMLElement) + query('.md3-list') ], List.prototype, "listRoot", void 0); __decorate([ - queryAssignedElements({ flatten: true, selector: '[md-list-item]' }), - __metadata("design:type", Array) + queryAssignedElements({ flatten: true, selector: '[md-list-item]' }) ], List.prototype, "items", void 0); //# sourceMappingURL=list.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/listitem/list-item-private-styles.css.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/listitem/forced-colors-styles.css.d.ts similarity index 100% rename from third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/listitem/list-item-private-styles.css.d.ts rename to third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/listitem/forced-colors-styles.css.d.ts
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/listitem/forced-colors-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/listitem/forced-colors-styles.css.js new file mode 100644 index 0000000..7188df0 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/listitem/forced-colors-styles.css.js
@@ -0,0 +1,9 @@ +/** + * @license + * Copyright 2022 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import { css } from 'lit'; +export const styles = css `@media(forced-colors: active){:host{--md-list-item-list-item-disabled-label-text-color: GrayText;--md-list-item-list-item-disabled-label-text-opacity: 1;--md-list-item-list-item-disabled-leading-icon-color: GrayText;--md-list-item-list-item-disabled-leading-icon-opacity: 1;--md-list-item-list-item-disabled-trailing-icon-color: GrayText;--md-list-item-list-item-disabled-trailing-icon-opacity: 1}}/*# sourceMappingURL=forced-colors-styles.css.map */ +`; +//# sourceMappingURL=forced-colors-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/listitem/list-item-private-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/listitem/list-item-private-styles.css.js deleted file mode 100644 index 84677845..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/listitem/list-item-private-styles.css.js +++ /dev/null
@@ -1,9 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { css } from 'lit'; -export const styles = css `:host{--_list-item-container-color: var(--md-list-list-item-container-color, var(--md-sys-color-surface, #fffbfe));--_list-item-container-elevation: var(--md-list-list-item-container-elevation, 0);--_list-item-container-shape: var(--md-list-list-item-container-shape, 0px);--_list-item-disabled-label-text-color: var(--md-list-list-item-disabled-label-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_list-item-disabled-label-text-opacity: var(--md-list-list-item-disabled-label-text-opacity, 0.3);--_list-item-disabled-leading-icon-color: var(--md-list-list-item-disabled-leading-icon-color, var(--md-sys-color-on-surface, #1c1b1f));--_list-item-disabled-leading-icon-opacity: var(--md-list-list-item-disabled-leading-icon-opacity, 0.38);--_list-item-disabled-state-layer-color: var(--md-list-list-item-disabled-state-layer-color, var(--md-sys-color-on-surface, #1c1b1f));--_list-item-disabled-state-layer-opacity: var(--md-list-list-item-disabled-state-layer-opacity, 0.12);--_list-item-disabled-trailing-icon-color: var(--md-list-list-item-disabled-trailing-icon-color, var(--md-sys-color-on-surface, #1c1b1f));--_list-item-disabled-trailing-icon-opacity: var(--md-list-list-item-disabled-trailing-icon-opacity, 0.38);--_list-item-dragged-container-elevation: var(--md-list-list-item-dragged-container-elevation, 8);--_list-item-dragged-label-text-color: var(--md-list-list-item-dragged-label-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_list-item-dragged-leading-icon-icon-color: var(--md-list-list-item-dragged-leading-icon-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_list-item-dragged-state-layer-color: var(--md-list-list-item-dragged-state-layer-color, var(--md-sys-color-on-surface, #1c1b1f));--_list-item-dragged-state-layer-opacity: var(--md-list-list-item-dragged-state-layer-opacity, 0.12);--_list-item-dragged-trailing-icon-icon-color: var(--md-list-list-item-dragged-trailing-icon-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_list-item-focus-label-text-color: var(--md-list-list-item-focus-label-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_list-item-focus-leading-icon-icon-color: var(--md-list-list-item-focus-leading-icon-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_list-item-focus-state-layer-color: var(--md-list-list-item-focus-state-layer-color, var(--md-sys-color-on-surface, #1c1b1f));--_list-item-focus-state-layer-opacity: var(--md-list-list-item-focus-state-layer-opacity, 0.12);--_list-item-focus-trailing-icon-icon-color: var(--md-list-list-item-focus-trailing-icon-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_list-item-hover-label-text-color: var(--md-list-list-item-hover-label-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_list-item-hover-leading-icon-icon-color: var(--md-list-list-item-hover-leading-icon-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_list-item-hover-state-layer-color: var(--md-list-list-item-hover-state-layer-color, var(--md-sys-color-on-surface, #1c1b1f));--_list-item-hover-state-layer-opacity: var(--md-list-list-item-hover-state-layer-opacity, 0.08);--_list-item-hover-trailing-icon-icon-color: var(--md-list-list-item-hover-trailing-icon-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_list-item-label-text-color: var(--md-list-list-item-label-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_list-item-label-text-font: var(--md-list-list-item-label-text-font, Roboto);--_list-item-label-text-line-height: var(--md-list-list-item-label-text-line-height, 1.5rem);--_list-item-label-text-size: var(--md-list-list-item-label-text-size, 1rem);--_list-item-label-text-tracking: var(--md-list-list-item-label-text-tracking, 0.031rem);--_list-item-label-text-type: var(--md-list-list-item-label-text-type, 400 1rem / 1.5rem Roboto);--_list-item-label-text-weight: var(--md-list-list-item-label-text-weight, 400);--_list-item-large-leading-video-height: var(--md-list-list-item-large-leading-video-height, 69px);--_list-item-leading-avatar-label-color: var(--md-list-list-item-leading-avatar-label-color, var(--md-sys-color-on-primary-container, #21005d));--_list-item-leading-avatar-label-font: var(--md-list-list-item-leading-avatar-label-font, Roboto);--_list-item-leading-avatar-label-line-height: var(--md-list-list-item-leading-avatar-label-line-height, 1.5rem);--_list-item-leading-avatar-label-size: var(--md-list-list-item-leading-avatar-label-size, 1rem);--_list-item-leading-avatar-label-tracking: var(--md-list-list-item-leading-avatar-label-tracking, 0.009rem);--_list-item-leading-avatar-label-type: var(--md-list-list-item-leading-avatar-label-type, 500 1rem / 1.5rem Roboto);--_list-item-leading-avatar-label-weight: var(--md-list-list-item-leading-avatar-label-weight, 500);--_list-item-leading-avatar-color: var(--md-list-list-item-leading-avatar-color, var(--md-sys-color-primary-container, #eaddff));--_list-item-leading-avatar-shape: var(--md-list-list-item-leading-avatar-shape, 9999px);--_list-item-leading-avatar-size: var(--md-list-list-item-leading-avatar-size, 40px);--_list-item-leading-icon-color: var(--md-list-list-item-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_list-item-leading-icon-size: var(--md-list-list-item-leading-icon-size, 18px);--_list-item-leading-image-height: var(--md-list-list-item-leading-image-height, 56px);--_list-item-leading-image-shape: var(--md-list-list-item-leading-image-shape, 0px);--_list-item-leading-image-width: var(--md-list-list-item-leading-image-width, 56px);--_list-item-leading-video-shape: var(--md-list-list-item-leading-video-shape, 0px);--_list-item-leading-video-width: var(--md-list-list-item-leading-video-width, 100px);--_list-item-one-line-container-height: var(--md-list-list-item-one-line-container-height, 56px);--_list-item-overline-color: var(--md-list-list-item-overline-color, var(--md-sys-color-on-surface-variant, #49454f));--_list-item-overline-font: var(--md-list-list-item-overline-font, Roboto);--_list-item-overline-line-height: var(--md-list-list-item-overline-line-height, 1rem);--_list-item-overline-size: var(--md-list-list-item-overline-size, 0.688rem);--_list-item-overline-tracking: var(--md-list-list-item-overline-tracking, 0.031rem);--_list-item-overline-type: var(--md-list-list-item-overline-type, 500 0.688rem / 1rem Roboto);--_list-item-overline-weight: var(--md-list-list-item-overline-weight, 500);--_list-item-pressed-label-text-color: var(--md-list-list-item-pressed-label-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_list-item-pressed-leading-icon-icon-color: var(--md-list-list-item-pressed-leading-icon-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_list-item-pressed-state-layer-color: var(--md-list-list-item-pressed-state-layer-color, var(--md-sys-color-on-surface, #1c1b1f));--_list-item-pressed-state-layer-opacity: var(--md-list-list-item-pressed-state-layer-opacity, 0.12);--_list-item-pressed-trailing-icon-icon-color: var(--md-list-list-item-pressed-trailing-icon-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_list-item-selected-trailing-icon-color: var(--md-list-list-item-selected-trailing-icon-color, var(--md-sys-color-primary, #6750a4));--_list-item-small-leading-video-height: var(--md-list-list-item-small-leading-video-height, 56px);--_list-item-supporting-text-color: var(--md-list-list-item-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_list-item-supporting-text-font: var(--md-list-list-item-supporting-text-font, Roboto);--_list-item-supporting-text-line-height: var(--md-list-list-item-supporting-text-line-height, 1.25rem);--_list-item-supporting-text-size: var(--md-list-list-item-supporting-text-size, 0.875rem);--_list-item-supporting-text-tracking: var(--md-list-list-item-supporting-text-tracking, 0.016rem);--_list-item-supporting-text-type: var(--md-list-list-item-supporting-text-type, 400 0.875rem / 1.25rem Roboto);--_list-item-supporting-text-weight: var(--md-list-list-item-supporting-text-weight, 400);--_list-item-three-line-container-height: var(--md-list-list-item-three-line-container-height, 88px);--_list-item-trailing-icon-color: var(--md-list-list-item-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_list-item-trailing-icon-size: var(--md-list-list-item-trailing-icon-size, 24px);--_list-item-trailing-supporting-text-color: var(--md-list-list-item-trailing-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_list-item-trailing-supporting-text-font: var(--md-list-list-item-trailing-supporting-text-font, Roboto);--_list-item-trailing-supporting-text-line-height: var(--md-list-list-item-trailing-supporting-text-line-height, 1rem);--_list-item-trailing-supporting-text-size: var(--md-list-list-item-trailing-supporting-text-size, 0.688rem);--_list-item-trailing-supporting-text-tracking: var(--md-list-list-item-trailing-supporting-text-tracking, 0.031rem);--_list-item-trailing-supporting-text-type: var(--md-list-list-item-trailing-supporting-text-type, 500 0.688rem / 1rem Roboto);--_list-item-trailing-supporting-text-weight: var(--md-list-list-item-trailing-supporting-text-weight, 500);--_list-item-two-line-container-height: var(--md-list-list-item-two-line-container-height, 72px);--_list-item-unselected-trailing-icon-color: var(--md-list-list-item-unselected-trailing-icon-color, var(--md-sys-color-on-surface, #1c1b1f))}/*# sourceMappingURL=list-item-private-styles.css.map */ -`; -//# sourceMappingURL=list-item-private-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/listitem/list-item-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/listitem/list-item-styles.css.js index da1faf2..95b6f2d 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/listitem/list-item-styles.css.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/listitem/list-item-styles.css.js
@@ -4,6 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ import { css } from 'lit'; -export const styles = css `:host{color:unset;--md-list-item-image-list-item-leading-image-height:var(--_list-item-leading-image-height);--md-list-item-image-list-item-leading-image-width:var(--_list-item-leading-image-width);--md-list-item-image-list-item-leading-image-shape:var(--_list-item-leading-image-shape);--md-list-item-video-list-item-small-leading-video-height:var(--_list-item-small-leading-video-height);--md-list-item-video-list-item-large-leading-video-height:var(--_list-item-large-leading-video-height);--md-list-item-video-list-item-leading-video-width:var(--_list-item-leading-video-width);--md-list-item-video-list-item-leading-video-shape:var(--_list-item-leading-video-shape);--md-focus-ring-shape-start-start:4px;--md-focus-ring-shape-start-end:4px;--md-focus-ring-shape-end-end:4px;--md-focus-ring-shape-end-start:4px;--md-focus-ring-offset-vertical:-2px;--md-focus-ring-offset-horizontal:-3px;--md-ripple-hover-state-layer-color:var(--_list-item-hover-state-layer-color);--md-ripple-hover-state-layer-opacity:var(--_list-item-hover-state-layer-opacity);--md-ripple-pressed-state-layer-color:var(--_list-item-pressed-state-layer-color);--md-ripple-pressed-state-layer-opacity:var(--_list-item-pressed-state-layer-opacity);--md-ripple-focus-state-layer-color:var(--_list-item-focus-state-layer-color);--md-ripple-focus-state-layer-opacity:var(--_list-item-focus-state-layer-opacity)}.list-item{align-items:center;box-sizing:border-box;display:flex;outline:none;position:relative;width:100%;text-decoration:none;background-color:var(--_list-item-container-color);border-radius:var(--_list-item-container-shape)}.list-item.enabled{cursor:pointer}.list-item.disabled{pointer-events:none}.with-one-line{min-height:var(--_list-item-one-line-container-height)}.with-two-line{min-height:var(--_list-item-two-line-container-height)}.with-three-line{min-height:var(--_list-item-three-line-container-height)}.start{flex:0 0 auto;z-index:1;--md-list-item-icon-list-item-icon-color:var(--_list-item-leading-icon-color);--md-list-item-icon-list-item-icon-size:var(--_list-item-leading-icon-size)}:hover .start{--md-list-item-icon-list-item-icon-color:var(--_list-item-hover-leading-icon-icon-color)}:active .start{--md-list-item-icon-list-item-icon-color:var(--_list-item-pressed-leading-icon-icon-color)}.disabled .start{--md-list-item-icon-list-item-icon-color:var(--_list-item-disabled-leading-icon-color);--md-list-item-icon-list-item-icon-opacity:var(--_list-item-disabled-leading-icon-opacity)}.with-leading-thumbnail .start,.with-leading-image .start{padding-inline-start:16px}.with-leading-video .start{padding-inline-start:0}.body{box-sizing:border-box;flex:1 0 0;padding-inline-start:16px;width:100%;z-index:1}.end{flex:0 0 auto;padding-inline-end:24px;z-index:1;--md-list-item-icon-list-item-icon-color:var(--_list-item-trailing-icon-color);--md-list-item-icon-list-item-icon-size:var(--_list-item-trailing-icon-size)}:hover .end{--md-list-item-icon-list-item-icon-color:var(--_list-item-hover-trailing-icon-icon-color)}:active .end{--md-list-item-icon-list-item-icon-color:var(--_list-item-pressed-trailing-icon-icon-color)}.disabled .end{--md-list-item-icon-list-item-icon-color:var(--_list-item-disabled-trailing-icon-color);--md-list-item-icon-list-item-icon-opacity:var(--_list-item-disabled-trailing-icon-opacity)}.label-text{display:flex;color:var(--_list-item-label-text-color);font-family:var(--_list-item-label-text-font);font-size:var(--_list-item-label-text-size);letter-spacing:var(--_list-item-label-text-tracking);font-weight:var(--_list-item-label-text-weight);line-height:var(--_list-item-label-text-line-height)}.disabled .label-text{color:var(--_list-item-disabled-label-text-color);opacity:var(--_list-item-disabled-label-text-opacity)}.supporting-text{display:block;padding-block-start:4px;text-overflow:ellipsis;white-space:nowrap;overflow:hidden;width:100%;color:var(--_list-item-supporting-text-color);font-family:var(--_list-item-supporting-text-font);font-size:var(--_list-item-supporting-text-size);letter-spacing:var(--_list-item-supporting-text-tracking);font-weight:var(--_list-item-supporting-text-weight);line-height:var(--_list-item-supporting-text-line-height)}.disabled .supporting-text{color:var(--_list-item-disabled-label-text-color);opacity:var(--_list-item-disabled-label-text-opacity)}.supporting-text--multi-line{-webkit-box-orient:vertical;-webkit-line-clamp:2;display:-webkit-box;overflow:hidden;white-space:normal}.trailing-supporting-text{padding-inline-start:16px;font-family:var(--_list-item-trailing-supporting-text-font);font-size:var(--_list-item-trailing-supporting-text-size);letter-spacing:var(--_list-item-trailing-supporting-text-tracking);font-weight:var(--_list-item-trailing-supporting-text-weight);line-height:var(--_list-item-trailing-supporting-text-line-height)}.list-item:not(.disabled) .trailing-supporting-text{color:var(--_list-item-trailing-supporting-text-color)}.disabled .trailing-supporting-text{color:var(--_list-item-disabled-label-text-color);opacity:var(--_list-item-disabled-label-text-opacity)}.ripple{display:inline-flex;inset:0;position:absolute;z-index:0}.focus-ring{z-index:1}/*# sourceMappingURL=list-item-styles.css.map */ +export const styles = css `:host{--_list-item-container-color: var(--md-list-item-list-item-container-color, var(--md-sys-color-surface, #fef7ff));--_list-item-container-shape: var(--md-list-item-list-item-container-shape, 0px);--_list-item-disabled-label-text-color: var(--md-list-item-list-item-disabled-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_list-item-disabled-label-text-opacity: var(--md-list-item-list-item-disabled-label-text-opacity, 0.3);--_list-item-disabled-leading-icon-color: var(--md-list-item-list-item-disabled-leading-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_list-item-disabled-leading-icon-opacity: var(--md-list-item-list-item-disabled-leading-icon-opacity, 0.38);--_list-item-disabled-trailing-icon-color: var(--md-list-item-list-item-disabled-trailing-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_list-item-disabled-trailing-icon-opacity: var(--md-list-item-list-item-disabled-trailing-icon-opacity, 0.38);--_list-item-focus-label-text-color: var(--md-list-item-list-item-focus-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_list-item-focus-leading-icon-icon-color: var(--md-list-item-list-item-focus-leading-icon-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_list-item-focus-state-layer-color: var(--md-list-item-list-item-focus-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_list-item-focus-state-layer-opacity: var(--md-list-item-list-item-focus-state-layer-opacity, 0.12);--_list-item-focus-trailing-icon-icon-color: var(--md-list-item-list-item-focus-trailing-icon-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_list-item-hover-label-text-color: var(--md-list-item-list-item-hover-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_list-item-hover-leading-icon-icon-color: var(--md-list-item-list-item-hover-leading-icon-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_list-item-hover-state-layer-color: var(--md-list-item-list-item-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_list-item-hover-state-layer-opacity: var(--md-list-item-list-item-hover-state-layer-opacity, 0.08);--_list-item-hover-trailing-icon-icon-color: var(--md-list-item-list-item-hover-trailing-icon-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_list-item-label-text-color: var(--md-list-item-list-item-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_list-item-label-text-line-height: var(--md-list-item-list-item-label-text-line-height, 1.5rem);--_list-item-label-text-type: var(--md-list-item-list-item-label-text-type, var(--md-sys-typescale-body-large, 400 1rem / 1.5rem var(--md-ref-typeface-plain, Roboto)));--_list-item-large-leading-video-height: var(--md-list-item-list-item-large-leading-video-height, 69px);--_list-item-leading-avatar-label-color: var(--md-list-item-list-item-leading-avatar-label-color, var(--md-sys-color-on-primary-container, #21005d));--_list-item-leading-avatar-label-type: var(--md-list-item-list-item-leading-avatar-label-type, var(--md-sys-typescale-title-medium, 500 1rem / 1.5rem var(--md-ref-typeface-plain, Roboto)));--_list-item-leading-avatar-color: var(--md-list-item-list-item-leading-avatar-color, var(--md-sys-color-primary-container, #eaddff));--_list-item-leading-avatar-shape: var(--md-list-item-list-item-leading-avatar-shape, 9999px);--_list-item-leading-avatar-size: var(--md-list-item-list-item-leading-avatar-size, 40px);--_list-item-leading-icon-color: var(--md-list-item-list-item-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_list-item-leading-icon-size: var(--md-list-item-list-item-leading-icon-size, 18px);--_list-item-leading-image-height: var(--md-list-item-list-item-leading-image-height, 56px);--_list-item-leading-image-shape: var(--md-list-item-list-item-leading-image-shape, 0px);--_list-item-leading-image-width: var(--md-list-item-list-item-leading-image-width, 56px);--_list-item-leading-video-shape: var(--md-list-item-list-item-leading-video-shape, 0px);--_list-item-leading-video-width: var(--md-list-item-list-item-leading-video-width, 100px);--_list-item-one-line-container-height: var(--md-list-item-list-item-one-line-container-height, 56px);--_list-item-pressed-label-text-color: var(--md-list-item-list-item-pressed-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_list-item-pressed-leading-icon-icon-color: var(--md-list-item-list-item-pressed-leading-icon-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_list-item-pressed-state-layer-color: var(--md-list-item-list-item-pressed-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_list-item-pressed-state-layer-opacity: var(--md-list-item-list-item-pressed-state-layer-opacity, 0.12);--_list-item-pressed-trailing-icon-icon-color: var(--md-list-item-list-item-pressed-trailing-icon-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_list-item-small-leading-video-height: var(--md-list-item-list-item-small-leading-video-height, 56px);--_list-item-supporting-text-color: var(--md-list-item-list-item-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_list-item-supporting-text-type: var(--md-list-item-list-item-supporting-text-type, var(--md-sys-typescale-body-medium, 400 0.875rem / 1.25rem var(--md-ref-typeface-plain, Roboto)));--_list-item-three-line-container-height: var(--md-list-item-list-item-three-line-container-height, 88px);--_list-item-trailing-icon-color: var(--md-list-item-list-item-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_list-item-trailing-icon-size: var(--md-list-item-list-item-trailing-icon-size, 24px);--_list-item-trailing-supporting-text-color: var(--md-list-item-list-item-trailing-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_list-item-trailing-supporting-text-line-height: var(--md-list-item-list-item-trailing-supporting-text-line-height, 1rem);--_list-item-trailing-supporting-text-type: var(--md-list-item-list-item-trailing-supporting-text-type, var(--md-sys-typescale-label-small, 500 0.688rem / 1rem var(--md-ref-typeface-plain, Roboto)));--_list-item-two-line-container-height: var(--md-list-item-list-item-two-line-container-height, 72px);--_list-item-leading-element-leading-space: var(--md-list-item-list-item-leading-element-leading-space, 16px);--_list-item-leading-space: var(--md-list-item-list-item-leading-space, 16px);--_list-item-leading-video-leading-space: var(--md-list-item-list-item-leading-video-leading-space, 0px);--_list-item-trailing-element-headline-trailing-element-space: var(--md-list-item-list-item-trailing-element-headline-trailing-element-space, 16px);--_list-item-trailing-space: var(--md-list-item-list-item-trailing-space, 16px)}:host{color:unset;--md-focus-ring-offset: -3px;--md-focus-ring-shape: 4px;--md-ripple-hover-color:var(--_list-item-hover-state-layer-color);--md-ripple-hover-opacity:var(--_list-item-hover-state-layer-opacity);--md-ripple-pressed-color:var(--_list-item-pressed-state-layer-color);--md-ripple-pressed-opacity:var(--_list-item-pressed-state-layer-opacity);--md-ripple-focus-color:var(--_list-item-focus-state-layer-color);--md-ripple-focus-opacity:var(--_list-item-focus-state-layer-opacity)}.list-item{align-items:center;box-sizing:border-box;display:flex;outline:none;position:relative;width:100%;text-decoration:none;background-color:var(--_list-item-container-color);border-radius:var(--_list-item-container-shape);-webkit-tap-highlight-color:rgba(0,0,0,0)}.list-item:not(.disabled){cursor:pointer}.list-item.disabled{pointer-events:none}.content-wrapper{display:flex;width:100%;border-radius:inherit}md-ripple{border-radius:inherit}.with-one-line{min-height:var(--_list-item-one-line-container-height)}.with-two-line{min-height:var(--_list-item-two-line-container-height)}.with-three-line{min-height:var(--_list-item-three-line-container-height)}.start{display:inline-flex;flex-direction:column;justify-content:center;align-items:center;flex:0 0 auto;z-index:1}.with-three-line .start{justify-content:start}slot[name=start]::slotted([data-variant=icon]),slot[name=start]::slotted([data-variant=image]),slot[name=start]::slotted([data-variant=avatar]){margin-inline-start:var(--_list-item-leading-element-leading-space)}.body{display:inline-flex;justify-content:center;flex-direction:column;box-sizing:border-box;flex:1 0 0;padding-inline-start:var(--_list-item-leading-space);padding-inline-end:var(--_list-item-trailing-space);z-index:1}.end{display:inline-flex;flex-direction:column;justify-content:center;flex:0 0 auto;z-index:1}.with-three-line .end{justify-content:start}slot[name=end]::slotted(*),.trailing-supporting-text{margin-inline-end:var(--_list-item-trailing-element-headline-trailing-element-space)}.label-text{display:flex;color:var(--_list-item-label-text-color);font:var(--_list-item-label-text-type)}:hover .label-text{color:var(--_list-item-hover-label-text-color)}:focus .label-text{color:var(--_list-item-focus-label-text-color)}:active .label-text{color:var(--_list-item-pressed-label-text-color)}.disabled .label-text{color:var(--_list-item-disabled-label-text-color);opacity:var(--_list-item-disabled-label-text-opacity)}.supporting-text{text-overflow:ellipsis;white-space:normal;overflow:hidden;width:100%;color:var(--_list-item-supporting-text-color);font:var(--_list-item-supporting-text-type);-webkit-box-orient:vertical;-webkit-line-clamp:1;display:-webkit-box}.disabled .supporting-text{color:var(--_list-item-disabled-label-text-color);opacity:var(--_list-item-disabled-label-text-opacity)}.supporting-text--multi-line{-webkit-line-clamp:2}.trailing-supporting-text{padding-inline-start:16px;font:var(--_list-item-trailing-supporting-text-type)}.list-item:not(.disabled) .trailing-supporting-text{color:var(--_list-item-trailing-supporting-text-color)}.disabled .trailing-supporting-text{color:var(--_list-item-disabled-label-text-color);opacity:var(--_list-item-disabled-label-text-opacity)}.with-three-line .trailing-supporting-text{padding-block-start:calc((var(--_list-item-label-text-line-height) - var(--_list-item-trailing-supporting-text-line-height))/2)}.focus-ring{z-index:1}::slotted([data-variant=image]){display:inline-flex;height:var(--_list-item-leading-image-height);width:var(--_list-item-leading-image-width);border-radius:var(--_list-item-leading-image-shape);padding-block:calc((var(--_list-item-two-line-container-height) - var(--_list-item-leading-image-height))/2)}.with-three-line ::slotted([data-variant=image]){padding-block:0}slot[name=start]::slotted([data-variant=icon]){--md-icon-color:var(--_list-item-leading-icon-color);--md-icon-size:var(--_list-item-leading-icon-size)}.with-three-line slot[name=start]::slotted([data-variant=icon]){padding-block-start:calc((var(--_list-item-label-text-line-height) - var(--_list-item-leading-icon-size))/2)}slot[name=end]::slotted([data-variant=icon]){--md-icon-color:var(--_list-item-trailing-icon-color);--md-icon-size:var(--_list-item-trailing-icon-size)}.with-three-line slot[name=end]::slotted([data-variant=icon]){padding-block-start:calc((var(--_list-item-label-text-line-height) - var(--_list-item-trailing-icon-size))/2)}:hover slot[name=start]::slotted([data-variant=icon]){--md-icon-color:var(--_list-item-hover-leading-icon-icon-color)}:hover slot[name=end]::slotted([data-variant=icon]){--md-icon-color:var(--_list-item-hover-trailing-icon-icon-color)}:focus slot[name=start]::slotted([data-variant=icon]){--md-icon-color:var(--_list-item-focus-leading-icon-icon-color)}:focus slot[name=end]::slotted([data-variant=icon]){--md-icon-color:var(--_list-item-focus-trailing-icon-icon-color)}:active slot[name=start]::slotted([data-variant=icon]){--md-icon-color:var(--_list-item-pressed-leading-icon-icon-color)}:active slot[name=end]::slotted([data-variant=icon]){--md-icon-color:var(--_list-item-pressed-trailing-icon-icon-color)}.disabled slot[name=start]::slotted([data-variant=icon]){opacity:var(--_list-item-disabled-leading-icon-opacity);--md-icon-color:var(--_list-item-disabled-leading-icon-color)}.disabled slot[name=end]::slotted([data-variant=icon]){opacity:var(--_list-item-disabled-trailing-icon-opacity);--md-icon-color:var(--_list-item-disabled-trailing-icon-color)}::slotted([data-variant=avatar]){display:inline-flex;justify-content:center;align-items:center;background-color:var(--_list-item-leading-avatar-color);height:var(--_list-item-leading-avatar-size);width:var(--_list-item-leading-avatar-size);border-radius:var(--_list-item-leading-avatar-shape);color:var(--_list-item-leading-avatar-label-color);font:var(--_list-item-leading-avatar-label-type)}::slotted([data-variant=video]),::slotted([data-variant=video-large]){display:inline-flex;object-fit:cover;height:var(--_list-item-small-leading-video-height);width:var(--_list-item-leading-video-width);border-radius:var(--_list-item-leading-video-shape);margin-inline-start:var(--_list-item-leading-video-leading-space);padding-block:calc((var(--_list-item-three-line-container-height) - var(--_list-item-small-leading-video-height))/2)}.with-three-line ::slotted([data-variant=video]),.with-three-line ::slotted([data-variant=video-large]){padding-block:0}::slotted([data-variant=video-large]){padding-block:calc((var(--_list-item-three-line-container-height) - var(--_list-item-large-leading-video-height))/2);height:var(--_list-item-large-leading-video-height)}/*# sourceMappingURL=list-item-styles.css.map */ `; //# sourceMappingURL=list-item-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/listitem/list-item.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/listitem/list-item.d.ts index 2882ad0e..664fd80 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/listitem/list-item.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/listitem/list-item.d.ts
@@ -5,8 +5,7 @@ */ import '../../../ripple/ripple.js'; import '../../../focus/focus-ring.js'; -import { LitElement, nothing, PropertyValues, TemplateResult } from 'lit'; -import { ClassInfo } from 'lit/directives/class-map.js'; +import { LitElement, PropertyValues } from 'lit'; import { MdRipple } from '../../../ripple/ripple.js'; import { ARIARole } from '../../../types/aria.js'; interface ListItemSelf { @@ -17,24 +16,22 @@ * The interface of an item that is compatible with md-list. An item that is * selectable and disablable. */ -export declare type ListItem = ListItemSelf & HTMLElement; +export type ListItem = ListItemSelf & HTMLElement; export declare class ListItemEl extends LitElement implements ListItem { - role: ARIARole; - ariaSelected: 'true' | 'false'; - ariaChecked: 'true' | 'false'; /** * The primary, headline text of the list item. */ headline: string; /** - * The one-line supporting text below the headline. + * The one-line supporting text below the headline. Set + * `multiLineSupportingText` to `true` to support multiple lines in the + * supporting text. */ supportingText: string; /** - * The multi-line supporting text below the headline. __NOTE:__ if set to a - * truthy value, overrides the visibility and behavior of `supportingText`. + * Modifies `supportingText` to support multiple lines. */ - multiLineSupportingText: string; + multiLineSupportingText: boolean; /** * The supporting text placed at the end of the item. Overriden by elements * slotted into the `end` slot. @@ -52,78 +49,81 @@ */ itemTabIndex: number; /** - * Whether or not the element is in the selected visual state. When active, - * tabindex is set to 0, and in some list item variants (like md-list-item), - * focuses the underlying item. + * Whether or not the element is actively being interacted with by md-list. + * When active, tabindex is set to 0, and in some list item variants (like + * md-list-item), focuses the underlying item. */ active: boolean; /** * READONLY. Sets the `md-list-item` attribute on the element. */ isListItem: boolean; - protected ripple: Promise<MdRipple | null>; - protected listItemRoot: HTMLElement; - protected showFocusRing: boolean; - protected showRipple: boolean; + private readonly ripple; + protected readonly listItemRoot: HTMLElement | null; + protected readonly listItemRole: ARIARole; + private showRipple; /** * Only meant to be overriden by subclassing and not by the user. This is * so that we have control over focus on specific variants such as disabling * focus on <md-autocomplete-item> but enabling it for <md-menu-item>. */ - protected focusOnSelection: boolean; - protected getRipple: () => Promise<MdRipple>; + protected focusOnActivation: boolean; + protected readonly getRipple: () => Promise<MdRipple>; private isFirstUpdate; - willUpdate(changed: PropertyValues<this>): void; - render(): TemplateResult; + protected willUpdate(changed: PropertyValues<this>): void; + protected render(): import("lit-html").TemplateResult<1>; /** * Renders the root list item. * * @param content {unkown} the child content of the list item. */ - protected renderListItem(content: unknown): TemplateResult<1>; + protected renderListItem(content: unknown): import("lit-html").TemplateResult<1>; /** * Handles rendering of the ripple element. */ - protected renderRipple(): TemplateResult | typeof nothing; + private renderRipple; /** * Handles rendering of the focus ring. */ - protected renderFocusRing(): TemplateResult; + private renderFocusRing; /** * Classes applied to the list item root. */ - protected getRenderClasses(): ClassInfo; + protected getRenderClasses(): { + 'with-one-line': boolean; + 'with-two-line': boolean; + 'with-three-line': boolean; + disabled: boolean; + }; /** * The content rendered at the start of the list item. */ - protected renderStart(): TemplateResult; + private renderStart; /** * Handles rendering the headline and supporting text. */ - protected renderBody(): TemplateResult; + private renderBody; /** * Renders the one-line supporting text. */ - protected renderSupportingText(): TemplateResult; + private renderSupportingText; /** - * Renders the multi-line supporting text + * Gets the classes for the supporting text node */ - protected renderMultiLineSupportingText(): TemplateResult; + private getSupportingTextClasses; /** * The content rendered at the end of the list item. */ - protected renderEnd(): TemplateResult; + protected renderEnd(): import("lit-html").TemplateResult<1>; /** * Renders the supporting text at the end of the list item. */ - protected renderTrailingSupportingText(): TemplateResult; - protected onPointerdown(): void; - protected onFocus(): void; - protected onBlur(): void; - protected onClick(e: Event): void; - protected onKeydown(e: KeyboardEvent): void; - protected onPointerenter(e: Event): void; - protected onPointerleave(e: Event): void; - updated(changed: PropertyValues<this>): void; + private renderTrailingSupportingText; + protected onClick?(event: Event): void; + protected onKeydown?(event: KeyboardEvent): void; + protected onPointerenter?(event: Event): void; + protected onPointerleave?(event: Event): void; + protected updated(changed: PropertyValues<this>): void; + focus(): void; } export {};
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/listitem/list-item.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/listitem/list-item.js index 4a8c1a1..f18c39fea 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/listitem/list-item.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/listitem/list-item.js
@@ -3,36 +3,33 @@ * Copyright 2022 Google LLC * SPDX-License-Identifier: Apache-2.0 */ -import { __decorate, __metadata } from "tslib"; -// Required for @ariaProperty -// tslint:disable:no-new-decorators +var _a; +import { __decorate } from "tslib"; import '../../../ripple/ripple.js'; import '../../../focus/focus-ring.js'; import { html, LitElement, nothing } from 'lit'; import { property, query, queryAsync, state } from 'lit/decorators.js'; import { classMap } from 'lit/directives/class-map.js'; -import { ariaProperty } from '../../../decorators/aria-property.js'; -import { pointerPress, shouldShowStrongFocus } from '../../../focus/strong-focus.js'; +import { requestUpdateOnAriaChange } from '../../../aria/delegate.js'; import { ripple } from '../../../ripple/directive.js'; // tslint:disable-next-line:enforce-comments-on-exported-symbols export class ListItemEl extends LitElement { constructor() { super(...arguments); - // @ts-ignore(b/264292293): Use `override` with TS 4.9+ - this.role = 'listitem'; /** * The primary, headline text of the list item. */ this.headline = ''; /** - * The one-line supporting text below the headline. + * The one-line supporting text below the headline. Set + * `multiLineSupportingText` to `true` to support multiple lines in the + * supporting text. */ this.supportingText = ''; /** - * The multi-line supporting text below the headline. __NOTE:__ if set to a - * truthy value, overrides the visibility and behavior of `supportingText`. + * Modifies `supportingText` to support multiple lines. */ - this.multiLineSupportingText = ''; + this.multiLineSupportingText = false; /** * The supporting text placed at the end of the item. Overriden by elements * slotted into the `end` slot. @@ -50,23 +47,23 @@ */ this.itemTabIndex = -1; /** - * Whether or not the element is in the selected visual state. When active, - * tabindex is set to 0, and in some list item variants (like md-list-item), - * focuses the underlying item. + * Whether or not the element is actively being interacted with by md-list. + * When active, tabindex is set to 0, and in some list item variants (like + * md-list-item), focuses the underlying item. */ this.active = false; /** * READONLY. Sets the `md-list-item` attribute on the element. */ this.isListItem = true; - this.showFocusRing = false; + this.listItemRole = 'listitem'; this.showRipple = false; /** * Only meant to be overriden by subclassing and not by the user. This is * so that we have control over focus on specific variants such as disabling * focus on <md-autocomplete-item> but enabling it for <md-menu-item>. */ - this.focusOnSelection = true; + this.focusOnActivation = true; this.getRipple = () => { this.showRipple = true; return this.ripple; @@ -77,26 +74,21 @@ if (changed.has('active') && !this.disabled) { if (this.active) { this.itemTabIndex = 0; - if (this.focusOnSelection) { - this.showFocusRing = shouldShowStrongFocus(); - } - // Do not reset anything if it's the first render because user could - // have set `itemTabIndex` manually. } else if (!this.isFirstUpdate) { + // Do not reset anything if it's the first render because user could + // have set `itemTabIndex` manually. this.itemTabIndex = -1; } } } render() { return this.renderListItem(html ` - ${this.renderStart()} - ${this.renderBody()} - ${this.renderEnd()} - <div class="ripple"> + <div class="content-wrapper"> + ${this.renderStart()} + ${this.renderBody()} + ${this.renderEnd()} ${this.renderRipple()} - </div> - <div class="focus-ring"> ${this.renderFocusRing()} </div>`); } @@ -108,14 +100,12 @@ renderListItem(content) { return html ` <li + id="item" tabindex=${this.disabled ? -1 : this.itemTabIndex} - role=${this.role} + role=${this.listItemRole} aria-selected=${this.ariaSelected || nothing} aria-checked=${this.ariaChecked || nothing} class="list-item ${classMap(this.getRenderClasses())}" - @pointerdown=${this.onPointerdown} - @focus=${this.onFocus} - @blur=${this.onBlur} @click=${this.onClick} @pointerenter=${this.onPointerenter} @pointerleave=${this.onPointerleave} @@ -134,18 +124,17 @@ * Handles rendering of the focus ring. */ renderFocusRing() { - return html `<md-focus-ring .visible="${this.showFocusRing}"></md-focus-ring>`; + return html `<md-focus-ring class="focus-ring" for="item"></md-focus-ring>`; } /** * Classes applied to the list item root. */ getRenderClasses() { return { - 'with-one-line': this.supportingText === '' && this.multiLineSupportingText === '', - 'with-two-line': this.supportingText !== '' && this.multiLineSupportingText === '', - 'with-three-line': this.multiLineSupportingText !== '', - 'disabled': this.disabled, - 'enabled': !this.disabled, + 'with-one-line': this.supportingText === '', + 'with-two-line': this.supportingText !== '' && !this.multiLineSupportingText, + 'with-three-line': this.supportingText !== '' && this.multiLineSupportingText, + 'disabled': this.disabled }; } /** @@ -158,10 +147,7 @@ * Handles rendering the headline and supporting text. */ renderBody() { - const supportingText = this.multiLineSupportingText !== '' ? - this.renderMultiLineSupportingText() : - this.supportingText !== '' ? this.renderSupportingText() : - ''; + const supportingText = this.supportingText !== '' ? this.renderSupportingText() : ''; return html `<div class="body" ><span class="label-text">${this.headline}</span>${supportingText}</div>`; } @@ -169,14 +155,15 @@ * Renders the one-line supporting text. */ renderSupportingText() { - return html `<span class="supporting-text">${this.supportingText}</span>`; + return html `<span + class="supporting-text ${classMap(this.getSupportingTextClasses())}" + >${this.supportingText}</span>`; } /** - * Renders the multi-line supporting text + * Gets the classes for the supporting text node */ - renderMultiLineSupportingText() { - return html `<span class="supporting-text supporting-text--multi-line" - >${this.multiLineSupportingText}</span>`; + getSupportingTextClasses() { + return { 'supporting-text--multi-line': this.multiLineSupportingText }; } /** * The content rendered at the end of the list item. @@ -195,95 +182,55 @@ return html `<span class="trailing-supporting-text" >${this.trailingSupportingText}</span>`; } - onPointerdown() { - pointerPress(); - this.showFocusRing = shouldShowStrongFocus(); - } - onFocus() { - this.showFocusRing = shouldShowStrongFocus(); - } - onBlur() { - this.showFocusRing = false; - } - // For easier overriding in menu-item - onClick(e) { } - onKeydown(e) { } - onPointerenter(e) { } - onPointerleave(e) { } updated(changed) { super.updated(changed); // will focus the list item root if it is selected but not on the first // update or else it may cause the page to jump on first load. if (changed.has('active') && !this.isFirstUpdate && this.active && - this.focusOnSelection) { - this.listItemRoot.focus(); + this.focusOnActivation) { + this.focus(); } this.isFirstUpdate = false; } + focus() { + this.listItemRoot?.focus?.(); + } } +_a = ListItemEl; +(() => { + requestUpdateOnAriaChange(_a); +})(); __decorate([ - ariaProperty - // tslint:disable-next-line - , - property({ type: String, attribute: 'data-role', noAccessor: true }), - __metadata("design:type", String) -], ListItemEl.prototype, "role", void 0); -__decorate([ - ariaProperty, - property({ type: String, attribute: 'data-aria-selected', noAccessor: true }), - __metadata("design:type", String) -], ListItemEl.prototype, "ariaSelected", void 0); -__decorate([ - ariaProperty, - property({ type: String, attribute: 'data-aria-checked', noAccessor: true }), - __metadata("design:type", String) -], ListItemEl.prototype, "ariaChecked", void 0); -__decorate([ - property(), - __metadata("design:type", Object) + property() ], ListItemEl.prototype, "headline", void 0); __decorate([ - property(), - __metadata("design:type", Object) + property() ], ListItemEl.prototype, "supportingText", void 0); __decorate([ - property(), - __metadata("design:type", Object) + property({ type: Boolean }) ], ListItemEl.prototype, "multiLineSupportingText", void 0); __decorate([ - property(), - __metadata("design:type", Object) + property() ], ListItemEl.prototype, "trailingSupportingText", void 0); __decorate([ - property({ type: Boolean }), - __metadata("design:type", Object) + property({ type: Boolean }) ], ListItemEl.prototype, "disabled", void 0); __decorate([ - property({ type: Number }), - __metadata("design:type", Object) + property({ type: Number }) ], ListItemEl.prototype, "itemTabIndex", void 0); __decorate([ - property({ type: Boolean, reflect: true }), - __metadata("design:type", Object) + property({ type: Boolean, reflect: true }) ], ListItemEl.prototype, "active", void 0); __decorate([ - property({ type: Boolean, attribute: 'md-list-item', reflect: true }), - __metadata("design:type", Object) + property({ type: Boolean, attribute: 'md-list-item', reflect: true }) ], ListItemEl.prototype, "isListItem", void 0); __decorate([ - queryAsync('md-ripple'), - __metadata("design:type", Promise) + queryAsync('md-ripple') ], ListItemEl.prototype, "ripple", void 0); __decorate([ - query('.list-item'), - __metadata("design:type", HTMLElement) + query('.list-item') ], ListItemEl.prototype, "listItemRoot", void 0); __decorate([ - state(), - __metadata("design:type", Object) -], ListItemEl.prototype, "showFocusRing", void 0); -__decorate([ - state(), - __metadata("design:type", Object) + state() ], ListItemEl.prototype, "showRipple", void 0); //# sourceMappingURL=list-item.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/listitemlink/list-item-link.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/listitemlink/list-item-link.js index 2d2c59be..f90408b 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/listitemlink/list-item-link.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/listitemlink/list-item-link.js
@@ -3,7 +3,7 @@ * Copyright 2022 Google LLC * SPDX-License-Identifier: Apache-2.0 */ -import { __decorate, __metadata } from "tslib"; +import { __decorate } from "tslib"; import { html, nothing } from 'lit'; import { property } from 'lit/decorators.js'; import { classMap } from 'lit/directives/class-map.js'; @@ -14,16 +14,14 @@ renderListItem(content) { return html ` <a + id="item" tabindex=${this.disabled ? -1 : this.itemTabIndex} - role=${this.role} + role=${this.listItemRole} aria-selected=${this.ariaSelected || nothing} aria-checked=${this.ariaChecked || nothing} class="list-item ${classMap(this.getRenderClasses())}" href=${this.href} target=${this.target || nothing} - @pointerdown=${this.onPointerdown} - @focus=${this.onFocus} - @blur=${this.onBlur} @click=${this.onClick} @pointerenter=${this.onPointerenter} @pointerleave=${this.onPointerleave} @@ -32,11 +30,9 @@ } } __decorate([ - property(), - __metadata("design:type", String) + property() ], ListItemLink.prototype, "href", void 0); __decorate([ - property(), - __metadata("design:type", String) + property() ], ListItemLink.prototype, "target", void 0); //# sourceMappingURL=list-item-link.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/video/list-item-video-styles.css.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/video/list-item-video-styles.css.d.ts deleted file mode 100644 index 1c75ade..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/video/list-item-video-styles.css.d.ts +++ /dev/null
@@ -1 +0,0 @@ -export declare const styles: import("lit").CSSResult;
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/video/list-item-video-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/video/list-item-video-styles.css.js deleted file mode 100644 index c0623e5..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/video/list-item-video-styles.css.js +++ /dev/null
@@ -1,9 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { css } from 'lit'; -export const styles = css `:host{--_list-item-small-leading-video-height: var(--md-list-item-video-list-item-small-leading-video-height, 56px);--_list-item-large-leading-video-height: var(--md-list-item-video-list-item-large-leading-video-height, 69px);--_list-item-leading-video-width: var(--md-list-item-video-list-item-leading-video-width, 100px);--_list-item-leading-video-shape: var(--md-list-item-video-list-item-leading-video-shape, 0px);display:inline-flex}.md3-list-item__video{display:inline-flex;margin-block-end:12px;margin-block-start:12px;object-fit:cover;height:var(--_list-item-small-leading-video-height);width:var(--_list-item-leading-video-width);border-radius:var(--_list-item-leading-video-shape)}.md3-list-item__video.large{height:var(--_list-item-large-leading-video-height)}/*# sourceMappingURL=list-item-video-styles.css.map */ -`; -//# sourceMappingURL=list-item-video-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/video/list-item-video.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/video/list-item-video.d.ts deleted file mode 100644 index 5a3e76c..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/video/list-item-video.d.ts +++ /dev/null
@@ -1,53 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { LitElement, TemplateResult } from 'lit'; -/** - * @fires loadeddata {Event} Dispatched whenever the native HTMLVideoElement - * fires the loadeddate event. - */ -export declare class ListItemVideo extends LitElement { - /** - * Displays the video in a taller format - */ - large: boolean; - /** - * The underlying `<video>`'s `autoplay` property. - */ - autoplay: boolean; - /** - * The underlying `<video>`'s `muted` property. - */ - muted: boolean; - /** - * The underlying `<video>`'s `loop` property. - */ - loop: boolean; - /** - * The underlying `<video>`'s `controls` property. - */ - controls: boolean; - /** - * The underlying `<video>`'s `playsinline` property. - */ - playsinline: boolean; - /** - * The underlying `<video>`'s `preload` property. - */ - preload: '' | 'auto' | 'metadata' | 'none'; - /** - * The underlying `<video>`'s `poster` property. - */ - poster: string; - /** - * The `src` of the video. - */ - video: string; - /** - * The `alt` attribute if the video. - */ - altText: string; - render(): TemplateResult; -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/video/list-item-video.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/video/list-item-video.js deleted file mode 100644 index d6f0c93..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/lib/video/list-item-video.js +++ /dev/null
@@ -1,115 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { __decorate, __metadata } from "tslib"; -import { html, LitElement, nothing } from 'lit'; -import { property } from 'lit/decorators.js'; -/** - * @fires loadeddata {Event} Dispatched whenever the native HTMLVideoElement - * fires the loadeddate event. - */ -export class ListItemVideo extends LitElement { - constructor() { - super(...arguments); - /** - * Displays the video in a taller format - */ - this.large = false; - /** - * The underlying `<video>`'s `autoplay` property. - */ - this.autoplay = false; - /** - * The underlying `<video>`'s `muted` property. - */ - this.muted = false; - /** - * The underlying `<video>`'s `loop` property. - */ - this.loop = false; - /** - * The underlying `<video>`'s `controls` property. - */ - this.controls = false; - /** - * The underlying `<video>`'s `playsinline` property. - */ - this.playsinline = false; - /** - * The underlying `<video>`'s `preload` property. - */ - this.preload = ''; - /** - * The underlying `<video>`'s `poster` property. - */ - this.poster = ''; - /** - * The `src` of the video. - */ - this.video = ''; - /** - * The `alt` attribute if the video. - */ - this.altText = ''; - } - render() { - return html ` - <video - @loadeddata=${() => this.dispatchEvent(new Event('loadeddata'))} - .src="${this.video || nothing}" - .poster="${this.poster || nothing}" - alt="${this.altText || nothing}" - .autoplay=${this.autoplay} - .muted=${this.muted} - .loop=${this.loop} - .playsinline=${this.playsinline} - .controls=${this.controls} - class="md3-list-item__video ${this.large ? 'large' : ''}"> - <slot></slot> - </video> - `; - } -} -__decorate([ - property({ type: Boolean }), - __metadata("design:type", Object) -], ListItemVideo.prototype, "large", void 0); -__decorate([ - property({ type: Boolean }), - __metadata("design:type", Object) -], ListItemVideo.prototype, "autoplay", void 0); -__decorate([ - property({ type: Boolean }), - __metadata("design:type", Object) -], ListItemVideo.prototype, "muted", void 0); -__decorate([ - property({ type: Boolean }), - __metadata("design:type", Object) -], ListItemVideo.prototype, "loop", void 0); -__decorate([ - property({ type: Boolean }), - __metadata("design:type", Object) -], ListItemVideo.prototype, "controls", void 0); -__decorate([ - property({ type: Boolean }), - __metadata("design:type", Object) -], ListItemVideo.prototype, "playsinline", void 0); -__decorate([ - property({ type: String }), - __metadata("design:type", String) -], ListItemVideo.prototype, "preload", void 0); -__decorate([ - property({ type: String }), - __metadata("design:type", Object) -], ListItemVideo.prototype, "poster", void 0); -__decorate([ - property({ type: String }), - __metadata("design:type", Object) -], ListItemVideo.prototype, "video", void 0); -__decorate([ - property({ type: String }), - __metadata("design:type", Object) -], ListItemVideo.prototype, "altText", void 0); -//# sourceMappingURL=list-item-video.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/list-item-avatar.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/list/list-item-avatar.d.ts deleted file mode 100644 index 26d5fa9..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/list-item-avatar.d.ts +++ /dev/null
@@ -1,20 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { ListItemAvatar } from './lib/avatar/list-item-avatar.js'; -declare global { - interface HTMLElementTagNameMap { - 'md-list-item-avatar': MdListItemAvatar; - } -} -/** - * @summary An image avatar that is expected to be slotted into a list item. - * - * @final - * @suppress {visibility} - */ -export declare class MdListItemAvatar extends ListItemAvatar { - static styles: import("lit").CSSResult[]; -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/list-item-avatar.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/list/list-item-avatar.js deleted file mode 100644 index f3b2baca..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/list-item-avatar.js +++ /dev/null
@@ -1,23 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { __decorate } from "tslib"; -import { customElement } from 'lit/decorators.js'; -import { ListItemAvatar } from './lib/avatar/list-item-avatar.js'; -import { styles } from './lib/avatar/list-item-avatar-styles.css.js'; -/** - * @summary An image avatar that is expected to be slotted into a list item. - * - * @final - * @suppress {visibility} - */ -let MdListItemAvatar = class MdListItemAvatar extends ListItemAvatar { -}; -MdListItemAvatar.styles = [styles]; -MdListItemAvatar = __decorate([ - customElement('md-list-item-avatar') -], MdListItemAvatar); -export { MdListItemAvatar }; -//# sourceMappingURL=list-item-avatar.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/list-item-icon.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/list/list-item-icon.d.ts deleted file mode 100644 index cb80933b..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/list-item-icon.d.ts +++ /dev/null
@@ -1,20 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { ListItemIcon } from './lib/icon/list-item-icon.js'; -declare global { - interface HTMLElementTagNameMap { - 'md-list-item-icon': MdListItemIcon; - } -} -/** - * @summary A material icon that is expected to be slotted into a list item. - * - * @final - * @suppress {visibility} - */ -export declare class MdListItemIcon extends ListItemIcon { - static styles: import("lit").CSSResult[]; -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/list-item-icon.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/list/list-item-icon.js deleted file mode 100644 index 2ee5975c..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/list-item-icon.js +++ /dev/null
@@ -1,23 +0,0 @@ -/** - * @license - * Copyright 2021 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { __decorate } from "tslib"; -import { customElement } from 'lit/decorators.js'; -import { ListItemIcon } from './lib/icon/list-item-icon.js'; -import { styles } from './lib/icon/list-item-icon-styles.css.js'; -/** - * @summary A material icon that is expected to be slotted into a list item. - * - * @final - * @suppress {visibility} - */ -let MdListItemIcon = class MdListItemIcon extends ListItemIcon { -}; -MdListItemIcon.styles = [styles]; -MdListItemIcon = __decorate([ - customElement('md-list-item-icon') -], MdListItemIcon); -export { MdListItemIcon }; -//# sourceMappingURL=list-item-icon.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/list-item-image.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/list/list-item-image.d.ts deleted file mode 100644 index 9de738d..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/list-item-image.d.ts +++ /dev/null
@@ -1,20 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { ListItemImage } from './lib/image/list-item-image.js'; -declare global { - interface HTMLElementTagNameMap { - 'md-list-item-image': MdListItemImage; - } -} -/** - * @summary An image that is expected to be slotted into a list item. - * - * @final - * @suppress {visibility} - */ -export declare class MdListItemImage extends ListItemImage { - static styles: import("lit").CSSResult[]; -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/list-item-image.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/list/list-item-image.js deleted file mode 100644 index 1f1ec19..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/list-item-image.js +++ /dev/null
@@ -1,23 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { __decorate } from "tslib"; -import { customElement } from 'lit/decorators.js'; -import { ListItemImage } from './lib/image/list-item-image.js'; -import { styles } from './lib/image/list-item-image-styles.css.js'; -/** - * @summary An image that is expected to be slotted into a list item. - * - * @final - * @suppress {visibility} - */ -let MdListItemImage = class MdListItemImage extends ListItemImage { -}; -MdListItemImage.styles = [styles]; -MdListItemImage = __decorate([ - customElement('md-list-item-image') -], MdListItemImage); -export { MdListItemImage }; -//# sourceMappingURL=list-item-image.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/list-item-link.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/list/list-item-link.d.ts index e41c8fae..9df6a89 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/list-item-link.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/list/list-item-link.d.ts
@@ -27,6 +27,24 @@ * item in a collection and act on it. * - Lists should present icons, text, and actions in a consistent format. * + * Example slottable child variants are: + * + * - `video[data-variant=video]` + * - `img,span[data-variant=avatar]` + * - `img[data-variant=image]` + * - `md-icon[data-variant=icon]` + * + * @example + * ```html + * <md-list-item-link + * headline="User Name" + * supportingText="user@name.com" + * href="/accounts"> + * <md-icon data-variant="icon" slot="start">account_circle</md-icon> + * <md-icon data-variant="icon" slot="end">open_in_new</md-icon> + * </md-list-item-link> + * ``` + * * @final * @suppress {visibility} */
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/list-item-link.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/list/list-item-link.js index db03224..22437911 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/list-item-link.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/list/list-item-link.js
@@ -5,7 +5,7 @@ */ import { __decorate } from "tslib"; import { customElement } from 'lit/decorators.js'; -import { styles as privateProps } from './lib/listitem/list-item-private-styles.css.js'; +import { styles as forcedColors } from './lib/listitem/forced-colors-styles.css.js'; import { styles } from './lib/listitem/list-item-styles.css.js'; import { ListItemLink } from './lib/listitemlink/list-item-link.js'; /** @@ -26,12 +26,30 @@ * item in a collection and act on it. * - Lists should present icons, text, and actions in a consistent format. * + * Example slottable child variants are: + * + * - `video[data-variant=video]` + * - `img,span[data-variant=avatar]` + * - `img[data-variant=image]` + * - `md-icon[data-variant=icon]` + * + * @example + * ```html + * <md-list-item-link + * headline="User Name" + * supportingText="user@name.com" + * href="/accounts"> + * <md-icon data-variant="icon" slot="start">account_circle</md-icon> + * <md-icon data-variant="icon" slot="end">open_in_new</md-icon> + * </md-list-item-link> + * ``` + * * @final * @suppress {visibility} */ let MdListItemLink = class MdListItemLink extends ListItemLink { }; -MdListItemLink.styles = [privateProps, styles]; +MdListItemLink.styles = [styles, forcedColors]; MdListItemLink = __decorate([ customElement('md-list-item-link') ], MdListItemLink);
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/list-item-video.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/list/list-item-video.d.ts deleted file mode 100644 index ee99b62..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/list-item-video.d.ts +++ /dev/null
@@ -1,20 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { ListItemVideo } from './lib/video/list-item-video.js'; -declare global { - interface HTMLElementTagNameMap { - 'md-list-item-video': MdListItemVideo; - } -} -/** - * @summary A video that is expected to be slotted into a list item. - * - * @final - * @suppress {visibility} - */ -export declare class MdListItemVideo extends ListItemVideo { - static styles: import("lit").CSSResult[]; -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/list-item-video.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/list/list-item-video.js deleted file mode 100644 index a7fb5b9..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/list-item-video.js +++ /dev/null
@@ -1,23 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { __decorate } from "tslib"; -import { customElement } from 'lit/decorators.js'; -import { ListItemVideo } from './lib/video/list-item-video.js'; -import { styles } from './lib/video/list-item-video-styles.css.js'; -/** - * @summary A video that is expected to be slotted into a list item. - * - * @final - * @suppress {visibility} - */ -let MdListItemVideo = class MdListItemVideo extends ListItemVideo { -}; -MdListItemVideo.styles = [styles]; -MdListItemVideo = __decorate([ - customElement('md-list-item-video') -], MdListItemVideo); -export { MdListItemVideo }; -//# sourceMappingURL=list-item-video.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/list-item.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/list/list-item.d.ts index 37f228a..47b88d6e 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/list-item.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/list/list-item.d.ts
@@ -27,6 +27,25 @@ * item in a collection and act on it. * - Lists should present icons, text, and actions in a consistent format. * + * Acceptable slottable child variants are: + * + * - `video[data-variant=video]` + * - `img,span[data-variant=avatar]` + * - `img[data-variant=image]` + * - `md-icon[data-variant=icon]` + * + * @example + * ```html + * <md-list-item + * headline="User Name" + * supportingText="user@name.com"> + * <md-icon data-variant="icon" slot="start">account_circle</md-icon> + * <md-icon data-variant="icon" slot="end">check</md-icon> + * </md-list-item> + * ``` + * + * @example + * * @final * @suppress {visibility} */
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/list-item.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/list/list-item.js index ab3922c..cb8853c 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/list/list-item.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/list/list-item.js
@@ -5,8 +5,8 @@ */ import { __decorate } from "tslib"; import { customElement } from 'lit/decorators.js'; +import { styles as forcedColors } from './lib/listitem/forced-colors-styles.css.js'; import { ListItemEl as ListItem } from './lib/listitem/list-item.js'; -import { styles as privateProps } from './lib/listitem/list-item-private-styles.css.js'; import { styles } from './lib/listitem/list-item-styles.css.js'; /** * @summary @@ -26,12 +26,31 @@ * item in a collection and act on it. * - Lists should present icons, text, and actions in a consistent format. * + * Acceptable slottable child variants are: + * + * - `video[data-variant=video]` + * - `img,span[data-variant=avatar]` + * - `img[data-variant=image]` + * - `md-icon[data-variant=icon]` + * + * @example + * ```html + * <md-list-item + * headline="User Name" + * supportingText="user@name.com"> + * <md-icon data-variant="icon" slot="start">account_circle</md-icon> + * <md-icon data-variant="icon" slot="end">check</md-icon> + * </md-list-item> + * ``` + * + * @example + * * @final * @suppress {visibility} */ let MdListItem = class MdListItem extends ListItem { }; -MdListItem.styles = [privateProps, styles]; +MdListItem.styles = [styles, forcedColors]; MdListItem = __decorate([ customElement('md-list-item') ], MdListItem);
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/harness.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/harness.d.ts index c545539f..dfc8e755 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/harness.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/harness.d.ts
@@ -6,6 +6,7 @@ import { Harness } from '../testing/harness.js'; import { Menu } from './lib/menu.js'; import { MenuItemHarness } from './lib/menuitem/harness.js'; +export { MenuItemHarness } from './lib/menuitem/harness.js'; /** * Test harness for menu. */
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/fab-extended-styles.css.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/forced-colors-styles.css.d.ts similarity index 100% copy from third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/fab-extended-styles.css.d.ts copy to third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/forced-colors-styles.css.d.ts
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/forced-colors-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/forced-colors-styles.css.js new file mode 100644 index 0000000..2fcc903 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/forced-colors-styles.css.js
@@ -0,0 +1,9 @@ +/** + * @license + * Copyright 2022 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import { css } from 'lit'; +export const styles = css `@media(forced-colors: active){.menu{border-style:solid;border-color:CanvasText;border-width:1px}}/*# sourceMappingURL=forced-colors-styles.css.map */ +`; +//# sourceMappingURL=forced-colors-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/menu-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/menu-styles.css.js index 012dd7d..d64286a 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/menu-styles.css.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/menu-styles.css.js
@@ -4,6 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ import { css } from 'lit'; -export const styles = css `:host{--_cascading-menu-indicator-icon-color: var(--md-menu-cascading-menu-indicator-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_cascading-menu-indicator-icon-size: var(--md-menu-cascading-menu-indicator-icon-size, 24px);--_container-color: var(--md-menu-container-color, var(--md-sys-color-surface, #fffbfe));--_container-elevation: var(--md-menu-container-elevation, 3);--_container-shadow-color: var(--md-menu-container-shadow-color, var(--md-sys-color-shadow, #000));--_container-shape: var(--md-menu-container-shape, 4px);--_container-surface-tint-layer-color: var(--md-menu-container-surface-tint-layer-color, var(--md-sys-color-primary, #6750a4));--_list-item-container-height: var(--md-menu-list-item-container-height, 48px);--_list-item-disabled-label-text-color: var(--md-menu-list-item-disabled-label-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_list-item-disabled-label-text-opacity: var(--md-menu-list-item-disabled-label-text-opacity, 0.38);--_list-item-focus-label-text-color: var(--md-menu-list-item-focus-label-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_list-item-focus-state-layer-color: var(--md-menu-list-item-focus-state-layer-color, var(--md-sys-color-on-surface, #1c1b1f));--_list-item-focus-state-layer-opacity: var(--md-menu-list-item-focus-state-layer-opacity, 0.12);--_list-item-hover-label-text-color: var(--md-menu-list-item-hover-label-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_list-item-hover-state-layer-color: var(--md-menu-list-item-hover-state-layer-color, var(--md-sys-color-on-surface, #1c1b1f));--_list-item-hover-state-layer-opacity: var(--md-menu-list-item-hover-state-layer-opacity, 0.08);--_list-item-label-text-color: var(--md-menu-list-item-label-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_list-item-label-text-font: var(--md-menu-list-item-label-text-font, Roboto);--_list-item-label-text-line-height: var(--md-menu-list-item-label-text-line-height, 1.25rem);--_list-item-label-text-size: var(--md-menu-list-item-label-text-size, 0.875rem);--_list-item-label-text-tracking: var(--md-menu-list-item-label-text-tracking, 0.006rem);--_list-item-label-text-type: var(--md-menu-list-item-label-text-type, 500 0.875rem / 1.25rem Roboto);--_list-item-label-text-weight: var(--md-menu-list-item-label-text-weight, 500);--_list-item-pressed-label-text-color: var(--md-menu-list-item-pressed-label-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_list-item-pressed-state-layer-color: var(--md-menu-list-item-pressed-state-layer-color, var(--md-sys-color-on-surface, #1c1b1f));--_list-item-pressed-state-layer-opacity: var(--md-menu-list-item-pressed-state-layer-opacity, 0.12);--_list-item-selected-container-color: var(--md-menu-list-item-selected-container-color, var(--md-sys-color-surface-variant, #e7e0ec));--_list-item-with-leading-icon-disabled-leading-icon-color: var(--md-menu-list-item-with-leading-icon-disabled-leading-icon-color, var(--md-sys-color-on-surface, #1c1b1f));--_list-item-with-leading-icon-disabled-leading-icon-opacity: var(--md-menu-list-item-with-leading-icon-disabled-leading-icon-opacity, 0.38);--_list-item-with-leading-icon-focus-icon-color: var(--md-menu-list-item-with-leading-icon-focus-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_list-item-with-leading-icon-hover-icon-color: var(--md-menu-list-item-with-leading-icon-hover-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_list-item-with-leading-icon-leading-icon-color: var(--md-menu-list-item-with-leading-icon-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_list-item-with-leading-icon-leading-icon-size: var(--md-menu-list-item-with-leading-icon-leading-icon-size, 24px);--_list-item-with-leading-icon-pressed-icon-color: var(--md-menu-list-item-with-leading-icon-pressed-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_list-item-with-trailing-icon-disabled-trailing-icon-color: var(--md-menu-list-item-with-trailing-icon-disabled-trailing-icon-color, var(--md-sys-color-on-surface, #1c1b1f));--_list-item-with-trailing-icon-disabled-trailing-icon-opacity: var(--md-menu-list-item-with-trailing-icon-disabled-trailing-icon-opacity, 0.38);--_list-item-with-trailing-icon-focus-icon-color: var(--md-menu-list-item-with-trailing-icon-focus-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_list-item-with-trailing-icon-hover-icon-color: var(--md-menu-list-item-with-trailing-icon-hover-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_list-item-with-trailing-icon-pressed-icon-color: var(--md-menu-list-item-with-trailing-icon-pressed-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_list-item-with-trailing-icon-trailing-icon-color: var(--md-menu-list-item-with-trailing-icon-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_list-item-with-trailing-icon-trailing-icon-size: var(--md-menu-list-item-with-trailing-icon-trailing-icon-size, 24px);--md-elevation-level:var(--_container-elevation);--md-elevation-shadow-color:var(--_container-shadow-color);--md-elevation-surface-tint:var(--_container-surface-tint-layer-color);--md-focus-ring-shape-start-start:var(--_container-shape);--md-focus-ring-shape-start-end:var(--_container-shape);--md-focus-ring-shape-end-end:var(--_container-shape);--md-focus-ring-shape-end-start:var(--_container-shape)}.menu{border-radius:var(--_container-shape);display:none;opacity:0;z-index:20;position:absolute;user-select:none;max-height:inherit;height:inherit}.menu.fixed{position:fixed}.menu md-list{height:inherit;max-height:inherit;display:block;overflow:auto}.menu.has-overflow md-list{overflow:visible}.menu.animating md-list{pointer-events:none;overflow:hidden}.menu.animating ::slotted(.hidden){opacity:0}.menu slot{display:block;height:inherit;max-height:inherit}md-elevation{position:absolute;inset:0;pointer-events:none}/*# sourceMappingURL=menu-styles.css.map */ +export const styles = css `:host{--_container-color: var(--md-menu-container-color, var(--md-sys-color-surface-container, #f3edf7));--_container-elevation: var(--md-menu-container-elevation, 2);--_container-shadow-color: var(--md-menu-container-shadow-color, var(--md-sys-color-shadow, #000));--_container-shape: var(--md-menu-container-shape, 4px);--md-list-container-color: var(--_container-color);--md-elevation-level:var(--_container-elevation);--md-elevation-shadow-color:var(--_container-shadow-color);--md-focus-ring-shape: var(--_container-shape);min-width:300px}.menu{border-radius:var(--_container-shape);display:none;opacity:0;z-index:20;position:absolute;user-select:none;max-height:inherit;height:inherit;min-width:inherit}.menu.fixed{position:fixed}.menu md-list{height:inherit;max-height:inherit;display:block;overflow:auto;min-width:inherit;border-radius:inherit}.menu.has-overflow md-list{overflow:visible}.menu.animating md-list{pointer-events:none;overflow:hidden}.menu.animating ::slotted(.hidden){opacity:0}.menu slot{display:block;height:inherit;max-height:inherit}/*# sourceMappingURL=menu-styles.css.map */ `; //# sourceMappingURL=menu-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/menu.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/menu.d.ts index 7be32b7..6798326 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/menu.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/menu.d.ts
@@ -7,32 +7,33 @@ import '../../focus/focus-ring.js'; import '../../elevation/elevation.js'; import { LitElement } from 'lit'; -import { MdFocusRing } from '../../focus/focus-ring.js'; -import { List } from '../../list/lib/list.js'; +import { ARIARole } from '../../types/aria.js'; import { MenuItem } from './shared.js'; -import { Corner, SurfacePositionController } from './surfacePositionController.js'; +import { Corner, SurfacePositionTarget } from './surfacePositionController.js'; import { TypeaheadController } from './typeaheadController.js'; export { Corner } from './surfacePositionController.js'; /** + * The default value for the typeahead buffer time in Milliseconds. + */ +export declare const DEFAULT_TYPEAHEAD_BUFFER_TIME = 200; +/** * Element to focus on when menu is first opened. */ -export declare type DefaultFocusState = 'NONE' | 'LIST_ROOT' | 'FIRST_ITEM' | 'LAST_ITEM'; +export type DefaultFocusState = 'NONE' | 'LIST_ROOT' | 'FIRST_ITEM' | 'LAST_ITEM'; /** - * @fires opening Fired before the opening animation begins (not fired on quick) + * @fires opening Fired before the opening animation begins * @fires opened Fired once the menu is open, after any animations - * @fires closing Fired before the closing animation begins (not fired on quick) + * @fires closing Fired before the closing animation begins * @fires closed Fired once the menu is closed, after any animations */ export declare abstract class Menu extends LitElement { - protected readonly listElement: List | null; - protected readonly surfaceEl: HTMLElement | null; - protected readonly slotEl: HTMLSlotElement | null; - protected readonly focusRing: MdFocusRing; - ariaLabel: string; + private readonly listElement; + private readonly surfaceEl; + private readonly slotEl; /** * The element in which the menu should align to. */ - anchor: HTMLElement | null; + anchor: HTMLElement & Partial<SurfacePositionTarget> | null; /** * Makes the element use `position:fixed` instead of `position:absolute`. In * most cases, the menu should position itself above most other @@ -81,6 +82,10 @@ */ listTabIndex: number; /** + * The role of the underlying list element. + */ + type: ARIARole; + /** * The max time between the keystrokes of the typeahead menu behavior before * it clears the typeahead buffer. */ @@ -96,10 +101,20 @@ */ menuCorner: Corner; /** - * Keeps the user clicks outside the menu + * Keeps the user clicks outside the menu. + * + * NOTE: clicking outside may still cause focusout to close the menu so see + * `stayOpenOnFocusout`. */ stayOpenOnOutsideClick: boolean; /** + * Keeps the menu open when focus leaves the menu's composed subtree. + * + * NOTE: Focusout behavior will stop propagation of the focusout event. Set + * this property to true to opt-out of menu's focuout handling altogether. + */ + stayOpenOnFocusout: boolean; + /** * After closing, does not restore focus to the last focused element before * the menu was opened. */ @@ -108,88 +123,88 @@ * The element that should be focused by default once opened. */ defaultFocus: DefaultFocusState; - protected openCloseAnimationSignal: import("../../motion/animation.js").AnimationSignal; + private typeaheadActive; + private readonly openCloseAnimationSignal; /** * Whether the menu is animating upwards or downwards when opening. This is * helpful for calculating some animation calculations. */ - protected get openDirection(): 'UP' | 'DOWN'; + private get openDirection(); /** * The element that was focused before the menu opened. */ - protected lastFocusedElement: HTMLElement | null; + private lastFocusedElement; /** * Handles typeahead navigation through the menu. */ - protected typeaheadController: TypeaheadController; + typeaheadController: TypeaheadController; /** * Handles positioning the surface and aligning it to the anchor. */ - protected menuPositionController: SurfacePositionController; + private readonly menuPositionController; /** * The menu items associated with this menu. The items must be `MenuItem`s and * have both the `md-menu-item` and `md-list-item` attributes. */ get items(): MenuItem[]; - render(): import("lit-html").TemplateResult<1>; + protected render(): import("lit-html").TemplateResult<1>; /** * Renders the positionable surface element and its contents. */ - protected renderSurface(): import("lit-html").TemplateResult<1>; + private renderSurface; /** * Renders the List element and its items */ - protected renderList(): import("lit-html").TemplateResult<1>; + private renderList; /** * Renders the menu items' slot */ - protected renderMenuItems(): import("lit-html").TemplateResult<1>; + private renderMenuItems; /** * Renders the elevation component. */ - protected renderElevation(): import("lit-html").TemplateResult<1>; + private renderElevation; /** * Renders the focus ring component. */ - protected renderFocusRing(): import("lit-html").TemplateResult<1>; - protected getSurfaceClasses(): { - open: boolean; - fixed: boolean; - 'has-overflow': boolean; - }; - protected onListFocus(): void; - protected onListClick(): void; - protected onListBlur(): void; + private renderFocusRing; + private getSurfaceClasses; + private handleFocusout; + private handleListKeydown; /** * Saves the last focused element focuses the new element based on * `defaultFocus`, and animates open. */ - protected onOpened: () => void; + private readonly onOpened; /** * Animates closed. */ - protected beforeClose: () => Promise<void>; + private readonly beforeClose; /** * Focuses the last focused element. */ - protected onClosed: () => void; + private readonly onClosed; /** * Performs the opening animation: * * https://direct.googleplex.com/#/spec/295000003+271060003 */ - protected animateOpen(): void; + private animateOpen; /** * Performs the closing animation: * * https://direct.googleplex.com/#/spec/295000003+271060003 */ - protected animateClose(): Promise<unknown>; + private animateClose; connectedCallback(): void; disconnectedCallback(): void; - protected onWindowClick: (e: MouseEvent) => void; - protected onCloseMenu(e: Event): void; - protected onDeactivateItems(e: Event): void; + private readonly onWindowClick; + private onCloseMenu; + private onDeactivateItems; + private handleDeactivateTypeahead; + private handleActivateTypeahead; + private handleStayOpenOnFocusout; + private handleCloseOnFocusout; focus(): void; close(): void; show(): void;
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/menu.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/menu.js index 998651c..7331658 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/menu.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/menu.js
@@ -3,24 +3,26 @@ * Copyright 2022 Google LLC * SPDX-License-Identifier: Apache-2.0 */ -import { __decorate, __metadata } from "tslib"; -// Required for @ariaProperty -// tslint:disable:no-new-decorators +var _a; +import { __decorate } from "tslib"; import '../../list/list.js'; import '../../focus/focus-ring.js'; import '../../elevation/elevation.js'; -import { html, LitElement } from 'lit'; -import { property, query } from 'lit/decorators.js'; +import { html, isServer, LitElement, nothing } from 'lit'; +import { eventOptions, property, query, state } from 'lit/decorators.js'; import { classMap } from 'lit/directives/class-map.js'; import { styleMap } from 'lit/directives/style-map.js'; -import { ariaProperty } from '../../decorators/aria-property.js'; -import { MdFocusRing } from '../../focus/focus-ring.js'; -import { pointerPress, shouldShowStrongFocus } from '../../focus/strong-focus.js'; +import { requestUpdateOnAriaChange } from '../../aria/delegate.js'; import { List } from '../../list/lib/list.js'; import { createAnimationSignal, EASING } from '../../motion/animation.js'; +import { isElementInSubtree } from './shared.js'; import { SurfacePositionController } from './surfacePositionController.js'; import { TypeaheadController } from './typeaheadController.js'; /** + * The default value for the typeahead buffer time in Milliseconds. + */ +export const DEFAULT_TYPEAHEAD_BUFFER_TIME = 200; +/** * Gets the currently focused element on the page. * * @param activeDoc The document or shadowroot from which to start the search. @@ -38,9 +40,9 @@ return activeEl; } /** - * @fires opening Fired before the opening animation begins (not fired on quick) + * @fires opening Fired before the opening animation begins * @fires opened Fired once the menu is open, after any animations - * @fires closing Fired before the closing animation begins (not fired on quick) + * @fires closing Fired before the closing animation begins * @fires closed Fired once the menu is closed, after any animations */ export class Menu extends LitElement { @@ -98,10 +100,14 @@ */ this.listTabIndex = 0; /** + * The role of the underlying list element. + */ + this.type = 'menu'; + /** * The max time between the keystrokes of the typeahead menu behavior before * it clears the typeahead buffer. */ - this.typeaheadBufferTime = 200; + this.typeaheadBufferTime = DEFAULT_TYPEAHEAD_BUFFER_TIME; /** * The corner of the anchor which to align the menu in the standard logical * property style of <block>_<inline>. @@ -113,10 +119,20 @@ */ this.menuCorner = 'START_START'; /** - * Keeps the user clicks outside the menu + * Keeps the user clicks outside the menu. + * + * NOTE: clicking outside may still cause focusout to close the menu so see + * `stayOpenOnFocusout`. */ this.stayOpenOnOutsideClick = false; /** + * Keeps the menu open when focus leaves the menu's composed subtree. + * + * NOTE: Focusout behavior will stop propagation of the focusout event. Set + * this property to true to opt-out of menu's focuout handling altogether. + */ + this.stayOpenOnFocusout = false; + /** * After closing, does not restore focus to the last focused element before * the menu was opened. */ @@ -125,6 +141,7 @@ * The element that should be focused by default once opened. */ this.defaultFocus = 'LIST_ROOT'; + this.typeaheadActive = true; this.openCloseAnimationSignal = createAnimationSignal(); /** * The element that was focused before the menu opened. @@ -137,6 +154,7 @@ return { getItems: () => this.items, typeaheadBufferTime: this.typeaheadBufferTime, + active: this.typeaheadActive }; }); /** @@ -192,6 +210,7 @@ break; } if (this.quick) { + this.dispatchEvent(new Event('opening')); this.dispatchEvent(new Event('opened')); } else { @@ -203,6 +222,9 @@ */ this.beforeClose = async () => { this.open = false; + if (!this.skipRestoreFocus) { + this.lastFocusedElement?.focus?.(); + } if (!this.quick) { await this.animateClose(); } @@ -212,11 +234,9 @@ */ this.onClosed = () => { if (this.quick) { + this.dispatchEvent(new Event('closing')); this.dispatchEvent(new Event('closed')); } - if (!this.skipRestoreFocus) { - this.lastFocusedElement?.focus?.(); - } }; this.onWindowClick = (e) => { if (!this.stayOpenOnOutsideClick && !e.composedPath().includes(this)) { @@ -250,12 +270,15 @@ * Renders the positionable surface element and its contents. */ renderSurface() { + // TODO(b/274140618): elevation should be an underlay, not an overlay that + // tints content return html ` <div - class="menu ${classMap(this.getSurfaceClasses())}" - style=${styleMap(this.menuPositionController.surfaceStyles)}> - ${this.renderList()} + class="menu ${classMap(this.getSurfaceClasses())}" + style=${styleMap(this.menuPositionController.surfaceStyles)} + @focusout=${this.handleFocusout}> ${this.renderElevation()} + ${this.renderList()} ${this.renderFocusRing()} </div> `; @@ -264,17 +287,17 @@ * Renders the List element and its items */ renderList() { + // Needed for closure conformance + const { ariaLabel } = this; return html ` - <md-list - .ariaLabel=${this.ariaLabel} - role="menu" - listTabIndex=${this.listTabIndex} - @focus=${this.onListFocus} - @blur=${this.onListBlur} - @click=${this.onListClick} - @keydown=${this.typeaheadController.onKeydown}> - ${this.renderMenuItems()} - </md-list>`; + <md-list + id="list" + aria-label=${ariaLabel || nothing} + type=${this.type} + listTabIndex=${this.listTabIndex} + @keydown=${this.handleListKeydown}> + ${this.renderMenuItems()} + </md-list>`; } /** * Renders the menu items' slot @@ -282,19 +305,23 @@ renderMenuItems() { return html `<slot @close-menu=${this.onCloseMenu} - @deactivate-items=${this.onDeactivateItems}></slot>`; + @deactivate-items=${this.onDeactivateItems} + @deactivate-typeahead=${this.handleDeactivateTypeahead} + @activate-typeahead=${this.handleActivateTypeahead} + @stay-open-on-focusout=${this.handleStayOpenOnFocusout} + @close-on-focusout=${this.handleCloseOnFocusout}></slot>`; } /** * Renders the elevation component. */ renderElevation() { - return html `<md-elevation shadow surface></md-elevation>`; + return html `<md-elevation></md-elevation>`; } /** * Renders the focus ring component. */ renderFocusRing() { - return html `<md-focus-ring></md-focus-ring>`; + return html `<md-focus-ring for="list"></md-focus-ring>`; } getSurfaceClasses() { return { @@ -303,15 +330,33 @@ 'has-overflow': this.hasOverflow, }; } - onListFocus() { - this.focusRing.visible = shouldShowStrongFocus(); + async handleFocusout(e) { + if (this.stayOpenOnFocusout) { + return; + } + // Stop propagation to prevent nested menus from interfering with each other + e.stopPropagation(); + if (e.relatedTarget) { + // Don't close the menu if we are switching focus between menu, + // md-menu-item, and md-list + if (isElementInSubtree(e.relatedTarget, this)) { + return; + } + } + const oldRestoreFocus = this.skipRestoreFocus; + // allow focus to continue to the next focused object rather than returning + this.skipRestoreFocus = true; + this.close(); + // await for close + await this.updateComplete; + // return to previous behavior + this.skipRestoreFocus = oldRestoreFocus; } - onListClick() { - pointerPress(); - this.focusRing.visible = shouldShowStrongFocus(); - } - onListBlur() { - this.focusRing.visible = false; + // Capture so that we can grab the event before it reaches the list item + // istelf. Specifically useful for the case where typeahead encounters a space + // and we don't want the menu item to close the menu. + handleListKeydown(e) { + this.typeaheadController.onKeydown(e); } /** * Performs the opening animation: @@ -481,17 +526,17 @@ } connectedCallback() { super.connectedCallback(); - if (window && window.addEventListener) { + if (!isServer) { window.addEventListener('click', this.onWindowClick, { capture: true }); } } disconnectedCallback() { super.disconnectedCallback(); - if (window && window.removeEventListener) { - window.removeEventListener('click', this.onWindowClick); + if (!isServer) { + window.removeEventListener('click', this.onWindowClick, { capture: true }); } } - onCloseMenu(e) { + onCloseMenu() { this.close(); } onDeactivateItems(e) { @@ -499,8 +544,29 @@ const items = this.items; for (const item of items) { item.active = false; + item.selected = false; } } + handleDeactivateTypeahead(e) { + // stopPropagation so that this does not deactivate any typeaheads in menus + // nested above it e.g. md-sub-menu-item + e.stopPropagation(); + this.typeaheadActive = false; + } + handleActivateTypeahead(e) { + // stopPropagation so that this does not activate any typeaheads in menus + // nested above it e.g. md-sub-menu-item + e.stopPropagation(); + this.typeaheadActive = true; + } + handleStayOpenOnFocusout(e) { + e.stopPropagation(); + this.stayOpenOnFocusout = true; + } + handleCloseOnFocusout(e) { + e.stopPropagation(); + this.stayOpenOnFocusout = false; + } focus() { this.listElement?.focus(); } @@ -514,81 +580,71 @@ this.open = true; } } +_a = Menu; +(() => { + requestUpdateOnAriaChange(_a); +})(); __decorate([ - query('md-list'), - __metadata("design:type", List) + query('md-list') ], Menu.prototype, "listElement", void 0); __decorate([ - query('.menu'), - __metadata("design:type", HTMLElement) + query('.menu') ], Menu.prototype, "surfaceEl", void 0); __decorate([ - query('slot'), - __metadata("design:type", HTMLSlotElement) + query('slot') ], Menu.prototype, "slotEl", void 0); __decorate([ - query('md-focus-ring'), - __metadata("design:type", MdFocusRing) -], Menu.prototype, "focusRing", void 0); -__decorate([ - ariaProperty, - property({ type: String, attribute: 'data-aria-label', noAccessor: true }), - __metadata("design:type", String) -], Menu.prototype, "ariaLabel", void 0); -__decorate([ - property({ attribute: false }), - __metadata("design:type", HTMLElement) + property({ attribute: false }) ], Menu.prototype, "anchor", void 0); __decorate([ - property({ type: Boolean }), - __metadata("design:type", Object) + property({ type: Boolean }) ], Menu.prototype, "fixed", void 0); __decorate([ - property({ type: Boolean }), - __metadata("design:type", Object) + property({ type: Boolean }) ], Menu.prototype, "quick", void 0); __decorate([ - property({ type: Boolean, attribute: 'has-overflow' }), - __metadata("design:type", Object) + property({ type: Boolean, attribute: 'has-overflow' }) ], Menu.prototype, "hasOverflow", void 0); __decorate([ - property({ type: Boolean, reflect: true }), - __metadata("design:type", Object) + property({ type: Boolean, reflect: true }) ], Menu.prototype, "open", void 0); __decorate([ - property({ type: Number, attribute: 'x-offset' }), - __metadata("design:type", Object) + property({ type: Number, attribute: 'x-offset' }) ], Menu.prototype, "xOffset", void 0); __decorate([ - property({ type: Number, attribute: 'y-offset' }), - __metadata("design:type", Object) + property({ type: Number, attribute: 'y-offset' }) ], Menu.prototype, "yOffset", void 0); __decorate([ - property({ type: Number, attribute: 'list-tab-index' }), - __metadata("design:type", Object) + property({ type: Number, attribute: 'list-tab-index' }) ], Menu.prototype, "listTabIndex", void 0); __decorate([ - property({ type: Number, attribute: 'typeahead-delay' }), - __metadata("design:type", Object) + property() +], Menu.prototype, "type", void 0); +__decorate([ + property({ type: Number, attribute: 'typeahead-delay' }) ], Menu.prototype, "typeaheadBufferTime", void 0); __decorate([ - property({ type: String, attribute: 'anchor-corner' }), - __metadata("design:type", String) + property({ attribute: 'anchor-corner' }) ], Menu.prototype, "anchorCorner", void 0); __decorate([ - property({ type: String, attribute: 'menu-corner' }), - __metadata("design:type", String) + property({ attribute: 'menu-corner' }) ], Menu.prototype, "menuCorner", void 0); __decorate([ - property({ type: Boolean, attribute: 'stay-open-on-outside-click' }), - __metadata("design:type", Object) + property({ type: Boolean, attribute: 'stay-open-on-outside-click' }) ], Menu.prototype, "stayOpenOnOutsideClick", void 0); __decorate([ - property({ type: Boolean, attribute: 'skip-restore-focus' }), - __metadata("design:type", Object) + property({ type: Boolean, attribute: 'stay-open-on-focusout' }) +], Menu.prototype, "stayOpenOnFocusout", void 0); +__decorate([ + property({ type: Boolean, attribute: 'skip-restore-focus' }) ], Menu.prototype, "skipRestoreFocus", void 0); __decorate([ - property({ type: String, attribute: 'default-focus' }), - __metadata("design:type", String) + property({ attribute: 'default-focus' }) ], Menu.prototype, "defaultFocus", void 0); +__decorate([ + state() +], Menu.prototype, "typeaheadActive", void 0); +__decorate([ + eventOptions({ capture: true }) +], Menu.prototype, "handleListKeydown", null); //# sourceMappingURL=menu.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/menuitem/menu-item-private-styles.css.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/menuitem/forced-colors-styles.css.d.ts similarity index 100% rename from third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/menuitem/menu-item-private-styles.css.d.ts rename to third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/menuitem/forced-colors-styles.css.d.ts
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/menuitem/forced-colors-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/menuitem/forced-colors-styles.css.js new file mode 100644 index 0000000..28f8d45 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/menuitem/forced-colors-styles.css.js
@@ -0,0 +1,9 @@ +/** + * @license + * Copyright 2022 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import { css } from 'lit'; +export const styles = css `@media(forced-colors: active){.list-item{position:relative}:host([selected]) .list-item:not(:has(.focus-ring[visible]))::before{content:"";position:absolute;inset:0;box-sizing:border-box;border-radius:inherit;pointer-events:none;border:3px double CanvasText}}/*# sourceMappingURL=forced-colors-styles.css.map */ +`; +//# sourceMappingURL=forced-colors-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/menuitem/menu-item-private-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/menuitem/menu-item-private-styles.css.js deleted file mode 100644 index e7a67220..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/menuitem/menu-item-private-styles.css.js +++ /dev/null
@@ -1,9 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { css } from 'lit'; -export const styles = css `:host{--_list-item-container-height: var(--md-menu-list-item-container-height, 48px);--_list-item-disabled-label-text-color: var(--md-menu-list-item-disabled-label-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_list-item-disabled-label-text-opacity: var(--md-menu-list-item-disabled-label-text-opacity, 0.38);--_list-item-focus-label-text-color: var(--md-menu-list-item-focus-label-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_list-item-focus-state-layer-color: var(--md-menu-list-item-focus-state-layer-color, var(--md-sys-color-on-surface, #1c1b1f));--_list-item-focus-state-layer-opacity: var(--md-menu-list-item-focus-state-layer-opacity, 0.12);--_list-item-hover-label-text-color: var(--md-menu-list-item-hover-label-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_list-item-hover-state-layer-color: var(--md-menu-list-item-hover-state-layer-color, var(--md-sys-color-on-surface, #1c1b1f));--_list-item-hover-state-layer-opacity: var(--md-menu-list-item-hover-state-layer-opacity, 0.08);--_list-item-label-text-color: var(--md-menu-list-item-label-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_list-item-label-text-font: var(--md-menu-list-item-label-text-font, Roboto);--_list-item-label-text-line-height: var(--md-menu-list-item-label-text-line-height, 1.25rem);--_list-item-label-text-size: var(--md-menu-list-item-label-text-size, 0.875rem);--_list-item-label-text-tracking: var(--md-menu-list-item-label-text-tracking, 0.006rem);--_list-item-label-text-type: var(--md-menu-list-item-label-text-type, 500 0.875rem / 1.25rem Roboto);--_list-item-label-text-weight: var(--md-menu-list-item-label-text-weight, 500);--_list-item-pressed-label-text-color: var(--md-menu-list-item-pressed-label-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_list-item-pressed-state-layer-color: var(--md-menu-list-item-pressed-state-layer-color, var(--md-sys-color-on-surface, #1c1b1f));--_list-item-pressed-state-layer-opacity: var(--md-menu-list-item-pressed-state-layer-opacity, 0.12);--_list-item-selected-container-color: var(--md-menu-list-item-selected-container-color, var(--md-sys-color-surface-variant, #e7e0ec));--_list-item-disabled-leading-icon-color: var(--md-menu-list-item-disabled-leading-icon-color, var(--md-sys-color-on-surface, #1c1b1f));--_list-item-disabled-leading-icon-opacity: var(--md-menu-list-item-disabled-leading-icon-opacity, 0.38);--_list-item-focus-leading-icon-icon-color: var(--md-menu-list-item-focus-leading-icon-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_list-item-hover-leading-icon-icon-color: var(--md-menu-list-item-hover-leading-icon-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_list-item-leading-icon-color: var(--md-menu-list-item-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_list-item-leading-icon-size: var(--md-menu-list-item-leading-icon-size, 24px);--_list-item-pressed-leading-icon-icon-color: var(--md-menu-list-item-pressed-leading-icon-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_list-item-disabled-trailing-icon-color: var(--md-menu-list-item-disabled-trailing-icon-color, var(--md-sys-color-on-surface, #1c1b1f));--_list-item-disabled-trailing-icon-opacity: var(--md-menu-list-item-disabled-trailing-icon-opacity, 0.38);--_list-item-focus-trailing-icon-icon-color: var(--md-menu-list-item-focus-trailing-icon-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_list-item-hover-trailing-icon-icon-color: var(--md-menu-list-item-hover-trailing-icon-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_list-item-pressed-trailing-icon-icon-color: var(--md-menu-list-item-pressed-trailing-icon-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_list-item-trailing-icon-color: var(--md-menu-list-item-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_list-item-trailing-icon-size: var(--md-menu-list-item-trailing-icon-size, 24px);--_list-item-one-line-container-height: var(--md-menu-list-item-one-line-container-height, 48px)}/*# sourceMappingURL=menu-item-private-styles.css.map */ -`; -//# sourceMappingURL=menu-item-private-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/menuitem/menu-item-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/menuitem/menu-item-styles.css.js index d416ab5..792d0f8 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/menuitem/menu-item-styles.css.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/menuitem/menu-item-styles.css.js
@@ -4,6 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ import { css } from 'lit'; -export const styles = css `:host([active]) .list-item{background-color:var(--_list-item-selected-container-color)}.list-item:has(.submenu:hover){--md-ripple-hover-state-layer-opacity:0}/*# sourceMappingURL=menu-item-styles.css.map */ +export const styles = css `:host{--_list-item-selected-container-color: var(--md-menu-item-list-item-selected-container-color, var(--md-sys-color-surface-container-highest, #e6e0e9));--_list-item-container-color: var(--md-menu-item-list-item-container-color, var(--md-sys-color-surface-container, #f3edf7));--md-list-item-list-item-container-color: var(--_list-item-container-color)}:host([selected]) .list-item{background-color:var(--_list-item-selected-container-color)}.list-item:has(.submenu:hover){--md-ripple-hover-opacity:0}/*# sourceMappingURL=menu-item-styles.css.map */ `; //# sourceMappingURL=menu-item-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/menuitem/menu-item.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/menuitem/menu-item.d.ts index 5d8fb03..a913c9a 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/menuitem/menu-item.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/menuitem/menu-item.d.ts
@@ -10,7 +10,6 @@ * @fires close-menu {CloseMenuEvent} */ export declare class MenuItemEl extends ListItemEl implements MenuItem { - role: ARIARole; /** * READONLY: self-identifies as a menu item and sets its identifying attribute */ @@ -23,6 +22,7 @@ * Used for overriding e.g. sub-menu-item. */ protected keepOpenOnClick: boolean; + protected readonly listItemRole: ARIARole; protected onClick(): void; protected onKeydown(e: KeyboardEvent): void; }
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/menuitem/menu-item.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/menuitem/menu-item.js index b568a99..94359ab 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/menuitem/menu-item.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/menuitem/menu-item.js
@@ -3,7 +3,7 @@ * Copyright 2022 Google LLC * SPDX-License-Identifier: Apache-2.0 */ -import { __decorate, __metadata } from "tslib"; +import { __decorate } from "tslib"; import { property } from 'lit/decorators.js'; import { ListItemEl } from '../../../list/lib/listitem/list-item.js'; import { CLOSE_REASON, DefaultCloseMenuEvent, isClosableKey } from '../shared.js'; @@ -13,7 +13,6 @@ export class MenuItemEl extends ListItemEl { constructor() { super(...arguments); - this.role = 'menuitem'; /** * READONLY: self-identifies as a menu item and sets its identifying attribute */ @@ -26,6 +25,7 @@ * Used for overriding e.g. sub-menu-item. */ this.keepOpenOnClick = false; + this.listItemRole = 'menuitem'; } onClick() { if (this.keepOpen || this.keepOpenOnClick) @@ -36,18 +36,16 @@ if (this.keepOpen) return; const keyCode = e.code; - if (isClosableKey(keyCode)) { + if (!e.defaultPrevented && isClosableKey(keyCode)) { e.preventDefault(); this.dispatchEvent(new DefaultCloseMenuEvent(this, { kind: CLOSE_REASON.KEYDOWN, key: keyCode })); } } } __decorate([ - property({ type: Boolean, attribute: 'md-menu-item', reflect: true }), - __metadata("design:type", Object) + property({ type: Boolean, attribute: 'md-menu-item', reflect: true }) ], MenuItemEl.prototype, "isMenuItem", void 0); __decorate([ - property({ type: Boolean, attribute: 'keep-open' }), - __metadata("design:type", Object) + property({ type: Boolean, attribute: 'keep-open' }) ], MenuItemEl.prototype, "keepOpen", void 0); //# sourceMappingURL=menu-item.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/menuitemlink/menu-item-link.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/menuitemlink/menu-item-link.d.ts index 3c25ec5..5b3aa4b 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/menuitemlink/menu-item-link.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/menuitemlink/menu-item-link.d.ts
@@ -4,13 +4,11 @@ * SPDX-License-Identifier: Apache-2.0 */ import { ListItemLink } from '../../../list/lib/listitemlink/list-item-link.js'; -import { ARIARole } from '../../../types/aria.js'; import { MenuItem } from '../shared.js'; /** * @fires close-menu {CloseMenuEvent} */ export declare class MenuItemLink extends ListItemLink implements MenuItem { - role: ARIARole; /** * READONLY: self-identifies as a menu item and sets its identifying attribute */
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/menuitemlink/menu-item-link.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/menuitemlink/menu-item-link.js index 696c0e7..0d84219 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/menuitemlink/menu-item-link.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/menuitemlink/menu-item-link.js
@@ -3,7 +3,7 @@ * Copyright 2023 Google LLC * SPDX-License-Identifier: Apache-2.0 */ -import { __decorate, __metadata } from "tslib"; +import { __decorate } from "tslib"; import { property } from 'lit/decorators.js'; import { ListItemLink } from '../../../list/lib/listitemlink/list-item-link.js'; import { CLOSE_REASON, DefaultCloseMenuEvent, isClosableKey, SELECTION_KEY } from '../shared.js'; @@ -13,7 +13,6 @@ export class MenuItemLink extends ListItemLink { constructor() { super(...arguments); - this.role = 'menuitem'; /** * READONLY: self-identifies as a menu item and sets its identifying attribute */ @@ -34,18 +33,17 @@ return; const keyCode = e.code; // Do not preventDefault on enter or else it will prevent from opening links - if (isClosableKey(keyCode) && keyCode !== SELECTION_KEY.ENTER) { + if (!e.defaultPrevented && isClosableKey(keyCode) && + keyCode !== SELECTION_KEY.ENTER) { e.preventDefault(); this.dispatchEvent(new DefaultCloseMenuEvent(this, { kind: CLOSE_REASON.KEYDOWN, key: keyCode })); } } } __decorate([ - property({ type: Boolean, attribute: 'md-menu-item', reflect: true }), - __metadata("design:type", Object) + property({ type: Boolean, attribute: 'md-menu-item', reflect: true }) ], MenuItemLink.prototype, "isMenuItem", void 0); __decorate([ - property({ type: Boolean, attribute: 'keep-open' }), - __metadata("design:type", Object) + property({ type: Boolean, attribute: 'keep-open' }) ], MenuItemLink.prototype, "keepOpen", void 0); //# sourceMappingURL=menu-item-link.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/shared.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/shared.d.ts index 6b9fcb9..7b066bdc 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/shared.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/shared.d.ts
@@ -13,21 +13,29 @@ */ headline: string; /** - * Whether or not the item is in the selected visual state (focuses on - * selection). + * Whether or not the item is the currently active item of interest (focuses + * upon activation). */ active: boolean; /** + * Whether or not the item is in the selected visual state. + */ + selected?: boolean; + /** * If it is a sub-menu-item, a method that can close the submenu. */ close?: () => void; + /** + * Focuses the item. + */ + focus: () => void; } /** * The interface of every menu item interactive with a menu. All menu items * should implement this interface to be compatible with md-menu. Additionally * they should have both the `md-menu-item` and `md-list-item` attributes set. */ -export declare type MenuItem = MenuItemSelf & ListItem; +export type MenuItem = MenuItemSelf & ListItem; /** * The reason the `close-menu` event was dispatched. */ @@ -53,7 +61,7 @@ /** * The default menu closing reasons for the material md-menu package. */ -export declare type DefaultReasons = ClickReason | KeydownReason; +export type DefaultReasons = ClickReason | KeydownReason; /** * The event that closes any parent menus. It is recommended to subclass and * dispatch this event rather than creating your own `close-menu` event. @@ -65,6 +73,20 @@ constructor(initiator: MenuItem, reason: T); } /** + * The event that signals to the menu that it should stay open on the focusout + * event. + */ +export declare class StayOpenOnFocusoutEvent extends Event { + constructor(); +} +/** + * The event that signals to the menu that it should close open on the focusout + * event. + */ +export declare class CloseOnFocusoutEvent extends Event { + constructor(); +} +/** * The default close menu event used by md-menu. To create your own `close-menu` * event, you should subclass the `CloseMenuEvent` instead. */ @@ -82,6 +104,18 @@ constructor(); } /** + * Requests the typeahead functionality of containing menu be deactivated. + */ +export declare class DeactivateTypeaheadEvent extends Event { + constructor(); +} +/** + * Requests the typeahead functionality of containing menu be activated. + */ +export declare class ActivateTypeaheadEvent extends Event { + constructor(); +} +/** * Keys that are used to navigate menus. */ export declare const NAVIGABLE_KEY: { @@ -112,7 +146,7 @@ readonly SPACE: "Space"; readonly ENTER: "Enter"; }; -declare type Values<T> = T[keyof T]; +type Values<T> = T[keyof T]; /** * Determines whether the given key code is a key code that should close the * menu. @@ -131,4 +165,14 @@ * menu item. */ export declare function isSelectableKey(code: string): code is Values<typeof SELECTION_KEY>; +/** + * Determines whether a target element is contained inside another element's + * composed tree. + * + * @param target The potential contained element. + * @param container The potential containing element of the target. + * @returns Whether the target element is contained inside the container's + * composed subtree + */ +export declare function isElementInSubtree(target: EventTarget, container: EventTarget): boolean; export {};
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/shared.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/shared.js index 7e09f3a..c00ff371 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/shared.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/shared.js
@@ -16,6 +16,24 @@ } } /** + * The event that signals to the menu that it should stay open on the focusout + * event. + */ +export class StayOpenOnFocusoutEvent extends Event { + constructor() { + super('stay-open-on-focusout', { bubbles: true, composed: true }); + } +} +/** + * The event that signals to the menu that it should close open on the focusout + * event. + */ +export class CloseOnFocusoutEvent extends Event { + constructor() { + super('close-on-focusout', { bubbles: true, composed: true }); + } +} +/** * The default close menu event used by md-menu. To create your own `close-menu` * event, you should subclass the `CloseMenuEvent` instead. */ @@ -30,6 +48,22 @@ } } /** + * Requests the typeahead functionality of containing menu be deactivated. + */ +export class DeactivateTypeaheadEvent extends Event { + constructor() { + super('deactivate-typeahead', { bubbles: true, composed: true }); + } +} +/** + * Requests the typeahead functionality of containing menu be activated. + */ +export class ActivateTypeaheadEvent extends Event { + constructor() { + super('activate-typeahead', { bubbles: true, composed: true }); + } +} +/** * Keys that are used to navigate menus. */ export const NAVIGABLE_KEY = { @@ -82,4 +116,27 @@ export function isSelectableKey(code) { return Object.values(SELECTION_KEY).some(value => (value === code)); } +/** + * Determines whether a target element is contained inside another element's + * composed tree. + * + * @param target The potential contained element. + * @param container The potential containing element of the target. + * @returns Whether the target element is contained inside the container's + * composed subtree + */ +export function isElementInSubtree(target, container) { + // Dispatch a composed, bubbling event to check its path to see if the + // newly-focused element is contained in container's subtree + const focusEv = new Event('md-contains', { bubbles: true, composed: true }); + let composedPath = []; + const listener = (ev) => { + composedPath = ev.composedPath(); + }; + container.addEventListener('md-contains', listener); + target.dispatchEvent(focusEv); + container.removeEventListener('md-contains', listener); + const isContained = composedPath.length > 0; + return isContained; +} //# sourceMappingURL=shared.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/submenuitem/sub-menu-item.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/submenuitem/sub-menu-item.d.ts index 3e115fd..ce4101d 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/submenuitem/sub-menu-item.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/submenuitem/sub-menu-item.d.ts
@@ -3,16 +3,23 @@ * Copyright 2023 Google LLC * SPDX-License-Identifier: Apache-2.0 */ -import { ARIARole } from '../../../types/aria.js'; -import { Corner, Menu } from '../menu.js'; +import { Corner } from '../menu.js'; import { MenuItemEl } from '../menuitem/menu-item.js'; -import { CloseMenuEvent } from '../shared.js'; /** * @fires deactivate-items {DeactivateItemsEvent} Requests the parent menu to * deselect other items when a submenu opens + * @fires deactivate-typeahead {DeactivateItemsEvent} Requests the parent menu + * to deactivate the typeahead functionality when a submenu opens + * @fires activate-typeahead {DeactivateItemsEvent} Requests the parent menu to + * activate the typeahead functionality when a submenu closes + * @fires stay-open-on-focusout {StayOpenOnFocusoutEvent} Requests the parent + * menu to stay open when focusout event is fired or has a `null` + * `relatedTarget` when submenu is opened. + * @fires close-on-focusout {CloseOnFocusoutEvent} Requests the parent + * menu to close when focusout event is fired or has a `null` + * `relatedTarget` When submenu is closed. */ export declare class SubMenuItem extends MenuItemEl { - role: ARIARole; /** * The anchorCorner to set on the submenu. */ @@ -29,12 +36,15 @@ * The delay between ponterleave and the submenu closing. */ hoverCloseDelay: number; - protected menus: Menu[]; + /** + * Sets the item in the selected visual state when a submenu is opened. + */ + selected: boolean; + private readonly menus; protected keepOpenOnClick: boolean; - protected previousOpenTimeout: number; - protected previousCloseTimeout: number; - protected submenuOpen: boolean; - protected get submenuEl(): Menu | undefined; + private previousOpenTimeout; + private previousCloseTimeout; + private get submenuEl(); /** * Starts the default 400ms countdown to open the submenu. */ @@ -55,9 +65,9 @@ /** * Renders the slot for the submenu. */ - protected renderSubMenu(): import("lit-html").TemplateResult<1>; - protected onCloseSubmenu(e: CloseMenuEvent): void; - protected onSubMenuKeydown(e: KeyboardEvent): Promise<void>; + private renderSubMenu; + private onCloseSubmenu; + private onSubMenuKeydown; /** * Shows the submenu. * @@ -77,7 +87,7 @@ * @param code The native KeyboardEvent code. * @return Whether or not the key code should open the submenu. */ - protected isSubmenuOpenKey(code: string): boolean; + private isSubmenuOpenKey; /** * Determines whether the given KeyboardEvent code is one that should close * the submenu. This is RTL-aware. By default right, left, or escape. @@ -85,5 +95,5 @@ * @param code The native KeyboardEvent code. * @return Whether or not the key code should close the submenu. */ - protected isSubmenuCloseKey(code: string): boolean; + private isSubmenuCloseKey; }
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/submenuitem/sub-menu-item.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/submenuitem/sub-menu-item.js index daa0104..19fda619 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/submenuitem/sub-menu-item.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/submenuitem/sub-menu-item.js
@@ -3,23 +3,32 @@ * Copyright 2023 Google LLC * SPDX-License-Identifier: Apache-2.0 */ -import { __decorate, __metadata } from "tslib"; +import { __decorate } from "tslib"; import { html } from 'lit'; import { property, queryAssignedElements } from 'lit/decorators.js'; import { List } from '../../../list/lib/list.js'; import { MenuItemEl } from '../menuitem/menu-item.js'; -import { CLOSE_REASON, DeactivateItemsEvent, KEYDOWN_CLOSE_KEYS, NAVIGABLE_KEY, SELECTION_KEY } from '../shared.js'; +import { ActivateTypeaheadEvent, CLOSE_REASON, CloseOnFocusoutEvent, DeactivateItemsEvent, DeactivateTypeaheadEvent, KEYDOWN_CLOSE_KEYS, NAVIGABLE_KEY, SELECTION_KEY, StayOpenOnFocusoutEvent } from '../shared.js'; function stopPropagation(e) { e.stopPropagation(); } /** * @fires deactivate-items {DeactivateItemsEvent} Requests the parent menu to * deselect other items when a submenu opens + * @fires deactivate-typeahead {DeactivateItemsEvent} Requests the parent menu + * to deactivate the typeahead functionality when a submenu opens + * @fires activate-typeahead {DeactivateItemsEvent} Requests the parent menu to + * activate the typeahead functionality when a submenu closes + * @fires stay-open-on-focusout {StayOpenOnFocusoutEvent} Requests the parent + * menu to stay open when focusout event is fired or has a `null` + * `relatedTarget` when submenu is opened. + * @fires close-on-focusout {CloseOnFocusoutEvent} Requests the parent + * menu to close when focusout event is fired or has a `null` + * `relatedTarget` When submenu is closed. */ export class SubMenuItem extends MenuItemEl { constructor() { super(...arguments); - this.role = 'menuitem'; /** * The anchorCorner to set on the submenu. */ @@ -36,10 +45,13 @@ * The delay between ponterleave and the submenu closing. */ this.hoverCloseDelay = 400; + /** + * Sets the item in the selected visual state when a submenu is opened. + */ + this.selected = false; this.keepOpenOnClick = true; this.previousOpenTimeout = 0; this.previousCloseTimeout = 0; - this.submenuOpen = false; /** * Starts the default 400ms countdown to open the submenu. */ @@ -128,17 +140,22 @@ } onCloseSubmenu(e) { e.itemPath.push(this); + // Restore focusout behavior + this.dispatchEvent(new CloseOnFocusoutEvent()); + this.dispatchEvent(new ActivateTypeaheadEvent()); // Escape should only close one menu not all of the menus unlike space or // click selection which should close all menus. if (e.reason.kind === CLOSE_REASON.KEYDOWN && e.reason.key === KEYDOWN_CLOSE_KEYS.ESCAPE) { e.stopPropagation(); this.active = true; + this.selected = false; // It might already be active so manually focus - this.listItemRoot.focus(); + this.listItemRoot?.focus(); return; } this.active = false; + this.selected = false; } async onSubMenuKeydown(e) { // Stop propagation so that we don't accidentally close every parent menu. @@ -150,7 +167,7 @@ return; this.close(() => { List.deactivateActiveItem(this.submenuEl.items); - this.listItemRoot.focus(); + this.listItemRoot?.focus(); this.active = true; }); } @@ -175,13 +192,21 @@ // keyboard after hover. menu.defaultFocus = 'LIST_ROOT'; menu.skipRestoreFocus = true; + menu.stayOpenOnOutsideClick = true; + menu.stayOpenOnFocusout = true; // Menu could already be opened because of mouse interaction const menuAlreadyOpen = menu.open; + // We want the parent to stay open in the case such that a middle submenu + // has a submenuitem hovered which opens a third submenut. Then if you hover + // on yet another middle menu-item (not submenuitem) then focusout Event's + // relatedTarget will be `null` thus, causing all the menus to close + this.dispatchEvent(new StayOpenOnFocusoutEvent()); menu.show(); // Deactivate other items. This can be the case if the user has tabbed // around the menu and then mouses over an md-sub-menu. this.dispatchEvent(new DeactivateItemsEvent()); - this.active = true; + this.dispatchEvent(new DeactivateTypeaheadEvent()); + this.selected = true; // This is the case of mouse hovering when already opened via keyboard or // vice versa if (menuAlreadyOpen) { @@ -200,9 +225,13 @@ const menu = this.submenuEl; if (!menu || !menu.open) return; + this.dispatchEvent(new ActivateTypeaheadEvent()); menu.quick = true; menu.close(); + // Restore focusout behavior. + this.dispatchEvent(new CloseOnFocusoutEvent()); this.active = false; + this.selected = false; menu.addEventListener('closed', onClosed, { once: true }); } /** @@ -244,23 +273,21 @@ } } __decorate([ - property({ attribute: 'anchor-corner' }), - __metadata("design:type", String) + property({ attribute: 'anchor-corner' }) ], SubMenuItem.prototype, "anchorCorner", void 0); __decorate([ - property({ attribute: 'menu-corner' }), - __metadata("design:type", String) + property({ attribute: 'menu-corner' }) ], SubMenuItem.prototype, "menuCorner", void 0); __decorate([ - property({ type: Number, attribute: 'hover-open-delay' }), - __metadata("design:type", Object) + property({ type: Number, attribute: 'hover-open-delay' }) ], SubMenuItem.prototype, "hoverOpenDelay", void 0); __decorate([ - property({ type: Number, attribute: 'hover-close-delay' }), - __metadata("design:type", Object) + property({ type: Number, attribute: 'hover-close-delay' }) ], SubMenuItem.prototype, "hoverCloseDelay", void 0); __decorate([ - queryAssignedElements({ slot: 'submenu' }), - __metadata("design:type", Array) + property({ type: Boolean, reflect: true }) +], SubMenuItem.prototype, "selected", void 0); +__decorate([ + queryAssignedElements({ slot: 'submenu', flatten: true }) ], SubMenuItem.prototype, "menus", void 0); //# sourceMappingURL=sub-menu-item.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/surfacePositionController.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/surfacePositionController.d.ts index 94e9676f..6a2452c 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/surfacePositionController.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/surfacePositionController.d.ts
@@ -8,7 +8,15 @@ /** * A corner of a box in the standard logical property style of <block>_<inline> */ -export declare type Corner = 'END_START' | 'END_END' | 'START_START' | 'START_END'; +export type Corner = 'END_START' | 'END_END' | 'START_START' | 'START_END'; +/** + * An interface that provides a method to customize the rect from which to + * calculate the anchor positioning. Useful for when you want a surface to + * anchor to an element in your shadow DOM rather than the host element. + */ +export interface SurfacePositionTarget extends HTMLElement { + getSurfacePositionClientRect?: () => DOMRect; +} /** * The configurable options for the surface position controller. */ @@ -24,11 +32,11 @@ /** * The HTMLElement reference of the surface to be positioned. */ - surfaceEl: HTMLElement | null; + surfaceEl: SurfacePositionTarget | null; /** * The HTMLElement reference of the anchor to align to. */ - anchorEl: HTMLElement | null; + anchorEl: SurfacePositionTarget | null; /** * Whether or not the calculation should be relative to the top layer rather * than relative to the parent of the anchor.
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/surfacePositionController.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/surfacePositionController.js index d12102c3..19fe8bc 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/surfacePositionController.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/surfacePositionController.js
@@ -55,8 +55,12 @@ // Wait for it to be visible. this.host.requestUpdate(); await this.host.updateComplete; - const surfaceRect = surfaceEl.getBoundingClientRect(); - const anchorRect = anchorEl.getBoundingClientRect(); + const surfaceRect = surfaceEl.getSurfacePositionClientRect ? + surfaceEl.getSurfacePositionClientRect() : + surfaceEl.getBoundingClientRect(); + const anchorRect = anchorEl.getSurfacePositionClientRect ? + anchorEl.getSurfacePositionClientRect() : + anchorEl.getBoundingClientRect(); const [surfaceBlock, surfaceInline] = surfaceCorner.split('_'); const [anchorBlock, anchorInline] = anchorCorner.split('_'); // We use number booleans to multiply values rather than `if` / ternary
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/typeaheadController.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/typeaheadController.d.ts index 77755ceb..f4ae453 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/typeaheadController.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/typeaheadController.d.ts
@@ -18,13 +18,25 @@ * alive. */ typeaheadBufferTime: number; + /** + * Whether or not the typeahead should listen for keystrokes or not. + */ + active: boolean; } /** * Data structure tuple that helps with indexing. * * [index, item, normalized header text] */ -declare type TypeaheadRecord = [number, MenuItem, string]; +type TypeaheadRecord = [number, MenuItem, string]; +/** + * Indicies to access the TypeaheadRecord tuple type. + */ +export declare const TYPEAHEAD_RECORD: { + readonly INDEX: 0; + readonly ITEM: 1; + readonly TEXT: 2; +}; /** * This controller listens to `keydown` events and searches the header text of * an array of `MenuItem`s with the corresponding entered keys within the buffer @@ -55,27 +67,27 @@ * ``` */ export declare class TypeaheadController { - protected getProperties: () => TypeaheadControllerProperties; + private readonly getProperties; /** * Array of tuples that helps with indexing. */ - protected typeaheadRecords: TypeaheadRecord[]; + private typeaheadRecords; /** * Currently-typed text since last buffer timeout */ - protected typaheadBuffer: string; + private typaheadBuffer; /** * The timeout id from the current buffer's setTimeout */ - protected cancelTypeaheadTimeout: number; + private cancelTypeaheadTimeout; /** * If we are currently "typing" */ - protected isTypingAhead: boolean; + isTypingAhead: boolean; /** * The record of the last active item. */ - protected lastActiveRecord: TypeaheadRecord | null; + lastActiveRecord: TypeaheadRecord | null; /** * @param getProperties A function that returns the options of the typeahead * controller: @@ -87,7 +99,8 @@ * } */ constructor(getProperties: () => TypeaheadControllerProperties); - protected get items(): MenuItem[]; + private get items(); + private get active(); /** * Apply this listener to the element that will receive `keydown` events that * should trigger this controller. @@ -98,7 +111,7 @@ /** * Sets up typingahead */ - protected beginTypeahead(e: KeyboardEvent): void; + private beginTypeahead; /** * Performs the typeahead. Based on the normalized items and the current text * buffer, finds the _next_ item with matching text and activates it. @@ -135,10 +148,10 @@ * * activates Olive */ - protected typeahead(e: KeyboardEvent): void; + private typeahead; /** * Ends the current typeahead and clears the buffer. */ - protected endTypeahead: () => void; + private readonly endTypeahead; } export {};
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/typeaheadController.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/typeaheadController.js index 2591c7c..07d473f 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/typeaheadController.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/lib/typeaheadController.js
@@ -3,10 +3,14 @@ * Copyright 2023 Google LLC * SPDX-License-Identifier: Apache-2.0 */ -// Indicies to access the TypeaheadRecord tuple -const TYPEAHEAD_INDEX = 0; -const TYPEAHEAD_ITEM = 1; -const TYPEAHEAD_TEXT = 2; +/** + * Indicies to access the TypeaheadRecord tuple type. + */ +export const TYPEAHEAD_RECORD = { + INDEX: 0, + ITEM: 1, + TEXT: 2, +}; /** * This controller listens to `keydown` events and searches the header text of * an array of `MenuItem`s with the corresponding entered keys within the buffer @@ -95,18 +99,21 @@ get items() { return this.getProperties().getItems(); } + get active() { + return this.getProperties().active; + } /** * Sets up typingahead */ beginTypeahead(e) { + if (!this.active) { + return; + } // We don't want to typeahead if the _beginning_ of the typeahead is a menu // navigation, or a selection. We will handle "Space" only if it's in the // middle of a typeahead if (e.code === 'Space' || e.code === 'Enter' || e.code.startsWith('Arrow') || e.code === 'Escape') { - if (this.lastActiveRecord) { - this.lastActiveRecord[TYPEAHEAD_ITEM].active = false; - } return; } this.isTypingAhead = true; @@ -114,10 +121,10 @@ // and a normalized header. this.typeaheadRecords = this.items.map((el, index) => [index, el, el.headline.trim().toLowerCase()]); this.lastActiveRecord = - this.typeaheadRecords.find(record => record[TYPEAHEAD_ITEM].active) ?? + this.typeaheadRecords.find(record => record[TYPEAHEAD_RECORD.ITEM].active) ?? null; if (this.lastActiveRecord) { - this.lastActiveRecord[TYPEAHEAD_ITEM].active = false; + this.lastActiveRecord[TYPEAHEAD_RECORD.ITEM].active = false; } this.typeahead(e); } @@ -165,19 +172,22 @@ e.code === 'Escape') { this.endTypeahead(); if (this.lastActiveRecord) { - this.lastActiveRecord[TYPEAHEAD_ITEM].active = false; + this.lastActiveRecord[TYPEAHEAD_RECORD.ITEM].active = false; } return; } // If Space is pressed, prevent it from selecting and closing the menu if (e.code === 'Space') { e.stopPropagation(); + e.preventDefault(); } // Start up a new keystroke buffer timeout this.cancelTypeaheadTimeout = setTimeout(this.endTypeahead, this.getProperties().typeaheadBufferTime); this.typaheadBuffer += e.key.toLowerCase(); - const lastActiveIndex = this.lastActiveRecord ? this.lastActiveRecord[TYPEAHEAD_INDEX] : -1; + const lastActiveIndex = this.lastActiveRecord ? + this.lastActiveRecord[TYPEAHEAD_RECORD.INDEX] : + -1; const numRecords = this.typeaheadRecords.length; /** * Sorting function that will resort the items starting with the given index @@ -202,13 +212,13 @@ * 5: [2, <reference>, 'banana'] */ const rebaseIndexOnActive = (record) => { - return (record[TYPEAHEAD_INDEX] + numRecords - lastActiveIndex) % + return (record[TYPEAHEAD_RECORD.INDEX] + numRecords - lastActiveIndex) % numRecords; }; // records filtered and sorted / rebased around the last active index const matchingRecords = this.typeaheadRecords - .filter(record => !record[TYPEAHEAD_ITEM].disabled && - record[TYPEAHEAD_TEXT].startsWith(this.typaheadBuffer)) + .filter(record => !record[TYPEAHEAD_RECORD.ITEM].disabled && + record[TYPEAHEAD_RECORD.TEXT].startsWith(this.typaheadBuffer)) .sort((a, b) => rebaseIndexOnActive(a) - rebaseIndexOnActive(b)); // Just leave if there's nothing that matches. Native select will just // choose the first thing that starts with the next letter in the alphabet @@ -216,7 +226,7 @@ if (matchingRecords.length === 0) { clearTimeout(this.cancelTypeaheadTimeout); if (this.lastActiveRecord) { - this.lastActiveRecord[TYPEAHEAD_ITEM].active = false; + this.lastActiveRecord[TYPEAHEAD_RECORD.ITEM].active = false; } this.endTypeahead(); return; @@ -232,10 +242,10 @@ nextRecord = matchingRecords[0]; } if (this.lastActiveRecord) { - this.lastActiveRecord[TYPEAHEAD_ITEM].active = false; + this.lastActiveRecord[TYPEAHEAD_RECORD.ITEM].active = false; } this.lastActiveRecord = nextRecord; - nextRecord[TYPEAHEAD_ITEM].active = true; + nextRecord[TYPEAHEAD_RECORD.ITEM].active = true; return; } }
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/menu-item-link.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/menu-item-link.js index d4c7f254..bf6ae99f 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/menu-item-link.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/menu-item-link.js
@@ -5,8 +5,9 @@ */ import { __decorate } from "tslib"; import { customElement } from 'lit/decorators.js'; +import { styles as listItemForcedColorsStyles } from '../list/lib/listitem/forced-colors-styles.css.js'; import { styles as listItemStyles } from '../list/lib/listitem/list-item-styles.css.js'; -import { styles as privateProps } from './lib/menuitem/menu-item-private-styles.css.js'; +import { styles as forcedColorsStyles } from './lib/menuitem/forced-colors-styles.css.js'; import { styles } from './lib/menuitem/menu-item-styles.css.js'; import { MenuItemLink } from './lib/menuitemlink/menu-item-link.js'; export { CloseMenuEvent, DeactivateItemsEvent } from './lib/shared.js'; @@ -29,7 +30,7 @@ */ let MdMenuItemLink = class MdMenuItemLink extends MenuItemLink { }; -MdMenuItemLink.styles = [privateProps, listItemStyles, styles]; +MdMenuItemLink.styles = [listItemStyles, styles, listItemForcedColorsStyles, forcedColorsStyles]; MdMenuItemLink = __decorate([ customElement('md-menu-item-link') ], MdMenuItemLink);
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/menu-item.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/menu-item.js index 2339b278..40c3ac179 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/menu-item.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/menu-item.js
@@ -5,9 +5,10 @@ */ import { __decorate } from "tslib"; import { customElement } from 'lit/decorators.js'; +import { styles as listItemForcedColorsStyles } from '../list/lib/listitem/forced-colors-styles.css.js'; import { styles as listItemStyles } from '../list/lib/listitem/list-item-styles.css.js'; +import { styles as forcedColorsStyles } from './lib/menuitem/forced-colors-styles.css.js'; import { MenuItemEl } from './lib/menuitem/menu-item.js'; -import { styles as privateProps } from './lib/menuitem/menu-item-private-styles.css.js'; import { styles } from './lib/menuitem/menu-item-styles.css.js'; export { CloseMenuEvent, DeactivateItemsEvent } from './lib/shared.js'; /** @@ -27,7 +28,7 @@ */ let MdMenuItem = class MdMenuItem extends MenuItemEl { }; -MdMenuItem.styles = [privateProps, listItemStyles, styles]; +MdMenuItem.styles = [listItemStyles, styles, listItemForcedColorsStyles, forcedColorsStyles]; MdMenuItem = __decorate([ customElement('md-menu-item') ], MdMenuItem);
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/menu.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/menu.js index 974fb73..23c588f8 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/menu.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/menu.js
@@ -5,6 +5,7 @@ */ import { __decorate } from "tslib"; import { customElement } from 'lit/decorators.js'; +import { styles as forcedColors } from './lib/forced-colors-styles.css.js'; import { Menu } from './lib/menu.js'; import { styles } from './lib/menu-styles.css.js'; export { CloseMenuEvent, DeactivateItemsEvent } from './lib/shared.js'; @@ -52,7 +53,7 @@ */ let MdMenu = class MdMenu extends Menu { }; -MdMenu.styles = [styles]; +MdMenu.styles = [styles, forcedColors]; MdMenu = __decorate([ customElement('md-menu') ], MdMenu);
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/sub-menu-item.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/sub-menu-item.js index ce0fcd78..9ca9a20d 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/sub-menu-item.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/menu/sub-menu-item.js
@@ -5,8 +5,9 @@ */ import { __decorate } from "tslib"; import { customElement } from 'lit/decorators.js'; +import { styles as listItemForcedColorsStyles } from '../list/lib/listitem/forced-colors-styles.css.js'; import { styles as listItemStyles } from '../list/lib/listitem/list-item-styles.css.js'; -import { styles as privateProps } from './lib/menuitem/menu-item-private-styles.css.js'; +import { styles as forcedColorsStyles } from './lib/menuitem/forced-colors-styles.css.js'; import { styles } from './lib/menuitem/menu-item-styles.css.js'; import { SubMenuItem } from './lib/submenuitem/sub-menu-item.js'; export { CloseMenuEvent, DeactivateItemsEvent } from './lib/shared.js'; @@ -56,7 +57,7 @@ */ let MdSubMenuItem = class MdSubMenuItem extends SubMenuItem { }; -MdSubMenuItem.styles = [privateProps, listItemStyles, styles]; +MdSubMenuItem.styles = [listItemStyles, styles, listItemForcedColorsStyles, forcedColorsStyles]; MdSubMenuItem = __decorate([ customElement('md-sub-menu-item') ], MdSubMenuItem);
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/menusurface/lib/adapter.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/menusurface/lib/adapter.d.ts deleted file mode 100644 index 423088f..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/menusurface/lib/adapter.d.ts +++ /dev/null
@@ -1,46 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { MDCMenuDimensions, MDCMenuDistance, MDCMenuPoint } from './types.js'; -/** - * Defines the shape of the adapter expected by the foundation. - * Implement this adapter for your framework of choice to delegate updates to - * the component in your framework of choice. See architecture documentation - * for more details. - * https://github.com/material-components/material-components-web/blob/master/docs/code/architecture.md - */ -export interface MDCMenuSurfaceAdapter { - addClass(className: string): void; - removeClass(className: string): void; - hasClass(className: string): boolean; - hasAnchor(): boolean; - isElementInContainer(el: Element): boolean; - isFocused(): boolean; - isRtl(): boolean; - getInnerDimensions(): MDCMenuDimensions; - getAnchorDimensions(): DOMRect | null; - getWindowDimensions(): MDCMenuDimensions; - getBodyDimensions(): MDCMenuDimensions; - getWindowScroll(): MDCMenuPoint; - setPosition(position: Partial<MDCMenuDistance>): void; - setMaxHeight(height: string): void; - setTransformOrigin(origin: string): void; - getOwnerDocument?(): Document; - /** Saves the element that was focused before the menu surface was opened. */ - saveFocus(): void; - /** - * Restores focus to the element that was focused before the menu surface was - * opened. - */ - restoreFocus(): void; - /** Emits an event when the menu surface is closed. */ - notifyClose(): void; - /** Emits an event when the menu surface is closing. */ - notifyClosing(): void; - /** Emits an event when the menu surface is opened. */ - notifyOpen(): void; - /** Emits an event when the menu surface is opening. */ - notifyOpening(): void; -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/menusurface/lib/adapter.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/menusurface/lib/adapter.js deleted file mode 100644 index d2fffb0..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/menusurface/lib/adapter.js +++ /dev/null
@@ -1,7 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -export {}; -//# sourceMappingURL=adapter.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/menusurface/lib/constants.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/menusurface/lib/constants.d.ts deleted file mode 100644 index b79db86..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/menusurface/lib/constants.d.ts +++ /dev/null
@@ -1,71 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -declare const cssClasses: { - ANCHOR: string; - ANIMATING_CLOSED: string; - ANIMATING_OPEN: string; - FIXED: string; - IS_OPEN_BELOW: string; - OPEN: string; - ROOT: string; -}; -declare const strings: { - CLOSED_EVENT: string; - CLOSING_EVENT: string; - OPENED_EVENT: string; - OPENING_EVENT: string; - FOCUSABLE_ELEMENTS: string; -}; -declare const numbers: { - /** Total duration of menu-surface open animation. */ - TRANSITION_OPEN_DURATION: number; - /** Total duration of menu-surface close animation. */ - TRANSITION_CLOSE_DURATION: number; - /** - * Margin left to the edge of the viewport when menu-surface is at maximum - * possible height. Also used as a viewport margin. - */ - MARGIN_TO_EDGE: number; - /** - * Ratio of anchor width to menu-surface width for switching from corner - * positioning to center positioning. - */ - ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO: number; - /** - * Amount of time to wait before restoring focus when closing the menu - * surface. This is important because if a touch event triggered the menu - * close, and the subsequent mouse event occurs after focus is restored, then - * the restored focus would be lost. - */ - TOUCH_EVENT_WAIT_MS: number; -}; -/** - * Enum for bits in the {@see Corner) bitmap. - */ -declare enum CornerBit { - BOTTOM = 1, - CENTER = 2, - RIGHT = 4, - FLIP_RTL = 8 -} -/** - * Enum for representing an element corner for positioning the menu-surface. - * - * The START constants map to LEFT if element directionality is left - * to right and RIGHT if the directionality is right to left. - * Likewise END maps to RIGHT or LEFT depending on the directionality. - */ -declare enum Corner { - TOP_LEFT = 0, - TOP_RIGHT = 4, - BOTTOM_LEFT = 1, - BOTTOM_RIGHT = 5, - TOP_START = 8, - TOP_END = 12, - BOTTOM_START = 9, - BOTTOM_END = 13 -} -export { cssClasses, strings, numbers, CornerBit, Corner };
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/menusurface/lib/constants.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/menusurface/lib/constants.js deleted file mode 100644 index b04e52c7..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/menusurface/lib/constants.js +++ /dev/null
@@ -1,83 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -const cssClasses = { - ANCHOR: 'md3-menu-surface--anchor', - ANIMATING_CLOSED: 'md3-menu-surface--animating-closed', - ANIMATING_OPEN: 'md3-menu-surface--animating-open', - FIXED: 'md3-menu-surface--fixed', - IS_OPEN_BELOW: 'md3-menu-surface--is-open-below', - OPEN: 'md3-menu-surface--open', - ROOT: 'md3-menu-surface', -}; -// tslint:disable:object-literal-sort-keys -const strings = { - CLOSED_EVENT: 'MDCMenuSurface:closed', - CLOSING_EVENT: 'MDCMenuSurface:closing', - OPENED_EVENT: 'MDCMenuSurface:opened', - OPENING_EVENT: 'MDCMenuSurface:opening', - FOCUSABLE_ELEMENTS: [ - 'button:not(:disabled)', - '[href]:not([aria-disabled="true"])', - 'input:not(:disabled)', - 'select:not(:disabled)', - 'textarea:not(:disabled)', - '[tabindex]:not([tabindex="-1"]):not([aria-disabled="true"])', - ].join(', '), -}; -// tslint:enable:object-literal-sort-keys -const numbers = { - /** Total duration of menu-surface open animation. */ - TRANSITION_OPEN_DURATION: 120, - /** Total duration of menu-surface close animation. */ - TRANSITION_CLOSE_DURATION: 75, - /** - * Margin left to the edge of the viewport when menu-surface is at maximum - * possible height. Also used as a viewport margin. - */ - MARGIN_TO_EDGE: 32, - /** - * Ratio of anchor width to menu-surface width for switching from corner - * positioning to center positioning. - */ - ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO: 0.67, - /** - * Amount of time to wait before restoring focus when closing the menu - * surface. This is important because if a touch event triggered the menu - * close, and the subsequent mouse event occurs after focus is restored, then - * the restored focus would be lost. - */ - TOUCH_EVENT_WAIT_MS: 30, -}; -/** - * Enum for bits in the {@see Corner) bitmap. - */ -var CornerBit; -(function (CornerBit) { - CornerBit[CornerBit["BOTTOM"] = 1] = "BOTTOM"; - CornerBit[CornerBit["CENTER"] = 2] = "CENTER"; - CornerBit[CornerBit["RIGHT"] = 4] = "RIGHT"; - CornerBit[CornerBit["FLIP_RTL"] = 8] = "FLIP_RTL"; -})(CornerBit || (CornerBit = {})); -/** - * Enum for representing an element corner for positioning the menu-surface. - * - * The START constants map to LEFT if element directionality is left - * to right and RIGHT if the directionality is right to left. - * Likewise END maps to RIGHT or LEFT depending on the directionality. - */ -var Corner; -(function (Corner) { - Corner[Corner["TOP_LEFT"] = 0] = "TOP_LEFT"; - Corner[Corner["TOP_RIGHT"] = 4] = "TOP_RIGHT"; - Corner[Corner["BOTTOM_LEFT"] = 1] = "BOTTOM_LEFT"; - Corner[Corner["BOTTOM_RIGHT"] = 5] = "BOTTOM_RIGHT"; - Corner[Corner["TOP_START"] = 8] = "TOP_START"; - Corner[Corner["TOP_END"] = 12] = "TOP_END"; - Corner[Corner["BOTTOM_START"] = 9] = "BOTTOM_START"; - Corner[Corner["BOTTOM_END"] = 13] = "BOTTOM_END"; -})(Corner || (Corner = {})); -export { cssClasses, strings, numbers, CornerBit, Corner }; -//# sourceMappingURL=constants.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/menusurface/lib/foundation.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/menusurface/lib/foundation.d.ts deleted file mode 100644 index bc41fdc7..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/menusurface/lib/foundation.d.ts +++ /dev/null
@@ -1,176 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { MDCMenuSurfaceAdapter } from './adapter.js'; -import { Corner } from './constants.js'; -import { MDCMenuDistance } from './types.js'; -export declare class MDCMenuSurfaceFoundation { - static get cssClasses(): { - ANCHOR: string; - ANIMATING_CLOSED: string; - ANIMATING_OPEN: string; - FIXED: string; - IS_OPEN_BELOW: string; - OPEN: string; - ROOT: string; - }; - static get strings(): { - CLOSED_EVENT: string; - CLOSING_EVENT: string; - OPENED_EVENT: string; - OPENING_EVENT: string; - FOCUSABLE_ELEMENTS: string; - }; - static get numbers(): { - TRANSITION_OPEN_DURATION: number; - TRANSITION_CLOSE_DURATION: number; - MARGIN_TO_EDGE: number; - ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO: number; - TOUCH_EVENT_WAIT_MS: number; - }; - static get Corner(): typeof Corner; - /** - * @see {@link MDCMenuSurfaceAdapter} for typing information on parameters and return types. - */ - static get defaultAdapter(): MDCMenuSurfaceAdapter; - private readonly adapter; - private isSurfaceOpen; - private isQuickOpen; - private isHoistedElement; - private isFixedPosition; - private isHorizontallyCenteredOnViewport; - private maxHeight; - private openBottomBias; - private openAnimationEndTimerId; - private closeAnimationEndTimerId; - private animationRequestId; - private anchorCorner; - /** - * Corner of the menu surface to which menu surface is attached to anchor. - * - * Anchor corner --->+----------+ - * | ANCHOR | - * +----------+ - * Origin corner --->+--------------+ - * | | - * | | - * | MENU SURFACE | - * | | - * | | - * +--------------+ - */ - private originCorner; - private readonly anchorMargin; - private readonly position; - private dimensions; - private measurements; - constructor(adapter: Partial<MDCMenuSurfaceAdapter>); - init(): void; - destroy(): void; - /** - * @param corner Default anchor corner alignment of top-left menu surface - * corner. - */ - setAnchorCorner(corner: Corner): void; - /** - * Flips menu corner horizontally. - */ - flipCornerHorizontally(): void; - /** - * @param margin Set of margin values from anchor. - */ - setAnchorMargin(margin: Partial<MDCMenuDistance>): void; - /** Used to indicate if the menu-surface is hoisted to the body. */ - setIsHoisted(isHoisted: boolean): void; - /** - * Used to set the menu-surface calculations based on a fixed position menu. - */ - setFixedPosition(isFixedPosition: boolean): void; - /** - * @return Returns true if menu is in fixed (`position: fixed`) position. - */ - isFixed(): boolean; - /** Sets the menu-surface position on the page. */ - setAbsolutePosition(x: number, y: number): void; - /** Sets whether menu-surface should be horizontally centered to viewport. */ - setIsHorizontallyCenteredOnViewport(isCentered: boolean): void; - setQuickOpen(quickOpen: boolean): void; - /** - * Sets maximum menu-surface height on open. - * @param maxHeight The desired max-height. Set to 0 (default) to - * automatically calculate max height based on available viewport space. - */ - setMaxHeight(maxHeight: number): void; - /** - * Set to a positive integer to influence the menu to preferentially open - * below the anchor instead of above. - * @param bias A value of `x` simulates an extra `x` pixels of available space - * below the menu during positioning calculations. - */ - setOpenBottomBias(bias: number): void; - isOpen(): boolean; - /** - * Open the menu surface. - */ - open(): void; - /** - * Closes the menu surface. - */ - close(skipRestoreFocus?: boolean): void; - /** Handle clicks and close if not within menu-surface element. */ - handleBodyClick(evt: MouseEvent): void; - /** Handle keys that close the surface. */ - handleKeydown(evt: KeyboardEvent): void; - private autoposition; - /** - * @return Measurements used to position menu surface popup. - */ - private getAutoLayoutmeasurements; - /** - * Computes the corner of the anchor from which to animate and position the - * menu surface. - * - * Only LEFT or RIGHT bit is used to position the menu surface ignoring RTL - * context. E.g., menu surface will be positioned from right side on TOP_END. - */ - private getOriginCorner; - /** - * @param corner Origin corner of the menu surface. - * @return Maximum height of the menu surface, based on available space. 0 - * indicates should not be set. - */ - private getMenuSurfaceMaxHeight; - /** - * @param corner Origin corner of the menu surface. - * @return Horizontal offset of menu surface origin corner from corresponding - * anchor corner. - */ - private getHorizontalOriginOffset; - /** - * @param corner Origin corner of the menu surface. - * @return Vertical offset of menu surface origin corner from corresponding - * anchor corner. - */ - private getVerticalOriginOffset; - /** - * Calculates the offsets for positioning the menu-surface when the - * menu-surface has been hoisted to the body. - */ - private adjustPositionForHoistedElement; - /** - * The last focused element when the menu surface was opened should regain - * focus, if the user is focused on or within the menu surface when it is - * closed. - */ - private maybeRestoreFocus; - private hasBit; - private setBit; - private unsetBit; - /** - * isFinite that doesn't force conversion to number type. - * Equivalent to Number.isFinite in ES2015, which is not supported in IE. - */ - private isFinite; -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/menusurface/lib/foundation.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/menusurface/lib/foundation.js deleted file mode 100644 index 5ca637b3..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/menusurface/lib/foundation.js +++ /dev/null
@@ -1,544 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { Corner, CornerBit, cssClasses, numbers, strings } from './constants.js'; -export class MDCMenuSurfaceFoundation { - constructor(adapter) { - this.isSurfaceOpen = false; - this.isQuickOpen = false; - this.isHoistedElement = false; - this.isFixedPosition = false; - this.isHorizontallyCenteredOnViewport = false; - this.maxHeight = 0; - this.openBottomBias = 0; - this.openAnimationEndTimerId = 0; - this.closeAnimationEndTimerId = 0; - this.animationRequestId = 0; - this.anchorCorner = Corner.TOP_START; - /** - * Corner of the menu surface to which menu surface is attached to anchor. - * - * Anchor corner --->+----------+ - * | ANCHOR | - * +----------+ - * Origin corner --->+--------------+ - * | | - * | | - * | MENU SURFACE | - * | | - * | | - * +--------------+ - */ - this.originCorner = Corner.TOP_START; - this.anchorMargin = { top: 0, right: 0, bottom: 0, left: 0 }; - this.position = { x: 0, y: 0 }; - this.adapter = { ...MDCMenuSurfaceFoundation.defaultAdapter, ...adapter }; - } - static get cssClasses() { - return cssClasses; - } - static get strings() { - return strings; - } - static get numbers() { - return numbers; - } - static get Corner() { - return Corner; - } - /** - * @see {@link MDCMenuSurfaceAdapter} for typing information on parameters and return types. - */ - static get defaultAdapter() { - // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface. - return { - addClass: () => undefined, - removeClass: () => undefined, - hasClass: () => false, - hasAnchor: () => false, - isElementInContainer: () => false, - isFocused: () => false, - isRtl: () => false, - getInnerDimensions: () => ({ height: 0, width: 0 }), - getAnchorDimensions: () => null, - getWindowDimensions: () => ({ height: 0, width: 0 }), - getBodyDimensions: () => ({ height: 0, width: 0 }), - getWindowScroll: () => ({ x: 0, y: 0 }), - setPosition: () => undefined, - setMaxHeight: () => undefined, - setTransformOrigin: () => undefined, - saveFocus: () => undefined, - restoreFocus: () => undefined, - notifyClose: () => undefined, - notifyClosing: () => undefined, - notifyOpen: () => undefined, - notifyOpening: () => undefined, - }; - // tslint:enable:object-literal-sort-keys - } - init() { - const { ROOT, OPEN } = MDCMenuSurfaceFoundation.cssClasses; - if (!this.adapter.hasClass(ROOT)) { - throw new Error(`${ROOT} class required in root element.`); - } - if (this.adapter.hasClass(OPEN)) { - this.isSurfaceOpen = true; - } - } - destroy() { - clearTimeout(this.openAnimationEndTimerId); - clearTimeout(this.closeAnimationEndTimerId); - // Cancel any currently running animations. - cancelAnimationFrame(this.animationRequestId); - } - /** - * @param corner Default anchor corner alignment of top-left menu surface - * corner. - */ - setAnchorCorner(corner) { - this.anchorCorner = corner; - } - /** - * Flips menu corner horizontally. - */ - flipCornerHorizontally() { - this.originCorner = this.originCorner ^ CornerBit.RIGHT; - } - /** - * @param margin Set of margin values from anchor. - */ - setAnchorMargin(margin) { - this.anchorMargin.top = margin.top || 0; - this.anchorMargin.right = margin.right || 0; - this.anchorMargin.bottom = margin.bottom || 0; - this.anchorMargin.left = margin.left || 0; - } - /** Used to indicate if the menu-surface is hoisted to the body. */ - setIsHoisted(isHoisted) { - this.isHoistedElement = isHoisted; - } - /** - * Used to set the menu-surface calculations based on a fixed position menu. - */ - setFixedPosition(isFixedPosition) { - this.isFixedPosition = isFixedPosition; - } - /** - * @return Returns true if menu is in fixed (`position: fixed`) position. - */ - isFixed() { - return this.isFixedPosition; - } - /** Sets the menu-surface position on the page. */ - setAbsolutePosition(x, y) { - this.position.x = this.isFinite(x) ? x : 0; - this.position.y = this.isFinite(y) ? y : 0; - } - /** Sets whether menu-surface should be horizontally centered to viewport. */ - setIsHorizontallyCenteredOnViewport(isCentered) { - this.isHorizontallyCenteredOnViewport = isCentered; - } - setQuickOpen(quickOpen) { - this.isQuickOpen = quickOpen; - } - /** - * Sets maximum menu-surface height on open. - * @param maxHeight The desired max-height. Set to 0 (default) to - * automatically calculate max height based on available viewport space. - */ - setMaxHeight(maxHeight) { - this.maxHeight = maxHeight; - } - /** - * Set to a positive integer to influence the menu to preferentially open - * below the anchor instead of above. - * @param bias A value of `x` simulates an extra `x` pixels of available space - * below the menu during positioning calculations. - */ - setOpenBottomBias(bias) { - this.openBottomBias = bias; - } - isOpen() { - return this.isSurfaceOpen; - } - /** - * Open the menu surface. - */ - open() { - if (this.isSurfaceOpen) { - return; - } - this.adapter.notifyOpening(); - this.adapter.saveFocus(); - if (this.isQuickOpen) { - this.isSurfaceOpen = true; - this.adapter.addClass(MDCMenuSurfaceFoundation.cssClasses.OPEN); - this.dimensions = this.adapter.getInnerDimensions(); - this.autoposition(); - this.adapter.notifyOpen(); - } - else { - this.adapter.addClass(MDCMenuSurfaceFoundation.cssClasses.ANIMATING_OPEN); - this.animationRequestId = requestAnimationFrame(() => { - this.dimensions = this.adapter.getInnerDimensions(); - this.autoposition(); - this.adapter.addClass(MDCMenuSurfaceFoundation.cssClasses.OPEN); - this.openAnimationEndTimerId = setTimeout(() => { - this.openAnimationEndTimerId = 0; - this.adapter.removeClass(MDCMenuSurfaceFoundation.cssClasses.ANIMATING_OPEN); - this.adapter.notifyOpen(); - }, numbers.TRANSITION_OPEN_DURATION); - }); - this.isSurfaceOpen = true; - } - } - /** - * Closes the menu surface. - */ - close(skipRestoreFocus = false) { - if (!this.isSurfaceOpen) { - return; - } - this.adapter.notifyClosing(); - if (this.isQuickOpen) { - this.isSurfaceOpen = false; - if (!skipRestoreFocus) { - this.maybeRestoreFocus(); - } - this.adapter.removeClass(MDCMenuSurfaceFoundation.cssClasses.OPEN); - this.adapter.removeClass(MDCMenuSurfaceFoundation.cssClasses.IS_OPEN_BELOW); - this.adapter.notifyClose(); - return; - } - this.adapter.addClass(MDCMenuSurfaceFoundation.cssClasses.ANIMATING_CLOSED); - requestAnimationFrame(() => { - this.adapter.removeClass(MDCMenuSurfaceFoundation.cssClasses.OPEN); - this.adapter.removeClass(MDCMenuSurfaceFoundation.cssClasses.IS_OPEN_BELOW); - this.closeAnimationEndTimerId = setTimeout(() => { - this.closeAnimationEndTimerId = 0; - this.adapter.removeClass(MDCMenuSurfaceFoundation.cssClasses.ANIMATING_CLOSED); - this.adapter.notifyClose(); - }, numbers.TRANSITION_CLOSE_DURATION); - }); - this.isSurfaceOpen = false; - if (!skipRestoreFocus) { - this.maybeRestoreFocus(); - } - } - /** Handle clicks and close if not within menu-surface element. */ - handleBodyClick(evt) { - const el = evt.target; - if (this.adapter.isElementInContainer(el)) { - return; - } - this.close(); - } - /** Handle keys that close the surface. */ - handleKeydown(evt) { - const { keyCode, key } = evt; - const isEscape = key === 'Escape' || keyCode === 27; - if (isEscape) { - this.close(); - } - } - autoposition() { - // Compute measurements for autoposition methods reuse. - this.measurements = this.getAutoLayoutmeasurements(); - const corner = this.getOriginCorner(); - const maxMenuSurfaceHeight = this.getMenuSurfaceMaxHeight(corner); - const verticalAlignment = this.hasBit(corner, CornerBit.BOTTOM) ? 'bottom' : 'top'; - let horizontalAlignment = this.hasBit(corner, CornerBit.RIGHT) ? 'right' : 'left'; - const horizontalOffset = this.getHorizontalOriginOffset(corner); - const verticalOffset = this.getVerticalOriginOffset(corner); - const { anchorSize, surfaceSize } = this.measurements; - const position = { - [horizontalAlignment]: horizontalOffset, - [verticalAlignment]: verticalOffset, - }; - // Center align when anchor width is comparable or greater than menu - // surface, otherwise keep corner. - if (anchorSize.width / surfaceSize.width > - numbers.ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO) { - horizontalAlignment = 'center'; - } - // If the menu-surface has been hoisted to the body, it's no longer relative - // to the anchor element - if (this.isHoistedElement || this.isFixedPosition) { - this.adjustPositionForHoistedElement(position); - } - this.adapter.setTransformOrigin(`${horizontalAlignment} ${verticalAlignment}`); - this.adapter.setPosition(position); - this.adapter.setMaxHeight(maxMenuSurfaceHeight ? maxMenuSurfaceHeight + 'px' : ''); - // If it is opened from the top then add is-open-below class - if (!this.hasBit(corner, CornerBit.BOTTOM)) { - this.adapter.addClass(MDCMenuSurfaceFoundation.cssClasses.IS_OPEN_BELOW); - } - } - /** - * @return Measurements used to position menu surface popup. - */ - getAutoLayoutmeasurements() { - let anchorRect = this.adapter.getAnchorDimensions(); - const bodySize = this.adapter.getBodyDimensions(); - const viewportSize = this.adapter.getWindowDimensions(); - const windowScroll = this.adapter.getWindowScroll(); - if (!anchorRect) { - // tslint:disable:object-literal-sort-keys Positional properties are more readable when they're grouped together - anchorRect = { - top: this.position.y, - right: this.position.x, - bottom: this.position.y, - left: this.position.x, - width: 0, - height: 0, - }; - // tslint:enable:object-literal-sort-keys - } - return { - anchorSize: anchorRect, - bodySize, - surfaceSize: this.dimensions, - viewportDistance: { - // tslint:disable:object-literal-sort-keys Positional properties are more readable when they're grouped together - top: anchorRect.top, - right: viewportSize.width - anchorRect.right, - bottom: viewportSize.height - anchorRect.bottom, - left: anchorRect.left, - // tslint:enable:object-literal-sort-keys - }, - viewportSize, - windowScroll, - }; - } - /** - * Computes the corner of the anchor from which to animate and position the - * menu surface. - * - * Only LEFT or RIGHT bit is used to position the menu surface ignoring RTL - * context. E.g., menu surface will be positioned from right side on TOP_END. - */ - getOriginCorner() { - let corner = this.originCorner; - const { viewportDistance, anchorSize, surfaceSize } = this.measurements; - const { MARGIN_TO_EDGE } = MDCMenuSurfaceFoundation.numbers; - const isAnchoredToBottom = this.hasBit(this.anchorCorner, CornerBit.BOTTOM); - let availableTop; - let availableBottom; - if (isAnchoredToBottom) { - availableTop = - viewportDistance.top - MARGIN_TO_EDGE + this.anchorMargin.bottom; - availableBottom = - viewportDistance.bottom - MARGIN_TO_EDGE - this.anchorMargin.bottom; - } - else { - availableTop = - viewportDistance.top - MARGIN_TO_EDGE + this.anchorMargin.top; - availableBottom = viewportDistance.bottom - MARGIN_TO_EDGE + - anchorSize.height - this.anchorMargin.top; - } - const isAvailableBottom = availableBottom - surfaceSize.height > 0; - if (!isAvailableBottom && - availableTop > availableBottom + this.openBottomBias) { - // Attach bottom side of surface to the anchor. - corner = this.setBit(corner, CornerBit.BOTTOM); - } - const isRtl = this.adapter.isRtl(); - const isFlipRtl = this.hasBit(this.anchorCorner, CornerBit.FLIP_RTL); - const hasRightBit = this.hasBit(this.anchorCorner, CornerBit.RIGHT) || - this.hasBit(corner, CornerBit.RIGHT); - // Whether surface attached to right side of anchor element. - let isAnchoredToRight = false; - // Anchored to start - if (isRtl && isFlipRtl) { - isAnchoredToRight = !hasRightBit; - } - else { - // Anchored to right - isAnchoredToRight = hasRightBit; - } - let availableLeft; - let availableRight; - if (isAnchoredToRight) { - availableLeft = - viewportDistance.left + anchorSize.width + this.anchorMargin.right; - availableRight = viewportDistance.right - this.anchorMargin.right; - } - else { - availableLeft = viewportDistance.left + this.anchorMargin.left; - availableRight = - viewportDistance.right + anchorSize.width - this.anchorMargin.left; - } - const isAvailableLeft = availableLeft - surfaceSize.width > 0; - const isAvailableRight = availableRight - surfaceSize.width > 0; - const isOriginCornerAlignedToEnd = this.hasBit(corner, CornerBit.FLIP_RTL) && - this.hasBit(corner, CornerBit.RIGHT); - if (isAvailableRight && isOriginCornerAlignedToEnd && isRtl || - !isAvailableLeft && isOriginCornerAlignedToEnd) { - // Attach left side of surface to the anchor. - corner = this.unsetBit(corner, CornerBit.RIGHT); - } - else if (isAvailableLeft && isAnchoredToRight && isRtl || - (isAvailableLeft && !isAnchoredToRight && hasRightBit) || - (!isAvailableRight && availableLeft >= availableRight)) { - // Attach right side of surface to the anchor. - corner = this.setBit(corner, CornerBit.RIGHT); - } - return corner; - } - /** - * @param corner Origin corner of the menu surface. - * @return Maximum height of the menu surface, based on available space. 0 - * indicates should not be set. - */ - getMenuSurfaceMaxHeight(corner) { - if (this.maxHeight > 0) { - return this.maxHeight; - } - const { viewportDistance } = this.measurements; - let maxHeight = 0; - const isBottomAligned = this.hasBit(corner, CornerBit.BOTTOM); - const isBottomAnchored = this.hasBit(this.anchorCorner, CornerBit.BOTTOM); - const { MARGIN_TO_EDGE } = MDCMenuSurfaceFoundation.numbers; - // When maximum height is not specified, it is handled from CSS. - if (isBottomAligned) { - maxHeight = viewportDistance.top + this.anchorMargin.top - MARGIN_TO_EDGE; - if (!isBottomAnchored) { - maxHeight += this.measurements.anchorSize.height; - } - } - else { - maxHeight = viewportDistance.bottom - this.anchorMargin.bottom + - this.measurements.anchorSize.height - MARGIN_TO_EDGE; - if (isBottomAnchored) { - maxHeight -= this.measurements.anchorSize.height; - } - } - return maxHeight; - } - /** - * @param corner Origin corner of the menu surface. - * @return Horizontal offset of menu surface origin corner from corresponding - * anchor corner. - */ - getHorizontalOriginOffset(corner) { - const { anchorSize } = this.measurements; - // isRightAligned corresponds to using the 'right' property on the surface. - const isRightAligned = this.hasBit(corner, CornerBit.RIGHT); - const avoidHorizontalOverlap = this.hasBit(this.anchorCorner, CornerBit.RIGHT); - if (isRightAligned) { - const rightOffset = avoidHorizontalOverlap ? - anchorSize.width - this.anchorMargin.left : - this.anchorMargin.right; - // For hoisted or fixed elements, adjust the offset by the difference - // between viewport width and body width so when we calculate the right - // value (`adjustPositionForHoistedElement`) based on the element - // position, the right property is correct. - if (this.isHoistedElement || this.isFixedPosition) { - return rightOffset - - (this.measurements.viewportSize.width - - this.measurements.bodySize.width); - } - return rightOffset; - } - return avoidHorizontalOverlap ? anchorSize.width - this.anchorMargin.right : - this.anchorMargin.left; - } - /** - * @param corner Origin corner of the menu surface. - * @return Vertical offset of menu surface origin corner from corresponding - * anchor corner. - */ - getVerticalOriginOffset(corner) { - const { anchorSize } = this.measurements; - const isBottomAligned = this.hasBit(corner, CornerBit.BOTTOM); - const avoidVerticalOverlap = this.hasBit(this.anchorCorner, CornerBit.BOTTOM); - let y = 0; - if (isBottomAligned) { - y = avoidVerticalOverlap ? anchorSize.height - this.anchorMargin.top : - -this.anchorMargin.bottom; - } - else { - y = avoidVerticalOverlap ? - (anchorSize.height + this.anchorMargin.bottom) : - this.anchorMargin.top; - } - return y; - } - /** - * Calculates the offsets for positioning the menu-surface when the - * menu-surface has been hoisted to the body. - */ - adjustPositionForHoistedElement(position) { - const { windowScroll, viewportDistance, surfaceSize, viewportSize } = this.measurements; - const props = Object.keys(position); - for (const prop of props) { - let value = position[prop] || 0; - if (this.isHorizontallyCenteredOnViewport && - (prop === 'left' || prop === 'right')) { - position[prop] = (viewportSize.width - surfaceSize.width) / 2; - continue; - } - // Hoisted surfaces need to have the anchor elements location on the page - // added to the position properties for proper alignment on the body. - value += viewportDistance[prop]; - // Surfaces that are absolutely positioned need to have additional - // calculations for scroll and bottom positioning. - if (!this.isFixedPosition) { - if (prop === 'top') { - value += windowScroll.y; - } - else if (prop === 'bottom') { - value -= windowScroll.y; - } - else if (prop === 'left') { - value += windowScroll.x; - } - else { // prop === 'right' - value -= windowScroll.x; - } - } - position[prop] = value; - } - } - /** - * The last focused element when the menu surface was opened should regain - * focus, if the user is focused on or within the menu surface when it is - * closed. - */ - maybeRestoreFocus() { - const isRootFocused = this.adapter.isFocused(); - const ownerDocument = this.adapter.getOwnerDocument ? - this.adapter.getOwnerDocument() : - document; - const childHasFocus = ownerDocument.activeElement && - this.adapter.isElementInContainer(ownerDocument.activeElement); - if (isRootFocused || childHasFocus) { - // Wait before restoring focus when closing the menu surface. This is - // important because if a touch event triggered the menu close, and the - // subsequent mouse event occurs after focus is restored, then the - // restored focus would be lost. - setTimeout(() => { - this.adapter.restoreFocus(); - }, numbers.TOUCH_EVENT_WAIT_MS); - } - } - hasBit(corner, bit) { - return Boolean(corner & bit); // tslint:disable-line:no-bitwise - } - setBit(corner, bit) { - return corner | bit; // tslint:disable-line:no-bitwise - } - unsetBit(corner, bit) { - return corner ^ bit; - } - /** - * isFinite that doesn't force conversion to number type. - * Equivalent to Number.isFinite in ES2015, which is not supported in IE. - */ - isFinite(num) { - return typeof num === 'number' && isFinite(num); - } -} -//# sourceMappingURL=foundation.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/menusurface/lib/menu-surface-styles.css.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/menusurface/lib/menu-surface-styles.css.d.ts deleted file mode 100644 index 1c75ade..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/menusurface/lib/menu-surface-styles.css.d.ts +++ /dev/null
@@ -1 +0,0 @@ -export declare const styles: import("lit").CSSResult;
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/menusurface/lib/menu-surface-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/menusurface/lib/menu-surface-styles.css.js deleted file mode 100644 index 3c2492c..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/menusurface/lib/menu-surface-styles.css.js +++ /dev/null
@@ -1,9 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { css } from 'lit'; -export const styles = css `:host{--_container-elevation: var(--md-menu-surface-container-elevation, 2);--_container-shadow-color: var(--md-menu-surface-container-shadow-color, var(--md-sys-color-shadow, #000));--_container-shape: var(--md-menu-surface-container-shape, 4px);--_container-surface-tint-layer-color: var(--md-menu-surface-container-surface-tint-layer-color, var(--md-sys-color-primary, #6750a4))}.md3-menu-surface{border-radius:var(--_container-shape);box-sizing:border-box;display:none;opacity:0;overflow:auto;margin:0;max-height:calc(100vh - 32px);max-width:calc(100vw - 32px);padding:0;position:absolute;transform:scale(1);transform-origin:top left;transition:opacity .03s linear,transform .12s cubic-bezier(0, 0, 0.2, 1),height 250ms cubic-bezier(0, 0, 0.2, 1);will-change:transform,opacity;z-index:8;--md-elevation-level:var(--_container-elevation);--md-elevation-shadow-color:var(--_container-shadow-color);--md-elevation-surface-tint:var(--_container-surface-tint-layer-color)}.md3-menu-surface md-elevation{z-index:0}.md3-menu-surface:focus{outline:none}.md3-menu-surface--animating-open{display:inline-block;opacity:0;transform:scale(0.8)}.md3-menu-surface--open{display:inline-block;opacity:1;transform:scale(1)}.md3-menu-surface--animating-closed{display:inline-block;opacity:0;transition:opacity .075s linear}.md3-menu-surface--anchor{overflow:visible;position:relative}.md3-menu-surface--fixed{position:fixed}.md3-menu-surface--fullwidth{width:100%}.md3-menu-surface--is-open-below{border-top-left-radius:0px;border-top-right-radius:0px}/*# sourceMappingURL=menu-surface-styles.css.map */ -`; -//# sourceMappingURL=menu-surface-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/menusurface/lib/menu-surface.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/menusurface/lib/menu-surface.d.ts deleted file mode 100644 index d42dd2f..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/menusurface/lib/menu-surface.d.ts +++ /dev/null
@@ -1,62 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import '../../elevation/elevation.js'; -import { LitElement, PropertyValues } from 'lit'; -import { ClassInfo } from 'lit/directives/class-map.js'; -import { MDCMenuSurfaceAdapter } from './adapter.js'; -import { Corner as CornerEnum } from './constants.js'; -import { MDCMenuSurfaceFoundation } from './foundation.js'; -export declare type Corner = keyof typeof CornerEnum; -export declare type AnchorableElement = HTMLElement & { - anchor: Element | null; -}; -/** - * @fires opened - * @fires closed - */ -export declare abstract class MenuSurface extends LitElement { - protected mdcFoundation: MDCMenuSurfaceFoundation; - mdcRoot: HTMLDivElement; - slotElement: HTMLSlotElement | null; - absolute: boolean; - fullwidth: boolean; - fixed: boolean; - x: number | null; - y: number | null; - quick: boolean; - open: boolean; - stayOpenOnBodyClick: boolean; - skipRestoreFocus: boolean; - protected previousFlipMenuHorizontally: boolean; - /** - * Whether to align the menu surface to the opposite side of the default - * alignment. - */ - flipMenuHorizontally: boolean; - corner: Corner; - protected styleTop: string; - protected styleLeft: string; - protected styleRight: string; - protected styleBottom: string; - protected styleMaxHeight: string; - protected styleTransformOrigin: string; - anchor: HTMLElement | null; - protected previouslyFocused: HTMLElement | Element | null; - protected previousAnchor: HTMLElement | null; - protected onBodyClickBound: (evt: MouseEvent) => void; - render(): import("lit-html").TemplateResult<1>; - /** @soyTemplate */ - protected getRenderClasses(): ClassInfo; - protected updated(changedProperties: PropertyValues<MenuSurface>): void; - protected firstUpdated(): void; - createAdapter(): MDCMenuSurfaceAdapter; - protected onKeydown(evt: KeyboardEvent): void; - protected onBodyClick(evt: MouseEvent): void; - protected registerBodyClick(): void; - protected deregisterBodyClick(): void; - close(): void; - show(): void; -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/menusurface/lib/menu-surface.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/menusurface/lib/menu-surface.js deleted file mode 100644 index 37c2bf4..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/menusurface/lib/menu-surface.js +++ /dev/null
@@ -1,347 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { __decorate, __metadata } from "tslib"; -// Style preference for leading underscores. -// tslint:disable:strip-private-property-underscore -import '../../elevation/elevation.js'; -import { html, LitElement } from 'lit'; -import { property, query, state } from 'lit/decorators.js'; -import { classMap } from 'lit/directives/class-map.js'; -import { styleMap } from 'lit/directives/style-map.js'; -import { isRtl } from '../../controller/is-rtl.js'; -import { Corner as CornerEnum } from './constants.js'; -import { MDCMenuSurfaceFoundation } from './foundation.js'; -// tslint:disable:no-bitwise -// required for closure compiler -const stringToCorner = { - 'TOP_LEFT': CornerEnum.TOP_LEFT, - 'TOP_RIGHT': CornerEnum.TOP_RIGHT, - 'BOTTOM_LEFT': CornerEnum.BOTTOM_LEFT, - 'BOTTOM_RIGHT': CornerEnum.BOTTOM_RIGHT, - 'TOP_START': CornerEnum.TOP_START, - 'TOP_END': CornerEnum.TOP_END, - 'BOTTOM_START': CornerEnum.BOTTOM_START, - 'BOTTOM_END': CornerEnum.BOTTOM_END, -}; -/** - * @fires opened - * @fires closed - */ -export class MenuSurface extends LitElement { - constructor() { - super(...arguments); - this.absolute = false; - this.fullwidth = false; - this.fixed = false; - this.x = null; - this.y = null; - // must be defined before open or else race condition in foundation occurs. - this.quick = false; - this.open = false; - this.stayOpenOnBodyClick = false; - this.skipRestoreFocus = false; - this.previousFlipMenuHorizontally = false; - /** - * Whether to align the menu surface to the opposite side of the default - * alignment. - */ - this.flipMenuHorizontally = false; - this.corner = 'BOTTOM_START'; - this.styleTop = ''; - this.styleLeft = ''; - this.styleRight = ''; - this.styleBottom = ''; - this.styleMaxHeight = ''; - this.styleTransformOrigin = ''; - this.anchor = null; - this.previouslyFocused = null; - this.previousAnchor = null; - this.onBodyClickBound = () => undefined; - } - render() { - const styles = { - 'top': this.styleTop, - 'left': this.styleLeft, - 'right': this.styleRight, - 'bottom': this.styleBottom, - 'max-height': this.styleMaxHeight, - 'transform-origin': this.styleTransformOrigin, - }; - return html ` - <div - class="md3-menu-surface ${classMap(this.getRenderClasses())}" - style="${styleMap(styles)}" - @keydown=${this.onKeydown} - @opened=${this.registerBodyClick} - @closed=${this.deregisterBodyClick}> - <md-elevation shadow></md-elevation> - <slot></slot> - </div>`; - } - /** @soyTemplate */ - getRenderClasses() { - return { - 'md3-menu-surface--fixed': this.fixed, - 'md3-menu-surface--fullwidth': this.fullwidth, - }; - } - updated(changedProperties) { - if (changedProperties.has('absolute') && !this.fixed) { - this.mdcFoundation.setIsHoisted(this.absolute); - } - if (changedProperties.has('fixed') && !this.absolute) { - this.mdcFoundation.setFixedPosition(this.fixed); - } - if ((changedProperties.has('x') || changedProperties.has('y')) && - this.x !== null && this.y !== null) { - this.mdcFoundation.setAbsolutePosition(this.x, this.y); - this.mdcFoundation.setAnchorMargin({ left: this.x, top: this.y, right: -this.y, bottom: this.y }); - } - if (changedProperties.has('quick')) { - this.mdcFoundation.setQuickOpen(this.quick); - } - if (changedProperties.has('open')) { - const wasOpen = changedProperties.get('open'); - if (this.open) { - this.mdcFoundation.open(); - // wasOpen helps with first render (when it is `undefined`) perf - } - else if (wasOpen !== undefined) { - this.mdcFoundation.close(this.skipRestoreFocus); - } - } - if (changedProperties.has('flipMenuHorizontally')) { - if (this.previousFlipMenuHorizontally !== this.flipMenuHorizontally) { - this.mdcFoundation.flipCornerHorizontally(); - } - this.previousFlipMenuHorizontally = this.flipMenuHorizontally; - } - if (changedProperties.has('corner') && this.corner) { - const bitwiseCorner = stringToCorner[this.corner]; - this.mdcFoundation.setAnchorCorner(bitwiseCorner); - } - } - firstUpdated() { - if (this.mdcFoundation !== undefined) { - this.mdcFoundation.destroy(); - } - this.mdcFoundation = new MDCMenuSurfaceFoundation(this.createAdapter()); - this.mdcFoundation.init(); - } - createAdapter() { - return { - addClass: (className) => { - this.mdcRoot.classList.add(className); - }, - removeClass: (className) => { - this.mdcRoot.classList.remove(className); - }, - hasClass: (className) => this.mdcRoot.classList.contains(className), - hasAnchor: () => { - return !!this.anchor; - }, - notifyClose: () => { - const init = { bubbles: true, composed: true }; - const ev = new CustomEvent('closed', init); - this.open = false; - this.mdcRoot.dispatchEvent(ev); - }, - notifyClosing: () => { - const init = { bubbles: true, composed: true }; - const ev = new CustomEvent('closing', init); - this.mdcRoot.dispatchEvent(ev); - }, - notifyOpen: () => { - const init = { bubbles: true, composed: true }; - const ev = new CustomEvent('opened', init); - this.open = true; - this.mdcRoot.dispatchEvent(ev); - }, - notifyOpening: () => { - const init = { bubbles: true, composed: true }; - const ev = new CustomEvent('opening', init); - this.mdcRoot.dispatchEvent(ev); - }, - isElementInContainer: () => false, - isRtl: () => this.mdcRoot ? isRtl(this.mdcRoot) : false, - setTransformOrigin: (origin) => { - const root = this.mdcRoot; - if (!root) { - return; - } - this.styleTransformOrigin = origin; - }, - isFocused: () => { - return this.matches(':focus-within'); - }, - saveFocus: () => { - this.previouslyFocused = document.activeElement; - }, - restoreFocus: () => { - if (!this.previouslyFocused) { - return; - } - if ('focus' in this.previouslyFocused) { - this.previouslyFocused.focus(); - } - }, - getInnerDimensions: () => { - const mdcRoot = this.mdcRoot; - if (!mdcRoot) { - return { width: 0, height: 0 }; - } - return { width: mdcRoot.offsetWidth, height: mdcRoot.offsetHeight }; - }, - getAnchorDimensions: () => { - const anchorElement = this.anchor; - return anchorElement ? anchorElement.getBoundingClientRect() : null; - }, - getBodyDimensions: () => { - return { - width: document.body.clientWidth, - height: document.body.clientHeight, - }; - }, - getWindowDimensions: () => { - return { - width: window.innerWidth, - height: window.innerHeight, - }; - }, - getWindowScroll: () => { - return { - x: window.pageXOffset, - y: window.pageYOffset, - }; - }, - setPosition: (position) => { - const mdcRoot = this.mdcRoot; - if (!mdcRoot) { - return; - } - this.styleLeft = 'left' in position ? `${position.left}px` : ''; - this.styleRight = 'right' in position ? `${position.right}px` : ''; - this.styleTop = 'top' in position ? `${position.top}px` : ''; - this.styleBottom = 'bottom' in position ? `${position.bottom}px` : ''; - }, - setMaxHeight: async (height) => { - const mdcRoot = this.mdcRoot; - if (!mdcRoot) { - return; - } - // must set both for IE support as IE will not set a var - this.styleMaxHeight = height; - await this.updateComplete; - this.styleMaxHeight = `var(--md3-menu-max-height, ${height})`; - }, - }; - } - onKeydown(evt) { - if (this.mdcFoundation) { - this.mdcFoundation.handleKeydown(evt); - } - } - onBodyClick(evt) { - if (this.stayOpenOnBodyClick) { - return; - } - const path = evt.composedPath(); - if (path.indexOf(this) === -1) { - this.close(); - } - } - registerBodyClick() { - this.onBodyClickBound = this.onBodyClick.bind(this); - // capture otherwise listener closes menu after quick menu opens - document.body.addEventListener('click', this.onBodyClickBound, { passive: true, capture: true }); - } - deregisterBodyClick() { - document.body.removeEventListener('click', this.onBodyClickBound, { capture: true }); - } - close() { - this.open = false; - } - show() { - this.open = true; - } -} -__decorate([ - query('.md3-menu-surface'), - __metadata("design:type", HTMLDivElement) -], MenuSurface.prototype, "mdcRoot", void 0); -__decorate([ - query('slot'), - __metadata("design:type", HTMLSlotElement) -], MenuSurface.prototype, "slotElement", void 0); -__decorate([ - property({ type: Boolean }), - __metadata("design:type", Object) -], MenuSurface.prototype, "absolute", void 0); -__decorate([ - property({ type: Boolean }), - __metadata("design:type", Object) -], MenuSurface.prototype, "fullwidth", void 0); -__decorate([ - property({ type: Boolean }), - __metadata("design:type", Object) -], MenuSurface.prototype, "fixed", void 0); -__decorate([ - property({ type: Number }), - __metadata("design:type", Number) -], MenuSurface.prototype, "x", void 0); -__decorate([ - property({ type: Number }), - __metadata("design:type", Number) -], MenuSurface.prototype, "y", void 0); -__decorate([ - property({ type: Boolean }), - __metadata("design:type", Object) -], MenuSurface.prototype, "quick", void 0); -__decorate([ - property({ type: Boolean, reflect: true }), - __metadata("design:type", Object) -], MenuSurface.prototype, "open", void 0); -__decorate([ - property({ type: Boolean }), - __metadata("design:type", Object) -], MenuSurface.prototype, "stayOpenOnBodyClick", void 0); -__decorate([ - property({ type: Boolean }), - __metadata("design:type", Object) -], MenuSurface.prototype, "skipRestoreFocus", void 0); -__decorate([ - property({ type: Boolean }), - __metadata("design:type", Object) -], MenuSurface.prototype, "flipMenuHorizontally", void 0); -__decorate([ - property({ type: String }), - __metadata("design:type", String) -], MenuSurface.prototype, "corner", void 0); -__decorate([ - state(), - __metadata("design:type", Object) -], MenuSurface.prototype, "styleTop", void 0); -__decorate([ - state(), - __metadata("design:type", Object) -], MenuSurface.prototype, "styleLeft", void 0); -__decorate([ - state(), - __metadata("design:type", Object) -], MenuSurface.prototype, "styleRight", void 0); -__decorate([ - state(), - __metadata("design:type", Object) -], MenuSurface.prototype, "styleBottom", void 0); -__decorate([ - state(), - __metadata("design:type", Object) -], MenuSurface.prototype, "styleMaxHeight", void 0); -__decorate([ - state(), - __metadata("design:type", Object) -], MenuSurface.prototype, "styleTransformOrigin", void 0); -//# sourceMappingURL=menu-surface.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/menusurface/lib/types.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/menusurface/lib/types.d.ts deleted file mode 100644 index 2e5f64c..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/menusurface/lib/types.d.ts +++ /dev/null
@@ -1,19 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -export interface MDCMenuDimensions { - width: number; - height: number; -} -export interface MDCMenuDistance { - top: number; - right: number; - bottom: number; - left: number; -} -export interface MDCMenuPoint { - x: number; - y: number; -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/menusurface/lib/types.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/menusurface/lib/types.js deleted file mode 100644 index ba75424e..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/menusurface/lib/types.js +++ /dev/null
@@ -1,7 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -export {}; -//# sourceMappingURL=types.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/menusurface/menu-surface.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/menusurface/menu-surface.d.ts deleted file mode 100644 index c6fd7b4..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/menusurface/menu-surface.d.ts +++ /dev/null
@@ -1,14 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { MenuSurface } from './lib/menu-surface.js'; -declare global { - interface HTMLElementTagNameMap { - 'md-menu-surface': MdMenuSurface; - } -} -export declare class MdMenuSurface extends MenuSurface { - static styles: import("lit").CSSResult[]; -}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/menusurface/menu-surface.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/menusurface/menu-surface.js deleted file mode 100644 index 5b3c3ce..0000000 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/menusurface/menu-surface.js +++ /dev/null
@@ -1,17 +0,0 @@ -/** - * @license - * Copyright 2022 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ -import { __decorate } from "tslib"; -import { customElement } from 'lit/decorators.js'; -import { MenuSurface } from './lib/menu-surface.js'; -import { styles } from './lib/menu-surface-styles.css.js'; -let MdMenuSurface = class MdMenuSurface extends MenuSurface { -}; -MdMenuSurface.styles = [styles]; -MdMenuSurface = __decorate([ - customElement('md-menu-surface') -], MdMenuSurface); -export { MdMenuSurface }; -//# sourceMappingURL=menu-surface.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationbar/lib/constants.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationbar/lib/constants.d.ts index 0402705..9b6526393 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationbar/lib/constants.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationbar/lib/constants.d.ts
@@ -14,4 +14,4 @@ /** * NavigationTabInteractionEvent is the custom event for the interaction event. */ -export declare type NavigationTabInteractionEvent = CustomEvent<MDCNavigationTabInteractionEventDetail>; +export type NavigationTabInteractionEvent = CustomEvent<MDCNavigationTabInteractionEventDetail>;
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationbar/lib/navigation-bar-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationbar/lib/navigation-bar-styles.css.js index afe5268..b8cb7dd 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationbar/lib/navigation-bar-styles.css.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationbar/lib/navigation-bar-styles.css.js
@@ -4,6 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ import { css } from 'lit'; -export const styles = css `:host{--_active-indicator-color: var(--md-navigation-bar-active-indicator-color, var(--md-sys-color-secondary-container, #e8def8));--_active-indicator-height: var(--md-navigation-bar-active-indicator-height, 32px);--_active-indicator-shape: var(--md-navigation-bar-active-indicator-shape, 9999px);--_active-indicator-width: var(--md-navigation-bar-active-indicator-width, 64px);--_active-focus-icon-color: var(--md-navigation-bar-active-focus-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_active-focus-label-text-color: var(--md-navigation-bar-active-focus-label-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_active-focus-state-layer-color: var(--md-navigation-bar-active-focus-state-layer-color, var(--md-sys-color-on-surface, #1c1b1f));--_active-hover-icon-color: var(--md-navigation-bar-active-hover-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_active-hover-label-text-color: var(--md-navigation-bar-active-hover-label-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_active-hover-state-layer-color: var(--md-navigation-bar-active-hover-state-layer-color, var(--md-sys-color-on-surface, #1c1b1f));--_active-icon-color: var(--md-navigation-bar-active-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_active-label-text-color: var(--md-navigation-bar-active-label-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_active-label-text-weight: var(--md-navigation-bar-active-label-text-weight, 700);--_active-pressed-icon-color: var(--md-navigation-bar-active-pressed-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_active-pressed-label-text-color: var(--md-navigation-bar-active-pressed-label-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_active-pressed-state-layer-color: var(--md-navigation-bar-active-pressed-state-layer-color, var(--md-sys-color-on-surface, #1c1b1f));--_container-color: var(--md-navigation-bar-container-color, var(--md-sys-color-surface, #fffbfe));--_container-elevation: var(--md-navigation-bar-container-elevation, 2);--_container-height: var(--md-navigation-bar-container-height, 80px);--_container-shape: var(--md-navigation-bar-container-shape, 0px);--_container-surface-tint-layer-color: var(--md-navigation-bar-container-surface-tint-layer-color, var(--md-sys-color-primary, #6750a4));--_focus-state-layer-opacity: var(--md-navigation-bar-focus-state-layer-opacity, 0.12);--_hover-state-layer-opacity: var(--md-navigation-bar-hover-state-layer-opacity, 0.08);--_icon-size: var(--md-navigation-bar-icon-size, 24px);--_inactive-focus-icon-color: var(--md-navigation-bar-inactive-focus-icon-color, var(--md-sys-color-on-surface, #1c1b1f));--_inactive-focus-label-text-color: var(--md-navigation-bar-inactive-focus-label-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_inactive-focus-state-layer-color: var(--md-navigation-bar-inactive-focus-state-layer-color, var(--md-sys-color-on-surface, #1c1b1f));--_inactive-hover-icon-color: var(--md-navigation-bar-inactive-hover-icon-color, var(--md-sys-color-on-surface, #1c1b1f));--_inactive-hover-label-text-color: var(--md-navigation-bar-inactive-hover-label-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_inactive-hover-state-layer-color: var(--md-navigation-bar-inactive-hover-state-layer-color, var(--md-sys-color-on-surface, #1c1b1f));--_inactive-icon-color: var(--md-navigation-bar-inactive-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_inactive-label-text-color: var(--md-navigation-bar-inactive-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_inactive-pressed-icon-color: var(--md-navigation-bar-inactive-pressed-icon-color, var(--md-sys-color-on-surface, #1c1b1f));--_inactive-pressed-label-text-color: var(--md-navigation-bar-inactive-pressed-label-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_inactive-pressed-state-layer-color: var(--md-navigation-bar-inactive-pressed-state-layer-color, var(--md-sys-color-on-surface, #1c1b1f));--_label-text-font: var(--md-navigation-bar-label-text-font, Roboto);--_label-text-line-height: var(--md-navigation-bar-label-text-line-height, 1rem);--_label-text-size: var(--md-navigation-bar-label-text-size, 0.75rem);--_label-text-tracking: var(--md-navigation-bar-label-text-tracking, 0.031rem);--_label-text-type: var(--md-navigation-bar-label-text-type, 500 0.75rem / 1rem Roboto);--_label-text-weight: var(--md-navigation-bar-label-text-weight, 500);--_pressed-state-layer-opacity: var(--md-navigation-bar-pressed-state-layer-opacity, 0.12);--md-elevation-duration:280ms;--md-elevation-level:var(--_container-elevation);--md-elevation-shadow-color:var(--_container-shadow-color);--md-elevation-surface-tint:var(--_container-surface-tint-layer-color);width:100%}.md3-navigation-bar{display:flex;position:relative;width:100%;background-color:var(--_container-color);border-radius:var(--_container-shape);height:var(--_container-height)}.md3-navigation-bar .md3-navigation-bar__tabs-slot-container{display:inherit;width:inherit}md-elevation{inset:0;position:absolute;z-index:0}/*# sourceMappingURL=navigation-bar-styles.css.map */ +export const styles = css `:host{--_active-indicator-color: var(--md-navigation-bar-active-indicator-color, var(--md-sys-color-secondary-container, #e8def8));--_active-indicator-height: var(--md-navigation-bar-active-indicator-height, 32px);--_active-indicator-shape: var(--md-navigation-bar-active-indicator-shape, 9999px);--_active-indicator-width: var(--md-navigation-bar-active-indicator-width, 64px);--_active-focus-icon-color: var(--md-navigation-bar-active-focus-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_active-focus-label-text-color: var(--md-navigation-bar-active-focus-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_active-focus-state-layer-color: var(--md-navigation-bar-active-focus-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_active-hover-icon-color: var(--md-navigation-bar-active-hover-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_active-hover-label-text-color: var(--md-navigation-bar-active-hover-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_active-hover-state-layer-color: var(--md-navigation-bar-active-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_active-icon-color: var(--md-navigation-bar-active-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_active-label-text-color: var(--md-navigation-bar-active-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_active-label-text-weight: var(--md-navigation-bar-active-label-text-weight, 700);--_active-pressed-icon-color: var(--md-navigation-bar-active-pressed-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_active-pressed-label-text-color: var(--md-navigation-bar-active-pressed-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_active-pressed-state-layer-color: var(--md-navigation-bar-active-pressed-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_container-color: var(--md-navigation-bar-container-color, var(--md-sys-color-surface-container, #f3edf7));--_container-elevation: var(--md-navigation-bar-container-elevation, 2);--_container-height: var(--md-navigation-bar-container-height, 80px);--_container-shape: var(--md-navigation-bar-container-shape, 0px);--_focus-state-layer-opacity: var(--md-navigation-bar-focus-state-layer-opacity, 0.12);--_hover-state-layer-opacity: var(--md-navigation-bar-hover-state-layer-opacity, 0.08);--_icon-size: var(--md-navigation-bar-icon-size, 24px);--_inactive-focus-icon-color: var(--md-navigation-bar-inactive-focus-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_inactive-focus-label-text-color: var(--md-navigation-bar-inactive-focus-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_inactive-focus-state-layer-color: var(--md-navigation-bar-inactive-focus-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_inactive-hover-icon-color: var(--md-navigation-bar-inactive-hover-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_inactive-hover-label-text-color: var(--md-navigation-bar-inactive-hover-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_inactive-hover-state-layer-color: var(--md-navigation-bar-inactive-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_inactive-icon-color: var(--md-navigation-bar-inactive-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_inactive-label-text-color: var(--md-navigation-bar-inactive-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_inactive-pressed-icon-color: var(--md-navigation-bar-inactive-pressed-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_inactive-pressed-label-text-color: var(--md-navigation-bar-inactive-pressed-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_inactive-pressed-state-layer-color: var(--md-navigation-bar-inactive-pressed-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_label-text-font: var(--md-navigation-bar-label-text-font, var(--md-ref-typeface-plain, Roboto));--_label-text-line-height: var(--md-navigation-bar-label-text-line-height, 1rem);--_label-text-size: var(--md-navigation-bar-label-text-size, 0.75rem);--_label-text-tracking: var(--md-navigation-bar-label-text-tracking, 0.031rem);--_label-text-type: var(--md-navigation-bar-label-text-type, 500 0.75rem / 1rem var(--md-ref-typeface-plain, Roboto));--_label-text-weight: var(--md-navigation-bar-label-text-weight, 500);--_pressed-state-layer-opacity: var(--md-navigation-bar-pressed-state-layer-opacity, 0.12);--md-elevation-level:var(--_container-elevation);--md-elevation-shadow-color:var(--_container-shadow-color);width:100%}.md3-navigation-bar{display:flex;position:relative;width:100%;background-color:var(--_container-color);border-radius:var(--_container-shape);height:var(--_container-height)}.md3-navigation-bar .md3-navigation-bar__tabs-slot-container{display:inherit;width:inherit}md-elevation{transition-duration:280ms;z-index:0}/*# sourceMappingURL=navigation-bar-styles.css.map */ `; //# sourceMappingURL=navigation-bar-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationbar/lib/navigation-bar.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationbar/lib/navigation-bar.d.ts index 2e46568..8283fb3 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationbar/lib/navigation-bar.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationbar/lib/navigation-bar.d.ts
@@ -4,18 +4,18 @@ * SPDX-License-Identifier: Apache-2.0 */ import '../../elevation/elevation.js'; -import { LitElement, PropertyValues, TemplateResult } from 'lit'; +import { LitElement, PropertyValues } from 'lit'; import { NavigationTab } from '../../navigationtab/lib/navigation-tab.js'; import { NavigationBarState } from './state.js'; -/** @soyCompatible */ +/** + * TODO(b/265346501): add docs + */ export declare class NavigationBar extends LitElement implements NavigationBarState { activeIndex: number; hideInactiveLabels: boolean; tabs: NavigationTab[]; - protected tabsElement: NavigationTab[]; - ariaLabel: string; - /** @soyTemplate */ - render(): TemplateResult; + private readonly tabsElement; + protected render(): import("lit-html").TemplateResult<1>; protected updated(changedProperties: PropertyValues<NavigationBar>): void; firstUpdated(changedProperties: PropertyValues): void; layout(): void;
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationbar/lib/navigation-bar.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationbar/lib/navigation-bar.js index 09fbfd05..0082849 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationbar/lib/navigation-bar.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationbar/lib/navigation-bar.js
@@ -3,14 +3,16 @@ * Copyright 2022 Google LLC * SPDX-License-Identifier: Apache-2.0 */ -import { __decorate, __metadata } from "tslib"; +var _a; +import { __decorate } from "tslib"; import '../../elevation/elevation.js'; -import { html, LitElement } from 'lit'; +import { html, LitElement, nothing } from 'lit'; import { property, queryAssignedElements } from 'lit/decorators.js'; -import { ifDefined } from 'lit/directives/if-defined.js'; +import { requestUpdateOnAriaChange } from '../../aria/delegate.js'; import { isRtl } from '../../controller/is-rtl.js'; -import { ariaProperty } from '../../decorators/aria-property.js'; -/** @soyCompatible */ +/** + * TODO(b/265346501): add docs + */ export class NavigationBar extends LitElement { constructor() { super(...arguments); @@ -18,16 +20,17 @@ this.hideInactiveLabels = false; this.tabs = []; } - /** @soyTemplate */ render() { + // Needed for closure conformance + const { ariaLabel } = this; return html `<div class="md3-navigation-bar" role="tablist" - aria-label="${ifDefined(this.ariaLabel || undefined)}" + aria-label=${ariaLabel || nothing} @keydown="${this.handleKeydown}" @navigation-tab-interaction="${this.handleNavigationTabInteraction}" @navigation-tab-rendered=${this.handleNavigationTabConnected} - ><md-elevation shadow surface - ></md-elevation><div class="md3-navigation-bar__tabs-slot-container" + ><md-elevation></md-elevation + ><div class="md3-navigation-bar__tabs-slot-container" ><slot></slot></div></div>`; } updated(changedProperties) { @@ -121,21 +124,17 @@ } } } +_a = NavigationBar; +(() => { + requestUpdateOnAriaChange(_a); +})(); __decorate([ - property({ type: Number }), - __metadata("design:type", Object) + property({ type: Number }) ], NavigationBar.prototype, "activeIndex", void 0); __decorate([ - property({ type: Boolean }), - __metadata("design:type", Object) + property({ type: Boolean }) ], NavigationBar.prototype, "hideInactiveLabels", void 0); __decorate([ - queryAssignedElements({ flatten: true }), - __metadata("design:type", Array) + queryAssignedElements({ flatten: true }) ], NavigationBar.prototype, "tabsElement", void 0); -__decorate([ - ariaProperty, - property({ attribute: 'data-aria-label', noAccessor: true }), - __metadata("design:type", String) -], NavigationBar.prototype, "ariaLabel", void 0); //# sourceMappingURL=navigation-bar.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationbar/navigation-bar.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationbar/navigation-bar.d.ts index d717e93..41a64406 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationbar/navigation-bar.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationbar/navigation-bar.d.ts
@@ -10,7 +10,6 @@ } } /** - * @soyCompatible * @final * @suppress {visibility} */
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationbar/navigation-bar.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationbar/navigation-bar.js index 91c8ae44..bb77dca 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationbar/navigation-bar.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationbar/navigation-bar.js
@@ -8,7 +8,6 @@ import { NavigationBar } from './lib/navigation-bar.js'; import { styles } from './lib/navigation-bar-styles.css.js'; /** - * @soyCompatible * @final * @suppress {visibility} */
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationdrawer/lib/navigation-drawer-modal-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationdrawer/lib/navigation-drawer-modal-styles.css.js index 06e28c1..403a392 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationdrawer/lib/navigation-drawer-modal-styles.css.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationdrawer/lib/navigation-drawer-modal-styles.css.js
@@ -4,6 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ import { css } from 'lit'; -export const styles = css `:host{--_container-shape-start-start: var(--md-navigation-drawer-modal-container-shape-start-start, 0);--_container-shape-start-end: var(--md-navigation-drawer-modal-container-shape-start-end, 16px);--_container-shape-end-end: var(--md-navigation-drawer-modal-container-shape-end-end, 16px);--_container-shape-end-start: var(--md-navigation-drawer-modal-container-shape-end-start, 0);--_container-color: var(--md-navigation-drawer-modal-container-color, #fff);--_container-height: var(--md-navigation-drawer-modal-container-height, 100%);--_container-surface-tint-layer-color: ;--_container-width: var(--md-navigation-drawer-modal-container-width, 360px);--_divider-color: var(--md-navigation-drawer-modal-divider-color, #000);--_modal-container-elevation: var(--md-navigation-drawer-modal-modal-container-elevation, 1);--_scrim-color: ;--_scrim-opacity: var(--md-navigation-drawer-modal-scrim-opacity, 0.04);--_standard-container-elevation: var(--md-navigation-drawer-modal-standard-container-elevation, 0);--md-elevation-level:var(--_modal-container-elevation)}.md3-navigation-drawer-modal{bottom:0;box-sizing:border-box;display:flex;justify-content:flex-end;overflow:hidden;position:absolute;top:0;inline-size:0;transition:inline-size .25s cubic-bezier(0.4, 0, 0.2, 1) 0s,visibility 0s cubic-bezier(0.4, 0, 0.2, 1) .25s}.md3-navigation-drawer-modal--opened{transition:inline-size .25s cubic-bezier(0.4, 0, 0.2, 1) 0s,visibility 0s cubic-bezier(0.4, 0, 0.2, 1) 0s}.md3-navigation-drawer-modal--pivot-at-start{justify-content:flex-start}.md3-navigation-drawer-modal__slot-content{display:flex;flex-direction:column;position:relative}.md3-navigation-drawer-modal__scrim{inset:0;opacity:0;position:absolute;visibility:hidden;background-color:var(--_scrim-color);transition:opacity .25s cubic-bezier(0.4, 0, 0.2, 1) 0s,visibility 0s cubic-bezier(0.4, 0, 0.2, 1) .25s}.md3-navigation-drawer-modal--scrim-visible{visibility:visible;opacity:var(--_scrim-opacity);transition:opacity .25s cubic-bezier(0.4, 0, 0.2, 1) 0s,visibility 0s cubic-bezier(0.4, 0, 0.2, 1) 0s}/*# sourceMappingURL=navigation-drawer-modal-styles.css.map */ +export const styles = css `:host{--_container-color: var(--md-navigation-drawer-modal-container-color, #fff);--_container-height: var(--md-navigation-drawer-modal-container-height, 100%);--_container-shape: var(--md-navigation-drawer-modal-container-shape, 0 16px 16px 0);--_container-width: var(--md-navigation-drawer-modal-container-width, 360px);--_divider-color: var(--md-navigation-drawer-modal-divider-color, #000);--_modal-container-elevation: var(--md-navigation-drawer-modal-modal-container-elevation, 1);--_scrim-color: ;--_scrim-opacity: var(--md-navigation-drawer-modal-scrim-opacity, 0.04);--_standard-container-elevation: var(--md-navigation-drawer-modal-standard-container-elevation, 0);--md-elevation-level:var(--_modal-container-elevation)}.md3-navigation-drawer-modal{bottom:0;box-sizing:border-box;display:flex;justify-content:flex-end;overflow:hidden;position:absolute;top:0;inline-size:0;transition:inline-size .25s cubic-bezier(0.4, 0, 0.2, 1) 0s,visibility 0s cubic-bezier(0.4, 0, 0.2, 1) .25s}.md3-navigation-drawer-modal--opened{transition:inline-size .25s cubic-bezier(0.4, 0, 0.2, 1) 0s,visibility 0s cubic-bezier(0.4, 0, 0.2, 1) 0s}.md3-navigation-drawer-modal--pivot-at-start{justify-content:flex-start}.md3-navigation-drawer-modal__slot-content{display:flex;flex-direction:column;position:relative}.md3-navigation-drawer-modal__scrim{inset:0;opacity:0;position:absolute;visibility:hidden;background-color:var(--_scrim-color);transition:opacity .25s cubic-bezier(0.4, 0, 0.2, 1) 0s,visibility 0s cubic-bezier(0.4, 0, 0.2, 1) .25s}.md3-navigation-drawer-modal--scrim-visible{visibility:visible;opacity:var(--_scrim-opacity);transition:opacity .25s cubic-bezier(0.4, 0, 0.2, 1) 0s,visibility 0s cubic-bezier(0.4, 0, 0.2, 1) 0s}/*# sourceMappingURL=navigation-drawer-modal-styles.css.map */ `; //# sourceMappingURL=navigation-drawer-modal-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationdrawer/lib/navigation-drawer-modal.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationdrawer/lib/navigation-drawer-modal.d.ts index 05593a55..9fb7201 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationdrawer/lib/navigation-drawer-modal.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationdrawer/lib/navigation-drawer-modal.d.ts
@@ -3,21 +3,16 @@ * Copyright 2021 Google LLC * SPDX-License-Identifier: Apache-2.0 */ -import { LitElement, PropertyValues, TemplateResult } from 'lit'; -/** @soyCompatible */ +import { LitElement, PropertyValues } from 'lit'; +/** + * TODO(b/265346501): add docs + */ export declare class NavigationDrawerModal extends LitElement { - ariaDescribedBy: string | undefined; - ariaLabel: string; - ariaModal: 'true' | 'false'; - ariaLabelledBy: string | undefined; opened: boolean; pivot: 'start' | 'end'; - /** @soyTemplate */ - render(): TemplateResult; - /** @soyTemplate classMap */ - protected getScrimClasses(): import("lit-html/directive.js").DirectiveResult<typeof import("lit-html/directives/class-map.js").ClassMapDirective>; - /** @soyTemplate classMap */ - protected getRenderClasses(): import("lit-html/directive.js").DirectiveResult<typeof import("lit-html/directives/class-map.js").ClassMapDirective>; + protected render(): import("lit-html").TemplateResult<1>; + private getScrimClasses; + private getRenderClasses; protected updated(changedProperties: PropertyValues<NavigationDrawerModal>): void; private handleKeyDown; private handleScrimClick;
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationdrawer/lib/navigation-drawer-modal.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationdrawer/lib/navigation-drawer-modal.js index b58ad03d..ed4f9a0 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationdrawer/lib/navigation-drawer-modal.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationdrawer/lib/navigation-drawer-modal.js
@@ -3,37 +3,36 @@ * Copyright 2021 Google LLC * SPDX-License-Identifier: Apache-2.0 */ -import { __decorate, __metadata } from "tslib"; -import { html, LitElement } from 'lit'; +var _a; +import { __decorate } from "tslib"; +import { html, LitElement, nothing } from 'lit'; import { property } from 'lit/decorators.js'; import { classMap } from 'lit/directives/class-map.js'; -import { ifDefined } from 'lit/directives/if-defined.js'; -import { ariaProperty } from '../../decorators/aria-property.js'; -/** @soyCompatible */ +import { requestUpdateOnAriaChange } from '../../aria/delegate.js'; +/** + * TODO(b/265346501): add docs + */ export class NavigationDrawerModal extends LitElement { constructor() { super(...arguments); - // tslint:disable-next-line:no-new-decorators - this.ariaModal = 'false'; this.opened = false; this.pivot = 'end'; } - /** @soyTemplate */ render() { const ariaExpanded = this.opened ? 'true' : 'false'; const ariaHidden = !this.opened ? 'true' : 'false'; + // Needed for closure conformance + const { ariaLabel, ariaModal } = this; return html ` <div class="md3-navigation-drawer-modal__scrim ${this.getScrimClasses()}" @click="${this.handleScrimClick}"> </div> <div - aria-describedby="${ifDefined(this.ariaDescribedBy)}" - aria-expanded="${ariaExpanded}" - aria-hidden="${ariaHidden}" - aria-label="${ifDefined(this.ariaLabel)}" - aria-labelledby="${ifDefined(this.ariaLabelledBy)}" - aria-modal="${this.ariaModal}" + aria-expanded=${ariaExpanded} + aria-hidden=${ariaHidden} + aria-label=${ariaLabel || nothing} + aria-modal=${ariaModal || nothing} class="md3-navigation-drawer-modal ${this.getRenderClasses()}" @keydown="${this.handleKeyDown}" role="dialog"><div class="md3-elevation-overlay" @@ -44,13 +43,11 @@ </div> `; } - /** @soyTemplate classMap */ getScrimClasses() { return classMap({ 'md3-navigation-drawer-modal--scrim-visible': this.opened, }); } - /** @soyTemplate classMap */ getRenderClasses() { return classMap({ 'md3-navigation-drawer-modal--opened': this.opened, @@ -73,33 +70,14 @@ this.opened = !this.opened; } } +_a = NavigationDrawerModal; +(() => { + requestUpdateOnAriaChange(_a); +})(); __decorate([ - ariaProperty, - property({ type: String, attribute: 'data-aria-describedby', noAccessor: true }), - __metadata("design:type", String) -], NavigationDrawerModal.prototype, "ariaDescribedBy", void 0); -__decorate([ - ariaProperty, - property({ type: String, attribute: 'data-aria-label', noAccessor: true }), - __metadata("design:type", String) -], NavigationDrawerModal.prototype, "ariaLabel", void 0); -__decorate([ - ariaProperty, - property({ attribute: 'data-aria-modal', type: String, noAccessor: true }), - __metadata("design:type", String) -], NavigationDrawerModal.prototype, "ariaModal", void 0); -__decorate([ - ariaProperty, - property({ type: String, attribute: 'data-aria-labelledby', noAccessor: true }), - __metadata("design:type", String) -], NavigationDrawerModal.prototype, "ariaLabelledBy", void 0); -__decorate([ - property({ type: Boolean }) // tslint:disable-next-line:no-new-decorators - , - __metadata("design:type", Object) + property({ type: Boolean }) ], NavigationDrawerModal.prototype, "opened", void 0); __decorate([ - property({ type: String }), - __metadata("design:type", String) + property() ], NavigationDrawerModal.prototype, "pivot", void 0); //# sourceMappingURL=navigation-drawer-modal.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationdrawer/lib/navigation-drawer-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationdrawer/lib/navigation-drawer-styles.css.js index 23fdc829..2a04487 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationdrawer/lib/navigation-drawer-styles.css.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationdrawer/lib/navigation-drawer-styles.css.js
@@ -4,6 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ import { css } from 'lit'; -export const styles = css `:host{--_container-shape-start-start: var(--md-navigation-drawer-container-shape-start-start, 0);--_container-shape-start-end: var(--md-navigation-drawer-container-shape-start-end, 16px);--_container-shape-end-end: var(--md-navigation-drawer-container-shape-end-end, 16px);--_container-shape-end-start: var(--md-navigation-drawer-container-shape-end-start, 0);--_container-color: var(--md-navigation-drawer-container-color, #fff);--_container-height: var(--md-navigation-drawer-container-height, 100%);--_container-surface-tint-layer-color: ;--_container-width: var(--md-navigation-drawer-container-width, 360px);--_divider-color: var(--md-navigation-drawer-divider-color, #000);--_modal-container-elevation: var(--md-navigation-drawer-modal-container-elevation, 1);--_standard-container-elevation: var(--md-navigation-drawer-standard-container-elevation, 0);--md-elevation-level:var(--_standard-container-elevation);--md-elevation-shadow-color:var(--_divider-color);--md-elevation-surface-tint:var(--_container-surface-tint-layer-color)}:host{display:flex}.md3-navigation-drawer{inline-size:0;box-sizing:border-box;display:flex;justify-content:flex-end;overflow:hidden;overflow-y:auto;visibility:hidden;transition:inline-size .25s cubic-bezier(0.4, 0, 0.2, 1) 0s,visibility 0s cubic-bezier(0.4, 0, 0.2, 1) .25s}md-elevation{inset:0;position:absolute;width:inherit;z-index:0}.md3-navigation-drawer--opened{visibility:visible;transition:inline-size .25s cubic-bezier(0.4, 0, 0.2, 1) 0s,visibility 0s cubic-bezier(0.4, 0, 0.2, 1) 0s}.md3-navigation-drawer--pivot-at-start{justify-content:flex-start}.md3-navigation-drawer__slot-content{display:flex;flex-direction:column;position:relative}/*# sourceMappingURL=navigation-drawer-styles.css.map */ +export const styles = css `:host{--_container-color: var(--md-navigation-drawer-container-color, #fff);--_container-height: var(--md-navigation-drawer-container-height, 100%);--_container-shape: var(--md-navigation-drawer-container-shape, 0 16px 16px 0);--_container-width: var(--md-navigation-drawer-container-width, 360px);--_divider-color: var(--md-navigation-drawer-divider-color, #000);--_modal-container-elevation: var(--md-navigation-drawer-modal-container-elevation, 1);--_standard-container-elevation: var(--md-navigation-drawer-standard-container-elevation, 0);--md-elevation-level:var(--_standard-container-elevation);--md-elevation-shadow-color:var(--_divider-color)}:host{display:flex}.md3-navigation-drawer{inline-size:0;box-sizing:border-box;display:flex;justify-content:flex-end;overflow:hidden;overflow-y:auto;visibility:hidden;transition:inline-size .25s cubic-bezier(0.4, 0, 0.2, 1) 0s,visibility 0s cubic-bezier(0.4, 0, 0.2, 1) .25s}md-elevation{z-index:0}.md3-navigation-drawer--opened{visibility:visible;transition:inline-size .25s cubic-bezier(0.4, 0, 0.2, 1) 0s,visibility 0s cubic-bezier(0.4, 0, 0.2, 1) 0s}.md3-navigation-drawer--pivot-at-start{justify-content:flex-start}.md3-navigation-drawer__slot-content{display:flex;flex-direction:column;position:relative}/*# sourceMappingURL=navigation-drawer-styles.css.map */ `; //# sourceMappingURL=navigation-drawer-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationdrawer/lib/navigation-drawer.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationdrawer/lib/navigation-drawer.d.ts index 638866f..06308aaa 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationdrawer/lib/navigation-drawer.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationdrawer/lib/navigation-drawer.d.ts
@@ -4,18 +4,14 @@ * SPDX-License-Identifier: Apache-2.0 */ import '../../elevation/elevation.js'; -import { LitElement, PropertyValues, TemplateResult } from 'lit'; -/** @soyCompatible */ +import { LitElement, PropertyValues } from 'lit'; +/** + * TODO(b/265346501): add docs + */ export declare class NavigationDrawer extends LitElement { - ariaDescribedBy: string | undefined; - ariaLabel: string; - ariaModal: 'true' | 'false'; - ariaLabelledBy: string | undefined; opened: boolean; pivot: 'start' | 'end'; - /** @soyTemplate */ - render(): TemplateResult; - /** @soyTemplate classMap */ - protected getRenderClasses(): import("lit-html/directive.js").DirectiveResult<typeof import("lit-html/directives/class-map.js").ClassMapDirective>; + protected render(): import("lit-html").TemplateResult<1>; + private getRenderClasses; protected updated(changedProperties: PropertyValues<NavigationDrawer>): void; }
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationdrawer/lib/navigation-drawer.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationdrawer/lib/navigation-drawer.js index 8ef7e2c..63751dc 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationdrawer/lib/navigation-drawer.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationdrawer/lib/navigation-drawer.js
@@ -3,44 +3,42 @@ * Copyright 2021 Google LLC * SPDX-License-Identifier: Apache-2.0 */ -import { __decorate, __metadata } from "tslib"; +var _a; +import { __decorate } from "tslib"; import '../../elevation/elevation.js'; -import { html, LitElement } from 'lit'; +import { html, LitElement, nothing } from 'lit'; import { property } from 'lit/decorators.js'; import { classMap } from 'lit/directives/class-map.js'; -import { ifDefined } from 'lit/directives/if-defined.js'; -import { ariaProperty } from '../../decorators/aria-property.js'; -/** @soyCompatible */ +import { requestUpdateOnAriaChange } from '../../aria/delegate.js'; +/** + * TODO(b/265346501): add docs + */ export class NavigationDrawer extends LitElement { constructor() { super(...arguments); - // tslint:disable-next-line:no-new-decorators - this.ariaModal = 'false'; this.opened = false; this.pivot = 'end'; } - /** @soyTemplate */ render() { const ariaExpanded = this.opened ? 'true' : 'false'; const ariaHidden = !this.opened ? 'true' : 'false'; + // Needed for closure conformance + const { ariaLabel, ariaModal } = this; return html ` <div - aria-describedby="${ifDefined(this.ariaDescribedBy)}" aria-expanded="${ariaExpanded}" aria-hidden="${ariaHidden}" - aria-label="${ifDefined(this.ariaLabel)}" - aria-labelledby="${ifDefined(this.ariaLabelledBy)}" - aria-modal="${this.ariaModal}" + aria-label=${ariaLabel || nothing} + aria-modal="${ariaModal || nothing}" class="md3-navigation-drawer ${this.getRenderClasses()}" role="dialog"> - <md-elevation shadow surface></md-elevation> + <md-elevation></md-elevation> <div class="md3-navigation-drawer__slot-content"> <slot></slot> </div> </div> `; } - /** @soyTemplate classMap */ getRenderClasses() { return classMap({ 'md3-navigation-drawer--opened': this.opened, @@ -55,33 +53,14 @@ } } } +_a = NavigationDrawer; +(() => { + requestUpdateOnAriaChange(_a); +})(); __decorate([ - ariaProperty, - property({ type: String, attribute: 'data-aria-describedby', noAccessor: true }), - __metadata("design:type", String) -], NavigationDrawer.prototype, "ariaDescribedBy", void 0); -__decorate([ - ariaProperty, - property({ type: String, attribute: 'data-aria-label', noAccessor: true }), - __metadata("design:type", String) -], NavigationDrawer.prototype, "ariaLabel", void 0); -__decorate([ - ariaProperty, - property({ attribute: 'data-aria-modal', type: String, noAccessor: true }), - __metadata("design:type", String) -], NavigationDrawer.prototype, "ariaModal", void 0); -__decorate([ - ariaProperty, - property({ type: String, attribute: 'data-aria-labelledby', noAccessor: true }), - __metadata("design:type", String) -], NavigationDrawer.prototype, "ariaLabelledBy", void 0); -__decorate([ - property({ type: Boolean }) // tslint:disable-next-line:no-new-decorators - , - __metadata("design:type", Object) + property({ type: Boolean }) ], NavigationDrawer.prototype, "opened", void 0); __decorate([ - property({ type: String }), - __metadata("design:type", String) + property() ], NavigationDrawer.prototype, "pivot", void 0); //# sourceMappingURL=navigation-drawer.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationdrawer/lib/shared-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationdrawer/lib/shared-styles.css.js index bdbdf5d..186ffd9 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationdrawer/lib/shared-styles.css.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationdrawer/lib/shared-styles.css.js
@@ -4,6 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ import { css } from 'lit'; -export const styles = css `.md3-navigation-drawer-modal{background-color:var(--_container-color);border-start-start-radius:var(--_container-shape-start-start);border-start-end-radius:var(--_container-shape-start-end);border-end-end-radius:var(--_container-shape-end-end);border-end-start-radius:var(--_container-shape-end-start);height:var(--_container-height)}.md3-navigation-drawer-modal.md3-navigation-drawer-modal--opened{inline-size:var(--_container-width)}.md3-navigation-drawer-modal .md3-navigation-drawer-modal__slot-content{min-inline-size:var(--_container-width);max-inline-size:var(--_container-width)}/*# sourceMappingURL=shared-styles.css.map */ +export const styles = css `.md3-navigation-drawer-modal{background-color:var(--_container-color);border-radius:var(--_container-shape);height:var(--_container-height)}.md3-navigation-drawer-modal.md3-navigation-drawer-modal--opened{inline-size:var(--_container-width)}.md3-navigation-drawer-modal .md3-navigation-drawer-modal__slot-content{min-inline-size:var(--_container-width);max-inline-size:var(--_container-width)}/*# sourceMappingURL=shared-styles.css.map */ `; //# sourceMappingURL=shared-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationdrawer/navigation-drawer-modal.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationdrawer/navigation-drawer-modal.d.ts index 14c6de3..cde9427 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationdrawer/navigation-drawer-modal.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationdrawer/navigation-drawer-modal.d.ts
@@ -10,7 +10,6 @@ } } /** - * @soyCompatible * @final * @suppress {visibility} */
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationdrawer/navigation-drawer-modal.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationdrawer/navigation-drawer-modal.js index 5025308..74214c6f 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationdrawer/navigation-drawer-modal.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationdrawer/navigation-drawer-modal.js
@@ -9,7 +9,6 @@ import { styles } from './lib/navigation-drawer-modal-styles.css.js'; import { styles as sharedStyles } from './lib/shared-styles.css.js'; /** - * @soyCompatible * @final * @suppress {visibility} */
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationdrawer/navigation-drawer.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationdrawer/navigation-drawer.d.ts index b07135a..fb1c9c2b 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationdrawer/navigation-drawer.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationdrawer/navigation-drawer.d.ts
@@ -10,7 +10,6 @@ } } /** - * @soyCompatible * @final * @suppress {visibility} */
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationdrawer/navigation-drawer.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationdrawer/navigation-drawer.js index b04f044..a563ad34 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationdrawer/navigation-drawer.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationdrawer/navigation-drawer.js
@@ -9,7 +9,6 @@ import { styles } from './lib/navigation-drawer-styles.css.js'; import { styles as sharedStyles } from './lib/shared-styles.css.js'; /** - * @soyCompatible * @final * @suppress {visibility} */
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationtab/lib/navigation-tab-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationtab/lib/navigation-tab-styles.css.js index b2716dd..d13fd1b 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationtab/lib/navigation-tab-styles.css.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationtab/lib/navigation-tab-styles.css.js
@@ -4,6 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ import { css } from 'lit'; -export const styles = css `:host{--_active-indicator-color: var(--md-navigation-bar-active-indicator-color, var(--md-sys-color-secondary-container, #e8def8));--_active-indicator-height: var(--md-navigation-bar-active-indicator-height, 32px);--_active-indicator-shape: var(--md-navigation-bar-active-indicator-shape, 9999px);--_active-indicator-width: var(--md-navigation-bar-active-indicator-width, 64px);--_active-focus-icon-color: var(--md-navigation-bar-active-focus-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_active-focus-label-text-color: var(--md-navigation-bar-active-focus-label-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_active-focus-state-layer-color: var(--md-navigation-bar-active-focus-state-layer-color, var(--md-sys-color-on-surface, #1c1b1f));--_active-hover-icon-color: var(--md-navigation-bar-active-hover-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_active-hover-label-text-color: var(--md-navigation-bar-active-hover-label-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_active-hover-state-layer-color: var(--md-navigation-bar-active-hover-state-layer-color, var(--md-sys-color-on-surface, #1c1b1f));--_active-icon-color: var(--md-navigation-bar-active-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_active-label-text-color: var(--md-navigation-bar-active-label-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_active-label-text-weight: var(--md-navigation-bar-active-label-text-weight, 700);--_active-pressed-icon-color: var(--md-navigation-bar-active-pressed-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_active-pressed-label-text-color: var(--md-navigation-bar-active-pressed-label-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_active-pressed-state-layer-color: var(--md-navigation-bar-active-pressed-state-layer-color, var(--md-sys-color-on-surface, #1c1b1f));--_container-color: var(--md-navigation-bar-container-color, var(--md-sys-color-surface, #fffbfe));--_container-elevation: var(--md-navigation-bar-container-elevation, 3);--_container-height: var(--md-navigation-bar-container-height, 80px);--_container-shape: var(--md-navigation-bar-container-shape, 0px);--_container-surface-tint-layer-color: var(--md-navigation-bar-container-surface-tint-layer-color, var(--md-sys-color-primary, #6750a4));--_focus-state-layer-opacity: var(--md-navigation-bar-focus-state-layer-opacity, 0.12);--_hover-state-layer-opacity: var(--md-navigation-bar-hover-state-layer-opacity, 0.08);--_icon-size: var(--md-navigation-bar-icon-size, 24px);--_inactive-focus-icon-color: var(--md-navigation-bar-inactive-focus-icon-color, var(--md-sys-color-on-surface, #1c1b1f));--_inactive-focus-label-text-color: var(--md-navigation-bar-inactive-focus-label-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_inactive-focus-state-layer-color: var(--md-navigation-bar-inactive-focus-state-layer-color, var(--md-sys-color-on-surface, #1c1b1f));--_inactive-hover-icon-color: var(--md-navigation-bar-inactive-hover-icon-color, var(--md-sys-color-on-surface, #1c1b1f));--_inactive-hover-label-text-color: var(--md-navigation-bar-inactive-hover-label-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_inactive-hover-state-layer-color: var(--md-navigation-bar-inactive-hover-state-layer-color, var(--md-sys-color-on-surface, #1c1b1f));--_inactive-icon-color: var(--md-navigation-bar-inactive-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_inactive-label-text-color: var(--md-navigation-bar-inactive-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_inactive-pressed-icon-color: var(--md-navigation-bar-inactive-pressed-icon-color, var(--md-sys-color-on-surface, #1c1b1f));--_inactive-pressed-label-text-color: var(--md-navigation-bar-inactive-pressed-label-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_inactive-pressed-state-layer-color: var(--md-navigation-bar-inactive-pressed-state-layer-color, var(--md-sys-color-on-surface, #1c1b1f));--_label-text-font: var(--md-navigation-bar-label-text-font, Roboto);--_label-text-line-height: var(--md-navigation-bar-label-text-line-height, 1rem);--_label-text-size: var(--md-navigation-bar-label-text-size, 0.75rem);--_label-text-tracking: var(--md-navigation-bar-label-text-tracking, 0.031rem);--_label-text-type: var(--md-navigation-bar-label-text-type, 500 0.75rem / 1rem Roboto);--_label-text-weight: var(--md-navigation-bar-label-text-weight, 500);--_pressed-state-layer-opacity: var(--md-navigation-bar-pressed-state-layer-opacity, 0.12);--md-focus-ring-shape-start-start:8px;--md-focus-ring-shape-start-end:8px;--md-focus-ring-shape-end-end:8px;--md-focus-ring-shape-end-start:8px;--md-focus-ring-offset-vertical:-2px;--md-focus-ring-offset-horizontal:-2px;display:flex;flex-grow:1}.md3-navigation-tab{align-items:center;appearance:none;background:none;border:none;box-sizing:border-box;cursor:pointer;display:flex;flex-direction:column;height:100%;justify-content:center;min-height:48px;min-width:48px;outline:none;padding:8px 0px 12px;position:relative;text-align:center;width:100%;font-family:var(--_label-text-font);font-size:var(--_label-text-size);letter-spacing:var(--_label-text-tracking);font-weight:var(--_label-text-weight);line-height:var(--_label-text-line-height)}.md3-navigation-tab::-moz-focus-inner{border:0;padding:0}.md3-navigation-tab__icon-content{align-items:center;box-sizing:border-box;display:flex;justify-content:center;position:relative;z-index:1}.md3-navigation-tab__label-text{height:16px;margin-top:4px;opacity:1;transition:opacity 100ms cubic-bezier(0.4, 0, 0.2, 1),height 100ms cubic-bezier(0.4, 0, 0.2, 1);z-index:1}.md3-navigation-tab--hide-inactive-label:not(.md3-navigation-tab--active) .md3-navigation-tab__label-text{height:0;opacity:0}.md3-navigation-tab__active-indicator{display:flex;justify-content:center;opacity:0;position:absolute;transition:width 100ms cubic-bezier(0.4, 0, 0.2, 1),opacity 100ms cubic-bezier(0.4, 0, 0.2, 1);width:32px;background-color:var(--_active-indicator-color);border-radius:var(--_active-indicator-shape)}.md3-navigation-tab--active .md3-navigation-tab__active-indicator{opacity:1}.md3-navigation-tab__active-indicator,.md3-navigation-tab__icon-content{height:var(--_active-indicator-height)}.md3-navigation-tab--active .md3-navigation-tab__active-indicator,.md3-navigation-tab__icon-content{width:var(--_active-indicator-width)}.md3-navigation-tab__icon{fill:currentColor;align-self:center;display:inline-block;position:relative;width:var(--_icon-size);height:var(--_icon-size);font-size:var(--_icon-size)}.md3-navigation-tab__icon.md3-navigation-tab__icon--active{display:none}.md3-navigation-tab--active .md3-navigation-tab__icon{display:none}.md3-navigation-tab--active .md3-navigation-tab__icon.md3-navigation-tab__icon--active{display:inline-block}.md3-navigation-tab__ripple{z-index:0}.md3-navigation-tab--active{--md-ripple-hover-state-layer-color:var(--_active-hover-state-layer-color);--md-ripple-focus-state-layer-color:var(--_active-focus-state-layer-color);--md-ripple-pressed-state-layer-color:var(--_active-pressed-state-layer-color);--md-ripple-hover-state-layer-opacity:var(--_hover-state-layer-opacity);--md-ripple-focus-state-layer-opacity:var(--_focus-state-layer-opacity);--md-ripple-pressed-state-layer-opacity:var(--_pressed-state-layer-opacity)}.md3-navigation-tab--active .md3-navigation-tab__icon{color:var(--_active-icon-color)}.md3-navigation-tab--active .md3-navigation-tab__label-text{color:var(--_active-label-text-color)}.md3-navigation-tab--active:hover .md3-navigation-tab__icon{color:var(--_active-hover-icon-color)}.md3-navigation-tab--active:hover .md3-navigation-tab__label-text{color:var(--_active-hover-label-text-color)}.md3-navigation-tab--active:focus .md3-navigation-tab__icon{color:var(--_active-focus-icon-color)}.md3-navigation-tab--active:focus .md3-navigation-tab__label-text{color:var(--_active-focus-label-text-color)}.md3-navigation-tab--active:active .md3-navigation-tab__icon{color:var(--_active-pressed-icon-color)}.md3-navigation-tab--active:active .md3-navigation-tab__label-text{color:var(--_active-pressed-label-text-color)}.md3-navigation-tab:not(.md3-navigation-tab--active){--md-ripple-hover-state-layer-color:var(--_inactive-hover-state-layer-color);--md-ripple-focus-state-layer-color:var(--_inactive-focus-state-layer-color);--md-ripple-pressed-state-layer-color:var(--_inactive-pressed-state-layer-color);--md-ripple-hover-state-layer-opacity:var(--_hover-state-layer-opacity);--md-ripple-focus-state-layer-opacity:var(--_focus-state-layer-opacity);--md-ripple-pressed-state-layer-opacity:var(--_pressed-state-layer-opacity)}.md3-navigation-tab:not(.md3-navigation-tab--active) .md3-navigation-tab__icon{color:var(--_inactive-icon-color)}.md3-navigation-tab:not(.md3-navigation-tab--active) .md3-navigation-tab__label-text{color:var(--_inactive-label-text-color)}.md3-navigation-tab:not(.md3-navigation-tab--active):hover .md3-navigation-tab__icon{color:var(--_inactive-hover-icon-color)}.md3-navigation-tab:not(.md3-navigation-tab--active):hover .md3-navigation-tab__label-text{color:var(--_inactive-hover-label-text-color)}.md3-navigation-tab:not(.md3-navigation-tab--active):focus .md3-navigation-tab__icon{color:var(--_inactive-focus-icon-color)}.md3-navigation-tab:not(.md3-navigation-tab--active):focus .md3-navigation-tab__label-text{color:var(--_inactive-focus-label-text-color)}.md3-navigation-tab:not(.md3-navigation-tab--active):active .md3-navigation-tab__icon{color:var(--_inactive-pressed-icon-color)}.md3-navigation-tab:not(.md3-navigation-tab--active):active .md3-navigation-tab__label-text{color:var(--_inactive-pressed-label-text-color)}/*# sourceMappingURL=navigation-tab-styles.css.map */ +export const styles = css `:host{--_active-indicator-color: var(--md-navigation-bar-active-indicator-color, var(--md-sys-color-secondary-container, #e8def8));--_active-indicator-height: var(--md-navigation-bar-active-indicator-height, 32px);--_active-indicator-shape: var(--md-navigation-bar-active-indicator-shape, 9999px);--_active-indicator-width: var(--md-navigation-bar-active-indicator-width, 64px);--_active-focus-icon-color: var(--md-navigation-bar-active-focus-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_active-focus-label-text-color: var(--md-navigation-bar-active-focus-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_active-focus-state-layer-color: var(--md-navigation-bar-active-focus-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_active-hover-icon-color: var(--md-navigation-bar-active-hover-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_active-hover-label-text-color: var(--md-navigation-bar-active-hover-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_active-hover-state-layer-color: var(--md-navigation-bar-active-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_active-icon-color: var(--md-navigation-bar-active-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_active-label-text-color: var(--md-navigation-bar-active-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_active-label-text-weight: var(--md-navigation-bar-active-label-text-weight, 700);--_active-pressed-icon-color: var(--md-navigation-bar-active-pressed-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_active-pressed-label-text-color: var(--md-navigation-bar-active-pressed-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_active-pressed-state-layer-color: var(--md-navigation-bar-active-pressed-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_container-color: var(--md-navigation-bar-container-color, var(--md-sys-color-surface-container, #f3edf7));--_container-elevation: var(--md-navigation-bar-container-elevation, 2);--_container-height: var(--md-navigation-bar-container-height, 80px);--_container-shape: var(--md-navigation-bar-container-shape, 0px);--_focus-state-layer-opacity: var(--md-navigation-bar-focus-state-layer-opacity, 0.12);--_hover-state-layer-opacity: var(--md-navigation-bar-hover-state-layer-opacity, 0.08);--_icon-size: var(--md-navigation-bar-icon-size, 24px);--_inactive-focus-icon-color: var(--md-navigation-bar-inactive-focus-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_inactive-focus-label-text-color: var(--md-navigation-bar-inactive-focus-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_inactive-focus-state-layer-color: var(--md-navigation-bar-inactive-focus-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_inactive-hover-icon-color: var(--md-navigation-bar-inactive-hover-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_inactive-hover-label-text-color: var(--md-navigation-bar-inactive-hover-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_inactive-hover-state-layer-color: var(--md-navigation-bar-inactive-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_inactive-icon-color: var(--md-navigation-bar-inactive-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_inactive-label-text-color: var(--md-navigation-bar-inactive-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_inactive-pressed-icon-color: var(--md-navigation-bar-inactive-pressed-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_inactive-pressed-label-text-color: var(--md-navigation-bar-inactive-pressed-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_inactive-pressed-state-layer-color: var(--md-navigation-bar-inactive-pressed-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_label-text-font: var(--md-navigation-bar-label-text-font, var(--md-ref-typeface-plain, Roboto));--_label-text-line-height: var(--md-navigation-bar-label-text-line-height, 1rem);--_label-text-size: var(--md-navigation-bar-label-text-size, 0.75rem);--_label-text-tracking: var(--md-navigation-bar-label-text-tracking, 0.031rem);--_label-text-type: var(--md-navigation-bar-label-text-type, 500 0.75rem / 1rem var(--md-ref-typeface-plain, Roboto));--_label-text-weight: var(--md-navigation-bar-label-text-weight, 500);--_pressed-state-layer-opacity: var(--md-navigation-bar-pressed-state-layer-opacity, 0.12);--md-focus-ring-offset: -2px;--md-focus-ring-shape: 8px;display:flex;flex-grow:1}.md3-navigation-tab{align-items:center;appearance:none;background:none;border:none;box-sizing:border-box;cursor:pointer;display:flex;flex-direction:column;height:100%;justify-content:center;min-height:48px;min-width:48px;outline:none;padding:8px 0px 12px;position:relative;text-align:center;width:100%;font:var(--_label-text-type)}.md3-navigation-tab::-moz-focus-inner{border:0;padding:0}.md3-navigation-tab__icon-content{align-items:center;box-sizing:border-box;display:flex;justify-content:center;position:relative;z-index:1}.md3-navigation-tab__label-text{height:16px;margin-top:4px;opacity:1;transition:opacity 100ms cubic-bezier(0.4, 0, 0.2, 1),height 100ms cubic-bezier(0.4, 0, 0.2, 1);z-index:1}.md3-navigation-tab--hide-inactive-label:not(.md3-navigation-tab--active) .md3-navigation-tab__label-text{height:0;opacity:0}.md3-navigation-tab__active-indicator{display:flex;justify-content:center;opacity:0;position:absolute;transition:width 100ms cubic-bezier(0.4, 0, 0.2, 1),opacity 100ms cubic-bezier(0.4, 0, 0.2, 1);width:32px;background-color:var(--_active-indicator-color);border-radius:var(--_active-indicator-shape)}.md3-navigation-tab--active .md3-navigation-tab__active-indicator{opacity:1}.md3-navigation-tab__active-indicator,.md3-navigation-tab__icon-content{height:var(--_active-indicator-height)}.md3-navigation-tab--active .md3-navigation-tab__active-indicator,.md3-navigation-tab__icon-content{width:var(--_active-indicator-width)}.md3-navigation-tab__icon{fill:currentColor;align-self:center;display:inline-block;position:relative;width:var(--_icon-size);height:var(--_icon-size);font-size:var(--_icon-size)}.md3-navigation-tab__icon.md3-navigation-tab__icon--active{display:none}.md3-navigation-tab--active .md3-navigation-tab__icon{display:none}.md3-navigation-tab--active .md3-navigation-tab__icon.md3-navigation-tab__icon--active{display:inline-block}.md3-navigation-tab__ripple{z-index:0}.md3-navigation-tab--active{--md-ripple-hover-color:var(--_active-hover-state-layer-color);--md-ripple-focus-color:var(--_active-focus-state-layer-color);--md-ripple-pressed-color:var(--_active-pressed-state-layer-color);--md-ripple-hover-opacity:var(--_hover-state-layer-opacity);--md-ripple-focus-opacity:var(--_focus-state-layer-opacity);--md-ripple-pressed-opacity:var(--_pressed-state-layer-opacity)}.md3-navigation-tab--active .md3-navigation-tab__icon{color:var(--_active-icon-color)}.md3-navigation-tab--active .md3-navigation-tab__label-text{color:var(--_active-label-text-color)}.md3-navigation-tab--active:hover .md3-navigation-tab__icon{color:var(--_active-hover-icon-color)}.md3-navigation-tab--active:hover .md3-navigation-tab__label-text{color:var(--_active-hover-label-text-color)}.md3-navigation-tab--active:focus .md3-navigation-tab__icon{color:var(--_active-focus-icon-color)}.md3-navigation-tab--active:focus .md3-navigation-tab__label-text{color:var(--_active-focus-label-text-color)}.md3-navigation-tab--active:active .md3-navigation-tab__icon{color:var(--_active-pressed-icon-color)}.md3-navigation-tab--active:active .md3-navigation-tab__label-text{color:var(--_active-pressed-label-text-color)}.md3-navigation-tab:not(.md3-navigation-tab--active){--md-ripple-hover-color:var(--_inactive-hover-state-layer-color);--md-ripple-focus-color:var(--_inactive-focus-state-layer-color);--md-ripple-pressed-color:var(--_inactive-pressed-state-layer-color);--md-ripple-hover-opacity:var(--_hover-state-layer-opacity);--md-ripple-focus-opacity:var(--_focus-state-layer-opacity);--md-ripple-pressed-opacity:var(--_pressed-state-layer-opacity)}.md3-navigation-tab:not(.md3-navigation-tab--active) .md3-navigation-tab__icon{color:var(--_inactive-icon-color)}.md3-navigation-tab:not(.md3-navigation-tab--active) .md3-navigation-tab__label-text{color:var(--_inactive-label-text-color)}.md3-navigation-tab:not(.md3-navigation-tab--active):hover .md3-navigation-tab__icon{color:var(--_inactive-hover-icon-color)}.md3-navigation-tab:not(.md3-navigation-tab--active):hover .md3-navigation-tab__label-text{color:var(--_inactive-hover-label-text-color)}.md3-navigation-tab:not(.md3-navigation-tab--active):focus .md3-navigation-tab__icon{color:var(--_inactive-focus-icon-color)}.md3-navigation-tab:not(.md3-navigation-tab--active):focus .md3-navigation-tab__label-text{color:var(--_inactive-focus-label-text-color)}.md3-navigation-tab:not(.md3-navigation-tab--active):active .md3-navigation-tab__icon{color:var(--_inactive-pressed-icon-color)}.md3-navigation-tab:not(.md3-navigation-tab--active):active .md3-navigation-tab__label-text{color:var(--_inactive-pressed-label-text-color)}/*# sourceMappingURL=navigation-tab-styles.css.map */ `; //# sourceMappingURL=navigation-tab-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationtab/lib/navigation-tab.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationtab/lib/navigation-tab.d.ts index b404bdf..33dfb28 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationtab/lib/navigation-tab.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationtab/lib/navigation-tab.d.ts
@@ -5,44 +5,31 @@ */ import '../../badge/badge.js'; import '../../focus/focus-ring.js'; -import { PropertyValues, TemplateResult } from 'lit'; -import { ClassInfo } from 'lit/directives/class-map.js'; -import { ActionElement, BeginPressConfig, EndPressConfig } from '../../actionelement/action-element.js'; +import '../../ripple/ripple.js'; +import { LitElement, PropertyValues } from 'lit'; import { MdRipple } from '../../ripple/ripple.js'; import { NavigationTabState } from './state.js'; -/** @soyCompatible */ -export declare class NavigationTab extends ActionElement implements NavigationTabState { +/** + * TODO(b/265346501): add docs + */ +export declare class NavigationTab extends LitElement implements NavigationTabState { disabled: boolean; active: boolean; hideInactiveLabel: boolean; label?: string; badgeValue: string; showBadge: boolean; - protected showFocusRing: boolean; - ariaLabel: string; - buttonElement: HTMLElement; - ripple: MdRipple; - /** @soyTemplate */ - render(): TemplateResult; - /** @soyTemplate */ - protected getRenderClasses(): ClassInfo; - /** @soyTemplate */ - protected renderFocusRing(): TemplateResult; - /** @soyTemplate */ - protected renderRipple(): TemplateResult | string; - /** @soyTemplate */ - protected renderBadge(): TemplateResult | ''; - /** @soyTemplate */ - protected renderLabel(): TemplateResult | ''; + private showRipple; + buttonElement: HTMLElement | null; + ripple: Promise<MdRipple | null>; + protected render(): import("lit-html").TemplateResult<1>; + private getRenderClasses; + private readonly getRipple; + private readonly renderRipple; + private renderBadge; + private renderLabel; firstUpdated(changedProperties: PropertyValues): void; focus(): void; blur(): void; - beginPress({ positionEvent }: BeginPressConfig): void; - endPress(options: EndPressConfig): void; - handlePointerDown(e: PointerEvent): void; - handlePointerUp(e: PointerEvent): void; - protected handlePointerEnter(e: PointerEvent): void; - handlePointerLeave(e: PointerEvent): void; - protected handleFocus(): void; - protected handleBlur(): void; + handleClick(): void; }
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationtab/lib/navigation-tab.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationtab/lib/navigation-tab.js index 94a718b..f53eb88f3 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationtab/lib/navigation-tab.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationtab/lib/navigation-tab.js
@@ -3,19 +3,21 @@ * Copyright 2022 Google LLC * SPDX-License-Identifier: Apache-2.0 */ -import { __decorate, __metadata } from "tslib"; +var _a; +import { __decorate } from "tslib"; import '../../badge/badge.js'; import '../../focus/focus-ring.js'; -import { html } from 'lit'; -import { property, query, state } from 'lit/decorators.js'; +import '../../ripple/ripple.js'; +import { html, LitElement, nothing } from 'lit'; +import { property, query, queryAsync, state } from 'lit/decorators.js'; import { classMap } from 'lit/directives/class-map.js'; -import { ifDefined } from 'lit/directives/if-defined.js'; -import { ActionElement } from '../../actionelement/action-element.js'; -import { ariaProperty } from '../../decorators/aria-property.js'; -import { pointerPress, shouldShowStrongFocus } from '../../focus/strong-focus.js'; -import { MdRipple } from '../../ripple/ripple.js'; -/** @soyCompatible */ -export class NavigationTab extends ActionElement { +import { when } from 'lit/directives/when.js'; +import { requestUpdateOnAriaChange } from '../../aria/delegate.js'; +import { ripple } from '../../ripple/directive.js'; +/** + * TODO(b/265346501): add docs + */ +export class NavigationTab extends LitElement { constructor() { super(...arguments); this.disabled = false; @@ -23,27 +25,29 @@ this.hideInactiveLabel = false; this.badgeValue = ''; this.showBadge = false; - this.showFocusRing = false; + this.showRipple = false; + this.getRipple = () => { + this.showRipple = true; + return this.ripple; + }; + this.renderRipple = () => { + return html `<md-ripple ?disabled="${this.disabled}" class="md3-navigation-tab__ripple"></md-ripple>`; + }; } - /** @soyTemplate */ render() { + // Needed for closure conformance + const { ariaLabel } = this; return html ` <button class="md3-navigation-tab ${classMap(this.getRenderClasses())}" role="tab" aria-selected="${this.active}" - aria-label="${ifDefined(this.ariaLabel)}" + aria-label=${ariaLabel || nothing} tabindex="${this.active ? 0 : -1}" - @focus="${this.handleFocus}" - @blur="${this.handleBlur}" - @pointerdown="${this.handlePointerDown}" - @pointerup="${this.handlePointerUp}" - @pointercancel="${this.handlePointerCancel}" - @pointerleave="${this.handlePointerLeave}" - @pointerenter="${this.handlePointerEnter}" @click="${this.handleClick}" - @contextmenu="${this.handleContextMenu}" - >${this.renderFocusRing()}${this.renderRipple()} + ${ripple(this.getRipple)}> + <md-focus-ring></md-focus-ring> + ${when(this.showRipple, this.renderRipple)} <span aria-hidden="true" class="md3-navigation-tab__icon-content" ><span class="md3-navigation-tab__active-indicator" ></span><span class="md3-navigation-tab__icon" @@ -55,32 +59,23 @@ >${this.renderLabel()} </button>`; } - /** @soyTemplate */ getRenderClasses() { return { 'md3-navigation-tab--hide-inactive-label': this.hideInactiveLabel, 'md3-navigation-tab--active': this.active, }; } - /** @soyTemplate */ - renderFocusRing() { - return html `<md-focus-ring .visible="${this.showFocusRing}"></md-focus-ring>`; - } - /** @soyTemplate */ - renderRipple() { - return html `<md-ripple class="md3-navigation-tab__ripple"></md-ripple>`; - } - /** @soyTemplate */ renderBadge() { return this.showBadge ? html `<md-badge .value="${this.badgeValue}"></md-badge>` : - ''; + nothing; } - /** @soyTemplate */ renderLabel() { - const ariaHidden = this.ariaLabel ? 'true' : 'false'; + // Needed for closure conformance + const { ariaLabel } = this; + const ariaHidden = ariaLabel ? 'true' : 'false'; return !this.label ? - '' : + nothing : html ` <span aria-hidden="${ariaHidden}" class="md3-navigation-tab__label-text">${this.label}</span>`; } @@ -101,74 +96,40 @@ buttonElement.blur(); } } - beginPress({ positionEvent }) { - this.ripple.beginPress(positionEvent); - } - endPress(options) { - this.ripple.endPress(); - super.endPress(options); - if (!options.cancelled) { - this.dispatchEvent(new CustomEvent('navigation-tab-interaction', { detail: { state: this }, bubbles: true, composed: true })); - } - } - handlePointerDown(e) { - super.handlePointerDown(e); - pointerPress(); - this.showFocusRing = shouldShowStrongFocus(); - } - handlePointerUp(e) { - super.handlePointerUp(e); - } - handlePointerEnter(e) { - this.ripple.beginHover(e); - } - handlePointerLeave(e) { - super.handlePointerLeave(e); - this.ripple.endHover(); - } - handleFocus() { - this.showFocusRing = shouldShowStrongFocus(); - } - handleBlur() { - this.showFocusRing = false; + handleClick() { + // TODO(b/269772145): connect to ripple + this.dispatchEvent(new CustomEvent('navigation-tab-interaction', { detail: { state: this }, bubbles: true, composed: true })); } } +_a = NavigationTab; +(() => { + requestUpdateOnAriaChange(_a); +})(); __decorate([ - property({ type: Boolean, reflect: true }), - __metadata("design:type", Object) + property({ type: Boolean }) +], NavigationTab.prototype, "disabled", void 0); +__decorate([ + property({ type: Boolean, reflect: true }) ], NavigationTab.prototype, "active", void 0); __decorate([ - property({ type: Boolean }), - __metadata("design:type", Object) + property({ type: Boolean }) ], NavigationTab.prototype, "hideInactiveLabel", void 0); __decorate([ - property({ type: String }), - __metadata("design:type", String) + property() ], NavigationTab.prototype, "label", void 0); __decorate([ - property({ type: String }), - __metadata("design:type", Object) + property() ], NavigationTab.prototype, "badgeValue", void 0); __decorate([ - property({ type: Boolean }), - __metadata("design:type", Object) + property({ type: Boolean }) ], NavigationTab.prototype, "showBadge", void 0); __decorate([ - state(), - __metadata("design:type", Object) -], NavigationTab.prototype, "showFocusRing", void 0); + state() +], NavigationTab.prototype, "showRipple", void 0); __decorate([ - ariaProperty // tslint:disable-line:no-new-decorators - , - property({ type: String, attribute: 'data-aria-label', noAccessor: true }), - __metadata("design:type", String) -], NavigationTab.prototype, "ariaLabel", void 0); -__decorate([ - query('button'), - __metadata("design:type", HTMLElement) + query('button') ], NavigationTab.prototype, "buttonElement", void 0); __decorate([ - query('md-ripple'), - __metadata("design:type", MdRipple) + queryAsync('md-ripple') ], NavigationTab.prototype, "ripple", void 0); //# sourceMappingURL=navigation-tab.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationtab/lib/state.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationtab/lib/state.d.ts index 53c6eb1d..45befcfc 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationtab/lib/state.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationtab/lib/state.d.ts
@@ -20,5 +20,5 @@ * TODO(b/229015424): Remove this when the jscompiler rename issue is * understood. */ - buttonElement: HTMLElement; + buttonElement: HTMLElement | null; }
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationtab/navigation-tab.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationtab/navigation-tab.d.ts index f3b619fa..bed3118 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationtab/navigation-tab.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationtab/navigation-tab.d.ts
@@ -10,7 +10,6 @@ } } /** - * @soyCompatible * @final * @suppress {visibility} */
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationtab/navigation-tab.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationtab/navigation-tab.js index 432e3e6..ade4ac4 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationtab/navigation-tab.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/navigationtab/navigation-tab.js
@@ -8,7 +8,6 @@ import { NavigationTab } from './lib/navigation-tab.js'; import { styles } from './lib/navigation-tab-styles.css.js'; /** - * @soyCompatible * @final * @suppress {visibility} */
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/package.json b/third_party/material_web_components/components-chromium/node_modules/@material/web/package.json index ffc876e0..b8b6bfa 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/package.json +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/package.json
@@ -1,6 +1,6 @@ { "name": "@material/web", - "version": "1.0.0-pre.2", + "version": "1.0.0-pre.8", "publishConfig": { "access": "public" }, @@ -36,6 +36,7 @@ ], "dependencies": { "lit": "^2.3.0", + "safevalues": "^0.4.3", "tslib": "^2.4.0" }, "devDependencies": { @@ -45,7 +46,7 @@ "jasmine": "^4.5.0", "sass": "^1.52.3", "sass-true": "^6.1.0", - "typescript": "~4.7.4", + "typescript": "4.9.4", "web-test-runner-jasmine": "^0.0.2", "wireit": "^0.9.0" },
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/radio/lib/radio-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/radio/lib/radio-styles.css.js index b2d6cbc..4b546a0 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/radio/lib/radio-styles.css.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/radio/lib/radio-styles.css.js
@@ -4,6 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ import { css } from 'lit'; -export const styles = css `:host{--_disabled-selected-icon-color: var(--md-radio-disabled-selected-icon-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-selected-icon-opacity: var(--md-radio-disabled-selected-icon-opacity, 0.38);--_disabled-unselected-icon-color: var(--md-radio-disabled-unselected-icon-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-unselected-icon-opacity: var(--md-radio-disabled-unselected-icon-opacity, 0.38);--_icon-size: var(--md-radio-icon-size, 20px);--_selected-focus-icon-color: var(--md-radio-selected-focus-icon-color, var(--md-sys-color-primary, #6750a4));--_selected-focus-state-layer-color: var(--md-radio-selected-focus-state-layer-color, var(--md-sys-color-primary, #6750a4));--_selected-focus-state-layer-opacity: var(--md-radio-selected-focus-state-layer-opacity, 0.12);--_selected-hover-icon-color: var(--md-radio-selected-hover-icon-color, var(--md-sys-color-primary, #6750a4));--_selected-hover-state-layer-color: var(--md-radio-selected-hover-state-layer-color, var(--md-sys-color-primary, #6750a4));--_selected-hover-state-layer-opacity: var(--md-radio-selected-hover-state-layer-opacity, 0.08);--_selected-icon-color: var(--md-radio-selected-icon-color, var(--md-sys-color-primary, #6750a4));--_selected-pressed-icon-color: var(--md-radio-selected-pressed-icon-color, var(--md-sys-color-primary, #6750a4));--_selected-pressed-state-layer-color: var(--md-radio-selected-pressed-state-layer-color, var(--md-sys-color-on-surface, #1c1b1f));--_selected-pressed-state-layer-opacity: var(--md-radio-selected-pressed-state-layer-opacity, 0.12);--_state-layer-size: var(--md-radio-state-layer-size, 40px);--_unselected-focus-icon-color: var(--md-radio-unselected-focus-icon-color, var(--md-sys-color-on-surface, #1c1b1f));--_unselected-focus-state-layer-color: var(--md-radio-unselected-focus-state-layer-color, var(--md-sys-color-on-surface, #1c1b1f));--_unselected-focus-state-layer-opacity: var(--md-radio-unselected-focus-state-layer-opacity, 0.12);--_unselected-hover-icon-color: var(--md-radio-unselected-hover-icon-color, var(--md-sys-color-on-surface, #1c1b1f));--_unselected-hover-state-layer-color: var(--md-radio-unselected-hover-state-layer-color, var(--md-sys-color-on-surface, #1c1b1f));--_unselected-hover-state-layer-opacity: var(--md-radio-unselected-hover-state-layer-opacity, 0.08);--_unselected-icon-color: var(--md-radio-unselected-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_unselected-pressed-icon-color: var(--md-radio-unselected-pressed-icon-color, var(--md-sys-color-on-surface, #1c1b1f));--_unselected-pressed-state-layer-color: var(--md-radio-unselected-pressed-state-layer-color, var(--md-sys-color-primary, #6750a4));--_unselected-pressed-state-layer-opacity: var(--md-radio-unselected-pressed-state-layer-opacity, 0.12);--md-ripple-focus-state-layer-color:var(--_unselected-focus-state-layer-color);--md-ripple-focus-state-layer-opacity:var(--_unselected-focus-state-layer-opacity);--md-ripple-hover-state-layer-color:var(--_unselected-hover-state-layer-color);--md-ripple-hover-state-layer-opacity:var(--_unselected-hover-state-layer-opacity);--md-ripple-pressed-state-layer-color:var(--_unselected-pressed-state-layer-color);--md-ripple-pressed-state-layer-opacity:var(--_unselected-pressed-state-layer-opacity);--md-focus-ring-offset-vertical:-2px;--md-focus-ring-offset-horizontal:-2px;display:inline-flex;height:48px;position:relative;vertical-align:top;width:48px;-webkit-tap-highlight-color:rgba(0,0,0,0)}:host([checked]){--md-ripple-focus-state-layer-color:var(--_selected-focus-state-layer-color);--md-ripple-focus-state-layer-opacity:var(--_selected-focus-state-layer-opacity);--md-ripple-hover-state-layer-color:var(--_selected-hover-state-layer-color);--md-ripple-hover-state-layer-opacity:var(--_selected-hover-state-layer-opacity);--md-ripple-pressed-state-layer-color:var(--_selected-pressed-state-layer-color);--md-ripple-pressed-state-layer-opacity:var(--_selected-pressed-state-layer-opacity)}input,md-ripple,.icon{inset:0;margin:auto;position:absolute}input{appearance:none;outline:none}md-ripple{height:var(--_state-layer-size);width:var(--_state-layer-size)}.icon{fill:var(--_unselected-icon-color);height:var(--_icon-size);width:var(--_icon-size)}.outer.circle{transition:fill 50ms linear}.inner.circle{opacity:0;transform-origin:center;transition:opacity 50ms linear}:host([checked]) .icon{fill:var(--_selected-icon-color)}:host([checked]) .inner.circle{animation:inner-circle-grow 300ms cubic-bezier(0.05, 0.7, 0.1, 1);opacity:1}@keyframes inner-circle-grow{from{transform:scale(0)}to{transform:scale(1)}}:host([disabled]) .circle{animation-duration:0s;transition-duration:0s}:host(:hover) .icon{fill:var(--_unselected-hover-icon-color)}:host(:focus-within) .icon{fill:var(--_unselected-focus-icon-color)}:host(:active) .icon{fill:var(--_unselected-pressed-icon-color)}:host([disabled]) .icon{fill:var(--_disabled-unselected-icon-color);opacity:var(--_disabled-unselected-icon-opacity)}:host([checked]:hover) .icon{fill:var(--_selected-hover-icon-color)}:host([checked]:focus-within) .icon{fill:var(--_selected-focus-icon-color)}:host([checked]:active) .icon{fill:var(--_selected-pressed-icon-color)}:host([checked][disabled]) .icon{fill:var(--_disabled-selected-icon-color);opacity:var(--_disabled-selected-icon-opacity)}/*# sourceMappingURL=radio-styles.css.map */ +export const styles = css `:host{--_disabled-selected-icon-color: var(--md-radio-disabled-selected-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-selected-icon-opacity: var(--md-radio-disabled-selected-icon-opacity, 0.38);--_disabled-unselected-icon-color: var(--md-radio-disabled-unselected-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-unselected-icon-opacity: var(--md-radio-disabled-unselected-icon-opacity, 0.38);--_icon-size: var(--md-radio-icon-size, 20px);--_selected-focus-icon-color: var(--md-radio-selected-focus-icon-color, var(--md-sys-color-primary, #6750a4));--_selected-focus-state-layer-color: var(--md-radio-selected-focus-state-layer-color, var(--md-sys-color-primary, #6750a4));--_selected-focus-state-layer-opacity: var(--md-radio-selected-focus-state-layer-opacity, 0.12);--_selected-hover-icon-color: var(--md-radio-selected-hover-icon-color, var(--md-sys-color-primary, #6750a4));--_selected-hover-state-layer-color: var(--md-radio-selected-hover-state-layer-color, var(--md-sys-color-primary, #6750a4));--_selected-hover-state-layer-opacity: var(--md-radio-selected-hover-state-layer-opacity, 0.08);--_selected-icon-color: var(--md-radio-selected-icon-color, var(--md-sys-color-primary, #6750a4));--_selected-pressed-icon-color: var(--md-radio-selected-pressed-icon-color, var(--md-sys-color-primary, #6750a4));--_selected-pressed-state-layer-color: var(--md-radio-selected-pressed-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_selected-pressed-state-layer-opacity: var(--md-radio-selected-pressed-state-layer-opacity, 0.12);--_state-layer-size: var(--md-radio-state-layer-size, 40px);--_unselected-focus-icon-color: var(--md-radio-unselected-focus-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-focus-state-layer-color: var(--md-radio-unselected-focus-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-focus-state-layer-opacity: var(--md-radio-unselected-focus-state-layer-opacity, 0.12);--_unselected-hover-icon-color: var(--md-radio-unselected-hover-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-hover-state-layer-color: var(--md-radio-unselected-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-hover-state-layer-opacity: var(--md-radio-unselected-hover-state-layer-opacity, 0.08);--_unselected-icon-color: var(--md-radio-unselected-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_unselected-pressed-icon-color: var(--md-radio-unselected-pressed-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-pressed-state-layer-color: var(--md-radio-unselected-pressed-state-layer-color, var(--md-sys-color-primary, #6750a4));--_unselected-pressed-state-layer-opacity: var(--md-radio-unselected-pressed-state-layer-opacity, 0.12);--md-ripple-focus-color:var(--_unselected-focus-state-layer-color);--md-ripple-focus-opacity:var(--_unselected-focus-state-layer-opacity);--md-ripple-hover-color:var(--_unselected-hover-state-layer-color);--md-ripple-hover-opacity:var(--_unselected-hover-state-layer-opacity);--md-ripple-pressed-color:var(--_unselected-pressed-state-layer-color);--md-ripple-pressed-opacity:var(--_unselected-pressed-state-layer-opacity);--md-focus-ring-offset: -2px;display:inline-flex;height:48px;position:relative;vertical-align:top;width:48px;-webkit-tap-highlight-color:rgba(0,0,0,0)}:host([checked]){--md-ripple-focus-color:var(--_selected-focus-state-layer-color);--md-ripple-focus-opacity:var(--_selected-focus-state-layer-opacity);--md-ripple-hover-color:var(--_selected-hover-state-layer-color);--md-ripple-hover-opacity:var(--_selected-hover-state-layer-opacity);--md-ripple-pressed-color:var(--_selected-pressed-state-layer-color);--md-ripple-pressed-opacity:var(--_selected-pressed-state-layer-opacity)}input,md-ripple,.icon{inset:0;margin:auto;position:absolute}input{appearance:none;outline:none}md-ripple{height:var(--_state-layer-size);width:var(--_state-layer-size)}.icon{fill:var(--_unselected-icon-color);height:var(--_icon-size);width:var(--_icon-size)}.outer.circle{transition:fill 50ms linear}.inner.circle{opacity:0;transform-origin:center;transition:opacity 50ms linear}:host([checked]) .icon{fill:var(--_selected-icon-color)}:host([checked]) .inner.circle{animation:inner-circle-grow 300ms cubic-bezier(0.05, 0.7, 0.1, 1);opacity:1}@keyframes inner-circle-grow{from{transform:scale(0)}to{transform:scale(1)}}:host([disabled]) .circle{animation-duration:0s;transition-duration:0s}:host(:hover) .icon{fill:var(--_unselected-hover-icon-color)}:host(:focus-within) .icon{fill:var(--_unselected-focus-icon-color)}:host(:active) .icon{fill:var(--_unselected-pressed-icon-color)}:host([disabled]) .icon{fill:var(--_disabled-unselected-icon-color);opacity:var(--_disabled-unselected-icon-opacity)}:host([checked]:hover) .icon{fill:var(--_selected-hover-icon-color)}:host([checked]:focus-within) .icon{fill:var(--_selected-focus-icon-color)}:host([checked]:active) .icon{fill:var(--_selected-pressed-icon-color)}:host([checked][disabled]) .icon{fill:var(--_disabled-selected-icon-color);opacity:var(--_disabled-selected-icon-opacity)}/*# sourceMappingURL=radio-styles.css.map */ `; //# sourceMappingURL=radio-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/radio/lib/radio.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/radio/lib/radio.d.ts index e824446..5727960 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/radio/lib/radio.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/radio/lib/radio.d.ts
@@ -5,7 +5,7 @@ */ import '../../focus/focus-ring.js'; import '../../ripple/ripple.js'; -import { LitElement, TemplateResult } from 'lit'; +import { LitElement } from 'lit'; import { getFormValue } from '../../controller/form-controller.js'; declare const CHECKED: unique symbol; /** @@ -35,7 +35,6 @@ * The HTML name to use in form submission. */ name: string; - ariaLabel: string; /** * The associated form element with which this element's value will submit. */ @@ -43,18 +42,13 @@ private readonly input; private readonly ripple; private readonly selectionController; - private showFocusRing; private showRipple; constructor(); [getFormValue](): string; focus(): void; - protected render(): TemplateResult; - private handleBlur; - private handleFocus; + protected render(): import("lit-html").TemplateResult<1>; private handleChange; - private handlePointerDown; private readonly getRipple; private readonly renderRipple; - private renderFocusRing; } export {};
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/radio/lib/radio.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/radio/lib/radio.js index 488bdb2..1c70911 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/radio/lib/radio.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/radio/lib/radio.js
@@ -3,17 +3,16 @@ * Copyright 2018 Google LLC * SPDX-License-Identifier: Apache-2.0 */ -var _a; -import { __decorate, __metadata } from "tslib"; +var _a, _b; +import { __decorate } from "tslib"; import '../../focus/focus-ring.js'; import '../../ripple/ripple.js'; -import { html, LitElement, nothing } from 'lit'; +import { html, isServer, LitElement, nothing } from 'lit'; import { property, query, queryAsync, state } from 'lit/decorators.js'; import { when } from 'lit/directives/when.js'; +import { requestUpdateOnAriaChange } from '../../aria/delegate.js'; import { dispatchActivationClick, isActivationClick, redispatchEvent } from '../../controller/events.js'; import { FormController, getFormValue } from '../../controller/form-controller.js'; -import { ariaProperty } from '../../decorators/aria-property.js'; -import { pointerPress, shouldShowStrongFocus } from '../../focus/strong-focus.js'; import { ripple } from '../../ripple/directive.js'; import { SingleSelectionController } from './single-selection-controller.js'; const CHECKED = Symbol('checked'); @@ -21,41 +20,6 @@ * A radio component. */ export class Radio extends LitElement { - constructor() { - super(); - this[_a] = false; - /** - * Whether or not the radio is disabled. - */ - this.disabled = false; - /** - * The element value to use in form submission when checked. - */ - this.value = 'on'; - /** - * The HTML name to use in form submission. - */ - this.name = ''; - this.selectionController = new SingleSelectionController(this); - this.showFocusRing = false; - this.showRipple = false; - this.getRipple = () => { - this.showRipple = true; - return this.ripple; - }; - this.renderRipple = () => { - return html `<md-ripple unbounded ?disabled=${this.disabled}></md-ripple>`; - }; - this.addController(new FormController(this)); - this.addController(this.selectionController); - this.addEventListener('click', (event) => { - if (!isActivationClick(event)) { - return; - } - this.focus(); - dispatchActivationClick(this.input); - }); - } /** * Whether or not the radio is selected. */ @@ -77,16 +41,54 @@ get form() { return this.closest('form'); } - [(_a = CHECKED, getFormValue)]() { + constructor() { + super(); + this[_b] = false; + /** + * Whether or not the radio is disabled. + */ + this.disabled = false; + /** + * The element value to use in form submission when checked. + */ + this.value = 'on'; + /** + * The HTML name to use in form submission. + */ + this.name = ''; + this.selectionController = new SingleSelectionController(this); + this.showRipple = false; + this.getRipple = () => { + this.showRipple = true; + return this.ripple; + }; + this.renderRipple = () => { + return html `<md-ripple unbounded ?disabled=${this.disabled}></md-ripple>`; + }; + this.addController(new FormController(this)); + this.addController(this.selectionController); + if (!isServer) { + this.addEventListener('click', (event) => { + if (!isActivationClick(event)) { + return; + } + this.focus(); + dispatchActivationClick(this.input); + }); + } + } + [(_b = CHECKED, getFormValue)]() { return this.checked ? this.value : null; } focus() { this.input?.focus(); } render() { + // Needed for closure conformance + const { ariaLabel } = this; return html ` ${when(this.showRipple, this.renderRipple)} - ${this.renderFocusRing()} + <md-focus-ring for="input"></md-focus-ring> <svg class="icon" viewBox="0 0 20 20"> <mask id="cutout"> <rect width="100%" height="100%" fill="white" /> @@ -96,26 +98,18 @@ <circle class="inner circle" cx="10" cy="10" r="5" /> </svg> <input + id="input" type="radio" name=${this.name} - aria-label=${this.ariaLabel || nothing} + aria-label=${ariaLabel || nothing} .checked=${this.checked} .value=${this.value} ?disabled=${this.disabled} @change=${this.handleChange} - @focus=${this.handleFocus} - @blur=${this.handleBlur} - @pointerdown=${this.handlePointerDown} ${ripple(this.getRipple)} > `; } - handleBlur() { - this.showFocusRing = false; - } - handleFocus() { - this.showFocusRing = shouldShowStrongFocus(); - } handleChange(event) { if (this.disabled) { return; @@ -124,56 +118,35 @@ this.checked = true; redispatchEvent(this, event); } - handlePointerDown() { - pointerPress(); - this.showFocusRing = shouldShowStrongFocus(); - } - renderFocusRing() { - return html `<md-focus-ring .visible=${this.showFocusRing}></md-focus-ring>`; - } } +_a = Radio; +(() => { + requestUpdateOnAriaChange(_a); +})(); Radio.shadowRootOptions = { ...LitElement.shadowRootOptions, delegatesFocus: true }; /** * @nocollapse */ Radio.formAssociated = true; __decorate([ - property({ type: Boolean, reflect: true }), - __metadata("design:type", Boolean), - __metadata("design:paramtypes", [Boolean]) + property({ type: Boolean, reflect: true }) ], Radio.prototype, "checked", null); __decorate([ - property({ type: Boolean, reflect: true }), - __metadata("design:type", Object) + property({ type: Boolean, reflect: true }) ], Radio.prototype, "disabled", void 0); __decorate([ - property({ type: String }), - __metadata("design:type", Object) + property() ], Radio.prototype, "value", void 0); __decorate([ - property({ type: String, reflect: true }), - __metadata("design:type", Object) + property({ reflect: true }) ], Radio.prototype, "name", void 0); __decorate([ - ariaProperty // tslint:disable-line:no-new-decorators - , - property({ attribute: 'data-aria-label', noAccessor: true }), - __metadata("design:type", String) -], Radio.prototype, "ariaLabel", void 0); -__decorate([ - query('input'), - __metadata("design:type", HTMLInputElement) + query('input') ], Radio.prototype, "input", void 0); __decorate([ - queryAsync('md-ripple'), - __metadata("design:type", Promise) + queryAsync('md-ripple') ], Radio.prototype, "ripple", void 0); __decorate([ - state(), - __metadata("design:type", Object) -], Radio.prototype, "showFocusRing", void 0); -__decorate([ - state(), - __metadata("design:type", Object) + state() ], Radio.prototype, "showRipple", void 0); //# sourceMappingURL=radio.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/ripple/directive.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/ripple/directive.d.ts index 573991d0..0566188 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/ripple/directive.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/ripple/directive.d.ts
@@ -10,46 +10,14 @@ * * Use with `await rippleFunction()` */ -declare type RippleFunction = () => Ripple | null | Promise<Ripple | null>; +type RippleFunction = () => Ripple | null | Promise<Ripple | null>; declare class RippleDirective extends Directive { private rippleGetter; private element?; - private state; - private checkBoundsAfterContextMenu; - private rippleStartEvent; - private touchTimer; - private clickTimer; constructor(partInfo: PartInfo); render(ripple: RippleFunction | Promise<Ripple | null>): symbol; handleEvent(event: Event): Promise<void>; update(part: ElementPart, [ripple]: DirectiveParameters<this>): symbol; - /** - * Returns `true` if - * - the ripple element is enabled - * - the pointer is primary for the input type - * - the pointer is the pointer that started the interaction, or will start - * the interaction - * - the pointer is a touch, or the pointer state has the primary button - * held, or the pointer is hovering - */ - private shouldReactToEvent; - private isTouch; - /** - * Check if the event is within the bounds of the element. - * - * This is only needed for the "stuck" contextmenu longpress on Chrome. - */ - private inBounds; - private beginPress; - private endPress; - private waitForTouchHold; - private click; - private contextMenu; - private pointerDown; - private pointerUp; - private pointerCancel; - private pointerEnter; - private pointerLeave; } /** * Connects a Ripple element to a node that drives the interaction
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/ripple/directive.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/ripple/directive.js index 99bcc1c..0ca5e3a5 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/ripple/directive.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/ripple/directive.js
@@ -5,65 +5,10 @@ */ import { noChange } from 'lit'; import { Directive, directive, PartType } from 'lit/directive.js'; -/** - * Delay reacting to touch so that we do not show the ripple for a swipe or - * scroll interaction. - */ -const TOUCH_DELAY_MS = 150; -/** - * Interaction states for the ripple. - * - * On Touch: - * - `INACTIVE -> TOUCH_DELAY -> WAITING_FOR_CLICK -> INACTIVE` - * - `INACTIVE -> TOUCH_DELAY -> HOLDING -> WAITING_FOR_CLICK -> INACTIVE` - * - * On Mouse or Pen: - * - `INACTIVE -> WAITING_FOR_CLICK -> INACTIVE` - */ -var State; -(function (State) { - /** - * Initial state of the control, no touch in progress. - * - * Transitions: - * - on touch down: transition to `TOUCH_DELAY`. - * - on mouse down: transition to `WAITING_FOR_CLICK`. - */ - State[State["INACTIVE"] = 0] = "INACTIVE"; - /** - * Touch down has been received, waiting to determine if it's a swipe or - * scroll. - * - * Transitions: - * - on touch up: beginPress(); transition to `WAITING_FOR_CLICK`. - * - on cancel: transition to `INACTIVE`. - * - after `TOUCH_DELAY_MS`: beginPress(); transition to `HOLDING`. - */ - State[State["TOUCH_DELAY"] = 1] = "TOUCH_DELAY"; - /** - * A touch has been deemed to be a press - * - * Transitions: - * - on up: transition to `WAITING_FOR_CLICK`. - */ - State[State["HOLDING"] = 2] = "HOLDING"; - /** - * The user touch has finished, transition into rest state. - * - * Transitions: - * - on click endPress(); transition to `INACTIVE`. - */ - State[State["WAITING_FOR_CLICK"] = 3] = "WAITING_FOR_CLICK"; -})(State || (State = {})); class RippleDirective extends Directive { constructor(partInfo) { super(partInfo); this.rippleGetter = async () => null; - this.state = State.INACTIVE; - this.checkBoundsAfterContextMenu = false; - this.rippleStartEvent = null; - this.touchTimer = null; - this.clickTimer = null; if (partInfo.type !== PartType.ELEMENT) { throw new Error('The `ripple` directive must be used on an element'); } @@ -80,25 +25,25 @@ } switch (event.type) { case 'click': - this.click(ripple); + ripple.handleClick(); break; case 'contextmenu': - this.contextMenu(ripple); + ripple.handleContextmenu(); break; case 'pointercancel': - this.pointerCancel(ripple, event); + ripple.handlePointercancel(event); break; case 'pointerdown': - this.pointerDown(ripple, event); + await ripple.handlePointerdown(event); break; case 'pointerenter': - this.pointerEnter(ripple, event); + ripple.handlePointerenter(event); break; case 'pointerleave': - this.pointerLeave(ripple, event); + ripple.handlePointerleave(event); break; case 'pointerup': - this.pointerUp(ripple, event); + ripple.handlePointerup(event); break; default: break; @@ -121,138 +66,6 @@ this.rippleGetter = typeof ripple === 'function' ? ripple : () => ripple; return noChange; } - /** - * Returns `true` if - * - the ripple element is enabled - * - the pointer is primary for the input type - * - the pointer is the pointer that started the interaction, or will start - * the interaction - * - the pointer is a touch, or the pointer state has the primary button - * held, or the pointer is hovering - */ - shouldReactToEvent(ripple, ev, hovering = false) { - const enabled = !ripple.disabled; - const isPrimaryPointer = ev.isPrimary; - const isInteractionPointer = this.rippleStartEvent === null || - this.rippleStartEvent.pointerId === ev.pointerId; - const isPrimaryButton = ev.buttons === 1; - return enabled && isPrimaryPointer && isInteractionPointer && - (this.isTouch(ev) || isPrimaryButton || hovering); - } - isTouch({ pointerType }) { - return pointerType === 'touch'; - } - /** - * Check if the event is within the bounds of the element. - * - * This is only needed for the "stuck" contextmenu longpress on Chrome. - */ - inBounds({ x, y }) { - const { top, left, bottom, right } = this.element.getBoundingClientRect(); - return x >= left && x <= right && y >= top && y <= bottom; - } - beginPress(ripple) { - ripple.beginPress(this.rippleStartEvent); - } - endPress(ripple) { - ripple.endPress(); - this.state = State.INACTIVE; - this.rippleStartEvent = null; - if (this.touchTimer) { - clearTimeout(this.touchTimer); - this.touchTimer = null; - } - if (this.clickTimer) { - clearTimeout(this.clickTimer); - this.clickTimer = null; - } - } - waitForTouchHold() { - if (this.touchTimer !== null) { - clearTimeout(this.touchTimer); - } - this.state = State.TOUCH_DELAY; - this.touchTimer = setTimeout(async () => { - const ripple = await this.rippleGetter(); - if (ripple === null || this.state !== State.TOUCH_DELAY) { - return; - } - this.state = State.HOLDING; - this.beginPress(ripple); - }, TOUCH_DELAY_MS); - } - click(ripple) { - // Click is a MouseEvent in Firefox and Safari, so we cannot use - // `shouldReactToEvent` - if (ripple.disabled) { - return; - } - if (this.state === State.WAITING_FOR_CLICK) { - this.endPress(ripple); - } - else if (this.state === State.INACTIVE) { - // keyboard synthesized click event - this.beginPress(ripple); - this.endPress(ripple); - } - } - contextMenu(ripple) { - if (!ripple.disabled) { - this.checkBoundsAfterContextMenu = true; - this.endPress(ripple); - } - } - pointerDown(ripple, ev) { - if (!this.shouldReactToEvent(ripple, ev)) { - return; - } - this.rippleStartEvent = ev; - if (this.isTouch(ev)) { - // after a longpress contextmenu event, an extra `pointerdown` can be - // dispatched to the pressed element. Check that the down is within - // bounds of the element in this case. - if (this.checkBoundsAfterContextMenu && !this.inBounds(ev)) { - return; - } - this.checkBoundsAfterContextMenu = false; - this.waitForTouchHold(); - } - else { - this.state = State.WAITING_FOR_CLICK; - this.beginPress(ripple); - } - } - pointerUp(ripple, ev) { - if (!this.isTouch(ev) || !this.shouldReactToEvent(ripple, ev)) { - return; - } - if (this.state === State.HOLDING) { - this.state = State.WAITING_FOR_CLICK; - } - else if (this.state === State.TOUCH_DELAY) { - this.state = State.WAITING_FOR_CLICK; - this.beginPress(ripple); - } - } - pointerCancel(ripple, ev) { - if (this.shouldReactToEvent(ripple, ev)) { - this.endPress(ripple); - } - } - pointerEnter(ripple, ev) { - if (this.shouldReactToEvent(ripple, ev, true)) { - ripple.beginHover(ev); - } - } - pointerLeave(ripple, ev) { - if (this.shouldReactToEvent(ripple, ev, true)) { - ripple.endHover(); - // release a held mouse or pen press that moves outside the element - if (!this.isTouch(ev) && this.state !== State.INACTIVE) { - this.endPress(ripple); - } - } - } } /** * Connects a Ripple element to a node that drives the interaction
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/ripple/lib/ripple-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/ripple/lib/ripple-styles.css.js index 3dba349..671b081f 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/ripple/lib/ripple-styles.css.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/ripple/lib/ripple-styles.css.js
@@ -4,6 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ import { css } from 'lit'; -export const styles = css `:host{--_dragged-state-layer-opacity: var(--md-ripple-dragged-state-layer-opacity, 0.16);--_focus-state-layer-opacity: var(--md-ripple-focus-state-layer-opacity, 0.12);--_hover-state-layer-opacity: var(--md-ripple-hover-state-layer-opacity, 0.08);--_pressed-state-layer-opacity: var(--md-ripple-pressed-state-layer-opacity, 0.12);--_state-layer-shape: var(--md-ripple-state-layer-shape, 0px);--_focus-state-layer-color: var(--md-ripple-focus-state-layer-color, black);--_hover-state-layer-color: var(--md-ripple-hover-state-layer-color, black);--_pressed-state-layer-color: var(--md-ripple-pressed-state-layer-color, black);--_dragged-state-layer-color: var(--md-ripple-dragged-state-layer-color, black)}:host{display:flex}:host([disabled]){opacity:0}:host,.md3-ripple-surface{position:absolute;inset:0;pointer-events:none;overflow:hidden}.md3-ripple-surface{will-change:transform;border-radius:var(--_state-layer-shape);outline:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.md3-ripple-surface::before,.md3-ripple-surface::after{position:absolute;opacity:0;pointer-events:none;content:""}.md3-ripple-surface::before{background-color:var(--_hover-state-layer-color);transition:opacity 15ms linear,background-color 15ms linear;inset:0}.md3-ripple-surface::after{background:radial-gradient(closest-side, var(--_pressed-state-layer-color) max(100% - 70px, 65%), transparent 100%);transition:opacity 375ms linear;transform-origin:center center}.md3-ripple--hovered::before{background-color:var(--_hover-state-layer-color);opacity:var(--_hover-state-layer-opacity)}.md3-ripple--focused::before{background-color:var(--_focus-state-layer-color);opacity:var(--_focus-state-layer-opacity);transition-duration:75ms}.md3-ripple--pressed::after{opacity:var(--_pressed-state-layer-opacity);transition-duration:105ms}.md3-ripple--unbounded{--_state-layer-shape: var(--md-ripple-state-layer-shape, 9999px)}@media screen and (forced-colors: active){:host{display:none}}/*# sourceMappingURL=ripple-styles.css.map */ +export const styles = css `:host{--_focus-color: var(--md-ripple-focus-color, var(--md-sys-color-on-surface, #1d1b20));--_focus-opacity: var(--md-ripple-focus-opacity, 0.12);--_hover-color: var(--md-ripple-hover-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-opacity: var(--md-ripple-hover-opacity, 0.08);--_pressed-color: var(--md-ripple-pressed-color, var(--md-sys-color-on-surface, #1d1b20));--_pressed-opacity: var(--md-ripple-pressed-opacity, 0.12);--_shape: var(--md-ripple-shape, 0px)}:host{display:flex}:host([disabled]){opacity:0}:host,.surface{position:absolute;inset:0;pointer-events:none;overflow:hidden}.surface{will-change:transform;border-radius:var(--_shape);outline:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.surface::before,.surface::after{position:absolute;opacity:0;pointer-events:none;content:""}.surface::before{background-color:var(--_hover-color);transition:opacity 15ms linear,background-color 15ms linear;inset:0}.surface::after{background:radial-gradient(closest-side, var(--_pressed-color) max(100% - 70px, 65%), transparent 100%);transition:opacity 375ms linear;transform-origin:center center}.hovered::before{background-color:var(--_hover-color);opacity:var(--_hover-opacity)}.focused::before{background-color:var(--_focus-color);opacity:var(--_focus-opacity);transition-duration:75ms}.pressed::after{opacity:var(--_pressed-opacity);transition-duration:105ms}.unbounded{--_shape: var(--md-ripple-shape, 9999px)}@media screen and (forced-colors: active){:host{display:none}}/*# sourceMappingURL=ripple-styles.css.map */ `; //# sourceMappingURL=ripple-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/ripple/lib/ripple.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/ripple/lib/ripple.d.ts index 6bd0ad4..720d6c04 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/ripple/lib/ripple.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/ripple/lib/ripple.d.ts
@@ -3,60 +3,62 @@ * Copyright 2022 Google LLC * SPDX-License-Identifier: Apache-2.0 */ -import { LitElement, PropertyValues, TemplateResult } from 'lit'; -import { ClassInfo } from 'lit/directives/class-map.js'; -/** @soyCompatible */ +import { LitElement, PropertyValues } from 'lit'; +/** + * A ripple component. + */ export declare class Ripple extends LitElement { - mdRoot: HTMLElement; + /** + * Sets the ripple to be an unbounded circle. + */ unbounded: boolean; + /** + * Disables the ripple. + */ disabled: boolean; - protected hovered: boolean; - protected focused: boolean; - protected pressed: boolean; - protected rippleSize: string; - protected rippleScale: string; - protected initialSize: number; - protected pressAnimationSignal: import("../../motion/animation.js").AnimationSignal; - protected growAnimation: Animation | null; - protected delayedEndPressHandle: number | null; - /** @soyTemplate */ - protected render(): TemplateResult; - /** @soyTemplate */ - protected getRenderRippleClasses(): ClassInfo; + private hovered; + private focused; + private pressed; + private readonly mdRoot; + private rippleSize; + private rippleScale; + private initialSize; + private growAnimation?; + private state; + private rippleStartEvent?; + private checkBoundsAfterContextMenu; + handlePointerenter(event: PointerEvent): void; + handlePointerleave(event: PointerEvent): void; + handleFocusin(): void; + handleFocusout(): void; + handlePointerup(event: PointerEvent): void; + handlePointerdown(event: PointerEvent): Promise<void>; + handleClick(): void; + handlePointercancel(event: PointerEvent): void; + handleContextmenu(): void; + protected render(): import("lit-html").TemplateResult<1>; protected update(changedProps: PropertyValues<this>): void; - protected getDimensions(): DOMRect; - protected determineRippleSize(): void; - protected getNormalizedPointerEventCoords(pointerEvent: PointerEvent): { - x: number; - y: number; - }; - protected getTranslationCoordinates(positionEvent?: Event | null): { - startPoint: { - x: number; - y: number; - }; - endPoint: { - x: number; - y: number; - }; - }; - protected startPressAnimation(positionEvent?: Event | null): void; + private getDimensions; + private determineRippleSize; + private getNormalizedPointerEventCoords; + private getTranslationCoordinates; + private startPressAnimation; + private endPressAnimation; /** - * @deprecated Use beginHover + * Returns `true` if + * - the ripple element is enabled + * - the pointer is primary for the input type + * - the pointer is the pointer that started the interaction, or will start + * the interaction + * - the pointer is a touch, or the pointer state has the primary button + * held, or the pointer is hovering */ - startHover(hoverEvent?: Event): void; - beginHover(hoverEvent?: Event): void; - endHover(): void; + private shouldReactToEvent; /** - * @deprecated Use beginFocus + * Check if the event is within the bounds of the element. + * + * This is only needed for the "stuck" contextmenu longpress on Chrome. */ - startFocus(): void; - beginFocus(): void; - endFocus(): void; - /** - * @deprecated Use beginPress - */ - startPress(positionEvent?: Event | null): void; - beginPress(positionEvent?: Event | null): void; - endPress(): void; + private inBounds; + private isTouch; }
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/ripple/lib/ripple.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/ripple/lib/ripple.js index cef389d9..8df1efd0 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/ripple/lib/ripple.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/ripple/lib/ripple.js
@@ -3,11 +3,11 @@ * Copyright 2022 Google LLC * SPDX-License-Identifier: Apache-2.0 */ -import { __decorate, __metadata } from "tslib"; +import { __decorate } from "tslib"; import { html, LitElement } from 'lit'; import { property, query, state } from 'lit/decorators.js'; import { classMap } from 'lit/directives/class-map.js'; -import { createAnimationSignal, EASING } from '../../motion/animation.js'; +import { EASING } from '../../motion/animation.js'; const PRESS_GROW_MS = 450; const MINIMUM_PRESS_MS = 225; const INITIAL_ORIGIN_SCALE = 0.2; @@ -16,14 +16,72 @@ const SOFT_EDGE_CONTAINER_RATIO = 0.35; const PRESS_PSEUDO = '::after'; const ANIMATION_FILL = 'forwards'; -/** @soyCompatible */ +/** + * Interaction states for the ripple. + * + * On Touch: + * - `INACTIVE -> TOUCH_DELAY -> WAITING_FOR_CLICK -> INACTIVE` + * - `INACTIVE -> TOUCH_DELAY -> HOLDING -> WAITING_FOR_CLICK -> INACTIVE` + * + * On Mouse or Pen: + * - `INACTIVE -> WAITING_FOR_CLICK -> INACTIVE` + */ +var State; +(function (State) { + /** + * Initial state of the control, no touch in progress. + * + * Transitions: + * - on touch down: transition to `TOUCH_DELAY`. + * - on mouse down: transition to `WAITING_FOR_CLICK`. + */ + State[State["INACTIVE"] = 0] = "INACTIVE"; + /** + * Touch down has been received, waiting to determine if it's a swipe or + * scroll. + * + * Transitions: + * - on touch up: begin press; transition to `WAITING_FOR_CLICK`. + * - on cancel: transition to `INACTIVE`. + * - after `TOUCH_DELAY_MS`: begin press; transition to `HOLDING`. + */ + State[State["TOUCH_DELAY"] = 1] = "TOUCH_DELAY"; + /** + * A touch has been deemed to be a press + * + * Transitions: + * - on up: transition to `WAITING_FOR_CLICK`. + */ + State[State["HOLDING"] = 2] = "HOLDING"; + /** + * The user touch has finished, transition into rest state. + * + * Transitions: + * - on click end press; transition to `INACTIVE`. + */ + State[State["WAITING_FOR_CLICK"] = 3] = "WAITING_FOR_CLICK"; +})(State || (State = {})); +/** + * Delay reacting to touch so that we do not show the ripple for a swipe or + * scroll interaction. + */ +const TOUCH_DELAY_MS = 150; +/** + * A ripple component. + */ export class Ripple extends LitElement { constructor() { super(...arguments); // TODO(https://bugs.webkit.org/show_bug.cgi?id=247546) // Remove Safari workaround that requires reflecting `unbounded` so // it can be styled against. + /** + * Sets the ripple to be an unbounded circle. + */ this.unbounded = false; + /** + * Disables the ripple. + */ this.disabled = false; this.hovered = false; this.focused = false; @@ -31,28 +89,116 @@ this.rippleSize = ''; this.rippleScale = ''; this.initialSize = 0; - this.pressAnimationSignal = createAnimationSignal(); - this.growAnimation = null; - this.delayedEndPressHandle = null; + this.state = State.INACTIVE; + this.checkBoundsAfterContextMenu = false; } - /** @soyTemplate */ + handlePointerenter(event) { + if (!this.shouldReactToEvent(event)) { + return; + } + this.hovered = true; + } + handlePointerleave(event) { + if (!this.shouldReactToEvent(event)) { + return; + } + this.hovered = false; + // release a held mouse or pen press that moves outside the element + if (this.state !== State.INACTIVE) { + this.endPressAnimation(); + } + } + handleFocusin() { + this.focused = true; + } + handleFocusout() { + this.focused = false; + } + handlePointerup(event) { + if (!this.shouldReactToEvent(event)) { + return; + } + if (this.state === State.HOLDING) { + this.state = State.WAITING_FOR_CLICK; + return; + } + if (this.state === State.TOUCH_DELAY) { + this.state = State.WAITING_FOR_CLICK; + this.startPressAnimation(this.rippleStartEvent); + return; + } + } + async handlePointerdown(event) { + if (!this.shouldReactToEvent(event)) { + return; + } + this.rippleStartEvent = event; + if (!this.isTouch(event)) { + this.state = State.WAITING_FOR_CLICK; + this.startPressAnimation(event); + return; + } + // after a longpress contextmenu event, an extra `pointerdown` can be + // dispatched to the pressed element. Check that the down is within + // bounds of the element in this case. + if (this.checkBoundsAfterContextMenu && !this.inBounds(event)) { + return; + } + this.checkBoundsAfterContextMenu = false; + // Wait for a hold after touch delay + this.state = State.TOUCH_DELAY; + await new Promise(resolve => { + setTimeout(resolve, TOUCH_DELAY_MS); + }); + if (this.state !== State.TOUCH_DELAY) { + return; + } + this.state = State.HOLDING; + this.startPressAnimation(event); + } + handleClick() { + // Click is a MouseEvent in Firefox and Safari, so we cannot use + // `shouldReactToEvent` + if (this.disabled) { + return; + } + if (this.state === State.WAITING_FOR_CLICK) { + this.endPressAnimation(); + return; + } + if (this.state === State.INACTIVE) { + // keyboard synthesized click event + this.startPressAnimation(); + this.endPressAnimation(); + } + } + handlePointercancel(event) { + if (!this.shouldReactToEvent(event)) { + return; + } + this.endPressAnimation(); + } + handleContextmenu() { + if (this.disabled) { + return; + } + this.checkBoundsAfterContextMenu = true; + this.endPressAnimation(); + } render() { - return html `<div class="md3-ripple-surface ${classMap(this.getRenderRippleClasses())}"></div>`; - } - /** @soyTemplate */ - getRenderRippleClasses() { - return { - 'md3-ripple--hovered': this.hovered, - 'md3-ripple--focused': this.focused, - 'md3-ripple--pressed': this.pressed, - 'md3-ripple--unbounded': this.unbounded, + const classes = { + 'hovered': this.hovered, + 'focused': this.focused, + 'pressed': this.pressed, + 'unbounded': this.unbounded, }; + return html `<div class="surface ${classMap(classes)}"></div>`; } update(changedProps) { if (changedProps.has('disabled') && this.disabled) { - this.endHover(); - this.endFocus(); - this.endPress(); + this.hovered = false; + this.focused = false; + this.pressed = false; } super.update(changedProps); } @@ -108,12 +254,16 @@ return { startPoint, endPoint }; } startPressAnimation(positionEvent) { + if (!this.mdRoot) { + return; + } + this.pressed = true; + this.growAnimation?.cancel(); this.determineRippleSize(); const { startPoint, endPoint } = this.getTranslationCoordinates(positionEvent); const translateStart = `${startPoint.x}px, ${startPoint.y}px`; const translateEnd = `${endPoint.x}px, ${endPoint.y}px`; - const signal = this.pressAnimationSignal.start(); - const growAnimation = this.mdRoot.animate({ + this.growAnimation = this.mdRoot.animate({ top: [0, 0], left: [0, 0], height: [this.rippleSize, this.rippleSize], @@ -128,91 +278,77 @@ easing: EASING.STANDARD, fill: ANIMATION_FILL }); - growAnimation.addEventListener('finish', () => { - this.pressAnimationSignal.finish(); - this.growAnimation = null; - }); - signal.addEventListener('abort', () => { - growAnimation.cancel(); - this.growAnimation = null; - }); - this.growAnimation = growAnimation; } - /** - * @deprecated Use beginHover - */ - startHover(hoverEvent) { - this.beginHover(hoverEvent); - } - beginHover(hoverEvent) { - if (hoverEvent?.pointerType !== 'touch') { - this.hovered = true; - } - } - endHover() { - this.hovered = false; - } - /** - * @deprecated Use beginFocus - */ - startFocus() { - this.beginFocus(); - } - beginFocus() { - this.focused = true; - } - endFocus() { - this.focused = false; - } - /** - * @deprecated Use beginPress - */ - startPress(positionEvent) { - this.beginPress(positionEvent); - } - beginPress(positionEvent) { - this.pressed = true; - if (this.delayedEndPressHandle !== null) { - clearTimeout(this.delayedEndPressHandle); - this.delayedEndPressHandle = null; - } - this.startPressAnimation(positionEvent); - } - endPress() { - const pressAnimationPlayState = this.growAnimation?.currentTime ?? Infinity; + async endPressAnimation() { + this.state = State.INACTIVE; + const animation = this.growAnimation; + const pressAnimationPlayState = animation?.currentTime ?? Infinity; if (pressAnimationPlayState >= MINIMUM_PRESS_MS) { this.pressed = false; + return; } - else { - this.delayedEndPressHandle = setTimeout(() => { - this.pressed = false; - this.delayedEndPressHandle = null; - }, MINIMUM_PRESS_MS - pressAnimationPlayState); + await new Promise(resolve => { + setTimeout(resolve, MINIMUM_PRESS_MS - pressAnimationPlayState); + }); + if (this.growAnimation !== animation) { + // A new press animation was started. The old animation was canceled and + // should not finish the pressed state. + return; } + this.pressed = false; + } + /** + * Returns `true` if + * - the ripple element is enabled + * - the pointer is primary for the input type + * - the pointer is the pointer that started the interaction, or will start + * the interaction + * - the pointer is a touch, or the pointer state has the primary button + * held, or the pointer is hovering + */ + shouldReactToEvent(event) { + if (this.disabled || !event.isPrimary) { + return false; + } + if (this.rippleStartEvent && + this.rippleStartEvent.pointerId !== event.pointerId) { + return false; + } + if (event.type === 'pointerenter' || event.type === 'pointerleave') { + return !this.isTouch(event); + } + const isPrimaryButton = event.buttons === 1; + return this.isTouch(event) || isPrimaryButton; + } + /** + * Check if the event is within the bounds of the element. + * + * This is only needed for the "stuck" contextmenu longpress on Chrome. + */ + inBounds({ x, y }) { + const { top, left, bottom, right } = this.getBoundingClientRect(); + return x >= left && x <= right && y >= top && y <= bottom; + } + isTouch({ pointerType }) { + return pointerType === 'touch'; } } __decorate([ - query('.md3-ripple-surface'), - __metadata("design:type", HTMLElement) -], Ripple.prototype, "mdRoot", void 0); -__decorate([ - property({ type: Boolean, reflect: true }), - __metadata("design:type", Object) + property({ type: Boolean, reflect: true }) ], Ripple.prototype, "unbounded", void 0); __decorate([ - property({ type: Boolean, reflect: true }), - __metadata("design:type", Object) + property({ type: Boolean, reflect: true }) ], Ripple.prototype, "disabled", void 0); __decorate([ - state(), - __metadata("design:type", Object) + state() ], Ripple.prototype, "hovered", void 0); __decorate([ - state(), - __metadata("design:type", Object) + state() ], Ripple.prototype, "focused", void 0); __decorate([ - state(), - __metadata("design:type", Object) + state() ], Ripple.prototype, "pressed", void 0); +__decorate([ + query('.surface') +], Ripple.prototype, "mdRoot", void 0); //# sourceMappingURL=ripple.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/ripple/ripple.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/ripple/ripple.d.ts index 6844b78..ff31f9e 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/ripple/ripple.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/ripple/ripple.d.ts
@@ -10,7 +10,15 @@ } } /** - * @soyCompatible + * @summary Ripples, also known as state layers, are visual indicators used to + * communicate the status of a component or interactive element. + * + * @description A state layer is a semi-transparent covering on an element that + * indicates its state. State layers provide a systematic approach to + * visualizing states by using opacity. A layer can be applied to an entire + * element or in a circular shape and only one state layer can be applied at a + * given time. + * * @final * @suppress {visibility} */
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/ripple/ripple.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/ripple/ripple.js index 806a2b7..ffb2832 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/ripple/ripple.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/ripple/ripple.js
@@ -8,7 +8,15 @@ import { Ripple } from './lib/ripple.js'; import { styles } from './lib/ripple-styles.css.js'; /** - * @soyCompatible + * @summary Ripples, also known as state layers, are visual indicators used to + * communicate the status of a component or interactive element. + * + * @description A state layer is a semi-transparent covering on an element that + * indicates its state. State layers provide a systematic approach to + * visualizing states by using opacity. A layer can be applied to an entire + * element or in a circular shape and only one state layer can be applied at a + * given time. + * * @final * @suppress {visibility} */
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/segmentedbutton/lib/outlined-segmented-button.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/segmentedbutton/lib/outlined-segmented-button.d.ts index 0496946..f54f9d6 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/segmentedbutton/lib/outlined-segmented-button.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/segmentedbutton/lib/outlined-segmented-button.d.ts
@@ -3,13 +3,22 @@ * Copyright 2022 Google LLC * SPDX-License-Identifier: Apache-2.0 */ -import { TemplateResult } from 'lit'; -import { ClassInfo } from 'lit/directives/class-map.js'; import { SegmentedButton } from './segmented-button.js'; -/** @soyCompatible */ +/** + * TODO(b/265346443): add docs + */ export declare class OutlinedSegmentedButton extends SegmentedButton { - /** @soyTemplate */ - protected getRenderClasses(): ClassInfo; - /** @soyTemplate */ - protected renderOutline(): TemplateResult; + protected getRenderClasses(): { + 'md3-segmented-button--outlined': boolean; + 'md3-segmented-button--selected': boolean; + 'md3-segmented-button--unselected': boolean; + 'md3-segmented-button--with-label': boolean; + 'md3-segmented-button--without-label': boolean; + 'md3-segmented-button--with-icon': boolean; + 'md3-segmented-button--with-checkmark': boolean; + 'md3-segmented-button--without-checkmark': boolean; + 'md3-segmented-button--selecting': boolean; + 'md3-segmented-button--deselecting': boolean; + }; + protected renderOutline(): import("lit-html").TemplateResult<1>; }
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/segmentedbutton/lib/outlined-segmented-button.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/segmentedbutton/lib/outlined-segmented-button.js index 1c854e36..8bc5bdf3 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/segmentedbutton/lib/outlined-segmented-button.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/segmentedbutton/lib/outlined-segmented-button.js
@@ -5,16 +5,16 @@ */ import { html } from 'lit'; import { SegmentedButton } from './segmented-button.js'; -/** @soyCompatible */ +/** + * TODO(b/265346443): add docs + */ export class OutlinedSegmentedButton extends SegmentedButton { - /** @soyTemplate */ getRenderClasses() { return { ...super.getRenderClasses(), 'md3-segmented-button--outlined': true, }; } - /** @soyTemplate */ renderOutline() { return html `<span class="md3-segmented-button__outline"></span>`; }
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/segmentedbutton/lib/outlined-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/segmentedbutton/lib/outlined-styles.css.js index 2671f29..b43019d 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/segmentedbutton/lib/outlined-styles.css.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/segmentedbutton/lib/outlined-styles.css.js
@@ -4,6 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ import { css } from 'lit'; -export const styles = css `:host{--_container-height: var(--md-segmented-button-container-height, 40px);--_disabled-icon-color: var(--md-segmented-button-disabled-icon-color, rgb(var(--md-sys-color-on-surface-rgb, 28, 27, 31), 0.38));--_disabled-label-text-color: var(--md-segmented-button-disabled-label-text-color, rgb(var(--md-sys-color-on-surface-rgb, 28, 27, 31), 0.38));--_disabled-outline-color: var(--md-segmented-button-disabled-outline-color, rgb(var(--md-sys-color-on-surface-rgb, 28, 27, 31), 0.12));--_focus-state-layer-opacity: var(--md-segmented-button-focus-state-layer-opacity, 0.12);--_hover-state-layer-opacity: var(--md-segmented-button-hover-state-layer-opacity, 0.08);--_label-text-font: var(--md-segmented-button-label-text-font, Roboto);--_label-text-line-height: var(--md-segmented-button-label-text-line-height, 1.25rem);--_label-text-size: var(--md-segmented-button-label-text-size, 0.875rem);--_label-text-tracking: var(--md-segmented-button-label-text-tracking, 0.006rem);--_label-text-type: var(--md-segmented-button-label-text-type, 500 0.875rem / 1.25rem Roboto);--_label-text-weight: var(--md-segmented-button-label-text-weight, 500);--_outline-color: var(--md-segmented-button-outline-color, var(--md-sys-color-outline, #79747e));--_outline-width: var(--md-segmented-button-outline-width, 1px);--_pressed-state-layer-opacity: var(--md-segmented-button-pressed-state-layer-opacity, 0.12);--_selected-container-color: var(--md-segmented-button-selected-container-color, var(--md-sys-color-secondary-container, #e8def8));--_selected-focus-icon-color: var(--md-segmented-button-selected-focus-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-focus-label-text-color: var(--md-segmented-button-selected-focus-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-focus-state-layer-color: var(--md-segmented-button-selected-focus-state-layer-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-hover-icon-color: var(--md-segmented-button-selected-hover-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-hover-label-text-color: var(--md-segmented-button-selected-hover-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-hover-state-layer-color: var(--md-segmented-button-selected-hover-state-layer-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-label-text-color: var(--md-segmented-button-selected-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-pressed-icon-color: var(--md-segmented-button-selected-pressed-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-pressed-label-text-color: var(--md-segmented-button-selected-pressed-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-pressed-state-layer-color: var(--md-segmented-button-selected-pressed-state-layer-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-with-icon-icon-color: var(--md-segmented-button-selected-with-icon-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_shape: var(--md-segmented-button-shape, 9999px);--_unselected-focus-icon-color: var(--md-segmented-button-unselected-focus-icon-color, var(--md-sys-color-on-surface, #1c1b1f));--_unselected-focus-label-text-color: var(--md-segmented-button-unselected-focus-label-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_unselected-focus-state-layer-color: var(--md-segmented-button-unselected-focus-state-layer-color, var(--md-sys-color-on-surface, #1c1b1f));--_unselected-hover-icon-color: var(--md-segmented-button-unselected-hover-icon-color, var(--md-sys-color-on-surface, #1c1b1f));--_unselected-hover-label-text-color: var(--md-segmented-button-unselected-hover-label-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_unselected-hover-state-layer-color: var(--md-segmented-button-unselected-hover-state-layer-color, var(--md-sys-color-on-surface, #1c1b1f));--_unselected-label-text-color: var(--md-segmented-button-unselected-label-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_unselected-pressed-icon-color: var(--md-segmented-button-unselected-pressed-icon-color, var(--md-sys-color-on-surface, #1c1b1f));--_unselected-pressed-label-text-color: var(--md-segmented-button-unselected-pressed-label-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_unselected-pressed-state-layer-color: var(--md-segmented-button-unselected-pressed-state-layer-color, var(--md-sys-color-on-surface, #1c1b1f));--_unselected-with-icon-icon-color: var(--md-segmented-button-unselected-with-icon-icon-color, var(--md-sys-color-on-surface, #1c1b1f));--_with-icon-icon-size: var(--md-segmented-button-with-icon-icon-size, 18px);--_spacing-leading: var(--md-segmented-button-spacing-leading, 12px);--_spacing-trailing: var(--md-segmented-button-spacing-trailing, 12px)}.md3-segmented-button__outline{border-radius:inherit;border-style:solid;border-width:1px;inset:0px -0.5px;pointer-events:none;position:absolute}/*# sourceMappingURL=outlined-styles.css.map */ +export const styles = css `:host{--_container-height: var(--md-segmented-button-container-height, 40px);--_disabled-icon-color: var(--md-segmented-button-disabled-icon-color, rgb(var(--md-sys-color-on-surface-rgb, 29, 27, 32), 0.38));--_disabled-label-text-color: var(--md-segmented-button-disabled-label-text-color, rgb(var(--md-sys-color-on-surface-rgb, 29, 27, 32), 0.38));--_disabled-outline-color: var(--md-segmented-button-disabled-outline-color, rgb(var(--md-sys-color-on-surface-rgb, 29, 27, 32), 0.12));--_focus-state-layer-opacity: var(--md-segmented-button-focus-state-layer-opacity, 0.12);--_hover-state-layer-opacity: var(--md-segmented-button-hover-state-layer-opacity, 0.08);--_label-text-type: var(--md-segmented-button-label-text-type, var(--md-sys-typescale-label-large, 500 0.875rem / 1.25rem var(--md-ref-typeface-plain, Roboto)));--_outline-color: var(--md-segmented-button-outline-color, var(--md-sys-color-outline, #79747e));--_outline-width: var(--md-segmented-button-outline-width, 1px);--_pressed-state-layer-opacity: var(--md-segmented-button-pressed-state-layer-opacity, 0.12);--_selected-container-color: var(--md-segmented-button-selected-container-color, var(--md-sys-color-secondary-container, #e8def8));--_selected-focus-icon-color: var(--md-segmented-button-selected-focus-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-focus-label-text-color: var(--md-segmented-button-selected-focus-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-focus-state-layer-color: var(--md-segmented-button-selected-focus-state-layer-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-hover-icon-color: var(--md-segmented-button-selected-hover-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-hover-label-text-color: var(--md-segmented-button-selected-hover-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-hover-state-layer-color: var(--md-segmented-button-selected-hover-state-layer-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-label-text-color: var(--md-segmented-button-selected-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-pressed-icon-color: var(--md-segmented-button-selected-pressed-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-pressed-label-text-color: var(--md-segmented-button-selected-pressed-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-pressed-state-layer-color: var(--md-segmented-button-selected-pressed-state-layer-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-with-icon-icon-color: var(--md-segmented-button-selected-with-icon-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_shape: var(--md-segmented-button-shape, 9999px);--_unselected-focus-icon-color: var(--md-segmented-button-unselected-focus-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-focus-label-text-color: var(--md-segmented-button-unselected-focus-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-focus-state-layer-color: var(--md-segmented-button-unselected-focus-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-hover-icon-color: var(--md-segmented-button-unselected-hover-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-hover-label-text-color: var(--md-segmented-button-unselected-hover-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-hover-state-layer-color: var(--md-segmented-button-unselected-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-label-text-color: var(--md-segmented-button-unselected-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-pressed-icon-color: var(--md-segmented-button-unselected-pressed-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-pressed-label-text-color: var(--md-segmented-button-unselected-pressed-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-pressed-state-layer-color: var(--md-segmented-button-unselected-pressed-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-with-icon-icon-color: var(--md-segmented-button-unselected-with-icon-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_with-icon-icon-size: var(--md-segmented-button-with-icon-icon-size, 18px);--_spacing-leading: var(--md-segmented-button-spacing-leading, 12px);--_spacing-trailing: var(--md-segmented-button-spacing-trailing, 12px)}.md3-segmented-button__outline{border-radius:inherit;border-style:solid;border-width:1px;inset:0px -0.5px;pointer-events:none;position:absolute}/*# sourceMappingURL=outlined-styles.css.map */ `; //# sourceMappingURL=outlined-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/segmentedbutton/lib/segmented-button.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/segmentedbutton/lib/segmented-button.d.ts index 3827d02d..50cbd94 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/segmentedbutton/lib/segmented-button.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/segmentedbutton/lib/segmented-button.d.ts
@@ -4,57 +4,45 @@ * SPDX-License-Identifier: Apache-2.0 */ import '../../focus/focus-ring.js'; -import { PropertyValues, TemplateResult } from 'lit'; -import { ClassInfo } from 'lit/directives/class-map.js'; -import { ActionElement, BeginPressConfig, EndPressConfig } from '../../actionelement/action-element.js'; -import { MdRipple } from '../../ripple/ripple.js'; +import '../../ripple/ripple.js'; +import { LitElement, nothing, PropertyValues, TemplateResult } from 'lit'; /** * SegmentedButton is a web component implementation of the Material Design * segmented button component. It is intended **only** for use as a child of a * `SementedButtonSet` component. It is **not** intended for use in any other * context. - * @soyCompatible */ -export declare class SegmentedButton extends ActionElement { +export declare class SegmentedButton extends LitElement { disabled: boolean; selected: boolean; label: string; noCheckmark: boolean; hasIcon: boolean; - /** @soyPrefixAttribute */ - ariaLabel: string; - protected animState: string; - protected showFocusRing: boolean; - protected iconElement: HTMLElement[]; - ripple: MdRipple; + private animState; + private showRipple; + private readonly iconElement; + private readonly ripple; protected update(props: PropertyValues<SegmentedButton>): void; private nextAnimationState; - beginPress({ positionEvent }: BeginPressConfig): void; - endPress(options: EndPressConfig): void; - handlePointerDown(e: PointerEvent): void; - handlePointerUp(e: PointerEvent): void; - protected handlePointerEnter(e: PointerEvent): void; - handlePointerLeave(e: PointerEvent): void; - protected handleFocus(): void; - protected handleBlur(): void; - /** @soyTemplate */ - render(): TemplateResult; - /** @soyTemplate */ - protected getRenderClasses(): ClassInfo; - /** @soyTemplate */ - protected renderFocusRing(): TemplateResult; - /** @soyTemplate */ - protected renderRipple(): TemplateResult | string; - /** @soyTemplate */ - protected renderOutline(): TemplateResult; - /** @soyTemplate */ - protected renderLeading(): TemplateResult; - /** @soyTemplate */ - protected renderLeadingWithoutLabel(): TemplateResult; - /** @soyTemplate */ - protected renderLeadingWithLabel(): TemplateResult; - /** @soyTemplate */ - protected renderLabel(): TemplateResult; - /** @soyTemplate */ - protected renderTouchTarget(): TemplateResult; + private handleClick; + protected render(): TemplateResult<1>; + protected getRenderClasses(): { + 'md3-segmented-button--selected': boolean; + 'md3-segmented-button--unselected': boolean; + 'md3-segmented-button--with-label': boolean; + 'md3-segmented-button--without-label': boolean; + 'md3-segmented-button--with-icon': boolean; + 'md3-segmented-button--with-checkmark': boolean; + 'md3-segmented-button--without-checkmark': boolean; + 'md3-segmented-button--selecting': boolean; + 'md3-segmented-button--deselecting': boolean; + }; + private readonly getRipple; + private readonly renderRipple; + protected renderOutline(): TemplateResult | typeof nothing; + private renderLeading; + private renderLeadingWithoutLabel; + private renderLeadingWithLabel; + private renderLabel; + private renderTouchTarget; }
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/segmentedbutton/lib/segmented-button.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/segmentedbutton/lib/segmented-button.js index bad64f4..b888120 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/segmentedbutton/lib/segmented-button.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/segmentedbutton/lib/segmented-button.js
@@ -3,24 +3,23 @@ * Copyright 2021 Google LLC * SPDX-License-Identifier: Apache-2.0 */ -import { __decorate, __metadata } from "tslib"; +var _a; +import { __decorate } from "tslib"; import '../../focus/focus-ring.js'; -import { html } from 'lit'; -import { property, query, queryAssignedElements, state } from 'lit/decorators.js'; +import '../../ripple/ripple.js'; +import { html, LitElement, nothing } from 'lit'; +import { property, queryAssignedElements, queryAsync, state } from 'lit/decorators.js'; import { classMap } from 'lit/directives/class-map.js'; -import { ifDefined } from 'lit/directives/if-defined.js'; -import { ActionElement } from '../../actionelement/action-element.js'; -import { ariaProperty } from '../../decorators/aria-property.js'; -import { pointerPress, shouldShowStrongFocus } from '../../focus/strong-focus.js'; -import { MdRipple } from '../../ripple/ripple.js'; +import { when } from 'lit/directives/when.js'; +import { requestUpdateOnAriaChange } from '../../aria/delegate.js'; +import { ripple } from '../../ripple/directive.js'; /** * SegmentedButton is a web component implementation of the Material Design * segmented button component. It is intended **only** for use as a child of a * `SementedButtonSet` component. It is **not** intended for use in any other * context. - * @soyCompatible */ -export class SegmentedButton extends ActionElement { +export class SegmentedButton extends LitElement { constructor() { super(...arguments); this.disabled = false; @@ -29,7 +28,14 @@ this.noCheckmark = false; this.hasIcon = false; this.animState = ''; - this.showFocusRing = false; + this.showRipple = false; + this.getRipple = () => { + this.showRipple = true; + return this.ripple; + }; + this.renderRipple = () => { + return html `<md-ripple ?disabled="${this.disabled}" class="md3-segmented-button__ripple"> </md-ripple>`; + }; } update(props) { this.animState = this.nextAnimationState(props); @@ -53,58 +59,24 @@ } return ''; } - beginPress({ positionEvent }) { - this.ripple.beginPress(positionEvent); + handleClick() { + const event = new Event('segmented-button-interaction', { bubbles: true, composed: true }); + this.dispatchEvent(event); } - endPress(options) { - this.ripple.endPress(); - super.endPress(options); - if (!options.cancelled) { - const event = new Event('segmented-button-interaction', { bubbles: true, composed: true }); - this.dispatchEvent(event); - } - } - handlePointerDown(e) { - super.handlePointerDown(e); - pointerPress(); - this.showFocusRing = shouldShowStrongFocus(); - } - handlePointerUp(e) { - super.handlePointerUp(e); - } - handlePointerEnter(e) { - this.ripple.beginHover(e); - } - handlePointerLeave(e) { - super.handlePointerLeave(e); - this.ripple.endHover(); - } - handleFocus() { - this.showFocusRing = shouldShowStrongFocus(); - } - handleBlur() { - this.showFocusRing = false; - } - /** @soyTemplate */ render() { + // Needed for closure conformance + const { ariaLabel } = this; return html ` <button tabindex="${this.disabled ? '-1' : '0'}" - aria-label="${ifDefined(this.ariaLabel)}" + aria-label=${ariaLabel || nothing} aria-pressed=${this.selected} ?disabled=${this.disabled} - @focus="${this.handleFocus}" - @blur="${this.handleBlur}" - @pointerdown="${this.handlePointerDown}" - @pointerup="${this.handlePointerUp}" - @pointercancel="${this.handlePointerCancel}" - @pointerleave="${this.handlePointerLeave}" - @pointerenter="${this.handlePointerEnter}" @click="${this.handleClick}" - @contextmenu="${this.handleContextMenu}" - class="md3-segmented-button ${classMap(this.getRenderClasses())}"> - ${this.renderFocusRing()} - ${this.renderRipple()} + class="md3-segmented-button ${classMap(this.getRenderClasses())}" + ${ripple(this.getRipple)}> + <md-focus-ring class="md3-segmented-button__focus-ring"></md-focus-ring> + ${when(this.showRipple, this.renderRipple)} ${this.renderOutline()} ${this.renderLeading()} ${this.renderLabel()} @@ -112,7 +84,6 @@ </button> `; } - /** @soyTemplate */ getRenderClasses() { return { 'md3-segmented-button--selected': this.selected, @@ -126,24 +97,13 @@ 'md3-segmented-button--deselecting': this.animState === 'deselecting', }; } - /** @soyTemplate */ - renderFocusRing() { - return html `<md-focus-ring .visible="${this.showFocusRing}" class="md3-segmented-button__focus-ring"></md-focus-ring>`; - } - /** @soyTemplate */ - renderRipple() { - return html `<md-ripple ?disabled="${this.disabled}" class="md3-segmented-button__ripple"> </md-ripple>`; - } - /** @soyTemplate */ renderOutline() { - return html ``; + return nothing; } - /** @soyTemplate */ renderLeading() { return this.label === '' ? this.renderLeadingWithoutLabel() : this.renderLeadingWithLabel(); } - /** @soyTemplate */ renderLeadingWithoutLabel() { return html ` <span class="md3-segmented-button__leading" aria-hidden="true"> @@ -158,7 +118,6 @@ </span> `; } - /** @soyTemplate */ renderLeadingWithLabel() { return html ` <span class="md3-segmented-button__leading" aria-hidden="true"> @@ -173,57 +132,44 @@ </span> `; } - /** @soyTemplate */ renderLabel() { return html ` <span class="md3-segmented-button__label-text">${this.label}</span> `; } - /** @soyTemplate */ renderTouchTarget() { return html `<span class="md3-segmented-button__touch"></span>`; } } +_a = SegmentedButton; +(() => { + requestUpdateOnAriaChange(_a); +})(); __decorate([ - property({ type: Boolean }), - __metadata("design:type", Object) + property({ type: Boolean }) ], SegmentedButton.prototype, "disabled", void 0); __decorate([ - property({ type: Boolean }), - __metadata("design:type", Object) + property({ type: Boolean }) ], SegmentedButton.prototype, "selected", void 0); __decorate([ - property({ type: String }), - __metadata("design:type", Object) + property() ], SegmentedButton.prototype, "label", void 0); __decorate([ - property({ type: Boolean }), - __metadata("design:type", Object) + property({ type: Boolean }) ], SegmentedButton.prototype, "noCheckmark", void 0); __decorate([ - property({ type: Boolean }), - __metadata("design:type", Object) + property({ type: Boolean }) ], SegmentedButton.prototype, "hasIcon", void 0); __decorate([ - ariaProperty // tslint:disable-line:no-new-decorators - , - property({ type: String, attribute: 'aria-label' }), - __metadata("design:type", String) -], SegmentedButton.prototype, "ariaLabel", void 0); -__decorate([ - state(), - __metadata("design:type", String) + state() ], SegmentedButton.prototype, "animState", void 0); __decorate([ - state(), - __metadata("design:type", Object) -], SegmentedButton.prototype, "showFocusRing", void 0); + state() +], SegmentedButton.prototype, "showRipple", void 0); __decorate([ - queryAssignedElements({ slot: 'icon', flatten: true }), - __metadata("design:type", Array) + queryAssignedElements({ slot: 'icon', flatten: true }) ], SegmentedButton.prototype, "iconElement", void 0); __decorate([ - query('md-ripple'), - __metadata("design:type", MdRipple) + queryAsync('md-ripple') ], SegmentedButton.prototype, "ripple", void 0); //# sourceMappingURL=segmented-button.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/segmentedbutton/lib/shared-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/segmentedbutton/lib/shared-styles.css.js index a11d1087..18decbd 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/segmentedbutton/lib/shared-styles.css.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/segmentedbutton/lib/shared-styles.css.js
@@ -4,6 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ import { css } from 'lit'; -export const styles = css `@keyframes md3-segmented-button-checkmark-selection-draw-in{from{stroke-dashoffset:29.7833385}to{stroke-dashoffset:0}}@keyframes md3-segmented-button-simple-fade-out{from{opacity:1}to{opacity:0}}@keyframes md3-segmented-button-simple-fade-in{from{opacity:0}to{opacity:1}}:host{display:inline-flex;outline:none}.md3-segmented-button{align-items:center;background:rgba(0,0,0,0);border:none;border-radius:inherit;display:flex;flex:1;justify-content:center;outline:none;position:relative;vertical-align:middle;padding-inline-start:var(--_spacing-leading);padding-inline-end:var(--_spacing-trailing)}.md3-segmented-button .md3-segmented-button__outline{border-color:var(--_outline-color)}.md3-segmented-button:disabled .md3-segmented-button__outline{border-color:var(--_disabled-outline-color)}.md3-segmented-button .md3-segmented-button__graphic,.md3-segmented-button .md3-segmented-button__checkmark,.md3-segmented-button .md3-segmented-button__icon,.md3-segmented-button .md3-segmented-button__icon ::slotted([slot=icon]){height:var(--_with-icon-icon-size);width:var(--_with-icon-icon-size);font-size:var(--_with-icon-icon-size)}.md3-segmented-button.md3-segmented-button--with-icon.md3-segmented-button--with-label .md3-segmented-button__graphic,.md3-segmented-button.md3-segmented-button--selected.md3-segmented-button--with-label.md3-segmented-button--with-checkmark .md3-segmented-button__graphic,.md3-segmented-button.md3-segmented-button--selected.md3-segmented-button--without-label.md3-segmented-button--with-checkmark .md3-segmented-button__graphic{width:calc(var(--_with-icon-icon-size) + 8px)}.md3-segmented-button .md3-segmented-button__label-text{font-family:var(--_label-text-font);font-size:var(--_label-text-size);letter-spacing:var(--_label-text-tracking);font-weight:var(--_label-text-weight)}.md3-segmented-button.md3-segmented-button--selected:enabled .md3-segmented-button__label-text{color:var(--_selected-label-text-color)}.md3-segmented-button.md3-segmented-button--selected:enabled:hover .md3-segmented-button__label-text{color:var(--_selected-hover-label-text-color)}.md3-segmented-button.md3-segmented-button--selected:enabled:focus .md3-segmented-button__label-text{color:var(--_selected-focus-label-text-color)}.md3-segmented-button.md3-segmented-button--selected:enabled:active .md3-segmented-button__label-text{color:var(--_selected-pressed-label-text-color)}.md3-segmented-button.md3-segmented-button--unselected:enabled .md3-segmented-button__label-text{color:var(--_unselected-label-text-color)}.md3-segmented-button.md3-segmented-button--unselected:enabled:hover .md3-segmented-button__label-text{color:var(--_unselected-hover-label-text-color)}.md3-segmented-button.md3-segmented-button--unselected:enabled:focus .md3-segmented-button__label-text{color:var(--_unselected-focus-label-text-color)}.md3-segmented-button.md3-segmented-button--unselected:enabled:active .md3-segmented-button__label-text{color:var(--_unselected-pressed-label-text-color)}.md3-segmented-button:disabled .md3-segmented-button__label-text{color:var(--_disabled-label-text-color)}.md3-segmented-button--unselected{--md-ripple-hover-state-layer-color:var(--_unselected-hover-state-layer-color);--md-ripple-hover-state-layer-opacity:var(--_hover-state-layer-opacity);--md-ripple-focus-state-layer-color:var(--_unselected-focus-state-layer-color);--md-ripple-focus-state-layer-opacity:var(--_focus-state-layer-opacity);--md-ripple-pressed-state-layer-color:var(--_unselected-pressed-state-layer-color);--md-ripple-pressed-state-layer-opacity:var(--_pressed-state-layer-opacity)}.md3-segmented-button--unselected .md3-segmented-button__icon{color:var(--_unselected-with-icon-icon-color)}.md3-segmented-button--unselected:hover .md3-segmented-button__icon{color:var(--_unselected-hover-icon-color)}.md3-segmented-button--unselected:focus .md3-segmented-button__icon{color:var(--_unselected-focus-icon-color)}.md3-segmented-button--unselected:active .md3-segmented-button__icon{color:var(--_unselected-pressed-icon-color)}.md3-segmented-button--unselected:disabled .md3-segmented-button__icon{color:var(--_disabled-icon-color)}.md3-segmented-button--selected{background-color:var(--_selected-container-color);--md-ripple-hover-state-layer-color:var(--_selected-hover-state-layer-color);--md-ripple-hover-state-layer-opacity:var(--_hover-state-layer-opacity);--md-ripple-focus-state-layer-color:var(--_selected-focus-state-layer-color);--md-ripple-focus-state-layer-opacity:var(--_focus-state-layer-opacity);--md-ripple-pressed-state-layer-color:var(--_selected-pressed-state-layer-color);--md-ripple-pressed-state-layer-opacity:var(--_pressed-state-layer-opacity)}.md3-segmented-button--selected .md3-segmented-button__icon{color:var(--_selected-with-icon-icon-color)}.md3-segmented-button--selected .md3-segmented-button__checkmark-path{stroke:var(--_selected-with-icon-icon-color)}.md3-segmented-button--selected:hover .md3-segmented-button__checkmark-path{stroke:var(--_selected-hover-icon-color)}.md3-segmented-button--selected:focus .md3-segmented-button__checkmark-path{stroke:var(--_selected-focus-icon-color)}.md3-segmented-button--selected:active .md3-segmented-button__checkmark-path{stroke:var(--_selected-pressed-icon-color)}.md3-segmented-button--selected:disabled .md3-segmented-button__checkmark-path{stroke:var(--_disabled-icon-color)}.md3-segmented-button:enabled{cursor:pointer}.md3-segmented-button__focus-ring{z-index:1}.md3-segmented-button__ripple{border-radius:inherit;z-index:0}.md3-segmented-button__touch{position:absolute;top:50%;height:48px;left:50%;width:100%;transform:translate(-50%, -50%)}.md3-segmented-button__leading,.md3-segmented-button__graphic{display:inline-flex;justify-content:flex-start;align-items:center}.md3-segmented-button__graphic{position:relative;overflow:hidden}.md3-segmented-button__graphic{transition:width 150ms cubic-bezier(0.4, 0, 0.2, 1)}.md3-segmented-button--unselected.md3-segmented-button--with-label .md3-segmented-button__graphic,.md3-segmented-button--unselected.md3-segmented-button--without-label .md3-segmented-button__graphic,.md3-segmented-button--selected.md3-segmented-button--without-checkmark .md3-segmented-button__graphic{width:0}.md3-segmented-button--unselected .md3-segmented-button__checkmark{opacity:0}.md3-segmented-button--selected.md3-segmented-button--with-label .md3-segmented-button__icon{opacity:0}.md3-segmented-button--with-label .md3-segmented-button__checkmark{display:inline-flex;position:absolute}.md3-segmented-button__checkmark-path{stroke-width:2px;stroke-dasharray:29.7833385}.md3-segmented-button--selecting .md3-segmented-button__checkmark-path{stroke-dashoffset:29.7833385;animation:md3-segmented-button-checkmark-selection-draw-in;animation-duration:150ms;animation-delay:50ms;animation-fill-mode:forwards;animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1)}.md3-segmented-button--selecting.md3-segmented-button--with-label .md3-segmented-button__icon{animation:md3-segmented-button-simple-fade-out;animation-duration:75ms;animation-timing-function:linear;animation-fill-mode:forwards}.md3-segmented-button--deselecting .md3-segmented-button__checkmark{animation:md3-segmented-button-simple-fade-out;animation-duration:50ms;animation-timing-function:linear;animation-fill-mode:forwards}.md3-segmented-button--deselecting.md3-segmented-button--with-label .md3-segmented-button__icon{opacity:0;animation:md3-segmented-button-simple-fade-in;animation-delay:50ms;animation-duration:150ms;animation-timing-function:linear;animation-fill-mode:forwards}/*# sourceMappingURL=shared-styles.css.map */ +export const styles = css `@keyframes md3-segmented-button-checkmark-selection-draw-in{from{stroke-dashoffset:29.7833385}to{stroke-dashoffset:0}}@keyframes md3-segmented-button-simple-fade-out{from{opacity:1}to{opacity:0}}@keyframes md3-segmented-button-simple-fade-in{from{opacity:0}to{opacity:1}}:host{display:inline-flex;outline:none}.md3-segmented-button{align-items:center;background:rgba(0,0,0,0);border:none;border-radius:inherit;display:flex;flex:1;justify-content:center;outline:none;position:relative;vertical-align:middle;padding-inline-start:var(--_spacing-leading);padding-inline-end:var(--_spacing-trailing)}.md3-segmented-button .md3-segmented-button__outline{border-color:var(--_outline-color)}.md3-segmented-button:disabled .md3-segmented-button__outline{border-color:var(--_disabled-outline-color)}.md3-segmented-button .md3-segmented-button__graphic,.md3-segmented-button .md3-segmented-button__checkmark,.md3-segmented-button .md3-segmented-button__icon,.md3-segmented-button .md3-segmented-button__icon ::slotted([slot=icon]){height:var(--_with-icon-icon-size);width:var(--_with-icon-icon-size);font-size:var(--_with-icon-icon-size)}.md3-segmented-button.md3-segmented-button--with-icon.md3-segmented-button--with-label .md3-segmented-button__graphic,.md3-segmented-button.md3-segmented-button--selected.md3-segmented-button--with-label.md3-segmented-button--with-checkmark .md3-segmented-button__graphic,.md3-segmented-button.md3-segmented-button--selected.md3-segmented-button--without-label.md3-segmented-button--with-checkmark .md3-segmented-button__graphic{width:calc(var(--_with-icon-icon-size) + 8px)}.md3-segmented-button .md3-segmented-button__label-text{font:var(--_label-text-type)}.md3-segmented-button.md3-segmented-button--selected:enabled .md3-segmented-button__label-text{color:var(--_selected-label-text-color)}.md3-segmented-button.md3-segmented-button--selected:enabled:hover .md3-segmented-button__label-text{color:var(--_selected-hover-label-text-color)}.md3-segmented-button.md3-segmented-button--selected:enabled:focus .md3-segmented-button__label-text{color:var(--_selected-focus-label-text-color)}.md3-segmented-button.md3-segmented-button--selected:enabled:active .md3-segmented-button__label-text{color:var(--_selected-pressed-label-text-color)}.md3-segmented-button.md3-segmented-button--unselected:enabled .md3-segmented-button__label-text{color:var(--_unselected-label-text-color)}.md3-segmented-button.md3-segmented-button--unselected:enabled:hover .md3-segmented-button__label-text{color:var(--_unselected-hover-label-text-color)}.md3-segmented-button.md3-segmented-button--unselected:enabled:focus .md3-segmented-button__label-text{color:var(--_unselected-focus-label-text-color)}.md3-segmented-button.md3-segmented-button--unselected:enabled:active .md3-segmented-button__label-text{color:var(--_unselected-pressed-label-text-color)}.md3-segmented-button:disabled .md3-segmented-button__label-text{color:var(--_disabled-label-text-color)}.md3-segmented-button--unselected{--md-ripple-hover-color:var(--_unselected-hover-state-layer-color);--md-ripple-hover-opacity:var(--_hover-state-layer-opacity);--md-ripple-focus-color:var(--_unselected-focus-state-layer-color);--md-ripple-focus-opacity:var(--_focus-state-layer-opacity);--md-ripple-pressed-color:var(--_unselected-pressed-state-layer-color);--md-ripple-pressed-opacity:var(--_pressed-state-layer-opacity)}.md3-segmented-button--unselected .md3-segmented-button__icon{color:var(--_unselected-with-icon-icon-color)}.md3-segmented-button--unselected:hover .md3-segmented-button__icon{color:var(--_unselected-hover-icon-color)}.md3-segmented-button--unselected:focus .md3-segmented-button__icon{color:var(--_unselected-focus-icon-color)}.md3-segmented-button--unselected:active .md3-segmented-button__icon{color:var(--_unselected-pressed-icon-color)}.md3-segmented-button--unselected:disabled .md3-segmented-button__icon{color:var(--_disabled-icon-color)}.md3-segmented-button--selected{background-color:var(--_selected-container-color);--md-ripple-hover-color:var(--_selected-hover-state-layer-color);--md-ripple-hover-opacity:var(--_hover-state-layer-opacity);--md-ripple-focus-color:var(--_selected-focus-state-layer-color);--md-ripple-focus-opacity:var(--_focus-state-layer-opacity);--md-ripple-pressed-color:var(--_selected-pressed-state-layer-color);--md-ripple-pressed-opacity:var(--_pressed-state-layer-opacity)}.md3-segmented-button--selected .md3-segmented-button__icon{color:var(--_selected-with-icon-icon-color)}.md3-segmented-button--selected .md3-segmented-button__checkmark-path{stroke:var(--_selected-with-icon-icon-color)}.md3-segmented-button--selected:hover .md3-segmented-button__checkmark-path{stroke:var(--_selected-hover-icon-color)}.md3-segmented-button--selected:focus .md3-segmented-button__checkmark-path{stroke:var(--_selected-focus-icon-color)}.md3-segmented-button--selected:active .md3-segmented-button__checkmark-path{stroke:var(--_selected-pressed-icon-color)}.md3-segmented-button--selected:disabled .md3-segmented-button__checkmark-path{stroke:var(--_disabled-icon-color)}.md3-segmented-button:enabled{cursor:pointer}.md3-segmented-button__focus-ring{z-index:1}.md3-segmented-button__ripple{border-radius:inherit;z-index:0}.md3-segmented-button__touch{position:absolute;top:50%;height:48px;left:50%;width:100%;transform:translate(-50%, -50%)}.md3-segmented-button__leading,.md3-segmented-button__graphic{display:inline-flex;justify-content:flex-start;align-items:center}.md3-segmented-button__graphic{position:relative;overflow:hidden}.md3-segmented-button__graphic{transition:width 150ms cubic-bezier(0.4, 0, 0.2, 1)}.md3-segmented-button--unselected.md3-segmented-button--with-label .md3-segmented-button__graphic,.md3-segmented-button--unselected.md3-segmented-button--without-label .md3-segmented-button__graphic,.md3-segmented-button--selected.md3-segmented-button--without-checkmark .md3-segmented-button__graphic{width:0}.md3-segmented-button--unselected .md3-segmented-button__checkmark{opacity:0}.md3-segmented-button--selected.md3-segmented-button--with-label .md3-segmented-button__icon{opacity:0}.md3-segmented-button--with-label .md3-segmented-button__checkmark{display:inline-flex;position:absolute}.md3-segmented-button__checkmark-path{stroke-width:2px;stroke-dasharray:29.7833385}.md3-segmented-button--selecting .md3-segmented-button__checkmark-path{stroke-dashoffset:29.7833385;animation:md3-segmented-button-checkmark-selection-draw-in;animation-duration:150ms;animation-delay:50ms;animation-fill-mode:forwards;animation-timing-function:cubic-bezier(0.4, 0, 0.2, 1)}.md3-segmented-button--selecting.md3-segmented-button--with-label .md3-segmented-button__icon{animation:md3-segmented-button-simple-fade-out;animation-duration:75ms;animation-timing-function:linear;animation-fill-mode:forwards}.md3-segmented-button--deselecting .md3-segmented-button__checkmark{animation:md3-segmented-button-simple-fade-out;animation-duration:50ms;animation-timing-function:linear;animation-fill-mode:forwards}.md3-segmented-button--deselecting.md3-segmented-button--with-label .md3-segmented-button__icon{opacity:0;animation:md3-segmented-button-simple-fade-in;animation-delay:50ms;animation-duration:150ms;animation-timing-function:linear;animation-fill-mode:forwards}/*# sourceMappingURL=shared-styles.css.map */ `; //# sourceMappingURL=shared-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/segmentedbutton/outlined-segmented-button.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/segmentedbutton/outlined-segmented-button.d.ts index d5e08ef..0a3d2459 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/segmentedbutton/outlined-segmented-button.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/segmentedbutton/outlined-segmented-button.d.ts
@@ -12,7 +12,6 @@ /** * MdOutlinedSegmentedButton is the custom element for the Material * Design outlined segmented button component. - * @soyCompatible * @final * @suppress {visibility} */
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/segmentedbutton/outlined-segmented-button.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/segmentedbutton/outlined-segmented-button.js index 27a63ed3..b5d2612 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/segmentedbutton/outlined-segmented-button.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/segmentedbutton/outlined-segmented-button.js
@@ -11,7 +11,6 @@ /** * MdOutlinedSegmentedButton is the custom element for the Material * Design outlined segmented button component. - * @soyCompatible * @final * @suppress {visibility} */
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/segmentedbuttonset/lib/outlined-segmented-button-set.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/segmentedbuttonset/lib/outlined-segmented-button-set.d.ts index 39dac34..0b85599 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/segmentedbuttonset/lib/outlined-segmented-button-set.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/segmentedbuttonset/lib/outlined-segmented-button-set.d.ts
@@ -3,10 +3,12 @@ * Copyright 2022 Google LLC * SPDX-License-Identifier: Apache-2.0 */ -import { ClassInfo } from 'lit/directives/class-map.js'; import { SegmentedButtonSet } from './segmented-button-set.js'; -/** @soyCompatible */ +/** + * TODO(b/265346443): add docs + */ export declare class OutlinedSegmentedButtonSet extends SegmentedButtonSet { - /** @soyTemplate */ - protected getRenderClasses(): ClassInfo; + protected getRenderClasses(): { + 'md3-segmented-button-set--outlined': boolean; + }; }
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/segmentedbuttonset/lib/outlined-segmented-button-set.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/segmentedbuttonset/lib/outlined-segmented-button-set.js index 17ceec1..dcaecd3d 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/segmentedbuttonset/lib/outlined-segmented-button-set.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/segmentedbuttonset/lib/outlined-segmented-button-set.js
@@ -4,9 +4,10 @@ * SPDX-License-Identifier: Apache-2.0 */ import { SegmentedButtonSet } from './segmented-button-set.js'; -/** @soyCompatible */ +/** + * TODO(b/265346443): add docs + */ export class OutlinedSegmentedButtonSet extends SegmentedButtonSet { - /** @soyTemplate */ getRenderClasses() { return { ...super.getRenderClasses(),
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/segmentedbuttonset/lib/outlined-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/segmentedbuttonset/lib/outlined-styles.css.js index 22801a9c..df21b3a2 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/segmentedbuttonset/lib/outlined-styles.css.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/segmentedbuttonset/lib/outlined-styles.css.js
@@ -4,6 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ import { css } from 'lit'; -export const styles = css `:host{--_shape-start-start: var(--md-segmented-button-shape-start-start, 9999px);--_shape-start-end: var(--md-segmented-button-shape-start-end, 9999px);--_shape-end-end: var(--md-segmented-button-shape-end-end, 9999px);--_shape-end-start: var(--md-segmented-button-shape-end-start, 9999px);--_container-height: var(--md-segmented-button-container-height, 40px);--_disabled-icon-color: var(--md-segmented-button-disabled-icon-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-icon-opacity: var(--md-segmented-button-disabled-icon-opacity, 0.38);--_disabled-label-text-color: var(--md-segmented-button-disabled-label-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-label-text-opacity: var(--md-segmented-button-disabled-label-text-opacity, 0.38);--_disabled-outline-color: var(--md-segmented-button-disabled-outline-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-outline-opacity: var(--md-segmented-button-disabled-outline-opacity, 0.12);--_focus-state-layer-opacity: var(--md-segmented-button-focus-state-layer-opacity, 0.12);--_hover-state-layer-opacity: var(--md-segmented-button-hover-state-layer-opacity, 0.08);--_label-text-font: var(--md-segmented-button-label-text-font, Roboto);--_label-text-line-height: var(--md-segmented-button-label-text-line-height, 1.25rem);--_label-text-size: var(--md-segmented-button-label-text-size, 0.875rem);--_label-text-tracking: var(--md-segmented-button-label-text-tracking, 0.006rem);--_label-text-type: var(--md-segmented-button-label-text-type, 500 0.875rem / 1.25rem Roboto);--_label-text-weight: var(--md-segmented-button-label-text-weight, 500);--_outline-color: var(--md-segmented-button-outline-color, var(--md-sys-color-outline, #79747e));--_outline-width: var(--md-segmented-button-outline-width, 1px);--_pressed-state-layer-opacity: var(--md-segmented-button-pressed-state-layer-opacity, 0.12);--_selected-container-color: var(--md-segmented-button-selected-container-color, var(--md-sys-color-secondary-container, #e8def8));--_selected-focus-icon-color: var(--md-segmented-button-selected-focus-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-focus-label-text-color: var(--md-segmented-button-selected-focus-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-focus-state-layer-color: var(--md-segmented-button-selected-focus-state-layer-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-hover-icon-color: var(--md-segmented-button-selected-hover-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-hover-label-text-color: var(--md-segmented-button-selected-hover-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-hover-state-layer-color: var(--md-segmented-button-selected-hover-state-layer-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-label-text-color: var(--md-segmented-button-selected-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-pressed-icon-color: var(--md-segmented-button-selected-pressed-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-pressed-label-text-color: var(--md-segmented-button-selected-pressed-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-pressed-state-layer-color: var(--md-segmented-button-selected-pressed-state-layer-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-with-icon-icon-color: var(--md-segmented-button-selected-with-icon-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_unselected-focus-icon-color: var(--md-segmented-button-unselected-focus-icon-color, var(--md-sys-color-on-surface, #1c1b1f));--_unselected-focus-label-text-color: var(--md-segmented-button-unselected-focus-label-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_unselected-focus-state-layer-color: var(--md-segmented-button-unselected-focus-state-layer-color, var(--md-sys-color-on-surface, #1c1b1f));--_unselected-hover-icon-color: var(--md-segmented-button-unselected-hover-icon-color, var(--md-sys-color-on-surface, #1c1b1f));--_unselected-hover-label-text-color: var(--md-segmented-button-unselected-hover-label-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_unselected-hover-state-layer-color: var(--md-segmented-button-unselected-hover-state-layer-color, var(--md-sys-color-on-surface, #1c1b1f));--_unselected-label-text-color: var(--md-segmented-button-unselected-label-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_unselected-pressed-icon-color: var(--md-segmented-button-unselected-pressed-icon-color, var(--md-sys-color-on-surface, #1c1b1f));--_unselected-pressed-label-text-color: var(--md-segmented-button-unselected-pressed-label-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_unselected-pressed-state-layer-color: var(--md-segmented-button-unselected-pressed-state-layer-color, var(--md-sys-color-on-surface, #1c1b1f));--_unselected-with-icon-icon-color: var(--md-segmented-button-unselected-with-icon-icon-color, var(--md-sys-color-on-surface, #1c1b1f));--_with-icon-icon-size: var(--md-segmented-button-with-icon-icon-size, 18px)}/*# sourceMappingURL=outlined-styles.css.map */ +export const styles = css `:host{--_container-height: var(--md-outlined-segmented-button-container-height, 40px);--_disabled-icon-color: var(--md-outlined-segmented-button-disabled-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-icon-opacity: var(--md-outlined-segmented-button-disabled-icon-opacity, 0.38);--_disabled-label-text-color: var(--md-outlined-segmented-button-disabled-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-label-text-opacity: var(--md-outlined-segmented-button-disabled-label-text-opacity, 0.38);--_disabled-outline-color: var(--md-outlined-segmented-button-disabled-outline-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-outline-opacity: var(--md-outlined-segmented-button-disabled-outline-opacity, 0.12);--_focus-state-layer-opacity: var(--md-outlined-segmented-button-focus-state-layer-opacity, 0.12);--_hover-state-layer-opacity: var(--md-outlined-segmented-button-hover-state-layer-opacity, 0.08);--_label-text-type: var(--md-outlined-segmented-button-label-text-type, var(--md-sys-typescale-label-large, 500 0.875rem / 1.25rem var(--md-ref-typeface-plain, Roboto)));--_outline-color: var(--md-outlined-segmented-button-outline-color, var(--md-sys-color-outline, #79747e));--_outline-width: var(--md-outlined-segmented-button-outline-width, 1px);--_pressed-state-layer-opacity: var(--md-outlined-segmented-button-pressed-state-layer-opacity, 0.12);--_selected-container-color: var(--md-outlined-segmented-button-selected-container-color, var(--md-sys-color-secondary-container, #e8def8));--_selected-focus-icon-color: var(--md-outlined-segmented-button-selected-focus-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-focus-label-text-color: var(--md-outlined-segmented-button-selected-focus-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-focus-state-layer-color: var(--md-outlined-segmented-button-selected-focus-state-layer-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-hover-icon-color: var(--md-outlined-segmented-button-selected-hover-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-hover-label-text-color: var(--md-outlined-segmented-button-selected-hover-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-hover-state-layer-color: var(--md-outlined-segmented-button-selected-hover-state-layer-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-label-text-color: var(--md-outlined-segmented-button-selected-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-pressed-icon-color: var(--md-outlined-segmented-button-selected-pressed-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-pressed-label-text-color: var(--md-outlined-segmented-button-selected-pressed-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-pressed-state-layer-color: var(--md-outlined-segmented-button-selected-pressed-state-layer-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-with-icon-icon-color: var(--md-outlined-segmented-button-selected-with-icon-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_shape: var(--md-outlined-segmented-button-shape, 9999px);--_unselected-focus-icon-color: var(--md-outlined-segmented-button-unselected-focus-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-focus-label-text-color: var(--md-outlined-segmented-button-unselected-focus-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-focus-state-layer-color: var(--md-outlined-segmented-button-unselected-focus-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-hover-icon-color: var(--md-outlined-segmented-button-unselected-hover-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-hover-label-text-color: var(--md-outlined-segmented-button-unselected-hover-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-hover-state-layer-color: var(--md-outlined-segmented-button-unselected-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-label-text-color: var(--md-outlined-segmented-button-unselected-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-pressed-icon-color: var(--md-outlined-segmented-button-unselected-pressed-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-pressed-label-text-color: var(--md-outlined-segmented-button-unselected-pressed-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-pressed-state-layer-color: var(--md-outlined-segmented-button-unselected-pressed-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-with-icon-icon-color: var(--md-outlined-segmented-button-unselected-with-icon-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_with-icon-icon-size: var(--md-outlined-segmented-button-with-icon-icon-size, 18px);--_shape-start-start: var( --md-outlined-segmented-button-shape-start-start, var(--_shape) );--_shape-start-end: var( --md-outlined-segmented-button-shape-start-end, var(--_shape) );--_shape-end-end: var( --md-outlined-segmented-button-shape-end-end, var(--_shape) );--_shape-end-start: var( --md-outlined-segmented-button-shape-end-start, var(--_shape) )}/*# sourceMappingURL=outlined-styles.css.map */ `; //# sourceMappingURL=outlined-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/segmentedbuttonset/lib/segmented-button-set.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/segmentedbuttonset/lib/segmented-button-set.d.ts index 1dedb70..c085c628 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/segmentedbuttonset/lib/segmented-button-set.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/segmentedbuttonset/lib/segmented-button-set.d.ts
@@ -3,19 +3,15 @@ * Copyright 2021 Google LLC * SPDX-License-Identifier: Apache-2.0 */ -import { LitElement, TemplateResult } from 'lit'; -import { ClassInfo } from 'lit/directives/class-map.js'; +import { LitElement } from 'lit'; import { SegmentedButton } from '../../segmentedbutton/lib/segmented-button.js'; /** * SegmentedButtonSet is the parent component for two or more * `SegmentedButton` components. **Only** `SegmentedButton` components may be * used as children. - * @soyCompatible */ export declare class SegmentedButtonSet extends LitElement { multiselect: boolean; - /** @soyPrefixAttribute */ - ariaLabel: string; buttons: SegmentedButton[]; getButtonDisabled(index: number): boolean; setButtonDisabled(index: number, disabled: boolean): void; @@ -25,8 +21,6 @@ private toggleSelection; private indexOutOfBounds; private emitSelectionEvent; - /** @soyTemplate */ - render(): TemplateResult; - /** @soyTemplate */ - protected getRenderClasses(): ClassInfo; + protected render(): import("lit-html").TemplateResult<1>; + protected getRenderClasses(): {}; }
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/segmentedbuttonset/lib/segmented-button-set.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/segmentedbuttonset/lib/segmented-button-set.js index 5441453..50d3536 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/segmentedbuttonset/lib/segmented-button-set.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/segmentedbuttonset/lib/segmented-button-set.js
@@ -3,17 +3,15 @@ * Copyright 2021 Google LLC * SPDX-License-Identifier: Apache-2.0 */ -import { __decorate, __metadata } from "tslib"; -import { html, LitElement } from 'lit'; +var _a; +import { __decorate } from "tslib"; +import { html, LitElement, nothing } from 'lit'; import { property, queryAssignedElements } from 'lit/decorators.js'; -import { classMap } from 'lit/directives/class-map.js'; -import { ifDefined } from 'lit/directives/if-defined.js'; -import { ariaProperty } from '../../decorators/aria-property.js'; +import { requestUpdateOnAriaChange } from '../../aria/delegate.js'; /** * SegmentedButtonSet is the parent component for two or more * `SegmentedButton` components. **Only** `SegmentedButton` components may be * used as children. - * @soyCompatible */ export class SegmentedButtonSet extends LitElement { constructor() { @@ -82,35 +80,31 @@ composed: true })); } - /** @soyTemplate */ render() { + // Needed for closure conformance + const { ariaLabel } = this; return html ` <span role="group" @segmented-button-interaction="${this.handleSegmentedButtonInteraction}" - aria-label="${ifDefined(this.ariaLabel)}" - class="md3-segmented-button-set ${classMap(this.getRenderClasses())}"> + aria-label=${ariaLabel || nothing} + class="md3-segmented-button-set"> <slot></slot> </span> `; } - /** @soyTemplate */ getRenderClasses() { return {}; } } +_a = SegmentedButtonSet; +(() => { + requestUpdateOnAriaChange(_a); +})(); __decorate([ - property({ type: Boolean }), - __metadata("design:type", Object) + property({ type: Boolean }) ], SegmentedButtonSet.prototype, "multiselect", void 0); __decorate([ - ariaProperty // tslint:disable-line:no-new-decorators - , - property({ type: String, attribute: 'aria-label' }), - __metadata("design:type", String) -], SegmentedButtonSet.prototype, "ariaLabel", void 0); -__decorate([ - queryAssignedElements({ flatten: true }), - __metadata("design:type", Array) + queryAssignedElements({ flatten: true }) ], SegmentedButtonSet.prototype, "buttons", void 0); //# sourceMappingURL=segmented-button-set.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/segmentedbuttonset/outlined-segmented-button-set.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/segmentedbuttonset/outlined-segmented-button-set.d.ts index d270b20..554eaf38 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/segmentedbuttonset/outlined-segmented-button-set.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/segmentedbuttonset/outlined-segmented-button-set.d.ts
@@ -12,7 +12,6 @@ /** * MdOutlinedSegmentedButtonSet is the custom element for the Material * Design outlined segmented button set component. - * @soyCompatible * @final * @suppress {visibility} */
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/segmentedbuttonset/outlined-segmented-button-set.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/segmentedbuttonset/outlined-segmented-button-set.js index 3f9b61c15..28e99e5 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/segmentedbuttonset/outlined-segmented-button-set.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/segmentedbuttonset/outlined-segmented-button-set.js
@@ -11,7 +11,6 @@ /** * MdOutlinedSegmentedButtonSet is the custom element for the Material * Design outlined segmented button set component. - * @soyCompatible * @final * @suppress {visibility} */
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/select/filled-select.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/select/filled-select.d.ts new file mode 100644 index 0000000..68172976 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/select/filled-select.d.ts
@@ -0,0 +1,41 @@ +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import { FilledSelect } from './lib/filled-select.js'; +declare global { + interface HTMLElementTagNameMap { + 'md-filled-select': MdFilledSelect; + } +} +/** + * @summary + * Select menus display a list of choices on temporary surfaces and display the + * currently selected menu item above the menu. + * + * @description + * The select component allows users to choose a value from a fixed list of + * available options. Composed of an interactive anchor button and a menu, it is + * analogous to the native HTML `<select>` element. This is the "filled" + * variant. + * + * @example + * ```html + * <md-filled-select label="fruits"> + * <!-- An empty selected option will give select an "un-filled" state --> + * <md-select-option selected></md-select-option> + * <md-select-option value="apple" headline="Apple"></md-select-option> + * <md-select-option value="banana" headline="Banana"></md-select-option> + * <md-select-option value="kiwi" headline="Kiwi"></md-select-option> + * <md-select-option value="orange" headline="Orange"></md-select-option> + * <md-select-option value="tomato" headline="Tomato"></md-select-option> + * </md-filled-select> + * ``` + * + * @final + * @suppress {visibility} + */ +export declare class MdFilledSelect extends FilledSelect { + static styles: import("lit").CSSResult[]; +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/select/filled-select.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/select/filled-select.js new file mode 100644 index 0000000..5567660 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/select/filled-select.js
@@ -0,0 +1,46 @@ +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import { __decorate } from "tslib"; +import { customElement } from 'lit/decorators.js'; +import { styles as filledForcedColorsStyles } from './lib/filled-forced-colors-styles.css.js'; +import { FilledSelect } from './lib/filled-select.js'; +import { styles } from './lib/filled-select-styles.css.js'; +import { styles as sharedStyles } from './lib/shared-styles.css.js'; +/** + * @summary + * Select menus display a list of choices on temporary surfaces and display the + * currently selected menu item above the menu. + * + * @description + * The select component allows users to choose a value from a fixed list of + * available options. Composed of an interactive anchor button and a menu, it is + * analogous to the native HTML `<select>` element. This is the "filled" + * variant. + * + * @example + * ```html + * <md-filled-select label="fruits"> + * <!-- An empty selected option will give select an "un-filled" state --> + * <md-select-option selected></md-select-option> + * <md-select-option value="apple" headline="Apple"></md-select-option> + * <md-select-option value="banana" headline="Banana"></md-select-option> + * <md-select-option value="kiwi" headline="Kiwi"></md-select-option> + * <md-select-option value="orange" headline="Orange"></md-select-option> + * <md-select-option value="tomato" headline="Tomato"></md-select-option> + * </md-filled-select> + * ``` + * + * @final + * @suppress {visibility} + */ +let MdFilledSelect = class MdFilledSelect extends FilledSelect { +}; +MdFilledSelect.styles = [sharedStyles, styles, filledForcedColorsStyles]; +MdFilledSelect = __decorate([ + customElement('md-filled-select') +], MdFilledSelect); +export { MdFilledSelect }; +//# sourceMappingURL=filled-select.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/select/harness.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/select/harness.d.ts new file mode 100644 index 0000000..e8a44f9 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/select/harness.d.ts
@@ -0,0 +1,24 @@ +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import { Field } from '../field/lib/field.js'; +import { Harness } from '../testing/harness.js'; +import { Select } from './lib/select.js'; +import { SelectOptionHarness } from './lib/selectoption/harness.js'; +/** + * Test harness for menu. + */ +export declare class SelectHarness extends Harness<Select> { + protected getField(): Field; + /** + * Shows the menu and returns the first list item element. + */ + protected getInteractiveElement(): Promise<Field>; + startHover(): Promise<void>; + /** @return ListItem harnesses for the menu's items. */ + getItems(): SelectOptionHarness[]; + click(quick?: boolean): Promise<void>; + clickOption(index: number): Promise<void>; +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/fab-extended-styles.css.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/select/lib/filled-forced-colors-styles.css.d.ts similarity index 100% copy from third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/fab-extended-styles.css.d.ts copy to third_party/material_web_components/components-chromium/node_modules/@material/web/select/lib/filled-forced-colors-styles.css.d.ts
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/select/lib/filled-forced-colors-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/select/lib/filled-forced-colors-styles.css.js new file mode 100644 index 0000000..1a68e7c --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/select/lib/filled-forced-colors-styles.css.js
@@ -0,0 +1,9 @@ +/** + * @license + * Copyright 2022 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import { css } from 'lit'; +export const styles = css `@media(forced-colors: active){:host{--md-filled-select-text-field-disabled-active-indicator-color: GrayText;--md-filled-select-text-field-disabled-active-indicator-opacity: 1;--md-filled-select-text-field-disabled-input-text-color: GrayText;--md-filled-select-text-field-disabled-input-text-opacity: 1;--md-filled-select-text-field-disabled-label-text-color: GrayText;--md-filled-select-text-field-disabled-label-text-opacity: 1;--md-filled-select-text-field-disabled-leading-icon-color: GrayText;--md-filled-select-text-field-disabled-leading-icon-opacity: 1;--md-filled-select-text-field-disabled-supporting-text-color: GrayText;--md-filled-select-text-field-disabled-supporting-text-opacity: 1;--md-filled-select-text-field-disabled-trailing-icon-color: GrayText;--md-filled-select-text-field-disabled-trailing-icon-opacity: 1}}/*# sourceMappingURL=filled-forced-colors-styles.css.map */ +`; +//# sourceMappingURL=filled-forced-colors-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/fab-extended-styles.css.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/select/lib/filled-select-styles.css.d.ts similarity index 100% copy from third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/fab-extended-styles.css.d.ts copy to third_party/material_web_components/components-chromium/node_modules/@material/web/select/lib/filled-select-styles.css.d.ts
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/select/lib/filled-select-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/select/lib/filled-select-styles.css.js new file mode 100644 index 0000000..5ae05a0 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/select/lib/filled-select-styles.css.js
@@ -0,0 +1,9 @@ +/** + * @license + * Copyright 2022 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import { css } from 'lit'; +export const styles = css `:host{--_text-field-active-indicator-color: var(--md-filled-select-text-field-active-indicator-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-active-indicator-height: var(--md-filled-select-text-field-active-indicator-height, 1px);--_text-field-container-color: var(--md-filled-select-text-field-container-color, var(--md-sys-color-surface-container-highest, #e6e0e9));--_text-field-container-shape-start-start: var( --md-filled-select-text-field-container-shape-start-start, var( --md-filled-select-text-field-container-shape, 4px ) );--_text-field-container-shape-start-end: var( --md-filled-select-text-field-container-shape-start-end, var( --md-filled-select-text-field-container-shape, 4px ) );--_text-field-container-shape-end-end: var( --md-filled-select-text-field-container-shape-end-end, var( --md-filled-select-text-field-container-shape, 0px ) );--_text-field-container-shape-end-start: var( --md-filled-select-text-field-container-shape-end-start, var( --md-filled-select-text-field-container-shape, 0px ) );--_text-field-disabled-active-indicator-color: var(--md-filled-select-text-field-disabled-active-indicator-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-disabled-active-indicator-height: var(--md-filled-select-text-field-disabled-active-indicator-height, 1px);--_text-field-disabled-active-indicator-opacity: var(--md-filled-select-text-field-disabled-active-indicator-opacity, 0.38);--_text-field-disabled-container-color: var(--md-filled-select-text-field-disabled-container-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-disabled-container-opacity: var(--md-filled-select-text-field-disabled-container-opacity, 0.04);--_text-field-disabled-input-text-color: var(--md-filled-select-text-field-disabled-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-disabled-input-text-opacity: var(--md-filled-select-text-field-disabled-input-text-opacity, 0.38);--_text-field-disabled-label-text-color: var(--md-filled-select-text-field-disabled-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-disabled-label-text-opacity: var(--md-filled-select-text-field-disabled-label-text-opacity, 0.38);--_text-field-disabled-leading-icon-color: var(--md-filled-select-text-field-disabled-leading-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-disabled-leading-icon-opacity: var(--md-filled-select-text-field-disabled-leading-icon-opacity, 0.38);--_text-field-disabled-supporting-text-color: var(--md-filled-select-text-field-disabled-supporting-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-disabled-supporting-text-opacity: var(--md-filled-select-text-field-disabled-supporting-text-opacity, 0.38);--_text-field-disabled-trailing-icon-color: var(--md-filled-select-text-field-disabled-trailing-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-disabled-trailing-icon-opacity: var(--md-filled-select-text-field-disabled-trailing-icon-opacity, 0.38);--_text-field-error-active-indicator-color: var(--md-filled-select-text-field-error-active-indicator-color, var(--md-sys-color-error, #b3261e));--_text-field-error-focus-active-indicator-color: var(--md-filled-select-text-field-error-focus-active-indicator-color, var(--md-sys-color-error, #b3261e));--_text-field-error-focus-input-text-color: var(--md-filled-select-text-field-error-focus-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-error-focus-label-text-color: var(--md-filled-select-text-field-error-focus-label-text-color, var(--md-sys-color-error, #b3261e));--_text-field-error-focus-leading-icon-color: var(--md-filled-select-text-field-error-focus-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-error-focus-supporting-text-color: var(--md-filled-select-text-field-error-focus-supporting-text-color, var(--md-sys-color-error, #b3261e));--_text-field-error-focus-trailing-icon-color: var(--md-filled-select-text-field-error-focus-trailing-icon-color, var(--md-sys-color-error, #b3261e));--_text-field-error-hover-active-indicator-color: var(--md-filled-select-text-field-error-hover-active-indicator-color, var(--md-sys-color-on-error-container, #410e0b));--_text-field-error-hover-input-text-color: var(--md-filled-select-text-field-error-hover-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-error-hover-label-text-color: var(--md-filled-select-text-field-error-hover-label-text-color, var(--md-sys-color-on-error-container, #410e0b));--_text-field-error-hover-leading-icon-color: var(--md-filled-select-text-field-error-hover-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-error-hover-state-layer-color: var(--md-filled-select-text-field-error-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-error-hover-state-layer-opacity: var(--md-filled-select-text-field-error-hover-state-layer-opacity, 0.08);--_text-field-error-hover-supporting-text-color: var(--md-filled-select-text-field-error-hover-supporting-text-color, var(--md-sys-color-error, #b3261e));--_text-field-error-hover-trailing-icon-color: var(--md-filled-select-text-field-error-hover-trailing-icon-color, var(--md-sys-color-on-error-container, #410e0b));--_text-field-error-input-text-color: var(--md-filled-select-text-field-error-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-error-label-text-color: var(--md-filled-select-text-field-error-label-text-color, var(--md-sys-color-error, #b3261e));--_text-field-error-leading-icon-color: var(--md-filled-select-text-field-error-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-error-supporting-text-color: var(--md-filled-select-text-field-error-supporting-text-color, var(--md-sys-color-error, #b3261e));--_text-field-error-trailing-icon-color: var(--md-filled-select-text-field-error-trailing-icon-color, var(--md-sys-color-error, #b3261e));--_text-field-focus-active-indicator-color: var(--md-filled-select-text-field-focus-active-indicator-color, var(--md-sys-color-primary, #6750a4));--_text-field-focus-active-indicator-height: var(--md-filled-select-text-field-focus-active-indicator-height, 2px);--_text-field-focus-input-text-color: var(--md-filled-select-text-field-focus-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-focus-label-text-color: var(--md-filled-select-text-field-focus-label-text-color, var(--md-sys-color-primary, #6750a4));--_text-field-focus-leading-icon-color: var(--md-filled-select-text-field-focus-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-focus-supporting-text-color: var(--md-filled-select-text-field-focus-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-focus-trailing-icon-color: var(--md-filled-select-text-field-focus-trailing-icon-color, var(--md-sys-color-primary, #6750a4));--_text-field-hover-active-indicator-color: var(--md-filled-select-text-field-hover-active-indicator-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-hover-active-indicator-height: var(--md-filled-select-text-field-hover-active-indicator-height, 1px);--_text-field-hover-input-text-color: var(--md-filled-select-text-field-hover-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-hover-label-text-color: var(--md-filled-select-text-field-hover-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-hover-leading-icon-color: var(--md-filled-select-text-field-hover-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-hover-state-layer-color: var(--md-filled-select-text-field-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-hover-state-layer-opacity: var(--md-filled-select-text-field-hover-state-layer-opacity, 0.08);--_text-field-hover-supporting-text-color: var(--md-filled-select-text-field-hover-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-hover-trailing-icon-color: var(--md-filled-select-text-field-hover-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-input-text-color: var(--md-filled-select-text-field-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-input-text-type: var(--md-filled-select-text-field-input-text-type, 400 1rem / 1.5rem var(--md-ref-typeface-plain, Roboto));--_text-field-label-text-color: var(--md-filled-select-text-field-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-label-text-populated-line-height: var(--md-filled-select-text-field-label-text-populated-line-height, 1rem);--_text-field-label-text-populated-size: var(--md-filled-select-text-field-label-text-populated-size, 0.75rem);--_text-field-label-text-type: var(--md-filled-select-text-field-label-text-type, 400 1rem / 1.5rem var(--md-ref-typeface-plain, Roboto));--_text-field-leading-icon-color: var(--md-filled-select-text-field-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-leading-icon-size: var(--md-filled-select-text-field-leading-icon-size, 20px);--_text-field-supporting-text-color: var(--md-filled-select-text-field-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-supporting-text-type: var(--md-filled-select-text-field-supporting-text-type, 400 0.75rem / 1rem var(--md-ref-typeface-plain, Roboto));--_text-field-trailing-icon-color: var(--md-filled-select-text-field-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-trailing-icon-size: var(--md-filled-select-text-field-trailing-icon-size, 24px);--md-filled-field-active-indicator-color: var(--_text-field-active-indicator-color);--md-filled-field-active-indicator-height: var(--_text-field-active-indicator-height);--md-filled-field-container-color: var(--_text-field-container-color);--md-filled-field-container-shape-end-end: var(--_text-field-container-shape-end-end);--md-filled-field-container-shape-end-start: var(--_text-field-container-shape-end-start);--md-filled-field-container-shape-start-end: var(--_text-field-container-shape-start-end);--md-filled-field-container-shape-start-start: var(--_text-field-container-shape-start-start);--md-filled-field-content-color: var(--_text-field-input-text-color);--md-filled-field-content-type: var(--_text-field-input-text-type);--md-filled-field-disabled-active-indicator-color: var(--_text-field-disabled-active-indicator-color);--md-filled-field-disabled-active-indicator-height: var(--_text-field-disabled-active-indicator-height);--md-filled-field-disabled-active-indicator-opacity: var(--_text-field-disabled-active-indicator-opacity);--md-filled-field-disabled-container-color: var(--_text-field-disabled-container-color);--md-filled-field-disabled-container-opacity: var(--_text-field-disabled-container-opacity);--md-filled-field-disabled-content-color: var(--_text-field-disabled-input-text-color);--md-filled-field-disabled-content-opacity: var(--_text-field-disabled-input-text-opacity);--md-filled-field-disabled-label-text-color: var(--_text-field-disabled-label-text-color);--md-filled-field-disabled-label-text-opacity: var(--_text-field-disabled-label-text-opacity);--md-filled-field-disabled-leading-content-color: var(--_text-field-disabled-leading-icon-color);--md-filled-field-disabled-leading-content-opacity: var(--_text-field-disabled-leading-icon-opacity);--md-filled-field-disabled-supporting-text-color: var(--_text-field-disabled-supporting-text-color);--md-filled-field-disabled-supporting-text-opacity: var(--_text-field-disabled-supporting-text-opacity);--md-filled-field-disabled-trailing-content-color: var(--_text-field-disabled-trailing-icon-color);--md-filled-field-disabled-trailing-content-opacity: var(--_text-field-disabled-trailing-icon-opacity);--md-filled-field-error-active-indicator-color: var(--_text-field-error-active-indicator-color);--md-filled-field-error-content-color: var(--_text-field-error-input-text-color);--md-filled-field-error-focus-active-indicator-color: var(--_text-field-error-focus-active-indicator-color);--md-filled-field-error-focus-content-color: var(--_text-field-error-focus-input-text-color);--md-filled-field-error-focus-label-text-color: var(--_text-field-error-focus-label-text-color);--md-filled-field-error-focus-leading-content-color: var(--_text-field-error-focus-leading-icon-color);--md-filled-field-error-focus-supporting-text-color: var(--_text-field-error-focus-supporting-text-color);--md-filled-field-error-focus-trailing-content-color: var(--_text-field-error-focus-trailing-icon-color);--md-filled-field-error-hover-active-indicator-color: var(--_text-field-error-hover-active-indicator-color);--md-filled-field-error-hover-content-color: var(--_text-field-error-hover-input-text-color);--md-filled-field-error-hover-label-text-color: var(--_text-field-error-hover-label-text-color);--md-filled-field-error-hover-leading-content-color: var(--_text-field-error-hover-leading-icon-color);--md-filled-field-error-hover-state-layer-color: var(--_text-field-error-hover-state-layer-color);--md-filled-field-error-hover-state-layer-opacity: var(--_text-field-error-hover-state-layer-opacity);--md-filled-field-error-hover-supporting-text-color: var(--_text-field-error-hover-supporting-text-color);--md-filled-field-error-hover-trailing-content-color: var(--_text-field-error-hover-trailing-icon-color);--md-filled-field-error-label-text-color: var(--_text-field-error-label-text-color);--md-filled-field-error-leading-content-color: var(--_text-field-error-leading-icon-color);--md-filled-field-error-supporting-text-color: var(--_text-field-error-supporting-text-color);--md-filled-field-error-trailing-content-color: var(--_text-field-error-trailing-icon-color);--md-filled-field-focus-active-indicator-color: var(--_text-field-focus-active-indicator-color);--md-filled-field-focus-active-indicator-height: var(--_text-field-focus-active-indicator-height);--md-filled-field-focus-content-color: var(--_text-field-focus-input-text-color);--md-filled-field-focus-label-text-color: var(--_text-field-focus-label-text-color);--md-filled-field-focus-leading-content-color: var(--_text-field-focus-leading-icon-color);--md-filled-field-focus-supporting-text-color: var(--_text-field-focus-supporting-text-color);--md-filled-field-focus-trailing-content-color: var(--_text-field-focus-trailing-icon-color);--md-filled-field-hover-active-indicator-color: var(--_text-field-hover-active-indicator-color);--md-filled-field-hover-active-indicator-height: var(--_text-field-hover-active-indicator-height);--md-filled-field-hover-content-color: var(--_text-field-hover-input-text-color);--md-filled-field-hover-label-text-color: var(--_text-field-hover-label-text-color);--md-filled-field-hover-leading-content-color: var(--_text-field-hover-leading-icon-color);--md-filled-field-hover-state-layer-color: var(--_text-field-hover-state-layer-color);--md-filled-field-hover-state-layer-opacity: var(--_text-field-hover-state-layer-opacity);--md-filled-field-hover-supporting-text-color: var(--_text-field-hover-supporting-text-color);--md-filled-field-hover-trailing-content-color: var(--_text-field-hover-trailing-icon-color);--md-filled-field-label-text-color: var(--_text-field-label-text-color);--md-filled-field-label-text-populated-line-height: var(--_text-field-label-text-populated-line-height);--md-filled-field-label-text-populated-size: var(--_text-field-label-text-populated-size);--md-filled-field-label-text-type: var(--_text-field-label-text-type);--md-filled-field-leading-content-color: var(--_text-field-leading-icon-color);--md-filled-field-supporting-text-color: var(--_text-field-supporting-text-color);--md-filled-field-supporting-text-type: var(--_text-field-supporting-text-type);--md-filled-field-trailing-content-color: var(--_text-field-trailing-icon-color)}[hasstart] .icon.leading{font-size:var(--_text-field-leading-icon-size);height:var(--_text-field-leading-icon-size);width:var(--_text-field-leading-icon-size)}[hasend] .icon.trailing{font-size:var(--_text-field-trailing-icon-size);height:var(--_text-field-trailing-icon-size);width:var(--_text-field-trailing-icon-size)}/*# sourceMappingURL=filled-select-styles.css.map */ +`; +//# sourceMappingURL=filled-select-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/select/lib/filled-select.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/select/lib/filled-select.d.ts new file mode 100644 index 0000000..4b462499 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/select/lib/filled-select.d.ts
@@ -0,0 +1,10 @@ +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import '../../field/filled-field.js'; +import { Select } from './select.js'; +export declare abstract class FilledSelect extends Select { + protected readonly fieldTag: import("lit-html/static.js").StaticValue; +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/select/lib/filled-select.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/select/lib/filled-select.js new file mode 100644 index 0000000..6a639f16 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/select/lib/filled-select.js
@@ -0,0 +1,16 @@ +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import '../../field/filled-field.js'; +import { literal } from 'lit/static-html.js'; +import { Select } from './select.js'; +// tslint:disable-next-line:enforce-comments-on-exported-symbols +export class FilledSelect extends Select { + constructor() { + super(...arguments); + this.fieldTag = literal `md-filled-field`; + } +} +//# sourceMappingURL=filled-select.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/fab-extended-styles.css.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/select/lib/outlined-forced-colors-styles.css.d.ts similarity index 100% copy from third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/fab-extended-styles.css.d.ts copy to third_party/material_web_components/components-chromium/node_modules/@material/web/select/lib/outlined-forced-colors-styles.css.d.ts
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/select/lib/outlined-forced-colors-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/select/lib/outlined-forced-colors-styles.css.js new file mode 100644 index 0000000..fdff0036 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/select/lib/outlined-forced-colors-styles.css.js
@@ -0,0 +1,9 @@ +/** + * @license + * Copyright 2022 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import { css } from 'lit'; +export const styles = css `@media(forced-colors: active){:host{--md-outlined-select-text-field-disabled-input-text-color: GrayText;--md-outlined-select-text-field-disabled-input-text-opacity: 1;--md-outlined-select-text-field-disabled-label-text-color: GrayText;--md-outlined-select-text-field-disabled-label-text-opacity: 1;--md-outlined-select-text-field-disabled-leading-icon-color: GrayText;--md-outlined-select-text-field-disabled-leading-icon-opacity: 1;--md-outlined-select-text-field-disabled-outline-color: GrayText;--md-outlined-select-text-field-disabled-outline-opacity: 1;--md-outlined-select-text-field-disabled-supporting-text-color: GrayText;--md-outlined-select-text-field-disabled-supporting-text-opacity: 1;--md-outlined-select-text-field-disabled-trailing-icon-color: GrayText;--md-outlined-select-text-field-disabled-trailing-icon-opacity: 1}}/*# sourceMappingURL=outlined-forced-colors-styles.css.map */ +`; +//# sourceMappingURL=outlined-forced-colors-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/fab-extended-styles.css.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/select/lib/outlined-select-styles.css.d.ts similarity index 100% copy from third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/fab-extended-styles.css.d.ts copy to third_party/material_web_components/components-chromium/node_modules/@material/web/select/lib/outlined-select-styles.css.d.ts
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/select/lib/outlined-select-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/select/lib/outlined-select-styles.css.js new file mode 100644 index 0000000..e55de79 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/select/lib/outlined-select-styles.css.js
@@ -0,0 +1,9 @@ +/** + * @license + * Copyright 2022 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import { css } from 'lit'; +export const styles = css `:host{--_text-field-container-shape: var(--md-outlined-select-text-field-container-shape, 4px);--_text-field-disabled-input-text-color: var(--md-outlined-select-text-field-disabled-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-disabled-input-text-opacity: var(--md-outlined-select-text-field-disabled-input-text-opacity, 0.38);--_text-field-disabled-label-text-color: var(--md-outlined-select-text-field-disabled-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-disabled-label-text-opacity: var(--md-outlined-select-text-field-disabled-label-text-opacity, 0.38);--_text-field-disabled-leading-icon-color: var(--md-outlined-select-text-field-disabled-leading-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-disabled-leading-icon-opacity: var(--md-outlined-select-text-field-disabled-leading-icon-opacity, 0.38);--_text-field-disabled-outline-color: var(--md-outlined-select-text-field-disabled-outline-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-disabled-outline-opacity: var(--md-outlined-select-text-field-disabled-outline-opacity, 0.12);--_text-field-disabled-outline-width: var(--md-outlined-select-text-field-disabled-outline-width, 1px);--_text-field-disabled-supporting-text-color: var(--md-outlined-select-text-field-disabled-supporting-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-disabled-supporting-text-opacity: var(--md-outlined-select-text-field-disabled-supporting-text-opacity, 0.38);--_text-field-disabled-trailing-icon-color: var(--md-outlined-select-text-field-disabled-trailing-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-disabled-trailing-icon-opacity: var(--md-outlined-select-text-field-disabled-trailing-icon-opacity, 0.38);--_text-field-error-focus-input-text-color: var(--md-outlined-select-text-field-error-focus-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-error-focus-label-text-color: var(--md-outlined-select-text-field-error-focus-label-text-color, var(--md-sys-color-error, #b3261e));--_text-field-error-focus-leading-icon-color: var(--md-outlined-select-text-field-error-focus-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-error-focus-outline-color: var(--md-outlined-select-text-field-error-focus-outline-color, var(--md-sys-color-error, #b3261e));--_text-field-error-focus-supporting-text-color: var(--md-outlined-select-text-field-error-focus-supporting-text-color, var(--md-sys-color-error, #b3261e));--_text-field-error-focus-trailing-icon-color: var(--md-outlined-select-text-field-error-focus-trailing-icon-color, var(--md-sys-color-error, #b3261e));--_text-field-error-hover-input-text-color: var(--md-outlined-select-text-field-error-hover-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-error-hover-label-text-color: var(--md-outlined-select-text-field-error-hover-label-text-color, var(--md-sys-color-on-error-container, #410e0b));--_text-field-error-hover-leading-icon-color: var(--md-outlined-select-text-field-error-hover-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-error-hover-outline-color: var(--md-outlined-select-text-field-error-hover-outline-color, var(--md-sys-color-on-error-container, #410e0b));--_text-field-error-hover-supporting-text-color: var(--md-outlined-select-text-field-error-hover-supporting-text-color, var(--md-sys-color-error, #b3261e));--_text-field-error-hover-trailing-icon-color: var(--md-outlined-select-text-field-error-hover-trailing-icon-color, var(--md-sys-color-on-error-container, #410e0b));--_text-field-error-input-text-color: var(--md-outlined-select-text-field-error-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-error-label-text-color: var(--md-outlined-select-text-field-error-label-text-color, var(--md-sys-color-error, #b3261e));--_text-field-error-leading-icon-color: var(--md-outlined-select-text-field-error-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-error-outline-color: var(--md-outlined-select-text-field-error-outline-color, var(--md-sys-color-error, #b3261e));--_text-field-error-supporting-text-color: var(--md-outlined-select-text-field-error-supporting-text-color, var(--md-sys-color-error, #b3261e));--_text-field-error-trailing-icon-color: var(--md-outlined-select-text-field-error-trailing-icon-color, var(--md-sys-color-error, #b3261e));--_text-field-focus-input-text-color: var(--md-outlined-select-text-field-focus-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-focus-label-text-color: var(--md-outlined-select-text-field-focus-label-text-color, var(--md-sys-color-primary, #6750a4));--_text-field-focus-leading-icon-color: var(--md-outlined-select-text-field-focus-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-focus-outline-color: var(--md-outlined-select-text-field-focus-outline-color, var(--md-sys-color-primary, #6750a4));--_text-field-focus-outline-width: var(--md-outlined-select-text-field-focus-outline-width, 2px);--_text-field-focus-supporting-text-color: var(--md-outlined-select-text-field-focus-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-focus-trailing-icon-color: var(--md-outlined-select-text-field-focus-trailing-icon-color, var(--md-sys-color-primary, #6750a4));--_text-field-hover-input-text-color: var(--md-outlined-select-text-field-hover-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-hover-label-text-color: var(--md-outlined-select-text-field-hover-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-hover-leading-icon-color: var(--md-outlined-select-text-field-hover-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-hover-outline-color: var(--md-outlined-select-text-field-hover-outline-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-hover-outline-width: var(--md-outlined-select-text-field-hover-outline-width, 1px);--_text-field-hover-supporting-text-color: var(--md-outlined-select-text-field-hover-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-hover-trailing-icon-color: var(--md-outlined-select-text-field-hover-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-input-text-color: var(--md-outlined-select-text-field-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_text-field-input-text-type: var(--md-outlined-select-text-field-input-text-type, 400 1rem / 1.5rem var(--md-ref-typeface-plain, Roboto));--_text-field-label-text-color: var(--md-outlined-select-text-field-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-label-text-populated-line-height: var(--md-outlined-select-text-field-label-text-populated-line-height, 1rem);--_text-field-label-text-populated-size: var(--md-outlined-select-text-field-label-text-populated-size, 0.75rem);--_text-field-label-text-type: var(--md-outlined-select-text-field-label-text-type, 400 1rem / 1.5rem var(--md-ref-typeface-plain, Roboto));--_text-field-leading-icon-color: var(--md-outlined-select-text-field-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-leading-icon-size: var(--md-outlined-select-text-field-leading-icon-size, 24px);--_text-field-outline-color: var(--md-outlined-select-text-field-outline-color, var(--md-sys-color-outline, #79747e));--_text-field-outline-width: var(--md-outlined-select-text-field-outline-width, 1px);--_text-field-supporting-text-color: var(--md-outlined-select-text-field-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-supporting-text-type: var(--md-outlined-select-text-field-supporting-text-type, 400 0.75rem / 1rem var(--md-ref-typeface-plain, Roboto));--_text-field-trailing-icon-color: var(--md-outlined-select-text-field-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_text-field-trailing-icon-size: var(--md-outlined-select-text-field-trailing-icon-size, 24px);--_text-field-container-shape-start-start: var( --md-outlined-select-text-field-container-shape-start-start, var(--_text-field-container-shape) );--_text-field-container-shape-start-end: var( --md-outlined-select-text-field-container-shape-start-end, var(--_text-field-container-shape) );--_text-field-container-shape-end-end: var( --md-outlined-select-text-field-container-shape-end-end, var(--_text-field-container-shape) );--_text-field-container-shape-end-start: var( --md-outlined-select-text-field-container-shape-end-start, var(--_text-field-container-shape) );--md-outlined-field-container-shape-end-end: var(--_text-field-container-shape-end-end);--md-outlined-field-container-shape-end-start: var(--_text-field-container-shape-end-start);--md-outlined-field-container-shape-start-end: var(--_text-field-container-shape-start-end);--md-outlined-field-container-shape-start-start: var(--_text-field-container-shape-start-start);--md-outlined-field-content-color: var(--_text-field-input-text-color);--md-outlined-field-content-type: var(--_text-field-input-text-type);--md-outlined-field-disabled-content-color: var(--_text-field-disabled-input-text-color);--md-outlined-field-disabled-content-opacity: var(--_text-field-disabled-input-text-opacity);--md-outlined-field-disabled-label-text-color: var(--_text-field-disabled-label-text-color);--md-outlined-field-disabled-label-text-opacity: var(--_text-field-disabled-label-text-opacity);--md-outlined-field-disabled-leading-content-color: var(--_text-field-disabled-leading-icon-color);--md-outlined-field-disabled-leading-content-opacity: var(--_text-field-disabled-leading-icon-opacity);--md-outlined-field-disabled-outline-color: var(--_text-field-disabled-outline-color);--md-outlined-field-disabled-outline-opacity: var(--_text-field-disabled-outline-opacity);--md-outlined-field-disabled-outline-width: var(--_text-field-disabled-outline-width);--md-outlined-field-disabled-supporting-text-color: var(--_text-field-disabled-supporting-text-color);--md-outlined-field-disabled-supporting-text-opacity: var(--_text-field-disabled-supporting-text-opacity);--md-outlined-field-disabled-trailing-content-color: var(--_text-field-disabled-trailing-icon-color);--md-outlined-field-disabled-trailing-content-opacity: var(--_text-field-disabled-trailing-icon-opacity);--md-outlined-field-error-content-color: var(--_text-field-error-input-text-color);--md-outlined-field-error-focus-content-color: var(--_text-field-error-focus-input-text-color);--md-outlined-field-error-focus-label-text-color: var(--_text-field-error-focus-label-text-color);--md-outlined-field-error-focus-leading-content-color: var(--_text-field-error-focus-leading-icon-color);--md-outlined-field-error-focus-outline-color: var(--_text-field-error-focus-outline-color);--md-outlined-field-error-focus-supporting-text-color: var(--_text-field-error-focus-supporting-text-color);--md-outlined-field-error-focus-trailing-content-color: var(--_text-field-error-focus-trailing-icon-color);--md-outlined-field-error-hover-content-color: var(--_text-field-error-hover-input-text-color);--md-outlined-field-error-hover-label-text-color: var(--_text-field-error-hover-label-text-color);--md-outlined-field-error-hover-leading-content-color: var(--_text-field-error-hover-leading-icon-color);--md-outlined-field-error-hover-outline-color: var(--_text-field-error-hover-outline-color);--md-outlined-field-error-hover-supporting-text-color: var(--_text-field-error-hover-supporting-text-color);--md-outlined-field-error-hover-trailing-content-color: var(--_text-field-error-hover-trailing-icon-color);--md-outlined-field-error-label-text-color: var(--_text-field-error-label-text-color);--md-outlined-field-error-leading-content-color: var(--_text-field-error-leading-icon-color);--md-outlined-field-error-outline-color: var(--_text-field-error-outline-color);--md-outlined-field-error-supporting-text-color: var(--_text-field-error-supporting-text-color);--md-outlined-field-error-trailing-content-color: var(--_text-field-error-trailing-icon-color);--md-outlined-field-focus-content-color: var(--_text-field-focus-input-text-color);--md-outlined-field-focus-label-text-color: var(--_text-field-focus-label-text-color);--md-outlined-field-focus-leading-content-color: var(--_text-field-focus-leading-icon-color);--md-outlined-field-focus-outline-color: var(--_text-field-focus-outline-color);--md-outlined-field-focus-outline-width: var(--_text-field-focus-outline-width);--md-outlined-field-focus-supporting-text-color: var(--_text-field-focus-supporting-text-color);--md-outlined-field-focus-trailing-content-color: var(--_text-field-focus-trailing-icon-color);--md-outlined-field-hover-content-color: var(--_text-field-hover-input-text-color);--md-outlined-field-hover-label-text-color: var(--_text-field-hover-label-text-color);--md-outlined-field-hover-leading-content-color: var(--_text-field-hover-leading-icon-color);--md-outlined-field-hover-outline-color: var(--_text-field-hover-outline-color);--md-outlined-field-hover-outline-width: var(--_text-field-hover-outline-width);--md-outlined-field-hover-supporting-text-color: var(--_text-field-hover-supporting-text-color);--md-outlined-field-hover-trailing-content-color: var(--_text-field-hover-trailing-icon-color);--md-outlined-field-label-text-color: var(--_text-field-label-text-color);--md-outlined-field-label-text-populated-line-height: var(--_text-field-label-text-populated-line-height);--md-outlined-field-label-text-populated-size: var(--_text-field-label-text-populated-size);--md-outlined-field-label-text-type: var(--_text-field-label-text-type);--md-outlined-field-leading-content-color: var(--_text-field-leading-icon-color);--md-outlined-field-outline-color: var(--_text-field-outline-color);--md-outlined-field-outline-width: var(--_text-field-outline-width);--md-outlined-field-supporting-text-color: var(--_text-field-supporting-text-color);--md-outlined-field-supporting-text-type: var(--_text-field-supporting-text-type);--md-outlined-field-trailing-content-color: var(--_text-field-trailing-icon-color)}[hasstart] .icon.leading{font-size:var(--_text-field-leading-icon-size);height:var(--_text-field-leading-icon-size);width:var(--_text-field-leading-icon-size)}[hasend] .icon.trailing{font-size:var(--_text-field-trailing-icon-size);height:var(--_text-field-trailing-icon-size);width:var(--_text-field-trailing-icon-size)}/*# sourceMappingURL=outlined-select-styles.css.map */ +`; +//# sourceMappingURL=outlined-select-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/select/lib/outlined-select.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/select/lib/outlined-select.d.ts new file mode 100644 index 0000000..1221719 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/select/lib/outlined-select.d.ts
@@ -0,0 +1,10 @@ +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import '../../field/outlined-field.js'; +import { Select } from './select.js'; +export declare abstract class OutlinedSelect extends Select { + protected readonly fieldTag: import("lit-html/static.js").StaticValue; +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/select/lib/outlined-select.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/select/lib/outlined-select.js new file mode 100644 index 0000000..3e067b9 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/select/lib/outlined-select.js
@@ -0,0 +1,16 @@ +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import '../../field/outlined-field.js'; +import { literal } from 'lit/static-html.js'; +import { Select } from './select.js'; +// tslint:disable-next-line:enforce-comments-on-exported-symbols +export class OutlinedSelect extends Select { + constructor() { + super(...arguments); + this.fieldTag = literal `md-outlined-field`; + } +} +//# sourceMappingURL=outlined-select.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/select/lib/select.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/select/lib/select.d.ts new file mode 100644 index 0000000..271a49e --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/select/lib/select.d.ts
@@ -0,0 +1,216 @@ +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import '../../menu/menu.js'; +import { LitElement, PropertyValues } from 'lit'; +import { StaticValue } from 'lit/static-html.js'; +import { SelectOption } from './shared.js'; +declare const VALUE: unique symbol; +/** + * @fires input Fired when a selection is made by the user via mouse or keyboard + * interaction. + * @fires change Fired when a selection is made by the user via mouse or + * keyboard interaction. + */ +export declare abstract class Select extends LitElement { + /** + * Opens the menu synchronously with no animation. + */ + quick: boolean; + /** + * Whether or not the select is required. + */ + required: boolean; + /** + * Disables the select. + */ + disabled: boolean; + /** + * The error message that replaces supporting text when `error` is true. If + * `errorText` is an empty string, then the supporting text will continue to + * show. + * + * Calling `reportValidity()` will automatically update `errorText` to the + * native `validationMessage`. + */ + errorText: string; + /** + * The floating label for the field. + */ + label: string; + /** + * Conveys additional information below the text field, such as how it should + * be used. + */ + supportingText: string; + /** + * Gets or sets whether or not the text field is in a visually invalid state. + * + * Calling `reportValidity()` will automatically update `error`. + */ + error: boolean; + /** + * Whether or not the underlying md-menu should be position: fixed to display + * in a top-level manner. + */ + menuFixed: boolean; + /** + * The max time between the keystrokes of the typeahead select / menu behavior + * before it clears the typeahead buffer. + */ + typeaheadBufferTime: number; + /** + * Whether or not the text field has a leading icon. Used for SSR. + */ + hasLeadingIcon: boolean; + /** + * Whether or not the text field has a trailing icon. Used for SSR. + */ + hasTrailingIcon: boolean; + /** + * Text to display in the field. Only set for SSR. + */ + displayText: string; + /** + * When set to true, the error text's `role="alert"` will be removed, then + * re-added after an animation frame. This will re-announce an error message + * to screen readers. + */ + private refreshErrorAlert; + private focused; + private open; + private readonly field; + private readonly menu; + private readonly leadingIcons; + private readonly trailingIcons; + /** + * The value of the currently selected option. + * + * Note: For SSR, set `[selected]` on the requested option and `displayText` + * rather than setting `value` setting `value` will incur a DOM query. + */ + get value(): string; + set value(value: string); + [VALUE]: string; + get options(): SelectOption[]; + /** + * The index of the currently selected option. + * + * Note: For SSR, set `[selected]` on the requested option and `displayText` + * rather than setting `selectedIndex` setting `selectedIndex` will incur a + * DOM query. + */ + get selectedIndex(): number; + set selectedIndex(index: number); + /** + * Returns an array of selected options. + * + * NOTE: md-select only suppoprts single selection. + */ + get selectedOptions(): SelectOption[]; + protected abstract readonly fieldTag: StaticValue; + /** + * Used for initializing select when the user sets the `value` directly. + */ + private lastUserSetValue; + /** + * Used for initializing select when the user sets the `selectedIndex` + * directly. + */ + private lastUserSetSelectedIndex; + /** + * Used for `input` and `change` event change detection. + */ + private lastSelectedOption; + private lastSelectedOptionRecords; + protected render(): import("lit-html").TemplateResult<1>; + private getRenderClasses; + private renderField; + private renderFieldContent; + private renderLeadingIcon; + private renderTrailingIcon; + private renderLabel; + private renderSupportingText; + private getSupportingText; + private shouldErrorAnnounce; + private renderMenu; + private renderMenuContent; + /** + * Handles opening the select on keydown and typahead selection when the menu + * is closed. + */ + private handleKeydown; + private handleClick; + private handleFocus; + private handleBlur; + /** + * Handles closing the menu when the focus leaves the select's subtree. + */ + private handleFocusout; + /** + * Gets a list of all selected select options as a list item record array. + * + * @return An array of selected list option records. + */ + private getSelectedOptions; + getUpdateComplete(): Promise<boolean>; + /** + * Gets the selected options from the DOM, and updates the value and display + * text to the first selected option's value and headline respectively. + * + * @return Whether or not the selected option has changed since last update. + */ + private updateValueAndDisplayText; + protected update(changed: PropertyValues<this>): void; + protected firstUpdated(changed: PropertyValues<this>): Promise<void>; + protected updated(changedProperties: PropertyValues): void; + /** + * Focuses and activates the last selected item upon opening, and resets other + * active items. + */ + private handleOpening; + private handleClosing; + /** + * Determines the reason for closing, and updates the UI accordingly. + */ + private handleCloseMenu; + /** + * Selects a given option, deselects other options, and updates the UI. + * + * @return Whether the last selected option has changed. + */ + private selectItem; + /** + * Handles updating selection when an option element requests selection via + * property / attribute change. + */ + private handleRequestSelection; + /** + * Handles updating selection when an option element requests deselection via + * property / attribute change. + */ + private handleRequestDeselection; + /** + * Selects an option given the value of the option, and updates MdSelect's + * value. + */ + select(value: string): void; + /** + * Selects an option given the index of the option, and updates MdSelect's + * value. + */ + selectIndex(index: number): void; + /** + * Attempts to initialize the selected option from user-settable values like + * SSR, setting `value`, or `selectedIndex` at startup. + */ + private initUserSelection; + private handleIconChange; + /** + * Dispatches the `input` and `change` events. + */ + private dispatchInteractionEvents; +} +export {};
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/select/lib/select.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/select/lib/select.js new file mode 100644 index 0000000..9f7d0246 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/select/lib/select.js
@@ -0,0 +1,589 @@ +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +var _a; +import { __decorate } from "tslib"; +import '../../menu/menu.js'; +import { html, LitElement, nothing } from 'lit'; +import { property, query, queryAssignedElements, state } from 'lit/decorators.js'; +import { classMap } from 'lit/directives/class-map.js'; +import { html as staticHtml } from 'lit/static-html.js'; +import { List } from '../../list/lib/list.js'; +import { DEFAULT_TYPEAHEAD_BUFFER_TIME } from '../../menu/lib/menu.js'; +import { isElementInSubtree, isSelectableKey } from '../../menu/lib/shared.js'; +import { TYPEAHEAD_RECORD } from '../../menu/lib/typeaheadController.js'; +import { getSelectedItems } from './shared.js'; +const VALUE = Symbol('value'); +/** + * @fires input Fired when a selection is made by the user via mouse or keyboard + * interaction. + * @fires change Fired when a selection is made by the user via mouse or + * keyboard interaction. + */ +export class Select extends LitElement { + constructor() { + super(...arguments); + /** + * Opens the menu synchronously with no animation. + */ + this.quick = false; + /** + * Whether or not the select is required. + */ + this.required = false; + /** + * Disables the select. + */ + this.disabled = false; + /** + * The error message that replaces supporting text when `error` is true. If + * `errorText` is an empty string, then the supporting text will continue to + * show. + * + * Calling `reportValidity()` will automatically update `errorText` to the + * native `validationMessage`. + */ + this.errorText = ''; + /** + * The floating label for the field. + */ + this.label = ''; + /** + * Conveys additional information below the text field, such as how it should + * be used. + */ + this.supportingText = ''; + /** + * Gets or sets whether or not the text field is in a visually invalid state. + * + * Calling `reportValidity()` will automatically update `error`. + */ + this.error = false; + /** + * Whether or not the underlying md-menu should be position: fixed to display + * in a top-level manner. + */ + this.menuFixed = false; + /** + * The max time between the keystrokes of the typeahead select / menu behavior + * before it clears the typeahead buffer. + */ + this.typeaheadBufferTime = DEFAULT_TYPEAHEAD_BUFFER_TIME; + /** + * Whether or not the text field has a leading icon. Used for SSR. + */ + this.hasLeadingIcon = false; + /** + * Whether or not the text field has a trailing icon. Used for SSR. + */ + this.hasTrailingIcon = false; + /** + * Text to display in the field. Only set for SSR. + */ + this.displayText = ''; + /** + * When set to true, the error text's `role="alert"` will be removed, then + * re-added after an animation frame. This will re-announce an error message + * to screen readers. + */ + this.refreshErrorAlert = false; + this.focused = false; + this.open = false; + this[_a] = ''; + /** + * Used for initializing select when the user sets the `value` directly. + */ + this.lastUserSetValue = null; + /** + * Used for initializing select when the user sets the `selectedIndex` + * directly. + */ + this.lastUserSetSelectedIndex = null; + /** + * Used for `input` and `change` event change detection. + */ + this.lastSelectedOption = null; + // tslint:disable-next-line:enforce-name-casing + this.lastSelectedOptionRecords = []; + } + /** + * The value of the currently selected option. + * + * Note: For SSR, set `[selected]` on the requested option and `displayText` + * rather than setting `value` setting `value` will incur a DOM query. + */ + get value() { + return this[VALUE]; + } + set value(value) { + this.lastUserSetValue = value; + this.select(value); + } + get options() { + // NOTE: this does a DOM query. + return (this.menu?.items ?? []); + } + /** + * The index of the currently selected option. + * + * Note: For SSR, set `[selected]` on the requested option and `displayText` + * rather than setting `selectedIndex` setting `selectedIndex` will incur a + * DOM query. + */ + get selectedIndex() { + // tslint:disable-next-line:enforce-name-casing + const [_option, index] = (this.getSelectedOptions() ?? [])[0] ?? []; + return index ?? -1; + } + set selectedIndex(index) { + this.lastUserSetSelectedIndex = index; + this.selectIndex(index); + } + /** + * Returns an array of selected options. + * + * NOTE: md-select only suppoprts single selection. + */ + get selectedOptions() { + return (this.getSelectedOptions() ?? []).map(([option]) => option); + } + render() { + return html ` + <span + class="select ${classMap(this.getRenderClasses())}" + @focusout=${this.handleFocusout}> + ${this.renderField()} + ${this.renderMenu()} + </span> + `; + } + getRenderClasses() { + return { + 'disabled': this.disabled, + 'error': this.error, + }; + } + renderField() { + return staticHtml ` + <${this.fieldTag} + aria-haspopup="listbox" + role="combobox" + tabindex=${this.disabled ? '-1' : '0'} + aria-expanded=${this.open ? 'true' : 'false'} + class="field" + label=${this.label} + .focused=${this.focused || this.open} + .populated=${!!this.displayText} + .disabled=${this.disabled} + .required=${this.required} + .error=${this.error} + .hasStart=${this.hasLeadingIcon} + .hasEnd=${this.hasTrailingIcon} + @keydown =${this.handleKeydown} + @click=${this.handleClick} + @focus=${this.handleFocus} + @blur=${this.handleBlur}> + ${this.renderFieldContent()} + </${this.fieldTag}>`; + } + renderFieldContent() { + return [ + this.renderLeadingIcon(), + this.renderLabel(), + this.renderTrailingIcon(), + this.renderSupportingText(), + ]; + } + renderLeadingIcon() { + return html ` + <span class="icon leading" slot="start"> + <slot name="leadingicon" @slotchange=${this.handleIconChange}></slot> + </span> + `; + } + renderTrailingIcon() { + return html ` + <span class="icon trailing" slot="end"> + <slot name="trailingicon" @slotchange=${this.handleIconChange}></slot> + </span> + `; + } + renderLabel() { + // need to render so that line-height can apply and give it a + // non-zero height + return html `<div + id="label" + class="label">${this.displayText || html ` `}</div>`; + } + renderSupportingText() { + const text = this.getSupportingText(); + if (!text) { + return nothing; + } + return html `<span id="support" + slot="supporting-text" + role=${this.shouldErrorAnnounce() ? 'alert' : nothing}>${text}</span>`; + } + getSupportingText() { + return this.error && this.errorText ? this.errorText : this.supportingText; + } + shouldErrorAnnounce() { + // Announce if there is an error and error text visible. + // If refreshErrorAlert is true, do not announce. This will remove the + // role="alert" attribute. Another render cycle will happen after an + // animation frame to re-add the role. + return this.error && !!this.errorText && !this.refreshErrorAlert; + } + renderMenu() { + return html ` + <md-menu + id="listbox" + default-focus="NONE" + listTabIndex="-1" + type="listbox" + stay-open-on-focusout + .anchor=${this.field} + .open=${this.open} + .quick=${this.quick} + .fixed=${this.menuFixed} + .typeaheadBufferTime=${this.typeaheadBufferTime} + @opening=${this.handleOpening} + @closing=${this.handleClosing} + @close-menu=${this.handleCloseMenu} + @request-selection=${this.handleRequestSelection} + @request-deselection=${this.handleRequestDeselection}> + ${this.renderMenuContent()} + </md-menu>`; + } + renderMenuContent() { + return html `<slot></slot>`; + } + /** + * Handles opening the select on keydown and typahead selection when the menu + * is closed. + */ + handleKeydown(e) { + if (this.open || this.disabled || !this.menu) { + return; + } + const typeaheadController = this.menu.typeaheadController; + const isOpenKey = e.code === 'Space' || e.code === 'ArrowDown' || e.code === 'Enter'; + // Do not open if currently typing ahead because the user may be typing the + // spacebar to match a word with a space + if (!typeaheadController.isTypingAhead && isOpenKey) { + e.preventDefault(); + this.open = true; + return; + } + const isPrintableKey = e.key.length === 1; + // Handles typing ahead when the menu is closed by delegating the event to + // the underlying menu's typeaheadController + if (isPrintableKey) { + typeaheadController.onKeydown(e); + e.preventDefault(); + const { lastActiveRecord } = typeaheadController; + if (!lastActiveRecord) { + return; + } + const hasChanged = this.selectItem(lastActiveRecord[TYPEAHEAD_RECORD.ITEM]); + if (hasChanged) { + this.dispatchInteractionEvents(); + } + } + } + handleClick() { + this.open = true; + } + handleFocus() { + this.focused = true; + } + handleBlur() { + this.focused = false; + } + /** + * Handles closing the menu when the focus leaves the select's subtree. + */ + handleFocusout(e) { + // Don't close the menu if we are switching focus between menu, + // select-option, and field + if (e.relatedTarget && isElementInSubtree(e.relatedTarget, this)) { + return; + } + this.open = false; + } + /** + * Gets a list of all selected select options as a list item record array. + * + * @return An array of selected list option records. + */ + getSelectedOptions() { + if (!this.menu) { + this.lastSelectedOptionRecords = []; + return null; + } + const items = this.menu.items; + this.lastSelectedOptionRecords = getSelectedItems(items); + return this.lastSelectedOptionRecords; + } + async getUpdateComplete() { + await this.menu?.updateComplete; + return super.getUpdateComplete(); + } + /** + * Gets the selected options from the DOM, and updates the value and display + * text to the first selected option's value and headline respectively. + * + * @return Whether or not the selected option has changed since last update. + */ + updateValueAndDisplayText() { + const selectedOptions = this.getSelectedOptions() ?? []; + // Used to determine whether or not we need to fire an input / change event + // which fire whenever the option element changes (value or selectedIndex) + // on user interaction. + let hasSelectedOptionChanged = false; + if (selectedOptions.length) { + const [firstSelectedOption] = selectedOptions[0]; + hasSelectedOptionChanged = + this.lastSelectedOption !== firstSelectedOption; + this.lastSelectedOption = firstSelectedOption; + this[VALUE] = firstSelectedOption.value; + this.displayText = firstSelectedOption.headline; + } + else { + hasSelectedOptionChanged = this.lastSelectedOption !== null; + this.lastSelectedOption = null; + this[VALUE] = ''; + this.displayText = ''; + } + return hasSelectedOptionChanged; + } + update(changed) { + // In SSR the options will be ready to query, so try to figure out what + // the value and display text should be. + if (!this.hasUpdated) { + this.initUserSelection(); + } + super.update(changed); + } + async firstUpdated(changed) { + await this.menu?.updateComplete; + // If this has been handled on update already due to SSR, try again. + if (!this.lastSelectedOptionRecords.length) { + this.initUserSelection(); + } + super.firstUpdated(changed); + } + updated(changedProperties) { + // Keep changedProperties arg so that subclasses may call it + if (this.refreshErrorAlert) { + // The past render cycle removed the role="alert" from the error message. + // Re-add it after an animation frame to re-announce the error. + requestAnimationFrame(() => { + this.refreshErrorAlert = false; + }); + } + } + /** + * Focuses and activates the last selected item upon opening, and resets other + * active items. + */ + async handleOpening() { + const items = this.menu.items; + const activeItem = List.getActiveItem(items)?.item; + const [selectedItem] = this.lastSelectedOptionRecords[0] ?? [null]; + // This is true if the user keys through the list but clicks out of the menu + // thus no close-menu event is fired by an item and we can't clean up in + // handleCloseMenu. + if (activeItem && activeItem !== selectedItem) { + activeItem.active = false; + } + if (selectedItem) { + selectedItem.active = true; + selectedItem.focus(); + } + } + handleClosing() { + this.open = false; + } + /** + * Determines the reason for closing, and updates the UI accordingly. + */ + handleCloseMenu(e) { + const reason = e.reason; + const item = e.itemPath[0]; + this.open = false; + let hasChanged = false; + if (reason.kind === 'CLICK_SELECTION') { + hasChanged = this.selectItem(item); + } + else if (reason.kind === 'KEYDOWN' && isSelectableKey(reason.key)) { + hasChanged = this.selectItem(item); + } + else { + // This can happen on ESC being pressed + item.active = false; + item.blur(); + } + // Dispatch interaction events since selection has been made via keyboard + // or mouse. + if (hasChanged) { + this.dispatchInteractionEvents(); + } + } + /** + * Selects a given option, deselects other options, and updates the UI. + * + * @return Whether the last selected option has changed. + */ + selectItem(item) { + this.lastSelectedOptionRecords.forEach(([option]) => { + if (item !== option) { + option.selected = false; + } + }); + item.selected = true; + return this.updateValueAndDisplayText(); + } + /** + * Handles updating selection when an option element requests selection via + * property / attribute change. + */ + handleRequestSelection(e) { + const requestingOptionEl = e.target; + // No-op if this item is already selected. + if (this.lastSelectedOptionRecords.some(([option]) => option === requestingOptionEl)) { + return; + } + this.selectItem(requestingOptionEl); + } + /** + * Handles updating selection when an option element requests deselection via + * property / attribute change. + */ + handleRequestDeselection(e) { + const requestingOptionEl = e.target; + // No-op if this item is not even in the list of tracked selected items. + if (!this.lastSelectedOptionRecords.some(([option]) => option === requestingOptionEl)) { + return; + } + this.updateValueAndDisplayText(); + } + /** + * Selects an option given the value of the option, and updates MdSelect's + * value. + */ + select(value) { + const optionToSelect = this.options.find(option => option.value === value); + if (optionToSelect) { + this.selectItem(optionToSelect); + } + } + /** + * Selects an option given the index of the option, and updates MdSelect's + * value. + */ + selectIndex(index) { + const optionToSelect = this.options[index]; + if (optionToSelect) { + this.selectItem(optionToSelect); + } + } + /** + * Attempts to initialize the selected option from user-settable values like + * SSR, setting `value`, or `selectedIndex` at startup. + */ + initUserSelection() { + // User has set `.value` directly, but internals have not yet booted up. + if (this.lastUserSetValue && !this.lastSelectedOptionRecords.length) { + this.select(this.lastUserSetValue); + // User has set `.selectedIndex` directly, but internals have not yet + // booted up. + } + else if (this.lastUserSetSelectedIndex !== null && + !this.lastSelectedOptionRecords.length) { + this.selectIndex(this.lastUserSetSelectedIndex); + // Regular boot up! + } + else { + this.updateValueAndDisplayText(); + } + } + handleIconChange() { + this.hasLeadingIcon = this.leadingIcons.length > 0; + this.hasTrailingIcon = this.trailingIcons.length > 0; + } + /** + * Dispatches the `input` and `change` events. + */ + dispatchInteractionEvents() { + this.dispatchEvent(new Event('input', { bubbles: true, composed: true })); + this.dispatchEvent(new Event('change', { bubbles: true })); + } +} +_a = VALUE; +__decorate([ + property({ type: Boolean }) +], Select.prototype, "quick", void 0); +__decorate([ + property({ type: Boolean }) +], Select.prototype, "required", void 0); +__decorate([ + property({ type: Boolean, reflect: true }) +], Select.prototype, "disabled", void 0); +__decorate([ + property({ type: String }) +], Select.prototype, "errorText", void 0); +__decorate([ + property() +], Select.prototype, "label", void 0); +__decorate([ + property({ type: String }) +], Select.prototype, "supportingText", void 0); +__decorate([ + property({ type: Boolean, reflect: true }) +], Select.prototype, "error", void 0); +__decorate([ + property({ type: Boolean }) +], Select.prototype, "menuFixed", void 0); +__decorate([ + property({ type: Number }) +], Select.prototype, "typeaheadBufferTime", void 0); +__decorate([ + property({ type: Boolean }) +], Select.prototype, "hasLeadingIcon", void 0); +__decorate([ + property({ type: Boolean }) +], Select.prototype, "hasTrailingIcon", void 0); +__decorate([ + property() +], Select.prototype, "displayText", void 0); +__decorate([ + state() +], Select.prototype, "refreshErrorAlert", void 0); +__decorate([ + state() +], Select.prototype, "focused", void 0); +__decorate([ + state() +], Select.prototype, "open", void 0); +__decorate([ + query('.field') +], Select.prototype, "field", void 0); +__decorate([ + query('md-menu') +], Select.prototype, "menu", void 0); +__decorate([ + queryAssignedElements({ slot: 'leadingicon', flatten: true }) +], Select.prototype, "leadingIcons", void 0); +__decorate([ + queryAssignedElements({ slot: 'trailingicon', flatten: true }) +], Select.prototype, "trailingIcons", void 0); +__decorate([ + property() +], Select.prototype, "value", null); +__decorate([ + property({ type: Number }) +], Select.prototype, "selectedIndex", null); +//# sourceMappingURL=select.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/autocompleteitem/harness.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/select/lib/selectoption/harness.d.ts similarity index 60% rename from third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/autocompleteitem/harness.d.ts rename to third_party/material_web_components/components-chromium/node_modules/@material/web/select/lib/selectoption/harness.d.ts index c7994a43..dd3cae4 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/autocompleteitem/harness.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/select/lib/selectoption/harness.d.ts
@@ -5,7 +5,7 @@ */ import { ListItemHarness } from '../../../list/lib/listitem/harness.js'; /** - * Test harness for autocomplete item. + * Test harness for menu item. */ -export declare class AutocompleteItemHarness extends ListItemHarness { +export declare class SelectOptionHarness extends ListItemHarness { }
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/select/lib/selectoption/select-option.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/select/lib/selectoption/select-option.d.ts new file mode 100644 index 0000000..1d2b92e --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/select/lib/selectoption/select-option.d.ts
@@ -0,0 +1,30 @@ +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import { PropertyValues } from 'lit'; +import { MenuItemEl } from '../../../menu/lib/menuitem/menu-item.js'; +import { ARIARole } from '../../../types/aria.js'; +import { SelectOption } from '../shared.js'; +/** + * @fires close-menu {CloseMenuEvent} Closes the encapsulating menu on + * @fires request-selection {RequestSelectionEvent} Requests the parent + * md-select to select this element (and deselect others if single-selection) + * when `selected` changed to `true`. + * @fires request-deselection {RequestDeselectionEvent} Requests the parent + * md-select to deselect this element when `selected` changed to `false`. + */ +export declare class SelectOptionEl extends MenuItemEl implements SelectOption { + /** + * Form value of the option. + */ + value: string; + /** + * Whether or not this option is selected. + */ + selected: boolean; + protected readonly listItemRole: ARIARole; + willUpdate(changed: PropertyValues<this>): void; + updated(changed: PropertyValues<this>): void; +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/select/lib/selectoption/select-option.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/select/lib/selectoption/select-option.js new file mode 100644 index 0000000..b19cb16 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/select/lib/selectoption/select-option.js
@@ -0,0 +1,71 @@ +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import { __decorate } from "tslib"; +import { property } from 'lit/decorators.js'; +import { MenuItemEl } from '../../../menu/lib/menuitem/menu-item.js'; +import { RequestDeselectionEvent, RequestSelectionEvent } from '../shared.js'; +/** + * @fires close-menu {CloseMenuEvent} Closes the encapsulating menu on + * @fires request-selection {RequestSelectionEvent} Requests the parent + * md-select to select this element (and deselect others if single-selection) + * when `selected` changed to `true`. + * @fires request-deselection {RequestDeselectionEvent} Requests the parent + * md-select to deselect this element when `selected` changed to `false`. + */ +export class SelectOptionEl extends MenuItemEl { + constructor() { + super(...arguments); + /** + * Form value of the option. + */ + this.value = ''; + /** + * Whether or not this option is selected. + */ + this.selected = false; + this.listItemRole = 'option'; + } + willUpdate(changed) { + if (changed.has('selected')) { + // Synchronize selected -> active but not the other way around because + // active is used for keyboard navigation and doesn't mean the option + // should be selected if active. + this.active = this.selected; + this.ariaSelected = this.selected ? 'true' : 'false'; + // By default active = true focuses the element. We want to prevent that + // in this case because we set active = this.selected and that may mess + // around with menu's restore focus function once the menu closes. + this.focusOnActivation = false; + } + super.willUpdate(changed); + } + updated(changed) { + super.updated(changed); + // Restore the active = true focusing behavior which happens in + // super.updated() if it was turned off. + this.focusOnActivation = true; + // Do not dispatch event on first update / boot-up. + if (changed.has('selected') && changed.get('selected') !== undefined) { + // This section is really useful for when the user sets selected on the + // option programmatically. Most other cases (click and keyboard) are + // handled by md-select because it needs to coordinate the + // single-selection behavior. + if (this.selected) { + this.dispatchEvent(new RequestSelectionEvent()); + } + else { + this.dispatchEvent(new RequestDeselectionEvent()); + } + } + } +} +__decorate([ + property() +], SelectOptionEl.prototype, "value", void 0); +__decorate([ + property({ type: Boolean, reflect: true }) +], SelectOptionEl.prototype, "selected", void 0); +//# sourceMappingURL=select-option.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/shared-styles.css.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/select/lib/shared-styles.css.d.ts similarity index 100% copy from third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/shared-styles.css.d.ts copy to third_party/material_web_components/components-chromium/node_modules/@material/web/select/lib/shared-styles.css.d.ts
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/select/lib/shared-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/select/lib/shared-styles.css.js new file mode 100644 index 0000000..416befe --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/select/lib/shared-styles.css.js
@@ -0,0 +1,9 @@ +/** + * @license + * Copyright 2022 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import { css } from 'lit'; +export const styles = css `:host{color:unset;min-width:210px}.field{cursor:default;outline:none}.select{position:relative}.field,.select{min-width:inherit}:host{display:inline-flex}.label{width:100%}:host([disabled]){pointer-events:none}/*# sourceMappingURL=shared-styles.css.map */ +`; +//# sourceMappingURL=shared-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/select/lib/shared.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/select/lib/shared.d.ts new file mode 100644 index 0000000..53bb949 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/select/lib/shared.d.ts
@@ -0,0 +1,52 @@ +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import { MenuItem } from '../../menu/lib/shared.js'; +/** + * The interface specific to a Select Option + */ +interface SelectOptionSelf { + /** + * The form value associated with the Select Option. (Note: the visual portion + * of the SelectOption is the headline defined in ListItem) + */ + value: string; + /** + * Whether or not the SelectOption is selected. + */ + selected: boolean; +} +/** + * The interface to implement for a select option. Additionally, the element + * must have `md-list-item` and `md-menu-item` attributes on the host. + */ +export type SelectOption = SelectOptionSelf & MenuItem; +/** + * A type that describes a SelectOption and its index. + */ +export type SelectOptionRecord = [SelectOption, number]; +/** + * Given a list of select options, this function will return an array of + * SelectOptionRecords that are selected. + * + * @return An array of SelectOptionRecords describing the options that are + * selected. + */ +export declare function getSelectedItems(items: SelectOption[]): SelectOptionRecord[]; +/** + * An event fired by a SelectOption to request selection from md-select. + * Typically fired after `selected` changes from `false` to `true`. + */ +export declare class RequestSelectionEvent extends Event { + constructor(); +} +/** + * An event fired by a SelectOption to request deselection from md-select. + * Typically fired after `selected` changes from `true` to `false`. + */ +export declare class RequestDeselectionEvent extends Event { + constructor(); +} +export {};
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/select/lib/shared.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/select/lib/shared.js new file mode 100644 index 0000000..d6e635f3 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/select/lib/shared.js
@@ -0,0 +1,41 @@ +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +/** + * Given a list of select options, this function will return an array of + * SelectOptionRecords that are selected. + * + * @return An array of SelectOptionRecords describing the options that are + * selected. + */ +export function getSelectedItems(items) { + const selectedItemRecords = []; + for (let i = 0; i < items.length; i++) { + const item = items[i]; + if (item.selected) { + selectedItemRecords.push([item, i]); + } + } + return selectedItemRecords; +} +/** + * An event fired by a SelectOption to request selection from md-select. + * Typically fired after `selected` changes from `false` to `true`. + */ +export class RequestSelectionEvent extends Event { + constructor() { + super('request-selection', { bubbles: true, composed: true }); + } +} +/** + * An event fired by a SelectOption to request deselection from md-select. + * Typically fired after `selected` changes from `true` to `false`. + */ +export class RequestDeselectionEvent extends Event { + constructor() { + super('request-deselection', { bubbles: true, composed: true }); + } +} +//# sourceMappingURL=shared.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/select/outlined-select.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/select/outlined-select.d.ts new file mode 100644 index 0000000..213c3ed --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/select/outlined-select.d.ts
@@ -0,0 +1,41 @@ +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import { OutlinedSelect } from './lib/outlined-select.js'; +declare global { + interface HTMLElementTagNameMap { + 'md-outlined-select': MdOutlinedSelect; + } +} +/** + * @summary + * Select menus display a list of choices on temporary surfaces and display the + * currently selected menu item above the menu. + * + * @description + * The select component allows users to choose a value from a fixed list of + * available options. Composed of an interactive anchor button and a menu, it is + * analogous to the native HTML `<select>` element. This is the "outlined" + * variant. + * + * @example + * ```html + * <md-outlined-select label="fruits"> + * <!-- An empty selected option will give select an "un-filled" state --> + * <md-select-option selected></md-select-option> + * <md-select-option value="apple" headline="Apple"></md-select-option> + * <md-select-option value="banana" headline="Banana"></md-select-option> + * <md-select-option value="kiwi" headline="Kiwi"></md-select-option> + * <md-select-option value="orange" headline="Orange"></md-select-option> + * <md-select-option value="tomato" headline="Tomato"></md-select-option> + * </md-outlined-select> + * ``` + * + * @final + * @suppress {visibility} + */ +export declare class MdOutlinedSelect extends OutlinedSelect { + static styles: import("lit").CSSResult[]; +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/select/outlined-select.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/select/outlined-select.js new file mode 100644 index 0000000..d30854b --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/select/outlined-select.js
@@ -0,0 +1,46 @@ +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import { __decorate } from "tslib"; +import { customElement } from 'lit/decorators.js'; +import { styles as outlinedForcedColorsStyles } from './lib/outlined-forced-colors-styles.css.js'; +import { OutlinedSelect } from './lib/outlined-select.js'; +import { styles } from './lib/outlined-select-styles.css.js'; +import { styles as sharedStyles } from './lib/shared-styles.css.js'; +/** + * @summary + * Select menus display a list of choices on temporary surfaces and display the + * currently selected menu item above the menu. + * + * @description + * The select component allows users to choose a value from a fixed list of + * available options. Composed of an interactive anchor button and a menu, it is + * analogous to the native HTML `<select>` element. This is the "outlined" + * variant. + * + * @example + * ```html + * <md-outlined-select label="fruits"> + * <!-- An empty selected option will give select an "un-filled" state --> + * <md-select-option selected></md-select-option> + * <md-select-option value="apple" headline="Apple"></md-select-option> + * <md-select-option value="banana" headline="Banana"></md-select-option> + * <md-select-option value="kiwi" headline="Kiwi"></md-select-option> + * <md-select-option value="orange" headline="Orange"></md-select-option> + * <md-select-option value="tomato" headline="Tomato"></md-select-option> + * </md-outlined-select> + * ``` + * + * @final + * @suppress {visibility} + */ +let MdOutlinedSelect = class MdOutlinedSelect extends OutlinedSelect { +}; +MdOutlinedSelect.styles = [sharedStyles, styles, outlinedForcedColorsStyles]; +MdOutlinedSelect = __decorate([ + customElement('md-outlined-select') +], MdOutlinedSelect); +export { MdOutlinedSelect }; +//# sourceMappingURL=outlined-select.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/select/select-option.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/select/select-option.d.ts new file mode 100644 index 0000000..6c90050 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/select/select-option.d.ts
@@ -0,0 +1,44 @@ +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import { SelectOptionEl } from './lib/selectoption/select-option.js'; +declare global { + interface HTMLElementTagNameMap { + 'md-select-option': MdSelectOption; + } +} +/** + * @summary + * Select menus display a list of choices on temporary surfaces and display the + * currently selected menu item above the menu. + * + * @description + * The select component allows users to choose a value from a fixed list of + * available options. Composed of an interactive anchor button and a menu, it is + * analogous to the native HTML `<select>` element. This is the option that + * can be placed inside of an md-select. + * + * This component is a subclass of `md-menu-item` and can accept the same slots, + * properties, and events as `md-menu-item`. + * + * @example + * ```html + * <md-outlined-select label="fruits"> + * <!-- An empty selected option will give select an "un-filled" state --> + * <md-select-option selected></md-select-option> + * <md-select-option value="apple" headline="Apple"></md-select-option> + * <md-select-option value="banana" headline="Banana"></md-select-option> + * <md-select-option value="kiwi" headline="Kiwi"></md-select-option> + * <md-select-option value="orange" headline="Orange"></md-select-option> + * <md-select-option value="tomato" headline="Tomato"></md-select-option> + * </md-outlined-select> + * ``` + * + * @final + * @suppress {visibility} + */ +export declare class MdSelectOption extends SelectOptionEl { + static styles: import("lit").CSSResult[]; +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/select/select-option.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/select/select-option.js new file mode 100644 index 0000000..3377d215 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/select/select-option.js
@@ -0,0 +1,51 @@ +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import { __decorate } from "tslib"; +import { customElement } from 'lit/decorators.js'; +import { styles as listItemForcedColorsStyles } from '../list/lib/listitem/forced-colors-styles.css.js'; +import { styles as listItemStyles } from '../list/lib/listitem/list-item-styles.css.js'; +import { styles as forcedColorsStyles } from '../menu/lib/menuitem/forced-colors-styles.css.js'; +import { styles } from '../menu/lib/menuitem/menu-item-styles.css.js'; +// TODO(b/236285090): update with HCM best practices +import { SelectOptionEl } from './lib/selectoption/select-option.js'; +/** + * @summary + * Select menus display a list of choices on temporary surfaces and display the + * currently selected menu item above the menu. + * + * @description + * The select component allows users to choose a value from a fixed list of + * available options. Composed of an interactive anchor button and a menu, it is + * analogous to the native HTML `<select>` element. This is the option that + * can be placed inside of an md-select. + * + * This component is a subclass of `md-menu-item` and can accept the same slots, + * properties, and events as `md-menu-item`. + * + * @example + * ```html + * <md-outlined-select label="fruits"> + * <!-- An empty selected option will give select an "un-filled" state --> + * <md-select-option selected></md-select-option> + * <md-select-option value="apple" headline="Apple"></md-select-option> + * <md-select-option value="banana" headline="Banana"></md-select-option> + * <md-select-option value="kiwi" headline="Kiwi"></md-select-option> + * <md-select-option value="orange" headline="Orange"></md-select-option> + * <md-select-option value="tomato" headline="Tomato"></md-select-option> + * </md-outlined-select> + * ``` + * + * @final + * @suppress {visibility} + */ +let MdSelectOption = class MdSelectOption extends SelectOptionEl { +}; +MdSelectOption.styles = [listItemStyles, styles, listItemForcedColorsStyles, forcedColorsStyles]; +MdSelectOption = __decorate([ + customElement('md-select-option') +], MdSelectOption); +export { MdSelectOption }; +//# sourceMappingURL=select-option.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/slider/harness.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/slider/harness.d.ts new file mode 100644 index 0000000..9efe243 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/slider/harness.d.ts
@@ -0,0 +1,21 @@ +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import { Harness } from '../testing/harness.js'; +import { Slider } from './lib/slider.js'; +/** + * Test harness for slider. + */ +export declare class SliderHarness extends Harness<Slider> { + getInteractiveElement(): Promise<HTMLInputElement>; + getInputs(): HTMLInputElement[]; + getHandles(): Element[]; + getLabels(): Element[]; + isLabelShowing(): boolean; + simulateValueInteraction(value: number, el?: HTMLInputElement): Promise<void>; + private positionEventAtHandle; + protected simulateStartHover(element: HTMLElement, init?: PointerEventInit): void; + protected simulateMousePress(element: HTMLElement, init?: PointerEventInit): void; +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/fab-extended-styles.css.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/slider/lib/forced-colors-styles.css.d.ts similarity index 100% copy from third_party/material_web_components/components-chromium/node_modules/@material/web/fab/lib/fab-extended-styles.css.d.ts copy to third_party/material_web_components/components-chromium/node_modules/@material/web/slider/lib/forced-colors-styles.css.d.ts
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/slider/lib/forced-colors-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/slider/lib/forced-colors-styles.css.js new file mode 100644 index 0000000..842ad41 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/slider/lib/forced-colors-styles.css.js
@@ -0,0 +1,9 @@ +/** + * @license + * Copyright 2022 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import { css } from 'lit'; +export const styles = css `@media(forced-colors: active){:host{--md-slider-active-track-color:CanvasText;--md-slider-disabled-active-track-color:GrayText;--md-slider-disabled-active-track-opacity:1;--md-slider-disabled-handle-color:GrayText;--md-slider-disabled-inactive-track-color:GrayText;--md-slider-disabled-inactive-track-opacity:1;--md-slider-focus-handle-color:CanvasText;--md-slider-handle-color:CanvasText;--md-slider-handle-shadow-color:Canvas;--md-slider-hover-handle-color:CanvasText;--md-slider-hover-state-layer-color:Canvas;--md-slider-hover-state-layer-opacity:1;--md-slider-inactive-track-color:Canvas;--md-slider-label-container-color:Canvas;--md-slider-label-label-text-color:CanvasText;--md-slider-pressed-handle-color:CanvasText;--md-slider-pressed-state-layer-color:Canvas;--md-slider-pressed-state-layer-opacity:1;--md-slider-with-overlap-handle-outline-color:CanvasText;--md-slider-with-tick-marks-active-container-color:Canvas;--md-slider-with-tick-marks-disabled-container-color:GrayText;--md-slider-with-tick-marks-inactive-container-color:CanvasText}.label,.label::before{border:var(--_with-overlap-handle-outline-color) solid var(--_with-overlap-handle-outline-width)}:host(:not([disabled])) .track::before{border:1px solid var(--_active-track-color)}}/*# sourceMappingURL=forced-colors-styles.css.map */ +`; +//# sourceMappingURL=forced-colors-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/filled-styles.css.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/slider/lib/slider-styles.css.d.ts similarity index 100% copy from third_party/material_web_components/components-chromium/node_modules/@material/web/autocomplete/lib/filled-styles.css.d.ts copy to third_party/material_web_components/components-chromium/node_modules/@material/web/slider/lib/slider-styles.css.d.ts
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/slider/lib/slider-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/slider/lib/slider-styles.css.js new file mode 100644 index 0000000..16400f3 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/slider/lib/slider-styles.css.js
@@ -0,0 +1,9 @@ +/** + * @license + * Copyright 2022 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import { css } from 'lit'; +export const styles = css `:host{display:inline-flex;vertical-align:middle;--_active-track-color: var(--md-slider-active-track-color, var(--md-sys-color-primary, #6750a4));--_active-track-height: var(--md-slider-active-track-height, 4px);--_active-track-shape: var(--md-slider-active-track-shape, 9999px);--_disabled-active-track-color: var(--md-slider-disabled-active-track-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-active-track-opacity: var(--md-slider-disabled-active-track-opacity, 0.38);--_disabled-handle-color: var(--md-slider-disabled-handle-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-handle-elevation: var(--md-slider-disabled-handle-elevation, 0);--_disabled-inactive-track-color: var(--md-slider-disabled-inactive-track-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-inactive-track-opacity: var(--md-slider-disabled-inactive-track-opacity, 0.12);--_focus-handle-color: var(--md-slider-focus-handle-color, var(--md-sys-color-primary, #6750a4));--_handle-color: var(--md-slider-handle-color, var(--md-sys-color-primary, #6750a4));--_handle-elevation: var(--md-slider-handle-elevation, 1);--_handle-height: var(--md-slider-handle-height, 20px);--_handle-shadow-color: var(--md-slider-handle-shadow-color, var(--md-sys-color-shadow, #000));--_handle-shape: var(--md-slider-handle-shape, 9999px);--_handle-width: var(--md-slider-handle-width, 20px);--_hover-handle-color: var(--md-slider-hover-handle-color, var(--md-sys-color-primary, #6750a4));--_hover-state-layer-color: var(--md-slider-hover-state-layer-color, var(--md-sys-color-primary, #6750a4));--_hover-state-layer-opacity: var(--md-slider-hover-state-layer-opacity, 0.08);--_inactive-track-color: var(--md-slider-inactive-track-color, var(--md-sys-color-surface-container-highest, #e6e0e9));--_inactive-track-height: var(--md-slider-inactive-track-height, 4px);--_inactive-track-shape: var(--md-slider-inactive-track-shape, 9999px);--_label-container-color: var(--md-slider-label-container-color, var(--md-sys-color-primary, #6750a4));--_label-container-height: var(--md-slider-label-container-height, 28px);--_label-label-text-color: var(--md-slider-label-label-text-color, var(--md-sys-color-on-primary, #fff));--_label-label-text-type: var(--md-slider-label-label-text-type, var(--md-sys-typescale-label-medium, 500 0.75rem / 1rem var(--md-ref-typeface-plain, Roboto)));--_pressed-handle-color: var(--md-slider-pressed-handle-color, var(--md-sys-color-primary, #6750a4));--_pressed-state-layer-color: var(--md-slider-pressed-state-layer-color, var(--md-sys-color-primary, #6750a4));--_pressed-state-layer-opacity: var(--md-slider-pressed-state-layer-opacity, 0.12);--_state-layer-size: var(--md-slider-state-layer-size, 40px);--_with-overlap-handle-outline-color: var(--md-slider-with-overlap-handle-outline-color, var(--md-sys-color-on-primary, #fff));--_with-overlap-handle-outline-width: var(--md-slider-with-overlap-handle-outline-width, 1px);--_with-tick-marks-active-container-color: var(--md-slider-with-tick-marks-active-container-color, var(--md-sys-color-on-primary, #fff));--_with-tick-marks-container-size: var(--md-slider-with-tick-marks-container-size, 2px);--_with-tick-marks-disabled-container-color: var(--md-slider-with-tick-marks-disabled-container-color, var(--md-sys-color-on-surface, #1d1b20));--_with-tick-marks-inactive-container-color: var(--md-slider-with-tick-marks-inactive-container-color, var(--md-sys-color-on-surface-variant, #49454f));min-inline-size:200px;--md-elevation-level:var(--_handle-elevation);--md-elevation-shadow-color:var(--_handle-shadow-color)}md-elevation{transition-duration:250ms}@media(prefers-reduced-motion){.label{transition-duration:0}}:host([disabled]){opacity:var(--_disabled-active-track-opacity);--md-elevation-level:var(--_disabled-handle-elevation)}.container{flex:1;display:flex;align-items:center;position:relative;block-size:var(--_state-layer-size);pointer-events:none;touch-action:none}.track{position:absolute;inset:0;display:flex;align-items:center}.track::before,.track::after{position:absolute;content:"";inset-inline-start:calc(var(--_state-layer-size)/2 - var(--_with-tick-marks-container-size));inset-inline-end:calc(var(--_state-layer-size)/2 - var(--_with-tick-marks-container-size));background-size:calc((100% - var(--_with-tick-marks-container-size)*2)/var(--slider-tick-count)) 100%}.track::before{block-size:var(--_inactive-track-height);border-radius:var(--_inactive-track-shape);background-color:var(--_inactive-track-color)}.track.tickMarks::before{background-image:radial-gradient(circle at var(--_with-tick-marks-container-size) center, var(--_with-tick-marks-inactive-container-color) 0, var(--_with-tick-marks-inactive-container-color) calc(var(--_with-tick-marks-container-size) / 2), transparent calc(var(--_with-tick-marks-container-size) / 2))}:host([disabled]) .track::before{opacity:calc(1/var(--_disabled-active-track-opacity)*var(--_disabled-inactive-track-opacity));background-color:var(--_disabled-inactive-track-color)}.track::after{block-size:var(--_active-track-height);border-radius:var(--_active-track-shape);clip-path:inset(0 calc(var(--_with-tick-marks-container-size) * min((1 - var(--slider-upper-fraction)) * 1000000000, 1) + (100% - var(--_with-tick-marks-container-size) * 2) * (1 - var(--slider-upper-fraction))) 0 calc(var(--_with-tick-marks-container-size) * min(var(--slider-lower-fraction) * 1000000000, 1) + (100% - var(--_with-tick-marks-container-size) * 2) * var(--slider-lower-fraction)));background-color:var(--_active-track-color)}:host-context([dir=rtl]) .track::after{clip-path:inset(0 calc(var(--_with-tick-marks-container-size) * min(var(--slider-lower-fraction) * 1000000000, 1) + (100% - var(--_with-tick-marks-container-size) * 2) * var(--slider-lower-fraction)) 0 calc(var(--_with-tick-marks-container-size) * min((1 - var(--slider-upper-fraction)) * 1000000000, 1) + (100% - var(--_with-tick-marks-container-size) * 2) * (1 - var(--slider-upper-fraction))))}:host([dir=rtl]) .track::after{clip-path:inset(0 calc(var(--_with-tick-marks-container-size) * min(var(--slider-lower-fraction) * 1000000000, 1) + (100% - var(--_with-tick-marks-container-size) * 2) * var(--slider-lower-fraction)) 0 calc(var(--_with-tick-marks-container-size) * min((1 - var(--slider-upper-fraction)) * 1000000000, 1) + (100% - var(--_with-tick-marks-container-size) * 2) * (1 - var(--slider-upper-fraction))))}.track:dir(rtl)::after{clip-path:inset(0 calc(var(--_with-tick-marks-container-size) * min(var(--slider-lower-fraction) * 1000000000, 1) + (100% - var(--_with-tick-marks-container-size) * 2) * var(--slider-lower-fraction)) 0 calc(var(--_with-tick-marks-container-size) * min((1 - var(--slider-upper-fraction)) * 1000000000, 1) + (100% - var(--_with-tick-marks-container-size) * 2) * (1 - var(--slider-upper-fraction))))}.track.tickMarks::after{background-image:radial-gradient(circle at var(--_with-tick-marks-container-size) center, var(--_with-tick-marks-active-container-color) 0, var(--_with-tick-marks-active-container-color) calc(var(--_with-tick-marks-container-size) / 2), transparent calc(var(--_with-tick-marks-container-size) / 2))}:host([disabled]) .track::after{background-color:var(--_disabled-active-track-color)}:host([disabled]) .track.tickMarks::before,:host([disabled]) .track.tickMarks::after{background-image:radial-gradient(circle at var(--_with-tick-marks-container-size) center, var(--_with-tick-marks-disabled-container-color) 0, var(--_with-tick-marks-disabled-container-color) calc(var(--_with-tick-marks-container-size) / 2), transparent calc(var(--_with-tick-marks-container-size) / 2))}.handleContainerPadded{position:relative;block-size:100%;inline-size:100%;padding-inline:calc(var(--_state-layer-size)/2)}.handleContainerBlock{position:relative;block-size:100%;inline-size:100%}.handleContainer{position:absolute;inset-block-start:0;inset-block-end:0;inset-inline-start:calc(100%*var(--slider-lower-fraction));inline-size:calc(100%*(var(--slider-upper-fraction) - var(--slider-lower-fraction)))}.handle{position:absolute;block-size:var(--_state-layer-size);inline-size:var(--_state-layer-size);border-radius:var(--_handle-shape);display:grid;place-items:center}.handleNub{position:absolute;height:var(--_handle-height);width:var(--_handle-width);border-radius:var(--_handle-shape);background:var(--_handle-color)}:host([disabled]) .handleNub{background:var(--_disabled-handle-color)}input.b:focus~.handleContainerPadded .handle.b>.handleNub,input.a:focus~.handleContainerPadded .handle.a>.handleNub{background:var(--_focus-handle-color)}.container>.handleContainerPadded .handle.hover>.handleNub{background:var(--_hover-handle-color)}:host(:not([disabled])) input.b:active~.handleContainerPadded .handle.b>.handleNub,:host(:not([disabled])) input.a:active~.handleContainerPadded .handle.a>.handleNub{background:var(--_pressed-handle-color)}.onTop.isOverlapping .handleNub,.onTop.isOverlapping .label,.onTop.isOverlapping .label::before{border:var(--_with-overlap-handle-outline-color) solid var(--_with-overlap-handle-outline-width)}.handle.lesser{inset-inline-start:calc(0px - var(--_state-layer-size)/2)}.handle:not(.lesser){inset-inline-end:calc(0px - var(--_state-layer-size)/2)}.label{position:absolute;box-sizing:border-box;display:grid;padding:4px;place-items:center;border-radius:9999px;color:var(--_label-label-text-color);font:var(--_label-label-text-type);inset-block-end:100%;min-inline-size:var(--_label-container-height);min-block-size:var(--_label-container-height);background:var(--_label-container-color);transition:transform 100ms cubic-bezier(0.2, 0, 0, 1);transform-origin:center bottom;transform:scale(0)}:host(:focus-within) .label,.handleContainer.hover .label{transform:scale(1)}.label::before,.label::after{position:absolute;display:block;content:"";background:inherit}.label::before{inline-size:calc(var(--_label-container-height)/2);block-size:calc(var(--_label-container-height)/2);bottom:calc(var(--_label-container-height)/-10);transform:rotate(45deg)}.label::after{inset:0px;border-radius:inherit}.labelContent{z-index:1}input[type=range]{opacity:0;-webkit-tap-highlight-color:rgba(0,0,0,0);position:absolute;box-sizing:border-box;height:100%;width:100%;margin:0;background:rgba(0,0,0,0);cursor:pointer;pointer-events:auto;appearance:none}input[type=range]:focus{outline:none}::-webkit-slider-runnable-track{-webkit-appearance:none}::-moz-range-track{appearance:none}::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;block-size:var(--_state-layer-size);inline-size:var(--_state-layer-size);transform:scaleX(0);opacity:0;z-index:2}::-moz-range-thumb{appearance:none;block-size:var(--_state-layer-size);inline-size:var(--_state-layer-size);transform:scaleX(0);opacity:0;z-index:2}.ranged input.lesser{clip-path:inset(0 calc(100% - (var(--_state-layer-size) / 2 + (100% - var(--_state-layer-size)) * (var(--slider-lower-fraction) + (var(--slider-upper-fraction) - var(--slider-lower-fraction)) / 2))) 0 0)}:host-context([dir=rtl]) .ranged input.lesser{clip-path:inset(0 0 0 calc(100% - (var(--_state-layer-size) / 2 + (100% - var(--_state-layer-size)) * (var(--slider-lower-fraction) + (var(--slider-upper-fraction) - var(--slider-lower-fraction)) / 2))))}:host([dir=rtl]) .ranged input.lesser{clip-path:inset(0 0 0 calc(100% - (var(--_state-layer-size) / 2 + (100% - var(--_state-layer-size)) * (var(--slider-lower-fraction) + (var(--slider-upper-fraction) - var(--slider-lower-fraction)) / 2))))}.ranged input.lesser:dir(rtl){clip-path:inset(0 0 0 calc(100% - (var(--_state-layer-size) / 2 + (100% - var(--_state-layer-size)) * (var(--slider-lower-fraction) + (var(--slider-upper-fraction) - var(--slider-lower-fraction)) / 2))))}.ranged input:not(.lesser){clip-path:inset(0 0 0 calc(var(--_state-layer-size) / 2 + (100% - var(--_state-layer-size)) * (var(--slider-lower-fraction) + (var(--slider-upper-fraction) - var(--slider-lower-fraction)) / 2)))}:host-context([dir=rtl]) .ranged input:not(.lesser){clip-path:inset(0 calc(var(--_state-layer-size) / 2 + (100% - var(--_state-layer-size)) * (var(--slider-lower-fraction) + (var(--slider-upper-fraction) - var(--slider-lower-fraction)) / 2)) 0 0)}:host([dir=rtl]) .ranged input:not(.lesser){clip-path:inset(0 calc(var(--_state-layer-size) / 2 + (100% - var(--_state-layer-size)) * (var(--slider-lower-fraction) + (var(--slider-upper-fraction) - var(--slider-lower-fraction)) / 2)) 0 0)}.ranged input:dir(rtl):not(.lesser){clip-path:inset(0 calc(var(--_state-layer-size) / 2 + (100% - var(--_state-layer-size)) * (var(--slider-lower-fraction) + (var(--slider-upper-fraction) - var(--slider-lower-fraction)) / 2)) 0 0)}.onTop{z-index:1}md-focus-ring{--md-focus-ring-offset: -2px}.handle{--md-ripple-hover-color:var(--_hover-state-layer-color);--md-ripple-hover-opacity:var(--_hover-state-layer-opacity);--md-ripple-pressed-color:var(--_pressed-state-layer-color);--md-ripple-pressed-opacity:var(--_pressed-state-layer-opacity)}md-ripple{height:var(--_state-layer-size);width:var(--_state-layer-size)}/*# sourceMappingURL=slider-styles.css.map */ +`; +//# sourceMappingURL=slider-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/slider/lib/slider.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/slider/lib/slider.d.ts new file mode 100644 index 0000000..bc3d78a2 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/slider/lib/slider.d.ts
@@ -0,0 +1,124 @@ +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import '../../elevation/elevation.js'; +import '../../focus/focus-ring.js'; +import '../../ripple/ripple.js'; +import { LitElement, PropertyValues } from 'lit'; +import { getFormValue } from '../../controller/form-controller.js'; +/** + * Slider component. + */ +export declare class Slider extends LitElement { + static shadowRootOptions: ShadowRootInit; + /** + * @nocollapse + */ + static formAssociated: boolean; + /** + * Whether or not the slider is disabled. + */ + disabled: boolean; + /** + * The slider minimum value + */ + min: number; + /** + * The slider maximum value + */ + max: number; + /** + * The slider value, can be a single number, or an array tuple indicating + * a start and end value. + */ + value: number | [number, number]; + /** + * An optinoal label for the slider's value; if not set, the label is the + * value itself. This can be a string or string tuple when start and end + * values are used. + */ + valueLabel?: string | [string, string] | undefined; + /** + * The step between values. + */ + step: number; + /** + * Whether or not to show tick marks. + */ + withTickMarks: boolean; + /** + * Whether or not to show a value label when activated. + */ + withLabel: boolean; + /** + * The HTML name to use in form submission. + */ + name: string; + /** + * The associated form element with which this element's value will submit. + */ + get form(): HTMLFormElement; + /** + * Read only computed value representing the fraction between 0 and 1 + * respresenting the value's position between min and max. This is a + * single fraction or a tuple if the value specifies start and end values. + */ + get valueAsFraction(): number | number[]; + private getMetrics; + private readonly inputA; + private readonly handleA; + private readonly rippleA; + private readonly inputB; + private readonly handleB; + private readonly rippleB; + private valueA; + private valueB; + private rippleAShowing; + private rippleBShowing; + private handleAHover; + private handleBHover; + private onTopId; + private handlesOverlapping; + constructor(); + focus(): void; + get valueAsString(): string; + [getFormValue](): string; + private allowRange; + private isFlipped; + protected willUpdate(changed: PropertyValues): void; + protected updated(changed: PropertyValues): Promise<void>; + protected render(): import("lit-html").TemplateResult<1>; + private renderTrack; + private renderLabel; + private renderHandle; + private renderInput; + private readonly renderRipple; + private readonly getRippleA; + private readonly getRippleB; + private toggleRippleHover; + private isEventOnA; + private handleFocus; + private ripplePointerId; + private handleDown; + /** + * The move handler tracks handle hovering to facilitate proper ripple + * behavior on the slider handle. This is needed because user interaction with + * the native input is leveraged to position the handle. Because the separate + * displayed handle element has pointer events disabled (to allow interaction + * with the input) and the input's handle is a pseudo-element, neither can be + * the ripple's interactive element. Therefore the input is the ripple's + * interactive element and has a `ripple` directive; however the ripple + * is gated on the handle being hovered. In addition, because the ripple + * hover state is being specially handled, it must be triggered independent + * of the directive. This is done based on the hover state when the + * slider is updated. + */ + private handleMove; + private handleEnter; + private handleLeave; + private updateOnTop; + private handleInput; + private handleChange; +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/slider/lib/slider.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/slider/lib/slider.js new file mode 100644 index 0000000..5393425 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/slider/lib/slider.js
@@ -0,0 +1,485 @@ +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +var _a; +import { __decorate } from "tslib"; +import '../../elevation/elevation.js'; +import '../../focus/focus-ring.js'; +import '../../ripple/ripple.js'; +import { html, isServer, LitElement, nothing } from 'lit'; +import { property, query, queryAsync, state } from 'lit/decorators.js'; +import { classMap } from 'lit/directives/class-map.js'; +import { styleMap } from 'lit/directives/style-map.js'; +import { when } from 'lit/directives/when.js'; +import { requestUpdateOnAriaChange } from '../../aria/delegate.js'; +import { dispatchActivationClick, isActivationClick, redispatchEvent } from '../../controller/events.js'; +import { FormController, getFormValue } from '../../controller/form-controller.js'; +import { stringConverter } from '../../controller/string-converter.js'; +import { ripple } from '../../ripple/directive.js'; +// Disable warning for classMap with destructuring +// tslint:disable:quoted-properties-on-dictionary +function inBounds({ x, y }, element) { + if (!element) { + return false; + } + const { top, left, bottom, right } = element.getBoundingClientRect(); + return x >= left && x <= right && y >= top && y <= bottom; +} +// parse values like: foo or foo,bar +function tupleConverter(attr) { + const [, v, e] = attr?.match(/\s*\[?\s*([^,]+)(?:(?:\s*$)|(?:\s*,\s*(.*)\s*))/) ?? []; + return e !== undefined ? [v, e] : v; +} +function toNumber(value) { + return Number(value) || 0; +} +function tupleAsString(value) { + return Array.isArray(value) ? value.join() : String(value ?? ''); +} +function valueConverter(attr) { + const value = tupleConverter(attr); + return Array.isArray(value) ? value.map(i => toNumber(i)) : toNumber(value); +} +function clamp(value, min, max) { + return Math.max(min, Math.min(max, value)); +} +function isOverlapping(elA, elB) { + if (!(elA && elB)) { + return false; + } + const a = elA.getBoundingClientRect(); + const b = elB.getBoundingClientRect(); + return !(a.top > b.bottom || a.right < b.left || a.bottom < b.top || + a.left > b.right); +} +/** + * Slider component. + */ +export class Slider extends LitElement { + /** + * The associated form element with which this element's value will submit. + */ + get form() { + return this.closest('form'); + } + /** + * Read only computed value representing the fraction between 0 and 1 + * respresenting the value's position between min and max. This is a + * single fraction or a tuple if the value specifies start and end values. + */ + get valueAsFraction() { + const { lowerFraction, upperFraction } = this.getMetrics(); + return this.allowRange ? [lowerFraction, upperFraction] : upperFraction; + } + getMetrics() { + const step = Math.max(this.step, 1); + const range = Math.max(this.max - this.min, step); + const lower = Math.min(this.valueA, this.valueB); + const upper = Math.max(this.valueA, this.valueB); + const lowerFraction = (lower - this.min) / range; + const upperFraction = (upper - this.min) / range; + return { + step, + range, + lower, + upper, + lowerFraction, + upperFraction, + }; + } + constructor() { + super(); + /** + * Whether or not the slider is disabled. + */ + this.disabled = false; + /** + * The slider minimum value + */ + this.min = 0; + /** + * The slider maximum value + */ + this.max = 10; + /** + * The slider value, can be a single number, or an array tuple indicating + * a start and end value. + */ + this.value = 0; + /** + * The step between values. + */ + this.step = 1; + /** + * Whether or not to show tick marks. + */ + this.withTickMarks = false; + /** + * Whether or not to show a value label when activated. + */ + this.withLabel = false; + /** + * The HTML name to use in form submission. + */ + this.name = ''; + this.valueA = 0; + this.valueB = 0; + this.rippleAShowing = false; + this.rippleBShowing = false; + // handle hover/pressed states are set manually since the handle + // does not receive pointer events so that the native inputs are + // interaction targets. + this.handleAHover = false; + this.handleBHover = false; + this.onTopId = 'b'; + this.handlesOverlapping = false; + // If range should be allowed (detected via value format). + this.allowRange = false; + this.renderRipple = (id) => html `<md-ripple class=${id} ?disabled=${this.disabled} unbounded></md-ripple>`; + this.getRippleA = () => { + if (!this.handleAHover) { + return null; + } + this.rippleAShowing = true; + return this.rippleA; + }; + this.getRippleB = () => { + if (!this.handleBHover) { + return null; + } + this.rippleBShowing = true; + return this.rippleB; + }; + // used in synthetic events generated to control ripple hover state. + this.ripplePointerId = 1; + this.addController(new FormController(this)); + if (!isServer) { + this.addEventListener('click', (event) => { + if (!isActivationClick(event) || !this.inputB) { + return; + } + this.focus(); + dispatchActivationClick(this.inputB); + }); + } + } + focus() { + this.inputB?.focus(); + } + get valueAsString() { + return tupleAsString(this.value); + } + // value coerced to a string + [getFormValue]() { + return this.valueAsString; + } + // indicates input values are crossed over each other from initial rendering. + isFlipped() { + return this.valueA > this.valueB; + } + willUpdate(changed) { + if (changed.has('value') || changed.has('min') || changed.has('max') || + changed.has('step')) { + this.allowRange = Array.isArray(this.value); + const step = Math.max(this.step, 1); + let lower = this.allowRange ? this.value[0] : this.min; + lower = clamp(lower - (lower % step), this.min, this.max); + let upper = this.allowRange ? this.value[1] : + this.value; + upper = clamp(upper - (upper % step), this.min, this.max); + const isFlipped = this.isFlipped() && this.allowRange; + this.valueA = isFlipped ? upper : lower; + this.valueB = isFlipped ? lower : upper; + } + // manually handle ripple hover state since the handle is pointer events + // none. + if (changed.get('handleAHover') !== undefined) { + this.rippleAShowing = true; + this.toggleRippleHover(this.rippleA, this.handleAHover); + } + else if (changed.get('handleBHover') !== undefined) { + this.rippleBShowing = true; + this.toggleRippleHover(this.rippleB, this.handleBHover); + } + } + async updated(changed) { + if (changed.has('value') || changed.has('valueA') || + changed.has('valueB')) { + await this.updateComplete; + this.handlesOverlapping = isOverlapping(this.handleA, this.handleB); + } + } + render() { + const { step, range, lowerFraction, upperFraction } = this.getMetrics(); + const isFlipped = this.isFlipped(); + const containerStyles = { + // for clipping inputs and active track. + '--slider-lower-fraction': String(lowerFraction), + '--slider-upper-fraction': String(upperFraction), + // for generating tick marks + '--slider-tick-count': String(range / step), + }; + const containerClasses = { ranged: this.allowRange }; + // optional label values to show in place of the value. + const labelA = String(this.valueLabel?.[isFlipped ? 1 : 0] ?? this.valueA); + const labelB = String((this.allowRange ? this.valueLabel?.[isFlipped ? 0 : 1] : + this.valueLabel) ?? + this.valueB); + const inputAProps = { + id: 'a', + lesser: !isFlipped, + value: this.valueA, + label: labelA, + getRipple: this.getRippleA + }; + const inputBProps = { + id: 'b', + lesser: isFlipped, + value: this.valueB, + label: labelB, + getRipple: this.getRippleB + }; + const handleAProps = { + id: 'a', + lesser: !isFlipped, + showRipple: this.rippleAShowing, + hover: this.handleAHover, + label: labelA + }; + const handleBProps = { + id: 'b', + lesser: isFlipped, + showRipple: this.rippleBShowing, + hover: this.handleBHover, + label: labelB + }; + const handleContainerClasses = { + hover: this.handleAHover || this.handleBHover + }; + return html ` + <div + class="container ${classMap(containerClasses)}" + style=${styleMap(containerStyles)} + > + ${when(this.allowRange, () => this.renderInput(inputAProps))} + ${this.renderInput(inputBProps)} + ${this.renderTrack()} + <div class="handleContainerPadded"> + <div class="handleContainerBlock"> + <div class="handleContainer ${classMap(handleContainerClasses)}"> + ${when(this.allowRange, () => this.renderHandle(handleAProps))} + ${this.renderHandle(handleBProps)} + </div> + </div> + </div> + </div>`; + } + renderTrack() { + const trackClasses = { 'tickMarks': this.withTickMarks }; + return html `<div class="track ${classMap(trackClasses)}"></div>`; + } + renderLabel(value) { + return html `<div class="label"> + <span class="labelContent" part="label">${value}</span> + </div>`; + } + renderHandle({ id, lesser, showRipple, hover, label }) { + const onTop = !this.disabled && id === this.onTopId; + const isOverlapping = !this.disabled && this.handlesOverlapping; + return html `<div class="handle ${classMap({ + [id]: true, + lesser, + hover, + onTop, + isOverlapping + })}"> + <div class="handleNub"><md-elevation></md-elevation></div> + ${when(this.withLabel, () => this.renderLabel(label))} + ${when(showRipple, () => this.renderRipple(id))} + <md-focus-ring for=${id}></md-focus-ring> + </div>`; + } + renderInput({ id, lesser, value, label, getRipple }) { + // when ranged, ensure announcement includes value info. + const ariaLabelDescriptor = this.allowRange ? ` - ${lesser ? `start` : `end`} handle` : ''; + // Needed for closure conformance + const { ariaLabel } = this; + return html `<input type="range" + class="${classMap({ + lesser, + [id]: true + })}" + @focus=${this.handleFocus} + @pointerdown=${this.handleDown} + @pointerenter=${this.handleEnter} + @pointermove=${this.handleMove} + @pointerleave=${this.handleLeave} + @input=${this.handleInput} + @change=${this.handleChange} + id=${id} + .disabled=${this.disabled} + .min=${String(this.min)} + .max=${String(this.max)} + .step=${String(this.step)} + .value=${String(value)} + .tabIndex=${lesser ? 1 : 0} + aria-label=${`${ariaLabel}${ariaLabelDescriptor}` || nothing} + aria-valuetext=${label} + ${ripple(getRipple)}>`; + } + async toggleRippleHover(ripple, hovering) { + const rippleEl = await ripple; + if (!rippleEl) { + return; + } + // TODO(b/269799771): improve slider ripple connection + if (hovering) { + rippleEl.handlePointerenter(new PointerEvent('pointerenter', { isPrimary: true, pointerId: this.ripplePointerId })); + } + else { + rippleEl.handlePointerleave(new PointerEvent('pointerleave', { isPrimary: true, pointerId: this.ripplePointerId })); + } + } + isEventOnA({ target }) { + return target === this.inputA; + } + handleFocus(e) { + this.updateOnTop(e); + } + handleDown(e) { + this.ripplePointerId = e.pointerId; + const isA = this.isEventOnA(e); + // Since handle moves to pointer on down and there may not be a move, + // it needs to be considered hovered.. + this.handleAHover = !this.disabled && isA && Boolean(this.handleA); + this.handleBHover = !this.disabled && !isA && Boolean(this.handleB); + // Force Safari to focus input so the label stays displayed; note, + // Macs don't normally focus non-text type inputs. + const target = e.target; + requestAnimationFrame(() => { + target.focus(); + }); + } + /** + * The move handler tracks handle hovering to facilitate proper ripple + * behavior on the slider handle. This is needed because user interaction with + * the native input is leveraged to position the handle. Because the separate + * displayed handle element has pointer events disabled (to allow interaction + * with the input) and the input's handle is a pseudo-element, neither can be + * the ripple's interactive element. Therefore the input is the ripple's + * interactive element and has a `ripple` directive; however the ripple + * is gated on the handle being hovered. In addition, because the ripple + * hover state is being specially handled, it must be triggered independent + * of the directive. This is done based on the hover state when the + * slider is updated. + */ + handleMove(e) { + this.handleAHover = !this.disabled && inBounds(e, this.handleA); + this.handleBHover = !this.disabled && inBounds(e, this.handleB); + } + handleEnter(e) { + this.handleMove(e); + } + handleLeave() { + this.handleAHover = false; + this.handleBHover = false; + } + updateOnTop(e) { + this.onTopId = e.target.classList.contains('a') ? 'a' : 'b'; + } + handleInput(e) { + if (this.inputA) { + this.valueA = this.inputA.valueAsNumber ?? 0; + } + this.valueB = this.inputB.valueAsNumber; + this.updateOnTop(e); + // update value only on interaction + const lower = Math.min(this.valueA, this.valueB); + const upper = Math.max(this.valueA, this.valueB); + this.value = this.allowRange ? [lower, upper] : this.valueB; + } + handleChange(event) { + redispatchEvent(this, event); + } +} +_a = Slider; +(() => { + requestUpdateOnAriaChange(_a); +})(); +Slider.shadowRootOptions = { ...LitElement.shadowRootOptions, delegatesFocus: true }; +/** + * @nocollapse + */ +Slider.formAssociated = true; +__decorate([ + property({ type: Boolean, reflect: true }) +], Slider.prototype, "disabled", void 0); +__decorate([ + property({ type: Number }) +], Slider.prototype, "min", void 0); +__decorate([ + property({ type: Number }) +], Slider.prototype, "max", void 0); +__decorate([ + property({ converter: valueConverter }) +], Slider.prototype, "value", void 0); +__decorate([ + property({ converter: tupleConverter }) +], Slider.prototype, "valueLabel", void 0); +__decorate([ + property({ type: Number }) +], Slider.prototype, "step", void 0); +__decorate([ + property({ type: Boolean }) +], Slider.prototype, "withTickMarks", void 0); +__decorate([ + property({ type: Boolean }) +], Slider.prototype, "withLabel", void 0); +__decorate([ + property({ reflect: true, converter: stringConverter }) +], Slider.prototype, "name", void 0); +__decorate([ + query('input.a') +], Slider.prototype, "inputA", void 0); +__decorate([ + query('.handle.a') +], Slider.prototype, "handleA", void 0); +__decorate([ + queryAsync('md-ripple.a') +], Slider.prototype, "rippleA", void 0); +__decorate([ + query('input.b') +], Slider.prototype, "inputB", void 0); +__decorate([ + query('.handle.b') +], Slider.prototype, "handleB", void 0); +__decorate([ + queryAsync('md-ripple.b') +], Slider.prototype, "rippleB", void 0); +__decorate([ + state() +], Slider.prototype, "valueA", void 0); +__decorate([ + state() +], Slider.prototype, "valueB", void 0); +__decorate([ + state() +], Slider.prototype, "rippleAShowing", void 0); +__decorate([ + state() +], Slider.prototype, "rippleBShowing", void 0); +__decorate([ + state() +], Slider.prototype, "handleAHover", void 0); +__decorate([ + state() +], Slider.prototype, "handleBHover", void 0); +__decorate([ + state() +], Slider.prototype, "onTopId", void 0); +__decorate([ + state() +], Slider.prototype, "handlesOverlapping", void 0); +//# sourceMappingURL=slider.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/slider/slider.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/slider/slider.d.ts new file mode 100644 index 0000000..20fc9ad --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/slider/slider.d.ts
@@ -0,0 +1,28 @@ +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import { Slider } from './lib/slider.js'; +declare global { + interface HTMLElementTagNameMap { + 'md-slider': MdSlider; + } +} +/** + * @summary Sliders allow users to view and select a value (or range) along + * a track. + * + * @description + * Changes made with sliders are immediate, allowing the user to make slider + * adjustments while determining a selection. Sliders shouldn’t be used to + * adjust settings with any delay in providing user feedback. Sliders reflect + * the current state of the settings they control. + * + * __Example usages:__ + * - Sliders are ideal for adjusting settings such as volume and brightness, or + * for applying image filters. + */ +export declare class MdSlider extends Slider { + static styles: import("lit").CSSResult[]; +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/slider/slider.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/slider/slider.js new file mode 100644 index 0000000..d218162 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/slider/slider.js
@@ -0,0 +1,32 @@ +/** + * @license + * Copyright 2023 Google LLC + * SPDX-License-Identifier: Apache-2.0 + */ +import { __decorate } from "tslib"; +import { customElement } from 'lit/decorators.js'; +import { styles as forcedColorsStyles } from './lib/forced-colors-styles.css.js'; +import { Slider } from './lib/slider.js'; +import { styles } from './lib/slider-styles.css.js'; +/** + * @summary Sliders allow users to view and select a value (or range) along + * a track. + * + * @description + * Changes made with sliders are immediate, allowing the user to make slider + * adjustments while determining a selection. Sliders shouldn’t be used to + * adjust settings with any delay in providing user feedback. Sliders reflect + * the current state of the settings they control. + * + * __Example usages:__ + * - Sliders are ideal for adjusting settings such as volume and brightness, or + * for applying image filters. + */ +let MdSlider = class MdSlider extends Slider { +}; +MdSlider.styles = [styles, forcedColorsStyles]; +MdSlider = __decorate([ + customElement('md-slider') +], MdSlider); +export { MdSlider }; +//# sourceMappingURL=slider.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/switch/lib/switch-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/switch/lib/switch-styles.css.js index 2c20aed..987b6c47 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/switch/lib/switch-styles.css.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/switch/lib/switch-styles.css.js
@@ -4,6 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ import { css } from 'lit'; -export const styles = css `:host{--_handle-shape-start-start: var(--md-switch-handle-shape-start-start, 9999px);--_handle-shape-start-end: var(--md-switch-handle-shape-start-end, 9999px);--_handle-shape-end-end: var(--md-switch-handle-shape-end-end, 9999px);--_handle-shape-end-start: var(--md-switch-handle-shape-end-start, 9999px);--_track-shape-start-start: var(--md-switch-track-shape-start-start, 9999px);--_track-shape-start-end: var(--md-switch-track-shape-start-end, 9999px);--_track-shape-end-end: var(--md-switch-track-shape-end-end, 9999px);--_track-shape-end-start: var(--md-switch-track-shape-end-start, 9999px);--_disabled-selected-handle-color: var(--md-switch-disabled-selected-handle-color, rgb(var(--md-sys-color-surface-rgb, 255, 251, 254), 1));--_disabled-selected-icon-color: var(--md-switch-disabled-selected-icon-color, rgb(var(--md-sys-color-on-surface-rgb, 28, 27, 31), 0.38));--_disabled-selected-track-color: var(--md-switch-disabled-selected-track-color, rgb(var(--md-sys-color-on-surface-rgb, 28, 27, 31), 0.12));--_disabled-unselected-handle-color: var(--md-switch-disabled-unselected-handle-color, rgb(var(--md-sys-color-on-surface-rgb, 28, 27, 31), 0.38));--_disabled-unselected-icon-color: var(--md-switch-disabled-unselected-icon-color, rgb(var(--md-sys-color-surface-variant-rgb, 231, 224, 236), 0.38));--_disabled-unselected-track-color: var(--md-switch-disabled-unselected-track-color, rgb(var(--md-sys-color-surface-variant-rgb, 231, 224, 236), 0.12));--_disabled-unselected-track-outline-color: var(--md-switch-disabled-unselected-track-outline-color, rgb(var(--md-sys-color-on-surface-rgb, 28, 27, 31), 0.12));--_pressed-handle-height: var(--md-switch-pressed-handle-height, 28px);--_pressed-handle-width: var(--md-switch-pressed-handle-width, 28px);--_selected-focus-handle-color: var(--md-switch-selected-focus-handle-color, var(--md-sys-color-primary-container, #eaddff));--_selected-focus-icon-color: var(--md-switch-selected-focus-icon-color, var(--md-sys-color-on-primary-container, #21005d));--_selected-focus-state-layer-color: var(--md-switch-selected-focus-state-layer-color, var(--md-sys-color-primary, #6750a4));--_selected-focus-state-layer-opacity: var(--md-switch-selected-focus-state-layer-opacity, 0.12);--_selected-focus-track-color: var(--md-switch-selected-focus-track-color, var(--md-sys-color-primary, #6750a4));--_selected-handle-color: var(--md-switch-selected-handle-color, var(--md-sys-color-on-primary, #fff));--_selected-handle-height: var(--md-switch-selected-handle-height, 24px);--_selected-handle-width: var(--md-switch-selected-handle-width, 24px);--_selected-hover-handle-color: var(--md-switch-selected-hover-handle-color, var(--md-sys-color-primary-container, #eaddff));--_selected-hover-icon-color: var(--md-switch-selected-hover-icon-color, var(--md-sys-color-on-primary-container, #21005d));--_selected-hover-state-layer-color: var(--md-switch-selected-hover-state-layer-color, var(--md-sys-color-primary, #6750a4));--_selected-hover-state-layer-opacity: var(--md-switch-selected-hover-state-layer-opacity, 0.08);--_selected-hover-track-color: var(--md-switch-selected-hover-track-color, var(--md-sys-color-primary, #6750a4));--_selected-icon-color: var(--md-switch-selected-icon-color, var(--md-sys-color-on-primary-container, #21005d));--_selected-icon-size: var(--md-switch-selected-icon-size, 16px);--_selected-pressed-handle-color: var(--md-switch-selected-pressed-handle-color, var(--md-sys-color-primary-container, #eaddff));--_selected-pressed-icon-color: var(--md-switch-selected-pressed-icon-color, var(--md-sys-color-on-primary-container, #21005d));--_selected-pressed-state-layer-color: var(--md-switch-selected-pressed-state-layer-color, var(--md-sys-color-primary, #6750a4));--_selected-pressed-state-layer-opacity: var(--md-switch-selected-pressed-state-layer-opacity, 0.12);--_selected-pressed-track-color: var(--md-switch-selected-pressed-track-color, var(--md-sys-color-primary, #6750a4));--_selected-track-color: var(--md-switch-selected-track-color, var(--md-sys-color-primary, #6750a4));--_state-layer-shape: var(--md-switch-state-layer-shape, 9999px);--_state-layer-size: var(--md-switch-state-layer-size, 40px);--_track-height: var(--md-switch-track-height, 32px);--_track-outline-width: var(--md-switch-track-outline-width, 2px);--_track-width: var(--md-switch-track-width, 52px);--_unselected-focus-handle-color: var(--md-switch-unselected-focus-handle-color, var(--md-sys-color-on-surface-variant, #49454f));--_unselected-focus-icon-color: var(--md-switch-unselected-focus-icon-color, var(--md-sys-color-surface-variant, #e7e0ec));--_unselected-focus-state-layer-color: var(--md-switch-unselected-focus-state-layer-color, var(--md-sys-color-on-surface, #1c1b1f));--_unselected-focus-state-layer-opacity: var(--md-switch-unselected-focus-state-layer-opacity, 0.12);--_unselected-focus-track-color: var(--md-switch-unselected-focus-track-color, var(--md-sys-color-surface-variant, #e7e0ec));--_unselected-focus-track-outline-color: var(--md-switch-unselected-focus-track-outline-color, var(--md-sys-color-outline, #79747e));--_unselected-handle-color: var(--md-switch-unselected-handle-color, var(--md-sys-color-outline, #79747e));--_unselected-handle-height: var(--md-switch-unselected-handle-height, 16px);--_unselected-handle-width: var(--md-switch-unselected-handle-width, 16px);--_unselected-hover-handle-color: var(--md-switch-unselected-hover-handle-color, var(--md-sys-color-on-surface-variant, #49454f));--_unselected-hover-icon-color: var(--md-switch-unselected-hover-icon-color, var(--md-sys-color-surface-variant, #e7e0ec));--_unselected-hover-state-layer-color: var(--md-switch-unselected-hover-state-layer-color, var(--md-sys-color-on-surface, #1c1b1f));--_unselected-hover-state-layer-opacity: var(--md-switch-unselected-hover-state-layer-opacity, 0.08);--_unselected-hover-track-color: var(--md-switch-unselected-hover-track-color, var(--md-sys-color-surface-variant, #e7e0ec));--_unselected-hover-track-outline-color: var(--md-switch-unselected-hover-track-outline-color, var(--md-sys-color-outline, #79747e));--_unselected-icon-color: var(--md-switch-unselected-icon-color, var(--md-sys-color-surface-variant, #e7e0ec));--_unselected-icon-size: var(--md-switch-unselected-icon-size, 16px);--_unselected-pressed-handle-color: var(--md-switch-unselected-pressed-handle-color, var(--md-sys-color-on-surface-variant, #49454f));--_unselected-pressed-icon-color: var(--md-switch-unselected-pressed-icon-color, var(--md-sys-color-surface-variant, #e7e0ec));--_unselected-pressed-state-layer-color: var(--md-switch-unselected-pressed-state-layer-color, var(--md-sys-color-on-surface, #1c1b1f));--_unselected-pressed-state-layer-opacity: var(--md-switch-unselected-pressed-state-layer-opacity, 0.12);--_unselected-pressed-track-color: var(--md-switch-unselected-pressed-track-color, var(--md-sys-color-surface-variant, #e7e0ec));--_unselected-pressed-track-outline-color: var(--md-switch-unselected-pressed-track-outline-color, var(--md-sys-color-outline, #79747e));--_unselected-track-color: var(--md-switch-unselected-track-color, var(--md-sys-color-surface-variant, #e7e0ec));--_unselected-track-outline-color: var(--md-switch-unselected-track-outline-color, var(--md-sys-color-outline, #79747e));--_with-icon-handle-height: var(--md-switch-with-icon-handle-height, 24px);--_with-icon-handle-width: var(--md-switch-with-icon-handle-width, 24px);display:inline-flex;outline:none;vertical-align:top;-webkit-tap-highlight-color:rgba(0,0,0,0)}@media screen and (forced-colors: active){:host{--md-switch-disabled-selected-icon-color:GrayText;--md-switch-disabled-selected-track-color:GrayText;--md-switch-disabled-unselected-handle-color:GrayText;--md-switch-disabled-unselected-icon-color:Canvas;--md-switch-selected-focus-track-color:ButtonText;--md-switch-selected-hover-track-color:ButtonText;--md-switch-selected-icon-color:ButtonText;--md-switch-selected-pressed-track-color:ButtonText;--md-switch-selected-track-color:ButtonText;--md-switch-unselected-focus-handle-color:ButtonText;--md-switch-unselected-handle-color:ButtonText;--md-switch-unselected-hover-handle-color:ButtonText;--md-switch-unselected-icon-color:Canvas;--md-switch-unselected-pressed-handle-color:ButtonText}}md-focus-ring{--md-focus-ring-shape-start-start:var(--_track-shape-start-start);--md-focus-ring-shape-start-end:var(--_track-shape-start-end);--md-focus-ring-shape-end-end:var(--_track-shape-end-start);--md-focus-ring-shape-end-start:var(--_track-shape-end-end)}.md3-switch{align-items:center;background:none;border:none;cursor:pointer;display:inline-flex;flex-shrink:0;margin:0;outline:none;padding:0;position:relative;width:var(--_track-width);height:var(--_track-height);border-start-start-radius:var(--_track-shape-start-start);border-start-end-radius:var(--_track-shape-start-end);border-end-end-radius:var(--_track-shape-end-end);border-end-start-radius:var(--_track-shape-end-start)}.md3-switch__touch{position:absolute;top:50%;height:48px;left:50%;width:48px;transform:translate(-50%, -50%)}.md3-switch:disabled{cursor:default;pointer-events:none}.md3-switch:disabled .md3-switch__track{background-color:rgba(0,0,0,0);border-color:rgba(0,0,0,0)}.md3-switch:disabled .md3-switch__track::before{background-clip:content-box}.md3-switch--selected:disabled .md3-switch__track{background-clip:border-box}.md3-switch__track{position:absolute;width:100%;height:100%;box-sizing:border-box;border-radius:inherit;display:flex;justify-content:center;align-items:center;transition:background-color 67ms linear;background-color:var(--_selected-track-color)}.md3-switch:disabled .md3-switch__track{transition:none}.md3-switch--selected:hover .md3-switch__track{background-color:var(--_selected-hover-track-color)}.md3-switch--selected:focus-visible .md3-switch__track{background-color:var(--_selected-focus-track-color)}.md3-switch--selected:active .md3-switch__track{background-color:var(--_selected-pressed-track-color)}.md3-switch--selected:disabled .md3-switch__track{background-color:var(--_disabled-selected-track-color)}.md3-switch__track::before{content:"";display:flex;position:absolute;height:100%;width:100%;border-radius:inherit;box-sizing:border-box;border-style:solid;transition-property:opacity,background-color;transition-timing-function:linear;transition-duration:67ms;border-width:var(--_track-outline-width);background-color:var(--_unselected-track-color);border-color:var(--_unselected-track-outline-color)}.md3-switch:disabled .md3-switch__track::before{transition:none}.md3-switch--selected .md3-switch__track::before{opacity:0}.md3-switch--unselected:hover .md3-switch__track::before{background-color:var(--_unselected-hover-track-color);border-color:var(--_unselected-hover-track-outline-color)}.md3-switch--unselected:focus-visible .md3-switch__track::before{background-color:var(--_unselected-focus-track-color);border-color:var(--_unselected-focus-track-outline-color)}.md3-switch--unselected:active .md3-switch__track::before{background-color:var(--_unselected-pressed-track-color);border-color:var(--_unselected-pressed-track-outline-color)}.md3-switch--unselected:disabled .md3-switch__track::before{background-color:var(--_disabled-unselected-track-color);border-color:var(--_disabled-unselected-track-outline-color)}.md3-switch__handle-container{position:relative;transition:margin 300ms cubic-bezier(0.175, 0.885, 0.32, 1.275);display:flex}.md3-switch--selected .md3-switch__handle-container{margin-inline-start:calc(var(--_track-width) - var(--_track-height))}.md3-switch--unselected .md3-switch__handle-container{margin-inline-end:calc(var(--_track-width) - var(--_track-height))}.md3-switch:disabled .md3-switch__handle-container{transition:none}.md3-switch__handle{border-start-start-radius:var(--_handle-shape-start-start);border-start-end-radius:var(--_handle-shape-start-end);border-end-end-radius:var(--_handle-shape-end-end);border-end-start-radius:var(--_handle-shape-end-start);height:var(--_unselected-handle-height);width:var(--_unselected-handle-width);background-color:var(--_selected-handle-color);transform-origin:center;transition-property:height,width,background-color;transition-duration:250ms,250ms,67ms;transition-timing-function:cubic-bezier(0.2, 0, 0, 1),cubic-bezier(0.2, 0, 0, 1),linear;z-index:0}.md3-switch__handle::before{content:"";display:flex;position:absolute;height:100%;width:100%;border-radius:inherit;box-sizing:border-box;transition:opacity 67ms linear}.md3-switch--selected .md3-switch__handle::before{opacity:0}.md3-switch:disabled .md3-switch__handle::before{transition:none}.md3-switch:disabled .md3-switch__handle{transition:none}.md3-switch--selected .md3-switch__handle,.md3-switch--unselected .md3-switch__handle.md3-switch__handle--big{height:var(--_selected-handle-height);width:var(--_selected-handle-width)}.md3-switch--selected:enabled:active .md3-switch__handle,.md3-switch--unselected:enabled:active .md3-switch__handle{height:var(--_pressed-handle-height);width:var(--_pressed-handle-width);transition-timing-function:linear;transition-duration:100ms}.md3-switch--selected:hover .md3-switch__handle{background-color:var(--_selected-hover-handle-color)}.md3-switch--selected:focus-visible .md3-switch__handle{background-color:var(--_selected-focus-handle-color)}.md3-switch--selected:active .md3-switch__handle{background-color:var(--_selected-pressed-handle-color)}.md3-switch--selected:disabled .md3-switch__handle{background-color:var(--_disabled-selected-handle-color)}.md3-switch__handle::before{background-color:var(--_unselected-handle-color)}.md3-switch--unselected:hover .md3-switch__handle::before{background-color:var(--_unselected-hover-handle-color)}.md3-switch--unselected:focus-visible .md3-switch__handle::before{background-color:var(--_unselected-focus-handle-color)}.md3-switch--unselected:active .md3-switch__handle::before{background-color:var(--_unselected-pressed-handle-color)}.md3-switch--unselected:disabled .md3-switch__handle::before{background-color:var(--_disabled-unselected-handle-color)}.md3-switch__ripple{position:absolute;display:inline-flex;top:50%;left:50%;transform:translate(-50%, -50%);height:var(--_state-layer-size);width:var(--_state-layer-size)}.md3-switch--selected .md3-switch__ripple{--md-ripple-hover-state-layer-color:var(--_selected-hover-state-layer-color);--md-ripple-focus-state-layer-color:var(--_selected-focus-state-layer-color);--md-ripple-pressed-state-layer-color:var(--_selected-pressed-state-layer-color);--md-ripple-hover-state-layer-opacity:var(--_selected-hover-state-layer-opacity);--md-ripple-focus-state-layer-opacity:var(--_selected-focus-state-layer-opacity);--md-ripple-pressed-state-layer-opacity:var(--_selected-pressed-state-layer-opacity)}.md3-switch--unselected .md3-switch__ripple{--md-ripple-hover-state-layer-color:var(--_unselected-hover-state-layer-color);--md-ripple-focus-state-layer-color:var(--_unselected-focus-state-layer-color);--md-ripple-pressed-state-layer-color:var(--_unselected-pressed-state-layer-color);--md-ripple-hover-state-layer-opacity:var(--_unselected-hover-state-layer-opacity);--md-ripple-focus-state-layer-opacity:var(--_unselected-focus-state-layer-opacity);--md-ripple-pressed-state-layer-opacity:var(--_unselected-pressed-state-layer-opacity)}.md3-switch__icons{position:relative;height:100%;width:100%}.md3-switch__icon{position:absolute;inset:0;margin:auto;transition:fill 67ms linear,opacity 33ms linear,transform 167ms cubic-bezier(0.2, 0, 0, 1);opacity:0}.md3-switch:disabled .md3-switch__icon{transition:none}.md3-switch--selected .md3-switch__icon--on,.md3-switch--unselected .md3-switch__icon--off{opacity:1}.md3-switch--unselected .md3-switch__handle:not(.md3-switch__handle--big) .md3-switch__icon--on{transform:rotate(-45deg)}.md3-switch--selected .md3-switch__icon{width:var(--_selected-icon-size);height:var(--_selected-icon-size);fill:var(--_selected-icon-color)}.md3-switch--unselected .md3-switch__icon{width:var(--_unselected-icon-size);height:var(--_unselected-icon-size);fill:var(--_unselected-icon-color)}.md3-switch--selected:disabled .md3-switch__icon{fill:var(--_disabled-selected-icon-color)}.md3-switch--unselected:disabled .md3-switch__icon{fill:var(--_disabled-unselected-icon-color)}/*# sourceMappingURL=switch-styles.css.map */ +export const styles = css `:host{--_disabled-selected-handle-color: var(--md-switch-disabled-selected-handle-color, rgb(var(--md-sys-color-surface-rgb, 254, 247, 255), 1));--_disabled-selected-icon-color: var(--md-switch-disabled-selected-icon-color, rgb(var(--md-sys-color-on-surface-rgb, 29, 27, 32), 0.38));--_disabled-selected-track-color: var(--md-switch-disabled-selected-track-color, rgb(var(--md-sys-color-on-surface-rgb, 29, 27, 32), 0.12));--_disabled-unselected-handle-color: var(--md-switch-disabled-unselected-handle-color, rgb(var(--md-sys-color-on-surface-rgb, 29, 27, 32), 0.38));--_disabled-unselected-icon-color: var(--md-switch-disabled-unselected-icon-color, rgb(var(--md-sys-color-surface-container-highest-rgb, 230, 224, 233), 0.38));--_disabled-unselected-track-color: var(--md-switch-disabled-unselected-track-color, rgb(var(--md-sys-color-surface-container-highest-rgb, 230, 224, 233), 0.12));--_disabled-unselected-track-outline-color: var(--md-switch-disabled-unselected-track-outline-color, rgb(var(--md-sys-color-on-surface-rgb, 29, 27, 32), 0.12));--_handle-shape: var(--md-switch-handle-shape, 9999px);--_pressed-handle-height: var(--md-switch-pressed-handle-height, 28px);--_pressed-handle-width: var(--md-switch-pressed-handle-width, 28px);--_selected-focus-handle-color: var(--md-switch-selected-focus-handle-color, var(--md-sys-color-primary-container, #eaddff));--_selected-focus-icon-color: var(--md-switch-selected-focus-icon-color, var(--md-sys-color-on-primary-container, #21005d));--_selected-focus-state-layer-color: var(--md-switch-selected-focus-state-layer-color, var(--md-sys-color-primary, #6750a4));--_selected-focus-state-layer-opacity: var(--md-switch-selected-focus-state-layer-opacity, 0.12);--_selected-focus-track-color: var(--md-switch-selected-focus-track-color, var(--md-sys-color-primary, #6750a4));--_selected-handle-color: var(--md-switch-selected-handle-color, var(--md-sys-color-on-primary, #fff));--_selected-handle-height: var(--md-switch-selected-handle-height, 24px);--_selected-handle-width: var(--md-switch-selected-handle-width, 24px);--_selected-hover-handle-color: var(--md-switch-selected-hover-handle-color, var(--md-sys-color-primary-container, #eaddff));--_selected-hover-icon-color: var(--md-switch-selected-hover-icon-color, var(--md-sys-color-on-primary-container, #21005d));--_selected-hover-state-layer-color: var(--md-switch-selected-hover-state-layer-color, var(--md-sys-color-primary, #6750a4));--_selected-hover-state-layer-opacity: var(--md-switch-selected-hover-state-layer-opacity, 0.08);--_selected-hover-track-color: var(--md-switch-selected-hover-track-color, var(--md-sys-color-primary, #6750a4));--_selected-icon-color: var(--md-switch-selected-icon-color, var(--md-sys-color-on-primary-container, #21005d));--_selected-icon-size: var(--md-switch-selected-icon-size, 16px);--_selected-pressed-handle-color: var(--md-switch-selected-pressed-handle-color, var(--md-sys-color-primary-container, #eaddff));--_selected-pressed-icon-color: var(--md-switch-selected-pressed-icon-color, var(--md-sys-color-on-primary-container, #21005d));--_selected-pressed-state-layer-color: var(--md-switch-selected-pressed-state-layer-color, var(--md-sys-color-primary, #6750a4));--_selected-pressed-state-layer-opacity: var(--md-switch-selected-pressed-state-layer-opacity, 0.12);--_selected-pressed-track-color: var(--md-switch-selected-pressed-track-color, var(--md-sys-color-primary, #6750a4));--_selected-track-color: var(--md-switch-selected-track-color, var(--md-sys-color-primary, #6750a4));--_state-layer-shape: var(--md-switch-state-layer-shape, 9999px);--_state-layer-size: var(--md-switch-state-layer-size, 40px);--_track-height: var(--md-switch-track-height, 32px);--_track-outline-width: var(--md-switch-track-outline-width, 2px);--_track-shape: var(--md-switch-track-shape, 9999px);--_track-width: var(--md-switch-track-width, 52px);--_unselected-focus-handle-color: var(--md-switch-unselected-focus-handle-color, var(--md-sys-color-on-surface-variant, #49454f));--_unselected-focus-icon-color: var(--md-switch-unselected-focus-icon-color, var(--md-sys-color-surface-container-highest, #e6e0e9));--_unselected-focus-state-layer-color: var(--md-switch-unselected-focus-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-focus-state-layer-opacity: var(--md-switch-unselected-focus-state-layer-opacity, 0.12);--_unselected-focus-track-color: var(--md-switch-unselected-focus-track-color, var(--md-sys-color-surface-container-highest, #e6e0e9));--_unselected-focus-track-outline-color: var(--md-switch-unselected-focus-track-outline-color, var(--md-sys-color-outline, #79747e));--_unselected-handle-color: var(--md-switch-unselected-handle-color, var(--md-sys-color-outline, #79747e));--_unselected-handle-height: var(--md-switch-unselected-handle-height, 16px);--_unselected-handle-width: var(--md-switch-unselected-handle-width, 16px);--_unselected-hover-handle-color: var(--md-switch-unselected-hover-handle-color, var(--md-sys-color-on-surface-variant, #49454f));--_unselected-hover-icon-color: var(--md-switch-unselected-hover-icon-color, var(--md-sys-color-surface-container-highest, #e6e0e9));--_unselected-hover-state-layer-color: var(--md-switch-unselected-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-hover-state-layer-opacity: var(--md-switch-unselected-hover-state-layer-opacity, 0.08);--_unselected-hover-track-color: var(--md-switch-unselected-hover-track-color, var(--md-sys-color-surface-container-highest, #e6e0e9));--_unselected-hover-track-outline-color: var(--md-switch-unselected-hover-track-outline-color, var(--md-sys-color-outline, #79747e));--_unselected-icon-color: var(--md-switch-unselected-icon-color, var(--md-sys-color-surface-container-highest, #e6e0e9));--_unselected-icon-size: var(--md-switch-unselected-icon-size, 16px);--_unselected-pressed-handle-color: var(--md-switch-unselected-pressed-handle-color, var(--md-sys-color-on-surface-variant, #49454f));--_unselected-pressed-icon-color: var(--md-switch-unselected-pressed-icon-color, var(--md-sys-color-surface-container-highest, #e6e0e9));--_unselected-pressed-state-layer-color: var(--md-switch-unselected-pressed-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-pressed-state-layer-opacity: var(--md-switch-unselected-pressed-state-layer-opacity, 0.12);--_unselected-pressed-track-color: var(--md-switch-unselected-pressed-track-color, var(--md-sys-color-surface-container-highest, #e6e0e9));--_unselected-pressed-track-outline-color: var(--md-switch-unselected-pressed-track-outline-color, var(--md-sys-color-outline, #79747e));--_unselected-track-color: var(--md-switch-unselected-track-color, var(--md-sys-color-surface-container-highest, #e6e0e9));--_unselected-track-outline-color: var(--md-switch-unselected-track-outline-color, var(--md-sys-color-outline, #79747e));--_with-icon-handle-height: var(--md-switch-with-icon-handle-height, 24px);--_with-icon-handle-width: var(--md-switch-with-icon-handle-width, 24px);--_handle-shape-start-start: var( --md-switch-handle-shape-start-start, var(--_handle-shape) );--_handle-shape-start-end: var( --md-switch-handle-shape-start-end, var(--_handle-shape) );--_handle-shape-end-end: var( --md-switch-handle-shape-end-end, var(--_handle-shape) );--_handle-shape-end-start: var( --md-switch-handle-shape-end-start, var(--_handle-shape) );--_track-shape-start-start: var( --md-switch-track-shape-start-start, var(--_track-shape) );--_track-shape-start-end: var( --md-switch-track-shape-start-end, var(--_track-shape) );--_track-shape-end-end: var( --md-switch-track-shape-end-end, var(--_track-shape) );--_track-shape-end-start: var( --md-switch-track-shape-end-start, var(--_track-shape) );display:inline-flex;outline:none;vertical-align:top;-webkit-tap-highlight-color:rgba(0,0,0,0)}@media screen and (forced-colors: active){:host{--md-switch-disabled-selected-icon-color: GrayText;--md-switch-disabled-selected-track-color: GrayText;--md-switch-disabled-unselected-handle-color: GrayText;--md-switch-disabled-unselected-icon-color: Canvas;--md-switch-selected-focus-track-color: ButtonText;--md-switch-selected-hover-track-color: ButtonText;--md-switch-selected-icon-color: ButtonText;--md-switch-selected-pressed-track-color: ButtonText;--md-switch-selected-track-color: ButtonText;--md-switch-unselected-focus-handle-color: ButtonText;--md-switch-unselected-handle-color: ButtonText;--md-switch-unselected-hover-handle-color: ButtonText;--md-switch-unselected-icon-color: Canvas;--md-switch-unselected-pressed-handle-color: ButtonText}}md-focus-ring{--md-focus-ring-shape-start-start: var(--_track-shape-start-start);--md-focus-ring-shape-start-end: var(--_track-shape-start-end);--md-focus-ring-shape-end-end: var(--_track-shape-end-end);--md-focus-ring-shape-end-start: var(--_track-shape-end-start)}.md3-switch{align-items:center;background:none;border:none;cursor:pointer;display:inline-flex;flex-shrink:0;margin:0;outline:none;padding:0;position:relative;width:var(--_track-width);height:var(--_track-height);border-start-start-radius:var(--_track-shape-start-start);border-start-end-radius:var(--_track-shape-start-end);border-end-end-radius:var(--_track-shape-end-end);border-end-start-radius:var(--_track-shape-end-start)}.md3-switch__touch{position:absolute;top:50%;height:48px;left:50%;width:48px;transform:translate(-50%, -50%)}.md3-switch:disabled{cursor:default;pointer-events:none}.md3-switch:disabled .md3-switch__track{background-color:rgba(0,0,0,0);border-color:rgba(0,0,0,0)}.md3-switch:disabled .md3-switch__track::before{background-clip:content-box}.md3-switch--selected:disabled .md3-switch__track{background-clip:border-box}.md3-switch__track{position:absolute;width:100%;height:100%;box-sizing:border-box;border-radius:inherit;display:flex;justify-content:center;align-items:center;transition:background-color 67ms linear;background-color:var(--_selected-track-color)}.md3-switch:disabled .md3-switch__track{transition:none}.md3-switch--selected:hover .md3-switch__track{background-color:var(--_selected-hover-track-color)}.md3-switch--selected:focus-visible .md3-switch__track{background-color:var(--_selected-focus-track-color)}.md3-switch--selected:active .md3-switch__track{background-color:var(--_selected-pressed-track-color)}.md3-switch--selected:disabled .md3-switch__track{background-color:var(--_disabled-selected-track-color)}.md3-switch__track::before{content:"";display:flex;position:absolute;height:100%;width:100%;border-radius:inherit;box-sizing:border-box;border-style:solid;transition-property:opacity,background-color;transition-timing-function:linear;transition-duration:67ms;border-width:var(--_track-outline-width);background-color:var(--_unselected-track-color);border-color:var(--_unselected-track-outline-color)}.md3-switch:disabled .md3-switch__track::before{transition:none}.md3-switch--selected .md3-switch__track::before{opacity:0}.md3-switch--unselected:hover .md3-switch__track::before{background-color:var(--_unselected-hover-track-color);border-color:var(--_unselected-hover-track-outline-color)}.md3-switch--unselected:focus-visible .md3-switch__track::before{background-color:var(--_unselected-focus-track-color);border-color:var(--_unselected-focus-track-outline-color)}.md3-switch--unselected:active .md3-switch__track::before{background-color:var(--_unselected-pressed-track-color);border-color:var(--_unselected-pressed-track-outline-color)}.md3-switch--unselected:disabled .md3-switch__track::before{background-color:var(--_disabled-unselected-track-color);border-color:var(--_disabled-unselected-track-outline-color)}.md3-switch__handle-container{position:relative;transition:margin 300ms cubic-bezier(0.175, 0.885, 0.32, 1.275);display:flex}.md3-switch--selected .md3-switch__handle-container{margin-inline-start:calc(var(--_track-width) - var(--_track-height))}.md3-switch--unselected .md3-switch__handle-container{margin-inline-end:calc(var(--_track-width) - var(--_track-height))}.md3-switch:disabled .md3-switch__handle-container{transition:none}.md3-switch__handle{border-start-start-radius:var(--_handle-shape-start-start);border-start-end-radius:var(--_handle-shape-start-end);border-end-end-radius:var(--_handle-shape-end-end);border-end-start-radius:var(--_handle-shape-end-start);height:var(--_unselected-handle-height);width:var(--_unselected-handle-width);background-color:var(--_selected-handle-color);transform-origin:center;transition-property:height,width,background-color;transition-duration:250ms,250ms,67ms;transition-timing-function:cubic-bezier(0.2, 0, 0, 1),cubic-bezier(0.2, 0, 0, 1),linear;z-index:0}.md3-switch__handle::before{content:"";display:flex;position:absolute;height:100%;width:100%;border-radius:inherit;box-sizing:border-box;transition:opacity 67ms linear}.md3-switch--selected .md3-switch__handle::before{opacity:0}.md3-switch:disabled .md3-switch__handle::before{transition:none}.md3-switch:disabled .md3-switch__handle{transition:none}.md3-switch--selected .md3-switch__handle,.md3-switch--unselected .md3-switch__handle.md3-switch__handle--big{height:var(--_selected-handle-height);width:var(--_selected-handle-width)}.md3-switch--selected:enabled:active .md3-switch__handle,.md3-switch--unselected:enabled:active .md3-switch__handle{height:var(--_pressed-handle-height);width:var(--_pressed-handle-width);transition-timing-function:linear;transition-duration:100ms}.md3-switch--selected:hover .md3-switch__handle{background-color:var(--_selected-hover-handle-color)}.md3-switch--selected:focus-visible .md3-switch__handle{background-color:var(--_selected-focus-handle-color)}.md3-switch--selected:active .md3-switch__handle{background-color:var(--_selected-pressed-handle-color)}.md3-switch--selected:disabled .md3-switch__handle{background-color:var(--_disabled-selected-handle-color)}.md3-switch__handle::before{background-color:var(--_unselected-handle-color)}.md3-switch--unselected:hover .md3-switch__handle::before{background-color:var(--_unselected-hover-handle-color)}.md3-switch--unselected:focus-visible .md3-switch__handle::before{background-color:var(--_unselected-focus-handle-color)}.md3-switch--unselected:active .md3-switch__handle::before{background-color:var(--_unselected-pressed-handle-color)}.md3-switch--unselected:disabled .md3-switch__handle::before{background-color:var(--_disabled-unselected-handle-color)}.md3-switch__ripple{position:absolute;display:inline-flex;top:50%;left:50%;transform:translate(-50%, -50%);height:var(--_state-layer-size);width:var(--_state-layer-size)}.md3-switch--selected .md3-switch__ripple{--md-ripple-hover-color:var(--_selected-hover-state-layer-color);--md-ripple-focus-color:var(--_selected-focus-state-layer-color);--md-ripple-pressed-color:var(--_selected-pressed-state-layer-color);--md-ripple-hover-opacity:var(--_selected-hover-state-layer-opacity);--md-ripple-focus-opacity:var(--_selected-focus-state-layer-opacity);--md-ripple-pressed-opacity:var(--_selected-pressed-state-layer-opacity)}.md3-switch--unselected .md3-switch__ripple{--md-ripple-hover-color:var(--_unselected-hover-state-layer-color);--md-ripple-focus-color:var(--_unselected-focus-state-layer-color);--md-ripple-pressed-color:var(--_unselected-pressed-state-layer-color);--md-ripple-hover-opacity:var(--_unselected-hover-state-layer-opacity);--md-ripple-focus-opacity:var(--_unselected-focus-state-layer-opacity);--md-ripple-pressed-opacity:var(--_unselected-pressed-state-layer-opacity)}.md3-switch__icons{position:relative;height:100%;width:100%}.md3-switch__icon{position:absolute;inset:0;margin:auto;transition:fill 67ms linear,opacity 33ms linear,transform 167ms cubic-bezier(0.2, 0, 0, 1);opacity:0}.md3-switch:disabled .md3-switch__icon{transition:none}.md3-switch--selected .md3-switch__icon--on,.md3-switch--unselected .md3-switch__icon--off{opacity:1}.md3-switch--unselected .md3-switch__handle:not(.md3-switch__handle--big) .md3-switch__icon--on{transform:rotate(-45deg)}.md3-switch--selected .md3-switch__icon{width:var(--_selected-icon-size);height:var(--_selected-icon-size);fill:var(--_selected-icon-color)}.md3-switch--unselected .md3-switch__icon{width:var(--_unselected-icon-size);height:var(--_unselected-icon-size);fill:var(--_unselected-icon-color)}.md3-switch--selected:disabled .md3-switch__icon{fill:var(--_disabled-selected-icon-color)}.md3-switch--unselected:disabled .md3-switch__icon{fill:var(--_disabled-unselected-icon-color)}/*# sourceMappingURL=switch-styles.css.map */ `; //# sourceMappingURL=switch-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/switch/lib/switch.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/switch/lib/switch.d.ts index d9b3608b..c94e229e 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/switch/lib/switch.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/switch/lib/switch.d.ts
@@ -37,9 +37,6 @@ * overrides the behavior of the `icons` property. */ showOnlySelectedIcon: boolean; - ariaLabel: string; - ariaLabelledBy: string; - private showFocusRing; private showRipple; private readonly ripple; private readonly button; @@ -62,7 +59,6 @@ private getRenderClasses; private readonly renderRipple; private readonly getRipple; - private readonly renderFocusRing; private renderHandle; private renderIcons; /** @@ -76,7 +72,4 @@ private renderTouchTarget; private shouldShowIcons; private handleClick; - private handleFocus; - private handleBlur; - private handlePointerDown; }
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/switch/lib/switch.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/switch/lib/switch.js index 31c33bb..8b0726e 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/switch/lib/switch.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/switch/lib/switch.js
@@ -3,19 +3,17 @@ * Copyright 2021 Google LLC * SPDX-License-Identifier: Apache-2.0 */ -import { __decorate, __metadata } from "tslib"; -// tslint:disable:no-new-decorators +var _a; +import { __decorate } from "tslib"; import '../../focus/focus-ring.js'; import '../../ripple/ripple.js'; -import { html, LitElement } from 'lit'; -import { eventOptions, property, query, queryAsync, state } from 'lit/decorators.js'; +import { html, isServer, LitElement, nothing } from 'lit'; +import { property, query, queryAsync, state } from 'lit/decorators.js'; import { classMap } from 'lit/directives/class-map.js'; -import { ifDefined } from 'lit/directives/if-defined.js'; import { when } from 'lit/directives/when.js'; +import { requestUpdateOnAriaChange } from '../../aria/delegate.js'; import { dispatchActivationClick, isActivationClick } from '../../controller/events.js'; import { FormController, getFormValue } from '../../controller/form-controller.js'; -import { ariaProperty } from '../../decorators/aria-property.js'; -import { pointerPress as focusRingPointerPress, shouldShowStrongFocus } from '../../focus/strong-focus.js'; import { ripple } from '../../ripple/directive.js'; /** * @fires input {InputEvent} Fired whenever `selected` changes due to user @@ -24,6 +22,15 @@ * interaction (bubbles). */ export class Switch extends LitElement { + /** + * The associated form element with which this element's value will submit. + */ + get form() { + return this.closest('form'); + } + [getFormValue]() { + return this.selected ? this.value : null; + } constructor() { super(); /** @@ -44,8 +51,6 @@ * overrides the behavior of the `icons` property. */ this.showOnlySelectedIcon = false; - this.ariaLabelledBy = ''; - this.showFocusRing = false; this.showRipple = false; /** * The HTML name to use in form submission. @@ -70,33 +75,21 @@ this.showRipple = true; return this.ripple; }; - this.renderFocusRing = () => { - return html `<md-focus-ring visible></md-focus-ring>`; - }; this.addController(new FormController(this)); - this.addEventListener('click', (event) => { - if (!isActivationClick(event)) { - return; - } - this.button?.focus(); - if (this.button != null) { - // this triggers the click behavior, and the ripple - dispatchActivationClick(this.button); - } - }); - } - /** - * The associated form element with which this element's value will submit. - */ - get form() { - return this.closest('form'); - } - [getFormValue]() { - return this.selected ? this.value : null; + if (!isServer) { + this.addEventListener('click', (event) => { + if (!isActivationClick(event)) { + return; + } + this.button?.focus(); + if (this.button != null) { + // this triggers the click behavior, and the ripple + dispatchActivationClick(this.button); + } + }); + } } render() { - const ariaLabelValue = this.ariaLabel ? this.ariaLabel : undefined; - const ariaLabelledByValue = this.ariaLabelledBy ? this.ariaLabelledBy : undefined; // NOTE: buttons must use only [phrasing // content](https://html.spec.whatwg.org/multipage/dom.html#phrasing-content) // children, which includes custom elements, but not `div`s @@ -106,16 +99,12 @@ class="md3-switch ${classMap(this.getRenderClasses())}" role="switch" aria-checked="${this.selected}" - aria-label="${ifDefined(ariaLabelValue)}" - aria-labelledby="${ifDefined(ariaLabelledByValue)}" + aria-label=${this.ariaLabel || nothing} ?disabled=${this.disabled} @click=${this.handleClick} - @focus="${this.handleFocus}" - @blur="${this.handleBlur}" - @pointerdown=${this.handlePointerDown} ${ripple(this.getRipple)} > - ${when(this.showFocusRing, this.renderFocusRing)} + <md-focus-ring></md-focus-ring> <span class="md3-switch__track"> ${this.renderHandle()} </span> @@ -129,7 +118,6 @@ }; } renderHandle() { - /** @classMap */ const classes = { 'md3-switch__handle--big': this.icons && !this.showOnlySelectedIcon, }; @@ -187,76 +175,41 @@ // Additionally, native change event is not an InputEvent. this.dispatchEvent(new Event('change', { bubbles: true })); } - handleFocus() { - this.showFocusRing = shouldShowStrongFocus(); - } - handleBlur() { - this.showFocusRing = false; - } - handlePointerDown() { - focusRingPointerPress(); - this.showFocusRing = false; - } } +_a = Switch; +(() => { + requestUpdateOnAriaChange(_a); +})(); Switch.shadowRootOptions = { mode: 'open', delegatesFocus: true }; /** * @nocollapse */ Switch.formAssociated = true; __decorate([ - property({ type: Boolean, reflect: true }), - __metadata("design:type", Object) + property({ type: Boolean, reflect: true }) ], Switch.prototype, "disabled", void 0); __decorate([ - property({ type: Boolean }), - __metadata("design:type", Object) + property({ type: Boolean }) ], Switch.prototype, "selected", void 0); __decorate([ - property({ type: Boolean }), - __metadata("design:type", Object) + property({ type: Boolean }) ], Switch.prototype, "icons", void 0); __decorate([ - property({ type: Boolean }), - __metadata("design:type", Object) + property({ type: Boolean }) ], Switch.prototype, "showOnlySelectedIcon", void 0); __decorate([ - ariaProperty, - property({ type: String, attribute: 'data-aria-label', noAccessor: true }), - __metadata("design:type", String) -], Switch.prototype, "ariaLabel", void 0); -__decorate([ - ariaProperty, - property({ type: String, attribute: 'data-aria-labelledby', noAccessor: true }), - __metadata("design:type", Object) -], Switch.prototype, "ariaLabelledBy", void 0); -__decorate([ - state(), - __metadata("design:type", Object) -], Switch.prototype, "showFocusRing", void 0); -__decorate([ - state(), - __metadata("design:type", Object) + state() ], Switch.prototype, "showRipple", void 0); __decorate([ - queryAsync('md-ripple'), - __metadata("design:type", Promise) + queryAsync('md-ripple') ], Switch.prototype, "ripple", void 0); __decorate([ - query('button'), - __metadata("design:type", HTMLButtonElement) + query('button') ], Switch.prototype, "button", void 0); __decorate([ - property({ type: String, reflect: true }), - __metadata("design:type", Object) + property({ reflect: true }) ], Switch.prototype, "name", void 0); __decorate([ - property({ type: String }), - __metadata("design:type", Object) + property() ], Switch.prototype, "value", void 0); -__decorate([ - eventOptions({ passive: true }), - __metadata("design:type", Function), - __metadata("design:paramtypes", []), - __metadata("design:returntype", void 0) -], Switch.prototype, "handlePointerDown", null); //# sourceMappingURL=switch.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/textfield/filled-text-field.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/textfield/filled-text-field.d.ts index 1767fdf..186bea5 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/textfield/filled-text-field.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/textfield/filled-text-field.d.ts
@@ -12,7 +12,7 @@ } } /** - * @soyCompatible + * TODO(b/228525797): Add docs * @final * @suppress {visibility} */
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/textfield/filled-text-field.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/textfield/filled-text-field.js index 7facd514..6c30fb6 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/textfield/filled-text-field.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/textfield/filled-text-field.js
@@ -7,13 +7,12 @@ import '../field/filled-field.js'; import { customElement } from 'lit/decorators.js'; import { literal } from 'lit/static-html.js'; -// TODO(b/236285090): update with HCM best practices import { styles as filledForcedColorsStyles } from './lib/filled-forced-colors-styles.css.js'; import { styles as filledStyles } from './lib/filled-styles.css.js'; import { FilledTextField } from './lib/filled-text-field.js'; import { styles as sharedStyles } from './lib/shared-styles.css.js'; /** - * @soyCompatible + * TODO(b/228525797): Add docs * @final * @suppress {visibility} */
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/textfield/harness.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/textfield/harness.d.ts index 40ab7e81..83892d5 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/textfield/harness.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/textfield/harness.d.ts
@@ -10,7 +10,7 @@ */ export declare class TextFieldHarness extends Harness<TextField> { /** Used to track whether or not a change event should be dispatched. */ - protected valueBeforeChange: string; + private valueBeforeChange; /** * Simulates a user typing a value one character at a time. This will fire * multiple input events.
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/textfield/lib/filled-forced-colors-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/textfield/lib/filled-forced-colors-styles.css.js index 8d6da31..2d5e8b2a 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/textfield/lib/filled-forced-colors-styles.css.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/textfield/lib/filled-forced-colors-styles.css.js
@@ -4,6 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ import { css } from 'lit'; -export const styles = css `@media(forced-colors: active){:host{--md-filled-text-field-disabled-active-indicator-color:GrayText;--md-filled-text-field-disabled-active-indicator-opacity:1;--md-filled-text-field-disabled-input-text-color:GrayText;--md-filled-text-field-disabled-input-text-opacity:1;--md-filled-text-field-disabled-label-text-color:GrayText;--md-filled-text-field-disabled-label-text-opacity:1;--md-filled-text-field-disabled-leading-icon-color:GrayText;--md-filled-text-field-disabled-leading-icon-opacity:1;--md-filled-text-field-disabled-supporting-text-color:GrayText;--md-filled-text-field-disabled-supporting-text-opacity:1;--md-filled-text-field-disabled-trailing-icon-color:GrayText;--md-filled-text-field-disabled-trailing-icon-opacity:1}}/*# sourceMappingURL=filled-forced-colors-styles.css.map */ +export const styles = css `@media(forced-colors: active){:host{--md-filled-text-field-disabled-active-indicator-color: GrayText;--md-filled-text-field-disabled-active-indicator-opacity: 1;--md-filled-text-field-disabled-input-text-color: GrayText;--md-filled-text-field-disabled-input-text-opacity: 1;--md-filled-text-field-disabled-label-text-color: GrayText;--md-filled-text-field-disabled-label-text-opacity: 1;--md-filled-text-field-disabled-leading-icon-color: GrayText;--md-filled-text-field-disabled-leading-icon-opacity: 1;--md-filled-text-field-disabled-supporting-text-color: GrayText;--md-filled-text-field-disabled-supporting-text-opacity: 1;--md-filled-text-field-disabled-trailing-icon-color: GrayText;--md-filled-text-field-disabled-trailing-icon-opacity: 1}}/*# sourceMappingURL=filled-forced-colors-styles.css.map */ `; //# sourceMappingURL=filled-forced-colors-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/textfield/lib/filled-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/textfield/lib/filled-styles.css.js index c93fc04..604b489 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/textfield/lib/filled-styles.css.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/textfield/lib/filled-styles.css.js
@@ -4,6 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ import { css } from 'lit'; -export const styles = css `:host{--_container-shape-start-start: var(--md-filled-text-field-container-shape-start-start, 4px);--_container-shape-start-end: var(--md-filled-text-field-container-shape-start-end, 4px);--_container-shape-end-end: var(--md-filled-text-field-container-shape-end-end, 0px);--_container-shape-end-start: var(--md-filled-text-field-container-shape-end-start, 0px);--_container-padding-horizontal: var(--md-filled-text-field-container-padding-horizontal, 16px);--_container-padding-vertical: var(--md-filled-text-field-container-padding-vertical, 16px);--_input-text-prefix-padding: var(--md-filled-text-field-input-text-prefix-padding, 2px);--_input-text-suffix-padding: var(--md-filled-text-field-input-text-suffix-padding, 2px);--_with-label-container-padding-vertical: var(--md-filled-text-field-with-label-container-padding-vertical, 8px);--_active-indicator-color: var(--md-filled-text-field-active-indicator-color, var(--md-sys-color-on-surface-variant, #49454f));--_active-indicator-height: var(--md-filled-text-field-active-indicator-height, 1px);--_caret-color: var(--md-filled-text-field-caret-color, var(--md-sys-color-primary, #6750a4));--_container-color: var(--md-filled-text-field-container-color, var(--md-sys-color-surface-variant, #e7e0ec));--_disabled-active-indicator-color: var(--md-filled-text-field-disabled-active-indicator-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-active-indicator-height: var(--md-filled-text-field-disabled-active-indicator-height, 1px);--_disabled-active-indicator-opacity: var(--md-filled-text-field-disabled-active-indicator-opacity, 0.38);--_disabled-container-color: var(--md-filled-text-field-disabled-container-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-container-opacity: var(--md-filled-text-field-disabled-container-opacity, 0.04);--_disabled-input-text-color: var(--md-filled-text-field-disabled-input-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-input-text-opacity: var(--md-filled-text-field-disabled-input-text-opacity, 0.38);--_disabled-label-text-color: var(--md-filled-text-field-disabled-label-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-label-text-opacity: var(--md-filled-text-field-disabled-label-text-opacity, 0.38);--_disabled-leading-icon-color: var(--md-filled-text-field-disabled-leading-icon-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-leading-icon-opacity: var(--md-filled-text-field-disabled-leading-icon-opacity, 0.38);--_disabled-supporting-text-color: var(--md-filled-text-field-disabled-supporting-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-supporting-text-opacity: var(--md-filled-text-field-disabled-supporting-text-opacity, 0.38);--_disabled-trailing-icon-color: var(--md-filled-text-field-disabled-trailing-icon-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-trailing-icon-opacity: var(--md-filled-text-field-disabled-trailing-icon-opacity, 0.38);--_error-active-indicator-color: var(--md-filled-text-field-error-active-indicator-color, var(--md-sys-color-error, #b3261e));--_error-focus-active-indicator-color: var(--md-filled-text-field-error-focus-active-indicator-color, var(--md-sys-color-error, #b3261e));--_error-focus-caret-color: var(--md-filled-text-field-error-focus-caret-color, var(--md-sys-color-error, #b3261e));--_error-focus-input-text-color: var(--md-filled-text-field-error-focus-input-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_error-focus-label-text-color: var(--md-filled-text-field-error-focus-label-text-color, var(--md-sys-color-error, #b3261e));--_error-focus-leading-icon-color: var(--md-filled-text-field-error-focus-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-focus-supporting-text-color: var(--md-filled-text-field-error-focus-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-focus-trailing-icon-color: var(--md-filled-text-field-error-focus-trailing-icon-color, var(--md-sys-color-error, #b3261e));--_error-hover-active-indicator-color: var(--md-filled-text-field-error-hover-active-indicator-color, var(--md-sys-color-on-error-container, #410e0b));--_error-hover-input-text-color: var(--md-filled-text-field-error-hover-input-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_error-hover-label-text-color: var(--md-filled-text-field-error-hover-label-text-color, var(--md-sys-color-on-error-container, #410e0b));--_error-hover-leading-icon-color: var(--md-filled-text-field-error-hover-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-hover-state-layer-color: var(--md-filled-text-field-error-hover-state-layer-color, var(--md-sys-color-on-surface, #1c1b1f));--_error-hover-state-layer-opacity: var(--md-filled-text-field-error-hover-state-layer-opacity, 0.08);--_error-hover-supporting-text-color: var(--md-filled-text-field-error-hover-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-hover-trailing-icon-color: var(--md-filled-text-field-error-hover-trailing-icon-color, var(--md-sys-color-on-error-container, #410e0b));--_error-input-text-color: var(--md-filled-text-field-error-input-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_error-label-text-color: var(--md-filled-text-field-error-label-text-color, var(--md-sys-color-error, #b3261e));--_error-leading-icon-color: var(--md-filled-text-field-error-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-supporting-text-color: var(--md-filled-text-field-error-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-trailing-icon-color: var(--md-filled-text-field-error-trailing-icon-color, var(--md-sys-color-error, #b3261e));--_focus-active-indicator-color: var(--md-filled-text-field-focus-active-indicator-color, var(--md-sys-color-primary, #6750a4));--_focus-active-indicator-height: var(--md-filled-text-field-focus-active-indicator-height, 2px);--_focus-input-text-color: var(--md-filled-text-field-focus-input-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_focus-label-text-color: var(--md-filled-text-field-focus-label-text-color, var(--md-sys-color-primary, #6750a4));--_focus-leading-icon-color: var(--md-filled-text-field-focus-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-supporting-text-color: var(--md-filled-text-field-focus-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-trailing-icon-color: var(--md-filled-text-field-focus-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-active-indicator-color: var(--md-filled-text-field-hover-active-indicator-color, var(--md-sys-color-on-surface, #1c1b1f));--_hover-active-indicator-height: var(--md-filled-text-field-hover-active-indicator-height, 1px);--_hover-input-text-color: var(--md-filled-text-field-hover-input-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_hover-label-text-color: var(--md-filled-text-field-hover-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-leading-icon-color: var(--md-filled-text-field-hover-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-state-layer-color: var(--md-filled-text-field-hover-state-layer-color, var(--md-sys-color-on-surface, #1c1b1f));--_hover-state-layer-opacity: var(--md-filled-text-field-hover-state-layer-opacity, 0.08);--_hover-supporting-text-color: var(--md-filled-text-field-hover-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-trailing-icon-color: var(--md-filled-text-field-hover-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_input-text-color: var(--md-filled-text-field-input-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_input-text-font: var(--md-filled-text-field-input-text-font, Roboto);--_input-text-line-height: var(--md-filled-text-field-input-text-line-height, 1.5rem);--_input-text-placeholder-color: var(--md-filled-text-field-input-text-placeholder-color, var(--md-sys-color-on-surface-variant, #49454f));--_input-text-prefix-color: var(--md-filled-text-field-input-text-prefix-color, var(--md-sys-color-on-surface-variant, #49454f));--_input-text-size: var(--md-filled-text-field-input-text-size, 1rem);--_input-text-suffix-color: var(--md-filled-text-field-input-text-suffix-color, var(--md-sys-color-on-surface-variant, #49454f));--_input-text-tracking: var(--md-filled-text-field-input-text-tracking, 0.031rem);--_input-text-type: var(--md-filled-text-field-input-text-type, 400 1rem / 1.5rem Roboto);--_input-text-weight: var(--md-filled-text-field-input-text-weight, 400);--_label-text-color: var(--md-filled-text-field-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_label-text-font: var(--md-filled-text-field-label-text-font, Roboto);--_label-text-line-height: var(--md-filled-text-field-label-text-line-height, 1.5rem);--_label-text-populated-line-height: var(--md-filled-text-field-label-text-populated-line-height, 1rem);--_label-text-populated-size: var(--md-filled-text-field-label-text-populated-size, 0.75rem);--_label-text-size: var(--md-filled-text-field-label-text-size, 1rem);--_label-text-tracking: var(--md-filled-text-field-label-text-tracking, 0.031rem);--_label-text-type: var(--md-filled-text-field-label-text-type, 400 1rem / 1.5rem Roboto);--_label-text-weight: var(--md-filled-text-field-label-text-weight, 400);--_leading-icon-color: var(--md-filled-text-field-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_leading-icon-size: var(--md-filled-text-field-leading-icon-size, 24px);--_supporting-text-color: var(--md-filled-text-field-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_supporting-text-font: var(--md-filled-text-field-supporting-text-font, Roboto);--_supporting-text-line-height: var(--md-filled-text-field-supporting-text-line-height, 1rem);--_supporting-text-size: var(--md-filled-text-field-supporting-text-size, 0.75rem);--_supporting-text-tracking: var(--md-filled-text-field-supporting-text-tracking, 0.025rem);--_supporting-text-type: var(--md-filled-text-field-supporting-text-type, 400 0.75rem / 1rem Roboto);--_supporting-text-weight: var(--md-filled-text-field-supporting-text-weight, 400);--_trailing-icon-color: var(--md-filled-text-field-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_trailing-icon-size: var(--md-filled-text-field-trailing-icon-size, 24px);--md-filled-field-container-shape-start-start:var(--_container-shape-start-start);--md-filled-field-container-shape-start-end:var(--_container-shape-start-end);--md-filled-field-container-shape-end-end:var(--_container-shape-end-end);--md-filled-field-container-shape-end-start:var(--_container-shape-end-start);--md-filled-field-active-indicator-color:var(--_active-indicator-color);--md-filled-field-active-indicator-height:var(--_active-indicator-height);--md-filled-field-container-color:var(--_container-color);--md-filled-field-container-padding-horizontal:var(--_container-padding-horizontal);--md-filled-field-container-padding-vertical:var(--_container-padding-vertical);--md-filled-field-content-color:var(--_input-text-color);--md-filled-field-disabled-active-indicator-color:var(--_disabled-active-indicator-color);--md-filled-field-disabled-active-indicator-height:var(--_disabled-active-indicator-height);--md-filled-field-disabled-active-indicator-opacity:var(--_disabled-active-indicator-opacity);--md-filled-field-disabled-container-color:var(--_disabled-container-color);--md-filled-field-disabled-container-opacity:var(--_disabled-container-opacity);--md-filled-field-disabled-content-color:var(--_disabled-input-text-color);--md-filled-field-disabled-content-opacity:var(--_disabled-input-text-opacity);--md-filled-field-disabled-label-text-color:var(--_disabled-label-text-color);--md-filled-field-disabled-label-text-opacity:var(--_disabled-label-text-opacity);--md-filled-field-disabled-leading-icon-color:var(--_disabled-leading-icon-color);--md-filled-field-disabled-leading-icon-opacity:var(--_disabled-leading-icon-opacity);--md-filled-field-disabled-supporting-text-color:var(--_disabled-supporting-text-color);--md-filled-field-disabled-supporting-text-opacity:var(--_disabled-supporting-text-opacity);--md-filled-field-disabled-trailing-icon-color:var(--_disabled-trailing-icon-color);--md-filled-field-disabled-trailing-icon-opacity:var(--_disabled-trailing-icon-opacity);--md-filled-field-error-active-indicator-color:var(--_error-active-indicator-color);--md-filled-field-error-focus-active-indicator-color:var(--_error-focus-active-indicator-color);--md-filled-field-error-focus-content-color:var(--_error-focus-input-text-color);--md-filled-field-error-focus-label-text-color:var(--_error-focus-label-text-color);--md-filled-field-error-focus-leading-icon-color:var(--_error-focus-leading-icon-color);--md-filled-field-error-focus-supporting-text-color:var(--_error-focus-supporting-text-color);--md-filled-field-error-focus-trailing-icon-color:var(--_error-focus-trailing-icon-color);--md-filled-field-error-hover-active-indicator-color:var(--_error-hover-active-indicator-color);--md-filled-field-error-hover-content-color:var(--_error-hover-input-text-color);--md-filled-field-error-hover-label-text-color:var(--_error-hover-label-text-color);--md-filled-field-error-hover-leading-icon-color:var(--_error-hover-leading-icon-color);--md-filled-field-error-hover-state-layer-color:var(--_error-hover-state-layer-color);--md-filled-field-error-hover-state-layer-opacity:var(--_error-hover-state-layer-opacity);--md-filled-field-error-hover-supporting-text-color:var(--_error-hover-supporting-text-color);--md-filled-field-error-hover-trailing-icon-color:var(--_error-hover-trailing-icon-color);--md-filled-field-error-content-color:var(--_error-input-text-color);--md-filled-field-error-label-text-color:var(--_error-label-text-color);--md-filled-field-error-leading-icon-color:var(--_error-leading-icon-color);--md-filled-field-error-supporting-text-color:var(--_error-supporting-text-color);--md-filled-field-error-trailing-icon-color:var(--_error-trailing-icon-color);--md-filled-field-focus-active-indicator-color:var(--_focus-active-indicator-color);--md-filled-field-focus-active-indicator-height:var(--_focus-active-indicator-height);--md-filled-field-focus-content-color:var(--_focus-input-text-color);--md-filled-field-focus-label-text-color:var(--_focus-label-text-color);--md-filled-field-focus-leading-icon-color:var(--_focus-leading-icon-color);--md-filled-field-focus-supporting-text-color:var(--_focus-supporting-text-color);--md-filled-field-focus-trailing-icon-color:var(--_focus-trailing-icon-color);--md-filled-field-hover-active-indicator-color:var(--_hover-active-indicator-color);--md-filled-field-hover-active-indicator-height:var(--_hover-active-indicator-height);--md-filled-field-hover-content-color:var(--_hover-input-text-color);--md-filled-field-hover-label-text-color:var(--_hover-label-text-color);--md-filled-field-hover-leading-icon-color:var(--_hover-leading-icon-color);--md-filled-field-hover-state-layer-color:var(--_hover-state-layer-color);--md-filled-field-hover-state-layer-opacity:var(--_hover-state-layer-opacity);--md-filled-field-hover-supporting-text-color:var(--_hover-supporting-text-color);--md-filled-field-hover-trailing-icon-color:var(--_hover-trailing-icon-color);--md-filled-field-label-text-color:var(--_label-text-color);--md-filled-field-label-text-font:var(--_label-text-font);--md-filled-field-label-text-line-height:var(--_label-text-line-height);--md-filled-field-label-text-populated-line-height:var(--_label-text-populated-line-height);--md-filled-field-label-text-populated-size:var(--_label-text-populated-size);--md-filled-field-label-text-size:var(--_label-text-size);--md-filled-field-label-text-tracking:var(--_label-text-tracking);--md-filled-field-label-text-weight:var(--_label-text-weight);--md-filled-field-leading-icon-color:var(--_leading-icon-color);--md-filled-field-leading-icon-size:var(--_leading-icon-size);--md-filled-field-supporting-text-color:var(--_supporting-text-color);--md-filled-field-supporting-text-font:var(--_supporting-text-font);--md-filled-field-supporting-text-line-height:var(--_supporting-text-line-height);--md-filled-field-supporting-text-size:var(--_supporting-text-size);--md-filled-field-supporting-text-tracking:var(--_supporting-text-tracking);--md-filled-field-supporting-text-weight:var(--_supporting-text-weight);--md-filled-field-trailing-icon-color:var(--_trailing-icon-color);--md-filled-field-trailing-icon-size:var(--_trailing-icon-size);--md-filled-field-with-label-container-padding-vertical:var(--_with-label-container-padding-vertical)}/*# sourceMappingURL=filled-styles.css.map */ +export const styles = css `:host{--_container-padding-horizontal: var(--md-filled-text-field-container-padding-horizontal, 16px);--_container-padding-vertical: var(--md-filled-text-field-container-padding-vertical, 16px);--_input-text-prefix-padding: var(--md-filled-text-field-input-text-prefix-padding, 2px);--_input-text-suffix-padding: var(--md-filled-text-field-input-text-suffix-padding, 2px);--_with-label-container-padding-vertical: var(--md-filled-text-field-with-label-container-padding-vertical, 8px);--_focus-caret-color: var(--md-filled-text-field-focus-caret-color, var(--md-sys-color-primary, #6750a4));--_active-indicator-color: var(--md-filled-text-field-active-indicator-color, var(--md-sys-color-on-surface-variant, #49454f));--_active-indicator-height: var(--md-filled-text-field-active-indicator-height, 1px);--_caret-color: var(--md-filled-text-field-caret-color, var(--md-sys-color-primary, #6750a4));--_container-color: var(--md-filled-text-field-container-color, var(--md-sys-color-surface-container-highest, #e6e0e9));--_container-shape-start-start: var( --md-filled-text-field-container-shape-start-start, var(--md-filled-text-field-container-shape, 4px) );--_container-shape-start-end: var( --md-filled-text-field-container-shape-start-end, var(--md-filled-text-field-container-shape, 4px) );--_container-shape-end-end: var( --md-filled-text-field-container-shape-end-end, var(--md-filled-text-field-container-shape, 0px) );--_container-shape-end-start: var( --md-filled-text-field-container-shape-end-start, var(--md-filled-text-field-container-shape, 0px) );--_disabled-active-indicator-color: var(--md-filled-text-field-disabled-active-indicator-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-active-indicator-height: var(--md-filled-text-field-disabled-active-indicator-height, 1px);--_disabled-active-indicator-opacity: var(--md-filled-text-field-disabled-active-indicator-opacity, 0.38);--_disabled-container-color: var(--md-filled-text-field-disabled-container-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-container-opacity: var(--md-filled-text-field-disabled-container-opacity, 0.04);--_disabled-input-text-color: var(--md-filled-text-field-disabled-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-input-text-opacity: var(--md-filled-text-field-disabled-input-text-opacity, 0.38);--_disabled-label-text-color: var(--md-filled-text-field-disabled-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-label-text-opacity: var(--md-filled-text-field-disabled-label-text-opacity, 0.38);--_disabled-leading-icon-color: var(--md-filled-text-field-disabled-leading-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-leading-icon-opacity: var(--md-filled-text-field-disabled-leading-icon-opacity, 0.38);--_disabled-supporting-text-color: var(--md-filled-text-field-disabled-supporting-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-supporting-text-opacity: var(--md-filled-text-field-disabled-supporting-text-opacity, 0.38);--_disabled-trailing-icon-color: var(--md-filled-text-field-disabled-trailing-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-trailing-icon-opacity: var(--md-filled-text-field-disabled-trailing-icon-opacity, 0.38);--_error-active-indicator-color: var(--md-filled-text-field-error-active-indicator-color, var(--md-sys-color-error, #b3261e));--_error-focus-active-indicator-color: var(--md-filled-text-field-error-focus-active-indicator-color, var(--md-sys-color-error, #b3261e));--_error-focus-caret-color: var(--md-filled-text-field-error-focus-caret-color, var(--md-sys-color-error, #b3261e));--_error-focus-input-text-color: var(--md-filled-text-field-error-focus-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_error-focus-label-text-color: var(--md-filled-text-field-error-focus-label-text-color, var(--md-sys-color-error, #b3261e));--_error-focus-leading-icon-color: var(--md-filled-text-field-error-focus-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-focus-supporting-text-color: var(--md-filled-text-field-error-focus-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-focus-trailing-icon-color: var(--md-filled-text-field-error-focus-trailing-icon-color, var(--md-sys-color-error, #b3261e));--_error-hover-active-indicator-color: var(--md-filled-text-field-error-hover-active-indicator-color, var(--md-sys-color-on-error-container, #410e0b));--_error-hover-input-text-color: var(--md-filled-text-field-error-hover-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_error-hover-label-text-color: var(--md-filled-text-field-error-hover-label-text-color, var(--md-sys-color-on-error-container, #410e0b));--_error-hover-leading-icon-color: var(--md-filled-text-field-error-hover-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-hover-state-layer-color: var(--md-filled-text-field-error-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_error-hover-state-layer-opacity: var(--md-filled-text-field-error-hover-state-layer-opacity, 0.08);--_error-hover-supporting-text-color: var(--md-filled-text-field-error-hover-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-hover-trailing-icon-color: var(--md-filled-text-field-error-hover-trailing-icon-color, var(--md-sys-color-on-error-container, #410e0b));--_error-input-text-color: var(--md-filled-text-field-error-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_error-label-text-color: var(--md-filled-text-field-error-label-text-color, var(--md-sys-color-error, #b3261e));--_error-leading-icon-color: var(--md-filled-text-field-error-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-supporting-text-color: var(--md-filled-text-field-error-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-trailing-icon-color: var(--md-filled-text-field-error-trailing-icon-color, var(--md-sys-color-error, #b3261e));--_focus-active-indicator-color: var(--md-filled-text-field-focus-active-indicator-color, var(--md-sys-color-primary, #6750a4));--_focus-active-indicator-height: var(--md-filled-text-field-focus-active-indicator-height, 2px);--_focus-input-text-color: var(--md-filled-text-field-focus-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_focus-label-text-color: var(--md-filled-text-field-focus-label-text-color, var(--md-sys-color-primary, #6750a4));--_focus-leading-icon-color: var(--md-filled-text-field-focus-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-supporting-text-color: var(--md-filled-text-field-focus-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-trailing-icon-color: var(--md-filled-text-field-focus-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-active-indicator-color: var(--md-filled-text-field-hover-active-indicator-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-active-indicator-height: var(--md-filled-text-field-hover-active-indicator-height, 1px);--_hover-input-text-color: var(--md-filled-text-field-hover-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-label-text-color: var(--md-filled-text-field-hover-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-leading-icon-color: var(--md-filled-text-field-hover-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-state-layer-color: var(--md-filled-text-field-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-state-layer-opacity: var(--md-filled-text-field-hover-state-layer-opacity, 0.08);--_hover-supporting-text-color: var(--md-filled-text-field-hover-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-trailing-icon-color: var(--md-filled-text-field-hover-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_input-text-color: var(--md-filled-text-field-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_input-text-placeholder-color: var(--md-filled-text-field-input-text-placeholder-color, var(--md-sys-color-on-surface-variant, #49454f));--_input-text-prefix-color: var(--md-filled-text-field-input-text-prefix-color, var(--md-sys-color-on-surface-variant, #49454f));--_input-text-suffix-color: var(--md-filled-text-field-input-text-suffix-color, var(--md-sys-color-on-surface-variant, #49454f));--_input-text-type: var(--md-filled-text-field-input-text-type, var(--md-sys-typescale-body-large, 400 1rem / 1.5rem var(--md-ref-typeface-plain, Roboto)));--_label-text-color: var(--md-filled-text-field-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_label-text-populated-line-height: var(--md-filled-text-field-label-text-populated-line-height, 1rem);--_label-text-populated-size: var(--md-filled-text-field-label-text-populated-size, 0.75rem);--_label-text-type: var(--md-filled-text-field-label-text-type, var(--md-sys-typescale-body-large, 400 1rem / 1.5rem var(--md-ref-typeface-plain, Roboto)));--_leading-icon-color: var(--md-filled-text-field-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_leading-icon-size: var(--md-filled-text-field-leading-icon-size, 24px);--_supporting-text-color: var(--md-filled-text-field-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_supporting-text-type: var(--md-filled-text-field-supporting-text-type, var(--md-sys-typescale-body-small, 400 0.75rem / 1rem var(--md-ref-typeface-plain, Roboto)));--_trailing-icon-color: var(--md-filled-text-field-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_trailing-icon-size: var(--md-filled-text-field-trailing-icon-size, 24px);--md-filled-field-active-indicator-color: var(--_active-indicator-color);--md-filled-field-active-indicator-height: var(--_active-indicator-height);--md-filled-field-container-color: var(--_container-color);--md-filled-field-container-padding-horizontal: var(--_container-padding-horizontal);--md-filled-field-container-padding-vertical: var(--_container-padding-vertical);--md-filled-field-container-shape-end-end: var(--_container-shape-end-end);--md-filled-field-container-shape-end-start: var(--_container-shape-end-start);--md-filled-field-container-shape-start-end: var(--_container-shape-start-end);--md-filled-field-container-shape-start-start: var(--_container-shape-start-start);--md-filled-field-content-color: var(--_input-text-color);--md-filled-field-content-type: var(--_input-text-type);--md-filled-field-disabled-active-indicator-color: var(--_disabled-active-indicator-color);--md-filled-field-disabled-active-indicator-height: var(--_disabled-active-indicator-height);--md-filled-field-disabled-active-indicator-opacity: var(--_disabled-active-indicator-opacity);--md-filled-field-disabled-container-color: var(--_disabled-container-color);--md-filled-field-disabled-container-opacity: var(--_disabled-container-opacity);--md-filled-field-disabled-content-color: var(--_disabled-input-text-color);--md-filled-field-disabled-content-opacity: var(--_disabled-input-text-opacity);--md-filled-field-disabled-label-text-color: var(--_disabled-label-text-color);--md-filled-field-disabled-label-text-opacity: var(--_disabled-label-text-opacity);--md-filled-field-disabled-leading-content-color: var(--_disabled-leading-icon-color);--md-filled-field-disabled-leading-content-opacity: var(--_disabled-leading-icon-opacity);--md-filled-field-disabled-supporting-text-color: var(--_disabled-supporting-text-color);--md-filled-field-disabled-supporting-text-opacity: var(--_disabled-supporting-text-opacity);--md-filled-field-disabled-trailing-content-color: var(--_disabled-trailing-icon-color);--md-filled-field-disabled-trailing-content-opacity: var(--_disabled-trailing-icon-opacity);--md-filled-field-error-active-indicator-color: var(--_error-active-indicator-color);--md-filled-field-error-content-color: var(--_error-input-text-color);--md-filled-field-error-focus-active-indicator-color: var(--_error-focus-active-indicator-color);--md-filled-field-error-focus-content-color: var(--_error-focus-input-text-color);--md-filled-field-error-focus-label-text-color: var(--_error-focus-label-text-color);--md-filled-field-error-focus-leading-content-color: var(--_error-focus-leading-icon-color);--md-filled-field-error-focus-supporting-text-color: var(--_error-focus-supporting-text-color);--md-filled-field-error-focus-trailing-content-color: var(--_error-focus-trailing-icon-color);--md-filled-field-error-hover-active-indicator-color: var(--_error-hover-active-indicator-color);--md-filled-field-error-hover-content-color: var(--_error-hover-input-text-color);--md-filled-field-error-hover-label-text-color: var(--_error-hover-label-text-color);--md-filled-field-error-hover-leading-content-color: var(--_error-hover-leading-icon-color);--md-filled-field-error-hover-state-layer-color: var(--_error-hover-state-layer-color);--md-filled-field-error-hover-state-layer-opacity: var(--_error-hover-state-layer-opacity);--md-filled-field-error-hover-supporting-text-color: var(--_error-hover-supporting-text-color);--md-filled-field-error-hover-trailing-content-color: var(--_error-hover-trailing-icon-color);--md-filled-field-error-label-text-color: var(--_error-label-text-color);--md-filled-field-error-leading-content-color: var(--_error-leading-icon-color);--md-filled-field-error-supporting-text-color: var(--_error-supporting-text-color);--md-filled-field-error-trailing-content-color: var(--_error-trailing-icon-color);--md-filled-field-focus-active-indicator-color: var(--_focus-active-indicator-color);--md-filled-field-focus-active-indicator-height: var(--_focus-active-indicator-height);--md-filled-field-focus-content-color: var(--_focus-input-text-color);--md-filled-field-focus-label-text-color: var(--_focus-label-text-color);--md-filled-field-focus-leading-content-color: var(--_focus-leading-icon-color);--md-filled-field-focus-supporting-text-color: var(--_focus-supporting-text-color);--md-filled-field-focus-trailing-content-color: var(--_focus-trailing-icon-color);--md-filled-field-hover-active-indicator-color: var(--_hover-active-indicator-color);--md-filled-field-hover-active-indicator-height: var(--_hover-active-indicator-height);--md-filled-field-hover-content-color: var(--_hover-input-text-color);--md-filled-field-hover-label-text-color: var(--_hover-label-text-color);--md-filled-field-hover-leading-content-color: var(--_hover-leading-icon-color);--md-filled-field-hover-state-layer-color: var(--_hover-state-layer-color);--md-filled-field-hover-state-layer-opacity: var(--_hover-state-layer-opacity);--md-filled-field-hover-supporting-text-color: var(--_hover-supporting-text-color);--md-filled-field-hover-trailing-content-color: var(--_hover-trailing-icon-color);--md-filled-field-label-text-color: var(--_label-text-color);--md-filled-field-label-text-populated-line-height: var(--_label-text-populated-line-height);--md-filled-field-label-text-populated-size: var(--_label-text-populated-size);--md-filled-field-label-text-type: var(--_label-text-type);--md-filled-field-leading-content-color: var(--_leading-icon-color);--md-filled-field-supporting-text-color: var(--_supporting-text-color);--md-filled-field-supporting-text-type: var(--_supporting-text-type);--md-filled-field-trailing-content-color: var(--_trailing-icon-color);--md-filled-field-with-label-container-padding-vertical: var(--_with-label-container-padding-vertical)}/*# sourceMappingURL=filled-styles.css.map */ `; //# sourceMappingURL=filled-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/textfield/lib/filled-text-field.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/textfield/lib/filled-text-field.d.ts index 0421d7d..4830c5e 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/textfield/lib/filled-text-field.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/textfield/lib/filled-text-field.d.ts
@@ -3,10 +3,11 @@ * Copyright 2021 Google LLC * SPDX-License-Identifier: Apache-2.0 */ -import { ClassInfo } from 'lit/directives/class-map.js'; +import '../../field/filled-field.js'; import { TextField } from './text-field.js'; -/** @soyCompatible */ -export declare abstract class FilledTextField extends TextField { - /** @soyTemplate */ - protected getRenderClasses(): ClassInfo; +/** + * A filled text field component. + */ +export declare class FilledTextField extends TextField { + protected readonly fieldTag: import("lit-html/static.js").StaticValue; }
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/textfield/lib/filled-text-field.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/textfield/lib/filled-text-field.js index 0f4cd1a..7673578 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/textfield/lib/filled-text-field.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/textfield/lib/filled-text-field.js
@@ -3,15 +3,16 @@ * Copyright 2021 Google LLC * SPDX-License-Identifier: Apache-2.0 */ +import '../../field/filled-field.js'; +import { literal } from 'lit/static-html.js'; import { TextField } from './text-field.js'; -/** @soyCompatible */ +/** + * A filled text field component. + */ export class FilledTextField extends TextField { - /** @soyTemplate */ - getRenderClasses() { - return { - ...super.getRenderClasses(), - 'md3-text-field--filled': true, - }; + constructor() { + super(...arguments); + this.fieldTag = literal `md-filled-field`; } } //# sourceMappingURL=filled-text-field.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/textfield/lib/outlined-forced-colors-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/textfield/lib/outlined-forced-colors-styles.css.js index fbe810d..a1951d4 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/textfield/lib/outlined-forced-colors-styles.css.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/textfield/lib/outlined-forced-colors-styles.css.js
@@ -4,6 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ import { css } from 'lit'; -export const styles = css `@media(forced-colors: active){:host{--md-outlined-text-field-disabled-input-text-color:GrayText;--md-outlined-text-field-disabled-input-text-opacity:1;--md-outlined-text-field-disabled-label-text-color:GrayText;--md-outlined-text-field-disabled-label-text-opacity:1;--md-outlined-text-field-disabled-leading-icon-color:GrayText;--md-outlined-text-field-disabled-leading-icon-opacity:1;--md-outlined-text-field-disabled-outline-color:GrayText;--md-outlined-text-field-disabled-outline-opacity:1;--md-outlined-text-field-disabled-supporting-text-color:GrayText;--md-outlined-text-field-disabled-supporting-text-opacity:1;--md-outlined-text-field-disabled-trailing-icon-color:GrayText;--md-outlined-text-field-disabled-trailing-icon-opacity:1}}/*# sourceMappingURL=outlined-forced-colors-styles.css.map */ +export const styles = css `@media(forced-colors: active){:host{--md-outlined-text-field-disabled-input-text-color: GrayText;--md-outlined-text-field-disabled-input-text-opacity: 1;--md-outlined-text-field-disabled-label-text-color: GrayText;--md-outlined-text-field-disabled-label-text-opacity: 1;--md-outlined-text-field-disabled-leading-icon-color: GrayText;--md-outlined-text-field-disabled-leading-icon-opacity: 1;--md-outlined-text-field-disabled-outline-color: GrayText;--md-outlined-text-field-disabled-outline-opacity: 1;--md-outlined-text-field-disabled-supporting-text-color: GrayText;--md-outlined-text-field-disabled-supporting-text-opacity: 1;--md-outlined-text-field-disabled-trailing-icon-color: GrayText;--md-outlined-text-field-disabled-trailing-icon-opacity: 1}}/*# sourceMappingURL=outlined-forced-colors-styles.css.map */ `; //# sourceMappingURL=outlined-forced-colors-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/textfield/lib/outlined-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/textfield/lib/outlined-styles.css.js index 16cadcd..e8ae44b 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/textfield/lib/outlined-styles.css.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/textfield/lib/outlined-styles.css.js
@@ -4,6 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ import { css } from 'lit'; -export const styles = css `:host{--_container-shape-start-start: var(--md-outlined-text-field-container-shape-start-start, 4px);--_container-shape-start-end: var(--md-outlined-text-field-container-shape-start-end, 4px);--_container-shape-end-end: var(--md-outlined-text-field-container-shape-end-end, 4px);--_container-shape-end-start: var(--md-outlined-text-field-container-shape-end-start, 4px);--_container-padding-horizontal: var(--md-outlined-text-field-container-padding-horizontal, 16px);--_container-padding-vertical: var(--md-outlined-text-field-container-padding-vertical, 16px);--_input-text-prefix-padding: var(--md-outlined-text-field-input-text-prefix-padding, 2px);--_input-text-suffix-padding: var(--md-outlined-text-field-input-text-suffix-padding, 2px);--_outline-label-padding: var(--md-outlined-text-field-outline-label-padding, 4px);--_caret-color: var(--md-outlined-text-field-caret-color, var(--md-sys-color-primary, #6750a4));--_disabled-input-text-color: var(--md-outlined-text-field-disabled-input-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-input-text-opacity: var(--md-outlined-text-field-disabled-input-text-opacity, 0.38);--_disabled-label-text-color: var(--md-outlined-text-field-disabled-label-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-label-text-opacity: var(--md-outlined-text-field-disabled-label-text-opacity, 0.38);--_disabled-leading-icon-color: var(--md-outlined-text-field-disabled-leading-icon-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-leading-icon-opacity: var(--md-outlined-text-field-disabled-leading-icon-opacity, 0.38);--_disabled-outline-color: var(--md-outlined-text-field-disabled-outline-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-outline-opacity: var(--md-outlined-text-field-disabled-outline-opacity, 0.12);--_disabled-outline-width: var(--md-outlined-text-field-disabled-outline-width, 1px);--_disabled-supporting-text-color: var(--md-outlined-text-field-disabled-supporting-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-supporting-text-opacity: var(--md-outlined-text-field-disabled-supporting-text-opacity, 0.38);--_disabled-trailing-icon-color: var(--md-outlined-text-field-disabled-trailing-icon-color, var(--md-sys-color-on-surface, #1c1b1f));--_disabled-trailing-icon-opacity: var(--md-outlined-text-field-disabled-trailing-icon-opacity, 0.38);--_error-focus-caret-color: var(--md-outlined-text-field-error-focus-caret-color, var(--md-sys-color-error, #b3261e));--_error-focus-input-text-color: var(--md-outlined-text-field-error-focus-input-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_error-focus-label-text-color: var(--md-outlined-text-field-error-focus-label-text-color, var(--md-sys-color-error, #b3261e));--_error-focus-leading-icon-color: var(--md-outlined-text-field-error-focus-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-focus-outline-color: var(--md-outlined-text-field-error-focus-outline-color, var(--md-sys-color-error, #b3261e));--_error-focus-supporting-text-color: var(--md-outlined-text-field-error-focus-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-focus-trailing-icon-color: var(--md-outlined-text-field-error-focus-trailing-icon-color, var(--md-sys-color-error, #b3261e));--_error-hover-input-text-color: var(--md-outlined-text-field-error-hover-input-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_error-hover-label-text-color: var(--md-outlined-text-field-error-hover-label-text-color, var(--md-sys-color-on-error-container, #410e0b));--_error-hover-leading-icon-color: var(--md-outlined-text-field-error-hover-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-hover-outline-color: var(--md-outlined-text-field-error-hover-outline-color, var(--md-sys-color-on-error-container, #410e0b));--_error-hover-supporting-text-color: var(--md-outlined-text-field-error-hover-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-hover-trailing-icon-color: var(--md-outlined-text-field-error-hover-trailing-icon-color, var(--md-sys-color-on-error-container, #410e0b));--_error-input-text-color: var(--md-outlined-text-field-error-input-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_error-label-text-color: var(--md-outlined-text-field-error-label-text-color, var(--md-sys-color-error, #b3261e));--_error-leading-icon-color: var(--md-outlined-text-field-error-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-outline-color: var(--md-outlined-text-field-error-outline-color, var(--md-sys-color-error, #b3261e));--_error-supporting-text-color: var(--md-outlined-text-field-error-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-trailing-icon-color: var(--md-outlined-text-field-error-trailing-icon-color, var(--md-sys-color-error, #b3261e));--_focus-input-text-color: var(--md-outlined-text-field-focus-input-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_focus-label-text-color: var(--md-outlined-text-field-focus-label-text-color, var(--md-sys-color-primary, #6750a4));--_focus-leading-icon-color: var(--md-outlined-text-field-focus-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-outline-color: var(--md-outlined-text-field-focus-outline-color, var(--md-sys-color-primary, #6750a4));--_focus-outline-width: var(--md-outlined-text-field-focus-outline-width, 2px);--_focus-supporting-text-color: var(--md-outlined-text-field-focus-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-trailing-icon-color: var(--md-outlined-text-field-focus-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-input-text-color: var(--md-outlined-text-field-hover-input-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_hover-label-text-color: var(--md-outlined-text-field-hover-label-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_hover-leading-icon-color: var(--md-outlined-text-field-hover-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-outline-color: var(--md-outlined-text-field-hover-outline-color, var(--md-sys-color-on-surface, #1c1b1f));--_hover-outline-width: var(--md-outlined-text-field-hover-outline-width, 1px);--_hover-supporting-text-color: var(--md-outlined-text-field-hover-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-trailing-icon-color: var(--md-outlined-text-field-hover-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_input-text-color: var(--md-outlined-text-field-input-text-color, var(--md-sys-color-on-surface, #1c1b1f));--_input-text-font: var(--md-outlined-text-field-input-text-font, Roboto);--_input-text-line-height: var(--md-outlined-text-field-input-text-line-height, 1.5rem);--_input-text-placeholder-color: var(--md-outlined-text-field-input-text-placeholder-color, var(--md-sys-color-on-surface-variant, #49454f));--_input-text-prefix-color: var(--md-outlined-text-field-input-text-prefix-color, var(--md-sys-color-on-surface-variant, #49454f));--_input-text-size: var(--md-outlined-text-field-input-text-size, 1rem);--_input-text-suffix-color: var(--md-outlined-text-field-input-text-suffix-color, var(--md-sys-color-on-surface-variant, #49454f));--_input-text-tracking: var(--md-outlined-text-field-input-text-tracking, 0.031rem);--_input-text-type: var(--md-outlined-text-field-input-text-type, 400 1rem / 1.5rem Roboto);--_input-text-weight: var(--md-outlined-text-field-input-text-weight, 400);--_label-text-color: var(--md-outlined-text-field-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_label-text-font: var(--md-outlined-text-field-label-text-font, Roboto);--_label-text-line-height: var(--md-outlined-text-field-label-text-line-height, 1.5rem);--_label-text-populated-line-height: var(--md-outlined-text-field-label-text-populated-line-height, 1rem);--_label-text-populated-size: var(--md-outlined-text-field-label-text-populated-size, 0.75rem);--_label-text-size: var(--md-outlined-text-field-label-text-size, 1rem);--_label-text-tracking: var(--md-outlined-text-field-label-text-tracking, 0.031rem);--_label-text-type: var(--md-outlined-text-field-label-text-type, 400 1rem / 1.5rem Roboto);--_label-text-weight: var(--md-outlined-text-field-label-text-weight, 400);--_leading-icon-color: var(--md-outlined-text-field-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_leading-icon-size: var(--md-outlined-text-field-leading-icon-size, 24px);--_outline-color: var(--md-outlined-text-field-outline-color, var(--md-sys-color-outline, #79747e));--_outline-width: var(--md-outlined-text-field-outline-width, 1px);--_supporting-text-color: var(--md-outlined-text-field-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_supporting-text-font: var(--md-outlined-text-field-supporting-text-font, Roboto);--_supporting-text-line-height: var(--md-outlined-text-field-supporting-text-line-height, 1rem);--_supporting-text-size: var(--md-outlined-text-field-supporting-text-size, 0.75rem);--_supporting-text-tracking: var(--md-outlined-text-field-supporting-text-tracking, 0.025rem);--_supporting-text-type: var(--md-outlined-text-field-supporting-text-type, 400 0.75rem / 1rem Roboto);--_supporting-text-weight: var(--md-outlined-text-field-supporting-text-weight, 400);--_trailing-icon-color: var(--md-outlined-text-field-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_trailing-icon-size: var(--md-outlined-text-field-trailing-icon-size, 24px);--md-outlined-field-container-shape-start-start:var(--_container-shape-start-start);--md-outlined-field-container-shape-start-end:var(--_container-shape-start-end);--md-outlined-field-container-shape-end-end:var(--_container-shape-end-end);--md-outlined-field-container-shape-end-start:var(--_container-shape-end-start);--md-outlined-field-container-padding-horizontal:var(--_container-padding-horizontal);--md-outlined-field-container-padding-vertical:var(--_container-padding-vertical);--md-outlined-field-disabled-content-color:var(--_disabled-input-text-color);--md-outlined-field-disabled-content-opacity:var(--_disabled-input-text-opacity);--md-outlined-field-disabled-label-text-color:var(--_disabled-label-text-color);--md-outlined-field-disabled-label-text-opacity:var(--_disabled-label-text-opacity);--md-outlined-field-disabled-leading-icon-color:var(--_disabled-leading-icon-color);--md-outlined-field-disabled-leading-icon-opacity:var(--_disabled-leading-icon-opacity);--md-outlined-field-disabled-outline-color:var(--_disabled-outline-color);--md-outlined-field-disabled-outline-opacity:var(--_disabled-outline-opacity);--md-outlined-field-disabled-outline-width:var(--_disabled-outline-width);--md-outlined-field-disabled-supporting-text-color:var(--_disabled-supporting-text-color);--md-outlined-field-disabled-supporting-text-opacity:var(--_disabled-supporting-text-opacity);--md-outlined-field-disabled-trailing-icon-color:var(--_disabled-trailing-icon-color);--md-outlined-field-disabled-trailing-icon-opacity:var(--_disabled-trailing-icon-opacity);--md-outlined-field-error-focus-content-color:var(--_error-focus-input-text-color);--md-outlined-field-error-focus-label-text-color:var(--_error-focus-label-text-color);--md-outlined-field-error-focus-leading-icon-color:var(--_error-focus-leading-icon-color);--md-outlined-field-error-focus-outline-color:var(--_error-focus-outline-color);--md-outlined-field-error-focus-supporting-text-color:var(--_error-focus-supporting-text-color);--md-outlined-field-error-focus-trailing-icon-color:var(--_error-focus-trailing-icon-color);--md-outlined-field-error-hover-content-color:var(--_error-hover-input-text-color);--md-outlined-field-error-hover-label-text-color:var(--_error-hover-label-text-color);--md-outlined-field-error-hover-leading-icon-color:var(--_error-hover-leading-icon-color);--md-outlined-field-error-hover-outline-color:var(--_error-hover-outline-color);--md-outlined-field-error-hover-supporting-text-color:var(--_error-hover-supporting-text-color);--md-outlined-field-error-hover-trailing-icon-color:var(--_error-hover-trailing-icon-color);--md-outlined-field-error-content-color:var(--_error-input-text-color);--md-outlined-field-error-label-text-color:var(--_error-label-text-color);--md-outlined-field-error-leading-icon-color:var(--_error-leading-icon-color);--md-outlined-field-error-outline-color:var(--_error-outline-color);--md-outlined-field-error-supporting-text-color:var(--_error-supporting-text-color);--md-outlined-field-error-trailing-icon-color:var(--_error-trailing-icon-color);--md-outlined-field-focus-content-color:var(--_focus-input-text-color);--md-outlined-field-focus-label-text-color:var(--_focus-label-text-color);--md-outlined-field-focus-leading-icon-color:var(--_focus-leading-icon-color);--md-outlined-field-focus-outline-color:var(--_focus-outline-color);--md-outlined-field-focus-outline-width:var(--_focus-outline-width);--md-outlined-field-focus-supporting-text-color:var(--_focus-supporting-text-color);--md-outlined-field-focus-trailing-icon-color:var(--_focus-trailing-icon-color);--md-outlined-field-hover-content-color:var(--_hover-input-text-color);--md-outlined-field-hover-label-text-color:var(--_hover-label-text-color);--md-outlined-field-hover-leading-icon-color:var(--_hover-leading-icon-color);--md-outlined-field-hover-outline-color:var(--_hover-outline-color);--md-outlined-field-hover-outline-width:var(--_hover-outline-width);--md-outlined-field-hover-supporting-text-color:var(--_hover-supporting-text-color);--md-outlined-field-hover-trailing-icon-color:var(--_hover-trailing-icon-color);--md-outlined-field-content-color:var(--_input-text-color);--md-outlined-field-label-text-color:var(--_label-text-color);--md-outlined-field-label-text-font:var(--_label-text-font);--md-outlined-field-label-text-line-height:var(--_label-text-line-height);--md-outlined-field-label-text-padding-bottom:var(--_label-text-padding-bottom);--md-outlined-field-label-text-populated-line-height:var(--_label-text-populated-line-height);--md-outlined-field-label-text-populated-size:var(--_label-text-populated-size);--md-outlined-field-label-text-size:var(--_label-text-size);--md-outlined-field-label-text-tracking:var(--_label-text-tracking);--md-outlined-field-label-text-weight:var(--_label-text-weight);--md-outlined-field-leading-icon-color:var(--_leading-icon-color);--md-outlined-field-leading-icon-size:var(--_leading-icon-size);--md-outlined-field-outline-color:var(--_outline-color);--md-outlined-field-outline-width:var(--_outline-width);--md-outlined-field-supporting-text-color:var(--_supporting-text-color);--md-outlined-field-supporting-text-font:var(--_supporting-text-font);--md-outlined-field-supporting-text-line-height:var(--_supporting-text-line-height);--md-outlined-field-supporting-text-size:var(--_supporting-text-size);--md-outlined-field-supporting-text-tracking:var(--_supporting-text-tracking);--md-outlined-field-supporting-text-weight:var(--_supporting-text-weight);--md-outlined-field-trailing-icon-color:var(--_trailing-icon-color);--md-outlined-field-trailing-icon-size:var(--_trailing-icon-size)}/*# sourceMappingURL=outlined-styles.css.map */ +export const styles = css `:host{--_container-padding-horizontal: var(--md-outlined-text-field-container-padding-horizontal, 16px);--_container-padding-vertical: var(--md-outlined-text-field-container-padding-vertical, 16px);--_input-text-prefix-padding: var(--md-outlined-text-field-input-text-prefix-padding, 2px);--_input-text-suffix-padding: var(--md-outlined-text-field-input-text-suffix-padding, 2px);--_focus-caret-color: var(--md-outlined-text-field-focus-caret-color, var(--md-sys-color-primary, #6750a4));--_caret-color: var(--md-outlined-text-field-caret-color, var(--md-sys-color-primary, #6750a4));--_container-shape: var(--md-outlined-text-field-container-shape, 4px);--_disabled-input-text-color: var(--md-outlined-text-field-disabled-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-input-text-opacity: var(--md-outlined-text-field-disabled-input-text-opacity, 0.38);--_disabled-label-text-color: var(--md-outlined-text-field-disabled-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-label-text-opacity: var(--md-outlined-text-field-disabled-label-text-opacity, 0.38);--_disabled-leading-icon-color: var(--md-outlined-text-field-disabled-leading-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-leading-icon-opacity: var(--md-outlined-text-field-disabled-leading-icon-opacity, 0.38);--_disabled-outline-color: var(--md-outlined-text-field-disabled-outline-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-outline-opacity: var(--md-outlined-text-field-disabled-outline-opacity, 0.12);--_disabled-outline-width: var(--md-outlined-text-field-disabled-outline-width, 1px);--_disabled-supporting-text-color: var(--md-outlined-text-field-disabled-supporting-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-supporting-text-opacity: var(--md-outlined-text-field-disabled-supporting-text-opacity, 0.38);--_disabled-trailing-icon-color: var(--md-outlined-text-field-disabled-trailing-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-trailing-icon-opacity: var(--md-outlined-text-field-disabled-trailing-icon-opacity, 0.38);--_error-focus-caret-color: var(--md-outlined-text-field-error-focus-caret-color, var(--md-sys-color-error, #b3261e));--_error-focus-input-text-color: var(--md-outlined-text-field-error-focus-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_error-focus-label-text-color: var(--md-outlined-text-field-error-focus-label-text-color, var(--md-sys-color-error, #b3261e));--_error-focus-leading-icon-color: var(--md-outlined-text-field-error-focus-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-focus-outline-color: var(--md-outlined-text-field-error-focus-outline-color, var(--md-sys-color-error, #b3261e));--_error-focus-supporting-text-color: var(--md-outlined-text-field-error-focus-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-focus-trailing-icon-color: var(--md-outlined-text-field-error-focus-trailing-icon-color, var(--md-sys-color-error, #b3261e));--_error-hover-input-text-color: var(--md-outlined-text-field-error-hover-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_error-hover-label-text-color: var(--md-outlined-text-field-error-hover-label-text-color, var(--md-sys-color-on-error-container, #410e0b));--_error-hover-leading-icon-color: var(--md-outlined-text-field-error-hover-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-hover-outline-color: var(--md-outlined-text-field-error-hover-outline-color, var(--md-sys-color-on-error-container, #410e0b));--_error-hover-supporting-text-color: var(--md-outlined-text-field-error-hover-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-hover-trailing-icon-color: var(--md-outlined-text-field-error-hover-trailing-icon-color, var(--md-sys-color-on-error-container, #410e0b));--_error-input-text-color: var(--md-outlined-text-field-error-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_error-label-text-color: var(--md-outlined-text-field-error-label-text-color, var(--md-sys-color-error, #b3261e));--_error-leading-icon-color: var(--md-outlined-text-field-error-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_error-outline-color: var(--md-outlined-text-field-error-outline-color, var(--md-sys-color-error, #b3261e));--_error-supporting-text-color: var(--md-outlined-text-field-error-supporting-text-color, var(--md-sys-color-error, #b3261e));--_error-trailing-icon-color: var(--md-outlined-text-field-error-trailing-icon-color, var(--md-sys-color-error, #b3261e));--_focus-input-text-color: var(--md-outlined-text-field-focus-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_focus-label-text-color: var(--md-outlined-text-field-focus-label-text-color, var(--md-sys-color-primary, #6750a4));--_focus-leading-icon-color: var(--md-outlined-text-field-focus-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-outline-color: var(--md-outlined-text-field-focus-outline-color, var(--md-sys-color-primary, #6750a4));--_focus-outline-width: var(--md-outlined-text-field-focus-outline-width, 2px);--_focus-supporting-text-color: var(--md-outlined-text-field-focus-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-trailing-icon-color: var(--md-outlined-text-field-focus-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-input-text-color: var(--md-outlined-text-field-hover-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-label-text-color: var(--md-outlined-text-field-hover-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-leading-icon-color: var(--md-outlined-text-field-hover-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-outline-color: var(--md-outlined-text-field-hover-outline-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-outline-width: var(--md-outlined-text-field-hover-outline-width, 1px);--_hover-supporting-text-color: var(--md-outlined-text-field-hover-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-trailing-icon-color: var(--md-outlined-text-field-hover-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_input-text-color: var(--md-outlined-text-field-input-text-color, var(--md-sys-color-on-surface, #1d1b20));--_input-text-placeholder-color: var(--md-outlined-text-field-input-text-placeholder-color, var(--md-sys-color-on-surface-variant, #49454f));--_input-text-prefix-color: var(--md-outlined-text-field-input-text-prefix-color, var(--md-sys-color-on-surface-variant, #49454f));--_input-text-suffix-color: var(--md-outlined-text-field-input-text-suffix-color, var(--md-sys-color-on-surface-variant, #49454f));--_input-text-type: var(--md-outlined-text-field-input-text-type, var(--md-sys-typescale-body-large, 400 1rem / 1.5rem var(--md-ref-typeface-plain, Roboto)));--_label-text-color: var(--md-outlined-text-field-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_label-text-populated-line-height: var(--md-outlined-text-field-label-text-populated-line-height, 1rem);--_label-text-populated-size: var(--md-outlined-text-field-label-text-populated-size, 0.75rem);--_label-text-type: var(--md-outlined-text-field-label-text-type, var(--md-sys-typescale-body-large, 400 1rem / 1.5rem var(--md-ref-typeface-plain, Roboto)));--_leading-icon-color: var(--md-outlined-text-field-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_leading-icon-size: var(--md-outlined-text-field-leading-icon-size, 24px);--_outline-color: var(--md-outlined-text-field-outline-color, var(--md-sys-color-outline, #79747e));--_outline-width: var(--md-outlined-text-field-outline-width, 1px);--_supporting-text-color: var(--md-outlined-text-field-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_supporting-text-type: var(--md-outlined-text-field-supporting-text-type, var(--md-sys-typescale-body-small, 400 0.75rem / 1rem var(--md-ref-typeface-plain, Roboto)));--_trailing-icon-color: var(--md-outlined-text-field-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_trailing-icon-size: var(--md-outlined-text-field-trailing-icon-size, 24px);--_container-shape-start-start: var( --md-outlined-text-field-container-shape-start-start, var(--_container-shape) );--_container-shape-start-end: var( --md-outlined-text-field-container-shape-start-end, var(--_container-shape) );--_container-shape-end-end: var( --md-outlined-text-field-container-shape-end-end, var(--_container-shape) );--_container-shape-end-start: var( --md-outlined-text-field-container-shape-end-start, var(--_container-shape) );--md-outlined-field-container-padding-horizontal: var(--_container-padding-horizontal);--md-outlined-field-container-padding-vertical: var(--_container-padding-vertical);--md-outlined-field-container-shape-end-end: var(--_container-shape-end-end);--md-outlined-field-container-shape-end-start: var(--_container-shape-end-start);--md-outlined-field-container-shape-start-end: var(--_container-shape-start-end);--md-outlined-field-container-shape-start-start: var(--_container-shape-start-start);--md-outlined-field-content-color: var(--_input-text-color);--md-outlined-field-content-type: var(--_input-text-type);--md-outlined-field-disabled-content-color: var(--_disabled-input-text-color);--md-outlined-field-disabled-content-opacity: var(--_disabled-input-text-opacity);--md-outlined-field-disabled-label-text-color: var(--_disabled-label-text-color);--md-outlined-field-disabled-label-text-opacity: var(--_disabled-label-text-opacity);--md-outlined-field-disabled-leading-content-color: var(--_disabled-leading-icon-color);--md-outlined-field-disabled-leading-content-opacity: var(--_disabled-leading-icon-opacity);--md-outlined-field-disabled-outline-color: var(--_disabled-outline-color);--md-outlined-field-disabled-outline-opacity: var(--_disabled-outline-opacity);--md-outlined-field-disabled-outline-width: var(--_disabled-outline-width);--md-outlined-field-disabled-supporting-text-color: var(--_disabled-supporting-text-color);--md-outlined-field-disabled-supporting-text-opacity: var(--_disabled-supporting-text-opacity);--md-outlined-field-disabled-trailing-content-color: var(--_disabled-trailing-icon-color);--md-outlined-field-disabled-trailing-content-opacity: var(--_disabled-trailing-icon-opacity);--md-outlined-field-error-content-color: var(--_error-input-text-color);--md-outlined-field-error-focus-content-color: var(--_error-focus-input-text-color);--md-outlined-field-error-focus-label-text-color: var(--_error-focus-label-text-color);--md-outlined-field-error-focus-leading-content-color: var(--_error-focus-leading-icon-color);--md-outlined-field-error-focus-outline-color: var(--_error-focus-outline-color);--md-outlined-field-error-focus-supporting-text-color: var(--_error-focus-supporting-text-color);--md-outlined-field-error-focus-trailing-content-color: var(--_error-focus-trailing-icon-color);--md-outlined-field-error-hover-content-color: var(--_error-hover-input-text-color);--md-outlined-field-error-hover-label-text-color: var(--_error-hover-label-text-color);--md-outlined-field-error-hover-leading-content-color: var(--_error-hover-leading-icon-color);--md-outlined-field-error-hover-outline-color: var(--_error-hover-outline-color);--md-outlined-field-error-hover-supporting-text-color: var(--_error-hover-supporting-text-color);--md-outlined-field-error-hover-trailing-content-color: var(--_error-hover-trailing-icon-color);--md-outlined-field-error-label-text-color: var(--_error-label-text-color);--md-outlined-field-error-leading-content-color: var(--_error-leading-icon-color);--md-outlined-field-error-outline-color: var(--_error-outline-color);--md-outlined-field-error-supporting-text-color: var(--_error-supporting-text-color);--md-outlined-field-error-trailing-content-color: var(--_error-trailing-icon-color);--md-outlined-field-focus-content-color: var(--_focus-input-text-color);--md-outlined-field-focus-label-text-color: var(--_focus-label-text-color);--md-outlined-field-focus-leading-content-color: var(--_focus-leading-icon-color);--md-outlined-field-focus-outline-color: var(--_focus-outline-color);--md-outlined-field-focus-outline-width: var(--_focus-outline-width);--md-outlined-field-focus-supporting-text-color: var(--_focus-supporting-text-color);--md-outlined-field-focus-trailing-content-color: var(--_focus-trailing-icon-color);--md-outlined-field-hover-content-color: var(--_hover-input-text-color);--md-outlined-field-hover-label-text-color: var(--_hover-label-text-color);--md-outlined-field-hover-leading-content-color: var(--_hover-leading-icon-color);--md-outlined-field-hover-outline-color: var(--_hover-outline-color);--md-outlined-field-hover-outline-width: var(--_hover-outline-width);--md-outlined-field-hover-supporting-text-color: var(--_hover-supporting-text-color);--md-outlined-field-hover-trailing-content-color: var(--_hover-trailing-icon-color);--md-outlined-field-label-text-color: var(--_label-text-color);--md-outlined-field-label-text-populated-line-height: var(--_label-text-populated-line-height);--md-outlined-field-label-text-populated-size: var(--_label-text-populated-size);--md-outlined-field-label-text-type: var(--_label-text-type);--md-outlined-field-leading-content-color: var(--_leading-icon-color);--md-outlined-field-outline-color: var(--_outline-color);--md-outlined-field-outline-width: var(--_outline-width);--md-outlined-field-supporting-text-color: var(--_supporting-text-color);--md-outlined-field-supporting-text-type: var(--_supporting-text-type);--md-outlined-field-trailing-content-color: var(--_trailing-icon-color)}/*# sourceMappingURL=outlined-styles.css.map */ `; //# sourceMappingURL=outlined-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/textfield/lib/outlined-text-field.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/textfield/lib/outlined-text-field.d.ts index e77fc9c..518172a 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/textfield/lib/outlined-text-field.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/textfield/lib/outlined-text-field.d.ts
@@ -3,10 +3,11 @@ * Copyright 2021 Google LLC * SPDX-License-Identifier: Apache-2.0 */ -import { ClassInfo } from 'lit/directives/class-map.js'; +import '../../field/outlined-field.js'; import { TextField } from './text-field.js'; -/** @soyCompatible */ -export declare abstract class OutlinedTextField extends TextField { - /** @soyTemplate */ - protected getRenderClasses(): ClassInfo; +/** + * An outlined text field component + */ +export declare class OutlinedTextField extends TextField { + protected readonly fieldTag: import("lit-html/static.js").StaticValue; }
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/textfield/lib/outlined-text-field.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/textfield/lib/outlined-text-field.js index 8947bae..f4be26d 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/textfield/lib/outlined-text-field.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/textfield/lib/outlined-text-field.js
@@ -3,15 +3,16 @@ * Copyright 2021 Google LLC * SPDX-License-Identifier: Apache-2.0 */ +import '../../field/outlined-field.js'; +import { literal } from 'lit/static-html.js'; import { TextField } from './text-field.js'; -/** @soyCompatible */ +/** + * An outlined text field component + */ export class OutlinedTextField extends TextField { - /** @soyTemplate */ - getRenderClasses() { - return { - ...super.getRenderClasses(), - 'md3-text-field--outlined': true, - }; + constructor() { + super(...arguments); + this.fieldTag = literal `md-outlined-field`; } } //# sourceMappingURL=outlined-text-field.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/textfield/lib/shared-styles.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/textfield/lib/shared-styles.css.js index ecd4bc4..979e6d7 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/textfield/lib/shared-styles.css.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/textfield/lib/shared-styles.css.js
@@ -4,6 +4,6 @@ * SPDX-License-Identifier: Apache-2.0 */ import { css } from 'lit'; -export const styles = css `:host{display:inline-flex;outline:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.md3-text-field{display:inline-flex;flex:1}.md3-text-field__field{cursor:text;flex:1}.md3-text-field--disabled .md3-text-field__field{cursor:default}.md3-text-field__counter{white-space:nowrap}.md3-text-field__icon{display:flex}.md3-text-field__icon ::slotted(*){display:flex}.md3-text-field__icon--leading{color:var(--_leading-icon-color)}.md3-text-field__icon--trailing{color:var(--_trailing-icon-color)}:hover .md3-text-field__icon--leading{color:var(--_hover-leading-icon-color)}:hover .md3-text-field__icon--trailing{color:var(--_hover-trailing-icon-color)}:focus-within .md3-text-field__icon--leading{color:var(--_focus-leading-icon-color)}:focus-within .md3-text-field__icon--trailing{color:var(--_focus-trailing-icon-color)}.md3-text-field--disabled .md3-text-field__icon--leading{color:var(--_disabled-leading-icon-color);opacity:var(--_disabled-leading-icon-opacity)}.md3-text-field--disabled .md3-text-field__icon--trailing{color:var(--_disabled-trailing-icon-color);opacity:var(--_disabled-trailing-icon-opacity)}.md3-text-field--error:not(.md3-text-field--disabled) .md3-text-field__icon--leading{color:var(--_error-leading-icon-color)}.md3-text-field--error:not(.md3-text-field--disabled) .md3-text-field__icon--trailing{color:var(--_error-trailing-icon-color)}.md3-text-field--error:not(.md3-text-field--disabled):hover .md3-text-field__icon--leading{color:var(--_error-hover-leading-icon-color)}.md3-text-field--error:not(.md3-text-field--disabled):hover .md3-text-field__icon--trailing{color:var(--_error-hover-trailing-icon-color)}.md3-text-field--error:not(.md3-text-field--disabled):focus-within .md3-text-field__icon--leading{color:var(--_error-focus-leading-icon-color)}.md3-text-field--error:not(.md3-text-field--disabled):focus-within .md3-text-field__icon--trailing{color:var(--_error-focus-trailing-icon-color)}.md3-text-field__input{appearance:none;background:none;border:none;caret-color:var(--_caret-color);color:currentColor;outline:none;padding:0;text-align:inherit;width:100%}.md3-text-field__input::placeholder{color:currentColor;opacity:1}.md3-text-field__input::-webkit-calendar-picker-indicator{display:none}@media(forced-colors: active){.md3-text-field__input{background-color:Field}}:focus-within .md3-text-field__input{caret-color:var(--_focus-caret-color)}.md3-text-field--error:focus-within .md3-text-field__input{caret-color:var(--_error-focus-caret-color)}.md3-text-field__input,.md3-text-field__prefix,.md3-text-field__suffix{font-family:var(--_input-text-font);font-size:var(--_input-text-size);font-weight:var(--_input-text-weight);letter-spacing:var(--_input-text-tracking);line-height:var(--_input-text-line-height)}.md3-text-field:not(.md3-text-field--disabled) .md3-text-field__prefix,.md3-text-field:not(.md3-text-field--disabled) .md3-text-field__suffix{color:var(--_input-text-prefix-color)}.md3-text-field:not(.md3-text-field--disabled) .md3-text-field__input::placeholder{color:var(--_input-text-placeholder-color)}.md3-text-field__prefix{padding-inline-end:var(--_input-text-prefix-padding)}.md3-text-field__suffix{padding-inline-start:var(--_input-text-suffix-padding)}/*# sourceMappingURL=shared-styles.css.map */ +export const styles = css `:host{display:inline-flex;outline:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.text-field{display:inline-flex;flex:1}.field{cursor:text;flex:1}.disabled .field{cursor:default}.counter{white-space:nowrap}.icon{color:currentColor;display:flex;fill:currentColor}.icon ::slotted(*){display:flex}[hasstart] .icon.leading{font-size:var(--_leading-icon-size);height:var(--_leading-icon-size);width:var(--_leading-icon-size)}[hasend] .icon.trailing{font-size:var(--_trailing-icon-size);height:var(--_trailing-icon-size);width:var(--_trailing-icon-size)}input{appearance:none;background:none;border:none;caret-color:var(--_caret-color);color:currentColor;font:inherit;outline:none;padding:0;text-align:inherit;width:100%}input::placeholder{color:currentColor;opacity:1}input::-webkit-calendar-picker-indicator{display:none}@media(forced-colors: active){input{background-color:Field}}:focus-within input{caret-color:var(--_focus-caret-color)}.error:focus-within input{caret-color:var(--_error-focus-caret-color)}.text-field:not(.disabled) .prefix{color:var(--_input-text-prefix-color)}.text-field:not(.disabled) .suffix{color:var(--_input-text-suffix-color)}.text-field:not(.disabled) input::placeholder{color:var(--_input-text-placeholder-color)}.prefix{padding-inline-end:var(--_input-text-prefix-padding)}.suffix{padding-inline-start:var(--_input-text-suffix-padding)}/*# sourceMappingURL=shared-styles.css.map */ `; //# sourceMappingURL=shared-styles.css.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/textfield/lib/text-field.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/textfield/lib/text-field.d.ts index 5fbfc6a6..7941bef 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/textfield/lib/text-field.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/textfield/lib/text-field.d.ts
@@ -3,24 +3,24 @@ * Copyright 2021 Google LLC * SPDX-License-Identifier: Apache-2.0 */ -import { LitElement, PropertyValues, TemplateResult } from 'lit'; -import { ClassInfo } from 'lit/directives/class-map.js'; +import { LitElement, PropertyValues } from 'lit'; import { StaticValue } from 'lit/static-html.js'; import { getFormValue } from '../../controller/form-controller.js'; -import { ARIAAutoComplete, ARIAExpanded, ARIARole } from '../../types/aria.js'; /** * Input types that are compatible with the text field. */ -export declare type TextFieldType = 'email' | 'number' | 'password' | 'search' | 'tel' | 'text' | 'url'; +export type TextFieldType = 'email' | 'number' | 'password' | 'search' | 'tel' | 'text' | 'url'; /** * Input types that are not fully supported for the text field. */ -export declare type UnsupportedTextFieldType = 'color' | 'date' | 'datetime-local' | 'file' | 'month' | 'time' | 'week'; +export type UnsupportedTextFieldType = 'color' | 'date' | 'datetime-local' | 'file' | 'month' | 'time' | 'week'; /** * Input types that are incompatible with the text field. */ -export declare type InvalidTextFieldType = 'button' | 'checkbox' | 'hidden' | 'image' | 'radio' | 'range' | 'reset' | 'submit'; -/** @soyCompatible */ +export type InvalidTextFieldType = 'button' | 'checkbox' | 'hidden' | 'image' | 'radio' | 'range' | 'reset' | 'submit'; +/** + * A text field component. + */ export declare abstract class TextField extends LitElement { static shadowRootOptions: ShadowRootInit; disabled: boolean; @@ -81,21 +81,6 @@ * LTR notation for fractions. */ textDirection: string; - ariaAutoComplete: ARIAAutoComplete | null; - ariaControls: string | null; - ariaActiveDescendant: string | null; - ariaExpanded: ARIAExpanded | null; - /** - * The `aria-label` of the text field's input. - */ - ariaLabel: string; - /** - * The `aria-labelledby` of the text field's input. - * - * Note: currently only usable in SSR light DOM. - */ - ariaLabelledBy: string; - role: ARIARole | null; get form(): HTMLFormElement; name: string; [getFormValue](): string; @@ -162,7 +147,7 @@ * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#step */ step: string; - type: 'email' | 'number' | 'password' | 'search' | 'tel' | 'text' | 'url' | 'color' | 'date' | 'datetime-local' | 'file' | 'month' | 'time' | 'week'; + type: TextFieldType | UnsupportedTextFieldType; /** * Returns the native validation error message that would be displayed upon * calling `reportValidity()`. @@ -194,18 +179,19 @@ * https://developer.mozilla.org/en-US/docs/Web/API/HTMLObjectElement/willValidate */ get willValidate(): boolean; + protected abstract readonly fieldTag: StaticValue; /** * Returns true when the text field has been interacted with. Native * validation errors only display in response to user interactions. */ - protected dirty: boolean; - protected focused: boolean; + private dirty; + private focused; /** * When set to true, the error text's `role="alert"` will be removed, then * re-added after an animation frame. This will re-announce an error message * to screen readers. */ - protected refreshErrorAlert: boolean; + private refreshErrorAlert; /** * Returns true when the text field's `value` property has been changed from * it's initial value. @@ -213,29 +199,25 @@ * Setting `value` should always overwrite `defaultValue`, even when `value` * is an empty string. This flag ensures that behavior. */ - protected valueHasChanged: boolean; + private valueHasChanged; /** * Whether or not to ignore the next `value` change when computing * `valueHasChanged`. */ - protected ignoreNextValueChange: boolean; + private ignoreNextValueChange; /** * Whether or not a native error has been reported via `reportValidity()`. */ - protected nativeError: boolean; + private nativeError; /** * The validation message displayed from a native error via * `reportValidity()`. */ - protected nativeErrorText: string; - protected readonly input?: HTMLInputElement | null; - protected abstract readonly fieldTag: StaticValue; - /** @soyUniqueAttribute */ - private readonly counterId; + private nativeErrorText; + private get hasError(); + private readonly input?; private readonly leadingIcons; private readonly trailingIcons; - /** @soyUniqueAttribute */ - private readonly supportingTextId; constructor(); /** * Checks the text field's native validation and returns whether or not the @@ -253,10 +235,6 @@ */ focus(): void; /** - * Unfocuses the text field. - */ - blur(): void; - /** * Checks the text field's native validation and returns whether or not the * element is valid. * @@ -332,65 +310,29 @@ * Reset the text field to its default value. */ reset(): void; - /** @soyTemplate */ - render(): TemplateResult; - /** @soyTemplate */ - protected getRenderClasses(): ClassInfo; - /** @soyTemplate */ - protected getError(): boolean; - /** @soyTemplate */ - protected renderField(): TemplateResult; - /** - * @soyTemplate - * @slotName start - */ - protected renderLeadingIcon(): TemplateResult; - /** - * @soyTemplate - * @slotName end - */ - protected renderTrailingIcon(): TemplateResult; - /** @soyTemplate */ - protected renderInput(): TemplateResult; - /** @soyTemplate */ - protected getInputValue(): string; - /** @soyTemplate */ - protected getAriaDescribedBy(): string; - /** @soyTemplate */ - protected renderPrefix(): TemplateResult; - /** @soyTemplate */ - protected renderSuffix(): TemplateResult; - /** - * @soyTemplate - * @slotName supporting-text - */ - protected renderSupportingText(): TemplateResult; - /** @soyTemplate */ - protected getSupportingText(): string; - /** @soyTemplate */ - protected getErrorText(): string; - /** @soyTemplate */ - protected shouldErrorAnnounce(): boolean; - /** - * @soyTemplate - * @slotName supporting-text-end - */ - protected renderCounter(): TemplateResult; - /** @soyTemplate */ - protected hasCounter(): boolean; - /** @soyTemplate */ - protected getCounterText(): TemplateResult; - protected update(changedProperties: PropertyValues<TextField>): void; + protected update(changedProperties: PropertyValues): void; + protected render(): import("lit-html").TemplateResult<1>; protected updated(changedProperties: PropertyValues): void; - /** @bubbleWizEvent */ - protected handleClick(): void; - /** @bubbleWizEvent */ - protected handleFocusin(event: FocusEvent): void; - /** @bubbleWizEvent */ - protected handleFocusout(event: FocusEvent): void; - protected handleInput(event: InputEvent): void; - protected redispatchEvent(event: Event): void; - protected getInput(): HTMLInputElement; + private renderField; + private renderLeadingIcon; + private renderTrailingIcon; + private renderInput; + private getInputValue; + private getAriaDescribedBy; + private renderPrefix; + private renderSuffix; + private renderAffix; + private renderSupportingText; + private getSupportingText; + private getErrorText; + private shouldErrorAnnounce; + private renderCounter; + private getCounterText; + private handleFocusin; + private handleFocusout; + private handleInput; + private redispatchEvent; + private getInput; private checkValidityAndDispatch; private handleIconChange; }
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/textfield/lib/text-field.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/textfield/lib/text-field.js index da0e1963..00f68e03 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/textfield/lib/text-field.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/textfield/lib/text-field.js
@@ -3,185 +3,22 @@ * Copyright 2021 Google LLC * SPDX-License-Identifier: Apache-2.0 */ -import { __decorate, __metadata } from "tslib"; -import { html, LitElement } from 'lit'; +var _a; +import { __decorate } from "tslib"; +import { html, isServer, LitElement, nothing } from 'lit'; import { property, query, queryAssignedElements, state } from 'lit/decorators.js'; import { classMap } from 'lit/directives/class-map.js'; -import { ifDefined } from 'lit/directives/if-defined.js'; import { live } from 'lit/directives/live.js'; import { styleMap } from 'lit/directives/style-map.js'; import { html as staticHtml } from 'lit/static-html.js'; +import { requestUpdateOnAriaChange } from '../../aria/delegate.js'; import { redispatchEvent } from '../../controller/events.js'; import { FormController, getFormValue } from '../../controller/form-controller.js'; import { stringConverter } from '../../controller/string-converter.js'; -import { ariaProperty } from '../../decorators/aria-property.js'; -/** @soyCompatible */ +/** + * A text field component. + */ export class TextField extends LitElement { - constructor() { - super(); - this.disabled = false; - /** - * Gets or sets whether or not the text field is in a visually invalid state. - * - * Calling `reportValidity()` will automatically update `error`. - */ - this.error = false; - /** - * The error message that replaces supporting text when `error` is true. If - * `errorText` is an empty string, then the supporting text will continue to - * show. - * - * Calling `reportValidity()` will automatically update `errorText` to the - * native `validationMessage`. - */ - this.errorText = ''; - this.required = false; - /** - * The current value of the text field. It is always a string. - * - * This is equal to `defaultValue` before user input. - */ - this.value = ''; - /** - * The default value of the text field. Before user input, changing the - * default value will update `value` as well. - * - * When the text field is reset, its `value` will be set to this default - * value. - */ - this.defaultValue = ''; - /** - * An optional prefix to display before the input value. - */ - this.prefixText = ''; - /** - * An optional suffix to display after the input value. - */ - this.suffixText = ''; - /** - * Whether or not the text field has a leading icon. Used for SSR. - */ - this.hasLeadingIcon = false; - /** - * Whether or not the text field has a trailing icon. Used for SSR. - */ - this.hasTrailingIcon = false; - /** - * Conveys additional information below the text field, such as how it should - * be used. - */ - this.supportingText = ''; - /** - * Override the input text CSS `direction`. Useful for RTL languages that use - * LTR notation for fractions. - */ - this.textDirection = ''; - // ARIA - // TODO(b/210730484): replace with @soyParam annotation - this.ariaAutoComplete = null; - this.ariaControls = null; - this.ariaActiveDescendant = null; - this.ariaExpanded = null; - // tslint:disable:decorator-placement - // @ts-ignore(b/264292293): Use `override` with TS 4.9+ - this.role = null; - this.name = ''; - // <input> properties - /** - * Defines the greatest value in the range of permitted values. - * - * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#max - */ - this.max = ''; - /** - * The maximum number of characters a user can enter into the text field. Set - * to -1 for none. - * - * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#maxlength - */ - this.maxLength = -1; - /** - * Defines the most negative value in the range of permitted values. - * - * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#min - */ - this.min = ''; - /** - * The minimum number of characters a user can enter into the text field. Set - * to -1 for none. - * - * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#minlength - */ - this.minLength = -1; - /** - * A regular expression that the text field's value must match to pass - * constraint validation. - * - * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#pattern - */ - this.pattern = ''; - this.placeholder = ''; - /** - * Indicates whether or not a user should be able to edit the text field's - * value. - * - * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#readonly - */ - this.readOnly = false; - /** - * Returns or sets the element's step attribute, which works with min and max - * to limit the increments at which a numeric or date-time value can be set. - * - * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#step - */ - this.step = ''; - // TODO(b/237284412): replace with exported types - this.type = 'text'; - /** - * Returns true when the text field has been interacted with. Native - * validation errors only display in response to user interactions. - */ - this.dirty = false; - this.focused = false; - /** - * When set to true, the error text's `role="alert"` will be removed, then - * re-added after an animation frame. This will re-announce an error message - * to screen readers. - */ - this.refreshErrorAlert = false; - /** - * Returns true when the text field's `value` property has been changed from - * it's initial value. - * - * Setting `value` should always overwrite `defaultValue`, even when `value` - * is an empty string. This flag ensures that behavior. - */ - this.valueHasChanged = false; - /** - * Whether or not to ignore the next `value` change when computing - * `valueHasChanged`. - */ - this.ignoreNextValueChange = false; - /** - * Whether or not a native error has been reported via `reportValidity()`. - */ - this.nativeError = false; - /** - * The validation message displayed from a native error via - * `reportValidity()`. - */ - this.nativeErrorText = ''; - /** @soyUniqueAttribute */ - this.counterId = 'counter'; - /** @soyUniqueAttribute */ - this.supportingTextId = 'support'; - this.addController(new FormController(this)); - // TODO(b/244574653): replace this.handleClick with this.focus - this.addEventListener('click', this.handleClick); - this.addEventListener('focusin', this.handleFocusin); - this.addEventListener('focusout', this.handleFocusout); - } - // tslint:enable:decorator-placement // FormElement get form() { return this.closest('form'); @@ -263,6 +100,160 @@ get willValidate() { return this.getInput().willValidate; } + get hasError() { + return this.error || this.nativeError; + } + constructor() { + super(); + this.disabled = false; + /** + * Gets or sets whether or not the text field is in a visually invalid state. + * + * Calling `reportValidity()` will automatically update `error`. + */ + this.error = false; + /** + * The error message that replaces supporting text when `error` is true. If + * `errorText` is an empty string, then the supporting text will continue to + * show. + * + * Calling `reportValidity()` will automatically update `errorText` to the + * native `validationMessage`. + */ + this.errorText = ''; + this.required = false; + /** + * The current value of the text field. It is always a string. + * + * This is equal to `defaultValue` before user input. + */ + this.value = ''; + /** + * The default value of the text field. Before user input, changing the + * default value will update `value` as well. + * + * When the text field is reset, its `value` will be set to this default + * value. + */ + this.defaultValue = ''; + /** + * An optional prefix to display before the input value. + */ + this.prefixText = ''; + /** + * An optional suffix to display after the input value. + */ + this.suffixText = ''; + /** + * Whether or not the text field has a leading icon. Used for SSR. + */ + this.hasLeadingIcon = false; + /** + * Whether or not the text field has a trailing icon. Used for SSR. + */ + this.hasTrailingIcon = false; + /** + * Conveys additional information below the text field, such as how it should + * be used. + */ + this.supportingText = ''; + /** + * Override the input text CSS `direction`. Useful for RTL languages that use + * LTR notation for fractions. + */ + this.textDirection = ''; + this.name = ''; + // <input> properties + /** + * Defines the greatest value in the range of permitted values. + * + * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#max + */ + this.max = ''; + /** + * The maximum number of characters a user can enter into the text field. Set + * to -1 for none. + * + * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#maxlength + */ + this.maxLength = -1; + /** + * Defines the most negative value in the range of permitted values. + * + * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#min + */ + this.min = ''; + /** + * The minimum number of characters a user can enter into the text field. Set + * to -1 for none. + * + * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#minlength + */ + this.minLength = -1; + /** + * A regular expression that the text field's value must match to pass + * constraint validation. + * + * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#pattern + */ + this.pattern = ''; + this.placeholder = ''; + /** + * Indicates whether or not a user should be able to edit the text field's + * value. + * + * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#readonly + */ + this.readOnly = false; + /** + * Returns or sets the element's step attribute, which works with min and max + * to limit the increments at which a numeric or date-time value can be set. + * + * https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#step + */ + this.step = ''; + this.type = 'text'; + /** + * Returns true when the text field has been interacted with. Native + * validation errors only display in response to user interactions. + */ + this.dirty = false; + this.focused = false; + /** + * When set to true, the error text's `role="alert"` will be removed, then + * re-added after an animation frame. This will re-announce an error message + * to screen readers. + */ + this.refreshErrorAlert = false; + /** + * Returns true when the text field's `value` property has been changed from + * it's initial value. + * + * Setting `value` should always overwrite `defaultValue`, even when `value` + * is an empty string. This flag ensures that behavior. + */ + this.valueHasChanged = false; + /** + * Whether or not to ignore the next `value` change when computing + * `valueHasChanged`. + */ + this.ignoreNextValueChange = false; + /** + * Whether or not a native error has been reported via `reportValidity()`. + */ + this.nativeError = false; + /** + * The validation message displayed from a native error via + * `reportValidity()`. + */ + this.nativeErrorText = ''; + this.addController(new FormController(this)); + if (!isServer) { + this.addEventListener('click', this.focus); + this.addEventListener('focusin', this.handleFocusin); + this.addEventListener('focusout', this.handleFocusout); + } + } /** * Checks the text field's native validation and returns whether or not the * element is valid. @@ -286,15 +277,7 @@ // button, to the input when focus is requested. return; } - // TODO(b/210731759): replace with super.focus() once SSR supports - // delegating focus - this.getInput().focus(); - } - /** - * Unfocuses the text field. - */ - blur() { - this.getInput().blur(); + super.focus(); } /** * Checks the text field's native validation and returns whether or not the @@ -404,205 +387,6 @@ this.nativeError = false; this.nativeErrorText = ''; } - /** @soyTemplate */ - render() { - return html ` - <span class="md3-text-field ${classMap(this.getRenderClasses())}"> - ${this.renderField()} - </span> - `; - } - /** @soyTemplate */ - getRenderClasses() { - return { - 'md3-text-field--disabled': this.disabled, - 'md3-text-field--error': this.getError(), - }; - } - /** @soyTemplate */ - getError() { - return this.error || this.nativeError; - } - /** @soyTemplate */ - renderField() { - const prefix = this.renderPrefix(); - const suffix = this.renderSuffix(); - const input = this.renderInput(); - const inputValue = this.getInputValue(); - return staticHtml `<${this.fieldTag} - class="md3-text-field__field" - ?disabled=${this.disabled} - ?error=${this.getError()} - ?focused=${this.focused} - ?hasEnd=${this.hasTrailingIcon} - ?hasStart=${this.hasLeadingIcon} - .label=${this.label} - ?populated=${!!inputValue} - ?required=${this.required} - > - ${this.renderLeadingIcon()} - ${prefix}${input}${suffix} - ${this.renderTrailingIcon()} - ${this.renderSupportingText()} - ${this.renderCounter()} - </${this.fieldTag}>`; - } - /** - * @soyTemplate - * @slotName start - */ - renderLeadingIcon() { - return html ` - <span class="md3-text-field__icon md3-text-field__icon--leading" - slot="start"> - <slot name="leadingicon" @slotchange=${this.handleIconChange}></slot> - </span> - `; - } - /** - * @soyTemplate - * @slotName end - */ - renderTrailingIcon() { - return html ` - <span class="md3-text-field__icon md3-text-field__icon--trailing" - slot="end"> - <slot name="trailingicon" @slotchange=${this.handleIconChange}></slot> - </span> - `; - } - /** @soyTemplate */ - renderInput() { - // TODO(b/237283903): remove when custom isTruthy directive is supported - const placeholderValue = this.placeholder || undefined; - const ariaActiveDescendantValue = this.ariaActiveDescendant || undefined; - const ariaAutoCompleteValue = this.ariaAutoComplete || undefined; - const ariaControlsValue = this.ariaControls || undefined; - const ariaDescribedByValue = this.getAriaDescribedBy() || undefined; - const ariaExpandedValue = this.ariaExpanded || undefined; - const ariaLabelValue = this.ariaLabel || this.label || undefined; - const ariaLabelledByValue = this.ariaLabelledBy || undefined; - const maxValue = this.max || undefined; - const maxLengthValue = this.maxLength > -1 ? this.maxLength : undefined; - const minValue = this.min || undefined; - const minLengthValue = this.minLength > -1 ? this.minLength : undefined; - const patternValue = this.pattern || undefined; - const roleValue = this.role || undefined; - const stepValue = this.step || undefined; - /** @styleMap */ - const style = { direction: this.textDirection }; - // TODO(b/243805848): remove `as unknown as number` once lit analyzer is - // fixed - return html `<input - class="md3-text-field__input" - style=${styleMap(style)} - aria-activedescendant=${ifDefined(ariaActiveDescendantValue)} - aria-autocomplete=${ifDefined(ariaAutoCompleteValue)} - aria-controls=${ifDefined(ariaControlsValue)} - aria-describedby=${ifDefined(ariaDescribedByValue)} - aria-expanded=${ifDefined(ariaExpandedValue)} - aria-invalid=${this.getError()} - aria-label=${ifDefined(ariaLabelValue)} - aria-labelledby=${ifDefined(ariaLabelledByValue)} - ?disabled=${this.disabled} - max=${ifDefined(maxValue)} - maxlength=${ifDefined(maxLengthValue)} - min=${ifDefined(minValue)} - minlength=${ifDefined(minLengthValue)} - pattern=${ifDefined(patternValue)} - placeholder=${ifDefined(placeholderValue)} - role=${ifDefined(roleValue)} - ?readonly=${this.readOnly} - ?required=${this.required} - step=${ifDefined(stepValue)} - type=${this.type} - .value=${live(this.getInputValue())} - @change=${this.redispatchEvent} - @input=${this.handleInput} - @select=${this.redispatchEvent} - >`; - } - /** @soyTemplate */ - getInputValue() { - const alwaysShowValue = this.dirty || this.valueHasChanged; - return alwaysShowValue ? this.value : this.defaultValue || this.value; - } - /** @soyTemplate */ - getAriaDescribedBy() { - const hasSupport = !!this.getSupportingText(); - const hasCounter = this.hasCounter(); - // TODO(b/244609052): remove parens - return (hasSupport || hasCounter) ? - `${hasSupport ? this.supportingTextId : ''} ${hasCounter ? this.counterId : ''}` : - ''; - } - /** @soyTemplate */ - renderPrefix() { - return this.prefixText ? - html `<span class="md3-text-field__prefix">${this.prefixText}</span>` : - html ``; - // TODO(b/217441842): Create shared function once argument bug is fixed - // return this.renderAffix(/* isSuffix */ false); - } - /** @soyTemplate */ - renderSuffix() { - return this.suffixText ? - html `<span class="md3-text-field__suffix">${this.suffixText}</span>` : - html ``; - // TODO(b/217441842): Create shared function once argument bug is fixed - // return this.renderAffix(/* isSuffix */ true); - } - /** - * @soyTemplate - * @slotName supporting-text - */ - renderSupportingText() { - const shouldAlert = this.shouldErrorAnnounce(); - const text = this.getSupportingText(); - const template = html `<span id=${this.supportingTextId} - slot="supporting-text" - role=${ifDefined(shouldAlert ? 'alert' : undefined)}>${text}</span>`; - return text ? template : html ``; - } - /** @soyTemplate */ - getSupportingText() { - const errorText = this.getErrorText(); - return this.getError() && errorText ? errorText : this.supportingText; - } - /** @soyTemplate */ - getErrorText() { - return this.error ? this.errorText : this.nativeErrorText; - } - /** @soyTemplate */ - shouldErrorAnnounce() { - // Announce if there is an error and error text visible. - // If refreshErrorAlert is true, do not announce. This will remove the - // role="alert" attribute. Another render cycle will happen after an - // animation frame to re-add the role. - return this.getError() && !!this.getErrorText() && !this.refreshErrorAlert; - } - /** - * @soyTemplate - * @slotName supporting-text-end - */ - renderCounter() { - const counter = html `<span id=${this.counterId} - class="md3-text-field__counter" - slot="supporting-text-end">${this.getCounterText()}</span>`; - // TODO(b/244473435): add aria-label and announcements - return this.hasCounter() ? counter : html ``; - } - // TODO(b/244197198): replace with !!this.getCounterText() - /** @soyTemplate */ - hasCounter() { - return this.maxLength > -1; - } - /** @soyTemplate */ - getCounterText() { - // TODO(b/244197198): replace with string return - const length = this.value.length; - return this.hasCounter() ? html `${length} / ${this.maxLength}` : html ``; - } update(changedProperties) { // Consider a value change anything that is not the initial empty string // value. @@ -616,7 +400,19 @@ } super.update(changedProperties); } + render() { + const classes = { + 'disabled': this.disabled, + 'error': !this.disabled && this.hasError, + }; + return html ` + <span class="text-field ${classMap(classes)}"> + ${this.renderField()} + </span> + `; + } updated(changedProperties) { + // Keep changedProperties arg so that subclasses may call it // If a property such as `type` changes and causes the internal <input> // value to change without dispatching an event, re-sync it. const value = this.getInput().value; @@ -637,16 +433,144 @@ }); } } - /** @bubbleWizEvent */ - handleClick() { - this.focus(); + renderField() { + const prefix = this.renderPrefix(); + const suffix = this.renderSuffix(); + const input = this.renderInput(); + return staticHtml `<${this.fieldTag} + class="field" + ?disabled=${this.disabled} + ?error=${this.hasError} + ?focused=${this.focused} + ?hasEnd=${this.hasTrailingIcon} + ?hasStart=${this.hasLeadingIcon} + .label=${this.label} + ?populated=${!!this.getInputValue()} + ?required=${this.required} + > + ${this.renderLeadingIcon()} + ${prefix}${input}${suffix} + ${this.renderTrailingIcon()} + ${this.renderSupportingText()} + ${this.renderCounter()} + </${this.fieldTag}>`; } - /** @bubbleWizEvent */ - handleFocusin(event) { + renderLeadingIcon() { + return html ` + <span class="icon leading" slot="start"> + <slot name="leadingicon" @slotchange=${this.handleIconChange}></slot> + </span> + `; + } + renderTrailingIcon() { + return html ` + <span class="icon trailing" slot="end"> + <slot name="trailingicon" @slotchange=${this.handleIconChange}></slot> + </span> + `; + } + renderInput() { + const style = { direction: this.textDirection }; + // TODO(b/243805848): remove `as unknown as number` once lit analyzer is + // fixed + return html `<input + style=${styleMap(style)} + aria-autocomplete=${this.ariaAutoComplete || nothing} + aria-describedby=${this.getAriaDescribedBy() || nothing} + aria-expanded=${this.ariaExpanded || nothing} + aria-invalid=${this.hasError} + aria-label=${this.ariaLabel || this.label || nothing} + ?disabled=${this.disabled} + max=${(this.max || nothing)} + maxlength=${this.maxLength > -1 ? this.maxLength : nothing} + min=${(this.min || nothing)} + minlength=${this.minLength > -1 ? this.minLength : nothing} + pattern=${this.pattern || nothing} + placeholder=${this.placeholder || nothing} + ?readonly=${this.readOnly} + ?required=${this.required} + step=${(this.step || nothing)} + type=${this.type} + .value=${live(this.getInputValue())} + @change=${this.redispatchEvent} + @input=${this.handleInput} + @select=${this.redispatchEvent} + >`; + } + getInputValue() { + const alwaysShowValue = this.dirty || this.valueHasChanged; + if (alwaysShowValue) { + return this.value; + } + return this.defaultValue || this.value; + } + getAriaDescribedBy() { + const ids = []; + if (this.getSupportingText()) { + ids.push('support'); + } + if (this.getCounterText()) { + ids.push('counter'); + } + return ids.join(' '); + } + renderPrefix() { + return this.renderAffix(this.prefixText, /* isSuffix */ false); + } + renderSuffix() { + return this.renderAffix(this.suffixText, /* isSuffix */ true); + } + renderAffix(text, isSuffix) { + if (!text) { + return nothing; + } + const classes = { + 'suffix': isSuffix, + 'prefix': !isSuffix, + }; + return html `<span class="${classMap(classes)}">${text}</span>`; + } + renderSupportingText() { + const text = this.getSupportingText(); + if (!text) { + return nothing; + } + return html `<span id="support" + slot="supporting-text" + role=${this.shouldErrorAnnounce() ? 'alert' : nothing}>${text}</span>`; + } + getSupportingText() { + const errorText = this.getErrorText(); + return this.hasError && errorText ? errorText : this.supportingText; + } + getErrorText() { + return this.error ? this.errorText : this.nativeErrorText; + } + shouldErrorAnnounce() { + // Announce if there is an error and error text visible. + // If refreshErrorAlert is true, do not announce. This will remove the + // role="alert" attribute. Another render cycle will happen after an + // animation frame to re-add the role. + return this.hasError && !!this.getErrorText() && !this.refreshErrorAlert; + } + renderCounter() { + const text = this.getCounterText(); + if (!text) { + return nothing; + } + // TODO(b/244473435): add aria-label and announcements + return html `<span id="counter" + class="counter" + slot="supporting-text-end">${text}</span>`; + } + getCounterText() { + return this.maxLength > -1 ? `${this.value.length} / ${this.maxLength}` : + ''; + } + handleFocusin() { this.focused = true; } - /** @bubbleWizEvent */ - handleFocusout(event) { + handleFocusout() { if (this.matches(':focus-within')) { // Changing focus to another child within the text field, like a button return; @@ -692,175 +616,105 @@ this.hasTrailingIcon = this.trailingIcons.length > 0; } } -TextField.shadowRootOptions = { mode: 'open', delegatesFocus: true }; +_a = TextField; +(() => { + requestUpdateOnAriaChange(_a); +})(); +TextField.shadowRootOptions = { ...LitElement.shadowRootOptions, delegatesFocus: true }; __decorate([ - property({ type: Boolean, reflect: true }), - __metadata("design:type", Object) + property({ type: Boolean, reflect: true }) ], TextField.prototype, "disabled", void 0); __decorate([ - property({ type: Boolean, reflect: true }), - __metadata("design:type", Object) + property({ type: Boolean, reflect: true }) ], TextField.prototype, "error", void 0); __decorate([ - property({ type: String }), - __metadata("design:type", Object) + property() ], TextField.prototype, "errorText", void 0); __decorate([ - property({ type: String }), - __metadata("design:type", String) + property() ], TextField.prototype, "label", void 0); __decorate([ - property({ type: Boolean, reflect: true }), - __metadata("design:type", Object) + property({ type: Boolean, reflect: true }) ], TextField.prototype, "required", void 0); __decorate([ - property({ type: String }), - __metadata("design:type", Object) + property() ], TextField.prototype, "value", void 0); __decorate([ - property({ type: String }), - __metadata("design:type", Object) + property() ], TextField.prototype, "defaultValue", void 0); __decorate([ - property({ type: String }), - __metadata("design:type", Object) + property() ], TextField.prototype, "prefixText", void 0); __decorate([ - property({ type: String }), - __metadata("design:type", Object) + property() ], TextField.prototype, "suffixText", void 0); __decorate([ - property({ type: Boolean }), - __metadata("design:type", Object) + property({ type: Boolean }) ], TextField.prototype, "hasLeadingIcon", void 0); __decorate([ - property({ type: Boolean }), - __metadata("design:type", Object) + property({ type: Boolean }) ], TextField.prototype, "hasTrailingIcon", void 0); __decorate([ - property({ type: String }), - __metadata("design:type", Object) + property() ], TextField.prototype, "supportingText", void 0); __decorate([ - property({ type: String }), - __metadata("design:type", Object) + property() ], TextField.prototype, "textDirection", void 0); __decorate([ - property({ type: String, attribute: 'data-aria-autocomplete', noAccessor: true }), - ariaProperty // tslint:disable-line:no-new-decorators - , - __metadata("design:type", String) -], TextField.prototype, "ariaAutoComplete", void 0); -__decorate([ - property({ type: String, attribute: 'data-aria-controls', noAccessor: true }), - ariaProperty // tslint:disable-line:no-new-decorators - , - __metadata("design:type", String) -], TextField.prototype, "ariaControls", void 0); -__decorate([ - property({ type: String, attribute: 'data-aria-activedescendant', noAccessor: true }), - ariaProperty // tslint:disable-line:no-new-decorators - , - __metadata("design:type", String) -], TextField.prototype, "ariaActiveDescendant", void 0); -__decorate([ - property({ type: String, attribute: 'data-aria-expanded', noAccessor: true }), - ariaProperty // tslint:disable-line:no-new-decorators - , - __metadata("design:type", String) -], TextField.prototype, "ariaExpanded", void 0); -__decorate([ - property({ type: String, attribute: 'data-aria-label', noAccessor: true }), - ariaProperty // tslint:disable-line:no-new-decorators - , - __metadata("design:type", String) -], TextField.prototype, "ariaLabel", void 0); -__decorate([ - property({ type: String, attribute: 'data-aria-labelledby', noAccessor: true }), - ariaProperty // tslint:disable-line:no-new-decorators - , - __metadata("design:type", String) -], TextField.prototype, "ariaLabelledBy", void 0); -__decorate([ - property({ type: String, attribute: 'data-role', noAccessor: true }), - ariaProperty // tslint:disable-line:no-new-decorators - , - __metadata("design:type", String) -], TextField.prototype, "role", void 0); -__decorate([ - property({ type: String, reflect: true, converter: stringConverter }), - __metadata("design:type", Object) + property({ reflect: true, converter: stringConverter }) ], TextField.prototype, "name", void 0); __decorate([ - property({ type: String }), - __metadata("design:type", Object) + property() ], TextField.prototype, "max", void 0); __decorate([ - property({ type: Number }), - __metadata("design:type", Object) + property({ type: Number }) ], TextField.prototype, "maxLength", void 0); __decorate([ - property({ type: String }), - __metadata("design:type", Object) + property() ], TextField.prototype, "min", void 0); __decorate([ - property({ type: Number }), - __metadata("design:type", Object) + property({ type: Number }) ], TextField.prototype, "minLength", void 0); __decorate([ - property({ type: String }), - __metadata("design:type", Object) + property() ], TextField.prototype, "pattern", void 0); __decorate([ - property({ type: String, reflect: true, converter: stringConverter }), - __metadata("design:type", Object) + property({ reflect: true, converter: stringConverter }) ], TextField.prototype, "placeholder", void 0); __decorate([ - property({ type: Boolean, reflect: true }), - __metadata("design:type", Object) + property({ type: Boolean, reflect: true }) ], TextField.prototype, "readOnly", void 0); __decorate([ - property({ type: String }), - __metadata("design:type", Object) + property() ], TextField.prototype, "step", void 0); __decorate([ - property({ type: String, reflect: true }), - __metadata("design:type", String) + property({ reflect: true }) ], TextField.prototype, "type", void 0); __decorate([ - state(), - __metadata("design:type", Object) + state() ], TextField.prototype, "dirty", void 0); __decorate([ - state(), - __metadata("design:type", Object) + state() ], TextField.prototype, "focused", void 0); __decorate([ - state(), - __metadata("design:type", Object) + state() ], TextField.prototype, "refreshErrorAlert", void 0); __decorate([ - state(), - __metadata("design:type", Object) + state() ], TextField.prototype, "valueHasChanged", void 0); __decorate([ - state(), - __metadata("design:type", Object) + state() ], TextField.prototype, "nativeError", void 0); __decorate([ - state(), - __metadata("design:type", Object) + state() ], TextField.prototype, "nativeErrorText", void 0); __decorate([ - query('.md3-text-field__input'), - __metadata("design:type", HTMLInputElement) + query('input') ], TextField.prototype, "input", void 0); __decorate([ - queryAssignedElements({ slot: 'leadingicon' }), - __metadata("design:type", Array) + queryAssignedElements({ slot: 'leadingicon' }) ], TextField.prototype, "leadingIcons", void 0); __decorate([ - queryAssignedElements({ slot: 'trailingicon' }), - __metadata("design:type", Array) + queryAssignedElements({ slot: 'trailingicon' }) ], TextField.prototype, "trailingIcons", void 0); //# sourceMappingURL=text-field.js.map \ No newline at end of file
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/textfield/outlined-text-field.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/textfield/outlined-text-field.d.ts index 602cebf..6a802dc4 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/textfield/outlined-text-field.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/textfield/outlined-text-field.d.ts
@@ -12,7 +12,7 @@ } } /** - * @soyCompatible + * TODO(b/228525797): Add docs * @final * @suppress {visibility} */
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/textfield/outlined-text-field.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/textfield/outlined-text-field.js index 123df10..63a36412 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/textfield/outlined-text-field.js +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/textfield/outlined-text-field.js
@@ -7,13 +7,12 @@ import '../field/outlined-field.js'; import { customElement } from 'lit/decorators.js'; import { literal } from 'lit/static-html.js'; -// TODO(b/236285090): update with HCM best practices import { styles as outlinedForcedColorsStyles } from './lib/outlined-forced-colors-styles.css.js'; import { styles as outlinedStyles } from './lib/outlined-styles.css.js'; import { OutlinedTextField } from './lib/outlined-text-field.js'; import { styles as sharedStyles } from './lib/shared-styles.css.js'; /** - * @soyCompatible + * TODO(b/228525797): Add docs * @final * @suppress {visibility} */
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/tokens/v0_152/index.test.css.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/tokens/v0_172/index.test.css.d.ts similarity index 100% rename from third_party/material_web_components/components-chromium/node_modules/@material/web/tokens/v0_152/index.test.css.d.ts rename to third_party/material_web_components/components-chromium/node_modules/@material/web/tokens/v0_172/index.test.css.d.ts
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/tokens/v0_152/index.test.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/tokens/v0_172/index.test.css.js similarity index 100% rename from third_party/material_web_components/components-chromium/node_modules/@material/web/tokens/v0_152/index.test.css.js rename to third_party/material_web_components/components-chromium/node_modules/@material/web/tokens/v0_172/index.test.css.js
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/tokens/v0_152/lib.test.css.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/tokens/v0_172/lib.test.css.d.ts similarity index 100% rename from third_party/material_web_components/components-chromium/node_modules/@material/web/tokens/v0_152/lib.test.css.d.ts rename to third_party/material_web_components/components-chromium/node_modules/@material/web/tokens/v0_172/lib.test.css.d.ts
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/tokens/v0_152/lib.test.css.js b/third_party/material_web_components/components-chromium/node_modules/@material/web/tokens/v0_172/lib.test.css.js similarity index 100% rename from third_party/material_web_components/components-chromium/node_modules/@material/web/tokens/v0_152/lib.test.css.js rename to third_party/material_web_components/components-chromium/node_modules/@material/web/tokens/v0_172/lib.test.css.js
diff --git a/third_party/material_web_components/components-chromium/node_modules/@material/web/types/aria.d.ts b/third_party/material_web_components/components-chromium/node_modules/@material/web/types/aria.d.ts index 66de2959..535a456 100644 --- a/third_party/material_web_components/components-chromium/node_modules/@material/web/types/aria.d.ts +++ b/third_party/material_web_components/components-chromium/node_modules/@material/web/types/aria.d.ts
@@ -2,13 +2,71 @@ * @license * Copyright 2022 Google LLC * SPDX-License-Identifier: Apache-2.0 - * + */ +/** * @fileoverview Provides types for `ariaX` properties. These are required when * typing `ariaX` properties since lit analyzer requires strict aria string * types. */ /** + * An extension of `ARIAMixin` that enforces strict value types for aria + * properties. + * + * This is needed for correct typing in render functions with lit analyzer. + * + * @example + * render() { + * const {ariaLabel} = this as ARIAMixinStrict; + * return html` + * <button aria-label=${ariaLabel || nothing}> + * <slot></slot> + * </button> + * `; + * } + */ +export interface ARIAMixinStrict extends ARIAMixin { + ariaAtomic: 'true'|'false'|null; + ariaAutoComplete: 'none'|'inline'|'list'|'both'|null; + ariaBusy: 'true'|'false'|null; + ariaChecked: 'true'|'false'|null; + ariaColCount: `${number}`|null; + ariaColIndex: `${number}`|null; + ariaColSpan: `${number}`|null; + ariaCurrent: 'page'|'step'|'location'|'date'|'time'|'true'|'false'|null; + ariaDisabled: 'true'|'false'|null; + ariaExpanded: 'true'|'false'|null; + ariaHasPopup: 'false'|'true'|'menu'|'listbox'|'tree'|'grid'|'dialog'|null; + ariaHidden: 'true'|'false'|null; + ariaInvalid: 'true'|'false'|null; + ariaKeyShortcuts: string|null; + ariaLabel: string|null; + ariaLevel: `${number}`|null; + ariaLive: 'assertive'|'off'|'polite'|null; + ariaModal: 'true'|'false'|null; + ariaMultiLine: 'true'|'false'|null; + ariaMultiSelectable: 'true'|'false'|null; + ariaOrientation: 'horizontal'|'vertical'|'undefined'|null; + ariaPlaceholder: string|null; + ariaPosInSet: `${number}`|null; + ariaPressed: 'true'|'false'|null; + ariaReadOnly: 'true'|'false'|null; + ariaRequired: 'true'|'false'|null; + ariaRoleDescription: string|null; + ariaRowCount: `${number}`|null; + ariaRowIndex: `${number}`|null; + ariaRowSpan: `${number}`|null; + ariaSelected: 'true'|'false'|null; + ariaSetSize: `${number}`|null; + ariaSort: 'ascending'|'descending'|'none'|'other'|null; + ariaValueMax: `${number}`|null; + ariaValueMin: `${number}`|null; + ariaValueNow: `${number}`|null; + ariaValueText: string|null; + role: ARIARole|null; +} + +/** * Valid values for `aria-expanded`. */ export type ARIAAutoComplete = 'none'|'inline'|'list'|'both';
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/LICENSE b/third_party/material_web_components/components-chromium/node_modules/safevalues/LICENSE new file mode 100644 index 0000000..d645695 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/LICENSE
@@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License.
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/attribute_builders.d.ts b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/attribute_builders.d.ts new file mode 100644 index 0000000..0fd6641c8 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/attribute_builders.d.ts
@@ -0,0 +1,15 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import '../environment/dev'; +import { SafeAttributePrefix } from '../internals/attribute_impl'; +/** + * Creates a SafeAttributePrefix object from a template literal with no + * interpolations for attributes that share a common prefix guaranteed to be not + * security sensitive. + * + * The template literal is a prefix that makes it obvious this attribute is not + * security sensitive. If it doesn't, this function will throw. + */ +export declare function safeAttrPrefix(templ: TemplateStringsArray): SafeAttributePrefix;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/attribute_builders.js b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/attribute_builders.js new file mode 100644 index 0000000..97278dc --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/attribute_builders.js
@@ -0,0 +1,44 @@ +"use strict"; +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.safeAttrPrefix = void 0; +require("../environment/dev"); +var attribute_impl_1 = require("../internals/attribute_impl"); +var string_literal_1 = require("../internals/string_literal"); +var sensitive_attributes_1 = require("./sensitive_attributes"); +/** + * Creates a SafeAttributePrefix object from a template literal with no + * interpolations for attributes that share a common prefix guaranteed to be not + * security sensitive. + * + * The template literal is a prefix that makes it obvious this attribute is not + * security sensitive. If it doesn't, this function will throw. + */ +function safeAttrPrefix(templ) { + if (process.env.NODE_ENV !== 'production') { + (0, string_literal_1.assertIsTemplateObject)(templ, true, 'safeAttr is a template literal tag function ' + + 'and should be called using the tagged template syntax. ' + + 'For example, safeAttr`foo`;'); + } + var attrPrefix = templ[0].toLowerCase(); + if (process.env.NODE_ENV !== 'production') { + if (attrPrefix.indexOf('on') === 0 || 'on'.indexOf(attrPrefix) === 0) { + throw new Error("Prefix '".concat(templ[0], "' does not guarantee the attribute ") + + "to be safe as it is also a prefix for event handler attributes" + + "Please use 'addEventListener' to set event handlers."); + } + sensitive_attributes_1.SECURITY_SENSITIVE_ATTRIBUTES.forEach(function (sensitiveAttr) { + if (sensitiveAttr.indexOf(attrPrefix) === 0) { + throw new Error("Prefix '".concat(templ[0], "' does not guarantee the attribute ") + + "to be safe as it is also a prefix for " + + "the security sensitive attribute '".concat(sensitiveAttr, "'. ") + + "Please use native or safe DOM APIs to set the attribute."); + } + }); + } + return (0, attribute_impl_1.createAttributePrefix)(attrPrefix); +} +exports.safeAttrPrefix = safeAttrPrefix;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/attribute_builders.mjs b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/attribute_builders.mjs new file mode 100644 index 0000000..824392a --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/attribute_builders.mjs
@@ -0,0 +1,40 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import '../environment/dev'; +import { createAttributePrefix } from '../internals/attribute_impl'; +import { assertIsTemplateObject } from '../internals/string_literal'; +import { SECURITY_SENSITIVE_ATTRIBUTES } from './sensitive_attributes'; +/** + * Creates a SafeAttributePrefix object from a template literal with no + * interpolations for attributes that share a common prefix guaranteed to be not + * security sensitive. + * + * The template literal is a prefix that makes it obvious this attribute is not + * security sensitive. If it doesn't, this function will throw. + */ +export function safeAttrPrefix(templ) { + if (process.env.NODE_ENV !== 'production') { + assertIsTemplateObject(templ, true, 'safeAttr is a template literal tag function ' + + 'and should be called using the tagged template syntax. ' + + 'For example, safeAttr`foo`;'); + } + const attrPrefix = templ[0].toLowerCase(); + if (process.env.NODE_ENV !== 'production') { + if (attrPrefix.indexOf('on') === 0 || 'on'.indexOf(attrPrefix) === 0) { + throw new Error(`Prefix '${templ[0]}' does not guarantee the attribute ` + + `to be safe as it is also a prefix for event handler attributes` + + `Please use 'addEventListener' to set event handlers.`); + } + SECURITY_SENSITIVE_ATTRIBUTES.forEach(sensitiveAttr => { + if (sensitiveAttr.indexOf(attrPrefix) === 0) { + throw new Error(`Prefix '${templ[0]}' does not guarantee the attribute ` + + `to be safe as it is also a prefix for ` + + `the security sensitive attribute '${sensitiveAttr}'. ` + + `Please use native or safe DOM APIs to set the attribute.`); + } + }); + } + return createAttributePrefix(attrPrefix); +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/html_builders.d.ts b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/html_builders.d.ts new file mode 100644 index 0000000..9c4598f --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/html_builders.d.ts
@@ -0,0 +1,39 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import { SafeHtml } from '../internals/html_impl'; +import { TrustedResourceUrl } from '../internals/resource_url_impl'; +import { SafeScript } from '../internals/script_impl'; +/** + * Returns HTML-escaped text as a `SafeHtml` object. + * + * Available options: + * - `preserveSpaces` turns every second consecutive space character into its + * HTML entity representation (` `). + * - `preserveNewlines` turns newline characters into breaks (`<br>`). + * - `preserveTabs` wraps tab characters in a span with style=white-space:pre. + */ +export declare function htmlEscape(text: string, options?: { + preserveNewlines?: boolean; + preserveSpaces?: boolean; + preserveTabs?: boolean; +}): SafeHtml; +/** + * Creates a `SafeHtml` representing a script tag with inline script content. + */ +export declare function scriptToHtml(script: SafeScript, options?: { + id?: string; + nonce?: string; + type?: string; +}): SafeHtml; +/** + * Creates a `SafeHtml` representing a script tag with the src attribute. + * This also supports CSP nonces and async loading. + */ +export declare function scriptUrlToHtml(src: TrustedResourceUrl, options?: { + async?: boolean; + nonce?: string; +}): SafeHtml; +/** Creates a `SafeHtml` value by concatenating multiple `SafeHtml`s. */ +export declare function concatHtmls(htmls: readonly SafeHtml[]): SafeHtml;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/html_builders.js b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/html_builders.js new file mode 100644 index 0000000..a6dcd1c --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/html_builders.js
@@ -0,0 +1,90 @@ +"use strict"; +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.concatHtmls = exports.scriptUrlToHtml = exports.scriptToHtml = exports.htmlEscape = void 0; +var html_impl_1 = require("../internals/html_impl"); +var resource_url_impl_1 = require("../internals/resource_url_impl"); +var script_impl_1 = require("../internals/script_impl"); +/** + * Returns HTML-escaped text as a `SafeHtml` object. + * + * Available options: + * - `preserveSpaces` turns every second consecutive space character into its + * HTML entity representation (` `). + * - `preserveNewlines` turns newline characters into breaks (`<br>`). + * - `preserveTabs` wraps tab characters in a span with style=white-space:pre. + */ +function htmlEscape(text, options) { + if (options === void 0) { options = {}; } + var htmlEscapedString = htmlEscapeToString(text); + if (options.preserveSpaces) { + // Do this first to ensure we preserve spaces after newlines and tabs. + htmlEscapedString = + htmlEscapedString.replace(/(^|[\r\n\t ]) /g, '$1 '); + } + if (options.preserveNewlines) { + htmlEscapedString = htmlEscapedString.replace(/(\r\n|\n|\r)/g, '<br>'); + } + if (options.preserveTabs) { + htmlEscapedString = htmlEscapedString.replace(/(\t+)/g, '<span style="white-space:pre">$1</span>'); + } + return (0, html_impl_1.createHtml)(htmlEscapedString); +} +exports.htmlEscape = htmlEscape; +/** + * Creates a `SafeHtml` representing a script tag with inline script content. + */ +function scriptToHtml(script, options) { + if (options === void 0) { options = {}; } + var unwrappedScript = (0, script_impl_1.unwrapScript)(script).toString(); + var stringTag = "<script"; + if (options.id) { + stringTag += " id=\"".concat(htmlEscapeToString(options.id), "\""); + } + if (options.nonce) { + stringTag += " nonce=\"".concat(htmlEscapeToString(options.nonce), "\""); + } + if (options.type) { + stringTag += " type=\"".concat(htmlEscapeToString(options.type), "\""); + } + stringTag += ">".concat(unwrappedScript, "</script>"); + return (0, html_impl_1.createHtml)(stringTag); +} +exports.scriptToHtml = scriptToHtml; +/** + * Creates a `SafeHtml` representing a script tag with the src attribute. + * This also supports CSP nonces and async loading. + */ +function scriptUrlToHtml(src, options) { + if (options === void 0) { options = {}; } + var unwrappedSrc = (0, resource_url_impl_1.unwrapResourceUrl)(src).toString(); + var stringTag = "<script src=\"".concat(htmlEscapeToString(unwrappedSrc), "\""); + if (options.async) { + stringTag += ' async'; + } + if (options.nonce) { + stringTag += " nonce=\"".concat(htmlEscapeToString(options.nonce), "\""); + } + stringTag += '>\u003C/script>'; + return (0, html_impl_1.createHtml)(stringTag); +} +exports.scriptUrlToHtml = scriptUrlToHtml; +/** + * HTML-escapes the given text (`&`, `<`, `>`, `"` and `'`). + */ +function htmlEscapeToString(text) { + var escaped = text.replace(/&/g, '&') + .replace(/</g, '<') + .replace(/>/g, '>') + .replace(/"/g, '"') + .replace(/'/g, '''); + return escaped; +} +/** Creates a `SafeHtml` value by concatenating multiple `SafeHtml`s. */ +function concatHtmls(htmls) { + return (0, html_impl_1.createHtml)(htmls.map(html_impl_1.unwrapHtml).join('')); +} +exports.concatHtmls = concatHtmls;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/html_builders.mjs b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/html_builders.mjs new file mode 100644 index 0000000..a8620ac --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/html_builders.mjs
@@ -0,0 +1,80 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import { createHtml, unwrapHtml } from '../internals/html_impl'; +import { unwrapResourceUrl } from '../internals/resource_url_impl'; +import { unwrapScript } from '../internals/script_impl'; +/** + * Returns HTML-escaped text as a `SafeHtml` object. + * + * Available options: + * - `preserveSpaces` turns every second consecutive space character into its + * HTML entity representation (` `). + * - `preserveNewlines` turns newline characters into breaks (`<br>`). + * - `preserveTabs` wraps tab characters in a span with style=white-space:pre. + */ +export function htmlEscape(text, options = {}) { + let htmlEscapedString = htmlEscapeToString(text); + if (options.preserveSpaces) { + // Do this first to ensure we preserve spaces after newlines and tabs. + htmlEscapedString = + htmlEscapedString.replace(/(^|[\r\n\t ]) /g, '$1 '); + } + if (options.preserveNewlines) { + htmlEscapedString = htmlEscapedString.replace(/(\r\n|\n|\r)/g, '<br>'); + } + if (options.preserveTabs) { + htmlEscapedString = htmlEscapedString.replace(/(\t+)/g, '<span style="white-space:pre">$1</span>'); + } + return createHtml(htmlEscapedString); +} +/** + * Creates a `SafeHtml` representing a script tag with inline script content. + */ +export function scriptToHtml(script, options = {}) { + const unwrappedScript = unwrapScript(script).toString(); + let stringTag = `<script`; + if (options.id) { + stringTag += ` id="${htmlEscapeToString(options.id)}"`; + } + if (options.nonce) { + stringTag += ` nonce="${htmlEscapeToString(options.nonce)}"`; + } + if (options.type) { + stringTag += ` type="${htmlEscapeToString(options.type)}"`; + } + stringTag += `>${unwrappedScript}\u003C/script>`; + return createHtml(stringTag); +} +/** + * Creates a `SafeHtml` representing a script tag with the src attribute. + * This also supports CSP nonces and async loading. + */ +export function scriptUrlToHtml(src, options = {}) { + const unwrappedSrc = unwrapResourceUrl(src).toString(); + let stringTag = `<script src="${htmlEscapeToString(unwrappedSrc)}"`; + if (options.async) { + stringTag += ' async'; + } + if (options.nonce) { + stringTag += ` nonce="${htmlEscapeToString(options.nonce)}"`; + } + stringTag += '>\u003C/script>'; + return createHtml(stringTag); +} +/** + * HTML-escapes the given text (`&`, `<`, `>`, `"` and `'`). + */ +function htmlEscapeToString(text) { + const escaped = text.replace(/&/g, '&') + .replace(/</g, '<') + .replace(/>/g, '>') + .replace(/"/g, '"') + .replace(/'/g, '''); + return escaped; +} +/** Creates a `SafeHtml` value by concatenating multiple `SafeHtml`s. */ +export function concatHtmls(htmls) { + return createHtml(htmls.map(unwrapHtml).join('')); +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/html_sanitizer/html_sanitizer.d.ts b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/html_sanitizer/html_sanitizer.d.ts new file mode 100644 index 0000000..0d501923 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/html_sanitizer/html_sanitizer.d.ts
@@ -0,0 +1,44 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import '../../environment/dev'; +import { SafeHtml } from '../../internals/html_impl'; +import { SanitizerTable } from './sanitizer_table/sanitizer_table'; +/** + * An HTML5-compliant markup sanitizer that produces SafeHtml markup. + * + * You can build sanitizers with a custom configuration using the + * HtmlSanitizerBuilder. + */ +export interface HtmlSanitizer { + sanitize(html: string): SafeHtml; + sanitizeToFragment(html: string): DocumentFragment; + sanitizeAssertUnchanged(html: string): SafeHtml; +} +/** Implementation for `HtmlSanitizer` */ +export declare class HtmlSanitizerImpl implements HtmlSanitizer { + private readonly sanitizerTable; + private changes; + constructor(sanitizerTable: SanitizerTable, token: object); + sanitizeAssertUnchanged(html: string): SafeHtml; + sanitize(html: string): SafeHtml; + sanitizeToFragment(html: string): DocumentFragment; + private sanitizeTextNode; + private sanitizeElementNode; + nodeFilter(node: Node): number; + private recordChange; + private satisfiesAllConditions; +} +/** Sanitizes untrusted html using the default sanitizer configuration. */ +export declare function sanitizeHtml(html: string): SafeHtml; +/** + * Sanitizes untrusted html using the default sanitizer configuration. Throws + * an error if the html was changed. + */ +export declare function sanitizeHtmlAssertUnchanged(html: string): SafeHtml; +/** + * Sanitizes untrusted html using the default sanitizer configuration. Throws + * an error if the html was changed. + */ +export declare function sanitizeHtmlToFragment(html: string): DocumentFragment;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/html_sanitizer/html_sanitizer.js b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/html_sanitizer/html_sanitizer.js new file mode 100644 index 0000000..39961a6 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/html_sanitizer/html_sanitizer.js
@@ -0,0 +1,270 @@ +"use strict"; +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +var __values = (this && this.__values) || function(o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; + if (m) return m.call(o); + if (o && typeof o.length === "number") return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); +}; +var __read = (this && this.__read) || function (o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.sanitizeHtmlToFragment = exports.sanitizeHtmlAssertUnchanged = exports.sanitizeHtml = exports.HtmlSanitizerImpl = void 0; +require("../../environment/dev"); +var html_impl_1 = require("../../internals/html_impl"); +/* g3_import_pure from '../../internals/pure' */ +var secrets_1 = require("../../internals/secrets"); +var url_sanitizer_1 = require("../url_sanitizer"); +var inert_fragment_1 = require("./inert_fragment"); +var no_clobber_1 = require("./no_clobber"); +var default_sanitizer_table_1 = require("./sanitizer_table/default_sanitizer_table"); +var sanitizer_table_1 = require("./sanitizer_table/sanitizer_table"); +/** Implementation for `HtmlSanitizer` */ +var HtmlSanitizerImpl = /** @class */ (function () { + function HtmlSanitizerImpl(sanitizerTable, token) { + this.sanitizerTable = sanitizerTable; + this.changes = []; + (0, secrets_1.ensureTokenIsValid)(token); + } + HtmlSanitizerImpl.prototype.sanitizeAssertUnchanged = function (html) { + this.changes = []; + var sanitizedHtml = this.sanitize(html); + if (this.changes.length !== 0) { + var message = ''; + if (process.env.NODE_ENV !== 'production') { + message = + "Unexpected change to HTML value as a result of sanitization. " + + "Input: \"".concat(html, "\", sanitized output: \"").concat(sanitizedHtml, "\"\n") + + "List of changes:".concat(this.changes.join('\n')); + } + throw new Error(message); + } + return sanitizedHtml; + }; + HtmlSanitizerImpl.prototype.sanitize = function (html) { + var fakeRoot = document.createElement('span'); + fakeRoot.appendChild(this.sanitizeToFragment(html)); + // XML serialization is preferred over HTML serialization as it is + // stricter and makes sure all attributes are properly escaped, avoiding + // cases where the tree might mutate when parsed again later due to the + // complexities of the HTML parsing algorithm + var serializedNewTree = new XMLSerializer().serializeToString(fakeRoot); + // We remove the outer most element as this is the span node created as + // the root for the sanitized tree and contains a spurious xmlns attribute + // from the XML serialization step. + serializedNewTree = serializedNewTree.slice(serializedNewTree.indexOf('>') + 1, serializedNewTree.lastIndexOf('</')); + return (0, html_impl_1.createHtml)(serializedNewTree); + }; + HtmlSanitizerImpl.prototype.sanitizeToFragment = function (html) { + var _this = this; + var dirtyFragment = (0, inert_fragment_1.createInertFragment)(html); + var treeWalker = document.createTreeWalker(dirtyFragment, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_TEXT, + // IE10 and IE11 won't accept a proper `NodeFilter` interface, and + // expect the filtering function to be passed directly. It seems that + // other browsers also do not mind getting the function directly. see + // https://stackoverflow.com/q/38245898 + (function (n) { return _this.nodeFilter(n); }), + // @ts-ignore: error TS2554: Expected 1-3 arguments, but got 4. + false); + // `nextNode` is called so we skip the root `DocumentFragment`. + var currentNode = treeWalker.nextNode(); + // We create a root element to attach all the children of the body to. We + // use div as it as a semantic-free, generic container and does not + // represent anything. This is removed when we serialize the tree back + // into a string. + var sanitizedFragment = document.createDocumentFragment(); + var sanitizedParent = sanitizedFragment; + while (currentNode !== null) { + var sanitizedNode = void 0; + if ((0, no_clobber_1.isText)(currentNode)) { + sanitizedNode = this.sanitizeTextNode(currentNode); + } + else if ((0, no_clobber_1.isElement)(currentNode)) { + sanitizedNode = this.sanitizeElementNode(currentNode); + } + else { + var message = ''; + if (process.env.NODE_ENV !== 'production') { + message = 'Node is not of type text or element'; + } + throw new Error(message); + } + sanitizedParent.appendChild(sanitizedNode); + // Advance iterator while keeping track of the sanitized parent for the + // current node + currentNode = treeWalker.firstChild(); + if (currentNode) { + sanitizedParent = sanitizedNode; + } + else { + while (!(currentNode = treeWalker.nextSibling())) { + if (!(currentNode = treeWalker.parentNode())) { + break; + } + sanitizedParent = sanitizedParent.parentNode; + } + } + } + return sanitizedFragment; + }; + HtmlSanitizerImpl.prototype.sanitizeTextNode = function (textNode) { + return document.createTextNode(textNode.data); + }; + HtmlSanitizerImpl.prototype.sanitizeElementNode = function (elementNode) { + var e_1, _a; + var elementName = (0, no_clobber_1.getNodeName)(elementNode); + var newNode = document.createElement(elementName); + var dirtyAttributes = elementNode.attributes; + try { + for (var dirtyAttributes_1 = __values(dirtyAttributes), dirtyAttributes_1_1 = dirtyAttributes_1.next(); !dirtyAttributes_1_1.done; dirtyAttributes_1_1 = dirtyAttributes_1.next()) { + var _b = dirtyAttributes_1_1.value, name_1 = _b.name, value = _b.value; + var policy = this.sanitizerTable.getAttributePolicy(name_1, elementName); + if (!this.satisfiesAllConditions(policy.conditions, dirtyAttributes)) { + this.recordChange("Not all conditions satisfied for attribute: ".concat(name_1, ".")); + continue; + } + switch (policy.policyAction) { + case sanitizer_table_1.AttributePolicyAction.KEEP: + newNode.setAttribute(name_1, value); + break; + case sanitizer_table_1.AttributePolicyAction.KEEP_AND_SANITIZE_URL: + var sanitizedAttrUrl = (0, url_sanitizer_1.restrictivelySanitizeUrl)(value); + if (sanitizedAttrUrl !== value) { + this.recordChange("Url in attribute ".concat(name_1, " was modified during sanitization. Original url:\"").concat(value, "\" was sanitized to: \"").concat(sanitizedAttrUrl, "\"")); + } + newNode.setAttribute(name_1, sanitizedAttrUrl); + break; + case sanitizer_table_1.AttributePolicyAction.KEEP_AND_NORMALIZE: + // We don't consider changing the case of an attribute value to be a + // semantic change + newNode.setAttribute(name_1, value.toLowerCase()); + break; + case sanitizer_table_1.AttributePolicyAction.KEEP_AND_SANITIZE_STYLE: + newNode.setAttribute(name_1, value); + break; + case sanitizer_table_1.AttributePolicyAction.DROP: + this.recordChange("Attribute: ".concat(name_1, " was dropped")); + break; + default: + if (process.env.NODE_ENV !== 'production') { + checkExhaustive(policy.policyAction, 'Unhandled AttributePolicyAction case'); + } + } + } + } + catch (e_1_1) { e_1 = { error: e_1_1 }; } + finally { + try { + if (dirtyAttributes_1_1 && !dirtyAttributes_1_1.done && (_a = dirtyAttributes_1.return)) _a.call(dirtyAttributes_1); + } + finally { if (e_1) throw e_1.error; } + } + return newNode; + }; + HtmlSanitizerImpl.prototype.nodeFilter = function (node) { + if ((0, no_clobber_1.isText)(node)) { + return NodeFilter.FILTER_ACCEPT; + } + else if (!(0, no_clobber_1.isElement)(node)) { + // Getting a node that is neither an `Element` or a `Text` node. This is + // likely due to something that is not supposed to be an element in user + // code but recognized as such by the TreeWalker (e.g. a polyfill for + // other kind of nodes). Since we can't recognize it as an element, we + // drop the node, but we don't record it as a meaningful change. + return NodeFilter.FILTER_REJECT; + } + var nodeName = (0, no_clobber_1.getNodeName)(node); + if (nodeName === null) { + this.recordChange("Node name was null for node: ".concat(node)); + return NodeFilter.FILTER_REJECT; + } + if (this.sanitizerTable.isAllowedElement(nodeName)) { + return NodeFilter.FILTER_ACCEPT; + } + this.recordChange("Element: ".concat(nodeName, " was dropped")); + return NodeFilter.FILTER_REJECT; + }; + HtmlSanitizerImpl.prototype.recordChange = function (errorMessage) { + if (process.env.NODE_ENV !== 'production') { + this.changes.push(errorMessage); + } + else if (this.changes.length === 0) { + this.changes.push(''); + } + }; + HtmlSanitizerImpl.prototype.satisfiesAllConditions = function (conditions, attrs) { + var e_2, _a; + var _b; + if (!conditions) { + return true; + } + try { + for (var conditions_1 = __values(conditions), conditions_1_1 = conditions_1.next(); !conditions_1_1.done; conditions_1_1 = conditions_1.next()) { + var _c = __read(conditions_1_1.value, 2), attrName = _c[0], expectedValues = _c[1]; + var value = (_b = attrs.getNamedItem(attrName)) === null || _b === void 0 ? void 0 : _b.value; + if (value && !expectedValues.has(value)) { + return false; + } + } + } + catch (e_2_1) { e_2 = { error: e_2_1 }; } + finally { + try { + if (conditions_1_1 && !conditions_1_1.done && (_a = conditions_1.return)) _a.call(conditions_1); + } + finally { if (e_2) throw e_2.error; } + } + return true; + }; + return HtmlSanitizerImpl; +}()); +exports.HtmlSanitizerImpl = HtmlSanitizerImpl; +var defaultHtmlSanitizer = +/* #__PURE__ */ (function () { return new HtmlSanitizerImpl(default_sanitizer_table_1.defaultSanitizerTable, secrets_1.secretToken); })(); +/** Sanitizes untrusted html using the default sanitizer configuration. */ +function sanitizeHtml(html) { + return defaultHtmlSanitizer.sanitize(html); +} +exports.sanitizeHtml = sanitizeHtml; +/** + * Sanitizes untrusted html using the default sanitizer configuration. Throws + * an error if the html was changed. + */ +function sanitizeHtmlAssertUnchanged(html) { + return defaultHtmlSanitizer.sanitizeAssertUnchanged(html); +} +exports.sanitizeHtmlAssertUnchanged = sanitizeHtmlAssertUnchanged; +/** + * Sanitizes untrusted html using the default sanitizer configuration. Throws + * an error if the html was changed. + */ +function sanitizeHtmlToFragment(html) { + return defaultHtmlSanitizer.sanitizeToFragment(html); +} +exports.sanitizeHtmlToFragment = sanitizeHtmlToFragment; +function checkExhaustive(value, msg) { + if (msg === void 0) { msg = "unexpected value ".concat(value, "!"); } + throw new Error(msg); +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/html_sanitizer/html_sanitizer.mjs b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/html_sanitizer/html_sanitizer.mjs new file mode 100644 index 0000000..44ba9305 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/html_sanitizer/html_sanitizer.mjs
@@ -0,0 +1,211 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import '../../environment/dev'; +import { createHtml } from '../../internals/html_impl'; +/* g3_import_pure from '../../internals/pure' */ +import { ensureTokenIsValid, secretToken } from '../../internals/secrets'; +import { restrictivelySanitizeUrl } from '../url_sanitizer'; +import { createInertFragment } from './inert_fragment'; +import { getNodeName, isElement, isText } from './no_clobber'; +import { defaultSanitizerTable } from './sanitizer_table/default_sanitizer_table'; +import { AttributePolicyAction } from './sanitizer_table/sanitizer_table'; +/** Implementation for `HtmlSanitizer` */ +export class HtmlSanitizerImpl { + sanitizerTable; + changes = []; + constructor(sanitizerTable, token) { + this.sanitizerTable = sanitizerTable; + ensureTokenIsValid(token); + } + sanitizeAssertUnchanged(html) { + this.changes = []; + const sanitizedHtml = this.sanitize(html); + if (this.changes.length !== 0) { + let message = ''; + if (process.env.NODE_ENV !== 'production') { + message = + `Unexpected change to HTML value as a result of sanitization. ` + + `Input: "${html}", sanitized output: "${sanitizedHtml}"\n` + + `List of changes:${this.changes.join('\n')}`; + } + throw new Error(message); + } + return sanitizedHtml; + } + sanitize(html) { + const fakeRoot = document.createElement('span'); + fakeRoot.appendChild(this.sanitizeToFragment(html)); + // XML serialization is preferred over HTML serialization as it is + // stricter and makes sure all attributes are properly escaped, avoiding + // cases where the tree might mutate when parsed again later due to the + // complexities of the HTML parsing algorithm + let serializedNewTree = new XMLSerializer().serializeToString(fakeRoot); + // We remove the outer most element as this is the span node created as + // the root for the sanitized tree and contains a spurious xmlns attribute + // from the XML serialization step. + serializedNewTree = serializedNewTree.slice(serializedNewTree.indexOf('>') + 1, serializedNewTree.lastIndexOf('</')); + return createHtml(serializedNewTree); + } + sanitizeToFragment(html) { + const dirtyFragment = createInertFragment(html); + const treeWalker = document.createTreeWalker(dirtyFragment, NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_TEXT, + // IE10 and IE11 won't accept a proper `NodeFilter` interface, and + // expect the filtering function to be passed directly. It seems that + // other browsers also do not mind getting the function directly. see + // https://stackoverflow.com/q/38245898 + ((n) => this.nodeFilter(n)), + // @ts-ignore: error TS2554: Expected 1-3 arguments, but got 4. + false); + // `nextNode` is called so we skip the root `DocumentFragment`. + let currentNode = treeWalker.nextNode(); + // We create a root element to attach all the children of the body to. We + // use div as it as a semantic-free, generic container and does not + // represent anything. This is removed when we serialize the tree back + // into a string. + const sanitizedFragment = document.createDocumentFragment(); + let sanitizedParent = sanitizedFragment; + while (currentNode !== null) { + let sanitizedNode; + if (isText(currentNode)) { + sanitizedNode = this.sanitizeTextNode(currentNode); + } + else if (isElement(currentNode)) { + sanitizedNode = this.sanitizeElementNode(currentNode); + } + else { + let message = ''; + if (process.env.NODE_ENV !== 'production') { + message = 'Node is not of type text or element'; + } + throw new Error(message); + } + sanitizedParent.appendChild(sanitizedNode); + // Advance iterator while keeping track of the sanitized parent for the + // current node + currentNode = treeWalker.firstChild(); + if (currentNode) { + sanitizedParent = sanitizedNode; + } + else { + while (!(currentNode = treeWalker.nextSibling())) { + if (!(currentNode = treeWalker.parentNode())) { + break; + } + sanitizedParent = sanitizedParent.parentNode; + } + } + } + return sanitizedFragment; + } + sanitizeTextNode(textNode) { + return document.createTextNode(textNode.data); + } + sanitizeElementNode(elementNode) { + const elementName = getNodeName(elementNode); + const newNode = document.createElement(elementName); + const dirtyAttributes = elementNode.attributes; + for (const { name, value } of dirtyAttributes) { + const policy = this.sanitizerTable.getAttributePolicy(name, elementName); + if (!this.satisfiesAllConditions(policy.conditions, dirtyAttributes)) { + this.recordChange(`Not all conditions satisfied for attribute: ${name}.`); + continue; + } + switch (policy.policyAction) { + case AttributePolicyAction.KEEP: + newNode.setAttribute(name, value); + break; + case AttributePolicyAction.KEEP_AND_SANITIZE_URL: + const sanitizedAttrUrl = restrictivelySanitizeUrl(value); + if (sanitizedAttrUrl !== value) { + this.recordChange(`Url in attribute ${name} was modified during sanitization. Original url:"${value}" was sanitized to: "${sanitizedAttrUrl}"`); + } + newNode.setAttribute(name, sanitizedAttrUrl); + break; + case AttributePolicyAction.KEEP_AND_NORMALIZE: + // We don't consider changing the case of an attribute value to be a + // semantic change + newNode.setAttribute(name, value.toLowerCase()); + break; + case AttributePolicyAction.KEEP_AND_SANITIZE_STYLE: + newNode.setAttribute(name, value); + break; + case AttributePolicyAction.DROP: + this.recordChange(`Attribute: ${name} was dropped`); + break; + default: + if (process.env.NODE_ENV !== 'production') { + checkExhaustive(policy.policyAction, 'Unhandled AttributePolicyAction case'); + } + } + } + return newNode; + } + nodeFilter(node) { + if (isText(node)) { + return NodeFilter.FILTER_ACCEPT; + } + else if (!isElement(node)) { + // Getting a node that is neither an `Element` or a `Text` node. This is + // likely due to something that is not supposed to be an element in user + // code but recognized as such by the TreeWalker (e.g. a polyfill for + // other kind of nodes). Since we can't recognize it as an element, we + // drop the node, but we don't record it as a meaningful change. + return NodeFilter.FILTER_REJECT; + } + const nodeName = getNodeName(node); + if (nodeName === null) { + this.recordChange(`Node name was null for node: ${node}`); + return NodeFilter.FILTER_REJECT; + } + if (this.sanitizerTable.isAllowedElement(nodeName)) { + return NodeFilter.FILTER_ACCEPT; + } + this.recordChange(`Element: ${nodeName} was dropped`); + return NodeFilter.FILTER_REJECT; + } + recordChange(errorMessage) { + if (process.env.NODE_ENV !== 'production') { + this.changes.push(errorMessage); + } + else if (this.changes.length === 0) { + this.changes.push(''); + } + } + satisfiesAllConditions(conditions, attrs) { + if (!conditions) { + return true; + } + for (const [attrName, expectedValues] of conditions) { + const value = attrs.getNamedItem(attrName)?.value; + if (value && !expectedValues.has(value)) { + return false; + } + } + return true; + } +} +const defaultHtmlSanitizer = +/* #__PURE__ */ (() => new HtmlSanitizerImpl(defaultSanitizerTable, secretToken))(); +/** Sanitizes untrusted html using the default sanitizer configuration. */ +export function sanitizeHtml(html) { + return defaultHtmlSanitizer.sanitize(html); +} +/** + * Sanitizes untrusted html using the default sanitizer configuration. Throws + * an error if the html was changed. + */ +export function sanitizeHtmlAssertUnchanged(html) { + return defaultHtmlSanitizer.sanitizeAssertUnchanged(html); +} +/** + * Sanitizes untrusted html using the default sanitizer configuration. Throws + * an error if the html was changed. + */ +export function sanitizeHtmlToFragment(html) { + return defaultHtmlSanitizer.sanitizeToFragment(html); +} +function checkExhaustive(value, msg = `unexpected value ${value}!`) { + throw new Error(msg); +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/html_sanitizer/html_sanitizer_builder.d.ts b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/html_sanitizer/html_sanitizer_builder.d.ts new file mode 100644 index 0000000..d706ba25 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/html_sanitizer/html_sanitizer_builder.d.ts
@@ -0,0 +1,56 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import { HtmlSanitizer } from './html_sanitizer'; +/** This class allows modifications to the default sanitizer configuration. */ +export declare class HtmlSanitizerBuilder { + private sanitizerTable; + private calledBuild; + constructor(); + /** Builder option to restrict allowed elements to a smaller subset. */ + onlyAllowElements(elementSet: ReadonlySet<string>): HtmlSanitizerBuilder; + /** + * Builder option to restrict allowed attributes to a smaller subset. + * + * If the attribute isn't currently allowed then it won't be added. + */ + onlyAllowAttributes(attributeSet: ReadonlySet<string>): HtmlSanitizerBuilder; + /** + * Allows the set of data attributes passed. + * + * These values must be prefixed with "data-" + * + * If called with onlyAllowElements or onlyAllowAttributes, those methods must + * be called first. + */ + allowDataAttributes(attributes: string[]): HtmlSanitizerBuilder; + /** + * Preserves style attributes. Note that the sanitizer won't parse and + * sanitize the values but keep them as they are. In particular this means + * that the code will be able to call functions that could do undesirable + * things (e.g. `url` to trigger a network request), as well as any custom + * properties or functions defined by the application. + */ + allowStyleAttributes(): HtmlSanitizerBuilder; + /** + * Preserves the class attribute on all elements. This means contents can + * adopt CSS styles from other page elements and possibly mask themselves as + * legitimate UI elements, which can lead to phishing. + */ + allowClassAttributes(): HtmlSanitizerBuilder; + /** + * Preserves id attributes. This carries moderate risk as it allows an + * element to override other elements with the same ID. + */ + allowIdAttributes(): HtmlSanitizerBuilder; + /** + * Preserves (some) attributes that reference existing ids. This carries a + * moderate security risk, because sanitized content can create semantic + * associations with existing elements in the page, regardless of the layout. + * This could be used to override the label associated with a form input by a + * screen reader, and facilitate phishing. + */ + allowIdReferenceAttributes(): HtmlSanitizerBuilder; + build(): HtmlSanitizer; +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/html_sanitizer/html_sanitizer_builder.js b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/html_sanitizer/html_sanitizer_builder.js new file mode 100644 index 0000000..2356149 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/html_sanitizer/html_sanitizer_builder.js
@@ -0,0 +1,234 @@ +"use strict"; +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +var __values = (this && this.__values) || function(o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; + if (m) return m.call(o); + if (o && typeof o.length === "number") return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); +}; +var __read = (this && this.__read) || function (o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.HtmlSanitizerBuilder = void 0; +var secrets_1 = require("../../internals/secrets"); +var html_sanitizer_1 = require("./html_sanitizer"); +var default_sanitizer_table_1 = require("./sanitizer_table/default_sanitizer_table"); +var sanitizer_table_1 = require("./sanitizer_table/sanitizer_table"); +/** This class allows modifications to the default sanitizer configuration. */ +var HtmlSanitizerBuilder = /** @class */ (function () { + function HtmlSanitizerBuilder() { + // To denote if the builder has called build() and therefore should make no + // further changes to the sanitizer table. + this.calledBuild = false; + this.sanitizerTable = default_sanitizer_table_1.defaultSanitizerTable; + } + /** Builder option to restrict allowed elements to a smaller subset. */ + HtmlSanitizerBuilder.prototype.onlyAllowElements = function (elementSet) { + var e_1, _a; + var allowedElements = new Set(); + var allowedElementPolicies = new Map(); + try { + for (var elementSet_1 = __values(elementSet), elementSet_1_1 = elementSet_1.next(); !elementSet_1_1.done; elementSet_1_1 = elementSet_1.next()) { + var element = elementSet_1_1.value; + element = element.toUpperCase(); + if (!this.sanitizerTable.isAllowedElement(element)) { + throw new Error("Element: ".concat(element, ", is not allowed by html5_contract.textpb")); + } + var elementPolicy = this.sanitizerTable.elementPolicies.get(element); + if (elementPolicy !== undefined) { + allowedElementPolicies.set(element, elementPolicy); + } + else { + allowedElements.add(element); + } + } + } + catch (e_1_1) { e_1 = { error: e_1_1 }; } + finally { + try { + if (elementSet_1_1 && !elementSet_1_1.done && (_a = elementSet_1.return)) _a.call(elementSet_1); + } + finally { if (e_1) throw e_1.error; } + } + this.sanitizerTable = new sanitizer_table_1.SanitizerTable(allowedElements, allowedElementPolicies, this.sanitizerTable.allowedGlobalAttributes, this.sanitizerTable.globalAttributePolicies); + return this; + }; + /** + * Builder option to restrict allowed attributes to a smaller subset. + * + * If the attribute isn't currently allowed then it won't be added. + */ + HtmlSanitizerBuilder.prototype.onlyAllowAttributes = function (attributeSet) { + var e_2, _a, e_3, _b, e_4, _c; + var allowedGlobalAttributes = new Set(); + var globalAttributePolicies = new Map(); + var elementPolicies = new Map(); + try { + for (var attributeSet_1 = __values(attributeSet), attributeSet_1_1 = attributeSet_1.next(); !attributeSet_1_1.done; attributeSet_1_1 = attributeSet_1.next()) { + var attribute = attributeSet_1_1.value; + if (this.sanitizerTable.allowedGlobalAttributes.has(attribute)) { + allowedGlobalAttributes.add(attribute); + } + if (this.sanitizerTable.globalAttributePolicies.has(attribute)) { + globalAttributePolicies.set(attribute, this.sanitizerTable.globalAttributePolicies.get(attribute)); + } + } + } + catch (e_2_1) { e_2 = { error: e_2_1 }; } + finally { + try { + if (attributeSet_1_1 && !attributeSet_1_1.done && (_a = attributeSet_1.return)) _a.call(attributeSet_1); + } + finally { if (e_2) throw e_2.error; } + } + try { + for (var _d = __values(this.sanitizerTable + .elementPolicies.entries()), _e = _d.next(); !_e.done; _e = _d.next()) { + var _f = __read(_e.value, 2), elementName = _f[0], originalElementPolicy = _f[1]; + var newElementPolicy = new Map(); + try { + for (var _g = (e_4 = void 0, __values(originalElementPolicy + .entries())), _h = _g.next(); !_h.done; _h = _g.next()) { + var _j = __read(_h.value, 2), attribute = _j[0], attributePolicy = _j[1]; + if (attributeSet.has(attribute)) { + newElementPolicy.set(attribute, attributePolicy); + } + } + } + catch (e_4_1) { e_4 = { error: e_4_1 }; } + finally { + try { + if (_h && !_h.done && (_c = _g.return)) _c.call(_g); + } + finally { if (e_4) throw e_4.error; } + } + elementPolicies.set(elementName, newElementPolicy); + } + } + catch (e_3_1) { e_3 = { error: e_3_1 }; } + finally { + try { + if (_e && !_e.done && (_b = _d.return)) _b.call(_d); + } + finally { if (e_3) throw e_3.error; } + } + this.sanitizerTable = new sanitizer_table_1.SanitizerTable(this.sanitizerTable.allowedElements, elementPolicies, allowedGlobalAttributes, globalAttributePolicies); + return this; + }; + /** + * Allows the set of data attributes passed. + * + * These values must be prefixed with "data-" + * + * If called with onlyAllowElements or onlyAllowAttributes, those methods must + * be called first. + */ + HtmlSanitizerBuilder.prototype.allowDataAttributes = function (attributes) { + var e_5, _a; + var allowedGlobalAttributes = new Set(this.sanitizerTable.allowedGlobalAttributes); + try { + for (var attributes_1 = __values(attributes), attributes_1_1 = attributes_1.next(); !attributes_1_1.done; attributes_1_1 = attributes_1.next()) { + var attribute = attributes_1_1.value; + if (attribute.indexOf('data-') !== 0) { + throw new Error("data attribute: ".concat(attribute, " does not begin with the prefix \"data-\"")); + } + allowedGlobalAttributes.add(attribute); + } + } + catch (e_5_1) { e_5 = { error: e_5_1 }; } + finally { + try { + if (attributes_1_1 && !attributes_1_1.done && (_a = attributes_1.return)) _a.call(attributes_1); + } + finally { if (e_5) throw e_5.error; } + } + this.sanitizerTable = new sanitizer_table_1.SanitizerTable(this.sanitizerTable.allowedElements, this.sanitizerTable.elementPolicies, allowedGlobalAttributes, this.sanitizerTable.globalAttributePolicies); + return this; + }; + /** + * Preserves style attributes. Note that the sanitizer won't parse and + * sanitize the values but keep them as they are. In particular this means + * that the code will be able to call functions that could do undesirable + * things (e.g. `url` to trigger a network request), as well as any custom + * properties or functions defined by the application. + */ + HtmlSanitizerBuilder.prototype.allowStyleAttributes = function () { + var globalAttributePolicies = new Map(this.sanitizerTable.globalAttributePolicies); + globalAttributePolicies.set('style', { + policyAction: sanitizer_table_1.AttributePolicyAction.KEEP_AND_SANITIZE_STYLE, + }); + this.sanitizerTable = new sanitizer_table_1.SanitizerTable(this.sanitizerTable.allowedElements, this.sanitizerTable.elementPolicies, this.sanitizerTable.allowedGlobalAttributes, globalAttributePolicies); + return this; + }; + /** + * Preserves the class attribute on all elements. This means contents can + * adopt CSS styles from other page elements and possibly mask themselves as + * legitimate UI elements, which can lead to phishing. + */ + HtmlSanitizerBuilder.prototype.allowClassAttributes = function () { + var allowedGlobalAttributes = new Set(this.sanitizerTable.allowedGlobalAttributes); + allowedGlobalAttributes.add('class'); + this.sanitizerTable = new sanitizer_table_1.SanitizerTable(this.sanitizerTable.allowedElements, this.sanitizerTable.elementPolicies, allowedGlobalAttributes, this.sanitizerTable.globalAttributePolicies); + return this; + }; + /** + * Preserves id attributes. This carries moderate risk as it allows an + * element to override other elements with the same ID. + */ + HtmlSanitizerBuilder.prototype.allowIdAttributes = function () { + var allowedGlobalAttributes = new Set(this.sanitizerTable.allowedGlobalAttributes); + allowedGlobalAttributes.add('id'); + this.sanitizerTable = new sanitizer_table_1.SanitizerTable(this.sanitizerTable.allowedElements, this.sanitizerTable.elementPolicies, allowedGlobalAttributes, this.sanitizerTable.globalAttributePolicies); + return this; + }; + /** + * Preserves (some) attributes that reference existing ids. This carries a + * moderate security risk, because sanitized content can create semantic + * associations with existing elements in the page, regardless of the layout. + * This could be used to override the label associated with a form input by a + * screen reader, and facilitate phishing. + */ + HtmlSanitizerBuilder.prototype.allowIdReferenceAttributes = function () { + var allowedGlobalAttributes = new Set(this.sanitizerTable.allowedGlobalAttributes); + // TODO(b/190693339): Generate this subtable from the contract. + allowedGlobalAttributes.add('aria-activedescendant') + .add('aria-controls') + .add('aria-labelledby') + .add('aria-owns') + .add('for') + .add('list'); + this.sanitizerTable = new sanitizer_table_1.SanitizerTable(this.sanitizerTable.allowedElements, this.sanitizerTable.elementPolicies, allowedGlobalAttributes, this.sanitizerTable.globalAttributePolicies); + return this; + }; + HtmlSanitizerBuilder.prototype.build = function () { + if (this.calledBuild) { + throw new Error('this sanitizer has already called build'); + } + this.calledBuild = true; + return new html_sanitizer_1.HtmlSanitizerImpl(this.sanitizerTable, secrets_1.secretToken); + }; + return HtmlSanitizerBuilder; +}()); +exports.HtmlSanitizerBuilder = HtmlSanitizerBuilder;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/html_sanitizer/html_sanitizer_builder.mjs b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/html_sanitizer/html_sanitizer_builder.mjs new file mode 100644 index 0000000..7690838 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/html_sanitizer/html_sanitizer_builder.mjs
@@ -0,0 +1,150 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import { secretToken } from '../../internals/secrets'; +import { HtmlSanitizerImpl } from './html_sanitizer'; +import { defaultSanitizerTable } from './sanitizer_table/default_sanitizer_table'; +import { AttributePolicyAction, SanitizerTable } from './sanitizer_table/sanitizer_table'; +/** This class allows modifications to the default sanitizer configuration. */ +export class HtmlSanitizerBuilder { + sanitizerTable; + // To denote if the builder has called build() and therefore should make no + // further changes to the sanitizer table. + calledBuild = false; + constructor() { + this.sanitizerTable = defaultSanitizerTable; + } + /** Builder option to restrict allowed elements to a smaller subset. */ + onlyAllowElements(elementSet) { + const allowedElements = new Set(); + const allowedElementPolicies = new Map(); + for (let element of elementSet) { + element = element.toUpperCase(); + if (!this.sanitizerTable.isAllowedElement(element)) { + throw new Error(`Element: ${element}, is not allowed by html5_contract.textpb`); + } + const elementPolicy = this.sanitizerTable.elementPolicies.get(element); + if (elementPolicy !== undefined) { + allowedElementPolicies.set(element, elementPolicy); + } + else { + allowedElements.add(element); + } + } + this.sanitizerTable = new SanitizerTable(allowedElements, allowedElementPolicies, this.sanitizerTable.allowedGlobalAttributes, this.sanitizerTable.globalAttributePolicies); + return this; + } + /** + * Builder option to restrict allowed attributes to a smaller subset. + * + * If the attribute isn't currently allowed then it won't be added. + */ + onlyAllowAttributes(attributeSet) { + const allowedGlobalAttributes = new Set(); + const globalAttributePolicies = new Map(); + const elementPolicies = new Map(); + for (const attribute of attributeSet) { + if (this.sanitizerTable.allowedGlobalAttributes.has(attribute)) { + allowedGlobalAttributes.add(attribute); + } + if (this.sanitizerTable.globalAttributePolicies.has(attribute)) { + globalAttributePolicies.set(attribute, this.sanitizerTable.globalAttributePolicies.get(attribute)); + } + } + for (const [elementName, originalElementPolicy] of this.sanitizerTable + .elementPolicies.entries()) { + const newElementPolicy = new Map(); + for (const [attribute, attributePolicy] of originalElementPolicy + .entries()) { + if (attributeSet.has(attribute)) { + newElementPolicy.set(attribute, attributePolicy); + } + } + elementPolicies.set(elementName, newElementPolicy); + } + this.sanitizerTable = new SanitizerTable(this.sanitizerTable.allowedElements, elementPolicies, allowedGlobalAttributes, globalAttributePolicies); + return this; + } + /** + * Allows the set of data attributes passed. + * + * These values must be prefixed with "data-" + * + * If called with onlyAllowElements or onlyAllowAttributes, those methods must + * be called first. + */ + allowDataAttributes(attributes) { + const allowedGlobalAttributes = new Set(this.sanitizerTable.allowedGlobalAttributes); + for (const attribute of attributes) { + if (attribute.indexOf('data-') !== 0) { + throw new Error(`data attribute: ${attribute} does not begin with the prefix "data-"`); + } + allowedGlobalAttributes.add(attribute); + } + this.sanitizerTable = new SanitizerTable(this.sanitizerTable.allowedElements, this.sanitizerTable.elementPolicies, allowedGlobalAttributes, this.sanitizerTable.globalAttributePolicies); + return this; + } + /** + * Preserves style attributes. Note that the sanitizer won't parse and + * sanitize the values but keep them as they are. In particular this means + * that the code will be able to call functions that could do undesirable + * things (e.g. `url` to trigger a network request), as well as any custom + * properties or functions defined by the application. + */ + allowStyleAttributes() { + const globalAttributePolicies = new Map(this.sanitizerTable.globalAttributePolicies); + globalAttributePolicies.set('style', { + policyAction: AttributePolicyAction.KEEP_AND_SANITIZE_STYLE, + }); + this.sanitizerTable = new SanitizerTable(this.sanitizerTable.allowedElements, this.sanitizerTable.elementPolicies, this.sanitizerTable.allowedGlobalAttributes, globalAttributePolicies); + return this; + } + /** + * Preserves the class attribute on all elements. This means contents can + * adopt CSS styles from other page elements and possibly mask themselves as + * legitimate UI elements, which can lead to phishing. + */ + allowClassAttributes() { + const allowedGlobalAttributes = new Set(this.sanitizerTable.allowedGlobalAttributes); + allowedGlobalAttributes.add('class'); + this.sanitizerTable = new SanitizerTable(this.sanitizerTable.allowedElements, this.sanitizerTable.elementPolicies, allowedGlobalAttributes, this.sanitizerTable.globalAttributePolicies); + return this; + } + /** + * Preserves id attributes. This carries moderate risk as it allows an + * element to override other elements with the same ID. + */ + allowIdAttributes() { + const allowedGlobalAttributes = new Set(this.sanitizerTable.allowedGlobalAttributes); + allowedGlobalAttributes.add('id'); + this.sanitizerTable = new SanitizerTable(this.sanitizerTable.allowedElements, this.sanitizerTable.elementPolicies, allowedGlobalAttributes, this.sanitizerTable.globalAttributePolicies); + return this; + } + /** + * Preserves (some) attributes that reference existing ids. This carries a + * moderate security risk, because sanitized content can create semantic + * associations with existing elements in the page, regardless of the layout. + * This could be used to override the label associated with a form input by a + * screen reader, and facilitate phishing. + */ + allowIdReferenceAttributes() { + const allowedGlobalAttributes = new Set(this.sanitizerTable.allowedGlobalAttributes); + // TODO(b/190693339): Generate this subtable from the contract. + allowedGlobalAttributes.add('aria-activedescendant') + .add('aria-controls') + .add('aria-labelledby') + .add('aria-owns') + .add('for') + .add('list'); + this.sanitizerTable = new SanitizerTable(this.sanitizerTable.allowedElements, this.sanitizerTable.elementPolicies, allowedGlobalAttributes, this.sanitizerTable.globalAttributePolicies); + return this; + } + build() { + if (this.calledBuild) { + throw new Error('this sanitizer has already called build'); + } + this.calledBuild = true; + return new HtmlSanitizerImpl(this.sanitizerTable, secretToken); + } +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/html_sanitizer/inert_fragment.d.ts b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/html_sanitizer/inert_fragment.d.ts new file mode 100644 index 0000000..02170e4 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/html_sanitizer/inert_fragment.d.ts
@@ -0,0 +1,9 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +/** + * Returns a fragment that contains the parsed HTML for `dirtyHtml` without + * executing any of the potential payload. + */ +export declare function createInertFragment(dirtyHtml: string): DocumentFragment;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/html_sanitizer/inert_fragment.js b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/html_sanitizer/inert_fragment.js new file mode 100644 index 0000000..b984748a --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/html_sanitizer/inert_fragment.js
@@ -0,0 +1,23 @@ +"use strict"; +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createInertFragment = void 0; +var element_1 = require("../../dom/elements/element"); +var html_impl_1 = require("../../internals/html_impl"); +/** + * Returns a fragment that contains the parsed HTML for `dirtyHtml` without + * executing any of the potential payload. + */ +function createInertFragment(dirtyHtml) { + var template = document.createElement('template'); + // This call is only used to create an inert tree for the sanitizer to + // further process and is never returned directly to the caller. We can't use + // a reviewed conversion in order to avoid an import loop. + var temporarySafeHtml = (0, html_impl_1.createHtml)(dirtyHtml); + (0, element_1.setInnerHtml)(template, temporarySafeHtml); + return template.content; +} +exports.createInertFragment = createInertFragment;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/html_sanitizer/inert_fragment.mjs b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/html_sanitizer/inert_fragment.mjs new file mode 100644 index 0000000..3080dde --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/html_sanitizer/inert_fragment.mjs
@@ -0,0 +1,19 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import { setInnerHtml } from '../../dom/elements/element'; +import { createHtml } from '../../internals/html_impl'; +/** + * Returns a fragment that contains the parsed HTML for `dirtyHtml` without + * executing any of the potential payload. + */ +export function createInertFragment(dirtyHtml) { + const template = document.createElement('template'); + // This call is only used to create an inert tree for the sanitizer to + // further process and is never returned directly to the caller. We can't use + // a reviewed conversion in order to avoid an import loop. + const temporarySafeHtml = createHtml(dirtyHtml); + setInnerHtml(template, temporarySafeHtml); + return template.content; +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/html_sanitizer/no_clobber.d.ts b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/html_sanitizer/no_clobber.d.ts new file mode 100644 index 0000000..5df355c69 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/html_sanitizer/no_clobber.d.ts
@@ -0,0 +1,14 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +/** + * Library that provides safe getters for different node properties and + * checks for clobbering. + */ +/** Gets a reasonable nodeName, even for clobbered nodes. */ +export declare function getNodeName(node: Node): string; +/** Returns true if the object passed is a Text node. */ +export declare function isText(node: Node): node is Text; +/** Returns true if the object passed is an Element node. */ +export declare function isElement(node: Node): node is Element;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/html_sanitizer/no_clobber.js b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/html_sanitizer/no_clobber.js new file mode 100644 index 0000000..1544a22 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/html_sanitizer/no_clobber.js
@@ -0,0 +1,32 @@ +"use strict"; +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.isElement = exports.isText = exports.getNodeName = void 0; +/** + * Library that provides safe getters for different node properties and + * checks for clobbering. + */ +/** Gets a reasonable nodeName, even for clobbered nodes. */ +function getNodeName(node) { + var nodeName = node.nodeName; + // If the property is clobbered, assume it is an `HTMLFormElement`. + return (typeof nodeName === 'string') ? nodeName : 'FORM'; +} +exports.getNodeName = getNodeName; +/** Returns true if the object passed is a Text node. */ +function isText(node) { + // The property cannot get clobbered on Text nodes. + return node.nodeType === Node.TEXT_NODE; +} +exports.isText = isText; +/** Returns true if the object passed is an Element node. */ +function isElement(node) { + var nodeType = node.nodeType; + // If the property is clobbered, we can assume it is an `HTMLFormElement`, and + // thus an `Element`. + return (nodeType === Node.ELEMENT_NODE) || (typeof nodeType !== 'number'); +} +exports.isElement = isElement;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/html_sanitizer/no_clobber.mjs b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/html_sanitizer/no_clobber.mjs new file mode 100644 index 0000000..1f6a7dc --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/html_sanitizer/no_clobber.mjs
@@ -0,0 +1,26 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +/** + * Library that provides safe getters for different node properties and + * checks for clobbering. + */ +/** Gets a reasonable nodeName, even for clobbered nodes. */ +export function getNodeName(node) { + const nodeName = node.nodeName; + // If the property is clobbered, assume it is an `HTMLFormElement`. + return (typeof nodeName === 'string') ? nodeName : 'FORM'; +} +/** Returns true if the object passed is a Text node. */ +export function isText(node) { + // The property cannot get clobbered on Text nodes. + return node.nodeType === Node.TEXT_NODE; +} +/** Returns true if the object passed is an Element node. */ +export function isElement(node) { + const nodeType = node.nodeType; + // If the property is clobbered, we can assume it is an `HTMLFormElement`, and + // thus an `Element`. + return (nodeType === Node.ELEMENT_NODE) || (typeof nodeType !== 'number'); +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/html_sanitizer/sanitizer_table/default_sanitizer_table.d.ts b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/html_sanitizer/sanitizer_table/default_sanitizer_table.d.ts new file mode 100644 index 0000000..02ebb844 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/html_sanitizer/sanitizer_table/default_sanitizer_table.d.ts
@@ -0,0 +1,10 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import { SanitizerTable } from './sanitizer_table'; +/** + * Sanitizer table for the default sanitizer configuration + * + */ +export declare const defaultSanitizerTable: SanitizerTable;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/html_sanitizer/sanitizer_table/default_sanitizer_table.js b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/html_sanitizer/sanitizer_table/default_sanitizer_table.js new file mode 100644 index 0000000..2a07f64 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/html_sanitizer/sanitizer_table/default_sanitizer_table.js
@@ -0,0 +1,252 @@ +"use strict"; +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.defaultSanitizerTable = void 0; +/* GENERATED CODE, DO NOT MODIFY */ +/* g3_import_pure from '../../../internals/pure' */ +var sanitizer_table_1 = require("./sanitizer_table"); +var ALLOWED_ELEMENTS = [ + 'ARTICLE', 'SECTION', 'NAV', 'ASIDE', 'H1', 'H2', + 'H3', 'H4', 'H5', 'H6', 'HEADER', 'FOOTER', + 'ADDRESS', 'P', 'HR', 'PRE', 'BLOCKQUOTE', 'OL', + 'UL', 'LH', 'LI', 'DL', 'DT', 'DD', + 'FIGURE', 'FIGCAPTION', 'MAIN', 'DIV', 'EM', 'STRONG', + 'SMALL', 'S', 'CITE', 'Q', 'DFN', 'ABBR', + 'RUBY', 'RB', 'RT', 'RTC', 'RP', 'DATA', + 'TIME', 'CODE', 'VAR', 'SAMP', 'KBD', 'SUB', + 'SUP', 'I', 'B', 'U', 'MARK', 'BDI', + 'BDO', 'SPAN', 'BR', 'WBR', 'INS', 'DEL', + 'PICTURE', 'PARAM', 'TRACK', 'MAP', 'TABLE', 'CAPTION', + 'COLGROUP', 'COL', 'TBODY', 'THEAD', 'TFOOT', 'TR', + 'TD', 'TH', 'SELECT', 'DATALIST', 'OPTGROUP', 'OPTION', + 'OUTPUT', 'PROGRESS', 'METER', 'FIELDSET', 'LEGEND', 'DETAILS', + 'SUMMARY', 'MENU', 'DIALOG', 'SLOT', 'CANVAS', 'FONT', + 'CENTER', +]; +var ELEMENT_POLICIES = [ + [ + 'A', new Map([ + ['href', { policyAction: sanitizer_table_1.AttributePolicyAction.KEEP_AND_SANITIZE_URL }], + ]) + ], + [ + 'AREA', new Map([ + ['href', { policyAction: sanitizer_table_1.AttributePolicyAction.KEEP_AND_SANITIZE_URL }], + ]) + ], + [ + 'LINK', new Map([ + [ + 'href', { + policyAction: sanitizer_table_1.AttributePolicyAction.KEEP_AND_SANITIZE_URL, + conditions: new Map([[ + 'rel', new Set([ + 'alternate', + 'author', + 'bookmark', + 'canonical', + 'cite', + 'help', + 'icon', + 'license', + 'next', + 'prefetch', + 'dns-prefetch', + 'prerender', + 'preconnect', + 'preload', + 'prev', + 'search', + 'subresource', + ]) + ]]) + } + ], + ]) + ], + [ + 'SOURCE', new Map([ + ['src', { policyAction: sanitizer_table_1.AttributePolicyAction.KEEP_AND_SANITIZE_URL }], + ]) + ], + [ + 'IMG', new Map([ + ['src', { policyAction: sanitizer_table_1.AttributePolicyAction.KEEP_AND_SANITIZE_URL }], + ]) + ], + [ + 'VIDEO', new Map([ + ['src', { policyAction: sanitizer_table_1.AttributePolicyAction.KEEP_AND_SANITIZE_URL }], + ]) + ], + [ + 'AUDIO', new Map([ + ['src', { policyAction: sanitizer_table_1.AttributePolicyAction.KEEP_AND_SANITIZE_URL }], + ]) + ], +]; +var ALLOWED_GLOBAL_ATTRIBUTES = [ + 'title', + 'aria-atomic', + 'aria-autocomplete', + 'aria-busy', + 'aria-checked', + 'aria-current', + 'aria-disabled', + 'aria-dropeffect', + 'aria-expanded', + 'aria-haspopup', + 'aria-hidden', + 'aria-invalid', + 'aria-label', + 'aria-level', + 'aria-live', + 'aria-multiline', + 'aria-multiselectable', + 'aria-orientation', + 'aria-posinset', + 'aria-pressed', + 'aria-readonly', + 'aria-relevant', + 'aria-required', + 'aria-selected', + 'aria-setsize', + 'aria-sort', + 'aria-valuemax', + 'aria-valuemin', + 'aria-valuenow', + 'aria-valuetext', + 'alt', + 'align', + 'autocapitalize', + 'autocomplete', + 'autocorrect', + 'autofocus', + 'autoplay', + 'bgcolor', + 'border', + 'cellpadding', + 'cellspacing', + 'checked', + 'color', + 'cols', + 'colspan', + 'controls', + 'datetime', + 'disabled', + 'download', + 'draggable', + 'enctype', + 'face', + 'formenctype', + 'frameborder', + 'height', + 'hreflang', + 'hidden', + 'ismap', + 'label', + 'lang', + 'loop', + 'max', + 'maxlength', + 'media', + 'minlength', + 'min', + 'multiple', + 'muted', + 'nonce', + 'open', + 'placeholder', + 'preload', + 'rel', + 'required', + 'reversed', + 'role', + 'rows', + 'rowspan', + 'selected', + 'shape', + 'size', + 'sizes', + 'slot', + 'span', + 'spellcheck', + 'start', + 'step', + 'summary', + 'translate', + 'type', + 'valign', + 'value', + 'width', + 'wrap', + 'itemscope', + 'itemtype', + 'itemid', + 'itemprop', + 'itemref', +]; +var GLOBAL_ATTRIBUTE_POLICIES = [ + [ + 'dir', { + policyAction: sanitizer_table_1.AttributePolicyAction.KEEP_AND_NORMALIZE, + conditions: /* #__PURE__ */ (function () { + return new Map([[ + 'dir', new Set([ + 'auto', + 'ltr', + 'rtl', + ]) + ]]); + })() + } + ], + [ + 'async', { + policyAction: sanitizer_table_1.AttributePolicyAction.KEEP_AND_NORMALIZE, + conditions: /* #__PURE__ */ (function () { + return new Map([[ + 'async', new Set([ + 'async', + ]) + ]]); + })() + } + ], + ['cite', { policyAction: sanitizer_table_1.AttributePolicyAction.KEEP_AND_SANITIZE_URL }], + [ + 'loading', { + policyAction: sanitizer_table_1.AttributePolicyAction.KEEP_AND_NORMALIZE, + conditions: /* #__PURE__ */ (function () { + return new Map([[ + 'loading', new Set([ + 'eager', + 'lazy', + ]) + ]]); + })() + } + ], + ['poster', { policyAction: sanitizer_table_1.AttributePolicyAction.KEEP_AND_SANITIZE_URL }], + [ + 'target', { + policyAction: sanitizer_table_1.AttributePolicyAction.KEEP_AND_NORMALIZE, + conditions: /* #__PURE__ */ (function () { + return new Map([[ + 'target', new Set([ + '_self', + '_blank', + ]) + ]]); + })() + } + ], +]; +/** + * Sanitizer table for the default sanitizer configuration + * + */ +exports.defaultSanitizerTable = new sanitizer_table_1.SanitizerTable(new Set(ALLOWED_ELEMENTS), new Map(ELEMENT_POLICIES), new Set(ALLOWED_GLOBAL_ATTRIBUTES), new Map(GLOBAL_ATTRIBUTE_POLICIES));
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/html_sanitizer/sanitizer_table/default_sanitizer_table.mjs b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/html_sanitizer/sanitizer_table/default_sanitizer_table.mjs new file mode 100644 index 0000000..b69ada3 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/html_sanitizer/sanitizer_table/default_sanitizer_table.mjs
@@ -0,0 +1,249 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +/* GENERATED CODE, DO NOT MODIFY */ +/* g3_import_pure from '../../../internals/pure' */ +import { AttributePolicyAction, SanitizerTable } from './sanitizer_table'; +const ALLOWED_ELEMENTS = [ + 'ARTICLE', 'SECTION', 'NAV', 'ASIDE', 'H1', 'H2', + 'H3', 'H4', 'H5', 'H6', 'HEADER', 'FOOTER', + 'ADDRESS', 'P', 'HR', 'PRE', 'BLOCKQUOTE', 'OL', + 'UL', 'LH', 'LI', 'DL', 'DT', 'DD', + 'FIGURE', 'FIGCAPTION', 'MAIN', 'DIV', 'EM', 'STRONG', + 'SMALL', 'S', 'CITE', 'Q', 'DFN', 'ABBR', + 'RUBY', 'RB', 'RT', 'RTC', 'RP', 'DATA', + 'TIME', 'CODE', 'VAR', 'SAMP', 'KBD', 'SUB', + 'SUP', 'I', 'B', 'U', 'MARK', 'BDI', + 'BDO', 'SPAN', 'BR', 'WBR', 'INS', 'DEL', + 'PICTURE', 'PARAM', 'TRACK', 'MAP', 'TABLE', 'CAPTION', + 'COLGROUP', 'COL', 'TBODY', 'THEAD', 'TFOOT', 'TR', + 'TD', 'TH', 'SELECT', 'DATALIST', 'OPTGROUP', 'OPTION', + 'OUTPUT', 'PROGRESS', 'METER', 'FIELDSET', 'LEGEND', 'DETAILS', + 'SUMMARY', 'MENU', 'DIALOG', 'SLOT', 'CANVAS', 'FONT', + 'CENTER', +]; +const ELEMENT_POLICIES = [ + [ + 'A', new Map([ + ['href', { policyAction: AttributePolicyAction.KEEP_AND_SANITIZE_URL }], + ]) + ], + [ + 'AREA', new Map([ + ['href', { policyAction: AttributePolicyAction.KEEP_AND_SANITIZE_URL }], + ]) + ], + [ + 'LINK', new Map([ + [ + 'href', { + policyAction: AttributePolicyAction.KEEP_AND_SANITIZE_URL, + conditions: new Map([[ + 'rel', new Set([ + 'alternate', + 'author', + 'bookmark', + 'canonical', + 'cite', + 'help', + 'icon', + 'license', + 'next', + 'prefetch', + 'dns-prefetch', + 'prerender', + 'preconnect', + 'preload', + 'prev', + 'search', + 'subresource', + ]) + ]]) + } + ], + ]) + ], + [ + 'SOURCE', new Map([ + ['src', { policyAction: AttributePolicyAction.KEEP_AND_SANITIZE_URL }], + ]) + ], + [ + 'IMG', new Map([ + ['src', { policyAction: AttributePolicyAction.KEEP_AND_SANITIZE_URL }], + ]) + ], + [ + 'VIDEO', new Map([ + ['src', { policyAction: AttributePolicyAction.KEEP_AND_SANITIZE_URL }], + ]) + ], + [ + 'AUDIO', new Map([ + ['src', { policyAction: AttributePolicyAction.KEEP_AND_SANITIZE_URL }], + ]) + ], +]; +const ALLOWED_GLOBAL_ATTRIBUTES = [ + 'title', + 'aria-atomic', + 'aria-autocomplete', + 'aria-busy', + 'aria-checked', + 'aria-current', + 'aria-disabled', + 'aria-dropeffect', + 'aria-expanded', + 'aria-haspopup', + 'aria-hidden', + 'aria-invalid', + 'aria-label', + 'aria-level', + 'aria-live', + 'aria-multiline', + 'aria-multiselectable', + 'aria-orientation', + 'aria-posinset', + 'aria-pressed', + 'aria-readonly', + 'aria-relevant', + 'aria-required', + 'aria-selected', + 'aria-setsize', + 'aria-sort', + 'aria-valuemax', + 'aria-valuemin', + 'aria-valuenow', + 'aria-valuetext', + 'alt', + 'align', + 'autocapitalize', + 'autocomplete', + 'autocorrect', + 'autofocus', + 'autoplay', + 'bgcolor', + 'border', + 'cellpadding', + 'cellspacing', + 'checked', + 'color', + 'cols', + 'colspan', + 'controls', + 'datetime', + 'disabled', + 'download', + 'draggable', + 'enctype', + 'face', + 'formenctype', + 'frameborder', + 'height', + 'hreflang', + 'hidden', + 'ismap', + 'label', + 'lang', + 'loop', + 'max', + 'maxlength', + 'media', + 'minlength', + 'min', + 'multiple', + 'muted', + 'nonce', + 'open', + 'placeholder', + 'preload', + 'rel', + 'required', + 'reversed', + 'role', + 'rows', + 'rowspan', + 'selected', + 'shape', + 'size', + 'sizes', + 'slot', + 'span', + 'spellcheck', + 'start', + 'step', + 'summary', + 'translate', + 'type', + 'valign', + 'value', + 'width', + 'wrap', + 'itemscope', + 'itemtype', + 'itemid', + 'itemprop', + 'itemref', +]; +const GLOBAL_ATTRIBUTE_POLICIES = [ + [ + 'dir', { + policyAction: AttributePolicyAction.KEEP_AND_NORMALIZE, + conditions: /* #__PURE__ */ (() => { + return new Map([[ + 'dir', new Set([ + 'auto', + 'ltr', + 'rtl', + ]) + ]]); + })() + } + ], + [ + 'async', { + policyAction: AttributePolicyAction.KEEP_AND_NORMALIZE, + conditions: /* #__PURE__ */ (() => { + return new Map([[ + 'async', new Set([ + 'async', + ]) + ]]); + })() + } + ], + ['cite', { policyAction: AttributePolicyAction.KEEP_AND_SANITIZE_URL }], + [ + 'loading', { + policyAction: AttributePolicyAction.KEEP_AND_NORMALIZE, + conditions: /* #__PURE__ */ (() => { + return new Map([[ + 'loading', new Set([ + 'eager', + 'lazy', + ]) + ]]); + })() + } + ], + ['poster', { policyAction: AttributePolicyAction.KEEP_AND_SANITIZE_URL }], + [ + 'target', { + policyAction: AttributePolicyAction.KEEP_AND_NORMALIZE, + conditions: /* #__PURE__ */ (() => { + return new Map([[ + 'target', new Set([ + '_self', + '_blank', + ]) + ]]); + })() + } + ], +]; +/** + * Sanitizer table for the default sanitizer configuration + * + */ +export const defaultSanitizerTable = new SanitizerTable(new Set(ALLOWED_ELEMENTS), new Map(ELEMENT_POLICIES), new Set(ALLOWED_GLOBAL_ATTRIBUTES), new Map(GLOBAL_ATTRIBUTE_POLICIES));
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/html_sanitizer/sanitizer_table/sanitizer_table.d.ts b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/html_sanitizer/sanitizer_table/sanitizer_table.d.ts new file mode 100644 index 0000000..6d30127 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/html_sanitizer/sanitizer_table/sanitizer_table.d.ts
@@ -0,0 +1,38 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +/** Class for holding element and attribute policies used for sanitization. */ +export declare class SanitizerTable { + readonly allowedElements: ReadonlySet<string>; + readonly elementPolicies: ReadonlyMap<string, ElementPolicy>; + readonly allowedGlobalAttributes: ReadonlySet<string>; + readonly globalAttributePolicies: ReadonlyMap<string, AttributePolicy>; + readonly globallyAllowedAttributePrefixes?: ReadonlySet<string> | undefined; + constructor(allowedElements: ReadonlySet<string>, elementPolicies: ReadonlyMap<string, ElementPolicy>, allowedGlobalAttributes: ReadonlySet<string>, globalAttributePolicies: ReadonlyMap<string, AttributePolicy>, globallyAllowedAttributePrefixes?: ReadonlySet<string> | undefined); + isAllowedElement(elementName: string): boolean; + getAttributePolicy(attributeName: string, elementName: string): AttributePolicy; +} +/** + * Holds information on how to sanitize the attributes of a particular element. + * An element with an ElementPolicy specified is implicitly kept in the output. + */ +export declare type ElementPolicy = ReadonlyMap<string, AttributePolicy>; +/** + * Values derived from + * https://godoc.corp.google.com/pkg/google3/third_party/safehtml/sanitizer/policy#AttributePolicy + */ +export declare enum AttributePolicyAction { + DROP = 0, + KEEP = 1, + KEEP_AND_SANITIZE_URL = 2, + KEEP_AND_NORMALIZE = 3, + KEEP_AND_SANITIZE_STYLE = 4 +} +/** + * Holds information on how to sanitize the values of a particular attribute. + */ +export interface AttributePolicy { + readonly policyAction: AttributePolicyAction; + readonly conditions?: ReadonlyMap<string, Set<string>>; +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/html_sanitizer/sanitizer_table/sanitizer_table.js b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/html_sanitizer/sanitizer_table/sanitizer_table.js new file mode 100644 index 0000000..d8619de --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/html_sanitizer/sanitizer_table/sanitizer_table.js
@@ -0,0 +1,85 @@ +"use strict"; +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +var __read = (this && this.__read) || function (o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; +}; +var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.AttributePolicyAction = exports.SanitizerTable = void 0; +/** Class for holding element and attribute policies used for sanitization. */ +var SanitizerTable = /** @class */ (function () { + function SanitizerTable(allowedElements, elementPolicies, allowedGlobalAttributes, globalAttributePolicies, globallyAllowedAttributePrefixes) { + this.allowedElements = allowedElements; + this.elementPolicies = elementPolicies; + this.allowedGlobalAttributes = allowedGlobalAttributes; + this.globalAttributePolicies = globalAttributePolicies; + this.globallyAllowedAttributePrefixes = globallyAllowedAttributePrefixes; + } + SanitizerTable.prototype.isAllowedElement = function (elementName) { + // Note: `HTMLFormElement`s are always dropped, supporting them is very + // costly because of the DOM clobberring they can cause. The additional code + // size required to properly work around DOM clobberring issues is large and + // shouldn't be put on every user of the sanitizer. Thoroughly review + // b/210975025 and the CLs linked there before you start allowing form + // elements. + return elementName.toLowerCase() !== 'form' && + (this.allowedElements.has(elementName) || + this.elementPolicies.has(elementName)); + }; + SanitizerTable.prototype.getAttributePolicy = function (attributeName, elementName) { + var elementPolicy = this.elementPolicies.get(elementName); + if (elementPolicy === null || elementPolicy === void 0 ? void 0 : elementPolicy.has(attributeName)) { + return elementPolicy.get(attributeName); + } + if (this.allowedGlobalAttributes.has(attributeName)) { + return { policyAction: AttributePolicyAction.KEEP }; + } + var globalPolicy = this.globalAttributePolicies.get(attributeName); + if (globalPolicy) { + return globalPolicy; + } + if (this.globallyAllowedAttributePrefixes && + __spreadArray([], __read(this.globallyAllowedAttributePrefixes), false).some(function (prefix) { return attributeName.indexOf(prefix) === 0; })) { + return { policyAction: AttributePolicyAction.KEEP }; + } + return { policyAction: AttributePolicyAction.DROP }; + }; + return SanitizerTable; +}()); +exports.SanitizerTable = SanitizerTable; +/** + * Values derived from + * https://godoc.corp.google.com/pkg/google3/third_party/safehtml/sanitizer/policy#AttributePolicy + */ +var AttributePolicyAction; +(function (AttributePolicyAction) { + AttributePolicyAction[AttributePolicyAction["DROP"] = 0] = "DROP"; + AttributePolicyAction[AttributePolicyAction["KEEP"] = 1] = "KEEP"; + AttributePolicyAction[AttributePolicyAction["KEEP_AND_SANITIZE_URL"] = 2] = "KEEP_AND_SANITIZE_URL"; + AttributePolicyAction[AttributePolicyAction["KEEP_AND_NORMALIZE"] = 3] = "KEEP_AND_NORMALIZE"; + AttributePolicyAction[AttributePolicyAction["KEEP_AND_SANITIZE_STYLE"] = 4] = "KEEP_AND_SANITIZE_STYLE"; +})(AttributePolicyAction = exports.AttributePolicyAction || (exports.AttributePolicyAction = {}));
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/html_sanitizer/sanitizer_table/sanitizer_table.mjs b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/html_sanitizer/sanitizer_table/sanitizer_table.mjs new file mode 100644 index 0000000..74b79c6 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/html_sanitizer/sanitizer_table/sanitizer_table.mjs
@@ -0,0 +1,60 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +/** Class for holding element and attribute policies used for sanitization. */ +export class SanitizerTable { + allowedElements; + elementPolicies; + allowedGlobalAttributes; + globalAttributePolicies; + globallyAllowedAttributePrefixes; + constructor(allowedElements, elementPolicies, allowedGlobalAttributes, globalAttributePolicies, globallyAllowedAttributePrefixes) { + this.allowedElements = allowedElements; + this.elementPolicies = elementPolicies; + this.allowedGlobalAttributes = allowedGlobalAttributes; + this.globalAttributePolicies = globalAttributePolicies; + this.globallyAllowedAttributePrefixes = globallyAllowedAttributePrefixes; + } + isAllowedElement(elementName) { + // Note: `HTMLFormElement`s are always dropped, supporting them is very + // costly because of the DOM clobberring they can cause. The additional code + // size required to properly work around DOM clobberring issues is large and + // shouldn't be put on every user of the sanitizer. Thoroughly review + // b/210975025 and the CLs linked there before you start allowing form + // elements. + return elementName.toLowerCase() !== 'form' && + (this.allowedElements.has(elementName) || + this.elementPolicies.has(elementName)); + } + getAttributePolicy(attributeName, elementName) { + const elementPolicy = this.elementPolicies.get(elementName); + if (elementPolicy?.has(attributeName)) { + return elementPolicy.get(attributeName); + } + if (this.allowedGlobalAttributes.has(attributeName)) { + return { policyAction: AttributePolicyAction.KEEP }; + } + const globalPolicy = this.globalAttributePolicies.get(attributeName); + if (globalPolicy) { + return globalPolicy; + } + if (this.globallyAllowedAttributePrefixes && + [...this.globallyAllowedAttributePrefixes].some((prefix) => attributeName.indexOf(prefix) === 0)) { + return { policyAction: AttributePolicyAction.KEEP }; + } + return { policyAction: AttributePolicyAction.DROP }; + } +} +/** + * Values derived from + * https://godoc.corp.google.com/pkg/google3/third_party/safehtml/sanitizer/policy#AttributePolicy + */ +export var AttributePolicyAction; +(function (AttributePolicyAction) { + AttributePolicyAction[AttributePolicyAction["DROP"] = 0] = "DROP"; + AttributePolicyAction[AttributePolicyAction["KEEP"] = 1] = "KEEP"; + AttributePolicyAction[AttributePolicyAction["KEEP_AND_SANITIZE_URL"] = 2] = "KEEP_AND_SANITIZE_URL"; + AttributePolicyAction[AttributePolicyAction["KEEP_AND_NORMALIZE"] = 3] = "KEEP_AND_NORMALIZE"; + AttributePolicyAction[AttributePolicyAction["KEEP_AND_SANITIZE_STYLE"] = 4] = "KEEP_AND_SANITIZE_STYLE"; +})(AttributePolicyAction || (AttributePolicyAction = {}));
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/resource_url_builders.d.ts b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/resource_url_builders.d.ts new file mode 100644 index 0000000..fe83d14 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/resource_url_builders.d.ts
@@ -0,0 +1,83 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +/// <reference types="trusted-types" /> +import '../environment/dev'; +import { TrustedResourceUrl } from '../internals/resource_url_impl'; +import { SafeScript } from '../internals/script_impl'; +/** Type that we know how to interpolate */ +declare type Primitive = string | number | boolean; +/** + * Builds TrustedResourceUrl from a template literal. + * + * This factory is a template literal tag function. It should be called with + * a template literal, with or without embedded expressions. For example, + * trustedResourceUrl`//example.com/${bar}`; + * or + * trustedResourceUrl`//example.com`; + * + * When this function is called with a template literal without any embedded + * expressions, the template string may contain anything as the whole URL is + * a compile-time string constant. + * + * When this function is called with a template literal that contains embedded + * expressions, the template must start with one of the following: + * - `https://<origin>/` + * - `//<origin>/` + * - `/<pathStart>` + * - `about:blank` + * - `data:` + * + * `<origin>` must contain only alphanumeric or any of the following: `-.:`. + * Remember that, as per the documentation for TrustedResourceUrl, the origin + * must be trustworthy. An origin of "example.com" could be set with this + * method, but would tie the security of your site to the security of + * example.com. Similarly, formats that potentially cover redirects hosted + * on a trusted origin are problematic, since that could lead to untrusted + * origins. + * + * `<pathStart>` is either an empty string, or a non empty string that does not + * start with '/' or '\'. + * In other words, `/<pathStart>` is either a '/' or a + * '/' followed by at least one character that is not '/' or '\'. + * + * `data:` (data URL) does not allow embedded expressions in the template + * literal input. + * + * All embedded expressions are URL encoded when they are interpolated. Do not + * embed expressions that are already URL encoded as they will be double encoded + * by the builder. + * + * @param templateObj This contains the literal part of the template literal. + * @param rest This represents the template's embedded expressions. + */ +export declare function trustedResourceUrl(templateObj: TemplateStringsArray, ...rest: Primitive[]): TrustedResourceUrl; +/** + * Creates a new TrustedResourceUrl with params added to the URL's search + * parameters. + * + * @param params What to add to the URL. Parameters with value `null` or + * `undefined` are skipped. Both keys and values will be encoded. Do not pass + * pre-encoded values as this will result them being double encoded. If the + * value is an array then the same parameter is added for every element in the + * array. + */ +export declare function appendParams(trustedUrl: TrustedResourceUrl, params: Map<string, Primitive | null | Array<Primitive | null>>): TrustedResourceUrl; +/** + * Creates a new TrustedResourceUrl based on an existing one but with the + * addition of a fragment (the part after `#`). If the URL already has a + * fragment, it is replaced with the new one. + * @param fragment The fragment to add to the URL, verbatim, without the leading + * `#`. No additional escaping is applied. + */ +export declare function replaceFragment(trustedUrl: TrustedResourceUrl, fragment: string): TrustedScriptURL; +/** + * Creates a `TrustedResourceUrl` by generating a `Blob` from a + * `SafeScript` and then calling `URL.createObjectURL` with that `Blob`. + * + * Caller must call `URL.revokeObjectUrl()` on the stringified url to + * release the underlying `Blob`. + */ +export declare function objectUrlFromScript(safeScript: SafeScript): TrustedResourceUrl; +export {};
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/resource_url_builders.js b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/resource_url_builders.js new file mode 100644 index 0000000..041dffd --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/resource_url_builders.js
@@ -0,0 +1,218 @@ +"use strict"; +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.objectUrlFromScript = exports.replaceFragment = exports.appendParams = exports.trustedResourceUrl = void 0; +require("../environment/dev"); +var resource_url_impl_1 = require("../internals/resource_url_impl"); +var script_impl_1 = require("../internals/script_impl"); +var string_literal_1 = require("../internals/string_literal"); +/** + * Check whether the base url contains a valid origin, + * + * A string for an origin must contain only alphanumeric or any of the + * following: `-.:`, and must not be an IP address. Remember that, as per the + * documentation for TrustedResourceUrl, the origin must be trustworthy. + * + * @param base The base url that contains an origin. + */ +function hasValidOrigin(base) { + if (!(/^https:\/\//.test(base) || /^\/\//.test(base))) { + return false; + } + var originStart = base.indexOf('//') + 2; + var originEnd = base.indexOf('/', originStart); + // If the base url only contains the prefix (e.g. //), or the slash + // for the origin is right after the prefix (e.g. ///), the origin is + // missing. + if (originEnd <= originStart) { + throw new Error("Can't interpolate data in a url's origin, " + + "Please make sure to fully specify the origin, terminated with '/'."); + } + var origin = base.substring(originStart, originEnd); + if (!/^[0-9a-z.:-]+$/i.test(origin)) { + throw new Error('The origin contains unsupported characters.'); + } + if (!/^[^:]*(:[0-9]+)?$/i.test(origin)) { + throw new Error('Invalid port number.'); + } + if (!/(^|\.)[a-z][^.]*$/i.test(origin)) { + throw new Error('The top-level domain must start with a letter.'); + } + return true; +} +/** + * Check whether the base url contains a valid about url at its beginning. + * + * An about url is either exactly 'about:blank' or 'about:blank#<str>' where + * <str> can be an arbitrary string. + * + * @param base The base url. + */ +function isValidAboutUrl(base) { + if (!/^about:blank/.test(base)) { + return false; + } + if (base !== 'about:blank' && !/^about:blank#/.test(base)) { + throw new Error('The about url is invalid.'); + } + return true; +} +/** + * Check whether the base url contains a valid path start at its beginning. + * + * A valid path start is either a '/' or a '/' followed by at least one + * character that is not '/' or '\'. + * + * @param base The base url. + */ +function isValidPathStart(base) { + if (!/^\//.test(base)) { + return false; + } + if ((base === '/') || + (base.length > 1 && base[1] !== '/' && base[1] !== '\\')) { + return true; + } + throw new Error('The path start in the url is invalid.'); +} +/** + * Builds TrustedResourceUrl from a template literal. + * + * This factory is a template literal tag function. It should be called with + * a template literal, with or without embedded expressions. For example, + * trustedResourceUrl`//example.com/${bar}`; + * or + * trustedResourceUrl`//example.com`; + * + * When this function is called with a template literal without any embedded + * expressions, the template string may contain anything as the whole URL is + * a compile-time string constant. + * + * When this function is called with a template literal that contains embedded + * expressions, the template must start with one of the following: + * - `https://<origin>/` + * - `//<origin>/` + * - `/<pathStart>` + * - `about:blank` + * - `data:` + * + * `<origin>` must contain only alphanumeric or any of the following: `-.:`. + * Remember that, as per the documentation for TrustedResourceUrl, the origin + * must be trustworthy. An origin of "example.com" could be set with this + * method, but would tie the security of your site to the security of + * example.com. Similarly, formats that potentially cover redirects hosted + * on a trusted origin are problematic, since that could lead to untrusted + * origins. + * + * `<pathStart>` is either an empty string, or a non empty string that does not + * start with '/' or '\'. + * In other words, `/<pathStart>` is either a '/' or a + * '/' followed by at least one character that is not '/' or '\'. + * + * `data:` (data URL) does not allow embedded expressions in the template + * literal input. + * + * All embedded expressions are URL encoded when they are interpolated. Do not + * embed expressions that are already URL encoded as they will be double encoded + * by the builder. + * + * @param templateObj This contains the literal part of the template literal. + * @param rest This represents the template's embedded expressions. + */ +function trustedResourceUrl(templateObj) { + var rest = []; + for (var _i = 1; _i < arguments.length; _i++) { + rest[_i - 1] = arguments[_i]; + } + // Check if templateObj is actually from a template literal. + if (process.env.NODE_ENV !== 'production') { + (0, string_literal_1.assertIsTemplateObject)(templateObj, true, 'trustedResourceUrl is a template literal tag function and ' + + 'can only be called as such (e.g. trustedResourceUrl`/somepath.js`)'); + } + if (rest.length === 0) { + return (0, resource_url_impl_1.createResourceUrl)(templateObj[0]); + } + var base = templateObj[0].toLowerCase(); + if (process.env.NODE_ENV !== 'production') { + if (/^data:/.test(base)) { + throw new Error('Data URLs cannot have expressions in the template literal input.'); + } + if (!hasValidOrigin(base) && !isValidPathStart(base) && + !isValidAboutUrl(base)) { + throw new Error('Trying to interpolate expressions in an unsupported url format.'); + } + } + var urlParts = [templateObj[0]]; + for (var i = 0; i < rest.length; i++) { + urlParts.push(encodeURIComponent(rest[i])); + urlParts.push(templateObj[i + 1]); + } + return (0, resource_url_impl_1.createResourceUrl)(urlParts.join('')); +} +exports.trustedResourceUrl = trustedResourceUrl; +/** + * Creates a new TrustedResourceUrl with params added to the URL's search + * parameters. + * + * @param params What to add to the URL. Parameters with value `null` or + * `undefined` are skipped. Both keys and values will be encoded. Do not pass + * pre-encoded values as this will result them being double encoded. If the + * value is an array then the same parameter is added for every element in the + * array. + */ +function appendParams(trustedUrl, params) { + var url = (0, resource_url_impl_1.unwrapResourceUrl)(trustedUrl).toString(); + if (/#/.test(url)) { + var message = ''; + if (process.env.NODE_ENV !== 'production') { + message = "Found a hash in url (".concat(url, "), appending not supported"); + } + throw new Error(message); + } + var separator = /\?/.test(url) ? '&' : '?'; + // for-of has a big polyfill. + // tslint:disable-next-line:ban-iterable-foreach + params.forEach(function (value, key) { + var values = (value instanceof Array) ? value : [value]; + for (var i = 0; i < values.length; i++) { + var v = values[i]; + if (v === null || v === undefined) { + continue; + } + url += separator + encodeURIComponent(key) + '=' + + encodeURIComponent(String(v)); + separator = '&'; + } + }); + return (0, resource_url_impl_1.createResourceUrl)(url); +} +exports.appendParams = appendParams; +var BEFORE_FRAGMENT_REGEXP = /[^#]*/; +/** + * Creates a new TrustedResourceUrl based on an existing one but with the + * addition of a fragment (the part after `#`). If the URL already has a + * fragment, it is replaced with the new one. + * @param fragment The fragment to add to the URL, verbatim, without the leading + * `#`. No additional escaping is applied. + */ +function replaceFragment(trustedUrl, fragment) { + var urlString = (0, resource_url_impl_1.unwrapResourceUrl)(trustedUrl).toString(); + return (0, resource_url_impl_1.createResourceUrl)(BEFORE_FRAGMENT_REGEXP.exec(urlString)[0] + '#' + fragment); +} +exports.replaceFragment = replaceFragment; +/** + * Creates a `TrustedResourceUrl` by generating a `Blob` from a + * `SafeScript` and then calling `URL.createObjectURL` with that `Blob`. + * + * Caller must call `URL.revokeObjectUrl()` on the stringified url to + * release the underlying `Blob`. + */ +function objectUrlFromScript(safeScript) { + var scriptContent = (0, script_impl_1.unwrapScript)(safeScript).toString(); + var blob = new Blob([scriptContent], { type: 'text/javascript' }); + return (0, resource_url_impl_1.createResourceUrl)(URL.createObjectURL(blob)); +} +exports.objectUrlFromScript = objectUrlFromScript;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/resource_url_builders.mjs b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/resource_url_builders.mjs new file mode 100644 index 0000000..0af06df --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/resource_url_builders.mjs
@@ -0,0 +1,207 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import '../environment/dev'; +import { createResourceUrl, unwrapResourceUrl } from '../internals/resource_url_impl'; +import { unwrapScript } from '../internals/script_impl'; +import { assertIsTemplateObject } from '../internals/string_literal'; +/** + * Check whether the base url contains a valid origin, + * + * A string for an origin must contain only alphanumeric or any of the + * following: `-.:`, and must not be an IP address. Remember that, as per the + * documentation for TrustedResourceUrl, the origin must be trustworthy. + * + * @param base The base url that contains an origin. + */ +function hasValidOrigin(base) { + if (!(/^https:\/\//.test(base) || /^\/\//.test(base))) { + return false; + } + const originStart = base.indexOf('//') + 2; + const originEnd = base.indexOf('/', originStart); + // If the base url only contains the prefix (e.g. //), or the slash + // for the origin is right after the prefix (e.g. ///), the origin is + // missing. + if (originEnd <= originStart) { + throw new Error(`Can't interpolate data in a url's origin, ` + + `Please make sure to fully specify the origin, terminated with '/'.`); + } + const origin = base.substring(originStart, originEnd); + if (!/^[0-9a-z.:-]+$/i.test(origin)) { + throw new Error('The origin contains unsupported characters.'); + } + if (!/^[^:]*(:[0-9]+)?$/i.test(origin)) { + throw new Error('Invalid port number.'); + } + if (!/(^|\.)[a-z][^.]*$/i.test(origin)) { + throw new Error('The top-level domain must start with a letter.'); + } + return true; +} +/** + * Check whether the base url contains a valid about url at its beginning. + * + * An about url is either exactly 'about:blank' or 'about:blank#<str>' where + * <str> can be an arbitrary string. + * + * @param base The base url. + */ +function isValidAboutUrl(base) { + if (!/^about:blank/.test(base)) { + return false; + } + if (base !== 'about:blank' && !/^about:blank#/.test(base)) { + throw new Error('The about url is invalid.'); + } + return true; +} +/** + * Check whether the base url contains a valid path start at its beginning. + * + * A valid path start is either a '/' or a '/' followed by at least one + * character that is not '/' or '\'. + * + * @param base The base url. + */ +function isValidPathStart(base) { + if (!/^\//.test(base)) { + return false; + } + if ((base === '/') || + (base.length > 1 && base[1] !== '/' && base[1] !== '\\')) { + return true; + } + throw new Error('The path start in the url is invalid.'); +} +/** + * Builds TrustedResourceUrl from a template literal. + * + * This factory is a template literal tag function. It should be called with + * a template literal, with or without embedded expressions. For example, + * trustedResourceUrl`//example.com/${bar}`; + * or + * trustedResourceUrl`//example.com`; + * + * When this function is called with a template literal without any embedded + * expressions, the template string may contain anything as the whole URL is + * a compile-time string constant. + * + * When this function is called with a template literal that contains embedded + * expressions, the template must start with one of the following: + * - `https://<origin>/` + * - `//<origin>/` + * - `/<pathStart>` + * - `about:blank` + * - `data:` + * + * `<origin>` must contain only alphanumeric or any of the following: `-.:`. + * Remember that, as per the documentation for TrustedResourceUrl, the origin + * must be trustworthy. An origin of "example.com" could be set with this + * method, but would tie the security of your site to the security of + * example.com. Similarly, formats that potentially cover redirects hosted + * on a trusted origin are problematic, since that could lead to untrusted + * origins. + * + * `<pathStart>` is either an empty string, or a non empty string that does not + * start with '/' or '\'. + * In other words, `/<pathStart>` is either a '/' or a + * '/' followed by at least one character that is not '/' or '\'. + * + * `data:` (data URL) does not allow embedded expressions in the template + * literal input. + * + * All embedded expressions are URL encoded when they are interpolated. Do not + * embed expressions that are already URL encoded as they will be double encoded + * by the builder. + * + * @param templateObj This contains the literal part of the template literal. + * @param rest This represents the template's embedded expressions. + */ +export function trustedResourceUrl(templateObj, ...rest) { + // Check if templateObj is actually from a template literal. + if (process.env.NODE_ENV !== 'production') { + assertIsTemplateObject(templateObj, true, 'trustedResourceUrl is a template literal tag function and ' + + 'can only be called as such (e.g. trustedResourceUrl`/somepath.js`)'); + } + if (rest.length === 0) { + return createResourceUrl(templateObj[0]); + } + const base = templateObj[0].toLowerCase(); + if (process.env.NODE_ENV !== 'production') { + if (/^data:/.test(base)) { + throw new Error('Data URLs cannot have expressions in the template literal input.'); + } + if (!hasValidOrigin(base) && !isValidPathStart(base) && + !isValidAboutUrl(base)) { + throw new Error('Trying to interpolate expressions in an unsupported url format.'); + } + } + const urlParts = [templateObj[0]]; + for (let i = 0; i < rest.length; i++) { + urlParts.push(encodeURIComponent(rest[i])); + urlParts.push(templateObj[i + 1]); + } + return createResourceUrl(urlParts.join('')); +} +/** + * Creates a new TrustedResourceUrl with params added to the URL's search + * parameters. + * + * @param params What to add to the URL. Parameters with value `null` or + * `undefined` are skipped. Both keys and values will be encoded. Do not pass + * pre-encoded values as this will result them being double encoded. If the + * value is an array then the same parameter is added for every element in the + * array. + */ +export function appendParams(trustedUrl, params) { + let url = unwrapResourceUrl(trustedUrl).toString(); + if (/#/.test(url)) { + let message = ''; + if (process.env.NODE_ENV !== 'production') { + message = `Found a hash in url (${url}), appending not supported`; + } + throw new Error(message); + } + let separator = /\?/.test(url) ? '&' : '?'; + // for-of has a big polyfill. + // tslint:disable-next-line:ban-iterable-foreach + params.forEach((value, key) => { + const values = (value instanceof Array) ? value : [value]; + for (let i = 0; i < values.length; i++) { + const v = values[i]; + if (v === null || v === undefined) { + continue; + } + url += separator + encodeURIComponent(key) + '=' + + encodeURIComponent(String(v)); + separator = '&'; + } + }); + return createResourceUrl(url); +} +const BEFORE_FRAGMENT_REGEXP = /[^#]*/; +/** + * Creates a new TrustedResourceUrl based on an existing one but with the + * addition of a fragment (the part after `#`). If the URL already has a + * fragment, it is replaced with the new one. + * @param fragment The fragment to add to the URL, verbatim, without the leading + * `#`. No additional escaping is applied. + */ +export function replaceFragment(trustedUrl, fragment) { + const urlString = unwrapResourceUrl(trustedUrl).toString(); + return createResourceUrl(BEFORE_FRAGMENT_REGEXP.exec(urlString)[0] + '#' + fragment); +} +/** + * Creates a `TrustedResourceUrl` by generating a `Blob` from a + * `SafeScript` and then calling `URL.createObjectURL` with that `Blob`. + * + * Caller must call `URL.revokeObjectUrl()` on the stringified url to + * release the underlying `Blob`. + */ +export function objectUrlFromScript(safeScript) { + const scriptContent = unwrapScript(safeScript).toString(); + const blob = new Blob([scriptContent], { type: 'text/javascript' }); + return createResourceUrl(URL.createObjectURL(blob)); +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/script_builders.d.ts b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/script_builders.d.ts new file mode 100644 index 0000000..183a7ffc --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/script_builders.d.ts
@@ -0,0 +1,55 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import '../environment/dev'; +import { SafeScript } from '../internals/script_impl'; +declare type Primitive = number | string | boolean | null; +declare type Serializable = Primitive | readonly Serializable[] | { + readonly [key: string]: Serializable; +}; +/** + * Creates a SafeScript object from a template literal (without any embedded + * expressions). + * + * This function is a template literal tag function. It should be called with + * a template literal that does not contain any expressions. For example, + * safeScript`foo`; + * + * @param templateObj This contains the literal part of the template literal. + */ +export declare function safeScript(templateObj: TemplateStringsArray): SafeScript; +/** Creates a `SafeScript` value by concatenating multiple `SafeScript`s. */ +export declare function concatScripts(scripts: readonly SafeScript[]): SafeScript; +/** + * Converts a serializable value into JSON that is safe to interpolate into a + * script context. In particular it escapes < characters so that a value of + * "</script>" doesn't break out of the context. + * @param value The value to serialize. + */ +export declare function valueAsScript(value: Serializable): SafeScript; +/** + * Creates a `SafeScript` object from a template literal (without any embedded + * expressions) along with additional arguments that the script should have + * access to. These arguments will be JSON-encoded and passed to the script as + * a function call. + * @example + * ```ts + * safeScriptWithArgs`function (name, props) { + * console.log(name + ' is ' + props.age); + * }`('Bob', { 'age': 42 }) + * ``` + * would return a `SafeScript` that represents the following code: + * ```js + * (function (name, props) { + * console.log(name + ' is ' + props.age); + * })("Bob",{"age":42}) + * ``` + * @note Be careful when passing objects as arguments, as unquoted property + * names may be changed during compilation. + * @param templateObj This contains the literal part of the template literal. + * @param emptyArgs Expressions that evaluate to the empty string to enable + * inline comments. + */ +export declare function safeScriptWithArgs(templateObj: TemplateStringsArray, ...emptyArgs: ReadonlyArray<''>): (...argValues: Serializable[]) => SafeScript; +export {};
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/script_builders.js b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/script_builders.js new file mode 100644 index 0000000..4ce4fee --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/script_builders.js
@@ -0,0 +1,91 @@ +"use strict"; +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.safeScriptWithArgs = exports.valueAsScript = exports.concatScripts = exports.safeScript = void 0; +require("../environment/dev"); +var script_impl_1 = require("../internals/script_impl"); +var string_literal_1 = require("../internals/string_literal"); +/** + * Creates a SafeScript object from a template literal (without any embedded + * expressions). + * + * This function is a template literal tag function. It should be called with + * a template literal that does not contain any expressions. For example, + * safeScript`foo`; + * + * @param templateObj This contains the literal part of the template literal. + */ +function safeScript(templateObj) { + if (process.env.NODE_ENV !== 'production') { + (0, string_literal_1.assertIsTemplateObject)(templateObj, false, 'safeScript is a template literal tag function ' + + 'that only accepts template literals without expressions. ' + + 'For example, safeScript`foo`;'); + } + return (0, script_impl_1.createScript)(templateObj[0]); +} +exports.safeScript = safeScript; +/** Creates a `SafeScript` value by concatenating multiple `SafeScript`s. */ +function concatScripts(scripts) { + return (0, script_impl_1.createScript)(scripts.map(script_impl_1.unwrapScript).join('')); +} +exports.concatScripts = concatScripts; +/** + * Converts a serializable value into JSON that is safe to interpolate into a + * script context. In particular it escapes < characters so that a value of + * "</script>" doesn't break out of the context. + * @param value The value to serialize. + */ +function valueAsScript(value) { + return (0, script_impl_1.createScript)(JSON.stringify(value).replace(/</g, '\\u003C')); +} +exports.valueAsScript = valueAsScript; +/** + * Creates a `SafeScript` object from a template literal (without any embedded + * expressions) along with additional arguments that the script should have + * access to. These arguments will be JSON-encoded and passed to the script as + * a function call. + * @example + * ```ts + * safeScriptWithArgs`function (name, props) { + * console.log(name + ' is ' + props.age); + * }`('Bob', { 'age': 42 }) + * ``` + * would return a `SafeScript` that represents the following code: + * ```js + * (function (name, props) { + * console.log(name + ' is ' + props.age); + * })("Bob",{"age":42}) + * ``` + * @note Be careful when passing objects as arguments, as unquoted property + * names may be changed during compilation. + * @param templateObj This contains the literal part of the template literal. + * @param emptyArgs Expressions that evaluate to the empty string to enable + * inline comments. + */ +function safeScriptWithArgs(templateObj) { + var emptyArgs = []; + for (var _i = 1; _i < arguments.length; _i++) { + emptyArgs[_i - 1] = arguments[_i]; + } + if (process.env.NODE_ENV !== 'production') { + if (emptyArgs.some(function (a) { return a !== ''; })) { + throw new Error('safeScriptWithArgs only allows empty string expressions ' + + 'to enable inline comments.'); + } + (0, string_literal_1.assertIsTemplateObject)(templateObj, true, 'safeScriptWithArgs is a template literal tag function ' + + 'that only accepts template literals. ' + + 'For example, safeScriptWithArgs`foo`;'); + } + return function () { + var argValues = []; + for (var _i = 0; _i < arguments.length; _i++) { + argValues[_i] = arguments[_i]; + } + var values = argValues.map(function (v) { return valueAsScript(v).toString(); }); + return (0, script_impl_1.createScript)("(".concat(templateObj.join(''), ")(").concat(values.join(','), ")")); + }; +} +exports.safeScriptWithArgs = safeScriptWithArgs;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/script_builders.mjs b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/script_builders.mjs new file mode 100644 index 0000000..bf52dfdc --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/script_builders.mjs
@@ -0,0 +1,76 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import '../environment/dev'; +import { createScript, unwrapScript } from '../internals/script_impl'; +import { assertIsTemplateObject } from '../internals/string_literal'; +/** + * Creates a SafeScript object from a template literal (without any embedded + * expressions). + * + * This function is a template literal tag function. It should be called with + * a template literal that does not contain any expressions. For example, + * safeScript`foo`; + * + * @param templateObj This contains the literal part of the template literal. + */ +export function safeScript(templateObj) { + if (process.env.NODE_ENV !== 'production') { + assertIsTemplateObject(templateObj, false, 'safeScript is a template literal tag function ' + + 'that only accepts template literals without expressions. ' + + 'For example, safeScript`foo`;'); + } + return createScript(templateObj[0]); +} +/** Creates a `SafeScript` value by concatenating multiple `SafeScript`s. */ +export function concatScripts(scripts) { + return createScript(scripts.map(unwrapScript).join('')); +} +/** + * Converts a serializable value into JSON that is safe to interpolate into a + * script context. In particular it escapes < characters so that a value of + * "</script>" doesn't break out of the context. + * @param value The value to serialize. + */ +export function valueAsScript(value) { + return createScript(JSON.stringify(value).replace(/</g, '\\u003C')); +} +/** + * Creates a `SafeScript` object from a template literal (without any embedded + * expressions) along with additional arguments that the script should have + * access to. These arguments will be JSON-encoded and passed to the script as + * a function call. + * @example + * ```ts + * safeScriptWithArgs`function (name, props) { + * console.log(name + ' is ' + props.age); + * }`('Bob', { 'age': 42 }) + * ``` + * would return a `SafeScript` that represents the following code: + * ```js + * (function (name, props) { + * console.log(name + ' is ' + props.age); + * })("Bob",{"age":42}) + * ``` + * @note Be careful when passing objects as arguments, as unquoted property + * names may be changed during compilation. + * @param templateObj This contains the literal part of the template literal. + * @param emptyArgs Expressions that evaluate to the empty string to enable + * inline comments. + */ +export function safeScriptWithArgs(templateObj, ...emptyArgs) { + if (process.env.NODE_ENV !== 'production') { + if (emptyArgs.some(a => a !== '')) { + throw new Error('safeScriptWithArgs only allows empty string expressions ' + + 'to enable inline comments.'); + } + assertIsTemplateObject(templateObj, true, 'safeScriptWithArgs is a template literal tag function ' + + 'that only accepts template literals. ' + + 'For example, safeScriptWithArgs`foo`;'); + } + return (...argValues) => { + const values = argValues.map((v) => valueAsScript(v).toString()); + return createScript(`(${templateObj.join('')})(${values.join(',')})`); + }; +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/sensitive_attributes.d.ts b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/sensitive_attributes.d.ts new file mode 100644 index 0000000..ee1b1e2 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/sensitive_attributes.d.ts
@@ -0,0 +1,9 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +/** + * Security sensitive attribute names that should not be set through + * `setAttribute` or similar functions. + */ +export declare const SECURITY_SENSITIVE_ATTRIBUTES: readonly ["src", "srcdoc", "codebase", "data", "href", "rel", "action", "formaction", "sandbox", "cite", "poster", "icon"];
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/sensitive_attributes.js b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/sensitive_attributes.js new file mode 100644 index 0000000..f390f28 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/sensitive_attributes.js
@@ -0,0 +1,26 @@ +"use strict"; +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SECURITY_SENSITIVE_ATTRIBUTES = void 0; +// AUTOGENERATED. DO NOT EDIT. +/** + * Security sensitive attribute names that should not be set through + * `setAttribute` or similar functions. + */ +exports.SECURITY_SENSITIVE_ATTRIBUTES = [ + 'src', + 'srcdoc', + 'codebase', + 'data', + 'href', + 'rel', + 'action', + 'formaction', + 'sandbox', + 'cite', + 'poster', + 'icon', +];
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/sensitive_attributes.mjs b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/sensitive_attributes.mjs new file mode 100644 index 0000000..c59495d --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/sensitive_attributes.mjs
@@ -0,0 +1,23 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +// AUTOGENERATED. DO NOT EDIT. +/** + * Security sensitive attribute names that should not be set through + * `setAttribute` or similar functions. + */ +export const SECURITY_SENSITIVE_ATTRIBUTES = [ + 'src', + 'srcdoc', + 'codebase', + 'data', + 'href', + 'rel', + 'action', + 'formaction', + 'sandbox', + 'cite', + 'poster', + 'icon', +];
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/style_builders.d.ts b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/style_builders.d.ts new file mode 100644 index 0000000..e172795 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/style_builders.d.ts
@@ -0,0 +1,30 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import '../environment/dev'; +import { SafeStyle } from '../internals/style_impl'; +/** + * Creates a SafeStyle object from a template literal (without any embedded + * expressions). + * + * ` style` should be in the format + * ` name: value; [name: value; ...]` and must not have any < or > + * characters in it. This is so that SafeStyle's contract is preserved, + * allowing the SafeStyle to correctly be interpreted as a sequence of CSS + * declarations and without affecting the syntactic structure of any + * surrounding CSS and HTML. + * + * This function is a template literal tag function. It should be called with + * a template literal that does not contain any expressions. For example, + * safeStyle`foo`; + * This function first checks if it is called with a literal template, and + * then performs basic sanity checks on the format of ` style` + * but does not constrain the format of ` name} and {@code value`, except + * for disallowing tag characters. + * + * @param templateObj This contains the literal part of the template literal. + */ +export declare function safeStyle(templateObj: TemplateStringsArray): SafeStyle; +/** Creates a `SafeStyle` value by concatenating multiple `SafeStyle`s. */ +export declare function concatStyles(styles: readonly SafeStyle[]): SafeStyle;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/style_builders.js b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/style_builders.js new file mode 100644 index 0000000..01701966 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/style_builders.js
@@ -0,0 +1,57 @@ +"use strict"; +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.concatStyles = exports.safeStyle = void 0; +require("../environment/dev"); +var string_literal_1 = require("../internals/string_literal"); +var style_impl_1 = require("../internals/style_impl"); +/** + * Creates a SafeStyle object from a template literal (without any embedded + * expressions). + * + * ` style` should be in the format + * ` name: value; [name: value; ...]` and must not have any < or > + * characters in it. This is so that SafeStyle's contract is preserved, + * allowing the SafeStyle to correctly be interpreted as a sequence of CSS + * declarations and without affecting the syntactic structure of any + * surrounding CSS and HTML. + * + * This function is a template literal tag function. It should be called with + * a template literal that does not contain any expressions. For example, + * safeStyle`foo`; + * This function first checks if it is called with a literal template, and + * then performs basic sanity checks on the format of ` style` + * but does not constrain the format of ` name} and {@code value`, except + * for disallowing tag characters. + * + * @param templateObj This contains the literal part of the template literal. + */ +function safeStyle(templateObj) { + if (process.env.NODE_ENV !== 'production') { + (0, string_literal_1.assertIsTemplateObject)(templateObj, false, 'safeStyle is a template literal tag function ' + + 'that only accepts template literals without expressions. ' + + 'For example, safeStyle`foo`;'); + } + var style = templateObj[0]; + if (process.env.NODE_ENV !== 'production') { + if (/[<>]/.test(style)) { + throw new Error('Forbidden characters in style string: ' + style); + } + if (!/;$/.test(style)) { + throw new Error('Style string does not end with ";": ' + style); + } + if (!/:/.test(style)) { + throw new Error('Style string should contain one or more ":": ' + style); + } + } + return (0, style_impl_1.createStyle)(style); +} +exports.safeStyle = safeStyle; +/** Creates a `SafeStyle` value by concatenating multiple `SafeStyle`s. */ +function concatStyles(styles) { + return (0, style_impl_1.createStyle)(styles.map(style_impl_1.unwrapStyle).join('')); +} +exports.concatStyles = concatStyles;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/style_builders.mjs b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/style_builders.mjs new file mode 100644 index 0000000..773a253 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/style_builders.mjs
@@ -0,0 +1,52 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import '../environment/dev'; +import { assertIsTemplateObject } from '../internals/string_literal'; +import { createStyle, unwrapStyle } from '../internals/style_impl'; +/** + * Creates a SafeStyle object from a template literal (without any embedded + * expressions). + * + * ` style` should be in the format + * ` name: value; [name: value; ...]` and must not have any < or > + * characters in it. This is so that SafeStyle's contract is preserved, + * allowing the SafeStyle to correctly be interpreted as a sequence of CSS + * declarations and without affecting the syntactic structure of any + * surrounding CSS and HTML. + * + * This function is a template literal tag function. It should be called with + * a template literal that does not contain any expressions. For example, + * safeStyle`foo`; + * This function first checks if it is called with a literal template, and + * then performs basic sanity checks on the format of ` style` + * but does not constrain the format of ` name} and {@code value`, except + * for disallowing tag characters. + * + * @param templateObj This contains the literal part of the template literal. + */ +export function safeStyle(templateObj) { + if (process.env.NODE_ENV !== 'production') { + assertIsTemplateObject(templateObj, false, 'safeStyle is a template literal tag function ' + + 'that only accepts template literals without expressions. ' + + 'For example, safeStyle`foo`;'); + } + const style = templateObj[0]; + if (process.env.NODE_ENV !== 'production') { + if (/[<>]/.test(style)) { + throw new Error('Forbidden characters in style string: ' + style); + } + if (!/;$/.test(style)) { + throw new Error('Style string does not end with ";": ' + style); + } + if (!/:/.test(style)) { + throw new Error('Style string should contain one or more ":": ' + style); + } + } + return createStyle(style); +} +/** Creates a `SafeStyle` value by concatenating multiple `SafeStyle`s. */ +export function concatStyles(styles) { + return createStyle(styles.map(unwrapStyle).join('')); +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/style_sheet_builders.d.ts b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/style_sheet_builders.d.ts new file mode 100644 index 0000000..7ae93c9 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/style_sheet_builders.d.ts
@@ -0,0 +1,25 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import '../environment/dev'; +import { SafeStyleSheet } from '../internals/style_sheet_impl'; +/** + * Creates a SafeStyleSheet object from a template literal (without any + * embedded expressions). + * + * This function is a template literal tag function. It should be called with + * a template literal that does not contain any expressions. For example, + * safeStyleSheet`foo`; + * The argument must not have any < or > characters in it. This is so that + * SafeStyleSheet's contract is preserved, allowing the SafeStyleSheet to + * correctly be interpreted as a sequence of CSS declarations and without + * affecting the syntactic structure of any surrounding CSS and HTML. + * + * @param templateObj This contains the literal part of the template literal. + */ +export declare function safeStyleSheet(templateObj: TemplateStringsArray): SafeStyleSheet; +/** + * Creates a `SafeStyleSheet` value by concatenating multiple `SafeStyleSheet`s. + */ +export declare function concatStyleSheets(sheets: readonly SafeStyleSheet[]): SafeStyleSheet;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/style_sheet_builders.js b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/style_sheet_builders.js new file mode 100644 index 0000000..36ceed2 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/style_sheet_builders.js
@@ -0,0 +1,46 @@ +"use strict"; +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.concatStyleSheets = exports.safeStyleSheet = void 0; +require("../environment/dev"); +var string_literal_1 = require("../internals/string_literal"); +var style_sheet_impl_1 = require("../internals/style_sheet_impl"); +/** + * Creates a SafeStyleSheet object from a template literal (without any + * embedded expressions). + * + * This function is a template literal tag function. It should be called with + * a template literal that does not contain any expressions. For example, + * safeStyleSheet`foo`; + * The argument must not have any < or > characters in it. This is so that + * SafeStyleSheet's contract is preserved, allowing the SafeStyleSheet to + * correctly be interpreted as a sequence of CSS declarations and without + * affecting the syntactic structure of any surrounding CSS and HTML. + * + * @param templateObj This contains the literal part of the template literal. + */ +function safeStyleSheet(templateObj) { + if (process.env.NODE_ENV !== 'production') { + (0, string_literal_1.assertIsTemplateObject)(templateObj, false, 'safeStyleSheet is a template literal tag ' + + 'function that only accepts template literals without ' + + 'expressions. For example, safeStyleSheet`foo`;'); + } + var styleSheet = templateObj[0]; + if (process.env.NODE_ENV !== 'production') { + if (/[<>]/.test(styleSheet)) { + throw new Error('Forbidden characters in styleSheet string: ' + styleSheet); + } + } + return (0, style_sheet_impl_1.createStyleSheet)(styleSheet); +} +exports.safeStyleSheet = safeStyleSheet; +/** + * Creates a `SafeStyleSheet` value by concatenating multiple `SafeStyleSheet`s. + */ +function concatStyleSheets(sheets) { + return (0, style_sheet_impl_1.createStyleSheet)(sheets.map(style_sheet_impl_1.unwrapStyleSheet).join('')); +} +exports.concatStyleSheets = concatStyleSheets;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/style_sheet_builders.mjs b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/style_sheet_builders.mjs new file mode 100644 index 0000000..04ac05c --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/style_sheet_builders.mjs
@@ -0,0 +1,41 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import '../environment/dev'; +import { assertIsTemplateObject } from '../internals/string_literal'; +import { createStyleSheet, unwrapStyleSheet } from '../internals/style_sheet_impl'; +/** + * Creates a SafeStyleSheet object from a template literal (without any + * embedded expressions). + * + * This function is a template literal tag function. It should be called with + * a template literal that does not contain any expressions. For example, + * safeStyleSheet`foo`; + * The argument must not have any < or > characters in it. This is so that + * SafeStyleSheet's contract is preserved, allowing the SafeStyleSheet to + * correctly be interpreted as a sequence of CSS declarations and without + * affecting the syntactic structure of any surrounding CSS and HTML. + * + * @param templateObj This contains the literal part of the template literal. + */ +export function safeStyleSheet(templateObj) { + if (process.env.NODE_ENV !== 'production') { + assertIsTemplateObject(templateObj, false, 'safeStyleSheet is a template literal tag ' + + 'function that only accepts template literals without ' + + 'expressions. For example, safeStyleSheet`foo`;'); + } + const styleSheet = templateObj[0]; + if (process.env.NODE_ENV !== 'production') { + if (/[<>]/.test(styleSheet)) { + throw new Error('Forbidden characters in styleSheet string: ' + styleSheet); + } + } + return createStyleSheet(styleSheet); +} +/** + * Creates a `SafeStyleSheet` value by concatenating multiple `SafeStyleSheet`s. + */ +export function concatStyleSheets(sheets) { + return createStyleSheet(sheets.map(unwrapStyleSheet).join('')); +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/url_sanitizer.d.ts b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/url_sanitizer.d.ts new file mode 100644 index 0000000..95208add --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/url_sanitizer.d.ts
@@ -0,0 +1,41 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +/** + * @fileoverview Provides functions to enforce the SafeUrl contract at the sink + * level. + */ +import '../environment/dev'; +/** + * Extracts the scheme from the given URL. If the URL is relative, https: is + * assumed. + * @param url The URL to extract the scheme from. + * @return the URL scheme. + */ +export declare function extractScheme(url: string): string | undefined; +/** + * Checks that the URL scheme is not javascript. + * The URL parsing relies on the URL API in browsers that support it. + * @param url The URL to sanitize for a SafeUrl sink. + * @return undefined if url has a javascript: scheme, the original URL + * otherwise. + */ +export declare function sanitizeJavascriptUrl(url: string): string | undefined; +/** + * Type alias for URLs passed to DOM sink wrappers. + */ +export declare type Url = string; +/** + * Adapter to sanitize string URLs in DOM sink wrappers. + * @return undefined if the URL was sanitized. + */ +export declare function unwrapUrlOrSanitize(url: Url): string | undefined; +/** + * Sanitizes a URL restrictively. + * This sanitizer protects against XSS and potentially other uncommon and + * undesirable schemes that an attacker could use for e.g. phishing (tel:, + * callto: ssh: etc schemes). This sanitizer is primarily meant to be used by + * the HTML sanitizer. + */ +export declare function restrictivelySanitizeUrl(url: string): string;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/url_sanitizer.js b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/url_sanitizer.js new file mode 100644 index 0000000..df29f20 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/url_sanitizer.js
@@ -0,0 +1,79 @@ +"use strict"; +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.restrictivelySanitizeUrl = exports.unwrapUrlOrSanitize = exports.sanitizeJavascriptUrl = exports.extractScheme = void 0; +/** + * @fileoverview Provides functions to enforce the SafeUrl contract at the sink + * level. + */ +require("../environment/dev"); +/** + * Extracts the scheme from the given URL. If the URL is relative, https: is + * assumed. + * @param url The URL to extract the scheme from. + * @return the URL scheme. + */ +function extractScheme(url) { + var parsedUrl; + try { + parsedUrl = new URL(url); + } + catch (e) { + // According to https://url.spec.whatwg.org/#constructors, the URL + // constructor with one parameter throws if `url` is not absolute. In this + // case, we are sure that no explicit scheme (javascript: ) is set. + // This can also be a URL parsing error, but in this case the URL won't be + // run anyway. + return 'https:'; + } + return parsedUrl.protocol; +} +exports.extractScheme = extractScheme; +// We can't use an ES6 Set here because gws somehow depends on this code and +// doesn't want to pay the cost of a polyfill. +var ALLOWED_SCHEMES = ['data:', 'http:', 'https:', 'mailto:', 'ftp:']; +/** + * Checks that the URL scheme is not javascript. + * The URL parsing relies on the URL API in browsers that support it. + * @param url The URL to sanitize for a SafeUrl sink. + * @return undefined if url has a javascript: scheme, the original URL + * otherwise. + */ +function sanitizeJavascriptUrl(url) { + var parsedScheme = extractScheme(url); + if (parsedScheme === 'javascript:') { + if (process.env.NODE_ENV !== 'production') { + console.error("A URL with content '".concat(url, "' was sanitized away.")); + } + return undefined; + } + return url; +} +exports.sanitizeJavascriptUrl = sanitizeJavascriptUrl; +/** + * Adapter to sanitize string URLs in DOM sink wrappers. + * @return undefined if the URL was sanitized. + */ +function unwrapUrlOrSanitize(url) { + return sanitizeJavascriptUrl(url); +} +exports.unwrapUrlOrSanitize = unwrapUrlOrSanitize; +/** + * Sanitizes a URL restrictively. + * This sanitizer protects against XSS and potentially other uncommon and + * undesirable schemes that an attacker could use for e.g. phishing (tel:, + * callto: ssh: etc schemes). This sanitizer is primarily meant to be used by + * the HTML sanitizer. + */ +function restrictivelySanitizeUrl(url) { + var parsedScheme = extractScheme(url); + if (parsedScheme !== undefined && + ALLOWED_SCHEMES.indexOf(parsedScheme.toLowerCase()) !== -1) { + return url; + } + return 'about:invalid#zClosurez'; +} +exports.restrictivelySanitizeUrl = restrictivelySanitizeUrl;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/url_sanitizer.mjs b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/url_sanitizer.mjs new file mode 100644 index 0000000..1c537564 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/builders/url_sanitizer.mjs
@@ -0,0 +1,72 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +/** + * @fileoverview Provides functions to enforce the SafeUrl contract at the sink + * level. + */ +import '../environment/dev'; +/** + * Extracts the scheme from the given URL. If the URL is relative, https: is + * assumed. + * @param url The URL to extract the scheme from. + * @return the URL scheme. + */ +export function extractScheme(url) { + let parsedUrl; + try { + parsedUrl = new URL(url); + } + catch (e) { + // According to https://url.spec.whatwg.org/#constructors, the URL + // constructor with one parameter throws if `url` is not absolute. In this + // case, we are sure that no explicit scheme (javascript: ) is set. + // This can also be a URL parsing error, but in this case the URL won't be + // run anyway. + return 'https:'; + } + return parsedUrl.protocol; +} +// We can't use an ES6 Set here because gws somehow depends on this code and +// doesn't want to pay the cost of a polyfill. +const ALLOWED_SCHEMES = ['data:', 'http:', 'https:', 'mailto:', 'ftp:']; +/** + * Checks that the URL scheme is not javascript. + * The URL parsing relies on the URL API in browsers that support it. + * @param url The URL to sanitize for a SafeUrl sink. + * @return undefined if url has a javascript: scheme, the original URL + * otherwise. + */ +export function sanitizeJavascriptUrl(url) { + const parsedScheme = extractScheme(url); + if (parsedScheme === 'javascript:') { + if (process.env.NODE_ENV !== 'production') { + console.error(`A URL with content '${url}' was sanitized away.`); + } + return undefined; + } + return url; +} +/** + * Adapter to sanitize string URLs in DOM sink wrappers. + * @return undefined if the URL was sanitized. + */ +export function unwrapUrlOrSanitize(url) { + return sanitizeJavascriptUrl(url); +} +/** + * Sanitizes a URL restrictively. + * This sanitizer protects against XSS and potentially other uncommon and + * undesirable schemes that an attacker could use for e.g. phishing (tel:, + * callto: ssh: etc schemes). This sanitizer is primarily meant to be used by + * the HTML sanitizer. + */ +export function restrictivelySanitizeUrl(url) { + const parsedScheme = extractScheme(url); + if (parsedScheme !== undefined && + ALLOWED_SCHEMES.indexOf(parsedScheme.toLowerCase()) !== -1) { + return url; + } + return 'about:invalid#zClosurez'; +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/anchor.d.ts b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/anchor.d.ts new file mode 100644 index 0000000..12f320c --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/anchor.d.ts
@@ -0,0 +1,9 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import { Url } from '../../builders/url_sanitizer'; +/** + * Sets the Href attribute from the given Url. + */ +export declare function setHref(anchor: HTMLAnchorElement, url: Url): void;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/anchor.js b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/anchor.js new file mode 100644 index 0000000..99a7b3f9 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/anchor.js
@@ -0,0 +1,18 @@ +"use strict"; +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.setHref = void 0; +var url_sanitizer_1 = require("../../builders/url_sanitizer"); +/** + * Sets the Href attribute from the given Url. + */ +function setHref(anchor, url) { + var sanitizedUrl = (0, url_sanitizer_1.unwrapUrlOrSanitize)(url); + if (sanitizedUrl !== undefined) { + anchor.href = sanitizedUrl; + } +} +exports.setHref = setHref;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/anchor.mjs b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/anchor.mjs new file mode 100644 index 0000000..187e5af --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/anchor.mjs
@@ -0,0 +1,14 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import { unwrapUrlOrSanitize } from '../../builders/url_sanitizer'; +/** + * Sets the Href attribute from the given Url. + */ +export function setHref(anchor, url) { + const sanitizedUrl = unwrapUrlOrSanitize(url); + if (sanitizedUrl !== undefined) { + anchor.href = sanitizedUrl; + } +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/area.d.ts b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/area.d.ts new file mode 100644 index 0000000..0e24014 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/area.d.ts
@@ -0,0 +1,9 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import { Url } from '../../builders/url_sanitizer'; +/** + * Sets the Href attribute from the given Url. + */ +export declare function setHref(area: HTMLAreaElement, url: Url): void;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/area.js b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/area.js new file mode 100644 index 0000000..6e7f59a --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/area.js
@@ -0,0 +1,18 @@ +"use strict"; +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.setHref = void 0; +var url_sanitizer_1 = require("../../builders/url_sanitizer"); +/** + * Sets the Href attribute from the given Url. + */ +function setHref(area, url) { + var sanitizedUrl = (0, url_sanitizer_1.unwrapUrlOrSanitize)(url); + if (sanitizedUrl !== undefined) { + area.href = sanitizedUrl; + } +} +exports.setHref = setHref;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/area.mjs b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/area.mjs new file mode 100644 index 0000000..5554db5 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/area.mjs
@@ -0,0 +1,14 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import { unwrapUrlOrSanitize } from '../../builders/url_sanitizer'; +/** + * Sets the Href attribute from the given Url. + */ +export function setHref(area, url) { + const sanitizedUrl = unwrapUrlOrSanitize(url); + if (sanitizedUrl !== undefined) { + area.href = sanitizedUrl; + } +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/base.d.ts b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/base.d.ts new file mode 100644 index 0000000..47a0619 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/base.d.ts
@@ -0,0 +1,9 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import { TrustedResourceUrl } from '../../internals/resource_url_impl'; +/** + * Sets the Href attribute from the given TrustedResourceUrl. + */ +export declare function setHref(baseEl: HTMLBaseElement, url: TrustedResourceUrl): void;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/base.js b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/base.js new file mode 100644 index 0000000..c59032a4 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/base.js
@@ -0,0 +1,15 @@ +"use strict"; +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.setHref = void 0; +var resource_url_impl_1 = require("../../internals/resource_url_impl"); +/** + * Sets the Href attribute from the given TrustedResourceUrl. + */ +function setHref(baseEl, url) { + baseEl.href = (0, resource_url_impl_1.unwrapResourceUrl)(url); +} +exports.setHref = setHref;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/base.mjs b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/base.mjs new file mode 100644 index 0000000..98df5d2 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/base.mjs
@@ -0,0 +1,11 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import { unwrapResourceUrl } from '../../internals/resource_url_impl'; +/** + * Sets the Href attribute from the given TrustedResourceUrl. + */ +export function setHref(baseEl, url) { + baseEl.href = unwrapResourceUrl(url); +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/button.d.ts b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/button.d.ts new file mode 100644 index 0000000..b893f63 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/button.d.ts
@@ -0,0 +1,9 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import { Url } from '../../builders/url_sanitizer'; +/** + * Sets the Formaction attribute from the given Url. + */ +export declare function setFormaction(button: HTMLButtonElement, url: Url): void;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/button.js b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/button.js new file mode 100644 index 0000000..9525fef3 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/button.js
@@ -0,0 +1,18 @@ +"use strict"; +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.setFormaction = void 0; +var url_sanitizer_1 = require("../../builders/url_sanitizer"); +/** + * Sets the Formaction attribute from the given Url. + */ +function setFormaction(button, url) { + var sanitizedUrl = (0, url_sanitizer_1.unwrapUrlOrSanitize)(url); + if (sanitizedUrl !== undefined) { + button.formAction = sanitizedUrl; + } +} +exports.setFormaction = setFormaction;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/button.mjs b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/button.mjs new file mode 100644 index 0000000..9fed100 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/button.mjs
@@ -0,0 +1,14 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import { unwrapUrlOrSanitize } from '../../builders/url_sanitizer'; +/** + * Sets the Formaction attribute from the given Url. + */ +export function setFormaction(button, url) { + const sanitizedUrl = unwrapUrlOrSanitize(url); + if (sanitizedUrl !== undefined) { + button.formAction = sanitizedUrl; + } +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/element.d.ts b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/element.d.ts new file mode 100644 index 0000000..2684a36 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/element.d.ts
@@ -0,0 +1,49 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +/** + * @fileoverview This contains safe wrappers for properties that aren't specific + * to one kind of HTMLElement (like innerHTML), plus other setters and functions + * that are not tied to elements (like location.href or Worker constructor). + */ +import '../../environment/dev'; +import { SafeAttributePrefix } from '../../internals/attribute_impl'; +import { SafeHtml } from '../../internals/html_impl'; +import { SafeStyle } from '../../internals/style_impl'; +/** + * Safely set {@link Element.innerHTML} on a given ShadowRoot or Element which + * may not be a `<script>` element or a `<style>` element. + */ +export declare function setInnerHtml<T extends Element | ShadowRoot>(elOrRoot: Exclude<T, HTMLScriptElement | HTMLStyleElement>, v: SafeHtml): void; +/** + * Safely set {@link Element.outerHTML} for the given Element. + */ +export declare function setOuterHtml(e: Element, v: SafeHtml): void; +/** + * Set `ElementCSSInlineStyle.cssText` for the given `ElementCSSInlineStyle`. + */ +export declare function setCssText(e: ElementCSSInlineStyle, v: SafeStyle): void; +/** + * Safely call {@link Element.insertAdjacentHTML} for the given Element. + */ +export declare function insertAdjacentHtml<T extends Element>(element: Exclude<T, HTMLScriptElement | HTMLStyleElement>, position: 'afterbegin' | 'afterend' | 'beforebegin' | 'beforeend', v: SafeHtml): void; +/** + * Given a set of known-to-be-safe prefixes (e.g., "data-", "aria-", "js"), + * return a setter function that allows you to set attributes on an element, + * as long as the names of the attributes to be set has one of the prefixes. + * + * The returned setter ensures that setting any dangerous attribute, e.g., + * "src", "href" will cause an exception. This is intended to be used as the + * safe alterantive of `Element#setAttribute`, when applications need to set + * attributes that do not have security implications and do not have a + * corresponding DOM property. + */ +export declare function buildPrefixedAttributeSetter(prefix: SafeAttributePrefix, ...otherPrefixes: readonly SafeAttributePrefix[]): (e: Element, attr: string, value: string) => void; +/** + * The safe alternative to Element#setAttribute. The function takes a list of + * `SafeAttributePrefix`, making developer intention explicit. The attribute + * to be set must has one of the safe prefixes, otherwise the function throws + * an Error. + */ +export declare function setPrefixedAttribute(attrPrefixes: readonly SafeAttributePrefix[], e: Element, attr: string, value: string): void;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/element.js b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/element.js new file mode 100644 index 0000000..a2698c39 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/element.js
@@ -0,0 +1,145 @@ +"use strict"; +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +var __read = (this && this.__read) || function (o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; +}; +var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.setPrefixedAttribute = exports.buildPrefixedAttributeSetter = exports.insertAdjacentHtml = exports.setCssText = exports.setOuterHtml = exports.setInnerHtml = void 0; +/** + * @fileoverview This contains safe wrappers for properties that aren't specific + * to one kind of HTMLElement (like innerHTML), plus other setters and functions + * that are not tied to elements (like location.href or Worker constructor). + */ +require("../../environment/dev"); +var attribute_impl_1 = require("../../internals/attribute_impl"); +var html_impl_1 = require("../../internals/html_impl"); +var style_impl_1 = require("../../internals/style_impl"); +/** + * Safely set {@link Element.innerHTML} on a given ShadowRoot or Element which + * may not be a `<script>` element or a `<style>` element. + */ +function setInnerHtml(elOrRoot, v) { + if (isElement(elOrRoot)) { + throwIfScriptOrStyle(elOrRoot); + } + elOrRoot.innerHTML = (0, html_impl_1.unwrapHtml)(v); +} +exports.setInnerHtml = setInnerHtml; +/** + * Safely set {@link Element.outerHTML} for the given Element. + */ +function setOuterHtml(e, v) { + var parent = e.parentElement; + if (parent !== null) { + throwIfScriptOrStyle(parent); + } + e.outerHTML = (0, html_impl_1.unwrapHtml)(v); +} +exports.setOuterHtml = setOuterHtml; +/** + * Set `ElementCSSInlineStyle.cssText` for the given `ElementCSSInlineStyle`. + */ +function setCssText(e, v) { + e.style.cssText = (0, style_impl_1.unwrapStyle)(v); +} +exports.setCssText = setCssText; +/** + * Safely call {@link Element.insertAdjacentHTML} for the given Element. + */ +function insertAdjacentHtml(element, position, v) { + var tagContext = (position === 'beforebegin' || position === 'afterend') ? + element.parentElement : + element; + if (tagContext !== null) { + throwIfScriptOrStyle(tagContext); + } + element.insertAdjacentHTML(position, (0, html_impl_1.unwrapHtml)(v)); +} +exports.insertAdjacentHtml = insertAdjacentHtml; +/** + * Given a set of known-to-be-safe prefixes (e.g., "data-", "aria-", "js"), + * return a setter function that allows you to set attributes on an element, + * as long as the names of the attributes to be set has one of the prefixes. + * + * The returned setter ensures that setting any dangerous attribute, e.g., + * "src", "href" will cause an exception. This is intended to be used as the + * safe alterantive of `Element#setAttribute`, when applications need to set + * attributes that do not have security implications and do not have a + * corresponding DOM property. + */ +function buildPrefixedAttributeSetter(prefix) { + var otherPrefixes = []; + for (var _i = 1; _i < arguments.length; _i++) { + otherPrefixes[_i - 1] = arguments[_i]; + } + var prefixes = __spreadArray([prefix], __read(otherPrefixes), false); + return function (e, attr, value) { + setPrefixedAttribute(prefixes, e, attr, value); + }; +} +exports.buildPrefixedAttributeSetter = buildPrefixedAttributeSetter; +/** + * The safe alternative to Element#setAttribute. The function takes a list of + * `SafeAttributePrefix`, making developer intention explicit. The attribute + * to be set must has one of the safe prefixes, otherwise the function throws + * an Error. + */ +function setPrefixedAttribute(attrPrefixes, e, attr, value) { + if (attrPrefixes.length === 0) { + var message = ''; + if (process.env.NODE_ENV !== 'production') { + message = 'No prefixes are provided'; + } + throw new Error(message); + } + var prefixes = attrPrefixes.map(function (s) { return (0, attribute_impl_1.unwrapAttributePrefix)(s); }); + var attrLower = attr.toLowerCase(); + if (prefixes.every(function (p) { return attrLower.indexOf(p) !== 0; })) { + throw new Error("Attribute \"".concat(attr, "\" does not match any of the allowed prefixes.")); + } + e.setAttribute(attr, value); +} +exports.setPrefixedAttribute = setPrefixedAttribute; +function throwIfScriptOrStyle(element) { + var message = ''; + if (element.tagName.toLowerCase() === 'script') { + if (process.env.NODE_ENV !== 'production') { + message = 'Use safeScriptEl.setTextContent with a SafeScript.'; + } + throw new Error(message); + } + else if (element.tagName.toLowerCase() === 'style') { + if (process.env.NODE_ENV !== 'production') { + message = 'Use safeStyleEl.setTextContent with a SafeStyleSheet.'; + } + throw new Error(message); + } +} +function isElement(elOrRoot) { + return elOrRoot.tagName !== undefined; +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/element.mjs b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/element.mjs new file mode 100644 index 0000000..83563993 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/element.mjs
@@ -0,0 +1,107 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +/** + * @fileoverview This contains safe wrappers for properties that aren't specific + * to one kind of HTMLElement (like innerHTML), plus other setters and functions + * that are not tied to elements (like location.href or Worker constructor). + */ +import '../../environment/dev'; +import { unwrapAttributePrefix } from '../../internals/attribute_impl'; +import { unwrapHtml } from '../../internals/html_impl'; +import { unwrapStyle } from '../../internals/style_impl'; +/** + * Safely set {@link Element.innerHTML} on a given ShadowRoot or Element which + * may not be a `<script>` element or a `<style>` element. + */ +export function setInnerHtml(elOrRoot, v) { + if (isElement(elOrRoot)) { + throwIfScriptOrStyle(elOrRoot); + } + elOrRoot.innerHTML = unwrapHtml(v); +} +/** + * Safely set {@link Element.outerHTML} for the given Element. + */ +export function setOuterHtml(e, v) { + const parent = e.parentElement; + if (parent !== null) { + throwIfScriptOrStyle(parent); + } + e.outerHTML = unwrapHtml(v); +} +/** + * Set `ElementCSSInlineStyle.cssText` for the given `ElementCSSInlineStyle`. + */ +export function setCssText(e, v) { + e.style.cssText = unwrapStyle(v); +} +/** + * Safely call {@link Element.insertAdjacentHTML} for the given Element. + */ +export function insertAdjacentHtml(element, position, v) { + const tagContext = (position === 'beforebegin' || position === 'afterend') ? + element.parentElement : + element; + if (tagContext !== null) { + throwIfScriptOrStyle(tagContext); + } + element.insertAdjacentHTML(position, unwrapHtml(v)); +} +/** + * Given a set of known-to-be-safe prefixes (e.g., "data-", "aria-", "js"), + * return a setter function that allows you to set attributes on an element, + * as long as the names of the attributes to be set has one of the prefixes. + * + * The returned setter ensures that setting any dangerous attribute, e.g., + * "src", "href" will cause an exception. This is intended to be used as the + * safe alterantive of `Element#setAttribute`, when applications need to set + * attributes that do not have security implications and do not have a + * corresponding DOM property. + */ +export function buildPrefixedAttributeSetter(prefix, ...otherPrefixes) { + const prefixes = [prefix, ...otherPrefixes]; + return (e, attr, value) => { + setPrefixedAttribute(prefixes, e, attr, value); + }; +} +/** + * The safe alternative to Element#setAttribute. The function takes a list of + * `SafeAttributePrefix`, making developer intention explicit. The attribute + * to be set must has one of the safe prefixes, otherwise the function throws + * an Error. + */ +export function setPrefixedAttribute(attrPrefixes, e, attr, value) { + if (attrPrefixes.length === 0) { + let message = ''; + if (process.env.NODE_ENV !== 'production') { + message = 'No prefixes are provided'; + } + throw new Error(message); + } + const prefixes = attrPrefixes.map(s => unwrapAttributePrefix(s)); + const attrLower = attr.toLowerCase(); + if (prefixes.every(p => attrLower.indexOf(p) !== 0)) { + throw new Error(`Attribute "${attr}" does not match any of the allowed prefixes.`); + } + e.setAttribute(attr, value); +} +function throwIfScriptOrStyle(element) { + let message = ''; + if (element.tagName.toLowerCase() === 'script') { + if (process.env.NODE_ENV !== 'production') { + message = 'Use safeScriptEl.setTextContent with a SafeScript.'; + } + throw new Error(message); + } + else if (element.tagName.toLowerCase() === 'style') { + if (process.env.NODE_ENV !== 'production') { + message = 'Use safeStyleEl.setTextContent with a SafeStyleSheet.'; + } + throw new Error(message); + } +} +function isElement(elOrRoot) { + return elOrRoot.tagName !== undefined; +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/embed.d.ts b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/embed.d.ts new file mode 100644 index 0000000..7a307c3 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/embed.d.ts
@@ -0,0 +1,9 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import { TrustedResourceUrl } from '../../internals/resource_url_impl'; +/** + * Sets the Src attribute from the given SafeUrl. + */ +export declare function setSrc(embedEl: HTMLEmbedElement, url: TrustedResourceUrl): void;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/embed.js b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/embed.js new file mode 100644 index 0000000..200a6808 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/embed.js
@@ -0,0 +1,15 @@ +"use strict"; +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.setSrc = void 0; +var resource_url_impl_1 = require("../../internals/resource_url_impl"); +/** + * Sets the Src attribute from the given SafeUrl. + */ +function setSrc(embedEl, url) { + embedEl.src = (0, resource_url_impl_1.unwrapResourceUrl)(url); +} +exports.setSrc = setSrc;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/embed.mjs b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/embed.mjs new file mode 100644 index 0000000..dca908a --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/embed.mjs
@@ -0,0 +1,11 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import { unwrapResourceUrl } from '../../internals/resource_url_impl'; +/** + * Sets the Src attribute from the given SafeUrl. + */ +export function setSrc(embedEl, url) { + embedEl.src = unwrapResourceUrl(url); +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/form.d.ts b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/form.d.ts new file mode 100644 index 0000000..b5ff8cf --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/form.d.ts
@@ -0,0 +1,9 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import { Url } from '../../builders/url_sanitizer'; +/** + * Sets the Action attribute from the given Url. + */ +export declare function setAction(form: HTMLFormElement, url: Url): void;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/form.js b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/form.js new file mode 100644 index 0000000..8389f419 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/form.js
@@ -0,0 +1,18 @@ +"use strict"; +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.setAction = void 0; +var url_sanitizer_1 = require("../../builders/url_sanitizer"); +/** + * Sets the Action attribute from the given Url. + */ +function setAction(form, url) { + var sanitizedUrl = (0, url_sanitizer_1.unwrapUrlOrSanitize)(url); + if (sanitizedUrl !== undefined) { + form.action = sanitizedUrl; + } +} +exports.setAction = setAction;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/form.mjs b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/form.mjs new file mode 100644 index 0000000..ce13c1bc --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/form.mjs
@@ -0,0 +1,14 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import { unwrapUrlOrSanitize } from '../../builders/url_sanitizer'; +/** + * Sets the Action attribute from the given Url. + */ +export function setAction(form, url) { + const sanitizedUrl = unwrapUrlOrSanitize(url); + if (sanitizedUrl !== undefined) { + form.action = sanitizedUrl; + } +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/iframe.d.ts b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/iframe.d.ts new file mode 100644 index 0000000..aec1564 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/iframe.d.ts
@@ -0,0 +1,13 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +/** + * @fileoverview Safe iframe helpers and go/intents-for-iframes-for-closure + */ +import { SafeHtml } from '../../internals/html_impl'; +import { TrustedResourceUrl } from '../../internals/resource_url_impl'; +/** Sets the Src attribute using a TrustedResourceUrl */ +export declare function setSrc(iframe: HTMLIFrameElement, v: TrustedResourceUrl): void; +/** Sets the Srcdoc attribute using a SafeHtml */ +export declare function setSrcdoc(iframe: HTMLIFrameElement, v: SafeHtml): void;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/iframe.js b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/iframe.js new file mode 100644 index 0000000..d81f5e4 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/iframe.js
@@ -0,0 +1,22 @@ +"use strict"; +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.setSrcdoc = exports.setSrc = void 0; +/** + * @fileoverview Safe iframe helpers and go/intents-for-iframes-for-closure + */ +var html_impl_1 = require("../../internals/html_impl"); +var resource_url_impl_1 = require("../../internals/resource_url_impl"); +/** Sets the Src attribute using a TrustedResourceUrl */ +function setSrc(iframe, v) { + iframe.src = (0, resource_url_impl_1.unwrapResourceUrl)(v).toString(); +} +exports.setSrc = setSrc; +/** Sets the Srcdoc attribute using a SafeHtml */ +function setSrcdoc(iframe, v) { + iframe.srcdoc = (0, html_impl_1.unwrapHtml)(v); +} +exports.setSrcdoc = setSrcdoc;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/iframe.mjs b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/iframe.mjs new file mode 100644 index 0000000..0df892b6 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/iframe.mjs
@@ -0,0 +1,17 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +/** + * @fileoverview Safe iframe helpers and go/intents-for-iframes-for-closure + */ +import { unwrapHtml } from '../../internals/html_impl'; +import { unwrapResourceUrl } from '../../internals/resource_url_impl'; +/** Sets the Src attribute using a TrustedResourceUrl */ +export function setSrc(iframe, v) { + iframe.src = unwrapResourceUrl(v).toString(); +} +/** Sets the Srcdoc attribute using a SafeHtml */ +export function setSrcdoc(iframe, v) { + iframe.srcdoc = unwrapHtml(v); +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/input.d.ts b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/input.d.ts new file mode 100644 index 0000000..4946af70 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/input.d.ts
@@ -0,0 +1,9 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import { Url } from '../../builders/url_sanitizer'; +/** + * Sets the Formaction attribute from the given Url. + */ +export declare function setFormaction(input: HTMLInputElement, url: Url): void;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/input.js b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/input.js new file mode 100644 index 0000000..f86befc6 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/input.js
@@ -0,0 +1,18 @@ +"use strict"; +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.setFormaction = void 0; +var url_sanitizer_1 = require("../../builders/url_sanitizer"); +/** + * Sets the Formaction attribute from the given Url. + */ +function setFormaction(input, url) { + var sanitizedUrl = (0, url_sanitizer_1.unwrapUrlOrSanitize)(url); + if (sanitizedUrl !== undefined) { + input.formAction = sanitizedUrl; + } +} +exports.setFormaction = setFormaction;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/input.mjs b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/input.mjs new file mode 100644 index 0000000..bfcb3b47 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/input.mjs
@@ -0,0 +1,14 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import { unwrapUrlOrSanitize } from '../../builders/url_sanitizer'; +/** + * Sets the Formaction attribute from the given Url. + */ +export function setFormaction(input, url) { + const sanitizedUrl = unwrapUrlOrSanitize(url); + if (sanitizedUrl !== undefined) { + input.formAction = sanitizedUrl; + } +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/link.d.ts b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/link.d.ts new file mode 100644 index 0000000..4a382fa --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/link.d.ts
@@ -0,0 +1,34 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import { Url } from '../../builders/url_sanitizer'; +import { TrustedResourceUrl } from '../../internals/resource_url_impl'; +declare const SAFE_URL_REL_VALUES: readonly ["alternate", "author", "bookmark", "canonical", "cite", "help", "icon", "license", "next", "prefetch", "dns-prefetch", "prerender", "preconnect", "preload", "prev", "search", "subresource"]; +/** + * Values of the "rel" attribute when "href" should accept `SafeUrl` instead of + * `TrustedResourceUrl`. + */ +export declare type SafeUrlRelTypes = typeof SAFE_URL_REL_VALUES[number]; +/** + * Values of the "rel" attribute when "href" should accept a + * `TrustedResourceUrl`. Note that this list is not exhaustive and is here just + * for better documentation, any unknown "rel" values will also require passing + * a `TrustedResourceUrl` "href". + */ +export declare type TrustedResourecUrlRelTypes = 'stylesheet' | 'manifest'; +/** + * Safely sets a link element's "href" property using a sensitive "rel" value. + */ +export declare function setHrefAndRel(link: HTMLLinkElement, url: TrustedResourceUrl, rel: TrustedResourecUrlRelTypes): void; +/** + * Safely sets a link element's "href" property using a non-sensitive "rel" + * value. + */ +export declare function setHrefAndRel(link: HTMLLinkElement, url: Url, rel: SafeUrlRelTypes): void; +/** + * Safely sets a link element's "href" property using an arbitrary "rel" + * value. + */ +export declare function setHrefAndRel(link: HTMLLinkElement, url: TrustedResourceUrl, rel: string): void; +export {};
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/link.js b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/link.js new file mode 100644 index 0000000..c1c160d7 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/link.js
@@ -0,0 +1,45 @@ +"use strict"; +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.setHrefAndRel = void 0; +var url_sanitizer_1 = require("../../builders/url_sanitizer"); +var resource_url_impl_1 = require("../../internals/resource_url_impl"); +var SAFE_URL_REL_VALUES = [ + 'alternate', + 'author', + 'bookmark', + 'canonical', + 'cite', + 'help', + 'icon', + 'license', + 'next', + 'prefetch', + 'dns-prefetch', + 'prerender', + 'preconnect', + 'preload', + 'prev', + 'search', + 'subresource', +]; +function setHrefAndRel(link, url, rel) { + if ((0, resource_url_impl_1.isResourceUrl)(url)) { + link.href = (0, resource_url_impl_1.unwrapResourceUrl)(url).toString(); + } + else { + if (SAFE_URL_REL_VALUES.indexOf(rel) === -1) { + throw new Error("TrustedResourceUrl href attribute required with rel=\"".concat(rel, "\"")); + } + var sanitizedUrl = (0, url_sanitizer_1.unwrapUrlOrSanitize)(url); + if (sanitizedUrl === undefined) { + return; + } + link.href = sanitizedUrl; + } + link.rel = rel; +} +exports.setHrefAndRel = setHrefAndRel;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/link.mjs b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/link.mjs new file mode 100644 index 0000000..d0842aa5 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/link.mjs
@@ -0,0 +1,41 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import { unwrapUrlOrSanitize } from '../../builders/url_sanitizer'; +import { isResourceUrl, unwrapResourceUrl } from '../../internals/resource_url_impl'; +const SAFE_URL_REL_VALUES = [ + 'alternate', + 'author', + 'bookmark', + 'canonical', + 'cite', + 'help', + 'icon', + 'license', + 'next', + 'prefetch', + 'dns-prefetch', + 'prerender', + 'preconnect', + 'preload', + 'prev', + 'search', + 'subresource', +]; +export function setHrefAndRel(link, url, rel) { + if (isResourceUrl(url)) { + link.href = unwrapResourceUrl(url).toString(); + } + else { + if (SAFE_URL_REL_VALUES.indexOf(rel) === -1) { + throw new Error(`TrustedResourceUrl href attribute required with rel="${rel}"`); + } + const sanitizedUrl = unwrapUrlOrSanitize(url); + if (sanitizedUrl === undefined) { + return; + } + link.href = sanitizedUrl; + } + link.rel = rel; +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/object.d.ts b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/object.d.ts new file mode 100644 index 0000000..f442189 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/object.d.ts
@@ -0,0 +1,7 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import { TrustedResourceUrl } from '../../internals/resource_url_impl'; +/** Sets the data attribute using a TrustedResourceUrl */ +export declare function setData(obj: HTMLObjectElement, v: TrustedResourceUrl): void;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/object.js b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/object.js new file mode 100644 index 0000000..cd452979e --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/object.js
@@ -0,0 +1,13 @@ +"use strict"; +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.setData = void 0; +var resource_url_impl_1 = require("../../internals/resource_url_impl"); +/** Sets the data attribute using a TrustedResourceUrl */ +function setData(obj, v) { + obj.data = (0, resource_url_impl_1.unwrapResourceUrl)(v); +} +exports.setData = setData;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/object.mjs b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/object.mjs new file mode 100644 index 0000000..e737338b --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/object.mjs
@@ -0,0 +1,9 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import { unwrapResourceUrl } from '../../internals/resource_url_impl'; +/** Sets the data attribute using a TrustedResourceUrl */ +export function setData(obj, v) { + obj.data = unwrapResourceUrl(v); +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/script.d.ts b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/script.d.ts new file mode 100644 index 0000000..95a24e92 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/script.d.ts
@@ -0,0 +1,10 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import { TrustedResourceUrl } from '../../internals/resource_url_impl'; +import { SafeScript } from '../../internals/script_impl'; +/** Sets textContent from the given SafeScript. */ +export declare function setTextContent(script: HTMLScriptElement, v: SafeScript): void; +/** Sets the Src attribute using a TrustedResourceUrl */ +export declare function setSrc(script: HTMLScriptElement, v: TrustedResourceUrl): void;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/script.js b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/script.js new file mode 100644 index 0000000..3d179a85 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/script.js
@@ -0,0 +1,44 @@ +"use strict"; +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.setSrc = exports.setTextContent = void 0; +var resource_url_impl_1 = require("../../internals/resource_url_impl"); +var script_impl_1 = require("../../internals/script_impl"); +/** Returns CSP nonce, if set for any script tag. */ +function getScriptNonceFromWindow(win) { + var _a; + var doc = win.document; + // document.querySelector can be undefined in non-browser environments. + var script = (_a = doc.querySelector) === null || _a === void 0 ? void 0 : _a.call(doc, 'script[nonce]'); + if (script) { + // Try to get the nonce from the IDL property first, because browsers that + // implement additional nonce protection features (currently only Chrome) to + // prevent nonce stealing via CSS do not expose the nonce via attributes. + // See https://github.com/whatwg/html/issues/2369 + return script['nonce'] || script.getAttribute('nonce') || ''; + } + return ''; +} +/** Propagates CSP nonce to dynamically created scripts. */ +function setNonceForScriptElement(script) { + var win = script.ownerDocument && script.ownerDocument.defaultView; + var nonce = getScriptNonceFromWindow(win || window); + if (nonce) { + script.setAttribute('nonce', nonce); + } +} +/** Sets textContent from the given SafeScript. */ +function setTextContent(script, v) { + script.textContent = (0, script_impl_1.unwrapScript)(v); + setNonceForScriptElement(script); +} +exports.setTextContent = setTextContent; +/** Sets the Src attribute using a TrustedResourceUrl */ +function setSrc(script, v) { + script.src = (0, resource_url_impl_1.unwrapResourceUrl)(v); + setNonceForScriptElement(script); +} +exports.setSrc = setSrc;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/script.mjs b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/script.mjs new file mode 100644 index 0000000..62209a3 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/script.mjs
@@ -0,0 +1,38 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import { unwrapResourceUrl } from '../../internals/resource_url_impl'; +import { unwrapScript } from '../../internals/script_impl'; +/** Returns CSP nonce, if set for any script tag. */ +function getScriptNonceFromWindow(win) { + const doc = win.document; + // document.querySelector can be undefined in non-browser environments. + const script = doc.querySelector?.('script[nonce]'); + if (script) { + // Try to get the nonce from the IDL property first, because browsers that + // implement additional nonce protection features (currently only Chrome) to + // prevent nonce stealing via CSS do not expose the nonce via attributes. + // See https://github.com/whatwg/html/issues/2369 + return script['nonce'] || script.getAttribute('nonce') || ''; + } + return ''; +} +/** Propagates CSP nonce to dynamically created scripts. */ +function setNonceForScriptElement(script) { + const win = script.ownerDocument && script.ownerDocument.defaultView; + const nonce = getScriptNonceFromWindow(win || window); + if (nonce) { + script.setAttribute('nonce', nonce); + } +} +/** Sets textContent from the given SafeScript. */ +export function setTextContent(script, v) { + script.textContent = unwrapScript(v); + setNonceForScriptElement(script); +} +/** Sets the Src attribute using a TrustedResourceUrl */ +export function setSrc(script, v) { + script.src = unwrapResourceUrl(v); + setNonceForScriptElement(script); +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/style.d.ts b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/style.d.ts new file mode 100644 index 0000000..1ffd028a07 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/style.d.ts
@@ -0,0 +1,7 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import { SafeStyleSheet } from '../../internals/style_sheet_impl'; +/** Safe setters for `HTMLStyleElement`s. */ +export declare function setTextContent(elem: HTMLStyleElement, safeStyleSheet: SafeStyleSheet): void;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/style.js b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/style.js new file mode 100644 index 0000000..9ef9772 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/style.js
@@ -0,0 +1,13 @@ +"use strict"; +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.setTextContent = void 0; +var style_sheet_impl_1 = require("../../internals/style_sheet_impl"); +/** Safe setters for `HTMLStyleElement`s. */ +function setTextContent(elem, safeStyleSheet) { + elem.textContent = (0, style_sheet_impl_1.unwrapStyleSheet)(safeStyleSheet); +} +exports.setTextContent = setTextContent;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/style.mjs b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/style.mjs new file mode 100644 index 0000000..d025f6c --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/style.mjs
@@ -0,0 +1,9 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import { unwrapStyleSheet } from '../../internals/style_sheet_impl'; +/** Safe setters for `HTMLStyleElement`s. */ +export function setTextContent(elem, safeStyleSheet) { + elem.textContent = unwrapStyleSheet(safeStyleSheet); +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/svg_use.d.ts b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/svg_use.d.ts new file mode 100644 index 0000000..7a4070d --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/svg_use.d.ts
@@ -0,0 +1,11 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import '../../environment/dev'; +/** + * Sets the Href attribute from the given URL. + * javascript: and data: URL are blocked as they can lead to XSS and the <use> + * element only loads resources same-origin. + */ +export declare function setHref(useEl: SVGUseElement, url: string): void;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/svg_use.js b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/svg_use.js new file mode 100644 index 0000000..398983e --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/svg_use.js
@@ -0,0 +1,27 @@ +"use strict"; +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.setHref = void 0; +require("../../environment/dev"); +var url_sanitizer_1 = require("../../builders/url_sanitizer"); +/** + * Sets the Href attribute from the given URL. + * javascript: and data: URL are blocked as they can lead to XSS and the <use> + * element only loads resources same-origin. + */ +function setHref(useEl, url) { + var scheme = (0, url_sanitizer_1.extractScheme)(url); + if (scheme === 'javascript:' || scheme === 'data:') { + if (process.env.NODE_ENV !== 'production') { + var msg = "A URL with content '".concat(url, "' was sanitized away."); + console.error(msg); + } + return; + } + // Note that the href property is read-only, so setAttribute must be used. + useEl.setAttribute('href', url); +} +exports.setHref = setHref;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/svg_use.mjs b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/svg_use.mjs new file mode 100644 index 0000000..38cc983 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/elements/svg_use.mjs
@@ -0,0 +1,23 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import '../../environment/dev'; +import { extractScheme } from '../../builders/url_sanitizer'; +/** + * Sets the Href attribute from the given URL. + * javascript: and data: URL are blocked as they can lead to XSS and the <use> + * element only loads resources same-origin. + */ +export function setHref(useEl, url) { + const scheme = extractScheme(url); + if (scheme === 'javascript:' || scheme === 'data:') { + if (process.env.NODE_ENV !== 'production') { + const msg = `A URL with content '${url}' was sanitized away.`; + console.error(msg); + } + return; + } + // Note that the href property is read-only, so setAttribute must be used. + useEl.setAttribute('href', url); +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/document.d.ts b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/document.d.ts new file mode 100644 index 0000000..d4571ad --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/document.d.ts
@@ -0,0 +1,22 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import { SafeHtml } from '../../internals/html_impl'; +/** + * write safely calls {@link Document.write} on the given {@link Document} with + * the given {@link SafeHtml}. + */ +export declare function write(doc: Document, text: SafeHtml): void; +declare type ValueType<Cmd extends string> = Lowercase<Cmd> extends 'inserthtml' ? SafeHtml : SafeHtml | string; +/** + * Safely calls {@link Document.execCommand}. When command is insertHtml, a + * SafeHtml must be passed in as value. + */ +export declare function execCommand<Cmd extends string>(doc: Document, command: Cmd, value?: ValueType<Cmd>): boolean; +/** + * Safely calls {@link Document.execCommand}('insertHtml'). + * @deprecated Use safeDocument.execCommand. + */ +export declare function execCommandInsertHtml(doc: Document, html: SafeHtml): boolean; +export {};
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/document.js b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/document.js new file mode 100644 index 0000000..2074895 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/document.js
@@ -0,0 +1,37 @@ +"use strict"; +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.execCommandInsertHtml = exports.execCommand = exports.write = void 0; +var html_impl_1 = require("../../internals/html_impl"); +/** + * write safely calls {@link Document.write} on the given {@link Document} with + * the given {@link SafeHtml}. + */ +function write(doc, text) { + doc.write((0, html_impl_1.unwrapHtml)(text)); +} +exports.write = write; +/** + * Safely calls {@link Document.execCommand}. When command is insertHtml, a + * SafeHtml must be passed in as value. + */ +function execCommand(doc, command, value) { + var commandString = String(command); + var valueArgument = value; + if (commandString.toLowerCase() === 'inserthtml') { + valueArgument = (0, html_impl_1.unwrapHtml)(value); + } + return doc.execCommand(commandString, /* showUi= */ false, valueArgument); +} +exports.execCommand = execCommand; +/** + * Safely calls {@link Document.execCommand}('insertHtml'). + * @deprecated Use safeDocument.execCommand. + */ +function execCommandInsertHtml(doc, html) { + return doc.execCommand('insertHTML', /* showUi= */ false, (0, html_impl_1.unwrapHtml)(html)); +} +exports.execCommandInsertHtml = execCommandInsertHtml;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/document.mjs b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/document.mjs new file mode 100644 index 0000000..c11ea700 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/document.mjs
@@ -0,0 +1,31 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import { unwrapHtml } from '../../internals/html_impl'; +/** + * write safely calls {@link Document.write} on the given {@link Document} with + * the given {@link SafeHtml}. + */ +export function write(doc, text) { + doc.write(unwrapHtml(text)); +} +/** + * Safely calls {@link Document.execCommand}. When command is insertHtml, a + * SafeHtml must be passed in as value. + */ +export function execCommand(doc, command, value) { + const commandString = String(command); + let valueArgument = value; + if (commandString.toLowerCase() === 'inserthtml') { + valueArgument = unwrapHtml(value); + } + return doc.execCommand(commandString, /* showUi= */ false, valueArgument); +} +/** + * Safely calls {@link Document.execCommand}('insertHtml'). + * @deprecated Use safeDocument.execCommand. + */ +export function execCommandInsertHtml(doc, html) { + return doc.execCommand('insertHTML', /* showUi= */ false, unwrapHtml(html)); +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/dom_parser.d.ts b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/dom_parser.d.ts new file mode 100644 index 0000000..78049927 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/dom_parser.d.ts
@@ -0,0 +1,16 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import '../../environment/dev'; +import { SafeHtml } from '../../internals/html_impl'; +/** Safely parses a string using the HTML parser. */ +export declare function parseHtml(parser: DOMParser, html: SafeHtml): HTMLDocument; +/** + * Safely parses a string using the XML parser. If the XML document is found to + * contain any elements from the HTML or SVG namespaces, an error is thrown for + * security reasons. + */ +export declare function parseXml(parser: DOMParser, xml: string): XMLDocument; +/** Safely parses a string using the HTML or XML parser. */ +export declare function parseFromString(parser: DOMParser, content: SafeHtml, contentType: DOMParserSupportedType): Document;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/dom_parser.js b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/dom_parser.js new file mode 100644 index 0000000..39afcfb --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/dom_parser.js
@@ -0,0 +1,44 @@ +"use strict"; +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.parseFromString = exports.parseXml = exports.parseHtml = void 0; +require("../../environment/dev"); +var html_impl_1 = require("../../internals/html_impl"); +/** Safely parses a string using the HTML parser. */ +function parseHtml(parser, html) { + return parseFromString(parser, html, 'text/html'); +} +exports.parseHtml = parseHtml; +/** + * Safely parses a string using the XML parser. If the XML document is found to + * contain any elements from the HTML or SVG namespaces, an error is thrown for + * security reasons. + */ +function parseXml(parser, xml) { + var doc = parseFromString(parser, (0, html_impl_1.createHtml)(xml), 'text/xml'); + var iterator = document.createNodeIterator(doc, NodeFilter.SHOW_ALL, null, + // @ts-ignore: error TS2554: Expected 1-3 arguments, but got 4. + false); + var currentNode; + while ((currentNode = iterator.nextNode())) { + if (currentNode instanceof HTMLElement || + currentNode instanceof SVGElement) { + var message = 'unsafe XML'; + if (process.env.NODE_ENV !== 'production') { + message = + "attempted to parse an XML document that embeds HTML or SVG content"; + } + throw new Error(message); + } + } + return doc; +} +exports.parseXml = parseXml; +/** Safely parses a string using the HTML or XML parser. */ +function parseFromString(parser, content, contentType) { + return parser.parseFromString((0, html_impl_1.unwrapHtml)(content), contentType); +} +exports.parseFromString = parseFromString;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/dom_parser.mjs b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/dom_parser.mjs new file mode 100644 index 0000000..b7d1777 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/dom_parser.mjs
@@ -0,0 +1,38 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import '../../environment/dev'; +import { createHtml, unwrapHtml } from '../../internals/html_impl'; +/** Safely parses a string using the HTML parser. */ +export function parseHtml(parser, html) { + return parseFromString(parser, html, 'text/html'); +} +/** + * Safely parses a string using the XML parser. If the XML document is found to + * contain any elements from the HTML or SVG namespaces, an error is thrown for + * security reasons. + */ +export function parseXml(parser, xml) { + const doc = parseFromString(parser, createHtml(xml), 'text/xml'); + const iterator = document.createNodeIterator(doc, NodeFilter.SHOW_ALL, null, + // @ts-ignore: error TS2554: Expected 1-3 arguments, but got 4. + false); + let currentNode; + while ((currentNode = iterator.nextNode())) { + if (currentNode instanceof HTMLElement || + currentNode instanceof SVGElement) { + let message = 'unsafe XML'; + if (process.env.NODE_ENV !== 'production') { + message = + `attempted to parse an XML document that embeds HTML or SVG content`; + } + throw new Error(message); + } + } + return doc; +} +/** Safely parses a string using the HTML or XML parser. */ +export function parseFromString(parser, content, contentType) { + return parser.parseFromString(unwrapHtml(content), contentType); +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/global.d.ts b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/global.d.ts new file mode 100644 index 0000000..49d8fce --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/global.d.ts
@@ -0,0 +1,12 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import { SafeScript } from '../../internals/script_impl'; +/** + * Evaluates a SafeScript value in the given scope using eval. + * + * Strongly consider avoiding this, as eval blocks CSP adoption and does not + * benefit from compiler optimizations. + */ +export declare function globalEval(win: Window | typeof globalThis, script: SafeScript): unknown;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/global.js b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/global.js new file mode 100644 index 0000000..3b75de7 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/global.js
@@ -0,0 +1,24 @@ +"use strict"; +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.globalEval = void 0; +var script_impl_1 = require("../../internals/script_impl"); +/** + * Evaluates a SafeScript value in the given scope using eval. + * + * Strongly consider avoiding this, as eval blocks CSP adoption and does not + * benefit from compiler optimizations. + */ +function globalEval(win, script) { + var trustedScript = (0, script_impl_1.unwrapScript)(script); + var result = win.eval(trustedScript); + if (result === trustedScript) { + // https://crbug.com/1024786 manifesting in workers. + result = win.eval(trustedScript.toString()); + } + return result; +} +exports.globalEval = globalEval;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/global.mjs b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/global.mjs new file mode 100644 index 0000000..5562364 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/global.mjs
@@ -0,0 +1,20 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import { unwrapScript } from '../../internals/script_impl'; +/** + * Evaluates a SafeScript value in the given scope using eval. + * + * Strongly consider avoiding this, as eval blocks CSP adoption and does not + * benefit from compiler optimizations. + */ +export function globalEval(win, script) { + const trustedScript = unwrapScript(script); + let result = win.eval(trustedScript); + if (result === trustedScript) { + // https://crbug.com/1024786 manifesting in workers. + result = win.eval(trustedScript.toString()); + } + return result; +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/location.d.ts b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/location.d.ts new file mode 100644 index 0000000..3473bab --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/location.d.ts
@@ -0,0 +1,20 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import { Url } from '../../builders/url_sanitizer'; +/** + * setHref safely sets {@link Location.href} on the given {@link Location} with + * given {@link Url}. + */ +export declare function setHref(loc: Location, url: Url): void; +/** + * replace safely calls {@link Location.replace} on the given {@link Location} + * with given {@link Url}. + */ +export declare function replace(loc: Location, url: Url): void; +/** + * assign safely calls {@link Location.assign} on the given {@link Location} + * with given {@link Url}. + */ +export declare function assign(loc: Location, url: Url): void;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/location.js b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/location.js new file mode 100644 index 0000000..09db868 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/location.js
@@ -0,0 +1,41 @@ +"use strict"; +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.assign = exports.replace = exports.setHref = void 0; +var url_sanitizer_1 = require("../../builders/url_sanitizer"); +/** + * setHref safely sets {@link Location.href} on the given {@link Location} with + * given {@link Url}. + */ +function setHref(loc, url) { + var sanitizedUrl = (0, url_sanitizer_1.unwrapUrlOrSanitize)(url); + if (sanitizedUrl !== undefined) { + loc.href = sanitizedUrl; + } +} +exports.setHref = setHref; +/** + * replace safely calls {@link Location.replace} on the given {@link Location} + * with given {@link Url}. + */ +function replace(loc, url) { + var sanitizedUrl = (0, url_sanitizer_1.unwrapUrlOrSanitize)(url); + if (sanitizedUrl !== undefined) { + loc.replace(sanitizedUrl); + } +} +exports.replace = replace; +/** + * assign safely calls {@link Location.assign} on the given {@link Location} + * with given {@link Url}. + */ +function assign(loc, url) { + var sanitizedUrl = (0, url_sanitizer_1.unwrapUrlOrSanitize)(url); + if (sanitizedUrl !== undefined) { + loc.assign(sanitizedUrl); + } +} +exports.assign = assign;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/location.mjs b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/location.mjs new file mode 100644 index 0000000..00047a9c --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/location.mjs
@@ -0,0 +1,35 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import { unwrapUrlOrSanitize } from '../../builders/url_sanitizer'; +/** + * setHref safely sets {@link Location.href} on the given {@link Location} with + * given {@link Url}. + */ +export function setHref(loc, url) { + const sanitizedUrl = unwrapUrlOrSanitize(url); + if (sanitizedUrl !== undefined) { + loc.href = sanitizedUrl; + } +} +/** + * replace safely calls {@link Location.replace} on the given {@link Location} + * with given {@link Url}. + */ +export function replace(loc, url) { + const sanitizedUrl = unwrapUrlOrSanitize(url); + if (sanitizedUrl !== undefined) { + loc.replace(sanitizedUrl); + } +} +/** + * assign safely calls {@link Location.assign} on the given {@link Location} + * with given {@link Url}. + */ +export function assign(loc, url) { + const sanitizedUrl = unwrapUrlOrSanitize(url); + if (sanitizedUrl !== undefined) { + loc.assign(sanitizedUrl); + } +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/range.d.ts b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/range.d.ts new file mode 100644 index 0000000..171a394 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/range.d.ts
@@ -0,0 +1,7 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import { SafeHtml } from '../../internals/html_impl'; +/** Safely creates a contextualFragment. */ +export declare function createContextualFragment(range: Range, html: SafeHtml): DocumentFragment;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/range.js b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/range.js new file mode 100644 index 0000000..54003a9 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/range.js
@@ -0,0 +1,13 @@ +"use strict"; +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.createContextualFragment = void 0; +var html_impl_1 = require("../../internals/html_impl"); +/** Safely creates a contextualFragment. */ +function createContextualFragment(range, html) { + return range.createContextualFragment((0, html_impl_1.unwrapHtml)(html)); +} +exports.createContextualFragment = createContextualFragment;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/range.mjs b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/range.mjs new file mode 100644 index 0000000..102ffa79 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/range.mjs
@@ -0,0 +1,9 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import { unwrapHtml } from '../../internals/html_impl'; +/** Safely creates a contextualFragment. */ +export function createContextualFragment(range, html) { + return range.createContextualFragment(unwrapHtml(html)); +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/service_worker_container.d.ts b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/service_worker_container.d.ts new file mode 100644 index 0000000..24ece790 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/service_worker_container.d.ts
@@ -0,0 +1,7 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import { TrustedResourceUrl } from '../../internals/resource_url_impl'; +/** Safely registers a service worker by URL */ +export declare function register(container: ServiceWorkerContainer, scriptURL: TrustedResourceUrl, options?: RegistrationOptions): Promise<ServiceWorkerRegistration>;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/service_worker_container.js b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/service_worker_container.js new file mode 100644 index 0000000..704a91b --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/service_worker_container.js
@@ -0,0 +1,13 @@ +"use strict"; +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.register = void 0; +var resource_url_impl_1 = require("../../internals/resource_url_impl"); +/** Safely registers a service worker by URL */ +function register(container, scriptURL, options) { + return container.register((0, resource_url_impl_1.unwrapResourceUrl)(scriptURL), options); +} +exports.register = register;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/service_worker_container.mjs b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/service_worker_container.mjs new file mode 100644 index 0000000..b2a9b698 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/service_worker_container.mjs
@@ -0,0 +1,9 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import { unwrapResourceUrl } from '../../internals/resource_url_impl'; +/** Safely registers a service worker by URL */ +export function register(container, scriptURL, options) { + return container.register(unwrapResourceUrl(scriptURL), options); +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/url.d.ts b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/url.d.ts new file mode 100644 index 0000000..5903f99b --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/url.d.ts
@@ -0,0 +1,11 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +/** + * Wraps URL.createObjectURL, checking the safety of the source. For blobs, the + * function validates that the Blob's type is amongst the safe MIME types, and + * throws if that's not the case. URL.revokeObjectURL should be called on the + * returned URL to free the resources. + */ +export declare function objectUrlFromSafeSource(source: Blob | MediaSource): string;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/url.js b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/url.js new file mode 100644 index 0000000..e829b60 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/url.js
@@ -0,0 +1,58 @@ +"use strict"; +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.objectUrlFromSafeSource = void 0; +/** + * A pattern that matches safe MIME types. Only matches image, video and audio + * types, with some parameter support (most notably, we haven't implemented the + * more complex parts like %-encoded characters or non-alphanumerical ones for + * simplicity's sake). Also, the specs are fairly complex, and they don't + * necessarily agree with Chrome on some aspects, and so we settled on a subset + * where the behavior makes sense to all parties involved. + * + * The spec is available at https://mimesniff.spec.whatwg.org/ (and see + * https://tools.ietf.org/html/rfc2397 for data: urls, which override some of + * it). + */ +function isSafeMimeType(mimeType) { + var match = mimeType.match(/^([^;]+)(?:;\w+=(?:\w+|"[\w;,= ]+"))*$/i); + return (match === null || match === void 0 ? void 0 : match.length) === 2 && + (isSafeImageMimeType(match[1]) || isSafeVideoMimeType(match[1]) || + isSafeAudioMimeType(match[1])); +} +function isSafeImageMimeType(mimeType) { + return /^image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp|x-icon|heic|heif)$/i.test(mimeType); +} +function isSafeVideoMimeType(mimeType) { + return /^video\/(?:mpeg|mp4|ogg|webm|x-matroska|quicktime|x-ms-wmv)$/i.test(mimeType); +} +function isSafeAudioMimeType(mimeType) { + return /^audio\/(?:3gpp2|3gpp|aac|L16|midi|mp3|mp4|mpeg|oga|ogg|opus|x-m4a|x-matroska|x-wav|wav|webm)$/i + .test(mimeType); +} +/** + * Wraps URL.createObjectURL, checking the safety of the source. For blobs, the + * function validates that the Blob's type is amongst the safe MIME types, and + * throws if that's not the case. URL.revokeObjectURL should be called on the + * returned URL to free the resources. + */ +function objectUrlFromSafeSource(source) { + // MediaSource support in Safari is limited + // https://developer.mozilla.org/en-US/docs/Web/API/MediaSource#browser_compatibility + if (typeof MediaSource !== 'undefined' && source instanceof MediaSource) { + return URL.createObjectURL(source); + } + var blob = source; + if (!isSafeMimeType(blob.type)) { + var message = ''; + if (process.env.NODE_ENV !== 'production') { + message = "unsafe blob MIME type: ".concat(blob.type); + } + throw new Error(message); + } + return URL.createObjectURL(blob); +} +exports.objectUrlFromSafeSource = objectUrlFromSafeSource;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/url.mjs b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/url.mjs new file mode 100644 index 0000000..53dc2ac --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/url.mjs
@@ -0,0 +1,54 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +/** + * A pattern that matches safe MIME types. Only matches image, video and audio + * types, with some parameter support (most notably, we haven't implemented the + * more complex parts like %-encoded characters or non-alphanumerical ones for + * simplicity's sake). Also, the specs are fairly complex, and they don't + * necessarily agree with Chrome on some aspects, and so we settled on a subset + * where the behavior makes sense to all parties involved. + * + * The spec is available at https://mimesniff.spec.whatwg.org/ (and see + * https://tools.ietf.org/html/rfc2397 for data: urls, which override some of + * it). + */ +function isSafeMimeType(mimeType) { + const match = mimeType.match(/^([^;]+)(?:;\w+=(?:\w+|"[\w;,= ]+"))*$/i); + return match?.length === 2 && + (isSafeImageMimeType(match[1]) || isSafeVideoMimeType(match[1]) || + isSafeAudioMimeType(match[1])); +} +function isSafeImageMimeType(mimeType) { + return /^image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp|x-icon|heic|heif)$/i.test(mimeType); +} +function isSafeVideoMimeType(mimeType) { + return /^video\/(?:mpeg|mp4|ogg|webm|x-matroska|quicktime|x-ms-wmv)$/i.test(mimeType); +} +function isSafeAudioMimeType(mimeType) { + return /^audio\/(?:3gpp2|3gpp|aac|L16|midi|mp3|mp4|mpeg|oga|ogg|opus|x-m4a|x-matroska|x-wav|wav|webm)$/i + .test(mimeType); +} +/** + * Wraps URL.createObjectURL, checking the safety of the source. For blobs, the + * function validates that the Blob's type is amongst the safe MIME types, and + * throws if that's not the case. URL.revokeObjectURL should be called on the + * returned URL to free the resources. + */ +export function objectUrlFromSafeSource(source) { + // MediaSource support in Safari is limited + // https://developer.mozilla.org/en-US/docs/Web/API/MediaSource#browser_compatibility + if (typeof MediaSource !== 'undefined' && source instanceof MediaSource) { + return URL.createObjectURL(source); + } + const blob = source; + if (!isSafeMimeType(blob.type)) { + let message = ''; + if (process.env.NODE_ENV !== 'production') { + message = `unsafe blob MIME type: ${blob.type}`; + } + throw new Error(message); + } + return URL.createObjectURL(blob); +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/window.d.ts b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/window.d.ts new file mode 100644 index 0000000..b46a50c --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/window.d.ts
@@ -0,0 +1,10 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import { Url } from '../../builders/url_sanitizer'; +/** + * open calls {@link Window.open} on the given {@link Window}, given a + * target {@link Url}. + */ +export declare function open(win: Window, url: Url, target?: string, features?: string): Window | null;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/window.js b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/window.js new file mode 100644 index 0000000..f0dda7a --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/window.js
@@ -0,0 +1,20 @@ +"use strict"; +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.open = void 0; +var url_sanitizer_1 = require("../../builders/url_sanitizer"); +/** + * open calls {@link Window.open} on the given {@link Window}, given a + * target {@link Url}. + */ +function open(win, url, target, features) { + var sanitizedUrl = (0, url_sanitizer_1.unwrapUrlOrSanitize)(url); + if (sanitizedUrl !== undefined) { + return win.open(sanitizedUrl, target, features); + } + return null; +} +exports.open = open;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/window.mjs b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/window.mjs new file mode 100644 index 0000000..31f2bec --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/window.mjs
@@ -0,0 +1,16 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import { unwrapUrlOrSanitize } from '../../builders/url_sanitizer'; +/** + * open calls {@link Window.open} on the given {@link Window}, given a + * target {@link Url}. + */ +export function open(win, url, target, features) { + const sanitizedUrl = unwrapUrlOrSanitize(url); + if (sanitizedUrl !== undefined) { + return win.open(sanitizedUrl, target, features); + } + return null; +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/worker.d.ts b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/worker.d.ts new file mode 100644 index 0000000..9059b2f --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/worker.d.ts
@@ -0,0 +1,28 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import { TrustedResourceUrl } from '../../internals/resource_url_impl'; +/** + * ScopeWithImportScripts is an {@link WindowOrWorkerGlobalScope} that also + * has {@link WorkerGlobalScope.importScripts} as {@link WorkerGlobalScope} in + * some cases cannot be depended on directly. + */ +export interface ScopeWithImportScripts extends WindowOrWorkerGlobalScope { + importScripts: (...url: string[]) => void; +} +/** + * Safely creates a Web Worker. + * + * Example usage: + * const trustedResourceUrl = trustedResourceUrl`/safe_script.js`; + * safedom.safeWorker.create(trustedResourceUrl); + * which is a safe alternative to + * new Worker(url); + * The latter can result in loading untrusted code. + */ +export declare function create(url: TrustedResourceUrl, options?: {}): Worker; +/** Safely creates a shared Web Worker. */ +export declare function createShared(url: TrustedResourceUrl, options?: string | WorkerOptions): SharedWorker; +/** Safely calls importScripts */ +export declare function importScripts(scope: ScopeWithImportScripts, ...urls: TrustedResourceUrl[]): void;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/worker.js b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/worker.js new file mode 100644 index 0000000..e3ccbbe --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/worker.js
@@ -0,0 +1,61 @@ +"use strict"; +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +var __read = (this && this.__read) || function (o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; +}; +var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.importScripts = exports.createShared = exports.create = void 0; +var resource_url_impl_1 = require("../../internals/resource_url_impl"); +/** + * Safely creates a Web Worker. + * + * Example usage: + * const trustedResourceUrl = trustedResourceUrl`/safe_script.js`; + * safedom.safeWorker.create(trustedResourceUrl); + * which is a safe alternative to + * new Worker(url); + * The latter can result in loading untrusted code. + */ +function create(url, options) { + return new Worker((0, resource_url_impl_1.unwrapResourceUrl)(url), options); +} +exports.create = create; +/** Safely creates a shared Web Worker. */ +function createShared(url, options) { + return new SharedWorker((0, resource_url_impl_1.unwrapResourceUrl)(url), options); +} +exports.createShared = createShared; +/** Safely calls importScripts */ +function importScripts(scope) { + var urls = []; + for (var _i = 1; _i < arguments.length; _i++) { + urls[_i - 1] = arguments[_i]; + } + scope.importScripts.apply(scope, __spreadArray([], __read(urls.map(function (url) { return (0, resource_url_impl_1.unwrapResourceUrl)(url); })), false)); +} +exports.importScripts = importScripts;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/worker.mjs b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/worker.mjs new file mode 100644 index 0000000..63df6bf4 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/globals/worker.mjs
@@ -0,0 +1,26 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import { unwrapResourceUrl } from '../../internals/resource_url_impl'; +/** + * Safely creates a Web Worker. + * + * Example usage: + * const trustedResourceUrl = trustedResourceUrl`/safe_script.js`; + * safedom.safeWorker.create(trustedResourceUrl); + * which is a safe alternative to + * new Worker(url); + * The latter can result in loading untrusted code. + */ +export function create(url, options) { + return new Worker(unwrapResourceUrl(url), options); +} +/** Safely creates a shared Web Worker. */ +export function createShared(url, options) { + return new SharedWorker(unwrapResourceUrl(url), options); +} +/** Safely calls importScripts */ +export function importScripts(scope, ...urls) { + scope.importScripts(...urls.map(url => unwrapResourceUrl(url))); +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/index.d.ts b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/index.d.ts new file mode 100644 index 0000000..1fcbca7 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/index.d.ts
@@ -0,0 +1,31 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +/** + * @fileoverview This file re-exports all of the wrappers to ensure that we have + * a clearly defined interface. + */ +export * as safeAnchorEl from './elements/anchor'; +export * as safeAreaEl from './elements/area'; +export * as safeBaseEl from './elements/base'; +export * as safeButtonEl from './elements/button'; +export * as safeElement from './elements/element'; +export * as safeEmbedEl from './elements/embed'; +export * as safeFormEl from './elements/form'; +export * as safeIframeEl from './elements/iframe'; +export * as safeInputEl from './elements/input'; +export * as safeLinkEl from './elements/link'; +export * as safeObjectEl from './elements/object'; +export * as safeScriptEl from './elements/script'; +export * as safeStyleEl from './elements/style'; +export * as safeSvgUseEl from './elements/svg_use'; +export * as safeDocument from './globals/document'; +export * as safeDomParser from './globals/dom_parser'; +export * as safeGlobal from './globals/global'; +export * as safeLocation from './globals/location'; +export * as safeRange from './globals/range'; +export * as safeServiceWorkerContainer from './globals/service_worker_container'; +export * as safeUrl from './globals/url'; +export * as safeWindow from './globals/window'; +export * as safeWorker from './globals/worker';
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/index.js b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/index.js new file mode 100644 index 0000000..f5026867 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/index.js
@@ -0,0 +1,57 @@ +"use strict"; +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.safeWorker = exports.safeWindow = exports.safeUrl = exports.safeServiceWorkerContainer = exports.safeRange = exports.safeLocation = exports.safeGlobal = exports.safeDomParser = exports.safeDocument = exports.safeSvgUseEl = exports.safeStyleEl = exports.safeScriptEl = exports.safeObjectEl = exports.safeLinkEl = exports.safeInputEl = exports.safeIframeEl = exports.safeFormEl = exports.safeEmbedEl = exports.safeElement = exports.safeButtonEl = exports.safeBaseEl = exports.safeAreaEl = exports.safeAnchorEl = void 0; +/** + * @fileoverview This file re-exports all of the wrappers to ensure that we have + * a clearly defined interface. + */ +exports.safeAnchorEl = __importStar(require("./elements/anchor")); +exports.safeAreaEl = __importStar(require("./elements/area")); +exports.safeBaseEl = __importStar(require("./elements/base")); +exports.safeButtonEl = __importStar(require("./elements/button")); +exports.safeElement = __importStar(require("./elements/element")); +exports.safeEmbedEl = __importStar(require("./elements/embed")); +exports.safeFormEl = __importStar(require("./elements/form")); +exports.safeIframeEl = __importStar(require("./elements/iframe")); +exports.safeInputEl = __importStar(require("./elements/input")); +exports.safeLinkEl = __importStar(require("./elements/link")); +exports.safeObjectEl = __importStar(require("./elements/object")); +exports.safeScriptEl = __importStar(require("./elements/script")); +exports.safeStyleEl = __importStar(require("./elements/style")); +exports.safeSvgUseEl = __importStar(require("./elements/svg_use")); +exports.safeDocument = __importStar(require("./globals/document")); +exports.safeDomParser = __importStar(require("./globals/dom_parser")); +exports.safeGlobal = __importStar(require("./globals/global")); +exports.safeLocation = __importStar(require("./globals/location")); +exports.safeRange = __importStar(require("./globals/range")); +exports.safeServiceWorkerContainer = __importStar(require("./globals/service_worker_container")); +exports.safeUrl = __importStar(require("./globals/url")); +exports.safeWindow = __importStar(require("./globals/window")); +exports.safeWorker = __importStar(require("./globals/worker"));
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/index.mjs b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/index.mjs new file mode 100644 index 0000000..1fcbca7 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/dom/index.mjs
@@ -0,0 +1,31 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +/** + * @fileoverview This file re-exports all of the wrappers to ensure that we have + * a clearly defined interface. + */ +export * as safeAnchorEl from './elements/anchor'; +export * as safeAreaEl from './elements/area'; +export * as safeBaseEl from './elements/base'; +export * as safeButtonEl from './elements/button'; +export * as safeElement from './elements/element'; +export * as safeEmbedEl from './elements/embed'; +export * as safeFormEl from './elements/form'; +export * as safeIframeEl from './elements/iframe'; +export * as safeInputEl from './elements/input'; +export * as safeLinkEl from './elements/link'; +export * as safeObjectEl from './elements/object'; +export * as safeScriptEl from './elements/script'; +export * as safeStyleEl from './elements/style'; +export * as safeSvgUseEl from './elements/svg_use'; +export * as safeDocument from './globals/document'; +export * as safeDomParser from './globals/dom_parser'; +export * as safeGlobal from './globals/global'; +export * as safeLocation from './globals/location'; +export * as safeRange from './globals/range'; +export * as safeServiceWorkerContainer from './globals/service_worker_container'; +export * as safeUrl from './globals/url'; +export * as safeWindow from './globals/window'; +export * as safeWorker from './globals/worker';
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/environment/dev.d.ts b/third_party/material_web_components/components-chromium/node_modules/safevalues/environment/dev.d.ts new file mode 100644 index 0000000..39b77bb --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/environment/dev.d.ts
@@ -0,0 +1,4 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/environment/dev.js b/third_party/material_web_components/components-chromium/node_modules/safevalues/environment/dev.js new file mode 100644 index 0000000..899ea853 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/environment/dev.js
@@ -0,0 +1,14 @@ +"use strict"; +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +/** + * Ensure process.env.NODE_ENV is set even when not running under Webpack or + * Node. Terser will strip this out of production binaries. + */ +/*#__PURE__*/ (function () { + if (typeof process === 'undefined') { + window.process = { env: { NODE_ENV: 'development' } }; + } +})();
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/environment/dev.mjs b/third_party/material_web_components/components-chromium/node_modules/safevalues/environment/dev.mjs new file mode 100644 index 0000000..70734c1 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/environment/dev.mjs
@@ -0,0 +1,14 @@ +"use strict"; +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +/** + * Ensure process.env.NODE_ENV is set even when not running under Webpack or + * Node. Terser will strip this out of production binaries. + */ +/*#__PURE__*/ (() => { + if (typeof process === 'undefined') { + window.process = { env: { NODE_ENV: 'development' } }; + } +})();
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/index.d.ts b/third_party/material_web_components/components-chromium/node_modules/safevalues/index.d.ts new file mode 100644 index 0000000..6f55f200 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/index.d.ts
@@ -0,0 +1,20 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +/** Safe builders */ +export { safeAttrPrefix } from './builders/attribute_builders'; +export { concatHtmls, htmlEscape, scriptToHtml, scriptUrlToHtml } from './builders/html_builders'; +export { HtmlSanitizer, sanitizeHtml, sanitizeHtmlAssertUnchanged, sanitizeHtmlToFragment } from './builders/html_sanitizer/html_sanitizer'; +export { HtmlSanitizerBuilder } from './builders/html_sanitizer/html_sanitizer_builder'; +export { appendParams, objectUrlFromScript, replaceFragment, trustedResourceUrl } from './builders/resource_url_builders'; +export { concatScripts, safeScript, safeScriptWithArgs, valueAsScript } from './builders/script_builders'; +export { concatStyles, safeStyle } from './builders/style_builders'; +export { concatStyleSheets, safeStyleSheet } from './builders/style_sheet_builders'; +/** Types, constants and unwrappers */ +export { SafeAttributePrefix, unwrapAttributePrefix } from './internals/attribute_impl'; +export { EMPTY_HTML, isHtml, SafeHtml, unwrapHtml } from './internals/html_impl'; +export { isResourceUrl, TrustedResourceUrl, unwrapResourceUrl } from './internals/resource_url_impl'; +export { EMPTY_SCRIPT, isScript, SafeScript, unwrapScript } from './internals/script_impl'; +export { isStyle, SafeStyle, unwrapStyle } from './internals/style_impl'; +export { isStyleSheet, SafeStyleSheet, unwrapStyleSheet } from './internals/style_sheet_impl';
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/index.js b/third_party/material_web_components/components-chromium/node_modules/safevalues/index.js new file mode 100644 index 0000000..ecb7a31 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/index.js
@@ -0,0 +1,63 @@ +"use strict"; +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.unwrapStyleSheet = exports.SafeStyleSheet = exports.isStyleSheet = exports.unwrapStyle = exports.SafeStyle = exports.isStyle = exports.unwrapScript = exports.SafeScript = exports.isScript = exports.EMPTY_SCRIPT = exports.unwrapResourceUrl = exports.TrustedResourceUrl = exports.isResourceUrl = exports.unwrapHtml = exports.SafeHtml = exports.isHtml = exports.EMPTY_HTML = exports.unwrapAttributePrefix = exports.SafeAttributePrefix = exports.safeStyleSheet = exports.concatStyleSheets = exports.safeStyle = exports.concatStyles = exports.valueAsScript = exports.safeScriptWithArgs = exports.safeScript = exports.concatScripts = exports.trustedResourceUrl = exports.replaceFragment = exports.objectUrlFromScript = exports.appendParams = exports.HtmlSanitizerBuilder = exports.sanitizeHtmlToFragment = exports.sanitizeHtmlAssertUnchanged = exports.sanitizeHtml = exports.scriptUrlToHtml = exports.scriptToHtml = exports.htmlEscape = exports.concatHtmls = exports.safeAttrPrefix = void 0; +/** Safe builders */ +var attribute_builders_1 = require("./builders/attribute_builders"); +Object.defineProperty(exports, "safeAttrPrefix", { enumerable: true, get: function () { return attribute_builders_1.safeAttrPrefix; } }); +var html_builders_1 = require("./builders/html_builders"); +Object.defineProperty(exports, "concatHtmls", { enumerable: true, get: function () { return html_builders_1.concatHtmls; } }); +Object.defineProperty(exports, "htmlEscape", { enumerable: true, get: function () { return html_builders_1.htmlEscape; } }); +Object.defineProperty(exports, "scriptToHtml", { enumerable: true, get: function () { return html_builders_1.scriptToHtml; } }); +Object.defineProperty(exports, "scriptUrlToHtml", { enumerable: true, get: function () { return html_builders_1.scriptUrlToHtml; } }); +var html_sanitizer_1 = require("./builders/html_sanitizer/html_sanitizer"); +Object.defineProperty(exports, "sanitizeHtml", { enumerable: true, get: function () { return html_sanitizer_1.sanitizeHtml; } }); +Object.defineProperty(exports, "sanitizeHtmlAssertUnchanged", { enumerable: true, get: function () { return html_sanitizer_1.sanitizeHtmlAssertUnchanged; } }); +Object.defineProperty(exports, "sanitizeHtmlToFragment", { enumerable: true, get: function () { return html_sanitizer_1.sanitizeHtmlToFragment; } }); +var html_sanitizer_builder_1 = require("./builders/html_sanitizer/html_sanitizer_builder"); +Object.defineProperty(exports, "HtmlSanitizerBuilder", { enumerable: true, get: function () { return html_sanitizer_builder_1.HtmlSanitizerBuilder; } }); +var resource_url_builders_1 = require("./builders/resource_url_builders"); +Object.defineProperty(exports, "appendParams", { enumerable: true, get: function () { return resource_url_builders_1.appendParams; } }); +Object.defineProperty(exports, "objectUrlFromScript", { enumerable: true, get: function () { return resource_url_builders_1.objectUrlFromScript; } }); +Object.defineProperty(exports, "replaceFragment", { enumerable: true, get: function () { return resource_url_builders_1.replaceFragment; } }); +Object.defineProperty(exports, "trustedResourceUrl", { enumerable: true, get: function () { return resource_url_builders_1.trustedResourceUrl; } }); +var script_builders_1 = require("./builders/script_builders"); +Object.defineProperty(exports, "concatScripts", { enumerable: true, get: function () { return script_builders_1.concatScripts; } }); +Object.defineProperty(exports, "safeScript", { enumerable: true, get: function () { return script_builders_1.safeScript; } }); +Object.defineProperty(exports, "safeScriptWithArgs", { enumerable: true, get: function () { return script_builders_1.safeScriptWithArgs; } }); +Object.defineProperty(exports, "valueAsScript", { enumerable: true, get: function () { return script_builders_1.valueAsScript; } }); +var style_builders_1 = require("./builders/style_builders"); +Object.defineProperty(exports, "concatStyles", { enumerable: true, get: function () { return style_builders_1.concatStyles; } }); +Object.defineProperty(exports, "safeStyle", { enumerable: true, get: function () { return style_builders_1.safeStyle; } }); +var style_sheet_builders_1 = require("./builders/style_sheet_builders"); +Object.defineProperty(exports, "concatStyleSheets", { enumerable: true, get: function () { return style_sheet_builders_1.concatStyleSheets; } }); +Object.defineProperty(exports, "safeStyleSheet", { enumerable: true, get: function () { return style_sheet_builders_1.safeStyleSheet; } }); +/** Types, constants and unwrappers */ +var attribute_impl_1 = require("./internals/attribute_impl"); +Object.defineProperty(exports, "SafeAttributePrefix", { enumerable: true, get: function () { return attribute_impl_1.SafeAttributePrefix; } }); +Object.defineProperty(exports, "unwrapAttributePrefix", { enumerable: true, get: function () { return attribute_impl_1.unwrapAttributePrefix; } }); +var html_impl_1 = require("./internals/html_impl"); +Object.defineProperty(exports, "EMPTY_HTML", { enumerable: true, get: function () { return html_impl_1.EMPTY_HTML; } }); +Object.defineProperty(exports, "isHtml", { enumerable: true, get: function () { return html_impl_1.isHtml; } }); +Object.defineProperty(exports, "SafeHtml", { enumerable: true, get: function () { return html_impl_1.SafeHtml; } }); +Object.defineProperty(exports, "unwrapHtml", { enumerable: true, get: function () { return html_impl_1.unwrapHtml; } }); +var resource_url_impl_1 = require("./internals/resource_url_impl"); +Object.defineProperty(exports, "isResourceUrl", { enumerable: true, get: function () { return resource_url_impl_1.isResourceUrl; } }); +Object.defineProperty(exports, "TrustedResourceUrl", { enumerable: true, get: function () { return resource_url_impl_1.TrustedResourceUrl; } }); +Object.defineProperty(exports, "unwrapResourceUrl", { enumerable: true, get: function () { return resource_url_impl_1.unwrapResourceUrl; } }); +var script_impl_1 = require("./internals/script_impl"); +Object.defineProperty(exports, "EMPTY_SCRIPT", { enumerable: true, get: function () { return script_impl_1.EMPTY_SCRIPT; } }); +Object.defineProperty(exports, "isScript", { enumerable: true, get: function () { return script_impl_1.isScript; } }); +Object.defineProperty(exports, "SafeScript", { enumerable: true, get: function () { return script_impl_1.SafeScript; } }); +Object.defineProperty(exports, "unwrapScript", { enumerable: true, get: function () { return script_impl_1.unwrapScript; } }); +var style_impl_1 = require("./internals/style_impl"); +Object.defineProperty(exports, "isStyle", { enumerable: true, get: function () { return style_impl_1.isStyle; } }); +Object.defineProperty(exports, "SafeStyle", { enumerable: true, get: function () { return style_impl_1.SafeStyle; } }); +Object.defineProperty(exports, "unwrapStyle", { enumerable: true, get: function () { return style_impl_1.unwrapStyle; } }); +var style_sheet_impl_1 = require("./internals/style_sheet_impl"); +Object.defineProperty(exports, "isStyleSheet", { enumerable: true, get: function () { return style_sheet_impl_1.isStyleSheet; } }); +Object.defineProperty(exports, "SafeStyleSheet", { enumerable: true, get: function () { return style_sheet_impl_1.SafeStyleSheet; } }); +Object.defineProperty(exports, "unwrapStyleSheet", { enumerable: true, get: function () { return style_sheet_impl_1.unwrapStyleSheet; } });
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/index.mjs b/third_party/material_web_components/components-chromium/node_modules/safevalues/index.mjs new file mode 100644 index 0000000..d934826 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/index.mjs
@@ -0,0 +1,20 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +/** Safe builders */ +export { safeAttrPrefix } from './builders/attribute_builders'; +export { concatHtmls, htmlEscape, scriptToHtml, scriptUrlToHtml } from './builders/html_builders'; +export { sanitizeHtml, sanitizeHtmlAssertUnchanged, sanitizeHtmlToFragment } from './builders/html_sanitizer/html_sanitizer'; +export { HtmlSanitizerBuilder } from './builders/html_sanitizer/html_sanitizer_builder'; +export { appendParams, objectUrlFromScript, replaceFragment, trustedResourceUrl } from './builders/resource_url_builders'; +export { concatScripts, safeScript, safeScriptWithArgs, valueAsScript } from './builders/script_builders'; +export { concatStyles, safeStyle } from './builders/style_builders'; +export { concatStyleSheets, safeStyleSheet } from './builders/style_sheet_builders'; +/** Types, constants and unwrappers */ +export { SafeAttributePrefix, unwrapAttributePrefix } from './internals/attribute_impl'; +export { EMPTY_HTML, isHtml, SafeHtml, unwrapHtml } from './internals/html_impl'; +export { isResourceUrl, TrustedResourceUrl, unwrapResourceUrl } from './internals/resource_url_impl'; +export { EMPTY_SCRIPT, isScript, SafeScript, unwrapScript } from './internals/script_impl'; +export { isStyle, SafeStyle, unwrapStyle } from './internals/style_impl'; +export { isStyleSheet, SafeStyleSheet, unwrapStyleSheet } from './internals/style_sheet_impl';
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/attribute_impl.d.ts b/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/attribute_impl.d.ts new file mode 100644 index 0000000..3a8fac8 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/attribute_impl.d.ts
@@ -0,0 +1,20 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import '../environment/dev'; +/** A prefix with which an attribute is safe to set using plain strings. */ +export declare abstract class SafeAttributePrefix { + private readonly brand; +} +/** + * Builds a new `SafeAttribute` from the given string, without enforcing + * safety guarantees. This shouldn't be exposed to application developers, and + * must only be used as a step towards safe builders or safe constants. + */ +export declare function createAttributePrefix(attrPrefix: string): SafeAttributePrefix; +/** + * Returns the string value of the passed `SafeAttributePrefix` object while + * ensuring it has the correct type. + */ +export declare function unwrapAttributePrefix(value: SafeAttributePrefix): string;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/attribute_impl.js b/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/attribute_impl.js new file mode 100644 index 0000000..c23907e --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/attribute_impl.js
@@ -0,0 +1,71 @@ +"use strict"; +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.unwrapAttributePrefix = exports.createAttributePrefix = exports.SafeAttributePrefix = void 0; +require("../environment/dev"); +var secrets_1 = require("./secrets"); +/** A prefix with which an attribute is safe to set using plain strings. */ +var SafeAttributePrefix = /** @class */ (function () { + function SafeAttributePrefix() { + } + return SafeAttributePrefix; +}()); +exports.SafeAttributePrefix = SafeAttributePrefix; +/** Implementation for `SafeAttributePrefix` */ +var AttributePrefixImpl = /** @class */ (function (_super) { + __extends(AttributePrefixImpl, _super); + function AttributePrefixImpl(attrPrefix, token) { + var _this = _super.call(this) || this; + (0, secrets_1.ensureTokenIsValid)(token); + _this.privateDoNotAccessOrElseWrappedAttrPrefix = attrPrefix; + return _this; + } + AttributePrefixImpl.prototype.toString = function () { + return this.privateDoNotAccessOrElseWrappedAttrPrefix; + }; + return AttributePrefixImpl; +}(SafeAttributePrefix)); +/** + * Builds a new `SafeAttribute` from the given string, without enforcing + * safety guarantees. This shouldn't be exposed to application developers, and + * must only be used as a step towards safe builders or safe constants. + */ +function createAttributePrefix(attrPrefix) { + return new AttributePrefixImpl(attrPrefix, secrets_1.secretToken); +} +exports.createAttributePrefix = createAttributePrefix; +/** + * Returns the string value of the passed `SafeAttributePrefix` object while + * ensuring it has the correct type. + */ +function unwrapAttributePrefix(value) { + if (value instanceof AttributePrefixImpl) { + return value.privateDoNotAccessOrElseWrappedAttrPrefix; + } + else { + var message = ''; + if (process.env.NODE_ENV !== 'production') { + message = 'Unexpected type when unwrapping SafeAttributePrefix'; + } + throw new Error(message); + } +} +exports.unwrapAttributePrefix = unwrapAttributePrefix;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/attribute_impl.mjs b/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/attribute_impl.mjs new file mode 100644 index 0000000..9fe3e65 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/attribute_impl.mjs
@@ -0,0 +1,47 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import '../environment/dev'; +import { ensureTokenIsValid, secretToken } from './secrets'; +/** A prefix with which an attribute is safe to set using plain strings. */ +export class SafeAttributePrefix { + // @ts-ignore: error TS6133: 'brand' is declared but its value is never read. + brand; // To prevent structural typing. +} +/** Implementation for `SafeAttributePrefix` */ +class AttributePrefixImpl extends SafeAttributePrefix { + privateDoNotAccessOrElseWrappedAttrPrefix; + constructor(attrPrefix, token) { + super(); + ensureTokenIsValid(token); + this.privateDoNotAccessOrElseWrappedAttrPrefix = attrPrefix; + } + toString() { + return this.privateDoNotAccessOrElseWrappedAttrPrefix; + } +} +/** + * Builds a new `SafeAttribute` from the given string, without enforcing + * safety guarantees. This shouldn't be exposed to application developers, and + * must only be used as a step towards safe builders or safe constants. + */ +export function createAttributePrefix(attrPrefix) { + return new AttributePrefixImpl(attrPrefix, secretToken); +} +/** + * Returns the string value of the passed `SafeAttributePrefix` object while + * ensuring it has the correct type. + */ +export function unwrapAttributePrefix(value) { + if (value instanceof AttributePrefixImpl) { + return value.privateDoNotAccessOrElseWrappedAttrPrefix; + } + else { + let message = ''; + if (process.env.NODE_ENV !== 'production') { + message = 'Unexpected type when unwrapping SafeAttributePrefix'; + } + throw new Error(message); + } +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/html_impl.d.ts b/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/html_impl.d.ts new file mode 100644 index 0000000..d8bc53b --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/html_impl.d.ts
@@ -0,0 +1,38 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +/// <reference types="trusted-types" /> +import '../environment/dev'; +/** + * String that is safe to use in HTML contexts in DOM APIs and HTML + documents. + */ +export declare type SafeHtml = TrustedHTML; +/** + * Also exports the constructor so that instanceof checks work. + */ +export declare const SafeHtml: TrustedHTML; +/** + * Builds a new `SafeHtml` from the given string, without enforcing safety + * guarantees. It may cause side effects by creating a Trusted Types policy. + * This shouldn't be exposed to application developers, and must only be used as + * a step towards safe builders or safe constants. + */ +export declare function createHtml(html: string): SafeHtml; +/** + * An empty `SafeHtml` constant. + * Unlike the function above, using this will not create a policy. + */ +export declare const EMPTY_HTML: SafeHtml; +/** + * Checks if the given value is a `SafeHtml` instance. + */ +export declare function isHtml(value: unknown): value is SafeHtml; +/** + * Returns the value of the passed `SafeHtml` object while ensuring it + * has the correct type. + * + * Returns a native `TrustedHTML` or a string if Trusted Types are disabled. + */ +export declare function unwrapHtml(value: SafeHtml): TrustedHTML | string;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/html_impl.js b/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/html_impl.js new file mode 100644 index 0000000..7bb4414 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/html_impl.js
@@ -0,0 +1,82 @@ +"use strict"; +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.unwrapHtml = exports.isHtml = exports.EMPTY_HTML = exports.createHtml = exports.SafeHtml = void 0; +require("../environment/dev"); +/* g3_import_pure from './pure' */ +var secrets_1 = require("./secrets"); +var trusted_types_1 = require("./trusted_types"); +/** + * Runtime implementation of `TrustedHTML` in browsers that don't support it. + */ +var HtmlImpl = /** @class */ (function () { + function HtmlImpl(html, token) { + (0, secrets_1.ensureTokenIsValid)(token); + this.privateDoNotAccessOrElseWrappedHtml = html; + } + HtmlImpl.prototype.toString = function () { + return this.privateDoNotAccessOrElseWrappedHtml.toString(); + }; + return HtmlImpl; +}()); +function createHtmlInternal(html, trusted) { + return (trusted !== null && trusted !== void 0 ? trusted : new HtmlImpl(html, secrets_1.secretToken)); +} +var GlobalTrustedHTML = (typeof window !== undefined) ? window.TrustedHTML : undefined; +/** + * Also exports the constructor so that instanceof checks work. + */ +exports.SafeHtml = (GlobalTrustedHTML !== null && GlobalTrustedHTML !== void 0 ? GlobalTrustedHTML : HtmlImpl); +/** + * Builds a new `SafeHtml` from the given string, without enforcing safety + * guarantees. It may cause side effects by creating a Trusted Types policy. + * This shouldn't be exposed to application developers, and must only be used as + * a step towards safe builders or safe constants. + */ +function createHtml(html) { + var _a; + /** @noinline */ + var noinlineHtml = html; + return createHtmlInternal(noinlineHtml, (_a = (0, trusted_types_1.getTrustedTypesPolicy)()) === null || _a === void 0 ? void 0 : _a.createHTML(noinlineHtml)); +} +exports.createHtml = createHtml; +/** + * An empty `SafeHtml` constant. + * Unlike the function above, using this will not create a policy. + */ +exports.EMPTY_HTML = +/* #__PURE__ */ (function () { var _a; return createHtmlInternal('', (_a = (0, trusted_types_1.getTrustedTypes)()) === null || _a === void 0 ? void 0 : _a.emptyHTML); })(); +/** + * Checks if the given value is a `SafeHtml` instance. + */ +function isHtml(value) { + var _a; + return ((_a = (0, trusted_types_1.getTrustedTypes)()) === null || _a === void 0 ? void 0 : _a.isHTML(value)) || value instanceof HtmlImpl; +} +exports.isHtml = isHtml; +/** + * Returns the value of the passed `SafeHtml` object while ensuring it + * has the correct type. + * + * Returns a native `TrustedHTML` or a string if Trusted Types are disabled. + */ +function unwrapHtml(value) { + var _a; + if ((_a = (0, trusted_types_1.getTrustedTypes)()) === null || _a === void 0 ? void 0 : _a.isHTML(value)) { + return value; + } + else if (value instanceof HtmlImpl) { + return value.privateDoNotAccessOrElseWrappedHtml; + } + else { + var message = ''; + if (process.env.NODE_ENV !== 'production') { + message = 'Unexpected type when unwrapping SafeHtml'; + } + throw new Error(message); + } +} +exports.unwrapHtml = unwrapHtml;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/html_impl.mjs b/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/html_impl.mjs new file mode 100644 index 0000000..03a0f5d --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/html_impl.mjs
@@ -0,0 +1,73 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import '../environment/dev'; +/* g3_import_pure from './pure' */ +import { ensureTokenIsValid, secretToken } from './secrets'; +import { getTrustedTypes, getTrustedTypesPolicy } from './trusted_types'; +/** + * Runtime implementation of `TrustedHTML` in browsers that don't support it. + */ +class HtmlImpl { + privateDoNotAccessOrElseWrappedHtml; + constructor(html, token) { + ensureTokenIsValid(token); + this.privateDoNotAccessOrElseWrappedHtml = html; + } + toString() { + return this.privateDoNotAccessOrElseWrappedHtml.toString(); + } +} +function createHtmlInternal(html, trusted) { + return (trusted ?? new HtmlImpl(html, secretToken)); +} +const GlobalTrustedHTML = (typeof window !== undefined) ? window.TrustedHTML : undefined; +/** + * Also exports the constructor so that instanceof checks work. + */ +export const SafeHtml = (GlobalTrustedHTML ?? HtmlImpl); +/** + * Builds a new `SafeHtml` from the given string, without enforcing safety + * guarantees. It may cause side effects by creating a Trusted Types policy. + * This shouldn't be exposed to application developers, and must only be used as + * a step towards safe builders or safe constants. + */ +export function createHtml(html) { + /** @noinline */ + const noinlineHtml = html; + return createHtmlInternal(noinlineHtml, getTrustedTypesPolicy()?.createHTML(noinlineHtml)); +} +/** + * An empty `SafeHtml` constant. + * Unlike the function above, using this will not create a policy. + */ +export const EMPTY_HTML = +/* #__PURE__ */ (() => createHtmlInternal('', getTrustedTypes()?.emptyHTML))(); +/** + * Checks if the given value is a `SafeHtml` instance. + */ +export function isHtml(value) { + return getTrustedTypes()?.isHTML(value) || value instanceof HtmlImpl; +} +/** + * Returns the value of the passed `SafeHtml` object while ensuring it + * has the correct type. + * + * Returns a native `TrustedHTML` or a string if Trusted Types are disabled. + */ +export function unwrapHtml(value) { + if (getTrustedTypes()?.isHTML(value)) { + return value; + } + else if (value instanceof HtmlImpl) { + return value.privateDoNotAccessOrElseWrappedHtml; + } + else { + let message = ''; + if (process.env.NODE_ENV !== 'production') { + message = 'Unexpected type when unwrapping SafeHtml'; + } + throw new Error(message); + } +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/resource_url_impl.d.ts b/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/resource_url_impl.d.ts new file mode 100644 index 0000000..8a3b3cc --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/resource_url_impl.d.ts
@@ -0,0 +1,35 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +/// <reference types="trusted-types" /> +import '../environment/dev'; +/** + * String that is safe to use in all URL contexts in DOM APIs and HTML + * documents; even as a reference to resources that may load in the current + * origin (e.g. scripts and stylesheets). + */ +export declare type TrustedResourceUrl = TrustedScriptURL; +/** + * Also exports the constructor so that instanceof checks work. + */ +export declare const TrustedResourceUrl: TrustedScriptURL; +/** + * Builds a new `TrustedResourceUrl` from the given string, without + * enforcing safety guarantees. It may cause side effects by creating a Trusted + * Types policy. This shouldn't be exposed to application developers, and must + * only be used as a step towards safe builders or safe constants. + */ +export declare function createResourceUrl(url: string): TrustedResourceUrl; +/** + * Checks if the given value is a `TrustedResourceUrl` instance. + */ +export declare function isResourceUrl(value: unknown): value is TrustedResourceUrl; +/** + * Returns the value of the passed `TrustedResourceUrl` object while ensuring it + * has the correct type. + * + * Returns a native `TrustedScriptURL` or a string if Trusted Types are + * disabled. + */ +export declare function unwrapResourceUrl(value: TrustedResourceUrl): TrustedScriptURL | string;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/resource_url_impl.js b/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/resource_url_impl.js new file mode 100644 index 0000000..8bdc683 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/resource_url_impl.js
@@ -0,0 +1,76 @@ +"use strict"; +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.unwrapResourceUrl = exports.isResourceUrl = exports.createResourceUrl = exports.TrustedResourceUrl = void 0; +require("../environment/dev"); +var secrets_1 = require("./secrets"); +var trusted_types_1 = require("./trusted_types"); +/** + * Runtime implementation of `TrustedScriptURL` in browsers that don't support + * it. + */ +var ResourceUrlImpl = /** @class */ (function () { + function ResourceUrlImpl(url, token) { + (0, secrets_1.ensureTokenIsValid)(token); + this.privateDoNotAccessOrElseWrappedResourceUrl = url; + } + ResourceUrlImpl.prototype.toString = function () { + return this.privateDoNotAccessOrElseWrappedResourceUrl.toString(); + }; + return ResourceUrlImpl; +}()); +var GlobalTrustedScriptURL = (typeof window !== undefined) ? window.TrustedScriptURL : undefined; +/** + * Also exports the constructor so that instanceof checks work. + */ +exports.TrustedResourceUrl = (GlobalTrustedScriptURL !== null && GlobalTrustedScriptURL !== void 0 ? GlobalTrustedScriptURL : ResourceUrlImpl); +/** + * Builds a new `TrustedResourceUrl` from the given string, without + * enforcing safety guarantees. It may cause side effects by creating a Trusted + * Types policy. This shouldn't be exposed to application developers, and must + * only be used as a step towards safe builders or safe constants. + */ +function createResourceUrl(url) { + var _a; + /** @noinline */ + var noinlineUrl = url; + var trustedScriptURL = (_a = (0, trusted_types_1.getTrustedTypesPolicy)()) === null || _a === void 0 ? void 0 : _a.createScriptURL(noinlineUrl); + return (trustedScriptURL !== null && trustedScriptURL !== void 0 ? trustedScriptURL : new ResourceUrlImpl(noinlineUrl, secrets_1.secretToken)); +} +exports.createResourceUrl = createResourceUrl; +/** + * Checks if the given value is a `TrustedResourceUrl` instance. + */ +function isResourceUrl(value) { + var _a; + return ((_a = (0, trusted_types_1.getTrustedTypes)()) === null || _a === void 0 ? void 0 : _a.isScriptURL(value)) || + value instanceof ResourceUrlImpl; +} +exports.isResourceUrl = isResourceUrl; +/** + * Returns the value of the passed `TrustedResourceUrl` object while ensuring it + * has the correct type. + * + * Returns a native `TrustedScriptURL` or a string if Trusted Types are + * disabled. + */ +function unwrapResourceUrl(value) { + var _a; + if ((_a = (0, trusted_types_1.getTrustedTypes)()) === null || _a === void 0 ? void 0 : _a.isScriptURL(value)) { + return value; + } + else if (value instanceof ResourceUrlImpl) { + return value.privateDoNotAccessOrElseWrappedResourceUrl; + } + else { + var message = ''; + if (process.env.NODE_ENV !== 'production') { + message = 'Unexpected type when unwrapping TrustedResourceUrl'; + } + throw new Error(message); + } +} +exports.unwrapResourceUrl = unwrapResourceUrl;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/resource_url_impl.mjs b/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/resource_url_impl.mjs new file mode 100644 index 0000000..b4058c7 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/resource_url_impl.mjs
@@ -0,0 +1,67 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import '../environment/dev'; +import { ensureTokenIsValid, secretToken } from './secrets'; +import { getTrustedTypes, getTrustedTypesPolicy } from './trusted_types'; +/** + * Runtime implementation of `TrustedScriptURL` in browsers that don't support + * it. + */ +class ResourceUrlImpl { + privateDoNotAccessOrElseWrappedResourceUrl; + constructor(url, token) { + ensureTokenIsValid(token); + this.privateDoNotAccessOrElseWrappedResourceUrl = url; + } + toString() { + return this.privateDoNotAccessOrElseWrappedResourceUrl.toString(); + } +} +const GlobalTrustedScriptURL = (typeof window !== undefined) ? window.TrustedScriptURL : undefined; +/** + * Also exports the constructor so that instanceof checks work. + */ +export const TrustedResourceUrl = (GlobalTrustedScriptURL ?? ResourceUrlImpl); +/** + * Builds a new `TrustedResourceUrl` from the given string, without + * enforcing safety guarantees. It may cause side effects by creating a Trusted + * Types policy. This shouldn't be exposed to application developers, and must + * only be used as a step towards safe builders or safe constants. + */ +export function createResourceUrl(url) { + /** @noinline */ + const noinlineUrl = url; + const trustedScriptURL = getTrustedTypesPolicy()?.createScriptURL(noinlineUrl); + return (trustedScriptURL ?? new ResourceUrlImpl(noinlineUrl, secretToken)); +} +/** + * Checks if the given value is a `TrustedResourceUrl` instance. + */ +export function isResourceUrl(value) { + return getTrustedTypes()?.isScriptURL(value) || + value instanceof ResourceUrlImpl; +} +/** + * Returns the value of the passed `TrustedResourceUrl` object while ensuring it + * has the correct type. + * + * Returns a native `TrustedScriptURL` or a string if Trusted Types are + * disabled. + */ +export function unwrapResourceUrl(value) { + if (getTrustedTypes()?.isScriptURL(value)) { + return value; + } + else if (value instanceof ResourceUrlImpl) { + return value.privateDoNotAccessOrElseWrappedResourceUrl; + } + else { + let message = ''; + if (process.env.NODE_ENV !== 'production') { + message = 'Unexpected type when unwrapping TrustedResourceUrl'; + } + throw new Error(message); + } +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/script_impl.d.ts b/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/script_impl.d.ts new file mode 100644 index 0000000..24aef53 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/script_impl.d.ts
@@ -0,0 +1,38 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +/// <reference types="trusted-types" /> +import '../environment/dev'; +/** + * JavaScript code that is safe to evaluate and use as the content of an HTML + * script element. + */ +export declare type SafeScript = TrustedScript; +/** + * Also exports the constructor so that instanceof checks work. + */ +export declare const SafeScript: TrustedScript; +/** + * Builds a new `SafeScript` from the given string, without enforcing + * safety guarantees. It may cause side effects by creating a Trusted Types + * policy. This shouldn't be exposed to application developers, and must only be + * used as a step towards safe builders or safe constants. + */ +export declare function createScript(script: string): SafeScript; +/** + * An empty `SafeScript` constant. + * Unlike the functions above, using this will not create a policy. + */ +export declare const EMPTY_SCRIPT: SafeScript; +/** + * Checks if the given value is a `SafeScript` instance. + */ +export declare function isScript(value: unknown): value is SafeScript; +/** + * Returns the value of the passed `SafeScript` object while ensuring it + * has the correct type. + * + * Returns a native `TrustedScript` or a string if Trusted Types are disabled. + */ +export declare function unwrapScript(value: SafeScript): TrustedScript | string;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/script_impl.js b/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/script_impl.js new file mode 100644 index 0000000..183d886 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/script_impl.js
@@ -0,0 +1,83 @@ +"use strict"; +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.unwrapScript = exports.isScript = exports.EMPTY_SCRIPT = exports.createScript = exports.SafeScript = void 0; +require("../environment/dev"); +/* g3_import_pure from './pure' */ +var secrets_1 = require("./secrets"); +var trusted_types_1 = require("./trusted_types"); +/** + * Runtime implementation of `TrustedScript` in browswers that don't support it. + * script element. + */ +var ScriptImpl = /** @class */ (function () { + function ScriptImpl(script, token) { + (0, secrets_1.ensureTokenIsValid)(token); + this.privateDoNotAccessOrElseWrappedScript = script; + } + ScriptImpl.prototype.toString = function () { + return this.privateDoNotAccessOrElseWrappedScript.toString(); + }; + return ScriptImpl; +}()); +function createScriptInternal(script, trusted) { + return (trusted !== null && trusted !== void 0 ? trusted : new ScriptImpl(script, secrets_1.secretToken)); +} +var GlobalTrustedScript = (typeof window !== undefined) ? window.TrustedScript : undefined; +/** + * Also exports the constructor so that instanceof checks work. + */ +exports.SafeScript = (GlobalTrustedScript !== null && GlobalTrustedScript !== void 0 ? GlobalTrustedScript : ScriptImpl); +/** + * Builds a new `SafeScript` from the given string, without enforcing + * safety guarantees. It may cause side effects by creating a Trusted Types + * policy. This shouldn't be exposed to application developers, and must only be + * used as a step towards safe builders or safe constants. + */ +function createScript(script) { + var _a; + /** @noinline */ + var noinlineScript = script; + return createScriptInternal(noinlineScript, (_a = (0, trusted_types_1.getTrustedTypesPolicy)()) === null || _a === void 0 ? void 0 : _a.createScript(noinlineScript)); +} +exports.createScript = createScript; +/** + * An empty `SafeScript` constant. + * Unlike the functions above, using this will not create a policy. + */ +exports.EMPTY_SCRIPT = +/* #__PURE__ */ (function () { var _a; return createScriptInternal('', (_a = (0, trusted_types_1.getTrustedTypes)()) === null || _a === void 0 ? void 0 : _a.emptyScript); })(); +/** + * Checks if the given value is a `SafeScript` instance. + */ +function isScript(value) { + var _a; + return ((_a = (0, trusted_types_1.getTrustedTypes)()) === null || _a === void 0 ? void 0 : _a.isScript(value)) || value instanceof ScriptImpl; +} +exports.isScript = isScript; +/** + * Returns the value of the passed `SafeScript` object while ensuring it + * has the correct type. + * + * Returns a native `TrustedScript` or a string if Trusted Types are disabled. + */ +function unwrapScript(value) { + var _a; + if ((_a = (0, trusted_types_1.getTrustedTypes)()) === null || _a === void 0 ? void 0 : _a.isScript(value)) { + return value; + } + else if (value instanceof ScriptImpl) { + return value.privateDoNotAccessOrElseWrappedScript; + } + else { + var message = ''; + if (process.env.NODE_ENV !== 'production') { + message = 'Unexpected type when unwrapping SafeScript'; + } + throw new Error(message); + } +} +exports.unwrapScript = unwrapScript;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/script_impl.mjs b/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/script_impl.mjs new file mode 100644 index 0000000..2211ce7 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/script_impl.mjs
@@ -0,0 +1,74 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import '../environment/dev'; +/* g3_import_pure from './pure' */ +import { ensureTokenIsValid, secretToken } from './secrets'; +import { getTrustedTypes, getTrustedTypesPolicy } from './trusted_types'; +/** + * Runtime implementation of `TrustedScript` in browswers that don't support it. + * script element. + */ +class ScriptImpl { + privateDoNotAccessOrElseWrappedScript; + constructor(script, token) { + ensureTokenIsValid(token); + this.privateDoNotAccessOrElseWrappedScript = script; + } + toString() { + return this.privateDoNotAccessOrElseWrappedScript.toString(); + } +} +function createScriptInternal(script, trusted) { + return (trusted ?? new ScriptImpl(script, secretToken)); +} +const GlobalTrustedScript = (typeof window !== undefined) ? window.TrustedScript : undefined; +/** + * Also exports the constructor so that instanceof checks work. + */ +export const SafeScript = (GlobalTrustedScript ?? ScriptImpl); +/** + * Builds a new `SafeScript` from the given string, without enforcing + * safety guarantees. It may cause side effects by creating a Trusted Types + * policy. This shouldn't be exposed to application developers, and must only be + * used as a step towards safe builders or safe constants. + */ +export function createScript(script) { + /** @noinline */ + const noinlineScript = script; + return createScriptInternal(noinlineScript, getTrustedTypesPolicy()?.createScript(noinlineScript)); +} +/** + * An empty `SafeScript` constant. + * Unlike the functions above, using this will not create a policy. + */ +export const EMPTY_SCRIPT = +/* #__PURE__ */ (() => createScriptInternal('', getTrustedTypes()?.emptyScript))(); +/** + * Checks if the given value is a `SafeScript` instance. + */ +export function isScript(value) { + return getTrustedTypes()?.isScript(value) || value instanceof ScriptImpl; +} +/** + * Returns the value of the passed `SafeScript` object while ensuring it + * has the correct type. + * + * Returns a native `TrustedScript` or a string if Trusted Types are disabled. + */ +export function unwrapScript(value) { + if (getTrustedTypes()?.isScript(value)) { + return value; + } + else if (value instanceof ScriptImpl) { + return value.privateDoNotAccessOrElseWrappedScript; + } + else { + let message = ''; + if (process.env.NODE_ENV !== 'production') { + message = 'Unexpected type when unwrapping SafeScript'; + } + throw new Error(message); + } +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/secrets.d.ts b/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/secrets.d.ts new file mode 100644 index 0000000..11a8959 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/secrets.d.ts
@@ -0,0 +1,17 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import '../environment/dev'; +/** + * A secret token that must be passed to safe type constructors. It is only + * accessible from within safevalues, ensuring that unrestricted safe type + * creation is only possible within safevalues. In particular, this prevents + * forgery such as `safeHtmlValue.constructor('javascript:evil')`. + */ +export declare const secretToken: {}; +/** + * Asserts that the given token matches the secret safevalues token. An + * exception is thrown if that is not the case. + */ +export declare function ensureTokenIsValid(token: object): void;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/secrets.js b/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/secrets.js new file mode 100644 index 0000000..bf7e5f06 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/secrets.js
@@ -0,0 +1,27 @@ +"use strict"; +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ensureTokenIsValid = exports.secretToken = void 0; +require("../environment/dev"); +/** + * A secret token that must be passed to safe type constructors. It is only + * accessible from within safevalues, ensuring that unrestricted safe type + * creation is only possible within safevalues. In particular, this prevents + * forgery such as `safeHtmlValue.constructor('javascript:evil')`. + */ +exports.secretToken = {}; +/** + * Asserts that the given token matches the secret safevalues token. An + * exception is thrown if that is not the case. + */ +function ensureTokenIsValid(token) { + if (process.env.NODE_ENV !== 'production') { + if (token !== exports.secretToken) { + throw new Error('Bad secret'); + } + } +} +exports.ensureTokenIsValid = ensureTokenIsValid;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/secrets.mjs b/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/secrets.mjs new file mode 100644 index 0000000..f9989b6 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/secrets.mjs
@@ -0,0 +1,23 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import '../environment/dev'; +/** + * A secret token that must be passed to safe type constructors. It is only + * accessible from within safevalues, ensuring that unrestricted safe type + * creation is only possible within safevalues. In particular, this prevents + * forgery such as `safeHtmlValue.constructor('javascript:evil')`. + */ +export const secretToken = {}; +/** + * Asserts that the given token matches the secret safevalues token. An + * exception is thrown if that is not the case. + */ +export function ensureTokenIsValid(token) { + if (process.env.NODE_ENV !== 'production') { + if (token !== secretToken) { + throw new Error('Bad secret'); + } + } +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/string_literal.d.ts b/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/string_literal.d.ts new file mode 100644 index 0000000..be68cbc8 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/string_literal.d.ts
@@ -0,0 +1,14 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +/** + * An object of type TemplateStringsArray represents the literal part(s) of a + * template literal. This function checks if a TemplateStringsArray object is + * actually from a template literal. + * + * @param templateObj This contains the literal part of the template literal. + * @param hasExprs If true, the input template may contain embedded expressions. + * @param errorMsg The custom error message in case any checks fail. + */ +export declare function assertIsTemplateObject(templateObj: TemplateStringsArray, hasExprs: boolean, errorMsg: string): void;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/string_literal.js b/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/string_literal.js new file mode 100644 index 0000000..ea760bc0 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/string_literal.js
@@ -0,0 +1,23 @@ +"use strict"; +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.assertIsTemplateObject = void 0; +/** + * An object of type TemplateStringsArray represents the literal part(s) of a + * template literal. This function checks if a TemplateStringsArray object is + * actually from a template literal. + * + * @param templateObj This contains the literal part of the template literal. + * @param hasExprs If true, the input template may contain embedded expressions. + * @param errorMsg The custom error message in case any checks fail. + */ +function assertIsTemplateObject(templateObj, hasExprs, errorMsg) { + if (!Array.isArray(templateObj) || !Array.isArray(templateObj.raw) || + (!hasExprs && templateObj.length !== 1)) { + throw new TypeError(errorMsg); + } +} +exports.assertIsTemplateObject = assertIsTemplateObject;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/string_literal.mjs b/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/string_literal.mjs new file mode 100644 index 0000000..918d898 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/string_literal.mjs
@@ -0,0 +1,19 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +/** + * An object of type TemplateStringsArray represents the literal part(s) of a + * template literal. This function checks if a TemplateStringsArray object is + * actually from a template literal. + * + * @param templateObj This contains the literal part of the template literal. + * @param hasExprs If true, the input template may contain embedded expressions. + * @param errorMsg The custom error message in case any checks fail. + */ +export function assertIsTemplateObject(templateObj, hasExprs, errorMsg) { + if (!Array.isArray(templateObj) || !Array.isArray(templateObj.raw) || + (!hasExprs && templateObj.length !== 1)) { + throw new TypeError(errorMsg); + } +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/style_impl.d.ts b/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/style_impl.d.ts new file mode 100644 index 0000000..6e317e5 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/style_impl.d.ts
@@ -0,0 +1,27 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import '../environment/dev'; +/** + * Sequence of CSS declarations safe to use in style contexts in an HTML + * document or in DOM APIs. + */ +export declare abstract class SafeStyle { + private readonly brand; +} +/** + * Builds a new `SafeStyle` from the given string, without enforcing + * safety guarantees. This shouldn't be exposed to application developers, and + * must only be used as a step towards safe builders or safe constants. + */ +export declare function createStyle(style: string): SafeStyle; +/** + * Checks if the given value is a `SafeStyle` instance. + */ +export declare function isStyle(value: unknown): value is SafeStyle; +/** + * Returns the string value of the passed `SafeStyle` object while ensuring it + * has the correct type. + */ +export declare function unwrapStyle(value: SafeStyle): string;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/style_impl.js b/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/style_impl.js new file mode 100644 index 0000000..ae3ff41 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/style_impl.js
@@ -0,0 +1,81 @@ +"use strict"; +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.unwrapStyle = exports.isStyle = exports.createStyle = exports.SafeStyle = void 0; +require("../environment/dev"); +var secrets_1 = require("./secrets"); +/** + * Sequence of CSS declarations safe to use in style contexts in an HTML + * document or in DOM APIs. + */ +var SafeStyle = /** @class */ (function () { + function SafeStyle() { + } + return SafeStyle; +}()); +exports.SafeStyle = SafeStyle; +/** Implementation for `SafeStyle` */ +var StyleImpl = /** @class */ (function (_super) { + __extends(StyleImpl, _super); + function StyleImpl(style, token) { + var _this = _super.call(this) || this; + (0, secrets_1.ensureTokenIsValid)(token); + _this.privateDoNotAccessOrElseWrappedStyle = style; + return _this; + } + StyleImpl.prototype.toString = function () { + return this.privateDoNotAccessOrElseWrappedStyle; + }; + return StyleImpl; +}(SafeStyle)); +/** + * Builds a new `SafeStyle` from the given string, without enforcing + * safety guarantees. This shouldn't be exposed to application developers, and + * must only be used as a step towards safe builders or safe constants. + */ +function createStyle(style) { + return new StyleImpl(style, secrets_1.secretToken); +} +exports.createStyle = createStyle; +/** + * Checks if the given value is a `SafeStyle` instance. + */ +function isStyle(value) { + return value instanceof StyleImpl; +} +exports.isStyle = isStyle; +/** + * Returns the string value of the passed `SafeStyle` object while ensuring it + * has the correct type. + */ +function unwrapStyle(value) { + if (value instanceof StyleImpl) { + return value.privateDoNotAccessOrElseWrappedStyle; + } + else { + var message = ''; + if (process.env.NODE_ENV !== 'production') { + message = 'Unexpected type when unwrapping SafeStyle'; + } + throw new Error(message); + } +} +exports.unwrapStyle = unwrapStyle;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/style_impl.mjs b/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/style_impl.mjs new file mode 100644 index 0000000..4ec45e6 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/style_impl.mjs
@@ -0,0 +1,56 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import '../environment/dev'; +import { ensureTokenIsValid, secretToken } from './secrets'; +/** + * Sequence of CSS declarations safe to use in style contexts in an HTML + * document or in DOM APIs. + */ +export class SafeStyle { + // @ts-ignore: error TS6133: 'brand' is declared but its value is never read. + brand; // To prevent structural typing. +} +/** Implementation for `SafeStyle` */ +class StyleImpl extends SafeStyle { + privateDoNotAccessOrElseWrappedStyle; + constructor(style, token) { + super(); + ensureTokenIsValid(token); + this.privateDoNotAccessOrElseWrappedStyle = style; + } + toString() { + return this.privateDoNotAccessOrElseWrappedStyle; + } +} +/** + * Builds a new `SafeStyle` from the given string, without enforcing + * safety guarantees. This shouldn't be exposed to application developers, and + * must only be used as a step towards safe builders or safe constants. + */ +export function createStyle(style) { + return new StyleImpl(style, secretToken); +} +/** + * Checks if the given value is a `SafeStyle` instance. + */ +export function isStyle(value) { + return value instanceof StyleImpl; +} +/** + * Returns the string value of the passed `SafeStyle` object while ensuring it + * has the correct type. + */ +export function unwrapStyle(value) { + if (value instanceof StyleImpl) { + return value.privateDoNotAccessOrElseWrappedStyle; + } + else { + let message = ''; + if (process.env.NODE_ENV !== 'production') { + message = 'Unexpected type when unwrapping SafeStyle'; + } + throw new Error(message); + } +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/style_sheet_impl.d.ts b/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/style_sheet_impl.d.ts new file mode 100644 index 0000000..bb0ea70 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/style_sheet_impl.d.ts
@@ -0,0 +1,27 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import '../environment/dev'; +/** + * A complete CSS style sheet, safe to use in style contexts in an HTML document + * or DOM APIs. + */ +export declare abstract class SafeStyleSheet { + private readonly brand; +} +/** + * Builds a new `SafeStyleSheet` from the given string, without enforcing + * safety guarantees. This shouldn't be exposed to application developers, and + * must only be used as a step towards safe builders or safe constants. + */ +export declare function createStyleSheet(styleSheet: string): SafeStyleSheet; +/** + * Checks if the given value is a `SafeStyleSheet` instance. + */ +export declare function isStyleSheet(value: unknown): value is SafeStyleSheet; +/** + * Returns the string value of the passed `SafeStyleSheet` object while + * ensuring it has the correct type. + */ +export declare function unwrapStyleSheet(value: SafeStyleSheet): string;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/style_sheet_impl.js b/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/style_sheet_impl.js new file mode 100644 index 0000000..b54475f --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/style_sheet_impl.js
@@ -0,0 +1,81 @@ +"use strict"; +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +exports.unwrapStyleSheet = exports.isStyleSheet = exports.createStyleSheet = exports.SafeStyleSheet = void 0; +require("../environment/dev"); +var secrets_1 = require("./secrets"); +/** + * A complete CSS style sheet, safe to use in style contexts in an HTML document + * or DOM APIs. + */ +var SafeStyleSheet = /** @class */ (function () { + function SafeStyleSheet() { + } + return SafeStyleSheet; +}()); +exports.SafeStyleSheet = SafeStyleSheet; +/** Implementation for `SafeStyleSheet` */ +var StyleSheetImpl = /** @class */ (function (_super) { + __extends(StyleSheetImpl, _super); + function StyleSheetImpl(styleSheet, token) { + var _this = _super.call(this) || this; + (0, secrets_1.ensureTokenIsValid)(token); + _this.privateDoNotAccessOrElseWrappedStyleSheet = styleSheet; + return _this; + } + StyleSheetImpl.prototype.toString = function () { + return this.privateDoNotAccessOrElseWrappedStyleSheet; + }; + return StyleSheetImpl; +}(SafeStyleSheet)); +/** + * Builds a new `SafeStyleSheet` from the given string, without enforcing + * safety guarantees. This shouldn't be exposed to application developers, and + * must only be used as a step towards safe builders or safe constants. + */ +function createStyleSheet(styleSheet) { + return new StyleSheetImpl(styleSheet, secrets_1.secretToken); +} +exports.createStyleSheet = createStyleSheet; +/** + * Checks if the given value is a `SafeStyleSheet` instance. + */ +function isStyleSheet(value) { + return value instanceof StyleSheetImpl; +} +exports.isStyleSheet = isStyleSheet; +/** + * Returns the string value of the passed `SafeStyleSheet` object while + * ensuring it has the correct type. + */ +function unwrapStyleSheet(value) { + if (value instanceof StyleSheetImpl) { + return value.privateDoNotAccessOrElseWrappedStyleSheet; + } + else { + var message = ''; + if (process.env.NODE_ENV !== 'production') { + message = 'Unexpected type when unwrapping SafeStyleSheet'; + } + throw new Error(message); + } +} +exports.unwrapStyleSheet = unwrapStyleSheet;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/style_sheet_impl.mjs b/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/style_sheet_impl.mjs new file mode 100644 index 0000000..9c819ac --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/style_sheet_impl.mjs
@@ -0,0 +1,56 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import '../environment/dev'; +import { ensureTokenIsValid, secretToken } from './secrets'; +/** + * A complete CSS style sheet, safe to use in style contexts in an HTML document + * or DOM APIs. + */ +export class SafeStyleSheet { + // @ts-ignore: error TS6133: 'brand' is declared but its value is never read. + brand; // To prevent structural typing. +} +/** Implementation for `SafeStyleSheet` */ +class StyleSheetImpl extends SafeStyleSheet { + privateDoNotAccessOrElseWrappedStyleSheet; + constructor(styleSheet, token) { + super(); + ensureTokenIsValid(token); + this.privateDoNotAccessOrElseWrappedStyleSheet = styleSheet; + } + toString() { + return this.privateDoNotAccessOrElseWrappedStyleSheet; + } +} +/** + * Builds a new `SafeStyleSheet` from the given string, without enforcing + * safety guarantees. This shouldn't be exposed to application developers, and + * must only be used as a step towards safe builders or safe constants. + */ +export function createStyleSheet(styleSheet) { + return new StyleSheetImpl(styleSheet, secretToken); +} +/** + * Checks if the given value is a `SafeStyleSheet` instance. + */ +export function isStyleSheet(value) { + return value instanceof StyleSheetImpl; +} +/** + * Returns the string value of the passed `SafeStyleSheet` object while + * ensuring it has the correct type. + */ +export function unwrapStyleSheet(value) { + if (value instanceof StyleSheetImpl) { + return value.privateDoNotAccessOrElseWrappedStyleSheet; + } + else { + let message = ''; + if (process.env.NODE_ENV !== 'production') { + message = 'Unexpected type when unwrapping SafeStyleSheet'; + } + throw new Error(message); + } +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/trusted_types.d.ts b/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/trusted_types.d.ts new file mode 100644 index 0000000..fb5e7f1 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/trusted_types.d.ts
@@ -0,0 +1,21 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +/// <reference types="trusted-types" /> +/** + * Returns window.trustedTypes if Trusted Types are enabled and supported, or + * null otherwise. + */ +export declare function getTrustedTypes(): TrustedTypePolicyFactory | null; +/** + * Returns the Trusted Types policy used by TS safevalues, or null if Trusted + * Types are not enabled/supported. The first call to this function will + * create the policy. + */ +export declare function getTrustedTypesPolicy(): TrustedTypePolicy | null; +/** Helpers for tests. */ +export declare const TEST_ONLY: { + resetDefaults(): void; + setTrustedTypesPolicyName(name: string): void; +};
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/trusted_types.js b/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/trusted_types.js new file mode 100644 index 0000000..d2eb3bc --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/trusted_types.js
@@ -0,0 +1,73 @@ +"use strict"; +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TEST_ONLY = exports.getTrustedTypesPolicy = exports.getTrustedTypes = void 0; +/** + * The name of the Trusted Types policy used by TS safevalues, or empty + * to disable Trusted Types. This duplicates the 'google#safe', but + * can be overridden in tests. + */ +var trustedTypesPolicyName = 'google#safe'; +/** Helper to retrieve the value of `window.trustedTypes`. */ +function trustedTypes() { + if (typeof window !== 'undefined') { + return window.trustedTypes; + } + return undefined; +} +/** + * Returns window.trustedTypes if Trusted Types are enabled and supported, or + * null otherwise. + */ +function getTrustedTypes() { + var _a; + return (trustedTypesPolicyName !== '') ? ((_a = trustedTypes()) !== null && _a !== void 0 ? _a : null) : null; +} +exports.getTrustedTypes = getTrustedTypes; +/** + * The Trusted Types policy used by TS safevalues, or null if Trusted Types + * are not enabled/supported, or undefined if the policy has not been created + * yet. + */ +var trustedTypesPolicy; +/** + * Returns the Trusted Types policy used by TS safevalues, or null if Trusted + * Types are not enabled/supported. The first call to this function will + * create the policy. + */ +function getTrustedTypesPolicy() { + var _a, _b; + if (trustedTypesPolicy === undefined) { + try { + trustedTypesPolicy = + (_b = (_a = getTrustedTypes()) === null || _a === void 0 ? void 0 : _a.createPolicy(trustedTypesPolicyName, { + createHTML: function (s) { return s; }, + createScript: function (s) { return s; }, + createScriptURL: function (s) { return s; } + })) !== null && _b !== void 0 ? _b : null; + } + catch (_c) { + // In Chromium versions before 81, trustedTypes.createPolicy throws if + // called with a name that is already registered, even if no CSP is set. + // Until users have largely migrated to 81 or above, catch the error not + // to break the applications functionally. In such case, the code will + // fall back to using regular Safe Types. + trustedTypesPolicy = null; + } + } + return trustedTypesPolicy; +} +exports.getTrustedTypesPolicy = getTrustedTypesPolicy; +/** Helpers for tests. */ +exports.TEST_ONLY = { + resetDefaults: function () { + trustedTypesPolicy = undefined; + trustedTypesPolicyName = 'google#safe'; + }, + setTrustedTypesPolicyName: function (name) { + trustedTypesPolicyName = name; + }, +};
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/trusted_types.mjs b/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/trusted_types.mjs new file mode 100644 index 0000000..cf86d24f --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/internals/trusted_types.mjs
@@ -0,0 +1,67 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +/** + * The name of the Trusted Types policy used by TS safevalues, or empty + * to disable Trusted Types. This duplicates the 'google#safe', but + * can be overridden in tests. + */ +let trustedTypesPolicyName = 'google#safe'; +/** Helper to retrieve the value of `window.trustedTypes`. */ +function trustedTypes() { + if (typeof window !== 'undefined') { + return window.trustedTypes; + } + return undefined; +} +/** + * Returns window.trustedTypes if Trusted Types are enabled and supported, or + * null otherwise. + */ +export function getTrustedTypes() { + return (trustedTypesPolicyName !== '') ? (trustedTypes() ?? null) : null; +} +/** + * The Trusted Types policy used by TS safevalues, or null if Trusted Types + * are not enabled/supported, or undefined if the policy has not been created + * yet. + */ +let trustedTypesPolicy; +/** + * Returns the Trusted Types policy used by TS safevalues, or null if Trusted + * Types are not enabled/supported. The first call to this function will + * create the policy. + */ +export function getTrustedTypesPolicy() { + if (trustedTypesPolicy === undefined) { + try { + trustedTypesPolicy = + getTrustedTypes()?.createPolicy(trustedTypesPolicyName, { + createHTML: (s) => s, + createScript: (s) => s, + createScriptURL: (s) => s + }) ?? + null; + } + catch { + // In Chromium versions before 81, trustedTypes.createPolicy throws if + // called with a name that is already registered, even if no CSP is set. + // Until users have largely migrated to 81 or above, catch the error not + // to break the applications functionally. In such case, the code will + // fall back to using regular Safe Types. + trustedTypesPolicy = null; + } + } + return trustedTypesPolicy; +} +/** Helpers for tests. */ +export const TEST_ONLY = { + resetDefaults() { + trustedTypesPolicy = undefined; + trustedTypesPolicyName = 'google#safe'; + }, + setTrustedTypesPolicyName(name) { + trustedTypesPolicyName = name; + }, +};
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/package.json b/third_party/material_web_components/components-chromium/node_modules/safevalues/package.json new file mode 100644 index 0000000..eecb952 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/package.json
@@ -0,0 +1,62 @@ +{ + "name": "safevalues", + "version": "0.4.3", + "description": "Safe builders for Trusted Types values", + "repository": "https://github.com/google/safevalues", + "author": "ISE Hardening", + "license": "Apache-2.0", + "publishConfig":{ + "registry":"https://wombat-dressing-room.appspot.com" + }, + "main": "index.js", + "module": "index.mjs", + "types": "index.d.ts", + "exports": { + ".": { + "require": "./index.js", + "import": "./index.mjs", + "types": "./index.d.ts" + }, + "./restricted/*": { + "require": "./restricted/*.js", + "import": "./restricted/*.mjs", + "types": "./restricted/*.d.ts" + }, + "./dom": { + "require": "./dom/index.js", + "import": "./dom/index.mjs", + "types": "./dom/index.d.ts" + } + }, + "sideEffects": false, + "files": [ + "/index.*", + "/environment/*", + "/restricted/*", + "/internals/*", + "/builders/*", + "/dom/*" + ], + "scripts": { + "clean": "rm -rf ./dist", + "build": "yarn clean && yarn build:esm && yarn build:cjs", + "build:esm": "yarn && tsc -p ./tsconfig.esm.json", + "build:cjs": "yarn && tsc -p ./tsconfig.cjs.json", + "prepack": "yarn test && bash ./prepack.sh", + "test": "yarn build && karma start --browsers ChromeHeadless,FirefoxHeadless --single-run", + "itest": "yarn build && karma start --browsers ChromeHeadless,FirefoxHeadless" + }, + "devDependencies": { + "@types/jasmine": "^3.6.2", + "@types/node": "*", + "@types/trusted-types": "^1.0.6", + "jasmine-core": "^3.6.0", + "karma": "^6.3.17", + "karma-chrome-launcher": "^3.1.0", + "karma-firefox-launcher": "^2.1.2", + "karma-jasmine": "^4.0.1", + "karma-spec-reporter": "^0.0.32", + "karma-typescript": "^5.2.0", + "typescript": "^4.1.2" + } +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/restricted/legacy.d.ts b/third_party/material_web_components/components-chromium/node_modules/safevalues/restricted/legacy.d.ts new file mode 100644 index 0000000..fb068e6 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/restricted/legacy.d.ts
@@ -0,0 +1,40 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import '../environment/dev'; +import { SafeHtml } from '../internals/html_impl'; +import { TrustedResourceUrl } from '../internals/resource_url_impl'; +import { SafeScript } from '../internals/script_impl'; +import { SafeStyle } from '../internals/style_impl'; +import { SafeStyleSheet } from '../internals/style_sheet_impl'; +/** + * Turns a string into SafeHtml for legacy API purposes. + * + * Please read fileoverview documentation before using. + */ +export declare function legacyUnsafeHtml(s: string): SafeHtml; +/** + * Turns a string into SafeScript for legacy API purposes. + * + * Please read fileoverview documentation before using. + */ +export declare function legacyUnsafeScript(s: string): SafeScript; +/** + * Turns a string into TrustedResourceUrl for legacy API purposes. + * + * Please read fileoverview documentation before using. + */ +export declare function legacyUnsafeResourceUrl(s: string): TrustedResourceUrl; +/** + * Turns a string into SafeStyle for legacy API purposes. + * + * Please read fileoverview documentation before using. + */ +export declare function legacyUnsafeStyle(s: string): SafeStyle; +/** + * Turns a string into SafeStyleSheet for legacy API purposes. + * + * Please read fileoverview documentation before using. + */ +export declare function legacyUnsafeStyleSheet(s: string): SafeStyleSheet;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/restricted/legacy.js b/third_party/material_web_components/components-chromium/node_modules/safevalues/restricted/legacy.js new file mode 100644 index 0000000..4af8ab57 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/restricted/legacy.js
@@ -0,0 +1,121 @@ +"use strict"; +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.legacyUnsafeStyleSheet = exports.legacyUnsafeStyle = exports.legacyUnsafeResourceUrl = exports.legacyUnsafeScript = exports.legacyUnsafeHtml = void 0; +require("../environment/dev"); +var html_impl_1 = require("../internals/html_impl"); +var resource_url_impl_1 = require("../internals/resource_url_impl"); +var script_impl_1 = require("../internals/script_impl"); +var style_impl_1 = require("../internals/style_impl"); +var style_sheet_impl_1 = require("../internals/style_sheet_impl"); +/* + * Transitional utilities to unsafely trust random strings as + * safe values. Intended for temporary use when upgrading a library that + * used to accept plain strings to use safe values, but where it's not + * practical to transitively update callers. + * + * IMPORTANT: No new code should use the conversion functions in this file, + * they are intended for refactoring old code to use safe values. New code + * should construct safe values via their APIs, template systems or + * sanitizers. If that’s not possible it should use a reviewed conversion and + * undergo security review. + * + * The semantics of the legacy conversions are very + * different from the ones provided by reviewed conversions. The + * latter are for use in code where it has been established through manual + * security review that the value produced by a piece of code will always + * satisfy the SafeHtml contract (e.g., the output of a secure HTML sanitizer). + * In uses of legacy conversions, this guarantee is not given -- the + * value in question originates in unreviewed legacy code and there is no + * guarantee that it satisfies the SafeHtml contract. + * + * There are only three valid uses of legacy conversions: + * + * 1. Introducing a safe values version of a function which currently consumes + * string and passes that string to a DOM API which can execute script - and + * hence cause XSS - like innerHTML. For example, Dialog might expose a + * setContent method which takes a string and sets the innerHTML property of + * an element with it. In this case a setSafeHtmlContent function could be + * added, consuming SafeHtml instead of string. setContent could then internally + * use legacyUnsafeHtml to create a SafeHtml + * from string and pass the SafeHtml to a safe values consumer down the line. In + * this scenario, remember to document the use of legacyUnsafeHtml in the + * modified setContent and consider deprecating it as well. + * + * 2. Automated refactoring of application code which handles HTML as string + * but needs to call a function which only takes safe values types. For example, + * in the Dialog scenario from (1) an alternative option would be to refactor + * setContent to accept SafeHtml instead of string and then refactor + * all current callers to use legacy conversions to pass SafeHtml. This is + * generally preferable to (1) because it keeps the library clean of + * legacy conversions, and makes code sites in application code that are + * potentially vulnerable to XSS more apparent. + * + * 3. Old code which needs to call APIs which consume safe values types and for + * which it is prohibitively expensive to refactor to use these types. + * Generally, this is code where safety from XSS is either hopeless or + * unimportant. + */ +/** + * Turns a string into SafeHtml for legacy API purposes. + * + * Please read fileoverview documentation before using. + */ +function legacyUnsafeHtml(s) { + if (process.env.NODE_ENV !== 'production' && typeof s !== 'string') { + throw new Error('Expected a string'); + } + return (0, html_impl_1.createHtml)(s); +} +exports.legacyUnsafeHtml = legacyUnsafeHtml; +/** + * Turns a string into SafeScript for legacy API purposes. + * + * Please read fileoverview documentation before using. + */ +function legacyUnsafeScript(s) { + if (process.env.NODE_ENV !== 'production' && typeof s !== 'string') { + throw new Error('Expected a string'); + } + return (0, script_impl_1.createScript)(s); +} +exports.legacyUnsafeScript = legacyUnsafeScript; +/** + * Turns a string into TrustedResourceUrl for legacy API purposes. + * + * Please read fileoverview documentation before using. + */ +function legacyUnsafeResourceUrl(s) { + if (process.env.NODE_ENV !== 'production' && typeof s !== 'string') { + throw new Error('Expected a string'); + } + return (0, resource_url_impl_1.createResourceUrl)(s); +} +exports.legacyUnsafeResourceUrl = legacyUnsafeResourceUrl; +/** + * Turns a string into SafeStyle for legacy API purposes. + * + * Please read fileoverview documentation before using. + */ +function legacyUnsafeStyle(s) { + if (process.env.NODE_ENV !== 'production' && typeof s !== 'string') { + throw new Error('Expected a string'); + } + return (0, style_impl_1.createStyle)(s); +} +exports.legacyUnsafeStyle = legacyUnsafeStyle; +/** + * Turns a string into SafeStyleSheet for legacy API purposes. + * + * Please read fileoverview documentation before using. + */ +function legacyUnsafeStyleSheet(s) { + if (process.env.NODE_ENV !== 'production' && typeof s !== 'string') { + throw new Error('Expected a string'); + } + return (0, style_sheet_impl_1.createStyleSheet)(s); +} +exports.legacyUnsafeStyleSheet = legacyUnsafeStyleSheet;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/restricted/legacy.mjs b/third_party/material_web_components/components-chromium/node_modules/safevalues/restricted/legacy.mjs new file mode 100644 index 0000000..d3f7300 --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/restricted/legacy.mjs
@@ -0,0 +1,113 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import '../environment/dev'; +import { createHtml } from '../internals/html_impl'; +import { createResourceUrl } from '../internals/resource_url_impl'; +import { createScript } from '../internals/script_impl'; +import { createStyle } from '../internals/style_impl'; +import { createStyleSheet } from '../internals/style_sheet_impl'; +/* + * Transitional utilities to unsafely trust random strings as + * safe values. Intended for temporary use when upgrading a library that + * used to accept plain strings to use safe values, but where it's not + * practical to transitively update callers. + * + * IMPORTANT: No new code should use the conversion functions in this file, + * they are intended for refactoring old code to use safe values. New code + * should construct safe values via their APIs, template systems or + * sanitizers. If that’s not possible it should use a reviewed conversion and + * undergo security review. + * + * The semantics of the legacy conversions are very + * different from the ones provided by reviewed conversions. The + * latter are for use in code where it has been established through manual + * security review that the value produced by a piece of code will always + * satisfy the SafeHtml contract (e.g., the output of a secure HTML sanitizer). + * In uses of legacy conversions, this guarantee is not given -- the + * value in question originates in unreviewed legacy code and there is no + * guarantee that it satisfies the SafeHtml contract. + * + * There are only three valid uses of legacy conversions: + * + * 1. Introducing a safe values version of a function which currently consumes + * string and passes that string to a DOM API which can execute script - and + * hence cause XSS - like innerHTML. For example, Dialog might expose a + * setContent method which takes a string and sets the innerHTML property of + * an element with it. In this case a setSafeHtmlContent function could be + * added, consuming SafeHtml instead of string. setContent could then internally + * use legacyUnsafeHtml to create a SafeHtml + * from string and pass the SafeHtml to a safe values consumer down the line. In + * this scenario, remember to document the use of legacyUnsafeHtml in the + * modified setContent and consider deprecating it as well. + * + * 2. Automated refactoring of application code which handles HTML as string + * but needs to call a function which only takes safe values types. For example, + * in the Dialog scenario from (1) an alternative option would be to refactor + * setContent to accept SafeHtml instead of string and then refactor + * all current callers to use legacy conversions to pass SafeHtml. This is + * generally preferable to (1) because it keeps the library clean of + * legacy conversions, and makes code sites in application code that are + * potentially vulnerable to XSS more apparent. + * + * 3. Old code which needs to call APIs which consume safe values types and for + * which it is prohibitively expensive to refactor to use these types. + * Generally, this is code where safety from XSS is either hopeless or + * unimportant. + */ +/** + * Turns a string into SafeHtml for legacy API purposes. + * + * Please read fileoverview documentation before using. + */ +export function legacyUnsafeHtml(s) { + if (process.env.NODE_ENV !== 'production' && typeof s !== 'string') { + throw new Error('Expected a string'); + } + return createHtml(s); +} +/** + * Turns a string into SafeScript for legacy API purposes. + * + * Please read fileoverview documentation before using. + */ +export function legacyUnsafeScript(s) { + if (process.env.NODE_ENV !== 'production' && typeof s !== 'string') { + throw new Error('Expected a string'); + } + return createScript(s); +} +/** + * Turns a string into TrustedResourceUrl for legacy API purposes. + * + * Please read fileoverview documentation before using. + */ +export function legacyUnsafeResourceUrl(s) { + if (process.env.NODE_ENV !== 'production' && typeof s !== 'string') { + throw new Error('Expected a string'); + } + return createResourceUrl(s); +} +/** + * Turns a string into SafeStyle for legacy API purposes. + * + * Please read fileoverview documentation before using. + */ +export function legacyUnsafeStyle(s) { + if (process.env.NODE_ENV !== 'production' && typeof s !== 'string') { + throw new Error('Expected a string'); + } + return createStyle(s); +} +/** + * Turns a string into SafeStyleSheet for legacy API purposes. + * + * Please read fileoverview documentation before using. + */ +export function legacyUnsafeStyleSheet(s) { + if (process.env.NODE_ENV !== 'production' && typeof s !== 'string') { + throw new Error('Expected a string'); + } + return createStyleSheet(s); +}
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/restricted/reviewed.d.ts b/third_party/material_web_components/components-chromium/node_modules/safevalues/restricted/reviewed.d.ts new file mode 100644 index 0000000..fa23019c --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/restricted/reviewed.d.ts
@@ -0,0 +1,61 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import '../environment/dev'; +import { SafeHtml } from '../internals/html_impl'; +import { TrustedResourceUrl } from '../internals/resource_url_impl'; +import { SafeScript } from '../internals/script_impl'; +import { SafeStyle } from '../internals/style_impl'; +import { SafeStyleSheet } from '../internals/style_sheet_impl'; +/** + * Performs a "reviewed conversion" to SafeHtml from a plain string that is + * known to satisfy the SafeHtml type contract. + * + * IMPORTANT: Uses of this method must be carefully security-reviewed to ensure + * that the value of `html` satisfies the SafeHtml type contract in all + * possible program states. An appropriate `justification` must be provided + * explaining why this particular use of the function is safe. + */ +export declare function htmlSafeByReview(html: string, justification: string): SafeHtml; +/** + * Performs a "reviewed conversion" to SafeScript from a plain string that + * is known to satisfy the SafeScript type contract. + * + * IMPORTANT: Uses of this method must be carefully security-reviewed to ensure + * that the value of `script` satisfies the SafeScript type contract in + * all possible program states. An appropriate `justification` must be provided + * explaining why this particular use of the function is safe. + */ +export declare function scriptSafeByReview(script: string, justification: string): SafeScript; +/** + * Performs a "reviewed conversion" to TrustedResourceUrl from a plain string + * that is known to satisfy the SafeUrl type contract. + * + * IMPORTANT: Uses of this method must be carefully security-reviewed to ensure + * that the value of `url` satisfies the TrustedResourceUrl type + * contract in all possible program states. An appropriate `justification` must + * be provided explaining why this particular use of the function is safe. + */ +export declare function resourceUrlSafeByReview(url: string, justification: string): TrustedResourceUrl; +/** + * Performs a "reviewed conversion" to SafeStyle from a plain string that is + * known to satisfy the SafeStyle type contract. + * + * IMPORTANT: Uses of this method must be carefully security-reviewed to ensure + * that the value of `style` satisfies the SafeStyle type contract in all + * possible program states. An appropriate `justification` must be provided + * explaining why this particular use of the function is safe. + */ +export declare function styleSafeByReview(style: string, justification: string): SafeStyle; +/** + * Performs a "reviewed conversion" to SafeStyleSheet from a plain string that + * is known to satisfy the SafeStyleSheet type contract. + * + * IMPORTANT: Uses of this method must be carefully security-reviewed to ensure + * that the value of `stylesheet` satisfies the SafeStyleSheet type + * contract in all possible program states. An appropriate `justification` must + * be provided explaining why this particular use of the function is safe; this + * may include a security review ticket number. + */ +export declare function styleSheetSafeByReview(stylesheet: string, justification: string): SafeStyleSheet;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/restricted/reviewed.js b/third_party/material_web_components/components-chromium/node_modules/safevalues/restricted/reviewed.js new file mode 100644 index 0000000..b45ec9d --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/restricted/reviewed.js
@@ -0,0 +1,123 @@ +"use strict"; +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +Object.defineProperty(exports, "__esModule", { value: true }); +exports.styleSheetSafeByReview = exports.styleSafeByReview = exports.resourceUrlSafeByReview = exports.scriptSafeByReview = exports.htmlSafeByReview = void 0; +require("../environment/dev"); +var html_impl_1 = require("../internals/html_impl"); +var resource_url_impl_1 = require("../internals/resource_url_impl"); +var script_impl_1 = require("../internals/script_impl"); +var style_impl_1 = require("../internals/style_impl"); +var style_sheet_impl_1 = require("../internals/style_sheet_impl"); +/** + * Utilities to convert arbitrary strings to values of the various + * Safe HTML types, subject to security review. These are also referred to as + * "reviewed conversions". + * + * These functions are intended for use-cases that cannot be expressed using an + * existing safe API (such as a type's builder) and instead require custom code + * to produce values of a Safe HTML type. A security review is required to + * verify that the custom code is indeed guaranteed to produce values that + * satisfy the target type's security contract. + * + * Code using restricted conversions should be structured such that this + * property is straightforward to establish. In particular, correctness should + * only depend on the code immediately surrounding the reviewed conversion, and + * not on assumptions about values received from outside the enclosing function + * (or, at the most, the enclosing file). + */ +/** + * Asserts that the provided justification is valid (non-empty). Throws an + * exception if that is not the case. + */ +function assertValidJustification(justification) { + if (typeof justification !== 'string' || justification.trim() === '') { + var errMsg = 'Calls to uncheckedconversion functions must go through security review.'; + errMsg += ' A justification must be provided to capture what security' + + ' assumptions are being made.'; + throw new Error(errMsg); + } +} +/** + * Performs a "reviewed conversion" to SafeHtml from a plain string that is + * known to satisfy the SafeHtml type contract. + * + * IMPORTANT: Uses of this method must be carefully security-reviewed to ensure + * that the value of `html` satisfies the SafeHtml type contract in all + * possible program states. An appropriate `justification` must be provided + * explaining why this particular use of the function is safe. + */ +function htmlSafeByReview(html, justification) { + if (process.env.NODE_ENV !== 'production') { + assertValidJustification(justification); + } + return (0, html_impl_1.createHtml)(html); +} +exports.htmlSafeByReview = htmlSafeByReview; +/** + * Performs a "reviewed conversion" to SafeScript from a plain string that + * is known to satisfy the SafeScript type contract. + * + * IMPORTANT: Uses of this method must be carefully security-reviewed to ensure + * that the value of `script` satisfies the SafeScript type contract in + * all possible program states. An appropriate `justification` must be provided + * explaining why this particular use of the function is safe. + */ +function scriptSafeByReview(script, justification) { + if (process.env.NODE_ENV !== 'production') { + assertValidJustification(justification); + } + return (0, script_impl_1.createScript)(script); +} +exports.scriptSafeByReview = scriptSafeByReview; +/** + * Performs a "reviewed conversion" to TrustedResourceUrl from a plain string + * that is known to satisfy the SafeUrl type contract. + * + * IMPORTANT: Uses of this method must be carefully security-reviewed to ensure + * that the value of `url` satisfies the TrustedResourceUrl type + * contract in all possible program states. An appropriate `justification` must + * be provided explaining why this particular use of the function is safe. + */ +function resourceUrlSafeByReview(url, justification) { + if (process.env.NODE_ENV !== 'production') { + assertValidJustification(justification); + } + return (0, resource_url_impl_1.createResourceUrl)(url); +} +exports.resourceUrlSafeByReview = resourceUrlSafeByReview; +/** + * Performs a "reviewed conversion" to SafeStyle from a plain string that is + * known to satisfy the SafeStyle type contract. + * + * IMPORTANT: Uses of this method must be carefully security-reviewed to ensure + * that the value of `style` satisfies the SafeStyle type contract in all + * possible program states. An appropriate `justification` must be provided + * explaining why this particular use of the function is safe. + */ +function styleSafeByReview(style, justification) { + if (process.env.NODE_ENV !== 'production') { + assertValidJustification(justification); + } + return (0, style_impl_1.createStyle)(style); +} +exports.styleSafeByReview = styleSafeByReview; +/** + * Performs a "reviewed conversion" to SafeStyleSheet from a plain string that + * is known to satisfy the SafeStyleSheet type contract. + * + * IMPORTANT: Uses of this method must be carefully security-reviewed to ensure + * that the value of `stylesheet` satisfies the SafeStyleSheet type + * contract in all possible program states. An appropriate `justification` must + * be provided explaining why this particular use of the function is safe; this + * may include a security review ticket number. + */ +function styleSheetSafeByReview(stylesheet, justification) { + if (process.env.NODE_ENV !== 'production') { + assertValidJustification(justification); + } + return (0, style_sheet_impl_1.createStyleSheet)(stylesheet); +} +exports.styleSheetSafeByReview = styleSheetSafeByReview;
diff --git a/third_party/material_web_components/components-chromium/node_modules/safevalues/restricted/reviewed.mjs b/third_party/material_web_components/components-chromium/node_modules/safevalues/restricted/reviewed.mjs new file mode 100644 index 0000000..0c68e0a --- /dev/null +++ b/third_party/material_web_components/components-chromium/node_modules/safevalues/restricted/reviewed.mjs
@@ -0,0 +1,115 @@ +/** + * @license + * SPDX-License-Identifier: Apache-2.0 + */ +import '../environment/dev'; +import { createHtml } from '../internals/html_impl'; +import { createResourceUrl } from '../internals/resource_url_impl'; +import { createScript } from '../internals/script_impl'; +import { createStyle } from '../internals/style_impl'; +import { createStyleSheet } from '../internals/style_sheet_impl'; +/** + * Utilities to convert arbitrary strings to values of the various + * Safe HTML types, subject to security review. These are also referred to as + * "reviewed conversions". + * + * These functions are intended for use-cases that cannot be expressed using an + * existing safe API (such as a type's builder) and instead require custom code + * to produce values of a Safe HTML type. A security review is required to + * verify that the custom code is indeed guaranteed to produce values that + * satisfy the target type's security contract. + * + * Code using restricted conversions should be structured such that this + * property is straightforward to establish. In particular, correctness should + * only depend on the code immediately surrounding the reviewed conversion, and + * not on assumptions about values received from outside the enclosing function + * (or, at the most, the enclosing file). + */ +/** + * Asserts that the provided justification is valid (non-empty). Throws an + * exception if that is not the case. + */ +function assertValidJustification(justification) { + if (typeof justification !== 'string' || justification.trim() === '') { + let errMsg = 'Calls to uncheckedconversion functions must go through security review.'; + errMsg += ' A justification must be provided to capture what security' + + ' assumptions are being made.'; + throw new Error(errMsg); + } +} +/** + * Performs a "reviewed conversion" to SafeHtml from a plain string that is + * known to satisfy the SafeHtml type contract. + * + * IMPORTANT: Uses of this method must be carefully security-reviewed to ensure + * that the value of `html` satisfies the SafeHtml type contract in all + * possible program states. An appropriate `justification` must be provided + * explaining why this particular use of the function is safe. + */ +export function htmlSafeByReview(html, justification) { + if (process.env.NODE_ENV !== 'production') { + assertValidJustification(justification); + } + return createHtml(html); +} +/** + * Performs a "reviewed conversion" to SafeScript from a plain string that + * is known to satisfy the SafeScript type contract. + * + * IMPORTANT: Uses of this method must be carefully security-reviewed to ensure + * that the value of `script` satisfies the SafeScript type contract in + * all possible program states. An appropriate `justification` must be provided + * explaining why this particular use of the function is safe. + */ +export function scriptSafeByReview(script, justification) { + if (process.env.NODE_ENV !== 'production') { + assertValidJustification(justification); + } + return createScript(script); +} +/** + * Performs a "reviewed conversion" to TrustedResourceUrl from a plain string + * that is known to satisfy the SafeUrl type contract. + * + * IMPORTANT: Uses of this method must be carefully security-reviewed to ensure + * that the value of `url` satisfies the TrustedResourceUrl type + * contract in all possible program states. An appropriate `justification` must + * be provided explaining why this particular use of the function is safe. + */ +export function resourceUrlSafeByReview(url, justification) { + if (process.env.NODE_ENV !== 'production') { + assertValidJustification(justification); + } + return createResourceUrl(url); +} +/** + * Performs a "reviewed conversion" to SafeStyle from a plain string that is + * known to satisfy the SafeStyle type contract. + * + * IMPORTANT: Uses of this method must be carefully security-reviewed to ensure + * that the value of `style` satisfies the SafeStyle type contract in all + * possible program states. An appropriate `justification` must be provided + * explaining why this particular use of the function is safe. + */ +export function styleSafeByReview(style, justification) { + if (process.env.NODE_ENV !== 'production') { + assertValidJustification(justification); + } + return createStyle(style); +} +/** + * Performs a "reviewed conversion" to SafeStyleSheet from a plain string that + * is known to satisfy the SafeStyleSheet type contract. + * + * IMPORTANT: Uses of this method must be carefully security-reviewed to ensure + * that the value of `stylesheet` satisfies the SafeStyleSheet type + * contract in all possible program states. An appropriate `justification` must + * be provided explaining why this particular use of the function is safe; this + * may include a security review ticket number. + */ +export function styleSheetSafeByReview(stylesheet, justification) { + if (process.env.NODE_ENV !== 'production') { + assertValidJustification(justification); + } + return createStyleSheet(stylesheet); +}
diff --git a/third_party/material_web_components/lit_exports.js b/third_party/material_web_components/lit_exports.js index 46094b4..8d087b0 100644 --- a/third_party/material_web_components/lit_exports.js +++ b/third_party/material_web_components/lit_exports.js
@@ -23,3 +23,4 @@ export * from "./components-chromium/node_modules/lit/directives/unsafe-svg.js"; export * from "./components-chromium/node_modules/lit/directives/until.js"; export * from "./components-chromium/node_modules/lit/directives/when.js"; +export {literal} from "./components-chromium/node_modules/lit/static-html.js";
diff --git a/third_party/material_web_components/package-lock.json b/third_party/material_web_components/package-lock.json index 732955e..06b17b0 100644 --- a/third_party/material_web_components/package-lock.json +++ b/third_party/material_web_components/package-lock.json
@@ -8,7 +8,7 @@ "name": "chromium-material-web-components", "version": "1.0.0", "dependencies": { - "@material/web": "1.0.0-pre.2" + "@material/web": "1.0.0-pre.8" }, "devDependencies": { "acorn": "8.8.2", @@ -30,11 +30,12 @@ } }, "node_modules/@material/web": { - "version": "1.0.0-pre.2", - "resolved": "https://registry.npmjs.org/@material/web/-/web-1.0.0-pre.2.tgz", - "integrity": "sha512-Fq0zBNvLw6uZ1v9/ntZtEviuVA3+4ynt6No4s+VlpHlfvGGoS2BnGxWqx4pIPNuIxAUt0LIK19caFtuxdu4S2A==", + "version": "1.0.0-pre.8", + "resolved": "https://registry.npmjs.org/@material/web/-/web-1.0.0-pre.8.tgz", + "integrity": "sha512-CafOQw/C23SP1DlJVYDbs2Cm9Ct4QV7RxjxMBiWhaqlhqfDyXVpnZnKlTVzD5dVDKZyUu3vHsWK7Y/N8P66DYQ==", "dependencies": { "lit": "^2.3.0", + "safevalues": "^0.4.3", "tslib": "^2.4.0" } }, @@ -143,6 +144,11 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/safevalues": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/safevalues/-/safevalues-0.4.3.tgz", + "integrity": "sha512-pNCNTkx3xs7G5YJ/9CoeZZVUSPRjH0SEPM0QI5Z1FZRlLBviTFWlNKPs8PTvZvERV0gO7ie/t/Zc0S96JS4Xew==" + }, "node_modules/supports-preserve-symlinks-flag": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz", @@ -176,11 +182,12 @@ } }, "@material/web": { - "version": "1.0.0-pre.2", - "resolved": "https://registry.npmjs.org/@material/web/-/web-1.0.0-pre.2.tgz", - "integrity": "sha512-Fq0zBNvLw6uZ1v9/ntZtEviuVA3+4ynt6No4s+VlpHlfvGGoS2BnGxWqx4pIPNuIxAUt0LIK19caFtuxdu4S2A==", + "version": "1.0.0-pre.8", + "resolved": "https://registry.npmjs.org/@material/web/-/web-1.0.0-pre.8.tgz", + "integrity": "sha512-CafOQw/C23SP1DlJVYDbs2Cm9Ct4QV7RxjxMBiWhaqlhqfDyXVpnZnKlTVzD5dVDKZyUu3vHsWK7Y/N8P66DYQ==", "requires": { "lit": "^2.3.0", + "safevalues": "^0.4.3", "tslib": "^2.4.0" } }, @@ -269,6 +276,11 @@ "supports-preserve-symlinks-flag": "^1.0.0" } }, + "safevalues": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/safevalues/-/safevalues-0.4.3.tgz", + "integrity": "sha512-pNCNTkx3xs7G5YJ/9CoeZZVUSPRjH0SEPM0QI5Z1FZRlLBviTFWlNKPs8PTvZvERV0gO7ie/t/Zc0S96JS4Xew==" + }, "supports-preserve-symlinks-flag": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz",
diff --git a/third_party/material_web_components/package.json b/third_party/material_web_components/package.json index 115f329..ab73494 100644 --- a/third_party/material_web_components/package.json +++ b/third_party/material_web_components/package.json
@@ -3,7 +3,7 @@ "version": "1.0.0", "author": "calamity@chromium.org", "dependencies": { - "@material/web": "1.0.0-pre.2" + "@material/web": "1.0.0-pre.8" }, "devDependencies": { "acorn": "8.8.2",
diff --git a/tools/metrics/actions/actions.xml b/tools/metrics/actions/actions.xml index 749a183..62029d3f 100644 --- a/tools/metrics/actions/actions.xml +++ b/tools/metrics/actions/actions.xml
@@ -10198,13 +10198,6 @@ <description>The user tapped outside the in-product help bubble.</description> </action> -<action name="InProductHelp.Promos.BubbleClicked"> - <owner>collinbaker@chromium.org</owner> - <description> - The user clicked on an in-product help promo bubble. - </description> -</action> - <action name="InProductHelp.ShouldTriggerHelpUI.IPH" not_user_triggered="true"> <owner>dtrainor@chromium.org</owner> <owner>nyquist@chromium.org</owner>
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml index 0676259..c63d483 100644 --- a/tools/metrics/histograms/enums.xml +++ b/tools/metrics/histograms/enums.xml
@@ -36249,14 +36249,15 @@ <int value="1766" label="PASSWORDSPRIVATE_SHOWEXPORTEDFILEINSHELL"/> <int value="1767" label="FILEMANAGERPRIVATE_TOGGLEBULKPINNING"/> <int value="1768" label="SMARTCARDPROVIDERPRIVATE_REPORTCONNECTRESULT"/> - <int value="1769" label="SMARTCARDPROVIDERPRIVATE_REPORTDISCONNECTRESULT"/> + <int value="1769" + label="DELETED_SMARTCARDPROVIDERPRIVATE_REPORTDISCONNECTRESULT"/> <int value="1770" label="WMDESKSPRIVATE_GETDESKBYID"/> <int value="1771" label="AUTOFILLPRIVATE_ISVALIDIBAN"/> <int value="1772" label="ACCESSIBILITY_PRIVATE_ISLACROSPRIMARY"/> <int value="1773" label="POWER_REPORTACTIVITY"/> <int value="1774" label="PASSWORDSPRIVATE_CONTINUEIMPORT"/> <int value="1775" label="PASSWORDSPRIVATE_RESETIMPORTER"/> - <int value="1776" label="SMARTCARDPROVIDERPRIVATE_REPORTCANCELRESULT"/> + <int value="1776" label="SMARTCARDPROVIDERPRIVATE_REPORTPLAINRESULT"/> <int value="1777" label="RUNTIME_GETCONTEXTS"/> <int value="1778" label="OS_EVENTS_ISEVENTSUPPORTED"/> <int value="1779" label="OS_EVENTS_STARTCAPTURINGEVENTS"/> @@ -55947,14 +55948,6 @@ <int value="3" label="Invalid display classification"/> </enum> -<enum name="KidsExternalFetcherStatus"> - <int value="0" label="NoError"/> - <int value="1" label="AuthError"/> - <int value="2" label="HttpStatusOrNetError"/> - <int value="3" label="ParseError"/> - <int value="4" label="DataError"/> -</enum> - <enum name="KidsManagementURLCheckerResponseStatus"> <int value="0" label="Success"/> <int value="1" label="Network Error"/> @@ -61084,6 +61077,7 @@ <int value="-899393472" label="enable-new-app-menu-icon"/> <int value="-899334103" label="disable-fast-text-autosizing"/> <int value="-899265865" label="DismissNtpPromos:disabled"/> + <int value="-898653891" label="UseClientGmbInterface:disabled"/> <int value="-898594349" label="ash-enable-stable-overview-order"/> <int value="-898499262" label="ImprovedA2HS:enabled"/> <int value="-898005938" label="disable-pinch-virtual-viewport"/> @@ -63866,6 +63860,7 @@ <int value="588333474" label="OfflineIndicator:disabled"/> <int value="589394614" label="OmniboxSuggestionButtonRow:enabled"/> <int value="589924262" label="CryptAuthV2DeviceActivityStatus:enabled"/> + <int value="591007879" label="UseClientGmbInterface:enabled"/> <int value="592050831" label="disable-slimming-paint"/> <int value="593707592" label="disable-network-portal-notification"/> <int value="594756372" label="MyFilesVolume:disabled"/> @@ -100236,6 +100231,14 @@ <int value="4" label="No Parent Error"/> </enum> +<enum name="SupervisedUserProtoFetcherStatus"> + <int value="0" label="NoError"/> + <int value="1" label="AuthError"/> + <int value="2" label="HttpStatusOrNetError"/> + <int value="3" label="ParseError"/> + <int value="4" label="DataError"/> +</enum> + <enum name="SupervisedUserSafetyFilterResult"> <int value="100" label="LINK_ALLOWED">Link; Allowed as safe</int> <int value="101" label="TYPED_ALLOWED">Typed URL; Allowed as safe</int>
diff --git a/tools/metrics/histograms/metadata/accessibility/histograms.xml b/tools/metrics/histograms/metadata/accessibility/histograms.xml index 9964b1b..51210b36 100644 --- a/tools/metrics/histograms/metadata/accessibility/histograms.xml +++ b/tools/metrics/histograms/metadata/accessibility/histograms.xml
@@ -1872,6 +1872,11 @@ <histogram name="Accessibility.ScreenAI.LoadLibraryResult" enum="ScreenAILoadLibraryResult" expires_after="2023-11-30"> + <obsolete> + Deprecated in May 2023 and replaced with several boolean histograms for + different functionality initialization of the library. See + Accessibility.ScreenAI.*.Initialized + </obsolete> <owner>kyungjunlee@google.com</owner> <owner>chrome-a11y-core@google.com</owner> <summary> @@ -1926,6 +1931,22 @@ </summary> </histogram> +<histogram name="Accessibility.ScreenAI.{Step}.Initialized" + enum="BooleanSuccess" expires_after="2024-05-01"> + <owner>rhalavati@chromium.org</owner> + <owner>chrome-a11y-core@google.com</owner> + <summary> + Records if initialization of {Step} in Screen AI service was successful or + not. + </summary> + <token key="Step"> + <variant name="Library" summary="library general functionalities"/> + <variant name="MainContentExtraction" + summary="Main Content Extraction functionality"/> + <variant name="OCR" summary="OCR functionality"/> + </token> +</histogram> + <histogram name="Accessibility.VTTContainsStyleBlock" enum="BooleanEnabled" expires_after="2023-09-06"> <owner>evliu@google.com</owner>
diff --git a/tools/metrics/histograms/metadata/chromeos_settings/histograms.xml b/tools/metrics/histograms/metadata/chromeos_settings/histograms.xml index b076361..f23a820 100644 --- a/tools/metrics/histograms/metadata/chromeos_settings/histograms.xml +++ b/tools/metrics/histograms/metadata/chromeos_settings/histograms.xml
@@ -316,6 +316,19 @@ </summary> </histogram> +<histogram name="ChromeOS.Settings.NumUniqueSettingsChanged.DeviceLifetime" + units="Unique Setting(s) Changed" expires_after="2024-05-16"> + <owner>moteva@google.com</owner> + <owner>wesokuhara@google.com</owner> + <owner>cros-settings@google.com</owner> + <summary> + Records the total number of unique settings changed by a user over a + device's lifetime. It is triggered when the user closes the Settings app. It + will not record the number if the user did not make any new unique changes + in the session. + </summary> +</histogram> + <histogram name="ChromeOS.Settings.NumUniqueSettingsChanged.PerSession" units="UniqueChanges" expires_after="2024-05-15"> <owner>moteva@google.com</owner>
diff --git a/tools/metrics/histograms/metadata/feature_engagement/histograms.xml b/tools/metrics/histograms/metadata/feature_engagement/histograms.xml index 3665b9c..be907560 100644 --- a/tools/metrics/histograms/metadata/feature_engagement/histograms.xml +++ b/tools/metrics/histograms/metadata/feature_engagement/histograms.xml
@@ -417,78 +417,6 @@ <token key="IPHFeature" variants="IPHFeature"/> </histogram> -<histogram name="InProductHelp.Promos.IPH_ReopenTab.DismissedAt" - enum="ReopenTabPromoStepAtDismissal" expires_after="M76"> - <owner>collinbaker@chromium.org</owner> - <summary> - Last step of in-product help (IPH) for reopening tabs that user followed - before finishing the IPH flow or dismissing it early. Recorded when the IPH - flow is dismissed, which is at one of three possible times: when the promo - bubble times out, when the menu is closed after the user opens it for IPH, - or when the user opens the last closed tab. The last is considered a - success. - </summary> -</histogram> - -<histogram name="InProductHelp.Promos.Snooze.{IPHFeature}" units="SnoozeType" - expires_after="2021-11-21"> - <obsolete> - Expired since 2021-11. - </obsolete> - <owner>kerenzhu@chromium.org</owner> - <owner>collinbaker@chromium.org</owner> - <summary> - Record the number of first-time snoozes and repeating snoozes of an - in-product help bubble for {IPHFeature} when the user clicks the snooze - button. A snooze of an IPH that has been snoozed before is a repeating - snooze. - </summary> - <token key="IPHFeature" variants="IPHFeature"/> -</histogram> - -<histogram name="InProductHelp.Promos.SnoozeCountAtAcknowledge.{IPHFeature}" - units="times" expires_after="2021-11-21"> - <obsolete> - Expired since 2021-11. - </obsolete> - <owner>kerenzhu@chromium.org</owner> - <owner>collinbaker@chromium.org</owner> - <summary> - Record the number of previous snoozes when an in-product help bubble for - {IPHFeature} is dismissed because the acknowledge button is clicked. - </summary> - <token key="IPHFeature" variants="IPHFeature"/> -</histogram> - -<histogram name="InProductHelp.Promos.SnoozeCountAtFollow.{IPHFeature}" - units="times" expires_after="2021-11-21"> - <obsolete> - Expired since 2021-11. - </obsolete> - <owner>kerenzhu@chromium.org</owner> - <owner>collinbaker@chromium.org</owner> - <summary> - Record the number of previous snoozes when an in-product help bubble for - {IPHFeature} is dismissed because the user follows the promo, e.g. a - relevant control is clicked. - </summary> - <token key="IPHFeature" variants="IPHFeature"/> -</histogram> - -<histogram name="InProductHelp.Promos.SnoozeCountAtTrigger.{IPHFeature}" - units="times" expires_after="2021-11-21"> - <obsolete> - Expired since 2021-11. - </obsolete> - <owner>kerenzhu@chromium.org</owner> - <owner>collinbaker@chromium.org</owner> - <summary> - Record the number of previous snoozes when an in-product help bubble for - {IPHFeature} is triggered. - </summary> - <token key="IPHFeature" variants="IPHFeature"/> -</histogram> - <histogram name="InProductHelp.ShouldTriggerHelpUI.{IPHFeature}" enum="TriggerHelpUIResult" expires_after="2023-12-26"> <owner>nyquist@chromium.org</owner>
diff --git a/tools/metrics/histograms/metadata/page/histograms.xml b/tools/metrics/histograms/metadata/page/histograms.xml index 60f05ac3..e7b6c0a 100644 --- a/tools/metrics/histograms/metadata/page/histograms.xml +++ b/tools/metrics/histograms/metadata/page/histograms.xml
@@ -2417,7 +2417,7 @@ <histogram name="PageLoad.Internal.PaintTiming.LargestContentfulPaint.ContentType" - enum="LargestContentType" expires_after="2023-07-03"> + enum="LargestContentType" expires_after="2024-01-03"> <owner>iclelland@chromium.org</owner> <owner>speed-metrics-dev@chromium.org</owner> <summary> @@ -2430,7 +2430,7 @@ <histogram name="PageLoad.Internal.PaintTiming.LargestContentfulPaint.MainFrame.ContentType" - enum="LargestContentType" expires_after="2023-07-03"> + enum="LargestContentType" expires_after="2024-01-03"> <owner>iclelland@chromium.org</owner> <owner>speed-metrics-dev@chromium.org</owner> <summary>
diff --git a/tools/metrics/histograms/metadata/signin/histograms.xml b/tools/metrics/histograms/metadata/signin/histograms.xml index 96dfb9a..e57def5 100644 --- a/tools/metrics/histograms/metadata/signin/histograms.xml +++ b/tools/metrics/histograms/metadata/signin/histograms.xml
@@ -851,7 +851,7 @@ </histogram> <histogram name="Signin.ListFamilyMembersRequest.Status" - enum="KidsExternalFetcherStatus" expires_after="2023-11-01"> + enum="SupervisedUserProtoFetcherStatus" expires_after="2023-11-01"> <owner>tju@google.com</owner> <owner>chrome-kids-eng@google.com</owner> <summary>The status of the fetch to the Kids Management API.</summary>
diff --git a/tools/metrics/histograms/metadata/sync/histograms.xml b/tools/metrics/histograms/metadata/sync/histograms.xml index 10745dd..beb449c 100644 --- a/tools/metrics/histograms/metadata/sync/histograms.xml +++ b/tools/metrics/histograms/metadata/sync/histograms.xml
@@ -736,18 +736,6 @@ </summary> </histogram> -<histogram name="Sync.LocalDeviceInfoDeletionReuploaded" enum="Boolean" - expires_after="2023-06-30"> - <owner>rushans@google.com</owner> - <owner>treib@chromium.org</owner> - <component>Services>Sync</component> - <summary> - Recorded after receiving an incoming deletion of local DeviceInfo during - incremental update. Counts whether the local DeviceInfo is marked to be - reuploaded. - </summary> -</histogram> - <histogram name="Sync.ModelLoadManager.LoadModelsElapsedTime" units="ms" expires_after="2023-11-30"> <owner>ankushkush@google.com</owner>
diff --git a/tools/perf/core/perfetto_binary_roller/binary_deps.json b/tools/perf/core/perfetto_binary_roller/binary_deps.json index 2630bd2..9c9b5ae2 100644 --- a/tools/perf/core/perfetto_binary_roller/binary_deps.json +++ b/tools/perf/core/perfetto_binary_roller/binary_deps.json
@@ -5,24 +5,24 @@ "full_remote_path": "perfetto-luci-artifacts/v34.0/linux-arm64/trace_processor_shell" }, "win": { - "hash": "2755b8a2529155c021489066dc5545dd04703e1c", - "full_remote_path": "chromium-telemetry/perfetto_binaries/trace_processor_shell/win/ab5c58d254d434ec35022ff5c8dfa437ff34ac6d/trace_processor_shell.exe" + "hash": "af1b51ca274566e2379c03d3d7571efd8dd384d6", + "full_remote_path": "chromium-telemetry/perfetto_binaries/trace_processor_shell/win/603af5820895ff5b344fd8b2b7e90a5336f2de30/trace_processor_shell.exe" }, "linux_arm": { "hash": "336a42cb9ec3c417e13a97816271fec10cdf67e5", "full_remote_path": "perfetto-luci-artifacts/v34.0/linux-arm/trace_processor_shell" }, "mac": { - "hash": "03ad7f27cbcd7c584f3e73cbc094c5562769654e", - "full_remote_path": "chromium-telemetry/perfetto_binaries/trace_processor_shell/mac/ab5c58d254d434ec35022ff5c8dfa437ff34ac6d/trace_processor_shell" + "hash": "45cc12219a0d03b2443070a50363714515211d7d", + "full_remote_path": "chromium-telemetry/perfetto_binaries/trace_processor_shell/mac/603af5820895ff5b344fd8b2b7e90a5336f2de30/trace_processor_shell" }, "mac_arm64": { "hash": "c32364e05e22cdf82ee0866aedd11c0e2050809c", "full_remote_path": "perfetto-luci-artifacts/v34.0/mac-arm64/trace_processor_shell" }, "linux": { - "hash": "02b7b3c80951e4fda942d49484f36880cfeb2648", - "full_remote_path": "chromium-telemetry/perfetto_binaries/trace_processor_shell/linux/ab5c58d254d434ec35022ff5c8dfa437ff34ac6d/trace_processor_shell" + "hash": "a7bcd56700bd6b57a2749a1ce1d66fe128ba35c6", + "full_remote_path": "chromium-telemetry/perfetto_binaries/trace_processor_shell/linux/603af5820895ff5b344fd8b2b7e90a5336f2de30/trace_processor_shell" } }, "power_profile.sql": {
diff --git a/tools/traffic_annotation/summary/annotations.xml b/tools/traffic_annotation/summary/annotations.xml index a69bd07..83f7c37 100644 --- a/tools/traffic_annotation/summary/annotations.xml +++ b/tools/traffic_annotation/summary/annotations.xml
@@ -298,7 +298,7 @@ <item id="download_bitmap" added_in_milestone="98" content_hash_code="0632ef37" os_list="android" file_path="chrome/browser/share/bitmap_download_request.cc" /> <item id="permission_request_creator" added_in_milestone="98" content_hash_code="04629d73" os_list="android,chromeos,linux,windows" file_path="chrome/browser/supervised_user/child_accounts/permission_request_creator_apiary.cc" /> <item id="kids_chrome_management_client_classify_url" added_in_milestone="98" content_hash_code="003a8b30" os_list="android,chromeos,linux,windows" file_path="components/supervised_user/core/browser/kids_chrome_management_client.cc" /> - <item id="kids_chrome_management_list_family_members" added_in_milestone="106" content_hash_code="023f7fa9" os_list="android,chromeos,windows,linux" file_path="components/supervised_user/core/browser/kids_external_fetcher_config.cc" /> + <item id="kids_chrome_management_list_family_members" added_in_milestone="106" content_hash_code="023f7fa9" os_list="android,chromeos,windows,linux" file_path="components/supervised_user/core/browser/fetcher_config.cc" /> <item id="cached_image_fetcher" added_in_milestone="98" content_hash_code="06334a2d" os_list="android" file_path="components/image_fetcher/image_fetcher_bridge.cc" /> <item id="chrome_cast_discovery_api" added_in_milestone="98" content_hash_code="0502b792" os_list="linux,windows,chromeos" file_path="chrome/browser/media/router/discovery/access_code/access_code_cast_discovery_interface.cc" /> <item id="fedcm" added_in_milestone="98" content_hash_code="082197eb" os_list="linux,windows,chromeos,android" file_path="content/browser/webid/idp_network_request_manager.cc" />
diff --git a/ui/accessibility/ax_event_generator.h b/ui/accessibility/ax_event_generator.h index 791c1fe..b7549c3 100644 --- a/ui/accessibility/ax_event_generator.h +++ b/ui/accessibility/ax_event_generator.h
@@ -155,7 +155,9 @@ ~TargetedEvent(); const AXNodeID node_id; - const EventParams& event_params; + // This field is not a raw_ref<> because it was filtered by the rewriter + // for: #constexpr-ctor-field-initializer + RAW_PTR_EXCLUSION const EventParams& event_params; }; class AX_EXPORT Iterator {
diff --git a/ui/chromeos/file_manager_strings.grdp b/ui/chromeos/file_manager_strings.grdp index 732ad96..a3f8cbfe 100644 --- a/ui/chromeos/file_manager_strings.grdp +++ b/ui/chromeos/file_manager_strings.grdp
@@ -826,6 +826,9 @@ <message name="IDS_FILE_BROWSER_IN_PROGRESS_LABEL" desc="Syncing in progress label."> Syncing </message> + <message name="IDS_FILE_BROWSER_IN_PROGRESS_PERCENTAGE_LABEL" desc="Syncing in progress accessibility label, also indicating the syncing progress percentage."> + Syncing - <ph name="PERCENT">$1<ex>10</ex></ph>% + </message> <message name="IDS_FILE_BROWSER_DISMISS_LABEL" desc="Dismiss label."> Dismiss </message> @@ -838,6 +841,9 @@ <message name="IDS_FILE_BROWSER_SEARCH_TEXT_LABEL" desc="Search text field label."> Search </message> + <message name="IDS_FILE_BROWSER_SETTINGS_LABEL" translateable="false" desc="Settings label"> + Settings + </message> <message name="IDS_FILE_BROWSER_SEARCH_CLEAR_LABEL" desc="Label to clear search text field"> Clear </message>
diff --git a/ui/chromeos/file_manager_strings_grdp/IDS_FILE_BROWSER_IN_PROGRESS_PERCENTAGE_LABEL.png.sha1 b/ui/chromeos/file_manager_strings_grdp/IDS_FILE_BROWSER_IN_PROGRESS_PERCENTAGE_LABEL.png.sha1 new file mode 100644 index 0000000..2b87c103 --- /dev/null +++ b/ui/chromeos/file_manager_strings_grdp/IDS_FILE_BROWSER_IN_PROGRESS_PERCENTAGE_LABEL.png.sha1
@@ -0,0 +1 @@ +2dd0ccdf16bd1ac4e7c2e52da9d8375cceab2bbe \ No newline at end of file
diff --git a/ui/file_manager/file_manager/background/js/drive_sync_handler.js b/ui/file_manager/file_manager/background/js/drive_sync_handler.js index f5772da..f33c6e7 100644 --- a/ui/file_manager/file_manager/background/js/drive_sync_handler.js +++ b/ui/file_manager/file_manager/background/js/drive_sync_handler.js
@@ -4,7 +4,9 @@ import {NativeEventTarget as EventTarget} from 'chrome://resources/ash/common/event_target.js'; +import {getUniqueParents} from '../../common/js/api.js'; import {AsyncQueue, RateLimiter} from '../../common/js/async_util.js'; +import {VolumeEntry} from '../../common/js/files_app_entry_types.js'; import {notifications} from '../../common/js/notifications.js'; import {ProgressCenterItem, ProgressItemState, ProgressItemType} from '../../common/js/progress_center_common.js'; import {getFilesAppIconURL, toFilesAppURL} from '../../common/js/url_constants.js'; @@ -13,6 +15,7 @@ import {ProgressCenter} from '../../externs/background/progress_center.js'; import {DriveDialogControllerInterface} from '../../externs/drive_dialog_controller.js'; import {MetadataModelInterface} from '../../externs/metadata_model.js'; +import {getStore} from '../../state/store.js'; import {fileOperationUtil} from './file_operation_util.js'; @@ -306,7 +309,7 @@ * syncStates Updated file transfer statuses. * @private */ - updateSyncStateMetadata_(syncStates) { + async updateSyncStateMetadata_(syncStates) { if (!this.metadataModel_) { // Files app is still loading. This should have no user visible impact // since sync status update events are constantly emitted. @@ -314,48 +317,54 @@ } const completedUrls = []; - const valuesToUpdate = []; + const completedValues = []; + const urlsToUpdate = []; + const valuesToUpdate = []; for (const {fileUrl, syncStatus, progress} of syncStates) { - valuesToUpdate.push([syncStatus, progress]); - urlsToUpdate.push(fileUrl); - if (syncStatus === COMPLETED) { completedUrls.push(fileUrl); + completedValues.push([syncStatus, progress, Date.now()]); + } else { + urlsToUpdate.push(fileUrl); + valuesToUpdate.push([syncStatus, progress]); } } this.metadataModel_.update(urlsToUpdate, METADATA_KEYS, valuesToUpdate); - // Update filtered states that are completed now and, in 300ms, are still - // completed (i.e., haven't started syncing again) to "not_found". - if (completedUrls.length > 0) { - setTimeout(() => this.dismissCompletedEntries_(completedUrls), 300); - } - } - - /** - * Updates fileUrls that are still "completed" to "not_found". - * @param {!Array<!string>} fileUrls - * @private - */ - dismissCompletedEntries_(fileUrls) { - const stillCompletedUrls = []; - const valuesToUpdate = []; - - const metadata = - this.metadataModel_.getCacheByUrls(fileUrls, [SYNC_STATUS]); - for (let i = 0; i < metadata.length; i++) { - if (metadata[i].syncStatus === COMPLETED) { - stillCompletedUrls.push(fileUrls[i]); - valuesToUpdate.push( - [chrome.fileManagerPrivate.SyncStatus.NOT_FOUND, 0]); - } + if (!completedUrls.length) { + return; } this.metadataModel_.update( - stillCompletedUrls, METADATA_KEYS, valuesToUpdate); + completedUrls, + [ + ...METADATA_KEYS, + chrome.fileManagerPrivate.EntryPropertyName.SYNC_COMPLETED_TIME, + ], + completedValues); + + // Hold "completed" state for 300ms to give users a chance to see it. + await new Promise(r => setTimeout(r, 300)); + + const {allEntries} = getStore().getState(); + // Unwrap entries so they are accepted by the `MetadataModel.get()` method. + const completedEntries = completedUrls.map(url => allEntries[url]?.entry) + .filter(Boolean) + .map(util.unwrapEntry); + + if (!completedEntries.length) { + return; + } + + this.metadataModel_.notifyEntriesChanged(completedEntries); + this.metadataModel_.get(completedEntries, [ + ...METADATA_KEYS, + chrome.fileManagerPrivate.EntryPropertyName.AVAILABLE_OFFLINE, + chrome.fileManagerPrivate.EntryPropertyName.PINNED, + ]); } /** @@ -518,7 +527,7 @@ this.updateSyncStateMetadata_([ { fileUrl: event.fileUrl, - syncStatus: chrome.fileManagerPrivate.SyncStatus.ERROR, + syncStatus: chrome.fileManagerPrivate.SyncStatus.QUEUED, progress: 0, }, ]);
diff --git a/ui/file_manager/file_manager/containers/search_container_unittest.ts b/ui/file_manager/file_manager/containers/search_container_unittest.ts index 305279e3..c9d42d8 100644 --- a/ui/file_manager/file_manager/containers/search_container_unittest.ts +++ b/ui/file_manager/file_manager/containers/search_container_unittest.ts
@@ -2,6 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +import {loadTimeData} from 'chrome://resources/ash/common/load_time_data.m.js'; import {CrInputElement} from 'chrome://resources/cr_elements/cr_input/cr_input.js'; import {EntryLocation} from '../externs/entry_location.js'; @@ -58,7 +59,16 @@ volumeManager, searchWrapper, optionsContainer, pathContainer); } -export async function testQueryUpdated() { +/** + * Resets flags state. + */ +export function tearDown() { + loadTimeData.resetForTesting(); +} + +export async function testQueryUpdatedV1() { + loadTimeData.overrideValues({FILES_SEARCH_V2: false}); + // Test 1: Enter a query. const input = searchWrapper.querySelector('cr-input') as CrInputElement; input.value = 'hello'; @@ -86,3 +96,5 @@ return state.search; }); } + +// TODO(b:241868453): Add test for V2
diff --git a/ui/file_manager/file_manager/foreground/js/metadata/external_metadata_provider.js b/ui/file_manager/file_manager/foreground/js/metadata/external_metadata_provider.js index 5e932b3d..6449a79 100644 --- a/ui/file_manager/file_manager/foreground/js/metadata/external_metadata_provider.js +++ b/ui/file_manager/file_manager/foreground/js/metadata/external_metadata_provider.js
@@ -140,4 +140,5 @@ 'syncStatus', 'progress', 'shortcut', + 'syncCompletedTime', ];
diff --git a/ui/file_manager/file_manager/foreground/js/metadata/metadata_item.js b/ui/file_manager/file_manager/foreground/js/metadata/metadata_item.js index a92d238..4ab08763 100644 --- a/ui/file_manager/file_manager/foreground/js/metadata/metadata_item.js +++ b/ui/file_manager/file_manager/foreground/js/metadata/metadata_item.js
@@ -257,5 +257,12 @@ * @type {boolean|undefined} */ this.shortcut; + + /** + * Time in milliseconds since the epoch when the file last received a + * "completed" sync status. + * @type {number|undefined} + */ + this.syncCompletedTime; } }
diff --git a/ui/file_manager/file_manager/foreground/js/ui/file_grid.js b/ui/file_manager/file_manager/foreground/js/ui/file_grid.js index 043206f..3f5c0f6 100644 --- a/ui/file_manager/file_manager/foreground/js/ui/file_grid.js +++ b/ui/file_manager/file_manager/foreground/js/ui/file_grid.js
@@ -745,20 +745,19 @@ listItem = /** @type {!FileGrid.Item} */ (listItem); this.decorateThumbnailBox_(listItem, entry); this.updateSharedStatus_(listItem, entry); - const {availableOffline, pinned} = - this.metadataModel_.getCache( - [entry], ['availableOffline', 'pinned'])[0] || + const metadata = this.metadataModel_.getCache( + [entry], + [ + 'availableOffline', + 'pinned', + 'syncStatus', + 'progress', + ])[0] || {}; - const inlineStatus = listItem.querySelector('.inline-status'); - // Clear the inline status' aria label and set it to "in progress", - // "queued", or "available offline" with the respective order of - // precedence if applicable. - inlineStatus.removeAttribute('aria-label'); - listItem.classList.toggle('dim-offline', availableOffline === false); - listItem.classList.toggle('pinned', pinned); - inlineStatus.setAttribute( - 'aria-label', pinned ? str('OFFLINE_COLUMN_LABEL') : ''); - this.updateInlineSyncStatus_(listItem, entry); + listItem.classList.toggle( + 'dim-offline', metadata.availableOffline === false); + listItem.classList.toggle('pinned', metadata.pinned); + filelist.updateInlineStatus(listItem, metadata); listItem.toggleAttribute( 'disabled', filelist.isDlpBlocked( @@ -811,11 +810,18 @@ const bottom = li.ownerDocument.createElement('div'); bottom.className = 'thumbnail-bottom'; - const {contentMimeType, availableOffline, pinned, canPin} = - this.metadataModel_.getCache( - [entry], - ['contentMimeType', 'availableOffline', 'pinned', 'canPin'])[0] || + const metadata = this.metadataModel_.getCache( + [entry], + [ + 'contentMimeType', + 'availableOffline', + 'pinned', + 'canPin', + 'syncStatus', + 'progress', + ])[0] || {}; + const {contentMimeType, availableOffline, pinned, canPin} = metadata; const locationInfo = this.volumeManager_.getLocationInfo(entry); const detailIcon = filelist.renderFileTypeIcon( @@ -870,7 +876,7 @@ this.decorateThumbnailBox_(assertInstanceof(li, HTMLLIElement), entry); } this.updateSharedStatus_(li, entry); - this.updateInlineSyncStatus_(li, entry); + filelist.updateInlineStatus(li, metadata); } /** @@ -933,52 +939,6 @@ } /** - * Update sync status icon for file or directory entry. - * @param {!HTMLLIElement} li The grid item. - * @param {!Entry} entry File entry for the grid item. - * @private - */ - updateInlineSyncStatus_(li, entry) { - if (!util.isInlineSyncStatusEnabled()) { - return; - } - - const metadata = - this.metadataModel_.getCache([entry], ['syncStatus', 'progress'])[0]; - - if (!metadata) { - return; - } - - const {syncStatus} = metadata; - let progress = metadata.progress ?? 0; - const inlineStatus = li.querySelector('.inline-status'); - - if (!syncStatus || !inlineStatus) { - return; - } - - switch (syncStatus) { - case chrome.fileManagerPrivate.SyncStatus.QUEUED: - case chrome.fileManagerPrivate.SyncStatus.ERROR: - progress = 0; - inlineStatus.setAttribute('aria-label', str('QUEUED_LABEL')); - break; - case chrome.fileManagerPrivate.SyncStatus.IN_PROGRESS: - inlineStatus.setAttribute( - 'aria-label', - `${str('IN_PROGRESS_LABEL')} - ${(progress * 100).toFixed(0)}%`); - break; - default: - break; - } - - li.setAttribute('data-sync-status', syncStatus); - inlineStatus.querySelector('.progress') - .setAttribute('progress', progress.toFixed(2)); - } - - /** * Handles the splice event of the data model to change the view based on * whether image files is dominant or not in the directory. * @private
diff --git a/ui/file_manager/file_manager/foreground/js/ui/file_table.js b/ui/file_manager/file_manager/foreground/js/ui/file_table.js index ddec7bfe..6b31150 100644 --- a/ui/file_manager/file_manager/foreground/js/ui/file_table.js +++ b/ui/file_manager/file_manager/foreground/js/ui/file_table.js
@@ -1033,6 +1033,7 @@ 'pinned', 'syncStatus', 'progress', + 'syncCompletedTime', 'shortcut', 'canPin', ])[0],
diff --git a/ui/file_manager/file_manager/foreground/js/ui/file_table_list.js b/ui/file_manager/file_manager/foreground/js/ui/file_table_list.js index 35929b1..61f3fed 100644 --- a/ui/file_manager/file_manager/foreground/js/ui/file_table_list.js +++ b/ui/file_manager/file_manager/foreground/js/ui/file_table_list.js
@@ -11,6 +11,7 @@ import {VolumeManager} from '../../../externs/volume_manager.js'; import {FilesTooltip} from '../../elements/files_tooltip.js'; import {FileListModel} from '../file_list_model.js'; +import {MetadataItem} from '../metadata/metadata_item.js'; import {MetadataModel} from '../metadata/metadata_model.js'; import {A11yAnnounce} from './a11y_announce.js'; @@ -366,6 +367,7 @@ 'pinned', 'syncStatus', 'progress', + 'syncCompletedTime', 'contentMimeType', 'shortcut', 'canPin', @@ -535,7 +537,7 @@ * Updates grid item or table row for the externalProps. * @param {ListItem} li List item. * @param {Entry|FilesAppEntry} entry The entry. - * @param {Object} externalProps Metadata. + * @param {MetadataItem} externalProps Metadata. */ filelist.updateListItemExternalProps = (li, entry, externalProps, isTeamDriveRoot) => { @@ -571,63 +573,7 @@ 'external-media-root', !!externalProps.isExternalMedia); } - const inlineStatus = li.querySelector('.inline-status'); - if (!inlineStatus) { - return; - } - - if (util.isDriveFsBulkPinningEnabled()) { - const inlineIcon = inlineStatus.querySelector('xf-icon'); - - if (!util.isNullOrUndefined(externalProps.canPin) && - !externalProps.canPin) { - // Items that can't be pinned should show a dashed icon to indicate - // they cannot be used offline (e.g. google forms can't be made - // available offline). - li.classList.toggle('cant-pin', true); - inlineIcon.type = 'cant-pin'; - inlineStatus.setAttribute( - 'aria-label', str('DRIVE_ITEM_UNAVAILABLE_OFFLINE')); - return; - } - - // In the event a previous item that could not be pinned has instead - // become pinnable, ensure the inline status icon is reset and the class - // is removed. - li.classList.toggle('cant-pin', false); - inlineIcon.type = 'offline'; - } - - // Clear the inline status' aria label and set it to "in progress", - // "queued", or "available offline" with the respective order of - // precedence if applicable. - inlineStatus.setAttribute( - 'aria-label', - externalProps.pinned ? str('OFFLINE_COLUMN_LABEL') : ''); - - const {syncStatus} = externalProps; - let progress = externalProps.progress ?? 0; - if (util.isInlineSyncStatusEnabled() && syncStatus) { - switch (syncStatus) { - case chrome.fileManagerPrivate.SyncStatus.QUEUED: - case chrome.fileManagerPrivate.SyncStatus.ERROR: - progress = 0; - inlineStatus.setAttribute('aria-label', str('QUEUED_LABEL')); - break; - case chrome.fileManagerPrivate.SyncStatus.IN_PROGRESS: - inlineStatus.setAttribute( - 'aria-label', - `${str('IN_PROGRESS_LABEL')} - ${ - (progress * 100).toFixed(0)}%`); - break; - default: - break; - } - - li.setAttribute('data-sync-status', syncStatus); - li.querySelector('.progress') - .setAttribute('progress', progress.toFixed(2)); - } + filelist.updateInlineStatus(li, externalProps); }; /** @@ -1049,4 +995,99 @@ } }; +/** + * Update status icon for file or directory entry. + * @param {!HTMLLIElement} li The grid item. + * @param {?MetadataItem} metadata Metadata. + */ +filelist.updateInlineStatus = (li, metadata) => { + if (!metadata) { + return; + } + + const inlineStatus = li.querySelector('.inline-status'); + if (!inlineStatus) { + return; + } + // Clear the inline status' aria label and set it to "in progress", + // "queued", or "available offline" with the respective order of + // precedence if applicable. + inlineStatus.setAttribute( + 'aria-label', metadata.pinned ? str('OFFLINE_COLUMN_LABEL') : ''); + + if (util.isDriveFsBulkPinningEnabled()) { + const inlineIcon = inlineStatus.querySelector('xf-icon'); + + if (!util.isNullOrUndefined(metadata.canPin) && + !metadata.canPin) { + // Items that can't be pinned should show a dashed icon to indicate + // they cannot be used offline (e.g. google forms can't be made + // available offline). + li.classList.toggle('cant-pin', true); + inlineIcon.type = 'cant-pin'; + inlineStatus.setAttribute( + 'aria-label', str('DRIVE_ITEM_UNAVAILABLE_OFFLINE')); + return; + } + + // In the event a previous item that could not be pinned has instead + // become pinnable, ensure the inline status icon is reset and the class + // is removed. + li.classList.toggle('cant-pin', false); + inlineIcon.type = 'offline'; + } + + if (!util.isInlineSyncStatusEnabled()) { + return; + } + + let {syncStatus} = metadata; + let progress = metadata.progress ?? 0; + + if (!syncStatus) { + return; + } + + const {syncCompletedTime} = metadata; + + // Hold "completed" state for 300ms to give users a chance to see it. + if (syncCompletedTime && Date.now() - syncCompletedTime < 300) { + syncStatus = chrome.fileManagerPrivate.SyncStatus.COMPLETED; + progress = 1.0; + } + + switch (syncStatus) { + case chrome.fileManagerPrivate.SyncStatus.QUEUED: + case chrome.fileManagerPrivate.SyncStatus.ERROR: + progress = 0; + inlineStatus.setAttribute('aria-label', str('QUEUED_LABEL')); + break; + case chrome.fileManagerPrivate.SyncStatus.IN_PROGRESS: + inlineStatus.setAttribute( + 'aria-label', + strf('IN_PROGRESS_PERCENTAGE_LABEL', (progress * 100).toFixed(0))); + break; + case chrome.fileManagerPrivate.SyncStatus.NOT_FOUND: + // Files can have a sync status of "not_found" even though they + // are actually "queued". This can happen due to a delay in the + // "queued" status being communicated from DriveFS. In this case + // though, they would also be considered dirty (meaning they have + // unsynced changes so will eventually get queued for syncing). + // Hence, let's display a status "not_found" that is also "dirty" + // as "queued". + if (metadata.dirty) { + progress = 0; + syncStatus = chrome.fileManagerPrivate.SyncStatus.QUEUED; + inlineStatus.setAttribute('aria-label', str('QUEUED_LABEL')); + } + break; + default: + break; + } + + li.setAttribute('data-sync-status', syncStatus); + inlineStatus.querySelector('.progress') + .setAttribute('progress', progress.toFixed(2)); +}; + export {filelist};
diff --git a/ui/file_manager/file_manager/widgets/xf_bulk_pinning_dialog.ts b/ui/file_manager/file_manager/widgets/xf_bulk_pinning_dialog.ts index c2e39cc..bd3d402 100644 --- a/ui/file_manager/file_manager/widgets/xf_bulk_pinning_dialog.ts +++ b/ui/file_manager/file_manager/widgets/xf_bulk_pinning_dialog.ts
@@ -76,7 +76,7 @@ this.requiredBytes_ = bpp.requiredSpaceBytes; this.$readyFooter_.innerText = strf( 'BULK_PINNING_SPACE', util.bytesToString(this.requiredBytes_), - util.bytesToString(this.freeBytes_ - this.requiredBytes_)); + util.bytesToString(this.freeBytes_)); } if (bpp.stage === this.stage_) {
diff --git a/ui/file_manager/file_manager/widgets/xf_cloud_panel.ts b/ui/file_manager/file_manager/widgets/xf_cloud_panel.ts index 90f9ed8..580c83d 100644 --- a/ui/file_manager/file_manager/widgets/xf_cloud_panel.ts +++ b/ui/file_manager/file_manager/widgets/xf_cloud_panel.ts
@@ -218,6 +218,10 @@ function getCSS() { return css` + cr-action-menu { + --cr-menu-border-radius: 20px; + } + :host { position: absolute; right: 0px;
diff --git a/ui/gfx/render_text_unittest.cc b/ui/gfx/render_text_unittest.cc index bf57032..ca3e689 100644 --- a/ui/gfx/render_text_unittest.cc +++ b/ui/gfx/render_text_unittest.cc
@@ -4964,8 +4964,10 @@ RenderText* render_text = GetRenderText(); render_text->SetText(u"A quick brown fox jumped over the lazy dog!"); -#if BUILDFLAG(IS_APPLE) +#if BUILDFLAG(IS_MAC) const FontList body2_font = FontList().DeriveWithSizeDelta(-1); +#elif BUILDFLAG(IS_IOS) + const FontList body2_font = FontList().DeriveWithSizeDelta(-2); #else const FontList body2_font; #endif
diff --git a/ui/ozone/platform/wayland/host/wayland_cursor_factory.cc b/ui/ozone/platform/wayland/host/wayland_cursor_factory.cc index 9ab12b1..11b16255 100644 --- a/ui/ozone/platform/wayland/host/wayland_cursor_factory.cc +++ b/ui/ozone/platform/wayland/host/wayland_cursor_factory.cc
@@ -230,7 +230,8 @@ base::ThreadPool::PostTaskAndReplyWithResult( FROM_HERE, {base::MayBlock(), base::TaskShutdownBehavior::SKIP_ON_SHUTDOWN}, - base::BindOnce(wl_cursor_theme_load, name_.c_str(), GetCacheKey(), + base::BindOnce(wl_cursor_theme_load, + name_.empty() ? nullptr : name_.c_str(), GetCacheKey(), connection_->buffer_factory()->shm()), base::BindOnce(&WaylandCursorFactory::OnThemeLoaded, weak_factory_.GetWeakPtr(), name_, size_));
diff --git a/ui/webui/resources/cr_components/app_management/app_management.mojom b/ui/webui/resources/cr_components/app_management/app_management.mojom index 63843aa..3dc9993 100644 --- a/ui/webui/resources/cr_components/app_management/app_management.mojom +++ b/ui/webui/resources/cr_components/app_management/app_management.mojom
@@ -177,6 +177,9 @@ GetApps() => (array<App> apps); // Returns null if the app is not found. GetApp(string app_id) => (App? app); + // Maps app IDs to their parent apps' app ID. The return value omits apps + // that do not have a parent. + GetSubAppToParentMap() => (map<string, string> sub_app_to_parent_map); GetExtensionAppPermissionMessages(string app_id) => (array<ExtensionAppPermissionMessage> messages); // Pins or unpins for an app identified with `app_id`.
diff --git a/ui/webui/resources/cr_components/app_management/uninstall_button.ts b/ui/webui/resources/cr_components/app_management/uninstall_button.ts index f025c8e..e61394d6 100644 --- a/ui/webui/resources/cr_components/app_management/uninstall_button.ts +++ b/ui/webui/resources/cr_components/app_management/uninstall_button.ts
@@ -50,6 +50,7 @@ case InstallReason.kUnknown: case InstallReason.kOem: case InstallReason.kDefault: + case InstallReason.kSubApp: case InstallReason.kSync: case InstallReason.kUser: case InstallReason.kSubApp:
diff --git a/ui/webui/resources/cr_components/app_management/util.ts b/ui/webui/resources/cr_components/app_management/util.ts index 00795b4..f1272073 100644 --- a/ui/webui/resources/cr_components/app_management/util.ts +++ b/ui/webui/resources/cr_components/app_management/util.ts
@@ -17,22 +17,30 @@ interface AppManagementPageState { apps: Record<string, App>; selectedAppId: string|null; + // Maps all apps to their parent's app ID. Apps without a parent are + // not listed in this map. + subAppToParentAppId: Record<string, string>; } export function createEmptyState(): AppManagementPageState { return { apps: {}, selectedAppId: null, + subAppToParentAppId: {}, }; } -export function createInitialState(apps: App[]): AppManagementPageState { +export function createInitialState( + apps: App[], + subAppToParentAppId: {[key: string]: string}): AppManagementPageState { const initialState = createEmptyState(); for (const app of apps) { initialState.apps[app.id] = app; } + initialState.subAppToParentAppId = subAppToParentAppId; + return initialState; } @@ -82,6 +90,19 @@ } /** + * Returns a list of all apps whose parent's app ID matches the selected app. + */ +export function getSubAppsOfSelectedApp(state: AppManagementPageState): App[] { + const selectedAppId = state.selectedAppId; + const result = selectedAppId ? + Object.values(state.apps) + .filter( + (app) => state.subAppToParentAppId[app.id] === selectedAppId) : + []; + return result; +} + +/** * A comparator function to sort strings alphabetically. */ export function alphabeticalSort(a: string, b: string) {