@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.
- package/CHANGELOG.md +79 -0
- package/{es/rce/plugins/shared/ai_tools/index.js → __mocks__/@instructure/ui-media-player/_mockUiMediaPlayer.js} +4 -4
- package/__tests__/common/mimeClass.test.js +25 -1
- package/__tests__/rcs/api.test.js +280 -251
- package/es/canvasFileBrowser/FileBrowser.d.ts +2 -2
- package/es/canvasFileBrowser/FileBrowser.js +8 -7
- package/es/common/mimeClass.js +3 -1
- package/es/defaultTinymceConfig.js +47 -49
- package/es/enhance-user-content/doc_previews.js +5 -0
- package/es/enhance-user-content/enhance_user_content.js +6 -8
- package/es/enhance-user-content/index.d.ts +3 -1
- package/es/enhance-user-content/index.js +3 -1
- package/es/enhance-user-content/instructure_helper.js +1 -0
- package/es/enhance-user-content/youtube_overlay.js +18 -0
- package/es/getThemeVars.d.ts +1 -1
- package/es/getThemeVars.js +23 -26
- package/es/rce/AlertMessageArea.d.ts +2 -2
- package/es/rce/AlertMessageArea.js +3 -3
- package/es/rce/KeyboardShortcutModal.js +2 -2
- package/es/rce/RCE.d.ts +9 -0
- package/es/rce/RCE.js +4 -0
- package/es/rce/RCEGlobals.d.ts +2 -0
- package/es/rce/RCEGlobals.js +1 -0
- package/es/rce/RCEVariants.d.ts +1 -2
- package/es/rce/RCEVariants.js +1 -2
- package/es/rce/RCEWrapper.d.ts +16 -26
- package/es/rce/RCEWrapper.js +227 -271
- package/es/rce/RCEWrapper.utils.d.ts +1 -1
- package/es/rce/RCEWrapperProps.d.ts +2 -1
- package/es/rce/RCEWrapperProps.js +2 -1
- package/es/rce/StatusBar.d.ts +0 -1
- package/es/rce/StatusBar.js +3 -28
- package/es/rce/plugins/instructure_equation/EquationEditorModal/advancedOnlySyntax.d.ts +2 -1
- package/es/rce/plugins/instructure_equation/EquationEditorModal/advancedOnlySyntax.js +3 -1
- package/es/rce/plugins/instructure_equation/EquationEditorModal/index.d.ts +1 -0
- package/es/rce/plugins/instructure_equation/EquationEditorModal/index.js +12 -2
- package/es/rce/plugins/instructure_icon_maker/components/CreateIconMakerForm/ImageSection/ImageOptions.js +2 -2
- package/es/rce/plugins/instructure_icon_maker/components/CreateIconMakerForm/ImageSection/ImageSection.js +3 -3
- package/es/rce/plugins/instructure_icon_maker/svg/constants.d.ts +20 -5
- package/es/rce/plugins/instructure_icon_maker/svg/utils.d.ts +1 -1
- package/es/rce/plugins/instructure_icon_maker/utils/IconMakerFormHasChanges.js +2 -2
- package/es/rce/plugins/instructure_image/ImageEmbedOptions.d.ts +0 -2
- package/es/rce/plugins/instructure_image/ImageEmbedOptions.js +2 -9
- package/es/rce/plugins/instructure_paste/plugin.js +18 -12
- package/es/rce/plugins/instructure_rce_external_tools/components/ExternalToolDialog/ExternalToolDialogModal.d.ts +1 -1
- package/es/rce/plugins/instructure_rce_external_tools/components/ExternalToolSelectionDialog/ExternalToolSelectionDialog.d.ts +1 -1
- package/es/rce/plugins/instructure_rce_external_tools/components/ExternalToolSelectionDialog/ExternalToolSelectionDialog.js +25 -25
- package/es/rce/plugins/instructure_rce_external_tools/components/util/ToolLaunchIframe.d.ts +4 -0
- package/es/rce/plugins/instructure_rce_external_tools/components/util/ToolLaunchIframe.js +4 -0
- package/es/rce/plugins/instructure_record/AudioOptionsTray/TrayController.d.ts +11 -2
- package/es/rce/plugins/instructure_record/AudioOptionsTray/TrayController.js +92 -10
- package/es/rce/plugins/instructure_record/AudioOptionsTray/index.d.ts +13 -1
- package/es/rce/plugins/instructure_record/AudioOptionsTray/index.js +216 -24
- package/es/rce/plugins/instructure_record/MediaPanel/index.js +16 -5
- package/es/rce/plugins/instructure_record/VideoOptionsTray/TrayController.d.ts +14 -13
- package/es/rce/plugins/instructure_record/VideoOptionsTray/TrayController.js +110 -39
- package/es/rce/plugins/instructure_record/VideoOptionsTray/index.d.ts +11 -1
- package/es/rce/plugins/instructure_record/VideoOptionsTray/index.js +242 -67
- package/es/rce/plugins/instructure_record/clickCallback.js +19 -4
- package/es/rce/plugins/instructure_record/mediaTranslations.js +1 -1
- package/es/rce/plugins/instructure_record/playerLayoutOptions.d.ts +25 -0
- package/es/rce/plugins/instructure_record/playerLayoutOptions.js +91 -0
- package/es/rce/plugins/instructure_record/plugin.js +2 -5
- package/es/rce/plugins/instructure_record/utils.d.ts +3 -0
- package/es/rce/plugins/instructure_record/utils.js +31 -0
- package/es/rce/plugins/instructure_studio_media_options/plugin.js +82 -24
- package/es/rce/plugins/instructure_wordcount/components/WordCountModal.js +1 -0
- package/es/rce/plugins/shared/ContentSelection.d.ts +6 -1
- package/es/rce/plugins/shared/ContentSelection.js +15 -6
- package/es/rce/plugins/shared/DimensionsInput/DimensionInput.js +1 -2
- package/es/rce/plugins/shared/DimensionsInput/index.js +11 -12
- package/es/rce/plugins/shared/DimensionsInput/useDimensionsState.d.ts +1 -1
- package/es/rce/plugins/shared/DimensionsInput/useDimensionsState.js +4 -3
- package/es/rce/plugins/shared/StudioLtiSupportUtils.d.ts +27 -5
- package/es/rce/plugins/shared/StudioLtiSupportUtils.js +94 -9
- package/es/rce/plugins/shared/Upload/UploadFile.js +1 -8
- package/es/rce/style.d.ts +2 -1
- package/es/rce/style.js +4 -2
- package/es/rcs/api.d.ts +5 -10
- package/es/rcs/api.js +15 -21
- package/es/rcs/fake.d.ts +1 -7
- package/es/rcs/fake.js +1 -47
- package/es/sidebar/actions/media.d.ts +19 -6
- package/es/sidebar/actions/media.js +17 -4
- package/es/sidebar/actions/upload.d.ts +3 -3
- package/es/sidebar/actions/upload.js +9 -9
- package/es/sidebar/containers/Sidebar.js +0 -2
- package/es/sidebar/containers/sidebarHandlers.d.ts +2 -4
- package/es/sidebar/containers/sidebarHandlers.js +2 -5
- package/es/sidebar/reducers/index.d.ts +0 -1
- package/es/sidebar/reducers/index.js +0 -2
- package/es/sidebar/store/initialState.d.ts +0 -1
- package/es/sidebar/store/initialState.js +0 -5
- package/es/translations/locales/ar.js +77 -77
- package/es/translations/locales/ca.js +77 -77
- package/es/translations/locales/cy.js +77 -77
- package/es/translations/locales/da-x-k12.js +77 -77
- package/es/translations/locales/da.js +77 -77
- package/es/translations/locales/de.js +77 -77
- package/es/translations/locales/el.js +0 -9
- package/es/translations/locales/en-AU-x-unimelb.js +77 -77
- package/es/translations/locales/en-GB-x-ukhe.js +77 -77
- package/es/translations/locales/en.js +67 -79
- package/es/translations/locales/en_AU.js +77 -77
- package/es/translations/locales/en_CA.js +77 -77
- package/es/translations/locales/en_CY.js +77 -77
- package/es/translations/locales/en_GB.js +77 -77
- package/es/translations/locales/es.js +77 -77
- package/es/translations/locales/es_ES.js +77 -77
- package/es/translations/locales/fa_IR.js +0 -9
- package/es/translations/locales/fi.js +77 -77
- package/es/translations/locales/fr.js +77 -77
- package/es/translations/locales/fr_CA.js +77 -77
- package/es/translations/locales/ga.js +77 -77
- package/es/translations/locales/he.js +0 -9
- package/es/translations/locales/hi.js +77 -77
- package/es/translations/locales/ht.js +77 -77
- package/es/translations/locales/hu.js +0 -36
- package/es/translations/locales/hy.js +0 -9
- package/es/translations/locales/id.js +77 -77
- package/es/translations/locales/is.js +77 -77
- package/es/translations/locales/it.js +77 -77
- package/es/translations/locales/ja.js +77 -77
- package/es/translations/locales/ko.js +2455 -133
- package/es/translations/locales/mi.js +77 -77
- package/es/translations/locales/ms.js +77 -77
- package/es/translations/locales/nb-x-k12.js +77 -77
- package/es/translations/locales/nb.js +77 -77
- package/es/translations/locales/nl.js +78 -78
- package/es/translations/locales/nn.js +0 -36
- package/es/translations/locales/pl.js +77 -77
- package/es/translations/locales/pt.js +77 -77
- package/es/translations/locales/pt_BR.js +77 -77
- package/es/translations/locales/ru.js +77 -77
- package/es/translations/locales/sl.js +77 -77
- package/es/translations/locales/sv-x-k12.js +77 -77
- package/es/translations/locales/sv.js +77 -77
- package/es/translations/locales/th.js +77 -77
- package/es/translations/locales/tr.js +1962 -18
- package/es/translations/locales/uk_UA.js +0 -9
- package/es/translations/locales/vi.js +77 -77
- package/es/translations/locales/zh-Hans.js +77 -77
- package/es/translations/locales/zh-Hant.js +77 -77
- package/es/translations/locales/zh.js +77 -77
- package/es/translations/locales/zh_HK.js +77 -77
- package/eslint.config.js +16 -147
- package/jest/jest-setup.js +1 -0
- package/jest.config.js +2 -0
- package/oxlint.json +84 -0
- package/package.json +86 -62
- package/tsconfig.json +3 -2
- package/es/rce/plugins/shared/ai_tools/AIResponseModal.d.ts +0 -10
- package/es/rce/plugins/shared/ai_tools/AIResponseModal.js +0 -67
- package/es/rce/plugins/shared/ai_tools/AIToolsTray.d.ts +0 -18
- package/es/rce/plugins/shared/ai_tools/AIToolsTray.js +0 -489
- package/es/rce/plugins/shared/ai_tools/aiicons.d.ts +0 -7
- package/es/rce/plugins/shared/ai_tools/aiicons.js +0 -60
- package/es/rce/plugins/shared/ai_tools/index.d.ts +0 -3
- package/es/sidebar/actions/flickr.d.ts +0 -20
- package/es/sidebar/actions/flickr.js +0 -60
- package/es/sidebar/reducers/flickr.d.ts +0 -1
- package/es/sidebar/reducers/flickr.js +0 -49
|
@@ -1,489 +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, { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react';
|
|
21
|
-
import formatMessage from '../../../../format-message';
|
|
22
|
-
import { Button, CloseButton, CondensedButton, IconButton } from '@instructure/ui-buttons';
|
|
23
|
-
import { Flex } from '@instructure/ui-flex';
|
|
24
|
-
import { Heading } from '@instructure/ui-heading';
|
|
25
|
-
import { Tray } from '@instructure/ui-tray';
|
|
26
|
-
import { SVGIcon } from '@instructure/ui-svg-images';
|
|
27
|
-
import { SimpleSelect } from '@instructure/ui-simple-select';
|
|
28
|
-
import { ScreenReaderContent } from '@instructure/ui-a11y-content';
|
|
29
|
-
import { Spinner } from '@instructure/ui-spinner';
|
|
30
|
-
import { TextArea } from '@instructure/ui-text-area';
|
|
31
|
-
import { TruncateText } from '@instructure/ui-truncate-text';
|
|
32
|
-
import { View } from '@instructure/ui-view';
|
|
33
|
-
import { uid } from '@instructure/uid';
|
|
34
|
-
import { showFlashAlert } from '../../../../common/FlashAlert';
|
|
35
|
-
import doFetchApi from '../do-fetch-api-effect';
|
|
36
|
-
import { AIWandSVG, AIAvatarSVG, InsertSVG, CopySVG, RefreshSVG, DislikeSVG } from './aiicons';
|
|
37
|
-
import { AIResponseModal } from './AIResponseModal';
|
|
38
|
-
const msgid = () => uid('msg', 3);
|
|
39
|
-
const modifyAllTaskMessage = formatMessage('Hello. Please describe the modifications you would like to make to your composition.');
|
|
40
|
-
const modifySelectionTaskMessage = formatMessage('Hello. Please describe the modifications you would like to make to your selection.');
|
|
41
|
-
const generateTaskMessage = formatMessage('Please decribe what you would like to compose.');
|
|
42
|
-
export const AIToolsTray = ({
|
|
43
|
-
open,
|
|
44
|
-
container,
|
|
45
|
-
mountNode,
|
|
46
|
-
contextId,
|
|
47
|
-
contextType,
|
|
48
|
-
currentContent,
|
|
49
|
-
onClose,
|
|
50
|
-
onInsertContent,
|
|
51
|
-
onReplaceContent
|
|
52
|
-
}) => {
|
|
53
|
-
const [trayRef, setTrayRef] = useState(null);
|
|
54
|
-
const [containerStyle] = useState(() => {
|
|
55
|
-
if (container) {
|
|
56
|
-
return {
|
|
57
|
-
width: container.style.width,
|
|
58
|
-
boxSizing: container.style.boxSizing,
|
|
59
|
-
transition: container.style.transition
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
return {};
|
|
63
|
-
});
|
|
64
|
-
const [isOpen, setIsOpen] = useState(open);
|
|
65
|
-
const [task, setTask] = useState(() => {
|
|
66
|
-
return currentContent.content.trim().length > 0 ? 'modify' : 'generate';
|
|
67
|
-
});
|
|
68
|
-
const [userPrompt, setUserPrompt] = useState('');
|
|
69
|
-
const [waitingForResponse, setWaitingForResponse] = useState(false);
|
|
70
|
-
const [responseHtml, setResponseHtml] = useState('');
|
|
71
|
-
const chatContainerRef = useRef(null);
|
|
72
|
-
const getModifyTaskMessage = useCallback(() => {
|
|
73
|
-
return currentContent.type === 'selection' ? modifySelectionTaskMessage : modifyAllTaskMessage;
|
|
74
|
-
}, [currentContent.type]);
|
|
75
|
-
const initChatMessages = useCallback(() => {
|
|
76
|
-
return [task === 'modify' ? {
|
|
77
|
-
id: msgid(),
|
|
78
|
-
type: 'message',
|
|
79
|
-
message: getModifyTaskMessage()
|
|
80
|
-
} : {
|
|
81
|
-
id: msgid(),
|
|
82
|
-
type: 'message',
|
|
83
|
-
message: generateTaskMessage
|
|
84
|
-
}];
|
|
85
|
-
}, [getModifyTaskMessage, task]);
|
|
86
|
-
const chatMessagesRef = useRef(initChatMessages());
|
|
87
|
-
const reset = useCallback(() => {
|
|
88
|
-
chatMessagesRef.current = initChatMessages();
|
|
89
|
-
setWaitingForResponse(false);
|
|
90
|
-
setUserPrompt('');
|
|
91
|
-
}, [initChatMessages]);
|
|
92
|
-
useLayoutEffect(() => {
|
|
93
|
-
const lastbox = chatContainerRef.current?.querySelector('.ai-chat-box:last-child');
|
|
94
|
-
lastbox?.scrollIntoView({
|
|
95
|
-
behavior: 'smooth',
|
|
96
|
-
block: 'nearest'
|
|
97
|
-
});
|
|
98
|
-
}, [trayRef, chatMessagesRef.current.length]);
|
|
99
|
-
useEffect(() => {
|
|
100
|
-
setTask(currentContent.content.trim().length > 0 ? 'modify' : 'generate');
|
|
101
|
-
}, [currentContent.content]);
|
|
102
|
-
useEffect(() => {
|
|
103
|
-
if (open !== isOpen) {
|
|
104
|
-
setIsOpen(open);
|
|
105
|
-
reset();
|
|
106
|
-
}
|
|
107
|
-
}, [isOpen, open, reset]);
|
|
108
|
-
useEffect(() => {
|
|
109
|
-
const shrinking_selector = '#content'; // '.block-editor-editor'
|
|
110
|
-
|
|
111
|
-
if (open && trayRef) {
|
|
112
|
-
const ed = document.querySelector(shrinking_selector);
|
|
113
|
-
if (!ed) return;
|
|
114
|
-
const edstyle = window.getComputedStyle(ed);
|
|
115
|
-
const ed_rect = ed.getBoundingClientRect();
|
|
116
|
-
const padding = parseInt(edstyle.paddingRight, 10);
|
|
117
|
-
const tray_left = window.innerWidth - trayRef.offsetWidth;
|
|
118
|
-
if (ed_rect.right > tray_left) {
|
|
119
|
-
ed.style.boxSizing = 'border-box';
|
|
120
|
-
ed.style.width = `${ed_rect.width - (ed_rect.right - tray_left - padding)}px`;
|
|
121
|
-
}
|
|
122
|
-
} else {
|
|
123
|
-
const ed = document.querySelector(shrinking_selector);
|
|
124
|
-
if (!ed) return;
|
|
125
|
-
ed.style.boxSizing = containerStyle.boxSizing || '';
|
|
126
|
-
ed.style.width = containerStyle.width || '';
|
|
127
|
-
ed.style.transition = containerStyle.transition || '';
|
|
128
|
-
}
|
|
129
|
-
}, [containerStyle, open, trayRef]);
|
|
130
|
-
const getResponse = useCallback(prompt => {
|
|
131
|
-
setWaitingForResponse(true);
|
|
132
|
-
|
|
133
|
-
// the .finally triggered the error even though there is a .catch
|
|
134
|
-
|
|
135
|
-
doFetchApi({
|
|
136
|
-
path: '/api/v1/rich_content/generate',
|
|
137
|
-
method: 'POST',
|
|
138
|
-
headers: {
|
|
139
|
-
'content-type': 'application/json'
|
|
140
|
-
},
|
|
141
|
-
body: JSON.stringify({
|
|
142
|
-
// context_id: contextId,
|
|
143
|
-
// context_type: contextType,
|
|
144
|
-
course_id: contextId,
|
|
145
|
-
prompt,
|
|
146
|
-
current_copy: task === 'modify' ? currentContent : undefined,
|
|
147
|
-
type_of_request: task
|
|
148
|
-
})
|
|
149
|
-
}).then(result => {
|
|
150
|
-
const {
|
|
151
|
-
json
|
|
152
|
-
} = result;
|
|
153
|
-
if (json.error) {
|
|
154
|
-
chatMessagesRef.current.push({
|
|
155
|
-
id: msgid(),
|
|
156
|
-
type: 'error',
|
|
157
|
-
message: formatMessage(json.error)
|
|
158
|
-
});
|
|
159
|
-
} else {
|
|
160
|
-
chatMessagesRef.current.push({
|
|
161
|
-
id: msgid(),
|
|
162
|
-
type: 'response',
|
|
163
|
-
message: json.content
|
|
164
|
-
});
|
|
165
|
-
}
|
|
166
|
-
}).catch(async err => {
|
|
167
|
-
const err_result = await err.response.json();
|
|
168
|
-
const msg = err_result.error || formatMessage('An error occurred processing your request');
|
|
169
|
-
chatMessagesRef.current.push({
|
|
170
|
-
id: msgid(),
|
|
171
|
-
type: 'error',
|
|
172
|
-
message: msg
|
|
173
|
-
});
|
|
174
|
-
}).finally(() => {
|
|
175
|
-
setWaitingForResponse(false);
|
|
176
|
-
});
|
|
177
|
-
}, [contextId, currentContent, task]);
|
|
178
|
-
const handleCloseTray = useCallback(() => {
|
|
179
|
-
onClose();
|
|
180
|
-
chatMessagesRef.current.push({
|
|
181
|
-
id: msgid(),
|
|
182
|
-
type: 'message',
|
|
183
|
-
message: task === 'modify' ? getModifyTaskMessage() : generateTaskMessage
|
|
184
|
-
});
|
|
185
|
-
setUserPrompt('');
|
|
186
|
-
}, [getModifyTaskMessage, onClose, task]);
|
|
187
|
-
const handleChangeTask = useCallback((event, data) => {
|
|
188
|
-
setTask(data.value);
|
|
189
|
-
setWaitingForResponse(false);
|
|
190
|
-
chatMessagesRef.current.push({
|
|
191
|
-
id: msgid(),
|
|
192
|
-
type: 'message',
|
|
193
|
-
message: data.value === 'modify' ? getModifyTaskMessage() : generateTaskMessage
|
|
194
|
-
});
|
|
195
|
-
}, [getModifyTaskMessage]);
|
|
196
|
-
const handlePromptChange = useCallback(e => {
|
|
197
|
-
setUserPrompt(e.target.value);
|
|
198
|
-
}, []);
|
|
199
|
-
const handleSubmitPrompt = useCallback(() => {
|
|
200
|
-
chatMessagesRef.current.push({
|
|
201
|
-
id: msgid(),
|
|
202
|
-
type: 'user',
|
|
203
|
-
message: userPrompt.trim()
|
|
204
|
-
});
|
|
205
|
-
getResponse(userPrompt);
|
|
206
|
-
setUserPrompt('');
|
|
207
|
-
}, [getResponse, userPrompt]);
|
|
208
|
-
const handleInsertResponse = useCallback(responseText => {
|
|
209
|
-
onInsertContent(responseText);
|
|
210
|
-
}, [onInsertContent]);
|
|
211
|
-
const handleCopyResponse = useCallback(async responseText => {
|
|
212
|
-
try {
|
|
213
|
-
if (ClipboardItem.supports('text/html')) {
|
|
214
|
-
const htmlBlob = new Blob([responseText], {
|
|
215
|
-
type: 'text/html'
|
|
216
|
-
});
|
|
217
|
-
await navigator.clipboard.write([new ClipboardItem({
|
|
218
|
-
'text/html': htmlBlob
|
|
219
|
-
})]);
|
|
220
|
-
} else {
|
|
221
|
-
const div = document.createElement('div');
|
|
222
|
-
div.innerHTML = responseText;
|
|
223
|
-
await navigator.clipboard.writeText(div.textContent || '');
|
|
224
|
-
}
|
|
225
|
-
showFlashAlert({
|
|
226
|
-
message: formatMessage('Response copied to clipboard'),
|
|
227
|
-
type: 'success',
|
|
228
|
-
err: undefined
|
|
229
|
-
});
|
|
230
|
-
} catch (err) {
|
|
231
|
-
showFlashAlert({
|
|
232
|
-
message: formatMessage('Failed to copy response'),
|
|
233
|
-
type: 'error',
|
|
234
|
-
err: undefined
|
|
235
|
-
});
|
|
236
|
-
}
|
|
237
|
-
}, []);
|
|
238
|
-
const handleRefreshResponse = useCallback(() => {
|
|
239
|
-
getResponse(userPrompt);
|
|
240
|
-
}, [getResponse, userPrompt]);
|
|
241
|
-
const handleDislikeResponse = useCallback(() => {
|
|
242
|
-
console.log('dislike response'); // TODO: what?
|
|
243
|
-
}, []);
|
|
244
|
-
const handleShowWholeResponse = useCallback(event => {
|
|
245
|
-
const msgId = event.target.dataset.messageId;
|
|
246
|
-
const message = chatMessagesRef.current.find(msg => msg.id === msgId);
|
|
247
|
-
if (message) {
|
|
248
|
-
setResponseHtml(message.message);
|
|
249
|
-
}
|
|
250
|
-
}, []);
|
|
251
|
-
const handleCloseResponseModal = useCallback(() => {
|
|
252
|
-
setResponseHtml('');
|
|
253
|
-
}, []);
|
|
254
|
-
const handleInsertFromModal = useCallback(() => {
|
|
255
|
-
handleInsertResponse(responseHtml);
|
|
256
|
-
handleCloseResponseModal();
|
|
257
|
-
}, [handleCloseResponseModal, handleInsertResponse, responseHtml]);
|
|
258
|
-
const handleReplaceFromModal = useCallback(() => {
|
|
259
|
-
onReplaceContent(responseHtml);
|
|
260
|
-
handleCloseResponseModal();
|
|
261
|
-
}, [handleCloseResponseModal, onReplaceContent, responseHtml]);
|
|
262
|
-
const sharkfin = () => {
|
|
263
|
-
return /*#__PURE__*/React.createElement("svg", {
|
|
264
|
-
width: "14",
|
|
265
|
-
height: "14",
|
|
266
|
-
viewBox: "0 0 14 14",
|
|
267
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
268
|
-
}, /*#__PURE__*/React.createElement("polyline", {
|
|
269
|
-
points: "0,14 0,0 14,14",
|
|
270
|
-
fill: "none",
|
|
271
|
-
stroke: "#ccc",
|
|
272
|
-
strokeWidth: "1"
|
|
273
|
-
}), /*#__PURE__*/React.createElement("polyline", {
|
|
274
|
-
points: "0,14 14,14",
|
|
275
|
-
stroke: "white",
|
|
276
|
-
strokeWidth: "2"
|
|
277
|
-
}));
|
|
278
|
-
};
|
|
279
|
-
const renderResponse = msgId => {
|
|
280
|
-
const message = chatMessagesRef.current.find(msg => msg.id === msgId);
|
|
281
|
-
if (!message) {
|
|
282
|
-
return /*#__PURE__*/React.createElement("span", null, formatMessage("I'm sorry, but I cannot find the AI's answer"));
|
|
283
|
-
}
|
|
284
|
-
const div = document.createElement('div');
|
|
285
|
-
div.innerHTML = message.message;
|
|
286
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
287
|
-
style: {
|
|
288
|
-
display: 'flex',
|
|
289
|
-
flexDirection: 'column'
|
|
290
|
-
}
|
|
291
|
-
}, /*#__PURE__*/React.createElement(TruncateText, {
|
|
292
|
-
maxLines: 3
|
|
293
|
-
}, div.textContent), /*#__PURE__*/React.createElement("span", {
|
|
294
|
-
style: {
|
|
295
|
-
alignSelf: 'end'
|
|
296
|
-
}
|
|
297
|
-
}, /*#__PURE__*/React.createElement(CondensedButton, {
|
|
298
|
-
onClick: handleShowWholeResponse,
|
|
299
|
-
"data-message-id": msgId
|
|
300
|
-
}, formatMessage('Show all'))));
|
|
301
|
-
};
|
|
302
|
-
|
|
303
|
-
// TODO: should the response box get truncated?
|
|
304
|
-
const renderChatBox = (message, key) => {
|
|
305
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
306
|
-
id: message.id,
|
|
307
|
-
className: "ai-chat-box",
|
|
308
|
-
key: key,
|
|
309
|
-
style: {
|
|
310
|
-
display: 'flex',
|
|
311
|
-
flexDirection: 'column',
|
|
312
|
-
justifyContent: 'start',
|
|
313
|
-
rowGap: '4px'
|
|
314
|
-
}
|
|
315
|
-
}, /*#__PURE__*/React.createElement(SVGIcon, {
|
|
316
|
-
src: AIAvatarSVG,
|
|
317
|
-
size: "small"
|
|
318
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
319
|
-
style: {
|
|
320
|
-
padding: '.5rem',
|
|
321
|
-
border: '1px solid #ccc',
|
|
322
|
-
borderRadius: '.5rem',
|
|
323
|
-
position: 'relative'
|
|
324
|
-
}
|
|
325
|
-
}, message.type === 'waiting' && /*#__PURE__*/React.createElement(Spinner, {
|
|
326
|
-
renderTitle: message.message,
|
|
327
|
-
size: "x-small"
|
|
328
|
-
}), (message.type === 'message' || message.type === 'user') && message.message, message.type === 'response' && renderResponse(message.id), message.type === 'error' && /*#__PURE__*/React.createElement("span", null, message.message), /*#__PURE__*/React.createElement("div", {
|
|
329
|
-
style: {
|
|
330
|
-
position: 'absolute',
|
|
331
|
-
top: '-18px',
|
|
332
|
-
// Adjust this value to position the sharkfin
|
|
333
|
-
left: '40px' // Adjust this value to align the sharkfin horizontally
|
|
334
|
-
}
|
|
335
|
-
}, sharkfin())), message.type === 'response' ?
|
|
336
|
-
/*#__PURE__*/
|
|
337
|
-
/* TODO: why is it to wide w/o maxWidth? */
|
|
338
|
-
React.createElement("div", {
|
|
339
|
-
style: {
|
|
340
|
-
display: 'flex',
|
|
341
|
-
gap: '8px',
|
|
342
|
-
justifyContent: 'end',
|
|
343
|
-
maxWidth: '95%',
|
|
344
|
-
margin: '5px 0'
|
|
345
|
-
}
|
|
346
|
-
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
347
|
-
screenReaderLabel: formatMessage('Insert'),
|
|
348
|
-
withBackground: false,
|
|
349
|
-
withBorder: false,
|
|
350
|
-
onClick: handleInsertResponse.bind(null, message.message)
|
|
351
|
-
}, /*#__PURE__*/React.createElement(SVGIcon, {
|
|
352
|
-
src: InsertSVG,
|
|
353
|
-
size: "x-small"
|
|
354
|
-
})), /*#__PURE__*/React.createElement(IconButton, {
|
|
355
|
-
screenReaderLabel: formatMessage('Copy'),
|
|
356
|
-
withBackground: false,
|
|
357
|
-
withBorder: false,
|
|
358
|
-
onClick: handleCopyResponse.bind(null, message.message)
|
|
359
|
-
}, /*#__PURE__*/React.createElement(SVGIcon, {
|
|
360
|
-
src: CopySVG,
|
|
361
|
-
size: "x-small"
|
|
362
|
-
})), /*#__PURE__*/React.createElement(IconButton, {
|
|
363
|
-
screenReaderLabel: formatMessage('Retry'),
|
|
364
|
-
withBackground: false,
|
|
365
|
-
withBorder: false,
|
|
366
|
-
onClick: handleRefreshResponse
|
|
367
|
-
}, /*#__PURE__*/React.createElement(SVGIcon, {
|
|
368
|
-
src: RefreshSVG,
|
|
369
|
-
size: "x-small"
|
|
370
|
-
})), /*#__PURE__*/React.createElement(IconButton, {
|
|
371
|
-
screenReaderLabel: formatMessage('Dislike'),
|
|
372
|
-
withBackground: false,
|
|
373
|
-
withBorder: false,
|
|
374
|
-
onClick: handleDislikeResponse
|
|
375
|
-
}, /*#__PURE__*/React.createElement(SVGIcon, {
|
|
376
|
-
src: DislikeSVG,
|
|
377
|
-
size: "x-small"
|
|
378
|
-
}))) : null);
|
|
379
|
-
};
|
|
380
|
-
const renderChatMessages = () => {
|
|
381
|
-
const messages = chatMessagesRef.current.map(message => {
|
|
382
|
-
return renderChatBox(message, message.id);
|
|
383
|
-
});
|
|
384
|
-
if (waitingForResponse) {
|
|
385
|
-
messages.push(renderChatBox({
|
|
386
|
-
id: msgid(),
|
|
387
|
-
type: 'waiting',
|
|
388
|
-
message: formatMessage('Waiting for response')
|
|
389
|
-
}, 'ai-waiting-message'));
|
|
390
|
-
}
|
|
391
|
-
return messages;
|
|
392
|
-
};
|
|
393
|
-
return /*#__PURE__*/React.createElement(Tray, {
|
|
394
|
-
contentRef: el => setTrayRef(el),
|
|
395
|
-
label: "AIToolsTray",
|
|
396
|
-
mountNode: mountNode,
|
|
397
|
-
open: open,
|
|
398
|
-
placement: "end",
|
|
399
|
-
size: "small",
|
|
400
|
-
onClose: handleCloseTray
|
|
401
|
-
}, /*#__PURE__*/React.createElement(View, {
|
|
402
|
-
as: "div",
|
|
403
|
-
padding: "small",
|
|
404
|
-
position: "relative",
|
|
405
|
-
height: "100vh",
|
|
406
|
-
overflowY: "hidden"
|
|
407
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
408
|
-
style: {
|
|
409
|
-
display: 'flex',
|
|
410
|
-
flexDirection: 'column',
|
|
411
|
-
gap: '16px',
|
|
412
|
-
height: '100%',
|
|
413
|
-
minHeight: '1px',
|
|
414
|
-
maxHeight: '100%'
|
|
415
|
-
}
|
|
416
|
-
}, /*#__PURE__*/React.createElement(Flex, {
|
|
417
|
-
margin: "0 0 medium",
|
|
418
|
-
gap: "small"
|
|
419
|
-
}, /*#__PURE__*/React.createElement(CloseButton, {
|
|
420
|
-
placement: "end",
|
|
421
|
-
onClick: handleCloseTray,
|
|
422
|
-
screenReaderLabel: "Close"
|
|
423
|
-
}), /*#__PURE__*/React.createElement(SVGIcon, {
|
|
424
|
-
src: AIWandSVG,
|
|
425
|
-
size: "x-small"
|
|
426
|
-
}), /*#__PURE__*/React.createElement(Heading, {
|
|
427
|
-
level: "h3"
|
|
428
|
-
}, formatMessage('Writing Assistant'))), /*#__PURE__*/React.createElement(SimpleSelect, {
|
|
429
|
-
renderLabel: formatMessage('What would you like to do?'),
|
|
430
|
-
value: task,
|
|
431
|
-
onChange: handleChangeTask
|
|
432
|
-
}, /*#__PURE__*/React.createElement(SimpleSelect.Option, {
|
|
433
|
-
id: "modify",
|
|
434
|
-
value: "modify",
|
|
435
|
-
isDisabled: currentContent.content.trim().length === 0
|
|
436
|
-
}, formatMessage('Modify')), /*#__PURE__*/React.createElement(SimpleSelect.Option, {
|
|
437
|
-
id: "generate",
|
|
438
|
-
value: "generate"
|
|
439
|
-
}, formatMessage('Compose'))), /*#__PURE__*/React.createElement("div", {
|
|
440
|
-
style: {
|
|
441
|
-
flexGrow: 1,
|
|
442
|
-
overflowY: 'auto'
|
|
443
|
-
}
|
|
444
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
445
|
-
ref: chatContainerRef,
|
|
446
|
-
style: {
|
|
447
|
-
display: 'flex',
|
|
448
|
-
flexDirection: 'column',
|
|
449
|
-
gap: '8px',
|
|
450
|
-
justifyContent: 'end',
|
|
451
|
-
minHeight: '100%'
|
|
452
|
-
}
|
|
453
|
-
}, renderChatMessages())), /*#__PURE__*/React.createElement(View, {
|
|
454
|
-
as: "div",
|
|
455
|
-
padding: "small 0 0 0",
|
|
456
|
-
borderWidth: "small 0 0 0"
|
|
457
|
-
}, /*#__PURE__*/React.createElement(TextArea, {
|
|
458
|
-
id: "ai-prompt",
|
|
459
|
-
label: /*#__PURE__*/React.createElement(ScreenReaderContent, null, formatMessage('Enter text')),
|
|
460
|
-
resize: "vertical",
|
|
461
|
-
value: userPrompt,
|
|
462
|
-
onChange: handlePromptChange
|
|
463
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
464
|
-
style: {
|
|
465
|
-
alignSelf: 'end'
|
|
466
|
-
}
|
|
467
|
-
}, /*#__PURE__*/React.createElement(Button, {
|
|
468
|
-
onClick: handleSubmitPrompt,
|
|
469
|
-
interaction: waitingForResponse || !userPrompt.trim() ? 'disabled' : 'enabled'
|
|
470
|
-
}, formatMessage('Submit')))), responseHtml && /*#__PURE__*/React.createElement(AIResponseModal, {
|
|
471
|
-
open: true,
|
|
472
|
-
onClose: handleCloseResponseModal,
|
|
473
|
-
html: responseHtml,
|
|
474
|
-
onInsert: handleInsertFromModal,
|
|
475
|
-
onReplace: handleReplaceFromModal
|
|
476
|
-
})));
|
|
477
|
-
};
|
|
478
|
-
AIToolsTray.propTypes = {
|
|
479
|
-
open: _pt.bool.isRequired,
|
|
480
|
-
contextId: _pt.string.isRequired,
|
|
481
|
-
contextType: _pt.string.isRequired,
|
|
482
|
-
currentContent: _pt.shape({
|
|
483
|
-
type: _pt.oneOf(['selection', 'full']).isRequired,
|
|
484
|
-
content: _pt.string.isRequired
|
|
485
|
-
}).isRequired,
|
|
486
|
-
onClose: _pt.func.isRequired,
|
|
487
|
-
onInsertContent: _pt.func.isRequired,
|
|
488
|
-
onReplaceContent: _pt.func.isRequired
|
|
489
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
declare const AIWandSVG = "<svg width=\"18\" height=\"18\" viewBox=\"0 0 18 18\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n<mask id=\"mask0_5548_26552\" style=\"mask-type:alpha\" maskUnits=\"userSpaceOnUse\" x=\"0\" y=\"0\" width=\"18\" height=\"18\">\n<path d=\"M8.48511 5.85958C8.34447 5.71049 8.11666 5.71049 7.97603 5.85958L6.54795 7.3735C6.40731 7.52256 6.40731 7.76409 6.54795 7.91315L8.75896 10.2571L8.75968 10.2582L8.76075 10.259L15.9574 17.8882C16.0277 17.9627 16.1198 18 16.2119 18C16.304 18 16.3961 17.9627 16.4664 17.8882L17.8945 16.3743C18.0352 16.2252 18.0352 15.9837 17.8945 15.8346L8.48511 5.85958ZM8.23057 6.66907L9.93327 8.47413L9.01436 9.44848L7.31157 7.64331L8.23057 6.66907ZM16.2119 17.0787L9.52344 9.98813L10.4423 9.01378L17.1309 16.1044L16.2119 17.0787Z\" fill=\"#273540\"/>\n<path d=\"M6.9677 4.52528C6.98177 4.52716 6.99581 4.52789 7.00988 4.52789C7.13082 4.52789 7.24473 4.46343 7.3119 4.35423L7.89726 3.3986L8.97165 3.3688C9.10875 3.3647 9.23182 3.27899 9.28912 3.14703C9.34641 3.01511 9.32815 2.86005 9.242 2.74714L8.56629 1.86119L8.8711 0.769191C8.91013 0.629809 8.87074 0.479228 8.77021 0.380468C8.66999 0.281678 8.52444 0.251498 8.39683 0.304431L7.39345 0.712163L6.50783 0.0674013C6.395 -0.0153617 6.24769 -0.0224389 6.12816 0.0491233C6.00862 0.119925 5.93726 0.256733 5.94426 0.401699L6.00018 1.53956L5.14798 2.23316C5.03898 2.32151 4.98731 2.46759 5.01402 2.61033C5.04075 2.75272 5.1413 2.86675 5.27383 2.90442L6.31166 3.19959L6.67062 4.27372C6.71633 4.4105 6.83164 4.50815 6.9677 4.52528ZM6.16471 2.36772L6.58872 2.0226C6.68292 1.94618 6.73531 1.82543 6.72932 1.7002L6.70157 1.13443L7.14172 1.45495C7.23946 1.52614 7.36393 1.54216 7.47466 1.49672L7.97354 1.29396L7.822 1.83698C7.78827 1.95773 7.81287 2.08781 7.88741 2.18546L8.2235 2.62601L7.68912 2.64089C7.57063 2.64425 7.46131 2.70912 7.39662 2.81458L7.10552 3.28978L6.92693 2.75571C6.88753 2.63718 6.79542 2.54699 6.68083 2.51455L6.16471 2.36772Z\" fill=\"#273540\"/>\n<path d=\"M5.00785 9.67232L5.31265 8.58029C5.35166 8.4409 5.31229 8.29032 5.21174 8.19156C5.11119 8.0928 4.96636 8.06262 4.83838 8.11553L3.83536 8.52329L2.94939 7.8785C2.83617 7.79614 2.68853 7.78904 2.56968 7.86025C2.45015 7.93105 2.37878 8.06783 2.38582 8.21282L2.44171 9.35068L1.5895 10.0443C1.48054 10.1326 1.42884 10.2787 1.45557 10.4215C1.48227 10.5638 1.58283 10.6779 1.71538 10.7155L2.75358 11.0107L3.11251 12.0845C3.15822 12.2212 3.27353 12.3189 3.40959 12.336C3.42366 12.3379 3.43773 12.3386 3.45179 12.3386C3.57273 12.3386 3.68664 12.2742 3.75379 12.1649L4.33915 11.2097L5.41354 11.1799C5.55067 11.1758 5.6737 11.0901 5.731 10.9582C5.78833 10.8262 5.77004 10.6712 5.68391 10.5582L5.00785 9.67232ZM4.13101 10.452C4.01255 10.4554 3.90319 10.5202 3.8385 10.6257L3.54741 11.1009L3.36881 10.5668C3.32945 10.4483 3.23734 10.3581 3.12271 10.3257L2.6066 10.1788L3.03024 9.83369C3.12448 9.7573 3.17687 9.63655 3.17088 9.51133L3.1431 8.94517L3.58363 9.26608C3.68137 9.33764 3.80581 9.35329 3.91655 9.30781L4.41509 9.10506L4.26356 9.6481C4.22982 9.76886 4.25443 9.89894 4.32894 9.99659L4.66541 10.4371L4.13101 10.452Z\" fill=\"#273540\"/>\n<path d=\"M1.96063 6.47752C1.97467 6.47936 1.98874 6.48012 2.00281 6.48012C2.12375 6.48012 2.23765 6.41563 2.3048 6.30643L2.89016 5.35083L3.96458 5.321C4.10168 5.3169 4.22472 5.23119 4.28204 5.09923C4.33934 4.96731 4.32105 4.81225 4.23492 4.69934L3.55922 3.81343L3.86402 2.72139C3.90303 2.58201 3.86366 2.43143 3.76311 2.33267C3.66292 2.23391 3.51701 2.2037 3.38975 2.25663L2.38637 2.66437L1.50076 2.0196C1.38754 1.93687 1.24095 1.92976 1.12106 2.00133C1.00152 2.07216 0.930156 2.20894 0.937191 2.3539L0.993081 3.49176L0.140875 4.18536C0.0319077 4.27371 -0.0197896 4.41982 0.00694182 4.56256C0.0336457 4.70493 0.134199 4.81898 0.266753 4.85662L1.30459 5.15179L1.66355 6.22592C1.70923 6.3627 1.82457 6.46035 1.96063 6.47752ZM1.15764 4.31992L1.58161 3.9748C1.67585 3.89838 1.72824 3.77763 1.72225 3.6524L1.69447 3.08666L2.13464 3.40718C2.23274 3.47872 2.35718 3.49439 2.46759 3.44892L2.96646 3.24616L2.81493 3.78918C2.78119 3.90996 2.8058 4.04001 2.88031 4.13766L3.21643 4.57821L2.68204 4.59312C2.56356 4.59646 2.45421 4.66132 2.38954 4.76678L2.09842 5.24198L1.91983 4.70791C1.88046 4.58938 1.78835 4.49919 1.67373 4.46676L1.15764 4.31992Z\" fill=\"#273540\"/>\n</mask>\n<g mask=\"url(#mask0_5548_26552)\">\n<rect width=\"18\" height=\"18\" fill=\"currentColor\"/>\n</g>\n</svg>\n";
|
|
2
|
-
declare const InsertSVG = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 18 18\" fill=\"none\">\n <path d=\"M16.9455 16.9451H12.375V18H18V12.375H16.9455V16.9451Z\" fill=\"#273540\"/>\n <path d=\"M1.05487 1.0545H5.625V0H0V5.625H1.0545L1.05487 1.0545Z\" fill=\"#273540\"/>\n <path d=\"M12.375 0V1.0545H16.9455V5.625H18V0H12.375Z\" fill=\"#273540\"/>\n <path d=\"M1.05487 12.375H0V18H5.625V16.9451H1.05487V12.375Z\" fill=\"#273540\"/>\n <path d=\"M3.59082 14.4093H14.4099V3.59058H3.59082V14.4093ZM4.64532 4.64508H13.3551V13.3548H4.64532V4.64508Z\" fill=\"#273540\"/>\n <path d=\"M9.52752 6.92065H8.47302V8.47278H6.9209V9.52728H8.47302V11.0794H9.52752V9.52728H11.0796V8.47278H9.52752V6.92065Z\" fill=\"#273540\"/>\n</svg>";
|
|
3
|
-
declare const CopySVG: any;
|
|
4
|
-
declare const RefreshSVG: any;
|
|
5
|
-
declare const DislikeSVG = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 18 18\" fill=\"none\">\n <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M2.17647 7.41176L3.2353 7.41176L3.2353 6.35294C2.65189 6.35294 2.17647 5.87859 2.17647 5.29411C2.17647 4.70964 2.65189 4.23529 3.2353 4.23529L4.29412 4.23529L4.29412 3.17647C3.71071 3.17647 3.2353 2.70211 3.2353 2.11764C3.2353 1.53317 3.71071 1.05882 4.29412 1.05882L13.2941 1.05882C14.7532 1.05882 15.9412 2.24576 15.9412 3.70588L15.9412 9.52941L14.9417 9.52941C13.6277 9.52941 12.3698 10.0694 11.4888 11.0086C10.2267 12.3554 8.738 14.4445 8.54953 16.9412L8.20859 16.9412C7.7353 16.9412 7.28953 16.7315 6.98671 16.3652C6.68071 15.9946 6.55683 15.5107 6.64788 15.0385C6.86071 13.9267 7.21224 12.8255 7.69083 11.7656C7.91424 11.2733 7.87188 10.71 7.58071 10.2568C7.28635 9.80153 6.78659 9.52941 6.24341 9.52941L2.17647 9.52941C1.59306 9.52941 1.11765 9.05506 1.11765 8.47059C1.11765 7.88611 1.59306 7.41176 2.17647 7.41176ZM0.0588235 8.47059C0.0588234 9.63847 1.00859 10.5882 2.17647 10.5882L6.24341 10.5882C6.42765 10.5882 6.59071 10.6761 6.69024 10.8307C6.78765 10.9821 6.80141 11.1642 6.72624 11.3294C6.21377 12.4645 5.83682 13.6461 5.60706 14.8405C5.45776 15.624 5.66212 16.4255 6.17035 17.0396C6.67541 17.6495 7.41871 18 8.20859 18L9.58824 18L9.58824 17.4706C9.58824 15.0851 11.042 13.0341 12.2607 11.7328C12.9426 11.0065 13.9199 10.5882 14.9416 10.5882L17 10.5882L17 3.70588C17 1.66235 15.3376 -1.45327e-07 13.2941 -3.23979e-07L4.29412 -1.11078e-06C3.12624 -1.21288e-06 2.17647 0.949763 2.17647 2.11765C2.17647 2.55282 2.30882 2.95835 2.53435 3.29506C1.71059 3.58518 1.11765 4.37188 1.11765 5.29412C1.11765 5.72929 1.25 6.13482 1.47553 6.47153C0.651767 6.76164 0.0588235 7.54835 0.0588235 8.47059Z\" fill=\"#273540\"/>\n</svg>";
|
|
6
|
-
declare const AIAvatarSVG = "\n<svg width=\"40\" height=\"40\" viewBox=\"0 0 40 40\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n<g id=\"Avatar - AI\">\n<rect id=\"Rectangle 2318\" x=\"0.5\" y=\"0.5\" width=\"39\" height=\"39\" rx=\"19.5\" fill=\"white\" stroke=\"#C7CDD1\"/>\n<rect id=\"Untitled-4 1\" x=\"8\" y=\"9\" width=\"24\" height=\"23.4915\" fill=\"url(#pattern0_5509_72095)\"/>\n</g>\n<defs>\n<pattern id=\"pattern0_5509_72095\" patternContentUnits=\"objectBoundingBox\" width=\"1\" height=\"1\">\n<use xlink:href=\"#image0_5509_72095\" transform=\"scale(0.0313 0.0313)\"/>\n</pattern>\n<image id=\"image0_5509_72095\" data-name=\"Untitled-4.png\" width=\"32\" height=\"32\" xlink:href=\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACEAAAAgCAYAAACcuBHKAAAAAXNSR0IArs4c6QAAAKZlWElmTU0AKgAAAAgABQESAAMAAAABAAEAAAEaAAUAAAABAAAASgEbAAUAAAABAAAAUgExAAIAAAAhAAAAWodpAAQAAAABAAAAfAAAAAAAAABIAAAAAQAAAEgAAAABQWRvYmUgUGhvdG9zaG9wIDI0LjcgKE1hY2ludG9zaCkAAAADoAEAAwAAAAEAAQAAoAIABAAAAAEAAAAhoAMABAAAAAEAAAAgAAAAALJEp6cAAAAJcEhZcwAACxMAAAsTAQCanBgAAAR2aVRYdFhNTDpjb20uYWRv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Yjv7mT4HLRkY+OlKMUpRlfXGJZn7QFc/buzDsE+BopBFpJ2alFvw1i6p5vbn7Ncurg/i+Urt6syMJ50WBlrSmSmsFknQOIYc1Wh8j02pMywQCgl31mvR41g2yr+mmeYDQEcfhLntZ+Qkkd6LdIWTnewobGwtZ1iyOGJegE8tdAAI2NIlpb1QVL76jzTcYOJXyTZu1aJ7SiG2iHLIIlKw9K8dynRyyuiCzwzLjFIokWqwarzWuZ9DuFzz75CfuyD1LPRcjdnbDOXwoxNyea4nHd2fba04cbaf5Wmn8agC6/iYm/fEr60a264rvrsweGfNtiiUSNFonmmJhgdWSmj6xp+/2CZp0mv9Vq6BjaT38QJJwFDnHGjLDs8Vy32KxtOTmeV97Z92/eaQW/9Rn+F/W4ovAwCCW5AAAAAElFTkSuQmCC\"/>\n</defs>\n</svg>\n";
|
|
7
|
-
export { AIWandSVG, AIAvatarSVG, InsertSVG, CopySVG, RefreshSVG, DislikeSVG };
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (C) 2024 - 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
|
-
|
|
19
|
-
// @ts-expect-error
|
|
20
|
-
import { IconCopyLine, IconRefreshLine } from '@instructure/ui-icons/es/svg';
|
|
21
|
-
const AIWandSVG = `<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
22
|
-
<mask id="mask0_5548_26552" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="18" height="18">
|
|
23
|
-
<path d="M8.48511 5.85958C8.34447 5.71049 8.11666 5.71049 7.97603 5.85958L6.54795 7.3735C6.40731 7.52256 6.40731 7.76409 6.54795 7.91315L8.75896 10.2571L8.75968 10.2582L8.76075 10.259L15.9574 17.8882C16.0277 17.9627 16.1198 18 16.2119 18C16.304 18 16.3961 17.9627 16.4664 17.8882L17.8945 16.3743C18.0352 16.2252 18.0352 15.9837 17.8945 15.8346L8.48511 5.85958ZM8.23057 6.66907L9.93327 8.47413L9.01436 9.44848L7.31157 7.64331L8.23057 6.66907ZM16.2119 17.0787L9.52344 9.98813L10.4423 9.01378L17.1309 16.1044L16.2119 17.0787Z" fill="#273540"/>
|
|
24
|
-
<path d="M6.9677 4.52528C6.98177 4.52716 6.99581 4.52789 7.00988 4.52789C7.13082 4.52789 7.24473 4.46343 7.3119 4.35423L7.89726 3.3986L8.97165 3.3688C9.10875 3.3647 9.23182 3.27899 9.28912 3.14703C9.34641 3.01511 9.32815 2.86005 9.242 2.74714L8.56629 1.86119L8.8711 0.769191C8.91013 0.629809 8.87074 0.479228 8.77021 0.380468C8.66999 0.281678 8.52444 0.251498 8.39683 0.304431L7.39345 0.712163L6.50783 0.0674013C6.395 -0.0153617 6.24769 -0.0224389 6.12816 0.0491233C6.00862 0.119925 5.93726 0.256733 5.94426 0.401699L6.00018 1.53956L5.14798 2.23316C5.03898 2.32151 4.98731 2.46759 5.01402 2.61033C5.04075 2.75272 5.1413 2.86675 5.27383 2.90442L6.31166 3.19959L6.67062 4.27372C6.71633 4.4105 6.83164 4.50815 6.9677 4.52528ZM6.16471 2.36772L6.58872 2.0226C6.68292 1.94618 6.73531 1.82543 6.72932 1.7002L6.70157 1.13443L7.14172 1.45495C7.23946 1.52614 7.36393 1.54216 7.47466 1.49672L7.97354 1.29396L7.822 1.83698C7.78827 1.95773 7.81287 2.08781 7.88741 2.18546L8.2235 2.62601L7.68912 2.64089C7.57063 2.64425 7.46131 2.70912 7.39662 2.81458L7.10552 3.28978L6.92693 2.75571C6.88753 2.63718 6.79542 2.54699 6.68083 2.51455L6.16471 2.36772Z" fill="#273540"/>
|
|
25
|
-
<path d="M5.00785 9.67232L5.31265 8.58029C5.35166 8.4409 5.31229 8.29032 5.21174 8.19156C5.11119 8.0928 4.96636 8.06262 4.83838 8.11553L3.83536 8.52329L2.94939 7.8785C2.83617 7.79614 2.68853 7.78904 2.56968 7.86025C2.45015 7.93105 2.37878 8.06783 2.38582 8.21282L2.44171 9.35068L1.5895 10.0443C1.48054 10.1326 1.42884 10.2787 1.45557 10.4215C1.48227 10.5638 1.58283 10.6779 1.71538 10.7155L2.75358 11.0107L3.11251 12.0845C3.15822 12.2212 3.27353 12.3189 3.40959 12.336C3.42366 12.3379 3.43773 12.3386 3.45179 12.3386C3.57273 12.3386 3.68664 12.2742 3.75379 12.1649L4.33915 11.2097L5.41354 11.1799C5.55067 11.1758 5.6737 11.0901 5.731 10.9582C5.78833 10.8262 5.77004 10.6712 5.68391 10.5582L5.00785 9.67232ZM4.13101 10.452C4.01255 10.4554 3.90319 10.5202 3.8385 10.6257L3.54741 11.1009L3.36881 10.5668C3.32945 10.4483 3.23734 10.3581 3.12271 10.3257L2.6066 10.1788L3.03024 9.83369C3.12448 9.7573 3.17687 9.63655 3.17088 9.51133L3.1431 8.94517L3.58363 9.26608C3.68137 9.33764 3.80581 9.35329 3.91655 9.30781L4.41509 9.10506L4.26356 9.6481C4.22982 9.76886 4.25443 9.89894 4.32894 9.99659L4.66541 10.4371L4.13101 10.452Z" fill="#273540"/>
|
|
26
|
-
<path d="M1.96063 6.47752C1.97467 6.47936 1.98874 6.48012 2.00281 6.48012C2.12375 6.48012 2.23765 6.41563 2.3048 6.30643L2.89016 5.35083L3.96458 5.321C4.10168 5.3169 4.22472 5.23119 4.28204 5.09923C4.33934 4.96731 4.32105 4.81225 4.23492 4.69934L3.55922 3.81343L3.86402 2.72139C3.90303 2.58201 3.86366 2.43143 3.76311 2.33267C3.66292 2.23391 3.51701 2.2037 3.38975 2.25663L2.38637 2.66437L1.50076 2.0196C1.38754 1.93687 1.24095 1.92976 1.12106 2.00133C1.00152 2.07216 0.930156 2.20894 0.937191 2.3539L0.993081 3.49176L0.140875 4.18536C0.0319077 4.27371 -0.0197896 4.41982 0.00694182 4.56256C0.0336457 4.70493 0.134199 4.81898 0.266753 4.85662L1.30459 5.15179L1.66355 6.22592C1.70923 6.3627 1.82457 6.46035 1.96063 6.47752ZM1.15764 4.31992L1.58161 3.9748C1.67585 3.89838 1.72824 3.77763 1.72225 3.6524L1.69447 3.08666L2.13464 3.40718C2.23274 3.47872 2.35718 3.49439 2.46759 3.44892L2.96646 3.24616L2.81493 3.78918C2.78119 3.90996 2.8058 4.04001 2.88031 4.13766L3.21643 4.57821L2.68204 4.59312C2.56356 4.59646 2.45421 4.66132 2.38954 4.76678L2.09842 5.24198L1.91983 4.70791C1.88046 4.58938 1.78835 4.49919 1.67373 4.46676L1.15764 4.31992Z" fill="#273540"/>
|
|
27
|
-
</mask>
|
|
28
|
-
<g mask="url(#mask0_5548_26552)">
|
|
29
|
-
<rect width="18" height="18" fill="currentColor"/>
|
|
30
|
-
</g>
|
|
31
|
-
</svg>
|
|
32
|
-
`;
|
|
33
|
-
const InsertSVG = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none">
|
|
34
|
-
<path d="M16.9455 16.9451H12.375V18H18V12.375H16.9455V16.9451Z" fill="#273540"/>
|
|
35
|
-
<path d="M1.05487 1.0545H5.625V0H0V5.625H1.0545L1.05487 1.0545Z" fill="#273540"/>
|
|
36
|
-
<path d="M12.375 0V1.0545H16.9455V5.625H18V0H12.375Z" fill="#273540"/>
|
|
37
|
-
<path d="M1.05487 12.375H0V18H5.625V16.9451H1.05487V12.375Z" fill="#273540"/>
|
|
38
|
-
<path d="M3.59082 14.4093H14.4099V3.59058H3.59082V14.4093ZM4.64532 4.64508H13.3551V13.3548H4.64532V4.64508Z" fill="#273540"/>
|
|
39
|
-
<path d="M9.52752 6.92065H8.47302V8.47278H6.9209V9.52728H8.47302V11.0794H9.52752V9.52728H11.0796V8.47278H9.52752V6.92065Z" fill="#273540"/>
|
|
40
|
-
</svg>`;
|
|
41
|
-
const CopySVG = IconCopyLine?.src;
|
|
42
|
-
const RefreshSVG = IconRefreshLine?.src;
|
|
43
|
-
const DislikeSVG = `<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18" fill="none">
|
|
44
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M2.17647 7.41176L3.2353 7.41176L3.2353 6.35294C2.65189 6.35294 2.17647 5.87859 2.17647 5.29411C2.17647 4.70964 2.65189 4.23529 3.2353 4.23529L4.29412 4.23529L4.29412 3.17647C3.71071 3.17647 3.2353 2.70211 3.2353 2.11764C3.2353 1.53317 3.71071 1.05882 4.29412 1.05882L13.2941 1.05882C14.7532 1.05882 15.9412 2.24576 15.9412 3.70588L15.9412 9.52941L14.9417 9.52941C13.6277 9.52941 12.3698 10.0694 11.4888 11.0086C10.2267 12.3554 8.738 14.4445 8.54953 16.9412L8.20859 16.9412C7.7353 16.9412 7.28953 16.7315 6.98671 16.3652C6.68071 15.9946 6.55683 15.5107 6.64788 15.0385C6.86071 13.9267 7.21224 12.8255 7.69083 11.7656C7.91424 11.2733 7.87188 10.71 7.58071 10.2568C7.28635 9.80153 6.78659 9.52941 6.24341 9.52941L2.17647 9.52941C1.59306 9.52941 1.11765 9.05506 1.11765 8.47059C1.11765 7.88611 1.59306 7.41176 2.17647 7.41176ZM0.0588235 8.47059C0.0588234 9.63847 1.00859 10.5882 2.17647 10.5882L6.24341 10.5882C6.42765 10.5882 6.59071 10.6761 6.69024 10.8307C6.78765 10.9821 6.80141 11.1642 6.72624 11.3294C6.21377 12.4645 5.83682 13.6461 5.60706 14.8405C5.45776 15.624 5.66212 16.4255 6.17035 17.0396C6.67541 17.6495 7.41871 18 8.20859 18L9.58824 18L9.58824 17.4706C9.58824 15.0851 11.042 13.0341 12.2607 11.7328C12.9426 11.0065 13.9199 10.5882 14.9416 10.5882L17 10.5882L17 3.70588C17 1.66235 15.3376 -1.45327e-07 13.2941 -3.23979e-07L4.29412 -1.11078e-06C3.12624 -1.21288e-06 2.17647 0.949763 2.17647 2.11765C2.17647 2.55282 2.30882 2.95835 2.53435 3.29506C1.71059 3.58518 1.11765 4.37188 1.11765 5.29412C1.11765 5.72929 1.25 6.13482 1.47553 6.47153C0.651767 6.76164 0.0588235 7.54835 0.0588235 8.47059Z" fill="#273540"/>
|
|
45
|
-
</svg>`;
|
|
46
|
-
const AIAvatarSVG = `
|
|
47
|
-
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
48
|
-
<g id="Avatar - AI">
|
|
49
|
-
<rect id="Rectangle 2318" x="0.5" y="0.5" width="39" height="39" rx="19.5" fill="white" stroke="#C7CDD1"/>
|
|
50
|
-
<rect id="Untitled-4 1" x="8" y="9" width="24" height="23.4915" fill="url(#pattern0_5509_72095)"/>
|
|
51
|
-
</g>
|
|
52
|
-
<defs>
|
|
53
|
-
<pattern id="pattern0_5509_72095" patternContentUnits="objectBoundingBox" width="1" height="1">
|
|
54
|
-
<use xlink:href="#image0_5509_72095" transform="scale(0.0313 0.0313)"/>
|
|
55
|
-
</pattern>
|
|
56
|
-
<image id="image0_5509_72095" data-name="Untitled-4.png" width="32" height="32" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACEAAAAgCAYAAACcuBHKAAAAAXNSR0IArs4c6QAAAKZlWElmTU0AKgAAAAgABQESAAMAAAABAAEAAAEaAAUAAAABAAAASgEbAAUAAAABAAAAUgExAAIAAAAhAAAA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Q+s6ddGeQ+WXgpGTalqOMxryc8U7xIiNcENyEjYVpaEgxQknuUSm84mutUY9QRkzGdcwGFLw7mgEh8JEAiYiPbeLu+xOhlBAKZS0VR3L8o9ShpG/KI4ZI6d8U5d8DaRZAJ1La+jTLwsX9vnq6l1jN1Zyl0j+8Y3DFyOtKKeofk1QNUvFA+0JJkp4cg/0/UGUqOYjv7mT4HLRkY+OlKMUpRlfXGJZn7QFc/buzDsE+BopBFpJ2alFvw1i6p5vbn7Ncurg/i+Urt6syMJ50WBlrSmSmsFknQOIYc1Wh8j02pMywQCgl31mvR41g2yr+mmeYDQEcfhLntZ+Qkkd6LdIWTnewobGwtZ1iyOGJegE8tdAAI2NIlpb1QVL76jzTcYOJXyTZu1aJ7SiG2iHLIIlKw9K8dynRyyuiCzwzLjFIokWqwarzWuZ9DuFzz75CfuyD1LPRcjdnbDOXwoxNyea4nHd2fba04cbaf5Wmn8agC6/iYm/fEr60a264rvrsweGfNtiiUSNFonmmJhgdWSmj6xp+/2CZp0mv9Vq6BjaT38QJJwFDnHGjLDs8Vy32KxtOTmeV97Z92/eaQW/9Rn+F/W4ovAwCCW5AAAAAElFTkSuQmCC"/>
|
|
57
|
-
</defs>
|
|
58
|
-
</svg>
|
|
59
|
-
`;
|
|
60
|
-
export { AIWandSVG, AIAvatarSVG, InsertSVG, CopySVG, RefreshSVG, DislikeSVG };
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export function startFlickrSearch(term: any): {
|
|
2
|
-
type: string;
|
|
3
|
-
term: any;
|
|
4
|
-
};
|
|
5
|
-
export function receiveFlickrResults(results: any): {
|
|
6
|
-
type: string;
|
|
7
|
-
results: any;
|
|
8
|
-
};
|
|
9
|
-
export function failFlickrSearch(error: any): {
|
|
10
|
-
type: string;
|
|
11
|
-
error: any;
|
|
12
|
-
};
|
|
13
|
-
export function openOrCloseFlickrForm(): {
|
|
14
|
-
type: string;
|
|
15
|
-
};
|
|
16
|
-
export function searchFlickr(term: any): (dispatch: any, getState: any) => any;
|
|
17
|
-
export const START_FLICKR_SEARCH: "START_FLICKR_SEARCH";
|
|
18
|
-
export const RECEIVE_FLICKR_RESULTS: "RECEIVE_FLICKR_RESULTS";
|
|
19
|
-
export const FAIL_FLICKR_SEARCH: "FAIL_FLICKR_SEARCH";
|
|
20
|
-
export const TOGGLE_FLICKR_FORM: "TOGGLE_FLICKR_FORM";
|