@stratametriq/id-card-designer 1.16.0 → 1.17.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 +333 -14
  2. package/dist/index.es.js +6750 -5812
  3. package/dist/index.js +103 -98
  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.15.0
5
+ > **Current release:** 1.17.0
6
6
 
7
7
  ---
8
8
 
@@ -10,8 +10,13 @@ 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
+ - [Pricing / License](#pricing--licensing-important)
14
+ - [What's New in v1.17.0](#whats-new-in-v1170)
15
+ - [What's New in v1.16.0](#whats-new-in-v1160)
13
16
  - [What's New in v1.15.0](#whats-new-in-v1150)
14
17
  - [Features](#features)
18
+ - [Enterprise Roles & Permissions (RBAC)](#enterprise-roles--permissions-rbac)
19
+ - [Enterprise Audit Logs & Access Trail](#enterprise-audit-logs--access-trail)
15
20
  - [ID Card Verification & Card Lifecycle](#id-card-verification--card-lifecycle)
16
21
  - [How It Works](#how-it-works)
17
22
  - [Import Data](#import-data)
@@ -22,7 +27,6 @@ A universal, dynamic, and highly customizable **ID Card Designer & Batch Print D
22
27
  - [Privacy](#privacy)
23
28
  - [Developer Docs](#developer-docs)
24
29
  - [NPM](#npm)
25
- - [Pricing / License](#pricing--license)
26
30
  - [FAQ](#faq)
27
31
 
28
32
  ---
@@ -39,7 +43,7 @@ It is designed for applications such as:
39
43
  - Membership systems
40
44
  - Internal identity-card workflows
41
45
 
42
- 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.
46
+ The package combines **visual card design** with **structured data, batch generation, card lifecycle management, enterprise role-based access control, and live digital verification** so developers do not need to build an ID-card production workflow from scratch.
43
47
 
44
48
  ---
45
49
 
@@ -72,7 +76,30 @@ Free for personal projects, students, open-source initiatives, and non-profit or
72
76
 
73
77
  ---
74
78
 
75
- ## What's New in v1.15.0
79
+ ## What's New in v1.17.0
80
+ - **👥 Enterprise Role-Based Access Control (RBAC):** Complete, modular RBAC architecture designed for institutional ERPs, healthcare portals, universities, and enterprise identity deployments.
81
+ - **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
+ - **6 Pre-Configured Personas:** Complete with avatars, departments, colors, and badge tokens:
83
+ - 🛡️ **Super Admin** (`Dr. Arthur Pendelton`): Full unrestricted authority across all features, settings, and purge actions.
84
+ - 🎨 **Template Designer** (`Maya Lin`): Visual canvas drafting, element styling, watermark management, and revision history. Rosters and batch printing are locked.
85
+ - 📋 **Data Registrar** (`Rahul Mehta`): Cardholder profiles, CSV/Excel/ZIP data imports, and webcam photo capture. Template layouts and record deletions are locked.
86
+ - 🖨️ **Issuance Officer** (`Carlos Mendez`): High-resolution 300 DPI batch PDF rendering and ZIP package downloads. Template layouts and record deletions are locked.
87
+ - 🔍 **Security Verifier** (`Officer David Briggs`): Physical gate checkpoint scanning, barcode validation, and credential lifecycle status management (`active`, `suspended`, `revoked`, `lost`).
88
+ - 📊 **Compliance Auditor** (`Evelyn Vance`): Read-only inspection of templates and rosters, paired with full access to inspect diffs and export audit trails. Log purging is permanently disabled.
89
+ - **100% Backward Compatibility:** If no user or role prop is provided, `<IdCardManager />` automatically defaults to full unrestricted mode (`super_admin`), ensuring zero breaking changes for existing library consumers.
90
+ - **Per-User Custom Overrides:** Supports `user.customPermissions` arrays to augment base role privileges without altering global role matrices.
91
+ - **🛡️ Declarative Action Gating (`<PermissionGate />`):** Seamless conditional rendering, hiding, or disabled state rendering with custom security explanation tooltips (`disabledTooltip`).
92
+ - **🎛️ Interactive Persona Simulator (`<RoleSwitcherModal />`):** Built-in modal featuring an interactive Permission Matrix Inspector organized across Templates, Rosters, Issuance/Security, and Audit Logs for 1-click persona switching in demo and QA environments.
93
+ - **🔒 Read-Only Template Inspector Mode (`<IdCardDesignerModal />`):** When users possess `templates:read` but lack `templates:write`, the designer launches in read-only mode with visual warnings, locking canvas edits and template saves.
94
+ - **🚨 Non-Repudiation Security Audit Trails:** Every authorization denial automatically logs an `ACCESS_DENIED` event under `AUDIT_CATEGORIES.SECURITY` with actor identity and required permissions.
95
+
96
+ ## What's New in v1.16.0
97
+ - **📜 Enterprise Audit Logs & Access Trail System (`<AuditLogModal />`):**
98
+ - Enterprise audit trail cockpit equipped with KPI metrics counters (Total Events, Issuance / Prints, Record Modifications, Security Flags).
99
+ - Multi-dimensional filtering across full-text search, action categories (`issuance`, `record`, `template`, `security`, `organization`), severity levels (`info`, `warning`, `critical`), and departments.
100
+ - Interactive timeline cards featuring expandable visual **Before vs. After Field Diffs** with syntax-highlighted values and a collapsible Raw JSON inspector for technical compliance auditors.
101
+ - One-click **Export CSV** generating an official audit certificate spreadsheet formatted with UTF-8 BOM encoding for Microsoft Excel.
102
+ - Offline-first IndexedDB persistence paired with an `onAuditLog` callback prop for real-time synchronization with enterprise SIEM and database backends (Node.js, Laravel, Supabase, Postgres).
76
103
  - **⚡ Massive Bundle Size Reduction (75%+ Smaller):** Implemented aggressive code-splitting and dynamic `import()` across all heavy modules (`jspdf`, `exceljs`, `jszip`, `html2canvas`, `@imgly/background-removal`, `canvas-confetti`). The core bundle footprint shrank from ~3.35MB to ~785KB, drastically speeding up initial page load and rendering in host apps.
77
104
  - **🔒 Zero-Vulnerability Security Architecture:** Fully eliminated the deprecated `xlsx` library, resolving all high/critical prototype pollution and ReDoS CVEs. Standardized on secure, lightweight `exceljs` and `papaparse`.
78
105
  - **📑 Clean Template Generation & Smart Import Mapping:** Fixed duplicate and repetitive column headers in generated Excel/CSV templates. Intelligent synonym normalization prevents redundant columns (e.g., `Class`, `classSec`, `Phone`, `Phone_no`) and automatically binds incoming data seamlessly.
@@ -111,12 +138,238 @@ Free for personal projects, students, open-source initiatives, and non-profit or
111
138
  - **🧠 Conditional Rendering:** Text elements can use JavaScript expressions for conditional output (e.g., `{{ department === 'HR' ? 'Red' : 'Blue' }}`).
112
139
  - **🛡️ Digital ID Card Verification:** Built-in `<IdCardVerificationModal />` with real-time status banners, anti-tampering photo match, HTML5 camera scanner, and public verification URLs.
113
140
  - **🔄 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.
141
+ - **👥 Enterprise Role-Based Access Control (RBAC):** Built-in 15 granular permissions across templates, rosters, batch printing, security, organization, and compliance. Pre-configured with 6 operator roles (`Super Admin`, `Template Designer`, `Data Registrar`, `Issuance Officer`, `Security Verifier`, `Compliance Auditor`), declarative `<PermissionGate />`, and interactive `<RoleSwitcherModal />`.
142
+ - **📜 Enterprise Audit Trail & SIEM Integration:** Built-in `<AuditLogModal />` featuring real-time event recording, before-and-after field diffs, Excel UTF-8 BOM CSV export, non-repudiation actor tracking, and an `onAuditLog` callback for external SIEM / database synchronization.
114
143
  - **🛡️ 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.
115
144
  - **🔲 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).
116
145
  - **⌨️ Keyboard Shortcuts:** Navigate the editor faster using Undo/Redo (`Ctrl+Z`, `Ctrl+Y`), Duplicate (`Ctrl+C`, `Ctrl+V`), Delete, and Arrow Key nudging.
117
146
 
118
147
  ---
119
148
 
149
+ ## Enterprise Roles & Permissions (RBAC)
150
+
151
+ Modern universities, hospitals, corporate security departments, and government facilities enforce **Segregation of Duties (SoD)**:
152
+ - **Card Designers** should only style badge layouts and watermarks, not access confidential student/patient rosters.
153
+ - **Data Registrars** should enter student or employee profiles, but cannot alter card dimensions or delete historical records.
154
+ - **Print Officers** should execute high-resolution batch PDF printing, but cannot change data or templates.
155
+ - **Security Officers** at turnstiles require verification scanner tools, but should not be allowed to purge audit histories.
156
+ - **Compliance Auditors** require read-only access with before/after diff inspection, but zero modification authority.
157
+
158
+ `@stratametriq/id-card-designer` provides an **enterprise-grade RBAC engine** out of the box with zero additional configuration required.
159
+
160
+ ### 1. Granular Permission Matrix (15 Permissions)
161
+
162
+ | Category | Permission Key | Description |
163
+ | :--- | :--- | :--- |
164
+ | **Templates** | `templates:read` | View and inspect card design templates |
165
+ | | `templates:write` | Create, modify, and save card designs and element styles |
166
+ | | `templates:history` | Restore or delete previous template version snapshots |
167
+ | **Rosters** | `records:read` | View the cardholder directory and record details |
168
+ | | `records:create` | Add new cardholder records manually or via webcam |
169
+ | | `records:edit` | Update existing cardholder profile data or photos |
170
+ | | `records:delete` | Delete individual cardholder records or perform bulk deletion |
171
+ | | `records:import` | Upload bulk spreadsheets (`.xlsx`, `.csv`) and photo ZIP archives |
172
+ | | `records:export` | Export directory rosters to formatted Excel or CSV files |
173
+ | **Issuance** | `issuance:export` | Generate 300 DPI batch print PDFs and high-res ZIP archives |
174
+ | **Security** | `security:verify` | Access gate verification scanner and optical barcode validation |
175
+ | | `security:revoke` | Alter credential lifecycle status (`Active`, `Suspended`, `Revoked`, `Lost`) |
176
+ | **Organization** | `org:manage` | Manage institutional assets, brand logos, signatories, and branches |
177
+ | **Audit Trails** | `audit:view` | Inspect compliance event history, diff timelines, and export audit CSV |
178
+ | | `audit:clear` | Purge audit history logs (restricted to Super Administrators) |
179
+
180
+ ### 2. Standard Pre-Configured Personas
181
+
182
+ | Persona Role | Key Operator Persona | Badge | Authorized Capabilities |
183
+ | :--- | :--- | :--- | :--- |
184
+ | `super_admin` | Dr. Arthur Pendelton | 🛡️ `Super Admin` | Unrestricted authority across all features, settings, and purge actions. |
185
+ | `template_designer` | Maya Lin | 🎨 `Designer` | Template drafting, element styling, watermarks, version history. Rosters locked. |
186
+ | `data_registrar` | Rahul Mehta | 📋 `Registrar` | Cardholder data entry, CSV/Excel/ZIP bulk imports, webcam capture. Templates locked. |
187
+ | `issuance_officer` | Carlos Mendez | 🖨️ `Production` | Batch 300 DPI PDF rendering, single card print, ZIP archive generation. |
188
+ | `security_verifier` | Officer David Briggs | 🔍 `Verifier` | Gate checkpoint scanning, barcode lookups, credential status changes (`revoked`, `lost`). |
189
+ | `compliance_auditor` | Evelyn Vance | 📊 `Auditor` | Read-only inspection of templates, rosters, and audit diff timelines. Purging locked. |
190
+
191
+ ### 3. Usage with `<IdCardManager />`
192
+
193
+ ```jsx
194
+ import React, { useState } from 'react';
195
+ import { IdCardManager, ROLES, DEFAULT_DEMO_USERS } from '@stratametriq/id-card-designer';
196
+ import '@stratametriq/id-card-designer/dist/index.css';
197
+
198
+ export default function EnterpriseCardPortal() {
199
+ // Pass active authenticated operator from your backend or state manager
200
+ const [operator, setOperator] = useState({
201
+ id: 'usr-corp-991',
202
+ name: 'Carlos Mendez',
203
+ email: 'carlos.mendez@enterprise.com',
204
+ role: ROLES.ISSUANCE_OFFICER,
205
+ title: 'Print Bureau Officer',
206
+ avatar: 'https://images.unsplash.com/photo-1500648767791-00dcc994a43e?w=100'
207
+ });
208
+
209
+ return (
210
+ <IdCardManager
211
+ currentUser={operator}
212
+ onRoleChange={(newOperator) => {
213
+ console.log('Operator switched:', newOperator);
214
+ setOperator(newOperator);
215
+ }}
216
+ onPermissionDenied={(actionName, requiredPermission) => {
217
+ console.warn(`Denied: ${actionName} requires ${requiredPermission}`);
218
+ }}
219
+ showRoleSwitcher={true} // Shows Persona Switcher pill in header (ideal for QA & staging)
220
+ />
221
+ );
222
+ }
223
+ ```
224
+
225
+ > [!NOTE]
226
+ > **100% Backward Compatible:** If `currentUser` is omitted, `<IdCardManager />` automatically runs in unrestricted Super Admin mode. Existing implementations will experience zero disruptions.
227
+
228
+ ### 4. Declarative Component Gating with `<PermissionGate />`
229
+
230
+ Protect your own custom application buttons, sections, or actions using `<PermissionGate />`:
231
+
232
+ ```jsx
233
+ import { PermissionGate, PERMISSIONS } from '@stratametriq/id-card-designer';
234
+
235
+ function AdminToolbar({ activeUser, onBatchPrint, onClearData }) {
236
+ return (
237
+ <div className="toolbar">
238
+ {/* Conditionally rendered only if user can generate print batches */}
239
+ <PermissionGate user={activeUser} permission={PERMISSIONS.ISSUANCE_EXPORT}>
240
+ <button onClick={onBatchPrint}>
241
+ 🖨️ Batch Export A4 PDF
242
+ </button>
243
+ </PermissionGate>
244
+
245
+ {/* Rendered as disabled with security tooltip explaining why it is locked */}
246
+ <PermissionGate
247
+ user={activeUser}
248
+ permission={PERMISSIONS.RECORDS_DELETE}
249
+ showDisabled={true}
250
+ disabledTooltip="Restricted: Only Administrators can purge roster records."
251
+ >
252
+ <button onClick={onClearData} className="btn-danger">
253
+ 🗑️ Delete All Records
254
+ </button>
255
+ </PermissionGate>
256
+ </div>
257
+ );
258
+ }
259
+ ```
260
+
261
+ ### 5. Programmatic Permission Helpers
262
+
263
+ Check permissions directly within your event handlers or routing logic:
264
+
265
+ ```javascript
266
+ import { hasPermission, canAny, canAll, PERMISSIONS } from '@stratametriq/id-card-designer';
267
+
268
+ // Single permission check
269
+ if (hasPermission(currentUser, PERMISSIONS.TEMPLATES_WRITE)) {
270
+ console.log('User can edit design layouts');
271
+ }
272
+
273
+ // Any matching permission (OR logic)
274
+ if (canAny(currentUser, [PERMISSIONS.RECORDS_CREATE, PERMISSIONS.RECORDS_IMPORT])) {
275
+ console.log('User can add cardholders');
276
+ }
277
+
278
+ // All matching permissions (AND logic)
279
+ if (canAll(currentUser, [PERMISSIONS.TEMPLATES_WRITE, PERMISSIONS.ORG_MANAGE])) {
280
+ console.log('User has full branding and template authority');
281
+ }
282
+ ```
283
+
284
+ ### 6. Interactive Persona Simulator (`<RoleSwitcherModal />`)
285
+
286
+ Test permissions in development and staging environments using the built-in modal:
287
+
288
+ ```jsx
289
+ import React, { useState } from 'react';
290
+ import { RoleSwitcherModal, DEFAULT_DEMO_USERS } from '@stratametriq/id-card-designer';
291
+
292
+ function DevSandbox() {
293
+ const [isOpen, setIsOpen] = useState(false);
294
+ const [activeUser, setActiveUser] = useState(DEFAULT_DEMO_USERS[0]);
295
+
296
+ return (
297
+ <>
298
+ <button onClick={() => setIsOpen(true)}>
299
+ 🎭 Switch Operator Role ({activeUser.role})
300
+ </button>
301
+
302
+ <RoleSwitcherModal
303
+ isOpen={isOpen}
304
+ onClose={() => setIsOpen(false)}
305
+ currentUser={activeUser}
306
+ onSelectUser={(newUser) => setActiveUser(newUser)}
307
+ theme="dark"
308
+ />
309
+ </>
310
+ );
311
+ }
312
+ ```
313
+
314
+ ---
315
+
316
+ ## Enterprise Audit Logs & Access Trail
317
+
318
+ Every action taken inside the ID card studio is recorded into an **immutable, traceable audit log** with full non-repudiation:
319
+ - **Batch Issuance Runs**: Tracks number of cards printed, orientation, sheet configuration, and time.
320
+ - **Record Modifications**: Captures granular **Before-vs-After Diffs** highlighting exact changed field values.
321
+ - **Template Layouts**: Logs template saves and version restoration timestamps.
322
+ - **Physical Security & Gate Checks**: Records badge verification events, QR scans, and credential revocations.
323
+ - **Security Denials**: Automatically audits unauthorized access attempts (`ACCESS_DENIED`) with actor credentials.
324
+
325
+ ### Synchronizing Audit Events to Backend / SIEM
326
+
327
+ Use the `onAuditLog` prop to pipe live audit telemetry into your database (PostgreSQL, Supabase, MySQL) or SIEM log aggregator (Datadog, Splunk):
328
+
329
+ ```jsx
330
+ <IdCardManager
331
+ onAuditLog={(auditEntry) => {
332
+ // Send to your backend API
333
+ fetch('/api/v1/compliance/audit-logs', {
334
+ method: 'POST',
335
+ headers: { 'Content-Type': 'application/json' },
336
+ body: JSON.stringify(auditEntry)
337
+ });
338
+ }}
339
+ />
340
+ ```
341
+
342
+ ```json
343
+ {
344
+ "id": "aud-1726485921-9921",
345
+ "timestamp": "2026-09-16T11:25:21.000Z",
346
+ "action": "RECORD_UPDATED",
347
+ "category": "record",
348
+ "severity": "info",
349
+ "actor": {
350
+ "id": "usr-reg-03",
351
+ "name": "Rahul Mehta",
352
+ "role": "data_registrar",
353
+ "title": "Admissions Officer",
354
+ "email": "r.mehta@admissions.edu"
355
+ },
356
+ "details": {
357
+ "summary": "Updated cardholder profile for Rahul Sharma",
358
+ "recordId": "ADM-2026-104",
359
+ "diff": [
360
+ {
361
+ "field": "classSec",
362
+ "label": "Class & Section",
363
+ "before": "Class IX [B]",
364
+ "after": "Class X [A]"
365
+ }
366
+ ]
367
+ }
368
+ }
369
+ ```
370
+
371
+ ---
372
+
120
373
  ## ID Card Verification & Card Lifecycle
121
374
 
122
375
  ### 1. Card Lifecycle State Machine
@@ -329,21 +582,87 @@ Your application remains responsible for compliance with applicable privacy and
329
582
  ## Developer Docs
330
583
 
331
584
  ### Components
332
- - `<IdCardManager />`: Complete dashboard experience. Use this when you want the complete import → design → preview → batch-export workflow.
333
- - `<IdCardDesigner />`: Standalone visual designer.
585
+ - `<IdCardManager />`: Complete dashboard experience. Use this when you want the complete import → design → preview → batch-export workflow with RBAC safeguards and audit trails.
586
+ - `<IdCardDesignerModal />`: Open the drag-and-drop designer modal (supports `readOnly` inspector mode for non-designer roles).
334
587
  - `<IdCardPreview />`: Embed a live ID-card preview inside another application screen.
335
- - `<IdCardDesignerModal />`: Open the designer inside your application's modal/dialog workflow.
336
-
337
- ### Props (IdCardManager)
588
+ - `<IdCardCanvas />`: Core vector canvas supporting element selection, drag, resize, and zoom.
589
+ - `<ElementPropertyEditor />`: Property inspector for text styling, barcode configurations, colors, and watermarks.
590
+ - `<PresetsSidebar />`: Template preset browser and gallery.
591
+ - `<WatermarkLayer />`: Security and brand watermark overlay engine.
592
+ - `<IdCardVerificationModal />`: Turnkey credential verification screen with HTML5 camera QR scanner and anti-tampering photo match.
593
+ - `<AuditLogModal />`: Full enterprise compliance cockpit with KPI counters, event filters, diff timelines, and Excel CSV export.
594
+ - `<PermissionGate />`: Declarative permission barrier component (`showDisabled`, `disabledTooltip`, fallback).
595
+ - `<RoleSwitcherModal />`: Interactive persona simulator and permission matrix inspector for testing.
596
+
597
+ ### Props (`<IdCardManager />`)
338
598
  | Prop | Type | Default | Description |
339
599
  |---|---|---|---|
340
- | `sampleRecords` | `object` | Default data | Records used to populate the dashboard |
341
- | `categories` | `object` | Default config | Custom ID-card categories |
342
- | `onBatchExportComplete` | `function` | `undefined` | Callback after batch PDF generation |
600
+ | `sampleRecords` | `object` | Default data | Records used to populate the dashboard (`{ student: [], employee: [], ... }`) |
601
+ | `categories` | `object` | Default config | Custom ID-card categories and field definitions |
602
+ | `onBatchExportComplete` | `function` | `undefined` | Callback `(category, records) => void` after batch PDF generation |
343
603
  | `organization` | `object` | `DEFAULT_ORGANIZATION` | Institution profile (Name, Code, Logo, Signatory, Signature, Verification Base URL) |
344
- | `onSaveOrganization` | `function` | `undefined` | Callback when organization profile or brand assets are updated |
604
+ | `onSaveOrganization` | `function` | `undefined` | Callback `(orgData) => void` when organization profile or brand assets are updated |
345
605
  | `workspaces` | `array` | `DEFAULT_WORKSPACES` | List of branch workspaces/campuses (`[{ id, name, code, location }]`) |
346
- | `onSwitchWorkspace` | `function` | `undefined` | Callback when active branch workspace changes |
606
+ | `onSwitchWorkspace` | `function` | `undefined` | Callback `(workspace) => void` when active branch workspace changes |
607
+ | `currentUser` | `object` | `null` | Active operator persona (`{ id, name, role, title, email, avatar, customPermissions }`). Defaults to full unrestricted access (`super_admin`) |
608
+ | `onRoleChange` | `function` | `undefined` | Callback `(newUser) => void` triggered when operator persona changes |
609
+ | `onPermissionDenied` | `function` | `undefined` | Callback `(actionName, permission) => void` triggered when an unauthorized action is attempted |
610
+ | `showRoleSwitcher` | `boolean` | `true` | Toggle display of the header operator persona switcher pill / modal |
611
+ | `initialAuditLogs` | `array` | `null` | Array of historical audit entries to populate `<AuditLogModal />` |
612
+ | `onAuditLog` | `function` | `undefined` | Callback `(auditEntry) => void` fired whenever an auditable action occurs (ideal for SIEM / database sync) |
613
+
614
+ ### Public Package Exports
615
+
616
+ ```javascript
617
+ // Components
618
+ import {
619
+ IdCardManager,
620
+ IdCardDesignerModal,
621
+ IdCardPreview,
622
+ IdCardCanvas,
623
+ ElementPropertyEditor,
624
+ PresetsSidebar,
625
+ WatermarkLayer,
626
+ IdCardVerificationModal,
627
+ AuditLogModal,
628
+ PermissionGate,
629
+ RoleSwitcherModal
630
+ } from '@stratametriq/id-card-designer';
631
+
632
+ // PDF & Print Utilities
633
+ import { generateIdCardsPdf } from '@stratametriq/id-card-designer';
634
+
635
+ // Enterprise RBAC Helpers & Constants
636
+ import {
637
+ hasPermission,
638
+ canAny,
639
+ canAll,
640
+ getRoleDefinition,
641
+ PERMISSIONS,
642
+ ROLES,
643
+ ROLE_DEFINITIONS,
644
+ DEFAULT_DEMO_USERS
645
+ } from '@stratametriq/id-card-designer';
646
+
647
+ // Enterprise Audit Logging Utilities & Constants
648
+ import {
649
+ createAuditEntry,
650
+ calculateRecordDiff,
651
+ exportAuditLogsToCsv,
652
+ SEED_AUDIT_LOGS,
653
+ AUDIT_CATEGORIES,
654
+ AUDIT_SEVERITIES
655
+ } from '@stratametriq/id-card-designer';
656
+
657
+ // Starter Presets & Utilities
658
+ import {
659
+ VERTICAL_PRESETS,
660
+ HORIZONTAL_PRESETS,
661
+ ALL_PRESETS,
662
+ getDefaultPreset,
663
+ getPresetsByOrientation
664
+ } from '@stratametriq/id-card-designer';
665
+ ```
347
666
 
348
667
  ### Templates
349
668
  Designs are represented as JSON-compatible template structures.