diff --git a/assets/layers/note/note.json b/assets/layers/note/note.json index ff548401f..b8f69c142 100644 --- a/assets/layers/note/note.json +++ b/assets/layers/note/note.json @@ -54,6 +54,10 @@ }, "titleIcons": [ { + "ariaLabel": { + "en": "See on OpenStreetMap.org", + "nl": "Bekijk op OpenStreetMap.org" + }, "render": "" } ], @@ -94,6 +98,7 @@ "tagRenderings": [ { "id": "conversation", + "classes": "p-0", "render": "{visualize_note_comments()}" }, { diff --git a/public/css/index-tailwind-output.css b/public/css/index-tailwind-output.css index f977d2bc5..cf19b7cc1 100644 --- a/public/css/index-tailwind-output.css +++ b/public/css/index-tailwind-output.css @@ -1118,14 +1118,14 @@ video { height: 50%; } -.h-3 { - height: 0.75rem; -} - .h-7 { height: 1.75rem; } +.h-3 { + height: 0.75rem; +} + .h-11 { height: 2.75rem; } @@ -1142,18 +1142,6 @@ video { height: 12rem; } -.h-56 { - height: 14rem; -} - -.h-20 { - height: 5rem; -} - -.h-10 { - height: 2.5rem; -} - .h-40 { height: 10rem; } @@ -1162,10 +1150,22 @@ video { height: 16rem; } +.h-10 { + height: 2.5rem; +} + .h-80 { height: 20rem; } +.h-56 { + height: 14rem; +} + +.h-20 { + height: 5rem; +} + .max-h-12 { max-height: 3rem; } @@ -1178,10 +1178,6 @@ video { max-height: 16rem; } -.max-h-7 { - max-height: 1.75rem; -} - .max-h-60 { max-height: 15rem; } @@ -1228,14 +1224,14 @@ video { width: 1rem; } -.w-3 { - width: 0.75rem; -} - .w-7 { width: 1.75rem; } +.w-3 { + width: 0.75rem; +} + .w-11 { width: 2.75rem; } @@ -1614,11 +1610,6 @@ video { border-radius: 0.125rem; } -.rounded-l { - border-top-left-radius: 0.25rem; - border-bottom-left-radius: 0.25rem; -} - .rounded-t { border-top-left-radius: 0.25rem; border-top-right-radius: 0.25rem; @@ -1634,6 +1625,11 @@ video { border-bottom-left-radius: 0.25rem; } +.rounded-l { + border-top-left-radius: 0.25rem; + border-bottom-left-radius: 0.25rem; +} + .rounded-tl { border-top-left-radius: 0.25rem; } @@ -1843,6 +1839,11 @@ video { padding-right: 0.75rem; } +.py-1 { + padding-top: 0.25rem; + padding-bottom: 0.25rem; +} + .pr-2 { padding-right: 0.5rem; } @@ -2317,6 +2318,14 @@ input[type=text] { width: 100%; } +.debug input, .debug textarea { + border: 6px solid red +} + +.debug label input, .debug label textarea { + border: 1px solid grey; +} + /************************* BIG CATEGORIES ********************************/ /** @@ -2490,6 +2499,12 @@ button.link:hover { fill: var(--foreground-color) !important; } +.neutral-label{ + /** This label styles as normal text. It's power comes from the many :not(.neutral-label) entries. + * Placed here for autocompletion + */ +} + label:not(.neutral-label) { /** * Label should _contain_ the input element @@ -2924,14 +2939,6 @@ a.link-underline { margin-right: 1rem; } - .sm\:mr-2 { - margin-right: 0.5rem; - } - - .sm\:flex { - display: flex; - } - .sm\:h-24 { height: 6rem; } @@ -2948,14 +2955,6 @@ a.link-underline { flex-wrap: nowrap; } - .sm\:items-stretch { - align-items: stretch; - } - - .sm\:justify-between { - justify-content: space-between; - } - .sm\:border-4 { border-width: 4px; } diff --git a/src/Logic/ImageProviders/ImageUploadManager.ts b/src/Logic/ImageProviders/ImageUploadManager.ts index 30d2ea638..fc7e5d283 100644 --- a/src/Logic/ImageProviders/ImageUploadManager.ts +++ b/src/Logic/ImageProviders/ImageUploadManager.ts @@ -7,7 +7,7 @@ import { Store, UIEventSource } from "../UIEventSource" import { OsmConnection } from "../Osm/OsmConnection" import { Changes } from "../Osm/Changes" import Translations from "../../UI/i18n/Translations" -import NoteCommentElement from "../../UI/Popup/NoteCommentElement" +import NoteCommentElement from "../../UI/Popup/Notes/NoteCommentElement" /** * The ImageUploadManager has a diff --git a/src/Logic/Web/LocalStorageSource.ts b/src/Logic/Web/LocalStorageSource.ts index 8d83dafb1..601324aeb 100644 --- a/src/Logic/Web/LocalStorageSource.ts +++ b/src/Logic/Web/LocalStorageSource.ts @@ -23,7 +23,10 @@ export class LocalStorageSource { static Get(key: string, defaultValue: string = undefined): UIEventSource { try { - const saved = localStorage.getItem(key) + let saved = localStorage.getItem(key) + if (saved === "undefined") { + saved = undefined + } const source = new UIEventSource(saved ?? defaultValue, "localstorage:" + key) source.addCallback((data) => { diff --git a/src/Models/ThemeConfig/TagRenderingConfig.ts b/src/Models/ThemeConfig/TagRenderingConfig.ts index f2d8367a8..cc0027d2b 100644 --- a/src/Models/ThemeConfig/TagRenderingConfig.ts +++ b/src/Models/ThemeConfig/TagRenderingConfig.ts @@ -647,6 +647,12 @@ export default class TagRenderingConfig { multiSelectedMapping: boolean[] | undefined, currentProperties: Record ): UploadableTag { + console.log("Constructing change spec", { + freeformValue, + singleSelectedMapping, + multiSelectedMapping, + currentProperties, + }) if (typeof freeformValue === "string") { freeformValue = freeformValue?.trim() } diff --git a/src/UI/Base/FloatOver.svelte b/src/UI/Base/FloatOver.svelte index fecad4772..bc2eade0a 100644 --- a/src/UI/Base/FloatOver.svelte +++ b/src/UI/Base/FloatOver.svelte @@ -3,6 +3,8 @@ import { XCircleIcon } from "@rgossiaux/svelte-heroicons/solid" import { twMerge } from "tailwind-merge" import { trapFocus } from "trap-focus-svelte" + import { ariaLabel } from "../../Utils/ariaLabel" + import Translations from "../i18n/Translations" /** * The slotted element will be shown on top, with a lower-opacity border @@ -35,6 +37,7 @@ diff --git a/src/UI/BigComponents/MapCenterDetails.svelte b/src/UI/BigComponents/MapCenterDetails.svelte index a985a3fc0..ff0e09d6e 100644 --- a/src/UI/BigComponents/MapCenterDetails.svelte +++ b/src/UI/BigComponents/MapCenterDetails.svelte @@ -38,7 +38,7 @@ return {bearing, distance: distanceToCurrentLocation.data.distance} }, [distanceToCurrentLocation]) let viewportCenterDetails = Translations.DynamicSubstitute(t.viewportCenterDetails, relativeBearing) - let viewportCenterDetailsAbsolute = Translations.DynamicSubstitute(t.viewportCenterDetails, distanceToCurrentLocation.map(({distance, bearing}) => { + let viewportCenterDetailsAbsolute = Translations.DynamicSubstitute(t.viewportCenterDetails, distanceToCurrentLocation.mapD(({distance, bearing}) => { return {distance, bearing: t.directionsAbsolute[GeoOperations.bearingToHuman(bearing)]} })) diff --git a/src/UI/InputElement/Helpers/LocationInput.svelte b/src/UI/InputElement/Helpers/LocationInput.svelte index a8b3306b7..de8d7c6cc 100644 --- a/src/UI/InputElement/Helpers/LocationInput.svelte +++ b/src/UI/InputElement/Helpers/LocationInput.svelte @@ -52,10 +52,9 @@ if (maxDistanceInMeters) { onDestroy( mla.location.addCallbackD((newLocation) => { - const l = [newLocation.lon, newLocation.lat] + const l : [number, number] = [newLocation.lon, newLocation.lat] const c: [number, number] = [initialCoordinate.lon, initialCoordinate.lat] const d = GeoOperations.distanceBetween(l, c) - console.log("distance is", d, l, c) if (d <= maxDistanceInMeters) { return } diff --git a/src/UI/InputElement/ValidatedInput.svelte b/src/UI/InputElement/ValidatedInput.svelte index 8e8258705..647bccb93 100644 --- a/src/UI/InputElement/ValidatedInput.svelte +++ b/src/UI/InputElement/ValidatedInput.svelte @@ -14,8 +14,9 @@ export let type: ValidatorType export let feedback: UIEventSource | undefined = undefined export let cls: string = undefined - export let getCountry: () => string | undefined - export let placeholder: string | Translation | undefined + export let getCountry: () => string | undefined = undefined + export let placeholder: string | Translation | undefined = undefined + export let autofocus: boolean = false export let unit: Unit = undefined /** * Valid state, exported to the calling component @@ -57,9 +58,9 @@ validator = Validators.get(type ?? "string") _placeholder = placeholder ?? validator?.getPlaceholder() ?? type - if(_value.data?.length > 0){ + if (_value.data?.length > 0) { feedback?.setData(validator?.getFeedback(_value.data, getCountry)) - }else{ + } else { feedback?.setData(undefined) } @@ -69,7 +70,7 @@ function setValues() { // Update the value stores const v = _value.data - if(v === ""){ + if (v === "") { value.setData(undefined) feedback?.setData(undefined) return @@ -100,7 +101,7 @@ if (_value.data !== fromUpstream && fromUpstream !== "") { _value.setData(fromUpstream) } - }) + }), ) } else { // Handled by the UnitInput @@ -114,7 +115,7 @@ Utils.sortedByLevenshteinDistance( type, Validators.AllValidators.map((v) => v.name), - (v) => v + (v) => v, ) .slice(0, 5) .join(", ") @@ -123,37 +124,30 @@ const isValid = _value.map((v) => validator?.isValid(v, getCountry) ?? true) - let htmlElem: HTMLInputElement + let htmlElem: HTMLInputElement | HTMLTextAreaElement - let dispatch = createEventDispatcher<{ selected; submit }>() + let dispatch = createEventDispatcher<{ selected }>() $: { if (htmlElem !== undefined) { htmlElem.onfocus = () => dispatch("selected") + if (autofocus) { + Utils.focusOn(htmlElem) + } } } - /** - * Dispatches the submit, but only if the value is valid - */ - function sendSubmit() { - if (feedback?.data) { - console.log("Not sending a submit as there is feedback") - } - dispatch("submit") - } {#if validator?.textArea} -
sendSubmit()}>