@instructure/canvas-rce 5.10.0 → 5.11.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 (58) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/Dockerfile +1 -1
  3. package/es/common/mimeClass.js +70 -67
  4. package/es/enhance-user-content/doc_previews.js +1 -1
  5. package/es/enhance-user-content/enhance_user_content.js +9 -1
  6. package/es/getThemeVars.js +3 -4
  7. package/es/rce/RCE.js +1 -3
  8. package/es/rce/RCEWrapper.js +3 -67
  9. package/es/rce/RceHtmlEditor.js +20 -38
  10. package/es/rce/plugins/instructure_links/components/Link.js +3 -9
  11. package/es/rce/plugins/instructure_links/components/LinkSet.js +4 -8
  12. package/es/rce/plugins/instructure_links/components/NoResults.js +5 -10
  13. package/es/rce/plugins/instructure_links/plugin.js +1 -7
  14. package/es/rce/plugins/instructure_rce_external_tools/components/ExternalToolDialog/ExternalToolDialog.js +1 -2
  15. package/es/rce/plugins/instructure_rce_external_tools/components/ExternalToolDialog/ExternalToolDialogTray.js +6 -12
  16. package/es/rce/plugins/instructure_rce_external_tools/components/ExternalToolSelectionDialog/ExternalToolSelectionDialog.js +2 -2
  17. package/es/rce/plugins/instructure_rce_external_tools/lti13-content-items/models/ResourceLinkContentItem.js +1 -1
  18. package/es/rce/plugins/instructure_record/VideoOptionsTray/TrayController.js +7 -2
  19. package/es/rce/plugins/instructure_record/VideoOptionsTray/index.js +3 -9
  20. package/es/rce/plugins/instructure_wordcount/components/WordCountModal.js +8 -16
  21. package/es/rce/plugins/shared/CanvasContentTray.js +7 -1
  22. package/es/rce/plugins/shared/fileTypeUtils.js +14 -6
  23. package/{lib/rce/plugins/tinymce-a11y-checker/components/color-field.js → es/rce/plugins/tinymce-a11y-checker/components/ColorField.js} +9 -7
  24. package/es/rce/plugins/tinymce-a11y-checker/components/checker.js +27 -24
  25. package/es/rce/root.js +1 -3
  26. package/es/rce/transformContent.js +8 -0
  27. package/es/sidebar/actions/upload.js +3 -1
  28. package/jest/jest-setup.js +2 -0
  29. package/lib/common/mimeClass.js +70 -67
  30. package/lib/enhance-user-content/doc_previews.js +1 -1
  31. package/lib/enhance-user-content/enhance_user_content.js +9 -1
  32. package/lib/getThemeVars.js +3 -4
  33. package/lib/rce/RCE.js +1 -3
  34. package/lib/rce/RCEWrapper.js +3 -67
  35. package/lib/rce/RceHtmlEditor.js +20 -38
  36. package/lib/rce/plugins/instructure_links/components/Link.js +3 -9
  37. package/lib/rce/plugins/instructure_links/components/LinkSet.js +4 -8
  38. package/lib/rce/plugins/instructure_links/components/NoResults.js +5 -10
  39. package/lib/rce/plugins/instructure_links/plugin.js +1 -7
  40. package/lib/rce/plugins/instructure_rce_external_tools/components/ExternalToolDialog/ExternalToolDialog.js +1 -2
  41. package/lib/rce/plugins/instructure_rce_external_tools/components/ExternalToolDialog/ExternalToolDialogTray.js +6 -12
  42. package/lib/rce/plugins/instructure_rce_external_tools/components/ExternalToolSelectionDialog/ExternalToolSelectionDialog.js +2 -2
  43. package/lib/rce/plugins/instructure_rce_external_tools/lti13-content-items/models/ResourceLinkContentItem.js +1 -1
  44. package/lib/rce/plugins/instructure_record/VideoOptionsTray/TrayController.js +7 -2
  45. package/lib/rce/plugins/instructure_record/VideoOptionsTray/index.js +3 -9
  46. package/lib/rce/plugins/instructure_wordcount/components/WordCountModal.js +8 -16
  47. package/lib/rce/plugins/shared/CanvasContentTray.js +7 -1
  48. package/lib/rce/plugins/shared/fileTypeUtils.js +14 -6
  49. package/{es/rce/plugins/tinymce-a11y-checker/components/color-field.js → lib/rce/plugins/tinymce-a11y-checker/components/ColorField.js} +9 -7
  50. package/lib/rce/plugins/tinymce-a11y-checker/components/checker.js +27 -24
  51. package/lib/rce/root.js +1 -3
  52. package/lib/rce/transformContent.js +8 -0
  53. package/lib/sidebar/actions/upload.js +3 -1
  54. package/locales/en.json +1438 -89
  55. package/package.json +55 -52
  56. package/canvas/README.md +0 -84
  57. package/canvas/locales/en.json +0 -934
  58. package/canvas/package.json +0 -189
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/canvas-rce",
3
- "version": "5.10.0",
3
+ "version": "5.11.0",
4
4
  "description": "A component wrapping Canvas's usage of Tinymce",
5
5
  "main": "es/index.js",
6
6
  "scripts": {
@@ -26,6 +26,7 @@
26
26
  "test:watch": "mocha 'test/**/*.test.js' --watch",
27
27
  "test:coverage": "cross-env nyc -r html -r json node_modules/.bin/mocha 'test/**/*.test.js'",
28
28
  "test:jest:debug": "node --inspect-brk node_modules/.bin/jest --runInBand",
29
+ "test:jest:watch": "node node_modules/.bin/jest --watch",
29
30
  "debug": "inspect _mocha --no-timeouts --debug-brk 'test/**/*.test.js'",
30
31
  "demo": "scripts/demo.sh",
31
32
  "demo:clean": "rm -f github-pages/dist/*",
@@ -39,7 +40,7 @@
39
40
  "build:canvas": "scripts/build-canvas",
40
41
  "build:watch": "yarn clean:es && yarn build:es --watch",
41
42
  "build:cafe": "wp --config webpack.testcafe.config.js",
42
- "prepublishOnly": "yarn build:all && yarn test",
43
+ "prepublishOnly": "yarn build:all",
43
44
  "fmt:check": "prettier -l '**/*.js*' '**/*.ts*'",
44
45
  "fmt:fix": "prettier --write '**/*.js*' '**/*.ts*'",
45
46
  "clean": "rm -rf lib && yarn clean:es && rm -rf coverage && yarn demo:clean",
@@ -73,60 +74,62 @@
73
74
  "instrument": false
74
75
  },
75
76
  "dependencies": {
77
+ "@instructure/canvas-theme": "^8",
76
78
  "@instructure/canvas-media": "*",
77
- "@instructure/canvas-theme": "7",
78
- "@instructure/debounce": "^7",
79
- "@instructure/emotion": "^8.38.1",
79
+ "@instructure/debounce": "^8",
80
+ "@instructure/emotion": "^8.39",
81
+ "@instructure/filter-console-messages": "*",
80
82
  "@instructure/k5uploader": "*",
81
83
  "@instructure/media-capture": "^9.0.0",
82
- "@instructure/ui-a11y-content": "^7",
83
- "@instructure/ui-a11y-utils": "^7",
84
- "@instructure/ui-alerts": "^7",
85
- "@instructure/ui-avatar": "^7",
86
- "@instructure/ui-badge": "^7",
87
- "@instructure/ui-billboard": "^7",
88
- "@instructure/ui-buttons": "^7",
89
- "@instructure/ui-checkbox": "^7",
90
- "@instructure/ui-code-editor": "^7",
91
- "@instructure/ui-color-utils": "^7",
92
- "@instructure/ui-file-drop": "^7",
93
- "@instructure/ui-flex": "^7",
94
- "@instructure/ui-focusable": "^7",
95
- "@instructure/ui-form-field": "^7",
96
- "@instructure/ui-grid": "^7",
97
- "@instructure/ui-heading": "^7",
98
- "@instructure/ui-icons": "^7",
99
- "@instructure/ui-img": "^7",
100
- "@instructure/ui-link": "^7",
101
- "@instructure/ui-list": "^7",
84
+ "@instructure/theme-registry": "^8",
85
+ "@instructure/ui-a11y-content": "^8",
86
+ "@instructure/ui-a11y-utils": "^8",
87
+ "@instructure/ui-alerts": "^8",
88
+ "@instructure/ui-avatar": "^8",
89
+ "@instructure/ui-badge": "^8",
90
+ "@instructure/ui-billboard": "^8",
91
+ "@instructure/ui-buttons": "^8",
92
+ "@instructure/ui-checkbox": "^8",
93
+ "@instructure/ui-code-editor": "^8",
94
+ "@instructure/ui-color-utils": "^8",
95
+ "@instructure/ui-file-drop": "^8",
96
+ "@instructure/ui-flex": "^8",
97
+ "@instructure/ui-focusable": "^8",
98
+ "@instructure/ui-form-field": "^8",
99
+ "@instructure/ui-grid": "^8",
100
+ "@instructure/ui-heading": "^8",
101
+ "@instructure/ui-icons": "^8",
102
+ "@instructure/ui-img": "^8",
103
+ "@instructure/ui-link": "^8",
104
+ "@instructure/ui-list": "^8",
102
105
  "@instructure/ui-media-player": "^9.0.0",
103
- "@instructure/ui-menu": "^7",
104
- "@instructure/ui-modal": "^7",
105
- "@instructure/ui-motion": "^7",
106
- "@instructure/ui-number-input": "^7",
107
- "@instructure/ui-overlays": "^7",
108
- "@instructure/ui-pagination": "^7",
109
- "@instructure/ui-popover": "^7",
110
- "@instructure/ui-radio-input": "^7",
111
- "@instructure/ui-react-utils": "^7",
112
- "@instructure/ui-simple-select": "^7",
113
- "@instructure/ui-spinner": "^7",
114
- "@instructure/ui-svg-images": "^7",
115
- "@instructure/ui-table": "^7",
116
- "@instructure/ui-tabs": "^7",
117
- "@instructure/ui-text": "^7",
118
- "@instructure/ui-text-area": "^7",
119
- "@instructure/ui-text-input": "^7",
120
- "@instructure/ui-themeable": "^7",
121
- "@instructure/ui-themes": "^7",
122
- "@instructure/ui-toggle-details": "^7",
123
- "@instructure/ui-tooltip": "^7",
124
- "@instructure/ui-tray": "^7",
125
- "@instructure/ui-tree-browser": "^7",
126
- "@instructure/ui-truncate-text": "^7",
127
- "@instructure/ui-utils": "^7",
128
- "@instructure/ui-view": "^7",
129
- "@instructure/uid": "^7",
106
+ "@instructure/ui-menu": "^8",
107
+ "@instructure/ui-modal": "^8",
108
+ "@instructure/ui-motion": "^8",
109
+ "@instructure/ui-number-input": "^8",
110
+ "@instructure/ui-overlays": "^8",
111
+ "@instructure/ui-pagination": "^8",
112
+ "@instructure/ui-popover": "^8",
113
+ "@instructure/ui-radio-input": "^8",
114
+ "@instructure/ui-react-utils": "^8",
115
+ "@instructure/ui-simple-select": "^8",
116
+ "@instructure/ui-source-code-editor": "^8",
117
+ "@instructure/ui-spinner": "^8",
118
+ "@instructure/ui-svg-images": "^8",
119
+ "@instructure/ui-table": "^8",
120
+ "@instructure/ui-tabs": "^8",
121
+ "@instructure/ui-text": "^8",
122
+ "@instructure/ui-text-area": "^8",
123
+ "@instructure/ui-text-input": "^8",
124
+ "@instructure/ui-themes": "^8",
125
+ "@instructure/ui-toggle-details": "^8",
126
+ "@instructure/ui-tooltip": "^8",
127
+ "@instructure/ui-tray": "^8",
128
+ "@instructure/ui-tree-browser": "^8",
129
+ "@instructure/ui-truncate-text": "^8",
130
+ "@instructure/ui-utils": "^8",
131
+ "@instructure/ui-view": "^8",
132
+ "@instructure/uid": "^8",
130
133
  "@sheerun/mutationobserver-shim": "^0.3.2",
131
134
  "@tinymce/tinymce-react": "~3.8.4",
132
135
  "aphrodite": "^2",
package/canvas/README.md DELETED
@@ -1,84 +0,0 @@
1
- # Canvas Rich Content Editor
2
-
3
- The Canvas LMS Rich Content Editor extracted in it's own npm package for use
4
- across multiple services. In the canvas ecosystem, this npm module is used
5
- in pair with a running `canvas-rce-api` microservice.
6
-
7
- Some features require a running instance of the `canvas-rce-api`,
8
- but you do not need that instance in order to
9
- do development on `canvas-rce`. (see [docs/development.md](docs/development.md))
10
-
11
- The first customer of the `canvas-rce` is the `canvas-lms` LMS so documentation
12
- and references throughout documentation might reflect and assume the use of
13
- `canvas-lms`.
14
-
15
- ## Install and setup
16
-
17
- As a published npm module, you can add canvas-rce to your node project by doing
18
- the following:
19
-
20
- ```bash
21
- npm install canvas-rce --save
22
- ```
23
-
24
- For guidance on how `canvas-rce` is used within canvas, please reference
25
- the [canvas-lms use of canvas-rce](https://github.com/instructure/canvas-lms/tree/stable/ui/shared/rce)
26
- to get an idea on how to incorporate it into your project. Pay
27
- special attention to the `RichContentEditor.js` and `serviceRCELoader.js`.
28
-
29
- Outside of canvas, the `CanvasRce` React component is your entry point.
30
- _Work is ongoing to make the props to `CanvasRce` more rational.
31
- Please be patient._
32
-
33
- ## Tests
34
-
35
- While canvas consumes the es modules build of the rce,
36
- Jest tests are run against the commonjs build, so make sure you've built the
37
- commonjs assets before running tests:
38
-
39
- ```bash
40
- yarn build:canvas
41
- yarn test:jest
42
- ```
43
-
44
- There are still legacy mocha tests run with `yarn test:mocha`. `yarn test` runs them all.
45
-
46
- ### test debugging hints
47
-
48
- ```
49
- yarn test:jest:debug path/to/__test__/file.test.js
50
- ```
51
-
52
- will break and wait for you to attach a debugger (e.g. `chrome://inspect/#devices`).
53
-
54
- Similarly, for mocha tests
55
-
56
- ```
57
- yarn test:mocha:debug path/to/test/file.test.js
58
- ```
59
-
60
- Both those commands may include a `--watch` argument to keep the process alive
61
- while you iterate.
62
-
63
- ## Polyfills
64
-
65
- This project makes use of modern JavaScript APIs like Promise, Object.assign,
66
- Array.prototype.includes, etc. which are present in modern
67
- browsers but may not be present in old browsers like IE 11. In order to not
68
- send unnecessarily large and duplicated code bundles to the browser, consumers
69
- are expected to have already globally polyfilled those APIs.
70
- Canvas only supports modern browsers and the rce has not been tested
71
- in older browsers like IE. If you need suggestions for how to include
72
- polyfills in your
73
- own app, you can just put this in your html above the script that includes
74
- canvas-rce:
75
-
76
- ```
77
- <script src="https://cdn.polyfill.io/v2/polyfill.min.js?rum=0"></script>
78
- ```
79
-
80
- (See: https://polyfill.io/v2/docs/ for more info)
81
-
82
- ## Development
83
-
84
- See [DEVELOPMENT.md](./DEVELOPMENT.md)