@estiva-app/ui 0.86.0 → 0.87.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/archivedLine.d.ts +19 -0
- package/dist/archivedLine.d.ts.map +1 -0
- package/dist/editor.d.ts +1 -1
- package/dist/editor.d.ts.map +1 -1
- package/dist/editor.js +9 -0
- package/dist/editor.js.map +2 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -0
- package/dist/index.js.map +3 -3
- package/package.json +1 -1
- package/registry.json +53 -2
- package/src/archivedLine.test.ts +34 -0
- package/src/archivedLine.ts +24 -0
- package/src/editor.ts +1 -0
- package/src/index.ts +1 -0
- package/src/registry/registry.test.ts +5 -5
package/package.json
CHANGED
package/registry.json
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
"kind": "package",
|
|
5
5
|
"repo": "estiva-ui",
|
|
6
6
|
"package": "@estiva-app/ui",
|
|
7
|
-
"packageVersion": "0.
|
|
8
|
-
"exports":
|
|
7
|
+
"packageVersion": "0.87.0",
|
|
8
|
+
"exports": 210,
|
|
9
9
|
"typeExports": 211,
|
|
10
10
|
"files": null
|
|
11
11
|
},
|
|
@@ -279,6 +279,25 @@
|
|
|
279
279
|
"overflow-hidden rounded-2xl bg-bg-surface signal:border signal:border-border-subtle signal:shadow-highlight-inset"
|
|
280
280
|
]
|
|
281
281
|
},
|
|
282
|
+
{
|
|
283
|
+
"name": "archivedLine",
|
|
284
|
+
"repo": "estiva-ui",
|
|
285
|
+
"kind": "helper",
|
|
286
|
+
"importPath": "@estiva-app/ui",
|
|
287
|
+
"sourceFile": "src/archivedLine.ts",
|
|
288
|
+
"purpose": "The line in the comment box's place on an archived file (CommentBox's `closed.reason`), in every app's words alike.",
|
|
289
|
+
"purposeFrom": "comment",
|
|
290
|
+
"props": [],
|
|
291
|
+
"variants": [],
|
|
292
|
+
"ownsBehaviours": [],
|
|
293
|
+
"status": "stable",
|
|
294
|
+
"migrationStage": null,
|
|
295
|
+
"docsId": null,
|
|
296
|
+
"storyId": null,
|
|
297
|
+
"docPage": null,
|
|
298
|
+
"app": null,
|
|
299
|
+
"looks": []
|
|
300
|
+
},
|
|
282
301
|
{
|
|
283
302
|
"name": "AttachmentCard",
|
|
284
303
|
"repo": "estiva-ui",
|
|
@@ -4188,6 +4207,38 @@
|
|
|
4188
4207
|
"border-border-tooltip-key bg-bg-tooltip-key text-text-tooltip-key signal:bg-bg-tooltip-key ship:bg-bg-tooltip-key"
|
|
4189
4208
|
]
|
|
4190
4209
|
},
|
|
4210
|
+
{
|
|
4211
|
+
"name": "keepCommentBoxWarm",
|
|
4212
|
+
"repo": "estiva-ui",
|
|
4213
|
+
"kind": "helper",
|
|
4214
|
+
"importPath": "@estiva-app/ui/editor",
|
|
4215
|
+
"sourceFile": "src/CommentBox.tsx",
|
|
4216
|
+
"purpose": "Keeps an editor built ahead for the next empty box given these `extensions` and `referenceView`, so it opens at once.",
|
|
4217
|
+
"purposeFrom": "comment",
|
|
4218
|
+
"props": [
|
|
4219
|
+
{
|
|
4220
|
+
"name": "extensions",
|
|
4221
|
+
"takes": "readonly AnyExtension[]",
|
|
4222
|
+
"required": false,
|
|
4223
|
+
"note": null
|
|
4224
|
+
},
|
|
4225
|
+
{
|
|
4226
|
+
"name": "referenceView",
|
|
4227
|
+
"takes": "ComponentType<ReferenceViewProps>",
|
|
4228
|
+
"required": false,
|
|
4229
|
+
"note": null
|
|
4230
|
+
}
|
|
4231
|
+
],
|
|
4232
|
+
"variants": [],
|
|
4233
|
+
"ownsBehaviours": [],
|
|
4234
|
+
"status": "stable",
|
|
4235
|
+
"migrationStage": null,
|
|
4236
|
+
"docsId": "primitives-commentbox--docs",
|
|
4237
|
+
"storyId": "primitives-commentbox--empty",
|
|
4238
|
+
"docPage": null,
|
|
4239
|
+
"app": null,
|
|
4240
|
+
"looks": []
|
|
4241
|
+
},
|
|
4191
4242
|
{
|
|
4192
4243
|
"name": "keepSelection",
|
|
4193
4244
|
"repo": "estiva-ui",
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The line in the comment box's place on an archived file names what to
|
|
3
|
+
* unarchive: the file itself, or the closest archived one above it by its kind
|
|
4
|
+
* (PEEKM-2, record a-file-is-archived-with-the-closest-archived-file-above-it).
|
|
5
|
+
*/
|
|
6
|
+
import { describe, expect, it } from 'vitest'
|
|
7
|
+
import { archivedLine } from './archivedLine'
|
|
8
|
+
|
|
9
|
+
const ABOVE = '30023:aaaa:plan'
|
|
10
|
+
|
|
11
|
+
describe('archivedLine', () => {
|
|
12
|
+
it('says nothing for a file that is not archived', () => {
|
|
13
|
+
expect(archivedLine(undefined, 'page')).toBeUndefined()
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
it('tells a person to unarchive the file itself when it is archived itself', () => {
|
|
17
|
+
expect(archivedLine({}, 'page')).toBe('Archived. Unarchive it to comment.')
|
|
18
|
+
})
|
|
19
|
+
|
|
20
|
+
it('names the closest archived file above by its kind', () => {
|
|
21
|
+
expect(archivedLine({ with: ABOVE }, 'page')).toBe('Unarchive the page to comment.')
|
|
22
|
+
expect(archivedLine({ with: ABOVE }, 'project')).toBe('Unarchive the project to comment.')
|
|
23
|
+
expect(archivedLine({ with: ABOVE }, 'PDF')).toBe('Unarchive the PDF to comment.')
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
it('writes Folder as a proper noun', () => {
|
|
27
|
+
expect(archivedLine({ with: ABOVE }, 'folder')).toBe('Unarchive the Folder to comment.')
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
it('still says what to do when the app has no noun for what is above', () => {
|
|
31
|
+
expect(archivedLine({ with: ABOVE })).toBe('Unarchive the parent to comment.')
|
|
32
|
+
expect(archivedLine({ with: ABOVE }, ' ')).toBe('Unarchive the parent to comment.')
|
|
33
|
+
})
|
|
34
|
+
})
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* archivedLine, the one sentence every app shows on an archived file (PEEKM-2).
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* The line in the comment box's place on an archived file (CommentBox's
|
|
7
|
+
* `closed.reason`), in every app's words alike.
|
|
8
|
+
*
|
|
9
|
+
* A file archived itself says so; one archived with a file above it names the
|
|
10
|
+
* closest archived one by its kind — "Unarchive the page to comment." — so a
|
|
11
|
+
* person unarchives the right thing, and once it is unarchived the next one up
|
|
12
|
+
* is named. Which file that is comes from interop: `archive.with` is its
|
|
13
|
+
* address, and the app reads its noun.
|
|
14
|
+
*
|
|
15
|
+
* why: https://github.com/estiva-app/estiva-docs/blob/main/decisions/a-file-is-archived-with-the-closest-archived-file-above-it.md
|
|
16
|
+
*/
|
|
17
|
+
export function archivedLine(archive: { with?: string } | undefined, noun?: string): string | undefined {
|
|
18
|
+
if (!archive) return undefined
|
|
19
|
+
if (!archive.with) return 'Archived. Unarchive it to comment.'
|
|
20
|
+
// A noun arrives as the manifest wrote it; a Folder is a proper noun in every
|
|
21
|
+
// app's copy. With no noun, Peek's ArchivedNotice word.
|
|
22
|
+
const word = noun?.trim()
|
|
23
|
+
return `Unarchive the ${word === 'folder' ? 'Folder' : word || 'parent'} to comment.`
|
|
24
|
+
}
|
package/src/editor.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -48,20 +48,20 @@ 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 210 names over 98 files: 139 components, 68 helpers and 3 hooks (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: 139, helper:
|
|
58
|
-
expect(new Set(registry.entries.map((one) => one.sourceFile)).size).toBe(
|
|
57
|
+
expect(kinds).toEqual({ component: 139, helper: 68, hook: 3 })
|
|
58
|
+
expect(new Set(registry.entries.map((one) => one.sourceFile)).size).toBe(98)
|
|
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
63
|
expect(registry.entries.filter((one) => one.purposeFrom === 'page').length).toBe(90)
|
|
64
|
-
expect(registry.entries.filter((one) => one.purposeFrom === 'comment').length).toBe(
|
|
64
|
+
expect(registry.entries.filter((one) => one.purposeFrom === 'comment').length).toBe(120)
|
|
65
65
|
})
|
|
66
66
|
|
|
67
67
|
it('takes a name with a page of its own from the page, and a name without one from the code', () => {
|
|
@@ -263,7 +263,7 @@ describe('the ids point at something', () => {
|
|
|
263
263
|
it('gives every component a page and a story, and only a helper none', () => {
|
|
264
264
|
const without = registry.entries.filter((one) => one.docsId === null || one.storyId === null)
|
|
265
265
|
// The helpers in a file with no page: cn, the shortcut names, the editor's suggestion wiring (documented on SuggestionMenu's page), and the link widgets' data helpers (documented on LinkCard's and LinkChip's pages; linkedFrom's on LinkCard's).
|
|
266
|
-
expect(without.map((one) => one.name).sort()).toEqual(['chosenOf', 'cn', 'isApplePlatform', 'isSuggestionActive', 'isSuggestionOpen', 'linkStateFrom', 'linkedFrom', 'loadingShapeOf', 'shortcutLabel', 'suggestionPopup', 'unavailableMemory'])
|
|
266
|
+
expect(without.map((one) => one.name).sort()).toEqual(['archivedLine', 'chosenOf', 'cn', 'isApplePlatform', 'isSuggestionActive', 'isSuggestionOpen', 'linkStateFrom', 'linkedFrom', 'loadingShapeOf', 'shortcutLabel', 'suggestionPopup', 'unavailableMemory'])
|
|
267
267
|
expect(without.every((one) => one.kind !== 'component')).toBe(true)
|
|
268
268
|
})
|
|
269
269
|
|