linting
This commit is contained in:
parent
2f90d7f431
commit
f1208919ee
|
@ -4,7 +4,7 @@
|
|||
selectedScreen,
|
||||
componentStore,
|
||||
selectedComponent,
|
||||
componentTreeNodesStore
|
||||
componentTreeNodesStore,
|
||||
} from "stores/builder"
|
||||
import { findComponent } from "helpers/components"
|
||||
import { goto, isActive } from "@roxi/routify"
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
userSelectedResourceMap,
|
||||
selectedComponent,
|
||||
hoverStore,
|
||||
componentTreeNodesStore
|
||||
componentTreeNodesStore,
|
||||
} from "stores/builder"
|
||||
import {
|
||||
findComponentPath,
|
||||
|
|
|
@ -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 }
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue