@molecule/app-audit-log-row-react 1.0.0 → 1.0.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 +122 -0
- package/package.json +14 -8
package/README.md
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
AUTO-GENERATED — DO NOT EDIT THIS FILE.
|
|
3
|
+
Generated by `mlcl sync-docs` from the package's src/index.ts JSDoc + mlcl/registry.json.
|
|
4
|
+
Edits here are overwritten on the next commit (molecule's pre-commit hook regenerates).
|
|
5
|
+
To change this document, edit the module-level JSDoc in src/index.ts.
|
|
6
|
+
Generated: 2026-08-04T01:50:05.040Z
|
|
7
|
+
-->
|
|
8
|
+
|
|
9
|
+
# @molecule/app-audit-log-row-react
|
|
10
|
+
|
|
11
|
+
> **Auto-generated, AI-first package reference** for the [molecule.dev](https://molecule.dev) ecosystem.
|
|
12
|
+
> It is written to be read by coding agents as much as by people, and is generated from this
|
|
13
|
+
> package's source — edit `src/index.ts` JSDoc, not this file.
|
|
14
|
+
|
|
15
|
+
Audit / activity / event-log row.
|
|
16
|
+
|
|
17
|
+
Exports `<AuditLogRow>` and `AuditLogEntry` type.
|
|
18
|
+
|
|
19
|
+
## Quick Start
|
|
20
|
+
|
|
21
|
+
```tsx
|
|
22
|
+
import { AuditLogRow } from '@molecule/app-audit-log-row-react'
|
|
23
|
+
|
|
24
|
+
;<AuditLogRow
|
|
25
|
+
entry={{
|
|
26
|
+
id: 'evt-001',
|
|
27
|
+
actor: 'alice@example.com',
|
|
28
|
+
action: 'updated',
|
|
29
|
+
target: 'Invoice #1042',
|
|
30
|
+
timestamp: '2 min ago',
|
|
31
|
+
oldValue: 'Draft',
|
|
32
|
+
newValue: 'Sent',
|
|
33
|
+
}}
|
|
34
|
+
onClick={() => openDetail('evt-001')}
|
|
35
|
+
/>
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Type
|
|
39
|
+
|
|
40
|
+
`feature`
|
|
41
|
+
|
|
42
|
+
## Installation
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
npm install @molecule/app-audit-log-row-react @molecule/app-react @molecule/app-ui @molecule/app-ui-react react
|
|
46
|
+
npm install -D @types/react
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## API
|
|
50
|
+
|
|
51
|
+
### Interfaces
|
|
52
|
+
|
|
53
|
+
#### `AuditLogEntry`
|
|
54
|
+
|
|
55
|
+
Shape of a single audit / activity log entry displayed by AuditLogRow.
|
|
56
|
+
|
|
57
|
+
```typescript
|
|
58
|
+
interface AuditLogEntry {
|
|
59
|
+
id: string
|
|
60
|
+
/** Actor name or id. */
|
|
61
|
+
actor: ReactNode
|
|
62
|
+
/** Verb describing what happened ("updated", "deleted", "assigned"). */
|
|
63
|
+
action: ReactNode
|
|
64
|
+
/** Target object / record. */
|
|
65
|
+
target?: ReactNode
|
|
66
|
+
/** Pre-formatted display timestamp (rendered verbatim — format before passing, e.g. "2 min ago"). */
|
|
67
|
+
timestamp: ReactNode
|
|
68
|
+
/** Optional summary field for delta display — old + new values. */
|
|
69
|
+
oldValue?: ReactNode
|
|
70
|
+
newValue?: ReactNode
|
|
71
|
+
/** Environment / source badge. */
|
|
72
|
+
environment?: ReactNode
|
|
73
|
+
/** Optional trace or correlation id. */
|
|
74
|
+
traceId?: ReactNode
|
|
75
|
+
}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
#### `AuditLogRowProps`
|
|
79
|
+
|
|
80
|
+
Props for {@link AuditLogRow}.
|
|
81
|
+
|
|
82
|
+
```typescript
|
|
83
|
+
interface AuditLogRowProps {
|
|
84
|
+
entry: AuditLogEntry
|
|
85
|
+
/** Called when the row is clicked. */
|
|
86
|
+
onClick?: () => void
|
|
87
|
+
/** Extra classes. */
|
|
88
|
+
className?: string
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Functions
|
|
93
|
+
|
|
94
|
+
#### `AuditLogRow(props)`
|
|
95
|
+
|
|
96
|
+
One row of an audit / activity / event log. Shape:
|
|
97
|
+
`[actor] [action] [target] · [timestamp]` with optional
|
|
98
|
+
`[old → new]` diff line and environment/trace metadata.
|
|
99
|
+
|
|
100
|
+
```typescript
|
|
101
|
+
function AuditLogRow({ entry, onClick, className }: AuditLogRowProps): JSX.Element
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
- `props` — Component props (see {@link AuditLogRowProps}).
|
|
105
|
+
|
|
106
|
+
## Injection Notes
|
|
107
|
+
|
|
108
|
+
### Requirements
|
|
109
|
+
|
|
110
|
+
Peer dependencies:
|
|
111
|
+
|
|
112
|
+
- `@molecule/app-react` ^1.0.1
|
|
113
|
+
- `@molecule/app-ui` ^1.0.1
|
|
114
|
+
- `@molecule/app-ui-react` ^1.0.1
|
|
115
|
+
- `react` ^18.0.0 || ^19.0.0
|
|
116
|
+
|
|
117
|
+
### Runtime Dependencies
|
|
118
|
+
|
|
119
|
+
- `@molecule/app-react`
|
|
120
|
+
- `@molecule/app-ui`
|
|
121
|
+
- `@molecule/app-ui-react`
|
|
122
|
+
- `react`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@molecule/app-audit-log-row-react",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Audit / error / event-log row: actor + action + object + timestamp + old/new values",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
19
|
"files": [
|
|
20
|
-
"dist"
|
|
20
|
+
"dist",
|
|
21
|
+
"README.md"
|
|
21
22
|
],
|
|
22
23
|
"keywords": [
|
|
23
24
|
"molecule",
|
|
@@ -25,16 +26,21 @@
|
|
|
25
26
|
"react"
|
|
26
27
|
],
|
|
27
28
|
"license": "Apache-2.0",
|
|
29
|
+
"repository": {
|
|
30
|
+
"type": "git",
|
|
31
|
+
"url": "https://github.com/molecule-dev/molecule.git",
|
|
32
|
+
"directory": "packages/app/features/audit-log-row-react"
|
|
33
|
+
},
|
|
28
34
|
"peerDependencies": {
|
|
29
|
-
"@molecule/app-react": "^1.0.
|
|
30
|
-
"@molecule/app-ui": "^1.0.
|
|
31
|
-
"@molecule/app-ui-react": "^1.0.
|
|
35
|
+
"@molecule/app-react": "^1.0.1",
|
|
36
|
+
"@molecule/app-ui": "^1.0.1",
|
|
37
|
+
"@molecule/app-ui-react": "^1.0.1",
|
|
32
38
|
"react": "^18.0.0 || ^19.0.0"
|
|
33
39
|
},
|
|
34
40
|
"devDependencies": {
|
|
35
|
-
"@molecule/app-react": "1.0.
|
|
36
|
-
"@molecule/app-ui": "1.0.
|
|
37
|
-
"@molecule/app-ui-react": "1.0.
|
|
41
|
+
"@molecule/app-react": "1.0.1",
|
|
42
|
+
"@molecule/app-ui": "1.0.1",
|
|
43
|
+
"@molecule/app-ui-react": "1.0.1",
|
|
38
44
|
"@testing-library/dom": "10.4.1",
|
|
39
45
|
"@testing-library/react": "16.3.2",
|
|
40
46
|
"@types/node": "26.1.2",
|