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.
Files changed (44) hide show
  1. package/README.md +36 -36
  2. package/dist/App.d.ts +1 -5
  3. package/dist/lib/hooks/useBrightnessEffect.d.ts +1 -1
  4. package/dist/lib/services/api.d.ts +1 -0
  5. package/dist/lib/services/color.service.d.ts +10 -0
  6. package/dist/lib/services/product.service.d.ts +4 -0
  7. package/dist/lib/services/quote.service.d.ts +24 -0
  8. package/dist/lib/services/shape.service.d.ts +7 -1
  9. package/dist/lib/services/template-design.service.d.ts +36 -0
  10. package/dist/lib/services/upload.service.d.ts +5 -0
  11. package/dist/lib/types/color.types.d.ts +9 -0
  12. package/dist/lib/types/fabric.types.d.ts +6 -0
  13. package/dist/lib/types/font.types.d.ts +6 -10
  14. package/dist/lib/types/product.types.d.ts +23 -0
  15. package/dist/lib/types/shape.types.d.ts +19 -14
  16. package/dist/lib/utils/canvas-setup.d.ts +9 -4
  17. package/dist/lib/utils/color-apply.utils.d.ts +23 -0
  18. package/dist/lib/utils/color-conversions.utils.d.ts +4 -0
  19. package/dist/lib/utils/custom-controls.d.ts +1 -1
  20. package/dist/lib/utils/fabric-helper.d.ts +2 -0
  21. package/dist/lib/utils/page-manager.d.ts +3 -2
  22. package/dist/lib/utils/qr-utils.d.ts +1 -1
  23. package/dist/lib/utils/query-params.d.ts +28 -0
  24. package/dist/lib/utils/svg-utils.d.ts +3 -0
  25. package/dist/modules/canvas/index.d.ts +1 -5
  26. package/dist/modules/components/color-picker/ChannelRow.d.ts +17 -0
  27. package/dist/modules/components/color-picker/ChannelSlider.d.ts +15 -0
  28. package/dist/modules/components/color-picker/index.d.ts +8 -1
  29. package/dist/modules/components/product-not-found/index.d.ts +3 -0
  30. package/dist/modules/index.d.ts +1 -5
  31. package/dist/modules/side-panel/color-panel/index.d.ts +1 -0
  32. package/dist/modules/topbar/preview-modal.d.ts +3 -0
  33. package/dist/vibrant-tool.css +631 -72
  34. package/dist/vibrant-tool.es.js +40463 -6494
  35. package/dist/vibrant-tool.umd.js +37526 -3558
  36. package/dist/zustand/productStore.d.ts +11 -0
  37. package/dist/zustand/recentElementsStore.d.ts +21 -0
  38. package/dist/zustand/selectionStore.d.ts +4 -1
  39. package/package.json +72 -71
  40. package/dist/modules/components/alpha-slider/index.d.ts +0 -12
  41. package/dist/modules/components/cmyk-inputs/index.d.ts +0 -12
  42. package/dist/modules/components/color-preview-box/index.d.ts +0 -6
  43. package/dist/modules/components/gradient-selector/index.d.ts +0 -10
  44. 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.2",
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
- "pdfmake": "^0.3.3",
40
- "qrcode": "^1.5.4",
41
- "qrcode.react": "^4.2.0",
42
- "react-loader-spinner": "^8.0.2",
43
- "zustand": "^5.0.10"
44
- },
45
- "peerDependencies": {
46
- "react": ">=18",
47
- "react-dom": ">=18"
48
- },
49
- "devDependencies": {
50
- "@tailwindcss/vite": "^4.2.1",
51
- "@types/gapi": "^0.0.47",
52
- "@types/gapi.auth2": "^0.0.61",
53
- "@types/gapi.client.drive": "^3.0.15",
54
- "@types/gapi.client.photoslibrary": "^1.0.0",
55
- "@types/node": "^22",
56
- "@types/pdfmake": "^0.3.1",
57
- "@types/qrcode": "^1.5.6",
58
- "@types/react": "^19.2.14",
59
- "@types/react-dom": "^19.2.3",
60
- "@vitejs/plugin-react": "^5.1.4",
61
- "cross-env": "^7.0.3",
62
- "eslint": "^9",
63
- "eslint-plugin-react-hooks": "^5.0.0",
64
- "eslint-plugin-react-refresh": "^0.4.14",
65
- "react": "^19.2.4",
66
- "react-dom": "^19.2.4",
67
- "tailwindcss": "^4.2.1",
68
- "typescript": "^5.9.3",
69
- "vite": "^7.3.1",
70
- "vite-plugin-dts": "^4.5.4"
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,6 +0,0 @@
1
- interface Props {
2
- color: string;
3
- alpha: number;
4
- }
5
- export default function ColorPreviewBox({ color, alpha }: Props): import("react/jsx-runtime").JSX.Element;
6
- 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 {};