@molecule/app-timeline-default 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 +135 -0
- package/package.json +5 -4
package/README.md
ADDED
|
@@ -0,0 +1,135 @@
|
|
|
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:52:58.749Z
|
|
7
|
+
-->
|
|
8
|
+
|
|
9
|
+
# @molecule/app-timeline-default
|
|
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
|
+
Default provider for `@molecule/app-timeline`.
|
|
16
|
+
|
|
17
|
+
Provides an in-memory timeline implementation with sorting
|
|
18
|
+
and item management.
|
|
19
|
+
|
|
20
|
+
## Quick Start
|
|
21
|
+
|
|
22
|
+
```typescript
|
|
23
|
+
import { provider } from '@molecule/app-timeline-default'
|
|
24
|
+
import { setProvider } from '@molecule/app-timeline'
|
|
25
|
+
|
|
26
|
+
setProvider(provider)
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Type
|
|
30
|
+
|
|
31
|
+
`provider`
|
|
32
|
+
|
|
33
|
+
## Installation
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
npm install @molecule/app-timeline-default @molecule/app-timeline
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## API
|
|
40
|
+
|
|
41
|
+
### Interfaces
|
|
42
|
+
|
|
43
|
+
#### `DefaultTimelineConfig`
|
|
44
|
+
|
|
45
|
+
Provider-specific configuration options.
|
|
46
|
+
|
|
47
|
+
```typescript
|
|
48
|
+
interface DefaultTimelineConfig {
|
|
49
|
+
/** Whether to sort items by date. Defaults to `true`. */
|
|
50
|
+
sortByDate?: boolean
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Functions
|
|
55
|
+
|
|
56
|
+
#### `createProvider(config)`
|
|
57
|
+
|
|
58
|
+
Creates a default timeline provider.
|
|
59
|
+
|
|
60
|
+
```typescript
|
|
61
|
+
function createProvider(config?: DefaultTimelineConfig): TimelineProvider
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
- `config` — Optional provider configuration.
|
|
65
|
+
|
|
66
|
+
**Returns:** A configured TimelineProvider.
|
|
67
|
+
|
|
68
|
+
### Constants
|
|
69
|
+
|
|
70
|
+
#### `provider`
|
|
71
|
+
|
|
72
|
+
Default timeline provider instance.
|
|
73
|
+
|
|
74
|
+
```typescript
|
|
75
|
+
const provider: TimelineProvider
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Core Interface
|
|
79
|
+
|
|
80
|
+
Implements `@molecule/app-timeline` interface.
|
|
81
|
+
|
|
82
|
+
## Bond Wiring
|
|
83
|
+
|
|
84
|
+
Setup function to register this provider with the core interface:
|
|
85
|
+
|
|
86
|
+
```typescript
|
|
87
|
+
import { setProvider } from '@molecule/app-timeline'
|
|
88
|
+
import { provider } from '@molecule/app-timeline-default'
|
|
89
|
+
|
|
90
|
+
export function setupTimelineDefault(): void {
|
|
91
|
+
setProvider(provider)
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Injection Notes
|
|
96
|
+
|
|
97
|
+
### Requirements
|
|
98
|
+
|
|
99
|
+
Peer dependencies:
|
|
100
|
+
|
|
101
|
+
- `@molecule/app-timeline` ^1.0.1
|
|
102
|
+
|
|
103
|
+
### Runtime Dependencies
|
|
104
|
+
|
|
105
|
+
- `@molecule/app-timeline`
|
|
106
|
+
|
|
107
|
+
## E2E Tests
|
|
108
|
+
|
|
109
|
+
Integration checklist — drive the real timeline UI (live preview, no mocks),
|
|
110
|
+
adapt each item to this app's actual timeline/activity screens, and check
|
|
111
|
+
every box off one by one. A box you can't check is an integration bug to fix
|
|
112
|
+
— not a skip:
|
|
113
|
+
|
|
114
|
+
- [ ] The timeline renders its entries in the correct chronological order per
|
|
115
|
+
the app's config (newest-first or oldest-first) — the on-screen order
|
|
116
|
+
matches the item `date` timestamps, NOT insertion order (`getItems()`
|
|
117
|
+
preserves insertion order; the app sorts by `date` for display).
|
|
118
|
+
- [ ] Each rendered entry shows its real data: the locale-formatted `date`
|
|
119
|
+
(never a raw `Date` string), the `title`, and — when set — the
|
|
120
|
+
`description`, `icon`, and dot/marker `color`.
|
|
121
|
+
- [ ] With `alternate` on, consecutive entries sit on opposite sides of the
|
|
122
|
+
rail; with it off, every entry sits on the same side.
|
|
123
|
+
- [ ] Clicking an entry fires `onItemClick` with THAT item — the wired action
|
|
124
|
+
(navigate/expand/select) happens for the clicked entry, not a neighbour.
|
|
125
|
+
- [ ] If the app groups entries (by day or type), each entry sits under the
|
|
126
|
+
correct group header, and an entry dated in a different bucket renders under
|
|
127
|
+
the right header.
|
|
128
|
+
- [ ] `addItem()` makes the new event appear in its correct position by `date`
|
|
129
|
+
timestamp (not merely appended last), and `removeItem(id)` removes exactly
|
|
130
|
+
that one entry.
|
|
131
|
+
- [ ] If the app loads older entries (load-more/pagination), they append via
|
|
132
|
+
`setItems` with no duplication — every rendered `id` stays unique.
|
|
133
|
+
- [ ] An empty timeline (no items) renders a defined empty state, not a
|
|
134
|
+
blank/broken layout; adding the first item replaces the empty state with the
|
|
135
|
+
entry.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@molecule/app-timeline-default",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Default provider for @molecule/app-timeline",
|
|
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",
|
|
@@ -31,10 +32,10 @@
|
|
|
31
32
|
"directory": "packages/app/bonds/timeline/default"
|
|
32
33
|
},
|
|
33
34
|
"peerDependencies": {
|
|
34
|
-
"@molecule/app-timeline": "^1.0.
|
|
35
|
+
"@molecule/app-timeline": "^1.0.1"
|
|
35
36
|
},
|
|
36
37
|
"devDependencies": {
|
|
37
|
-
"@molecule/app-timeline": "1.0.
|
|
38
|
+
"@molecule/app-timeline": "1.0.1",
|
|
38
39
|
"@types/node": "26.1.2",
|
|
39
40
|
"typescript": "6.0.3",
|
|
40
41
|
"vitest": "4.1.10"
|