bugfix: dnd over screenslot was throwing err
This commit is contained in:
parent
8a1f0a5e4a
commit
b21f8d6d02
|
@ -25,6 +25,7 @@ import {
|
||||||
saveScreenApi as _saveScreenApi,
|
saveScreenApi as _saveScreenApi,
|
||||||
regenerateCssForCurrentScreen,
|
regenerateCssForCurrentScreen,
|
||||||
generateNewIdsForComponent,
|
generateNewIdsForComponent,
|
||||||
|
getComponentDefinition,
|
||||||
} from "../storeUtils"
|
} from "../storeUtils"
|
||||||
export const getStore = () => {
|
export const getStore = () => {
|
||||||
const initial = {
|
const initial = {
|
||||||
|
@ -77,9 +78,6 @@ export const getStore = () => {
|
||||||
|
|
||||||
export default getStore
|
export default getStore
|
||||||
|
|
||||||
export const getComponentDefinition = (state, name) =>
|
|
||||||
name.startsWith("##") ? getBuiltin(name) : state.components[name]
|
|
||||||
|
|
||||||
const setPackage = (store, initial) => async pkg => {
|
const setPackage = (store, initial) => async pkg => {
|
||||||
const [main_screens, unauth_screens] = await Promise.all([
|
const [main_screens, unauth_screens] = await Promise.all([
|
||||||
api
|
api
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
import { makePropsSafe } from "components/userInterface/pagesParsing/createProps"
|
import {
|
||||||
|
makePropsSafe,
|
||||||
|
getBuiltin,
|
||||||
|
} from "components/userInterface/pagesParsing/createProps"
|
||||||
import api from "./api"
|
import api from "./api"
|
||||||
import { generate_screen_css } from "./generate_css"
|
import { generate_screen_css } from "./generate_css"
|
||||||
import { uuid } from "./uuid"
|
import { uuid } from "./uuid"
|
||||||
|
@ -85,3 +88,6 @@ export const generateNewIdsForComponent = c =>
|
||||||
walkProps(c, p => {
|
walkProps(c, p => {
|
||||||
p._id = uuid()
|
p._id = uuid()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
export const getComponentDefinition = (state, name) =>
|
||||||
|
name.startsWith("##") ? getBuiltin(name) : state.components[name]
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<script>
|
<script>
|
||||||
import { MoreIcon } from "components/common/Icons"
|
import { MoreIcon } from "components/common/Icons"
|
||||||
import { store } from "builderStore"
|
import { store } from "builderStore"
|
||||||
import { getComponentDefinition } from "builderStore/store"
|
import { getComponentDefinition } from "builderStore/storeUtils"
|
||||||
import ConfirmDialog from "components/common/ConfirmDialog.svelte"
|
import ConfirmDialog from "components/common/ConfirmDialog.svelte"
|
||||||
import { last, cloneDeep } from "lodash/fp"
|
import { last, cloneDeep } from "lodash/fp"
|
||||||
import UIkit from "uikit"
|
import UIkit from "uikit"
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
ChevronDownIcon,
|
ChevronDownIcon,
|
||||||
CopyIcon,
|
CopyIcon,
|
||||||
} from "../common/Icons"
|
} from "../common/Icons"
|
||||||
|
import { getComponentDefinition } from "builderStore/storeUtils"
|
||||||
|
|
||||||
export let components = []
|
export let components = []
|
||||||
export let currentComponent
|
export let currentComponent
|
||||||
|
@ -51,7 +52,7 @@
|
||||||
|
|
||||||
const dragover = (component, index) => e => {
|
const dragover = (component, index) => e => {
|
||||||
const canHaveChildrenButIsEmpty =
|
const canHaveChildrenButIsEmpty =
|
||||||
$store.components[component._component].children &&
|
getComponentDefinition($store, component._component).children &&
|
||||||
component._children.length === 0
|
component._children.length === 0
|
||||||
|
|
||||||
e.dataTransfer.dropEffect = "copy"
|
e.dataTransfer.dropEffect = "copy"
|
||||||
|
|
Loading…
Reference in New Issue