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.
Files changed (215) hide show
  1. package/README.md +31 -0
  2. package/client/archive/bundle.js +11528 -0
  3. package/client/archive/golem.html +60 -0
  4. package/client/archive/golemClient.js +595 -0
  5. package/client/archive/golembundle.js +11634 -0
  6. package/client/archive/sequencer.html +43 -0
  7. package/client/archive/sequenceurClient.js +815 -0
  8. package/client/archive/stylegolem.css +158 -0
  9. package/client/archive/stylesequenceur.css +204 -0
  10. package/client/clientListe/Sortable-master/.circleci/config.yml +33 -0
  11. package/client/clientListe/Sortable-master/.editorconfig +15 -0
  12. package/client/clientListe/Sortable-master/.github/ISSUE_TEMPLATE/bug-report.md +73 -0
  13. package/client/clientListe/Sortable-master/.github/ISSUE_TEMPLATE/custom-template.md +48 -0
  14. package/client/clientListe/Sortable-master/.github/ISSUE_TEMPLATE/feature-request.md +41 -0
  15. package/client/clientListe/Sortable-master/.jshintrc +25 -0
  16. package/client/clientListe/Sortable-master/.testcaferc.json +7 -0
  17. package/client/clientListe/Sortable-master/CONTRIBUTING.md +26 -0
  18. package/client/clientListe/Sortable-master/LICENSE +21 -0
  19. package/client/clientListe/Sortable-master/README.md +813 -0
  20. package/client/clientListe/Sortable-master/Sortable.js +3709 -0
  21. package/client/clientListe/Sortable-master/Sortable.min.js +2 -0
  22. package/client/clientListe/Sortable-master/Sortable.min.old.js +2 -0
  23. package/client/clientListe/Sortable-master/Sortable.min.old.old.js +2 -0
  24. package/client/clientListe/Sortable-master/babel.config.js +27 -0
  25. package/client/clientListe/Sortable-master/bower.json +30 -0
  26. package/client/clientListe/Sortable-master/entry/entry-complete.js +8 -0
  27. package/client/clientListe/Sortable-master/entry/entry-core.js +19 -0
  28. package/client/clientListe/Sortable-master/entry/entry-defaults.js +19 -0
  29. package/client/clientListe/Sortable-master/index.html +460 -0
  30. package/client/clientListe/Sortable-master/modular/sortable.complete.esm.js +3701 -0
  31. package/client/clientListe/Sortable-master/modular/sortable.core.esm.js +3698 -0
  32. package/client/clientListe/Sortable-master/modular/sortable.esm.js +3699 -0
  33. package/client/clientListe/Sortable-master/package-lock.json +5704 -0
  34. package/client/clientListe/Sortable-master/package.json +56 -0
  35. package/client/clientListe/Sortable-master/plugins/AutoScroll/AutoScroll.js +270 -0
  36. package/client/clientListe/Sortable-master/plugins/AutoScroll/README.md +80 -0
  37. package/client/clientListe/Sortable-master/plugins/AutoScroll/index.js +1 -0
  38. package/client/clientListe/Sortable-master/plugins/MultiDrag/MultiDrag.js +617 -0
  39. package/client/clientListe/Sortable-master/plugins/MultiDrag/README.md +96 -0
  40. package/client/clientListe/Sortable-master/plugins/MultiDrag/index.js +1 -0
  41. package/client/clientListe/Sortable-master/plugins/OnSpill/OnSpill.js +79 -0
  42. package/client/clientListe/Sortable-master/plugins/OnSpill/README.md +60 -0
  43. package/client/clientListe/Sortable-master/plugins/OnSpill/index.js +1 -0
  44. package/client/clientListe/Sortable-master/plugins/README.md +178 -0
  45. package/client/clientListe/Sortable-master/plugins/Swap/README.md +55 -0
  46. package/client/clientListe/Sortable-master/plugins/Swap/Swap.js +90 -0
  47. package/client/clientListe/Sortable-master/plugins/Swap/index.js +1 -0
  48. package/client/clientListe/Sortable-master/scripts/banner.js +8 -0
  49. package/client/clientListe/Sortable-master/scripts/build.js +17 -0
  50. package/client/clientListe/Sortable-master/scripts/esm-build.js +28 -0
  51. package/client/clientListe/Sortable-master/scripts/minify.js +11 -0
  52. package/client/clientListe/Sortable-master/scripts/test-compat.js +30 -0
  53. package/client/clientListe/Sortable-master/scripts/test.js +21 -0
  54. package/client/clientListe/Sortable-master/scripts/umd-build.js +15 -0
  55. package/client/clientListe/Sortable-master/src/Animation.js +175 -0
  56. package/client/clientListe/Sortable-master/src/BrowserInfo.js +12 -0
  57. package/client/clientListe/Sortable-master/src/EventDispatcher.js +57 -0
  58. package/client/clientListe/Sortable-master/src/PluginManager.js +87 -0
  59. package/client/clientListe/Sortable-master/src/Sortable.js +1971 -0
  60. package/client/clientListe/Sortable-master/src/utils.js +556 -0
  61. package/client/clientListe/Sortable-master/st/app.js +224 -0
  62. package/client/clientListe/Sortable-master/st/iframe/frame.html +32 -0
  63. package/client/clientListe/Sortable-master/st/iframe/index.html +49 -0
  64. package/client/clientListe/Sortable-master/st/logo.png +0 -0
  65. package/client/clientListe/Sortable-master/st/og-image.png +0 -0
  66. package/client/clientListe/Sortable-master/st/prettify/prettify.css +1 -0
  67. package/client/clientListe/Sortable-master/st/prettify/prettify.js +46 -0
  68. package/client/clientListe/Sortable-master/st/prettify/run_prettify.js +64 -0
  69. package/client/clientListe/Sortable-master/st/saucelabs.svg +1 -0
  70. package/client/clientListe/Sortable-master/st/theme.css +254 -0
  71. package/client/clientListe/Sortable-master/tests/Sortable.compat.test.js +39 -0
  72. package/client/clientListe/Sortable-master/tests/Sortable.test.js +386 -0
  73. package/client/clientListe/Sortable-master/tests/dual-list.html +34 -0
  74. package/client/clientListe/Sortable-master/tests/empty-list.html +30 -0
  75. package/client/clientListe/Sortable-master/tests/filter.html +27 -0
  76. package/client/clientListe/Sortable-master/tests/handles.html +27 -0
  77. package/client/clientListe/Sortable-master/tests/nested.html +67 -0
  78. package/client/clientListe/Sortable-master/tests/single-list.html +25 -0
  79. package/client/clientListe/Sortable-master/tests/style.css +18 -0
  80. package/client/clientListe/clientListe.html +148 -0
  81. package/client/clientListe/clientListe.js +1508 -0
  82. package/client/clientListe/clientListebundle.js +13164 -0
  83. package/client/clientListe/images/poubelle.png +0 -0
  84. package/client/clientListe/images/start.png +0 -0
  85. package/client/clientListe/images/stop.png +0 -0
  86. package/client/clientListe/images/submit.png +0 -0
  87. package/client/clientListe/sortable-theme-bootstrap.css +90 -0
  88. package/client/configurateur/configReact.js +273 -0
  89. package/client/configurateur/configReactbundle.js +295 -0
  90. package/client/configurateur/configurateur.css +95 -0
  91. package/client/configurateur/configurateur.html +48 -0
  92. package/client/configurateur/lib/jexcel.css +755 -0
  93. package/client/configurateur/lib/jexcel.js +14970 -0
  94. package/client/configurateur/lib/jsuites.css +2801 -0
  95. package/client/configurateur/lib/jsuites.js +11822 -0
  96. package/client/configurateur/lib/react-dom.production.min.js +239 -0
  97. package/client/configurateur/lib/react.production.min.js +32 -0
  98. package/client/configurateur/src/configReact.js +247 -0
  99. package/client/controleur/clientcontroleur.js +536 -0
  100. package/client/controleur/clientcontroleur.test.js +282 -0
  101. package/client/controleur/controleur.html +51 -0
  102. package/client/controleur/controleurbundle.js +565 -0
  103. package/client/controleur/stylecontroleur.css +236 -0
  104. package/client/controleurHH/controleurHH.html +71 -0
  105. package/client/controleurHH/controleurHH.js +252 -0
  106. package/client/controleurHH/styles/index.css +320 -0
  107. package/client/controleurHH/styles/material.css +11552 -0
  108. package/client/parametrage/paramReact.js +473 -0
  109. package/client/parametrage/paramReactbundle.js +500 -0
  110. package/client/parametrage/parametrage.css +111 -0
  111. package/client/parametrage/parametrage.html +163 -0
  112. package/client/parametrage/src/paramReact.js +459 -0
  113. package/client/score/hash.js +83 -0
  114. package/client/score/p5.min.js +3 -0
  115. package/client/score/parto1.js +1171 -0
  116. package/client/score/parto1bundle.js +1181 -0
  117. package/client/score/processing.min.js +431 -0
  118. package/client/score/score.html +15 -0
  119. package/client/score/score.js +34 -0
  120. package/client/simulateurListe/simulateurFork.js +750 -0
  121. package/client/simulateurListe/simulateurFork.mjs +681 -0
  122. package/client/simulateurListe/simulateurForkSansReorg.js +569 -0
  123. package/client/simulateurListe/simulateurListe.js +628 -0
  124. package/myReact/archive/Nodeemitvaluedlocal1.hh.js +52 -0
  125. package/myReact/archive/abort-parNode.js +79 -0
  126. package/myReact/archive/abroNode.js +169 -0
  127. package/myReact/archive/abroNode2.js +80 -0
  128. package/myReact/archive/atom.compile.hh.js +51 -0
  129. package/myReact/archive/await-countNode.js +67 -0
  130. package/myReact/archive/await-nowvalNode.js +44 -0
  131. package/myReact/archive/callHH.js +96 -0
  132. package/myReact/archive/emit-if2.hh.compiled.js +113 -0
  133. package/myReact/archive/every1Node.js +35 -0
  134. package/myReact/archive/if-runNode.js +74 -0
  135. package/myReact/archive/if1Node.js +43 -0
  136. package/myReact/archive/makeawait.js +0 -0
  137. package/myReact/archive/myReact.old.js +684 -0
  138. package/myReact/archive/orchestration.js +281 -0
  139. package/myReact/archive/orchestration1.js +132 -0
  140. package/myReact/archive/orchestration1.xml +465 -0
  141. package/myReact/archive/orchestration2.js +161 -0
  142. package/myReact/archive/orchestrationHH.mano.js +280 -0
  143. package/myReact/archive/orchestrationHHTest.js +428 -0
  144. package/myReact/archive/orchestrationHHTest.xml +234 -0
  145. package/myReact/archive/orchestrationHHTestRun.js +104 -0
  146. package/myReact/archive/orchestrationHHTestRun.xml +34 -0
  147. package/myReact/archive/orchestrationTest0.js +178 -0
  148. package/myReact/archive/orchestrationTest1.js +181 -0
  149. package/myReact/archive/orchestrationTest2.js +281 -0
  150. package/myReact/archive/run3pointsNode.js +59 -0
  151. package/myReact/archive/runNode.js +123 -0
  152. package/myReact/archive/runNode2.js +91 -0
  153. package/myReact/archive/testAwait1.js +141 -0
  154. package/myReact/archive/testAwait1.xml +86 -0
  155. package/myReact/archive/testEvery1.js +122 -0
  156. package/myReact/archive/testEvery1.xml +79 -0
  157. package/myReact/archive/testHH1.js +135 -0
  158. package/myReact/archive/testHH1.xml +86 -0
  159. package/myReact/archive/testHH1revu.js +104 -0
  160. package/myReact/archive/testHH2.js +122 -0
  161. package/myReact/archive/testHH2.xml +79 -0
  162. package/myReact/archive/testHH3.js +130 -0
  163. package/myReact/archive/testHH3.xml +86 -0
  164. package/myReact/archive/testHHabort.js +121 -0
  165. package/myReact/archive/testHHabort.xml +83 -0
  166. package/myReact/archive/testMakeawait.js +202 -0
  167. package/myReact/archive/testRun1.js +168 -0
  168. package/myReact/archive/testRun1.xml +142 -0
  169. package/myReact/archive/titi.js +28 -0
  170. package/myReact/archive/titi.xml +110 -0
  171. package/myReact/archive/toto.js +73 -0
  172. package/myReact/archive/toto.xml +198 -0
  173. package/myReact/archive/trap-await-parallelNode.js +123 -0
  174. package/myReact/inutiles/hiver2022.xml +804 -0
  175. package/myReact/inutiles/hopeNode.xml +459 -0
  176. package/myReact/inutiles/mars2022.xml +871 -0
  177. package/myReact/inutiles/mystique1.xml +318 -0
  178. package/myReact/inutiles/mystiqueOSC.xml +277 -0
  179. package/myReact/inutiles/opus5Node.xml +1271 -0
  180. package/myReact/inutiles/opus5NodeLinux.xml +1241 -0
  181. package/myReact/inutiles/orchestrationHH.xml +541 -0
  182. package/myReact/inutiles/orchestrationHH2.xml +547 -0
  183. package/myReact/inutiles/testHH.xml +95 -0
  184. package/myReact/inutiles/trouveLaPercuTenor.xml +349 -0
  185. package/myReact/myReact.js +744 -0
  186. package/myReact/myReact.min.js +1 -0
  187. package/myReact/orchestrationHH.js +311 -0
  188. package/myReact/orchestrationHH.mjs +436 -0
  189. package/myReact/orchestrationHH.mjs.map +1 -0
  190. package/package.json +46 -0
  191. package/serveur/OSCandMidi.mjs +361 -0
  192. package/serveur/computeScore.mjs +415 -0
  193. package/serveur/controleDAW.mjs +1149 -0
  194. package/serveur/defaultSession.csv +2 -0
  195. package/serveur/defaultSkiniParametres.js +119 -0
  196. package/serveur/gameOSC.mjs +96 -0
  197. package/serveur/groupeClientsSons.mjs +1014 -0
  198. package/serveur/ipConfig.json +24 -0
  199. package/serveur/ipConfig127.json +19 -0
  200. package/serveur/ipConfig75.json +17 -0
  201. package/serveur/ipConfigBH.json +19 -0
  202. package/serveur/ipConfigLocal.json +19 -0
  203. package/serveur/midiConfig.json +26 -0
  204. package/serveur/midiConfigBH.json +26 -0
  205. package/serveur/midiConfigVoid.json +3 -0
  206. package/serveur/midimix.mjs +570 -0
  207. package/serveur/saveParam.mjs +159 -0
  208. package/serveur/skiniParametres.good.js +132 -0
  209. package/serveur/skiniParametres.js +106 -0
  210. package/serveur/utilsHHSkini.hh.js +64 -0
  211. package/serveur/utilsSkini.mjs +137 -0
  212. package/serveur/websocketServer.mjs +2052 -0
  213. package/serveur/workerInterfaceZ.mjs +327 -0
  214. package/serveur/workerSynchro.mjs +49 -0
  215. package/skini.mjs +141 -0
@@ -0,0 +1,175 @@
1
+ import { getRect, css, matrix, isRectEqual, indexOfObject } from './utils.js';
2
+ import Sortable from './Sortable.js';
3
+
4
+ export default function AnimationStateManager() {
5
+ let animationStates = [],
6
+ animationCallbackId;
7
+
8
+ return {
9
+ captureAnimationState() {
10
+ animationStates = [];
11
+ if (!this.options.animation) return;
12
+ let children = [].slice.call(this.el.children);
13
+
14
+ children.forEach(child => {
15
+ if (css(child, 'display') === 'none' || child === Sortable.ghost) return;
16
+ animationStates.push({
17
+ target: child,
18
+ rect: getRect(child)
19
+ });
20
+ let fromRect = { ...animationStates[animationStates.length - 1].rect };
21
+
22
+ // If animating: compensate for current animation
23
+ if (child.thisAnimationDuration) {
24
+ let childMatrix = matrix(child, true);
25
+ if (childMatrix) {
26
+ fromRect.top -= childMatrix.f;
27
+ fromRect.left -= childMatrix.e;
28
+ }
29
+ }
30
+
31
+ child.fromRect = fromRect;
32
+ });
33
+ },
34
+
35
+ addAnimationState(state) {
36
+ animationStates.push(state);
37
+ },
38
+
39
+ removeAnimationState(target) {
40
+ animationStates.splice(indexOfObject(animationStates, { target }), 1);
41
+ },
42
+
43
+ animateAll(callback) {
44
+ if (!this.options.animation) {
45
+ clearTimeout(animationCallbackId);
46
+ if (typeof(callback) === 'function') callback();
47
+ return;
48
+ }
49
+
50
+ let animating = false,
51
+ animationTime = 0;
52
+
53
+ animationStates.forEach((state) => {
54
+ let time = 0,
55
+ animatingThis = false,
56
+ target = state.target,
57
+ fromRect = target.fromRect,
58
+ toRect = getRect(target),
59
+ prevFromRect = target.prevFromRect,
60
+ prevToRect = target.prevToRect,
61
+ animatingRect = state.rect,
62
+ targetMatrix = matrix(target, true);
63
+
64
+
65
+ if (targetMatrix) {
66
+ // Compensate for current animation
67
+ toRect.top -= targetMatrix.f;
68
+ toRect.left -= targetMatrix.e;
69
+ }
70
+
71
+ target.toRect = toRect;
72
+
73
+ if (target.thisAnimationDuration) {
74
+ // Could also check if animatingRect is between fromRect and toRect
75
+ if (
76
+ isRectEqual(prevFromRect, toRect) &&
77
+ !isRectEqual(fromRect, toRect) &&
78
+ // Make sure animatingRect is on line between toRect & fromRect
79
+ (animatingRect.top - toRect.top) /
80
+ (animatingRect.left - toRect.left) ===
81
+ (fromRect.top - toRect.top) /
82
+ (fromRect.left - toRect.left)
83
+ ) {
84
+ // If returning to same place as started from animation and on same axis
85
+ time = calculateRealTime(animatingRect, prevFromRect, prevToRect, this.options);
86
+ }
87
+ }
88
+
89
+ // if fromRect != toRect: animate
90
+ if (!isRectEqual(toRect, fromRect)) {
91
+ target.prevFromRect = fromRect;
92
+ target.prevToRect = toRect;
93
+
94
+ if (!time) {
95
+ time = this.options.animation;
96
+ }
97
+ this.animate(
98
+ target,
99
+ animatingRect,
100
+ toRect,
101
+ time
102
+ );
103
+ }
104
+
105
+ if (time) {
106
+ animating = true;
107
+ animationTime = Math.max(animationTime, time);
108
+ clearTimeout(target.animationResetTimer);
109
+ target.animationResetTimer = setTimeout(function() {
110
+ target.animationTime = 0;
111
+ target.prevFromRect = null;
112
+ target.fromRect = null;
113
+ target.prevToRect = null;
114
+ target.thisAnimationDuration = null;
115
+ }, time);
116
+ target.thisAnimationDuration = time;
117
+ }
118
+ });
119
+
120
+
121
+ clearTimeout(animationCallbackId);
122
+ if (!animating) {
123
+ if (typeof(callback) === 'function') callback();
124
+ } else {
125
+ animationCallbackId = setTimeout(function() {
126
+ if (typeof(callback) === 'function') callback();
127
+ }, animationTime);
128
+ }
129
+ animationStates = [];
130
+ },
131
+
132
+ animate(target, currentRect, toRect, duration) {
133
+ if (duration) {
134
+ css(target, 'transition', '');
135
+ css(target, 'transform', '');
136
+ let elMatrix = matrix(this.el),
137
+ scaleX = elMatrix && elMatrix.a,
138
+ scaleY = elMatrix && elMatrix.d,
139
+ translateX = (currentRect.left - toRect.left) / (scaleX || 1),
140
+ translateY = (currentRect.top - toRect.top) / (scaleY || 1);
141
+
142
+ target.animatingX = !!translateX;
143
+ target.animatingY = !!translateY;
144
+
145
+ css(target, 'transform', 'translate3d(' + translateX + 'px,' + translateY + 'px,0)');
146
+
147
+ repaint(target); // repaint
148
+
149
+ css(target, 'transition', 'transform ' + duration + 'ms' + (this.options.easing ? ' ' + this.options.easing : ''));
150
+ css(target, 'transform', 'translate3d(0,0,0)');
151
+ (typeof target.animated === 'number') && clearTimeout(target.animated);
152
+ target.animated = setTimeout(function () {
153
+ css(target, 'transition', '');
154
+ css(target, 'transform', '');
155
+ target.animated = false;
156
+
157
+ target.animatingX = false;
158
+ target.animatingY = false;
159
+ }, duration);
160
+ }
161
+ }
162
+ };
163
+ }
164
+
165
+ function repaint(target) {
166
+ return target.offsetWidth;
167
+ }
168
+
169
+
170
+ function calculateRealTime(animatingRect, fromRect, toRect, options) {
171
+ return (
172
+ Math.sqrt(Math.pow(fromRect.top - animatingRect.top, 2) + Math.pow(fromRect.left - animatingRect.left, 2)) /
173
+ Math.sqrt(Math.pow(fromRect.top - toRect.top, 2) + Math.pow(fromRect.left - toRect.left, 2))
174
+ ) * options.animation;
175
+ }
@@ -0,0 +1,12 @@
1
+ function userAgent(pattern) {
2
+ if (typeof window !== 'undefined' && window.navigator) {
3
+ return !!/*@__PURE__*/navigator.userAgent.match(pattern);
4
+ }
5
+ }
6
+
7
+ export const IE11OrLess = userAgent(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i);
8
+ export const Edge = userAgent(/Edge/i);
9
+ export const FireFox = userAgent(/firefox/i);
10
+ export const Safari = userAgent(/safari/i) && !userAgent(/chrome/i) && !userAgent(/android/i);
11
+ export const IOS = userAgent(/iP(ad|od|hone)/i);
12
+ export const ChromeForAndroid = userAgent(/chrome/i) && userAgent(/android/i);
@@ -0,0 +1,57 @@
1
+ import { IE11OrLess, Edge } from './BrowserInfo.js';
2
+ import { expando } from './utils.js';
3
+ import PluginManager from './PluginManager.js';
4
+
5
+ export default function dispatchEvent(
6
+ {
7
+ sortable, rootEl, name,
8
+ targetEl, cloneEl, toEl, fromEl,
9
+ oldIndex, newIndex,
10
+ oldDraggableIndex, newDraggableIndex,
11
+ originalEvent, putSortable, extraEventProperties
12
+ }
13
+ ) {
14
+ sortable = (sortable || (rootEl && rootEl[expando]));
15
+ if (!sortable) return;
16
+
17
+ let evt,
18
+ options = sortable.options,
19
+ onName = 'on' + name.charAt(0).toUpperCase() + name.substr(1);
20
+ // Support for new CustomEvent feature
21
+ if (window.CustomEvent && !IE11OrLess && !Edge) {
22
+ evt = new CustomEvent(name, {
23
+ bubbles: true,
24
+ cancelable: true
25
+ });
26
+ } else {
27
+ evt = document.createEvent('Event');
28
+ evt.initEvent(name, true, true);
29
+ }
30
+
31
+ evt.to = toEl || rootEl;
32
+ evt.from = fromEl || rootEl;
33
+ evt.item = targetEl || rootEl;
34
+ evt.clone = cloneEl;
35
+
36
+ evt.oldIndex = oldIndex;
37
+ evt.newIndex = newIndex;
38
+
39
+ evt.oldDraggableIndex = oldDraggableIndex;
40
+ evt.newDraggableIndex = newDraggableIndex;
41
+
42
+ evt.originalEvent = originalEvent;
43
+ evt.pullMode = putSortable ? putSortable.lastPutMode : undefined;
44
+
45
+ let allEventProperties = { ...extraEventProperties, ...PluginManager.getEventProperties(name, sortable) };
46
+ for (let option in allEventProperties) {
47
+ evt[option] = allEventProperties[option];
48
+ }
49
+
50
+ if (rootEl) {
51
+ rootEl.dispatchEvent(evt);
52
+ }
53
+
54
+ if (options[onName]) {
55
+ options[onName].call(sortable, evt);
56
+ }
57
+ }
@@ -0,0 +1,87 @@
1
+ let plugins = [];
2
+
3
+ const defaults = {
4
+ initializeByDefault: true
5
+ };
6
+
7
+ export default {
8
+ mount(plugin) {
9
+ // Set default static properties
10
+ for (let option in defaults) {
11
+ if (defaults.hasOwnProperty(option) && !(option in plugin)) {
12
+ plugin[option] = defaults[option];
13
+ }
14
+ }
15
+ plugins.push(plugin);
16
+ },
17
+ pluginEvent(eventName, sortable, evt) {
18
+ this.eventCanceled = false;
19
+ evt.cancel = () => {
20
+ this.eventCanceled = true;
21
+ };
22
+ const eventNameGlobal = eventName + 'Global';
23
+ plugins.forEach(plugin => {
24
+ if (!sortable[plugin.pluginName]) return;
25
+ // Fire global events if it exists in this sortable
26
+ if (
27
+ sortable[plugin.pluginName][eventNameGlobal]
28
+ ) {
29
+ sortable[plugin.pluginName][eventNameGlobal]({ sortable, ...evt });
30
+ }
31
+
32
+ // Only fire plugin event if plugin is enabled in this sortable,
33
+ // and plugin has event defined
34
+ if (
35
+ sortable.options[plugin.pluginName] &&
36
+ sortable[plugin.pluginName][eventName]
37
+ ) {
38
+ sortable[plugin.pluginName][eventName]({ sortable, ...evt });
39
+ }
40
+ });
41
+ },
42
+ initializePlugins(sortable, el, defaults, options) {
43
+ plugins.forEach(plugin => {
44
+ const pluginName = plugin.pluginName;
45
+ if (!sortable.options[pluginName] && !plugin.initializeByDefault) return;
46
+
47
+ let initialized = new plugin(sortable, el, sortable.options);
48
+ initialized.sortable = sortable;
49
+ initialized.options = sortable.options;
50
+ sortable[pluginName] = initialized;
51
+
52
+ // Add default options from plugin
53
+ Object.assign(defaults, initialized.defaults);
54
+ });
55
+
56
+ for (let option in sortable.options) {
57
+ if (!sortable.options.hasOwnProperty(option)) continue;
58
+ let modified = this.modifyOption(sortable, option, sortable.options[option]);
59
+ if (typeof(modified) !== 'undefined') {
60
+ sortable.options[option] = modified;
61
+ }
62
+ }
63
+ },
64
+ getEventProperties(name, sortable) {
65
+ let eventProperties = {};
66
+ plugins.forEach(plugin => {
67
+ if (typeof(plugin.eventProperties) !== 'function') return;
68
+ Object.assign(eventProperties, plugin.eventProperties.call(sortable[plugin.pluginName], name));
69
+ });
70
+
71
+ return eventProperties;
72
+ },
73
+ modifyOption(sortable, name, value) {
74
+ let modifiedValue;
75
+ plugins.forEach(plugin => {
76
+ // Plugin must exist on the Sortable
77
+ if (!sortable[plugin.pluginName]) return;
78
+
79
+ // If static option listener exists for this option, call in the context of the Sortable's instance of this plugin
80
+ if (plugin.optionListeners && typeof(plugin.optionListeners[name]) === 'function') {
81
+ modifiedValue = plugin.optionListeners[name].call(sortable[plugin.pluginName], value);
82
+ }
83
+ });
84
+
85
+ return modifiedValue;
86
+ }
87
+ };