Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:sparkles: https://github.com/siyuan-note/siyuan/issues/8895

Vanessa01739b6682e9
diff --git a/app/appearance/langs/en_US.json b/app/appearance/langs/en_US.json
index 746490fa97..02ffc634a3 100644
--- a/app/appearance/langs/en_US.json
+++ b/app/appearance/langs/en_US.json
@@ -1,4 +1,5 @@
{
+ "filesMedia":"Files & media",
"removeBookmark": "Remove bookmark from ${x}?",
"defaultMargin": "Default",
"noneMargin": "None",
diff --git a/app/appearance/langs/es_ES.json b/app/appearance/langs/es_ES.json
index 4aad6e5624..c2c0546831 100644
--- a/app/appearance/langs/es_ES.json
+++ b/app/appearance/langs/es_ES.json
@@ -1,4 +1,5 @@
{
+ "filesMedia":"Archivos y medios",
"removeBookmark": "¿Eliminar marcador de ${x}?",
"lockEdit": "Hacer que el documento sea de sólo lectura",
"unlockEdit": "Hacer que el documento sea escribible",
diff --git a/app/appearance/langs/fr_FR.json b/app/appearance/langs/fr_FR.json
index 3b8b54c2cc..3531be1c1d 100644
--- a/app/appearance/langs/fr_FR.json
+++ b/app/appearance/langs/fr_FR.json
@@ -1,4 +1,5 @@
{
+ "filesMedia": "Fichiers et médias",
"removeBookmark": "Supprimer le signet de ${x} ?",
"lockEdit": "Rendre le document en lecture seule",
"unlockEdit": "Rendre le document accessible en écriture",
diff --git a/app/appearance/langs/zh_CHT.json b/app/appearance/langs/zh_CHT.json
index a8e57dfbd8..66e1501696 100644
--- a/app/appearance/langs/zh_CHT.json
+++ b/app/appearance/langs/zh_CHT.json
@@ -1,4 +1,5 @@
{
+ "filesMedia":"檔案與多媒體",
"removeBookmark": "移除 ${x} 中的書籤?",
"lockEdit": "鎖定編輯",
"unlockEdit": "解除鎖定",
diff --git a/app/appearance/langs/zh_CN.json b/app/appearance/langs/zh_CN.json
index 1ae7f285cf..b8490adffb 100644
--- a/app/appearance/langs/zh_CN.json
+++ b/app/appearance/langs/zh_CN.json
@@ -1,4 +1,5 @@
{
+ "filesMedia":"文件和多媒体",
"removeBookmark": "移除 ${x} 中的书签?",
"lockEdit": "锁定编辑",
"unlockEdit": "解除锁定",
diff --git a/app/src/protyle/render/av/addCol.ts b/app/src/protyle/render/av/addCol.ts
index 53760ff4a7..c7feb0f8a3 100644
--- a/app/src/protyle/render/av/addCol.ts
+++ b/app/src/protyle/render/av/addCol.ts
@@ -12,7 +12,7 @@ export const addCol = (protyle: IProtyle, blockElement: Element) => {
const id = Lute.NewNodeID();
transaction(protyle, [{
action: "addAttrViewCol",
- name: "Text",
+ name: window.siyuan.languages.text,
avID,
type: "text",
id
@@ -25,7 +25,7 @@ export const addCol = (protyle: IProtyle, blockElement: Element) => {
blockElement: blockElement,
protyle: protyle,
type: "text",
- name: "Text",
+ name: window.siyuan.languages.text,
id
});
}
@@ -37,7 +37,7 @@ export const addCol = (protyle: IProtyle, blockElement: Element) => {
const id = Lute.NewNodeID();
transaction(protyle, [{
action: "addAttrViewCol",
- name: "Number",
+ name: window.siyuan.languages.number,
avID,
type: "number",
id
@@ -50,7 +50,7 @@ export const addCol = (protyle: IProtyle, blockElement: Element) => {
blockElement: blockElement,
protyle: protyle,
type: "number",
- name: "Number",
+ name: window.siyuan.languages.number,
id
});
}
@@ -62,7 +62,7 @@ export const addCol = (protyle: IProtyle, blockElement: Element) => {
const id = Lute.NewNodeID();
transaction(protyle, [{
action: "addAttrViewCol",
- name: "Select",
+ name: window.siyuan.languages.select,
avID,
type: "select",
id
@@ -75,7 +75,7 @@ export const addCol = (protyle: IProtyle, blockElement: Element) => {
blockElement: blockElement,
protyle: protyle,
type: "select",
- name: "Select",
+ name: window.siyuan.languages.select,
id
});
}
@@ -87,7 +87,7 @@ export const addCol = (protyle: IProtyle, blockElement: Element) => {
const id = Lute.NewNodeID();
transaction(protyle, [{
action: "addAttrViewCol",
- name: "Multi-select",
+ name: window.siyuan.languages.multiSelect,
avID,
type: "mSelect",
id
@@ -100,7 +100,7 @@ export const addCol = (protyle: IProtyle, blockElement: Element) => {
blockElement: blockElement,
protyle: protyle,
type: "mSelect",
- name: "Multi-select",
+ name: window.siyuan.languages.multiSelect,
id
});
}
@@ -112,7 +112,7 @@ export const addCol = (protyle: IProtyle, blockElement: Element) => {
const id = Lute.NewNodeID();
transaction(protyle, [{
action: "addAttrViewCol",
- name: "Date",
+ name: window.siyuan.languages.date,
avID,
type: "date",
id
@@ -125,7 +125,32 @@ export const addCol = (protyle: IProtyle, blockElement: Element) => {
blockElement: blockElement,
protyle: protyle,
type: "date",
- name: "Date",
+ name: window.siyuan.languages.date,
+ id
+ });
+ }
+ });
+ menu.addItem({
+ icon: "iconImage",
+ label: window.siyuan.languages.filesMedia,
+ click() {
+ const id = Lute.NewNodeID();
+ transaction(protyle, [{
+ action: "addAttrViewCol",
+ name: window.siyuan.languages.filesMedia,
+ avID,
+ type: "mAsset",
+ id
+ }], [{
+ action: "removeAttrViewCol",
+ id,
+ avID,
+ }]);
+ addAttrViewColAnimation({
+ blockElement: blockElement,
+ protyle: protyle,
+ type: "mAsset",
+ name: window.siyuan.languages.filesMedia,
id
});
}
@@ -137,7 +162,7 @@ export const addCol = (protyle: IProtyle, blockElement: Element) => {
const id = Lute.NewNodeID();
transaction(protyle, [{
action: "addAttrViewCol",
- name: "URL",
+ name: window.siyuan.languages.link,
avID,
type: "url",
id
@@ -150,7 +175,7 @@ export const addCol = (protyle: IProtyle, blockElement: Element) => {
blockElement: blockElement,
protyle: protyle,
type: "url",
- name: "URL",
+ name: window.siyuan.languages.link,
id
});
}
@@ -162,7 +187,7 @@ export const addCol = (protyle: IProtyle, blockElement: Element) => {
const id = Lute.NewNodeID();
transaction(protyle, [{
action: "addAttrViewCol",
- name: "Email",
+ name: window.siyuan.languages.email,
avID,
type: "email",
id
@@ -175,7 +200,7 @@ export const addCol = (protyle: IProtyle, blockElement: Element) => {
blockElement: blockElement,
protyle: protyle,
type: "email",
- name: "Email",
+ name: window.siyuan.languages.email,
id
});
}
@@ -187,7 +212,7 @@ export const addCol = (protyle: IProtyle, blockElement: Element) => {
const id = Lute.NewNodeID();
transaction(protyle, [{
action: "addAttrViewCol",
- name: "Phone",
+ name: window.siyuan.languages.phone,
avID,
type: "phone",
id
@@ -200,7 +225,7 @@ export const addCol = (protyle: IProtyle, blockElement: Element) => {
blockElement: blockElement,
protyle: protyle,
type: "phone",
- name: "Phone",
+ name: window.siyuan.languages.phone,
id
});
}
diff --git a/app/src/types/index.d.ts b/app/src/types/index.d.ts
index bf7dfc9ba5..5e4144cd7e 100644
--- a/app/src/types/index.d.ts
+++ b/app/src/types/index.d.ts
@@ -60,6 +60,7 @@ type TAVCol =
| "url"
| "email"
| "phone"
+ | "mAsset"
type THintSource = "search" | "av" | "hint";
type TAVFilterOperator =
"="