dragselect 2.5.1 → 2.5.3

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.
@@ -5,14 +5,14 @@ export default class DropZone {
5
5
  * @param {DragSelect} obj.DS
6
6
  * @param {string} obj.id
7
7
  * @param {DSElement} obj.element
8
- * @param {DSInputElements} obj.droppables
8
+ * @param {DSInputElements} [obj.droppables]
9
9
  * @ignore
10
10
  */
11
11
  constructor({ DS, id, element, droppables }: {
12
12
  DS: DragSelect;
13
13
  id: string;
14
14
  element: DSElement;
15
- droppables: DSInputElements;
15
+ droppables?: DSInputElements;
16
16
  });
17
17
  /**
18
18
  * @type {string}
@@ -25,7 +25,7 @@ export default class DropZone {
25
25
  /**
26
26
  * @type {DSElements}
27
27
  */
28
- droppables: DSElements;
28
+ _droppables: DSElements;
29
29
  /**
30
30
  * @type {DOMRect}
31
31
  * @private
@@ -53,6 +53,8 @@ export default class DropZone {
53
53
  private _itemsInside;
54
54
  DS: DragSelect;
55
55
  Settings: Settings;
56
+ set droppables(arg: DSElements);
57
+ get droppables(): DSElements;
56
58
  /**
57
59
  * @param {'add'|'remove'} action
58
60
  */
package/dist/types.d.ts CHANGED
@@ -180,9 +180,18 @@ type CallbackObject = {
180
180
  };
181
181
  type DSCallback = Function;
182
182
  type DSInputDropZone = {
183
+ /**
184
+ * can be any unique identifier of type string
185
+ */
183
186
  id: string;
187
+ /**
188
+ * is the dropzone itself
189
+ */
184
190
  element: DSElement;
185
- droppables: DSInputElements;
191
+ /**
192
+ * the elements that can be dropped into that zone. This is optional, by default it will be all selectables
193
+ */
194
+ droppables?: DSInputElements;
186
195
  };
187
196
  type DSDropZone = {
188
197
  id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dragselect",
3
- "version": "2.5.1",
3
+ "version": "2.5.3",
4
4
  "description": "easy javascript drag select & drop functionality for your projects",
5
5
  "main": "./dist/DragSelect.js",
6
6
  "types": "./dist/DragSelect.d.ts",
@@ -1,7 +1,7 @@
1
1
  // @ts-check
2
2
  import '../types'
3
3
 
4
- import { removeModificationObservers } from './'
4
+ import { removeModificationObservers } from '.'
5
5
 
6
6
  /**
7
7
  * Removes event-listeners from the DOMNode
@@ -32,10 +32,7 @@ export default (nodes, cb) => {
32
32
  /**
33
33
  * Removes all observers
34
34
  */
35
- const cleanup = () => removeModificationObservers(
36
- observer,
37
- callback,
38
- )
35
+ const cleanup = () => removeModificationObservers(observer, callback)
39
36
 
40
37
  return { observer, callback, cleanup }
41
38
  }
@@ -1,6 +1,6 @@
1
1
  // @ts-check
2
2
  import '../types'
3
- import { getCurrentScroll } from './'
3
+ import { getCurrentScroll } from '.'
4
4
 
5
5
  /**
6
6
  * Checks whether the area can scroll or not
@@ -8,12 +8,12 @@ import { getCurrentScroll } from './'
8
8
  * @return {boolean} scroll X/Y
9
9
  */
10
10
  export default (area) => {
11
- let scroll = getCurrentScroll(area)
11
+ const scroll = getCurrentScroll(area)
12
12
  if (scroll.x || scroll.y) return true
13
13
 
14
14
  if (area instanceof Document) {
15
15
  if (area.body) return !!(area.body.scrollTop = 1)
16
- else return !!(area.documentElement.scrollTop = 1)
16
+ return !!(area.documentElement.scrollTop = 1)
17
17
  }
18
18
 
19
19
  return !!(area.scrollTop = 1)
@@ -9,9 +9,8 @@ export default (node) => {
9
9
  toWatch.push(parent)
10
10
  index++
11
11
  return traverse(toWatch, index)
12
- } else {
13
- return toWatch
14
12
  }
13
+ return toWatch
15
14
  }
16
15
 
17
16
  return traverse([node])
@@ -22,15 +22,14 @@ const getComputedTranslatePositions = (element) => {
22
22
  position.y = parseInt(values[13]) || 0
23
23
  }
24
24
  return position
25
- } else {
26
- const match = computed.transform.trim().match(/matrix\((.*?)\)/)
27
- if (match && match.length) {
28
- const values = match[1]?.split(',')
29
- position.x = parseInt(values[4]) || 0
30
- position.y = parseInt(values[5]) || 0
31
- }
32
- return position
33
25
  }
26
+ const match = computed.transform.trim().match(/matrix\((.*?)\)/)
27
+ if (match && match.length) {
28
+ const values = match[1]?.split(',')
29
+ position.x = parseInt(values[4]) || 0
30
+ position.y = parseInt(values[5]) || 0
31
+ }
32
+ return position
34
33
  }
35
34
 
36
35
  /**
@@ -38,7 +37,7 @@ const getComputedTranslatePositions = (element) => {
38
37
  * @return {Vect2}
39
38
  */
40
39
  const getTranslatedPositions = (element) => {
41
- const transform = element.style.transform
40
+ const { transform } = element.style
42
41
 
43
42
  if (!transform || transform.indexOf('translate') < 0)
44
43
  return getComputedTranslatePositions(element)
@@ -68,7 +67,7 @@ const getTranslatedPositions = (element) => {
68
67
  * @return {Vect2}
69
68
  */
70
69
  const getTopLeftPosition = (element) => {
71
- const style = element.style
70
+ const { style } = element
72
71
 
73
72
  const position = {
74
73
  x: parseInt(style.left) || 0,
@@ -96,5 +95,5 @@ const getTopLeftPosition = (element) => {
96
95
  */
97
96
  export default (element, useTranslate) => {
98
97
  if (useTranslate) return getTranslatedPositions(element)
99
- else return getTopLeftPosition(element)
98
+ return getTopLeftPosition(element)
100
99
  }
@@ -8,7 +8,7 @@ import '../types'
8
8
  * @param {DSArea} p.node
9
9
  */
10
10
  export default ({ computedStyle, node }) => {
11
- const position = computedStyle.position
11
+ const { position } = computedStyle
12
12
  const isPositioned =
13
13
  position === 'absolute' || position === 'relative' || position === 'fixed'
14
14
  if (!(node instanceof Document) && !isPositioned)
@@ -1,23 +1,24 @@
1
1
  /**
2
- * @param {string} key
3
- * @param {string} type
2
+ * @param {string} key
3
+ * @param {string} type
4
4
  * @param {*} fallback
5
5
  * @returns {void}
6
6
  */
7
- const wrongTypeWarn = (key, type, fallback) =>
8
- console.warn(`[DragSelect] TypeIssue: setting "${key}" is not of type "${type}".`)
7
+ const wrongTypeWarn = (key, type, fallback) =>
8
+ console.warn(
9
+ `[DragSelect] TypeIssue: setting "${key}" is not of type "${type}".`
10
+ )
9
11
 
10
12
  /**
11
- * @param {string} key
13
+ * @param {string} key
12
14
  * @param {*} value
13
- * @param {boolean} withFallback
14
- * @param {*} fallback
15
+ * @param {boolean} withFallback
16
+ * @param {*} fallback
15
17
  * @returns {object}
16
18
  */
17
19
  const hydrateHelper = (key, value, withFallback, fallback) => {
18
20
  // no value available
19
- if (value === undefined)
20
- return withFallback ? { [key]: fallback } : {}
21
+ if (value === undefined) return withFallback ? { [key]: fallback } : {}
21
22
  // force unsetting of a value
22
23
  if (value === null) return { [key]: null }
23
24
 
@@ -27,31 +28,35 @@ const hydrateHelper = (key, value, withFallback, fallback) => {
27
28
 
28
29
  // TypeCheck [String]
29
30
  const expectedString = typeof fallback === 'string'
30
- if (expectedString) isAvailable = typeof value === 'string' || value instanceof String
31
+ if (expectedString)
32
+ isAvailable = typeof value === 'string' || value instanceof String
31
33
  if (expectedString && !isAvailable) {
32
34
  forceFallback = true
33
35
  wrongTypeWarn(key, 'string', fallback)
34
36
  }
35
37
 
36
38
  // TypeCheck [Number]
37
- const expectedNumber = !isNaN(fallback) && typeof fallback === 'number'
38
- if (expectedNumber) isAvailable = !isNaN(value) && typeof value === 'number'
39
+ const expectedNumber = !Number.isNaN(fallback) && typeof fallback === 'number'
40
+ if (expectedNumber)
41
+ isAvailable = !Number.isNaN(value) && typeof value === 'number'
39
42
  if (expectedNumber && !isAvailable) {
40
43
  forceFallback = true
41
44
  wrongTypeWarn(key, 'number', fallback)
42
45
  }
43
46
 
44
47
  // TypeCheck [Object]
45
- const expectedObject = Object.prototype.toString.call(fallback) === "[object Object]"
46
- if (expectedObject) isAvailable = Object.prototype.toString.call(value) === "[object Object]"
48
+ const expectedObject =
49
+ Object.prototype.toString.call(fallback) === '[object Object]'
50
+ if (expectedObject)
51
+ isAvailable = Object.prototype.toString.call(value) === '[object Object]'
47
52
  if (expectedObject && !isAvailable) {
48
53
  forceFallback = true
49
54
  wrongTypeWarn(key, 'object', fallback)
50
55
  }
51
56
 
52
57
  // TypeCheck [Boolean]
53
- const expectedBoolean = typeof fallback === "boolean"
54
- if (expectedBoolean) isAvailable = typeof value === "boolean"
58
+ const expectedBoolean = typeof fallback === 'boolean'
59
+ if (expectedBoolean) isAvailable = typeof value === 'boolean'
55
60
  if (expectedBoolean && !isAvailable) {
56
61
  forceFallback = true
57
62
  wrongTypeWarn(key, 'boolean', fallback)
@@ -68,59 +73,183 @@ const hydrateHelper = (key, value, withFallback, fallback) => {
68
73
  const isFallback = forceFallback || withFallback
69
74
 
70
75
  // Special rule for [dragKeys]
71
- if (key === 'dragKeys' && isAvailable) return { [key]: Object.assign(fallback, value) }
72
- else if(key === 'dragKeys' && !isAvailable) return isFallback ? { [key]: fallback } : {}
76
+ if (key === 'dragKeys' && isAvailable)
77
+ return { [key]: Object.assign(fallback, value) }
78
+ if (key === 'dragKeys' && !isAvailable)
79
+ return isFallback ? { [key]: fallback } : {}
73
80
 
74
81
  // Special rule for [dropZones]
75
- if (key === 'dropZones' && isAvailable && new Set(value.map(v => v.id)).size !== value.length)
76
- console.warn(`[DragSelect] UniqueConstraintsIssue: setting "dropZones" contains duplicate ids.`)
82
+ if (
83
+ key === 'dropZones' &&
84
+ isAvailable &&
85
+ new Set(value.map((v) => v.id)).size !== value.length
86
+ )
87
+ console.warn(
88
+ `[DragSelect] UniqueConstraintsIssue: setting "dropZones" contains duplicate ids.`
89
+ )
77
90
 
78
- return isAvailable ? { [key]: value } : isFallback ? { [key]: fallback } : {}
91
+ if (isAvailable) return { [key]: value }
92
+ if (isFallback) return { [key]: fallback }
93
+ return {}
79
94
  }
80
95
 
81
96
  /**
82
97
  * This helper method creates the setting object,
83
98
  * - if the settings provided are of wrong type, the fallback value will be used
84
99
  * - - except for if settings are undefined or explicitly marked as "null"
85
- * - if "withfallback" is true, it will return the object with all settings:
100
+ * - if "withfallback" is true, it will return the object with all settings:
86
101
  * - - if not provided from the settings object (or wrong type), the fallback will be used
87
102
  * (the fallback value for each setting is the last prop of the hydrateHelper)
88
- * @param {Settings} settings
89
- * @param {boolean} withFallback
103
+ * @param {Settings} settings
104
+ * @param {boolean} withFallback
90
105
  */
91
106
  export default (settings, withFallback) => ({
92
107
  ...hydrateHelper('area', settings.area, withFallback, document),
93
108
  ...hydrateHelper('selectables', settings.selectables, withFallback, null),
94
- ...hydrateHelper('autoScrollSpeed', settings.autoScrollSpeed, withFallback, 5),
95
- ...hydrateHelper('overflowTolerance', settings.overflowTolerance, withFallback, { x: 25, y: 25 }),
109
+ ...hydrateHelper(
110
+ 'autoScrollSpeed',
111
+ settings.autoScrollSpeed,
112
+ withFallback,
113
+ 5
114
+ ),
115
+ ...hydrateHelper(
116
+ 'overflowTolerance',
117
+ settings.overflowTolerance,
118
+ withFallback,
119
+ { x: 25, y: 25 }
120
+ ),
96
121
  ...hydrateHelper('zoom', settings.zoom, withFallback, 1),
97
122
  ...hydrateHelper('customStyles', settings.customStyles, withFallback, false),
98
- ...hydrateHelper('multiSelectMode', settings.multiSelectMode, withFallback, false),
99
- ...hydrateHelper('multiSelectToggling', settings.multiSelectToggling, withFallback, true),
100
- ...hydrateHelper('multiSelectKeys', settings.multiSelectKeys, withFallback, ['Control', 'Shift', 'Meta']),
123
+ ...hydrateHelper(
124
+ 'multiSelectMode',
125
+ settings.multiSelectMode,
126
+ withFallback,
127
+ false
128
+ ),
129
+ ...hydrateHelper(
130
+ 'multiSelectToggling',
131
+ settings.multiSelectToggling,
132
+ withFallback,
133
+ true
134
+ ),
135
+ ...hydrateHelper('multiSelectKeys', settings.multiSelectKeys, withFallback, [
136
+ 'Control',
137
+ 'Shift',
138
+ 'Meta',
139
+ ]),
101
140
  ...hydrateHelper('selector', settings.selector, withFallback, null),
102
- ...hydrateHelper('selectionThreshold', settings.selectionThreshold, withFallback, 0),
141
+ ...hydrateHelper(
142
+ 'selectionThreshold',
143
+ settings.selectionThreshold,
144
+ withFallback,
145
+ 0
146
+ ),
103
147
  ...hydrateHelper('draggability', settings.draggability, withFallback, true),
104
148
  ...hydrateHelper('immediateDrag', settings.immediateDrag, withFallback, true),
105
149
  ...hydrateHelper('keyboardDrag', settings.keyboardDrag, withFallback, true),
106
- ...hydrateHelper('dragKeys', settings.dragKeys, withFallback, { up: ['ArrowUp'], down: ['ArrowDown'], left: ['ArrowLeft'], right: ['ArrowRight'] }),
107
- ...hydrateHelper('keyboardDragSpeed', settings.keyboardDragSpeed, withFallback, 10),
150
+ ...hydrateHelper('dragKeys', settings.dragKeys, withFallback, {
151
+ up: ['ArrowUp'],
152
+ down: ['ArrowDown'],
153
+ left: ['ArrowLeft'],
154
+ right: ['ArrowRight'],
155
+ }),
156
+ ...hydrateHelper(
157
+ 'keyboardDragSpeed',
158
+ settings.keyboardDragSpeed,
159
+ withFallback,
160
+ 10
161
+ ),
108
162
  ...hydrateHelper('useTransform', settings.useTransform, withFallback, true),
109
- ...hydrateHelper('refreshMemoryRate', settings.refreshMemoryRate, withFallback, 80),
163
+ ...hydrateHelper(
164
+ 'refreshMemoryRate',
165
+ settings.refreshMemoryRate,
166
+ withFallback,
167
+ 80
168
+ ),
110
169
  ...hydrateHelper('dropZones', settings.dropZones, withFallback, []),
111
- ...hydrateHelper('dropInsideThreshold', settings.dropInsideThreshold, withFallback, 1),
112
- ...hydrateHelper('dropTargetThreshold', settings.dropTargetThreshold, withFallback, 0),
113
- ...hydrateHelper('usePointerEvents', settings.usePointerEvents, withFallback, false),
170
+ ...hydrateHelper(
171
+ 'dropInsideThreshold',
172
+ settings.dropInsideThreshold,
173
+ withFallback,
174
+ 1
175
+ ),
176
+ ...hydrateHelper(
177
+ 'dropTargetThreshold',
178
+ settings.dropTargetThreshold,
179
+ withFallback,
180
+ 0
181
+ ),
182
+ ...hydrateHelper(
183
+ 'usePointerEvents',
184
+ settings.usePointerEvents,
185
+ withFallback,
186
+ false
187
+ ),
114
188
  ...hydrateHelper('hoverClass', settings.hoverClass, withFallback, 'ds-hover'),
115
- ...hydrateHelper('selectableClass', settings.selectableClass, withFallback, 'ds-selectable'),
116
- ...hydrateHelper('selectedClass', settings.selectedClass, withFallback, 'ds-selected'),
117
- ...hydrateHelper('selectorClass', settings.selectorClass, withFallback, 'ds-selector'),
118
- ...hydrateHelper('selectorAreaClass', settings.selectorAreaClass, withFallback, 'ds-selector-area'),
119
- ...hydrateHelper('droppedTargetClass', settings.droppedTargetClass, withFallback, 'ds-dropped-target'),
120
- ...hydrateHelper('droppedInsideClass', settings.droppedInsideClass, withFallback, 'ds-dropped-inside'),
121
- ...hydrateHelper('droppableClass', settings.droppableClass, withFallback, 'ds-droppable'),
122
- ...hydrateHelper('dropZoneClass', settings.dropZoneClass, withFallback, 'ds-dropzone'),
123
- ...hydrateHelper('dropZoneReadyClass', settings.dropZoneReadyClass, withFallback, 'ds-dropzone-ready'),
124
- ...hydrateHelper('dropZoneTargetClass', settings.dropZoneTargetClass, withFallback, 'ds-dropzone-target'),
125
- ...hydrateHelper('dropZoneInsideClass', settings.dropZoneInsideClass, withFallback, 'ds-dropzone-inside'),
189
+ ...hydrateHelper(
190
+ 'selectableClass',
191
+ settings.selectableClass,
192
+ withFallback,
193
+ 'ds-selectable'
194
+ ),
195
+ ...hydrateHelper(
196
+ 'selectedClass',
197
+ settings.selectedClass,
198
+ withFallback,
199
+ 'ds-selected'
200
+ ),
201
+ ...hydrateHelper(
202
+ 'selectorClass',
203
+ settings.selectorClass,
204
+ withFallback,
205
+ 'ds-selector'
206
+ ),
207
+ ...hydrateHelper(
208
+ 'selectorAreaClass',
209
+ settings.selectorAreaClass,
210
+ withFallback,
211
+ 'ds-selector-area'
212
+ ),
213
+ ...hydrateHelper(
214
+ 'droppedTargetClass',
215
+ settings.droppedTargetClass,
216
+ withFallback,
217
+ 'ds-dropped-target'
218
+ ),
219
+ ...hydrateHelper(
220
+ 'droppedInsideClass',
221
+ settings.droppedInsideClass,
222
+ withFallback,
223
+ 'ds-dropped-inside'
224
+ ),
225
+ ...hydrateHelper(
226
+ 'droppableClass',
227
+ settings.droppableClass,
228
+ withFallback,
229
+ 'ds-droppable'
230
+ ),
231
+ ...hydrateHelper(
232
+ 'dropZoneClass',
233
+ settings.dropZoneClass,
234
+ withFallback,
235
+ 'ds-dropzone'
236
+ ),
237
+ ...hydrateHelper(
238
+ 'dropZoneReadyClass',
239
+ settings.dropZoneReadyClass,
240
+ withFallback,
241
+ 'ds-dropzone-ready'
242
+ ),
243
+ ...hydrateHelper(
244
+ 'dropZoneTargetClass',
245
+ settings.dropZoneTargetClass,
246
+ withFallback,
247
+ 'ds-dropzone-target'
248
+ ),
249
+ ...hydrateHelper(
250
+ 'dropZoneInsideClass',
251
+ settings.dropZoneInsideClass,
252
+ withFallback,
253
+ 'ds-dropzone-inside'
254
+ ),
126
255
  })
@@ -51,5 +51,5 @@ export default (el1, el2, percent = 0) => {
51
51
  )
52
52
  return true
53
53
  // collision detected!
54
- else return false
54
+ return false
55
55
  }
@@ -24,24 +24,33 @@ import { DropZones, Interaction, SelectedSet } from '../modules'
24
24
  * @param {SelectedSet} p.SelectedSet
25
25
  * @param {DropZones} p.DropZones
26
26
  */
27
- export default ({ subscribe, publish, Interaction, SelectedSet, DropZones }) => {
27
+ export default ({
28
+ subscribe,
29
+ publish,
30
+ Interaction,
31
+ SelectedSet,
32
+ DropZones,
33
+ }) => {
28
34
  const mapping = {
29
35
  'Selected:added': [{ name: 'elementselect' }],
30
36
  'Selected:removed': [{ name: 'elementunselect' }],
31
37
  'Area:scroll': [{ name: 'autoscroll' }], // scroll_directions, scroll_multiplier
32
38
  'Interaction:start': [{ name: 'dragstart' }], // event, isDraggingKeyboard
33
- 'Interaction:update': [ // event, isDraggingKeyboard
39
+ 'Interaction:update': [
40
+ // event, isDraggingKeyboard
34
41
  { name: 'dragmove', condition: (data) => data.event },
35
- ],
36
- 'Interaction:end': [ // event, isDraggingKeyboard
42
+ ],
43
+ 'Interaction:end': [
44
+ // event, isDraggingKeyboard
37
45
  {
38
- name: 'callback', extraData: () => {
46
+ name: 'callback',
47
+ extraData: () => {
39
48
  const target = DropZones.getTarget()
40
49
  return {
41
50
  ...(target ? { dropTarget: target.toObject() } : {}),
42
51
  }
43
- }
44
- }
52
+ },
53
+ },
45
54
  ],
46
55
  }
47
56
 
@@ -1,5 +1,5 @@
1
1
  // @ts-check
2
- import '../types.js'
2
+ import '../types'
3
3
  import DragSelect from '../DragSelect'
4
4
 
5
5
  import {
@@ -17,31 +17,37 @@ export default class Area {
17
17
  * @private
18
18
  */
19
19
  DS
20
+
20
21
  /**
21
22
  * @type {{cleanup:() => void}}
22
23
  * @private
23
24
  */
24
25
  _observers
26
+
25
27
  /**
26
28
  * @type {DSArea}
27
29
  * @private
28
30
  */
29
31
  _node
32
+
30
33
  /**
31
34
  * @type {DSArea[]}
32
35
  * @private
33
36
  */
34
37
  _parentNodes
38
+
35
39
  /**
36
40
  * @type {CSSStyleDeclaration}
37
41
  * @private
38
42
  * */
39
43
  _computedStyle
44
+
40
45
  /**
41
46
  * @type {{top:number,bottom:number,left:number,right:number}}
42
47
  * @private
43
48
  * */
44
49
  _computedBorder
50
+
45
51
  /**
46
52
  * @type {DSBoundingRect}
47
53
  * @private
@@ -105,7 +111,7 @@ export default class Area {
105
111
  this.reset()
106
112
  }
107
113
 
108
- //////////////////////////////////////////////////////////////////////////////////////
114
+ /// ///////////////////////////////////////////////////////////////////////////////////
109
115
  // Scroll
110
116
 
111
117
  /**
@@ -123,7 +129,7 @@ export default class Area {
123
129
  this.DS.PubSub.publish('Area:scroll', data)
124
130
  }
125
131
 
126
- //////////////////////////////////////////////////////////////////////////////////////
132
+ /// ///////////////////////////////////////////////////////////////////////////////////
127
133
  // Node Getters
128
134
 
129
135
  get HTMLNode() {
@@ -154,7 +160,7 @@ export default class Area {
154
160
  return (this._computedStyle = window.getComputedStyle(
155
161
  this.HTMLNode.body || this.HTMLNode.documentElement
156
162
  ))
157
- else return (this._computedStyle = window.getComputedStyle(this.HTMLNode))
163
+ return (this._computedStyle = window.getComputedStyle(this.HTMLNode))
158
164
  }
159
165
 
160
166
  /**
@@ -163,7 +169,10 @@ export default class Area {
163
169
  */
164
170
  get rect() {
165
171
  if (this._rect) return this._rect
166
- return (this._rect = getAreaRect(this.HTMLNode, this.DS.stores.SettingsStore.s.zoom))
172
+ return (this._rect = getAreaRect(
173
+ this.HTMLNode,
174
+ this.DS.stores.SettingsStore.s.zoom
175
+ ))
167
176
  }
168
177
 
169
178
  get parentNodes() {
@@ -10,21 +10,25 @@ export default class Drag {
10
10
  * @private
11
11
  */
12
12
  _prevCursorPos
13
+
13
14
  /**
14
15
  * @type {Vect2}
15
16
  * @private
16
17
  */
17
18
  _prevScrollPos
19
+
18
20
  /**
19
21
  * @type {DSElements}
20
22
  * @private
21
23
  */
22
24
  _elements = []
25
+
23
26
  /**
24
27
  * @type {DSDragKeys}
25
28
  * @private
26
29
  */
27
30
  _dragKeys
31
+
28
32
  /**
29
33
  * @type {string[]}
30
34
  * @private
@@ -51,10 +55,18 @@ export default class Drag {
51
55
 
52
56
  assignDragkeys = () => {
53
57
  this._dragKeys = {
54
- up: this.DS.stores.SettingsStore.s.dragKeys.up.map((k) => k.toLowerCase()),
55
- down: this.DS.stores.SettingsStore.s.dragKeys.down.map((k) => k.toLowerCase()),
56
- left: this.DS.stores.SettingsStore.s.dragKeys.left.map((k) => k.toLowerCase()),
57
- right: this.DS.stores.SettingsStore.s.dragKeys.right.map((k) => k.toLowerCase()),
58
+ up: this.DS.stores.SettingsStore.s.dragKeys.up.map((k) =>
59
+ k.toLowerCase()
60
+ ),
61
+ down: this.DS.stores.SettingsStore.s.dragKeys.down.map((k) =>
62
+ k.toLowerCase()
63
+ ),
64
+ left: this.DS.stores.SettingsStore.s.dragKeys.left.map((k) =>
65
+ k.toLowerCase()
66
+ ),
67
+ right: this.DS.stores.SettingsStore.s.dragKeys.right.map((k) =>
68
+ k.toLowerCase()
69
+ ),
58
70
  }
59
71
  this._dragKeysFlat = [
60
72
  ...this._dragKeys.up,