Giter Club home page Giter Club logo

Comments (5)

Vanessa219 avatar Vanessa219 commented on May 12, 2024

通过问题2的 API hasClosestBlock 就可以解决问题1了。需要的话我先把 hasClosestBlock 开放出去。由于 getEditorRange 会根据使用场景进行判断,如果光标不在 editor 中会将其设置到第一个块中,从而改变光标的原有位置,就先不放出去了。

from petal.

iamqiz avatar iamqiz commented on May 12, 2024

@Vanessa219
问题1 解决了(用的Zuoqiu-Yingyi的代码),然后我想实现把段落块转换为列表块,之前在思源源码里调用 turnsIntoOneTransaction 加 type:Blocks2ULs ,很方便,但没开放给插件用,建议开放 , 再加上个 focusBlock .
话说能不能让插件无缝对接思源源码,即能够直接使用思源源码里任意函数而不需要特意开放?

from petal.

Vanessa219 avatar Vanessa219 commented on May 12, 2024

我抽空整理一下吧。为了安全性思源源码目前不能直接使用,有需求提就好了,我们会尽快完善的。

from petal.

Vanessa219 avatar Vanessa219 commented on May 12, 2024
  • turnIntoOneTransaction
  • turnIntoTransaction
  • updateTransaction
  • updateBatchTransaction
  • getRange
  • hasClosestBlock
  • focusBlock

from petal.

iamqiz avatar iamqiz commented on May 12, 2024

@Vanessa219 nice~

from petal.

Related Issues (14)

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.