@stratametriq/id-card-designer 1.17.0 → 1.17.2
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 +104 -4
- package/dist/index.es.js +6790 -5660
- package/dist/index.js +113 -98
- 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.17.
|
|
5
|
+
> **Current release:** 1.17.2
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -11,9 +11,11 @@ A universal, dynamic, and highly customizable **ID Card Designer & Batch Print D
|
|
|
11
11
|
- [Overview](#overview)
|
|
12
12
|
- [Live Demo](#live-demo)
|
|
13
13
|
- [Pricing / License](#pricing--licensing-important)
|
|
14
|
+
- [What's New in v1.17.2](#whats-new-in-v1172)
|
|
15
|
+
- [What's New in v1.17.1](#whats-new-in-v171)
|
|
14
16
|
- [What's New in v1.17.0](#whats-new-in-v1170)
|
|
15
|
-
- [What's New in v1.16.0](#whats-new-in-
|
|
16
|
-
- [What's New in v1.15.0](#whats-new-in-
|
|
17
|
+
- [What's New in v1.16.0](#whats-new-in-v160)
|
|
18
|
+
- [What's New in v1.15.0](#whats-new-in-v150)
|
|
17
19
|
- [Features](#features)
|
|
18
20
|
- [Enterprise Roles & Permissions (RBAC)](#enterprise-roles--permissions-rbac)
|
|
19
21
|
- [Enterprise Audit Logs & Access Trail](#enterprise-audit-logs--access-trail)
|
|
@@ -76,11 +78,42 @@ Free for personal projects, students, open-source initiatives, and non-profit or
|
|
|
76
78
|
|
|
77
79
|
---
|
|
78
80
|
|
|
81
|
+
## What's New in v1.17.2
|
|
82
|
+
- **🧠 Smart Session User Auto-Detection:**
|
|
83
|
+
- Automatically identifies the authenticated operator from browser storage (`localStorage`, `sessionStorage`), window globals (`window.currentUser`, `window.authUser`), and domain metadata.
|
|
84
|
+
- Added user prop aliases (`currentUser`, `user`, `authUser`, `sessionUser`), guaranteeing seamless integration regardless of which prop name host applications provide.
|
|
85
|
+
- Dynamically binds the active authenticated user (`Aabid Hussain Wani`) as the primary root Super Admin.
|
|
86
|
+
- **🚫 Complete Eradication of Dummy Mock Personas in Production:**
|
|
87
|
+
- Removed all hardcoded mock personas (*Maya Lin*, *Rahul Mehta*, *Carlos Mendez*, *Officer David Briggs*, *Evelyn Vance*) from the production user registry.
|
|
88
|
+
- In production mode, the user list starts with **only the authenticated logged-in operator** (`Team Users (1)`).
|
|
89
|
+
- Newly added operators created via `+ Add New User` now populate the directory cleanly without mock user clutter.
|
|
90
|
+
- Added `demoMode` prop (`demoMode={false}` by default): host apps and test harnesses can explicitly opt into mock personas for sandboxing if desired.
|
|
91
|
+
- **🔄 Automated IndexedDB Migration & Storage Sanitizer:**
|
|
92
|
+
- Built-in `sanitizeAndMigrateUsers` purges legacy dummy mock personas from browser IndexedDB (`ricd_users_v1`), updating existing installations automatically without requiring manual cache clears while preserving all user-created accounts.
|
|
93
|
+
- **📦 Public Exports:**
|
|
94
|
+
- Exported `DEFAULT_PRIMARY_ADMIN`, `isDemoPersona`, `detectSessionUser`, and `sanitizeAndMigrateUsers` from `@stratametriq/id-card-designer`.
|
|
95
|
+
|
|
96
|
+
## What's New in v1.17.1
|
|
97
|
+
- **👥 Team User Provisioning Cockpit & Granular Permission Editor:**
|
|
98
|
+
- Expanded `<RoleSwitcherModal />` with a full-featured operator management dashboard supporting **+ Add User**, **Edit User**, and **Delete User**.
|
|
99
|
+
- **15-Permission Granular Matrix:** Super Admins can customize exact privileges (Templates, Rosters, Issuance/Security, Compliance Audit) for any operator with live checkbox toggles and real-time counter badges (`X of 15 Perms`).
|
|
100
|
+
- **Protected Primary Super Admin:** Safety guardrails preventing accidental deletion or demotion of the root system administrator.
|
|
101
|
+
- **🌐 Open-Source Neutral Identity Architecture:**
|
|
102
|
+
- Removed hardcoded personal names from the public library core in favor of neutral `System Administrator` (`admin@organization.com`, `isPrimaryAdmin: true`).
|
|
103
|
+
- Seamlessly accepts the host application's authenticated session user via `<IdCardManager currentUser={session.user} />` so that whoever signs in first becomes the active Super Admin.
|
|
104
|
+
- **⚡ Production SaaS Real Database Synchronization:**
|
|
105
|
+
- Added turnkey database synchronization props: `users`, `onAddUser`, `onUpdateUser`, and `onDeleteUser` enabling direct connection to PostgreSQL, Supabase, MySQL, MongoDB, Firebase, Laravel, and REST/GraphQL backends.
|
|
106
|
+
- **Dual-Mode Persistence:** Automatically switches to browser IndexedDB (`localforage`) when database callback props are omitted, guaranteeing offline resilience and zero-config prototyping.
|
|
107
|
+
- **🏷️ Master Header Operator Identity Pill:**
|
|
108
|
+
- Top-right profile pill and studio canvas persona pill dynamically reflect the authenticated operator's avatar, full name, and role badge, with instant 1-click access to the User & Role Management Cockpit.
|
|
109
|
+
- **📦 Public Utility Exports:**
|
|
110
|
+
- Exported `getUserPermissions` and `STORAGE_KEY_USERS` (`ricd_users_v1`) from `@stratametriq/id-card-designer`.
|
|
111
|
+
|
|
79
112
|
## What's New in v1.17.0
|
|
80
113
|
- **👥 Enterprise Role-Based Access Control (RBAC):** Complete, modular RBAC architecture designed for institutional ERPs, healthcare portals, universities, and enterprise identity deployments.
|
|
81
114
|
- **15 Granular Permissions:** Structured across Card Templates (`templates:read`, `templates:write`, `templates:history`), Cardholder Rosters (`records:read`, `records:create`, `records:edit`, `records:delete`, `records:import`, `records:export`), Production & Issuance (`issuance:export`), Physical Security (`security:verify`, `security:revoke`), Organization & Branch Management (`org:manage`), and Compliance Audit Trails (`audit:view`, `audit:clear`).
|
|
82
115
|
- **6 Pre-Configured Personas:** Complete with avatars, departments, colors, and badge tokens:
|
|
83
|
-
- 🛡️ **Super Admin** (`
|
|
116
|
+
- 🛡️ **Super Admin** (`System Administrator` / Host App Session User): Full unrestricted authority across all features, settings, and purge actions.
|
|
84
117
|
- 🎨 **Template Designer** (`Maya Lin`): Visual canvas drafting, element styling, watermark management, and revision history. Rosters and batch printing are locked.
|
|
85
118
|
- 📋 **Data Registrar** (`Rahul Mehta`): Cardholder profiles, CSV/Excel/ZIP data imports, and webcam photo capture. Template layouts and record deletions are locked.
|
|
86
119
|
- 🖨️ **Issuance Officer** (`Carlos Mendez`): High-resolution 300 DPI batch PDF rendering and ZIP package downloads. Template layouts and record deletions are locked.
|
|
@@ -309,6 +342,69 @@ function DevSandbox() {
|
|
|
309
342
|
</>
|
|
310
343
|
);
|
|
311
344
|
}
|
|
345
|
+
### 7. Real SaaS Production Database vs Offline Test Data
|
|
346
|
+
|
|
347
|
+
`@stratametriq/id-card-designer` is designed with a **Dual-Architecture Model** so it works immediately out-of-the-box for prototyping, but easily connects to real cloud databases in live SaaS production:
|
|
348
|
+
|
|
349
|
+
#### Mode A: Standalone / Offline Mode (Test Data)
|
|
350
|
+
* **How it works:** When you don't provide backend callback props, the package uses browser `IndexedDB` (`localforage`).
|
|
351
|
+
* **Use case:** Local testing, offline desktop applications, or quick client-side demos without needing a backend server.
|
|
352
|
+
* **Behavior:** Any user created or permission modified is saved inside the local browser.
|
|
353
|
+
|
|
354
|
+
#### Mode B: Live SaaS Production Mode (Real Cloud Database)
|
|
355
|
+
* **How it works:** In multi-user SaaS deployments, connect `<IdCardManager />` directly to your real API endpoints (PostgreSQL, Supabase, MySQL, MongoDB, Firebase, Laravel, Node.js):
|
|
356
|
+
|
|
357
|
+
```jsx
|
|
358
|
+
import React, { useState, useEffect } from 'react';
|
|
359
|
+
import { IdCardManager } from '@stratametriq/id-card-designer';
|
|
360
|
+
|
|
361
|
+
export default function SaaSIdentityApp({ activeAuthUser }) {
|
|
362
|
+
const [realUsers, setRealUsers] = useState([]);
|
|
363
|
+
|
|
364
|
+
// 1. Fetch real team users from your backend API
|
|
365
|
+
useEffect(() => {
|
|
366
|
+
fetch('/api/v1/organization/users')
|
|
367
|
+
.then(res => res.json())
|
|
368
|
+
.then(data => setRealUsers(data));
|
|
369
|
+
}, []);
|
|
370
|
+
|
|
371
|
+
return (
|
|
372
|
+
<IdCardManager
|
|
373
|
+
// Pass the real authenticated session user (Super Admin or Operator)
|
|
374
|
+
currentUser={activeAuthUser}
|
|
375
|
+
|
|
376
|
+
// Pass live database users array
|
|
377
|
+
users={realUsers}
|
|
378
|
+
|
|
379
|
+
// Real Database Sync: Create user in your backend DB
|
|
380
|
+
onAddUser={async (newUser) => {
|
|
381
|
+
const response = await fetch('/api/v1/organization/users', {
|
|
382
|
+
method: 'POST',
|
|
383
|
+
headers: { 'Content-Type': 'application/json' },
|
|
384
|
+
body: JSON.stringify(newUser)
|
|
385
|
+
});
|
|
386
|
+
const savedUser = await response.json();
|
|
387
|
+
setRealUsers(prev => [...prev, savedUser]);
|
|
388
|
+
}}
|
|
389
|
+
|
|
390
|
+
// Real Database Sync: Update role / permissions in your backend DB
|
|
391
|
+
onUpdateUser={async (updatedUser) => {
|
|
392
|
+
await fetch(`/api/v1/organization/users/${updatedUser.id}`, {
|
|
393
|
+
method: 'PUT',
|
|
394
|
+
headers: { 'Content-Type': 'application/json' },
|
|
395
|
+
body: JSON.stringify(updatedUser)
|
|
396
|
+
});
|
|
397
|
+
setRealUsers(prev => prev.map(u => u.id === updatedUser.id ? updatedUser : u));
|
|
398
|
+
}}
|
|
399
|
+
|
|
400
|
+
// Real Database Sync: Delete user from your backend DB
|
|
401
|
+
onDeleteUser={async (userId) => {
|
|
402
|
+
await fetch(`/api/v1/organization/users/${userId}`, { method: 'DELETE' });
|
|
403
|
+
setRealUsers(prev => prev.filter(u => u.id !== userId));
|
|
404
|
+
}}
|
|
405
|
+
/>
|
|
406
|
+
);
|
|
407
|
+
}
|
|
312
408
|
```
|
|
313
409
|
|
|
314
410
|
---
|
|
@@ -610,6 +706,10 @@ Your application remains responsible for compliance with applicable privacy and
|
|
|
610
706
|
| `showRoleSwitcher` | `boolean` | `true` | Toggle display of the header operator persona switcher pill / modal |
|
|
611
707
|
| `initialAuditLogs` | `array` | `null` | Array of historical audit entries to populate `<AuditLogModal />` |
|
|
612
708
|
| `onAuditLog` | `function` | `undefined` | Callback `(auditEntry) => void` fired whenever an auditable action occurs (ideal for SIEM / database sync) |
|
|
709
|
+
| `users` | `array` | `null` | Real team users array from your backend database (`[{ id, name, email, role, ... }]`). When omitted, uses local IndexedDB |
|
|
710
|
+
| `onAddUser` | `function` | `undefined` | Callback `async (newUser) => void` to persist a new operator in your backend database API |
|
|
711
|
+
| `onUpdateUser` | `function` | `undefined` | Callback `async (updatedUser) => void` to persist modified operator permissions in your backend database API |
|
|
712
|
+
| `onDeleteUser` | `function` | `undefined` | Callback `async (userId) => void` to delete an operator from your backend database API |
|
|
613
713
|
|
|
614
714
|
### Public Package Exports
|
|
615
715
|
|