@molecule/app-inbox-row-vue 0.0.1-stage → 1.1.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.
- package/README.md +223 -4
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -1,11 +1,230 @@
|
|
|
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-11-21T12:46:39.164Z
|
|
7
|
+
-->
|
|
8
|
+
|
|
1
9
|
# @molecule/app-inbox-row-vue
|
|
2
10
|
|
|
3
|
-
|
|
11
|
+
Vue inbox / email message list row.
|
|
12
|
+
|
|
13
|
+
Exports `<InboxRow>` and the `InboxRowProps` type — the Vue counterpart of
|
|
14
|
+
`@molecule/app-inbox-row-react`: the same props (React names) and the same
|
|
15
|
+
DOM for the same input.
|
|
16
|
+
|
|
17
|
+
> **Auto-generated, AI-first package reference** for the [molecule.dev](https://molecule.dev) ecosystem.
|
|
18
|
+
> It is written to be read by coding agents as much as by people, and is generated from this
|
|
19
|
+
> package's source — edit `src/index.ts` JSDoc, not this file.
|
|
20
|
+
|
|
21
|
+
## Quick Start
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
import { createApp, defineComponent, h } from 'vue'
|
|
25
|
+
import { InboxRow } from '@molecule/app-inbox-row-vue'
|
|
26
|
+
|
|
27
|
+
const App = defineComponent({
|
|
28
|
+
setup() {
|
|
29
|
+
return () =>
|
|
30
|
+
h(InboxRow, {
|
|
31
|
+
sender: 'Alice Johnson',
|
|
32
|
+
senderAvatarSrc: 'https://example.com/alice.jpg',
|
|
33
|
+
subject: 'Q3 report is ready',
|
|
34
|
+
preview: "Hi, I've attached the final numbers for review...",
|
|
35
|
+
timestamp: '10:42 AM',
|
|
36
|
+
unread: true,
|
|
37
|
+
starred: false,
|
|
38
|
+
hasAttachment: true,
|
|
39
|
+
onClick: () => openMessage(msg.id),
|
|
40
|
+
onToggleStar: () => toggleStar(msg.id),
|
|
41
|
+
})
|
|
42
|
+
},
|
|
43
|
+
})
|
|
44
|
+
|
|
45
|
+
createApp(App).mount('#app')
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Type
|
|
49
|
+
|
|
50
|
+
`feature`
|
|
51
|
+
|
|
52
|
+
## Installation
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
npm install @molecule/app-inbox-row-vue @molecule/app-i18n @molecule/app-ui @molecule/app-ui-vue @molecule/app-vue vue
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## API
|
|
59
|
+
|
|
60
|
+
### Interfaces
|
|
4
61
|
|
|
62
|
+
#### `InboxRowProps`
|
|
63
|
+
|
|
64
|
+
Props accepted by the {@link InboxRow} component.
|
|
65
|
+
|
|
66
|
+
```typescript
|
|
67
|
+
interface InboxRowProps {
|
|
68
|
+
/**
|
|
69
|
+
* Sender display. Passed as a prop or as the same-named slot — both work;
|
|
70
|
+
* a plain string also names the avatar's image.
|
|
71
|
+
*/
|
|
72
|
+
sender: VNodeChild
|
|
73
|
+
/** Avatar URL fallback for sender. */
|
|
74
|
+
senderAvatarSrc?: string
|
|
75
|
+
/** Subject / headline. Passed as a prop or as the same-named slot. */
|
|
76
|
+
subject: VNodeChild
|
|
77
|
+
/** Preview / first line of body (a prop or the `preview` slot). */
|
|
78
|
+
preview?: VNodeChild
|
|
79
|
+
/** Display timestamp (a prop or the `timestamp` slot). */
|
|
80
|
+
timestamp?: VNodeChild
|
|
81
|
+
/** Whether the message is unread (drives bold + dot). */
|
|
82
|
+
unread?: boolean
|
|
83
|
+
/** Whether the message is starred / flagged. */
|
|
84
|
+
starred?: boolean
|
|
85
|
+
/** Optional attachment indicator. */
|
|
86
|
+
hasAttachment?: boolean
|
|
87
|
+
/** Optional labels / tags chip row (a prop or the `labels` slot). */
|
|
88
|
+
labels?: VNodeChild
|
|
89
|
+
/** Right-side selection slot (checkbox) — a prop or the `selectionSlot` slot. */
|
|
90
|
+
selectionSlot?: VNodeChild
|
|
91
|
+
/**
|
|
92
|
+
* Click handler — typically opens the message. While it is set, the whole
|
|
93
|
+
* row is clickable through a transparent native button laid over it, named
|
|
94
|
+
* by the sender and the subject (two ids, `aria-labelledby="<senderId>
|
|
95
|
+
* <subjectId>"`); the inner controls — the star toggle, the selection slot
|
|
96
|
+
* and the labels slot — sit above that button and keep their own clicks.
|
|
97
|
+
*/
|
|
98
|
+
onClick?: () => void
|
|
99
|
+
/** Star toggle. */
|
|
100
|
+
onToggleStar?: () => void
|
|
101
|
+
/** Extra classes. */
|
|
102
|
+
className?: string
|
|
103
|
+
}
|
|
5
104
|
```
|
|
6
|
-
|
|
105
|
+
|
|
106
|
+
### Constants
|
|
107
|
+
|
|
108
|
+
#### `InboxRow`
|
|
109
|
+
|
|
110
|
+
Inbox / email message list row — sender + subject + preview + timestamp +
|
|
111
|
+
unread/star indicators. Generalizes beyond email to any "message list" UI
|
|
112
|
+
(chat lists, notification archives, ticket queues).
|
|
113
|
+
|
|
114
|
+
```typescript
|
|
115
|
+
const InboxRow: DefineComponent<
|
|
116
|
+
ExtractPropTypes<{
|
|
117
|
+
sender: { type: null; default: undefined }
|
|
118
|
+
senderAvatarSrc: { type: StringConstructor; default: undefined }
|
|
119
|
+
subject: { type: null; default: undefined }
|
|
120
|
+
preview: { type: null; default: undefined }
|
|
121
|
+
timestamp: { type: null; default: undefined }
|
|
122
|
+
unread: { type: BooleanConstructor; default: undefined }
|
|
123
|
+
starred: { type: BooleanConstructor; default: undefined }
|
|
124
|
+
hasAttachment: { type: BooleanConstructor; default: undefined }
|
|
125
|
+
labels: { type: null; default: undefined }
|
|
126
|
+
selectionSlot: { type: null; default: undefined }
|
|
127
|
+
onClick: { type: PropType<() => void>; default: undefined }
|
|
128
|
+
onToggleStar: { type: PropType<() => void>; default: undefined }
|
|
129
|
+
className: { type: StringConstructor; default: undefined }
|
|
130
|
+
}>,
|
|
131
|
+
() => VNode,
|
|
132
|
+
{},
|
|
133
|
+
{},
|
|
134
|
+
{},
|
|
135
|
+
ComponentOptionsMixin,
|
|
136
|
+
ComponentOptionsMixin,
|
|
137
|
+
{},
|
|
138
|
+
string,
|
|
139
|
+
PublicProps,
|
|
140
|
+
Readonly<
|
|
141
|
+
ExtractPropTypes<{
|
|
142
|
+
sender: { type: null; default: undefined }
|
|
143
|
+
senderAvatarSrc: { type: StringConstructor; default: undefined }
|
|
144
|
+
subject: { type: null; default: undefined }
|
|
145
|
+
preview: { type: null; default: undefined }
|
|
146
|
+
timestamp: { type: null; default: undefined }
|
|
147
|
+
unread: { type: BooleanConstructor; default: undefined }
|
|
148
|
+
starred: { type: BooleanConstructor; default: undefined }
|
|
149
|
+
hasAttachment: { type: BooleanConstructor; default: undefined }
|
|
150
|
+
labels: { type: null; default: undefined }
|
|
151
|
+
selectionSlot: { type: null; default: undefined }
|
|
152
|
+
onClick: { type: PropType<() => void>; default: undefined }
|
|
153
|
+
onToggleStar: { type: PropType<() => void>; default: undefined }
|
|
154
|
+
className: { type: StringConstructor; default: undefined }
|
|
155
|
+
}>
|
|
156
|
+
> &
|
|
157
|
+
Readonly<{}>,
|
|
158
|
+
{
|
|
159
|
+
sender: any
|
|
160
|
+
senderAvatarSrc: string
|
|
161
|
+
subject: any
|
|
162
|
+
preview: any
|
|
163
|
+
timestamp: any
|
|
164
|
+
unread: boolean
|
|
165
|
+
starred: boolean
|
|
166
|
+
hasAttachment: boolean
|
|
167
|
+
labels: any
|
|
168
|
+
selectionSlot: any
|
|
169
|
+
onClick: () => void
|
|
170
|
+
onToggleStar: () => void
|
|
171
|
+
className: string
|
|
172
|
+
},
|
|
173
|
+
{},
|
|
174
|
+
{},
|
|
175
|
+
{},
|
|
176
|
+
string,
|
|
177
|
+
ComponentProvideOptions,
|
|
178
|
+
true,
|
|
179
|
+
{},
|
|
180
|
+
any
|
|
181
|
+
>
|
|
7
182
|
```
|
|
8
183
|
|
|
9
|
-
|
|
184
|
+
- `props` — Component props (see {@link InboxRowProps}).
|
|
185
|
+
|
|
186
|
+
**Returns:** The inbox row component.
|
|
187
|
+
|
|
188
|
+
## Injection Notes
|
|
189
|
+
|
|
190
|
+
### Requirements
|
|
191
|
+
|
|
192
|
+
Peer dependencies:
|
|
193
|
+
|
|
194
|
+
- `@molecule/app-i18n` ^1.0.1
|
|
195
|
+
- `@molecule/app-ui` ^1.4.0
|
|
196
|
+
- `@molecule/app-ui-vue` ^1.1.0
|
|
197
|
+
- `@molecule/app-vue` ^3.5.0
|
|
198
|
+
- `vue` ^3.5.0
|
|
199
|
+
|
|
200
|
+
### Runtime Dependencies
|
|
201
|
+
|
|
202
|
+
- `@molecule/app-i18n`
|
|
203
|
+
- `@molecule/app-ui`
|
|
204
|
+
- `@molecule/app-ui-vue`
|
|
205
|
+
- `@molecule/app-vue`
|
|
206
|
+
- `vue`
|
|
207
|
+
|
|
208
|
+
- With `onClick` set, the whole row is clickable through a transparent
|
|
209
|
+
native button laid over it, named by the sender and the subject (two ids,
|
|
210
|
+
`aria-labelledby="<senderId> <subjectId>"`); the inner controls (the star
|
|
211
|
+
toggle, the selection slot, the labels slot) sit above it and keep their
|
|
212
|
+
own clicks. A native button turns Enter and Space into a click itself, so
|
|
213
|
+
the row's open action needs no key handler.
|
|
214
|
+
- Star/attachment indicators use fixed colors and emoji. Their aria-labels
|
|
215
|
+
("Star"/"Unstar"/"Has attachment") route through `t()` under `inboxRow.*`,
|
|
216
|
+
translated by the `@molecule/app-locales-inbox-row` companion bond; they
|
|
217
|
+
are read through `useTranslation()`, so a locale switch re-renders them.
|
|
218
|
+
- When `sender` is not a plain string, the avatar's accessible name falls
|
|
219
|
+
back to the translated "Sender" (`inboxRow.sender`) — pass a string
|
|
220
|
+
`sender` (or your own `selectionSlot`) when screen-reader naming matters.
|
|
221
|
+
- `unread` bolds the row via an inline `fontWeight: 600` and renders a fixed
|
|
222
|
+
blue dot — the dot color does not follow the theme.
|
|
223
|
+
- `getClassMap()` requires a bonded ClassMap; `<Avatar>` comes from
|
|
224
|
+
`@molecule/app-ui-vue`.
|
|
225
|
+
- Node-valued props (`sender`, `subject`, `preview`, `timestamp`, `labels`,
|
|
226
|
+
`selectionSlot`) accept a prop or a same-named slot; a given prop wins.
|
|
227
|
+
|
|
228
|
+
## Translations
|
|
10
229
|
|
|
11
|
-
|
|
230
|
+
Translation strings are provided by `@molecule/app-locales-inbox-row`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@molecule/app-inbox-row-vue",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Email / notification inbox row — sender + subject + preview + time + unread dot",
|
|
5
5
|
"homepage": "https://www.molecule.dev/packages/app-inbox-row-vue",
|
|
6
6
|
"type": "module",
|
|
@@ -46,15 +46,15 @@
|
|
|
46
46
|
"@molecule/app-ui": "^1.4.0",
|
|
47
47
|
"@molecule/app-ui-vue": "^1.1.0",
|
|
48
48
|
"@molecule/app-vue": "^3.5.0",
|
|
49
|
-
"vue": "^3.
|
|
49
|
+
"vue": "^3.5.0"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@molecule/app-framework-conformance": "0.0.0",
|
|
53
53
|
"@molecule/app-i18n": "1.2.2",
|
|
54
54
|
"@molecule/app-icons": "1.0.4",
|
|
55
|
-
"@molecule/app-ui": "1.
|
|
56
|
-
"@molecule/app-ui-vue": "1.1
|
|
57
|
-
"@molecule/app-vue": "3.
|
|
55
|
+
"@molecule/app-ui": "1.5.0",
|
|
56
|
+
"@molecule/app-ui-vue": "1.2.1",
|
|
57
|
+
"@molecule/app-vue": "3.9.0",
|
|
58
58
|
"@types/node": "26.6.5",
|
|
59
59
|
"jsdom": "30.1.3",
|
|
60
60
|
"typescript": "6.0.3",
|