From f1208919eeecf2867f852929cf6d06b1a9ce67e8 Mon Sep 17 00:00:00 2001 From: Gerard Burns Date: Mon, 4 Mar 2024 08:07:15 +0000 Subject: [PATCH] linting --- .../ComponentList/ComponentKeyHandler.svelte | 2 +- .../ComponentList/ComponentTree.svelte | 2 +- .../src/stores/builder/componentTreeNodes.js | 6 ++++-- .../builder/src/stores/builder/components.js | 17 ++++++++++++----- packages/builder/src/stores/builder/index.js | 7 ++----- 5 files changed, 20 insertions(+), 14 deletions(-) diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/ComponentList/ComponentKeyHandler.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/ComponentList/ComponentKeyHandler.svelte index df0d361290..f25d21721d 100644 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/ComponentList/ComponentKeyHandler.svelte +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/ComponentList/ComponentKeyHandler.svelte @@ -4,7 +4,7 @@ selectedScreen, componentStore, selectedComponent, - componentTreeNodesStore + componentTreeNodesStore, } from "stores/builder" import { findComponent } from "helpers/components" import { goto, isActive } from "@roxi/routify" diff --git a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/ComponentList/ComponentTree.svelte b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/ComponentList/ComponentTree.svelte index b8e5720eea..6bae359a17 100644 --- a/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/ComponentList/ComponentTree.svelte +++ b/packages/builder/src/pages/builder/app/[application]/design/[screenId]/_components/ComponentList/ComponentTree.svelte @@ -8,7 +8,7 @@ userSelectedResourceMap, selectedComponent, hoverStore, - componentTreeNodesStore + componentTreeNodesStore, } from "stores/builder" import { findComponentPath, diff --git a/packages/builder/src/stores/builder/componentTreeNodes.js b/packages/builder/src/stores/builder/componentTreeNodes.js index f6d3a80c43..bffb1327b2 100644 --- a/packages/builder/src/stores/builder/componentTreeNodes.js +++ b/packages/builder/src/stores/builder/componentTreeNodes.js @@ -20,9 +20,11 @@ const expandNode = componentId => { const expandNodes = componentIds => { baseStore.update(openNodes => { - const newNodes = Object.fromEntries(componentIds.map(id => ([`nodeOpen-${id}`, true]))) + const newNodes = Object.fromEntries( + componentIds.map(id => [`nodeOpen-${id}`, true]) + ) - return { ...openNodes, ...newNodes }; + return { ...openNodes, ...newNodes } }) } diff --git a/packages/builder/src/stores/builder/components.js b/packages/builder/src/stores/builder/components.js index 6dc1a1c96b..6bce50a614 100644 --- a/packages/builder/src/stores/builder/components.js +++ b/packages/builder/src/stores/builder/components.js @@ -19,7 +19,7 @@ import { appStore, previewStore, tables, - componentTreeNodesStore + componentTreeNodesStore, } from "stores/builder/index" import { buildFormSchema, getSchemaForDatasource } from "dataBinding" import { @@ -654,7 +654,9 @@ export class ComponentStore extends BudiStore { state.selectedScreenId = targetScreenId state.selectedComponentId = newComponentId - const targetScreen = get(screenStore).screens.find(screen => screen.id === targetScreenId) + const targetScreen = get(screenStore).screens.find( + screen => screen.id === targetScreenId + ) const componentPathIds = findComponentPath( targetScreen?.props, @@ -814,7 +816,10 @@ export class ComponentStore extends BudiStore { // sibling const previousSibling = parent._children[index - 1] const definition = this.getDefinition(previousSibling._component) - if (definition.hasChildren && componentTreeNodes[`nodeOpen-${previousSibling._id}`] !== false) { + if ( + definition.hasChildren && + componentTreeNodes[`nodeOpen-${previousSibling._id}`] !== false + ) { previousSibling._children.push(originalComponent) } @@ -842,7 +847,6 @@ export class ComponentStore extends BudiStore { const parent = findComponentParent(screen.props, componentId) const componentTreeNodes = get(componentTreeNodesStore) - // Sanity check parent is found if (!parent?._children?.length) { return false @@ -868,7 +872,10 @@ export class ComponentStore extends BudiStore { // If the next sibling has children, and is not collapsed, become the first child const nextSibling = parent._children[index] const definition = this.getDefinition(nextSibling._component) - if (definition.hasChildren && componentTreeNodes[`nodeOpen-${nextSibling._id}`] !== false) { + if ( + definition.hasChildren && + componentTreeNodes[`nodeOpen-${nextSibling._id}`] !== false + ) { nextSibling._children.splice(0, 0, originalComponent) } diff --git a/packages/builder/src/stores/builder/index.js b/packages/builder/src/stores/builder/index.js index ee2c36db38..98fedd880a 100644 --- a/packages/builder/src/stores/builder/index.js +++ b/packages/builder/src/stores/builder/index.js @@ -1,9 +1,6 @@ import { layoutStore } from "./layouts.js" import { appStore } from "./app.js" -import { - componentStore, - selectedComponent, -} from "./components" +import { componentStore, selectedComponent } from "./components" import { navigationStore } from "./navigation.js" import { themeStore } from "./theme.js" import { screenStore, selectedScreen, sortedScreens } from "./screens.js" @@ -29,7 +26,7 @@ import { integrations } from "./integrations" import { sortedIntegrations } from "./sortedIntegrations" import { queries } from "./queries" import { flags } from "./flags" -import componentTreeNodesStore from './componentTreeNodes'; +import componentTreeNodesStore from "./componentTreeNodes" export { componentTreeNodesStore,