@opencx/widget 2.0.0

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 (125) hide show
  1. package/README.md +105 -0
  2. package/dist/basic.cjs +259 -0
  3. package/dist/basic.cjs.map +1 -0
  4. package/dist/basic.d.ts +2 -0
  5. package/dist/basic.js +40507 -0
  6. package/dist/basic.js.map +1 -0
  7. package/dist/core/client/api.d.ts +15 -0
  8. package/dist/core/client/client.d.ts +39 -0
  9. package/dist/core/client/index.d.ts +1 -0
  10. package/dist/core/errors/index.d.ts +21 -0
  11. package/dist/core/index.d.ts +3 -0
  12. package/dist/core/managers/chathistory-manager.d.ts +61 -0
  13. package/dist/core/managers/session-manager.d.ts +35 -0
  14. package/dist/core/platform/index.d.ts +20 -0
  15. package/dist/core/transport/http.transport.d.ts +17 -0
  16. package/dist/core/transport/transport.d.ts +25 -0
  17. package/dist/core/types/helpers.d.ts +5 -0
  18. package/dist/core/types/index.d.ts +32 -0
  19. package/dist/core/types/messages.d.ts +43 -0
  20. package/dist/core/types/prelude.d.ts +14 -0
  21. package/dist/core/types/pub-sub.d.ts +94 -0
  22. package/dist/core/types/schemas.d.ts +489 -0
  23. package/dist/core/types/transport.d.ts +31 -0
  24. package/dist/core/utils/genId.d.ts +2 -0
  25. package/dist/core/utils/genId.test.d.ts +1 -0
  26. package/dist/core/utils/history-to-widget-messages.d.ts +4 -0
  27. package/dist/history-to-widget-messages-CP0hKjhv.js +195 -0
  28. package/dist/history-to-widget-messages-CP0hKjhv.js.map +1 -0
  29. package/dist/history-to-widget-messages-CdbZolRN.cjs +2 -0
  30. package/dist/history-to-widget-messages-CdbZolRN.cjs.map +1 -0
  31. package/dist/index-C11ivBh5.js +2604 -0
  32. package/dist/index-C11ivBh5.js.map +1 -0
  33. package/dist/index-DQmRZV3b.cjs +18 -0
  34. package/dist/index-DQmRZV3b.cjs.map +1 -0
  35. package/dist/index.cjs +2 -0
  36. package/dist/index.cjs.map +1 -0
  37. package/dist/index.d.ts +2 -0
  38. package/dist/index.js +445 -0
  39. package/dist/index.js.map +1 -0
  40. package/dist/react-lib/Root.d.ts +6 -0
  41. package/dist/react-lib/hooks/handle-socket-messages.d.ts +27 -0
  42. package/dist/react-lib/hooks/index.d.ts +6 -0
  43. package/dist/react-lib/hooks/socket.d.ts +11 -0
  44. package/dist/react-lib/hooks/socketState.d.ts +2 -0
  45. package/dist/react-lib/hooks/use-sound.d.ts +13 -0
  46. package/dist/react-lib/hooks/use-sound.test.d.ts +1 -0
  47. package/dist/react-lib/hooks/use-sync-state.test.d.ts +1 -0
  48. package/dist/react-lib/hooks/useAbstractChat.d.ts +159 -0
  49. package/dist/react-lib/hooks/useAxiosInstance.d.ts +121 -0
  50. package/dist/react-lib/hooks/useBaseClient.d.ts +2 -0
  51. package/dist/react-lib/hooks/useScrollTo.d.ts +2 -0
  52. package/dist/react-lib/hooks/useSyncState.d.ts +4 -0
  53. package/dist/react-lib/hooks/useTimeoutState.d.ts +3 -0
  54. package/dist/react-lib/hooks/useUploadFiles.d.ts +21 -0
  55. package/dist/react-lib/hooks/useVote.d.ts +2 -0
  56. package/dist/react-lib/hooks/useWidgetContentHeight.d.ts +9 -0
  57. package/dist/react-lib/index.d.ts +10 -0
  58. package/dist/react-lib/locales/ar.locale.d.ts +2 -0
  59. package/dist/react-lib/locales/de.locale.d.ts +2 -0
  60. package/dist/react-lib/locales/en.locale.d.ts +55 -0
  61. package/dist/react-lib/locales/fr.locale.d.ts +2 -0
  62. package/dist/react-lib/locales/helper.d.ts +65 -0
  63. package/dist/react-lib/locales/index.d.ts +3 -0
  64. package/dist/react-lib/locales/nl.locale.d.ts +2 -0
  65. package/dist/react-lib/locales/pt.locale.d.ts +2 -0
  66. package/dist/react-lib/providers/ChatProvider.d.ts +135 -0
  67. package/dist/react-lib/providers/ClientProvider.d.ts +7 -0
  68. package/dist/react-lib/providers/ConfigDataProvider.d.ts +62 -0
  69. package/dist/react-lib/providers/ContactProvider.d.ts +58 -0
  70. package/dist/react-lib/providers/LocalesProvider.d.ts +11 -0
  71. package/dist/react-lib/providers/componentRegistry.d.ts +13 -0
  72. package/dist/react-lib/providers/use-widget-sfx.d.ts +7 -0
  73. package/dist/react-lib/providers/usePreludeData.d.ts +2 -0
  74. package/dist/react-lib/types/components.d.ts +10 -0
  75. package/dist/react-lib/types/index.d.ts +6 -0
  76. package/dist/react-lib/types/options.d.ts +43 -0
  77. package/dist/react-lib/utils/create-safe-context.d.ts +1 -0
  78. package/dist/react-lib/utils/debug.d.ts +2 -0
  79. package/dist/react-lib/utils/getters.d.ts +24 -0
  80. package/dist/react-lib/utils/index.d.ts +1 -0
  81. package/dist/react.cjs +2 -0
  82. package/dist/react.cjs.map +1 -0
  83. package/dist/react.d.ts +2 -0
  84. package/dist/react.js +41 -0
  85. package/dist/react.js.map +1 -0
  86. package/dist/src/@components/BotMessage.d.ts +9 -0
  87. package/dist/src/@components/BotMessageWrapper.d.ts +7 -0
  88. package/dist/src/@components/ChatEvent.component.d.ts +9 -0
  89. package/dist/src/@components/Fallback.component.d.ts +8 -0
  90. package/dist/src/@components/Loading.component.d.ts +2 -0
  91. package/dist/src/@components/OpenLogoSvg.d.ts +4 -0
  92. package/dist/src/@components/Text.component.d.ts +3 -0
  93. package/dist/src/@components/index.d.ts +6 -0
  94. package/dist/src/@components/markdown.d.ts +3 -0
  95. package/dist/src/components/MotionDiv.d.ts +18 -0
  96. package/dist/src/components/RenderFile.d.ts +7 -0
  97. package/dist/src/components/avatar.d.ts +6 -0
  98. package/dist/src/components/button.d.ts +11 -0
  99. package/dist/src/components/dialog.d.ts +276 -0
  100. package/dist/src/components/dropdown-menu.d.ts +27 -0
  101. package/dist/src/components/input.d.ts +5 -0
  102. package/dist/src/components/keyboard.d.ts +7 -0
  103. package/dist/src/components/popover.d.ts +8 -0
  104. package/dist/src/components/skeleton.d.ts +3 -0
  105. package/dist/src/components/switch.d.ts +4 -0
  106. package/dist/src/components/tooltip.d.ts +10 -0
  107. package/dist/src/components/userMessage.d.ts +8 -0
  108. package/dist/src/components/wobble.d.ts +15 -0
  109. package/dist/src/designs/basic/WidgetPopoverTrigger.d.ts +5 -0
  110. package/dist/src/designs/basic/index.d.ts +5 -0
  111. package/dist/src/designs/basic/screens/chat-screen/ChatFooter.d.ts +2 -0
  112. package/dist/src/designs/basic/screens/chat-screen/ChatHeader.d.ts +2 -0
  113. package/dist/src/designs/basic/screens/chat-screen/ChatScreen.d.ts +2 -0
  114. package/dist/src/designs/basic/screens/chat-screen/SessionClosedDialog.d.ts +2 -0
  115. package/dist/src/designs/basic/screens/root-screen.d.ts +2 -0
  116. package/dist/src/designs/basic/screens/welcome-screen/WelcomeScreen.d.ts +2 -0
  117. package/dist/src/designs/constants.d.ts +15 -0
  118. package/dist/src/hooks/useShouldCollectData.d.ts +3 -0
  119. package/dist/src/index.d.ts +9 -0
  120. package/dist/src/render.d.ts +2 -0
  121. package/dist/src/utils.d.ts +2 -0
  122. package/dist/style.css +1 -0
  123. package/dist-embed/script.js +476 -0
  124. package/dist-embed/script.js.map +1 -0
  125. package/package.json +153 -0
package/package.json ADDED
@@ -0,0 +1,153 @@
1
+ {
2
+ "name": "@opencx/widget",
3
+ "private": false,
4
+ "version": "2.0.0",
5
+ "type": "module",
6
+ "publishConfig": {
7
+ "access": "public"
8
+ },
9
+ "peerDependencies": {
10
+ "lucide-react": "^0.412.0",
11
+ "react": "^18.3.1",
12
+ "rehype-raw": "^7.0.0"
13
+ },
14
+ "peerDependenciesMeta": {
15
+ "react": {
16
+ "optional": true
17
+ }
18
+ },
19
+ "optionalDependencies": {
20
+ "axios": "^1.7.5",
21
+ "socket.io-client": "^4.7.5",
22
+ "zod": "^3.23.8"
23
+ },
24
+ "dependencies": {
25
+ "@radix-ui/react-avatar": "^1.1.0",
26
+ "@radix-ui/react-dropdown-menu": "^2.1.4",
27
+ "@radix-ui/react-slot": "^1.1.0",
28
+ "@radix-ui/react-switch": "^1.1.0",
29
+ "@radix-ui/react-tooltip": "^1.1.2",
30
+ "clsx": "^2.1.1",
31
+ "date-fns": "^4.1.0",
32
+ "framer-motion": "^11.3.30",
33
+ "lodash.set": "^4.3.2",
34
+ "lucide-react": "^0.436.0",
35
+ "mutative": "^1.0.11",
36
+ "react-dropzone": "^14.3.5",
37
+ "react-hot-toast": "^2.4.1",
38
+ "tinycolor2": "^1.6.0",
39
+ "zod": "^3.23.8"
40
+ },
41
+ "overrides": {
42
+ "@opencx/widget": {
43
+ "react": {
44
+ "optional": true,
45
+ "dependencies": {
46
+ "react-hot-toast": "^2.4.1",
47
+ "react-markdown": "^9.0.1",
48
+ "framer-motion": "^11.3.30",
49
+ "date-fns": "^4.1.0"
50
+ }
51
+ }
52
+ }
53
+ },
54
+ "conditionalDependencies": {
55
+ "react": {
56
+ "react-hot-toast": "^2.4.1",
57
+ "react-markdown": "^9.0.1",
58
+ "framer-motion": "^11.3.30",
59
+ "date-fns": "^4.1.0"
60
+ }
61
+ },
62
+ "files": [
63
+ "dist",
64
+ "dist-embed"
65
+ ],
66
+ "bugs": {
67
+ "url": "https://github.com/openchatai/OpenCopilot/issues"
68
+ },
69
+ "author": {
70
+ "name": "openchatai",
71
+ "url": "https://github.com/openchatai"
72
+ },
73
+ "main": "./dist/index.js",
74
+ "module": "./dist/index.js",
75
+ "types": "./dist/index.d.ts",
76
+ "sideEffects": false,
77
+ "exports": {
78
+ ".": {
79
+ "types": "./dist/index.d.ts",
80
+ "import": "./dist/index.js",
81
+ "require": "./dist/index.cjs"
82
+ },
83
+ "./basic": {
84
+ "types": "./dist/basic.d.ts",
85
+ "import": "./dist/basic.js",
86
+ "require": "./dist/basic.cjs"
87
+ },
88
+ "./react": {
89
+ "types": "./dist/react.d.ts",
90
+ "import": "./dist/react.js",
91
+ "require": "./dist/react.cjs"
92
+ },
93
+ "./package.json": "./package.json",
94
+ "./dist/*.css": "./dist/*.css"
95
+ },
96
+ "devDependencies": {
97
+ "@biomejs/biome": "1.9.4",
98
+ "@changesets/cli": "^2.27.9",
99
+ "@radix-ui/react-popover": "^1.1.2",
100
+ "@tailwindcss/typography": "^0.5.15",
101
+ "@testing-library/dom": "^10.4.0",
102
+ "@testing-library/jest-dom": "^6.5.0",
103
+ "@testing-library/react": "^16.0.1",
104
+ "@types/lodash.debounce": "^4.0.9",
105
+ "@types/lodash.set": "^4.3.9",
106
+ "@types/node": "^20.14.8",
107
+ "@types/react": "^18.3.4",
108
+ "@types/react-dom": "^18.3.0",
109
+ "@types/tinycolor2": "^1.4.6",
110
+ "@uiw/react-iframe": "^1.0.3",
111
+ "@vitejs/plugin-react": "^4.3.4",
112
+ "autoprefixer": "^10.4.20",
113
+ "axios": "^1.7.5",
114
+ "class-variance-authority": "^0.7.0",
115
+ "jsdom": "^25.0.1",
116
+ "mutative": "^1.0.11",
117
+ "postcss": "^8.4.41",
118
+ "postcss-prefix-selector": "^1.16.1",
119
+ "react": "^18.3.1",
120
+ "react-dom": "^18.3.1",
121
+ "react-markdown": "^9.0.1",
122
+ "react-use": "^17.5.1",
123
+ "rehype-raw": "^7.0.0",
124
+ "remark-gfm": "^4.0.0",
125
+ "socket.io-client": "^4.7.5",
126
+ "swr": "^2.2.5",
127
+ "tailwind-merge": "^2.4.0",
128
+ "tailwindcss": "^3.4.6",
129
+ "tailwindcss-animate": "^1.0.7",
130
+ "typescript": "^5.5.4",
131
+ "vite": "^5.4.2",
132
+ "vite-plugin-dts": "4.0.3",
133
+ "vite-plugin-externalize-deps": "^0.8.0",
134
+ "vite-tsconfig-paths": "^5.0.1",
135
+ "vitest": "^2.0.5"
136
+ },
137
+ "scripts": {
138
+ "clean": "rm -rf ./dist ./dist-embed",
139
+ "clean:dist": "rm -rf ./dist ./dist-embed",
140
+ "build:lib": "vite build",
141
+ "dev": "vite -c vite.config.ts",
142
+ "build:embed": "vite build -c vite.embed.config.ts",
143
+ "test": "vitest run",
144
+ "batman": "pnpm build:lib && pnpm build:embed",
145
+ "test:watch": "vitest --watch",
146
+ "cs": "changeset",
147
+ "csv": "changeset version",
148
+ "csp": "changeset publish",
149
+ "type-check": "tsc --noEmit",
150
+ "lint": "biome lint --fix",
151
+ "format": "biome format --fix"
152
+ }
153
+ }