Css 删除MS bot framework中的图像上载按钮

Css 删除MS bot framework中的图像上载按钮,css,sass,botframework,Css,Sass,Botframework,我想删除MS botframwork中的图像上载按钮。我正在对botchat.scss文件进行更改,然后运行npm run prepublish,但什么都没有发生。我不想在botchat.css文件中进行更改。你能确切地告诉我我要做什么吗 谢谢。webchat的结构是使用React动态创建的,代码放在botchat.js文件中。您必须在文件botchat.js中注释或删除以下行: React.createElement("label", { className: "wc-upload", onK

我想删除MS botframwork中的图像上载按钮。我正在对botchat.scss文件进行更改,然后运行npm run prepublish,但什么都没有发生。我不想在botchat.css文件中进行更改。你能确切地告诉我我要做什么吗


谢谢。

webchat的结构是使用React动态创建的,代码放在
botchat.js
文件中。您必须在文件
botchat.js
中注释或删除以下行:

React.createElement("label", { className: "wc-upload", onKeyPress: function (evt) { return _this.handleUploadButtonKeyPress(evt); }, tabIndex: 0 },
React.createElement("svg", null,
React.createElement("path", { d: "M19.96 4.79m-2 0a2 2 0 0 1 4 0 2 2 0 0 1-4 0zM8.32 4.19L2.5 15.53 22.45 15.53 17.46 8.56 14.42 11.18 8.32 4.19ZM1.04 1L1.04 17 24.96 17 24.96 1 1.04 1ZM1.03 0L24.96 0C25.54 0 26 0.45 26 0.99L26 17.01C26 17.55 25.53 18 24.96 18L1.03 18C0.46 18 0 17.55 0 17.01L0 0.99C0 0.45 0.47 0 1.03 0Z" })),
React.createElement("input", { id: "wc-upload-input", tabIndex: -1, type: "file", ref: function (input) { return _this.fileInput = input; }, multiple: true, onChange: function () { return _this.onChangeFile(); }, "aria-label": this.props.strings.uploadFile, role: "button" })),

这些行呈现并显示图像上载按钮,取消注释这些行以再次显示按钮。

嵌入式网络聊天没有直接配置来禁用上载按钮和功能。但是,嵌入式web聊天是由项目构建的,因此您可以修改源代码,并编译成您自己的版本以实现您的需求

  • 将repo克隆到本地工作空间,运行
    npm install
    安装所有node.js依赖项
  • 注释第114行至第132行的代码部分
  • 运行
    npm运行build
    将源代码编译为javascript文件
  • 请按照下面的部分在您的网站中利用您自己的js文件

  • 您可以通过更改CSS来实现这一点

    不要更改
    botchat.css
    ,因为它将在网络构建中被覆盖

    您必须在
    botchat.scss
    中进行更改,然后重新生成CSS:
    npm运行build CSS

    .wc-upload {
                cursor: pointer;
                position: relative;
                display: none; // add this to hide image for upload
    
                svg {
                    height: 18px;
                    width: 26px;
                }
            }
    
    &.has-upload-button .wc-textbox {
                left: 15px; // change the value from 48px to 15px to move to left input control
            }
    

    如果您将页面作为脚本托管在页面上,而不是作为iFrame托管,则可以将这些CSS添加到网页本身。不需要重建botchat.css。