nodeskini 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -0
- package/client/archive/bundle.js +11528 -0
- package/client/archive/golem.html +60 -0
- package/client/archive/golemClient.js +595 -0
- package/client/archive/golembundle.js +11634 -0
- package/client/archive/sequencer.html +43 -0
- package/client/archive/sequenceurClient.js +815 -0
- package/client/archive/stylegolem.css +158 -0
- package/client/archive/stylesequenceur.css +204 -0
- package/client/clientListe/Sortable-master/.circleci/config.yml +33 -0
- package/client/clientListe/Sortable-master/.editorconfig +15 -0
- package/client/clientListe/Sortable-master/.github/ISSUE_TEMPLATE/bug-report.md +73 -0
- package/client/clientListe/Sortable-master/.github/ISSUE_TEMPLATE/custom-template.md +48 -0
- package/client/clientListe/Sortable-master/.github/ISSUE_TEMPLATE/feature-request.md +41 -0
- package/client/clientListe/Sortable-master/.jshintrc +25 -0
- package/client/clientListe/Sortable-master/.testcaferc.json +7 -0
- package/client/clientListe/Sortable-master/CONTRIBUTING.md +26 -0
- package/client/clientListe/Sortable-master/LICENSE +21 -0
- package/client/clientListe/Sortable-master/README.md +813 -0
- package/client/clientListe/Sortable-master/Sortable.js +3709 -0
- package/client/clientListe/Sortable-master/Sortable.min.js +2 -0
- package/client/clientListe/Sortable-master/Sortable.min.old.js +2 -0
- package/client/clientListe/Sortable-master/Sortable.min.old.old.js +2 -0
- package/client/clientListe/Sortable-master/babel.config.js +27 -0
- package/client/clientListe/Sortable-master/bower.json +30 -0
- package/client/clientListe/Sortable-master/entry/entry-complete.js +8 -0
- package/client/clientListe/Sortable-master/entry/entry-core.js +19 -0
- package/client/clientListe/Sortable-master/entry/entry-defaults.js +19 -0
- package/client/clientListe/Sortable-master/index.html +460 -0
- package/client/clientListe/Sortable-master/modular/sortable.complete.esm.js +3701 -0
- package/client/clientListe/Sortable-master/modular/sortable.core.esm.js +3698 -0
- package/client/clientListe/Sortable-master/modular/sortable.esm.js +3699 -0
- package/client/clientListe/Sortable-master/package-lock.json +5704 -0
- package/client/clientListe/Sortable-master/package.json +56 -0
- package/client/clientListe/Sortable-master/plugins/AutoScroll/AutoScroll.js +270 -0
- package/client/clientListe/Sortable-master/plugins/AutoScroll/README.md +80 -0
- package/client/clientListe/Sortable-master/plugins/AutoScroll/index.js +1 -0
- package/client/clientListe/Sortable-master/plugins/MultiDrag/MultiDrag.js +617 -0
- package/client/clientListe/Sortable-master/plugins/MultiDrag/README.md +96 -0
- package/client/clientListe/Sortable-master/plugins/MultiDrag/index.js +1 -0
- package/client/clientListe/Sortable-master/plugins/OnSpill/OnSpill.js +79 -0
- package/client/clientListe/Sortable-master/plugins/OnSpill/README.md +60 -0
- package/client/clientListe/Sortable-master/plugins/OnSpill/index.js +1 -0
- package/client/clientListe/Sortable-master/plugins/README.md +178 -0
- package/client/clientListe/Sortable-master/plugins/Swap/README.md +55 -0
- package/client/clientListe/Sortable-master/plugins/Swap/Swap.js +90 -0
- package/client/clientListe/Sortable-master/plugins/Swap/index.js +1 -0
- package/client/clientListe/Sortable-master/scripts/banner.js +8 -0
- package/client/clientListe/Sortable-master/scripts/build.js +17 -0
- package/client/clientListe/Sortable-master/scripts/esm-build.js +28 -0
- package/client/clientListe/Sortable-master/scripts/minify.js +11 -0
- package/client/clientListe/Sortable-master/scripts/test-compat.js +30 -0
- package/client/clientListe/Sortable-master/scripts/test.js +21 -0
- package/client/clientListe/Sortable-master/scripts/umd-build.js +15 -0
- package/client/clientListe/Sortable-master/src/Animation.js +175 -0
- package/client/clientListe/Sortable-master/src/BrowserInfo.js +12 -0
- package/client/clientListe/Sortable-master/src/EventDispatcher.js +57 -0
- package/client/clientListe/Sortable-master/src/PluginManager.js +87 -0
- package/client/clientListe/Sortable-master/src/Sortable.js +1971 -0
- package/client/clientListe/Sortable-master/src/utils.js +556 -0
- package/client/clientListe/Sortable-master/st/app.js +224 -0
- package/client/clientListe/Sortable-master/st/iframe/frame.html +32 -0
- package/client/clientListe/Sortable-master/st/iframe/index.html +49 -0
- package/client/clientListe/Sortable-master/st/logo.png +0 -0
- package/client/clientListe/Sortable-master/st/og-image.png +0 -0
- package/client/clientListe/Sortable-master/st/prettify/prettify.css +1 -0
- package/client/clientListe/Sortable-master/st/prettify/prettify.js +46 -0
- package/client/clientListe/Sortable-master/st/prettify/run_prettify.js +64 -0
- package/client/clientListe/Sortable-master/st/saucelabs.svg +1 -0
- package/client/clientListe/Sortable-master/st/theme.css +254 -0
- package/client/clientListe/Sortable-master/tests/Sortable.compat.test.js +39 -0
- package/client/clientListe/Sortable-master/tests/Sortable.test.js +386 -0
- package/client/clientListe/Sortable-master/tests/dual-list.html +34 -0
- package/client/clientListe/Sortable-master/tests/empty-list.html +30 -0
- package/client/clientListe/Sortable-master/tests/filter.html +27 -0
- package/client/clientListe/Sortable-master/tests/handles.html +27 -0
- package/client/clientListe/Sortable-master/tests/nested.html +67 -0
- package/client/clientListe/Sortable-master/tests/single-list.html +25 -0
- package/client/clientListe/Sortable-master/tests/style.css +18 -0
- package/client/clientListe/clientListe.html +148 -0
- package/client/clientListe/clientListe.js +1508 -0
- package/client/clientListe/clientListebundle.js +13164 -0
- package/client/clientListe/images/poubelle.png +0 -0
- package/client/clientListe/images/start.png +0 -0
- package/client/clientListe/images/stop.png +0 -0
- package/client/clientListe/images/submit.png +0 -0
- package/client/clientListe/sortable-theme-bootstrap.css +90 -0
- package/client/configurateur/configReact.js +273 -0
- package/client/configurateur/configReactbundle.js +295 -0
- package/client/configurateur/configurateur.css +95 -0
- package/client/configurateur/configurateur.html +48 -0
- package/client/configurateur/lib/jexcel.css +755 -0
- package/client/configurateur/lib/jexcel.js +14970 -0
- package/client/configurateur/lib/jsuites.css +2801 -0
- package/client/configurateur/lib/jsuites.js +11822 -0
- package/client/configurateur/lib/react-dom.production.min.js +239 -0
- package/client/configurateur/lib/react.production.min.js +32 -0
- package/client/configurateur/src/configReact.js +247 -0
- package/client/controleur/clientcontroleur.js +536 -0
- package/client/controleur/clientcontroleur.test.js +282 -0
- package/client/controleur/controleur.html +51 -0
- package/client/controleur/controleurbundle.js +565 -0
- package/client/controleur/stylecontroleur.css +236 -0
- package/client/controleurHH/controleurHH.html +71 -0
- package/client/controleurHH/controleurHH.js +252 -0
- package/client/controleurHH/styles/index.css +320 -0
- package/client/controleurHH/styles/material.css +11552 -0
- package/client/parametrage/paramReact.js +473 -0
- package/client/parametrage/paramReactbundle.js +500 -0
- package/client/parametrage/parametrage.css +111 -0
- package/client/parametrage/parametrage.html +163 -0
- package/client/parametrage/src/paramReact.js +459 -0
- package/client/score/hash.js +83 -0
- package/client/score/p5.min.js +3 -0
- package/client/score/parto1.js +1171 -0
- package/client/score/parto1bundle.js +1181 -0
- package/client/score/processing.min.js +431 -0
- package/client/score/score.html +15 -0
- package/client/score/score.js +34 -0
- package/client/simulateurListe/simulateurFork.js +750 -0
- package/client/simulateurListe/simulateurFork.mjs +681 -0
- package/client/simulateurListe/simulateurForkSansReorg.js +569 -0
- package/client/simulateurListe/simulateurListe.js +628 -0
- package/myReact/archive/Nodeemitvaluedlocal1.hh.js +52 -0
- package/myReact/archive/abort-parNode.js +79 -0
- package/myReact/archive/abroNode.js +169 -0
- package/myReact/archive/abroNode2.js +80 -0
- package/myReact/archive/atom.compile.hh.js +51 -0
- package/myReact/archive/await-countNode.js +67 -0
- package/myReact/archive/await-nowvalNode.js +44 -0
- package/myReact/archive/callHH.js +96 -0
- package/myReact/archive/emit-if2.hh.compiled.js +113 -0
- package/myReact/archive/every1Node.js +35 -0
- package/myReact/archive/if-runNode.js +74 -0
- package/myReact/archive/if1Node.js +43 -0
- package/myReact/archive/makeawait.js +0 -0
- package/myReact/archive/myReact.old.js +684 -0
- package/myReact/archive/orchestration.js +281 -0
- package/myReact/archive/orchestration1.js +132 -0
- package/myReact/archive/orchestration1.xml +465 -0
- package/myReact/archive/orchestration2.js +161 -0
- package/myReact/archive/orchestrationHH.mano.js +280 -0
- package/myReact/archive/orchestrationHHTest.js +428 -0
- package/myReact/archive/orchestrationHHTest.xml +234 -0
- package/myReact/archive/orchestrationHHTestRun.js +104 -0
- package/myReact/archive/orchestrationHHTestRun.xml +34 -0
- package/myReact/archive/orchestrationTest0.js +178 -0
- package/myReact/archive/orchestrationTest1.js +181 -0
- package/myReact/archive/orchestrationTest2.js +281 -0
- package/myReact/archive/run3pointsNode.js +59 -0
- package/myReact/archive/runNode.js +123 -0
- package/myReact/archive/runNode2.js +91 -0
- package/myReact/archive/testAwait1.js +141 -0
- package/myReact/archive/testAwait1.xml +86 -0
- package/myReact/archive/testEvery1.js +122 -0
- package/myReact/archive/testEvery1.xml +79 -0
- package/myReact/archive/testHH1.js +135 -0
- package/myReact/archive/testHH1.xml +86 -0
- package/myReact/archive/testHH1revu.js +104 -0
- package/myReact/archive/testHH2.js +122 -0
- package/myReact/archive/testHH2.xml +79 -0
- package/myReact/archive/testHH3.js +130 -0
- package/myReact/archive/testHH3.xml +86 -0
- package/myReact/archive/testHHabort.js +121 -0
- package/myReact/archive/testHHabort.xml +83 -0
- package/myReact/archive/testMakeawait.js +202 -0
- package/myReact/archive/testRun1.js +168 -0
- package/myReact/archive/testRun1.xml +142 -0
- package/myReact/archive/titi.js +28 -0
- package/myReact/archive/titi.xml +110 -0
- package/myReact/archive/toto.js +73 -0
- package/myReact/archive/toto.xml +198 -0
- package/myReact/archive/trap-await-parallelNode.js +123 -0
- package/myReact/inutiles/hiver2022.xml +804 -0
- package/myReact/inutiles/hopeNode.xml +459 -0
- package/myReact/inutiles/mars2022.xml +871 -0
- package/myReact/inutiles/mystique1.xml +318 -0
- package/myReact/inutiles/mystiqueOSC.xml +277 -0
- package/myReact/inutiles/opus5Node.xml +1271 -0
- package/myReact/inutiles/opus5NodeLinux.xml +1241 -0
- package/myReact/inutiles/orchestrationHH.xml +541 -0
- package/myReact/inutiles/orchestrationHH2.xml +547 -0
- package/myReact/inutiles/testHH.xml +95 -0
- package/myReact/inutiles/trouveLaPercuTenor.xml +349 -0
- package/myReact/myReact.js +744 -0
- package/myReact/myReact.min.js +1 -0
- package/myReact/orchestrationHH.js +311 -0
- package/myReact/orchestrationHH.mjs +436 -0
- package/myReact/orchestrationHH.mjs.map +1 -0
- package/package.json +46 -0
- package/serveur/OSCandMidi.mjs +361 -0
- package/serveur/computeScore.mjs +415 -0
- package/serveur/controleDAW.mjs +1149 -0
- package/serveur/defaultSession.csv +2 -0
- package/serveur/defaultSkiniParametres.js +119 -0
- package/serveur/gameOSC.mjs +96 -0
- package/serveur/groupeClientsSons.mjs +1014 -0
- package/serveur/ipConfig.json +24 -0
- package/serveur/ipConfig127.json +19 -0
- package/serveur/ipConfig75.json +17 -0
- package/serveur/ipConfigBH.json +19 -0
- package/serveur/ipConfigLocal.json +19 -0
- package/serveur/midiConfig.json +26 -0
- package/serveur/midiConfigBH.json +26 -0
- package/serveur/midiConfigVoid.json +3 -0
- package/serveur/midimix.mjs +570 -0
- package/serveur/saveParam.mjs +159 -0
- package/serveur/skiniParametres.good.js +132 -0
- package/serveur/skiniParametres.js +106 -0
- package/serveur/utilsHHSkini.hh.js +64 -0
- package/serveur/utilsSkini.mjs +137 -0
- package/serveur/websocketServer.mjs +2052 -0
- package/serveur/workerInterfaceZ.mjs +327 -0
- package/serveur/workerSynchro.mjs +49 -0
- package/skini.mjs +141 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "sortablejs",
|
|
3
|
+
"exportName": "Sortable",
|
|
4
|
+
"version": "1.10.2",
|
|
5
|
+
"devDependencies": {
|
|
6
|
+
"@babel/core": "^7.4.4",
|
|
7
|
+
"@babel/plugin-transform-object-assign": "^7.2.0",
|
|
8
|
+
"@babel/preset-env": "^7.4.4",
|
|
9
|
+
"rollup": "^1.11.3",
|
|
10
|
+
"rollup-plugin-babel": "^4.3.2",
|
|
11
|
+
"rollup-plugin-json": "^4.0.0",
|
|
12
|
+
"rollup-plugin-node-resolve": "^5.0.0",
|
|
13
|
+
"testcafe": "^1.3.1",
|
|
14
|
+
"testcafe-browser-provider-saucelabs": "^1.7.0",
|
|
15
|
+
"testcafe-reporter-xunit": "^2.1.0",
|
|
16
|
+
"uglify-js": "^3.5.12"
|
|
17
|
+
},
|
|
18
|
+
"description": "JavaScript library for reorderable drag-and-drop lists on modern browsers and touch devices. No jQuery required. Supports Meteor, AngularJS, React, Polymer, Vue, Knockout and any CSS library, e.g. Bootstrap.",
|
|
19
|
+
"main": "./Sortable.js",
|
|
20
|
+
"module": "modular/sortable.esm.js",
|
|
21
|
+
"scripts": {
|
|
22
|
+
"build:umd": "NODE_ENV=umd rollup -c ./scripts/umd-build.js",
|
|
23
|
+
"build:umd:watch": "set NODE_ENV=umd&& rollup -w -c ./scripts/umd-build.js",
|
|
24
|
+
"build:es": "set NODE_ENV=es&& rollup -c ./scripts/esm-build.js",
|
|
25
|
+
"build:es:watch": "set NODE_ENV=es&& rollup -w -c ./scripts/esm-build.js",
|
|
26
|
+
"minify": "node ./scripts/minify.js",
|
|
27
|
+
"build": "npm run build:es && npm run build:umd && npm run minify",
|
|
28
|
+
"test:compat": "node ./scripts/test-compat.js",
|
|
29
|
+
"test": "node ./scripts/test.js"
|
|
30
|
+
},
|
|
31
|
+
"maintainers": [
|
|
32
|
+
"Konstantin Lebedev <ibnRubaXa@gmail.com>",
|
|
33
|
+
"Owen Mills <owen23355@gmail.com>"
|
|
34
|
+
],
|
|
35
|
+
"repository": {
|
|
36
|
+
"type": "git",
|
|
37
|
+
"url": "git://github.com/SortableJS/Sortable.git"
|
|
38
|
+
},
|
|
39
|
+
"files": [
|
|
40
|
+
"Sortable.js",
|
|
41
|
+
"Sortable.min.js",
|
|
42
|
+
"modular/"
|
|
43
|
+
],
|
|
44
|
+
"keywords": [
|
|
45
|
+
"sortable",
|
|
46
|
+
"reorder",
|
|
47
|
+
"drag",
|
|
48
|
+
"meteor",
|
|
49
|
+
"angular",
|
|
50
|
+
"ng-sortable",
|
|
51
|
+
"react",
|
|
52
|
+
"vue",
|
|
53
|
+
"mixin"
|
|
54
|
+
],
|
|
55
|
+
"license": "MIT"
|
|
56
|
+
}
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
import {
|
|
2
|
+
on,
|
|
3
|
+
off,
|
|
4
|
+
css,
|
|
5
|
+
throttle,
|
|
6
|
+
cancelThrottle,
|
|
7
|
+
scrollBy,
|
|
8
|
+
getParentAutoScrollElement,
|
|
9
|
+
expando,
|
|
10
|
+
getRect,
|
|
11
|
+
getWindowScrollingElement
|
|
12
|
+
} from '../../src/utils.js';
|
|
13
|
+
|
|
14
|
+
import Sortable from '../../src/Sortable.js';
|
|
15
|
+
|
|
16
|
+
import { Edge, IE11OrLess, Safari } from '../../src/BrowserInfo.js';
|
|
17
|
+
|
|
18
|
+
let autoScrolls = [],
|
|
19
|
+
scrollEl,
|
|
20
|
+
scrollRootEl,
|
|
21
|
+
scrolling = false,
|
|
22
|
+
lastAutoScrollX,
|
|
23
|
+
lastAutoScrollY,
|
|
24
|
+
touchEvt,
|
|
25
|
+
pointerElemChangedInterval;
|
|
26
|
+
|
|
27
|
+
function AutoScrollPlugin() {
|
|
28
|
+
|
|
29
|
+
function AutoScroll() {
|
|
30
|
+
this.defaults = {
|
|
31
|
+
scroll: true,
|
|
32
|
+
scrollSensitivity: 30,
|
|
33
|
+
scrollSpeed: 10,
|
|
34
|
+
bubbleScroll: true
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
// Bind all private methods
|
|
38
|
+
for (let fn in this) {
|
|
39
|
+
if (fn.charAt(0) === '_' && typeof this[fn] === 'function') {
|
|
40
|
+
this[fn] = this[fn].bind(this);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
AutoScroll.prototype = {
|
|
46
|
+
dragStarted({ originalEvent }) {
|
|
47
|
+
if (this.sortable.nativeDraggable) {
|
|
48
|
+
on(document, 'dragover', this._handleAutoScroll);
|
|
49
|
+
} else {
|
|
50
|
+
if (this.options.supportPointer) {
|
|
51
|
+
on(document, 'pointermove', this._handleFallbackAutoScroll);
|
|
52
|
+
} else if (originalEvent.touches) {
|
|
53
|
+
on(document, 'touchmove', this._handleFallbackAutoScroll);
|
|
54
|
+
} else {
|
|
55
|
+
on(document, 'mousemove', this._handleFallbackAutoScroll);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
dragOverCompleted({ originalEvent }) {
|
|
61
|
+
// For when bubbling is canceled and using fallback (fallback 'touchmove' always reached)
|
|
62
|
+
if (!this.options.dragOverBubble && !originalEvent.rootEl) {
|
|
63
|
+
this._handleAutoScroll(originalEvent);
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
|
|
67
|
+
drop() {
|
|
68
|
+
if (this.sortable.nativeDraggable) {
|
|
69
|
+
off(document, 'dragover', this._handleAutoScroll);
|
|
70
|
+
} else {
|
|
71
|
+
off(document, 'pointermove', this._handleFallbackAutoScroll);
|
|
72
|
+
off(document, 'touchmove', this._handleFallbackAutoScroll);
|
|
73
|
+
off(document, 'mousemove', this._handleFallbackAutoScroll);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
clearPointerElemChangedInterval();
|
|
77
|
+
clearAutoScrolls();
|
|
78
|
+
cancelThrottle();
|
|
79
|
+
},
|
|
80
|
+
|
|
81
|
+
nulling() {
|
|
82
|
+
touchEvt =
|
|
83
|
+
scrollRootEl =
|
|
84
|
+
scrollEl =
|
|
85
|
+
scrolling =
|
|
86
|
+
pointerElemChangedInterval =
|
|
87
|
+
lastAutoScrollX =
|
|
88
|
+
lastAutoScrollY = null;
|
|
89
|
+
|
|
90
|
+
autoScrolls.length = 0;
|
|
91
|
+
},
|
|
92
|
+
|
|
93
|
+
_handleFallbackAutoScroll(evt) {
|
|
94
|
+
this._handleAutoScroll(evt, true);
|
|
95
|
+
},
|
|
96
|
+
|
|
97
|
+
_handleAutoScroll(evt, fallback) {
|
|
98
|
+
const x = (evt.touches ? evt.touches[0] : evt).clientX,
|
|
99
|
+
y = (evt.touches ? evt.touches[0] : evt).clientY,
|
|
100
|
+
|
|
101
|
+
elem = document.elementFromPoint(x, y);
|
|
102
|
+
|
|
103
|
+
touchEvt = evt;
|
|
104
|
+
|
|
105
|
+
// IE does not seem to have native autoscroll,
|
|
106
|
+
// Edge's autoscroll seems too conditional,
|
|
107
|
+
// MACOS Safari does not have autoscroll,
|
|
108
|
+
// Firefox and Chrome are good
|
|
109
|
+
if (fallback || Edge || IE11OrLess || Safari) {
|
|
110
|
+
autoScroll(evt, this.options, elem, fallback);
|
|
111
|
+
|
|
112
|
+
// Listener for pointer element change
|
|
113
|
+
let ogElemScroller = getParentAutoScrollElement(elem, true);
|
|
114
|
+
if (
|
|
115
|
+
scrolling &&
|
|
116
|
+
(
|
|
117
|
+
!pointerElemChangedInterval ||
|
|
118
|
+
x !== lastAutoScrollX ||
|
|
119
|
+
y !== lastAutoScrollY
|
|
120
|
+
)
|
|
121
|
+
) {
|
|
122
|
+
pointerElemChangedInterval && clearPointerElemChangedInterval();
|
|
123
|
+
// Detect for pointer elem change, emulating native DnD behaviour
|
|
124
|
+
pointerElemChangedInterval = setInterval(() => {
|
|
125
|
+
let newElem = getParentAutoScrollElement(document.elementFromPoint(x, y), true);
|
|
126
|
+
if (newElem !== ogElemScroller) {
|
|
127
|
+
ogElemScroller = newElem;
|
|
128
|
+
clearAutoScrolls();
|
|
129
|
+
}
|
|
130
|
+
autoScroll(evt, this.options, newElem, fallback);
|
|
131
|
+
}, 10);
|
|
132
|
+
lastAutoScrollX = x;
|
|
133
|
+
lastAutoScrollY = y;
|
|
134
|
+
}
|
|
135
|
+
} else {
|
|
136
|
+
// if DnD is enabled (and browser has good autoscrolling), first autoscroll will already scroll, so get parent autoscroll of first autoscroll
|
|
137
|
+
if (!this.options.bubbleScroll || getParentAutoScrollElement(elem, true) === getWindowScrollingElement()) {
|
|
138
|
+
clearAutoScrolls();
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
autoScroll(evt, this.options, getParentAutoScrollElement(elem, false), false);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
return Object.assign(AutoScroll, {
|
|
147
|
+
pluginName: 'scroll',
|
|
148
|
+
initializeByDefault: true
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
function clearAutoScrolls() {
|
|
153
|
+
autoScrolls.forEach(function(autoScroll) {
|
|
154
|
+
clearInterval(autoScroll.pid);
|
|
155
|
+
});
|
|
156
|
+
autoScrolls = [];
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
function clearPointerElemChangedInterval() {
|
|
160
|
+
clearInterval(pointerElemChangedInterval);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
const autoScroll = throttle(function(evt, options, rootEl, isFallback) {
|
|
165
|
+
// Bug: https://bugzilla.mozilla.org/show_bug.cgi?id=505521
|
|
166
|
+
if (!options.scroll) return;
|
|
167
|
+
const x = (evt.touches ? evt.touches[0] : evt).clientX,
|
|
168
|
+
y = (evt.touches ? evt.touches[0] : evt).clientY,
|
|
169
|
+
sens = options.scrollSensitivity,
|
|
170
|
+
speed = options.scrollSpeed,
|
|
171
|
+
winScroller = getWindowScrollingElement();
|
|
172
|
+
|
|
173
|
+
let scrollThisInstance = false,
|
|
174
|
+
scrollCustomFn;
|
|
175
|
+
|
|
176
|
+
// New scroll root, set scrollEl
|
|
177
|
+
if (scrollRootEl !== rootEl) {
|
|
178
|
+
scrollRootEl = rootEl;
|
|
179
|
+
|
|
180
|
+
clearAutoScrolls();
|
|
181
|
+
|
|
182
|
+
scrollEl = options.scroll;
|
|
183
|
+
scrollCustomFn = options.scrollFn;
|
|
184
|
+
|
|
185
|
+
if (scrollEl === true) {
|
|
186
|
+
scrollEl = getParentAutoScrollElement(rootEl, true);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
let layersOut = 0;
|
|
192
|
+
let currentParent = scrollEl;
|
|
193
|
+
do {
|
|
194
|
+
let el = currentParent,
|
|
195
|
+
rect = getRect(el),
|
|
196
|
+
|
|
197
|
+
top = rect.top,
|
|
198
|
+
bottom = rect.bottom,
|
|
199
|
+
left = rect.left,
|
|
200
|
+
right = rect.right,
|
|
201
|
+
|
|
202
|
+
width = rect.width,
|
|
203
|
+
height = rect.height,
|
|
204
|
+
|
|
205
|
+
canScrollX,
|
|
206
|
+
canScrollY,
|
|
207
|
+
|
|
208
|
+
scrollWidth = el.scrollWidth,
|
|
209
|
+
scrollHeight = el.scrollHeight,
|
|
210
|
+
|
|
211
|
+
elCSS = css(el),
|
|
212
|
+
|
|
213
|
+
scrollPosX = el.scrollLeft,
|
|
214
|
+
scrollPosY = el.scrollTop;
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
if (el === winScroller) {
|
|
218
|
+
canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll' || elCSS.overflowX === 'visible');
|
|
219
|
+
canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll' || elCSS.overflowY === 'visible');
|
|
220
|
+
} else {
|
|
221
|
+
canScrollX = width < scrollWidth && (elCSS.overflowX === 'auto' || elCSS.overflowX === 'scroll');
|
|
222
|
+
canScrollY = height < scrollHeight && (elCSS.overflowY === 'auto' || elCSS.overflowY === 'scroll');
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
let vx = canScrollX && (Math.abs(right - x) <= sens && (scrollPosX + width) < scrollWidth) - (Math.abs(left - x) <= sens && !!scrollPosX);
|
|
226
|
+
let vy = canScrollY && (Math.abs(bottom - y) <= sens && (scrollPosY + height) < scrollHeight) - (Math.abs(top - y) <= sens && !!scrollPosY);
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
if (!autoScrolls[layersOut]) {
|
|
230
|
+
for (let i = 0; i <= layersOut; i++) {
|
|
231
|
+
if (!autoScrolls[i]) {
|
|
232
|
+
autoScrolls[i] = {};
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
if (autoScrolls[layersOut].vx != vx || autoScrolls[layersOut].vy != vy || autoScrolls[layersOut].el !== el) {
|
|
238
|
+
autoScrolls[layersOut].el = el;
|
|
239
|
+
autoScrolls[layersOut].vx = vx;
|
|
240
|
+
autoScrolls[layersOut].vy = vy;
|
|
241
|
+
|
|
242
|
+
clearInterval(autoScrolls[layersOut].pid);
|
|
243
|
+
|
|
244
|
+
if (vx != 0 || vy != 0) {
|
|
245
|
+
scrollThisInstance = true;
|
|
246
|
+
/* jshint loopfunc:true */
|
|
247
|
+
autoScrolls[layersOut].pid = setInterval((function () {
|
|
248
|
+
// emulate drag over during autoscroll (fallback), emulating native DnD behaviour
|
|
249
|
+
if (isFallback && this.layer === 0) {
|
|
250
|
+
Sortable.active._onTouchMove(touchEvt); // To move ghost if it is positioned absolutely
|
|
251
|
+
}
|
|
252
|
+
let scrollOffsetY = autoScrolls[this.layer].vy ? autoScrolls[this.layer].vy * speed : 0;
|
|
253
|
+
let scrollOffsetX = autoScrolls[this.layer].vx ? autoScrolls[this.layer].vx * speed : 0;
|
|
254
|
+
|
|
255
|
+
if (typeof(scrollCustomFn) === 'function') {
|
|
256
|
+
if (scrollCustomFn.call(Sortable.dragged.parentNode[expando], scrollOffsetX, scrollOffsetY, evt, touchEvt, autoScrolls[this.layer].el) !== 'continue') {
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
scrollBy(autoScrolls[this.layer].el, scrollOffsetX, scrollOffsetY);
|
|
262
|
+
}).bind({layer: layersOut}), 24);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
layersOut++;
|
|
266
|
+
} while (options.bubbleScroll && currentParent !== winScroller && (currentParent = getParentAutoScrollElement(currentParent, false)));
|
|
267
|
+
scrolling = scrollThisInstance; // in case another function catches scrolling as false in between when it is not
|
|
268
|
+
}, 30);
|
|
269
|
+
|
|
270
|
+
export default AutoScrollPlugin;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
## AutoScroll
|
|
2
|
+
This plugin allows for the page to automatically scroll during dragging near a scrollable element's edge on mobile devices and IE9 (or whenever fallback is enabled), and also enhances most browser's native drag-and-drop autoscrolling.
|
|
3
|
+
Demo:
|
|
4
|
+
- `window`: https://jsbin.com/dosilir/edit?js,output
|
|
5
|
+
- `overflow: hidden`: https://jsbin.com/xecihez/edit?html,js,output
|
|
6
|
+
|
|
7
|
+
**This plugin is a default plugin, and is included in the default UMD and ESM builds of Sortable**
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Mounting
|
|
14
|
+
```js
|
|
15
|
+
import { Sortable, AutoScroll } from 'sortablejs';
|
|
16
|
+
|
|
17
|
+
Sortable.mount(new AutoScroll());
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### Options
|
|
25
|
+
|
|
26
|
+
```js
|
|
27
|
+
new Sortable(el, {
|
|
28
|
+
scroll: true, // Enable the plugin. Can be HTMLElement.
|
|
29
|
+
scrollFn: function(offsetX, offsetY, originalEvent, touchEvt, hoverTargetEl) { ... }, // if you have custom scrollbar scrollFn may be used for autoscrolling
|
|
30
|
+
scrollSensitivity: 30, // px, how near the mouse must be to an edge to start scrolling.
|
|
31
|
+
scrollSpeed: 10, // px, speed of the scrolling
|
|
32
|
+
bubbleScroll: true // apply autoscroll to all parent elements, allowing for easier movement
|
|
33
|
+
});
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
#### `scroll` option
|
|
41
|
+
Enables the plugin. Defaults to `true`. May also be set to an HTMLElement which will be where autoscrolling is rooted.
|
|
42
|
+
|
|
43
|
+
Demo:
|
|
44
|
+
- `window`: https://jsbin.com/dosilir/edit?js,output
|
|
45
|
+
- `overflow: hidden`: https://jsbin.com/xecihez/edit?html,js,output
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
#### `scrollFn` option
|
|
52
|
+
Defines function that will be used for autoscrolling. el.scrollTop/el.scrollLeft is used by default.
|
|
53
|
+
Useful when you have custom scrollbar with dedicated scroll function.
|
|
54
|
+
This function should return `'continue'` if it wishes to allow Sortable's native autoscrolling.
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
#### `scrollSensitivity` option
|
|
61
|
+
Defines how near the mouse must be to an edge to start scrolling.
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
#### `scrollSpeed` option
|
|
68
|
+
The speed at which the window should scroll once the mouse pointer gets within the `scrollSensitivity` distance.
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
#### `bubbleScroll` option
|
|
75
|
+
If set to `true`, the normal `autoscroll` function will also be applied to all parent elements of the element the user is dragging over.
|
|
76
|
+
|
|
77
|
+
Demo: https://jsbin.com/kesewor/edit?html,js,output
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
---
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './AutoScroll.js';
|