diff --git a/assets/layers/questions/questions.json b/assets/layers/questions/questions.json index ae81c772d..d11028a8c 100644 --- a/assets/layers/questions/questions.json +++ b/assets/layers/questions/questions.json @@ -2653,7 +2653,6 @@ } } }, - { "id": "qr_code", "labels": [ @@ -2706,6 +2705,28 @@ "class": "subtle font-small" } } + }, + { + "id": "nothing_known", + "labels": [ + "added_by_default" + ], + "condition": { + "and": [ + "_backend~*", + "_last_edit:passed_time>=300" + ] + }, + "render": { + "special": { + "type": "if_nothing_known", + "text": { + "en": "Nothing is known about this place. Help by filling out the questions", + "nl": "Er is nog niets geweten. Help mee door de vragen te beantwoorden" + }, + "cssClasses": "subtle m-4 italic flex items-center justify-center" + } + } } ] } diff --git a/assets/svg/download.svg.license b/assets/svg/download.svg.license new file mode 100644 index 000000000..87be97fae --- /dev/null +++ b/assets/svg/download.svg.license @@ -0,0 +1,2 @@ +SPDX-FileCopyrightText: Engr.eponce +SPDX-License-Identifier: CC-BY-SA-4.0 \ No newline at end of file diff --git a/assets/svg/license_info.json b/assets/svg/license_info.json index d95f0ed68..66804aab4 100644 --- a/assets/svg/license_info.json +++ b/assets/svg/license_info.json @@ -359,24 +359,6 @@ ], "sources": [] }, - { - "path": "download.svg", - "license": "CC0-1.0", - "authors": [ - "Hannah Declerck" - ], - "sources": [] - }, - { - "path": "download.svg", - "license": "CC-BY-SA-4.0", - "authors": [ - "Engr.eponce" - ], - "sources": [ - "https://commons.wikimedia.org/wiki/File:Download-icon.svg" - ] - }, { "path": "duplicate.svg", "license": "CC0-1.0", @@ -735,18 +717,6 @@ "authors": [], "sources": [] }, - { - "path": "logout.svg", - "license": "TRIVIAL", - "authors": [], - "sources": [] - }, - { - "path": "logout.svg", - "license": "TRIVIAL", - "authors": [], - "sources": [] - }, { "path": "mangrove_logo.svg", "license": "LOGO", @@ -1117,18 +1087,6 @@ "https://phabricator.wikimedia.org/diffusion/GOJU/browse/master/AUTHORS.txt" ] }, - { - "path": "share.svg", - "license": "TRIVIAL", - "authors": [], - "sources": [] - }, - { - "path": "share.svg", - "license": "TRIVIAL", - "authors": [], - "sources": [] - }, { "path": "speech_bubble.svg", "license": "CC-BY-4.0", @@ -1267,26 +1225,6 @@ ], "sources": [] }, - { - "path": "up.svg", - "license": "TRIVIAL", - "authors": [], - "sources": [] - }, - { - "path": "up.svg", - "license": "TRIVIAL", - "authors": [], - "sources": [] - }, - { - "path": "upload.svg", - "license": "CC0-1.0", - "authors": [ - "Pieter Vander Vennet" - ], - "sources": [] - }, { "path": "wikidata.svg", "license": "LOGO", diff --git a/assets/svg/logout.svg b/assets/svg/logout.svg deleted file mode 100644 index 35af5e550..000000000 --- a/assets/svg/logout.svg +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/assets/svg/share.svg.license b/assets/svg/share.svg.license new file mode 100644 index 000000000..22b8ca7a5 --- /dev/null +++ b/assets/svg/share.svg.license @@ -0,0 +1,2 @@ +SPDX-FileCopyrightText: +SPDX-License-Identifier: LicenseRef-TRIVIAL \ No newline at end of file diff --git a/assets/svg/up.svg.license b/assets/svg/up.svg.license new file mode 100644 index 000000000..22b8ca7a5 --- /dev/null +++ b/assets/svg/up.svg.license @@ -0,0 +1,2 @@ +SPDX-FileCopyrightText: +SPDX-License-Identifier: LicenseRef-TRIVIAL \ No newline at end of file diff --git a/assets/svg/upload.svg.license b/assets/svg/upload.svg.license new file mode 100644 index 000000000..ed0288300 --- /dev/null +++ b/assets/svg/upload.svg.license @@ -0,0 +1,2 @@ +SPDX-FileCopyrightText: Pieter Vander Vennet +SPDX-License-Identifier: CC0-1.0 \ No newline at end of file diff --git a/assets/themes/playgrounds/playgrounds.json b/assets/themes/playgrounds/playgrounds.json index 87db0468e..8b4322aa4 100644 --- a/assets/themes/playgrounds/playgrounds.json +++ b/assets/themes/playgrounds/playgrounds.json @@ -1,4 +1,5 @@ { + "id": "playgrounds", "title": { "en": "Playgrounds", @@ -72,4 +73,4 @@ } ], "widenFactor": 5 -} \ No newline at end of file +} diff --git a/public/css/index-tailwind-output.css b/public/css/index-tailwind-output.css index 59e7e9f13..5526d33a4 100644 --- a/public/css/index-tailwind-output.css +++ b/public/css/index-tailwind-output.css @@ -941,11 +941,6 @@ video { margin-bottom: 0.25rem; } -.my-4 { - margin-top: 1rem; - margin-bottom: 1rem; -} - .my-2 { margin-top: 0.5rem; margin-bottom: 0.5rem; @@ -956,6 +951,11 @@ video { margin-right: 0.25rem; } +.my-4 { + margin-top: 1rem; + margin-bottom: 1rem; +} + .mx-4 { margin-left: 1rem; margin-right: 1rem; @@ -2027,6 +2027,10 @@ video { row-gap: 0.25rem; } +.gap-y-2 { + row-gap: 0.5rem; +} + .gap-x-4 { column-gap: 1rem; } @@ -2039,10 +2043,6 @@ video { column-gap: 0px; } -.gap-y-2 { - row-gap: 0.5rem; -} - .gap-x-1 { column-gap: 0.25rem; } @@ -2258,10 +2258,6 @@ video { align-self: stretch; } -.justify-self-start { - justify-self: start; -} - .justify-self-end { justify-self: end; } @@ -3453,10 +3449,6 @@ video { padding-right: 3rem; } -.pl-1 { - padding-left: 0.25rem; -} - .pr-1 { padding-right: 0.25rem; } @@ -3493,6 +3485,10 @@ video { padding-left: 0.75rem; } +.pl-1 { + padding-left: 0.25rem; +} + .pb-1\.5 { padding-bottom: 0.375rem; } @@ -4408,9 +4404,10 @@ video { --interactive-background: #dddddd; --interactive-foreground: black; --interactive-contrast: #ff00ff; - --button-background: #383838; + --button-background: #282828; --button-background-hover: #686868; --button-foreground: white; + --button-border-color: #F7F7F7; --disabled: #DBDBDB; /** * Base colour of interactive elements, mainly the 'subtle button' @@ -4559,9 +4556,9 @@ button, .button { align-items: center; padding: 0.25rem 1rem; margin: 0.25rem; - border: 1px solid var(--foreground-color); + border: 1px solid var(--button-background-hover); box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); - border-radius: 30px; + border-radius: 15px; background: var(--background-color); transition: all 200ms; } @@ -4578,9 +4575,14 @@ button:focus, .button:focus { border-color: var(--interactive-contrast); } +.focus { + border: 2px solid var(--interactive-contrast); +} + button.primary, .button.primary { color: var(--button-foreground); background-color: var(--button-background); + border-color: var(--button-border-color); } button.primary:hover:not(.disabled), .button.primary:hover:not(.disabled) { @@ -4592,6 +4594,12 @@ button.disabled { color: var(--disabled); } +button.disabled svg path { + transition: all 200ms; + fill: var(--disabled); + stroke: var(--disabled); +} + button.primary.disabled, .button.primary.disabled { color: var(--button-foreground); background-color: var(--disabled); @@ -4648,12 +4656,11 @@ label:not(.neutral-label):not(.button) { /** * Label should _contain_ the input element */ - border: 2px solid var(--interactive-background); padding: 0.25rem; padding-right: 0.5rem; padding-left: 0.5rem; + margin:0.25rem; border-radius: 0.5rem; - background-color: var(--low-interaction-background); width: 100%; box-sizing: border-box; transition: all 250ms; @@ -4664,27 +4671,12 @@ label.button { } label:hover:not(.neutral-label) { - background-color: var(--catch-detail-color); - color: var(--catch-detail-foregroundcolor); - border: 2px solid var(--interactive-contrast); -} - -label:not(.no-image-background):not(.neutral-label) img { - padding: 0.25rem; - border-radius: 0.25rem; - background: var(--low-interaction-background); -} - -label:not(.neutral-label) svg path { - transition: all 250ms; -} - -label:hover:not(.no-image-background):not(.neutral-label) svg path { - fill: var(--catch-detail-foregroundcolor) !important; + background-color: var(--low-interaction-background); } label.checked:not(.neutral-label) { - border: 2px solid var(--foreground-color); + color: var(--foreground-color); + background-color: var(--low-interaction-background); } textarea { @@ -4924,10 +4916,6 @@ svg.apply-fill path { } } -.glowing-shadow { - animation: glowing 1s ease-in-out infinite alternate; -} - /************************* LEGACY MARKER - CLEANUP BELOW ********************************/ .slideshow-item img { @@ -7170,6 +7158,10 @@ svg.apply-fill path { margin-bottom: 0px; } + .sm\:inline { + display: inline; + } + .sm\:flex { display: flex; } @@ -7269,6 +7261,10 @@ svg.apply-fill path { padding-right: 1rem; } + .sm\:pr-2 { + padding-right: 0.5rem; + } + .sm\:pt-1 { padding-top: 0.25rem; } @@ -7335,6 +7331,10 @@ svg.apply-fill path { display: block; } + .md\:inline { + display: inline; + } + .md\:flex { display: flex; } @@ -7537,6 +7537,10 @@ svg.apply-fill path { padding-bottom: 2rem; } + .md\:pr-2 { + padding-right: 0.5rem; + } + .md\:text-6xl { font-size: 3.75rem; line-height: 1; diff --git a/public/css/tagrendering.css b/public/css/tagrendering.css index ce1d6c3b8..40adaab94 100644 --- a/public/css/tagrendering.css +++ b/public/css/tagrendering.css @@ -1,36 +1,4 @@ -/** - Some utility functions which are only used to render data - */ - -.question .form-text-field > input { - width: 100%; - box-sizing: border-box; -} - -.question { - display: block; - margin-top: 1em; - background-color: var(--subtle-detail-color); - color: var(--subtle-detail-color-contrast); - padding: 1em; - border-radius: 0.75rem; - font-size: larger !important; - overflow-wrap: initial; -} - -.question form { - display: inline-block; - max-width: 90vw; - width: 100%; -} - -.question svg { - width: 100%; - height: 100%; -} - - .mapping-icon-small-height { diff --git a/src/Logic/MetaTagging.ts b/src/Logic/MetaTagging.ts index 375555992..22a48ac21 100644 --- a/src/Logic/MetaTagging.ts +++ b/src/Logic/MetaTagging.ts @@ -83,15 +83,18 @@ export default class MetaTagging { let lastUpdateMoment = new Date() const tags = state?.featureProperties?.getStore(feature.properties.id) console.log("Binding an updater to", feature) + let updateCount = 0 tags?.addCallbackD(() => { - console.log("Received an update! Re-calculating the metatags") + console.log("Received an update! Re-calculating the metatags, timediff:", new Date().getTime() - lastUpdateMoment.getTime()) if (feature !== state.selectedElement.data) { return true // Unregister, we are not the selected element anymore } - if (new Date().getTime() - lastUpdateMoment.getTime() < 250) { + if (new Date().getTime() - lastUpdateMoment.getTime() < (250 + updateCount * 50)) { return } + + updateCount ++ lastUpdateMoment = new Date() window.requestIdleCallback(() => { this.updateCurrentSelectedElement() diff --git a/src/Models/ThemeConfig/Conversion/PrepareLayer.ts b/src/Models/ThemeConfig/Conversion/PrepareLayer.ts index dded8eb4a..3efe954d8 100644 --- a/src/Models/ThemeConfig/Conversion/PrepareLayer.ts +++ b/src/Models/ThemeConfig/Conversion/PrepareLayer.ts @@ -653,17 +653,14 @@ export class AddEditingElements extends DesugaringStep { const specialVisualisations = ValidationUtils.getAllSpecialVisualisations( json.tagRenderings ) + const usedSpecialFunctions = new Set( specialVisualisations.map((sv) => typeof sv === "string" ? undefined : sv.func.funcName ) ) - if (!allIds.has("lod")) { - json.tagRenderings.push(this._desugaring.tagRenderings.get("lod")) - } - if (!usedSpecialFunctions.has("minimap")) { - json.tagRenderings.push(this._desugaring.tagRenderings.get("minimap")) - } + + /***** ADD TO TOP ****/ if ( this._desugaring.tagRenderings.has("just_created") && @@ -672,6 +669,26 @@ export class AddEditingElements extends DesugaringStep { json.tagRenderings.unshift(this._desugaring.tagRenderings.get("just_created")) } + if (!allIds.has("nothing_known")) { + const indexFirstQuestion = json.tagRenderings.findIndex(tr => tr["question"] !== undefined) + json.tagRenderings.splice(indexFirstQuestion, + 0, + this._desugaring.tagRenderings.get("nothing_known")) + console.log("aDDING",this._desugaring.tagRenderings.get("nothing_known")) + } + + + /***** ADD TO BOTTOM ****/ + + + if (!allIds.has("lod")) { + json.tagRenderings.push(this._desugaring.tagRenderings.get("lod")) + } + if (!usedSpecialFunctions.has("minimap")) { + json.tagRenderings.push(this._desugaring.tagRenderings.get("minimap")) + } + + if (json.allowSplit && !usedSpecialFunctions.has("split_button")) { json.tagRenderings.push({ id: "split-button", @@ -693,6 +710,19 @@ export class AddEditingElements extends DesugaringStep { }) } + if (!usedSpecialFunctions.has("favourite_status")) { + json.tagRenderings.push({ + id: "favourite_status", + render: { "*": "{favourite_status()}" }, + }) + } + if (!allIds.has("share")) { + json.tagRenderings.push(this._desugaring.tagRenderings.get("share")) + } + + if (!allIds.has("qr_code")) { + json.tagRenderings.push(this._desugaring.tagRenderings.get("qr_code")) + } if ( json.source !== "special" && json.source !== "special:library" && @@ -703,20 +733,7 @@ export class AddEditingElements extends DesugaringStep { json.tagRenderings.push(this._desugaring.tagRenderings.get("last_edit")) } - if (!usedSpecialFunctions.has("favourite_status")) { - json.tagRenderings.push({ - id: "favourite_status", - render: { "*": "{favourite_status()}" }, - }) - } - if (!allIds.has("qr_code")) { - json.tagRenderings.push(this._desugaring.tagRenderings.get("qr_code")) - } - - if (!allIds.has("share")) { - json.tagRenderings.push(this._desugaring.tagRenderings.get("share")) - } if (!usedSpecialFunctions.has("all_tags")) { const trc: QuestionableTagRenderingConfigJson = { @@ -768,6 +785,9 @@ export class RewriteSpecial extends DesugaringStep { * // should handle a simple special case * RewriteSpecial.convertIfNeeded({"special": {"type":"image_carousel"}}, ConversionContext.test()) // => {'*': "{image_carousel()}"} * + * // should add a class to the special element + * RewriteSpecial.convertIfNeeded({"special": {"type":"qr_code"}, class:"inline"}, ConversionContext.test()) // => {'*': "{qr_code():inline}"} + * * // should handle special case with a parameter * RewriteSpecial.convertIfNeeded({"special": {"type":"image_carousel", "image_key": "some_image_key"}}, ConversionContext.test()) // => {'*': "{image_carousel(some_image_key)}"} * @@ -784,7 +804,7 @@ export class RewriteSpecial extends DesugaringStep { * // should warn for unexpected keys * const context = ConversionContext.test() * RewriteSpecial.convertIfNeeded({"special": {type: "image_carousel"}, "en": "xyz"}, context) // => {'*': "{image_carousel()}"} - * context.getAll("error")[0].message // => "The only keys allowed next to a 'special'-block are 'before' and 'after'. Perhaps you meant to put 'en' into the special block?" + * context.getAll("error")[0].message // => "The only keys allowed next to a 'special'-block are 'before', 'after' and 'class'. Perhaps you meant to put 'en' into the special block?" * * // should give an error on unknown visualisations * const context = ConversionContext.test() @@ -863,9 +883,9 @@ export class RewriteSpecial extends DesugaringStep { return undefined } Array.from(Object.keys(input)) - .filter((k) => k !== "special" && k !== "before" && k !== "after") + .filter((k) => k !== "special" && k !== "before" && k !== "after" && k !== "class") .map((k) => { - return `The only keys allowed next to a 'special'-block are 'before' and 'after'. Perhaps you meant to put '${k}' into the special block?` + return `The only keys allowed next to a 'special'-block are 'before', 'after' and 'class'. Perhaps you meant to put '${k}' into the special block?` }) .forEach((e) => context.err(e)) @@ -917,6 +937,8 @@ export class RewriteSpecial extends DesugaringStep { const before = Translations.T(input.before) const after = Translations.T(input.after) + const clss: string = input.class !== undefined ? ":"+input.class : "" + for (const ln of Object.keys(before?.translations ?? {})) { foundLanguages.add(ln) @@ -930,7 +952,7 @@ export class RewriteSpecial extends DesugaringStep { .map((nm) => RewriteSpecial.escapeStr(special[nm] ?? "")) .join(",") return { - "*": `{${type}(${args})}`, + "*": `{${type}(${args})${clss}}`, } } @@ -955,7 +977,7 @@ export class RewriteSpecial extends DesugaringStep { } const beforeText = before?.textFor(ln) ?? "" const afterText = after?.textFor(ln) ?? "" - result[ln] = `${beforeText}{${type}(${args.map((a) => a).join(",")})}${afterText}` + result[ln] = `${beforeText}{${type}(${args.map((a) => a).join(",")})${clss}}${afterText}` } return result } diff --git a/src/UI/AllThemesGui.svelte b/src/UI/AllThemesGui.svelte index bfcee56b3..a9bc4e6d8 100644 --- a/src/UI/AllThemesGui.svelte +++ b/src/UI/AllThemesGui.svelte @@ -84,22 +84,18 @@ -
+
diff --git a/src/UI/Base/FileSelector.svelte b/src/UI/Base/FileSelector.svelte index 9caaeca60..e7958eebe 100644 --- a/src/UI/Base/FileSelector.svelte +++ b/src/UI/Base/FileSelector.svelte @@ -79,7 +79,8 @@ }} >