umap-project 2.2.1__py3-none-any.whl → 2.3.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 (144) hide show
  1. umap/__init__.py +1 -1
  2. umap/static/umap/base.css +83 -44
  3. umap/static/umap/css/icon.css +6 -0
  4. umap/static/umap/css/panel.css +9 -4
  5. umap/static/umap/img/16.svg +2 -2
  6. umap/static/umap/img/source/16.svg +3 -3
  7. umap/static/umap/js/modules/browser.js +63 -22
  8. umap/static/umap/js/modules/facets.js +14 -39
  9. umap/static/umap/js/modules/orderable.js +1 -1
  10. umap/static/umap/js/modules/schema.js +4 -4
  11. umap/static/umap/js/modules/urls.js +1 -1
  12. umap/static/umap/js/modules/utils.js +9 -1
  13. umap/static/umap/js/umap.controls.js +15 -11
  14. umap/static/umap/js/umap.core.js +17 -15
  15. umap/static/umap/js/umap.features.js +8 -2
  16. umap/static/umap/js/umap.forms.js +92 -33
  17. umap/static/umap/js/umap.js +19 -24
  18. umap/static/umap/js/umap.layer.js +3 -6
  19. umap/static/umap/locale/am_ET.js +11 -12
  20. umap/static/umap/locale/am_ET.json +11 -12
  21. umap/static/umap/locale/ar.js +11 -12
  22. umap/static/umap/locale/ar.json +11 -12
  23. umap/static/umap/locale/ast.js +11 -12
  24. umap/static/umap/locale/ast.json +11 -12
  25. umap/static/umap/locale/bg.js +11 -12
  26. umap/static/umap/locale/bg.json +11 -12
  27. umap/static/umap/locale/br.js +11 -12
  28. umap/static/umap/locale/br.json +11 -12
  29. umap/static/umap/locale/ca.js +11 -12
  30. umap/static/umap/locale/ca.json +11 -12
  31. umap/static/umap/locale/cs_CZ.js +11 -12
  32. umap/static/umap/locale/cs_CZ.json +11 -12
  33. umap/static/umap/locale/da.js +11 -12
  34. umap/static/umap/locale/da.json +11 -12
  35. umap/static/umap/locale/de.js +11 -12
  36. umap/static/umap/locale/de.json +11 -12
  37. umap/static/umap/locale/el.js +11 -12
  38. umap/static/umap/locale/el.json +11 -12
  39. umap/static/umap/locale/en.js +11 -12
  40. umap/static/umap/locale/en.json +11 -12
  41. umap/static/umap/locale/en_US.json +11 -12
  42. umap/static/umap/locale/es.js +11 -12
  43. umap/static/umap/locale/es.json +11 -12
  44. umap/static/umap/locale/et.js +11 -12
  45. umap/static/umap/locale/et.json +11 -12
  46. umap/static/umap/locale/eu.js +27 -16
  47. umap/static/umap/locale/eu.json +27 -16
  48. umap/static/umap/locale/fa_IR.js +11 -12
  49. umap/static/umap/locale/fa_IR.json +11 -12
  50. umap/static/umap/locale/fi.js +11 -12
  51. umap/static/umap/locale/fi.json +11 -12
  52. umap/static/umap/locale/fr.js +11 -12
  53. umap/static/umap/locale/fr.json +11 -12
  54. umap/static/umap/locale/gl.js +11 -12
  55. umap/static/umap/locale/gl.json +11 -12
  56. umap/static/umap/locale/he.js +11 -12
  57. umap/static/umap/locale/he.json +11 -12
  58. umap/static/umap/locale/hr.js +11 -12
  59. umap/static/umap/locale/hr.json +11 -12
  60. umap/static/umap/locale/hu.js +29 -30
  61. umap/static/umap/locale/hu.json +29 -30
  62. umap/static/umap/locale/id.js +11 -12
  63. umap/static/umap/locale/id.json +11 -12
  64. umap/static/umap/locale/is.js +11 -12
  65. umap/static/umap/locale/is.json +11 -12
  66. umap/static/umap/locale/it.js +11 -12
  67. umap/static/umap/locale/it.json +11 -12
  68. umap/static/umap/locale/ja.js +11 -12
  69. umap/static/umap/locale/ja.json +11 -12
  70. umap/static/umap/locale/ko.js +11 -12
  71. umap/static/umap/locale/ko.json +11 -12
  72. umap/static/umap/locale/lt.js +11 -12
  73. umap/static/umap/locale/lt.json +11 -12
  74. umap/static/umap/locale/ms.js +20 -21
  75. umap/static/umap/locale/ms.json +20 -21
  76. umap/static/umap/locale/nl.js +11 -12
  77. umap/static/umap/locale/nl.json +11 -12
  78. umap/static/umap/locale/no.js +11 -12
  79. umap/static/umap/locale/no.json +11 -12
  80. umap/static/umap/locale/pl.js +11 -12
  81. umap/static/umap/locale/pl.json +11 -12
  82. umap/static/umap/locale/pl_PL.json +11 -12
  83. umap/static/umap/locale/pt.js +11 -12
  84. umap/static/umap/locale/pt.json +11 -12
  85. umap/static/umap/locale/pt_BR.js +11 -12
  86. umap/static/umap/locale/pt_BR.json +11 -12
  87. umap/static/umap/locale/pt_PT.js +11 -12
  88. umap/static/umap/locale/pt_PT.json +11 -12
  89. umap/static/umap/locale/ro.js +11 -12
  90. umap/static/umap/locale/ro.json +11 -12
  91. umap/static/umap/locale/ru.js +11 -12
  92. umap/static/umap/locale/ru.json +11 -12
  93. umap/static/umap/locale/si.js +240 -227
  94. umap/static/umap/locale/si.json +240 -227
  95. umap/static/umap/locale/sk_SK.js +11 -12
  96. umap/static/umap/locale/sk_SK.json +11 -12
  97. umap/static/umap/locale/sl.js +11 -12
  98. umap/static/umap/locale/sl.json +11 -12
  99. umap/static/umap/locale/sr.js +11 -12
  100. umap/static/umap/locale/sr.json +11 -12
  101. umap/static/umap/locale/sv.js +11 -12
  102. umap/static/umap/locale/sv.json +11 -12
  103. umap/static/umap/locale/th_TH.js +11 -12
  104. umap/static/umap/locale/th_TH.json +11 -12
  105. umap/static/umap/locale/tr.js +11 -12
  106. umap/static/umap/locale/tr.json +11 -12
  107. umap/static/umap/locale/uk_UA.js +11 -12
  108. umap/static/umap/locale/uk_UA.json +11 -12
  109. umap/static/umap/locale/vi.js +11 -12
  110. umap/static/umap/locale/vi.json +11 -12
  111. umap/static/umap/locale/vi_VN.json +11 -12
  112. umap/static/umap/locale/zh.js +11 -12
  113. umap/static/umap/locale/zh.json +11 -12
  114. umap/static/umap/locale/zh_CN.json +11 -12
  115. umap/static/umap/locale/zh_TW.Big5.json +11 -12
  116. umap/static/umap/locale/zh_TW.js +11 -12
  117. umap/static/umap/locale/zh_TW.json +11 -12
  118. umap/static/umap/map.css +17 -2
  119. umap/static/umap/unittests/utils.js +7 -0
  120. umap/static/umap/vars.css +10 -0
  121. umap/static/umap/vendors/dompurify/purify.es.js +54 -5
  122. umap/static/umap/vendors/dompurify/purify.es.mjs.map +1 -0
  123. umap/tests/integration/conftest.py +5 -4
  124. umap/tests/integration/test_browser.py +7 -0
  125. umap/tests/integration/test_choropleth.py +1 -1
  126. umap/tests/integration/test_draw_polygon.py +6 -0
  127. umap/tests/integration/test_draw_polyline.py +6 -0
  128. umap/tests/integration/test_edit_datalayer.py +5 -5
  129. umap/tests/integration/test_edit_map.py +4 -4
  130. umap/tests/integration/test_edit_marker.py +6 -6
  131. umap/tests/integration/test_edit_polygon.py +6 -6
  132. umap/tests/integration/test_facets_browser.py +82 -13
  133. {umap_project-2.2.1.dist-info → umap_project-2.3.0.dist-info}/METADATA +8 -7
  134. {umap_project-2.2.1.dist-info → umap_project-2.3.0.dist-info}/RECORD +137 -143
  135. {umap_project-2.2.1.dist-info → umap_project-2.3.0.dist-info}/WHEEL +1 -1
  136. umap/.DS_Store +0 -0
  137. umap/static/.DS_Store +0 -0
  138. umap/static/umap/.DS_Store +0 -0
  139. umap/static/umap/favicons/.DS_Store +0 -0
  140. umap/static/umap/fonts/.DS_Store +0 -0
  141. umap/tests/.DS_Store +0 -0
  142. umap/tests/integration/.DS_Store +0 -0
  143. {umap_project-2.2.1.dist-info → umap_project-2.3.0.dist-info}/entry_points.txt +0 -0
  144. {umap_project-2.2.1.dist-info → umap_project-2.3.0.dist-info}/licenses/LICENSE +0 -0
@@ -50,7 +50,7 @@ def test_can_edit_on_shift_click(live_server, openmap, page, datalayer):
50
50
  modifier = "Meta" if platform.system() == "Darwin" else "Control"
51
51
  page.goto(f"{live_server.url}{openmap.get_absolute_url()}?edit")
52
52
  page.locator(".leaflet-marker-icon").click(modifiers=[modifier, "Shift"])
53
- expect(page.get_by_role("heading", name="Layer properties")).to_be_visible()
53
+ expect(page.get_by_text("Layer properties")).to_be_visible()
54
54
 
55
55
 
56
56
  def test_marker_style_should_have_precedence(live_server, openmap, page, bootstrap):
@@ -59,7 +59,7 @@ def test_marker_style_should_have_precedence(live_server, openmap, page, bootstr
59
59
  # Change colour at layer level
60
60
  page.get_by_role("link", name="Manage layers").click()
61
61
  page.locator(".panel").get_by_title("Edit", exact=True).click()
62
- page.get_by_role("heading", name="Shape properties").click()
62
+ page.get_by_text("Shape properties").click()
63
63
  page.locator(".umap-field-color .define").click()
64
64
  expect(page.locator(".leaflet-overlay-pane path[fill='DarkBlue']")).to_have_count(1)
65
65
  page.get_by_title("DarkRed").first.click()
@@ -67,7 +67,7 @@ def test_marker_style_should_have_precedence(live_server, openmap, page, bootstr
67
67
 
68
68
  # Now change at polygon level, it should take precedence
69
69
  page.locator("path").click(modifiers=["Shift"])
70
- page.get_by_role("heading", name="Shape properties").click()
70
+ page.get_by_text("Shape properties").click()
71
71
  page.locator("#umap-feature-shape-properties").get_by_text("define").first.click()
72
72
  page.get_by_title("GoldenRod", exact=True).first.click()
73
73
  expect(page.locator(".leaflet-overlay-pane path[fill='GoldenRod']")).to_have_count(
@@ -77,7 +77,7 @@ def test_marker_style_should_have_precedence(live_server, openmap, page, bootstr
77
77
  # Now change again at layer level again, it should not change the marker color
78
78
  page.get_by_role("link", name="Manage layers").click()
79
79
  page.locator(".panel").get_by_title("Edit", exact=True).click()
80
- page.get_by_role("heading", name="Shape properties").click()
80
+ page.get_by_text("Shape properties").click()
81
81
  page.locator(".umap-field-color input").click()
82
82
  page.get_by_title("DarkViolet").first.click()
83
83
  expect(page.locator(".leaflet-overlay-pane path[fill='GoldenRod']")).to_have_count(
@@ -99,7 +99,7 @@ def test_can_remove_stroke(live_server, openmap, page, bootstrap):
99
99
  )
100
100
  page.locator("path").click()
101
101
  page.get_by_role("link", name="Toggle edit mode").click()
102
- page.get_by_role("heading", name="Shape properties").click()
102
+ page.get_by_text("Shape properties").click()
103
103
  page.locator(".umap-field-stroke .define").first.click()
104
104
  page.locator(".umap-field-stroke label").first.click()
105
105
  expect(page.locator(".leaflet-overlay-pane path[stroke='DarkBlue']")).to_have_count(
@@ -111,7 +111,7 @@ def test_can_remove_stroke(live_server, openmap, page, bootstrap):
111
111
  def test_should_reset_style_on_cancel(live_server, openmap, page, bootstrap):
112
112
  page.goto(f"{live_server.url}{openmap.get_absolute_url()}?edit")
113
113
  page.locator("path").click(modifiers=["Shift"])
114
- page.get_by_role("heading", name="Shape properties").click()
114
+ page.get_by_text("Shape properties").click()
115
115
  page.locator("#umap-feature-shape-properties").get_by_text("define").first.click()
116
116
  page.get_by_title("GoldenRod", exact=True).first.click()
117
117
  expect(page.locator(".leaflet-overlay-pane path[fill='GoldenRod']")).to_have_count(
@@ -93,7 +93,7 @@ DATALAYER_DATA3 = {
93
93
 
94
94
 
95
95
  def test_simple_facet_search(live_server, page, map):
96
- map.settings["properties"]["onLoadPanel"] = "facet"
96
+ map.settings["properties"]["onLoadPanel"] = "datafilters"
97
97
  map.settings["properties"]["facetKey"] = "mytype|My type,mynumber|My Number|number"
98
98
  map.settings["properties"]["showLabel"] = True
99
99
  map.save()
@@ -101,7 +101,7 @@ def test_simple_facet_search(live_server, page, map):
101
101
  DataLayerFactory(map=map, data=DATALAYER_DATA2)
102
102
  DataLayerFactory(map=map, data=DATALAYER_DATA3)
103
103
  page.goto(f"{live_server.url}{map.get_absolute_url()}#6/48.948/1.670")
104
- panel = page.locator(".umap-facet-search")
104
+ panel = page.locator(".umap-browser")
105
105
  # From a non browsable datalayer, should not be impacted
106
106
  paths = page.locator(".leaflet-overlay-pane path")
107
107
  expect(paths).to_be_visible()
@@ -117,17 +117,28 @@ def test_simple_facet_search(live_server, page, map):
117
117
  markers = page.locator(".leaflet-marker-icon")
118
118
  expect(markers).to_have_count(4)
119
119
  # Tooltips
120
- expect(page.get_by_text("Point 1")).to_be_visible()
121
- expect(page.get_by_text("Point 2")).to_be_visible()
122
- expect(page.get_by_text("Point 3")).to_be_visible()
123
- expect(page.get_by_text("Point 4")).to_be_visible()
120
+ expect(page.get_by_role("tooltip", name="Point 1")).to_be_visible()
121
+ expect(page.get_by_role("tooltip", name="Point 2")).to_be_visible()
122
+ expect(page.get_by_role("tooltip", name="Point 3")).to_be_visible()
123
+ expect(page.get_by_role("tooltip", name="Point 4")).to_be_visible()
124
+
125
+ # Datalist
126
+ expect(panel.get_by_text("Point 1")).to_be_visible()
127
+ expect(panel.get_by_text("Point 2")).to_be_visible()
128
+ expect(panel.get_by_text("Point 3")).to_be_visible()
129
+ expect(panel.get_by_text("Point 4")).to_be_visible()
130
+
124
131
  # Now let's filter
125
132
  odd.click()
126
133
  expect(markers).to_have_count(2)
127
- expect(page.get_by_text("Point 2")).to_be_hidden()
128
- expect(page.get_by_text("Point 4")).to_be_hidden()
129
- expect(page.get_by_text("Point 1")).to_be_visible()
130
- expect(page.get_by_text("Point 3")).to_be_visible()
134
+ expect(page.get_by_role("tooltip", name="Point 2")).to_be_hidden()
135
+ expect(page.get_by_role("tooltip", name="Point 4")).to_be_hidden()
136
+ expect(page.get_by_role("tooltip", name="Point 1")).to_be_visible()
137
+ expect(page.get_by_role("tooltip", name="Point 3")).to_be_visible()
138
+ expect(panel.get_by_text("Point 2")).to_be_hidden()
139
+ expect(panel.get_by_text("Point 4")).to_be_hidden()
140
+ expect(panel.get_by_text("Point 1")).to_be_visible()
141
+ expect(panel.get_by_text("Point 3")).to_be_visible()
131
142
  expect(paths).to_be_visible
132
143
  # Now let's filter
133
144
  odd.click()
@@ -156,7 +167,7 @@ def test_simple_facet_search(live_server, page, map):
156
167
 
157
168
 
158
169
  def test_date_facet_search(live_server, page, map):
159
- map.settings["properties"]["onLoadPanel"] = "facet"
170
+ map.settings["properties"]["onLoadPanel"] = "datafilters"
160
171
  map.settings["properties"]["facetKey"] = "mydate|Date filter|date"
161
172
  map.save()
162
173
  DataLayerFactory(map=map, data=DATALAYER_DATA1)
@@ -174,7 +185,7 @@ def test_date_facet_search(live_server, page, map):
174
185
 
175
186
 
176
187
  def test_choice_with_empty_value(live_server, page, map):
177
- map.settings["properties"]["onLoadPanel"] = "facet"
188
+ map.settings["properties"]["onLoadPanel"] = "datafilters"
178
189
  map.settings["properties"]["facetKey"] = "mytype|My type"
179
190
  map.save()
180
191
  data = copy.deepcopy(DATALAYER_DATA1)
@@ -191,7 +202,7 @@ def test_choice_with_empty_value(live_server, page, map):
191
202
 
192
203
 
193
204
  def test_number_with_zero_value(live_server, page, map):
194
- map.settings["properties"]["onLoadPanel"] = "facet"
205
+ map.settings["properties"]["onLoadPanel"] = "datafilters"
195
206
  map.settings["properties"]["facetKey"] = "mynumber|Filter|number"
196
207
  map.save()
197
208
  data = copy.deepcopy(DATALAYER_DATA1)
@@ -205,3 +216,61 @@ def test_number_with_zero_value(live_server, page, map):
205
216
  page.keyboard.press("Tab") # Move out of the input, so the "change" event is sent
206
217
  markers = page.locator(".leaflet-marker-icon")
207
218
  expect(markers).to_have_count(3)
219
+
220
+
221
+ def test_facets_search_are_persistent_when_closing_panel(live_server, page, map):
222
+ map.settings["properties"]["onLoadPanel"] = "datafilters"
223
+ map.settings["properties"]["facetKey"] = "mytype|My type,mynumber|My Number|number"
224
+ map.save()
225
+ DataLayerFactory(map=map, data=DATALAYER_DATA1)
226
+ DataLayerFactory(map=map, data=DATALAYER_DATA2)
227
+ page.goto(f"{live_server.url}{map.get_absolute_url()}#6/48.948/1.670")
228
+ panel = page.locator(".umap-browser")
229
+
230
+ # Facet values
231
+ odd = page.get_by_label("odd")
232
+ markers = page.locator(".leaflet-marker-icon")
233
+ expect(markers).to_have_count(4)
234
+
235
+ # Datalist in the browser
236
+ expect(panel.get_by_text("Point 1")).to_be_visible()
237
+ expect(panel.get_by_text("Point 2")).to_be_visible()
238
+ expect(panel.get_by_text("Point 3")).to_be_visible()
239
+ expect(panel.get_by_text("Point 4")).to_be_visible()
240
+
241
+ # Now let's filter
242
+ odd.click()
243
+ expect(page.locator("summary")).to_have_attribute("data-badge", " ")
244
+ expect(page.locator(".umap-control-browse")).to_have_attribute("data-badge", " ")
245
+ expect(markers).to_have_count(2)
246
+ expect(panel.get_by_text("Point 2")).to_be_hidden()
247
+ expect(panel.get_by_text("Point 4")).to_be_hidden()
248
+ expect(panel.get_by_text("Point 1")).to_be_visible()
249
+ expect(panel.get_by_text("Point 3")).to_be_visible()
250
+
251
+ # Let's filter using the number facet
252
+ expect(panel.get_by_label("Min")).to_have_value("10")
253
+ expect(panel.get_by_label("Max")).to_have_value("14")
254
+ page.get_by_label("Min").fill("13")
255
+ page.keyboard.press("Tab") # Move out of the input, so the "change" event is sent
256
+ expect(panel.get_by_label("Min")).to_have_attribute("data-modified", "true")
257
+ expect(markers).to_have_count(1)
258
+ expect(panel.get_by_text("Point 2")).to_be_hidden()
259
+ expect(panel.get_by_text("Point 4")).to_be_hidden()
260
+ expect(panel.get_by_text("Point 1")).to_be_hidden()
261
+ expect(panel.get_by_text("Point 3")).to_be_visible()
262
+
263
+ # Close panel
264
+ expect(panel.locator("summary")).to_have_attribute("data-badge", " ")
265
+ expect(page.locator(".umap-control-browse")).to_have_attribute("data-badge", " ")
266
+ page.get_by_role("listitem", name="Close").click()
267
+ page.get_by_role("button", name="See layers").click()
268
+ expect(panel.get_by_label("Min")).to_have_value("13")
269
+ expect(panel.get_by_label("Min")).to_have_attribute("data-modified", "true")
270
+ expect(panel.get_by_label("odd")).to_be_checked()
271
+
272
+ # Datalist in the browser should be inchanged
273
+ expect(panel.get_by_text("Point 2")).to_be_hidden()
274
+ expect(panel.get_by_text("Point 4")).to_be_hidden()
275
+ expect(panel.get_by_text("Point 1")).to_be_hidden()
276
+ expect(panel.get_by_text("Point 3")).to_be_visible()
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.3
2
2
  Name: umap-project
3
- Version: 2.2.1
3
+ Version: 2.3.0
4
4
  Summary: Create maps with OpenStreetMap layers in a minute and embed them in your site.
5
5
  Author-email: Yohan Boniface <yb@enix.org>
6
6
  Maintainer-email: David Larlet <david@larlet.fr>
@@ -19,7 +19,7 @@ Requires-Python: >=3.10
19
19
  Requires-Dist: django-agnocomplete==2.2.0
20
20
  Requires-Dist: django-environ==0.11.2
21
21
  Requires-Dist: django-probes==1.7.0
22
- Requires-Dist: django==5.0.4
22
+ Requires-Dist: django==5.0.5
23
23
  Requires-Dist: pillow==10.3.0
24
24
  Requires-Dist: psycopg==3.1.18
25
25
  Requires-Dist: rcssmin==1.1.2
@@ -29,12 +29,13 @@ Requires-Dist: social-auth-app-django==5.4.1
29
29
  Requires-Dist: social-auth-core==4.5.4
30
30
  Provides-Extra: dev
31
31
  Requires-Dist: djlint==1.34.1; extra == 'dev'
32
- Requires-Dist: hatch==1.9.7; extra == 'dev'
32
+ Requires-Dist: hatch==1.10.0; extra == 'dev'
33
33
  Requires-Dist: isort==5.13.2; extra == 'dev'
34
- Requires-Dist: mkdocs-material==9.5.18; extra == 'dev'
35
- Requires-Dist: mkdocs==1.5.3; extra == 'dev'
34
+ Requires-Dist: mkdocs-material==9.5.21; extra == 'dev'
35
+ Requires-Dist: mkdocs-static-i18n==1.2.2; extra == 'dev'
36
+ Requires-Dist: mkdocs==1.6.0; extra == 'dev'
36
37
  Requires-Dist: pymdown-extensions==10.8.1; extra == 'dev'
37
- Requires-Dist: ruff==0.4.2; extra == 'dev'
38
+ Requires-Dist: ruff==0.4.3; extra == 'dev'
38
39
  Requires-Dist: vermin==1.6.0; extra == 'dev'
39
40
  Provides-Extra: docker
40
41
  Requires-Dist: uwsgi==2.0.25.1; extra == 'docker'