@botonic/react 0.21.4 → 0.21.5
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@botonic/react",
|
|
3
|
-
"version": "0.21.
|
|
3
|
+
"version": "0.21.5",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Build Chatbots using React",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -42,14 +42,14 @@
|
|
|
42
42
|
"react-frame-component": "^4.1.3",
|
|
43
43
|
"react-json-tree": "^0.15.0",
|
|
44
44
|
"react-reveal": "^1.2.2",
|
|
45
|
-
"react-router-dom": "^5.
|
|
45
|
+
"react-router-dom": "^5.3.4",
|
|
46
46
|
"react-textarea-autosize": "^7.1.2",
|
|
47
47
|
"reconnecting-websocket": "^4.4.0",
|
|
48
|
-
"simplebar-react": "^2.
|
|
48
|
+
"simplebar-react": "^2.4.3",
|
|
49
49
|
"styled-components": "^5.3.0",
|
|
50
|
-
"ua-parser-js": "^0.
|
|
50
|
+
"ua-parser-js": "^0.8.1",
|
|
51
51
|
"unescape": "^1.0.1",
|
|
52
|
-
"use-async-effect": "^2.2.
|
|
52
|
+
"use-async-effect": "^2.2.7",
|
|
53
53
|
"uuid": "^8.3.2"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
package/src/components/audio.jsx
CHANGED
|
@@ -2,6 +2,7 @@ import { INPUT, isBrowser } from '@botonic/core'
|
|
|
2
2
|
import React from 'react'
|
|
3
3
|
|
|
4
4
|
import { ROLES } from '../constants'
|
|
5
|
+
import { staticAsset } from '../util/environment'
|
|
5
6
|
import { Message } from './message'
|
|
6
7
|
|
|
7
8
|
const serialize = audioProps => {
|
|
@@ -9,6 +10,7 @@ const serialize = audioProps => {
|
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
export const Audio = props => {
|
|
13
|
+
props = { ...props, src: staticAsset(props.src) }
|
|
12
14
|
let content = props.children
|
|
13
15
|
if (isBrowser())
|
|
14
16
|
content = (
|
|
@@ -4,6 +4,7 @@ import styled from 'styled-components'
|
|
|
4
4
|
|
|
5
5
|
import { ROLES, WEBCHAT } from '../constants'
|
|
6
6
|
import { WebchatContext } from '../contexts'
|
|
7
|
+
import { staticAsset } from '../util/environment'
|
|
7
8
|
import { Message } from './message'
|
|
8
9
|
|
|
9
10
|
const StyledButton = styled.a`
|
|
@@ -29,6 +30,7 @@ const serialize = documentProps => {
|
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
export const Document = props => {
|
|
33
|
+
props = { ...props, src: staticAsset(props.src) }
|
|
32
34
|
let content = props.children
|
|
33
35
|
|
|
34
36
|
const { getThemeProperty } = useContext(WebchatContext)
|
package/src/components/image.jsx
CHANGED
|
@@ -4,6 +4,7 @@ import styled from 'styled-components'
|
|
|
4
4
|
|
|
5
5
|
import { ROLES, WEBCHAT } from '../constants'
|
|
6
6
|
import { WebchatContext } from '../contexts'
|
|
7
|
+
import { staticAsset } from '../util/environment'
|
|
7
8
|
import { Message } from './message'
|
|
8
9
|
|
|
9
10
|
const StyledImage = styled.img`
|
|
@@ -19,6 +20,7 @@ const serialize = imageProps => {
|
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
export const Image = props => {
|
|
23
|
+
props = { ...props, src: staticAsset(props.src) }
|
|
22
24
|
let content = props.children
|
|
23
25
|
|
|
24
26
|
const [isPreviewerOpened, setIsPreviewerOpened] = useState(false)
|
package/src/components/pic.jsx
CHANGED
|
@@ -2,6 +2,7 @@ import React from 'react'
|
|
|
2
2
|
import styled from 'styled-components'
|
|
3
3
|
|
|
4
4
|
import { COLORS, WEBCHAT } from '../constants'
|
|
5
|
+
import { staticAsset } from '../util/environment'
|
|
5
6
|
import { renderComponent } from '../util/react'
|
|
6
7
|
|
|
7
8
|
const PicStyled = styled.img`
|
|
@@ -15,6 +16,7 @@ const PicStyled = styled.img`
|
|
|
15
16
|
`
|
|
16
17
|
|
|
17
18
|
export const Pic = props => {
|
|
19
|
+
props = { ...props, src: staticAsset(props.src) }
|
|
18
20
|
const renderBrowser = () => <PicStyled src={props.src} />
|
|
19
21
|
const renderNode = () => <pic>{props.src}</pic>
|
|
20
22
|
return renderComponent({ renderBrowser, renderNode })
|
package/src/components/video.jsx
CHANGED
|
@@ -3,6 +3,7 @@ import React from 'react'
|
|
|
3
3
|
import styled from 'styled-components'
|
|
4
4
|
|
|
5
5
|
import { COLORS, ROLES } from '../constants'
|
|
6
|
+
import { staticAsset } from '../util/environment'
|
|
6
7
|
import { Message } from './message'
|
|
7
8
|
|
|
8
9
|
const StyledVideo = styled.video`
|
|
@@ -18,6 +19,7 @@ const serialize = videoProps => {
|
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
export const Video = props => {
|
|
22
|
+
props = { ...props, src: staticAsset(props.src) }
|
|
21
23
|
let content = props.children
|
|
22
24
|
if (isBrowser())
|
|
23
25
|
content = (
|
package/src/util/environment.js
CHANGED
|
@@ -9,7 +9,8 @@ export const staticAsset = path => {
|
|
|
9
9
|
.getAttribute('src')
|
|
10
10
|
const scriptName = scriptBaseURL.split('/').pop()
|
|
11
11
|
const basePath = scriptBaseURL.replace('/' + scriptName, '/')
|
|
12
|
-
|
|
12
|
+
const resolvedStaticAssetPath = basePath + path
|
|
13
|
+
return resolvedStaticAssetPath
|
|
13
14
|
} catch (e) {
|
|
14
15
|
console.error(`Could not resolve path: '${path}'`)
|
|
15
16
|
return path
|