mirror of https://github.com/Budibase/budibase.git
39 changed files with 2420 additions and 1452 deletions
File diff suppressed because it is too large
|
Before Width: | Height: | Size: 52 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 19 KiB |
@ -0,0 +1,59 @@ |
|||
<script> |
|||
export let title = "" |
|||
export let favicon = "" |
|||
|
|||
export let appId |
|||
export let pageName = "" |
|||
export let production |
|||
|
|||
export const PRODUCTION_ASSETS_URL = `https://${appId}.app.budi.live` |
|||
|
|||
function publicPath(path) { |
|||
if (production) { |
|||
return `${PRODUCTION_ASSETS_URL}/assets/${appId}/${pageName}/${path}` |
|||
} |
|||
|
|||
return `/assets/${path}` |
|||
} |
|||
</script> |
|||
|
|||
<svelte:head> |
|||
<meta charset="utf8" /> |
|||
<meta name="viewport" content="width=device-width" /> |
|||
|
|||
<title>{title}</title> |
|||
<link rel="icon" type="image/png" href={favicon} /> |
|||
|
|||
<link rel="stylesheet" href={publicPath('bundle.css')} /> |
|||
|
|||
<link rel="stylesheet" href="https://rsms.me/inter/inter.css" /> |
|||
<link |
|||
rel="stylesheet" |
|||
href="https://fonts.googleapis.com/css2?family=Roboto+Mono" /> |
|||
<style> |
|||
html, |
|||
body { |
|||
font-family: Inter; |
|||
height: 100%; |
|||
width: 100%; |
|||
margin: 0px; |
|||
padding: 0px; |
|||
} |
|||
|
|||
*, |
|||
*:before, |
|||
*:after { |
|||
box-sizing: border-box; |
|||
} |
|||
</style> |
|||
</svelte:head> |
|||
|
|||
<body id="app"> |
|||
<script src={publicPath('clientFrontendDefinition.js')}> |
|||
</script> |
|||
<script src={publicPath('budibase-client.js')}> |
|||
</script> |
|||
<script> |
|||
loadBudibase() |
|||
</script> |
|||
</body> |
|||
@ -0,0 +1,10 @@ |
|||
<!doctype html> |
|||
<html> |
|||
|
|||
<head> |
|||
{{{head}}} |
|||
</head> |
|||
|
|||
{{{body}}} |
|||
|
|||
</html> |
|||
@ -1,43 +0,0 @@ |
|||
const crypto = require("crypto") |
|||
const { ensureDir, emptyDir, writeFile } = require("fs-extra") |
|||
const { join } = require("../centralPath") |
|||
|
|||
module.exports.convertCssToFiles = async (publicPagePath, pkg) => { |
|||
const cssDir = join(publicPagePath, "css") |
|||
await ensureDir(cssDir) |
|||
await emptyDir(cssDir) |
|||
|
|||
for (let screen of pkg.screens || []) { |
|||
if (!screen._css) continue |
|||
if (screen._css.trim().length === 0) { |
|||
delete screen._css |
|||
continue |
|||
} |
|||
screen._css = await createCssFile(cssDir, screen._css) |
|||
} |
|||
|
|||
if (pkg.page._css) { |
|||
pkg.page._css = await createCssFile(cssDir, pkg.page._css) |
|||
} |
|||
} |
|||
|
|||
module.exports.getHashedCssPaths = (cssDir, _css) => { |
|||
const fileName = |
|||
crypto |
|||
.createHash("md5") |
|||
.update(_css) |
|||
.digest("hex") + ".css" |
|||
|
|||
const filePath = join(cssDir, fileName) |
|||
const url = `/css/${fileName}` |
|||
|
|||
return { filePath, url } |
|||
} |
|||
|
|||
const createCssFile = async (cssDir, _css) => { |
|||
const { filePath, url } = module.exports.getHashedCssPaths(cssDir, _css) |
|||
|
|||
await writeFile(filePath, _css) |
|||
|
|||
return url |
|||
} |
|||
@ -1,63 +0,0 @@ |
|||
<!doctype html> |
|||
<html> |
|||
|
|||
<head> |
|||
<meta charset='utf8'> |
|||
<meta name='viewport' content='width=device-width'> |
|||
|
|||
<title>{{ title }}</title> |
|||
<link rel='icon' type='image/png' href='{{ favicon }}'> |
|||
|
|||
<style> |
|||
html, |
|||
body { |
|||
font-family: Inter; |
|||
height: 100%; |
|||
width: 100%; |
|||
margin: 0px; |
|||
padding: 0px; |
|||
} |
|||
*, *:before, *:after { |
|||
box-sizing: border-box; |
|||
} |
|||
</style> |
|||
|
|||
{{ each(options.stylesheets) }} |
|||
<link rel='stylesheet' href='{{ @this }}'> |
|||
{{ /each }} |
|||
|
|||
{{ each(options.screenStyles) }} |
|||
{{ if(options.production) }} |
|||
<link rel='stylesheet' href='/assets/{{ appId }}/{{ pageName }}{{ @this }}'> |
|||
{{#else}} |
|||
<link rel='stylesheet' href='/assets{{ @this }}'> |
|||
{{ /if }} |
|||
{{ /each }} |
|||
|
|||
{{ if(options.pageStyle) }} |
|||
{{ if(options.production) }} |
|||
<link rel='stylesheet' href='/assets/{{ appId }}/{{ pageName }}{{ pageStyle }}'> |
|||
{{#else}} |
|||
<link rel='stylesheet' href='/assets{{ pageStyle }}'> |
|||
{{ /if }} |
|||
{{ /if }} |
|||
|
|||
<link rel="stylesheet" href="https://rsms.me/inter/inter.css"> |
|||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Roboto+Mono"> |
|||
|
|||
{{ if(options.production) }} |
|||
<script src='/assets/{{ appId }}/{{ pageName }}/clientFrontendDefinition.js'></script> |
|||
<script src='/assets/{{ appId }}/{{ pageName }}/budibase-client.js'></script> |
|||
{{#else}} |
|||
<script src='/assets/clientFrontendDefinition.js'></script> |
|||
<script src='/assets/budibase-client.js'></script> |
|||
{{ /if }} |
|||
</head> |
|||
|
|||
<body id="app"> |
|||
<script> |
|||
loadBudibase(); |
|||
</script> |
|||
</body> |
|||
|
|||
</html> |
|||
@ -1,3 +0,0 @@ |
|||
const { join } = require("../centralPath") |
|||
|
|||
module.exports = (appPath, pageName) => join(appPath, "public", pageName) |
|||
@ -0,0 +1,34 @@ |
|||
<script> |
|||
import { RichText } from "@budibase/bbui" |
|||
|
|||
export let _bb |
|||
|
|||
export let content = "" |
|||
|
|||
const updateValue = content => { |
|||
if (_bb) { |
|||
_bb.setBinding("value", content) |
|||
} |
|||
} |
|||
|
|||
$: updateValue(content) |
|||
|
|||
// Need to determine what options we want to expose. |
|||
|
|||
let options = { |
|||
modules: { |
|||
toolbar: [ |
|||
[ |
|||
{ |
|||
header: [1, 2, 3, false], |
|||
}, |
|||
], |
|||
["bold", "italic", "underline", "strike"], |
|||
], |
|||
}, |
|||
placeholder: "Type something...", |
|||
theme: "snow", |
|||
} |
|||
</script> |
|||
|
|||
<RichText bind:content {options} /> |
|||
Loading…
Reference in new issue