forked from hyperbrew/bolt-cep
-
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.
* add svelte template * dependency fixes, App > main, won't run on build * improvements to tempate testing * svelte fixes * svelte fully functional Co-authored-by: Martin Lindberg <[email protected]>
- Loading branch information
1 parent
0c4b2eb
commit ba544c3
Showing
19 changed files
with
478 additions
and
87 deletions.
There are no files selected for viewing
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,26 @@ | ||
export const debugAll = [ | ||
{ | ||
mainPath: "./template-react/index.html", // DEBUG the React Template | ||
name: "template-react", | ||
panelDisplayName: "Bolt CEP - React", | ||
autoVisible: true, | ||
width: 600, | ||
height: 650, | ||
}, | ||
{ | ||
mainPath: "./template-vue/index.html", // DEBUG the Vue Template | ||
name: "template-vue", | ||
panelDisplayName: "Bolt CEP - Vue", | ||
autoVisible: true, | ||
width: 600, | ||
height: 650, | ||
}, | ||
{ | ||
mainPath: "./template-svelte/index.html", // DEBUG the Svelte Template | ||
name: "template-svelte", | ||
panelDisplayName: "Bolt CEP - Svelte", | ||
autoVisible: true, | ||
width: 600, | ||
height: 650, | ||
}, | ||
]; |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 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 @@ | ||
@import "../variables.scss"; |
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 @@ | ||
@import "../variables.scss"; |
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,13 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" href="/favicon.ico" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Bolt CEP Svelte</title> | ||
</head> | ||
<body> | ||
<div id="root"></div> | ||
<script type="module" src="./main.ts"></script> | ||
</body> | ||
</html> |
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 @@ | ||
@import "../variables.scss"; |
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,106 @@ | ||
<script lang="ts"> | ||
import { onMount } from "svelte"; | ||
import { fs, os, path } from "../lib/node"; | ||
import { csi, evalES, evalFile, openLinkInBrowser } from "../lib/utils"; | ||
import viteLogo from "../assets/vite.svg"; | ||
import svelteLogo from "../assets/svelte.svg"; | ||
import tsLogo from "../assets/typescript.svg"; | ||
import sassLogo from "../assets/sass.svg"; | ||
import nodeJs from "../assets/node-js.svg"; | ||
import adobe from "../assets/adobe.svg"; | ||
import bolt from "../assets/bolt-cep.svg"; | ||
import "../index.scss"; | ||
import "./main.scss"; | ||
let count = 0; | ||
const jsxTest = () => { | ||
console.log(evalES(`helloWorld("${csi.getApplicationID()}")`)); | ||
}; | ||
const nodeTest = () => { | ||
alert( | ||
`Node.js ${process.version}\nPlatform: ${ | ||
os.platform | ||
}\nFolder: ${path.basename(window.cep_node.global.__dirname)}` | ||
); | ||
}; | ||
onMount(() => { | ||
if (window.cep) { | ||
const extRoot = csi.getSystemPath("extension"); | ||
const jsxSrc = `${extRoot}/jsx/index.js`; | ||
const jsxBinSrc = `${extRoot}/jsx/index.jsxbin`; | ||
if (fs.existsSync(jsxSrc)) { | ||
console.log(jsxSrc); | ||
evalFile(jsxSrc); | ||
} else if (fs.existsSync(jsxBinSrc)) { | ||
console.log(jsxBinSrc); | ||
evalFile(jsxBinSrc); | ||
} | ||
} | ||
}); | ||
</script> | ||
|
||
<div class="app"> | ||
<header class="app-header"> | ||
<img src={bolt} class="icon" alt="" /> | ||
<div class="stack-icons"> | ||
<div> | ||
<img src={viteLogo} alt="" /> | ||
Vite | ||
</div> | ||
+ | ||
<div> | ||
<img src={svelteLogo} alt="" /> | ||
Svelte | ||
</div> | ||
+ | ||
<div> | ||
<img src={tsLogo} alt="" /> | ||
TypeScript | ||
</div> | ||
+ | ||
<div> | ||
<img src={sassLogo} alt="" /> | ||
Sass | ||
</div> | ||
</div> | ||
<div class="button-group"> | ||
<button on:click={() => (count += 1)}>Count is: {count}</button> | ||
<button on:click={nodeTest}> | ||
<img class="icon-button" src={nodeJs} alt="" /> | ||
</button> | ||
<button on:click={jsxTest}> | ||
<img class="icon-button" src={adobe} alt="" /> | ||
</button> | ||
</div> | ||
|
||
<p>Edit <code>main.svelte</code> and save to test HMR updates.</p> | ||
<p> | ||
<button | ||
on:click={() => | ||
openLinkInBrowser("https://github.com/hyperbrew/bolt-cep")} | ||
> | ||
Bolt Docs | ||
</button> | ||
| | ||
<button on:click={() => openLinkInBrowser("https://svelte.dev/docs")}> | ||
Svelte Docs | ||
</button> | ||
| | ||
<button | ||
on:click={() => | ||
openLinkInBrowser("https://vitejs.dev/guide/features.html")} | ||
> | ||
Vite Docs | ||
</button> | ||
</p> | ||
</header> | ||
</div> | ||
|
||
<style> | ||
</style> |
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,7 @@ | ||
import App from "./main.svelte"; | ||
|
||
const app = new App({ | ||
target: document.getElementById("root") as Element, | ||
}); | ||
|
||
export default app; |
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,2 @@ | ||
/// <reference types="svelte" /> | ||
/// <reference types="vite/client" /> |
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
Oops, something went wrong.