@botonic/react 0.28.2-alpha.3 → 0.28.2-alpha.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.
|
@@ -6,9 +6,18 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
6
6
|
const core_1 = require("@botonic/core");
|
|
7
7
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
8
8
|
const server_1 = tslib_1.__importDefault(require("react-dom/server"));
|
|
9
|
-
const unescape_1 = tslib_1.__importDefault(require("unescape"));
|
|
10
9
|
const reply_1 = require("./components/reply");
|
|
11
10
|
const text_1 = require("./components/text");
|
|
11
|
+
function decodeHTMLEntities(text) {
|
|
12
|
+
const entities = {
|
|
13
|
+
'"': '"',
|
|
14
|
+
'&': '&',
|
|
15
|
+
'<': '<',
|
|
16
|
+
'>': '>',
|
|
17
|
+
''': "'",
|
|
18
|
+
};
|
|
19
|
+
return text.replace(/"|&|<|>|'/g, match => entities[match]);
|
|
20
|
+
}
|
|
12
21
|
class BotonicInputTester {
|
|
13
22
|
constructor(bot) {
|
|
14
23
|
this.bot = bot;
|
|
@@ -20,7 +29,7 @@ class BotonicInputTester {
|
|
|
20
29
|
session: session,
|
|
21
30
|
lastRoutePath: lastRoutePath,
|
|
22
31
|
});
|
|
23
|
-
return (
|
|
32
|
+
return decodeHTMLEntities(res.response);
|
|
24
33
|
});
|
|
25
34
|
}
|
|
26
35
|
payload(inp, session = { user: { id: '123' } }, lastRoutePath = '') {
|
|
@@ -30,7 +39,7 @@ class BotonicInputTester {
|
|
|
30
39
|
session: session,
|
|
31
40
|
lastRoutePath: lastRoutePath,
|
|
32
41
|
});
|
|
33
|
-
return (
|
|
42
|
+
return decodeHTMLEntities(res.response);
|
|
34
43
|
});
|
|
35
44
|
}
|
|
36
45
|
path(inp, session = { user: { id: '123' } }, lastRoutePath = '') {
|
|
@@ -40,7 +49,7 @@ class BotonicInputTester {
|
|
|
40
49
|
session: session,
|
|
41
50
|
lastRoutePath: lastRoutePath,
|
|
42
51
|
});
|
|
43
|
-
return (
|
|
52
|
+
return decodeHTMLEntities(res.response);
|
|
44
53
|
});
|
|
45
54
|
}
|
|
46
55
|
}
|
|
@@ -50,14 +59,14 @@ class BotonicOutputTester {
|
|
|
50
59
|
this.bot = bot;
|
|
51
60
|
}
|
|
52
61
|
text(out, replies = null) {
|
|
53
|
-
return (
|
|
62
|
+
return decodeHTMLEntities(server_1.default.renderToStaticMarkup(!replies ? ((0, jsx_runtime_1.jsx)(text_1.Text, { children: out })) : ((0, jsx_runtime_1.jsxs)(text_1.Text, { children: [out, replies] }))));
|
|
54
63
|
}
|
|
55
64
|
reply({ text, payload = null, path = null }) {
|
|
56
65
|
if (payload) {
|
|
57
|
-
return (
|
|
66
|
+
return decodeHTMLEntities(server_1.default.renderToStaticMarkup((0, jsx_runtime_1.jsx)(reply_1.Reply, Object.assign({ payload: payload }, { children: text }))));
|
|
58
67
|
}
|
|
59
68
|
if (path) {
|
|
60
|
-
return (
|
|
69
|
+
return decodeHTMLEntities(server_1.default.renderToStaticMarkup((0, jsx_runtime_1.jsx)(reply_1.Reply, Object.assign({ path: path }, { children: text }))));
|
|
61
70
|
}
|
|
62
71
|
throw new Error('reply should contain a payload or a path');
|
|
63
72
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"botonic-tester.js","sourceRoot":"","sources":["../../src/botonic-tester.jsx"],"names":[],"mappings":";;;;;AAAA,wCAAqC;AACrC,0DAAyB;AACzB,sEAA6C;
|
|
1
|
+
{"version":3,"file":"botonic-tester.js","sourceRoot":"","sources":["../../src/botonic-tester.jsx"],"names":[],"mappings":";;;;;AAAA,wCAAqC;AACrC,0DAAyB;AACzB,sEAA6C;AAE7C,8CAA0C;AAC1C,4CAAwC;AAExC,SAAS,kBAAkB,CAAC,IAAI;IAC9B,MAAM,QAAQ,GAAG;QACf,QAAQ,EAAE,GAAG;QACb,OAAO,EAAE,GAAG;QACZ,MAAM,EAAE,G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IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACpC,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;YACjB,OAAO,CAAC,IAAI,CACV,IAAI,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAC/D,CAAA;SACF;QACD,OAAO,OAAO,CAAA;IAChB,CAAC;CACF;AA9CD,kDA8CC"}
|
|
@@ -3,9 +3,18 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import { INPUT } from '@botonic/core';
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import ReactDOMServer from 'react-dom/server';
|
|
6
|
-
import decode from 'unescape';
|
|
7
6
|
import { Reply } from './components/reply';
|
|
8
7
|
import { Text } from './components/text';
|
|
8
|
+
function decodeHTMLEntities(text) {
|
|
9
|
+
const entities = {
|
|
10
|
+
'"': '"',
|
|
11
|
+
'&': '&',
|
|
12
|
+
'<': '<',
|
|
13
|
+
'>': '>',
|
|
14
|
+
''': "'",
|
|
15
|
+
};
|
|
16
|
+
return text.replace(/"|&|<|>|'/g, match => entities[match]);
|
|
17
|
+
}
|
|
9
18
|
export class BotonicInputTester {
|
|
10
19
|
constructor(bot) {
|
|
11
20
|
this.bot = bot;
|
|
@@ -17,7 +26,7 @@ export class BotonicInputTester {
|
|
|
17
26
|
session: session,
|
|
18
27
|
lastRoutePath: lastRoutePath,
|
|
19
28
|
});
|
|
20
|
-
return
|
|
29
|
+
return decodeHTMLEntities(res.response);
|
|
21
30
|
});
|
|
22
31
|
}
|
|
23
32
|
payload(inp, session = { user: { id: '123' } }, lastRoutePath = '') {
|
|
@@ -27,7 +36,7 @@ export class BotonicInputTester {
|
|
|
27
36
|
session: session,
|
|
28
37
|
lastRoutePath: lastRoutePath,
|
|
29
38
|
});
|
|
30
|
-
return
|
|
39
|
+
return decodeHTMLEntities(res.response);
|
|
31
40
|
});
|
|
32
41
|
}
|
|
33
42
|
path(inp, session = { user: { id: '123' } }, lastRoutePath = '') {
|
|
@@ -37,7 +46,7 @@ export class BotonicInputTester {
|
|
|
37
46
|
session: session,
|
|
38
47
|
lastRoutePath: lastRoutePath,
|
|
39
48
|
});
|
|
40
|
-
return
|
|
49
|
+
return decodeHTMLEntities(res.response);
|
|
41
50
|
});
|
|
42
51
|
}
|
|
43
52
|
}
|
|
@@ -46,14 +55,14 @@ export class BotonicOutputTester {
|
|
|
46
55
|
this.bot = bot;
|
|
47
56
|
}
|
|
48
57
|
text(out, replies = null) {
|
|
49
|
-
return
|
|
58
|
+
return decodeHTMLEntities(ReactDOMServer.renderToStaticMarkup(!replies ? (_jsx(Text, { children: out })) : (_jsxs(Text, { children: [out, replies] }))));
|
|
50
59
|
}
|
|
51
60
|
reply({ text, payload = null, path = null }) {
|
|
52
61
|
if (payload) {
|
|
53
|
-
return
|
|
62
|
+
return decodeHTMLEntities(ReactDOMServer.renderToStaticMarkup(_jsx(Reply, Object.assign({ payload: payload }, { children: text }))));
|
|
54
63
|
}
|
|
55
64
|
if (path) {
|
|
56
|
-
return
|
|
65
|
+
return decodeHTMLEntities(ReactDOMServer.renderToStaticMarkup(_jsx(Reply, Object.assign({ path: path }, { children: text }))));
|
|
57
66
|
}
|
|
58
67
|
throw new Error('reply should contain a payload or a path');
|
|
59
68
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"botonic-tester.js","sourceRoot":"","sources":["../../src/botonic-tester.jsx"],"names":[],"mappings":";;AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACrC,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,cAAc,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"botonic-tester.js","sourceRoot":"","sources":["../../src/botonic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KAAK,kBAAC,OAAO,EAAE,OAAO,gBAAG,IAAI,IAAS,CACxC,CACF,CAAA;SACF;QACD,IAAI,IAAI,EAAE;YACR,OAAO,kBAAkB,CACvB,cAAc,CAAC,oBAAoB,CAAC,KAAC,KAAK,kBAAC,IAAI,EAAE,IAAI,gBAAG,IAAI,IAAS,CAAC,CACvE,CAAA;SACF;QACD,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAA;IAC7D,CAAC;IAED,OAAO,CAAC,GAAG,IAAI;QACb,MAAM,OAAO,GAAG,EAAE,CAAA;QAClB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACpC,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;YACjB,OAAO,CAAC,IAAI,CACV,IAAI,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAC/D,CAAA;SACF;QACD,OAAO,OAAO,CAAA;IAChB,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@botonic/react",
|
|
3
|
-
"version": "0.28.2-alpha.
|
|
3
|
+
"version": "0.28.2-alpha.4",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Build Chatbots using React",
|
|
6
6
|
"main": "./lib/cjs",
|
|
@@ -20,13 +20,11 @@
|
|
|
20
20
|
"lint_core": "../../node_modules/.bin/eslint_d --cache --quiet '.*.js' '*.js' 'src/**/*.js*' --fix"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@botonic/core": "0.28.2-alpha.
|
|
23
|
+
"@botonic/core": "0.28.2-alpha.3",
|
|
24
24
|
"axios": "^1.7.2",
|
|
25
25
|
"emoji-picker-react": "^4.4.9",
|
|
26
|
-
"he": "^1.2.0",
|
|
27
26
|
"lodash.merge": "^4.6.2",
|
|
28
27
|
"markdown-it": "^12.0.6",
|
|
29
|
-
"qrcode.react": "^1.0.1",
|
|
30
28
|
"react": "^16.14.0",
|
|
31
29
|
"react-dom": "^16.14.0",
|
|
32
30
|
"react-frame-component": "^4.1.3",
|
|
@@ -37,7 +35,6 @@
|
|
|
37
35
|
"simplebar-react": "^2.4.3",
|
|
38
36
|
"styled-components": "^5.3.0",
|
|
39
37
|
"ua-parser-js": "^0.8.1",
|
|
40
|
-
"unescape": "^1.0.1",
|
|
41
38
|
"use-async-effect": "^2.2.7",
|
|
42
39
|
"uuid": "^8.3.2"
|
|
43
40
|
},
|
package/src/botonic-tester.jsx
CHANGED
|
@@ -1,22 +1,37 @@
|
|
|
1
1
|
import { INPUT } from '@botonic/core'
|
|
2
2
|
import React from 'react'
|
|
3
3
|
import ReactDOMServer from 'react-dom/server'
|
|
4
|
-
import decode from 'unescape'
|
|
5
4
|
|
|
6
5
|
import { Reply } from './components/reply'
|
|
7
6
|
import { Text } from './components/text'
|
|
8
7
|
|
|
8
|
+
function decodeHTMLEntities(text) {
|
|
9
|
+
const entities = {
|
|
10
|
+
'"': '"',
|
|
11
|
+
'&': '&',
|
|
12
|
+
'<': '<',
|
|
13
|
+
'>': '>',
|
|
14
|
+
''': "'",
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return text.replace(
|
|
18
|
+
/"|&|<|>|'/g,
|
|
19
|
+
match => entities[match]
|
|
20
|
+
)
|
|
21
|
+
}
|
|
22
|
+
|
|
9
23
|
export class BotonicInputTester {
|
|
10
24
|
constructor(bot) {
|
|
11
25
|
this.bot = bot
|
|
12
26
|
}
|
|
27
|
+
|
|
13
28
|
async text(inp, session = { user: { id: '123' } }, lastRoutePath = '') {
|
|
14
29
|
const res = await this.bot.input({
|
|
15
30
|
input: { type: INPUT.TEXT, data: inp },
|
|
16
31
|
session: session,
|
|
17
32
|
lastRoutePath: lastRoutePath,
|
|
18
33
|
})
|
|
19
|
-
return
|
|
34
|
+
return decodeHTMLEntities(res.response)
|
|
20
35
|
}
|
|
21
36
|
|
|
22
37
|
async payload(inp, session = { user: { id: '123' } }, lastRoutePath = '') {
|
|
@@ -25,7 +40,7 @@ export class BotonicInputTester {
|
|
|
25
40
|
session: session,
|
|
26
41
|
lastRoutePath: lastRoutePath,
|
|
27
42
|
})
|
|
28
|
-
return
|
|
43
|
+
return decodeHTMLEntities(res.response)
|
|
29
44
|
}
|
|
30
45
|
|
|
31
46
|
async path(inp, session = { user: { id: '123' } }, lastRoutePath = '') {
|
|
@@ -34,7 +49,7 @@ export class BotonicInputTester {
|
|
|
34
49
|
session: session,
|
|
35
50
|
lastRoutePath: lastRoutePath,
|
|
36
51
|
})
|
|
37
|
-
return
|
|
52
|
+
return decodeHTMLEntities(res.response)
|
|
38
53
|
}
|
|
39
54
|
}
|
|
40
55
|
|
|
@@ -44,7 +59,7 @@ export class BotonicOutputTester {
|
|
|
44
59
|
}
|
|
45
60
|
|
|
46
61
|
text(out, replies = null) {
|
|
47
|
-
return
|
|
62
|
+
return decodeHTMLEntities(
|
|
48
63
|
ReactDOMServer.renderToStaticMarkup(
|
|
49
64
|
!replies ? (
|
|
50
65
|
<Text>{out}</Text>
|
|
@@ -60,14 +75,14 @@ export class BotonicOutputTester {
|
|
|
60
75
|
|
|
61
76
|
reply({ text, payload = null, path = null }) {
|
|
62
77
|
if (payload) {
|
|
63
|
-
return
|
|
78
|
+
return decodeHTMLEntities(
|
|
64
79
|
ReactDOMServer.renderToStaticMarkup(
|
|
65
80
|
<Reply payload={payload}>{text}</Reply>
|
|
66
81
|
)
|
|
67
82
|
)
|
|
68
83
|
}
|
|
69
84
|
if (path) {
|
|
70
|
-
return
|
|
85
|
+
return decodeHTMLEntities(
|
|
71
86
|
ReactDOMServer.renderToStaticMarkup(<Reply path={path}>{text}</Reply>)
|
|
72
87
|
)
|
|
73
88
|
}
|