bugfix: dnd over screenslot was throwing err

This commit is contained in:
Michael Shanks 2020-08-13 14:02:15 +01:00
parent 8a1f0a5e4a
commit b21f8d6d02
4 changed files with 11 additions and 6 deletions

View File

@ -25,6 +25,7 @@ import {
saveScreenApi as _saveScreenApi,
regenerateCssForCurrentScreen,
generateNewIdsForComponent,
getComponentDefinition,
} from "../storeUtils"
export const getStore = () => {
const initial = {
@ -77,9 +78,6 @@ export const getStore = () => {
export default getStore
export const getComponentDefinition = (state, name) =>
name.startsWith("##") ? getBuiltin(name) : state.components[name]
const setPackage = (store, initial) => async pkg => {
const [main_screens, unauth_screens] = await Promise.all([
api

View File

@ -1,4 +1,7 @@
import { makePropsSafe } from "components/userInterface/pagesParsing/createProps"
import {
makePropsSafe,
getBuiltin,
} from "components/userInterface/pagesParsing/createProps"
import api from "./api"
import { generate_screen_css } from "./generate_css"
import { uuid } from "./uuid"
@ -85,3 +88,6 @@ export const generateNewIdsForComponent = c =>
walkProps(c, p => {
p._id = uuid()
})
export const getComponentDefinition = (state, name) =>
name.startsWith("##") ? getBuiltin(name) : state.components[name]

View File

@ -1,7 +1,7 @@
<script>
import { MoreIcon } from "components/common/Icons"
import { store } from "builderStore"
import { getComponentDefinition } from "builderStore/store"
import { getComponentDefinition } from "builderStore/storeUtils"
import ConfirmDialog from "components/common/ConfirmDialog.svelte"
import { last, cloneDeep } from "lodash/fp"
import UIkit from "uikit"

View File

@ -10,6 +10,7 @@
ChevronDownIcon,
CopyIcon,
} from "../common/Icons"
import { getComponentDefinition } from "builderStore/storeUtils"
export let components = []
export let currentComponent
@ -51,7 +52,7 @@
const dragover = (component, index) => e => {
const canHaveChildrenButIsEmpty =
$store.components[component._component].children &&
getComponentDefinition($store, component._component).children &&
component._children.length === 0
e.dataTransfer.dropEffect = "copy"