@elmethis/qwik 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.qwik.mjs
CHANGED
|
@@ -1,19 +1,9 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "@builder.io/qwik/jsx-runtime";
|
|
2
|
-
import { component$, Slot, useSignal, useTask$, $, useComputed$, useVisibleTask$, useContextProvider, createContextId, useContext } from "@builder.io/qwik";
|
|
2
|
+
import { component$, useStylesScoped$, Slot, useStyles$, useSignal, useTask$, $, useComputed$, useVisibleTask$, useContextProvider, createContextId, useContext } from "@builder.io/qwik";
|
|
3
3
|
import { mdiClipboardCheckMultipleOutline, mdiClipboardMultipleOutline, mdiChevronRight, mdiPlus, mdiMessageImageOutline, mdiFile, mdiDownload, mdiLinkVariant, mdiFormatQuoteOpen, mdiFormatQuoteClose, mdiAlertOctagram, mdiAlert, mdiShieldAlert, mdiLightbulbOn, mdiInformation } from "@mdi/js";
|
|
4
4
|
import { renderToString } from "katex";
|
|
5
5
|
import { kebabCase } from "lodash-es";
|
|
6
|
-
const
|
|
7
|
-
const divider = "_divider_f7ep7_49";
|
|
8
|
-
const code$1 = "_code_f7ep7_1";
|
|
9
|
-
const styles$m = {
|
|
10
|
-
"code-block": "_code-block_f7ep7_1",
|
|
11
|
-
"language-icon": "_language-icon_f7ep7_22",
|
|
12
|
-
caption: caption$1,
|
|
13
|
-
"copy-icon": "_copy-icon_f7ep7_33",
|
|
14
|
-
divider,
|
|
15
|
-
code: code$1
|
|
16
|
-
};
|
|
6
|
+
const styles$n = '.code-block {\n display: grid;\n grid-template-rows: 2.75rem 1px 1fr;\n grid-template-columns: 2rem 1fr 2.5rem;\n grid-template-areas: "language-icon caption copy-icon" "divider divider divider" "code code code";\n align-items: center;\n justify-content: center;\n gap: 0;\n box-sizing: border-box;\n width: 100%;\n margin: 0;\n padding: 0.25rem;\n border-radius: 0.25rem;\n background-color: rgba(255, 255, 255, 0.4);\n box-shadow: 0 0 0.125rem rgba(62, 67, 75, 0.3);\n}\n[data-theme=dark] .code-block {\n background-color: rgba(44, 48, 55, 0.9);\n box-shadow: 0 0 0.125rem rgba(0, 0, 0, 0.4);\n}\n\n.language-icon {\n grid-area: language-icon;\n padding-inline-start: 0.75rem;\n}\n\n.caption {\n grid-area: caption;\n padding: 1rem;\n font-family: monospace;\n}\n\n.copy-icon {\n grid-area: copy-icon;\n padding: 0.25rem;\n width: 1.25rem;\n height: 1.25rem;\n border-radius: 0.125rem;\n transition: background-color 100ms;\n cursor: pointer;\n}\n.copy-icon:hover {\n background-color: rgba(0, 0, 0, 0.1);\n}\n[data-theme=dark] .copy-icon:hover {\n background-color: rgba(255, 255, 255, 0.1);\n}\n\n.divider {\n grid-area: divider;\n width: calc(100% - 1rem);\n border: none;\n border-bottom: solid 1px rgba(128, 128, 128, 0.5);\n}\n\n.code {\n grid-area: code;\n box-sizing: border-box;\n padding: 0 1rem;\n}';
|
|
17
7
|
const Rust = component$(({ size = 24, ...props }) => {
|
|
18
8
|
return /* @__PURE__ */ jsx("svg", {
|
|
19
9
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -65,11 +55,9 @@ const Typescript = component$(({ size = 24, ...props }) => {
|
|
|
65
55
|
]
|
|
66
56
|
});
|
|
67
57
|
});
|
|
68
|
-
const path = "
|
|
69
|
-
const styles$l = {
|
|
70
|
-
path
|
|
71
|
-
};
|
|
58
|
+
const styles$m = ".path {\n fill: #293138;\n}\n[data-theme=dark] .path {\n fill: #d2dbe3;\n}";
|
|
72
59
|
const Bash = component$(({ size = 24, ...props }) => {
|
|
60
|
+
useStylesScoped$(styles$m);
|
|
73
61
|
return /* @__PURE__ */ jsxs("svg", {
|
|
74
62
|
xmlns: "http://www.w3.org/2000/svg",
|
|
75
63
|
viewBox: "0 0 128 128",
|
|
@@ -82,7 +70,7 @@ const Bash = component$(({ size = 24, ...props }) => {
|
|
|
82
70
|
d: "M4.24 4.24h119.53v119.53H4.24z"
|
|
83
71
|
}),
|
|
84
72
|
/* @__PURE__ */ jsx("path", {
|
|
85
|
-
class:
|
|
73
|
+
class: "path",
|
|
86
74
|
d: "M109.01 28.64L71.28 6.24c-2.25-1.33-4.77-2-7.28-2s-5.03.67-7.28 2.01l-37.74 22.4c-4.5 2.67-7.28 7.61-7.28 12.96v44.8c0 5.35 2.77 10.29 7.28 12.96l37.73 22.4c2.25 1.34 4.76 2 7.28 2c2.51 0 5.03-.67 7.28-2l37.74-22.4c4.5-2.67 7.28-7.62 7.28-12.96V41.6c0-5.34-2.77-10.29-7.28-12.96M79.79 98.59l.06 3.22c0 .39-.25.83-.55.99l-1.91 1.1c-.3.15-.56-.03-.56-.42l-.03-3.17c-1.63.68-3.29.84-4.34.42c-.2-.08-.29-.37-.21-.71l.69-2.91c.06-.23.18-.46.34-.6c.06-.06.12-.1.18-.13c.11-.06.22-.07.31-.03c1.14.38 2.59.2 3.99-.5c1.78-.9 2.97-2.72 2.95-4.52c-.02-1.64-.9-2.31-3.05-2.33c-2.74.01-5.3-.53-5.34-4.57c-.03-3.32 1.69-6.78 4.43-8.96l-.03-3.25c0-.4.24-.84.55-1l1.85-1.18c.3-.15.56.04.56.43l.03 3.25c1.36-.54 2.54-.69 3.61-.44c.23.06.34.38.24.75l-.72 2.88c-.06.22-.18.44-.33.58a.8.8 0 0 1-.19.14c-.1.05-.19.06-.28.05c-.49-.11-1.65-.36-3.48.56c-1.92.97-2.59 2.64-2.58 3.88c.02 1.48.77 1.93 3.39 1.97c3.49.06 4.99 1.58 5.03 5.09c.05 3.44-1.79 7.15-4.61 9.41m26.34-60.5l-35.7 22.05c-4.45 2.6-7.73 5.52-7.74 10.89v43.99c0 3.21 1.3 5.29 3.29 5.9c-.65.11-1.32.19-1.98.19c-2.09 0-4.15-.57-5.96-1.64l-37.73-22.4c-3.69-2.19-5.98-6.28-5.98-10.67V41.6c0-4.39 2.29-8.48 5.98-10.67l37.74-22.4c1.81-1.07 3.87-1.64 5.96-1.64s4.15.57 5.96 1.64l37.74 22.4c3.11 1.85 5.21 5.04 5.8 8.63c-1.27-2.67-4.09-3.39-7.38-1.47"
|
|
87
75
|
}),
|
|
88
76
|
/* @__PURE__ */ jsx("path", {
|
|
@@ -607,42 +595,30 @@ const ElmLanguageIcon = component$(({ size = 24, language }) => {
|
|
|
607
595
|
size
|
|
608
596
|
});
|
|
609
597
|
});
|
|
610
|
-
const
|
|
611
|
-
const
|
|
612
|
-
const
|
|
613
|
-
const link$1 = "_link_1gswr_47";
|
|
614
|
-
const styles$k = {
|
|
615
|
-
text: text$1,
|
|
616
|
-
code,
|
|
617
|
-
kbd,
|
|
618
|
-
link: link$1
|
|
619
|
-
};
|
|
620
|
-
const text = "_text_zryur_1";
|
|
621
|
-
const textStyles = {
|
|
622
|
-
text
|
|
623
|
-
};
|
|
624
|
-
const icon$2 = "_icon_19g82_1";
|
|
625
|
-
const styles$j = {
|
|
626
|
-
icon: icon$2
|
|
627
|
-
};
|
|
598
|
+
const styles$l = '.text {\n padding: 0;\n margin: 0;\n white-space: pre-line;\n font-size: var(--font-size, 1em);\n line-height: var(--font-size, 1em);\n background-color: var(--background-color);\n transition: color 200ms;\n text-decoration-color: var(--color);\n}\n\n.code {\n margin-inline: 0.25rem;\n padding: 2px 0.5em;\n font-size: calc(1em - 2px);\n border-radius: 0.125rem;\n background-color: rgba(0, 0, 0, 0.075);\n font-family: "Source Code Pro" monospace;\n}\n\n.kbd {\n padding: 0.125rem 0.25rem;\n position: relative;\n border-radius: 0.125rem;\n background-color: #e6e6e6;\n}\n[data-theme=dark] .kbd {\n background-color: #404040;\n}\n.kbd::before {\n z-index: -1;\n position: absolute;\n content: "";\n bottom: -0.25em;\n left: 0;\n height: 100%;\n width: 100%;\n background-color: #ccc;\n border-radius: 0 0 0.125rem 0.125rem;\n box-shadow: 0 0 0.125em rgba(0, 0, 0, 0.5);\n}\n[data-theme=dark] .kbd::before {\n background-color: #595959;\n box-shadow: 0 0 0.125em rgba(255, 255, 255, 0.5);\n}\n\n.link {\n all: unset;\n box-sizing: border-box;\n padding: 0 0.25rem;\n font-size: var(--font-size);\n display: inline-flex;\n align-items: center;\n gap: 0.25rem;\n cursor: pointer;\n color: #6987b8;\n border-radius: 0.125rem;\n transition: background-color 200ms, color 200ms, opacity 200ms;\n}\n.link:hover {\n background-color: rgba(105, 135, 184, 0.2);\n}\n.link:active {\n opacity: 0.5;\n}\n.link:visited {\n color: #9771bd;\n border-bottom: dashed 1px #9771bd;\n}\n.link:visited:hover {\n background-color: rgba(151, 113, 189, 0.2);\n}\n\n.ogp {\n display: flex;\n flex-direction: column;\n gap: 0.25rem;\n overflow: hidden;\n border-radius: 0.25rem;\n box-shadow: 0 0 0.125rem rgba(0, 0, 0, 0.3);\n background-color: rgba(255, 255, 255, 0.8);\n}\n[data-theme=dark] .ogp {\n background-color: rgba(255, 255, 255, 0.1);\n}\n\n.ogp-text {\n box-sizing: border-box;\n padding: 0.5rem;\n}\n\n.ogp-title {\n box-sizing: border-box;\n font-weight: bold;\n padding-block-end: 0.25rem;\n}\n\n.ogp-description {\n opacity: 0.7;\n padding: 0.25rem;\n}';
|
|
599
|
+
const textStyles = ".text {\n color: var(--color, #606875);\n}\n.text::selection {\n color: #cccfd5;\n background-color: var(--color, #3e434b);\n}\n[data-theme=dark] .text {\n color: var(--color, #b0b5be);\n}\n[data-theme=dark] .text::selection {\n color: #3e434b;\n background-color: var(--color, #cccfd5);\n}";
|
|
600
|
+
const styles$k = ".icon {\n margin: 0;\n padding: 0;\n display: inline-block;\n vertical-align: middle;\n height: 1em;\n}\n.icon::selection {\n filter: brightness(1000%);\n background-color: var(--color, rgba(0, 0, 0, 0.25));\n}\n[data-theme=dark] .icon {\n color: var(--color, rgba(255, 255, 255, 0.7));\n}\n[data-theme=dark] .icon::selection {\n color: rgba(0, 0, 0, 0.7);\n background-color: var(--color, rgba(255, 255, 255, 0.25));\n}";
|
|
628
601
|
const ElmInlineIcon = component$(({ src, alt }) => {
|
|
602
|
+
useStylesScoped$(styles$k);
|
|
629
603
|
return /* @__PURE__ */ jsx("div", {
|
|
630
|
-
class:
|
|
604
|
+
class: "icon",
|
|
631
605
|
children: /* @__PURE__ */ jsx("img", {
|
|
632
606
|
src,
|
|
633
607
|
alt,
|
|
634
|
-
class:
|
|
608
|
+
class: "icon"
|
|
635
609
|
})
|
|
636
610
|
});
|
|
637
611
|
});
|
|
638
612
|
const ElmInlineText = component$((props) => {
|
|
639
|
-
|
|
613
|
+
useStylesScoped$(styles$l);
|
|
614
|
+
useStylesScoped$(textStyles);
|
|
615
|
+
const { bold = false, italic = false, underline = false, strikethrough = false, code = false, size = "1em" } = props;
|
|
640
616
|
let vnode = props.text ? /* @__PURE__ */ jsx("span", {
|
|
641
617
|
children: props.text
|
|
642
618
|
}) : /* @__PURE__ */ jsx(Slot, {});
|
|
643
619
|
if (props.kbd) {
|
|
644
620
|
vnode = /* @__PURE__ */ jsx("kbd", {
|
|
645
|
-
class:
|
|
621
|
+
class: "kbd",
|
|
646
622
|
children: vnode
|
|
647
623
|
});
|
|
648
624
|
}
|
|
@@ -666,15 +642,15 @@ const ElmInlineText = component$((props) => {
|
|
|
666
642
|
children: vnode
|
|
667
643
|
});
|
|
668
644
|
}
|
|
669
|
-
if (
|
|
645
|
+
if (code) {
|
|
670
646
|
vnode = /* @__PURE__ */ jsx("code", {
|
|
671
|
-
class:
|
|
647
|
+
class: "code",
|
|
672
648
|
children: vnode
|
|
673
649
|
});
|
|
674
650
|
}
|
|
675
651
|
if (props.ruby) {
|
|
676
652
|
vnode = /* @__PURE__ */ jsxs("ruby", {
|
|
677
|
-
class:
|
|
653
|
+
class: "text",
|
|
678
654
|
children: [
|
|
679
655
|
/* @__PURE__ */ jsx("span", {
|
|
680
656
|
children: vnode
|
|
@@ -687,8 +663,8 @@ const ElmInlineText = component$((props) => {
|
|
|
687
663
|
}
|
|
688
664
|
const wrappedVnode = /* @__PURE__ */ jsx("span", {
|
|
689
665
|
class: [
|
|
690
|
-
|
|
691
|
-
|
|
666
|
+
"text",
|
|
667
|
+
"text"
|
|
692
668
|
],
|
|
693
669
|
style: {
|
|
694
670
|
"--color": props.color,
|
|
@@ -699,7 +675,7 @@ const ElmInlineText = component$((props) => {
|
|
|
699
675
|
});
|
|
700
676
|
if (props.href) {
|
|
701
677
|
return /* @__PURE__ */ jsxs("a", {
|
|
702
|
-
class:
|
|
678
|
+
class: "link",
|
|
703
679
|
href: props.href,
|
|
704
680
|
style: {
|
|
705
681
|
"--font-size": size
|
|
@@ -716,10 +692,12 @@ const ElmInlineText = component$((props) => {
|
|
|
716
692
|
}
|
|
717
693
|
return wrappedVnode;
|
|
718
694
|
});
|
|
719
|
-
const
|
|
695
|
+
const styles$j = '.shiki,\n.shiki span {\n font-family: "Source Code Pro", Menlo, Consolas, "DejaVu Sans Mono", monospace !important;\n}\n.shiki *::selection,\n.shiki span *::selection {\n background-color: rgba(0, 0, 0, 0.1);\n}\n[data-theme=dark] .shiki *::selection,\n[data-theme=dark] .shiki span *::selection {\n background-color: rgba(255, 255, 255, 0.15);\n}\n[data-theme=dark] .shiki,\n[data-theme=dark] .shiki span {\n color: var(--shiki-dark) !important;\n background-color: var(--shiki-dark-bg) !important;\n}';
|
|
696
|
+
const ElmShikiHighlighter = component$(({ code, language = "txt" }) => {
|
|
697
|
+
useStyles$(styles$j);
|
|
720
698
|
const rawHtml = useSignal("");
|
|
721
699
|
useTask$(async ({ track }) => {
|
|
722
|
-
const currentCode = track(() =>
|
|
700
|
+
const currentCode = track(() => code);
|
|
723
701
|
const currentLang = track(() => language);
|
|
724
702
|
const { getHighlighterSingleton } = await import("./shikiInstance-igs7t2fe.js");
|
|
725
703
|
const highlighter = await getHighlighterSingleton();
|
|
@@ -743,13 +721,11 @@ const ElmShikiHighlighter = component$(({ code: code2, language = "txt" }) => {
|
|
|
743
721
|
dangerouslySetInnerHTML: rawHtml.value
|
|
744
722
|
});
|
|
745
723
|
});
|
|
746
|
-
const
|
|
747
|
-
const styles$i = {
|
|
748
|
-
icon: icon$1
|
|
749
|
-
};
|
|
724
|
+
const styles$i = ".icon {\n fill: var(--color, #555b67);\n transition: fill 200ms;\n}\n[data-theme=dark] .icon {\n fill: var(--dark-color, #b0b5be);\n}";
|
|
750
725
|
const ElmMdiIcon = component$(({ d, size = "1em", color, lightColor, darkColor }) => {
|
|
726
|
+
useStylesScoped$(styles$i);
|
|
751
727
|
return /* @__PURE__ */ jsx("svg", {
|
|
752
|
-
class:
|
|
728
|
+
class: "icon",
|
|
753
729
|
style: {
|
|
754
730
|
"--color": lightColor ?? color,
|
|
755
731
|
"--dark-color": darkColor ?? color
|
|
@@ -766,7 +742,8 @@ const ElmMdiIcon = component$(({ d, size = "1em", color, lightColor, darkColor }
|
|
|
766
742
|
})
|
|
767
743
|
});
|
|
768
744
|
});
|
|
769
|
-
const ElmCodeBlock = component$(({ code
|
|
745
|
+
const ElmCodeBlock = component$(({ code, language = "txt", caption, margin }) => {
|
|
746
|
+
useStylesScoped$(styles$n);
|
|
770
747
|
const timerId = useSignal(null);
|
|
771
748
|
const copyToClipboard = $(async () => {
|
|
772
749
|
if (timerId.value !== null) {
|
|
@@ -774,35 +751,35 @@ const ElmCodeBlock = component$(({ code: code2, language = "txt", caption: capti
|
|
|
774
751
|
timerId.value = null;
|
|
775
752
|
}
|
|
776
753
|
try {
|
|
777
|
-
await navigator.clipboard.writeText(
|
|
754
|
+
await navigator.clipboard.writeText(code);
|
|
778
755
|
timerId.value = window.setTimeout(() => timerId.value = null, 1500);
|
|
779
756
|
} catch (err) {
|
|
780
757
|
console.error("Failed to copy: ", err);
|
|
781
758
|
}
|
|
782
759
|
});
|
|
783
760
|
return /* @__PURE__ */ jsxs("figure", {
|
|
784
|
-
class:
|
|
761
|
+
class: "code-block",
|
|
785
762
|
style: {
|
|
786
763
|
margin
|
|
787
764
|
},
|
|
788
765
|
children: [
|
|
789
766
|
/* @__PURE__ */ jsx("span", {
|
|
790
|
-
class:
|
|
767
|
+
class: "language-icon",
|
|
791
768
|
children: /* @__PURE__ */ jsx(ElmLanguageIcon, {
|
|
792
769
|
language
|
|
793
770
|
})
|
|
794
771
|
}),
|
|
795
772
|
/* @__PURE__ */ jsx("span", {
|
|
796
|
-
class:
|
|
773
|
+
class: "caption",
|
|
797
774
|
children: /* @__PURE__ */ jsxs(ElmInlineText, {
|
|
798
775
|
children: [
|
|
799
|
-
|
|
776
|
+
caption || language,
|
|
800
777
|
/* @__PURE__ */ jsx(Slot, {})
|
|
801
778
|
]
|
|
802
779
|
})
|
|
803
780
|
}),
|
|
804
781
|
/* @__PURE__ */ jsx("div", {
|
|
805
|
-
class:
|
|
782
|
+
class: "copy-icon",
|
|
806
783
|
onClick$: copyToClipboard,
|
|
807
784
|
children: /* @__PURE__ */ jsx(ElmMdiIcon, {
|
|
808
785
|
size: "1.25rem",
|
|
@@ -811,12 +788,12 @@ const ElmCodeBlock = component$(({ code: code2, language = "txt", caption: capti
|
|
|
811
788
|
})
|
|
812
789
|
}),
|
|
813
790
|
/* @__PURE__ */ jsx("hr", {
|
|
814
|
-
class:
|
|
791
|
+
class: "divider"
|
|
815
792
|
}),
|
|
816
793
|
/* @__PURE__ */ jsx("div", {
|
|
817
|
-
class:
|
|
794
|
+
class: "code",
|
|
818
795
|
children: /* @__PURE__ */ jsx(ElmShikiHighlighter, {
|
|
819
|
-
code
|
|
796
|
+
code,
|
|
820
797
|
language
|
|
821
798
|
})
|
|
822
799
|
})
|
|
@@ -824,70 +801,48 @@ const ElmCodeBlock = component$(({ code: code2, language = "txt", caption: capti
|
|
|
824
801
|
});
|
|
825
802
|
});
|
|
826
803
|
const ElmKatex = component$(({ expression, block = false }) => {
|
|
804
|
+
useStylesScoped$(textStyles);
|
|
827
805
|
const html = useComputed$(() => renderToString(expression, {
|
|
828
806
|
displayMode: block,
|
|
829
807
|
output: "mathml"
|
|
830
808
|
}));
|
|
831
809
|
return /* @__PURE__ */ jsx("div", {
|
|
832
|
-
class:
|
|
810
|
+
class: "text",
|
|
833
811
|
dangerouslySetInnerHTML: html.value
|
|
834
812
|
});
|
|
835
813
|
});
|
|
836
|
-
const toggle = "
|
|
837
|
-
const
|
|
838
|
-
|
|
839
|
-
const footer = "_footer_1nxqa_80";
|
|
840
|
-
const styles$h = {
|
|
841
|
-
toggle,
|
|
842
|
-
"toggle-closed": "_toggle-closed_1nxqa_7",
|
|
843
|
-
"toggle-open": "_toggle-open_1nxqa_10",
|
|
844
|
-
summary,
|
|
845
|
-
"summary-open": "_summary-open_1nxqa_29",
|
|
846
|
-
"summary-closed": "_summary-closed_1nxqa_33",
|
|
847
|
-
"chevron-icon": "_chevron-icon_1nxqa_37",
|
|
848
|
-
"chevron-icon-open": "_chevron-icon-open_1nxqa_40",
|
|
849
|
-
"chevron-icon-closed": "_chevron-icon-closed_1nxqa_43",
|
|
850
|
-
"plus-icon": "_plus-icon_1nxqa_47",
|
|
851
|
-
"plus-icon-open": "_plus-icon-open_1nxqa_53",
|
|
852
|
-
"plus-icon-closed": "_plus-icon-closed_1nxqa_56",
|
|
853
|
-
content: content$2,
|
|
854
|
-
"content-open": "_content-open_1nxqa_73",
|
|
855
|
-
"content-closed": "_content-closed_1nxqa_76",
|
|
856
|
-
footer,
|
|
857
|
-
"footer-line": "_footer-line_1nxqa_99",
|
|
858
|
-
"footer-cross-icon": "_footer-cross-icon_1nxqa_106",
|
|
859
|
-
"footer-chevron-icon": "_footer-chevron-icon_1nxqa_109"
|
|
860
|
-
};
|
|
861
|
-
const ElmToggle = component$(({ summary: summary2 }) => {
|
|
814
|
+
const styles$h = ".toggle {\n margin: 0;\n display: grid;\n transition: grid 200ms;\n overflow: hidden;\n}\n.toggle.toggle-closed {\n grid-template-rows: 3.5rem 0fr 0rem;\n}\n.toggle.toggle-open {\n grid-template-rows: 3.5rem 1fr 3rem;\n}\n\n.summary {\n box-sizing: border-box;\n padding-inline: 1rem;\n display: grid;\n grid-template-columns: min-content 1fr min-content;\n gap: 1rem;\n align-items: center;\n cursor: pointer;\n border: 1px solid rgba(0, 0, 0, 0.125);\n background-color: rgba(62, 67, 75, 0.05);\n}\n[data-theme=dark] .summary {\n border: 1px solid rgba(255, 255, 255, 0.125);\n background-color: rgba(190, 194, 202, 0.1);\n}\n.summary.summary-open {\n border-radius: 0.25rem 0.25rem 0 0;\n border-bottom-color: transparent;\n}\n.summary.summary-closed {\n border-radius: 0.25rem;\n}\n\n.chevron-icon {\n transition: transform 200ms;\n}\n.chevron-icon.chevron-icon-open {\n transform: rotate(90deg);\n}\n.chevron-icon.chevron-icon-closed {\n transform: rotate(0deg);\n}\n\n.plus-icon {\n height: 1rem;\n width: 1rem;\n transform-origin: center;\n transition: transform 200ms;\n}\n.plus-icon.plus-icon-open {\n transform: rotate(135deg);\n}\n.plus-icon.plus-icon-closed {\n transform: rotate(0deg);\n}\n\n.content {\n box-sizing: border-box;\n padding: 1rem;\n overflow: hidden;\n transition: opacity 200ms;\n border: 1px solid rgba(0, 0, 0, 0.125);\n border-radius: 0 0 0.25rem 0.25rem;\n background-color: rgba(62, 67, 75, 0.0125);\n}\n[data-theme=dark] .content {\n border-color: rgba(255, 255, 255, 0.125);\n background-color: rgba(190, 194, 202, 0.025);\n}\n.content.content-open {\n opacity: 1;\n}\n.content.content-closed {\n opacity: 0;\n}\n\n.footer {\n box-sizing: border-box;\n margin: 0.25rem 0rem;\n padding: 0.5rem;\n color: #c56565;\n font-family: monospace;\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 0.5rem;\n user-select: none;\n cursor: pointer;\n border-radius: 0.25rem;\n transition: opacity 200ms, background-color 200ms;\n}\n.footer:hover {\n opacity: 0.5;\n background-color: rgba(96, 104, 117, 0.1);\n}\n.footer.footer-line {\n box-sizing: border-box;\n margin: 0 0.25rem;\n flex-grow: 1;\n border: none;\n border-bottom: solid 1px rgba(128, 128, 128, 0.3);\n}\n.footer.footer-cross-icon {\n transform: rotate(45deg);\n}\n.footer.footer-chevron-icon {\n transform: rotate(-90deg);\n}";
|
|
815
|
+
const ElmToggle = component$(({ summary }) => {
|
|
816
|
+
useStylesScoped$(styles$h);
|
|
862
817
|
const isOpen = useSignal(false);
|
|
863
|
-
const
|
|
818
|
+
const toggle = $(() => {
|
|
864
819
|
isOpen.value = !isOpen.value;
|
|
865
820
|
});
|
|
866
821
|
return /* @__PURE__ */ jsxs("div", {
|
|
867
822
|
class: [
|
|
868
|
-
|
|
823
|
+
"toggle",
|
|
869
824
|
{
|
|
870
|
-
|
|
871
|
-
|
|
825
|
+
"toggle-open": isOpen.value,
|
|
826
|
+
"toggle-closed": !isOpen.value
|
|
872
827
|
}
|
|
873
828
|
],
|
|
874
829
|
children: [
|
|
875
830
|
/* @__PURE__ */ jsxs("div", {
|
|
876
831
|
class: [
|
|
877
|
-
|
|
832
|
+
"summary",
|
|
878
833
|
{
|
|
879
|
-
|
|
880
|
-
|
|
834
|
+
"summary-open": isOpen.value,
|
|
835
|
+
"summary-closed": !isOpen.value
|
|
881
836
|
}
|
|
882
837
|
],
|
|
883
|
-
onClick$:
|
|
838
|
+
onClick$: toggle,
|
|
884
839
|
children: [
|
|
885
840
|
/* @__PURE__ */ jsx("span", {
|
|
886
841
|
class: [
|
|
887
|
-
|
|
842
|
+
"chevron-icon",
|
|
888
843
|
{
|
|
889
|
-
|
|
890
|
-
|
|
844
|
+
"chevron-icon-open": isOpen.value,
|
|
845
|
+
"chevron-icon-closed": !isOpen.value
|
|
891
846
|
}
|
|
892
847
|
],
|
|
893
848
|
children: /* @__PURE__ */ jsx(ElmMdiIcon, {
|
|
@@ -895,17 +850,17 @@ const ElmToggle = component$(({ summary: summary2 }) => {
|
|
|
895
850
|
})
|
|
896
851
|
}),
|
|
897
852
|
/* @__PURE__ */ jsx("span", {
|
|
898
|
-
class:
|
|
899
|
-
children:
|
|
853
|
+
class: "summary-text",
|
|
854
|
+
children: summary ? summary : /* @__PURE__ */ jsx(Slot, {
|
|
900
855
|
name: "summary"
|
|
901
856
|
})
|
|
902
857
|
}),
|
|
903
858
|
/* @__PURE__ */ jsx("span", {
|
|
904
859
|
class: [
|
|
905
|
-
|
|
860
|
+
"plus-icon",
|
|
906
861
|
{
|
|
907
|
-
|
|
908
|
-
|
|
862
|
+
"plus-icon-open": isOpen.value,
|
|
863
|
+
"plus-icon-closed": !isOpen.value
|
|
909
864
|
}
|
|
910
865
|
],
|
|
911
866
|
children: /* @__PURE__ */ jsx(ElmMdiIcon, {
|
|
@@ -918,30 +873,30 @@ const ElmToggle = component$(({ summary: summary2 }) => {
|
|
|
918
873
|
}),
|
|
919
874
|
/* @__PURE__ */ jsx("div", {
|
|
920
875
|
class: [
|
|
921
|
-
|
|
876
|
+
"content",
|
|
922
877
|
{
|
|
923
|
-
|
|
924
|
-
|
|
878
|
+
"content-open": isOpen.value,
|
|
879
|
+
"content-closed": !isOpen.value
|
|
925
880
|
}
|
|
926
881
|
],
|
|
927
882
|
children: /* @__PURE__ */ jsx(Slot, {})
|
|
928
883
|
}),
|
|
929
884
|
/* @__PURE__ */ jsxs("div", {
|
|
930
|
-
class:
|
|
931
|
-
onClick$:
|
|
885
|
+
class: "footer",
|
|
886
|
+
onClick$: toggle,
|
|
932
887
|
children: [
|
|
933
888
|
/* @__PURE__ */ jsx("span", {
|
|
934
|
-
class:
|
|
889
|
+
class: "footer-chevron-icon",
|
|
935
890
|
children: /* @__PURE__ */ jsx(ElmMdiIcon, {
|
|
936
891
|
d: mdiChevronRight,
|
|
937
892
|
color: "gray"
|
|
938
893
|
})
|
|
939
894
|
}),
|
|
940
895
|
/* @__PURE__ */ jsx("hr", {
|
|
941
|
-
class:
|
|
896
|
+
class: "footer-line"
|
|
942
897
|
}),
|
|
943
898
|
/* @__PURE__ */ jsx("span", {
|
|
944
|
-
class:
|
|
899
|
+
class: "footer-cross-icon",
|
|
945
900
|
children: /* @__PURE__ */ jsx(ElmMdiIcon, {
|
|
946
901
|
d: mdiPlus,
|
|
947
902
|
color: "#c56565"
|
|
@@ -951,17 +906,17 @@ const ElmToggle = component$(({ summary: summary2 }) => {
|
|
|
951
906
|
children: "CLOSE"
|
|
952
907
|
}),
|
|
953
908
|
/* @__PURE__ */ jsx("span", {
|
|
954
|
-
class:
|
|
909
|
+
class: "footer-cross-icon",
|
|
955
910
|
children: /* @__PURE__ */ jsx(ElmMdiIcon, {
|
|
956
911
|
d: mdiPlus,
|
|
957
912
|
color: "#c56565"
|
|
958
913
|
})
|
|
959
914
|
}),
|
|
960
915
|
/* @__PURE__ */ jsx("hr", {
|
|
961
|
-
class:
|
|
916
|
+
class: "footer-line"
|
|
962
917
|
}),
|
|
963
918
|
/* @__PURE__ */ jsx("span", {
|
|
964
|
-
class:
|
|
919
|
+
class: "footer-chevron-icon",
|
|
965
920
|
children: /* @__PURE__ */ jsx(ElmMdiIcon, {
|
|
966
921
|
d: mdiChevronRight,
|
|
967
922
|
color: "gray"
|
|
@@ -972,50 +927,44 @@ const ElmToggle = component$(({ summary: summary2 }) => {
|
|
|
972
927
|
]
|
|
973
928
|
});
|
|
974
929
|
});
|
|
975
|
-
const styles$g = {
|
|
976
|
-
|
|
977
|
-
};
|
|
978
|
-
const wrapper = "_wrapper_1yktj_12";
|
|
979
|
-
const dot = "_dot_1yktj_22";
|
|
980
|
-
const styles$f = {
|
|
981
|
-
wrapper,
|
|
982
|
-
dot
|
|
983
|
-
};
|
|
930
|
+
const styles$g = ".block-fallback {\n position: relative;\n display: flex;\n justify-content: center;\n align-items: center;\n width: 100%;\n height: var(--height);\n}";
|
|
931
|
+
const styles$f = "@keyframes bounce {\n 0% {\n transform: translateY(0%) scaleY(0.3) scaleX(1.5);\n }\n 10% {\n transform: scaleY(0.8) scaleX(1.2);\n }\n 100% {\n transform: translateY(-400%) scaleY(1.1);\n }\n}\n.wrapper {\n width: var(--size);\n height: var(--size);\n user-select: none;\n position: relative;\n display: flex;\n justify-content: space-around;\n align-items: flex-end;\n}\n\n.dot {\n width: 20%;\n height: 20%;\n border-radius: 50%;\n animation-name: bounce;\n animation-duration: 0.4s;\n animation-iteration-count: infinite;\n animation-direction: alternate;\n animation-timing-function: ease-out;\n transition: background-color 400ms;\n background-color: var(--color, #606875);\n}\n[data-theme=dark] .dot {\n background-color: #b0b5be;\n}\n.dot:nth-last-of-type(1) {\n animation-delay: -100ms;\n}\n.dot:nth-last-of-type(2) {\n animation-delay: 0ms;\n}\n.dot:nth-last-of-type(3) {\n animation-delay: 100ms;\n}";
|
|
984
932
|
const ElmDotLoadingIcon = component$(({ size = "4em", color = "#606875" }) => {
|
|
933
|
+
useStylesScoped$(styles$f);
|
|
985
934
|
return /* @__PURE__ */ jsxs("div", {
|
|
986
|
-
class:
|
|
935
|
+
class: "wrapper",
|
|
987
936
|
style: {
|
|
988
937
|
"--size": size,
|
|
989
938
|
"--color": color
|
|
990
939
|
},
|
|
991
940
|
children: [
|
|
992
941
|
/* @__PURE__ */ jsx("div", {
|
|
993
|
-
class:
|
|
942
|
+
class: "dot",
|
|
994
943
|
"aria-hidden": "true"
|
|
995
944
|
}),
|
|
996
945
|
/* @__PURE__ */ jsx("div", {
|
|
997
|
-
class:
|
|
946
|
+
class: "dot",
|
|
998
947
|
"aria-hidden": "true"
|
|
999
948
|
}),
|
|
1000
949
|
/* @__PURE__ */ jsx("div", {
|
|
1001
|
-
class:
|
|
950
|
+
class: "dot",
|
|
1002
951
|
"aria-hidden": "true"
|
|
1003
952
|
})
|
|
1004
953
|
]
|
|
1005
954
|
});
|
|
1006
955
|
});
|
|
1007
|
-
const styles$e = {
|
|
1008
|
-
"rectangle-wave": "_rectangle-wave_hej9g_17"
|
|
1009
|
-
};
|
|
956
|
+
const styles$e = "@keyframes elm-rectangle-wave {\n 0% {\n transform: scale(0);\n opacity: 0;\n }\n 30% {\n opacity: 0;\n }\n 40% {\n opacity: 1;\n }\n 100% {\n transform: scale(1);\n opacity: 0;\n }\n}\n.rectangle-wave {\n box-sizing: border-box;\n position: absolute;\n overflow: hidden;\n margin: 0;\n width: 100%;\n height: 100%;\n animation-name: elm-rectangle-wave;\n animation-duration: 1200ms;\n animation-iteration-count: infinite;\n animation-fill-mode: both;\n border-style: solid;\n border-width: 1px;\n border-color: rgba(0, 0, 0, 0.7);\n}\n[data-theme=dark] .rectangle-wave {\n border-color: rgba(255, 255, 255, 0.7);\n}";
|
|
1010
957
|
const ElmRectangleWave = component$(() => {
|
|
958
|
+
useStylesScoped$(styles$e);
|
|
1011
959
|
return /* @__PURE__ */ jsx("div", {
|
|
1012
960
|
"aria-hidden": "true",
|
|
1013
|
-
class:
|
|
961
|
+
class: "rectangle-wave"
|
|
1014
962
|
});
|
|
1015
963
|
});
|
|
1016
964
|
const ElmBlockFallback = component$(({ height = "16rem" }) => {
|
|
965
|
+
useStylesScoped$(styles$g);
|
|
1017
966
|
return /* @__PURE__ */ jsxs("div", {
|
|
1018
|
-
class:
|
|
967
|
+
class: "block-fallback",
|
|
1019
968
|
style: {
|
|
1020
969
|
"--height": height
|
|
1021
970
|
},
|
|
@@ -1025,17 +974,9 @@ const ElmBlockFallback = component$(({ height = "16rem" }) => {
|
|
|
1025
974
|
]
|
|
1026
975
|
});
|
|
1027
976
|
});
|
|
1028
|
-
const
|
|
1029
|
-
const
|
|
1030
|
-
|
|
1031
|
-
"block-image": "_block-image_zq5gl_1",
|
|
1032
|
-
"image-container": "_image-container_zq5gl_11",
|
|
1033
|
-
image: image$1,
|
|
1034
|
-
fallback,
|
|
1035
|
-
"caption-box": "_caption-box_zq5gl_41",
|
|
1036
|
-
"modal-container": "_modal-container_zq5gl_53"
|
|
1037
|
-
};
|
|
1038
|
-
const ElmBlockImage = component$(({ src, alt, caption: caption2, width, height, enableModal = true }) => {
|
|
977
|
+
const styles$d = ".block-image {\n margin: 0;\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n gap: 0.5rem;\n width: 100%;\n}\n\n.image-container {\n width: 100%;\n height: 100%;\n position: relative;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.image {\n max-width: 100%;\n max-height: 100%;\n border-radius: 0.25rem;\n box-shadow: 0 0 0.125rem rgba(0, 0, 0, 0.1);\n transition: opacity 400ms;\n opacity: var(--opacity, 1);\n user-select: none;\n cursor: var(--cursor);\n}\n\n.fallback {\n width: 100%;\n height: 100%;\n inset: 0 0 auto auto;\n position: absolute;\n transition: opacity 400ms;\n opacity: var(--opacity, 1);\n pointer-events: none;\n}\n\n.caption-box {\n box-sizing: border-box;\n padding: 0rem 1rem;\n display: flex;\n justify-content: center;\n align-items: center;\n gap: 1rem;\n opacity: 0.75;\n opacity: var(--opacity, 1);\n transition: opacity 400ms;\n}\n\n.modal-container {\n width: 100vw;\n height: 100vh;\n display: flex;\n justify-content: center;\n align-items: center;\n position: fixed;\n inset: 0 0 auto auto;\n z-index: 100;\n background-color: rgba(35, 38, 42, 0.8);\n cursor: zoom-out;\n opacity: var(--opacity, 1);\n transition: opacity 200ms;\n}";
|
|
978
|
+
const ElmBlockImage = component$(({ src, alt, caption, width, height, enableModal = true }) => {
|
|
979
|
+
useStylesScoped$(styles$d);
|
|
1039
980
|
const isLoading = useSignal(true);
|
|
1040
981
|
const isShowModal = useSignal(false);
|
|
1041
982
|
const handleImageLoad = $(() => {
|
|
@@ -1048,10 +989,10 @@ const ElmBlockImage = component$(({ src, alt, caption: caption2, width, height,
|
|
|
1048
989
|
});
|
|
1049
990
|
const ImageComponent = /* @__PURE__ */ jsx("img", {
|
|
1050
991
|
class: [
|
|
1051
|
-
|
|
992
|
+
"image"
|
|
1052
993
|
],
|
|
1053
994
|
src,
|
|
1054
|
-
alt: alt ??
|
|
995
|
+
alt: alt ?? caption ?? "Image",
|
|
1055
996
|
width,
|
|
1056
997
|
height,
|
|
1057
998
|
onLoad$: handleImageLoad,
|
|
@@ -1061,7 +1002,7 @@ const ElmBlockImage = component$(({ src, alt, caption: caption2, width, height,
|
|
|
1061
1002
|
}
|
|
1062
1003
|
});
|
|
1063
1004
|
const Modal = /* @__PURE__ */ jsx("div", {
|
|
1064
|
-
class:
|
|
1005
|
+
class: "modal-container",
|
|
1065
1006
|
style: {
|
|
1066
1007
|
pointerEvents: isShowModal.value ? "auto" : "none",
|
|
1067
1008
|
"--opacity": isShowModal.value ? 1 : 0
|
|
@@ -1070,10 +1011,10 @@ const ElmBlockImage = component$(({ src, alt, caption: caption2, width, height,
|
|
|
1070
1011
|
children: ImageComponent
|
|
1071
1012
|
});
|
|
1072
1013
|
return /* @__PURE__ */ jsxs("figure", {
|
|
1073
|
-
class:
|
|
1014
|
+
class: "block-image",
|
|
1074
1015
|
children: [
|
|
1075
1016
|
/* @__PURE__ */ jsxs("div", {
|
|
1076
|
-
class:
|
|
1017
|
+
class: "image-container",
|
|
1077
1018
|
style: {
|
|
1078
1019
|
"--opacity": isLoading.value ? 1 : 0
|
|
1079
1020
|
},
|
|
@@ -1081,13 +1022,13 @@ const ElmBlockImage = component$(({ src, alt, caption: caption2, width, height,
|
|
|
1081
1022
|
children: [
|
|
1082
1023
|
ImageComponent,
|
|
1083
1024
|
/* @__PURE__ */ jsx("div", {
|
|
1084
|
-
class:
|
|
1025
|
+
class: "fallback",
|
|
1085
1026
|
children: /* @__PURE__ */ jsx(ElmRectangleWave, {})
|
|
1086
1027
|
})
|
|
1087
1028
|
]
|
|
1088
1029
|
}),
|
|
1089
|
-
|
|
1090
|
-
class:
|
|
1030
|
+
caption && /* @__PURE__ */ jsxs("figcaption", {
|
|
1031
|
+
class: "caption-box",
|
|
1091
1032
|
style: {
|
|
1092
1033
|
"--opacity": isLoading.value ? 0 : 1
|
|
1093
1034
|
},
|
|
@@ -1104,7 +1045,7 @@ const ElmBlockImage = component$(({ src, alt, caption: caption2, width, height,
|
|
|
1104
1045
|
}),
|
|
1105
1046
|
/* @__PURE__ */ jsx(ElmInlineText, {
|
|
1106
1047
|
size: "1rem",
|
|
1107
|
-
children:
|
|
1048
|
+
children: caption
|
|
1108
1049
|
})
|
|
1109
1050
|
]
|
|
1110
1051
|
}),
|
|
@@ -1112,36 +1053,32 @@ const ElmBlockImage = component$(({ src, alt, caption: caption2, width, height,
|
|
|
1112
1053
|
]
|
|
1113
1054
|
});
|
|
1114
1055
|
});
|
|
1115
|
-
const file = "
|
|
1116
|
-
const styles$c = {
|
|
1117
|
-
file,
|
|
1118
|
-
"file-size": "_file-size_14a0w_16",
|
|
1119
|
-
"download-icon": "_download-icon_14a0w_21"
|
|
1120
|
-
};
|
|
1056
|
+
const styles$c = ".file {\n margin: 0;\n padding: 1rem;\n display: grid;\n grid-template-columns: 1.5rem 1fr 1fr 1.5rem;\n gap: 1rem;\n align-items: center;\n box-shadow: 0 0 0.125rem rgba(0, 0, 0, 0.2);\n border-radius: 0.25rem;\n background-color: rgba(255, 255, 255, 0.2);\n}\n[data-theme=dark] .file {\n background-color: rgba(0, 0, 0, 0.2);\n}\n\n.file-size {\n text-align: right;\n opacity: 0.5;\n}\n\n.download-icon {\n display: flex;\n justify-content: center;\n align-items: center;\n height: 1.5rem;\n width: 1.5rem;\n padding: 0.125rem;\n border-radius: 0.125rem;\n cursor: pointer;\n transition: color 200ms, background-color 200ms;\n}\n.download-icon:hover {\n background-color: rgba(0, 0, 0, 0.1);\n}\n[data-theme=dark] .download-icon:hover {\n background-color: rgba(255, 255, 255, 0.1);\n}";
|
|
1121
1057
|
function getLastPathSegmentWithoutQueryOrHash(urlString) {
|
|
1122
1058
|
const cleanedUrl = urlString.split(/[?#]/)[0];
|
|
1123
1059
|
const pathSegments = cleanedUrl.split("/").filter(Boolean);
|
|
1124
1060
|
return pathSegments.length > 0 ? pathSegments[pathSegments.length - 1] : null;
|
|
1125
1061
|
}
|
|
1126
1062
|
const ElmFile = component$(({ name, src, filesize }) => {
|
|
1063
|
+
useStylesScoped$(styles$c);
|
|
1127
1064
|
const downloadFile = $(async () => {
|
|
1128
|
-
let
|
|
1065
|
+
let link;
|
|
1129
1066
|
try {
|
|
1130
1067
|
const response = await fetch(src);
|
|
1131
1068
|
if (!response.ok) throw new Error("Failed to download file");
|
|
1132
1069
|
const blob = await response.blob();
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1070
|
+
link = document.createElement("a");
|
|
1071
|
+
link.href = URL.createObjectURL(blob);
|
|
1072
|
+
link.download = name ?? getLastPathSegmentWithoutQueryOrHash(src) ?? "file";
|
|
1073
|
+
link.click();
|
|
1137
1074
|
} catch (error) {
|
|
1138
1075
|
console.error("ERROR:", error);
|
|
1139
1076
|
} finally {
|
|
1140
|
-
if (
|
|
1077
|
+
if (link) URL.revokeObjectURL(link.href);
|
|
1141
1078
|
}
|
|
1142
1079
|
});
|
|
1143
1080
|
return /* @__PURE__ */ jsxs("div", {
|
|
1144
|
-
class:
|
|
1081
|
+
class: "file",
|
|
1145
1082
|
children: [
|
|
1146
1083
|
/* @__PURE__ */ jsx("div", {
|
|
1147
1084
|
children: /* @__PURE__ */ jsx(ElmMdiIcon, {
|
|
@@ -1155,13 +1092,13 @@ const ElmFile = component$(({ name, src, filesize }) => {
|
|
|
1155
1092
|
})
|
|
1156
1093
|
}),
|
|
1157
1094
|
/* @__PURE__ */ jsx("div", {
|
|
1158
|
-
class:
|
|
1095
|
+
class: "file-size",
|
|
1159
1096
|
children: /* @__PURE__ */ jsx(ElmInlineText, {
|
|
1160
1097
|
children: filesize
|
|
1161
1098
|
})
|
|
1162
1099
|
}),
|
|
1163
1100
|
/* @__PURE__ */ jsx("div", {
|
|
1164
|
-
class:
|
|
1101
|
+
class: "download-icon",
|
|
1165
1102
|
onClick$: downloadFile,
|
|
1166
1103
|
children: /* @__PURE__ */ jsx(ElmMdiIcon, {
|
|
1167
1104
|
d: mdiDownload,
|
|
@@ -1171,55 +1108,41 @@ const ElmFile = component$(({ name, src, filesize }) => {
|
|
|
1171
1108
|
]
|
|
1172
1109
|
});
|
|
1173
1110
|
});
|
|
1174
|
-
const bookmark = "
|
|
1175
|
-
const
|
|
1176
|
-
|
|
1177
|
-
const content$1 = "_content_rgq1s_53";
|
|
1178
|
-
const title = "_title_rgq1s_73";
|
|
1179
|
-
const description = "_description_rgq1s_76";
|
|
1180
|
-
const link = "_link_rgq1s_80";
|
|
1181
|
-
const styles$b = {
|
|
1182
|
-
bookmark,
|
|
1183
|
-
container,
|
|
1184
|
-
image,
|
|
1185
|
-
content: content$1,
|
|
1186
|
-
title,
|
|
1187
|
-
description,
|
|
1188
|
-
link
|
|
1189
|
-
};
|
|
1190
|
-
const ElmBookmark = component$(({ url, image: image2, title: title2, description: description2, favicon }) => {
|
|
1111
|
+
const styles$b = ".bookmark {\n all: unset;\n display: block;\n container-type: inline-size;\n border-radius: 0.25rem;\n box-shadow: 0 0 0.125rem rgba(0, 0, 0, 0.1);\n overflow: hidden;\n transition: background-color 200ms, transform 200ms;\n}\n.bookmark:hover {\n background-color: rgba(105, 135, 184, 0.1);\n transform: translateX(-0.125rem) translateY(-0.125rem);\n}\n.bookmark:active {\n background-color: rgba(89, 181, 124, 0.1);\n transform: translateX(0) translateY(0);\n}\n\n.container {\n all: unset;\n cursor: pointer;\n width: 100%;\n display: flex;\n flex-direction: row;\n}\n@container (max-width: 700px) {\n .container {\n flex-direction: column;\n }\n}\n\n.image {\n overflow: hidden;\n height: 100%;\n opacity: 0.9;\n display: flex;\n justify-content: center;\n align-items: center;\n object-fit: cover;\n object-position: center;\n aspect-ratio: 2/1;\n width: min-content;\n max-width: 35%;\n}\n@container (max-width: 700px) {\n .image {\n min-width: unset;\n max-width: unset;\n width: 100%;\n }\n}\n\n.content {\n flex: 1;\n width: 75%;\n box-sizing: border-box;\n padding: 0.5rem;\n display: flex;\n flex-direction: column;\n gap: 0.5rem;\n justify-content: space-between;\n transition: background-color 200ms;\n background-color: rgba(255, 255, 255, 0.4);\n}\n@container (max-width: 700px) {\n .content {\n width: 100%;\n }\n}\n[data-theme=dark] .content {\n background-color: rgba(0, 0, 0, 0.2);\n}\n.content .title {\n box-sizing: border-box;\n}\n.content .description {\n box-sizing: border-box;\n opacity: 0.7;\n}\n.content .link {\n line-height: 0.75rem;\n display: flex;\n justify-content: flex-end;\n align-items: center;\n gap: 0.25rem;\n opacity: 0.7;\n}";
|
|
1112
|
+
const ElmBookmark = component$(({ url, image, title, description, favicon }) => {
|
|
1113
|
+
useStylesScoped$(styles$b);
|
|
1191
1114
|
return /* @__PURE__ */ jsx("div", {
|
|
1192
|
-
class:
|
|
1115
|
+
class: "bookmark",
|
|
1193
1116
|
children: /* @__PURE__ */ jsxs("a", {
|
|
1194
|
-
class:
|
|
1117
|
+
class: "container",
|
|
1195
1118
|
href: url,
|
|
1196
1119
|
target: "_blank",
|
|
1197
1120
|
rel: "noopener noreferrer",
|
|
1198
1121
|
children: [
|
|
1199
1122
|
/* @__PURE__ */ jsx("img", {
|
|
1200
|
-
class:
|
|
1201
|
-
src:
|
|
1123
|
+
class: "image",
|
|
1124
|
+
src: image,
|
|
1202
1125
|
alt: "OGP Image"
|
|
1203
1126
|
}),
|
|
1204
1127
|
/* @__PURE__ */ jsxs("div", {
|
|
1205
|
-
class:
|
|
1128
|
+
class: "content",
|
|
1206
1129
|
children: [
|
|
1207
1130
|
/* @__PURE__ */ jsx("div", {
|
|
1208
|
-
class:
|
|
1131
|
+
class: "title",
|
|
1209
1132
|
children: /* @__PURE__ */ jsx(ElmInlineText, {
|
|
1210
1133
|
bold: true,
|
|
1211
|
-
children:
|
|
1134
|
+
children: title
|
|
1212
1135
|
})
|
|
1213
1136
|
}),
|
|
1214
1137
|
/* @__PURE__ */ jsx("div", {
|
|
1215
|
-
class:
|
|
1138
|
+
class: "description",
|
|
1216
1139
|
children: /* @__PURE__ */ jsx(ElmInlineText, {
|
|
1217
1140
|
size: "0.75rem",
|
|
1218
|
-
children:
|
|
1141
|
+
children: description
|
|
1219
1142
|
})
|
|
1220
1143
|
}),
|
|
1221
1144
|
/* @__PURE__ */ jsxs("div", {
|
|
1222
|
-
class:
|
|
1145
|
+
class: "link",
|
|
1223
1146
|
children: [
|
|
1224
1147
|
favicon ? /* @__PURE__ */ jsx(ElmInlineIcon, {
|
|
1225
1148
|
src: favicon
|
|
@@ -1239,24 +1162,19 @@ const ElmBookmark = component$(({ url, image: image2, title: title2, description
|
|
|
1239
1162
|
})
|
|
1240
1163
|
});
|
|
1241
1164
|
});
|
|
1242
|
-
const
|
|
1243
|
-
const body = "_body_b5jd8_18";
|
|
1244
|
-
const icon = "_icon_b5jd8_23";
|
|
1245
|
-
const styles$a = {
|
|
1246
|
-
blockquote,
|
|
1247
|
-
body,
|
|
1248
|
-
icon
|
|
1249
|
-
};
|
|
1165
|
+
const styles$a = '.blockquote {\n box-sizing: border-box;\n width: 100%;\n margin: 0;\n background-color: rgba(134, 142, 156, 0.1);\n position: relative;\n}\n.blockquote::after {\n position: absolute;\n content: "";\n top: 0;\n left: 0;\n width: 4px;\n height: 100%;\n background-color: #868e9c;\n}\n\n.body {\n box-sizing: border-box;\n padding: 2rem 1.5rem;\n}\n\n.icon {\n position: absolute;\n content: "";\n inset: var(--inset);\n opacity: 0.5;\n}';
|
|
1250
1166
|
const ElmBlockQuote = component$(({ cite }) => {
|
|
1167
|
+
useStylesScoped$(styles$a);
|
|
1168
|
+
useStylesScoped$(textStyles);
|
|
1251
1169
|
return /* @__PURE__ */ jsxs("blockquote", {
|
|
1252
1170
|
class: [
|
|
1253
|
-
|
|
1254
|
-
|
|
1171
|
+
"blockquote",
|
|
1172
|
+
"text"
|
|
1255
1173
|
],
|
|
1256
1174
|
cite,
|
|
1257
1175
|
children: [
|
|
1258
1176
|
/* @__PURE__ */ jsx("div", {
|
|
1259
|
-
class:
|
|
1177
|
+
class: "icon",
|
|
1260
1178
|
style: {
|
|
1261
1179
|
"--inset": "0.25rem auto auto 0.5rem"
|
|
1262
1180
|
},
|
|
@@ -1265,13 +1183,11 @@ const ElmBlockQuote = component$(({ cite }) => {
|
|
|
1265
1183
|
})
|
|
1266
1184
|
}),
|
|
1267
1185
|
/* @__PURE__ */ jsx("div", {
|
|
1268
|
-
class:
|
|
1269
|
-
styles$a.body
|
|
1270
|
-
],
|
|
1186
|
+
class: "body",
|
|
1271
1187
|
children: /* @__PURE__ */ jsx(Slot, {})
|
|
1272
1188
|
}),
|
|
1273
1189
|
/* @__PURE__ */ jsx("div", {
|
|
1274
|
-
class:
|
|
1190
|
+
class: "icon",
|
|
1275
1191
|
style: {
|
|
1276
1192
|
"--inset": "auto 0.25rem 0.25rem auto"
|
|
1277
1193
|
},
|
|
@@ -1282,14 +1198,7 @@ const ElmBlockQuote = component$(({ cite }) => {
|
|
|
1282
1198
|
]
|
|
1283
1199
|
});
|
|
1284
1200
|
});
|
|
1285
|
-
const
|
|
1286
|
-
const header = "_header_1d8l2_25";
|
|
1287
|
-
const content = "_content_1d8l2_31";
|
|
1288
|
-
const styles$9 = {
|
|
1289
|
-
callout,
|
|
1290
|
-
header,
|
|
1291
|
-
content
|
|
1292
|
-
};
|
|
1201
|
+
const styles$9 = '.callout {\n position: relative;\n padding: 1rem;\n}\n.callout::after {\n position: absolute;\n content: "";\n inset: 0 auto auto 0;\n height: 100%;\n width: 0.25rem;\n background-color: var(--callout-color);\n}\n.callout::before {\n position: absolute;\n content: "";\n inset: 0 0 auto auto;\n height: 100%;\n width: 100%;\n background-color: var(--callout-color);\n opacity: 0.15;\n z-index: -1;\n pointer-events: none;\n}\n\n.header {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n}\n\n.content {\n padding-block-start: 1rem;\n padding-block-end: 0.25rem;\n}';
|
|
1293
1202
|
const COLOR_MAP = Object.freeze({
|
|
1294
1203
|
note: {
|
|
1295
1204
|
code: "#6987b8",
|
|
@@ -1313,14 +1222,15 @@ const COLOR_MAP = Object.freeze({
|
|
|
1313
1222
|
}
|
|
1314
1223
|
});
|
|
1315
1224
|
const ElmCallout = component$(({ type = "note" }) => {
|
|
1225
|
+
useStylesScoped$(styles$9);
|
|
1316
1226
|
return /* @__PURE__ */ jsxs("aside", {
|
|
1317
|
-
class:
|
|
1227
|
+
class: "callout",
|
|
1318
1228
|
style: {
|
|
1319
1229
|
"--callout-color": COLOR_MAP[type].code
|
|
1320
1230
|
},
|
|
1321
1231
|
children: [
|
|
1322
1232
|
/* @__PURE__ */ jsxs("div", {
|
|
1323
|
-
class:
|
|
1233
|
+
class: "header",
|
|
1324
1234
|
children: [
|
|
1325
1235
|
/* @__PURE__ */ jsx(ElmMdiIcon, {
|
|
1326
1236
|
d: COLOR_MAP[type].icon,
|
|
@@ -1333,29 +1243,25 @@ const ElmCallout = component$(({ type = "note" }) => {
|
|
|
1333
1243
|
]
|
|
1334
1244
|
}),
|
|
1335
1245
|
/* @__PURE__ */ jsx("div", {
|
|
1336
|
-
class:
|
|
1246
|
+
class: "content",
|
|
1337
1247
|
children: /* @__PURE__ */ jsx(Slot, {})
|
|
1338
1248
|
})
|
|
1339
1249
|
]
|
|
1340
1250
|
});
|
|
1341
1251
|
});
|
|
1342
|
-
const
|
|
1343
|
-
const styles$8 = {
|
|
1344
|
-
hr
|
|
1345
|
-
};
|
|
1252
|
+
const styles$8 = ".hr {\n margin: 0;\n width: 100%;\n border: none;\n border-bottom: dashed 1px #868e9c;\n}";
|
|
1346
1253
|
const ElmDivider = component$(({ margin }) => {
|
|
1254
|
+
useStylesScoped$(styles$8);
|
|
1347
1255
|
return /* @__PURE__ */ jsx("hr", {
|
|
1348
|
-
class:
|
|
1256
|
+
class: "hr",
|
|
1349
1257
|
style: {
|
|
1350
1258
|
marginBlock: margin
|
|
1351
1259
|
}
|
|
1352
1260
|
});
|
|
1353
1261
|
});
|
|
1354
|
-
const
|
|
1355
|
-
const styles$7 = {
|
|
1356
|
-
fragment
|
|
1357
|
-
};
|
|
1262
|
+
const styles$7 = ".fragment {\n font-size: 1rem;\n width: 1rem;\n height: 1rem;\n padding: 0.125rem;\n margin-inline-start: 0.5rem;\n border-radius: 0.125rem;\n display: inline-flex;\n justify-content: center;\n align-items: center;\n color: #b69545;\n cursor: pointer;\n user-select: none;\n opacity: 1;\n transition: background-color 200ms, opacity 100ms, transform 100ms;\n}\n.fragment:hover {\n background-color: rgba(134, 142, 156, 0.2);\n}\n.fragment:active {\n opacity: 0.5;\n transform: translateX(1px) translateY(1px);\n}";
|
|
1358
1263
|
const ElmFragmentIdentifier = component$(({ id }) => {
|
|
1264
|
+
useStylesScoped$(styles$7);
|
|
1359
1265
|
const handleHashClick = $((id2) => {
|
|
1360
1266
|
const url = new URL(window.location.href);
|
|
1361
1267
|
url.hash = id2;
|
|
@@ -1368,26 +1274,12 @@ const ElmFragmentIdentifier = component$(({ id }) => {
|
|
|
1368
1274
|
}
|
|
1369
1275
|
});
|
|
1370
1276
|
return /* @__PURE__ */ jsx("span", {
|
|
1371
|
-
class:
|
|
1277
|
+
class: "fragment",
|
|
1372
1278
|
onClick$: () => handleHashClick(id),
|
|
1373
1279
|
children: "#"
|
|
1374
1280
|
});
|
|
1375
1281
|
});
|
|
1376
|
-
const h1 = "
|
|
1377
|
-
const h2 = "_h2_1mgdk_40";
|
|
1378
|
-
const h3 = "_h3_1mgdk_75";
|
|
1379
|
-
const h4 = "_h4_1mgdk_92";
|
|
1380
|
-
const h5 = "_h5_1mgdk_96";
|
|
1381
|
-
const h6 = "_h6_1mgdk_100";
|
|
1382
|
-
const styles$6 = {
|
|
1383
|
-
"heading-common": "_heading-common_1mgdk_1",
|
|
1384
|
-
h1,
|
|
1385
|
-
h2,
|
|
1386
|
-
h3,
|
|
1387
|
-
h4,
|
|
1388
|
-
h5,
|
|
1389
|
-
h6
|
|
1390
|
-
};
|
|
1282
|
+
const styles$6 = '.heading-common {\n margin: 0;\n position: relative;\n font-size: var(--font-size);\n line-height: var(--font-size);\n opacity: var(--opacity);\n transition: color 400ms, opacity 800ms;\n}\n\n.h1::after {\n position: absolute;\n content: "";\n bottom: -4px;\n left: 0;\n width: 100%;\n height: 0.25px;\n background-color: rgba(0, 0, 0, 0.5);\n transition: transform 800ms;\n transform: scaleX(var(--scale));\n}\n[data-theme=dark] .h1::after {\n background-color: rgba(255, 255, 255, 0.5);\n}\n.h1::before {\n position: absolute;\n content: "";\n bottom: -6px;\n left: 45%;\n width: 10%;\n height: 2px;\n background-color: rgba(0, 0, 0, 0.6);\n transition: transform 800ms;\n transform: scaleY(var(--scale));\n transform-origin: top;\n}\n[data-theme=dark] .h1::before {\n background-color: rgba(255, 255, 255, 0.6);\n}\n\n.h2 {\n border-bottom: solid 1px rgba(0, 0, 0, 0.5);\n}\n[data-theme=dark] .h2 {\n border-color: rgba(255, 255, 255, 0.5);\n}\n.h2::after {\n position: absolute;\n content: "";\n right: 2px;\n bottom: -4px;\n width: 6px;\n height: 8px;\n opacity: 0.8;\n transform: skewX(-25deg);\n background-color: rgba(0, 0, 0, 0.8);\n}\n[data-theme=dark] .h2::after {\n background-color: rgba(255, 255, 255, 0.8);\n}\n.h2::before {\n position: absolute;\n content: "";\n right: 10px;\n bottom: -4px;\n width: 6px;\n height: 8px;\n opacity: 0.8;\n transform: skewX(-25deg);\n background-color: rgba(0, 0, 0, 0.8);\n}\n[data-theme=dark] .h2::before {\n background-color: rgba(255, 255, 255, 0.8);\n}\n\n.h3 {\n box-sizing: border-box;\n padding-left: 0.75rem;\n}\n.h3::after {\n position: absolute;\n content: "";\n width: 3px;\n height: 12px;\n top: calc(50% - 8px);\n left: 0;\n background-color: rgba(0, 0, 0, 0.5);\n}\n[data-theme=dark] .h3::after {\n background-color: rgba(255, 255, 255, 0.5);\n}\n\n.h4 {\n position: relative;\n}\n\n.h5 {\n position: relative;\n}\n\n.h6 {\n position: relative;\n}';
|
|
1391
1283
|
const SIZE_MAP = Object.freeze({
|
|
1392
1284
|
1: 1.5,
|
|
1393
1285
|
2: 1.4,
|
|
@@ -1396,19 +1288,21 @@ const SIZE_MAP = Object.freeze({
|
|
|
1396
1288
|
5: 1.15,
|
|
1397
1289
|
6: 1.1
|
|
1398
1290
|
});
|
|
1399
|
-
const ElmHeading = component$(({ level, text
|
|
1291
|
+
const ElmHeading = component$(({ level, text, id }) => {
|
|
1292
|
+
useStylesScoped$(styles$6);
|
|
1293
|
+
useStylesScoped$(textStyles);
|
|
1400
1294
|
const Tag = `h${level}`;
|
|
1401
1295
|
return /* @__PURE__ */ jsxs(Tag, {
|
|
1402
1296
|
class: [
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1297
|
+
"heading-common",
|
|
1298
|
+
"text",
|
|
1299
|
+
`h${level}`
|
|
1406
1300
|
],
|
|
1407
1301
|
style: {
|
|
1408
1302
|
"--font-size": `${SIZE_MAP[level]}em`
|
|
1409
1303
|
},
|
|
1410
1304
|
children: [
|
|
1411
|
-
|
|
1305
|
+
text,
|
|
1412
1306
|
/* @__PURE__ */ jsx(Slot, {}),
|
|
1413
1307
|
id && /* @__PURE__ */ jsx("span", {
|
|
1414
1308
|
style: {
|
|
@@ -1421,11 +1315,14 @@ const ElmHeading = component$(({ level, text: text2, id }) => {
|
|
|
1421
1315
|
]
|
|
1422
1316
|
});
|
|
1423
1317
|
});
|
|
1318
|
+
const listStyles = '.elmethis-list-common {\n margin-block: 1rem;\n opacity: var(--opacity);\n transition: opacity 800ms;\n box-sizing: border-box;\n padding-left: 1.25rem;\n}\n\n.elmethis-bulleted-list li {\n box-sizing: border-box;\n padding-left: 0.5rem;\n margin-block: 0.75rem;\n}\n.elmethis-bulleted-list li::marker {\n content: url("data:image/svg+xml;base64,ICA8c3ZnCiAgICB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnCiAgICB2aWV3Qm94PScwIDAgMTYgMTYnCiAgICB3aWR0aD0nMTJweCcKICAgIGhlaWdodD0nMTJweCcKICA+CiAgICA8cGF0aAogICAgICBmaWxsPScjNDQ5NzYzJwogICAgICBvcGFjaXR5PScwLjgnCiAgICAgIGQ9J00zIDMuNzMyYTEuNSAxLjUgMCAwIDEgMi4zMDUtMS4yNjVsNi43MDYgNC4yNjdhMS41IDEuNSAwIDAgMSAwIDIuNTMxbC02LjcwNiA0LjI2OEExLjUgMS41IDAgMCAxIDMgMTIuMjY3VjMuNzMyWicKICAgIC8+CiAgPC9zdmc+");\n}\n.elmethis-bulleted-list li ul li::marker {\n content: url("data:image/svg+xml;base64,ICA8c3ZnCiAgICB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnCiAgICB2aWV3Qm94PScwIDAgMjQgMjQnCiAgICB3aWR0aD0nMTJweCcKICAgIGhlaWdodD0nMTJweCcKICAgIHN0cm9rZT0nIzQ0OTc2MycKICAgIGZpbGw9J3RyYW5zcGFyZW50JwogID4KICAgIDxwYXRoCiAgICAgIHN0cm9rZUxpbmVjYXA9J3JvdW5kJwogICAgICBzdHJva2VMaW5lam9pbj0ncm91bmQnCiAgICAgIGQ9J001LjI1IDUuNjUzYzAtLjg1Ni45MTctMS4zOTggMS42NjctLjk4NmwxMS41NCA2LjM0N2ExLjEyNSAxLjEyNSAwIDAgMSAwIDEuOTcybC0xMS41NCA2LjM0N2ExLjEyNSAxLjEyNSAwIDAgMS0xLjY2Ny0uOTg2VjUuNjUzWicKICAgIC8+CiAgPC9zdmc+");\n}\n.elmethis-bulleted-list li ul li ul li::marker {\n content: url("data:image/svg+xml;base64,ICA8c3ZnCiAgICB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnCiAgICB2aWV3Qm94PScwIDAgMjAgMjAnCiAgICB3aWR0aD0nMTJweCcKICAgIGhlaWdodD0nMTJweCcKICAgIHN0cm9rZT0nIzQ0OTc2MycKICAgIGZpbGw9JyM0NDk3NjMnCiAgPgogICAgPHBhdGgKICAgICAgZmlsbFJ1bGU9J2V2ZW5vZGQnCiAgICAgIGQ9J004LjIyIDUuMjJhLjc1Ljc1IDAgMCAxIDEuMDYgMGw0LjI1IDQuMjVhLjc1Ljc1IDAgMCAxIDAgMS4wNmwtNC4yNSA0LjI1YS43NS43NSAwIDAgMS0xLjA2LTEuMDZMMTEuOTQgMTAgOC4yMiA2LjI4YS43NS43NSAwIDAgMSAwLTEuMDZaJwogICAgICBjbGlwUnVsZT0nZXZlbm9kZCcKICAgIC8+CiAgPC9zdmc+");\n}\n\n.elmethis-numbered-list li {\n box-sizing: border-box;\n padding-left: 0.25rem;\n margin-block: 0.75rem;\n margin-left: 0.25rem;\n list-style-type: decimal;\n}\n.elmethis-numbered-list li::marker {\n font-weight: bold;\n color: #9771bd;\n}\n.elmethis-numbered-list li ol li {\n list-style-type: lower-alpha;\n}\n.elmethis-numbered-list li ol li ol li {\n list-style-type: lower-roman;\n}\n.elmethis-numbered-list li ol li ol li ol li {\n list-style-type: lower-greek;\n}';
|
|
1424
1319
|
const ElmList = component$(({ listStyle = "unordered" }) => {
|
|
1320
|
+
useStyles$(listStyles);
|
|
1321
|
+
useStylesScoped$(textStyles);
|
|
1425
1322
|
if (listStyle === "ordered") {
|
|
1426
1323
|
return /* @__PURE__ */ jsx("ol", {
|
|
1427
1324
|
class: [
|
|
1428
|
-
|
|
1325
|
+
"text",
|
|
1429
1326
|
"elmethis-list-common",
|
|
1430
1327
|
"elmethis-numbered-list"
|
|
1431
1328
|
],
|
|
@@ -1434,7 +1331,7 @@ const ElmList = component$(({ listStyle = "unordered" }) => {
|
|
|
1434
1331
|
} else {
|
|
1435
1332
|
return /* @__PURE__ */ jsx("ul", {
|
|
1436
1333
|
class: [
|
|
1437
|
-
|
|
1334
|
+
"text",
|
|
1438
1335
|
"elmethis-list-common",
|
|
1439
1336
|
"elmethis-bulleted-list"
|
|
1440
1337
|
],
|
|
@@ -1442,10 +1339,7 @@ const ElmList = component$(({ listStyle = "unordered" }) => {
|
|
|
1442
1339
|
});
|
|
1443
1340
|
}
|
|
1444
1341
|
});
|
|
1445
|
-
const paragraph = "
|
|
1446
|
-
const styles$5 = {
|
|
1447
|
-
paragraph
|
|
1448
|
-
};
|
|
1342
|
+
const styles$5 = ".paragraph {\n opacity: var(--opacity, 0);\n opacity: var(--opacity);\n transition: opacity 800ms;\n color: var(--color, #606875);\n background-color: var(--background-color, inherit);\n}\n.paragraph::selection {\n color: rgba(255, 255, 255, 0.7);\n background-color: rgba(0, 0, 0, 0.7);\n}\n[data-theme=dark] .paragraph {\n color: rgba(255, 255, 255, 0.7);\n}\n[data-theme=dark] .paragraph::selection {\n color: rgba(0, 0, 0, 0.7);\n background-color: rgba(255, 255, 255, 0.7);\n}";
|
|
1449
1343
|
const useInView = (props) => {
|
|
1450
1344
|
const ref = useSignal();
|
|
1451
1345
|
const isVisible = useSignal(false);
|
|
@@ -1466,12 +1360,14 @@ const useInView = (props) => {
|
|
|
1466
1360
|
};
|
|
1467
1361
|
};
|
|
1468
1362
|
const ElmParagraph = component$(({ color, backgroundColor }) => {
|
|
1363
|
+
useStylesScoped$(styles$5);
|
|
1364
|
+
useStylesScoped$(textStyles);
|
|
1469
1365
|
const { ref, isVisible } = useInView();
|
|
1470
1366
|
return /* @__PURE__ */ jsx("p", {
|
|
1471
1367
|
ref,
|
|
1472
1368
|
class: [
|
|
1473
|
-
|
|
1474
|
-
|
|
1369
|
+
"paragraph",
|
|
1370
|
+
"text"
|
|
1475
1371
|
],
|
|
1476
1372
|
style: {
|
|
1477
1373
|
"--color": color,
|
|
@@ -1481,38 +1377,32 @@ const ElmParagraph = component$(({ color, backgroundColor }) => {
|
|
|
1481
1377
|
children: /* @__PURE__ */ jsx(Slot, {})
|
|
1482
1378
|
});
|
|
1483
1379
|
});
|
|
1484
|
-
const
|
|
1485
|
-
const caption = "_caption_x2nyq_8";
|
|
1486
|
-
const spacing = "_spacing_x2nyq_25";
|
|
1487
|
-
const styles$4 = {
|
|
1488
|
-
table,
|
|
1489
|
-
caption,
|
|
1490
|
-
"caption-inner": "_caption-inner_x2nyq_18",
|
|
1491
|
-
spacing
|
|
1492
|
-
};
|
|
1380
|
+
const styles$4 = ".table {\n margin-block: var(--margin-block);\n border-collapse: collapse;\n border-spacing: 0;\n box-shadow: 0 0 0.125rem rgba(0, 0, 0, 0.2);\n}\n\n.caption {\n position: relative;\n width: 100%;\n display: inline-flex;\n justify-content: center;\n align-items: center;\n gap: 1rem;\n margin-block-end: 1rem;\n}\n\n.caption-inner {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n gap: 0.25rem;\n}\n\n.spacing {\n flex-grow: 1;\n height: 1px;\n background-color: rgba(128, 128, 128, 0.2);\n}";
|
|
1493
1381
|
const HasRowHeaderContext = createContextId("HasRowHeaderContext");
|
|
1494
1382
|
const ElmTable = component$((props) => {
|
|
1495
|
-
|
|
1383
|
+
useStylesScoped$(styles$4);
|
|
1384
|
+
useStylesScoped$(textStyles);
|
|
1385
|
+
const { margin, caption, hasRowHeader = false } = props;
|
|
1496
1386
|
const hasRowHeaderComputed = useComputed$(() => hasRowHeader);
|
|
1497
1387
|
useContextProvider(HasRowHeaderContext, hasRowHeaderComputed);
|
|
1498
1388
|
return /* @__PURE__ */ jsxs("table", {
|
|
1499
1389
|
class: [
|
|
1500
|
-
|
|
1501
|
-
|
|
1390
|
+
"table",
|
|
1391
|
+
"text"
|
|
1502
1392
|
],
|
|
1503
1393
|
style: {
|
|
1504
1394
|
"--margin-block": margin
|
|
1505
1395
|
},
|
|
1506
1396
|
children: [
|
|
1507
|
-
|
|
1397
|
+
caption && /* @__PURE__ */ jsx("caption", {
|
|
1508
1398
|
children: /* @__PURE__ */ jsxs("span", {
|
|
1509
|
-
class:
|
|
1399
|
+
class: "caption",
|
|
1510
1400
|
children: [
|
|
1511
1401
|
/* @__PURE__ */ jsx("span", {
|
|
1512
|
-
class:
|
|
1402
|
+
class: "spacing"
|
|
1513
1403
|
}),
|
|
1514
1404
|
/* @__PURE__ */ jsxs("span", {
|
|
1515
|
-
class:
|
|
1405
|
+
class: "caption-inner",
|
|
1516
1406
|
children: [
|
|
1517
1407
|
/* @__PURE__ */ jsx("svg", {
|
|
1518
1408
|
viewBox: "0 0 24 24",
|
|
@@ -1524,12 +1414,12 @@ const ElmTable = component$((props) => {
|
|
|
1524
1414
|
})
|
|
1525
1415
|
}),
|
|
1526
1416
|
/* @__PURE__ */ jsx(ElmInlineText, {
|
|
1527
|
-
text:
|
|
1417
|
+
text: caption
|
|
1528
1418
|
})
|
|
1529
1419
|
]
|
|
1530
1420
|
}),
|
|
1531
1421
|
/* @__PURE__ */ jsx("span", {
|
|
1532
|
-
class:
|
|
1422
|
+
class: "spacing"
|
|
1533
1423
|
})
|
|
1534
1424
|
]
|
|
1535
1425
|
})
|
|
@@ -1538,15 +1428,13 @@ const ElmTable = component$((props) => {
|
|
|
1538
1428
|
]
|
|
1539
1429
|
});
|
|
1540
1430
|
});
|
|
1541
|
-
const
|
|
1542
|
-
const styles$3 = {
|
|
1543
|
-
thead
|
|
1544
|
-
};
|
|
1431
|
+
const styles$3 = ".thead {\n text-align: left;\n transition: background-color 400ms, color 400ms;\n border-bottom: 2px solid rgba(128, 128, 128, 0.5);\n}";
|
|
1545
1432
|
const HasHeaderContext = createContextId("HasHeaderContext");
|
|
1546
1433
|
const ElmTableHeader = component$(() => {
|
|
1434
|
+
useStylesScoped$(styles$3);
|
|
1547
1435
|
useContextProvider(HasHeaderContext, true);
|
|
1548
1436
|
return /* @__PURE__ */ jsx("thead", {
|
|
1549
|
-
class:
|
|
1437
|
+
class: "thead",
|
|
1550
1438
|
children: /* @__PURE__ */ jsx(Slot, {})
|
|
1551
1439
|
});
|
|
1552
1440
|
});
|
|
@@ -1556,55 +1444,41 @@ const ElmTableBody = component$(() => {
|
|
|
1556
1444
|
children: /* @__PURE__ */ jsx(Slot, {})
|
|
1557
1445
|
});
|
|
1558
1446
|
});
|
|
1559
|
-
const tr = "
|
|
1560
|
-
const styles$2 = {
|
|
1561
|
-
tr,
|
|
1562
|
-
"has-row-header": "_has-row-header_2ogbz_20"
|
|
1563
|
-
};
|
|
1447
|
+
const styles$2 = ".tr {\n transition: background-color 200ms;\n}\n.tr:nth-child(odd) {\n background-color: transparent;\n}\n.tr:nth-child(even) {\n background-color: rgba(0, 0, 0, 0.015);\n}\n[data-theme=dark] .tr:nth-child(even) {\n background-color: rgba(255, 255, 255, 0.015);\n}\n.tr:hover {\n background-color: rgba(105, 135, 184, 0.15);\n}\n[data-theme=dark] .tr:hover {\n background-color: rgba(105, 135, 184, 0.15);\n}\n\n.has-row-header td:first-child,\n.has-row-header tr:first-child {\n background-color: rgba(128, 128, 128, 0.15);\n}";
|
|
1564
1448
|
const ElmTableRow = component$(() => {
|
|
1449
|
+
useStylesScoped$(styles$2);
|
|
1565
1450
|
const hasRowHeader = useContext(HasRowHeaderContext);
|
|
1566
1451
|
return /* @__PURE__ */ jsx("tr", {
|
|
1567
1452
|
class: [
|
|
1568
|
-
|
|
1569
|
-
hasRowHeader.value &&
|
|
1453
|
+
"tr",
|
|
1454
|
+
hasRowHeader.value && "has-row-header"
|
|
1570
1455
|
],
|
|
1571
1456
|
children: /* @__PURE__ */ jsx(Slot, {})
|
|
1572
1457
|
});
|
|
1573
1458
|
});
|
|
1574
|
-
const common = "
|
|
1575
|
-
const td = "_td_1puhv_24";
|
|
1576
|
-
const th = "_th_1puhv_31";
|
|
1577
|
-
const styles$1 = {
|
|
1578
|
-
common,
|
|
1579
|
-
td,
|
|
1580
|
-
th
|
|
1581
|
-
};
|
|
1459
|
+
const styles$1 = ".common {\n padding: 0.75rem 1rem;\n color: rgba(0, 0, 0, 0.7);\n border-right: 1px dotted rgba(0, 0, 0, 0.15);\n}\n.common::selection {\n color: rgba(255, 255, 255, 0.7);\n background-color: rgba(0, 0, 0, 0.7);\n}\n[data-theme=dark] .common {\n color: rgba(255, 255, 255, 0.7);\n}\n[data-theme=dark] .common::selection {\n color: rgba(0, 0, 0, 0.7);\n background-color: rgba(255, 255, 255, 0.7);\n}\n[data-theme=dark] .common {\n border-right: 1px dotted rgba(255, 255, 255, 0.15);\n}\n.common:last-child {\n border-right: none;\n}\n\n.td {\n border-top: 1px solid rgba(0, 0, 0, 0.15);\n}\n[data-theme=dark] .td {\n border-top-color: rgba(255, 255, 255, 0.15);\n}\n\n.th {\n background-color: rgba(128, 128, 128, 0.15);\n}";
|
|
1582
1460
|
const ElmTableCell = component$((props) => {
|
|
1583
|
-
|
|
1461
|
+
useStylesScoped$(styles$1);
|
|
1462
|
+
const { hasHeader = false, text } = props;
|
|
1584
1463
|
const hasHeaderInjected = useContext(HasHeaderContext, false);
|
|
1585
1464
|
const isHeader = hasHeader || hasHeaderInjected;
|
|
1586
1465
|
return /* @__PURE__ */ jsx(Fragment, {
|
|
1587
1466
|
children: isHeader ? /* @__PURE__ */ jsx("th", {
|
|
1588
1467
|
class: [
|
|
1589
|
-
|
|
1590
|
-
|
|
1468
|
+
"common",
|
|
1469
|
+
"th"
|
|
1591
1470
|
],
|
|
1592
|
-
children:
|
|
1471
|
+
children: text ? text : /* @__PURE__ */ jsx(Slot, {})
|
|
1593
1472
|
}) : /* @__PURE__ */ jsx("td", {
|
|
1594
1473
|
class: [
|
|
1595
|
-
|
|
1596
|
-
|
|
1474
|
+
"common",
|
|
1475
|
+
"td"
|
|
1597
1476
|
],
|
|
1598
|
-
children:
|
|
1477
|
+
children: text ? text : /* @__PURE__ */ jsx(Slot, {})
|
|
1599
1478
|
})
|
|
1600
1479
|
});
|
|
1601
1480
|
});
|
|
1602
|
-
const
|
|
1603
|
-
const styles = {
|
|
1604
|
-
"jarkup-body": "_jarkup-body_1l2bp_1",
|
|
1605
|
-
"column-list": "_column-list_1l2bp_7",
|
|
1606
|
-
column
|
|
1607
|
-
};
|
|
1481
|
+
const styles = ".jarkup-body {\n display: flex;\n flex-direction: column;\n gap: 2rem;\n}\n\n.column-list {\n box-sizing: content-box;\n padding-block: 0.25rem;\n width: 100%;\n display: flex;\n flex-direction: row;\n gap: 0.25rem;\n justify-content: space-around;\n overflow: auto;\n}\n\n.column {\n box-sizing: border-box;\n padding: 0.125rem;\n flex: var(--width-ratio, 1);\n}\n.column > * + * {\n margin-block-start: 2em;\n}";
|
|
1608
1482
|
const convertInlineComponentsToPlainText = (inlineComponents) => {
|
|
1609
1483
|
return inlineComponents.map((component) => {
|
|
1610
1484
|
if (component.type === "Text") {
|
|
@@ -1615,6 +1489,7 @@ const convertInlineComponentsToPlainText = (inlineComponents) => {
|
|
|
1615
1489
|
}).join("");
|
|
1616
1490
|
};
|
|
1617
1491
|
const ElmJarkup = component$((props) => {
|
|
1492
|
+
useStylesScoped$(styles);
|
|
1618
1493
|
const render = (jsonComponents) => {
|
|
1619
1494
|
return jsonComponents.map((component, index) => {
|
|
1620
1495
|
const key = component.id || index;
|
|
@@ -1741,12 +1616,12 @@ const ElmJarkup = component$((props) => {
|
|
|
1741
1616
|
}, key);
|
|
1742
1617
|
case "ColumnList":
|
|
1743
1618
|
return /* @__PURE__ */ jsx("div", {
|
|
1744
|
-
class:
|
|
1619
|
+
class: "column-list",
|
|
1745
1620
|
children: render(component.slots.default)
|
|
1746
1621
|
}, key);
|
|
1747
1622
|
case "Column":
|
|
1748
1623
|
return /* @__PURE__ */ jsx("div", {
|
|
1749
|
-
class:
|
|
1624
|
+
class: "column",
|
|
1750
1625
|
style: {
|
|
1751
1626
|
"--width-ratio": component.props?.widthRatio || 1,
|
|
1752
1627
|
width: component.props?.widthRatio ? `${component.props.widthRatio * 100}%` : void 0
|
|
@@ -1768,7 +1643,7 @@ const ElmJarkup = component$((props) => {
|
|
|
1768
1643
|
});
|
|
1769
1644
|
};
|
|
1770
1645
|
return /* @__PURE__ */ jsx("div", {
|
|
1771
|
-
class:
|
|
1646
|
+
class: "jarkup-body",
|
|
1772
1647
|
children: render(props.jsonComponents)
|
|
1773
1648
|
});
|
|
1774
1649
|
});
|