@molecule/app-audit-log-row-svelte

Feature · audit-log-row · App (browser) · v1.1.3 · Apache-2.0

Audit / error / event-log row: actor + action + object + timestamp + old/new values

npm install @molecule/app-audit-log-row-svelte

npm · Source on GitHub

How it works

@molecule/app-audit-log-row-svelte is a ready-made audit-log-row feature for the app (browser) side. It composes the core interfaces it needs, so it works with whichever providers your app has bonded.

<script lang="ts">
  import { AuditLogRow } from '@molecule/app-audit-log-row-svelte'

  const entry = {
    id: 'evt-001',
    actor: 'alice@example.com',
    action: 'updated',
    target: 'Invoice #1042',
    timestamp: '2 min ago',
    oldValue: 'Draft',
    newValue: 'Sent',
  }
</script>

<AuditLogRow {entry} onClick={() => openDetail('evt-001')} />

Works with: @molecule/app-svelte, @molecule/app-ui, @molecule/app-ui-svelte

Reference

Svelte audit / activity / event-log row.

Exports <AuditLogRow> and the AuditLogEntry type — the Svelte counterpart of @molecule/app-audit-log-row-react: the same props (React names) and the same DOM for the same input.

Auto-generated, AI-first package reference for the molecule.dev ecosystem. It is written to be read by coding agents as much as by people, and is generated from this package's source — edit src/index.ts JSDoc, not this file.

Quick Start

<script lang="ts">
  import { AuditLogRow } from '@molecule/app-audit-log-row-svelte'

  const entry = {
    id: 'evt-001',
    actor: 'alice@example.com',
    action: 'updated',
    target: 'Invoice #1042',
    timestamp: '2 min ago',
    oldValue: 'Draft',
    newValue: 'Sent',
  }
</script>

<AuditLogRow {entry} onClick={() => openDetail('evt-001')} />

Type

feature

Installation

npm install @molecule/app-audit-log-row-svelte @molecule/app-svelte @molecule/app-ui @molecule/app-ui-svelte svelte

API

Interfaces

AuditLogEntry

Shape of a single audit / activity log entry displayed by AuditLogRow.

interface AuditLogEntry {
  id: string
  /** Actor name or id (React's `ReactNode`: text, or a snippet rendering a node). */
  actor: Snippet | string | number
  /** Verb describing what happened ("updated", "deleted", "assigned"). */
  action: Snippet | string | number
  /** Target object / record. */
  target?: Snippet | string | number
  /** Pre-formatted display timestamp (rendered verbatim — format before passing, e.g. "2 min ago"). */
  timestamp: Snippet | string | number
  /** Optional summary field for delta display — old + new values. */
  oldValue?: Snippet | string | number
  newValue?: Snippet | string | number
  /** Environment / source badge. */
  environment?: Snippet | string | number
  /** Optional trace or correlation id. */
  traceId?: Snippet | string | number
}

AuditLogRowProps

Props accepted by the AuditLogRow component.

interface AuditLogRowProps {
  /** The entry to display. */
  entry: AuditLogEntry
  /** Called when the row is clicked. */
  onClick?: () => void
  /** Extra classes. */
  className?: string
}

Constants

AuditLogRow

const AuditLogRow: LegacyComponentType

Injection Notes

Requirements

Peer dependencies:

  • @molecule/app-svelte ^3.5.0 || ^4.0.0
  • @molecule/app-ui ^1.0.1
  • @molecule/app-ui-svelte ^1.6.0
  • svelte ^5.0.0

Runtime Dependencies

  • @molecule/app-svelte

  • @molecule/app-ui

  • @molecule/app-ui-svelte

  • svelte

  • Requires a bonded ClassMap — rendering throws otherwise.

  • entry fields are display nodes: pass pre-formatted, translated values. A snippet works anywhere a string does.

  • With onClick the row carries role="button" + tabindex="0" and Enter / Space activate it, like a native button; without it the row is static.