@instructure/canvas-rce 5.11.1 → 5.12.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.
Files changed (108) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/es/canvasFileBrowser/FileBrowser.js +6 -1
  3. package/es/common/fileUrl.js +3 -4
  4. package/es/defaultTinymceConfig.js +1 -1
  5. package/es/elementDenylist.js +19 -0
  6. package/es/getThemeVars.js +4 -3
  7. package/es/getTranslations.js +77 -1
  8. package/es/rce/RCEWrapper.js +2 -6
  9. package/es/rce/StatusBar.js +8 -2
  10. package/es/rce/contentInsertion.js +5 -2
  11. package/es/rce/plugins/instructure_documents/components/DocumentsPanel.js +3 -9
  12. package/es/rce/plugins/instructure_html_view/plugin.js +2 -2
  13. package/es/rce/plugins/instructure_icon_maker/components/SavedIconMakerList.js +3 -2
  14. package/es/rce/plugins/instructure_image/ImageList/Image.js +2 -2
  15. package/es/rce/plugins/instructure_image/Images/index.js +3 -10
  16. package/es/rce/plugins/instructure_rce_external_tools/components/ExternalToolDialog/ExternalToolDialog.js +3 -0
  17. package/es/rce/plugins/instructure_rce_external_tools/lti13-content-items/models/ResourceLinkContentItem.js +3 -1
  18. package/es/rce/plugins/instructure_record/AudioOptionsTray/TrayController.js +26 -1
  19. package/es/rce/plugins/instructure_record/AudioOptionsTray/index.js +9 -3
  20. package/es/rce/plugins/instructure_record/MediaPanel/index.js +3 -9
  21. package/es/rce/plugins/instructure_record/VideoOptionsTray/TrayController.js +27 -2
  22. package/es/rce/plugins/instructure_record/VideoOptionsTray/index.js +35 -6
  23. package/es/rce/plugins/shared/fileShape.js +81 -9
  24. package/es/rce/plugins/shared/fileTypeUtils.js +6 -0
  25. package/es/rcs/api.js +6 -4
  26. package/es/sidebar/store/configureStore.js +2 -2
  27. package/es/translations/locales/ab.js +26 -0
  28. package/es/translations/locales/cs.js +27 -0
  29. package/es/translations/locales/cs_CZ.js +27 -0
  30. package/es/translations/locales/da_DK.js +27 -0
  31. package/es/translations/locales/en_NZ.js +26 -0
  32. package/es/translations/locales/en_SE.js +26 -0
  33. package/es/translations/locales/en_US.js +26 -0
  34. package/es/translations/locales/hu_HU.js +27 -0
  35. package/es/translations/locales/id.js +2426 -0
  36. package/es/{types/inst-ui.d.js → translations/locales/id_ID.js} +9 -1
  37. package/es/translations/locales/ko_KR.js +27 -0
  38. package/es/translations/locales/lt.js +26 -0
  39. package/es/translations/locales/lt_LT.js +26 -0
  40. package/es/translations/locales/mn_MN.js +26 -0
  41. package/es/translations/locales/nl_NL.js +27 -0
  42. package/es/translations/locales/ro.js +27 -0
  43. package/es/translations/locales/ru.js +2375 -32
  44. package/es/translations/locales/sv.js +2379 -30
  45. package/es/translations/locales/th.js +2401 -1
  46. package/es/translations/locales/tl_PH.js +26 -0
  47. package/es/translations/locales/tr.js +3 -0
  48. package/es/translations/locales/vi.js +2396 -8
  49. package/es/translations/locales/zh_TW.Big5.js +27 -0
  50. package/es/translations/locales/zh_TW.js +27 -0
  51. package/lib/canvasFileBrowser/FileBrowser.js +6 -1
  52. package/lib/common/fileUrl.js +3 -4
  53. package/lib/defaultTinymceConfig.js +1 -1
  54. package/lib/elementDenylist.js +19 -0
  55. package/lib/getThemeVars.js +4 -3
  56. package/lib/getTranslations.js +77 -1
  57. package/lib/rce/RCEWrapper.js +2 -6
  58. package/lib/rce/StatusBar.js +8 -2
  59. package/lib/rce/contentInsertion.js +5 -2
  60. package/lib/rce/plugins/instructure_documents/components/DocumentsPanel.js +3 -9
  61. package/lib/rce/plugins/instructure_html_view/plugin.js +2 -2
  62. package/lib/rce/plugins/instructure_icon_maker/components/SavedIconMakerList.js +3 -2
  63. package/lib/rce/plugins/instructure_image/ImageList/Image.js +2 -2
  64. package/lib/rce/plugins/instructure_image/Images/index.js +3 -10
  65. package/lib/rce/plugins/instructure_rce_external_tools/components/ExternalToolDialog/ExternalToolDialog.js +3 -0
  66. package/lib/rce/plugins/instructure_rce_external_tools/lti13-content-items/models/ResourceLinkContentItem.js +3 -1
  67. package/lib/rce/plugins/instructure_record/AudioOptionsTray/TrayController.js +26 -1
  68. package/lib/rce/plugins/instructure_record/AudioOptionsTray/index.js +9 -3
  69. package/lib/rce/plugins/instructure_record/MediaPanel/index.js +3 -9
  70. package/lib/rce/plugins/instructure_record/VideoOptionsTray/TrayController.js +27 -2
  71. package/lib/rce/plugins/instructure_record/VideoOptionsTray/index.js +35 -6
  72. package/lib/rce/plugins/shared/fileShape.js +81 -9
  73. package/lib/rce/plugins/shared/fileTypeUtils.js +6 -0
  74. package/lib/rcs/api.js +6 -4
  75. package/lib/sidebar/store/configureStore.js +2 -2
  76. package/lib/translations/locales/ab.js +26 -0
  77. package/lib/translations/locales/cs.js +27 -0
  78. package/lib/translations/locales/cs_CZ.js +27 -0
  79. package/lib/translations/locales/da_DK.js +27 -0
  80. package/lib/translations/locales/en_NZ.js +26 -0
  81. package/lib/translations/locales/en_SE.js +26 -0
  82. package/lib/translations/locales/en_US.js +26 -0
  83. package/lib/translations/locales/hu_HU.js +27 -0
  84. package/lib/translations/locales/id.js +2426 -0
  85. package/lib/{types/inst-ui.d.js → translations/locales/id_ID.js} +9 -1
  86. package/lib/translations/locales/ko_KR.js +27 -0
  87. package/lib/translations/locales/lt.js +26 -0
  88. package/lib/translations/locales/lt_LT.js +26 -0
  89. package/lib/translations/locales/mn_MN.js +26 -0
  90. package/lib/translations/locales/nl_NL.js +27 -0
  91. package/lib/translations/locales/ro.js +27 -0
  92. package/lib/translations/locales/ru.js +2375 -32
  93. package/lib/translations/locales/sv.js +2379 -30
  94. package/lib/translations/locales/th.js +2401 -1
  95. package/lib/translations/locales/tl_PH.js +26 -0
  96. package/lib/translations/locales/tr.js +3 -0
  97. package/lib/translations/locales/vi.js +2396 -8
  98. package/lib/translations/locales/zh_TW.Big5.js +27 -0
  99. package/lib/translations/locales/zh_TW.js +27 -0
  100. package/package.json +11 -9
  101. package/scripts/publish_to_npm.sh +26 -0
  102. package/canvas/README.md +0 -84
  103. package/canvas/locales/en.json +0 -934
  104. package/canvas/package.json +0 -189
  105. package/es/common/scroll.js +0 -45
  106. package/es/types/ts-migration.js +0 -1
  107. package/lib/common/scroll.js +0 -45
  108. package/lib/types/ts-migration.js +0 -1
@@ -0,0 +1,27 @@
1
+ /*
2
+ * Copyright (C) 2021 - present Instructure, Inc.
3
+ *
4
+ * This file is part of Canvas.
5
+ *
6
+ * Canvas is free software: you can redistribute it and/or modify it under
7
+ * the terms of the GNU Affero General Public License as published by the Free
8
+ * Software Foundation, version 3 of the License.
9
+ *
10
+ * Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
11
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12
+ * A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
13
+ * details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License along
16
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ import formatMessage from '../../format-message';
19
+ import '../tinymce/zh_CN';
20
+ const locale = {
21
+ "count_plural_one_item_loaded_other_items_loaded_857023b7": {
22
+ "message": "{ count, plural,\n other {}\n}"
23
+ }
24
+ };
25
+ formatMessage.addLocale({
26
+ 'zh-TW.Big5': locale
27
+ });
@@ -0,0 +1,27 @@
1
+ /*
2
+ * Copyright (C) 2021 - present Instructure, Inc.
3
+ *
4
+ * This file is part of Canvas.
5
+ *
6
+ * Canvas is free software: you can redistribute it and/or modify it under
7
+ * the terms of the GNU Affero General Public License as published by the Free
8
+ * Software Foundation, version 3 of the License.
9
+ *
10
+ * Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
11
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12
+ * A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
13
+ * details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License along
16
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ import formatMessage from '../../format-message';
19
+ import '../tinymce/zh_CN';
20
+ const locale = {
21
+ "count_plural_one_item_loaded_other_items_loaded_857023b7": {
22
+ "message": "{ count, plural,\n other {}\n}"
23
+ }
24
+ };
25
+ formatMessage.addLocale({
26
+ 'zh-TW': locale
27
+ });
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "@instructure/canvas-rce",
3
- "version": "5.11.1",
3
+ "version": "5.12.1",
4
4
  "description": "A component wrapping Canvas's usage of Tinymce",
5
5
  "main": "es/index.js",
6
+ "owner": "LF",
6
7
  "scripts": {
7
8
  "i18n:extract": "format-message extract \"src/**/*.[jt]s*\" -g underscored_crc32 -o locales/en.json",
8
9
  "integration-test": "nightwatch --env integration",
@@ -45,6 +46,7 @@
45
46
  "fmt:fix": "prettier --write '**/*.js*' '**/*.ts*'",
46
47
  "clean": "rm -rf lib && yarn clean:es && rm -rf coverage && yarn demo:clean",
47
48
  "clean:es": "rm -rf es",
49
+ "check:ts": "tsc -p tsconfig.json",
48
50
  "generate-svgs": "yarn build:es && node --experimental-modules scripts/generateSvgs.js && prettier --write src/rce/plugins/instructure_equation/MathIcon/svgs.js",
49
51
  "publishToNpm": "scripts/publish_to_npm.sh"
50
52
  },
@@ -80,6 +82,7 @@
80
82
  "@instructure/emotion": "^8.39",
81
83
  "@instructure/k5uploader": "*",
82
84
  "@instructure/media-capture": "^9.0.0",
85
+ "@instructure/postcss-themeable-styles": "^7",
83
86
  "@instructure/theme-registry": "^8",
84
87
  "@instructure/ui-a11y-content": "^8",
85
88
  "@instructure/ui-a11y-utils": "^8",
@@ -109,6 +112,7 @@
109
112
  "@instructure/ui-overlays": "^8",
110
113
  "@instructure/ui-pagination": "^8",
111
114
  "@instructure/ui-popover": "^8",
115
+ "@instructure/ui-postcss-config": "^7",
112
116
  "@instructure/ui-radio-input": "^8",
113
117
  "@instructure/ui-react-utils": "^8",
114
118
  "@instructure/ui-simple-select": "^8",
@@ -116,9 +120,9 @@
116
120
  "@instructure/ui-svg-images": "^8",
117
121
  "@instructure/ui-table": "^8",
118
122
  "@instructure/ui-tabs": "^8",
119
- "@instructure/ui-text": "^8",
120
123
  "@instructure/ui-text-area": "^8",
121
124
  "@instructure/ui-text-input": "^8",
125
+ "@instructure/ui-text": "^8",
122
126
  "@instructure/ui-themes": "^8",
123
127
  "@instructure/ui-toggle-details": "^8",
124
128
  "@instructure/ui-tooltip": "^8",
@@ -140,13 +144,12 @@
140
144
  "format-message-generate-id": "^6",
141
145
  "i18n-js": "^3",
142
146
  "isomorphic-fetch": "2.2.1",
143
- "jquery": "https://github.com/instructure/jquery.git#1.7.2-with-AMD-and-CommonJS",
144
147
  "js-beautify": "1",
145
148
  "keycode": "^2",
146
149
  "lodash": "^4",
147
150
  "mathlive": "^0.77.0",
148
151
  "minimatch": "~3.0.4",
149
- "moment-timezone": "^0.5.13",
152
+ "moment-timezone": "^0.5.43",
150
153
  "prop-types": "^15",
151
154
  "react": "^0.14.8 || ^15.0.0 || ^16",
152
155
  "react-aria-live": "^2",
@@ -157,8 +160,7 @@
157
160
  "react-transition-group": "^1",
158
161
  "redux": "^4",
159
162
  "redux-batch-middleware": "^0.2.0",
160
- "redux-thunk": "^2",
161
- "scroll-into-view": "https://github.com/bkirkby/scroll-into-view.git#588b0ced98eeecf84e6fb2074aa076e80b7cffab",
163
+ "redux-thunk": "^3.1.0",
162
164
  "text-field-edit": "^3.2.0",
163
165
  "tinymce": "^5",
164
166
  "uri-js": "^4.2.2",
@@ -181,14 +183,14 @@
181
183
  "@testing-library/react-hooks": "^5",
182
184
  "@testing-library/user-event": "^12",
183
185
  "axe-testcafe": "^3",
184
- "babel-loader": "^8.2.5",
186
+ "babel-loader": "^9.1.3",
185
187
  "babel-plugin-dynamic-import-node": "^2.2.0",
186
188
  "babel-plugin-inline-json-import": "^0.2.0",
187
189
  "babel-plugin-minify-constant-folding": "^0.5.0",
188
190
  "babel-plugin-minify-dead-code-elimination": "^0.5.0",
189
191
  "babel-plugin-minify-guarded-expressions": "^0.4.3",
190
192
  "babel-plugin-transform-inline-environment-variables": "^0.4.3",
191
- "babel-plugin-typescript-to-proptypes": "^1.4.2",
193
+ "babel-plugin-typescript-to-proptypes": "^2.1.0",
192
194
  "cross-env": "^5.0.0",
193
195
  "escape-html": "^1",
194
196
  "eslint-plugin-mocha": "^6",
@@ -216,7 +218,7 @@
216
218
  "testcafe-browser-provider-selenium": "^1.2.0",
217
219
  "testcafe-react-selectors": "^3.3.0",
218
220
  "ts-node": "^10.9.1",
219
- "typescript": "^5.2.2",
221
+ "typescript": "^5.3.2",
220
222
  "url-loader": "^4.1.1",
221
223
  "webpack": "^5",
222
224
  "webpack-merge": "^5",
@@ -16,6 +16,7 @@
16
16
  # SKIP_NPM_LOGIN=1
17
17
  # SKIP_NPM_PUBLISH=1
18
18
  # SKIP_ALERT=1
19
+ # SKIP_NPM_INSTALL=1
19
20
 
20
21
  function prompt {
21
22
  read -p "$1 (Y/N): " confirm &&
@@ -49,6 +50,31 @@ else
49
50
  echo "Would have logged into NPM"
50
51
  fi
51
52
 
53
+ if [ -z "$SKIP_NPM_INSTALL" ]; then
54
+ # checks that the package is able to be installed outside
55
+ # of the canvas-lms directory
56
+ echo -e "\nVerifying NPM install...\n"
57
+
58
+ script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
59
+ current_dir=$(pwd)
60
+ temp=$(mktemp -d)
61
+ cd "$temp"
62
+ yarn add file:$script_dir/..
63
+
64
+ if [[ ! $? -eq 0 ]]; then
65
+ echo "npm install failed"
66
+ cd "$current_dir"
67
+ rm -rf "$temp"
68
+ exit 1
69
+ fi
70
+
71
+ echo "npm install successful"
72
+ cd "$current_dir"
73
+ rm -rf "$temp"
74
+ else
75
+ echo "Would have verified NPM install"
76
+ fi
77
+
52
78
  if [ -z "$SKIP_NPM_PUBLISH" ]; then
53
79
  echo -e "\nPublishing to NPM...\n"
54
80
  npm publish
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)