@stratametriq/id-card-designer 1.10.0 → 1.12.0

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 (4) hide show
  1. package/README.md +118 -39
  2. package/dist/index.es.js +21248 -19469
  3. package/dist/index.js +249 -202
  4. package/package.json +1 -1
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  A universal, dynamic, and highly customizable **ID Card Designer & Batch Print Dashboard** for React, Vue, Angular, and Vanilla JS.
4
4
 
5
- > **Current release:** 1.10.0
5
+ > **Current release:** 1.12.0
6
6
 
7
7
  ---
8
8
 
@@ -10,8 +10,11 @@ A universal, dynamic, and highly customizable **ID Card Designer & Batch Print D
10
10
 
11
11
  - [Overview](#overview)
12
12
  - [Live Demo](#live-demo)
13
+ - [What's New in v1.12.0](#whats-new-in-v1120)
14
+ - [What's New in v1.11.0](#whats-new-in-v1110)
13
15
  - [What's New in v1.10.0](#whats-new-in-v1100)
14
16
  - [Features](#features)
17
+ - [ID Card Verification & Card Lifecycle](#id-card-verification--card-lifecycle)
15
18
  - [How It Works](#how-it-works)
16
19
  - [Import Data](#import-data)
17
20
  - [Design Cards](#design-cards)
@@ -38,7 +41,7 @@ It is designed for applications such as:
38
41
  - Membership systems
39
42
  - Internal identity-card workflows
40
43
 
41
- The package combines **visual card design** with **structured data and batch generation** so developers do not need to build an ID-card production workflow from scratch.
44
+ The package combines **visual card design** with **structured data, batch generation, card lifecycle management, and live digital verification** so developers do not need to build an ID-card production workflow from scratch.
42
45
 
43
46
  ---
44
47
 
@@ -50,52 +53,37 @@ You can launch a complete ID card design studio and batch print dashboard with j
50
53
 
51
54
  ---
52
55
 
53
- ## What's New in v1.10.0
54
- - **Brand & Security Watermark Suite:** Complete watermarking support for card templates, live canvas editing, previews, and batch print exports.
55
- - **Multi-Mode Watermarks:** Brand / Security Text (`STRATAMETRIQ`, `OFFICIAL`, `SAMPLE`, `CONFIDENTIAL`, `DRAFT`), Custom Logo/Seal Uploads, and Repeating SVG Security Tiles.
56
- - **Dynamic Placeholders:** Watermarks support live field bindings like `{{companyName}}` or `{{employeeId}}`.
57
- - **Inspector Controls:** Opacity sliders (`3%`–`40%`), rotation angle dials (`-45°` to `45°`), color and font size controls.
58
- - **Layer & Side Targeting:** Background (behind text/photo) vs. Overlay (top security layer) placement with side targeting (`all`, `front`, `back`).
59
- - **300 DPI Export Integrity:** Watermarks export crisp in PDFs, thermal CR80 PVC prints, and PNGs while ensuring 100% barcode/QR optical scannability.
56
+ ## What's New in v1.12.0
57
+ - **Dynamic Custom Column / Field Creator (`+ Add Column`):** Add custom data columns (e.g. `Bus Route`, `Locker Number`, `RFID Badge UID`, `House Color`) directly inside the People Directory without re-uploading spreadsheets.
58
+ - **Auto-Generated Template Keys:** Automatically generates camelCase variables (e.g. `{{busRoute}}`) with customizable data types (`Text`, `Number`, `Date`, `Badge`).
59
+ - **Default Value Backfilling:** Automatically populates default values across all existing cards in the active department.
60
+ - **Live Table Controls:** Custom headers appear with `✦ Label`, 1-click ascending/descending sorting, and a one-click delete trigger (`[x]`).
61
+ - **Universal Propagation:** Custom columns appear in Add/Edit forms, resolve in `<IdCardPreview />`, export into `.xlsx`/`.csv`, bind as draggable tags in `<IdCardDesignerModal />`, and persist in IndexedDB (`idcd_customFieldDefsMap`) and `.stmq` project backups.
62
+ - **Enterprise People Directory Suite:**
63
+ - **Directory Export to Excel (.xlsx) & CSV (.csv):** Export all or selected cards into formatted `.xlsx` workbooks and `.csv` files completely client-side. Checkbox selection allows printing or exporting a single card or custom batch.
64
+ - **Live Data Quality & Missing Photo Filters:** Automatic audits identifying cards missing real portraits (`⚠️ Missing Photo (X)`) or incomplete information (`⚠️ Incomplete (X)`) with visual warning badges.
65
+ - **Dynamic Sub-Group (Department / Class) Filter:** Auto-discovers unique sections, roles, or wards with live count badges (`Group: [All Groups (X) ▾]`).
66
+ - **Card Expiry Date & Renewal Tracking:** Dedicated `expiryDate` tracking with automatic `🟡 EXPIRED` flagging and filter chips.
67
+ - **Duplicate ID Collision Detection:** Real-time frequency analysis highlights duplicate badge IDs with `⚠️ DUPLICATE` warning pills.
60
68
 
61
69
  ---
62
70
 
63
- ## What's New in v1.9.5
64
- - **Multi-Mode Scannable QR Codes:** Added support for Dynamic Field Binding (with URL prefixes), Static URLs, and vCard 3.0 Digital Contact Cards (instant smartphone scan-to-save contacts).
65
- - **Custom QR Colors & Error Correction Level (ECC):** Full foreground and background color pickers with selectable ECC levels (`L`, `M`, `Q`, `H`).
66
- - **1-Click Blank Excel Template Generator:** Download clean, pre-formatted `.xlsx` spreadsheets matching the columns of any active department.
67
- - **CR80 Thermal PVC Print Matrix Fix:** Accurate single-card sheet layout (`1 Col × 1 Row`, `54×86 mm`) calculations in the Live Sheet Grid Matrix.
68
- - **Enhanced Text Wrapping & Auto-Shrink:** Intelligent text break-word handling for long addresses and multi-line descriptions.
69
- - **Roster Monospace ID Badge Polish:** Added `whiteSpace: nowrap` to table ID badges in the Live Roster Directory.
70
-
71
- ---
72
-
73
- ## What's New in v1.9.4
74
- - **Full Roster CRUD & IndexedDB Sync:** Added an interactive **"+ Add Record"** modal with integrated photo upload, an **"Edit Record"** modal for fixing details on the fly, individual row **"Delete"** with confirmation, and bulk **"Delete Selected"** actions—all synchronized with browser IndexedDB (`localforage`).
75
- - **Interactive Multi-Column Sorting:** 1-click column header sorting (Ascending / Descending) across Name & Avatar, Class/Designation, ID Number, Guardian/Department, and Contact Phone.
76
- - **Smart Roster Pagination:** High-performance pagination toolbar (`10`, `25`, `50`, `100`, `All`) with responsive page navigation controls, preventing DOM lag on large imported rosters (1,000+ cards).
77
- - **Production-Grade Scannable QR & 1D Barcodes:** Upgraded QR codes (`qrcode`) and 1D Code 128 Barcodes (`jsbarcode`) to produce mathematically accurate, industry-standard matrices readable by mobile cameras and hardware laser scanners.
78
- - **Multi-CSV Import Append:** Sequential importing now seamlessly merges new records and dynamic fields without overriding previously imported data.
79
-
80
- ---
81
-
82
- ## What's New in v1.9.0
83
- - **AI Background Removal:** Integrated an advanced, fully client-side WebAssembly machine learning model (`@imgly/background-removal`) directly into the Live Roster Data Table. Users can now perfectly remove the background from uploaded profile photos or webcam captures with a single click, completely offline, without any backend processing or API keys.
84
-
85
- ---
86
-
87
- ## What's New in v1.8.0
88
- - **Canva-Style Smart Alignment Guides:** Magnetically snap elements to the center of the card or align them perfectly with other elements using color-coded visual guides (Purple for center, Red for edges).
89
- - **High-Res ZIP Export:** Batch export individual ID cards as high-resolution (300 DPI) PNG files neatly packaged in a single ZIP archive.
90
- - **Thermal PVC Printer Support:** Native support for exporting a perfectly dimensioned CR80 layout (1 card per page) specifically optimized for Zebra, Fargo, and Magicard thermal printers.
91
- - **Dynamic Image Fallbacks:** Beautifully generated initial-based avatars with consistent gradient backgrounds are automatically inserted if a profile photo is missing.
92
- - **Curved Typography:** Advanced SVG text rendering to wrap and curve text along circular paths.
71
+ ## What's New in v1.11.0
72
+ - **ID Card Digital Verification & Card Lifecycle Suite:** Upgrades `@stratametriq/id-card-designer` from a badge design canvas into a complete Enterprise Credential & Anti-Counterfeiting Platform.
73
+ - **Standalone `<IdCardVerificationModal />`:** Mobile-friendly digital verification certificate featuring real-time status banners (🟢 `Active`, 🟣 `Issued`, ⚪ `Draft`, 🟠 `Suspended`, 🔴 `Revoked`, 🚨 `Lost`), official database photo matching, and digital checksum verification.
74
+ - **Built-in HTML5 Camera Scanner:** Optical scanner using `getUserMedia` with targeting reticle overlay for instant badge scanning via laptop webcams or smartphone cameras.
75
+ - **Live Roster Lifecycle Controls:** Added interactive **Status Column** in `<IdCardManager />` with 1-click status switcher dropdowns, row-level **"Verify"** action buttons, and **Batch Action ▾** menu.
76
+ - **Smart Lifecycle Filter Tabs:** 1-Click filter toolbar (`All`, `Active`, `Issued`, `Draft`, `Suspended`, `Revoked`, `Selected`).
77
+ - **Automatic Print Issuance Promotion:** Batch PDF or ZIP export automatically promotes printed cards to **`Issued`** status with an ISO issuance timestamp (`issuedAt`).
78
+ - **Dynamic Verification QR Code Preset:** Dedicated "Verification QR" button and configuration in Property Editor with dynamic URL binding for live scanning.
93
79
 
94
80
  ---
95
81
 
96
82
  ## Features
97
83
 
98
84
  - **🎨 Visual ID Card Designer:** A complete workspace for designing ID cards with a visual canvas, configurable elements, templates, and preview capabilities.
85
+ - **➕ Custom Column / Field Creator:** Dynamically create custom data fields (`+ Add Column`) on the fly, with automated template key generation, default value backfilling, live table sorting, and persistent IndexedDB sync.
86
+ - **📊 Enterprise People Directory:** Export full or selected cards to formatted Excel (`.xlsx`) & CSV (`.csv`), filter by missing portraits or incomplete records, filter by class/department sub-groups, track card expiration dates, and detect duplicate ID collisions in real time.
99
87
  - **➕ Live Roster CRUD & Management:** Full inline editing ("Edit Record"), manual creation ("+ Add Record" with photo upload), individual deletion, and bulk selection deletion directly from the dashboard.
100
88
  - **🔀 Multi-Column Sorting & Smart Pagination:** 1-click column header sorting (Ascending / Descending) and customizable pagination (`10`, `25`, `50`, `100`, `All`) for smooth performance on large datasets.
101
89
  - **📥 CSV & Excel Import:** Import structured card data from `.csv`, `.xlsx`, and `.xls`. Imported columns can be used as dynamic fields inside templates.
@@ -104,9 +92,100 @@ You can launch a complete ID card design studio and batch print dashboard with j
104
92
  - **🔳 QR Codes & Barcodes:** Generate dynamic, scannable QR codes (`qrcode`) and 1D Code 128 barcodes (`jsbarcode`) and bind them to record values such as admission numbers, employee IDs, URLs, or other unique identifiers.
105
93
  - **🏷️ Dynamic Field Placeholders:** Bind template elements to imported data (e.g., `ID: {{admissionNo}}`).
106
94
  - **🧠 Conditional Rendering:** Text elements can use JavaScript expressions for conditional output (e.g., `{{ department === 'HR' ? 'Red' : 'Blue' }}`).
95
+ - **🛡️ Digital ID Card Verification:** Built-in `<IdCardVerificationModal />` with real-time status banners, anti-tampering photo match, HTML5 camera scanner, and public verification URLs.
96
+ - **🔄 Full Card Lifecycle Management:** Complete state machine tracking (`Active`, `Issued`, `Draft`, `Suspended`, `Revoked`, `Lost`), interactive table status pills, batch status transitions, and automatic issuance logging on print.
107
97
  - **🛡️ Brand & Security Watermark Suite:** Add customizable text watermarks (`STRATAMETRIQ`, `CONFIDENTIAL`, `SAMPLE`), uploaded brand seal logos, and repeating security tile patterns with live opacity, rotation, and layer controls.
108
98
  - **🔲 Smart Alignment Guides:** Snap elements to the center of the card or align them with other elements using visual color-coded guides (Purple for center, Red for edges).
109
99
  - **⌨️ Keyboard Shortcuts:** Navigate the editor faster using Undo/Redo (`Ctrl+Z`, `Ctrl+Y`), Duplicate (`Ctrl+C`, `Ctrl+V`), Delete, and Arrow Key nudging.
100
+
101
+ ---
102
+
103
+ ## ID Card Verification & Card Lifecycle
104
+
105
+ ### 1. Card Lifecycle State Machine
106
+
107
+ Physical and digital ID credentials transition through an operational lifecycle:
108
+
109
+ ```text
110
+ [Import / Add] ──► DRAFT
111
+ │
112
+ ▼
113
+ APPROVED
114
+ │
115
+ ▼ (Batch Print / Export)
116
+ ISSUED ──► ACTIVE ◄──► SUSPENDED (Temporary Freeze)
117
+ │
118
+ ┌──────────────────┼──────────────────┐
119
+ ▼ ▼ ▼
120
+ EXPIRED REVOKED LOST / STOLEN
121
+ (Term Ended) (Resigned/Exit) (Blacklisted)
122
+ ```
123
+
124
+ | Lifecycle State | Badge Indicator | Meaning & Access Rule |
125
+ | :--- | :--- | :--- |
126
+ | **Draft** | ⚪ `Gray` | Newly created record; pending administrative review before printing. |
127
+ | **Approved** | 🔵 `Blue` | Validated and approved for inclusion in batch print runs. |
128
+ | **Issued** | 🟣 `Purple` | High-DPI physical card printed; logs issuance timestamp (`issuedAt`). |
129
+ | **Active** | 🟢 `Green` | Currently valid credential; full campus / facility entry authorized. |
130
+ | **Suspended** | 🟠 `Amber` | Temporary administrative hold (fees, disciplinary, leave). Gate entry denied. |
131
+ | **Revoked** | 🔴 `Red` | Credential invalidated permanently (student graduated, employee resigned). |
132
+ | **Lost / Stolen** | 🚨 `Rose` | Badge blacklisted to prevent unauthorized impersonator entry. Confiscate on sight. |
133
+ | **Expired** | 🟡 `Yellow` | Credential validity date passed; renewal required. |
134
+
135
+ ### 2. Live Anti-Counterfeiting Verification
136
+
137
+ Every badge template can include a **Dynamic Verification QR Code** that points to an authentic verification certificate:
138
+ ```text
139
+ https://verify.stratametriq.com/badge/{{id}}
140
+ ```
141
+
142
+ When scanned by any smartphone camera or optical scanner:
143
+ 1. **Live Credential Status**: Instantly displays whether the badge is 🟢 `ACTIVE`, 🟠 `SUSPENDED`, or 🔴 `REVOKED`.
144
+ 2. **Official Database Photo Match**: Displays the high-resolution photo stored in the database to immediately expose photo-swapping tampering on physical PVC cards.
145
+ 3. **Audit Information**: Card serial number, emergency phone numbers, admission/employee code, and tamper-proof verification checksum.
146
+
147
+ ### 3. Verification Component Code Example
148
+
149
+ ```jsx
150
+ import React, { useState } from 'react';
151
+ import { IdCardVerificationModal } from '@stratametriq/id-card-designer';
152
+
153
+ function SecurityGateApp() {
154
+ const [isOpen, setIsOpen] = useState(false);
155
+ const [activeRecord, setActiveRecord] = useState(null);
156
+
157
+ const rosterRecords = [
158
+ {
159
+ id: 'ADM-2026-104',
160
+ studentName: 'Rahul Sharma',
161
+ classSec: 'Class X [A]',
162
+ status: 'active',
163
+ profilePhoto: 'https://images.unsplash.com/photo-1534528741775-53994a69daeb?w=300'
164
+ }
165
+ ];
166
+
167
+ return (
168
+ <div>
169
+ <button onClick={() => setIsOpen(true)}>
170
+ 🛡️ Verify ID Badge
171
+ </button>
172
+
173
+ <IdCardVerificationModal
174
+ isOpen={isOpen}
175
+ onClose={() => setIsOpen(false)}
176
+ records={rosterRecords}
177
+ activeRecord={activeRecord}
178
+ onUpdateRecordStatus={(recordId, newStatus) => {
179
+ console.log(`Updated record ${recordId} to ${newStatus}`);
180
+ }}
181
+ theme="dark"
182
+ categoryLabel="Student Credential"
183
+ />
184
+ </div>
185
+ );
186
+ }
187
+ ```
188
+
110
189
  ---
111
190
 
112
191
  ## How It Works