@jupyter/chat 0.1.0 → 0.3.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 (55) hide show
  1. package/lib/active-cell-manager.d.ts +151 -0
  2. package/lib/active-cell-manager.js +201 -0
  3. package/lib/components/chat-input.d.ts +14 -4
  4. package/lib/components/chat-input.js +118 -10
  5. package/lib/components/chat-messages.d.ts +45 -15
  6. package/lib/components/chat-messages.js +237 -55
  7. package/lib/components/chat.d.ts +21 -6
  8. package/lib/components/chat.js +15 -45
  9. package/lib/components/code-blocks/code-toolbar.d.ts +13 -0
  10. package/lib/components/code-blocks/code-toolbar.js +70 -0
  11. package/lib/components/{copy-button.d.ts → code-blocks/copy-button.d.ts} +1 -0
  12. package/lib/components/code-blocks/copy-button.js +43 -0
  13. package/lib/components/mui-extras/contrasting-tooltip.d.ts +6 -0
  14. package/lib/components/mui-extras/contrasting-tooltip.js +21 -0
  15. package/lib/components/mui-extras/tooltipped-icon-button.d.ts +35 -0
  16. package/lib/components/mui-extras/tooltipped-icon-button.js +36 -0
  17. package/lib/components/rendermime-markdown.d.ts +2 -0
  18. package/lib/components/rendermime-markdown.js +29 -15
  19. package/lib/components/scroll-container.js +1 -19
  20. package/lib/icons.d.ts +2 -0
  21. package/lib/icons.js +10 -0
  22. package/lib/index.d.ts +2 -0
  23. package/lib/index.js +2 -0
  24. package/lib/model.d.ts +98 -14
  25. package/lib/model.js +197 -6
  26. package/lib/registry.d.ts +78 -0
  27. package/lib/registry.js +83 -0
  28. package/lib/types.d.ts +60 -4
  29. package/lib/widgets/chat-sidebar.d.ts +3 -4
  30. package/lib/widgets/chat-sidebar.js +2 -2
  31. package/lib/widgets/chat-widget.d.ts +2 -8
  32. package/lib/widgets/chat-widget.js +6 -6
  33. package/package.json +204 -200
  34. package/src/active-cell-manager.ts +318 -0
  35. package/src/components/chat-input.tsx +196 -50
  36. package/src/components/chat-messages.tsx +357 -95
  37. package/src/components/chat.tsx +43 -69
  38. package/src/components/code-blocks/code-toolbar.tsx +143 -0
  39. package/src/components/code-blocks/copy-button.tsx +68 -0
  40. package/src/components/mui-extras/contrasting-tooltip.tsx +27 -0
  41. package/src/components/mui-extras/tooltipped-icon-button.tsx +84 -0
  42. package/src/components/rendermime-markdown.tsx +44 -20
  43. package/src/components/scroll-container.tsx +1 -25
  44. package/src/icons.ts +12 -0
  45. package/src/index.ts +2 -0
  46. package/src/model.ts +275 -21
  47. package/src/registry.ts +129 -0
  48. package/src/types.ts +62 -4
  49. package/src/widgets/chat-sidebar.tsx +3 -15
  50. package/src/widgets/chat-widget.tsx +8 -21
  51. package/style/chat.css +40 -0
  52. package/style/icons/read.svg +11 -0
  53. package/style/icons/replace-cell.svg +8 -0
  54. package/lib/components/copy-button.js +0 -35
  55. package/src/components/copy-button.tsx +0 -55
package/package.json CHANGED
@@ -1,209 +1,213 @@
1
1
  {
2
- "name": "@jupyter/chat",
3
- "version": "0.1.0",
4
- "description": "A package that provides UI components that can be used to create a chat in a Jupyterlab extension.",
5
- "keywords": [
6
- "jupyter",
7
- "jupyterlab",
8
- "jupyterlab-extension"
9
- ],
10
- "homepage": "https://github.com/jupyterlab/jupyter-chat",
11
- "bugs": {
12
- "url": "https://github.com/jupyterlab/jupyter-chat/issues"
13
- },
14
- "license": "BSD-3-Clause",
15
- "author": {
16
- "name": "Jupyter Development Team",
17
- "email": "jupyter@googlegroups.com"
18
- },
19
- "files": [
20
- "lib/**/*.{d.ts,eot,gif,html,jpg,js,js.map,json,png,svg,woff2,ttf}",
21
- "style/**/*.{css,js,eot,gif,html,jpg,json,png,svg,woff2,ttf}",
22
- "src/**/*.{ts,tsx}",
23
- "schema/*.json"
24
- ],
25
- "main": "lib/index.js",
26
- "types": "lib/index.d.ts",
27
- "style": "style/index.css",
28
- "repository": {
29
- "type": "git",
30
- "url": "https://github.com/jupyterlab/jupyter-chat.git"
31
- },
32
- "scripts": {
33
- "build": "jlpm build:lib",
34
- "build:prod": "jlpm clean && jlpm build:lib:prod",
35
- "build:lib": "tsc --sourceMap",
36
- "build:lib:prod": "tsc",
37
- "clean": "jlpm clean:lib",
38
- "clean:lib": "rimraf lib tsconfig.tsbuildinfo",
39
- "clean:lintcache": "rimraf .eslintcache .stylelintcache",
40
- "clean:all": "jlpm clean:lib && jlpm clean:lintcache",
41
- "eslint": "jlpm eslint:check --fix",
42
- "eslint:check": "eslint . --cache --ext .ts,.tsx",
43
- "install:extension": "jlpm build",
44
- "lint": "jlpm stylelint && jlpm prettier && jlpm eslint",
45
- "lint:check": "jlpm stylelint:check && jlpm prettier:check && jlpm eslint:check",
46
- "prettier": "jlpm prettier:base --write --list-different",
47
- "prettier:base": "prettier \"**/*{.ts,.tsx,.js,.jsx,.css,.json,.md}\"",
48
- "prettier:check": "jlpm prettier:base --check",
49
- "stylelint": "jlpm stylelint:check --fix",
50
- "stylelint:check": "stylelint --cache \"style/**/*.css\"",
51
- "test": "jest --coverage",
52
- "watch:src": "tsc -w --sourceMap"
53
- },
54
- "dependencies": {
55
- "@emotion/react": "^11.10.5",
56
- "@emotion/styled": "^11.10.5",
57
- "@jupyterlab/apputils": "^4.0.0",
58
- "@jupyterlab/rendermime": "^4.0.0",
59
- "@jupyterlab/ui-components": "^4.0.0",
60
- "@lumino/disposable": "^2.0.0",
61
- "@lumino/signaling": "^2.0.0",
62
- "@mui/icons-material": "^5.11.0",
63
- "@mui/material": "^5.11.0",
64
- "clsx": "^2.1.0",
65
- "react": "^18.2.0",
66
- "react-dom": "^18.2.0"
67
- },
68
- "devDependencies": {
69
- "@types/jest": "^29.2.0",
70
- "@types/json-schema": "^7.0.11",
71
- "@types/react": "^18.2.0",
72
- "@types/react-addons-linked-state-mixin": "^0.14.22",
73
- "@types/react-dom": "^18.2.0",
74
- "@typescript-eslint/eslint-plugin": "^6.1.0",
75
- "@typescript-eslint/parser": "^6.1.0",
76
- "css-loader": "^6.7.1",
77
- "eslint": "^8.36.0",
78
- "eslint-config-prettier": "^8.8.0",
79
- "eslint-plugin-prettier": "^5.0.0",
80
- "jest": "^29.2.0",
81
- "npm-run-all": "^4.1.5",
82
- "prettier": "^3.0.0",
83
- "rimraf": "^5.0.1",
84
- "source-map-loader": "^1.0.2",
85
- "style-loader": "^3.3.1",
86
- "stylelint": "^15.10.1",
87
- "stylelint-config-recommended": "^13.0.0",
88
- "stylelint-config-standard": "^34.0.0",
89
- "stylelint-csstree-validator": "^3.0.0",
90
- "stylelint-prettier": "^4.0.0",
91
- "typescript": "~5.0.2"
2
+ "name": "@jupyter/chat",
3
+ "version": "0.3.0",
4
+ "description": "A package that provides UI components that can be used to create a chat in a Jupyterlab extension.",
5
+ "keywords": [
6
+ "jupyter",
7
+ "jupyterlab",
8
+ "jupyterlab-extension"
9
+ ],
10
+ "homepage": "https://github.com/jupyterlab/jupyter-chat",
11
+ "bugs": {
12
+ "url": "https://github.com/jupyterlab/jupyter-chat/issues"
13
+ },
14
+ "license": "BSD-3-Clause",
15
+ "author": {
16
+ "name": "Jupyter Development Team",
17
+ "email": "jupyter@googlegroups.com"
18
+ },
19
+ "files": [
20
+ "lib/**/*.{d.ts,eot,gif,html,jpg,js,js.map,json,png,svg,woff2,ttf}",
21
+ "style/**/*.{css,js,eot,gif,html,jpg,json,png,svg,woff2,ttf}",
22
+ "src/**/*.{ts,tsx}",
23
+ "schema/*.json"
24
+ ],
25
+ "main": "lib/index.js",
26
+ "types": "lib/index.d.ts",
27
+ "style": "style/index.css",
28
+ "repository": {
29
+ "type": "git",
30
+ "url": "https://github.com/jupyterlab/jupyter-chat.git"
31
+ },
32
+ "scripts": {
33
+ "build": "jlpm build:lib",
34
+ "build:prod": "jlpm clean && jlpm build:lib:prod",
35
+ "build:lib": "tsc --sourceMap",
36
+ "build:lib:prod": "tsc",
37
+ "clean": "jlpm clean:lib",
38
+ "clean:lib": "rimraf lib tsconfig.tsbuildinfo",
39
+ "clean:lintcache": "rimraf .eslintcache .stylelintcache",
40
+ "clean:all": "jlpm clean:lib && jlpm clean:lintcache",
41
+ "eslint": "jlpm eslint:check --fix",
42
+ "eslint:check": "eslint . --cache --ext .ts,.tsx",
43
+ "install:extension": "jlpm build",
44
+ "lint": "jlpm stylelint && jlpm prettier && jlpm eslint",
45
+ "lint:check": "jlpm stylelint:check && jlpm prettier:check && jlpm eslint:check",
46
+ "prettier": "jlpm prettier:base --write --list-different",
47
+ "prettier:base": "prettier \"**/*{.ts,.tsx,.js,.jsx,.css,.json,.md}\"",
48
+ "prettier:check": "jlpm prettier:base --check",
49
+ "stylelint": "jlpm stylelint:check --fix",
50
+ "stylelint:check": "stylelint --cache \"style/**/*.css\"",
51
+ "test": "jest --coverage",
52
+ "watch:src": "tsc -w --sourceMap"
53
+ },
54
+ "dependencies": {
55
+ "@emotion/react": "^11.10.5",
56
+ "@emotion/styled": "^11.10.5",
57
+ "@jupyter/react-components": "^0.15.2",
58
+ "@jupyterlab/application": "^4.2.0",
59
+ "@jupyterlab/apputils": "^4.3.0",
60
+ "@jupyterlab/notebook": "^4.2.0",
61
+ "@jupyterlab/rendermime": "^4.2.0",
62
+ "@jupyterlab/ui-components": "^4.2.0",
63
+ "@lumino/commands": "^2.0.0",
64
+ "@lumino/disposable": "^2.0.0",
65
+ "@lumino/signaling": "^2.0.0",
66
+ "@mui/icons-material": "^5.11.0",
67
+ "@mui/material": "^5.11.0",
68
+ "clsx": "^2.1.0",
69
+ "react": "^18.2.0",
70
+ "react-dom": "^18.2.0"
71
+ },
72
+ "devDependencies": {
73
+ "@types/jest": "^29.2.0",
74
+ "@types/json-schema": "^7.0.11",
75
+ "@types/react": "^18.2.0",
76
+ "@types/react-addons-linked-state-mixin": "^0.14.22",
77
+ "@types/react-dom": "^18.2.0",
78
+ "@typescript-eslint/eslint-plugin": "^6.1.0",
79
+ "@typescript-eslint/parser": "^6.1.0",
80
+ "css-loader": "^6.7.1",
81
+ "eslint": "^8.36.0",
82
+ "eslint-config-prettier": "^8.8.0",
83
+ "eslint-plugin-prettier": "^5.0.0",
84
+ "jest": "^29.2.0",
85
+ "npm-run-all": "^4.1.5",
86
+ "prettier": "^3.0.0",
87
+ "rimraf": "^5.0.1",
88
+ "source-map-loader": "^1.0.2",
89
+ "style-loader": "^3.3.1",
90
+ "stylelint": "^15.10.1",
91
+ "stylelint-config-recommended": "^13.0.0",
92
+ "stylelint-config-standard": "^34.0.0",
93
+ "stylelint-csstree-validator": "^3.0.0",
94
+ "stylelint-prettier": "^4.0.0",
95
+ "typescript": "~5.0.2"
96
+ },
97
+ "sideEffects": [
98
+ "style/*.css",
99
+ "style/index.js"
100
+ ],
101
+ "styleModule": "style/index.js",
102
+ "publishConfig": {
103
+ "access": "public"
104
+ },
105
+ "jupyterlab": {
106
+ "discovery": {
107
+ "server": {
108
+ "managers": [
109
+ "pip"
110
+ ],
111
+ "base": {
112
+ "name": "jupyter_chat"
113
+ }
114
+ }
92
115
  },
93
- "sideEffects": [
94
- "style/*.css",
95
- "style/index.js"
116
+ "extension": false,
117
+ "schemaDir": "schema"
118
+ },
119
+ "eslintIgnore": [
120
+ "node_modules",
121
+ "dist",
122
+ "coverage",
123
+ "**/*.d.ts",
124
+ "tests",
125
+ "**/__tests__",
126
+ "ui-tests"
127
+ ],
128
+ "eslintConfig": {
129
+ "extends": [
130
+ "eslint:recommended",
131
+ "plugin:@typescript-eslint/eslint-recommended",
132
+ "plugin:@typescript-eslint/recommended",
133
+ "plugin:prettier/recommended"
96
134
  ],
97
- "styleModule": "style/index.js",
98
- "publishConfig": {
99
- "access": "public"
135
+ "parser": "@typescript-eslint/parser",
136
+ "parserOptions": {
137
+ "project": "tsconfig.json",
138
+ "sourceType": "module"
100
139
  },
101
- "jupyterlab": {
102
- "discovery": {
103
- "server": {
104
- "managers": [
105
- "pip"
106
- ],
107
- "base": {
108
- "name": "jupyter_chat"
109
- }
110
- }
111
- },
112
- "extension": false,
113
- "schemaDir": "schema"
114
- },
115
- "eslintIgnore": [
116
- "node_modules",
117
- "dist",
118
- "coverage",
119
- "**/*.d.ts",
120
- "tests",
121
- "**/__tests__",
122
- "ui-tests"
140
+ "plugins": [
141
+ "@typescript-eslint"
123
142
  ],
124
- "eslintConfig": {
125
- "extends": [
126
- "eslint:recommended",
127
- "plugin:@typescript-eslint/eslint-recommended",
128
- "plugin:@typescript-eslint/recommended",
129
- "plugin:prettier/recommended"
130
- ],
131
- "parser": "@typescript-eslint/parser",
132
- "parserOptions": {
133
- "project": "tsconfig.json",
134
- "sourceType": "module"
135
- },
136
- "plugins": [
137
- "@typescript-eslint"
138
- ],
139
- "rules": {
140
- "@typescript-eslint/naming-convention": [
141
- "error",
142
- {
143
- "selector": "interface",
144
- "format": [
145
- "PascalCase"
146
- ],
147
- "custom": {
148
- "regex": "^I[A-Z]",
149
- "match": true
150
- }
151
- }
152
- ],
153
- "@typescript-eslint/no-unused-vars": [
154
- "warn",
155
- {
156
- "args": "none"
157
- }
158
- ],
159
- "@typescript-eslint/no-explicit-any": "off",
160
- "@typescript-eslint/no-namespace": "off",
161
- "@typescript-eslint/no-use-before-define": "off",
162
- "@typescript-eslint/quotes": [
163
- "error",
164
- "single",
165
- {
166
- "avoidEscape": true,
167
- "allowTemplateLiterals": false
168
- }
169
- ],
170
- "curly": [
171
- "error",
172
- "all"
173
- ],
174
- "eqeqeq": "error",
175
- "prefer-arrow-callback": "error"
143
+ "rules": {
144
+ "@typescript-eslint/naming-convention": [
145
+ "error",
146
+ {
147
+ "selector": "interface",
148
+ "format": [
149
+ "PascalCase"
150
+ ],
151
+ "custom": {
152
+ "regex": "^I[A-Z]",
153
+ "match": true
154
+ }
176
155
  }
177
- },
178
- "prettier": {
179
- "singleQuote": true,
180
- "trailingComma": "none",
181
- "arrowParens": "avoid",
182
- "endOfLine": "auto",
183
- "overrides": [
184
- {
185
- "files": "package.json",
186
- "options": {
187
- "tabWidth": 4
188
- }
189
- }
190
- ]
191
- },
192
- "stylelint": {
193
- "extends": [
194
- "stylelint-config-recommended",
195
- "stylelint-config-standard",
196
- "stylelint-prettier/recommended"
197
- ],
198
- "plugins": [
199
- "stylelint-csstree-validator"
200
- ],
201
- "rules": {
202
- "csstree/validator": true,
203
- "property-no-vendor-prefix": null,
204
- "selector-class-pattern": "^([a-z][A-z\\d]*)(-[A-z\\d]+)*$",
205
- "selector-no-vendor-prefix": null,
206
- "value-no-vendor-prefix": null
156
+ ],
157
+ "@typescript-eslint/no-unused-vars": [
158
+ "warn",
159
+ {
160
+ "args": "none"
207
161
  }
162
+ ],
163
+ "@typescript-eslint/no-explicit-any": "off",
164
+ "@typescript-eslint/no-namespace": "off",
165
+ "@typescript-eslint/no-use-before-define": "off",
166
+ "@typescript-eslint/quotes": [
167
+ "error",
168
+ "single",
169
+ {
170
+ "avoidEscape": true,
171
+ "allowTemplateLiterals": false
172
+ }
173
+ ],
174
+ "curly": [
175
+ "error",
176
+ "all"
177
+ ],
178
+ "eqeqeq": "error",
179
+ "prefer-arrow-callback": "error"
180
+ }
181
+ },
182
+ "prettier": {
183
+ "singleQuote": true,
184
+ "trailingComma": "none",
185
+ "arrowParens": "avoid",
186
+ "endOfLine": "auto",
187
+ "overrides": [
188
+ {
189
+ "files": "package.json",
190
+ "options": {
191
+ "tabWidth": 2
192
+ }
193
+ }
194
+ ]
195
+ },
196
+ "stylelint": {
197
+ "extends": [
198
+ "stylelint-config-recommended",
199
+ "stylelint-config-standard",
200
+ "stylelint-prettier/recommended"
201
+ ],
202
+ "plugins": [
203
+ "stylelint-csstree-validator"
204
+ ],
205
+ "rules": {
206
+ "csstree/validator": true,
207
+ "property-no-vendor-prefix": null,
208
+ "selector-class-pattern": "^([a-z][A-z\\d]*)(-[A-z\\d]+)*$",
209
+ "selector-no-vendor-prefix": null,
210
+ "value-no-vendor-prefix": null
208
211
  }
212
+ }
209
213
  }