@instructure/canvas-rce 7.3.0 → 7.3.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 (59) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/es/enhance-user-content/doc_previews.js +5 -0
  3. package/es/enhance-user-content/enhance_user_content.js +1 -1
  4. package/es/enhance-user-content/instructure_helper.js +1 -0
  5. package/es/rce/AlertMessageArea.d.ts +2 -2
  6. package/es/rce/AlertMessageArea.js +3 -3
  7. package/es/rce/KeyboardShortcutModal.js +1 -1
  8. package/es/rce/RCEWrapper.d.ts +11 -11
  9. package/es/rce/RCEWrapper.js +216 -191
  10. package/es/rce/plugins/instructure_rce_external_tools/components/ExternalToolSelectionDialog/ExternalToolSelectionDialog.d.ts +1 -1
  11. package/es/rce/plugins/instructure_rce_external_tools/components/ExternalToolSelectionDialog/ExternalToolSelectionDialog.js +25 -25
  12. package/es/rce/plugins/instructure_studio_media_options/plugin.js +4 -2
  13. package/es/rce/plugins/instructure_wordcount/components/WordCountModal.js +1 -0
  14. package/es/rce/plugins/shared/StudioLtiSupportUtils.d.ts +2 -1
  15. package/es/rce/plugins/shared/StudioLtiSupportUtils.js +17 -1
  16. package/es/translations/locales/ar.js +15 -0
  17. package/es/translations/locales/ca.js +15 -0
  18. package/es/translations/locales/cy.js +15 -0
  19. package/es/translations/locales/da-x-k12.js +15 -0
  20. package/es/translations/locales/da.js +15 -0
  21. package/es/translations/locales/de.js +15 -0
  22. package/es/translations/locales/en-AU-x-unimelb.js +15 -0
  23. package/es/translations/locales/en-GB-x-ukhe.js +15 -0
  24. package/es/translations/locales/en.js +6 -0
  25. package/es/translations/locales/en_AU.js +15 -0
  26. package/es/translations/locales/en_CA.js +15 -0
  27. package/es/translations/locales/en_CY.js +15 -0
  28. package/es/translations/locales/en_GB.js +15 -0
  29. package/es/translations/locales/es.js +15 -0
  30. package/es/translations/locales/es_ES.js +15 -0
  31. package/es/translations/locales/fi.js +15 -0
  32. package/es/translations/locales/fr.js +15 -0
  33. package/es/translations/locales/fr_CA.js +15 -0
  34. package/es/translations/locales/ga.js +15 -0
  35. package/es/translations/locales/hi.js +15 -0
  36. package/es/translations/locales/ht.js +15 -0
  37. package/es/translations/locales/id.js +15 -0
  38. package/es/translations/locales/is.js +15 -0
  39. package/es/translations/locales/it.js +15 -0
  40. package/es/translations/locales/ja.js +15 -0
  41. package/es/translations/locales/mi.js +15 -0
  42. package/es/translations/locales/ms.js +15 -0
  43. package/es/translations/locales/nb-x-k12.js +15 -0
  44. package/es/translations/locales/nb.js +15 -0
  45. package/es/translations/locales/nl.js +15 -0
  46. package/es/translations/locales/pl.js +15 -0
  47. package/es/translations/locales/pt.js +15 -0
  48. package/es/translations/locales/pt_BR.js +15 -0
  49. package/es/translations/locales/ru.js +15 -0
  50. package/es/translations/locales/sl.js +15 -0
  51. package/es/translations/locales/sv-x-k12.js +15 -0
  52. package/es/translations/locales/sv.js +15 -0
  53. package/es/translations/locales/th.js +15 -0
  54. package/es/translations/locales/vi.js +15 -0
  55. package/es/translations/locales/zh-Hans.js +15 -0
  56. package/es/translations/locales/zh-Hant.js +15 -0
  57. package/es/translations/locales/zh.js +15 -0
  58. package/es/translations/locales/zh_HK.js +15 -0
  59. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -5,6 +5,20 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## 7.3.1 - 2025-11-11
9
+
10
+ ### Fixed
11
+ - WordCountModal not closing with keyboard navigation
12
+ - Accessibility issue for RCE's file preview
13
+ - Assessment questions preview path
14
+ - Formatting in Biome configuration for RCE package
15
+
16
+ ### Changed
17
+ - Updated TinyMCE shortcut link text
18
+
19
+ ### Localization
20
+ - Updated RCE translations
21
+
8
22
  ## 7.3.0 - 2025-10-16
9
23
 
10
24
  ### Added
@@ -106,6 +106,9 @@ export function loadDocPreview($container, options) {
106
106
  });
107
107
  }
108
108
  }
109
+ const iframeAriaLabel = opts.attachment_name ? formatMessage('File preview for {fileName}', {
110
+ fileName: opts.attachment_name
111
+ }) : formatMessage('File preview');
109
112
  if (opts.canvadoc_session_url) {
110
113
  const canvadocWrapper = document.createElement('div');
111
114
  canvadocWrapper.setAttribute('style', 'overflow: auto; resize: vertical; border: 1px solid transparent; height: 100%;');
@@ -117,6 +120,7 @@ export function loadDocPreview($container, options) {
117
120
  tellAppIViewedThisInline('canvadocs');
118
121
  if (typeof opts.ready === 'function') opts.ready();
119
122
  });
123
+ iframe.setAttribute('aria-label', iframeAriaLabel);
120
124
  iframe.setAttribute('src', sanitizedUrl);
121
125
  iframe.setAttribute('width', opts.width);
122
126
  iframe.setAttribute('allowfullscreen', '1');
@@ -142,6 +146,7 @@ export function loadDocPreview($container, options) {
142
146
  iframe.setAttribute('src', googleDocPreviewUrl);
143
147
  iframe.setAttribute('height', opts.height);
144
148
  iframe.setAttribute('width', '100%');
149
+ iframe.setAttribute('aria-label', iframeAriaLabel);
145
150
  $container.appendChild(iframe);
146
151
  }
147
152
  };
@@ -269,7 +269,7 @@ export function enhanceUserContent(container = document, opts = {}) {
269
269
 
270
270
  // Don't attempt to enhance links with no href
271
271
  if (!href) return;
272
- const matchesCanvasFile = href.pathname.match(/(?:\/(courses|groups|users)\/\d+)?\/files\/([\d~]+)(?=[!*'();:@&=+$,/?#\[\]]|$)/);
272
+ const matchesCanvasFile = href.pathname.match(/(?:\/(courses|groups|users|assessment_questions)\/\d+)?\/files\/([\d~]+)(?=[!*'();:@&=+$,/?#\[\]]|$)/);
273
273
  if (!matchesCanvasFile) {
274
274
  // a bug in the new RCE added instructure_file_link class name to all links
275
275
  // only proceed if this is a canvas file link
@@ -157,6 +157,7 @@ export function showFilePreviewInline(event, canvasOrigin, disableGooglePreviews
157
157
  mimeType: attachment.content_type,
158
158
  public_url: attachment.public_url,
159
159
  attachment_preview_processing: attachment.workflow_state === 'pending_upload' || attachment.workflow_state === 'processing',
160
+ attachment_name: attachment.display_name,
160
161
  disableGooglePreviews
161
162
  });
162
163
  const $minimizeLink = document.createElement('a');
@@ -1,5 +1,5 @@
1
- import React from "react";
2
- import type { AlertVariant } from "./types";
1
+ import React from 'react';
2
+ import type { AlertVariant } from './types';
3
3
  interface AlertMessageAreaProps {
4
4
  messages: {
5
5
  id: number;
@@ -16,8 +16,8 @@ import _pt from "prop-types";
16
16
  * You should have received a copy of the GNU Affero General Public License along
17
17
  * with this program. If not, see <http://www.gnu.org/licenses/>.
18
18
  */
19
- import { Alert } from "@instructure/ui-alerts";
20
- import React from "react";
19
+ import { Alert } from '@instructure/ui-alerts';
20
+ import React from 'react';
21
21
  /**
22
22
  * Shows messages that have been provided to it in the RCE
23
23
  */
@@ -28,7 +28,7 @@ export default function AlertMessageArea({
28
28
  }) {
29
29
  return /*#__PURE__*/React.createElement("div", null, messages.map(message => /*#__PURE__*/React.createElement(Alert, {
30
30
  key: message.id,
31
- variant: message.variant || "info",
31
+ variant: message.variant || 'info',
32
32
  timeout: 10000,
33
33
  liveRegion: liveRegion,
34
34
  onDismiss: () => afterDismiss(message.id)
@@ -79,7 +79,7 @@ export default function KeyboardShortcutModal(props) {
79
79
  }, formatMessage('Other editor shortcuts may be found at'), ' ', /*#__PURE__*/React.createElement("a", {
80
80
  href: "https://www.tiny.cloud/docs/advanced/keyboard-shortcuts/",
81
81
  target: "rcekbshortcut"
82
- }, "https://www.tiny.cloud/docs/advanced/keyboard-shortcuts/")))));
82
+ }, "TinyMCE Keyboard Shortcuts")))));
83
83
  }
84
84
  KeyboardShortcutModal.propTypes = {
85
85
  open: bool.isRequired,
@@ -1,12 +1,12 @@
1
- import React, { ReactNode } from "react";
2
- import { Editor } from "@tinymce/tinymce-react";
3
- import tinymce from "tinymce";
4
- import type { Editor as TinyMCEEditor } from "tinymce";
5
- import { PlaceHoldableThingInfo } from "../util/loadingPlaceholder";
6
- import EncryptedStorage from "../util/encrypted-storage";
7
- import { RCEVariant } from "./RCEVariants";
8
- import { mergeMenu, mergeMenuItems, mergePlugins, mergeToolbar, parsePluginsToExclude } from "./RCEWrapper.utils";
9
- import { AlertMessage, EditorOptions, RCETrayProps } from "./types";
1
+ import React, { ReactNode } from 'react';
2
+ import { Editor } from '@tinymce/tinymce-react';
3
+ import tinymce from 'tinymce';
4
+ import type { Editor as TinyMCEEditor } from 'tinymce';
5
+ import { PlaceHoldableThingInfo } from '../util/loadingPlaceholder';
6
+ import EncryptedStorage from '../util/encrypted-storage';
7
+ import { RCEVariant } from './RCEVariants';
8
+ import { mergeMenu, mergeMenuItems, mergePlugins, mergeToolbar, parsePluginsToExclude } from './RCEWrapper.utils';
9
+ import { AlertMessage, EditorOptions, RCETrayProps } from './types';
10
10
  export declare function storageAvailable(): boolean | null;
11
11
  interface RCEWrapperProps {
12
12
  ai_text_tools?: boolean;
@@ -74,7 +74,7 @@ declare class RCEWrapper extends React.Component<RCEWrapperProps, RCEWrapperStat
74
74
  _showOnFocusButton?: HTMLElement;
75
75
  _statusBarId: string;
76
76
  _textareaEl?: HTMLTextAreaElement;
77
- _effectiveContainingContext: RCETrayProps["containingContext"];
77
+ _effectiveContainingContext: RCETrayProps['containingContext'];
78
78
  AIToolsTray?: ReactNode;
79
79
  editor: TinyMCEEditor | null;
80
80
  initialContent?: string;
@@ -425,4 +425,4 @@ declare class RCEWrapper extends React.Component<RCEWrapperProps, RCEWrapperStat
425
425
  render(): React.JSX.Element;
426
426
  }
427
427
  export default RCEWrapper;
428
- export { mergeMenuItems, mergeMenu, mergeToolbar, mergePlugins, parsePluginsToExclude, };
428
+ export { mergeMenuItems, mergeMenu, mergeToolbar, mergePlugins, parsePluginsToExclude };