Skip to content

Commit

Permalink
change package manager install component
Browse files Browse the repository at this point in the history
  • Loading branch information
jolbol1 committed Sep 21, 2024
1 parent 85c1889 commit 69b3050
Show file tree
Hide file tree
Showing 48 changed files with 1,186 additions and 410 deletions.
64 changes: 31 additions & 33 deletions contentlayer.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@ import {
defineDocumentType,
defineNestedType,
makeSource,
} from "contentlayer2/source-files";
import rehypeAutolinkHeadings from "rehype-autolink-headings";
import rehypePrettyCode from "rehype-pretty-code";
import rehypeSlug from "rehype-slug";
import { codeImport } from "remark-code-import";
import remarkGfm from "remark-gfm";
import { visit } from "unist-util-visit";
} from "contentlayer2/source-files"
import rehypeAutolinkHeadings from "rehype-autolink-headings"
import rehypePrettyCode from "rehype-pretty-code"
import rehypeSlug from "rehype-slug"
import { codeImport } from "remark-code-import"
import remarkGfm from "remark-gfm"
import { visit } from "unist-util-visit"

import { rehypeComponent } from "./src/lib/rehype-component";
import { rehypeNpmCommand } from "./src/lib/rehype-npm-command";
import { rehypeComponent } from "./src/lib/rehype-component"

/** @type {import('contentlayer2/source-files').ComputedFields} */
const computedFields = {
Expand All @@ -23,7 +22,7 @@ const computedFields = {
type: "string",
resolve: (doc) => doc._raw.flattenedPath.split("/").slice(1).join("/"),
},
};
}

const LinksProperties = defineNestedType(() => ({
name: "LinksProperties",
Expand All @@ -35,7 +34,7 @@ const LinksProperties = defineNestedType(() => ({
type: "string",
},
},
}));
}))

export const Doc = defineDocumentType(() => ({
name: "Doc",
Expand Down Expand Up @@ -75,7 +74,7 @@ export const Doc = defineDocumentType(() => ({
},
},
computedFields,
}));
}))

export default makeSource({
contentDirPath: "./src/content",
Expand All @@ -88,26 +87,26 @@ export default makeSource({
() => (tree) => {
visit(tree, (node) => {
if (node?.type === "element" && node?.tagName === "pre") {
const [codeEl] = node.children;
const [codeEl] = node.children
if (codeEl.tagName !== "code") {
return;
return
}

if (codeEl.data?.meta) {
// Extract event from meta and pass it down the tree.
const regex = /event="([^"]*)"/;
const match = codeEl.data?.meta.match(regex);
const regex = /event="([^"]*)"/
const match = codeEl.data?.meta.match(regex)
if (match) {
node.__event__ = match ? match[1] : null;
codeEl.data.meta = codeEl.data.meta.replace(regex, "");
node.__event__ = match ? match[1] : null
codeEl.data.meta = codeEl.data.meta.replace(regex, "")
}
}

node.__rawString__ = codeEl.children?.[0].value;
node.__src__ = node.properties?.__src__;
node.__style__ = node.properties?.__style__;
node.__rawString__ = codeEl.children?.[0].value
node.__src__ = node.properties?.__src__
node.__style__ = node.properties?.__style__
}
});
})
},
[
rehypePrettyCode,
Expand All @@ -119,33 +118,32 @@ export default makeSource({
visit(tree, (node) => {
if (node?.type === "element" && node?.tagName === "figure") {
if (!("data-rehype-pretty-code-figure" in node.properties)) {
return;
return
}

const preElement = node.children.at(-1);
const preElement = node.children.at(-1)
if (preElement.tagName !== "pre") {
return;
return
}

preElement.properties["__withMeta__"] =
node.children.at(0).tagName === "div";
preElement.properties["__rawString__"] = node.__rawString__;
node.children.at(0).tagName === "div"
preElement.properties["__rawString__"] = node.__rawString__

if (node.__src__) {
preElement.properties["__src__"] = node.__src__;
preElement.properties["__src__"] = node.__src__
}

if (node.__event__) {
preElement.properties["__event__"] = node.__event__;
preElement.properties["__event__"] = node.__event__
}

if (node.__style__) {
preElement.properties["__style__"] = node.__style__;
preElement.properties["__style__"] = node.__style__
}
}
});
})
},
rehypeNpmCommand,
[
rehypeAutolinkHeadings,
{
Expand All @@ -157,4 +155,4 @@ export default makeSource({
],
],
},
});
})
88 changes: 44 additions & 44 deletions public/sitemap.xml
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:news="http://www.google.com/schemas/sitemap-news/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:mobile="http://www.google.com/schemas/sitemap-mobile/1.0" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:video="http://www.google.com/schemas/sitemap-video/1.1">
<url><loc>https://jollyui.dev/helloworld</loc><lastmod>2024-08-31T22:46:20.557Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev</loc><lastmod>2024-08-31T22:46:20.558Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/changelog</loc><lastmod>2024-08-31T22:46:20.558Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs</loc><lastmod>2024-08-31T22:46:20.558Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/breadcrumbs</loc><lastmod>2024-08-31T22:46:20.558Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/button</loc><lastmod>2024-08-31T22:46:20.558Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/calendar</loc><lastmod>2024-08-31T22:46:20.558Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/checkbox-group</loc><lastmod>2024-08-31T22:46:20.558Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/checkbox</loc><lastmod>2024-08-31T22:46:20.558Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/color-primitives</loc><lastmod>2024-08-31T22:46:20.558Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/color</loc><lastmod>2024-08-31T22:46:20.558Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/combobox</loc><lastmod>2024-08-31T22:46:20.558Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/date-picker</loc><lastmod>2024-08-31T22:46:20.558Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/date-range-picker</loc><lastmod>2024-08-31T22:46:20.558Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/datefield</loc><lastmod>2024-08-31T22:46:20.558Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/dialog</loc><lastmod>2024-08-31T22:46:20.558Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/dropzone</loc><lastmod>2024-08-31T22:46:20.558Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/file-trigger</loc><lastmod>2024-08-31T22:46:20.558Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/form</loc><lastmod>2024-08-31T22:46:20.558Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/grid-list</loc><lastmod>2024-08-31T22:46:20.558Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/group</loc><lastmod>2024-08-31T22:46:20.558Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/link</loc><lastmod>2024-08-31T22:46:20.558Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/list-box</loc><lastmod>2024-08-31T22:46:20.558Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/menu</loc><lastmod>2024-08-31T22:46:20.558Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/meter</loc><lastmod>2024-08-31T22:46:20.558Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/modal</loc><lastmod>2024-08-31T22:46:20.558Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/numberfield</loc><lastmod>2024-08-31T22:46:20.558Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/popover</loc><lastmod>2024-08-31T22:46:20.558Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/progress</loc><lastmod>2024-08-31T22:46:20.558Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/radio-group</loc><lastmod>2024-08-31T22:46:20.558Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/range-calendar</loc><lastmod>2024-08-31T22:46:20.558Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/searchfield</loc><lastmod>2024-08-31T22:46:20.558Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/select</loc><lastmod>2024-08-31T22:46:20.558Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/slider</loc><lastmod>2024-08-31T22:46:20.558Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/switch</loc><lastmod>2024-08-31T22:46:20.558Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/tabs</loc><lastmod>2024-08-31T22:46:20.558Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/tag-group</loc><lastmod>2024-08-31T22:46:20.558Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/textfield</loc><lastmod>2024-08-31T22:46:20.558Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/timefield</loc><lastmod>2024-08-31T22:46:20.558Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/toggle</loc><lastmod>2024-08-31T22:46:20.558Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/toolbar</loc><lastmod>2024-08-31T22:46:20.558Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/tooltip</loc><lastmod>2024-08-31T22:46:20.558Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/installation/cli</loc><lastmod>2024-08-31T22:46:20.558Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/installation</loc><lastmod>2024-08-31T22:46:20.558Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/helloworld</loc><lastmod>2024-09-21T08:41:09.571Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev</loc><lastmod>2024-09-21T08:41:09.571Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/changelog</loc><lastmod>2024-09-21T08:41:09.571Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs</loc><lastmod>2024-09-21T08:41:09.571Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/breadcrumbs</loc><lastmod>2024-09-21T08:41:09.571Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/button</loc><lastmod>2024-09-21T08:41:09.571Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/calendar</loc><lastmod>2024-09-21T08:41:09.571Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/checkbox-group</loc><lastmod>2024-09-21T08:41:09.571Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/checkbox</loc><lastmod>2024-09-21T08:41:09.571Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/color-primitives</loc><lastmod>2024-09-21T08:41:09.571Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/color</loc><lastmod>2024-09-21T08:41:09.571Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/combobox</loc><lastmod>2024-09-21T08:41:09.571Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/date-picker</loc><lastmod>2024-09-21T08:41:09.571Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/date-range-picker</loc><lastmod>2024-09-21T08:41:09.571Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/datefield</loc><lastmod>2024-09-21T08:41:09.571Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/dialog</loc><lastmod>2024-09-21T08:41:09.571Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/dropzone</loc><lastmod>2024-09-21T08:41:09.571Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/file-trigger</loc><lastmod>2024-09-21T08:41:09.571Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/form</loc><lastmod>2024-09-21T08:41:09.571Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/grid-list</loc><lastmod>2024-09-21T08:41:09.571Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/group</loc><lastmod>2024-09-21T08:41:09.571Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/link</loc><lastmod>2024-09-21T08:41:09.571Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/list-box</loc><lastmod>2024-09-21T08:41:09.571Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/menu</loc><lastmod>2024-09-21T08:41:09.571Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/meter</loc><lastmod>2024-09-21T08:41:09.571Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/modal</loc><lastmod>2024-09-21T08:41:09.571Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/numberfield</loc><lastmod>2024-09-21T08:41:09.571Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/popover</loc><lastmod>2024-09-21T08:41:09.571Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/progress</loc><lastmod>2024-09-21T08:41:09.571Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/radio-group</loc><lastmod>2024-09-21T08:41:09.571Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/range-calendar</loc><lastmod>2024-09-21T08:41:09.571Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/searchfield</loc><lastmod>2024-09-21T08:41:09.571Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/select</loc><lastmod>2024-09-21T08:41:09.571Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/slider</loc><lastmod>2024-09-21T08:41:09.571Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/switch</loc><lastmod>2024-09-21T08:41:09.571Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/tabs</loc><lastmod>2024-09-21T08:41:09.571Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/tag-group</loc><lastmod>2024-09-21T08:41:09.571Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/textfield</loc><lastmod>2024-09-21T08:41:09.571Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/timefield</loc><lastmod>2024-09-21T08:41:09.571Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/toggle</loc><lastmod>2024-09-21T08:41:09.571Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/toolbar</loc><lastmod>2024-09-21T08:41:09.571Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/components/tooltip</loc><lastmod>2024-09-21T08:41:09.571Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/installation/cli</loc><lastmod>2024-09-21T08:41:09.571Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
<url><loc>https://jollyui.dev/docs/installation</loc><lastmod>2024-09-21T08:41:09.571Z</lastmod><changefreq>daily</changefreq><priority>0.7</priority></url>
</urlset>
13 changes: 13 additions & 0 deletions src/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -268,3 +268,16 @@
margin-bottom: -2px;
}
}

.install-selected[data-selected="true"]:after {
position: absolute;
right: 8px;
bottom: -1.5px;
left: 8px;
z-index: 1;
height: 2px;
border-radius: 2px;
content: "";
background-color: hsl(var(--primary));
transition: background-color 0.25s;
}
Loading

0 comments on commit 69b3050

Please sign in to comment.