@contember/echo 0.0.26 → 0.0.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/echo.es.js +767 -782
- package/dist/echo.es.js.map +1 -0
- package/dist/echo.umd.js +6 -5
- package/dist/echo.umd.js.map +1 -0
- package/package.json +1 -1
- package/dist/components/Echo.d.ts +0 -3
- package/dist/components/atoms/Button.d.ts +0 -7
- package/dist/components/atoms/Shape.d.ts +0 -8
- package/dist/components/atoms/index.d.ts +0 -1
- package/dist/components/icons/CheckCircleIcon.d.ts +0 -3
- package/dist/components/icons/ChevronRightIcon.d.ts +0 -3
- package/dist/components/icons/ContemberIcon.d.ts +0 -3
- package/dist/components/icons/ExternalLinkIcon.d.ts +0 -3
- package/dist/components/icons/HighlightIcon.d.ts +0 -3
- package/dist/components/icons/PenIcon.d.ts +0 -3
- package/dist/components/icons/TrashIcon.d.ts +0 -3
- package/dist/components/icons/XCircleIcon.d.ts +0 -3
- package/dist/components/icons/XIcon.d.ts +0 -3
- package/dist/components/icons/index.d.ts +0 -8
- package/dist/components/molecules/ColorSelector.d.ts +0 -2
- package/dist/components/molecules/DrawingToolbar.d.ts +0 -2
- package/dist/components/molecules/DrawingTooltip.d.ts +0 -2
- package/dist/components/molecules/LauncherButton.d.ts +0 -2
- package/dist/components/molecules/Notification.d.ts +0 -2
- package/dist/components/molecules/ShapeActions.d.ts +0 -2
- package/dist/components/molecules/StoredFeedback.d.ts +0 -2
- package/dist/components/molecules/WelcomeMessage.d.ts +0 -2
- package/dist/components/organisms/DrawingLayer.d.ts +0 -2
- package/dist/components/organisms/FeedbackForm.d.ts +0 -2
- package/dist/config/defaultText.d.ts +0 -2
- package/dist/config/drawingConfig.d.ts +0 -13
- package/dist/contexts/EchoContext.d.ts +0 -9
- package/dist/contexts/index.d.ts +0 -1
- package/dist/stores/drawingStore.d.ts +0 -39
- package/dist/stores/echoStore.d.ts +0 -16
- package/dist/stores/feedbackStore.d.ts +0 -12
- package/dist/stores/index.d.ts +0 -4
- package/dist/stores/widgetStore.d.ts +0 -19
- package/dist/types.d.ts +0 -87
- package/dist/utils/color.d.ts +0 -2
- package/dist/utils/common.d.ts +0 -1
- package/dist/utils/console.d.ts +0 -4
- package/dist/utils/debounce.d.ts +0 -1
- package/dist/utils/device.d.ts +0 -1
- package/dist/utils/events.d.ts +0 -5
- package/dist/utils/format.d.ts +0 -1
- package/dist/utils/geometry.d.ts +0 -8
- package/dist/utils/index.d.ts +0 -13
- package/dist/utils/listeners.d.ts +0 -22
- package/dist/utils/screenshot.d.ts +0 -2
- package/dist/utils/storage.d.ts +0 -28
- package/dist/utils/svg.d.ts +0 -13
- package/dist/utils/validators.d.ts +0 -2
@@ -1,13 +0,0 @@
|
|
1
|
-
import type { DrawingTool } from '~/types';
|
2
|
-
type ToolConfig = {
|
3
|
-
id: DrawingTool;
|
4
|
-
label: string;
|
5
|
-
getCursor: (color: string) => string;
|
6
|
-
strokeWidth: number;
|
7
|
-
opacity: {
|
8
|
-
selected: number;
|
9
|
-
default: number;
|
10
|
-
};
|
11
|
-
};
|
12
|
-
export declare const toolConfig: Record<DrawingTool, ToolConfig>;
|
13
|
-
export {};
|
@@ -1,9 +0,0 @@
|
|
1
|
-
import { type Component, JSXElement } from 'solid-js';
|
2
|
-
import { type EchoStore } from '~/stores';
|
3
|
-
import type { FullEchoConfig } from '~/types';
|
4
|
-
type EchoProviderProps = FullEchoConfig & {
|
5
|
-
children: JSXElement;
|
6
|
-
};
|
7
|
-
export declare const EchoProvider: Component<EchoProviderProps>;
|
8
|
-
export declare const useEchoStore: () => EchoStore;
|
9
|
-
export {};
|
package/dist/contexts/index.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export * from './EchoContext';
|
@@ -1,39 +0,0 @@
|
|
1
|
-
import type { DrawingTool, FullEchoConfig, Point, Shape } from '~/types';
|
2
|
-
export type DrawingState = {
|
3
|
-
isDrawing: boolean;
|
4
|
-
selectedShapeId: string | null;
|
5
|
-
selectedTool: DrawingTool;
|
6
|
-
selectedColor: string;
|
7
|
-
shapes: Shape[];
|
8
|
-
currentPoints: Point[];
|
9
|
-
showTooltip: boolean;
|
10
|
-
mousePosition: Point;
|
11
|
-
hasDrawn: boolean;
|
12
|
-
isDragging: boolean;
|
13
|
-
dragStartPos: Point | null;
|
14
|
-
initialClickPos: Point | null;
|
15
|
-
dragOffset: Point | null;
|
16
|
-
cursor: string;
|
17
|
-
};
|
18
|
-
export type DrawingStore = {
|
19
|
-
state: DrawingState;
|
20
|
-
setState: (state: Partial<DrawingState>, isClearing?: boolean) => void;
|
21
|
-
methods: {
|
22
|
-
startDrawing: (initialPoint: Point) => void;
|
23
|
-
updateDrawing: (point: Point) => void;
|
24
|
-
finishDrawing: () => void;
|
25
|
-
handleShapeClick: (shapeId: string) => void;
|
26
|
-
handleStart: (e: MouseEvent | TouchEvent) => void;
|
27
|
-
handleMove: (e: MouseEvent | TouchEvent) => void;
|
28
|
-
handleEnd: (e: MouseEvent | TouchEvent) => void;
|
29
|
-
handleEnter: (e: MouseEvent | TouchEvent) => void;
|
30
|
-
handleLeave: (e: MouseEvent | TouchEvent) => void;
|
31
|
-
startDrag: (point: Point) => void;
|
32
|
-
stopDrag: () => void;
|
33
|
-
setInitialClick: (point: Point | null) => void;
|
34
|
-
updateDragOffset: (shape: {
|
35
|
-
points: Point[];
|
36
|
-
}, point: Point) => void;
|
37
|
-
};
|
38
|
-
};
|
39
|
-
export declare const createDrawingStore: (config: FullEchoConfig, currentPageKey: string, onStateChange?: (state: Partial<DrawingState>, isClearing?: boolean) => void) => DrawingStore;
|
@@ -1,16 +0,0 @@
|
|
1
|
-
import type { FeedbackPayload, FullEchoConfig } from '~/types';
|
2
|
-
import { type Notification } from '~/types';
|
3
|
-
import { type DrawingStore } from './drawingStore';
|
4
|
-
import { type FeedbackStore } from './feedbackStore';
|
5
|
-
import { type WidgetStore } from './widgetStore';
|
6
|
-
export type EchoStore = {
|
7
|
-
feedback: FeedbackStore;
|
8
|
-
drawing: DrawingStore;
|
9
|
-
widget: WidgetStore;
|
10
|
-
methods: {
|
11
|
-
reset: () => void;
|
12
|
-
postSubmit: (result: Notification) => void;
|
13
|
-
onSubmit: (data: FeedbackPayload) => Promise<void>;
|
14
|
-
};
|
15
|
-
};
|
16
|
-
export declare const createEchoStore: (config: FullEchoConfig) => EchoStore;
|
@@ -1,12 +0,0 @@
|
|
1
|
-
import type { FullEchoConfig, Screenshot } from '~/types';
|
2
|
-
export type FeedbackState = {
|
3
|
-
comment: string;
|
4
|
-
screenshot?: Screenshot;
|
5
|
-
isCapturing: boolean;
|
6
|
-
isMinimized: boolean;
|
7
|
-
};
|
8
|
-
export type FeedbackStore = {
|
9
|
-
state: FeedbackState;
|
10
|
-
setState: (state: Partial<FeedbackState>, isClearing?: boolean) => void;
|
11
|
-
};
|
12
|
-
export declare const createFeedbackStore: (config: FullEchoConfig, currentPageKey: string, onStateChange?: (state: Partial<FeedbackState>, isClearing?: boolean) => void) => FeedbackStore;
|
package/dist/stores/index.d.ts
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
import type { FullEchoConfig, Notification, TextConfig } from '~/types';
|
2
|
-
export type WidgetState = {
|
3
|
-
text: TextConfig;
|
4
|
-
isOpen: boolean;
|
5
|
-
primaryColor: string;
|
6
|
-
notification: Notification;
|
7
|
-
dimensions: {
|
8
|
-
width: number;
|
9
|
-
height: number;
|
10
|
-
};
|
11
|
-
isStoredFeedbackOpen: boolean;
|
12
|
-
pagesCount: number;
|
13
|
-
welcomeMessageIsClosing: boolean;
|
14
|
-
};
|
15
|
-
export type WidgetStore = {
|
16
|
-
state: WidgetState;
|
17
|
-
setState: (state: Partial<WidgetState>) => void;
|
18
|
-
};
|
19
|
-
export declare const createWidgetStore: (config: FullEchoConfig, currentPageKey: string) => WidgetStore;
|
package/dist/types.d.ts
DELETED
@@ -1,87 +0,0 @@
|
|
1
|
-
export type Screenshot = `data:image/png;base64,${string}`;
|
2
|
-
export type BrowserInfo = {
|
3
|
-
width: number;
|
4
|
-
height: number;
|
5
|
-
screenWidth: number;
|
6
|
-
screenHeight: number;
|
7
|
-
};
|
8
|
-
export type Metadata = {
|
9
|
-
url: string;
|
10
|
-
userAgent: string;
|
11
|
-
timestamp: string;
|
12
|
-
browserInfo: BrowserInfo;
|
13
|
-
};
|
14
|
-
export type ConsoleEntry = {
|
15
|
-
type: 'log' | 'warn' | 'error';
|
16
|
-
message: string;
|
17
|
-
timestamp: string;
|
18
|
-
};
|
19
|
-
export type FeedbackPayload = {
|
20
|
-
comment: string;
|
21
|
-
screenshot?: Screenshot;
|
22
|
-
metadata: Metadata;
|
23
|
-
console: ConsoleEntry[];
|
24
|
-
};
|
25
|
-
export type Position = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
|
26
|
-
export type TextConfig = {
|
27
|
-
welcomeMessage: {
|
28
|
-
text: string;
|
29
|
-
closeAriaLabel: string;
|
30
|
-
};
|
31
|
-
feedbackForm: {
|
32
|
-
title: string;
|
33
|
-
placeholder: string;
|
34
|
-
screenshotAlt: string;
|
35
|
-
submitButton: string;
|
36
|
-
minimizeTitle: string;
|
37
|
-
expandTitle: string;
|
38
|
-
closeTitle: string;
|
39
|
-
showFormTitle: string;
|
40
|
-
};
|
41
|
-
notification: {
|
42
|
-
successTitle: string;
|
43
|
-
errorTitle: string;
|
44
|
-
errorMessage: string;
|
45
|
-
hideTitle: string;
|
46
|
-
};
|
47
|
-
drawingTooltip: {
|
48
|
-
text: string;
|
49
|
-
};
|
50
|
-
};
|
51
|
-
export type EchoConfig = {
|
52
|
-
onSubmit: (data: FeedbackPayload) => Promise<void>;
|
53
|
-
position?: Position;
|
54
|
-
primaryColor?: `#${string}`;
|
55
|
-
textConfig?: Partial<TextConfig>;
|
56
|
-
};
|
57
|
-
export type FullEchoConfig = Required<EchoConfig> & {
|
58
|
-
textConfig: TextConfig;
|
59
|
-
};
|
60
|
-
export declare const POSITIONS: Record<Position, {
|
61
|
-
[key: string]: string;
|
62
|
-
}>;
|
63
|
-
export type Point = {
|
64
|
-
x: number;
|
65
|
-
y: number;
|
66
|
-
};
|
67
|
-
export type ShapeType = 'rectangle' | 'path';
|
68
|
-
export type DrawingTool = 'rectangle' | 'path';
|
69
|
-
export type Shape = {
|
70
|
-
id: string;
|
71
|
-
type: ShapeType;
|
72
|
-
color: string;
|
73
|
-
points: Point[];
|
74
|
-
};
|
75
|
-
export type IconProps = {
|
76
|
-
size?: number;
|
77
|
-
stroke?: string;
|
78
|
-
strokeWidth?: number;
|
79
|
-
class?: string;
|
80
|
-
style?: any;
|
81
|
-
fill?: string;
|
82
|
-
};
|
83
|
-
export type Notification = {
|
84
|
-
show: boolean;
|
85
|
-
type: 'success' | 'error' | null;
|
86
|
-
message: string | null;
|
87
|
-
};
|
package/dist/utils/color.d.ts
DELETED
package/dist/utils/common.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export declare const deepMerge: (target: any, source: any) => any;
|
package/dist/utils/console.d.ts
DELETED
package/dist/utils/debounce.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export declare const debounce: <T extends (...args: any[]) => void>(func: T, wait: number) => (...args: Parameters<T>) => void;
|
package/dist/utils/device.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export declare const isMobileDevice: () => boolean;
|
package/dist/utils/events.d.ts
DELETED
package/dist/utils/format.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export declare const formatPath: (path: string) => string;
|
package/dist/utils/geometry.d.ts
DELETED
package/dist/utils/index.d.ts
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
export * from './color';
|
2
|
-
export * from './common';
|
3
|
-
export * from './console';
|
4
|
-
export * from './debounce';
|
5
|
-
export * from './device';
|
6
|
-
export * from './events';
|
7
|
-
export * from './format';
|
8
|
-
export * from './geometry';
|
9
|
-
export * from './listeners';
|
10
|
-
export * from './screenshot';
|
11
|
-
export * from './storage';
|
12
|
-
export * from './svg';
|
13
|
-
export * from './validators';
|
@@ -1,22 +0,0 @@
|
|
1
|
-
export declare const registerKeyListener: (key: string, callback: (e: KeyboardEvent) => void) => void;
|
2
|
-
export declare const registerWindowEventListener: {
|
3
|
-
<K extends keyof WindowEventMap>(props: {
|
4
|
-
event: K;
|
5
|
-
callback: (e: WindowEventMap[K]) => void;
|
6
|
-
onMount?: () => void;
|
7
|
-
onCleanup?: () => void;
|
8
|
-
}): void;
|
9
|
-
(props: {
|
10
|
-
event: string;
|
11
|
-
callback: (e: Event) => void;
|
12
|
-
onMount?: () => void;
|
13
|
-
onCleanup?: () => void;
|
14
|
-
}): void;
|
15
|
-
};
|
16
|
-
export declare const registerMutationObserver: (props: {
|
17
|
-
target: Node;
|
18
|
-
options?: MutationObserverInit;
|
19
|
-
callback: (mutations: MutationRecord[]) => void;
|
20
|
-
onMount?: () => void;
|
21
|
-
onCleanup?: () => void;
|
22
|
-
}) => void;
|
package/dist/utils/storage.d.ts
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
import { DrawingState, FeedbackState } from '~/stores';
|
2
|
-
import type { Shape } from '~/types';
|
3
|
-
type StoredPageState = {
|
4
|
-
feedback: {
|
5
|
-
comment: string;
|
6
|
-
};
|
7
|
-
drawing: {
|
8
|
-
shapes: Shape[];
|
9
|
-
};
|
10
|
-
latestQuery?: string;
|
11
|
-
};
|
12
|
-
export declare const dispatchStorageChange: () => void;
|
13
|
-
export declare const getStorageKey: (key: string) => string;
|
14
|
-
export declare const getFromStorage: <T>(key: string, defaultValue: T) => T;
|
15
|
-
export declare const setToStorage: <T>(key: string, value: T) => void;
|
16
|
-
export declare const getPageKey: () => string;
|
17
|
-
export declare const savePageState: (pageKey: string, state: {
|
18
|
-
feedback: FeedbackState;
|
19
|
-
drawing: DrawingState;
|
20
|
-
}) => void;
|
21
|
-
export declare const loadPageState: (pageKey: string) => StoredPageState | null;
|
22
|
-
export declare const clearPageState: (pageKey: string) => void;
|
23
|
-
export declare const getStoredPagesCount: () => number;
|
24
|
-
export declare const getStoredPages: () => {
|
25
|
-
path: string;
|
26
|
-
state: StoredPageState;
|
27
|
-
}[];
|
28
|
-
export {};
|
package/dist/utils/svg.d.ts
DELETED