From 3e89f69ed0e6e5b4dbfd426f44382668fb803387 Mon Sep 17 00:00:00 2001 From: Michelle Meinert Date: Tue, 16 May 2023 11:12:20 +0200 Subject: [PATCH 1/4] feat: desktop only --- components.198185.json | 20 ++++++++++++++++---- src/components/physics-section.svelte | 24 ++++++++++++++++++++---- src/types/bloks.d.ts | 27 ++++++++++++++++++++------- 3 files changed, 56 insertions(+), 15 deletions(-) diff --git a/components.198185.json b/components.198185.json index e25e1273..76dd2e45 100644 --- a/components.198185.json +++ b/components.198185.json @@ -2095,7 +2095,7 @@ "name": "physics-balloon-card", "display_name": null, "created_at": "2023-04-14T10:39:02.963Z", - "updated_at": "2023-04-14T10:40:57.966Z", + "updated_at": "2023-05-12T15:06:10.366Z", "id": 3811407, "schema": { "text": { @@ -2127,6 +2127,9 @@ } ], "exclude_empty_option": true + }, + "isDesktopOnly": { + "type": "boolean" } }, "image": null, @@ -2146,11 +2149,14 @@ "name": "physics-input", "display_name": null, "created_at": "2023-04-17T15:13:53.017Z", - "updated_at": "2023-04-17T15:14:00.636Z", + "updated_at": "2023-05-12T15:06:42.156Z", "id": 3830600, "schema": { "placeholder": { "type": "text" + }, + "isDesktopOnly": { + "type": "boolean" } }, "image": null, @@ -2170,7 +2176,7 @@ "name": "physics-rectangle-card", "display_name": null, "created_at": "2023-04-14T10:37:48.156Z", - "updated_at": "2023-04-14T10:38:41.658Z", + "updated_at": "2023-05-12T15:05:52.122Z", "id": 3811406, "schema": { "text": { @@ -2192,6 +2198,9 @@ } ], "exclude_empty_option": true + }, + "isDesktopOnly": { + "type": "boolean" } }, "image": null, @@ -2211,13 +2220,16 @@ "name": "physics-sticker", "display_name": null, "created_at": "2023-04-26T13:15:00.766Z", - "updated_at": "2023-04-26T16:25:36.409Z", + "updated_at": "2023-05-12T15:04:09.272Z", "id": 3889837, "schema": { "photo": { "type": "asset", "filetypes": ["images"], "asset_folder_id": 234280 + }, + "isDesktopOnly": { + "type": "boolean" } }, "image": null, diff --git a/src/components/physics-section.svelte b/src/components/physics-section.svelte index f9e18c6c..32438339 100644 --- a/src/components/physics-section.svelte +++ b/src/components/physics-section.svelte @@ -357,13 +357,21 @@ {:else if item.component === 'physics-rectangle-card'} {:else if item.component === 'physics-input'}
@@ -372,14 +380,22 @@ form={i + item._uid} block={item} bind:ref={refs[i]} - class={clsx('absolute w-fit', !engine && 'invisible')} + class={clsx( + 'absolute w-fit', + !engine && 'invisible', + item.isDesktopOnly && 'invisible md:visible' + )} />
{:else if item.component === 'physics-sticker' && item.photo} {@const { width, height, src, alt } = getImageAttributes(item.photo)} Date: Thu, 18 May 2023 10:19:40 +0200 Subject: [PATCH 2/4] fix: property name --- components.198185.json | 36 +++++++++++++++++---------- src/components/physics-section.svelte | 18 ++++++-------- src/types/bloks.d.ts | 8 +++--- 3 files changed, 34 insertions(+), 28 deletions(-) diff --git a/components.198185.json b/components.198185.json index 2816dbd0..d4125f7d 100644 --- a/components.198185.json +++ b/components.198185.json @@ -2095,7 +2095,7 @@ "name": "physics-balloon-card", "display_name": null, "created_at": "2023-04-14T10:39:02.963Z", - "updated_at": "2023-05-12T15:06:10.366Z", + "updated_at": "2023-05-18T07:26:57.000Z", "id": 3811407, "schema": { "text": { @@ -2128,7 +2128,7 @@ ], "exclude_empty_option": true }, - "isDesktopOnly": { + "is_desktop_only": { "type": "boolean" } }, @@ -2149,13 +2149,13 @@ "name": "physics-input", "display_name": null, "created_at": "2023-04-17T15:13:53.017Z", - "updated_at": "2023-05-12T15:06:42.156Z", + "updated_at": "2023-05-18T07:27:49.440Z", "id": 3830600, "schema": { "placeholder": { "type": "text" }, - "isDesktopOnly": { + "is_desktop_only": { "type": "boolean" } }, @@ -2176,11 +2176,13 @@ "name": "physics-rectangle-card", "display_name": null, "created_at": "2023-04-14T10:37:48.156Z", - "updated_at": "2023-05-12T15:05:52.122Z", + "updated_at": "2023-05-18T07:25:20.056Z", "id": 3811406, "schema": { "text": { - "type": "text" + "type": "text", + "key": "text", + "pos": 0 }, "theme": { "type": "option", @@ -2197,10 +2199,14 @@ "name": "Yellow" } ], - "exclude_empty_option": true + "exclude_empty_option": true, + "key": "theme", + "pos": 1 }, - "isDesktopOnly": { - "type": "boolean" + "is_desktop_only": { + "type": "boolean", + "key": "isDesktopOnly", + "pos": 2 } }, "image": null, @@ -2220,16 +2226,20 @@ "name": "physics-sticker", "display_name": null, "created_at": "2023-04-26T13:15:00.766Z", - "updated_at": "2023-05-12T15:04:09.272Z", + "updated_at": "2023-05-18T07:26:39.476Z", "id": 3889837, "schema": { "photo": { "type": "asset", "filetypes": ["images"], - "asset_folder_id": 234280 + "asset_folder_id": 234280, + "key": "photo", + "pos": 0 }, - "isDesktopOnly": { - "type": "boolean" + "is_desktop_only": { + "type": "boolean", + "key": "isDesktopOnly", + "pos": 1 } }, "image": null, diff --git a/src/components/physics-section.svelte b/src/components/physics-section.svelte index 32438339..6764b173 100644 --- a/src/components/physics-section.svelte +++ b/src/components/physics-section.svelte @@ -357,11 +357,7 @@ {:else if item.component === 'physics-rectangle-card'} {:else if item.component === 'physics-input'} @@ -382,8 +378,8 @@ bind:ref={refs[i]} class={clsx( 'absolute w-fit', - !engine && 'invisible', - item.isDesktopOnly && 'invisible md:visible' + !engine && 'invisible' + //item.is_desktop_only && 'hidden md:block' )} /> @@ -393,8 +389,8 @@ bind:this={refs[i]} class={clsx( 'absolute select-none drop-shadow-md', - !engine && 'invisible', - item.isDesktopOnly && 'invisible md:visible' + !engine && 'invisible' + //item.is_desktop_only && 'hidden md:block' )} {src} {alt} diff --git a/src/types/bloks.d.ts b/src/types/bloks.d.ts index 389a29e5..5c8faf0e 100644 --- a/src/types/bloks.d.ts +++ b/src/types/bloks.d.ts @@ -569,7 +569,7 @@ export interface PhotoCardStoryblok { export interface PhysicsBalloonCardStoryblok { text?: string; theme?: 'inverted' | 'panel' | 'offset' | 'yellow'; - isDesktopOnly?: boolean; + is_desktop_only?: boolean; _uid: string; component: 'physics-balloon-card'; [k: string]: any; @@ -577,7 +577,7 @@ export interface PhysicsBalloonCardStoryblok { export interface PhysicsInputStoryblok { placeholder?: string; - isDesktopOnly?: boolean; + is_desktop_only?: boolean; _uid: string; component: 'physics-input'; [k: string]: any; @@ -586,7 +586,7 @@ export interface PhysicsInputStoryblok { export interface PhysicsRectangleCardStoryblok { text?: string; theme?: 'transparent' | 'yellow'; - isDesktopOnly?: boolean; + is_desktop_only?: boolean; _uid: string; component: 'physics-rectangle-card'; [k: string]: any; @@ -594,7 +594,7 @@ export interface PhysicsRectangleCardStoryblok { export interface PhysicsStickerStoryblok { photo?: AssetStoryblok; - isDesktopOnly?: boolean; + is_desktop_only?: boolean; _uid: string; component: 'physics-sticker'; [k: string]: any; From 07255e6108f869dff436064081a33f2e501d1e4e Mon Sep 17 00:00:00 2001 From: Filipe Ferreira Date: Thu, 18 May 2023 12:17:55 +0100 Subject: [PATCH 3/4] fix(physics): desktop only bodies --- src/components/physics-section.svelte | 79 ++++++++++++++------------- 1 file changed, 42 insertions(+), 37 deletions(-) diff --git a/src/components/physics-section.svelte b/src/components/physics-section.svelte index 6764b173..1826da72 100644 --- a/src/components/physics-section.svelte +++ b/src/components/physics-section.svelte @@ -1,6 +1,6 @@