mirror of
https://github.com/penpot/penpot-exporter-figma-plugin.git
synced 2024-12-22 13:43:03 -05:00
interactions
This commit is contained in:
parent
1fb18167f0
commit
3852805ffc
10 changed files with 61 additions and 2 deletions
4
src/ui/lib/types/shape.d.ts
vendored
4
src/ui/lib/types/shape.d.ts
vendored
|
@ -1,6 +1,7 @@
|
|||
import { Export } from './utils/export';
|
||||
import { Fill } from './utils/fill';
|
||||
import { Grid } from './utils/grid';
|
||||
import { Interaction } from './utils/interactions/interaction';
|
||||
import { Matrix } from './utils/matrix';
|
||||
import { Point } from './utils/point';
|
||||
import { Selrect } from './utils/selrect';
|
||||
|
@ -43,8 +44,7 @@ export type Shape = {
|
|||
transform?: Matrix;
|
||||
transformInverse?: Matrix;
|
||||
blendMode?: string;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
interactions?: any;
|
||||
interactions?: Interaction[];
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
shadow?: any;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
|
|
7
src/ui/lib/types/utils/interactions/actionType.d.ts
vendored
Normal file
7
src/ui/lib/types/utils/interactions/actionType.d.ts
vendored
Normal file
|
@ -0,0 +1,7 @@
|
|||
export type ActionType =
|
||||
| 'navigate'
|
||||
| 'open-overlay'
|
||||
| 'toggle-overlay'
|
||||
| 'close-overlay'
|
||||
| 'prev-screen'
|
||||
| 'open-url';
|
13
src/ui/lib/types/utils/interactions/animation.d.ts
vendored
Normal file
13
src/ui/lib/types/utils/interactions/animation.d.ts
vendored
Normal file
|
@ -0,0 +1,13 @@
|
|||
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;
|
||||
};
|
1
src/ui/lib/types/utils/interactions/animationType.d.ts
vendored
Normal file
1
src/ui/lib/types/utils/interactions/animationType.d.ts
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
export type AnimationType = 'dissolve' | 'slide' | 'push';
|
1
src/ui/lib/types/utils/interactions/directionType.d.ts
vendored
Normal file
1
src/ui/lib/types/utils/interactions/directionType.d.ts
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
export type DirectionType = 'right' | 'left' | 'up' | 'down';
|
1
src/ui/lib/types/utils/interactions/easingType.d.ts
vendored
Normal file
1
src/ui/lib/types/utils/interactions/easingType.d.ts
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
export type EasingType = 'linear' | 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out';
|
7
src/ui/lib/types/utils/interactions/eventType.d.ts
vendored
Normal file
7
src/ui/lib/types/utils/interactions/eventType.d.ts
vendored
Normal file
|
@ -0,0 +1,7 @@
|
|||
export type EventType =
|
||||
| 'click'
|
||||
| 'mouse-press'
|
||||
| 'mouse-over'
|
||||
| 'mouse-enter'
|
||||
| 'mouse-leave'
|
||||
| 'after-delay';
|
19
src/ui/lib/types/utils/interactions/interaction.d.ts
vendored
Normal file
19
src/ui/lib/types/utils/interactions/interaction.d.ts
vendored
Normal file
|
@ -0,0 +1,19 @@
|
|||
import { ActionType } from './actionType';
|
||||
import { Animation } from './animation';
|
||||
import { EventType } from './eventType';
|
||||
import { OverlayPositioningType } from './overlayPositioningType';
|
||||
|
||||
export type Interaction = {
|
||||
eventType: EventType;
|
||||
actionType: ActionType;
|
||||
destination?: string;
|
||||
preserveScroll?: boolean;
|
||||
animation?: Animation;
|
||||
overlayPosition?: { x: number; y: number };
|
||||
overlayPosType?: OverlayPositioningType;
|
||||
closeClickOutside?: boolean;
|
||||
backgroundOverlay?: boolean;
|
||||
positionRelativeTo?: string;
|
||||
url?: string;
|
||||
delay?: number;
|
||||
};
|
9
src/ui/lib/types/utils/interactions/overlayPositioningType.d.ts
vendored
Normal file
9
src/ui/lib/types/utils/interactions/overlayPositioningType.d.ts
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
export type OverlayPositioningType =
|
||||
| 'manual'
|
||||
| 'center'
|
||||
| 'top-left'
|
||||
| 'top-right'
|
||||
| 'top-center'
|
||||
| 'bottom-left'
|
||||
| 'bottom-right'
|
||||
| 'bottom-center';
|
1
src/ui/lib/types/utils/interactions/wayType.d.ts
vendored
Normal file
1
src/ui/lib/types/utils/interactions/wayType.d.ts
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
export type WayType = 'in' | 'out';
|
Loading…
Reference in a new issue