From 1c83afa8df8dc26ec771a90a3d7b8700c31b8a6a Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Fri, 12 Jan 2024 11:36:39 -0500 Subject: [PATCH 01/55] Start the process of splitting up our tests into 'browser' and 'unit' We can use node:test to run unit tests for situations where we don't need the tests to run in a browser with karma, which we will be replacing. --- .eslintignore | 1 - karma.conf.cjs | 14 ++--- package.json | 10 ++-- test/.eslintrc | 3 +- test/benchmark/bench_helpers.js | 1 - test/benchmark/tests/bench.js | 5 +- test/{spec => browser}/Context.test.js | 0 test/{spec => browser}/actions/add_entity.js | 0 test/{spec => browser}/actions/add_member.js | 0 .../{spec => browser}/actions/add_midpoint.js | 0 .../actions/change_member.js | 0 .../actions/change_preset.js | 0 test/{spec => browser}/actions/change_tags.js | 0 test/{spec => browser}/actions/circularize.js | 0 test/{spec => browser}/actions/connect.js | 0 .../actions/copy_entities.js | 0 .../actions/delete_member.js | 0 .../actions/delete_multiple.js | 0 test/{spec => browser}/actions/delete_node.js | 0 .../actions/delete_relation.js | 0 test/{spec => browser}/actions/delete_way.js | 0 .../{spec => browser}/actions/discard_tags.js | 0 test/{spec => browser}/actions/disconnect.js | 0 test/{spec => browser}/actions/extract.js | 0 test/{spec => browser}/actions/join.js | 0 test/{spec => browser}/actions/merge.js | 0 test/{spec => browser}/actions/merge_nodes.js | 0 .../actions/merge_polygon.js | 0 .../actions/merge_remote_changes.js | 0 test/{spec => browser}/actions/move.js | 0 test/{spec => browser}/actions/move_node.js | 0 test/{spec => browser}/actions/noop.js | 0 .../actions/orthogonalize.js | 0 test/{spec => browser}/actions/reflect.js | 0 .../actions/restrict_turn.js | 0 test/{spec => browser}/actions/reverse.js | 0 test/{spec => browser}/actions/revert.js | 0 test/{spec => browser}/actions/split.js | 0 .../actions/straighten_nodes.js | 0 .../actions/straighten_way.js | 0 .../actions/unrestrict_turn.js | 0 .../{spec => browser}/actions/upgrade_tags.js | 0 .../core/DataLoaderSystem.test.js | 0 .../{spec => browser}/core/EditSystem.test.js | 0 .../core/FilterSystem.test.js | 0 .../core/LocalizationSystem.test.js | 0 .../core/LocationSystem.test.js | 0 test/{spec => browser}/core/MapSystem.Test.js | 0 .../core/PresetSystem.test.js | 0 .../core/UrlHashSystem.test.js | 0 .../core/ValidationSystem.test.js | 0 .../core/lib/Category.test.js | 0 .../core/lib/Collection.test.js | 0 .../core/lib/Difference.test.js | 0 test/{spec => browser}/core/lib/Graph.test.js | 0 .../core/lib/ImagerySource.test.js | 0 .../{spec => browser}/core/lib/Preset.test.js | 0 test/{spec => browser}/core/lib/Tree.test.js | 0 test/{spec => browser}/geo/geom.js | 0 test/{spec => browser}/operations/extract.js | 0 .../operations/straighten.js | 0 test/{spec => browser}/osm/changeset.js | 0 test/{spec => browser}/osm/entity.js | 0 test/{spec => browser}/osm/intersection.js | 0 test/{spec => browser}/osm/lanes.js | 0 test/{spec => browser}/osm/multipolygon.js | 0 test/{spec => browser}/osm/node.js | 0 test/{spec => browser}/osm/note.js | 0 test/{spec => browser}/osm/relation.js | 0 test/{spec => browser}/osm/tags.js | 0 test/{spec => browser}/osm/way.js | 0 test/{spec => browser}/pixi/PixiLayerMapUI.js | 0 .../renderer/PixiRenderer.js | 17 +++--- .../renderer/canned_osm_data.json | 0 .../services/KartaviewService.test.js | 0 .../services/MapillaryService.test.js | 0 .../services/NominatimService.test.js | 0 .../services/OsmService.test.js | 0 .../services/OsmWikibaseService.test.js | 0 .../services/StreetsideService.test.js | 0 .../services/TaginfoService.test.js | 0 test/{spec => browser}/spec_helpers.js | 0 test/{spec => browser}/svg/tag_classes.js | 0 test/{spec => browser}/ui/cmd.js | 0 test/{spec => browser}/ui/combobox.js | 0 test/{spec => browser}/ui/confirm.js | 0 test/{spec => browser}/ui/fields/access.js | 0 test/{spec => browser}/ui/fields/localized.js | 0 test/{spec => browser}/ui/fields/wikipedia.js | 0 test/{spec => browser}/ui/flash.js | 0 test/{spec => browser}/ui/icon.js | 0 test/{spec => browser}/ui/modal.js | 0 .../ui/sections/raw_tag_editor.js | 0 test/{spec => browser}/util/keybinding.js | 0 .../validations/almost_junction.js | 0 .../validations/ambiguous_crossing_tags.js | 0 .../validations/crossing_ways.js | 0 .../validations/disconnected_way.js | 0 .../validations/incompatible_source.js | 0 .../validations/mismatched_geometry.js | 0 .../validations/missing_role.js | 0 .../validations/missing_tag.js | 0 .../validations/outdated_tags.js | 0 .../validations/private_data.js | 0 .../validations/suspicious_name.js | 0 test/data/intro_graph.min.json | 15 ----- test/data/node.xml | 13 ----- test/data/way.xml | 58 ------------------- 108 files changed, 24 insertions(+), 113 deletions(-) delete mode 100644 .eslintignore rename test/{spec => browser}/Context.test.js (100%) rename test/{spec => browser}/actions/add_entity.js (100%) rename test/{spec => browser}/actions/add_member.js (100%) rename test/{spec => browser}/actions/add_midpoint.js (100%) rename test/{spec => browser}/actions/change_member.js (100%) rename test/{spec => browser}/actions/change_preset.js (100%) rename test/{spec => browser}/actions/change_tags.js (100%) rename test/{spec => browser}/actions/circularize.js (100%) rename test/{spec => browser}/actions/connect.js (100%) rename test/{spec => browser}/actions/copy_entities.js (100%) rename test/{spec => browser}/actions/delete_member.js (100%) rename test/{spec => browser}/actions/delete_multiple.js (100%) rename test/{spec => browser}/actions/delete_node.js (100%) rename test/{spec => browser}/actions/delete_relation.js (100%) rename test/{spec => browser}/actions/delete_way.js (100%) rename test/{spec => browser}/actions/discard_tags.js (100%) rename test/{spec => browser}/actions/disconnect.js (100%) rename test/{spec => browser}/actions/extract.js (100%) rename test/{spec => browser}/actions/join.js (100%) rename test/{spec => browser}/actions/merge.js (100%) rename test/{spec => browser}/actions/merge_nodes.js (100%) rename test/{spec => browser}/actions/merge_polygon.js (100%) rename test/{spec => browser}/actions/merge_remote_changes.js (100%) rename test/{spec => browser}/actions/move.js (100%) rename test/{spec => browser}/actions/move_node.js (100%) rename test/{spec => browser}/actions/noop.js (100%) rename test/{spec => browser}/actions/orthogonalize.js (100%) rename test/{spec => browser}/actions/reflect.js (100%) rename test/{spec => browser}/actions/restrict_turn.js (100%) rename test/{spec => browser}/actions/reverse.js (100%) rename test/{spec => browser}/actions/revert.js (100%) rename test/{spec => browser}/actions/split.js (100%) rename test/{spec => browser}/actions/straighten_nodes.js (100%) rename test/{spec => browser}/actions/straighten_way.js (100%) rename test/{spec => browser}/actions/unrestrict_turn.js (100%) rename test/{spec => browser}/actions/upgrade_tags.js (100%) rename test/{spec => browser}/core/DataLoaderSystem.test.js (100%) rename test/{spec => browser}/core/EditSystem.test.js (100%) rename test/{spec => browser}/core/FilterSystem.test.js (100%) rename test/{spec => browser}/core/LocalizationSystem.test.js (100%) rename test/{spec => browser}/core/LocationSystem.test.js (100%) rename test/{spec => browser}/core/MapSystem.Test.js (100%) rename test/{spec => browser}/core/PresetSystem.test.js (100%) rename test/{spec => browser}/core/UrlHashSystem.test.js (100%) rename test/{spec => browser}/core/ValidationSystem.test.js (100%) rename test/{spec => browser}/core/lib/Category.test.js (100%) rename test/{spec => browser}/core/lib/Collection.test.js (100%) rename test/{spec => browser}/core/lib/Difference.test.js (100%) rename test/{spec => browser}/core/lib/Graph.test.js (100%) rename test/{spec => browser}/core/lib/ImagerySource.test.js (100%) rename test/{spec => browser}/core/lib/Preset.test.js (100%) rename test/{spec => browser}/core/lib/Tree.test.js (100%) rename test/{spec => browser}/geo/geom.js (100%) rename test/{spec => browser}/operations/extract.js (100%) rename test/{spec => browser}/operations/straighten.js (100%) rename test/{spec => browser}/osm/changeset.js (100%) rename test/{spec => browser}/osm/entity.js (100%) rename test/{spec => browser}/osm/intersection.js (100%) rename test/{spec => browser}/osm/lanes.js (100%) rename test/{spec => browser}/osm/multipolygon.js (100%) rename test/{spec => browser}/osm/node.js (100%) rename test/{spec => browser}/osm/note.js (100%) rename test/{spec => browser}/osm/relation.js (100%) rename test/{spec => browser}/osm/tags.js (100%) rename test/{spec => browser}/osm/way.js (100%) rename test/{spec => browser}/pixi/PixiLayerMapUI.js (100%) rename test/{spec => browser}/renderer/PixiRenderer.js (84%) rename test/{spec => browser}/renderer/canned_osm_data.json (100%) rename test/{spec => browser}/services/KartaviewService.test.js (100%) rename test/{spec => browser}/services/MapillaryService.test.js (100%) rename test/{spec => browser}/services/NominatimService.test.js (100%) rename test/{spec => browser}/services/OsmService.test.js (100%) rename test/{spec => browser}/services/OsmWikibaseService.test.js (100%) rename test/{spec => browser}/services/StreetsideService.test.js (100%) rename test/{spec => browser}/services/TaginfoService.test.js (100%) rename test/{spec => browser}/spec_helpers.js (100%) rename test/{spec => browser}/svg/tag_classes.js (100%) rename test/{spec => browser}/ui/cmd.js (100%) rename test/{spec => browser}/ui/combobox.js (100%) rename test/{spec => browser}/ui/confirm.js (100%) rename test/{spec => browser}/ui/fields/access.js (100%) rename test/{spec => browser}/ui/fields/localized.js (100%) rename test/{spec => browser}/ui/fields/wikipedia.js (100%) rename test/{spec => browser}/ui/flash.js (100%) rename test/{spec => browser}/ui/icon.js (100%) rename test/{spec => browser}/ui/modal.js (100%) rename test/{spec => browser}/ui/sections/raw_tag_editor.js (100%) rename test/{spec => browser}/util/keybinding.js (100%) rename test/{spec => browser}/validations/almost_junction.js (100%) rename test/{spec => browser}/validations/ambiguous_crossing_tags.js (100%) rename test/{spec => browser}/validations/crossing_ways.js (100%) rename test/{spec => browser}/validations/disconnected_way.js (100%) rename test/{spec => browser}/validations/incompatible_source.js (100%) rename test/{spec => browser}/validations/mismatched_geometry.js (100%) rename test/{spec => browser}/validations/missing_role.js (100%) rename test/{spec => browser}/validations/missing_tag.js (100%) rename test/{spec => browser}/validations/outdated_tags.js (100%) rename test/{spec => browser}/validations/private_data.js (100%) rename test/{spec => browser}/validations/suspicious_name.js (100%) delete mode 100644 test/data/intro_graph.min.json delete mode 100644 test/data/node.xml delete mode 100644 test/data/way.xml diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index e894f62d00..0000000000 --- a/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -test/spec/renderer/PixiRenderer.js \ No newline at end of file diff --git a/karma.conf.cjs b/karma.conf.cjs index 0826bc528f..3469578c53 100644 --- a/karma.conf.cjs +++ b/karma.conf.cjs @@ -25,17 +25,17 @@ module.exports = function (config) { { pattern: 'dist/rapid.js', included: true }, { pattern: 'dist/rapid.css', included: true }, { pattern: 'dist/**/*', included: false }, - { pattern: 'test/spec/renderer/*.json', included: true, served: true}, - 'test/spec/spec_helpers.js', - 'test/spec/**/*.js' + { pattern: 'test/browser/renderer/*.json', included: true, served: true}, + 'test/browser/spec_helpers.js', + 'test/browser/**/*.js' ], // list of files / patterns to exclude exclude: [ - 'test/spec/pixi/*.js', + 'test/browser/pixi/*.js', // Comment the next line to run the OSM renderer-specific unit test, which right now merely exercise the code. // These tests don't actually make any assertions and therefore always succeed. - 'test/spec/renderer/PixiRenderer.js' + 'test/browser/renderer/PixiRenderer.js' ], proxies: { @@ -48,7 +48,7 @@ module.exports = function (config) { // available preprocessors: https://www.npmjs.com/search?q=keywords:karma-preprocessor preprocessors: { 'dist/rapid.js': ['coverage'], - 'test/spec/renderer/*.json': ['json_fixtures'] + 'test/browser/renderer/*.json': ['json_fixtures'] }, // test results reporter to use @@ -98,4 +98,4 @@ module.exports = function (config) { } } }); -}; \ No newline at end of file +}; diff --git a/package.json b/package.json index 33ac7fb01a..4d330241ba 100644 --- a/package.json +++ b/package.json @@ -34,20 +34,20 @@ "dist:svg:temaki": "svg-sprite --symbol --symbol-dest . --shape-id-generator \"temaki-%s\" --symbol-sprite dist/img/temaki-sprite.svg node_modules/@rapideditor/temaki/icons/*.svg", "docs": "jsdoc -c webdoc.conf.json -r", "imagery": "node scripts/update_imagery.js", - "lint": "eslint test/spec modules", - "lint:fix": "eslint test/spec modules --fix", + "lint": "eslint modules test", "start": "run-s build:css build:bundle start:server", "quickstart": "npm run start", "stats": "run-s stats:codeviz stats:cloc:**", "stats:codeviz": "esbuild-visualizer --metadata dist/esbuild.json --filename docs/statistics.html", "stats:cloc:modules": "npx cloc --skip-uniqueness --include-ext=css,js,ts,jsx,tsx ./css ./data ./modules", - "stats:cloc:tests": "npx cloc --skip-uniqueness --include-ext=css,js,ts,jsx,tsx ./test/spec", + "stats:cloc:tests": "npx cloc --skip-uniqueness --include-ext=css,js,ts,jsx,tsx ./test", "start:server": "node scripts/server.js", - "test": "npm-run-all -s lint build test:spec", + "test": "npm-run-all -s lint build test:unit test:browser", "test:benchmark": "npm run test:unzip-benchmark-data && npx playwright test --workers=1 --config=test/benchmark/playwright.config.mjs && npm run test:cleanup-benchmark-data", + "test:browser": "karma start karma.conf.cjs", + "test:unit": "echo not yet", "test:unzip-benchmark-data": "tar -xvf test/benchmark/tokyo_canned_data.zip -C test/benchmark", "test:cleanup-benchmark-data": "rm test/benchmark/tokyo_*_canned_osm_data.js", - "test:spec": "karma start karma.conf.cjs", "translations": "node scripts/update_locales.js" }, "dependencies": { diff --git a/test/.eslintrc b/test/.eslintrc index 06c181cfb2..aafa4fe3f2 100644 --- a/test/.eslintrc +++ b/test/.eslintrc @@ -5,7 +5,6 @@ }, "globals": { "expect": true, - "fakeFetch": true, "happen": false, "iD": false, "Rapid": false, @@ -16,4 +15,4 @@ "rules": { "no-unused-expressions": "off" } -} \ No newline at end of file +} diff --git a/test/benchmark/bench_helpers.js b/test/benchmark/bench_helpers.js index f6a226c06e..2367b1cb4b 100644 --- a/test/benchmark/bench_helpers.js +++ b/test/benchmark/bench_helpers.js @@ -1,4 +1,3 @@ -/* globals chai:false */ /* eslint no-extend-native:off */ // Disable things that use the network diff --git a/test/benchmark/tests/bench.js b/test/benchmark/tests/bench.js index 228309d4c0..0137a97a35 100644 --- a/test/benchmark/tests/bench.js +++ b/test/benchmark/tests/bench.js @@ -1,5 +1,5 @@ -// uncomment imports if running outside browser env! -// import Benchmark from 'benchmark'; +/* eslint-disable no-console */ +import Benchmark from 'benchmark'; const suite = new Benchmark.Suite(); const values = []; @@ -42,6 +42,7 @@ let renderData; let graphEntities; let projection; let zoom; +let tokyo_15, tokyo_17, tokyo_19; const timestamp = 1649012524130; //Now initialize context in a similar fashion to our unit tests. diff --git a/test/spec/Context.test.js b/test/browser/Context.test.js similarity index 100% rename from test/spec/Context.test.js rename to test/browser/Context.test.js diff --git a/test/spec/actions/add_entity.js b/test/browser/actions/add_entity.js similarity index 100% rename from test/spec/actions/add_entity.js rename to test/browser/actions/add_entity.js diff --git a/test/spec/actions/add_member.js b/test/browser/actions/add_member.js similarity index 100% rename from test/spec/actions/add_member.js rename to test/browser/actions/add_member.js diff --git a/test/spec/actions/add_midpoint.js b/test/browser/actions/add_midpoint.js similarity index 100% rename from test/spec/actions/add_midpoint.js rename to test/browser/actions/add_midpoint.js diff --git a/test/spec/actions/change_member.js b/test/browser/actions/change_member.js similarity index 100% rename from test/spec/actions/change_member.js rename to test/browser/actions/change_member.js diff --git a/test/spec/actions/change_preset.js b/test/browser/actions/change_preset.js similarity index 100% rename from test/spec/actions/change_preset.js rename to test/browser/actions/change_preset.js diff --git a/test/spec/actions/change_tags.js b/test/browser/actions/change_tags.js similarity index 100% rename from test/spec/actions/change_tags.js rename to test/browser/actions/change_tags.js diff --git a/test/spec/actions/circularize.js b/test/browser/actions/circularize.js similarity index 100% rename from test/spec/actions/circularize.js rename to test/browser/actions/circularize.js diff --git a/test/spec/actions/connect.js b/test/browser/actions/connect.js similarity index 100% rename from test/spec/actions/connect.js rename to test/browser/actions/connect.js diff --git a/test/spec/actions/copy_entities.js b/test/browser/actions/copy_entities.js similarity index 100% rename from test/spec/actions/copy_entities.js rename to test/browser/actions/copy_entities.js diff --git a/test/spec/actions/delete_member.js b/test/browser/actions/delete_member.js similarity index 100% rename from test/spec/actions/delete_member.js rename to test/browser/actions/delete_member.js diff --git a/test/spec/actions/delete_multiple.js b/test/browser/actions/delete_multiple.js similarity index 100% rename from test/spec/actions/delete_multiple.js rename to test/browser/actions/delete_multiple.js diff --git a/test/spec/actions/delete_node.js b/test/browser/actions/delete_node.js similarity index 100% rename from test/spec/actions/delete_node.js rename to test/browser/actions/delete_node.js diff --git a/test/spec/actions/delete_relation.js b/test/browser/actions/delete_relation.js similarity index 100% rename from test/spec/actions/delete_relation.js rename to test/browser/actions/delete_relation.js diff --git a/test/spec/actions/delete_way.js b/test/browser/actions/delete_way.js similarity index 100% rename from test/spec/actions/delete_way.js rename to test/browser/actions/delete_way.js diff --git a/test/spec/actions/discard_tags.js b/test/browser/actions/discard_tags.js similarity index 100% rename from test/spec/actions/discard_tags.js rename to test/browser/actions/discard_tags.js diff --git a/test/spec/actions/disconnect.js b/test/browser/actions/disconnect.js similarity index 100% rename from test/spec/actions/disconnect.js rename to test/browser/actions/disconnect.js diff --git a/test/spec/actions/extract.js b/test/browser/actions/extract.js similarity index 100% rename from test/spec/actions/extract.js rename to test/browser/actions/extract.js diff --git a/test/spec/actions/join.js b/test/browser/actions/join.js similarity index 100% rename from test/spec/actions/join.js rename to test/browser/actions/join.js diff --git a/test/spec/actions/merge.js b/test/browser/actions/merge.js similarity index 100% rename from test/spec/actions/merge.js rename to test/browser/actions/merge.js diff --git a/test/spec/actions/merge_nodes.js b/test/browser/actions/merge_nodes.js similarity index 100% rename from test/spec/actions/merge_nodes.js rename to test/browser/actions/merge_nodes.js diff --git a/test/spec/actions/merge_polygon.js b/test/browser/actions/merge_polygon.js similarity index 100% rename from test/spec/actions/merge_polygon.js rename to test/browser/actions/merge_polygon.js diff --git a/test/spec/actions/merge_remote_changes.js b/test/browser/actions/merge_remote_changes.js similarity index 100% rename from test/spec/actions/merge_remote_changes.js rename to test/browser/actions/merge_remote_changes.js diff --git a/test/spec/actions/move.js b/test/browser/actions/move.js similarity index 100% rename from test/spec/actions/move.js rename to test/browser/actions/move.js diff --git a/test/spec/actions/move_node.js b/test/browser/actions/move_node.js similarity index 100% rename from test/spec/actions/move_node.js rename to test/browser/actions/move_node.js diff --git a/test/spec/actions/noop.js b/test/browser/actions/noop.js similarity index 100% rename from test/spec/actions/noop.js rename to test/browser/actions/noop.js diff --git a/test/spec/actions/orthogonalize.js b/test/browser/actions/orthogonalize.js similarity index 100% rename from test/spec/actions/orthogonalize.js rename to test/browser/actions/orthogonalize.js diff --git a/test/spec/actions/reflect.js b/test/browser/actions/reflect.js similarity index 100% rename from test/spec/actions/reflect.js rename to test/browser/actions/reflect.js diff --git a/test/spec/actions/restrict_turn.js b/test/browser/actions/restrict_turn.js similarity index 100% rename from test/spec/actions/restrict_turn.js rename to test/browser/actions/restrict_turn.js diff --git a/test/spec/actions/reverse.js b/test/browser/actions/reverse.js similarity index 100% rename from test/spec/actions/reverse.js rename to test/browser/actions/reverse.js diff --git a/test/spec/actions/revert.js b/test/browser/actions/revert.js similarity index 100% rename from test/spec/actions/revert.js rename to test/browser/actions/revert.js diff --git a/test/spec/actions/split.js b/test/browser/actions/split.js similarity index 100% rename from test/spec/actions/split.js rename to test/browser/actions/split.js diff --git a/test/spec/actions/straighten_nodes.js b/test/browser/actions/straighten_nodes.js similarity index 100% rename from test/spec/actions/straighten_nodes.js rename to test/browser/actions/straighten_nodes.js diff --git a/test/spec/actions/straighten_way.js b/test/browser/actions/straighten_way.js similarity index 100% rename from test/spec/actions/straighten_way.js rename to test/browser/actions/straighten_way.js diff --git a/test/spec/actions/unrestrict_turn.js b/test/browser/actions/unrestrict_turn.js similarity index 100% rename from test/spec/actions/unrestrict_turn.js rename to test/browser/actions/unrestrict_turn.js diff --git a/test/spec/actions/upgrade_tags.js b/test/browser/actions/upgrade_tags.js similarity index 100% rename from test/spec/actions/upgrade_tags.js rename to test/browser/actions/upgrade_tags.js diff --git a/test/spec/core/DataLoaderSystem.test.js b/test/browser/core/DataLoaderSystem.test.js similarity index 100% rename from test/spec/core/DataLoaderSystem.test.js rename to test/browser/core/DataLoaderSystem.test.js diff --git a/test/spec/core/EditSystem.test.js b/test/browser/core/EditSystem.test.js similarity index 100% rename from test/spec/core/EditSystem.test.js rename to test/browser/core/EditSystem.test.js diff --git a/test/spec/core/FilterSystem.test.js b/test/browser/core/FilterSystem.test.js similarity index 100% rename from test/spec/core/FilterSystem.test.js rename to test/browser/core/FilterSystem.test.js diff --git a/test/spec/core/LocalizationSystem.test.js b/test/browser/core/LocalizationSystem.test.js similarity index 100% rename from test/spec/core/LocalizationSystem.test.js rename to test/browser/core/LocalizationSystem.test.js diff --git a/test/spec/core/LocationSystem.test.js b/test/browser/core/LocationSystem.test.js similarity index 100% rename from test/spec/core/LocationSystem.test.js rename to test/browser/core/LocationSystem.test.js diff --git a/test/spec/core/MapSystem.Test.js b/test/browser/core/MapSystem.Test.js similarity index 100% rename from test/spec/core/MapSystem.Test.js rename to test/browser/core/MapSystem.Test.js diff --git a/test/spec/core/PresetSystem.test.js b/test/browser/core/PresetSystem.test.js similarity index 100% rename from test/spec/core/PresetSystem.test.js rename to test/browser/core/PresetSystem.test.js diff --git a/test/spec/core/UrlHashSystem.test.js b/test/browser/core/UrlHashSystem.test.js similarity index 100% rename from test/spec/core/UrlHashSystem.test.js rename to test/browser/core/UrlHashSystem.test.js diff --git a/test/spec/core/ValidationSystem.test.js b/test/browser/core/ValidationSystem.test.js similarity index 100% rename from test/spec/core/ValidationSystem.test.js rename to test/browser/core/ValidationSystem.test.js diff --git a/test/spec/core/lib/Category.test.js b/test/browser/core/lib/Category.test.js similarity index 100% rename from test/spec/core/lib/Category.test.js rename to test/browser/core/lib/Category.test.js diff --git a/test/spec/core/lib/Collection.test.js b/test/browser/core/lib/Collection.test.js similarity index 100% rename from test/spec/core/lib/Collection.test.js rename to test/browser/core/lib/Collection.test.js diff --git a/test/spec/core/lib/Difference.test.js b/test/browser/core/lib/Difference.test.js similarity index 100% rename from test/spec/core/lib/Difference.test.js rename to test/browser/core/lib/Difference.test.js diff --git a/test/spec/core/lib/Graph.test.js b/test/browser/core/lib/Graph.test.js similarity index 100% rename from test/spec/core/lib/Graph.test.js rename to test/browser/core/lib/Graph.test.js diff --git a/test/spec/core/lib/ImagerySource.test.js b/test/browser/core/lib/ImagerySource.test.js similarity index 100% rename from test/spec/core/lib/ImagerySource.test.js rename to test/browser/core/lib/ImagerySource.test.js diff --git a/test/spec/core/lib/Preset.test.js b/test/browser/core/lib/Preset.test.js similarity index 100% rename from test/spec/core/lib/Preset.test.js rename to test/browser/core/lib/Preset.test.js diff --git a/test/spec/core/lib/Tree.test.js b/test/browser/core/lib/Tree.test.js similarity index 100% rename from test/spec/core/lib/Tree.test.js rename to test/browser/core/lib/Tree.test.js diff --git a/test/spec/geo/geom.js b/test/browser/geo/geom.js similarity index 100% rename from test/spec/geo/geom.js rename to test/browser/geo/geom.js diff --git a/test/spec/operations/extract.js b/test/browser/operations/extract.js similarity index 100% rename from test/spec/operations/extract.js rename to test/browser/operations/extract.js diff --git a/test/spec/operations/straighten.js b/test/browser/operations/straighten.js similarity index 100% rename from test/spec/operations/straighten.js rename to test/browser/operations/straighten.js diff --git a/test/spec/osm/changeset.js b/test/browser/osm/changeset.js similarity index 100% rename from test/spec/osm/changeset.js rename to test/browser/osm/changeset.js diff --git a/test/spec/osm/entity.js b/test/browser/osm/entity.js similarity index 100% rename from test/spec/osm/entity.js rename to test/browser/osm/entity.js diff --git a/test/spec/osm/intersection.js b/test/browser/osm/intersection.js similarity index 100% rename from test/spec/osm/intersection.js rename to test/browser/osm/intersection.js diff --git a/test/spec/osm/lanes.js b/test/browser/osm/lanes.js similarity index 100% rename from test/spec/osm/lanes.js rename to test/browser/osm/lanes.js diff --git a/test/spec/osm/multipolygon.js b/test/browser/osm/multipolygon.js similarity index 100% rename from test/spec/osm/multipolygon.js rename to test/browser/osm/multipolygon.js diff --git a/test/spec/osm/node.js b/test/browser/osm/node.js similarity index 100% rename from test/spec/osm/node.js rename to test/browser/osm/node.js diff --git a/test/spec/osm/note.js b/test/browser/osm/note.js similarity index 100% rename from test/spec/osm/note.js rename to test/browser/osm/note.js diff --git a/test/spec/osm/relation.js b/test/browser/osm/relation.js similarity index 100% rename from test/spec/osm/relation.js rename to test/browser/osm/relation.js diff --git a/test/spec/osm/tags.js b/test/browser/osm/tags.js similarity index 100% rename from test/spec/osm/tags.js rename to test/browser/osm/tags.js diff --git a/test/spec/osm/way.js b/test/browser/osm/way.js similarity index 100% rename from test/spec/osm/way.js rename to test/browser/osm/way.js diff --git a/test/spec/pixi/PixiLayerMapUI.js b/test/browser/pixi/PixiLayerMapUI.js similarity index 100% rename from test/spec/pixi/PixiLayerMapUI.js rename to test/browser/pixi/PixiLayerMapUI.js diff --git a/test/spec/renderer/PixiRenderer.js b/test/browser/renderer/PixiRenderer.js similarity index 84% rename from test/spec/renderer/PixiRenderer.js rename to test/browser/renderer/PixiRenderer.js index 3c35a68b89..06e045a893 100644 --- a/test/spec/renderer/PixiRenderer.js +++ b/test/browser/renderer/PixiRenderer.js @@ -1,5 +1,6 @@ describe('PixiRenderer', () => { const timestamp = 1649012524130; + let context; let map; let renderData; let graphEntities; @@ -10,12 +11,11 @@ describe('PixiRenderer', () => { // Converts a list of json OSM entities to osm objects function jsonToOSM(renderData) { // Entity data is already split into points, vertices, lines, and polygons. - let osmRenderData = {}; - - let points = renderData.points.map(point => Rapid.osmNode(point)); - let vertices = renderData.vertices.map(vertex => Rapid.osmNode(vertex)); - let lines = renderData.lines.map(line => Rapid.osmWay(line)); - let polygons = renderData.polygons.map(polygon => Rapid.osmWay(polygon)); + const osmRenderData = {}; + const points = renderData.points.map(point => Rapid.osmNode(point)); + const vertices = renderData.vertices.map(vertex => Rapid.osmNode(vertex)); + const lines = renderData.lines.map(line => Rapid.osmWay(line)); + const polygons = renderData.polygons.map(polygon => Rapid.osmWay(polygon)); osmRenderData.points = points; osmRenderData.vertices = vertices; @@ -28,9 +28,8 @@ describe('PixiRenderer', () => { // Converts a list of json OSM entities to osm objects function castEntities(entities) { - let osmEntities = []; - for (entityKey in entities) { - let entity = entities[entityKey]; + const osmEntities = []; + for (const entity of entities) { if (entity.id.charAt(0) === 'w') osmEntities.push(new Rapid.osmWay(entity)); if (entity.id.charAt(0) === 'n') osmEntities.push(new Rapid.osmNode(entity)); } diff --git a/test/spec/renderer/canned_osm_data.json b/test/browser/renderer/canned_osm_data.json similarity index 100% rename from test/spec/renderer/canned_osm_data.json rename to test/browser/renderer/canned_osm_data.json diff --git a/test/spec/services/KartaviewService.test.js b/test/browser/services/KartaviewService.test.js similarity index 100% rename from test/spec/services/KartaviewService.test.js rename to test/browser/services/KartaviewService.test.js diff --git a/test/spec/services/MapillaryService.test.js b/test/browser/services/MapillaryService.test.js similarity index 100% rename from test/spec/services/MapillaryService.test.js rename to test/browser/services/MapillaryService.test.js diff --git a/test/spec/services/NominatimService.test.js b/test/browser/services/NominatimService.test.js similarity index 100% rename from test/spec/services/NominatimService.test.js rename to test/browser/services/NominatimService.test.js diff --git a/test/spec/services/OsmService.test.js b/test/browser/services/OsmService.test.js similarity index 100% rename from test/spec/services/OsmService.test.js rename to test/browser/services/OsmService.test.js diff --git a/test/spec/services/OsmWikibaseService.test.js b/test/browser/services/OsmWikibaseService.test.js similarity index 100% rename from test/spec/services/OsmWikibaseService.test.js rename to test/browser/services/OsmWikibaseService.test.js diff --git a/test/spec/services/StreetsideService.test.js b/test/browser/services/StreetsideService.test.js similarity index 100% rename from test/spec/services/StreetsideService.test.js rename to test/browser/services/StreetsideService.test.js diff --git a/test/spec/services/TaginfoService.test.js b/test/browser/services/TaginfoService.test.js similarity index 100% rename from test/spec/services/TaginfoService.test.js rename to test/browser/services/TaginfoService.test.js diff --git a/test/spec/spec_helpers.js b/test/browser/spec_helpers.js similarity index 100% rename from test/spec/spec_helpers.js rename to test/browser/spec_helpers.js diff --git a/test/spec/svg/tag_classes.js b/test/browser/svg/tag_classes.js similarity index 100% rename from test/spec/svg/tag_classes.js rename to test/browser/svg/tag_classes.js diff --git a/test/spec/ui/cmd.js b/test/browser/ui/cmd.js similarity index 100% rename from test/spec/ui/cmd.js rename to test/browser/ui/cmd.js diff --git a/test/spec/ui/combobox.js b/test/browser/ui/combobox.js similarity index 100% rename from test/spec/ui/combobox.js rename to test/browser/ui/combobox.js diff --git a/test/spec/ui/confirm.js b/test/browser/ui/confirm.js similarity index 100% rename from test/spec/ui/confirm.js rename to test/browser/ui/confirm.js diff --git a/test/spec/ui/fields/access.js b/test/browser/ui/fields/access.js similarity index 100% rename from test/spec/ui/fields/access.js rename to test/browser/ui/fields/access.js diff --git a/test/spec/ui/fields/localized.js b/test/browser/ui/fields/localized.js similarity index 100% rename from test/spec/ui/fields/localized.js rename to test/browser/ui/fields/localized.js diff --git a/test/spec/ui/fields/wikipedia.js b/test/browser/ui/fields/wikipedia.js similarity index 100% rename from test/spec/ui/fields/wikipedia.js rename to test/browser/ui/fields/wikipedia.js diff --git a/test/spec/ui/flash.js b/test/browser/ui/flash.js similarity index 100% rename from test/spec/ui/flash.js rename to test/browser/ui/flash.js diff --git a/test/spec/ui/icon.js b/test/browser/ui/icon.js similarity index 100% rename from test/spec/ui/icon.js rename to test/browser/ui/icon.js diff --git a/test/spec/ui/modal.js b/test/browser/ui/modal.js similarity index 100% rename from test/spec/ui/modal.js rename to test/browser/ui/modal.js diff --git a/test/spec/ui/sections/raw_tag_editor.js b/test/browser/ui/sections/raw_tag_editor.js similarity index 100% rename from test/spec/ui/sections/raw_tag_editor.js rename to test/browser/ui/sections/raw_tag_editor.js diff --git a/test/spec/util/keybinding.js b/test/browser/util/keybinding.js similarity index 100% rename from test/spec/util/keybinding.js rename to test/browser/util/keybinding.js diff --git a/test/spec/validations/almost_junction.js b/test/browser/validations/almost_junction.js similarity index 100% rename from test/spec/validations/almost_junction.js rename to test/browser/validations/almost_junction.js diff --git a/test/spec/validations/ambiguous_crossing_tags.js b/test/browser/validations/ambiguous_crossing_tags.js similarity index 100% rename from test/spec/validations/ambiguous_crossing_tags.js rename to test/browser/validations/ambiguous_crossing_tags.js diff --git a/test/spec/validations/crossing_ways.js b/test/browser/validations/crossing_ways.js similarity index 100% rename from test/spec/validations/crossing_ways.js rename to test/browser/validations/crossing_ways.js diff --git a/test/spec/validations/disconnected_way.js b/test/browser/validations/disconnected_way.js similarity index 100% rename from test/spec/validations/disconnected_way.js rename to test/browser/validations/disconnected_way.js diff --git a/test/spec/validations/incompatible_source.js b/test/browser/validations/incompatible_source.js similarity index 100% rename from test/spec/validations/incompatible_source.js rename to test/browser/validations/incompatible_source.js diff --git a/test/spec/validations/mismatched_geometry.js b/test/browser/validations/mismatched_geometry.js similarity index 100% rename from test/spec/validations/mismatched_geometry.js rename to test/browser/validations/mismatched_geometry.js diff --git a/test/spec/validations/missing_role.js b/test/browser/validations/missing_role.js similarity index 100% rename from test/spec/validations/missing_role.js rename to test/browser/validations/missing_role.js diff --git a/test/spec/validations/missing_tag.js b/test/browser/validations/missing_tag.js similarity index 100% rename from test/spec/validations/missing_tag.js rename to test/browser/validations/missing_tag.js diff --git a/test/spec/validations/outdated_tags.js b/test/browser/validations/outdated_tags.js similarity index 100% rename from test/spec/validations/outdated_tags.js rename to test/browser/validations/outdated_tags.js diff --git a/test/spec/validations/private_data.js b/test/browser/validations/private_data.js similarity index 100% rename from test/spec/validations/private_data.js rename to test/browser/validations/private_data.js diff --git a/test/spec/validations/suspicious_name.js b/test/browser/validations/suspicious_name.js similarity index 100% rename from test/spec/validations/suspicious_name.js rename to test/browser/validations/suspicious_name.js diff --git a/test/data/intro_graph.min.json b/test/data/intro_graph.min.json deleted file mode 100644 index d73b650968..0000000000 --- a/test/data/intro_graph.min.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "n1": { - "id": "n1", - "loc": [-85.636433, 41.942959], - "tags": { - "addr:city": "Three Rivers", - "addr:housenumber": "333", - "addr:postcode": "49093", - "addr:state": "MI", - "addr:street": "Michigan Avenue", - "amenity": "townhall", - "name": "Three Rivers City Hall" - } - } -} diff --git a/test/data/node.xml b/test/data/node.xml deleted file mode 100644 index 9e6640dc4c..0000000000 --- a/test/data/node.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - diff --git a/test/data/way.xml b/test/data/way.xml deleted file mode 100644 index e8e2ed5ebc..0000000000 --- a/test/data/way.xml +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From 721e9385877a3d10070df5302437eebf821510ed Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Tue, 16 Jan 2024 14:34:21 -0500 Subject: [PATCH 02/55] Use full file path with extension with import/export I started looking into using node:test for our unit tests and learned that node requires this. Other environments like Typescript, or bundlers like rollup/esbuild/webpack/ or CJS imports, in the past have been more forgiving of skipping the file extension, and they will automatically add the '.js' or look in 'index.js' Node import with ES modules will not do this, for reasons. (it actually mimics the behavior of imports in a browser environment) So going forward, we should just always include the full path and extension for all local file imports. see also https://stackoverflow.com/questions/72491392/when-do-we-need-to-add-file-extension-when-importing-javascript-modules --- modules/Context.js | 10 +- modules/actions/add_member.js | 4 +- modules/actions/change_preset.js | 2 +- modules/actions/circularize.js | 2 +- modules/actions/connect.js | 4 +- modules/actions/delete_member.js | 2 +- modules/actions/delete_members.js | 2 +- modules/actions/delete_multiple.js | 6 +- modules/actions/delete_node.js | 4 +- modules/actions/delete_relation.js | 2 +- modules/actions/delete_way.js | 4 +- modules/actions/disconnect.js | 2 +- modules/actions/extract.js | 3 +- modules/actions/index.js | 81 +++++---- modules/actions/join.js | 8 +- modules/actions/merge.js | 2 +- modules/actions/merge_nodes.js | 3 +- modules/actions/merge_polygon.js | 2 +- modules/actions/merge_remote_changes.js | 4 +- modules/actions/move.js | 4 +- modules/actions/orthogonalize.js | 4 +- modules/actions/rapid_accept_feature.js | 3 +- modules/actions/restrict_turn.js | 2 +- modules/actions/revert.js | 4 +- modules/actions/split.js | 10 +- modules/actions/straighten_way.js | 2 +- modules/actions/unrestrict_turn.js | 2 +- modules/behaviors/DragBehavior.js | 4 +- modules/behaviors/DrawBehavior.js | 4 +- modules/behaviors/HoverBehavior.js | 4 +- modules/behaviors/KeyOperationBehavior.js | 2 +- modules/behaviors/LassoBehavior.js | 2 +- modules/behaviors/MapInteractionBehavior.js | 4 +- modules/behaviors/MapNudgingBehavior.js | 4 +- modules/behaviors/PasteBehavior.js | 14 +- modules/behaviors/SelectBehavior.js | 12 +- modules/behaviors/index.js | 20 +-- modules/core/ColorSystem.js | 72 ++++---- modules/core/DataLoaderSystem.js | 4 +- modules/core/EditSystem.js | 10 +- modules/core/FilterSystem.js | 4 +- modules/core/ImagerySystem.js | 4 +- modules/core/LocalizationSystem.js | 4 +- modules/core/LocationSystem.js | 2 +- modules/core/Map3dSystem.js | 2 +- modules/core/MapSystem.js | 7 +- modules/core/PhotoSystem.js | 2 +- modules/core/PresetSystem.js | 8 +- modules/core/RapidSystem.js | 2 +- modules/core/StorageSystem.js | 2 +- modules/core/StyleSystem.js | 5 +- modules/core/UiSystem.js | 10 +- modules/core/UploaderSystem.js | 10 +- modules/core/UrlHashSystem.js | 4 +- modules/core/ValidationSystem.js | 6 +- modules/core/index.js | 40 ++--- modules/core/lib/Category.js | 2 +- modules/core/lib/ImagerySource.js | 2 +- modules/core/lib/Preset.js | 2 +- modules/core/lib/Tree.js | 3 +- modules/core/lib/ValidationIssue.js | 4 +- modules/core/lib/index.js | 22 +-- modules/index.js | 36 ++-- modules/main.js | 2 +- modules/modes/AddNoteMode.js | 4 +- modules/modes/AddPointMode.js | 12 +- modules/modes/BrowseMode.js | 4 +- modules/modes/DragNodeMode.js | 12 +- modules/modes/DrawAreaMode.js | 14 +- modules/modes/DrawLineMode.js | 15 +- modules/modes/MoveMode.js | 4 +- modules/modes/RotateMode.js | 4 +- modules/modes/SaveMode.js | 14 +- modules/modes/SelectMode.js | 18 +- modules/modes/SelectOsmMode.js | 10 +- modules/modes/index.js | 26 +-- modules/operations/circularize.js | 6 +- modules/operations/continue.js | 2 +- modules/operations/copy.js | 6 +- modules/operations/cycle_highway_tag.js | 4 +- modules/operations/delete.js | 8 +- modules/operations/disconnect.js | 6 +- modules/operations/downgrade.js | 6 +- modules/operations/extract.js | 6 +- modules/operations/index.js | 34 ++-- modules/operations/merge.js | 10 +- modules/operations/move.js | 4 +- modules/operations/orthogonalize.js | 6 +- modules/operations/paste.js | 6 +- modules/operations/reflect.js | 6 +- modules/operations/reverse.js | 4 +- modules/operations/rotate.js | 4 +- modules/operations/split.js | 4 +- modules/operations/straighten.js | 8 +- modules/osm/changeset.js | 2 +- modules/osm/entity.js | 2 +- modules/osm/index.js | 22 +-- modules/osm/intersection.js | 10 +- modules/osm/multipolygon.js | 6 +- modules/osm/node.js | 2 +- modules/osm/relation.js | 4 +- modules/osm/way.js | 8 +- modules/pixi/AbstractFeature.js | 2 +- modules/pixi/PixiEvents.js | 2 +- modules/pixi/PixiFeatureLine.js | 4 +- modules/pixi/PixiFeaturePoint.js | 2 +- modules/pixi/PixiFeaturePolygon.js | 7 +- modules/pixi/PixiLayerBackgroundTiles.js | 2 +- modules/pixi/PixiLayerCustomData.js | 10 +- modules/pixi/PixiLayerEditBlocks.js | 4 +- modules/pixi/PixiLayerImproveOsm.js | 4 +- modules/pixi/PixiLayerKartaPhotos.js | 6 +- modules/pixi/PixiLayerKeepRight.js | 4 +- modules/pixi/PixiLayerLabels.js | 3 +- modules/pixi/PixiLayerMapUI.js | 4 +- modules/pixi/PixiLayerMapillaryFeatures.js | 4 +- modules/pixi/PixiLayerMapillaryPhotos.js | 7 +- modules/pixi/PixiLayerMapillarySigns.js | 4 +- modules/pixi/PixiLayerOsm.js | 8 +- modules/pixi/PixiLayerOsmNotes.js | 4 +- modules/pixi/PixiLayerOsmose.js | 4 +- modules/pixi/PixiLayerRapid.js | 8 +- modules/pixi/PixiLayerStreetsidePhotos.js | 6 +- modules/pixi/PixiRenderer.js | 10 +- modules/pixi/PixiScene.js | 32 ++-- modules/services/EsriService.js | 8 +- modules/services/ImproveOsmService.js | 6 +- modules/services/KartaviewService.js | 4 +- modules/services/KeepRightService.js | 6 +- modules/services/MapWithAIService.js | 8 +- modules/services/MapillaryService.js | 4 +- modules/services/NominatimService.js | 4 +- modules/services/NsiService.js | 2 +- modules/services/OsmService.js | 10 +- modules/services/OsmWikibaseService.js | 6 +- modules/services/OsmoseService.js | 6 +- modules/services/StreetsideService.js | 6 +- modules/services/TaginfoService.js | 6 +- modules/services/VectorTileService.js | 7 +- modules/services/WikidataService.js | 4 +- modules/services/WikipediaService.js | 4 +- modules/services/index.js | 32 ++-- modules/svg/tag_classes.js | 3 +- modules/ui/UiDefs.js | 2 +- modules/ui/UiField.js | 12 +- modules/ui/account.js | 2 +- modules/ui/attribution.js | 2 +- modules/ui/changeset_editor.js | 10 +- modules/ui/cmd.js | 2 +- modules/ui/combobox.js | 3 +- modules/ui/commit.js | 16 +- modules/ui/commit_warnings.js | 2 +- modules/ui/confirm.js | 2 +- modules/ui/conflicts.js | 8 +- modules/ui/contributors.js | 4 +- modules/ui/data_editor.js | 7 +- modules/ui/data_header.js | 2 +- modules/ui/disclosure.js | 7 +- modules/ui/edit_menu.js | 9 +- modules/ui/entity_editor.js | 22 +-- modules/ui/feature_info.js | 2 +- modules/ui/feature_list.js | 11 +- modules/ui/field_help.js | 6 +- modules/ui/fields/access.js | 4 +- modules/ui/fields/address.js | 6 +- modules/ui/fields/check.js | 8 +- modules/ui/fields/combo.js | 8 +- modules/ui/fields/cycleway.js | 4 +- modules/ui/fields/index.js | 56 +++--- modules/ui/fields/input.js | 4 +- modules/ui/fields/lanes.js | 4 +- modules/ui/fields/localized.js | 8 +- modules/ui/fields/radio.js | 4 +- modules/ui/fields/restrictions.js | 12 +- modules/ui/fields/roadspeed.js | 4 +- modules/ui/fields/textarea.js | 2 +- modules/ui/fields/wikidata.js | 8 +- modules/ui/fields/wikipedia.js | 8 +- modules/ui/form_fields.js | 4 +- modules/ui/full_screen.js | 4 +- modules/ui/geolocate.js | 6 +- modules/ui/improveOSM_comments.js | 2 +- modules/ui/improveOSM_details.js | 2 +- modules/ui/improveOSM_editor.js | 10 +- modules/ui/index.js | 162 +++++++++--------- modules/ui/info.js | 12 +- modules/ui/inspector.js | 6 +- modules/ui/intro/UiCurtain.js | 2 +- modules/ui/intro/area.js | 4 +- modules/ui/intro/building.js | 6 +- modules/ui/intro/helper.js | 2 +- modules/ui/intro/intro.js | 26 +-- modules/ui/intro/line.js | 4 +- modules/ui/intro/navigation.js | 4 +- modules/ui/intro/point.js | 6 +- modules/ui/intro/rapid.js | 4 +- modules/ui/intro/start_editing.js | 6 +- modules/ui/intro/welcome.js | 4 +- modules/ui/issues_info.js | 4 +- modules/ui/keepRight_details.js | 2 +- modules/ui/keepRight_editor.js | 10 +- modules/ui/keepRight_header.js | 2 +- modules/ui/loading.js | 3 +- modules/ui/map3d_viewer.js | 4 +- modules/ui/map_in_map.js | 4 +- modules/ui/modal.js | 4 +- modules/ui/note_comments.js | 2 +- modules/ui/note_editor.js | 13 +- modules/ui/note_header.js | 2 +- modules/ui/note_report.js | 4 +- modules/ui/osmose_details.js | 2 +- modules/ui/osmose_editor.js | 11 +- modules/ui/pane.js | 4 +- modules/ui/panels/UiPanelBackground.js | 4 +- modules/ui/panels/UiPanelHistory.js | 4 +- modules/ui/panels/UiPanelLocation.js | 4 +- modules/ui/panels/UiPanelMeasurement.js | 4 +- modules/ui/panels/index.js | 8 +- modules/ui/panes/background.js | 14 +- modules/ui/panes/help.js | 10 +- modules/ui/panes/index.js | 10 +- modules/ui/panes/issues.js | 10 +- modules/ui/panes/map_data.js | 10 +- modules/ui/panes/preferences.js | 6 +- modules/ui/photo_viewer.js | 5 +- modules/ui/popover.js | 3 +- modules/ui/preset_icon.js | 3 +- modules/ui/preset_list.js | 18 +- modules/ui/rapid_colorpicker.js | 4 +- modules/ui/rapid_feature_inspector.js | 10 +- modules/ui/rapid_feature_toggle_dialog.js | 10 +- modules/ui/rapid_first_edit_dialog.js | 6 +- modules/ui/rapid_poweruser_features_dialog.js | 2 +- modules/ui/rapid_splash.js | 6 +- modules/ui/rapid_view_manage_datasets.js | 6 +- modules/ui/rapid_whatsnew.js | 5 +- modules/ui/restore.js | 2 +- modules/ui/section.js | 4 +- .../ui/sections/background_display_options.js | 4 +- modules/ui/sections/background_list.js | 20 +-- modules/ui/sections/background_offset.js | 4 +- modules/ui/sections/changes.js | 12 +- modules/ui/sections/data_layers.js | 10 +- modules/ui/sections/entity_issues.js | 6 +- modules/ui/sections/feature_type.js | 10 +- modules/ui/sections/grid_display_options.js | 2 +- modules/ui/sections/index.js | 44 ++--- modules/ui/sections/map_features.js | 4 +- .../ui/sections/map_interaction_options.js | 4 +- modules/ui/sections/map_style_options.js | 4 +- modules/ui/sections/overlay_list.js | 6 +- modules/ui/sections/photo_overlays.js | 6 +- modules/ui/sections/preset_fields.js | 8 +- modules/ui/sections/privacy.js | 6 +- modules/ui/sections/raw_member_editor.js | 16 +- modules/ui/sections/raw_membership_editor.js | 20 +-- modules/ui/sections/raw_tag_editor.js | 10 +- modules/ui/sections/react_container.jsx | 6 +- modules/ui/sections/selection_list.js | 8 +- modules/ui/sections/validation_issues.js | 8 +- modules/ui/sections/validation_options.js | 2 +- modules/ui/sections/validation_rules.js | 6 +- modules/ui/sections/validation_status.js | 6 +- modules/ui/settings/custom_background.js | 4 +- modules/ui/settings/custom_data.js | 4 +- modules/ui/settings/index.js | 4 +- modules/ui/shortcuts.js | 8 +- modules/ui/sidebar.js | 24 +-- modules/ui/splash.js | 4 +- modules/ui/status.js | 4 +- modules/ui/success.js | 7 +- modules/ui/tag_reference.js | 2 +- modules/ui/tools/download_osc.js | 10 +- modules/ui/tools/index.js | 15 +- modules/ui/tools/modes.js | 6 +- modules/ui/tools/notes.js | 6 +- modules/ui/tools/rapid_features.js | 9 +- modules/ui/tools/save.js | 6 +- modules/ui/tools/sidebar_toggle.js | 4 +- modules/ui/tools/undo_redo.js | 8 +- modules/ui/tooltip.js | 6 +- modules/ui/top_toolbar.js | 2 +- modules/ui/version.js | 4 +- modules/ui/view_on_keepRight.js | 4 +- modules/ui/view_on_osm.js | 4 +- modules/ui/view_on_osmose.js | 4 +- modules/ui/zoom.js | 8 +- modules/ui/zoom_to_selection.js | 4 +- modules/util/index.js | 30 ++-- modules/validations/almost_junction.js | 12 +- .../validations/ambiguous_crossing_tags.js | 4 +- modules/validations/close_nodes.js | 6 +- modules/validations/crossing_ways.js | 8 +- modules/validations/disconnected_way.js | 6 +- modules/validations/duplicate_way_segments.js | 2 +- modules/validations/help_request.js | 2 +- modules/validations/impossible_oneway.js | 6 +- modules/validations/incompatible_source.js | 2 +- modules/validations/index.js | 38 ++-- modules/validations/invalid_format.js | 2 +- modules/validations/mismatched_geometry.js | 16 +- modules/validations/missing_role.js | 6 +- modules/validations/missing_tag.js | 8 +- modules/validations/outdated_tags.js | 10 +- modules/validations/private_data.js | 4 +- modules/validations/short_road.js | 4 +- modules/validations/suspicious_name.js | 4 +- modules/validations/unsquare_way.js | 8 +- modules/validations/y_shaped_connection.js | 4 +- 309 files changed, 1243 insertions(+), 1227 deletions(-) diff --git a/modules/Context.js b/modules/Context.js index 8673613b5e..f512d3650e 100644 --- a/modules/Context.js +++ b/modules/Context.js @@ -3,12 +3,12 @@ import { select as d3_select } from 'd3-selection'; import { Projection, geoScaleToZoom } from '@rapid-sdk/math'; import { utilUnicodeCharsTruncated } from '@rapid-sdk/util'; -import { behaviors } from './behaviors'; -import { modes } from './modes'; -import { services } from './services'; -import { systems } from './core'; +import { behaviors } from './behaviors/index.js'; +import { modes } from './modes/index.js'; +import { services } from './services/index.js'; +import { systems } from './core/index.js'; -import { utilKeybinding } from './util'; +import { utilKeybinding } from './util/keybinding.js'; const MINZOOM = 15; const TILESIZE = 256; diff --git a/modules/actions/add_member.js b/modules/actions/add_member.js index 5dcac628c5..9c83da777d 100644 --- a/modules/actions/add_member.js +++ b/modules/actions/add_member.js @@ -1,7 +1,7 @@ import { utilArrayGroupBy, utilObjectOmit } from '@rapid-sdk/util'; -import { osmJoinWays } from '../osm/multipolygon'; -import { osmWay } from '../osm/way'; +import { osmJoinWays } from '../osm/multipolygon.js'; +import { osmWay } from '../osm/way.js'; export function actionAddMember(relationId, member, memberIndex, insertPair) { diff --git a/modules/actions/change_preset.js b/modules/actions/change_preset.js index d8f6831ebd..7fbb2d4f68 100644 --- a/modules/actions/change_preset.js +++ b/modules/actions/change_preset.js @@ -1,4 +1,4 @@ -import { actionSyncCrossingTags } from './sync_crossing_tags'; +import { actionSyncCrossingTags } from './sync_crossing_tags.js'; export function actionChangePreset(entityID, oldPreset, newPreset, skipFieldDefaults) { return function action(graph) { diff --git a/modules/actions/circularize.js b/modules/actions/circularize.js index ba2ba83e68..719bd7f236 100644 --- a/modules/actions/circularize.js +++ b/modules/actions/circularize.js @@ -7,7 +7,7 @@ import { import { vecInterp, vecLength, vecLengthSquare } from '@rapid-sdk/math'; import { utilArrayUniq } from '@rapid-sdk/util'; -import { osmNode } from '../osm/node'; +import { osmNode } from '../osm/node.js'; export function actionCircularize(wayId, projection, maxAngle) { diff --git a/modules/actions/connect.js b/modules/actions/connect.js index 0016d5dd81..37725e7522 100644 --- a/modules/actions/connect.js +++ b/modules/actions/connect.js @@ -1,7 +1,7 @@ import { utilArrayUniq } from '@rapid-sdk/util'; -import { actionDeleteNode } from './delete_node'; -import { actionDeleteWay } from './delete_way'; +import { actionDeleteNode } from './delete_node.js'; +import { actionDeleteWay } from './delete_way.js'; // Connect the ways at the given nodes. diff --git a/modules/actions/delete_member.js b/modules/actions/delete_member.js index 81715eae46..b1653e8fec 100644 --- a/modules/actions/delete_member.js +++ b/modules/actions/delete_member.js @@ -1,4 +1,4 @@ -import { actionDeleteRelation } from './delete_relation'; +import { actionDeleteRelation } from './delete_relation.js'; export function actionDeleteMember(relationId, memberIndex) { diff --git a/modules/actions/delete_members.js b/modules/actions/delete_members.js index 2ef06b9f9b..df56df7e74 100644 --- a/modules/actions/delete_members.js +++ b/modules/actions/delete_members.js @@ -1,4 +1,4 @@ -import { actionDeleteMember } from './delete_member'; +import { actionDeleteMember } from './delete_member.js'; export function actionDeleteMembers(relationId, memberIndexes) { diff --git a/modules/actions/delete_multiple.js b/modules/actions/delete_multiple.js index 904d712ca8..93ec9cdbc4 100644 --- a/modules/actions/delete_multiple.js +++ b/modules/actions/delete_multiple.js @@ -1,6 +1,6 @@ -import { actionDeleteNode } from './delete_node'; -import { actionDeleteRelation } from './delete_relation'; -import { actionDeleteWay } from './delete_way'; +import { actionDeleteNode } from './delete_node.js'; +import { actionDeleteRelation } from './delete_relation.js'; +import { actionDeleteWay } from './delete_way.js'; export function actionDeleteMultiple(ids) { diff --git a/modules/actions/delete_node.js b/modules/actions/delete_node.js index 402fe0cfe8..9d34b1aaca 100644 --- a/modules/actions/delete_node.js +++ b/modules/actions/delete_node.js @@ -1,5 +1,5 @@ -import { actionDeleteRelation } from './delete_relation'; -import { actionDeleteWay } from './delete_way'; +import { actionDeleteRelation } from './delete_relation.js'; +import { actionDeleteWay } from './delete_way.js'; // https://github.com/openstreetmap/potlatch2/blob/master/net/systemeD/halcyon/connection/actions/DeleteNodeAction.as diff --git a/modules/actions/delete_relation.js b/modules/actions/delete_relation.js index 1ec571ce32..fedd4e3e19 100644 --- a/modules/actions/delete_relation.js +++ b/modules/actions/delete_relation.js @@ -1,6 +1,6 @@ import { utilArrayUniq } from '@rapid-sdk/util'; -import { actionDeleteMultiple } from './delete_multiple'; +import { actionDeleteMultiple } from './delete_multiple.js'; // https://github.com/openstreetmap/potlatch2/blob/master/net/systemeD/halcyon/connection/actions/DeleteRelationAction.as diff --git a/modules/actions/delete_way.js b/modules/actions/delete_way.js index b7faff26c3..32294fe30b 100644 --- a/modules/actions/delete_way.js +++ b/modules/actions/delete_way.js @@ -1,5 +1,5 @@ -import { osmNodeGeometriesForTags } from '../osm/tags'; -import { actionDeleteRelation } from './delete_relation'; +import { osmNodeGeometriesForTags } from '../osm/tags.js'; +import { actionDeleteRelation } from './delete_relation.js'; // https://github.com/openstreetmap/potlatch2/blob/master/net/systemeD/halcyon/connection/actions/DeleteWayAction.as diff --git a/modules/actions/disconnect.js b/modules/actions/disconnect.js index c6e25ec5e1..12fbfaebaa 100644 --- a/modules/actions/disconnect.js +++ b/modules/actions/disconnect.js @@ -1,4 +1,4 @@ -import { osmNode } from '../osm/node'; +import { osmNode } from '../osm/node.js'; // Disconnect the ways at the given node. diff --git a/modules/actions/extract.js b/modules/actions/extract.js index bd980deb89..bc85a80db0 100644 --- a/modules/actions/extract.js +++ b/modules/actions/extract.js @@ -1,6 +1,7 @@ import { polygonCentroid as d3_polygonCentroid } from 'd3-polygon'; import { vecInterp } from '@rapid-sdk/math'; -import { osmNode } from '../osm/node'; + +import { osmNode } from '../osm/node.js'; export function actionExtract(entityID, projection) { diff --git a/modules/actions/index.js b/modules/actions/index.js index 690187f371..f9864fc687 100644 --- a/modules/actions/index.js +++ b/modules/actions/index.js @@ -1,42 +1,41 @@ -export { actionAddEntity } from './add_entity'; -export { actionAddMember } from './add_member'; -export { actionAddMidpoint } from './add_midpoint'; -export { actionAddVertex } from './add_vertex'; -export { actionChangeMember } from './change_member'; -export { actionChangePreset } from './change_preset'; -export { actionChangeTags } from './change_tags'; -export { actionCircularize } from './circularize'; -export { actionConnect } from './connect'; -export { actionCopyEntities } from './copy_entities'; -export { actionDeleteMember } from './delete_member'; -export { actionDeleteMultiple } from './delete_multiple'; -export { actionDeleteNode } from './delete_node'; -export { actionDeleteRelation } from './delete_relation'; -export { actionDeleteWay } from './delete_way'; -export { actionDiscardTags } from './discard_tags'; -export { actionDisconnect } from './disconnect'; -export { actionExtract } from './extract'; -export { actionJoin } from './join'; -export { actionMerge } from './merge'; -export { actionMergeNodes } from './merge_nodes'; -export { actionMergePolygon } from './merge_polygon'; -export { actionMergeRemoteChanges } from './merge_remote_changes'; -export { actionMove } from './move'; -export { actionMoveMember } from './move_member'; -export { actionMoveNode } from './move_node'; -export { actionNoop } from './noop'; -export { actionOrthogonalize } from './orthogonalize'; -export { actionRestrictTurn } from './restrict_turn'; -export { actionReverse } from './reverse'; -export { actionRevert } from './revert'; -export { actionRotate } from './rotate'; -export { actionScale } from './scale'; -export { actionSplit } from './split'; -export { actionStraightenNodes } from './straighten_nodes'; -export { actionStraightenWay } from './straighten_way'; -export { actionSyncCrossingTags } from './sync_crossing_tags'; -export { actionUnrestrictTurn } from './unrestrict_turn'; +export { actionAddEntity } from './add_entity.js'; +export { actionAddMember } from './add_member.js'; +export { actionAddMidpoint } from './add_midpoint.js'; +export { actionAddVertex } from './add_vertex.js'; +export { actionChangeMember } from './change_member.js'; +export { actionChangePreset } from './change_preset.js'; +export { actionChangeTags } from './change_tags.js'; +export { actionCircularize } from './circularize.js'; +export { actionConnect } from './connect.js'; +export { actionCopyEntities } from './copy_entities.js'; +export { actionDeleteMember } from './delete_member.js'; +export { actionDeleteMultiple } from './delete_multiple.js'; +export { actionDeleteNode } from './delete_node.js'; +export { actionDeleteRelation } from './delete_relation.js'; +export { actionDeleteWay } from './delete_way.js'; +export { actionDiscardTags } from './discard_tags.js'; +export { actionDisconnect } from './disconnect.js'; +export { actionExtract } from './extract.js'; +export { actionJoin } from './join.js'; +export { actionMerge } from './merge.js'; +export { actionMergeNodes } from './merge_nodes.js'; +export { actionMergePolygon } from './merge_polygon.js'; +export { actionMergeRemoteChanges } from './merge_remote_changes.js'; +export { actionMove } from './move.js'; +export { actionMoveMember } from './move_member.js'; +export { actionMoveNode } from './move_node.js'; +export { actionNoop } from './noop.js'; +export { actionOrthogonalize } from './orthogonalize.js'; +export { actionRapidAcceptFeature } from './rapid_accept_feature.js'; +export { actionRestrictTurn } from './restrict_turn.js'; +export { actionReverse } from './reverse.js'; +export { actionRevert } from './revert.js'; +export { actionRotate } from './rotate.js'; +export { actionScale } from './scale.js'; +export { actionSplit } from './split.js'; +export { actionStraightenNodes } from './straighten_nodes.js'; +export { actionStraightenWay } from './straighten_way.js'; +export { actionSyncCrossingTags } from './sync_crossing_tags.js'; +export { actionUnrestrictTurn } from './unrestrict_turn.js'; export { actionReflect } from './reflect.js'; -export { actionUpgradeTags } from './upgrade_tags'; - -export { actionRapidAcceptFeature } from './rapid_accept_feature'; +export { actionUpgradeTags } from './upgrade_tags.js'; diff --git a/modules/actions/join.js b/modules/actions/join.js index b419bb746e..bcc3de0c42 100644 --- a/modules/actions/join.js +++ b/modules/actions/join.js @@ -1,10 +1,10 @@ import { geomPathIntersections } from '@rapid-sdk/math'; import { utilArrayGroupBy, utilArrayIdentical, utilArrayIntersection } from '@rapid-sdk/util'; -import { actionDeleteRelation } from './delete_relation'; -import { actionDeleteWay } from './delete_way'; -import { osmIsInterestingTag } from '../osm/tags'; -import { osmJoinWays } from '../osm/multipolygon'; +import { actionDeleteRelation } from './delete_relation.js'; +import { actionDeleteWay } from './delete_way.js'; +import { osmIsInterestingTag } from '../osm/tags.js'; +import { osmJoinWays } from '../osm/multipolygon.js'; // Join ways at the end node they share. diff --git a/modules/actions/merge.js b/modules/actions/merge.js index 5cd17054af..2192b2d96e 100644 --- a/modules/actions/merge.js +++ b/modules/actions/merge.js @@ -1,6 +1,6 @@ import { utilArrayGroupBy, utilArrayUniq } from '@rapid-sdk/util'; -import { osmTagSuggestingArea } from '../osm/tags'; +import { osmTagSuggestingArea } from '../osm/tags.js'; export function actionMerge(ids) { diff --git a/modules/actions/merge_nodes.js b/modules/actions/merge_nodes.js index ee55cc7a65..b8a17e9e95 100644 --- a/modules/actions/merge_nodes.js +++ b/modules/actions/merge_nodes.js @@ -1,6 +1,7 @@ -import { actionConnect } from './connect'; import { vecAdd, vecScale } from '@rapid-sdk/math'; +import { actionConnect } from './connect.js'; + // `actionMergeNodes` is just a combination of: // diff --git a/modules/actions/merge_polygon.js b/modules/actions/merge_polygon.js index 30c82a519f..f8109951d0 100644 --- a/modules/actions/merge_polygon.js +++ b/modules/actions/merge_polygon.js @@ -1,7 +1,7 @@ import { geomPolygonContainsPolygon } from '@rapid-sdk/math'; import { utilArrayGroupBy, utilArrayIntersection, utilObjectOmit } from '@rapid-sdk/util'; -import { osmJoinWays, osmRelation } from '../osm'; +import { osmJoinWays, osmRelation } from '../osm/index.js'; export function actionMergePolygon(ids, newRelationId) { diff --git a/modules/actions/merge_remote_changes.js b/modules/actions/merge_remote_changes.js index 97d1ede720..bf94f225c5 100644 --- a/modules/actions/merge_remote_changes.js +++ b/modules/actions/merge_remote_changes.js @@ -3,8 +3,8 @@ import { utilArrayUnion, utilArrayUniq } from '@rapid-sdk/util'; import deepEqual from 'fast-deep-equal'; import { diff3Merge } from 'node-diff3'; -import { actionDeleteMultiple } from './delete_multiple'; -import { osmEntity } from '../osm'; +import { actionDeleteMultiple } from './delete_multiple.js'; +import { osmEntity } from '../osm/entity.js'; export function actionMergeRemoteChanges(id, options = {}) { diff --git a/modules/actions/move.js b/modules/actions/move.js index 770ba96a22..7bb06ba220 100644 --- a/modules/actions/move.js +++ b/modules/actions/move.js @@ -1,8 +1,8 @@ import { geomPathIntersections, geomPathLength, vecAdd, vecAngle, vecEqual, vecInterp, vecSubtract } from '@rapid-sdk/math'; import { utilArrayIntersection } from '@rapid-sdk/util'; -import { geoChooseEdge } from '../geo'; -import { osmNode } from '../osm/node'; +import { geoChooseEdge } from '../geo/index.js'; +import { osmNode } from '../osm/node.js'; // https://github.com/openstreetmap/josm/blob/mirror/src/org/openstreetmap/josm/command/MoveCommand.java diff --git a/modules/actions/orthogonalize.js b/modules/actions/orthogonalize.js index ab5c2a8038..6c8cbeeeea 100644 --- a/modules/actions/orthogonalize.js +++ b/modules/actions/orthogonalize.js @@ -2,8 +2,8 @@ import { vecAdd, vecEqual, vecInterp, vecLength, vecNormalize, vecProject, vecScale, vecSubtract } from '@rapid-sdk/math'; -import { actionDeleteNode } from './delete_node'; -import { geoOrthoNormalizedDotProduct, geoOrthoCalcScore, geoOrthoCanOrthogonalize } from '../geo'; +import { actionDeleteNode } from './delete_node.js'; +import { geoOrthoNormalizedDotProduct, geoOrthoCalcScore, geoOrthoCanOrthogonalize } from '../geo/index.js'; export function actionOrthogonalize(wayID, projection, vertexID, degThresh, ep) { diff --git a/modules/actions/rapid_accept_feature.js b/modules/actions/rapid_accept_feature.js index d2b8e48818..6df8688890 100644 --- a/modules/actions/rapid_accept_feature.js +++ b/modules/actions/rapid_accept_feature.js @@ -1,5 +1,6 @@ import { vecInterp } from '@rapid-sdk/math'; -import { osmNode, osmRelation, osmWay } from '../osm'; + +import { osmNode, osmRelation, osmWay } from '../osm/index.js'; function findConnectionPoint(graph, newNode, targetWay, nodeA, nodeB) { diff --git a/modules/actions/restrict_turn.js b/modules/actions/restrict_turn.js index 31cba88395..4d305759b1 100644 --- a/modules/actions/restrict_turn.js +++ b/modules/actions/restrict_turn.js @@ -1,4 +1,4 @@ -import { osmRelation } from '../osm/relation'; +import { osmRelation } from '../osm/relation.js'; // `actionRestrictTurn` creates a turn restriction relation. diff --git a/modules/actions/revert.js b/modules/actions/revert.js index bf102db9e6..8f5afdb109 100644 --- a/modules/actions/revert.js +++ b/modules/actions/revert.js @@ -1,5 +1,5 @@ -import { actionDeleteRelation } from './delete_relation'; -import { actionDeleteWay } from './delete_way'; +import { actionDeleteRelation } from './delete_relation.js'; +import { actionDeleteWay } from './delete_way.js'; export function actionRevert(id) { diff --git a/modules/actions/split.js b/modules/actions/split.js index d5bd41a874..e0314343b6 100644 --- a/modules/actions/split.js +++ b/modules/actions/split.js @@ -1,11 +1,11 @@ import { geoSphericalDistance } from '@rapid-sdk/math'; import { utilArrayIntersection, utilArrayUniq } from '@rapid-sdk/util'; -import { actionAddMember } from './add_member'; -import { osmIsOldMultipolygonOuterMember } from '../osm/multipolygon'; -import { osmRelation } from '../osm/relation'; -import { osmWay } from '../osm/way'; -import { utilWrap } from '../util'; +import { actionAddMember } from './add_member.js'; +import { osmIsOldMultipolygonOuterMember } from '../osm/multipolygon.js'; +import { osmRelation } from '../osm/relation.js'; +import { osmWay } from '../osm/way.js'; +import { utilWrap } from '../util/index.js'; // Split a way at the given node. diff --git a/modules/actions/straighten_way.js b/modules/actions/straighten_way.js index 5bf8c53331..3679041faa 100644 --- a/modules/actions/straighten_way.js +++ b/modules/actions/straighten_way.js @@ -1,7 +1,7 @@ import { vecDot, vecInterp, vecLength } from '@rapid-sdk/math'; import { utilArrayDifference } from '@rapid-sdk/util'; -import { actionDeleteNode } from './delete_node'; +import { actionDeleteNode } from './delete_node.js'; /* diff --git a/modules/actions/unrestrict_turn.js b/modules/actions/unrestrict_turn.js index 8d980f4595..ea799ef7c9 100644 --- a/modules/actions/unrestrict_turn.js +++ b/modules/actions/unrestrict_turn.js @@ -1,4 +1,4 @@ -import { actionDeleteRelation } from './delete_relation'; +import { actionDeleteRelation } from './delete_relation.js'; // `actionUnrestrictTurn` deletes a turn restriction relation. diff --git a/modules/behaviors/DragBehavior.js b/modules/behaviors/DragBehavior.js index 3ce851e677..e0a876d0d5 100644 --- a/modules/behaviors/DragBehavior.js +++ b/modules/behaviors/DragBehavior.js @@ -1,7 +1,7 @@ import { vecLength } from '@rapid-sdk/math'; -import { AbstractBehavior } from './AbstractBehavior'; -import { osmNode } from '../osm'; +import { AbstractBehavior } from './AbstractBehavior.js'; +import { osmNode } from '../osm/node.js'; const NEAR_TOLERANCE = 1; const FAR_TOLERANCE = 4; diff --git a/modules/behaviors/DrawBehavior.js b/modules/behaviors/DrawBehavior.js index 22832f38ba..74498c53cb 100644 --- a/modules/behaviors/DrawBehavior.js +++ b/modules/behaviors/DrawBehavior.js @@ -1,7 +1,7 @@ import { vecLength } from '@rapid-sdk/math'; -import { AbstractBehavior } from './AbstractBehavior'; -// import { geoChooseEdge } from '../geo'; +import { AbstractBehavior } from './AbstractBehavior.js'; +// import { geoChooseEdge } from '../geo/index.js'; const NEAR_TOLERANCE = 4; const FAR_TOLERANCE = 12; diff --git a/modules/behaviors/HoverBehavior.js b/modules/behaviors/HoverBehavior.js index f44ad6ed11..89cddded64 100644 --- a/modules/behaviors/HoverBehavior.js +++ b/modules/behaviors/HoverBehavior.js @@ -1,5 +1,5 @@ -import { AbstractBehavior } from './AbstractBehavior'; -// import { geoChooseEdge } from '../geo'; +import { AbstractBehavior } from './AbstractBehavior.js'; +// import { geoChooseEdge } from '../geo/index.js'; /** diff --git a/modules/behaviors/KeyOperationBehavior.js b/modules/behaviors/KeyOperationBehavior.js index 7daa993a78..58e03bf653 100644 --- a/modules/behaviors/KeyOperationBehavior.js +++ b/modules/behaviors/KeyOperationBehavior.js @@ -1,4 +1,4 @@ -import { AbstractBehavior } from './AbstractBehavior'; +import { AbstractBehavior } from './AbstractBehavior.js'; /** diff --git a/modules/behaviors/LassoBehavior.js b/modules/behaviors/LassoBehavior.js index 4fc9011b54..339b0c9c5c 100644 --- a/modules/behaviors/LassoBehavior.js +++ b/modules/behaviors/LassoBehavior.js @@ -1,7 +1,7 @@ import { Extent, geomPointInPolygon } from '@rapid-sdk/math'; import { utilArrayIntersection } from '@rapid-sdk/util'; -import { AbstractBehavior } from './AbstractBehavior'; +import { AbstractBehavior } from './AbstractBehavior.js'; /** diff --git a/modules/behaviors/MapInteractionBehavior.js b/modules/behaviors/MapInteractionBehavior.js index 3dbe85ae93..39eeaf1d49 100644 --- a/modules/behaviors/MapInteractionBehavior.js +++ b/modules/behaviors/MapInteractionBehavior.js @@ -1,7 +1,7 @@ import { geoZoomToScale, vecLength } from '@rapid-sdk/math'; -import { AbstractBehavior } from './AbstractBehavior'; -import { osmNode } from '../osm'; +import { AbstractBehavior } from './AbstractBehavior.js'; +import { osmNode } from '../osm/node.js'; // constants const TILESIZE = 256; diff --git a/modules/behaviors/MapNudgingBehavior.js b/modules/behaviors/MapNudgingBehavior.js index 8f4118e1d7..e971574002 100644 --- a/modules/behaviors/MapNudgingBehavior.js +++ b/modules/behaviors/MapNudgingBehavior.js @@ -1,5 +1,7 @@ import { geomViewportNudge } from '@rapid-sdk/math'; -import { AbstractBehavior } from './AbstractBehavior'; + +import { AbstractBehavior } from './AbstractBehavior.js'; + // Scalar for how fast we want the map nudging to actually be. // Pixi returns mouse events pretty quickly, diff --git a/modules/behaviors/PasteBehavior.js b/modules/behaviors/PasteBehavior.js index 7040b6626a..b171a4249a 100644 --- a/modules/behaviors/PasteBehavior.js +++ b/modules/behaviors/PasteBehavior.js @@ -1,11 +1,10 @@ import { Extent, vecSubtract } from '@rapid-sdk/math'; -import { AbstractBehavior } from './AbstractBehavior'; -import { actionCopyEntities } from '../actions/copy_entities'; -import { actionMove } from '../actions/move'; -import { utilDetect } from '../util/detect'; +import { AbstractBehavior } from './AbstractBehavior.js'; +import { actionCopyEntities } from '../actions/copy_entities.js'; +import { actionMove } from '../actions/move.js'; +import { utilDetect } from '../util/detect.js'; -const MACOS = (utilDetect().os === 'mac'); /** @@ -21,6 +20,8 @@ export class PasteBehavior extends AbstractBehavior { super(context); this.id = 'paste'; + this._isMacOS = (utilDetect().os === 'mac'); + // Make sure the event handlers have `this` bound correctly this._keydown = this._keydown.bind(this); } @@ -58,7 +59,8 @@ export class PasteBehavior extends AbstractBehavior { * @param `e` A DOM KeyboardEvent */ _keydown(e) { - const modifier = (MACOS && e.metaKey) || (!MACOS && e.ctrlKey); + const isMacOS = this._isMacOS; + const modifier = (isMacOS && e.metaKey) || (!isMacOS && e.ctrlKey); if (modifier && e.key === 'v') { this._doPaste(e); } diff --git a/modules/behaviors/SelectBehavior.js b/modules/behaviors/SelectBehavior.js index ae0d879ecc..975b5a1126 100644 --- a/modules/behaviors/SelectBehavior.js +++ b/modules/behaviors/SelectBehavior.js @@ -1,11 +1,11 @@ import { vecLength } from '@rapid-sdk/math'; -import { AbstractBehavior } from './AbstractBehavior'; -import { osmEntity, osmNote, QAItem } from '../osm'; -import { actionAddMidpoint } from '../actions/add_midpoint'; -import { osmNode } from '../osm/node'; -import { osmWay } from '../osm/way'; -import { geoChooseEdge } from '../geo'; +import { AbstractBehavior } from './AbstractBehavior.js'; +import { osmEntity, osmNote, QAItem } from '../osm/index.js'; +import { actionAddMidpoint } from '../actions/add_midpoint.js'; +import { osmNode } from '../osm/node.js'; +import { osmWay } from '../osm/way.js'; +import { geoChooseEdge } from '../geo/index.js'; const NEAR_TOLERANCE = 4; const FAR_TOLERANCE = 12; diff --git a/modules/behaviors/index.js b/modules/behaviors/index.js index 3001fd1ed4..863d3d69c1 100644 --- a/modules/behaviors/index.js +++ b/modules/behaviors/index.js @@ -1,13 +1,13 @@ -import { AbstractBehavior } from './AbstractBehavior'; -import { DragBehavior } from './DragBehavior'; -import { DrawBehavior } from './DrawBehavior'; -import { HoverBehavior } from './HoverBehavior'; -import { KeyOperationBehavior } from './KeyOperationBehavior'; -import { LassoBehavior } from './LassoBehavior'; -import { MapInteractionBehavior } from './MapInteractionBehavior'; -import { MapNudgingBehavior } from './MapNudgingBehavior'; -import { PasteBehavior } from './PasteBehavior'; -import { SelectBehavior } from './SelectBehavior'; +import { AbstractBehavior } from './AbstractBehavior.js'; +import { DragBehavior } from './DragBehavior.js'; +import { DrawBehavior } from './DrawBehavior.js'; +import { HoverBehavior } from './HoverBehavior.js'; +import { KeyOperationBehavior } from './KeyOperationBehavior.js'; +import { LassoBehavior } from './LassoBehavior.js'; +import { MapInteractionBehavior } from './MapInteractionBehavior.js'; +import { MapNudgingBehavior } from './MapNudgingBehavior.js'; +import { PasteBehavior } from './PasteBehavior.js'; +import { SelectBehavior } from './SelectBehavior.js'; export { AbstractBehavior, diff --git a/modules/core/ColorSystem.js b/modules/core/ColorSystem.js index 64f0eaa852..6923b96a24 100644 --- a/modules/core/ColorSystem.js +++ b/modules/core/ColorSystem.js @@ -1,43 +1,47 @@ -import { AbstractSystem } from './AbstractSystem'; +import { AbstractSystem } from './AbstractSystem.js'; export class ColorSystem extends AbstractSystem { - constructor(context) { - super(context); - this.id = 'colors'; - this.context = context; - this.dependencies = new Set(['dataloader']); - this.autoStart = true; - this._started = false; - this.colorData = null; - - this.getColorScheme = this.getColorScheme.bind(this); + constructor(context) { + super(context); + this.id = 'colors'; + this.context = context; + this.dependencies = new Set(['dataloader']); + this.autoStart = true; + this._started = false; + this.colorData = null; + + this.getColorScheme = this.getColorScheme.bind(this); + } + + + initAsync(){ + for (const id of this.dependencies) { + if (!this.context.systems[id]) { + return Promise.reject(`Cannot init: ${this.id} requires ${id}`); + } } + return Promise.resolve(); + } - initAsync(){ - for (const id of this.dependencies) { - if (!this.context.systems[id]) { - return Promise.reject(`Cannot init: ${this.id} requires ${id}`); - } - } - return Promise.resolve(); - } - startAsync() { - this._started = true; - const context = this.context; - const dataloader = context.systems.dataloader; + startAsync() { + this._started = true; + const context = this.context; + const dataloader = context.systems.dataloader; - dataloader.getDataAsync('colors') - .then((data) => { this.colorData = data; } ); + dataloader.getDataAsync('colors') + .then((data) => { this.colorData = data; } ); - return Promise.resolve(); - } + return Promise.resolve(); + } - resetAsync() { - return Promise.resolve(); - } - getColorScheme() { - return this.colorData; - } -} \ No newline at end of file + resetAsync() { + return Promise.resolve(); + } + + + getColorScheme() { + return this.colorData; + } +} diff --git a/modules/core/DataLoaderSystem.js b/modules/core/DataLoaderSystem.js index 5a941eef19..109c437b8d 100644 --- a/modules/core/DataLoaderSystem.js +++ b/modules/core/DataLoaderSystem.js @@ -1,5 +1,5 @@ -import { AbstractSystem } from './AbstractSystem'; -import { utilFetchResponse } from '../util'; +import { AbstractSystem } from './AbstractSystem.js'; +import { utilFetchResponse } from '../util/index.js'; /** diff --git a/modules/core/EditSystem.js b/modules/core/EditSystem.js index 4054d650a6..74950c2a7d 100644 --- a/modules/core/EditSystem.js +++ b/modules/core/EditSystem.js @@ -1,12 +1,12 @@ import { easeLinear as d3_easeLinear } from 'd3-ease'; import { select as d3_select } from 'd3-selection'; import { utilArrayGroupBy, utilObjectOmit, utilSessionMutex } from '@rapid-sdk/util'; -import debounce from 'lodash-es/debounce'; +import debounce from 'lodash-es/debounce.js'; -import { AbstractSystem } from './AbstractSystem'; -import { Difference, Edit, Graph, Tree } from './lib'; -import { osmEntity } from '../osm/entity'; -import { uiLoading } from '../ui/loading'; +import { AbstractSystem } from './AbstractSystem.js'; +import { Difference, Edit, Graph, Tree } from './lib/index.js'; +import { osmEntity } from '../osm/entity.js'; +import { uiLoading } from '../ui/loading.js'; diff --git a/modules/core/FilterSystem.js b/modules/core/FilterSystem.js index ae483d185d..f89c82a51c 100644 --- a/modules/core/FilterSystem.js +++ b/modules/core/FilterSystem.js @@ -1,7 +1,7 @@ import { utilArrayGroupBy, utilArrayUnion } from '@rapid-sdk/util'; -import { AbstractSystem } from './AbstractSystem'; -import { osmEntity, osmLifecyclePrefixes } from '../osm'; +import { AbstractSystem } from './AbstractSystem.js'; +import { osmEntity, osmLifecyclePrefixes } from '../osm/index.js'; const traffic_roads = { diff --git a/modules/core/ImagerySystem.js b/modules/core/ImagerySystem.js index 3f06ce59ed..888468a86c 100644 --- a/modules/core/ImagerySystem.js +++ b/modules/core/ImagerySystem.js @@ -1,8 +1,8 @@ import { geoMetersToOffset, geoOffsetToMeters } from '@rapid-sdk/math'; import whichPolygon from 'which-polygon'; -import { AbstractSystem } from './AbstractSystem'; -import { ImagerySource, ImagerySourceBing, ImagerySourceCustom, ImagerySourceEsri, ImagerySourceNone } from './lib/ImagerySource'; +import { AbstractSystem } from './AbstractSystem.js'; +import { ImagerySource, ImagerySourceBing, ImagerySourceCustom, ImagerySourceEsri, ImagerySourceNone } from './lib/ImagerySource.js'; /** diff --git a/modules/core/LocalizationSystem.js b/modules/core/LocalizationSystem.js index 83b2ccb54a..e26cb0b623 100644 --- a/modules/core/LocalizationSystem.js +++ b/modules/core/LocalizationSystem.js @@ -1,5 +1,5 @@ -import { AbstractSystem } from './AbstractSystem'; -import { utilDetect } from '../util/detect'; +import { AbstractSystem } from './AbstractSystem.js'; +import { utilDetect } from '../util/detect.js'; function wrap(x, min, max) { diff --git a/modules/core/LocationSystem.js b/modules/core/LocationSystem.js index 13b5092841..cd511f8740 100644 --- a/modules/core/LocationSystem.js +++ b/modules/core/LocationSystem.js @@ -2,7 +2,7 @@ import LocationConflation from '@rapideditor/location-conflation'; import whichPolygon from 'which-polygon'; import calcArea from '@mapbox/geojson-area'; -import { AbstractSystem } from './AbstractSystem'; +import { AbstractSystem } from './AbstractSystem.js'; const LOCO = new LocationConflation(); // shared instance of a location-conflation resolver diff --git a/modules/core/Map3dSystem.js b/modules/core/Map3dSystem.js index dd22645f29..0430296fa3 100644 --- a/modules/core/Map3dSystem.js +++ b/modules/core/Map3dSystem.js @@ -1,6 +1,6 @@ import { select as d3_select } from 'd3-selection'; -import { AbstractSystem } from './AbstractSystem'; +import { AbstractSystem } from './AbstractSystem.js'; const MAPLIBRE_JS = 'https://cdn.jsdelivr.net/npm/maplibre-gl@3/dist/maplibre-gl.min.js'; const MAPLIBRE_CSS = 'https://cdn.jsdelivr.net/npm/maplibre-gl@3/dist/maplibre-gl.min.css'; diff --git a/modules/core/MapSystem.js b/modules/core/MapSystem.js index abdac1c4a2..bd8e6ae51c 100644 --- a/modules/core/MapSystem.js +++ b/modules/core/MapSystem.js @@ -1,11 +1,10 @@ import { select as d3_select } from 'd3-selection'; import { Projection, Extent, geoMetersToLon, geoScaleToZoom, geoZoomToScale, vecAdd, vecScale, vecSubtract } from '@rapid-sdk/math'; -import { AbstractSystem } from './AbstractSystem'; -import { PixiRenderer } from '../pixi/PixiRenderer'; +import { AbstractSystem } from './AbstractSystem.js'; +import { PixiRenderer } from '../pixi/PixiRenderer.js'; import { uiCmd } from '../ui/cmd.js'; -import { utilTotalExtent } from '../util/util'; -import { utilGetDimensions } from '../util/dimensions'; +import { utilGetDimensions, utilTotalExtent } from '../util/index.js'; const TILESIZE = 256; diff --git a/modules/core/PhotoSystem.js b/modules/core/PhotoSystem.js index 7624e975a8..b6eee62f01 100644 --- a/modules/core/PhotoSystem.js +++ b/modules/core/PhotoSystem.js @@ -1,4 +1,4 @@ -import { AbstractSystem } from './AbstractSystem'; +import { AbstractSystem } from './AbstractSystem.js'; /** diff --git a/modules/core/PresetSystem.js b/modules/core/PresetSystem.js index 6e4c74c57f..65bde938aa 100644 --- a/modules/core/PresetSystem.js +++ b/modules/core/PresetSystem.js @@ -1,9 +1,9 @@ import { utilArrayUniq } from '@rapid-sdk/util'; -import { AbstractSystem } from './AbstractSystem'; -import { osmNodeGeometriesForTags, osmSetAreaKeys, osmSetPointTags, osmSetVertexTags } from '../osm/tags'; -import { Category, Collection, Field, Preset } from './lib'; -import { uiFields } from '../ui/fields'; +import { AbstractSystem } from './AbstractSystem.js'; +import { osmNodeGeometriesForTags, osmSetAreaKeys, osmSetPointTags, osmSetVertexTags } from '../osm/tags.js'; +import { Category, Collection, Field, Preset } from './lib/index.js'; +import { uiFields } from '../ui/fields/index.js'; const VERBOSE = true; // warn about v6 preset features we don't support currently const MAXRECENTS = 30; // how many recents to store in localstorage diff --git a/modules/core/RapidSystem.js b/modules/core/RapidSystem.js index 24dd20c283..841bdf2704 100644 --- a/modules/core/RapidSystem.js +++ b/modules/core/RapidSystem.js @@ -1,7 +1,7 @@ import { gpx } from '@tmcw/togeojson'; import { Extent } from '@rapid-sdk/math'; -import { AbstractSystem } from './AbstractSystem'; +import { AbstractSystem } from './AbstractSystem.js'; const RAPID_MAGENTA = '#da26d3'; const RAPID_COLORS = [ diff --git a/modules/core/StorageSystem.js b/modules/core/StorageSystem.js index 549e10c1fb..d3362acd13 100644 --- a/modules/core/StorageSystem.js +++ b/modules/core/StorageSystem.js @@ -1,4 +1,4 @@ -import { AbstractSystem } from './AbstractSystem'; +import { AbstractSystem } from './AbstractSystem.js'; /** * `StorageSystem` is a wrapper around `window.localStorage` diff --git a/modules/core/StyleSystem.js b/modules/core/StyleSystem.js index 21d8c38204..5b3a5b61a1 100644 --- a/modules/core/StyleSystem.js +++ b/modules/core/StyleSystem.js @@ -1,6 +1,7 @@ import * as PIXI from 'pixi.js'; -import { osmPavedTags } from '../osm/tags'; -import { AbstractSystem } from './AbstractSystem'; + +import { AbstractSystem } from './AbstractSystem.js'; +import { osmPavedTags } from '../osm/tags.js'; // // A "style" is a bundle of properties to say how things should look. diff --git a/modules/core/UiSystem.js b/modules/core/UiSystem.js index fb21ef324f..5d5d8e6f89 100644 --- a/modules/core/UiSystem.js +++ b/modules/core/UiSystem.js @@ -1,8 +1,8 @@ import { select as d3_select } from 'd3-selection'; -import { AbstractSystem } from './AbstractSystem'; -import { utilDetect } from '../util/detect'; -import { utilGetDimensions } from '../util/dimensions'; +import { AbstractSystem } from './AbstractSystem.js'; +import { utilDetect } from '../util/detect.js'; +import { utilGetDimensions } from '../util/dimensions.js'; import { uiAccount, uiAttribution, uiContributors, UiDefs, uiEditMenu, @@ -12,11 +12,11 @@ import { uiRapidWhatsNew, uiRapidSplash, uiRestore, uiScale, uiShortcuts, uiSidebar, uiSourceSwitch, uiSpinner, uiStatus, uiTooltip, uiTopToolbar, uiVersion, uiZoom, uiZoomToSelection, uiCmd, -} from '../ui'; +} from '../ui/index.js'; import { uiPaneBackground, uiPaneHelp, uiPaneIssues, uiPaneMapData, uiPanePreferences -} from '../ui/panes'; +} from '../ui/panes/index.js'; /** diff --git a/modules/core/UploaderSystem.js b/modules/core/UploaderSystem.js index 93b7fabe32..5203a0e288 100644 --- a/modules/core/UploaderSystem.js +++ b/modules/core/UploaderSystem.js @@ -1,10 +1,10 @@ import { utilArrayUnion, utilArrayUniq } from '@rapid-sdk/util'; -import { AbstractSystem } from './AbstractSystem'; -import { actionDiscardTags } from '../actions/discard_tags'; -import { actionMergeRemoteChanges } from '../actions/merge_remote_changes'; -import { actionRevert } from '../actions/revert'; -import { Graph } from './lib'; +import { AbstractSystem } from './AbstractSystem.js'; +import { actionDiscardTags } from '../actions/discard_tags.js'; +import { actionMergeRemoteChanges } from '../actions/merge_remote_changes.js'; +import { actionRevert } from '../actions/revert.js'; +import { Graph } from './lib/index.js'; diff --git a/modules/core/UrlHashSystem.js b/modules/core/UrlHashSystem.js index c31246ee94..9e9df45dbc 100644 --- a/modules/core/UrlHashSystem.js +++ b/modules/core/UrlHashSystem.js @@ -1,7 +1,7 @@ import { utilObjectOmit, utilQsString, utilStringQs } from '@rapid-sdk/util'; -import throttle from 'lodash-es/throttle'; +import throttle from 'lodash-es/throttle.js'; -import { AbstractSystem } from './AbstractSystem'; +import { AbstractSystem } from './AbstractSystem.js'; /** diff --git a/modules/core/ValidationSystem.js b/modules/core/ValidationSystem.js index b590c15b84..53d4b076c3 100644 --- a/modules/core/ValidationSystem.js +++ b/modules/core/ValidationSystem.js @@ -2,9 +2,9 @@ import { Extent } from '@rapid-sdk/math'; import { utilArrayChunk, utilArrayGroupBy } from '@rapid-sdk/util'; import RBush from 'rbush'; -import { AbstractSystem } from './AbstractSystem'; -import { Difference } from './lib/Difference'; -import * as Validations from '../validations/index'; +import { AbstractSystem } from './AbstractSystem.js'; +import { Difference } from './lib/Difference.js'; +import * as Validations from '../validations/index.js'; const RETRY = 5000; // wait 5 sec before revalidating provisional entities diff --git a/modules/core/index.js b/modules/core/index.js index 7cac45b552..dff1eaea09 100644 --- a/modules/core/index.js +++ b/modules/core/index.js @@ -1,24 +1,24 @@ -export * from './lib/index'; +export * from './lib/index.js'; -import { AbstractSystem } from './AbstractSystem'; -import { ColorSystem } from './ColorSystem'; -import { DataLoaderSystem } from './DataLoaderSystem'; -import { EditSystem } from './EditSystem'; -import { FilterSystem } from './FilterSystem'; -import { ImagerySystem } from './ImagerySystem'; -import { LocalizationSystem } from './LocalizationSystem'; -import { LocationSystem } from './LocationSystem'; -import { Map3dSystem } from './Map3dSystem'; -import { MapSystem } from './MapSystem'; -import { PhotoSystem } from './PhotoSystem'; -import { PresetSystem } from './PresetSystem'; -import { RapidSystem } from './RapidSystem'; -import { StorageSystem } from './StorageSystem'; -import { StyleSystem } from './StyleSystem'; -import { UiSystem } from './UiSystem'; -import { UploaderSystem } from './UploaderSystem'; -import { UrlHashSystem } from './UrlHashSystem'; -import { ValidationSystem } from './ValidationSystem'; +import { AbstractSystem } from './AbstractSystem.js'; +import { ColorSystem } from './ColorSystem.js'; +import { DataLoaderSystem } from './DataLoaderSystem.js'; +import { EditSystem } from './EditSystem.js'; +import { FilterSystem } from './FilterSystem.js'; +import { ImagerySystem } from './ImagerySystem.js'; +import { LocalizationSystem } from './LocalizationSystem.js'; +import { LocationSystem } from './LocationSystem.js'; +import { Map3dSystem } from './Map3dSystem.js'; +import { MapSystem } from './MapSystem.js'; +import { PhotoSystem } from './PhotoSystem.js'; +import { PresetSystem } from './PresetSystem.js'; +import { RapidSystem } from './RapidSystem.js'; +import { StorageSystem } from './StorageSystem.js'; +import { StyleSystem } from './StyleSystem.js'; +import { UiSystem } from './UiSystem.js'; +import { UploaderSystem } from './UploaderSystem.js'; +import { UrlHashSystem } from './UrlHashSystem.js'; +import { ValidationSystem } from './ValidationSystem.js'; export { AbstractSystem, diff --git a/modules/core/lib/Category.js b/modules/core/lib/Category.js index f6b0f677e4..847af6d98f 100644 --- a/modules/core/lib/Category.js +++ b/modules/core/lib/Category.js @@ -1,6 +1,6 @@ import { utilObjectOmit, utilSafeString } from '@rapid-sdk/util'; -import { Collection } from './Collection'; +import { Collection } from './Collection.js'; /** diff --git a/modules/core/lib/ImagerySource.js b/modules/core/lib/ImagerySource.js index 61b9d010d9..2ead382b71 100644 --- a/modules/core/lib/ImagerySource.js +++ b/modules/core/lib/ImagerySource.js @@ -2,7 +2,7 @@ import { geoArea as d3_geoArea, geoMercatorRaw as d3_geoMercatorRaw } from 'd3-g import { utilAesDecrypt, utilQsString, utilStringQs } from '@rapid-sdk/util'; import { geoSphericalDistance } from '@rapid-sdk/math'; -import { utilFetchResponse } from '../../util'; +import { utilFetchResponse } from '../../util/index.js'; /** diff --git a/modules/core/lib/Preset.js b/modules/core/lib/Preset.js index 900dbd91ee..674fd65138 100644 --- a/modules/core/lib/Preset.js +++ b/modules/core/lib/Preset.js @@ -1,6 +1,6 @@ import { utilArrayUniq, utilObjectOmit, utilSafeString } from '@rapid-sdk/util'; -import { osmAreaKeys } from '../../osm/tags'; +import { osmAreaKeys } from '../../osm/tags.js'; /** diff --git a/modules/core/lib/Tree.js b/modules/core/lib/Tree.js index 841f76c69d..184706ea3b 100644 --- a/modules/core/lib/Tree.js +++ b/modules/core/lib/Tree.js @@ -1,5 +1,6 @@ import RBush from 'rbush'; -import { Difference } from './Difference'; + +import { Difference } from './Difference.js'; /** diff --git a/modules/core/lib/ValidationIssue.js b/modules/core/lib/ValidationIssue.js index 9aab7b9f77..25c5df3828 100644 --- a/modules/core/lib/ValidationIssue.js +++ b/modules/core/lib/ValidationIssue.js @@ -1,7 +1,7 @@ import { Extent } from '@rapid-sdk/math'; -import { ValidationFix } from './ValidationFix'; -import { utilTotalExtent } from '../../util'; +import { ValidationFix } from './ValidationFix.js'; +import { utilTotalExtent } from '../../util/index.js'; export class ValidationIssue { diff --git a/modules/core/lib/index.js b/modules/core/lib/index.js index 892075058b..ba969162cc 100644 --- a/modules/core/lib/index.js +++ b/modules/core/lib/index.js @@ -1,7 +1,7 @@ -export { Category } from './Category'; -export { Collection } from './Collection'; -export { Difference } from './Difference'; -export { Edit } from './Edit'; +export { Category } from './Category.js'; +export { Collection } from './Collection.js'; +export { Difference } from './Difference.js'; +export { Edit } from './Edit.js'; export { ImagerySource, @@ -9,11 +9,11 @@ export { ImagerySourceCustom, ImagerySourceEsri, ImagerySourceNone -} from './ImagerySource'; +} from './ImagerySource.js'; -export { Field } from './Field'; -export { Graph } from './Graph'; -export { Preset } from './Preset'; -export { Tree } from './Tree'; -export { ValidationFix } from './ValidationFix'; -export { ValidationIssue } from './ValidationIssue'; +export { Field } from './Field.js'; +export { Graph } from './Graph.js'; +export { Preset } from './Preset.js'; +export { Tree } from './Tree.js'; +export { ValidationFix } from './ValidationFix.js'; +export { ValidationIssue } from './ValidationIssue.js'; diff --git a/modules/index.js b/modules/index.js index 5d3b114195..93f82de7b7 100644 --- a/modules/index.js +++ b/modules/index.js @@ -1,22 +1,22 @@ -export * from './actions/index'; -export * from './behaviors/index'; -export * from './core/index'; -export * from './geo/index'; -export * from './modes/index'; -export * from './operations/index'; -export * from './osm/index'; -export * from './services/index'; -export * from './svg/index'; -export * from './ui/fields/index'; -export * from './ui/panels/index'; -export * from './ui/panes/index'; -export * from './ui/sections/index'; -export * from './ui/settings/index'; -export * from './ui/index'; -export * from './util/index'; -export * from './validations/index'; +export * from './actions/index.js'; +export * from './behaviors/index.js'; +export * from './core/index.js'; +export * from './geo/index.js'; +export * from './modes/index.js'; +export * from './operations/index.js'; +export * from './osm/index.js'; +export * from './services/index.js'; +export * from './svg/index.js'; +export * from './ui/fields/index.js'; +export * from './ui/panels/index.js'; +export * from './ui/panes/index.js'; +export * from './ui/sections/index.js'; +export * from './ui/settings/index.js'; +export * from './ui/index.js'; +export * from './util/index.js'; +export * from './validations/index.js'; -export { Context } from './Context'; +export { Context } from './Context.js'; // Reexport only what our tests use, see iD#4379 import * as D3 from 'd3'; diff --git a/modules/main.js b/modules/main.js index 3ee164142d..59b40e175f 100644 --- a/modules/main.js +++ b/modules/main.js @@ -16,6 +16,6 @@ window.cancelIdleCallback = window.cancelIdleCallback || window.cancelAnimationFrame(handle); }; -import * as __all__ from './index'; +import * as __all__ from './index.js'; window.Rapid = __all__; window.iD = __all__; diff --git a/modules/modes/AddNoteMode.js b/modules/modes/AddNoteMode.js index e504e1ac3c..a3bdaf347f 100644 --- a/modules/modes/AddNoteMode.js +++ b/modules/modes/AddNoteMode.js @@ -1,5 +1,5 @@ -import { AbstractMode } from './AbstractMode'; -import { osmNote } from '../osm/note'; +import { AbstractMode } from './AbstractMode.js'; +import { osmNote } from '../osm/note.js'; const DEBUG = false; diff --git a/modules/modes/AddPointMode.js b/modules/modes/AddPointMode.js index 54ffd6f273..269a2ac48c 100644 --- a/modules/modes/AddPointMode.js +++ b/modules/modes/AddPointMode.js @@ -1,10 +1,10 @@ -import { AbstractMode } from './AbstractMode'; +import { AbstractMode } from './AbstractMode.js'; -import { actionAddEntity } from '../actions/add_entity'; -import { actionChangeTags } from '../actions/change_tags'; -import { actionAddMidpoint } from '../actions/add_midpoint'; -import { geoChooseEdge } from '../geo'; -import { osmNode } from '../osm/node'; +import { actionAddEntity } from '../actions/add_entity.js'; +import { actionChangeTags } from '../actions/change_tags.js'; +import { actionAddMidpoint } from '../actions/add_midpoint.js'; +import { geoChooseEdge } from '../geo/index.js'; +import { osmNode } from '../osm/node.js'; const DEBUG = false; diff --git a/modules/modes/BrowseMode.js b/modules/modes/BrowseMode.js index 1dd89bf205..698bd5f06f 100644 --- a/modules/modes/BrowseMode.js +++ b/modules/modes/BrowseMode.js @@ -1,5 +1,5 @@ -import { AbstractMode } from './AbstractMode'; -import { operationPaste } from '../operations/paste'; +import { AbstractMode } from './AbstractMode.js'; +import { operationPaste } from '../operations/paste.js'; const DEBUG = false; diff --git a/modules/modes/DragNodeMode.js b/modules/modes/DragNodeMode.js index c08bb555e7..a275aef7a1 100644 --- a/modules/modes/DragNodeMode.js +++ b/modules/modes/DragNodeMode.js @@ -1,12 +1,12 @@ import { vecAdd, vecSubtract } from '@rapid-sdk/math'; import { utilArrayIntersection } from '@rapid-sdk/util'; -import { AbstractMode } from './AbstractMode'; -import { actionAddMidpoint } from '../actions/add_midpoint'; -import { actionConnect } from '../actions/connect'; -import { actionMoveNode } from '../actions/move_node'; -import { geoChooseEdge } from '../geo'; -import { osmNode } from '../osm'; +import { AbstractMode } from './AbstractMode.js'; +import { actionAddMidpoint } from '../actions/add_midpoint.js'; +import { actionConnect } from '../actions/connect.js'; +import { actionMoveNode } from '../actions/move_node.js'; +import { geoChooseEdge } from '../geo/index.js'; +import { osmNode } from '../osm/node.js'; diff --git a/modules/modes/DrawAreaMode.js b/modules/modes/DrawAreaMode.js index 90bb32dc7b..fd382573b1 100644 --- a/modules/modes/DrawAreaMode.js +++ b/modules/modes/DrawAreaMode.js @@ -1,12 +1,12 @@ import { vecEqual, vecLength } from '@rapid-sdk/math'; -import { AbstractMode } from './AbstractMode'; -import { actionAddEntity } from '../actions/add_entity'; -import { actionAddMidpoint } from '../actions/add_midpoint'; -import { actionAddVertex } from '../actions/add_vertex'; -import { actionMoveNode } from '../actions/move_node'; -import { geoChooseEdge } from '../geo'; -import { osmNode, osmWay } from '../osm'; +import { AbstractMode } from './AbstractMode.js'; +import { actionAddEntity } from '../actions/add_entity.js'; +import { actionAddMidpoint } from '../actions/add_midpoint.js'; +import { actionAddVertex } from '../actions/add_vertex.js'; +import { actionMoveNode } from '../actions/move_node.js'; +import { geoChooseEdge } from '../geo/index.js'; +import { osmNode, osmWay } from '../osm/index.js'; const DEBUG = false; diff --git a/modules/modes/DrawLineMode.js b/modules/modes/DrawLineMode.js index ae4ba6b7b4..a20bec43d9 100644 --- a/modules/modes/DrawLineMode.js +++ b/modules/modes/DrawLineMode.js @@ -1,14 +1,15 @@ import { vecEqual, vecLength } from '@rapid-sdk/math'; -import { AbstractMode } from './AbstractMode'; -import { actionAddEntity } from '../actions/add_entity'; -import { actionAddMidpoint } from '../actions/add_midpoint'; -import { actionAddVertex } from '../actions/add_vertex'; -import { actionMoveNode } from '../actions/move_node'; -import { geoChooseEdge } from '../geo'; -import { osmNode, osmWay } from '../osm'; +import { AbstractMode } from './AbstractMode.js'; +import { actionAddEntity } from '../actions/add_entity.js'; +import { actionAddMidpoint } from '../actions/add_midpoint.js'; +import { actionAddVertex } from '../actions/add_vertex.js'; +import { actionMoveNode } from '../actions/move_node.js'; +import { geoChooseEdge } from '../geo/index.js'; +import { osmNode, osmWay } from '../osm/index.js'; const DEBUG = false; + /** * `DrawLineMode` * In this mode, we are drawing a new line or continuing an existing line. diff --git a/modules/modes/MoveMode.js b/modules/modes/MoveMode.js index b18ed90665..7c25868d7d 100644 --- a/modules/modes/MoveMode.js +++ b/modules/modes/MoveMode.js @@ -1,7 +1,7 @@ import { vecSubtract } from '@rapid-sdk/math'; -import { AbstractMode } from './AbstractMode'; -import { actionMove } from '../actions/move'; +import { AbstractMode } from './AbstractMode.js'; +import { actionMove } from '../actions/move.js'; /** diff --git a/modules/modes/RotateMode.js b/modules/modes/RotateMode.js index ecbb70544d..02ca22499e 100644 --- a/modules/modes/RotateMode.js +++ b/modules/modes/RotateMode.js @@ -2,8 +2,8 @@ import { polygonHull as d3_polygonHull, polygonCentroid as d3_polygonCentroid } import { vecInterp, vecSubtract } from '@rapid-sdk/math'; import { utilGetAllNodes } from '@rapid-sdk/util'; -import { AbstractMode } from './AbstractMode'; -import { actionRotate } from '../actions/rotate'; +import { AbstractMode } from './AbstractMode.js'; +import { actionRotate } from '../actions/rotate.js'; /** diff --git a/modules/modes/SaveMode.js b/modules/modes/SaveMode.js index 1d373af96d..7bd9ba55c4 100644 --- a/modules/modes/SaveMode.js +++ b/modules/modes/SaveMode.js @@ -1,12 +1,12 @@ import { select as d3_select } from 'd3-selection'; -import { AbstractMode } from './AbstractMode'; -import { uiCommit } from '../ui/commit'; -import { uiConfirm } from '../ui/confirm'; -import { uiConflicts } from '../ui/conflicts'; -import { uiLoading } from '../ui/loading'; -import { uiSuccess } from '../ui/success'; -import { utilKeybinding } from '../util'; +import { AbstractMode } from './AbstractMode.js'; +import { uiCommit } from '../ui/commit.js'; +import { uiConfirm } from '../ui/confirm.js'; +import { uiConflicts } from '../ui/conflicts.js'; +import { uiLoading } from '../ui/loading.js'; +import { uiSuccess } from '../ui/success.js'; +import { utilKeybinding } from '../util/index.js'; const DEBUG = false; diff --git a/modules/modes/SelectMode.js b/modules/modes/SelectMode.js index 745dd663dc..052e9daac0 100644 --- a/modules/modes/SelectMode.js +++ b/modules/modes/SelectMode.js @@ -2,15 +2,15 @@ import { select as d3_select } from 'd3-selection'; import { geoBounds as d3_geoBounds } from 'd3-geo'; import { Extent } from '@rapid-sdk/math'; -import { AbstractMode } from './AbstractMode'; -import { osmNote, QAItem } from '../osm'; -import { uiDataEditor } from '../ui/data_editor'; -import { uiImproveOsmEditor } from '../ui/improveOSM_editor'; -import { uiKeepRightEditor } from '../ui/keepRight_editor'; -import { uiNoteEditor } from '../ui/note_editor'; -import { uiOsmoseEditor } from '../ui/osmose_editor'; -import { uiRapidFeatureInspector } from '../ui/rapid_feature_inspector'; -import { utilKeybinding } from '../util'; +import { AbstractMode } from './AbstractMode.js'; +import { osmNote, QAItem } from '../osm/index.js'; +import { uiDataEditor } from '../ui/data_editor.js'; +import { uiImproveOsmEditor } from '../ui/improveOSM_editor.js'; +import { uiKeepRightEditor } from '../ui/keepRight_editor.js'; +import { uiNoteEditor } from '../ui/note_editor.js'; +import { uiOsmoseEditor } from '../ui/osmose_editor.js'; +import { uiRapidFeatureInspector } from '../ui/rapid_feature_inspector.js'; +import { utilKeybinding } from '../util/index.js'; const DEBUG = false; diff --git a/modules/modes/SelectOsmMode.js b/modules/modes/SelectOsmMode.js index f0d1348004..ea1bbe7d55 100644 --- a/modules/modes/SelectOsmMode.js +++ b/modules/modes/SelectOsmMode.js @@ -1,10 +1,10 @@ import { select as d3_select } from 'd3-selection'; -import { AbstractMode } from './AbstractMode'; -import { actionDeleteRelation } from '../actions/delete_relation'; -import * as Operations from '../operations/index'; -import { uiCmd } from '../ui/cmd'; -import { utilKeybinding, utilTotalExtent } from '../util'; +import { AbstractMode } from './AbstractMode.js'; +import { actionDeleteRelation } from '../actions/delete_relation.js'; +import * as Operations from '../operations/index.js'; +import { uiCmd } from '../ui/cmd.js'; +import { utilKeybinding, utilTotalExtent } from '../util/index.js'; /** diff --git a/modules/modes/index.js b/modules/modes/index.js index df0cc0b7bb..f6288a0455 100644 --- a/modules/modes/index.js +++ b/modules/modes/index.js @@ -1,15 +1,15 @@ -import { AbstractMode } from './AbstractMode'; -import { AddNoteMode } from './AddNoteMode'; -import { AddPointMode } from './AddPointMode'; -import { BrowseMode } from './BrowseMode'; -import { DragNodeMode } from './DragNodeMode'; -import { DrawAreaMode } from './DrawAreaMode'; -import { DrawLineMode } from './DrawLineMode'; -import { MoveMode } from './MoveMode'; -import { RotateMode } from './RotateMode'; -import { SaveMode } from './SaveMode'; -import { SelectMode } from './SelectMode'; -import { SelectOsmMode } from './SelectOsmMode'; +import { AbstractMode } from './AbstractMode.js'; +import { AddNoteMode } from './AddNoteMode.js'; +import { AddPointMode } from './AddPointMode.js'; +import { BrowseMode } from './BrowseMode.js'; +import { DragNodeMode } from './DragNodeMode.js'; +import { DrawAreaMode } from './DrawAreaMode.js'; +import { DrawLineMode } from './DrawLineMode.js'; +import { MoveMode } from './MoveMode.js'; +import { RotateMode } from './RotateMode.js'; +import { SaveMode } from './SaveMode.js'; +import { SelectMode } from './SelectMode.js'; +import { SelectOsmMode } from './SelectOsmMode.js'; export { AbstractMode, @@ -27,7 +27,7 @@ export { }; // legacy -export { modeDragNote } from './drag_note'; +export { modeDragNote } from './drag_note.js'; // At init time, we will instantiate any that are in the 'available' collection. export const modes = { diff --git a/modules/operations/circularize.js b/modules/operations/circularize.js index f80211f396..c4e9514fdb 100644 --- a/modules/operations/circularize.js +++ b/modules/operations/circularize.js @@ -1,8 +1,8 @@ import { utilGetAllNodes } from '@rapid-sdk/util'; -import { actionCircularize } from '../actions/circularize'; -import { KeyOperationBehavior } from '../behaviors/KeyOperationBehavior'; -import { utilTotalExtent } from '../util'; +import { actionCircularize } from '../actions/circularize.js'; +import { KeyOperationBehavior } from '../behaviors/KeyOperationBehavior.js'; +import { utilTotalExtent } from '../util/index.js'; export function operationCircularize(context, selectedIDs) { diff --git a/modules/operations/continue.js b/modules/operations/continue.js index 70aa3a6419..998ee57443 100644 --- a/modules/operations/continue.js +++ b/modules/operations/continue.js @@ -1,6 +1,6 @@ import { utilArrayGroupBy } from '@rapid-sdk/util'; -import { KeyOperationBehavior } from '../behaviors/KeyOperationBehavior'; +import { KeyOperationBehavior } from '../behaviors/KeyOperationBehavior.js'; export function operationContinue(context, selectedIDs) { diff --git a/modules/operations/copy.js b/modules/operations/copy.js index 7a362c0924..e30f3d4dfb 100644 --- a/modules/operations/copy.js +++ b/modules/operations/copy.js @@ -1,8 +1,8 @@ import { utilArrayGroupBy } from '@rapid-sdk/util'; -import { KeyOperationBehavior } from '../behaviors/KeyOperationBehavior'; -import { uiCmd } from '../ui/cmd'; -import { utilTotalExtent } from '../util'; +import { KeyOperationBehavior } from '../behaviors/KeyOperationBehavior.js'; +import { uiCmd } from '../ui/cmd.js'; +import { utilTotalExtent } from '../util/index.js'; export function operationCopy(context, selectedIDs) { diff --git a/modules/operations/cycle_highway_tag.js b/modules/operations/cycle_highway_tag.js index a4a2138cca..2112e7ec62 100644 --- a/modules/operations/cycle_highway_tag.js +++ b/modules/operations/cycle_highway_tag.js @@ -1,7 +1,7 @@ import { utilArrayIdentical } from '@rapid-sdk/util'; -import { actionChangePreset } from '../actions'; -import { KeyOperationBehavior } from '../behaviors/KeyOperationBehavior'; +import { actionChangePreset } from '../actions/change_preset.js'; +import { KeyOperationBehavior } from '../behaviors/KeyOperationBehavior.js'; let _lastSelectedIDs = []; diff --git a/modules/operations/delete.js b/modules/operations/delete.js index ea21ea571e..2baad0599c 100644 --- a/modules/operations/delete.js +++ b/modules/operations/delete.js @@ -1,10 +1,10 @@ import { geoSphericalDistance } from '@rapid-sdk/math'; import { utilGetAllNodes } from '@rapid-sdk/util'; -import { actionDeleteMultiple } from '../actions/delete_multiple'; -import { KeyOperationBehavior } from '../behaviors/KeyOperationBehavior'; -import { uiCmd } from '../ui/cmd'; -import { utilTotalExtent } from '../util'; +import { actionDeleteMultiple } from '../actions/delete_multiple.js'; +import { KeyOperationBehavior } from '../behaviors/KeyOperationBehavior.js'; +import { uiCmd } from '../ui/cmd.js'; +import { utilTotalExtent } from '../util/index.js'; export function operationDelete(context, selectedIDs) { diff --git a/modules/operations/disconnect.js b/modules/operations/disconnect.js index 7ce126f841..0d39a9e955 100644 --- a/modules/operations/disconnect.js +++ b/modules/operations/disconnect.js @@ -1,8 +1,8 @@ import { utilArrayUniq, utilGetAllNodes } from '@rapid-sdk/util'; -import { actionDisconnect } from '../actions/disconnect'; -import { KeyOperationBehavior } from '../behaviors/KeyOperationBehavior'; -import { utilTotalExtent } from '../util/util'; +import { actionDisconnect } from '../actions/disconnect.js'; +import { KeyOperationBehavior } from '../behaviors/KeyOperationBehavior.js'; +import { utilTotalExtent } from '../util/index.js'; export function operationDisconnect(context, selectedIDs) { diff --git a/modules/operations/downgrade.js b/modules/operations/downgrade.js index ba3520192f..187ff4078f 100644 --- a/modules/operations/downgrade.js +++ b/modules/operations/downgrade.js @@ -1,6 +1,6 @@ -import { actionChangeTags } from '../actions/change_tags'; -import { KeyOperationBehavior } from '../behaviors/KeyOperationBehavior'; -import { uiCmd } from '../ui/cmd'; +import { actionChangeTags } from '../actions/change_tags.js'; +import { KeyOperationBehavior } from '../behaviors/KeyOperationBehavior.js'; +import { uiCmd } from '../ui/cmd.js'; export function operationDowngrade(context, selectedIDs) { diff --git a/modules/operations/extract.js b/modules/operations/extract.js index a0de61c286..ede4eeea5d 100644 --- a/modules/operations/extract.js +++ b/modules/operations/extract.js @@ -1,8 +1,8 @@ import { utilArrayUniq } from '@rapid-sdk/util'; -import { actionExtract } from '../actions/extract'; -import { KeyOperationBehavior } from '../behaviors/KeyOperationBehavior'; -import { utilTotalExtent } from '../util'; +import { actionExtract } from '../actions/extract.js'; +import { KeyOperationBehavior } from '../behaviors/KeyOperationBehavior.js'; +import { utilTotalExtent } from '../util/index.js'; export function operationExtract(context, selectedIDs) { diff --git a/modules/operations/index.js b/modules/operations/index.js index dd239116a1..16bd1beb5e 100644 --- a/modules/operations/index.js +++ b/modules/operations/index.js @@ -1,17 +1,17 @@ -export { operationCircularize } from './circularize'; -export { operationContinue } from './continue'; -export { operationCycleHighwayTag } from './cycle_highway_tag'; -export { operationCopy } from './copy'; -export { operationDelete } from './delete'; -export { operationDisconnect } from './disconnect'; -export { operationDowngrade } from './downgrade'; -export { operationExtract } from './extract'; -export { operationMerge } from './merge'; -export { operationMove } from './move'; -export { operationOrthogonalize } from './orthogonalize'; -export { operationPaste } from './paste'; -export { operationReflectShort, operationReflectLong } from './reflect'; -export { operationReverse } from './reverse'; -export { operationRotate } from './rotate'; -export { operationSplit } from './split'; -export { operationStraighten } from './straighten'; +export { operationCircularize } from './circularize.js'; +export { operationContinue } from './continue.js'; +export { operationCycleHighwayTag } from './cycle_highway_tag.js'; +export { operationCopy } from './copy.js'; +export { operationDelete } from './delete.js'; +export { operationDisconnect } from './disconnect.js'; +export { operationDowngrade } from './downgrade.js'; +export { operationExtract } from './extract.js'; +export { operationMerge } from './merge.js'; +export { operationMove } from './move.js'; +export { operationOrthogonalize } from './orthogonalize.js'; +export { operationPaste } from './paste.js'; +export { operationReflectShort, operationReflectLong } from './reflect.js'; +export { operationReverse } from './reverse.js'; +export { operationRotate } from './rotate.js'; +export { operationSplit } from './split.js'; +export { operationStraighten } from './straighten.js'; diff --git a/modules/operations/merge.js b/modules/operations/merge.js index 5e7a7a7515..fd00e7662d 100644 --- a/modules/operations/merge.js +++ b/modules/operations/merge.js @@ -1,9 +1,9 @@ -import { actionJoin } from '../actions/join'; -import { actionMerge } from '../actions/merge'; -import { actionMergeNodes } from '../actions/merge_nodes'; -import { actionMergePolygon } from '../actions/merge_polygon'; +import { actionJoin } from '../actions/join.js'; +import { actionMerge } from '../actions/merge.js'; +import { actionMergeNodes } from '../actions/merge_nodes.js'; +import { actionMergePolygon } from '../actions/merge_polygon.js'; -import { KeyOperationBehavior } from '../behaviors/KeyOperationBehavior'; +import { KeyOperationBehavior } from '../behaviors/KeyOperationBehavior.js'; export function operationMerge(context, selectedIDs) { diff --git a/modules/operations/move.js b/modules/operations/move.js index 80dc80b7f8..a843da2640 100644 --- a/modules/operations/move.js +++ b/modules/operations/move.js @@ -1,7 +1,7 @@ import { utilGetAllNodes } from '@rapid-sdk/util'; -import { KeyOperationBehavior } from '../behaviors/KeyOperationBehavior'; -import { utilTotalExtent } from '../util/util'; +import { KeyOperationBehavior } from '../behaviors/KeyOperationBehavior.js'; +import { utilTotalExtent } from '../util/util.js'; export function operationMove(context, selectedIDs) { diff --git a/modules/operations/orthogonalize.js b/modules/operations/orthogonalize.js index 673419f6c2..928e96a771 100644 --- a/modules/operations/orthogonalize.js +++ b/modules/operations/orthogonalize.js @@ -1,8 +1,8 @@ import { utilGetAllNodes } from '@rapid-sdk/util'; -import { actionOrthogonalize } from '../actions/orthogonalize'; -import { KeyOperationBehavior } from '../behaviors/KeyOperationBehavior'; -import { utilTotalExtent } from '../util'; +import { actionOrthogonalize } from '../actions/orthogonalize.js'; +import { KeyOperationBehavior } from '../behaviors/KeyOperationBehavior.js'; +import { utilTotalExtent } from '../util/index.js'; export function operationOrthogonalize(context, selectedIDs) { diff --git a/modules/operations/paste.js b/modules/operations/paste.js index 71b5874e94..1d2e541403 100644 --- a/modules/operations/paste.js +++ b/modules/operations/paste.js @@ -1,9 +1,9 @@ import { Extent, vecSubtract } from '@rapid-sdk/math'; -import { actionCopyEntities } from '../actions/copy_entities'; -import { actionMove } from '../actions/move'; +import { actionCopyEntities } from '../actions/copy_entities.js'; +import { actionMove } from '../actions/move.js'; -import { uiCmd } from '../ui/cmd'; +import { uiCmd } from '../ui/cmd.js'; // see also `PasteBehavior` diff --git a/modules/operations/reflect.js b/modules/operations/reflect.js index 733dbb0b01..f202cd60e8 100644 --- a/modules/operations/reflect.js +++ b/modules/operations/reflect.js @@ -1,8 +1,8 @@ import { utilGetAllNodes } from '@rapid-sdk/util'; -import { actionReflect } from '../actions/reflect'; -import { KeyOperationBehavior } from '../behaviors/KeyOperationBehavior'; -import { utilTotalExtent } from '../util/util'; +import { actionReflect } from '../actions/reflect.js'; +import { KeyOperationBehavior } from '../behaviors/KeyOperationBehavior.js'; +import { utilTotalExtent } from '../util/util.js'; export function operationReflectShort(context, selectedIDs) { diff --git a/modules/operations/reverse.js b/modules/operations/reverse.js index 6d0a22183d..f4d0983ae5 100644 --- a/modules/operations/reverse.js +++ b/modules/operations/reverse.js @@ -1,5 +1,5 @@ -import { actionReverse } from '../actions/reverse'; -import { KeyOperationBehavior } from '../behaviors/KeyOperationBehavior'; +import { actionReverse } from '../actions/reverse.js'; +import { KeyOperationBehavior } from '../behaviors/KeyOperationBehavior.js'; export function operationReverse(context, selectedIDs) { diff --git a/modules/operations/rotate.js b/modules/operations/rotate.js index 777034c2fe..2fa5cc06de 100644 --- a/modules/operations/rotate.js +++ b/modules/operations/rotate.js @@ -1,7 +1,7 @@ import { utilGetAllNodes } from '@rapid-sdk/util'; -import { KeyOperationBehavior } from '../behaviors/KeyOperationBehavior'; -import { utilTotalExtent } from '../util/util'; +import { KeyOperationBehavior } from '../behaviors/KeyOperationBehavior.js'; +import { utilTotalExtent } from '../util/util.js'; export function operationRotate(context, selectedIDs) { diff --git a/modules/operations/split.js b/modules/operations/split.js index b4957ae1d1..b1c9264ab8 100644 --- a/modules/operations/split.js +++ b/modules/operations/split.js @@ -1,5 +1,5 @@ -import { actionSplit } from '../actions/split'; -import { KeyOperationBehavior } from '../behaviors/KeyOperationBehavior'; +import { actionSplit } from '../actions/split.js'; +import { KeyOperationBehavior } from '../behaviors/KeyOperationBehavior.js'; export function operationSplit(context, selectedIDs) { diff --git a/modules/operations/straighten.js b/modules/operations/straighten.js index f1950a43af..08893dbaf9 100644 --- a/modules/operations/straighten.js +++ b/modules/operations/straighten.js @@ -1,9 +1,9 @@ import { utilArrayDifference, utilGetAllNodes } from '@rapid-sdk/util'; -import { actionStraightenNodes } from '../actions/straighten_nodes'; -import { actionStraightenWay } from '../actions/straighten_way'; -import { KeyOperationBehavior } from '../behaviors/KeyOperationBehavior'; -import { utilTotalExtent } from '../util/index'; +import { actionStraightenNodes } from '../actions/straighten_nodes.js'; +import { actionStraightenWay } from '../actions/straighten_way.js'; +import { KeyOperationBehavior } from '../behaviors/KeyOperationBehavior.js'; +import { utilTotalExtent } from '../util/index.js'; export function operationStraighten(context, selectedIDs) { diff --git a/modules/osm/changeset.js b/modules/osm/changeset.js index 705e93bfc3..1e2f89a84d 100644 --- a/modules/osm/changeset.js +++ b/modules/osm/changeset.js @@ -1,6 +1,6 @@ import { Extent } from '@rapid-sdk/math'; -import { osmEntity } from './entity'; +import { osmEntity } from './entity.js'; export function osmChangeset() { diff --git a/modules/osm/entity.js b/modules/osm/entity.js index e2b9036a1f..3065959da3 100644 --- a/modules/osm/entity.js +++ b/modules/osm/entity.js @@ -1,6 +1,6 @@ import { utilArrayUnion, utilUnicodeCharsTruncated } from '@rapid-sdk/util'; -import { osmIsInterestingTag } from './tags'; +import { osmIsInterestingTag } from './tags.js'; let _nextv = 0; diff --git a/modules/osm/index.js b/modules/osm/index.js index 755b7d91cf..86c21eeb4e 100644 --- a/modules/osm/index.js +++ b/modules/osm/index.js @@ -1,27 +1,27 @@ -export { osmChangeset } from './changeset'; -export { osmEntity } from './entity'; -export { osmNode } from './node'; -export { osmNote } from './note'; -export { osmRelation } from './relation'; -export { osmWay } from './way'; -export { QAItem } from './qa_item'; +export { osmChangeset } from './changeset.js'; +export { osmEntity } from './entity.js'; +export { osmNode } from './node.js'; +export { osmNote } from './note.js'; +export { osmRelation } from './relation.js'; +export { osmWay } from './way.js'; +export { QAItem } from './qa_item.js'; export { osmIntersection, osmTurn, osmInferRestriction -} from './intersection'; +} from './intersection.js'; export { osmLanes -} from './lanes'; +} from './lanes.js'; export { osmOldMultipolygonOuterMemberOfRelation, osmIsOldMultipolygonOuterMember, osmOldMultipolygonOuterMember, osmJoinWays -} from './multipolygon'; +} from './multipolygon.js'; export { osmAreaKeys, @@ -40,4 +40,4 @@ export { osmRoutableHighwayTagValues, osmFlowingWaterwayTagValues, osmRailwayTrackTagValues -} from './tags'; +} from './tags.js'; diff --git a/modules/osm/intersection.js b/modules/osm/intersection.js index 61c9fb9aa3..4144bfccae 100644 --- a/modules/osm/intersection.js +++ b/modules/osm/intersection.js @@ -1,11 +1,11 @@ import { geoSphericalDistance, vecAngle } from '@rapid-sdk/math'; import { utilArrayDifference, utilArrayUniq } from '@rapid-sdk/util'; -import { actionDeleteRelation } from '../actions/delete_relation'; -import { actionReverse } from '../actions/reverse'; -import { actionSplit } from '../actions/split'; -import { Graph } from '../core/lib'; -import { osmEntity } from './entity'; +import { actionDeleteRelation } from '../actions/delete_relation.js'; +import { actionReverse } from '../actions/reverse.js'; +import { actionSplit } from '../actions/split.js'; +import { Graph } from '../core/lib/index.js'; +import { osmEntity } from './entity.js'; export function osmTurn(turn) { diff --git a/modules/osm/multipolygon.js b/modules/osm/multipolygon.js index 7be0afabdd..92b251d094 100644 --- a/modules/osm/multipolygon.js +++ b/modules/osm/multipolygon.js @@ -1,6 +1,6 @@ -import { actionReverse } from '../actions/reverse'; -import { osmIsInterestingTag } from './tags'; -import { osmWay } from './way'; +import { actionReverse } from '../actions/reverse.js'; +import { osmIsInterestingTag } from './tags.js'; +import { osmWay } from './way.js'; // "Old" multipolyons, previously known as "simple" multipolygons, are as follows: diff --git a/modules/osm/node.js b/modules/osm/node.js index d3806c88cd..b94801fbc1 100644 --- a/modules/osm/node.js +++ b/modules/osm/node.js @@ -1,7 +1,7 @@ import { Extent, vecAngle } from '@rapid-sdk/math'; import { utilArrayUniq } from '@rapid-sdk/util'; -import { osmEntity } from './entity'; +import { osmEntity } from './entity.js'; export function osmNode() { diff --git a/modules/osm/relation.js b/modules/osm/relation.js index 460223307b..97717d248e 100644 --- a/modules/osm/relation.js +++ b/modules/osm/relation.js @@ -1,8 +1,8 @@ import { geoArea as d3_geoArea } from 'd3-geo'; import { Extent, geomPolygonContainsPolygon, geomPolygonIntersectsPolygon } from '@rapid-sdk/math'; -import { osmEntity } from './entity'; -import { osmJoinWays } from './multipolygon'; +import { osmEntity } from './entity.js'; +import { osmJoinWays } from './multipolygon.js'; export function osmRelation() { diff --git a/modules/osm/way.js b/modules/osm/way.js index 946d5e61a9..ca0d23be65 100644 --- a/modules/osm/way.js +++ b/modules/osm/way.js @@ -2,10 +2,10 @@ import { geoArea as d3_geoArea } from 'd3-geo'; import { Extent, vecCross } from '@rapid-sdk/math'; import { utilArrayUniq } from '@rapid-sdk/util'; -import { osmEntity } from './entity'; -import { osmLanes } from './lanes'; -import { osmTagSuggestingArea, osmOneWayTags, osmRightSideIsInsideTags, osmRemoveLifecyclePrefix } from './tags'; -import { utilTotalExtent } from '../util'; +import { osmEntity } from './entity.js'; +import { osmLanes } from './lanes.js'; +import { osmTagSuggestingArea, osmOneWayTags, osmRightSideIsInsideTags, osmRemoveLifecyclePrefix } from './tags.js'; +import { utilTotalExtent } from '../util/index.js'; export function osmWay() { diff --git a/modules/pixi/AbstractFeature.js b/modules/pixi/AbstractFeature.js index b60a2d6a2d..0d6ba15249 100644 --- a/modules/pixi/AbstractFeature.js +++ b/modules/pixi/AbstractFeature.js @@ -1,5 +1,5 @@ import * as PIXI from 'pixi.js'; -import { PixiGeometry } from './PixiGeometry'; +import { PixiGeometry } from './PixiGeometry.js'; /** diff --git a/modules/pixi/PixiEvents.js b/modules/pixi/PixiEvents.js index 0ed6969718..4b82bc7c9b 100644 --- a/modules/pixi/PixiEvents.js +++ b/modules/pixi/PixiEvents.js @@ -1,6 +1,6 @@ import { EventEmitter } from '@pixi/utils'; -import { utilDetect } from '../util/detect'; +import { utilDetect } from '../util/detect.js'; /** diff --git a/modules/pixi/PixiFeatureLine.js b/modules/pixi/PixiFeatureLine.js index 207d18cefc..9cf9417687 100644 --- a/modules/pixi/PixiFeatureLine.js +++ b/modules/pixi/PixiFeatureLine.js @@ -2,8 +2,8 @@ import * as PIXI from 'pixi.js'; import { DashLine } from '@rapideditor/pixi-dashed-line'; import { GlowFilter } from 'pixi-filters'; -import { AbstractFeature } from './AbstractFeature'; -import { getLineSegments, lineToPoly } from './helpers'; +import { AbstractFeature } from './AbstractFeature.js'; +import { getLineSegments, lineToPoly } from './helpers.js'; const ONEWAY_SPACING = 35; const SIDED_SPACING = 30; diff --git a/modules/pixi/PixiFeaturePoint.js b/modules/pixi/PixiFeaturePoint.js index 4908d397fe..73ac6ec505 100644 --- a/modules/pixi/PixiFeaturePoint.js +++ b/modules/pixi/PixiFeaturePoint.js @@ -2,7 +2,7 @@ import * as PIXI from 'pixi.js'; import { DashLine } from '@rapideditor/pixi-dashed-line'; import { GlowFilter } from 'pixi-filters'; -import { AbstractFeature } from './AbstractFeature'; +import { AbstractFeature } from './AbstractFeature.js'; /** diff --git a/modules/pixi/PixiFeaturePolygon.js b/modules/pixi/PixiFeaturePolygon.js index b425d069da..536fa10a16 100644 --- a/modules/pixi/PixiFeaturePolygon.js +++ b/modules/pixi/PixiFeaturePolygon.js @@ -2,9 +2,10 @@ import * as PIXI from 'pixi.js'; import { DashLine } from '@rapideditor/pixi-dashed-line'; import { GlowFilter } from 'pixi-filters'; import { /* geomRotatePoints,*/ vecEqual, vecLength /*, vecSubtract */ } from '@rapid-sdk/math'; -import { flatCoordsToPoints } from '../util/util'; -import { AbstractFeature } from './AbstractFeature'; -import { lineToPoly } from './helpers'; + +import { flatCoordsToPoints } from '../util/util.js'; +import { AbstractFeature } from './AbstractFeature.js'; +import { lineToPoly } from './helpers.js'; const PARTIALFILLWIDTH = 32; diff --git a/modules/pixi/PixiLayerBackgroundTiles.js b/modules/pixi/PixiLayerBackgroundTiles.js index d4a8acf334..097ae6958c 100644 --- a/modules/pixi/PixiLayerBackgroundTiles.js +++ b/modules/pixi/PixiLayerBackgroundTiles.js @@ -3,7 +3,7 @@ import { interpolateNumber as d3_interpolateNumber } from 'd3-interpolate'; import { AdjustmentFilter, ConvolutionFilter } from 'pixi-filters'; import { Tiler, geoScaleToZoom, vecScale } from '@rapid-sdk/math'; -import { AbstractLayer } from './AbstractLayer'; +import { AbstractLayer } from './AbstractLayer.js'; const DEBUGCOLOR = 0xffff00; diff --git a/modules/pixi/PixiLayerCustomData.js b/modules/pixi/PixiLayerCustomData.js index 9a85f2ca68..af36cb0bbe 100644 --- a/modules/pixi/PixiLayerCustomData.js +++ b/modules/pixi/PixiLayerCustomData.js @@ -3,11 +3,11 @@ import { gpx, kml } from '@tmcw/togeojson'; import { Extent } from '@rapid-sdk/math'; import geojsonRewind from '@mapbox/geojson-rewind'; -import { AbstractLayer } from './AbstractLayer'; -import { PixiFeatureLine } from './PixiFeatureLine'; -import { PixiFeaturePoint } from './PixiFeaturePoint'; -import { PixiFeaturePolygon } from './PixiFeaturePolygon'; -import { utilFetchResponse } from '../util'; +import { AbstractLayer } from './AbstractLayer.js'; +import { PixiFeatureLine } from './PixiFeatureLine.js'; +import { PixiFeaturePoint } from './PixiFeaturePoint.js'; +import { PixiFeaturePolygon } from './PixiFeaturePolygon.js'; +import { utilFetchResponse } from '../util/index.js'; const CUSTOM_COLOR = 0x00ffff; diff --git a/modules/pixi/PixiLayerEditBlocks.js b/modules/pixi/PixiLayerEditBlocks.js index c332ae7cbc..4184586f4a 100644 --- a/modules/pixi/PixiLayerEditBlocks.js +++ b/modules/pixi/PixiLayerEditBlocks.js @@ -1,5 +1,5 @@ -import { AbstractLayer } from './AbstractLayer'; -import { PixiFeaturePolygon } from './PixiFeaturePolygon'; +import { AbstractLayer } from './AbstractLayer.js'; +import { PixiFeaturePolygon } from './PixiFeaturePolygon.js'; const MINZOOM = 4; diff --git a/modules/pixi/PixiLayerImproveOsm.js b/modules/pixi/PixiLayerImproveOsm.js index bbb572673c..cfd9491b79 100644 --- a/modules/pixi/PixiLayerImproveOsm.js +++ b/modules/pixi/PixiLayerImproveOsm.js @@ -1,5 +1,5 @@ -import { AbstractLayer } from './AbstractLayer'; -import { PixiFeaturePoint } from './PixiFeaturePoint'; +import { AbstractLayer } from './AbstractLayer.js'; +import { PixiFeaturePoint } from './PixiFeaturePoint.js'; const MINZOOM = 12; diff --git a/modules/pixi/PixiLayerKartaPhotos.js b/modules/pixi/PixiLayerKartaPhotos.js index 99dfe34718..e4515bd183 100644 --- a/modules/pixi/PixiLayerKartaPhotos.js +++ b/modules/pixi/PixiLayerKartaPhotos.js @@ -1,6 +1,6 @@ -import { AbstractLayer } from './AbstractLayer'; -import { PixiFeatureLine } from './PixiFeatureLine'; -import { PixiFeaturePoint } from './PixiFeaturePoint'; +import { AbstractLayer } from './AbstractLayer.js'; +import { PixiFeatureLine } from './PixiFeatureLine.js'; +import { PixiFeaturePoint } from './PixiFeaturePoint.js'; const MINZOOM = 12; const KARTA_BLUE = 0x20c4ff; diff --git a/modules/pixi/PixiLayerKeepRight.js b/modules/pixi/PixiLayerKeepRight.js index adfa616ea9..21e671ec30 100644 --- a/modules/pixi/PixiLayerKeepRight.js +++ b/modules/pixi/PixiLayerKeepRight.js @@ -1,5 +1,5 @@ -import { AbstractLayer } from './AbstractLayer'; -import { PixiFeaturePoint } from './PixiFeaturePoint'; +import { AbstractLayer } from './AbstractLayer.js'; +import { PixiFeaturePoint } from './PixiFeaturePoint.js'; const MINZOOM = 12; diff --git a/modules/pixi/PixiLayerLabels.js b/modules/pixi/PixiLayerLabels.js index 6ad563fb5d..0efe53cd93 100644 --- a/modules/pixi/PixiLayerLabels.js +++ b/modules/pixi/PixiLayerLabels.js @@ -2,9 +2,10 @@ import * as PIXI from 'pixi.js'; import RBush from 'rbush'; import { Extent, vecAdd, vecAngle, vecScale, vecSubtract, geomRotatePoints } from '@rapid-sdk/math'; -import { AbstractLayer } from './AbstractLayer'; +import { AbstractLayer } from './AbstractLayer.js'; import { getLineSegments, getDebugBBox, lineToPoly } from './helpers.js'; + const MINZOOM = 12; const TEXT_NORMAL = { diff --git a/modules/pixi/PixiLayerMapUI.js b/modules/pixi/PixiLayerMapUI.js index 03fa8718f3..9e30fc0321 100644 --- a/modules/pixi/PixiLayerMapUI.js +++ b/modules/pixi/PixiLayerMapUI.js @@ -1,8 +1,8 @@ import * as PIXI from 'pixi.js'; +import { DashLine } from '@rapideditor/pixi-dashed-line'; import { geoMetersToLon } from '@rapid-sdk/math'; -import { AbstractLayer } from './AbstractLayer'; -import { DashLine } from '@rapideditor/pixi-dashed-line'; +import { AbstractLayer } from './AbstractLayer.js'; /** diff --git a/modules/pixi/PixiLayerMapillaryFeatures.js b/modules/pixi/PixiLayerMapillaryFeatures.js index ea0a303717..9a3c60b2ea 100644 --- a/modules/pixi/PixiLayerMapillaryFeatures.js +++ b/modules/pixi/PixiLayerMapillaryFeatures.js @@ -1,5 +1,5 @@ -import { AbstractLayer } from './AbstractLayer'; -import { PixiFeaturePoint } from './PixiFeaturePoint'; +import { AbstractLayer } from './AbstractLayer.js'; +import { PixiFeaturePoint } from './PixiFeaturePoint.js'; const MINZOOM = 12; diff --git a/modules/pixi/PixiLayerMapillaryPhotos.js b/modules/pixi/PixiLayerMapillaryPhotos.js index 8b1d866f8f..64153156ea 100644 --- a/modules/pixi/PixiLayerMapillaryPhotos.js +++ b/modules/pixi/PixiLayerMapillaryPhotos.js @@ -1,8 +1,9 @@ -import { AbstractLayer } from './AbstractLayer'; -import { PixiFeatureLine } from './PixiFeatureLine'; -import { PixiFeaturePoint } from './PixiFeaturePoint'; import { scaleLinear as d3_scaleLinear } from 'd3-scale'; +import { AbstractLayer } from './AbstractLayer.js'; +import { PixiFeatureLine } from './PixiFeatureLine.js'; +import { PixiFeaturePoint } from './PixiFeaturePoint.js'; + const MINZOOM = 12; const MAPILLARY_GREEN = 0x05CB63; const MAPILLARY_SELECTED = 0xffee00; diff --git a/modules/pixi/PixiLayerMapillarySigns.js b/modules/pixi/PixiLayerMapillarySigns.js index e28bf4bee2..00cd2638f4 100644 --- a/modules/pixi/PixiLayerMapillarySigns.js +++ b/modules/pixi/PixiLayerMapillarySigns.js @@ -1,5 +1,5 @@ -import { AbstractLayer } from './AbstractLayer'; -import { PixiFeaturePoint } from './PixiFeaturePoint'; +import { AbstractLayer } from './AbstractLayer.js'; +import { PixiFeaturePoint } from './PixiFeaturePoint.js'; const MINZOOM = 12; diff --git a/modules/pixi/PixiLayerOsm.js b/modules/pixi/PixiLayerOsm.js index d3fad8cf56..fee64e3cdc 100644 --- a/modules/pixi/PixiLayerOsm.js +++ b/modules/pixi/PixiLayerOsm.js @@ -2,10 +2,10 @@ import * as PIXI from 'pixi.js'; import geojsonRewind from '@mapbox/geojson-rewind'; import { vecAngle, vecLength, vecInterp } from '@rapid-sdk/math'; -import { AbstractLayer } from './AbstractLayer'; -import { PixiFeatureLine } from './PixiFeatureLine'; -import { PixiFeaturePoint } from './PixiFeaturePoint'; -import { PixiFeaturePolygon } from './PixiFeaturePolygon'; +import { AbstractLayer } from './AbstractLayer.js'; +import { PixiFeatureLine } from './PixiFeatureLine.js'; +import { PixiFeaturePoint } from './PixiFeaturePoint.js'; +import { PixiFeaturePolygon } from './PixiFeaturePolygon.js'; const MINZOOM = 12; diff --git a/modules/pixi/PixiLayerOsmNotes.js b/modules/pixi/PixiLayerOsmNotes.js index 5d17ed94ae..6cd41ffbe9 100644 --- a/modules/pixi/PixiLayerOsmNotes.js +++ b/modules/pixi/PixiLayerOsmNotes.js @@ -1,5 +1,5 @@ -import { AbstractLayer } from './AbstractLayer'; -import { PixiFeaturePoint } from './PixiFeaturePoint'; +import { AbstractLayer } from './AbstractLayer.js'; +import { PixiFeaturePoint } from './PixiFeaturePoint.js'; const MINZOOM = 12; diff --git a/modules/pixi/PixiLayerOsmose.js b/modules/pixi/PixiLayerOsmose.js index 2f5db055ed..abb44654dc 100644 --- a/modules/pixi/PixiLayerOsmose.js +++ b/modules/pixi/PixiLayerOsmose.js @@ -1,5 +1,5 @@ -import { AbstractLayer } from './AbstractLayer'; -import { PixiFeaturePoint } from './PixiFeaturePoint'; +import { AbstractLayer } from './AbstractLayer.js'; +import { PixiFeaturePoint } from './PixiFeaturePoint.js'; const MINZOOM = 12; diff --git a/modules/pixi/PixiLayerRapid.js b/modules/pixi/PixiLayerRapid.js index 601e0a7779..fbc8e6ef00 100644 --- a/modules/pixi/PixiLayerRapid.js +++ b/modules/pixi/PixiLayerRapid.js @@ -1,10 +1,10 @@ import * as PIXI from 'pixi.js'; import geojsonRewind from '@mapbox/geojson-rewind'; -import { AbstractLayer } from './AbstractLayer'; -import { PixiFeatureLine } from './PixiFeatureLine'; -import { PixiFeaturePoint } from './PixiFeaturePoint'; -import { PixiFeaturePolygon } from './PixiFeaturePolygon'; +import { AbstractLayer } from './AbstractLayer.js'; +import { PixiFeatureLine } from './PixiFeatureLine.js'; +import { PixiFeaturePoint } from './PixiFeaturePoint.js'; +import { PixiFeaturePolygon } from './PixiFeaturePolygon.js'; const MINZOOM = 12; diff --git a/modules/pixi/PixiLayerStreetsidePhotos.js b/modules/pixi/PixiLayerStreetsidePhotos.js index 0b5172945b..37c376bcac 100644 --- a/modules/pixi/PixiLayerStreetsidePhotos.js +++ b/modules/pixi/PixiLayerStreetsidePhotos.js @@ -1,6 +1,6 @@ -import { AbstractLayer } from './AbstractLayer'; -import { PixiFeatureLine } from './PixiFeatureLine'; -import { PixiFeaturePoint } from './PixiFeaturePoint'; +import { AbstractLayer } from './AbstractLayer.js'; +import { PixiFeatureLine } from './PixiFeatureLine.js'; +import { PixiFeaturePoint } from './PixiFeaturePoint.js'; const MINZOOM = 12; const STREETSIDE_TEAL = 0xfffc4; diff --git a/modules/pixi/PixiRenderer.js b/modules/pixi/PixiRenderer.js index 02c26cd7c1..e4116751bb 100644 --- a/modules/pixi/PixiRenderer.js +++ b/modules/pixi/PixiRenderer.js @@ -2,11 +2,11 @@ import * as PIXI from 'pixi.js'; import { EventEmitter } from '@pixi/utils'; import { Projection, vecLength, vecSubtract } from '@rapid-sdk/math'; -import { osmNote, QAItem } from '../osm'; -import { PixiEvents } from './PixiEvents'; -import { PixiScene } from './PixiScene'; -import { PixiTextures } from './PixiTextures'; -import { utilSetTransform } from '../util/util'; +import { osmNote, QAItem } from '../osm/index.js'; +import { PixiEvents } from './PixiEvents.js'; +import { PixiScene } from './PixiScene.js'; +import { PixiTextures } from './PixiTextures.js'; +import { utilSetTransform } from '../util/util.js'; let _sharedTextures; // singleton (for now) diff --git a/modules/pixi/PixiScene.js b/modules/pixi/PixiScene.js index 5b017e67da..f2766c1e0d 100644 --- a/modules/pixi/PixiScene.js +++ b/modules/pixi/PixiScene.js @@ -1,22 +1,22 @@ import * as PIXI from 'pixi.js'; import { EventEmitter } from '@pixi/utils'; -import { PixiLayerBackgroundTiles } from './PixiLayerBackgroundTiles'; -import { PixiLayerEditBlocks } from './PixiLayerEditBlocks'; -import { PixiLayerImproveOsm } from './PixiLayerImproveOsm'; -import { PixiLayerKartaPhotos } from './PixiLayerKartaPhotos'; -import { PixiLayerKeepRight } from './PixiLayerKeepRight'; -import { PixiLayerLabels } from './PixiLayerLabels'; -import { PixiLayerMapillaryFeatures } from './PixiLayerMapillaryFeatures'; -import { PixiLayerMapillaryPhotos } from './PixiLayerMapillaryPhotos'; -import { PixiLayerMapillarySigns } from './PixiLayerMapillarySigns'; -import { PixiLayerOsm } from './PixiLayerOsm'; -import { PixiLayerOsmNotes } from './PixiLayerOsmNotes'; -import { PixiLayerOsmose } from './PixiLayerOsmose'; -import { PixiLayerRapid } from './PixiLayerRapid'; -import { PixiLayerMapUI } from './PixiLayerMapUI'; -import { PixiLayerStreetsidePhotos } from './PixiLayerStreetsidePhotos'; -import { PixiLayerCustomData } from './PixiLayerCustomData'; +import { PixiLayerBackgroundTiles } from './PixiLayerBackgroundTiles.js'; +import { PixiLayerCustomData } from './PixiLayerCustomData.js'; +import { PixiLayerEditBlocks } from './PixiLayerEditBlocks.js'; +import { PixiLayerImproveOsm } from './PixiLayerImproveOsm.js'; +import { PixiLayerKartaPhotos } from './PixiLayerKartaPhotos.js'; +import { PixiLayerKeepRight } from './PixiLayerKeepRight.js'; +import { PixiLayerLabels } from './PixiLayerLabels.js'; +import { PixiLayerMapillaryFeatures } from './PixiLayerMapillaryFeatures.js'; +import { PixiLayerMapillaryPhotos } from './PixiLayerMapillaryPhotos.js'; +import { PixiLayerMapillarySigns } from './PixiLayerMapillarySigns.js'; +import { PixiLayerMapUI } from './PixiLayerMapUI.js'; +import { PixiLayerOsm } from './PixiLayerOsm.js'; +import { PixiLayerOsmNotes } from './PixiLayerOsmNotes.js'; +import { PixiLayerOsmose } from './PixiLayerOsmose.js'; +import { PixiLayerRapid } from './PixiLayerRapid.js'; +import { PixiLayerStreetsidePhotos } from './PixiLayerStreetsidePhotos.js'; // Convert a single value, an Array of values, or a Set of values. diff --git a/modules/services/EsriService.js b/modules/services/EsriService.js index be60aac6a0..50135a52b2 100644 --- a/modules/services/EsriService.js +++ b/modules/services/EsriService.js @@ -2,10 +2,10 @@ import { select as d3_select } from 'd3-selection'; import { Tiler } from '@rapid-sdk/math'; import { utilQsString } from '@rapid-sdk/util'; -import { AbstractSystem } from '../core/AbstractSystem'; -import { Graph, Tree } from '../core/lib'; -import { osmNode, osmRelation, osmWay } from '../osm'; -import { utilFetchResponse } from '../util'; +import { AbstractSystem } from '../core/AbstractSystem.js'; +import { Graph, Tree } from '../core/lib/index.js'; +import { osmNode, osmRelation, osmWay } from '../osm/index.js'; +import { utilFetchResponse } from '../util/index.js'; const GROUPID = 'bdf6c800b3ae453b9db239e03d7c1727'; diff --git a/modules/services/ImproveOsmService.js b/modules/services/ImproveOsmService.js index 24307978e2..66f497db4a 100644 --- a/modules/services/ImproveOsmService.js +++ b/modules/services/ImproveOsmService.js @@ -2,9 +2,9 @@ import { Extent, Tiler, vecAdd, vecScale} from '@rapid-sdk/math'; import { utilQsString } from '@rapid-sdk/util'; import RBush from 'rbush'; -import { AbstractSystem } from '../core/AbstractSystem'; -import { QAItem } from '../osm'; -import { utilFetchResponse } from '../util'; +import { AbstractSystem } from '../core/AbstractSystem.js'; +import { QAItem } from '../osm/index.js'; +import { utilFetchResponse } from '../util/index.js'; const TILEZOOM = 14; diff --git a/modules/services/KartaviewService.js b/modules/services/KartaviewService.js index e81272e647..5977e78eaf 100644 --- a/modules/services/KartaviewService.js +++ b/modules/services/KartaviewService.js @@ -3,8 +3,8 @@ import { Tiler, geoScaleToZoom } from '@rapid-sdk/math'; import { utilArrayUnion, utilQsString } from '@rapid-sdk/util'; import RBush from 'rbush'; -import { AbstractSystem } from '../core/AbstractSystem'; -import { utilFetchResponse, utilSetTransform } from '../util'; +import { AbstractSystem } from '../core/AbstractSystem.js'; +import { utilFetchResponse, utilSetTransform } from '../util/index.js'; const KARTAVIEW_API = 'https://kartaview.org'; diff --git a/modules/services/KeepRightService.js b/modules/services/KeepRightService.js index 196487cc94..a18b6000fa 100644 --- a/modules/services/KeepRightService.js +++ b/modules/services/KeepRightService.js @@ -2,9 +2,9 @@ import { Extent, Tiler, vecAdd} from '@rapid-sdk/math'; import { utilQsString } from '@rapid-sdk/util'; import RBush from 'rbush'; -import { AbstractSystem } from '../core/AbstractSystem'; -import { QAItem } from '../osm'; -import { utilFetchResponse } from '../util'; +import { AbstractSystem } from '../core/AbstractSystem.js'; +import { QAItem } from '../osm/index.js'; +import { utilFetchResponse } from '../util/index.js'; const KEEPRIGHT_API = 'https://www.keepright.at'; diff --git a/modules/services/MapWithAIService.js b/modules/services/MapWithAIService.js index 53607976e1..6c0bbbc5b6 100644 --- a/modules/services/MapWithAIService.js +++ b/modules/services/MapWithAIService.js @@ -1,9 +1,9 @@ import { Tiler } from '@rapid-sdk/math'; -import { AbstractSystem } from '../core/AbstractSystem'; -import { Graph, Tree } from '../core/lib'; -import { osmEntity, osmNode, osmWay } from '../osm'; -import { utilFetchResponse } from '../util'; +import { AbstractSystem } from '../core/AbstractSystem.js'; +import { Graph, Tree } from '../core/lib/index.js'; +import { osmEntity, osmNode, osmWay } from '../osm/index.js'; +import { utilFetchResponse } from '../util/index.js'; const APIROOT = 'https://mapwith.ai/maps/ml_roads'; diff --git a/modules/services/MapillaryService.js b/modules/services/MapillaryService.js index 8e92e8ebe7..c25ad9276b 100644 --- a/modules/services/MapillaryService.js +++ b/modules/services/MapillaryService.js @@ -4,8 +4,8 @@ import { VectorTile } from '@mapbox/vector-tile'; import Protobuf from 'pbf'; import RBush from 'rbush'; -import { AbstractSystem } from '../core/AbstractSystem'; -import { utilFetchResponse } from '../util'; +import { AbstractSystem } from '../core/AbstractSystem.js'; +import { utilFetchResponse } from '../util/index.js'; const MAPILLARY_JS = 'https://cdn.jsdelivr.net/npm/mapillary-js@4/dist/mapillary.min.js'; const MAPILLARY_CSS = 'https://cdn.jsdelivr.net/npm/mapillary-js@4/dist/mapillary.min.css'; diff --git a/modules/services/NominatimService.js b/modules/services/NominatimService.js index 4ae5dc4262..5958095857 100644 --- a/modules/services/NominatimService.js +++ b/modules/services/NominatimService.js @@ -2,8 +2,8 @@ import { Extent } from '@rapid-sdk/math'; import { utilQsString } from '@rapid-sdk/util'; import RBush from 'rbush'; -import { AbstractSystem } from '../core/AbstractSystem'; -import { utilFetchResponse } from '../util'; +import { AbstractSystem } from '../core/AbstractSystem.js'; +import { utilFetchResponse } from '../util/index.js'; /** diff --git a/modules/services/NsiService.js b/modules/services/NsiService.js index ccf54d3b5a..e73303fae1 100644 --- a/modules/services/NsiService.js +++ b/modules/services/NsiService.js @@ -1,6 +1,6 @@ import { Matcher } from 'name-suggestion-index'; -import { AbstractSystem } from '../core/AbstractSystem'; +import { AbstractSystem } from '../core/AbstractSystem.js'; diff --git a/modules/services/OsmService.js b/modules/services/OsmService.js index d1550053e5..109e47e650 100644 --- a/modules/services/OsmService.js +++ b/modules/services/OsmService.js @@ -1,13 +1,13 @@ import { Extent, Projection, Tiler, geoZoomToScale, vecAdd } from '@rapid-sdk/math'; import { utilArrayChunk, utilArrayGroupBy, utilArrayUniq, utilObjectOmit, utilQsString } from '@rapid-sdk/util'; -import _throttle from 'lodash-es/throttle'; +import _throttle from 'lodash-es/throttle.js'; import { osmAuth } from 'osm-auth'; import RBush from 'rbush'; -import { AbstractSystem } from '../core/AbstractSystem'; -import { JXON } from '../util/jxon'; -import { osmEntity, osmNode, osmNote, osmRelation, osmWay } from '../osm'; -import { utilFetchResponse } from '../util'; +import { AbstractSystem } from '../core/AbstractSystem.js'; +import { JXON } from '../util/jxon.js'; +import { osmEntity, osmNode, osmNote, osmRelation, osmWay } from '../osm/index.js'; +import { utilFetchResponse } from '../util/index.js'; /** diff --git a/modules/services/OsmWikibaseService.js b/modules/services/OsmWikibaseService.js index ab0dadf8b0..c4dac875c7 100644 --- a/modules/services/OsmWikibaseService.js +++ b/modules/services/OsmWikibaseService.js @@ -1,8 +1,8 @@ import { utilQsString } from '@rapid-sdk/util'; -import debounce from 'lodash-es/debounce'; +import debounce from 'lodash-es/debounce.js'; -import { AbstractSystem } from '../core/AbstractSystem'; -import { utilFetchResponse } from '../util'; +import { AbstractSystem } from '../core/AbstractSystem.js'; +import { utilFetchResponse } from '../util/index.js'; /** diff --git a/modules/services/OsmoseService.js b/modules/services/OsmoseService.js index 83634afcf2..e87477c0c6 100644 --- a/modules/services/OsmoseService.js +++ b/modules/services/OsmoseService.js @@ -4,9 +4,9 @@ import { utilQsString } from '@rapid-sdk/util'; import { marked } from 'marked'; import RBush from 'rbush'; -import { AbstractSystem } from '../core/AbstractSystem'; -import { QAItem } from '../osm'; -import { utilFetchResponse } from '../util'; +import { AbstractSystem } from '../core/AbstractSystem.js'; +import { QAItem } from '../osm/index.js'; +import { utilFetchResponse } from '../util/index.js'; const TILEZOOM = 14; diff --git a/modules/services/StreetsideService.js b/modules/services/StreetsideService.js index 595c7393c7..45df51ef43 100644 --- a/modules/services/StreetsideService.js +++ b/modules/services/StreetsideService.js @@ -4,9 +4,9 @@ import { Extent, Tiler, geoMetersToLat, geoMetersToLon, geomRotatePoints, geomPo import { utilArrayUnion, utilQsString, utilUniqueString } from '@rapid-sdk/util'; import RBush from 'rbush'; -import { AbstractSystem } from '../core/AbstractSystem'; -import { jsonpRequest } from '../util/jsonp_request'; -import { utilFetchResponse } from '../util'; +import { AbstractSystem } from '../core/AbstractSystem.js'; +import { jsonpRequest } from '../util/jsonp_request.js'; +import { utilFetchResponse } from '../util/index.js'; const PANNELLUM_JS = 'https://cdn.jsdelivr.net/npm/pannellum@2/build/pannellum.min.js'; const PANNELLUM_CSS = 'https://cdn.jsdelivr.net/npm/pannellum@2/build/pannellum.min.css'; diff --git a/modules/services/TaginfoService.js b/modules/services/TaginfoService.js index c743392fe0..81b0a1d3eb 100644 --- a/modules/services/TaginfoService.js +++ b/modules/services/TaginfoService.js @@ -1,8 +1,8 @@ import { utilObjectOmit, utilQsString } from '@rapid-sdk/util'; -import debounce from 'lodash-es/debounce'; +import debounce from 'lodash-es/debounce.js'; -import { AbstractSystem } from '../core/AbstractSystem'; -import { utilFetchResponse } from '../util'; +import { AbstractSystem } from '../core/AbstractSystem.js'; +import { utilFetchResponse } from '../util/index.js'; const TAGINFO_API = 'https://taginfo.openstreetmap.org/api/4/'; diff --git a/modules/services/VectorTileService.js b/modules/services/VectorTileService.js index d2583d7da5..19da4c106a 100644 --- a/modules/services/VectorTileService.js +++ b/modules/services/VectorTileService.js @@ -2,14 +2,15 @@ import { Extent, Tiler, vecEqual } from '@rapid-sdk/math'; import { utilHashcode } from '@rapid-sdk/util'; import { VectorTile } from '@mapbox/vector-tile'; import geojsonRewind from '@mapbox/geojson-rewind'; -import { PMTiles } from 'pmtiles'; +// import { PMTiles } from 'pmtiles'; +import * as PMTiles from 'pmtiles'; import stringify from 'fast-json-stable-stringify'; import * as Polyclip from 'polyclip-ts'; import Protobuf from 'pbf'; import RBush from 'rbush'; -import { AbstractSystem } from '../core/AbstractSystem'; -import { utilFetchResponse } from '../util'; +import { AbstractSystem } from '../core/AbstractSystem.js'; +import { utilFetchResponse } from '../util/index.js'; /** diff --git a/modules/services/WikidataService.js b/modules/services/WikidataService.js index 2b6620a290..9052819755 100644 --- a/modules/services/WikidataService.js +++ b/modules/services/WikidataService.js @@ -1,7 +1,7 @@ import { utilQsString } from '@rapid-sdk/util'; -import { AbstractSystem } from '../core/AbstractSystem'; -import { utilFetchResponse } from '../util'; +import { AbstractSystem } from '../core/AbstractSystem.js'; +import { utilFetchResponse } from '../util/index.js'; const WIKIDATA_API = 'https://www.wikidata.org/w/api.php?'; diff --git a/modules/services/WikipediaService.js b/modules/services/WikipediaService.js index 7217ffdf74..00160b9259 100644 --- a/modules/services/WikipediaService.js +++ b/modules/services/WikipediaService.js @@ -1,7 +1,7 @@ import { utilQsString } from '@rapid-sdk/util'; -import { AbstractSystem } from '../core/AbstractSystem'; -import { utilFetchResponse } from '../util'; +import { AbstractSystem } from '../core/AbstractSystem.js'; +import { utilFetchResponse } from '../util/index.js'; const WIKIPEDIA_API = 'https://en.wikipedia.org/w/api.php?'; diff --git a/modules/services/index.js b/modules/services/index.js index 9c2be7c369..45273d0885 100644 --- a/modules/services/index.js +++ b/modules/services/index.js @@ -1,19 +1,19 @@ -import { EsriService } from './EsriService'; -import { ImproveOsmService } from './ImproveOsmService'; -import { KartaviewService } from './KartaviewService'; -import { KeepRightService } from './KeepRightService'; -import { MapillaryService } from './MapillaryService'; -import { MapWithAIService } from './MapWithAIService'; -import { NominatimService } from './NominatimService'; -import { NsiService } from './NsiService'; -import { OsmService } from './OsmService'; -import { OsmoseService } from './OsmoseService'; -import { OsmWikibaseService } from './OsmWikibaseService'; -import { StreetsideService } from './StreetsideService'; -import { TaginfoService } from './TaginfoService'; -import { VectorTileService } from './VectorTileService'; -import { WikidataService } from './WikidataService'; -import { WikipediaService } from './WikipediaService'; +import { EsriService } from './EsriService.js'; +import { ImproveOsmService } from './ImproveOsmService.js'; +import { KartaviewService } from './KartaviewService.js'; +import { KeepRightService } from './KeepRightService.js'; +import { MapillaryService } from './MapillaryService.js'; +import { MapWithAIService } from './MapWithAIService.js'; +import { NominatimService } from './NominatimService.js'; +import { NsiService } from './NsiService.js'; +import { OsmService } from './OsmService.js'; +import { OsmoseService } from './OsmoseService.js'; +import { OsmWikibaseService } from './OsmWikibaseService.js'; +import { StreetsideService } from './StreetsideService.js'; +import { TaginfoService } from './TaginfoService.js'; +import { VectorTileService } from './VectorTileService.js'; +import { WikidataService } from './WikidataService.js'; +import { WikipediaService } from './WikipediaService.js'; export { EsriService, diff --git a/modules/svg/tag_classes.js b/modules/svg/tag_classes.js index 0303a90835..bb11a85bc0 100644 --- a/modules/svg/tag_classes.js +++ b/modules/svg/tag_classes.js @@ -1,5 +1,6 @@ import { select as d3_select } from 'd3-selection'; -import { osmPathHighwayTagValues, osmPavedTags, osmSemipavedTags, osmLifecyclePrefixes } from '../osm/tags'; + +import { osmPathHighwayTagValues, osmPavedTags, osmSemipavedTags, osmLifecyclePrefixes } from '../osm/tags.js'; export function svgTagClasses() { diff --git a/modules/ui/UiDefs.js b/modules/ui/UiDefs.js index be7194c0f9..cabfa8d1a9 100644 --- a/modules/ui/UiDefs.js +++ b/modules/ui/UiDefs.js @@ -1,6 +1,6 @@ import { select as d3_select } from 'd3-selection'; -import { utilFetchResponse } from '../util'; +import { utilFetchResponse } from '../util/index.js'; /** diff --git a/modules/ui/UiField.js b/modules/ui/UiField.js index 7fd342be8d..021b9c3491 100644 --- a/modules/ui/UiField.js +++ b/modules/ui/UiField.js @@ -2,12 +2,12 @@ import { dispatch as d3_dispatch } from 'd3-dispatch'; import { select as d3_select } from 'd3-selection'; import { utilUniqueString } from '@rapid-sdk/util'; -import { uiIcon } from './icon'; -import { uiTooltip } from './tooltip'; -// import { uiFieldHelp } from './field_help'; -import { uiFields } from './fields'; -import { uiTagReference } from './tag_reference'; -import { utilRebind, utilTotalExtent } from '../util'; +import { uiIcon } from './icon.js'; +import { uiTooltip } from './tooltip.js'; +// import { uiFieldHelp } from './field_help.js'; +import { uiFields } from './fields/index.js'; +import { uiTagReference } from './tag_reference.js'; +import { utilRebind, utilTotalExtent } from '../util/index.js'; /** diff --git a/modules/ui/account.js b/modules/ui/account.js index 22f05a9689..c9ad4109c2 100644 --- a/modules/ui/account.js +++ b/modules/ui/account.js @@ -1,4 +1,4 @@ -import { uiIcon } from './icon'; +import { uiIcon } from './icon.js'; export function uiAccount(context) { diff --git a/modules/ui/attribution.js b/modules/ui/attribution.js index 7f331cfb86..bc4146e519 100644 --- a/modules/ui/attribution.js +++ b/modules/ui/attribution.js @@ -1,4 +1,4 @@ -import _throttle from 'lodash-es/throttle'; +import _throttle from 'lodash-es/throttle.js'; import { select as d3_select } from 'd3-selection'; diff --git a/modules/ui/changeset_editor.js b/modules/ui/changeset_editor.js index fe2aed6dc3..9af6cd8991 100644 --- a/modules/ui/changeset_editor.js +++ b/modules/ui/changeset_editor.js @@ -1,11 +1,11 @@ import { dispatch as d3_dispatch } from 'd3-dispatch'; import { utilArrayUniqBy } from '@rapid-sdk/util'; -import { uiIcon } from './icon'; -import { uiCombobox} from './combobox'; -import { UiField } from './UiField'; -import { uiFormFields } from './form_fields'; -import { utilRebind, utilTriggerEvent } from '../util'; +import { uiIcon } from './icon.js'; +import { uiCombobox} from './combobox.js'; +import { UiField } from './UiField.js'; +import { uiFormFields } from './form_fields.js'; +import { utilRebind, utilTriggerEvent } from '../util/index.js'; export function uiChangesetEditor(context) { diff --git a/modules/ui/cmd.js b/modules/ui/cmd.js index e6c94da43d..24afeb450c 100644 --- a/modules/ui/cmd.js +++ b/modules/ui/cmd.js @@ -1,4 +1,4 @@ -import { utilDetect } from '../util/detect'; +import { utilDetect } from '../util/detect.js'; // Throughout Rapid we specify key combos in MacOS style. diff --git a/modules/ui/combobox.js b/modules/ui/combobox.js index 2ec9a79f3b..c24f2fe9c4 100644 --- a/modules/ui/combobox.js +++ b/modules/ui/combobox.js @@ -1,6 +1,7 @@ import { dispatch as d3_dispatch } from 'd3-dispatch'; import { select as d3_select } from 'd3-selection'; -import { utilGetSetValue, utilRebind, utilTriggerEvent } from '../util'; + +import { utilGetSetValue, utilRebind, utilTriggerEvent } from '../util/index.js'; // This code assumes that the combobox values will not have duplicate entries. diff --git a/modules/ui/commit.js b/modules/ui/commit.js index c82f647232..67a20973a2 100644 --- a/modules/ui/commit.js +++ b/modules/ui/commit.js @@ -3,14 +3,14 @@ import { select as d3_select } from 'd3-selection'; import { utilArrayGroupBy, utilUniqueString } from '@rapid-sdk/util'; import deepEqual from 'fast-deep-equal'; -import { osmChangeset } from '../osm'; -import { uiIcon } from './icon'; -import { uiTooltip } from './tooltip'; -import { uiChangesetEditor } from './changeset_editor'; -import { uiSectionChanges } from './sections/changes'; -import { uiCommitWarnings } from './commit_warnings'; -import { uiSectionRawTagEditor } from './sections/raw_tag_editor'; -import { utilDetect, utilRebind } from '../util'; +import { osmChangeset } from '../osm/index.js'; +import { uiIcon } from './icon.js'; +import { uiTooltip } from './tooltip.js'; +import { uiChangesetEditor } from './changeset_editor.js'; +import { uiSectionChanges } from './sections/changes.js'; +import { uiCommitWarnings } from './commit_warnings.js'; +import { uiSectionRawTagEditor } from './sections/raw_tag_editor.js'; +import { utilDetect, utilRebind } from '../util/index.js'; const readOnlyTags = [ diff --git a/modules/ui/commit_warnings.js b/modules/ui/commit_warnings.js index efd028f045..8a67263f7c 100644 --- a/modules/ui/commit_warnings.js +++ b/modules/ui/commit_warnings.js @@ -1,6 +1,6 @@ import { utilEntityOrMemberSelector } from '@rapid-sdk/util'; -import { uiIcon } from './icon'; +import { uiIcon } from './icon.js'; export function uiCommitWarnings(context) { diff --git a/modules/ui/confirm.js b/modules/ui/confirm.js index dffc4e69f5..396f3c5d55 100644 --- a/modules/ui/confirm.js +++ b/modules/ui/confirm.js @@ -1,4 +1,4 @@ -import { uiModal } from './modal'; +import { uiModal } from './modal.js'; export function uiConfirm(context, selection) { diff --git a/modules/ui/conflicts.js b/modules/ui/conflicts.js index 9a51de62db..6a2d6693dc 100644 --- a/modules/ui/conflicts.js +++ b/modules/ui/conflicts.js @@ -3,10 +3,10 @@ import { select as d3_select } from 'd3-selection'; import { Extent } from '@rapid-sdk/math'; import { utilEntityOrMemberSelector } from '@rapid-sdk/util'; -import { JXON } from '../util/jxon'; -import { osmChangeset } from '../osm'; -import { uiIcon } from './icon'; -import { utilDetect, utilKeybinding, utilRebind, utilWrap } from '../util'; +import { JXON } from '../util/jxon.js'; +import { osmChangeset } from '../osm/index.js'; +import { uiIcon } from './icon.js'; +import { utilDetect, utilKeybinding, utilRebind, utilWrap } from '../util/index.js'; export function uiConflicts(context) { diff --git a/modules/ui/contributors.js b/modules/ui/contributors.js index e15a6b8ce6..7f0f1bb74f 100644 --- a/modules/ui/contributors.js +++ b/modules/ui/contributors.js @@ -1,7 +1,7 @@ import { select as d3_select } from 'd3-selection'; -import debounce from 'lodash-es/debounce'; +import debounce from 'lodash-es/debounce.js'; -import { uiIcon } from './icon'; +import { uiIcon } from './icon.js'; export function uiContributors(context) { diff --git a/modules/ui/data_editor.js b/modules/ui/data_editor.js index 5dd64a34c3..8952f3605e 100644 --- a/modules/ui/data_editor.js +++ b/modules/ui/data_editor.js @@ -1,7 +1,6 @@ -import { uiIcon } from './icon'; - -import { uiDataHeader } from './data_header'; -import { uiSectionRawTagEditor } from './sections/raw_tag_editor'; +import { uiIcon } from './icon.js'; +import { uiDataHeader } from './data_header.js'; +import { uiSectionRawTagEditor } from './sections/raw_tag_editor.js'; export function uiDataEditor(context) { diff --git a/modules/ui/data_header.js b/modules/ui/data_header.js index 50d06950c3..0189f35f8a 100644 --- a/modules/ui/data_header.js +++ b/modules/ui/data_header.js @@ -1,4 +1,4 @@ -import { uiIcon } from './icon'; +import { uiIcon } from './icon.js'; export function uiDataHeader(context) { diff --git a/modules/ui/disclosure.js b/modules/ui/disclosure.js index 7acf3aa0a0..67db2ee4a5 100644 --- a/modules/ui/disclosure.js +++ b/modules/ui/disclosure.js @@ -1,9 +1,8 @@ import { dispatch as d3_dispatch } from 'd3-dispatch'; -import { uiIcon } from './icon'; -import { utilFunctor } from '../util'; -import { utilRebind } from '../util/rebind'; -import { uiToggle } from './toggle'; +import { uiIcon } from './icon.js'; +import { uiToggle } from './toggle.js'; +import { utilFunctor, utilRebind } from '../util/index.js'; // A Disclosure consists of a toggleable Label and Content diff --git a/modules/ui/edit_menu.js b/modules/ui/edit_menu.js index 0fd9d0ca48..705df61f36 100644 --- a/modules/ui/edit_menu.js +++ b/modules/ui/edit_menu.js @@ -1,11 +1,10 @@ import { select as d3_select } from 'd3-selection'; import { dispatch as d3_dispatch } from 'd3-dispatch'; - import { vecAdd } from '@rapid-sdk/math'; -import { uiTooltip } from './tooltip'; -import { utilRebind } from '../util/rebind'; -import { utilHighlightEntities } from '../util/util'; -import { uiIcon } from './icon'; + +import { uiTooltip } from './tooltip.js'; +import { uiIcon } from './icon.js'; +import { utilHighlightEntities, utilRebind } from '../util/index.js'; export function uiEditMenu(context) { diff --git a/modules/ui/entity_editor.js b/modules/ui/entity_editor.js index 034bc11a25..88ce561bc9 100644 --- a/modules/ui/entity_editor.js +++ b/modules/ui/entity_editor.js @@ -2,17 +2,17 @@ import { dispatch as d3_dispatch } from 'd3-dispatch'; import { utilArrayIdentical, utilCleanTags } from '@rapid-sdk/util'; import deepEqual from 'fast-deep-equal'; -import { actionChangeTags, actionSyncCrossingTags } from '../actions'; -import { uiIcon } from './icon'; -import { utilRebind } from '../util'; - -import { uiSectionEntityIssues } from './sections/entity_issues'; -import { uiSectionFeatureType } from './sections/feature_type'; -import { uiSectionPresetFields } from './sections/preset_fields'; -import { uiSectionRawMemberEditor } from './sections/raw_member_editor'; -import { uiSectionRawMembershipEditor } from './sections/raw_membership_editor'; -import { uiSectionRawTagEditor } from './sections/raw_tag_editor'; -import { uiSectionSelectionList } from './sections/selection_list'; +import { actionChangeTags, actionSyncCrossingTags } from '../actions/index.js'; +import { uiIcon } from './icon.js'; +import { utilRebind } from '../util/index.js'; + +import { uiSectionEntityIssues } from './sections/entity_issues.js'; +import { uiSectionFeatureType } from './sections/feature_type.js'; +import { uiSectionPresetFields } from './sections/preset_fields.js'; +import { uiSectionRawMemberEditor } from './sections/raw_member_editor.js'; +import { uiSectionRawMembershipEditor } from './sections/raw_membership_editor.js'; +import { uiSectionRawTagEditor } from './sections/raw_tag_editor.js'; +import { uiSectionSelectionList } from './sections/selection_list.js'; let _wasSelectedIDs = []; diff --git a/modules/ui/feature_info.js b/modules/ui/feature_info.js index 8d75488c12..94e245f500 100644 --- a/modules/ui/feature_info.js +++ b/modules/ui/feature_info.js @@ -1,4 +1,4 @@ -import { uiTooltip } from './tooltip'; +import { uiTooltip } from './tooltip.js'; export function uiFeatureInfo(context) { diff --git a/modules/ui/feature_list.js b/modules/ui/feature_list.js index ee6f5f92df..5e833207bc 100644 --- a/modules/ui/feature_list.js +++ b/modules/ui/feature_list.js @@ -2,12 +2,11 @@ import { select as d3_select } from 'd3-selection'; import { Extent, geoSphericalDistance } from '@rapid-sdk/math'; import * as sexagesimal from '@mapbox/sexagesimal'; -import { Graph } from '../core/lib'; -import { osmEntity } from '../osm/entity'; -import { uiIcon } from './icon'; -import { uiCmd } from './cmd'; - -import { utilHighlightEntities, utilIsColorValid, utilNoAuto } from '../util'; +import { Graph } from '../core/lib/index.js'; +import { osmEntity } from '../osm/entity.js'; +import { uiIcon } from './icon.js'; +import { uiCmd } from './cmd.js'; +import { utilHighlightEntities, utilIsColorValid, utilNoAuto } from '../util/index.js'; export function uiFeatureList(context) { diff --git a/modules/ui/field_help.js b/modules/ui/field_help.js index 669b1291f7..540a4418e1 100644 --- a/modules/ui/field_help.js +++ b/modules/ui/field_help.js @@ -1,8 +1,8 @@ //import { select as d3_select } from 'd3-selection'; -// //import { marked } from 'marked'; -//import { uiIcon } from './icon'; -//import { icon } from './intro/helper'; +// +//import { uiIcon } from './icon.js'; +//import { icon } from './intro/helper.js'; // // //// This currently only works with the 'restrictions' field diff --git a/modules/ui/fields/access.js b/modules/ui/fields/access.js index 59276b0f94..2fc16c0568 100644 --- a/modules/ui/fields/access.js +++ b/modules/ui/fields/access.js @@ -1,8 +1,8 @@ import { dispatch as d3_dispatch } from 'd3-dispatch'; import { select as d3_select } from 'd3-selection'; -import { uiCombobox } from '../combobox'; -import { utilGetSetValue, utilNoAuto, utilRebind } from '../../util'; +import { uiCombobox } from '../combobox.js'; +import { utilGetSetValue, utilNoAuto, utilRebind } from '../../util/index.js'; export function uiFieldAccess(context, uifield) { diff --git a/modules/ui/fields/address.js b/modules/ui/fields/address.js index bba4349c81..8f9d550aa4 100644 --- a/modules/ui/fields/address.js +++ b/modules/ui/fields/address.js @@ -4,9 +4,9 @@ import { Extent, geoSphericalDistance } from '@rapid-sdk/math'; import { utilArrayUniqBy } from '@rapid-sdk/util'; import { iso1A2Code } from '@rapideditor/country-coder'; -import { geoChooseEdge } from '../../geo'; -import { uiCombobox } from '../combobox'; -import { utilGetSetValue, utilNoAuto, utilRebind } from '../../util'; +import { geoChooseEdge } from '../../geo/index.js'; +import { uiCombobox } from '../combobox.js'; +import { utilGetSetValue, utilNoAuto, utilRebind } from '../../util/index.js'; export function uiFieldAddress(context, uifield) { diff --git a/modules/ui/fields/check.js b/modules/ui/fields/check.js index b4db51e092..60501f9715 100644 --- a/modules/ui/fields/check.js +++ b/modules/ui/fields/check.js @@ -1,10 +1,10 @@ import { dispatch as d3_dispatch } from 'd3-dispatch'; import { select as d3_select } from 'd3-selection'; -import { utilRebind } from '../../util/rebind'; -import { actionReverse } from '../../actions/reverse'; -import { osmOneWayTags } from '../../osm'; -import { uiIcon } from '../icon'; +import { utilRebind } from '../../util/rebind.js'; +import { actionReverse } from '../../actions/reverse.js'; +import { osmOneWayTags } from '../../osm/tags.js'; +import { uiIcon } from '../icon.js'; export { uiFieldCheck as uiFieldDefaultCheck }; export { uiFieldCheck as uiFieldOnewayCheck }; diff --git a/modules/ui/fields/combo.js b/modules/ui/fields/combo.js index fd27ae54da..044f375d86 100644 --- a/modules/ui/fields/combo.js +++ b/modules/ui/fields/combo.js @@ -4,10 +4,10 @@ import { drag as d3_drag } from 'd3-drag'; import { utilArrayUniq, utilUnicodeCharsCount } from '@rapid-sdk/util'; import { iso1A2Code } from '@rapideditor/country-coder'; -import { osmEntity } from '../../osm/entity'; -import { uiCombobox } from '../combobox'; -import { utilKeybinding } from '../../util/keybinding'; -import { utilGetSetValue, utilNoAuto, utilRebind } from '../../util'; +import { osmEntity } from '../../osm/entity.js'; +import { uiCombobox } from '../combobox.js'; +import { utilKeybinding } from '../../util/keybinding.js'; +import { utilGetSetValue, utilNoAuto, utilRebind } from '../../util/index.js'; export { uiFieldCombo as uiFieldManyCombo, diff --git a/modules/ui/fields/cycleway.js b/modules/ui/fields/cycleway.js index 209d2ca2fc..12797dbbb8 100644 --- a/modules/ui/fields/cycleway.js +++ b/modules/ui/fields/cycleway.js @@ -1,8 +1,8 @@ import { dispatch as d3_dispatch } from 'd3-dispatch'; import { select as d3_select } from 'd3-selection'; -import { uiCombobox } from '../combobox'; -import { utilGetSetValue, utilNoAuto, utilRebind } from '../../util'; +import { uiCombobox } from '../combobox.js'; +import { utilGetSetValue, utilNoAuto, utilRebind } from '../../util/index.js'; export function uiFieldCycleway(context, uifield) { diff --git a/modules/ui/fields/index.js b/modules/ui/fields/index.js index 94e8ba8e13..6532d38214 100644 --- a/modules/ui/fields/index.js +++ b/modules/ui/fields/index.js @@ -1,23 +1,23 @@ -export * from './check'; -export * from './combo'; -export * from './input'; -export * from './access'; -export * from './address'; -export * from './cycleway'; -export * from './lanes'; -export * from './localized'; -export * from './roadspeed'; -export * from './radio'; -export * from './restrictions'; -export * from './textarea'; -export * from './wikidata'; -export * from './wikipedia'; +export * from './check.js'; +export * from './combo.js'; +export * from './input.js'; +export * from './access.js'; +export * from './address.js'; +export * from './cycleway.js'; +export * from './lanes.js'; +export * from './localized.js'; +export * from './roadspeed.js'; +export * from './radio.js'; +export * from './restrictions.js'; +export * from './textarea.js'; +export * from './wikidata.js'; +export * from './wikipedia.js'; import { uiFieldCheck, uiFieldDefaultCheck, uiFieldOnewayCheck -} from './check'; +} from './check.js'; import { uiFieldCombo, @@ -26,7 +26,7 @@ import { uiFieldNetworkCombo, uiFieldSemiCombo, uiFieldTypeCombo -} from './combo'; +} from './combo.js'; import { uiFieldEmail, @@ -35,23 +35,23 @@ import { uiFieldTel, uiFieldText, uiFieldUrl -} from './input'; +} from './input.js'; import { uiFieldRadio, uiFieldStructureRadio -} from './radio'; +} from './radio.js'; -import { uiFieldAccess } from './access'; -import { uiFieldAddress } from './address'; -import { uiFieldCycleway } from './cycleway'; -import { uiFieldLanes } from './lanes'; -import { uiFieldLocalized } from './localized'; -import { uiFieldRoadspeed } from './roadspeed'; -// import { uiFieldRestrictions } from './restrictions'; -import { uiFieldTextarea } from './textarea'; -import { uiFieldWikidata } from './wikidata'; -import { uiFieldWikipedia } from './wikipedia'; +import { uiFieldAccess } from './access.js'; +import { uiFieldAddress } from './address.js'; +import { uiFieldCycleway } from './cycleway.js'; +import { uiFieldLanes } from './lanes.js'; +import { uiFieldLocalized } from './localized.js'; +import { uiFieldRoadspeed } from './roadspeed.js'; +// import { uiFieldRestrictions } from './restrictions.js'; +import { uiFieldTextarea } from './textarea.js'; +import { uiFieldWikidata } from './wikidata.js'; +import { uiFieldWikipedia } from './wikipedia.js'; export var uiFields = { access: uiFieldAccess, diff --git a/modules/ui/fields/input.js b/modules/ui/fields/input.js index 3968ecbb71..fe74e1c6d2 100644 --- a/modules/ui/fields/input.js +++ b/modules/ui/fields/input.js @@ -2,8 +2,8 @@ import { dispatch as d3_dispatch } from 'd3-dispatch'; import { select as d3_select } from 'd3-selection'; import { iso1A2Code } from '@rapideditor/country-coder'; -import { utilGetSetValue, utilNoAuto, utilRebind } from '../../util'; -import { uiIcon } from '../icon'; +import { utilGetSetValue, utilNoAuto, utilRebind } from '../../util/index.js'; +import { uiIcon } from '../icon.js'; export { uiFieldText as uiFieldUrl, diff --git a/modules/ui/fields/lanes.js b/modules/ui/fields/lanes.js index b58b098b30..12899050e8 100644 --- a/modules/ui/fields/lanes.js +++ b/modules/ui/fields/lanes.js @@ -1,7 +1,7 @@ import { dispatch as d3_dispatch } from 'd3-dispatch'; -import { utilRebind } from '../../util/rebind'; -import { utilGetDimensions } from '../../util/dimensions'; +import { utilRebind } from '../../util/rebind.js'; +import { utilGetDimensions } from '../../util/dimensions.js'; export function uiFieldLanes(context, uifield) { diff --git a/modules/ui/fields/localized.js b/modules/ui/fields/localized.js index 74dec88a28..2af1ffbb86 100644 --- a/modules/ui/fields/localized.js +++ b/modules/ui/fields/localized.js @@ -3,10 +3,10 @@ import { select as d3_select } from 'd3-selection'; import { utilArrayUniq, utilUniqueString } from '@rapid-sdk/util'; import { iso1A2Code } from '@rapideditor/country-coder'; -import { uiIcon } from '../icon'; -import { uiTooltip } from '../tooltip'; -import { uiCombobox } from '../combobox'; -import { utilGetSetValue, utilNoAuto, utilRebind } from '../../util'; +import { uiIcon } from '../icon.js'; +import { uiTooltip } from '../tooltip.js'; +import { uiCombobox } from '../combobox.js'; +import { utilGetSetValue, utilNoAuto, utilRebind } from '../../util/index.js'; var _languagesArray = []; diff --git a/modules/ui/fields/radio.js b/modules/ui/fields/radio.js index dde07922f3..adc68ce02b 100644 --- a/modules/ui/fields/radio.js +++ b/modules/ui/fields/radio.js @@ -2,8 +2,8 @@ import { dispatch as d3_dispatch } from 'd3-dispatch'; import { select as d3_select } from 'd3-selection'; import { utilArrayUnion } from '@rapid-sdk/util'; -import { UiField } from '../UiField'; -import { utilRebind } from '../../util'; +import { UiField } from '../UiField.js'; +import { utilRebind } from '../../util/index.js'; export { uiFieldRadio as uiFieldStructureRadio }; diff --git a/modules/ui/fields/restrictions.js b/modules/ui/fields/restrictions.js index 22bac003c1..951df6f19d 100644 --- a/modules/ui/fields/restrictions.js +++ b/modules/ui/fields/restrictions.js @@ -3,12 +3,12 @@ //import { Extent, Projection, geoZoomToScale, vecScale, vecSubtract } from '@rapid-sdk/math'; //import { utilEntitySelector } from '@rapid-sdk/util'; // -//import { actionRestrictTurn } from '../../actions/restrict_turn'; -//import { actionUnrestrictTurn } from '../../actions/unrestrict_turn'; -//import { osmIntersection, osmInferRestriction, osmTurn, osmWay } from '../../osm'; -//import { svgLayers, svgLines, svgTurns, svgVertices } from '../../svg'; -//import { utilFunctor, utilRebind } from '../../util'; -//import { utilGetDimensions, utilSetDimensions } from '../../util/dimensions'; +//import { actionRestrictTurn } from '../../actions/restrict_turn.js'; +//import { actionUnrestrictTurn } from '../../actions/unrestrict_turn.js'; +//import { osmIntersection, osmInferRestriction, osmTurn, osmWay } from '../../osm/index.js'; +//import { svgLayers, svgLines, svgTurns, svgVertices } from '../../svg/index.js'; +//import { utilFunctor, utilRebind } from '../../util/index.js'; +//import { utilGetDimensions, utilSetDimensions } from '../../util/dimensions.js'; // // //export function uiFieldRestrictions(context, uifield) { diff --git a/modules/ui/fields/roadspeed.js b/modules/ui/fields/roadspeed.js index 7500f7cecf..7eb8c9f1e5 100644 --- a/modules/ui/fields/roadspeed.js +++ b/modules/ui/fields/roadspeed.js @@ -2,8 +2,8 @@ import { dispatch as d3_dispatch } from 'd3-dispatch'; import { select as d3_select } from 'd3-selection'; import { roadSpeedUnit } from '@rapideditor/country-coder'; -import { uiCombobox } from '../combobox'; -import { utilGetSetValue, utilNoAuto, utilRebind } from '../../util'; +import { uiCombobox } from '../combobox.js'; +import { utilGetSetValue, utilNoAuto, utilRebind } from '../../util/index.js'; export function uiFieldRoadspeed(context, uifield) { diff --git a/modules/ui/fields/textarea.js b/modules/ui/fields/textarea.js index c436aab879..97fc9582f7 100644 --- a/modules/ui/fields/textarea.js +++ b/modules/ui/fields/textarea.js @@ -1,7 +1,7 @@ import { dispatch as d3_dispatch } from 'd3-dispatch'; import { select as d3_select } from 'd3-selection'; -import { utilGetSetValue, utilNoAuto, utilRebind } from '../../util'; +import { utilGetSetValue, utilNoAuto, utilRebind } from '../../util/index.js'; export function uiFieldTextarea(context, uifield) { diff --git a/modules/ui/fields/wikidata.js b/modules/ui/fields/wikidata.js index dbd54ad6a0..01b4517ceb 100644 --- a/modules/ui/fields/wikidata.js +++ b/modules/ui/fields/wikidata.js @@ -1,10 +1,10 @@ import { dispatch as d3_dispatch } from 'd3-dispatch'; import { select as d3_select } from 'd3-selection'; -import { actionChangeTags } from '../../actions/change_tags'; -import { uiIcon } from '../icon'; -import { utilGetSetValue, utilNoAuto, utilRebind } from '../../util'; -import { uiCombobox } from '../combobox'; +import { actionChangeTags } from '../../actions/change_tags.js'; +import { uiIcon } from '../icon.js'; +import { utilGetSetValue, utilNoAuto, utilRebind } from '../../util/index.js'; +import { uiCombobox } from '../combobox.js'; export function uiFieldWikidata(context, uifield) { diff --git a/modules/ui/fields/wikipedia.js b/modules/ui/fields/wikipedia.js index dc68ada9b8..7a50b44b01 100644 --- a/modules/ui/fields/wikipedia.js +++ b/modules/ui/fields/wikipedia.js @@ -1,10 +1,10 @@ import { dispatch as d3_dispatch } from 'd3-dispatch'; import { select as d3_select } from 'd3-selection'; -import { actionChangeTags } from '../../actions/change_tags'; -import { uiIcon } from '../icon'; -import { uiCombobox } from '../combobox'; -import { utilGetSetValue, utilNoAuto, utilRebind } from '../../util'; +import { actionChangeTags } from '../../actions/change_tags.js'; +import { uiIcon } from '../icon.js'; +import { uiCombobox } from '../combobox.js'; +import { utilGetSetValue, utilNoAuto, utilRebind } from '../../util/index.js'; export function uiFieldWikipedia(context, uifield) { diff --git a/modules/ui/form_fields.js b/modules/ui/form_fields.js index 279d58fef8..68db124b28 100644 --- a/modules/ui/form_fields.js +++ b/modules/ui/form_fields.js @@ -1,7 +1,7 @@ import { select as d3_select } from 'd3-selection'; -import { uiCombobox } from './combobox'; -import { utilGetSetValue, utilNoAuto } from '../util'; +import { uiCombobox } from './combobox.js'; +import { utilGetSetValue, utilNoAuto } from '../util/index.js'; export function uiFormFields(context) { diff --git a/modules/ui/full_screen.js b/modules/ui/full_screen.js index f2a04fff9b..acb052490e 100644 --- a/modules/ui/full_screen.js +++ b/modules/ui/full_screen.js @@ -1,5 +1,5 @@ -import { uiCmd } from './cmd'; -import { utilDetect } from '../util/detect'; +import { uiCmd } from './cmd.js'; +import { utilDetect } from '../util/detect.js'; export function uiFullScreen(context) { var element = context.container().node(); diff --git a/modules/ui/geolocate.js b/modules/ui/geolocate.js index be72027208..86f41bb04c 100644 --- a/modules/ui/geolocate.js +++ b/modules/ui/geolocate.js @@ -1,9 +1,9 @@ import { select as d3_select } from 'd3-selection'; import { Extent } from '@rapid-sdk/math'; -import { uiTooltip } from './tooltip'; -import { uiIcon } from './icon'; -import { uiLoading } from './loading'; +import { uiIcon } from './icon.js'; +import { uiLoading } from './loading.js'; +import { uiTooltip } from './tooltip.js'; const GEOLOCATE_TIMEOUT = 10000; // 10 sec const GEOLOCATE_REPEAT = 2000; // 2 sec diff --git a/modules/ui/improveOSM_comments.js b/modules/ui/improveOSM_comments.js index 49314707d7..fe2944c9d3 100644 --- a/modules/ui/improveOSM_comments.js +++ b/modules/ui/improveOSM_comments.js @@ -1,6 +1,6 @@ import { select as d3_select } from 'd3-selection'; -import { uiIcon } from './icon'; +import { uiIcon } from './icon.js'; export function uiImproveOsmComments(context) { diff --git a/modules/ui/improveOSM_details.js b/modules/ui/improveOSM_details.js index a4dc216ac7..a9c6486b91 100644 --- a/modules/ui/improveOSM_details.js +++ b/modules/ui/improveOSM_details.js @@ -1,6 +1,6 @@ import { select as d3_select } from 'd3-selection'; -import { utilHighlightEntities } from '../util'; +import { utilHighlightEntities } from '../util/index.js'; export function uiImproveOsmDetails(context) { diff --git a/modules/ui/improveOSM_editor.js b/modules/ui/improveOSM_editor.js index 1809400712..a77eb26f35 100644 --- a/modules/ui/improveOSM_editor.js +++ b/modules/ui/improveOSM_editor.js @@ -1,11 +1,11 @@ import { dispatch as d3_dispatch } from 'd3-dispatch'; import { select as d3_select } from 'd3-selection'; -import { uiIcon } from './icon'; -import { uiImproveOsmComments } from './improveOSM_comments'; -import { uiImproveOsmDetails } from './improveOSM_details'; -import { uiImproveOsmHeader } from './improveOSM_header'; -import { utilNoAuto, utilRebind } from '../util'; +import { uiIcon } from './icon.js'; +import { uiImproveOsmComments } from './improveOSM_comments.js'; +import { uiImproveOsmDetails } from './improveOSM_details.js'; +import { uiImproveOsmHeader } from './improveOSM_header.js'; +import { utilNoAuto, utilRebind } from '../util/index.js'; export function uiImproveOsmEditor(context) { diff --git a/modules/ui/index.js b/modules/ui/index.js index 7c183fd065..b0c7694170 100644 --- a/modules/ui/index.js +++ b/modules/ui/index.js @@ -1,81 +1,81 @@ -export { uiAccount } from './account'; -export { uiAttribution } from './attribution'; -export { uiChangesetEditor } from './changeset_editor'; -export { uiCmd } from './cmd'; -export { uiCombobox } from './combobox'; -export { uiCommit } from './commit'; -export { uiCommitWarnings } from './commit_warnings'; -export { uiConfirm } from './confirm'; -export { uiConflicts } from './conflicts'; -export { uiContributors } from './contributors'; -export { uiDataEditor } from './data_editor'; -export { uiDataHeader } from './data_header'; -export { UiDefs } from './UiDefs'; -export { uiDisclosure } from './disclosure'; -export { uiEditMenu } from './edit_menu'; -export { uiEntityEditor } from './entity_editor'; -export { uiFeatureInfo } from './feature_info'; -export { uiFeatureList } from './feature_list'; -export { UiField } from './UiField'; -// export { uiFieldHelp } from './field_help'; -export { uiFlash } from './flash'; -export { uiFormFields } from './form_fields'; -export { uiFullScreen } from './full_screen'; -export { uiGeolocate } from './geolocate'; -export { uiIcon } from './icon'; -export { uiImproveOsmComments } from './improveOSM_comments'; -export { uiImproveOsmDetails } from './improveOSM_details'; -export { uiImproveOsmEditor } from './improveOSM_editor'; -export { uiImproveOsmHeader } from './improveOSM_header'; -export { uiIntro } from './intro/intro'; -export { uiInfo } from './info'; -export { uiInspector } from './inspector'; -export { uiIssuesInfo } from './issues_info'; -export { uiKeepRightDetails } from './keepRight_details'; -export { uiKeepRightEditor } from './keepRight_editor'; -export { uiKeepRightHeader } from './keepRight_header'; -export { uiLoading } from './loading'; -export { uiMap3dViewer } from './map3d_viewer'; -export { uiMapInMap } from './map_in_map'; -export { uiModal } from './modal'; -export { uiNoteComments } from './note_comments'; -export { uiNoteEditor } from './note_editor'; -export { uiNoteHeader } from './note_header'; -export { uiNoteReport } from './note_report'; -export { uiOsmoseDetails } from './osmose_details'; -export { uiOsmoseEditor } from './osmose_editor'; -export { uiOsmoseHeader } from './osmose_header'; -export { uiPane } from './pane'; -export { uiPhotoViewer } from './photo_viewer'; -export { uiPopover } from './popover'; -export { uiPresetIcon } from './preset_icon'; -export { uiPresetList } from './preset_list'; -export { uiRapidColorpicker } from './rapid_colorpicker'; -export { uiRapidFeatureInspector } from './rapid_feature_inspector'; -export { uiRapidFeatureToggleDialog } from './rapid_feature_toggle_dialog'; -export { uiRapidFirstEditDialog } from './rapid_first_edit_dialog'; -export { uiRapidPowerUserFeaturesDialog } from './rapid_poweruser_features_dialog'; -export { uiRapidServiceLicense } from './rapid_service_license'; -export { uiRapidSplash } from './rapid_splash'; -export { uiRapidViewManageDatasets } from './rapid_view_manage_datasets'; -export { uiRapidWhatsNew } from './rapid_whatsnew'; -export { uiRestore } from './restore'; -export { uiScale } from './scale'; -export { uiSection } from './section'; -export { uiShortcuts } from './shortcuts'; -export { uiSidebar } from './sidebar'; -export { uiSourceSwitch } from './source_switch'; -export { uiSpinner } from './spinner'; -export { uiSplash } from './splash'; -export { uiStatus } from './status'; -export { uiSuccess } from './success'; -export { uiTagReference } from './tag_reference'; -export { uiToggle } from './toggle'; -export { uiTooltip } from './tooltip'; -export { uiTopToolbar } from './top_toolbar'; -export { uiVersion } from './version'; -export { uiViewOnKeepRight } from './view_on_keepRight'; -export { uiViewOnOSM } from './view_on_osm'; -export { uiViewOnOsmose } from './view_on_osmose'; -export { uiZoom } from './zoom'; -export { uiZoomToSelection } from './zoom_to_selection'; +export { uiAccount } from './account.js'; +export { uiAttribution } from './attribution.js'; +export { uiChangesetEditor } from './changeset_editor.js'; +export { uiCmd } from './cmd.js'; +export { uiCombobox } from './combobox.js'; +export { uiCommit } from './commit.js'; +export { uiCommitWarnings } from './commit_warnings.js'; +export { uiConfirm } from './confirm.js'; +export { uiConflicts } from './conflicts.js'; +export { uiContributors } from './contributors.js'; +export { uiDataEditor } from './data_editor.js'; +export { uiDataHeader } from './data_header.js'; +export { UiDefs } from './UiDefs.js'; +export { uiDisclosure } from './disclosure.js'; +export { uiEditMenu } from './edit_menu.js'; +export { uiEntityEditor } from './entity_editor.js'; +export { uiFeatureInfo } from './feature_info.js'; +export { uiFeatureList } from './feature_list.js'; +export { UiField } from './UiField.js'; +// export { uiFieldHelp } from './field_help.js'; +export { uiFlash } from './flash.js'; +export { uiFormFields } from './form_fields.js'; +export { uiFullScreen } from './full_screen.js'; +export { uiGeolocate } from './geolocate.js'; +export { uiIcon } from './icon.js'; +export { uiImproveOsmComments } from './improveOSM_comments.js'; +export { uiImproveOsmDetails } from './improveOSM_details.js'; +export { uiImproveOsmEditor } from './improveOSM_editor.js'; +export { uiImproveOsmHeader } from './improveOSM_header.js'; +export { uiIntro } from './intro/intro.js'; +export { uiInfo } from './info.js'; +export { uiInspector } from './inspector.js'; +export { uiIssuesInfo } from './issues_info.js'; +export { uiKeepRightDetails } from './keepRight_details.js'; +export { uiKeepRightEditor } from './keepRight_editor.js'; +export { uiKeepRightHeader } from './keepRight_header.js'; +export { uiLoading } from './loading.js'; +export { uiMap3dViewer } from './map3d_viewer.js'; +export { uiMapInMap } from './map_in_map.js'; +export { uiModal } from './modal.js'; +export { uiNoteComments } from './note_comments.js'; +export { uiNoteEditor } from './note_editor.js'; +export { uiNoteHeader } from './note_header.js'; +export { uiNoteReport } from './note_report.js'; +export { uiOsmoseDetails } from './osmose_details.js'; +export { uiOsmoseEditor } from './osmose_editor.js'; +export { uiOsmoseHeader } from './osmose_header.js'; +export { uiPane } from './pane.js'; +export { uiPhotoViewer } from './photo_viewer.js'; +export { uiPopover } from './popover.js'; +export { uiPresetIcon } from './preset_icon.js'; +export { uiPresetList } from './preset_list.js'; +export { uiRapidColorpicker } from './rapid_colorpicker.js'; +export { uiRapidFeatureInspector } from './rapid_feature_inspector.js'; +export { uiRapidFeatureToggleDialog } from './rapid_feature_toggle_dialog.js'; +export { uiRapidFirstEditDialog } from './rapid_first_edit_dialog.js'; +export { uiRapidPowerUserFeaturesDialog } from './rapid_poweruser_features_dialog.js'; +export { uiRapidServiceLicense } from './rapid_service_license.js'; +export { uiRapidSplash } from './rapid_splash.js'; +export { uiRapidViewManageDatasets } from './rapid_view_manage_datasets.js'; +export { uiRapidWhatsNew } from './rapid_whatsnew.js'; +export { uiRestore } from './restore.js'; +export { uiScale } from './scale.js'; +export { uiSection } from './section.js'; +export { uiShortcuts } from './shortcuts.js'; +export { uiSidebar } from './sidebar.js'; +export { uiSourceSwitch } from './source_switch.js'; +export { uiSpinner } from './spinner.js'; +export { uiSplash } from './splash.js'; +export { uiStatus } from './status.js'; +export { uiSuccess } from './success.js'; +export { uiTagReference } from './tag_reference.js'; +export { uiToggle } from './toggle.js'; +export { uiTooltip } from './tooltip.js'; +export { uiTopToolbar } from './top_toolbar.js'; +export { uiVersion } from './version.js'; +export { uiViewOnKeepRight } from './view_on_keepRight.js'; +export { uiViewOnOSM } from './view_on_osm.js'; +export { uiViewOnOsmose } from './view_on_osmose.js'; +export { uiZoom } from './zoom.js'; +export { uiZoomToSelection } from './zoom_to_selection.js'; diff --git a/modules/ui/info.js b/modules/ui/info.js index 6707fe52a2..3b817a7d16 100644 --- a/modules/ui/info.js +++ b/modules/ui/info.js @@ -1,12 +1,12 @@ import { select as d3_select } from 'd3-selection'; -import { uiIcon } from './icon'; -import { uiCmd } from './cmd'; +import { uiIcon } from './icon.js'; +import { uiCmd } from './cmd.js'; -import { UiPanelBackground } from './panels/UiPanelBackground'; -import { UiPanelHistory } from './panels/UiPanelHistory'; -import { UiPanelLocation } from './panels/UiPanelLocation'; -import { UiPanelMeasurement } from './panels/UiPanelMeasurement'; +import { UiPanelBackground } from './panels/UiPanelBackground.js'; +import { UiPanelHistory } from './panels/UiPanelHistory.js'; +import { UiPanelLocation } from './panels/UiPanelLocation.js'; +import { UiPanelMeasurement } from './panels/UiPanelMeasurement.js'; /** diff --git a/modules/ui/inspector.js b/modules/ui/inspector.js index f5e772b8a5..7a8e27f83b 100644 --- a/modules/ui/inspector.js +++ b/modules/ui/inspector.js @@ -1,9 +1,9 @@ import { interpolate as d3_interpolate } from 'd3-interpolate'; import { select as d3_select } from 'd3-selection'; -import { uiEntityEditor } from './entity_editor'; -import { uiPresetList } from './preset_list'; -import { uiViewOnOSM } from './view_on_osm'; +import { uiEntityEditor } from './entity_editor.js'; +import { uiPresetList } from './preset_list.js'; +import { uiViewOnOSM } from './view_on_osm.js'; // The Inspector is a UI component for viewing/editing OSM Entities in the sidebar. diff --git a/modules/ui/intro/UiCurtain.js b/modules/ui/intro/UiCurtain.js index e0a27d7bc4..2ef8a89931 100644 --- a/modules/ui/intro/UiCurtain.js +++ b/modules/ui/intro/UiCurtain.js @@ -2,7 +2,7 @@ import { Extent, vecAdd } from '@rapid-sdk/math'; import { easeLinear as d3_easeLinear } from 'd3-ease'; import { select as d3_select } from 'd3-selection'; -import { uiToggle } from '../toggle'; +import { uiToggle } from '../toggle.js'; function clamp(num, min, max) { return Math.max(min, Math.min(num, max)); diff --git a/modules/ui/intro/area.js b/modules/ui/intro/area.js index 04f3e49d09..06e93ea26a 100644 --- a/modules/ui/intro/area.js +++ b/modules/ui/intro/area.js @@ -2,8 +2,8 @@ import { Extent } from '@rapid-sdk/math'; import { dispatch as d3_dispatch } from 'd3-dispatch'; import { interpolateNumber as d3_interpolateNumber } from 'd3-interpolate'; -import { utilRebind } from '../../util/rebind'; -import { delayAsync, eventCancel, helpHtml, icon, transitionTime } from './helper'; +import { utilRebind } from '../../util/rebind.js'; +import { delayAsync, eventCancel, helpHtml, icon, transitionTime } from './helper.js'; export function uiIntroArea(context, curtain) { diff --git a/modules/ui/intro/building.js b/modules/ui/intro/building.js index 72365b19eb..0935c761ef 100644 --- a/modules/ui/intro/building.js +++ b/modules/ui/intro/building.js @@ -2,9 +2,9 @@ import { Extent } from '@rapid-sdk/math'; import { dispatch as d3_dispatch } from 'd3-dispatch'; import { utilArrayUniq } from '@rapid-sdk/util'; -import { actionChangePreset } from '../../actions/change_preset'; -import { utilRebind } from '../../util'; -import { delayAsync, eventCancel, helpHtml, isMostlySquare, transitionTime } from './helper'; +import { actionChangePreset } from '../../actions/change_preset.js'; +import { utilRebind } from '../../util/index.js'; +import { delayAsync, eventCancel, helpHtml, isMostlySquare, transitionTime } from './helper.js'; export function uiIntroBuilding(context, curtain) { diff --git a/modules/ui/intro/helper.js b/modules/ui/intro/helper.js index d7fb64cbd2..1ac1023d45 100644 --- a/modules/ui/intro/helper.js +++ b/modules/ui/intro/helper.js @@ -1,5 +1,5 @@ import { geoSphericalDistance, vecNormalizedDot } from '@rapid-sdk/math'; -import { uiCmd } from '../cmd'; +import { uiCmd } from '../cmd.js'; /** * insert an icon diff --git a/modules/ui/intro/intro.js b/modules/ui/intro/intro.js index 1aa248ac64..286c50b9ea 100644 --- a/modules/ui/intro/intro.js +++ b/modules/ui/intro/intro.js @@ -1,18 +1,18 @@ import { utilArrayDifference, utilArrayUniq } from '@rapid-sdk/util'; -import { localize } from './helper'; -import { osmEntity } from '../../osm/entity'; -import { uiIcon } from '../icon'; - -import { UiCurtain } from './UiCurtain'; -import { uiIntroWelcome } from './welcome'; -import { uiIntroNavigation } from './navigation'; -import { uiIntroPoint } from './point'; -import { uiIntroArea } from './area'; -import { uiIntroLine } from './line'; -import { uiIntroBuilding } from './building'; -import { uiIntroStartEditing } from './start_editing'; -import { uiIntroRapid } from './rapid'; +import { localize } from './helper.js'; +import { osmEntity } from '../../osm/entity.js'; +import { uiIcon } from '../icon.js'; +import { UiCurtain } from './UiCurtain.js'; + +import { uiIntroWelcome } from './welcome.js'; +import { uiIntroNavigation } from './navigation.js'; +import { uiIntroPoint } from './point.js'; +import { uiIntroArea } from './area.js'; +import { uiIntroLine } from './line.js'; +import { uiIntroBuilding } from './building.js'; +import { uiIntroStartEditing } from './start_editing.js'; +import { uiIntroRapid } from './rapid.js'; const INTRO_IMAGERY = 'EsriWorldImageryClarity'; diff --git a/modules/ui/intro/line.js b/modules/ui/intro/line.js index 12dc72e69f..4dfff41fd9 100644 --- a/modules/ui/intro/line.js +++ b/modules/ui/intro/line.js @@ -1,8 +1,8 @@ import { Extent, geoSphericalDistance } from '@rapid-sdk/math'; import { dispatch as d3_dispatch } from 'd3-dispatch'; -import { utilRebind } from '../../util/rebind'; -import { delayAsync, eventCancel, helpHtml, icon, transitionTime } from './helper'; +import { utilRebind } from '../../util/rebind.js'; +import { delayAsync, eventCancel, helpHtml, icon, transitionTime } from './helper.js'; export function uiIntroLine(context, curtain) { diff --git a/modules/ui/intro/navigation.js b/modules/ui/intro/navigation.js index 283dc1bebb..0617e627c3 100644 --- a/modules/ui/intro/navigation.js +++ b/modules/ui/intro/navigation.js @@ -2,8 +2,8 @@ import { Extent, vecEqual } from '@rapid-sdk/math'; import { dispatch as d3_dispatch } from 'd3-dispatch'; import { select as d3_select } from 'd3-selection'; -import { utilRebind } from '../../util/rebind'; -import { delayAsync, eventCancel, helpHtml, icon, transitionTime } from './helper'; +import { utilRebind } from '../../util/rebind.js'; +import { delayAsync, eventCancel, helpHtml, icon, transitionTime } from './helper.js'; export function uiIntroNavigation(context, curtain) { diff --git a/modules/ui/intro/point.js b/modules/ui/intro/point.js index 32aba90359..30d0b8bd18 100644 --- a/modules/ui/intro/point.js +++ b/modules/ui/intro/point.js @@ -2,9 +2,9 @@ import { Extent } from '@rapid-sdk/math'; import { dispatch as d3_dispatch } from 'd3-dispatch'; import { select as d3_select } from 'd3-selection'; -import { actionChangePreset } from '../../actions/change_preset'; -import { utilRebind } from '../../util/rebind'; -import { delayAsync, eventCancel, helpHtml, icon, transitionTime } from './helper'; +import { actionChangePreset } from '../../actions/change_preset.js'; +import { utilRebind } from '../../util/rebind.js'; +import { delayAsync, eventCancel, helpHtml, icon, transitionTime } from './helper.js'; export function uiIntroPoint(context, curtain) { diff --git a/modules/ui/intro/rapid.js b/modules/ui/intro/rapid.js index 57a9d0cccf..31d94b08fc 100644 --- a/modules/ui/intro/rapid.js +++ b/modules/ui/intro/rapid.js @@ -2,8 +2,8 @@ import { Extent } from '@rapid-sdk/math'; import { dispatch as d3_dispatch } from 'd3-dispatch'; import { select as d3_select } from 'd3-selection'; -import { utilRebind } from '../../util/rebind'; -import { delayAsync, eventCancel, helpHtml, icon, transitionTime } from './helper'; +import { utilRebind } from '../../util/rebind.js'; +import { delayAsync, eventCancel, helpHtml, icon, transitionTime } from './helper.js'; export function uiIntroRapid(context, curtain) { diff --git a/modules/ui/intro/start_editing.js b/modules/ui/intro/start_editing.js index 5eaec57c7f..0f6c1bd95b 100644 --- a/modules/ui/intro/start_editing.js +++ b/modules/ui/intro/start_editing.js @@ -1,8 +1,8 @@ import { dispatch as d3_dispatch } from 'd3-dispatch'; -import { helpHtml } from './helper'; -import { uiModal } from '../modal'; -import { utilRebind } from '../../util/rebind'; +import { helpHtml } from './helper.js'; +import { uiModal } from '../modal.js'; +import { utilRebind } from '../../util/rebind.js'; export function uiIntroStartEditing(context, curtain) { diff --git a/modules/ui/intro/welcome.js b/modules/ui/intro/welcome.js index 02bf171ae3..0c0cce06f2 100644 --- a/modules/ui/intro/welcome.js +++ b/modules/ui/intro/welcome.js @@ -1,8 +1,8 @@ import { Extent } from '@rapid-sdk/math'; import { dispatch as d3_dispatch } from 'd3-dispatch'; -import { helpHtml } from './helper'; -import { utilRebind } from '../../util/rebind'; +import { helpHtml } from './helper.js'; +import { utilRebind } from '../../util/rebind.js'; export function uiIntroWelcome(context, curtain) { diff --git a/modules/ui/issues_info.js b/modules/ui/issues_info.js index 33d04da84e..edda905a01 100644 --- a/modules/ui/issues_info.js +++ b/modules/ui/issues_info.js @@ -1,7 +1,7 @@ import { select as d3_select } from 'd3-selection'; -import { uiIcon } from './icon'; -import { uiTooltip } from './tooltip'; +import { uiIcon } from './icon.js'; +import { uiTooltip } from './tooltip.js'; export function uiIssuesInfo(context) { diff --git a/modules/ui/keepRight_details.js b/modules/ui/keepRight_details.js index 2737a73fed..1e994eee08 100644 --- a/modules/ui/keepRight_details.js +++ b/modules/ui/keepRight_details.js @@ -1,6 +1,6 @@ import { select as d3_select } from 'd3-selection'; -import { utilHighlightEntities } from '../util'; +import { utilHighlightEntities } from '../util/index.js'; export function uiKeepRightDetails(context) { diff --git a/modules/ui/keepRight_editor.js b/modules/ui/keepRight_editor.js index 6f04b80158..3f1f5a4ea6 100644 --- a/modules/ui/keepRight_editor.js +++ b/modules/ui/keepRight_editor.js @@ -1,11 +1,11 @@ import { dispatch as d3_dispatch } from 'd3-dispatch'; import { select as d3_select } from 'd3-selection'; -import { uiIcon } from './icon'; -import { uiKeepRightDetails } from './keepRight_details'; -import { uiKeepRightHeader } from './keepRight_header'; -import { uiViewOnKeepRight } from './view_on_keepRight'; -import { utilNoAuto, utilRebind } from '../util'; +import { uiIcon } from './icon.js'; +import { uiKeepRightDetails } from './keepRight_details.js'; +import { uiKeepRightHeader } from './keepRight_header.js'; +import { uiViewOnKeepRight } from './view_on_keepRight.js'; +import { utilNoAuto, utilRebind } from '../util/index.js'; export function uiKeepRightEditor(context) { diff --git a/modules/ui/keepRight_header.js b/modules/ui/keepRight_header.js index 119df652ae..0508e45d65 100644 --- a/modules/ui/keepRight_header.js +++ b/modules/ui/keepRight_header.js @@ -1,6 +1,6 @@ import { Color } from 'pixi.js'; -import { uiIcon } from './icon'; +import { uiIcon } from './icon.js'; export function uiKeepRightHeader(context) { diff --git a/modules/ui/loading.js b/modules/ui/loading.js index 1fff8d72cc..52023a06f0 100644 --- a/modules/ui/loading.js +++ b/modules/ui/loading.js @@ -1,5 +1,6 @@ import { select as d3_select } from 'd3-selection'; -import { uiModal } from './modal'; + +import { uiModal } from './modal.js'; export function uiLoading(context) { diff --git a/modules/ui/map3d_viewer.js b/modules/ui/map3d_viewer.js index 12934859fe..b8f506d01a 100644 --- a/modules/ui/map3d_viewer.js +++ b/modules/ui/map3d_viewer.js @@ -1,8 +1,8 @@ import { Color } from 'pixi.js'; +import { geomPolygonContainsPolygon } from '@rapid-sdk/math'; import { select as d3_select } from 'd3-selection'; -import { uiCmd } from './cmd'; -import { geomPolygonContainsPolygon } from '@rapid-sdk/math'; +import { uiCmd } from './cmd.js'; /* * uiMap3dViewer is a ui panel containing a maplibre 3D Map for visualizing buildings, roads, and areas. diff --git a/modules/ui/map_in_map.js b/modules/ui/map_in_map.js index 642bd921cc..f029938082 100644 --- a/modules/ui/map_in_map.js +++ b/modules/ui/map_in_map.js @@ -3,8 +3,8 @@ import { select as d3_select } from 'd3-selection'; import { zoom as d3_zoom, zoomIdentity as d3_zoomIdentity } from 'd3-zoom'; import { Projection, geoScaleToZoom, geoZoomToScale, vecScale, vecSubtract } from '@rapid-sdk/math'; -import { utilSetTransform } from '../util'; -import { PixiLayerBackgroundTiles } from '../pixi/PixiLayerBackgroundTiles'; +import { PixiLayerBackgroundTiles } from '../pixi/PixiLayerBackgroundTiles.js'; +import { utilSetTransform } from '../util/index.js'; export function uiMapInMap(context) { diff --git a/modules/ui/modal.js b/modules/ui/modal.js index ef885ade6f..0ef8197667 100644 --- a/modules/ui/modal.js +++ b/modules/ui/modal.js @@ -1,7 +1,7 @@ import { select as d3_select } from 'd3-selection'; -import { uiIcon } from './icon'; -import { utilKeybinding } from '../util'; +import { uiIcon } from './icon.js'; +import { utilKeybinding } from '../util/index.js'; export function uiModal(selection, blocking) { diff --git a/modules/ui/note_comments.js b/modules/ui/note_comments.js index 61f6b57087..e9f33cea8a 100644 --- a/modules/ui/note_comments.js +++ b/modules/ui/note_comments.js @@ -1,6 +1,6 @@ import { select as d3_select } from 'd3-selection'; -import { uiIcon } from './icon'; +import { uiIcon } from './icon.js'; export function uiNoteComments(context) { diff --git a/modules/ui/note_editor.js b/modules/ui/note_editor.js index 9ef3293e21..a369312ef5 100644 --- a/modules/ui/note_editor.js +++ b/modules/ui/note_editor.js @@ -1,13 +1,12 @@ import { dispatch as d3_dispatch } from 'd3-dispatch'; import { select as d3_select } from 'd3-selection'; -import { uiIcon } from './icon'; - -import { uiNoteComments } from './note_comments'; -import { uiNoteHeader } from './note_header'; -import { uiNoteReport } from './note_report'; -import { uiViewOnOSM } from './view_on_osm'; -import { utilNoAuto, utilRebind } from '../util'; +import { uiIcon } from './icon.js'; +import { uiNoteComments } from './note_comments.js'; +import { uiNoteHeader } from './note_header.js'; +import { uiNoteReport } from './note_report.js'; +import { uiViewOnOSM } from './view_on_osm.js'; +import { utilNoAuto, utilRebind } from '../util/index.js'; export function uiNoteEditor(context) { diff --git a/modules/ui/note_header.js b/modules/ui/note_header.js index b099e2bf99..4642a52b54 100644 --- a/modules/ui/note_header.js +++ b/modules/ui/note_header.js @@ -1,4 +1,4 @@ -import { uiIcon } from './icon'; +import { uiIcon } from './icon.js'; export function uiNoteHeader(context) { diff --git a/modules/ui/note_report.js b/modules/ui/note_report.js index efdaec692f..a2b634bdcb 100644 --- a/modules/ui/note_report.js +++ b/modules/ui/note_report.js @@ -1,5 +1,5 @@ -import { osmNote } from '../osm'; -import { uiIcon } from './icon'; +import { osmNote } from '../osm/note.js'; +import { uiIcon } from './icon.js'; export function uiNoteReport(context) { diff --git a/modules/ui/osmose_details.js b/modules/ui/osmose_details.js index 7be192ac5a..880cbc892a 100644 --- a/modules/ui/osmose_details.js +++ b/modules/ui/osmose_details.js @@ -1,6 +1,6 @@ import { select as d3_select } from 'd3-selection'; -import { utilHighlightEntities } from '../util'; +import { utilHighlightEntities } from '../util/index.js'; export function uiOsmoseDetails(context) { diff --git a/modules/ui/osmose_editor.js b/modules/ui/osmose_editor.js index 2550c1d2ce..e38dbced9b 100644 --- a/modules/ui/osmose_editor.js +++ b/modules/ui/osmose_editor.js @@ -1,11 +1,10 @@ import { dispatch as d3_dispatch } from 'd3-dispatch'; -import { uiIcon } from './icon'; - -import { uiOsmoseDetails } from './osmose_details'; -import { uiOsmoseHeader } from './osmose_header'; -import { uiViewOnOsmose } from './view_on_osmose'; -import { utilRebind } from '../util'; +import { uiOsmoseDetails } from './osmose_details.js'; +import { uiOsmoseHeader } from './osmose_header.js'; +import { uiIcon } from './icon.js'; +import { uiViewOnOsmose } from './view_on_osmose.js'; +import { utilRebind } from '../util/index.js'; export function uiOsmoseEditor(context) { diff --git a/modules/ui/pane.js b/modules/ui/pane.js index f2a3816b03..418ddbb68e 100644 --- a/modules/ui/pane.js +++ b/modules/ui/pane.js @@ -1,7 +1,7 @@ import { select as d3_select } from 'd3-selection'; -import { uiIcon } from './icon'; -import { uiTooltip } from './tooltip'; +import { uiIcon } from './icon.js'; +import { uiTooltip } from './tooltip.js'; export function uiPane(context, id) { diff --git a/modules/ui/panels/UiPanelBackground.js b/modules/ui/panels/UiPanelBackground.js index c822558a7c..2faacaa129 100644 --- a/modules/ui/panels/UiPanelBackground.js +++ b/modules/ui/panels/UiPanelBackground.js @@ -1,8 +1,8 @@ import { select as d3_select } from 'd3-selection'; import { Extent } from '@rapid-sdk/math'; -import debounce from 'lodash-es/debounce'; +import debounce from 'lodash-es/debounce.js'; -import { AbstractUiPanel } from './AbstractUiPanel'; +import { AbstractUiPanel } from './AbstractUiPanel.js'; const METADATA_KEYS = ['zoom', 'vintage', 'source', 'description', 'resolution', 'accuracy']; diff --git a/modules/ui/panels/UiPanelHistory.js b/modules/ui/panels/UiPanelHistory.js index 2db449032a..47573e8344 100644 --- a/modules/ui/panels/UiPanelHistory.js +++ b/modules/ui/panels/UiPanelHistory.js @@ -1,7 +1,7 @@ import { select as d3_select } from 'd3-selection'; -import { AbstractUiPanel } from './AbstractUiPanel'; -import { uiIcon } from '../icon'; +import { AbstractUiPanel } from './AbstractUiPanel.js'; +import { uiIcon } from '../icon.js'; /** diff --git a/modules/ui/panels/UiPanelLocation.js b/modules/ui/panels/UiPanelLocation.js index 718a011f18..8775773278 100644 --- a/modules/ui/panels/UiPanelLocation.js +++ b/modules/ui/panels/UiPanelLocation.js @@ -1,7 +1,7 @@ import { select as d3_select } from 'd3-selection'; -import debounce from 'lodash-es/debounce'; +import debounce from 'lodash-es/debounce.js'; -import { AbstractUiPanel } from './AbstractUiPanel'; +import { AbstractUiPanel } from './AbstractUiPanel.js'; /** diff --git a/modules/ui/panels/UiPanelMeasurement.js b/modules/ui/panels/UiPanelMeasurement.js index 308a779a07..78f2b14604 100644 --- a/modules/ui/panels/UiPanelMeasurement.js +++ b/modules/ui/panels/UiPanelMeasurement.js @@ -3,8 +3,8 @@ import { geoLength as d3_geoLength, geoCentroid as d3_geoCentroid } from 'd3-geo import { Extent, geoSphericalDistance } from '@rapid-sdk/math'; import { utilGetAllNodes } from '@rapid-sdk/util'; -import { AbstractUiPanel } from './AbstractUiPanel'; -import { osmNote } from '../../osm'; +import { AbstractUiPanel } from './AbstractUiPanel.js'; +import { osmNote } from '../../osm/index.js'; // using WGS84 authalic radius (6371007.1809 m) diff --git a/modules/ui/panels/index.js b/modules/ui/panels/index.js index f372adbe7f..196b3f6ed4 100644 --- a/modules/ui/panels/index.js +++ b/modules/ui/panels/index.js @@ -1,4 +1,4 @@ -export * from './UiPanelBackground'; -export * from './UiPanelHistory'; -export * from './UiPanelLocation'; -export * from './UiPanelMeasurement'; +export * from './UiPanelBackground.js'; +export * from './UiPanelHistory.js'; +export * from './UiPanelLocation.js'; +export * from './UiPanelMeasurement.js'; diff --git a/modules/ui/panes/background.js b/modules/ui/panes/background.js index 6688a1ca36..f9cffb1079 100644 --- a/modules/ui/panes/background.js +++ b/modules/ui/panes/background.js @@ -1,10 +1,10 @@ -import { uiPane } from '../pane'; -import { uiSectionBackgroundDisplayOptions } from '../sections/background_display_options'; -import { uiSectionBackgroundList } from '../sections/background_list'; -import { uiSectionBackgroundOffset } from '../sections/background_offset'; -import { uiSectionGridDisplayOptions } from '../sections/grid_display_options'; -import { uiSectionOverlayList } from '../sections/overlay_list'; -// import { uiSectionReactContainer } from '../sections/react_container'; +import { uiPane } from '../pane.js'; +import { uiSectionBackgroundDisplayOptions } from '../sections/background_display_options.js'; +import { uiSectionBackgroundList } from '../sections/background_list.js'; +import { uiSectionBackgroundOffset } from '../sections/background_offset.js'; +import { uiSectionGridDisplayOptions } from '../sections/grid_display_options.js'; +import { uiSectionOverlayList } from '../sections/overlay_list.js'; +// import { uiSectionReactContainer } from '../sections/react_container.jsx'; export function uiPaneBackground(context) { diff --git a/modules/ui/panes/help.js b/modules/ui/panes/help.js index 6eeac0c141..bf12431010 100644 --- a/modules/ui/panes/help.js +++ b/modules/ui/panes/help.js @@ -1,10 +1,10 @@ import { marked } from 'marked'; -import { uiIcon } from '../icon'; -import { uiIntro } from '../intro/intro'; -import { uiPane } from '../pane'; -import { uiTooltip } from '../tooltip'; -import { helpHtml } from '../intro/helper'; +import { uiIcon } from '../icon.js'; +import { uiIntro } from '../intro/intro.js'; +import { uiPane } from '../pane.js'; +import { uiTooltip } from '../tooltip.js'; +import { helpHtml } from '../intro/helper.js'; export function uiPaneHelp(context) { diff --git a/modules/ui/panes/index.js b/modules/ui/panes/index.js index 15966d69e3..8aa64eb456 100644 --- a/modules/ui/panes/index.js +++ b/modules/ui/panes/index.js @@ -1,5 +1,5 @@ -export { uiPaneBackground } from './background'; -export { uiPaneHelp } from './help'; -export { uiPaneIssues } from './issues'; -export { uiPaneMapData } from './map_data'; -export { uiPanePreferences } from './preferences'; +export { uiPaneBackground } from './background.js'; +export { uiPaneHelp } from './help.js'; +export { uiPaneIssues } from './issues.js'; +export { uiPaneMapData } from './map_data.js'; +export { uiPanePreferences } from './preferences.js'; diff --git a/modules/ui/panes/issues.js b/modules/ui/panes/issues.js index bc157a842c..3b0f4c5739 100644 --- a/modules/ui/panes/issues.js +++ b/modules/ui/panes/issues.js @@ -1,9 +1,9 @@ -import { uiPane } from '../pane'; +import { uiPane } from '../pane.js'; -import { uiSectionValidationIssues } from '../sections/validation_issues'; -import { uiSectionValidationOptions } from '../sections/validation_options'; -import { uiSectionValidationRules } from '../sections/validation_rules'; -import { uiSectionValidationStatus } from '../sections/validation_status'; +import { uiSectionValidationIssues } from '../sections/validation_issues.js'; +import { uiSectionValidationOptions } from '../sections/validation_options.js'; +import { uiSectionValidationRules } from '../sections/validation_rules.js'; +import { uiSectionValidationStatus } from '../sections/validation_status.js'; export function uiPaneIssues(context) { diff --git a/modules/ui/panes/map_data.js b/modules/ui/panes/map_data.js index 7e69d51e62..8b55051588 100644 --- a/modules/ui/panes/map_data.js +++ b/modules/ui/panes/map_data.js @@ -1,9 +1,9 @@ -import { uiPane } from '../pane'; +import { uiPane } from '../pane.js'; -import { uiSectionDataLayers } from '../sections/data_layers'; -import { uiSectionMapFeatures } from '../sections/map_features'; -import { uiSectionMapStyleOptions } from '../sections/map_style_options'; -import { uiSectionPhotoOverlays } from '../sections/photo_overlays'; +import { uiSectionDataLayers } from '../sections/data_layers.js'; +import { uiSectionMapFeatures } from '../sections/map_features.js'; +import { uiSectionMapStyleOptions } from '../sections/map_style_options.js'; +import { uiSectionPhotoOverlays } from '../sections/photo_overlays.js'; export function uiPaneMapData(context) { diff --git a/modules/ui/panes/preferences.js b/modules/ui/panes/preferences.js index 98c7ef73ed..bd3c330077 100644 --- a/modules/ui/panes/preferences.js +++ b/modules/ui/panes/preferences.js @@ -1,6 +1,6 @@ -import { uiPane } from '../pane'; -import { uiSectionPrivacy } from '../sections/privacy'; -import { uiSectionMapInteractionOptions } from '../sections/map_interaction_options'; +import { uiPane } from '../pane.js'; +import { uiSectionPrivacy } from '../sections/privacy.js'; +import { uiSectionMapInteractionOptions } from '../sections/map_interaction_options.js'; export function uiPanePreferences(context) { diff --git a/modules/ui/photo_viewer.js b/modules/ui/photo_viewer.js index 9f4541878d..f57c000bff 100644 --- a/modules/ui/photo_viewer.js +++ b/modules/ui/photo_viewer.js @@ -1,9 +1,8 @@ import { select as d3_select } from 'd3-selection'; import { dispatch as d3_dispatch } from 'd3-dispatch'; -import { uiIcon } from './icon'; -import { utilGetDimensions } from '../util/dimensions'; -import { utilRebind } from '../util'; +import { uiIcon } from './icon.js'; +import { utilGetDimensions, utilRebind } from '../util/index.js'; export function uiPhotoViewer(context) { diff --git a/modules/ui/popover.js b/modules/ui/popover.js index d2d2f8d680..a381efaa0d 100644 --- a/modules/ui/popover.js +++ b/modules/ui/popover.js @@ -1,5 +1,6 @@ import { select as d3_select } from 'd3-selection'; -import { utilFunctor } from '../util/util'; + +import { utilFunctor } from '../util/index.js'; var _popoverID = 0; diff --git a/modules/ui/preset_icon.js b/modules/ui/preset_icon.js index 0e2ebada1c..374c637b4c 100644 --- a/modules/ui/preset_icon.js +++ b/modules/ui/preset_icon.js @@ -1,5 +1,6 @@ import { Color } from 'pixi.js'; -import { uiIcon } from './icon'; + +import { uiIcon } from './icon.js'; export function uiPresetIcon(context) { diff --git a/modules/ui/preset_list.js b/modules/ui/preset_list.js index 78f1bc3323..65e5391d65 100644 --- a/modules/ui/preset_list.js +++ b/modules/ui/preset_list.js @@ -1,14 +1,14 @@ import { dispatch as d3_dispatch } from 'd3-dispatch'; import { select as d3_select } from 'd3-selection'; -import debounce from 'lodash-es/debounce'; - -import { actionChangePreset } from '../actions/change_preset'; -import { operationDelete } from '../operations/delete'; -import { uiIcon } from './icon'; -import { uiTooltip } from './tooltip'; -import { uiPresetIcon } from './preset_icon'; -import { uiTagReference } from './tag_reference'; -import { utilKeybinding, utilNoAuto, utilRebind, utilTotalExtent } from '../util'; +import debounce from 'lodash-es/debounce.js'; + +import { actionChangePreset } from '../actions/change_preset.js'; +import { operationDelete } from '../operations/delete.js'; +import { uiIcon } from './icon.js'; +import { uiPresetIcon } from './preset_icon.js'; +import { uiTagReference } from './tag_reference.js'; +import { uiTooltip } from './tooltip.js'; +import { utilKeybinding, utilNoAuto, utilRebind, utilTotalExtent } from '../util/index.js'; export function uiPresetList(context) { diff --git a/modules/ui/rapid_colorpicker.js b/modules/ui/rapid_colorpicker.js index 6dedb9a0ab..4e40918bdb 100644 --- a/modules/ui/rapid_colorpicker.js +++ b/modules/ui/rapid_colorpicker.js @@ -1,8 +1,8 @@ import { dispatch as d3_dispatch } from 'd3-dispatch'; import { select as d3_select } from 'd3-selection'; -import { uiIcon } from './icon'; -import { utilKeybinding, utilRebind } from '../util'; +import { uiIcon } from './icon.js'; +import { utilKeybinding, utilRebind } from '../util/index.js'; export function uiRapidColorpicker(context, parentModal) { diff --git a/modules/ui/rapid_feature_inspector.js b/modules/ui/rapid_feature_inspector.js index b0cad46136..f790cb36fe 100644 --- a/modules/ui/rapid_feature_inspector.js +++ b/modules/ui/rapid_feature_inspector.js @@ -1,10 +1,10 @@ import { select as d3_select } from 'd3-selection'; -import { actionNoop, actionRapidAcceptFeature } from '../actions'; -import { uiIcon } from './icon'; -import { uiFlash } from './flash'; -import { uiTooltip } from './tooltip'; -import { uiRapidFirstEditDialog } from './rapid_first_edit_dialog'; +import { actionNoop, actionRapidAcceptFeature } from '../actions/index.js'; +import { uiIcon } from './icon.js'; +import { uiFlash } from './flash.js'; +import { uiRapidFirstEditDialog } from './rapid_first_edit_dialog.js'; +import { uiTooltip } from './tooltip.js'; const ACCEPT_FEATURES_LIMIT = 50; diff --git a/modules/ui/rapid_feature_toggle_dialog.js b/modules/ui/rapid_feature_toggle_dialog.js index 0123a9c907..b36d97b804 100644 --- a/modules/ui/rapid_feature_toggle_dialog.js +++ b/modules/ui/rapid_feature_toggle_dialog.js @@ -1,11 +1,11 @@ import { select as d3_select } from 'd3-selection'; import { marked } from 'marked'; -import { icon } from './intro/helper'; -import { uiIcon } from './icon'; -import { uiModal } from './modal'; -import { uiRapidColorpicker } from './rapid_colorpicker'; -import { uiRapidViewManageDatasets } from './rapid_view_manage_datasets'; +import { icon } from './intro/helper.js'; +import { uiIcon } from './icon.js'; +import { uiModal } from './modal.js'; +import { uiRapidColorpicker } from './rapid_colorpicker.js'; +import { uiRapidViewManageDatasets } from './rapid_view_manage_datasets.js'; export function uiRapidFeatureToggleDialog(context, AIFeatureToggleKey, featureToggleKeyDispatcher) { diff --git a/modules/ui/rapid_first_edit_dialog.js b/modules/ui/rapid_first_edit_dialog.js index 7569abdc9c..1ef100aae8 100644 --- a/modules/ui/rapid_first_edit_dialog.js +++ b/modules/ui/rapid_first_edit_dialog.js @@ -1,6 +1,6 @@ -import { icon } from './intro/helper'; -import { uiModal } from './modal'; -import { uiRapidSplash } from './rapid_splash'; +import { icon } from './intro/helper.js'; +import { uiModal } from './modal.js'; +import { uiRapidSplash } from './rapid_splash.js'; export function uiRapidFirstEditDialog(context) { diff --git a/modules/ui/rapid_poweruser_features_dialog.js b/modules/ui/rapid_poweruser_features_dialog.js index 7277e9871f..dee7b72a82 100644 --- a/modules/ui/rapid_poweruser_features_dialog.js +++ b/modules/ui/rapid_poweruser_features_dialog.js @@ -1,6 +1,6 @@ import { select as d3_select } from 'd3-selection'; -import { uiModal } from './modal'; +import { uiModal } from './modal.js'; export function uiRapidPowerUserFeaturesDialog(context) { diff --git a/modules/ui/rapid_splash.js b/modules/ui/rapid_splash.js index 35d7a7cec6..3ccdf975de 100644 --- a/modules/ui/rapid_splash.js +++ b/modules/ui/rapid_splash.js @@ -1,6 +1,6 @@ -import { uiIntro } from './intro/intro'; -import { icon } from './intro/helper'; -import { uiModal } from './modal'; +import { icon } from './intro/helper.js'; +import { uiIntro } from './intro/intro.js'; +import { uiModal } from './modal.js'; export function uiRapidSplash(context) { diff --git a/modules/ui/rapid_view_manage_datasets.js b/modules/ui/rapid_view_manage_datasets.js index ccdf467aa6..4201c34732 100644 --- a/modules/ui/rapid_view_manage_datasets.js +++ b/modules/ui/rapid_view_manage_datasets.js @@ -3,9 +3,9 @@ import { select as d3_select } from 'd3-selection'; import { Extent } from '@rapid-sdk/math'; import { marked } from 'marked'; -import { uiIcon } from './icon'; -import { uiCombobox} from './combobox'; -import { utilKeybinding, utilNoAuto, utilRebind } from '../util'; +import { uiIcon } from './icon.js'; +import { uiCombobox} from './combobox.js'; +import { utilKeybinding, utilNoAuto, utilRebind } from '../util/index.js'; export function uiRapidViewManageDatasets(context, parentModal) { diff --git a/modules/ui/rapid_whatsnew.js b/modules/ui/rapid_whatsnew.js index bd77aada13..0baacfcf5e 100644 --- a/modules/ui/rapid_whatsnew.js +++ b/modules/ui/rapid_whatsnew.js @@ -1,7 +1,8 @@ -import { icon } from './intro/helper'; -import { uiModal } from './modal'; import { marked } from 'marked'; +import { icon } from './intro/helper.js'; +import { uiModal } from './modal.js'; + export function uiRapidWhatsNew(context) { const l10n = context.systems.l10n; diff --git a/modules/ui/restore.js b/modules/ui/restore.js index 50abaea6dc..89bdd22820 100644 --- a/modules/ui/restore.js +++ b/modules/ui/restore.js @@ -1,4 +1,4 @@ -import { uiModal } from './modal'; +import { uiModal } from './modal.js'; export function uiRestore(context) { diff --git a/modules/ui/section.js b/modules/ui/section.js index 8fe12bb8e7..f3a4167581 100644 --- a/modules/ui/section.js +++ b/modules/ui/section.js @@ -1,7 +1,7 @@ import { select as d3_select } from 'd3-selection'; -import { uiDisclosure } from './disclosure'; -import { utilFunctor } from '../util'; +import { uiDisclosure } from './disclosure.js'; +import { utilFunctor } from '../util/index.js'; // A Section is a box of content. diff --git a/modules/ui/sections/background_display_options.js b/modules/ui/sections/background_display_options.js index 9efb7a854b..96a11901e0 100644 --- a/modules/ui/sections/background_display_options.js +++ b/modules/ui/sections/background_display_options.js @@ -1,5 +1,5 @@ -import { uiIcon } from '../icon'; -import { uiSection } from '../section'; +import { uiIcon } from '../icon.js'; +import { uiSection } from '../section.js'; export function uiSectionBackgroundDisplayOptions(context) { diff --git a/modules/ui/sections/background_list.js b/modules/ui/sections/background_list.js index 9f22b5f3a9..8aa1e900a9 100644 --- a/modules/ui/sections/background_list.js +++ b/modules/ui/sections/background_list.js @@ -1,16 +1,16 @@ import { descending as d3_descending, ascending as d3_ascending } from 'd3-array'; import { select as d3_select } from 'd3-selection'; import { easeCubicInOut as d3_easeCubicInOut } from 'd3-ease'; -import debounce from 'lodash-es/debounce'; - -import { uiTooltip } from '../tooltip'; -import { ImagerySource } from '../../core/lib'; -import { uiIcon } from '../icon'; -import { uiCmd } from '../cmd'; -import { uiSettingsCustomBackground } from '../settings/custom_background'; -import { uiMapInMap } from '../map_in_map'; -import { uiMap3dViewer } from '../map3d_viewer'; -import { uiSection } from '../section'; +import debounce from 'lodash-es/debounce.js'; + +import { uiTooltip } from '../tooltip.js'; +import { ImagerySource } from '../../core/lib/index.js'; +import { uiIcon } from '../icon.js'; +import { uiCmd } from '../cmd.js'; +import { uiSettingsCustomBackground } from '../settings/custom_background.js'; +import { uiMapInMap } from '../map_in_map.js'; +import { uiMap3dViewer } from '../map3d_viewer.js'; +import { uiSection } from '../section.js'; export function uiSectionBackgroundList(context) { diff --git a/modules/ui/sections/background_offset.js b/modules/ui/sections/background_offset.js index e79cd9697b..4e75c5416f 100644 --- a/modules/ui/sections/background_offset.js +++ b/modules/ui/sections/background_offset.js @@ -1,8 +1,8 @@ import { select as d3_select } from 'd3-selection'; import { geoMetersToOffset, geoOffsetToMeters } from '@rapid-sdk/math'; -import { uiIcon } from '../icon'; -import { uiSection } from '../section'; +import { uiIcon } from '../icon.js'; +import { uiSection } from '../section.js'; export function uiSectionBackgroundOffset(context) { diff --git a/modules/ui/sections/changes.js b/modules/ui/sections/changes.js index 3710f3672d..07c3b4201f 100644 --- a/modules/ui/sections/changes.js +++ b/modules/ui/sections/changes.js @@ -1,12 +1,12 @@ import { select as d3_select } from 'd3-selection'; import { utilEntityOrMemberSelector } from '@rapid-sdk/util'; -import { JXON } from '../../util/jxon'; -import { actionDiscardTags } from '../../actions/discard_tags'; -import { osmChangeset } from '../../osm'; -import { uiIcon } from '../icon'; -import { uiSection } from '../section'; -import { utilDetect } from '../../util'; +import { JXON } from '../../util/jxon.js'; +import { actionDiscardTags } from '../../actions/discard_tags.js'; +import { osmChangeset } from '../../osm/index.js'; +import { uiIcon } from '../icon.js'; +import { uiSection } from '../section.js'; +import { utilDetect } from '../../util/index.js'; export function uiSectionChanges(context) { diff --git a/modules/ui/sections/data_layers.js b/modules/ui/sections/data_layers.js index 7cc49e4e58..b5e25f099c 100644 --- a/modules/ui/sections/data_layers.js +++ b/modules/ui/sections/data_layers.js @@ -1,10 +1,10 @@ import { select as d3_select } from 'd3-selection'; -import { uiTooltip } from '../tooltip'; -import { uiIcon } from '../icon'; -import { uiCmd } from '../cmd'; -import { uiSection } from '../section'; -import { uiSettingsCustomData } from '../settings/custom_data'; +import { uiTooltip } from '../tooltip.js'; +import { uiIcon } from '../icon.js'; +import { uiCmd } from '../cmd.js'; +import { uiSection } from '../section.js'; +import { uiSettingsCustomData } from '../settings/custom_data.js'; export function uiSectionDataLayers(context) { diff --git a/modules/ui/sections/entity_issues.js b/modules/ui/sections/entity_issues.js index 40f58db2e3..2ba14d4b1f 100644 --- a/modules/ui/sections/entity_issues.js +++ b/modules/ui/sections/entity_issues.js @@ -1,9 +1,9 @@ import { select as d3_select } from 'd3-selection'; import { utilArrayIdentical } from '@rapid-sdk/util'; -import { uiIcon } from '../icon'; -import { utilHighlightEntities } from '../../util'; -import { uiSection } from '../section'; +import { uiIcon } from '../icon.js'; +import { uiSection } from '../section.js'; +import { utilHighlightEntities } from '../../util/index.js'; export function uiSectionEntityIssues(context) { diff --git a/modules/ui/sections/feature_type.js b/modules/ui/sections/feature_type.js index 39cc8f7af4..bcc665e337 100644 --- a/modules/ui/sections/feature_type.js +++ b/modules/ui/sections/feature_type.js @@ -1,11 +1,11 @@ import { dispatch as d3_dispatch } from 'd3-dispatch'; import { utilArrayIdentical } from '@rapid-sdk/util'; -import { uiTooltip } from '../tooltip'; -import { utilRebind } from '../../util'; -import { uiPresetIcon } from '../preset_icon'; -import { uiSection } from '../section'; -import { uiTagReference } from '../tag_reference'; +import { uiTooltip } from '../tooltip.js'; +import { utilRebind } from '../../util/index.js'; +import { uiPresetIcon } from '../preset_icon.js'; +import { uiSection } from '../section.js'; +import { uiTagReference } from '../tag_reference.js'; export function uiSectionFeatureType(context) { diff --git a/modules/ui/sections/grid_display_options.js b/modules/ui/sections/grid_display_options.js index 92fc119b0f..47aa0956d3 100644 --- a/modules/ui/sections/grid_display_options.js +++ b/modules/ui/sections/grid_display_options.js @@ -1,6 +1,6 @@ import { select as d3_select } from 'd3-selection'; -import { uiSection } from '../section'; +import { uiSection } from '../section.js'; export function uiSectionGridDisplayOptions(context) { diff --git a/modules/ui/sections/index.js b/modules/ui/sections/index.js index b5815250ef..cd53b19188 100644 --- a/modules/ui/sections/index.js +++ b/modules/ui/sections/index.js @@ -1,22 +1,22 @@ -export { uiSectionBackgroundDisplayOptions } from './background_display_options'; -export { uiSectionBackgroundList } from './background_list'; -export { uiSectionBackgroundOffset } from './background_offset'; -export { uiSectionChanges } from './changes'; -export { uiSectionDataLayers } from './data_layers'; -export { uiSectionEntityIssues } from './entity_issues'; -export { uiSectionFeatureType } from './feature_type'; -export { uiSectionMapFeatures } from './map_features'; -export { uiSectionMapInteractionOptions } from './map_interaction_options'; -export { uiSectionMapStyleOptions } from './map_style_options'; -export { uiSectionOverlayList } from './overlay_list'; -export { uiSectionPhotoOverlays } from './photo_overlays'; -export { uiSectionPresetFields } from './preset_fields'; -export { uiSectionPrivacy } from './privacy'; -export { uiSectionRawMemberEditor } from './raw_member_editor'; -export { uiSectionRawMembershipEditor } from './raw_membership_editor'; -export { uiSectionRawTagEditor } from './raw_tag_editor'; -export { uiSectionSelectionList } from './selection_list'; -export { uiSectionValidationIssues } from './validation_issues'; -export { uiSectionValidationOptions } from './validation_options'; -export { uiSectionValidationRules } from './validation_rules'; -export { uiSectionValidationStatus } from './validation_status'; +export { uiSectionBackgroundDisplayOptions } from './background_display_options.js'; +export { uiSectionBackgroundList } from './background_list.js'; +export { uiSectionBackgroundOffset } from './background_offset.js'; +export { uiSectionChanges } from './changes.js'; +export { uiSectionDataLayers } from './data_layers.js'; +export { uiSectionEntityIssues } from './entity_issues.js'; +export { uiSectionFeatureType } from './feature_type.js'; +export { uiSectionMapFeatures } from './map_features.js'; +export { uiSectionMapInteractionOptions } from './map_interaction_options.js'; +export { uiSectionMapStyleOptions } from './map_style_options.js'; +export { uiSectionOverlayList } from './overlay_list.js'; +export { uiSectionPhotoOverlays } from './photo_overlays.js'; +export { uiSectionPresetFields } from './preset_fields.js'; +export { uiSectionPrivacy } from './privacy.js'; +export { uiSectionRawMemberEditor } from './raw_member_editor.js'; +export { uiSectionRawMembershipEditor } from './raw_membership_editor.js'; +export { uiSectionRawTagEditor } from './raw_tag_editor.js'; +export { uiSectionSelectionList } from './selection_list.js'; +export { uiSectionValidationIssues } from './validation_issues.js'; +export { uiSectionValidationOptions } from './validation_options.js'; +export { uiSectionValidationRules } from './validation_rules.js'; +export { uiSectionValidationStatus } from './validation_status.js'; diff --git a/modules/ui/sections/map_features.js b/modules/ui/sections/map_features.js index 3e6b6c58de..ff8091c75f 100644 --- a/modules/ui/sections/map_features.js +++ b/modules/ui/sections/map_features.js @@ -1,5 +1,5 @@ -import { uiTooltip } from '../tooltip'; -import { uiSection } from '../section'; +import { uiTooltip } from '../tooltip.js'; +import { uiSection } from '../section.js'; export function uiSectionMapFeatures(context) { diff --git a/modules/ui/sections/map_interaction_options.js b/modules/ui/sections/map_interaction_options.js index a1aa190696..8fde33ff92 100644 --- a/modules/ui/sections/map_interaction_options.js +++ b/modules/ui/sections/map_interaction_options.js @@ -1,5 +1,5 @@ -import { uiTooltip } from '../tooltip'; -import { uiSection } from '../section'; +import { uiTooltip } from '../tooltip.js'; +import { uiSection } from '../section.js'; export function uiSectionMapInteractionOptions(context) { diff --git a/modules/ui/sections/map_style_options.js b/modules/ui/sections/map_style_options.js index 7d72f96d35..9a243a7624 100644 --- a/modules/ui/sections/map_style_options.js +++ b/modules/ui/sections/map_style_options.js @@ -1,5 +1,5 @@ -import { uiTooltip } from '../tooltip'; -import { uiSection } from '../section'; +import { uiTooltip } from '../tooltip.js'; +import { uiSection } from '../section.js'; export function uiSectionMapStyleOptions(context) { diff --git a/modules/ui/sections/overlay_list.js b/modules/ui/sections/overlay_list.js index a70c987380..0a2d4a2b01 100644 --- a/modules/ui/sections/overlay_list.js +++ b/modules/ui/sections/overlay_list.js @@ -1,9 +1,9 @@ import { descending as d3_descending, ascending as d3_ascending } from 'd3-array'; import { select as d3_select } from 'd3-selection'; -import debounce from 'lodash-es/debounce'; +import debounce from 'lodash-es/debounce.js'; -import { uiTooltip } from '../tooltip'; -import { uiSection } from '../section'; +import { uiTooltip } from '../tooltip.js'; +import { uiSection } from '../section.js'; export function uiSectionOverlayList(context) { diff --git a/modules/ui/sections/photo_overlays.js b/modules/ui/sections/photo_overlays.js index 0cafb3b60b..bbfd685756 100644 --- a/modules/ui/sections/photo_overlays.js +++ b/modules/ui/sections/photo_overlays.js @@ -1,8 +1,8 @@ import { select as d3_select } from 'd3-selection'; -import { uiTooltip } from '../tooltip'; -import { uiSection } from '../section'; -import { utilGetSetValue, utilNoAuto } from '../../util'; +import { uiTooltip } from '../tooltip.js'; +import { uiSection } from '../section.js'; +import { utilGetSetValue, utilNoAuto } from '../../util/index.js'; export function uiSectionPhotoOverlays(context) { diff --git a/modules/ui/sections/preset_fields.js b/modules/ui/sections/preset_fields.js index a3d68841ca..b4549355d8 100644 --- a/modules/ui/sections/preset_fields.js +++ b/modules/ui/sections/preset_fields.js @@ -1,10 +1,10 @@ import { dispatch as d3_dispatch } from 'd3-dispatch'; import { utilArrayIdentical, utilArrayUnion } from '@rapid-sdk/util'; -import { UiField } from '../UiField'; -import { uiFormFields } from '../form_fields'; -import { uiSection } from '../section'; -import { utilRebind } from '../../util'; +import { UiField } from '../UiField.js'; +import { uiFormFields } from '../form_fields.js'; +import { uiSection } from '../section.js'; +import { utilRebind } from '../../util/index.js'; export function uiSectionPresetFields(context) { diff --git a/modules/ui/sections/privacy.js b/modules/ui/sections/privacy.js index 371a29a641..203fcb56ec 100644 --- a/modules/ui/sections/privacy.js +++ b/modules/ui/sections/privacy.js @@ -1,6 +1,6 @@ -import { uiTooltip } from '../tooltip'; -import { uiIcon } from '../icon'; -import { uiSection } from '../section'; +import { uiTooltip } from '../tooltip.js'; +import { uiIcon } from '../icon.js'; +import { uiSection } from '../section.js'; export function uiSectionPrivacy(context) { diff --git a/modules/ui/sections/raw_member_editor.js b/modules/ui/sections/raw_member_editor.js index ac98b85dd4..a0d1b97fc9 100644 --- a/modules/ui/sections/raw_member_editor.js +++ b/modules/ui/sections/raw_member_editor.js @@ -3,14 +3,14 @@ import { select as d3_select } from 'd3-selection'; import { vecLength, vecSubtract } from '@rapid-sdk/math'; import { utilUniqueString } from '@rapid-sdk/util'; -import { actionChangeMember } from '../../actions/change_member'; -import { actionDeleteMember } from '../../actions/delete_member'; -import { actionMoveMember } from '../../actions/move_member'; -import { osmEntity } from '../../osm'; -import { uiIcon } from '../icon'; -import { uiCombobox } from '../combobox'; -import { uiSection } from '../section'; -import { utilHighlightEntities, utilIsColorValid, utilNoAuto } from '../../util'; +import { actionChangeMember } from '../../actions/change_member.js'; +import { actionDeleteMember } from '../../actions/delete_member.js'; +import { actionMoveMember } from '../../actions/move_member.js'; +import { osmEntity } from '../../osm/entity.js'; +import { uiIcon } from '../icon.js'; +import { uiCombobox } from '../combobox.js'; +import { uiSection } from '../section.js'; +import { utilHighlightEntities, utilIsColorValid, utilNoAuto } from '../../util/index.js'; const MAX_MEMBERS = 1000; diff --git a/modules/ui/sections/raw_membership_editor.js b/modules/ui/sections/raw_membership_editor.js index 1eff84511b..7d63948b44 100644 --- a/modules/ui/sections/raw_membership_editor.js +++ b/modules/ui/sections/raw_membership_editor.js @@ -1,16 +1,16 @@ import { select as d3_select } from 'd3-selection'; import { utilArrayGroupBy, utilArrayIntersection, utilUniqueString } from '@rapid-sdk/util'; -import { actionAddEntity } from '../../actions/add_entity'; -import { actionAddMember } from '../../actions/add_member'; -import { actionChangeMember } from '../../actions/change_member'; -import { actionDeleteMembers } from '../../actions/delete_members'; -import { osmEntity, osmRelation } from '../../osm'; -import { uiIcon } from '../icon'; -import { uiCombobox } from '../combobox'; -import { uiSection } from '../section'; -import { uiTooltip } from '../tooltip'; -import { utilNoAuto, utilIsColorValid, utilHighlightEntities } from '../../util'; +import { actionAddEntity } from '../../actions/add_entity.js'; +import { actionAddMember } from '../../actions/add_member.js'; +import { actionChangeMember } from '../../actions/change_member.js'; +import { actionDeleteMembers } from '../../actions/delete_members.js'; +import { osmEntity, osmRelation } from '../../osm/index.js'; +import { uiIcon } from '../icon.js'; +import { uiCombobox } from '../combobox.js'; +import { uiSection } from '../section.js'; +import { uiTooltip } from '../tooltip.js'; +import { utilNoAuto, utilIsColorValid, utilHighlightEntities } from '../../util/index.js'; const MAX_MEMBERSHIPS = 1000; diff --git a/modules/ui/sections/raw_tag_editor.js b/modules/ui/sections/raw_tag_editor.js index f66f6a5281..2041581eae 100644 --- a/modules/ui/sections/raw_tag_editor.js +++ b/modules/ui/sections/raw_tag_editor.js @@ -2,11 +2,11 @@ import { dispatch as d3_dispatch } from 'd3-dispatch'; import { select as d3_select } from 'd3-selection'; import { utilArrayDifference, utilArrayIdentical, utilTagDiff } from '@rapid-sdk/util'; -import { uiIcon } from '../icon'; -import { uiCombobox } from '../combobox'; -import { uiSection } from '../section'; -import { uiTagReference } from '../tag_reference'; -import { utilGetSetValue, utilNoAuto, utilRebind } from '../../util'; +import { uiIcon } from '../icon.js'; +import { uiCombobox } from '../combobox.js'; +import { uiSection } from '../section.js'; +import { uiTagReference } from '../tag_reference.js'; +import { utilGetSetValue, utilNoAuto, utilRebind } from '../../util/index.js'; export function uiSectionRawTagEditor(context, id) { diff --git a/modules/ui/sections/react_container.jsx b/modules/ui/sections/react_container.jsx index a188879b07..a71e72aaa6 100644 --- a/modules/ui/sections/react_container.jsx +++ b/modules/ui/sections/react_container.jsx @@ -1,9 +1,9 @@ -import debounce from 'lodash-es/debounce'; +import debounce from 'lodash-es/debounce.js'; import React from 'react'; import ReactDom from 'react-dom'; import ReactComponent from './ReactComponent'; -import { uiSection } from '../section'; +import { uiSection } from '../section.js'; export function uiSectionReactContainer(context) { @@ -43,4 +43,4 @@ export function uiSectionReactContainer(context) { ); return section; -} \ No newline at end of file +} diff --git a/modules/ui/sections/selection_list.js b/modules/ui/sections/selection_list.js index fff92dbe01..ff4239140d 100644 --- a/modules/ui/sections/selection_list.js +++ b/modules/ui/sections/selection_list.js @@ -1,9 +1,9 @@ import { select as d3_select } from 'd3-selection'; -import { osmEntity } from '../../osm'; -import { uiIcon } from '../icon'; -import { uiSection } from '../section'; -import { utilHighlightEntities } from '../../util'; +import { osmEntity } from '../../osm/entity.js'; +import { uiIcon } from '../icon.js'; +import { uiSection } from '../section.js'; +import { utilHighlightEntities } from '../../util/index.js'; export function uiSectionSelectionList(context) { diff --git a/modules/ui/sections/validation_issues.js b/modules/ui/sections/validation_issues.js index f3493dbfcd..55a4b89405 100644 --- a/modules/ui/sections/validation_issues.js +++ b/modules/ui/sections/validation_issues.js @@ -1,10 +1,10 @@ -import debounce from 'lodash-es/debounce'; +import debounce from 'lodash-es/debounce.js'; import { select as d3_select } from 'd3-selection'; import { geoSphericalDistance } from '@rapid-sdk/math'; -import { uiIcon } from '../icon'; -import { utilHighlightEntities } from '../../util'; -import { uiSection } from '../section'; +import { uiIcon } from '../icon.js'; +import { uiSection } from '../section.js'; +import { utilHighlightEntities } from '../../util/index.js'; const MAX_ISSUES = 1000; diff --git a/modules/ui/sections/validation_options.js b/modules/ui/sections/validation_options.js index b0f957f882..4f8a1dbe92 100644 --- a/modules/ui/sections/validation_options.js +++ b/modules/ui/sections/validation_options.js @@ -1,4 +1,4 @@ -import { uiSection } from '../section'; +import { uiSection } from '../section.js'; export function uiSectionValidationOptions(context) { diff --git a/modules/ui/sections/validation_rules.js b/modules/ui/sections/validation_rules.js index e34d6d00a8..dc196a6137 100644 --- a/modules/ui/sections/validation_rules.js +++ b/modules/ui/sections/validation_rules.js @@ -1,8 +1,8 @@ import { select as d3_select } from 'd3-selection'; -import { utilGetSetValue, utilNoAuto } from '../../util'; -import { uiTooltip } from '../tooltip'; -import { uiSection } from '../section'; +import { uiTooltip } from '../tooltip.js'; +import { uiSection } from '../section.js'; +import { utilGetSetValue, utilNoAuto } from '../../util/index.js'; export function uiSectionValidationRules(context) { diff --git a/modules/ui/sections/validation_status.js b/modules/ui/sections/validation_status.js index 3a784240b3..01177ddf60 100644 --- a/modules/ui/sections/validation_status.js +++ b/modules/ui/sections/validation_status.js @@ -1,7 +1,7 @@ -import debounce from 'lodash-es/debounce'; +import debounce from 'lodash-es/debounce.js'; -import { uiIcon } from '../icon'; -import { uiSection } from '../section'; +import { uiIcon } from '../icon.js'; +import { uiSection } from '../section.js'; export function uiSectionValidationStatus(context) { diff --git a/modules/ui/settings/custom_background.js b/modules/ui/settings/custom_background.js index 64e45a2fd5..83b56609dd 100644 --- a/modules/ui/settings/custom_background.js +++ b/modules/ui/settings/custom_background.js @@ -1,8 +1,8 @@ import { dispatch as d3_dispatch } from 'd3-dispatch'; import { marked } from 'marked'; -import { uiConfirm } from '../confirm'; -import { utilNoAuto, utilRebind } from '../../util'; +import { uiConfirm } from '../confirm.js'; +import { utilNoAuto, utilRebind } from '../../util/index.js'; export function uiSettingsCustomBackground(context) { diff --git a/modules/ui/settings/custom_data.js b/modules/ui/settings/custom_data.js index 20faa306c0..d3b4082963 100644 --- a/modules/ui/settings/custom_data.js +++ b/modules/ui/settings/custom_data.js @@ -1,8 +1,8 @@ import { dispatch as d3_dispatch } from 'd3-dispatch'; import { marked } from 'marked'; -import { uiConfirm } from '../confirm'; -import { utilNoAuto, utilRebind } from '../../util'; +import { uiConfirm } from '../confirm.js'; +import { utilNoAuto, utilRebind } from '../../util/index.js'; export function uiSettingsCustomData(context) { diff --git a/modules/ui/settings/index.js b/modules/ui/settings/index.js index b8a047b261..50dca023cc 100644 --- a/modules/ui/settings/index.js +++ b/modules/ui/settings/index.js @@ -1,2 +1,2 @@ -export { uiSettingsCustomBackground } from './custom_background'; -export { uiSettingsCustomData } from './custom_data'; +export { uiSettingsCustomBackground } from './custom_background.js'; +export { uiSettingsCustomData } from './custom_data.js'; diff --git a/modules/ui/shortcuts.js b/modules/ui/shortcuts.js index b37a2f3991..e04225794b 100644 --- a/modules/ui/shortcuts.js +++ b/modules/ui/shortcuts.js @@ -1,10 +1,10 @@ import { select as d3_select } from 'd3-selection'; import { utilArrayUniq } from '@rapid-sdk/util'; -import { uiIcon } from './icon'; -import { uiCmd } from './cmd'; -import { uiModal } from './modal'; -import { utilDetect } from '../util/detect'; +import { uiIcon } from './icon.js'; +import { uiCmd } from './cmd.js'; +import { uiModal } from './modal.js'; +import { utilDetect } from '../util/detect.js'; export function uiShortcuts(context) { diff --git a/modules/ui/sidebar.js b/modules/ui/sidebar.js index 5d44b9bb5a..b265d29202 100644 --- a/modules/ui/sidebar.js +++ b/modules/ui/sidebar.js @@ -2,18 +2,18 @@ import { interpolateNumber as d3_interpolateNumber } from 'd3-interpolate'; import { select as d3_select } from 'd3-selection'; import { Extent } from '@rapid-sdk/math'; import { utilArrayIdentical } from '@rapid-sdk/util'; -import _throttle from 'lodash-es/throttle'; - -import { utilFastMouse } from '../util'; -import { osmEntity, osmNote, QAItem } from '../osm'; -import { uiDataEditor } from './data_editor'; -import { uiFeatureList } from './feature_list'; -import { uiInspector } from './inspector'; -import { uiImproveOsmEditor } from './improveOSM_editor'; -import { uiKeepRightEditor } from './keepRight_editor'; -import { uiOsmoseEditor } from './osmose_editor'; -import { uiNoteEditor } from './note_editor'; -import { uiRapidFeatureInspector } from './rapid_feature_inspector'; +import _throttle from 'lodash-es/throttle.js'; + +import { osmEntity, osmNote, QAItem } from '../osm/index.js'; +import { uiDataEditor } from './data_editor.js'; +import { uiFeatureList } from './feature_list.js'; +import { uiInspector } from './inspector.js'; +import { uiImproveOsmEditor } from './improveOSM_editor.js'; +import { uiKeepRightEditor } from './keepRight_editor.js'; +import { uiOsmoseEditor } from './osmose_editor.js'; +import { uiNoteEditor } from './note_editor.js'; +import { uiRapidFeatureInspector } from './rapid_feature_inspector.js'; +import { utilFastMouse } from '../util/index.js'; export function uiSidebar(context) { diff --git a/modules/ui/splash.js b/modules/ui/splash.js index 9dc439c2f8..7457e33a5e 100644 --- a/modules/ui/splash.js +++ b/modules/ui/splash.js @@ -1,5 +1,5 @@ -import { uiIntro } from './intro/intro'; -import { uiModal } from './modal'; +import { uiIntro } from './intro/intro.js'; +import { uiModal } from './modal.js'; export function uiSplash(context) { diff --git a/modules/ui/status.js b/modules/ui/status.js index 740ea9ca46..d15f9c98ea 100644 --- a/modules/ui/status.js +++ b/modules/ui/status.js @@ -1,6 +1,6 @@ -import _throttle from 'lodash-es/throttle'; +import _throttle from 'lodash-es/throttle.js'; -import { uiIcon } from './icon'; +import { uiIcon } from './icon.js'; export function uiStatus(context) { diff --git a/modules/ui/success.js b/modules/ui/success.js index a4123cfa58..98f60198be 100644 --- a/modules/ui/success.js +++ b/modules/ui/success.js @@ -1,11 +1,10 @@ import { dispatch as d3_dispatch } from 'd3-dispatch'; import { select as d3_select } from 'd3-selection'; - import { resolveStrings } from 'osm-community-index'; -import { uiIcon } from './icon'; -import { uiDisclosure } from '../ui/disclosure'; -import { utilRebind } from '../util/rebind'; +import { uiIcon } from './icon.js'; +import { uiDisclosure } from '../ui/disclosure.js'; +import { utilRebind } from '../util/rebind.js'; let _oci = null; diff --git a/modules/ui/tag_reference.js b/modules/ui/tag_reference.js index b2136458d9..b7862ac34c 100644 --- a/modules/ui/tag_reference.js +++ b/modules/ui/tag_reference.js @@ -1,6 +1,6 @@ import { select as d3_select } from 'd3-selection'; -import { uiIcon } from './icon'; +import { uiIcon } from './icon.js'; // Pass `what` object of the form: diff --git a/modules/ui/tools/download_osc.js b/modules/ui/tools/download_osc.js index bba6067764..2892d59cb9 100644 --- a/modules/ui/tools/download_osc.js +++ b/modules/ui/tools/download_osc.js @@ -1,8 +1,8 @@ -import { JXON } from '../../util/jxon'; -import { osmChangeset } from '../../osm'; -import { actionDiscardTags } from '../../actions'; -import { uiIcon } from '../icon'; -import { uiTooltip } from '../tooltip'; +import { JXON } from '../../util/jxon.js'; +import { osmChangeset } from '../../osm/index.js'; +import { actionDiscardTags } from '../../actions/index.js'; +import { uiIcon } from '../icon.js'; +import { uiTooltip } from '../tooltip.js'; export function uiToolDownloadOsc(context) { diff --git a/modules/ui/tools/index.js b/modules/ui/tools/index.js index e0c14436af..6e774a57ca 100644 --- a/modules/ui/tools/index.js +++ b/modules/ui/tools/index.js @@ -1,8 +1,7 @@ -export * from './download_osc'; -export * from './modes'; -export * from './notes'; -export * from './save'; -export * from './sidebar_toggle'; -export * from './undo_redo'; - -export * from './rapid_features'; +export * from './download_osc.js'; +export * from './modes.js'; +export * from './notes.js'; +export * from './rapid_features.js'; +export * from './save.js'; +export * from './sidebar_toggle.js'; +export * from './undo_redo.js'; diff --git a/modules/ui/tools/modes.js b/modules/ui/tools/modes.js index eb9906f87e..114774ef28 100644 --- a/modules/ui/tools/modes.js +++ b/modules/ui/tools/modes.js @@ -1,8 +1,8 @@ import { select as d3_select } from 'd3-selection'; -import debounce from 'lodash-es/debounce'; +import debounce from 'lodash-es/debounce.js'; -import { uiIcon } from '../icon'; -import { uiTooltip } from '../tooltip'; +import { uiIcon } from '../icon.js'; +import { uiTooltip } from '../tooltip.js'; export function uiToolDrawModes(context) { diff --git a/modules/ui/tools/notes.js b/modules/ui/tools/notes.js index 3ec011950a..d3993de2bd 100644 --- a/modules/ui/tools/notes.js +++ b/modules/ui/tools/notes.js @@ -1,8 +1,8 @@ -import debounce from 'lodash-es/debounce'; +import debounce from 'lodash-es/debounce.js'; import { select as d3_select } from 'd3-selection'; -import { uiIcon } from '../icon'; -import { uiTooltip } from '../tooltip'; +import { uiIcon } from '../icon.js'; +import { uiTooltip } from '../tooltip.js'; export function uiToolNotes(context) { diff --git a/modules/ui/tools/rapid_features.js b/modules/ui/tools/rapid_features.js index bd15904043..c3c6d21979 100644 --- a/modules/ui/tools/rapid_features.js +++ b/modules/ui/tools/rapid_features.js @@ -1,8 +1,9 @@ import { dispatch as d3_dispatch } from 'd3-dispatch'; -import { uiTooltip } from '../tooltip'; -import { uiCmd } from '../cmd'; -import { uiRapidFeatureToggleDialog } from '../rapid_feature_toggle_dialog'; -import { uiRapidPowerUserFeaturesDialog } from '../rapid_poweruser_features_dialog'; + +import { uiCmd } from '../cmd.js'; +import { uiRapidFeatureToggleDialog } from '../rapid_feature_toggle_dialog.js'; +import { uiRapidPowerUserFeaturesDialog } from '../rapid_poweruser_features_dialog.js'; +import { uiTooltip } from '../tooltip.js'; export function uiToolRapidFeatures(context) { diff --git a/modules/ui/tools/save.js b/modules/ui/tools/save.js index d3182ee475..c03aa4dd7c 100644 --- a/modules/ui/tools/save.js +++ b/modules/ui/tools/save.js @@ -1,8 +1,8 @@ import { interpolateRgb as d3_interpolateRgb } from 'd3-interpolate'; -import { uiIcon } from '../icon'; -import { uiCmd } from '../cmd'; -import { uiTooltip } from '../tooltip'; +import { uiCmd } from '../cmd.js'; +import { uiIcon } from '../icon.js'; +import { uiTooltip } from '../tooltip.js'; export function uiToolSave(context) { diff --git a/modules/ui/tools/sidebar_toggle.js b/modules/ui/tools/sidebar_toggle.js index 8756ebbac1..369b9082a3 100644 --- a/modules/ui/tools/sidebar_toggle.js +++ b/modules/ui/tools/sidebar_toggle.js @@ -1,5 +1,5 @@ -import { uiIcon } from '../icon'; -import { uiTooltip } from '../tooltip'; +import { uiIcon } from '../icon.js'; +import { uiTooltip } from '../tooltip.js'; export function uiToolSidebarToggle(context) { diff --git a/modules/ui/tools/undo_redo.js b/modules/ui/tools/undo_redo.js index 6212b2b207..eeab45ddd7 100644 --- a/modules/ui/tools/undo_redo.js +++ b/modules/ui/tools/undo_redo.js @@ -1,9 +1,9 @@ import { select as d3_select } from 'd3-selection'; -import debounce from 'lodash-es/debounce'; +import debounce from 'lodash-es/debounce.js'; -import { uiIcon } from '../icon'; -import { uiCmd } from '../cmd'; -import { uiTooltip } from '../tooltip'; +import { uiCmd } from '../cmd.js'; +import { uiIcon } from '../icon.js'; +import { uiTooltip } from '../tooltip.js'; export function uiToolUndoRedo(context) { diff --git a/modules/ui/tooltip.js b/modules/ui/tooltip.js index 54f89fd36a..67bd6dc86f 100644 --- a/modules/ui/tooltip.js +++ b/modules/ui/tooltip.js @@ -1,8 +1,8 @@ import { select as d3_select } from 'd3-selection'; -import { utilFunctor } from '../util/util'; -import { uiPopover } from './popover'; -import { uiCmd } from './cmd'; +import { uiPopover } from './popover.js'; +import { uiCmd } from './cmd.js'; +import { utilFunctor } from '../util/util.js'; export function uiTooltip(context) { diff --git a/modules/ui/top_toolbar.js b/modules/ui/top_toolbar.js index 986a913ece..9f016fcb32 100644 --- a/modules/ui/top_toolbar.js +++ b/modules/ui/top_toolbar.js @@ -3,7 +3,7 @@ import { select as d3_select } from 'd3-selection'; import { uiToolRapidFeatures, uiToolDrawModes, uiToolNotes, uiToolSave, uiToolSidebarToggle, uiToolUndoRedo, uiToolDownloadOsc -} from './tools'; +} from './tools/index.js'; export function uiTopToolbar(context) { diff --git a/modules/ui/version.js b/modules/ui/version.js index f26921f23a..629913aa1d 100644 --- a/modules/ui/version.js +++ b/modules/ui/version.js @@ -1,5 +1,5 @@ -import { uiIcon } from './icon'; -import { uiTooltip } from './tooltip'; +import { uiIcon } from './icon.js'; +import { uiTooltip } from './tooltip.js'; // These are module variables so they are preserved through a ui.restart() diff --git a/modules/ui/view_on_keepRight.js b/modules/ui/view_on_keepRight.js index c150960283..cf711415c2 100644 --- a/modules/ui/view_on_keepRight.js +++ b/modules/ui/view_on_keepRight.js @@ -1,5 +1,5 @@ -import { uiIcon } from './icon'; -import { QAItem } from '../osm'; +import { QAItem } from '../osm/index.js'; +import { uiIcon } from './icon.js'; export function uiViewOnKeepRight(context) { diff --git a/modules/ui/view_on_osm.js b/modules/ui/view_on_osm.js index 918c1d5601..2f089566da 100644 --- a/modules/ui/view_on_osm.js +++ b/modules/ui/view_on_osm.js @@ -1,5 +1,5 @@ -import { osmEntity, osmNote } from '../osm'; -import { uiIcon } from './icon'; +import { osmEntity, osmNote } from '../osm/index.js'; +import { uiIcon } from './icon.js'; export function uiViewOnOSM(context) { diff --git a/modules/ui/view_on_osmose.js b/modules/ui/view_on_osmose.js index 08fdf8ff86..e0be4579ea 100644 --- a/modules/ui/view_on_osmose.js +++ b/modules/ui/view_on_osmose.js @@ -1,5 +1,5 @@ -import { uiIcon } from './icon'; -import { QAItem } from '../osm'; +import { QAItem } from '../osm/index.js'; +import { uiIcon } from './icon.js'; export function uiViewOnOsmose(context) { diff --git a/modules/ui/zoom.js b/modules/ui/zoom.js index 8baa52613b..cc076bb791 100644 --- a/modules/ui/zoom.js +++ b/modules/ui/zoom.js @@ -1,9 +1,9 @@ import { select as d3_select } from 'd3-selection'; -import { uiIcon } from './icon'; -import { uiCmd } from './cmd'; -import { uiTooltip } from './tooltip'; -import { utilKeybinding } from '../util/keybinding'; +import { uiIcon } from './icon.js'; +import { uiCmd } from './cmd.js'; +import { uiTooltip } from './tooltip.js'; +import { utilKeybinding } from '../util/keybinding.js'; export function uiZoom(context) { diff --git a/modules/ui/zoom_to_selection.js b/modules/ui/zoom_to_selection.js index b93c1e8a6d..6f35762d4e 100644 --- a/modules/ui/zoom_to_selection.js +++ b/modules/ui/zoom_to_selection.js @@ -1,5 +1,5 @@ -import { uiTooltip } from './tooltip'; -import { uiIcon } from './icon'; +import { uiIcon } from './icon.js'; +import { uiTooltip } from './tooltip.js'; export function uiZoomToSelection(context) { diff --git a/modules/util/index.js b/modules/util/index.js index bb6c5425e8..406c4f1bca 100644 --- a/modules/util/index.js +++ b/modules/util/index.js @@ -1,15 +1,17 @@ -export { utilDetect } from './detect'; -export { utilFastMouse } from './util'; -export { utilFetchResponse, FetchError } from './fetch_response'; -export { utilFunctor } from './util'; -export { utilGetSetValue } from './get_set_value'; -export { utilIsColorValid } from './util'; -export { utilHighlightEntities } from './util'; -export { utilKeybinding } from './keybinding'; -export { utilNoAuto } from './util'; -export { utilRebind } from './rebind'; -export { utilSetTransform } from './util'; -export { utilTotalExtent } from './util'; -export { utilTriggerEvent } from './trigger_event'; -export { utilWrap } from './util'; +export { utilDetect } from './detect.js'; +export { utilFastMouse } from './util.js'; +export { utilFetchResponse, FetchError } from './fetch_response.js'; +export { utilFunctor } from './util.js'; +export { utilGetDimensions } from './dimensions.js'; +export { utilGetSetValue } from './get_set_value.js'; +export { utilIsColorValid } from './util.js'; +export { utilHighlightEntities } from './util.js'; +export { utilKeybinding } from './keybinding.js'; +export { utilNoAuto } from './util.js'; +export { utilRebind } from './rebind.js'; +export { utilSetDimensions } from './dimensions.js'; +export { utilSetTransform } from './util.js'; +export { utilTotalExtent } from './util.js'; +export { utilTriggerEvent } from './trigger_event.js'; +export { utilWrap } from './util.js'; diff --git a/modules/validations/almost_junction.js b/modules/validations/almost_junction.js index 61406fea29..3beefd6e8b 100644 --- a/modules/validations/almost_junction.js +++ b/modules/validations/almost_junction.js @@ -3,12 +3,12 @@ import { geomLineIntersection, vecAngle, vecInterp } from '@rapid-sdk/math'; -import { actionAddMidpoint } from '../actions/add_midpoint'; -import { actionChangeTags } from '../actions/change_tags'; -import { actionMergeNodes } from '../actions/merge_nodes'; -import { geoHasSelfIntersections } from '../geo'; -import { osmRoutableHighwayTagValues } from '../osm/tags'; -import { ValidationIssue, ValidationFix } from '../core/lib'; +import { actionAddMidpoint } from '../actions/add_midpoint.js'; +import { actionChangeTags } from '../actions/change_tags.js'; +import { actionMergeNodes } from '../actions/merge_nodes.js'; +import { geoHasSelfIntersections } from '../geo/index.js'; +import { osmRoutableHighwayTagValues } from '../osm/tags.js'; +import { ValidationIssue, ValidationFix } from '../core/lib/index.js'; /** diff --git a/modules/validations/ambiguous_crossing_tags.js b/modules/validations/ambiguous_crossing_tags.js index 2954de9390..775c70324f 100644 --- a/modules/validations/ambiguous_crossing_tags.js +++ b/modules/validations/ambiguous_crossing_tags.js @@ -1,8 +1,8 @@ import { select as d3_select } from 'd3-selection'; import { utilTagDiff } from '@rapid-sdk/util'; -import { actionChangePreset, actionChangeTags, actionSyncCrossingTags } from '../actions'; -import { Difference, ValidationIssue, ValidationFix } from '../core/lib'; +import { actionChangePreset, actionChangeTags, actionSyncCrossingTags } from '../actions/index.js'; +import { Difference, ValidationIssue, ValidationFix } from '../core/lib/index.js'; /** diff --git a/modules/validations/close_nodes.js b/modules/validations/close_nodes.js index fdd2d3c4fc..e288c748ec 100644 --- a/modules/validations/close_nodes.js +++ b/modules/validations/close_nodes.js @@ -1,8 +1,8 @@ import { Extent, geoMetersToLat, geoMetersToLon, geoSphericalDistance } from '@rapid-sdk/math'; -import { actionMergeNodes } from '../actions/merge_nodes'; -import { ValidationIssue, ValidationFix } from '../core/lib'; -import { osmPathHighwayTagValues } from '../osm/tags'; +import { actionMergeNodes } from '../actions/merge_nodes.js'; +import { ValidationIssue, ValidationFix } from '../core/lib/index.js'; +import { osmPathHighwayTagValues } from '../osm/tags.js'; export function validationCloseNodes(context) { diff --git a/modules/validations/crossing_ways.js b/modules/validations/crossing_ways.js index 7c4d9ccb05..6a3e9a3ad9 100644 --- a/modules/validations/crossing_ways.js +++ b/modules/validations/crossing_ways.js @@ -4,13 +4,13 @@ import { vecAngle, vecLength } from '@rapid-sdk/math'; -import { actionAddMidpoint, actionChangeTags, actionMergeNodes, actionSplit, actionSyncCrossingTags } from '../actions'; -import { osmNode } from '../osm/node'; +import { actionAddMidpoint, actionChangeTags, actionMergeNodes, actionSplit, actionSyncCrossingTags } from '../actions/index.js'; +import { osmNode } from '../osm/node.js'; import { osmFlowingWaterwayTagValues, osmPathHighwayTagValues, osmRailwayTrackTagValues, osmRoutableAerowayTags, osmRoutableHighwayTagValues -} from '../osm/tags'; -import { ValidationIssue, ValidationFix } from '../core/lib'; +} from '../osm/tags.js'; +import { ValidationIssue, ValidationFix } from '../core/lib/index.js'; export function validationCrossingWays(context) { diff --git a/modules/validations/disconnected_way.js b/modules/validations/disconnected_way.js index fbbf7af008..acb468c666 100644 --- a/modules/validations/disconnected_way.js +++ b/modules/validations/disconnected_way.js @@ -1,8 +1,8 @@ import { Extent } from '@rapid-sdk/math'; -import { operationDelete } from '../operations/delete'; -import { osmRoutableHighwayTagValues } from '../osm/tags'; -import { ValidationIssue, ValidationFix } from '../core/lib'; +import { operationDelete } from '../operations/delete.js'; +import { osmRoutableHighwayTagValues } from '../osm/tags.js'; +import { ValidationIssue, ValidationFix } from '../core/lib/index.js'; export function validationDisconnectedWay(context) { diff --git a/modules/validations/duplicate_way_segments.js b/modules/validations/duplicate_way_segments.js index 2026635707..30345c86fb 100644 --- a/modules/validations/duplicate_way_segments.js +++ b/modules/validations/duplicate_way_segments.js @@ -1,4 +1,4 @@ -import { ValidationIssue, ValidationFix } from '../core/lib'; +import { ValidationIssue, ValidationFix } from '../core/lib/index.js'; // This validation determines whether way segments are duplicated atop one another, diff --git a/modules/validations/help_request.js b/modules/validations/help_request.js index f848516f4c..e060c1afa9 100644 --- a/modules/validations/help_request.js +++ b/modules/validations/help_request.js @@ -1,4 +1,4 @@ -import { ValidationIssue, ValidationFix } from '../core/lib'; +import { ValidationIssue, ValidationFix } from '../core/lib/index.js'; export function validationHelpRequest(context) { diff --git a/modules/validations/impossible_oneway.js b/modules/validations/impossible_oneway.js index 5d2b3c8ad1..72a609f90c 100644 --- a/modules/validations/impossible_oneway.js +++ b/modules/validations/impossible_oneway.js @@ -1,8 +1,8 @@ import { Extent } from '@rapid-sdk/math'; -import { actionReverse } from '../actions/reverse'; -import { osmFlowingWaterwayTagValues, osmRoutableHighwayTagValues } from '../osm/tags'; -import { ValidationIssue, ValidationFix } from '../core/lib'; +import { actionReverse } from '../actions/reverse.js'; +import { osmFlowingWaterwayTagValues, osmRoutableHighwayTagValues } from '../osm/tags.js'; +import { ValidationIssue, ValidationFix } from '../core/lib/index.js'; export function validationImpossibleOneway(context) { diff --git a/modules/validations/incompatible_source.js b/modules/validations/incompatible_source.js index 439611eee1..9d2a71f072 100644 --- a/modules/validations/incompatible_source.js +++ b/modules/validations/incompatible_source.js @@ -1,4 +1,4 @@ -import { ValidationIssue, ValidationFix } from '../core/lib'; +import { ValidationIssue, ValidationFix } from '../core/lib/index.js'; export function validationIncompatibleSource(context) { diff --git a/modules/validations/index.js b/modules/validations/index.js index 2fa7f89a55..95a75f7806 100644 --- a/modules/validations/index.js +++ b/modules/validations/index.js @@ -1,19 +1,19 @@ -export { validationAlmostJunction } from './almost_junction'; -export { validationCloseNodes } from './close_nodes'; -export { validationAmbiguousCrossingTags } from './ambiguous_crossing_tags'; -export { validationCrossingWays } from './crossing_ways'; -export { validationDisconnectedWay } from './disconnected_way'; -export { validationDuplicateWaySegments } from './duplicate_way_segments'; -export { validationFormatting } from './invalid_format'; -export { validationHelpRequest } from './help_request'; -export { validationImpossibleOneway } from './impossible_oneway'; -export { validationIncompatibleSource } from './incompatible_source'; -export { validationMismatchedGeometry } from './mismatched_geometry'; -export { validationMissingRole } from './missing_role'; -export { validationMissingTag } from './missing_tag'; -export { validationOutdatedTags } from './outdated_tags'; -export { validationPrivateData } from './private_data'; -// export { validationShortRoad } from './short_road'; -export { validationYShapedConnection } from './y_shaped_connection'; -export { validationSuspiciousName } from './suspicious_name'; -export { validationUnsquareWay } from './unsquare_way'; +export { validationAlmostJunction } from './almost_junction.js'; +export { validationCloseNodes } from './close_nodes.js'; +export { validationAmbiguousCrossingTags } from './ambiguous_crossing_tags.js'; +export { validationCrossingWays } from './crossing_ways.js'; +export { validationDisconnectedWay } from './disconnected_way.js'; +export { validationDuplicateWaySegments } from './duplicate_way_segments.js'; +export { validationFormatting } from './invalid_format.js'; +export { validationHelpRequest } from './help_request.js'; +export { validationImpossibleOneway } from './impossible_oneway.js'; +export { validationIncompatibleSource } from './incompatible_source.js'; +export { validationMismatchedGeometry } from './mismatched_geometry.js'; +export { validationMissingRole } from './missing_role.js'; +export { validationMissingTag } from './missing_tag.js'; +export { validationOutdatedTags } from './outdated_tags.js'; +export { validationPrivateData } from './private_data.js'; +// export { validationShortRoad } from './short_road.js'; +export { validationYShapedConnection } from './y_shaped_connection.js'; +export { validationSuspiciousName } from './suspicious_name.js'; +export { validationUnsquareWay } from './unsquare_way.js'; diff --git a/modules/validations/invalid_format.js b/modules/validations/invalid_format.js index 8d21e173a5..c3dd3f8be1 100644 --- a/modules/validations/invalid_format.js +++ b/modules/validations/invalid_format.js @@ -1,4 +1,4 @@ -import { ValidationIssue } from '../core/lib'; +import { ValidationIssue } from '../core/lib/index.js'; export function validationFormatting(context) { diff --git a/modules/validations/mismatched_geometry.js b/modules/validations/mismatched_geometry.js index 2cd67585ab..6b149a8e23 100644 --- a/modules/validations/mismatched_geometry.js +++ b/modules/validations/mismatched_geometry.js @@ -2,14 +2,14 @@ import { geoSphericalDistance } from '@rapid-sdk/math'; import { utilTagText } from '@rapid-sdk/util'; import deepEqual from 'fast-deep-equal'; -import { actionAddVertex } from '../actions/add_vertex'; -import { actionChangeTags } from '../actions/change_tags'; -import { actionMergeNodes } from '../actions/merge_nodes'; -import { actionExtract } from '../actions/extract'; -import { osmJoinWays } from '../osm/multipolygon'; -import { osmNodeGeometriesForTags, osmTagSuggestingArea } from '../osm/tags'; -import { geoHasSelfIntersections } from '../geo'; -import { ValidationIssue, ValidationFix } from '../core/lib'; +import { actionAddVertex } from '../actions/add_vertex.js'; +import { actionChangeTags } from '../actions/change_tags.js'; +import { actionMergeNodes } from '../actions/merge_nodes.js'; +import { actionExtract } from '../actions/extract.js'; +import { osmJoinWays } from '../osm/multipolygon.js'; +import { osmNodeGeometriesForTags, osmTagSuggestingArea } from '../osm/tags.js'; +import { geoHasSelfIntersections } from '../geo/index.js'; +import { ValidationIssue, ValidationFix } from '../core/lib/index.js'; export function validationMismatchedGeometry(context) { diff --git a/modules/validations/missing_role.js b/modules/validations/missing_role.js index 9d293bfbd3..aa9ed9a343 100644 --- a/modules/validations/missing_role.js +++ b/modules/validations/missing_role.js @@ -1,6 +1,6 @@ -import { actionChangeMember } from '../actions/change_member'; -import { actionDeleteMember } from '../actions/delete_member'; -import { ValidationIssue, ValidationFix } from '../core/lib'; +import { actionChangeMember } from '../actions/change_member.js'; +import { actionDeleteMember } from '../actions/delete_member.js'; +import { ValidationIssue, ValidationFix } from '../core/lib/index.js'; export function validationMissingRole(context) { diff --git a/modules/validations/missing_tag.js b/modules/validations/missing_tag.js index 632dc8d3dc..8e6f5760b5 100644 --- a/modules/validations/missing_tag.js +++ b/modules/validations/missing_tag.js @@ -1,7 +1,7 @@ -import { operationDelete } from '../operations/delete'; -import { osmIsInterestingTag } from '../osm/tags'; -import { osmOldMultipolygonOuterMemberOfRelation } from '../osm/multipolygon'; -import { ValidationIssue, ValidationFix } from '../core/lib'; +import { operationDelete } from '../operations/delete.js'; +import { osmIsInterestingTag } from '../osm/tags.js'; +import { osmOldMultipolygonOuterMemberOfRelation } from '../osm/multipolygon.js'; +import { ValidationIssue, ValidationFix } from '../core/lib/index.js'; export function validationMissingTag(context) { diff --git a/modules/validations/outdated_tags.js b/modules/validations/outdated_tags.js index 9ef479477a..45735b32e9 100644 --- a/modules/validations/outdated_tags.js +++ b/modules/validations/outdated_tags.js @@ -1,10 +1,10 @@ import { utilHashcode, utilTagDiff } from '@rapid-sdk/util'; -import { actionChangePreset } from '../actions/change_preset'; -import { actionChangeTags } from '../actions/change_tags'; -import { actionUpgradeTags } from '../actions/upgrade_tags'; -import { osmIsOldMultipolygonOuterMember, osmOldMultipolygonOuterMemberOfRelation } from '../osm/multipolygon'; -import { ValidationIssue, ValidationFix } from '../core/lib'; +import { actionChangePreset } from '../actions/change_preset.js'; +import { actionChangeTags } from '../actions/change_tags.js'; +import { actionUpgradeTags } from '../actions/upgrade_tags.js'; +import { osmIsOldMultipolygonOuterMember, osmOldMultipolygonOuterMemberOfRelation } from '../osm/multipolygon.js'; +import { ValidationIssue, ValidationFix } from '../core/lib/index.js'; const pathVals = new Set([ diff --git a/modules/validations/private_data.js b/modules/validations/private_data.js index f41a4c273c..90e851d260 100644 --- a/modules/validations/private_data.js +++ b/modules/validations/private_data.js @@ -1,7 +1,7 @@ import { utilTagDiff } from '@rapid-sdk/util'; -import { actionChangeTags } from '../actions/change_tags'; -import { ValidationIssue, ValidationFix } from '../core/lib'; +import { actionChangeTags } from '../actions/change_tags.js'; +import { ValidationIssue, ValidationFix } from '../core/lib/index.js'; export function validationPrivateData(context) { diff --git a/modules/validations/short_road.js b/modules/validations/short_road.js index c8a3ae3e33..699c161aee 100644 --- a/modules/validations/short_road.js +++ b/modules/validations/short_road.js @@ -1,7 +1,7 @@ import { Extent, geoSphericalDistance } from '@rapid-sdk/math'; -import { operationDelete } from '../operations/index'; -import { ValidationIssue, ValidationFix } from '../core/lib'; +import { operationDelete } from '../operations/index.js'; +import { ValidationIssue, ValidationFix } from '../core/lib/index.js'; export function validationShortRoad(context) { diff --git a/modules/validations/suspicious_name.js b/modules/validations/suspicious_name.js index f1d080859c..d62d30126c 100644 --- a/modules/validations/suspicious_name.js +++ b/modules/validations/suspicious_name.js @@ -1,5 +1,5 @@ -import { actionChangeTags } from '../actions/change_tags'; -import { ValidationIssue, ValidationFix } from '../core/lib'; +import { actionChangeTags } from '../actions/change_tags.js'; +import { ValidationIssue, ValidationFix } from '../core/lib/index.js'; export function validationSuspiciousName(context) { diff --git a/modules/validations/unsquare_way.js b/modules/validations/unsquare_way.js index 51b185311d..59f4714291 100644 --- a/modules/validations/unsquare_way.js +++ b/modules/validations/unsquare_way.js @@ -1,7 +1,7 @@ -//import { actionChangeTags } from '../actions/change_tags'; -import { actionOrthogonalize } from '../actions/orthogonalize'; -import { geoOrthoCanOrthogonalize } from '../geo/ortho'; -import { ValidationIssue, ValidationFix } from '../core/lib'; +//import { actionChangeTags } from '../actions/change_tags.js'; +import { actionOrthogonalize } from '../actions/orthogonalize.js'; +import { geoOrthoCanOrthogonalize } from '../geo/ortho.js'; +import { ValidationIssue, ValidationFix } from '../core/lib/index.js'; export function validationUnsquareWay(context) { diff --git a/modules/validations/y_shaped_connection.js b/modules/validations/y_shaped_connection.js index aa36f0a9bf..cc8c84da3e 100644 --- a/modules/validations/y_shaped_connection.js +++ b/modules/validations/y_shaped_connection.js @@ -1,7 +1,7 @@ import { geoSphericalDistance, vecAngle } from '@rapid-sdk/math'; -import { operationDelete } from '../operations/index'; -import { ValidationIssue, ValidationFix } from '../core/lib'; +import { operationDelete } from '../operations/index.js'; +import { ValidationIssue, ValidationFix } from '../core/lib/index.js'; export function validationYShapedConnection(context) { From 329f60557d60b744da2e28f700e01db85fac0d2a Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Wed, 17 Jan 2024 12:47:31 -0500 Subject: [PATCH 03/55] Start moving over the actions from browser tests to node tests Also created "headless.js" for code that can run without a browser. We may need a esbuild step for this eventually, but for now this is all code that should be able to run directly in vanilla JS / node with no complication step. --- modules/headless.js | 30 +++ package-lock.json | 180 ++++++++++++-- package.json | 7 +- test/browser/actions/add_entity.js | 7 - test/browser/actions/add_member.js | 220 ----------------- test/browser/actions/add_midpoint.js | 54 ----- test/browser/actions/noop.js | 7 - test/index.html | 182 ++++++-------- test/unit/actions/add_entity.test.js | 12 + test/unit/actions/add_member.test.js | 222 ++++++++++++++++++ test/unit/actions/add_midpoint.test.js | 66 ++++++ .../actions/change_member.test.js} | 9 +- .../actions/change_preset.test.js} | 9 +- .../actions/change_tags.test.js} | 9 +- .../actions/circularize.test.js} | 27 ++- .../actions/connect.test.js} | 11 +- .../actions/copy_entities.test.js} | 9 +- .../actions/delete_member.test.js} | 9 +- .../actions/delete_multiple.test.js} | 11 +- .../actions/delete_node.test.js} | 9 +- .../actions/delete_relation.test.js} | 11 +- .../actions/delete_way.test.js} | 11 +- .../actions/discard_tags.test.js} | 9 +- .../actions/disconnect.test.js} | 11 +- .../actions/extract.test.js} | 27 ++- .../join.js => unit/actions/join.test.js} | 11 +- .../merge.js => unit/actions/merge.test.js} | 9 +- .../actions/merge_nodes.test.js} | 11 +- .../actions/merge_polygon.test.js} | 10 +- .../actions/merge_remote_changes.test.js} | 29 ++- .../move.js => unit/actions/move.test.js} | 13 +- .../actions/move_node.test.js} | 11 +- test/unit/actions/noop.test.js | 12 + .../actions/orthogonalize.test.js} | 31 ++- .../actions/reflect.test.js} | 13 +- .../actions/restrict_turn.test.js} | 9 +- .../actions/reverse.test.js} | 25 +- .../revert.js => unit/actions/revert.test.js} | 19 +- .../split.js => unit/actions/split.test.js} | 27 ++- .../actions/straighten_nodes.test.js} | 11 +- .../actions/straighten_way.test.js} | 15 +- .../actions/unrestrict_turn.test.js} | 9 +- .../actions/upgrade_tags.test.js} | 9 +- 43 files changed, 911 insertions(+), 522 deletions(-) create mode 100644 modules/headless.js delete mode 100644 test/browser/actions/add_entity.js delete mode 100644 test/browser/actions/add_member.js delete mode 100644 test/browser/actions/add_midpoint.js delete mode 100644 test/browser/actions/noop.js create mode 100644 test/unit/actions/add_entity.test.js create mode 100644 test/unit/actions/add_member.test.js create mode 100644 test/unit/actions/add_midpoint.test.js rename test/{browser/actions/change_member.js => unit/actions/change_member.test.js} (62%) rename test/{browser/actions/change_preset.js => unit/actions/change_preset.test.js} (82%) rename test/{browser/actions/change_tags.js => unit/actions/change_tags.test.js} (52%) rename test/{browser/actions/circularize.js => unit/actions/circularize.test.js} (94%) rename test/{browser/actions/connect.js => unit/actions/connect.test.js} (98%) rename test/{browser/actions/copy_entities.js => unit/actions/copy_entities.test.js} (90%) rename test/{browser/actions/delete_member.js => unit/actions/delete_member.test.js} (74%) rename test/{browser/actions/delete_multiple.js => unit/actions/delete_multiple.test.js} (82%) rename test/{browser/actions/delete_node.js => unit/actions/delete_node.test.js} (90%) rename test/{browser/actions/delete_relation.js => unit/actions/delete_relation.test.js} (93%) rename test/{browser/actions/delete_way.js => unit/actions/delete_way.test.js} (94%) rename test/{browser/actions/discard_tags.js => unit/actions/discard_tags.test.js} (85%) rename test/{browser/actions/disconnect.js => unit/actions/disconnect.test.js} (97%) rename test/{browser/actions/extract.js => unit/actions/extract.test.js} (97%) rename test/{browser/actions/join.js => unit/actions/join.test.js} (99%) rename test/{browser/actions/merge.js => unit/actions/merge.test.js} (90%) rename test/{browser/actions/merge_nodes.js => unit/actions/merge_nodes.test.js} (95%) rename test/{browser/actions/merge_polygon.js => unit/actions/merge_polygon.test.js} (95%) rename test/{browser/actions/merge_remote_changes.js => unit/actions/merge_remote_changes.test.js} (98%) rename test/{browser/actions/move.js => unit/actions/move.test.js} (90%) rename test/{browser/actions/move_node.js => unit/actions/move_node.test.js} (84%) create mode 100644 test/unit/actions/noop.test.js rename test/{browser/actions/orthogonalize.js => unit/actions/orthogonalize.test.js} (97%) rename test/{browser/actions/reflect.js => unit/actions/reflect.test.js} (96%) rename test/{browser/actions/restrict_turn.js => unit/actions/restrict_turn.test.js} (90%) rename test/{browser/actions/reverse.js => unit/actions/reverse.test.js} (97%) rename test/{browser/actions/revert.js => unit/actions/revert.test.js} (95%) rename test/{browser/actions/split.js => unit/actions/split.test.js} (98%) rename test/{browser/actions/straighten_nodes.js => unit/actions/straighten_nodes.test.js} (93%) rename test/{browser/actions/straighten_way.js => unit/actions/straighten_way.test.js} (95%) rename test/{browser/actions/unrestrict_turn.js => unit/actions/unrestrict_turn.test.js} (77%) rename test/{browser/actions/upgrade_tags.js => unit/actions/upgrade_tags.test.js} (96%) diff --git a/modules/headless.js b/modules/headless.js new file mode 100644 index 0000000000..4b06c9f340 --- /dev/null +++ b/modules/headless.js @@ -0,0 +1,30 @@ +// Just a few core components that we could use to +// support a headless (no browser) Rapid for testing + +export * from './actions/index.js'; +export * from './core/lib/index.js'; +export * from './osm/index.js'; +export * from './util/index.js'; + +// Reexport only what our tests use, see iD#4379 +import * as D3 from 'd3'; +export const d3 = { + polygonArea: D3.polygonArea, + polygonCentroid: D3.polygonCentroid, + select: D3.select, + selectAll: D3.selectAll, + timerFlush: D3.timerFlush +}; + +// Reexport the sdk things that our tests use too +import * as SDKMATH from '@rapid-sdk/math'; +import * as SDKUTIL from '@rapid-sdk/util'; +export const sdk = { + Projection: SDKMATH.Projection, + Extent: SDKMATH.Extent, + geoSphericalDistance: SDKMATH.geoSphericalDistance, + geoZoomToScale: SDKMATH.geoZoomToScale, + vecLength: SDKMATH.vecLength, + utilQsString: SDKUTIL.utilQsString, + utilStringQs: SDKUTIL.utilStringQs +}; diff --git a/package-lock.json b/package-lock.json index ff6b1a4947..e7f62f9825 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@rapideditor/rapid", - "version": "2.2.3", + "version": "2.2.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@rapideditor/rapid", - "version": "2.2.3", + "version": "2.2.4", "license": "ISC", "dependencies": { "@mapbox/geojson-area": "^0.2.2", @@ -54,6 +54,7 @@ "autoprefixer": "^10.4.16", "benchmark": "^2.1.4", "btoa": "^1.2.1", + "c8": "^8.0.1", "chai": "^4.4.0", "chalk": "^5.3.0", "cldr-core": "44.1.0", @@ -458,6 +459,12 @@ "node": ">=6.9.0" } }, + "node_modules/@bcoe/v8-coverage": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", + "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", + "dev": true + }, "node_modules/@colors/colors": { "version": "1.5.0", "dev": true, @@ -1733,6 +1740,12 @@ "version": "7946.0.10", "license": "MIT" }, + "node_modules/@types/istanbul-lib-coverage": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz", + "integrity": "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==", + "dev": true + }, "node_modules/@types/node": { "version": "18.11.18", "dev": true, @@ -2136,6 +2149,54 @@ "node": ">= 0.8" } }, + "node_modules/c8": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/c8/-/c8-8.0.1.tgz", + "integrity": "sha512-EINpopxZNH1mETuI0DzRA4MZpAUH+IFiRhnmFD3vFr3vdrgxqi3VfE3KL0AIL+zDq8rC9bZqwM/VDmmoe04y7w==", + "dev": true, + "dependencies": { + "@bcoe/v8-coverage": "^0.2.3", + "@istanbuljs/schema": "^0.1.3", + "find-up": "^5.0.0", + "foreground-child": "^2.0.0", + "istanbul-lib-coverage": "^3.2.0", + "istanbul-lib-report": "^3.0.1", + "istanbul-reports": "^3.1.6", + "rimraf": "^3.0.2", + "test-exclude": "^6.0.0", + "v8-to-istanbul": "^9.0.0", + "yargs": "^17.7.2", + "yargs-parser": "^21.1.1" + }, + "bin": { + "c8": "bin/c8.js" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/c8/node_modules/foreground-child": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", + "integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/c8/node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "engines": { + "node": ">=12" + } + }, "node_modules/call-bind": { "version": "1.0.2", "dev": true, @@ -5051,16 +5112,17 @@ } }, "node_modules/istanbul-lib-report": { - "version": "3.0.0", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.1.tgz", + "integrity": "sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==", "dev": true, - "license": "BSD-3-Clause", "dependencies": { "istanbul-lib-coverage": "^3.0.0", - "make-dir": "^3.0.0", + "make-dir": "^4.0.0", "supports-color": "^7.1.0" }, "engines": { - "node": ">=8" + "node": ">=10" } }, "node_modules/istanbul-lib-source-maps": { @@ -5077,9 +5139,10 @@ } }, "node_modules/istanbul-reports": { - "version": "3.1.5", + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.1.6.tgz", + "integrity": "sha512-TLgnMkKg3iTDsQ9PbPTdpfAK2DzjF9mqUG7RMgcQl8oFjad8ob4laGxv5XV5U9MAfx8D6tSJiUyuAwzLicaxlg==", "dev": true, - "license": "BSD-3-Clause", "dependencies": { "html-escaper": "^2.0.0", "istanbul-lib-report": "^3.0.0" @@ -5810,19 +5873,53 @@ } }, "node_modules/make-dir": { - "version": "3.1.0", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz", + "integrity": "sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==", "dev": true, - "license": "MIT", "dependencies": { - "semver": "^6.0.0" + "semver": "^7.5.3" }, "engines": { - "node": ">=8" + "node": ">=10" }, "funding": { "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/make-dir/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/make-dir/node_modules/semver": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/make-dir/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, "node_modules/map-obj": { "version": "1.0.1", "dev": true, @@ -8346,6 +8443,40 @@ "dev": true, "license": "BSD-2-Clause" }, + "node_modules/test-exclude": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "dev": true, + "dependencies": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/test-exclude/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/text-hex": { "version": "1.0.0", "dev": true, @@ -8640,6 +8771,26 @@ "node": ">= 0.4.0" } }, + "node_modules/v8-to-istanbul": { + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.2.0.tgz", + "integrity": "sha512-/EH/sDgxU2eGxajKdwLCDmQ4FWq+kpi3uCmBGpw1xJtnAxEjlD8j8PEiGWpCIMIs3ciNAgH0d3TTJiUkYzyZjA==", + "dev": true, + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.12", + "@types/istanbul-lib-coverage": "^2.0.1", + "convert-source-map": "^2.0.0" + }, + "engines": { + "node": ">=10.12.0" + } + }, + "node_modules/v8-to-istanbul/node_modules/convert-source-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", + "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==", + "dev": true + }, "node_modules/validate-npm-package-license": { "version": "3.0.4", "dev": true, @@ -9021,9 +9172,10 @@ "license": "ISC" }, "node_modules/yargs": { - "version": "17.6.2", + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", "dev": true, - "license": "MIT", "dependencies": { "cliui": "^8.0.1", "escalade": "^3.1.1", diff --git a/package.json b/package.json index 4d330241ba..428b21768f 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,6 @@ "name": "@rapideditor/rapid", "version": "2.2.4", "description": "An AI-enhanced editor for OpenStreetMap", - "main": "dist/rapid.min.js", "repository": "github:facebook/Rapid", "homepage": "https://rapideditor.org", "bugs": "https://github.com/facebook/Rapid/issues", @@ -11,6 +10,8 @@ "openstreetmap" ], "license": "ISC", + "type": "module", + "main": "dist/rapid.min.js", "scripts": { "all": "run-s clean build dist", "benchmark": "run-p start:server test:benchmark", @@ -45,7 +46,7 @@ "test": "npm-run-all -s lint build test:unit test:browser", "test:benchmark": "npm run test:unzip-benchmark-data && npx playwright test --workers=1 --config=test/benchmark/playwright.config.mjs && npm run test:cleanup-benchmark-data", "test:browser": "karma start karma.conf.cjs", - "test:unit": "echo not yet", + "test:unit": "c8 node --test test/unit", "test:unzip-benchmark-data": "tar -xvf test/benchmark/tokyo_canned_data.zip -C test/benchmark", "test:cleanup-benchmark-data": "rm test/benchmark/tokyo_*_canned_osm_data.js", "translations": "node scripts/update_locales.js" @@ -96,6 +97,7 @@ "autoprefixer": "^10.4.16", "benchmark": "^2.1.4", "btoa": "^1.2.1", + "c8": "^8.0.1", "chai": "^4.4.0", "chalk": "^5.3.0", "cldr-core": "44.1.0", @@ -132,7 +134,6 @@ "static-server": "^2.2.1", "svg-sprite": "2.0.2" }, - "type": "module", "engines": { "node": ">=18" }, diff --git a/test/browser/actions/add_entity.js b/test/browser/actions/add_entity.js deleted file mode 100644 index 3c450c99a0..0000000000 --- a/test/browser/actions/add_entity.js +++ /dev/null @@ -1,7 +0,0 @@ -describe('actionAddEntity', function () { - it('adds an entity to the graph', function () { - var entity = Rapid.osmEntity(), - graph = Rapid.actionAddEntity(entity)(new Rapid.Graph()); - expect(graph.entity(entity.id)).to.equal(entity); - }); -}); diff --git a/test/browser/actions/add_member.js b/test/browser/actions/add_member.js deleted file mode 100644 index 3f076bf4d4..0000000000 --- a/test/browser/actions/add_member.js +++ /dev/null @@ -1,220 +0,0 @@ -describe('actionAddMember', function() { - it('adds an member to a relation at the specified index', function() { - var r = Rapid.osmRelation({members: [{id: '1'}, {id: '3'}]}); - var g = Rapid.actionAddMember(r.id, {id: '2'}, 1)(new Rapid.Graph([r])); - expect(g.entity(r.id).members).to.eql([{id: '1'}, {id: '2'}, {id: '3'}]); - }); - - describe('inserts way members at a sensible index', function() { - function members(graph) { - return graph.entity('r').members.map(function (m) { return m.id; }); - } - - it('handles incomplete relations', function () { - var graph = new Rapid.Graph([ - Rapid.osmNode({id: 'a', loc: [0, 0]}), - Rapid.osmNode({id: 'b', loc: [0, 0]}), - Rapid.osmNode({id: 'c', loc: [0, 0]}), - Rapid.osmNode({id: 'd', loc: [0, 0]}), - Rapid.osmWay({id: '-', nodes: ['a', 'b', 'c']}), - Rapid.osmWay({id: '=', nodes: ['c','d']}), - Rapid.osmRelation({id: 'r', members: [ - {id: '~', type: 'way'}, - {id: '-', type: 'way'} - ]}) - ]); - - graph = Rapid.actionAddMember('r', {id: '=', type: 'way'})(graph); - expect(members(graph)).to.eql(['~', '-', '=']); - }); - - it('adds the member to a relation with no members', function() { - var graph = new Rapid.Graph([ - Rapid.osmNode({id: 'a', loc: [0, 0]}), - Rapid.osmNode({id: 'b', loc: [0, 0]}), - Rapid.osmWay({id: '-', nodes: ['a', 'b']}), - Rapid.osmRelation({id: 'r'}) - ]); - - graph = Rapid.actionAddMember('r', {id: '-', type: 'way'})(graph); - expect(members(graph)).to.eql(['-']); - }); - - it('appends the member if the ways are not connecting', function() { - // Before: a ---> b - // After: a ---> b .. c ===> d - var graph = new Rapid.Graph([ - Rapid.osmNode({id: 'a', loc: [0, 0]}), - Rapid.osmNode({id: 'b', loc: [0, 0]}), - Rapid.osmNode({id: 'c', loc: [0, 0]}), - Rapid.osmNode({id: 'd', loc: [0, 0]}), - Rapid.osmWay({id: '-', nodes: ['a', 'b']}), - Rapid.osmWay({id: '=', nodes: ['c', 'd']}), - Rapid.osmRelation({id: 'r', members: [ - {id: '-', type: 'way'} - ]}) - ]); - - graph = Rapid.actionAddMember('r', {id: '=', type: 'way'})(graph); - expect(members(graph)).to.eql(['-', '=']); - }); - - it('appends the member if the way connects at end', function() { - // Before: a ---> b - // After: a ---> b ===> c - var graph = new Rapid.Graph([ - Rapid.osmNode({id: 'a', loc: [0, 0]}), - Rapid.osmNode({id: 'b', loc: [0, 0]}), - Rapid.osmNode({id: 'c', loc: [0, 0]}), - Rapid.osmWay({id: '-', nodes: ['a', 'b']}), - Rapid.osmWay({id: '=', nodes: ['b', 'c']}), - Rapid.osmRelation({id: 'r', members: [ - {id: '-', type: 'way'} - ]}) - ]); - - graph = Rapid.actionAddMember('r', {id: '=', type: 'way'})(graph); - expect(members(graph)).to.eql(['-', '=']); - }); - - it('inserts the member if the way connects at beginning', function() { - // Before: b ---> c ~~~> d - // After: a ===> b ---> c ~~~> d - var graph = new Rapid.Graph([ - Rapid.osmNode({id: 'a', loc: [0, 0]}), - Rapid.osmNode({id: 'b', loc: [0, 0]}), - Rapid.osmNode({id: 'c', loc: [0, 0]}), - Rapid.osmNode({id: 'd', loc: [0, 0]}), - Rapid.osmWay({id: '=', nodes: ['a', 'b']}), - Rapid.osmWay({id: '-', nodes: ['b', 'c']}), - Rapid.osmWay({id: '~', nodes: ['c', 'd']}), - Rapid.osmRelation({id: 'r', members: [ - {id: '-', type: 'way'}, - {id: '~', type: 'way'} - ]}) - ]); - - graph = Rapid.actionAddMember('r', {id: '=', type: 'way'})(graph); - expect(members(graph)).to.eql(['=', '-', '~']); - }); - - it('inserts the member if the way connects in middle', function() { - // Before: a ---> b .. c ~~~> d - // After: a ---> b ===> c ~~~> d - var graph = new Rapid.Graph([ - Rapid.osmNode({id: 'a', loc: [0, 0]}), - Rapid.osmNode({id: 'b', loc: [0, 0]}), - Rapid.osmNode({id: 'c', loc: [0, 0]}), - Rapid.osmNode({id: 'd', loc: [0, 0]}), - Rapid.osmWay({id: '-', nodes: ['a', 'b']}), - Rapid.osmWay({id: '=', nodes: ['b', 'c']}), - Rapid.osmWay({id: '~', nodes: ['c', 'd']}), - Rapid.osmRelation({id: 'r', members: [ - {id: '-', type: 'way'}, - {id: '~', type: 'way'} - ]}) - ]); - - graph = Rapid.actionAddMember('r', {id: '=', type: 'way'})(graph); - expect(members(graph)).to.eql(['-', '=', '~']); - }); - - it('inserts the member multiple times if insertPair provided (middle)', function() { - // Before: a ---> b .. c ~~~> d <~~~ c .. b <--- a - // After: a ---> b ===> c ~~~> d <~~~ c <=== b <--- a - var graph = new Rapid.Graph([ - Rapid.osmNode({id: 'a', loc: [0, 0]}), - Rapid.osmNode({id: 'b', loc: [0, 0]}), - Rapid.osmNode({id: 'c', loc: [0, 0]}), - Rapid.osmNode({id: 'd', loc: [0, 0]}), - Rapid.osmWay({id: '-', nodes: ['a', 'b']}), - Rapid.osmWay({id: '=', nodes: ['b', 'c']}), - Rapid.osmWay({id: '~', nodes: ['c', 'd']}), - Rapid.osmRelation({id: 'r', members: [ - {id: '-', type: 'way'}, - {id: '~', type: 'way'}, - {id: '~', type: 'way'}, - {id: '-', type: 'way'} - ]}) - ]); - - var member = { id: '=', type: 'way' }; - var insertPair = { - originalID: '-', - insertedID: '=', - nodes: ['a','b','c'] - }; - graph = Rapid.actionAddMember('r', member, undefined, insertPair)(graph); - expect(members(graph)).to.eql(['-', '=', '~', '~', '=', '-']); - }); - - it('inserts the member multiple times if insertPair provided (beginning/end)', function() { - // Before: b <=== c ~~~> d <~~~ c ===> b - // After: a <--- b <=== c ~~~> d <~~~ c ===> b ---> a - var graph = new Rapid.Graph([ - Rapid.osmNode({id: 'a', loc: [0, 0]}), - Rapid.osmNode({id: 'b', loc: [0, 0]}), - Rapid.osmNode({id: 'c', loc: [0, 0]}), - Rapid.osmNode({id: 'd', loc: [0, 0]}), - Rapid.osmWay({id: '-', nodes: ['b', 'a']}), - Rapid.osmWay({id: '=', nodes: ['c', 'b']}), - Rapid.osmWay({id: '~', nodes: ['c', 'd']}), - Rapid.osmRelation({id: 'r', members: [ - {id: '=', type: 'way'}, - {id: '~', type: 'way'}, - {id: '~', type: 'way'}, - {id: '=', type: 'way'} - ]}) - ]); - - var member = { id: '-', type: 'way' }; - var insertPair = { - originalID: '=', - insertedID: '-', - nodes: ['c','b','a'] - }; - graph = Rapid.actionAddMember('r', member, undefined, insertPair)(graph); - expect(members(graph)).to.eql(['-', '=', '~', '~', '=', '-']); - }); - - it('keeps stops and platforms ordered before node, way, relation (for PTv2 routes)', function() { - var graph = new Rapid.Graph([ - Rapid.osmNode({id: 'a', loc: [0, 0]}), - Rapid.osmNode({id: 'b', loc: [0, 0]}), - Rapid.osmNode({id: 'c', loc: [0, 0]}), - Rapid.osmWay({id: '-', nodes: ['a', 'b']}), - Rapid.osmWay({id: '=', nodes: ['b', 'c']}), - Rapid.osmRelation({id: 'r', members: [ - { id: 'n1', type: 'node', role: 'stop' }, - { id: 'w1', type: 'way', role: 'platform' }, - { id: 'n2', type: 'node', role: 'stop_entry_only' }, - { id: 'w2', type: 'way', role: 'platform_entry_only' }, - { id: 'n3', type: 'node', role: 'stop_exit_only' }, - { id: 'w3', type: 'way', role: 'platform_exit_only' }, - { id: 'n10', type: 'node', role: 'forward' }, - { id: 'n11', type: 'node', role: 'forward' }, - { id: '-', type: 'way', role: 'forward' }, - { id: 'r1', type: 'relation', role: 'forward' }, - { id: 'n12', type: 'node', role: 'forward' } - ]}) - ]); - - graph = Rapid.actionAddMember('r', { id: '=', type: 'way', role: 'forward' })(graph); - expect(graph.entity('r').members).to.eql([ - { id: 'n1', type: 'node', role: 'stop' }, - { id: 'w1', type: 'way', role: 'platform' }, - { id: 'n2', type: 'node', role: 'stop_entry_only' }, - { id: 'w2', type: 'way', role: 'platform_entry_only' }, - { id: 'n3', type: 'node', role: 'stop_exit_only' }, - { id: 'w3', type: 'way', role: 'platform_exit_only' }, - { id: 'n10', type: 'node', role: 'forward' }, - { id: 'n11', type: 'node', role: 'forward' }, - { id: 'n12', type: 'node', role: 'forward' }, - { id: '-', type: 'way', role: 'forward' }, - { id: '=', type: 'way', role: 'forward' }, - { id: 'r1', type: 'relation', role: 'forward' } - ]); - }); - - }); -}); diff --git a/test/browser/actions/add_midpoint.js b/test/browser/actions/add_midpoint.js deleted file mode 100644 index f76cd063f1..0000000000 --- a/test/browser/actions/add_midpoint.js +++ /dev/null @@ -1,54 +0,0 @@ -describe('actionAddMidpoint', function () { - it('adds the node at the midpoint location', function () { - var node = Rapid.osmNode(), - a = Rapid.osmNode(), - b = Rapid.osmNode(), - midpoint = {loc: [1, 2], edge: [a.id, b.id]}, - graph = Rapid.actionAddMidpoint(midpoint, node)(new Rapid.Graph([a, b])); - - expect(graph.entity(node.id).loc).to.eql([1, 2]); - }); - - it('adds the node to a way that contains the given edge in forward order', function () { - var node = Rapid.osmNode(), - a = Rapid.osmNode(), - b = Rapid.osmNode(), - w1 = Rapid.osmWay(), - w2 = Rapid.osmWay({nodes: [a.id, b.id]}), - midpoint = {loc: [1, 2], edge: [a.id, b.id]}, - graph = Rapid.actionAddMidpoint(midpoint, node)(new Rapid.Graph([a, b, w1, w2])); - - expect(graph.entity(w1.id).nodes).to.eql([]); - expect(graph.entity(w2.id).nodes).to.eql([a.id, node.id, b.id]); - }); - - it('adds the node to a way that contains the given edge in reverse order', function () { - var node = Rapid.osmNode(), - a = Rapid.osmNode(), - b = Rapid.osmNode(), - w1 = Rapid.osmWay(), - w2 = Rapid.osmWay({nodes: [b.id, a.id]}), - midpoint = {loc: [1, 2], edge: [a.id, b.id]}, - graph = Rapid.actionAddMidpoint(midpoint, node)(new Rapid.Graph([a, b, w1, w2])); - - expect(graph.entity(w1.id).nodes).to.eql([]); - expect(graph.entity(w2.id).nodes).to.eql([b.id, node.id, a.id]); - }); - - it('turns an invalid double-back into a self-intersection', function () { - // a====b (aba) - // Expected result (converts to a valid loop): - // a---b (acba) - // \ / - // c - - var a = Rapid.osmNode(), - b = Rapid.osmNode(), - c = Rapid.osmNode(), - w = Rapid.osmWay({nodes: [a.id, b.id, a.id]}), - midpoint = {loc: [1, 2], edge: [a.id, b.id]}, - graph = Rapid.actionAddMidpoint(midpoint, c)(new Rapid.Graph([a, b, w])); - - expect(graph.entity(w.id).nodes).to.eql([a.id, c.id, b.id, a.id]); - }); -}); diff --git a/test/browser/actions/noop.js b/test/browser/actions/noop.js deleted file mode 100644 index 888474be17..0000000000 --- a/test/browser/actions/noop.js +++ /dev/null @@ -1,7 +0,0 @@ -describe('actionNoop', function () { - it('does nothing', function () { - var graph = new Rapid.Graph(), - action = Rapid.actionNoop(graph); - expect(action(graph)).to.equal(graph); - }); -}); diff --git a/test/index.html b/test/index.html index 96cfdd5b2a..2787732438 100644 --- a/test/index.html +++ b/test/index.html @@ -28,113 +28,77 @@