@instructure/canvas-rce 7.0.0 → 7.2.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 +33 -1
- package/__tests__/common/indicate.test.js +5 -6
- package/es/bridge/Bridge.js +2 -4
- package/es/canvasFileBrowser/FileBrowser.js +2 -4
- package/es/defaultTinymceConfig.d.ts +1 -1
- package/es/defaultTinymceConfig.js +149 -114
- package/es/enhance-user-content/enhance_user_content.js +7 -1
- package/es/enhance-user-content/instructure_helper.js +4 -0
- package/es/enhance-user-content/youtube_overlay.d.ts +1 -0
- package/es/enhance-user-content/youtube_overlay.js +87 -0
- package/es/format-message.d.js +1 -0
- package/es/format-message.js +5 -0
- package/es/index.d.ts +1 -1
- package/es/rce/RCE.d.ts +0 -1
- package/es/rce/RCE.js +5 -10
- package/es/rce/RCEVariants.d.ts +8 -3
- package/es/rce/RCEVariants.js +31 -5
- package/es/rce/RCEWrapper.d.ts +3 -3
- package/es/rce/RCEWrapper.js +66 -57
- package/es/rce/RCEWrapperProps.d.ts +1 -1
- package/es/rce/ShowOnFocusButton/index.js +4 -2
- package/es/rce/StatusBar.js +61 -15
- package/es/rce/alertHandler.js +6 -7
- package/es/rce/plugins/instructure-ui-icons/plugin.js +2 -2
- package/es/rce/plugins/instructure_equation/EquationEditorModal/index.js +6 -10
- package/es/rce/plugins/instructure_icon_maker/components/CreateIconMakerForm/ImageSection/Course.d.ts +5 -15
- package/es/rce/plugins/instructure_icon_maker/components/CreateIconMakerForm/ImageSection/Course.js +4 -10
- package/es/rce/plugins/instructure_image/ImageEmbedOptions.d.ts +7 -0
- package/es/rce/plugins/instructure_image/ImageEmbedOptions.js +45 -2
- package/es/rce/plugins/instructure_rce_external_tools/components/ExternalToolDialog/ExternalToolDialog.d.ts +1 -8
- package/es/rce/plugins/instructure_rce_external_tools/components/ExternalToolDialog/ExternalToolDialog.js +13 -33
- package/es/rce/plugins/instructure_rce_external_tools/components/ExternalToolDialog/ExternalToolDialogModal.d.ts +1 -2
- package/es/rce/plugins/instructure_rce_external_tools/components/ExternalToolDialog/ExternalToolDialogModal.js +2 -1
- package/es/rce/plugins/instructure_record/VideoOptionsTray/index.js +10 -7
- package/es/rce/plugins/shared/DimensionsInput/index.js +3 -3
- package/es/rce/plugins/shared/FixedContentTray.d.ts +7 -23
- package/es/rce/plugins/shared/FixedContentTray.js +7 -16
- package/es/rce/plugins/shared/ImageCropper/constants.d.ts +1 -1
- package/es/rce/plugins/shared/ImageCropper/constants.js +1 -1
- package/es/rce/plugins/shared/ImageCropper/controls/CustomNumberInput.js +1 -1
- package/es/rce/plugins/shared/PreviewIcon.js +1 -1
- package/es/rce/plugins/shared/ai_tools/aiicons.d.ts +3 -3
- package/es/rce/plugins/shared/ai_tools/aiicons.js +11 -11
- package/es/rce/plugins/tinymce-a11y-checker/components/checker.js +7 -1
- package/es/rce/plugins/tinymce-a11y-checker/utils/indicate.d.ts +1 -1
- package/es/rce/plugins/tinymce-a11y-checker/utils/indicate.js +1 -1
- package/es/rce/style.js +19 -17
- package/es/translations/locales/ar.js +29 -5
- package/es/translations/locales/ca.js +32 -8
- package/es/translations/locales/cy.js +29 -5
- package/es/translations/locales/da-x-k12.js +29 -5
- package/es/translations/locales/da.js +29 -5
- package/es/translations/locales/de.js +29 -5
- package/es/translations/locales/en-AU-x-unimelb.js +29 -5
- package/es/translations/locales/en-GB-x-ukhe.js +29 -5
- package/es/translations/locales/en.js +17 -5
- package/es/translations/locales/en_AU.js +29 -5
- package/es/translations/locales/en_CA.js +29 -5
- package/es/translations/locales/en_CY.js +29 -5
- package/es/translations/locales/en_GB.js +29 -5
- package/es/translations/locales/es.js +29 -5
- package/es/translations/locales/es_ES.js +29 -5
- package/es/translations/locales/fa_IR.js +0 -3
- package/es/translations/locales/fi.js +29 -5
- package/es/translations/locales/fr.js +29 -5
- package/es/translations/locales/fr_CA.js +30 -6
- package/es/translations/locales/ga.js +46 -22
- package/es/translations/locales/hi.js +29 -5
- package/es/translations/locales/ht.js +29 -5
- package/es/translations/locales/hu.js +0 -6
- package/es/translations/locales/id.js +29 -5
- package/es/translations/locales/is.js +23 -5
- package/es/translations/locales/it.js +29 -5
- package/es/translations/locales/ja.js +29 -5
- package/es/translations/locales/mi.js +29 -5
- package/es/translations/locales/ms.js +29 -5
- package/es/translations/locales/nb-x-k12.js +29 -5
- package/es/translations/locales/nb.js +29 -5
- package/es/translations/locales/nl.js +29 -5
- package/es/translations/locales/nn.js +0 -6
- package/es/translations/locales/pl.js +29 -5
- package/es/translations/locales/pt.js +29 -5
- package/es/translations/locales/pt_BR.js +29 -5
- package/es/translations/locales/ru.js +29 -5
- package/es/translations/locales/sl.js +29 -5
- package/es/translations/locales/sv-x-k12.js +29 -5
- package/es/translations/locales/sv.js +29 -5
- package/es/translations/locales/th.js +29 -5
- package/es/translations/locales/uk_UA.js +0 -6
- package/es/translations/locales/vi.js +29 -5
- package/es/translations/locales/zh-Hans.js +29 -5
- package/es/translations/locales/zh-Hant.js +29 -5
- package/es/translations/locales/zh.js +29 -5
- package/es/translations/locales/zh_HK.js +29 -5
- package/es/util/contextHelper.d.ts +7 -0
- package/{testcafe/axe.test.js → es/util/contextHelper.js} +10 -21
- package/es/util/loadingPlaceholder.js +11 -11
- package/eslint.config.js +3 -25
- package/jest/jest-setup.js +27 -2
- package/jest.config.js +5 -1
- package/package.json +61 -84
- package/testcafe/RCEWrapper.test.js +0 -319
- package/testcafe/StatusBar.test.js +0 -108
- package/testcafe/enhanceUserContent.html +0 -58
- package/testcafe/enhanceUserContent.test.js +0 -44
- package/testcafe/entry.jsx +0 -77
- package/testcafe/testcafe.html +0 -14
- package/webpack.testcafe.config.js +0 -61
|
@@ -400,6 +400,9 @@ const locale = {
|
|
|
400
400
|
"content_type_2cf90d95": {
|
|
401
401
|
"message": "內容類型"
|
|
402
402
|
},
|
|
403
|
+
"continue_to_youtube_content_a34f0f85": {
|
|
404
|
+
"message": "繼續觀看 YouTube 內容"
|
|
405
|
+
},
|
|
403
406
|
"coproduct_e7838082": {
|
|
404
407
|
"message": "副產品"
|
|
405
408
|
},
|
|
@@ -499,6 +502,9 @@ const locale = {
|
|
|
499
502
|
"decrease_indent_d9cf469d": {
|
|
500
503
|
"message": "減少縮排"
|
|
501
504
|
},
|
|
505
|
+
"decrease_rich_content_area_82068f64": {
|
|
506
|
+
"message": "減少多種格式的內容區域"
|
|
507
|
+
},
|
|
502
508
|
"deep_purple_bb3e2907": {
|
|
503
509
|
"message": "深紫色"
|
|
504
510
|
},
|
|
@@ -1081,6 +1087,9 @@ const locale = {
|
|
|
1081
1087
|
"increase_indent_6af90f7c": {
|
|
1082
1088
|
"message": "增加縮進"
|
|
1083
1089
|
},
|
|
1090
|
+
"increase_rich_content_area_340b775": {
|
|
1091
|
+
"message": "增加多種格式的內容區域"
|
|
1092
|
+
},
|
|
1084
1093
|
"indefinite_integral_6623307e": {
|
|
1085
1094
|
"message": "無限積分"
|
|
1086
1095
|
},
|
|
@@ -1123,6 +1132,9 @@ const locale = {
|
|
|
1123
1132
|
"intersection_cd4590e4": {
|
|
1124
1133
|
"message": "交集"
|
|
1125
1134
|
},
|
|
1135
|
+
"invalid_description_991e23bb": {
|
|
1136
|
+
"message": "無效的描述"
|
|
1137
|
+
},
|
|
1126
1138
|
"invalid_entry_f7d2a0f5": {
|
|
1127
1139
|
"message": "無效的輸入項目。"
|
|
1128
1140
|
},
|
|
@@ -1690,9 +1702,18 @@ const locale = {
|
|
|
1690
1702
|
"please_allow_canvas_to_access_your_microphone_and__dc2c3079": {
|
|
1691
1703
|
"message": "請允許 Canvas 存取您的麥克風和網路攝影機。"
|
|
1692
1704
|
},
|
|
1705
|
+
"please_choose_a_file_c2449cc": {
|
|
1706
|
+
"message": "請選擇一個檔案"
|
|
1707
|
+
},
|
|
1693
1708
|
"please_decribe_what_you_would_like_to_compose_27a51be5": {
|
|
1694
1709
|
"message": "請描述您想創作什麼。"
|
|
1695
1710
|
},
|
|
1711
|
+
"please_enter_a_file_name_f159edc1": {
|
|
1712
|
+
"message": "請輸入一個檔案名稱"
|
|
1713
|
+
},
|
|
1714
|
+
"please_select_a_file_of_a_supported_type_1fc578f2": {
|
|
1715
|
+
"message": "請選取支援類型的檔案"
|
|
1716
|
+
},
|
|
1696
1717
|
"plus_d43cd4ec": {
|
|
1697
1718
|
"message": "+"
|
|
1698
1719
|
},
|
|
@@ -2242,8 +2263,11 @@ const locale = {
|
|
|
2242
2263
|
"the_first_heading_on_a_page_should_be_an_h2_859089f2": {
|
|
2243
2264
|
"message": "頁面的第一個標題應該是 H2。"
|
|
2244
2265
|
},
|
|
2245
|
-
"
|
|
2246
|
-
"message": "
|
|
2266
|
+
"the_height_of_rich_content_area_is_decreased_36920e0": {
|
|
2267
|
+
"message": "多種格式的內容區域的高度已減少。"
|
|
2268
|
+
},
|
|
2269
|
+
"the_height_of_rich_content_area_is_increased_74c2358d": {
|
|
2270
|
+
"message": "多種格式的內容區域的高度已增加。"
|
|
2247
2271
|
},
|
|
2248
2272
|
"the_material_is_in_the_public_domain_279c39a3": {
|
|
2249
2273
|
"message": "該材料位於公用網域中。"
|
|
@@ -2254,9 +2278,6 @@ const locale = {
|
|
|
2254
2278
|
"the_material_is_subject_to_an_exception_e_g_fair_u_a39c8ca2": {
|
|
2255
2279
|
"message": "可能有適用於此資料的例外情況 - 如:合理使用、引用權,或適用版權法下的其他情況"
|
|
2256
2280
|
},
|
|
2257
|
-
"the_preceding_content_is_partner_provided_d753928c": {
|
|
2258
|
-
"message": "上述內容由合作夥伴提供"
|
|
2259
|
-
},
|
|
2260
2281
|
"the_pretty_html_editor_is_not_keyboard_accessible__d6d5d2b": {
|
|
2261
2282
|
"message": "美觀 HTML 編輯器無法用鍵盤存取。按 ShiftO 開啟原始 HTML 編輯器。"
|
|
2262
2283
|
},
|
|
@@ -2296,6 +2317,9 @@ const locale = {
|
|
|
2296
2317
|
"this_image_is_currently_unavailable_25c68857": {
|
|
2297
2318
|
"message": "此圖像目前不可用"
|
|
2298
2319
|
},
|
|
2320
|
+
"this_video_may_display_youtube_ads_4d19d590": {
|
|
2321
|
+
"message": "此影片可能會顯示 YouTube 廣告。"
|
|
2322
|
+
},
|
|
2299
2323
|
"though_your_video_will_have_the_correct_title_in_t_90e427f3": {
|
|
2300
2324
|
"message": "雖然您的影片在瀏覽器中有正確的標題,但我們無法在資料庫中將其更新。"
|
|
2301
2325
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright (C)
|
|
2
|
+
* Copyright (C) 2025 - present Instructure, Inc.
|
|
3
3
|
*
|
|
4
4
|
* This file is part of Canvas.
|
|
5
5
|
*
|
|
@@ -15,25 +15,14 @@
|
|
|
15
15
|
* You should have received a copy of the GNU Affero General Public License along
|
|
16
16
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
17
17
|
*/
|
|
18
|
-
import {axeCheck, createReport} from 'axe-testcafe'
|
|
19
|
-
fixture`aXe a11y checking`.page`./testcafe.html`
|
|
20
18
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
19
|
+
export const normalizeContainingContext = context => {
|
|
20
|
+
if (context && !['user', 'course', 'group'].includes(context.contextType)) {
|
|
21
|
+
return {
|
|
22
|
+
...context,
|
|
23
|
+
contextType: 'user',
|
|
24
|
+
contextId: context.userId
|
|
25
|
+
};
|
|
25
26
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
test('automated a11y testing', async t => {
|
|
29
|
-
const axeContext = {
|
|
30
|
-
include: 'body',
|
|
31
|
-
}
|
|
32
|
-
const axeOptions = {
|
|
33
|
-
runOnly: {
|
|
34
|
-
type: 'tag',
|
|
35
|
-
values: ['wcag21a', 'wcag21aa', 'best-practice', 'section508'],
|
|
36
|
-
},
|
|
37
|
-
}
|
|
38
|
-
await runAxeCheck(t, axeContext, axeOptions)
|
|
39
|
-
})
|
|
27
|
+
return context;
|
|
28
|
+
};
|
|
@@ -33,11 +33,11 @@ export async function placeholderInfoFor(fileMetaProps) {
|
|
|
33
33
|
const ariaLabel = formatMessage('Loading placeholder for {fileName}', {
|
|
34
34
|
fileName: fileName !== null && fileName !== void 0 ? fileName : 'unknown filename'
|
|
35
35
|
});
|
|
36
|
-
if (typeof fileMetaProps.contentType !== 'string') {
|
|
37
|
-
throw new Error('Invalid fileMetaProps.contentType');
|
|
38
|
-
}
|
|
39
36
|
const type = fileMetaProps.contentType || fileMetaProps.type;
|
|
40
|
-
if (
|
|
37
|
+
if (typeof type !== 'string') {
|
|
38
|
+
throw new Error('Invalid type: ' + type);
|
|
39
|
+
}
|
|
40
|
+
if (isImage(type) && fileMetaProps.displayAs !== 'link') {
|
|
41
41
|
var _trimmedOrNull2;
|
|
42
42
|
const imageUrl = (_trimmedOrNull2 = trimmedOrNull(fileMetaProps.domObject.preview)) !== null && _trimmedOrNull2 !== void 0 ? _trimmedOrNull2 : URL.createObjectURL(fileMetaProps.domObject);
|
|
43
43
|
return new Promise((resolve, reject) => {
|
|
@@ -54,7 +54,7 @@ export async function placeholderInfoFor(fileMetaProps) {
|
|
|
54
54
|
image.onerror = () => reject(new Error('Failed to load image: ' + imageUrl));
|
|
55
55
|
image.src = imageUrl;
|
|
56
56
|
});
|
|
57
|
-
} else if (
|
|
57
|
+
} else if (isVideo(type)) {
|
|
58
58
|
const videoSize = videoDefaultSize();
|
|
59
59
|
return {
|
|
60
60
|
type: 'block',
|
|
@@ -64,7 +64,7 @@ export async function placeholderInfoFor(fileMetaProps) {
|
|
|
64
64
|
height: videoSize.height,
|
|
65
65
|
vAlign: 'bottom'
|
|
66
66
|
};
|
|
67
|
-
} else if (
|
|
67
|
+
} else if (isAudio(type)) {
|
|
68
68
|
return {
|
|
69
69
|
type: 'block',
|
|
70
70
|
visibleLabel,
|
|
@@ -159,7 +159,7 @@ export async function insertPlaceholder(editor, unencodedName, placeholderInfoPr
|
|
|
159
159
|
const labelElem = editor.dom.doc.createElement('div');
|
|
160
160
|
placeholderElem.appendChild(labelElem);
|
|
161
161
|
Object.assign(labelElem.style, {
|
|
162
|
-
color: '#
|
|
162
|
+
color: '#273540',
|
|
163
163
|
zIndex: '1000',
|
|
164
164
|
/* Restrict text to one line */
|
|
165
165
|
display: 'inline-block',
|
|
@@ -179,7 +179,7 @@ export async function insertPlaceholder(editor, unencodedName, placeholderInfoPr
|
|
|
179
179
|
padding: '5px',
|
|
180
180
|
verticalAlign: 'baseline',
|
|
181
181
|
gap: '8px',
|
|
182
|
-
backgroundColor: '#
|
|
182
|
+
backgroundColor: '#F2F4F4'
|
|
183
183
|
});
|
|
184
184
|
break;
|
|
185
185
|
case 'block':
|
|
@@ -299,8 +299,8 @@ function spinnerSvg(size, labelId) {
|
|
|
299
299
|
position: relative;
|
|
300
300
|
box-sizing: border-box;
|
|
301
301
|
overflow: hidden;
|
|
302
|
-
--Spinner-trackColor: #
|
|
303
|
-
--Spinner-color: #
|
|
302
|
+
--Spinner-trackColor: #F2F4F4;
|
|
303
|
+
--Spinner-color: #2B7ABC;
|
|
304
304
|
--Spinner-xSmallSize: 1.5em;
|
|
305
305
|
--Spinner-xSmallBorderWidth: 0.25em;
|
|
306
306
|
--Spinner-smallSize: 3em;
|
|
@@ -309,7 +309,7 @@ function spinnerSvg(size, labelId) {
|
|
|
309
309
|
--Spinner-mediumBorderWidth: 0.5em;
|
|
310
310
|
--Spinner-largeSize: 7em;
|
|
311
311
|
--Spinner-largeBorderWidth: 0.75em;
|
|
312
|
-
--Spinner-inverseColor: #
|
|
312
|
+
--Spinner-inverseColor: #2B7ABC;
|
|
313
313
|
}
|
|
314
314
|
|
|
315
315
|
.Spinner-circleTrack {
|
package/eslint.config.js
CHANGED
|
@@ -14,17 +14,10 @@ const pluginJest = require('eslint-plugin-jest')
|
|
|
14
14
|
module.exports = tseslint.config(
|
|
15
15
|
// General
|
|
16
16
|
{
|
|
17
|
-
files: ['src/**/*.ts'
|
|
17
|
+
files: ['src/**/*.ts'],
|
|
18
18
|
},
|
|
19
19
|
{
|
|
20
|
-
ignores: [
|
|
21
|
-
'es/**/*',
|
|
22
|
-
'./src/translations/*/*',
|
|
23
|
-
'scripts',
|
|
24
|
-
'packages/canvas-rce/webpack.testcafe.config.js',
|
|
25
|
-
'testcafe/',
|
|
26
|
-
'webpack.*.config.js',
|
|
27
|
-
],
|
|
20
|
+
ignores: ['es/**/*', './src/translations/*/*', 'scripts', 'webpack.*.config.js'],
|
|
28
21
|
},
|
|
29
22
|
|
|
30
23
|
// Globals
|
|
@@ -165,11 +158,7 @@ module.exports = tseslint.config(
|
|
|
165
158
|
// Imports
|
|
166
159
|
importPlugin.flatConfigs.recommended,
|
|
167
160
|
{
|
|
168
|
-
files: [
|
|
169
|
-
'__tests__/**/*.{js,mjs,ts,jsx,tsx}',
|
|
170
|
-
'src/**/*.{js,mjs,ts,jsx,tsx}',
|
|
171
|
-
'testcafe/**/*.{js,mjs,ts,jsx,tsx}',
|
|
172
|
-
],
|
|
161
|
+
files: ['__tests__/**/*.{js,mjs,ts,jsx,tsx}', 'src/**/*.{js,mjs,ts,jsx,tsx}'],
|
|
173
162
|
ignores: ['src/translations/**'],
|
|
174
163
|
languageOptions: {
|
|
175
164
|
ecmaVersion: 'latest',
|
|
@@ -212,17 +201,6 @@ module.exports = tseslint.config(
|
|
|
212
201
|
},
|
|
213
202
|
},
|
|
214
203
|
|
|
215
|
-
// Testcafe
|
|
216
|
-
{
|
|
217
|
-
files: ['testcafe/**/*.{js,mjs,ts,jsx,tsx}'],
|
|
218
|
-
languageOptions: {
|
|
219
|
-
globals: {
|
|
220
|
-
test: true,
|
|
221
|
-
fixture: true,
|
|
222
|
-
},
|
|
223
|
-
},
|
|
224
|
-
},
|
|
225
|
-
|
|
226
204
|
// Jest
|
|
227
205
|
{
|
|
228
206
|
files: [
|
package/jest/jest-setup.js
CHANGED
|
@@ -25,6 +25,30 @@ import {TextDecoder, TextEncoder} from 'util'
|
|
|
25
25
|
global.TextEncoder = TextEncoder
|
|
26
26
|
global.TextDecoder = TextDecoder
|
|
27
27
|
|
|
28
|
+
// Add fetch polyfills for msw
|
|
29
|
+
require('isomorphic-fetch')
|
|
30
|
+
|
|
31
|
+
// Add BroadcastChannel polyfill for msw
|
|
32
|
+
if (!globalThis.BroadcastChannel) {
|
|
33
|
+
globalThis.BroadcastChannel = class BroadcastChannel {
|
|
34
|
+
constructor() {}
|
|
35
|
+
postMessage() {}
|
|
36
|
+
close() {}
|
|
37
|
+
addEventListener() {}
|
|
38
|
+
removeEventListener() {}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// Add TransformStream polyfill for msw
|
|
43
|
+
if (!globalThis.TransformStream) {
|
|
44
|
+
globalThis.TransformStream = class TransformStream {
|
|
45
|
+
constructor() {
|
|
46
|
+
this.readable = {}
|
|
47
|
+
this.writable = {}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
28
52
|
/**
|
|
29
53
|
* We want to ensure errors and warnings get appropriate eyes. If
|
|
30
54
|
* you are seeing an exception from here, it probably means you
|
|
@@ -59,6 +83,7 @@ const ignoredErrors = [
|
|
|
59
83
|
/Warning: findDOMNode is deprecated and will be removed in the next major release. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https:\/\/reactjs.org\/link\/strict-mode-find-node/,
|
|
60
84
|
/Warning: %s uses the legacy childContextTypes API which is no longer supported and will be removed in the next major release. Use React.createContext\(\) instead/,
|
|
61
85
|
/Warning: %s uses the legacy contextTypes API which is no longer supported and will be removed in the next major release. Use React.createContext\(\) with static contextType instead./,
|
|
86
|
+
/Warning: Unknown event handler property `%s`. It will be ignored.%s/,
|
|
62
87
|
]
|
|
63
88
|
const globalWarn = global.console.warn
|
|
64
89
|
const ignoredWarnings = [
|
|
@@ -78,7 +103,7 @@ global.console = {
|
|
|
78
103
|
}
|
|
79
104
|
globalError(error)
|
|
80
105
|
throw new Error(
|
|
81
|
-
`Looks like you have an unhandled error. Keep our test logs clean by handling or filtering it. ${error}
|
|
106
|
+
`Looks like you have an unhandled error. Keep our test logs clean by handling or filtering it. ${error}`,
|
|
82
107
|
)
|
|
83
108
|
},
|
|
84
109
|
warn: warning => {
|
|
@@ -87,7 +112,7 @@ global.console = {
|
|
|
87
112
|
}
|
|
88
113
|
globalWarn(warning)
|
|
89
114
|
throw new Error(
|
|
90
|
-
`Looks like you have an unhandled warning. Keep our test logs clean by handling or filtering it. ${warning}
|
|
115
|
+
`Looks like you have an unhandled warning. Keep our test logs clean by handling or filtering it. ${warning}`,
|
|
91
116
|
)
|
|
92
117
|
},
|
|
93
118
|
info: console.info,
|
package/jest.config.js
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
// Used to enable babel transformations for node_modules that use ecmascript module syntax directly
|
|
20
20
|
// From https://github.com/nrwl/nx/issues/812
|
|
21
|
-
const esModules = ['text-field-edit', '@instructure\\/ui-icons'].join('|')
|
|
21
|
+
const esModules = ['text-field-edit', '@instructure\\/ui-icons', 'msw'].join('|')
|
|
22
22
|
|
|
23
23
|
module.exports = {
|
|
24
24
|
setupFiles: ['jest-canvas-mock', '<rootDir>/jest/jest-setup.js'],
|
|
@@ -43,6 +43,10 @@ module.exports = {
|
|
|
43
43
|
modulePathIgnorePatterns: ['<rootDir>/es', '<rootDir>/canvas'],
|
|
44
44
|
transformIgnorePatterns: [`/node_modules/(?!${esModules})`],
|
|
45
45
|
testEnvironment: 'jsdom',
|
|
46
|
+
testEnvironmentOptions: {
|
|
47
|
+
// https://github.com/mswjs/examples/blob/main/examples/with-jest/jest.config.ts#L20
|
|
48
|
+
customExportConditions: [''],
|
|
49
|
+
},
|
|
46
50
|
moduleNameMapper: {
|
|
47
51
|
// jest can't import css
|
|
48
52
|
'\\.(css|less)$': '<rootDir>/src/rce/__mocks__/styleMock.js',
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/canvas-rce",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.2.0",
|
|
4
4
|
"description": "A component wrapping Canvas's usage of Tinymce",
|
|
5
5
|
"main": "es/index.js",
|
|
6
6
|
"types": "es/index.d.ts",
|
|
7
|
-
"owner": "
|
|
7
|
+
"owner": "RCX",
|
|
8
8
|
"scripts": {
|
|
9
9
|
"i18n:extract": "format-message extract \"es/**/*.js\" -g underscored_crc32 -o locales/en.json",
|
|
10
10
|
"integration-test": "nightwatch --env integration",
|
|
@@ -14,14 +14,6 @@
|
|
|
14
14
|
"test:parallel": "yarn test:jest",
|
|
15
15
|
"test:serial": "yarn test:jest",
|
|
16
16
|
"test:jest": "jest --color",
|
|
17
|
-
"test:cafe": "yarn build:cafe && yarn test:cafe:only",
|
|
18
|
-
"test:cafe:ui": "yarn build:cafe && yarn test:cafe:only:ui",
|
|
19
|
-
"test:cafe:only": "testcafe ${TESTCAFE_PROVIDER:-chrome:headless} testcafe/**/*.test.js",
|
|
20
|
-
"test:cafe:only:ui": "testcafe chrome testcafe/**/*.test.js -s takeOnFails=true",
|
|
21
|
-
"test:cafe:only:debug": "testcafe chrome testcafe/**/*.test.js --debug-mode -s takeOnFails=true",
|
|
22
|
-
"test:cafe:one": "testcafe chrome testcafe/**/*.test.js --test ",
|
|
23
|
-
"test:cafe:all": "yarn build:cafe && testcafe chrome,firefox,safari testcafe/**/*.test.js",
|
|
24
|
-
"test:cafe:debug": "yarn build:cafe && yarn test:cafe:only:debug",
|
|
25
17
|
"test:jest:debug": "node --inspect-brk node_modules/.bin/jest --runInBand",
|
|
26
18
|
"test:jest:watch": "node node_modules/.bin/jest --watch",
|
|
27
19
|
"demo": "scripts/demo.sh",
|
|
@@ -35,7 +27,6 @@
|
|
|
35
27
|
"build:types": "tsc",
|
|
36
28
|
"build:canvas": "yarn run build",
|
|
37
29
|
"build:watch": "yarn clean:es && yarn build:es --watch",
|
|
38
|
-
"build:cafe": "wp --config webpack.testcafe.config.js",
|
|
39
30
|
"prepublishOnly": "yarn build && yarn test",
|
|
40
31
|
"fmt:check": "biome check",
|
|
41
32
|
"fmt:fix": "biome format --write",
|
|
@@ -54,92 +45,83 @@
|
|
|
54
45
|
],
|
|
55
46
|
"author": "Instructure, Inc",
|
|
56
47
|
"license": "AGPL-3.0",
|
|
57
|
-
"browserslist": [
|
|
58
|
-
"extends @instructure/browserslist-config-canvas-lms"
|
|
59
|
-
],
|
|
48
|
+
"browserslist": ["extends @instructure/browserslist-config-canvas-lms"],
|
|
60
49
|
"nyc": {
|
|
61
|
-
"include": [
|
|
62
|
-
"shared/**/*.js",
|
|
63
|
-
"src/**/*.js"
|
|
64
|
-
],
|
|
50
|
+
"include": ["shared/**/*.js", "src/**/*.js"],
|
|
65
51
|
"exclude": [],
|
|
66
|
-
"require": [
|
|
67
|
-
"@babel/register",
|
|
68
|
-
"@instructure/canvas-theme"
|
|
69
|
-
],
|
|
52
|
+
"require": ["@babel/register", "@instructure/canvas-theme"],
|
|
70
53
|
"sourceMap": false,
|
|
71
54
|
"instrument": false
|
|
72
55
|
},
|
|
73
56
|
"dependencies": {
|
|
74
|
-
"@instructure/canvas-theme": "10.
|
|
57
|
+
"@instructure/canvas-theme": "10.24.2",
|
|
75
58
|
"@instructure/canvas-media": "*",
|
|
76
|
-
"@instructure/debounce": "10.
|
|
77
|
-
"@instructure/emotion": "10.
|
|
59
|
+
"@instructure/debounce": "10.24.2",
|
|
60
|
+
"@instructure/emotion": "10.24.2",
|
|
78
61
|
"@instructure/k5uploader": "*",
|
|
79
62
|
"@instructure/media-capture": "^9.0.0",
|
|
80
|
-
"@instructure/theme-registry": "10.
|
|
81
|
-
"@instructure/ui-a11y-content": "10.
|
|
82
|
-
"@instructure/ui-a11y-utils": "10.
|
|
83
|
-
"@instructure/ui-alerts": "10.
|
|
84
|
-
"@instructure/ui-avatar": "10.
|
|
85
|
-
"@instructure/ui-badge": "10.
|
|
86
|
-
"@instructure/ui-billboard": "10.
|
|
87
|
-
"@instructure/ui-buttons": "10.
|
|
88
|
-
"@instructure/ui-checkbox": "10.
|
|
89
|
-
"@instructure/ui-source-code-editor": "10.
|
|
90
|
-
"@instructure/ui-color-picker": "10.
|
|
91
|
-
"@instructure/ui-color-utils": "10.
|
|
92
|
-
"@instructure/ui-file-drop": "10.
|
|
93
|
-
"@instructure/ui-flex": "10.
|
|
94
|
-
"@instructure/ui-focusable": "10.
|
|
95
|
-
"@instructure/ui-form-field": "10.
|
|
96
|
-
"@instructure/ui-grid": "10.
|
|
97
|
-
"@instructure/ui-heading": "10.
|
|
98
|
-
"@instructure/ui-icons": "10.
|
|
99
|
-
"@instructure/ui-img": "10.
|
|
100
|
-
"@instructure/ui-link": "10.
|
|
101
|
-
"@instructure/ui-list": "10.
|
|
63
|
+
"@instructure/theme-registry": "10.24.2",
|
|
64
|
+
"@instructure/ui-a11y-content": "10.24.2",
|
|
65
|
+
"@instructure/ui-a11y-utils": "10.24.2",
|
|
66
|
+
"@instructure/ui-alerts": "10.24.2",
|
|
67
|
+
"@instructure/ui-avatar": "10.24.2",
|
|
68
|
+
"@instructure/ui-badge": "10.24.2",
|
|
69
|
+
"@instructure/ui-billboard": "10.24.2",
|
|
70
|
+
"@instructure/ui-buttons": "10.24.2",
|
|
71
|
+
"@instructure/ui-checkbox": "10.24.2",
|
|
72
|
+
"@instructure/ui-source-code-editor": "10.24.2",
|
|
73
|
+
"@instructure/ui-color-picker": "10.24.2",
|
|
74
|
+
"@instructure/ui-color-utils": "10.24.2",
|
|
75
|
+
"@instructure/ui-file-drop": "10.24.2",
|
|
76
|
+
"@instructure/ui-flex": "10.24.2",
|
|
77
|
+
"@instructure/ui-focusable": "10.24.2",
|
|
78
|
+
"@instructure/ui-form-field": "10.24.2",
|
|
79
|
+
"@instructure/ui-grid": "10.24.2",
|
|
80
|
+
"@instructure/ui-heading": "10.24.2",
|
|
81
|
+
"@instructure/ui-icons": "10.24.2",
|
|
82
|
+
"@instructure/ui-img": "10.24.2",
|
|
83
|
+
"@instructure/ui-link": "10.24.2",
|
|
84
|
+
"@instructure/ui-list": "10.24.2",
|
|
102
85
|
"@instructure/ui-media-player": "^9.0.0",
|
|
103
|
-
"@instructure/ui-menu": "10.
|
|
104
|
-
"@instructure/ui-modal": "10.
|
|
105
|
-
"@instructure/ui-motion": "10.
|
|
106
|
-
"@instructure/ui-number-input": "10.
|
|
107
|
-
"@instructure/ui-overlays": "10.
|
|
108
|
-
"@instructure/ui-pagination": "10.
|
|
109
|
-
"@instructure/ui-pill": "10.
|
|
110
|
-
"@instructure/ui-popover": "10.
|
|
111
|
-
"@instructure/ui-radio-input": "10.
|
|
112
|
-
"@instructure/ui-simple-select": "10.
|
|
113
|
-
"@instructure/ui-spinner": "10.
|
|
114
|
-
"@instructure/ui-svg-images": "10.
|
|
115
|
-
"@instructure/ui-table": "10.
|
|
116
|
-
"@instructure/ui-tabs": "10.
|
|
117
|
-
"@instructure/ui-text-area": "10.
|
|
118
|
-
"@instructure/ui-text-input": "10.
|
|
119
|
-
"@instructure/ui-text": "10.
|
|
120
|
-
"@instructure/ui-themes": "10.
|
|
121
|
-
"@instructure/ui-toggle-details": "10.
|
|
122
|
-
"@instructure/ui-tooltip": "10.
|
|
123
|
-
"@instructure/ui-tray": "10.
|
|
124
|
-
"@instructure/ui-tree-browser": "10.
|
|
125
|
-
"@instructure/ui-truncate-text": "10.
|
|
126
|
-
"@instructure/ui-utils": "10.
|
|
127
|
-
"@instructure/ui-view": "10.
|
|
128
|
-
"@instructure/uid": "10.
|
|
86
|
+
"@instructure/ui-menu": "10.24.2",
|
|
87
|
+
"@instructure/ui-modal": "10.24.2",
|
|
88
|
+
"@instructure/ui-motion": "10.24.2",
|
|
89
|
+
"@instructure/ui-number-input": "10.24.2",
|
|
90
|
+
"@instructure/ui-overlays": "10.24.2",
|
|
91
|
+
"@instructure/ui-pagination": "10.24.2",
|
|
92
|
+
"@instructure/ui-pill": "10.24.2",
|
|
93
|
+
"@instructure/ui-popover": "10.24.2",
|
|
94
|
+
"@instructure/ui-radio-input": "10.24.2",
|
|
95
|
+
"@instructure/ui-simple-select": "10.24.2",
|
|
96
|
+
"@instructure/ui-spinner": "10.24.2",
|
|
97
|
+
"@instructure/ui-svg-images": "10.24.2",
|
|
98
|
+
"@instructure/ui-table": "10.24.2",
|
|
99
|
+
"@instructure/ui-tabs": "10.24.2",
|
|
100
|
+
"@instructure/ui-text-area": "10.24.2",
|
|
101
|
+
"@instructure/ui-text-input": "10.24.2",
|
|
102
|
+
"@instructure/ui-text": "10.24.2",
|
|
103
|
+
"@instructure/ui-themes": "10.24.2",
|
|
104
|
+
"@instructure/ui-toggle-details": "10.24.2",
|
|
105
|
+
"@instructure/ui-tooltip": "10.24.2",
|
|
106
|
+
"@instructure/ui-tray": "10.24.2",
|
|
107
|
+
"@instructure/ui-tree-browser": "10.24.2",
|
|
108
|
+
"@instructure/ui-truncate-text": "10.24.2",
|
|
109
|
+
"@instructure/ui-utils": "10.24.2",
|
|
110
|
+
"@instructure/ui-view": "10.24.2",
|
|
111
|
+
"@instructure/uid": "10.24.2",
|
|
129
112
|
"@sheerun/mutationobserver-shim": "^0.3.2",
|
|
130
113
|
"@types/tinycolor2": "^1.4.6",
|
|
131
114
|
"@tinymce/tinymce-react": "~3.8.4",
|
|
132
115
|
"aphrodite": "^2",
|
|
133
|
-
"axios": "^
|
|
116
|
+
"axios": "^1.11.0",
|
|
134
117
|
"bloody-offset": "0.0.0",
|
|
135
|
-
"crypto-es": "^2.0
|
|
118
|
+
"crypto-es": "^2.1.0",
|
|
136
119
|
"classnames": "^2.2.5",
|
|
137
|
-
"concurrently": "^4",
|
|
138
120
|
"format-message": "^6",
|
|
139
121
|
"format-message-generate-id": "^6",
|
|
140
122
|
"i18n-js": "^3",
|
|
141
123
|
"isomorphic-fetch": "2.2.1",
|
|
142
|
-
"js-beautify": "1",
|
|
124
|
+
"js-beautify": "1.14.9",
|
|
143
125
|
"keycode": "^2",
|
|
144
126
|
"lodash": "^4",
|
|
145
127
|
"mathlive": "^0.77.0",
|
|
@@ -181,7 +163,6 @@
|
|
|
181
163
|
"@types/react": "^18",
|
|
182
164
|
"@types/react-dom": "^18",
|
|
183
165
|
"@types/testing-library__jest-dom": "^5.0.0",
|
|
184
|
-
"axe-testcafe": "^3",
|
|
185
166
|
"babel-loader": "^9.1.3",
|
|
186
167
|
"babel-plugin-dynamic-import-node": "^2.2.0",
|
|
187
168
|
"babel-plugin-inline-json-import": "^0.2.0",
|
|
@@ -200,16 +181,12 @@
|
|
|
200
181
|
"jest-mock-proxy": "3.1.2",
|
|
201
182
|
"jest": "^28",
|
|
202
183
|
"mathjax": "^3.2.0",
|
|
203
|
-
"
|
|
184
|
+
"msw": "^2.7",
|
|
204
185
|
"nyc": "^13",
|
|
205
186
|
"proxyquire": "1.7.4",
|
|
206
187
|
"shelljs": "^0.8.3",
|
|
207
|
-
"sinon": "^7",
|
|
208
188
|
"skin-deep": "^1",
|
|
209
189
|
"source-map-support": "0.5.21",
|
|
210
|
-
"testcafe-browser-provider-selenium": "^1.2.0",
|
|
211
|
-
"testcafe-react-selectors": "^3.3.0",
|
|
212
|
-
"testcafe": "1.14.2",
|
|
213
190
|
"ts-node": "^10.9.2",
|
|
214
191
|
"typescript": "*",
|
|
215
192
|
"url-loader": "^4.1.1",
|
|
@@ -221,4 +198,4 @@
|
|
|
221
198
|
"resolutions": {
|
|
222
199
|
"format-message-estree-util": "./packages/format-message-estree-util"
|
|
223
200
|
}
|
|
224
|
-
}
|
|
201
|
+
}
|