@molecule/app-timeline-default 1.0.0 → 1.0.2

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 (2) hide show
  1. package/README.md +135 -0
  2. package/package.json +7 -5
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,7 +1,8 @@
1
1
  {
2
2
  "name": "@molecule/app-timeline-default",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Default provider for @molecule/app-timeline",
5
+ "homepage": "https://www.molecule.dev/packages/app-timeline-default",
5
6
  "type": "module",
6
7
  "main": "dist/index.js",
7
8
  "types": "dist/index.d.ts",
@@ -17,7 +18,8 @@
17
18
  }
18
19
  },
19
20
  "files": [
20
- "dist"
21
+ "dist",
22
+ "README.md"
21
23
  ],
22
24
  "keywords": [
23
25
  "molecule",
@@ -31,12 +33,12 @@
31
33
  "directory": "packages/app/bonds/timeline/default"
32
34
  },
33
35
  "peerDependencies": {
34
- "@molecule/app-timeline": "^1.0.0"
36
+ "@molecule/app-timeline": "^1.0.1"
35
37
  },
36
38
  "devDependencies": {
37
- "@molecule/app-timeline": "1.0.0",
39
+ "@molecule/app-timeline": "1.0.2",
38
40
  "@types/node": "26.1.2",
39
41
  "typescript": "6.0.3",
40
- "vitest": "4.1.10"
42
+ "vitest": "4.1.11"
41
43
  }
42
44
  }