0
Fork 0
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:
Alex Sánchez 2024-04-11 09:49:54 +02:00
parent 1fb18167f0
commit 3852805ffc
No known key found for this signature in database
GPG key ID: 68A95170EEB87E16
10 changed files with 61 additions and 2 deletions

View file

@ -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

View file

@ -0,0 +1,7 @@
export type ActionType =
| 'navigate'
| 'open-overlay'
| 'toggle-overlay'
| 'close-overlay'
| 'prev-screen'
| 'open-url';

View 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;
};

View file

@ -0,0 +1 @@
export type AnimationType = 'dissolve' | 'slide' | 'push';

View file

@ -0,0 +1 @@
export type DirectionType = 'right' | 'left' | 'up' | 'down';

View file

@ -0,0 +1 @@
export type EasingType = 'linear' | 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out';

View file

@ -0,0 +1,7 @@
export type EventType =
| 'click'
| 'mouse-press'
| 'mouse-over'
| 'mouse-enter'
| 'mouse-leave'
| 'after-delay';

View 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;
};

View file

@ -0,0 +1,9 @@
export type OverlayPositioningType =
| 'manual'
| 'center'
| 'top-left'
| 'top-right'
| 'top-center'
| 'bottom-left'
| 'bottom-right'
| 'bottom-center';

View file

@ -0,0 +1 @@
export type WayType = 'in' | 'out';