umap-project 2.4.0b1__py3-none-any.whl → 2.4.1__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 (53) hide show
  1. umap/__init__.py +1 -1
  2. umap/locale/en/LC_MESSAGES/django.po +11 -11
  3. umap/locale/fr/LC_MESSAGES/django.mo +0 -0
  4. umap/locale/fr/LC_MESSAGES/django.po +12 -11
  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 -28
  8. umap/static/umap/css/importers.css +8 -1
  9. umap/static/umap/css/panel.css +0 -1
  10. umap/static/umap/img/16-white.svg +1 -3
  11. umap/static/umap/img/source/16-white.svg +2 -4
  12. umap/static/umap/js/modules/browser.js +5 -5
  13. umap/static/umap/js/modules/caption.js +1 -1
  14. umap/static/umap/js/modules/importer.js +20 -9
  15. umap/static/umap/js/modules/importers/datasets.js +1 -0
  16. umap/static/umap/js/modules/utils.js +3 -3
  17. umap/static/umap/js/umap.features.js +11 -3
  18. umap/static/umap/js/umap.js +47 -48
  19. umap/static/umap/js/umap.layer.js +11 -1
  20. umap/static/umap/js/umap.popup.js +1 -1
  21. umap/static/umap/locale/en.js +2 -1
  22. umap/static/umap/locale/en.json +2 -1
  23. umap/static/umap/locale/es.js +9 -8
  24. umap/static/umap/locale/es.json +9 -8
  25. umap/static/umap/locale/fr.js +16 -15
  26. umap/static/umap/locale/fr.json +16 -15
  27. umap/static/umap/locale/pt.js +61 -60
  28. umap/static/umap/locale/pt.json +61 -60
  29. umap/static/umap/map.css +14 -13
  30. umap/static/umap/unittests/utils.js +5 -5
  31. umap/static/umap/vars.css +2 -1
  32. umap/static/umap/vendors/dompurify/purify.es.js +59 -5
  33. umap/static/umap/vendors/dompurify/purify.es.mjs.map +1 -1
  34. umap/static/umap/vendors/formbuilder/Leaflet.FormBuilder.js +2 -2
  35. umap/tests/integration/test_browser.py +76 -3
  36. umap/tests/integration/test_edit_polygon.py +11 -0
  37. umap/tests/integration/test_import.py +47 -0
  38. umap/tests/integration/test_map.py +29 -0
  39. umap/tests/integration/test_view_marker.py +2 -2
  40. {umap_project-2.4.0b1.dist-info → umap_project-2.4.1.dist-info}/METADATA +5 -5
  41. {umap_project-2.4.0b1.dist-info → umap_project-2.4.1.dist-info}/RECORD +44 -53
  42. {umap_project-2.4.0b1.dist-info → umap_project-2.4.1.dist-info}/WHEEL +1 -1
  43. umap/.DS_Store +0 -0
  44. umap/static/.DS_Store +0 -0
  45. umap/static/umap/.DS_Store +0 -0
  46. umap/static/umap/favicons/.DS_Store +0 -0
  47. umap/static/umap/fonts/.DS_Store +0 -0
  48. umap/static/umap/img/.DS_Store +0 -0
  49. umap/static/umap/img/source/.DS_Store +0 -0
  50. umap/tests/.DS_Store +0 -0
  51. umap/tests/integration/.DS_Store +0 -0
  52. {umap_project-2.4.0b1.dist-info → umap_project-2.4.1.dist-info}/entry_points.txt +0 -0
  53. {umap_project-2.4.0b1.dist-info → umap_project-2.4.1.dist-info}/licenses/LICENSE +0 -0
umap/static/umap/map.css CHANGED
@@ -678,7 +678,9 @@ ul.photon-autocomplete {
678
678
  font-style: italic;
679
679
  }
680
680
  .umap-slideshow-toolbox {
681
- float: right;
681
+ position: absolute;
682
+ right: 0;
683
+ top: 0;
682
684
  display: none;
683
685
  }
684
686
  .umap-slideshow-enabled .umap-slideshow-toolbox {
@@ -690,9 +692,9 @@ ul.photon-autocomplete {
690
692
  font-size: 1.5em;
691
693
  background-color: #464646;
692
694
  color: #fff;
693
- height: 46px;
694
- width: 70px;
695
- line-height: 46px;
695
+ width: calc(var(--footer-height) * 2);
696
+ height: var(--footer-height);
697
+ line-height: var(--footer-height);
696
698
  vertical-align: middle;
697
699
  text-align: center;
698
700
  }
@@ -704,24 +706,24 @@ ul.photon-autocomplete {
704
706
  }
705
707
  .umap-slideshow-active .umap-slideshow-toolbox .play,
706
708
  .umap-slideshow-toolbox .play {
707
- width: 100px;
709
+ width: calc(var(--footer-height) * 3);
708
710
  text-align: left;
709
711
  padding-left: 20px;
710
712
  }
711
713
  .umap-slideshow-toolbox .play:after {
712
- content: '';
714
+ content: '⏯︎';
713
715
  }
714
716
  .umap-slideshow-active .umap-slideshow-toolbox .play:after {
715
- content: ' ❚❚';
717
+ content: '⏸︎';
716
718
  }
717
719
  .umap-slideshow-toolbox .stop:before {
718
- content: '';
720
+ content: '';
719
721
  }
720
722
  .umap-slideshow-toolbox .next:before {
721
- content: '';
723
+ content: '⏵︎';
722
724
  }
723
725
  .umap-slideshow-toolbox .prev:before {
724
- content: '';
726
+ content: '⏴︎';
725
727
  }
726
728
  .umap-slideshow-toolbox .play div {
727
729
  height: 20px;
@@ -1127,6 +1129,7 @@ a.umap-control-caption,
1127
1129
  }
1128
1130
 
1129
1131
  .umap-popup-footer {
1132
+ position: relative;
1130
1133
  background-color: rgb(68, 68, 68);
1131
1134
  color: white;
1132
1135
  display: table;
@@ -1522,7 +1525,7 @@ span.popup-icon {
1522
1525
  z-index: 1001;
1523
1526
  }
1524
1527
  .leaflet-popup-content {
1525
- min-width: 100px;
1528
+ min-width: 200px;
1526
1529
  line-height: inherit;
1527
1530
  }
1528
1531
  .leaflet-popup-content-wrapper, .leaflet-popup-tip {
@@ -1559,8 +1562,6 @@ span.popup-icon {
1559
1562
  }
1560
1563
  .umap-popup-container {
1561
1564
  flex-grow: 1;
1562
- word-break: break-word;
1563
- white-space: pre-line;
1564
1565
  margin-bottom: 10px;
1565
1566
  }
1566
1567
  .umap-popup-container ul {
@@ -11,14 +11,14 @@ global.JSDOM = JSDOM
11
11
  describe('Utils', function () {
12
12
  describe('#toHTML()', function () {
13
13
  it('should handle title', function () {
14
- assert.equal(Utils.toHTML('# A title'), '<h3>A title</h3>')
14
+ assert.equal(Utils.toHTML('# A title'), '<h4>A title</h4>')
15
15
  })
16
16
  it('should handle title followed by text', function () {
17
- assert.equal(Utils.toHTML('# A title\nSome text.'), '<h3>A title</h3>Some text.')
17
+ assert.equal(Utils.toHTML('# A title\nSome text.'), '<h4>A title</h4>Some text.')
18
18
  })
19
19
 
20
20
  it('should handle title in the middle of the content', function () {
21
- assert.equal(Utils.toHTML('A phrase\n## A title'), 'A phrase\n<h4>A title</h4>')
21
+ assert.equal(Utils.toHTML('A phrase\n## A title'), 'A phrase\n<h5>A title</h5>')
22
22
  })
23
23
 
24
24
  it('should handle hr', function () {
@@ -43,7 +43,7 @@ describe('Utils', function () {
43
43
  it('should handle simple link in title', function () {
44
44
  assert.equal(
45
45
  Utils.toHTML('# http://osm.org'),
46
- '<h3><a href="http://osm.org" target="_blank">http://osm.org</a></h3>'
46
+ '<h4><a href="http://osm.org" target="_blank">http://osm.org</a></h4>'
47
47
  )
48
48
  })
49
49
 
@@ -180,7 +180,7 @@ describe('Utils', function () {
180
180
  it('title followed by bullet points', function () {
181
181
  assert.equal(
182
182
  Utils.toHTML('## Some title\n* First *point*\n* Second **point**\n* Last [[https://here.org|point]]'),
183
- '<h4>Some title</h4><ul><li>First <em>point</em></li><li>Second <strong>point</strong></li><li>Last <a href="https://here.org" target="_blank">point</a></li></ul>'
183
+ '<h5>Some title</h5><ul><li>First <em>point</em></li><li>Second <strong>point</strong></li><li>Last <a href="https://here.org" target="_blank">point</a></li></ul>'
184
184
  )
185
185
  })
186
186
  })
umap/static/umap/vars.css CHANGED
@@ -29,12 +29,13 @@
29
29
  --panel-width: 400px;
30
30
  --header-height: 46px;
31
31
  --current-header-height: 0px;
32
- --footer-height: 28px;
32
+ --footer-height: 32px;
33
33
  --current-footer-height: 0px;
34
34
  --control-size: 36px;
35
35
  --border-radius: 4px;
36
36
  --box-padding: 20px;
37
37
  --box-margin: 14px;
38
+ --text-margin: 7px;
38
39
  }
39
40
  .dark {
40
41
  --background-color: var(--color-darkGray);
@@ -1,4 +1,4 @@
1
- /*! @license DOMPurify 3.1.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.5/LICENSE */
1
+ /*! @license DOMPurify 3.1.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.3/LICENSE */
2
2
 
3
3
  const {
4
4
  entries,
@@ -48,6 +48,7 @@ const stringTrim = unapply(String.prototype.trim);
48
48
  const objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty);
49
49
  const regExpTest = unapply(RegExp.prototype.test);
50
50
  const typeErrorCreate = unconstruct(TypeError);
51
+ const numberIsNaN = unapply(Number.isNaN);
51
52
 
52
53
  /**
53
54
  * Creates a new function that calls the given function with a specified thisArg and arguments.
@@ -196,7 +197,7 @@ const mathMl$1 = freeze(['math', 'menclose', 'merror', 'mfenced', 'mfrac', 'mgly
196
197
  const mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongdiv', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow', 'semantics', 'annotation', 'annotation-xml', 'mprescripts', 'none']);
197
198
  const text = freeze(['#text']);
198
199
 
199
- const html = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'controls', 'controlslist', 'coords', 'crossorigin', 'datetime', 'decoding', 'default', 'dir', 'disabled', 'disablepictureinpicture', 'disableremoteplayback', 'download', 'draggable', 'enctype', 'enterkeyhint', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inputmode', 'integrity', 'ismap', 'kind', 'label', 'lang', 'list', 'loading', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'multiple', 'muted', 'name', 'nonce', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'pattern', 'placeholder', 'playsinline', 'popover', 'popovertarget', 'popovertargetaction', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'wrap', 'xmlns', 'slot']);
200
+ const html = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'controls', 'controlslist', 'coords', 'crossorigin', 'datetime', 'decoding', 'default', 'dir', 'disabled', 'disablepictureinpicture', 'disableremoteplayback', 'download', 'draggable', 'enctype', 'enterkeyhint', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inputmode', 'integrity', 'ismap', 'kind', 'label', 'lang', 'list', 'loading', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'multiple', 'muted', 'name', 'nonce', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'pattern', 'placeholder', 'playsinline', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'wrap', 'xmlns', 'slot']);
200
201
  const svg = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clippathunits', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dur', 'edgemode', 'elevation', 'end', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'systemlanguage', 'tabindex', 'targetx', 'targety', 'transform', 'transform-origin', 'text-anchor', 'text-decoration', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']);
201
202
  const mathMl = freeze(['accent', 'accentunder', 'align', 'bevelled', 'close', 'columnsalign', 'columnlines', 'columnspan', 'denomalign', 'depth', 'dir', 'display', 'displaystyle', 'encoding', 'fence', 'frame', 'height', 'href', 'id', 'largeop', 'length', 'linethickness', 'lspace', 'lquote', 'mathbackground', 'mathcolor', 'mathsize', 'mathvariant', 'maxsize', 'minsize', 'movablelimits', 'notation', 'numalign', 'open', 'rowalign', 'rowlines', 'rowspacing', 'rowspan', 'rspace', 'rquote', 'scriptlevel', 'scriptminsize', 'scriptsizemultiplier', 'selection', 'separator', 'separators', 'stretchy', 'subscriptshift', 'supscriptshift', 'symmetric', 'voffset', 'width', 'xmlns']);
202
203
  const xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']);
@@ -300,7 +301,7 @@ function createDOMPurify() {
300
301
  * Version label, exposed for easier checks
301
302
  * if DOMPurify is up to date or not
302
303
  */
303
- DOMPurify.version = '3.1.5';
304
+ DOMPurify.version = '3.1.3';
304
305
 
305
306
  /**
306
307
  * Array of elements that DOMPurify removed during sanitation.
@@ -533,6 +534,9 @@ function createDOMPurify() {
533
534
  /* Keep a reference to config to pass to hooks */
534
535
  let CONFIG = null;
535
536
 
537
+ /* Specify the maximum element nesting depth to prevent mXSS */
538
+ const MAX_NESTING_DEPTH = 255;
539
+
536
540
  /* Ideally, do not touch anything below this line */
537
541
  /* ______________________________________________ */
538
542
 
@@ -943,7 +947,11 @@ function createDOMPurify() {
943
947
  * @return {Boolean} true if clobbered, false if safe
944
948
  */
945
949
  const _isClobbered = function _isClobbered(elm) {
946
- return elm instanceof HTMLFormElement && (typeof elm.nodeName !== 'string' || typeof elm.textContent !== 'string' || typeof elm.removeChild !== 'function' || !(elm.attributes instanceof NamedNodeMap) || typeof elm.removeAttribute !== 'function' || typeof elm.setAttribute !== 'function' || typeof elm.namespaceURI !== 'string' || typeof elm.insertBefore !== 'function' || typeof elm.hasChildNodes !== 'function');
950
+ return elm instanceof HTMLFormElement && (
951
+ // eslint-disable-next-line unicorn/no-typeof-undefined
952
+ typeof elm.__depth !== 'undefined' && typeof elm.__depth !== 'number' ||
953
+ // eslint-disable-next-line unicorn/no-typeof-undefined
954
+ typeof elm.__removalCount !== 'undefined' && typeof elm.__removalCount !== 'number' || typeof elm.nodeName !== 'string' || typeof elm.textContent !== 'string' || typeof elm.removeChild !== 'function' || !(elm.attributes instanceof NamedNodeMap) || typeof elm.removeAttribute !== 'function' || typeof elm.setAttribute !== 'function' || typeof elm.namespaceURI !== 'string' || typeof elm.insertBefore !== 'function' || typeof elm.hasChildNodes !== 'function');
947
955
  };
948
956
 
949
957
  /**
@@ -1094,7 +1102,7 @@ function createDOMPurify() {
1094
1102
  // eslint-disable-next-line complexity
1095
1103
  const _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {
1096
1104
  /* Make sure attribute cannot clobber */
1097
- if (SANITIZE_DOM && (lcName === 'id' || lcName === 'name') && (value in document || value in formElement)) {
1105
+ if (SANITIZE_DOM && (lcName === 'id' || lcName === 'name') && (value in document || value in formElement || value === '__depth' || value === '__removalCount')) {
1098
1106
  return false;
1099
1107
  }
1100
1108
 
@@ -1285,9 +1293,32 @@ function createDOMPurify() {
1285
1293
  if (_sanitizeElements(shadowNode)) {
1286
1294
  continue;
1287
1295
  }
1296
+ const parentNode = getParentNode(shadowNode);
1297
+
1298
+ /* Set the nesting depth of an element */
1299
+ if (shadowNode.nodeType === NODE_TYPE.element) {
1300
+ if (parentNode && parentNode.__depth) {
1301
+ /*
1302
+ We want the depth of the node in the original tree, which can
1303
+ change when it's removed from its parent.
1304
+ */
1305
+ shadowNode.__depth = (shadowNode.__removalCount || 0) + parentNode.__depth + 1;
1306
+ } else {
1307
+ shadowNode.__depth = 1;
1308
+ }
1309
+ }
1310
+
1311
+ /*
1312
+ * Remove an element if nested too deeply to avoid mXSS
1313
+ * or if the __depth might have been tampered with
1314
+ */
1315
+ if (shadowNode.__depth >= MAX_NESTING_DEPTH || shadowNode.__depth < 0 || numberIsNaN(shadowNode.__depth)) {
1316
+ _forceRemove(shadowNode);
1317
+ }
1288
1318
 
1289
1319
  /* Deep shadow DOM detected */
1290
1320
  if (shadowNode.content instanceof DocumentFragment) {
1321
+ shadowNode.content.__depth = shadowNode.__depth;
1291
1322
  _sanitizeShadowDOM(shadowNode.content);
1292
1323
  }
1293
1324
 
@@ -1403,9 +1434,32 @@ function createDOMPurify() {
1403
1434
  if (_sanitizeElements(currentNode)) {
1404
1435
  continue;
1405
1436
  }
1437
+ const parentNode = getParentNode(currentNode);
1438
+
1439
+ /* Set the nesting depth of an element */
1440
+ if (currentNode.nodeType === NODE_TYPE.element) {
1441
+ if (parentNode && parentNode.__depth) {
1442
+ /*
1443
+ We want the depth of the node in the original tree, which can
1444
+ change when it's removed from its parent.
1445
+ */
1446
+ currentNode.__depth = (currentNode.__removalCount || 0) + parentNode.__depth + 1;
1447
+ } else {
1448
+ currentNode.__depth = 1;
1449
+ }
1450
+ }
1451
+
1452
+ /*
1453
+ * Remove an element if nested too deeply to avoid mXSS
1454
+ * or if the __depth might have been tampered with
1455
+ */
1456
+ if (currentNode.__depth >= MAX_NESTING_DEPTH || currentNode.__depth < 0 || numberIsNaN(currentNode.__depth)) {
1457
+ _forceRemove(currentNode);
1458
+ }
1406
1459
 
1407
1460
  /* Shadow DOM detected, sanitize it */
1408
1461
  if (currentNode.content instanceof DocumentFragment) {
1462
+ currentNode.content.__depth = currentNode.__depth;
1409
1463
  _sanitizeShadowDOM(currentNode.content);
1410
1464
  }
1411
1465