Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
MalikWhitten67 committed Sep 28, 2023
1 parent df4e482 commit dd7f371
Show file tree
Hide file tree
Showing 9 changed files with 344 additions and 99 deletions.
72 changes: 21 additions & 51 deletions dist/styles/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -7797,9 +7797,6 @@ details.collapse summary::-webkit-details-marker {
.left-1\/2 {
left: 50%;
}
.top-1\/2 {
top: 50%;
}
.isolate {
isolation: isolate;
}
Expand Down Expand Up @@ -7893,6 +7890,9 @@ details.collapse summary::-webkit-details-marker {
.mt-8 {
margin-top: 2rem;
}
.mt-3 {
margin-top: 0.75rem;
}
.box-border {
box-sizing: border-box;
}
Expand Down Expand Up @@ -8444,6 +8444,12 @@ details.collapse summary::-webkit-details-marker {
.gap-5 {
gap: 1.25rem;
}
.gap-4 {
gap: 1rem;
}
.gap-1 {
gap: 0.25rem;
}
.space-x-2 > :not([hidden]) ~ :not([hidden]) {
--tw-space-x-reverse: 0;
margin-right: calc(0.5rem * var(--tw-space-x-reverse));
Expand Down Expand Up @@ -8813,10 +8819,18 @@ details.collapse summary::-webkit-details-marker {
--tw-bg-opacity: 1;
background-color: hsl(var(--b2) / var(--tw-bg-opacity));
}
.bg-gray-400 {
--tw-bg-opacity: 1;
background-color: rgb(156 163 175 / var(--tw-bg-opacity));
}
.bg-gray-700 {
--tw-bg-opacity: 1;
background-color: rgb(55 65 81 / var(--tw-bg-opacity));
}
.bg-gray-300 {
--tw-bg-opacity: 1;
background-color: rgb(209 213 219 / var(--tw-bg-opacity));
}
.bg-gradient-to-r {
background-image: linear-gradient(to right, var(--tw-gradient-stops));
}
Expand Down Expand Up @@ -8928,9 +8942,6 @@ details.collapse summary::-webkit-details-marker {
.p-5 {
padding: 1.25rem;
}
.p-8 {
padding: 2rem;
}
.px-1 {
padding-left: 0.25rem;
padding-right: 0.25rem;
Expand Down Expand Up @@ -9116,6 +9127,10 @@ details.collapse summary::-webkit-details-marker {
.text-transparent {
color: transparent;
}
.text-warning {
--tw-text-opacity: 1;
color: hsl(var(--wa) / var(--tw-text-opacity));
}
.text-white {
--tw-text-opacity: 1;
color: rgb(255 255 255 / var(--tw-text-opacity));
Expand Down Expand Up @@ -10780,39 +10795,6 @@ details.collapse summary::-webkit-details-marker {
margin-bottom: 0;
}
}
@media (min-width: 768px) {

.md\:drawer-open > .drawer-toggle {
display: none;
}

.md\:drawer-open > .drawer-toggle ~ .drawer-side {
pointer-events: auto;
visibility: visible;
position: sticky;
display: block;
width: auto;
overscroll-behavior: auto;
}

.md\:drawer-open > .drawer-toggle ~ .drawer-side > *:not(.drawer-overlay) {
transform: translateX(0%);
}

[dir="rtl"] .md\:drawer-open > .drawer-toggle ~ .drawer-side > *:not(.drawer-overlay) {
transform: translateX(0%);
}

.md\:drawer-open > .drawer-toggle:checked ~ .drawer-side {
pointer-events: auto;
visibility: visible;
}

.md\:drawer-open > .drawer-toggle ~ .drawer-side > .drawer-overlay {
cursor: default;
background-color: transparent;
}
}
@media (min-width: 1024px) {

.lg\:drawer-open > .drawer-toggle {
Expand Down Expand Up @@ -11342,14 +11324,6 @@ details.collapse summary::-webkit-details-marker {
}
@media (min-width: 768px) {

.md\:z-\[1\] {
z-index: 1;
}

.md\:hidden {
display: none;
}

.md\:max-w-xl {
max-width: 36rem;
}
Expand Down Expand Up @@ -11426,10 +11400,6 @@ details.collapse summary::-webkit-details-marker {
width: 60vw;
}

.xl\:w-screen {
width: 100vw;
}

.xl\:max-w-2xl {
max-width: 42rem;
}
Expand Down
74 changes: 51 additions & 23 deletions dist/vader/vader.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ let states = {};
* @description Allows you to convert markdown to html
*/
function markdown(content) {
const lines = content.split('\n');
const lines = content.split('\n').filter((line) => line !== '').map((line) => line.trim());

let result = '';

lines.forEach((line) => {
Expand All @@ -16,7 +17,8 @@ function markdown(content) {

let link = line.match(/\[(.*?)\]\((.*?)\)/g);
let ul = line.match(/^\-\s/);
let ol = line.match(/^\d\.\s/);
let ol = line.match(/^\d\.\s/);

let li = line.match(/^\s/);
let hr = line.match(/^\-\-\-\s/);
let blockquote = line.match(/^\>\s/);
Expand All @@ -25,6 +27,8 @@ function markdown(content) {

let codeBlock = line.match(/\`\`\`/g);
let codeBlockEnd = line.match(/\`\`\`/g);
let code = line.match(/\`(.*?)\`/g);



if (heading) {
Expand Down Expand Up @@ -55,15 +59,11 @@ function markdown(content) {
});
}
if (ul) {
line = line.replace(ul[0], `<li
style="list-style-type: disc;"
>`);
line = line.replace(ul[0], `<li style="list-style-type: disc;">`);
line += `</li>`;
}
if (ol) {
line = line.replace(ol[0], `<li
style="list-style-type: decimal;"
>`);
line = line.replace(ol[0], `<li style="list-style-type: decimal;">`);
line += `</li>`;
}
if (hr) {
Expand All @@ -83,15 +83,27 @@ function markdown(content) {
line = line.replace(i, `<img src="${src}" alt="${alt}"/>`).replace('!','')
});
}
if(codeBlock){
line = line.replace(codeBlock[0], `<code>`);

if (li) {
line = line.replace(li[0], `<li>`);
line += `</li>`;
}
if (codeBlock) {
line = line.replace(codeBlock[0], `<pre><code>`);
}
if(codeBlockEnd){
line = line.replace(codeBlockEnd[0], `</code>`);
// remove spaces
line = line.replace(/^\s+/g, '');
if (codeBlockEnd) {
line = line.replace(codeBlockEnd[0], `</code></pre>`);
}

if (code) {
code.forEach((c) => {
line = line.replace(c, `<code
style="background-color: #f5f5f5; padding: 5px; border-radius: 5px;
"
>${c.replace(/\`/g, "")}</code>`);
});
}




Expand Down Expand Up @@ -181,8 +193,18 @@ export class Component {
},
});
this.snapshots = [];

}

/**
* @method adapter
* @description Allows you to create an adapter - this is used to create custom logic
*
*
*/
adapter() {
return
}
init() {
this.registerComponent();
}
Expand Down Expand Up @@ -825,6 +847,10 @@ export class Component {
result += args[i];
}
}

result = result.replace(/\\n/g, '\n').trim()
// replace `
result = result.replace(/`/g, '\`').trim()

result = new Function("useRef", `return \`${result}\``)(useRef)

Expand Down Expand Up @@ -860,8 +886,10 @@ export class Component {
throw new SyntaxError(
`Image: ${element.outerHTML} alt attribute cannot be empty`
);

} else if (
element.hasAttribute("src") &&
!element.getAttribute("src")?.includes("http") || !element.getAttribute("src")?.includes("https") &&
!document.documentElement.outerHTML
.trim()
.includes("<!-- #vader-disable_accessibility -->")
Expand Down Expand Up @@ -955,16 +983,17 @@ export class Component {
}

if (
element.hasAttribute("src") &&
// @ts-ignore
element.getAttribute("src").startsWith("/") &&
!document.documentElement.outerHTML
.trim()
.includes("<!-- #vader-disable_relative-paths -->")
element.hasAttribute("src") &&
// @ts-ignore
!element.getAttribute("src").includes("http") &&
// @ts-ignore
!element.getAttribute("src").includes("https") &&
!document.documentElement.outerHTML.includes(`<!-- #vader-disable_relative-paths -->`)
) {
element.setAttribute(
"src",
`${window.location.origin}/public${element.getAttribute("src")}`
// @ts-ignore
`./public/${element.getAttribute("src")}`
);
}
break;
Expand Down Expand Up @@ -1107,7 +1136,6 @@ export const include = async (path) => {
}
return include(includePath).then((includeData) => {
data = data.replace(e, includeData);
console.log("included", includePath);
});
});

Expand Down
4 changes: 2 additions & 2 deletions src/components/nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<ul class="menu menu-horizontal px-1">
<li><a class="
xl:flex hidden
hover:text-blue-300">Show Case</a></li>
hover:text-blue-300">About</a></li>


<li><a href="/docs/base/getting-started" class="hover:text-blue-300">Docs</a></li>
Expand All @@ -47,7 +47,7 @@

</li>
${
$FULL_URL.includes('docs') ? `<li class=" lg:hidden xl:hidden md:hidden flex">
$FULL_URL.includes('docs') ? `<li class=" lg:hidden xl:hidden flex">
<a
onclick="document.querySelector('.drawer').classList.toggle('drawer-open')"
>
Expand Down
57 changes: 51 additions & 6 deletions src/components/sidedrawer.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
<div
ref="drawer"
class="drawer fixed mt-16 z[-1] lg:drawer-open md:drawer-open xl:drawer-open">
class="drawer fixed mt-16 z[-1] lg:drawer-open xl:drawer-open">
<input id="my-drawer-2" type="checkbox" class="drawer-toggle" />


<div class="drawer-side">
<label for="my-drawer-2" class="drawer-overlay"></label>
<ul class="menu p-4 w-64 min-h-full bg-base-100 border border-slate-100 text-base-content">
<!-- Sidebar content here -->
<div tabindex="0" class="collapse collapse-open collapse-plus ">
<input type="checkbox" />
<div tabindex="0" class="collapse
collapse-open
collapse-plus ">
<input type="checkbox"
onclick="
this.parentElement.classList.toggle('collapse-open')
this.parentElement.classList.toggle('collapse-close')
"
/>
<div class="collapse-title
after:collapse-arrow
">
Expand Down Expand Up @@ -49,9 +56,47 @@


</div>

<li><a>Sidebar Item 1</a></li>
<li><a>Sidebar Item 2</a></li>
<div tabindex="0"

class="collapse
cursor-pointer
collapse-open
collapse-plus ">
<input
onclick="
this.parentElement.classList.toggle('collapse-open')
this.parentElement.classList.toggle('collapse-close')
"
type="checkbox" />
<div class="collapse-title
after:collapse-arrow
">
Basics
</div>
<div class="collapse-content min-h-24 flex gap-5 flex-col">
<a href="/docs/basics/project-structure" class="
${
$FULL_URL.includes("/project-structure")
? "text-sky-500"
: "text-base-content"
}
">Project Structure</a>
<a href="/docs/basics/components" class="
${
$FULL_URL.includes("/components")
? "text-sky-500"
: "text-base-content"
}
">Components</a>


</div>


</div>

</ul>

</div>
Expand Down
Loading

0 comments on commit dd7f371

Please sign in to comment.