From 82208d618aafda70491f4bc4a9a8607ee73d9fe6 Mon Sep 17 00:00:00 2001 From: David Larlet Date: Wed, 26 Mar 2025 14:37:56 -0400 Subject: [PATCH] chore: apply Biome check --- biome.json | 14 ++--- .../static/umap/js/components/alerts/alert.js | 1 - umap/static/umap/js/modules/browser.js | 6 +- umap/static/umap/js/modules/caption.js | 2 +- umap/static/umap/js/modules/data/features.js | 16 ++--- umap/static/umap/js/modules/data/layer.js | 20 +++---- umap/static/umap/js/modules/form/builder.js | 6 +- umap/static/umap/js/modules/form/fields.js | 16 ++--- umap/static/umap/js/modules/formatter.js | 2 +- umap/static/umap/js/modules/global.js | 8 +-- umap/static/umap/js/modules/help.js | 2 +- .../static/umap/js/modules/importers/banfr.js | 4 +- .../umap/js/modules/importers/cadastrefr.js | 4 +- .../umap/js/modules/importers/communesfr.js | 2 +- umap/static/umap/js/modules/permissions.js | 4 +- umap/static/umap/js/modules/rendering/icon.js | 4 +- .../js/modules/rendering/layers/classified.js | 6 +- .../js/modules/rendering/layers/cluster.js | 4 +- .../umap/js/modules/rendering/layers/heat.js | 10 ++-- umap/static/umap/js/modules/rendering/map.js | 12 ++-- .../static/umap/js/modules/rendering/popup.js | 4 +- .../umap/js/modules/rendering/template.js | 6 +- umap/static/umap/js/modules/rendering/ui.js | 14 ++--- umap/static/umap/js/modules/rules.js | 6 +- umap/static/umap/js/modules/share.js | 2 +- umap/static/umap/js/modules/sync/engine.js | 2 +- umap/static/umap/js/modules/sync/hlc.js | 2 +- umap/static/umap/js/modules/tableeditor.js | 2 +- umap/static/umap/js/modules/ui/bar.js | 4 +- umap/static/umap/js/modules/ui/tooltip.js | 2 +- umap/static/umap/js/modules/umap.js | 58 +++++++++---------- umap/static/umap/js/modules/utils.js | 11 ++-- 32 files changed, 129 insertions(+), 127 deletions(-) diff --git a/biome.json b/biome.json index c03644d7..8db7c77c 100644 --- a/biome.json +++ b/biome.json @@ -1,11 +1,7 @@ { "files": { - "include": [ - "umap/static/umap/js/**" - ], - "ignore": [ - "umap/static/umap/vendors/**" - ] + "include": ["umap/static/umap/js/**"], + "ignore": ["umap/static/umap/vendors/**"] }, "formatter": { "enabled": true, @@ -22,7 +18,11 @@ "rules": { "style": { "useBlockStatements": "off", - "noShoutyConstants": "warn" + "noShoutyConstants": "warn", + "noParameterAssign": "off" + }, + "complexity": { + "noForEach": "off" }, "performance": { "noDelete": "off" diff --git a/umap/static/umap/js/components/alerts/alert.js b/umap/static/umap/js/components/alerts/alert.js index d47fc83d..af2bf862 100644 --- a/umap/static/umap/js/components/alerts/alert.js +++ b/umap/static/umap/js/components/alerts/alert.js @@ -140,7 +140,6 @@ class uMapAlertConflict extends uMapAlert { } onAlertConflict(event) { - // biome-ignore lint/style/useNumberNamespace: Number.Infinity returns undefined by default const { level = 'info', duration = Number.POSITIVE_INFINITY, diff --git a/umap/static/umap/js/modules/browser.js b/umap/static/umap/js/modules/browser.js index b123173e..4a20fab1 100644 --- a/umap/static/umap/js/modules/browser.js +++ b/umap/static/umap/js/modules/browser.js @@ -1,10 +1,10 @@ import { DomEvent, DomUtil, stamp } from '../../vendors/leaflet/leaflet-src.esm.js' +import { Form } from './form/builder.js' +import { EXPORT_FORMATS } from './formatter.js' import { translate } from './i18n.js' import * as Icon from './rendering/icon.js' -import * as Utils from './utils.js' -import { EXPORT_FORMATS } from './formatter.js' import ContextMenu from './ui/contextmenu.js' -import { Form } from './form/builder.js' +import * as Utils from './utils.js' export default class Browser { constructor(umap, leafletMap) { diff --git a/umap/static/umap/js/modules/caption.js b/umap/static/umap/js/modules/caption.js index c47aa224..21768dde 100644 --- a/umap/static/umap/js/modules/caption.js +++ b/umap/static/umap/js/modules/caption.js @@ -1,6 +1,6 @@ +import { uMapAlert as Alert } from '../components/alerts/alert.js' import { translate } from './i18n.js' import * as Utils from './utils.js' -import { uMapAlert as Alert } from '../components/alerts/alert.js' const TEMPLATE = `
diff --git a/umap/static/umap/js/modules/data/features.js b/umap/static/umap/js/modules/data/features.js index ee168ece..8ccfe9ba 100644 --- a/umap/static/umap/js/modules/data/features.js +++ b/umap/static/umap/js/modules/data/features.js @@ -1,22 +1,22 @@ import { - DomUtil, DomEvent, - stamp, + DomUtil, GeoJSON, LineUtil, + stamp, } from '../../../vendors/leaflet/leaflet-src.esm.js' -import * as Utils from '../utils.js' -import { SCHEMA } from '../schema.js' -import { translate } from '../i18n.js' import { uMapAlert as Alert } from '../../components/alerts/alert.js' +import { MutatingForm } from '../form/builder.js' +import { translate } from '../i18n.js' +import loadPopup from '../rendering/popup.js' import { LeafletMarker, - LeafletPolyline, LeafletPolygon, + LeafletPolyline, MaskPolygon, } from '../rendering/ui.js' -import loadPopup from '../rendering/popup.js' -import { MutatingForm } from '../form/builder.js' +import { SCHEMA } from '../schema.js' +import * as Utils from '../utils.js' class Feature { constructor(umap, datalayer, geojson = {}, id = null) { diff --git a/umap/static/umap/js/modules/data/layer.js b/umap/static/umap/js/modules/data/layer.js index 92808cc2..f9d1f78f 100644 --- a/umap/static/umap/js/modules/data/layer.js +++ b/umap/static/umap/js/modules/data/layer.js @@ -1,26 +1,26 @@ // FIXME: this module should not depend on Leaflet import { - DomUtil, DomEvent, - stamp, + DomUtil, GeoJSON, + stamp, } from '../../../vendors/leaflet/leaflet-src.esm.js' -import * as Utils from '../utils.js' -import { Default as DefaultLayer } from '../rendering/layers/base.js' -import { Cluster } from '../rendering/layers/cluster.js' -import { Heat } from '../rendering/layers/heat.js' -import { Categorized, Choropleth, Circles } from '../rendering/layers/classified.js' import { uMapAlert as Alert, uMapAlertConflict as AlertConflict, } from '../../components/alerts/alert.js' +import { MutatingForm } from '../form/builder.js' import { translate } from '../i18n.js' import { DataLayerPermissions } from '../permissions.js' -import { Point, LineString, Polygon } from './features.js' -import TableEditor from '../tableeditor.js' +import { Default as DefaultLayer } from '../rendering/layers/base.js' +import { Categorized, Choropleth, Circles } from '../rendering/layers/classified.js' +import { Cluster } from '../rendering/layers/cluster.js' +import { Heat } from '../rendering/layers/heat.js' import { ServerStored } from '../saving.js' import * as Schema from '../schema.js' -import { MutatingForm } from '../form/builder.js' +import TableEditor from '../tableeditor.js' +import * as Utils from '../utils.js' +import { LineString, Point, Polygon } from './features.js' export const LAYER_TYPES = [ DefaultLayer, diff --git a/umap/static/umap/js/modules/form/builder.js b/umap/static/umap/js/modules/form/builder.js index d0461036..b505c817 100644 --- a/umap/static/umap/js/modules/form/builder.js +++ b/umap/static/umap/js/modules/form/builder.js @@ -1,7 +1,7 @@ -import getClass from './fields.js' -import * as Utils from '../utils.js' -import { SCHEMA } from '../schema.js' import { translate } from '../i18n.js' +import { SCHEMA } from '../schema.js' +import * as Utils from '../utils.js' +import getClass from './fields.js' export class Form extends Utils.WithEvents { constructor(obj, fields, properties) { diff --git a/umap/static/umap/js/modules/form/fields.js b/umap/static/umap/js/modules/form/fields.js index 130b0d85..71abe87d 100644 --- a/umap/static/umap/js/modules/form/fields.js +++ b/umap/static/umap/js/modules/form/fields.js @@ -1,12 +1,12 @@ -import * as Utils from '../utils.js' -import { translate } from '../i18n.js' import { AjaxAutocomplete, AjaxAutocompleteMultiple, AutocompleteDatalist, } from '../autocomplete.js' -import { SCHEMA } from '../schema.js' +import { translate } from '../i18n.js' import * as Icon from '../rendering/icon.js' +import { SCHEMA } from '../schema.js' +import * as Utils from '../utils.js' const Fields = {} @@ -254,8 +254,8 @@ Fields.BlurInput = class extends Fields.Input { const IntegerMixin = (Base) => class extends Base { value() { - return !isNaN(this.input.value) && this.input.value !== '' - ? parseInt(this.input.value, 10) + return !Number.isNaN(this.input.value) && this.input.value !== '' + ? Number.parseInt(this.input.value, 10) : undefined } @@ -270,8 +270,8 @@ Fields.BlurIntInput = class extends IntegerMixin(Fields.BlurInput) {} const FloatMixin = (Base) => class extends Base { value() { - return !isNaN(this.input.value) && this.input.value !== '' - ? parseFloat(this.input.value) + return !Number.isNaN(this.input.value) && this.input.value !== '' + ? Number.parseFloat(this.input.value) : undefined } @@ -390,7 +390,7 @@ Fields.Select = class extends BaseElement { Fields.IntSelect = class extends Fields.Select { value() { - return parseInt(super.value(), 10) + return Number.parseInt(super.value(), 10) } } diff --git a/umap/static/umap/js/modules/formatter.js b/umap/static/umap/js/modules/formatter.js index 58544a16..f4131041 100644 --- a/umap/static/umap/js/modules/formatter.js +++ b/umap/static/umap/js/modules/formatter.js @@ -1,6 +1,6 @@ +import { uMapAlert as Alert } from '../components/alerts/alert.js' /* Uses globals for: csv2geojson, osmtogeojson (not available as ESM) */ import { translate } from './i18n.js' -import { uMapAlert as Alert } from '../components/alerts/alert.js' export const EXPORT_FORMATS = { geojson: { diff --git a/umap/static/umap/js/modules/global.js b/umap/static/umap/js/modules/global.js index 4ef04502..51e378b8 100644 --- a/umap/static/umap/js/modules/global.js +++ b/umap/static/umap/js/modules/global.js @@ -4,14 +4,14 @@ import { AjaxAutocompleteMultiple, AutocompleteDatalist, } from './autocomplete.js' +import { LineString, Point, Polygon } from './data/features.js' +import { LAYER_TYPES } from './data/layer.js' import Help from './help.js' +import * as Icon from './rendering/icon.js' +import { LeafletMarker, LeafletPolygon, LeafletPolyline } from './rendering/ui.js' import { ServerRequest } from './request.js' import { SCHEMA } from './schema.js' import * as Utils from './utils.js' -import * as Icon from './rendering/icon.js' -import { LAYER_TYPES } from './data/layer.js' -import { Point, LineString, Polygon } from './data/features.js' -import { LeafletMarker, LeafletPolyline, LeafletPolygon } from './rendering/ui.js' // Import modules and export them to the global scope. // For the not yet module-compatible JS out there. diff --git a/umap/static/umap/js/modules/help.js b/umap/static/umap/js/modules/help.js index 5d027e77..61ea1131 100644 --- a/umap/static/umap/js/modules/help.js +++ b/umap/static/umap/js/modules/help.js @@ -1,7 +1,7 @@ import { DomEvent, DomUtil } from '../../vendors/leaflet/leaflet-src.esm.js' import { translate } from './i18n.js' -import * as Utils from './utils.js' import Dialog from './ui/dialog.js' +import * as Utils from './utils.js' const SHORTCUTS = { DRAW_MARKER: { diff --git a/umap/static/umap/js/modules/importers/banfr.js b/umap/static/umap/js/modules/importers/banfr.js index 64428287..32d4e937 100644 --- a/umap/static/umap/js/modules/importers/banfr.js +++ b/umap/static/umap/js/modules/importers/banfr.js @@ -1,9 +1,9 @@ import { DomUtil } from '../../../vendors/leaflet/leaflet-src.esm.js' +import { uMapAlert as Alert } from '../../components/alerts/alert.js' import { BaseAjax, SingleMixin } from '../autocomplete.js' +import { translate } from '../i18n.js' import * as Utils from '../utils.js' import { AutocompleteCommunes } from './communesfr.js' -import { translate } from '../i18n.js' -import { uMapAlert as Alert } from '../../components/alerts/alert.js' const TEMPLATE = `
diff --git a/umap/static/umap/js/modules/importers/cadastrefr.js b/umap/static/umap/js/modules/importers/cadastrefr.js index 38c00af8..e9fd932f 100644 --- a/umap/static/umap/js/modules/importers/cadastrefr.js +++ b/umap/static/umap/js/modules/importers/cadastrefr.js @@ -1,9 +1,9 @@ import { DomUtil } from '../../../vendors/leaflet/leaflet-src.esm.js' +import { uMapAlert as Alert } from '../../components/alerts/alert.js' import { BaseAjax, SingleMixin } from '../autocomplete.js' +import { translate } from '../i18n.js' import * as Util from '../utils.js' import { AutocompleteCommunes } from './communesfr.js' -import { translate } from '../i18n.js' -import { uMapAlert as Alert } from '../../components/alerts/alert.js' const TEMPLATE = `

Cadastre

diff --git a/umap/static/umap/js/modules/importers/communesfr.js b/umap/static/umap/js/modules/importers/communesfr.js index 3f901b1f..de948370 100644 --- a/umap/static/umap/js/modules/importers/communesfr.js +++ b/umap/static/umap/js/modules/importers/communesfr.js @@ -15,7 +15,7 @@ export class AutocompleteCommunes extends SingleMixin(BaseAjax) { let options = { q: encodeURIComponent(value) } const re = /^(0[1-9]|[1-9][ABab\d])\d{3}$/gm if (re.test(value)) { - url = "https://geo.api.gouv.fr/communes?code={code}&limit=5" + url = 'https://geo.api.gouv.fr/communes?code={code}&limit=5' options = { code: encodeURIComponent(value) } } return Util.template(url, options) diff --git a/umap/static/umap/js/modules/permissions.js b/umap/static/umap/js/modules/permissions.js index d206496a..ffaab4fa 100644 --- a/umap/static/umap/js/modules/permissions.js +++ b/umap/static/umap/js/modules/permissions.js @@ -1,9 +1,9 @@ import { DomUtil } from '../../vendors/leaflet/leaflet-src.esm.js' -import { translate } from './i18n.js' import { uMapAlert as Alert } from '../components/alerts/alert.js' +import { MutatingForm } from './form/builder.js' +import { translate } from './i18n.js' import { ServerStored } from './saving.js' import * as Utils from './utils.js' -import { MutatingForm } from './form/builder.js' // Dedicated object so we can deal with a separate dirty status, and thus // call the endpoint only when needed, saving one call at each save. diff --git a/umap/static/umap/js/modules/rendering/icon.js b/umap/static/umap/js/modules/rendering/icon.js index 4dfaf845..0aaa5cb0 100644 --- a/umap/static/umap/js/modules/rendering/icon.js +++ b/umap/static/umap/js/modules/rendering/icon.js @@ -1,11 +1,11 @@ import { + DivIcon, DomEvent, DomUtil, - DivIcon, Icon, } from '../../../vendors/leaflet/leaflet-src.esm.js' -import * as Utils from '../utils.js' import { SCHEMA } from '../schema.js' +import * as Utils from '../utils.js' export function getClass(name) { switch (name) { diff --git a/umap/static/umap/js/modules/rendering/layers/classified.js b/umap/static/umap/js/modules/rendering/layers/classified.js index 6b8f39aa..a9b2cfb6 100644 --- a/umap/static/umap/js/modules/rendering/layers/classified.js +++ b/umap/static/umap/js/modules/rendering/layers/classified.js @@ -1,9 +1,9 @@ -import { FeatureGroup, DomUtil } from '../../../../vendors/leaflet/leaflet-src.esm.js' +import colorbrewer from '../../../../vendors/colorbrewer/colorbrewer.js' +import { DomUtil, FeatureGroup } from '../../../../vendors/leaflet/leaflet-src.esm.js' import { translate } from '../../i18n.js' -import { LayerMixin } from './base.js' import * as Utils from '../../utils.js' import { CircleMarker } from '../ui.js' -import colorbrewer from '../../../../vendors/colorbrewer/colorbrewer.js' +import { LayerMixin } from './base.js' // Layer where each feature color is relative to the others, // so we need all features before behing able to set one diff --git a/umap/static/umap/js/modules/rendering/layers/cluster.js b/umap/static/umap/js/modules/rendering/layers/cluster.js index 2349f6c0..2ee6b1d1 100644 --- a/umap/static/umap/js/modules/rendering/layers/cluster.js +++ b/umap/static/umap/js/modules/rendering/layers/cluster.js @@ -1,10 +1,10 @@ +import { Evented } from '../../../../vendors/leaflet/leaflet-src.esm.js' // WARNING must be loaded dynamically, or at least after leaflet.markercluster // Uses global L.MarkerCluster and L.MarkerClusterGroup, not exposed as ESM import { translate } from '../../i18n.js' -import { LayerMixin } from './base.js' import * as Utils from '../../utils.js' -import { Evented } from '../../../../vendors/leaflet/leaflet-src.esm.js' import { Cluster as ClusterIcon } from '../icon.js' +import { LayerMixin } from './base.js' const MarkerCluster = L.MarkerCluster.extend({ // Custom class so we can call computeTextColor diff --git a/umap/static/umap/js/modules/rendering/layers/heat.js b/umap/static/umap/js/modules/rendering/layers/heat.js index 422a7919..b686c3dc 100644 --- a/umap/static/umap/js/modules/rendering/layers/heat.js +++ b/umap/static/umap/js/modules/rendering/layers/heat.js @@ -1,14 +1,14 @@ // Uses global L.HeatLayer, not exposed as ESM import { - Marker, - LatLng, - latLngBounds, Bounds, + LatLng, + Marker, + latLngBounds, point, } from '../../../../vendors/leaflet/leaflet-src.esm.js' -import { LayerMixin } from './base.js' -import * as Utils from '../../utils.js' import { translate } from '../../i18n.js' +import * as Utils from '../../utils.js' +import { LayerMixin } from './base.js' export const Heat = L.HeatLayer.extend({ statics: { diff --git a/umap/static/umap/js/modules/rendering/map.js b/umap/static/umap/js/modules/rendering/map.js index e3f940ee..cbfe1ccc 100644 --- a/umap/static/umap/js/modules/rendering/map.js +++ b/umap/static/umap/js/modules/rendering/map.js @@ -1,18 +1,18 @@ // Goes here all code related to Leaflet, DOM and user interactions. import { Map as BaseMap, - DomUtil, - DomEvent, - latLngBounds, - latLng, Control, + DomEvent, + DomUtil, + latLng, + latLngBounds, setOptions, } from '../../../vendors/leaflet/leaflet-src.esm.js' -import { translate } from '../i18n.js' import { uMapAlert as Alert } from '../../components/alerts/alert.js' +import DropControl from '../drop.js' +import { translate } from '../i18n.js' import * as Utils from '../utils.js' import * as Icon from './icon.js' -import DropControl from '../drop.js' // Those options are not saved on the server, so they can live here // instead of in umap.properties diff --git a/umap/static/umap/js/modules/rendering/popup.js b/umap/static/umap/js/modules/rendering/popup.js index 0b87d01e..8e4f9f53 100644 --- a/umap/static/umap/js/modules/rendering/popup.js +++ b/umap/static/umap/js/modules/rendering/popup.js @@ -1,11 +1,11 @@ import { + Popup as BasePopup, DomEvent, DomUtil, Path, - Popup as BasePopup, } from '../../../vendors/leaflet/leaflet-src.esm.js' -import loadTemplate from './template.js' import Browser from '../browser.js' +import loadTemplate from './template.js' export default function loadPopup(name) { switch (name) { diff --git a/umap/static/umap/js/modules/rendering/template.js b/umap/static/umap/js/modules/rendering/template.js index 39854c6e..b81a9204 100644 --- a/umap/static/umap/js/modules/rendering/template.js +++ b/umap/static/umap/js/modules/rendering/template.js @@ -1,8 +1,8 @@ -import { DomUtil, DomEvent } from '../../../vendors/leaflet/leaflet-src.esm.js' -import { translate, getLocale } from '../i18n.js' +import { DomEvent, DomUtil } from '../../../vendors/leaflet/leaflet-src.esm.js' +import { getLocale, translate } from '../i18n.js' +import { Request } from '../request.js' import * as Utils from '../utils.js' import * as Icon from './icon.js' -import { Request } from '../request.js' export default async function loadTemplate(name, feature, container) { let klass = PopupTemplate diff --git a/umap/static/umap/js/modules/rendering/ui.js b/umap/static/umap/js/modules/rendering/ui.js index 4a3d584f..1755c046 100644 --- a/umap/static/umap/js/modules/rendering/ui.js +++ b/umap/static/umap/js/modules/rendering/ui.js @@ -1,18 +1,18 @@ // Goes here all code related to Leaflet, DOM and user interactions. import { - Marker, - Polyline, - Polygon, CircleMarker as BaseCircleMarker, + DomEvent, DomUtil, - LineUtil, - latLng, LatLng, LatLngBounds, - DomEvent, + LineUtil, + Marker, + Polygon, + Polyline, + latLng, } from '../../../vendors/leaflet/leaflet-src.esm.js' -import { translate } from '../i18n.js' import { uMapAlert as Alert } from '../../components/alerts/alert.js' +import { translate } from '../i18n.js' import * as Utils from '../utils.js' import * as Icon from './icon.js' diff --git a/umap/static/umap/js/modules/rules.js b/umap/static/umap/js/modules/rules.js index f03fc20c..a6c39ad1 100644 --- a/umap/static/umap/js/modules/rules.js +++ b/umap/static/umap/js/modules/rules.js @@ -1,9 +1,9 @@ import { DomEvent, DomUtil, stamp } from '../../vendors/leaflet/leaflet-src.esm.js' -import { translate } from './i18n.js' -import * as Utils from './utils.js' import { AutocompleteDatalist } from './autocomplete.js' -import Orderable from './orderable.js' import { MutatingForm } from './form/builder.js' +import { translate } from './i18n.js' +import Orderable from './orderable.js' +import * as Utils from './utils.js' const EMPTY_VALUES = ['', undefined, null] diff --git a/umap/static/umap/js/modules/share.js b/umap/static/umap/js/modules/share.js index ccf93636..20965032 100644 --- a/umap/static/umap/js/modules/share.js +++ b/umap/static/umap/js/modules/share.js @@ -1,8 +1,8 @@ import { DomUtil } from '../../vendors/leaflet/leaflet-src.esm.js' +import { MutatingForm } from './form/builder.js' import { EXPORT_FORMATS } from './formatter.js' import { translate } from './i18n.js' import * as Utils from './utils.js' -import { MutatingForm } from './form/builder.js' export default class Share { constructor(umap) { diff --git a/umap/static/umap/js/modules/sync/engine.js b/umap/static/umap/js/modules/sync/engine.js index 08b76cc5..63af120e 100644 --- a/umap/static/umap/js/modules/sync/engine.js +++ b/umap/static/umap/js/modules/sync/engine.js @@ -1,8 +1,8 @@ +import * as SaveManager from '../saving.js' import * as Utils from '../utils.js' import { HybridLogicalClock } from './hlc.js' import { DataLayerUpdater, FeatureUpdater, MapUpdater } from './updaters.js' import { WebSocketTransport } from './websocket.js' -import * as SaveManager from '../saving.js' // Start reconnecting after 2 seconds, then double the delay each time // maxing out at 32 seconds. diff --git a/umap/static/umap/js/modules/sync/hlc.js b/umap/static/umap/js/modules/sync/hlc.js index f229b4e4..fb86b236 100644 --- a/umap/static/umap/js/modules/sync/hlc.js +++ b/umap/static/umap/js/modules/sync/hlc.js @@ -91,7 +91,7 @@ export class HybridLogicalClock { if (now > local.walltime && now > remote.walltime) { nextValue = { ...local, walltime: now } - } else if (local.walltime == remote.walltime) { + } else if (local.walltime === remote.walltime) { const nn = Math.max(local.nn, remote.nn) + 1 nextValue = { ...local, nn: nn } } else if (remote.walltime > local.walltime) { diff --git a/umap/static/umap/js/modules/tableeditor.js b/umap/static/umap/js/modules/tableeditor.js index bdfe8619..f6d6c126 100644 --- a/umap/static/umap/js/modules/tableeditor.js +++ b/umap/static/umap/js/modules/tableeditor.js @@ -1,8 +1,8 @@ import { DomEvent, DomUtil } from '../../vendors/leaflet/leaflet-src.esm.js' +import { MutatingForm } from './form/builder.js' import { translate } from './i18n.js' import ContextMenu from './ui/contextmenu.js' import { WithTemplate, loadTemplate } from './utils.js' -import { MutatingForm } from './form/builder.js' const TEMPLATE = ` diff --git a/umap/static/umap/js/modules/ui/bar.js b/umap/static/umap/js/modules/ui/bar.js index d7bf77de..3c2ef27d 100644 --- a/umap/static/umap/js/modules/ui/bar.js +++ b/umap/static/umap/js/modules/ui/bar.js @@ -1,9 +1,9 @@ import { DomEvent } from '../../../vendors/leaflet/leaflet-src.esm.js' +import { LineString, Point, Polygon } from '../data/features.js' import { translate } from '../i18n.js' import { WithTemplate } from '../utils.js' -import ContextMenu from './contextmenu.js' import * as Utils from '../utils.js' -import { Point, LineString, Polygon } from '../data/features.js' +import ContextMenu from './contextmenu.js' const TOP_BAR_TEMPLATE = `
diff --git a/umap/static/umap/js/modules/ui/tooltip.js b/umap/static/umap/js/modules/ui/tooltip.js index 2c4362e0..67bb511f 100644 --- a/umap/static/umap/js/modules/ui/tooltip.js +++ b/umap/static/umap/js/modules/ui/tooltip.js @@ -1,7 +1,7 @@ import { DomEvent } from '../../../vendors/leaflet/leaflet-src.esm.js' import { translate } from '../i18n.js' -import { Positioned } from './base.js' import * as Utils from '../utils.js' +import { Positioned } from './base.js' export default class Tooltip extends Positioned { constructor(parent) { diff --git a/umap/static/umap/js/modules/umap.js b/umap/static/umap/js/modules/umap.js index add17341..c21df57f 100644 --- a/umap/static/umap/js/modules/umap.js +++ b/umap/static/umap/js/modules/umap.js @@ -1,40 +1,40 @@ import { DomUtil, Util as LeafletUtil, - stamp, latLngBounds, + stamp, } from '../../vendors/leaflet/leaflet-src.esm.js' -import { translate, setLocale, getLocale } from './i18n.js' -import * as Utils from './utils.js' -import { ServerStored } from './saving.js' -import * as SAVEMANAGER from './saving.js' -import { SyncEngine } from './sync/engine.js' -import { LeafletMap } from './rendering/map.js' -import URLs from './urls.js' -import { Panel, EditPanel, FullPanel } from './ui/panel.js' -import Dialog from './ui/dialog.js' -import { BottomBar, TopBar, EditBar } from './ui/bar.js' -import Tooltip from './ui/tooltip.js' -import ContextMenu from './ui/contextmenu.js' -import { Request, ServerRequest } from './request.js' -import Help from './help.js' -import { Formatter } from './formatter.js' -import Slideshow from './slideshow.js' -import { MapPermissions } from './permissions.js' -import { SCHEMA } from './schema.js' -import { DataLayer } from './data/layer.js' -import Facets from './facets.js' +import { + uMapAlert as Alert, + uMapAlertCreation as AlertCreation, +} from '../components/alerts/alert.js' import Browser from './browser.js' import Caption from './caption.js' -import Importer from './importer.js' -import Rules from './rules.js' -import Share from './share.js' -import { - uMapAlertCreation as AlertCreation, - uMapAlert as Alert, -} from '../components/alerts/alert.js' -import Orderable from './orderable.js' +import { DataLayer } from './data/layer.js' +import Facets from './facets.js' import { MutatingForm } from './form/builder.js' +import { Formatter } from './formatter.js' +import Help from './help.js' +import { getLocale, setLocale, translate } from './i18n.js' +import Importer from './importer.js' +import Orderable from './orderable.js' +import { MapPermissions } from './permissions.js' +import { LeafletMap } from './rendering/map.js' +import { Request, ServerRequest } from './request.js' +import Rules from './rules.js' +import { ServerStored } from './saving.js' +import * as SAVEMANAGER from './saving.js' +import { SCHEMA } from './schema.js' +import Share from './share.js' +import Slideshow from './slideshow.js' +import { SyncEngine } from './sync/engine.js' +import { BottomBar, EditBar, TopBar } from './ui/bar.js' +import ContextMenu from './ui/contextmenu.js' +import Dialog from './ui/dialog.js' +import { EditPanel, FullPanel, Panel } from './ui/panel.js' +import Tooltip from './ui/tooltip.js' +import URLs from './urls.js' +import * as Utils from './utils.js' export default class Umap extends ServerStored { constructor(element, geojson) { diff --git a/umap/static/umap/js/modules/utils.js b/umap/static/umap/js/modules/utils.js index 228d94c1..4c36abfe 100644 --- a/umap/static/umap/js/modules/utils.js +++ b/umap/static/umap/js/modules/utils.js @@ -368,10 +368,13 @@ export function isDataImage(value) { * characters and no diacritics. */ export function normalize(s) { - return (s || '') - .toLowerCase() - .normalize('NFD') - .replace(/[\u0300-\u036f]/g, '') + return ( + (s || '') + .toLowerCase() + .normalize('NFD') + // biome-ignore lint/suspicious/noMisleadingCharacterClass: + .replace(/[\u0300-\u036f]/g, '') + ) } // Vendorized from leaflet.utils