@puckeditor/plugin-ai 0.1.0-canary.ff322ae0 → 0.1.0-canary.ff784f5d

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.css CHANGED
@@ -372,72 +372,43 @@ p {
372
372
  }
373
373
 
374
374
  /* css-module:/home/runner/work/puck-platform/puck-platform/packages/platform-client/components/Heading/Heading.module.css/#css-module-data */
375
- ._Heading_qkzg9_1 {
375
+ ._Heading_1czuc_1 {
376
376
  display: block;
377
377
  font-weight: 700;
378
378
  margin: 0;
379
379
  }
380
- ._Heading_qkzg9_1 b {
380
+ ._Heading_1czuc_1 b {
381
381
  font-weight: 700;
382
382
  }
383
- ._Heading--xxxxl_qkzg9_11 {
383
+ ._Heading--xxxxl_1czuc_11 {
384
+ font-size: var(--puck-font-size-xxxxl);
385
+ letter-spacing: 0.08ch;
386
+ font-weight: 800;
387
+ }
388
+ ._Heading--xxxl_1czuc_17 {
384
389
  font-size: var(--puck-font-size-xxxl);
385
390
  }
386
- ._Heading--xxxl_qkzg9_15 {
391
+ ._Heading--xxl_1czuc_21 {
387
392
  font-size: var(--puck-font-size-xxl);
388
393
  }
389
- ._Heading--xxl_qkzg9_19 {
394
+ ._Heading--xl_1czuc_25 {
390
395
  font-size: var(--puck-font-size-xl);
391
396
  }
392
- ._Heading--xl_qkzg9_23 {
397
+ ._Heading--l_1czuc_29 {
393
398
  font-size: var(--puck-font-size-l);
394
399
  }
395
- ._Heading--l_qkzg9_27 {
400
+ ._Heading--m_1czuc_33 {
396
401
  font-size: var(--puck-font-size-m);
397
402
  }
398
- ._Heading--m_qkzg9_31 {
403
+ ._Heading--s_1czuc_37 {
399
404
  font-size: var(--puck-font-size-s);
400
405
  }
401
- ._Heading--s_qkzg9_35 {
406
+ ._Heading--xs_1czuc_41 {
402
407
  font-size: var(--puck-font-size-xs);
403
408
  }
404
- ._Heading--xs_qkzg9_39 {
405
- font-size: var(--puck-font-size-xxs);
406
- }
407
- ._Heading--xxs_qkzg9_43 {
409
+ ._Heading--xxs_1czuc_45 {
408
410
  font-size: var(--puck-font-size-xxs);
409
411
  }
410
- @media (min-width: 768px) {
411
- ._Heading--xxxxl_qkzg9_11 {
412
- font-size: var(--puck-font-size-xxxxl);
413
- letter-spacing: 0.08ch;
414
- font-weight: 800;
415
- }
416
- ._Heading--xxxl_qkzg9_15 {
417
- font-size: var(--puck-font-size-xxxl);
418
- }
419
- ._Heading--xxl_qkzg9_19 {
420
- font-size: var(--puck-font-size-xxl);
421
- }
422
- ._Heading--xl_qkzg9_23 {
423
- font-size: var(--puck-font-size-xl);
424
- }
425
- ._Heading--l_qkzg9_27 {
426
- font-size: var(--puck-font-size-l);
427
- }
428
- ._Heading--m_qkzg9_31 {
429
- font-size: var(--puck-font-size-m);
430
- }
431
- ._Heading--s_qkzg9_35 {
432
- font-size: var(--puck-font-size-s);
433
- }
434
- ._Heading--xs_qkzg9_39 {
435
- font-size: var(--puck-font-size-xs);
436
- }
437
- ._Heading--xxs_qkzg9_43 {
438
- font-size: var(--puck-font-size-xxs);
439
- }
440
- }
441
412
 
442
413
  /* css-module:/home/runner/work/puck-platform/puck-platform/packages/platform-client/components/Align/Align.module.css/#css-module-data */
443
414
  ._Align_oewlu_1 {
@@ -631,13 +602,13 @@ p {
631
602
  }
632
603
 
633
604
  /* css-module:/home/runner/work/puck-platform/puck-platform/packages/platform-client/components/Page/Page.module.css/#css-module-data */
634
- ._Page_1ajs1_1 {
605
+ ._Page_1pzwy_1 {
635
606
  display: flex;
636
607
  flex-direction: column;
637
608
  height: 100%;
638
609
  overflow: hidden;
639
610
  }
640
- ._Page-masthead_1ajs1_8 {
611
+ ._Page-masthead_1pzwy_8 {
641
612
  align-items: center;
642
613
  display: flex;
643
614
  gap: 16px;
@@ -645,47 +616,45 @@ p {
645
616
  box-sizing: border-box;
646
617
  border-bottom: 1px solid var(--puck-color-grey-10);
647
618
  min-height: 64px;
648
- overflow-x: auto;
649
619
  }
650
- ._Page-crumbs_1ajs1_19 {
620
+ ._Page-crumbs_1pzwy_18 {
651
621
  display: flex;
652
622
  gap: 32px;
653
623
  }
654
- ._Page-crumb_1ajs1_19 {
624
+ ._Page-crumb_1pzwy_18 {
655
625
  color: var(--puck-color-grey-05);
656
626
  position: relative;
657
- white-space: nowrap;
658
627
  }
659
- ._Page-crumbLink_1ajs1_30 {
628
+ ._Page-crumbLink_1pzwy_28 {
660
629
  color: var(--puck-color-grey-05);
661
630
  text-decoration: none;
662
631
  }
663
- ._Page-crumbLink_1ajs1_30:hover {
632
+ ._Page-crumbLink_1pzwy_28:hover {
664
633
  color: var(--puck-color-azure-04);
665
634
  }
666
- ._Page-crumb_1ajs1_19:last-of-type {
635
+ ._Page-crumb_1pzwy_18:last-of-type {
667
636
  color: var(--puck-color-grey-01);
668
637
  font-weight: 600;
669
638
  }
670
- ._Page-crumb_1ajs1_19::before {
639
+ ._Page-crumb_1pzwy_18::before {
671
640
  position: absolute;
672
641
  content: "/";
673
642
  left: -19px;
674
643
  color: var(--puck-color-grey-09);
675
644
  font-weight: 400;
676
645
  }
677
- ._Page-crumb_1ajs1_19:first-of-type::before {
646
+ ._Page-crumb_1pzwy_18:first-of-type::before {
678
647
  display: none;
679
648
  }
680
- ._Page-crumb_1ajs1_19 {
649
+ ._Page-crumb_1pzwy_18 {
681
650
  color: var(--puck-color-grey-05);
682
651
  position: relative;
683
652
  text-decoration: none;
684
653
  }
685
- ._Page-actions_1ajs1_62 {
654
+ ._Page-actions_1pzwy_60 {
686
655
  margin-left: auto;
687
656
  }
688
- ._Page-footer_1ajs1_66 {
657
+ ._Page-footer_1pzwy_64 {
689
658
  border-top: 1px solid var(--puck-color-grey-10);
690
659
  padding: 16px 24px;
691
660
  }
@@ -924,43 +893,8 @@ p {
924
893
  padding-top: 128px;
925
894
  }
926
895
 
927
- /* css-module:/home/runner/work/puck-platform/puck-platform/packages/platform-client/components/Viewport/styles.module.css/#css-module-data */
928
- ._Viewport_1vvhm_3 {
929
- }
930
- ._Viewport--standard_1vvhm_6,
931
- ._Viewport--inline_1vvhm_7._Viewport--standard_1vvhm_6 {
932
- display: none;
933
- }
934
- ._Viewport--narrow_1vvhm_11 {
935
- display: block;
936
- }
937
- ._Viewport--inline_1vvhm_7._Viewport--narrow_1vvhm_11 {
938
- display: inline;
939
- }
940
- ._Viewport--flex_1vvhm_19._Viewport--narrow_1vvhm_11 {
941
- display: flex;
942
- }
943
- @media (min-width: 768px) {
944
- ._Viewport--narrow_1vvhm_11,
945
- ._Viewport--inline_1vvhm_7._Viewport--narrow_1vvhm_11,
946
- ._Viewport--flex_1vvhm_19._Viewport--narrow_1vvhm_11 {
947
- display: none;
948
- }
949
- }
950
- @media (min-width: 768px) {
951
- ._Viewport--standard_1vvhm_6 {
952
- display: block;
953
- }
954
- ._Viewport--inline_1vvhm_7._Viewport--standard_1vvhm_6 {
955
- display: inline;
956
- }
957
- ._Viewport--flex_1vvhm_19._Viewport--standard_1vvhm_6 {
958
- display: flex;
959
- }
960
- }
961
-
962
896
  /* css-module:/home/runner/work/puck-platform/puck-platform/packages/plugin-ai/src/components/ChatBody/styles.module.css/#css-module-data */
963
- ._Chat_150yz_1 {
897
+ ._Chat_14j71_1 {
964
898
  --fade-size: 32px;
965
899
  --chat-background-color: white;
966
900
  display: flex;
@@ -970,46 +904,46 @@ p {
970
904
  overflow: hidden;
971
905
  }
972
906
  @media (min-width: 638px) {
973
- ._Chat_150yz_1 {
907
+ ._Chat_14j71_1 {
974
908
  max-height: none;
975
909
  }
976
910
  }
977
- ._Chat-inner_150yz_17 {
911
+ ._Chat-inner_14j71_17 {
978
912
  background-color: var(--chat-background-color);
979
913
  display: flex;
980
914
  flex-direction: column;
981
915
  max-height: 100%;
982
916
  position: relative;
983
917
  }
984
- ._Chat--hasMessages_150yz_25 ._Chat-inner_150yz_17 {
918
+ ._Chat--hasMessages_14j71_25 ._Chat-inner_14j71_17 {
985
919
  padding-top: 0;
986
920
  }
987
- ._Chat_150yz_1:not(._Chat--hasChildren_150yz_29) ._Chat-inner_150yz_17 {
921
+ ._Chat_14j71_1:not(._Chat--hasChildren_14j71_29) ._Chat-inner_14j71_17 {
988
922
  height: 100%;
989
923
  padding-top: 0;
990
924
  }
991
- ._Chat--hasMessages_150yz_25 ._Chat-messages_150yz_34 {
925
+ ._Chat--hasMessages_14j71_25 ._Chat-messages_14j71_34 {
992
926
  display: flex;
993
927
  flex-direction: column-reverse;
994
928
  padding: 16px;
995
929
  overflow: auto;
996
930
  }
997
- ._Chat-form_150yz_41 {
931
+ ._Chat-form_14j71_41 {
998
932
  background-color: white;
999
933
  padding: 16px;
1000
934
  }
1001
- ._Chat--hideInput_150yz_46 ._Chat-form_150yz_41 {
935
+ ._Chat--hideInput_14j71_46 ._Chat-form_14j71_41 {
1002
936
  display: none;
1003
937
  }
1004
- ._Chat--hasMessages_150yz_25 ._Chat-form_150yz_41 {
938
+ ._Chat--hasMessages_14j71_25 ._Chat-form_14j71_41 {
1005
939
  border-top: 1px solid var(--puck-color-grey-09);
1006
940
  }
1007
941
  @media (min-width: 638px) {
1008
- ._Chat-form_150yz_41 {
942
+ ._Chat-form_14j71_41 {
1009
943
  border-top: 1px solid var(--puck-color-grey-09);
1010
944
  }
1011
945
  }
1012
- ._Chat-formHelper_150yz_60 {
946
+ ._Chat-formHelper_14j71_60 {
1013
947
  align-items: center;
1014
948
  display: flex;
1015
949
  color: var(--puck-color-grey-04);
@@ -1018,11 +952,11 @@ p {
1018
952
  gap: 8px;
1019
953
  padding-bottom: 12px;
1020
954
  }
1021
- ._Chat--hasMessages_150yz_25 ._Chat-formHelper_150yz_60 {
955
+ ._Chat--hasMessages_14j71_25 ._Chat-formHelper_14j71_60 {
1022
956
  opacity: 0;
1023
957
  transition: opacity 250ms ease-in;
1024
958
  }
1025
- ._Chat-examplePrompts_150yz_75 {
959
+ ._Chat-examplePrompts_14j71_75 {
1026
960
  align-items: center;
1027
961
  display: flex;
1028
962
  flex-wrap: nowrap;
@@ -1031,7 +965,7 @@ p {
1031
965
  width: 100%;
1032
966
  overflow-x: auto;
1033
967
  }
1034
- ._Chat-examplePrompt_150yz_75 {
968
+ ._Chat-examplePrompt_14j71_75 {
1035
969
  align-items: center;
1036
970
  background: white;
1037
971
  border: 1px solid var(--puck-color-grey-09);
@@ -1042,34 +976,33 @@ p {
1042
976
  padding: 6px 12px;
1043
977
  text-wrap: nowrap;
1044
978
  }
1045
- ._Chat-examplePrompt_150yz_75:hover {
979
+ ._Chat-examplePrompt_14j71_75:hover {
1046
980
  background: var(--puck-color-azure-11);
1047
981
  border-color: var(--puck-color-azure-08);
1048
982
  color: var(--puck-color-azure-04);
1049
983
  }
1050
- ._Chat-examplePromptArrow_150yz_103 {
984
+ ._Chat-examplePromptArrow_14j71_103 {
1051
985
  margin-left: auto;
1052
986
  }
1053
- ._Chat-default_150yz_107 {
987
+ ._Chat-default_14j71_107 {
1054
988
  overflow-y: auto;
1055
989
  flex-grow: 1;
1056
990
  }
1057
- ._Chat--hasMessages_150yz_25 ._Chat-default_150yz_107 {
991
+ ._Chat--hasMessages_14j71_25 ._Chat-default_14j71_107 {
1058
992
  opacity: 0;
1059
993
  padding: 0;
1060
994
  pointer-events: none;
1061
995
  transition: opacity 250ms ease-in;
1062
996
  }
1063
- ._Chat--hasMessages_150yz_25 {
997
+ ._Chat--hasMessages_14j71_25 {
1064
998
  background-color: white;
1065
999
  transition: background-color 250ms ease-in;
1066
1000
  }
1067
- ._ChatMessage_150yz_124 {
1001
+ ._ChatMessage_14j71_124 {
1068
1002
  font-size: var(--puck-font-size-xs);
1069
1003
  line-height: var(--line-height-s);
1070
- overflow-wrap: break-word;
1071
1004
  }
1072
- ._ChatMessage--userRole_150yz_130 ._ChatMessage-text_150yz_130 {
1005
+ ._ChatMessage--userRole_14j71_129 ._ChatMessage-text_14j71_129 {
1073
1006
  background: var(--puck-color-azure-10);
1074
1007
  border-radius: 16px;
1075
1008
  color: var(--puck-color-grey-03);
@@ -1078,64 +1011,64 @@ p {
1078
1011
  margin-top: 8px;
1079
1012
  padding: 12px 16px;
1080
1013
  }
1081
- ._ChatMessage_150yz_124 ul,
1082
- ._ChatMessage_150yz_124 ol {
1014
+ ._ChatMessage_14j71_124 ul,
1015
+ ._ChatMessage_14j71_124 ol {
1083
1016
  list-style: decimal;
1084
1017
  margin: 0;
1085
1018
  margin-bottom: 12px;
1086
1019
  margin-top: 12px;
1087
1020
  padding-left: 32px;
1088
1021
  }
1089
- ._ChatMessage_150yz_124 li {
1022
+ ._ChatMessage_14j71_124 li {
1090
1023
  margin-bottom: 8px;
1091
1024
  margin-top: 8px;
1092
1025
  padding-left: 8px;
1093
1026
  }
1094
- ._ChatMessage_150yz_124 h1,
1095
- ._ChatMessage_150yz_124 h2,
1096
- ._ChatMessage_150yz_124 h3,
1097
- ._ChatMessage_150yz_124 h4,
1098
- ._ChatMessage_150yz_124 h5,
1099
- ._ChatMessage_150yz_124 h6 {
1027
+ ._ChatMessage_14j71_124 h1,
1028
+ ._ChatMessage_14j71_124 h2,
1029
+ ._ChatMessage_14j71_124 h3,
1030
+ ._ChatMessage_14j71_124 h4,
1031
+ ._ChatMessage_14j71_124 h5,
1032
+ ._ChatMessage_14j71_124 h6 {
1100
1033
  font-weight: 600;
1101
1034
  }
1102
- ._ChatMessage_150yz_124 h1 {
1035
+ ._ChatMessage_14j71_124 h1 {
1103
1036
  font-size: var(--puck-font-l);
1104
1037
  }
1105
- ._ChatMessage_150yz_124 h2 {
1038
+ ._ChatMessage_14j71_124 h2 {
1106
1039
  font-size: var(--puck-font-m);
1107
1040
  }
1108
- ._ChatMessage_150yz_124 h3 {
1041
+ ._ChatMessage_14j71_124 h3 {
1109
1042
  font-size: var(--puck-font-m);
1110
1043
  }
1111
- ._ChatMessage_150yz_124 h4 {
1044
+ ._ChatMessage_14j71_124 h4 {
1112
1045
  font-size: var(--puck-font-s);
1113
1046
  }
1114
- ._ChatMessage_150yz_124 h5 {
1047
+ ._ChatMessage_14j71_124 h5 {
1115
1048
  font-size: var(--puck-font-xs);
1116
1049
  }
1117
- ._ChatMessage_150yz_124 h6 {
1050
+ ._ChatMessage_14j71_124 h6 {
1118
1051
  font-size: var(--puck-font-xm);
1119
1052
  }
1120
- ._ChatMessage_150yz_124 p {
1053
+ ._ChatMessage_14j71_124 p {
1121
1054
  margin-bottom: 8px;
1122
1055
  margin-top: 8px;
1123
1056
  }
1124
- ._ChatMessage_150yz_124 a {
1057
+ ._ChatMessage_14j71_124 a {
1125
1058
  color: var(--puck-color-azure-04);
1126
1059
  font-weight: 600;
1127
1060
  text-decoration: none;
1128
1061
  }
1129
- ._ChatMessage_150yz_124 a:hover {
1062
+ ._ChatMessage_14j71_124 a:hover {
1130
1063
  color: var(--puck-color-azure-05);
1131
1064
  }
1132
- ._ChatMessage_150yz_124 hr {
1065
+ ._ChatMessage_14j71_124 hr {
1133
1066
  border-top: none;
1134
1067
  border-bottom-color: var(--puck-color-grey-09);
1135
1068
  margin-bottom: 16px;
1136
1069
  margin-top: 16px;
1137
1070
  }
1138
- ._ChatMessage_150yz_124 blockquote {
1071
+ ._ChatMessage_14j71_124 blockquote {
1139
1072
  margin-bottom: 8px;
1140
1073
  margin-top: 8px;
1141
1074
  margin-left: 0;
@@ -1144,7 +1077,7 @@ p {
1144
1077
  padding-bottom: 2px;
1145
1078
  padding-top: 2px;
1146
1079
  }
1147
- ._ChatMessage-data_150yz_220 {
1080
+ ._ChatMessage-data_14j71_219 {
1148
1081
  background: var(--puck-color-grey-12);
1149
1082
  border: 1px solid var(--puck-color-grey-08);
1150
1083
  border-radius: 16px;
@@ -1154,19 +1087,19 @@ p {
1154
1087
  margin-top: 12px;
1155
1088
  padding: 12px 16px;
1156
1089
  }
1157
- ._ChatMessage-dataInner_150yz_231 {
1090
+ ._ChatMessage-dataInner_14j71_230 {
1158
1091
  align-items: center;
1159
1092
  display: flex;
1160
1093
  gap: 8px;
1161
1094
  }
1162
- ._ChatMessage-dataIcon_150yz_237 {
1095
+ ._ChatMessage-dataIcon_14j71_236 {
1163
1096
  display: flex;
1164
1097
  }
1165
- ._Chat-loader_150yz_241 {
1098
+ ._Chat-loader_14j71_240 {
1166
1099
  padding: 16px;
1167
1100
  padding-top: 0;
1168
1101
  }
1169
- ._Chat-error_150yz_246 {
1102
+ ._Chat-error_14j71_245 {
1170
1103
  align-items: center;
1171
1104
  display: flex;
1172
1105
  gap: 8px;
@@ -1174,10 +1107,10 @@ p {
1174
1107
  margin: 16px;
1175
1108
  margin-top: 0;
1176
1109
  }
1177
- ._Chat-errorLabel_150yz_255 {
1110
+ ._Chat-errorLabel_14j71_254 {
1178
1111
  color: var(--puck-color-red-04);
1179
1112
  }
1180
- ._Chat-errorAction_150yz_259 {
1113
+ ._Chat-errorAction_14j71_258 {
1181
1114
  margin-left: auto;
1182
1115
  }
1183
1116
 
package/dist/index.d.mts CHANGED
@@ -1,115 +1,22 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { UIMessage, ChatStatus } from 'ai';
3
+ import { PuckProviderMetadata, PuckDataParts } from '@puckeditor/platform-types';
4
+ import { ReactNode, RefObject } from 'react';
2
5
 
3
- type _JSONSchema = boolean | JSONSchema;
4
- type JSONSchema = {
5
- [k: string]: unknown;
6
- $schema?: "https://json-schema.org/draft/2020-12/schema" | "http://json-schema.org/draft-07/schema#" | "http://json-schema.org/draft-04/schema#";
7
- $id?: string;
8
- $anchor?: string;
9
- $ref?: string;
10
- $dynamicRef?: string;
11
- $dynamicAnchor?: string;
12
- $vocabulary?: Record<string, boolean>;
13
- $comment?: string;
14
- $defs?: Record<string, JSONSchema>;
15
- type?: "object" | "array" | "string" | "number" | "boolean" | "null" | "integer";
16
- additionalItems?: _JSONSchema;
17
- unevaluatedItems?: _JSONSchema;
18
- prefixItems?: _JSONSchema[];
19
- items?: _JSONSchema | _JSONSchema[];
20
- contains?: _JSONSchema;
21
- additionalProperties?: _JSONSchema;
22
- unevaluatedProperties?: _JSONSchema;
23
- properties?: Record<string, _JSONSchema>;
24
- patternProperties?: Record<string, _JSONSchema>;
25
- dependentSchemas?: Record<string, _JSONSchema>;
26
- propertyNames?: _JSONSchema;
27
- if?: _JSONSchema;
28
- then?: _JSONSchema;
29
- else?: _JSONSchema;
30
- allOf?: JSONSchema[];
31
- anyOf?: JSONSchema[];
32
- oneOf?: JSONSchema[];
33
- not?: _JSONSchema;
34
- multipleOf?: number;
35
- maximum?: number;
36
- exclusiveMaximum?: number | boolean;
37
- minimum?: number;
38
- exclusiveMinimum?: number | boolean;
39
- maxLength?: number;
40
- minLength?: number;
41
- pattern?: string;
42
- maxItems?: number;
43
- minItems?: number;
44
- uniqueItems?: boolean;
45
- maxContains?: number;
46
- minContains?: number;
47
- maxProperties?: number;
48
- minProperties?: number;
49
- required?: string[];
50
- dependentRequired?: Record<string, string[]>;
51
- enum?: Array<string | number | boolean | null>;
52
- const?: string | number | boolean | null;
53
- id?: string;
54
- title?: string;
55
- description?: string;
56
- default?: unknown;
57
- deprecated?: boolean;
58
- readOnly?: boolean;
59
- writeOnly?: boolean;
60
- nullable?: boolean;
61
- examples?: unknown[];
62
- format?: string;
63
- contentMediaType?: string;
64
- contentEncoding?: string;
65
- contentSchema?: JSONSchema;
66
- _prefault?: unknown;
67
- };
68
-
69
- type ComponentAiParams = {
70
- instructions?: string;
71
- schema?: JSONSchema;
72
- defaultZone?: { allow?: string[]; disallow?: string[]; disabled?: boolean };
73
- };
74
-
75
- type FieldAiParams = {
76
- instructions?: string;
77
- exclude?: boolean;
78
- required?: boolean;
79
- stream?: boolean;
80
- schema?: JSONSchema;
81
- };
82
-
83
- declare module "@measured/puck" {
84
- export interface ComponentMetadata {
85
- ai?: ComponentAiParams;
86
- }
6
+ type PuckMessage = UIMessage<PuckProviderMetadata, PuckDataParts>;
87
7
 
88
- export interface ComponentConfigExtensions {
89
- ai?: ComponentAiParams;
90
- }
91
-
92
- export interface FieldMetadata {
93
- ai?: FieldAiParams;
94
- }
95
-
96
- export interface BaseField {
97
- ai?: FieldAiParams;
98
- }
99
- }
100
-
101
- type AiPluginProps = {
8
+ type ChatProps$1 = {
102
9
  host?: string;
103
- chat?: {
104
- onSubmit?: (prompt: string) => void;
105
- examplePrompts?: {
106
- href: string;
107
- label: string;
108
- }[];
109
- };
10
+ onSubmit?: (prompt: string) => void;
11
+ examplePrompts?: {
12
+ href: string;
13
+ label: string;
14
+ }[];
15
+ chatId?: string;
16
+ initialMessages?: PuckMessage[];
110
17
  };
111
18
 
112
- declare function createAiPlugin(opts?: AiPluginProps): {
19
+ declare function createAIPlugin(opts?: ChatProps$1): {
113
20
  label: string;
114
21
  name: string;
115
22
  render: () => react_jsx_runtime.JSX.Element;
@@ -117,4 +24,17 @@ declare function createAiPlugin(opts?: AiPluginProps): {
117
24
  mobilePanelHeight: "min-content";
118
25
  };
119
26
 
120
- export { createAiPlugin };
27
+ type ChatProps = {
28
+ children?: ReactNode;
29
+ examplePrompts?: ReactNode;
30
+ handleSubmit?: (prompt: string) => void;
31
+ hideInput?: boolean;
32
+ inputRef?: RefObject<HTMLTextAreaElement | null>;
33
+ status?: ChatStatus;
34
+ messages?: PuckMessage[];
35
+ error?: string;
36
+ handleRetry?: () => void;
37
+ };
38
+ declare function ChatBody({ children, examplePrompts, handleSubmit, hideInput, inputRef, messages, status, error, handleRetry, }: ChatProps): react_jsx_runtime.JSX.Element;
39
+
40
+ export { ChatBody, createAIPlugin as default };