@estiva-app/ui 0.62.1 → 0.64.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.
Files changed (54) hide show
  1. package/dist/CodeBlockColours.d.ts +11 -0
  2. package/dist/CodeBlockColours.d.ts.map +1 -0
  3. package/dist/ComposerTriggers.d.ts +8 -2
  4. package/dist/ComposerTriggers.d.ts.map +1 -1
  5. package/dist/KindIcon.d.ts +30 -0
  6. package/dist/KindIcon.d.ts.map +1 -0
  7. package/dist/Link.d.ts +1 -1
  8. package/dist/PastedImages.d.ts +33 -0
  9. package/dist/PastedImages.d.ts.map +1 -0
  10. package/dist/RichText.d.ts +2 -1
  11. package/dist/RichText.d.ts.map +1 -1
  12. package/dist/codeColours.d.ts +29 -0
  13. package/dist/codeColours.d.ts.map +1 -0
  14. package/dist/editor.d.ts +2 -0
  15. package/dist/editor.d.ts.map +1 -1
  16. package/dist/editor.js +86 -13
  17. package/dist/editor.js.map +4 -4
  18. package/dist/eslint/index.js +1 -0
  19. package/dist/eslint/index.js.map +2 -2
  20. package/dist/eslint/no-restyled-part.d.ts.map +1 -1
  21. package/dist/index.d.ts +1 -0
  22. package/dist/index.d.ts.map +1 -1
  23. package/dist/index.js +291 -237
  24. package/dist/index.js.map +4 -4
  25. package/package.json +8 -2
  26. package/registry.json +179 -16
  27. package/src/CodeBlockColours.mdx +48 -0
  28. package/src/CodeBlockColours.stories.tsx +37 -0
  29. package/src/CodeBlockColours.ts +14 -0
  30. package/src/ComposerTriggers.mdx +6 -4
  31. package/src/ComposerTriggers.test.tsx +30 -0
  32. package/src/ComposerTriggers.tsx +9 -3
  33. package/src/KindIcon.mdx +58 -0
  34. package/src/KindIcon.stories.tsx +64 -0
  35. package/src/KindIcon.tsx +64 -0
  36. package/src/Link.mdx +1 -1
  37. package/src/Link.stories.tsx +1 -1
  38. package/src/Link.test.tsx +2 -2
  39. package/src/Link.tsx +2 -2
  40. package/src/PastedImages.mdx +61 -0
  41. package/src/PastedImages.stories.tsx +53 -0
  42. package/src/PastedImages.test.ts +83 -0
  43. package/src/PastedImages.ts +105 -0
  44. package/src/RichText.stories.tsx +24 -0
  45. package/src/RichText.tsx +31 -17
  46. package/src/codeColours.ts +33 -0
  47. package/src/editor.ts +2 -0
  48. package/src/eslint/no-restyled-part.ts +1 -0
  49. package/src/index.ts +1 -0
  50. package/src/pages.test.ts +5 -1
  51. package/src/registry/registry.test.ts +7 -7
  52. package/stories/Choosing.mdx +3 -0
  53. package/tailwind-preset.js +8 -0
  54. package/tokens.css +50 -0
@@ -26,7 +26,7 @@ import { SCHEMA_VERSION, validateRegistry, type Registry, type RegistryEntry } f
26
26
  const root = process.cwd()
27
27
  const registry = buildRegistry({ root })
28
28
  /** Editor extensions: named like components by the catalogue, and not React components. */
29
- const EDITOR_EXTENSIONS = ['KeptSelection', 'BlockId', 'UnknownBlock', 'ReferenceNode', 'AttachmentNode', 'PersonMention', 'UrgentPersonMention', 'CaptionedReference', 'ReferenceTrigger', 'SlashCommands']
29
+ const EDITOR_EXTENSIONS = ['KeptSelection', 'BlockId', 'UnknownBlock', 'ReferenceNode', 'AttachmentNode', 'PersonMention', 'UrgentPersonMention', 'CaptionedReference', 'ReferenceTrigger', 'SlashCommands', 'PastedImages', 'CodeBlockColours']
30
30
  const entry = (name: string): RegistryEntry => {
31
31
  const found = registry.entries.find((candidate) => candidate.name === name)
32
32
  if (!found) throw new Error(`no entry for ${name}`)
@@ -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 134 names over 73 files: 104 components, 29 helpers and 1 hook (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, and AppProvider on 8 October)', () => {
51
+ it('counts 140 names over 76 files: 107 components, 32 helpers and 1 hook (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)', () => {
52
52
  // The reconciliation GATES.md §24 explains. If this changes, that changes.
53
- // The ten `EDITOR_EXTENSIONS` count as components by their names; they are
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: 104, helper: 29, hook: 1 })
58
- expect(new Set(registry.entries.map((one) => one.sourceFile)).size).toBe(73)
57
+ expect(kinds).toEqual({ component: 107, helper: 32, hook: 1 })
58
+ expect(new Set(registry.entries.map((one) => one.sourceFile)).size).toBe(76)
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(69)
64
- expect(registry.entries.filter((one) => one.purposeFrom === 'comment').length).toBe(65)
63
+ expect(registry.entries.filter((one) => one.purposeFrom === 'page').length).toBe(72)
64
+ expect(registry.entries.filter((one) => one.purposeFrom === 'comment').length).toBe(68)
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', () => {
@@ -96,7 +96,10 @@ fork freely, owe nothing back, mention it on the package's ticket.
96
96
  | Where am I, and the way back up | **Breadcrumb** |
97
97
  | A link — in text, on a title, beside a note, or a whole box | **Link** — `text`, `quiet`, `underlined`, `plain`; `external` for a new tab |
98
98
  | A document or an image attached to something, posted or waiting to be sent | **AttachmentCard** — the file decides the shape; `pending` in a composer |
99
+ | A picture pasted into an editor, attached rather than pasted | **PastedImages** — from `@estiva-app/ui/editor`; the app hands it its upload |
100
+ | A code block in an editor, coloured by its language as you type | **CodeBlockColours** — from `@estiva-app/ui/editor`, in place of the starter kit's code block |
99
101
  | A person or a thing named inside a sentence | **InlineChip** — one line high, level with the words; `href` makes it a link |
102
+ | What kind of thing a name stands for — a topic, a project, an issue, a file, a message | **KindIcon** — before the name in a row, or inside an **InlineChip**; `thingKindOf` turns an event kind into one |
100
103
  | Formatted text: headings, lists, a quote, code, a table, links | **RichText** — pass the parsed tree; `small` inside a card |
101
104
  | The key that does this too | **Kbd** — or the `shortcut` prop on **MenuItem**, **Tooltip** and **SearchInput** |
102
105
 
@@ -155,6 +155,14 @@ export default {
155
155
  'bg-tooltip-key': 'var(--bg-tooltip-key)',
156
156
  'bg-field': 'var(--bg-field)',
157
157
  'bg-code': 'var(--bg-code)',
158
+ 'text-code': 'var(--text-code)',
159
+ 'syntax-keyword': 'var(--syntax-keyword)',
160
+ 'syntax-function': 'var(--syntax-function)',
161
+ 'syntax-constant': 'var(--syntax-constant)',
162
+ 'syntax-string': 'var(--syntax-string)',
163
+ 'syntax-variable': 'var(--syntax-variable)',
164
+ 'syntax-comment': 'var(--syntax-comment)',
165
+ 'syntax-tag': 'var(--syntax-tag)',
158
166
  // text
159
167
  'text-primary': 'var(--text-primary)',
160
168
  'text-secondary': 'var(--text-secondary)',
package/tokens.css CHANGED
@@ -101,6 +101,16 @@
101
101
  /* Code, in a sentence and as a block, and a table's header row (RichText, UIG-30).
102
102
  Here, the hover fill: bg-active, #D4D4D8, was the darkest thing on a white card (Katerina, 28 September). */
103
103
  --bg-code: #E9E9EB;
104
+ /* Inline code's text: amber, on --bg-code (Katerina, 9 October: option I). Darker than the warning amber, which is 3.8 : 1 on the code fill; this is 4.8. */
105
+ --text-code: #855f00;
106
+ /* Colours inside a code block, by language (Katerina, 9 October). GitHub's light set; the keyword one shade darker (#cf222e is 4.4 : 1 on our fill, this 4.9). */
107
+ --syntax-keyword: #c21f2b;
108
+ --syntax-function: #6639ba;
109
+ --syntax-constant: #0550ae;
110
+ --syntax-string: #0a3069;
111
+ --syntax-variable: #953800;
112
+ --syntax-comment: #59636e;
113
+ --syntax-tag: #116329;
104
114
  }
105
115
 
106
116
  /* ─── dark ─── Peek's dark theme (peek/src/index.css .dark, 2026-08-28). */
@@ -184,6 +194,16 @@
184
194
  /* Code, in a sentence and as a block, and a table's header row (RichText, UIG-30).
185
195
  Here, bg-active, as Peek draws code (Katerina, 28 September). */
186
196
  --bg-code: #2D2D31;
197
+ /* Inline code's text: amber, on --bg-code (Katerina, 9 October: option I). Amber 400, as on GitHub's dark ground. */
198
+ --text-code: #fbbf24;
199
+ /* Colours inside a code block, by language (Katerina, 9 October). GitHub's dark set. */
200
+ --syntax-keyword: #ff7b72;
201
+ --syntax-function: #d2a8ff;
202
+ --syntax-constant: #79c0ff;
203
+ --syntax-string: #a5d6ff;
204
+ --syntax-variable: #ffa657;
205
+ --syntax-comment: #9198a1;
206
+ --syntax-tag: #7ee787;
187
207
  }
188
208
 
189
209
 
@@ -271,6 +291,16 @@
271
291
  /* Code, in a sentence and as a block, and a table's header row (RichText, UIG-30).
272
292
  Here, bg-active, as Peek draws code (Katerina, 28 September). */
273
293
  --bg-code: rgba(255, 255, 255, 0.08);
294
+ /* Inline code's text: amber, on --bg-code (Katerina, 9 October: option I). Signal's warning amber. */
295
+ --text-code: #ffb020;
296
+ /* Colours inside a code block, by language (Katerina, 9 October). GitHub's dark set. */
297
+ --syntax-keyword: #ff7b72;
298
+ --syntax-function: #d2a8ff;
299
+ --syntax-constant: #79c0ff;
300
+ --syntax-string: #a5d6ff;
301
+ --syntax-variable: #ffa657;
302
+ --syntax-comment: #9198a1;
303
+ --syntax-tag: #7ee787;
274
304
  }
275
305
 
276
306
  /* ─── ship ─── Ship's palette (Katerina's ruling, 2026-08-28; ship/web/src/index.css). */
@@ -372,6 +402,16 @@
372
402
  /* Code, in a sentence and as a block, and a table's header row (RichText, UIG-30).
373
403
  Here, bg-active, as Peek draws code (Katerina, 28 September). */
374
404
  --bg-code: rgba(255, 255, 255, 0.08);
405
+ /* Inline code's text: amber, on --bg-code (Katerina, 9 October: option I). Ship's warning amber. */
406
+ --text-code: #e0b04a;
407
+ /* Colours inside a code block, by language (Katerina, 9 October). GitHub's dark set. */
408
+ --syntax-keyword: #ff7b72;
409
+ --syntax-function: #d2a8ff;
410
+ --syntax-constant: #79c0ff;
411
+ --syntax-string: #a5d6ff;
412
+ --syntax-variable: #ffa657;
413
+ --syntax-comment: #9198a1;
414
+ --syntax-tag: #7ee787;
375
415
  }
376
416
 
377
417
  /* ─── leaf ─── Leaf's theme: Linear's light theme on these same tokens (Katerina,
@@ -465,4 +505,14 @@
465
505
  /* Code, in a sentence and as a block, and a table's header row (RichText, UIG-30).
466
506
  Here, the inset fill: lighter than bg-active on a white card (Katerina, 28 September). */
467
507
  --bg-code: #e9e9ea;
508
+ /* Inline code's text: amber, on --bg-code (Katerina, 9 October: option I). Darker than Leaf's warning amber (#967000, 3.8 : 1 on the code fill); this is 4.8. */
509
+ --text-code: #855f00;
510
+ /* Colours inside a code block, by language (Katerina, 9 October). GitHub's light set; the keyword one shade darker (#cf222e is 4.4 : 1 on our fill, this 4.9). */
511
+ --syntax-keyword: #c21f2b;
512
+ --syntax-function: #6639ba;
513
+ --syntax-constant: #0550ae;
514
+ --syntax-string: #0a3069;
515
+ --syntax-variable: #953800;
516
+ --syntax-comment: #59636e;
517
+ --syntax-tag: #116329;
468
518
  }