Socket
Socket
Sign inDemoInstall

@chasi/ui

Package Overview
Dependencies
Maintainers
1
Versions
163
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@chasi/ui - npm Package Compare versions

Comparing version 0.2.71 to 0.2.72

49

dist/Actions/draggable.js

@@ -0,6 +1,30 @@

import { BROWSER } from 'esm-env';
import pannable from './pannable.js';
if (BROWSER) {
if (!document.querySelector('#draggable-styles')) {
const style = document.createElement('style');
style.setAttribute('id', 'draggable-styles');
style.innerHTML = `
[data-draggable-item].ghost {
position: fixed;
top: 0;
left: 0;
pointer-events: none;
transition: none;
z-index: 9999;
box-shadow: var(--shadow-4);
}
:where([data-draggable-item].dragged) {
opacity: 0;
transition: none !important;
animation: none !important;
pointer-events: none;
}`;
document.getElementsByTagName('head')[0].appendChild(style);
}
}
export default function (node, { onDrop, onMove, onStart, handlerSelector, duration = 250 }) {
let ghostElement = null;
createStyles();
const handler = handlerSelector ? node.querySelector(handlerSelector) : node;
node.setAttribute('data-draggable-item', '');
return pannable(node, {

@@ -62,24 +86,1 @@ onStart(e, coords) {

}
function createStyles() {
if (!document.querySelector('#draggable-styles')) {
const style = document.createElement('style');
style.setAttribute('id', 'draggable-styles');
style.innerHTML = `
.ghost {
position: fixed;
top: 0;
left: 0;
pointer-events: none;
transition: none;
z-index: 9999;
box-shadow: var(--shadow-4);
}
.dragged {
opacity: 0.5;
transition: none !important;
animation: none !important;
pointer-events: none;
}`;
document.getElementsByTagName('head')[0].appendChild(style);
}
}
{
"name": "@chasi/ui",
"version": "0.2.71",
"version": "0.2.72",
"bin": {

@@ -5,0 +5,0 @@ "gen-theme": "./dist/bin/theme.js"

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