@puckeditor/plugin-ai 0.1.0-canary.3c29c6ea → 0.1.0-canary.4aba31f4
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 +27 -93
- package/dist/index.d.mts +28 -10
- package/dist/index.d.ts +28 -10
- package/dist/index.js +477 -617
- package/dist/index.mjs +472 -612
- package/package.json +3 -4
package/dist/index.css
CHANGED
|
@@ -372,72 +372,43 @@ p {
|
|
|
372
372
|
}
|
|
373
373
|
|
|
374
374
|
/* css-module:/home/runner/work/puck-platform/puck-platform/packages/platform-client/components/Heading/Heading.module.css/#css-module-data */
|
|
375
|
-
.
|
|
375
|
+
._Heading_1czuc_1 {
|
|
376
376
|
display: block;
|
|
377
377
|
font-weight: 700;
|
|
378
378
|
margin: 0;
|
|
379
379
|
}
|
|
380
|
-
.
|
|
380
|
+
._Heading_1czuc_1 b {
|
|
381
381
|
font-weight: 700;
|
|
382
382
|
}
|
|
383
|
-
._Heading--
|
|
383
|
+
._Heading--xxxxl_1czuc_11 {
|
|
384
|
+
font-size: var(--puck-font-size-xxxxl);
|
|
385
|
+
letter-spacing: 0.08ch;
|
|
386
|
+
font-weight: 800;
|
|
387
|
+
}
|
|
388
|
+
._Heading--xxxl_1czuc_17 {
|
|
384
389
|
font-size: var(--puck-font-size-xxxl);
|
|
385
390
|
}
|
|
386
|
-
._Heading--
|
|
391
|
+
._Heading--xxl_1czuc_21 {
|
|
387
392
|
font-size: var(--puck-font-size-xxl);
|
|
388
393
|
}
|
|
389
|
-
._Heading--
|
|
394
|
+
._Heading--xl_1czuc_25 {
|
|
390
395
|
font-size: var(--puck-font-size-xl);
|
|
391
396
|
}
|
|
392
|
-
._Heading--
|
|
397
|
+
._Heading--l_1czuc_29 {
|
|
393
398
|
font-size: var(--puck-font-size-l);
|
|
394
399
|
}
|
|
395
|
-
._Heading--
|
|
400
|
+
._Heading--m_1czuc_33 {
|
|
396
401
|
font-size: var(--puck-font-size-m);
|
|
397
402
|
}
|
|
398
|
-
._Heading--
|
|
403
|
+
._Heading--s_1czuc_37 {
|
|
399
404
|
font-size: var(--puck-font-size-s);
|
|
400
405
|
}
|
|
401
|
-
._Heading--
|
|
406
|
+
._Heading--xs_1czuc_41 {
|
|
402
407
|
font-size: var(--puck-font-size-xs);
|
|
403
408
|
}
|
|
404
|
-
._Heading--
|
|
405
|
-
font-size: var(--puck-font-size-xxs);
|
|
406
|
-
}
|
|
407
|
-
._Heading--xxs_qkzg9_43 {
|
|
409
|
+
._Heading--xxs_1czuc_45 {
|
|
408
410
|
font-size: var(--puck-font-size-xxs);
|
|
409
411
|
}
|
|
410
|
-
@media (min-width: 768px) {
|
|
411
|
-
._Heading--xxxxl_qkzg9_11 {
|
|
412
|
-
font-size: var(--puck-font-size-xxxxl);
|
|
413
|
-
letter-spacing: 0.08ch;
|
|
414
|
-
font-weight: 800;
|
|
415
|
-
}
|
|
416
|
-
._Heading--xxxl_qkzg9_15 {
|
|
417
|
-
font-size: var(--puck-font-size-xxxl);
|
|
418
|
-
}
|
|
419
|
-
._Heading--xxl_qkzg9_19 {
|
|
420
|
-
font-size: var(--puck-font-size-xxl);
|
|
421
|
-
}
|
|
422
|
-
._Heading--xl_qkzg9_23 {
|
|
423
|
-
font-size: var(--puck-font-size-xl);
|
|
424
|
-
}
|
|
425
|
-
._Heading--l_qkzg9_27 {
|
|
426
|
-
font-size: var(--puck-font-size-l);
|
|
427
|
-
}
|
|
428
|
-
._Heading--m_qkzg9_31 {
|
|
429
|
-
font-size: var(--puck-font-size-m);
|
|
430
|
-
}
|
|
431
|
-
._Heading--s_qkzg9_35 {
|
|
432
|
-
font-size: var(--puck-font-size-s);
|
|
433
|
-
}
|
|
434
|
-
._Heading--xs_qkzg9_39 {
|
|
435
|
-
font-size: var(--puck-font-size-xs);
|
|
436
|
-
}
|
|
437
|
-
._Heading--xxs_qkzg9_43 {
|
|
438
|
-
font-size: var(--puck-font-size-xxs);
|
|
439
|
-
}
|
|
440
|
-
}
|
|
441
412
|
|
|
442
413
|
/* css-module:/home/runner/work/puck-platform/puck-platform/packages/platform-client/components/Align/Align.module.css/#css-module-data */
|
|
443
414
|
._Align_oewlu_1 {
|
|
@@ -631,13 +602,13 @@ p {
|
|
|
631
602
|
}
|
|
632
603
|
|
|
633
604
|
/* css-module:/home/runner/work/puck-platform/puck-platform/packages/platform-client/components/Page/Page.module.css/#css-module-data */
|
|
634
|
-
.
|
|
605
|
+
._Page_1pzwy_1 {
|
|
635
606
|
display: flex;
|
|
636
607
|
flex-direction: column;
|
|
637
608
|
height: 100%;
|
|
638
609
|
overflow: hidden;
|
|
639
610
|
}
|
|
640
|
-
._Page-
|
|
611
|
+
._Page-masthead_1pzwy_8 {
|
|
641
612
|
align-items: center;
|
|
642
613
|
display: flex;
|
|
643
614
|
gap: 16px;
|
|
@@ -645,47 +616,45 @@ p {
|
|
|
645
616
|
box-sizing: border-box;
|
|
646
617
|
border-bottom: 1px solid var(--puck-color-grey-10);
|
|
647
618
|
min-height: 64px;
|
|
648
|
-
overflow-x: auto;
|
|
649
619
|
}
|
|
650
|
-
._Page-
|
|
620
|
+
._Page-crumbs_1pzwy_18 {
|
|
651
621
|
display: flex;
|
|
652
622
|
gap: 32px;
|
|
653
623
|
}
|
|
654
|
-
._Page-
|
|
624
|
+
._Page-crumb_1pzwy_18 {
|
|
655
625
|
color: var(--puck-color-grey-05);
|
|
656
626
|
position: relative;
|
|
657
|
-
white-space: nowrap;
|
|
658
627
|
}
|
|
659
|
-
._Page-
|
|
628
|
+
._Page-crumbLink_1pzwy_28 {
|
|
660
629
|
color: var(--puck-color-grey-05);
|
|
661
630
|
text-decoration: none;
|
|
662
631
|
}
|
|
663
|
-
._Page-
|
|
632
|
+
._Page-crumbLink_1pzwy_28:hover {
|
|
664
633
|
color: var(--puck-color-azure-04);
|
|
665
634
|
}
|
|
666
|
-
._Page-
|
|
635
|
+
._Page-crumb_1pzwy_18:last-of-type {
|
|
667
636
|
color: var(--puck-color-grey-01);
|
|
668
637
|
font-weight: 600;
|
|
669
638
|
}
|
|
670
|
-
._Page-
|
|
639
|
+
._Page-crumb_1pzwy_18::before {
|
|
671
640
|
position: absolute;
|
|
672
641
|
content: "/";
|
|
673
642
|
left: -19px;
|
|
674
643
|
color: var(--puck-color-grey-09);
|
|
675
644
|
font-weight: 400;
|
|
676
645
|
}
|
|
677
|
-
._Page-
|
|
646
|
+
._Page-crumb_1pzwy_18:first-of-type::before {
|
|
678
647
|
display: none;
|
|
679
648
|
}
|
|
680
|
-
._Page-
|
|
649
|
+
._Page-crumb_1pzwy_18 {
|
|
681
650
|
color: var(--puck-color-grey-05);
|
|
682
651
|
position: relative;
|
|
683
652
|
text-decoration: none;
|
|
684
653
|
}
|
|
685
|
-
._Page-
|
|
654
|
+
._Page-actions_1pzwy_60 {
|
|
686
655
|
margin-left: auto;
|
|
687
656
|
}
|
|
688
|
-
._Page-
|
|
657
|
+
._Page-footer_1pzwy_64 {
|
|
689
658
|
border-top: 1px solid var(--puck-color-grey-10);
|
|
690
659
|
padding: 16px 24px;
|
|
691
660
|
}
|
|
@@ -924,41 +893,6 @@ p {
|
|
|
924
893
|
padding-top: 128px;
|
|
925
894
|
}
|
|
926
895
|
|
|
927
|
-
/* css-module:/home/runner/work/puck-platform/puck-platform/packages/platform-client/components/Viewport/styles.module.css/#css-module-data */
|
|
928
|
-
._Viewport_1vvhm_3 {
|
|
929
|
-
}
|
|
930
|
-
._Viewport--standard_1vvhm_6,
|
|
931
|
-
._Viewport--inline_1vvhm_7._Viewport--standard_1vvhm_6 {
|
|
932
|
-
display: none;
|
|
933
|
-
}
|
|
934
|
-
._Viewport--narrow_1vvhm_11 {
|
|
935
|
-
display: block;
|
|
936
|
-
}
|
|
937
|
-
._Viewport--inline_1vvhm_7._Viewport--narrow_1vvhm_11 {
|
|
938
|
-
display: inline;
|
|
939
|
-
}
|
|
940
|
-
._Viewport--flex_1vvhm_19._Viewport--narrow_1vvhm_11 {
|
|
941
|
-
display: flex;
|
|
942
|
-
}
|
|
943
|
-
@media (min-width: 768px) {
|
|
944
|
-
._Viewport--narrow_1vvhm_11,
|
|
945
|
-
._Viewport--inline_1vvhm_7._Viewport--narrow_1vvhm_11,
|
|
946
|
-
._Viewport--flex_1vvhm_19._Viewport--narrow_1vvhm_11 {
|
|
947
|
-
display: none;
|
|
948
|
-
}
|
|
949
|
-
}
|
|
950
|
-
@media (min-width: 768px) {
|
|
951
|
-
._Viewport--standard_1vvhm_6 {
|
|
952
|
-
display: block;
|
|
953
|
-
}
|
|
954
|
-
._Viewport--inline_1vvhm_7._Viewport--standard_1vvhm_6 {
|
|
955
|
-
display: inline;
|
|
956
|
-
}
|
|
957
|
-
._Viewport--flex_1vvhm_19._Viewport--standard_1vvhm_6 {
|
|
958
|
-
display: flex;
|
|
959
|
-
}
|
|
960
|
-
}
|
|
961
|
-
|
|
962
896
|
/* css-module:/home/runner/work/puck-platform/puck-platform/packages/plugin-ai/src/components/ChatBody/styles.module.css/#css-module-data */
|
|
963
897
|
._Chat_150yz_1 {
|
|
964
898
|
--fade-size: 32px;
|
package/dist/index.d.mts
CHANGED
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { UIMessage, ChatStatus } from 'ai';
|
|
3
|
+
import { PuckProviderMetadata, PuckDataParts } from '@puckeditor/platform-types';
|
|
4
|
+
import { ReactNode, RefObject } from 'react';
|
|
2
5
|
|
|
3
|
-
type
|
|
6
|
+
type PuckMessage = UIMessage<PuckProviderMetadata, PuckDataParts>;
|
|
7
|
+
|
|
8
|
+
type ChatProps$1 = {
|
|
4
9
|
host?: string;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
onSubmit?: (prompt: string) => void;
|
|
11
|
+
examplePrompts?: {
|
|
12
|
+
href: string;
|
|
13
|
+
label: string;
|
|
14
|
+
}[];
|
|
15
|
+
chatId?: string;
|
|
16
|
+
initialMessages?: PuckMessage[];
|
|
12
17
|
};
|
|
13
18
|
|
|
14
|
-
declare function
|
|
19
|
+
declare function createAIPlugin(opts?: ChatProps$1): {
|
|
15
20
|
label: string;
|
|
16
21
|
name: string;
|
|
17
22
|
render: () => react_jsx_runtime.JSX.Element;
|
|
@@ -19,4 +24,17 @@ declare function createAiPlugin(opts?: AiPluginProps): {
|
|
|
19
24
|
mobilePanelHeight: "min-content";
|
|
20
25
|
};
|
|
21
26
|
|
|
22
|
-
|
|
27
|
+
type ChatProps = {
|
|
28
|
+
children?: ReactNode;
|
|
29
|
+
examplePrompts?: ReactNode;
|
|
30
|
+
handleSubmit?: (prompt: string) => void;
|
|
31
|
+
hideInput?: boolean;
|
|
32
|
+
inputRef?: RefObject<HTMLTextAreaElement | null>;
|
|
33
|
+
status?: ChatStatus;
|
|
34
|
+
messages?: PuckMessage[];
|
|
35
|
+
error?: string;
|
|
36
|
+
handleRetry?: () => void;
|
|
37
|
+
};
|
|
38
|
+
declare function ChatBody({ children, examplePrompts, handleSubmit, hideInput, inputRef, messages, status, error, handleRetry, }: ChatProps): react_jsx_runtime.JSX.Element;
|
|
39
|
+
|
|
40
|
+
export { ChatBody, createAIPlugin as default };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { UIMessage, ChatStatus } from 'ai';
|
|
3
|
+
import { PuckProviderMetadata, PuckDataParts } from '@puckeditor/platform-types';
|
|
4
|
+
import { ReactNode, RefObject } from 'react';
|
|
2
5
|
|
|
3
|
-
type
|
|
6
|
+
type PuckMessage = UIMessage<PuckProviderMetadata, PuckDataParts>;
|
|
7
|
+
|
|
8
|
+
type ChatProps$1 = {
|
|
4
9
|
host?: string;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
onSubmit?: (prompt: string) => void;
|
|
11
|
+
examplePrompts?: {
|
|
12
|
+
href: string;
|
|
13
|
+
label: string;
|
|
14
|
+
}[];
|
|
15
|
+
chatId?: string;
|
|
16
|
+
initialMessages?: PuckMessage[];
|
|
12
17
|
};
|
|
13
18
|
|
|
14
|
-
declare function
|
|
19
|
+
declare function createAIPlugin(opts?: ChatProps$1): {
|
|
15
20
|
label: string;
|
|
16
21
|
name: string;
|
|
17
22
|
render: () => react_jsx_runtime.JSX.Element;
|
|
@@ -19,4 +24,17 @@ declare function createAiPlugin(opts?: AiPluginProps): {
|
|
|
19
24
|
mobilePanelHeight: "min-content";
|
|
20
25
|
};
|
|
21
26
|
|
|
22
|
-
|
|
27
|
+
type ChatProps = {
|
|
28
|
+
children?: ReactNode;
|
|
29
|
+
examplePrompts?: ReactNode;
|
|
30
|
+
handleSubmit?: (prompt: string) => void;
|
|
31
|
+
hideInput?: boolean;
|
|
32
|
+
inputRef?: RefObject<HTMLTextAreaElement | null>;
|
|
33
|
+
status?: ChatStatus;
|
|
34
|
+
messages?: PuckMessage[];
|
|
35
|
+
error?: string;
|
|
36
|
+
handleRetry?: () => void;
|
|
37
|
+
};
|
|
38
|
+
declare function ChatBody({ children, examplePrompts, handleSubmit, hideInput, inputRef, messages, status, error, handleRetry, }: ChatProps): react_jsx_runtime.JSX.Element;
|
|
39
|
+
|
|
40
|
+
export { ChatBody, createAIPlugin as default };
|