vibrant-tool 0.1.2 → 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/README.md +36 -36
- package/dist/App.d.ts +1 -5
- 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/product.service.d.ts +4 -0
- package/dist/lib/services/quote.service.d.ts +24 -0
- package/dist/lib/services/shape.service.d.ts +7 -1
- package/dist/lib/services/template-design.service.d.ts +36 -0
- package/dist/lib/services/upload.service.d.ts +5 -0
- package/dist/lib/types/color.types.d.ts +9 -0
- package/dist/lib/types/fabric.types.d.ts +6 -0
- package/dist/lib/types/font.types.d.ts +6 -10
- package/dist/lib/types/product.types.d.ts +23 -0
- package/dist/lib/types/shape.types.d.ts +19 -14
- package/dist/lib/utils/canvas-setup.d.ts +9 -4
- package/dist/lib/utils/color-apply.utils.d.ts +23 -0
- package/dist/lib/utils/color-conversions.utils.d.ts +4 -0
- package/dist/lib/utils/custom-controls.d.ts +1 -1
- package/dist/lib/utils/fabric-helper.d.ts +2 -0
- package/dist/lib/utils/page-manager.d.ts +3 -2
- package/dist/lib/utils/qr-utils.d.ts +1 -1
- package/dist/lib/utils/query-params.d.ts +28 -0
- package/dist/lib/utils/svg-utils.d.ts +3 -0
- package/dist/modules/canvas/index.d.ts +1 -5
- 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/components/color-picker/index.d.ts +8 -1
- package/dist/modules/components/product-not-found/index.d.ts +3 -0
- package/dist/modules/index.d.ts +1 -5
- package/dist/modules/side-panel/color-panel/index.d.ts +1 -0
- package/dist/modules/topbar/preview-modal.d.ts +3 -0
- package/dist/vibrant-tool.css +631 -72
- package/dist/vibrant-tool.es.js +40463 -6494
- package/dist/vibrant-tool.umd.js +37526 -3558
- package/dist/zustand/productStore.d.ts +11 -0
- package/dist/zustand/recentElementsStore.d.ts +21 -0
- package/dist/zustand/selectionStore.d.ts +4 -1
- package/package.json +72 -71
- 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
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ProductOptionItem } from '../lib/types/product.types';
|
|
2
|
+
interface ProductState {
|
|
3
|
+
productData: ProductOptionItem | null;
|
|
4
|
+
isLoading: boolean;
|
|
5
|
+
isNotFound: boolean;
|
|
6
|
+
error: string | null;
|
|
7
|
+
setProductData: (data: ProductOptionItem | null) => void;
|
|
8
|
+
fetchProduct: (id: string) => Promise<ProductOptionItem | null>;
|
|
9
|
+
}
|
|
10
|
+
export declare const useProductStore: import('zustand').UseBoundStore<import('zustand').StoreApi<ProductState>>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ElementItem } from '../lib/types/shape.types';
|
|
2
|
+
type RecentElementsState = {
|
|
3
|
+
recentItems: ElementItem[];
|
|
4
|
+
};
|
|
5
|
+
type RecentElementsActions = {
|
|
6
|
+
addRecentItem: (item: ElementItem) => void;
|
|
7
|
+
};
|
|
8
|
+
export declare const useRecentElementsStore: import('zustand').UseBoundStore<Omit<import('zustand').StoreApi<RecentElementsState & RecentElementsActions>, "setState" | "persist"> & {
|
|
9
|
+
setState(partial: (RecentElementsState & RecentElementsActions) | Partial<RecentElementsState & RecentElementsActions> | ((state: RecentElementsState & RecentElementsActions) => (RecentElementsState & RecentElementsActions) | Partial<RecentElementsState & RecentElementsActions>), replace?: false | undefined): unknown;
|
|
10
|
+
setState(state: (RecentElementsState & RecentElementsActions) | ((state: RecentElementsState & RecentElementsActions) => RecentElementsState & RecentElementsActions), replace: true): unknown;
|
|
11
|
+
persist: {
|
|
12
|
+
setOptions: (options: Partial<import('zustand/middleware').PersistOptions<RecentElementsState & RecentElementsActions, RecentElementsState & RecentElementsActions, unknown>>) => void;
|
|
13
|
+
clearStorage: () => void;
|
|
14
|
+
rehydrate: () => Promise<void> | void;
|
|
15
|
+
hasHydrated: () => boolean;
|
|
16
|
+
onHydrate: (fn: (state: RecentElementsState & RecentElementsActions) => void) => () => void;
|
|
17
|
+
onFinishHydration: (fn: (state: RecentElementsState & RecentElementsActions) => void) => () => void;
|
|
18
|
+
getOptions: () => Partial<import('zustand/middleware').PersistOptions<RecentElementsState & RecentElementsActions, RecentElementsState & RecentElementsActions, unknown>>;
|
|
19
|
+
};
|
|
20
|
+
}>;
|
|
21
|
+
export {};
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { FabricObject } from 'fabric';
|
|
2
|
-
export type SelectionType = "none" | "textbox" | "image" | "qr" | "multiple" | "group";
|
|
2
|
+
export type SelectionType = "none" | "textbox" | "image" | "qr" | "barcode" | "multiple" | "group";
|
|
3
3
|
interface SelectionStore {
|
|
4
4
|
type: SelectionType;
|
|
5
5
|
objects: FabricObject[];
|
|
6
|
+
activeColor: string | null;
|
|
7
|
+
activeColorIndex: number;
|
|
6
8
|
setSelection: (objects: FabricObject[]) => void;
|
|
9
|
+
setActiveColor: (color: string | null, index?: number) => void;
|
|
7
10
|
clearSelection: () => void;
|
|
8
11
|
}
|
|
9
12
|
export declare const useSelectionStore: import('zustand').UseBoundStore<import('zustand').StoreApi<SelectionStore>>;
|
package/package.json
CHANGED
|
@@ -1,72 +1,73 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "vibrant-tool",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "Vibrant design editor (Vite + React)",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "./dist/vibrant-tool.umd.js",
|
|
7
|
-
"module": "./dist/vibrant-tool.es.js",
|
|
8
|
-
"types": "./dist/index.d.ts",
|
|
9
|
-
"exports": {
|
|
10
|
-
".": {
|
|
11
|
-
"types": "./dist/index.d.ts",
|
|
12
|
-
"import": "./dist/vibrant-tool.es.js",
|
|
13
|
-
"require": "./dist/vibrant-tool.umd.js"
|
|
14
|
-
},
|
|
15
|
-
"./dist/vibrant-tool.css": "./dist/vibrant-tool.css"
|
|
16
|
-
},
|
|
17
|
-
"files": [
|
|
18
|
-
"dist"
|
|
19
|
-
],
|
|
20
|
-
"scripts": {
|
|
21
|
-
"dev": "vite",
|
|
22
|
-
"build": "vite build --mode lib",
|
|
23
|
-
"preview:build": "vite build",
|
|
24
|
-
"preview": "vite preview",
|
|
25
|
-
"lint": "eslint .",
|
|
26
|
-
"prepare": "npm run build"
|
|
27
|
-
},
|
|
28
|
-
"publishConfig": {
|
|
29
|
-
"access": "public"
|
|
30
|
-
},
|
|
31
|
-
"dependencies": {
|
|
32
|
-
"@react-oauth/google": "^0.13.4",
|
|
33
|
-
"bwip-js": "^4.8.0",
|
|
34
|
-
"driver.js": "^1.4.0",
|
|
35
|
-
"dropbox": "^10.34.0",
|
|
36
|
-
"fabric": "^6.9.0",
|
|
37
|
-
"firebase": "^12.9.0",
|
|
38
|
-
"gapi-script": "^1.2.0",
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"qrcode
|
|
42
|
-
"react
|
|
43
|
-
"
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
"react
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
"@
|
|
52
|
-
"@types/gapi
|
|
53
|
-
"@types/gapi.
|
|
54
|
-
"@types/gapi.client.
|
|
55
|
-
"@types/
|
|
56
|
-
"@types/
|
|
57
|
-
"@types/
|
|
58
|
-
"@types/
|
|
59
|
-
"@types/react
|
|
60
|
-
"@
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"eslint
|
|
64
|
-
"eslint-plugin-react-
|
|
65
|
-
"react": "^
|
|
66
|
-
"react
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"vite
|
|
71
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "vibrant-tool",
|
|
3
|
+
"version": "0.1.4",
|
|
4
|
+
"description": "Vibrant design editor (Vite + React)",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/vibrant-tool.umd.js",
|
|
7
|
+
"module": "./dist/vibrant-tool.es.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/vibrant-tool.es.js",
|
|
13
|
+
"require": "./dist/vibrant-tool.umd.js"
|
|
14
|
+
},
|
|
15
|
+
"./dist/vibrant-tool.css": "./dist/vibrant-tool.css"
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"dist"
|
|
19
|
+
],
|
|
20
|
+
"scripts": {
|
|
21
|
+
"dev": "vite",
|
|
22
|
+
"build": "vite build --mode lib",
|
|
23
|
+
"preview:build": "vite build",
|
|
24
|
+
"preview": "vite preview",
|
|
25
|
+
"lint": "eslint .",
|
|
26
|
+
"prepare": "npm run build"
|
|
27
|
+
},
|
|
28
|
+
"publishConfig": {
|
|
29
|
+
"access": "public"
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@react-oauth/google": "^0.13.4",
|
|
33
|
+
"bwip-js": "^4.8.0",
|
|
34
|
+
"driver.js": "^1.4.0",
|
|
35
|
+
"dropbox": "^10.34.0",
|
|
36
|
+
"fabric": "^6.9.0",
|
|
37
|
+
"firebase": "^12.9.0",
|
|
38
|
+
"gapi-script": "^1.2.0",
|
|
39
|
+
"pdf-lib": "^1.17.1",
|
|
40
|
+
"pdfmake": "^0.3.3",
|
|
41
|
+
"qrcode": "^1.5.4",
|
|
42
|
+
"qrcode.react": "^4.2.0",
|
|
43
|
+
"react-loader-spinner": "^8.0.2",
|
|
44
|
+
"zustand": "^5.0.10"
|
|
45
|
+
},
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"react": ">=18",
|
|
48
|
+
"react-dom": ">=18"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"@tailwindcss/vite": "^4.2.1",
|
|
52
|
+
"@types/gapi": "^0.0.47",
|
|
53
|
+
"@types/gapi.auth2": "^0.0.61",
|
|
54
|
+
"@types/gapi.client.drive": "^3.0.15",
|
|
55
|
+
"@types/gapi.client.photoslibrary": "^1.0.0",
|
|
56
|
+
"@types/node": "^22",
|
|
57
|
+
"@types/pdfmake": "^0.3.1",
|
|
58
|
+
"@types/qrcode": "^1.5.6",
|
|
59
|
+
"@types/react": "^19.2.14",
|
|
60
|
+
"@types/react-dom": "^19.2.3",
|
|
61
|
+
"@vitejs/plugin-react": "^5.1.4",
|
|
62
|
+
"cross-env": "^7.0.3",
|
|
63
|
+
"eslint": "^9",
|
|
64
|
+
"eslint-plugin-react-hooks": "^5.0.0",
|
|
65
|
+
"eslint-plugin-react-refresh": "^0.4.14",
|
|
66
|
+
"react": "^19.2.4",
|
|
67
|
+
"react-dom": "^19.2.4",
|
|
68
|
+
"tailwindcss": "^4.2.1",
|
|
69
|
+
"typescript": "^5.9.3",
|
|
70
|
+
"vite": "^7.3.1",
|
|
71
|
+
"vite-plugin-dts": "^4.5.4"
|
|
72
|
+
}
|
|
72
73
|
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { RefObject } from 'react';
|
|
2
|
-
interface Props {
|
|
3
|
-
alpha: number;
|
|
4
|
-
color: string;
|
|
5
|
-
refEl: RefObject<HTMLDivElement | null>;
|
|
6
|
-
setAlpha: (v: number) => void;
|
|
7
|
-
canvas: any;
|
|
8
|
-
targets: any[];
|
|
9
|
-
saveState: () => void;
|
|
10
|
-
}
|
|
11
|
-
export default function AlphaSlider({ alpha, color, refEl, setAlpha, canvas, targets, saveState, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { CMYKColor } from '../../../lib/types/color.types';
|
|
2
|
-
interface Props {
|
|
3
|
-
cmyk: CMYKColor;
|
|
4
|
-
alpha: number;
|
|
5
|
-
setAlpha: (v: number) => void;
|
|
6
|
-
updateColor: (cmyk: CMYKColor) => void;
|
|
7
|
-
canvas: any;
|
|
8
|
-
targets: any[];
|
|
9
|
-
saveState: () => void;
|
|
10
|
-
}
|
|
11
|
-
export default function CMYKInputs({ cmyk, alpha, setAlpha, updateColor, canvas, targets, saveState, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { RefObject } from 'react';
|
|
2
|
-
import { HSVColor } from '../../../lib/types/color.types';
|
|
3
|
-
interface Props {
|
|
4
|
-
hsv: HSVColor;
|
|
5
|
-
hueColor: string;
|
|
6
|
-
refEl: RefObject<HTMLDivElement | null>;
|
|
7
|
-
onChange: (hsv: HSVColor) => void;
|
|
8
|
-
}
|
|
9
|
-
export default function GradientSelector({ hsv, hueColor, refEl, onChange, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { RefObject } from 'react';
|
|
2
|
-
import { HSVColor } from '../../../lib/types/color.types';
|
|
3
|
-
interface Props {
|
|
4
|
-
hsv: HSVColor;
|
|
5
|
-
refEl: RefObject<HTMLDivElement | null>;
|
|
6
|
-
onChange: (hsv: HSVColor) => void;
|
|
7
|
-
}
|
|
8
|
-
export default function HueSlider({ hsv, refEl, onChange }: Props): import("react/jsx-runtime").JSX.Element;
|
|
9
|
-
export {};
|