New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@solid-primitives/mouse

Package Overview
Dependencies
Maintainers
3
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@solid-primitives/mouse - npm Package Compare versions

Comparing version 2.0.9 to 2.0.10

23

dist/index.js
import { makeEventListenerStack } from '@solid-primitives/event-listener';
import { clamp, createStaticStore } from '@solid-primitives/utils';
import { noop, clamp, createStaticStore } from '@solid-primitives/utils';
import { isServer } from 'solid-js/web';
import { createHydratableSingletonRoot } from '@solid-primitives/rootless';

@@ -24,2 +25,5 @@ import { createEffect, sharedConfig, onMount, createComputed } from 'solid-js';

function makeMousePositionListener(target = window, callback, options = {}) {
if (isServer) {
return noop;
}
const { touch = true, followTouch = true } = options;

@@ -42,2 +46,5 @@ const [listen, clear] = makeEventListenerStack(target, PASSIVE);

function makeMouseInsideListener(target = window, callback, options = {}) {
if (isServer) {
return noop;
}
const { touch = true } = options;

@@ -61,2 +68,5 @@ const [listen, clear] = makeEventListenerStack(target, PASSIVE);

var getPositionToElement = (pageX, pageY, el) => {
if (isServer) {
return DEFAULT_RELATIVE_ELEMENT_POSITION;
}
const bounds = el.getBoundingClientRect(), top = bounds.top + window.scrollY, left = bounds.left + window.scrollX, x = pageX - left, y = pageY - top, { width, height } = bounds;

@@ -74,2 +84,5 @@ return {

var getPositionInElement = (pageX, pageY, el) => {
if (isServer) {
return DEFAULT_RELATIVE_ELEMENT_POSITION;
}
const relative = getPositionToElement(pageX, pageY, el);

@@ -82,3 +95,3 @@ return {

};
var getPositionToScreen = (pageX, pageY) => ({
var getPositionToScreen = isServer ? () => DEFAULT_MOUSE_POSITION : (pageX, pageY) => ({
x: pageX - window.scrollX,

@@ -92,2 +105,5 @@ y: pageY - window.screenY

};
if (isServer) {
return fallback;
}
const [state, setState] = createStaticStore(fallback);

@@ -112,2 +128,5 @@ const attachListeners = (el) => {

};
if (isServer) {
return fallback;
}
const isFn = typeof element === "function";

@@ -114,0 +133,0 @@ const calcState = (el) => {

65

package.json
{
"name": "@solid-primitives/mouse",
"version": "2.0.9",
"version": "2.0.10",
"description": "A collection of Solid Primitives, that capture current mouse cursor position, and help to deal with common related usecases.",

@@ -24,52 +24,7 @@ "author": "Damian Tarnawski <gthetarnav@gmail.com>",

"type": "module",
"main": "./dist/server.cjs",
"module": "./dist/server.js",
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"browser": {
"./dist/server.js": "./dist/index.js",
"./dist/server.cjs": "./dist/index.cjs"
},
"browser": {},
"exports": {
"worker": {
"import": {
"types": "./dist/index.d.ts",
"default": "./dist/server.js"
},
"require": "./dist/server.cjs"
},
"browser": {
"development": {
"import": {
"types": "./dist/index.d.ts",
"default": "./dist/dev.js"
},
"require": "./dist/dev.cjs"
},
"import": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"require": "./dist/index.cjs"
},
"deno": {
"import": {
"types": "./dist/index.d.ts",
"default": "./dist/server.js"
},
"require": "./dist/server.cjs"
},
"node": {
"import": {
"types": "./dist/index.d.ts",
"default": "./dist/server.js"
},
"require": "./dist/server.cjs"
},
"development": {
"import": {
"types": "./dist/index.d.ts",
"default": "./dist/dev.js"
},
"require": "./dist/dev.cjs"
},
"import": {

@@ -92,11 +47,11 @@ "types": "./dist/index.d.ts",

"devDependencies": {
"@solid-primitives/raf": "^2.1.8"
"@solid-primitives/raf": "^2.1.9"
},
"dependencies": {
"@solid-primitives/event-listener": "^2.2.8",
"@solid-primitives/rootless": "^1.3.0",
"@solid-primitives/utils": "^5.5.0"
"@solid-primitives/event-listener": "^2.2.9",
"@solid-primitives/rootless": "^1.3.1",
"@solid-primitives/utils": "^5.5.1"
},
"peerDependencies": {
"solid-js": "^1.6.0"
"solid-js": "^1.6.12"
},

@@ -108,3 +63,3 @@ "typesVersions": {},

"page": "vite build dev",
"build": "jiti ../../scripts/build.ts --ssr --dev",
"build": "jiti ../../scripts/build.ts",
"test": "vitest -c ../../configs/vitest.config.ts",

@@ -111,0 +66,0 @@ "test:ssr": "pnpm run test --mode ssr",

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