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

@interactjs/auto-start

Package Overview
Dependencies
Maintainers
2
Versions
137
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@interactjs/auto-start - npm Package Compare versions

Comparing version 1.4.0-alpha.30 to 1.4.0-alpha.31

autoStart.spec.d.ts

9

base.d.ts
import * as utils from '@interactjs/utils';
declare type Scope = import('@interactjs/core/scope').Scope;
declare module '@interactjs/interact/interact' {

@@ -31,11 +30,11 @@ interface InteractStatic {

withinInteractionLimit: typeof withinInteractionLimit;
cursorElement: Element;
cursorElement: HTMLElement;
signals: utils.Signals;
}
declare function install(scope: Scope): void;
declare function install(scope: Interact.Scope): void;
declare function validateAction(action: any, interactable: any, element: any, eventTarget: any, scope: any): {
[index: string]: any;
};
declare function withinInteractionLimit(interactable: any, element: any, action: any, scope: any): boolean;
declare function maxInteractions(newValue: any, scope: any): any;
declare function withinInteractionLimit(interactable: Interact.Interactable, element: Element, action: any, scope: Interact.Scope): boolean;
declare function maxInteractions(newValue: any, scope: Interact.Scope): any;
declare const _default: {

@@ -42,0 +41,0 @@ install: typeof install;

@@ -5,3 +5,3 @@ import * as utils from '@interactjs/utils';

const { interact, interactions, defaults, } = scope;
interact.use(InteractableMethods);
InteractableMethods.install(scope);
// set cursor style on mousedown

@@ -34,11 +34,11 @@ interactions.signals.on('down', ({ interaction, pointer, event, eventTarget }) => {

scope.autoStart.signals.fire('before-start', arg);
const target = interaction.interactable;
if (interaction.prepared.name && target) {
const { interactable } = interaction;
if (interaction.prepared.name && interactable) {
// check manualStart and interaction limit
if (target.options[interaction.prepared.name].manualStart ||
!withinInteractionLimit(target, interaction.element, interaction.prepared, scope)) {
if (interactable.options[interaction.prepared.name].manualStart ||
!withinInteractionLimit(interactable, interaction.element, interaction.prepared, scope)) {
interaction.stop();
}
else {
interaction.start(interaction.prepared, target, interaction.element);
interaction.start(interaction.prepared, interactable, interaction.element);
}

@@ -48,4 +48,4 @@ }

interactions.signals.on('stop', ({ interaction }) => {
const target = interaction.interactable;
if (target && target.options.styleCursor) {
const { interactable } = interaction;
if (interactable && interactable.options.styleCursor) {
setCursor(interaction.element, '', scope);

@@ -77,3 +77,3 @@ }

*/
interact /* FIXME */.maxInteractions = (newValue) => maxInteractions(newValue, scope);
interact.maxInteractions = (newValue) => maxInteractions(newValue, scope);
scope.autoStart = {

@@ -87,3 +87,3 @@ // Allow this many interactions to happen simultaneously

}
// Check if the current target supports the action.
// Check if the current interactable supports the action.
// If so, return the validated action. Otherwise, return null

@@ -107,3 +107,3 @@ function validateAction(action, interactable, element, eventTarget, scope) {

action,
target: match,
interactable: match,
element: matchElement,

@@ -113,3 +113,3 @@ };

}
return { action: null, target: null, element: null };
return { action: null, interactable: null, element: null };
}

@@ -130,3 +130,3 @@ function getActionInfo(interaction, pointer, event, eventTarget, scope) {

if (actionInfo.action &&
!actionInfo.target.options[actionInfo.action.name].manualStart) {
!actionInfo.interactable.options[actionInfo.action.name].manualStart) {
return actionInfo;

@@ -136,5 +136,5 @@ }

}
return { action: null, target: null, element: null };
return { action: null, interactable: null, element: null };
}
function prepare(interaction, { action, target, element }, scope) {
function prepare(interaction, { action, interactable, element }, scope) {
action = action || {};

@@ -144,6 +144,9 @@ if (interaction.interactable && interaction.interactable.options.styleCursor) {

}
interaction.interactable = target;
interaction.interactable = interactable;
interaction.element = element;
utils.copyAction(interaction.prepared, action);
if (target && target.options.styleCursor) {
interaction.rect = interactable && action.name
? interactable.getRect(element)
: null;
if (interactable && interactable.options.styleCursor) {
const cursor = action ? scope.actions[action.name].getCursor(action) : '';

@@ -160,4 +163,4 @@ setCursor(interaction.element, cursor, scope);

let activeInteractions = 0;
let targetCount = 0;
let targetElementCount = 0;
let interactableCount = 0;
let elementCount = 0;
// no actions if any of these values == 0

@@ -179,9 +182,9 @@ if (!(maxActions && maxPerElement && autoStartMax)) {

}
targetCount += otherAction === action.name ? 1 : 0;
if (targetCount >= maxActions) {
interactableCount += otherAction === action.name ? 1 : 0;
if (interactableCount >= maxActions) {
return false;
}
if (interaction.element === element) {
targetElementCount++;
if (otherAction === action.name && targetElementCount >= maxPerElement) {
elementCount++;
if (otherAction === action.name && elementCount >= maxPerElement) {
return false;

@@ -214,2 +217,2 @@ }

};
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmFzZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImJhc2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLEtBQUssTUFBTSxtQkFBbUIsQ0FBQTtBQUMxQyxPQUFPLG1CQUFtQixNQUFNLHVCQUF1QixDQUFBO0FBMkN2RCxTQUFTLE9BQU8sQ0FBRSxLQUFZO0lBQzVCLE1BQU0sRUFDSixRQUFRLEVBQ1IsWUFBWSxFQUNaLFFBQVEsR0FDVCxHQUFHLEtBQUssQ0FBQTtJQUVULFFBQVEsQ0FBQyxHQUFHLENBQUMsbUJBQW1CLENBQUMsQ0FBQTtJQUVqQyxnQ0FBZ0M7SUFDaEMsWUFBWSxDQUFDLE9BQU8sQ0FBQyxFQUFFLENBQUMsTUFBTSxFQUFFLENBQUMsRUFBRSxXQUFXLEVBQUUsT0FBTyxFQUFFLEtBQUssRUFBRSxXQUFXLEVBQUUsRUFBRSxFQUFFO1FBQy9FLElBQUksV0FBVyxDQUFDLFdBQVcsRUFBRSxFQUFFO1lBQUUsT0FBTTtTQUFFO1FBRXpDLE1BQU0sVUFBVSxHQUFHLGFBQWEsQ0FBQyxXQUFXLEVBQUUsT0FBTyxFQUFFLEtBQUssRUFBRSxXQUFXLEVBQUUsS0FBSyxDQUFDLENBQUE7UUFDakYsT0FBTyxDQUFDLFdBQVcsRUFBRSxVQUFVLEVBQUUsS0FBSyxDQUFDLENBQUE7SUFDekMsQ0FBQyxDQUFDLENBQUE7SUFFRixnQ0FBZ0M7SUFDaEMs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kpIHtcbiAgICBzY29wZS5hdXRvU3RhcnQubWF4SW50ZXJhY3Rpb25zID0gbmV3VmFsdWVcblxuICAgIHJldHVybiB0aGlzXG4gIH1cblxuICByZXR1cm4gc2NvcGUuYXV0b1N0YXJ0Lm1heEludGVyYWN0aW9uc1xufVxuXG5mdW5jdGlvbiBzZXRDdXJzb3IgKGVsZW1lbnQ6IEhUTUxFbGVtZW50LCBjdXJzb3IsIHNjb3BlOiBJbnRlcmFjdC5TY29wZSkge1xuICBpZiAoc2NvcGUuYXV0b1N0YXJ0LmN1cnNvckVsZW1lbnQpIHtcbiAgICBzY29wZS5hdXRvU3RhcnQuY3Vyc29yRWxlbWVudC5zdHlsZS5jdXJzb3IgPSAnJ1xuICB9XG5cbiAgZWxlbWVudC5vd25lckRvY3VtZW50LmRvY3VtZW50RWxlbWVudC5zdHlsZS5jdXJzb3IgPSBjdXJzb3JcbiAgZWxlbWVudC5zdHlsZS5jdXJzb3IgPSBjdXJzb3JcbiAgc2NvcGUuYXV0b1N0YXJ0LmN1cnNvckVsZW1lbnQgPSBjdXJzb3IgPyBlbGVtZW50IDogbnVsbFxufVxuXG5leHBvcnQgZGVmYXVsdCB7XG4gIGluc3RhbGwsXG4gIG1heEludGVyYWN0aW9ucyxcbiAgd2l0aGluSW50ZXJhY3Rpb25MaW1pdCxcbiAgdmFsaWRhdGVBY3Rpb24sXG59XG4iXX0=
{
"name": "@interactjs/auto-start",
"version": "1.4.0-alpha.30+sha.bdc493e",
"version": "1.4.0-alpha.31+sha.6f00f8c",
"peerDependencies": {
"@interactjs/core": "1.4.0-alpha.30+sha.bdc493e",
"@interactjs/utils": "1.4.0-alpha.30+sha.bdc493e"
"@interactjs/core": "1.4.0-alpha.31+sha.6f00f8c",
"@interactjs/utils": "1.4.0-alpha.31+sha.6f00f8c"
},
"devDependencies": {
"@interactjs/_dev": "1.4.0-alpha.30+sha.bdc493e",
"@interactjs/core": "1.4.0-alpha.30+sha.bdc493e",
"@interactjs/utils": "1.4.0-alpha.30+sha.bdc493e"
"@interactjs/_dev": "1.4.0-alpha.31+sha.6f00f8c",
"@interactjs/actions": "1.4.0-alpha.31+sha.6f00f8c",
"@interactjs/core": "1.4.0-alpha.31+sha.6f00f8c",
"@interactjs/utils": "1.4.0-alpha.31+sha.6f00f8c"
},

@@ -13,0 +14,0 @@ "publishConfig": {

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