@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.
- package/CHANGELOG.md +36 -0
- package/Dockerfile +1 -1
- package/es/common/mimeClass.js +70 -67
- package/es/enhance-user-content/doc_previews.js +1 -1
- package/es/enhance-user-content/enhance_user_content.js +9 -1
- package/es/getThemeVars.js +3 -4
- package/es/rce/RCE.js +1 -3
- package/es/rce/RCEWrapper.js +3 -67
- package/es/rce/RceHtmlEditor.js +20 -38
- package/es/rce/plugins/instructure_links/components/Link.js +3 -9
- package/es/rce/plugins/instructure_links/components/LinkSet.js +4 -8
- package/es/rce/plugins/instructure_links/components/NoResults.js +5 -10
- package/es/rce/plugins/instructure_links/plugin.js +1 -7
- package/es/rce/plugins/instructure_rce_external_tools/components/ExternalToolDialog/ExternalToolDialog.js +1 -2
- package/es/rce/plugins/instructure_rce_external_tools/components/ExternalToolDialog/ExternalToolDialogTray.js +6 -12
- package/es/rce/plugins/instructure_rce_external_tools/components/ExternalToolSelectionDialog/ExternalToolSelectionDialog.js +2 -2
- package/es/rce/plugins/instructure_rce_external_tools/lti13-content-items/models/ResourceLinkContentItem.js +1 -1
- package/es/rce/plugins/instructure_record/VideoOptionsTray/TrayController.js +7 -2
- package/es/rce/plugins/instructure_record/VideoOptionsTray/index.js +3 -9
- package/es/rce/plugins/instructure_wordcount/components/WordCountModal.js +8 -16
- package/es/rce/plugins/shared/CanvasContentTray.js +7 -1
- package/es/rce/plugins/shared/fileTypeUtils.js +14 -6
- package/{lib/rce/plugins/tinymce-a11y-checker/components/color-field.js → es/rce/plugins/tinymce-a11y-checker/components/ColorField.js} +9 -7
- package/es/rce/plugins/tinymce-a11y-checker/components/checker.js +27 -24
- package/es/rce/root.js +1 -3
- package/es/rce/transformContent.js +8 -0
- package/es/sidebar/actions/upload.js +3 -1
- package/jest/jest-setup.js +2 -0
- package/lib/common/mimeClass.js +70 -67
- package/lib/enhance-user-content/doc_previews.js +1 -1
- package/lib/enhance-user-content/enhance_user_content.js +9 -1
- package/lib/getThemeVars.js +3 -4
- package/lib/rce/RCE.js +1 -3
- package/lib/rce/RCEWrapper.js +3 -67
- package/lib/rce/RceHtmlEditor.js +20 -38
- package/lib/rce/plugins/instructure_links/components/Link.js +3 -9
- package/lib/rce/plugins/instructure_links/components/LinkSet.js +4 -8
- package/lib/rce/plugins/instructure_links/components/NoResults.js +5 -10
- package/lib/rce/plugins/instructure_links/plugin.js +1 -7
- package/lib/rce/plugins/instructure_rce_external_tools/components/ExternalToolDialog/ExternalToolDialog.js +1 -2
- package/lib/rce/plugins/instructure_rce_external_tools/components/ExternalToolDialog/ExternalToolDialogTray.js +6 -12
- package/lib/rce/plugins/instructure_rce_external_tools/components/ExternalToolSelectionDialog/ExternalToolSelectionDialog.js +2 -2
- package/lib/rce/plugins/instructure_rce_external_tools/lti13-content-items/models/ResourceLinkContentItem.js +1 -1
- package/lib/rce/plugins/instructure_record/VideoOptionsTray/TrayController.js +7 -2
- package/lib/rce/plugins/instructure_record/VideoOptionsTray/index.js +3 -9
- package/lib/rce/plugins/instructure_wordcount/components/WordCountModal.js +8 -16
- package/lib/rce/plugins/shared/CanvasContentTray.js +7 -1
- package/lib/rce/plugins/shared/fileTypeUtils.js +14 -6
- package/{es/rce/plugins/tinymce-a11y-checker/components/color-field.js → lib/rce/plugins/tinymce-a11y-checker/components/ColorField.js} +9 -7
- package/lib/rce/plugins/tinymce-a11y-checker/components/checker.js +27 -24
- package/lib/rce/root.js +1 -3
- package/lib/rce/transformContent.js +8 -0
- package/lib/sidebar/actions/upload.js +3 -1
- package/locales/en.json +1438 -89
- package/package.json +55 -52
- package/canvas/README.md +0 -84
- package/canvas/locales/en.json +0 -934
- 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.
|
|
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
|
|
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/
|
|
78
|
-
"@instructure/
|
|
79
|
-
"@instructure/
|
|
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/
|
|
83
|
-
"@instructure/ui-a11y-
|
|
84
|
-
"@instructure/ui-
|
|
85
|
-
"@instructure/ui-
|
|
86
|
-
"@instructure/ui-
|
|
87
|
-
"@instructure/ui-
|
|
88
|
-
"@instructure/ui-
|
|
89
|
-
"@instructure/ui-
|
|
90
|
-
"@instructure/ui-
|
|
91
|
-
"@instructure/ui-
|
|
92
|
-
"@instructure/ui-
|
|
93
|
-
"@instructure/ui-
|
|
94
|
-
"@instructure/ui-
|
|
95
|
-
"@instructure/ui-
|
|
96
|
-
"@instructure/ui-
|
|
97
|
-
"@instructure/ui-
|
|
98
|
-
"@instructure/ui-
|
|
99
|
-
"@instructure/ui-
|
|
100
|
-
"@instructure/ui-
|
|
101
|
-
"@instructure/ui-
|
|
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": "^
|
|
104
|
-
"@instructure/ui-modal": "^
|
|
105
|
-
"@instructure/ui-motion": "^
|
|
106
|
-
"@instructure/ui-number-input": "^
|
|
107
|
-
"@instructure/ui-overlays": "^
|
|
108
|
-
"@instructure/ui-pagination": "^
|
|
109
|
-
"@instructure/ui-popover": "^
|
|
110
|
-
"@instructure/ui-radio-input": "^
|
|
111
|
-
"@instructure/ui-react-utils": "^
|
|
112
|
-
"@instructure/ui-simple-select": "^
|
|
113
|
-
"@instructure/ui-
|
|
114
|
-
"@instructure/ui-
|
|
115
|
-
"@instructure/ui-
|
|
116
|
-
"@instructure/ui-
|
|
117
|
-
"@instructure/ui-
|
|
118
|
-
"@instructure/ui-text
|
|
119
|
-
"@instructure/ui-text-
|
|
120
|
-
"@instructure/ui-
|
|
121
|
-
"@instructure/ui-themes": "^
|
|
122
|
-
"@instructure/ui-toggle-details": "^
|
|
123
|
-
"@instructure/ui-tooltip": "^
|
|
124
|
-
"@instructure/ui-tray": "^
|
|
125
|
-
"@instructure/ui-tree-browser": "^
|
|
126
|
-
"@instructure/ui-truncate-text": "^
|
|
127
|
-
"@instructure/ui-utils": "^
|
|
128
|
-
"@instructure/ui-view": "^
|
|
129
|
-
"@instructure/uid": "^
|
|
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)
|