Skip to content

Commit

Permalink
path resolving fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
MalikWhitten67 committed Jan 21, 2024
1 parent 03e21e1 commit 3a721a1
Show file tree
Hide file tree
Showing 13 changed files with 64 additions and 64 deletions.
2 changes: 1 addition & 1 deletion pages/404/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
let {Component, useParams} = await import('/vader.js')
let {Component, useParams} = await await import(Vader.root + '//vader.js')

class Index extends Component{
constructor(props){
Expand Down
26 changes: 13 additions & 13 deletions pages/docs/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
let { Component, useState } = await import('/vader.js')
import { Nav }from '/dist/src/Nav.js'
import { Home } from '/dist/src/pages/docs/overview/index.js'
let { Component, useState } = await await import(Vader.root + '//vader.js')
let { Nav } = await import(Vader.root + '/src/Nav.js')
let { Home } = await import(Vader.root + '/src/pages/docs/overview/index.js')

window.Vader['docs'] = {
'overview': {
Expand Down Expand Up @@ -40,35 +40,35 @@ class Index extends Component {
<li><a
class='font-semibold'
onClick="${this.bind(`this.response.setQuery({ page: 'getting-started' }); `, false, false, '2rkp1b05cbc', "setPath,", setPath)}", usesEvent="true", eventType="onClick",data-ref="2rkp1b05cbc",
onClick="${this.bind(`this.response.setQuery({ page: 'getting-started' }); `, false, false, 'ba4mq3dohq', "setPath,", setPath)}", usesEvent="true", eventType="onClick",data-ref="ba4mq3dohq",
>Getting Started</a></li>
<li class='p-1'><a
class="${`
${path == '/docs/getting-started/installation' ? 'font-semibold text-blue-500 font-sans' : ''
}
`}",
onClick="${this.bind(`this.response.setQuery({ page: 'getting-started', subpage: 'installation' }); `, false, false, 'ztyjefuzv1', "setPath,", setPath)}", usesEvent="true", eventType="onClick",data-ref="ztyjefuzv1",
onClick="${this.bind(`this.response.setQuery({ page: 'getting-started', subpage: 'installation' }); `, false, false, '30lzaadjz0i', "setPath,", setPath)}", usesEvent="true", eventType="onClick",data-ref="30lzaadjz0i",
>Installation</a></li>
<li class='p-1'><a
class="${`
cursor-pointer
${path == '/docs/getting-started/project-structure' ? 'font-semibold text-blue-500 font-sans' : ''
}
`}",
onClick="${this.bind(`this.response.setQuery({ page: 'getting-started', subpage: 'project-structure' }); `, false, false, '08hs78caqoji', "setPath,", setPath)}", usesEvent="true", eventType="onClick",data-ref="08hs78caqoji",
onClick="${this.bind(`this.response.setQuery({ page: 'getting-started', subpage: 'project-structure' }); `, false, false, 'ht7dppuhot', "setPath,", setPath)}", usesEvent="true", eventType="onClick",data-ref="ht7dppuhot",
>Project Structure</a></li>
<li class="p-1">
<a
class="${`${path == '/docs/getting-started/routing' ? 'font-semibold text-blue-500 font-sans' : ''}`}",
onClick="${this.bind(`this.response.setQuery({ page: 'getting-started', subpage: 'routing' }); `, false, false, 'vnr0112rdlo', "setPath,", setPath)}", usesEvent="true", eventType="onClick",data-ref="vnr0112rdlo",
onClick="${this.bind(`this.response.setQuery({ page: 'getting-started', subpage: 'routing' }); `, false, false, '0ye1yd81gmda', "setPath,", setPath)}", usesEvent="true", eventType="onClick",data-ref="0ye1yd81gmda",
>Routing</a></li>
<li class="p-1">
<a
class="${`${path == '/docs/getting-started/deployment' ? 'font-semibold text-blue-500 font-sans' : ''}`}",
onClick="${this.bind(`this.response.setQuery({ page: 'getting-started', subpage: 'deployment' }); `, false, false, 'urq8uehj7qp', "setPath,", setPath)}", usesEvent="true", eventType="onClick",data-ref="urq8uehj7qp",
onClick="${this.bind(`this.response.setQuery({ page: 'getting-started', subpage: 'deployment' }); `, false, false, 'vkqbif0zgua', "setPath,", setPath)}", usesEvent="true", eventType="onClick",data-ref="vkqbif0zgua",
>Deployment</a></li>
Expand Down Expand Up @@ -106,7 +106,7 @@ class Index extends Component {
<ul class='p-5 fixed flex flex-col text-sm gap-5'>
<li
onClick="${this.bind(`this.response.setQuery({ page: 'getting-started' }); `, false, false, 'ddtt7lvcjie', "setPath,", setPath)}", usesEvent="true", eventType="onClick",data-ref="ddtt7lvcjie",
onClick="${this.bind(`this.response.setQuery({ page: 'getting-started' }); `, false, false, 'j6qmzevm17q', "setPath,", setPath)}", usesEvent="true", eventType="onClick",data-ref="j6qmzevm17q",
class='cursor-pointer'
>
<a class='flex gap-2 hero'>
Expand Down Expand Up @@ -177,7 +177,7 @@ class Index extends Component {
${
path.includes('getting-started') ? `
<li
onClick="${this.bind(`this.response.setQuery({ page: 'getting-started', subpage: 'installation' }); `, false, false, '9l302q84pxf', "setPath,", setPath)}", usesEvent="true", eventType="onClick",data-ref="9l302q84pxf",
onClick="${this.bind(`this.response.setQuery({ page: 'getting-started', subpage: 'installation' }); `, false, false, 'wi3j5ir65vh', "setPath,", setPath)}", usesEvent="true", eventType="onClick",data-ref="wi3j5ir65vh",
class='cursor-pointer'
>
<a
Expand All @@ -197,7 +197,7 @@ class Index extends Component {
</a>
</li>
<li
onClick="${this.bind(`this.response.setQuery({ page: 'getting-started', subpage: 'project-structure' }); `, false, false, '8qpbu8wrnbd', "setPath,", setPath)}", usesEvent="true", eventType="onClick",data-ref="8qpbu8wrnbd",
onClick="${this.bind(`this.response.setQuery({ page: 'getting-started', subpage: 'project-structure' }); `, false, false, 'rv7cy0gzmud', "setPath,", setPath)}", usesEvent="true", eventType="onClick",data-ref="rv7cy0gzmud",
class='cursor-pointer'
>
<a class='flex gap-2 hero'>
Expand All @@ -212,7 +212,7 @@ class Index extends Component {
</a>
</li>
<li
onClick="${this.bind(`this.response.setQuery({ page: 'getting-started', subpage: 'routing' }); `, false, false, 'kx9fnfuj5re', "setPath,", setPath)}", usesEvent="true", eventType="onClick",data-ref="kx9fnfuj5re",
onClick="${this.bind(`this.response.setQuery({ page: 'getting-started', subpage: 'routing' }); `, false, false, 'jscxt805id', "setPath,", setPath)}", usesEvent="true", eventType="onClick",data-ref="jscxt805id",
class='cursor-pointer'
>
<a class='flex gap-2 hero'>
Expand All @@ -229,7 +229,7 @@ class Index extends Component {
</a>
</li>
<li
onClick="${this.bind(`this.response.setQuery({ page: 'getting-started', subpage: 'deployment' }); `, false, false, 'kbtws7ioqf9', "setPath,", setPath)}", usesEvent="true", eventType="onClick",data-ref="kbtws7ioqf9",
onClick="${this.bind(`this.response.setQuery({ page: 'getting-started', subpage: 'deployment' }); `, false, false, 'qx1qvlqu9mi', "setPath,", setPath)}", usesEvent="true", eventType="onClick",data-ref="qx1qvlqu9mi",
class='cursor-pointer'
>
<a class='flex gap-2 hero'>
Expand Down
25 changes: 12 additions & 13 deletions pages/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { Component, useState, strictMount, useRef } from "/vader.js"
import {Button} from "/dist/src/button.js"
import {Nav }from '/dist/src/Nav.js'
import { ComponentExample} from "/dist/src/examples/component.js"

let { Component, useState, strictMount, useRef } = await import(Vader.root + '//vader.js')
let {Button} = await import(Vader.root + '/src/button.js')
let {Nav } = await import(Vader.root + '/src/Nav.js')
let { ComponentExample} = await import(Vader.root + '/src/examples/component.js')
export default class Index extends Component {
constructor(props) {
super(props);
Expand All @@ -11,11 +10,11 @@ export default class Index extends Component {
}
render() {

let [/** @type {String} */view, setView] = this.useState('view', 'index')

let [/** @type {String} */view, setView] = this.useState('view', 'index')


let [/** @type {Boolean} */loaded, setLoaded] = this.useState('loaded', false)

let [/** @type {Boolean} */loaded, setLoaded] = this.useState('loaded', false)


let embedref = this.useRef('embedref', null)

Expand Down Expand Up @@ -79,7 +78,7 @@ export default class Index extends Component {
<button
class="btn btn-ghost shadow border-slate-200 border hover:bg-white btn-sm w-fit text-center align-middle mx-auto mt-5"
onClick="${this.bind(`setView(view === 'index' ? 'stackblitz' : 'index'); console.log(view); `, false, false, 'pmq1yyr1prc', "setView,view,embedref,", setView, view, embedref)}", usesEvent="true", eventType="onClick",data-ref="pmq1yyr1prc",
onClick="${this.bind(`setView(view === 'index' ? 'stackblitz' : 'index'); console.log(view); `, false, false, 'w5xo1rydzs', "setView,view,embedref,", setView, view, embedref)}", usesEvent="true", eventType="onClick",data-ref="w5xo1rydzs",
>
${
view === 'index' ? 'Click to View Code' : 'Click to View Example Component'
Expand All @@ -97,7 +96,7 @@ export default class Index extends Component {
: `
<embed
ref="${embedref.bind}",
onLoad="${this.bind(``, false, false, '0kjdxrcfucjb', "setLoaded,loaded,", setLoaded, loaded)}", usesEvent="true", eventType="onLoad",data-ref="0kjdxrcfucjb",
onLoad="${this.bind(``, false, false, '8cd1g6vi6fb', "setLoaded,loaded,", setLoaded, loaded)}", usesEvent="true", eventType="onLoad",data-ref="8cd1g6vi6fb",
class="h-[600px] w-[600px] rounded "
src="https://stackblitz.com/edit/web-platform-aanbgw?file=dev%2Fpages%2Findex.jsx&view=editor"
style={{ width: '100%', height: '100%' }}
Expand All @@ -120,6 +119,6 @@ export default class Index extends Component {
}






//wascompiled
6 changes: 3 additions & 3 deletions src/Nav.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Component } from '/vader.js'
import {SearchBar} from './search.js'
let { Component } = await import(Vader.root + '//vader.js')
let {SearchBar} = await import(Vader.root + '/src/search.js')
export class Nav extends Component {
constructor(props) {
super(props)
Expand All @@ -8,7 +8,7 @@ export class Nav extends Component {
return `
<div class="navbar sticky top-0 z-[9999] bg-white ">
<div class="navbar-start"
onClick="${this.bind(`this.response.redirect('/'); `, false, false, '88xzmtfqgv2', "", null)}", usesEvent="true", eventType="onClick",data-ref="88xzmtfqgv2",
onClick="${this.bind(`this.response.redirect('/'); `, false, false, 's7eifr793j', "", null)}", usesEvent="true", eventType="onClick",data-ref="s7eifr793j",
>
<img
Expand Down
4 changes: 2 additions & 2 deletions src/button.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component } from "/vader.js"
let { Component } = await import(Vader.root + '//vader.js')

export class Button extends Component{
constructor(props){
Expand All @@ -11,7 +11,7 @@ export class Button extends Component{
return `
<button class="${this.props?.class}",
name='button'
onClick="${this.bind(`console.log(this); this.parentNode.response.redirect(this.props?.redirect); `, false, false, 'lmfqp4vsa1n', "", null)}", usesEvent="true", eventType="onClick",data-ref="lmfqp4vsa1n",
onClick="${this.bind(`console.log(this); this.parentNode.response.redirect(this.props?.redirect); `, false, false, 'm7xtffjzn6m', "", null)}", usesEvent="true", eventType="onClick",data-ref="m7xtffjzn6m",
>${this.props?.children}</button>
`
Expand Down
4 changes: 2 additions & 2 deletions src/collapse.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, useState } from "/vader.js"
let { Component, useState } = await import(Vader.root + '//vader.js')

export class Collapse extends Component{
constructor(props){
Expand All @@ -16,7 +16,7 @@ export class Collapse extends Component{
>
<button class="${this.props?.class}",
onClick="${this.bind(`setOpen(!open); this.props?.click(this.props?.redirectTo); `, false, false, '60jnfrlriyj', "setOpen,open,", setOpen, open)}", usesEvent="true", eventType="onClick",data-ref="60jnfrlriyj", >
onClick="${this.bind(`setOpen(!open); this.props?.click(this.props?.redirectTo); `, false, false, '00cj3rqug8xqk', "setOpen,open,", setOpen, open)}", usesEvent="true", eventType="onClick",data-ref="00cj3rqug8xqk", >
${this.props?.title}
</button>
<div
Expand Down
6 changes: 3 additions & 3 deletions src/examples/component.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Component, useState, strictMount, useRef} from '/vader.js'
let {Component, useState, strictMount, useRef} = await import(Vader.root + '//vader.js')

class Video extends Component{
constructor(props){
Expand Down Expand Up @@ -27,7 +27,7 @@ class Video extends Component{
ref="${likedRef.bind}",
xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" strokeWidth="${1.5}", stroke="currentColor"
class="${`w-6 h-6 cursor-pointer ${liked ? 'fill-error stroke-error' : ''}`}",
onClick="${this.bind(`setLiked(!liked, likedRef.bind); `, false, false, '9bhmzeuce0k', "setLiked,,liked,likedRef,event,", setLiked, liked, likedRef, event)}", usesEvent="true", eventType="onClick",data-ref="9bhmzeuce0k",
onClick="${this.bind(`setLiked(!liked, likedRef.bind); `, false, false, '9toqkdxafxq', "setLiked,,liked,likedRef,event,", setLiked, liked, likedRef, event)}", usesEvent="true", eventType="onClick",data-ref="9toqkdxafxq",
>
<path strokeLinecap="round" strokeLinejoin="round" d="M21 8.25c0-2.485-2.099-4.5-4.688-4.5-1.935 0-3.597 1.126-4.312 2.733-.715-1.607-2.377-2.733-4.313-2.733C5.1 3.75 3 5.765 3 8.25c0 7.22 9 12 9 12s9-4.78 9-12Z" />
</svg>
Expand Down Expand Up @@ -107,7 +107,7 @@ export class ComponentExample extends Component{
<input
onInput="${this.bind(filterVideos, true, false, 'gw856tfwt4w', "e, test", event, videos)}", usesEvent="true", eventType="onInput",data-ref="gw856tfwt4w",
onInput="${this.bind(filterVideos, true, false, '4aylv5n28wx', "e, test", event, videos)}", usesEvent="true", eventType="onInput",data-ref="4aylv5n28wx",
type="text" class="input input-bordered rounded-full" placeholder="Search..." />
</div>
<h1 class='font-bold text-xl mx-5 p-2' ref="${searchHook.bind}", >${videos.length} Videos</h1>
Expand Down
4 changes: 2 additions & 2 deletions src/pages/docs/deployment/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component } from "/vader.js"
let { Component } = await import(Vader.root + '//vader.js')

export class Deployment extends Component {
constructor(props) {
Expand All @@ -13,7 +13,7 @@ export class Deployment extends Component {
<div class="text-sm breadcrumbs">
<ul>
<li><a class='no-underline'
onClick="${this.bind(`this.props?.swapPage({ page: 'getting-started', subpage: '' }); `, false, false, 'jyogbu1tvei', "", null)}", usesEvent="true", eventType="onClick",data-ref="jyogbu1tvei",
onClick="${this.bind(`this.props?.swapPage({ page: 'getting-started', subpage: '' }); `, false, false, 'rx6arbdtdej', "", null)}", usesEvent="true", eventType="onClick",data-ref="rx6arbdtdej",
>Getting Started</a></li>
<li><a class='font-semibold'>Deployment</a></li>
</ul>
Expand Down
4 changes: 2 additions & 2 deletions src/pages/docs/hooks/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {useState, useRef, Component} from '/vader.js'
let {useState, useRef, Component} = await import(Vader.root + '//vader.js')
const data = {
useState: `
<div>
Expand Down Expand Up @@ -36,7 +36,7 @@ class Hooks extends Component {
<li class='list-inside' >
<a
class='text-blue-500 cursor-pointer hover:underline'
onClick="${this.bind(`this.props?.click('/docs/hooks/useState'); `, false, false, 'mgjfc6u94sl', "", null)}", usesEvent="true", eventType="onClick",data-ref="mgjfc6u94sl", >
onClick="${this.bind(`this.props?.click('/docs/hooks/useState'); `, false, false, 'btjfb6edb5', "", null)}", usesEvent="true", eventType="onClick",data-ref="btjfb6edb5", >
useState
</a>
</li>
Expand Down
Loading

0 comments on commit 3a721a1

Please sign in to comment.