@pactor-app/chat 1.18.1 → 1.21.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/index.cjs CHANGED
@@ -3019,33 +3019,27 @@ function buildEmptyStateFragment(props) {
3019
3019
  }
3020
3020
  if (props.suggestions && props.suggestions.length > 0) {
3021
3021
  children.push({
3022
- type: "Flex",
3022
+ type: "Suggestion",
3023
3023
  props: {
3024
- gap: "small",
3024
+ items: props.suggestions.map((suggestion) => ({
3025
+ label: suggestionLabel(suggestion),
3026
+ value: suggestionPrompt(suggestion)
3027
+ })),
3025
3028
  justify: "center",
3026
3029
  className: "pactor-chat-empty__suggestions"
3027
3030
  },
3028
- children: props.suggestions.map((suggestion) => ({
3029
- type: "Button",
3030
- props: {
3031
- text: suggestionLabel(suggestion),
3032
- variant: "default",
3033
- size: "middle",
3034
- className: "pactor-chat-empty__suggestion"
3035
- },
3036
- events: {
3037
- onClick: [
3038
- {
3039
- action: "chat.sendSuggestion",
3040
- params: { text: suggestionPrompt(suggestion) }
3041
- }
3042
- ]
3043
- }
3044
- }))
3031
+ events: {
3032
+ onSelect: [
3033
+ {
3034
+ action: "chat.sendSuggestion",
3035
+ params: { text: "${event}" }
3036
+ }
3037
+ ]
3038
+ }
3045
3039
  });
3046
3040
  }
3047
3041
  return {
3048
- requires: ["Flex", "Typography", "Text", "Button"],
3042
+ requires: ["Flex", "Typography", "Text", "Suggestion"],
3049
3043
  node: {
3050
3044
  type: "Flex",
3051
3045
  props: { direction: "vertical", align: "center", gap: "middle" },
package/dist/index.js CHANGED
@@ -2959,33 +2959,27 @@ function buildEmptyStateFragment(props) {
2959
2959
  }
2960
2960
  if (props.suggestions && props.suggestions.length > 0) {
2961
2961
  children.push({
2962
- type: "Flex",
2962
+ type: "Suggestion",
2963
2963
  props: {
2964
- gap: "small",
2964
+ items: props.suggestions.map((suggestion) => ({
2965
+ label: suggestionLabel(suggestion),
2966
+ value: suggestionPrompt(suggestion)
2967
+ })),
2965
2968
  justify: "center",
2966
2969
  className: "pactor-chat-empty__suggestions"
2967
2970
  },
2968
- children: props.suggestions.map((suggestion) => ({
2969
- type: "Button",
2970
- props: {
2971
- text: suggestionLabel(suggestion),
2972
- variant: "default",
2973
- size: "middle",
2974
- className: "pactor-chat-empty__suggestion"
2975
- },
2976
- events: {
2977
- onClick: [
2978
- {
2979
- action: "chat.sendSuggestion",
2980
- params: { text: suggestionPrompt(suggestion) }
2981
- }
2982
- ]
2983
- }
2984
- }))
2971
+ events: {
2972
+ onSelect: [
2973
+ {
2974
+ action: "chat.sendSuggestion",
2975
+ params: { text: "${event}" }
2976
+ }
2977
+ ]
2978
+ }
2985
2979
  });
2986
2980
  }
2987
2981
  return {
2988
- requires: ["Flex", "Typography", "Text", "Button"],
2982
+ requires: ["Flex", "Typography", "Text", "Suggestion"],
2989
2983
  node: {
2990
2984
  type: "Flex",
2991
2985
  props: { direction: "vertical", align: "center", gap: "middle" },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pactor-app/chat",
3
- "version": "1.18.1",
3
+ "version": "1.21.0",
4
4
  "description": "Pactor chat: AI message rendering protocol (message model, streaming reducer, safe registry, capability action) and chat runtime view (ChatView / MessageBubble / PartRenderer / Composer / chat layout)",
5
5
  "keywords": [
6
6
  "pactor",
@@ -49,11 +49,11 @@
49
49
  "access": "public"
50
50
  },
51
51
  "dependencies": {
52
- "@pactor-app/core": "1.18.1",
53
- "@pactor-app/markdown": "1.18.1",
54
- "@pactor-app/ui": "1.18.1",
55
- "@pactor-app/runtime": "1.18.1",
56
- "@pactor-app/permission": "1.18.1"
52
+ "@pactor-app/core": "1.21.0",
53
+ "@pactor-app/markdown": "1.21.0",
54
+ "@pactor-app/permission": "1.21.0",
55
+ "@pactor-app/runtime": "1.21.0",
56
+ "@pactor-app/ui": "1.21.0"
57
57
  },
58
58
  "peerDependencies": {
59
59
  "react": ">=18"