vibrant-tool 0.1.3 → 0.1.4
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/lib/hooks/useBrightnessEffect.d.ts +1 -1
- package/dist/lib/services/api.d.ts +1 -0
- package/dist/lib/services/color.service.d.ts +10 -0
- package/dist/lib/services/quote.service.d.ts +24 -0
- package/dist/lib/services/shape.service.d.ts +2 -0
- package/dist/lib/services/template-design.service.d.ts +2 -1
- package/dist/lib/services/upload.service.d.ts +5 -0
- package/dist/lib/types/color.types.d.ts +9 -0
- package/dist/lib/utils/canvas-setup.d.ts +2 -0
- package/dist/lib/utils/color-apply.utils.d.ts +13 -3
- package/dist/lib/utils/color-conversions.utils.d.ts +0 -2
- package/dist/lib/utils/custom-controls.d.ts +1 -1
- package/dist/modules/components/color-picker/ChannelRow.d.ts +17 -0
- package/dist/modules/components/color-picker/ChannelSlider.d.ts +15 -0
- package/dist/modules/side-panel/color-panel/index.d.ts +1 -0
- package/dist/vibrant-tool.css +340 -99
- package/dist/vibrant-tool.es.js +2090 -737
- package/dist/vibrant-tool.umd.js +2090 -737
- package/dist/zustand/recentElementsStore.d.ts +21 -0
- package/dist/zustand/selectionStore.d.ts +4 -1
- package/package.json +1 -1
- package/dist/modules/components/alpha-slider/index.d.ts +0 -12
- package/dist/modules/components/cmyk-inputs/index.d.ts +0 -12
- package/dist/modules/components/color-preview-box/index.d.ts +0 -6
- package/dist/modules/components/gradient-selector/index.d.ts +0 -10
- package/dist/modules/components/hue-slider/index.d.ts +0 -9
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { Canvas } from 'fabric';
|
|
2
|
-
export declare function useBrightnessEffect(canvas: Canvas | null,
|
|
2
|
+
export declare function useBrightnessEffect(canvas: Canvas | null, active: boolean): void;
|
|
@@ -9,4 +9,5 @@ interface ApiFetchOptions<TBody> {
|
|
|
9
9
|
headers?: HeadersInit;
|
|
10
10
|
}
|
|
11
11
|
export declare function apiFetch<TResponse, TBody = unknown>(endpoint: string, options?: ApiFetchOptions<TBody>): Promise<TResponse>;
|
|
12
|
+
export declare function apiUploadImage<TResponse, TBody = unknown>(endpoint: string, options?: ApiFetchOptions<TBody>): Promise<TResponse>;
|
|
12
13
|
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ColorItem } from '../types/color.types';
|
|
2
|
+
export interface ColorQuery {
|
|
3
|
+
page?: number;
|
|
4
|
+
limit?: number;
|
|
5
|
+
search?: string;
|
|
6
|
+
status?: boolean | string;
|
|
7
|
+
}
|
|
8
|
+
export declare const ColorService: {
|
|
9
|
+
getAll(params?: ColorQuery): Promise<ColorItem[]>;
|
|
10
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface QuoteItem {
|
|
2
|
+
_id?: string;
|
|
3
|
+
content: string;
|
|
4
|
+
author: string;
|
|
5
|
+
position?: number;
|
|
6
|
+
status?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface QuoteResponse {
|
|
9
|
+
success: boolean;
|
|
10
|
+
data: QuoteItem[];
|
|
11
|
+
pagination?: {
|
|
12
|
+
total: number;
|
|
13
|
+
page: number;
|
|
14
|
+
limit: number;
|
|
15
|
+
totalPages: number;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export declare const QuoteService: {
|
|
19
|
+
getAllQuotes(params?: {
|
|
20
|
+
page?: number;
|
|
21
|
+
limit?: number;
|
|
22
|
+
search?: string;
|
|
23
|
+
}): Promise<QuoteItem[]>;
|
|
24
|
+
};
|
|
@@ -9,5 +9,7 @@ export declare const ShapeService: {
|
|
|
9
9
|
items: TextTemplateItem[];
|
|
10
10
|
}>;
|
|
11
11
|
getTextTemplateById(id: string): Promise<TextTemplateItem | null>;
|
|
12
|
+
updateTextTemplate(id: string, body: any): Promise<any>;
|
|
13
|
+
convertImages(url: string): Promise<any>;
|
|
12
14
|
};
|
|
13
15
|
export {};
|
|
@@ -7,6 +7,7 @@ export interface TemplatePage {
|
|
|
7
7
|
export interface TemplateDesignItem {
|
|
8
8
|
_id: string;
|
|
9
9
|
name?: string;
|
|
10
|
+
type?: "design" | "text" | string;
|
|
10
11
|
pages: TemplatePage[];
|
|
11
12
|
designs?: any[];
|
|
12
13
|
image?: string;
|
|
@@ -23,7 +24,7 @@ export interface TemplateDesignResponse {
|
|
|
23
24
|
}
|
|
24
25
|
export declare const TemplateDesignService: {
|
|
25
26
|
getTemplates(data: {
|
|
26
|
-
product
|
|
27
|
+
product?: string;
|
|
27
28
|
page: number;
|
|
28
29
|
limit: number;
|
|
29
30
|
}): Promise<TemplateDesignResponse | null>;
|
|
@@ -21,6 +21,8 @@ export interface WorkareaProductOptions {
|
|
|
21
21
|
bleedArea?: number;
|
|
22
22
|
trimArea?: number;
|
|
23
23
|
safetyArea?: number;
|
|
24
|
+
hideGuidelines?: boolean;
|
|
25
|
+
isTextTemplate?: boolean;
|
|
24
26
|
optionsMap?: Record<string, string>;
|
|
25
27
|
}
|
|
26
28
|
export declare function createWorkarea(canvas: Canvas, container: HTMLDivElement, productData?: WorkareaProductOptions | null): Rect<{
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import { CMYKColor } from '../types/color.types';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Normalizes any valid CSS color or fabric color string into 6-digit #rrggbb hex.
|
|
4
|
+
*/
|
|
5
|
+
export declare function normalizeHexColor(c: any): string | null;
|
|
6
|
+
/**
|
|
7
|
+
* Extracts all unique colors (fills and visible strokes) from selected target objects only.
|
|
8
|
+
* Avoids reading default prototype fills from Group containers.
|
|
9
|
+
*/
|
|
10
|
+
export declare function extractAllTargetColors(targets: any[]): string[];
|
|
11
|
+
/**
|
|
12
|
+
* Extracts the primary color, opacity, and __cmyk from the first selected target object.
|
|
4
13
|
*/
|
|
5
14
|
export declare function extractTargetColor(targets: any[]): {
|
|
6
15
|
color?: string;
|
|
@@ -8,6 +17,7 @@ export declare function extractTargetColor(targets: any[]): {
|
|
|
8
17
|
cmyk?: CMYKColor;
|
|
9
18
|
};
|
|
10
19
|
/**
|
|
11
|
-
*
|
|
20
|
+
* Replaces a specific color (or applies new color) across selected Fabric objects.
|
|
21
|
+
* If targetOldColor is specified, only occurrences of that color are replaced.
|
|
12
22
|
*/
|
|
13
|
-
export declare function applyFillToFabricObjects(objects: any[], newColor: string, alpha: number,
|
|
23
|
+
export declare function applyFillToFabricObjects(objects: any[], newColor: string, alpha: number, targetOldColor: string | null | undefined, canvas: any, cmykValues?: CMYKColor): void;
|
|
@@ -19,7 +19,5 @@ export declare function hexToRgb(hex: string): {
|
|
|
19
19
|
};
|
|
20
20
|
export declare function hexToCmyk(hex: string): CMYKColor;
|
|
21
21
|
export declare function cmykToHex(c: number, m: number, y: number, k: number): string;
|
|
22
|
-
export declare function isOutOfCmykGamut(hex: string, threshold?: number): boolean;
|
|
23
|
-
export declare function parseHexInput(input: string): string | null;
|
|
24
22
|
export declare function convertSvgColorsToCmyk(svg: string): string;
|
|
25
23
|
export declare function convertPdfToDeviceCMYK(rawBuffer: ArrayBuffer): Promise<Uint8Array>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Control, FabricObject } from 'fabric';
|
|
2
2
|
export declare function renderRotateIcon(ctx: CanvasRenderingContext2D, left: number, top: number, fabricObject: FabricObject): void;
|
|
3
|
-
export declare function createRotateControl(): Control;
|
|
3
|
+
export declare function createRotateControl(size?: number, offsetY?: number): Control;
|
|
4
4
|
export declare function configureObjectControls(obj: FabricObject): void;
|
|
5
5
|
export declare function initializeRotateImage(): void;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface ChannelRowProps {
|
|
2
|
+
label: string;
|
|
3
|
+
labelColor: string;
|
|
4
|
+
/** Full accessible name for the channel (e.g. "Cyan") */
|
|
5
|
+
ariaLabel: string;
|
|
6
|
+
value: number;
|
|
7
|
+
min: number;
|
|
8
|
+
max: number;
|
|
9
|
+
gradient: string;
|
|
10
|
+
onChange: (value: number) => void;
|
|
11
|
+
/** Discrete commit. `'slider'` = drag/keypress on the track; `'input'` = the number box. */
|
|
12
|
+
onCommit?: (source: 'slider' | 'input') => void;
|
|
13
|
+
/** Part-level classes forwarded to the slider track / thumb. */
|
|
14
|
+
sliderClassName?: string;
|
|
15
|
+
sliderThumbClassName?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare function ChannelRow({ label, labelColor, ariaLabel, value, min, max, gradient, onChange, onCommit, sliderClassName, sliderThumbClassName }: ChannelRowProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface ChannelSliderProps {
|
|
2
|
+
value: number;
|
|
3
|
+
min: number;
|
|
4
|
+
max: number;
|
|
5
|
+
gradient: string;
|
|
6
|
+
/** Accessible name for the slider (e.g. "Cyan", "Magenta") */
|
|
7
|
+
ariaLabel: string;
|
|
8
|
+
onChange: (value: number) => void;
|
|
9
|
+
/** Discrete commit — fires on pointer-up (end of a drag) and on blur */
|
|
10
|
+
onCommit?: () => void;
|
|
11
|
+
/** Extra class on the track / thumb */
|
|
12
|
+
className?: string;
|
|
13
|
+
thumbClassName?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare function ChannelSlider({ value, min, max, gradient, ariaLabel, onChange, onCommit, className, thumbClassName }: ChannelSliderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function ColorPanel(): import("react/jsx-runtime").JSX.Element;
|