mirror of
https://github.com/utopia-os/utopia-ui.git
synced 2025-12-13 07:46:10 +00:00
fix(source): fix link detection (#243)
* 3.0.97 * 3.0.98 * 3.0.99 * fixed markdown link detection * Update src/Components/Map/Subcomponents/ItemPopupComponents/TextView.tsx Co-authored-by: Ulf Gebhardt <ulf.gebhardt@webcraft-media.de> * css fix * fix linting --------- Co-authored-by: Ulf Gebhardt <ulf.gebhardt@webcraft-media.de>
This commit is contained in:
parent
6327ae7788
commit
a7a50af896
@ -53,6 +53,13 @@ export const TextView = ({
|
|||||||
|
|
||||||
if (innerText) replacedText = fixUrls(innerText)
|
if (innerText) replacedText = fixUrls(innerText)
|
||||||
|
|
||||||
|
if (replacedText) {
|
||||||
|
replacedText = replacedText.replace(
|
||||||
|
/(?<!\]?\()(?<!<)https?:\/\/[^\s)]+(?!\))(?!>)/g,
|
||||||
|
(url) => `[${url.replace(/https?:\/\/w{3}\./gi, '')}](${url})`,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
if (replacedText) {
|
if (replacedText) {
|
||||||
replacedText = replacedText.replace(mailRegex, (url) => {
|
replacedText = replacedText.replace(mailRegex, (url) => {
|
||||||
return `[${url}](mailto:${url})`
|
return `[${url}](mailto:${url})`
|
||||||
|
|||||||
@ -1,98 +1,103 @@
|
|||||||
.leaflet-control-attribution {
|
.leaflet-control-attribution {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.leaflet-control-locate {
|
.leaflet-control-locate {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.leaflet-data-marker {
|
.leaflet-data-marker {
|
||||||
background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACMAAAAQCAYAAACcN8ZaAAAB3klEQVR42s3U4UdDURzG8czMXJnJ1Vwzc6VJZjaZJdlMlpQsKdmUFNOUspRSSqUolfQfr+fF98Vx5mwv9qbDx7LdznnO7/7Omej3+/+Ga0QMUYkhbvBgmhzCQxwxibIGrGE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gH3pDTYwu1igATvs/pXqvBKiR4i2bNJfi1ZfUAnjgrOG8wY2quNzBKuU/ZS+uSFEl5O0xRGuUIlZCcw7xG5QPkeHYUSNV5WXGou2sC3rBC0LjenqCXGO0WEiTJa0Lr4KixdHBrDGuGGiRqCUpFk8pGIpQtCU7p4YPwxYxEMCk1aAMQZh8Ac8PfbIzYPJOwAAAABJRU5ErkJggg==') no-repeat;
|
||||||
background-position: 6px 32px;
|
background-position: 6px 32px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.leaflet-container {
|
.leaflet-container {
|
||||||
cursor: inherit;
|
cursor: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
.leaflet-popup-scrolled {
|
.leaflet-popup-scrolled {
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.leaflet-popup-content-wrapper, .leaflet-popup-tip{
|
.leaflet-popup-content-wrapper,
|
||||||
background-color: var(--color-base-100);
|
.leaflet-popup-tip {
|
||||||
color: var(--color-base-content);
|
background-color: var(--color-base-100);
|
||||||
border-radius: var(--radius-box);
|
color: var(--color-base-content);
|
||||||
}
|
border-radius: var(--radius-box);
|
||||||
|
}
|
||||||
|
|
||||||
.leaflet-popup-tip-container, .leaflet-popup-tip{
|
.leaflet-popup-tip-container,
|
||||||
border-radius: 0;
|
.leaflet-popup-tip {
|
||||||
}
|
border-radius: 0;
|
||||||
|
}
|
||||||
|
|
||||||
.leaflet-tooltip {
|
.leaflet-tooltip {
|
||||||
background-color: var(--color-base-100);
|
background-color: var(--color-base-100);
|
||||||
color: var(--color-base-content);
|
color: var(--color-base-content);
|
||||||
border-width: 0px;
|
border-width: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.leaflet-tooltip {
|
.leaflet-tooltip {
|
||||||
border-radius: var(--radius-box);
|
border-radius: var(--radius-box);
|
||||||
transition: opacity 500ms;
|
transition: opacity 500ms;
|
||||||
transition-delay: 50ms;
|
transition-delay: 50ms;
|
||||||
}
|
}
|
||||||
|
|
||||||
.leaflet-tooltip::before {
|
.leaflet-tooltip::before {
|
||||||
border-top-color: var(--color-base-100);
|
border-top-color: var(--color-base-100);
|
||||||
}
|
}
|
||||||
|
|
||||||
.leaflet-container {
|
.leaflet-container {
|
||||||
text-align: left;
|
text-align: left;
|
||||||
background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' stroke='%23000' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cstyle%3E.spinner_V8m1%7Btransform-origin:center;animation:spinner_zKoa 2s linear infinite%7D.spinner_V8m1 circle%7Bstroke-linecap:round;animation:spinner_YpZS 1.5s ease-out infinite%7D%40keyframes spinner_zKoa%7B100%25%7Btransform:rotate(360deg)%7D%7D%40keyframes spinner_YpZS%7B0%25%7Bstroke-dasharray:0 150;stroke-dashoffset:0%7D47.5%25%7Bstroke-dasharray:42 150;stroke-dashoffset:-16%7D95%25%2C100%25%7Bstroke-dasharray:42 150;stroke-dashoffset:-59%7D%7D%3C%2Fstyle%3E%3Cg class='spinner_V8m1'%3E%3Ccircle cx='12' cy='12' r='9.5' fill='none' stroke-width='3'%3E%3C%2Fcircle%3E%3C%2Fg%3E%3C%2Fsvg%3E");
|
background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' stroke='%23000' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cstyle%3E.spinner_V8m1%7Btransform-origin:center;animation:spinner_zKoa 2s linear infinite%7D.spinner_V8m1 circle%7Bstroke-linecap:round;animation:spinner_YpZS 1.5s ease-out infinite%7D%40keyframes spinner_zKoa%7B100%25%7Btransform:rotate(360deg)%7D%7D%40keyframes spinner_YpZS%7B0%25%7Bstroke-dasharray:0 150;stroke-dashoffset:0%7D47.5%25%7Bstroke-dasharray:42 150;stroke-dashoffset:-16%7D95%25%2C100%25%7Bstroke-dasharray:42 150;stroke-dashoffset:-59%7D%7D%3C%2Fstyle%3E%3Cg class='spinner_V8m1'%3E%3Ccircle cx='12' cy='12' r='9.5' fill='none' stroke-width='3'%3E%3C%2Fcircle%3E%3C%2Fg%3E%3C%2Fsvg%3E");
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-attachment: fixed;
|
background-attachment: fixed;
|
||||||
background-position: 50% 80%;
|
background-position: 50% 80%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.leaflet-popup-close-button span {
|
.leaflet-popup-close-button span {
|
||||||
color: var(--color-base-content);
|
color: var(--color-base-content);
|
||||||
opacity: 50%;
|
opacity: 50%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.leaflet-top {
|
.leaflet-top {
|
||||||
top: 6em
|
top: 6em
|
||||||
}
|
}
|
||||||
|
|
||||||
.leaflet-left {
|
.leaflet-left {
|
||||||
left: 0.5em
|
left: 0.5em
|
||||||
}
|
}
|
||||||
|
|
||||||
.leaflet-control-zoom {
|
.leaflet-control-zoom {
|
||||||
border-radius: var(--radius-box);
|
border-radius: var(--radius-box);
|
||||||
color: var(--color-base-content);
|
color: var(--color-base-content);
|
||||||
background-color: var(--color-base-100);
|
background-color: var(--color-base-100);
|
||||||
width: calc(var(--tw-spacing) * 10);
|
width: calc(var(--tw-spacing) * 10);
|
||||||
border: 2px solid var(--color-base-300) !important;
|
border: 2px solid var(--color-base-300) !important;
|
||||||
box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1) !important;
|
box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.leaflet-control-zoom-in {
|
.leaflet-control-zoom-in {
|
||||||
border-top-left-radius: var(--radius-box) !important;
|
border-top-left-radius: var(--radius-box) !important;
|
||||||
border-top-right-radius: var(--radius-box) !important;
|
border-top-right-radius: var(--radius-box) !important;
|
||||||
color: var(--color-base-content) !important;
|
color: var(--color-base-content) !important;
|
||||||
background-color: var(--color-base-100) !important;
|
background-color: var(--color-base-100) !important;
|
||||||
width: calc(var(--tw-spacing) * 9) !important;
|
width: calc(var(--tw-spacing) * 9) !important;
|
||||||
border-bottom: 1px solid var(--color-base-300) !important;
|
border-bottom: 1px solid var(--color-base-300) !important;
|
||||||
height: calc(var(--tw-spacing) * 9) !important;
|
height: calc(var(--tw-spacing) * 9) !important;
|
||||||
line-height: 40px !important;
|
line-height: 40px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.leaflet-control-zoom-out {
|
.leaflet-control-zoom-out {
|
||||||
border-bottom-left-radius: var(--radius-box) !important;
|
border-bottom-left-radius: var(--radius-box) !important;
|
||||||
border-bottom-right-radius: var(--radius-box) !important;
|
border-bottom-right-radius: var(--radius-box) !important;
|
||||||
color: var(--color-base-content) !important;
|
color: var(--color-base-content) !important;
|
||||||
background-color: var(--color-base-100) !important;
|
background-color: var(--color-base-100) !important;
|
||||||
width: calc(var(--tw-spacing) * 9) !important;
|
width: calc(var(--tw-spacing) * 9) !important;
|
||||||
height: calc(var(--tw-spacing) * 9) !important;
|
height: calc(var(--tw-spacing) * 9) !important;
|
||||||
line-height: 40px !important;
|
line-height: 40px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.leaflet-popup-content p {
|
||||||
|
margin: calc(var(--tw-spacing) * 1) !important
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user