@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.
- package/CHANGELOG.md +10 -0
- package/DEVELOPMENT.md +1 -1
- package/es/bridge/Bridge.js +10 -17
- package/es/canvasFileBrowser/FileBrowser.js +10 -19
- package/es/common/FlashAlert.js +8 -11
- package/es/common/fileUrl.js +6 -10
- package/es/common/incremental-loading/LoadMoreButton.js +3 -4
- package/es/common/incremental-loading/LoadingStatus.js +4 -11
- package/es/common/indicate.js +1 -2
- package/es/defaultTinymceConfig.js +1 -1
- package/es/enhance-user-content/doc_previews.js +10 -10
- package/es/enhance-user-content/enhance_user_content.js +4 -7
- package/es/enhance-user-content/external_links.js +1 -1
- package/es/enhance-user-content/instructure_helper.js +11 -17
- package/es/enhance-user-content/mathml.js +15 -27
- package/es/enhance-user-content/media_comment_thumbnail.js +3 -10
- package/es/format-message.js +2 -2
- package/es/index.js +3 -5
- package/es/rce/AlertMessageArea.js +15 -16
- package/es/rce/KeyboardShortcutModal.js +2 -2
- package/es/rce/RCE.js +6 -8
- package/es/rce/RCEVariants.js +2 -4
- package/es/rce/RCEWrapper.js +397 -289
- package/es/rce/RCEWrapper.utils.js +131 -0
- package/es/rce/RCEWrapperProps.js +2 -3
- package/es/rce/RceHtmlEditor.js +12 -11
- package/es/rce/ResizeHandle.js +1 -2
- package/es/rce/ShowOnFocusButton/index.js +2 -2
- package/es/rce/StatusBar.js +5 -10
- package/es/rce/contentInsertion.js +1 -2
- package/es/rce/contentRendering.js +6 -5
- package/es/rce/editorLanguage.js +1 -1
- package/es/rce/indicatorRegion.js +1 -2
- package/es/rce/normalizeProps.js +4 -4
- package/es/rce/plugins/instructure_color/clickCallback.js +2 -4
- package/es/rce/plugins/instructure_color/components/ColorPicker.js +17 -22
- package/es/rce/plugins/instructure_color/components/ColorPopup.js +7 -8
- package/es/rce/plugins/instructure_condensed_buttons/ui/list-button.js +4 -10
- package/es/rce/plugins/instructure_condensed_buttons/ui/subscript-superscript-button.js +1 -1
- package/es/rce/plugins/instructure_documents/components/Link.js +1 -2
- package/es/rce/plugins/instructure_equation/EquationEditorModal/index.js +5 -8
- package/es/rce/plugins/instructure_equation/EquationEditorModal/latexTextareaUtil.js +3 -3
- package/es/rce/plugins/instructure_equation/EquationEditorModal/parseLatex.js +3 -3
- package/es/rce/plugins/instructure_equation/EquationEditorToolbar/buttons.js +2 -2
- package/es/rce/plugins/instructure_equation/EquationEditorToolbar/index.js +9 -11
- package/es/rce/plugins/instructure_equation/MathIcon/index.js +3 -4
- package/es/rce/plugins/instructure_equation/mathlive/index.js +167 -16
- package/es/rce/plugins/instructure_fullscreen/plugin.js +0 -2
- package/es/rce/plugins/instructure_icon_maker/clickCallback.js +3 -4
- package/es/rce/plugins/instructure_icon_maker/components/CreateIconMakerForm/ColorSection.js +46 -49
- package/es/rce/plugins/instructure_icon_maker/components/CreateIconMakerForm/CreateIconMakerForm.js +9 -10
- package/es/rce/plugins/instructure_icon_maker/components/CreateIconMakerForm/Footer.js +10 -11
- package/es/rce/plugins/instructure_icon_maker/components/CreateIconMakerForm/Group.js +5 -6
- package/es/rce/plugins/instructure_icon_maker/components/CreateIconMakerForm/Header.js +7 -8
- package/es/rce/plugins/instructure_icon_maker/components/CreateIconMakerForm/ImageSection/Course.js +7 -9
- package/es/rce/plugins/instructure_icon_maker/components/CreateIconMakerForm/ImageSection/ImageOptions.js +19 -26
- package/es/rce/plugins/instructure_icon_maker/components/CreateIconMakerForm/ImageSection/ImageSection.js +8 -12
- package/es/rce/plugins/instructure_icon_maker/components/CreateIconMakerForm/ImageSection/ModeSelect.js +6 -7
- package/es/rce/plugins/instructure_icon_maker/components/CreateIconMakerForm/ImageSection/MultiColor/index.js +5 -6
- package/es/rce/plugins/instructure_icon_maker/components/CreateIconMakerForm/ImageSection/SVGList.js +6 -7
- package/es/rce/plugins/instructure_icon_maker/components/CreateIconMakerForm/ImageSection/SVGThumbnail.js +8 -10
- package/es/rce/plugins/instructure_icon_maker/components/CreateIconMakerForm/ImageSection/SingleColor/index.js +5 -6
- package/es/rce/plugins/instructure_icon_maker/components/CreateIconMakerForm/ImageSection/SingleColor/svg.js +32 -80
- package/es/rce/plugins/instructure_icon_maker/components/CreateIconMakerForm/ImageSection/Upload.js +7 -8
- package/es/rce/plugins/instructure_icon_maker/components/CreateIconMakerForm/ImageSection/utils.js +4 -5
- package/es/rce/plugins/instructure_icon_maker/components/CreateIconMakerForm/Preview.js +3 -4
- package/es/rce/plugins/instructure_icon_maker/components/CreateIconMakerForm/ShapeSection.js +4 -5
- package/es/rce/plugins/instructure_icon_maker/components/CreateIconMakerForm/TextSection.js +4 -5
- package/es/rce/plugins/instructure_icon_maker/components/IconMakerTray.js +22 -29
- package/es/rce/plugins/instructure_icon_maker/registerEditToolbar.js +1 -1
- package/es/rce/plugins/instructure_icon_maker/svg/image.js +5 -7
- package/es/rce/plugins/instructure_icon_maker/svg/index.js +6 -9
- package/es/rce/plugins/instructure_icon_maker/svg/settings.js +17 -20
- package/es/rce/plugins/instructure_icon_maker/svg/shape.js +4 -5
- package/es/rce/plugins/instructure_icon_maker/svg/text.js +28 -32
- package/es/rce/plugins/instructure_icon_maker/svg/utils.js +2 -4
- package/es/rce/plugins/instructure_icon_maker/utils/IconMakerClose.js +2 -3
- package/es/rce/plugins/instructure_icon_maker/utils/iconValidation.js +1 -2
- package/es/rce/plugins/instructure_image/ImageEmbedOptions.js +3 -7
- package/es/rce/plugins/instructure_image/ImageList/Image.js +7 -8
- package/es/rce/plugins/instructure_image/ImageList/index.js +7 -8
- package/es/rce/plugins/instructure_image/ImageOptionsTray/TrayController.js +2 -4
- package/es/rce/plugins/instructure_image/ImageOptionsTray/index.js +3 -3
- package/es/rce/plugins/instructure_image/plugin.js +1 -2
- package/es/rce/plugins/instructure_links/components/AccordionSection.js +7 -8
- package/es/rce/plugins/instructure_links/components/Link.js +61 -65
- package/es/rce/plugins/instructure_links/components/LinkOptionsDialog/LinkOptionsDialogController.js +1 -2
- package/es/rce/plugins/instructure_links/components/LinkOptionsDialog/index.js +2 -2
- package/es/rce/plugins/instructure_links/components/LinkOptionsTray/index.js +2 -2
- package/es/rce/plugins/instructure_links/components/LinkSet.js +28 -37
- package/es/rce/plugins/instructure_links/components/LinksPanel.js +21 -8
- package/es/rce/plugins/instructure_links/components/NoResults.js +6 -7
- package/es/rce/plugins/instructure_links/plugin.js +6 -9
- package/es/rce/plugins/instructure_media_embed/clickCallback.js +3 -4
- package/es/rce/plugins/instructure_media_embed/components/Embed.js +6 -7
- package/es/rce/plugins/instructure_paste/plugin.js +5 -7
- package/es/rce/plugins/instructure_rce_external_tools/ExternalToolsEnv.js +24 -33
- package/es/rce/plugins/instructure_rce_external_tools/RceToolWrapper.js +7 -38
- package/es/rce/plugins/instructure_rce_external_tools/components/ExternalToolDialog/ExternalToolDialog.js +30 -29
- package/es/rce/plugins/instructure_rce_external_tools/components/ExternalToolSelectionDialog/ExternalToolSelectionDialog.js +3 -4
- package/es/rce/plugins/instructure_rce_external_tools/dialog-helper.js +1 -2
- package/es/rce/plugins/instructure_rce_external_tools/jquery/jquery.dropdownList.js +3 -4
- package/es/rce/plugins/instructure_rce_external_tools/lti11-content-items/RceLti11ContentItem.js +17 -24
- package/es/rce/plugins/instructure_rce_external_tools/lti13-content-items/RceLti13ContentItem.js +2 -2
- package/es/rce/plugins/instructure_rce_external_tools/lti13-content-items/models/BaseLinkContentItem.js +4 -5
- package/es/rce/plugins/instructure_rce_external_tools/lti13-content-items/processEditorContentItems.js +8 -9
- package/es/rce/plugins/instructure_rce_external_tools/lti13-content-items/rceLti13ContentItemFromJson.js +0 -1
- package/es/rce/plugins/instructure_rce_external_tools/plugin.js +4 -4
- package/es/rce/plugins/instructure_rce_external_tools/util/externalToolsForToolbar.js +42 -0
- package/es/rce/plugins/instructure_record/AudioOptionsTray/TrayController.js +5 -10
- package/es/rce/plugins/instructure_record/AudioOptionsTray/index.js +12 -13
- package/es/rce/plugins/instructure_record/VideoOptionsTray/TrayController.js +8 -15
- package/es/rce/plugins/instructure_record/VideoOptionsTray/index.js +19 -20
- package/es/rce/plugins/instructure_record/clickCallback.js +26 -30
- package/es/rce/plugins/instructure_search_and_replace/clickCallback.js +2 -3
- package/es/rce/plugins/instructure_search_and_replace/components/FindReplaceTray.js +14 -16
- package/es/rce/plugins/instructure_search_and_replace/components/FindReplaceTrayController.js +9 -12
- package/es/rce/plugins/instructure_search_and_replace/plugin.js +1 -2
- package/es/rce/plugins/instructure_wordcount/clickCallback.js +3 -4
- package/es/rce/plugins/instructure_wordcount/components/WordCountModal.js +26 -33
- package/es/rce/plugins/instructure_wordcount/utils/countContent.js +3 -3
- package/es/rce/plugins/instructure_wordcount/utils/tableContent.js +5 -8
- package/es/rce/plugins/shared/CanvasContentTray.js +9 -16
- package/es/rce/plugins/shared/ColorInput.js +22 -25
- package/es/rce/plugins/shared/ConditionalTooltip.js +5 -6
- package/es/rce/plugins/shared/ContentSelection.js +12 -20
- package/es/rce/plugins/shared/DimensionUtils.js +2 -4
- package/es/rce/plugins/shared/EventUtils.js +1 -1
- package/es/rce/plugins/shared/FixedContentTray.js +13 -14
- package/es/rce/plugins/shared/ImageCropper/DirectionRegion.js +3 -4
- package/es/rce/plugins/shared/ImageCropper/Modal.js +12 -13
- package/es/rce/plugins/shared/ImageCropper/Preview.js +11 -13
- package/es/rce/plugins/shared/ImageCropper/controls/CustomNumberInput.js +8 -9
- package/es/rce/plugins/shared/ImageCropper/controls/ResetControls.js +3 -4
- package/es/rce/plugins/shared/ImageCropper/controls/RotationControls.js +4 -5
- package/es/rce/plugins/shared/ImageCropper/controls/ShapeControls.js +7 -11
- package/es/rce/plugins/shared/ImageCropper/controls/ZoomControls.js +4 -5
- package/es/rce/plugins/shared/ImageCropper/controls/index.js +4 -5
- package/es/rce/plugins/shared/ImageCropper/controls/useDebouncedNumericValue.js +13 -15
- package/es/rce/plugins/shared/ImageCropper/imageCropUtils.js +18 -21
- package/es/rce/plugins/shared/ImageCropper/svg/shape.js +4 -5
- package/es/rce/plugins/shared/ImageCropper/svg/utils.js +2 -4
- package/es/rce/plugins/shared/ImageCropper/useKeyMouseEvents.js +1 -4
- package/es/rce/plugins/shared/ImageOptionsForm.js +17 -18
- package/es/rce/plugins/shared/LinkDisplay.js +8 -9
- package/es/rce/plugins/shared/PreviewIcon.js +8 -9
- package/es/rce/plugins/shared/RceFileBrowser.js +2 -3
- package/es/rce/plugins/shared/StoreContext.js +8 -10
- package/es/rce/plugins/shared/StudioLtiSupportUtils.js +5 -6
- package/es/rce/plugins/shared/Upload/CanvasContentPanel.js +6 -7
- package/es/rce/plugins/shared/Upload/CategoryProcessor.js +1 -2
- package/es/rce/plugins/shared/Upload/ComputerPanel.js +11 -14
- package/es/rce/plugins/shared/Upload/PanelFilter.js +7 -8
- package/es/rce/plugins/shared/Upload/UploadFile.js +19 -22
- package/es/rce/plugins/shared/Upload/UploadFileModal.js +28 -34
- package/es/rce/plugins/shared/Upload/UrlPanel.js +4 -5
- package/es/rce/plugins/shared/Upload/UsageRightsSelectBox.js +18 -24
- package/es/rce/plugins/shared/Upload/doFileUpload.js +6 -7
- package/es/rce/plugins/shared/ai_tools/AIResponseModal.js +7 -8
- package/es/rce/plugins/shared/ai_tools/AIToolsTray.js +14 -17
- package/es/rce/plugins/shared/ai_tools/aiicons.js +2 -2
- package/es/rce/plugins/shared/canvasContentUtils.js +1 -2
- package/es/rce/plugins/shared/compressionUtils.js +17 -20
- package/es/rce/plugins/shared/do-fetch-api-effect/doFetchApi.js +12 -15
- package/es/rce/plugins/shared/do-fetch-api-effect/get-cookie.js +1 -1
- package/es/rce/plugins/shared/fileTypeUtils.js +3 -6
- package/es/rce/plugins/shared/round.js +1 -2
- package/es/rce/plugins/shared/trayUtils.js +3 -0
- package/es/rce/plugins/shared/useDataUrl.js +4 -5
- package/es/rce/plugins/tinymce-a11y-checker/components/ColorField.js +2 -2
- package/es/rce/plugins/tinymce-a11y-checker/components/checker.js +8 -10
- package/es/rce/plugins/tinymce-a11y-checker/node-checker.js +1 -3
- package/es/rce/plugins/tinymce-a11y-checker/plugin.js +14 -17
- package/es/rce/plugins/tinymce-a11y-checker/rules/headings-start-at-h2.js +1 -2
- package/es/rce/plugins/tinymce-a11y-checker/rules/large-text-contrast.js +1 -2
- package/es/rce/plugins/tinymce-a11y-checker/rules/small-text-contrast.js +1 -2
- package/es/rce/plugins/tinymce-a11y-checker/utils/dom.js +2 -4
- package/es/rce/plugins/tinymce-a11y-checker/utils/indicate.js +2 -3
- package/es/rce/plugins/tinymce-a11y-checker/utils/rgb-hex.js +1 -4
- package/es/rce/root.js +9 -9
- package/es/rce/tinyRCE.js +1 -0
- package/es/rce/transformContent.js +1 -1
- package/es/rcs/api.js +39 -55
- package/es/rcs/buildError.js +3 -3
- package/es/rcs/fake.js +5 -7
- package/es/sidebar/actions/documents.js +10 -12
- package/es/sidebar/actions/files.js +18 -22
- package/es/sidebar/actions/filter.js +4 -5
- package/es/sidebar/actions/images.js +20 -26
- package/es/sidebar/actions/media.js +15 -18
- package/es/sidebar/actions/session.js +1 -2
- package/es/sidebar/actions/upload.js +26 -37
- package/es/sidebar/containers/sidebarHandlers.js +6 -12
- package/es/sidebar/dragHtml.js +6 -2
- package/es/sidebar/reducers/all_files.js +1 -3
- package/es/sidebar/reducers/collection.js +1 -3
- package/es/sidebar/reducers/collections.js +1 -3
- package/es/sidebar/reducers/documents.js +1 -3
- package/es/sidebar/reducers/files.js +1 -3
- package/es/sidebar/reducers/filter.js +7 -15
- package/es/sidebar/reducers/flickr.js +1 -3
- package/es/sidebar/reducers/folder.js +1 -3
- package/es/sidebar/reducers/folders.js +1 -3
- package/es/sidebar/reducers/images.js +1 -3
- package/es/sidebar/reducers/media.js +1 -3
- package/es/sidebar/reducers/newPageLinkExpanded.js +1 -3
- package/es/sidebar/reducers/noop.js +1 -2
- package/es/sidebar/reducers/rootFolderId.js +1 -3
- package/es/sidebar/reducers/session.js +1 -3
- package/es/sidebar/reducers/ui.js +3 -9
- package/es/sidebar/reducers/upload.js +8 -24
- package/es/sidebar/store/initialState.js +1 -2
- package/es/translations/locales/ar.js +6 -0
- package/es/translations/locales/ca.js +6 -0
- package/es/translations/locales/cy.js +6 -0
- package/es/translations/locales/da-x-k12.js +6 -0
- package/es/translations/locales/da.js +6 -0
- package/es/translations/locales/de.js +6 -0
- package/es/translations/locales/en-AU-x-unimelb.js +6 -0
- package/es/translations/locales/en-GB-x-ukhe.js +6 -0
- package/es/translations/locales/en_AU.js +6 -0
- package/es/translations/locales/en_CA.js +6 -0
- package/es/translations/locales/en_CY.js +6 -0
- package/es/translations/locales/en_GB.js +6 -0
- package/es/translations/locales/es.js +6 -0
- package/es/translations/locales/es_ES.js +6 -0
- package/es/translations/locales/fi.js +6 -0
- package/es/translations/locales/fr.js +6 -0
- package/es/translations/locales/fr_CA.js +6 -0
- package/es/translations/locales/hi.js +6 -0
- package/es/translations/locales/ht.js +6 -0
- package/es/translations/locales/id.js +6 -0
- package/es/translations/locales/is.js +6 -0
- package/es/translations/locales/it.js +6 -0
- package/es/translations/locales/ja.js +6 -0
- package/es/translations/locales/mi.js +6 -0
- package/es/translations/locales/ms.js +6 -0
- package/es/translations/locales/nb-x-k12.js +6 -0
- package/es/translations/locales/nb.js +6 -0
- package/es/translations/locales/nl.js +6 -0
- package/es/translations/locales/pl.js +6 -0
- package/es/translations/locales/pt.js +6 -0
- package/es/translations/locales/pt_BR.js +6 -0
- package/es/translations/locales/ru.js +6 -0
- package/es/translations/locales/sl.js +6 -0
- package/es/translations/locales/sv-x-k12.js +6 -0
- package/es/translations/locales/sv.js +6 -0
- package/es/translations/locales/th.js +6 -0
- package/es/translations/locales/vi.js +6 -0
- package/es/translations/locales/zh-Hans.js +6 -0
- package/es/translations/locales/zh-Hant.js +6 -0
- package/es/translations/locales/zh.js +6 -0
- package/es/translations/locales/zh_HK.js +6 -0
- package/es/util/elem-util.js +1 -1
- package/es/util/file-url-util.js +1 -1
- package/es/util/fullscreenHelpers.js +6 -9
- package/es/util/loadingPlaceholder.js +2 -3
- package/es/util/simpleCache.js +1 -2
- package/es/util/url-util.js +5 -5
- package/eslint.config.js +15 -4
- package/locales/en.json +190 -10
- package/package.json +56 -55
- package/scripts/installTranslations.js +7 -8
- package/tsconfig.json +1 -1
- package/types/format-message-generate-id.d.ts +22 -0
- 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
|
},
|
package/es/util/elem-util.js
CHANGED
package/es/util/file-url-util.js
CHANGED
|
@@ -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 (
|
|
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
|
|
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
|
|
package/es/util/simpleCache.js
CHANGED
|
@@ -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) {
|
package/es/util/url-util.js
CHANGED
|
@@ -60,7 +60,7 @@ export function relativeHttpUrlForHostname(inputUrlStr, origin) {
|
|
|
60
60
|
if (inputUrlStr == null || inputUrlStr === '') {
|
|
61
61
|
return inputUrlStr;
|
|
62
62
|
}
|
|
63
|
-
if (!
|
|
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
|
|
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 ||
|
|
87
|
+
const originUsesHttpPort = originUrl == null || originUrl?.port === '80' || originUrl?.port === '443' || originUrl?.port === '';
|
|
88
88
|
const portCheckNeeded = !(urlUsesHttpPort && originUsesHttpPort);
|
|
89
|
-
if (portCheckNeeded &&
|
|
89
|
+
if (portCheckNeeded && originUrl?.port !== url?.port) {
|
|
90
90
|
return inputUrlStr;
|
|
91
91
|
}
|
|
92
|
-
if (url.hostname ===
|
|
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':
|
|
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': '
|
|
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': '
|
|
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
|
)
|