mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-06 08:48:49 +01:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
2b273974b4
5 changed files with 58 additions and 31 deletions
27
README.md
27
README.md
|
|
@ -52,7 +52,6 @@ Most features are free, even for commercial use.
|
|||
* Markdown WYSIWYG
|
||||
* List outline
|
||||
* Block zoom-in
|
||||
* Block horizontal layout
|
||||
* Million-word large document editing
|
||||
* Mathematical formulas, charts, flowcharts, Gantt charts, timing charts, staffs, etc.
|
||||
* Web clipping
|
||||
|
|
@ -64,11 +63,13 @@ Most features are free, even for commercial use.
|
|||
* Copy to WeChat MP, Zhihu and Yuque
|
||||
* Database
|
||||
* Table view
|
||||
* Spaced repetition
|
||||
* Flashcard spaced repetition
|
||||
* AI writing and Q/A chat via OpenAI API
|
||||
* Tesseract OCR
|
||||
* Multi-tab, drag and drop to split screen
|
||||
* Template snippet
|
||||
* JavaScript/CSS snippet
|
||||
* Android/iOS APP
|
||||
* Android/iOS App
|
||||
* Docker deployment
|
||||
* [API](https://github.com/siyuan-note/siyuan/blob/master/API.md)
|
||||
* Community marketplace
|
||||
|
|
@ -79,16 +80,16 @@ Some features are only available to paid members, for more details please refer
|
|||
|
||||

|
||||
|
||||
| Project | Description | Forks | Stars |
|
||||
|----------------------------------------------------------|-------------------------|---------------------------------------------------------------------------------|--------------------------------------------------------------------------------------|
|
||||
| [lute](https://github.com/88250/lute) | Editor engine |  |  |
|
||||
| [chrome](https://github.com/siyuan-note/siyuan-chrome) | Chrome/Edge extension |  |  |
|
||||
| [bazaar](https://github.com/siyuan-note/bazaar) | Community marketplace |  |  |
|
||||
| [dejavu](https://github.com/siyuan-note/dejavu) | Data repo |  |  |
|
||||
| [petal](https://github.com/siyuan-note/petal) | Plugin API |  |  |
|
||||
| [android](https://github.com/siyuan-note/siyuan-android) | Android APP |  |  |
|
||||
| [ios](https://github.com/siyuan-note/siyuan-ios) | iOS APP |  |  |
|
||||
| [riff](https://github.com/siyuan-note/riff) | Spaced repetition |  |  |
|
||||
| Project | Description | Forks | Stars |
|
||||
|----------------------------------------------------------|-----------------------|---------------------------------------------------------------------------------|--------------------------------------------------------------------------------------|
|
||||
| [lute](https://github.com/88250/lute) | Editor engine |  |  |
|
||||
| [chrome](https://github.com/siyuan-note/siyuan-chrome) | Chrome/Edge extension |  |  |
|
||||
| [bazaar](https://github.com/siyuan-note/bazaar) | Community marketplace |  |  |
|
||||
| [dejavu](https://github.com/siyuan-note/dejavu) | Data repo |  |  |
|
||||
| [petal](https://github.com/siyuan-note/petal) | Plugin API |  |  |
|
||||
| [android](https://github.com/siyuan-note/siyuan-android) | Android App |  |  |
|
||||
| [ios](https://github.com/siyuan-note/siyuan-ios) | iOS App |  |  |
|
||||
| [riff](https://github.com/siyuan-note/riff) | Spaced repetition |  |  |
|
||||
|
||||
## 🌟 Star History
|
||||
|
||||
|
|
|
|||
|
|
@ -53,7 +53,6 @@
|
|||
* Markdown 所见即所得
|
||||
* 列表大纲
|
||||
* 块缩放聚焦
|
||||
* 块横向排版
|
||||
* 百万字大文档编辑
|
||||
* 数学公式、图表、流程图、甘特图、时序图、五线谱等
|
||||
* 网页剪藏
|
||||
|
|
@ -65,10 +64,12 @@
|
|||
* 复制到微信公众号、知乎和语雀
|
||||
* 数据库
|
||||
* 表格视图
|
||||
* 间隔重复
|
||||
* 闪卡间隔重复
|
||||
* 接入 OpenAI 接口支持人工智能写作和问答聊天
|
||||
* Tesseract OCR
|
||||
* 模板片段
|
||||
* JavaScript/CSS 代码片段
|
||||
* Android/iOS APP
|
||||
* Android/iOS App
|
||||
* Docker 部署
|
||||
* [API](API_zh_CN.md)
|
||||
* 社区集市
|
||||
|
|
@ -86,8 +87,8 @@
|
|||
| [bazaar](https://github.com/siyuan-note/bazaar) | 社区集市 |  |  |
|
||||
| [dejavu](https://github.com/siyuan-note/dejavu) | 数据仓库 |  |  |
|
||||
| [petal](https://github.com/siyuan-note/petal) | 插件 API |  |  |
|
||||
| [android](https://github.com/siyuan-note/siyuan-android) | Android APP |  |  |
|
||||
| [ios](https://github.com/siyuan-note/siyuan-ios) | iOS APP |  |  |
|
||||
| [android](https://github.com/siyuan-note/siyuan-android) | Android App |  |  |
|
||||
| [ios](https://github.com/siyuan-note/siyuan-ios) | iOS App |  |  |
|
||||
| [riff](https://github.com/siyuan-note/riff) | 间隔重复 |  |  |
|
||||
|
||||
## 🌟 Star History
|
||||
|
|
|
|||
|
|
@ -2039,23 +2039,29 @@ func addAttributeViewBlock(avID, blockID, previousBlockID, addingBlockID string,
|
|||
return
|
||||
}
|
||||
|
||||
// 不允许重复添加相同的块到属性视图中
|
||||
var content string
|
||||
if !isDetached {
|
||||
content = getNodeRefText(node)
|
||||
}
|
||||
|
||||
now := time.Now().UnixMilli()
|
||||
|
||||
// 检查是否重复添加相同的块
|
||||
blockValues := attrView.GetBlockKeyValues()
|
||||
for _, blockValue := range blockValues.Values {
|
||||
if blockValue.Block.ID == addingBlockID {
|
||||
if !isDetached {
|
||||
// 重复绑定一下,比如剪切数据库块的场景需要
|
||||
bindBlockAv0(tx, avID, blockID, node, tree)
|
||||
// 重复绑定一下,比如剪切数据库块、取消绑定块后再次添加的场景需要
|
||||
bindBlockAv0(tx, avID, node, tree)
|
||||
blockValue.IsDetached = isDetached
|
||||
blockValue.Block.Content = content
|
||||
blockValue.UpdatedAt = now
|
||||
err = av.SaveAttributeView(attrView)
|
||||
}
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
var content string
|
||||
if !isDetached {
|
||||
content = getNodeRefText(node)
|
||||
}
|
||||
now := time.Now().UnixMilli()
|
||||
blockValue := &av.Value{
|
||||
ID: ast.NewNodeID(),
|
||||
KeyID: blockValues.Key.ID,
|
||||
|
|
@ -2148,7 +2154,7 @@ func addAttributeViewBlock(avID, blockID, previousBlockID, addingBlockID string,
|
|||
}
|
||||
|
||||
if !isDetached {
|
||||
bindBlockAv0(tx, avID, blockID, node, tree)
|
||||
bindBlockAv0(tx, avID, node, tree)
|
||||
}
|
||||
|
||||
for _, v := range attrView.Views {
|
||||
|
|
@ -3069,6 +3075,11 @@ func unbindBlockAv(tx *Transaction, avID, blockID string) {
|
|||
node.SetIALAttr(av.NodeAttrNameAvs, strings.Join(avIDs, ","))
|
||||
}
|
||||
|
||||
avNames := getAvNames(attrs[av.NodeAttrNameAvs])
|
||||
if "" != avNames {
|
||||
attrs[av.NodeAttrViewNames] = avNames
|
||||
}
|
||||
|
||||
if nil != tx {
|
||||
err = setNodeAttrsWithTx(tx, node, tree, attrs)
|
||||
} else {
|
||||
|
|
@ -3087,11 +3098,11 @@ func bindBlockAv(tx *Transaction, avID, blockID string) {
|
|||
return
|
||||
}
|
||||
|
||||
bindBlockAv0(tx, avID, blockID, node, tree)
|
||||
bindBlockAv0(tx, avID, node, tree)
|
||||
return
|
||||
}
|
||||
|
||||
func bindBlockAv0(tx *Transaction, avID, blockID string, node *ast.Node, tree *parse.Tree) {
|
||||
func bindBlockAv0(tx *Transaction, avID string, node *ast.Node, tree *parse.Tree) {
|
||||
attrs := parse.IAL2Map(node.KramdownIAL)
|
||||
if "" == attrs[av.NodeAttrNameAvs] {
|
||||
attrs[av.NodeAttrNameAvs] = avID
|
||||
|
|
@ -3114,7 +3125,7 @@ func bindBlockAv0(tx *Transaction, avID, blockID string, node *ast.Node, tree *p
|
|||
err = setNodeAttrs(node, tree, attrs)
|
||||
}
|
||||
if nil != err {
|
||||
logging.LogWarnf("set node [%s] attrs failed: %s", blockID, err)
|
||||
logging.LogWarnf("set node [%s] attrs failed: %s", node.ID, err)
|
||||
return
|
||||
}
|
||||
return
|
||||
|
|
|
|||
|
|
@ -1312,10 +1312,15 @@ func (tx *Transaction) commit() (err error) {
|
|||
if err = writeJSONQueue(tree); nil != err {
|
||||
return
|
||||
}
|
||||
|
||||
var sources []interface{}
|
||||
for _, op := range tx.DoOperations {
|
||||
sources = append(sources, op.Action)
|
||||
}
|
||||
util.PushSaveDoc(tree.ID, "tx", sources)
|
||||
}
|
||||
refreshDynamicRefTexts(tx.nodes, tx.trees)
|
||||
IncSync()
|
||||
tx.trees = nil
|
||||
tx.state.Store(2)
|
||||
tx.m.Unlock()
|
||||
return
|
||||
|
|
|
|||
|
|
@ -220,6 +220,15 @@ func PushReloadDoc(rootID string) {
|
|||
BroadcastByType("main", "reloaddoc", 0, "", rootID)
|
||||
}
|
||||
|
||||
func PushSaveDoc(rootID, typ string, sources interface{}) {
|
||||
data := map[string]interface{}{
|
||||
"rootID": rootID,
|
||||
"type": typ,
|
||||
"sources": sources,
|
||||
}
|
||||
BroadcastByType("main", "savedoc", 0, "", data)
|
||||
}
|
||||
|
||||
func PushProtyleReload(rootID string) {
|
||||
BroadcastByType("protyle", "reload", 0, "", rootID)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue