This commit is contained in:
Andrew Kingston 2025-02-05 16:20:31 +00:00
parent b9c2b07f3e
commit e71e8ff6b6
No known key found for this signature in database
4 changed files with 7 additions and 19 deletions

View File

@ -124,7 +124,6 @@
}
const startDraggingPlaceholder = () => {
console.log("START PLACEHOLDER")
const mode = GridDragModes.Move
const id = DNDPlaceholderID
@ -160,7 +159,6 @@
}
// Add event handler to clear all drag state when dragging ends
console.log("add up listener")
document.addEventListener("mouseup", stopDragging)
}

View File

@ -36,8 +36,6 @@ import * as internal from "svelte/internal"
window.svelte_internal = internal
window.svelte = svelte
console.log("NEW CLIENT")
// Initialise spectrum icons
// eslint-disable-next-line local-rules/no-budibase-imports
import loadSpectrumIcons from "@budibase/bbui/spectrum-icons-vite.js"

View File

@ -1,6 +1,6 @@
import { writable, get } from "svelte/store"
import { derivedMemo } from "@budibase/frontend-core"
import { screenStore } from "@/stores"
import { screenStore, isGridScreen } from "@/stores"
import { ScreenslotID } from "@/constants"
const createDndStore = () => {
@ -33,15 +33,11 @@ const createDndStore = () => {
return
}
// On grid screens, we already know exactly where to insert the component
let target, drop
const screen = get(screenStore)?.activeScreen
const isGridScreen = screen?.props?.layout === "grid"
if (isGridScreen) {
if (get(isGridScreen)) {
const id = screen?.props?._id
drop = {
parent: id,
index: screen?.props?._children?.length,
}
target = {
id,
parent: ScreenslotID,
@ -49,6 +45,10 @@ const createDndStore = () => {
empty: false,
acceptsChildren: true,
}
drop = {
parent: id,
index: screen?.props?._children?.length,
}
}
// Get size of new component so we can show a properly sized placeholder
@ -57,7 +57,6 @@ const createDndStore = () => {
store.set({
...initialState,
isGridScreen,
source: {
id: null,
parent: null,
@ -73,7 +72,6 @@ const createDndStore = () => {
const updateTarget = ({ id, parent, node, empty, acceptsChildren }) => {
store.update(state => {
state.target = { id, parent, node, empty, acceptsChildren }
console.log("TARGET", state.target)
return state
})
}
@ -81,7 +79,6 @@ const createDndStore = () => {
const updateDrop = ({ parent, index }) => {
store.update(state => {
state.drop = { parent, index }
console.log("DROP", state.drop)
return state
})
}
@ -127,7 +124,3 @@ export const dndIsNewComponent = derivedMemo(
dndStore,
x => x.source?.newComponentType != null
)
export const dndNewComponentProps = derivedMemo(
dndStore,
x => x.meta?.newComponentProps
)

View File

@ -25,7 +25,6 @@ export {
dndBounds,
dndIsNewComponent,
dndIsDragging,
dndNewComponentProps,
} from "./dnd"
export { sidePanelStore } from "./sidePanel"
export { modalStore } from "./modal"