@instructure/canvas-rce 5.14.2 → 5.15.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 (266) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/DEVELOPMENT.md +1 -1
  3. package/es/bridge/Bridge.js +10 -17
  4. package/es/canvasFileBrowser/FileBrowser.js +10 -19
  5. package/es/common/FlashAlert.js +8 -11
  6. package/es/common/fileUrl.js +6 -10
  7. package/es/common/incremental-loading/LoadMoreButton.js +3 -4
  8. package/es/common/incremental-loading/LoadingStatus.js +4 -11
  9. package/es/common/indicate.js +1 -2
  10. package/es/defaultTinymceConfig.js +1 -1
  11. package/es/enhance-user-content/doc_previews.js +10 -10
  12. package/es/enhance-user-content/enhance_user_content.js +4 -7
  13. package/es/enhance-user-content/external_links.js +1 -1
  14. package/es/enhance-user-content/instructure_helper.js +11 -17
  15. package/es/enhance-user-content/mathml.js +15 -27
  16. package/es/enhance-user-content/media_comment_thumbnail.js +3 -10
  17. package/es/format-message.js +2 -2
  18. package/es/index.js +3 -5
  19. package/es/rce/AlertMessageArea.js +15 -16
  20. package/es/rce/KeyboardShortcutModal.js +2 -2
  21. package/es/rce/RCE.js +6 -8
  22. package/es/rce/RCEVariants.js +2 -4
  23. package/es/rce/RCEWrapper.js +397 -289
  24. package/es/rce/RCEWrapper.utils.js +131 -0
  25. package/es/rce/RCEWrapperProps.js +2 -3
  26. package/es/rce/RceHtmlEditor.js +12 -11
  27. package/es/rce/ResizeHandle.js +1 -2
  28. package/es/rce/ShowOnFocusButton/index.js +2 -2
  29. package/es/rce/StatusBar.js +5 -10
  30. package/es/rce/contentInsertion.js +1 -2
  31. package/es/rce/contentRendering.js +6 -5
  32. package/es/rce/editorLanguage.js +1 -1
  33. package/es/rce/indicatorRegion.js +1 -2
  34. package/es/rce/normalizeProps.js +4 -4
  35. package/es/rce/plugins/instructure_color/clickCallback.js +2 -4
  36. package/es/rce/plugins/instructure_color/components/ColorPicker.js +17 -22
  37. package/es/rce/plugins/instructure_color/components/ColorPopup.js +7 -8
  38. package/es/rce/plugins/instructure_condensed_buttons/ui/list-button.js +4 -10
  39. package/es/rce/plugins/instructure_condensed_buttons/ui/subscript-superscript-button.js +1 -1
  40. package/es/rce/plugins/instructure_documents/components/Link.js +1 -2
  41. package/es/rce/plugins/instructure_equation/EquationEditorModal/index.js +5 -8
  42. package/es/rce/plugins/instructure_equation/EquationEditorModal/latexTextareaUtil.js +3 -3
  43. package/es/rce/plugins/instructure_equation/EquationEditorModal/parseLatex.js +3 -3
  44. package/es/rce/plugins/instructure_equation/EquationEditorToolbar/buttons.js +2 -2
  45. package/es/rce/plugins/instructure_equation/EquationEditorToolbar/index.js +9 -11
  46. package/es/rce/plugins/instructure_equation/MathIcon/index.js +3 -4
  47. package/es/rce/plugins/instructure_equation/mathlive/index.js +167 -16
  48. package/es/rce/plugins/instructure_fullscreen/plugin.js +0 -2
  49. package/es/rce/plugins/instructure_icon_maker/clickCallback.js +3 -4
  50. package/es/rce/plugins/instructure_icon_maker/components/CreateIconMakerForm/ColorSection.js +46 -49
  51. package/es/rce/plugins/instructure_icon_maker/components/CreateIconMakerForm/CreateIconMakerForm.js +9 -10
  52. package/es/rce/plugins/instructure_icon_maker/components/CreateIconMakerForm/Footer.js +10 -11
  53. package/es/rce/plugins/instructure_icon_maker/components/CreateIconMakerForm/Group.js +5 -6
  54. package/es/rce/plugins/instructure_icon_maker/components/CreateIconMakerForm/Header.js +7 -8
  55. package/es/rce/plugins/instructure_icon_maker/components/CreateIconMakerForm/ImageSection/Course.js +7 -9
  56. package/es/rce/plugins/instructure_icon_maker/components/CreateIconMakerForm/ImageSection/ImageOptions.js +19 -26
  57. package/es/rce/plugins/instructure_icon_maker/components/CreateIconMakerForm/ImageSection/ImageSection.js +8 -12
  58. package/es/rce/plugins/instructure_icon_maker/components/CreateIconMakerForm/ImageSection/ModeSelect.js +6 -7
  59. package/es/rce/plugins/instructure_icon_maker/components/CreateIconMakerForm/ImageSection/MultiColor/index.js +5 -6
  60. package/es/rce/plugins/instructure_icon_maker/components/CreateIconMakerForm/ImageSection/SVGList.js +6 -7
  61. package/es/rce/plugins/instructure_icon_maker/components/CreateIconMakerForm/ImageSection/SVGThumbnail.js +8 -10
  62. package/es/rce/plugins/instructure_icon_maker/components/CreateIconMakerForm/ImageSection/SingleColor/index.js +5 -6
  63. package/es/rce/plugins/instructure_icon_maker/components/CreateIconMakerForm/ImageSection/SingleColor/svg.js +32 -80
  64. package/es/rce/plugins/instructure_icon_maker/components/CreateIconMakerForm/ImageSection/Upload.js +7 -8
  65. package/es/rce/plugins/instructure_icon_maker/components/CreateIconMakerForm/ImageSection/utils.js +4 -5
  66. package/es/rce/plugins/instructure_icon_maker/components/CreateIconMakerForm/Preview.js +3 -4
  67. package/es/rce/plugins/instructure_icon_maker/components/CreateIconMakerForm/ShapeSection.js +4 -5
  68. package/es/rce/plugins/instructure_icon_maker/components/CreateIconMakerForm/TextSection.js +4 -5
  69. package/es/rce/plugins/instructure_icon_maker/components/IconMakerTray.js +22 -29
  70. package/es/rce/plugins/instructure_icon_maker/registerEditToolbar.js +1 -1
  71. package/es/rce/plugins/instructure_icon_maker/svg/image.js +5 -7
  72. package/es/rce/plugins/instructure_icon_maker/svg/index.js +6 -9
  73. package/es/rce/plugins/instructure_icon_maker/svg/settings.js +17 -20
  74. package/es/rce/plugins/instructure_icon_maker/svg/shape.js +4 -5
  75. package/es/rce/plugins/instructure_icon_maker/svg/text.js +28 -32
  76. package/es/rce/plugins/instructure_icon_maker/svg/utils.js +2 -4
  77. package/es/rce/plugins/instructure_icon_maker/utils/IconMakerClose.js +2 -3
  78. package/es/rce/plugins/instructure_icon_maker/utils/iconValidation.js +1 -2
  79. package/es/rce/plugins/instructure_image/ImageEmbedOptions.js +3 -7
  80. package/es/rce/plugins/instructure_image/ImageList/Image.js +7 -8
  81. package/es/rce/plugins/instructure_image/ImageList/index.js +7 -8
  82. package/es/rce/plugins/instructure_image/ImageOptionsTray/TrayController.js +2 -4
  83. package/es/rce/plugins/instructure_image/ImageOptionsTray/index.js +3 -3
  84. package/es/rce/plugins/instructure_image/plugin.js +1 -2
  85. package/es/rce/plugins/instructure_links/components/AccordionSection.js +7 -8
  86. package/es/rce/plugins/instructure_links/components/Link.js +61 -65
  87. package/es/rce/plugins/instructure_links/components/LinkOptionsDialog/LinkOptionsDialogController.js +1 -2
  88. package/es/rce/plugins/instructure_links/components/LinkOptionsDialog/index.js +2 -2
  89. package/es/rce/plugins/instructure_links/components/LinkOptionsTray/index.js +2 -2
  90. package/es/rce/plugins/instructure_links/components/LinkSet.js +28 -37
  91. package/es/rce/plugins/instructure_links/components/LinksPanel.js +21 -8
  92. package/es/rce/plugins/instructure_links/components/NoResults.js +6 -7
  93. package/es/rce/plugins/instructure_links/plugin.js +6 -9
  94. package/es/rce/plugins/instructure_media_embed/clickCallback.js +3 -4
  95. package/es/rce/plugins/instructure_media_embed/components/Embed.js +6 -7
  96. package/es/rce/plugins/instructure_paste/plugin.js +5 -7
  97. package/es/rce/plugins/instructure_rce_external_tools/ExternalToolsEnv.js +24 -33
  98. package/es/rce/plugins/instructure_rce_external_tools/RceToolWrapper.js +7 -38
  99. package/es/rce/plugins/instructure_rce_external_tools/components/ExternalToolDialog/ExternalToolDialog.js +30 -29
  100. package/es/rce/plugins/instructure_rce_external_tools/components/ExternalToolSelectionDialog/ExternalToolSelectionDialog.js +3 -4
  101. package/es/rce/plugins/instructure_rce_external_tools/dialog-helper.js +1 -2
  102. package/es/rce/plugins/instructure_rce_external_tools/jquery/jquery.dropdownList.js +3 -4
  103. package/es/rce/plugins/instructure_rce_external_tools/lti11-content-items/RceLti11ContentItem.js +17 -24
  104. package/es/rce/plugins/instructure_rce_external_tools/lti13-content-items/RceLti13ContentItem.js +2 -2
  105. package/es/rce/plugins/instructure_rce_external_tools/lti13-content-items/models/BaseLinkContentItem.js +4 -5
  106. package/es/rce/plugins/instructure_rce_external_tools/lti13-content-items/processEditorContentItems.js +8 -9
  107. package/es/rce/plugins/instructure_rce_external_tools/lti13-content-items/rceLti13ContentItemFromJson.js +0 -1
  108. package/es/rce/plugins/instructure_rce_external_tools/plugin.js +4 -4
  109. package/es/rce/plugins/instructure_rce_external_tools/util/externalToolsForToolbar.js +42 -0
  110. package/es/rce/plugins/instructure_record/AudioOptionsTray/TrayController.js +5 -10
  111. package/es/rce/plugins/instructure_record/AudioOptionsTray/index.js +12 -13
  112. package/es/rce/plugins/instructure_record/VideoOptionsTray/TrayController.js +8 -15
  113. package/es/rce/plugins/instructure_record/VideoOptionsTray/index.js +19 -20
  114. package/es/rce/plugins/instructure_record/clickCallback.js +26 -30
  115. package/es/rce/plugins/instructure_search_and_replace/clickCallback.js +2 -3
  116. package/es/rce/plugins/instructure_search_and_replace/components/FindReplaceTray.js +14 -16
  117. package/es/rce/plugins/instructure_search_and_replace/components/FindReplaceTrayController.js +9 -12
  118. package/es/rce/plugins/instructure_search_and_replace/plugin.js +1 -2
  119. package/es/rce/plugins/instructure_wordcount/clickCallback.js +3 -4
  120. package/es/rce/plugins/instructure_wordcount/components/WordCountModal.js +26 -33
  121. package/es/rce/plugins/instructure_wordcount/utils/countContent.js +3 -3
  122. package/es/rce/plugins/instructure_wordcount/utils/tableContent.js +5 -8
  123. package/es/rce/plugins/shared/CanvasContentTray.js +9 -16
  124. package/es/rce/plugins/shared/ColorInput.js +22 -25
  125. package/es/rce/plugins/shared/ConditionalTooltip.js +5 -6
  126. package/es/rce/plugins/shared/ContentSelection.js +12 -20
  127. package/es/rce/plugins/shared/DimensionUtils.js +2 -4
  128. package/es/rce/plugins/shared/EventUtils.js +1 -1
  129. package/es/rce/plugins/shared/FixedContentTray.js +13 -14
  130. package/es/rce/plugins/shared/ImageCropper/DirectionRegion.js +3 -4
  131. package/es/rce/plugins/shared/ImageCropper/Modal.js +12 -13
  132. package/es/rce/plugins/shared/ImageCropper/Preview.js +11 -13
  133. package/es/rce/plugins/shared/ImageCropper/controls/CustomNumberInput.js +8 -9
  134. package/es/rce/plugins/shared/ImageCropper/controls/ResetControls.js +3 -4
  135. package/es/rce/plugins/shared/ImageCropper/controls/RotationControls.js +4 -5
  136. package/es/rce/plugins/shared/ImageCropper/controls/ShapeControls.js +7 -11
  137. package/es/rce/plugins/shared/ImageCropper/controls/ZoomControls.js +4 -5
  138. package/es/rce/plugins/shared/ImageCropper/controls/index.js +4 -5
  139. package/es/rce/plugins/shared/ImageCropper/controls/useDebouncedNumericValue.js +13 -15
  140. package/es/rce/plugins/shared/ImageCropper/imageCropUtils.js +18 -21
  141. package/es/rce/plugins/shared/ImageCropper/svg/shape.js +4 -5
  142. package/es/rce/plugins/shared/ImageCropper/svg/utils.js +2 -4
  143. package/es/rce/plugins/shared/ImageCropper/useKeyMouseEvents.js +1 -4
  144. package/es/rce/plugins/shared/ImageOptionsForm.js +17 -18
  145. package/es/rce/plugins/shared/LinkDisplay.js +8 -9
  146. package/es/rce/plugins/shared/PreviewIcon.js +8 -9
  147. package/es/rce/plugins/shared/RceFileBrowser.js +2 -3
  148. package/es/rce/plugins/shared/StoreContext.js +8 -10
  149. package/es/rce/plugins/shared/StudioLtiSupportUtils.js +5 -6
  150. package/es/rce/plugins/shared/Upload/CanvasContentPanel.js +6 -7
  151. package/es/rce/plugins/shared/Upload/CategoryProcessor.js +1 -2
  152. package/es/rce/plugins/shared/Upload/ComputerPanel.js +11 -14
  153. package/es/rce/plugins/shared/Upload/PanelFilter.js +7 -8
  154. package/es/rce/plugins/shared/Upload/UploadFile.js +19 -22
  155. package/es/rce/plugins/shared/Upload/UploadFileModal.js +28 -34
  156. package/es/rce/plugins/shared/Upload/UrlPanel.js +4 -5
  157. package/es/rce/plugins/shared/Upload/UsageRightsSelectBox.js +18 -24
  158. package/es/rce/plugins/shared/Upload/doFileUpload.js +6 -7
  159. package/es/rce/plugins/shared/ai_tools/AIResponseModal.js +7 -8
  160. package/es/rce/plugins/shared/ai_tools/AIToolsTray.js +14 -17
  161. package/es/rce/plugins/shared/ai_tools/aiicons.js +2 -2
  162. package/es/rce/plugins/shared/canvasContentUtils.js +1 -2
  163. package/es/rce/plugins/shared/compressionUtils.js +17 -20
  164. package/es/rce/plugins/shared/do-fetch-api-effect/doFetchApi.js +12 -15
  165. package/es/rce/plugins/shared/do-fetch-api-effect/get-cookie.js +1 -1
  166. package/es/rce/plugins/shared/fileTypeUtils.js +3 -6
  167. package/es/rce/plugins/shared/round.js +1 -2
  168. package/es/rce/plugins/shared/trayUtils.js +3 -0
  169. package/es/rce/plugins/shared/useDataUrl.js +4 -5
  170. package/es/rce/plugins/tinymce-a11y-checker/components/ColorField.js +2 -2
  171. package/es/rce/plugins/tinymce-a11y-checker/components/checker.js +8 -10
  172. package/es/rce/plugins/tinymce-a11y-checker/node-checker.js +1 -3
  173. package/es/rce/plugins/tinymce-a11y-checker/plugin.js +14 -17
  174. package/es/rce/plugins/tinymce-a11y-checker/rules/headings-start-at-h2.js +1 -2
  175. package/es/rce/plugins/tinymce-a11y-checker/rules/large-text-contrast.js +1 -2
  176. package/es/rce/plugins/tinymce-a11y-checker/rules/small-text-contrast.js +1 -2
  177. package/es/rce/plugins/tinymce-a11y-checker/utils/dom.js +2 -4
  178. package/es/rce/plugins/tinymce-a11y-checker/utils/indicate.js +2 -3
  179. package/es/rce/plugins/tinymce-a11y-checker/utils/rgb-hex.js +1 -4
  180. package/es/rce/root.js +9 -9
  181. package/es/rce/tinyRCE.js +1 -0
  182. package/es/rce/transformContent.js +1 -1
  183. package/es/rcs/api.js +39 -55
  184. package/es/rcs/buildError.js +3 -3
  185. package/es/rcs/fake.js +5 -7
  186. package/es/sidebar/actions/documents.js +10 -12
  187. package/es/sidebar/actions/files.js +18 -22
  188. package/es/sidebar/actions/filter.js +4 -5
  189. package/es/sidebar/actions/images.js +20 -26
  190. package/es/sidebar/actions/media.js +15 -18
  191. package/es/sidebar/actions/session.js +1 -2
  192. package/es/sidebar/actions/upload.js +26 -37
  193. package/es/sidebar/containers/sidebarHandlers.js +6 -12
  194. package/es/sidebar/dragHtml.js +6 -2
  195. package/es/sidebar/reducers/all_files.js +1 -3
  196. package/es/sidebar/reducers/collection.js +1 -3
  197. package/es/sidebar/reducers/collections.js +1 -3
  198. package/es/sidebar/reducers/documents.js +1 -3
  199. package/es/sidebar/reducers/files.js +1 -3
  200. package/es/sidebar/reducers/filter.js +7 -15
  201. package/es/sidebar/reducers/flickr.js +1 -3
  202. package/es/sidebar/reducers/folder.js +1 -3
  203. package/es/sidebar/reducers/folders.js +1 -3
  204. package/es/sidebar/reducers/images.js +1 -3
  205. package/es/sidebar/reducers/media.js +1 -3
  206. package/es/sidebar/reducers/newPageLinkExpanded.js +1 -3
  207. package/es/sidebar/reducers/noop.js +1 -2
  208. package/es/sidebar/reducers/rootFolderId.js +1 -3
  209. package/es/sidebar/reducers/session.js +1 -3
  210. package/es/sidebar/reducers/ui.js +3 -9
  211. package/es/sidebar/reducers/upload.js +8 -24
  212. package/es/sidebar/store/initialState.js +1 -2
  213. package/es/translations/locales/ar.js +6 -0
  214. package/es/translations/locales/ca.js +6 -0
  215. package/es/translations/locales/cy.js +6 -0
  216. package/es/translations/locales/da-x-k12.js +6 -0
  217. package/es/translations/locales/da.js +6 -0
  218. package/es/translations/locales/de.js +6 -0
  219. package/es/translations/locales/en-AU-x-unimelb.js +6 -0
  220. package/es/translations/locales/en-GB-x-ukhe.js +6 -0
  221. package/es/translations/locales/en_AU.js +6 -0
  222. package/es/translations/locales/en_CA.js +6 -0
  223. package/es/translations/locales/en_CY.js +6 -0
  224. package/es/translations/locales/en_GB.js +6 -0
  225. package/es/translations/locales/es.js +6 -0
  226. package/es/translations/locales/es_ES.js +6 -0
  227. package/es/translations/locales/fi.js +6 -0
  228. package/es/translations/locales/fr.js +6 -0
  229. package/es/translations/locales/fr_CA.js +6 -0
  230. package/es/translations/locales/hi.js +6 -0
  231. package/es/translations/locales/ht.js +6 -0
  232. package/es/translations/locales/id.js +6 -0
  233. package/es/translations/locales/is.js +6 -0
  234. package/es/translations/locales/it.js +6 -0
  235. package/es/translations/locales/ja.js +6 -0
  236. package/es/translations/locales/mi.js +6 -0
  237. package/es/translations/locales/ms.js +6 -0
  238. package/es/translations/locales/nb-x-k12.js +6 -0
  239. package/es/translations/locales/nb.js +6 -0
  240. package/es/translations/locales/nl.js +6 -0
  241. package/es/translations/locales/pl.js +6 -0
  242. package/es/translations/locales/pt.js +6 -0
  243. package/es/translations/locales/pt_BR.js +6 -0
  244. package/es/translations/locales/ru.js +6 -0
  245. package/es/translations/locales/sl.js +6 -0
  246. package/es/translations/locales/sv-x-k12.js +6 -0
  247. package/es/translations/locales/sv.js +6 -0
  248. package/es/translations/locales/th.js +6 -0
  249. package/es/translations/locales/vi.js +6 -0
  250. package/es/translations/locales/zh-Hans.js +6 -0
  251. package/es/translations/locales/zh-Hant.js +6 -0
  252. package/es/translations/locales/zh.js +6 -0
  253. package/es/translations/locales/zh_HK.js +6 -0
  254. package/es/util/elem-util.js +1 -1
  255. package/es/util/file-url-util.js +1 -1
  256. package/es/util/fullscreenHelpers.js +6 -9
  257. package/es/util/loadingPlaceholder.js +2 -3
  258. package/es/util/simpleCache.js +1 -2
  259. package/es/util/url-util.js +5 -5
  260. package/eslint.config.js +15 -4
  261. package/locales/en.json +190 -10
  262. package/package.json +56 -55
  263. package/scripts/installTranslations.js +7 -8
  264. package/tsconfig.json +1 -1
  265. package/types/format-message-generate-id.d.ts +22 -0
  266. package/types/js-beautify.d.ts +21 -0
@@ -490,6 +490,9 @@ const locale = {
490
490
  "deep_purple_bb3e2907": {
491
491
  "message": "深紫色"
492
492
  },
493
+ "default_9db103d": {
494
+ "message": "默认"
495
+ },
493
496
  "default_bulleted_unordered_list_47079da8": {
494
497
  "message": "默认项目符号无序列表"
495
498
  },
@@ -1561,6 +1564,9 @@ const locale = {
1561
1564
  "outline_size_a6059a21": {
1562
1565
  "message": "轮廓大小"
1563
1566
  },
1567
+ "p_is_not_a_valid_protocol_b1c4efaa": {
1568
+ "message": "{ p }不是有效的协议。"
1569
+ },
1564
1570
  "page_50c4823d": {
1565
1571
  "message": "页面"
1566
1572
  },
@@ -490,6 +490,9 @@ const locale = {
490
490
  "deep_purple_bb3e2907": {
491
491
  "message": "深紫色"
492
492
  },
493
+ "default_9db103d": {
494
+ "message": "預設"
495
+ },
493
496
  "default_bulleted_unordered_list_47079da8": {
494
497
  "message": "預設符號無序清單"
495
498
  },
@@ -1561,6 +1564,9 @@ const locale = {
1561
1564
  "outline_size_a6059a21": {
1562
1565
  "message": "輪廓大小"
1563
1566
  },
1567
+ "p_is_not_a_valid_protocol_b1c4efaa": {
1568
+ "message": "{ p } 不是有效的通訊協定。"
1569
+ },
1564
1570
  "page_50c4823d": {
1565
1571
  "message": "頁面"
1566
1572
  },
@@ -490,6 +490,9 @@ const locale = {
490
490
  "deep_purple_bb3e2907": {
491
491
  "message": "深紫色"
492
492
  },
493
+ "default_9db103d": {
494
+ "message": "默认"
495
+ },
493
496
  "default_bulleted_unordered_list_47079da8": {
494
497
  "message": "默认项目符号无序列表"
495
498
  },
@@ -1561,6 +1564,9 @@ const locale = {
1561
1564
  "outline_size_a6059a21": {
1562
1565
  "message": "轮廓大小"
1563
1566
  },
1567
+ "p_is_not_a_valid_protocol_b1c4efaa": {
1568
+ "message": "{ p }不是有效的协议。"
1569
+ },
1564
1570
  "page_50c4823d": {
1565
1571
  "message": "页面"
1566
1572
  },
@@ -490,6 +490,9 @@ const locale = {
490
490
  "deep_purple_bb3e2907": {
491
491
  "message": "深紫色"
492
492
  },
493
+ "default_9db103d": {
494
+ "message": "預設"
495
+ },
493
496
  "default_bulleted_unordered_list_47079da8": {
494
497
  "message": "預設符號無序清單"
495
498
  },
@@ -1561,6 +1564,9 @@ const locale = {
1561
1564
  "outline_size_a6059a21": {
1562
1565
  "message": "輪廓大小"
1563
1566
  },
1567
+ "p_is_not_a_valid_protocol_b1c4efaa": {
1568
+ "message": "{ p } 不是有效的通訊協定。"
1569
+ },
1564
1570
  "page_50c4823d": {
1565
1571
  "message": "頁面"
1566
1572
  },
@@ -22,5 +22,5 @@
22
22
  * @param n
23
23
  */
24
24
  export function isTextNode(n) {
25
- return (n === null || n === void 0 ? void 0 : n.nodeType) === Node.TEXT_NODE;
25
+ return n?.nodeType === Node.TEXT_NODE;
26
26
  }
@@ -24,7 +24,7 @@ export function guessCanvasFileIdFromUrl(inputUrlStr, restrictToOrigin) {
24
24
  if (restrictToOrigin != null) {
25
25
  const url = parseUrlOrNull(inputUrlStr);
26
26
  const originUrl = parseUrlOrNull(restrictToOrigin);
27
- if ((url === null || url === void 0 ? void 0 : url.origin) !== (originUrl === null || originUrl === void 0 ? void 0 : originUrl.origin)) {
27
+ if (url?.origin !== originUrl?.origin) {
28
28
  return null;
29
29
  }
30
30
  }
@@ -17,14 +17,11 @@
17
17
  */
18
18
 
19
19
  // safari implements only the webkit prefixed version of the fullscreen api
20
- const FS_ELEMENT = document.fullscreenElement === undefined ? 'webkitFullscreenElement' : 'fullscreenElement';
20
+ export const FS_ELEMENT = document.fullscreenElement === undefined ? 'webkitFullscreenElement' : 'fullscreenElement';
21
21
  // @ts-expect-error
22
- const FS_REQUEST = document.body.requestFullscreen ? 'requestFullscreen' : 'webkitRequestFullscreen';
22
+ export const FS_REQUEST = document.body.requestFullscreen ? 'requestFullscreen' : 'webkitRequestFullscreen';
23
23
  // @ts-expect-error
24
- const FS_EXIT = document.exitFullscreen ? 'exitFullscreen' : 'webkitExitFullscreen';
25
- const FS_CHANGEEVENT = FS_ELEMENT === 'webkitFullscreenElement' ? 'webkitfullscreenchange' : 'fullscreenchange';
26
- const FS_ENABLED = document.fullscreenEnabled ? 'fullscreenEnabled' : 'webkitFullscreenEnabled';
27
-
28
- // @ts-expect-error
29
- const instuiPopupMountNode = () => document[FS_ELEMENT];
30
- export { FS_ELEMENT, FS_REQUEST, FS_EXIT, FS_CHANGEEVENT, FS_ENABLED, instuiPopupMountNode };
24
+ export const FS_EXIT = document.exitFullscreen ? 'exitFullscreen' : 'webkitExitFullscreen';
25
+ export const FS_CHANGEEVENT = FS_ELEMENT === 'webkitFullscreenElement' ? 'webkitfullscreenchange' : 'fullscreenchange';
26
+ export const FS_ENABLED = document.fullscreenEnabled ? 'fullscreenEnabled' : 'webkitFullscreenEnabled';
27
+ export const instuiPopupMountNodeFn = () => document.fullscreenElement || document.webkitFullscreenElement;
@@ -105,7 +105,7 @@ export async function insertPlaceholder(editor, unencodedName, placeholderInfoPr
105
105
  // Insert a minimal placeholder element into the editor.
106
106
  editor.undoManager.ignore(() => editor.execCommand('mceInsertContent', false, `<span
107
107
  aria-label="${formatMessage('Loading')}"
108
- data-placeholder-for="${encodeURIComponent(unencodedName)}"
108
+ data-placeholder-for="${encodeURIComponent(unencodedName || '')}"
109
109
  id="${placeholderId}"
110
110
  class="mceNonEditable"
111
111
  style="user-select: none; pointer-events: none; user-focus: none; display: inline-flex;"
@@ -115,11 +115,10 @@ export async function insertPlaceholder(editor, unencodedName, placeholderInfoPr
115
115
  const placeholderElem = editor.dom.doc.querySelector(`#${placeholderId}`);
116
116
  if (placeholderElem) {
117
117
  editor.undoManager.ignore(() => {
118
- var _nextNode$data;
119
118
  // Remove the trailing space
120
119
  const nextNode = placeholderElem.nextSibling;
121
120
  placeholderElem.contentEditable = 'false';
122
- if (isTextNode(nextNode) && nextNode !== null && nextNode !== void 0 && (_nextNode$data = nextNode.data) !== null && _nextNode$data !== void 0 && _nextNode$data.startsWith('\xA0' /* nbsp */)) {
121
+ if (isTextNode(nextNode) && nextNode?.data?.startsWith('\xA0' /* nbsp */)) {
123
122
  // Split out the non-breaking-space which only counts as length 1 for splitText
124
123
  nextNode.splitText(1);
125
124
 
@@ -22,8 +22,7 @@
22
22
  * @param compute The function to compute values in the cache
23
23
  * @param cache The map to use as a cache
24
24
  */
25
- export function simpleCache(compute) {
26
- let cache = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new Map();
25
+ export function simpleCache(compute, cache = new Map()) {
27
26
  return {
28
27
  cache,
29
28
  get(key) {
@@ -60,7 +60,7 @@ export function relativeHttpUrlForHostname(inputUrlStr, origin) {
60
60
  if (inputUrlStr == null || inputUrlStr === '') {
61
61
  return inputUrlStr;
62
62
  }
63
- if (!(inputUrlStr !== null && inputUrlStr !== void 0 && inputUrlStr.match(/^https?:/i)) || !(origin !== null && origin !== void 0 && origin.match(/^https?:/i))) {
63
+ if (!inputUrlStr?.match(/^https?:/i) || !origin?.match(/^https?:/i)) {
64
64
  // Already relative or not a http/https protocol url
65
65
  return inputUrlStr;
66
66
  }
@@ -77,19 +77,19 @@ export function relativeHttpUrlForHostname(inputUrlStr, origin) {
77
77
 
78
78
  // Handle the more complex case of hostname/port matching
79
79
  const originUrl = parseUrlOrNull(origin);
80
- const originHostname = originUrl === null || originUrl === void 0 ? void 0 : originUrl.hostname;
80
+ const originHostname = originUrl?.hostname;
81
81
 
82
82
  // Port checks are only needed if the port is not the default port for http or https.
83
83
  // If the port isn't an http port, then we don't want equivalence, especially for local origins,
84
84
  // since you might be running canvas on "localhost:3000" and some LTI tool on "localhost:4000"
85
85
  // But elsewhere, "http://canvas.com:80" and "http://canvas.com" are equivalent
86
86
  const urlUsesHttpPort = url.port === '80' || url.port === '443' || url.port === '';
87
- const originUsesHttpPort = originUrl == null || (originUrl === null || originUrl === void 0 ? void 0 : originUrl.port) === '80' || (originUrl === null || originUrl === void 0 ? void 0 : originUrl.port) === '443' || (originUrl === null || originUrl === void 0 ? void 0 : originUrl.port) === '';
87
+ const originUsesHttpPort = originUrl == null || originUrl?.port === '80' || originUrl?.port === '443' || originUrl?.port === '';
88
88
  const portCheckNeeded = !(urlUsesHttpPort && originUsesHttpPort);
89
- if (portCheckNeeded && (originUrl === null || originUrl === void 0 ? void 0 : originUrl.port) !== (url === null || url === void 0 ? void 0 : url.port)) {
89
+ if (portCheckNeeded && originUrl?.port !== url?.port) {
90
90
  return inputUrlStr;
91
91
  }
92
- if (url.hostname === (originHostname === null || originHostname === void 0 ? void 0 : originHostname.toLowerCase())) {
92
+ if (url.hostname === originHostname?.toLowerCase()) {
93
93
  return relativizeUrl(inputUrlStr);
94
94
  } else {
95
95
  return inputUrlStr;
package/eslint.config.js CHANGED
@@ -67,7 +67,18 @@ module.exports = tseslint.config(
67
67
  '@typescript-eslint/no-this-alias': 'off',
68
68
  '@typescript-eslint/no-unsafe-function-type': 'warn',
69
69
  '@typescript-eslint/no-unused-expressions': 'warn',
70
- '@typescript-eslint/no-unused-vars': 'warn',
70
+ '@typescript-eslint/no-unused-vars': [
71
+ 'warn',
72
+ {
73
+ args: 'all',
74
+ argsIgnorePattern: '^_',
75
+ caughtErrors: 'all',
76
+ caughtErrorsIgnorePattern: '^_',
77
+ destructuredArrayIgnorePattern: '^_',
78
+ varsIgnorePattern: '^_',
79
+ ignoreRestSiblings: true,
80
+ },
81
+ ],
71
82
  '@typescript-eslint/no-wrapper-object-types': 'warn',
72
83
  'no-undef': 'warn',
73
84
  },
@@ -94,7 +105,7 @@ module.exports = tseslint.config(
94
105
  'no-unexpected-multiline': 'warn',
95
106
  'no-unsafe-optional-chaining': 'warn',
96
107
  'no-unused-expressions': 'off',
97
- 'no-unused-vars': 'warn',
108
+ 'no-unused-vars': 'off', // use @typescript-eslint/no-unused-vars instead
98
109
  'no-useless-escape': 'warn',
99
110
  'prefer-const': 'warn',
100
111
  'prefer-rest-params': 'off',
@@ -167,7 +178,7 @@ module.exports = tseslint.config(
167
178
  rules: {
168
179
  'import/no-dynamic-require': 'warn',
169
180
  'import/no-nodejs-modules': 'warn',
170
- 'import/no-unresolved': 'warn',
181
+ 'import/no-unresolved': 'off', // not working properly
171
182
  'import/named': 'off',
172
183
  'import/namespace': 'off',
173
184
  },
@@ -235,5 +246,5 @@ module.exports = tseslint.config(
235
246
  'jest/valid-expect': 'error',
236
247
  'react/no-deprecated': 'warn',
237
248
  },
238
- }
249
+ },
239
250
  )