@elmethis/qwik 0.0.1
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/LICENSE +21 -0
- package/README.md +55 -0
- package/lib/assets/6FDiDjPb-elmethis.css +955 -0
- package/lib/elmethis.js +56 -0
- package/lib/elmethis10.js +108 -0
- package/lib/elmethis11.js +25 -0
- package/lib/elmethis12.js +87 -0
- package/lib/elmethis13.js +62 -0
- package/lib/elmethis14.js +62 -0
- package/lib/elmethis15.js +44 -0
- package/lib/elmethis16.js +58 -0
- package/lib/elmethis17.js +14 -0
- package/lib/elmethis18.js +24 -0
- package/lib/elmethis19.js +41 -0
- package/lib/elmethis2.js +68 -0
- package/lib/elmethis20.js +89 -0
- package/lib/elmethis21.js +28 -0
- package/lib/elmethis22.js +24 -0
- package/lib/elmethis23.js +57 -0
- package/lib/elmethis24.js +15 -0
- package/lib/elmethis25.js +12 -0
- package/lib/elmethis26.js +17 -0
- package/lib/elmethis27.js +27 -0
- package/lib/elmethis28.js +193 -0
- package/lib/elmethis29.js +17 -0
- package/lib/elmethis3.js +17 -0
- package/lib/elmethis30.js +8 -0
- package/lib/elmethis31.js +79 -0
- package/lib/elmethis33.js +32 -0
- package/lib/elmethis34.js +6 -0
- package/lib/elmethis35.js +6 -0
- package/lib/elmethis36.js +11 -0
- package/lib/elmethis37.js +8 -0
- package/lib/elmethis38.js +18 -0
- package/lib/elmethis39.js +24 -0
- package/lib/elmethis4.js +33 -0
- package/lib/elmethis40.js +24 -0
- package/lib/elmethis41.js +29 -0
- package/lib/elmethis42.js +31 -0
- package/lib/elmethis43.js +32 -0
- package/lib/elmethis44.js +18 -0
- package/lib/elmethis45.js +24 -0
- package/lib/elmethis46.js +36 -0
- package/lib/elmethis47.js +45 -0
- package/lib/elmethis48.js +27 -0
- package/lib/elmethis49.js +89 -0
- package/lib/elmethis5.js +123 -0
- package/lib/elmethis50.js +18 -0
- package/lib/elmethis51.js +64 -0
- package/lib/elmethis52.js +28 -0
- package/lib/elmethis53.js +28 -0
- package/lib/elmethis54.js +32 -0
- package/lib/elmethis55.js +28 -0
- package/lib/elmethis56.js +8 -0
- package/lib/elmethis57.js +15 -0
- package/lib/elmethis58.js +10 -0
- package/lib/elmethis59.js +26 -0
- package/lib/elmethis6.js +20 -0
- package/lib/elmethis60.js +14 -0
- package/lib/elmethis61.js +14 -0
- package/lib/elmethis62.js +8 -0
- package/lib/elmethis63.js +8 -0
- package/lib/elmethis64.js +24 -0
- package/lib/elmethis65.js +17 -0
- package/lib/elmethis67.js +8 -0
- package/lib/elmethis68.js +23 -0
- package/lib/elmethis69.js +15 -0
- package/lib/elmethis7.js +12 -0
- package/lib/elmethis70.js +8 -0
- package/lib/elmethis71.js +9 -0
- package/lib/elmethis72.js +14 -0
- package/lib/elmethis73.js +10 -0
- package/lib/elmethis74.js +8 -0
- package/lib/elmethis8.js +29 -0
- package/lib/elmethis9.js +16 -0
- package/lib-types/components/code/elm-code-block.d.ts +21 -0
- package/lib-types/components/code/elm-code-block.stories.d.ts +9 -0
- package/lib-types/components/code/elm-katex.d.ts +15 -0
- package/lib-types/components/code/elm-katex.stories.d.ts +8 -0
- package/lib-types/components/code/elm-shiki-highlighter.d.ts +12 -0
- package/lib-types/components/code/elm-shiki-highlighter.stories.d.ts +6 -0
- package/lib-types/components/code/shikiInstance.d.ts +2 -0
- package/lib-types/components/containments/elm-toggle.d.ts +7 -0
- package/lib-types/components/containments/elm-toggle.stories.d.ts +6 -0
- package/lib-types/components/fallback/elm-block-fallback.d.ts +5 -0
- package/lib-types/components/fallback/elm-block-fallback.stories.d.ts +6 -0
- package/lib-types/components/fallback/elm-rectangle-wave.d.ts +4 -0
- package/lib-types/components/fallback/elm-rectangle-wave.stories.d.ts +6 -0
- package/lib-types/components/icon/elm-dot-loading-icon.d.ts +14 -0
- package/lib-types/components/icon/elm-dot-loading-icon.stories.d.ts +6 -0
- package/lib-types/components/icon/elm-inline-icon.d.ts +11 -0
- package/lib-types/components/icon/elm-inline-icon.stories.d.ts +6 -0
- package/lib-types/components/icon/elm-language-icon.d.ts +14 -0
- package/lib-types/components/icon/elm-language-icon.stories.d.ts +6 -0
- package/lib-types/components/icon/elm-mdi-icon.d.ts +8 -0
- package/lib-types/components/icon/elm-mdi-icon.stories.d.ts +6 -0
- package/lib-types/components/icon/languages/bash.d.ts +2 -0
- package/lib-types/components/icon/languages/c-plus-plus.d.ts +2 -0
- package/lib-types/components/icon/languages/c-sharp.d.ts +2 -0
- package/lib-types/components/icon/languages/c.d.ts +2 -0
- package/lib-types/components/icon/languages/css.d.ts +2 -0
- package/lib-types/components/icon/languages/go.d.ts +2 -0
- package/lib-types/components/icon/languages/html.d.ts +2 -0
- package/lib-types/components/icon/languages/java.d.ts +2 -0
- package/lib-types/components/icon/languages/javascript.d.ts +2 -0
- package/lib-types/components/icon/languages/json.d.ts +2 -0
- package/lib-types/components/icon/languages/kotlin.d.ts +2 -0
- package/lib-types/components/icon/languages/language-interface.d.ts +4 -0
- package/lib-types/components/icon/languages/lua.d.ts +2 -0
- package/lib-types/components/icon/languages/npm.d.ts +2 -0
- package/lib-types/components/icon/languages/python.d.ts +2 -0
- package/lib-types/components/icon/languages/rust.d.ts +2 -0
- package/lib-types/components/icon/languages/sql.d.ts +2 -0
- package/lib-types/components/icon/languages/terraform.d.ts +2 -0
- package/lib-types/components/icon/languages/typescript.d.ts +2 -0
- package/lib-types/components/media/elm-block-image.d.ts +16 -0
- package/lib-types/components/media/elm-block-image.stories.d.ts +12 -0
- package/lib-types/components/media/elm-file.d.ts +15 -0
- package/lib-types/components/media/elm-file.stories.d.ts +7 -0
- package/lib-types/components/navigation/elm-bookmark.d.ts +24 -0
- package/lib-types/components/navigation/elm-bookmark.stories.d.ts +12 -0
- package/lib-types/components/others/elm-jarkup.d.ts +5 -0
- package/lib-types/components/others/elm-jarkup.stories.d.ts +6 -0
- package/lib-types/components/table/elm-table-body.d.ts +2 -0
- package/lib-types/components/table/elm-table-cell.d.ts +12 -0
- package/lib-types/components/table/elm-table-header.d.ts +3 -0
- package/lib-types/components/table/elm-table-row.d.ts +2 -0
- package/lib-types/components/table/elm-table.d.ts +13 -0
- package/lib-types/components/table/elm-table.stories.d.ts +6 -0
- package/lib-types/components/table/index.d.ts +5 -0
- package/lib-types/components/typography/elm-block-quote.d.ts +4 -0
- package/lib-types/components/typography/elm-block-quote.stories.d.ts +6 -0
- package/lib-types/components/typography/elm-callout.d.ts +8 -0
- package/lib-types/components/typography/elm-callout.stories.d.ts +10 -0
- package/lib-types/components/typography/elm-divider.d.ts +8 -0
- package/lib-types/components/typography/elm-divider.stories.d.ts +6 -0
- package/lib-types/components/typography/elm-fragment-identifier.d.ts +7 -0
- package/lib-types/components/typography/elm-fragment-identifier.stories.d.ts +6 -0
- package/lib-types/components/typography/elm-heading.d.ts +6 -0
- package/lib-types/components/typography/elm-heading.stories.d.ts +7 -0
- package/lib-types/components/typography/elm-inline-text.d.ts +54 -0
- package/lib-types/components/typography/elm-inline-text.stories.d.ts +13 -0
- package/lib-types/components/typography/elm-list.d.ts +5 -0
- package/lib-types/components/typography/elm-list.stories.d.ts +8 -0
- package/lib-types/components/typography/elm-paragraph.d.ts +5 -0
- package/lib-types/components/typography/elm-paragraph.stories.d.ts +9 -0
- package/lib-types/entry.dev.d.ts +2 -0
- package/lib-types/entry.ssr.d.ts +14 -0
- package/lib-types/hooks/useDelayedSignal.d.ts +6 -0
- package/lib-types/hooks/useInView.d.ts +6 -0
- package/lib-types/index.d.ts +27 -0
- package/lib-types/root.d.ts +2 -0
- package/package.json +72 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { jsx, jsxs } from "@builder.io/qwik/jsx-runtime";
|
|
2
|
+
import { component$, Slot } from "@builder.io/qwik";
|
|
3
|
+
import styles from "./elmethis65.js";
|
|
4
|
+
import textStyles from "./elmethis30.js";
|
|
5
|
+
import { ElmInlineIcon } from "./elmethis9.js";
|
|
6
|
+
const ElmInlineText = component$((props) => {
|
|
7
|
+
const { bold = false, italic = false, underline = false, strikethrough = false, code = false, size = "1em" } = props;
|
|
8
|
+
let vnode = props.text ? /* @__PURE__ */ jsx("span", {
|
|
9
|
+
children: props.text
|
|
10
|
+
}) : /* @__PURE__ */ jsx(Slot, {});
|
|
11
|
+
if (props.kbd) {
|
|
12
|
+
vnode = /* @__PURE__ */ jsx("kbd", {
|
|
13
|
+
class: styles.kbd,
|
|
14
|
+
children: vnode
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
if (strikethrough) {
|
|
18
|
+
vnode = /* @__PURE__ */ jsx("del", {
|
|
19
|
+
children: vnode
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
if (italic) {
|
|
23
|
+
vnode = /* @__PURE__ */ jsx("em", {
|
|
24
|
+
children: vnode
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
if (underline) {
|
|
28
|
+
vnode = /* @__PURE__ */ jsx("ins", {
|
|
29
|
+
children: vnode
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
if (bold) {
|
|
33
|
+
vnode = /* @__PURE__ */ jsx("strong", {
|
|
34
|
+
children: vnode
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
if (code) {
|
|
38
|
+
vnode = /* @__PURE__ */ jsx("code", {
|
|
39
|
+
class: styles.code,
|
|
40
|
+
children: vnode
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
if (props.ruby) {
|
|
44
|
+
vnode = /* @__PURE__ */ jsxs("ruby", {
|
|
45
|
+
class: styles.text,
|
|
46
|
+
children: [
|
|
47
|
+
/* @__PURE__ */ jsx("span", {
|
|
48
|
+
children: vnode
|
|
49
|
+
}),
|
|
50
|
+
/* @__PURE__ */ jsx("rt", {
|
|
51
|
+
children: props.ruby
|
|
52
|
+
})
|
|
53
|
+
]
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
const wrappedVnode = /* @__PURE__ */ jsx("span", {
|
|
57
|
+
class: [
|
|
58
|
+
styles.text,
|
|
59
|
+
textStyles.text
|
|
60
|
+
],
|
|
61
|
+
style: {
|
|
62
|
+
"--color": props.color,
|
|
63
|
+
"--font-size": size,
|
|
64
|
+
"--background-color": props.backgroundColor
|
|
65
|
+
},
|
|
66
|
+
children: vnode
|
|
67
|
+
});
|
|
68
|
+
if (props.href) {
|
|
69
|
+
return /* @__PURE__ */ jsxs("a", {
|
|
70
|
+
class: styles.link,
|
|
71
|
+
href: props.href,
|
|
72
|
+
style: {
|
|
73
|
+
"--font-size": size
|
|
74
|
+
},
|
|
75
|
+
target: "_blank",
|
|
76
|
+
rel: "noopener noreferrer",
|
|
77
|
+
children: [
|
|
78
|
+
props.favicon && /* @__PURE__ */ jsx(ElmInlineIcon, {
|
|
79
|
+
src: props.favicon
|
|
80
|
+
}),
|
|
81
|
+
wrappedVnode
|
|
82
|
+
]
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
return wrappedVnode;
|
|
86
|
+
});
|
|
87
|
+
export {
|
|
88
|
+
ElmInlineText
|
|
89
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx } from "@builder.io/qwik/jsx-runtime";
|
|
2
|
+
import { component$, Slot } from "@builder.io/qwik";
|
|
3
|
+
/* empty css */
|
|
4
|
+
import textStyles from "./elmethis30.js";
|
|
5
|
+
const ElmList = component$(({ listStyle = "unordered" }) => {
|
|
6
|
+
if (listStyle === "ordered") {
|
|
7
|
+
return /* @__PURE__ */ jsx("ol", {
|
|
8
|
+
class: [
|
|
9
|
+
textStyles.text,
|
|
10
|
+
"elmethis-list-common",
|
|
11
|
+
"elmethis-numbered-list"
|
|
12
|
+
],
|
|
13
|
+
children: /* @__PURE__ */ jsx(Slot, {})
|
|
14
|
+
});
|
|
15
|
+
} else {
|
|
16
|
+
return /* @__PURE__ */ jsx("ul", {
|
|
17
|
+
class: [
|
|
18
|
+
textStyles.text,
|
|
19
|
+
"elmethis-list-common",
|
|
20
|
+
"elmethis-bulleted-list"
|
|
21
|
+
],
|
|
22
|
+
children: /* @__PURE__ */ jsx(Slot, {})
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
export {
|
|
27
|
+
ElmList
|
|
28
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsx } from "@builder.io/qwik/jsx-runtime";
|
|
2
|
+
import { component$, Slot } from "@builder.io/qwik";
|
|
3
|
+
import styles from "./elmethis67.js";
|
|
4
|
+
import textStyles from "./elmethis30.js";
|
|
5
|
+
import { useInView } from "./elmethis68.js";
|
|
6
|
+
const ElmParagraph = component$(({ color, backgroundColor }) => {
|
|
7
|
+
const { ref, isVisible } = useInView();
|
|
8
|
+
return /* @__PURE__ */ jsx("p", {
|
|
9
|
+
ref,
|
|
10
|
+
class: [
|
|
11
|
+
styles.paragraph,
|
|
12
|
+
textStyles.text
|
|
13
|
+
],
|
|
14
|
+
style: {
|
|
15
|
+
"--color": color,
|
|
16
|
+
"--background-color": backgroundColor,
|
|
17
|
+
"--opacity": isVisible.value ? 1 : 0
|
|
18
|
+
},
|
|
19
|
+
children: /* @__PURE__ */ jsx(Slot, {})
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
export {
|
|
23
|
+
ElmParagraph
|
|
24
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { jsxs, jsx } from "@builder.io/qwik/jsx-runtime";
|
|
2
|
+
import { component$, useComputed$, useContextProvider, createContextId, Slot } from "@builder.io/qwik";
|
|
3
|
+
import styles from "./elmethis69.js";
|
|
4
|
+
import textStyles from "./elmethis30.js";
|
|
5
|
+
import { ElmInlineText } from "./elmethis20.js";
|
|
6
|
+
const HasRowHeaderContext = createContextId("HasRowHeaderContext");
|
|
7
|
+
const ElmTable = component$((props) => {
|
|
8
|
+
const { margin, caption, hasRowHeader = false } = props;
|
|
9
|
+
const hasRowHeaderComputed = useComputed$(() => hasRowHeader);
|
|
10
|
+
useContextProvider(HasRowHeaderContext, hasRowHeaderComputed);
|
|
11
|
+
return /* @__PURE__ */ jsxs("table", {
|
|
12
|
+
class: [
|
|
13
|
+
styles.table,
|
|
14
|
+
textStyles.text
|
|
15
|
+
],
|
|
16
|
+
style: {
|
|
17
|
+
"--margin-block": margin
|
|
18
|
+
},
|
|
19
|
+
children: [
|
|
20
|
+
caption && /* @__PURE__ */ jsx("caption", {
|
|
21
|
+
children: /* @__PURE__ */ jsxs("span", {
|
|
22
|
+
class: styles["caption"],
|
|
23
|
+
children: [
|
|
24
|
+
/* @__PURE__ */ jsx("span", {
|
|
25
|
+
class: styles.spacing
|
|
26
|
+
}),
|
|
27
|
+
/* @__PURE__ */ jsxs("span", {
|
|
28
|
+
class: styles["caption-inner"],
|
|
29
|
+
children: [
|
|
30
|
+
/* @__PURE__ */ jsx("svg", {
|
|
31
|
+
viewBox: "0 0 24 24",
|
|
32
|
+
width: "1rem",
|
|
33
|
+
height: "1rem",
|
|
34
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
35
|
+
d: "M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4M12,6A6,6 0 0,0 6,12A6,6 0 0,0 12,18A6,6 0 0,0 18,12A6,6 0 0,0 12,6M12,8A4,4 0 0,1 16,12A4,4 0 0,1 12,16A4,4 0 0,1 8,12A4,4 0 0,1 12,8Z",
|
|
36
|
+
fill: "#6987b8"
|
|
37
|
+
})
|
|
38
|
+
}),
|
|
39
|
+
/* @__PURE__ */ jsx(ElmInlineText, {
|
|
40
|
+
text: caption
|
|
41
|
+
})
|
|
42
|
+
]
|
|
43
|
+
}),
|
|
44
|
+
/* @__PURE__ */ jsx("span", {
|
|
45
|
+
class: styles.spacing
|
|
46
|
+
})
|
|
47
|
+
]
|
|
48
|
+
})
|
|
49
|
+
}),
|
|
50
|
+
/* @__PURE__ */ jsx(Slot, {})
|
|
51
|
+
]
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
export {
|
|
55
|
+
ElmTable,
|
|
56
|
+
HasRowHeaderContext
|
|
57
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx } from "@builder.io/qwik/jsx-runtime";
|
|
2
|
+
import { component$, useContextProvider, createContextId, Slot } from "@builder.io/qwik";
|
|
3
|
+
import styles from "./elmethis70.js";
|
|
4
|
+
const HasHeaderContext = createContextId("HasHeaderContext");
|
|
5
|
+
const ElmTableHeader = component$(() => {
|
|
6
|
+
useContextProvider(HasHeaderContext, true);
|
|
7
|
+
return /* @__PURE__ */ jsx("thead", {
|
|
8
|
+
class: styles.thead,
|
|
9
|
+
children: /* @__PURE__ */ jsx(Slot, {})
|
|
10
|
+
});
|
|
11
|
+
});
|
|
12
|
+
export {
|
|
13
|
+
ElmTableHeader,
|
|
14
|
+
HasHeaderContext
|
|
15
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx } from "@builder.io/qwik/jsx-runtime";
|
|
2
|
+
import { component$, useContextProvider, Slot } from "@builder.io/qwik";
|
|
3
|
+
import { HasHeaderContext } from "./elmethis24.js";
|
|
4
|
+
const ElmTableBody = component$(() => {
|
|
5
|
+
useContextProvider(HasHeaderContext, false);
|
|
6
|
+
return /* @__PURE__ */ jsx("tbody", {
|
|
7
|
+
children: /* @__PURE__ */ jsx(Slot, {})
|
|
8
|
+
});
|
|
9
|
+
});
|
|
10
|
+
export {
|
|
11
|
+
ElmTableBody
|
|
12
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx } from "@builder.io/qwik/jsx-runtime";
|
|
2
|
+
import { component$, useContext, Slot } from "@builder.io/qwik";
|
|
3
|
+
import styles from "./elmethis71.js";
|
|
4
|
+
import { HasRowHeaderContext } from "./elmethis23.js";
|
|
5
|
+
const ElmTableRow = component$(() => {
|
|
6
|
+
const hasRowHeader = useContext(HasRowHeaderContext);
|
|
7
|
+
return /* @__PURE__ */ jsx("tr", {
|
|
8
|
+
class: [
|
|
9
|
+
styles.tr,
|
|
10
|
+
hasRowHeader.value && styles["has-row-header"]
|
|
11
|
+
],
|
|
12
|
+
children: /* @__PURE__ */ jsx(Slot, {})
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
export {
|
|
16
|
+
ElmTableRow
|
|
17
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx, Fragment } from "@builder.io/qwik/jsx-runtime";
|
|
2
|
+
import { component$, useContext, Slot } from "@builder.io/qwik";
|
|
3
|
+
import styles from "./elmethis72.js";
|
|
4
|
+
import { HasHeaderContext } from "./elmethis24.js";
|
|
5
|
+
const ElmTableCell = component$((props) => {
|
|
6
|
+
const { hasHeader = false, text } = props;
|
|
7
|
+
const hasHeaderInjected = useContext(HasHeaderContext, false);
|
|
8
|
+
const isHeader = hasHeader || hasHeaderInjected;
|
|
9
|
+
return /* @__PURE__ */ jsx(Fragment, {
|
|
10
|
+
children: isHeader ? /* @__PURE__ */ jsx("th", {
|
|
11
|
+
class: [
|
|
12
|
+
styles.common,
|
|
13
|
+
styles.th
|
|
14
|
+
],
|
|
15
|
+
children: text ? text : /* @__PURE__ */ jsx(Slot, {})
|
|
16
|
+
}) : /* @__PURE__ */ jsx("td", {
|
|
17
|
+
class: [
|
|
18
|
+
styles.common,
|
|
19
|
+
styles.td
|
|
20
|
+
],
|
|
21
|
+
children: text ? text : /* @__PURE__ */ jsx(Slot, {})
|
|
22
|
+
})
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
export {
|
|
26
|
+
ElmTableCell
|
|
27
|
+
};
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { jsx, jsxs } from "@builder.io/qwik/jsx-runtime";
|
|
2
|
+
import { component$ } from "@builder.io/qwik";
|
|
3
|
+
import { kebabCase } from "lodash-es";
|
|
4
|
+
import styles from "./elmethis73.js";
|
|
5
|
+
import { ElmInlineText } from "./elmethis20.js";
|
|
6
|
+
import { ElmKatex } from "./elmethis3.js";
|
|
7
|
+
import { ElmInlineIcon } from "./elmethis9.js";
|
|
8
|
+
import { ElmHeading } from "./elmethis19.js";
|
|
9
|
+
import { ElmParagraph } from "./elmethis22.js";
|
|
10
|
+
import { ElmList } from "./elmethis21.js";
|
|
11
|
+
import { ElmBlockQuote } from "./elmethis15.js";
|
|
12
|
+
import { ElmCallout } from "./elmethis16.js";
|
|
13
|
+
import { ElmDivider } from "./elmethis17.js";
|
|
14
|
+
import { ElmToggle } from "./elmethis5.js";
|
|
15
|
+
import { ElmBookmark } from "./elmethis14.js";
|
|
16
|
+
import { ElmFile } from "./elmethis13.js";
|
|
17
|
+
import { ElmBlockImage } from "./elmethis12.js";
|
|
18
|
+
import { ElmCodeBlock } from "./elmethis2.js";
|
|
19
|
+
import { ElmTableCell } from "./elmethis27.js";
|
|
20
|
+
import { ElmTableRow } from "./elmethis26.js";
|
|
21
|
+
import { ElmTable } from "./elmethis23.js";
|
|
22
|
+
import { ElmTableHeader } from "./elmethis24.js";
|
|
23
|
+
import { ElmTableBody } from "./elmethis25.js";
|
|
24
|
+
const convertInlineComponentsToPlainText = (inlineComponents) => {
|
|
25
|
+
return inlineComponents.map((component) => {
|
|
26
|
+
if (component.type === "Text") {
|
|
27
|
+
return component.props.text;
|
|
28
|
+
} else {
|
|
29
|
+
return "";
|
|
30
|
+
}
|
|
31
|
+
}).join("");
|
|
32
|
+
};
|
|
33
|
+
const ElmJarkup = component$((props) => {
|
|
34
|
+
const render = (jsonComponents) => {
|
|
35
|
+
return jsonComponents.map((component, index) => {
|
|
36
|
+
const key = component.id || index;
|
|
37
|
+
switch (component.type) {
|
|
38
|
+
case "Text": {
|
|
39
|
+
const { props: p } = component;
|
|
40
|
+
if (p.katex) {
|
|
41
|
+
return /* @__PURE__ */ jsx(ElmKatex, {
|
|
42
|
+
expression: p.text,
|
|
43
|
+
block: false
|
|
44
|
+
}, key);
|
|
45
|
+
}
|
|
46
|
+
return /* @__PURE__ */ jsx(ElmInlineText, {
|
|
47
|
+
text: p.text,
|
|
48
|
+
color: p.color,
|
|
49
|
+
backgroundColor: p.backgroundColor,
|
|
50
|
+
bold: p.bold,
|
|
51
|
+
italic: p.italic,
|
|
52
|
+
underline: p.underline,
|
|
53
|
+
strikethrough: p.strikethrough,
|
|
54
|
+
code: p.code,
|
|
55
|
+
ruby: p.ruby,
|
|
56
|
+
href: p.href,
|
|
57
|
+
favicon: p.favicon
|
|
58
|
+
}, key);
|
|
59
|
+
}
|
|
60
|
+
case "Icon":
|
|
61
|
+
return /* @__PURE__ */ jsx(ElmInlineIcon, {
|
|
62
|
+
src: component.props.src,
|
|
63
|
+
alt: component.props.alt
|
|
64
|
+
}, key);
|
|
65
|
+
case "Heading":
|
|
66
|
+
return /* @__PURE__ */ jsx(ElmHeading, {
|
|
67
|
+
level: component.props.level,
|
|
68
|
+
id: kebabCase(convertInlineComponentsToPlainText(component.slots.default)),
|
|
69
|
+
children: render(component.slots.default)
|
|
70
|
+
}, key);
|
|
71
|
+
case "Paragraph":
|
|
72
|
+
return /* @__PURE__ */ jsx(ElmParagraph, {
|
|
73
|
+
color: component.props?.color,
|
|
74
|
+
backgroundColor: component.props?.backgroundColor,
|
|
75
|
+
children: render(component.slots.default)
|
|
76
|
+
}, key);
|
|
77
|
+
case "ListItem":
|
|
78
|
+
return /* @__PURE__ */ jsx("li", {
|
|
79
|
+
children: render(component.slots.default)
|
|
80
|
+
}, key);
|
|
81
|
+
case "List":
|
|
82
|
+
return /* @__PURE__ */ jsx(ElmList, {
|
|
83
|
+
listStyle: component.props?.listStyle === "unordered" ? "unordered" : "ordered",
|
|
84
|
+
children: render(component.slots.default)
|
|
85
|
+
}, key);
|
|
86
|
+
case "BlockQuote":
|
|
87
|
+
return /* @__PURE__ */ jsx(ElmBlockQuote, {
|
|
88
|
+
cite: component.props?.cite,
|
|
89
|
+
children: render(component.slots.default)
|
|
90
|
+
}, key);
|
|
91
|
+
case "Callout":
|
|
92
|
+
return /* @__PURE__ */ jsx(ElmCallout, {
|
|
93
|
+
type: component.props?.type,
|
|
94
|
+
children: render(component.slots.default)
|
|
95
|
+
}, key);
|
|
96
|
+
case "Divider":
|
|
97
|
+
return /* @__PURE__ */ jsx(ElmDivider, {}, key);
|
|
98
|
+
case "Toggle":
|
|
99
|
+
return /* @__PURE__ */ jsxs(ElmToggle, {
|
|
100
|
+
children: [
|
|
101
|
+
/* @__PURE__ */ jsx("div", {
|
|
102
|
+
"q:slot": "summary",
|
|
103
|
+
children: render(component.slots.summary)
|
|
104
|
+
}),
|
|
105
|
+
render(component.slots.default)
|
|
106
|
+
]
|
|
107
|
+
}, key);
|
|
108
|
+
case "Bookmark":
|
|
109
|
+
return /* @__PURE__ */ jsx(ElmBookmark, {
|
|
110
|
+
url: component.props.url,
|
|
111
|
+
title: component.props.title,
|
|
112
|
+
description: component.props.description,
|
|
113
|
+
image: component.props.image
|
|
114
|
+
}, key);
|
|
115
|
+
case "File":
|
|
116
|
+
return /* @__PURE__ */ jsx(ElmFile, {
|
|
117
|
+
src: component.props.src,
|
|
118
|
+
name: component.props.name
|
|
119
|
+
}, key);
|
|
120
|
+
case "Image":
|
|
121
|
+
return /* @__PURE__ */ jsx(ElmBlockImage, {
|
|
122
|
+
src: component.props.src,
|
|
123
|
+
alt: component.props.alt,
|
|
124
|
+
enableModal: true
|
|
125
|
+
}, key);
|
|
126
|
+
case "CodeBlock":
|
|
127
|
+
return /* @__PURE__ */ jsx(ElmCodeBlock, {
|
|
128
|
+
code: component.props.code,
|
|
129
|
+
language: component.props.language,
|
|
130
|
+
children: component.slots?.default && render(component.slots.default)
|
|
131
|
+
}, key);
|
|
132
|
+
case "Katex":
|
|
133
|
+
return /* @__PURE__ */ jsx(ElmKatex, {
|
|
134
|
+
expression: component.props.expression,
|
|
135
|
+
block: true
|
|
136
|
+
}, key);
|
|
137
|
+
case "Table":
|
|
138
|
+
return /* @__PURE__ */ jsxs(ElmTable, {
|
|
139
|
+
caption: component.props?.caption,
|
|
140
|
+
hasRowHeader: component.props?.hasRowHeader,
|
|
141
|
+
children: [
|
|
142
|
+
component.slots.header && /* @__PURE__ */ jsx(ElmTableHeader, {
|
|
143
|
+
children: render(component.slots.header)
|
|
144
|
+
}),
|
|
145
|
+
/* @__PURE__ */ jsx(ElmTableBody, {
|
|
146
|
+
children: render(component.slots.body)
|
|
147
|
+
})
|
|
148
|
+
]
|
|
149
|
+
}, key);
|
|
150
|
+
case "TableRow":
|
|
151
|
+
return /* @__PURE__ */ jsx(ElmTableRow, {
|
|
152
|
+
children: render(component.slots.default)
|
|
153
|
+
}, key);
|
|
154
|
+
case "TableCell":
|
|
155
|
+
return /* @__PURE__ */ jsx(ElmTableCell, {
|
|
156
|
+
children: render(component.slots.default)
|
|
157
|
+
}, key);
|
|
158
|
+
case "ColumnList":
|
|
159
|
+
return /* @__PURE__ */ jsx("div", {
|
|
160
|
+
class: styles["column-list"],
|
|
161
|
+
children: render(component.slots.default)
|
|
162
|
+
}, key);
|
|
163
|
+
case "Column":
|
|
164
|
+
return /* @__PURE__ */ jsx("div", {
|
|
165
|
+
class: styles.column,
|
|
166
|
+
style: {
|
|
167
|
+
"--width-ratio": component.props?.widthRatio || 1,
|
|
168
|
+
width: component.props?.widthRatio ? `${component.props.widthRatio * 100}%` : void 0
|
|
169
|
+
},
|
|
170
|
+
children: render(component.slots.default)
|
|
171
|
+
}, key);
|
|
172
|
+
default:
|
|
173
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
174
|
+
style: {
|
|
175
|
+
color: "red",
|
|
176
|
+
border: "1px solid red"
|
|
177
|
+
},
|
|
178
|
+
children: [
|
|
179
|
+
"Unsupported component type: ",
|
|
180
|
+
component.type
|
|
181
|
+
]
|
|
182
|
+
}, key);
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
};
|
|
186
|
+
return /* @__PURE__ */ jsx("div", {
|
|
187
|
+
class: styles["jarkup-body"],
|
|
188
|
+
children: render(props.jsonComponents)
|
|
189
|
+
});
|
|
190
|
+
});
|
|
191
|
+
export {
|
|
192
|
+
ElmJarkup
|
|
193
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const caption = "_caption_f7ep7_27";
|
|
2
|
+
const divider = "_divider_f7ep7_49";
|
|
3
|
+
const code = "_code_f7ep7_1";
|
|
4
|
+
const styles = {
|
|
5
|
+
"code-block": "_code-block_f7ep7_1",
|
|
6
|
+
"language-icon": "_language-icon_f7ep7_22",
|
|
7
|
+
caption,
|
|
8
|
+
"copy-icon": "_copy-icon_f7ep7_33",
|
|
9
|
+
divider,
|
|
10
|
+
code
|
|
11
|
+
};
|
|
12
|
+
export {
|
|
13
|
+
caption,
|
|
14
|
+
code,
|
|
15
|
+
styles as default,
|
|
16
|
+
divider
|
|
17
|
+
};
|
package/lib/elmethis3.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx } from "@builder.io/qwik/jsx-runtime";
|
|
2
|
+
import { component$, useComputed$ } from "@builder.io/qwik";
|
|
3
|
+
import textStyles from "./elmethis30.js";
|
|
4
|
+
import { renderToString } from "katex";
|
|
5
|
+
const ElmKatex = component$(({ expression, block = false }) => {
|
|
6
|
+
const html = useComputed$(() => renderToString(expression, {
|
|
7
|
+
displayMode: block,
|
|
8
|
+
output: "mathml"
|
|
9
|
+
}));
|
|
10
|
+
return /* @__PURE__ */ jsx("div", {
|
|
11
|
+
class: textStyles.text,
|
|
12
|
+
dangerouslySetInnerHTML: html.value
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
export {
|
|
16
|
+
ElmKatex
|
|
17
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { createHighlighter } from "shiki";
|
|
2
|
+
let highlighterPromise = null;
|
|
3
|
+
function getHighlighterSingleton() {
|
|
4
|
+
if (!highlighterPromise) {
|
|
5
|
+
highlighterPromise = createHighlighter({
|
|
6
|
+
langs: [
|
|
7
|
+
"abap",
|
|
8
|
+
"bash",
|
|
9
|
+
"c",
|
|
10
|
+
"clojure",
|
|
11
|
+
"coffeescript",
|
|
12
|
+
"c++",
|
|
13
|
+
"c#",
|
|
14
|
+
"css",
|
|
15
|
+
"dart",
|
|
16
|
+
"diff",
|
|
17
|
+
"docker",
|
|
18
|
+
"elixir",
|
|
19
|
+
"elm",
|
|
20
|
+
"erlang",
|
|
21
|
+
"f#",
|
|
22
|
+
"gherkin",
|
|
23
|
+
"glsl",
|
|
24
|
+
"go",
|
|
25
|
+
"graphql",
|
|
26
|
+
"groovy",
|
|
27
|
+
"haskell",
|
|
28
|
+
"html",
|
|
29
|
+
"java",
|
|
30
|
+
"javascript",
|
|
31
|
+
"json",
|
|
32
|
+
"julia",
|
|
33
|
+
"kotlin",
|
|
34
|
+
"latex",
|
|
35
|
+
"less",
|
|
36
|
+
"lisp",
|
|
37
|
+
"lua",
|
|
38
|
+
"makefile",
|
|
39
|
+
"markdown",
|
|
40
|
+
"matlab",
|
|
41
|
+
"mermaid",
|
|
42
|
+
"nix",
|
|
43
|
+
"objective-c",
|
|
44
|
+
"ocaml",
|
|
45
|
+
"pascal",
|
|
46
|
+
"perl",
|
|
47
|
+
"php",
|
|
48
|
+
"plaintext",
|
|
49
|
+
"powershell",
|
|
50
|
+
"prolog",
|
|
51
|
+
"protobuf",
|
|
52
|
+
"python",
|
|
53
|
+
"r",
|
|
54
|
+
"ruby",
|
|
55
|
+
"rust",
|
|
56
|
+
"sass",
|
|
57
|
+
"scala",
|
|
58
|
+
"scheme",
|
|
59
|
+
"scss",
|
|
60
|
+
"shell",
|
|
61
|
+
"sql",
|
|
62
|
+
"swift",
|
|
63
|
+
"toml",
|
|
64
|
+
"typescript",
|
|
65
|
+
"wasm",
|
|
66
|
+
"xml",
|
|
67
|
+
"yaml"
|
|
68
|
+
],
|
|
69
|
+
themes: [
|
|
70
|
+
"vitesse-light",
|
|
71
|
+
"vitesse-dark"
|
|
72
|
+
]
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
return highlighterPromise;
|
|
76
|
+
}
|
|
77
|
+
export {
|
|
78
|
+
getHighlighterSingleton
|
|
79
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
const toggle = "_toggle_1nxqa_1";
|
|
2
|
+
const summary = "_summary_1nxqa_14";
|
|
3
|
+
const content = "_content_1nxqa_60";
|
|
4
|
+
const footer = "_footer_1nxqa_80";
|
|
5
|
+
const styles = {
|
|
6
|
+
toggle,
|
|
7
|
+
"toggle-closed": "_toggle-closed_1nxqa_7",
|
|
8
|
+
"toggle-open": "_toggle-open_1nxqa_10",
|
|
9
|
+
summary,
|
|
10
|
+
"summary-open": "_summary-open_1nxqa_29",
|
|
11
|
+
"summary-closed": "_summary-closed_1nxqa_33",
|
|
12
|
+
"chevron-icon": "_chevron-icon_1nxqa_37",
|
|
13
|
+
"chevron-icon-open": "_chevron-icon-open_1nxqa_40",
|
|
14
|
+
"chevron-icon-closed": "_chevron-icon-closed_1nxqa_43",
|
|
15
|
+
"plus-icon": "_plus-icon_1nxqa_47",
|
|
16
|
+
"plus-icon-open": "_plus-icon-open_1nxqa_53",
|
|
17
|
+
"plus-icon-closed": "_plus-icon-closed_1nxqa_56",
|
|
18
|
+
content,
|
|
19
|
+
"content-open": "_content-open_1nxqa_73",
|
|
20
|
+
"content-closed": "_content-closed_1nxqa_76",
|
|
21
|
+
footer,
|
|
22
|
+
"footer-line": "_footer-line_1nxqa_99",
|
|
23
|
+
"footer-cross-icon": "_footer-cross-icon_1nxqa_106",
|
|
24
|
+
"footer-chevron-icon": "_footer-chevron-icon_1nxqa_109"
|
|
25
|
+
};
|
|
26
|
+
export {
|
|
27
|
+
content,
|
|
28
|
+
styles as default,
|
|
29
|
+
footer,
|
|
30
|
+
summary,
|
|
31
|
+
toggle
|
|
32
|
+
};
|