|
447 | 447 | {} $ :class-name (str-spaced css/row-middle css/gap8 style-reply-actions) |
448 | 448 | button |
449 | 449 | {} |
450 | | - :class-name $ str-spaced css/button style-more |
| 450 | + :class-name $ str-spaced css/button style-reply-button |
451 | 451 | :on-click $ fn (e d!) |
452 | 452 | .show reply-plugin d! $ fn (text) (submit-message! cursor state text false false model d!) |
453 | | - <> "|回复" |
| 453 | + <> |Reply |
454 | 454 | , nil |
455 | 455 | if (:loading? state) |
456 | 456 | div ({}) (memof1-call-by :abort-loading comp-abort "\"Loading...") |
|
801 | 801 | :code $ quote |
802 | 802 | defstyle style-message-assistant $ {} |
803 | 803 | "\"&" $ {} (:align-self :flex-start) |
804 | | - :background-color $ hsl 0 0 100 |
805 | 804 | :examples $ [] |
806 | 805 | |style-message-box $ %{} :CodeEntry (:doc |) |
807 | 806 | :code $ quote |
|
822 | 821 | |style-message-item $ %{} :CodeEntry (:doc |) |
823 | 822 | :code $ quote |
824 | 823 | defstyle style-message-item $ {} |
825 | | - "\"&" $ {} (:padding "\"12px 16px") (:border-radius 10) (:max-width "\"80%") (:line-height "\"1.6") |
| 824 | + "\"&" $ {} (:line-height "\"1.6") |
826 | 825 | :examples $ [] |
827 | 826 | |style-message-list $ %{} :CodeEntry (:doc |) |
828 | 827 | :code $ quote |
|
846 | 845 | defstyle style-message-user $ {} |
847 | 846 | "\"&" $ {} (:align-self :flex-end) |
848 | 847 | :background-color $ hsl 0 0 96 |
| 848 | + :padding "\"12px 16px" |
| 849 | + :border-radius 10 |
849 | 850 | :examples $ [] |
850 | 851 | |style-more $ %{} :CodeEntry (:doc |) |
851 | 852 | :code $ quote |
|
856 | 857 | :padding "\"4px 12px" |
857 | 858 | :margin "\"8px 0" |
858 | 859 | :white-space :nowrap |
859 | | - :display :inline-flex |
| 860 | + :display :inline-block |
860 | 861 | "\"&:hover" $ {} |
861 | 862 | :box-shadow $ str "\"1px 1px 4px " (hsl 0 0 0 0.2) |
862 | 863 | :examples $ [] |
|
865 | 866 | defstyle style-reply-actions $ {} |
866 | 867 | "\"&" $ {} (:margin-top 6) (:justify-content :flex-start) (:width "\"100%") |
867 | 868 | :examples $ [] |
| 869 | + |style-reply-button $ %{} :CodeEntry (:doc |) |
| 870 | + :code $ quote |
| 871 | + defstyle style-reply-button $ {} |
| 872 | + "\"&" $ {} (:text-align :center) (:min-width 80) |
| 873 | + :background-color $ hsl 0 0 100 |
| 874 | + :border-radius 16 |
| 875 | + :padding "\"4px 12px" |
| 876 | + :margin "\"8px 0" |
| 877 | + :white-space :nowrap |
| 878 | + :display :inline-block |
| 879 | + "\"&:hover" $ {} |
| 880 | + :box-shadow $ str "\"1px 1px 4px " (hsl 0 0 0 0.2) |
| 881 | + :examples $ [] |
868 | 882 | |style-submit $ %{} :CodeEntry (:doc |) |
869 | 883 | :code $ quote |
870 | 884 | defstyle style-submit $ {} |
|
873 | 887 | |style-textbox $ %{} :CodeEntry (:doc |) |
874 | 888 | :code $ quote |
875 | 889 | defstyle style-textbox $ {} |
876 | | - "\"&" $ {} (:border-radius 12) (:height "\"max(160px,20vh)") (:width "\"100%") (:transition-duration "\"320ms") (:border :none) (:background-color :transparent) |
877 | | - "\"&.focus-within" $ {} (:height "\"max(240px,32vh)") (:border :none) (:box-shadow :none) |
| 890 | + "\"&" $ {} (:border-radius 12) (:height "|max(100px,15vh)") (:width "\"100%") (:transition-duration "\"320ms") (:border :none) (:background-color :transparent) |
| 891 | + "\"&.focus-within" $ {} (:height "|max(240px,32vh)") (:border :none) (:box-shadow :none) |
878 | 892 | :examples $ [] |
879 | 893 | |style-thinking $ %{} :CodeEntry (:doc |) |
880 | 894 | :code $ quote |
|
893 | 907 | :code $ quote |
894 | 908 | defn submit-message! (cursor state prompt-text search? think? model d!) (hint-fn async) |
895 | 909 | let |
| 910 | + state1 $ assoc state :messages |
| 911 | + append-user-message (:messages state) prompt-text |
896 | 912 | *text $ atom "\"" |
897 | 913 | *thinking-text $ atom "\"" |
898 | 914 | model $ :model state |
| 915 | + d! cursor state1 |
899 | 916 | try |
900 | 917 | do $ case-default model |
901 | | - js-await $ call-genai-msg! model cursor state prompt-text search? think? d! *text *thinking-text |
902 | | - :gemini-pro $ js-await (call-genai-msg! model cursor state prompt-text search? think? d! *text *thinking-text) |
903 | | - :flash-imagen $ js-await (call-flash-imagen-msg! model cursor state prompt-text d!) |
904 | | - :imagen-4 $ js-await (call-imagen-4-msg! model cursor state prompt-text d!) |
905 | | - :gemini-thinking $ js-await (call-genai-msg! model cursor state prompt-text search? think? d! *text *thinking-text) |
906 | | - :gemini-flash-thinking $ js-await (call-genai-msg! model cursor state prompt-text search? think? d! *text *thinking-text) |
907 | | - :gemini-flash-lite $ js-await (call-genai-msg! model cursor state prompt-text search? think? d! *text *thinking-text) |
908 | | - :gemini-flash $ js-await (call-genai-msg! model cursor state prompt-text search? think? d! *text *thinking-text) |
909 | | - :gemini-learnlm $ js-await (call-genai-msg! model cursor state prompt-text search? think? d! *text *thinking-text) |
910 | | - :claude-3.7 $ js-await (call-anthropic-msg! cursor state prompt-text "\"claude-3-7-sonnet-20250219" false d!) |
911 | | - :openrouter/anthropic/claude-sonnet-4 $ js-await (call-openrouter! cursor state prompt-text "\"anthropic/claude-sonnet-4" true d! *text) |
912 | | - :openrouter/anthropic/claude-opus-4 $ js-await (call-openrouter! cursor state prompt-text "\"anthropic/claude-opus-4" true d! *text) |
913 | | - :openrouter/anthropic/claude-3.7-sonnet:thinking $ js-await (call-openrouter! cursor state prompt-text "\"anthropic/claude-3.7-sonnet:thinking" true d! *text) |
914 | | - :openrouter/google/gemini-2.5-pro-preview $ js-await (call-openrouter! cursor state prompt-text "\"google/gemini-2.5-pro-preview" true d! *text) |
915 | | - :openrouter/google/gemini-2.5-flash-preview-05-20 $ js-await (call-openrouter! cursor state prompt-text "\"google/gemini-2.5-flash-preview-05-20" true d! *text) |
916 | | - :openrouter/openai/gpt-5 $ js-await (call-openrouter! cursor state prompt-text "\"openai/gpt-5" true d! *text) |
917 | | - :openrouter/deepseek/deepseek-chat-v3.1 $ js-await (call-openrouter! cursor state prompt-text "\"deepseek/deepseek-chat-v3.1" true d! *text) |
| 918 | + js-await $ call-genai-msg! model cursor state1 prompt-text search? think? d! *text *thinking-text |
| 919 | + :gemini-pro $ js-await (call-genai-msg! model cursor state1 prompt-text search? think? d! *text *thinking-text) |
| 920 | + :flash-imagen $ js-await (call-flash-imagen-msg! model cursor state1 prompt-text d!) |
| 921 | + :imagen-4 $ js-await (call-imagen-4-msg! model cursor state1 prompt-text d!) |
| 922 | + :gemini-thinking $ js-await (call-genai-msg! model cursor state1 prompt-text search? think? d! *text *thinking-text) |
| 923 | + :gemini-flash-thinking $ js-await (call-genai-msg! model cursor state1 prompt-text search? think? d! *text *thinking-text) |
| 924 | + :gemini-flash-lite $ js-await (call-genai-msg! model cursor state1 prompt-text search? think? d! *text *thinking-text) |
| 925 | + :gemini-flash $ js-await (call-genai-msg! model cursor state1 prompt-text search? think? d! *text *thinking-text) |
| 926 | + :gemini-learnlm $ js-await (call-genai-msg! model cursor state1 prompt-text search? think? d! *text *thinking-text) |
| 927 | + :claude-3.7 $ js-await (call-anthropic-msg! cursor state1 prompt-text "\"claude-3-7-sonnet-20250219" false d!) |
| 928 | + :openrouter/anthropic/claude-sonnet-4 $ js-await (call-openrouter! cursor state1 prompt-text "\"anthropic/claude-sonnet-4" true d! *text) |
| 929 | + :openrouter/anthropic/claude-opus-4 $ js-await (call-openrouter! cursor state1 prompt-text "\"anthropic/claude-opus-4" true d! *text) |
| 930 | + :openrouter/anthropic/claude-3.7-sonnet:thinking $ js-await (call-openrouter! cursor state1 prompt-text "\"anthropic/claude-3.7-sonnet:thinking" true d! *text) |
| 931 | + :openrouter/google/gemini-2.5-pro-preview $ js-await (call-openrouter! cursor state1 prompt-text "\"google/gemini-2.5-pro-preview" true d! *text) |
| 932 | + :openrouter/google/gemini-2.5-flash-preview-05-20 $ js-await (call-openrouter! cursor state1 prompt-text "\"google/gemini-2.5-flash-preview-05-20" true d! *text) |
| 933 | + :openrouter/openai/gpt-5 $ js-await (call-openrouter! cursor state1 prompt-text "\"openai/gpt-5" true d! *text) |
| 934 | + :openrouter/deepseek/deepseek-chat-v3.1 $ js-await (call-openrouter! cursor state1 prompt-text "\"deepseek/deepseek-chat-v3.1" true d! *text) |
918 | 935 | fn (e) |
919 | 936 | let |
920 | 937 | err-text $ str "\"Failed to load: " e |
|
0 commit comments