@botpress/webchat 1.0.0 → 1.0.2

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.
Files changed (105) hide show
  1. package/package.json +2 -1
  2. package/dist/vite.svg +0 -1
  3. package/index.html +0 -18
  4. package/public/vite.svg +0 -1
  5. package/src/App.tsx +0 -41
  6. package/src/Utils/colors.ts +0 -45
  7. package/src/Utils/eventEmitter.ts +0 -31
  8. package/src/Utils/index.ts +0 -2
  9. package/src/assets/check-circle-bold.svg +0 -5
  10. package/src/assets/chevron-up.svg +0 -3
  11. package/src/assets/file-05.svg +0 -6
  12. package/src/assets/globe-02.svg +0 -6
  13. package/src/assets/help-circle.svg +0 -3
  14. package/src/assets/info-circle.svg +0 -3
  15. package/src/assets/lock-01.svg +0 -4
  16. package/src/assets/mail-01.svg +0 -6
  17. package/src/assets/minus-circle.svg +0 -3
  18. package/src/assets/phone.svg +0 -6
  19. package/src/assets/send-03.svg +0 -4
  20. package/src/assets/share-04.svg +0 -5
  21. package/src/assets/slash-circle-01.svg +0 -3
  22. package/src/assets/x-circle-bold.svg +0 -5
  23. package/src/assets/x-close.svg +0 -3
  24. package/src/assets/x.svg +0 -3
  25. package/src/client/MessagingClient.ts +0 -87
  26. package/src/client/adapters/Audio.ts +0 -10
  27. package/src/client/adapters/Card.ts +0 -104
  28. package/src/client/adapters/Carousel.ts +0 -11
  29. package/src/client/adapters/Choice.ts +0 -48
  30. package/src/client/adapters/Dropdown.ts +0 -39
  31. package/src/client/adapters/File.ts +0 -10
  32. package/src/client/adapters/Image.ts +0 -10
  33. package/src/client/adapters/Location.ts +0 -18
  34. package/src/client/adapters/Message.ts +0 -26
  35. package/src/client/adapters/Text.ts +0 -11
  36. package/src/client/adapters/Utils.ts +0 -11
  37. package/src/client/adapters/Video.ts +0 -10
  38. package/src/client/adapters/Voice.ts +0 -9
  39. package/src/client/adapters/index.ts +0 -12
  40. package/src/client/index.ts +0 -2
  41. package/src/components/Avatar.tsx +0 -22
  42. package/src/components/Block.tsx +0 -17
  43. package/src/components/Composer.tsx +0 -115
  44. package/src/components/Container.tsx +0 -17
  45. package/src/components/Header.tsx +0 -141
  46. package/src/components/LoadingIndicator.tsx +0 -15
  47. package/src/components/Message.tsx +0 -52
  48. package/src/components/MessageList.tsx +0 -75
  49. package/src/components/Modal.tsx +0 -49
  50. package/src/components/RestartConversation.tsx +0 -52
  51. package/src/components/Webchat.tsx +0 -68
  52. package/src/components/dev-tools/DevTools.tsx +0 -496
  53. package/src/components/dev-tools/configuration.tsx +0 -27
  54. package/src/components/dev-tools/helpers.ts +0 -21
  55. package/src/components/index.ts +0 -12
  56. package/src/components/renderers/Audio.tsx +0 -11
  57. package/src/components/renderers/Bubble.tsx +0 -12
  58. package/src/components/renderers/Button.tsx +0 -59
  59. package/src/components/renderers/Carousel.tsx +0 -51
  60. package/src/components/renderers/Column.tsx +0 -22
  61. package/src/components/renderers/Dropdown.tsx +0 -170
  62. package/src/components/renderers/File.tsx +0 -13
  63. package/src/components/renderers/Image.tsx +0 -63
  64. package/src/components/renderers/Location.tsx +0 -16
  65. package/src/components/renderers/Row.tsx +0 -22
  66. package/src/components/renderers/Text.tsx +0 -32
  67. package/src/components/renderers/Video.tsx +0 -11
  68. package/src/components/renderers/index.ts +0 -28
  69. package/src/contexts/ComposerContext.ts +0 -16
  70. package/src/contexts/MessageContext.ts +0 -16
  71. package/src/contexts/ModalContext.ts +0 -19
  72. package/src/contexts/WebchatContext.ts +0 -61
  73. package/src/contexts/index.ts +0 -4
  74. package/src/hooks/index.ts +0 -3
  75. package/src/hooks/useImageSize.ts +0 -30
  76. package/src/hooks/useRefresh.ts +0 -33
  77. package/src/hooks/useWebchatStore.ts +0 -45
  78. package/src/index.css +0 -18
  79. package/src/index.ts +0 -3
  80. package/src/main.tsx +0 -33
  81. package/src/providers/ModalProvider.tsx +0 -35
  82. package/src/providers/WebchatProvider.tsx +0 -107
  83. package/src/providers/index.ts +0 -2
  84. package/src/schemas/index.ts +0 -1
  85. package/src/schemas/theme.ts +0 -188
  86. package/src/services/clipboard.ts +0 -8
  87. package/src/services/images.ts +0 -39
  88. package/src/services/index.ts +0 -3
  89. package/src/services/toast.tsx +0 -71
  90. package/src/themes/dawn.ts +0 -277
  91. package/src/themes/duskTheme.ts +0 -349
  92. package/src/themes/eggplant.ts +0 -353
  93. package/src/themes/galaxy.ts +0 -323
  94. package/src/themes/index.ts +0 -6
  95. package/src/themes/midnight.ts +0 -276
  96. package/src/themes/prism.ts +0 -349
  97. package/src/twind.config.ts +0 -31
  98. package/src/types/block-type.ts +0 -150
  99. package/src/types/image.ts +0 -10
  100. package/src/types/index.ts +0 -2
  101. package/src/vite-env.d.ts +0 -1
  102. package/tailwind.config.js +0 -0
  103. package/tsconfig.json +0 -30
  104. package/tsconfig.node.json +0 -10
  105. package/vite.config.ts +0 -31
@@ -1,150 +0,0 @@
1
- import type { Theme } from '../schemas'
2
-
3
- export const blockTypes = [
4
- 'button',
5
- 'text',
6
- 'image',
7
- 'audio',
8
- 'video',
9
- 'file',
10
- 'location',
11
- 'column',
12
- 'row',
13
- 'bubble',
14
- 'carousel',
15
- 'dropdown',
16
- ] as const
17
-
18
- export const markdownTypes = [
19
- 'heading1',
20
- 'heading2',
21
- 'heading3',
22
- 'text',
23
- 'horizontalRule',
24
- 'link',
25
- 'italic',
26
- 'bold',
27
- 'orderedList',
28
- 'unorderedList',
29
- 'listItem',
30
- 'lineBreak',
31
- 'pre',
32
- ] as const
33
-
34
- export type MarkdownTypes = (typeof markdownTypes)[number]
35
-
36
- export type BlockTypes = (typeof blockTypes)[number]
37
- export type BlockStyles = NonNullable<Theme['message']>['blocks']
38
-
39
- export type BlockObject =
40
- | DropdownBlock
41
- | ButtonBlock
42
- | TextBlock
43
- | ImageBlock
44
- | AudioBlock
45
- | VideoBlock
46
- | FileBlock
47
- | LocationBlock
48
- | ColumnBlock
49
- | RowBlock
50
- | BubbleBlock
51
- | CarouselBlock
52
-
53
- export type Sender = {
54
- name: string
55
- avatar?: string
56
- }
57
-
58
- export type MessageObject = {
59
- direction: 'incoming' | 'outgoing' | 'system'
60
- disableInput?: boolean
61
- sender: Sender
62
- timestamp: Date
63
- block: BlockObject
64
- }
65
-
66
- export type ButtonBlock = {
67
- type: 'button'
68
- variant: 'action' | 'link'
69
- reusable?: boolean
70
- groupId?: string
71
- text: string
72
- buttonValue: string
73
- }
74
-
75
- export type TextBlock = {
76
- type: 'text'
77
- text: string
78
- }
79
-
80
- export type ImageBlock = {
81
- type: 'image'
82
- orientation?: 'portrait' | 'landscape' | 'square' | 'auto'
83
- url: string
84
- }
85
-
86
- export type AudioBlock = {
87
- type: 'audio'
88
- url: string
89
- }
90
-
91
- export type VideoBlock = {
92
- type: 'video'
93
- url: string
94
- }
95
-
96
- export type FileBlock = {
97
- type: 'file'
98
- url: string
99
- title?: string
100
- }
101
-
102
- type DropdownChoice = {
103
- label: string
104
- value: string
105
- }
106
- export type DropdownBlock = {
107
- label?: string
108
- type: 'dropdown'
109
- reusable?: boolean
110
- options: DropdownChoice[]
111
- }
112
-
113
- export type LocationBlock = {
114
- type: 'location'
115
- latitude: number
116
- longitude: number
117
- title?: string
118
- }
119
-
120
- export type ColumnBlock = {
121
- type: 'column'
122
- blocks: BlockObject[]
123
- horizontalAlignment?: 'left' | 'center' | 'right'
124
- verticalAlignment?: 'top' | 'center' | 'bottom' | 'stretch'
125
- }
126
-
127
- export type RowBlock = {
128
- type: 'row'
129
- blocks: BlockObject[]
130
- horizontalAlignment?: 'left' | 'center' | 'right' | 'stretch'
131
- verticalAlignment?: 'top' | 'center' | 'bottom'
132
- }
133
-
134
- export type CarouselBlock = {
135
- type: 'carousel'
136
- blocks: BlockObject[]
137
- }
138
-
139
- export type BubbleBlock = {
140
- type: 'bubble'
141
- block: BlockObject
142
- }
143
-
144
- export type CommonBlockProps = {
145
- styles?: BlockStyles
146
- }
147
-
148
- export type BlockMap<P extends BlockObject = BlockObject> = {
149
- [T in P['type']]: Extract<P, { type: T }>
150
- }
@@ -1,10 +0,0 @@
1
- export type Options = {
2
- timeout?: number
3
- }
4
-
5
- export type Dimensions = {
6
- width: number
7
- height: number
8
- }
9
-
10
- export type UseImageSizeResult = [Dimensions | null, { loading: boolean; error: string | null }]
@@ -1,2 +0,0 @@
1
- export * from './block-type'
2
- export * from './image'
package/src/vite-env.d.ts DELETED
@@ -1 +0,0 @@
1
- /// <reference types="vite/client" />
File without changes
package/tsconfig.json DELETED
@@ -1,30 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES2020",
4
- "useDefineForClassFields": true,
5
- "lib": ["ES2020", "DOM", "DOM.Iterable"],
6
- "module": "ESNext",
7
- "skipLibCheck": true,
8
- "esModuleInterop": true,
9
-
10
- /* Bundler mode */
11
- "moduleResolution": "bundler",
12
- "allowImportingTsExtensions": true,
13
- "resolveJsonModule": true,
14
- "isolatedModules": true,
15
- "noEmit": true,
16
- "jsx": "react-jsx",
17
-
18
- /* Linting */
19
- "strict": true,
20
- "noUnusedLocals": false,
21
- "noUnusedParameters": true,
22
- "noFallthroughCasesInSwitch": true,
23
- "forceConsistentCasingInFileNames": false,
24
-
25
- "typeRoots": ["./node_modules/@types"],
26
- "outDir": "./dist"
27
- },
28
- "include": ["src"],
29
- "references": [{ "path": "./tsconfig.node.json" }]
30
- }
@@ -1,10 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "composite": true,
4
- "skipLibCheck": true,
5
- "module": "ESNext",
6
- "moduleResolution": "bundler",
7
- "allowSyntheticDefaultImports": true
8
- },
9
- "include": ["vite.config.ts"]
10
- }
package/vite.config.ts DELETED
@@ -1,31 +0,0 @@
1
- import { defineConfig } from 'vite'
2
- import react from '@vitejs/plugin-react-swc'
3
- import svgr from 'vite-plugin-svgr'
4
- import path from 'path'
5
- import dts from 'vite-plugin-dts'
6
-
7
- // https://vitejs.dev/config/
8
- export default defineConfig({
9
- plugins: [react(), svgr({ include: '**/*.svg' }), dts()],
10
- build: {
11
- lib: {
12
- // Could also be a dictionary or array of multiple entry points
13
- entry: path.join(__dirname, 'src/index.ts'),
14
- name: 'Webchat',
15
- // the proper extensions will be added
16
- fileName: 'index',
17
- },
18
- rollupOptions: {
19
- // make sure to externalize deps that shouldn't be bundled
20
- // into your library
21
- external: ['react'],
22
- output: {
23
- // Provide global variables to use in the UMD build
24
- // for externalized deps
25
- globals: {
26
- react: 'React',
27
- },
28
- },
29
- },
30
- },
31
- })