@estiva-app/ui 0.101.0 → 0.102.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/dist/AskedBlocks.d.ts +30 -0
- package/dist/AskedBlocks.d.ts.map +1 -0
- package/dist/DeletedNotice.d.ts +17 -0
- package/dist/DeletedNotice.d.ts.map +1 -0
- package/dist/DocumentEditor.d.ts +39 -6
- package/dist/DocumentEditor.d.ts.map +1 -1
- package/dist/LinkRow.d.ts +7 -10
- package/dist/LinkRow.d.ts.map +1 -1
- package/dist/NoAccessNotice.d.ts +13 -0
- package/dist/NoAccessNotice.d.ts.map +1 -0
- package/dist/PartCard.d.ts +3 -3
- package/dist/PartCard.d.ts.map +1 -1
- package/dist/editor.d.ts +1 -1
- package/dist/editor.d.ts.map +1 -1
- package/dist/editor.js +311 -8
- package/dist/editor.js.map +4 -4
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +113 -81
- package/dist/index.js.map +4 -4
- package/dist/linked.d.ts +2 -2
- package/dist/linked.d.ts.map +1 -1
- package/dist/linkedFrom.d.ts.map +1 -1
- package/package.json +1 -1
- package/registry.json +77 -7
- package/src/AskedBlocks.ts +158 -0
- package/src/DeletedNotice.mdx +43 -0
- package/src/DeletedNotice.stories.tsx +29 -0
- package/src/DeletedNotice.test.tsx +46 -0
- package/src/DeletedNotice.tsx +47 -0
- package/src/DocumentEditor.mdx +5 -1
- package/src/DocumentEditor.stories.tsx +84 -0
- package/src/DocumentEditor.test.tsx +188 -0
- package/src/DocumentEditor.tsx +294 -14
- package/src/LinkCard.test.tsx +4 -6
- package/src/LinkCard.tsx +1 -1
- package/src/LinkRow.mdx +1 -1
- package/src/LinkRow.stories.tsx +3 -3
- package/src/LinkRow.test.tsx +2 -2
- package/src/LinkRow.tsx +11 -20
- package/src/NoAccessNotice.mdx +40 -0
- package/src/NoAccessNotice.stories.tsx +17 -0
- package/src/NoAccessNotice.tsx +18 -0
- package/src/PartCard.test.tsx +2 -2
- package/src/PartCard.tsx +5 -4
- package/src/editor.ts +1 -0
- package/src/index.ts +2 -0
- package/src/linked.ts +2 -2
- package/src/linkedFrom.test.tsx +4 -7
- package/src/linkedFrom.ts +0 -2
- package/src/registry/registry.test.ts +4 -4
- package/stories/Choosing.mdx +2 -0
package/src/LinkRow.mdx
CHANGED
|
@@ -17,7 +17,7 @@ A link alone on its line: its kind in a file's tile, the title and its key under
|
|
|
17
17
|
- **width** — at most 480px, in a box being written in too.
|
|
18
18
|
- **unread** — the count is brighter, with its dot.
|
|
19
19
|
- **loading** — the row in bars, in the row's own shape.
|
|
20
|
-
- **unavailable** —
|
|
20
|
+
- **unavailable** — not the reader's to see: a row's shape, "You can't open this issue", and no way out, since there is nothing for them to open (`openIn` is no longer drawn). This is also what a card draws when it is not available: **LinkUnavailable**, from this file. The page the link opens draws **NoAccessNotice**, in the same words.
|
|
21
21
|
- **deleted** — `deleted` on the state, when a trusted deletion names it (SPEC §13.6.1): the same row, "Issue deleted", and no way out.
|
|
22
22
|
- **written as a URL** — `url` on the state: the URL as it was written, a plain link in the row's place, deleted or not available alike (SPEC §13.1).
|
|
23
23
|
|
package/src/LinkRow.stories.tsx
CHANGED
|
@@ -50,12 +50,12 @@ export const Deleted: Story = { args: { link: DELETED } }
|
|
|
50
50
|
/** Written as a URL that cannot be shown: it stays that URL, a plain link, in the row's place. */
|
|
51
51
|
export const WrittenAsAUrl: Story = { args: { link: WRITTEN_AS_A_URL } }
|
|
52
52
|
|
|
53
|
-
/** The not-available line on its own, as a card or a part draws it too
|
|
53
|
+
/** The not-available line on its own, as a card or a part draws it too, and the deleted one: no way out from either. */
|
|
54
54
|
export const NotAvailableLine: Story = {
|
|
55
55
|
render: () => (
|
|
56
56
|
<div className="flex flex-col gap-2">
|
|
57
|
-
<LinkUnavailable kind="issue" noun="
|
|
58
|
-
<LinkUnavailable kind="page" noun="
|
|
57
|
+
<LinkUnavailable kind="issue" noun="Item" />
|
|
58
|
+
<LinkUnavailable kind="page" noun="Item" deleted />
|
|
59
59
|
</div>
|
|
60
60
|
),
|
|
61
61
|
}
|
package/src/LinkRow.test.tsx
CHANGED
|
@@ -31,9 +31,9 @@ describe('LinkRow', () => {
|
|
|
31
31
|
expect(screen.queryByRole('link')).toBeNull()
|
|
32
32
|
})
|
|
33
33
|
|
|
34
|
-
it('says
|
|
34
|
+
it('says you cannot open it, in one line', () => {
|
|
35
35
|
render(<LinkRow link={UNAVAILABLE} />)
|
|
36
|
-
expect(screen.getByText('
|
|
36
|
+
expect(screen.getByText("You can't open this issue")).toBeTruthy()
|
|
37
37
|
})
|
|
38
38
|
|
|
39
39
|
it('says its count whole, one comment or several, never the figure run into the noun', () => {
|
package/src/LinkRow.tsx
CHANGED
|
@@ -9,10 +9,8 @@
|
|
|
9
9
|
* At most 480px wide, as a card is, in a box being written in too.
|
|
10
10
|
*/
|
|
11
11
|
import { useContext } from 'react'
|
|
12
|
-
import { IconExternalLink } from '@tabler/icons-react'
|
|
13
12
|
import { Avatar } from './Avatar'
|
|
14
13
|
import { AvatarGroup } from './AvatarGroup'
|
|
15
|
-
import { Button } from './Button'
|
|
16
14
|
import { Card } from './Card'
|
|
17
15
|
import { cn } from './cn'
|
|
18
16
|
import { Link } from './Link'
|
|
@@ -21,13 +19,12 @@ import { CommentCount, kindNounOf, LinkedIcon, LinkTile, ProgressRing, StatusMar
|
|
|
21
19
|
import { LinkPreview } from './LinkPreview'
|
|
22
20
|
import { TIME_CLASSES, TYPE_TILE_CLASSES } from './looks'
|
|
23
21
|
import { SkeletonBar } from './Skeleton'
|
|
24
|
-
import { WithTooltip } from './Tooltip'
|
|
25
22
|
|
|
26
23
|
export interface LinkUnavailableProps {
|
|
27
24
|
kind: LinkedKind
|
|
28
|
-
/** What it is, in a word: "Issue". Drawn as "
|
|
25
|
+
/** What it is, in a word: "Issue". Drawn as "You can't open this issue", or "Issue deleted". */
|
|
29
26
|
noun: string
|
|
30
|
-
/**
|
|
27
|
+
/** @deprecated Not drawn since 0.102.0: someone who can't open it has nowhere to go. */
|
|
31
28
|
openIn?: { app: string; href: string }
|
|
32
29
|
/** In a card's place: a card's 12px round it. Default a row's. */
|
|
33
30
|
card?: boolean
|
|
@@ -42,15 +39,18 @@ const ROW_CLASSES = 'flex items-center gap-3 p-1.5 pr-3'
|
|
|
42
39
|
* Not available: not this reader's to see, or deleted, which says so (SPEC
|
|
43
40
|
* §13.6.1: deleted is not not-permitted). Drawn as the row or the card it
|
|
44
41
|
* would have been, on the same fill and edge (Katerina, 29 Oct: "same styling
|
|
45
|
-
* as the linkcard default"), its words muted.
|
|
46
|
-
*
|
|
42
|
+
* as the linkcard default"), its words muted. Not this reader's: "You can't
|
|
43
|
+
* open this issue", the approved story's words, with no way out, since there
|
|
44
|
+
* is nothing for them to open (Miky, ALO-4's review, 3 November).
|
|
47
45
|
*/
|
|
48
|
-
export function LinkUnavailable({ kind, noun,
|
|
49
|
-
|
|
46
|
+
export function LinkUnavailable({ kind, noun, card = false, deleted = false }: LinkUnavailableProps) {
|
|
47
|
+
// A word ("Issue") reads in the sentence in small letters; an app's name ("Estiva Ship") keeps its own.
|
|
48
|
+
const word = /^[A-Z][a-z]*$/.test(noun) ? noun.toLowerCase() : noun
|
|
49
|
+
return <UnavailableRow kind={kind} words={deleted ? `${noun} deleted` : `You can't open this ${word}`} card={card} />
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
/** The not-available row with the words it is given; `href` makes the words a link (a part that can't be shown opens its whole file). */
|
|
53
|
-
export function UnavailableRow({ kind, words, href,
|
|
53
|
+
export function UnavailableRow({ kind, words, href, card = false }: { kind: LinkedKind; words: string; href?: string; card?: boolean }) {
|
|
54
54
|
const wide = useContext(inTheBox)
|
|
55
55
|
return (
|
|
56
56
|
<Card fill={wide ? 'elevated' : 'inset'} className={cn(card ? 'flex items-center gap-3 p-3' : ROW_CLASSES, 'max-w-[480px]')}>
|
|
@@ -66,15 +66,6 @@ export function UnavailableRow({ kind, words, href, openIn, card = false }: { ki
|
|
|
66
66
|
words
|
|
67
67
|
)}
|
|
68
68
|
</span>
|
|
69
|
-
{/* The kit's Button as a link, as Peek's file header has it (Katerina, 31 Oct): "Open", the app in its name and
|
|
70
|
-
tooltip, in place of a text link with a typed arrow. */}
|
|
71
|
-
{openIn && (
|
|
72
|
-
<WithTooltip label={`Open in ${openIn.app}`}>
|
|
73
|
-
<Button href={openIn.href} external size="small" className="shrink-0" leadingIcon={<IconExternalLink stroke={1.5} className="size-3.5" />} aria-label={`Open in ${openIn.app}`}>
|
|
74
|
-
Open
|
|
75
|
-
</Button>
|
|
76
|
-
</WithTooltip>
|
|
77
|
-
)}
|
|
78
69
|
</Card>
|
|
79
70
|
)
|
|
80
71
|
}
|
|
@@ -124,7 +115,7 @@ export function LinkRow({ link, preview = true }: LinkRowProps) {
|
|
|
124
115
|
}
|
|
125
116
|
if (link.state === 'unavailable') {
|
|
126
117
|
if (link.url) return <WrittenUrl url={link.url} block />
|
|
127
|
-
return <LinkUnavailable kind={link.kind} noun={link.noun}
|
|
118
|
+
return <LinkUnavailable kind={link.kind} noun={link.noun} deleted={link.deleted} />
|
|
128
119
|
}
|
|
129
120
|
const { linked } = link
|
|
130
121
|
const status = chosenOf(linked.status)
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Meta, Canvas, Controls } from '@storybook/addon-docs/blocks'
|
|
2
|
+
import * as Stories from './NoAccessNotice.stories'
|
|
3
|
+
|
|
4
|
+
<Meta of={Stories} />
|
|
5
|
+
|
|
6
|
+
# NoAccessNotice
|
|
7
|
+
|
|
8
|
+
Where a link to a file you can't read opens: "You can't open this …", and no title.
|
|
9
|
+
|
|
10
|
+
<Canvas of={Stories.Page} />
|
|
11
|
+
|
|
12
|
+
## When
|
|
13
|
+
|
|
14
|
+
- The page a link opens, when the file is not yours to read. The page holds the line alone.
|
|
15
|
+
|
|
16
|
+
## When not
|
|
17
|
+
|
|
18
|
+
- Under a message → **LinkRow** or **LinkCard** with the link unavailable: the same words, on the link's own card.
|
|
19
|
+
- A file that was deleted → **DeletedNotice**, which says who deleted it.
|
|
20
|
+
- A page with nothing in it yet → **EmptyState**.
|
|
21
|
+
|
|
22
|
+
## How
|
|
23
|
+
|
|
24
|
+
```tsx
|
|
25
|
+
import { NoAccessNotice } from '@estiva-app/ui'
|
|
26
|
+
|
|
27
|
+
<NoAccessNotice what="page" />
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
- `what` is the kind of file, in the app's words. Never pass its title: the line exists so a link tells someone who can't read the file nothing about it.
|
|
31
|
+
|
|
32
|
+
## What it owns
|
|
33
|
+
|
|
34
|
+
| It does | So you never write | Refused when written by hand |
|
|
35
|
+
|---|---|---|
|
|
36
|
+
| The line, its lock and its place, the same in every app | the sentence | |
|
|
37
|
+
|
|
38
|
+
## Props
|
|
39
|
+
|
|
40
|
+
<Controls />
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite'
|
|
2
|
+
import { NoAccessNotice } from './NoAccessNotice'
|
|
3
|
+
|
|
4
|
+
/** Where a link to a file you can't read opens. */
|
|
5
|
+
const meta = {
|
|
6
|
+
title: 'Status & feedback/NoAccessNotice',
|
|
7
|
+
component: NoAccessNotice,
|
|
8
|
+
parameters: { layout: 'padded' },
|
|
9
|
+
args: { what: 'item' },
|
|
10
|
+
decorators: [(Story) => <div className="max-w-xl">{Story()}</div>],
|
|
11
|
+
} satisfies Meta<typeof NoAccessNotice>
|
|
12
|
+
|
|
13
|
+
export default meta
|
|
14
|
+
type Story = StoryObj<typeof meta>
|
|
15
|
+
|
|
16
|
+
/** Where the link opens: the page holds the line alone. */
|
|
17
|
+
export const Page: Story = {}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { IconLock } from '@tabler/icons-react'
|
|
2
|
+
import { EmptyState } from './EmptyState'
|
|
3
|
+
|
|
4
|
+
export interface NoAccessNoticeProps {
|
|
5
|
+
/** What the link names, in the app's words: "project", "page". The line never says which one: no title. */
|
|
6
|
+
what: string
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Where a link to a file you can't read opens: "You can't open this …", with no title, so a link tells someone who
|
|
11
|
+
* can't read the file nothing about it (the story `Project changes`, approved 2 November). Under a message the same
|
|
12
|
+
* moment is `LinkRow`'s and `LinkCard`'s own card, in the same words (Miky, ALO-4's review, 3 November).
|
|
13
|
+
*
|
|
14
|
+
* why: https://github.com/estiva-app/estiva-docs/blob/main/decisions/a-file-is-named-by-its-id-in-a-capital-and-small-tag.md
|
|
15
|
+
*/
|
|
16
|
+
export function NoAccessNotice({ what }: NoAccessNoticeProps) {
|
|
17
|
+
return <EmptyState scope="page" icon={<IconLock size={16} stroke={1.5} />} message={`You can't open this ${what}`} />
|
|
18
|
+
}
|
package/src/PartCard.test.tsx
CHANGED
|
@@ -31,9 +31,9 @@ describe('PartCard', () => {
|
|
|
31
31
|
tall.mockRestore()
|
|
32
32
|
})
|
|
33
33
|
|
|
34
|
-
it('says a part is
|
|
34
|
+
it('says a part you cannot read is a file you cannot open', () => {
|
|
35
35
|
render(<PartCard state="unavailable" kind="issue" noun="Issue" />)
|
|
36
|
-
expect(screen.getByText('
|
|
36
|
+
expect(screen.getByText("You can't open this issue")).toBeTruthy()
|
|
37
37
|
})
|
|
38
38
|
|
|
39
39
|
it('says what became of a part in the SPEC’s words: deleted with its file, its block deleted, or no part to show', () => {
|
package/src/PartCard.tsx
CHANGED
|
@@ -42,9 +42,9 @@ export interface PartCardProps {
|
|
|
42
42
|
href?: string
|
|
43
43
|
/** The key of what it is part of: "ABC-2". */
|
|
44
44
|
partKey?: string
|
|
45
|
-
/** What it is part of, in a word, for "
|
|
45
|
+
/** What it is part of, in a word, for "You can't open this issue". Absent, its kind's word. */
|
|
46
46
|
noun?: string
|
|
47
|
-
/**
|
|
47
|
+
/** @deprecated Not drawn since 0.102.0: someone who can't open it has nowhere to go. */
|
|
48
48
|
openIn?: { app: string; href: string }
|
|
49
49
|
/** The part's blocks, drawn by the app. */
|
|
50
50
|
children?: ReactNode
|
|
@@ -52,12 +52,13 @@ export interface PartCardProps {
|
|
|
52
52
|
maxHeight?: number
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
export function PartCard({ state = 'ready', kind, heading, href, partKey, noun,
|
|
55
|
+
export function PartCard({ state = 'ready', kind, heading, href, partKey, noun, children, maxHeight }: PartCardProps) {
|
|
56
56
|
const word = noun ?? kindNounOf({ kind }) ?? 'File'
|
|
57
57
|
const boxed = useContext(inTheBox)
|
|
58
58
|
if (state === 'loading') return <LinkCardLoading kind={kind} shape={{ summary: true, rows: 0, footer: 'none' }} />
|
|
59
59
|
if (state === 'unavailable' || state === 'deleted') {
|
|
60
|
-
|
|
60
|
+
// A part you can't read is one whose file you can't read: "You can't open this issue".
|
|
61
|
+
return <LinkUnavailable kind={kind} noun={state === 'deleted' ? `A part of this ${word.toLowerCase()}` : word} deleted={state === 'deleted'} card />
|
|
61
62
|
}
|
|
62
63
|
// The SPEC's words (§13.6.1): what it is part of is still there; the part is not, or cannot be one.
|
|
63
64
|
if (state === 'detached') return <UnavailableRow kind={kind} words="This part was deleted" card />
|
package/src/editor.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -154,6 +154,8 @@ export { ResolveDialog, type ResolveDialogProps } from './ResolveDialog'
|
|
|
154
154
|
export { PinnedComment, type PinnedCommentProps } from './PinnedComment'
|
|
155
155
|
export { ArchiveDialog, type ArchiveDialogProps } from './ArchiveDialog'
|
|
156
156
|
export { ArchivedNotice, type ArchivedNoticeProps } from './ArchivedNotice'
|
|
157
|
+
export { DeletedNotice, type DeletedNoticeProps } from './DeletedNotice'
|
|
158
|
+
export { NoAccessNotice, type NoAccessNoticeProps } from './NoAccessNotice'
|
|
157
159
|
export { Thread, type ThreadProps, type ThreadStart } from './Thread'
|
|
158
160
|
export { useSeenOnScreen, type SeenOnScreen } from './seenOnScreen'
|
|
159
161
|
export { showInConversation, showInConversationWhenDrawn, type ShowOptions, type ShowWhenDrawnOptions } from './showInConversation'
|
package/src/linked.ts
CHANGED
|
@@ -147,7 +147,7 @@ export interface LoadingShape {
|
|
|
147
147
|
/**
|
|
148
148
|
* Where a link's lookup stands. `loading` knows the kind from the address, and
|
|
149
149
|
* a shape when the app remembers one; `unavailable` is not the reader's to see
|
|
150
|
-
* ("
|
|
150
|
+
* ("You can't open this issue"), or `deleted` ("Issue deleted"), which a reader tells
|
|
151
151
|
* apart by a deletion naming the address (SPEC §13.6.1: deleted is not
|
|
152
152
|
* not-permitted). Written as a URL, it is that URL either way (`url`).
|
|
153
153
|
*/
|
|
@@ -158,7 +158,7 @@ export type LinkState =
|
|
|
158
158
|
kind: LinkedKind
|
|
159
159
|
/** What it is, in a word: "Item". */
|
|
160
160
|
noun: string
|
|
161
|
-
/**
|
|
161
|
+
/** @deprecated Not drawn since 0.102.0: someone who can't open it has nowhere to go (Miky, ALO-4's review). */
|
|
162
162
|
openIn?: { app: string; href: string }
|
|
163
163
|
/** Deleted, as a trusted deletion naming its address says (SPEC §13.6.1): "Issue deleted", with no way out. */
|
|
164
164
|
deleted?: boolean
|
package/src/linkedFrom.test.tsx
CHANGED
|
@@ -224,24 +224,21 @@ describe('when it changed, and who made it', () => {
|
|
|
224
224
|
})
|
|
225
225
|
|
|
226
226
|
describe('a file the reader cannot read', () => {
|
|
227
|
-
it('
|
|
227
|
+
it('says you cannot open it, with nowhere to go, even where its app names an address', () => {
|
|
228
228
|
const stub: LinkedSource = { ...GROUP, unreachable: true, noun: 'group', appName: 'App one', openUrl: 'https://app.example/x' }
|
|
229
229
|
render(<LinkCard link={linkStateFrom(stub, UNREAD, options())} />)
|
|
230
|
-
expect(screen.getByText(
|
|
231
|
-
expect(screen.getByRole('link', { name: /App one/ }).getAttribute('href')).toBe('https://app.example/x')
|
|
232
|
-
cleanup()
|
|
233
|
-
render(<LinkCard link={linkStateFrom({ ...stub, openUrl: 'javascript:alert(1)' }, UNREAD, options())} />)
|
|
230
|
+
expect(screen.getByText("You can't open this group")).toBeTruthy()
|
|
234
231
|
expect(screen.queryByRole('link')).toBeNull()
|
|
235
232
|
})
|
|
236
233
|
|
|
237
234
|
it('is named by its app when its type has no name, as the record a-file-is-labelled-by-its-type-not-its-app says', () => {
|
|
238
235
|
render(<LinkCard link={linkStateFrom({ ...GROUP, unreachable: true, appName: 'App one' }, { kind: 'file', noun: 'Record' }, options())} />)
|
|
239
|
-
expect(screen.getByText('App one
|
|
236
|
+
expect(screen.getByText("You can't open this App one")).toBeTruthy()
|
|
240
237
|
})
|
|
241
238
|
|
|
242
239
|
it('reads as the address says while it loads and when nothing came back', () => {
|
|
243
240
|
render(<LinkCard link={linkStateFrom(null, { kind: 'file', noun: 'Record' }, options())} />)
|
|
244
|
-
expect(screen.getByText('
|
|
241
|
+
expect(screen.getByText("You can't open this record")).toBeTruthy()
|
|
245
242
|
})
|
|
246
243
|
|
|
247
244
|
it('says it was deleted when a trusted deletion names it, and offers no way out', () => {
|
package/src/linkedFrom.ts
CHANGED
|
@@ -328,12 +328,10 @@ export function linkStateFrom<T extends LinkedSource>(
|
|
|
328
328
|
const written = unread.url ? { url: unread.url } : {}
|
|
329
329
|
if (object === null) return { state: 'unavailable', kind: unread.kind, noun: unread.noun, ...(unread.deleted ? { deleted: true } : {}), ...written }
|
|
330
330
|
if (object.unreachable) {
|
|
331
|
-
const href = object.openUrl && /^https:\/\//i.test(object.openUrl) ? object.openUrl : undefined
|
|
332
331
|
return {
|
|
333
332
|
state: 'unavailable',
|
|
334
333
|
kind: linkedKindOfKind(object.kind),
|
|
335
334
|
noun: nounOf(object) || unread.noun,
|
|
336
|
-
...(href ? { openIn: { app: object.appName ?? 'its app', href } } : {}),
|
|
337
335
|
...written,
|
|
338
336
|
}
|
|
339
337
|
}
|
|
@@ -48,19 +48,19 @@ describe('the registry builds', () => {
|
|
|
48
48
|
expect(registry.entries.map((one) => one.name).sort()).toEqual(values.map((one) => one.name).sort())
|
|
49
49
|
})
|
|
50
50
|
|
|
51
|
-
it('counts
|
|
51
|
+
it('counts 245 names over 125 files: 162 components, 76 helpers and 7 hooks (DeletedNotice and NoAccessNotice, the cards on a deleted file and on one you cannot open (ALO-4), on 3 November; useFormBusy, whether a Form around it is sending, read by the editor’s DocumentField from the main entry, in the review of 2 November; useLeftAt, sendsInLayout, useSeenOnScreen, showInConversation and showInConversationWhenDrawn, where a conversation scrolls, what was seen and a link landing on a comment, moved from Peek for every app, on 2 November; useRememberedOpen, the fold a section remembers, read by the app, and NAV_TREE_PENDING_MS and isPlainClick, Peek’s Folder timer and plain-click check, moved in, on 2 November; FormDialog, MoveDialog and ArchiveDialog, the dialogs Peek wired by hand, on 2 November; ConversationPlace, the line saying where a comment was said, and DocumentField, a rich-text field of a form, moved from Peek, on 2 November; ArchivedNotice, the card on an archived file, from Peek, Ship and Leaf, on 31 October; caretOnOpen, the box at a thread’s foot taking the caret when a ConversationLayout opens it, without scrolling, on 31 October; the conversation from Peek for every app, with PageHeader and PinnedComment, on 31 October, and ResolutionNote and ResolutionHistory gone with the resolved looks not picked, on 1 November; useSidebarFold, a folded sidebar kept folded in every app, on 31 October; cardShapeMemory, a card’s last shape on this device, lifted from Peek and Ship for Leaf, and ReferenceCards and useReferenceCards gone with their deprecated page, in the widget review, on 30 October; inTheBox, a card or part in a box being written in, on the files’ fill and in words, on 29 October; archivedLine, the line on an archived file in every app (PEEKM-2), on 23 October; keepCommentBoxWarm, a box built ahead, exported as 0.84.0 promised (PEEKM-1), on 21 October;linkedFrom and linkStateFrom, one card for a file in every app (5ebf2756), on 21 October; ComposeBox, ComposeKeys and COMPOSE_EDITOR_CLASSES gone into CommentBox’s own frame (one box), on 21 October; LinkPlaces with linkPlaceAt and staysChip, a link in a document drawn where it sits (WBD-4), on 20 October; DocumentEditor, one document editor for every app, and PersonReference, `@` in a document (WBD-3), on 20 October; toggleTableHeaderRow, a table’s header row on and off (LEAF-12), on 19 October;EntryShell, the screen while nobody is signed in, moved from Peek (AUT-3), on 17 October; CommentBox with commentBoxRows, and ReactionRow with AddReactionButton and whoReacted, the shared comment box and reaction row (COMM-2), on 17 October; the link widgets — LinkChip, LinkRow, LinkCard, CardUnder, PartCard, LinkPreview and their parts, with useCanHover, chosenOf, loadingShapeOf and unavailableMemory — from the Widgets 2 prototype, on 16 October; InlineText, a title or the line under it edited where it stands (SUM-4), on 16 October; ComposeBox with ComposeKeys and its classes, CommentHighlights with its five helpers, and keepSelection and releaseSelection, from the Leaf prototype (LEAF-4), on 16 October;NavTree, NavTreeSection, the composer triggers and UnreadDot joined on 2 October; BlockHandle and EditorBlockHandle (RIC-18) on 2 October, moveBlock and blockDropCursor, the drop in the gutter, on 5 October, MembersPill and MembersDialog, moved from Peek (SHI-31), on 6 October, ShowMore on 7 October, AppProvider on 8 October, and KindIcon, thingKindOf and PastedImages with its two helpers, moved from Peek, on 8 October; CodeBlockColours, the coloured code block of the editor, on 9 October; Checklist, Callout, isChecklistTick and calloutLook (RIC-19) on 13 October; EditorTableControls and its four actions (RIC-21) on 13 October; ReferenceCards, useReferenceCards and its three helpers, the card a chip in a document asks for, on 14 October; LinkChips and its two helpers, a URL in a document read as its chip, on 14 October; ReferenceMenu, ReferenceMenuView and three helpers, the menu of a chip while writing, on 14 October; PastedMarkdown, markdown pasted as the blocks it spells (LEAF-10), on 15 October; turnIntoRows, turnListInto and turnQuoteInto, the block menu’s Turn into for a list and a quote (LEAF-11), on 15 October)', () => {
|
|
52
52
|
// The reconciliation GATES.md §24 explains. If this changes, that changes.
|
|
53
53
|
// The `EDITOR_EXTENSIONS` count as components by their names; they are
|
|
54
54
|
// editor extensions, documented on SelectionToolbar's, BlockNodes' and
|
|
55
55
|
// ComposerTriggers' pages.
|
|
56
56
|
const kinds = registry.entries.reduce<Record<string, number>>((all, one) => ({ ...all, [one.kind]: (all[one.kind] ?? 0) + 1 }), {})
|
|
57
|
-
expect(kinds).toEqual({ component:
|
|
58
|
-
expect(new Set(registry.entries.map((one) => one.sourceFile)).size).toBe(
|
|
57
|
+
expect(kinds).toEqual({ component: 162, helper: 76, hook: 7 })
|
|
58
|
+
expect(new Set(registry.entries.map((one) => one.sourceFile)).size).toBe(125)
|
|
59
59
|
})
|
|
60
60
|
|
|
61
61
|
it('gives every entry a purpose, from its own page or from the comment above it', () => {
|
|
62
62
|
expect(registry.entries.filter((one) => one.purpose.trim() === '')).toEqual([])
|
|
63
|
-
expect(registry.entries.filter((one) => one.purposeFrom === 'page').length).toBe(
|
|
63
|
+
expect(registry.entries.filter((one) => one.purposeFrom === 'page').length).toBe(112)
|
|
64
64
|
expect(registry.entries.filter((one) => one.purposeFrom === 'comment').length).toBe(133)
|
|
65
65
|
})
|
|
66
66
|
|
package/stories/Choosing.mdx
CHANGED
|
@@ -156,6 +156,8 @@ The same conversation in every app; only its colours are each app's.
|
|
|
156
156
|
| It happened, and must not be missed | **Toast** with `durationMs: 0` and an action — it floats and stays until dismissed (D21) |
|
|
157
157
|
| The whole surface has something to say | **Banner** — the strip under the top bar, full width; `onDismiss` if the reader closes it rather than the app |
|
|
158
158
|
| The file is archived | **ArchivedNotice** — the grey card at the top of its page and in the comment box's place: who, when, the resolution, and Unarchive |
|
|
159
|
+
| The file was deleted, and a link to it opens | **DeletedNotice** — the same card: who deleted it, when, and Restore for someone who may edit it |
|
|
160
|
+
| A link names a file the person can't read | **NoAccessNotice** — "You can't open this …", no title, on the page a link opens; under a message, **LinkRow** or **LinkCard** unavailable says the same |
|
|
159
161
|
| A part that breaks without taking the page with it | **ErrorBoundary** — around each column, panel or conversation, and once around the app; `label` says what it holds |
|
|
160
162
|
|
|
161
163
|
## The frame
|