@estiva-app/ui 0.96.0 → 0.98.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/Avatar.d.ts +6 -1
- package/dist/Avatar.d.ts.map +1 -1
- package/dist/AvatarGroup.d.ts +2 -0
- package/dist/AvatarGroup.d.ts.map +1 -1
- package/dist/ComposerTriggers.d.ts +2 -0
- package/dist/ComposerTriggers.d.ts.map +1 -1
- package/dist/ConversationCard.d.ts +26 -6
- package/dist/ConversationCard.d.ts.map +1 -1
- package/dist/ConversationLayout.d.ts +18 -6
- package/dist/ConversationLayout.d.ts.map +1 -1
- package/dist/ConversationMenu.d.ts +14 -5
- package/dist/ConversationMenu.d.ts.map +1 -1
- package/dist/LinkParts.d.ts +1 -0
- package/dist/LinkParts.d.ts.map +1 -1
- package/dist/MembersDialog.d.ts +4 -0
- package/dist/MembersDialog.d.ts.map +1 -1
- package/dist/Person.d.ts +3 -1
- package/dist/Person.d.ts.map +1 -1
- package/dist/PersonTrigger.d.ts +1 -1
- package/dist/PersonTrigger.d.ts.map +1 -1
- package/dist/RepliesRow.d.ts +1 -0
- package/dist/RepliesRow.d.ts.map +1 -1
- package/dist/Thread.d.ts +9 -2
- package/dist/Thread.d.ts.map +1 -1
- package/dist/editor.js +1 -1
- package/dist/editor.js.map +2 -2
- package/dist/index.js +196 -92
- package/dist/index.js.map +3 -3
- package/dist/linked.d.ts +4 -0
- package/dist/linked.d.ts.map +1 -1
- package/dist/linkedFrom.d.ts +2 -0
- package/dist/linkedFrom.d.ts.map +1 -1
- package/package.json +1 -1
- package/registry.json +153 -19
- package/src/Avatar.agent.test.tsx +63 -0
- package/src/Avatar.mdx +25 -0
- package/src/Avatar.stories.tsx +13 -0
- package/src/Avatar.tsx +51 -3
- package/src/AvatarGroup.tsx +3 -1
- package/src/ComposerTriggers.stories.tsx +2 -0
- package/src/ComposerTriggers.tsx +3 -1
- package/src/ConversationCard.mdx +3 -2
- package/src/ConversationCard.states.test.tsx +25 -5
- package/src/ConversationCard.stories.tsx +3 -3
- package/src/ConversationCard.test.tsx +4 -4
- package/src/ConversationCard.tsx +60 -38
- package/src/ConversationLayout.mdx +12 -0
- package/src/ConversationLayout.stories.tsx +47 -0
- package/src/ConversationLayout.test.tsx +100 -0
- package/src/ConversationLayout.tsx +98 -20
- package/src/ConversationMenu.mdx +5 -2
- package/src/ConversationMenu.stories.tsx +19 -1
- package/src/ConversationMenu.test.tsx +17 -4
- package/src/ConversationMenu.tsx +37 -16
- package/src/LinkCard.tsx +3 -3
- package/src/LinkChip.tsx +1 -1
- package/src/LinkParts.tsx +4 -4
- package/src/LinkRow.tsx +1 -1
- package/src/MembersDialog.stories.tsx +11 -0
- package/src/MembersDialog.tsx +7 -3
- package/src/Person.tsx +4 -2
- package/src/PersonTrigger.tsx +3 -3
- package/src/PinnedComment.tsx +1 -1
- package/src/RepliesRow.tsx +2 -2
- package/src/Thread.mdx +2 -0
- package/src/Thread.test.tsx +17 -0
- package/src/Thread.tsx +32 -8
- package/src/linked.ts +4 -0
- package/src/linkedFrom.test.tsx +18 -0
- package/src/linkedFrom.ts +7 -5
- package/src/registry/registry.test.ts +2 -1
- package/stories/Choosing.mdx +1 -1
package/dist/linked.d.ts
CHANGED
|
@@ -18,6 +18,8 @@ export interface LinkedStatus {
|
|
|
18
18
|
export interface LinkedPerson {
|
|
19
19
|
name: string;
|
|
20
20
|
picture?: string;
|
|
21
|
+
/** An agent: its face is a robot, as Avatar's `bot`. */
|
|
22
|
+
bot?: boolean;
|
|
21
23
|
}
|
|
22
24
|
/** One choice a picker offers. */
|
|
23
25
|
export interface PickerOption {
|
|
@@ -27,6 +29,8 @@ export interface PickerOption {
|
|
|
27
29
|
colour?: StatusColour;
|
|
28
30
|
/** A person's picture: the option draws their face. */
|
|
29
31
|
picture?: string;
|
|
32
|
+
/** An agent: its face is a robot, as Avatar's `bot`. */
|
|
33
|
+
bot?: boolean;
|
|
30
34
|
}
|
|
31
35
|
/**
|
|
32
36
|
* A value the reader may be able to change from the card: a status, or who
|
package/dist/linked.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"linked.d.ts","sourceRoot":"","sources":["../src/linked.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAE3C;;;;GAIG;AACH,eAAO,MAAM,QAAQ,kCAAuB,CAAA;AAE5C,wEAAwE;AACxE,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,MAAM,CAAA;AAE3C,sEAAsE;AACtE,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAA;AAEjE,oDAAoD;AACpD,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,YAAY,CAAA;CACrB;AAED,+EAA+E;AAC/E,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,CAAC,EAAE,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"linked.d.ts","sourceRoot":"","sources":["../src/linked.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAE3C;;;;GAIG;AACH,eAAO,MAAM,QAAQ,kCAAuB,CAAA;AAE5C,wEAAwE;AACxE,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,MAAM,CAAA;AAE3C,sEAAsE;AACtE,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,OAAO,CAAA;AAEjE,oDAAoD;AACpD,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,YAAY,CAAA;CACrB;AAED,+EAA+E;AAC/E,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,wDAAwD;IACxD,GAAG,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,UAAU,EAAE,MAAM,EAAE,OAAO,GAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC,CAAA;CAAO,GAAG,eAAe,CA4C5J;AAED;;;;;;GAMG;AACH,MAAM,WAAW,iBAAiB;IAChC,yDAAyD;IACzD,GAAG,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAA;IAC5B,gFAAgF;IAChF,IAAI,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,KAAK,IAAI,CAAA;IAC9C,gBAAgB;IAChB,KAAK,EAAE,MAAM,IAAI,CAAA;CAClB;AAED,oHAAoH;AACpH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,SAAM,GAAG,iBAAiB,CAuCpF"}
|
package/dist/linkedFrom.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ import type { LinkState, Linked, LinkedConversation, LinkedKind } from './linked
|
|
|
3
3
|
export interface LinkedProfile {
|
|
4
4
|
displayName?: string;
|
|
5
5
|
picture?: string;
|
|
6
|
+
/** NIP-24's `bot`: the profile is an agent's. */
|
|
7
|
+
bot?: boolean;
|
|
6
8
|
}
|
|
7
9
|
/** One of interop's resolved slots. */
|
|
8
10
|
export interface LinkedSlot {
|
package/dist/linkedFrom.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"linkedFrom.d.ts","sourceRoot":"","sources":["../src/linkedFrom.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAe,kBAAkB,EAAE,UAAU,EAA4C,MAAM,UAAU,CAAA;AAExI,iEAAiE;AACjE,MAAM,WAAW,aAAa;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,OAAO,CAAC,EAAE,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"linkedFrom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AS,YAAY,EAClD,MAAM,EAAE,CAAC,GAAG,IAAI,GAAG,SAAS,EAC5B,MAAM,EAAE;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,EAC3E,OAAO,EAAE,iBAAiB,CAAC,CAAC,CAAC,GAC5B,SAAS,CAeX"}
|
package/package.json
CHANGED
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.
|
|
7
|
+
"packageVersion": "0.98.0",
|
|
8
8
|
"exports": 229,
|
|
9
9
|
"typeExports": 234,
|
|
10
10
|
"files": null
|
|
@@ -615,6 +615,12 @@
|
|
|
615
615
|
"required": false,
|
|
616
616
|
"note": "Say the person's name out loud, for a face that stands on its own — `PersonTrigger`'s compact shape, a stack of members."
|
|
617
617
|
},
|
|
618
|
+
{
|
|
619
|
+
"name": "bot",
|
|
620
|
+
"takes": "true/false",
|
|
621
|
+
"required": false,
|
|
622
|
+
"note": "An agent's face: a robot in place of the initials, for a profile that says it is an agent (NIP-24's `bot`)."
|
|
623
|
+
},
|
|
618
624
|
{
|
|
619
625
|
"name": "className",
|
|
620
626
|
"takes": "text",
|
|
@@ -2656,7 +2662,19 @@
|
|
|
2656
2662
|
"name": "resolved",
|
|
2657
2663
|
"takes": "{ by: string; note?: string; at?: string }",
|
|
2658
2664
|
"required": false,
|
|
2659
|
-
"note": "Resolved, by whom, with what note and when (`at`, in the app's words)."
|
|
2665
|
+
"note": "Resolved, by whom, with what note and when (`at`, in the app's words): \"✓ Resolved\" by the time, who and the note on hover; \"Person two → the note · time\" above the replies row."
|
|
2666
|
+
},
|
|
2667
|
+
{
|
|
2668
|
+
"name": "noun",
|
|
2669
|
+
"takes": "text",
|
|
2670
|
+
"required": false,
|
|
2671
|
+
"note": "What the comment is called in the delete question: \"Delete this comment?\" by default."
|
|
2672
|
+
},
|
|
2673
|
+
{
|
|
2674
|
+
"name": "resolveHint",
|
|
2675
|
+
"takes": "text",
|
|
2676
|
+
"required": false,
|
|
2677
|
+
"note": "Beside Resolve in the ⋯ menu, how the app's box resolves too, as its key hint: Peek's \"->\"."
|
|
2660
2678
|
},
|
|
2661
2679
|
{
|
|
2662
2680
|
"name": "onResolve",
|
|
@@ -2706,6 +2724,12 @@
|
|
|
2706
2724
|
"required": false,
|
|
2707
2725
|
"note": "A link to it: the time is then the link, \"Link to this\", as a reply's is."
|
|
2708
2726
|
},
|
|
2727
|
+
{
|
|
2728
|
+
"name": "timeLabel",
|
|
2729
|
+
"takes": "text",
|
|
2730
|
+
"required": false,
|
|
2731
|
+
"note": "The time's tooltip when it is a link, in the app's words: \"Link to this\" by default; Peek's \"Link to this message\"."
|
|
2732
|
+
},
|
|
2709
2733
|
{
|
|
2710
2734
|
"name": "edited",
|
|
2711
2735
|
"takes": "text",
|
|
@@ -2794,13 +2818,31 @@
|
|
|
2794
2818
|
"name": "deleteNote",
|
|
2795
2819
|
"takes": "anything",
|
|
2796
2820
|
"required": false,
|
|
2797
|
-
"note": "The app's
|
|
2821
|
+
"note": "The app's own words under the delete question, what deleting does there, in place of the kit's: \"It is deleted for everyone.\", and on a comment how many replies stay."
|
|
2798
2822
|
},
|
|
2799
2823
|
{
|
|
2800
2824
|
"name": "menu",
|
|
2801
2825
|
"takes": "anything",
|
|
2802
2826
|
"required": false,
|
|
2803
|
-
"note": "The app's own rows in the ⋯ menu: `MenuItem`s."
|
|
2827
|
+
"note": "The app's own rows in the ⋯ menu, after Resolve: `MenuItem`s."
|
|
2828
|
+
},
|
|
2829
|
+
{
|
|
2830
|
+
"name": "menuAfter",
|
|
2831
|
+
"takes": "anything",
|
|
2832
|
+
"required": false,
|
|
2833
|
+
"note": "The app's own rows in the ⋯ menu after Edit, before Delete: Peek's \"View details\"."
|
|
2834
|
+
},
|
|
2835
|
+
{
|
|
2836
|
+
"name": "menuLabel",
|
|
2837
|
+
"takes": "text",
|
|
2838
|
+
"required": false,
|
|
2839
|
+
"note": "A heading over the menu's first rows, in the app's words: Peek's \"Utilities\"."
|
|
2840
|
+
},
|
|
2841
|
+
{
|
|
2842
|
+
"name": "editLabel",
|
|
2843
|
+
"takes": "text",
|
|
2844
|
+
"required": false,
|
|
2845
|
+
"note": "Edit's words in the ⋯ menu: \"Edit\" by default; Peek's \"Edit message\"."
|
|
2804
2846
|
},
|
|
2805
2847
|
{
|
|
2806
2848
|
"name": "className",
|
|
@@ -2817,9 +2859,7 @@
|
|
|
2817
2859
|
"storyId": "conversation-conversationcard--comment",
|
|
2818
2860
|
"docPage": "src/ConversationCard.mdx",
|
|
2819
2861
|
"app": null,
|
|
2820
|
-
"looks": [
|
|
2821
|
-
"[&>div]:line-clamp-1 [&>div]:max-h-[1lh] [&>div>*:not(p):not(ul):not(ol):not(blockquote):not(pre):not(div:only-child)]:hidden [&>div>div:only-child>*:not(p):not(ul):not(ol):not(blockquote):not(pre)]:hidden"
|
|
2822
|
-
]
|
|
2862
|
+
"looks": []
|
|
2823
2863
|
},
|
|
2824
2864
|
{
|
|
2825
2865
|
"name": "ConversationLayout",
|
|
@@ -2864,7 +2904,19 @@
|
|
|
2864
2904
|
"name": "above",
|
|
2865
2905
|
"takes": "anything",
|
|
2866
2906
|
"required": false,
|
|
2867
|
-
"note": "Above the comments, inside their list:
|
|
2907
|
+
"note": "Above the comments, inside their list: placeholders while older comments are read, a note."
|
|
2908
|
+
},
|
|
2909
|
+
{
|
|
2910
|
+
"name": "below",
|
|
2911
|
+
"takes": "anything",
|
|
2912
|
+
"required": false,
|
|
2913
|
+
"note": "Two columns: under the comments, inside their list, or under the empty line: a `ReactionHorizon`."
|
|
2914
|
+
},
|
|
2915
|
+
{
|
|
2916
|
+
"name": "top",
|
|
2917
|
+
"takes": "anything",
|
|
2918
|
+
"required": false,
|
|
2919
|
+
"note": "Two columns: at the top of the column however few the comments are, over the room a short conversation leaves: an `ArchivedNotice`."
|
|
2868
2920
|
},
|
|
2869
2921
|
{
|
|
2870
2922
|
"name": "loading",
|
|
@@ -2874,9 +2926,21 @@
|
|
|
2874
2926
|
},
|
|
2875
2927
|
{
|
|
2876
2928
|
"name": "empty",
|
|
2877
|
-
"takes": "
|
|
2929
|
+
"takes": "anything",
|
|
2930
|
+
"required": false,
|
|
2931
|
+
"note": "What an empty conversation says: words, or the app's own `EmptyState` (a read that failed says so)."
|
|
2932
|
+
},
|
|
2933
|
+
{
|
|
2934
|
+
"name": "bodyRef",
|
|
2935
|
+
"takes": "Ref<HTMLDivElement>",
|
|
2878
2936
|
"required": false,
|
|
2879
|
-
"note": "
|
|
2937
|
+
"note": "Two columns: the comments' scrolling box, for an app that keeps its own place in it (where it was left, its \"New\" line, following what arrives)."
|
|
2938
|
+
},
|
|
2939
|
+
{
|
|
2940
|
+
"name": "onBodyScroll",
|
|
2941
|
+
"takes": "UIEventHandler<HTMLDivElement>",
|
|
2942
|
+
"required": false,
|
|
2943
|
+
"note": "Two columns: the comments' box scrolled."
|
|
2880
2944
|
},
|
|
2881
2945
|
{
|
|
2882
2946
|
"name": "header",
|
|
@@ -2888,7 +2952,7 @@
|
|
|
2888
2952
|
"name": "title",
|
|
2889
2953
|
"takes": "anything",
|
|
2890
2954
|
"required": false,
|
|
2891
|
-
"note": "
|
|
2955
|
+
"note": "Its name: one column's, in its header. Two columns, said with the message if the column breaks (the page's own bar is `header`)."
|
|
2892
2956
|
},
|
|
2893
2957
|
{
|
|
2894
2958
|
"name": "actions",
|
|
@@ -2927,7 +2991,7 @@
|
|
|
2927
2991
|
"kind": "component",
|
|
2928
2992
|
"importPath": "@estiva-app/ui",
|
|
2929
2993
|
"sourceFile": "src/ConversationMenu.tsx",
|
|
2930
|
-
"purpose": "The ⋯ menu of a comment or a reply: Resolve or Reopen
|
|
2994
|
+
"purpose": "The ⋯ menu of a comment or a reply: Resolve or Reopen and the app's own rows; then Edit on your own; then Delete on your own, apart.",
|
|
2931
2995
|
"purposeFrom": "page",
|
|
2932
2996
|
"props": [
|
|
2933
2997
|
{
|
|
@@ -2948,11 +3012,23 @@
|
|
|
2948
3012
|
"required": false,
|
|
2949
3013
|
"note": null
|
|
2950
3014
|
},
|
|
3015
|
+
{
|
|
3016
|
+
"name": "resolveHint",
|
|
3017
|
+
"takes": "text",
|
|
3018
|
+
"required": false,
|
|
3019
|
+
"note": "Beside Resolve, how the app's box resolves too, as its key hint: Peek's \"->\"."
|
|
3020
|
+
},
|
|
2951
3021
|
{
|
|
2952
3022
|
"name": "children",
|
|
2953
3023
|
"takes": "anything",
|
|
2954
3024
|
"required": false,
|
|
2955
|
-
"note": "The app's own rows,
|
|
3025
|
+
"note": "The app's own rows, after Resolve: `MenuItem`s."
|
|
3026
|
+
},
|
|
3027
|
+
{
|
|
3028
|
+
"name": "label",
|
|
3029
|
+
"takes": "text",
|
|
3030
|
+
"required": false,
|
|
3031
|
+
"note": "A heading over Resolve and the app's rows, in the app's words: Peek's \"Utilities\"."
|
|
2956
3032
|
},
|
|
2957
3033
|
{
|
|
2958
3034
|
"name": "onEdit",
|
|
@@ -2960,6 +3036,18 @@
|
|
|
2960
3036
|
"required": false,
|
|
2961
3037
|
"note": "Offered on your own only."
|
|
2962
3038
|
},
|
|
3039
|
+
{
|
|
3040
|
+
"name": "editLabel",
|
|
3041
|
+
"takes": "text",
|
|
3042
|
+
"required": false,
|
|
3043
|
+
"note": "Edit's words: \"Edit\" by default; Peek's \"Edit message\"."
|
|
3044
|
+
},
|
|
3045
|
+
{
|
|
3046
|
+
"name": "after",
|
|
3047
|
+
"takes": "anything",
|
|
3048
|
+
"required": false,
|
|
3049
|
+
"note": "The app's own rows after Edit, before Delete: Peek's \"View details\"."
|
|
3050
|
+
},
|
|
2963
3051
|
{
|
|
2964
3052
|
"name": "onDelete",
|
|
2965
3053
|
"takes": "a handler",
|
|
@@ -7210,6 +7298,12 @@
|
|
|
7210
7298
|
"required": false,
|
|
7211
7299
|
"note": null
|
|
7212
7300
|
},
|
|
7301
|
+
{
|
|
7302
|
+
"name": "bot",
|
|
7303
|
+
"takes": "true/false",
|
|
7304
|
+
"required": false,
|
|
7305
|
+
"note": "An agent: its face is a robot, as Avatar's `bot`."
|
|
7306
|
+
},
|
|
7213
7307
|
{
|
|
7214
7308
|
"name": "fallback",
|
|
7215
7309
|
"takes": "text",
|
|
@@ -7310,6 +7404,12 @@
|
|
|
7310
7404
|
"required": false,
|
|
7311
7405
|
"note": null
|
|
7312
7406
|
},
|
|
7407
|
+
{
|
|
7408
|
+
"name": "bot",
|
|
7409
|
+
"takes": "true/false",
|
|
7410
|
+
"required": false,
|
|
7411
|
+
"note": "An agent: its face is a robot, as Avatar's `bot`."
|
|
7412
|
+
},
|
|
7313
7413
|
{
|
|
7314
7414
|
"name": "fallback",
|
|
7315
7415
|
"takes": "text",
|
|
@@ -8438,7 +8538,7 @@
|
|
|
8438
8538
|
},
|
|
8439
8539
|
{
|
|
8440
8540
|
"name": "faces",
|
|
8441
|
-
"takes": "readonly { name: string; picture?: string }[]",
|
|
8541
|
+
"takes": "readonly { name: string; picture?: string; bot?: boolean }[]",
|
|
8442
8542
|
"required": false,
|
|
8443
8543
|
"note": "Who replied: their faces."
|
|
8444
8544
|
},
|
|
@@ -8515,6 +8615,12 @@
|
|
|
8515
8615
|
"required": false,
|
|
8516
8616
|
"note": "A link to it: the time is then the link, \"Link to this\", as a reply's is."
|
|
8517
8617
|
},
|
|
8618
|
+
{
|
|
8619
|
+
"name": "timeLabel",
|
|
8620
|
+
"takes": "text",
|
|
8621
|
+
"required": false,
|
|
8622
|
+
"note": "The time's tooltip when it is a link, in the app's words: \"Link to this\" by default; Peek's \"Link to this message\"."
|
|
8623
|
+
},
|
|
8518
8624
|
{
|
|
8519
8625
|
"name": "edited",
|
|
8520
8626
|
"takes": "text",
|
|
@@ -8603,13 +8709,31 @@
|
|
|
8603
8709
|
"name": "deleteNote",
|
|
8604
8710
|
"takes": "anything",
|
|
8605
8711
|
"required": false,
|
|
8606
|
-
"note": "The app's
|
|
8712
|
+
"note": "The app's own words under the delete question, what deleting does there, in place of the kit's: \"It is deleted for everyone.\", and on a comment how many replies stay."
|
|
8607
8713
|
},
|
|
8608
8714
|
{
|
|
8609
8715
|
"name": "menu",
|
|
8610
8716
|
"takes": "anything",
|
|
8611
8717
|
"required": false,
|
|
8612
|
-
"note": "The app's own rows in the ⋯ menu: `MenuItem`s."
|
|
8718
|
+
"note": "The app's own rows in the ⋯ menu, after Resolve: `MenuItem`s."
|
|
8719
|
+
},
|
|
8720
|
+
{
|
|
8721
|
+
"name": "menuAfter",
|
|
8722
|
+
"takes": "anything",
|
|
8723
|
+
"required": false,
|
|
8724
|
+
"note": "The app's own rows in the ⋯ menu after Edit, before Delete: Peek's \"View details\"."
|
|
8725
|
+
},
|
|
8726
|
+
{
|
|
8727
|
+
"name": "menuLabel",
|
|
8728
|
+
"takes": "text",
|
|
8729
|
+
"required": false,
|
|
8730
|
+
"note": "A heading over the menu's first rows, in the app's words: Peek's \"Utilities\"."
|
|
8731
|
+
},
|
|
8732
|
+
{
|
|
8733
|
+
"name": "editLabel",
|
|
8734
|
+
"takes": "text",
|
|
8735
|
+
"required": false,
|
|
8736
|
+
"note": "Edit's words in the ⋯ menu: \"Edit\" by default; Peek's \"Edit message\"."
|
|
8613
8737
|
},
|
|
8614
8738
|
{
|
|
8615
8739
|
"name": "className",
|
|
@@ -8626,9 +8750,7 @@
|
|
|
8626
8750
|
"storyId": "conversation-replycard--reply",
|
|
8627
8751
|
"docPage": "src/ReplyCard.mdx",
|
|
8628
8752
|
"app": null,
|
|
8629
|
-
"looks": [
|
|
8630
|
-
"[&>div]:line-clamp-1 [&>div]:max-h-[1lh] [&>div>*:not(p):not(ul):not(ol):not(blockquote):not(pre):not(div:only-child)]:hidden [&>div>div:only-child>*:not(p):not(ul):not(ol):not(blockquote):not(pre)]:hidden"
|
|
8631
|
-
]
|
|
8753
|
+
"looks": []
|
|
8632
8754
|
},
|
|
8633
8755
|
{
|
|
8634
8756
|
"name": "ResolveDialog",
|
|
@@ -10155,6 +10277,18 @@
|
|
|
10155
10277
|
"required": false,
|
|
10156
10278
|
"note": "Closes the column."
|
|
10157
10279
|
},
|
|
10280
|
+
{
|
|
10281
|
+
"name": "closeLabel",
|
|
10282
|
+
"takes": "text",
|
|
10283
|
+
"required": false,
|
|
10284
|
+
"note": "Close's name for a screen reader, in the app's words (\"Close thread\")."
|
|
10285
|
+
},
|
|
10286
|
+
{
|
|
10287
|
+
"name": "empty",
|
|
10288
|
+
"takes": "anything",
|
|
10289
|
+
"required": false,
|
|
10290
|
+
"note": "Beside: what an empty thread says, words or the app's own `EmptyState`."
|
|
10291
|
+
},
|
|
10158
10292
|
{
|
|
10159
10293
|
"name": "title",
|
|
10160
10294
|
"takes": "anything",
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
// @vitest-environment jsdom
|
|
2
|
+
/**
|
|
3
|
+
* An agent's face (Katerina, 1 November): a robot where a person's initials would be, wherever a face is drawn, and
|
|
4
|
+
* its picture when it has one. Before, every agent showed "C" for "Claude (steered by …)", like a person.
|
|
5
|
+
*
|
|
6
|
+
* jsdom never loads an image, so the picture tests fire the `<img>`'s own events.
|
|
7
|
+
*/
|
|
8
|
+
import { afterEach, describe, expect, it } from 'vitest'
|
|
9
|
+
import { cleanup, fireEvent, render, screen } from '@testing-library/react'
|
|
10
|
+
import { Avatar } from './Avatar'
|
|
11
|
+
import { MembersDialog } from './MembersDialog'
|
|
12
|
+
import { Person } from './Person'
|
|
13
|
+
|
|
14
|
+
afterEach(cleanup)
|
|
15
|
+
|
|
16
|
+
const AGENT = 'Agent (steered by Ana Duarte)'
|
|
17
|
+
const tile = (container: HTMLElement) => container.firstElementChild as HTMLElement
|
|
18
|
+
|
|
19
|
+
describe('an agent’s face', () => {
|
|
20
|
+
it('is a robot, not its initials', () => {
|
|
21
|
+
const { container } = render(<Avatar name={AGENT} bot />)
|
|
22
|
+
expect(tile(container).textContent).toBe('')
|
|
23
|
+
expect(tile(container).querySelector('svg path')).not.toBeNull()
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
it('a person with the same kind of name still gets initials', () => {
|
|
27
|
+
const { container } = render(<Avatar name={AGENT} />)
|
|
28
|
+
expect(tile(container).textContent).toBe('A')
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
it('its picture still wins, and the robot shows if the picture fails', () => {
|
|
32
|
+
const { container } = render(<Avatar name={AGENT} bot src="https://example.test/agent.png" />)
|
|
33
|
+
const img = tile(container).querySelector('img')!
|
|
34
|
+
fireEvent.load(img)
|
|
35
|
+
expect(tile(container).querySelector('svg')).toBeNull()
|
|
36
|
+
cleanup()
|
|
37
|
+
const failed = render(<Avatar name={AGENT} bot src="https://example.test/agent.png" />)
|
|
38
|
+
fireEvent.error(tile(failed.container).querySelector('img')!)
|
|
39
|
+
expect(tile(failed.container).querySelector('svg path')).not.toBeNull()
|
|
40
|
+
expect(tile(failed.container).textContent).toBe('')
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
it('beside its name in a Person, the name is said once and no letter is drawn', () => {
|
|
44
|
+
const { container } = render(<Person name={AGENT} bot />)
|
|
45
|
+
expect(container.textContent).toBe(AGENT)
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
it('in the members list, the agent’s row has the robot and the person’s row their initials', () => {
|
|
49
|
+
render(
|
|
50
|
+
<MembersDialog
|
|
51
|
+
members={[
|
|
52
|
+
{ id: 'ana', name: 'Ana Duarte' },
|
|
53
|
+
{ id: 'agent', name: AGENT, bot: true },
|
|
54
|
+
]}
|
|
55
|
+
onClose={() => {}}
|
|
56
|
+
/>,
|
|
57
|
+
)
|
|
58
|
+
const rowOf = (name: string) => screen.getByText(name).closest('div.flex.h-12') as HTMLElement
|
|
59
|
+
expect(rowOf('Ana Duarte').textContent).toBe('ADAna Duarte')
|
|
60
|
+
expect(rowOf(AGENT).textContent).toBe(AGENT)
|
|
61
|
+
expect(rowOf(AGENT).querySelector('svg path')).not.toBeNull()
|
|
62
|
+
})
|
|
63
|
+
})
|
package/src/Avatar.mdx
CHANGED
|
@@ -7,6 +7,7 @@ import * as AvatarStories from './Avatar.stories'
|
|
|
7
7
|
|
|
8
8
|
A person's face: their picture, or their initials on a colour that is
|
|
9
9
|
theirs, or — when there is no name to take initials from — a silhouette.
|
|
10
|
+
An agent's face is a robot on lime.
|
|
10
11
|
|
|
11
12
|
<Canvas of={AvatarStories.Sizes} />
|
|
12
13
|
|
|
@@ -68,6 +69,29 @@ a stack of members — and the tile becomes one image with one name.
|
|
|
68
69
|
|
|
69
70
|
<Canvas of={AvatarStories.Palette} />
|
|
70
71
|
|
|
72
|
+
### An agent
|
|
73
|
+
|
|
74
|
+
**`bot` draws a robot on lime** in place of the initials, for a profile that
|
|
75
|
+
says it is an agent (NIP-24's `bot: true`, which Estiva ID publishes for every
|
|
76
|
+
agent). Its picture still wins when it has one.
|
|
77
|
+
|
|
78
|
+
```tsx
|
|
79
|
+
<Avatar name={profile.name} src={profile.picture} bot={profile.bot} />
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
- Take `bot` from the profile, **never from the name**: "steered by" is a
|
|
83
|
+
name, not a marker.
|
|
84
|
+
- Lime is the same in every theme, on the initials' light and shade. No
|
|
85
|
+
person's colour is near it, so an agent never reads as a person, nor as the
|
|
86
|
+
yellow urgent mark.
|
|
87
|
+
- The robot is drawn at 5/8 of the tile, larger than the silhouette, so it
|
|
88
|
+
still reads at 16px.
|
|
89
|
+
- Every part that draws a face takes `bot` with the person: `Person`,
|
|
90
|
+
`PersonTrigger`, `AvatarGroup`, `MembersPill`, `MembersDialog`, the mention
|
|
91
|
+
menu, a comment's and a reply's author, and the link parts.
|
|
92
|
+
|
|
93
|
+
<Canvas of={AvatarStories.Agent} />
|
|
94
|
+
|
|
71
95
|
- **Planned:** a Byline part — face · name · time — in migration stage 7.
|
|
72
96
|
|
|
73
97
|
- `initialsFor(name)` and `hueFor(name)` give the same initials and colour where
|
|
@@ -80,6 +104,7 @@ It does these by itself. Write none of them around it.
|
|
|
80
104
|
| It does | So you never write | Refused when written by hand |
|
|
81
105
|
|---|---|---|
|
|
82
106
|
| Shows initials from the name when there is no picture, or when it fails to load | an `onError`, or initials of your own | |
|
|
107
|
+
| Shows a robot for an agent (`bot`) when there is no picture | a robot icon of your own, or a check of the name | |
|
|
83
108
|
|
|
84
109
|
## Props
|
|
85
110
|
|
package/src/Avatar.stories.tsx
CHANGED
|
@@ -17,6 +17,19 @@ export const Initials: Story = {}
|
|
|
17
17
|
/** No name, no picture: the silhouette. Never a key, never a `?`. */
|
|
18
18
|
export const Unnamed: Story = { args: { name: undefined } }
|
|
19
19
|
|
|
20
|
+
/** An agent (its profile says `bot`): a robot on lime in place of its initials, at every size. */
|
|
21
|
+
export const Agent: Story = {
|
|
22
|
+
args: { name: 'Agent (steered by Ana Duarte)', bot: true },
|
|
23
|
+
parameters: { controls: { disable: true } },
|
|
24
|
+
render: (args) => (
|
|
25
|
+
<div className="flex items-end gap-3">
|
|
26
|
+
{[16, 20, 24, 32, 36].map((size) => (
|
|
27
|
+
<Avatar key={size} {...args} size={size} />
|
|
28
|
+
))}
|
|
29
|
+
</div>
|
|
30
|
+
),
|
|
31
|
+
}
|
|
32
|
+
|
|
20
33
|
/** A picture — here an inline SVG, so the story needs nothing from anywhere. */
|
|
21
34
|
export const WithPicture: Story = {
|
|
22
35
|
args: {
|
package/src/Avatar.tsx
CHANGED
|
@@ -6,6 +6,7 @@ import { cn } from './cn'
|
|
|
6
6
|
/**
|
|
7
7
|
* A person's face: their picture, or their initials on a colour that is
|
|
8
8
|
* theirs, or — when there is no name to take initials from — a silhouette.
|
|
9
|
+
* An agent's is a robot on lime (`bot`), unless it has a picture.
|
|
9
10
|
*
|
|
10
11
|
* Peek's Avatar (2026-08-28), made self-contained: Peek's version found the
|
|
11
12
|
* picture itself, by name, from Peek's data (an upload in Convex, else the
|
|
@@ -39,6 +40,9 @@ export const hueFor = (key: string) => {
|
|
|
39
40
|
return HUES[Math.abs(h) % HUES.length]
|
|
40
41
|
}
|
|
41
42
|
|
|
43
|
+
/** The tile's ground from its hue: lighter at the top left, darker at the foot. An agent's lime takes it too. */
|
|
44
|
+
const groundFor = (hue: string) => `linear-gradient(160deg, color-mix(in srgb, ${hue} 92%, #fff) 0%, color-mix(in srgb, ${hue} 70%, #0b0d11) 100%)`
|
|
45
|
+
|
|
42
46
|
/**
|
|
43
47
|
* Peek's rule, sharpened: the first letter of the first two words — counting
|
|
44
48
|
* only words that begin with a letter or digit, so "Claude (steered by
|
|
@@ -72,10 +76,52 @@ export interface AvatarProps {
|
|
|
72
76
|
* of a name, not text, and a screen reader was reading them as text.
|
|
73
77
|
*/
|
|
74
78
|
label?: string
|
|
79
|
+
/**
|
|
80
|
+
* **An agent's face**: a robot in place of the initials, for a profile that says it is an agent (NIP-24's `bot`).
|
|
81
|
+
* Its picture still wins when it has one. Never worked out from the name: "steered by" is a name, not a marker.
|
|
82
|
+
*/
|
|
83
|
+
bot?: boolean
|
|
75
84
|
className?: string
|
|
76
85
|
}
|
|
77
86
|
|
|
78
|
-
|
|
87
|
+
/**
|
|
88
|
+
* An agent's robot: Remix Icon's `robot-2-fill`, copied as its one path rather than a second icon package, because
|
|
89
|
+
* Tabler has no solid robot (Katerina, 1 November, from six drawings in four open sets).
|
|
90
|
+
* Remix Icon License v1.0, Copyright (c) 2017–2026 Remix Design: use in a product is allowed; not as a logo, and
|
|
91
|
+
* not resold as icons.
|
|
92
|
+
*/
|
|
93
|
+
const ROBOT_PATH =
|
|
94
|
+
'M13.5 2C13.5 2.44425 13.3069 2.84339 13 3.11805V5H18C19.6569 5 21 6.34315 21 8V18C21 19.6569 19.6569 21 18 21H6C4.34315 21 3 19.6569 3 18V8C3 6.34315 4.34315 5 6 5H11V3.11805C10.6931 2.84339 10.5 2.44425 10.5 2C10.5 1.17157 11.1716 0.5 12 0.5C12.8284 0.5 13.5 1.17157 13.5 2ZM0 10H2V16H0V10ZM24 10H22V16H24V10ZM9 14.5C9.82843 14.5 10.5 13.8284 10.5 13C10.5 12.1716 9.82843 11.5 9 11.5C8.17157 11.5 7.5 12.1716 7.5 13C7.5 13.8284 8.17157 14.5 9 14.5ZM16.5 13C16.5 12.1716 15.8284 11.5 15 11.5C14.1716 11.5 13.5 12.1716 13.5 13C13.5 13.8284 14.1716 14.5 15 14.5C15.8284 14.5 16.5 13.8284 16.5 13Z'
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* An agent's colour: lime, the same in every theme and on the initials' light and shade (Katerina, 1 November). No
|
|
98
|
+
* person's hue is near it, so an agent never reads as a person, nor as the yellow urgent mark.
|
|
99
|
+
*/
|
|
100
|
+
const AGENT_HUE = '#d4ee4a'
|
|
101
|
+
|
|
102
|
+
/** An agent's face: the robot, larger than the silhouette (5/8 of the tile), so it still reads at 16px. */
|
|
103
|
+
function AgentFace({ size }: { size: number }) {
|
|
104
|
+
const glyph = Math.round(size * 0.625)
|
|
105
|
+
return (
|
|
106
|
+
<BaseAvatar.Fallback
|
|
107
|
+
render={<div />}
|
|
108
|
+
className="w-full h-full flex items-center justify-center"
|
|
109
|
+
style={{
|
|
110
|
+
/* eslint-disable no-restricted-syntax -- @estiva-escape: one colour in every theme, on the initials' light
|
|
111
|
+
and shade, and their ink: a palette, as HUES, so none of it can be a token. */
|
|
112
|
+
background: groundFor(AGENT_HUE),
|
|
113
|
+
color: '#08121c',
|
|
114
|
+
/* eslint-enable no-restricted-syntax */
|
|
115
|
+
}}
|
|
116
|
+
>
|
|
117
|
+
<svg width={glyph} height={glyph} viewBox="0 0 24 24" fill="currentColor" aria-hidden>
|
|
118
|
+
<path d={ROBOT_PATH} />
|
|
119
|
+
</svg>
|
|
120
|
+
</BaseAvatar.Fallback>
|
|
121
|
+
)
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export function Avatar({ src, name, alt = '', size = 36, label: spoken, bot = false, className }: AvatarProps) {
|
|
79
125
|
const label = name || alt
|
|
80
126
|
// No picture handed in: the app's own, when it has said where pictures live (`AppProvider`).
|
|
81
127
|
const pictureFor = usePictureFor()
|
|
@@ -107,7 +153,9 @@ export function Avatar({ src, name, alt = '', size = 36, label: spoken, classNam
|
|
|
107
153
|
className="w-full h-full object-cover data-[error]:hidden"
|
|
108
154
|
/>
|
|
109
155
|
)}
|
|
110
|
-
{
|
|
156
|
+
{bot ? (
|
|
157
|
+
<AgentFace size={size} />
|
|
158
|
+
) : label ? (
|
|
111
159
|
<BaseAvatar.Fallback
|
|
112
160
|
render={<div />}
|
|
113
161
|
/*
|
|
@@ -133,7 +181,7 @@ export function Avatar({ src, name, alt = '', size = 36, label: spoken, classNam
|
|
|
133
181
|
// ink cannot be a token either.
|
|
134
182
|
color: '#08121c',
|
|
135
183
|
fontSize: Math.round(size * 0.36),
|
|
136
|
-
background:
|
|
184
|
+
background: groundFor(hueFor(label)),
|
|
137
185
|
/* eslint-enable no-restricted-syntax */
|
|
138
186
|
}}
|
|
139
187
|
>
|
package/src/AvatarGroup.tsx
CHANGED
|
@@ -20,6 +20,8 @@ export interface AvatarGroupMember {
|
|
|
20
20
|
name: string
|
|
21
21
|
/** Resolved by the caller. Absent draws the initials. */
|
|
22
22
|
picture?: string
|
|
23
|
+
/** An agent: its face is a robot, as Avatar's `bot`. */
|
|
24
|
+
bot?: boolean
|
|
23
25
|
}
|
|
24
26
|
|
|
25
27
|
export interface AvatarGroupProps {
|
|
@@ -67,7 +69,7 @@ export function AvatarGroup({ members, size = 24, on = 'surface' }: AvatarGroupP
|
|
|
67
69
|
{/* Each face says whose it is: a stack stands on its own, with no
|
|
68
70
|
name beside it to borrow. It read as its initials before —
|
|
69
71
|
"AD BC CD" — which is the drawing, not the person. */}
|
|
70
|
-
<Avatar size={size} name={member.name} src={member.picture} label={member.name} />
|
|
72
|
+
<Avatar size={size} name={member.name} src={member.picture} bot={member.bot} label={member.name} />
|
|
71
73
|
</span>
|
|
72
74
|
))}
|
|
73
75
|
</div>
|
|
@@ -36,6 +36,8 @@ const PEOPLE: MentionPerson[] = ['one', 'two', 'three', 'four', 'five', 'six', '
|
|
|
36
36
|
description: i % 2 === 0 ? 'Label' : undefined,
|
|
37
37
|
pubkey: null,
|
|
38
38
|
}))
|
|
39
|
+
// An agent among them, second, so `@` shows its robot face at once.
|
|
40
|
+
PEOPLE.splice(1, 0, { id: 'agent', name: 'Agent (steered by Person one)', description: 'Agent', pubkey: null, bot: true })
|
|
39
41
|
|
|
40
42
|
const ITEMS: CaptionedItem[] = ['one', 'two', 'three'].map((n) => ({
|
|
41
43
|
id: `item-${n}`,
|
package/src/ComposerTriggers.tsx
CHANGED
|
@@ -40,6 +40,8 @@ export interface MentionPerson {
|
|
|
40
40
|
pubkey?: string | null
|
|
41
41
|
/** The face at the row's start. Default: the package `Avatar` for the name. */
|
|
42
42
|
avatar?: ReactNode
|
|
43
|
+
/** An agent: its face is a robot, as Avatar's `bot`. */
|
|
44
|
+
bot?: boolean
|
|
43
45
|
}
|
|
44
46
|
|
|
45
47
|
/** How many people the list shows. */
|
|
@@ -67,7 +69,7 @@ export function peopleMenu(urgent: boolean): SuggestionPopupOptions<MentionPerso
|
|
|
67
69
|
row: (person) => ({
|
|
68
70
|
label: person.name,
|
|
69
71
|
description: person.description,
|
|
70
|
-
leading: person.avatar ?? <Avatar size={32} alt={person.name} />,
|
|
72
|
+
leading: person.avatar ?? <Avatar size={32} alt={person.name} bot={person.bot} />,
|
|
71
73
|
hint: <EnterHint />,
|
|
72
74
|
size: 'tall',
|
|
73
75
|
}),
|