@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
|
@@ -29,24 +29,23 @@ import { Tooltip } from '@instructure/ui-tooltip';
|
|
|
29
29
|
import { CUSTOM, MIN_HEIGHT, MIN_WIDTH, MIN_PERCENTAGE, imageSizes, labelForImageSize } from '../instructure_image/ImageEmbedOptions';
|
|
30
30
|
import formatMessage from '../../../format-message';
|
|
31
31
|
import DimensionsInput from './DimensionsInput';
|
|
32
|
-
const ImageOptionsForm =
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
} = _ref;
|
|
32
|
+
const ImageOptionsForm = ({
|
|
33
|
+
imageSize,
|
|
34
|
+
displayAs,
|
|
35
|
+
isDecorativeImage,
|
|
36
|
+
altText,
|
|
37
|
+
isLinked,
|
|
38
|
+
dimensionsState,
|
|
39
|
+
handleAltTextChange,
|
|
40
|
+
handleIsDecorativeChange,
|
|
41
|
+
handleDisplayAsChange,
|
|
42
|
+
handleImageSizeChange,
|
|
43
|
+
messagesForSize,
|
|
44
|
+
hideDimensions,
|
|
45
|
+
id = 'image-options-form',
|
|
46
|
+
isIconMaker = false,
|
|
47
|
+
forBlockEditorUse = false
|
|
48
|
+
}) => {
|
|
50
49
|
const TYPE = isIconMaker ? formatMessage('icon') : formatMessage('image');
|
|
51
50
|
const tooltipText = formatMessage('Used by screen readers to describe the content of an {TYPE}', {
|
|
52
51
|
TYPE
|
|
@@ -26,15 +26,14 @@ import { showFlashAlert } from '../../../common/FlashAlert';
|
|
|
26
26
|
import { ScreenReaderContent } from '@instructure/ui-a11y-content';
|
|
27
27
|
import { getIcon, getFriendlyLinkType } from './linkUtils';
|
|
28
28
|
const getEditMessage = () => formatMessage('If left empty, link text will display as course link name');
|
|
29
|
-
export const LinkDisplay =
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
} = _ref;
|
|
29
|
+
export const LinkDisplay = ({
|
|
30
|
+
linkText,
|
|
31
|
+
placeholderText,
|
|
32
|
+
linkFileName,
|
|
33
|
+
published,
|
|
34
|
+
handleTextChange,
|
|
35
|
+
linkType
|
|
36
|
+
}) => {
|
|
38
37
|
useEffect(() => {
|
|
39
38
|
showFlashAlert({
|
|
40
39
|
message: formatMessage('Selected {linkFileName}', {
|
|
@@ -23,15 +23,14 @@ import { Flex } from '@instructure/ui-flex';
|
|
|
23
23
|
import formatMessage from '../../../format-message';
|
|
24
24
|
import checkerboardStyle from './CheckerboardStyling';
|
|
25
25
|
const SQUARE_SIZE = 4;
|
|
26
|
-
const PreviewIcon =
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
} = _ref;
|
|
26
|
+
const PreviewIcon = ({
|
|
27
|
+
color,
|
|
28
|
+
testId,
|
|
29
|
+
variant,
|
|
30
|
+
image,
|
|
31
|
+
loading,
|
|
32
|
+
checkered
|
|
33
|
+
}) => {
|
|
35
34
|
const variantSettings = PreviewIcon.variants[variant];
|
|
36
35
|
const background = () => {
|
|
37
36
|
if (loading) return {};
|
|
@@ -59,7 +59,6 @@ export default function RceFileBrowser(props) {
|
|
|
59
59
|
});
|
|
60
60
|
}, [host, jwt, refreshToken, source, canvasOrigin]);
|
|
61
61
|
function handleFileSelect(fileInfo) {
|
|
62
|
-
var _fileInfo$api$embed, _fileInfo$api;
|
|
63
62
|
const content_type = fileInfo.api.type;
|
|
64
63
|
const canPreview = isPreviewable(content_type);
|
|
65
64
|
const url = downloadToWrap(fileInfo.src);
|
|
@@ -69,11 +68,11 @@ export default function RceFileBrowser(props) {
|
|
|
69
68
|
title: fileInfo.name,
|
|
70
69
|
href: url,
|
|
71
70
|
embedded_iframe_url,
|
|
72
|
-
media_id:
|
|
71
|
+
media_id: fileInfo.api.embed?.id || fileInfo.api.mediaEntryId,
|
|
73
72
|
target: '_blank',
|
|
74
73
|
content_type
|
|
75
74
|
};
|
|
76
|
-
if (
|
|
75
|
+
if (fileInfo.api?.category === 'icon_maker_icons') {
|
|
77
76
|
onFileSelectParams.src = fileInfo.api.url;
|
|
78
77
|
addIconMakerAttributes(onFileSelectParams);
|
|
79
78
|
} else {
|
|
@@ -22,11 +22,10 @@ import bridge from '../../../bridge';
|
|
|
22
22
|
import sidebarHandlers from '../../../sidebar/containers/sidebarHandlers';
|
|
23
23
|
import { propsFromState } from '../../../sidebar/containers/Sidebar';
|
|
24
24
|
import configureStore from '../../../sidebar/store/configureStore';
|
|
25
|
-
function Consumer(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
} = _ref;
|
|
25
|
+
function Consumer({
|
|
26
|
+
children,
|
|
27
|
+
...props
|
|
28
|
+
}) {
|
|
30
29
|
return children({
|
|
31
30
|
onLinkClick: bridge.insertLink,
|
|
32
31
|
onImageEmbed: bridge.embedImage,
|
|
@@ -37,11 +36,10 @@ function Consumer(_ref) {
|
|
|
37
36
|
}
|
|
38
37
|
export const StoreConsumer = connect(propsFromState, sidebarHandlers)(Consumer);
|
|
39
38
|
const StoreContext = /*#__PURE__*/createContext();
|
|
40
|
-
export function StoreProvider(
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
} = _ref2;
|
|
39
|
+
export function StoreProvider({
|
|
40
|
+
children,
|
|
41
|
+
...storeProps
|
|
42
|
+
}) {
|
|
45
43
|
const [store] = useState(() => configureStore(storeProps));
|
|
46
44
|
return /*#__PURE__*/React.createElement(ReduxProvider, {
|
|
47
45
|
store: store
|
|
@@ -45,19 +45,18 @@ export function displayStyleFrom(studioAttributes) {
|
|
|
45
45
|
return studioAttributes['data-studio-resizable'] || studioAttributes['data-studio-tray-enabled'] ? 'inline-block' : '';
|
|
46
46
|
}
|
|
47
47
|
export function isStudioEmbeddedMedia(element) {
|
|
48
|
-
var _tinymceIframeShim$fi;
|
|
49
48
|
// Borrowing this structure from isMediaElement in ContentSelection.js
|
|
50
|
-
const tinymceIframeShim =
|
|
51
|
-
if (
|
|
49
|
+
const tinymceIframeShim = element?.tagName === 'IFRAME' ? element?.parentElement : element;
|
|
50
|
+
if (tinymceIframeShim?.firstElementChild?.tagName !== 'IFRAME') {
|
|
52
51
|
return false;
|
|
53
52
|
}
|
|
54
53
|
return tinymceIframeShim.getAttribute('data-mce-p-data-studio-tray-enabled') === 'true';
|
|
55
54
|
}
|
|
56
55
|
export function parseStudioOptions(element) {
|
|
57
|
-
const tinymceIframeShim =
|
|
56
|
+
const tinymceIframeShim = element?.tagName === 'IFRAME' ? element?.parentElement : element;
|
|
58
57
|
return {
|
|
59
|
-
resizable:
|
|
60
|
-
convertibleToLink:
|
|
58
|
+
resizable: tinymceIframeShim?.getAttribute('data-mce-p-data-studio-resizable') === 'true',
|
|
59
|
+
convertibleToLink: tinymceIframeShim?.getAttribute('data-mce-p-data-studio-convertible-to-link') === 'true'
|
|
61
60
|
};
|
|
62
61
|
}
|
|
63
62
|
|
|
@@ -25,13 +25,12 @@ import PanelFilter from './PanelFilter';
|
|
|
25
25
|
import { FILTER_SETTINGS_BY_PLUGIN, DynamicPanel } from '../canvasContentUtils';
|
|
26
26
|
import { useStoreProps } from '../StoreContext';
|
|
27
27
|
// TODO: Component is only validated for images, need to validate for other content types
|
|
28
|
-
export default function CanvasContentPanel(
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
} = _ref;
|
|
28
|
+
export default function CanvasContentPanel({
|
|
29
|
+
trayProps,
|
|
30
|
+
canvasOrigin,
|
|
31
|
+
plugin,
|
|
32
|
+
setFileUrl
|
|
33
|
+
}) {
|
|
35
34
|
const [filterSettings, setFilterSettings] = useFilterSettings(FILTER_SETTINGS_BY_PLUGIN[plugin]);
|
|
36
35
|
const [link, setLink] = useState(null);
|
|
37
36
|
const [hasLoaded, setHasLoaded] = useState(false);
|
|
@@ -18,10 +18,9 @@
|
|
|
18
18
|
|
|
19
19
|
import * as SvgProcessor from './SvgCategoryProcessor';
|
|
20
20
|
export async function process(file) {
|
|
21
|
-
var _file$type;
|
|
22
21
|
// Determine which processor to use based on file type.
|
|
23
22
|
// If no matching processor is found for the given file type, return undefined
|
|
24
|
-
if (file
|
|
23
|
+
if (file?.type?.includes(SvgProcessor.typeTest)) {
|
|
25
24
|
return await SvgProcessor.process(file);
|
|
26
25
|
}
|
|
27
26
|
}
|
|
@@ -83,15 +83,14 @@ function readFile(theFile) {
|
|
|
83
83
|
});
|
|
84
84
|
return p;
|
|
85
85
|
}
|
|
86
|
-
export default function ComputerPanel(
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
} = _ref;
|
|
86
|
+
export default function ComputerPanel({
|
|
87
|
+
theFile,
|
|
88
|
+
setFile,
|
|
89
|
+
setError,
|
|
90
|
+
accept,
|
|
91
|
+
label,
|
|
92
|
+
bounds
|
|
93
|
+
}) {
|
|
95
94
|
const [messages, setMessages] = useState([]);
|
|
96
95
|
const [preview, setPreview] = useState({
|
|
97
96
|
preview: null,
|
|
@@ -105,9 +104,8 @@ export default function ComputerPanel(_ref) {
|
|
|
105
104
|
const width = 0.8 * bounds.width;
|
|
106
105
|
useEffect(() => {
|
|
107
106
|
return () => {
|
|
108
|
-
if (Array.isArray(preview
|
|
109
|
-
|
|
110
|
-
(_URL = URL) === null || _URL === void 0 ? void 0 : (_URL$revokeObjectURL = _URL.revokeObjectURL) === null || _URL$revokeObjectURL === void 0 ? void 0 : _URL$revokeObjectURL.call(_URL, preview.preview[0].src);
|
|
107
|
+
if (Array.isArray(preview?.preview)) {
|
|
108
|
+
URL?.revokeObjectURL?.(preview.preview[0].src);
|
|
111
109
|
}
|
|
112
110
|
};
|
|
113
111
|
}, [preview]);
|
|
@@ -259,8 +257,7 @@ export default function ComputerPanel(_ref) {
|
|
|
259
257
|
}, /*#__PURE__*/React.createElement(FileDrop, {
|
|
260
258
|
"data-testid": "filedrop",
|
|
261
259
|
accept: accept,
|
|
262
|
-
onDropAccepted:
|
|
263
|
-
let [file] = _ref2;
|
|
260
|
+
onDropAccepted: ([file]) => {
|
|
264
261
|
if (messages.length) {
|
|
265
262
|
setMessages([]);
|
|
266
263
|
}
|
|
@@ -28,14 +28,13 @@ import React, { useEffect, useState } from 'react';
|
|
|
28
28
|
function shouldSearch(searchString) {
|
|
29
29
|
return searchString.length === 0 || searchString.length >= 3;
|
|
30
30
|
}
|
|
31
|
-
export default function PanelFilter(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
} = _ref;
|
|
31
|
+
export default function PanelFilter({
|
|
32
|
+
mountNode,
|
|
33
|
+
onChange,
|
|
34
|
+
sortValue,
|
|
35
|
+
searchString,
|
|
36
|
+
contentType
|
|
37
|
+
}) {
|
|
39
38
|
const [pendingSearchString, setPendingSearchString] = useState(searchString);
|
|
40
39
|
const [searchInputTimer, setSearchInputTimer] = useState(0);
|
|
41
40
|
|
|
@@ -33,24 +33,22 @@ export const FullPanelIds = [...UploadCanvasPanelIds, ...UploadFilePanelIds];
|
|
|
33
33
|
/**
|
|
34
34
|
* Handles uploading data based on what type of data is submitted.
|
|
35
35
|
*/
|
|
36
|
-
export const handleSubmit =
|
|
36
|
+
export const handleSubmit = (editor, accept, selectedPanel,
|
|
37
37
|
// @ts-expect-error
|
|
38
38
|
uploadData,
|
|
39
39
|
// @ts-expect-error
|
|
40
40
|
storeProps,
|
|
41
41
|
// @ts-expect-error
|
|
42
|
-
_source) {
|
|
43
|
-
let afterInsert = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : () => undefined;
|
|
42
|
+
_source, afterInsert = () => undefined) => {
|
|
44
43
|
Bridge.focusEditor(RCEWrapper.getByEditor(editor)); // necessary since it blurred when the modal opened
|
|
45
44
|
const {
|
|
46
45
|
altText,
|
|
47
46
|
isDecorativeImage,
|
|
48
47
|
displayAs
|
|
49
|
-
} =
|
|
48
|
+
} = uploadData?.imageOptions || {};
|
|
50
49
|
switch (selectedPanel) {
|
|
51
50
|
case 'COMPUTER':
|
|
52
51
|
{
|
|
53
|
-
var _uploadData$usageRigh;
|
|
54
52
|
const {
|
|
55
53
|
theFile
|
|
56
54
|
} = uploadData;
|
|
@@ -63,7 +61,7 @@ _source) {
|
|
|
63
61
|
altText,
|
|
64
62
|
isDecorativeImage,
|
|
65
63
|
displayAs,
|
|
66
|
-
usageRights:
|
|
64
|
+
usageRights: uploadData?.usageRights?.usageRight === 'choose' ? undefined : uploadData?.usageRights
|
|
67
65
|
};
|
|
68
66
|
let tabContext = 'documents';
|
|
69
67
|
if (isImage(theFile.type)) {
|
|
@@ -104,21 +102,20 @@ _source) {
|
|
|
104
102
|
element.addEventListener('load', () => indicate(indicatorRegion(editor, element)));
|
|
105
103
|
afterInsert();
|
|
106
104
|
};
|
|
107
|
-
export function UploadFile(
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
} = _ref;
|
|
105
|
+
export function UploadFile({
|
|
106
|
+
accept,
|
|
107
|
+
editor,
|
|
108
|
+
label,
|
|
109
|
+
panels,
|
|
110
|
+
onDismiss,
|
|
111
|
+
requireA11yAttributes = true,
|
|
112
|
+
forBlockEditorUse = false,
|
|
113
|
+
uploading = false,
|
|
114
|
+
trayProps,
|
|
115
|
+
canvasOrigin,
|
|
116
|
+
onSubmit = handleSubmit,
|
|
117
|
+
preselectedFile = undefined
|
|
118
|
+
}) {
|
|
122
119
|
const [modalBodyWidth, setModalBodyWidth] = useState(undefined);
|
|
123
120
|
const [modalBodyHeight, setModalBodyHeight] = useState(undefined);
|
|
124
121
|
const [theFile] = useState(preselectedFile);
|
|
@@ -135,7 +132,7 @@ export function UploadFile(_ref) {
|
|
|
135
132
|
if (bodyRef.current) {
|
|
136
133
|
// eslint-disable-next-line react/no-find-dom-node
|
|
137
134
|
const thebody = ReactDOM.findDOMNode(bodyRef.current);
|
|
138
|
-
const sz = thebody
|
|
135
|
+
const sz = thebody?.getBoundingClientRect();
|
|
139
136
|
sz.height -= px('3rem'); // leave room for the tabs
|
|
140
137
|
setModalBodyWidth(sz.width);
|
|
141
138
|
setModalBodyHeight(sz.height);
|
|
@@ -25,7 +25,7 @@ import { Spinner } from '@instructure/ui-spinner';
|
|
|
25
25
|
import { Tabs } from '@instructure/ui-tabs';
|
|
26
26
|
import { ToggleDetails } from '@instructure/ui-toggle-details';
|
|
27
27
|
import formatMessage from '../../../../format-message';
|
|
28
|
-
import {
|
|
28
|
+
import { instuiPopupMountNodeFn } from '../../../../util/fullscreenHelpers';
|
|
29
29
|
import RceApiSource from '../../../../rcs/api';
|
|
30
30
|
import ImageOptionsForm from '../ImageOptionsForm';
|
|
31
31
|
import UsageRightsSelectBox from './UsageRightsSelectBox';
|
|
@@ -34,12 +34,11 @@ import { UploadCanvasPanelIds, CanvasPanelTitles } from '../canvasContentUtils';
|
|
|
34
34
|
const CanvasContentPanel = /*#__PURE__*/React.lazy(() => import('./CanvasContentPanel'));
|
|
35
35
|
const ComputerPanel = /*#__PURE__*/React.lazy(() => import('./ComputerPanel'));
|
|
36
36
|
const UrlPanel = /*#__PURE__*/React.lazy(() => import('./UrlPanel'));
|
|
37
|
-
function shouldBeDisabled(
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
} = _ref;
|
|
37
|
+
function shouldBeDisabled({
|
|
38
|
+
fileUrl,
|
|
39
|
+
theFile,
|
|
40
|
+
error
|
|
41
|
+
}, selectedPanel, usageRightNotSet) {
|
|
43
42
|
if (error || usageRightNotSet && selectedPanel === 'COMPUTER') {
|
|
44
43
|
return true;
|
|
45
44
|
}
|
|
@@ -54,25 +53,23 @@ function shouldBeDisabled(_ref, selectedPanel, usageRightNotSet) {
|
|
|
54
53
|
// When in doubt, don't disable (but we shouldn't get here either)
|
|
55
54
|
}
|
|
56
55
|
}
|
|
57
|
-
const UploadFileModal = /*#__PURE__*/React.forwardRef((
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
uploading = false
|
|
75
|
-
} = _ref2;
|
|
56
|
+
const UploadFileModal = /*#__PURE__*/React.forwardRef(({
|
|
57
|
+
preselectedFile,
|
|
58
|
+
editor,
|
|
59
|
+
contentProps,
|
|
60
|
+
trayProps,
|
|
61
|
+
canvasOrigin,
|
|
62
|
+
onSubmit,
|
|
63
|
+
onDismiss,
|
|
64
|
+
panels,
|
|
65
|
+
label,
|
|
66
|
+
accept,
|
|
67
|
+
modalBodyWidth,
|
|
68
|
+
modalBodyHeight,
|
|
69
|
+
requireA11yAttributes = true,
|
|
70
|
+
forBlockEditorUse = false,
|
|
71
|
+
uploading = false
|
|
72
|
+
}, ref) => {
|
|
76
73
|
const [theFile, setFile] = useState(preselectedFile);
|
|
77
74
|
const [error, setError] = useState(null);
|
|
78
75
|
const [fileUrl, setFileUrl] = useState('');
|
|
@@ -89,7 +86,7 @@ const UploadFileModal = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
|
|
|
89
86
|
const [displayAs, setDisplayAs] = useState('embed');
|
|
90
87
|
// even though usage rights might be required by the course, canvas has no place
|
|
91
88
|
// on the user to store it. Only Group and Course.
|
|
92
|
-
const requiresUsageRights =
|
|
89
|
+
const requiresUsageRights = contentProps?.session?.usageRightsRequired && /(?:course|group)/.test(trayProps.contextType);
|
|
93
90
|
function handleAltTextChange(event) {
|
|
94
91
|
setAltText(event.target.value);
|
|
95
92
|
}
|
|
@@ -127,7 +124,7 @@ const UploadFileModal = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
|
|
|
127
124
|
"data-mce-component": true,
|
|
128
125
|
as: "form",
|
|
129
126
|
label: label,
|
|
130
|
-
mountNode:
|
|
127
|
+
mountNode: instuiPopupMountNodeFn,
|
|
131
128
|
size: "large",
|
|
132
129
|
overflow: "fit",
|
|
133
130
|
onDismiss: onDismiss,
|
|
@@ -158,12 +155,9 @@ const UploadFileModal = /*#__PURE__*/React.forwardRef((_ref2, ref) => {
|
|
|
158
155
|
}), /*#__PURE__*/React.createElement(Heading, null, label)), /*#__PURE__*/React.createElement(Modal.Body, {
|
|
159
156
|
ref: ref
|
|
160
157
|
}, /*#__PURE__*/React.createElement(Tabs, {
|
|
161
|
-
onRequestTabChange: (event,
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
} = _ref3;
|
|
165
|
-
return handleRequestTabChange(index);
|
|
166
|
-
}
|
|
158
|
+
onRequestTabChange: (event, {
|
|
159
|
+
index
|
|
160
|
+
}) => handleRequestTabChange(index)
|
|
167
161
|
}, panels.map(panel => {
|
|
168
162
|
switch (panel) {
|
|
169
163
|
case 'COMPUTER':
|
|
@@ -20,11 +20,10 @@ import React from 'react';
|
|
|
20
20
|
import { string, func } from 'prop-types';
|
|
21
21
|
import { TextInput } from '@instructure/ui-text-input';
|
|
22
22
|
import formatMessage from '../../../../format-message';
|
|
23
|
-
export default function UrlPanel(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
} = _ref;
|
|
23
|
+
export default function UrlPanel({
|
|
24
|
+
fileUrl,
|
|
25
|
+
setFileUrl
|
|
26
|
+
}) {
|
|
28
27
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(TextInput, {
|
|
29
28
|
name: "file-url",
|
|
30
29
|
renderLabel: formatMessage('File URL'),
|
|
@@ -22,12 +22,11 @@ import formatMessage from '../../../../format-message';
|
|
|
22
22
|
import { SimpleSelect } from '@instructure/ui-simple-select';
|
|
23
23
|
import { View } from '@instructure/ui-view';
|
|
24
24
|
import { TextInput } from '@instructure/ui-text-input';
|
|
25
|
-
const ShowCreativeCommonsOptions =
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
} = _ref;
|
|
25
|
+
const ShowCreativeCommonsOptions = ({
|
|
26
|
+
ccLicense,
|
|
27
|
+
setCCLicense,
|
|
28
|
+
licenseOptions
|
|
29
|
+
}) => {
|
|
31
30
|
const onlyCC = licenseOptions.filter(license => license.id.indexOf('cc') === 0);
|
|
32
31
|
return /*#__PURE__*/React.createElement(View, {
|
|
33
32
|
as: "div",
|
|
@@ -36,12 +35,9 @@ const ShowCreativeCommonsOptions = _ref => {
|
|
|
36
35
|
renderLabel: formatMessage('Creative Commons License:'),
|
|
37
36
|
assistiveText: formatMessage('Use arrow keys to navigate options.'),
|
|
38
37
|
value: ccLicense,
|
|
39
|
-
onChange: (e,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
} = _ref2;
|
|
43
|
-
return setCCLicense(id);
|
|
44
|
-
}
|
|
38
|
+
onChange: (e, {
|
|
39
|
+
id
|
|
40
|
+
}) => setCCLicense(id)
|
|
45
41
|
}, onlyCC.map(license => /*#__PURE__*/React.createElement(SimpleSelect.Option, {
|
|
46
42
|
key: license.id,
|
|
47
43
|
id: license.id,
|
|
@@ -59,14 +55,13 @@ const ShowMessage = () => {
|
|
|
59
55
|
}
|
|
60
56
|
}, formatMessage("If you do not select usage rights now, this file will be unpublished after it's uploaded."))));
|
|
61
57
|
};
|
|
62
|
-
const UsageRightsSelectBox =
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
} = _ref3;
|
|
58
|
+
const UsageRightsSelectBox = ({
|
|
59
|
+
contextType,
|
|
60
|
+
contextId,
|
|
61
|
+
showMessage: showMessageProp,
|
|
62
|
+
usageRightsState,
|
|
63
|
+
setUsageRightsState
|
|
64
|
+
}) => {
|
|
70
65
|
const {
|
|
71
66
|
usageRight,
|
|
72
67
|
ccLicense,
|
|
@@ -119,10 +114,9 @@ const UsageRightsSelectBox = _ref3 => {
|
|
|
119
114
|
}, /*#__PURE__*/React.createElement(SimpleSelect, {
|
|
120
115
|
renderLabel: formatMessage('Usage Right:'),
|
|
121
116
|
assistiveText: formatMessage('Use arrow keys to navigate options.'),
|
|
122
|
-
onChange: (e,
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
} = _ref4;
|
|
117
|
+
onChange: (e, {
|
|
118
|
+
id
|
|
119
|
+
}) => {
|
|
126
120
|
handleChange(id);
|
|
127
121
|
},
|
|
128
122
|
value: usageRight
|
|
@@ -29,13 +29,12 @@ export default function doFileUpload(ed, document, opts) {
|
|
|
29
29
|
} = {
|
|
30
30
|
...opts
|
|
31
31
|
};
|
|
32
|
-
const title = accept
|
|
32
|
+
const title = accept?.startsWith('image/') ? formatMessage('Upload Image') : formatMessage('Upload File');
|
|
33
33
|
let shownResolve;
|
|
34
34
|
const shownPromise = new Promise(resolve => shownResolve = resolve);
|
|
35
|
-
const closedPromise = import('./UploadFile').then(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
} = _ref;
|
|
35
|
+
const closedPromise = import('./UploadFile').then(({
|
|
36
|
+
UploadFile
|
|
37
|
+
}) => {
|
|
39
38
|
const container = document.querySelector('.canvas-rce-upload-container') || (() => {
|
|
40
39
|
const elem = document.createElement('div');
|
|
41
40
|
elem.className = 'canvas-rce-upload-container';
|
|
@@ -48,9 +47,9 @@ export default function doFileUpload(ed, document, opts) {
|
|
|
48
47
|
ed.focus(false);
|
|
49
48
|
resolve('dismissed');
|
|
50
49
|
};
|
|
51
|
-
const wrappedSubmit =
|
|
50
|
+
const wrappedSubmit = (...args) => {
|
|
52
51
|
try {
|
|
53
|
-
return handleSubmit(...
|
|
52
|
+
return handleSubmit(...args);
|
|
54
53
|
} finally {
|
|
55
54
|
resolve('submitted');
|
|
56
55
|
}
|
|
@@ -22,14 +22,13 @@ import formatMessage from '../../../../format-message';
|
|
|
22
22
|
import { Button, CloseButton } from '@instructure/ui-buttons';
|
|
23
23
|
import { Heading } from '@instructure/ui-heading';
|
|
24
24
|
import { Modal } from '@instructure/ui-modal';
|
|
25
|
-
const AIResponseModal =
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
} = _ref;
|
|
25
|
+
const AIResponseModal = ({
|
|
26
|
+
open,
|
|
27
|
+
html,
|
|
28
|
+
onClose,
|
|
29
|
+
onInsert,
|
|
30
|
+
onReplace
|
|
31
|
+
}) => {
|
|
33
32
|
return /*#__PURE__*/React.createElement(Modal, {
|
|
34
33
|
open: open,
|
|
35
34
|
onDismiss: onClose,
|