@estiva-app/ui 0.88.1 → 0.89.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@estiva-app/ui",
3
- "version": "0.88.1",
3
+ "version": "0.89.0",
4
4
  "description": "Estiva's design tokens (the contract) and a small set of primitives (a convenience) for every Estiva app.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -133,8 +133,8 @@
133
133
  },
134
134
  "devDependencies": {
135
135
  "@eslint/js": "^10.0.1",
136
- "@estiva-app/conversation": "^0.17.0",
137
- "@estiva-app/protocol": "^0.41.0",
136
+ "@estiva-app/conversation": "^0.22.0",
137
+ "@estiva-app/protocol": "^0.45.0",
138
138
  "@storybook/addon-a11y": "^10.6.0",
139
139
  "@storybook/addon-docs": "^10.5.10",
140
140
  "@storybook/addon-vitest": "^10.6.0",
package/registry.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "kind": "package",
5
5
  "repo": "estiva-ui",
6
6
  "package": "@estiva-app/ui",
7
- "packageVersion": "0.88.1",
7
+ "packageVersion": "0.89.0",
8
8
  "exports": 210,
9
9
  "typeExports": 211,
10
10
  "files": null
@@ -1,6 +1,9 @@
1
1
  /**
2
2
  * archivedLine, the one sentence every app shows on an archived file (PEEKM-2).
3
+ * It lives in @estiva-app/conversation since PEEKM-8, so the agent prints the
4
+ * same words; this package hands it on unchanged.
3
5
  */
6
+ import { archivedLine as sentence } from '@estiva-app/conversation'
4
7
 
5
8
  /**
6
9
  * The line in the comment box's place on an archived file (CommentBox's
@@ -8,17 +11,17 @@
8
11
  *
9
12
  * A file archived itself says so; one archived with a file above it names the
10
13
  * 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
+ * person unarchives the right thing. `options.in` names where to unarchive, for
15
+ * an app with no Unarchive of its own; `options.to` is what waits, "comment"
16
+ * unless said.
17
+ *
18
+ * Typed here rather than inferred, so this package's types never point at
19
+ * @estiva-app/conversation (bundled, not a dependency of an app's).
14
20
  *
15
21
  * why: https://github.com/estiva-app/estiva-docs/blob/main/decisions/a-file-is-archived-with-the-closest-archived-file-above-it.md
16
22
  */
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
- }
23
+ export const archivedLine: (
24
+ archive: { with?: string } | undefined,
25
+ noun?: string,
26
+ options?: { in?: string; to?: string },
27
+ ) => string | undefined = sentence
@@ -1,34 +0,0 @@
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
- })