@puckeditor/plugin-ai 0.1.0-canary.edb4f9bd → 0.1.0-canary.f56e596d

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,43 +372,72 @@ 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_1czuc_1 {
375
+ ._Heading_qkzg9_1 {
376
376
  display: block;
377
377
  font-weight: 700;
378
378
  margin: 0;
379
379
  }
380
- ._Heading_1czuc_1 b {
380
+ ._Heading_qkzg9_1 b {
381
381
  font-weight: 700;
382
382
  }
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 {
383
+ ._Heading--xxxxl_qkzg9_11 {
389
384
  font-size: var(--puck-font-size-xxxl);
390
385
  }
391
- ._Heading--xxl_1czuc_21 {
386
+ ._Heading--xxxl_qkzg9_15 {
392
387
  font-size: var(--puck-font-size-xxl);
393
388
  }
394
- ._Heading--xl_1czuc_25 {
389
+ ._Heading--xxl_qkzg9_19 {
395
390
  font-size: var(--puck-font-size-xl);
396
391
  }
397
- ._Heading--l_1czuc_29 {
392
+ ._Heading--xl_qkzg9_23 {
398
393
  font-size: var(--puck-font-size-l);
399
394
  }
400
- ._Heading--m_1czuc_33 {
395
+ ._Heading--l_qkzg9_27 {
401
396
  font-size: var(--puck-font-size-m);
402
397
  }
403
- ._Heading--s_1czuc_37 {
398
+ ._Heading--m_qkzg9_31 {
404
399
  font-size: var(--puck-font-size-s);
405
400
  }
406
- ._Heading--xs_1czuc_41 {
401
+ ._Heading--s_qkzg9_35 {
407
402
  font-size: var(--puck-font-size-xs);
408
403
  }
409
- ._Heading--xxs_1czuc_45 {
404
+ ._Heading--xs_qkzg9_39 {
405
+ font-size: var(--puck-font-size-xxs);
406
+ }
407
+ ._Heading--xxs_qkzg9_43 {
410
408
  font-size: var(--puck-font-size-xxs);
411
409
  }
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
+ }
412
441
 
413
442
  /* css-module:/home/runner/work/puck-platform/puck-platform/packages/platform-client/components/Align/Align.module.css/#css-module-data */
414
443
  ._Align_oewlu_1 {
@@ -602,13 +631,13 @@ p {
602
631
  }
603
632
 
604
633
  /* css-module:/home/runner/work/puck-platform/puck-platform/packages/platform-client/components/Page/Page.module.css/#css-module-data */
605
- ._Page_1pzwy_1 {
634
+ ._Page_1ajs1_1 {
606
635
  display: flex;
607
636
  flex-direction: column;
608
637
  height: 100%;
609
638
  overflow: hidden;
610
639
  }
611
- ._Page-masthead_1pzwy_8 {
640
+ ._Page-masthead_1ajs1_8 {
612
641
  align-items: center;
613
642
  display: flex;
614
643
  gap: 16px;
@@ -616,45 +645,47 @@ p {
616
645
  box-sizing: border-box;
617
646
  border-bottom: 1px solid var(--puck-color-grey-10);
618
647
  min-height: 64px;
648
+ overflow-x: auto;
619
649
  }
620
- ._Page-crumbs_1pzwy_18 {
650
+ ._Page-crumbs_1ajs1_19 {
621
651
  display: flex;
622
652
  gap: 32px;
623
653
  }
624
- ._Page-crumb_1pzwy_18 {
654
+ ._Page-crumb_1ajs1_19 {
625
655
  color: var(--puck-color-grey-05);
626
656
  position: relative;
657
+ white-space: nowrap;
627
658
  }
628
- ._Page-crumbLink_1pzwy_28 {
659
+ ._Page-crumbLink_1ajs1_30 {
629
660
  color: var(--puck-color-grey-05);
630
661
  text-decoration: none;
631
662
  }
632
- ._Page-crumbLink_1pzwy_28:hover {
663
+ ._Page-crumbLink_1ajs1_30:hover {
633
664
  color: var(--puck-color-azure-04);
634
665
  }
635
- ._Page-crumb_1pzwy_18:last-of-type {
666
+ ._Page-crumb_1ajs1_19:last-of-type {
636
667
  color: var(--puck-color-grey-01);
637
668
  font-weight: 600;
638
669
  }
639
- ._Page-crumb_1pzwy_18::before {
670
+ ._Page-crumb_1ajs1_19::before {
640
671
  position: absolute;
641
672
  content: "/";
642
673
  left: -19px;
643
674
  color: var(--puck-color-grey-09);
644
675
  font-weight: 400;
645
676
  }
646
- ._Page-crumb_1pzwy_18:first-of-type::before {
677
+ ._Page-crumb_1ajs1_19:first-of-type::before {
647
678
  display: none;
648
679
  }
649
- ._Page-crumb_1pzwy_18 {
680
+ ._Page-crumb_1ajs1_19 {
650
681
  color: var(--puck-color-grey-05);
651
682
  position: relative;
652
683
  text-decoration: none;
653
684
  }
654
- ._Page-actions_1pzwy_60 {
685
+ ._Page-actions_1ajs1_62 {
655
686
  margin-left: auto;
656
687
  }
657
- ._Page-footer_1pzwy_64 {
688
+ ._Page-footer_1ajs1_66 {
658
689
  border-top: 1px solid var(--puck-color-grey-10);
659
690
  padding: 16px 24px;
660
691
  }
@@ -893,8 +924,43 @@ p {
893
924
  padding-top: 128px;
894
925
  }
895
926
 
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
+
896
962
  /* css-module:/home/runner/work/puck-platform/puck-platform/packages/plugin-ai/src/components/ChatBody/styles.module.css/#css-module-data */
897
- ._Chat_14j71_1 {
963
+ ._Chat_150yz_1 {
898
964
  --fade-size: 32px;
899
965
  --chat-background-color: white;
900
966
  display: flex;
@@ -904,46 +970,46 @@ p {
904
970
  overflow: hidden;
905
971
  }
906
972
  @media (min-width: 638px) {
907
- ._Chat_14j71_1 {
973
+ ._Chat_150yz_1 {
908
974
  max-height: none;
909
975
  }
910
976
  }
911
- ._Chat-inner_14j71_17 {
977
+ ._Chat-inner_150yz_17 {
912
978
  background-color: var(--chat-background-color);
913
979
  display: flex;
914
980
  flex-direction: column;
915
981
  max-height: 100%;
916
982
  position: relative;
917
983
  }
918
- ._Chat--hasMessages_14j71_25 ._Chat-inner_14j71_17 {
984
+ ._Chat--hasMessages_150yz_25 ._Chat-inner_150yz_17 {
919
985
  padding-top: 0;
920
986
  }
921
- ._Chat_14j71_1:not(._Chat--hasChildren_14j71_29) ._Chat-inner_14j71_17 {
987
+ ._Chat_150yz_1:not(._Chat--hasChildren_150yz_29) ._Chat-inner_150yz_17 {
922
988
  height: 100%;
923
989
  padding-top: 0;
924
990
  }
925
- ._Chat--hasMessages_14j71_25 ._Chat-messages_14j71_34 {
991
+ ._Chat--hasMessages_150yz_25 ._Chat-messages_150yz_34 {
926
992
  display: flex;
927
993
  flex-direction: column-reverse;
928
994
  padding: 16px;
929
995
  overflow: auto;
930
996
  }
931
- ._Chat-form_14j71_41 {
997
+ ._Chat-form_150yz_41 {
932
998
  background-color: white;
933
999
  padding: 16px;
934
1000
  }
935
- ._Chat--hideInput_14j71_46 ._Chat-form_14j71_41 {
1001
+ ._Chat--hideInput_150yz_46 ._Chat-form_150yz_41 {
936
1002
  display: none;
937
1003
  }
938
- ._Chat--hasMessages_14j71_25 ._Chat-form_14j71_41 {
1004
+ ._Chat--hasMessages_150yz_25 ._Chat-form_150yz_41 {
939
1005
  border-top: 1px solid var(--puck-color-grey-09);
940
1006
  }
941
1007
  @media (min-width: 638px) {
942
- ._Chat-form_14j71_41 {
1008
+ ._Chat-form_150yz_41 {
943
1009
  border-top: 1px solid var(--puck-color-grey-09);
944
1010
  }
945
1011
  }
946
- ._Chat-formHelper_14j71_60 {
1012
+ ._Chat-formHelper_150yz_60 {
947
1013
  align-items: center;
948
1014
  display: flex;
949
1015
  color: var(--puck-color-grey-04);
@@ -952,11 +1018,11 @@ p {
952
1018
  gap: 8px;
953
1019
  padding-bottom: 12px;
954
1020
  }
955
- ._Chat--hasMessages_14j71_25 ._Chat-formHelper_14j71_60 {
1021
+ ._Chat--hasMessages_150yz_25 ._Chat-formHelper_150yz_60 {
956
1022
  opacity: 0;
957
1023
  transition: opacity 250ms ease-in;
958
1024
  }
959
- ._Chat-examplePrompts_14j71_75 {
1025
+ ._Chat-examplePrompts_150yz_75 {
960
1026
  align-items: center;
961
1027
  display: flex;
962
1028
  flex-wrap: nowrap;
@@ -965,7 +1031,7 @@ p {
965
1031
  width: 100%;
966
1032
  overflow-x: auto;
967
1033
  }
968
- ._Chat-examplePrompt_14j71_75 {
1034
+ ._Chat-examplePrompt_150yz_75 {
969
1035
  align-items: center;
970
1036
  background: white;
971
1037
  border: 1px solid var(--puck-color-grey-09);
@@ -976,33 +1042,34 @@ p {
976
1042
  padding: 6px 12px;
977
1043
  text-wrap: nowrap;
978
1044
  }
979
- ._Chat-examplePrompt_14j71_75:hover {
1045
+ ._Chat-examplePrompt_150yz_75:hover {
980
1046
  background: var(--puck-color-azure-11);
981
1047
  border-color: var(--puck-color-azure-08);
982
1048
  color: var(--puck-color-azure-04);
983
1049
  }
984
- ._Chat-examplePromptArrow_14j71_103 {
1050
+ ._Chat-examplePromptArrow_150yz_103 {
985
1051
  margin-left: auto;
986
1052
  }
987
- ._Chat-default_14j71_107 {
1053
+ ._Chat-default_150yz_107 {
988
1054
  overflow-y: auto;
989
1055
  flex-grow: 1;
990
1056
  }
991
- ._Chat--hasMessages_14j71_25 ._Chat-default_14j71_107 {
1057
+ ._Chat--hasMessages_150yz_25 ._Chat-default_150yz_107 {
992
1058
  opacity: 0;
993
1059
  padding: 0;
994
1060
  pointer-events: none;
995
1061
  transition: opacity 250ms ease-in;
996
1062
  }
997
- ._Chat--hasMessages_14j71_25 {
1063
+ ._Chat--hasMessages_150yz_25 {
998
1064
  background-color: white;
999
1065
  transition: background-color 250ms ease-in;
1000
1066
  }
1001
- ._ChatMessage_14j71_124 {
1067
+ ._ChatMessage_150yz_124 {
1002
1068
  font-size: var(--puck-font-size-xs);
1003
1069
  line-height: var(--line-height-s);
1070
+ overflow-wrap: break-word;
1004
1071
  }
1005
- ._ChatMessage--userRole_14j71_129 ._ChatMessage-text_14j71_129 {
1072
+ ._ChatMessage--userRole_150yz_130 ._ChatMessage-text_150yz_130 {
1006
1073
  background: var(--puck-color-azure-10);
1007
1074
  border-radius: 16px;
1008
1075
  color: var(--puck-color-grey-03);
@@ -1011,64 +1078,64 @@ p {
1011
1078
  margin-top: 8px;
1012
1079
  padding: 12px 16px;
1013
1080
  }
1014
- ._ChatMessage_14j71_124 ul,
1015
- ._ChatMessage_14j71_124 ol {
1081
+ ._ChatMessage_150yz_124 ul,
1082
+ ._ChatMessage_150yz_124 ol {
1016
1083
  list-style: decimal;
1017
1084
  margin: 0;
1018
1085
  margin-bottom: 12px;
1019
1086
  margin-top: 12px;
1020
1087
  padding-left: 32px;
1021
1088
  }
1022
- ._ChatMessage_14j71_124 li {
1089
+ ._ChatMessage_150yz_124 li {
1023
1090
  margin-bottom: 8px;
1024
1091
  margin-top: 8px;
1025
1092
  padding-left: 8px;
1026
1093
  }
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 {
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 {
1033
1100
  font-weight: 600;
1034
1101
  }
1035
- ._ChatMessage_14j71_124 h1 {
1102
+ ._ChatMessage_150yz_124 h1 {
1036
1103
  font-size: var(--puck-font-l);
1037
1104
  }
1038
- ._ChatMessage_14j71_124 h2 {
1105
+ ._ChatMessage_150yz_124 h2 {
1039
1106
  font-size: var(--puck-font-m);
1040
1107
  }
1041
- ._ChatMessage_14j71_124 h3 {
1108
+ ._ChatMessage_150yz_124 h3 {
1042
1109
  font-size: var(--puck-font-m);
1043
1110
  }
1044
- ._ChatMessage_14j71_124 h4 {
1111
+ ._ChatMessage_150yz_124 h4 {
1045
1112
  font-size: var(--puck-font-s);
1046
1113
  }
1047
- ._ChatMessage_14j71_124 h5 {
1114
+ ._ChatMessage_150yz_124 h5 {
1048
1115
  font-size: var(--puck-font-xs);
1049
1116
  }
1050
- ._ChatMessage_14j71_124 h6 {
1117
+ ._ChatMessage_150yz_124 h6 {
1051
1118
  font-size: var(--puck-font-xm);
1052
1119
  }
1053
- ._ChatMessage_14j71_124 p {
1120
+ ._ChatMessage_150yz_124 p {
1054
1121
  margin-bottom: 8px;
1055
1122
  margin-top: 8px;
1056
1123
  }
1057
- ._ChatMessage_14j71_124 a {
1124
+ ._ChatMessage_150yz_124 a {
1058
1125
  color: var(--puck-color-azure-04);
1059
1126
  font-weight: 600;
1060
1127
  text-decoration: none;
1061
1128
  }
1062
- ._ChatMessage_14j71_124 a:hover {
1129
+ ._ChatMessage_150yz_124 a:hover {
1063
1130
  color: var(--puck-color-azure-05);
1064
1131
  }
1065
- ._ChatMessage_14j71_124 hr {
1132
+ ._ChatMessage_150yz_124 hr {
1066
1133
  border-top: none;
1067
1134
  border-bottom-color: var(--puck-color-grey-09);
1068
1135
  margin-bottom: 16px;
1069
1136
  margin-top: 16px;
1070
1137
  }
1071
- ._ChatMessage_14j71_124 blockquote {
1138
+ ._ChatMessage_150yz_124 blockquote {
1072
1139
  margin-bottom: 8px;
1073
1140
  margin-top: 8px;
1074
1141
  margin-left: 0;
@@ -1077,7 +1144,7 @@ p {
1077
1144
  padding-bottom: 2px;
1078
1145
  padding-top: 2px;
1079
1146
  }
1080
- ._ChatMessage-data_14j71_219 {
1147
+ ._ChatMessage-data_150yz_220 {
1081
1148
  background: var(--puck-color-grey-12);
1082
1149
  border: 1px solid var(--puck-color-grey-08);
1083
1150
  border-radius: 16px;
@@ -1087,19 +1154,19 @@ p {
1087
1154
  margin-top: 12px;
1088
1155
  padding: 12px 16px;
1089
1156
  }
1090
- ._ChatMessage-dataInner_14j71_230 {
1157
+ ._ChatMessage-dataInner_150yz_231 {
1091
1158
  align-items: center;
1092
1159
  display: flex;
1093
1160
  gap: 8px;
1094
1161
  }
1095
- ._ChatMessage-dataIcon_14j71_236 {
1162
+ ._ChatMessage-dataIcon_150yz_237 {
1096
1163
  display: flex;
1097
1164
  }
1098
- ._Chat-loader_14j71_240 {
1165
+ ._Chat-loader_150yz_241 {
1099
1166
  padding: 16px;
1100
1167
  padding-top: 0;
1101
1168
  }
1102
- ._Chat-error_14j71_245 {
1169
+ ._Chat-error_150yz_246 {
1103
1170
  align-items: center;
1104
1171
  display: flex;
1105
1172
  gap: 8px;
@@ -1107,10 +1174,10 @@ p {
1107
1174
  margin: 16px;
1108
1175
  margin-top: 0;
1109
1176
  }
1110
- ._Chat-errorLabel_14j71_254 {
1177
+ ._Chat-errorLabel_150yz_255 {
1111
1178
  color: var(--puck-color-red-04);
1112
1179
  }
1113
- ._Chat-errorAction_14j71_258 {
1180
+ ._Chat-errorAction_150yz_259 {
1114
1181
  margin-left: auto;
1115
1182
  }
1116
1183
 
package/dist/index.js CHANGED
@@ -20917,7 +20917,7 @@ init_react_import();
20917
20917
 
20918
20918
  // css-module:/home/runner/work/puck-platform/puck-platform/packages/platform-client/components/Heading/Heading.module.css#css-module
20919
20919
  init_react_import();
20920
- var Heading_module_default = { "Heading": "_Heading_1czuc_1", "Heading--xxxxl": "_Heading--xxxxl_1czuc_11", "Heading--xxxl": "_Heading--xxxl_1czuc_17", "Heading--xxl": "_Heading--xxl_1czuc_21", "Heading--xl": "_Heading--xl_1czuc_25", "Heading--l": "_Heading--l_1czuc_29", "Heading--m": "_Heading--m_1czuc_33", "Heading--s": "_Heading--s_1czuc_37", "Heading--xs": "_Heading--xs_1czuc_41", "Heading--xxs": "_Heading--xxs_1czuc_45" };
20920
+ var Heading_module_default = { "Heading": "_Heading_qkzg9_1", "Heading--xxxxl": "_Heading--xxxxl_qkzg9_11", "Heading--xxxl": "_Heading--xxxl_qkzg9_15", "Heading--xxl": "_Heading--xxl_qkzg9_19", "Heading--xl": "_Heading--xl_qkzg9_23", "Heading--l": "_Heading--l_qkzg9_27", "Heading--m": "_Heading--m_qkzg9_31", "Heading--s": "_Heading--s_qkzg9_35", "Heading--xs": "_Heading--xs_qkzg9_39", "Heading--xxs": "_Heading--xxs_qkzg9_43" };
20921
20921
 
20922
20922
  // ../platform-client/components/Heading/Heading.tsx
20923
20923
  var import_jsx_runtime4 = require("react/jsx-runtime");
@@ -21182,7 +21182,7 @@ init_react_import();
21182
21182
 
21183
21183
  // css-module:/home/runner/work/puck-platform/puck-platform/packages/platform-client/components/Page/Page.module.css#css-module
21184
21184
  init_react_import();
21185
- var Page_module_default = { "Page": "_Page_1pzwy_1", "Page-masthead": "_Page-masthead_1pzwy_8", "Page-crumbs": "_Page-crumbs_1pzwy_18", "Page-crumb": "_Page-crumb_1pzwy_18", "Page-crumbLink": "_Page-crumbLink_1pzwy_28", "Page-actions": "_Page-actions_1pzwy_60", "Page-footer": "_Page-footer_1pzwy_64" };
21185
+ var Page_module_default = { "Page": "_Page_1ajs1_1", "Page-masthead": "_Page-masthead_1ajs1_8", "Page-crumbs": "_Page-crumbs_1ajs1_19", "Page-crumb": "_Page-crumb_1ajs1_19", "Page-crumbLink": "_Page-crumbLink_1ajs1_30", "Page-actions": "_Page-actions_1ajs1_62", "Page-footer": "_Page-footer_1ajs1_66" };
21186
21186
 
21187
21187
  // ../platform-client/components/Page/Page.tsx
21188
21188
  var import_jsx_runtime14 = require("react/jsx-runtime");
@@ -21274,15 +21274,26 @@ var VerticalSpace_module_default = { "VerticalSpace": "_VerticalSpace_1tjaw_1",
21274
21274
  var import_jsx_runtime20 = require("react/jsx-runtime");
21275
21275
  var getClassName15 = get_class_name_factory_default("VerticalSpace", VerticalSpace_module_default);
21276
21276
 
21277
+ // ../platform-client/components/Viewport/index.tsx
21278
+ init_react_import();
21279
+
21280
+ // css-module:/home/runner/work/puck-platform/puck-platform/packages/platform-client/components/Viewport/styles.module.css#css-module
21281
+ init_react_import();
21282
+ var styles_module_default3 = { "Viewport": "_Viewport_1vvhm_3", "Viewport--standard": "_Viewport--standard_1vvhm_6", "Viewport--inline": "_Viewport--inline_1vvhm_7", "Viewport--narrow": "_Viewport--narrow_1vvhm_11", "Viewport--flex": "_Viewport--flex_1vvhm_19" };
21283
+
21284
+ // ../platform-client/components/Viewport/index.tsx
21285
+ var import_jsx_runtime21 = require("react/jsx-runtime");
21286
+ var cx4 = getClassNameFactory("Viewport", styles_module_default3);
21287
+
21277
21288
  // ../platform-client/context/editor.tsx
21278
21289
  init_react_import();
21279
21290
  var import_react15 = require("react");
21280
- var import_jsx_runtime21 = require("react/jsx-runtime");
21291
+ var import_jsx_runtime22 = require("react/jsx-runtime");
21281
21292
  var ctx = (0, import_react15.createContext)({});
21282
21293
 
21283
21294
  // css-module:/home/runner/work/puck-platform/puck-platform/packages/plugin-ai/src/components/ChatBody/styles.module.css#css-module
21284
21295
  init_react_import();
21285
- var styles_module_default3 = { "Chat": "_Chat_14j71_1", "Chat-inner": "_Chat-inner_14j71_17", "Chat--hasMessages": "_Chat--hasMessages_14j71_25", "Chat--hasChildren": "_Chat--hasChildren_14j71_29", "Chat-messages": "_Chat-messages_14j71_34", "Chat-form": "_Chat-form_14j71_41", "Chat--hideInput": "_Chat--hideInput_14j71_46", "Chat-formHelper": "_Chat-formHelper_14j71_60", "Chat-examplePrompts": "_Chat-examplePrompts_14j71_75", "Chat-examplePrompt": "_Chat-examplePrompt_14j71_75", "Chat-examplePromptArrow": "_Chat-examplePromptArrow_14j71_103", "Chat-default": "_Chat-default_14j71_107", "ChatMessage": "_ChatMessage_14j71_124", "ChatMessage--userRole": "_ChatMessage--userRole_14j71_129", "ChatMessage-text": "_ChatMessage-text_14j71_129", "ChatMessage-data": "_ChatMessage-data_14j71_219", "ChatMessage-dataInner": "_ChatMessage-dataInner_14j71_230", "ChatMessage-dataIcon": "_ChatMessage-dataIcon_14j71_236", "Chat-loader": "_Chat-loader_14j71_240", "Chat-error": "_Chat-error_14j71_245", "Chat-errorLabel": "_Chat-errorLabel_14j71_254", "Chat-errorAction": "_Chat-errorAction_14j71_258" };
21296
+ var styles_module_default4 = { "Chat": "_Chat_150yz_1", "Chat-inner": "_Chat-inner_150yz_17", "Chat--hasMessages": "_Chat--hasMessages_150yz_25", "Chat--hasChildren": "_Chat--hasChildren_150yz_29", "Chat-messages": "_Chat-messages_150yz_34", "Chat-form": "_Chat-form_150yz_41", "Chat--hideInput": "_Chat--hideInput_150yz_46", "Chat-formHelper": "_Chat-formHelper_150yz_60", "Chat-examplePrompts": "_Chat-examplePrompts_150yz_75", "Chat-examplePrompt": "_Chat-examplePrompt_150yz_75", "Chat-examplePromptArrow": "_Chat-examplePromptArrow_150yz_103", "Chat-default": "_Chat-default_150yz_107", "ChatMessage": "_ChatMessage_150yz_124", "ChatMessage--userRole": "_ChatMessage--userRole_150yz_130", "ChatMessage-text": "_ChatMessage-text_150yz_130", "ChatMessage-data": "_ChatMessage-data_150yz_220", "ChatMessage-dataInner": "_ChatMessage-dataInner_150yz_231", "ChatMessage-dataIcon": "_ChatMessage-dataIcon_150yz_237", "Chat-loader": "_Chat-loader_150yz_241", "Chat-error": "_Chat-error_150yz_246", "Chat-errorLabel": "_Chat-errorLabel_150yz_255", "Chat-errorAction": "_Chat-errorAction_150yz_259" };
21286
21297
 
21287
21298
  // src/components/PromptForm/index.tsx
21288
21299
  init_react_import();
@@ -21290,11 +21301,11 @@ var import_react16 = require("react");
21290
21301
 
21291
21302
  // css-module:/home/runner/work/puck-platform/puck-platform/packages/plugin-ai/src/components/PromptForm/styles.module.css#css-module
21292
21303
  init_react_import();
21293
- var styles_module_default4 = { "PromptForm": "_PromptForm_136g1_1", "PromptForm-inner": "_PromptForm-inner_136g1_8", "PromptForm--dark": "_PromptForm--dark_136g1_14", "PromptForm--glow": "_PromptForm--glow_136g1_19", "PromptForm-glow": "_PromptForm-glow_136g1_19", "loop": "_loop_136g1_1", "PromptForm-formInner": "_PromptForm-formInner_136g1_60", "PromptForm-input": "_PromptForm-input_136g1_64", "PromptForm--disabled": "_PromptForm--disabled_136g1_92", "PromptForm-helper": "_PromptForm-helper_136g1_97", "PromptForm-actions": "_PromptForm-actions_136g1_107", "PromptForm-actionsLeft": "_PromptForm-actionsLeft_136g1_118", "PromptForm-actionsRight": "_PromptForm-actionsRight_136g1_124", "PromptForm-actionSubmit": "_PromptForm-actionSubmit_136g1_128", "PromptForm--isDisabled": "_PromptForm--isDisabled_136g1_147", "PromptForm--isLoading": "_PromptForm--isLoading_136g1_152" };
21304
+ var styles_module_default5 = { "PromptForm": "_PromptForm_136g1_1", "PromptForm-inner": "_PromptForm-inner_136g1_8", "PromptForm--dark": "_PromptForm--dark_136g1_14", "PromptForm--glow": "_PromptForm--glow_136g1_19", "PromptForm-glow": "_PromptForm-glow_136g1_19", "loop": "_loop_136g1_1", "PromptForm-formInner": "_PromptForm-formInner_136g1_60", "PromptForm-input": "_PromptForm-input_136g1_64", "PromptForm--disabled": "_PromptForm--disabled_136g1_92", "PromptForm-helper": "_PromptForm-helper_136g1_97", "PromptForm-actions": "_PromptForm-actions_136g1_107", "PromptForm-actionsLeft": "_PromptForm-actionsLeft_136g1_118", "PromptForm-actionsRight": "_PromptForm-actionsRight_136g1_124", "PromptForm-actionSubmit": "_PromptForm-actionSubmit_136g1_128", "PromptForm--isDisabled": "_PromptForm--isDisabled_136g1_147", "PromptForm--isLoading": "_PromptForm--isLoading_136g1_152" };
21294
21305
 
21295
21306
  // src/components/PromptForm/index.tsx
21296
- var import_jsx_runtime22 = require("react/jsx-runtime");
21297
- var cx4 = getClassNameFactory2("PromptForm", styles_module_default4);
21307
+ var import_jsx_runtime23 = require("react/jsx-runtime");
21308
+ var cx5 = getClassNameFactory2("PromptForm", styles_module_default5);
21298
21309
  function PromptForm({
21299
21310
  actions,
21300
21311
  colorScheme = "light",
@@ -21323,31 +21334,31 @@ function PromptForm({
21323
21334
  setPrompt(initialPrompt);
21324
21335
  }
21325
21336
  }, [setPrompt]);
21326
- return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(
21337
+ return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(
21327
21338
  "div",
21328
21339
  {
21329
- className: cx4({
21340
+ className: cx5({
21330
21341
  isDisabled,
21331
21342
  isLoading,
21332
21343
  dark: colorScheme === "dark",
21333
21344
  glow
21334
21345
  }),
21335
21346
  children: [
21336
- helperText ? /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: cx4("helper"), children: helperText }) : null,
21337
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: cx4("inner"), children: [
21338
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("span", { className: cx4("glow") }),
21339
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
21347
+ helperText ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: cx5("helper"), children: helperText }) : null,
21348
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: cx5("inner"), children: [
21349
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { className: cx5("glow") }),
21350
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
21340
21351
  "form",
21341
21352
  {
21342
21353
  onSubmit: (e) => {
21343
21354
  e.preventDefault();
21344
21355
  sendPrompt();
21345
21356
  },
21346
- children: /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: cx4("formInner"), children: [
21347
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
21357
+ children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: cx5("formInner"), children: [
21358
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
21348
21359
  import_react_textarea_autosize.default,
21349
21360
  {
21350
- className: cx4("input"),
21361
+ className: cx5("input"),
21351
21362
  name: "prompt",
21352
21363
  minRows: 2,
21353
21364
  placeholder,
@@ -21368,15 +21379,15 @@ function PromptForm({
21368
21379
  }
21369
21380
  }
21370
21381
  ),
21371
- /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)("div", { className: cx4("actions"), children: [
21372
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: cx4("actionsLeft"), children: actions }),
21373
- /* @__PURE__ */ (0, import_jsx_runtime22.jsx)("div", { className: cx4("actionsRight"), children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
21382
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: cx5("actions"), children: [
21383
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: cx5("actionsLeft"), children: actions }),
21384
+ /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: cx5("actionsRight"), children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
21374
21385
  "button",
21375
21386
  {
21376
- className: cx4("actionSubmit"),
21387
+ className: cx5("actionSubmit"),
21377
21388
  type: "submit",
21378
21389
  disabled: isLoading,
21379
- children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ArrowUp, {})
21390
+ children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ArrowUp, {})
21380
21391
  }
21381
21392
  ) })
21382
21393
  ] })
@@ -21396,9 +21407,9 @@ var toolStatusContext = (0, import_react17.createContext)({});
21396
21407
  var ToolStatusProvider = toolStatusContext.Provider;
21397
21408
 
21398
21409
  // src/components/ChatBody/index.tsx
21399
- var import_jsx_runtime23 = require("react/jsx-runtime");
21400
- var cx5 = getClassNameFactory2("Chat", styles_module_default3);
21401
- var cxMessage = getClassNameFactory2("ChatMessage", styles_module_default3);
21410
+ var import_jsx_runtime24 = require("react/jsx-runtime");
21411
+ var cx6 = getClassNameFactory2("Chat", styles_module_default4);
21412
+ var cxMessage = getClassNameFactory2("ChatMessage", styles_module_default4);
21402
21413
  function ChatBody({
21403
21414
  children,
21404
21415
  examplePrompts,
@@ -21412,17 +21423,17 @@ function ChatBody({
21412
21423
  }) {
21413
21424
  const { scrollRef, contentRef } = (0, import_use_stick_to_bottom.useStickToBottom)();
21414
21425
  const hasMessages = messages && messages.length > 0;
21415
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: cx5({ hasMessages, hasChildren: !!children, hideInput }), children: [
21416
- children ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: cx5("default"), children }) : null,
21417
- /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: cx5("inner"), ref: scrollRef, children: [
21418
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: cx5("messages"), ref: contentRef, children: messages.toReversed().map((message) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ChatMessage, { message }, message.id)) }),
21419
- status === "submitted" && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: cx5("loader"), children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Loader, { size: 14 }) }),
21420
- error45 && /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: cx5("error"), children: [
21421
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: cx5("errorLabel"), children: "Something went wrong." }),
21422
- handleRetry && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: cx5("errorAction"), children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(IconButton, { title: "Retry", onClick: handleRetry, children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(RotateCcw, { size: "14" }) }) })
21426
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: cx6({ hasMessages, hasChildren: !!children, hideInput }), children: [
21427
+ children ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: cx6("default"), children }) : null,
21428
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: cx6("inner"), ref: scrollRef, children: [
21429
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: cx6("messages"), ref: contentRef, children: messages.toReversed().map((message) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ChatMessage, { message }, message.id)) }),
21430
+ status === "submitted" && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: cx6("loader"), children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Loader, { size: 14 }) }),
21431
+ error45 && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: cx6("error"), children: [
21432
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: cx6("errorLabel"), children: "Something went wrong." }),
21433
+ handleRetry && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: cx6("errorAction"), children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(IconButton, { title: "Retry", onClick: handleRetry, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(RotateCcw, { size: "14" }) }) })
21423
21434
  ] }),
21424
- /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: cx5("form"), children: [
21425
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
21435
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: cx6("form"), children: [
21436
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
21426
21437
  PromptForm,
21427
21438
  {
21428
21439
  glow: !hasMessages,
@@ -21432,19 +21443,19 @@ function ChatBody({
21432
21443
  placeholder: "What do you want to build?"
21433
21444
  }
21434
21445
  ),
21435
- examplePrompts ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: cx5("examplePrompts"), children: examplePrompts }) : null
21446
+ examplePrompts ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: cx6("examplePrompts"), children: examplePrompts }) : null
21436
21447
  ] })
21437
21448
  ] })
21438
21449
  ] });
21439
21450
  }
21440
21451
  function ChatMessage({ message }) {
21441
21452
  const { role, parts } = message;
21442
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
21453
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
21443
21454
  "div",
21444
21455
  {
21445
21456
  className: cxMessage({ [`${role}Role`]: true }),
21446
21457
  "data-message-id": message.id,
21447
- children: parts.map((part, i) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
21458
+ children: parts.map((part, i) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
21448
21459
  ChatMessagePart,
21449
21460
  {
21450
21461
  part,
@@ -21460,25 +21471,25 @@ function ChatMessageWrapper({
21460
21471
  role
21461
21472
  }) {
21462
21473
  if (role === "assistant") {
21463
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_react_markdown.default, { children });
21474
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_react_markdown.default, { children });
21464
21475
  }
21465
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("span", { children });
21476
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("span", { children });
21466
21477
  }
21467
21478
  function ChatMessagePart({
21468
21479
  part,
21469
21480
  role
21470
21481
  }) {
21471
21482
  if (part.type === "text") {
21472
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: cxMessage("text"), children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ChatMessageWrapper, { role, children: part.text }) });
21483
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: cxMessage("text"), children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ChatMessageWrapper, { role, children: part.text }) });
21473
21484
  }
21474
21485
  if (part.type === "tool-createPage") {
21475
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(PuckTool, __spreadValues({}, part));
21486
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(PuckTool, __spreadValues({}, part));
21476
21487
  }
21477
21488
  if (part.type === "tool-updatePage") {
21478
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(PuckTool, __spreadValues({}, part));
21489
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(PuckTool, __spreadValues({}, part));
21479
21490
  }
21480
21491
  if (part.type === "tool-userTool") {
21481
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(PuckTool, __spreadValues({}, part));
21492
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(PuckTool, __spreadValues({}, part));
21482
21493
  }
21483
21494
  return null;
21484
21495
  }
@@ -21490,27 +21501,27 @@ function PuckTool({
21490
21501
  const toolStatus = (0, import_react18.useContext)(toolStatusContext)[toolCallId];
21491
21502
  const outputObj = output;
21492
21503
  const status = outputObj && "status" in outputObj ? outputObj.status : toolStatus != null ? toolStatus : { loading: true, label: defaultLabel };
21493
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ToolStatus, { status });
21504
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ToolStatus, { status });
21494
21505
  }
21495
21506
  function ToolStatus({ status }) {
21496
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: cxMessage("data"), children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("div", { className: cxMessage("dataInner"), children: [
21497
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: cxMessage("dataIcon"), children: status.error ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(TriangleAlert, { size: 18 }) : status.loading ? /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Loader, { size: 16 }) : /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Check, { size: 18 }) }),
21498
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { children: status.label })
21507
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: cxMessage("data"), children: /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: cxMessage("dataInner"), children: [
21508
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: cxMessage("dataIcon"), children: status.error ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(TriangleAlert, { size: 18 }) : status.loading ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Loader, { size: 16 }) : /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Check, { size: 18 }) }),
21509
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { children: status.label })
21499
21510
  ] }) });
21500
21511
  }
21501
21512
  function ExamplePrompt({
21502
21513
  label,
21503
21514
  href
21504
21515
  }) {
21505
- return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)("a", { className: cx5("examplePrompt"), href, children: [
21506
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { children: label }),
21507
- /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("div", { className: cx5("examplePromptArrow"), children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(ArrowRight, { size: "16" }) })
21516
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("a", { className: cx6("examplePrompt"), href, children: [
21517
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { children: label }),
21518
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: cx6("examplePromptArrow"), children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ArrowRight, { size: "16" }) })
21508
21519
  ] });
21509
21520
  }
21510
21521
 
21511
21522
  // src/components/Chat/index.tsx
21512
21523
  var import_qler = __toESM(require("qler"));
21513
- var import_jsx_runtime24 = require("react/jsx-runtime");
21524
+ var import_jsx_runtime25 = require("react/jsx-runtime");
21514
21525
  var q = (0, import_qler.default)();
21515
21526
  var BENCHMARK = false;
21516
21527
  var prefixedUlid = (prefix = "") => `${prefix ? `${prefix}_` : ""}${(0, import_ulid.ulid)()}`;
@@ -21750,22 +21761,22 @@ function Chat2({
21750
21761
  });
21751
21762
  });
21752
21763
  }, [messages, toolStatus]);
21753
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: getClassName16(), ref: pluginRef, children: [
21754
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { className: getClassName16("header"), children: "AI page builder" }),
21755
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ToolStatusProvider, { value: toolStatus, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
21764
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: getClassName16(), ref: pluginRef, children: [
21765
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { className: getClassName16("header"), children: "AI page builder" }),
21766
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ToolStatusProvider, { value: toolStatus, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
21756
21767
  ChatBody,
21757
21768
  {
21758
21769
  messages: messagesWithStatuses,
21759
21770
  handleSubmit,
21760
21771
  inputRef,
21761
21772
  status,
21762
- examplePrompts: examplePrompts == null ? void 0 : examplePrompts.map(({ label, href }) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ExamplePrompt, { label, href }, label)),
21773
+ examplePrompts: examplePrompts == null ? void 0 : examplePrompts.map(({ label, href }) => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ExamplePrompt, { label, href }, label)),
21763
21774
  error: error45,
21764
21775
  handleRetry: () => {
21765
21776
  setError("");
21766
21777
  regenerate();
21767
21778
  },
21768
- children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
21779
+ children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
21769
21780
  Placeholder,
21770
21781
  {
21771
21782
  dispatch: puckDispatch,
@@ -21796,11 +21807,11 @@ function Placeholder({
21796
21807
  }
21797
21808
  }, 10);
21798
21809
  };
21799
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: getClassName16("placeholder"), children: [
21800
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(Bot, { size: "24" }),
21801
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { children: "Use AI to build a page using your own components" }),
21802
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)("div", { className: getClassName16("actions"), children: [
21803
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
21810
+ return /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: getClassName16("placeholder"), children: [
21811
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Bot, { size: "24" }),
21812
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)("div", { children: "Use AI to build a page using your own components" }),
21813
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)("div", { className: getClassName16("actions"), children: [
21814
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
21804
21815
  "button",
21805
21816
  {
21806
21817
  className: getClassName16("action"),
@@ -21808,7 +21819,7 @@ function Placeholder({
21808
21819
  children: "Enter prompt"
21809
21820
  }
21810
21821
  ),
21811
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
21822
+ /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(
21812
21823
  "button",
21813
21824
  {
21814
21825
  className: getClassName16("actionOutlined"),
@@ -21832,13 +21843,13 @@ function isScrolledIntoView(el) {
21832
21843
  }
21833
21844
 
21834
21845
  // src/index.tsx
21835
- var import_jsx_runtime25 = require("react/jsx-runtime");
21846
+ var import_jsx_runtime26 = require("react/jsx-runtime");
21836
21847
  function createAIPlugin(opts) {
21837
21848
  return {
21838
21849
  label: "AI",
21839
21850
  name: "ai",
21840
- render: () => /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Chat2, __spreadValues({}, opts)),
21841
- icon: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Bot, {}),
21851
+ render: () => /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Chat2, __spreadValues({}, opts)),
21852
+ icon: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Bot, {}),
21842
21853
  mobilePanelHeight: "min-content"
21843
21854
  };
21844
21855
  }
package/dist/index.mjs CHANGED
@@ -20908,7 +20908,7 @@ init_react_import();
20908
20908
 
20909
20909
  // css-module:/home/runner/work/puck-platform/puck-platform/packages/platform-client/components/Heading/Heading.module.css#css-module
20910
20910
  init_react_import();
20911
- var Heading_module_default = { "Heading": "_Heading_1czuc_1", "Heading--xxxxl": "_Heading--xxxxl_1czuc_11", "Heading--xxxl": "_Heading--xxxl_1czuc_17", "Heading--xxl": "_Heading--xxl_1czuc_21", "Heading--xl": "_Heading--xl_1czuc_25", "Heading--l": "_Heading--l_1czuc_29", "Heading--m": "_Heading--m_1czuc_33", "Heading--s": "_Heading--s_1czuc_37", "Heading--xs": "_Heading--xs_1czuc_41", "Heading--xxs": "_Heading--xxs_1czuc_45" };
20911
+ var Heading_module_default = { "Heading": "_Heading_qkzg9_1", "Heading--xxxxl": "_Heading--xxxxl_qkzg9_11", "Heading--xxxl": "_Heading--xxxl_qkzg9_15", "Heading--xxl": "_Heading--xxl_qkzg9_19", "Heading--xl": "_Heading--xl_qkzg9_23", "Heading--l": "_Heading--l_qkzg9_27", "Heading--m": "_Heading--m_qkzg9_31", "Heading--s": "_Heading--s_qkzg9_35", "Heading--xs": "_Heading--xs_qkzg9_39", "Heading--xxs": "_Heading--xxs_qkzg9_43" };
20912
20912
 
20913
20913
  // ../platform-client/components/Heading/Heading.tsx
20914
20914
  import { jsx as jsx4 } from "react/jsx-runtime";
@@ -21173,7 +21173,7 @@ init_react_import();
21173
21173
 
21174
21174
  // css-module:/home/runner/work/puck-platform/puck-platform/packages/platform-client/components/Page/Page.module.css#css-module
21175
21175
  init_react_import();
21176
- var Page_module_default = { "Page": "_Page_1pzwy_1", "Page-masthead": "_Page-masthead_1pzwy_8", "Page-crumbs": "_Page-crumbs_1pzwy_18", "Page-crumb": "_Page-crumb_1pzwy_18", "Page-crumbLink": "_Page-crumbLink_1pzwy_28", "Page-actions": "_Page-actions_1pzwy_60", "Page-footer": "_Page-footer_1pzwy_64" };
21176
+ var Page_module_default = { "Page": "_Page_1ajs1_1", "Page-masthead": "_Page-masthead_1ajs1_8", "Page-crumbs": "_Page-crumbs_1ajs1_19", "Page-crumb": "_Page-crumb_1ajs1_19", "Page-crumbLink": "_Page-crumbLink_1ajs1_30", "Page-actions": "_Page-actions_1ajs1_62", "Page-footer": "_Page-footer_1ajs1_66" };
21177
21177
 
21178
21178
  // ../platform-client/components/Page/Page.tsx
21179
21179
  import { jsx as jsx14, jsxs as jsxs8 } from "react/jsx-runtime";
@@ -21265,15 +21265,26 @@ var VerticalSpace_module_default = { "VerticalSpace": "_VerticalSpace_1tjaw_1",
21265
21265
  import { jsx as jsx20 } from "react/jsx-runtime";
21266
21266
  var getClassName15 = get_class_name_factory_default("VerticalSpace", VerticalSpace_module_default);
21267
21267
 
21268
+ // ../platform-client/components/Viewport/index.tsx
21269
+ init_react_import();
21270
+
21271
+ // css-module:/home/runner/work/puck-platform/puck-platform/packages/platform-client/components/Viewport/styles.module.css#css-module
21272
+ init_react_import();
21273
+ var styles_module_default3 = { "Viewport": "_Viewport_1vvhm_3", "Viewport--standard": "_Viewport--standard_1vvhm_6", "Viewport--inline": "_Viewport--inline_1vvhm_7", "Viewport--narrow": "_Viewport--narrow_1vvhm_11", "Viewport--flex": "_Viewport--flex_1vvhm_19" };
21274
+
21275
+ // ../platform-client/components/Viewport/index.tsx
21276
+ import { jsx as jsx21 } from "react/jsx-runtime";
21277
+ var cx4 = getClassNameFactory("Viewport", styles_module_default3);
21278
+
21268
21279
  // ../platform-client/context/editor.tsx
21269
21280
  init_react_import();
21270
21281
  import { createContext as createContext2, useContext as useContext2, useState as useState8 } from "react";
21271
- import { jsx as jsx21 } from "react/jsx-runtime";
21282
+ import { jsx as jsx22 } from "react/jsx-runtime";
21272
21283
  var ctx = createContext2({});
21273
21284
 
21274
21285
  // css-module:/home/runner/work/puck-platform/puck-platform/packages/plugin-ai/src/components/ChatBody/styles.module.css#css-module
21275
21286
  init_react_import();
21276
- var styles_module_default3 = { "Chat": "_Chat_14j71_1", "Chat-inner": "_Chat-inner_14j71_17", "Chat--hasMessages": "_Chat--hasMessages_14j71_25", "Chat--hasChildren": "_Chat--hasChildren_14j71_29", "Chat-messages": "_Chat-messages_14j71_34", "Chat-form": "_Chat-form_14j71_41", "Chat--hideInput": "_Chat--hideInput_14j71_46", "Chat-formHelper": "_Chat-formHelper_14j71_60", "Chat-examplePrompts": "_Chat-examplePrompts_14j71_75", "Chat-examplePrompt": "_Chat-examplePrompt_14j71_75", "Chat-examplePromptArrow": "_Chat-examplePromptArrow_14j71_103", "Chat-default": "_Chat-default_14j71_107", "ChatMessage": "_ChatMessage_14j71_124", "ChatMessage--userRole": "_ChatMessage--userRole_14j71_129", "ChatMessage-text": "_ChatMessage-text_14j71_129", "ChatMessage-data": "_ChatMessage-data_14j71_219", "ChatMessage-dataInner": "_ChatMessage-dataInner_14j71_230", "ChatMessage-dataIcon": "_ChatMessage-dataIcon_14j71_236", "Chat-loader": "_Chat-loader_14j71_240", "Chat-error": "_Chat-error_14j71_245", "Chat-errorLabel": "_Chat-errorLabel_14j71_254", "Chat-errorAction": "_Chat-errorAction_14j71_258" };
21287
+ var styles_module_default4 = { "Chat": "_Chat_150yz_1", "Chat-inner": "_Chat-inner_150yz_17", "Chat--hasMessages": "_Chat--hasMessages_150yz_25", "Chat--hasChildren": "_Chat--hasChildren_150yz_29", "Chat-messages": "_Chat-messages_150yz_34", "Chat-form": "_Chat-form_150yz_41", "Chat--hideInput": "_Chat--hideInput_150yz_46", "Chat-formHelper": "_Chat-formHelper_150yz_60", "Chat-examplePrompts": "_Chat-examplePrompts_150yz_75", "Chat-examplePrompt": "_Chat-examplePrompt_150yz_75", "Chat-examplePromptArrow": "_Chat-examplePromptArrow_150yz_103", "Chat-default": "_Chat-default_150yz_107", "ChatMessage": "_ChatMessage_150yz_124", "ChatMessage--userRole": "_ChatMessage--userRole_150yz_130", "ChatMessage-text": "_ChatMessage-text_150yz_130", "ChatMessage-data": "_ChatMessage-data_150yz_220", "ChatMessage-dataInner": "_ChatMessage-dataInner_150yz_231", "ChatMessage-dataIcon": "_ChatMessage-dataIcon_150yz_237", "Chat-loader": "_Chat-loader_150yz_241", "Chat-error": "_Chat-error_150yz_246", "Chat-errorLabel": "_Chat-errorLabel_150yz_255", "Chat-errorAction": "_Chat-errorAction_150yz_259" };
21277
21288
 
21278
21289
  // src/components/PromptForm/index.tsx
21279
21290
  init_react_import();
@@ -21285,11 +21296,11 @@ import {
21285
21296
 
21286
21297
  // css-module:/home/runner/work/puck-platform/puck-platform/packages/plugin-ai/src/components/PromptForm/styles.module.css#css-module
21287
21298
  init_react_import();
21288
- var styles_module_default4 = { "PromptForm": "_PromptForm_136g1_1", "PromptForm-inner": "_PromptForm-inner_136g1_8", "PromptForm--dark": "_PromptForm--dark_136g1_14", "PromptForm--glow": "_PromptForm--glow_136g1_19", "PromptForm-glow": "_PromptForm-glow_136g1_19", "loop": "_loop_136g1_1", "PromptForm-formInner": "_PromptForm-formInner_136g1_60", "PromptForm-input": "_PromptForm-input_136g1_64", "PromptForm--disabled": "_PromptForm--disabled_136g1_92", "PromptForm-helper": "_PromptForm-helper_136g1_97", "PromptForm-actions": "_PromptForm-actions_136g1_107", "PromptForm-actionsLeft": "_PromptForm-actionsLeft_136g1_118", "PromptForm-actionsRight": "_PromptForm-actionsRight_136g1_124", "PromptForm-actionSubmit": "_PromptForm-actionSubmit_136g1_128", "PromptForm--isDisabled": "_PromptForm--isDisabled_136g1_147", "PromptForm--isLoading": "_PromptForm--isLoading_136g1_152" };
21299
+ var styles_module_default5 = { "PromptForm": "_PromptForm_136g1_1", "PromptForm-inner": "_PromptForm-inner_136g1_8", "PromptForm--dark": "_PromptForm--dark_136g1_14", "PromptForm--glow": "_PromptForm--glow_136g1_19", "PromptForm-glow": "_PromptForm-glow_136g1_19", "loop": "_loop_136g1_1", "PromptForm-formInner": "_PromptForm-formInner_136g1_60", "PromptForm-input": "_PromptForm-input_136g1_64", "PromptForm--disabled": "_PromptForm--disabled_136g1_92", "PromptForm-helper": "_PromptForm-helper_136g1_97", "PromptForm-actions": "_PromptForm-actions_136g1_107", "PromptForm-actionsLeft": "_PromptForm-actionsLeft_136g1_118", "PromptForm-actionsRight": "_PromptForm-actionsRight_136g1_124", "PromptForm-actionSubmit": "_PromptForm-actionSubmit_136g1_128", "PromptForm--isDisabled": "_PromptForm--isDisabled_136g1_147", "PromptForm--isLoading": "_PromptForm--isLoading_136g1_152" };
21289
21300
 
21290
21301
  // src/components/PromptForm/index.tsx
21291
- import { jsx as jsx22, jsxs as jsxs11 } from "react/jsx-runtime";
21292
- var cx4 = getClassNameFactory2("PromptForm", styles_module_default4);
21302
+ import { jsx as jsx23, jsxs as jsxs11 } from "react/jsx-runtime";
21303
+ var cx5 = getClassNameFactory2("PromptForm", styles_module_default5);
21293
21304
  function PromptForm({
21294
21305
  actions,
21295
21306
  colorScheme = "light",
@@ -21321,28 +21332,28 @@ function PromptForm({
21321
21332
  return /* @__PURE__ */ jsxs11(
21322
21333
  "div",
21323
21334
  {
21324
- className: cx4({
21335
+ className: cx5({
21325
21336
  isDisabled,
21326
21337
  isLoading,
21327
21338
  dark: colorScheme === "dark",
21328
21339
  glow
21329
21340
  }),
21330
21341
  children: [
21331
- helperText ? /* @__PURE__ */ jsx22("div", { className: cx4("helper"), children: helperText }) : null,
21332
- /* @__PURE__ */ jsxs11("div", { className: cx4("inner"), children: [
21333
- /* @__PURE__ */ jsx22("span", { className: cx4("glow") }),
21334
- /* @__PURE__ */ jsx22(
21342
+ helperText ? /* @__PURE__ */ jsx23("div", { className: cx5("helper"), children: helperText }) : null,
21343
+ /* @__PURE__ */ jsxs11("div", { className: cx5("inner"), children: [
21344
+ /* @__PURE__ */ jsx23("span", { className: cx5("glow") }),
21345
+ /* @__PURE__ */ jsx23(
21335
21346
  "form",
21336
21347
  {
21337
21348
  onSubmit: (e) => {
21338
21349
  e.preventDefault();
21339
21350
  sendPrompt();
21340
21351
  },
21341
- children: /* @__PURE__ */ jsxs11("div", { className: cx4("formInner"), children: [
21342
- /* @__PURE__ */ jsx22(
21352
+ children: /* @__PURE__ */ jsxs11("div", { className: cx5("formInner"), children: [
21353
+ /* @__PURE__ */ jsx23(
21343
21354
  default2,
21344
21355
  {
21345
- className: cx4("input"),
21356
+ className: cx5("input"),
21346
21357
  name: "prompt",
21347
21358
  minRows: 2,
21348
21359
  placeholder,
@@ -21363,15 +21374,15 @@ function PromptForm({
21363
21374
  }
21364
21375
  }
21365
21376
  ),
21366
- /* @__PURE__ */ jsxs11("div", { className: cx4("actions"), children: [
21367
- /* @__PURE__ */ jsx22("div", { className: cx4("actionsLeft"), children: actions }),
21368
- /* @__PURE__ */ jsx22("div", { className: cx4("actionsRight"), children: /* @__PURE__ */ jsx22(
21377
+ /* @__PURE__ */ jsxs11("div", { className: cx5("actions"), children: [
21378
+ /* @__PURE__ */ jsx23("div", { className: cx5("actionsLeft"), children: actions }),
21379
+ /* @__PURE__ */ jsx23("div", { className: cx5("actionsRight"), children: /* @__PURE__ */ jsx23(
21369
21380
  "button",
21370
21381
  {
21371
- className: cx4("actionSubmit"),
21382
+ className: cx5("actionSubmit"),
21372
21383
  type: "submit",
21373
21384
  disabled: isLoading,
21374
- children: /* @__PURE__ */ jsx22(ArrowUp, {})
21385
+ children: /* @__PURE__ */ jsx23(ArrowUp, {})
21375
21386
  }
21376
21387
  ) })
21377
21388
  ] })
@@ -21391,9 +21402,9 @@ var toolStatusContext = createContext3({});
21391
21402
  var ToolStatusProvider = toolStatusContext.Provider;
21392
21403
 
21393
21404
  // src/components/ChatBody/index.tsx
21394
- import { jsx as jsx23, jsxs as jsxs12 } from "react/jsx-runtime";
21395
- var cx5 = getClassNameFactory2("Chat", styles_module_default3);
21396
- var cxMessage = getClassNameFactory2("ChatMessage", styles_module_default3);
21405
+ import { jsx as jsx24, jsxs as jsxs12 } from "react/jsx-runtime";
21406
+ var cx6 = getClassNameFactory2("Chat", styles_module_default4);
21407
+ var cxMessage = getClassNameFactory2("ChatMessage", styles_module_default4);
21397
21408
  function ChatBody({
21398
21409
  children,
21399
21410
  examplePrompts,
@@ -21407,17 +21418,17 @@ function ChatBody({
21407
21418
  }) {
21408
21419
  const { scrollRef, contentRef } = useStickToBottom();
21409
21420
  const hasMessages = messages && messages.length > 0;
21410
- return /* @__PURE__ */ jsxs12("div", { className: cx5({ hasMessages, hasChildren: !!children, hideInput }), children: [
21411
- children ? /* @__PURE__ */ jsx23("div", { className: cx5("default"), children }) : null,
21412
- /* @__PURE__ */ jsxs12("div", { className: cx5("inner"), ref: scrollRef, children: [
21413
- /* @__PURE__ */ jsx23("div", { className: cx5("messages"), ref: contentRef, children: messages.toReversed().map((message) => /* @__PURE__ */ jsx23(ChatMessage, { message }, message.id)) }),
21414
- status === "submitted" && /* @__PURE__ */ jsx23("div", { className: cx5("loader"), children: /* @__PURE__ */ jsx23(Loader, { size: 14 }) }),
21415
- error45 && /* @__PURE__ */ jsxs12("div", { className: cx5("error"), children: [
21416
- /* @__PURE__ */ jsx23("div", { className: cx5("errorLabel"), children: "Something went wrong." }),
21417
- handleRetry && /* @__PURE__ */ jsx23("div", { className: cx5("errorAction"), children: /* @__PURE__ */ jsx23(IconButton, { title: "Retry", onClick: handleRetry, children: /* @__PURE__ */ jsx23(RotateCcw, { size: "14" }) }) })
21421
+ return /* @__PURE__ */ jsxs12("div", { className: cx6({ hasMessages, hasChildren: !!children, hideInput }), children: [
21422
+ children ? /* @__PURE__ */ jsx24("div", { className: cx6("default"), children }) : null,
21423
+ /* @__PURE__ */ jsxs12("div", { className: cx6("inner"), ref: scrollRef, children: [
21424
+ /* @__PURE__ */ jsx24("div", { className: cx6("messages"), ref: contentRef, children: messages.toReversed().map((message) => /* @__PURE__ */ jsx24(ChatMessage, { message }, message.id)) }),
21425
+ status === "submitted" && /* @__PURE__ */ jsx24("div", { className: cx6("loader"), children: /* @__PURE__ */ jsx24(Loader, { size: 14 }) }),
21426
+ error45 && /* @__PURE__ */ jsxs12("div", { className: cx6("error"), children: [
21427
+ /* @__PURE__ */ jsx24("div", { className: cx6("errorLabel"), children: "Something went wrong." }),
21428
+ handleRetry && /* @__PURE__ */ jsx24("div", { className: cx6("errorAction"), children: /* @__PURE__ */ jsx24(IconButton, { title: "Retry", onClick: handleRetry, children: /* @__PURE__ */ jsx24(RotateCcw, { size: "14" }) }) })
21418
21429
  ] }),
21419
- /* @__PURE__ */ jsxs12("div", { className: cx5("form"), children: [
21420
- /* @__PURE__ */ jsx23(
21430
+ /* @__PURE__ */ jsxs12("div", { className: cx6("form"), children: [
21431
+ /* @__PURE__ */ jsx24(
21421
21432
  PromptForm,
21422
21433
  {
21423
21434
  glow: !hasMessages,
@@ -21427,19 +21438,19 @@ function ChatBody({
21427
21438
  placeholder: "What do you want to build?"
21428
21439
  }
21429
21440
  ),
21430
- examplePrompts ? /* @__PURE__ */ jsx23("div", { className: cx5("examplePrompts"), children: examplePrompts }) : null
21441
+ examplePrompts ? /* @__PURE__ */ jsx24("div", { className: cx6("examplePrompts"), children: examplePrompts }) : null
21431
21442
  ] })
21432
21443
  ] })
21433
21444
  ] });
21434
21445
  }
21435
21446
  function ChatMessage({ message }) {
21436
21447
  const { role, parts } = message;
21437
- return /* @__PURE__ */ jsx23(
21448
+ return /* @__PURE__ */ jsx24(
21438
21449
  "div",
21439
21450
  {
21440
21451
  className: cxMessage({ [`${role}Role`]: true }),
21441
21452
  "data-message-id": message.id,
21442
- children: parts.map((part, i) => /* @__PURE__ */ jsx23(
21453
+ children: parts.map((part, i) => /* @__PURE__ */ jsx24(
21443
21454
  ChatMessagePart,
21444
21455
  {
21445
21456
  part,
@@ -21455,25 +21466,25 @@ function ChatMessageWrapper({
21455
21466
  role
21456
21467
  }) {
21457
21468
  if (role === "assistant") {
21458
- return /* @__PURE__ */ jsx23(Markdown, { children });
21469
+ return /* @__PURE__ */ jsx24(Markdown, { children });
21459
21470
  }
21460
- return /* @__PURE__ */ jsx23("span", { children });
21471
+ return /* @__PURE__ */ jsx24("span", { children });
21461
21472
  }
21462
21473
  function ChatMessagePart({
21463
21474
  part,
21464
21475
  role
21465
21476
  }) {
21466
21477
  if (part.type === "text") {
21467
- return /* @__PURE__ */ jsx23("div", { className: cxMessage("text"), children: /* @__PURE__ */ jsx23(ChatMessageWrapper, { role, children: part.text }) });
21478
+ return /* @__PURE__ */ jsx24("div", { className: cxMessage("text"), children: /* @__PURE__ */ jsx24(ChatMessageWrapper, { role, children: part.text }) });
21468
21479
  }
21469
21480
  if (part.type === "tool-createPage") {
21470
- return /* @__PURE__ */ jsx23(PuckTool, __spreadValues({}, part));
21481
+ return /* @__PURE__ */ jsx24(PuckTool, __spreadValues({}, part));
21471
21482
  }
21472
21483
  if (part.type === "tool-updatePage") {
21473
- return /* @__PURE__ */ jsx23(PuckTool, __spreadValues({}, part));
21484
+ return /* @__PURE__ */ jsx24(PuckTool, __spreadValues({}, part));
21474
21485
  }
21475
21486
  if (part.type === "tool-userTool") {
21476
- return /* @__PURE__ */ jsx23(PuckTool, __spreadValues({}, part));
21487
+ return /* @__PURE__ */ jsx24(PuckTool, __spreadValues({}, part));
21477
21488
  }
21478
21489
  return null;
21479
21490
  }
@@ -21485,27 +21496,27 @@ function PuckTool({
21485
21496
  const toolStatus = useContext3(toolStatusContext)[toolCallId];
21486
21497
  const outputObj = output;
21487
21498
  const status = outputObj && "status" in outputObj ? outputObj.status : toolStatus != null ? toolStatus : { loading: true, label: defaultLabel };
21488
- return /* @__PURE__ */ jsx23(ToolStatus, { status });
21499
+ return /* @__PURE__ */ jsx24(ToolStatus, { status });
21489
21500
  }
21490
21501
  function ToolStatus({ status }) {
21491
- return /* @__PURE__ */ jsx23("div", { className: cxMessage("data"), children: /* @__PURE__ */ jsxs12("div", { className: cxMessage("dataInner"), children: [
21492
- /* @__PURE__ */ jsx23("div", { className: cxMessage("dataIcon"), children: status.error ? /* @__PURE__ */ jsx23(TriangleAlert, { size: 18 }) : status.loading ? /* @__PURE__ */ jsx23(Loader, { size: 16 }) : /* @__PURE__ */ jsx23(Check, { size: 18 }) }),
21493
- /* @__PURE__ */ jsx23("div", { children: status.label })
21502
+ return /* @__PURE__ */ jsx24("div", { className: cxMessage("data"), children: /* @__PURE__ */ jsxs12("div", { className: cxMessage("dataInner"), children: [
21503
+ /* @__PURE__ */ jsx24("div", { className: cxMessage("dataIcon"), children: status.error ? /* @__PURE__ */ jsx24(TriangleAlert, { size: 18 }) : status.loading ? /* @__PURE__ */ jsx24(Loader, { size: 16 }) : /* @__PURE__ */ jsx24(Check, { size: 18 }) }),
21504
+ /* @__PURE__ */ jsx24("div", { children: status.label })
21494
21505
  ] }) });
21495
21506
  }
21496
21507
  function ExamplePrompt({
21497
21508
  label,
21498
21509
  href
21499
21510
  }) {
21500
- return /* @__PURE__ */ jsxs12("a", { className: cx5("examplePrompt"), href, children: [
21501
- /* @__PURE__ */ jsx23("div", { children: label }),
21502
- /* @__PURE__ */ jsx23("div", { className: cx5("examplePromptArrow"), children: /* @__PURE__ */ jsx23(ArrowRight, { size: "16" }) })
21511
+ return /* @__PURE__ */ jsxs12("a", { className: cx6("examplePrompt"), href, children: [
21512
+ /* @__PURE__ */ jsx24("div", { children: label }),
21513
+ /* @__PURE__ */ jsx24("div", { className: cx6("examplePromptArrow"), children: /* @__PURE__ */ jsx24(ArrowRight, { size: "16" }) })
21503
21514
  ] });
21504
21515
  }
21505
21516
 
21506
21517
  // src/components/Chat/index.tsx
21507
21518
  import qler from "qler";
21508
- import { jsx as jsx24, jsxs as jsxs13 } from "react/jsx-runtime";
21519
+ import { jsx as jsx25, jsxs as jsxs13 } from "react/jsx-runtime";
21509
21520
  var q = qler();
21510
21521
  var BENCHMARK = false;
21511
21522
  var prefixedUlid = (prefix = "") => `${prefix ? `${prefix}_` : ""}${ulid3()}`;
@@ -21746,21 +21757,21 @@ function Chat2({
21746
21757
  });
21747
21758
  }, [messages, toolStatus]);
21748
21759
  return /* @__PURE__ */ jsxs13("div", { className: getClassName16(), ref: pluginRef, children: [
21749
- /* @__PURE__ */ jsx24("div", { className: getClassName16("header"), children: "AI page builder" }),
21750
- /* @__PURE__ */ jsx24(ToolStatusProvider, { value: toolStatus, children: /* @__PURE__ */ jsx24(
21760
+ /* @__PURE__ */ jsx25("div", { className: getClassName16("header"), children: "AI page builder" }),
21761
+ /* @__PURE__ */ jsx25(ToolStatusProvider, { value: toolStatus, children: /* @__PURE__ */ jsx25(
21751
21762
  ChatBody,
21752
21763
  {
21753
21764
  messages: messagesWithStatuses,
21754
21765
  handleSubmit,
21755
21766
  inputRef,
21756
21767
  status,
21757
- examplePrompts: examplePrompts == null ? void 0 : examplePrompts.map(({ label, href }) => /* @__PURE__ */ jsx24(ExamplePrompt, { label, href }, label)),
21768
+ examplePrompts: examplePrompts == null ? void 0 : examplePrompts.map(({ label, href }) => /* @__PURE__ */ jsx25(ExamplePrompt, { label, href }, label)),
21758
21769
  error: error45,
21759
21770
  handleRetry: () => {
21760
21771
  setError("");
21761
21772
  regenerate();
21762
21773
  },
21763
- children: /* @__PURE__ */ jsx24(
21774
+ children: /* @__PURE__ */ jsx25(
21764
21775
  Placeholder,
21765
21776
  {
21766
21777
  dispatch: puckDispatch,
@@ -21792,10 +21803,10 @@ function Placeholder({
21792
21803
  }, 10);
21793
21804
  };
21794
21805
  return /* @__PURE__ */ jsxs13("div", { className: getClassName16("placeholder"), children: [
21795
- /* @__PURE__ */ jsx24(Bot, { size: "24" }),
21796
- /* @__PURE__ */ jsx24("div", { children: "Use AI to build a page using your own components" }),
21806
+ /* @__PURE__ */ jsx25(Bot, { size: "24" }),
21807
+ /* @__PURE__ */ jsx25("div", { children: "Use AI to build a page using your own components" }),
21797
21808
  /* @__PURE__ */ jsxs13("div", { className: getClassName16("actions"), children: [
21798
- /* @__PURE__ */ jsx24(
21809
+ /* @__PURE__ */ jsx25(
21799
21810
  "button",
21800
21811
  {
21801
21812
  className: getClassName16("action"),
@@ -21803,7 +21814,7 @@ function Placeholder({
21803
21814
  children: "Enter prompt"
21804
21815
  }
21805
21816
  ),
21806
- /* @__PURE__ */ jsx24(
21817
+ /* @__PURE__ */ jsx25(
21807
21818
  "button",
21808
21819
  {
21809
21820
  className: getClassName16("actionOutlined"),
@@ -21827,13 +21838,13 @@ function isScrolledIntoView(el) {
21827
21838
  }
21828
21839
 
21829
21840
  // src/index.tsx
21830
- import { jsx as jsx25 } from "react/jsx-runtime";
21841
+ import { jsx as jsx26 } from "react/jsx-runtime";
21831
21842
  function createAIPlugin(opts) {
21832
21843
  return {
21833
21844
  label: "AI",
21834
21845
  name: "ai",
21835
- render: () => /* @__PURE__ */ jsx25(Chat2, __spreadValues({}, opts)),
21836
- icon: /* @__PURE__ */ jsx25(Bot, {}),
21846
+ render: () => /* @__PURE__ */ jsx26(Chat2, __spreadValues({}, opts)),
21847
+ icon: /* @__PURE__ */ jsx26(Bot, {}),
21837
21848
  mobilePanelHeight: "min-content"
21838
21849
  };
21839
21850
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@puckeditor/plugin-ai",
3
- "version": "0.1.0-canary.edb4f9bd",
3
+ "version": "0.1.0-canary.f56e596d",
4
4
  "author": "Chris Villa <chris@puckeditor.com>",
5
5
  "repository": "puckeditor/puck",
6
6
  "bugs": "https://github.com/puckeditor/puck/issues",