From b21f8d6d02992a9e5a35852d145aac1e0ee740b1 Mon Sep 17 00:00:00 2001 From: Michael Shanks Date: Thu, 13 Aug 2020 14:02:15 +0100 Subject: [PATCH 01/15] bugfix: dnd over screenslot was throwing err --- packages/builder/src/builderStore/store/index.js | 4 +--- packages/builder/src/builderStore/storeUtils.js | 8 +++++++- .../components/userInterface/ComponentDropdownMenu.svelte | 2 +- .../userInterface/ComponentsHierarchyChildren.svelte | 3 ++- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/packages/builder/src/builderStore/store/index.js b/packages/builder/src/builderStore/store/index.js index f5849c480a..4939cdb40a 100644 --- a/packages/builder/src/builderStore/store/index.js +++ b/packages/builder/src/builderStore/store/index.js @@ -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 diff --git a/packages/builder/src/builderStore/storeUtils.js b/packages/builder/src/builderStore/storeUtils.js index 1630d118e0..a1974d81b9 100644 --- a/packages/builder/src/builderStore/storeUtils.js +++ b/packages/builder/src/builderStore/storeUtils.js @@ -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] diff --git a/packages/builder/src/components/userInterface/ComponentDropdownMenu.svelte b/packages/builder/src/components/userInterface/ComponentDropdownMenu.svelte index 23e28a7b48..b120ca549b 100644 --- a/packages/builder/src/components/userInterface/ComponentDropdownMenu.svelte +++ b/packages/builder/src/components/userInterface/ComponentDropdownMenu.svelte @@ -1,7 +1,7 @@