@estiva-app/ui 0.110.0 → 0.111.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/CornerMenu.d.ts +34 -0
- package/dist/CornerMenu.d.ts.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +349 -308
- package/dist/index.js.map +4 -4
- package/package.json +1 -1
- package/registry.json +37 -3
- package/src/CornerMenu.mdx +60 -0
- package/src/CornerMenu.stories.tsx +62 -0
- package/src/CornerMenu.test.tsx +93 -0
- package/src/CornerMenu.tsx +81 -0
- package/src/index.ts +1 -0
- package/src/registry/registry.test.ts +4 -4
- package/stories/Choosing.mdx +1 -0
package/package.json
CHANGED
package/registry.json
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
"kind": "package",
|
|
5
5
|
"repo": "estiva-ui",
|
|
6
6
|
"package": "@estiva-app/ui",
|
|
7
|
-
"packageVersion": "0.
|
|
8
|
-
"exports":
|
|
9
|
-
"typeExports":
|
|
7
|
+
"packageVersion": "0.111.0",
|
|
8
|
+
"exports": 252,
|
|
9
|
+
"typeExports": 263,
|
|
10
10
|
"files": null
|
|
11
11
|
},
|
|
12
12
|
"storybook": {
|
|
@@ -3380,6 +3380,40 @@
|
|
|
3380
3380
|
"app": null,
|
|
3381
3381
|
"looks": []
|
|
3382
3382
|
},
|
|
3383
|
+
{
|
|
3384
|
+
"name": "CornerMenu",
|
|
3385
|
+
"repo": "estiva-ui",
|
|
3386
|
+
"kind": "component",
|
|
3387
|
+
"importPath": "@estiva-app/ui",
|
|
3388
|
+
"sourceFile": "src/CornerMenu.tsx",
|
|
3389
|
+
"purpose": "The \"…\" over the top-right corner of a row or a card in a list the person arranges: Show as Row or Card, and Remove.",
|
|
3390
|
+
"purposeFrom": "page",
|
|
3391
|
+
"props": [
|
|
3392
|
+
{
|
|
3393
|
+
"name": "children",
|
|
3394
|
+
"takes": "anything",
|
|
3395
|
+
"required": true,
|
|
3396
|
+
"note": "The row or the card the \"…\" floats over."
|
|
3397
|
+
},
|
|
3398
|
+
{
|
|
3399
|
+
"name": "menu",
|
|
3400
|
+
"takes": "CornerMenuOptions",
|
|
3401
|
+
"required": false,
|
|
3402
|
+
"note": "The \"…\" and its menu. Without it only `children` are drawn: where the person cannot arrange the list."
|
|
3403
|
+
}
|
|
3404
|
+
],
|
|
3405
|
+
"variants": [],
|
|
3406
|
+
"ownsBehaviours": [],
|
|
3407
|
+
"status": "stable",
|
|
3408
|
+
"migrationStage": null,
|
|
3409
|
+
"docsId": "links-references-cornermenu--docs",
|
|
3410
|
+
"storyId": "links-references-cornermenu--card-and-row",
|
|
3411
|
+
"docPage": "src/CornerMenu.mdx",
|
|
3412
|
+
"app": null,
|
|
3413
|
+
"looks": [
|
|
3414
|
+
"-right-2 -top-2 rounded-md border border-border-strong bg-bg-elevated opacity-0 shadow-sm transition-opacity focus-within:opacity-100 [@media(hover:none)]:opacity-100"
|
|
3415
|
+
]
|
|
3416
|
+
},
|
|
3383
3417
|
{
|
|
3384
3418
|
"name": "deleteBlock",
|
|
3385
3419
|
"repo": "estiva-ui",
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { Meta, Canvas, Controls } from '@storybook/addon-docs/blocks'
|
|
2
|
+
import * as CornerMenuStories from './CornerMenu.stories'
|
|
3
|
+
|
|
4
|
+
<Meta of={CornerMenuStories} />
|
|
5
|
+
|
|
6
|
+
# CornerMenu
|
|
7
|
+
|
|
8
|
+
The "…" over the top-right corner of a row or a card in a list the person arranges: Show as Row or Card, and Remove.
|
|
9
|
+
|
|
10
|
+
<Canvas of={CornerMenuStories.CardAndRow} />
|
|
11
|
+
|
|
12
|
+
## When
|
|
13
|
+
|
|
14
|
+
- **with `menu`** — an item in a list the person may arrange: it shows as one line or as its card, and they can take it off.
|
|
15
|
+
- **no `menu`** — the same list to someone who may not arrange it: the child alone, no "…".
|
|
16
|
+
|
|
17
|
+
The "…" floats over the item's top-right corner, where `AttachedCard`'s ✕ sits, and takes no room of its own. It shows when the pointer is over the item, while it has focus or its menu is open, and always on a screen that cannot hover, so a tap reaches it.
|
|
18
|
+
|
|
19
|
+
<Canvas of={CornerMenuStories.Open} />
|
|
20
|
+
|
|
21
|
+
## When not
|
|
22
|
+
|
|
23
|
+
- A card whose only action is taking it off → **AttachedCard** `onRemove`, the round ✕.
|
|
24
|
+
- A link alone on its line in a document being written → **ReferenceMenu**, which offers the same Show as in the editor.
|
|
25
|
+
- More than these actions on a row of a list in the sidebar → **NavItem** `menu`.
|
|
26
|
+
|
|
27
|
+
## How
|
|
28
|
+
|
|
29
|
+
```tsx
|
|
30
|
+
import { AttachedCard, CornerMenu, LinkRow } from '@estiva-app/ui'
|
|
31
|
+
|
|
32
|
+
<CornerMenu menu={canArrange ? { name: title, look, onLook: setLook, onRemove: remove } : undefined}>
|
|
33
|
+
{look === 'card' ? <AttachedCard link={link} /> : <LinkRow link={link} />}
|
|
34
|
+
</CornerMenu>
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
- `name` is required: the "…" is announced as "More options for {name}".
|
|
38
|
+
- `onLook` is called only with the look not in use; choosing the one in use closes the menu and asks for nothing.
|
|
39
|
+
- Pass the card **no** `onRemove`: Remove is in the menu, and a card with both would draw the ✕ beside the "…".
|
|
40
|
+
- It is at most 480px wide, as `AttachedCard`, so the "…" sits on the card's corner.
|
|
41
|
+
|
|
42
|
+
## What it owns
|
|
43
|
+
|
|
44
|
+
| It does | So you never write |
|
|
45
|
+
|---|---|
|
|
46
|
+
| Floats the "…" over the item's top-right corner, taking no room | a positioned wrapper and a button |
|
|
47
|
+
| Reveals it on hover, focus and while its menu is open, and always shows it on touch | a hover or touch check |
|
|
48
|
+
| The menu: Show as Row or Card, the look in use ticked, and checked for a screen reader, then Remove | the words and the tick |
|
|
49
|
+
|
|
50
|
+
## Keys
|
|
51
|
+
|
|
52
|
+
| Key | Does |
|
|
53
|
+
|---|---|
|
|
54
|
+
| Tab | Reaches the "…", and shows it |
|
|
55
|
+
| Enter | Opens the menu |
|
|
56
|
+
| Escape | Closes the menu |
|
|
57
|
+
|
|
58
|
+
## Props
|
|
59
|
+
|
|
60
|
+
<Controls of={CornerMenuStories.NoMenu} />
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite'
|
|
2
|
+
import { useState } from 'react'
|
|
3
|
+
import { userEvent, within } from 'storybook/test'
|
|
4
|
+
import { AttachedCard } from './AttachedCard'
|
|
5
|
+
import { Button } from './Button'
|
|
6
|
+
import { CornerMenu, type CornerMenuLook } from './CornerMenu'
|
|
7
|
+
import { LinkRow } from './LinkRow'
|
|
8
|
+
import { ITEM, ITEM_NO_SUMMARY, ready } from './linked.examples'
|
|
9
|
+
|
|
10
|
+
const meta = {
|
|
11
|
+
title: 'Links & references/CornerMenu',
|
|
12
|
+
component: CornerMenu,
|
|
13
|
+
parameters: { layout: 'padded' },
|
|
14
|
+
args: { children: null },
|
|
15
|
+
} satisfies Meta<typeof CornerMenu>
|
|
16
|
+
|
|
17
|
+
export default meta
|
|
18
|
+
type Story = StoryObj<typeof meta>
|
|
19
|
+
|
|
20
|
+
/** One item, a row or a card as its menu says, and gone once removed. */
|
|
21
|
+
function Item({ start, linked }: { start: CornerMenuLook; linked: typeof ITEM }) {
|
|
22
|
+
const [look, setLook] = useState(start)
|
|
23
|
+
const [removed, setRemoved] = useState(false)
|
|
24
|
+
if (removed) return <Button onClick={() => setRemoved(false)}>Put it back</Button>
|
|
25
|
+
const link = ready(linked)
|
|
26
|
+
return (
|
|
27
|
+
<CornerMenu menu={{ name: linked.title, look, onLook: setLook, onRemove: () => setRemoved(true) }}>
|
|
28
|
+
{look === 'card' ? <AttachedCard link={link} /> : <LinkRow link={link} />}
|
|
29
|
+
</CornerMenu>
|
|
30
|
+
)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** A card and a row in one list: point at either and its "…" shows over its top-right corner, taking no room. Show as Row or Card changes it; Remove takes it off. */
|
|
34
|
+
export const CardAndRow: Story = {
|
|
35
|
+
render: () => (
|
|
36
|
+
<div className="flex flex-col gap-3">
|
|
37
|
+
<Item start="card" linked={ITEM} />
|
|
38
|
+
<Item start="row" linked={ITEM_NO_SUMMARY} />
|
|
39
|
+
</div>
|
|
40
|
+
),
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** The menu open on a card: Show as, the look in use selected, then Remove. */
|
|
44
|
+
export const Open: Story = {
|
|
45
|
+
render: () => (
|
|
46
|
+
<div className="h-96">
|
|
47
|
+
<Item start="card" linked={ITEM} />
|
|
48
|
+
</div>
|
|
49
|
+
),
|
|
50
|
+
play: async ({ canvasElement }) => {
|
|
51
|
+
await userEvent.click(within(canvasElement).getByRole('button', { name: `More options for ${ITEM.title}` }))
|
|
52
|
+
},
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** Where the person cannot arrange the list: no `menu`, no "…". */
|
|
56
|
+
export const NoMenu: Story = {
|
|
57
|
+
render: () => (
|
|
58
|
+
<CornerMenu>
|
|
59
|
+
<AttachedCard link={ready(ITEM)} />
|
|
60
|
+
</CornerMenu>
|
|
61
|
+
),
|
|
62
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
// @vitest-environment jsdom
|
|
2
|
+
/** What the CornerMenu page claims, pinned: the "…" is named for the item, is drawn only with a menu, and its menu shows and changes the look and removes. */
|
|
3
|
+
import { cleanup, render, screen, waitFor } from '@testing-library/react'
|
|
4
|
+
import userEvent from '@testing-library/user-event'
|
|
5
|
+
import { afterEach, describe, expect, it, vi } from 'vitest'
|
|
6
|
+
import { CornerMenu, type CornerMenuOptions } from './CornerMenu'
|
|
7
|
+
|
|
8
|
+
afterEach(cleanup)
|
|
9
|
+
|
|
10
|
+
function options(over: Partial<CornerMenuOptions> = {}): CornerMenuOptions {
|
|
11
|
+
return { name: 'Item one', look: 'row', onLook: vi.fn(), onRemove: vi.fn(), ...over }
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
async function openMenu(menu: CornerMenuOptions) {
|
|
15
|
+
const user = userEvent.setup()
|
|
16
|
+
render(
|
|
17
|
+
<CornerMenu menu={menu}>
|
|
18
|
+
<span>Item one</span>
|
|
19
|
+
</CornerMenu>,
|
|
20
|
+
)
|
|
21
|
+
await user.click(screen.getByRole('button', { name: 'More options for Item one' }))
|
|
22
|
+
await screen.findByRole('menu')
|
|
23
|
+
return user
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
describe('CornerMenu', () => {
|
|
27
|
+
it('draws its child and a "…" named for the item', () => {
|
|
28
|
+
render(
|
|
29
|
+
<CornerMenu menu={options()}>
|
|
30
|
+
<span>Item one</span>
|
|
31
|
+
</CornerMenu>,
|
|
32
|
+
)
|
|
33
|
+
expect(screen.getByText('Item one')).toBeTruthy()
|
|
34
|
+
expect(screen.getByRole('button', { name: 'More options for Item one' })).toBeTruthy()
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
it('without a menu, where the person cannot arrange the list, draws its child and no "…"', () => {
|
|
38
|
+
render(
|
|
39
|
+
<CornerMenu>
|
|
40
|
+
<span>Item one</span>
|
|
41
|
+
</CornerMenu>,
|
|
42
|
+
)
|
|
43
|
+
expect(screen.getByText('Item one')).toBeTruthy()
|
|
44
|
+
expect(screen.queryAllByRole('button')).toHaveLength(0)
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
it('opens Show as with Row and Card, the look in use checked, then Remove', async () => {
|
|
48
|
+
await openMenu(options({ look: 'card' }))
|
|
49
|
+
expect(screen.getByRole('group', { name: 'Show as' })).toBeTruthy()
|
|
50
|
+
expect(screen.getByRole('menuitemradio', { name: 'Card', checked: true })).toBeTruthy()
|
|
51
|
+
expect(screen.getByRole('menuitemradio', { name: 'Row', checked: false })).toBeTruthy()
|
|
52
|
+
expect(screen.getByRole('menuitem', { name: 'Remove' })).toBeTruthy()
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
it('choosing Card on a row asks for the card, and closes the menu', async () => {
|
|
56
|
+
const menu = options({ look: 'row' })
|
|
57
|
+
const user = await openMenu(menu)
|
|
58
|
+
await user.click(screen.getByRole('menuitemradio', { name: 'Card' }))
|
|
59
|
+
expect(menu.onLook).toHaveBeenCalledWith('card')
|
|
60
|
+
expect(menu.onLook).toHaveBeenCalledTimes(1)
|
|
61
|
+
await waitFor(() => expect(screen.queryByRole('menu')).toBeNull())
|
|
62
|
+
})
|
|
63
|
+
|
|
64
|
+
it('choosing the look already in use asks for nothing', async () => {
|
|
65
|
+
const menu = options({ look: 'row' })
|
|
66
|
+
const user = await openMenu(menu)
|
|
67
|
+
await user.click(screen.getByRole('menuitemradio', { name: 'Row' }))
|
|
68
|
+
expect(menu.onLook).not.toHaveBeenCalled()
|
|
69
|
+
})
|
|
70
|
+
|
|
71
|
+
it('Remove removes the item', async () => {
|
|
72
|
+
const menu = options()
|
|
73
|
+
const user = await openMenu(menu)
|
|
74
|
+
await user.click(screen.getByRole('menuitem', { name: 'Remove' }))
|
|
75
|
+
expect(menu.onRemove).toHaveBeenCalledTimes(1)
|
|
76
|
+
expect(menu.onLook).not.toHaveBeenCalled()
|
|
77
|
+
})
|
|
78
|
+
|
|
79
|
+
it('opens from the keyboard: Tab reaches the "…", Enter opens it, Escape closes it', async () => {
|
|
80
|
+
const user = userEvent.setup()
|
|
81
|
+
render(
|
|
82
|
+
<CornerMenu menu={options()}>
|
|
83
|
+
<span>Item one</span>
|
|
84
|
+
</CornerMenu>,
|
|
85
|
+
)
|
|
86
|
+
await user.tab()
|
|
87
|
+
expect(document.activeElement).toBe(screen.getByRole('button', { name: 'More options for Item one' }))
|
|
88
|
+
await user.keyboard('{Enter}')
|
|
89
|
+
expect(await screen.findByRole('menuitem', { name: 'Remove' })).toBeTruthy()
|
|
90
|
+
await user.keyboard('{Escape}')
|
|
91
|
+
await waitFor(() => expect(screen.queryByRole('menu')).toBeNull())
|
|
92
|
+
})
|
|
93
|
+
})
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The "…" that floats over a row's or a card's top-right corner in a list the
|
|
3
|
+
* person arranges, and the menu it opens: Show as Row or Card, the one in use
|
|
4
|
+
* ticked, then Remove (Miky, 6 Nov, the topics level-up prototype).
|
|
5
|
+
*
|
|
6
|
+
* It sits where `AttachedCard`'s ✕ sits and takes no room of its own: shown
|
|
7
|
+
* while the pointer is over the item, while the "…" has focus or its menu is
|
|
8
|
+
* open, and always on a screen that cannot hover, so a tap reaches it. "Show
|
|
9
|
+
* as", "Row" and "Card" are the words `ReferenceMenu` uses for the same choice.
|
|
10
|
+
*
|
|
11
|
+
* Without `menu` it draws only its child, in the same box: where the person
|
|
12
|
+
* cannot arrange the list, the app passes nothing and no "…" is drawn.
|
|
13
|
+
*/
|
|
14
|
+
import type { ReactNode } from 'react'
|
|
15
|
+
import { IconCheck, IconDotsVertical } from '@tabler/icons-react'
|
|
16
|
+
import { IconButton } from './IconButton'
|
|
17
|
+
import { Menu, MenuItem, MenuSection, MenuSeparator } from './Menu'
|
|
18
|
+
|
|
19
|
+
/** How an item in a list shows: one line, or its card. */
|
|
20
|
+
export type CornerMenuLook = 'row' | 'card'
|
|
21
|
+
|
|
22
|
+
const LOOKS: { look: CornerMenuLook; label: string }[] = [
|
|
23
|
+
{ look: 'row', label: 'Row' },
|
|
24
|
+
{ look: 'card', label: 'Card' },
|
|
25
|
+
]
|
|
26
|
+
|
|
27
|
+
export interface CornerMenuOptions {
|
|
28
|
+
/** The item's name: the "…" is "More options for {name}". */
|
|
29
|
+
name: string
|
|
30
|
+
/** How it shows now: ticked under Show as. */
|
|
31
|
+
look: CornerMenuLook
|
|
32
|
+
/** Show as Row or Card was chosen: the other look than `look`. Choosing the one in use calls nothing. */
|
|
33
|
+
onLook: (look: CornerMenuLook) => void
|
|
34
|
+
/** Remove was chosen. */
|
|
35
|
+
onRemove: () => void
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface CornerMenuProps {
|
|
39
|
+
/** The row or the card the "…" floats over. */
|
|
40
|
+
children: ReactNode
|
|
41
|
+
/** The "…" and its menu. Without it only `children` are drawn: where the person cannot arrange the list. */
|
|
42
|
+
menu?: CornerMenuOptions
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export function CornerMenu({ children, menu }: CornerMenuProps) {
|
|
46
|
+
return (
|
|
47
|
+
// At most 480px, as `AttachedCard`, so the "…" sits on the card's corner and not at the column's edge.
|
|
48
|
+
<div className="group/corner relative max-w-[480px]">
|
|
49
|
+
{children}
|
|
50
|
+
{menu && (
|
|
51
|
+
<div className="absolute -right-2 -top-2 z-10 rounded-md border border-border-strong bg-bg-elevated opacity-0 shadow-sm transition-opacity group-hover/corner:opacity-100 focus-within:opacity-100 has-[[aria-expanded=true]]:opacity-100 [@media(hover:none)]:opacity-100">
|
|
52
|
+
<Menu
|
|
53
|
+
align="right"
|
|
54
|
+
trigger={
|
|
55
|
+
<IconButton tooltip="More options" aria-label={`More options for ${menu.name}`}>
|
|
56
|
+
<IconDotsVertical size={16} stroke={1.5} />
|
|
57
|
+
</IconButton>
|
|
58
|
+
}
|
|
59
|
+
>
|
|
60
|
+
<MenuSection label="Show as">
|
|
61
|
+
{LOOKS.map(({ look, label }) => (
|
|
62
|
+
<MenuItem
|
|
63
|
+
key={look}
|
|
64
|
+
role="menuitemradio"
|
|
65
|
+
aria-checked={menu.look === look}
|
|
66
|
+
label={label}
|
|
67
|
+
trailing={menu.look === look ? <IconCheck size={16} aria-hidden /> : undefined}
|
|
68
|
+
onClick={() => {
|
|
69
|
+
if (menu.look !== look) menu.onLook(look)
|
|
70
|
+
}}
|
|
71
|
+
/>
|
|
72
|
+
))}
|
|
73
|
+
</MenuSection>
|
|
74
|
+
<MenuSeparator />
|
|
75
|
+
<MenuItem label="Remove" onClick={menu.onRemove} />
|
|
76
|
+
</Menu>
|
|
77
|
+
</div>
|
|
78
|
+
)}
|
|
79
|
+
</div>
|
|
80
|
+
)
|
|
81
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -129,6 +129,7 @@ export { LinkRow, LinkUnavailable, type LinkRowProps, type LinkUnavailableProps
|
|
|
129
129
|
export { LinkCard, LinkCardLoading, type LinkCardProps, type LinkCardLoadingProps } from './LinkCard'
|
|
130
130
|
export { LinkPreview, LinkPreviewOpen, useCanHover, type LinkPreviewProps } from './LinkPreview'
|
|
131
131
|
export { AttachedCard, type AttachedCardMemory, type AttachedCardProps } from './AttachedCard'
|
|
132
|
+
export { CornerMenu, type CornerMenuLook, type CornerMenuOptions, type CornerMenuProps } from './CornerMenu'
|
|
132
133
|
export { PartCard, type PartCardProps, type PartCardState } from './PartCard'
|
|
133
134
|
export { Person, type PersonProps } from './Person'
|
|
134
135
|
export { Rail, type RailProps } from './Rail'
|
|
@@ -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 252 names over 129 files: 167 components, 78 helpers and 7 hooks (CornerMenu, the "…" over a row’s or a card’s corner with Show as and Remove (TOPI-5), on 10 November; ConversationHeading, which place a comment is on in a list mixing several places (TOPI-2), on 9 November; FollowSwitch, LevelIcon and WhoFollowsDialog, how you follow a place and who follows it (TEA-6), on 6 November; goneWords and GONE_CLOSED, what stands in a gone comment’s place and under its thread in every app (ONE-9), on 6 November; 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: 167, helper: 78, hook: 7 })
|
|
58
|
+
expect(new Set(registry.entries.map((one) => one.sourceFile)).size).toBe(129)
|
|
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(116)
|
|
64
64
|
expect(registry.entries.filter((one) => one.purposeFrom === 'comment').length).toBe(136)
|
|
65
65
|
})
|
|
66
66
|
|
package/stories/Choosing.mdx
CHANGED
|
@@ -140,6 +140,7 @@ The same conversation in every app; only its colours are each app's.
|
|
|
140
140
|
| A link alone on its line | **LinkRow** — one 36px line for every kind; **LinkUnavailable** when it cannot be read |
|
|
141
141
|
| A link's card: what a row cannot hold, with the pickers the reader may use | **LinkCard** — `onChange` on a picker only for a reader who may change it; **LinkCardLoading** at its height |
|
|
142
142
|
| The one card attached to a piece of text, with the ✕ that removes it | **AttachedCard** — in a box, `CommentBox` places it with the files |
|
|
143
|
+
| A row or a card in a list the person arranges: Show as Row or Card, and Remove, behind a `…` on its corner | **CornerMenu** around the **LinkRow** or **AttachedCard** (no `onRemove`); no `menu` where they cannot arrange it |
|
|
143
144
|
| A link's card on hover, read only | **LinkPreview** — LinkChip and LinkRow already wrap themselves in it |
|
|
144
145
|
| A part of something longer, shared live | **PartCard** — the app draws the blocks |
|
|
145
146
|
| A status and an owner changed in place, a conversation count with its unread dot, a ring | **LinkParts** — `LinkPickers`, `CommentCount`, `StatusMark`, `ProgressRing` |
|