-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
70486c7
commit 7e7c574
Showing
21 changed files
with
4,380 additions
and
2,128 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
nodeLinker: node-modules | ||
nodeLinker: node-modules |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/** @jsxImportSource . */ | ||
|
||
import { useState } from 'react'; | ||
import BrowserWindow from '../../components/BrowserWindow'; | ||
|
||
function App() { | ||
const [show, setShow] = useState(false); | ||
|
||
return ( | ||
<div> | ||
<button onClick={() => setShow(!show)}>Toggle</button> | ||
|
||
<div $if={show}>Show 'em</div> | ||
</div> | ||
); | ||
} | ||
|
||
export default function IfDirectiveExample() { | ||
return ( | ||
<BrowserWindow> | ||
<App /> | ||
</BrowserWindow> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { createLocalJsxContext } from '../setup'; | ||
|
||
const ctx = createLocalJsxContext(); | ||
export const { jsx, jsxDEV, jsxs } = ctx; | ||
|
||
function ifDirectiveMiddleware(next, type, props, key) { | ||
if ('$if' in props) { | ||
if (!props.$if) return null; | ||
const { $if, ...rest } = props; | ||
props = rest; | ||
} | ||
|
||
return next(type, props, key); | ||
} | ||
|
||
ctx.addMiddlewares(ifDirectiveMiddleware); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/** @jsxImportSource . */ | ||
|
||
import BrowserWindow from '../../components/BrowserWindow'; | ||
|
||
function App() { | ||
return ( | ||
<div> | ||
<h1>Hello World</h1> | ||
<p>This is a paragraph</p> | ||
</div> | ||
); | ||
} | ||
|
||
export default function IndexExample() { | ||
return ( | ||
<BrowserWindow> | ||
<App /> | ||
</BrowserWindow> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/** @jsxImportSource . */ | ||
|
||
import BrowserWindow from '../../components/BrowserWindow'; | ||
|
||
function App() { | ||
return ( | ||
<div style={{ height: 100, overflow: 'auto' }}> | ||
<div style={{ height: 200 }} $onWheelActive={(ev) => ev.preventDefault()}> | ||
Try to scroll with the mouse wheel. You can't! | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
export default function OnWheelActiveExample() { | ||
return ( | ||
<BrowserWindow> | ||
<App /> | ||
</BrowserWindow> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import React from 'react'; | ||
import { createLocalJsxContext } from '../setup'; | ||
import { Ripple } from './ripple'; | ||
|
||
const ctx = createLocalJsxContext(); | ||
export const { jsx, jsxDEV, jsxs } = ctx; | ||
|
||
function rippleMiddleware(next, type, { $ripple, ...props }, key) { | ||
if ($ripple || (type === 'button' && $ripple !== false)) { | ||
return <Ripple>{next(type, props, key)}</Ripple>; | ||
} | ||
|
||
return next(type, props, key); | ||
} | ||
|
||
ctx.addMiddlewares(rippleMiddleware); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import React from 'react'; | ||
import { createLocalJsxContext } from '../setup'; | ||
import styles from './index.module.css'; | ||
|
||
const ctx = createLocalJsxContext(); | ||
export const { jsx, jsxDEV, jsxs } = ctx; | ||
|
||
function tooltipMiddleware(next, type, { $tooltip, ...props }, key) { | ||
if ($tooltip) { | ||
return ( | ||
<div className={styles.tooltipContainer}> | ||
{<div className={styles.tooltip}>{$tooltip}</div>} | ||
{next(type, props, key)} | ||
</div> | ||
); | ||
} | ||
|
||
return next(type, props, key); | ||
} | ||
|
||
ctx.addMiddlewares(tooltipMiddleware); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/** @jsxImportSource . */ | ||
|
||
import BrowserWindow from '../../components/BrowserWindow'; | ||
|
||
function App() { | ||
return <button $withClickCount>Click me</button>; | ||
} | ||
|
||
export default function WithClickCountExample() { | ||
return ( | ||
<BrowserWindow> | ||
<App /> | ||
</BrowserWindow> | ||
); | ||
} |
Oops, something went wrong.