-
+
{#if $isFocused}
{#if $searchTerm.length > 0 && results === undefined}
@@ -64,7 +66,7 @@
{#each $recentThemes as themeId (themeId)}
{/each}
diff --git a/src/Utils.ts b/src/Utils.ts
index 45fdc7271..f853a6619 100644
--- a/src/Utils.ts
+++ b/src/Utils.ts
@@ -1,4 +1,5 @@
import DOMPurify from "dompurify"
+
export class Utils {
/**
* In the 'deploy'-step, some code needs to be run by ts-node.
@@ -1771,22 +1772,26 @@ In the case that MapComplete is pointed to the testing grounds, the edit will be
}
- static NoNullInplace(layers: any[]): void {
- for (let i = layers.length - 1; i >= 0; i--) {
- if (layers[i] === null || layers[i] === undefined) {
- layers.splice(i, 1)
+ static NoNullInplace(items: T[]): T[] {
+ for (let i = items.length - 1; i >= 0; i--) {
+ if (items[i] === null || items[i] === undefined) {
+ items.splice(i, 1)
}
}
+ return items
}
- private static emojiRegex = /[\p{Extended_Pictographic}🛰️]$/u
+ private static emojiRegex = /[\p{Extended_Pictographic}🛰️]/u
/**
* Returns 'true' if the given string contains at least one and only emoji characters
*
* Utils.isEmoji("⛰\uFE0F") // => true
+ * Utils.isEmoji("🇧🇪") // => true
+ * Utils.isEmoji("🍕") // => true
*/
public static isEmoji(string: string) {
- return Utils.emojiRegex.test(string)
+ return Utils.emojiRegex.test(string) ||
+ /[🇦-🇿]{2}/u.test(string) // flags, see https://stackoverflow.com/questions/53360006/detect-with-regex-if-emoji-is-country-flag
}
}
diff --git a/src/index.css b/src/index.css
index 463b0c00e..f55289308 100644
--- a/src/index.css
+++ b/src/index.css
@@ -382,6 +382,17 @@ h2.group {
background-color: #58cd2722;
}
+.badge {
+ display: flex;
+ align-items: center;
+ white-space: nowrap;
+ border-radius: 999rem;
+ padding-left: 0.5rem;
+ padding-right: 0.5rem;
+ border: 1px solid var(--subtle-detail-color-light-contrast);
+ background-color: var(--low-interaction-background);
+}
+
.alert {
/* The class to convey important information, e.g. 'invalid', 'something went wrong', 'warning: testmode', ... */
background-color: var(--alert-color);