diff --git a/packages/builder/package.json b/packages/builder/package.json index d308c1e5ec..6d0bb15083 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -79,6 +79,7 @@ "posthog-js": "1.4.5", "remixicon": "2.5.0", "shortid": "2.2.15", + "svelte-dnd-action": "^0.8.9", "svelte-loading-spinners": "^0.1.1", "svelte-portal": "0.1.0", "uuid": "8.3.1", diff --git a/packages/builder/src/builderStore/dataBinding.js b/packages/builder/src/builderStore/dataBinding.js index 429ba1c683..dee0b86fb3 100644 --- a/packages/builder/src/builderStore/dataBinding.js +++ b/packages/builder/src/builderStore/dataBinding.js @@ -120,7 +120,7 @@ const getContextBindings = (asset, componentId) => { tableName = info.table?.name // Add _id and _rev fields for certain types - if (datasource.type === "table" || datasource.type === "link") { + if (schema && ["table", "link"].includes(datasource.type)) { schema["_id"] = { type: "string" } schema["_rev"] = { type: "string" } } diff --git a/packages/builder/src/builderStore/store/frontend.js b/packages/builder/src/builderStore/store/frontend.js index 19987764e5..8877ccef69 100644 --- a/packages/builder/src/builderStore/store/frontend.js +++ b/packages/builder/src/builderStore/store/frontend.js @@ -285,6 +285,7 @@ export const getFrontendStore = () => { _id: uuid(), _component: definition.component, _styles: { normal: {}, hover: {}, active: {} }, + _transition: "", _instanceName: `New ${definition.name}`, ...cloneDeep(props), ...extras, @@ -487,6 +488,15 @@ export const getFrontendStore = () => { selected._styles = { normal: {}, hover: {}, active: {} } await store.actions.preview.saveSelected() }, + updateTransition: async transition => { + const selected = get(selectedComponent) + if (transition == null || transition === "") { + selected._transition = "" + } else { + selected._transition = transition + } + await store.actions.preview.saveSelected() + }, updateProp: async (name, value) => { let component = get(selectedComponent) if (!name || !component) { diff --git a/packages/builder/src/builderStore/store/screenTemplates/utils/Component.js b/packages/builder/src/builderStore/store/screenTemplates/utils/Component.js index 182736a1d5..c4085e483c 100644 --- a/packages/builder/src/builderStore/store/screenTemplates/utils/Component.js +++ b/packages/builder/src/builderStore/store/screenTemplates/utils/Component.js @@ -14,6 +14,7 @@ export class Component extends BaseStructure { active: {}, selected: {}, }, + _transition: "", _instanceName: "", _children: [], } @@ -39,6 +40,11 @@ export class Component extends BaseStructure { return this } + transition(transition) { + this._json._transition = transition + return this + } + // Shorthand for custom props "type" type(type) { this._json.type = type diff --git a/packages/builder/src/components/automation/AutomationPanel/AutomationPanel.svelte b/packages/builder/src/components/automation/AutomationPanel/AutomationPanel.svelte index e09803e130..7d56867d03 100644 --- a/packages/builder/src/components/automation/AutomationPanel/AutomationPanel.svelte +++ b/packages/builder/src/components/automation/AutomationPanel/AutomationPanel.svelte @@ -2,10 +2,6 @@ import AutomationList from "./AutomationList.svelte" import CreateAutomationModal from "./CreateAutomationModal.svelte" import { Modal } from "@budibase/bbui" - import { automationStore, backendUiStore } from "builderStore" - import { notifier } from "builderStore/store/notifications" - - let selectedTab = "AUTOMATIONS" let modal @@ -40,12 +36,4 @@ cursor: pointer; color: var(--blue); } - - span:not(.selected) { - color: var(--grey-5); - } - - span:not(.selected):hover { - color: var(--ink); - } diff --git a/packages/builder/src/components/automation/AutomationPanel/CreateAutomationModal.svelte b/packages/builder/src/components/automation/AutomationPanel/CreateAutomationModal.svelte index 5bd535087d..804dceec87 100644 --- a/packages/builder/src/components/automation/AutomationPanel/CreateAutomationModal.svelte +++ b/packages/builder/src/components/automation/AutomationPanel/CreateAutomationModal.svelte @@ -8,13 +8,6 @@ $: valid = !!name $: instanceId = $backendUiStore.selectedDatabase._id - $: appId = $store.appId - - function sleep(ms) { - return new Promise(resolve => { - setTimeout(resolve, ms) - }) - } async function createAutomation() { await automationStore.actions.create({ diff --git a/packages/builder/src/components/automation/AutomationPanel/EditAutomationPopover.svelte b/packages/builder/src/components/automation/AutomationPanel/EditAutomationPopover.svelte index a3ec5b2ae5..eb983dc948 100644 --- a/packages/builder/src/components/automation/AutomationPanel/EditAutomationPopover.svelte +++ b/packages/builder/src/components/automation/AutomationPanel/EditAutomationPopover.svelte @@ -60,29 +60,4 @@ div.icon i { font-size: 16px; } - - ul { - list-style: none; - margin: 0; - padding: var(--spacing-s) 0; - } - - li { - display: flex; - font-family: var(--font-sans); - font-size: var(--font-size-xs); - color: var(--ink); - padding: var(--spacing-s) var(--spacing-m); - margin: auto 0; - align-items: center; - cursor: pointer; - } - - li:hover { - background-color: var(--grey-2); - } - - li:active { - color: var(--blue); - } diff --git a/packages/builder/src/components/automation/SetupPanel/AutomationBindingPanel.svelte b/packages/builder/src/components/automation/SetupPanel/AutomationBindingPanel.svelte new file mode 100644 index 0000000000..a05d5b9996 --- /dev/null +++ b/packages/builder/src/components/automation/SetupPanel/AutomationBindingPanel.svelte @@ -0,0 +1,190 @@ + + +
+
+ Available bindings + + + + {#each categories as [categoryName, bindings]} + {categoryName} + + {#each bindableProperties.filter(binding => + binding.label.match(searchRgx) + ) as binding} +
addToText(binding)}> + {binding.label} + {binding.type} +
+
+ {binding.description || ''} +
+
+ {/each} + {/each} + Helpers + + {#each helpers.filter(helper => helper.label.match(searchRgx) || helper.description.match(searchRgx)) as helper} +
addToText(helper)}> + {helper.label} +
+
+ {@html helper.description || ''} +
+
{helper.example || ''}
+
+ {/each} +
+
+