@stratametriq/id-card-designer 1.17.0 → 1.17.1
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 +88 -4
- package/dist/index.es.js +6649 -5692
- package/dist/index.js +114 -99
- 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.1
|
|
6
6
|
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -11,9 +11,10 @@ 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.1](#whats-new-in-v1171)
|
|
14
15
|
- [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-
|
|
16
|
+
- [What's New in v1.16.0](#whats-new-in-v160)
|
|
17
|
+
- [What's New in v1.15.0](#whats-new-in-v150)
|
|
17
18
|
- [Features](#features)
|
|
18
19
|
- [Enterprise Roles & Permissions (RBAC)](#enterprise-roles--permissions-rbac)
|
|
19
20
|
- [Enterprise Audit Logs & Access Trail](#enterprise-audit-logs--access-trail)
|
|
@@ -76,11 +77,27 @@ Free for personal projects, students, open-source initiatives, and non-profit or
|
|
|
76
77
|
|
|
77
78
|
---
|
|
78
79
|
|
|
80
|
+
## What's New in v1.17.1
|
|
81
|
+
- **👥 Team User Provisioning Cockpit & Granular Permission Editor:**
|
|
82
|
+
- Expanded `<RoleSwitcherModal />` with a full-featured operator management dashboard supporting **+ Add User**, **Edit User**, and **Delete User**.
|
|
83
|
+
- **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`).
|
|
84
|
+
- **Protected Primary Super Admin:** Safety guardrails preventing accidental deletion or demotion of the root system administrator.
|
|
85
|
+
- **🌐 Open-Source Neutral Identity Architecture:**
|
|
86
|
+
- Removed hardcoded personal names from the public library core in favor of neutral `System Administrator` (`admin@organization.com`, `isPrimaryAdmin: true`).
|
|
87
|
+
- 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.
|
|
88
|
+
- **⚡ Production SaaS Real Database Synchronization:**
|
|
89
|
+
- Added turnkey database synchronization props: `users`, `onAddUser`, `onUpdateUser`, and `onDeleteUser` enabling direct connection to PostgreSQL, Supabase, MySQL, MongoDB, Firebase, Laravel, and REST/GraphQL backends.
|
|
90
|
+
- **Dual-Mode Persistence:** Automatically switches to browser IndexedDB (`localforage`) when database callback props are omitted, guaranteeing offline resilience and zero-config prototyping.
|
|
91
|
+
- **🏷️ Master Header Operator Identity Pill:**
|
|
92
|
+
- 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.
|
|
93
|
+
- **📦 Public Utility Exports:**
|
|
94
|
+
- Exported `getUserPermissions` and `STORAGE_KEY_USERS` (`ricd_users_v1`) from `@stratametriq/id-card-designer`.
|
|
95
|
+
|
|
79
96
|
## What's New in v1.17.0
|
|
80
97
|
- **👥 Enterprise Role-Based Access Control (RBAC):** Complete, modular RBAC architecture designed for institutional ERPs, healthcare portals, universities, and enterprise identity deployments.
|
|
81
98
|
- **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
99
|
- **6 Pre-Configured Personas:** Complete with avatars, departments, colors, and badge tokens:
|
|
83
|
-
- 🛡️ **Super Admin** (`
|
|
100
|
+
- 🛡️ **Super Admin** (`System Administrator` / Host App Session User): Full unrestricted authority across all features, settings, and purge actions.
|
|
84
101
|
- 🎨 **Template Designer** (`Maya Lin`): Visual canvas drafting, element styling, watermark management, and revision history. Rosters and batch printing are locked.
|
|
85
102
|
- 📋 **Data Registrar** (`Rahul Mehta`): Cardholder profiles, CSV/Excel/ZIP data imports, and webcam photo capture. Template layouts and record deletions are locked.
|
|
86
103
|
- 🖨️ **Issuance Officer** (`Carlos Mendez`): High-resolution 300 DPI batch PDF rendering and ZIP package downloads. Template layouts and record deletions are locked.
|
|
@@ -309,6 +326,69 @@ function DevSandbox() {
|
|
|
309
326
|
</>
|
|
310
327
|
);
|
|
311
328
|
}
|
|
329
|
+
### 7. Real SaaS Production Database vs Offline Test Data
|
|
330
|
+
|
|
331
|
+
`@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:
|
|
332
|
+
|
|
333
|
+
#### Mode A: Standalone / Offline Mode (Test Data)
|
|
334
|
+
* **How it works:** When you don't provide backend callback props, the package uses browser `IndexedDB` (`localforage`).
|
|
335
|
+
* **Use case:** Local testing, offline desktop applications, or quick client-side demos without needing a backend server.
|
|
336
|
+
* **Behavior:** Any user created or permission modified is saved inside the local browser.
|
|
337
|
+
|
|
338
|
+
#### Mode B: Live SaaS Production Mode (Real Cloud Database)
|
|
339
|
+
* **How it works:** In multi-user SaaS deployments, connect `<IdCardManager />` directly to your real API endpoints (PostgreSQL, Supabase, MySQL, MongoDB, Firebase, Laravel, Node.js):
|
|
340
|
+
|
|
341
|
+
```jsx
|
|
342
|
+
import React, { useState, useEffect } from 'react';
|
|
343
|
+
import { IdCardManager } from '@stratametriq/id-card-designer';
|
|
344
|
+
|
|
345
|
+
export default function SaaSIdentityApp({ activeAuthUser }) {
|
|
346
|
+
const [realUsers, setRealUsers] = useState([]);
|
|
347
|
+
|
|
348
|
+
// 1. Fetch real team users from your backend API
|
|
349
|
+
useEffect(() => {
|
|
350
|
+
fetch('/api/v1/organization/users')
|
|
351
|
+
.then(res => res.json())
|
|
352
|
+
.then(data => setRealUsers(data));
|
|
353
|
+
}, []);
|
|
354
|
+
|
|
355
|
+
return (
|
|
356
|
+
<IdCardManager
|
|
357
|
+
// Pass the real authenticated session user (Super Admin or Operator)
|
|
358
|
+
currentUser={activeAuthUser}
|
|
359
|
+
|
|
360
|
+
// Pass live database users array
|
|
361
|
+
users={realUsers}
|
|
362
|
+
|
|
363
|
+
// Real Database Sync: Create user in your backend DB
|
|
364
|
+
onAddUser={async (newUser) => {
|
|
365
|
+
const response = await fetch('/api/v1/organization/users', {
|
|
366
|
+
method: 'POST',
|
|
367
|
+
headers: { 'Content-Type': 'application/json' },
|
|
368
|
+
body: JSON.stringify(newUser)
|
|
369
|
+
});
|
|
370
|
+
const savedUser = await response.json();
|
|
371
|
+
setRealUsers(prev => [...prev, savedUser]);
|
|
372
|
+
}}
|
|
373
|
+
|
|
374
|
+
// Real Database Sync: Update role / permissions in your backend DB
|
|
375
|
+
onUpdateUser={async (updatedUser) => {
|
|
376
|
+
await fetch(`/api/v1/organization/users/${updatedUser.id}`, {
|
|
377
|
+
method: 'PUT',
|
|
378
|
+
headers: { 'Content-Type': 'application/json' },
|
|
379
|
+
body: JSON.stringify(updatedUser)
|
|
380
|
+
});
|
|
381
|
+
setRealUsers(prev => prev.map(u => u.id === updatedUser.id ? updatedUser : u));
|
|
382
|
+
}}
|
|
383
|
+
|
|
384
|
+
// Real Database Sync: Delete user from your backend DB
|
|
385
|
+
onDeleteUser={async (userId) => {
|
|
386
|
+
await fetch(`/api/v1/organization/users/${userId}`, { method: 'DELETE' });
|
|
387
|
+
setRealUsers(prev => prev.filter(u => u.id !== userId));
|
|
388
|
+
}}
|
|
389
|
+
/>
|
|
390
|
+
);
|
|
391
|
+
}
|
|
312
392
|
```
|
|
313
393
|
|
|
314
394
|
---
|
|
@@ -610,6 +690,10 @@ Your application remains responsible for compliance with applicable privacy and
|
|
|
610
690
|
| `showRoleSwitcher` | `boolean` | `true` | Toggle display of the header operator persona switcher pill / modal |
|
|
611
691
|
| `initialAuditLogs` | `array` | `null` | Array of historical audit entries to populate `<AuditLogModal />` |
|
|
612
692
|
| `onAuditLog` | `function` | `undefined` | Callback `(auditEntry) => void` fired whenever an auditable action occurs (ideal for SIEM / database sync) |
|
|
693
|
+
| `users` | `array` | `null` | Real team users array from your backend database (`[{ id, name, email, role, ... }]`). When omitted, uses local IndexedDB |
|
|
694
|
+
| `onAddUser` | `function` | `undefined` | Callback `async (newUser) => void` to persist a new operator in your backend database API |
|
|
695
|
+
| `onUpdateUser` | `function` | `undefined` | Callback `async (updatedUser) => void` to persist modified operator permissions in your backend database API |
|
|
696
|
+
| `onDeleteUser` | `function` | `undefined` | Callback `async (userId) => void` to delete an operator from your backend database API |
|
|
613
697
|
|
|
614
698
|
### Public Package Exports
|
|
615
699
|
|