diff --git a/lerna.json b/lerna.json index 041a478a09..51d6b5caea 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.9.105-alpha.6", + "version": "0.9.105-alpha.7", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/auth/package.json b/packages/auth/package.json index 7198d3c2a6..bd4a0a500f 100644 --- a/packages/auth/package.json +++ b/packages/auth/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/auth", - "version": "0.9.105-alpha.6", + "version": "0.9.105-alpha.7", "description": "Authentication middlewares for budibase builder and apps", "main": "src/index.js", "author": "Budibase", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index b5a2f86db3..2040d38611 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "0.9.105-alpha.6", + "version": "0.9.105-alpha.7", "license": "AGPL-3.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", diff --git a/packages/builder/package.json b/packages/builder/package.json index f5dabb25c3..1831cf2e78 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "0.9.105-alpha.6", + "version": "0.9.105-alpha.7", "license": "AGPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^0.9.105-alpha.6", - "@budibase/client": "^0.9.105-alpha.6", + "@budibase/bbui": "^0.9.105-alpha.7", + "@budibase/client": "^0.9.105-alpha.7", "@budibase/colorpicker": "1.1.2", - "@budibase/string-templates": "^0.9.105-alpha.6", + "@budibase/string-templates": "^0.9.105-alpha.7", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/builder/src/builderStore/dataBinding.js b/packages/builder/src/builderStore/dataBinding.js index 6d7cad1cd0..dc995d611c 100644 --- a/packages/builder/src/builderStore/dataBinding.js +++ b/packages/builder/src/builderStore/dataBinding.js @@ -17,7 +17,13 @@ export const getBindableProperties = (asset, componentId) => { const contextBindings = getContextBindings(asset, componentId) const userBindings = getUserBindings() const urlBindings = getUrlBindings(asset) - return [...contextBindings, ...userBindings, ...urlBindings] + const deviceBindings = getDeviceBindings() + return [ + ...deviceBindings, + ...urlBindings, + ...contextBindings, + ...userBindings, + ] } /** @@ -221,6 +227,27 @@ const getUserBindings = () => { return bindings } +/** + * Gets all device bindings that are globally available. + */ +const getDeviceBindings = () => { + let bindings = [] + if (get(store).clientFeatures?.deviceAwareness) { + const safeDevice = makePropSafe("device") + bindings.push({ + type: "context", + runtimeBinding: `${safeDevice}.${makePropSafe("mobile")}`, + readableBinding: `Device.Mobile`, + }) + bindings.push({ + type: "context", + runtimeBinding: `${safeDevice}.${makePropSafe("tablet")}`, + readableBinding: `Device.Tablet`, + }) + } + return bindings +} + /** * Gets all bindable properties from URL parameters. */ diff --git a/packages/builder/src/builderStore/store/frontend.js b/packages/builder/src/builderStore/store/frontend.js index 3339ea07d6..1924ae07a2 100644 --- a/packages/builder/src/builderStore/store/frontend.js +++ b/packages/builder/src/builderStore/store/frontend.js @@ -35,6 +35,7 @@ const INITIAL_FRONTEND_STATE = { clientFeatures: { spectrumThemes: false, intelligentLoading: false, + deviceAwareness: false, }, currentFrontEndType: "none", selectedScreenId: "", diff --git a/packages/builder/src/components/common/bindings/BindingPanel.svelte b/packages/builder/src/components/common/bindings/BindingPanel.svelte index 6290bd2a3d..fdf708dc4e 100644 --- a/packages/builder/src/components/common/bindings/BindingPanel.svelte +++ b/packages/builder/src/components/common/bindings/BindingPanel.svelte @@ -38,7 +38,7 @@ {#if filteredColumns?.length}
-
Columns
+
Bindable Values