umap-project 3.1.2__py3-none-any.whl → 3.2.0__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 (151) hide show
  1. umap/__init__.py +1 -1
  2. umap/locale/en/LC_MESSAGES/django.po +21 -17
  3. umap/locale/fr/LC_MESSAGES/django.mo +0 -0
  4. umap/locale/fr/LC_MESSAGES/django.po +21 -17
  5. umap/management/commands/export_pictogram.py +29 -0
  6. umap/management/commands/migrate_to_S3.py +5 -1
  7. umap/management/commands/purge_old_versions.py +8 -6
  8. umap/settings/__init__.py +21 -0
  9. umap/settings/base.py +1 -0
  10. umap/static/umap/content.css +7 -2
  11. umap/static/umap/css/icon.css +77 -3
  12. umap/static/umap/css/panel.css +31 -1
  13. umap/static/umap/js/modules/browser.js +1 -1
  14. umap/static/umap/js/modules/data/features.js +14 -29
  15. umap/static/umap/js/modules/data/layer.js +248 -136
  16. umap/static/umap/js/modules/facets.js +2 -2
  17. umap/static/umap/js/modules/form/fields.js +56 -19
  18. umap/static/umap/js/modules/formatter.js +36 -8
  19. umap/static/umap/js/modules/importers/opendata.js +23 -6
  20. umap/static/umap/js/modules/managers.js +59 -0
  21. umap/static/umap/js/modules/rendering/icon.js +3 -5
  22. umap/static/umap/js/modules/rendering/layers/classified.js +8 -7
  23. umap/static/umap/js/modules/rendering/map.js +1 -1
  24. umap/static/umap/js/modules/rendering/ui.js +13 -0
  25. umap/static/umap/js/modules/rules.js +76 -23
  26. umap/static/umap/js/modules/schema.js +3 -0
  27. umap/static/umap/js/modules/slideshow.js +1 -1
  28. umap/static/umap/js/modules/sync/updaters.js +1 -6
  29. umap/static/umap/js/modules/tableeditor.js +13 -37
  30. umap/static/umap/js/modules/templates.js +7 -6
  31. umap/static/umap/js/modules/ui/panel.js +7 -0
  32. umap/static/umap/js/modules/umap.js +17 -6
  33. umap/static/umap/js/modules/utils.js +8 -7
  34. umap/static/umap/locale/am_ET.js +43 -6
  35. umap/static/umap/locale/am_ET.json +43 -6
  36. umap/static/umap/locale/ar.js +43 -6
  37. umap/static/umap/locale/ar.json +43 -6
  38. umap/static/umap/locale/ast.js +43 -6
  39. umap/static/umap/locale/ast.json +43 -6
  40. umap/static/umap/locale/bg.js +43 -6
  41. umap/static/umap/locale/bg.json +43 -6
  42. umap/static/umap/locale/br.js +30 -26
  43. umap/static/umap/locale/br.json +30 -26
  44. umap/static/umap/locale/ca.js +50 -13
  45. umap/static/umap/locale/ca.json +50 -13
  46. umap/static/umap/locale/cs_CZ.js +43 -6
  47. umap/static/umap/locale/cs_CZ.json +43 -6
  48. umap/static/umap/locale/da.js +10 -6
  49. umap/static/umap/locale/da.json +10 -6
  50. umap/static/umap/locale/de.js +10 -6
  51. umap/static/umap/locale/de.json +10 -6
  52. umap/static/umap/locale/el.js +20 -10
  53. umap/static/umap/locale/el.json +20 -10
  54. umap/static/umap/locale/en.js +10 -6
  55. umap/static/umap/locale/en.json +10 -6
  56. umap/static/umap/locale/en_US.json +43 -6
  57. umap/static/umap/locale/es.js +10 -6
  58. umap/static/umap/locale/es.json +10 -6
  59. umap/static/umap/locale/et.js +43 -6
  60. umap/static/umap/locale/et.json +43 -6
  61. umap/static/umap/locale/eu.js +43 -6
  62. umap/static/umap/locale/eu.json +43 -6
  63. umap/static/umap/locale/fa_IR.js +43 -6
  64. umap/static/umap/locale/fa_IR.json +43 -6
  65. umap/static/umap/locale/fi.js +43 -6
  66. umap/static/umap/locale/fi.json +43 -6
  67. umap/static/umap/locale/fr.js +10 -6
  68. umap/static/umap/locale/fr.json +10 -6
  69. umap/static/umap/locale/gl.js +43 -6
  70. umap/static/umap/locale/gl.json +43 -6
  71. umap/static/umap/locale/he.js +43 -6
  72. umap/static/umap/locale/he.json +43 -6
  73. umap/static/umap/locale/hr.js +43 -6
  74. umap/static/umap/locale/hr.json +43 -6
  75. umap/static/umap/locale/hu.js +34 -24
  76. umap/static/umap/locale/hu.json +34 -24
  77. umap/static/umap/locale/id.js +43 -6
  78. umap/static/umap/locale/id.json +43 -6
  79. umap/static/umap/locale/is.js +43 -6
  80. umap/static/umap/locale/is.json +43 -6
  81. umap/static/umap/locale/it.js +10 -6
  82. umap/static/umap/locale/it.json +10 -6
  83. umap/static/umap/locale/ja.js +43 -6
  84. umap/static/umap/locale/ja.json +43 -6
  85. umap/static/umap/locale/ko.js +43 -6
  86. umap/static/umap/locale/ko.json +43 -6
  87. umap/static/umap/locale/lt.js +43 -6
  88. umap/static/umap/locale/lt.json +43 -6
  89. umap/static/umap/locale/ms.js +43 -6
  90. umap/static/umap/locale/ms.json +43 -6
  91. umap/static/umap/locale/nl.js +10 -6
  92. umap/static/umap/locale/nl.json +10 -6
  93. umap/static/umap/locale/no.js +43 -6
  94. umap/static/umap/locale/no.json +43 -6
  95. umap/static/umap/locale/pl.js +43 -6
  96. umap/static/umap/locale/pl.json +43 -6
  97. umap/static/umap/locale/pl_PL.json +43 -6
  98. umap/static/umap/locale/pt.js +43 -6
  99. umap/static/umap/locale/pt.json +43 -6
  100. umap/static/umap/locale/pt_BR.js +53 -16
  101. umap/static/umap/locale/pt_BR.json +53 -16
  102. umap/static/umap/locale/pt_PT.js +43 -6
  103. umap/static/umap/locale/pt_PT.json +43 -6
  104. umap/static/umap/locale/ro.js +43 -6
  105. umap/static/umap/locale/ro.json +43 -6
  106. umap/static/umap/locale/ru.js +43 -6
  107. umap/static/umap/locale/ru.json +43 -6
  108. umap/static/umap/locale/sk_SK.js +43 -6
  109. umap/static/umap/locale/sk_SK.json +43 -6
  110. umap/static/umap/locale/sl.js +43 -6
  111. umap/static/umap/locale/sl.json +43 -6
  112. umap/static/umap/locale/sr.js +43 -6
  113. umap/static/umap/locale/sr.json +43 -6
  114. umap/static/umap/locale/sv.js +43 -6
  115. umap/static/umap/locale/sv.json +43 -6
  116. umap/static/umap/locale/th_TH.js +43 -6
  117. umap/static/umap/locale/th_TH.json +43 -6
  118. umap/static/umap/locale/tr.js +43 -6
  119. umap/static/umap/locale/tr.json +43 -6
  120. umap/static/umap/locale/uk_UA.js +43 -6
  121. umap/static/umap/locale/uk_UA.json +43 -6
  122. umap/static/umap/locale/vi.js +43 -6
  123. umap/static/umap/locale/vi.json +43 -6
  124. umap/static/umap/locale/vi_VN.json +43 -6
  125. umap/static/umap/locale/zh.js +43 -6
  126. umap/static/umap/locale/zh.json +43 -6
  127. umap/static/umap/locale/zh_CN.json +43 -6
  128. umap/static/umap/locale/zh_TW.Big5.json +43 -6
  129. umap/static/umap/locale/zh_TW.js +43 -6
  130. umap/static/umap/locale/zh_TW.json +43 -6
  131. umap/static/umap/map.css +239 -65
  132. umap/static/umap/vendors/betterknown/betterknown.mjs +287 -0
  133. umap/storage/fs.py +3 -2
  134. umap/templates/base.html +4 -1
  135. umap/tests/base.py +9 -1
  136. umap/tests/integration/test_basics.py +1 -1
  137. umap/tests/integration/test_conditional_rules.py +62 -20
  138. umap/tests/integration/test_edit_datalayer.py +1 -1
  139. umap/tests/integration/test_edit_marker.py +1 -1
  140. umap/tests/integration/test_export_map.py +10 -0
  141. umap/tests/integration/test_import.py +140 -0
  142. umap/tests/integration/test_optimistic_merge.py +72 -12
  143. umap/tests/integration/test_tableeditor.py +6 -3
  144. umap/utils.py +33 -0
  145. umap/views.py +16 -2
  146. umap_project-3.2.0.dist-info/METADATA +76 -0
  147. {umap_project-3.1.2.dist-info → umap_project-3.2.0.dist-info}/RECORD +150 -148
  148. umap_project-3.1.2.dist-info/METADATA +0 -68
  149. {umap_project-3.1.2.dist-info → umap_project-3.2.0.dist-info}/WHEEL +0 -0
  150. {umap_project-3.1.2.dist-info → umap_project-3.2.0.dist-info}/entry_points.txt +0 -0
  151. {umap_project-3.1.2.dist-info → umap_project-3.2.0.dist-info}/licenses/LICENSE +0 -0
@@ -15,14 +15,17 @@
15
15
  box-sizing: border-box;
16
16
  counter-reset: step;
17
17
  }
18
+
18
19
  .panel.dark {
19
20
  border: 1px solid #222;
20
21
  }
22
+
21
23
  .panel.full {
22
24
  width: initial;
23
25
  right: -100%;
24
26
  z-index: calc(var(--zindex-panels) + 1);
25
27
  }
28
+
26
29
  .panel.full.on {
27
30
  visibility: visible;
28
31
  right: calc(var(--panel-gutter) * 2 + var(--control-size));
@@ -30,29 +33,45 @@
30
33
  height: initial;
31
34
  max-height: initial;
32
35
  }
36
+
33
37
  .panel .umap-popup-content img {
34
38
  /* See https://github.com/Leaflet/Leaflet/commit/61d746818b99d362108545c151a27f09d60960ee#commitcomment-6061847 */
35
39
  max-width: 99% !important;
36
40
  }
41
+
37
42
  .panel .umap-popup-content {
38
43
  max-height: inherit;
39
44
  }
45
+
40
46
  .panel .body {
41
- height: calc(100% - var(--panel-header-height)); /* Minus size of toolbox */
47
+ /* Minus size of toolbox */
48
+ height: calc(100% - var(--panel-header-height));
42
49
  padding: var(--panel-gutter);
43
50
  }
51
+
44
52
  .panel h3 {
45
53
  display: flex;
46
54
  align-items: center;
47
55
  }
56
+
48
57
  .panel .counter::before {
49
58
  counter-increment: step;
50
59
  content: counter(step) ". ";
51
60
  }
61
+
52
62
  .panel .counter {
53
63
  display: block;
54
64
  margin-top: var(--panel-gutter);
55
65
  }
66
+
67
+ .panel.dark details[open] {
68
+ border-left: 2px solid var(--color-accent);
69
+ }
70
+
71
+ .panel.dark details[open] summary {
72
+ background-color: var(--color-veryDarkGray);
73
+ }
74
+
56
75
  @media all and (orientation:landscape) {
57
76
  .panel {
58
77
  top: var(--current-header-height);
@@ -60,28 +79,35 @@
60
79
  width: var(--panel-width);
61
80
  max-width: calc(100% - var(--panel-gutter) * 2 - var(--control-size))
62
81
  }
82
+
63
83
  .panel.condensed {
64
84
  max-height: calc(min(500px, 100% - var(--current-header-height) - var(--current-footer-height) - var(--panel-gutter) * 2));
65
85
  bottom: initial;
66
86
  }
87
+
67
88
  .panel.right {
68
89
  right: calc(0px - var(--panel-width));
69
90
  }
91
+
70
92
  .panel.left {
71
93
  left: calc(0px - var(--panel-width));
72
94
  }
95
+
73
96
  .panel.left.on {
74
97
  left: calc(var(--panel-gutter) * 2 + var(--control-size));
75
98
  visibility: visible;
76
99
  }
100
+
77
101
  .panel.right.on {
78
102
  right: calc(var(--panel-gutter) * 2 + var(--control-size));
79
103
  visibility: visible;
80
104
  }
105
+
81
106
  .panel-left-on .panel.full {
82
107
  left: calc(var(--panel-gutter) * 3 + var(--control-size) + var(--panel-width));
83
108
  }
84
109
  }
110
+
85
111
  @media all and (orientation:portrait) {
86
112
  .panel {
87
113
  height: 50%;
@@ -90,18 +116,22 @@
90
116
  bottom: var(--current-footer-height);
91
117
  right: -100%;
92
118
  }
119
+
93
120
  .panel.left {
94
121
  left: -100%;
95
122
  }
123
+
96
124
  .panel.on {
97
125
  right: 0;
98
126
  left: 0;
99
127
  visibility: visible;
100
128
  }
129
+
101
130
  .panel.expanded {
102
131
  height: calc(100% - var(--current-footer-height));
103
132
  max-height: calc(100% - var(--current-footer-height));
104
133
  }
134
+
105
135
  .umap-caption-bar-enabled .panel {
106
136
  border-bottom-left-radius: 0;
107
137
  border-bottom-right-radius: 0;
@@ -90,7 +90,7 @@ export default class Browser {
90
90
  const label = parent.querySelector('.datalayer-name')
91
91
  const container = parent.querySelector('ul')
92
92
  container.innerHTML = ''
93
- datalayer.eachFeature((feature) => this.addFeature(feature, container))
93
+ datalayer.features.forEach((feature) => this.addFeature(feature, container))
94
94
  datalayer.propagate(['properties.name'])
95
95
  const total = datalayer.count()
96
96
  if (!total) return
@@ -3,7 +3,6 @@ import {
3
3
  DomUtil,
4
4
  GeoJSON,
5
5
  LineUtil,
6
- stamp,
7
6
  } from '../../../vendors/leaflet/leaflet-src.esm.js'
8
7
  import { uMapAlert as Alert } from '../../components/alerts/alert.js'
9
8
  import { MutatingForm } from '../form/builder.js'
@@ -84,6 +83,11 @@ class Feature {
84
83
  this.pushGeometry()
85
84
  }
86
85
 
86
+ get fields() {
87
+ // Fields are user defined properties
88
+ return [...this.datalayer.fields, ...this._umap.fields]
89
+ }
90
+
87
91
  isOnScreen(bounds) {
88
92
  return this.ui?.isOnScreen(bounds)
89
93
  }
@@ -198,14 +202,13 @@ class Feature {
198
202
  if (this._umap.currentFeature === this) {
199
203
  this.view()
200
204
  }
201
- this.datalayer.indexProperties(this)
202
205
  }
203
206
  this.redraw()
204
207
  }
205
208
 
206
209
  edit(event) {
207
210
  if (!this._umap.editEnabled || this.isReadOnly()) return
208
- if (this._umap.editedFeature === this && !event.force) return
211
+ if (this._umap.editedFeature === this && !event?.force) return
209
212
  const container = DomUtil.create('div', 'umap-feature-container')
210
213
  DomUtil.createTitle(
211
214
  container,
@@ -221,30 +224,20 @@ class Feature {
221
224
  container.appendChild(builder.build())
222
225
 
223
226
  const properties = []
224
- let labelKeyFound = undefined
225
- for (const property of this.datalayer.allProperties()) {
226
- if (!labelKeyFound && U.LABEL_KEYS.includes(property)) {
227
- labelKeyFound = property
228
- continue
227
+ for (const field of this.fields) {
228
+ let handler = 'Input'
229
+ if (field.key === 'description' || field.type === 'Text') {
230
+ handler = 'Textarea'
229
231
  }
230
- if (property === 'description') {
231
- continue
232
- }
233
- properties.push([`properties.${property}`, { label: property }])
234
- }
235
- // We always want name and description for now (properties management to come)
236
- properties.unshift('properties.description')
237
- if (!labelKeyFound) {
238
- labelKeyFound = U.DEFAULT_LABEL_KEY
232
+ properties.push([`properties.${field.key}`, { label: field.key, handler }])
239
233
  }
240
- properties.unshift([`properties.${labelKeyFound}`, { label: labelKeyFound }])
241
234
  builder = new MutatingForm(this, properties, {
242
235
  id: 'umap-feature-properties',
243
236
  })
244
237
  const form = builder.build()
245
238
  container.appendChild(form)
246
239
  const button = Utils.loadTemplate(
247
- `<button type="button"><i class="icon icon-16 icon-add"></i>${translate('Add a new property')}</button>`
240
+ `<button type="button"><i class="icon icon-16 icon-add"></i>${translate('Add a new field')}</button>`
248
241
  )
249
242
  button.addEventListener('click', () => {
250
243
  this.datalayer.addProperty().then(() => this.edit({ force: true }))
@@ -258,7 +251,7 @@ class Feature {
258
251
  this.getAdvancedEditActions(advancedActions)
259
252
  const onLoad = this._umap.editPanel.open({ content: container })
260
253
  onLoad.then(() => {
261
- builder.helpers[`properties.${labelKeyFound}`].input.focus()
254
+ builder.form.querySelector('input')?.focus()
262
255
  })
263
256
  this._umap.editedFeature = this
264
257
  if (!this.ui.isOnScreen(this._umap._leafletMap.getBounds())) this.zoomTo(event)
@@ -378,8 +371,6 @@ class Feature {
378
371
 
379
372
  connectToDataLayer(datalayer) {
380
373
  this.datalayer = datalayer
381
- // FIXME should be in layer/ui
382
- this.ui.options.renderer = this.datalayer.renderer
383
374
  }
384
375
 
385
376
  disconnectFromDataLayer(datalayer) {
@@ -607,7 +598,7 @@ class Feature {
607
598
  }
608
599
 
609
600
  getRank() {
610
- return this.datalayer._index.indexOf(L.stamp(this))
601
+ return this.datalayer.features.getIndex(this)
611
602
  }
612
603
 
613
604
  redraw() {
@@ -785,12 +776,6 @@ class Path extends Feature {
785
776
  this.ui.setLatLngs(latlngs)
786
777
  }
787
778
 
788
- connectToDataLayer(datalayer) {
789
- super.connectToDataLayer(datalayer)
790
- // We keep markers on their own layer on top of the paths.
791
- this.ui.options.pane = this.datalayer.pane
792
- }
793
-
794
779
  edit(event) {
795
780
  if (this._umap.editEnabled) {
796
781
  super.edit(event)