@instructure/canvas-rce 5.11.1 → 5.12.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 (108) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/es/canvasFileBrowser/FileBrowser.js +6 -1
  3. package/es/common/fileUrl.js +3 -4
  4. package/es/defaultTinymceConfig.js +1 -1
  5. package/es/elementDenylist.js +19 -0
  6. package/es/getThemeVars.js +4 -3
  7. package/es/getTranslations.js +77 -1
  8. package/es/rce/RCEWrapper.js +2 -6
  9. package/es/rce/StatusBar.js +8 -2
  10. package/es/rce/contentInsertion.js +5 -2
  11. package/es/rce/plugins/instructure_documents/components/DocumentsPanel.js +3 -9
  12. package/es/rce/plugins/instructure_html_view/plugin.js +2 -2
  13. package/es/rce/plugins/instructure_icon_maker/components/SavedIconMakerList.js +3 -2
  14. package/es/rce/plugins/instructure_image/ImageList/Image.js +2 -2
  15. package/es/rce/plugins/instructure_image/Images/index.js +3 -10
  16. package/es/rce/plugins/instructure_rce_external_tools/components/ExternalToolDialog/ExternalToolDialog.js +3 -0
  17. package/es/rce/plugins/instructure_rce_external_tools/lti13-content-items/models/ResourceLinkContentItem.js +3 -1
  18. package/es/rce/plugins/instructure_record/AudioOptionsTray/TrayController.js +26 -1
  19. package/es/rce/plugins/instructure_record/AudioOptionsTray/index.js +9 -3
  20. package/es/rce/plugins/instructure_record/MediaPanel/index.js +3 -9
  21. package/es/rce/plugins/instructure_record/VideoOptionsTray/TrayController.js +27 -2
  22. package/es/rce/plugins/instructure_record/VideoOptionsTray/index.js +35 -6
  23. package/es/rce/plugins/shared/fileShape.js +81 -9
  24. package/es/rce/plugins/shared/fileTypeUtils.js +6 -0
  25. package/es/rcs/api.js +6 -4
  26. package/es/sidebar/store/configureStore.js +2 -2
  27. package/es/translations/locales/ab.js +26 -0
  28. package/es/translations/locales/cs.js +27 -0
  29. package/es/translations/locales/cs_CZ.js +27 -0
  30. package/es/translations/locales/da_DK.js +27 -0
  31. package/es/translations/locales/en_NZ.js +26 -0
  32. package/es/translations/locales/en_SE.js +26 -0
  33. package/es/translations/locales/en_US.js +26 -0
  34. package/es/translations/locales/hu_HU.js +27 -0
  35. package/es/translations/locales/id.js +2426 -0
  36. package/es/{types/inst-ui.d.js → translations/locales/id_ID.js} +9 -1
  37. package/es/translations/locales/ko_KR.js +27 -0
  38. package/es/translations/locales/lt.js +26 -0
  39. package/es/translations/locales/lt_LT.js +26 -0
  40. package/es/translations/locales/mn_MN.js +26 -0
  41. package/es/translations/locales/nl_NL.js +27 -0
  42. package/es/translations/locales/ro.js +27 -0
  43. package/es/translations/locales/ru.js +2375 -32
  44. package/es/translations/locales/sv.js +2379 -30
  45. package/es/translations/locales/th.js +2401 -1
  46. package/es/translations/locales/tl_PH.js +26 -0
  47. package/es/translations/locales/tr.js +3 -0
  48. package/es/translations/locales/vi.js +2396 -8
  49. package/es/translations/locales/zh_TW.Big5.js +27 -0
  50. package/es/translations/locales/zh_TW.js +27 -0
  51. package/lib/canvasFileBrowser/FileBrowser.js +6 -1
  52. package/lib/common/fileUrl.js +3 -4
  53. package/lib/defaultTinymceConfig.js +1 -1
  54. package/lib/elementDenylist.js +19 -0
  55. package/lib/getThemeVars.js +4 -3
  56. package/lib/getTranslations.js +77 -1
  57. package/lib/rce/RCEWrapper.js +2 -6
  58. package/lib/rce/StatusBar.js +8 -2
  59. package/lib/rce/contentInsertion.js +5 -2
  60. package/lib/rce/plugins/instructure_documents/components/DocumentsPanel.js +3 -9
  61. package/lib/rce/plugins/instructure_html_view/plugin.js +2 -2
  62. package/lib/rce/plugins/instructure_icon_maker/components/SavedIconMakerList.js +3 -2
  63. package/lib/rce/plugins/instructure_image/ImageList/Image.js +2 -2
  64. package/lib/rce/plugins/instructure_image/Images/index.js +3 -10
  65. package/lib/rce/plugins/instructure_rce_external_tools/components/ExternalToolDialog/ExternalToolDialog.js +3 -0
  66. package/lib/rce/plugins/instructure_rce_external_tools/lti13-content-items/models/ResourceLinkContentItem.js +3 -1
  67. package/lib/rce/plugins/instructure_record/AudioOptionsTray/TrayController.js +26 -1
  68. package/lib/rce/plugins/instructure_record/AudioOptionsTray/index.js +9 -3
  69. package/lib/rce/plugins/instructure_record/MediaPanel/index.js +3 -9
  70. package/lib/rce/plugins/instructure_record/VideoOptionsTray/TrayController.js +27 -2
  71. package/lib/rce/plugins/instructure_record/VideoOptionsTray/index.js +35 -6
  72. package/lib/rce/plugins/shared/fileShape.js +81 -9
  73. package/lib/rce/plugins/shared/fileTypeUtils.js +6 -0
  74. package/lib/rcs/api.js +6 -4
  75. package/lib/sidebar/store/configureStore.js +2 -2
  76. package/lib/translations/locales/ab.js +26 -0
  77. package/lib/translations/locales/cs.js +27 -0
  78. package/lib/translations/locales/cs_CZ.js +27 -0
  79. package/lib/translations/locales/da_DK.js +27 -0
  80. package/lib/translations/locales/en_NZ.js +26 -0
  81. package/lib/translations/locales/en_SE.js +26 -0
  82. package/lib/translations/locales/en_US.js +26 -0
  83. package/lib/translations/locales/hu_HU.js +27 -0
  84. package/lib/translations/locales/id.js +2426 -0
  85. package/lib/{types/inst-ui.d.js → translations/locales/id_ID.js} +9 -1
  86. package/lib/translations/locales/ko_KR.js +27 -0
  87. package/lib/translations/locales/lt.js +26 -0
  88. package/lib/translations/locales/lt_LT.js +26 -0
  89. package/lib/translations/locales/mn_MN.js +26 -0
  90. package/lib/translations/locales/nl_NL.js +27 -0
  91. package/lib/translations/locales/ro.js +27 -0
  92. package/lib/translations/locales/ru.js +2375 -32
  93. package/lib/translations/locales/sv.js +2379 -30
  94. package/lib/translations/locales/th.js +2401 -1
  95. package/lib/translations/locales/tl_PH.js +26 -0
  96. package/lib/translations/locales/tr.js +3 -0
  97. package/lib/translations/locales/vi.js +2396 -8
  98. package/lib/translations/locales/zh_TW.Big5.js +27 -0
  99. package/lib/translations/locales/zh_TW.js +27 -0
  100. package/package.json +11 -9
  101. package/scripts/publish_to_npm.sh +26 -0
  102. package/canvas/README.md +0 -84
  103. package/canvas/locales/en.json +0 -934
  104. package/canvas/package.json +0 -189
  105. package/es/common/scroll.js +0 -45
  106. package/es/types/ts-migration.js +0 -1
  107. package/lib/common/scroll.js +0 -45
  108. package/lib/types/ts-migration.js +0 -1
package/CHANGELOG.md CHANGED
@@ -5,6 +5,30 @@ 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
+ ## 5.12.1 - 2024-01-26
9
+
10
+ ### Fixed
11
+
12
+ - An issue where we were adding file verifiers unnecessarily to non-user files
13
+ which were allowing students access to course files they should not have
14
+ access to
15
+ - An issue where type query parameter was duplicated.
16
+ - Fix focus ring in RCE content
17
+ - Stop adding wrap params to course links
18
+
19
+ ### Changed
20
+
21
+ - Bump redux-thunk to 3.1.0
22
+ - Show full name in hover in All Files tray
23
+ - Remove "scroll-into-view"
24
+ - jQuery changes
25
+ - Upgrade moment to 0.5.43
26
+ - Upgrade babel-loader to 9.1.3
27
+ - Remove use of InferType
28
+ - Show media captions in New Quizzes
29
+ - Bump Instui to 8.49
30
+
31
+
8
32
  ## 5.11.1 - 2023-10-12
9
33
 
10
34
  ### Fixed
@@ -340,9 +340,14 @@ class FileBrowser extends React.Component {
340
340
  itemIcon = getIconFromType(file.type);
341
341
  }
342
342
 
343
+ const containerRef = node => {
344
+ if (node && !node.title && props.name) node.title = props.name;
345
+ };
346
+
343
347
  return { ...props,
344
348
  thumbnail,
345
- itemIcon
349
+ itemIcon,
350
+ containerRef
346
351
  };
347
352
  }
348
353
 
@@ -104,9 +104,11 @@ export function fixupFileUrl(contextType, contextId, fileInfo, canvasOrigin) {
104
104
  parsed = changeDownloadToWrapParams(parsed);
105
105
  parsed = addContext(parsed, contextType, contextId); // if this is a user file, add the verifier
106
106
 
107
- if (fileInfo.uuid && (contextType.includes('user') || !!canvasOrigin && canvasOrigin !== window.location.origin)) {
107
+ if (fileInfo.uuid && contextType.includes('user')) {
108
108
  delete parsed.search;
109
109
  parsed.query.verifier = fileInfo.uuid;
110
+ } else {
111
+ delete parsed.query.verifier;
110
112
  }
111
113
 
112
114
  fileInfo[key] = format(parsed);
@@ -136,8 +138,6 @@ export function prepEmbedSrc(url) {
136
138
  return format(parsed);
137
139
  } // when the user opens a link to a resource, we want its view
138
140
  // logged, so remove /preview
139
- // Add wrap=1 to indicate clicking on the link should open a preview
140
- // and not download the file (this doesn't work if the original link is a download link)
141
141
 
142
142
  export function prepLinkedSrc(url) {
143
143
  const parsed = parseCanvasUrl(url);
@@ -148,6 +148,5 @@ export function prepLinkedSrc(url) {
148
148
 
149
149
  delete parsed.search;
150
150
  parsed.pathname = parsed.pathname.replace(/\/preview(\?|$)/, '$1');
151
- parsed.query.wrap = '1';
152
151
  return format(parsed);
153
152
  }
@@ -71,7 +71,7 @@ const defaultTinymceConfig = {
71
71
  // then edited.
72
72
  //
73
73
  // this list needs to be kept in sync with the list in gems/canvas_sanitize/lib/canvas_sanitize/canvas_sanitize.rb
74
- valid_elements: '@[id|class|style|title|dir<ltr?rtl|lang|xml::lang|role],a[rel|rev|charset|hreflang|tabindex|accesskey|type|name|href|target|title|class],strong/b,em/i,strike/s,u,#p,-ol[type|compact],-ul[type|compact],-li,br,img[longdesc|usemap|src|border|alt|title|hspace|vspace|width|height|align|role],-sub,-sup,-blockquote[cite],-table[border=0|cellspacing|cellpadding|width|frame|rules|height|align|summary|bgcolor|background|bordercolor],-tr[rowspan|width|height|align|valign|bgcolor|background|bordercolor],tbody,thead,tfoot,#td[colspan|rowspan|width|height|align|valign|bgcolor|background|bordercolor|scope],#th[colspan|rowspan|width|height|align|valign|scope],caption,-div,-span,-code,-pre,address,-h1,-h2,-h3,-h4,-h5,-h6,hr[size|noshade],-font[face|size|color],dd,dl,dt,cite,abbr,acronym,del[datetime|cite],ins[datetime|cite],object[classid|width|height|codebase|*],param[name|value|_value],embed[type|width|height|src|*],map[name],area[shape|coords|href|alt|target],bdo,col[align|char|charoff|span|valign|width],colgroup[align|char|charoff|span|valign|width],dfn,kbd,q[cite],samp,small,tt,var,big,figure,figcaption,source[media|sizes|src|srcset|type],track,mark,article,aside,details,footer,header,nav,section,summary,time',
74
+ valid_elements: '@[id|class|style|title|dir<ltr?rtl|lang|xml::lang|role],a[rel|rev|charset|hreflang|tabindex|accesskey|type|name|href|target|title|class],strong/b,em/i,strike/s,u,#p,-ol[type|compact],-ul[type|compact],-li,br,img[longdesc|usemap|src|border|alt|title|hspace|vspace|width|height|align|role],-sub,-sup,-blockquote[cite],-table[border=0|cellspacing|cellpadding|width|frame|rules|height|align|summary|bgcolor|background|bordercolor],-tr[rowspan|width|height|align|valign|bgcolor|background|bordercolor],tbody,thead,tfoot,#td[colspan|rowspan|width|height|align|valign|bgcolor|background|bordercolor|scope],#th[colspan|rowspan|width|height|align|valign|scope],caption,-div,-span,-code,-pre,address,-h1,-h2,-h3,-h4,-h5,-h6,hr[size|noshade],-font[face|size|color],dd,dl,dt,cite,abbr,acronym,del[datetime|cite],ins[datetime|cite],object[classid|width|height|codebase|*],param[name|value|_value],embed[type|width|height|src|*],map[name],area[shape|coords|href|alt|target],bdo,col[align|char|charoff|span|valign|width],colgroup[align|char|charoff|span|valign|width],dfn,kbd,q[cite],samp,small,tt,var,big,figure,figcaption,source[media|width|height|sizes|src|srcset|type],track,mark,article,aside,details,footer,header,nav,section,summary,time',
75
75
  extended_valid_elements: '@[id|accesskey|class|dir|lang|style|tabindex|title|contenteditable|contextmenu|draggable|dropzone|hidden|longdesc|spellcheck|translate|align|role|aria-labelledby|aria-atomic|aria-busy|aria-controls|aria-describedby|aria-disabled|aria-dropeffect|aria-flowto|aria-grabbed|aria-haspopup|aria-hidden|aria-invalid|aria-label|aria-labelledby|aria-live|aria-owns|aria-relevant|aria-autocomplete|aria-checked|aria-disabled|aria-expanded|aria-haspopup|aria-hidden|aria-invalid|aria-label|aria-level|aria-multiline|aria-multiselectable|aria-orientation|aria-pressed|aria-readonly|aria-required|aria-selected|aria-sort|aria-valuemax|aria-valuemin|aria-valuenow|aria-valuetext],iframe[id|data-media-type|title|src|width|height|name|align|style|class|sandbox|allowfullscreen|webkitallowfullscreen|mozallowfullscreen|allow],i[iclass],a[hidden|href|target|rel|media|hreflang|type|charset|name|rev|shape|coords|download|alt],#p,li[value],-ol[reversed|start|type|compact],pre[width],table[border|summary|width|frame|rules|cellspacing|cellpadding|bgcolor],tbody[char|charoff|valign],td[colspan|rowspan|headers|abbr|axis|scope|align|char|charoff|valign|nowrap|bgcolor|width|height],tfoot[char|charoff|valign],th[colspan|rowspan|headers|scope|abbr|axis|align|char|charoff|valign|nowrap|bgcolor|width|height],thead[char|charoff|valign],tr[char|charoff|valign|bgcolor],-ul[compact],video[name|src|allowfullscreen|muted|poster|width|height|controls|playsinline],audio[name|src|muted|controls],annotation[href|xref|definitionURL|encoding|cd|name|src],annotation-xml[href|xref|definitionURL|encoding|cd|name|src],maction[href|xref|mathcolor|mathbackground|actiontype|selection],maligngroup[href|xref|mathcolor|mathbackground|groupalign],malignmark[href|xref|mathcolor|mathbackground|edge],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],menclose[href|xref|mathcolor|mathbackground|notation],merror[href|xref|mathcolor|mathbackground],mfenced[href|xref|mathcolor|mathbackground|open|close|separators],mfrac[href|xref|mathcolor|mathbackground|linethickness|munalign|denomalign|bevelled],mglyph[href|xref|mathcolor|mathbackground|src|alt|width|height|valign],mi[href|xref|mathcolor|mathbackground|mathvariant|mathsize],mlabeledtr[href|xref|mathcolor|mathbackground],mlongdiv[href|xref|mathcolor|mathbackground|longdivstyle|align|stackalign|charalign|charspacing],mmultiscripts[href|xref|mathcolor|mathbackground|subscriptshift|superscriptshift],mn[href|xref|mathcolor|mathbackground|mathvariant|mathsize],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],mover[href|xref|mathcolor|mathbackground|accent|align],mpadded[href|xref|mathcolor|mathbackground|height|depth|width|lspace|voffset],mphantom[href|xref|mathcolor|mathbackground],mprescripts[href|xref|mathcolor|mathbackground],mroot[href|xref|mathcolor|mathbackground],mrow[href|xref|mathcolor|mathbackground],ms[href|xref|mathcolor|mathbackground|mathvariant|mathsize|lquote|rquote],mscarries[href|xref|mathcolor|mathbackground|position|location|crossout|scriptsizemultiplier],mscarry[href|xref|mathcolor|mathbackground|location|crossout],msgroup[href|xref|mathcolor|mathbackground|position|shift],msline[href|xref|mathcolor|mathbackground|position|length|leftoverhang|rightoverhang|mslinethickness],mspace[href|xref|mathcolor|mathbackground|mathvariant|mathsize],msqrt[href|xref|mathcolor|mathbackground],msrow[href|xref|mathcolor|mathbackground|position],mstack[href|xref|mathcolor|mathbackground|align|stackalign|charalign|charspacing],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],msub[href|xref|mathcolor|mathbackground|subscriptshift],msubsup[href|xref|mathcolor|mathbackground|subscriptshift|superscriptshift],msup[href|xref|mathcolor|mathbackground|superscriptshift],mtable[href|xref|mathcolor|mathbackground|align|rowalign|columnalign|groupalign|alignmentscope|columnwidth|width|rowspacing|columnspacing|rowlines|columnlines|frame|framespacing|equalrows|equalcolumns|displaystyle|side|minlabelspacing],mtd[href|xref|mathcolor|mathbackground|rowspan|columnspan|rowalign|columnalign|groupalign],mtext[href|xref|mathcolor|mathbackground|mathvariant|mathsize|width|height|depth|linebreak],mtr[href|xref|mathcolor|mathbackground|rowalign|columnalign|groupalign],munder[href|xref|mathcolor|mathbackground|accentunder|align],munderover[href|xref|mathcolor|mathbackground|accent|accentunder|align],none[href|xref|mathcolor|mathbackground],semantics[href|xref|definitionURL|encoding],picture,ruby,rp,rt,wbr' + // the svg necessary for the uploading placeholder's spinner
76
76
  'svg[*],g[*],circle[*]',
77
77
  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',
@@ -0,0 +1,19 @@
1
+ /*
2
+ * Copyright (C) 2023 - present Instructure, Inc.
3
+ *
4
+ * This file is part of Canvas.
5
+ *
6
+ * Canvas is free software: you can redistribute it and/or modify it under
7
+ * the terms of the GNU Affero General Public License as published by the Free
8
+ * Software Foundation, version 3 of the License.
9
+ *
10
+ * Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
11
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12
+ * A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
13
+ * details.
14
+ *
15
+ * You should have received a copy of the GNU Affero General Public License along
16
+ * with this program. If not, see <http://www.gnu.org/licenses/>.
17
+ */
18
+ const elementDenylist = ('html,base,head,link,meta,style,title,body,main,data,rb,rtc,portal,svg,canvas,noscript,script,button,datalist,fieldset,form,input,label,legend,meter,optgroup' + ',option,output,progress,select,textarea,dialog,menu,slot,template,applet,basefont,bgsound,blink,center,content,dir,frame,frameset,hgroup,image,keygen,marquee,menuitem,nobr,noembed' + ',noframes,plaintext,rb,rtc,shadow,spacer,xmp').split(',');
19
+ export default elementDenylist;
@@ -24,7 +24,7 @@ let memoizedVariables;
24
24
  function getThemeVars() {
25
25
  if (memoizedVariables) return memoizedVariables;
26
26
  const {
27
- defaultThemeKey,
27
+ currentThemeKey,
28
28
  overrides,
29
29
  themes
30
30
  } = getRegistry(); // Just assume the "canvas" theme if the default key is null. This will
@@ -33,11 +33,12 @@ function getThemeVars() {
33
33
  // Also we have to cloneDeep this because the merge below is about to
34
34
  // mutate the whole thing.
35
35
 
36
- const variables = cloneDeep(themes[defaultThemeKey !== null && defaultThemeKey !== void 0 ? defaultThemeKey : 'canvas']);
36
+ const themeKey = currentThemeKey || 'canvas';
37
+ const variables = cloneDeep(themes[themeKey]);
37
38
  merge(variables, overrides);
38
39
  memoizedVariables = {
39
40
  variables,
40
- key: defaultThemeKey
41
+ key: themeKey
41
42
  };
42
43
  return memoizedVariables;
43
44
  }
@@ -28,6 +28,10 @@ export default function getTranslations(locale) {
28
28
  let p;
29
29
 
30
30
  switch (locale) {
31
+ case 'ab':
32
+ p = import('./translations/locales/ab');
33
+ break;
34
+
31
35
  case 'ar':
32
36
  p = import('./translations/locales/ar');
33
37
  break;
@@ -36,6 +40,14 @@ export default function getTranslations(locale) {
36
40
  p = import('./translations/locales/ca');
37
41
  break;
38
42
 
43
+ case 'cs':
44
+ p = import('./translations/locales/cs');
45
+ break;
46
+
47
+ case 'cs-CZ':
48
+ p = import('./translations/locales/cs_CZ');
49
+ break;
50
+
39
51
  case 'cy':
40
52
  p = import('./translations/locales/cy');
41
53
  break;
@@ -48,6 +60,10 @@ export default function getTranslations(locale) {
48
60
  p = import('./translations/locales/da-x-k12');
49
61
  break;
50
62
 
63
+ case 'da-DK':
64
+ p = import('./translations/locales/da_DK');
65
+ break;
66
+
51
67
  case 'de':
52
68
  p = import('./translations/locales/de');
53
69
  break;
@@ -84,6 +100,18 @@ export default function getTranslations(locale) {
84
100
  p = import('./translations/locales/en_GB');
85
101
  break;
86
102
 
103
+ case 'en-NZ':
104
+ p = import('./translations/locales/en_NZ');
105
+ break;
106
+
107
+ case 'en-SE':
108
+ p = import('./translations/locales/en_SE');
109
+ break;
110
+
111
+ case 'en-US':
112
+ p = import('./translations/locales/en_US');
113
+ break;
114
+
87
115
  case 'es':
88
116
  p = import('./translations/locales/es');
89
117
  break;
@@ -124,10 +152,22 @@ export default function getTranslations(locale) {
124
152
  p = import('./translations/locales/hu');
125
153
  break;
126
154
 
155
+ case 'hu-HU':
156
+ p = import('./translations/locales/hu_HU');
157
+ break;
158
+
127
159
  case 'hy':
128
160
  p = import('./translations/locales/hy');
129
161
  break;
130
162
 
163
+ case 'id':
164
+ p = import('./translations/locales/id');
165
+ break;
166
+
167
+ case 'id-ID':
168
+ p = import('./translations/locales/id_ID');
169
+ break;
170
+
131
171
  case 'is':
132
172
  p = import('./translations/locales/is');
133
173
  break;
@@ -144,10 +184,26 @@ export default function getTranslations(locale) {
144
184
  p = import('./translations/locales/ko');
145
185
  break;
146
186
 
187
+ case 'ko-KR':
188
+ p = import('./translations/locales/ko_KR');
189
+ break;
190
+
191
+ case 'lt':
192
+ p = import('./translations/locales/lt');
193
+ break;
194
+
195
+ case 'lt-LT':
196
+ p = import('./translations/locales/lt_LT');
197
+ break;
198
+
147
199
  case 'mi':
148
200
  p = import('./translations/locales/mi');
149
201
  break;
150
202
 
203
+ case 'mn-MN':
204
+ p = import('./translations/locales/mn_MN');
205
+ break;
206
+
151
207
  case 'ms':
152
208
  p = import('./translations/locales/ms');
153
209
  break;
@@ -164,6 +220,10 @@ export default function getTranslations(locale) {
164
220
  p = import('./translations/locales/nl');
165
221
  break;
166
222
 
223
+ case 'nl-NL':
224
+ p = import('./translations/locales/nl_NL');
225
+ break;
226
+
167
227
  case 'nn':
168
228
  p = import('./translations/locales/nn');
169
229
  break;
@@ -180,6 +240,10 @@ export default function getTranslations(locale) {
180
240
  p = import('./translations/locales/pt_BR');
181
241
  break;
182
242
 
243
+ case 'ro':
244
+ p = import('./translations/locales/ro');
245
+ break;
246
+
183
247
  case 'ru':
184
248
  p = import('./translations/locales/ru');
185
249
  break;
@@ -216,6 +280,10 @@ export default function getTranslations(locale) {
216
280
  p = import('./translations/locales/th_TH');
217
281
  break;
218
282
 
283
+ case 'tl-PH':
284
+ p = import('./translations/locales/tl_PH');
285
+ break;
286
+
219
287
  case 'tr':
220
288
  p = import('./translations/locales/tr');
221
289
  break;
@@ -248,6 +316,14 @@ export default function getTranslations(locale) {
248
316
  p = import('./translations/locales/zh_HK');
249
317
  break;
250
318
 
319
+ case 'zh-TW':
320
+ p = import('./translations/locales/zh_TW');
321
+ break;
322
+
323
+ case 'zh-TW.Big5':
324
+ p = import('./translations/locales/zh_TW.Big5');
325
+ break;
326
+
251
327
  default:
252
328
  p = Promise.resolve(null);
253
329
  }
@@ -260,5 +336,5 @@ export default function getTranslations(locale) {
260
336
  return transReadyPromise;
261
337
  }
262
338
  export function getLocaleList() {
263
- return ['ar', 'ca', 'cy', 'da', 'da-x-k12', 'de', 'el', 'en', 'en-AU-x-unimelb', 'en-GB-x-ukhe', 'en-AU', 'en-CA', 'en-CY', 'en-GB', 'es', 'es-ES', 'es-GT', 'fa-IR', 'fi', 'fr', 'fr-CA', 'he', 'ht', 'hu', 'hy', 'is', 'it', 'ja', 'ko', 'mi', 'ms', 'nb', 'nb-x-k12', 'nl', 'nn', 'pl', 'pt', 'pt-BR', 'ru', 'se', 'sl', 'sv', 'sv-x-k12', 'sv-SE', 'tg', 'th', 'th-TH', 'tr', 'uk-UA', 'vi', 'vi-VN', 'zh', 'zh-Hans', 'zh-Hant', 'zh-HK'];
339
+ return ['ab', 'ar', 'ca', 'cs', 'cs-CZ', 'cy', 'da', 'da-x-k12', 'da-DK', 'de', 'el', 'en', 'en-AU-x-unimelb', 'en-GB-x-ukhe', 'en-AU', 'en-CA', 'en-CY', 'en-GB', 'en-NZ', 'en-SE', 'en-US', 'es', 'es-ES', 'es-GT', 'fa-IR', 'fi', 'fr', 'fr-CA', 'he', 'ht', 'hu', 'hu-HU', 'hy', 'id', 'id-ID', 'is', 'it', 'ja', 'ko', 'ko-KR', 'lt', 'lt-LT', 'mi', 'mn-MN', 'ms', 'nb', 'nb-x-k12', 'nl', 'nl-NL', 'nn', 'pl', 'pt', 'pt-BR', 'ro', 'ru', 'se', 'sl', 'sv', 'sv-x-k12', 'sv-SE', 'tg', 'th', 'th-TH', 'tl-PH', 'tr', 'uk-UA', 'vi', 'vi-VN', 'zh', 'zh-Hans', 'zh-Hant', 'zh-HK', 'zh-TW', 'zh-TW.Big5'];
264
340
  }
@@ -2552,9 +2552,6 @@ class RCEWrapper extends React.Component {
2552
2552
  }
2553
2553
  }
2554
2554
 
2555
- this.setState({
2556
- popupMountNode: instuiPopupMountNode()
2557
- });
2558
2555
  this.focusCurrentView();
2559
2556
  };
2560
2557
 
@@ -3099,8 +3096,7 @@ class RCEWrapper extends React.Component {
3099
3096
  prevHeight: _ht
3100
3097
  },
3101
3098
  a11yErrorsCount: 0,
3102
- shouldShowEditor: typeof IntersectionObserver === 'undefined' || maxInitRenderedRCEs <= 0 || currentRCECount < maxInitRenderedRCEs,
3103
- popupMountNode: instuiPopupMountNode()
3099
+ shouldShowEditor: typeof IntersectionObserver === 'undefined' || maxInitRenderedRCEs <= 0 || currentRCECount < maxInitRenderedRCEs
3104
3100
  };
3105
3101
  this._statusBarId = `${this.state.id}_statusbar`;
3106
3102
  this.pendingEventHandlers = []; // Get top 2 favorited LTI Tools
@@ -4144,7 +4140,7 @@ class RCEWrapper extends React.Component {
4144
4140
  }),
4145
4141
  disabledPlugins: this.pluginsToExclude
4146
4142
  }), ((_this$props$trayProps10 = this.props.trayProps) === null || _this$props$trayProps10 === void 0 ? void 0 : _this$props$trayProps10.containingContext) && /*#__PURE__*/React.createElement(CanvasContentTray, Object.assign({
4147
- mountNode: this.state.popupMountNode,
4143
+ mountNode: instuiPopupMountNode,
4148
4144
  key: this.id,
4149
4145
  canvasOrigin: this.getCanvasUrl(),
4150
4146
  bridge: bridge,
@@ -165,7 +165,10 @@ export default function StatusBar(props) {
165
165
 
166
166
  function renderPath() {
167
167
  return /*#__PURE__*/React.createElement(View, {
168
- "data-testid": "whole-status-bar-path"
168
+ "data-testid": "whole-status-bar-path",
169
+ style: {
170
+ display: 'flex'
171
+ }
169
172
  }, renderPathString(props));
170
173
  }
171
174
 
@@ -208,7 +211,10 @@ export default function StatusBar(props) {
208
211
  const message = props.editorView === PRETTY_HTML_EDITOR_VIEW ? formatMessage('Sadly, the pretty HTML editor is not keyboard accessible. Access the raw HTML editor here.') : formatMessage('Access the pretty HTML editor');
209
212
  const label = props.editorView === PRETTY_HTML_EDITOR_VIEW ? formatMessage('Switch to raw HTML Editor') : formatMessage('Switch to pretty HTML Editor');
210
213
  return /*#__PURE__*/React.createElement(View, {
211
- "data-testid": "html-editor-message"
214
+ "data-testid": "html-editor-message",
215
+ style: {
216
+ display: 'flex'
217
+ }
212
218
  }, /*#__PURE__*/React.createElement(Button, {
213
219
  "data-btn-id": "rce-editormessage-btn",
214
220
  margin: "0 small",
@@ -17,7 +17,6 @@
17
17
  */
18
18
  import classnames from 'classnames';
19
19
  import { renderAudio, renderImage, renderLink, renderLinkedImage, renderVideo } from './contentRendering';
20
- import scroll from '../common/scroll';
21
20
  import { cleanUrl, getAnchorElement, isImageFigure, isOnlyTextSelected } from './contentInsertionUtils';
22
21
  import { mediaPlayerURLFromFile } from './plugins/shared/fileTypeUtils';
23
22
  import { absoluteToRelativeUrl } from '../common/fileUrl';
@@ -54,7 +53,11 @@ export function insertContent(editor, content) {
54
53
  // insertion should reference the newly created node (or first of the newly
55
54
  // created nodes if there were multiple, unfortunately), because the cursor
56
55
  // itself stays just before the new content.
57
- scroll.scrollIntoViewWDelay(editor.iframeElement, {}); // there's a bug in tinymce where insertContent calls execCommand('mceInsertContent'),
56
+ setTimeout(() => {
57
+ if (editor.iframeElement) {
58
+ editor.iframeElement.scrollIntoView();
59
+ }
60
+ }, 100); // there's a bug in tinymce where insertContent calls execCommand('mceInsertContent'),
58
61
  // but doesn't correctly forward the second "args" argument. Let's go right for
59
62
  // execCommand
60
63
  // editor.insertContent(content, {skip_focus: true})
@@ -16,8 +16,8 @@
16
16
  * with this program. If not, see <http://www.gnu.org/licenses/>.
17
17
  */
18
18
  import React, { useRef } from 'react';
19
- import { arrayOf, bool, func, shape, string, objectOf, oneOf } from 'prop-types';
20
- import { fileShape } from '../../shared/fileShape';
19
+ import { func, shape, string, oneOf } from 'prop-types';
20
+ import { contentTrayDocumentShape } from '../../shared/fileShape';
21
21
  import formatMessage from '../../../../format-message';
22
22
  import { Text } from '@instructure/ui-text';
23
23
  import { View } from '@instructure/ui-view';
@@ -111,13 +111,7 @@ DocumentsPanel.propTypes = {
111
111
  fetchInitialDocs: func.isRequired,
112
112
  fetchNextDocs: func.isRequired,
113
113
  onLinkClick: func.isRequired,
114
- documents: objectOf(shape({
115
- files: arrayOf(shape(fileShape)).isRequired,
116
- bookmark: string,
117
- hasMore: bool,
118
- isLoading: bool,
119
- error: string
120
- })).isRequired,
114
+ documents: contentTrayDocumentShape.isRequired,
121
115
  sortBy: shape({
122
116
  sort: oneOf(['date_added', 'alphabetical']).isRequired,
123
117
  order: oneOf(['asc', 'desc']).isRequired
@@ -17,8 +17,8 @@
17
17
  */
18
18
  import formatMessage from '../../../format-message';
19
19
  import clickCallback from './clickCallback';
20
- import tinymce from 'tinymce';
21
- // Register plugin
20
+ import tinymce from 'tinymce'; // Register plugin
21
+
22
22
  tinymce.PluginManager.add('instructure_html_view', function (ed) {
23
23
  // Register commands
24
24
  ed.addCommand('instructureHtmlView', () => clickCallback()); // Register menu items
@@ -18,7 +18,8 @@
18
18
  import React from 'react';
19
19
  import PropTypes from 'prop-types';
20
20
  import { View } from '@instructure/ui-view';
21
- import Images, { RCSImageCollectionType } from '../../instructure_image/Images';
21
+ import Images from '../../instructure_image/Images';
22
+ import { contentTrayDocumentShape } from '../../shared/fileShape';
22
23
  import { ICON_MAKER_ICONS } from '../svg/constants';
23
24
 
24
25
  const SavedIconMakerList = props => {
@@ -69,7 +70,7 @@ SavedIconMakerList.propTypes = {
69
70
  sort: PropTypes.oneOf(['date_added', 'alphabetical']).isRequired,
70
71
  order: PropTypes.oneOf(['asc', 'desc']).isRequired
71
72
  }),
72
- images: RCSImageCollectionType.isRequired,
73
+ images: contentTrayDocumentShape.isRequired,
73
74
  contextType: PropTypes.string.isRequired,
74
75
  searchString: PropTypes.string,
75
76
  onImageEmbed: PropTypes.func,
@@ -16,7 +16,7 @@
16
16
  * with this program. If not, see <http://www.gnu.org/licenses/>.
17
17
  */
18
18
  import React from 'react';
19
- import { func, instanceOf, number, shape, string, bool } from 'prop-types';
19
+ import { func, instanceOf, number, oneOfType, shape, string, bool } from 'prop-types';
20
20
  import { Img } from '@instructure/ui-img';
21
21
  import { Link } from '@instructure/ui-link';
22
22
  import { Text } from '@instructure/ui-text';
@@ -92,7 +92,7 @@ Image.propTypes = {
92
92
  display_name: string.isRequired,
93
93
  filename: string,
94
94
  href: string.isRequired,
95
- id: number,
95
+ id: oneOfType([number, string]),
96
96
  preview_url: string,
97
97
  thumbnail_url: string.isRequired
98
98
  }).isRequired,
@@ -16,21 +16,14 @@
16
16
  * with this program. If not, see <http://www.gnu.org/licenses/>.
17
17
  */
18
18
  import React, { useRef } from 'react';
19
- import { arrayOf, bool, func, objectOf, oneOf, shape, string } from 'prop-types';
20
- import { fileShape } from '../../shared/fileShape';
19
+ import { bool, func, oneOf, shape, string } from 'prop-types';
20
+ import { contentTrayDocumentShape } from '../../shared/fileShape';
21
21
  import { Flex } from '@instructure/ui-flex';
22
22
  import { View } from '@instructure/ui-view';
23
23
  import { Text } from '@instructure/ui-text';
24
24
  import { LoadMoreButton, LoadingIndicator, LoadingStatus, useIncrementalLoading } from '../../../../common/incremental-loading';
25
25
  import ImageList from '../ImageList';
26
26
  import formatMessage from '../../../../format-message';
27
- export const RCSImageCollectionType = objectOf(shape({
28
- files: arrayOf(shape(fileShape)).isRequired,
29
- bookmark: string,
30
- hasMore: bool.isRequired,
31
- isLoading: bool.isRequired,
32
- error: string
33
- }));
34
27
 
35
28
  function hasFiles(images) {
36
29
  return images.files.length > 0;
@@ -114,7 +107,7 @@ Images.propTypes = {
114
107
  fetchInitialImages: func.isRequired,
115
108
  fetchNextImages: func.isRequired,
116
109
  contextType: string.isRequired,
117
- images: RCSImageCollectionType.isRequired,
110
+ images: contentTrayDocumentShape.isRequired,
118
111
  sortBy: shape({
119
112
  sort: oneOf(['date_added', 'alphabetical']).isRequired,
120
113
  order: oneOf(['asc', 'desc']).isRequired
@@ -86,6 +86,9 @@ export default class ExternalToolDialog extends React.Component {
86
86
  if ((data === null || data === void 0 ? void 0 : data.subject) === 'LtiDeepLinkingResponse') {
87
87
  processEditorContentItems(ev, this.props.env, this);
88
88
  } else if ((data === null || data === void 0 ? void 0 : data.subject) === 'externalContentReady') {
89
+ // 'externalContentReady' is EXTERNAL_CONTENT_READY in
90
+ // ui/shared/external-tools/externalContentEvents.ts
91
+ // where events are also described/used
89
92
  this.handleExternalContentReady(ev.data);
90
93
  }
91
94
  }
@@ -34,8 +34,10 @@ export default class ResourceLinkContentItem extends BaseLinkContentItem {
34
34
  }
35
35
 
36
36
  buildUrl() {
37
+ // iframed launches need canvas wrapped around them for postMessages to work
38
+ const display = this.iframe != null ? 'in_rce' : 'borderless';
37
39
  return addQueryParamsToUrl(this.context.ltiEndpoint, {
38
- display: 'in_rce',
40
+ display,
39
41
  resource_link_lookup_uuid: this.lookup_uuid,
40
42
  [PARENT_FRAME_CONTEXT_PARAM]: this.context.containingCanvasLtiToolId
41
43
  });
@@ -101,6 +101,27 @@ export default class TrayController {
101
101
  });
102
102
  }
103
103
 
104
+ requestSubtitlesFromIframe(cb) {
105
+ var _this$_audioContainer, _this$_audioContainer2;
106
+
107
+ if (!bridge.canvasOrigin) return;
108
+ this._subtitleListener = new AbortController();
109
+ window.addEventListener('message', event => {
110
+ var _event$data;
111
+
112
+ if ((event === null || event === void 0 ? void 0 : (_event$data = event.data) === null || _event$data === void 0 ? void 0 : _event$data.subject) === "media_tracks_response") {
113
+ var _event$data2;
114
+
115
+ cb(event === null || event === void 0 ? void 0 : (_event$data2 = event.data) === null || _event$data2 === void 0 ? void 0 : _event$data2.payload);
116
+ }
117
+ }, {
118
+ signal: this._subtitleListener.signal
119
+ });
120
+ (_this$_audioContainer = this._audioContainer) === null || _this$_audioContainer === void 0 ? void 0 : (_this$_audioContainer2 = _this$_audioContainer.contentWindow) === null || _this$_audioContainer2 === void 0 ? void 0 : _this$_audioContainer2.postMessage({
121
+ subject: 'media_tracks_request'
122
+ }, bridge.canvasOrigin);
123
+ }
124
+
104
125
  _renderTray(trayProps) {
105
126
  const audioOptions = asAudioElement(this._audioContainer) || {};
106
127
  const element = /*#__PURE__*/React.createElement(AudioOptionsTray, {
@@ -109,8 +130,11 @@ export default class TrayController {
109
130
  this._isOpen = true;
110
131
  },
111
132
  onExited: () => {
133
+ var _this$_subtitleListen;
134
+
112
135
  bridge.focusActiveEditor(false);
113
136
  this._isOpen = false;
137
+ (_this$_subtitleListen = this._subtitleListener) === null || _this$_subtitleListen === void 0 ? void 0 : _this$_subtitleListen.abort();
114
138
  },
115
139
  onSave: options => {
116
140
  this._applyAudioOptions(options);
@@ -119,7 +143,8 @@ export default class TrayController {
119
143
  },
120
144
  onDismiss: () => this._dismissTray(),
121
145
  open: this._shouldOpen,
122
- trayProps: trayProps
146
+ trayProps: trayProps,
147
+ requestSubtitlesFromIframe: cb => this.requestSubtitlesFromIframe(cb)
123
148
  });
124
149
  ReactDOM.render(element, this.container);
125
150
  }
@@ -15,7 +15,7 @@
15
15
  * You should have received a copy of the GNU Affero General Public License along
16
16
  * with this program. If not, see <http://www.gnu.org/licenses/>.
17
17
  */
18
- import React, { useState } from 'react';
18
+ import React, { useState, useEffect } from 'react';
19
19
  import { arrayOf, bool, func, shape, string } from 'prop-types';
20
20
  import { Flex } from '@instructure/ui-flex';
21
21
  import { Tray } from '@instructure/ui-tray';
@@ -39,9 +39,13 @@ export default function AudioOptionsTray(_ref) {
39
39
  onDismiss,
40
40
  onSave,
41
41
  trayProps,
42
- audioOptions
42
+ audioOptions,
43
+ requestSubtitlesFromIframe
43
44
  } = _ref;
44
45
  const [subtitles, setSubtitles] = useState(audioOptions.tracks || []);
46
+ useEffect(() => {
47
+ if (subtitles.length === 0) requestSubtitlesFromIframe(setSubtitles);
48
+ }, []);
45
49
 
46
50
  const handleSave = (e, contentProps) => {
47
51
  onSave({
@@ -128,6 +132,7 @@ AudioOptionsTray.propTypes = {
128
132
  onDismiss: func,
129
133
  onSave: func,
130
134
  open: bool.isRequired,
135
+ requestSubtitlesFromIframe: func,
131
136
  trayProps: shape({
132
137
  host: string.isRequired,
133
138
  jwt: string.isRequired
@@ -144,5 +149,6 @@ AudioOptionsTray.defaultProps = {
144
149
  onEntered: null,
145
150
  onExited: null,
146
151
  onDismiss: null,
147
- onSave: null
152
+ onSave: null,
153
+ requestSubtitlesFromIframe: () => {}
148
154
  };
@@ -16,8 +16,8 @@
16
16
  * with this program. If not, see <http://www.gnu.org/licenses/>.
17
17
  */
18
18
  import React, { useRef } from 'react';
19
- import { arrayOf, bool, func, objectOf, oneOf, shape, string } from 'prop-types';
20
- import { mediaObjectShape } from '../../shared/fileShape';
19
+ import { func, oneOf, shape, string } from 'prop-types';
20
+ import { contentTrayDocumentShape } from '../../shared/fileShape';
21
21
  import formatMessage from '../../../../format-message';
22
22
  import { Text } from '@instructure/ui-text';
23
23
  import { View } from '@instructure/ui-view';
@@ -114,13 +114,7 @@ MediaPanel.propTypes = {
114
114
  fetchInitialMedia: func.isRequired,
115
115
  fetchNextMedia: func.isRequired,
116
116
  onMediaEmbed: func.isRequired,
117
- media: objectOf(shape({
118
- files: arrayOf(shape(mediaObjectShape)).isRequired,
119
- bookmark: string,
120
- hasMore: bool,
121
- isLoading: bool,
122
- error: string
123
- })).isRequired,
117
+ media: contentTrayDocumentShape.isRequired,
124
118
  sortBy: shape({
125
119
  sort: oneOf(['date_added', 'alphabetical']).isRequired,
126
120
  order: oneOf(['asc', 'desc']).isRequired