diff --git a/dist/styles/main.css b/dist/styles/main.css
index 9043356..0cfbf9b 100644
--- a/dist/styles/main.css
+++ b/dist/styles/main.css
@@ -8838,14 +8838,36 @@ details.collapse summary::-webkit-details-marker {
.bg-gradient-to-r {
background-image: linear-gradient(to right, var(--tw-gradient-stops));
}
+.from-blue-200 {
+ --tw-gradient-from: #bfdbfe var(--tw-gradient-from-position);
+ --tw-gradient-to: rgb(191 219 254 / 0) var(--tw-gradient-to-position);
+ --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
+}
.from-blue-400 {
--tw-gradient-from: #60a5fa var(--tw-gradient-from-position);
--tw-gradient-to: rgb(96 165 250 / 0) var(--tw-gradient-to-position);
--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
}
+.from-blue-600 {
+ --tw-gradient-from: #2563eb var(--tw-gradient-from-position);
+ --tw-gradient-to: rgb(37 99 235 / 0) var(--tw-gradient-to-position);
+ --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
+}
.to-blue-500 {
--tw-gradient-to: #3b82f6 var(--tw-gradient-to-position);
}
+.to-blue-600 {
+ --tw-gradient-to: #2563eb var(--tw-gradient-to-position);
+}
+.to-blue-300 {
+ --tw-gradient-to: #93c5fd var(--tw-gradient-to-position);
+}
+.to-blue-400 {
+ --tw-gradient-to: #60a5fa var(--tw-gradient-to-position);
+}
+.to-blue-200 {
+ --tw-gradient-to: #bfdbfe var(--tw-gradient-to-position);
+}
.decoration-slice {
-webkit-box-decoration-break: slice;
box-decoration-break: slice;
diff --git a/dist/vader/component.d.ts b/dist/vader/component.d.ts
new file mode 100644
index 0000000..0519ecb
--- /dev/null
+++ b/dist/vader/component.d.ts
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/dist/vader/vader.js b/dist/vader/vader.js
index c0209b5..fa906b9 100644
--- a/dist/vader/vader.js
+++ b/dist/vader/vader.js
@@ -1,74 +1,8 @@
-let dom = []
+// @ts-nocheck
+let dom = [];
let states = {};
-let worker = new Worker(new URL('./worker.js', import.meta.url));
-/**
- * @function markdown
- * @param {String} content
- * @description Allows you to convert markdown to html
- */
-function markdown(content) {
-
- let headers = content.match(/(#+)(.*)/g);
- if (headers) {
- headers.forEach((header) => {
- if(header.includes('/') || header.includes('<') || header.includes('>')){
- return
-
- }
- let level = header.split('#').length;
- content = content.replace(header, `${text}
`;
- });
- content = content.replace(/\[([^\]]+)\]\(([^)]+)\)/g, (match, text, url) => {
- return `${text}`;
- });
- content = content.replace(/!\[([^\]]+)\]\(([^)]+)\)/g, (match, alt, src) => {
- return ``;
- });
- content = content.split('\n').map((line, index, arr) => {
- if (line.match(/^\s*-\s+(.*?)$/gm)) {
- if (index === 0 || !arr[index - 1].match(/^\s*-\s+(.*?)$/gm)) {
- return `
code
)
+ result = result.replace(/`(.*?)`/g, (match, text) => {
+ return `${text}
`;
+ });
+
+ // Convert links (e.g., [Text](URL) => Text)
+ result = result.replace(/\[([^\]]+)\]\(([^)]+)\)/g, (match, text, url) => {
+ return `${text}`;
+ });
+
+ // Convert images (e.g., ![Alt](URL) => )
+ result = result.replace(/!\[([^\]]+)\]\(([^)]+)\)/g, (match, alt, src) => {
+ return ``;
+ });
+
+ // Convert unordered lists (e.g., * Item => code
)
- result = result.replace(/`(.*?)`/g, (match, text) => {
- return `${text}
`;
- });
-
- // Convert links (e.g., [Text](URL) => Text)
- result = result.replace(/\[([^\]]+)\]\(([^)]+)\)/g, (match, text, url) => {
- return `${text}`;
- });
-
- // Convert images (e.g., ![Alt](URL) => )
- result = result.replace(/!\[([^\]]+)\]\(([^)]+)\)/g, (match, alt, src) => {
- return ``;
- });
-
- // Convert unordered lists (e.g., * Item => Quote) + result = result.replace(/^\s*> (.*)$/gm, (match, text) => { + return `
${text}`; + }); + + // Convert tables (e.g., | Header | Cell | =>
Header | Cell |
---|
${headerCell} | `; }); - result = result.replace(/^\s*---\s*$/gm, '
---|
${cell} | `; }); + table += "
Header | Cell |
---|
${headerCell} | `; - }); - table += '
---|
${cell} | `; + if (!result.includes("")) { + throw new Error( + `Vader Error: You must enclose your html in a body tag for all components. \n\n${result}` + ); + } + /** + * @type {string[]} + * @description - grabbing all className attributes and replace them with class + */ + // @ts-ignore + result = result.replace(/classname/g, "class"); + /** + * @type {string[]} + * @description - grabbing all image tags and replace the src attribute with the absolute path + */ + // @ts-ignore + let images = result.match(/]*)>/g); + if (images) { + for (let i = 0; i < images.length; i++) { + let image = images[i]; + let src = image.match(/src="([^"]*)"/); + let alt = image.match(/alt="([^"]*)"/); + + if (!alt && !result.includes("")) { + throw new Error( + `Vader Error: You must include an alt attribute in the image tag \n\n${image} of class ${e.data.name}. ` + ); + } + if (src) { + src.forEach((s) => { + if ( + !s.includes("http") && + !result.includes("") + ) { + result = result.replace(`src="${s}"`, `src="${l}/${s}"`); + } else if ( + !s.includes("http") && + s.startsWith(".") && + !result.includes("") + ) { + throw new Error( + `Vader Error: You cannot use absolute paths since relative paths are not disabled in ${e.data.file}. Use relative paths instead. \n\n${s}` + ); + } }); - table += '
- Views are vader components which are used to display content to the user. They help you organize your webapp into different page files, while also allowing you to embed them in one another. - Views use the src/ directory and can be included in other views using the <include/> tag. - Alternatively their is a include() function to include views inside of your top level js files! -
-- There are no limitation to what you write inside of view files most the documentation you have read about vader is written in both html and markdown! - vader transpiles markdown code inside of your html/vjs files. - They also are returned as functions which means you can write js inside using $ { } . -
-- After defining routes to your pages - vader looks for relative links for example /about and /contact are valid links to your pages. - These will be changed to #/about.html and #/contact.html respectively. -
- -- You can disable relative paths - using #vader_disable_relative-paths comment at the top of your file. -
-+ Views are vader components which are used to display content to the user. They help you organize your webapp + into different page files, while also allowing you to embed them in one another. + Views use the src/ directory and can be included in + other views using the <include/> tag. + Alternatively their is a include() function to include views inside of + your top level js files! +
++ They offer remarkable flexibility, treating your content consistently whether it's written in Markdown or HTML. Your at no limitation to what you can write or do inside of then! + +
++ After defining routes to your pages - vader looks for relative links for example /about and /contact are valid links to your pages. + These will be changed to #/about.html and #/contact.html respectively. +
+ ++ Vader uses relative paths because often times it can be hard indexing folders. in a webapp - so vader uses relative paths to both the root public folder and the root src folder. + These two folders are required to be in the root of your project. +
++ You can disable relative paths - using #vader_disable_relative-paths + comment at the top of your file. +
++ Views have two ways of using js in your project views - we have the inline version ${'`'}