@estiva-app/ui 0.96.0 → 0.97.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 (49) hide show
  1. package/dist/Avatar.d.ts +6 -1
  2. package/dist/Avatar.d.ts.map +1 -1
  3. package/dist/AvatarGroup.d.ts +2 -0
  4. package/dist/AvatarGroup.d.ts.map +1 -1
  5. package/dist/ComposerTriggers.d.ts +2 -0
  6. package/dist/ComposerTriggers.d.ts.map +1 -1
  7. package/dist/ConversationCard.d.ts +2 -0
  8. package/dist/ConversationCard.d.ts.map +1 -1
  9. package/dist/LinkParts.d.ts +1 -0
  10. package/dist/LinkParts.d.ts.map +1 -1
  11. package/dist/MembersDialog.d.ts +4 -0
  12. package/dist/MembersDialog.d.ts.map +1 -1
  13. package/dist/Person.d.ts +3 -1
  14. package/dist/Person.d.ts.map +1 -1
  15. package/dist/PersonTrigger.d.ts +1 -1
  16. package/dist/PersonTrigger.d.ts.map +1 -1
  17. package/dist/RepliesRow.d.ts +1 -0
  18. package/dist/RepliesRow.d.ts.map +1 -1
  19. package/dist/editor.js +1 -1
  20. package/dist/editor.js.map +2 -2
  21. package/dist/index.js +47 -26
  22. package/dist/index.js.map +2 -2
  23. package/dist/linked.d.ts +4 -0
  24. package/dist/linked.d.ts.map +1 -1
  25. package/dist/linkedFrom.d.ts +2 -0
  26. package/dist/linkedFrom.d.ts.map +1 -1
  27. package/package.json +1 -1
  28. package/registry.json +20 -2
  29. package/src/Avatar.agent.test.tsx +63 -0
  30. package/src/Avatar.mdx +25 -0
  31. package/src/Avatar.stories.tsx +13 -0
  32. package/src/Avatar.tsx +51 -3
  33. package/src/AvatarGroup.tsx +3 -1
  34. package/src/ComposerTriggers.stories.tsx +2 -0
  35. package/src/ComposerTriggers.tsx +3 -1
  36. package/src/ConversationCard.tsx +4 -2
  37. package/src/LinkCard.tsx +3 -3
  38. package/src/LinkChip.tsx +1 -1
  39. package/src/LinkParts.tsx +4 -4
  40. package/src/LinkRow.tsx +1 -1
  41. package/src/MembersDialog.stories.tsx +11 -0
  42. package/src/MembersDialog.tsx +7 -3
  43. package/src/Person.tsx +4 -2
  44. package/src/PersonTrigger.tsx +3 -3
  45. package/src/PinnedComment.tsx +1 -1
  46. package/src/RepliesRow.tsx +2 -2
  47. package/src/linked.ts +4 -0
  48. package/src/linkedFrom.ts +5 -3
  49. package/src/registry/registry.test.ts +2 -1
package/src/linked.ts CHANGED
@@ -34,6 +34,8 @@ export interface LinkedStatus {
34
34
  export interface LinkedPerson {
35
35
  name: string
36
36
  picture?: string
37
+ /** An agent: its face is a robot, as Avatar's `bot`. */
38
+ bot?: boolean
37
39
  }
38
40
 
39
41
  /** One choice a picker offers. */
@@ -44,6 +46,8 @@ export interface PickerOption {
44
46
  colour?: StatusColour
45
47
  /** A person's picture: the option draws their face. */
46
48
  picture?: string
49
+ /** An agent: its face is a robot, as Avatar's `bot`. */
50
+ bot?: boolean
47
51
  }
48
52
 
49
53
  /**
package/src/linkedFrom.ts CHANGED
@@ -16,6 +16,8 @@ import type { LinkState, Linked, LinkedChild, LinkedConversation, LinkedKind, Li
16
16
  export interface LinkedProfile {
17
17
  displayName?: string
18
18
  picture?: string
19
+ /** NIP-24's `bot`: the profile is an agent's. */
20
+ bot?: boolean
19
21
  }
20
22
 
21
23
  /** One of interop's resolved slots. */
@@ -178,7 +180,7 @@ function childrenOf<T extends LinkedSource>(object: T, options: LinkedFromOption
178
180
  href: options.hrefOf(child, false),
179
181
  ...(key ? { key } : {}),
180
182
  status: { label: status?.value ?? nounOf(child) ?? 'File', colour: colourOf(status?.colour) ?? 'muted' },
181
- ...(person?.displayName ? { owner: { name: person.displayName, ...(person.picture ? { picture: person.picture } : {}) } } : {}),
183
+ ...(person?.displayName ? { owner: { name: person.displayName, ...(person.picture ? { picture: person.picture } : {}), ...(person.bot ? { bot: true } : {}) } } : {}),
182
184
  }
183
185
  })
184
186
  }
@@ -238,7 +240,7 @@ function ownerOf(object: LinkedSource, options: Pick<LinkedFromOptions, 'directo
238
240
  if (!slot) return undefined
239
241
  const person = people?.[slot.value]
240
242
  return {
241
- owner: { value: slot.value, options: [{ value: slot.value, label: person?.displayName ?? '—', ...(person?.picture ? { picture: person.picture } : {}) }] },
243
+ owner: { value: slot.value, options: [{ value: slot.value, label: person?.displayName ?? '—', ...(person?.picture ? { picture: person.picture } : {}), ...(person?.bot ? { bot: true } : {}) }] },
242
244
  ...(slot.label ? { ownerLabel: slot.label } : {}),
243
245
  }
244
246
  }
@@ -273,7 +275,7 @@ export function linkedFrom<T extends LinkedSource>(object: T, options: LinkedFro
273
275
  kind: 'message',
274
276
  title: name,
275
277
  href,
276
- author: { name, ...(person?.picture ? { picture: person.picture } : {}) },
278
+ author: { name, ...(person?.picture ? { picture: person.picture } : {}), ...(person?.bot ? { bot: true } : {}) },
277
279
  ...(body ? { body } : {}),
278
280
  ...(updated ? { updated } : {}),
279
281
  }
@@ -363,7 +363,7 @@ describe('a second parser agrees', async () => {
363
363
  const INHERITED_WITH_A_DEFAULT = new Set(['Button.type', 'IconButton.type', 'TextInput.type', 'SearchInput.placeholder'])
364
364
 
365
365
  /**
366
- * The eighteen where **this registry is right and `react-docgen` is not**.
366
+ * The nineteen where **this registry is right and `react-docgen` is not**.
367
367
  *
368
368
  * `IdentityPanelProps extends Omit<IdentityMenuProps, 'compact'>` and
369
369
  * `PersonTriggerProps extends Omit<PersonProps, 'className'>`: docgen does not
@@ -388,6 +388,7 @@ const DOCGEN_STOPS_AT_OMIT = new Set([
388
388
  'IdentityPanel.children',
389
389
  'PersonTrigger.name',
390
390
  'PersonTrigger.picture',
391
+ 'PersonTrigger.bot',
391
392
  'PersonTrigger.fallback',
392
393
  'PersonTrigger.size',
393
394
  'ToolbarLink.variant',