Socket
Socket
Sign inDemoInstall

@material/ripple

Package Overview
Dependencies
7
Maintainers
14
Versions
1700
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 15.0.0-canary.311ab4d4a.0 to 15.0.0-canary.311f29a60.0

8

adapter.d.ts

@@ -40,6 +40,6 @@ /**

containsEventTarget(target: EventTarget | null): boolean;
registerInteractionHandler<K extends EventType>(evtType: K, handler: SpecificEventListener<K>): void;
deregisterInteractionHandler<K extends EventType>(evtType: K, handler: SpecificEventListener<K>): void;
registerDocumentInteractionHandler<K extends EventType>(evtType: K, handler: SpecificEventListener<K>): void;
deregisterDocumentInteractionHandler<K extends EventType>(evtType: K, handler: SpecificEventListener<K>): void;
registerInteractionHandler<K extends EventType>(eventType: K, handler: SpecificEventListener<K>): void;
deregisterInteractionHandler<K extends EventType>(eventType: K, handler: SpecificEventListener<K>): void;
registerDocumentInteractionHandler<K extends EventType>(eventType: K, handler: SpecificEventListener<K>): void;
deregisterDocumentInteractionHandler<K extends EventType>(eventType: K, handler: SpecificEventListener<K>): void;
registerResizeHandler(handler: SpecificEventListener<'resize'>): void;

@@ -46,0 +46,0 @@ deregisterResizeHandler(handler: SpecificEventListener<'resize'>): void;

@@ -6,4 +6,7 @@ # Change Log

# [15.0.0-canary.311ab4d4a.0](https://github.com/material-components/material-components-web/compare/v14.0.0...v15.0.0-canary.311ab4d4a.0) (2023-02-27)
# [15.0.0-canary.311f29a60.0](https://github.com/material-components/material-components-web/compare/v14.0.0...v15.0.0-canary.311f29a60.0) (2024-04-23)
**Note:** Version bump only for package @material/ripple
### Features
* **button:** Support state-layer-color theming for buttons and icon-buttons ([127a44b](https://github.com/material-components/material-components-web/commit/127a44b284698c40533b2e52cd0311ec689aa026))

@@ -56,7 +56,7 @@ /**

containsEventTarget: function (target) { return instance.root.contains(target); },
deregisterDocumentInteractionHandler: function (evtType, handler) {
document.documentElement.removeEventListener(evtType, handler, applyPassive());
deregisterDocumentInteractionHandler: function (eventType, handler) {
document.documentElement.removeEventListener(eventType, handler, applyPassive());
},
deregisterInteractionHandler: function (evtType, handler) {
instance.root.removeEventListener(evtType, handler, applyPassive());
deregisterInteractionHandler: function (eventType, handler) {
instance.root.removeEventListener(eventType, handler, applyPassive());
},

@@ -72,7 +72,7 @@ deregisterResizeHandler: function (handler) {

isUnbounded: function () { return Boolean(instance.unbounded); },
registerDocumentInteractionHandler: function (evtType, handler) {
document.documentElement.addEventListener(evtType, handler, applyPassive());
registerDocumentInteractionHandler: function (eventType, handler) {
document.documentElement.addEventListener(eventType, handler, applyPassive());
},
registerInteractionHandler: function (evtType, handler) {
instance.root.addEventListener(evtType, handler, applyPassive());
registerInteractionHandler: function (eventType, handler) {
instance.root.addEventListener(eventType, handler, applyPassive());
},

@@ -79,0 +79,0 @@ registerResizeHandler: function (handler) {

@@ -71,5 +71,5 @@ /**

/**
* @param evt Optional event containing position information.
* @param event Optional event containing position information.
*/
activate(evt?: Event): void;
activate(event?: Event): void;
deactivate(): void;

@@ -76,0 +76,0 @@ layout(): void;

@@ -169,6 +169,6 @@ /**

/**
* @param evt Optional event containing position information.
* @param event Optional event containing position information.
*/
MDCRippleFoundation.prototype.activate = function (evt) {
this.activateImpl(evt);
MDCRippleFoundation.prototype.activate = function (event) {
this.activateImpl(event);
};

@@ -237,4 +237,4 @@ MDCRippleFoundation.prototype.deactivate = function () {

for (var ACTIVATION_EVENT_TYPES_1 = __values(ACTIVATION_EVENT_TYPES), ACTIVATION_EVENT_TYPES_1_1 = ACTIVATION_EVENT_TYPES_1.next(); !ACTIVATION_EVENT_TYPES_1_1.done; ACTIVATION_EVENT_TYPES_1_1 = ACTIVATION_EVENT_TYPES_1.next()) {
var evtType = ACTIVATION_EVENT_TYPES_1_1.value;
this.adapter.registerInteractionHandler(evtType, this.activateHandler);
var eventType = ACTIVATION_EVENT_TYPES_1_1.value;
this.adapter.registerInteractionHandler(eventType, this.activateHandler);
}

@@ -256,5 +256,5 @@ }

};
MDCRippleFoundation.prototype.registerDeactivationHandlers = function (evt) {
MDCRippleFoundation.prototype.registerDeactivationHandlers = function (event) {
var e_2, _a;
if (evt.type === 'keydown') {
if (event.type === 'keydown') {
this.adapter.registerInteractionHandler('keyup', this.deactivateHandler);

@@ -265,4 +265,4 @@ }

for (var POINTER_DEACTIVATION_EVENT_TYPES_1 = __values(POINTER_DEACTIVATION_EVENT_TYPES), POINTER_DEACTIVATION_EVENT_TYPES_1_1 = POINTER_DEACTIVATION_EVENT_TYPES_1.next(); !POINTER_DEACTIVATION_EVENT_TYPES_1_1.done; POINTER_DEACTIVATION_EVENT_TYPES_1_1 = POINTER_DEACTIVATION_EVENT_TYPES_1.next()) {
var evtType = POINTER_DEACTIVATION_EVENT_TYPES_1_1.value;
this.adapter.registerDocumentInteractionHandler(evtType, this.deactivateHandler);
var eventType = POINTER_DEACTIVATION_EVENT_TYPES_1_1.value;
this.adapter.registerDocumentInteractionHandler(eventType, this.deactivateHandler);
}

@@ -283,4 +283,4 @@ }

for (var ACTIVATION_EVENT_TYPES_2 = __values(ACTIVATION_EVENT_TYPES), ACTIVATION_EVENT_TYPES_2_1 = ACTIVATION_EVENT_TYPES_2.next(); !ACTIVATION_EVENT_TYPES_2_1.done; ACTIVATION_EVENT_TYPES_2_1 = ACTIVATION_EVENT_TYPES_2.next()) {
var evtType = ACTIVATION_EVENT_TYPES_2_1.value;
this.adapter.deregisterInteractionHandler(evtType, this.activateHandler);
var eventType = ACTIVATION_EVENT_TYPES_2_1.value;
this.adapter.deregisterInteractionHandler(eventType, this.activateHandler);
}

@@ -306,4 +306,4 @@ }

for (var POINTER_DEACTIVATION_EVENT_TYPES_2 = __values(POINTER_DEACTIVATION_EVENT_TYPES), POINTER_DEACTIVATION_EVENT_TYPES_2_1 = POINTER_DEACTIVATION_EVENT_TYPES_2.next(); !POINTER_DEACTIVATION_EVENT_TYPES_2_1.done; POINTER_DEACTIVATION_EVENT_TYPES_2_1 = POINTER_DEACTIVATION_EVENT_TYPES_2.next()) {
var evtType = POINTER_DEACTIVATION_EVENT_TYPES_2_1.value;
this.adapter.deregisterDocumentInteractionHandler(evtType, this.deactivateHandler);
var eventType = POINTER_DEACTIVATION_EVENT_TYPES_2_1.value;
this.adapter.deregisterDocumentInteractionHandler(eventType, this.deactivateHandler);
}

@@ -329,3 +329,3 @@ }

};
MDCRippleFoundation.prototype.activateImpl = function (evt) {
MDCRippleFoundation.prototype.activateImpl = function (event) {
var _this = this;

@@ -342,4 +342,4 @@ if (this.adapter.isSurfaceDisabled()) {

var previousActivationEvent = this.previousActivationEvent;
var isSameInteraction = previousActivationEvent && evt !== undefined &&
previousActivationEvent.type !== evt.type;
var isSameInteraction = previousActivationEvent && event !== undefined &&
previousActivationEvent.type !== event.type;
if (isSameInteraction) {

@@ -349,10 +349,10 @@ return;

activationState.isActivated = true;
activationState.isProgrammatic = evt === undefined;
activationState.activationEvent = evt;
activationState.isProgrammatic = event === undefined;
activationState.activationEvent = event;
activationState.wasActivatedByPointer = activationState.isProgrammatic ?
false :
evt !== undefined &&
(evt.type === 'mousedown' || evt.type === 'touchstart' ||
evt.type === 'pointerdown');
var hasActivatedChild = evt !== undefined &&
event !== undefined &&
(event.type === 'mousedown' || event.type === 'touchstart' ||
event.type === 'pointerdown');
var hasActivatedChild = event !== undefined &&
activatedTargets.length > 0 &&

@@ -366,7 +366,7 @@ activatedTargets.some(function (target) { return _this.adapter.containsEventTarget(target); });

}
if (evt !== undefined) {
activatedTargets.push(evt.target);
this.registerDeactivationHandlers(evt);
if (event !== undefined) {
activatedTargets.push(event.target);
this.registerDeactivationHandlers(event);
}
activationState.wasElementMadeActive = this.checkElementMadeActive(evt);
activationState.wasElementMadeActive = this.checkElementMadeActive(event);
if (activationState.wasElementMadeActive) {

@@ -379,5 +379,5 @@ this.animateActivation();

activatedTargets = [];
if (!activationState.wasElementMadeActive && evt !== undefined &&
(evt.key === ' ' ||
evt.keyCode === 32)) {
if (!activationState.wasElementMadeActive && event !== undefined &&
(event.key === ' ' ||
event.keyCode === 32)) {
// If space was pressed, try again within an rAF call to detect :active,

@@ -391,3 +391,3 @@ // because different UAs report active states inconsistently when

// callback for a submit button interaction (#2241).
activationState.wasElementMadeActive = _this.checkElementMadeActive(evt);
activationState.wasElementMadeActive = _this.checkElementMadeActive(event);
if (activationState.wasElementMadeActive) {

@@ -403,4 +403,4 @@ _this.animateActivation();

};
MDCRippleFoundation.prototype.checkElementMadeActive = function (evt) {
return (evt !== undefined && evt.type === 'keydown') ?
MDCRippleFoundation.prototype.checkElementMadeActive = function (event) {
return (event !== undefined && event.type === 'keydown') ?
this.adapter.isSurfaceActive() :

@@ -407,0 +407,0 @@ true;

{
"name": "@material/ripple",
"description": "The Material Components for the web Ink Ripple effect for web element interactions",
"version": "15.0.0-canary.311ab4d4a.0",
"version": "15.0.0-canary.311f29a60.0",
"license": "MIT",

@@ -20,11 +20,11 @@ "keywords": [

"dependencies": {
"@material/animation": "15.0.0-canary.311ab4d4a.0",
"@material/base": "15.0.0-canary.311ab4d4a.0",
"@material/dom": "15.0.0-canary.311ab4d4a.0",
"@material/feature-targeting": "15.0.0-canary.311ab4d4a.0",
"@material/rtl": "15.0.0-canary.311ab4d4a.0",
"@material/theme": "15.0.0-canary.311ab4d4a.0",
"@material/animation": "15.0.0-canary.311f29a60.0",
"@material/base": "15.0.0-canary.311f29a60.0",
"@material/dom": "15.0.0-canary.311f29a60.0",
"@material/feature-targeting": "15.0.0-canary.311f29a60.0",
"@material/rtl": "15.0.0-canary.311f29a60.0",
"@material/theme": "15.0.0-canary.311f29a60.0",
"tslib": "^2.1.0"
},
"gitHead": "07f8d2f7bb4b2f30e60a6bd8739befd9d17bfbfc"
"gitHead": "7bc0264e163e842f0f96c1dbf7a468c022db1497"
}

@@ -167,6 +167,6 @@ <!--docs:

| `containsEventTarget(target: EventTarget) => boolean` | Whether or not the ripple surface contains the given event target |
| `registerInteractionHandler(evtType: string, handler: EventListener) => void` | Registers an event handler on the ripple surface |
| `deregisterInteractionHandler(evtType: string, handler: EventListener) => void` | Unregisters an event handler on the ripple surface |
| `registerDocumentInteractionHandler(evtType: string, handler: EventListener) => void` | Registers an event handler on the documentElement |
| `deregisterDocumentInteractionHandler(evtType: string, handler: EventListener) => void` | Unregisters an event handler on the documentElement |
| `registerInteractionHandler(eventType: string, handler: EventListener) => void` | Registers an event handler on the ripple surface |
| `deregisterInteractionHandler(eventType: string, handler: EventListener) => void` | Unregisters an event handler on the ripple surface |
| `registerDocumentInteractionHandler(eventType: string, handler: EventListener) => void` | Registers an event handler on the documentElement |
| `deregisterDocumentInteractionHandler(eventType: string, handler: EventListener) => void` | Unregisters an event handler on the documentElement |
| `registerResizeHandler(handler: Function) => void` | Registers a handler to be called when the ripple surface (or its viewport) resizes |

@@ -257,9 +257,9 @@ | `deregisterResizeHandler(handler: Function) => void` | Unregisters a handler to be called when the ripple surface (or its viewport) resizes |

this.active = false;
this.root.addEventListener('keydown', evt => {
if (isSpace(evt)) {
this.root.addEventListener('keydown', event => {
if (isSpace(event)) {
this.active = true;
}
});
this.root.addEventListener('keyup', evt => {
if (isSpace(evt)) {
this.root.addEventListener('keyup', event => {
if (isSpace(event)) {
this.active = false;

@@ -266,0 +266,0 @@ }

@@ -24,3 +24,5 @@ /**

import { MDCRipplePoint } from './types';
/** Checks if the window supports CSS Variables */
export declare function supportsCssVariables(windowObj: typeof globalThis, forceRefresh?: boolean): boolean;
export declare function getNormalizedEventCoords(evt: Event | undefined, pageOffset: MDCRipplePoint, clientRect: DOMRect): MDCRipplePoint;
/** Gets the normalized events coordinates */
export declare function getNormalizedEventCoords(event: Event | undefined, pageOffset: MDCRipplePoint, clientRect: DOMRect): MDCRipplePoint;
/**
* @license
* Copyright 2016 Google Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
/**
* Stores result from supportsCssVariables to avoid redundant processing to
* detect CSS custom variable support.
*/
var supportsCssVariables_;
var supportsCssVariablesCache;
/** Checks if the window supports CSS Variables */
export function supportsCssVariables(windowObj, forceRefresh) {
if (forceRefresh === void 0) { forceRefresh = false; }
var CSS = windowObj.CSS;
var supportsCssVars = supportsCssVariables_;
if (typeof supportsCssVariables_ === 'boolean' && !forceRefresh) {
return supportsCssVariables_;
var supportsCssVars = supportsCssVariablesCache;
if (typeof supportsCssVariablesCache === 'boolean' && !forceRefresh) {
return supportsCssVariablesCache;
}

@@ -24,8 +47,9 @@ var supportsFunctionPresent = CSS && typeof CSS.supports === 'function';

if (!forceRefresh) {
supportsCssVariables_ = supportsCssVars;
supportsCssVariablesCache = supportsCssVars;
}
return supportsCssVars;
}
export function getNormalizedEventCoords(evt, pageOffset, clientRect) {
if (!evt) {
/** Gets the normalized events coordinates */
export function getNormalizedEventCoords(event, pageOffset, clientRect) {
if (!event) {
return { x: 0, y: 0 };

@@ -39,4 +63,4 @@ }

// Determine touch point relative to the ripple container.
if (evt.type === 'touchstart') {
var touchEvent = evt;
if (event.type === 'touchstart') {
var touchEvent = event;
normalizedX = touchEvent.changedTouches[0].pageX - documentX;

@@ -46,3 +70,3 @@ normalizedY = touchEvent.changedTouches[0].pageY - documentY;

else {
var mouseEvent = evt;
var mouseEvent = event;
normalizedX = mouseEvent.pageX - documentX;

@@ -49,0 +73,0 @@ normalizedY = mouseEvent.pageY - documentY;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc