@instructure/canvas-rce 7.3.1 → 8.1.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 (155) hide show
  1. package/CHANGELOG.md +70 -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/enhance_user_content.js +6 -8
  10. package/es/enhance-user-content/index.d.ts +3 -1
  11. package/es/enhance-user-content/index.js +3 -1
  12. package/es/enhance-user-content/youtube_overlay.js +18 -0
  13. package/es/getThemeVars.d.ts +1 -1
  14. package/es/getThemeVars.js +23 -26
  15. package/es/rce/KeyboardShortcutModal.js +1 -1
  16. package/es/rce/RCE.d.ts +9 -0
  17. package/es/rce/RCE.js +4 -0
  18. package/es/rce/RCEGlobals.d.ts +2 -0
  19. package/es/rce/RCEGlobals.js +1 -0
  20. package/es/rce/RCEVariants.d.ts +1 -2
  21. package/es/rce/RCEVariants.js +1 -2
  22. package/es/rce/RCEWrapper.d.ts +6 -16
  23. package/es/rce/RCEWrapper.js +18 -87
  24. package/es/rce/RCEWrapper.utils.d.ts +1 -1
  25. package/es/rce/RCEWrapperProps.d.ts +2 -1
  26. package/es/rce/RCEWrapperProps.js +2 -1
  27. package/es/rce/StatusBar.d.ts +0 -1
  28. package/es/rce/StatusBar.js +3 -28
  29. package/es/rce/plugins/instructure_equation/EquationEditorModal/advancedOnlySyntax.d.ts +2 -1
  30. package/es/rce/plugins/instructure_equation/EquationEditorModal/advancedOnlySyntax.js +3 -1
  31. package/es/rce/plugins/instructure_equation/EquationEditorModal/index.d.ts +1 -0
  32. package/es/rce/plugins/instructure_equation/EquationEditorModal/index.js +12 -2
  33. package/es/rce/plugins/instructure_icon_maker/components/CreateIconMakerForm/ImageSection/ImageOptions.js +2 -2
  34. package/es/rce/plugins/instructure_icon_maker/components/CreateIconMakerForm/ImageSection/ImageSection.js +3 -3
  35. package/es/rce/plugins/instructure_icon_maker/svg/constants.d.ts +20 -5
  36. package/es/rce/plugins/instructure_icon_maker/svg/utils.d.ts +1 -1
  37. package/es/rce/plugins/instructure_icon_maker/utils/IconMakerFormHasChanges.js +2 -2
  38. package/es/rce/plugins/instructure_image/ImageEmbedOptions.d.ts +0 -2
  39. package/es/rce/plugins/instructure_image/ImageEmbedOptions.js +2 -9
  40. package/es/rce/plugins/instructure_paste/plugin.js +18 -12
  41. package/es/rce/plugins/instructure_rce_external_tools/components/ExternalToolDialog/ExternalToolDialogModal.d.ts +1 -1
  42. package/es/rce/plugins/instructure_rce_external_tools/components/util/ToolLaunchIframe.d.ts +4 -0
  43. package/es/rce/plugins/instructure_rce_external_tools/components/util/ToolLaunchIframe.js +4 -0
  44. package/es/rce/plugins/instructure_record/AudioOptionsTray/TrayController.d.ts +11 -2
  45. package/es/rce/plugins/instructure_record/AudioOptionsTray/TrayController.js +92 -10
  46. package/es/rce/plugins/instructure_record/AudioOptionsTray/index.d.ts +13 -1
  47. package/es/rce/plugins/instructure_record/AudioOptionsTray/index.js +216 -24
  48. package/es/rce/plugins/instructure_record/MediaPanel/index.js +16 -5
  49. package/es/rce/plugins/instructure_record/VideoOptionsTray/TrayController.d.ts +14 -13
  50. package/es/rce/plugins/instructure_record/VideoOptionsTray/TrayController.js +110 -39
  51. package/es/rce/plugins/instructure_record/VideoOptionsTray/index.d.ts +11 -1
  52. package/es/rce/plugins/instructure_record/VideoOptionsTray/index.js +242 -67
  53. package/es/rce/plugins/instructure_record/clickCallback.js +19 -4
  54. package/es/rce/plugins/instructure_record/mediaTranslations.js +1 -1
  55. package/es/rce/plugins/instructure_record/playerLayoutOptions.d.ts +25 -0
  56. package/es/rce/plugins/instructure_record/playerLayoutOptions.js +91 -0
  57. package/es/rce/plugins/instructure_record/plugin.js +2 -5
  58. package/es/rce/plugins/instructure_record/utils.d.ts +3 -0
  59. package/es/rce/plugins/instructure_record/utils.js +31 -0
  60. package/es/rce/plugins/instructure_studio_media_options/plugin.js +82 -26
  61. package/es/rce/plugins/shared/ContentSelection.d.ts +6 -1
  62. package/es/rce/plugins/shared/ContentSelection.js +15 -6
  63. package/es/rce/plugins/shared/DimensionsInput/DimensionInput.js +1 -2
  64. package/es/rce/plugins/shared/DimensionsInput/index.js +11 -12
  65. package/es/rce/plugins/shared/DimensionsInput/useDimensionsState.d.ts +1 -1
  66. package/es/rce/plugins/shared/DimensionsInput/useDimensionsState.js +4 -3
  67. package/es/rce/plugins/shared/StudioLtiSupportUtils.d.ts +27 -6
  68. package/es/rce/plugins/shared/StudioLtiSupportUtils.js +82 -13
  69. package/es/rce/plugins/shared/Upload/UploadFile.js +1 -8
  70. package/es/rce/style.d.ts +2 -1
  71. package/es/rce/style.js +4 -2
  72. package/es/rcs/api.d.ts +5 -10
  73. package/es/rcs/api.js +15 -21
  74. package/es/rcs/fake.d.ts +1 -7
  75. package/es/rcs/fake.js +1 -47
  76. package/es/sidebar/actions/media.d.ts +19 -6
  77. package/es/sidebar/actions/media.js +17 -4
  78. package/es/sidebar/actions/upload.d.ts +3 -3
  79. package/es/sidebar/actions/upload.js +9 -9
  80. package/es/sidebar/containers/Sidebar.js +0 -2
  81. package/es/sidebar/containers/sidebarHandlers.d.ts +2 -4
  82. package/es/sidebar/containers/sidebarHandlers.js +2 -5
  83. package/es/sidebar/reducers/index.d.ts +0 -1
  84. package/es/sidebar/reducers/index.js +0 -2
  85. package/es/sidebar/store/initialState.d.ts +0 -1
  86. package/es/sidebar/store/initialState.js +0 -5
  87. package/es/translations/locales/ar.js +65 -80
  88. package/es/translations/locales/ca.js +65 -80
  89. package/es/translations/locales/cy.js +65 -80
  90. package/es/translations/locales/da-x-k12.js +65 -80
  91. package/es/translations/locales/da.js +65 -80
  92. package/es/translations/locales/de.js +65 -80
  93. package/es/translations/locales/el.js +0 -9
  94. package/es/translations/locales/en-AU-x-unimelb.js +65 -80
  95. package/es/translations/locales/en-GB-x-ukhe.js +65 -80
  96. package/es/translations/locales/en.js +61 -79
  97. package/es/translations/locales/en_AU.js +65 -80
  98. package/es/translations/locales/en_CA.js +65 -80
  99. package/es/translations/locales/en_CY.js +65 -80
  100. package/es/translations/locales/en_GB.js +65 -80
  101. package/es/translations/locales/es.js +65 -80
  102. package/es/translations/locales/es_ES.js +65 -80
  103. package/es/translations/locales/fa_IR.js +0 -9
  104. package/es/translations/locales/fi.js +65 -80
  105. package/es/translations/locales/fr.js +65 -80
  106. package/es/translations/locales/fr_CA.js +65 -80
  107. package/es/translations/locales/ga.js +65 -80
  108. package/es/translations/locales/he.js +0 -9
  109. package/es/translations/locales/hi.js +65 -80
  110. package/es/translations/locales/ht.js +65 -80
  111. package/es/translations/locales/hu.js +0 -36
  112. package/es/translations/locales/hy.js +0 -9
  113. package/es/translations/locales/id.js +65 -80
  114. package/es/translations/locales/is.js +65 -80
  115. package/es/translations/locales/it.js +65 -80
  116. package/es/translations/locales/ja.js +65 -80
  117. package/es/translations/locales/ko.js +2455 -133
  118. package/es/translations/locales/mi.js +65 -80
  119. package/es/translations/locales/ms.js +65 -80
  120. package/es/translations/locales/nb-x-k12.js +65 -80
  121. package/es/translations/locales/nb.js +65 -80
  122. package/es/translations/locales/nl.js +66 -81
  123. package/es/translations/locales/nn.js +0 -36
  124. package/es/translations/locales/pl.js +65 -80
  125. package/es/translations/locales/pt.js +65 -80
  126. package/es/translations/locales/pt_BR.js +65 -80
  127. package/es/translations/locales/ru.js +65 -80
  128. package/es/translations/locales/sl.js +65 -80
  129. package/es/translations/locales/sv-x-k12.js +65 -80
  130. package/es/translations/locales/sv.js +65 -80
  131. package/es/translations/locales/th.js +65 -80
  132. package/es/translations/locales/tr.js +1962 -18
  133. package/es/translations/locales/uk_UA.js +0 -9
  134. package/es/translations/locales/vi.js +65 -80
  135. package/es/translations/locales/zh-Hans.js +65 -80
  136. package/es/translations/locales/zh-Hant.js +65 -80
  137. package/es/translations/locales/zh.js +65 -80
  138. package/es/translations/locales/zh_HK.js +65 -80
  139. package/eslint.config.js +16 -147
  140. package/jest/jest-setup.js +1 -0
  141. package/jest.config.js +2 -0
  142. package/oxlint.json +84 -0
  143. package/package.json +87 -62
  144. package/tsconfig.json +3 -2
  145. package/es/rce/plugins/shared/ai_tools/AIResponseModal.d.ts +0 -10
  146. package/es/rce/plugins/shared/ai_tools/AIResponseModal.js +0 -67
  147. package/es/rce/plugins/shared/ai_tools/AIToolsTray.d.ts +0 -18
  148. package/es/rce/plugins/shared/ai_tools/AIToolsTray.js +0 -489
  149. package/es/rce/plugins/shared/ai_tools/aiicons.d.ts +0 -7
  150. package/es/rce/plugins/shared/ai_tools/aiicons.js +0 -60
  151. package/es/rce/plugins/shared/ai_tools/index.d.ts +0 -3
  152. package/es/sidebar/actions/flickr.d.ts +0 -20
  153. package/es/sidebar/actions/flickr.js +0 -60
  154. package/es/sidebar/reducers/flickr.d.ts +0 -1
  155. package/es/sidebar/reducers/flickr.js +0 -49
package/oxlint.json ADDED
@@ -0,0 +1,84 @@
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/oxc-project/oxc/main/npm/oxlint/configuration_schema.json",
3
+ "plugins": ["react", "jsx_a11y", "import", "promise", "typescript"],
4
+ "jsPlugins": ["../../config/canvas-copyright.js"],
5
+ "env": {
6
+ "browser": true,
7
+ "node": true
8
+ },
9
+ "ignorePatterns": [
10
+ "es/**/*",
11
+ "**/translations/**/*",
12
+ "**/node_modules/**"
13
+ ],
14
+ "rules": {
15
+ "no-console": "warn",
16
+ "no-undef": "warn",
17
+ "no-constant-binary-expression": "warn",
18
+ "no-dupe-class-members": "warn",
19
+ "no-dupe-keys": "warn",
20
+ "no-import-assign": "warn",
21
+ "no-loss-of-precision": "warn",
22
+ "no-prototype-builtins": "off",
23
+ "no-unexpected-multiline": "warn",
24
+ "no-unsafe-optional-chaining": "warn",
25
+ "no-unused-expressions": "off",
26
+ "no-unused-vars": "off",
27
+ "no-unused-private-class-members": "warn",
28
+ "no-useless-escape": "warn",
29
+ "prefer-const": "warn",
30
+ "no-redeclare": "warn",
31
+ "typescript/ban-ts-comment": "off",
32
+ "typescript/no-unused-vars": ["warn", {
33
+ "args": "all",
34
+ "argsIgnorePattern": "^_",
35
+ "caughtErrors": "all",
36
+ "caughtErrorsIgnorePattern": "^_",
37
+ "destructuredArrayIgnorePattern": "^_",
38
+ "varsIgnorePattern": "^_",
39
+ "ignoreRestSiblings": true
40
+ }],
41
+ "typescript/no-this-alias": "off",
42
+ "typescript/no-explicit-any": "off",
43
+ "typescript/no-unused-expressions": "warn",
44
+ "typescript/no-empty-object-type": "warn",
45
+ "typescript/no-unsafe-function-type": "warn",
46
+ "typescript/no-require-imports": "off",
47
+ "typescript/no-wrapper-object-types": "warn",
48
+ "typescript/no-non-null-asserted-optional-chain": "warn",
49
+ "react/jsx-key": "warn",
50
+ "react/no-string-refs": "warn",
51
+ "react/no-find-dom-node": "warn",
52
+ "react/jsx-no-target-blank": "warn",
53
+ "react/no-unknown-property": "warn",
54
+ "react/rules-of-hooks": "warn",
55
+ "react/exhaustive-deps": "warn",
56
+ "jsx_a11y/role-has-required-aria-props": "warn",
57
+ "jsx_a11y/no-autofocus": "warn",
58
+ "import/no-dynamic-require": "warn",
59
+ "import/no-nodejs-modules": "warn",
60
+ "promise/always-return": "off",
61
+ "promise/catch-or-return": "off"
62
+ },
63
+ "overrides": [
64
+ {
65
+ "files": ["src/**/*.{js,mjs,ts,jsx,tsx}"],
66
+ "rules": {
67
+ "canvas-copyright/notice": "error"
68
+ }
69
+ },
70
+ {
71
+ "files": [
72
+ "**/__tests__/**",
73
+ "src/**/__tests__/**",
74
+ "src/rce/plugins/tinymce-a11y-checker/rules/__mocks__/index.js"
75
+ ],
76
+ "plugins": ["jest"],
77
+ "rules": {
78
+ "jest/no-disabled-tests": "warn",
79
+ "jest/no-focused-tests": "error",
80
+ "jest/valid-expect": "error"
81
+ }
82
+ }
83
+ ]
84
+ }
package/package.json CHANGED
@@ -1,9 +1,27 @@
1
1
  {
2
2
  "name": "@instructure/canvas-rce",
3
- "version": "7.3.1",
3
+ "version": "8.1.0",
4
4
  "description": "A component wrapping Canvas's usage of Tinymce",
5
5
  "main": "es/index.js",
6
6
  "types": "es/index.d.ts",
7
+ "typesVersions": {
8
+ "*": {
9
+ "enhance-user-content": [
10
+ "./es/enhance-user-content/index.d.ts"
11
+ ]
12
+ }
13
+ },
14
+ "exports": {
15
+ ".": {
16
+ "types": "./es/index.d.ts",
17
+ "default": "./es/index.js"
18
+ },
19
+ "./enhance-user-content": {
20
+ "types": "./es/enhance-user-content/index.d.ts",
21
+ "default": "./es/enhance-user-content/index.js"
22
+ },
23
+ "./*": "./*"
24
+ },
7
25
  "owner": "RCX",
8
26
  "scripts": {
9
27
  "i18n:extract": "format-message extract \"es/**/*.js\" -g underscored_crc32 -o locales/en.json",
@@ -45,87 +63,94 @@
45
63
  ],
46
64
  "author": "Instructure, Inc",
47
65
  "license": "AGPL-3.0",
48
- "browserslist": ["extends @instructure/browserslist-config-canvas-lms"],
66
+ "browserslist": [
67
+ "extends @instructure/browserslist-config-canvas-lms"
68
+ ],
49
69
  "nyc": {
50
- "include": ["shared/**/*.js", "src/**/*.js"],
70
+ "include": [
71
+ "shared/**/*.js",
72
+ "src/**/*.js"
73
+ ],
51
74
  "exclude": [],
52
- "require": ["@babel/register", "@instructure/canvas-theme"],
75
+ "require": [
76
+ "@babel/register",
77
+ "@instructure/canvas-theme"
78
+ ],
53
79
  "sourceMap": false,
54
80
  "instrument": false
55
81
  },
56
82
  "dependencies": {
57
- "@instructure/canvas-theme": "10.26.2",
83
+ "@instructure/canvas-theme": "11.6.0",
58
84
  "@instructure/canvas-media": "*",
59
- "@instructure/debounce": "10.26.2",
60
- "@instructure/emotion": "10.26.2",
85
+ "@instructure/debounce": "11.6.0",
86
+ "@instructure/emotion": "11.6.0",
61
87
  "@instructure/k5uploader": "*",
62
- "@instructure/media-capture": "^9.0.0",
63
- "@instructure/theme-registry": "10.26.2",
64
- "@instructure/ui-a11y-content": "10.26.2",
65
- "@instructure/ui-a11y-utils": "10.26.2",
66
- "@instructure/ui-alerts": "10.26.2",
67
- "@instructure/ui-avatar": "10.26.2",
68
- "@instructure/ui-badge": "10.26.2",
69
- "@instructure/ui-billboard": "10.26.2",
70
- "@instructure/ui-buttons": "10.26.2",
71
- "@instructure/ui-checkbox": "10.26.2",
72
- "@instructure/ui-source-code-editor": "10.26.2",
73
- "@instructure/ui-color-picker": "10.26.2",
74
- "@instructure/ui-color-utils": "10.26.2",
75
- "@instructure/ui-file-drop": "10.26.2",
76
- "@instructure/ui-flex": "10.26.2",
77
- "@instructure/ui-focusable": "10.26.2",
78
- "@instructure/ui-form-field": "10.26.2",
79
- "@instructure/ui-grid": "10.26.2",
80
- "@instructure/ui-heading": "10.26.2",
81
- "@instructure/ui-icons": "10.26.2",
82
- "@instructure/ui-img": "10.26.2",
83
- "@instructure/ui-link": "10.26.2",
84
- "@instructure/ui-list": "10.26.2",
85
- "@instructure/ui-media-player": "^9.0.0",
86
- "@instructure/ui-menu": "10.26.2",
87
- "@instructure/ui-modal": "10.26.2",
88
- "@instructure/ui-motion": "10.26.2",
89
- "@instructure/ui-number-input": "10.26.2",
90
- "@instructure/ui-overlays": "10.26.2",
91
- "@instructure/ui-pagination": "10.26.2",
92
- "@instructure/ui-pill": "10.26.2",
93
- "@instructure/ui-popover": "10.26.2",
94
- "@instructure/ui-radio-input": "10.26.2",
95
- "@instructure/ui-simple-select": "10.26.2",
96
- "@instructure/ui-spinner": "10.26.2",
97
- "@instructure/ui-svg-images": "10.26.2",
98
- "@instructure/ui-table": "10.26.2",
99
- "@instructure/ui-tabs": "10.26.2",
100
- "@instructure/ui-text-area": "10.26.2",
101
- "@instructure/ui-text-input": "10.26.2",
102
- "@instructure/ui-text": "10.26.2",
103
- "@instructure/ui-themes": "10.26.2",
104
- "@instructure/ui-toggle-details": "10.26.2",
105
- "@instructure/ui-tooltip": "10.26.2",
106
- "@instructure/ui-tray": "10.26.2",
107
- "@instructure/ui-tree-browser": "10.26.2",
108
- "@instructure/ui-truncate-text": "10.26.2",
109
- "@instructure/ui-utils": "10.26.2",
110
- "@instructure/ui-view": "10.26.2",
111
- "@instructure/uid": "10.26.2",
88
+ "@instructure/media-capture": "12.0.0",
89
+ "@instructure/ui-a11y-content": "11.6.0",
90
+ "@instructure/ui-a11y-utils": "11.6.0",
91
+ "@instructure/ui-alerts": "11.6.0",
92
+ "@instructure/ui-avatar": "11.6.0",
93
+ "@instructure/ui-badge": "11.6.0",
94
+ "@instructure/ui-billboard": "11.6.0",
95
+ "@instructure/ui-buttons": "11.6.0",
96
+ "@instructure/ui-checkbox": "11.6.0",
97
+ "@instructure/ui-source-code-editor": "11.6.0",
98
+ "@instructure/ui-color-picker": "11.6.0",
99
+ "@instructure/ui-color-utils": "11.6.0",
100
+ "@instructure/ui-file-drop": "11.6.0",
101
+ "@instructure/ui-flex": "11.6.0",
102
+ "@instructure/ui-focusable": "11.6.0",
103
+ "@instructure/ui-form-field": "11.6.0",
104
+ "@instructure/ui-grid": "11.6.0",
105
+ "@instructure/ui-heading": "11.6.0",
106
+ "@instructure/ui-icons": "11.6.0",
107
+ "@instructure/ui-img": "11.6.0",
108
+ "@instructure/ui-link": "11.6.0",
109
+ "@instructure/ui-list": "11.6.0",
110
+ "@instructure/ui-media-player": "12.0.0",
111
+ "@instructure/ui-menu": "11.6.0",
112
+ "@instructure/ui-modal": "11.6.0",
113
+ "@instructure/ui-motion": "11.6.0",
114
+ "@instructure/ui-number-input": "11.6.0",
115
+ "@instructure/ui-overlays": "11.6.0",
116
+ "@instructure/ui-pagination": "11.6.0",
117
+ "@instructure/ui-pill": "11.6.0",
118
+ "@instructure/ui-popover": "11.6.0",
119
+ "@instructure/ui-radio-input": "11.6.0",
120
+ "@instructure/ui-simple-select": "11.6.0",
121
+ "@instructure/ui-spinner": "11.6.0",
122
+ "@instructure/ui-svg-images": "11.6.0",
123
+ "@instructure/ui-table": "11.6.0",
124
+ "@instructure/ui-tabs": "11.6.0",
125
+ "@instructure/ui-text-area": "11.6.0",
126
+ "@instructure/ui-text-input": "11.6.0",
127
+ "@instructure/ui-text": "11.6.0",
128
+ "@instructure/ui-themes": "11.6.0",
129
+ "@instructure/ui-toggle-details": "11.6.0",
130
+ "@instructure/ui-tooltip": "11.6.0",
131
+ "@instructure/ui-tray": "11.6.0",
132
+ "@instructure/ui-tree-browser": "11.6.0",
133
+ "@instructure/ui-truncate-text": "11.6.0",
134
+ "@instructure/ui-utils": "11.6.0",
135
+ "@instructure/ui-view": "11.6.0",
136
+ "@instructure/uid": "11.6.0",
112
137
  "@sheerun/mutationobserver-shim": "^0.3.2",
113
138
  "@types/tinycolor2": "^1.4.6",
114
139
  "@tinymce/tinymce-react": "~3.8.4",
115
140
  "aphrodite": "^2",
116
- "axios": "^0.30.0",
141
+ "axios": "^1.15.0",
117
142
  "bloody-offset": "0.0.0",
118
143
  "crypto-es": "^2.1.0",
119
144
  "classnames": "^2.2.5",
145
+ "es-toolkit": "^1.42.0",
120
146
  "format-message": "^6",
121
147
  "format-message-generate-id": "^6",
122
148
  "i18n-js": "^3",
123
149
  "isomorphic-fetch": "2.2.1",
124
- "js-beautify": "1.14.9",
150
+ "js-beautify": "1.15.4",
125
151
  "keycode": "^2",
126
- "lodash": "^4",
127
152
  "mathlive": "^0.77.0",
128
- "minimatch": "~3.0.4",
153
+ "minimatch": "^10.2.3",
129
154
  "moment-timezone": "^0.5.45",
130
155
  "prop-types": "^15",
131
156
  "psl": "^1.1.0",
@@ -179,7 +204,7 @@
179
204
  "jest-canvas-mock": "^2",
180
205
  "jest-junit": "^7",
181
206
  "jest-mock-proxy": "3.1.2",
182
- "jest": "^28",
207
+ "jest": "^29",
183
208
  "mathjax": "^3.2.0",
184
209
  "msw": "^2.7",
185
210
  "nyc": "^13",
package/tsconfig.json CHANGED
@@ -4,9 +4,9 @@
4
4
  "esModuleInterop": true,
5
5
  "isolatedModules": true,
6
6
  "jsx": "react",
7
- "lib": ["dom", "es2020", "esnext"],
7
+ "lib": ["dom", "dom.iterable", "es2020", "esnext"],
8
8
  "module": "ES2020",
9
- "moduleResolution": "node",
9
+ "moduleResolution": "bundler",
10
10
  "declaration": true,
11
11
  "declarationDir": "es",
12
12
  "emitDeclarationOnly": true,
@@ -19,6 +19,7 @@
19
19
  "composite": true,
20
20
  "rootDir": "src",
21
21
  "verbatimModuleSyntax": false,
22
+ "types": ["node"],
22
23
  "paths": {
23
24
  "@instructure/*": ["../packages/*"]
24
25
  }
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- type AIResponseModaProps = {
3
- open: boolean;
4
- html: string;
5
- onClose: () => void;
6
- onInsert: () => void;
7
- onReplace: () => void;
8
- };
9
- declare const AIResponseModal: ({ open, html, onClose, onInsert, onReplace }: AIResponseModaProps) => React.JSX.Element;
10
- export { AIResponseModal };
@@ -1,67 +0,0 @@
1
- import _pt from "prop-types";
2
- /*
3
- * Copyright (C) 2024 - 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
-
20
- import React from 'react';
21
- import formatMessage from '../../../../format-message';
22
- import { Button, CloseButton } from '@instructure/ui-buttons';
23
- import { Heading } from '@instructure/ui-heading';
24
- import { Modal } from '@instructure/ui-modal';
25
- const AIResponseModal = ({
26
- open,
27
- html,
28
- onClose,
29
- onInsert,
30
- onReplace
31
- }) => {
32
- return /*#__PURE__*/React.createElement(Modal, {
33
- open: open,
34
- onDismiss: onClose,
35
- size: "medium",
36
- label: formatMessage('AI Response')
37
- }, /*#__PURE__*/React.createElement(Modal.Header, null, /*#__PURE__*/React.createElement(CloseButton, {
38
- onClick: onClose,
39
- placement: "end",
40
- offset: "medium",
41
- screenReaderLabel: formatMessage('Close')
42
- }), /*#__PURE__*/React.createElement(Heading, {
43
- level: "h3"
44
- }, "AI Response")), /*#__PURE__*/React.createElement(Modal.Body, null, /*#__PURE__*/React.createElement("div", {
45
- dangerouslySetInnerHTML: {
46
- __html: html
47
- }
48
- })), /*#__PURE__*/React.createElement(Modal.Footer, null, /*#__PURE__*/React.createElement(Button, {
49
- onClick: onClose,
50
- margin: "medium 0 0 0"
51
- }, formatMessage('Close')), /*#__PURE__*/React.createElement(Button, {
52
- onClick: onReplace,
53
- margin: "medium 0 0 medium"
54
- }, formatMessage('Replace')), /*#__PURE__*/React.createElement(Button, {
55
- onClick: onInsert,
56
- color: "primary",
57
- margin: "medium 0 0 medium"
58
- }, formatMessage('Insert'))));
59
- };
60
- AIResponseModal.propTypes = {
61
- open: _pt.bool.isRequired,
62
- html: _pt.string.isRequired,
63
- onClose: _pt.func.isRequired,
64
- onInsert: _pt.func.isRequired,
65
- onReplace: _pt.func.isRequired
66
- };
67
- export { AIResponseModal };
@@ -1,18 +0,0 @@
1
- import React from 'react';
2
- type AIToolsTrayContent = {
3
- type: 'selection' | 'full';
4
- content: string;
5
- };
6
- type AIToolsTrayProps = {
7
- open: boolean;
8
- container: HTMLElement;
9
- mountNode: HTMLElement;
10
- contextId: string;
11
- contextType: string;
12
- currentContent: AIToolsTrayContent;
13
- onClose: () => void;
14
- onInsertContent: (content: string) => void;
15
- onReplaceContent: (content: string) => void;
16
- };
17
- export declare const AIToolsTray: ({ open, container, mountNode, contextId, contextType, currentContent, onClose, onInsertContent, onReplaceContent, }: AIToolsTrayProps) => React.JSX.Element;
18
- export {};