umap-project 2.4.0b2__py3-none-any.whl → 2.4.2__py3-none-any.whl

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.

Potentially problematic release.


This version of umap-project might be problematic. Click here for more details.

Files changed (129) hide show
  1. umap/__init__.py +1 -1
  2. umap/locale/el/LC_MESSAGES/django.po +145 -90
  3. umap/locale/en/LC_MESSAGES/django.po +3 -3
  4. umap/locale/eu/LC_MESSAGES/django.po +145 -89
  5. umap/locale/pt/LC_MESSAGES/django.mo +0 -0
  6. umap/locale/pt/LC_MESSAGES/django.po +87 -37
  7. umap/static/umap/base.css +20 -6
  8. umap/static/umap/content.css +2 -2
  9. umap/static/umap/css/dialog.css +1 -1
  10. umap/static/umap/css/importers.css +2 -0
  11. umap/static/umap/css/panel.css +2 -2
  12. umap/static/umap/css/tooltip.css +1 -1
  13. umap/static/umap/img/16-white.svg +1 -3
  14. umap/static/umap/img/source/16-white.svg +2 -4
  15. umap/static/umap/js/components/alerts/alert.css +1 -1
  16. umap/static/umap/js/components/alerts/alert.js +1 -1
  17. umap/static/umap/js/modules/autocomplete.js +4 -4
  18. umap/static/umap/js/modules/browser.js +11 -11
  19. umap/static/umap/js/modules/caption.js +5 -5
  20. umap/static/umap/js/modules/dompurify.js +2 -3
  21. umap/static/umap/js/modules/facets.js +16 -10
  22. umap/static/umap/js/modules/global.js +16 -16
  23. umap/static/umap/js/modules/help.js +2 -2
  24. umap/static/umap/js/modules/importer.js +6 -6
  25. umap/static/umap/js/modules/importers/geodatamine.js +4 -4
  26. umap/static/umap/js/modules/importers/overpass.js +2 -2
  27. umap/static/umap/js/modules/orderable.js +2 -2
  28. umap/static/umap/js/modules/request.js +1 -1
  29. umap/static/umap/js/modules/rules.js +13 -10
  30. umap/static/umap/js/modules/sync/engine.js +3 -3
  31. umap/static/umap/js/modules/sync/updaters.js +10 -11
  32. umap/static/umap/js/modules/sync/websocket.js +1 -1
  33. umap/static/umap/js/modules/ui/dialog.js +1 -1
  34. umap/static/umap/js/modules/ui/panel.js +1 -1
  35. umap/static/umap/js/modules/ui/tooltip.js +6 -6
  36. umap/static/umap/js/modules/urls.js +1 -2
  37. umap/static/umap/js/modules/utils.js +19 -19
  38. umap/static/umap/js/umap.controls.js +26 -28
  39. umap/static/umap/js/umap.core.js +19 -15
  40. umap/static/umap/js/umap.datalayer.permissions.js +15 -18
  41. umap/static/umap/js/umap.features.js +102 -120
  42. umap/static/umap/js/umap.forms.js +46 -74
  43. umap/static/umap/js/umap.icon.js +17 -22
  44. umap/static/umap/js/umap.js +126 -131
  45. umap/static/umap/js/umap.layer.js +159 -167
  46. umap/static/umap/js/umap.permissions.js +6 -9
  47. umap/static/umap/js/umap.popup.js +20 -20
  48. umap/static/umap/js/umap.share.js +9 -15
  49. umap/static/umap/js/umap.slideshow.js +12 -14
  50. umap/static/umap/js/umap.tableeditor.js +5 -5
  51. umap/static/umap/locale/am_ET.json +5 -2
  52. umap/static/umap/locale/ar.json +5 -2
  53. umap/static/umap/locale/ast.json +5 -2
  54. umap/static/umap/locale/bg.json +5 -2
  55. umap/static/umap/locale/br.json +5 -2
  56. umap/static/umap/locale/ca.json +5 -2
  57. umap/static/umap/locale/cs_CZ.json +5 -2
  58. umap/static/umap/locale/da.json +5 -2
  59. umap/static/umap/locale/de.json +5 -2
  60. umap/static/umap/locale/el.json +10 -7
  61. umap/static/umap/locale/en.js +2 -1
  62. umap/static/umap/locale/en.json +5 -2
  63. umap/static/umap/locale/en_US.json +5 -2
  64. umap/static/umap/locale/es.js +9 -8
  65. umap/static/umap/locale/es.json +12 -9
  66. umap/static/umap/locale/et.json +5 -2
  67. umap/static/umap/locale/fa_IR.json +5 -2
  68. umap/static/umap/locale/fi.json +5 -2
  69. umap/static/umap/locale/fr.js +2 -1
  70. umap/static/umap/locale/fr.json +5 -2
  71. umap/static/umap/locale/gl.json +5 -2
  72. umap/static/umap/locale/he.json +5 -2
  73. umap/static/umap/locale/hr.json +5 -2
  74. umap/static/umap/locale/hu.json +5 -2
  75. umap/static/umap/locale/id.json +5 -2
  76. umap/static/umap/locale/is.json +5 -2
  77. umap/static/umap/locale/it.json +5 -2
  78. umap/static/umap/locale/ja.json +5 -2
  79. umap/static/umap/locale/ko.json +5 -2
  80. umap/static/umap/locale/lt.json +5 -2
  81. umap/static/umap/locale/ms.json +5 -2
  82. umap/static/umap/locale/nl.json +5 -2
  83. umap/static/umap/locale/no.json +5 -2
  84. umap/static/umap/locale/pl.json +5 -2
  85. umap/static/umap/locale/pl_PL.json +5 -2
  86. umap/static/umap/locale/pt.js +61 -60
  87. umap/static/umap/locale/pt.json +64 -61
  88. umap/static/umap/locale/pt_BR.json +5 -2
  89. umap/static/umap/locale/pt_PT.json +5 -2
  90. umap/static/umap/locale/ro.json +5 -2
  91. umap/static/umap/locale/ru.json +5 -2
  92. umap/static/umap/locale/sk_SK.json +5 -2
  93. umap/static/umap/locale/sl.json +5 -2
  94. umap/static/umap/locale/sr.json +5 -2
  95. umap/static/umap/locale/sv.json +5 -2
  96. umap/static/umap/locale/th_TH.json +5 -2
  97. umap/static/umap/locale/tr.json +5 -2
  98. umap/static/umap/locale/uk_UA.json +5 -2
  99. umap/static/umap/locale/vi.json +5 -2
  100. umap/static/umap/locale/vi_VN.json +5 -2
  101. umap/static/umap/locale/zh.json +5 -2
  102. umap/static/umap/locale/zh_CN.json +5 -2
  103. umap/static/umap/locale/zh_TW.Big5.json +5 -2
  104. umap/static/umap/locale/zh_TW.json +5 -2
  105. umap/static/umap/map.css +22 -22
  106. umap/static/umap/unittests/utils.js +5 -5
  107. umap/static/umap/vars.css +12 -1
  108. umap/storage.py +1 -1
  109. umap/tests/integration/test_browser.py +76 -3
  110. umap/tests/integration/test_edit_polygon.py +11 -0
  111. umap/tests/integration/test_map.py +29 -0
  112. umap/tests/integration/test_map_preview.py +36 -2
  113. umap/tests/integration/test_view_marker.py +2 -2
  114. umap/tests/test_views.py +2 -2
  115. umap/views.py +3 -2
  116. {umap_project-2.4.0b2.dist-info → umap_project-2.4.2.dist-info}/METADATA +3 -3
  117. {umap_project-2.4.0b2.dist-info → umap_project-2.4.2.dist-info}/RECORD +120 -129
  118. {umap_project-2.4.0b2.dist-info → umap_project-2.4.2.dist-info}/WHEEL +1 -1
  119. umap/.DS_Store +0 -0
  120. umap/static/.DS_Store +0 -0
  121. umap/static/umap/.DS_Store +0 -0
  122. umap/static/umap/favicons/.DS_Store +0 -0
  123. umap/static/umap/fonts/.DS_Store +0 -0
  124. umap/static/umap/img/.DS_Store +0 -0
  125. umap/static/umap/img/source/.DS_Store +0 -0
  126. umap/tests/.DS_Store +0 -0
  127. umap/tests/integration/.DS_Store +0 -0
  128. {umap_project-2.4.0b2.dist-info → umap_project-2.4.2.dist-info}/entry_points.txt +0 -0
  129. {umap_project-2.4.0b2.dist-info → umap_project-2.4.2.dist-info}/licenses/LICENSE +0 -0
@@ -162,7 +162,7 @@ U.BaseFeatureAction = L.ToolbarAction.extend({
162
162
  this.postInit()
163
163
  },
164
164
 
165
- postInit: function () {},
165
+ postInit: () => {},
166
166
 
167
167
  hideToolbar: function () {
168
168
  this.map.removeLayer(this.toolbar)
@@ -356,7 +356,7 @@ U.DropControl = L.Class.extend({
356
356
  this.dropzone.classList.add('umap-dragover')
357
357
  },
358
358
 
359
- dragover: function (e) {
359
+ dragover: (e) => {
360
360
  L.DomEvent.stop(e)
361
361
  },
362
362
 
@@ -393,7 +393,7 @@ U.EditControl = L.Control.extend({
393
393
  L.DomEvent.on(
394
394
  enableEditing,
395
395
  'mouseover',
396
- function () {
396
+ () => {
397
397
  map.tooltip.open({
398
398
  content: map.help.displayLabel('TOGGLE_EDIT'),
399
399
  anchor: enableEditing,
@@ -434,9 +434,9 @@ U.MoreControls = L.Control.extend({
434
434
  },
435
435
 
436
436
  toggle: function () {
437
- const pos = this.getPosition(),
438
- corner = this._map._controlCorners[pos],
439
- className = 'umap-more-controls'
437
+ const pos = this.getPosition()
438
+ const corner = this._map._controlCorners[pos]
439
+ const className = 'umap-more-controls'
440
440
  if (L.DomUtil.hasClass(corner, className)) L.DomUtil.removeClass(corner, className)
441
441
  else L.DomUtil.addClass(corner, className)
442
442
  },
@@ -454,10 +454,10 @@ U.PermanentCreditsControl = L.Control.extend({
454
454
 
455
455
  onAdd: function () {
456
456
  const paragraphContainer = L.DomUtil.create(
457
- 'div',
458
- 'umap-permanent-credits-container'
459
- ),
460
- creditsParagraph = L.DomUtil.create('p', '', paragraphContainer)
457
+ 'div',
458
+ 'umap-permanent-credits-container'
459
+ )
460
+ const creditsParagraph = L.DomUtil.create('p', '', paragraphContainer)
461
461
 
462
462
  this.paragraphContainer = paragraphContainer
463
463
  this.setCredits()
@@ -503,7 +503,7 @@ L.Control.Button = L.Control.extend({
503
503
  return container
504
504
  },
505
505
 
506
- afterAdd: function (container) {},
506
+ afterAdd: (container) => {},
507
507
  })
508
508
 
509
509
  U.DataLayersControl = L.Control.Button.extend({
@@ -745,7 +745,7 @@ const ControlsMixin = {
745
745
  L.DomUtil.createLink(
746
746
  'umap-user',
747
747
  rightContainer,
748
- L._(`My Dashboard ({username})`, {
748
+ L._('My Dashboard ({username})', {
749
749
  username: this.options.user.name,
750
750
  }),
751
751
  this.options.user.url
@@ -832,10 +832,10 @@ const ControlsMixin = {
832
832
  row.dataset.id = L.stamp(datalayer)
833
833
  })
834
834
  const onReorder = (src, dst, initialIndex, finalIndex) => {
835
- const layer = this.datalayers[src.dataset.id],
836
- other = this.datalayers[dst.dataset.id],
837
- minIndex = Math.min(layer.getRank(), other.getRank()),
838
- maxIndex = Math.max(layer.getRank(), other.getRank())
835
+ const layer = this.datalayers[src.dataset.id]
836
+ const other = this.datalayers[dst.dataset.id]
837
+ const minIndex = Math.min(layer.getRank(), other.getRank())
838
+ const maxIndex = Math.max(layer.getRank(), other.getRank())
839
839
  if (finalIndex === 0) layer.bringToTop()
840
840
  else if (finalIndex > initialIndex) layer.insertBefore(other)
841
841
  else layer.insertAfter(other)
@@ -948,10 +948,10 @@ U.TileLayerChooser = L.Control.extend({
948
948
  },
949
949
 
950
950
  addTileLayerElement: function (tilelayer, options) {
951
- const selectedClass = this.map.hasLayer(tilelayer) ? 'selected' : '',
952
- el = L.DomUtil.create('li', selectedClass, this._tilelayers_container),
953
- img = L.DomUtil.create('img', '', el),
954
- name = L.DomUtil.create('div', '', el)
951
+ const selectedClass = this.map.hasLayer(tilelayer) ? 'selected' : ''
952
+ const el = L.DomUtil.create('li', selectedClass, this._tilelayers_container)
953
+ const img = L.DomUtil.create('img', '', el)
954
+ const name = L.DomUtil.create('div', '', el)
955
955
  img.src = U.Utils.template(tilelayer.options.url_template, this.map.demoTileInfos)
956
956
  img.loading = 'lazy'
957
957
  name.textContent = tilelayer.options.name
@@ -961,7 +961,7 @@ U.TileLayerChooser = L.Control.extend({
961
961
  function () {
962
962
  this.map.selectTileLayer(tilelayer)
963
963
  this.map._controls.tilelayers.setLayers()
964
- if (options && options.callback) options.callback(tilelayer)
964
+ if (options?.callback) options.callback(tilelayer)
965
965
  },
966
966
  this
967
967
  )
@@ -982,8 +982,8 @@ U.AttributionControl = L.Control.Attribution.extend({
982
982
  this._container.innerHTML = ''
983
983
  const container = L.DomUtil.create('div', 'attribution-container', this._container)
984
984
  container.innerHTML = credits
985
- const shortCredit = this._map.getOption('shortCredit'),
986
- captionMenus = this._map.getOption('captionMenus')
985
+ const shortCredit = this._map.getOption('shortCredit')
986
+ const captionMenus = this._map.getOption('captionMenus')
987
987
  if (shortCredit) {
988
988
  L.DomUtil.element({
989
989
  tagName: 'span',
@@ -1205,9 +1205,7 @@ L.Control.MiniMap.include({
1205
1205
  this._miniMap.addLayer(this._layer)
1206
1206
  },
1207
1207
 
1208
- _cloneLayer: function (layer) {
1209
- return new L.TileLayer(layer._url, L.Util.extend({}, layer.options))
1210
- },
1208
+ _cloneLayer: (layer) => new L.TileLayer(layer._url, L.Util.extend({}, layer.options)),
1211
1209
  })
1212
1210
 
1213
1211
  L.Control.Loading.include({
@@ -1312,7 +1310,7 @@ U.Editable = L.Editable.extend({
1312
1310
  },
1313
1311
 
1314
1312
  drawingTooltip: function (e) {
1315
- if (e.layer instanceof L.Marker && e.type == 'editable:drawing:start') {
1313
+ if (e.layer instanceof L.Marker && e.type === 'editable:drawing:start') {
1316
1314
  this.map.tooltip.open({ content: L._('Click to add a marker') })
1317
1315
  }
1318
1316
  if (!(e.layer instanceof L.Polyline)) {
@@ -1364,7 +1362,7 @@ U.Editable = L.Editable.extend({
1364
1362
  this.map.ui.closeTooltip()
1365
1363
  },
1366
1364
 
1367
- onVertexRawClick: function (e) {
1365
+ onVertexRawClick: (e) => {
1368
1366
  e.layer.onVertexRawClick(e)
1369
1367
  L.DomEvent.stop(e)
1370
1368
  e.cancel()
@@ -1,4 +1,4 @@
1
- L.Util.copyToClipboard = function (textToCopy) {
1
+ L.Util.copyToClipboard = (textToCopy) => {
2
2
  // https://stackoverflow.com/a/65996386
3
3
  // Navigator clipboard api needs a secure context (https)
4
4
  if (navigator.clipboard && window.isSecureContext) {
@@ -25,10 +25,10 @@ L.Util.copyToClipboard = function (textToCopy) {
25
25
  }
26
26
  }
27
27
 
28
- L.Util.queryString = function (name, fallback) {
28
+ L.Util.queryString = (name, fallback) => {
29
29
  const decode = (s) => decodeURIComponent(s.replace(/\+/g, ' '))
30
- const qs = window.location.search.slice(1).split('&'),
31
- qa = {}
30
+ const qs = window.location.search.slice(1).split('&')
31
+ const qa = {}
32
32
  for (const i in qs) {
33
33
  const key = qs[i].split('=')
34
34
  if (!key) continue
@@ -37,27 +37,27 @@ L.Util.queryString = function (name, fallback) {
37
37
  return qa[name] || fallback
38
38
  }
39
39
 
40
- L.Util.booleanFromQueryString = function (name) {
40
+ L.Util.booleanFromQueryString = (name) => {
41
41
  const value = L.Util.queryString(name)
42
42
  return value === '1' || value === 'true'
43
43
  }
44
44
 
45
- L.Util.setFromQueryString = function (options, name) {
45
+ L.Util.setFromQueryString = (options, name) => {
46
46
  const value = L.Util.queryString(name)
47
47
  if (typeof value !== 'undefined') options[name] = value
48
48
  }
49
49
 
50
- L.Util.setBooleanFromQueryString = function (options, name) {
50
+ L.Util.setBooleanFromQueryString = (options, name) => {
51
51
  const value = L.Util.queryString(name)
52
- if (typeof value !== 'undefined') options[name] = value == '1' || value == 'true'
52
+ if (typeof value !== 'undefined') options[name] = value === '1' || value === 'true'
53
53
  }
54
54
 
55
- L.Util.setNumberFromQueryString = function (options, name) {
55
+ L.Util.setNumberFromQueryString = (options, name) => {
56
56
  const value = +L.Util.queryString(name)
57
- if (!isNaN(value)) options[name] = value
57
+ if (!Number.isNaN(value)) options[name] = value
58
58
  }
59
59
 
60
- L.Util.setNullableBooleanFromQueryString = function (options, name) {
60
+ L.Util.setNullableBooleanFromQueryString = (options, name) => {
61
61
  let value = L.Util.queryString(name)
62
62
  if (typeof value !== 'undefined') {
63
63
  if (value === 'null') value = null
@@ -192,7 +192,7 @@ L.DomUtil.after = (target, el) => {
192
192
  // convert colour in range 0-255 to the modifier used within luminance calculation
193
193
  L.DomUtil.colourMod = (colour) => {
194
194
  const sRGB = colour / 255
195
- let mod = Math.pow((sRGB + 0.055) / 1.055, 2.4)
195
+ let mod = ((sRGB + 0.055) / 1.055) ** 2.4
196
196
  if (sRGB < 0.03928) mod = sRGB / 12.92
197
197
  return mod
198
198
  }
@@ -222,7 +222,11 @@ L.DomUtil.contrastedColor = (el, bgcolor) => {
222
222
  let rgb = window.getComputedStyle(el).getPropertyValue('background-color')
223
223
  rgb = L.DomUtil.RGBRegex.exec(rgb)
224
224
  if (!rgb || rgb.length !== 4) return out
225
- rgb = [parseInt(rgb[1], 10), parseInt(rgb[2], 10), parseInt(rgb[3], 10)]
225
+ rgb = [
226
+ Number.parseInt(rgb[1], 10),
227
+ Number.parseInt(rgb[2], 10),
228
+ Number.parseInt(rgb[3], 10),
229
+ ]
226
230
  out = L.DomUtil.contrastWCAG21(rgb)
227
231
  if (bgcolor) _CACHE_CONSTRAST[bgcolor] = out
228
232
  return out
@@ -247,9 +251,9 @@ L.DomEvent.once = (el, types, fn, context) => {
247
251
 
248
252
  L.LatLng.prototype.isValid = function () {
249
253
  return (
250
- isFinite(this.lat) &&
254
+ Number.isFinite(this.lat) &&
251
255
  Math.abs(this.lat) <= 90 &&
252
- isFinite(this.lng) &&
256
+ Number.isFinite(this.lng) &&
253
257
  Math.abs(this.lng) <= 180
254
258
  )
255
259
  }
@@ -7,15 +7,12 @@ U.DataLayerPermissions = L.Class.extend({
7
7
  this.options = L.Util.setOptions(this, datalayer.options.permissions)
8
8
  this.datalayer = datalayer
9
9
  let isDirty = false
10
- const self = this
11
10
  try {
12
11
  Object.defineProperty(this, 'isDirty', {
13
- get: function () {
14
- return isDirty
15
- },
16
- set: function (status) {
12
+ get: () => isDirty,
13
+ set: (status) => {
17
14
  isDirty = status
18
- if (status) self.datalayer.isDirty = status
15
+ if (status) this.datalayer.isDirty = status
19
16
  },
20
17
  })
21
18
  } catch (e) {
@@ -29,19 +26,19 @@ U.DataLayerPermissions = L.Class.extend({
29
26
 
30
27
  edit: function (container) {
31
28
  const fields = [
32
- [
33
- 'options.edit_status',
34
- {
35
- handler: 'IntSelect',
36
- label: L._('Who can edit "{layer}"', { layer: this.datalayer.getName() }),
37
- selectOptions: this.datalayer.map.options.datalayer_edit_statuses,
38
- },
39
- ],
29
+ [
30
+ 'options.edit_status',
31
+ {
32
+ handler: 'IntSelect',
33
+ label: L._('Who can edit "{layer}"', { layer: this.datalayer.getName() }),
34
+ selectOptions: this.datalayer.map.options.datalayer_edit_statuses,
35
+ },
40
36
  ],
41
- builder = new U.FormBuilder(this, fields, {
42
- className: 'umap-form datalayer-permissions',
43
- }),
44
- form = builder.build()
37
+ ]
38
+ const builder = new U.FormBuilder(this, fields, {
39
+ className: 'umap-form datalayer-permissions',
40
+ })
41
+ const form = builder.build()
45
42
  container.appendChild(form)
46
43
  },
47
44