Make several data external instead of bundled:

Also dist/data/* contains minified files now

These are now external and will fetch as needed:
-export { dataAddressFormats } from './address-formats.json';
-export { dataDeprecated } from './deprecated.json';
-export { dataDiscarded } from './discarded.json';
-export { dataLanguages } from './languages.json';
-export { dataPhoneFormats } from './phone-formats.json';
-export { dataShortcuts } from './shortcuts.json';
-export { dataTerritoryLanguages } from './territory-languages.json';
This commit is contained in:
Bryan Housel
2020-01-28 22:21:31 -05:00
parent 3ac800c619
commit 567eeac587
40 changed files with 2815 additions and 3193 deletions

View File

@@ -18,6 +18,11 @@ export function uiCommitChanges(context) {
var detected = utilDetect();
var _entityID;
var _discardTags = {};
context.data().get('discarded')
.then(function(d) { _discardTags = d; })
.catch(function() { /* ignore */ });
function commitChanges(selection) {
var history = context.history();
@@ -96,7 +101,7 @@ export function uiCommitChanges(context) {
// Download changeset link
var changeset = new osmChangeset().update({ id: undefined });
var changes = history.changes(actionDiscardTags(history.difference()));
var changes = history.changes(actionDiscardTags(history.difference(), _discardTags));
delete changeset.id; // Export without chnageset_id
@@ -158,9 +163,9 @@ export function uiCommitChanges(context) {
}
commitChanges.entityID = function(_) {
commitChanges.entityID = function(val) {
if (!arguments.length) return _entityID;
_entityID = _;
_entityID = val;
return commitChanges;
};