@opencx/widget 3.0.99 → 4.0.17

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 (146) hide show
  1. package/README.md +3 -73
  2. package/dist-embed/script.js +151 -194
  3. package/dist-embed/script.js.map +1 -1
  4. package/package.json +11 -173
  5. package/dist/designs.cjs +0 -79
  6. package/dist/designs.cjs.map +0 -1
  7. package/dist/designs.d.ts +0 -2
  8. package/dist/designs.js +0 -17770
  9. package/dist/designs.js.map +0 -1
  10. package/dist/index.cjs +0 -2
  11. package/dist/index.cjs.map +0 -1
  12. package/dist/index.d.ts +0 -2
  13. package/dist/index.js +0 -8
  14. package/dist/index.js.map +0 -1
  15. package/dist/is-exhaustive-9o43S91P.cjs +0 -2
  16. package/dist/is-exhaustive-9o43S91P.cjs.map +0 -1
  17. package/dist/is-exhaustive-DGJzQK69.js +0 -7
  18. package/dist/is-exhaustive-DGJzQK69.js.map +0 -1
  19. package/dist/react.cjs +0 -2
  20. package/dist/react.cjs.map +0 -1
  21. package/dist/react.d.ts +0 -2
  22. package/dist/react.js +0 -34
  23. package/dist/react.js.map +0 -1
  24. package/dist/src/designs/react/WidgetPopoverAnchor.d.ts +0 -2
  25. package/dist/src/designs/react/WidgetPopoverContent.d.ts +0 -3
  26. package/dist/src/designs/react/WidgetPopoverTrigger.d.ts +0 -3
  27. package/dist/src/designs/react/components/AgentOrBotAvatar.d.ts +0 -6
  28. package/dist/src/designs/react/components/AttachmentPreview.d.ts +0 -7
  29. package/dist/src/designs/react/components/BotOrAgentMessage.d.ts +0 -7
  30. package/dist/src/designs/react/components/BotOrAgentMessageGroup.d.ts +0 -7
  31. package/dist/src/designs/react/components/Header.d.ts +0 -3
  32. package/dist/src/designs/react/components/MightSolveUserIssueSuggestedReplies.d.ts +0 -2
  33. package/dist/src/designs/react/components/PoweredByOpen.d.ts +0 -4
  34. package/dist/src/designs/react/components/SuggestedReplyButton.d.ts +0 -5
  35. package/dist/src/designs/react/components/UserMessage.d.ts +0 -8
  36. package/dist/src/designs/react/components/UserMessageGroup.d.ts +0 -5
  37. package/dist/src/designs/react/components/VoteButtons.d.ts +0 -8
  38. package/dist/src/designs/react/components/custom-components/BotOrAgentTextResponse.component.d.ts +0 -16
  39. package/dist/src/designs/react/components/custom-components/Fallback.component.d.ts +0 -6
  40. package/dist/src/designs/react/components/custom-components/Handoff.component.d.ts +0 -3
  41. package/dist/src/designs/react/components/custom-components/Loading.component.d.ts +0 -6
  42. package/dist/src/designs/react/components/lib/DynamicIcon.d.ts +0 -6
  43. package/dist/src/designs/react/components/lib/LoadingSpinner.d.ts +0 -4
  44. package/dist/src/designs/react/components/lib/MotionDiv.d.ts +0 -19
  45. package/dist/src/designs/react/components/lib/avatar.d.ts +0 -6
  46. package/dist/src/designs/react/components/lib/button.d.ts +0 -11
  47. package/dist/src/designs/react/components/lib/dialog.d.ts +0 -24
  48. package/dist/src/designs/react/components/lib/dropdown-menu.d.ts +0 -27
  49. package/dist/src/designs/react/components/lib/input.d.ts +0 -4
  50. package/dist/src/designs/react/components/lib/popover.d.ts +0 -8
  51. package/dist/src/designs/react/components/lib/skeleton.d.ts +0 -3
  52. package/dist/src/designs/react/components/lib/switch.d.ts +0 -4
  53. package/dist/src/designs/react/components/lib/tooltip.d.ts +0 -10
  54. package/dist/src/designs/react/components/lib/utils/cn.d.ts +0 -2
  55. package/dist/src/designs/react/components/lib/widget-portal.d.ts +0 -9
  56. package/dist/src/designs/react/components/lib/wobble.d.ts +0 -26
  57. package/dist/src/designs/react/components/markdown.d.ts +0 -3
  58. package/dist/src/designs/react/components/svg/ChatBubbleSvg.d.ts +0 -5
  59. package/dist/src/designs/react/components/svg/OpenLogoSvg.d.ts +0 -4
  60. package/dist/src/designs/react/hooks/useCanvas.d.ts +0 -3
  61. package/dist/src/designs/react/hooks/useIsSmallScreen.d.ts +0 -3
  62. package/dist/src/designs/react/hooks/useLocale.d.ts +0 -6
  63. package/dist/src/designs/react/hooks/useSetWidgetSize.d.ts +0 -8
  64. package/dist/src/designs/react/hooks/useTheme.d.ts +0 -62
  65. package/dist/src/designs/react/hooks/useWidgetContentHeight.d.ts +0 -3
  66. package/dist/src/designs/react/index.d.ts +0 -9
  67. package/dist/src/designs/react/screens/chat/ChatCanvas.d.ts +0 -2
  68. package/dist/src/designs/react/screens/chat/ChatFooter.d.ts +0 -2
  69. package/dist/src/designs/react/screens/chat/ChatMain.d.ts +0 -2
  70. package/dist/src/designs/react/screens/chat/index.d.ts +0 -2
  71. package/dist/src/designs/react/screens/index.d.ts +0 -2
  72. package/dist/src/designs/react/screens/sessions/index.d.ts +0 -2
  73. package/dist/src/designs/react/screens/welcome/index.d.ts +0 -2
  74. package/dist/src/designs/react/utils/data-component.d.ts +0 -7
  75. package/dist/src/designs/react/utils/group-messages-by-type.d.ts +0 -5
  76. package/dist/src/designs/translation/ar.locale.d.ts +0 -2
  77. package/dist/src/designs/translation/de.locale.d.ts +0 -2
  78. package/dist/src/designs/translation/en.locale.d.ts +0 -2
  79. package/dist/src/designs/translation/es.locale.d.ts +0 -2
  80. package/dist/src/designs/translation/fr.locale.d.ts +0 -2
  81. package/dist/src/designs/translation/index.d.ts +0 -16
  82. package/dist/src/designs/translation/nl.locale.d.ts +0 -2
  83. package/dist/src/designs/translation/pt.locale.d.ts +0 -2
  84. package/dist/src/designs/translation/tr.locale.d.ts +0 -2
  85. package/dist/src/designs/translation/translation.types.d.ts +0 -4
  86. package/dist/src/embedded/index.d.ts +0 -11
  87. package/dist/src/headless/core/__tests__/api-caller.mock.d.ts +0 -1
  88. package/dist/src/headless/core/__tests__/context/contact/auth/auto-create-unverified-anonymous.spec.d.ts +0 -0
  89. package/dist/src/headless/core/__tests__/context/contact/auth/auto-create-unverified-with-user-data-provided-by-org.spec.d.ts +0 -0
  90. package/dist/src/headless/core/__tests__/context/contact/auth/manually-create-unverified-with-user-data-provided-by-user.spec.d.ts +0 -0
  91. package/dist/src/headless/core/__tests__/context/contact/auth/with-secure-token.spec.d.ts +0 -0
  92. package/dist/src/headless/core/__tests__/context/contact/should-collect-data.spec.d.ts +0 -0
  93. package/dist/src/headless/core/__tests__/test-utils.d.ts +0 -419
  94. package/dist/src/headless/core/__tests__/utils/Poller.spec.d.ts +0 -1
  95. package/dist/src/headless/core/__tests__/utils/PrimitiveState.spec.d.ts +0 -1
  96. package/dist/src/headless/core/__tests__/utils/uuid.spec.d.ts +0 -1
  97. package/dist/src/headless/core/api/api-caller.d.ts +0 -437
  98. package/dist/src/headless/core/api/client.d.ts +0 -12
  99. package/dist/src/headless/core/api/schema.d.ts +0 -928
  100. package/dist/src/headless/core/context/active-session-polling.ctx.d.ts +0 -25
  101. package/dist/src/headless/core/context/contact.ctx.d.ts +0 -30
  102. package/dist/src/headless/core/context/message.ctx.d.ts +0 -38
  103. package/dist/src/headless/core/context/router.ctx.d.ts +0 -33
  104. package/dist/src/headless/core/context/session.ctx.d.ts +0 -119
  105. package/dist/src/headless/core/context/storage.ctx.d.ts +0 -15
  106. package/dist/src/headless/core/context/widget.ctx.d.ts +0 -27
  107. package/dist/src/headless/core/index.d.ts +0 -15
  108. package/dist/src/headless/core/types/agent-or-bot.d.ts +0 -6
  109. package/dist/src/headless/core/types/component-name.d.ts +0 -1
  110. package/dist/src/headless/core/types/dtos.d.ts +0 -12
  111. package/dist/src/headless/core/types/external-storage.d.ts +0 -5
  112. package/dist/src/headless/core/types/helpers.d.ts +0 -2
  113. package/dist/src/headless/core/types/icons.d.ts +0 -3
  114. package/dist/src/headless/core/types/json-value.d.ts +0 -7
  115. package/dist/src/headless/core/types/messages.d.ts +0 -55
  116. package/dist/src/headless/core/types/widget-config.d.ts +0 -400
  117. package/dist/src/headless/core/utils/Poller.d.ts +0 -12
  118. package/dist/src/headless/core/utils/PrimitiveState.d.ts +0 -13
  119. package/dist/src/headless/core/utils/is-exhaustive.d.ts +0 -1
  120. package/dist/src/headless/core/utils/run-catching.d.ts +0 -13
  121. package/dist/src/headless/core/utils/uuid.d.ts +0 -1
  122. package/dist/src/headless/react/ComponentRegistry.d.ts +0 -10
  123. package/dist/src/headless/react/WidgetProvider.d.ts +0 -25
  124. package/dist/src/headless/react/hooks/useConfig.d.ts +0 -1
  125. package/dist/src/headless/react/hooks/useContact.d.ts +0 -12
  126. package/dist/src/headless/react/hooks/useDocumentDir.d.ts +0 -3
  127. package/dist/src/headless/react/hooks/useIsAwaitingBotReply.d.ts +0 -3
  128. package/dist/src/headless/react/hooks/useMessages.d.ts +0 -14
  129. package/dist/src/headless/react/hooks/useModes.d.ts +0 -15
  130. package/dist/src/headless/react/hooks/usePreludeData.d.ts +0 -38
  131. package/dist/src/headless/react/hooks/usePrimitiveState.d.ts +0 -2
  132. package/dist/src/headless/react/hooks/useSessions.d.ts +0 -104
  133. package/dist/src/headless/react/hooks/useUploadFiles.d.ts +0 -21
  134. package/dist/src/headless/react/hooks/useVote.d.ts +0 -18
  135. package/dist/src/headless/react/hooks/useWidgetRouter.d.ts +0 -7
  136. package/dist/src/headless/react/hooks/useWidgetTrigger.d.ts +0 -10
  137. package/dist/src/headless/react/index.d.ts +0 -14
  138. package/dist/src/headless/react/types/components.d.ts +0 -7
  139. package/dist/useModes-CtIywY2i.cjs +0 -2
  140. package/dist/useModes-CtIywY2i.cjs.map +0 -1
  141. package/dist/useModes-GTENcGQD.js +0 -259
  142. package/dist/useModes-GTENcGQD.js.map +0 -1
  143. package/dist/widget.ctx-B-jCTG4Y.js +0 -698
  144. package/dist/widget.ctx-B-jCTG4Y.js.map +0 -1
  145. package/dist/widget.ctx-XvIjOOOZ.cjs +0 -5
  146. package/dist/widget.ctx-XvIjOOOZ.cjs.map +0 -1
package/package.json CHANGED
@@ -1,202 +1,40 @@
1
1
  {
2
2
  "name": "@opencx/widget",
3
3
  "private": false,
4
- "version": "3.0.99",
4
+ "version": "4.0.17",
5
5
  "type": "module",
6
- "publishConfig": {
7
- "access": "public"
8
- },
9
6
  "repository": {
10
7
  "type": "git",
11
8
  "url": "https://github.com/openchatai/widget"
12
9
  },
13
- "bugs": {
14
- "url": "https://github.com/openchatai/widget/issues"
15
- },
16
- "author": {
17
- "name": "openchatai",
18
- "url": "https://github.com/openchatai"
19
- },
20
10
  "files": [
21
- "dist",
22
11
  "dist-embed"
23
12
  ],
24
- "sideEffects": false,
25
- "exports": {
26
- ".": {
27
- "types": "./dist/index.d.ts",
28
- "import": "./dist/index.js",
29
- "require": "./dist/index.cjs"
30
- },
31
- "./react": {
32
- "types": "./dist/react.d.ts",
33
- "import": "./dist/react.js",
34
- "require": "./dist/react.cjs"
35
- },
36
- "./designs": {
37
- "types": "./dist/designs.d.ts",
38
- "import": "./dist/designs.js",
39
- "require": "./dist/designs.cjs"
40
- }
41
- },
42
13
  "dependencies": {
43
- "lodash.isequal": "^4.5.0",
44
- "openapi-fetch": "^0.13.4",
45
- "uuid": "^11.0.4"
14
+ "@opencx/widget-core": "4.0.17",
15
+ "@opencx/widget-react": "4.0.17"
46
16
  },
47
17
  "peerDependencies": {
48
18
  "@types/react": ">=18 <20",
49
19
  "@types/react-dom": ">=18 <20",
50
20
  "react": ">=18 <20",
51
- "react-dom": ">=18 <20",
52
- "@radix-ui/react-avatar": "^1.1.0",
53
- "@radix-ui/react-dialog": "^1.1.5",
54
- "@radix-ui/react-dropdown-menu": "^2.1.4",
55
- "@radix-ui/react-popover": "^1.1.2",
56
- "@radix-ui/react-slot": "^1.1.0",
57
- "@radix-ui/react-switch": "^1.1.0",
58
- "@radix-ui/react-tooltip": "^1.1.2",
59
- "clsx": "^2.1.1",
60
- "framer-motion": "^11.3.30",
61
- "lucide-react": "^0.436.0",
62
- "react-dropzone": "^14.3.5",
63
- "tinycolor2": "^1.6.0",
64
- "zod": "^3.23.8",
65
- "react-markdown": "^9.0.1",
66
- "react-use": "^17.5.1",
67
- "rehype-raw": "^7.0.0",
68
- "remark-gfm": "^4.0.0",
69
- "swr": "^2.2.5",
70
- "tailwind-merge": "^2.4.0",
71
- "class-variance-authority": "^0.7.0",
72
- "@uiw/react-iframe": "^1.0.3"
73
- },
74
- "peerDependenciesMeta": {
75
- "@types/react": {
76
- "optional": true
77
- },
78
- "@types/react-dom": {
79
- "optional": true
80
- },
81
- "react": {
82
- "optional": true
83
- },
84
- "react-dom": {
85
- "optional": true
86
- },
87
- "@radix-ui/react-avatar": {
88
- "optional": true
89
- },
90
- "@radix-ui/react-dialog": {
91
- "optional": true
92
- },
93
- "@radix-ui/react-dropdown-menu": {
94
- "optional": true
95
- },
96
- "@radix-ui/react-popover": {
97
- "optional": true
98
- },
99
- "@radix-ui/react-slot": {
100
- "optional": true
101
- },
102
- "@radix-ui/react-switch": {
103
- "optional": true
104
- },
105
- "@radix-ui/react-tooltip": {
106
- "optional": true
107
- },
108
- "clsx": {
109
- "optional": true
110
- },
111
- "framer-motion": {
112
- "optional": true
113
- },
114
- "lucide-react": {
115
- "optional": true
116
- },
117
- "react-dropzone": {
118
- "optional": true
119
- },
120
- "tinycolor2": {
121
- "optional": true
122
- },
123
- "zod": {
124
- "optional": true
125
- },
126
- "react-markdown": {
127
- "optional": true
128
- },
129
- "react-use": {
130
- "optional": true
131
- },
132
- "rehype-raw": {
133
- "optional": true
134
- },
135
- "remark-gfm": {
136
- "optional": true
137
- },
138
- "swr": {
139
- "optional": true
140
- },
141
- "tailwind-merge": {
142
- "optional": true
143
- },
144
- "class-variance-authority": {
145
- "optional": true
146
- },
147
- "@uiw/react-iframe": {
148
- "optional": true
149
- }
21
+ "react-dom": ">=18 <20"
150
22
  },
151
23
  "devDependencies": {
152
- "@changesets/cli": "^2.27.9",
153
- "@eslint/eslintrc": "^3.3.1",
154
- "@eslint/js": "^9.23.0",
155
- "@tailwindcss/typography": "^0.5.15",
156
- "@types/lodash.isequal": "^4.5.8",
157
- "@types/node": "^20.14.8",
158
- "@types/tinycolor2": "^1.4.6",
159
- "@typescript-eslint/eslint-plugin": "^8.29.0",
160
- "@typescript-eslint/parser": "^8.29.0",
161
- "@vitejs/plugin-react": "^4.3.4",
162
- "tailwindcss": "^3.4.6",
163
- "tailwindcss-animate": "^1.0.7",
164
- "eslint": "^9.23.0",
165
- "eslint-config-prettier": "^10.1.1",
166
- "eslint-plugin-prettier": "^5.2.6",
167
- "eslint-plugin-react": "^7.37.5",
168
- "eslint-plugin-react-hooks": "^5.2.0",
169
- "eslint-plugin-unused-imports": "^4.1.4",
170
- "eslint-plugin-vitest": "^0.5.4",
171
- "globals": "^16.0.0",
172
- "jsdom": "^25.0.1",
173
- "lucide": "^0.525.0",
174
- "postcss": "^8.4.41",
175
- "prettier": "^3.5.3",
176
- "openapi-typescript": "^7.5.2",
177
- "typescript": "^5.5.4",
178
- "vite": "^5.4.2",
179
- "vite-plugin-dts": "4.0.3",
180
- "vite-plugin-externalize-deps": "^0.8.0",
181
- "vite-tsconfig-paths": "^5.0.1",
182
- "vitest": "^3.0.2"
24
+ "@opencx/eslint-config": "0.0.0",
25
+ "@opencx/tsconfig": "0.0.1"
183
26
  },
184
27
  "scripts": {
185
- "clean": "rm -rf ./dist ./dist-embed",
186
- "clean:dist": "rm -rf ./dist ./dist-embed",
187
- "dev": "vite -c vite.config.ts --host",
188
- "build:lib": "vite build -c vite.config.ts",
189
- "build:embed": "vite build -c vite.embed.config.ts",
190
- "gen:sdk": "pnpm dlx openapi-typescript http://localhost:8080/widget-api-yaml -o ./src/headless/core/api/schema.ts && prettier --write ./src/headless/core/api/schema.ts",
28
+ "clean": "rm -rf node_modules dist-embed .turbo",
29
+ "clean:dist": "rm -rf dist-embed .turbo",
30
+ "dev": "vite --host",
31
+ "build": "vite build -c vite.config.ts",
191
32
  "test": "vitest run",
192
- "test:watch": "vitest --watch",
193
33
  "cs": "changeset",
194
34
  "csv": "changeset version",
195
35
  "csp": "changeset publish",
196
36
  "type-check": "tsc --noEmit",
197
37
  "lint": "eslint .",
198
- "format": "prettier --write .",
199
- "batman": "pnpm tsc && pnpm build:lib && pnpm build:embed",
200
- "test:browser": "vitest --workspace=vitest.workspace.ts"
38
+ "format": "prettier --write ."
201
39
  }
202
40
  }