open-chat-studio-widget 0.4.0 → 0.4.1
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 +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/open-chat-studio-widget.cjs.entry.js +81 -43
- 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 +6 -6
- package/dist/collection/components/ocs-chat/heroicons.js.map +1 -1
- package/dist/collection/components/ocs-chat/ocs-chat.css +92 -66
- package/dist/collection/components/ocs-chat/ocs-chat.js +96 -56
- package/dist/collection/components/ocs-chat/ocs-chat.js.map +1 -1
- package/dist/components/open-chat-studio-widget.js +85 -45
- 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 +81 -43
- 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-eb89e6d7.entry.js +3 -0
- package/dist/open-chat-studio-widget/p-eb89e6d7.entry.js.map +1 -0
- package/dist/types/components/ocs-chat/heroicons.d.ts +2 -2
- package/dist/types/components/ocs-chat/ocs-chat.d.ts +16 -6
- package/dist/types/components.d.ts +8 -8
- package/package.json +1 -1
- package/dist/open-chat-studio-widget/p-d2d76b54.entry.js +0 -3
- package/dist/open-chat-studio-widget/p-d2d76b54.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],"
|
|
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"],"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],"isFullscreen":[32]}]]]], options);
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
exports.setNonce = index.setNonce;
|
|
@@ -2,16 +2,16 @@ import { h } from "@stencil/core";
|
|
|
2
2
|
export const XMarkIcon = () => {
|
|
3
3
|
return h("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", "stroke-width": "1.5", stroke: "currentColor", class: "size-6" }, h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", d: "M6 18 18 6M6 6l12 12" }));
|
|
4
4
|
};
|
|
5
|
-
export const ChevronUpIcon = () => {
|
|
6
|
-
return h("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", "stroke-width": "1.5", stroke: "currentColor", class: "size-6" }, h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", d: "m4.5 15.75 7.5-7.5 7.5 7.5" }));
|
|
7
|
-
};
|
|
8
|
-
export const ChevronDownIcon = () => {
|
|
9
|
-
return h("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", "stroke-width": "1.5", stroke: "currentColor", class: "size-6" }, h("path", { "stroke-linecap": "round", "stroke-linejoin": "round", d: "m19.5 8.25-7.5 7.5-7.5-7.5" }));
|
|
10
|
-
};
|
|
11
5
|
export const GripDotsVerticalIcon = () => {
|
|
12
6
|
return (h("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "currentColor", viewBox: "0 0 24 24", class: "size-6" }, 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" })));
|
|
13
7
|
};
|
|
14
8
|
export const PencilSquare = () => {
|
|
15
9
|
return (h("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", "stroke-width": "1.5", stroke: "currentColor", class: "size-6" }, 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" })));
|
|
16
10
|
};
|
|
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", class: "size-6" }, 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
|
+
};
|
|
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", class: "size-6" }, 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
|
+
};
|
|
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,EACrF,MAAM,EAAC,cAAc,EAAC,KAAK,EAAC,QAAQ;QAC9C,8BAAqB,OAAO,qBAAiB,OAAO,EAAC,CAAC,EAAC,sBAAsB,GAAE,CAC3E,CAAC;AACT,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,
|
|
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,EACrF,MAAM,EAAC,cAAc,EAAC,KAAK,EAAC,QAAQ;QAC9C,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,EACnB,KAAK,EAAC,QAAQ;QAGd,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,EAC3G,KAAK,EAAC,QAAQ;QACjB,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,EAC3G,KAAK,EAAC,QAAQ;QACjB,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,EAC3G,KAAK,EAAC,QAAQ;QACjB,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\"\n stroke=\"currentColor\" class=\"size-6\">\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 class=\"size-6\"\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 class=\"size-6\">\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 class=\"size-6\">\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 class=\"size-6\">\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"]}
|
|
@@ -519,9 +519,8 @@ video {
|
|
|
519
519
|
}
|
|
520
520
|
.chat-btn-text,
|
|
521
521
|
.chat-btn-icon {
|
|
522
|
-
position: fixed;
|
|
523
522
|
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));
|
|
524
|
-
border-radius:
|
|
523
|
+
border-radius: 0.5rem;
|
|
525
524
|
border-width: 0px;
|
|
526
525
|
--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
|
|
527
526
|
--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);
|
|
@@ -557,12 +556,11 @@ video {
|
|
|
557
556
|
display: flex;
|
|
558
557
|
align-items: center;
|
|
559
558
|
gap: 0.5rem;
|
|
560
|
-
padding-left:
|
|
561
|
-
padding-right:
|
|
559
|
+
padding-left: 0.75rem;
|
|
560
|
+
padding-right: 0.75rem;
|
|
562
561
|
padding-top: 0.75rem;
|
|
563
562
|
padding-bottom: 0.75rem;
|
|
564
563
|
color: var(--button-text-color, #111827);
|
|
565
|
-
min-height: 56px;
|
|
566
564
|
}
|
|
567
565
|
.chat-btn-text:hover {
|
|
568
566
|
color: var(--button-text-color-hover, #1d4ed8);
|
|
@@ -592,10 +590,6 @@ video {
|
|
|
592
590
|
-o-object-fit: contain;
|
|
593
591
|
object-fit: contain;
|
|
594
592
|
}
|
|
595
|
-
.chat-btn-text,
|
|
596
|
-
.chat-btn-icon {
|
|
597
|
-
border-radius: 0.5rem; /* Default square shape */
|
|
598
|
-
}
|
|
599
593
|
.chat-btn-text.round,
|
|
600
594
|
.chat-btn-icon.round {
|
|
601
595
|
border-radius: 9999px;
|
|
@@ -612,6 +606,15 @@ video {
|
|
|
612
606
|
.fixed {
|
|
613
607
|
position: fixed;
|
|
614
608
|
}
|
|
609
|
+
.relative {
|
|
610
|
+
position: relative;
|
|
611
|
+
}
|
|
612
|
+
.inset-0 {
|
|
613
|
+
inset: 0px;
|
|
614
|
+
}
|
|
615
|
+
.z-\[9999\] {
|
|
616
|
+
z-index: 9999;
|
|
617
|
+
}
|
|
615
618
|
.ml-2 {
|
|
616
619
|
margin-left: 0.5rem;
|
|
617
620
|
}
|
|
@@ -624,9 +627,6 @@ video {
|
|
|
624
627
|
.block {
|
|
625
628
|
display: block;
|
|
626
629
|
}
|
|
627
|
-
.inline-block {
|
|
628
|
-
display: inline-block;
|
|
629
|
-
}
|
|
630
630
|
.flex {
|
|
631
631
|
display: flex;
|
|
632
632
|
}
|
|
@@ -640,41 +640,83 @@ video {
|
|
|
640
640
|
width: 1.5rem;
|
|
641
641
|
height: 1.5rem;
|
|
642
642
|
}
|
|
643
|
-
.h-
|
|
644
|
-
height: 0.
|
|
645
|
-
}
|
|
646
|
-
.h-3\/5 {
|
|
647
|
-
height: 60%;
|
|
643
|
+
.h-1\.5 {
|
|
644
|
+
height: 0.375rem;
|
|
648
645
|
}
|
|
649
646
|
.h-5\/6 {
|
|
650
647
|
height: 83.333333%;
|
|
651
648
|
}
|
|
652
|
-
.
|
|
653
|
-
|
|
649
|
+
.h-full {
|
|
650
|
+
height: 100%;
|
|
651
|
+
}
|
|
652
|
+
.max-h-full {
|
|
653
|
+
max-height: 100%;
|
|
654
654
|
}
|
|
655
655
|
.w-full {
|
|
656
656
|
width: 100%;
|
|
657
657
|
}
|
|
658
|
+
.max-w-screen-lg {
|
|
659
|
+
max-width: 1024px;
|
|
660
|
+
}
|
|
658
661
|
.max-w-xs {
|
|
659
662
|
max-width: 20rem;
|
|
660
663
|
}
|
|
661
664
|
.flex-grow {
|
|
662
665
|
flex-grow: 1;
|
|
663
666
|
}
|
|
664
|
-
|
|
667
|
+
.origin-left-right {
|
|
668
|
+
transform-origin: 0% 50%;
|
|
669
|
+
}
|
|
670
|
+
.transform {
|
|
671
|
+
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));
|
|
672
|
+
}
|
|
673
|
+
@keyframes dots {
|
|
674
|
+
|
|
675
|
+
0%, 20% {
|
|
676
|
+
color: rgba(0,0,0,0);
|
|
677
|
+
text-shadow: .25em 0 0 rgba(0,0,0,0), .5em 0 0 rgba(0,0,0,0);
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
40% {
|
|
681
|
+
color: black;
|
|
682
|
+
text-shadow: .25em 0 0 rgba(0,0,0,0), .5em 0 0 rgba(0,0,0,0);
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
60% {
|
|
686
|
+
text-shadow: .25em 0 0 black, .5em 0 0 rgba(0,0,0,0);
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
80%, 100% {
|
|
690
|
+
text-shadow: .25em 0 0 black, .5em 0 0 black;
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
.animate-dots {
|
|
694
|
+
animation: dots 1s steps(5, end) infinite;
|
|
695
|
+
}
|
|
696
|
+
@keyframes progress {
|
|
697
|
+
|
|
698
|
+
0% {
|
|
699
|
+
transform: translateX(0) scaleX(0);
|
|
700
|
+
}
|
|
665
701
|
|
|
666
|
-
|
|
667
|
-
transform:
|
|
668
|
-
animation-timing-function: cubic-bezier(0.8,0,1,1);
|
|
702
|
+
10% {
|
|
703
|
+
transform: translateX(0) scaleX(0.3);
|
|
669
704
|
}
|
|
670
705
|
|
|
671
706
|
50% {
|
|
672
|
-
transform:
|
|
673
|
-
|
|
707
|
+
transform: translateX(100%) scaleX(0.3);
|
|
708
|
+
}
|
|
709
|
+
|
|
710
|
+
90% {
|
|
711
|
+
transform: translateX(0) scaleX(0.3);
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
100% {
|
|
715
|
+
transform: translateX(0) scaleX(0);
|
|
674
716
|
}
|
|
675
717
|
}
|
|
676
|
-
.animate-
|
|
677
|
-
animation:
|
|
718
|
+
.animate-progress {
|
|
719
|
+
animation: progress 3s infinite linear;
|
|
678
720
|
}
|
|
679
721
|
.cursor-grab {
|
|
680
722
|
cursor: grab;
|
|
@@ -728,29 +770,27 @@ video {
|
|
|
728
770
|
margin-top: calc(0.5rem * calc(1 - var(--tw-space-y-reverse)));
|
|
729
771
|
margin-bottom: calc(0.5rem * var(--tw-space-y-reverse));
|
|
730
772
|
}
|
|
731
|
-
.space-y-4 > :not([hidden]) ~ :not([hidden]) {
|
|
732
|
-
--tw-space-y-reverse: 0;
|
|
733
|
-
margin-top: calc(1rem * calc(1 - var(--tw-space-y-reverse)));
|
|
734
|
-
margin-bottom: calc(1rem * var(--tw-space-y-reverse));
|
|
735
|
-
}
|
|
736
773
|
.overflow-hidden {
|
|
737
774
|
overflow: hidden;
|
|
738
775
|
}
|
|
739
776
|
.overflow-y-auto {
|
|
740
777
|
overflow-y: auto;
|
|
741
778
|
}
|
|
742
|
-
.rounded-full {
|
|
743
|
-
border-radius: 9999px;
|
|
744
|
-
}
|
|
745
779
|
.rounded-lg {
|
|
746
780
|
border-radius: 0.5rem;
|
|
747
781
|
}
|
|
748
782
|
.rounded-md {
|
|
749
783
|
border-radius: 0.375rem;
|
|
750
784
|
}
|
|
785
|
+
.rounded-none {
|
|
786
|
+
border-radius: 0px;
|
|
787
|
+
}
|
|
751
788
|
.border {
|
|
752
789
|
border-width: 1px;
|
|
753
790
|
}
|
|
791
|
+
.border-0 {
|
|
792
|
+
border-width: 0px;
|
|
793
|
+
}
|
|
754
794
|
.border-b {
|
|
755
795
|
border-bottom-width: 1px;
|
|
756
796
|
}
|
|
@@ -769,6 +809,10 @@ video {
|
|
|
769
809
|
--tw-border-opacity: 1;
|
|
770
810
|
border-color: rgb(209 213 219 / var(--tw-border-opacity, 1));
|
|
771
811
|
}
|
|
812
|
+
.bg-blue-200 {
|
|
813
|
+
--tw-bg-opacity: 1;
|
|
814
|
+
background-color: rgb(191 219 254 / var(--tw-bg-opacity, 1));
|
|
815
|
+
}
|
|
772
816
|
.bg-blue-500 {
|
|
773
817
|
--tw-bg-opacity: 1;
|
|
774
818
|
background-color: rgb(59 130 246 / var(--tw-bg-opacity, 1));
|
|
@@ -785,10 +829,6 @@ video {
|
|
|
785
829
|
--tw-bg-opacity: 1;
|
|
786
830
|
background-color: rgb(209 213 219 / var(--tw-bg-opacity, 1));
|
|
787
831
|
}
|
|
788
|
-
.bg-gray-400 {
|
|
789
|
-
--tw-bg-opacity: 1;
|
|
790
|
-
background-color: rgb(156 163 175 / var(--tw-bg-opacity, 1));
|
|
791
|
-
}
|
|
792
832
|
.bg-white {
|
|
793
833
|
--tw-bg-opacity: 1;
|
|
794
834
|
background-color: rgb(255 255 255 / var(--tw-bg-opacity, 1));
|
|
@@ -903,6 +943,9 @@ video {
|
|
|
903
943
|
--button-border-color-hover: #374151;
|
|
904
944
|
--chat-z-index: 50;
|
|
905
945
|
display: block;
|
|
946
|
+
position: fixed;
|
|
947
|
+
right: 20px;
|
|
948
|
+
bottom: 20px;
|
|
906
949
|
}
|
|
907
950
|
#ocs-chat-window {
|
|
908
951
|
z-index: var(--chat-z-index);
|
|
@@ -1670,33 +1713,8 @@ textarea::-webkit-scrollbar-thumb:hover {
|
|
|
1670
1713
|
--tw-bg-opacity: 1;
|
|
1671
1714
|
background-color: rgb(255 255 255 / var(--tw-bg-opacity, 1));
|
|
1672
1715
|
}
|
|
1673
|
-
|
|
1674
|
-
.
|
|
1675
|
-
max-width: 85%;
|
|
1676
|
-
}
|
|
1677
|
-
|
|
1678
|
-
.chat-btn-icon {
|
|
1679
|
-
width: 56px;
|
|
1680
|
-
height: 56px;
|
|
1681
|
-
}
|
|
1682
|
-
|
|
1683
|
-
.chat-btn-text {
|
|
1684
|
-
padding-left: 0.75rem;
|
|
1685
|
-
padding-right: 0.75rem;
|
|
1686
|
-
padding-top: 0.5rem;
|
|
1687
|
-
padding-bottom: 0.5rem;
|
|
1688
|
-
min-height: 52px;
|
|
1689
|
-
}
|
|
1690
|
-
|
|
1691
|
-
.chat-btn-text img {
|
|
1692
|
-
height: 1.25rem;
|
|
1693
|
-
width: 1.25rem;
|
|
1694
|
-
}
|
|
1695
|
-
|
|
1696
|
-
.chat-btn-text span {
|
|
1697
|
-
font-size: 0.75rem;
|
|
1698
|
-
line-height: 1rem;
|
|
1699
|
-
}
|
|
1716
|
+
.loading:after {
|
|
1717
|
+
content: ' .';
|
|
1700
1718
|
}
|
|
1701
1719
|
.hover\:bg-blue-600:hover {
|
|
1702
1720
|
--tw-bg-opacity: 1;
|
|
@@ -1731,10 +1749,18 @@ textarea::-webkit-scrollbar-thumb:hover {
|
|
|
1731
1749
|
}
|
|
1732
1750
|
@media (min-width: 640px) {
|
|
1733
1751
|
|
|
1752
|
+
.sm\:block {
|
|
1753
|
+
display: block;
|
|
1754
|
+
}
|
|
1755
|
+
|
|
1734
1756
|
.sm\:flex {
|
|
1735
1757
|
display: flex;
|
|
1736
1758
|
}
|
|
1737
1759
|
|
|
1760
|
+
.sm\:hidden {
|
|
1761
|
+
display: none;
|
|
1762
|
+
}
|
|
1763
|
+
|
|
1738
1764
|
.sm\:w-\[450px\] {
|
|
1739
1765
|
width: 450px;
|
|
1740
1766
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
|
-
import { XMarkIcon,
|
|
2
|
+
import { XMarkIcon, GripDotsVerticalIcon, PencilSquare, ArrowsPointingOutIcon, ArrowsPointingInIcon, } from "./heroicons";
|
|
3
3
|
import { renderMarkdownSync as renderMarkdownComplete } from "../../utils/markdown";
|
|
4
4
|
export class OcsChat {
|
|
5
5
|
constructor() {
|
|
@@ -19,10 +19,6 @@ export class OcsChat {
|
|
|
19
19
|
* The initial position of the chat widget on the screen.
|
|
20
20
|
*/
|
|
21
21
|
this.position = 'right';
|
|
22
|
-
/**
|
|
23
|
-
* Whether the chat widget is initially expanded.
|
|
24
|
-
*/
|
|
25
|
-
this.expanded = false;
|
|
26
22
|
/**
|
|
27
23
|
* Whether to persist session data to local storage to allow resuming previous conversations after page reload.
|
|
28
24
|
*/
|
|
@@ -32,6 +28,10 @@ export class OcsChat {
|
|
|
32
28
|
* `0` to never expire.
|
|
33
29
|
*/
|
|
34
30
|
this.persistentSessionExpire = 60 * 24;
|
|
31
|
+
/**
|
|
32
|
+
* Allow the user to make the chat window full screen.
|
|
33
|
+
*/
|
|
34
|
+
this.allowFullScreen = true;
|
|
35
35
|
this.loaded = false;
|
|
36
36
|
this.error = "";
|
|
37
37
|
this.messages = [];
|
|
@@ -42,11 +42,13 @@ export class OcsChat {
|
|
|
42
42
|
this.isDragging = false;
|
|
43
43
|
this.dragOffset = { x: 0, y: 0 };
|
|
44
44
|
this.windowPosition = { x: 0, y: 0 };
|
|
45
|
+
this.fullscreenPosition = { x: 0 };
|
|
45
46
|
this.showStarterQuestions = true;
|
|
46
47
|
this.parsedWelcomeMessages = [];
|
|
47
48
|
this.parsedStarterQuestions = [];
|
|
49
|
+
this.isFullscreen = false;
|
|
48
50
|
this.handleMouseDown = (event) => {
|
|
49
|
-
if (window.innerWidth < OcsChat.MOBILE_BREAKPOINT)
|
|
51
|
+
if (!this.isFullscreen && window.innerWidth < OcsChat.MOBILE_BREAKPOINT)
|
|
50
52
|
return;
|
|
51
53
|
if (event.target.closest('button'))
|
|
52
54
|
return;
|
|
@@ -398,13 +400,29 @@ export class OcsChat {
|
|
|
398
400
|
return;
|
|
399
401
|
this.position = position;
|
|
400
402
|
}
|
|
401
|
-
toggleSize() {
|
|
402
|
-
this.expanded = !this.expanded;
|
|
403
|
-
}
|
|
404
403
|
getPositionClasses() {
|
|
405
|
-
|
|
404
|
+
if (this.isFullscreen) {
|
|
405
|
+
return `fixed inset-0 w-full h-full max-w-screen-lg max-h-full bg-white border-0 shadow-lg transition-shadow duration-200 rounded-none overflow-hidden flex flex-col z-[9999]`;
|
|
406
|
+
}
|
|
407
|
+
return `fixed w-full sm:w-[450px] max-w-screen-lg h-5/6 bg-white border border-gray-200 ${this.isDragging ? 'shadow-2xl cursor-grabbing' : 'shadow-lg transition-shadow duration-200'} rounded-lg overflow-hidden flex flex-col`;
|
|
408
|
+
}
|
|
409
|
+
getFullscreenBounds() {
|
|
410
|
+
const windowWidth = window.innerWidth;
|
|
411
|
+
const actualChatWidth = Math.min(windowWidth, OcsChat.CHAT_MAX_WIDTH);
|
|
412
|
+
const centeredX = (windowWidth - actualChatWidth) / 2;
|
|
413
|
+
const maxOffset = (windowWidth - actualChatWidth) / 2;
|
|
414
|
+
return { windowWidth, actualChatWidth, centeredX, maxOffset };
|
|
406
415
|
}
|
|
407
416
|
getPositionStyles() {
|
|
417
|
+
if (this.isFullscreen) {
|
|
418
|
+
const { centeredX } = this.getFullscreenBounds();
|
|
419
|
+
const finalX = centeredX + this.fullscreenPosition.x;
|
|
420
|
+
return {
|
|
421
|
+
left: `${finalX}px`,
|
|
422
|
+
top: '0px',
|
|
423
|
+
transform: 'none',
|
|
424
|
+
};
|
|
425
|
+
}
|
|
408
426
|
return {
|
|
409
427
|
left: `${this.windowPosition.x}px`,
|
|
410
428
|
top: `${this.windowPosition.y}px`,
|
|
@@ -414,9 +432,7 @@ export class OcsChat {
|
|
|
414
432
|
const windowWidth = window.innerWidth;
|
|
415
433
|
const windowHeight = window.innerHeight;
|
|
416
434
|
const chatWidth = windowWidth < OcsChat.MOBILE_BREAKPOINT ? windowWidth : OcsChat.CHAT_WIDTH_DESKTOP;
|
|
417
|
-
const chatHeight =
|
|
418
|
-
? (windowHeight * OcsChat.CHAT_HEIGHT_EXPANDED_RATIO)
|
|
419
|
-
: (windowHeight * OcsChat.CHAT_HEIGHT_COLLAPSED_RATIO);
|
|
435
|
+
const chatHeight = windowHeight * OcsChat.CHAT_HEIGHT_EXPANDED_RATIO;
|
|
420
436
|
const isMobile = windowWidth < OcsChat.MOBILE_BREAKPOINT;
|
|
421
437
|
if (isMobile) {
|
|
422
438
|
this.windowPosition = { x: 0, y: 0 };
|
|
@@ -457,28 +473,45 @@ export class OcsChat {
|
|
|
457
473
|
if (!this.chatWindowRef)
|
|
458
474
|
return;
|
|
459
475
|
this.isDragging = true;
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
476
|
+
if (this.isFullscreen) {
|
|
477
|
+
// For fullscreen, track relative to current position
|
|
478
|
+
this.dragOffset = {
|
|
479
|
+
x: pointer.clientX,
|
|
480
|
+
y: pointer.clientY
|
|
481
|
+
};
|
|
482
|
+
}
|
|
483
|
+
else {
|
|
484
|
+
const rect = this.chatWindowRef.getBoundingClientRect();
|
|
485
|
+
this.dragOffset = {
|
|
486
|
+
x: pointer.clientX - rect.left,
|
|
487
|
+
y: pointer.clientY - rect.top
|
|
488
|
+
};
|
|
489
|
+
}
|
|
465
490
|
}
|
|
466
491
|
updateDragPosition(pointer) {
|
|
467
492
|
if (!this.isDragging)
|
|
468
493
|
return;
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
494
|
+
if (this.isFullscreen) {
|
|
495
|
+
// In fullscreen, only allow horizontal dragging
|
|
496
|
+
const { maxOffset } = this.getFullscreenBounds();
|
|
497
|
+
const deltaX = pointer.clientX - this.dragOffset.x;
|
|
498
|
+
this.fullscreenPosition = {
|
|
499
|
+
x: Math.max(-maxOffset, Math.min(maxOffset, deltaX))
|
|
500
|
+
};
|
|
501
|
+
}
|
|
502
|
+
else {
|
|
503
|
+
const newX = pointer.clientX - this.dragOffset.x;
|
|
504
|
+
const newY = pointer.clientY - this.dragOffset.y;
|
|
505
|
+
// Constrain chatbox to window
|
|
506
|
+
const windowWidth = window.innerWidth;
|
|
507
|
+
const windowHeight = window.innerHeight;
|
|
508
|
+
const chatWidth = windowWidth < OcsChat.MOBILE_BREAKPOINT ? windowWidth : OcsChat.CHAT_WIDTH_DESKTOP;
|
|
509
|
+
const chatHeight = windowHeight * OcsChat.CHAT_HEIGHT_EXPANDED_RATIO;
|
|
510
|
+
this.windowPosition = {
|
|
511
|
+
x: Math.max(0, Math.min(newX, windowWidth - chatWidth)),
|
|
512
|
+
y: Math.max(0, Math.min(newY, windowHeight - chatHeight))
|
|
513
|
+
};
|
|
514
|
+
}
|
|
482
515
|
}
|
|
483
516
|
endDrag() {
|
|
484
517
|
this.isDragging = false;
|
|
@@ -607,11 +640,16 @@ export class OcsChat {
|
|
|
607
640
|
this.cleanup();
|
|
608
641
|
await this.startSession();
|
|
609
642
|
}
|
|
643
|
+
toggleFullscreen() {
|
|
644
|
+
this.isFullscreen = !this.isFullscreen;
|
|
645
|
+
// Reset fullscreen position when toggling
|
|
646
|
+
this.fullscreenPosition = { x: 0 };
|
|
647
|
+
}
|
|
610
648
|
render() {
|
|
611
649
|
if (this.error) {
|
|
612
650
|
return (h(Host, null, h("p", { class: "text-red-500 p-2" }, this.error)));
|
|
613
651
|
}
|
|
614
|
-
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: `flex justify-between items-center px-2 py-2 border-b border-gray-100
|
|
652
|
+
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: `flex justify-between items-center px-2 py-2 border-b border-gray-100 ${this.isDragging ? 'cursor-grabbing' : 'cursor-grab'} active:bg-gray-50 hover:bg-gray-25 transition-colors duration-150`, onMouseDown: this.handleMouseDown, onTouchStart: this.handleTouchStart }, h("div", { class: "hidden sm:flex gap-1" }, h("div", { class: "flex gap-0.5 ml-2 pointer-events-none" }, h(GripDotsVerticalIcon, null))), h("div", { class: "sm:hidden" }), h("div", { class: "flex gap-1 items-center" }, this.allowFullScreen && h("button", { class: "hidden sm:block p-1.5 rounded-md transition-colors duration-200 hover:bg-gray-100 text-gray-500", 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: "p-1.5 rounded-md transition-colors duration-200 hover:bg-gray-100 text-gray-500", onClick: () => this.startNewChat(), title: "Start new chat", "aria-label": "Start new chat" }, h(PencilSquare, null))), h("button", { class: "p-1.5 hover:bg-gray-100 rounded-md transition-colors duration-200 text-gray-500", onClick: () => this.visible = false, "aria-label": "Close" }, h(XMarkIcon, null)))), h("div", { class: "flex flex-col flex-grow overflow-hidden" }, this.isLoading && !this.sessionId && (h("div", { class: "flex items-center justify-center flex-grow" }, h("div", { class: "loading-spinner" }), h("span", { class: "ml-2 text-gray-500" }, "Starting chat..."))), this.sessionId && (h("div", { ref: (el) => this.messageListRef = el, class: "flex-grow overflow-y-auto p-4 space-y-2" }, this.messages.length === 0 && !this.isTyping && this.parsedWelcomeMessages.length > 0 && (h("div", { class: "space-y-2" }, this.parsedWelcomeMessages.map((message, index) => (h("div", { key: `welcome-${index}`, class: "flex justify-start" }, h("div", { class: "bg-gray-200 text-gray-800 max-w-xs lg:max-w-md px-4 py-2 rounded-lg" }, h("div", { class: "chat-markdown", innerHTML: renderMarkdownComplete(message) }))))))), this.messages.map((message, index) => (h("div", { key: index, class: {
|
|
615
653
|
'flex': true,
|
|
616
654
|
'justify-end': message.role === 'user',
|
|
617
655
|
'justify-start': message.role !== 'user'
|
|
@@ -620,7 +658,7 @@ export class OcsChat {
|
|
|
620
658
|
'bg-blue-500 text-white': message.role === 'user',
|
|
621
659
|
'bg-gray-200 text-gray-800': message.role === 'assistant',
|
|
622
660
|
'bg-gray-100 text-gray-600 text-sm': message.role === 'system'
|
|
623
|
-
} }, h("div", { class: "chat-markdown", innerHTML: renderMarkdownComplete(message.content) }), message.attachments && message.attachments.length > 0 && (h("div", { class: "mt-2 space-y-1" }, message.attachments.map((attachment, attachmentIndex) => (h("a", { key: attachmentIndex, href: attachment.content_url, target: "_blank", rel: "noopener noreferrer", class: "block text-sm underline hover:no-underline" }, "\uD83D\uDCCE ", attachment.name))))), h("div", { class: "text-xs opacity-70 mt-1" }, this.formatTime(message.created_at)))))), this.isTyping && (h("div",
|
|
661
|
+
} }, h("div", { class: "chat-markdown", innerHTML: renderMarkdownComplete(message.content) }), message.attachments && message.attachments.length > 0 && (h("div", { class: "mt-2 space-y-1" }, message.attachments.map((attachment, attachmentIndex) => (h("a", { key: attachmentIndex, href: attachment.content_url, target: "_blank", rel: "noopener noreferrer", class: "block text-sm underline hover:no-underline" }, "\uD83D\uDCCE ", attachment.name))))), h("div", { class: "text-xs opacity-70 mt-1" }, this.formatTime(message.created_at)))))), this.isTyping && (h("div", null, h("div", { class: "h-1.5 w-full overflow-hidden" }, h("div", { class: "animate-progress w-full h-full bg-blue-200 origin-left-right rounded-lg" })), h("div", { class: "w-full text-xs opacity-70 justify-center" }, h("span", null, "Preparing response"), h("span", { class: "loading animate-dots" })))))), this.sessionId && this.showStarterQuestions && this.messages.length === 0 && !this.isTyping && (h("div", { class: "p-4 space-y-2" }, this.parsedStarterQuestions.map((question, index) => (h("div", { key: `starter-${index}`, class: "flex justify-end" }, h("button", { class: "starter-question", onClick: () => this.handleStarterQuestionClick(question) }, question)))))), this.sessionId && (h("div", { class: "border-t border-gray-200 p-4 text-sm" }, h("div", { class: "flex gap-2" }, h("textarea", { ref: (el) => this.textareaRef = el, class: "flex-grow px-3 py-2 border border-gray-300 rounded-md resize-none focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent", 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: {
|
|
624
662
|
'px-4 py-2 rounded-md font-medium transition-colors duration-200': true,
|
|
625
663
|
'bg-blue-500 hover:bg-blue-600 text-white': !this.isTyping && !!this.messageInput.trim(),
|
|
626
664
|
'bg-gray-300 text-gray-500 cursor-not-allowed': this.isTyping || !this.messageInput.trim()
|
|
@@ -777,26 +815,6 @@ export class OcsChat {
|
|
|
777
815
|
"reflect": false,
|
|
778
816
|
"defaultValue": "'right'"
|
|
779
817
|
},
|
|
780
|
-
"expanded": {
|
|
781
|
-
"type": "boolean",
|
|
782
|
-
"mutable": true,
|
|
783
|
-
"complexType": {
|
|
784
|
-
"original": "boolean",
|
|
785
|
-
"resolved": "boolean",
|
|
786
|
-
"references": {}
|
|
787
|
-
},
|
|
788
|
-
"required": false,
|
|
789
|
-
"optional": false,
|
|
790
|
-
"docs": {
|
|
791
|
-
"tags": [],
|
|
792
|
-
"text": "Whether the chat widget is initially expanded."
|
|
793
|
-
},
|
|
794
|
-
"getter": false,
|
|
795
|
-
"setter": false,
|
|
796
|
-
"attribute": "expanded",
|
|
797
|
-
"reflect": false,
|
|
798
|
-
"defaultValue": "false"
|
|
799
|
-
},
|
|
800
818
|
"welcomeMessages": {
|
|
801
819
|
"type": "string",
|
|
802
820
|
"mutable": false,
|
|
@@ -874,6 +892,26 @@ export class OcsChat {
|
|
|
874
892
|
"attribute": "persistent-session-expire",
|
|
875
893
|
"reflect": false,
|
|
876
894
|
"defaultValue": "60 * 24"
|
|
895
|
+
},
|
|
896
|
+
"allowFullScreen": {
|
|
897
|
+
"type": "boolean",
|
|
898
|
+
"mutable": false,
|
|
899
|
+
"complexType": {
|
|
900
|
+
"original": "boolean",
|
|
901
|
+
"resolved": "boolean",
|
|
902
|
+
"references": {}
|
|
903
|
+
},
|
|
904
|
+
"required": false,
|
|
905
|
+
"optional": false,
|
|
906
|
+
"docs": {
|
|
907
|
+
"tags": [],
|
|
908
|
+
"text": "Allow the user to make the chat window full screen."
|
|
909
|
+
},
|
|
910
|
+
"getter": false,
|
|
911
|
+
"setter": false,
|
|
912
|
+
"attribute": "allow-full-screen",
|
|
913
|
+
"reflect": false,
|
|
914
|
+
"defaultValue": "true"
|
|
877
915
|
}
|
|
878
916
|
};
|
|
879
917
|
}
|
|
@@ -892,9 +930,11 @@ export class OcsChat {
|
|
|
892
930
|
"isDragging": {},
|
|
893
931
|
"dragOffset": {},
|
|
894
932
|
"windowPosition": {},
|
|
933
|
+
"fullscreenPosition": {},
|
|
895
934
|
"showStarterQuestions": {},
|
|
896
935
|
"parsedWelcomeMessages": {},
|
|
897
|
-
"parsedStarterQuestions": {}
|
|
936
|
+
"parsedStarterQuestions": {},
|
|
937
|
+
"isFullscreen": {}
|
|
898
938
|
};
|
|
899
939
|
}
|
|
900
940
|
}
|
|
@@ -904,8 +944,8 @@ OcsChat.MESSAGE_POLLING_INTERVAL_MS = 30000;
|
|
|
904
944
|
OcsChat.SCROLL_DELAY_MS = 100;
|
|
905
945
|
OcsChat.FOCUS_DELAY_MS = 100;
|
|
906
946
|
OcsChat.CHAT_WIDTH_DESKTOP = 450;
|
|
907
|
-
OcsChat.
|
|
908
|
-
OcsChat.
|
|
947
|
+
OcsChat.CHAT_MAX_WIDTH = 1024;
|
|
948
|
+
OcsChat.CHAT_HEIGHT_EXPANDED_RATIO = 0.83; // 83% of window height (h-5/6)
|
|
909
949
|
OcsChat.MOBILE_BREAKPOINT = 640;
|
|
910
950
|
OcsChat.WINDOW_MARGIN = 20;
|
|
911
951
|
OcsChat.LOCALSTORAGE_TEST_KEY = '__ocs_test__';
|