forked from tsai/budibase
10 changed files with 106 additions and 128 deletions
@ -1,7 +1,4 @@ |
|||
<script> |
|||
import ComponentListPanel from "./_components/navigation/ComponentListPanel.svelte" |
|||
import ComponentSettingsPanel from "./_components/settings/ComponentSettingsPanel.svelte" |
|||
</script> |
|||
|
|||
<ComponentListPanel /> |
|||
<ComponentSettingsPanel /> |
|||
<!-- |
|||
Placeholder file so that routify works. |
|||
No unique content is needed in this index page. |
|||
--> |
|||
|
|||
@ -0,0 +1,5 @@ |
|||
<script> |
|||
import NewComponentPanel from "./_components/NewComponentPanel.svelte" |
|||
</script> |
|||
|
|||
<NewComponentPanel /> |
|||
@ -1,21 +0,0 @@ |
|||
<script> |
|||
import Panel from "components/design/Panel.svelte" |
|||
import { Body, Layout } from "@budibase/bbui" |
|||
import { selectedComponent, selectedScreen, store } from "builderStore" |
|||
|
|||
$: componentDefinition = store.actions.components.getDefinition( |
|||
$selectedComponent?._component |
|||
) |
|||
$: isScreen = $selectedComponent?._id === $selectedScreen?.props._id |
|||
$: title = isScreen ? "Screen" : $selectedComponent?._instanceName |
|||
$: position = componentDefinition?.hasChildren ? "inside" : "below" |
|||
</script> |
|||
|
|||
<Panel {title} icon={componentDefinition?.icon} borderLeft> |
|||
<Layout paddingX="L" paddingY="XL"> |
|||
<Body size="S"> |
|||
Components that you add will be placed {position} |
|||
{title} |
|||
</Body> |
|||
</Layout> |
|||
</Panel> |
|||
@ -1,26 +0,0 @@ |
|||
<script> |
|||
import NewComponentPanel from "./_components/NewComponentPanel.svelte" |
|||
import NewComponentTargetPanel from "./_components/NewComponentTargetPanel.svelte" |
|||
import { onMount } from "svelte" |
|||
import { store, selectedComponent, selectedScreen } from "builderStore" |
|||
import { redirect } from "@roxi/routify" |
|||
|
|||
// Select the screen slot as the target to add to, if no component |
|||
// is selected |
|||
onMount(() => { |
|||
if (!$selectedComponent) { |
|||
if ($selectedScreen) { |
|||
store.update(state => { |
|||
state.selectedComponentId = $selectedScreen.props._id |
|||
return state |
|||
}) |
|||
} else { |
|||
// Otherwise go back out of the add screen |
|||
$redirect("../") |
|||
} |
|||
} |
|||
}) |
|||
</script> |
|||
|
|||
<NewComponentPanel /> |
|||
<NewComponentTargetPanel /> |
|||
Loading…
Reference in new issue