Giter Site home page Giter Site logo

braft-extensions's People

Contributors

augustocunha avatar bertyhell avatar bluescurry avatar margox avatar ninesunsabiu avatar shenzhim avatar yyl1999 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

braft-extensions's Issues

table功能是如何支持的....

公司在开发一款编辑器,一定要用draft.js.,,,,,看到你这边已经支持了表格功能了...不过好像看不到例子

code-highlighter: theme was preserved in the codeblock by copy code from IDE(vscode)

Hi, thanks for your great work, I have a problem with extension of code-highlighter. when I insert my code from my IDE(vscode) by copy (control/command + C ),and the theme of my IDE was preserved in the codeblock of braft-editor.

here is, the theme of code is my IDE's theme, and the code style will be preserved in the html string, when I call this.state.editorState.toHTML()
image

however, the braft-editor code-highlighter default theme is prism-tomorrow, and the expected result is:
image

设置个别编辑器使用表格不起作用问题

BraftEditor.use(Table({includeEditors:['xxx']}))设置后,相应的编辑器仍然没有插入表格项,只有BraftEditor.use(Table({xxx}))(table中设置不包括includeEditors或excludeEditors)是编辑器中才会出现表格插入图标

Table 选中多行单元格,设置居中时问题

复现路径:

  1. 添加一个 3 * 3 的表格,填入内容

  2. 选中所有单元格,点击工具栏中的剧中操作
    image

  3. 设置剧中完成后,表格被合并成一行了,如下图
    image

  4. 如果选中6行时,设置居中会导致js error 整个编辑器崩溃了
    image

image
期望结果,所有单元格内容居中,表格显示如下图:
image

table 插件 光标自动跳转问题

如果光标点击 table 最右侧, 之后光标会自动跳到 table 内部最后一个单元格, 之后不管是点击 table 内部还是外部都会自动跳转到最后一个单元格.

image

而且现在貌相只能通过清楚内容来删除 table. 不能在 table 最右侧处光标, delete 键删除掉.

ie中table在初始化无法显示

在主流浏览器中都可以在初始化时显示表格但是在ie11中直接提示类型错误。只要加了{editorId:'editor-table'}参数找不到具体的原因导致的请帮忙看一下

表情包不显示

表情包已经能展开了 但是插入到编辑器里面是一个空格 是为什么有什么解决办法吗

Enter回车

请问作者有没有可配置属性 让enter回车可以直接触发提交事件 而不是换行

edge浏览器下增加table功能会造成所有内容无法显示

您好
当使用扩展表格功能后,edge浏览器无法将通过
BraftEditor.createEditorState(props.data, {....}) 创建包含数据的editorState ,editorState.toHTML()为空,与之前提问的ie出现的情况类似,打印了error
初次

SyntaxError: Unexpected end of JSON input
at JSON.parse ()
at Function.editor_BraftEditor.createEditorState.external_draft_js_.EditorState.createFrom [as createEditorState] (index.js:6250)
at new Braft (BraftEditor.js:84)
at constructClassInstance (react-dom.development.js:11312)
at updateClassComponent (react-dom.development.js:14481)
at beginWork (react-dom.development.js:15438)
at performUnitOfWork (react-dom.development.js:19106)
at workLoop (react-dom.development.js:19146)
at renderRoot (react-dom.development.js:19229)
at performWorkOnRoot (react-dom.development.js:20136)
at performWork (react-dom.development.js:20048)
at performSyncWork (react-dom.development.js:20022)
at requestWork (react-dom.development.js:19891)
at scheduleWork (react-dom.development.js:19705)
at Object.enqueueSetState (react-dom.development.js:11141)
at DynamicComponent../node_modules/react/cjs/react.development.js.Component.setState (react.development.js:335)
at dynamic.js:91

之后

SyntaxError: Unexpected token < in JSON at position 0
at JSON.parse ()
at Function.editor_BraftEditor.createEditorState.external_draft_js_.EditorState.createFrom [as createEditorState] (index.js:6250)
at BraftEditor.js:105

谷歌也会有这个error 但是加载显示无任何问题。

antd-form表单中中使用braft-extensions问题

在antd表单中使用getFieldDecorator绑定braft组件时,设置了CodeHighlighter代码高亮扩展功能,并且在getFieldDecorator的initialValue中按照官方案例初始化赋值,此时CodeHighlighter代码高亮功能失效。
请问是否此扩展功能无法和antd的getFieldDecorator功能一起使用?

详细代码:

`

BraftEditor.use(CodeHighlighter({ includeEditors: ['editor'] }));

export default class Publish extends PureComponent {
state = {
editorInitValue: BraftEditor.createEditorState('请输入正文', { editorId: 'editor' })
};

 render () {

 return (

      <Form>
         <Form.Item label='正文'>
              {getFieldDecorator('content', {
              // 初始化赋值无效
              initialValue: editorInitValue,
              validateTrigger: 'onBlur, onChange',
              rules: [{
              required: true,
              validator: (_, value, callback) => {
                   if (!value) {
                        callback('正文内容不能为空');
                    } else {
                        console.log(value.toRAW());
                        callback();
                    }
                }
            }],
          })(

            <BraftEditor
              id="editor"
              className={style.editor}
            />

          )}
        </Form.Item>
   </Form>

)

}
}

`

标题id属性扩展以及控制媒体库问题咨询...

当我们写文章时,比如在语雀中,它会自动给h1-h3标题的块加上id属性,这样的话,通过元素类型和id属性,我们可以构造文档页面的锚点,并将页面锚点组织起来形成文档的大纲,对于文档系统来说,这简直是一大利器,非常好用
无奈,才疏学浅,看了Draft.js的默认块的定制,似乎没能找到hack进braft-editor来实现该功能的方法...
希望大神能指点一下解决思路,文档我自己看...

还有,上传图片的时候我希望能在数据库里面记录某文章中所有上传过的图片(文章的图片库),将图片库和组件的媒体库关联起来,这样,媒体库中文件删除时,我这边会按照数据库中记录的图片信息去云端删除该图片,减少无用图片的存储
但目前的问题是,没找到直接插入数据到媒体库的,根据数据库中的图片信息来初始化媒体库的方法...
大神,求指点...

English support

Hi!
looks great, any chance for English components?
Thanks!

在antd的form中使用表格的问题

在点击插入表格,弹框显示行列设置,点击确认后,触发了form的submit事件;需要将行列设置面板里的按钮加上属性type=“button”,防止意外提交

代码高亮问题

用了代码高亮模块,生成的代码里class前缀是lang-不是language-,展示页引入prism.js和prism.css无法高亮显示

table功能线条及样式保存问题

在使用表格扩展的时候,editorState.toHTML()转化出来的html代码没有了表格的样式,表格的线条什么的都没有了,请问有什么方法取到对应的html代码吗?包的版本:"braft-convert": "^2.1.11","braft-editor": "^2.1.36","braft-extensions": "0.0.13","braft-utils": "^3.0.9"

Process data from onConfirm modal

Hi @margox
I want to create a extension for UnsplashFinder
This is my code:

import React from 'react';
import Unsplash from './Unsplash';

export default (config = {}) => {
    const { includeEditors, apiKey, excludeEditors, id = 'unsplash' } = config;
    return {
        type: 'entity',
        name: 'UNSPLASH',
        mutability: 'IMMUTABLE',
        includeEditors,
        excludeEditors,
        control: props => {
            return {
                key: 'unsplash',
                type: 'modal',
                title: 'Unsplash',
                text: 'Unsplash',
                modal: {
                    id: id,
                    title: 'Unsplash Finder',
                    showCancel: true,
                    showConfirm: true,
                    confirmable: true,
                    showFooter: true,
                    component: (
                        <Unsplash apiKey={apiKey} editor={props.editor} editorState={props.editorState} />
                    ),
                    onConfirm: () => {
                        console.log(1111);
                    }
                }
            };
        }
    };
};

You can imagine it similar to Media
How can I insert my data from onConfirm?
I can submit it from Unsplash component but I can't find a closes modal method.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.