@puckeditor/plugin-ai 0.6.0-canary.dea81b9d → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +190 -24
- package/dist/index.d.mts +16 -2
- package/dist/index.d.ts +16 -2
- package/dist/index.js +5245 -261
- package/dist/index.mjs +5238 -255
- package/package.json +4 -4
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
|
-
.
|
|
268
|
+
._Button_1sscz_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
|
-
.
|
|
291
|
-
.
|
|
290
|
+
._Button_1sscz_1:hover,
|
|
291
|
+
._Button_1sscz_1:active {
|
|
292
292
|
transition: none;
|
|
293
293
|
}
|
|
294
|
-
.
|
|
294
|
+
._Button_1sscz_1:focus-visible {
|
|
295
295
|
outline: 2px solid var(--puck-color-azure-05);
|
|
296
296
|
outline-offset: 2px;
|
|
297
297
|
}
|
|
298
|
-
._Button--
|
|
298
|
+
._Button--medium_1sscz_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--
|
|
305
|
+
._Button--large_1sscz_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-
|
|
311
|
+
._Button-icon_1sscz_49 {
|
|
312
312
|
margin-top: 2px;
|
|
313
313
|
}
|
|
314
|
-
._Button--
|
|
314
|
+
._Button--brand_1sscz_53 {
|
|
315
315
|
background-image:
|
|
316
316
|
linear-gradient(
|
|
317
317
|
210deg,
|
|
@@ -322,63 +322,79 @@ p {
|
|
|
322
322
|
border-radius: 48px;
|
|
323
323
|
}
|
|
324
324
|
@media (hover: hover) and (pointer: fine) {
|
|
325
|
-
._Button--
|
|
325
|
+
._Button--brand_1sscz_53:hover {
|
|
326
326
|
opacity: 0.8;
|
|
327
327
|
}
|
|
328
328
|
}
|
|
329
|
-
._Button--
|
|
329
|
+
._Button--brand_1sscz_53:active {
|
|
330
330
|
opacity: 0.8;
|
|
331
331
|
}
|
|
332
|
-
._Button--
|
|
332
|
+
._Button--primary_1sscz_74 {
|
|
333
333
|
background: var(--puck-color-azure-04);
|
|
334
334
|
}
|
|
335
335
|
@media (hover: hover) and (pointer: fine) {
|
|
336
|
-
._Button--
|
|
336
|
+
._Button--primary_1sscz_74:hover {
|
|
337
337
|
background-color: var(--puck-color-azure-03);
|
|
338
338
|
}
|
|
339
339
|
}
|
|
340
|
-
._Button--
|
|
340
|
+
._Button--primary_1sscz_74:active {
|
|
341
341
|
background-color: var(--puck-color-azure-02);
|
|
342
342
|
}
|
|
343
|
-
._Button--
|
|
343
|
+
._Button--secondary_1sscz_88 {
|
|
344
344
|
border: 1px solid currentColor;
|
|
345
345
|
color: currentColor;
|
|
346
346
|
}
|
|
347
347
|
@media (hover: hover) and (pointer: fine) {
|
|
348
|
-
._Button--
|
|
348
|
+
._Button--secondary_1sscz_88:hover {
|
|
349
349
|
background-color: var(--puck-color-azure-12);
|
|
350
350
|
color: var(--puck-color-black);
|
|
351
351
|
}
|
|
352
352
|
}
|
|
353
|
-
._Button--
|
|
353
|
+
._Button--secondary_1sscz_88:active {
|
|
354
354
|
background-color: var(--puck-color-azure-11);
|
|
355
355
|
color: var(--puck-color-black);
|
|
356
356
|
}
|
|
357
|
-
._Button--
|
|
357
|
+
._Button--danger_1sscz_105 {
|
|
358
358
|
background: var(--puck-color-red-04);
|
|
359
359
|
}
|
|
360
360
|
@media (hover: hover) and (pointer: fine) {
|
|
361
|
-
._Button--
|
|
361
|
+
._Button--danger_1sscz_105:hover {
|
|
362
362
|
background-color: var(--puck-color-red-03);
|
|
363
363
|
}
|
|
364
364
|
}
|
|
365
|
-
._Button--
|
|
365
|
+
._Button--danger_1sscz_105:active {
|
|
366
366
|
background-color: var(--puck-color-red-02);
|
|
367
367
|
}
|
|
368
|
-
._Button--
|
|
368
|
+
._Button--flush_1sscz_119 {
|
|
369
369
|
border-radius: 0;
|
|
370
370
|
}
|
|
371
|
-
._Button--
|
|
372
|
-
|
|
371
|
+
._Button--ghost_1sscz_123 {
|
|
372
|
+
align-items: center;
|
|
373
|
+
background-color: transparent;
|
|
374
|
+
border: none;
|
|
375
|
+
border-radius: 4px;
|
|
376
|
+
color: var(--puck-color-grey-08);
|
|
377
|
+
padding: 8px;
|
|
378
|
+
display: flex;
|
|
379
|
+
}
|
|
380
|
+
@media (hover: hover) and (pointer: fine) {
|
|
381
|
+
._Button--ghost_1sscz_123:hover {
|
|
382
|
+
background-color: var(--puck-color-azure-11);
|
|
383
|
+
color: var(--puck-color-azure-04);
|
|
384
|
+
cursor: pointer;
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
._Button--disabled_1sscz_141,
|
|
388
|
+
._Button--disabled_1sscz_141:hover {
|
|
373
389
|
background-color: var(--puck-color-grey-09);
|
|
374
390
|
color: var(--puck-color-grey-05);
|
|
375
391
|
cursor: not-allowed;
|
|
376
392
|
}
|
|
377
|
-
._Button--
|
|
393
|
+
._Button--fullWidth_1sscz_148 {
|
|
378
394
|
justify-content: center;
|
|
379
395
|
width: 100%;
|
|
380
396
|
}
|
|
381
|
-
._Button-
|
|
397
|
+
._Button-spinner_1sscz_153 {
|
|
382
398
|
padding-left: 8px;
|
|
383
399
|
}
|
|
384
400
|
|
|
@@ -908,6 +924,156 @@ p {
|
|
|
908
924
|
color: var(--puck-color-grey-05);
|
|
909
925
|
}
|
|
910
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_yaytb_1 {
|
|
929
|
+
opacity: 0;
|
|
930
|
+
}
|
|
931
|
+
._PlanGrid-grid_yaytb_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_yaytb_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_yaytb_16 a {
|
|
950
|
+
color: var(--puck-color-azure-04);
|
|
951
|
+
cursor: pointer;
|
|
952
|
+
}
|
|
953
|
+
|
|
954
|
+
/* css-module:/home/runner/work/puck-platform/puck-platform/packages/platform-client/components/PlanCard/styles.module.css/#css-module-data */
|
|
955
|
+
._PlanCard_xeanv_1 {
|
|
956
|
+
border: 1px solid var(--puck-color-grey-09);
|
|
957
|
+
border-radius: 16px;
|
|
958
|
+
display: flex;
|
|
959
|
+
gap: 8px;
|
|
960
|
+
flex-direction: column;
|
|
961
|
+
min-width: 256px;
|
|
962
|
+
padding: 8px;
|
|
963
|
+
}
|
|
964
|
+
._PlanCard--enterprise_xeanv_11 {
|
|
965
|
+
flex-direction: row;
|
|
966
|
+
grid-column: span 3;
|
|
967
|
+
}
|
|
968
|
+
._PlanCard-title_xeanv_16 {
|
|
969
|
+
font-size: var(--puck-font-size-xs);
|
|
970
|
+
font-weight: 700;
|
|
971
|
+
white-space: nowrap;
|
|
972
|
+
}
|
|
973
|
+
._PlanCard-header_xeanv_22 {
|
|
974
|
+
box-sizing: border-box;
|
|
975
|
+
display: flex;
|
|
976
|
+
flex-direction: column;
|
|
977
|
+
gap: 4px;
|
|
978
|
+
padding: 12px 16px;
|
|
979
|
+
width: 100%;
|
|
980
|
+
}
|
|
981
|
+
._PlanCard-features_xeanv_31 {
|
|
982
|
+
display: grid;
|
|
983
|
+
gap: 4px;
|
|
984
|
+
list-style: none;
|
|
985
|
+
margin: 0;
|
|
986
|
+
padding: 0;
|
|
987
|
+
}
|
|
988
|
+
._PlanCard-feature_xeanv_31 {
|
|
989
|
+
align-items: center;
|
|
990
|
+
display: flex;
|
|
991
|
+
gap: 4px;
|
|
992
|
+
color: var(--puck-color-grey-05);
|
|
993
|
+
font-size: var(--puck-font-size-xxs);
|
|
994
|
+
}
|
|
995
|
+
._PlanCard-featureIcon_xeanv_47 {
|
|
996
|
+
align-self: flex-start;
|
|
997
|
+
margin-top: 5px;
|
|
998
|
+
}
|
|
999
|
+
._PlanCard-featureTitle_xeanv_52 {
|
|
1000
|
+
color: var(--puck-color-grey-04);
|
|
1001
|
+
font-weight: 600;
|
|
1002
|
+
}
|
|
1003
|
+
._PlanCard-priceValue_xeanv_57 {
|
|
1004
|
+
font-size: var(--puck-font-size-m);
|
|
1005
|
+
}
|
|
1006
|
+
._PlanCard-priceInterval_xeanv_61 {
|
|
1007
|
+
color: var(--puck-color-grey-05);
|
|
1008
|
+
}
|
|
1009
|
+
._PlanCard-body_xeanv_65 {
|
|
1010
|
+
background-color: var(--puck-color-grey-12);
|
|
1011
|
+
border: 1px solid var(--puck-color-grey-11);
|
|
1012
|
+
border-radius: 8px;
|
|
1013
|
+
padding: 16px;
|
|
1014
|
+
flex-grow: 1;
|
|
1015
|
+
}
|
|
1016
|
+
._PlanCard--enterprise_xeanv_11 ._PlanCard-body_xeanv_65 {
|
|
1017
|
+
display: flex;
|
|
1018
|
+
gap: 8px;
|
|
1019
|
+
width: 100%;
|
|
1020
|
+
}
|
|
1021
|
+
._PlanCard-section_xeanv_79 {
|
|
1022
|
+
padding-bottom: 16px;
|
|
1023
|
+
min-width: 192px;
|
|
1024
|
+
}
|
|
1025
|
+
._PlanCard-section_xeanv_79:last-of-type {
|
|
1026
|
+
padding-bottom: 0;
|
|
1027
|
+
}
|
|
1028
|
+
._PlanCard-section_xeanv_79 + ._PlanCard-section_xeanv_79 {
|
|
1029
|
+
border-top: 1px solid var(--puck-color-grey-09);
|
|
1030
|
+
padding-top: 16px;
|
|
1031
|
+
}
|
|
1032
|
+
._PlanCard--enterprise_xeanv_11 {
|
|
1033
|
+
._PlanCard-section_xeanv_79 + ._PlanCard-section_xeanv_79 {
|
|
1034
|
+
border-left: 1px solid var(--puck-color-grey-09);
|
|
1035
|
+
border-top: none;
|
|
1036
|
+
padding-left: 16px;
|
|
1037
|
+
padding-top: 0;
|
|
1038
|
+
}
|
|
1039
|
+
}
|
|
1040
|
+
._PlanCard-sectionTitle_xeanv_102 {
|
|
1041
|
+
font-size: var(--puck-font-size-xs);
|
|
1042
|
+
font-weight: 500;
|
|
1043
|
+
margin-bottom: 8px;
|
|
1044
|
+
}
|
|
1045
|
+
._PlanCard-sectionBody_xeanv_108 + ._PlanCard-sectionTitle_xeanv_102 {
|
|
1046
|
+
border-top: 1px solid var(--puck-color-grey-09);
|
|
1047
|
+
margin-top: 16px;
|
|
1048
|
+
padding-top: 16px;
|
|
1049
|
+
}
|
|
1050
|
+
._PlanCard-sectionBody_xeanv_108 {
|
|
1051
|
+
color: var(--puck-color-grey-03);
|
|
1052
|
+
font-size: var(--puck-font-size-xxs);
|
|
1053
|
+
display: grid;
|
|
1054
|
+
gap: 2px;
|
|
1055
|
+
}
|
|
1056
|
+
._PlanCard-usageItem_xeanv_121 {
|
|
1057
|
+
display: flex;
|
|
1058
|
+
gap: 8px;
|
|
1059
|
+
font-size: var(--puck-font-size-xxs);
|
|
1060
|
+
}
|
|
1061
|
+
._PlanCard-usageLabel_xeanv_127 {
|
|
1062
|
+
color: var(--puck-color-grey-04);
|
|
1063
|
+
font-weight: 500;
|
|
1064
|
+
}
|
|
1065
|
+
._PlanCard-usageValue_xeanv_132 {
|
|
1066
|
+
color: var(--puck-color-grey-05);
|
|
1067
|
+
font-family: var(--puck-font-family-monospaced);
|
|
1068
|
+
margin-left: auto;
|
|
1069
|
+
}
|
|
1070
|
+
._PlanCard-action_xeanv_138 {
|
|
1071
|
+
align-items: flex-end;
|
|
1072
|
+
display: flex;
|
|
1073
|
+
justify-content: flex-end;
|
|
1074
|
+
width: 100%;
|
|
1075
|
+
}
|
|
1076
|
+
|
|
911
1077
|
/* css-module:/home/runner/work/puck-platform/puck-platform/packages/platform-client/components/Section/Section.module.css/#css-module-data */
|
|
912
1078
|
._Section-inner_1uwo0_1 {
|
|
913
1079
|
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 };
|