@instructure/canvas-rce 7.3.0 → 8.0.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 (162) hide show
  1. package/CHANGELOG.md +79 -0
  2. package/{es/rce/plugins/shared/ai_tools/index.js → __mocks__/@instructure/ui-media-player/_mockUiMediaPlayer.js} +4 -4
  3. package/__tests__/common/mimeClass.test.js +25 -1
  4. package/__tests__/rcs/api.test.js +280 -251
  5. package/es/canvasFileBrowser/FileBrowser.d.ts +2 -2
  6. package/es/canvasFileBrowser/FileBrowser.js +8 -7
  7. package/es/common/mimeClass.js +3 -1
  8. package/es/defaultTinymceConfig.js +47 -49
  9. package/es/enhance-user-content/doc_previews.js +5 -0
  10. package/es/enhance-user-content/enhance_user_content.js +6 -8
  11. package/es/enhance-user-content/index.d.ts +3 -1
  12. package/es/enhance-user-content/index.js +3 -1
  13. package/es/enhance-user-content/instructure_helper.js +1 -0
  14. package/es/enhance-user-content/youtube_overlay.js +18 -0
  15. package/es/getThemeVars.d.ts +1 -1
  16. package/es/getThemeVars.js +23 -26
  17. package/es/rce/AlertMessageArea.d.ts +2 -2
  18. package/es/rce/AlertMessageArea.js +3 -3
  19. package/es/rce/KeyboardShortcutModal.js +2 -2
  20. package/es/rce/RCE.d.ts +9 -0
  21. package/es/rce/RCE.js +4 -0
  22. package/es/rce/RCEGlobals.d.ts +2 -0
  23. package/es/rce/RCEGlobals.js +1 -0
  24. package/es/rce/RCEVariants.d.ts +1 -2
  25. package/es/rce/RCEVariants.js +1 -2
  26. package/es/rce/RCEWrapper.d.ts +16 -26
  27. package/es/rce/RCEWrapper.js +227 -271
  28. package/es/rce/RCEWrapper.utils.d.ts +1 -1
  29. package/es/rce/RCEWrapperProps.d.ts +2 -1
  30. package/es/rce/RCEWrapperProps.js +2 -1
  31. package/es/rce/StatusBar.d.ts +0 -1
  32. package/es/rce/StatusBar.js +3 -28
  33. package/es/rce/plugins/instructure_equation/EquationEditorModal/advancedOnlySyntax.d.ts +2 -1
  34. package/es/rce/plugins/instructure_equation/EquationEditorModal/advancedOnlySyntax.js +3 -1
  35. package/es/rce/plugins/instructure_equation/EquationEditorModal/index.d.ts +1 -0
  36. package/es/rce/plugins/instructure_equation/EquationEditorModal/index.js +12 -2
  37. package/es/rce/plugins/instructure_icon_maker/components/CreateIconMakerForm/ImageSection/ImageOptions.js +2 -2
  38. package/es/rce/plugins/instructure_icon_maker/components/CreateIconMakerForm/ImageSection/ImageSection.js +3 -3
  39. package/es/rce/plugins/instructure_icon_maker/svg/constants.d.ts +20 -5
  40. package/es/rce/plugins/instructure_icon_maker/svg/utils.d.ts +1 -1
  41. package/es/rce/plugins/instructure_icon_maker/utils/IconMakerFormHasChanges.js +2 -2
  42. package/es/rce/plugins/instructure_image/ImageEmbedOptions.d.ts +0 -2
  43. package/es/rce/plugins/instructure_image/ImageEmbedOptions.js +2 -9
  44. package/es/rce/plugins/instructure_paste/plugin.js +18 -12
  45. package/es/rce/plugins/instructure_rce_external_tools/components/ExternalToolDialog/ExternalToolDialogModal.d.ts +1 -1
  46. package/es/rce/plugins/instructure_rce_external_tools/components/ExternalToolSelectionDialog/ExternalToolSelectionDialog.d.ts +1 -1
  47. package/es/rce/plugins/instructure_rce_external_tools/components/ExternalToolSelectionDialog/ExternalToolSelectionDialog.js +25 -25
  48. package/es/rce/plugins/instructure_rce_external_tools/components/util/ToolLaunchIframe.d.ts +4 -0
  49. package/es/rce/plugins/instructure_rce_external_tools/components/util/ToolLaunchIframe.js +4 -0
  50. package/es/rce/plugins/instructure_record/AudioOptionsTray/TrayController.d.ts +11 -2
  51. package/es/rce/plugins/instructure_record/AudioOptionsTray/TrayController.js +92 -10
  52. package/es/rce/plugins/instructure_record/AudioOptionsTray/index.d.ts +13 -1
  53. package/es/rce/plugins/instructure_record/AudioOptionsTray/index.js +216 -24
  54. package/es/rce/plugins/instructure_record/MediaPanel/index.js +16 -5
  55. package/es/rce/plugins/instructure_record/VideoOptionsTray/TrayController.d.ts +14 -13
  56. package/es/rce/plugins/instructure_record/VideoOptionsTray/TrayController.js +110 -39
  57. package/es/rce/plugins/instructure_record/VideoOptionsTray/index.d.ts +11 -1
  58. package/es/rce/plugins/instructure_record/VideoOptionsTray/index.js +242 -67
  59. package/es/rce/plugins/instructure_record/clickCallback.js +19 -4
  60. package/es/rce/plugins/instructure_record/mediaTranslations.js +1 -1
  61. package/es/rce/plugins/instructure_record/playerLayoutOptions.d.ts +25 -0
  62. package/es/rce/plugins/instructure_record/playerLayoutOptions.js +91 -0
  63. package/es/rce/plugins/instructure_record/plugin.js +2 -5
  64. package/es/rce/plugins/instructure_record/utils.d.ts +3 -0
  65. package/es/rce/plugins/instructure_record/utils.js +31 -0
  66. package/es/rce/plugins/instructure_studio_media_options/plugin.js +82 -24
  67. package/es/rce/plugins/instructure_wordcount/components/WordCountModal.js +1 -0
  68. package/es/rce/plugins/shared/ContentSelection.d.ts +6 -1
  69. package/es/rce/plugins/shared/ContentSelection.js +15 -6
  70. package/es/rce/plugins/shared/DimensionsInput/DimensionInput.js +1 -2
  71. package/es/rce/plugins/shared/DimensionsInput/index.js +11 -12
  72. package/es/rce/plugins/shared/DimensionsInput/useDimensionsState.d.ts +1 -1
  73. package/es/rce/plugins/shared/DimensionsInput/useDimensionsState.js +4 -3
  74. package/es/rce/plugins/shared/StudioLtiSupportUtils.d.ts +27 -5
  75. package/es/rce/plugins/shared/StudioLtiSupportUtils.js +94 -9
  76. package/es/rce/plugins/shared/Upload/UploadFile.js +1 -8
  77. package/es/rce/style.d.ts +2 -1
  78. package/es/rce/style.js +4 -2
  79. package/es/rcs/api.d.ts +5 -10
  80. package/es/rcs/api.js +15 -21
  81. package/es/rcs/fake.d.ts +1 -7
  82. package/es/rcs/fake.js +1 -47
  83. package/es/sidebar/actions/media.d.ts +19 -6
  84. package/es/sidebar/actions/media.js +17 -4
  85. package/es/sidebar/actions/upload.d.ts +3 -3
  86. package/es/sidebar/actions/upload.js +9 -9
  87. package/es/sidebar/containers/Sidebar.js +0 -2
  88. package/es/sidebar/containers/sidebarHandlers.d.ts +2 -4
  89. package/es/sidebar/containers/sidebarHandlers.js +2 -5
  90. package/es/sidebar/reducers/index.d.ts +0 -1
  91. package/es/sidebar/reducers/index.js +0 -2
  92. package/es/sidebar/store/initialState.d.ts +0 -1
  93. package/es/sidebar/store/initialState.js +0 -5
  94. package/es/translations/locales/ar.js +77 -77
  95. package/es/translations/locales/ca.js +77 -77
  96. package/es/translations/locales/cy.js +77 -77
  97. package/es/translations/locales/da-x-k12.js +77 -77
  98. package/es/translations/locales/da.js +77 -77
  99. package/es/translations/locales/de.js +77 -77
  100. package/es/translations/locales/el.js +0 -9
  101. package/es/translations/locales/en-AU-x-unimelb.js +77 -77
  102. package/es/translations/locales/en-GB-x-ukhe.js +77 -77
  103. package/es/translations/locales/en.js +67 -79
  104. package/es/translations/locales/en_AU.js +77 -77
  105. package/es/translations/locales/en_CA.js +77 -77
  106. package/es/translations/locales/en_CY.js +77 -77
  107. package/es/translations/locales/en_GB.js +77 -77
  108. package/es/translations/locales/es.js +77 -77
  109. package/es/translations/locales/es_ES.js +77 -77
  110. package/es/translations/locales/fa_IR.js +0 -9
  111. package/es/translations/locales/fi.js +77 -77
  112. package/es/translations/locales/fr.js +77 -77
  113. package/es/translations/locales/fr_CA.js +77 -77
  114. package/es/translations/locales/ga.js +77 -77
  115. package/es/translations/locales/he.js +0 -9
  116. package/es/translations/locales/hi.js +77 -77
  117. package/es/translations/locales/ht.js +77 -77
  118. package/es/translations/locales/hu.js +0 -36
  119. package/es/translations/locales/hy.js +0 -9
  120. package/es/translations/locales/id.js +77 -77
  121. package/es/translations/locales/is.js +77 -77
  122. package/es/translations/locales/it.js +77 -77
  123. package/es/translations/locales/ja.js +77 -77
  124. package/es/translations/locales/ko.js +2455 -133
  125. package/es/translations/locales/mi.js +77 -77
  126. package/es/translations/locales/ms.js +77 -77
  127. package/es/translations/locales/nb-x-k12.js +77 -77
  128. package/es/translations/locales/nb.js +77 -77
  129. package/es/translations/locales/nl.js +78 -78
  130. package/es/translations/locales/nn.js +0 -36
  131. package/es/translations/locales/pl.js +77 -77
  132. package/es/translations/locales/pt.js +77 -77
  133. package/es/translations/locales/pt_BR.js +77 -77
  134. package/es/translations/locales/ru.js +77 -77
  135. package/es/translations/locales/sl.js +77 -77
  136. package/es/translations/locales/sv-x-k12.js +77 -77
  137. package/es/translations/locales/sv.js +77 -77
  138. package/es/translations/locales/th.js +77 -77
  139. package/es/translations/locales/tr.js +1962 -18
  140. package/es/translations/locales/uk_UA.js +0 -9
  141. package/es/translations/locales/vi.js +77 -77
  142. package/es/translations/locales/zh-Hans.js +77 -77
  143. package/es/translations/locales/zh-Hant.js +77 -77
  144. package/es/translations/locales/zh.js +77 -77
  145. package/es/translations/locales/zh_HK.js +77 -77
  146. package/eslint.config.js +16 -147
  147. package/jest/jest-setup.js +1 -0
  148. package/jest.config.js +2 -0
  149. package/oxlint.json +84 -0
  150. package/package.json +86 -62
  151. package/tsconfig.json +3 -2
  152. package/es/rce/plugins/shared/ai_tools/AIResponseModal.d.ts +0 -10
  153. package/es/rce/plugins/shared/ai_tools/AIResponseModal.js +0 -67
  154. package/es/rce/plugins/shared/ai_tools/AIToolsTray.d.ts +0 -18
  155. package/es/rce/plugins/shared/ai_tools/AIToolsTray.js +0 -489
  156. package/es/rce/plugins/shared/ai_tools/aiicons.d.ts +0 -7
  157. package/es/rce/plugins/shared/ai_tools/aiicons.js +0 -60
  158. package/es/rce/plugins/shared/ai_tools/index.d.ts +0 -3
  159. package/es/sidebar/actions/flickr.d.ts +0 -20
  160. package/es/sidebar/actions/flickr.js +0 -60
  161. package/es/sidebar/reducers/flickr.d.ts +0 -1
  162. package/es/sidebar/reducers/flickr.js +0 -49
@@ -42,7 +42,8 @@ declare class FileBrowser extends React.Component<any, any, any> {
42
42
  decreaseLoadingCount(): void;
43
43
  getRootFolderData(context: any, contextId: any, opts?: {}): void;
44
44
  populateRootFolder(data: any, opts?: {}): void;
45
- fetchSubFolders: ((id: any) => void) & _.MemoizedFunction;
45
+ /** @type {(id: number) => void} */
46
+ fetchSubFolders: (id: number) => void;
46
47
  fetchFiles(id: any): void;
47
48
  getFolderData(id: any): void;
48
49
  populateCollectionsList: (folderList: any, opts?: {}) => void;
@@ -76,5 +77,4 @@ declare class FileBrowser extends React.Component<any, any, any> {
76
77
  render(): React.JSX.Element;
77
78
  }
78
79
  import React from 'react';
79
- import _ from 'lodash';
80
80
  import PropTypes from 'prop-types';
@@ -16,8 +16,8 @@
16
16
 
17
17
  import React from 'react';
18
18
  import formatMessage from '../format-message';
19
- import _ from 'lodash';
20
- import minimatch from 'minimatch';
19
+ import { cloneDeep, memoize } from 'es-toolkit/compat';
20
+ import { minimatch } from 'minimatch';
21
21
  import { TreeBrowser } from '@instructure/ui-tree-browser';
22
22
  import { Text } from '@instructure/ui-text';
23
23
  import { Spinner } from '@instructure/ui-spinner';
@@ -32,7 +32,8 @@ class FileBrowser extends React.Component {
32
32
  super(_props2);
33
33
  // Memoized function to fetch all subfolders
34
34
  // of the given folder ID, handing pagination
35
- this.fetchSubFolders = _.memoize(id => {
35
+ /** @type {(id: number) => void} */
36
+ this.fetchSubFolders = memoize(id => {
36
37
  this.source.fetchBookmarkedData(this.source.fetchSubFolders.bind(this.source), {
37
38
  folderId: id,
38
39
  perPage: 50
@@ -46,7 +47,7 @@ class FileBrowser extends React.Component {
46
47
  });
47
48
  this.populateCollectionsList = (folderList, opts = {}) => {
48
49
  this.setState((state, props) => {
49
- const newCollections = _.cloneDeep(state.collections);
50
+ const newCollections = cloneDeep(state.collections);
50
51
  folderList.forEach(folder => {
51
52
  const collection = this.formatFolderInfo(folder, {
52
53
  ...opts,
@@ -67,8 +68,8 @@ class FileBrowser extends React.Component {
67
68
  };
68
69
  this.populateItemsList = fileList => {
69
70
  this.setState((state, _props) => {
70
- const newItems = _.cloneDeep(state.items);
71
- const newCollections = _.cloneDeep(state.collections);
71
+ const newItems = cloneDeep(state.items);
72
+ const newCollections = cloneDeep(state.collections);
72
73
  fileList.forEach(file => {
73
74
  if (this.contentTypeIsAllowed(file.type)) {
74
75
  const item = this.formatFileInfo(file);
@@ -101,7 +102,7 @@ class FileBrowser extends React.Component {
101
102
  } else if (!collection.locked) {
102
103
  newFolders = newFolders.concat(openFolders);
103
104
  newFolders.push(folderId);
104
- newCollections = _.cloneDeep(state.collections);
105
+ newCollections = cloneDeep(state.collections);
105
106
  newCollections[folderId] = collection;
106
107
  }
107
108
  return {
@@ -41,8 +41,10 @@ export function mimeClass(file) {
41
41
  return file.mime_class;
42
42
  } else {
43
43
  const contentType = getContentType(file);
44
+ // Strip MIME parameters (charset, boundary, etc.) before lookup
44
45
  // NOTE: Keep this list in sync with what's in canvas-lms/app/models/attachment.rb
45
- return contentMapping(contentType) || file.mime_class || 'file';
46
+ const baseType = contentType?.split(';')[0]?.trim();
47
+ return contentMapping(baseType) || file.mime_class || 'file';
46
48
  }
47
49
  }
48
50
  export function contentMapping(contentType) {
@@ -172,9 +172,9 @@ const defaultTinymceConfig = {
172
172
  acronym: [],
173
173
  del: ['datetime', 'cite'],
174
174
  ins: ['datetime', 'cite'],
175
- object: ['classid', 'width', 'height', 'codebase', '*'],
175
+ object: ['classid', 'codebase', 'data', 'height', 'type', 'width'],
176
176
  param: ['name', 'value', '_value'],
177
- embed: ['type', 'width', 'height', 'src', '*'],
177
+ embed: ['allowfullscreen', 'allowscriptaccess', 'height', 'name', 'pluginspage', 'src', 'type', 'width', 'wmode'],
178
178
  map: ['name'],
179
179
  area: ['shape', 'coords', 'href', 'alt', 'target'],
180
180
  bdo: [],
@@ -222,56 +222,54 @@ const defaultTinymceConfig = {
222
222
  '-ul': ['compact'],
223
223
  video: ['name', 'src', 'allowfullscreen', 'muted', 'poster', 'width', 'height', 'controls', 'playsinline'],
224
224
  audio: ['name', 'src', 'muted', 'controls'],
225
- annotation: ['href', 'xref', 'definitionURL', 'encoding', 'cd', 'name', 'src'],
226
- 'annotation-xml': ['href', 'xref', 'definitionURL', 'encoding', 'cd', 'name', 'src'],
227
- maction: ['href', 'xref', 'mathcolor', 'mathbackground', 'actiontype', 'selection'],
228
- maligngroup: ['href', 'xref', 'mathcolor', 'mathbackground', 'groupalign'],
229
- malignmark: ['href', 'xref', 'mathcolor', 'mathbackground', 'edge'],
230
- math: ['xmlns', 'href', 'xref', 'display', 'maxwidth', 'overflow', 'altimg', 'altimg-width', 'altimg-height', 'altimg-valign', 'alttext', 'cdgroup', 'mathcolor', 'mathbackground', 'scriptlevel', 'displaystyle', 'scriptsizemultiplier', 'scriptminsize', 'infixlinebreakstyle', 'decimalpoint', 'mathvariant', 'mathsize', 'width', 'height', 'valign', 'form', 'fence', 'separator', 'lspace', 'rspace', 'stretchy', 'symmetric', 'maxsize', 'minsize', 'largeop', 'movablelimits', 'accent', 'linebreak', 'lineleading', 'linebreakstyle', 'linebreakmultchar', 'indentalign', 'indentshift', 'indenttarget', 'indentalignfirst', 'indentshiftfirst', 'indentalignlast', 'indentshiftlast', 'depth', 'lquote', 'rquote', 'linethickness', 'munalign', 'denomalign', 'bevelled', 'voffset', 'open', 'close', 'separators', 'notation', 'subscriptshift', 'superscriptshift', 'accentunder', 'align', 'rowalign', 'columnalign', 'groupalign', 'alignmentscope', 'columnwidth', 'rowspacing', 'columnspacing', 'rowlines', 'columnlines', 'frame', 'framespacing', 'equalrows', 'equalcolumns', 'side', 'minlabelspacing', 'rowspan', 'columnspan', 'edge', 'stackalign', 'charalign', 'charspacing', 'longdivstyle', 'position', 'shift', 'location', 'crossout', 'length', 'leftoverhang', 'rightoverhang', 'mslinethickness', 'selection'],
231
- menclose: ['href', 'xref', 'mathcolor', 'mathbackground', 'notation'],
232
- merror: ['href', 'xref', 'mathcolor', 'mathbackground'],
233
- mfenced: ['href', 'xref', 'mathcolor', 'mathbackground', 'open', 'close', 'separators'],
234
- mfrac: ['href', 'xref', 'mathcolor', 'mathbackground', 'linethickness', 'munalign', 'denomalign', 'bevelled'],
235
- mglyph: ['href', 'xref', 'mathcolor', 'mathbackground', 'src', 'alt', 'width', 'height', 'valign'],
236
- mi: ['href', 'xref', 'mathcolor', 'mathbackground', 'mathvariant', 'mathsize'],
237
- mlabeledtr: ['href', 'xref', 'mathcolor', 'mathbackground'],
238
- mlongdiv: ['href', 'xref', 'mathcolor', 'mathbackground', 'longdivstyle', 'align', 'stackalign', 'charalign', 'charspacing'],
239
- mmultiscripts: ['href', 'xref', 'mathcolor', 'mathbackground', 'subscriptshift', 'superscriptshift'],
240
- mn: ['href', 'xref', 'mathcolor', 'mathbackground', 'mathvariant', 'mathsize'],
241
- mo: ['href', 'xref', 'mathcolor', 'mathbackground', 'mathvariant', 'mathsize', 'form', 'fence', 'separator', 'lspace', 'rspace', 'stretchy', 'symmetric', 'maxsize', 'minsize', 'largeop', 'movablelimits', 'accent', 'linebreak', 'lineleading', 'linebreakstyle', 'linebreakmultchar', 'indentalign', 'indentshift', 'indenttarget', 'indentalignfirst', 'indentshiftfirst', 'indentalignlast', 'indentshiftlast'],
242
- mover: ['href', 'xref', 'mathcolor', 'mathbackground', 'accent', 'align'],
243
- mpadded: ['href', 'xref', 'mathcolor', 'mathbackground', 'height', 'depth', 'width', 'lspace', 'voffset'],
244
- mphantom: ['href', 'xref', 'mathcolor', 'mathbackground'],
245
- mprescripts: ['href', 'xref', 'mathcolor', 'mathbackground'],
246
- mroot: ['href', 'xref', 'mathcolor', 'mathbackground'],
247
- mrow: ['href', 'xref', 'mathcolor', 'mathbackground'],
248
- ms: ['href', 'xref', 'mathcolor', 'mathbackground', 'mathvariant', 'mathsize', 'lquote', 'rquote'],
249
- mscarries: ['href', 'xref', 'mathcolor', 'mathbackground', 'position', 'location', 'crossout', 'scriptsizemultiplier'],
250
- mscarry: ['href', 'xref', 'mathcolor', 'mathbackground', 'location', 'crossout'],
251
- msgroup: ['href', 'xref', 'mathcolor', 'mathbackground', 'position', 'shift'],
252
- msline: ['href', 'xref', 'mathcolor', 'mathbackground', 'position', 'length', 'leftoverhang', 'rightoverhang', 'mslinethickness'],
253
- mspace: ['href', 'xref', 'mathcolor', 'mathbackground', 'mathvariant', 'mathsize'],
254
- msqrt: ['href', 'xref', 'mathcolor', 'mathbackground'],
255
- msrow: ['href', 'xref', 'mathcolor', 'mathbackground', 'position'],
256
- mstack: ['href', 'xref', 'mathcolor', 'mathbackground', 'align', 'stackalign', 'charalign', 'charspacing'],
257
- mstyle: ['href', 'xref', 'mathcolor', 'mathbackground', 'scriptlevel', 'displaystyle', 'scriptsizemultiplier', 'scriptminsize', 'infixlinebreakstyle', 'decimalpoint', 'mathvariant', 'mathsize', 'width', 'height', 'valign', 'form', 'fence', 'separator', 'lspace', 'rspace', 'stretchy', 'symmetric', 'maxsize', 'minsize', 'largeop', 'movablelimits', 'accent', 'linebreak', 'lineleading', 'linebreakstyle', 'linebreakmultchar', 'indentalign', 'indentshift', 'indenttarget', 'indentalignfirst', 'indentshiftfirst', 'indentalignlast', 'indentshiftlast', 'depth', 'lquote', 'rquote', 'linethickness', 'munalign', 'denomalign', 'bevelled', 'voffset', 'open', 'close', 'separators', 'notation', 'subscriptshift', 'superscriptshift', 'accentunder', 'align', 'rowalign', 'columnalign', 'groupalign', 'alignmentscope', 'columnwidth', 'rowspacing', 'columnspacing', 'rowlines', 'columnlines', 'frame', 'framespacing', 'equalrows', 'equalcolumns', 'side', 'minlabelspacing', 'rowspan', 'columnspan', 'edge', 'stackalign', 'charalign', 'charspacing', 'longdivstyle', 'position', 'shift', 'location', 'crossout', 'length', 'leftoverhang', 'rightoverhang', 'mslinethickness', 'selection'],
258
- msub: ['href', 'xref', 'mathcolor', 'mathbackground', 'subscriptshift'],
259
- msubsup: ['href', 'xref', 'mathcolor', 'mathbackground', 'subscriptshift', 'superscriptshift'],
260
- msup: ['href', 'xref', 'mathcolor', 'mathbackground', 'superscriptshift'],
261
- mtable: ['href', 'xref', 'mathcolor', 'mathbackground', 'align', 'rowalign', 'columnalign', 'groupalign', 'alignmentscope', 'columnwidth', 'width', 'rowspacing', 'columnspacing', 'rowlines', 'columnlines', 'frame', 'framespacing', 'equalrows', 'equalcolumns', 'displaystyle', 'side', 'minlabelspacing'],
262
- mtd: ['href', 'xref', 'mathcolor', 'mathbackground', 'rowspan', 'columnspan', 'rowalign', 'columnalign', 'groupalign'],
263
- mtext: ['href', 'xref', 'mathcolor', 'mathbackground', 'mathvariant', 'mathsize', 'width', 'height', 'depth', 'linebreak'],
264
- mtr: ['href', 'xref', 'mathcolor', 'mathbackground', 'rowalign', 'columnalign', 'groupalign'],
265
- munder: ['href', 'xref', 'mathcolor', 'mathbackground', 'accentunder', 'align'],
266
- munderover: ['href', 'xref', 'mathcolor', 'mathbackground', 'accent', 'accentunder', 'align'],
267
- none: ['href', 'xref', 'mathcolor', 'mathbackground'],
268
- semantics: ['href', 'xref', 'definitionURL', 'encoding'],
225
+ annotation: ['href', 'xref', 'intent', 'arg', 'definitionURL', 'encoding', 'cd', 'name', 'src'],
226
+ 'annotation-xml': ['href', 'xref', 'intent', 'arg', 'definitionURL', 'encoding', 'cd', 'name', 'src'],
227
+ maction: ['href', 'xref', 'mathcolor', 'mathbackground', 'intent', 'arg', 'actiontype', 'selection'],
228
+ maligngroup: ['href', 'xref', 'mathcolor', 'mathbackground', 'intent', 'arg', 'groupalign'],
229
+ malignmark: ['href', 'xref', 'mathcolor', 'mathbackground', 'intent', 'arg', 'edge'],
230
+ math: ['xmlns', 'href', 'xref', 'display', 'maxwidth', 'overflow', 'altimg', 'altimg-width', 'altimg-height', 'altimg-valign', 'alttext', 'cdgroup', 'intent', 'arg', 'mathcolor', 'mathbackground', 'scriptlevel', 'displaystyle', 'scriptsizemultiplier', 'scriptminsize', 'infixlinebreakstyle', 'decimalpoint', 'mathvariant', 'mathsize', 'width', 'height', 'valign', 'form', 'fence', 'separator', 'lspace', 'rspace', 'stretchy', 'symmetric', 'maxsize', 'minsize', 'largeop', 'movablelimits', 'accent', 'linebreak', 'lineleading', 'linebreakstyle', 'linebreakmultchar', 'indentalign', 'indentshift', 'indenttarget', 'indentalignfirst', 'indentshiftfirst', 'indentalignlast', 'indentshiftlast', 'depth', 'lquote', 'rquote', 'linethickness', 'numalign', 'denomalign', 'bevelled', 'voffset', 'open', 'close', 'separators', 'notation', 'subscriptshift', 'superscriptshift', 'accentunder', 'align', 'rowalign', 'columnalign', 'groupalign', 'alignmentscope', 'columnwidth', 'rowspacing', 'columnspacing', 'rowlines', 'columnlines', 'frame', 'framespacing', 'equalrows', 'equalcolumns', 'side', 'minlabelspacing', 'rowspan', 'columnspan', 'edge', 'stackalign', 'charalign', 'charspacing', 'longdivstyle', 'position', 'shift', 'location', 'crossout', 'length', 'leftoverhang', 'rightoverhang', 'mslinethickness', 'selection'],
231
+ menclose: ['href', 'xref', 'mathcolor', 'mathbackground', 'intent', 'arg', 'notation'],
232
+ merror: ['href', 'xref', 'mathcolor', 'mathbackground', 'intent', 'arg'],
233
+ mfenced: ['href', 'xref', 'mathcolor', 'mathbackground', 'intent', 'arg', 'open', 'close', 'separators'],
234
+ mfrac: ['href', 'xref', 'mathcolor', 'mathbackground', 'intent', 'arg', 'linethickness', 'numalign', 'denomalign', 'bevelled'],
235
+ mglyph: ['href', 'xref', 'mathcolor', 'mathbackground', 'intent', 'arg', 'src', 'alt', 'width', 'height', 'valign'],
236
+ mi: ['href', 'xref', 'mathcolor', 'mathbackground', 'intent', 'arg', 'mathvariant', 'mathsize'],
237
+ mlabeledtr: ['href', 'xref', 'mathcolor', 'mathbackground', 'intent', 'arg'],
238
+ mlongdiv: ['href', 'xref', 'mathcolor', 'mathbackground', 'intent', 'arg', 'longdivstyle', 'align', 'stackalign', 'charalign', 'charspacing'],
239
+ mmultiscripts: ['href', 'xref', 'mathcolor', 'mathbackground', 'intent', 'arg', 'subscriptshift', 'superscriptshift'],
240
+ mn: ['href', 'xref', 'mathcolor', 'mathbackground', 'intent', 'arg', 'mathvariant', 'mathsize'],
241
+ mo: ['href', 'xref', 'mathcolor', 'mathbackground', 'intent', 'arg', 'mathvariant', 'mathsize', 'form', 'fence', 'separator', 'lspace', 'rspace', 'stretchy', 'symmetric', 'maxsize', 'minsize', 'largeop', 'movablelimits', 'accent', 'linebreak', 'lineleading', 'linebreakstyle', 'linebreakmultchar', 'indentalign', 'indentshift', 'indenttarget', 'indentalignfirst', 'indentshiftfirst', 'indentalignlast', 'indentshiftlast'],
242
+ mover: ['href', 'xref', 'mathcolor', 'mathbackground', 'intent', 'arg', 'accent', 'align'],
243
+ mpadded: ['href', 'xref', 'mathcolor', 'mathbackground', 'intent', 'arg', 'height', 'depth', 'width', 'lspace', 'voffset'],
244
+ mphantom: ['href', 'xref', 'mathcolor', 'mathbackground', 'intent', 'arg'],
245
+ mprescripts: ['href', 'xref', 'mathcolor', 'mathbackground', 'intent', 'arg'],
246
+ mroot: ['href', 'xref', 'mathcolor', 'mathbackground', 'intent', 'arg'],
247
+ mrow: ['href', 'xref', 'mathcolor', 'mathbackground', 'intent', 'arg'],
248
+ ms: ['href', 'xref', 'mathcolor', 'mathbackground', 'intent', 'arg', 'mathvariant', 'mathsize', 'lquote', 'rquote'],
249
+ mscarries: ['href', 'xref', 'mathcolor', 'mathbackground', 'intent', 'arg', 'position', 'location', 'crossout', 'scriptsizemultiplier'],
250
+ mscarry: ['href', 'xref', 'mathcolor', 'mathbackground', 'intent', 'arg', 'location', 'crossout'],
251
+ msgroup: ['href', 'xref', 'mathcolor', 'mathbackground', 'intent', 'arg', 'position', 'shift'],
252
+ msline: ['href', 'xref', 'mathcolor', 'mathbackground', 'intent', 'arg', 'position', 'length', 'leftoverhang', 'rightoverhang', 'mslinethickness'],
253
+ mspace: ['href', 'xref', 'mathcolor', 'mathbackground', 'intent', 'arg', 'mathvariant', 'mathsize'],
254
+ msqrt: ['href', 'xref', 'mathcolor', 'mathbackground', 'intent', 'arg'],
255
+ msrow: ['href', 'xref', 'mathcolor', 'mathbackground', 'intent', 'arg', 'position'],
256
+ mstack: ['href', 'xref', 'mathcolor', 'mathbackground', 'intent', 'arg', 'align', 'stackalign', 'charalign', 'charspacing'],
257
+ mstyle: ['href', 'xref', 'mathcolor', 'mathbackground', 'intent', 'arg', 'scriptlevel', 'displaystyle', 'scriptsizemultiplier', 'scriptminsize', 'infixlinebreakstyle', 'decimalpoint', 'mathvariant', 'mathsize', 'width', 'height', 'valign', 'form', 'fence', 'separator', 'lspace', 'rspace', 'stretchy', 'symmetric', 'maxsize', 'minsize', 'largeop', 'movablelimits', 'accent', 'linebreak', 'lineleading', 'linebreakstyle', 'linebreakmultchar', 'indentalign', 'indentshift', 'indenttarget', 'indentalignfirst', 'indentshiftfirst', 'indentalignlast', 'indentshiftlast', 'depth', 'lquote', 'rquote', 'linethickness', 'numalign', 'denomalign', 'bevelled', 'voffset', 'open', 'close', 'separators', 'notation', 'subscriptshift', 'superscriptshift', 'accentunder', 'align', 'rowalign', 'columnalign', 'groupalign', 'alignmentscope', 'columnwidth', 'rowspacing', 'columnspacing', 'rowlines', 'columnlines', 'frame', 'framespacing', 'equalrows', 'equalcolumns', 'side', 'minlabelspacing', 'rowspan', 'columnspan', 'edge', 'stackalign', 'charalign', 'charspacing', 'longdivstyle', 'position', 'shift', 'location', 'crossout', 'length', 'leftoverhang', 'rightoverhang', 'mslinethickness', 'selection'],
258
+ msub: ['href', 'xref', 'mathcolor', 'mathbackground', 'intent', 'arg', 'subscriptshift'],
259
+ msubsup: ['href', 'xref', 'mathcolor', 'mathbackground', 'intent', 'arg', 'subscriptshift', 'superscriptshift'],
260
+ msup: ['href', 'xref', 'mathcolor', 'mathbackground', 'intent', 'arg', 'superscriptshift'],
261
+ mtable: ['href', 'xref', 'mathcolor', 'mathbackground', 'intent', 'arg', 'align', 'rowalign', 'columnalign', 'groupalign', 'alignmentscope', 'columnwidth', 'width', 'rowspacing', 'columnspacing', 'rowlines', 'columnlines', 'frame', 'framespacing', 'equalrows', 'equalcolumns', 'displaystyle', 'side', 'minlabelspacing'],
262
+ mtd: ['href', 'xref', 'mathcolor', 'mathbackground', 'intent', 'arg', 'rowspan', 'columnspan', 'rowalign', 'columnalign', 'groupalign'],
263
+ mtext: ['href', 'xref', 'mathcolor', 'mathbackground', 'intent', 'arg', 'mathvariant', 'mathsize', 'width', 'height', 'depth', 'linebreak'],
264
+ mtr: ['href', 'xref', 'mathcolor', 'mathbackground', 'intent', 'arg', 'rowalign', 'columnalign', 'groupalign'],
265
+ munder: ['href', 'xref', 'mathcolor', 'mathbackground', 'intent', 'arg', 'accentunder', 'align'],
266
+ munderover: ['href', 'xref', 'mathcolor', 'mathbackground', 'intent', 'arg', 'accent', 'accentunder', 'align'],
267
+ none: ['href', 'xref', 'mathcolor', 'mathbackground', 'intent', 'arg'],
268
+ semantics: ['href', 'xref', 'intent', 'arg', 'definitionURL', 'encoding'],
269
269
  picture: [],
270
270
  ruby: [],
271
271
  rp: [],
272
- rt: [],
273
- g: ['*'],
274
- circle: ['*']
272
+ rt: []
275
273
  }),
276
274
  non_empty_elements: 'td th iframe video audio object script a i area base basefont br col frame hr img input isindex link meta param embed source wbr track ruby',
277
275
  // tiny's external link create/edit dialog config
@@ -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
  };
@@ -104,7 +104,7 @@ function previewId() {
104
104
  function buildUrl(url) {
105
105
  try {
106
106
  return new URL(url);
107
- } catch (e) {
107
+ } catch (_e) {
108
108
  // Don't raise an error
109
109
  }
110
110
  }
@@ -124,7 +124,7 @@ const addResourceIdentifiersToStudioContent = content => {
124
124
  };
125
125
  export function enhanceUserContent(container = document, opts = {}) {
126
126
  const {
127
- customEnhanceFunc,
127
+ customEnhance,
128
128
  canvasOrigin,
129
129
  kalturaSettings,
130
130
  disableGooglePreviews,
@@ -163,7 +163,7 @@ export function enhanceUserContent(container = document, opts = {}) {
163
163
  }
164
164
  content.querySelectorAll('.user_content:not(.enhanced)').forEach(elem => {
165
165
  elem.classList.add('unenhanced');
166
- explicit_latex_typesetting && elem.classList.add(MathJaxDirective.Process);
166
+ if (explicit_latex_typesetting) elem.classList.add(MathJaxDirective.Process);
167
167
  });
168
168
  const mathml = new Mathml({
169
169
  new_math_equation_handling,
@@ -172,7 +172,7 @@ export function enhanceUserContent(container = document, opts = {}) {
172
172
  locale
173
173
  });
174
174
  content.querySelectorAll('.unenhanced').forEach(unenhanced_elem => {
175
- explicit_latex_typesetting && mathml.processNewMathInElem(unenhanced_elem);
175
+ if (explicit_latex_typesetting) mathml.processNewMathInElem(unenhanced_elem);
176
176
  unenhanced_elem.querySelectorAll('img').forEach(img => {
177
177
  const src = img.getAttribute('src');
178
178
  if (!/^\/[^/]/.test(src)) {
@@ -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
@@ -346,9 +346,7 @@ export function enhanceUserContent(container = document, opts = {}) {
346
346
  handleYoutubeLink($anchor);
347
347
  }
348
348
  });
349
- if (customEnhanceFunc) {
350
- customEnhanceFunc();
351
- }
349
+ if (typeof customEnhance === 'function') customEnhance();
352
350
  content.querySelectorAll('.user_content.unenhanced').forEach($elem => {
353
351
  $elem.classList.remove('unenhanced');
354
352
  $elem.classList.add('enhanced');
@@ -1,4 +1,6 @@
1
- export * from "./enhance_user_content";
1
+ export { enhanceUserContent } from "./enhance_user_content";
2
+ export { makeAllExternalLinksExternalLinks } from "./external_links";
3
+ export { Mathml } from "./mathml";
2
4
  export { mediaCommentThumbnail };
3
5
  import mediaCommentThumbnail from './media_comment_thumbnail';
4
6
  export { isPreviewable, loadDocPreview } from "./doc_previews";
@@ -17,6 +17,8 @@
17
17
  */
18
18
 
19
19
  import mediaCommentThumbnail from './media_comment_thumbnail';
20
- export * from './enhance_user_content';
20
+ export { enhanceUserContent } from './enhance_user_content';
21
21
  export { isPreviewable, loadDocPreview } from './doc_previews';
22
+ export { makeAllExternalLinksExternalLinks } from './external_links';
23
+ export { Mathml } from './mathml';
22
24
  export { mediaCommentThumbnail };
@@ -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,4 +1,22 @@
1
1
  import _pt from "prop-types";
2
+ /*
3
+ * Copyright (C) 2026 - present Instructure, Inc.
4
+ *
5
+ * This file is part of Canvas.
6
+ *
7
+ * Canvas is free software: you can redistribute it and/or modify it under
8
+ * the terms of the GNU Affero General Public License as published by the Free
9
+ * Software Foundation, version 3 of the License.
10
+ *
11
+ * Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
12
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
13
+ * A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
14
+ * details.
15
+ *
16
+ * You should have received a copy of the GNU Affero General Public License along
17
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
18
+ */
19
+
2
20
  import React, { useRef, useEffect, useState, useCallback } from 'react';
3
21
  import { createRoot } from 'react-dom/client';
4
22
  import { Text } from '@instructure/ui-text';
@@ -1,4 +1,4 @@
1
- declare function getThemeVars(): {
1
+ declare function getThemeVars(useHighContrast?: boolean, fontFamily?: string): {
2
2
  variables: Record<string, unknown>;
3
3
  key: string;
4
4
  };
@@ -16,33 +16,30 @@
16
16
  * with this program. If not, see <http://www.gnu.org/licenses/>.
17
17
  */
18
18
 
19
- import { getRegistry } from '@instructure/theme-registry';
20
- import { merge, cloneDeep } from 'lodash';
21
-
22
- // The running theme is the running theme for this page load, and it never
23
- // changes, so there's no point in doing the work more than once.
24
- let memoizedVariables;
25
- function getThemeVars() {
26
- if (memoizedVariables) return memoizedVariables;
27
-
28
- // @ts-expect-error
29
- const {
30
- currentThemeKey,
31
- overrides,
32
- themes
33
- } = getRegistry();
34
- // Just assume the "canvas" theme if the default key is null. This will
35
- // never happen in the live app because one way or another a theme gets
36
- // used, but unit tests don't always do that.
37
- // Also we have to cloneDeep this because the merge below is about to
38
- // mutate the whole thing.
39
- const themeKey = currentThemeKey || 'canvas';
40
- const variables = cloneDeep(themes[themeKey]);
41
- merge(variables, overrides);
42
- memoizedVariables = {
19
+ import { canvas, canvasHighContrast } from '@instructure/ui-themes';
20
+ import { cloneDeep } from 'es-toolkit/compat';
21
+ const cache = new Map();
22
+ function getThemeVars(useHighContrast = false, fontFamily) {
23
+ const cacheKey = `${useHighContrast}:${fontFamily !== null && fontFamily !== void 0 ? fontFamily : ''}`;
24
+ if (cache.has(cacheKey)) return cache.get(cacheKey);
25
+ const baseTheme = useHighContrast ? canvasHighContrast : canvas;
26
+ const key = useHighContrast ? 'canvas-high-contrast' : 'canvas';
27
+ const brandVars = !useHighContrast && typeof window !== 'undefined' ? window.CANVAS_ACTIVE_BRAND_VARIABLES || {} : {};
28
+ const variables = {
29
+ ...cloneDeep(baseTheme),
30
+ ...brandVars
31
+ };
32
+ if (fontFamily) {
33
+ variables.typography = {
34
+ ...variables.typography,
35
+ fontFamily
36
+ };
37
+ }
38
+ const result = {
43
39
  variables,
44
- key: themeKey
40
+ key
45
41
  };
46
- return memoizedVariables;
42
+ cache.set(cacheKey, result);
43
+ return result;
47
44
  }
48
45
  export { getThemeVars };
@@ -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)
@@ -47,7 +47,7 @@ export default function KeyboardShortcutModal(props) {
47
47
  offset: "medium",
48
48
  color: "primary",
49
49
  onClick: props.onDismiss,
50
- screenReaderLabel: formatMessage('Close')
50
+ screenReaderLabel: formatMessage('Close Keyboard Shortcuts Modal')
51
51
  }), /*#__PURE__*/React.createElement(Heading, null, formatMessage('Keyboard Shortcuts'))), /*#__PURE__*/React.createElement(Modal.Body, null, /*#__PURE__*/React.createElement(View, {
52
52
  as: "div",
53
53
  padding: "x-small xx-large large x-large"
@@ -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,
package/es/rce/RCE.d.ts CHANGED
@@ -46,6 +46,15 @@ export interface RCEPropTypes {
46
46
  * array of URLs to high-contrast css
47
47
  */
48
48
  highContrastCSS?: string[];
49
+ /**
50
+ * whether high contrast mode is enabled
51
+ */
52
+ useHighContrast?: boolean;
53
+ /**
54
+ * CSS font-family string for the RCE chrome (toolbar, menus).
55
+ * Built by the host to include Lato Extended, dyslexic font, K5 font, etc.
56
+ */
57
+ fontFamily?: string;
49
58
  /**
50
59
  * if true, do not load the plugin that provides the media toolbar and menu items
51
60
  */
package/es/rce/RCE.js CHANGED
@@ -46,6 +46,8 @@ const RCE = /*#__PURE__*/forwardRef(function RCE(props, rceRef) {
46
46
  // tinymce config
47
47
  height,
48
48
  highContrastCSS,
49
+ useHighContrast,
50
+ fontFamily,
49
51
  instRecordDisabled,
50
52
  language,
51
53
  liveRegion,
@@ -87,6 +89,8 @@ const RCE = /*#__PURE__*/forwardRef(function RCE(props, rceRef) {
87
89
  canvasOrigin,
88
90
  defaultContent,
89
91
  highContrastCSS,
92
+ useHighContrast,
93
+ fontFamily,
90
94
  instRecordDisabled,
91
95
  language: normalizeLocale(language),
92
96
  liveRegion,
@@ -2,12 +2,14 @@ export default instance;
2
2
  export type Features = {
3
3
  file_verifiers_for_quiz_links: boolean;
4
4
  rce_studio_embed_improvements: boolean;
5
+ rce_asr_captioning_improvements: boolean;
5
6
  };
6
7
  declare const instance: RCEGlobals;
7
8
  /**
8
9
  * @typedef {Object} Features
9
10
  * @property {boolean} file_verifiers_for_quiz_links
10
11
  * @property {boolean} rce_studio_embed_improvements
12
+ * @property {boolean} rce_asr_captioning_improvements
11
13
  */
12
14
  declare class RCEGlobals {
13
15
  _data: {
@@ -22,6 +22,7 @@ const isEmpty = obj => Object.keys(obj).length === 0;
22
22
  * @typedef {Object} Features
23
23
  * @property {boolean} file_verifiers_for_quiz_links
24
24
  * @property {boolean} rce_studio_embed_improvements
25
+ * @property {boolean} rce_asr_captioning_improvements
25
26
  */
26
27
 
27
28
  class RCEGlobals {
@@ -7,11 +7,10 @@ interface ToolbarGroupSetting {
7
7
  name: string;
8
8
  items: string[];
9
9
  }
10
- type StatusBarFeature = 'ai_tools' | 'keyboard_shortcuts' | 'a11y_checker' | 'word_count' | 'html_view' | 'fullscreen' | 'resize_handle' | 'a11y_resize_handlers';
10
+ type StatusBarFeature = 'keyboard_shortcuts' | 'a11y_checker' | 'word_count' | 'html_view' | 'fullscreen' | 'resize_handle' | 'a11y_resize_handlers';
11
11
  export declare const RCEVariantValues: readonly ["full", "lite", "text-only", "text-block", "block-content-editor"];
12
12
  export type RCEVariant = (typeof RCEVariantValues)[number];
13
13
  export type StatusBarOptions = {
14
- aiTextTools?: boolean;
15
14
  isDesktop?: boolean;
16
15
  a11yResizers?: boolean;
17
16
  };
@@ -144,7 +144,6 @@ const MOBILE_FEATURES = ['a11y_checker', 'word_count'];
144
144
  const EXTENDED_FEATURES = ['html_view', 'fullscreen', 'resize_handle'];
145
145
  const A11Y_RESIZERS = ['a11y_resize_handlers'];
146
146
  export function getStatusBarFeaturesForVariant(variant, options = {
147
- aiTextTools: false,
148
147
  isDesktop: true,
149
148
  a11yResizers: false
150
149
  }) {
@@ -158,5 +157,5 @@ export function getStatusBarFeaturesForVariant(variant, options = {
158
157
  if (variant === 'lite' || variant === 'text-only') {
159
158
  return platformFeatures;
160
159
  }
161
- return [...platformFeatures, ...EXTENDED_FEATURES, ...(options.a11yResizers ? A11Y_RESIZERS : []), ...(options.aiTextTools ? ['ai_tools'] : [])];
160
+ return [...platformFeatures, ...EXTENDED_FEATURES, ...(options.a11yResizers ? A11Y_RESIZERS : [])];
162
161
  }