@instructure/canvas-rce 7.2.0 → 7.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/es/enhance-user-content/doc_previews.js +1 -14
  3. package/es/index.d.ts +1 -0
  4. package/es/index.js +2 -1
  5. package/es/rce/AlertMessageArea.d.ts +2 -2
  6. package/es/rce/AlertMessageArea.js +4 -6
  7. package/es/rce/RCEGlobals.d.ts +2 -0
  8. package/es/rce/RCEGlobals.js +1 -0
  9. package/es/rce/RCEVariants.js +3 -3
  10. package/es/rce/RCEWrapper.d.ts +14 -12
  11. package/es/rce/RCEWrapper.js +206 -199
  12. package/es/rce/plugins/instructure_keyboard_shortcuts_header/clickCallback.d.ts +2 -0
  13. package/es/rce/plugins/instructure_keyboard_shortcuts_header/clickCallback.js +45 -0
  14. package/es/rce/plugins/instructure_keyboard_shortcuts_header/plugin.d.ts +1 -0
  15. package/es/rce/plugins/instructure_keyboard_shortcuts_header/plugin.js +43 -0
  16. package/es/rce/plugins/instructure_rce_external_tools/components/ExternalToolSelectionDialog/ExternalToolSelectionDialog.d.ts +1 -1
  17. package/es/rce/plugins/instructure_rce_external_tools/components/ExternalToolSelectionDialog/ExternalToolSelectionDialog.js +25 -25
  18. package/es/rce/plugins/instructure_record/AudioOptionsTray/TrayController.d.ts +1 -1
  19. package/es/rce/plugins/instructure_record/AudioOptionsTray/TrayController.js +2 -1
  20. package/es/rce/plugins/instructure_record/VideoOptionsTray/TrayController.d.ts +1 -1
  21. package/es/rce/plugins/instructure_record/VideoOptionsTray/TrayController.js +2 -1
  22. package/es/rce/plugins/instructure_record/mediaTranslations.js +1 -1
  23. package/es/rce/plugins/instructure_studio_media_options/plugin.js +109 -14
  24. package/es/rce/plugins/instructure_studio_media_options/studioToolbarIcons.d.ts +5 -0
  25. package/es/rce/plugins/instructure_studio_media_options/studioToolbarIcons.js +23 -0
  26. package/es/rce/plugins/instructure_wordcount_header/plugin.d.ts +1 -0
  27. package/es/rce/plugins/instructure_wordcount_header/plugin.js +75 -0
  28. package/es/rce/plugins/shared/ContentSelection.d.ts +1 -2
  29. package/es/rce/plugins/shared/ContentSelection.js +1 -18
  30. package/es/rce/plugins/shared/StudioLtiSupportUtils.d.ts +9 -1
  31. package/es/rce/plugins/shared/StudioLtiSupportUtils.js +94 -1
  32. package/es/rce/plugins/shared/Upload/ComputerPanel.js +1 -1
  33. package/es/rce/plugins/shared/Upload/UploadFileModal.js +37 -4
  34. package/es/rce/plugins/shared/Upload/VideoUrlPanel.d.ts +15 -0
  35. package/es/rce/plugins/shared/Upload/VideoUrlPanel.js +51 -0
  36. package/es/rce/plugins/shared/Upload/videoValidationUtils.d.ts +7 -0
  37. package/es/rce/plugins/shared/Upload/videoValidationUtils.js +58 -0
  38. package/es/rce/plugins/shared/iframeUtils.d.ts +1 -0
  39. package/es/rce/plugins/shared/iframeUtils.js +37 -0
  40. package/es/rce/tinyRCE.js +2 -0
  41. package/es/sidebar/actions/upload.d.ts +1 -0
  42. package/es/sidebar/actions/upload.js +56 -0
  43. package/es/sidebar/containers/sidebarHandlers.d.ts +1 -0
  44. package/es/sidebar/containers/sidebarHandlers.js +2 -1
  45. package/es/translations/locales/ar.js +15 -6
  46. package/es/translations/locales/ca.js +15 -6
  47. package/es/translations/locales/cy.js +15 -6
  48. package/es/translations/locales/da-x-k12.js +15 -6
  49. package/es/translations/locales/da.js +15 -6
  50. package/es/translations/locales/de.js +15 -6
  51. package/es/translations/locales/el.js +6 -0
  52. package/es/translations/locales/en-AU-x-unimelb.js +15 -6
  53. package/es/translations/locales/en-GB-x-ukhe.js +15 -6
  54. package/es/translations/locales/en.js +30 -6
  55. package/es/translations/locales/en_AU.js +15 -6
  56. package/es/translations/locales/en_CA.js +15 -6
  57. package/es/translations/locales/en_CY.js +15 -6
  58. package/es/translations/locales/en_GB.js +15 -6
  59. package/es/translations/locales/es.js +15 -6
  60. package/es/translations/locales/es_ES.js +15 -6
  61. package/es/translations/locales/fa_IR.js +6 -3
  62. package/es/translations/locales/fi.js +15 -6
  63. package/es/translations/locales/fr.js +15 -6
  64. package/es/translations/locales/fr_CA.js +19 -10
  65. package/es/translations/locales/ga.js +15 -6
  66. package/es/translations/locales/he.js +6 -0
  67. package/es/translations/locales/hi.js +15 -6
  68. package/es/translations/locales/ht.js +15 -6
  69. package/es/translations/locales/hu.js +6 -6
  70. package/es/translations/locales/hy.js +6 -0
  71. package/es/translations/locales/id.js +15 -6
  72. package/es/translations/locales/is.js +21 -6
  73. package/es/translations/locales/it.js +15 -6
  74. package/es/translations/locales/ja.js +15 -6
  75. package/es/translations/locales/ko.js +6 -0
  76. package/es/translations/locales/mi.js +15 -6
  77. package/es/translations/locales/ms.js +15 -6
  78. package/es/translations/locales/nb-x-k12.js +15 -6
  79. package/es/translations/locales/nb.js +15 -6
  80. package/es/translations/locales/nl.js +15 -6
  81. package/es/translations/locales/nn.js +6 -6
  82. package/es/translations/locales/pl.js +15 -6
  83. package/es/translations/locales/pt.js +15 -6
  84. package/es/translations/locales/pt_BR.js +15 -6
  85. package/es/translations/locales/ru.js +15 -6
  86. package/es/translations/locales/sl.js +15 -6
  87. package/es/translations/locales/sv-x-k12.js +15 -6
  88. package/es/translations/locales/sv.js +15 -6
  89. package/es/translations/locales/th.js +15 -6
  90. package/es/translations/locales/tr.js +6 -3
  91. package/es/translations/locales/uk_UA.js +6 -3
  92. package/es/translations/locales/vi.js +15 -6
  93. package/es/translations/locales/zh-Hans.js +15 -6
  94. package/es/translations/locales/zh-Hant.js +15 -6
  95. package/es/translations/locales/zh.js +15 -6
  96. package/es/translations/locales/zh_HK.js +15 -6
  97. package/package.json +53 -53
package/CHANGELOG.md CHANGED
@@ -5,6 +5,33 @@ 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.0 - 2025-10-16
9
+
10
+ ### Added
11
+ - Block Content Editor (BCE) support and improvements
12
+ - Media Embed by URL functionality
13
+ - A11y checker for block editor
14
+ - User choices to improved Studio toolbar options
15
+ - Feature flag for upcoming Studio embed improvements
16
+
17
+ ### Changed
18
+ - Upgrade to InstUI 10.26.2
19
+ - Unify image upload buttons
20
+ - Adjust the text block footer
21
+ - Remove documents from RCE's toolbar for BCE
22
+
23
+ ### Fixed
24
+ - Prevent setState from TinyMCE events after unmount
25
+ - Image upload modal for BCE
26
+ - Revert Alert conditional rendering
27
+ - Revert axios version upgrade
28
+
29
+ ### Removed
30
+ - Remove crocodoc from canvas
31
+
32
+ ### Localization
33
+ - Updated RCE translations for multiple locales
34
+
8
35
  ## 7.2.0 - 2025-08-21
9
36
 
10
37
  ### Added
@@ -106,20 +106,7 @@ export function loadDocPreview($container, options) {
106
106
  });
107
107
  }
108
108
  }
109
- if (opts.crocodoc_session_url) {
110
- const sanitizedUrl = sanitizeUrl(opts.crocodoc_session_url);
111
- const iframe = document.createElement('iframe');
112
- iframe.setAttribute('src', sanitizedUrl);
113
- iframe.setAttribute('width', opts.width);
114
- iframe.setAttribute('height', opts.height);
115
- iframe.setAttribute('allowfullscreen', '1');
116
- iframe.id = opts.id;
117
- $container.appendChild(iframe);
118
- iframe.load(() => {
119
- tellAppIViewedThisInline('crocodoc');
120
- if (typeof opts.ready === 'function') opts.ready();
121
- });
122
- } else if (opts.canvadoc_session_url) {
109
+ if (opts.canvadoc_session_url) {
123
110
  const canvadocWrapper = document.createElement('div');
124
111
  canvadocWrapper.setAttribute('style', 'overflow: auto; resize: vertical; border: 1px solid transparent; height: 100%;');
125
112
  $container.appendChild(canvadocWrapper);
package/es/index.d.ts CHANGED
@@ -57,3 +57,4 @@ export declare function getRCSAuthenticationHeaders(jwt: string): {
57
57
  Authorization: string;
58
58
  };
59
59
  export declare function getRCSOriginFromHost(host: string): any;
60
+ export { default as checkNode } from './rce/plugins/tinymce-a11y-checker/node-checker';
package/es/index.js CHANGED
@@ -50,4 +50,5 @@ export function getRCSAuthenticationHeaders(jwt) {
50
50
  }
51
51
  export function getRCSOriginFromHost(host) {
52
52
  return originFromHost(host);
53
- }
53
+ }
54
+ export { default as checkNode } from './rce/plugins/tinymce-a11y-checker/node-checker';
@@ -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,10 +28,8 @@ 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',
32
- timeout: 10000
33
- // @ts-expect-error
34
- ,
31
+ variant: message.variant || "info",
32
+ timeout: 10000,
35
33
  liveRegion: liveRegion,
36
34
  onDismiss: () => afterDismiss(message.id)
37
35
  }, message.text)));
@@ -1,11 +1,13 @@
1
1
  export default instance;
2
2
  export type Features = {
3
3
  file_verifiers_for_quiz_links: boolean;
4
+ rce_studio_embed_improvements: boolean;
4
5
  };
5
6
  declare const instance: RCEGlobals;
6
7
  /**
7
8
  * @typedef {Object} Features
8
9
  * @property {boolean} file_verifiers_for_quiz_links
10
+ * @property {boolean} rce_studio_embed_improvements
9
11
  */
10
12
  declare class RCEGlobals {
11
13
  _data: {
@@ -21,6 +21,7 @@ const isEmpty = obj => Object.keys(obj).length === 0;
21
21
  /**
22
22
  * @typedef {Object} Features
23
23
  * @property {boolean} file_verifiers_for_quiz_links
24
+ * @property {boolean} rce_studio_embed_improvements
24
25
  */
25
26
 
26
27
  class RCEGlobals {
@@ -110,13 +110,13 @@ export function getToolbarForVariant(variant, ltiToolFavorites = []) {
110
110
  items: ['bold', 'italic', 'underline', 'instructure_color', 'inst_subscript', 'inst_superscript']
111
111
  }, {
112
112
  name: formatMessage('Content'),
113
- items: ['instructure_links', 'instructure_documents']
113
+ items: ['instructure_links']
114
114
  }, {
115
115
  name: formatMessage('Alignment and Lists'),
116
116
  items: ['align', 'bullist', 'inst_indent', 'inst_outdent']
117
117
  }, {
118
118
  name: formatMessage('Miscellaneous'),
119
- items: ['removeformat', 'instructure_equation']
119
+ items: ['removeformat', 'instructure_equation', 'instructure_keyboard_shortcuts_header', 'instructure_wordcount_header']
120
120
  }];
121
121
  }
122
122
  return [{
@@ -152,7 +152,7 @@ export function getStatusBarFeaturesForVariant(variant, options = {
152
152
  return [];
153
153
  }
154
154
  if (variant === 'block-content-editor') {
155
- return ['keyboard_shortcuts', 'word_count'];
155
+ return [];
156
156
  }
157
157
  const platformFeatures = options.isDesktop ? DESKTOP_FEATURES : MOBILE_FEATURES;
158
158
  if (variant === 'lite' || variant === 'text-only') {
@@ -1,13 +1,13 @@
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
- export declare function storageAvailable(): boolean | undefined;
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
+ export declare function storageAvailable(): boolean | null;
11
11
  interface RCEWrapperProps {
12
12
  ai_text_tools?: boolean;
13
13
  autosave?: {
@@ -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;
@@ -214,6 +214,7 @@ declare class RCEWrapper extends React.Component<RCEWrapperProps, RCEWrapperStat
214
214
  new_math_equation_handling: unknown;
215
215
  explicit_latex_typesetting: unknown;
216
216
  rce_transform_loaded_content: unknown;
217
+ rce_studio_embed_improvements: unknown;
217
218
  file_verifiers_for_quiz_links: unknown;
218
219
  rce_find_replace: unknown;
219
220
  consolidated_media_player: unknown;
@@ -315,6 +316,7 @@ declare class RCEWrapper extends React.Component<RCEWrapperProps, RCEWrapperStat
315
316
  */
316
317
  _setupSelectionSaving: (editor: any) => void;
317
318
  announcing: number;
319
+ _isMounted: boolean;
318
320
  announceContextToolbars(editor: TinyMCEEditor): void;
319
321
  initAutoSave: (editor: TinyMCEEditor) => void;
320
322
  cleanupAutoSave: (deleteAll?: boolean) => void;
@@ -423,4 +425,4 @@ declare class RCEWrapper extends React.Component<RCEWrapperProps, RCEWrapperStat
423
425
  render(): React.JSX.Element;
424
426
  }
425
427
  export default RCEWrapper;
426
- export { mergeMenuItems, mergeMenu, mergeToolbar, mergePlugins, parsePluginsToExclude };
428
+ export { mergeMenuItems, mergeMenu, mergeToolbar, mergePlugins, parsePluginsToExclude, };