@interactjs/reflow
Advanced tools
Comparing version 1.10.24 to 1.10.25
11
index.js
@@ -0,6 +1,9 @@ | ||
"use strict"; | ||
var _plugin = _interopRequireDefault(require("./plugin.js")); | ||
var _index = _interopRequireDefault(require("../interact/index.js")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
/* eslint-disable no-console, eol-last, import/no-duplicates, import/no-extraneous-dependencies, import/order */ | ||
import "./plugin.js"; | ||
import interact from "../interact/index.js"; | ||
import plugin from "./plugin.js"; | ||
interact.use(plugin); | ||
_index.default.use(_plugin.default); | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,2 @@ | ||
import"./plugin.prod.js";import r from"../interact/index.prod.js";import o from"./plugin.prod.js";r.use(o); | ||
var e=r(require("./plugin.prod.js"));function r(e){return e&&e.__esModule?e:{default:e}}r(require("../interact/index.prod.js")).default.use(e.default); | ||
//# sourceMappingURL=index.prod.js.map |
{ | ||
"name": "@interactjs/reflow", | ||
"version": "1.10.24", | ||
"version": "1.10.25", | ||
"main": "index", | ||
@@ -13,7 +13,7 @@ "module": "index", | ||
"peerDependencies": { | ||
"@interactjs/core": "1.10.24", | ||
"@interactjs/utils": "1.10.24" | ||
"@interactjs/core": "1.10.25", | ||
"@interactjs/utils": "1.10.25" | ||
}, | ||
"optionalDependencies": { | ||
"@interactjs/interact": "1.10.24" | ||
"@interactjs/interact": "1.10.25" | ||
}, | ||
@@ -28,3 +28,3 @@ "publishConfig": { | ||
"license": "MIT", | ||
"gitHead": "86c64a3f" | ||
"gitHead": "ee3c52c4" | ||
} |
@@ -1,5 +0,13 @@ | ||
import * as arr from "../utils/arr.js"; | ||
import { copyAction } from "../utils/misc.js"; | ||
import * as pointerUtils from "../utils/pointerUtils.js"; | ||
import { tlbrToXywh } from "../utils/rect.js"; | ||
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.default = void 0; | ||
var arr = _interopRequireWildcard(require("../utils/arr.js")); | ||
var _misc = require("../utils/misc.js"); | ||
var pointerUtils = _interopRequireWildcard(require("../utils/pointerUtils.js")); | ||
var _rect = require("../utils/rect.js"); | ||
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); } | ||
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; } | ||
function install(scope) { | ||
@@ -37,3 +45,3 @@ const { | ||
} else { | ||
const xywh = tlbrToXywh(rect); | ||
const xywh = (0, _rect.tlbrToXywh)(rect); | ||
const coords = { | ||
@@ -75,3 +83,3 @@ page: { | ||
pointerUtils.setZeroCoords(interaction.coords.delta); | ||
copyAction(interaction.prepared, action); | ||
(0, _misc.copyAction)(interaction.prepared, action); | ||
interaction._doPhase(signalArg); | ||
@@ -113,3 +121,3 @@ const { | ||
}; | ||
export default reflow; | ||
var _default = exports.default = reflow; | ||
//# sourceMappingURL=plugin.js.map |
@@ -1,2 +0,2 @@ | ||
import*as e from"../utils/arr.prod.js";import{copyAction as t}from"../utils/misc.prod.js";import*as o from"../utils/pointerUtils.prod.js";import{tlbrToXywh as r}from"../utils/rect.prod.js";function n(e,r,n,i,s){const l=e.interactions.new({pointerType:"reflow"}),a={interaction:l,event:s,pointer:s,eventTarget:n,phase:"reflow"};l.interactable=r,l.element=n,l.prevEvent=s,l.updatePointer(s,s,n,!0),o.setZeroCoords(l.coords.delta),t(l.prepared,i),l._doPhase(a);const{Promise:p}=e.window,c=p?new p((e=>{l._reflowResolve=e})):void 0;return l._reflowPromise=c,l.start(i,r,n),l._interacting?(l.move(a),l.end(s)):(l.stop(),l._reflowResolve()),l.removePointer(s,s),c}const i={id:"reflow",install(t){const{Interactable:i}=t;t.actions.phases.reflow=!0,i.prototype.reflow=function(i){return((t,i,s)=>{const l=t.getAllElements(),a=s.window.Promise,p=a?[]:null;for(const c of l){const l=t.getRect(c);if(!l)break;const f=e.find(s.interactions.list,(e=>e.interacting()&&e.interactable===t&&e.element===c&&e.prepared.name===i.name));let m;if(f)f.move(),p&&(m=f._reflowPromise||new a((e=>{f._reflowResolve=e})));else{const e=r(l),a={page:{x:e.x,y:e.y},client:{x:e.x,y:e.y},timeStamp:s.now()},p=o.coordsToEvent(a);m=n(s,t,c,i,p)}p&&p.push(m)}return p&&a.all(p).then((()=>t))})(this,i,t)}},listeners:{"interactions:stop"({interaction:t},o){"reflow"===t.pointerType&&(t._reflowResolve&&t._reflowResolve(),e.remove(o.interactions.list,t))}}};export default i; | ||
Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=void 0;var e=i(require("../utils/arr.prod.js")),t=require("../utils/misc.prod.js"),r=i(require("../utils/pointerUtils.prod.js")),o=require("../utils/rect.prod.js");function n(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(n=e=>e?r:t)(e)}function i(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=n(t);if(r&&r.has(e))return r.get(e);var o={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in e)if("default"!==s&&Object.prototype.hasOwnProperty.call(e,s)){var l=i?Object.getOwnPropertyDescriptor(e,s):null;l&&(l.get||l.set)?Object.defineProperty(o,s,l):o[s]=e[s]}return o.default=e,r&&r.set(e,o),o}function s(e,o,n,i,s){const l=e.interactions.new({pointerType:"reflow"}),a={interaction:l,event:s,pointer:s,eventTarget:n,phase:"reflow"};l.interactable=o,l.element=n,l.prevEvent=s,l.updatePointer(s,s,n,!0),r.setZeroCoords(l.coords.delta),(0,t.copyAction)(l.prepared,i),l._doPhase(a);const{Promise:p}=e.window,c=p?new p((e=>{l._reflowResolve=e})):void 0;return l._reflowPromise=c,l.start(i,o,n),l._interacting?(l.move(a),l.end(s)):(l.stop(),l._reflowResolve()),l.removePointer(s,s),c}const l={id:"reflow",install(t){const{Interactable:n}=t;t.actions.phases.reflow=!0,n.prototype.reflow=function(n){return((t,n,i)=>{const l=t.getAllElements(),a=i.window.Promise,p=a?[]:null;for(const c of l){const l=t.getRect(c);if(!l)break;const f=e.find(i.interactions.list,(e=>e.interacting()&&e.interactable===t&&e.element===c&&e.prepared.name===n.name));let u;if(f)f.move(),p&&(u=f._reflowPromise||new a((e=>{f._reflowResolve=e})));else{const e=(0,o.tlbrToXywh)(l),a={page:{x:e.x,y:e.y},client:{x:e.x,y:e.y},timeStamp:i.now()},p=r.coordsToEvent(a);u=s(i,t,c,n,p)}p&&p.push(u)}return p&&a.all(p).then((()=>t))})(this,n,t)}},listeners:{"interactions:stop"({interaction:t},r){"reflow"===t.pointerType&&(t._reflowResolve&&t._reflowResolve(),e.remove(r.interactions.list,t))}}};exports.default=l; | ||
//# sourceMappingURL=plugin.prod.js.map |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
32536
180
2