@bigbinary/neeto-assist-frontend 0.0.0-stage → 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 (66) hide show
  1. package/README.md +243 -2
  2. package/app/javascript/src/translations/ar.json +78 -0
  3. package/app/javascript/src/translations/bg.json +78 -0
  4. package/app/javascript/src/translations/ca.json +78 -0
  5. package/app/javascript/src/translations/cs.json +78 -0
  6. package/app/javascript/src/translations/da.json +78 -0
  7. package/app/javascript/src/translations/de.json +78 -0
  8. package/app/javascript/src/translations/en.json +75 -0
  9. package/app/javascript/src/translations/es-MX.json +78 -0
  10. package/app/javascript/src/translations/es.json +78 -0
  11. package/app/javascript/src/translations/et.json +78 -0
  12. package/app/javascript/src/translations/fi.json +78 -0
  13. package/app/javascript/src/translations/fil.json +78 -0
  14. package/app/javascript/src/translations/fr.json +78 -0
  15. package/app/javascript/src/translations/he.json +78 -0
  16. package/app/javascript/src/translations/hi.json +78 -0
  17. package/app/javascript/src/translations/hr.json +78 -0
  18. package/app/javascript/src/translations/hu.json +78 -0
  19. package/app/javascript/src/translations/id.json +78 -0
  20. package/app/javascript/src/translations/index.js +3 -0
  21. package/app/javascript/src/translations/it.json +78 -0
  22. package/app/javascript/src/translations/ja.json +78 -0
  23. package/app/javascript/src/translations/ko.json +78 -0
  24. package/app/javascript/src/translations/lv.json +75 -0
  25. package/app/javascript/src/translations/nl.json +78 -0
  26. package/app/javascript/src/translations/pl.json +78 -0
  27. package/app/javascript/src/translations/pt-BR.json +78 -0
  28. package/app/javascript/src/translations/pt.json +78 -0
  29. package/app/javascript/src/translations/ro.json +78 -0
  30. package/app/javascript/src/translations/ru.json +78 -0
  31. package/app/javascript/src/translations/sk.json +78 -0
  32. package/app/javascript/src/translations/sl.json +78 -0
  33. package/app/javascript/src/translations/sv.json +78 -0
  34. package/app/javascript/src/translations/th.json +78 -0
  35. package/app/javascript/src/translations/tr.json +78 -0
  36. package/app/javascript/src/translations/uk.json +78 -0
  37. package/app/javascript/src/translations/vi.json +78 -0
  38. package/app/javascript/src/translations/zh-CN.json +78 -0
  39. package/app/javascript/src/translations/zh-TW.json +78 -0
  40. package/dist/.ready +1 -0
  41. package/dist/NeetoAssistButton.js +98 -0
  42. package/dist/NeetoAssistButton.js.map +1 -0
  43. package/dist/NeetoAssistPane.js +975 -0
  44. package/dist/NeetoAssistPane.js.map +1 -0
  45. package/dist/cjs/NeetoAssistButton.js +100 -0
  46. package/dist/cjs/NeetoAssistButton.js.map +1 -0
  47. package/dist/cjs/NeetoAssistPane.js +977 -0
  48. package/dist/cjs/NeetoAssistPane.js.map +1 -0
  49. package/dist/cjs/index.js +30 -0
  50. package/dist/cjs/index.js.map +1 -0
  51. package/dist/cjs/useNeetoAssistStatus.js +18 -0
  52. package/dist/cjs/useNeetoAssistStatus.js.map +1 -0
  53. package/dist/index.js +22 -0
  54. package/dist/index.js.map +1 -0
  55. package/dist/neeto_assist-BbwXxKis.js +121 -0
  56. package/dist/neeto_assist-BbwXxKis.js.map +1 -0
  57. package/dist/neeto_assist-Ha049T0Q.js +102 -0
  58. package/dist/neeto_assist-Ha049T0Q.js.map +1 -0
  59. package/dist/useNeetoAssistStatus.js +16 -0
  60. package/dist/useNeetoAssistStatus.js.map +1 -0
  61. package/dist/useNeetoAssistStore-B5U7FFgQ.js +218 -0
  62. package/dist/useNeetoAssistStore-B5U7FFgQ.js.map +1 -0
  63. package/dist/useNeetoAssistStore-C4fEnA_y.js +232 -0
  64. package/dist/useNeetoAssistStore-C4fEnA_y.js.map +1 -0
  65. package/package.json +231 -4
  66. package/types.d.ts +53 -0
package/package.json CHANGED
@@ -1,6 +1,233 @@
1
1
  {
2
2
  "name": "@bigbinary/neeto-assist-frontend",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "1.0.2",
4
+ "description": "NeetoAssist pane and helpers for Neeto products",
5
+ "license": "UNLICENSED",
6
+ "homepage": "https://github.com/bigbinary/neeto-assist-nano",
7
+ "bugs": {
8
+ "url": "https://github.com/bigbinary/neeto-assist-nano/issues"
9
+ },
10
+ "repository": "neeto-assist-nano",
11
+ "author": "BigBinary",
12
+ "files": [
13
+ "dist",
14
+ "types.d.ts",
15
+ "app/javascript/src/translations"
16
+ ],
17
+ "exports": {
18
+ ".": {
19
+ "import": "./dist/index.js",
20
+ "require": "./dist/cjs/index.js",
21
+ "types": "./types.d.ts"
22
+ },
23
+ "./*": {
24
+ "import": "./dist/*.js",
25
+ "require": "./dist/cjs/*.js",
26
+ "types": "./types.d.ts"
27
+ }
28
+ },
29
+ "main": "dist/index.cjs.js",
30
+ "module": "dist/index.js",
31
+ "types": "types.d.ts",
32
+ "scripts": {
33
+ "build": "NODE_ENV=production rollup --bundleConfigAsCjs -c --environment production",
34
+ "build-preview": "NODE_ENV=production webpack",
35
+ "prepare": "husky install",
36
+ "release": "yarn build && yalc push --sig",
37
+ "test": "node --import ./test/javascript/setup.mjs --test test/javascript/*.test.mjs"
38
+ },
39
+ "lint-staged": {
40
+ "./**/*.rb": [
41
+ "bundle exec rubocop -a --force-exclusion"
42
+ ],
43
+ "./**/app/javascript/**/*.{js,jsx,json}": [
44
+ "prettier --write",
45
+ "eslint --fix"
46
+ ],
47
+ "./test/dummy/**/app/javascript/**/*.{js,jsx,json}": [
48
+ "prettier --write",
49
+ "eslint --fix"
50
+ ],
51
+ "{Gemfile,Rakefile,config.ru}": [
52
+ "bundle exec rubocop -a --force-exclusion"
53
+ ]
54
+ },
55
+ "devDependencies": {
56
+ "@babel/core": "7.29.7",
57
+ "@babel/eslint-parser": "7.25.9",
58
+ "@babel/plugin-transform-runtime": "7.25.9",
59
+ "@babel/preset-env": "7.26.0",
60
+ "@babel/preset-react": "7.25.9",
61
+ "@babel/preset-typescript": "7.26.0",
62
+ "@babel/runtime": "7.29.7",
63
+ "@bigbinary/babel-preset-neeto": "^1.0.3",
64
+ "@bigbinary/eslint-plugin-neeto": "1.9.1",
65
+ "@bigbinary/neeto-atoms": "1.1.2",
66
+ "@bigbinary/neeto-cist": "1.0.17",
67
+ "@bigbinary/neeto-commons-frontend": "4.14.8",
68
+ "@bigbinary/neeto-filters-frontend": "4.6.3",
69
+ "@emotion/is-prop-valid": "1.2.0",
70
+ "@faker-js/faker": "8.2.0",
71
+ "@honeybadger-io/js": "6.10.1",
72
+ "@honeybadger-io/react": "6.1.25",
73
+ "@rollup/plugin-alias": "5.1.1",
74
+ "@rollup/plugin-babel": "6.1.0",
75
+ "@rollup/plugin-commonjs": "25.0.8",
76
+ "@rollup/plugin-json": "6.1.0",
77
+ "@rollup/plugin-node-resolve": "15.3.0",
78
+ "@rollup/plugin-replace": "5.0.4",
79
+ "@svgr/rollup": "8.1.0",
80
+ "@tailwindcss/postcss": "^4.1.17",
81
+ "@tanstack/react-query": "5.59.20",
82
+ "@tanstack/react-query-devtools": "5.59.20",
83
+ "antd": "5.22.1",
84
+ "autoprefixer": "^10.4.5",
85
+ "axios": "1.20.0",
86
+ "babel-loader": "^8.2.5",
87
+ "babel-plugin-istanbul": "^6.1.1",
88
+ "babel-plugin-js-logger": "1.0.17",
89
+ "babel-plugin-macros": "3.1.0",
90
+ "babel-plugin-module-resolver": "5.0.3",
91
+ "babel-plugin-preval": "^5.1.0",
92
+ "babel-plugin-transform-react-remove-prop-types": "0.4.24",
93
+ "babel-preset-react": "6.24.1",
94
+ "babel-preset-typescript": "^7.0.0-alpha.19",
95
+ "browserify-zlib": "0.2.0",
96
+ "buffer": "^6.0.3",
97
+ "classnames": "2.5.1",
98
+ "crypto-browserify": "3.12.1",
99
+ "css-loader": "6.8.1",
100
+ "dompurify": "3.4.17",
101
+ "dotenv-webpack": "^8.0.1",
102
+ "eslint": "^9.25.1",
103
+ "eslint-config-prettier": "^10.1.2",
104
+ "eslint-plugin-cypress": "2.12.1",
105
+ "eslint-plugin-import": "^2.31.0",
106
+ "eslint-plugin-jam3": "^0.2.3",
107
+ "eslint-plugin-json": "^4.0.1",
108
+ "eslint-plugin-prettier": "^5.2.6",
109
+ "eslint-plugin-promise": "^7.2.1",
110
+ "eslint-plugin-react": "^7.37.5",
111
+ "eslint-plugin-react-hooks": "^5.2.0",
112
+ "eslint-plugin-security": "^3.0.1",
113
+ "eslint-plugin-sonarjs": "^4.0.2",
114
+ "eslint-plugin-unused-imports": "^4.1.4",
115
+ "eslint-plugin-xss": "^0.1.12",
116
+ "formik": "2.4.6",
117
+ "globals": "16.0.0",
118
+ "globby": "^14.1.0",
119
+ "html-webpack-plugin": "5.5.3",
120
+ "https-browserify": "1.0.0",
121
+ "husky": "7.0.4",
122
+ "i18next": "22.5.1",
123
+ "i18next-browser-languagedetector": "7.0.1",
124
+ "js-logger": "1.6.1",
125
+ "lint-staged": "12.4.1",
126
+ "lucide-react": "1.25.0",
127
+ "mini-css-extract-plugin": "2.7.6",
128
+ "mixpanel-browser": "2.47.0",
129
+ "os-browserify": "0.3.0",
130
+ "path-browserify": "^1.0.1",
131
+ "postcss": "8.5.29",
132
+ "postcss-import": "^15.0.0",
133
+ "postcss-loader": "^7.0.1",
134
+ "postcss-preset-env": "7.8.2",
135
+ "prettier": "3",
136
+ "prettier-plugin-tailwindcss": "^0.7.1",
137
+ "process": "0.11.10",
138
+ "qs": "6.16.2",
139
+ "ramda": "0.29.0",
140
+ "react": "18.3.1",
141
+ "react-dom": "18.3.1",
142
+ "react-helmet": "^6.1.0",
143
+ "react-i18next": "12.3.1",
144
+ "react-router-dom": "5.3.3",
145
+ "react-toastify": "8.0.2",
146
+ "rollup": "4.59.0",
147
+ "rollup-plugin-analyzer": "4.0.0",
148
+ "rollup-plugin-cleaner": "1.0.0",
149
+ "rollup-plugin-copy": "3.5.0",
150
+ "rollup-plugin-peer-deps-external": "2.2.4",
151
+ "rollup-plugin-styles": "4.0.0",
152
+ "sass": "1.98.0",
153
+ "sass-loader": "^13.0.2",
154
+ "source-map-loader": "4.0.1",
155
+ "stream-browserify": "^3.0.0",
156
+ "stream-http": "3.2.0",
157
+ "style-loader": "^3.3.1",
158
+ "tailwindcss": "^4.1.17",
159
+ "tty-browserify": "0.0.1",
160
+ "url": "0.11.4",
161
+ "util": "^0.12.5",
162
+ "vm-browserify": "1.1.2",
163
+ "webpack": "5.104.1",
164
+ "webpack-assets-manifest": "5.1.0",
165
+ "webpack-cli": "5.1.4",
166
+ "webpack-dev-server": "5.2.6",
167
+ "yup": "0.32.11",
168
+ "zustand": "4.4.2"
169
+ },
170
+ "peerDependencies": {
171
+ "@babel/runtime": "7.29.7",
172
+ "@bigbinary/neeto-atoms": "1.1.2",
173
+ "@bigbinary/neeto-cist": "1.0.17",
174
+ "@bigbinary/neeto-commons-frontend": "4.14.8",
175
+ "@bigbinary/neeto-filters-frontend": "4.6.3",
176
+ "@honeybadger-io/js": "6.10.1",
177
+ "@honeybadger-io/react": "6.1.25",
178
+ "@tanstack/react-query": "5.59.20",
179
+ "@tanstack/react-query-devtools": "5.59.20",
180
+ "antd": "5.22.1",
181
+ "axios": "1.20.0",
182
+ "buffer": "^6.0.3",
183
+ "classnames": "2.5.1",
184
+ "crypto-browserify": "3.12.1",
185
+ "dompurify": "3.4.17",
186
+ "formik": "2.4.6",
187
+ "https-browserify": "1.0.0",
188
+ "i18next": "22.5.1",
189
+ "js-logger": "1.6.1",
190
+ "lucide-react": "^1.8.0",
191
+ "mixpanel-browser": "2.45.0",
192
+ "os-browserify": "0.3.0",
193
+ "path-browserify": "^1.0.1",
194
+ "qs": "6.16.2",
195
+ "ramda": "0.29.0",
196
+ "react": "18.3.1",
197
+ "react-dom": "18.3.1",
198
+ "react-helmet": "^6.1.0",
199
+ "react-i18next": "12.3.1",
200
+ "react-router-dom": "5.3.3",
201
+ "react-toastify": "8.0.2",
202
+ "source-map-loader": "4.0.1",
203
+ "stream-browserify": "^3.0.0",
204
+ "stream-http": "3.2.0",
205
+ "tailwindcss": "4.1.17",
206
+ "tty-browserify": "0.0.1",
207
+ "url": "0.11.4",
208
+ "util": "^0.12.5",
209
+ "vm-browserify": "1.1.2",
210
+ "yup": "0.32.11",
211
+ "zustand": "4.4.2"
212
+ },
213
+ "resolutions": {
214
+ "postcss": "^8",
215
+ "wrap-ansi": "7.0.0",
216
+ "string-width": "4.1.0",
217
+ "pbkdf2": "^3.1.3",
218
+ "sha.js": "^2.4.12",
219
+ "node-forge": "^1.3.2",
220
+ "qs": "6.14.2"
221
+ },
222
+ "engines": {
223
+ "node": ">=22.13",
224
+ "npm": ">=9",
225
+ "yarn": ">=1.22"
226
+ },
227
+ "dependencies": {
228
+ "@babel/plugin-syntax-dynamic-import": "^7.8.3",
229
+ "babel-plugin-transform-imports": "^2.0.0",
230
+ "react-router-nav-prompt": "0.4.1"
231
+ },
232
+ "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
233
+ }
package/types.d.ts ADDED
@@ -0,0 +1,53 @@
1
+ import React from "react";
2
+
3
+ import { UseQueryResult } from "@tanstack/react-query";
4
+
5
+ export interface NeetoAssistButtonProps {
6
+ /**
7
+ * The host's own id for the conversation. The pane calls
8
+ * `/neeto_assist/api/v1/conversations/:conversationId/runs`, and the engine
9
+ * looks it up through the host adapter's `find_conversation`.
10
+ */
11
+ conversationId: string;
12
+ /**
13
+ * Called when the rep clicks "Use reply". Put the reply in the composer and
14
+ * send nothing: NeetoAssist never writes to the customer. Leave it out to
15
+ * show only "Copy".
16
+ *
17
+ * @param text The reply as NeetoAssist wrote it, in light markdown
18
+ * (paragraphs, `**bold**`, `1.` and `-` lists, `## ` headings).
19
+ * @param html The same reply as HTML for a rich-text composer: escaped text
20
+ * inside only `p`, `br`, `strong`, `ol`, `ul`, `li` and `h2`, with no
21
+ * attributes, so no markup from the conversation survives as HTML.
22
+ */
23
+ onUseReply?: (text: string, html: string) => void;
24
+ }
25
+
26
+ /**
27
+ * "Ask NeetoAssist", for the ticket's header. It opens the pane and tells it
28
+ * which ticket it is about for as long as the button is on screen. A dot says a
29
+ * suggested reply is waiting. Render it only for a rep who may use NeetoAssist.
30
+ * It needs the host's React Query client (neeto-commons-frontend's
31
+ * `AppContainer` provides one) and axios set up by neeto-commons-frontend.
32
+ */
33
+ export const NeetoAssistButton: React.FC<NeetoAssistButtonProps>;
34
+
35
+ /**
36
+ * NeetoAssist's chat window. Mount it once in the host's layout, as the last
37
+ * child of the flex row that holds the page, so it opens on the right and
38
+ * pushes the page to the left. It takes no props and no room until a
39
+ * `NeetoAssistButton` opens it. It shows everything NeetoAssist did on the
40
+ * ticket, oldest first, and polls every 3 seconds while a run is pending and
41
+ * every 30 seconds otherwise. While open it sets `data-neeto-assist-open` on
42
+ * the document's root element, to `default` or `expanded`, for a host that needs
43
+ * CSS to make room.
44
+ */
45
+ export const NeetoAssistPane: React.FC;
46
+
47
+ /**
48
+ * Whether NeetoAssist is on for the signed-in rep's workspace: the React Query
49
+ * result of `GET /neeto_assist/api/v1/status`, which answers
50
+ * `{ enabled: true | false }`. Read `data?.enabled`: it is empty while loading
51
+ * and after a failure, and a failure never shows the rep a toast.
52
+ */
53
+ export function useNeetoAssistStatus(): UseQueryResult<{ enabled: boolean }>;