@visns-studio/visns-components 5.15.8 → 5.15.10

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 CHANGED
@@ -9,10 +9,11 @@ A comprehensive React component library used by the VISNS Studio team for CRM an
9
9
 
10
10
  VISNS Components is a React-based UI component library that provides a set of reusable, consistent, and customizable components for building web applications. It includes components for authentication, data grids, forms, navigation, and more, designed to work seamlessly together.
11
11
 
12
- ## Recent Updates (v5.15.6)
12
+ ## Recent Updates (v5.15.10)
13
13
 
14
14
  ### Latest Enhancements
15
15
 
16
+ - **CameraPlacement Legacy Import**: Added comprehensive legacy JSON file import functionality with support for multiple data formats, automatic image loading, and seamless database integration
16
17
  - **CameraPlacement Module**: Enhanced interactive camera placement tool with improved UI consistency, better icon visibility, drag-and-drop image upload, professional export capabilities, and complete Verkada database integration
17
18
  - **Complete StandardModal Migration**: All components now use StandardModal instead of reactjs-popup for consistent modal behavior across the entire library
18
19
  - **HTML Content Support**: Terms and conditions now properly parse HTML content from TinyMCE editors with clean rendering
@@ -2461,6 +2462,15 @@ import { CameraPlacement } from 'visns-components';
2461
2462
  <CameraPlacement />
2462
2463
  ```
2463
2464
 
2465
+ **Legacy Import Workflow:**
2466
+ 1. **Click Import Button**: Orange folder icon (📁) in the header controls
2467
+ 2. **Select JSON File**: Choose legacy camera placement JSON file (.json extension)
2468
+ 3. **Automatic Processing**: Smart parser handles multiple formats automatically
2469
+ 4. **Import Validation**: Real-time validation with detailed error messages if needed
2470
+ 5. **Data Loading**: Cameras, background images, and project metadata loaded instantly
2471
+ 6. **Review & Adjust**: Fine-tune camera positions if coordinate scaling differs
2472
+ 7. **Save to Database**: Use existing save functionality to persist imported data
2473
+
2464
2474
  **Key Features:**
2465
2475
  - **Enhanced User Interface**: Modern icon-based controls with tooltips, consistent color theming using project CSS variables
2466
2476
  - **Dual Mode Support**: Switch between Mapbox map integration and image-based placement with seamless transitions
@@ -2470,10 +2480,14 @@ import { CameraPlacement } from 'visns-components';
2470
2480
  - **FOV Visualization**: Intelligent field-of-view triangles with inverse distance scaling for realistic coverage display
2471
2481
  - **Interactive Placement**: Drag-and-drop camera positioning with rotation handles for directional adjustment
2472
2482
  - **Save/Load Projects**: Export/import camera placements as JSON files with project metadata and timestamps
2483
+ - **Legacy JSON Import**: One-click import of legacy camera placement files with automatic format detection and base64 image support
2473
2484
  - **Professional Exports**: Generate high-quality PNG reports with side-by-side camera specifications and installation details
2474
2485
  - **SweetAlert Integration**: Professional modal dialogs for confirmations, error handling, and success notifications
2475
2486
 
2476
- **Recent Improvements (v5.15.6):**
2487
+ **Recent Improvements (v5.15.10):**
2488
+ - **Legacy JSON Import**: Comprehensive import functionality supporting multiple legacy data formats with automatic image loading and base64 processing
2489
+ - **Enhanced Controls Layout**: Expanded controls container to accommodate new import button with proper spacing and responsive design
2490
+ - **Smart Data Parser**: Intelligent JSON parsing that handles 4+ different legacy format structures with fallback handling
2477
2491
  - **Icon Visibility**: Fixed save button icon visibility with improved color contrast and explicit styling
2478
2492
  - **UI Consistency**: All buttons now use project-standard color variables for consistent theming
2479
2493
  - **Tooltips**: CSS-based tooltips for all control buttons with descriptive text
@@ -2488,6 +2502,30 @@ import { CameraPlacement } from 'visns-components';
2488
2502
  - **Advanced Models**: Support for optical zoom, telephoto lenses, 4K resolution, and specialized security features
2489
2503
  - **Real-time Updates**: Live camera specification display in sidebar with direction controls and coordinate tracking
2490
2504
 
2505
+ **Legacy Import System (v5.15.10+):**
2506
+ - **Multi-Format Support**: Handles 4+ different legacy JSON structures automatically with intelligent format detection
2507
+ - **Base64 Image Processing**: Seamless import of large images (4MB+) with base64 data URL support
2508
+ - **Smart Data Validation**: Comprehensive validation with user-friendly error messages and detailed debugging
2509
+ - **Format Flexibility**: Supports various naming conventions (`image.src`, `uploadedImage`, `backgroundImage`, etc.)
2510
+ - **One-Click Migration**: Import legacy projects with cameras, images, and metadata in a single operation
2511
+ - **Database Integration**: Imported data immediately compatible with save/load database functionality
2512
+ - **Visual Import Feedback**: Loading indicators, success dialogs with import summaries, and error handling
2513
+
2514
+ **Supported Legacy Formats:**
2515
+ ```javascript
2516
+ // Format 1: Standard export with image object
2517
+ { "image": { "src": "data:image/...", "name": "..." }, "cameras": [...] }
2518
+
2519
+ // Format 2: Nested placement structure
2520
+ { "placement": { "cameras": [...], "image": "...", "projectName": "..." } }
2521
+
2522
+ // Format 3: Simple camera array
2523
+ [{ "id": 1, "name": "Camera 1", "x": 100, "y": 200, ... }]
2524
+
2525
+ // Format 4: Auto-detected custom structures
2526
+ { "customData": { "cameraArray": [...] }, "backgroundImage": "..." }
2527
+ ```
2528
+
2491
2529
  **Technical Capabilities:**
2492
2530
  - **Map Integration**: Mapbox GL JS with geocoding search, satellite imagery, and custom marker styling
2493
2531
  - **Image Processing**: Support for floor plans and site diagrams with HTML5 file API and FileReader integration
package/package.json CHANGED
@@ -94,7 +94,7 @@
94
94
  "react-dom": "^17.0.0 || ^18.0.0"
95
95
  },
96
96
  "name": "@visns-studio/visns-components",
97
- "version": "5.15.8",
97
+ "version": "5.15.10",
98
98
  "description": "Various packages to assist in the development of our Custom Applications.",
99
99
  "main": "src/index.js",
100
100
  "files": [