@jhits/plugin-images 0.0.14 → 0.0.15
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/components/Image.d.ts +1 -6
- package/dist/components/Image.d.ts.map +1 -1
- package/dist/components/Image.js +86 -202
- package/dist/components/ImageEditor.d.ts.map +1 -1
- package/dist/components/ImageEditor.js +21 -125
- package/dist/components/ImagePicker.d.ts.map +1 -1
- package/dist/components/ImagePicker.js +6 -59
- package/dist/utils/fallback.d.ts +9 -4
- package/dist/utils/fallback.d.ts.map +1 -1
- package/dist/utils/fallback.js +40 -12
- package/dist/utils/transforms.d.ts.map +1 -1
- package/dist/utils/transforms.js +7 -10
- package/dist/views/ImageManager/components/CleanupLibraryModal.d.ts +12 -0
- package/dist/views/ImageManager/components/CleanupLibraryModal.d.ts.map +1 -0
- package/dist/views/ImageManager/components/CleanupLibraryModal.js +7 -0
- package/dist/views/ImageManager/components/DeleteImageModal.d.ts +15 -0
- package/dist/views/ImageManager/components/DeleteImageModal.d.ts.map +1 -0
- package/dist/views/ImageManager/components/DeleteImageModal.js +8 -0
- package/dist/views/ImageManager/components/ImageGrid.d.ts +12 -0
- package/dist/views/ImageManager/components/ImageGrid.d.ts.map +1 -0
- package/dist/views/ImageManager/components/ImageGrid.js +15 -0
- package/dist/views/ImageManager/components/ImageManagerHeader.d.ts +11 -0
- package/dist/views/ImageManager/components/ImageManagerHeader.d.ts.map +1 -0
- package/dist/views/ImageManager/components/ImageManagerHeader.js +6 -0
- package/dist/views/ImageManager/components/ImageManagerStats.d.ts +8 -0
- package/dist/views/ImageManager/components/ImageManagerStats.d.ts.map +1 -0
- package/dist/views/ImageManager/components/ImageManagerStats.js +6 -0
- package/dist/views/ImageManager/components/ImageManagerToolbar.d.ts +9 -0
- package/dist/views/ImageManager/components/ImageManagerToolbar.d.ts.map +1 -0
- package/dist/views/ImageManager/components/ImageManagerToolbar.js +10 -0
- package/dist/views/ImageManager/components/ImageTable.d.ts +13 -0
- package/dist/views/ImageManager/components/ImageTable.d.ts.map +1 -0
- package/dist/views/ImageManager/components/ImageTable.js +13 -0
- package/dist/views/ImageManager/types.d.ts +26 -0
- package/dist/views/ImageManager/types.d.ts.map +1 -0
- package/dist/views/ImageManager/types.js +1 -0
- package/dist/views/ImageManager.d.ts +1 -1
- package/dist/views/ImageManager.d.ts.map +1 -1
- package/dist/views/ImageManager.js +28 -52
- package/package.json +10 -9
- package/src/components/Image.tsx +107 -262
- package/src/components/ImageEditor.tsx +31 -193
- package/src/components/ImagePicker.tsx +22 -107
- package/src/utils/fallback.ts +46 -13
- package/src/utils/transforms.ts +9 -12
- package/src/views/ImageManager/components/CleanupLibraryModal.tsx +96 -0
- package/src/views/ImageManager/components/DeleteImageModal.tsx +144 -0
- package/src/views/ImageManager/components/ImageGrid.tsx +119 -0
- package/src/views/ImageManager/components/ImageManagerHeader.tsx +72 -0
- package/src/views/ImageManager/components/ImageManagerStats.tsx +60 -0
- package/src/views/ImageManager/components/ImageManagerToolbar.tsx +60 -0
- package/src/views/ImageManager/components/ImageTable.tsx +120 -0
- package/src/views/ImageManager/types.ts +27 -0
- package/src/views/ImageManager.tsx +103 -571
- package/src/components/BackgroundImage.d.ts +0 -11
- package/src/components/BackgroundImage.d.ts.map +0 -1
- package/src/components/GlobalImageEditor/config.d.ts +0 -9
- package/src/components/GlobalImageEditor/config.d.ts.map +0 -1
- package/src/components/GlobalImageEditor/eventHandlers.d.ts +0 -20
- package/src/components/GlobalImageEditor/eventHandlers.d.ts.map +0 -1
- package/src/components/GlobalImageEditor/imageDetection.d.ts +0 -16
- package/src/components/GlobalImageEditor/imageDetection.d.ts.map +0 -1
- package/src/components/GlobalImageEditor/imageSetup.d.ts +0 -9
- package/src/components/GlobalImageEditor/imageSetup.d.ts.map +0 -1
- package/src/components/GlobalImageEditor/saveLogic.d.ts +0 -26
- package/src/components/GlobalImageEditor/saveLogic.d.ts.map +0 -1
- package/src/components/GlobalImageEditor/stylingDetection.d.ts +0 -9
- package/src/components/GlobalImageEditor/stylingDetection.d.ts.map +0 -1
- package/src/components/GlobalImageEditor/transformParsing.d.ts +0 -16
- package/src/components/GlobalImageEditor/transformParsing.d.ts.map +0 -1
- package/src/components/GlobalImageEditor/types.d.ts +0 -36
- package/src/components/GlobalImageEditor/types.d.ts.map +0 -1
- package/src/components/GlobalImageEditor.d.ts +0 -8
- package/src/components/GlobalImageEditor.d.ts.map +0 -1
- package/src/components/Image.d.ts +0 -22
- package/src/components/Image.d.ts.map +0 -1
- package/src/components/ImageBrowserModal.d.ts +0 -13
- package/src/components/ImageBrowserModal.d.ts.map +0 -1
- package/src/components/ImageEditor.d.ts +0 -27
- package/src/components/ImageEditor.d.ts.map +0 -1
- package/src/components/ImagePicker.d.ts +0 -3
- package/src/components/ImagePicker.d.ts.map +0 -1
- package/src/components/ImagesPluginInit.d.ts +0 -24
- package/src/components/ImagesPluginInit.d.ts.map +0 -1
- package/src/hooks/useImagePicker.d.ts +0 -20
- package/src/hooks/useImagePicker.d.ts.map +0 -1
- package/src/types/index.d.ts +0 -80
- package/src/types/index.d.ts.map +0 -1
- package/src/utils/fallback.d.ts +0 -27
- package/src/utils/fallback.d.ts.map +0 -1
- package/src/utils/transforms.d.ts +0 -26
- package/src/utils/transforms.d.ts.map +0 -1
- package/src/views/ImageManager.d.ts +0 -10
- package/src/views/ImageManager.d.ts.map +0 -1
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export interface BackgroundImageProps {
|
|
3
|
-
id: string;
|
|
4
|
-
className?: string;
|
|
5
|
-
style?: React.CSSProperties;
|
|
6
|
-
children?: React.ReactNode;
|
|
7
|
-
backgroundSize?: 'cover' | 'contain' | 'auto' | string;
|
|
8
|
-
backgroundPosition?: string;
|
|
9
|
-
}
|
|
10
|
-
export declare function BackgroundImage({ id, className, style, children, backgroundSize, backgroundPosition, }: BackgroundImageProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
//# sourceMappingURL=BackgroundImage.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BackgroundImage.d.ts","sourceRoot":"","sources":["BackgroundImage.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAInD,MAAM,WAAW,oBAAoB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,cAAc,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,CAAC;IACvD,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,wBAAgB,eAAe,CAAC,EAC5B,EAAE,EACF,SAAc,EACd,KAAU,EACV,QAAQ,EACR,cAAwB,EACxB,kBAA6B,GAChC,EAAE,oBAAoB,2CAqEtB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["config.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C;;GAEG;AACH,wBAAgB,eAAe,IAAI,YAAY,CAW9C"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Event handlers for image changes and effects
|
|
3
|
-
*/
|
|
4
|
-
import type { SelectedImage } from './types';
|
|
5
|
-
import type { ImageMetadata } from '../../types';
|
|
6
|
-
/**
|
|
7
|
-
* Apply image changes to DOM and save to API
|
|
8
|
-
*/
|
|
9
|
-
export declare function handleImageChange(image: ImageMetadata | null, selectedImage: SelectedImage, onClose: () => void): Promise<void>;
|
|
10
|
-
/**
|
|
11
|
-
* Handle brightness change
|
|
12
|
-
* @param saveImmediately - If true, save to API immediately. If false, only update state/DOM (for editor preview)
|
|
13
|
-
*/
|
|
14
|
-
export declare function handleBrightnessChange(brightness: number, selectedImage: SelectedImage, setSelectedImage: (image: SelectedImage) => void, saveImmediately?: boolean): Promise<void>;
|
|
15
|
-
/**
|
|
16
|
-
* Handle blur change
|
|
17
|
-
* @param saveImmediately - If true, save to API immediately. If false, only update state/DOM (for editor preview)
|
|
18
|
-
*/
|
|
19
|
-
export declare function handleBlurChange(blur: number, selectedImage: SelectedImage, setSelectedImage: (image: SelectedImage) => void, saveImmediately?: boolean): Promise<void>;
|
|
20
|
-
//# sourceMappingURL=eventHandlers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"eventHandlers.d.ts","sourceRoot":"","sources":["eventHandlers.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjD;;GAEG;AACH,wBAAsB,iBAAiB,CACnC,KAAK,EAAE,aAAa,GAAG,IAAI,EAC3B,aAAa,EAAE,aAAa,EAC5B,OAAO,EAAE,MAAM,IAAI,GACpB,OAAO,CAAC,IAAI,CAAC,CAiDf;AAoID;;;GAGG;AACH,wBAAsB,sBAAsB,CACxC,UAAU,EAAE,MAAM,EAClB,aAAa,EAAE,aAAa,EAC5B,gBAAgB,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,EAChD,eAAe,GAAE,OAAc,GAChC,OAAO,CAAC,IAAI,CAAC,CAyBf;AAED;;;GAGG;AACH,wBAAsB,gBAAgB,CAClC,IAAI,EAAE,MAAM,EACZ,aAAa,EAAE,aAAa,EAC5B,gBAAgB,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,EAChD,eAAe,GAAE,OAAc,GAChC,OAAO,CAAC,IAAI,CAAC,CAyBf"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Image detection and parsing utilities
|
|
3
|
-
*/
|
|
4
|
-
import type { SelectedImage } from './types';
|
|
5
|
-
/**
|
|
6
|
-
* Extract image source from element (handles Next.js Image wrapper)
|
|
7
|
-
*/
|
|
8
|
-
export declare function getImageSource(element: HTMLElement, isBackground: boolean): {
|
|
9
|
-
currentSrc: string;
|
|
10
|
-
actualImgElement: HTMLImageElement | null;
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
* Parse image data from element to create SelectedImage
|
|
14
|
-
*/
|
|
15
|
-
export declare function parseImageData(element: HTMLElement, id: string, currentBrightness?: number, currentBlur?: number): SelectedImage | null;
|
|
16
|
-
//# sourceMappingURL=imageDetection.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"imageDetection.d.ts","sourceRoot":"","sources":["imageDetection.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAI7C;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,OAAO,GAAG;IACzE,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,gBAAgB,GAAG,IAAI,CAAC;CAC7C,CAmCA;AAED;;GAEG;AACH,wBAAgB,cAAc,CAC1B,OAAO,EAAE,WAAW,EACpB,EAAE,EAAE,MAAM,EACV,iBAAiB,CAAC,EAAE,MAAM,EAC1B,WAAW,CAAC,EAAE,MAAM,GACrB,aAAa,GAAG,IAAI,CAoGtB"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Image setup and click handlers
|
|
3
|
-
*/
|
|
4
|
-
import type { SelectedImage } from './types';
|
|
5
|
-
/**
|
|
6
|
-
* Setup click handlers and hover effects for all images
|
|
7
|
-
*/
|
|
8
|
-
export declare function setupImageHandlers(onImageClick: (image: SelectedImage) => void): () => void;
|
|
9
|
-
//# sourceMappingURL=imageSetup.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"imageSetup.d.ts","sourceRoot":"","sources":["imageSetup.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAK7C;;GAEG;AACH,wBAAgB,kBAAkB,CAC9B,YAAY,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,GAC7C,MAAM,IAAI,CAmSZ"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Save logic for image transforms and effects
|
|
3
|
-
*/
|
|
4
|
-
import type { SelectedImage, PendingTransform } from './types';
|
|
5
|
-
/**
|
|
6
|
-
* Normalize position values - convert -50% (centering value) to 0
|
|
7
|
-
*/
|
|
8
|
-
export declare function normalizePosition(position: number): number;
|
|
9
|
-
/**
|
|
10
|
-
* Get filename from element or API
|
|
11
|
-
*/
|
|
12
|
-
export declare function getFilename(semanticId: string, selectedImage: SelectedImage): Promise<string | null>;
|
|
13
|
-
/**
|
|
14
|
-
* Save image transform to API
|
|
15
|
-
*/
|
|
16
|
-
export declare function saveTransformToAPI(semanticId: string, filename: string, scale: number, positionX: number, positionY: number, brightness: number, blur: number): Promise<boolean>;
|
|
17
|
-
/**
|
|
18
|
-
* Flush pending save immediately
|
|
19
|
-
*/
|
|
20
|
-
export declare function flushPendingSave(pending: PendingTransform, selectedImage: SelectedImage): Promise<void>;
|
|
21
|
-
/**
|
|
22
|
-
* Save image transform with debouncing support
|
|
23
|
-
* This is a wrapper that handles the debouncing logic
|
|
24
|
-
*/
|
|
25
|
-
export declare function saveImageTransform(semanticId: string, filename: string, scale: number, positionX: number, positionY: number, brightness: number, blur: number): Promise<void>;
|
|
26
|
-
//# sourceMappingURL=saveLogic.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"saveLogic.d.ts","sourceRoot":"","sources":["saveLogic.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE/D;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE1D;AAED;;GAEG;AACH,wBAAsB,WAAW,CAC7B,UAAU,EAAE,MAAM,EAClB,aAAa,EAAE,aAAa,GAC7B,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CA4BxB;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CACpC,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,MAAM,GACb,OAAO,CAAC,OAAO,CAAC,CAmClB;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CAClC,OAAO,EAAE,gBAAgB,EACzB,aAAa,EAAE,aAAa,GAC7B,OAAO,CAAC,IAAI,CAAC,CAaf;AAED;;;GAGG;AACH,wBAAsB,kBAAkB,CACpC,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,MAAM,GACb,OAAO,CAAC,IAAI,CAAC,CAEf"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Utilities for detecting styling from DOM elements
|
|
3
|
-
*/
|
|
4
|
-
import type { DetectedStyling } from './types';
|
|
5
|
-
/**
|
|
6
|
-
* Detect styling properties from an element and its parent containers
|
|
7
|
-
*/
|
|
8
|
-
export declare function detectStyling(element: HTMLElement, imgElement: HTMLImageElement | null): DetectedStyling;
|
|
9
|
-
//# sourceMappingURL=stylingDetection.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stylingDetection.d.ts","sourceRoot":"","sources":["stylingDetection.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C;;GAEG;AACH,wBAAgB,aAAa,CACzB,OAAO,EAAE,WAAW,EACpB,UAAU,EAAE,gBAAgB,GAAG,IAAI,GACpC,eAAe,CA6GjB"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Utilities for parsing CSS transforms to extract scale and position values
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Parse scale from CSS transform string
|
|
6
|
-
*/
|
|
7
|
-
export declare function parseScaleFromTransform(transform: string, container: HTMLElement | null, imgElement: HTMLImageElement | null): number;
|
|
8
|
-
/**
|
|
9
|
-
* Parse position (X, Y) from CSS transform string
|
|
10
|
-
* Returns container-relative percentages
|
|
11
|
-
*/
|
|
12
|
-
export declare function parsePositionFromTransform(transform: string): {
|
|
13
|
-
x: number;
|
|
14
|
-
y: number;
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=transformParsing.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"transformParsing.d.ts","sourceRoot":"","sources":["transformParsing.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,wBAAgB,uBAAuB,CACnC,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,WAAW,GAAG,IAAI,EAC7B,UAAU,EAAE,gBAAgB,GAAG,IAAI,GACpC,MAAM,CA+BR;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,SAAS,EAAE,MAAM,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAkCtF"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Types for GlobalImageEditor component
|
|
3
|
-
*/
|
|
4
|
-
export interface SelectedImage {
|
|
5
|
-
element: HTMLElement;
|
|
6
|
-
originalSrc: string;
|
|
7
|
-
brightness: number;
|
|
8
|
-
blur: number;
|
|
9
|
-
scale: number;
|
|
10
|
-
positionX: number;
|
|
11
|
-
positionY: number;
|
|
12
|
-
isBackground: boolean;
|
|
13
|
-
aspectRatio?: string;
|
|
14
|
-
borderRadius?: string;
|
|
15
|
-
objectFit?: 'cover' | 'contain' | 'fill' | 'none' | 'scale-down';
|
|
16
|
-
objectPosition?: string;
|
|
17
|
-
}
|
|
18
|
-
export interface PluginConfig {
|
|
19
|
-
enabled: boolean;
|
|
20
|
-
className?: string;
|
|
21
|
-
overlayClassName?: string;
|
|
22
|
-
}
|
|
23
|
-
export interface DetectedStyling {
|
|
24
|
-
aspectRatio: string;
|
|
25
|
-
borderRadius: string;
|
|
26
|
-
objectFit: 'cover' | 'contain' | 'fill' | 'none' | 'scale-down';
|
|
27
|
-
objectPosition: string;
|
|
28
|
-
}
|
|
29
|
-
export interface PendingTransform {
|
|
30
|
-
scale: number;
|
|
31
|
-
positionX: number;
|
|
32
|
-
positionY: number;
|
|
33
|
-
semanticId: string;
|
|
34
|
-
filename: string;
|
|
35
|
-
}
|
|
36
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,aAAa;IAC1B,OAAO,EAAE,WAAW,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,OAAO,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,YAAY,CAAC;IACjE,cAAc,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,YAAY;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,eAAe;IAC5B,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,YAAY,CAAC;IAChE,cAAc,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,gBAAgB;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Global Image Editor Component
|
|
3
|
-
* Allows clicking on any image in the client app to edit it (admin/dev only)
|
|
4
|
-
*
|
|
5
|
-
* Reads configuration from window.__JHITS_PLUGIN_PROPS__['plugin-images']
|
|
6
|
-
*/
|
|
7
|
-
export declare function GlobalImageEditor(): import("react/jsx-runtime").JSX.Element | null;
|
|
8
|
-
//# sourceMappingURL=GlobalImageEditor.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"GlobalImageEditor.d.ts","sourceRoot":"","sources":["GlobalImageEditor.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAeH,wBAAgB,iBAAiB,mDAkThC"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export interface PluginImageProps {
|
|
3
|
-
id: string;
|
|
4
|
-
alt: string;
|
|
5
|
-
width?: number;
|
|
6
|
-
height?: number;
|
|
7
|
-
className?: string;
|
|
8
|
-
fill?: boolean;
|
|
9
|
-
sizes?: string;
|
|
10
|
-
priority?: boolean;
|
|
11
|
-
objectFit?: 'contain' | 'cover' | 'fill' | 'none' | 'scale-down';
|
|
12
|
-
objectPosition?: string;
|
|
13
|
-
style?: React.CSSProperties;
|
|
14
|
-
editable?: boolean;
|
|
15
|
-
scale?: number;
|
|
16
|
-
positionX?: number;
|
|
17
|
-
positionY?: number;
|
|
18
|
-
brightness?: number;
|
|
19
|
-
blur?: number;
|
|
20
|
-
}
|
|
21
|
-
export declare function Image({ id, alt, width, height, className, fill, sizes, priority, objectFit, objectPosition, style, editable, ...props }: PluginImageProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
-
//# sourceMappingURL=Image.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Image.d.ts","sourceRoot":"","sources":["Image.tsx"],"names":[],"mappings":"AAGA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAKjF,MAAM,WAAW,gBAAgB;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,YAAY,CAAC;IACjE,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,QAAQ,CAAC,EAAE,OAAO,CAAC;IAEnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,KAAK,CAAC,EAClB,EAAE,EACF,GAAG,EACH,KAAK,EACL,MAAM,EACN,SAAc,EACd,IAAY,EACZ,KAAK,EACL,QAAgB,EAChB,SAAmB,EACnB,cAAyB,EACzB,KAAK,EACL,QAAe,EACf,GAAG,KAAK,EACX,EAAE,gBAAgB,2CA2SlB"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { ImageMetadata } from '../types';
|
|
3
|
-
export interface ImageBrowserModalProps {
|
|
4
|
-
isOpen: boolean;
|
|
5
|
-
onClose: () => void;
|
|
6
|
-
onSelectImage: (image: ImageMetadata) => void;
|
|
7
|
-
selectedImageId?: string;
|
|
8
|
-
darkMode?: boolean;
|
|
9
|
-
onUpload?: (file: File) => Promise<void>;
|
|
10
|
-
uploading?: boolean;
|
|
11
|
-
}
|
|
12
|
-
export declare function ImageBrowserModal({ isOpen, onClose, onSelectImage, selectedImageId, darkMode, onUpload, uploading, }: ImageBrowserModalProps): React.ReactPortal | null;
|
|
13
|
-
//# sourceMappingURL=ImageBrowserModal.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ImageBrowserModal.d.ts","sourceRoot":"","sources":["ImageBrowserModal.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA4D,MAAM,OAAO,CAAC;AAGjF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AA8P9C,MAAM,WAAW,sBAAsB;IACnC,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,aAAa,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAC9C,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACzC,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB;AAID,wBAAgB,iBAAiB,CAAC,EAC9B,MAAM,EACN,OAAO,EACP,aAAa,EACb,eAAe,EACf,QAAgB,EAChB,QAAQ,EACR,SAAiB,GACpB,EAAE,sBAAsB,4BA6iBxB"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export interface ImageEditorProps {
|
|
3
|
-
imageUrl: string;
|
|
4
|
-
scale: number;
|
|
5
|
-
positionX: number;
|
|
6
|
-
positionY: number;
|
|
7
|
-
brightness?: number;
|
|
8
|
-
blur?: number;
|
|
9
|
-
onScaleChange: (scale: number) => void;
|
|
10
|
-
onPositionChange: (x: number, y: number) => void;
|
|
11
|
-
onBrightnessChange?: (brightness: number) => void;
|
|
12
|
-
onBlurChange?: (blur: number) => void;
|
|
13
|
-
aspectRatio?: string;
|
|
14
|
-
borderRadius?: string;
|
|
15
|
-
imageId?: string;
|
|
16
|
-
}
|
|
17
|
-
export interface ImageEditorHandle {
|
|
18
|
-
flushSave: () => Promise<{
|
|
19
|
-
scale: number;
|
|
20
|
-
positionX: number;
|
|
21
|
-
positionY: number;
|
|
22
|
-
brightness: number;
|
|
23
|
-
blur: number;
|
|
24
|
-
}>;
|
|
25
|
-
}
|
|
26
|
-
export declare const ImageEditor: React.ForwardRefExoticComponent<ImageEditorProps & React.RefAttributes<ImageEditorHandle>>;
|
|
27
|
-
//# sourceMappingURL=ImageEditor.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ImageEditor.d.ts","sourceRoot":"","sources":["ImageEditor.tsx"],"names":[],"mappings":"AAEA,OAAO,KAA6F,MAAM,OAAO,CAAC;AAIlH,MAAM,WAAW,gBAAgB;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,gBAAgB,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACjD,kBAAkB,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IAClD,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,iBAAiB;IAC9B,SAAS,EAAE,MAAM,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACvH;AAED,eAAO,MAAM,WAAW,4FAuStB,CAAC"}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { ImagePickerProps } from '../types';
|
|
2
|
-
export declare function ImagePicker({ value, onChange, brightness, blur, scale, positionX, positionY, aspectRatio, borderRadius, onBrightnessChange, onBlurChange, onScaleChange, onPositionXChange, onPositionYChange, onEditorSave, autoOpenEditor, }: ImagePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
-
//# sourceMappingURL=ImagePicker.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ImagePicker.d.ts","sourceRoot":"","sources":["ImagePicker.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAQjD,wBAAgB,WAAW,CAAC,EACxB,KAAK,EAAE,QAAQ,EAAE,UAAgB,EAAE,IAAQ,EAAE,KAAW,EAAE,SAAa,EAAE,SAAa,EACtF,WAAoB,EAAE,YAA2B,EAAE,kBAAkB,EAAE,YAAY,EACnF,aAAa,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,YAAY,EAAE,cAAsB,GAC5F,EAAE,gBAAgB,2CAuPlB"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Images Plugin Initialization Component
|
|
3
|
-
*
|
|
4
|
-
* This component reads from window.__JHITS_PLUGIN_PROPS__['plugin-images']
|
|
5
|
-
* and renders the GlobalImageEditor if enabled.
|
|
6
|
-
*
|
|
7
|
-
* Render this once in your app layout after calling initImagesPlugin().
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* Images Plugin Initialization Component
|
|
11
|
-
*
|
|
12
|
-
* Renders the global image editor if enabled in the plugin configuration.
|
|
13
|
-
* This component should be rendered in your app layout.
|
|
14
|
-
*
|
|
15
|
-
* @example
|
|
16
|
-
* ```tsx
|
|
17
|
-
* import { ImagesPluginInit } from '@jhits/plugin-images';
|
|
18
|
-
*
|
|
19
|
-
* // After calling initImagesPlugin() in a useEffect or script
|
|
20
|
-
* <ImagesPluginInit />
|
|
21
|
-
* ```
|
|
22
|
-
*/
|
|
23
|
-
export declare function ImagesPluginInit(): import("react/jsx-runtime").JSX.Element;
|
|
24
|
-
//# sourceMappingURL=ImagesPluginInit.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ImagesPluginInit.d.ts","sourceRoot":"","sources":["ImagesPluginInit.tsx"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gBAAgB,4CAE/B"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Hook for Image Picker Logic
|
|
3
|
-
*/
|
|
4
|
-
import type { ImageMetadata } from '../types';
|
|
5
|
-
export interface UseImagePickerOptions {
|
|
6
|
-
value?: string;
|
|
7
|
-
images: ImageMetadata[];
|
|
8
|
-
}
|
|
9
|
-
export declare function useImagePicker({ value, images }: UseImagePickerOptions): {
|
|
10
|
-
selectedImage: ImageMetadata | null;
|
|
11
|
-
setSelectedImage: import("react").Dispatch<import("react").SetStateAction<ImageMetadata | null>>;
|
|
12
|
-
uploading: boolean;
|
|
13
|
-
fileInputRef: import("react").RefObject<HTMLInputElement | null>;
|
|
14
|
-
handleFileSelect: (e?: React.ChangeEvent<HTMLInputElement> | {
|
|
15
|
-
target: {
|
|
16
|
-
files: File[] | null;
|
|
17
|
-
};
|
|
18
|
-
}) => Promise<any>;
|
|
19
|
-
};
|
|
20
|
-
//# sourceMappingURL=useImagePicker.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useImagePicker.d.ts","sourceRoot":"","sources":["useImagePicker.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,MAAM,WAAW,qBAAqB;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,aAAa,EAAE,CAAC;CAC3B;AAED,wBAAgB,cAAc,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,qBAAqB;;;;;2BA6R/B,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,GAAG;QAAE,MAAM,EAAE;YAAE,KAAK,EAAE,IAAI,EAAE,GAAG,IAAI,CAAA;SAAE,CAAA;KAAE;EA8CjH"}
|
package/src/types/index.d.ts
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Image Plugin Types
|
|
3
|
-
*/
|
|
4
|
-
export interface ImageMetadata {
|
|
5
|
-
/** Unique image ID */
|
|
6
|
-
id: string;
|
|
7
|
-
/** Original filename */
|
|
8
|
-
filename: string;
|
|
9
|
-
/** File path/URL */
|
|
10
|
-
url: string;
|
|
11
|
-
/** File size in bytes */
|
|
12
|
-
size: number;
|
|
13
|
-
/** MIME type */
|
|
14
|
-
mimeType: string;
|
|
15
|
-
/** Image dimensions */
|
|
16
|
-
width?: number;
|
|
17
|
-
height?: number;
|
|
18
|
-
/** Alt text */
|
|
19
|
-
alt?: string;
|
|
20
|
-
/** Upload timestamp */
|
|
21
|
-
uploadedAt: string;
|
|
22
|
-
/** Uploaded by user ID */
|
|
23
|
-
uploadedBy?: string;
|
|
24
|
-
/** Tags for searching */
|
|
25
|
-
tags?: string[];
|
|
26
|
-
}
|
|
27
|
-
export interface ImageUploadResponse {
|
|
28
|
-
success: boolean;
|
|
29
|
-
image?: ImageMetadata;
|
|
30
|
-
error?: string;
|
|
31
|
-
}
|
|
32
|
-
export interface ImageListResponse {
|
|
33
|
-
images: ImageMetadata[];
|
|
34
|
-
total: number;
|
|
35
|
-
page: number;
|
|
36
|
-
limit: number;
|
|
37
|
-
}
|
|
38
|
-
export interface ImagePickerProps {
|
|
39
|
-
/** Current selected image URL */
|
|
40
|
-
value?: string;
|
|
41
|
-
/** Callback when image is selected */
|
|
42
|
-
onChange: (image: ImageMetadata | null) => void;
|
|
43
|
-
/** Whether dark mode is enabled */
|
|
44
|
-
darkMode?: boolean;
|
|
45
|
-
/** Show brightness and blur controls */
|
|
46
|
-
showEffects?: boolean;
|
|
47
|
-
/** Current brightness value (0-200, 100 = normal) */
|
|
48
|
-
brightness?: number;
|
|
49
|
-
/** Current blur value (0-20) */
|
|
50
|
-
blur?: number;
|
|
51
|
-
/** Current scale value (0.1-3.0, 1.0 = normal) */
|
|
52
|
-
scale?: number;
|
|
53
|
-
/** Current X position offset (-100 to 100, 0 = center) */
|
|
54
|
-
positionX?: number;
|
|
55
|
-
/** Current Y position offset (-100 to 100, 0 = center) */
|
|
56
|
-
positionY?: number;
|
|
57
|
-
/** Aspect ratio for preview/editor (e.g., "4/5", "3/4", "16/9", "1/1") */
|
|
58
|
-
aspectRatio?: string;
|
|
59
|
-
/** Border radius class (e.g., "rounded-xl", "rounded-3xl") */
|
|
60
|
-
borderRadius?: string;
|
|
61
|
-
/** Object fit style (e.g., "cover", "contain") */
|
|
62
|
-
objectFit?: 'cover' | 'contain' | 'fill' | 'none' | 'scale-down';
|
|
63
|
-
/** Object position (e.g., "center", "top", "bottom") */
|
|
64
|
-
objectPosition?: string;
|
|
65
|
-
/** Callback when brightness changes */
|
|
66
|
-
onBrightnessChange?: (brightness: number) => void;
|
|
67
|
-
/** Callback when blur changes */
|
|
68
|
-
onBlurChange?: (blur: number) => void;
|
|
69
|
-
/** Callback when scale changes */
|
|
70
|
-
onScaleChange?: (scale: number) => void;
|
|
71
|
-
/** Callback when X position changes */
|
|
72
|
-
onPositionXChange?: (positionX: number) => void;
|
|
73
|
-
/** Callback when Y position changes */
|
|
74
|
-
onPositionYChange?: (positionY: number) => void;
|
|
75
|
-
/** Callback when editor "Done" button is clicked - triggers immediate save */
|
|
76
|
-
onEditorSave?: (scale: number, positionX: number, positionY: number, brightness?: number, blur?: number) => void;
|
|
77
|
-
/** Automatically open the editor when component mounts (useful for modal scenarios) */
|
|
78
|
-
autoOpenEditor?: boolean;
|
|
79
|
-
}
|
|
80
|
-
//# sourceMappingURL=index.d.ts.map
|
package/src/types/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,aAAa;IAC1B,sBAAsB;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,wBAAwB;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,oBAAoB;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,yBAAyB;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,gBAAgB;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,uBAAuB;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,eAAe;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,uBAAuB;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,0BAA0B;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,yBAAyB;IACzB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,mBAAmB;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,iBAAiB;IAC9B,MAAM,EAAE,aAAa,EAAE,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,gBAAgB;IAC7B,iCAAiC;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sCAAsC;IACtC,QAAQ,EAAE,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI,KAAK,IAAI,CAAC;IAChD,mCAAmC;IACnC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,wCAAwC;IACxC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,qDAAqD;IACrD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gCAAgC;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,kDAAkD;IAClD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,0DAA0D;IAC1D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0DAA0D;IAC1D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0EAA0E;IAC1E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8DAA8D;IAC9D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kDAAkD;IAClD,SAAS,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,YAAY,CAAC;IACjE,wDAAwD;IACxD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,uCAAuC;IACvC,kBAAkB,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IAClD,iCAAiC;IACjC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,kCAAkC;IAClC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,uCAAuC;IACvC,iBAAiB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAChD,uCAAuC;IACvC,iBAAiB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAChD,8EAA8E;IAC9E,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACjH,uFAAuF;IACvF,cAAc,CAAC,EAAE,OAAO,CAAC;CAC5B"}
|
package/src/utils/fallback.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Fallback image utility
|
|
3
|
-
* Provides a default fallback image URL when images fail to load or are invalid
|
|
4
|
-
* Also handles URL construction for image filenames
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* Returns the URL for the fallback "image not found" image
|
|
8
|
-
* Served from the plugin's API route
|
|
9
|
-
*/
|
|
10
|
-
export declare function getFallbackImageUrl(): string;
|
|
11
|
-
/**
|
|
12
|
-
* Constructs the full image URL from a filename or URL
|
|
13
|
-
* - If it's already a full URL (http://, https://, or starts with /), returns as-is
|
|
14
|
-
* - If it's a filename, constructs `/api/uploads/${filename}`
|
|
15
|
-
*/
|
|
16
|
-
export declare function constructImageUrl(src: string | null | undefined): string | null;
|
|
17
|
-
/**
|
|
18
|
-
* Validates if a URL is valid and can be used with Next.js Image component
|
|
19
|
-
*/
|
|
20
|
-
export declare function isValidImageUrl(url: string | null | undefined): boolean;
|
|
21
|
-
/**
|
|
22
|
-
* Gets a safe image URL with automatic URL construction and fallback
|
|
23
|
-
* - Constructs the full URL if src is a filename
|
|
24
|
-
* - Falls back to the plugin's fallback image if invalid or missing
|
|
25
|
-
*/
|
|
26
|
-
export declare function getSafeImageUrl(src: string | null | undefined): string;
|
|
27
|
-
//# sourceMappingURL=fallback.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fallback.d.ts","sourceRoot":"","sources":["fallback.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;GAGG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CAE5C;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAY/E;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAkBvE;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAUtE"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Image Transform Utilities
|
|
3
|
-
*/
|
|
4
|
-
export interface ImageTransformOptions {
|
|
5
|
-
scale: number;
|
|
6
|
-
positionX: number;
|
|
7
|
-
positionY: number;
|
|
8
|
-
baseScale?: number;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Calculates the CSS transform string
|
|
12
|
-
* Order: Center -> Scale -> Translate (Offset)
|
|
13
|
-
*
|
|
14
|
-
* Position values are stored as percentages of the CONTAINER, not the image.
|
|
15
|
-
* This makes them consistent across different container sizes.
|
|
16
|
-
*
|
|
17
|
-
* IMPORTANT: The image uses width: auto; height: auto with minWidth: 100%; minHeight: 100%
|
|
18
|
-
* This allows the image to maintain its natural aspect ratio while ensuring it covers the container.
|
|
19
|
-
* baseScale handles the "fitting" to ensure the image is large enough to fill the container.
|
|
20
|
-
*
|
|
21
|
-
* Applying SCALE before POSITION makes the position relative to the visual size you see,
|
|
22
|
-
* not the original raw file size. This ensures consistent positioning across different scales.
|
|
23
|
-
*/
|
|
24
|
-
export declare function getImageTransform(options: ImageTransformOptions, needsCentering?: boolean, caller?: string): string;
|
|
25
|
-
export declare function getImageFilter(brightness?: number, blur?: number): string | undefined;
|
|
26
|
-
//# sourceMappingURL=transforms.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"transforms.d.ts","sourceRoot":"","sources":["transforms.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,qBAAqB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAC7B,OAAO,EAAE,qBAAqB,EAC9B,cAAc,GAAE,OAAe,EAC/B,MAAM,CAAC,EAAE,MAAM,GAChB,MAAM,CAmBR;AAED,wBAAgB,cAAc,CAAC,UAAU,GAAE,MAAY,EAAE,IAAI,GAAE,MAAU,GAAG,MAAM,GAAG,SAAS,CAG7F"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Image Manager View
|
|
3
|
-
* Main view for managing uploaded images
|
|
4
|
-
*/
|
|
5
|
-
export interface ImageManagerViewProps {
|
|
6
|
-
siteId: string;
|
|
7
|
-
locale: string;
|
|
8
|
-
}
|
|
9
|
-
export declare function ImageManagerView({ siteId, locale }: ImageManagerViewProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
//# sourceMappingURL=ImageManager.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ImageManager.d.ts","sourceRoot":"","sources":["ImageManager.tsx"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,MAAM,WAAW,qBAAqB;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAClB;AAED,wBAAgB,gBAAgB,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,qBAAqB,2CAczE"}
|