open-chat-studio-widget 0.4.3 → 0.4.4
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/README.md +17 -14
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/open-chat-studio-widget.cjs.entry.js +8 -8
- package/dist/cjs/open-chat-studio-widget.cjs.entry.js.map +1 -1
- package/dist/cjs/open-chat-studio-widget.cjs.js +1 -1
- package/dist/collection/components/ocs-chat/heroicons.js +5 -5
- package/dist/collection/components/ocs-chat/heroicons.js.map +1 -1
- package/dist/collection/components/ocs-chat/ocs-chat.css +78 -55
- package/dist/collection/components/ocs-chat/ocs-chat.js +21 -2
- package/dist/collection/components/ocs-chat/ocs-chat.js.map +1 -1
- package/dist/components/open-chat-studio-widget.js +9 -8
- package/dist/components/open-chat-studio-widget.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/open-chat-studio-widget.entry.js +8 -8
- package/dist/esm/open-chat-studio-widget.entry.js.map +1 -1
- package/dist/esm/open-chat-studio-widget.js +1 -1
- package/dist/open-chat-studio-widget/open-chat-studio-widget.esm.js +1 -1
- package/dist/open-chat-studio-widget/open-chat-studio-widget.esm.js.map +1 -1
- package/dist/open-chat-studio-widget/p-19d45fe5.entry.js +3 -0
- package/dist/open-chat-studio-widget/p-19d45fe5.entry.js.map +1 -0
- package/dist/types/components/ocs-chat/ocs-chat.d.ts +4 -0
- package/dist/types/components.d.ts +8 -0
- package/package.json +1 -1
- package/dist/open-chat-studio-widget/p-6c3059b7.entry.js +0 -3
- package/dist/open-chat-studio-widget/p-6c3059b7.entry.js.map +0 -1
|
@@ -19,7 +19,7 @@ var patchBrowser = () => {
|
|
|
19
19
|
|
|
20
20
|
patchBrowser().then(async (options) => {
|
|
21
21
|
await appGlobals.globalScripts();
|
|
22
|
-
return index.bootstrapLazy([["open-chat-studio-widget.cjs",[[1,"open-chat-studio-widget",{"chatbotId":[1,"chatbot-id"],"apiBaseUrl":[1,"api-base-url"],"buttonText":[1,"button-text"],"iconUrl":[1,"icon-url"],"buttonShape":[1,"button-shape"],"visible":[1028],"position":[1025],"welcomeMessages":[1,"welcome-messages"],"starterQuestions":[1,"starter-questions"],"userId":[1,"user-id"],"userName":[1,"user-name"],"persistentSession":[4,"persistent-session"],"persistentSessionExpire":[2,"persistent-session-expire"],"allowFullScreen":[4,"allow-full-screen"],"loaded":[32],"error":[32],"messages":[32],"sessionId":[32],"isLoading":[32],"isTyping":[32],"messageInput":[32],"pollingInterval":[32],"lastPollTime":[32],"isTaskPolling":[32],"isDragging":[32],"dragOffset":[32],"windowPosition":[32],"fullscreenPosition":[32],"showStarterQuestions":[32],"parsedWelcomeMessages":[32],"parsedStarterQuestions":[32],"generatedUserId":[32],"isFullscreen":[32]}]]]], options);
|
|
22
|
+
return index.bootstrapLazy([["open-chat-studio-widget.cjs",[[1,"open-chat-studio-widget",{"chatbotId":[1,"chatbot-id"],"apiBaseUrl":[1,"api-base-url"],"buttonText":[1,"button-text"],"iconUrl":[1,"icon-url"],"buttonShape":[1,"button-shape"],"headerText":[1,"header-text"],"visible":[1028],"position":[1025],"welcomeMessages":[1,"welcome-messages"],"starterQuestions":[1,"starter-questions"],"userId":[1,"user-id"],"userName":[1,"user-name"],"persistentSession":[4,"persistent-session"],"persistentSessionExpire":[2,"persistent-session-expire"],"allowFullScreen":[4,"allow-full-screen"],"loaded":[32],"error":[32],"messages":[32],"sessionId":[32],"isLoading":[32],"isTyping":[32],"messageInput":[32],"pollingInterval":[32],"lastPollTime":[32],"isTaskPolling":[32],"isDragging":[32],"dragOffset":[32],"windowPosition":[32],"fullscreenPosition":[32],"showStarterQuestions":[32],"parsedWelcomeMessages":[32],"parsedStarterQuestions":[32],"generatedUserId":[32],"isFullscreen":[32]}]]]], options);
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
exports.setNonce = index.setNonce;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
2
|
export const XMarkIcon = () => {
|
|
3
|
-
return h("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", "stroke-width": "1.5", stroke: "currentColor"
|
|
3
|
+
return h("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", "stroke-width": "1.5", stroke: "currentColor" }, h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", d: "M6 18 18 6M6 6l12 12" }));
|
|
4
4
|
};
|
|
5
5
|
export const GripDotsVerticalIcon = () => {
|
|
6
|
-
return (h("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "currentColor", viewBox: "0 0 24 24"
|
|
6
|
+
return (h("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "currentColor", viewBox: "0 0 24 24" }, h("circle", { cx: "8", cy: "6", r: "1.5" }), h("circle", { cx: "8", cy: "12", r: "1.5" }), h("circle", { cx: "8", cy: "18", r: "1.5" }), h("circle", { cx: "16", cy: "6", r: "1.5" }), h("circle", { cx: "16", cy: "12", r: "1.5" }), h("circle", { cx: "16", cy: "18", r: "1.5" })));
|
|
7
7
|
};
|
|
8
8
|
export const PencilSquare = () => {
|
|
9
|
-
return (h("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", "stroke-width": "1.5", stroke: "currentColor"
|
|
9
|
+
return (h("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", "stroke-width": "1.5", stroke: "currentColor" }, h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", d: "m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L10.582 16.07a4.5 4.5 0 0 1-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 0 1 1.13-1.897l8.932-8.931Zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0 1 15.75 21H5.25A2.25 2.25 0 0 1 3 18.75V8.25A2.25 2.25 0 0 1 5.25 6H10" })));
|
|
10
10
|
};
|
|
11
11
|
export const ArrowsPointingOutIcon = () => {
|
|
12
|
-
return (h("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", "stroke-width": "1.5", stroke: "currentColor"
|
|
12
|
+
return (h("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", "stroke-width": "1.5", stroke: "currentColor" }, h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", d: "M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15" })));
|
|
13
13
|
};
|
|
14
14
|
export const ArrowsPointingInIcon = () => {
|
|
15
|
-
return (h("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", "stroke-width": "1.5", stroke: "currentColor"
|
|
15
|
+
return (h("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", "stroke-width": "1.5", stroke: "currentColor" }, h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", d: "M9 9V4.5M9 9H4.5M9 9 3.75 3.75M15 9h4.5M15 9V4.5M15 9l5.25-5.25M9 15v4.5M9 15H4.5M9 15l-5.25 5.25M15 15h4.5M15 15v4.5m0-4.5 5.25 5.25" })));
|
|
16
16
|
};
|
|
17
17
|
//# sourceMappingURL=heroicons.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"heroicons.js","sourceRoot":"","sources":["../../../src/components/ocs-chat/heroicons.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,eAAe,CAAC;AAEhC,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,EAAE;IAC5B,OAAO,WAAK,KAAK,EAAC,4BAA4B,EAAC,IAAI,EAAC,MAAM,EAAC,OAAO,EAAC,WAAW,kBAAc,KAAK,
|
|
1
|
+
{"version":3,"file":"heroicons.js","sourceRoot":"","sources":["../../../src/components/ocs-chat/heroicons.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAC,CAAC,EAAC,MAAM,eAAe,CAAC;AAEhC,MAAM,CAAC,MAAM,SAAS,GAAG,GAAG,EAAE;IAC5B,OAAO,WAAK,KAAK,EAAC,4BAA4B,EAAC,IAAI,EAAC,MAAM,EAAC,OAAO,EAAC,WAAW,kBAAc,KAAK,EAAC,MAAM,EAAC,cAAc;QACrH,8BAAqB,OAAO,qBAAiB,OAAO,EAAC,CAAC,EAAC,sBAAsB,GAAE,CAC3E,CAAC;AACT,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,EAAE;IACvC,OAAO,CACL,WACE,KAAK,EAAC,4BAA4B,EAClC,IAAI,EAAC,cAAc,EACnB,OAAO,EAAC,WAAW;QAGnB,cAAQ,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,GAAG,EAAC,CAAC,EAAC,KAAK,GAAG;QAChC,cAAQ,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,IAAI,EAAC,CAAC,EAAC,KAAK,GAAG;QACjC,cAAQ,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,IAAI,EAAC,CAAC,EAAC,KAAK,GAAG;QAGjC,cAAQ,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,GAAG,EAAC,CAAC,EAAC,KAAK,GAAG;QACjC,cAAQ,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,EAAC,CAAC,EAAC,KAAK,GAAG;QAClC,cAAQ,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,EAAC,CAAC,EAAC,KAAK,GAAG,CAC9B,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAG,GAAG,EAAE;IAC/B,OAAO,CACL,WAAK,KAAK,EAAC,4BAA4B,EAAC,IAAI,EAAC,MAAM,EAAC,OAAO,EAAC,WAAW,kBAAc,KAAK,EAAC,MAAM,EAAC,cAAc;QAC9G,8BAAqB,OAAO,qBAAiB,OAAO,EAC9C,CAAC,EAAC,kQAAkQ,GAAE,CACxQ,CACP,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,EAAE;IACxC,OAAO,CACL,WAAK,KAAK,EAAC,4BAA4B,EAAC,IAAI,EAAC,MAAM,EAAC,OAAO,EAAC,WAAW,kBAAc,KAAK,EAAC,MAAM,EAAC,cAAc;QAC9G,8BAAqB,OAAO,qBAAiB,OAAO,EAC9C,CAAC,EAAC,uJAAuJ,GAAE,CAC7J,CACP,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,EAAE;IACvC,OAAO,CACL,WAAK,KAAK,EAAC,4BAA4B,EAAC,IAAI,EAAC,MAAM,EAAC,OAAO,EAAC,WAAW,kBAAc,KAAK,EAAC,MAAM,EAAC,cAAc;QAC9G,8BAAqB,OAAO,qBAAiB,OAAO,EAC9C,CAAC,EAAC,uIAAuI,GAAE,CAC7I,CACP,CAAA;AACH,CAAC,CAAA","sourcesContent":["import {h} from \"@stencil/core\";\n\nexport const XMarkIcon = () => {\n return <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M6 18 18 6M6 6l12 12\"/>\n </svg>;\n}\n\nexport const GripDotsVerticalIcon = () => {\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"currentColor\"\n viewBox=\"0 0 24 24\"\n >\n {/* Left column of dots */}\n <circle cx=\"8\" cy=\"6\" r=\"1.5\" />\n <circle cx=\"8\" cy=\"12\" r=\"1.5\" />\n <circle cx=\"8\" cy=\"18\" r=\"1.5\" />\n\n {/* Right column of dots */}\n <circle cx=\"16\" cy=\"6\" r=\"1.5\" />\n <circle cx=\"16\" cy=\"12\" r=\"1.5\" />\n <circle cx=\"16\" cy=\"18\" r=\"1.5\" />\n </svg>\n );\n};\n\nexport const PencilSquare = () => {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\"\n d=\"m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L10.582 16.07a4.5 4.5 0 0 1-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 0 1 1.13-1.897l8.932-8.931Zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0 1 15.75 21H5.25A2.25 2.25 0 0 1 3 18.75V8.25A2.25 2.25 0 0 1 5.25 6H10\"/>\n </svg>\n )\n}\n\nexport const ArrowsPointingOutIcon = () => {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\"\n d=\"M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15\"/>\n </svg>\n )\n}\n\nexport const ArrowsPointingInIcon = () => {\n return (\n <svg xmlns=\"http://www.w3.org/2000/svg\" fill=\"none\" viewBox=\"0 0 24 24\" stroke-width=\"1.5\" stroke=\"currentColor\">\n <path stroke-linecap=\"round\" stroke-linejoin=\"round\"\n d=\"M9 9V4.5M9 9H4.5M9 9 3.75 3.75M15 9h4.5M15 9V4.5M15 9l5.25-5.25M9 15v4.5M9 15H4.5M9 15l-5.25 5.25M15 15h4.5M15 15v4.5m0-4.5 5.25 5.25\"/>\n </svg>\n )\n}\n"]}
|
|
@@ -499,6 +499,10 @@ video {
|
|
|
499
499
|
[hidden]:where(:not([hidden="until-found"])) {
|
|
500
500
|
display: none;
|
|
501
501
|
}
|
|
502
|
+
#ocs-chat-window {
|
|
503
|
+
z-index: var(--chat-z-index);
|
|
504
|
+
font-size: var(--chat-window-font-size);
|
|
505
|
+
}
|
|
502
506
|
.starter-question {
|
|
503
507
|
border-radius: 0.5rem;
|
|
504
508
|
text-align: left;
|
|
@@ -533,40 +537,39 @@ video {
|
|
|
533
537
|
.chat-btn-text,
|
|
534
538
|
.chat-btn-icon {
|
|
535
539
|
background-color: var(--button-background-color, white);
|
|
540
|
+
border: 1px solid var(--button-border-color);
|
|
536
541
|
z-index: var(--chat-z-index, 50);
|
|
542
|
+
font-size: var(--button-font-size);
|
|
543
|
+
padding: var(--button-padding, 0.75em);
|
|
544
|
+
}
|
|
545
|
+
.chat-btn-text:hover, .chat-btn-icon:hover {
|
|
546
|
+
color: var(--button-text-color-hover, #1d4ed8);
|
|
547
|
+
border: 1px solid var(--button-border-color-hover);
|
|
537
548
|
}
|
|
538
549
|
/* Button with text and icon */
|
|
539
550
|
.chat-btn-text {
|
|
540
551
|
display: flex;
|
|
541
552
|
align-items: center;
|
|
542
553
|
gap: 8px;
|
|
543
|
-
padding: var(--button-padding, 0.75em);
|
|
544
554
|
color: var(--button-text-color, #111827);
|
|
545
555
|
}
|
|
546
|
-
.chat-btn-text:hover {
|
|
547
|
-
color: var(--button-text-color-hover, #1d4ed8);
|
|
548
|
-
}
|
|
549
556
|
.chat-btn-text span {
|
|
550
557
|
white-space: nowrap;
|
|
551
558
|
font-weight: 500;
|
|
552
|
-
font-size: var(--button-font-size);
|
|
553
559
|
}
|
|
554
560
|
.chat-btn-text img {
|
|
561
|
+
width: var(--button-icon-size);
|
|
562
|
+
height: var(--button-icon-size);
|
|
555
563
|
flex-shrink: 0;
|
|
556
564
|
-o-object-fit: contain;
|
|
557
565
|
object-fit: contain;
|
|
558
|
-
width: var(--button-icon-width, 1.5em);
|
|
559
|
-
height: var(--button-icon-height, 1.5em);
|
|
560
566
|
}
|
|
561
567
|
/* Icon-only button */
|
|
562
568
|
.chat-btn-icon {
|
|
563
|
-
padding: var(--button-padding, 0.75em);
|
|
564
|
-
width: 56px;
|
|
565
|
-
height: 56px;
|
|
566
569
|
}
|
|
567
570
|
.chat-btn-icon img {
|
|
568
|
-
|
|
569
|
-
|
|
571
|
+
width: var(--button-icon-size);
|
|
572
|
+
height: var(--button-icon-size);
|
|
570
573
|
-o-object-fit: contain;
|
|
571
574
|
object-fit: contain;
|
|
572
575
|
}
|
|
@@ -599,7 +602,6 @@ video {
|
|
|
599
602
|
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
600
603
|
transition-duration: 200ms;
|
|
601
604
|
background-color: var(--chat-window-bg-color);
|
|
602
|
-
font-size: var(--chat-window-font-size);
|
|
603
605
|
max-width: var(--chat-window-fullscreen-width);
|
|
604
606
|
}
|
|
605
607
|
.chat-window-normal {
|
|
@@ -650,6 +652,14 @@ video {
|
|
|
650
652
|
padding: var(--header-padding, 0.5em);
|
|
651
653
|
background-color: var(--header-bg-color);
|
|
652
654
|
border-bottom: 1px solid var(--header-border-color);
|
|
655
|
+
font-size: var(--header-font-size);
|
|
656
|
+
}
|
|
657
|
+
.header-text {
|
|
658
|
+
display: flex;
|
|
659
|
+
align-items: center;
|
|
660
|
+
justify-content: center;
|
|
661
|
+
font-size: var(--header-text-font-size);
|
|
662
|
+
color: var(--header-text-color);
|
|
653
663
|
}
|
|
654
664
|
.chat-header:hover,
|
|
655
665
|
.chat-header:active {
|
|
@@ -676,12 +686,6 @@ video {
|
|
|
676
686
|
display: flex;
|
|
677
687
|
gap: 2px;
|
|
678
688
|
}
|
|
679
|
-
@media (min-width: 640px) {
|
|
680
|
-
|
|
681
|
-
.drag-spacer {
|
|
682
|
-
display: none;
|
|
683
|
-
}
|
|
684
|
-
}
|
|
685
689
|
.header-buttons {
|
|
686
690
|
display: flex;
|
|
687
691
|
align-items: center;
|
|
@@ -693,9 +697,13 @@ video {
|
|
|
693
697
|
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
|
|
694
698
|
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
695
699
|
transition-duration: 200ms;
|
|
696
|
-
padding:
|
|
700
|
+
padding: 0.375em;
|
|
697
701
|
color: var(--header-button-text-color);
|
|
698
702
|
}
|
|
703
|
+
.header-button svg {
|
|
704
|
+
width: var(--header-button-icon-size);
|
|
705
|
+
height: var(--header-button-icon-size);
|
|
706
|
+
}
|
|
699
707
|
.header-button:hover {
|
|
700
708
|
background-color: var(--header-button-bg-hover-color);
|
|
701
709
|
}
|
|
@@ -885,7 +893,6 @@ video {
|
|
|
885
893
|
}
|
|
886
894
|
.starter-questions {
|
|
887
895
|
padding: var(--container-padding, 1em);
|
|
888
|
-
font-size: var(--chat-window-font-size);
|
|
889
896
|
}
|
|
890
897
|
.starter-question-row {
|
|
891
898
|
display: flex;
|
|
@@ -893,10 +900,9 @@ video {
|
|
|
893
900
|
}
|
|
894
901
|
/* Input area */
|
|
895
902
|
.input-area {
|
|
896
|
-
padding: var(--container-padding, 1em);
|
|
903
|
+
padding: var(--container-padding, 1em) var(--container-padding, 1em) 0 var(--container-padding, 1em);
|
|
897
904
|
background-color: var(--input-bg-color);
|
|
898
905
|
border-top: 1px solid var(--input-border-color);
|
|
899
|
-
font-size: var(--chat-window-font-size);
|
|
900
906
|
}
|
|
901
907
|
.input-container {
|
|
902
908
|
display: flex;
|
|
@@ -928,7 +934,6 @@ video {
|
|
|
928
934
|
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
929
935
|
transition-duration: 200ms;
|
|
930
936
|
padding: var(--send-button-padding-y, 0.5em) var(--send-button-padding-x, 1em);
|
|
931
|
-
font-size: var(--chat-window-font-size);
|
|
932
937
|
}
|
|
933
938
|
.send-button-enabled {
|
|
934
939
|
background-color: var(--send-button-bg-color);
|
|
@@ -951,12 +956,14 @@ video {
|
|
|
951
956
|
.relative {
|
|
952
957
|
position: relative;
|
|
953
958
|
}
|
|
959
|
+
.flex {
|
|
960
|
+
display: flex;
|
|
961
|
+
}
|
|
954
962
|
.table {
|
|
955
963
|
display: table;
|
|
956
964
|
}
|
|
957
|
-
.
|
|
958
|
-
width:
|
|
959
|
-
height: 1.5rem;
|
|
965
|
+
.w-full {
|
|
966
|
+
width: 100%;
|
|
960
967
|
}
|
|
961
968
|
.transform {
|
|
962
969
|
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
|
@@ -964,6 +971,32 @@ video {
|
|
|
964
971
|
.resize {
|
|
965
972
|
resize: both;
|
|
966
973
|
}
|
|
974
|
+
.items-center {
|
|
975
|
+
align-items: center;
|
|
976
|
+
}
|
|
977
|
+
.justify-center {
|
|
978
|
+
justify-content: center;
|
|
979
|
+
}
|
|
980
|
+
.border {
|
|
981
|
+
border-width: 1px;
|
|
982
|
+
}
|
|
983
|
+
.py-\[2px\] {
|
|
984
|
+
padding-top: 2px;
|
|
985
|
+
padding-bottom: 2px;
|
|
986
|
+
}
|
|
987
|
+
.text-\[0\.8em\] {
|
|
988
|
+
font-size: 0.8em;
|
|
989
|
+
}
|
|
990
|
+
.font-light {
|
|
991
|
+
font-weight: 300;
|
|
992
|
+
}
|
|
993
|
+
.text-slate-500 {
|
|
994
|
+
--tw-text-opacity: 1;
|
|
995
|
+
color: rgb(100 116 139 / var(--tw-text-opacity, 1));
|
|
996
|
+
}
|
|
997
|
+
.underline {
|
|
998
|
+
text-decoration-line: underline;
|
|
999
|
+
}
|
|
967
1000
|
.shadow {
|
|
968
1001
|
--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
|
|
969
1002
|
--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);
|
|
@@ -971,11 +1004,9 @@ video {
|
|
|
971
1004
|
}
|
|
972
1005
|
:host {
|
|
973
1006
|
/**
|
|
974
|
-
* Global Variables
|
|
975
1007
|
* @prop --chat-z-index: Z-index for chat widget (50)
|
|
976
1008
|
* @prop --container-padding: General container padding (1em)
|
|
977
1009
|
*
|
|
978
|
-
* Button Variables
|
|
979
1010
|
* @prop --button-background-color: Button background color (#ffffff)
|
|
980
1011
|
* @prop --button-background-color-hover: Button background color on hover (#f3f4f6)
|
|
981
1012
|
* @prop --button-text-color: Button text color (#111827)
|
|
@@ -983,12 +1014,9 @@ video {
|
|
|
983
1014
|
* @prop --button-border-color: Button border color (#6b7280)
|
|
984
1015
|
* @prop --button-border-color-hover: Button border color on hover (#374151)
|
|
985
1016
|
* @prop --button-padding: Button padding (0.75em)
|
|
986
|
-
* @prop --button-padding-sm: Small button padding (0.375em)
|
|
987
1017
|
* @prop --button-font-size: Button text font size (0.875em)
|
|
988
|
-
* @prop --button-icon-
|
|
989
|
-
* @prop --button-icon-height: Button icon height (1.5em)
|
|
1018
|
+
* @prop --button-icon-size: Button icon size (1.5em)
|
|
990
1019
|
*
|
|
991
|
-
* Chat Window Variables
|
|
992
1020
|
* @prop --chat-window-height: Chat window height in pixels or percent (60%)
|
|
993
1021
|
* @prop --chat-window-width: Chat window width in pixels or percent (25%)
|
|
994
1022
|
* @prop --chat-window-fullscreen-width: Chat window fullscreen width in pixels or percent (80%)
|
|
@@ -998,15 +1026,17 @@ video {
|
|
|
998
1026
|
* @prop --chat-window-font-size: Default font size for text in the chat window (0.875em)
|
|
999
1027
|
* @prop --chat-window-font-size-sm: Font size for small text in the chat window (0.75em)
|
|
1000
1028
|
*
|
|
1001
|
-
* Header Variables
|
|
1002
1029
|
* @prop --header-bg-color: Header background color (transparent)
|
|
1003
1030
|
* @prop --header-bg-hover-color: Header background color on hover (#f9fafb)
|
|
1004
1031
|
* @prop --header-border-color: Header border color (#f3f4f6)
|
|
1005
1032
|
* @prop --header-button-text-color: Header button text color (#6b7280)
|
|
1006
1033
|
* @prop --header-button-bg-hover-color: Header button background on hover (#f3f4f6)
|
|
1007
1034
|
* @prop --header-padding: Header padding (0.5em)
|
|
1035
|
+
* @prop --header-font-size: Header font size (1em)
|
|
1036
|
+
* @prop --header-button-icon-size: Icon size for buttons in the header (1.5em)
|
|
1037
|
+
* @prop --header-text-font-size: Font size for the text in the header (1em)
|
|
1038
|
+
* @prop --header-text-color: Color for the text in the header (#525762)
|
|
1008
1039
|
*
|
|
1009
|
-
* Starter Question Variables
|
|
1010
1040
|
* @prop --starter-question-bg-color: Starter question background color (transparent)
|
|
1011
1041
|
* @prop --starter-question-bg-hover-color: Starter question background on hover (#eff6ff)
|
|
1012
1042
|
* @prop --starter-question-text-color: Starter question text color (#3b82f6)
|
|
@@ -1014,7 +1044,6 @@ video {
|
|
|
1014
1044
|
* @prop --starter-question-border-hover-color: Starter question border on hover (#2563eb)
|
|
1015
1045
|
* @prop --starter-question-padding: Starter question padding (0.75em)
|
|
1016
1046
|
*
|
|
1017
|
-
* Message Bubble Variables
|
|
1018
1047
|
* @prop --message-user-bg-color: User message background color (#3b82f6)
|
|
1019
1048
|
* @prop --message-user-text-color: User message text color (#ffffff)
|
|
1020
1049
|
* @prop --message-assistant-bg-color: Assistant message background color (#e5e7eb)
|
|
@@ -1026,7 +1055,6 @@ video {
|
|
|
1026
1055
|
* @prop --message-padding-x: Message horizontal padding (1em)
|
|
1027
1056
|
* @prop --message-padding-y: Message vertical padding (0.5em)
|
|
1028
1057
|
*
|
|
1029
|
-
* Input Area Variables
|
|
1030
1058
|
* @prop --input-bg-color: Input area background color (transparent)
|
|
1031
1059
|
* @prop --input-border-color: Input field border color (#d1d5db)
|
|
1032
1060
|
* @prop --input-text-color: Input text color (#111827)
|
|
@@ -1035,7 +1063,6 @@ video {
|
|
|
1035
1063
|
* @prop --input-textarea-padding-x: Input textarea horizontal padding (0.75em)
|
|
1036
1064
|
* @prop --input-textarea-padding-y: Input textarea vertical padding (0.5em)
|
|
1037
1065
|
*
|
|
1038
|
-
* Send Button Variables
|
|
1039
1066
|
* @prop --send-button-bg-color: Send button background color (#3b82f6)
|
|
1040
1067
|
* @prop --send-button-bg-hover-color: Send button background on hover (#2563eb)
|
|
1041
1068
|
* @prop --send-button-text-color: Send button text color (#ffffff)
|
|
@@ -1044,25 +1071,20 @@ video {
|
|
|
1044
1071
|
* @prop --send-button-padding-x: Send button horizontal padding (1em)
|
|
1045
1072
|
* @prop --send-button-padding-y: Send button vertical padding (0.5em)
|
|
1046
1073
|
*
|
|
1047
|
-
* Loading Variables
|
|
1048
1074
|
* @prop --loading-text-color: Loading text color (#6b7280)
|
|
1049
1075
|
* @prop --loading-spinner-track-color: Loading spinner track color (#e5e7eb)
|
|
1050
1076
|
* @prop --loading-spinner-fill-color: Loading spinner fill color (#3b82f6)
|
|
1051
1077
|
* @prop --loading-spinner-size: Loading spinner size (1.25em)
|
|
1052
1078
|
*
|
|
1053
|
-
* Typing Indicator Variables
|
|
1054
1079
|
* @prop --typing-progress-bg-color: Typing progress bar background color (#ade3ff)
|
|
1055
1080
|
*
|
|
1056
|
-
* Scrollbar Variables
|
|
1057
1081
|
* @prop --scrollbar-track-color: Scrollbar track color (#f3f4f6)
|
|
1058
1082
|
* @prop --scrollbar-thumb-color: Scrollbar thumb color (#d1d5db)
|
|
1059
1083
|
* @prop --scrollbar-thumb-hover-color: Scrollbar thumb hover color (#9ca3af)
|
|
1060
1084
|
*
|
|
1061
|
-
* Error Variables
|
|
1062
1085
|
* @prop --error-text-color: Error text color (#ef4444)
|
|
1063
1086
|
* @prop --error-message-padding: Error message padding (0.5em)
|
|
1064
1087
|
*
|
|
1065
|
-
* Markdown Code Variables
|
|
1066
1088
|
* @prop --code-bg-user-color: Code background in user messages (--message-user-bg-color + 20% white)
|
|
1067
1089
|
* @prop --code-text-user-color: Code text color in user messages (--message-user-text-color)
|
|
1068
1090
|
* @prop --code-border-user-color: Code border in user messages (--message-user-bg-color + 20% black)
|
|
@@ -1079,13 +1101,11 @@ video {
|
|
|
1079
1101
|
--button-background-color-hover: #f3f4f6;
|
|
1080
1102
|
--button-text-color: #111827;
|
|
1081
1103
|
--button-text-color-hover: #1d4ed8;
|
|
1082
|
-
--button-border-color:
|
|
1083
|
-
--button-border-color-hover: #
|
|
1084
|
-
--button-padding: 0.
|
|
1085
|
-
--button-padding-sm: 0.375em;
|
|
1104
|
+
--button-border-color: transparent;
|
|
1105
|
+
--button-border-color-hover: #d1d5db;
|
|
1106
|
+
--button-padding: 0.5em;
|
|
1086
1107
|
--button-font-size: 0.875em; /* text-sm */
|
|
1087
|
-
--button-icon-
|
|
1088
|
-
--button-icon-height: 1.5em;
|
|
1108
|
+
--button-icon-size: 1.5em;
|
|
1089
1109
|
|
|
1090
1110
|
/* Chat window variables */
|
|
1091
1111
|
--chat-window-height: 60%;
|
|
@@ -1104,6 +1124,10 @@ video {
|
|
|
1104
1124
|
--header-button-text-color: #6b7280;
|
|
1105
1125
|
--header-button-bg-hover-color: #f3f4f6;
|
|
1106
1126
|
--header-padding: 0.5em;
|
|
1127
|
+
--header-font-size: 1em;
|
|
1128
|
+
--header-text-font-size: 1em;
|
|
1129
|
+
--header-text-color: #525762;
|
|
1130
|
+
--header-button-icon-size: 1.5em;
|
|
1107
1131
|
|
|
1108
1132
|
/* Starter question variables */
|
|
1109
1133
|
--starter-question-bg-color: transparent;
|
|
@@ -1174,9 +1198,6 @@ video {
|
|
|
1174
1198
|
right: 20px;
|
|
1175
1199
|
bottom: 20px;
|
|
1176
1200
|
}
|
|
1177
|
-
#ocs-chat-window {
|
|
1178
|
-
z-index: var(--chat-z-index);
|
|
1179
|
-
}
|
|
1180
1201
|
textarea {
|
|
1181
1202
|
max-height: 8rem;
|
|
1182
1203
|
min-height: 2.5rem;
|
|
@@ -1197,6 +1218,10 @@ textarea::-webkit-scrollbar-thumb {
|
|
|
1197
1218
|
textarea::-webkit-scrollbar-thumb:hover {
|
|
1198
1219
|
background-color: var(--scrollbar-thumb-hover-color);
|
|
1199
1220
|
}
|
|
1221
|
+
.loading-spinner {
|
|
1222
|
+
width: var(--loading-spinner-size);
|
|
1223
|
+
height: var(--loading-spinner-size);
|
|
1224
|
+
}
|
|
1200
1225
|
@keyframes spin {
|
|
1201
1226
|
|
|
1202
1227
|
to {
|
|
@@ -1209,8 +1234,6 @@ textarea::-webkit-scrollbar-thumb:hover {
|
|
|
1209
1234
|
border-width: 2px;
|
|
1210
1235
|
border-color: var(--loading-spinner-track-color);
|
|
1211
1236
|
border-top-color: var(--loading-spinner-fill-color);
|
|
1212
|
-
width: var(--loading-spinner-size, 1.25em);
|
|
1213
|
-
height: var(--loading-spinner-size, 1.25em);
|
|
1214
1237
|
}
|
|
1215
1238
|
.overflow-y-auto::-webkit-scrollbar {
|
|
1216
1239
|
width: 0.375rem;
|
|
@@ -1881,7 +1904,7 @@ textarea::-webkit-scrollbar-thumb:hover {
|
|
|
1881
1904
|
--tw-prose-invert-th-borders: #4b5563;
|
|
1882
1905
|
--tw-prose-invert-td-borders: #374151;
|
|
1883
1906
|
max-width: none;
|
|
1884
|
-
font-size:
|
|
1907
|
+
font-size: 1em;
|
|
1885
1908
|
--tw-prose-body: var(--message-assistant-text-color);
|
|
1886
1909
|
--tw-prose-headings: var(--message-assistant-text-color);
|
|
1887
1910
|
--tw-prose-lead: var(--message-assistant-text-color);
|
|
@@ -688,13 +688,13 @@ export class OcsChat {
|
|
|
688
688
|
if (this.error) {
|
|
689
689
|
return (h(Host, null, h("p", { class: "error-message" }, this.error)));
|
|
690
690
|
}
|
|
691
|
-
return (h(Host, null, this.renderButton(), this.visible && (h("div", { ref: (el) => this.chatWindowRef = el, id: "ocs-chat-window", class: this.getPositionClasses(), style: this.getPositionStyles() }, h("div", { class: `chat-header ${this.isDragging ? 'chat-header-dragging' : 'chat-header-draggable'}`, onMouseDown: this.handleMouseDown, onTouchStart: this.handleTouchStart }, h("div", { class: "drag-indicator" }, h("div", { class: "drag-dots" }, h(GripDotsVerticalIcon, null))), h("div", { class: "
|
|
691
|
+
return (h(Host, null, this.renderButton(), this.visible && (h("div", { ref: (el) => this.chatWindowRef = el, id: "ocs-chat-window", class: this.getPositionClasses(), style: this.getPositionStyles() }, h("div", { class: `chat-header ${this.isDragging ? 'chat-header-dragging' : 'chat-header-draggable'}`, onMouseDown: this.handleMouseDown, onTouchStart: this.handleTouchStart }, h("div", { class: "drag-indicator" }, h("div", { class: "drag-dots header-button" }, h(GripDotsVerticalIcon, null))), h("div", { class: "header-text" }, this.headerText), h("div", { class: "header-buttons" }, this.allowFullScreen && h("button", { class: "header-button fullscreen-button", onClick: () => this.toggleFullscreen(), title: this.isFullscreen ? "Exit fullscreen" : "Enter fullscreen", "aria-label": this.isFullscreen ? "Exit fullscreen" : "Enter fullscreen" }, this.isFullscreen ? h(ArrowsPointingInIcon, null) : h(ArrowsPointingOutIcon, null)), this.sessionId && this.messages.length > 0 && (h("button", { class: "header-button", onClick: () => this.startNewChat(), title: "Start new chat", "aria-label": "Start new chat" }, h(PencilSquare, null))), h("button", { class: "header-button", onClick: () => this.visible = false, "aria-label": "Close" }, h(XMarkIcon, null)))), h("div", { class: "chat-content" }, this.isLoading && !this.sessionId && (h("div", { class: "loading-container" }, h("div", { class: "loading-spinner" }), h("span", { class: "loading-text" }, "Starting chat..."))), this.sessionId && (h("div", { ref: (el) => this.messageListRef = el, class: "messages-container" }, this.messages.length === 0 && !this.isTyping && this.parsedWelcomeMessages.length > 0 && (h("div", { class: "welcome-messages" }, this.parsedWelcomeMessages.map((message, index) => (h("div", { key: `welcome-${index}`, class: "message-row message-row-assistant" }, h("div", { class: "message-bubble message-bubble-assistant" }, h("div", { class: "chat-markdown", innerHTML: renderMarkdownComplete(message) }))))))), this.messages.map((message, index) => (h("div", { key: index, class: `message-row ${message.role === 'user' ? 'message-row-user' : 'message-row-assistant'}` }, h("div", { class: `message-bubble ${message.role === 'user'
|
|
692
692
|
? 'message-bubble-user'
|
|
693
693
|
: message.role === 'assistant'
|
|
694
694
|
? 'message-bubble-assistant'
|
|
695
695
|
: 'message-bubble-system'}` }, h("div", { class: "chat-markdown", innerHTML: renderMarkdownComplete(message.content) }), message.attachments && message.attachments.length > 0 && (h("div", { class: "message-attachments" }, message.attachments.map((attachment, attachmentIndex) => (h("a", { key: attachmentIndex, href: attachment.content_url, target: "_blank", rel: "noopener noreferrer", class: "attachment-link" }, "\uD83D\uDCCE ", attachment.name))))), h("div", { class: "message-timestamp" }, this.formatTime(message.created_at)))))), this.isTyping && (h("div", null, h("div", { class: "typing-indicator" }, h("div", { class: "typing-progress" })), h("div", { class: "typing-text" }, h("span", null, "Preparing response"), h("span", { class: "typing-dots" })))))), this.sessionId && this.showStarterQuestions && this.messages.length === 0 && !this.isTyping && (h("div", { class: "starter-questions" }, this.parsedStarterQuestions.map((question, index) => (h("div", { key: `starter-${index}`, class: "starter-question-row" }, h("button", { class: "starter-question", onClick: () => this.handleStarterQuestionClick(question) }, question)))))), this.sessionId && (h("div", { class: "input-area" }, h("div", { class: "input-container" }, h("textarea", { ref: (el) => this.textareaRef = el, class: "message-textarea", rows: 1, placeholder: "Type your message...", value: this.messageInput, onInput: (e) => this.handleInputChange(e), onKeyPress: (e) => this.handleKeyPress(e), disabled: this.isTyping }), h("button", { class: `send-button ${!this.isTyping && !!this.messageInput.trim()
|
|
696
696
|
? 'send-button-enabled'
|
|
697
|
-
: 'send-button-disabled'}`, onClick: () => this.sendMessage(this.messageInput), disabled: this.isTyping || !this.messageInput.trim() }, "Send")))))))));
|
|
697
|
+
: 'send-button-disabled'}`, onClick: () => this.sendMessage(this.messageInput), disabled: this.isTyping || !this.messageInput.trim() }, "Send")))), h("div", { class: "flex items-center justify-center text-[0.8em] font-light w-full text-slate-500 py-[2px]" }, h("p", null, "Powered by ", h("a", { class: "underline", href: "https://www.dimagi.com", target: "_blank" }, "Dimagi"))))))));
|
|
698
698
|
}
|
|
699
699
|
static get is() { return "open-chat-studio-widget"; }
|
|
700
700
|
static get encapsulation() { return "shadow"; }
|
|
@@ -807,6 +807,25 @@ export class OcsChat {
|
|
|
807
807
|
"reflect": false,
|
|
808
808
|
"defaultValue": "'square'"
|
|
809
809
|
},
|
|
810
|
+
"headerText": {
|
|
811
|
+
"type": "string",
|
|
812
|
+
"mutable": false,
|
|
813
|
+
"complexType": {
|
|
814
|
+
"original": "''",
|
|
815
|
+
"resolved": "\"\"",
|
|
816
|
+
"references": {}
|
|
817
|
+
},
|
|
818
|
+
"required": false,
|
|
819
|
+
"optional": false,
|
|
820
|
+
"docs": {
|
|
821
|
+
"tags": [],
|
|
822
|
+
"text": "The text to place in the header."
|
|
823
|
+
},
|
|
824
|
+
"getter": false,
|
|
825
|
+
"setter": false,
|
|
826
|
+
"attribute": "header-text",
|
|
827
|
+
"reflect": false
|
|
828
|
+
},
|
|
810
829
|
"visible": {
|
|
811
830
|
"type": "boolean",
|
|
812
831
|
"mutable": true,
|