fix build by running yarn format

This commit is contained in:
Maurits Lourens 2021-03-23 20:32:22 +01:00
parent d64b80b118
commit cefd3b9643
2 changed files with 97 additions and 92 deletions

View File

@ -1,38 +1,42 @@
<script> <script>
import { createEventDispatcher } from 'svelte' import { createEventDispatcher } from "svelte"
import Colorpicker from "@budibase/colorpicker" import Colorpicker from "@budibase/colorpicker"
const dispatch = createEventDispatcher(); const dispatch = createEventDispatcher()
export let value export let value
const WAIT = 150; const WAIT = 150
function throttle(callback, wait, immediate = false) { function throttle(callback, wait, immediate = false) {
let timeout = null let timeout = null
let initialCall = true let initialCall = true
return function() { return function() {
const callNow = immediate && initialCall const callNow = immediate && initialCall
const next = () => { const next = () => {
callback.apply(this, arguments) callback.apply(this, arguments)
timeout = null timeout = null
} }
if (callNow) { if (callNow) {
initialCall = false initialCall = false
next() next()
} }
if (!timeout) { if (!timeout) {
timeout = setTimeout(next, wait) timeout = setTimeout(next, wait)
} }
} }
} }
const onChange = throttle(e => { const onChange = throttle(
dispatch('change', e.detail) e => {
}, WAIT, true) dispatch("change", e.detail)
},
WAIT,
true
)
</script> </script>
<Colorpicker value={value || '#C4C4C4'} on:change={onChange} /> <Colorpicker value={value || '#C4C4C4'} on:change={onChange} />

View File

@ -8,7 +8,7 @@ const initialiseBudibase = require("./utilities/initialiseBudibase")
const { budibaseAppsDir } = require("./utilities/budibaseDir") const { budibaseAppsDir } = require("./utilities/budibaseDir")
const { openNewGitHubIssue, debugInfo } = require("electron-util") const { openNewGitHubIssue, debugInfo } = require("electron-util")
const eventEmitter = require("./events") const eventEmitter = require("./events")
const isMac = process.platform === 'darwin'; const isMac = process.platform === "darwin"
const budibaseDir = budibaseAppsDir() const budibaseDir = budibaseAppsDir()
const envFile = join(budibaseDir, ".env") const envFile = join(budibaseDir, ".env")
@ -90,108 +90,109 @@ async function startApp() {
const template = [ const template = [
// { role: 'appMenu' } // { role: 'appMenu' }
...(isMac ? [{ ...(isMac
label: app.name, ? [
submenu: [ {
{ role: 'about' }, label: app.name,
{ type: 'separator' }, submenu: [
{ role: 'services' }, { role: "about" },
{ type: 'separator' }, { type: "separator" },
{ role: 'hide' }, { role: "services" },
{ role: 'hideothers' }, { type: "separator" },
{ role: 'unhide' }, { role: "hide" },
{ type: 'separator' }, { role: "hideothers" },
{ role: 'quit' } { role: "unhide" },
] { type: "separator" },
}] : []), { role: "quit" },
],
},
]
: []),
// { role: 'fileMenu' } // { role: 'fileMenu' }
{ {
label: 'File', label: "File",
submenu: [ submenu: [isMac ? { role: "close" } : { role: "quit" }],
isMac ? { role: 'close' } : { role: 'quit' }
]
}, },
// { role: 'editMenu' } // { role: 'editMenu' }
{ {
label: 'Edit', label: "Edit",
submenu: [ submenu: [
{ role: 'undo' }, { role: "undo" },
{ role: 'redo' }, { role: "redo" },
{ type: 'separator' }, { type: "separator" },
{ role: 'cut' }, { role: "cut" },
{ role: 'copy' }, { role: "copy" },
{ role: 'paste' }, { role: "paste" },
...(isMac ? [ ...(isMac
{ role: 'pasteAndMatchStyle' }, ? [
{ role: 'delete' }, { role: "pasteAndMatchStyle" },
{ role: 'selectAll' }, { role: "delete" },
{ type: 'separator' }, { role: "selectAll" },
{ { type: "separator" },
label: 'Speech', {
submenu: [ label: "Speech",
{ role: 'startSpeaking' }, submenu: [{ role: "startSpeaking" }, { role: "stopSpeaking" }],
{ role: 'stopSpeaking' } },
] ]
} : [{ role: "delete" }, { type: "separator" }, { role: "selectAll" }]),
] : [ ],
{ role: 'delete' },
{ type: 'separator' },
{ role: 'selectAll' }
])
]
}, },
// { role: 'viewMenu' } // { role: 'viewMenu' }
{ {
label: 'View', label: "View",
submenu: [ submenu: [
{ role: 'reload' }, { role: "reload" },
{ role: 'forceReload' }, { role: "forceReload" },
{ role: 'toggleDevTools' }, { role: "toggleDevTools" },
{ type: 'separator' }, { type: "separator" },
{ role: 'resetZoom' }, { role: "resetZoom" },
{ role: 'zoomIn' }, { role: "zoomIn" },
{ role: 'zoomOut' }, { role: "zoomOut" },
{ type: 'separator' }, { type: "separator" },
{ role: 'togglefullscreen' } { role: "togglefullscreen" },
] ],
}, },
// { role: 'windowMenu' } // { role: 'windowMenu' }
{ {
label: 'Window', label: "Window",
submenu: [ submenu: [
{ role: 'minimize' }, { role: "minimize" },
{ role: 'zoom' }, { role: "zoom" },
...(isMac ? [ ...(isMac
{ type: 'separator' }, ? [
{ role: 'front' }, { type: "separator" },
{ type: 'separator' }, { role: "front" },
{ role: 'window' } { type: "separator" },
] : [ { role: "window" },
{ role: 'close' } ]
]) : [{ role: "close" }]),
] ],
}, },
{ {
role: 'help', role: "help",
submenu: [ submenu: [
{ {
label: 'Learn More', label: "Learn More",
click: () => shell.openExternal('https://www.budibase.com/') click: () => shell.openExternal("https://www.budibase.com/"),
}, },
{ {
label: 'Documentation', label: "Documentation",
click: () => shell.openExternal('https://docs.budibase.com/') click: () => shell.openExternal("https://docs.budibase.com/"),
}, },
{ {
label: 'Search issues', label: "Search issues",
click: () => shell.openExternal('https://github.com/Budibase/budibase/issues') click: () =>
shell.openExternal("https://github.com/Budibase/budibase/issues"),
}, },
{ {
label: 'Community discussions', label: "Community discussions",
click: () => shell.openExternal('https://github.com/Budibase/budibase/discussions') click: () =>
shell.openExternal(
"https://github.com/Budibase/budibase/discussions"
),
}, },
] ],
} },
] ]
const menu = Menu.buildFromTemplate(template) const menu = Menu.buildFromTemplate(template)