Skip to content

Commit

Permalink
Toward OpenHistoricalMap/issues#877 by publishing to npm even if we'r…
Browse files Browse the repository at this point in the history
…e going to deprecate that avenue of distribution.
  • Loading branch information
erictheise committed Sep 1, 2024
1 parent 846e2f2 commit 6c48138
Show file tree
Hide file tree
Showing 8 changed files with 196 additions and 50 deletions.
26 changes: 22 additions & 4 deletions dist/iD.css
Original file line number Diff line number Diff line change
Expand Up @@ -4991,12 +4991,20 @@
display: flex;
flex-flow: row nowrap;
}
.ideditor .form-field ul.rows li.labeled-input > div {
.ideditor .form-field ul.rows li.labeled-input > div,
.ideditor .form-field ul.rows li.labeled-input-source > div {
flex: 1 1 auto;
width: 100%;
border-radius: 0;
line-height: 0.95rem;
}
.ideditor .form-field ul.rows li.labeled-input div > span,
.ideditor .form-field ul.rows li.labeled-input-source div > span{
vertical-align: middle;
}
.ideditor .form-field ul.rows li.labeled-input-source > div {
width: auto;
}
.ideditor .form-field ul.rows li input {
border-radius: 0;
border-width: 0;
Expand All @@ -5020,18 +5028,21 @@
display: table;
width: 100%;
}
.ideditor .form-field ul.rows.rows-table li.labeled-input {
.ideditor .form-field ul.rows.rows-table li.labeled-input,
.ideditor .form-field ul.rows.rows-table li.labeled-input-source {
display: table-row;
}
.ideditor .form-field ul.rows.rows-table li.labeled-input > div:first-child {
.ideditor .form-field ul.rows.rows-table li.labeled-input > div:first-child,
.ideditor .form-field ul.rows.rows-table li.labeled-input-source > div:first-child {
display: table-cell;
width: auto;
max-width: 170px;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
.ideditor .form-field ul.rows.rows-table li.labeled-input > div:nth-child(2) {
.ideditor .form-field ul.rows.rows-table li.labeled-input > div:nth-child(2),
.ideditor .form-field ul.rows.rows-table li.labeled-input-source > div:nth-child(2) {
display: table-cell;
width: auto;
}
Expand Down Expand Up @@ -5451,6 +5462,9 @@

/* Field - date, roadheight, and roadspeed
------------------------------------------------------- */
.ideditor .form-field-input-source {
flex-direction: column;
}
.ideditor .form-field-input-date input.date-year,
.ideditor .form-field-input-date input.date-month,
.ideditor .form-field-input-roadheight input.roadheight-number,
Expand Down Expand Up @@ -6364,6 +6378,10 @@
.ideditor .add-row .space-value {
flex: 1 1 50%;
}
.ideditor .add-row .add-subkey {
width: 32px;
flex: 0 1 auto;
}
.ideditor .add-row .space-buttons {
flex: 0 0 62px;
}
Expand Down
79 changes: 76 additions & 3 deletions dist/iD.js
Original file line number Diff line number Diff line change
Expand Up @@ -33070,8 +33070,9 @@
};
}
if (fields.source) {
fields.source.type = "text";
fields.source.type = "source";
fields.source.source = false;
fields.source.keys = ["source", "source:url", "source:name", "source:date"];
}
fields.license = {
key: "license",
Expand Down Expand Up @@ -49026,9 +49027,13 @@
function validateEDTF(key, msgKey) {
if (!entity.tags[key] || !entity.tags[key + ":edtf"])
return;
let basic = parseEDTF(entity.tags[key]);
let basic = entity.tags[key];
if (basic.match("^-?[0-9]+-[0-9]{2}-[0-9]{2}$")) {
basic = "".concat(basic, "T00:00:00/").concat(basic, "T24:00:00");
}
let basicAsEDTF = parseEDTF(basic);
let parsed = parseEDTF(entity.tags[key + ":edtf"]);
if (!basic || !parsed || parsed.covers(basic))
if (!basicAsEDTF || !parsed || parsed.covers(basicAsEDTF) || basicAsEDTF.covers(parsed))
return;
issues.push(new validationIssue({
type: type2,
Expand Down Expand Up @@ -71520,6 +71525,73 @@
}
uiFieldWikipedia.supportsMultiselection = false;

// modules/ui/fields/sources.js
function uiFieldSources(field, context) {
let dispatch14 = dispatch_default("change");
let items = select_default2(null);
let _tags = {};
let _selection = select_default2(null);
let _pendingChange;
const mainKey = "source";
const sourceHeader = mainKey + ":";
const possibleSourceSubkeys = [{ key: "name" }, { key: "url" }, { key: "date" }];
function scheduleChange() {
if (!_pendingChange)
return;
dispatch14.call("change", this, _pendingChange);
_pendingChange = null;
_selection.call(sources);
}
function valueChange(d3_event, d2) {
if (typeof d2.key !== "string" && !this.value)
return;
var key = sourceHeader + d2.key;
_pendingChange = _pendingChange || {};
var value = context.cleanTagValue(this.value);
_pendingChange[key] = value === "" ? void 0 : value;
_tags[key] = value === "" ? void 0 : value;
scheduleChange();
}
function mainChange() {
_pendingChange = _pendingChange || {};
var value = context.cleanTagValue(this.value);
_pendingChange[mainKey] = value === "" ? void 0 : value;
_tags[mainKey] = value === "" ? void 0 : value;
scheduleChange();
}
function sources(selection2) {
_selection = selection2;
var wrap2 = selection2.selectAll(".form-field-input-wrap").data([0]);
selection2.exit().style("top", "0").style("max-height", "240px").transition().duration(200).style("opacity", "0").style("max-height", "0px").remove();
wrap2 = wrap2.enter().append("div").attr("class", "form-field-input-wrap form-field-input-" + field.type).merge(wrap2);
wrap2.selectAll("input").data([0]).enter().append("input").attr("class", "main-value").attr("type", "text").attr("placeholder", _t("inspector.source.main_input")).call(utilNoAuto).on("change", mainChange).on("blur", mainChange);
var list3 = wrap2.selectAll("ul").data([0]);
list3 = list3.enter().append("ul").attr("class", "rows").merge(list3);
list3 = list3.merge(list3);
items = list3.selectAll("li.labeled-input-source").data(possibleSourceSubkeys);
items = items.enter().append("li").attr("class", "labeled-input-source");
items.append("input").attr("type", "text").attr("class", "value").attr("placeholder", function(d2) {
return _t("inspector.source." + d2.key);
}).call(utilNoAuto).call(utilGetSetValue, function(d2) {
return _tags[sourceHeader + d2.key];
}).on("change", valueChange).on("blur", valueChange);
items.exit().remove();
utilGetSetValue(_selection.selectAll(".value"), function(d2) {
return _tags[sourceHeader + d2.key] === void 0 ? "" : _tags[sourceHeader + d2.key];
});
utilGetSetValue(_selection.selectAll(".main-value"), function() {
return _tags[mainKey] === void 0 ? "" : _tags[mainKey];
});
}
sources.tags = function(tags) {
if (!arguments.length)
return _tags;
_tags = tags;
_selection.call(sources);
};
return utilRebind(sources, dispatch14, "on");
}

// modules/ui/fields/index.js
var uiFields = {
access: uiFieldAccess,
Expand All @@ -71545,6 +71617,7 @@
radio: uiFieldRadio,
restrictions: uiFieldRestrictions,
semiCombo: uiFieldCombo,
source: uiFieldSources,
structureRadio: uiFieldRadio,
tel: uiFieldText,
text: uiFieldText,
Expand Down
8 changes: 4 additions & 4 deletions dist/iD.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/img/fa-sprite.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion dist/locales/en.min.json

Large diffs are not rendered by default.

Loading

0 comments on commit 6c48138

Please sign in to comment.