diff --git a/config/webpack.config.js b/config/webpack.config.js index dd31696f..4930c854 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -757,3 +757,19 @@ module.exports = function (webpackEnv) { performance: false, }; }; +module.exports = { + module: { + rules: [ + { + test: /\.mjs$/, + resolve: { + fullySpecified: false, + }, + ...(isEnvDevelopment && { + use: ['source-map-loader'], + }), + exclude: /node_modules\/@mediapipe\/tasks-vision/, + }, + ], + }, +}; diff --git a/src/components/Experiment/QuickInput/useQuickInputControl.js b/src/components/Experiment/QuickInput/useQuickInputControl.js index 50b55682..b3ddd868 100644 --- a/src/components/Experiment/QuickInput/useQuickInputControl.js +++ b/src/components/Experiment/QuickInput/useQuickInputControl.js @@ -133,7 +133,10 @@ export default function useQuickInputControl(props) { // Data to be sent to API if (typeof url !== 'object') { selectedData = [{ src: url, inputType: task.inputType }]; - } else { + } else if (Array.isArray(url)) { + selectedData = url.map(u => ({ inputType: task.inputType, src: u })); + } + else { selectedData = [{ inputType: task.inputType, ...url }]; } } diff --git a/src/components/Experiment/QuickOutput/InputPreview.js b/src/components/Experiment/QuickOutput/InputPreview.js index 7d859b89..8fc15acb 100644 --- a/src/components/Experiment/QuickOutput/InputPreview.js +++ b/src/components/Experiment/QuickOutput/InputPreview.js @@ -1,9 +1,9 @@ import React from "react"; import "./InputPreview.scss"; import useBEMNaming from "../../../common/useBEMNaming"; +import { ReactComponent as DocumentIcon } from "../../../resources/icons/icon-document.svg"; import CsvIcon from "../../../../src/resources/icons/icon-csv-file.svg"; - const defaultProps = { className: "input-preview", input: "", @@ -27,28 +27,26 @@ export default function InputPreview(givenProps) { const getInput = () => { switch (props.inputType) { case "text": - return

{props.input.src}

; + let shortened = props.input.src.split(" ").slice(0, 5).join(" "); + shortened = shortened + (shortened.length < props.input.src.length ? "..." : ""); + return

{shortened}

; case "audio": - return