Fixes
This commit is contained in:
parent
12d596e7ab
commit
0d096132b8
|
@ -2,6 +2,7 @@ import { writable, get } from "svelte/store"
|
||||||
import { findComponentParent, findComponentPath } from "@/helpers/components"
|
import { findComponentParent, findComponentPath } from "@/helpers/components"
|
||||||
import { selectedScreen, componentStore } from "@/stores/builder"
|
import { selectedScreen, componentStore } from "@/stores/builder"
|
||||||
import { DropPosition } from "@budibase/types"
|
import { DropPosition } from "@budibase/types"
|
||||||
|
export { DropPosition } from "@budibase/types"
|
||||||
|
|
||||||
const initialState = {
|
const initialState = {
|
||||||
source: null,
|
source: null,
|
||||||
|
|
|
@ -1,20 +1,20 @@
|
||||||
import { layoutStore } from "./layouts.js"
|
import { layoutStore } from "./layouts"
|
||||||
import { appStore } from "./app.js"
|
import { appStore } from "./app"
|
||||||
import { componentStore, selectedComponent } from "./components"
|
import { componentStore, selectedComponent } from "./components"
|
||||||
import { navigationStore } from "./navigation.js"
|
import { navigationStore } from "./navigation"
|
||||||
import { themeStore } from "./theme.js"
|
import { themeStore } from "./theme"
|
||||||
import { screenStore, selectedScreen, sortedScreens } from "./screens"
|
import { screenStore, selectedScreen, sortedScreens } from "./screens"
|
||||||
import { builderStore } from "./builder.js"
|
import { builderStore } from "./builder"
|
||||||
import { hoverStore } from "./hover.js"
|
import { hoverStore } from "./hover"
|
||||||
import { previewStore } from "./preview.js"
|
import { previewStore } from "./preview"
|
||||||
import {
|
import {
|
||||||
automationStore,
|
automationStore,
|
||||||
selectedAutomation,
|
selectedAutomation,
|
||||||
automationHistoryStore,
|
automationHistoryStore,
|
||||||
} from "./automations.js"
|
} from "./automations"
|
||||||
import { userStore, userSelectedResourceMap, isOnlyUser } from "./users.js"
|
import { userStore, userSelectedResourceMap, isOnlyUser } from "./users"
|
||||||
import { deploymentStore } from "./deployments.js"
|
import { deploymentStore } from "./deployments"
|
||||||
import { contextMenuStore } from "./contextMenu.js"
|
import { contextMenuStore } from "./contextMenu"
|
||||||
import { snippets } from "./snippets"
|
import { snippets } from "./snippets"
|
||||||
import {
|
import {
|
||||||
screenComponentsList,
|
screenComponentsList,
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<script>
|
<script>
|
||||||
import { getContext, onDestroy, onMount, setContext } from "svelte"
|
import { getContext, onDestroy, onMount, setContext } from "svelte"
|
||||||
import { builderStore } from "@/stores/builder"
|
import { builderStore } from "stores/builder"
|
||||||
import { blockStore } from "stores/blocks"
|
import { blockStore } from "stores/blocks"
|
||||||
|
|
||||||
const component = getContext("component")
|
const component = getContext("component")
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<script>
|
<script>
|
||||||
import { getContext, onDestroy } from "svelte"
|
import { getContext, onDestroy } from "svelte"
|
||||||
import { generate } from "shortid"
|
import { generate } from "shortid"
|
||||||
import { builderStore } from "../stores/builder.js"
|
import { builderStore } from "../stores/builder"
|
||||||
import Component from "components/Component.svelte"
|
import Component from "components/Component.svelte"
|
||||||
|
|
||||||
export let type
|
export let type
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
import Field from "./Field.svelte"
|
import Field from "./Field.svelte"
|
||||||
import { CoreDropzone, ProgressCircle, Helpers } from "@budibase/bbui"
|
import { CoreDropzone, ProgressCircle, Helpers } from "@budibase/bbui"
|
||||||
import { getContext, onMount, onDestroy } from "svelte"
|
import { getContext, onMount, onDestroy } from "svelte"
|
||||||
import { builderStore } from "@/stores/builder"
|
import { builderStore } from "stores/builder"
|
||||||
import { processStringSync } from "@budibase/string-templates"
|
import { processStringSync } from "@budibase/string-templates"
|
||||||
|
|
||||||
export let datasourceId
|
export let datasourceId
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { writable, get } from "svelte/store"
|
||||||
import { API } from "api"
|
import { API } from "api"
|
||||||
import { devToolsStore } from "./devTools.js"
|
import { devToolsStore } from "./devTools.js"
|
||||||
import { eventStore } from "./events.js"
|
import { eventStore } from "./events.js"
|
||||||
import { DropPosition, PreviewDevice } from "@budibase/types"
|
import { DropPosition, PingSource, PreviewDevice } from "@budibase/types"
|
||||||
|
|
||||||
interface BuilderStore {
|
interface BuilderStore {
|
||||||
inBuilder: boolean
|
inBuilder: boolean
|
||||||
|
@ -81,34 +81,38 @@ const createBuilderStore = () => {
|
||||||
selectComponent,
|
selectComponent,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
deleteComponent: id => {
|
deleteComponent: (id: string) => {
|
||||||
eventStore.actions.dispatchEvent("delete-component", { id })
|
eventStore.actions.dispatchEvent("delete-component", { id })
|
||||||
},
|
},
|
||||||
notifyLoaded: () => {
|
notifyLoaded: () => {
|
||||||
eventStore.actions.dispatchEvent("preview-loaded")
|
eventStore.actions.dispatchEvent("preview-loaded")
|
||||||
},
|
},
|
||||||
analyticsPing: async ({ embedded }) => {
|
analyticsPing: async ({ embedded }: { embedded: boolean }) => {
|
||||||
try {
|
try {
|
||||||
await API.analyticsPing({ source: "app", embedded })
|
await API.analyticsPing({ source: PingSource.APP, embedded })
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
// Do nothing
|
// Do nothing
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
moveComponent: async (componentId, destinationComponentId, mode) => {
|
moveComponent: async (
|
||||||
|
componentId: string,
|
||||||
|
destinationComponentId: string,
|
||||||
|
mode: DropPosition
|
||||||
|
) => {
|
||||||
await eventStore.actions.dispatchEvent("move-component", {
|
await eventStore.actions.dispatchEvent("move-component", {
|
||||||
componentId,
|
componentId,
|
||||||
destinationComponentId,
|
destinationComponentId,
|
||||||
mode,
|
mode,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
dropNewComponent: (component, parent, index) => {
|
dropNewComponent: (component: string, parent: string, index: number) => {
|
||||||
eventStore.actions.dispatchEvent("drop-new-component", {
|
eventStore.actions.dispatchEvent("drop-new-component", {
|
||||||
component,
|
component,
|
||||||
parent,
|
parent,
|
||||||
index,
|
index,
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
setEditMode: enabled => {
|
setEditMode: (enabled: boolean) => {
|
||||||
if (enabled === get(store).editMode) {
|
if (enabled === get(store).editMode) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import { derived } from "svelte/store"
|
import { derived } from "svelte/store"
|
||||||
import { appStore } from "../app.js"
|
import { appStore } from "../app.js"
|
||||||
import { builderStore } from "../builder.js"
|
import { builderStore } from "../builder"
|
||||||
|
|
||||||
export const devToolsEnabled = derived(
|
export const devToolsEnabled = derived(
|
||||||
[appStore, builderStore],
|
[appStore, builderStore],
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { appStore } from "../app.js"
|
import { appStore } from "../app.js"
|
||||||
import { builderStore } from "../builder.js"
|
import { builderStore } from "../builder"
|
||||||
import { derivedMemo } from "@budibase/frontend-core"
|
import { derivedMemo } from "@budibase/frontend-core"
|
||||||
|
|
||||||
export const snippets = derivedMemo(
|
export const snippets = derivedMemo(
|
||||||
|
|
Loading…
Reference in New Issue