Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@smui/ripple

Package Overview
Dependencies
Maintainers
1
Versions
93
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@smui/ripple - npm Package Compare versions

Comparing version 8.0.0-beta.1 to 8.0.0-beta.2

11

CHANGELOG.md

@@ -6,2 +6,13 @@ # Change Log

# [8.0.0-beta.2](https://github.com/hperrin/svelte-material-ui/compare/v8.0.0-beta.1...v8.0.0-beta.2) (2024-12-13)
### Bug Fixes
* use svelte event on instead of addEventListener ([11b68e7](https://github.com/hperrin/svelte-material-ui/commit/11b68e7ffa75a87be6cb5b47dd2d92ab59763774))
# [8.0.0-beta.1](https://github.com/hperrin/svelte-material-ui/compare/v8.0.0-beta.0...v8.0.0-beta.1) (2024-12-11)

@@ -8,0 +19,0 @@

31

dist/Ripple.js
import { MDCRippleFoundation, util } from '@material/ripple';
import { events, ponyfill } from '@material/dom';
import { getContext } from 'svelte';
import { SvelteEventManager } from '@smui/common/internal';
const { applyPassive } = events;

@@ -8,2 +9,3 @@ const { matches } = ponyfill;

let instance;
let eventManager = new SvelteEventManager();
let addLayoutListener = getContext('SMUI:addLayoutListener');

@@ -52,15 +54,24 @@ let removeLayoutListener;

containsEventTarget: (target) => node.contains(target),
deregisterDocumentInteractionHandler: (evtType, handler) => document.documentElement.removeEventListener(evtType, handler, applyPassive()),
deregisterInteractionHandler: (evtType, handler) => (eventTarget || node).removeEventListener(evtType, handler, applyPassive()),
deregisterDocumentInteractionHandler: (evtType, handler) => eventManager.off(document.documentElement, evtType, handler),
deregisterInteractionHandler: (evtType, handler) => eventManager.off(eventTarget || node, evtType, handler),
deregisterResizeHandler: (handler) => window.removeEventListener('resize', handler),
getWindowPageOffset: () => ({
x: window.pageXOffset,
y: window.pageYOffset,
}),
getWindowPageOffset: () => {
var _a, _b;
return ({
x: (_a = window.pageXOffset) !== null && _a !== void 0 ? _a : window.scrollX,
y: (_b = window.pageYOffset) !== null && _b !== void 0 ? _b : window.scrollY,
});
},
isSurfaceActive: () => active == null ? matches(activeTarget || node, ':active') : active,
isSurfaceDisabled: () => !!disabled,
isUnbounded: () => !!unbounded,
registerDocumentInteractionHandler: (evtType, handler) => document.documentElement.addEventListener(evtType, handler, applyPassive()),
registerInteractionHandler: (evtType, handler) => (eventTarget || node).addEventListener(evtType, handler, applyPassive()),
registerResizeHandler: (handler) => window.addEventListener('resize', handler),
registerDocumentInteractionHandler: (evtType, handler) => {
const opts = applyPassive();
eventManager.on(document.documentElement, evtType, handler, typeof opts === 'boolean' ? { capture: opts } : opts);
},
registerInteractionHandler: (evtType, handler) => {
const opts = applyPassive();
eventManager.on(eventTarget || node, evtType, handler, typeof opts === 'boolean' ? { capture: opts } : opts);
},
registerResizeHandler: (handler) => eventManager.on(window, 'resize', handler),
removeClass,

@@ -81,2 +92,3 @@ updateCssVariable: addStyle,

instance = undefined;
eventManager.clear();
}

@@ -134,2 +146,3 @@ });

instance = undefined;
eventManager.clear();
removeClass('mdc-ripple-surface');

@@ -136,0 +149,0 @@ removeClass('smui-ripple-surface--primary');

{
"name": "@smui/ripple",
"version": "8.0.0-beta.1",
"version": "8.0.0-beta.2",
"description": "Svelte Material UI - Ripple",

@@ -53,3 +53,3 @@ "type": "module",

"@material/ripple": "^14.0.0",
"@smui/common": "^8.0.0-beta.1",
"@smui/common": "^8.0.0-beta.2",
"svelte2tsx": "^0.7.26"

@@ -64,3 +64,3 @@ },

},
"gitHead": "cf78a993fe276816e10dd5a3be86b8cfa333ea0e"
"gitHead": "cdb983378b3a26e5e745f3e250ad52636d2d761f"
}

@@ -5,2 +5,3 @@ import { MDCRippleFoundation, util } from '@material/ripple';

import type { AddLayoutListener, RemoveLayoutListener } from '@smui/common';
import { SvelteEventManager } from '@smui/common/internal';
const { applyPassive } = events;

@@ -45,2 +46,3 @@ const { matches } = ponyfill;

let instance: MDCRippleFoundation | undefined;
let eventManager = new SvelteEventManager();
let addLayoutListener = getContext<AddLayoutListener | undefined>(

@@ -92,18 +94,10 @@ 'SMUI:addLayoutListener',

deregisterDocumentInteractionHandler: (evtType, handler) =>
document.documentElement.removeEventListener(
evtType,
handler,
applyPassive(),
),
eventManager.off(document.documentElement, evtType, handler),
deregisterInteractionHandler: (evtType, handler) =>
(eventTarget || node).removeEventListener(
evtType,
handler,
applyPassive(),
),
eventManager.off(eventTarget || node, evtType, handler),
deregisterResizeHandler: (handler) =>
window.removeEventListener('resize', handler),
getWindowPageOffset: () => ({
x: window.pageXOffset,
y: window.pageYOffset,
x: window.pageXOffset ?? window.scrollX,
y: window.pageYOffset ?? window.scrollY,
}),

@@ -114,16 +108,22 @@ isSurfaceActive: () =>

isUnbounded: () => !!unbounded,
registerDocumentInteractionHandler: (evtType, handler) =>
document.documentElement.addEventListener(
registerDocumentInteractionHandler: (evtType, handler) => {
const opts = applyPassive();
eventManager.on(
document.documentElement,
evtType,
handler,
applyPassive(),
),
registerInteractionHandler: (evtType, handler) =>
(eventTarget || node).addEventListener(
typeof opts === 'boolean' ? { capture: opts } : opts,
);
},
registerInteractionHandler: (evtType, handler) => {
const opts = applyPassive();
eventManager.on(
eventTarget || node,
evtType,
handler,
applyPassive(),
),
typeof opts === 'boolean' ? { capture: opts } : opts,
);
},
registerResizeHandler: (handler) =>
window.addEventListener('resize', handler),
eventManager.on(window, 'resize', handler),
removeClass,

@@ -144,2 +144,3 @@ updateCssVariable: addStyle,

instance = undefined;
eventManager.clear();
}

@@ -222,2 +223,3 @@ });

instance = undefined;
eventManager.clear();
removeClass('mdc-ripple-surface');

@@ -224,0 +226,0 @@ removeClass('smui-ripple-surface--primary');

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc