Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Vanessa 2024-05-11 09:28:44 +08:00
commit 46c9f35b84
17 changed files with 215 additions and 46 deletions

View file

@ -900,7 +900,7 @@
* `fromID`:定义块 ID
* `toID`:目标块 ID
* `refIDs`:指向定义块 ID 的引用所在块 ID可选如果不指定所有指向定义块 ID 的引用 ID 都会被转移
* `refIDs`:指向定义块 ID 的引用所在块 ID可选如果不指定所有指向定义块 ID 的引用 ID 都会被转移
* 返回值
```json

View file

@ -58,7 +58,7 @@
* 网页剪藏
* PDF 标注双链
* 导出
* 引用和嵌入块
* 引用和嵌入块
* 带 assets 文件夹的标准 Markdown
* PDF、Word 和 HTML
* 复制到微信公众号、知乎和语雀

View file

@ -917,7 +917,7 @@
"missingAssets": "丟失的資料文件",
"unreferencedAssets": "未引用的資料文件",
"paste": "貼上",
"pasteRef": "貼上引用",
"pasteRef": "貼上引用",
"pasteEmbed": "貼上塊嵌入",
"cut": "剪下",
"mentions": "提及",
@ -1018,7 +1018,7 @@
"fileTree20": "使用單行保存",
"fileTree21": "啟用後儲存 .sy 文件和資料庫 .json 時將使用單行 JSON 格式,大約能減少 30% 檔案大小並提升 50% 讀寫效率",
"export10": "例如 <code class='fn__code'>&lt;span style=\"color: #fff;background-color: black;padding: 4px;border-radius: 5px;float:right;\"&gt;SiYuan&lt;/span&gt;</code> ,為空時使用水印文字或浮水印檔案路徑。",
"export11": "匯出時關於引用內容的處理方式",
"export11": "匯出時關於引用內容的處理方式",
"export12": "匯出時關於嵌入塊內容的處理方式",
"export13": "錨文字包裹符號",
"export14": "請依次在輸入框中填寫錨文字左側符號和錨文字右側符號",
@ -1065,7 +1065,7 @@
"closeRight": "關閉右側分頁",
"closeUnmodified": "關閉未修改的分頁",
"newFileTip": "請先打開一個筆記本",
"copyBlockRef": "複製為引用",
"copyBlockRef": "複製為引用",
"copyBlockEmbed": "複製為嵌入塊",
"linkLevel": "層級",
"mark": "標記",

View file

@ -917,7 +917,7 @@
"missingAssets": "丢失的资源文件",
"unreferencedAssets": "未引用的资源文件",
"paste": "粘贴",
"pasteRef": "粘贴引用",
"pasteRef": "粘贴引用",
"pasteEmbed": "粘贴块嵌入",
"cut": "剪切",
"mentions": "提及",
@ -1018,7 +1018,7 @@
"fileTree20": "使用单行保存",
"fileTree21": "启用后保存 .sy 文档和数据库 .json 时将使用单行 JSON 格式,大约能减少 30% 文件大小并提升 50% 读写效率",
"export10": "例如 <code class='fn__code'>&lt;span style=\"color: #fff;background-color: black;padding: 4px;border-radius: 5px;float:right;\"&gt;SiYuan&lt;/span&gt;</code> ,为空时使用水印文本或水印文件路径。",
"export11": "导出时关于引用内容的处理方式",
"export11": "导出时关于引用内容的处理方式",
"export12": "导出时关于嵌入块内容的处理方式",
"export13": "锚文本包裹符号",
"export14": "请依次在输入框中填写锚文本左侧符号和锚文本右侧符号",
@ -1065,7 +1065,7 @@
"closeRight": "关闭右侧页签",
"closeUnmodified": "关闭未修改的页签",
"newFileTip": "请先打开一个笔记本",
"copyBlockRef": "复制为引用",
"copyBlockRef": "复制为引用",
"copyBlockEmbed": "复制为嵌入块",
"linkLevel": "层级",
"mark": "标记",

View file

@ -6,7 +6,7 @@
"id": "20200924101225-k254i8g",
"title": "Content Block Type",
"type": "doc",
"updated": "20240427231144"
"updated": "20240510235721"
},
"Children": [
{
@ -1814,7 +1814,8 @@
"ID": "20210104091538-9zkv22k",
"Type": "NodeParagraph",
"Properties": {
"id": "20210104091538-9zkv22k"
"id": "20210104091538-9zkv22k",
"updated": "20210104091538"
},
"Children": [
{
@ -1834,6 +1835,20 @@
}
]
},
{
"ID": "20240510235622-zfu6ujw",
"Type": "NodeParagraph",
"Properties": {
"id": "20240510235622-zfu6ujw",
"updated": "20240510235721"
},
"Children": [
{
"Type": "NodeText",
"Data": "The unordered list block can only contain list item blocks, and neighboring unordered list blocks are widely spaced."
}
]
},
{
"ID": "20210104091538-lb00enw",
"Type": "NodeParagraph",
@ -2003,12 +2018,13 @@
"ID": "20210104091538-1ix6ueu",
"Type": "NodeParagraph",
"Properties": {
"id": "20210104091538-1ix6ueu"
"id": "20210104091538-1ix6ueu",
"updated": "20240510235637"
},
"Children": [
{
"Type": "NodeText",
"Data": "An ordered list block is a type "
"Data": "The ordered list block is a type "
},
{
"Type": "NodeTextMark",
@ -2023,6 +2039,20 @@
}
]
},
{
"ID": "20240510235620-trltkc3",
"Type": "NodeParagraph",
"Properties": {
"id": "20240510235620-trltkc3",
"updated": "20240510235659"
},
"Children": [
{
"Type": "NodeText",
"Data": "The ordered list block can only contain list item blocks, and neighboring ordered list blocks are widely spaced."
}
]
},
{
"ID": "20210104091538-uz0na96",
"Type": "NodeHeading",
@ -2200,6 +2230,20 @@
}
]
},
{
"ID": "20240510235512-za4depm",
"Type": "NodeParagraph",
"Properties": {
"id": "20240510235512-za4depm",
"updated": "20240510235706"
},
"Children": [
{
"Type": "NodeText",
"Data": "The task list block can only contain list item blocks, and neighboring task list blocks are widely spaced."
}
]
},
{
"ID": "20210104091538-wqiaxdu",
"Type": "NodeHeading",
@ -2265,7 +2309,8 @@
"ID": "20210104091538-lbf2al4",
"Type": "NodeParagraph",
"Properties": {
"id": "20210104091538-lbf2al4"
"id": "20210104091538-lbf2al4",
"updated": "20210104091538"
},
"Children": [
{
@ -2285,6 +2330,20 @@
}
]
},
{
"ID": "20240510235301-s4nj22e",
"Type": "NodeParagraph",
"Properties": {
"id": "20240510235301-s4nj22e",
"updated": "20240510235356"
},
"Children": [
{
"Type": "NodeText",
"Data": "List item blocks are contained within a list block, and neighboring list item blocks are less widely spaced."
}
]
},
{
"ID": "20210104091538-w91ot9s",
"Type": "NodeHeading",

View file

@ -371,7 +371,7 @@
"Children": [
{
"Type": "NodeText",
"Data": "鼠标悬浮引用前面的标识会弹出预览浮窗"
"Data": "鼠标悬浮引用前面的标识会弹出预览浮窗"
}
]
}
@ -403,7 +403,7 @@
"Children": [
{
"Type": "NodeText",
"Data": "单击反链列表中的引用进行跳转"
"Data": "单击反链列表中的引用进行跳转"
}
]
}

View file

@ -6,7 +6,7 @@
"id": "20200905090211-2vixtlf",
"title": "内容块类型",
"type": "doc",
"updated": "20240427230507"
"updated": "20240510235019"
},
"Children": [
{
@ -1819,11 +1819,26 @@
}
]
},
{
"ID": "20240510234951-58h7o7g",
"Type": "NodeParagraph",
"Properties": {
"id": "20240510234951-58h7o7g",
"updated": "20240510235019"
},
"Children": [
{
"Type": "NodeText",
"Data": "无序列表块只能包含列表项块,相邻的无序列表块间距较大。"
}
]
},
{
"ID": "20210104090624-5p4i03b",
"Type": "NodeParagraph",
"Properties": {
"id": "20210104090624-5p4i03b"
"id": "20210104090624-5p4i03b",
"updated": "20210104090624"
},
"Children": [
{
@ -1837,7 +1852,7 @@
},
{
"Type": "NodeText",
"Data": "。"
"Data": "。"
}
]
},
@ -1987,7 +2002,8 @@
"ID": "20210104090624-13yo86l",
"Type": "NodeParagraph",
"Properties": {
"id": "20210104090624-13yo86l"
"id": "20210104090624-13yo86l",
"updated": "20210104090624"
},
"Children": [
{
@ -2007,6 +2023,20 @@
}
]
},
{
"ID": "20240510234949-rphupr1",
"Type": "NodeParagraph",
"Properties": {
"id": "20240510234949-rphupr1",
"updated": "20240510234959"
},
"Children": [
{
"Type": "NodeText",
"Data": "有序列表块只能包含列表项块,相邻的有序列表块间距较大。"
}
]
},
{
"ID": "20210104090624-mvu5j2d",
"Type": "NodeHeading",
@ -2184,6 +2214,20 @@
}
]
},
{
"ID": "20240510234858-y5tx7l9",
"Type": "NodeParagraph",
"Properties": {
"id": "20240510234858-y5tx7l9",
"updated": "20240510234944"
},
"Children": [
{
"Type": "NodeText",
"Data": "任务列表块只能包含列表项块,相邻的任务列表块间距较大。"
}
]
},
{
"ID": "20210104090624-n9anlgh",
"Type": "NodeHeading",
@ -2249,7 +2293,8 @@
"ID": "20210104090624-wcbtwum",
"Type": "NodeParagraph",
"Properties": {
"id": "20210104090624-wcbtwum"
"id": "20210104090624-wcbtwum",
"updated": "20210104090624"
},
"Children": [
{
@ -2269,6 +2314,20 @@
}
]
},
{
"ID": "20240510234715-ystlvq4",
"Type": "NodeParagraph",
"Properties": {
"id": "20240510234715-ystlvq4",
"updated": "20240510234833"
},
"Children": [
{
"Type": "NodeText",
"Data": "列表项块被包含在列表块内,相邻的列表项块间距较小。"
}
]
},
{
"ID": "20210104090624-37f19ny",
"Type": "NodeHeading",

View file

@ -3445,7 +3445,7 @@
"Children": [
{
"Type": "NodeText",
"Data": "复制该块为引用"
"Data": "复制该块为引用"
}
]
},

View file

@ -180,7 +180,7 @@
"Children": [
{
"Type": "NodeText",
"Data": "在 PDF 中鼠标悬浮标注可预览引用块"
"Data": "在 PDF 中鼠标悬浮标注可预览引用标注的块"
}
]
}

View file

@ -6,7 +6,7 @@
"id": "20211226120147-ib6yy3i",
"title": "內容塊類型",
"type": "doc",
"updated": "20240427230732"
"updated": "20240510235243"
},
"Children": [
{
@ -1763,6 +1763,20 @@
}
]
},
{
"ID": "20240510235226-7fqokpj",
"Type": "NodeParagraph",
"Properties": {
"id": "20240510235226-7fqokpj",
"updated": "20240510235233"
},
"Children": [
{
"Type": "NodeText",
"Data": "無序列表塊只能包含列表項塊,相鄰的無序列表塊間距較大。"
}
]
},
{
"ID": "20211226120227-wx6gvu6",
"Type": "NodeParagraph",
@ -1934,6 +1948,20 @@
}
]
},
{
"ID": "20240510235224-yj7efu2",
"Type": "NodeParagraph",
"Properties": {
"id": "20240510235224-yj7efu2",
"updated": "20240510235237"
},
"Children": [
{
"Type": "NodeText",
"Data": "有序列表塊只能包含列表項塊,相鄰的有序列表塊間距較大。"
}
]
},
{
"ID": "20211226120227-16ew3ez",
"Type": "NodeHeading",
@ -2089,6 +2117,20 @@
}
]
},
{
"ID": "20240510235222-wwcw8cn",
"Type": "NodeParagraph",
"Properties": {
"id": "20240510235222-wwcw8cn",
"updated": "20240510235243"
},
"Children": [
{
"Type": "NodeText",
"Data": "任務列表塊只能包含列表項塊,相鄰的任務列表塊間距較大。"
}
]
},
{
"ID": "20211226120227-ot6klof",
"Type": "NodeHeading",
@ -2168,6 +2210,20 @@
}
]
},
{
"ID": "20240510235159-gjhzzj5",
"Type": "NodeParagraph",
"Properties": {
"id": "20240510235159-gjhzzj5",
"updated": "20240510235159"
},
"Children": [
{
"Type": "NodeText",
"Data": "列表項塊被包含在列表塊內,相鄰的列表項塊間距較小。"
}
]
},
{
"ID": "20211226120227-7tg2ytf",
"Type": "NodeHeading",

View file

@ -326,7 +326,7 @@
"Children": [
{
"Type": "NodeText",
"Data": "滑鼠懸浮引用前面的標識會彈出預覽浮窗"
"Data": "滑鼠懸浮引用前面的標識會彈出預覽浮窗"
}
]
}
@ -354,7 +354,7 @@
"Children": [
{
"Type": "NodeText",
"Data": "單擊反連列表中的引用進行跳轉"
"Data": "單擊反連列表中的引用進行跳轉"
}
]
}

View file

@ -3441,7 +3441,7 @@
"Children": [
{
"Type": "NodeText",
"Data": "複製該塊為引用"
"Data": "複製該塊為引用"
}
]
},
@ -6665,7 +6665,7 @@
"Children": [
{
"Type": "NodeText",
"Data": "在下側打開引用"
"Data": "在下側打開引用"
}
]
},
@ -7444,7 +7444,7 @@
"Children": [
{
"Type": "NodeText",
"Data": "引用"
"Data": "引用"
}
]
},

View file

@ -181,7 +181,7 @@
"Children": [
{
"Type": "NodeText",
"Data": "在 PDF 中滑鼠懸浮標注可預覽引用塊"
"Data": "在 PDF 中滑鼠懸浮標注可預覽引用標注的塊"
}
]
}

View file

@ -35,7 +35,7 @@ export const hintSlash = (key: string, protyle: IProtyle) => {
value: Constants.ZWSP + 2,
html: `<div class="b3-list-item__first"><svg class="b3-list-item__graphic"><use xlink:href="#iconImage"></use></svg><span class="b3-list-item__text">${window.siyuan.languages.assets}</span></div>`,
}, {
filter: ["引用", "yinyong", "yy", "block reference"],
filter: ["引用", "yinyong", "yy", "block reference"],
value: "((",
html: `<div class="b3-list-item__first"><svg class="b3-list-item__graphic"><use xlink:href="#iconRef"></use></svg><span class="b3-list-item__text">${window.siyuan.languages.ref}</span><span class="b3-list-item__meta">((</span></div>`,
}, {

View file

@ -49,7 +49,7 @@ const removeTopElement = (updateElement: Element, protyle: IProtyle) => {
}
};
// 用于执行操作,外加处理当前编辑器中引用、嵌入块的更新
// 用于执行操作,外加处理当前编辑器中引用、嵌入块的更新
const promiseTransaction = () => {
if (window.siyuan.transactions.length === 0) {
return;
@ -172,7 +172,7 @@ const promiseTransaction = () => {
}
// 当前编辑器中更新嵌入块
updateEmbed(protyle, operation);
// 更新引用
// 更新引用
updateRef(protyle, operation.id);
return;
}
@ -293,7 +293,7 @@ const promiseTransaction = () => {
// blockRender(protyle, item);
// }
// });
// 更新引用
// 更新引用
updateRef(protyle, operation.id);
}
});
@ -371,7 +371,7 @@ const updateBlock = (updateElements: Element[], protyle: IProtyle, operation: IO
blockRender(protyle, updateElements.length === 1 ? updateElements[0] : protyle.wysiwyg.element);
// 更新 ws 嵌入块
updateEmbed(protyle, operation);
// 更新 ws 引用
// 更新 ws 引用
updateRef(protyle, operation.id);
};
@ -476,7 +476,7 @@ export const onTransaction = (protyle: IProtyle, operation: IOperation, isUndo:
} else { // updateElements 没有包含嵌入块,在悬浮层编辑嵌入块时,嵌入块也需要更新
// 更新 ws 嵌入块
updateEmbed(protyle, operation);
// 更新 ws 引用
// 更新 ws 引用
updateRef(protyle, operation.id);
}
return;
@ -733,7 +733,7 @@ export const onTransaction = (protyle: IProtyle, operation: IOperation, isUndo:
wbrElement.remove();
}
});
// 更新 ws 引用
// 更新 ws 引用
updateRef(protyle, operation.id);
return;
}

View file

@ -1019,14 +1019,6 @@ func renderAttributeViewTable(attrView *av.AttributeView, view *av.View, query s
}
rows[val.BlockID] = values
}
// 数据订正,补全关联
if av.KeyTypeRelation == keyValues.Key.Type && nil != keyValues.Key.Relation {
av.UpsertAvBackRel(attrView.ID, keyValues.Key.Relation.AvID)
if keyValues.Key.Relation.IsTwoWay {
av.UpsertAvBackRel(keyValues.Key.Relation.AvID, attrView.ID)
}
}
}
// 过滤掉不存在的行
@ -1655,6 +1647,9 @@ func updateAttributeViewColRelation(operation *Operation) (err error) {
}
av.UpsertAvBackRel(srcAv.ID, destAv.ID)
if operation.IsTwoWay && !isSameAv {
av.UpsertAvBackRel(destAv.ID, srcAv.ID)
}
return
}

View file

@ -1378,7 +1378,7 @@ func (tx *Transaction) writeTree(tree *parse.Tree) (err error) {
return
}
// refreshDynamicRefText 用于刷新引用的动态锚文本。
// refreshDynamicRefText 用于刷新引用的动态锚文本。
// 该实现依赖了数据库缓存,导致外部调用时可能需要阻塞等待数据库写入后才能获取到 refs
func refreshDynamicRefText(updatedDefNode *ast.Node, updatedTree *parse.Tree) {
changedDefs := map[string]*ast.Node{updatedDefNode.ID: updatedDefNode}
@ -1386,7 +1386,7 @@ func refreshDynamicRefText(updatedDefNode *ast.Node, updatedTree *parse.Tree) {
refreshDynamicRefTexts(changedDefs, changedTrees)
}
// refreshDynamicRefTexts 用于批量刷新引用的动态锚文本。
// refreshDynamicRefTexts 用于批量刷新引用的动态锚文本。
// 该实现依赖了数据库缓存,导致外部调用时可能需要阻塞等待数据库写入后才能获取到 refs
func refreshDynamicRefTexts(updatedDefNodes map[string]*ast.Node, updatedTrees map[string]*parse.Tree) {
// 1. 更新引用的动态锚文本