Merge RobinLinde-patch-1

This commit is contained in:
Pieter Vander Vennet 2024-04-23 22:14:09 +02:00
commit 6abe3c7d32
20 changed files with 553 additions and 63 deletions

View file

@ -0,0 +1,6 @@
<svg width="132" height="132" viewBox="0 0 132 132" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.51112 2.00003L122.139 2.19836C126.73 2.20742 129.325 4.83971 129.441 9.04561L130 123.637C127.957 129.019 127.608 129.186 122.57 130L9.11705 129.955C5.75923 129.877 1.50476 124.564 2.04707 120.555L2.44691 9.24047C2.82408 5.75765 4.60422 3.18731 8.51112 2.00003Z" stroke="black" stroke-width="2.5"/>
<path d="M49.0917 102.23V93.3995H22.3459V102.23H49.0917Z" fill="black"/>
<path d="M109.488 102.23V93.3995H82.7425V102.23H109.488Z" fill="black"/>
<path d="M72.1498 27.5248H59.4755V54.4807H72.1498V27.5248Z" fill="black"/>
</svg>

After

Width:  |  Height:  |  Size: 678 B

View file

@ -0,0 +1,2 @@
SPDX-FileCopyrightText: Yanpas
SPDX-License-Identifier: CC-BY-SA-4.0

View file

@ -1221,6 +1221,85 @@
"path": "./assets/layers/charging_station/bosch-5pin.svg",
"class": "medium"
}
},
{
"if": "socket:bs1363=1",
"ifnot": "socket:bs1363=",
"then": {
"en": "<b>BS1363</b> (Type G)",
"nl": "<b>BS1363</b> (VK 3-pin)"
},
"icon": {
"path": "./assets/layers/charging_station/bs1363.svg",
"class": "medium"
},
"hideInAnswer": {
"and": [
"_country!=bh",
"_country!=bd",
"_country!=bz",
"_country!=bt",
"_country!=bw",
"_country!=bn",
"_country!=kh",
"_country!=cy",
"_country!=dm",
"_country!=gh",
"_country!=gi",
"_country!=gd",
"_country!=gg",
"_country!=gy",
"_country!=id",
"_country!=iq",
"_country!=ie",
"_country!=im",
"_country!=je",
"_country!=jo",
"_country!=ke",
"_country!=kw",
"_country!=lb",
"_country!=mo",
"_country!=mw",
"_country!=mv",
"_country!=mt",
"_country!=mu",
"_country!=ng",
"_country!=om",
"_country!=pk",
"_country!=qa",
"_country!=rw",
"_country!=sa",
"_country!=sc",
"_country!=sl",
"_country!=sb",
"_country!=lk",
"_country!=sd",
"_country!=tz",
"_country!=ug",
"_country!=vu",
"_country!=vn",
"_country!=ye",
"_country!=zm",
"_country!=zw"
]
}
},
{
"if": {
"and": [
"socket:bs1363~*",
"socket:bs1363!=1"
]
},
"then": {
"en": "<b>BS1363</b> (Type G)",
"nl": "<b>BS1363</b> (VK 3-pin)"
},
"hideInAnswer": true,
"icon": {
"path": "./assets/layers/charging_station/bs1363.svg",
"class": "medium"
}
}
]
},
@ -1561,6 +1640,24 @@
[],
[],
[]
],
[
"socket:bs1363",
"socket:bs1363",
{
"en": "<b>BS1363</b> (Type G)",
"nl": "<b>BS1363</b> (VK 3-pin)"
},
"bs1363.svg",
[
"230"
],
[
"13"
],
[
"3kW"
]
]
]
},
@ -2607,6 +2704,13 @@
"de": "Hat einen <div style='display: inline-block'><b><b>Bosch Active Connect Anschluss mit 5 Pins</b></b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/bosch-5pin.svg'/></div> und Kabel"
},
"osmTags": "socket:bosch_5pin~*"
},
{
"question": {
"en": "Has a <div style='display: inline-block'><b><b>BS1363</b> (Type G)</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/bs1363.svg'/></div> connector",
"nl": "Heeft een <div style='display: inline-block'><b><b>BS1363</b> (VK 3-pin)</b> <img style='width:1rem; display: inline-block' src='./assets/layers/charging_station/bs1363.svg'/></div>"
},
"osmTags": "socket:bs1363~*"
}
]
}
@ -2757,6 +2861,15 @@
"mW",
"kW"
]
},
"socket:bs1363:voltage": "voltage",
"socket:bs1363:current": "current",
"socket:bs1363:output": {
"quantity": "power",
"denominations": [
"mW",
"kW"
]
}
}
],

View file

@ -115,6 +115,16 @@
],
"sources": []
},
{
"path": "bs1363.svg",
"license": "CC-BY-SA-4.0",
"authors": [
"Yanpas"
],
"sources": [
"https://commons.wikimedia.org/wiki/File:Plug_types.svg"
]
},
{
"path": "under_construction.svg",
"license": "CC0-1.0",

View file

@ -15,3 +15,4 @@ socket:tesla_destination,,Type2_tethered.svg,<b>Tesla supercharger (destination)
socket:USB-A,,usb_port.svg,<b>USB</b> to charge phones and small electronics,,,5,1;2,5W;10W,<b>USB</b> om GSMs en kleine electronica op te laden,*,,
socket:bosch_3pin,,bosch-3pin.svg,<b>Bosch Active Connect with 3 pins</b> and cable,,,,,,<b>Bosch Active Connect met 3 pinnen</b> aan een kabel,bicycle,car;motorcar;hgv;bus,
socket:bosch_5pin,,bosch-5pin.svg,<b>Bosch Active Connect with 5 pins</b> and cable,,,,,,<b>Bosch Active Connect met 5 pinnen</b> aan een kabel,bicycle,car;motorcar;hgv;bus,
socket:bs1363,,bs1363.svg,<b>BS1363</b> (Type G),bh;bd;bz;bt;bw;bn;kh;cy;dm;gh;gi;gd;gg;gy;id;iq;ie;im;je;jo;ke;kw;lb;mo;mw;mv;mt;mu;ng;om;pk;qa;rw;sa;sc;sl;sb;lk;sd;tz;ug;vu;vn;ye;zm;zw,,230,13,3kW,<b>BS1363</b> (VK 3-pin),*,,

1 key id image description:en countryWhiteList countryBlackList commonVoltages commonCurrents commonOutputs description:nl associatedVehicleTypes neverAssociatedWith extraVisualisationCondition
15 socket:USB-A usb_port.svg <b>USB</b> to charge phones and small electronics 5 1;2 5W;10W <b>USB</b> om GSMs en kleine electronica op te laden *
16 socket:bosch_3pin bosch-3pin.svg <b>Bosch Active Connect with 3 pins</b> and cable <b>Bosch Active Connect met 3 pinnen</b> aan een kabel bicycle car;motorcar;hgv;bus
17 socket:bosch_5pin bosch-5pin.svg <b>Bosch Active Connect with 5 pins</b> and cable <b>Bosch Active Connect met 5 pinnen</b> aan een kabel bicycle car;motorcar;hgv;bus
18 socket:bs1363 bs1363.svg <b>BS1363</b> (Type G) bh;bd;bz;bt;bw;bn;kh;cy;dm;gh;gi;gd;gg;gy;id;iq;ie;im;je;jo;ke;kw;lb;mo;mw;mv;mt;mu;ng;om;pk;qa;rw;sa;sc;sl;sb;lk;sd;tz;ug;vu;vn;ye;zm;zw 230 13 3kW <b>BS1363</b> (VK 3-pin) *

View file

@ -0,0 +1,7 @@
<svg width="900" height="900" viewBox="0 0 900 900" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="900" height="900" rx="150" fill="white"/>
<path d="M222.328 580C152.016 580 127.641 626.895 128.578 650.312V673.75H409.828V650.312C409.828 626.875 386.391 580 316.078 580H222.328ZM128.578 697.188C105.141 697.188 105.141 720.625 128.578 720.625H409.828C433.266 720.625 433.266 697.188 409.828 697.188H128.578ZM128.578 744.797V759.445C128.578 775.48 147.699 790.938 163.734 790.938H374.672C390.707 790.938 409.828 775.48 409.828 759.445V744.797H128.578Z" fill="#C77400"/>
<path d="M514.438 510V650.625C514.438 697.5 561.312 720.938 619.906 720.938C678.5 720.938 725.375 697.5 725.375 650.625H772.25C795.688 650.625 819.125 627.188 819.125 603.75V580.312C819.125 556.875 795.688 533.438 772.25 533.438H725.375V510H514.438ZM725.375 562.734H766.391C782.043 562.734 789.828 575.926 789.828 592.031C789.828 608.137 780.73 621.328 766.391 621.328H725.375V562.734ZM491 744.375C491 767.812 514.438 791.25 537.875 791.25H701.938C725.375 791.25 748.812 767.812 748.812 744.375H491Z" fill="#C77400"/>
<path d="M491 156L537.875 437.25H678.5L725.375 156H491ZM520.297 179.438H696.078L688.344 226.312H527.562L520.297 179.438Z" fill="#C77400"/>
<path d="M124.395 109C117.695 109 111 115.695 111 129.09V296.5C111 323.285 157.875 323.285 157.875 350.07L144.484 484H211.445L198.055 350.07C198.055 323.285 244.93 323.285 244.93 296.5V129.09C244.93 102.305 218.145 102.305 218.145 129.09V269.715C218.145 284.801 191.359 284.801 191.359 269.715V129.09C191.359 102.305 164.57 102.305 164.57 129.09V269.715C164.57 283.84 137.785 283.84 137.785 269.715V129.09C137.785 115.695 131.09 109 124.395 109ZM352.07 109C325.285 109 271.715 162.57 271.715 242.93C271.715 323.285 331.984 350.07 331.984 350.07L318.59 484H385.555L372.16 350.07C372.16 350.07 432.43 323.285 432.43 242.93C432.43 162.57 378.859 109 352.07 109Z" fill="#C77400"/>
</svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

View file

@ -0,0 +1,2 @@
SPDX-FileCopyrightText: OSM Carto
SPDX-License-Identifier: CC0-1.0

View file

@ -0,0 +1,76 @@
{
"id": "food_courts",
"name": {
"en": "Food Courts"
},
"description": {
"en": "Food courts with a variety of food options."
},
"title": {
"render": {
"en": "Food Court"
},
"mappings": [
{
"if": "name~*",
"then": "{name}"
}
]
},
"source": {
"osmTags": "amenity=food_court"
},
"minzoom": 12,
"tagRenderings": [
{
"id": "name",
"question": {
"en": "What is the name of this food court?"
},
"freeform": {
"key": "name",
"type": "string",
"placeholder": {
"en": "Name of the food court"
}
},
"render": {
"en": "This food court is called <b>{name}</b>."
}
},
"reviews",
"images",
"opening_hours",
"wheelchair-access",
"website",
"phone",
"smoking"
],
"pointRendering": [
{
"location": [
"point",
"centroid"
],
"marker": [
{
"icon": "./assets/layers/food_courts/food_court.svg"
}
],
"label": {
"mappings": [
{
"if": "name~*",
"then": "<div style='background: white; padding: 0.25em; border-radius:0.5em'>{name}</div>"
}
]
}
}
],
"lineRendering": [
{
"color": "#C77400",
"fillColor": "#C774004D"
}
]
}

View file

@ -0,0 +1,10 @@
[
{
"path": "food_court.svg",
"license": "CC0-1.0",
"authors": [
"OSM Carto"
],
"sources": []
}
]

View file

@ -0,0 +1,12 @@
[
{
"path": "outdoor_seating.svg",
"license": "CC0-1.0",
"authors": [
"Adamant36"
],
"sources": [
"https://github.com/gravitystorm/openstreetmap-carto/blob/master/symbols/leisure/outdoor_seating.svg"
]
}
]

View file

@ -0,0 +1,174 @@
{
"id": "outdoor_seating",
"name": {
"en": "Outdoor Seating"
},
"description": {
"en": "Outdoor seating areas, usually located near cafes and restaurants."
},
"title": {
"render": {
"en": "Outdoor Seating area"
},
"mappings": [
{
"if": "name~*",
"then": "{name}"
}
]
},
"source": {
"osmTags": "leisure=outdoor_seating"
},
"minzoom": 19,
"tagRenderings": [
"images",
{
"id": "access",
"question": {
"en": "Who can use this outdoor seating area?"
},
"mappings": [
{
"if": "access=yes",
"then": {
"en": "Anyone can use this outdoor seating area."
}
},
{
"if": "access=customers",
"then": {
"en": "Only customers can use this outdoor seating area."
}
},
{
"if": "access=private",
"then": {
"en": "This outdoor seating area is private."
}
}
]
},
{
"id": "seasonal",
"question": {
"en": "Is this outdoor seating area seasonal?"
},
"multiAnswer": true,
"mappings": [
{
"if": "seasonal=no",
"then": {
"en": "This outdoor seating area is available all year round."
}
},
{
"if": "seasonal=spring",
"then": {
"en": "This outdoor seating area is available in spring."
}
},
{
"if": "seasonal=summer",
"then": {
"en": "This outdoor seating area is available in summer."
}
},
{
"if": "seasonal=autumn",
"then": {
"en": "This outdoor seating area is available in autumn."
}
},
{
"if": "seasonal=winter",
"then": {
"en": "This outdoor seating area is available in winter."
}
},
{
"if": "seasonal=dry_season",
"then": {
"en": "This outdoor seating area is available in the dry season."
}
}
]
},
"opening_hours_24_7",
"website",
"internet-all",
"wheelchair-access",
{
"id": "heating",
"question": {
"en": "Is this outdoor seating area heated?"
},
"mappings": [
{
"if": "heating=yes",
"then": {
"en": "This outdoor seating area is heated."
}
},
{
"if": "heating=no",
"then": {
"en": "This outdoor seating area is not heated."
}
}
]
},
{
"id": "covered",
"question": {
"en": "Is this outdoor seating area covered?"
},
"mappings": [
{
"if": "covered=yes",
"then": {
"en": "This outdoor seating area is covered."
}
},
{
"if": "covered=no",
"then": {
"en": "This outdoor seating area is not covered."
}
}
]
},
{
"builtin": "smoking",
"override": {
"mappings": [
{},
{},
{
"hideInAnswer": true
}
]
}
}
],
"pointRendering": [
{
"location": [
"point",
"centroid"
],
"marker": [
{
"icon": "./assets/layers/outdoor_seating/outdoor_seating.svg"
}
]
}
],
"lineRendering": [
{
"color": "green",
"fillColor": "#00FF004D",
"width": 2
}
]
}

View file

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 14 14">
<path d="M 7.0078125,0 0,3 V 4 H 6.5 V 8 H 2 v 1 h 4.5 v 5 h 1 V 9 H 12 V 8 H 7.5 V 4 H 14 V 3 Z M 0,6 c 0,2.6666667 0,5.333333 0,8 h 1 v -2 h 2 v 2 H 4 C 4,13 4,12 4,11 3,11 2,11 1,11 V 6 Z m 13,0 v 5 c -1,0 -2,0 -3,0 0,1 0,2 0,3 h 1 v -2 h 2 v 2 h 1 c 0,-2.666667 0,-5.3333333 0,-8 z"/>
</svg>

After

Width:  |  Height:  |  Size: 382 B

View file

@ -0,0 +1,2 @@
SPDX-FileCopyrightText: Adamant36
SPDX-License-Identifier: CC0-1.0

View file

@ -37,7 +37,9 @@
},
"icon": "./assets/layers/cafe_pub/pub.svg",
"layers": [
"cafe_pub"
"cafe_pub",
"outdoor_seating",
"food_courts"
],
"widenFactor": 1.5
}

View file

@ -155,15 +155,15 @@
"centroid"
],
"label": {
"render": "<div style='position: absolute; top: -30px; right: -10px; color: white; background-color: #00a703; width: 20px; height: 20px; border-radius: 100%'>?</div>",
"render": "<div class='text-white text-center w-5 h-5 rounded-full' style='background-color: #00a703'>?</div>",
"mappings": [
{
"if": "rcn_ref~*",
"then": "<div style='position: absolute; top: -30px; right: -10px; color: white; background-color: #00a703; width: 20px; height: 20px; border-radius: 100%'>{rcn_ref}</div>"
"then": "<div class='text-white text-center w-5 h-5 rounded-full' style='background-color: #00a703'>{rcn_ref}</div>"
},
{
"if": "proposed:rcn_ref~*",
"then": "<div style='position: absolute; top: -32px; right: -10px; color: white; background-color: #00a703; width: 20px; height: 20px; border-radius: 100%; border-style:dotted; border-color:white; border-width: 2px'>{proposed:rcn_ref}</div>"
"then": "<div class='text-white text-center w-5 h-5 rounded-full border-2 border-white border-dotted' style='background-color: #00a703'>{proposed:rcn_ref}</div>"
}
]
}
@ -402,4 +402,4 @@
}
}
]
}
}

View file

@ -31,7 +31,9 @@
"icon": "./assets/layers/food/restaurant.svg",
"layers": [
"food",
"ice_cream"
"ice_cream",
"outdoor_seating",
"food_courts"
],
"widenFactor": 3
}
}

View file

@ -151,15 +151,15 @@
"centroid"
],
"label": {
"render": "<div style='position: absolute; top: -30px; right: -10px; color: white; background-color: #452b29; width: 20px; height: 20px; border-radius: 100%'>?</div>",
"render": "<div class='text-white text-center w-5 h-5 rounded-full' style='background-color: #452b29'>?</div>",
"mappings": [
{
"if": "rwn_ref~*",
"then": "<div style='position: absolute; top: -30px; right: -10px; color: white; background-color: #452b29; width: 20px; height: 20px; border-radius: 100%'>{rwn_ref}</div>"
"then": "<div class='text-white text-center w-5 h-5 rounded-full' style='background-color: #452b29'>{rwn_ref}</div>"
},
{
"if": "proposed:rwn_ref~*",
"then": "<div style='position: absolute; top: -31px; right: -10px; color: white; background-color: #452b29; width: 22px; height: 22px; border-radius: 100%; border-style:dotted; border-color:white; border-width: 2px'>{proposed:rwn_ref}</div>"
"then": "<div class='text-white text-center w-5 h-5 rounded-full border-2 border-white border-dotted' style='background-color: #452b29'>{proposed:rwn_ref}</div>"
}
]
}
@ -369,4 +369,4 @@
}
}
]
}
}

View file

@ -693,6 +693,10 @@ video {
position: relative;
}
.\!relative {
position: relative !important;
}
.sticky {
position: -webkit-sticky;
position: sticky;
@ -717,6 +721,10 @@ video {
top: 14rem;
}
.bottom-0 {
bottom: 0px;
}
.top-0 {
top: 0px;
}
@ -725,10 +733,6 @@ video {
left: 0px;
}
.bottom-0 {
bottom: 0px;
}
.right-4 {
right: 1rem;
}
@ -896,14 +900,6 @@ video {
margin-right: 4rem;
}
.mb-4 {
margin-bottom: 1rem;
}
.mb-8 {
margin-bottom: 2rem;
}
.mt-4 {
margin-top: 1rem;
}
@ -936,6 +932,10 @@ video {
margin-right: 0.25rem;
}
.mb-4 {
margin-bottom: 1rem;
}
.ml-1 {
margin-left: 0.25rem;
}
@ -968,6 +968,10 @@ video {
margin-top: 2rem;
}
.mb-8 {
margin-bottom: 2rem;
}
.-ml-6 {
margin-left: -1.5rem;
}
@ -1076,12 +1080,18 @@ video {
height: 6rem;
}
.h-full {
height: 100%;
}
.h-screen {
height: 100vh;
}
.h-full {
height: 100%;
.h-fit {
height: -webkit-fit-content;
height: -moz-fit-content;
height: fit-content;
}
.h-32 {
@ -1105,16 +1115,6 @@ video {
height: 1.5rem;
}
.h-fit {
height: -webkit-fit-content;
height: -moz-fit-content;
height: fit-content;
}
.h-96 {
height: 24rem;
}
.h-0 {
height: 0px;
}
@ -1786,10 +1786,6 @@ video {
background-color: rgb(255 255 255 / var(--tw-bg-opacity));
}
.bg-white\/50 {
background-color: rgb(255 255 255 / 0.5);
}
.bg-red-400 {
--tw-bg-opacity: 1;
background-color: rgb(248 113 113 / var(--tw-bg-opacity));
@ -1876,6 +1872,10 @@ video {
padding-right: 0.5rem;
}
.pl-2 {
padding-left: 0.5rem;
}
.pr-12 {
padding-right: 3rem;
}
@ -1888,10 +1888,6 @@ video {
padding-right: 0.25rem;
}
.pl-2 {
padding-left: 0.5rem;
}
.pt-0\.5 {
padding-top: 0.125rem;
}
@ -2122,6 +2118,11 @@ video {
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
}
.outline-none {
outline: 2px solid transparent;
outline-offset: 2px;
}
.outline {
outline-style: solid;
}
@ -2217,12 +2218,6 @@ video {
backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);
}
.transition-colors {
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
transition-duration: 150ms;
}
.transition {
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, -webkit-transform, -webkit-filter, -webkit-backdrop-filter;
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
@ -2231,6 +2226,12 @@ video {
transition-duration: 150ms;
}
.transition-colors {
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
transition-duration: 150ms;
}
.duration-200 {
transition-duration: 200ms;
}
@ -2928,11 +2929,6 @@ svg.apply-fill path {
max-width: 100%;
}
.hover\:bg-white:hover {
--tw-bg-opacity: 1;
background-color: rgb(255 255 255 / var(--tw-bg-opacity));
}
.hover\:bg-indigo-200:hover {
--tw-bg-opacity: 1;
background-color: rgb(199 210 254 / var(--tw-bg-opacity));

View file

@ -170,7 +170,7 @@ export default class DetermineLayout {
.map((mr) => mr?.marker?.find((icon) => icon.icon !== undefined)?.icon)
.find((i) => i !== undefined)
) ?? "bug"
const icon = new TagRenderingConfig(iconTr).render.txt
const icon = new TagRenderingConfig(iconTr)?.render?.txt ?? "./assets/svg/bug.svg"
json = {
id: json.id,
description: json.description,

View file

@ -29,6 +29,7 @@
import Translations from "./i18n/Translations"
import Tr from "./Base/Tr.svelte"
import Add from "../assets/svg/Add.svelte"
import { SearchIcon } from "@rgossiaux/svelte-heroicons/solid"
export let studioUrl =
window.location.hostname === "127.0.0.2"
@ -55,25 +56,64 @@
const studio = new StudioServer(studioUrl, uid)
let layersWithErr = studio.fetchOverview()
let layerFilterTerm: string = ""
let layers: Store<{ owner: number; id: string }[]> = layersWithErr.mapD((l) =>
l["success"]?.filter((l) => l.category === "layers")
)
let selfLayers: Store<{ owner: number; id: string }[]> = layers.mapD((ls) => ls.filter((l) => l.owner === uid.data), [uid])
let otherLayers: Store<{ owner: number; id: string }[]> = layers.mapD(
(ls) => ls.filter((l) => l.owner !== undefined && l.owner !== uid.data),
$: selfLayers = layers.mapD(
(ls) =>
ls.filter(
(l) => l.owner === uid.data && l.id.toLowerCase().includes(layerFilterTerm.toLowerCase())
),
[uid]
)
$: otherLayers = layers.mapD(
(ls) =>
ls.filter(
(l) =>
l.owner !== undefined &&
l.owner !== uid.data &&
l.id.toLowerCase().includes(layerFilterTerm.toLowerCase())
),
[uid]
)
let officialLayers = layers.mapD((ls) => ls.filter((l) => l.owner === undefined), [uid])
$: officialLayers = layers.mapD(
(ls) =>
ls.filter(
(l) => l.owner === undefined && l.id.toLowerCase().includes(layerFilterTerm.toLowerCase())
),
[uid]
)
let themeFilterTerm: string = ""
let themes: Store<{ owner: number; id: string }[]> = layersWithErr.mapD((l) =>
l["success"]?.filter((l) => l.category === "themes")
)
let selfThemes = themes.mapD((ls) => ls.filter((l) => l.owner === uid.data), [uid])
let otherThemes = themes.mapD(
(ls) => ls.filter((l) => l.owner !== undefined && l.owner !== uid.data),
$: selfThemes = themes.mapD(
(ls) =>
ls.filter(
(l) => l.owner === uid.data && l.id.toLowerCase().includes(themeFilterTerm.toLowerCase())
),
[uid]
)
$: otherThemes = themes.mapD(
(ls) =>
ls.filter(
(l) =>
l.owner !== undefined &&
l.owner !== uid.data &&
l.id.toLowerCase().includes(themeFilterTerm.toLowerCase())
),
[uid]
)
$: officialThemes = themes.mapD(
(ls) =>
ls.filter(
(l) => l.owner === undefined && l.id.toLowerCase().includes(themeFilterTerm.toLowerCase())
),
[uid]
)
let officialThemes = themes.mapD((ls) => ls.filter((l) => l.owner === undefined), [uid])
let state:
| undefined
@ -224,6 +264,22 @@
MapComplete Studio
</BackButton>
<h2>Choose a layer to edit</h2>
<form class="flex justify-center">
<label
class="neutral-label my-2 flex w-full items-center rounded-full border-2 border-black sm:w-1/2"
>
<SearchIcon aria-hidden="true" class="h-8 w-8" />
<input
class="mr-4 w-full outline-none"
id="layer-search"
type="search"
placeholder="Filter layers by name"
bind:value={layerFilterTerm}
/>
</label>
</form>
<ChooseLayerToEdit {osmConnection} layerIds={$selfLayers} on:layerSelected={editLayer}>
<h3 slot="title">Your layers</h3>
</ChooseLayerToEdit>
@ -257,6 +313,22 @@
MapComplete Studio
</BackButton>
<h2>Choose a theme to edit</h2>
<form class="flex justify-center">
<label
class="neutral-label my-2 flex w-full items-center rounded-full border-2 border-black sm:w-1/2"
>
<SearchIcon aria-hidden="true" class="h-8 w-8" />
<input
class="mr-4 w-full outline-none"
id="theme-search"
type="search"
placeholder="Filter themes by name"
bind:value={themeFilterTerm}
/>
</label>
</form>
<ChooseLayerToEdit {osmConnection} layerIds={$selfThemes} on:layerSelected={editTheme}>
<h3 slot="title">Your themes</h3>
</ChooseLayerToEdit>