Vendored
+4
-1
@@ -8,7 +8,10 @@
|
||||
|
||||
"tailwindCSS.experimental.classRegex": [
|
||||
["cva\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"],
|
||||
["cx\\(([^)]*)\\)", "(?:'|\"|`)([^']*)(?:'|\"|`)"]
|
||||
["cx\\(([^)]*)\\)", "(?:'|\"|`)([^']*)(?:'|\"|`)"],
|
||||
// ["tw\\(([^)]*)\\)", "(?:'|\"|`)([^']*)(?:'|\"|`)"]
|
||||
|
||||
["tw`([^`]*)`", "([^`]*)"]
|
||||
],
|
||||
|
||||
// If you do not want to autofix some rules on save
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
globalThis.tw = function tw(strings: TemplateStringsArray, ...values: any[]) {
|
||||
return strings.reduce((acc, str, i) => {
|
||||
const value = values[i] ?? ""
|
||||
return acc + str + value
|
||||
}, "")
|
||||
}
|
||||
@@ -36,6 +36,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="module" src="./dx-helper.ts"></script>
|
||||
<script type="module" src="/src/main.tsx"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Vendored
+2
@@ -21,6 +21,8 @@ declare global {
|
||||
export interface Window {
|
||||
SENTRY_RELEASE: typeof SENTRY_RELEASE
|
||||
}
|
||||
|
||||
export function tw(strings: TemplateStringsArray, ...values: any[]): string
|
||||
}
|
||||
|
||||
export {}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { Checkbox } from "@renderer/components/ui/checkbox"
|
||||
import { ShikiHighLighter } from "@renderer/components/ui/code-highlighter"
|
||||
import { Image } from "@renderer/components/ui/image"
|
||||
import { LinkWithTooltip } from "@renderer/components/ui/link"
|
||||
@@ -90,6 +91,20 @@ export const parseHtml = async (
|
||||
}
|
||||
return createElement("p", undefined, props.children)
|
||||
},
|
||||
hr: ({ node, ...props }) => createElement("hr", {
|
||||
...props,
|
||||
className: tw`scale-x-50`,
|
||||
}),
|
||||
input: ({ node, ...props }) => {
|
||||
if (props.type === "checkbox") {
|
||||
return createElement(Checkbox, {
|
||||
...props,
|
||||
disabled: false,
|
||||
className: tw`pointer-events-none mr-2`,
|
||||
})
|
||||
}
|
||||
return createElement("input", props)
|
||||
},
|
||||
pre: ({ node, ...props }) => {
|
||||
if (!props.children) return null
|
||||
|
||||
|
||||
Reference in New Issue
Block a user