cec-nuxt-lib 0.11.14 → 0.11.16
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/module.json
CHANGED
package/package.json
CHANGED
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { useHead } from "#app";
|
|
3
|
-
import { onMounted } from "vue";
|
|
4
|
-
import { useState } from "#app";
|
|
5
|
-
const showChat = useState("showChat", () => false);
|
|
6
|
-
const openChat = () => {
|
|
7
|
-
showChat.value = !showChat.value;
|
|
8
|
-
};
|
|
9
|
-
const styleOptions = {
|
|
10
|
-
hideUploadButton: true,
|
|
11
|
-
avatarBorderRadius: "50%",
|
|
12
|
-
botAvatarInitials: "CEC",
|
|
13
|
-
avatarSize: 40,
|
|
14
|
-
botAvatarImage: "https://bot-framework.azureedge.net/bot-icons-v1/a248a9a7-5a00-4923-a58a-31ce3199d509_G6n7eqCFC7JI8NWE7T8ro8rMD6CuwB2x9A65wLF1UyU8uC.png",
|
|
15
|
-
userAvatarImage: "https://content.powerapps.com/resource/makerx/static/media/user.0d06c38a.svg",
|
|
16
|
-
userAvatarInitials: "You",
|
|
17
|
-
backgroundColor: "rgba(249,249,249,1)",
|
|
18
|
-
sendBoxButtonColor: "#206c49",
|
|
19
|
-
timestampColor: "#212529"
|
|
20
|
-
};
|
|
21
|
-
const BOT_ID = "da657b31-7cec-40a8-afea-fe17480f1550";
|
|
22
|
-
const theURL = "https://powerva.microsoft.com/api/botmanagement/v1/directline/directlinetoken?botId=" + BOT_ID;
|
|
23
|
-
useHead({
|
|
24
|
-
script: [
|
|
25
|
-
{
|
|
26
|
-
src: "https://cdn.botframework.com/botframework-webchat/latest/webchat.js"
|
|
27
|
-
}
|
|
28
|
-
]
|
|
29
|
-
});
|
|
30
|
-
onMounted(() => {
|
|
31
|
-
const removeTabind = () => {
|
|
32
|
-
const divs = Array.from(document.querySelectorAll("div")).filter(
|
|
33
|
-
(e) => !e.innerHTML && e.hasAttribute("tabindex")
|
|
34
|
-
);
|
|
35
|
-
if (!divs.length) {
|
|
36
|
-
setTimeout(removeTabind, 10);
|
|
37
|
-
} else {
|
|
38
|
-
divs.forEach((e) => e.removeAttribute("tabindex"));
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
const store = WebChat.createStore(
|
|
42
|
-
{},
|
|
43
|
-
({ dispatch }) => (next) => (action) => {
|
|
44
|
-
if (action.type === "DIRECT_LINE/CONNECT_FULFILLED") {
|
|
45
|
-
dispatch({
|
|
46
|
-
meta: {
|
|
47
|
-
method: "keyboard"
|
|
48
|
-
},
|
|
49
|
-
payload: {
|
|
50
|
-
activity: {
|
|
51
|
-
channelData: {
|
|
52
|
-
postBack: true
|
|
53
|
-
},
|
|
54
|
-
name: "startConversation",
|
|
55
|
-
type: "event"
|
|
56
|
-
}
|
|
57
|
-
},
|
|
58
|
-
type: "DIRECT_LINE/POST_ACTIVITY"
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
return next(action);
|
|
62
|
-
}
|
|
63
|
-
);
|
|
64
|
-
fetch(theURL).then((response) => response.json()).then((conversationInfo) => {
|
|
65
|
-
WebChat.renderWebChat(
|
|
66
|
-
{
|
|
67
|
-
directLine: WebChat.createDirectLine({
|
|
68
|
-
token: conversationInfo.token
|
|
69
|
-
}),
|
|
70
|
-
store,
|
|
71
|
-
styleOptions
|
|
72
|
-
},
|
|
73
|
-
document.getElementById("webchat")
|
|
74
|
-
);
|
|
75
|
-
}).catch((err) => console.error("An error occurred: " + err));
|
|
76
|
-
removeTabind();
|
|
77
|
-
});
|
|
78
|
-
</script>
|
|
79
|
-
|
|
80
|
-
<template>
|
|
81
|
-
<div>
|
|
82
|
-
<a href="#" @click="openChat" class="openwebchatbutton"
|
|
83
|
-
><img
|
|
84
|
-
alt="Can I help you button"
|
|
85
|
-
src="https://www.cheshireeast.gov.uk/images/non_user/cecilia-button.png"
|
|
86
|
-
/><span class="sr-only">Open or close Cecilia chat bot</span></a
|
|
87
|
-
>
|
|
88
|
-
<div
|
|
89
|
-
v-show="showChat"
|
|
90
|
-
id="chatWindow"
|
|
91
|
-
class="chat-popup"
|
|
92
|
-
style="position: relative; width: 400px; min-width: 400px; height: 100%"
|
|
93
|
-
>
|
|
94
|
-
<div id="webchat-wrapper">
|
|
95
|
-
<div id="webchat-header">
|
|
96
|
-
Cecilia<a href="#" @click="openChat" class="minimisechatbutton"
|
|
97
|
-
><svg
|
|
98
|
-
preserveAspectRatio="xMidYMid meet"
|
|
99
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
100
|
-
fill="white"
|
|
101
|
-
width="20"
|
|
102
|
-
height="20"
|
|
103
|
-
stroke="white"
|
|
104
|
-
stroke-width="3"
|
|
105
|
-
viewBox="0 0 32 32"
|
|
106
|
-
aria-hidden="true"
|
|
107
|
-
>
|
|
108
|
-
<path d="M8 15H24V17H8z"></path></svg
|
|
109
|
-
><span class="sr-only">Close chat window</span></a
|
|
110
|
-
>
|
|
111
|
-
</div>
|
|
112
|
-
<div id="webchat" role="main"></div>
|
|
113
|
-
<div id="webchat-footer">
|
|
114
|
-
<small
|
|
115
|
-
><a
|
|
116
|
-
target="_blank"
|
|
117
|
-
href="https://www.cheshireeast.gov.uk/council_and_democracy/council_information/website_information/privacy-notices/cecilia-%E2%80%93-chat-bot-privacy-notice.aspx"
|
|
118
|
-
>Privacy notice<span class="sr-only">
|
|
119
|
-
(link opens in a new window)</span
|
|
120
|
-
></a
|
|
121
|
-
></small
|
|
122
|
-
>
|
|
123
|
-
</div>
|
|
124
|
-
</div>
|
|
125
|
-
</div>
|
|
126
|
-
</div>
|
|
127
|
-
</template>
|
|
128
|
-
|
|
129
|
-
<style scoped>
|
|
130
|
-
.chat-popup#chatWindow{display:block}.react-film__filmstrip__list li{list-style:none}
|
|
131
|
-
</style>
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
-
export default _default;
|