@estiva-app/ui 0.72.0-widgets2.2 → 0.73.0-inline-text.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/dist/CommentHighlights.d.ts +100 -0
- package/dist/CommentHighlights.d.ts.map +1 -0
- package/dist/ComposeBox.d.ts +55 -0
- package/dist/ComposeBox.d.ts.map +1 -0
- package/dist/ComposerTriggers.d.ts.map +1 -1
- package/dist/InlineText.d.ts +56 -0
- package/dist/InlineText.d.ts.map +1 -0
- package/dist/SelectionToolbar.d.ts +17 -1
- package/dist/SelectionToolbar.d.ts.map +1 -1
- package/dist/editor.d.ts +4 -1
- package/dist/editor.d.ts.map +1 -1
- package/dist/editor.js +748 -240
- package/dist/editor.js.map +4 -4
- package/dist/index.js.map +1 -1
- package/dist/looks.d.ts +6 -0
- package/dist/looks.d.ts.map +1 -1
- package/package.json +1 -5
- package/registry.json +403 -3
- package/src/CommentHighlights.mdx +61 -0
- package/src/CommentHighlights.stories.tsx +72 -0
- package/src/CommentHighlights.test.ts +100 -0
- package/src/CommentHighlights.ts +413 -0
- package/src/ComposeBox.mdx +58 -0
- package/src/ComposeBox.stories.tsx +81 -0
- package/src/ComposeBox.tsx +183 -0
- package/src/ComposerTriggers.tsx +9 -3
- package/src/InlineText.mdx +64 -0
- package/src/InlineText.stories.tsx +86 -0
- package/src/InlineText.test.tsx +187 -0
- package/src/InlineText.tsx +187 -0
- package/src/SelectionToolbar.actions.test.tsx +44 -0
- package/src/SelectionToolbar.mdx +1 -0
- package/src/SelectionToolbar.tsx +36 -2
- package/src/editor.ts +16 -1
- package/src/looks.ts +8 -0
- package/src/registry/app.test.ts +7 -1
- package/src/registry/registry.test.ts +6 -6
- package/stories/Choosing.mdx +3 -0
- package/dist/widgets-2/fixtures.d.ts +0 -102
- package/dist/widgets-2/fixtures.d.ts.map +0 -1
- package/dist/widgets-2/places.d.ts +0 -105
- package/dist/widgets-2/places.d.ts.map +0 -1
- package/dist/widgets-2/proposed.d.ts +0 -130
- package/dist/widgets-2/proposed.d.ts.map +0 -1
- package/dist/widgets-2.d.ts +0 -12
- package/dist/widgets-2.d.ts.map +0 -1
- package/dist/widgets-2.js +0 -585
- package/dist/widgets-2.js.map +0 -7
- package/src/widgets-2/fixtures.ts +0 -161
- package/src/widgets-2/places.tsx +0 -316
- package/src/widgets-2/proposed.tsx +0 -596
- package/src/widgets-2.ts +0 -11
- package/stories/widgets-2/ReadMe.mdx +0 -60
- package/stories/widgets-2/Widgets.stories.tsx +0 -504
- package/stories/widgets-2/today.tsx +0 -352
|
@@ -1,504 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/react-vite'
|
|
2
|
-
import type { ReactNode } from 'react'
|
|
3
|
-
import { AttachmentCard } from '../../src/AttachmentCard'
|
|
4
|
-
import { ATTACHMENT, ATTACHMENT_FILE, ISSUE, MESSAGE, PAGE, PART, PICTURE, PROJECT, TOPIC, UNREADABLE, type Thing } from '../../src/widgets-2/fixtures'
|
|
5
|
-
import {
|
|
6
|
-
AttachmentChip,
|
|
7
|
-
CardLoading,
|
|
8
|
-
CardUnavailable,
|
|
9
|
-
CommentAnchor,
|
|
10
|
-
CompactCard,
|
|
11
|
-
DetailedCard,
|
|
12
|
-
HoverPreviewOpen,
|
|
13
|
-
loadingShapeOf,
|
|
14
|
-
MessageCard,
|
|
15
|
-
PartCard,
|
|
16
|
-
ReferenceChip,
|
|
17
|
-
} from '../../src/widgets-2/proposed'
|
|
18
|
-
import {
|
|
19
|
-
LeafCard,
|
|
20
|
-
LeafChip,
|
|
21
|
-
LeafSkeleton,
|
|
22
|
-
PartBlocks,
|
|
23
|
-
PeekCard,
|
|
24
|
-
PeekChip,
|
|
25
|
-
PeekChipQuiet,
|
|
26
|
-
PeekNotAvailable,
|
|
27
|
-
PeekPartNotAvailable,
|
|
28
|
-
PeekSkeleton,
|
|
29
|
-
ShipCard,
|
|
30
|
-
ShipChip,
|
|
31
|
-
ShipNotAvailable,
|
|
32
|
-
ShipQuote,
|
|
33
|
-
ShipSkeleton,
|
|
34
|
-
TodayAttachment,
|
|
35
|
-
TodayCommentAnchor,
|
|
36
|
-
TodayPartCard,
|
|
37
|
-
} from './today'
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Widgets 2, the prototype of every widget (WID-2). One story per kind of
|
|
41
|
-
* file: the proposed kit first, then how Peek, Ship and Leaf draw it today.
|
|
42
|
-
* Columns: the chip in a sentence, compact, detailed, loading, not available.
|
|
43
|
-
*/
|
|
44
|
-
const meta = {
|
|
45
|
-
title: 'Widgets 2/Every widget',
|
|
46
|
-
parameters: { layout: 'fullscreen', controls: { disable: true } },
|
|
47
|
-
} satisfies Meta
|
|
48
|
-
|
|
49
|
-
export default meta
|
|
50
|
-
type Story = StoryObj<typeof meta>
|
|
51
|
-
|
|
52
|
-
/* ------------------------------------------------------------ layout */
|
|
53
|
-
|
|
54
|
-
const COLUMNS = ['Chip', 'Compact', 'Detailed', 'Loading', 'Not available'] as const
|
|
55
|
-
|
|
56
|
-
function Sheet({ children }: { children: ReactNode }) {
|
|
57
|
-
return <div className="min-h-screen overflow-x-auto bg-bg-surface p-6 text-text-primary">{children}</div>
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/** One row of the sheet: a label, then a cell per column. */
|
|
61
|
-
function Row({ label, note, cells }: { label: string; note?: string; cells: ReactNode[] }) {
|
|
62
|
-
return (
|
|
63
|
-
<div className="grid grid-cols-[140px_270px_repeat(4,380px)] gap-4 border-t border-border-subtle py-4">
|
|
64
|
-
<div>
|
|
65
|
-
<div className="text-body-2-strong">{label}</div>
|
|
66
|
-
{note && <div className="mt-1 text-caption text-text-secondary">{note}</div>}
|
|
67
|
-
</div>
|
|
68
|
-
{cells.map((cell, i) => (
|
|
69
|
-
<div key={i} className="flex min-w-0 flex-col gap-3">
|
|
70
|
-
{cell}
|
|
71
|
-
</div>
|
|
72
|
-
))}
|
|
73
|
-
</div>
|
|
74
|
-
)
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
function Header({ title, children }: { title: string; children?: ReactNode }) {
|
|
78
|
-
return (
|
|
79
|
-
<div className="mb-2">
|
|
80
|
-
<h2 className="text-h4">{title}</h2>
|
|
81
|
-
{children && <p className="mt-1 max-w-[880px] text-body-2 text-text-secondary">{children}</p>}
|
|
82
|
-
<div className="mt-4 grid grid-cols-[140px_270px_repeat(4,380px)] gap-4 text-caption text-text-muted">
|
|
83
|
-
<span />
|
|
84
|
-
{COLUMNS.map((c) => (
|
|
85
|
-
<span key={c}>{c}</span>
|
|
86
|
-
))}
|
|
87
|
-
</div>
|
|
88
|
-
</div>
|
|
89
|
-
)
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
/** A chip at home: inside a sentence, where it has to sit level with the words. */
|
|
93
|
-
function Sentence({ children }: { children: ReactNode }) {
|
|
94
|
-
return <p className="text-body-2 text-text-primary">See {children} for the rest of it.</p>
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
/** A cell with nothing to draw, and why. */
|
|
98
|
-
function None({ children }: { children: ReactNode }) {
|
|
99
|
-
return <p className="text-caption italic text-text-muted">{children}</p>
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
function Labelled({ label, children }: { label: string; children: ReactNode }) {
|
|
103
|
-
return (
|
|
104
|
-
<div className="flex flex-col gap-1">
|
|
105
|
-
<span className="text-caption text-text-muted">{label}</span>
|
|
106
|
-
{children}
|
|
107
|
-
</div>
|
|
108
|
-
)
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
/* ------------------------------------------------------------- rows */
|
|
112
|
-
|
|
113
|
-
function proposedRow(thing: Thing, opts: { detailed?: ReactNode | false; note?: string } = {}) {
|
|
114
|
-
const detailedOffered = opts.detailed !== false
|
|
115
|
-
return (
|
|
116
|
-
<Row
|
|
117
|
-
label="Proposed"
|
|
118
|
-
note={opts.note ?? 'Hover the chip or the compact card for the detailed card.'}
|
|
119
|
-
cells={[
|
|
120
|
-
<Sentence key="c">
|
|
121
|
-
<ReferenceChip thing={thing} preview />
|
|
122
|
-
</Sentence>,
|
|
123
|
-
<CompactCard key="k" thing={thing} preview />,
|
|
124
|
-
detailedOffered ? (opts.detailed ?? <DetailedCard thing={thing} />) : <None key="d">Not offered: detailed would add nothing compact does not show (Decided 15 Oct).</None>,
|
|
125
|
-
<>
|
|
126
|
-
<Labelled label="Chip">
|
|
127
|
-
<Sentence>
|
|
128
|
-
<ReferenceChip thing={thing} state="loading" />
|
|
129
|
-
</Sentence>
|
|
130
|
-
</Labelled>
|
|
131
|
-
<Labelled label="Compact">
|
|
132
|
-
<CardLoading kind={thing.kind} layout="compact" />
|
|
133
|
-
</Labelled>
|
|
134
|
-
{detailedOffered && (
|
|
135
|
-
<Labelled label="Detailed">
|
|
136
|
-
<CardLoading kind={thing.kind} layout="detailed" shape={loadingShapeOf(thing)} />
|
|
137
|
-
</Labelled>
|
|
138
|
-
)}
|
|
139
|
-
</>,
|
|
140
|
-
<>
|
|
141
|
-
<Labelled label="Chip">
|
|
142
|
-
<Sentence>
|
|
143
|
-
<ReferenceChip thing={thing} state="unavailable" />
|
|
144
|
-
</Sentence>
|
|
145
|
-
</Labelled>
|
|
146
|
-
<Labelled label="Compact and detailed">
|
|
147
|
-
<CardUnavailable kind={thing.kind} noun={thing.noun} app={thing.app} />
|
|
148
|
-
</Labelled>
|
|
149
|
-
</>,
|
|
150
|
-
]}
|
|
151
|
-
/>
|
|
152
|
-
)
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
/** The detailed card for a reader who may not change the file: the pickers become words (Miky, 15 Oct). */
|
|
156
|
-
function readOnlyRow(thing: Thing) {
|
|
157
|
-
return (
|
|
158
|
-
<Row
|
|
159
|
-
label="Proposed, read only"
|
|
160
|
-
note="For a reader who may not change it, and in the hover preview."
|
|
161
|
-
cells={[<span key="c" />, <None key="k">Compact has no actions to lose.</None>, <DetailedCard key="d" thing={thing} readOnly />, <span key="l" />, <span key="n" />]}
|
|
162
|
-
/>
|
|
163
|
-
)
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
function todayRows(thing: Thing, opts: { shipDetailed?: ReactNode; peekDetailed?: ReactNode } = {}) {
|
|
167
|
-
return (
|
|
168
|
-
<>
|
|
169
|
-
<Row
|
|
170
|
-
label="Today in Peek"
|
|
171
|
-
cells={[
|
|
172
|
-
<Sentence key="c">
|
|
173
|
-
<PeekChip thing={thing} />
|
|
174
|
-
</Sentence>,
|
|
175
|
-
<PeekCard key="k" thing={thing} layout="row" />,
|
|
176
|
-
opts.peekDetailed ?? <PeekCard thing={thing} layout="card" />,
|
|
177
|
-
<>
|
|
178
|
-
<Labelled label="Chip">
|
|
179
|
-
<Sentence>
|
|
180
|
-
<PeekChipQuiet address={UNREADABLE.address} />
|
|
181
|
-
</Sentence>
|
|
182
|
-
</Labelled>
|
|
183
|
-
<Labelled label="Compact">
|
|
184
|
-
<PeekSkeleton thing={thing} layout="row" />
|
|
185
|
-
</Labelled>
|
|
186
|
-
<Labelled label="Detailed">
|
|
187
|
-
<PeekSkeleton thing={thing} layout="card" />
|
|
188
|
-
</Labelled>
|
|
189
|
-
</>,
|
|
190
|
-
<>
|
|
191
|
-
<Labelled label="Chip">
|
|
192
|
-
<Sentence>
|
|
193
|
-
<PeekChipQuiet address={UNREADABLE.address} />
|
|
194
|
-
</Sentence>
|
|
195
|
-
</Labelled>
|
|
196
|
-
<Labelled label="Compact and detailed">
|
|
197
|
-
<PeekNotAvailable noun={thing.noun} app={thing.app} />
|
|
198
|
-
</Labelled>
|
|
199
|
-
</>,
|
|
200
|
-
]}
|
|
201
|
-
/>
|
|
202
|
-
<Row
|
|
203
|
-
label="Today in Ship"
|
|
204
|
-
cells={[
|
|
205
|
-
<Sentence key="c">
|
|
206
|
-
<ShipChip thing={thing} />
|
|
207
|
-
</Sentence>,
|
|
208
|
-
thing.kind === 'message' ? <ShipQuote key="k" thing={thing} /> : <ShipCard key="k" thing={thing} layout="row" />,
|
|
209
|
-
opts.shipDetailed ?? (thing.kind === 'message' ? <ShipQuote thing={thing} /> : <ShipCard thing={thing} layout="card" />),
|
|
210
|
-
<Labelled key="l" label="Compact and detailed">
|
|
211
|
-
<ShipSkeleton />
|
|
212
|
-
</Labelled>,
|
|
213
|
-
<Labelled key="n" label="Compact and detailed">
|
|
214
|
-
<ShipNotAvailable noun={thing.noun} />
|
|
215
|
-
</Labelled>,
|
|
216
|
-
]}
|
|
217
|
-
/>
|
|
218
|
-
<Row
|
|
219
|
-
label="Today in Leaf"
|
|
220
|
-
cells={[
|
|
221
|
-
<Sentence key="c">
|
|
222
|
-
<LeafChip thing={thing} />
|
|
223
|
-
</Sentence>,
|
|
224
|
-
<LeafCard key="k" thing={thing} layout="compact" />,
|
|
225
|
-
<LeafCard key="d" thing={thing} layout="detailed" />,
|
|
226
|
-
<Labelled key="l" label="Compact and detailed">
|
|
227
|
-
<LeafSkeleton />
|
|
228
|
-
</Labelled>,
|
|
229
|
-
<None key="n">Draws nothing.</None>,
|
|
230
|
-
]}
|
|
231
|
-
/>
|
|
232
|
-
</>
|
|
233
|
-
)
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
/* ----------------------------------------------------------- stories */
|
|
237
|
-
|
|
238
|
-
/** Every kind of file in the proposed kit, one row each. Start here. */
|
|
239
|
-
export const Overview: Story = {
|
|
240
|
-
render: () => (
|
|
241
|
-
<Sheet>
|
|
242
|
-
<Header title="Every widget, proposed">
|
|
243
|
-
One drawing per kind for Peek, Ship and Leaf alike. No noun and no "Open in …": the icon says what it is, the title is the link. Compact is one line; detailed adds the short summary and what the kind owns, with its actions; hovering a chip or a compact card shows the detailed card. Loading is the card it becomes; not available is one line everywhere.
|
|
244
|
-
</Header>
|
|
245
|
-
{[
|
|
246
|
-
{ thing: ISSUE, label: 'Issue' },
|
|
247
|
-
{ thing: PROJECT, label: 'Project' },
|
|
248
|
-
{ thing: TOPIC, label: 'Topic' },
|
|
249
|
-
{ thing: MESSAGE, label: 'Message', detailed: <MessageCard thing={MESSAGE} /> },
|
|
250
|
-
{ thing: PAGE, label: 'Page' },
|
|
251
|
-
].map(({ thing, label, detailed }) => (
|
|
252
|
-
<div key={label}>
|
|
253
|
-
<h3 className="mt-4 text-h5">{label}</h3>
|
|
254
|
-
{proposedRow(thing, { detailed })}
|
|
255
|
-
</div>
|
|
256
|
-
))}
|
|
257
|
-
</Sheet>
|
|
258
|
-
),
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
/** The detailed card on hover, drawn open; the canvases above open it on a real hover. */
|
|
262
|
-
export const Hover: Story = {
|
|
263
|
-
name: 'On hover',
|
|
264
|
-
render: () => (
|
|
265
|
-
<Sheet>
|
|
266
|
-
<h2 className="text-h4">On hover</h2>
|
|
267
|
-
<p className="mt-1 max-w-[880px] text-body-2 text-text-secondary">
|
|
268
|
-
Hovering a chip or a compact card shows its detailed card in the package's preview box (Miky, 15 Oct). Drawn open here; hover them in the other stories to see it for real.
|
|
269
|
-
</p>
|
|
270
|
-
<div className="mt-6 grid grid-cols-[repeat(4,380px)] gap-6">
|
|
271
|
-
{[ISSUE, PROJECT, TOPIC, PAGE].map((thing) => (
|
|
272
|
-
<div key={thing.title} className="flex flex-col gap-2">
|
|
273
|
-
<span className="text-caption text-text-muted">{thing.noun}</span>
|
|
274
|
-
<CompactCard thing={thing} />
|
|
275
|
-
<HoverPreviewOpen thing={thing} />
|
|
276
|
-
</div>
|
|
277
|
-
))}
|
|
278
|
-
</div>
|
|
279
|
-
</Sheet>
|
|
280
|
-
),
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
export const Issue: Story = {
|
|
284
|
-
render: () => (
|
|
285
|
-
<Sheet>
|
|
286
|
-
<Header title="Issue">
|
|
287
|
-
Proposed: the key before the title in the chip and compact; in detailed it moves under the title with the project, "ABC-2 · Group one". Compact is one line with no actions, and shows the comment count only when you have something unread there. Detailed shows the summary, its status and assignee only as the pickers that change them, and the comment count with the unread dot.
|
|
288
|
-
</Header>
|
|
289
|
-
{proposedRow(ISSUE)}
|
|
290
|
-
{readOnlyRow(ISSUE)}
|
|
291
|
-
{todayRows(ISSUE)}
|
|
292
|
-
</Sheet>
|
|
293
|
-
),
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
export const Project: Story = {
|
|
297
|
-
render: () => (
|
|
298
|
-
<Sheet>
|
|
299
|
-
<Header title="Project">
|
|
300
|
-
Proposed: progress as a small ring with "3/8" beside it, status and lead as pickers, the comment count, and each issue led by its status icon, with its key and assignee. Each issue's row opens that issue.
|
|
301
|
-
</Header>
|
|
302
|
-
{proposedRow(PROJECT)}
|
|
303
|
-
{readOnlyRow(PROJECT)}
|
|
304
|
-
{todayRows(PROJECT)}
|
|
305
|
-
</Sheet>
|
|
306
|
-
),
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
export const Topic: Story = {
|
|
310
|
-
render: () => (
|
|
311
|
-
<Sheet>
|
|
312
|
-
<Header title="Topic">
|
|
313
|
-
Proposed: compact shows when the last conversation moved, how many there are with the same icon as every file's comments, and who is in it, with the unread dot when you have something unread there. Detailed adds the latest conversation, labelled "Latest conversation", because it follows the topic and changes after the link was sent.
|
|
314
|
-
</Header>
|
|
315
|
-
{proposedRow(TOPIC)}
|
|
316
|
-
{todayRows(TOPIC)}
|
|
317
|
-
</Sheet>
|
|
318
|
-
),
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
export const Message: Story = {
|
|
322
|
-
render: () => (
|
|
323
|
-
<Sheet>
|
|
324
|
-
<Header title="Message">
|
|
325
|
-
"Person Two" is the person who wrote the message, so it is drawn with their face. A linked message is a card, not a quote (Miky, 15 Oct), so it needs nothing new on the wire.
|
|
326
|
-
</Header>
|
|
327
|
-
{proposedRow(MESSAGE, { detailed: <MessageCard thing={MESSAGE} /> })}
|
|
328
|
-
{todayRows(MESSAGE)}
|
|
329
|
-
</Sheet>
|
|
330
|
-
),
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
export const Page: Story = {
|
|
334
|
-
render: () => (
|
|
335
|
-
<Sheet>
|
|
336
|
-
<Header title="Page">
|
|
337
|
-
Proposed: a page gets its own icon (today every app draws it as another app's file). Compact shows when it was last edited and who wrote it; detailed adds its Folder, its summary, its authors' faces (no names, which would not fit once several people wrote it), and its comment count.
|
|
338
|
-
</Header>
|
|
339
|
-
{proposedRow(PAGE)}
|
|
340
|
-
{todayRows(PAGE)}
|
|
341
|
-
</Sheet>
|
|
342
|
-
),
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
/** A block of a description, shared live: no compact or detailed, the part itself. */
|
|
346
|
-
export const PartOfADescription: Story = {
|
|
347
|
-
name: 'Part of a description',
|
|
348
|
-
render: () => (
|
|
349
|
-
<Sheet>
|
|
350
|
-
<Header title="Part of a description">
|
|
351
|
-
A link to one block inserts the part itself, live, with no card offered (decision record: the author chooses a link's card). So the columns here are the chip, the part, loading, not available, and a comment's anchor. Proposed: the part wears a detailed card's header, so parts and cards read as one family.
|
|
352
|
-
</Header>
|
|
353
|
-
<Row
|
|
354
|
-
label="Proposed"
|
|
355
|
-
cells={[
|
|
356
|
-
<Sentence key="c">
|
|
357
|
-
<ReferenceChip thing={{ ...ISSUE, title: `${PART.heading} · ${PART.blocks[0]}`, status: undefined }} />
|
|
358
|
-
</Sentence>,
|
|
359
|
-
<None key="k">The part, next column.</None>,
|
|
360
|
-
<PartCard key="p" kind="issue" partKey={ISSUE.key} heading={PART.heading} noun={PART.noun} app={PART.app}>
|
|
361
|
-
<PartBlocks />
|
|
362
|
-
</PartCard>,
|
|
363
|
-
<PartCard key="l" kind="issue" heading="" noun={PART.noun} app={PART.app} state="loading" />,
|
|
364
|
-
<>
|
|
365
|
-
<PartCard kind="issue" heading="" noun={PART.noun} app={PART.app} state="unavailable" />
|
|
366
|
-
<Labelled label="Comment anchor">
|
|
367
|
-
<CommentAnchor text={PART.blocks[1]} />
|
|
368
|
-
</Labelled>
|
|
369
|
-
<Labelled label="Comment anchor, part deleted">
|
|
370
|
-
<CommentAnchor />
|
|
371
|
-
</Labelled>
|
|
372
|
-
</>,
|
|
373
|
-
]}
|
|
374
|
-
/>
|
|
375
|
-
<Row
|
|
376
|
-
label="Today in Peek"
|
|
377
|
-
cells={[
|
|
378
|
-
<Sentence key="c">
|
|
379
|
-
<PeekChip thing={{ ...ISSUE, title: `${PART.heading} · ${PART.blocks[0]}`, status: undefined }} />
|
|
380
|
-
</Sentence>,
|
|
381
|
-
<None key="k">The part, next column.</None>,
|
|
382
|
-
<TodayPartCard key="p" app="Peek" />,
|
|
383
|
-
<PeekSkeleton key="l" thing={ISSUE} layout="card" />,
|
|
384
|
-
<>
|
|
385
|
-
<PeekPartNotAvailable />
|
|
386
|
-
<Labelled label="Comment anchor">
|
|
387
|
-
<TodayCommentAnchor text={PART.blocks[1]} />
|
|
388
|
-
</Labelled>
|
|
389
|
-
<Labelled label="Comment anchor, part deleted">
|
|
390
|
-
<TodayCommentAnchor />
|
|
391
|
-
</Labelled>
|
|
392
|
-
</>,
|
|
393
|
-
]}
|
|
394
|
-
/>
|
|
395
|
-
<Row
|
|
396
|
-
label="Today in Ship"
|
|
397
|
-
cells={[
|
|
398
|
-
<Sentence key="c">
|
|
399
|
-
<ShipChip thing={{ ...ISSUE, title: `${PART.heading} · ${PART.blocks[0]}`, status: undefined }} />
|
|
400
|
-
</Sentence>,
|
|
401
|
-
<None key="k">The part, next column.</None>,
|
|
402
|
-
<TodayPartCard key="p" app="Ship" />,
|
|
403
|
-
<ShipSkeleton key="l" />,
|
|
404
|
-
<None key="n">Same as Peek.</None>,
|
|
405
|
-
]}
|
|
406
|
-
/>
|
|
407
|
-
<Row label="Today in Leaf" cells={[<None key="c">No parts yet.</None>, <span key="k" />, <span key="p" />, <span key="l" />, <span key="n" />]} />
|
|
408
|
-
</Sheet>
|
|
409
|
-
),
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
export const Attachment: Story = {
|
|
413
|
-
render: () => (
|
|
414
|
-
<Sheet>
|
|
415
|
-
<Header title="Attachment">
|
|
416
|
-
The attachment card is already shared. Proposed: a chip for an attachment in running text, the file card as compact, and the picture as detailed, offered for pictures only.
|
|
417
|
-
</Header>
|
|
418
|
-
<Row
|
|
419
|
-
label="Proposed"
|
|
420
|
-
cells={[
|
|
421
|
-
<Sentence key="c">
|
|
422
|
-
<AttachmentChip name={ATTACHMENT.name} />
|
|
423
|
-
</Sentence>,
|
|
424
|
-
<AttachmentCard key="k" name={ATTACHMENT_FILE.name} size={ATTACHMENT_FILE.size} contentType={ATTACHMENT_FILE.contentType} download />,
|
|
425
|
-
<>
|
|
426
|
-
<AttachmentCard name={ATTACHMENT.name} size={ATTACHMENT.size} contentType={ATTACHMENT.contentType} src={PICTURE} download />
|
|
427
|
-
<None>A file that is not a picture: compact only.</None>
|
|
428
|
-
</>,
|
|
429
|
-
<>
|
|
430
|
-
<Sentence>
|
|
431
|
-
<AttachmentChip name="" state="loading" />
|
|
432
|
-
</Sentence>
|
|
433
|
-
<AttachmentCard name={ATTACHMENT.name} contentType={ATTACHMENT.contentType} state="loading" />
|
|
434
|
-
</>,
|
|
435
|
-
<>
|
|
436
|
-
<Sentence>
|
|
437
|
-
<AttachmentChip name="" state="unavailable" />
|
|
438
|
-
</Sentence>
|
|
439
|
-
<AttachmentCard name={ATTACHMENT.name} contentType={ATTACHMENT.contentType} state="unreadable" />
|
|
440
|
-
</>,
|
|
441
|
-
]}
|
|
442
|
-
/>
|
|
443
|
-
<Row
|
|
444
|
-
label="Today in Ship and Peek"
|
|
445
|
-
cells={[
|
|
446
|
-
<None key="c">No chip: an attachment is never in running text.</None>,
|
|
447
|
-
<TodayAttachment key="k" {...ATTACHMENT_FILE} />,
|
|
448
|
-
<TodayAttachment key="d" {...ATTACHMENT} />,
|
|
449
|
-
<AttachmentCard key="l" name={ATTACHMENT.name} contentType={ATTACHMENT.contentType} state="loading" />,
|
|
450
|
-
<AttachmentCard key="n" name={ATTACHMENT.name} contentType={ATTACHMENT.contentType} state="unreadable" />,
|
|
451
|
-
]}
|
|
452
|
-
/>
|
|
453
|
-
</Sheet>
|
|
454
|
-
),
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
/** A file you cannot read: only its kind and its app are known, from the address. */
|
|
458
|
-
export const NotReadable: Story = {
|
|
459
|
-
name: "A file you can't read",
|
|
460
|
-
render: () => (
|
|
461
|
-
<Sheet>
|
|
462
|
-
<Header title="A file you can't read">
|
|
463
|
-
Only the kind and the app are known, from the address. Deleted and unreadable read the same, "not available." (Miky, 15 Oct). Proposed: the chip says so in words instead of showing the address.
|
|
464
|
-
</Header>
|
|
465
|
-
<Row
|
|
466
|
-
label="Proposed"
|
|
467
|
-
cells={[
|
|
468
|
-
<Sentence key="c">
|
|
469
|
-
<ReferenceChip thing={{ ...ISSUE, noun: UNREADABLE.noun }} state="unavailable" />
|
|
470
|
-
</Sentence>,
|
|
471
|
-
<CardUnavailable key="k" kind={UNREADABLE.kind} noun={UNREADABLE.noun} app={UNREADABLE.app} />,
|
|
472
|
-
<None key="d">Same as compact: there is nothing more to show.</None>,
|
|
473
|
-
<None key="l">Loading first, as for its kind.</None>,
|
|
474
|
-
<CardUnavailable key="n" kind="file" noun="Another app's file" app="its app" />,
|
|
475
|
-
]}
|
|
476
|
-
/>
|
|
477
|
-
<Row
|
|
478
|
-
label="Today in Peek"
|
|
479
|
-
cells={[
|
|
480
|
-
<Sentence key="c">
|
|
481
|
-
<PeekChipQuiet address={UNREADABLE.address} />
|
|
482
|
-
</Sentence>,
|
|
483
|
-
<PeekNotAvailable key="k" noun={UNREADABLE.noun} app={UNREADABLE.app} />,
|
|
484
|
-
<PeekNotAvailable key="d" noun={UNREADABLE.noun} app={UNREADABLE.app} />,
|
|
485
|
-
<span key="l" />,
|
|
486
|
-
<None key="n">Without a chosen card: draws nothing.</None>,
|
|
487
|
-
]}
|
|
488
|
-
/>
|
|
489
|
-
<Row
|
|
490
|
-
label="Today in Ship"
|
|
491
|
-
cells={[
|
|
492
|
-
<Sentence key="c">
|
|
493
|
-
<PeekChipQuiet address={UNREADABLE.address} />
|
|
494
|
-
</Sentence>,
|
|
495
|
-
<ShipNotAvailable key="k" noun={UNREADABLE.noun} />,
|
|
496
|
-
<ShipNotAvailable key="d" noun={UNREADABLE.noun} />,
|
|
497
|
-
<span key="l" />,
|
|
498
|
-
<span key="n" />,
|
|
499
|
-
]}
|
|
500
|
-
/>
|
|
501
|
-
<Row label="Today in Leaf" cells={[<Sentence key="c"><PeekChipQuiet address={UNREADABLE.address} /></Sentence>, <None key="k">Draws nothing.</None>, <None key="d">Draws nothing.</None>, <span key="l" />, <span key="n" />]} />
|
|
502
|
-
</Sheet>
|
|
503
|
-
),
|
|
504
|
-
}
|