@instructure/canvas-rce 7.0.0 → 7.3.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.
Files changed (152) hide show
  1. package/CHANGELOG.md +60 -1
  2. package/__tests__/common/indicate.test.js +5 -6
  3. package/es/bridge/Bridge.js +2 -4
  4. package/es/canvasFileBrowser/FileBrowser.js +2 -4
  5. package/es/defaultTinymceConfig.d.ts +1 -1
  6. package/es/defaultTinymceConfig.js +149 -114
  7. package/es/enhance-user-content/doc_previews.js +1 -14
  8. package/es/enhance-user-content/enhance_user_content.js +7 -1
  9. package/es/enhance-user-content/instructure_helper.js +4 -0
  10. package/es/enhance-user-content/youtube_overlay.d.ts +1 -0
  11. package/es/enhance-user-content/youtube_overlay.js +87 -0
  12. package/es/format-message.d.js +1 -0
  13. package/es/format-message.js +5 -0
  14. package/es/index.d.ts +2 -1
  15. package/es/index.js +2 -1
  16. package/es/rce/AlertMessageArea.d.ts +2 -2
  17. package/es/rce/AlertMessageArea.js +4 -6
  18. package/es/rce/RCE.d.ts +0 -1
  19. package/es/rce/RCE.js +5 -10
  20. package/es/rce/RCEGlobals.d.ts +2 -0
  21. package/es/rce/RCEGlobals.js +1 -0
  22. package/es/rce/RCEVariants.d.ts +8 -3
  23. package/es/rce/RCEVariants.js +31 -5
  24. package/es/rce/RCEWrapper.d.ts +16 -14
  25. package/es/rce/RCEWrapper.js +260 -244
  26. package/es/rce/RCEWrapperProps.d.ts +1 -1
  27. package/es/rce/ShowOnFocusButton/index.js +4 -2
  28. package/es/rce/StatusBar.js +61 -15
  29. package/es/rce/alertHandler.js +6 -7
  30. package/es/rce/plugins/instructure-ui-icons/plugin.js +2 -2
  31. package/es/rce/plugins/instructure_equation/EquationEditorModal/index.js +6 -10
  32. package/es/rce/plugins/instructure_icon_maker/components/CreateIconMakerForm/ImageSection/Course.d.ts +5 -15
  33. package/es/rce/plugins/instructure_icon_maker/components/CreateIconMakerForm/ImageSection/Course.js +4 -10
  34. package/es/rce/plugins/instructure_image/ImageEmbedOptions.d.ts +7 -0
  35. package/es/rce/plugins/instructure_image/ImageEmbedOptions.js +45 -2
  36. package/es/rce/plugins/instructure_keyboard_shortcuts_header/clickCallback.d.ts +2 -0
  37. package/es/rce/plugins/instructure_keyboard_shortcuts_header/clickCallback.js +45 -0
  38. package/es/rce/plugins/instructure_keyboard_shortcuts_header/plugin.d.ts +1 -0
  39. package/es/rce/plugins/instructure_keyboard_shortcuts_header/plugin.js +43 -0
  40. package/es/rce/plugins/instructure_rce_external_tools/components/ExternalToolDialog/ExternalToolDialog.d.ts +1 -8
  41. package/es/rce/plugins/instructure_rce_external_tools/components/ExternalToolDialog/ExternalToolDialog.js +13 -33
  42. package/es/rce/plugins/instructure_rce_external_tools/components/ExternalToolDialog/ExternalToolDialogModal.d.ts +1 -2
  43. package/es/rce/plugins/instructure_rce_external_tools/components/ExternalToolDialog/ExternalToolDialogModal.js +2 -1
  44. package/es/rce/plugins/instructure_rce_external_tools/components/ExternalToolSelectionDialog/ExternalToolSelectionDialog.d.ts +1 -1
  45. package/es/rce/plugins/instructure_rce_external_tools/components/ExternalToolSelectionDialog/ExternalToolSelectionDialog.js +25 -25
  46. package/es/rce/plugins/instructure_record/AudioOptionsTray/TrayController.d.ts +1 -1
  47. package/es/rce/plugins/instructure_record/AudioOptionsTray/TrayController.js +2 -1
  48. package/es/rce/plugins/instructure_record/VideoOptionsTray/TrayController.d.ts +1 -1
  49. package/es/rce/plugins/instructure_record/VideoOptionsTray/TrayController.js +2 -1
  50. package/es/rce/plugins/instructure_record/VideoOptionsTray/index.js +10 -7
  51. package/es/rce/plugins/instructure_record/mediaTranslations.js +1 -1
  52. package/es/rce/plugins/instructure_studio_media_options/plugin.js +109 -14
  53. package/es/rce/plugins/instructure_studio_media_options/studioToolbarIcons.d.ts +5 -0
  54. package/es/rce/plugins/instructure_studio_media_options/studioToolbarIcons.js +23 -0
  55. package/es/rce/plugins/instructure_wordcount_header/plugin.d.ts +1 -0
  56. package/es/rce/plugins/instructure_wordcount_header/plugin.js +75 -0
  57. package/es/rce/plugins/shared/ContentSelection.d.ts +1 -2
  58. package/es/rce/plugins/shared/ContentSelection.js +1 -18
  59. package/es/rce/plugins/shared/DimensionsInput/index.js +3 -3
  60. package/es/rce/plugins/shared/FixedContentTray.d.ts +7 -23
  61. package/es/rce/plugins/shared/FixedContentTray.js +7 -16
  62. package/es/rce/plugins/shared/ImageCropper/constants.d.ts +1 -1
  63. package/es/rce/plugins/shared/ImageCropper/constants.js +1 -1
  64. package/es/rce/plugins/shared/ImageCropper/controls/CustomNumberInput.js +1 -1
  65. package/es/rce/plugins/shared/PreviewIcon.js +1 -1
  66. package/es/rce/plugins/shared/StudioLtiSupportUtils.d.ts +9 -1
  67. package/es/rce/plugins/shared/StudioLtiSupportUtils.js +94 -1
  68. package/es/rce/plugins/shared/Upload/ComputerPanel.js +1 -1
  69. package/es/rce/plugins/shared/Upload/UploadFileModal.js +37 -4
  70. package/es/rce/plugins/shared/Upload/VideoUrlPanel.d.ts +15 -0
  71. package/es/rce/plugins/shared/Upload/VideoUrlPanel.js +51 -0
  72. package/es/rce/plugins/shared/Upload/videoValidationUtils.d.ts +7 -0
  73. package/es/rce/plugins/shared/Upload/videoValidationUtils.js +58 -0
  74. package/es/rce/plugins/shared/ai_tools/aiicons.d.ts +3 -3
  75. package/es/rce/plugins/shared/ai_tools/aiicons.js +11 -11
  76. package/es/rce/plugins/shared/iframeUtils.d.ts +1 -0
  77. package/es/rce/plugins/shared/iframeUtils.js +37 -0
  78. package/es/rce/plugins/tinymce-a11y-checker/components/checker.js +7 -1
  79. package/es/rce/plugins/tinymce-a11y-checker/utils/indicate.d.ts +1 -1
  80. package/es/rce/plugins/tinymce-a11y-checker/utils/indicate.js +1 -1
  81. package/es/rce/style.js +19 -17
  82. package/es/rce/tinyRCE.js +2 -0
  83. package/es/sidebar/actions/upload.d.ts +1 -0
  84. package/es/sidebar/actions/upload.js +56 -0
  85. package/es/sidebar/containers/sidebarHandlers.d.ts +1 -0
  86. package/es/sidebar/containers/sidebarHandlers.js +2 -1
  87. package/es/translations/locales/ar.js +44 -11
  88. package/es/translations/locales/ca.js +47 -14
  89. package/es/translations/locales/cy.js +44 -11
  90. package/es/translations/locales/da-x-k12.js +44 -11
  91. package/es/translations/locales/da.js +44 -11
  92. package/es/translations/locales/de.js +44 -11
  93. package/es/translations/locales/el.js +6 -0
  94. package/es/translations/locales/en-AU-x-unimelb.js +44 -11
  95. package/es/translations/locales/en-GB-x-ukhe.js +44 -11
  96. package/es/translations/locales/en.js +47 -11
  97. package/es/translations/locales/en_AU.js +44 -11
  98. package/es/translations/locales/en_CA.js +44 -11
  99. package/es/translations/locales/en_CY.js +44 -11
  100. package/es/translations/locales/en_GB.js +44 -11
  101. package/es/translations/locales/es.js +44 -11
  102. package/es/translations/locales/es_ES.js +44 -11
  103. package/es/translations/locales/fa_IR.js +6 -6
  104. package/es/translations/locales/fi.js +44 -11
  105. package/es/translations/locales/fr.js +44 -11
  106. package/es/translations/locales/fr_CA.js +49 -16
  107. package/es/translations/locales/ga.js +61 -28
  108. package/es/translations/locales/he.js +6 -0
  109. package/es/translations/locales/hi.js +44 -11
  110. package/es/translations/locales/ht.js +44 -11
  111. package/es/translations/locales/hu.js +6 -12
  112. package/es/translations/locales/hy.js +6 -0
  113. package/es/translations/locales/id.js +44 -11
  114. package/es/translations/locales/is.js +44 -11
  115. package/es/translations/locales/it.js +44 -11
  116. package/es/translations/locales/ja.js +44 -11
  117. package/es/translations/locales/ko.js +6 -0
  118. package/es/translations/locales/mi.js +44 -11
  119. package/es/translations/locales/ms.js +44 -11
  120. package/es/translations/locales/nb-x-k12.js +44 -11
  121. package/es/translations/locales/nb.js +44 -11
  122. package/es/translations/locales/nl.js +44 -11
  123. package/es/translations/locales/nn.js +6 -12
  124. package/es/translations/locales/pl.js +44 -11
  125. package/es/translations/locales/pt.js +44 -11
  126. package/es/translations/locales/pt_BR.js +44 -11
  127. package/es/translations/locales/ru.js +44 -11
  128. package/es/translations/locales/sl.js +44 -11
  129. package/es/translations/locales/sv-x-k12.js +44 -11
  130. package/es/translations/locales/sv.js +44 -11
  131. package/es/translations/locales/th.js +44 -11
  132. package/es/translations/locales/tr.js +6 -3
  133. package/es/translations/locales/uk_UA.js +6 -9
  134. package/es/translations/locales/vi.js +44 -11
  135. package/es/translations/locales/zh-Hans.js +44 -11
  136. package/es/translations/locales/zh-Hant.js +44 -11
  137. package/es/translations/locales/zh.js +44 -11
  138. package/es/translations/locales/zh_HK.js +44 -11
  139. package/es/util/contextHelper.d.ts +7 -0
  140. package/{testcafe/axe.test.js → es/util/contextHelper.js} +10 -21
  141. package/es/util/loadingPlaceholder.js +11 -11
  142. package/eslint.config.js +3 -25
  143. package/jest/jest-setup.js +27 -2
  144. package/jest.config.js +5 -1
  145. package/package.json +61 -84
  146. package/testcafe/RCEWrapper.test.js +0 -319
  147. package/testcafe/StatusBar.test.js +0 -108
  148. package/testcafe/enhanceUserContent.html +0 -58
  149. package/testcafe/enhanceUserContent.test.js +0 -44
  150. package/testcafe/entry.jsx +0 -77
  151. package/testcafe/testcafe.html +0 -14
  152. package/webpack.testcafe.config.js +0 -61
@@ -301,12 +301,6 @@ const locale = {
301
301
  "clear_image_3213fe62": {
302
302
  "message": "清除图片"
303
303
  },
304
- "clear_selected_file_82388e50": {
305
- "message": "清除所选文件"
306
- },
307
- "clear_selected_file_filename_2fe8a58e": {
308
- "message": "清除所选文件:{ filename }"
309
- },
310
304
  "click_or_shift_click_for_the_html_editor_25d70bb4": {
311
305
  "message": "单击或按住 shift 并单击 html 编辑器。"
312
306
  },
@@ -400,6 +394,9 @@ const locale = {
400
394
  "content_type_2cf90d95": {
401
395
  "message": "内容类型"
402
396
  },
397
+ "continue_to_youtube_content_a34f0f85": {
398
+ "message": "继续前往 YouTube 内容"
399
+ },
403
400
  "coproduct_e7838082": {
404
401
  "message": "余积"
405
402
  },
@@ -499,6 +496,9 @@ const locale = {
499
496
  "decrease_indent_d9cf469d": {
500
497
  "message": "减少缩进"
501
498
  },
499
+ "decrease_rich_content_area_82068f64": {
500
+ "message": "减小富内容区域"
501
+ },
502
502
  "deep_purple_bb3e2907": {
503
503
  "message": "深紫色"
504
504
  },
@@ -1081,6 +1081,9 @@ const locale = {
1081
1081
  "increase_indent_6af90f7c": {
1082
1082
  "message": "增加缩进"
1083
1083
  },
1084
+ "increase_rich_content_area_340b775": {
1085
+ "message": "增大富内容区域"
1086
+ },
1084
1087
  "indefinite_integral_6623307e": {
1085
1088
  "message": "不定积分"
1086
1089
  },
@@ -1123,6 +1126,9 @@ const locale = {
1123
1126
  "intersection_cd4590e4": {
1124
1127
  "message": "相交"
1125
1128
  },
1129
+ "invalid_description_991e23bb": {
1130
+ "message": "无效的描述"
1131
+ },
1126
1132
  "invalid_entry_f7d2a0f5": {
1127
1133
  "message": "无效的输入。"
1128
1134
  },
@@ -1690,9 +1696,21 @@ const locale = {
1690
1696
  "please_allow_canvas_to_access_your_microphone_and__dc2c3079": {
1691
1697
  "message": "请允许 Canvas 访问您的麦克风和网络摄像头。"
1692
1698
  },
1699
+ "please_choose_a_file_c2449cc": {
1700
+ "message": "请选择文件"
1701
+ },
1693
1702
  "please_decribe_what_you_would_like_to_compose_27a51be5": {
1694
1703
  "message": "请描述您要撰写的内容。"
1695
1704
  },
1705
+ "please_enter_a_file_name_f159edc1": {
1706
+ "message": "请输入一个文件名"
1707
+ },
1708
+ "please_enter_a_valid_video_url_from_a_supported_pl_30dc0596": {
1709
+ "message": "请输入来自支持的平台的有效的视频 URL。"
1710
+ },
1711
+ "please_select_a_file_of_a_supported_type_1fc578f2": {
1712
+ "message": "请选择支持类型的文件"
1713
+ },
1696
1714
  "plus_d43cd4ec": {
1697
1715
  "message": "加号"
1698
1716
  },
@@ -1807,6 +1825,12 @@ const locale = {
1807
1825
  "religion_icon_246e0be1": {
1808
1826
  "message": "宗教图标"
1809
1827
  },
1828
+ "remove_f47dc62a": {
1829
+ "message": "移除"
1830
+ },
1831
+ "remove_filename_3ea029f6": {
1832
+ "message": "移除 { filename }"
1833
+ },
1810
1834
  "remove_heading_style_5fdc8855": {
1811
1835
  "message": "删除标题样式"
1812
1836
  },
@@ -2242,8 +2266,11 @@ const locale = {
2242
2266
  "the_first_heading_on_a_page_should_be_an_h2_859089f2": {
2243
2267
  "message": "页面上的第一个标题应该是H2。"
2244
2268
  },
2245
- "the_following_content_is_partner_provided_ed1da756": {
2246
- "message": "以下内容由合作伙伴提供"
2269
+ "the_height_of_rich_content_area_is_decreased_36920e0": {
2270
+ "message": "富内容区域的高度减小。"
2271
+ },
2272
+ "the_height_of_rich_content_area_is_increased_74c2358d": {
2273
+ "message": "富内容区域的高度增大。"
2247
2274
  },
2248
2275
  "the_material_is_in_the_public_domain_279c39a3": {
2249
2276
  "message": "材料在公开域中"
@@ -2254,9 +2281,6 @@ const locale = {
2254
2281
  "the_material_is_subject_to_an_exception_e_g_fair_u_a39c8ca2": {
2255
2282
  "message": "材料有例外情况——例如,合理使用、引用权,或版权法规定的其他适用的情况"
2256
2283
  },
2257
- "the_preceding_content_is_partner_provided_d753928c": {
2258
- "message": "以上内容由合作伙伴提供"
2259
- },
2260
2284
  "the_pretty_html_editor_is_not_keyboard_accessible__d6d5d2b": {
2261
2285
  "message": "无法通过键盘访问精美 HTML 编辑器。按 Shift O 打开原始 HTML 编辑器。"
2262
2286
  },
@@ -2296,6 +2320,9 @@ const locale = {
2296
2320
  "this_image_is_currently_unavailable_25c68857": {
2297
2321
  "message": "该图像目前不可用"
2298
2322
  },
2323
+ "this_video_may_display_youtube_ads_4d19d590": {
2324
+ "message": "此视频可能展示 YouTube 广告。"
2325
+ },
2299
2326
  "though_your_video_will_have_the_correct_title_in_t_90e427f3": {
2300
2327
  "message": "虽然您的视频在浏览器里会有正确标题,但我们无法在数据库里更新。"
2301
2328
  },
@@ -2518,6 +2545,9 @@ const locale = {
2518
2545
  "video_player_for_title_ffd9fbc4": {
2519
2546
  "message": "{ title }的视频播放器"
2520
2547
  },
2548
+ "video_url_889d3263": {
2549
+ "message": "视频 URL"
2550
+ },
2521
2551
  "view_all_e13bf0a6": {
2522
2552
  "message": "查看全部"
2523
2553
  },
@@ -2632,6 +2662,9 @@ const locale = {
2632
2662
  "your_webcam_may_already_be_in_use_6cd64c25": {
2633
2663
  "message": "您的网络摄像头可能正在使用中。"
2634
2664
  },
2665
+ "youtube_embed_url_5c1018d4": {
2666
+ "message": "YouTube 嵌入 URL"
2667
+ },
2635
2668
  "zeta_5ef24f0e": {
2636
2669
  "message": "Zeta"
2637
2670
  },
@@ -301,12 +301,6 @@ const locale = {
301
301
  "clear_image_3213fe62": {
302
302
  "message": "清除影像"
303
303
  },
304
- "clear_selected_file_82388e50": {
305
- "message": "清除所選擇的檔案"
306
- },
307
- "clear_selected_file_filename_2fe8a58e": {
308
- "message": "清除所選擇的檔案:{ filename }"
309
- },
310
304
  "click_or_shift_click_for_the_html_editor_25d70bb4": {
311
305
  "message": "點擊或按住 Shift 點擊調出 html 編輯器。"
312
306
  },
@@ -400,6 +394,9 @@ const locale = {
400
394
  "content_type_2cf90d95": {
401
395
  "message": "內容類型"
402
396
  },
397
+ "continue_to_youtube_content_a34f0f85": {
398
+ "message": "繼續觀看 YouTube 內容"
399
+ },
403
400
  "coproduct_e7838082": {
404
401
  "message": "副產品"
405
402
  },
@@ -499,6 +496,9 @@ const locale = {
499
496
  "decrease_indent_d9cf469d": {
500
497
  "message": "減少縮排"
501
498
  },
499
+ "decrease_rich_content_area_82068f64": {
500
+ "message": "減少多種格式的內容區域"
501
+ },
502
502
  "deep_purple_bb3e2907": {
503
503
  "message": "深紫色"
504
504
  },
@@ -1081,6 +1081,9 @@ const locale = {
1081
1081
  "increase_indent_6af90f7c": {
1082
1082
  "message": "增加縮進"
1083
1083
  },
1084
+ "increase_rich_content_area_340b775": {
1085
+ "message": "增加多種格式的內容區域"
1086
+ },
1084
1087
  "indefinite_integral_6623307e": {
1085
1088
  "message": "無限積分"
1086
1089
  },
@@ -1123,6 +1126,9 @@ const locale = {
1123
1126
  "intersection_cd4590e4": {
1124
1127
  "message": "交集"
1125
1128
  },
1129
+ "invalid_description_991e23bb": {
1130
+ "message": "無效的描述"
1131
+ },
1126
1132
  "invalid_entry_f7d2a0f5": {
1127
1133
  "message": "無效的輸入項目。"
1128
1134
  },
@@ -1690,9 +1696,21 @@ const locale = {
1690
1696
  "please_allow_canvas_to_access_your_microphone_and__dc2c3079": {
1691
1697
  "message": "請允許 Canvas 存取您的麥克風和網路攝影機。"
1692
1698
  },
1699
+ "please_choose_a_file_c2449cc": {
1700
+ "message": "請選擇一個檔案"
1701
+ },
1693
1702
  "please_decribe_what_you_would_like_to_compose_27a51be5": {
1694
1703
  "message": "請描述您想創作什麼。"
1695
1704
  },
1705
+ "please_enter_a_file_name_f159edc1": {
1706
+ "message": "請輸入一個檔案名稱"
1707
+ },
1708
+ "please_enter_a_valid_video_url_from_a_supported_pl_30dc0596": {
1709
+ "message": "請輸入受支援平台的有效影片 URL。"
1710
+ },
1711
+ "please_select_a_file_of_a_supported_type_1fc578f2": {
1712
+ "message": "請選取支援類型的檔案"
1713
+ },
1696
1714
  "plus_d43cd4ec": {
1697
1715
  "message": "+"
1698
1716
  },
@@ -1807,6 +1825,12 @@ const locale = {
1807
1825
  "religion_icon_246e0be1": {
1808
1826
  "message": "宗教圖示"
1809
1827
  },
1828
+ "remove_f47dc62a": {
1829
+ "message": "移除"
1830
+ },
1831
+ "remove_filename_3ea029f6": {
1832
+ "message": "移除 { filename }"
1833
+ },
1810
1834
  "remove_heading_style_5fdc8855": {
1811
1835
  "message": "移除標題樣式"
1812
1836
  },
@@ -2242,8 +2266,11 @@ const locale = {
2242
2266
  "the_first_heading_on_a_page_should_be_an_h2_859089f2": {
2243
2267
  "message": "頁面的第一個標題應該是 H2。"
2244
2268
  },
2245
- "the_following_content_is_partner_provided_ed1da756": {
2246
- "message": "以下內容由合作夥伴提供"
2269
+ "the_height_of_rich_content_area_is_decreased_36920e0": {
2270
+ "message": "多種格式的內容區域的高度已減少。"
2271
+ },
2272
+ "the_height_of_rich_content_area_is_increased_74c2358d": {
2273
+ "message": "多種格式的內容區域的高度已增加。"
2247
2274
  },
2248
2275
  "the_material_is_in_the_public_domain_279c39a3": {
2249
2276
  "message": "該材料位於公用網域中。"
@@ -2254,9 +2281,6 @@ const locale = {
2254
2281
  "the_material_is_subject_to_an_exception_e_g_fair_u_a39c8ca2": {
2255
2282
  "message": "可能有適用於此資料的例外情況 - 如:合理使用、引用權,或適用版權法下的其他情況"
2256
2283
  },
2257
- "the_preceding_content_is_partner_provided_d753928c": {
2258
- "message": "上述內容由合作夥伴提供"
2259
- },
2260
2284
  "the_pretty_html_editor_is_not_keyboard_accessible__d6d5d2b": {
2261
2285
  "message": "美觀 HTML 編輯器無法用鍵盤存取。按 ShiftO 開啟原始 HTML 編輯器。"
2262
2286
  },
@@ -2296,6 +2320,9 @@ const locale = {
2296
2320
  "this_image_is_currently_unavailable_25c68857": {
2297
2321
  "message": "此圖像目前不可用"
2298
2322
  },
2323
+ "this_video_may_display_youtube_ads_4d19d590": {
2324
+ "message": "此影片可能會顯示 YouTube 廣告。"
2325
+ },
2299
2326
  "though_your_video_will_have_the_correct_title_in_t_90e427f3": {
2300
2327
  "message": "雖然您的影片在瀏覽器中有正確的標題,但我們無法在資料庫中將其更新。"
2301
2328
  },
@@ -2518,6 +2545,9 @@ const locale = {
2518
2545
  "video_player_for_title_ffd9fbc4": {
2519
2546
  "message": "{ title } 的影片播放器"
2520
2547
  },
2548
+ "video_url_889d3263": {
2549
+ "message": "影片網址"
2550
+ },
2521
2551
  "view_all_e13bf0a6": {
2522
2552
  "message": "全部檢視"
2523
2553
  },
@@ -2632,6 +2662,9 @@ const locale = {
2632
2662
  "your_webcam_may_already_be_in_use_6cd64c25": {
2633
2663
  "message": "您的網路攝影機可能已在使用中。"
2634
2664
  },
2665
+ "youtube_embed_url_5c1018d4": {
2666
+ "message": "YouTube 嵌入網址"
2667
+ },
2635
2668
  "zeta_5ef24f0e": {
2636
2669
  "message": "θ"
2637
2670
  },
@@ -0,0 +1,7 @@
1
+ type ContainingContext = {
2
+ contextType: string;
3
+ contextId: string;
4
+ userId: string;
5
+ };
6
+ export declare const normalizeContainingContext: (context?: ContainingContext) => ContainingContext | undefined;
7
+ export {};
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright (C) 2019 - present Instructure, Inc.
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
- async function runAxeCheck(t, context, options) {
22
- const {violations} = await axeCheck(t, context, options)
23
- if (violations) {
24
- await t.expect(violations.length === 0).ok(createReport(violations))
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 (isImage(fileMetaProps.contentType) && fileMetaProps.displayAs !== 'link') {
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 (typeof type === 'string' && isVideo(type)) {
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 (typeof type === 'string' && isAudio(type)) {
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: '#2D3B45',
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: '#F5F5F5'
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: #F5F5F5;
303
- --Spinner-color: #0374B5;
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: #0374B5;
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', 'testcafe/**/*.{js,mjs,ts,jsx,tsx}'],
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: [
@@ -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',