From 94472a95cc4919b01a339f9b1d524bb4ce4fc0da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20S=C3=A1nchez?= Date: Thu, 11 Apr 2024 10:09:14 +0200 Subject: [PATCH] blur and fixes --- src/ui/lib/types/shape.d.ts | 6 +++--- src/ui/lib/types/utils/animation.d.ts | 8 ++++++++ src/ui/lib/types/utils/blur.d.ts | 8 ++++++++ src/ui/lib/types/utils/interaction.d.ts | 17 ++++++++++++++++ .../types/utils/interactions/actionType.d.ts | 7 ------- .../types/utils/interactions/animation.d.ts | 13 ------------ .../utils/interactions/animationType.d.ts | 1 - .../utils/interactions/directionType.d.ts | 1 - .../types/utils/interactions/easingType.d.ts | 1 - .../types/utils/interactions/eventType.d.ts | 7 ------- .../types/utils/interactions/interaction.d.ts | 20 ------------------- .../interactions/overlayPositioningType.d.ts | 9 --------- .../lib/types/utils/interactions/wayType.d.ts | 1 - src/ui/lib/types/utils/shadow.d.ts | 4 +--- 14 files changed, 37 insertions(+), 66 deletions(-) create mode 100644 src/ui/lib/types/utils/animation.d.ts create mode 100644 src/ui/lib/types/utils/blur.d.ts create mode 100644 src/ui/lib/types/utils/interaction.d.ts delete mode 100644 src/ui/lib/types/utils/interactions/actionType.d.ts delete mode 100644 src/ui/lib/types/utils/interactions/animation.d.ts delete mode 100644 src/ui/lib/types/utils/interactions/animationType.d.ts delete mode 100644 src/ui/lib/types/utils/interactions/directionType.d.ts delete mode 100644 src/ui/lib/types/utils/interactions/easingType.d.ts delete mode 100644 src/ui/lib/types/utils/interactions/eventType.d.ts delete mode 100644 src/ui/lib/types/utils/interactions/interaction.d.ts delete mode 100644 src/ui/lib/types/utils/interactions/overlayPositioningType.d.ts delete mode 100644 src/ui/lib/types/utils/interactions/wayType.d.ts diff --git a/src/ui/lib/types/shape.d.ts b/src/ui/lib/types/shape.d.ts index de6f3e2..bc37872 100644 --- a/src/ui/lib/types/shape.d.ts +++ b/src/ui/lib/types/shape.d.ts @@ -1,3 +1,4 @@ +import { Blur } from './utils/blur'; import { Export } from './utils/export'; import { Fill } from './utils/fill'; import { Grid } from './utils/grid'; @@ -46,8 +47,7 @@ export type Shape = { transformInverse?: Matrix; blendMode?: string; interactions?: Interaction[]; - shadow?: Shadow; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - blur?: any; + shadow?: Shadow[]; + blur?: Blur; growType?: 'auto-width' | 'auto-height' | 'fixed'; }; diff --git a/src/ui/lib/types/utils/animation.d.ts b/src/ui/lib/types/utils/animation.d.ts new file mode 100644 index 0000000..1497a15 --- /dev/null +++ b/src/ui/lib/types/utils/animation.d.ts @@ -0,0 +1,8 @@ +export type Animation = { + animationType: symbol; // 'dissolve' | 'slide' | 'push' + duration: number; + easing: symbol; // 'linear' | 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' + way?: symbol; // 'in' | 'out' + direction?: symbol; // 'right' | 'left' | 'up' | 'down' + offsetEffect?: boolean; +}; diff --git a/src/ui/lib/types/utils/blur.d.ts b/src/ui/lib/types/utils/blur.d.ts new file mode 100644 index 0000000..e1ba2ce --- /dev/null +++ b/src/ui/lib/types/utils/blur.d.ts @@ -0,0 +1,8 @@ +import { Uuid } from './uuid'; + +export type Blur = { + id: Uuid; + type: symbol; // layer-blur + value: number; + hidden: boolean; +}; diff --git a/src/ui/lib/types/utils/interaction.d.ts b/src/ui/lib/types/utils/interaction.d.ts new file mode 100644 index 0000000..2708796 --- /dev/null +++ b/src/ui/lib/types/utils/interaction.d.ts @@ -0,0 +1,17 @@ +import { Animation } from './animation'; +import { Uuid } from './uuid'; + +export type Interaction = { + eventType: symbol; // 'click' | 'mouse-press' | 'mouse-over' | 'mouse-enter' | 'mouse-leave' | 'after-delay' + actionType: symbol; // 'navigate' | 'open-overlay' | 'toggle-overlay' | 'close-overlay' | 'prev-screen' | 'open-url' + destination?: Uuid; + preserveScroll?: boolean; + animation?: Animation; + overlayPosition?: { x: number; y: number }; + overlayPosType?: symbol; // 'manual' | 'center' | 'top-left' | 'top-right' | 'top-center' | 'bottom-left' | 'bottom-right' | 'bottom-center' + closeClickOutside?: boolean; + backgroundOverlay?: boolean; + positionRelativeTo?: Uuid; + url?: string; + delay?: number; +}; diff --git a/src/ui/lib/types/utils/interactions/actionType.d.ts b/src/ui/lib/types/utils/interactions/actionType.d.ts deleted file mode 100644 index 9a6432c..0000000 --- a/src/ui/lib/types/utils/interactions/actionType.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export type ActionType = - | 'navigate' - | 'open-overlay' - | 'toggle-overlay' - | 'close-overlay' - | 'prev-screen' - | 'open-url'; diff --git a/src/ui/lib/types/utils/interactions/animation.d.ts b/src/ui/lib/types/utils/interactions/animation.d.ts deleted file mode 100644 index 21d47bd..0000000 --- a/src/ui/lib/types/utils/interactions/animation.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { AnimationType } from './animationType'; -import { DirectionType } from './directionType'; -import { EasingType } from './easingType'; -import { WayType } from './wayType'; - -export type Animation = { - animationType: AnimationType; - duration: number; - easing: EasingType; - way?: WayType; - direction?: DirectionType; - offsetEffect?: boolean; -}; diff --git a/src/ui/lib/types/utils/interactions/animationType.d.ts b/src/ui/lib/types/utils/interactions/animationType.d.ts deleted file mode 100644 index 2d1e470..0000000 --- a/src/ui/lib/types/utils/interactions/animationType.d.ts +++ /dev/null @@ -1 +0,0 @@ -export type AnimationType = 'dissolve' | 'slide' | 'push'; diff --git a/src/ui/lib/types/utils/interactions/directionType.d.ts b/src/ui/lib/types/utils/interactions/directionType.d.ts deleted file mode 100644 index 9598ade..0000000 --- a/src/ui/lib/types/utils/interactions/directionType.d.ts +++ /dev/null @@ -1 +0,0 @@ -export type DirectionType = 'right' | 'left' | 'up' | 'down'; diff --git a/src/ui/lib/types/utils/interactions/easingType.d.ts b/src/ui/lib/types/utils/interactions/easingType.d.ts deleted file mode 100644 index 3fac235..0000000 --- a/src/ui/lib/types/utils/interactions/easingType.d.ts +++ /dev/null @@ -1 +0,0 @@ -export type EasingType = 'linear' | 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out'; diff --git a/src/ui/lib/types/utils/interactions/eventType.d.ts b/src/ui/lib/types/utils/interactions/eventType.d.ts deleted file mode 100644 index d475c19..0000000 --- a/src/ui/lib/types/utils/interactions/eventType.d.ts +++ /dev/null @@ -1,7 +0,0 @@ -export type EventType = - | 'click' - | 'mouse-press' - | 'mouse-over' - | 'mouse-enter' - | 'mouse-leave' - | 'after-delay'; diff --git a/src/ui/lib/types/utils/interactions/interaction.d.ts b/src/ui/lib/types/utils/interactions/interaction.d.ts deleted file mode 100644 index 9e49f4b..0000000 --- a/src/ui/lib/types/utils/interactions/interaction.d.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { Uuid } from '../uuid'; -import { ActionType } from './actionType'; -import { Animation } from './animation'; -import { EventType } from './eventType'; -import { OverlayPositioningType } from './overlayPositioningType'; - -export type Interaction = { - eventType: EventType; - actionType: ActionType; - destination?: Uuid; - preserveScroll?: boolean; - animation?: Animation; - overlayPosition?: { x: number; y: number }; - overlayPosType?: OverlayPositioningType; - closeClickOutside?: boolean; - backgroundOverlay?: boolean; - positionRelativeTo?: Uuid; - url?: string; - delay?: number; -}; diff --git a/src/ui/lib/types/utils/interactions/overlayPositioningType.d.ts b/src/ui/lib/types/utils/interactions/overlayPositioningType.d.ts deleted file mode 100644 index 2ac693d..0000000 --- a/src/ui/lib/types/utils/interactions/overlayPositioningType.d.ts +++ /dev/null @@ -1,9 +0,0 @@ -export type OverlayPositioningType = - | 'manual' - | 'center' - | 'top-left' - | 'top-right' - | 'top-center' - | 'bottom-left' - | 'bottom-right' - | 'bottom-center'; diff --git a/src/ui/lib/types/utils/interactions/wayType.d.ts b/src/ui/lib/types/utils/interactions/wayType.d.ts deleted file mode 100644 index b01b723..0000000 --- a/src/ui/lib/types/utils/interactions/wayType.d.ts +++ /dev/null @@ -1 +0,0 @@ -export type WayType = 'in' | 'out'; diff --git a/src/ui/lib/types/utils/shadow.d.ts b/src/ui/lib/types/utils/shadow.d.ts index 96f4cb7..9bf690b 100644 --- a/src/ui/lib/types/utils/shadow.d.ts +++ b/src/ui/lib/types/utils/shadow.d.ts @@ -1,11 +1,9 @@ import { Gradient } from './gradient'; import { Uuid } from './uuid'; -type ShadowStyle = 'drop-shadow' | 'inner-shadow'; - export type Shadow = { id?: Uuid; - style: ShadowStyle; + style: symbol; // 'drop-shadow' | 'inner-shadow' offsetX: number; offsetY: number; blur: number;