ai assistant, splash screen

This commit is contained in:
Will Freeman
2025-06-15 15:31:16 -06:00
parent 60827b6349
commit d8f688df9f
9 changed files with 115 additions and 45 deletions
+5 -5
View File
@@ -12,11 +12,11 @@ const nsiCdnUrl = ENV__ID_NSI_CDN_URL
// api urls and settings
const defaultOsmApiConnections = {
// live: {
// url: 'https://www.openstreetmap.org',
// apiUrl: 'https://api.openstreetmap.org',
// client_id: 'JHvon_-Q5ez357REB4jY7pnvXmyW4MyabXWVXdC_H7A'
// },
live: {
url: 'https://www.openstreetmap.org',
apiUrl: 'https://api.openstreetmap.org',
client_id: 'JHvon_-Q5ez357REB4jY7pnvXmyW4MyabXWVXdC_H7A'
},
dev: {
url: 'https://api06.dev.openstreetmap.org',
client_id: 'BpM31KdNZabpOoHJnoQJmRWIhwdpVy0oZA0tZdKoXg8'
+45
View File
@@ -5987,3 +5987,48 @@ li.hide + li.version .badge .tooltip .popover-arrow {
width: 100px;
color: #7092ff;
}
/* DeFlock Edits */
.ideditor .field-label button.rainbow-box:not(:hover):not(:active):not(:focus) {
background: linear-gradient(135deg,
#ff9a9e 0%,
#fad0c4 25%,
#fbc2eb 50%,
#a1c4fd 75%,
#c2e9fb 100%);
}
.ideditor .field-label button.rainbow-box {
width: unset;
}
.rainbow-box {
display: flex;
align-items: center;
justify-content: center;
padding-left: 1em;
padding-right: 1em;
text-align: center;
font-weight: bold;
background: linear-gradient(135deg,
#ff9a9e 0%,
#fad0c4 25%,
#fbc2eb 50%,
#a1c4fd 75%,
#c2e9fb 100%);
}
.modal-logo {
height: 70px;
padding-top: 20px;
text-align: center;
}
.modal-logo img {
height: 100%;
width: auto;
}
.text-center {
text-align: center;
}
+3 -2
View File
@@ -737,6 +737,7 @@ en:
manual: "{features} are hidden. Enable them in the Map Data pane."
zoom: "{features} are hidden. Zoom in to enable them."
back_tooltip: Change feature type
ai_help: Identify by Photo
remove: Remove
search: Search
search_feature_type: Search feature type
@@ -1081,8 +1082,8 @@ en:
okay: "OK"
cancel: "Cancel"
splash:
welcome: Welcome to the iD OpenStreetMap editor
text: "iD is a friendly but powerful tool for contributing to the world's best free world map. This is version {version}. For more information see {website} and report bugs at {github}."
welcome: Welcome to the DeFlock Editor
text: "The DeFlock Editor is a fork of {idWiki}, designed to make it as easy as possible to report ALPRs."
changelog: changelog
privacy_update: "Our privacy policy has recently been updated."
privacy_policy: iD privacy policy
+5 -5
View File
@@ -44,11 +44,11 @@ export function uiEntityEditor(context) {
var direction = (localizer.textDirection() === 'rtl') ? 'forward' : 'backward';
headerEnter
.append('button')
.attr('class', 'preset-reset preset-choose')
.attr('title', t('inspector.back_tooltip'))
.call(svgIcon(`#iD-icon-${direction}`));
// headerEnter
// .append('button')
// .attr('class', 'preset-reset preset-choose')
// .attr('title', t('inspector.back_tooltip'))
// .call(svgIcon(`#iD-icon-${direction}`));
headerEnter
.append('button')
+17
View File
@@ -243,6 +243,23 @@ export function uiField(context, presetField, entityIDs, options) {
.call(reference.body)
.select('.field-label')
.call(reference.button);
// Add AI Identifier for ALPRs to Manufacturer field
if (field.key === 'manufacturer') {
const existingButton = selection.select('.field-label .rainbow-box');
if (existingButton.empty()) { // Only create if it doesn't exist
const aiSvg = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" style="display: block; fill: #000000;"><path d="M19,1L17.74,3.75L15,5L17.74,6.26L19,9L20.25,6.26L23,5L20.25,3.75M9,4L6.5,9.5L1,12L6.5,14.5L9,20L11.5,14.5L17,12L11.5,9.5M19,15L17.74,17.74L15,19L17.74,20.25L19,23L20.25,20.25L23,19L20.25,17.74" /></svg>`;
selection.select('.field-label')
.insert('button', '.tag-reference-button')
.attr('class', 'rainbow-box')
.attr('title', t('inspector.ai_help'))
.html(aiSvg)
.on('click', () => {
window.open('https://example.com/', '_blank');
});
}
}
}
d.impl.tags(_tags);
+1 -1
View File
@@ -350,7 +350,7 @@ export function uiInit(context) {
// hide the sidebar by default
// ui.sidebar.toggle(false);
ui.sidebar.toggle(false);
// Setup map dimensions and move map to initial center/zoom.
// This should happen after .main-content and toolbars exist.
-1
View File
@@ -139,7 +139,6 @@ export function helpHtml(id, replacements) {
tags: t.html('inspector.tags'),
relations: t.html('inspector.relations'),
new_relation: t.html('inspector.new_relation'),
turn_restrictions: t.html('_tagging.presets.fields.restrictions.label'),
background_settings: t.html('background.description'),
imagery_offset: t.html('background.fix_misalignment'),
start_the_walkthrough: t.html('splash.walkthrough'),
+13 -13
View File
@@ -38,11 +38,11 @@ export function uiSectionFeatureType(context) {
var presetButton = presetButtonWrap
.append('button')
.attr('class', 'preset-list-button preset-reset')
.call(uiTooltip()
.title(() => t.append('inspector.back_tooltip'))
.placement('bottom')
);
.attr('class', 'preset-list-button preset-reset');
// .call(uiTooltip()
// .title(() => t.append('inspector.back_tooltip'))
// .placement('bottom')
// );
presetButton.append('div')
.attr('class', 'preset-icon-container');
@@ -77,14 +77,14 @@ export function uiSectionFeatureType(context) {
.call(_tagReference.body);
}
selection.selectAll('.preset-reset')
.on('click', function() {
dispatch.call('choose', this, _presets);
})
.on('pointerdown pointerup mousedown mouseup', function(d3_event) {
d3_event.preventDefault();
d3_event.stopPropagation();
});
// selection.selectAll('.preset-reset')
// .on('click', function() {
// dispatch.call('choose', this, _presets);
// })
// .on('pointerdown pointerup mousedown mouseup', function(d3_event) {
// d3_event.preventDefault();
// d3_event.stopPropagation();
// });
var geometries = entityGeometries();
selection.select('.preset-list-item button')
+26 -18
View File
@@ -4,6 +4,7 @@ import { t } from '../core/localizer';
import { uiIntro } from './intro';
import { uiModal } from './modal';
import { uiSectionPrivacy } from './sections/privacy';
import { html } from 'd3';
export function uiSplash(context) {
@@ -39,9 +40,17 @@ export function uiSplash(context) {
.append('div')
.attr('class', 'fillL');
// Add logo at the top of the splash screen
introModal
.append('div')
.attr('class','modal-section')
.attr('class', 'modal-logo')
.append('img')
.attr('src', 'https://deflock.me/deflock-logo.svg')
.attr('alt', 'Deflock Logo');
introModal
.append('div')
.attr('class','modal-section text-center')
.append('h3')
.call(t.append('splash.welcome'));
@@ -53,8 +62,7 @@ export function uiSplash(context) {
.append('p')
.html(t.html('splash.text', {
version: context.version,
website: { html: '<a target="_blank" href="https://github.com/openstreetmap/iD/blob/develop/CHANGELOG.md#whats-new">' + t.html('splash.changelog') + '</a>' },
github: { html: '<a target="_blank" href="https://github.com/openstreetmap/iD/issues">github.com</a>' }
idWiki: { html: `<a target="_blank" href="https://wiki.openstreetmap.org/wiki/iD">OSM's iD Editor</a>` },
}));
modalSection
@@ -73,23 +81,23 @@ export function uiSplash(context) {
.append('div')
.attr('class', 'modal-actions');
let walkthrough = buttonWrap
.append('button')
.attr('class', 'walkthrough')
.on('click', () => {
context.container().call(uiIntro(context));
modalSelection.close();
});
// let walkthrough = buttonWrap
// .append('button')
// .attr('class', 'walkthrough')
// .on('click', () => {
// context.container().call(uiIntro(context));
// modalSelection.close();
// });
walkthrough
.append('svg')
.attr('class', 'logo logo-walkthrough')
.append('use')
.attr('xlink:href', '#iD-logo-walkthrough');
// walkthrough
// .append('svg')
// .attr('class', 'logo logo-walkthrough')
// .append('use')
// .attr('xlink:href', '#iD-logo-walkthrough');
walkthrough
.append('div')
.call(t.append('splash.walkthrough'));
// walkthrough
// .append('div')
// .call(t.append('splash.walkthrough'));
let startEditing = buttonWrap
.append('button')