@puckeditor/plugin-ai 0.6.0-canary.e94eafc3 → 0.6.1-canary.0342162f

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
@@ -265,7 +265,7 @@ p {
265
265
  }
266
266
 
267
267
  /* css-module:/home/runner/work/puck-platform/puck-platform/packages/platform-client/components/Button/Button.module.css/#css-module-data */
268
- ._Button_1sscz_1 {
268
+ ._Button_1br4o_1 {
269
269
  appearance: none;
270
270
  background: none;
271
271
  border: 1px solid transparent;
@@ -287,31 +287,31 @@ p {
287
287
  white-space: nowrap;
288
288
  margin: 0;
289
289
  }
290
- ._Button_1sscz_1:hover,
291
- ._Button_1sscz_1:active {
290
+ ._Button_1br4o_1:hover,
291
+ ._Button_1br4o_1:active {
292
292
  transition: none;
293
293
  }
294
- ._Button_1sscz_1:focus-visible {
294
+ ._Button_1br4o_1:focus-visible {
295
295
  outline: 2px solid var(--puck-color-azure-05);
296
296
  outline-offset: 2px;
297
297
  }
298
- ._Button--medium_1sscz_34 {
298
+ ._Button--medium_1br4o_34 {
299
299
  min-height: 34px;
300
300
  padding-bottom: 7px;
301
301
  padding-left: 19px;
302
302
  padding-right: 19px;
303
303
  padding-top: 7px;
304
304
  }
305
- ._Button--large_1sscz_42 {
305
+ ._Button--large_1br4o_42 {
306
306
  padding-bottom: 11px;
307
307
  padding-left: 19px;
308
308
  padding-right: 19px;
309
309
  padding-top: 11px;
310
310
  }
311
- ._Button-icon_1sscz_49 {
311
+ ._Button-icon_1br4o_49 {
312
312
  margin-top: 2px;
313
313
  }
314
- ._Button--brand_1sscz_53 {
314
+ ._Button--brand_1br4o_53 {
315
315
  background-image:
316
316
  linear-gradient(
317
317
  210deg,
@@ -322,79 +322,78 @@ p {
322
322
  border-radius: 48px;
323
323
  }
324
324
  @media (hover: hover) and (pointer: fine) {
325
- ._Button--brand_1sscz_53:hover {
325
+ ._Button--brand_1br4o_53:hover {
326
326
  opacity: 0.8;
327
327
  }
328
328
  }
329
- ._Button--brand_1sscz_53:active {
329
+ ._Button--brand_1br4o_53:active {
330
330
  opacity: 0.8;
331
331
  }
332
- ._Button--primary_1sscz_74 {
332
+ ._Button--primary_1br4o_74 {
333
333
  background: var(--puck-color-azure-04);
334
334
  }
335
335
  @media (hover: hover) and (pointer: fine) {
336
- ._Button--primary_1sscz_74:hover {
336
+ ._Button--primary_1br4o_74:hover {
337
337
  background-color: var(--puck-color-azure-03);
338
338
  }
339
339
  }
340
- ._Button--primary_1sscz_74:active {
340
+ ._Button--primary_1br4o_74:active {
341
341
  background-color: var(--puck-color-azure-02);
342
342
  }
343
- ._Button--secondary_1sscz_88 {
343
+ ._Button--secondary_1br4o_88 {
344
344
  border: 1px solid currentColor;
345
345
  color: currentColor;
346
346
  }
347
347
  @media (hover: hover) and (pointer: fine) {
348
- ._Button--secondary_1sscz_88:hover {
348
+ ._Button--secondary_1br4o_88:hover {
349
349
  background-color: var(--puck-color-azure-12);
350
350
  color: var(--puck-color-black);
351
351
  }
352
352
  }
353
- ._Button--secondary_1sscz_88:active {
353
+ ._Button--secondary_1br4o_88:active {
354
354
  background-color: var(--puck-color-azure-11);
355
355
  color: var(--puck-color-black);
356
356
  }
357
- ._Button--danger_1sscz_105 {
357
+ ._Button--danger_1br4o_105 {
358
358
  background: var(--puck-color-red-04);
359
359
  }
360
360
  @media (hover: hover) and (pointer: fine) {
361
- ._Button--danger_1sscz_105:hover {
361
+ ._Button--danger_1br4o_105:hover {
362
362
  background-color: var(--puck-color-red-03);
363
363
  }
364
364
  }
365
- ._Button--danger_1sscz_105:active {
365
+ ._Button--danger_1br4o_105:active {
366
366
  background-color: var(--puck-color-red-02);
367
367
  }
368
- ._Button--flush_1sscz_119 {
368
+ ._Button--flush_1br4o_119 {
369
369
  border-radius: 0;
370
370
  }
371
- ._Button--ghost_1sscz_123 {
371
+ ._Button--ghost_1br4o_123 {
372
372
  align-items: center;
373
373
  background-color: transparent;
374
374
  border: none;
375
375
  border-radius: 4px;
376
- color: var(--puck-color-grey-08);
377
- padding: 8px;
376
+ color: var(--puck-color-azure-04);
378
377
  display: flex;
379
378
  }
380
379
  @media (hover: hover) and (pointer: fine) {
381
- ._Button--ghost_1sscz_123:hover {
382
- background-color: var(--puck-color-azure-11);
380
+ ._Button--ghost_1br4o_123:hover {
381
+ background-color: var(--puck-color-grey-11);
383
382
  color: var(--puck-color-azure-04);
384
383
  cursor: pointer;
385
384
  }
386
385
  }
387
- ._Button--disabled_1sscz_141,
388
- ._Button--disabled_1sscz_141:hover {
386
+ ._Button--disabled_1br4o_140,
387
+ ._Button--disabled_1br4o_140:hover {
389
388
  background-color: var(--puck-color-grey-09);
390
389
  color: var(--puck-color-grey-05);
391
390
  cursor: not-allowed;
392
391
  }
393
- ._Button--fullWidth_1sscz_148 {
392
+ ._Button--fullWidth_1br4o_147 {
394
393
  justify-content: center;
395
394
  width: 100%;
396
395
  }
397
- ._Button-spinner_1sscz_153 {
396
+ ._Button-spinner_1br4o_152 {
398
397
  padding-left: 8px;
399
398
  }
400
399
 
@@ -524,7 +523,7 @@ p {
524
523
  }
525
524
 
526
525
  /* css-module:/home/runner/work/puck-platform/puck-platform/packages/platform-client/components/Card/Card.module.css/#css-module-data */
527
- ._Card_jzb6b_1 {
526
+ ._Card_rpnal_1 {
528
527
  background-color: white;
529
528
  border: 1px solid var(--puck-color-grey-08);
530
529
  border-radius: 16px;
@@ -532,32 +531,33 @@ p {
532
531
  display: block;
533
532
  text-decoration: none;
534
533
  }
535
- ._Card_jzb6b_1:hover {
534
+ ._Card_rpnal_1:hover {
536
535
  cursor: pointer;
537
536
  background: var(--puck-color-azure-11);
538
537
  border-color: currentColor;
539
538
  color: var(--puck-color-azure-04);
540
539
  }
541
- ._Card-body_jzb6b_17 {
540
+ ._Card-body_rpnal_17 {
542
541
  align-items: center;
543
542
  display: flex;
544
543
  padding: 16px;
545
544
  }
546
- ._Card-title_jzb6b_23 {
545
+ ._Card-title_rpnal_23 {
547
546
  margin-bottom: 4px;
548
547
  }
549
- ._Card-subtitle_jzb6b_27 {
548
+ ._Card-subtitle_rpnal_27 {
550
549
  margin: 0;
550
+ text-wrap: wrap;
551
551
  }
552
- ._Card-chevron_jzb6b_31 {
552
+ ._Card-chevron_rpnal_32 {
553
553
  align-items: center;
554
554
  display: none;
555
555
  margin-left: auto;
556
556
  }
557
- ._Card--showChevron_jzb6b_37 ._Card-chevron_jzb6b_31 {
557
+ ._Card--showChevron_rpnal_38 ._Card-chevron_rpnal_32 {
558
558
  display: flex;
559
559
  }
560
- ._Card--isActive_jzb6b_41 {
560
+ ._Card--isActive_rpnal_42 {
561
561
  border-color: var(--puck-color-azure-04);
562
562
  color: var(--puck-color-azure-04);
563
563
  }
@@ -924,6 +924,218 @@ p {
924
924
  color: var(--puck-color-grey-05);
925
925
  }
926
926
 
927
+ /* css-module:/home/runner/work/puck-platform/puck-platform/packages/platform-client/components/PlanGrid/styles.module.css/#css-module-data */
928
+ ._PlanGrid--loading_97rn7_1 {
929
+ opacity: 0;
930
+ }
931
+ ._PlanGrid-grid_97rn7_5 {
932
+ color: var(--puck-color-grey-02);
933
+ display: grid;
934
+ gap: 16px;
935
+ text-align: left;
936
+ @media (min-width: 768px) {
937
+ grid-template-columns: 1fr 1fr 1fr;
938
+ }
939
+ }
940
+ ._PlanGrid-enterprise_97rn7_16 {
941
+ color: var(--puck-color-grey-04);
942
+ font-size: var(--puck-font-size-xxs);
943
+ margin-left: auto;
944
+ margin-right: auto;
945
+ padding-inline: 4px;
946
+ padding-top: 20px;
947
+ text-align: center;
948
+ }
949
+ ._PlanGrid-enterprise_97rn7_16 a {
950
+ color: var(--puck-color-azure-04);
951
+ cursor: pointer;
952
+ font-weight: 500;
953
+ }
954
+
955
+ /* css-module:/home/runner/work/puck-platform/puck-platform/packages/platform-client/components/PlanCard/styles.module.css/#css-module-data */
956
+ ._PlanCard_16zmu_1 {
957
+ border: 1px solid var(--puck-color-grey-09);
958
+ border-radius: 16px;
959
+ display: flex;
960
+ gap: 8px;
961
+ flex-direction: column;
962
+ min-width: 256px;
963
+ padding: 8px;
964
+ position: relative;
965
+ }
966
+ ._PlanCard--enterprise_16zmu_12 {
967
+ flex-direction: row;
968
+ grid-column: span 3;
969
+ }
970
+ ._PlanCard-title_16zmu_17 {
971
+ display: flex;
972
+ gap: 8px;
973
+ justify-content: space-between;
974
+ font-size: var(--puck-font-size-xs);
975
+ font-weight: 700;
976
+ white-space: nowrap;
977
+ }
978
+ ._PlanCard-header_16zmu_26 {
979
+ box-sizing: border-box;
980
+ display: flex;
981
+ flex-direction: column;
982
+ gap: 4px;
983
+ padding: 12px 16px;
984
+ width: 100%;
985
+ }
986
+ ._PlanCard-features_16zmu_35 {
987
+ display: grid;
988
+ gap: 4px;
989
+ list-style: none;
990
+ margin: 0;
991
+ padding: 0;
992
+ }
993
+ ._PlanCard-feature_16zmu_35 {
994
+ align-items: center;
995
+ display: flex;
996
+ gap: 4px;
997
+ color: var(--puck-color-grey-05);
998
+ font-size: var(--puck-font-size-xxs);
999
+ }
1000
+ ._PlanCard-featureIcon_16zmu_51 {
1001
+ align-self: flex-start;
1002
+ margin-top: 5px;
1003
+ }
1004
+ ._PlanCard-featureTitle_16zmu_56 {
1005
+ color: var(--puck-color-grey-04);
1006
+ font-weight: 600;
1007
+ }
1008
+ ._PlanCard-priceValue_16zmu_61 {
1009
+ font-size: var(--puck-font-size-m);
1010
+ }
1011
+ ._PlanCard-priceInterval_16zmu_65 {
1012
+ color: var(--puck-color-grey-05);
1013
+ }
1014
+ ._PlanCard-body_16zmu_69 {
1015
+ background-color: var(--puck-color-grey-12);
1016
+ border: 1px solid var(--puck-color-grey-11);
1017
+ border-radius: 8px;
1018
+ padding: 16px;
1019
+ flex-grow: 1;
1020
+ }
1021
+ ._PlanCard--enterprise_16zmu_12 ._PlanCard-body_16zmu_69 {
1022
+ display: flex;
1023
+ gap: 8px;
1024
+ width: 100%;
1025
+ }
1026
+ ._PlanCard-section_16zmu_83 {
1027
+ padding-bottom: 16px;
1028
+ min-width: 192px;
1029
+ }
1030
+ ._PlanCard-section_16zmu_83:last-of-type {
1031
+ padding-bottom: 0;
1032
+ }
1033
+ ._PlanCard-section_16zmu_83 + ._PlanCard-section_16zmu_83 {
1034
+ border-top: 1px solid var(--puck-color-grey-09);
1035
+ padding-top: 16px;
1036
+ }
1037
+ ._PlanCard--enterprise_16zmu_12 {
1038
+ ._PlanCard-section_16zmu_83 + ._PlanCard-section_16zmu_83 {
1039
+ border-left: 1px solid var(--puck-color-grey-09);
1040
+ border-top: none;
1041
+ padding-left: 16px;
1042
+ padding-top: 0;
1043
+ }
1044
+ }
1045
+ ._PlanCard-sectionTitle_16zmu_106 {
1046
+ font-size: var(--puck-font-size-xs);
1047
+ font-weight: 500;
1048
+ margin-bottom: 8px;
1049
+ }
1050
+ ._PlanCard-sectionBody_16zmu_112 + ._PlanCard-sectionTitle_16zmu_106 {
1051
+ border-top: 1px solid var(--puck-color-grey-09);
1052
+ margin-top: 16px;
1053
+ padding-top: 16px;
1054
+ }
1055
+ ._PlanCard-sectionBody_16zmu_112 {
1056
+ color: var(--puck-color-grey-03);
1057
+ font-size: var(--puck-font-size-xxs);
1058
+ display: grid;
1059
+ gap: 2px;
1060
+ }
1061
+ ._PlanCard-usageItem_16zmu_125 {
1062
+ display: flex;
1063
+ gap: 8px;
1064
+ font-size: var(--puck-font-size-xxs);
1065
+ }
1066
+ ._PlanCard-usageLabel_16zmu_131 {
1067
+ color: var(--puck-color-grey-04);
1068
+ font-weight: 500;
1069
+ }
1070
+ ._PlanCard-usageValue_16zmu_136 {
1071
+ color: var(--puck-color-grey-05);
1072
+ font-family: var(--puck-font-family-monospaced);
1073
+ margin-left: auto;
1074
+ }
1075
+ ._PlanCard-action_16zmu_142 {
1076
+ align-items: flex-end;
1077
+ display: flex;
1078
+ justify-content: flex-end;
1079
+ width: 100%;
1080
+ }
1081
+ ._PlanCard-description_16zmu_149 {
1082
+ color: var(--puck-color-grey-03);
1083
+ margin-top: 8px;
1084
+ }
1085
+ ._PlanCard--highlight_16zmu_154 {
1086
+ border: transparent;
1087
+ }
1088
+ ._PlanCard--highlight_16zmu_154::before {
1089
+ content: "";
1090
+ position: absolute;
1091
+ inset: 0;
1092
+ padding: 1px;
1093
+ border-radius: inherit;
1094
+ background-image:
1095
+ linear-gradient(
1096
+ 210deg,
1097
+ var(--puck-color-azure-01) 0%,
1098
+ var(--puck-color-azure-03) 40%,
1099
+ var(--puck-color-red-05) 100%);
1100
+ background-size: cover;
1101
+ background-position: center;
1102
+ -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
1103
+ -webkit-mask-composite: xor;
1104
+ mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
1105
+ mask-composite: exclude;
1106
+ pointer-events: none;
1107
+ }
1108
+ ._PlanCard-highlightText_16zmu_184 {
1109
+ @supports (background-clip: text) or (-webkit-background-clip: text) {
1110
+ color: transparent;
1111
+ background-clip: text;
1112
+ -webkit-background-clip: text;
1113
+ background-image:
1114
+ linear-gradient(
1115
+ 210deg,
1116
+ var(--puck-color-azure-01) 0%,
1117
+ var(--puck-color-azure-03) 40%,
1118
+ var(--puck-color-red-05) 100%);
1119
+ background-size: cover;
1120
+ background-position: center;
1121
+ }
1122
+ }
1123
+ ._PlanCard--fullWidth_16zmu_200 {
1124
+ flex-direction: row;
1125
+ grid-column: 1 / -1;
1126
+ }
1127
+ ._PlanCard--fullWidth_16zmu_200 ._PlanCard-header_16zmu_26 {
1128
+ max-width: 312px;
1129
+ }
1130
+ ._PlanCard--fullWidth_16zmu_200 ._PlanCard-action_16zmu_142 {
1131
+ max-width: 256px;
1132
+ }
1133
+ ._PlanCard--fullWidth_16zmu_200 ._PlanCard-sectionBody_16zmu_112 {
1134
+ display: grid;
1135
+ grid-template-rows: 1fr 1fr 1fr 1fr;
1136
+ grid-auto-flow: column;
1137
+ }
1138
+
927
1139
  /* css-module:/home/runner/work/puck-platform/puck-platform/packages/platform-client/components/Section/Section.module.css/#css-module-data */
928
1140
  ._Section-inner_1uwo0_1 {
929
1141
  margin-left: auto;
package/dist/index.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as react from 'react';
2
2
  import * as react_jsx_runtime from 'react/jsx-runtime';
3
+ import { PuckAction, Data, Config } from '@puckeditor/core';
3
4
  import { LanguageModelUsage, UIMessage, CreateUIMessage, DataUIPart, ChatStatus } from 'ai';
4
- import { PuckAction, Data } from '@puckeditor/core';
5
5
 
6
6
  type _JSONSchema = boolean | JSONSchema;
7
7
  type JSONSchema = {
@@ -71,6 +71,7 @@ type JSONSchema = {
71
71
 
72
72
  type ComponentAiParams = {
73
73
  instructions?: string;
74
+ exclude?: boolean;
74
75
  defaultZone?: { allow?: string[]; disallow?: string[]; disabled?: boolean };
75
76
  };
76
77
 
@@ -187,6 +188,18 @@ type PuckProviderMetadata = {
187
188
 
188
189
  type PuckMessage = UIMessage<PuckProviderMetadata, PuckDataParts>;
189
190
 
191
+ type RequestOptions = {
192
+ body?: {
193
+ chatId?: string;
194
+ trigger?: string;
195
+ messages?: PuckMessage[];
196
+ pageData?: Data;
197
+ config?: Config;
198
+ [key: string]: any;
199
+ };
200
+ headers?: HeadersInit;
201
+ credentials?: RequestCredentials;
202
+ };
190
203
  type AiPluginProps = {
191
204
  host?: string;
192
205
  chat?: {
@@ -198,6 +211,7 @@ type AiPluginProps = {
198
211
  }[];
199
212
  };
200
213
  scrollTracking?: boolean;
214
+ prepareRequest?: (opts: RequestOptions) => RequestOptions | Promise<RequestOptions>;
201
215
  };
202
216
  declare global {
203
217
  interface Window {
@@ -223,4 +237,4 @@ declare function createAiPlugin(opts?: AiPluginProps): {
223
237
  };
224
238
  };
225
239
 
226
- export { createAiPlugin };
240
+ export { type ComponentAiParams, type FieldAiParams, createAiPlugin };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as react from 'react';
2
2
  import * as react_jsx_runtime from 'react/jsx-runtime';
3
+ import { PuckAction, Data, Config } from '@puckeditor/core';
3
4
  import { LanguageModelUsage, UIMessage, CreateUIMessage, DataUIPart, ChatStatus } from 'ai';
4
- import { PuckAction, Data } from '@puckeditor/core';
5
5
 
6
6
  type _JSONSchema = boolean | JSONSchema;
7
7
  type JSONSchema = {
@@ -71,6 +71,7 @@ type JSONSchema = {
71
71
 
72
72
  type ComponentAiParams = {
73
73
  instructions?: string;
74
+ exclude?: boolean;
74
75
  defaultZone?: { allow?: string[]; disallow?: string[]; disabled?: boolean };
75
76
  };
76
77
 
@@ -187,6 +188,18 @@ type PuckProviderMetadata = {
187
188
 
188
189
  type PuckMessage = UIMessage<PuckProviderMetadata, PuckDataParts>;
189
190
 
191
+ type RequestOptions = {
192
+ body?: {
193
+ chatId?: string;
194
+ trigger?: string;
195
+ messages?: PuckMessage[];
196
+ pageData?: Data;
197
+ config?: Config;
198
+ [key: string]: any;
199
+ };
200
+ headers?: HeadersInit;
201
+ credentials?: RequestCredentials;
202
+ };
190
203
  type AiPluginProps = {
191
204
  host?: string;
192
205
  chat?: {
@@ -198,6 +211,7 @@ type AiPluginProps = {
198
211
  }[];
199
212
  };
200
213
  scrollTracking?: boolean;
214
+ prepareRequest?: (opts: RequestOptions) => RequestOptions | Promise<RequestOptions>;
201
215
  };
202
216
  declare global {
203
217
  interface Window {
@@ -223,4 +237,4 @@ declare function createAiPlugin(opts?: AiPluginProps): {
223
237
  };
224
238
  };
225
239
 
226
- export { createAiPlugin };
240
+ export { type ComponentAiParams, type FieldAiParams, createAiPlugin };