@contember/echo 0.0.18 → 0.0.20
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/config/drawingConfig.d.ts +2 -2
- package/dist/echo.es.js +2059 -2047
- package/dist/echo.umd.js +45 -44
- package/dist/features/drawing/components/Shape.d.ts +3 -5
- package/dist/features/drawing/index.d.ts +0 -3
- package/dist/features/launcher/components/EchoLauncherButton.d.ts +2 -0
- package/dist/stores/drawingStore.d.ts +40 -0
- package/dist/stores/echoStore.d.ts +11 -46
- package/dist/stores/feedbackStore.d.ts +12 -0
- package/dist/stores/index.d.ts +3 -1
- package/dist/stores/widgetStore.d.ts +22 -0
- package/dist/types.d.ts +1 -1
- package/dist/utils/geometry.d.ts +1 -0
- package/dist/utils/index.d.ts +0 -1
- package/dist/utils/storage.d.ts +1 -1
- package/dist/utils/svg.d.ts +13 -0
- package/package.json +2 -1
- package/dist/features/drawing/hooks/index.d.ts +0 -3
- package/dist/features/drawing/hooks/useDrag.d.ts +0 -17
- package/dist/features/drawing/hooks/useDrawing.d.ts +0 -11
- package/dist/features/drawing/hooks/useViewport.d.ts +0 -4
- package/dist/features/drawing/types/index.d.ts +0 -21
- package/dist/features/drawing/utils/index.d.ts +0 -2
- package/dist/features/drawing/utils/svg.d.ts +0 -12
- package/dist/features/launcher/components/EchoButton.d.ts +0 -2
- package/dist/stores/welcomeMessageStore.d.ts +0 -4
- package/dist/utils/shape.d.ts +0 -2
- /package/dist/{features/drawing/utils → utils}/events.d.ts +0 -0
@@ -1,10 +1,8 @@
|
|
1
|
-
import
|
1
|
+
import { Component } from 'solid-js';
|
2
2
|
import type { Shape as ShapeType } from '~/types';
|
3
|
-
|
4
|
-
shape: ShapeType;
|
3
|
+
type ShapeProps = ShapeType & {
|
5
4
|
selectedShapeId: string | null;
|
6
5
|
onShapeClick?: (id: string) => void;
|
7
|
-
|
8
|
-
}
|
6
|
+
};
|
9
7
|
export declare const Shape: Component<ShapeProps>;
|
10
8
|
export {};
|
@@ -0,0 +1,40 @@
|
|
1
|
+
import type { DrawingTool, Point, Shape } from '~/types';
|
2
|
+
export interface DrawingState {
|
3
|
+
isDrawing: boolean;
|
4
|
+
selectedShapeId: string | null;
|
5
|
+
selectedTool: DrawingTool;
|
6
|
+
selectedColor: string;
|
7
|
+
shapes: Shape[];
|
8
|
+
currentPoints: Point[];
|
9
|
+
currentPath: string;
|
10
|
+
showTooltip: boolean;
|
11
|
+
mousePosition: Point;
|
12
|
+
hasDrawn: boolean;
|
13
|
+
isDragging: boolean;
|
14
|
+
dragStartPos: Point | null;
|
15
|
+
initialClickPos: Point | null;
|
16
|
+
dragOffset: Point | null;
|
17
|
+
cursor: string;
|
18
|
+
}
|
19
|
+
export interface DrawingStore {
|
20
|
+
state: DrawingState;
|
21
|
+
setState: (state: Partial<DrawingState>, isClearing?: boolean) => void;
|
22
|
+
methods: {
|
23
|
+
startDrawing: (initialPoint: Point) => void;
|
24
|
+
updateDrawing: (point: Point) => void;
|
25
|
+
finishDrawing: () => void;
|
26
|
+
handleShapeClick: (shapeId: string) => void;
|
27
|
+
handleStart: (e: MouseEvent | TouchEvent) => void;
|
28
|
+
handleMove: (e: MouseEvent | TouchEvent) => void;
|
29
|
+
handleEnd: (e: MouseEvent | TouchEvent) => void;
|
30
|
+
handleEnter: (e: MouseEvent | TouchEvent) => void;
|
31
|
+
handleLeave: (e: MouseEvent | TouchEvent) => void;
|
32
|
+
startDrag: (point: Point) => void;
|
33
|
+
stopDrag: () => void;
|
34
|
+
setInitialClick: (point: Point | null) => void;
|
35
|
+
updateDragOffset: (shape: {
|
36
|
+
points: Point[];
|
37
|
+
}, point: Point) => void;
|
38
|
+
};
|
39
|
+
}
|
40
|
+
export declare const createDrawingStore: (primaryColor: string, onStateChange?: (state: Partial<DrawingState>, isClearing?: boolean) => void) => DrawingStore;
|
@@ -1,55 +1,20 @@
|
|
1
|
-
import type {
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
selectedColor: string;
|
13
|
-
shapes: Shape[];
|
14
|
-
currentPoints: Point[];
|
15
|
-
currentPath: string;
|
16
|
-
showTooltip: boolean;
|
17
|
-
mousePosition: Point;
|
18
|
-
hasDrawn: boolean;
|
19
|
-
isDragging: boolean;
|
20
|
-
dragStartPos: Point | null;
|
21
|
-
initialClickPos: Point | null;
|
22
|
-
dragOffset: Point | null;
|
23
|
-
}
|
24
|
-
export interface WidgetState {
|
25
|
-
isOpen: boolean;
|
26
|
-
primaryColor: string;
|
27
|
-
onSubmit: (data: FeedbackData) => void | Promise<void>;
|
28
|
-
notification: Notification;
|
29
|
-
dimensions: {
|
30
|
-
width: number;
|
31
|
-
height: number;
|
1
|
+
import type { FeedbackData, TextConfig } from '~/types';
|
2
|
+
import { type DrawingStore } from './drawingStore';
|
3
|
+
import { type FeedbackStore } from './feedbackStore';
|
4
|
+
import { type WidgetStore } from './widgetStore';
|
5
|
+
export interface EchoStore {
|
6
|
+
feedback: FeedbackStore;
|
7
|
+
drawing: DrawingStore;
|
8
|
+
widget: WidgetStore;
|
9
|
+
text: TextConfig;
|
10
|
+
methods: {
|
11
|
+
reset: () => void;
|
32
12
|
};
|
33
|
-
isPagesDropdownOpen: boolean;
|
34
|
-
pagesCount: number;
|
35
13
|
}
|
36
14
|
interface EchoStoreConfig {
|
37
15
|
primaryColor: string;
|
38
16
|
onSubmit: (data: FeedbackData) => Promise<void>;
|
39
17
|
text: TextConfig;
|
40
18
|
}
|
41
|
-
export interface EchoStore {
|
42
|
-
feedback: FeedbackState;
|
43
|
-
setFeedback: (state: Partial<FeedbackState>, isClearing?: boolean) => void;
|
44
|
-
drawing: DrawingState;
|
45
|
-
setDrawing: (state: Partial<DrawingState>, isClearing?: boolean) => void;
|
46
|
-
widget: WidgetState;
|
47
|
-
setWidget: (state: Partial<WidgetState>) => void;
|
48
|
-
text: TextConfig;
|
49
|
-
methods: {
|
50
|
-
reset: () => void;
|
51
|
-
postSubmit: (result: Notification) => void;
|
52
|
-
};
|
53
|
-
}
|
54
19
|
export declare const createEchoStore: (config: EchoStoreConfig) => EchoStore;
|
55
20
|
export {};
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import type { Screenshot } from '~/types';
|
2
|
+
export interface FeedbackState {
|
3
|
+
comment: string;
|
4
|
+
screenshot?: Screenshot;
|
5
|
+
isCapturing: boolean;
|
6
|
+
isMinimized: boolean;
|
7
|
+
}
|
8
|
+
export interface FeedbackStore {
|
9
|
+
state: FeedbackState;
|
10
|
+
setState: (state: Partial<FeedbackState>, isClearing?: boolean) => void;
|
11
|
+
}
|
12
|
+
export declare const createFeedbackStore: (initialComment?: string, onStateChange?: (state: Partial<FeedbackState>, isClearing?: boolean) => void) => FeedbackStore;
|
package/dist/stores/index.d.ts
CHANGED
@@ -0,0 +1,22 @@
|
|
1
|
+
import type { FeedbackData, Notification } from '~/types';
|
2
|
+
export interface WidgetState {
|
3
|
+
isOpen: boolean;
|
4
|
+
primaryColor: string;
|
5
|
+
notification: Notification;
|
6
|
+
dimensions: {
|
7
|
+
width: number;
|
8
|
+
height: number;
|
9
|
+
};
|
10
|
+
isPagesDropdownOpen: boolean;
|
11
|
+
pagesCount: number;
|
12
|
+
welcomeMessageIsClosing: boolean;
|
13
|
+
}
|
14
|
+
export interface WidgetStore {
|
15
|
+
state: WidgetState;
|
16
|
+
setState: (state: Partial<WidgetState>) => void;
|
17
|
+
methods: {
|
18
|
+
postSubmit: (result: Notification) => void;
|
19
|
+
onSubmit: (data: FeedbackData) => Promise<void>;
|
20
|
+
};
|
21
|
+
}
|
22
|
+
export declare const createWidgetStore: (primaryColor: string, onSubmit: (data: FeedbackData) => Promise<void>) => WidgetStore;
|
package/dist/types.d.ts
CHANGED
package/dist/utils/geometry.d.ts
CHANGED
package/dist/utils/index.d.ts
CHANGED
package/dist/utils/storage.d.ts
CHANGED
package/package.json
CHANGED
@@ -1,17 +0,0 @@
|
|
1
|
-
import type { Point } from '~/types';
|
2
|
-
export declare const useDrag: () => {
|
3
|
-
state: {
|
4
|
-
isDragging: import("solid-js").Accessor<boolean>;
|
5
|
-
dragStartPos: import("solid-js").Accessor<Point | null>;
|
6
|
-
initialClickPos: import("solid-js").Accessor<Point | null>;
|
7
|
-
dragOffset: import("solid-js").Accessor<Point | null>;
|
8
|
-
};
|
9
|
-
actions: {
|
10
|
-
startDrag: (point: Point) => void;
|
11
|
-
stopDrag: () => void;
|
12
|
-
setInitialClick: (point: Point | null) => void;
|
13
|
-
updateDragOffset: (shape: {
|
14
|
-
points: Point[];
|
15
|
-
}, point: Point) => void;
|
16
|
-
};
|
17
|
-
};
|
@@ -1,11 +0,0 @@
|
|
1
|
-
export declare const useDrawing: () => {
|
2
|
-
state: import("../../../stores").DrawingState;
|
3
|
-
actions: {
|
4
|
-
handleStart: (e: MouseEvent | TouchEvent) => void;
|
5
|
-
handleMove: (e: MouseEvent | TouchEvent) => void;
|
6
|
-
handleEnd: (e: MouseEvent | TouchEvent) => void;
|
7
|
-
handleEnter: (e: MouseEvent | TouchEvent) => void;
|
8
|
-
handleLeave: (e: MouseEvent | TouchEvent) => void;
|
9
|
-
handleShapeClick: (shapeId: string) => void;
|
10
|
-
};
|
11
|
-
};
|
@@ -1,21 +0,0 @@
|
|
1
|
-
import { Point, Shape } from '~/types';
|
2
|
-
export interface DrawingState {
|
3
|
-
isDrawing: boolean;
|
4
|
-
currentPoints: Point[];
|
5
|
-
currentPath: string;
|
6
|
-
selectedShapeId: string | null;
|
7
|
-
mousePosition: Point | null;
|
8
|
-
showTooltip: boolean;
|
9
|
-
hasDrawn: boolean;
|
10
|
-
selectedTool: string;
|
11
|
-
selectedColor: string;
|
12
|
-
shapes: Shape[];
|
13
|
-
isDragging: boolean;
|
14
|
-
dragStartPos: Point | null;
|
15
|
-
initialClickPos: Point | null;
|
16
|
-
dragOffset: Point | null;
|
17
|
-
}
|
18
|
-
export interface ViewportState {
|
19
|
-
width: number;
|
20
|
-
height: number;
|
21
|
-
}
|
@@ -1,12 +0,0 @@
|
|
1
|
-
import type { ViewportState } from '../types';
|
2
|
-
export declare const generateCutoutPath: (viewport: ViewportState, currentPoints: {
|
3
|
-
x: number;
|
4
|
-
y: number;
|
5
|
-
}[], shapes: {
|
6
|
-
type: string;
|
7
|
-
points: {
|
8
|
-
x: number;
|
9
|
-
y: number;
|
10
|
-
}[];
|
11
|
-
}[]) => string;
|
12
|
-
export declare const getPenCursor: (color: string) => string;
|
package/dist/utils/shape.d.ts
DELETED
File without changes
|