From 9068bbc89c5236d851ead9a69bee6902b4b656ea Mon Sep 17 00:00:00 2001 From: Joe <49767913+joebudi@users.noreply.github.com> Date: Thu, 11 Jun 2020 13:15:19 +0100 Subject: [PATCH] formatting and lint update --- .../common/Inputs/InputGroup.svelte | 7 ++-- .../AppPreview/CurrentItemPreview.svelte | 38 ++++++++++--------- .../ComponentPropertiesPanel.svelte | 23 ++++++----- .../userInterface/propertyCategories.js | 24 ++++++++++-- 4 files changed, 59 insertions(+), 33 deletions(-) diff --git a/packages/builder/src/components/common/Inputs/InputGroup.svelte b/packages/builder/src/components/common/Inputs/InputGroup.svelte index e5fed68103..385623ca19 100644 --- a/packages/builder/src/components/common/Inputs/InputGroup.svelte +++ b/packages/builder/src/components/common/Inputs/InputGroup.svelte @@ -19,9 +19,10 @@ onChange(_value) } - $: displayValues = value && suffix - ? value.map(v => v.replace(new RegExp(`${suffix}$`), "")) - : value || [] + $: displayValues = + value && suffix + ? value.map(v => v.replace(new RegExp(`${suffix}$`), "")) + : value || []
diff --git a/packages/builder/src/components/userInterface/AppPreview/CurrentItemPreview.svelte b/packages/builder/src/components/userInterface/AppPreview/CurrentItemPreview.svelte index 53450c2200..00d7e6c171 100644 --- a/packages/builder/src/components/userInterface/AppPreview/CurrentItemPreview.svelte +++ b/packages/builder/src/components/userInterface/AppPreview/CurrentItemPreview.svelte @@ -21,7 +21,7 @@ return componentName || "element" } - const screenPlaceholder = { + const screenPlaceholder = { name: "Screen Placeholder", route: "*", props: { @@ -60,9 +60,8 @@ }, } - $: hasComponent = !!$store.currentPreviewItem - + $: { styles = "" // Apply the CSS from the currently selected page and its screens @@ -88,9 +87,9 @@ libraries: $store.libraries, page: $store.pages[$store.currentPageName], screens: [ - $store.currentFrontEndType === "page" - ? screenPlaceholder - : $store.currentPreviewItem, + $store.currentFrontEndType === "page" + ? screenPlaceholder + : $store.currentPreviewItem, ], appRootPath: "", } @@ -102,20 +101,25 @@ : "" const refreshContent = () => { - iframe.contentWindow.postMessage(JSON.stringify({ - styles, - stylesheetLinks, - selectedComponentType, - selectedComponentId, - frontendDefinition, - })) + iframe.contentWindow.postMessage( + JSON.stringify({ + styles, + stylesheetLinks, + selectedComponentType, + selectedComponentId, + frontendDefinition, + }) + ) } - $: if(iframe) iframe.contentWindow.addEventListener("bb-ready", refreshContent, { once: true }) + $: if (iframe) + iframe.contentWindow.addEventListener("bb-ready", refreshContent, { + once: true, + }) - $: if(iframe && frontendDefinition) { - refreshContent() - } + $: if (iframe && frontendDefinition) { + refreshContent() + }
diff --git a/packages/builder/src/components/userInterface/ComponentPropertiesPanel.svelte b/packages/builder/src/components/userInterface/ComponentPropertiesPanel.svelte index bfe5507256..7d33b9c963 100644 --- a/packages/builder/src/components/userInterface/ComponentPropertiesPanel.svelte +++ b/packages/builder/src/components/userInterface/ComponentPropertiesPanel.svelte @@ -37,27 +37,32 @@ //use for getting controls for each component property c => c._component === componentInstance._component ) || {} - + let panelDefinition = {} $: { - if(componentPropDefinition.properties) { - if(selectedCategory.value === "design") { + if (componentPropDefinition.properties) { + if (selectedCategory.value === "design") { panelDefinition = componentPropDefinition.properties["design"] - }else{ + } else { let panelDef = componentPropDefinition.properties["settings"] - if($store.currentFrontEndType === "page" && $store.currentView !== "component") { - panelDefinition = [...page,...panelDef] - }else if($store.currentFrontEndType === "screen" && $store.currentView !== "component") { + if ( + $store.currentFrontEndType === "page" && + $store.currentView !== "component" + ) { + panelDefinition = [...page, ...panelDef] + } else if ( + $store.currentFrontEndType === "screen" && + $store.currentView !== "component" + ) { panelDefinition = [...screen, ...panelDef] - }else { + } else { panelDefinition = panelDef } } } } - const onStyleChanged = store.setComponentStyle const onPropChanged = store.setComponentProp diff --git a/packages/builder/src/components/userInterface/propertyCategories.js b/packages/builder/src/components/userInterface/propertyCategories.js index 8ee38d3c35..c0485304ce 100644 --- a/packages/builder/src/components/userInterface/propertyCategories.js +++ b/packages/builder/src/components/userInterface/propertyCategories.js @@ -403,10 +403,26 @@ export const effects = [ options: [ { label: "None", value: "none" }, { label: "Extra small", value: "0 1px 2px 0 rgba(0, 0, 0, 0.05)" }, - { label: "Small", value: "0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)" }, - { label: "Medium", value: "0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)" }, - { label: "Large", value: "0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)" }, - { label: "Extra large", value: "0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)" }, + { + label: "Small", + value: + "0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06)", + }, + { + label: "Medium", + value: + "0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)", + }, + { + label: "Large", + value: + "0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)", + }, + { + label: "Extra large", + value: + "0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04)", + }, ], }, ]