canvas-lms/packages/canvas-rce
Jenkins f67e64f719 [i18n] Update RCE translations.
Change-Id: I1026c42022e2c86edab4c730c6009b246b7768d9
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/340091
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2024-02-09 04:51:07 +00:00
..
bin
demo Rename .js files with JSX to .jsx in RCE 2023-08-10 15:07:53 +00:00
doc Add initial RCE I18n docs 2021-10-08 17:04:14 +00:00
github-pages Stop using google fonts on user-facing pages 2022-02-07 20:55:16 +00:00
jest Upgrade Canvas to InstUI version 8 (second try) 2023-10-06 03:07:44 +00:00
locales Upgrade Canvas to InstUI version 8 (second try) 2023-10-06 03:07:44 +00:00
scripts Remove CommonJS build of RCE 2024-01-30 18:06:41 +00:00
src [i18n] Update RCE translations. 2024-02-09 04:51:07 +00:00
test Stop adding verifiers to files in new Quizzes 2024-01-30 17:45:30 +00:00
testcafe Rename .js files with JSX to .jsx in RCE 2023-08-10 15:07:53 +00:00
.dockerignore
.eslintrc RCE: Enable noImplicitAny for typescript 2023-04-28 16:43:16 +00:00
.gitignore babel independence: canvas-rce 2022-03-16 14:34:10 +00:00
.mocharc.js Prepare for InstUI 8 upgrade 2023-09-08 15:56:48 +00:00
.npmignore
.prettierignore fix prettier diff in auto-generated file 2022-10-20 20:20:54 +00:00
CHANGELOG.md update canvas-rce package for publishing 2024-01-31 17:43:18 +00:00
DEVELOPMENT.md Read JWT secrets from Vault instead of dynamic_settings 2023-05-15 18:59:18 +00:00
Dockerfile update dockerfiles for node 18 2023-10-09 14:29:00 +00:00
LICENSE
README.md update README 2023-05-30 20:59:12 +00:00
babel-register.js Remove babel-plugin-themeable-styles 2024-01-30 15:01:11 +00:00
babel.config.cjs.js Remove babel-plugin-themeable-styles 2024-01-30 15:01:11 +00:00
babel.config.js Remove babel-plugin-themeable-styles 2024-01-30 15:01:11 +00:00
build.sh
docker-compose.yml bump all docker-compose files to 2.3 2020-07-28 20:44:44 +00:00
jest.config.js Remove babel-plugin-themeable-styles 2024-01-30 15:01:11 +00:00
mocha-reporter-config.js Provide default test coverage data output dir 2021-06-24 17:19:47 +00:00
package.json update canvas-rce package for publishing 2024-01-31 17:43:18 +00:00
tsconfig.json Exclude node_modules from RCE tsconfig (for VS Code) 2023-05-16 23:32:12 +00:00
webpack.demo.config.js Recreate the standalone demo app for working on the RCE 2021-04-29 14:02:58 +00:00
webpack.dev.config.js Recreate the standalone demo app for working on the RCE 2021-04-29 14:02:58 +00:00
webpack.shared.config.js Remove CJS build from RCE 2023-08-08 19:30:56 +00:00
webpack.testcafe.config.js Remove CJS build from RCE 2023-08-08 19:30:56 +00:00

README.md

Canvas Rich Content Editor

The Canvas LMS Rich Content Editor (RCE) extracted in it's own npm package for use across multiple services

In the Canvas ecosystem, this npm module is used in conjunction with the Rich Content Service (RCS) microservice. The code for the RCS is also open source and lives in the canvas-rce-api repository. (see https://github.com/instructure/canvas-rce-api)

Some features require a running instance of the canvas-rce-api, but you do not need an instance in order to do development on @instructure/canvas-rce. (see the Development section)

The primary consumer of the @instructure/canvas-rce is canvas-lms, so documentation and references throughout documentation might reflect and assume the use of canvas-lms.

Install and Setup

As a published npm module, you can add @instructure/canvas-rce to your node project by doing the following:

npm install @instructure/canvas-rce --save

For guidance on how @instructure/canvas-rce is used within Canvas, please reference the canvas-lms use of canvas-rce to get an idea on how to incorporate it into your project. Pay special attention to the RichContentEditor.js and serviceRCELoader.js.

Outside of Canvas, the CanvasRce React component is your entry point.

Tests

First, build assets. Then you can run the tests:

yarn build:all
yarn test:jest

There are still legacy mocha tests run with yarn test:mocha. The command yarn test runs them all.

Test Debugging Hints

yarn test:jest:debug path/to/__test__/file.test.js

will break and wait for you to attach a debugger (e.g. chrome://inspect/#devices).

Similarly, for mocha tests

yarn test:mocha:debug path/to/test/file.test.js

Both those commands may include a --watch argument to keep the process alive while you iterate.

Polyfills

This project makes use of modern JavaScript APIs like Promise, Object.assign, Array.prototype.includes, etc. which are present in modern browsers but may not be present in old browsers like IE 11. In order to not send unnecessarily large and duplicated code bundles to the browser, consumers are expected to have already globally polyfilled those APIs. Canvas only supports modern browsers and the RCE has not been tested in older browsers like IE. If you need suggestions for how to include polyfills in your own app, you can put this in your html above the script that includes @instructure/canvas-rce:

<script src="https://cdn.polyfill.io/v2/polyfill.min.js?rum=0"></script>

(See https://polyfill.io/v2/docs/ for more info)

Development

See DEVELOPMENT.md