@instructure/canvas-rce 5.11.0 → 5.11.1
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 +6 -0
- package/canvas/README.md +84 -0
- package/canvas/locales/en.json +934 -0
- package/canvas/package.json +189 -0
- package/es/rce/RceHtmlEditor.js +58 -20
- package/lib/rce/RceHtmlEditor.js +58 -20
- package/package.json +2 -4
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## 5.11.1 - 2023-10-12
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- An issue where the RCE can't be built due to an extraneous dependency
|
|
13
|
+
|
|
8
14
|
## 5.11.0 - 2023-10-10
|
|
9
15
|
|
|
10
16
|
### Fixed
|
package/canvas/README.md
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
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)
|