@mgonza02/goal-image-gallery 1.0.6 → 1.0.8

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/CHANGELOG.md CHANGED
@@ -5,6 +5,25 @@ All notable changes to the GoalImageGallery project will be documented in this f
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.0.8] - 2025-07-14
9
+
10
+ ### 🧹 Bug Fixes
11
+ - Fixed an issue with the `use-image-gallery` hook where the `imageCodes` prop was not being correctly split into an array.
12
+ - Updated the `GoalImageGallery` component to ensure the `currentCompany` prop can accept both string and number types for better flexibility.
13
+ - Removed unused `clipboardSupport` prop from the `GoalImageGallery` component to avoid confusion.
14
+ - Ensured consistent handling of `currentCompany` across all components.
15
+
16
+
17
+ ## [1.0.7] - 2025-07-14
18
+ ### 🧹 Bug fix
19
+ - Fixed an issue with clipboard support detection in the `use-image-gallery` hook.
20
+ - Updated the `GoalImageGallery` component to ensure clipboard support is correctly passed as a prop.
21
+ - Removed unused clipboard support prop from the component to avoid confusion.
22
+ - Ensured consistent handling of clipboard support across all components.
23
+
24
+
25
+
26
+
8
27
  ## [1.0.6] - 2025-07-11
9
28
 
10
29
  ### 🧹 Optimization & Cleanup
@@ -231,7 +231,7 @@ const GoalImageGallery = _ref => {
231
231
  noImageUrl = "/images/no-image.png",
232
232
  showError = message => console.error(message),
233
233
  hasPermission = () => true,
234
- currentCompany = "default",
234
+ currentCompany = 0,
235
235
  slot = {},
236
236
  slotProps = {}
237
237
  } = _ref;
@@ -378,7 +378,7 @@ const GoalImageGallery = _ref => {
378
378
  allowDownload: allowDownload,
379
379
  showImageInfo: showImageInfo,
380
380
  loading: loading,
381
- clipboardSupported: clipboardSupported,
381
+ clipboardSupported: !!clipboardSupported,
382
382
  getImageUrl: getImageUrl,
383
383
  noImageUrl: noImageUrl,
384
384
  onImageClick: handleOpenImage,
@@ -415,7 +415,7 @@ GoalImageGallery.propTypes = {
415
415
  noImageUrl: PropTypes.string,
416
416
  showError: PropTypes.func,
417
417
  hasPermission: PropTypes.func,
418
- currentCompany: PropTypes.string,
418
+ currentCompany: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
419
419
  slot: PropTypes.object,
420
420
  slotProps: PropTypes.object
421
421
  };
@@ -26,7 +26,7 @@ export const useImageGallery = _ref => {
26
26
 
27
27
  // Process image codes into image list
28
28
  useEffect(() => {
29
- const splitedImages = Array.isArray(imageCodes) ? imageCodes : imageCodes?.split(/[\s,]+/);
29
+ const splitedImages = Array.isArray(imageCodes) ? imageCodes : (imageCodes || '')?.split(/[\s,]+/);
30
30
  let newList = [];
31
31
  if (splitedImages) {
32
32
  const list = splitedImages.map((image_code, index) => ({
@@ -185,7 +185,7 @@ export const useImageZoom = (getImageUrl, imageList) => {
185
185
  export const useClipboard = (updatable, selectingImage, onPasteImage) => {
186
186
  const [clipboardSupported, setClipboardSupported] = useState(false);
187
187
  useEffect(() => {
188
- setClipboardSupported(navigator.clipboard);
188
+ setClipboardSupported(!!navigator.clipboard);
189
189
  }, []);
190
190
  useEffect(() => {
191
191
  const handlePaste = async event => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mgonza02/goal-image-gallery",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "description": "Advanced, accessible, and highly customizable React image gallery component with multi-method upload, responsive design, and extensive TypeScript support",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/index.js",