@instructure/canvas-rce 5.11.0 → 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 (107) hide show
  1. package/CHANGELOG.md +30 -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/RceHtmlEditor.js +58 -20
  10. package/es/rce/StatusBar.js +8 -2
  11. package/es/rce/contentInsertion.js +5 -2
  12. package/es/rce/plugins/instructure_documents/components/DocumentsPanel.js +3 -9
  13. package/es/rce/plugins/instructure_html_view/plugin.js +2 -2
  14. package/es/rce/plugins/instructure_icon_maker/components/SavedIconMakerList.js +3 -2
  15. package/es/rce/plugins/instructure_image/ImageList/Image.js +2 -2
  16. package/es/rce/plugins/instructure_image/Images/index.js +3 -10
  17. package/es/rce/plugins/instructure_rce_external_tools/components/ExternalToolDialog/ExternalToolDialog.js +3 -0
  18. package/es/rce/plugins/instructure_rce_external_tools/lti13-content-items/models/ResourceLinkContentItem.js +3 -1
  19. package/es/rce/plugins/instructure_record/AudioOptionsTray/TrayController.js +26 -1
  20. package/es/rce/plugins/instructure_record/AudioOptionsTray/index.js +9 -3
  21. package/es/rce/plugins/instructure_record/MediaPanel/index.js +3 -9
  22. package/es/rce/plugins/instructure_record/VideoOptionsTray/TrayController.js +27 -2
  23. package/es/rce/plugins/instructure_record/VideoOptionsTray/index.js +35 -6
  24. package/es/rce/plugins/shared/fileShape.js +81 -9
  25. package/es/rce/plugins/shared/fileTypeUtils.js +6 -0
  26. package/es/rcs/api.js +6 -4
  27. package/es/sidebar/store/configureStore.js +2 -2
  28. package/es/translations/locales/ab.js +26 -0
  29. package/es/translations/locales/cs.js +27 -0
  30. package/es/translations/locales/cs_CZ.js +27 -0
  31. package/es/translations/locales/da_DK.js +27 -0
  32. package/es/translations/locales/en_NZ.js +26 -0
  33. package/es/translations/locales/en_SE.js +26 -0
  34. package/es/translations/locales/en_US.js +26 -0
  35. package/es/translations/locales/hu_HU.js +27 -0
  36. package/es/translations/locales/id.js +2426 -0
  37. package/{lib/types/inst-ui.d.js → es/translations/locales/id_ID.js} +9 -1
  38. package/es/translations/locales/ko_KR.js +27 -0
  39. package/es/translations/locales/lt.js +26 -0
  40. package/es/translations/locales/lt_LT.js +26 -0
  41. package/es/translations/locales/mn_MN.js +26 -0
  42. package/es/translations/locales/nl_NL.js +27 -0
  43. package/es/translations/locales/ro.js +27 -0
  44. package/es/translations/locales/ru.js +2375 -32
  45. package/es/translations/locales/sv.js +2379 -30
  46. package/es/translations/locales/th.js +2401 -1
  47. package/es/translations/locales/tl_PH.js +26 -0
  48. package/es/translations/locales/tr.js +3 -0
  49. package/es/translations/locales/vi.js +2396 -8
  50. package/es/translations/locales/zh_TW.Big5.js +27 -0
  51. package/es/translations/locales/zh_TW.js +27 -0
  52. package/lib/canvasFileBrowser/FileBrowser.js +6 -1
  53. package/lib/common/fileUrl.js +3 -4
  54. package/lib/defaultTinymceConfig.js +1 -1
  55. package/lib/elementDenylist.js +19 -0
  56. package/lib/getThemeVars.js +4 -3
  57. package/lib/getTranslations.js +77 -1
  58. package/lib/rce/RCEWrapper.js +2 -6
  59. package/lib/rce/RceHtmlEditor.js +58 -20
  60. package/lib/rce/StatusBar.js +8 -2
  61. package/lib/rce/contentInsertion.js +5 -2
  62. package/lib/rce/plugins/instructure_documents/components/DocumentsPanel.js +3 -9
  63. package/lib/rce/plugins/instructure_html_view/plugin.js +2 -2
  64. package/lib/rce/plugins/instructure_icon_maker/components/SavedIconMakerList.js +3 -2
  65. package/lib/rce/plugins/instructure_image/ImageList/Image.js +2 -2
  66. package/lib/rce/plugins/instructure_image/Images/index.js +3 -10
  67. package/lib/rce/plugins/instructure_rce_external_tools/components/ExternalToolDialog/ExternalToolDialog.js +3 -0
  68. package/lib/rce/plugins/instructure_rce_external_tools/lti13-content-items/models/ResourceLinkContentItem.js +3 -1
  69. package/lib/rce/plugins/instructure_record/AudioOptionsTray/TrayController.js +26 -1
  70. package/lib/rce/plugins/instructure_record/AudioOptionsTray/index.js +9 -3
  71. package/lib/rce/plugins/instructure_record/MediaPanel/index.js +3 -9
  72. package/lib/rce/plugins/instructure_record/VideoOptionsTray/TrayController.js +27 -2
  73. package/lib/rce/plugins/instructure_record/VideoOptionsTray/index.js +35 -6
  74. package/lib/rce/plugins/shared/fileShape.js +81 -9
  75. package/lib/rce/plugins/shared/fileTypeUtils.js +6 -0
  76. package/lib/rcs/api.js +6 -4
  77. package/lib/sidebar/store/configureStore.js +2 -2
  78. package/lib/translations/locales/ab.js +26 -0
  79. package/lib/translations/locales/cs.js +27 -0
  80. package/lib/translations/locales/cs_CZ.js +27 -0
  81. package/lib/translations/locales/da_DK.js +27 -0
  82. package/lib/translations/locales/en_NZ.js +26 -0
  83. package/lib/translations/locales/en_SE.js +26 -0
  84. package/lib/translations/locales/en_US.js +26 -0
  85. package/lib/translations/locales/hu_HU.js +27 -0
  86. package/lib/translations/locales/id.js +2426 -0
  87. package/{es/types/inst-ui.d.js → lib/translations/locales/id_ID.js} +9 -1
  88. package/lib/translations/locales/ko_KR.js +27 -0
  89. package/lib/translations/locales/lt.js +26 -0
  90. package/lib/translations/locales/lt_LT.js +26 -0
  91. package/lib/translations/locales/mn_MN.js +26 -0
  92. package/lib/translations/locales/nl_NL.js +27 -0
  93. package/lib/translations/locales/ro.js +27 -0
  94. package/lib/translations/locales/ru.js +2375 -32
  95. package/lib/translations/locales/sv.js +2379 -30
  96. package/lib/translations/locales/th.js +2401 -1
  97. package/lib/translations/locales/tl_PH.js +26 -0
  98. package/lib/translations/locales/tr.js +3 -0
  99. package/lib/translations/locales/vi.js +2396 -8
  100. package/lib/translations/locales/zh_TW.Big5.js +27 -0
  101. package/lib/translations/locales/zh_TW.js +27 -0
  102. package/package.json +12 -12
  103. package/scripts/publish_to_npm.sh +26 -0
  104. package/es/common/scroll.js +0 -45
  105. package/es/types/ts-migration.js +0 -1
  106. package/lib/common/scroll.js +0 -45
  107. 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.0",
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",
@@ -40,11 +41,12 @@
40
41
  "build:canvas": "scripts/build-canvas",
41
42
  "build:watch": "yarn clean:es && yarn build:es --watch",
42
43
  "build:cafe": "wp --config webpack.testcafe.config.js",
43
- "prepublishOnly": "yarn build:all",
44
+ "prepublishOnly": "yarn build:all && yarn test",
44
45
  "fmt:check": "prettier -l '**/*.js*' '**/*.ts*'",
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
  },
@@ -78,9 +80,9 @@
78
80
  "@instructure/canvas-media": "*",
79
81
  "@instructure/debounce": "^8",
80
82
  "@instructure/emotion": "^8.39",
81
- "@instructure/filter-console-messages": "*",
82
83
  "@instructure/k5uploader": "*",
83
84
  "@instructure/media-capture": "^9.0.0",
85
+ "@instructure/postcss-themeable-styles": "^7",
84
86
  "@instructure/theme-registry": "^8",
85
87
  "@instructure/ui-a11y-content": "^8",
86
88
  "@instructure/ui-a11y-utils": "^8",
@@ -110,17 +112,17 @@
110
112
  "@instructure/ui-overlays": "^8",
111
113
  "@instructure/ui-pagination": "^8",
112
114
  "@instructure/ui-popover": "^8",
115
+ "@instructure/ui-postcss-config": "^7",
113
116
  "@instructure/ui-radio-input": "^8",
114
117
  "@instructure/ui-react-utils": "^8",
115
118
  "@instructure/ui-simple-select": "^8",
116
- "@instructure/ui-source-code-editor": "^8",
117
119
  "@instructure/ui-spinner": "^8",
118
120
  "@instructure/ui-svg-images": "^8",
119
121
  "@instructure/ui-table": "^8",
120
122
  "@instructure/ui-tabs": "^8",
121
- "@instructure/ui-text": "^8",
122
123
  "@instructure/ui-text-area": "^8",
123
124
  "@instructure/ui-text-input": "^8",
125
+ "@instructure/ui-text": "^8",
124
126
  "@instructure/ui-themes": "^8",
125
127
  "@instructure/ui-toggle-details": "^8",
126
128
  "@instructure/ui-tooltip": "^8",
@@ -142,13 +144,12 @@
142
144
  "format-message-generate-id": "^6",
143
145
  "i18n-js": "^3",
144
146
  "isomorphic-fetch": "2.2.1",
145
- "jquery": "https://github.com/instructure/jquery.git#1.7.2-with-AMD-and-CommonJS",
146
147
  "js-beautify": "1",
147
148
  "keycode": "^2",
148
149
  "lodash": "^4",
149
150
  "mathlive": "^0.77.0",
150
151
  "minimatch": "~3.0.4",
151
- "moment-timezone": "^0.5.13",
152
+ "moment-timezone": "^0.5.43",
152
153
  "prop-types": "^15",
153
154
  "react": "^0.14.8 || ^15.0.0 || ^16",
154
155
  "react-aria-live": "^2",
@@ -159,8 +160,7 @@
159
160
  "react-transition-group": "^1",
160
161
  "redux": "^4",
161
162
  "redux-batch-middleware": "^0.2.0",
162
- "redux-thunk": "^2",
163
- "scroll-into-view": "https://github.com/bkirkby/scroll-into-view.git#588b0ced98eeecf84e6fb2074aa076e80b7cffab",
163
+ "redux-thunk": "^3.1.0",
164
164
  "text-field-edit": "^3.2.0",
165
165
  "tinymce": "^5",
166
166
  "uri-js": "^4.2.2",
@@ -183,14 +183,14 @@
183
183
  "@testing-library/react-hooks": "^5",
184
184
  "@testing-library/user-event": "^12",
185
185
  "axe-testcafe": "^3",
186
- "babel-loader": "^8.2.5",
186
+ "babel-loader": "^9.1.3",
187
187
  "babel-plugin-dynamic-import-node": "^2.2.0",
188
188
  "babel-plugin-inline-json-import": "^0.2.0",
189
189
  "babel-plugin-minify-constant-folding": "^0.5.0",
190
190
  "babel-plugin-minify-dead-code-elimination": "^0.5.0",
191
191
  "babel-plugin-minify-guarded-expressions": "^0.4.3",
192
192
  "babel-plugin-transform-inline-environment-variables": "^0.4.3",
193
- "babel-plugin-typescript-to-proptypes": "^1.4.2",
193
+ "babel-plugin-typescript-to-proptypes": "^2.1.0",
194
194
  "cross-env": "^5.0.0",
195
195
  "escape-html": "^1",
196
196
  "eslint-plugin-mocha": "^6",
@@ -218,7 +218,7 @@
218
218
  "testcafe-browser-provider-selenium": "^1.2.0",
219
219
  "testcafe-react-selectors": "^3.3.0",
220
220
  "ts-node": "^10.9.1",
221
- "typescript": "^5.2.2",
221
+ "typescript": "^5.3.2",
222
222
  "url-loader": "^4.1.1",
223
223
  "webpack": "^5",
224
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
@@ -1,45 +0,0 @@
1
- /*
2
- * Copyright (C) 2018 - 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 scrollIntoView from 'scroll-into-view';
19
- export default {
20
- // scrolling in react is kinda messed up. it would
21
- // make sense to scroll after getting "componentDidUpdate'
22
- // after exposing new DOM objects, but "componentDidUpdate"
23
- // get's called after the virtual DOM flushes it's updates
24
- // to the real DOM. it doesn't get called after the real
25
- // DOM has actually updated the page, so getting accurate
26
- // scroll and window size information in "componenetDidUpdate"
27
- // is not reliable, so we need a delay.
28
- // there also is no uniform event in javascript yet that will
29
- // notify of scoll window changes. firefox has "overflow",
30
- // chrome has "overflowchanged", and ie has nothing.
31
- // so i need to introduce a delay to give the DOM time to render.
32
- // the underlying scrollIntoView module will also perform a
33
- // requestAnimationFrame() (through module raf), but that delay
34
- // wasn't enough for what we needed here.
35
- // see the below stackoverflow for more info
36
- // http://stackoverflow.com/questions/26556436/react-after-render-code
37
- INTERIM_DELAY: 100,
38
-
39
- scrollIntoViewWDelay(target, config) {
40
- setTimeout(() => {
41
- scrollIntoView.scrollIntoView(target, config);
42
- }, this.INTERIM_DELAY);
43
- }
44
-
45
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1,45 +0,0 @@
1
- /*
2
- * Copyright (C) 2018 - 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 scrollIntoView from 'scroll-into-view';
19
- export default {
20
- // scrolling in react is kinda messed up. it would
21
- // make sense to scroll after getting "componentDidUpdate'
22
- // after exposing new DOM objects, but "componentDidUpdate"
23
- // get's called after the virtual DOM flushes it's updates
24
- // to the real DOM. it doesn't get called after the real
25
- // DOM has actually updated the page, so getting accurate
26
- // scroll and window size information in "componenetDidUpdate"
27
- // is not reliable, so we need a delay.
28
- // there also is no uniform event in javascript yet that will
29
- // notify of scoll window changes. firefox has "overflow",
30
- // chrome has "overflowchanged", and ie has nothing.
31
- // so i need to introduce a delay to give the DOM time to render.
32
- // the underlying scrollIntoView module will also perform a
33
- // requestAnimationFrame() (through module raf), but that delay
34
- // wasn't enough for what we needed here.
35
- // see the below stackoverflow for more info
36
- // http://stackoverflow.com/questions/26556436/react-after-render-code
37
- INTERIM_DELAY: 100,
38
-
39
- scrollIntoViewWDelay(target, config) {
40
- setTimeout(() => {
41
- scrollIntoView.scrollIntoView(target, config);
42
- }, this.INTERIM_DELAY);
43
- }
44
-
45
- };
@@ -1 +0,0 @@
1
- export {};