Skip to content

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

:bug: Unify automation collection target selection https://github.com/siyuan-note/siyuan/issues/20646

Daniel78ff55e55458
diff --git a/app/appearance/langs/ar.json b/app/appearance/langs/ar.json
index b4c49901d2..d4ad1f16c7 100644
--- a/app/appearance/langs/ar.json
+++ b/app/appearance/langs/ar.json
@@ -6,7 +6,7 @@
"automationCollectionTarget": "هدف التجميع",
"automationCollectionTargetBlock": "الكتلة التي تحتوي على الوسم",
"automationCollectionTargetContainer": "كتلة الحاوية",
- "automationCollectionTargetDefaultTip": "عند استخدام شروط الوسوم، تنتمي الفقرة الأولى من عنصر القائمة إلى العنصر؛ وتطابق الكتل الأخرى وسومها الخاصة",
+ "automationCollectionTargetDefaultTip": "لوسوم أول كتلة محتوى، فضّل عنصر القائمة المطابق للشروط؛ وإلا فاجمع الكتلة الموسومة المطابقة",
"automationCollectionTargetBlockTip": "عند استخدام شروط الوسوم، اجمع الكتلة التي تحتوي على الوسم وفق نوعها وسماتها",
"automationCollectionTargetContainerTip": "عند استخدام شروط الوسوم، اجمع أقرب حاوية تطابق النوع والسمات؛ ويجب تحديد المستندات صراحةً",
"automationCollectionTargetChangeTip": "يحافظ تغيير الخيار على الإدخالات والحقول الحالية؛ راجع النتائج الجديدة في المعاينة",
diff --git a/app/appearance/langs/de.json b/app/appearance/langs/de.json
index d49d03930f..1cee545000 100644
--- a/app/appearance/langs/de.json
+++ b/app/appearance/langs/de.json
@@ -6,7 +6,7 @@
"automationCollectionTarget": "Sammelziel",
"automationCollectionTargetBlock": "Block mit dem Tag",
"automationCollectionTargetContainer": "Containerblock",
- "automationCollectionTargetDefaultTip": "Bei Tag-Bedingungen gehört der erste Absatz eines Listeneintrags zum Eintrag; andere Blöcke prüfen ihre eigenen Tags",
+ "automationCollectionTargetDefaultTip": "Bei Tags im ersten Inhaltsblock den passenden Listeneintrag bevorzugen; andernfalls den passenden Block mit dem Tag sammeln",
"automationCollectionTargetBlockTip": "Bei Tag-Bedingungen den Block mit dem Tag anhand seines Typs und seiner Attribute sammeln",
"automationCollectionTargetContainerTip": "Bei Tag-Bedingungen den nächsten Container mit passendem Typ und passenden Attributen sammeln; Dokumente müssen ausdrücklich ausgewählt werden",
"automationCollectionTargetChangeTip": "Ein Wechsel erhält vorhandene Einträge und Felder; prüfen Sie die neuen Ergebnisse in der Vorschau",
diff --git a/app/appearance/langs/en.json b/app/appearance/langs/en.json
index ccfd87fffb..481df451db 100644
--- a/app/appearance/langs/en.json
+++ b/app/appearance/langs/en.json
@@ -6,7 +6,7 @@
"automationCollectionTarget": "Collect",
"automationCollectionTargetBlock": "Block containing the tag",
"automationCollectionTargetContainer": "Container block",
- "automationCollectionTargetDefaultTip": "With tag conditions, the first paragraph of a list item belongs to the list item; other blocks match their own tags",
+ "automationCollectionTargetDefaultTip": "Prefer the eligible list item for tags in its first content block; otherwise collect the eligible tagged block",
"automationCollectionTargetBlockTip": "With tag conditions, collect the block containing the tag using its type and attributes",
"automationCollectionTargetContainerTip": "With tag conditions, collect the nearest container matching the type and attributes; documents must be explicitly selected",
"automationCollectionTargetChangeTip": "Changing this option preserves existing entries and fields; preview the collection to check the new results",
diff --git a/app/appearance/langs/es.json b/app/appearance/langs/es.json
index 917158fd74..e455cb50c5 100644
--- a/app/appearance/langs/es.json
+++ b/app/appearance/langs/es.json
@@ -6,7 +6,7 @@
"automationCollectionTarget": "Objeto de recopilación",
"automationCollectionTargetBlock": "Bloque que contiene la etiqueta",
"automationCollectionTargetContainer": "Bloque contenedor",
- "automationCollectionTargetDefaultTip": "Con condiciones de etiquetas, el primer párrafo de un elemento de lista pertenece al elemento; los demás bloques comparan sus propias etiquetas",
+ "automationCollectionTargetDefaultTip": "Para etiquetas en el primer bloque de contenido, priorizar el elemento de lista que cumpla las condiciones; en otro caso, recopilar el bloque etiquetado que las cumpla",
"automationCollectionTargetBlockTip": "Con condiciones de etiquetas, recopilar el bloque que contiene la etiqueta según su tipo y atributos",
"automationCollectionTargetContainerTip": "Con condiciones de etiquetas, recopilar el contenedor más cercano que cumpla el tipo y los atributos; los documentos deben seleccionarse explícitamente",
"automationCollectionTargetChangeTip": "Cambiar esta opción conserva las entradas y los campos existentes; compruebe los nuevos resultados en la vista previa",
diff --git a/app/appearance/langs/fr.json b/app/appearance/langs/fr.json
index cc978d96de..d519727394 100644
--- a/app/appearance/langs/fr.json
+++ b/app/appearance/langs/fr.json
@@ -6,7 +6,7 @@
"automationCollectionTarget": "Objet à collecter",
"automationCollectionTargetBlock": "Bloc contenant l’étiquette",
"automationCollectionTargetContainer": "Bloc conteneur",
- "automationCollectionTargetDefaultTip": "Avec des conditions d’étiquettes, le premier paragraphe d’un élément de liste appartient à cet élément ; les autres blocs vérifient leurs propres étiquettes",
+ "automationCollectionTargetDefaultTip": "Pour les étiquettes du premier bloc de contenu, privilégier l’élément de liste admissible ; sinon, collecter le bloc étiqueté admissible",
"automationCollectionTargetBlockTip": "Avec des conditions d’étiquettes, collecter le bloc contenant l’étiquette selon son type et ses attributs",
"automationCollectionTargetContainerTip": "Avec des conditions d’étiquettes, collecter le conteneur le plus proche correspondant au type et aux attributs ; les documents doivent être sélectionnés explicitement",
"automationCollectionTargetChangeTip": "Changer cette option conserve les entrées et champs existants ; vérifiez les nouveaux résultats dans l’aperçu",
diff --git a/app/appearance/langs/he.json b/app/appearance/langs/he.json
index c0684c43f3..4c778ea5aa 100644
--- a/app/appearance/langs/he.json
+++ b/app/appearance/langs/he.json
@@ -6,7 +6,7 @@
"automationCollectionTarget": "יעד האיסוף",
"automationCollectionTargetBlock": "בלוק המכיל את התגית",
"automationCollectionTargetContainer": "בלוק מכל",
- "automationCollectionTargetDefaultTip": "כאשר מוגדרים תנאי תגיות, הפסקה הראשונה בפריט רשימה שייכת לפריט; בלוקים אחרים בודקים את התגיות שלהם",
+ "automationCollectionTargetDefaultTip": "לתגיות בבלוק התוכן הראשון יש להעדיף את פריט הרשימה המתאים; אחרת יש לאסוף את הבלוק המתויג המתאים",
"automationCollectionTargetBlockTip": "כאשר מוגדרים תנאי תגיות, יש לאסוף את הבלוק המכיל את התגית לפי הסוג והמאפיינים שלו",
"automationCollectionTargetContainerTip": "כאשר מוגדרים תנאי תגיות, יש לאסוף את המכל הקרוב ביותר התואם לסוג ולמאפיינים; יש לבחור מסמכים במפורש",
"automationCollectionTargetChangeTip": "שינוי האפשרות שומר על הרשומות והשדות הקיימים; ניתן לבדוק את התוצאות החדשות בתצוגה המקדימה",
diff --git a/app/appearance/langs/hi.json b/app/appearance/langs/hi.json
index bcb5f344be..b356c5f231 100644
--- a/app/appearance/langs/hi.json
+++ b/app/appearance/langs/hi.json
@@ -6,7 +6,7 @@
"automationCollectionTarget": "संग्रह लक्ष्य",
"automationCollectionTargetBlock": "टैग वाला ब्लॉक",
"automationCollectionTargetContainer": "कंटेनर ब्लॉक",
- "automationCollectionTargetDefaultTip": "टैग की शर्तें होने पर सूची आइटम का पहला अनुच्छेद उसी आइटम का भाग माना जाता है; अन्य ब्लॉक अपने टैग से मिलान करते हैं",
+ "automationCollectionTargetDefaultTip": "पहले सामग्री ब्लॉक के टैग के लिए शर्तों से मेल खाने वाले सूची आइटम को प्राथमिकता दें; अन्यथा मेल खाने वाला टैगयुक्त ब्लॉक संग्रहित करें",
"automationCollectionTargetBlockTip": "टैग की शर्तें होने पर टैग वाले ब्लॉक को उसके प्रकार और विशेषताओं के अनुसार संग्रहित करें",
"automationCollectionTargetContainerTip": "टैग की शर्तें होने पर प्रकार और विशेषताओं से मेल खाने वाला निकटतम कंटेनर संग्रहित करें; दस्तावेज़ स्पष्ट रूप से चुनने होंगे",
"automationCollectionTargetChangeTip": "यह विकल्प बदलने पर मौजूदा प्रविष्टियाँ और फ़ील्ड सुरक्षित रहते हैं; नए परिणाम पूर्वावलोकन में देखें",
diff --git a/app/appearance/langs/id.json b/app/appearance/langs/id.json
index 0872014ac9..139b5a62c7 100644
--- a/app/appearance/langs/id.json
+++ b/app/appearance/langs/id.json
@@ -6,7 +6,7 @@
"automationCollectionTarget": "Objek pengumpulan",
"automationCollectionTargetBlock": "Blok yang berisi tag",
"automationCollectionTargetContainer": "Blok wadah",
- "automationCollectionTargetDefaultTip": "Dengan kondisi tag, paragraf pertama item daftar menjadi bagian item tersebut; blok lain mencocokkan tag masing-masing",
+ "automationCollectionTargetDefaultTip": "Untuk tag pada blok konten pertama, utamakan item daftar yang memenuhi kondisi; jika tidak, kumpulkan blok bertag yang memenuhi kondisi",
"automationCollectionTargetBlockTip": "Dengan kondisi tag, kumpulkan blok yang berisi tag berdasarkan jenis dan atributnya",
"automationCollectionTargetContainerTip": "Dengan kondisi tag, kumpulkan wadah terdekat yang sesuai dengan jenis dan atribut; dokumen harus dipilih secara eksplisit",
"automationCollectionTargetChangeTip": "Perubahan mempertahankan entri dan kolom yang ada; periksa hasil baru melalui pratinjau",
diff --git a/app/appearance/langs/it.json b/app/appearance/langs/it.json
index 93b09736db..6ec38c3875 100644
--- a/app/appearance/langs/it.json
+++ b/app/appearance/langs/it.json
@@ -6,7 +6,7 @@
"automationCollectionTarget": "Oggetto da raccogliere",
"automationCollectionTargetBlock": "Blocco contenente il tag",
"automationCollectionTargetContainer": "Blocco contenitore",
- "automationCollectionTargetDefaultTip": "Con condizioni sui tag, il primo paragrafo di una voce di elenco appartiene alla voce; gli altri blocchi verificano i propri tag",
+ "automationCollectionTargetDefaultTip": "Per i tag nel primo blocco di contenuto, preferisci la voce di elenco idonea; altrimenti raccogli il blocco con tag idoneo",
"automationCollectionTargetBlockTip": "Con condizioni sui tag, raccogli il blocco contenente il tag in base al tipo e agli attributi",
"automationCollectionTargetContainerTip": "Con condizioni sui tag, raccogli il contenitore più vicino che soddisfa tipo e attributi; i documenti vanno selezionati esplicitamente",
"automationCollectionTargetChangeTip": "La modifica conserva le voci e i campi esistenti; controlla i nuovi risultati nell’anteprima",
diff --git a/app/appearance/langs/ja.json b/app/appearance/langs/ja.json
index 92eeab6dca..4830950d34 100644
--- a/app/appearance/langs/ja.json
+++ b/app/appearance/langs/ja.json
@@ -6,7 +6,7 @@
"automationCollectionTarget": "収集対象",
"automationCollectionTargetBlock": "タグを含むブロック",
"automationCollectionTargetContainer": "コンテナブロック",
- "automationCollectionTargetDefaultTip": "タグ条件がある場合、リスト項目の最初の段落はリスト項目に属し、他のブロックは自身のタグと照合します",
+ "automationCollectionTargetDefaultTip": "最初の内容ブロックのタグでは条件に合うリスト項目を優先し、それ以外は条件に合うタグ付きブロックを収集します",
"automationCollectionTargetBlockTip": "タグ条件がある場合、タグを含むブロックの種類と属性で絞り込んで収集します",
"automationCollectionTargetContainerTip": "タグ条件がある場合、種類と属性の条件に一致する最も近いコンテナを収集します。文書は明示的な選択が必要です",
"automationCollectionTargetChangeTip": "切り替えても既存の項目やフィールドは変更されません。プレビューで新しい収集結果を確認できます",
diff --git a/app/appearance/langs/ko.json b/app/appearance/langs/ko.json
index aeaae5261c..5fcb28c150 100644
--- a/app/appearance/langs/ko.json
+++ b/app/appearance/langs/ko.json
@@ -6,7 +6,7 @@
"automationCollectionTarget": "수집 대상",
"automationCollectionTargetBlock": "태그가 있는 블록",
"automationCollectionTargetContainer": "컨테이너 블록",
- "automationCollectionTargetDefaultTip": "태그 조건이 있으면 목록 항목의 첫 문단은 해당 항목에 속하며, 다른 블록은 자체 태그로 일치 여부를 확인합니다",
+ "automationCollectionTargetDefaultTip": "첫 내용 블록의 태그는 조건에 맞는 목록 항목을 우선하며, 그렇지 않으면 조건에 맞는 태그가 있는 블록을 수집합니다",
"automationCollectionTargetBlockTip": "태그 조건이 있으면 태그가 있는 블록의 유형과 속성에 따라 수집합니다",
"automationCollectionTargetContainerTip": "태그 조건이 있으면 유형과 속성 조건을 충족하는 가장 가까운 컨테이너를 수집합니다. 문서는 명시적으로 선택해야 합니다",
"automationCollectionTargetChangeTip": "변경해도 기존 항목과 필드는 유지됩니다. 미리보기에서 새로운 수집 결과를 확인하세요",
diff --git a/app/appearance/langs/nl.json b/app/appearance/langs/nl.json
index 752e735475..b2ee7fff03 100644
--- a/app/appearance/langs/nl.json
+++ b/app/appearance/langs/nl.json
@@ -6,7 +6,7 @@
"automationCollectionTarget": "Verzameldoel",
"automationCollectionTargetBlock": "Blok met de tag",
"automationCollectionTargetContainer": "Containerblok",
- "automationCollectionTargetDefaultTip": "Bij tagvoorwaarden hoort de eerste alinea van een lijstitem bij dat item; andere blokken controleren hun eigen tags",
+ "automationCollectionTargetDefaultTip": "Geef bij tags in het eerste inhoudsblok voorrang aan het passende lijstitem; verzamel anders het passende blok met de tag",
"automationCollectionTargetBlockTip": "Bij tagvoorwaarden het blok met de tag verzamelen op basis van het type en de kenmerken",
"automationCollectionTargetContainerTip": "Bij tagvoorwaarden de dichtstbijzijnde container met het juiste type en de juiste kenmerken verzamelen; documenten moeten expliciet worden geselecteerd",
"automationCollectionTargetChangeTip": "Wijzigen behoudt bestaande items en velden; controleer de nieuwe resultaten in het voorbeeld",
diff --git a/app/appearance/langs/pl.json b/app/appearance/langs/pl.json
index 18c8729b63..c92829a7fc 100644
--- a/app/appearance/langs/pl.json
+++ b/app/appearance/langs/pl.json
@@ -6,7 +6,7 @@
"automationCollectionTarget": "Obiekt zbierania",
"automationCollectionTargetBlock": "Blok zawierający tag",
"automationCollectionTargetContainer": "Blok kontenera",
- "automationCollectionTargetDefaultTip": "Przy warunkach tagów pierwszy akapit elementu listy należy do tego elementu; pozostałe bloki sprawdzają własne tagi",
+ "automationCollectionTargetDefaultTip": "Dla tagów w pierwszym bloku treści preferuj element listy spełniający warunki; w przeciwnym razie zbierz pasujący blok z tagiem",
"automationCollectionTargetBlockTip": "Przy warunkach tagów zbieraj blok zawierający tag według jego typu i atrybutów",
"automationCollectionTargetContainerTip": "Przy warunkach tagów zbieraj najbliższy kontener zgodny z typem i atrybutami; dokumenty wymagają jawnego wyboru",
"automationCollectionTargetChangeTip": "Zmiana zachowuje istniejące wpisy i pola; sprawdź nowe wyniki w podglądzie",
diff --git a/app/appearance/langs/pt-BR.json b/app/appearance/langs/pt-BR.json
index 1d112e7338..c7cc75862d 100644
--- a/app/appearance/langs/pt-BR.json
+++ b/app/appearance/langs/pt-BR.json
@@ -6,7 +6,7 @@
"automationCollectionTarget": "Objeto da coleta",
"automationCollectionTargetBlock": "Bloco que contém a etiqueta",
"automationCollectionTargetContainer": "Bloco contêiner",
- "automationCollectionTargetDefaultTip": "Com condições de etiquetas, o primeiro parágrafo de um item de lista pertence ao item; os demais blocos verificam suas próprias etiquetas",
+ "automationCollectionTargetDefaultTip": "Para etiquetas no primeiro bloco de conteúdo, priorizar o item de lista que atenda às condições; caso contrário, coletar o bloco etiquetado correspondente",
"automationCollectionTargetBlockTip": "Com condições de etiquetas, coletar o bloco que contém a etiqueta conforme seu tipo e atributos",
"automationCollectionTargetContainerTip": "Com condições de etiquetas, coletar o contêiner mais próximo que corresponda ao tipo e aos atributos; documentos devem ser selecionados explicitamente",
"automationCollectionTargetChangeTip": "Alterar esta opção preserva as entradas e os campos existentes; confira os novos resultados na prévia",
diff --git a/app/appearance/langs/ru.json b/app/appearance/langs/ru.json
index e0ca403da2..0c8446e674 100644
--- a/app/appearance/langs/ru.json
+++ b/app/appearance/langs/ru.json
@@ -6,7 +6,7 @@
"automationCollectionTarget": "Объект сбора",
"automationCollectionTargetBlock": "Блок с тегом",
"automationCollectionTargetContainer": "Блок-контейнер",
- "automationCollectionTargetDefaultTip": "При условиях по тегам первый абзац элемента списка относится к этому элементу; остальные блоки проверяют собственные теги",
+ "automationCollectionTargetDefaultTip": "Для тегов в первом блоке содержимого предпочитать подходящий элемент списка; иначе собирать подходящий блок с тегом",
"automationCollectionTargetBlockTip": "При условиях по тегам собирать блок с тегом с учётом его типа и атрибутов",
"automationCollectionTargetContainerTip": "При условиях по тегам собирать ближайший контейнер, соответствующий типу и атрибутам; документы нужно выбирать явно",
"automationCollectionTargetChangeTip": "Изменение сохраняет существующие записи и поля; проверьте новые результаты в предпросмотре",
diff --git a/app/appearance/langs/sk.json b/app/appearance/langs/sk.json
index 0de6256f7d..6f5e74dc82 100644
--- a/app/appearance/langs/sk.json
+++ b/app/appearance/langs/sk.json
@@ -6,7 +6,7 @@
"automationCollectionTarget": "Objekt zbierania",
"automationCollectionTargetBlock": "Blok obsahujúci značku",
"automationCollectionTargetContainer": "Kontajnerový blok",
- "automationCollectionTargetDefaultTip": "Pri podmienkach značiek patrí prvý odsek položky zoznamu k položke; ostatné bloky porovnávajú vlastné značky",
+ "automationCollectionTargetDefaultTip": "Pri značkách v prvom obsahovom bloku uprednostniť vyhovujúcu položku zoznamu; inak zbierať vyhovujúci označený blok",
"automationCollectionTargetBlockTip": "Pri podmienkach značiek zbierať blok obsahujúci značku podľa jeho typu a atribútov",
"automationCollectionTargetContainerTip": "Pri podmienkach značiek zbierať najbližší kontajner zodpovedajúci typu a atribútom; dokumenty treba výslovne vybrať",
"automationCollectionTargetChangeTip": "Zmena zachová existujúce položky a polia; nové výsledky skontrolujte v náhľade",
diff --git a/app/appearance/langs/sr.json b/app/appearance/langs/sr.json
index bd04cee52d..9df8b2bf76 100644
--- a/app/appearance/langs/sr.json
+++ b/app/appearance/langs/sr.json
@@ -6,7 +6,7 @@
"automationCollectionTarget": "Објекат прикупљања",
"automationCollectionTargetBlock": "Блок који садржи ознаку",
"automationCollectionTargetContainer": "Контејнерски блок",
- "automationCollectionTargetDefaultTip": "Када постоје услови ознака, први пасус ставке листе припада тој ставци; остали блокови проверавају сопствене ознаке",
+ "automationCollectionTargetDefaultTip": "За ознаке у првом блоку садржаја дај предност одговарајућој ставци листе; иначе прикупи одговарајући означени блок",
"automationCollectionTargetBlockTip": "Када постоје услови ознака, прикупљај блок који садржи ознаку према његовом типу и атрибутима",
"automationCollectionTargetContainerTip": "Када постоје услови ознака, прикупљај најближи контејнер који одговара типу и атрибутима; документи морају бити изричито изабрани",
"automationCollectionTargetChangeTip": "Промена чува постојеће ставке и поља; проверите нове резултате у прегледу",
diff --git a/app/appearance/langs/th.json b/app/appearance/langs/th.json
index 7a02ce0796..8d850af7cc 100644
--- a/app/appearance/langs/th.json
+++ b/app/appearance/langs/th.json
@@ -6,7 +6,7 @@
"automationCollectionTarget": "เป้าหมายการรวบรวม",
"automationCollectionTargetBlock": "บล็อกที่มีแท็ก",
"automationCollectionTargetContainer": "บล็อกคอนเทนเนอร์",
- "automationCollectionTargetDefaultTip": "เมื่อมีเงื่อนไขแท็ก ย่อหน้าแรกของรายการจะถือเป็นส่วนหนึ่งของรายการ ส่วนบล็อกอื่นจะตรวจสอบแท็กของตนเอง",
+ "automationCollectionTargetDefaultTip": "สำหรับแท็กในบล็อกเนื้อหาแรก ให้เลือกรายการที่ตรงตามเงื่อนไขก่อน มิฉะนั้นให้รวบรวมบล็อกที่มีแท็กและตรงตามเงื่อนไข",
"automationCollectionTargetBlockTip": "เมื่อมีเงื่อนไขแท็ก ให้รวบรวมบล็อกที่มีแท็กตามประเภทและคุณลักษณะของบล็อกนั้น",
"automationCollectionTargetContainerTip": "เมื่อมีเงื่อนไขแท็ก ให้รวบรวมคอนเทนเนอร์ที่ใกล้ที่สุดซึ่งตรงตามประเภทและคุณลักษณะ ต้องเลือกเอกสารอย่างชัดเจน",
"automationCollectionTargetChangeTip": "การเปลี่ยนตัวเลือกจะคงรายการและเขตข้อมูลเดิมไว้ ตรวจสอบผลลัพธ์ใหม่ได้ในการแสดงตัวอย่าง",
diff --git a/app/appearance/langs/tr.json b/app/appearance/langs/tr.json
index f90681b7fd..617063c637 100644
--- a/app/appearance/langs/tr.json
+++ b/app/appearance/langs/tr.json
@@ -6,7 +6,7 @@
"automationCollectionTarget": "Toplanacak nesne",
"automationCollectionTargetBlock": "Etiketi içeren blok",
"automationCollectionTargetContainer": "Kapsayıcı blok",
- "automationCollectionTargetDefaultTip": "Etiket koşullarında liste öğesinin ilk paragrafı öğeye aittir; diğer bloklar kendi etiketleriyle eşleştirilir",
+ "automationCollectionTargetDefaultTip": "İlk içerik bloğundaki etiketlerde koşullara uyan liste öğesini tercih et; aksi hâlde koşullara uyan etiketli bloğu topla",
"automationCollectionTargetBlockTip": "Etiket koşullarında etiketi içeren bloğu türüne ve özniteliklerine göre topla",
"automationCollectionTargetContainerTip": "Etiket koşullarında tür ve öznitelik koşullarına uyan en yakın kapsayıcıyı topla; belgeler açıkça seçilmelidir",
"automationCollectionTargetChangeTip": "Değişiklik mevcut kayıtları ve alanları korur; yeni sonuçları önizlemede kontrol edin",
diff --git a/app/appearance/langs/uk.json b/app/appearance/langs/uk.json
index 7fb2da4811..61278b196d 100644
--- a/app/appearance/langs/uk.json
+++ b/app/appearance/langs/uk.json
@@ -6,7 +6,7 @@
"automationCollectionTarget": "Об’єкт збирання",
"automationCollectionTargetBlock": "Блок із тегом",
"automationCollectionTargetContainer": "Блок-контейнер",
- "automationCollectionTargetDefaultTip": "За умовами тегів перший абзац елемента списку належить цьому елементу; інші блоки перевіряють власні теги",
+ "automationCollectionTargetDefaultTip": "Для тегів у першому блоці вмісту надавати перевагу відповідному елементу списку; інакше збирати відповідний блок із тегом",
"automationCollectionTargetBlockTip": "За умовами тегів збирати блок із тегом відповідно до його типу й атрибутів",
"automationCollectionTargetContainerTip": "За умовами тегів збирати найближчий контейнер, що відповідає типу й атрибутам; документи потрібно вибирати явно",
"automationCollectionTargetChangeTip": "Зміна зберігає наявні записи й поля; перевірте нові результати в попередньому перегляді",
diff --git a/app/appearance/langs/zh-CN.json b/app/appearance/langs/zh-CN.json
index 647f8132d5..efaa4ec27d 100644
--- a/app/appearance/langs/zh-CN.json
+++ b/app/appearance/langs/zh-CN.json
@@ -6,7 +6,7 @@
"automationCollectionTarget": "收集对象",
"automationCollectionTargetBlock": "标签所在块",
"automationCollectionTargetContainer": "容器块",
- "automationCollectionTargetDefaultTip": "有标签条件时,列表项首段默认归属列表项,其他块匹配自身标签",
+ "automationCollectionTargetDefaultTip": "首个内容块的标签优先收集符合条件的列表项,否则收集符合条件的标签所在块",
"automationCollectionTargetBlockTip": "有标签条件时,按标签所在块的类型和属性筛选并收集",
"automationCollectionTargetContainerTip": "有标签条件时,收集最近的符合类型和属性条件的容器;文档需要显式选择",
"automationCollectionTargetChangeTip": "切换不会转换已有条目或修改其字段,可通过预览确认新的收集结果",
diff --git a/app/appearance/langs/zh-TW.json b/app/appearance/langs/zh-TW.json
index 24b1d116c5..8621cabdfe 100644
--- a/app/appearance/langs/zh-TW.json
+++ b/app/appearance/langs/zh-TW.json
@@ -6,7 +6,7 @@
"automationCollectionTarget": "收集對象",
"automationCollectionTargetBlock": "標籤所在區塊",
"automationCollectionTargetContainer": "容器區塊",
- "automationCollectionTargetDefaultTip": "有標籤條件時,清單項目首段預設歸屬清單項目,其他區塊比對自身標籤",
+ "automationCollectionTargetDefaultTip": "首個內容區塊的標籤優先收集符合條件的清單項目,否則收集符合條件的標籤所在區塊",
"automationCollectionTargetBlockTip": "有標籤條件時,依標籤所在區塊的類型與屬性篩選並收集",
"automationCollectionTargetContainerTip": "有標籤條件時,收集最近且符合類型與屬性條件的容器;文件需明確選取",
"automationCollectionTargetChangeTip": "切換不會轉換既有項目或修改其欄位,可透過預覽確認新的收集結果",
diff --git a/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20240208172514-9dsv6na.sy b/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20240208172514-9dsv6na.sy
index 6a8e95d1ca..9d3bfc236f 100644
--- a/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20240208172514-9dsv6na.sy
+++ b/app/guide/20210808180117-6v0mkxr/20200923234011-ieuun1p/20210808180303-xaduj2o/20240208172514-9dsv6na.sy
@@ -7,7 +7,7 @@
"id": "20240208172514-9dsv6na",
"title": "Database",
"type": "doc",
- "updated": "20261017204817"
+ "updated": "20261017234820"
},
"Children": [
{
@@ -4554,12 +4554,12 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20261017204817-jfdo45b",
- "updated": "20261017204817"
+ "updated": "20261017234820"
},
"Children": [
{
"Type": "NodeText",
- "Data": "The Collect menu beside the tag conditions offers Default, Block containing the tag, and Container block. Default preserves existing behavior, including treating a list item’s first paragraph as part of that item. Block containing the tag filters and collects the actual tagged block by its type and attributes. Container block collects the nearest container meeting the selected type and attribute conditions, deduplicating by block ID; documents are eligible only when explicitly selected. All required tags must occur in the same source block, rather than being combined across children. With no tag conditions, this option has no effect. Preview shows the final collection targets. Changing this option preserves existing entries and fields without converting their bound blocks. The two explicit modes require automation format 4; older formats remain readable, and older clients reject format 4 without rewriting the database."
+ "Data": "The Collect menu beside the tag conditions offers Default, Block containing the tag, and Container block. Default prefers the enclosing list item when its first content block contains the tags and it meets the type and attribute conditions; otherwise it uses the eligible tagged block. Selecting both paragraph and list-item types still produces only one target for the same tag source. Block containing the tag filters and collects the actual tagged block by its type and attributes. Container block collects the nearest container meeting the selected type and attribute conditions, deduplicating by block ID; documents are eligible only when explicitly selected. All required tags must occur in the same source block, rather than being combined across children. With no tag conditions, this option has no effect. Preview shows the final collection targets. Changing this option preserves existing entries and fields without converting their bound blocks. The two explicit modes require automation format 4; older formats remain readable, and older clients reject format 4 without rewriting the database."
}
]
},
diff --git a/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20240208113259-nykkvaq.sy b/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20240208113259-nykkvaq.sy
index ff9422ee9e..c590e75d18 100644
--- a/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20240208113259-nykkvaq.sy
+++ b/app/guide/20210808180117-czj9bvb/20200812220555-lj3enxa/20210808180321-hbvl5c2/20240208113259-nykkvaq.sy
@@ -7,7 +7,7 @@
"id": "20240208113259-nykkvaq",
"title": "数据库",
"type": "doc",
- "updated": "20261017204817"
+ "updated": "20261017234820"
},
"Children": [
{
@@ -4554,12 +4554,12 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20261017204817-4ocp9jq",
- "updated": "20261017204817"
+ "updated": "20261017234820"
},
"Children": [
{
"Type": "NodeText",
- "Data": "标签条件旁的「收集对象」提供「默认」「标签所在块」和「容器块」。默认沿用现有行为,包括将列表项首段归属列表项;标签所在块按实际包含标签的块的类型和属性筛选并收集;容器块向上选择最近的符合类型和属性条件的容器,并按块 ID 去重,文档只有被显式选择时才参与。要求全部标签时,标签必须出现在同一个来源块中,不会合并不同子块的标签。没有标签条件时,此选项不影响筛选。预览显示最终收集对象。切换不会转换已有条目的绑定块或修改其字段。两种显式模式需要自动化格式 4,已有格式仍可读取;旧客户端会拒绝格式 4,不会改写数据库。"
+ "Data": "标签条件旁的「收集对象」提供「默认」「标签所在块」和「容器块」。默认在列表项首个内容块包含标签且列表项满足类型和属性条件时优先收集列表项,否则尝试符合条件的标签所在块;同时选择段落和列表项也不会为同一个标签来源收集两个层级;标签所在块按实际包含标签的块的类型和属性筛选并收集;容器块向上选择最近的符合类型和属性条件的容器,并按块 ID 去重,文档只有被显式选择时才参与。要求全部标签时,标签必须出现在同一个来源块中,不会合并不同子块的标签。没有标签条件时,此选项不影响筛选。预览显示最终收集对象。切换不会转换已有条目的绑定块或修改其字段。两种显式模式需要自动化格式 4,已有格式仍可读取;旧客户端会拒绝格式 4,不会改写数据库。"
}
]
},
diff --git a/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20240208171522-y7dxcno.sy b/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20240208171522-y7dxcno.sy
index f14d12388d..4f4871937f 100644
--- a/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20240208171522-y7dxcno.sy
+++ b/app/guide/20211226090932-5lcq56f/20211226115423-d5z1joq/20211226121203-rjjngpz/20240208171522-y7dxcno.sy
@@ -7,7 +7,7 @@
"id": "20240208171522-y7dxcno",
"title": "資料庫",
"type": "doc",
- "updated": "20261017204817"
+ "updated": "20261017234820"
},
"Children": [
{
@@ -4554,12 +4554,12 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20261017204817-t0qt0db",
- "updated": "20261017204817"
+ "updated": "20261017234820"
},
"Children": [
{
"Type": "NodeText",
- "Data": "標籤條件旁的「收集對象」提供「預設」「標籤所在區塊」和「容器區塊」。預設沿用既有行為,包括將清單項目首段歸屬清單項目;標籤所在區塊依實際包含標籤的區塊類型與屬性篩選並收集;容器區塊向上選擇最近且符合類型與屬性條件的容器,並依區塊 ID 去除重複,文件只有被明確選取時才參與。要求全部標籤時,標籤必須出現在同一個來源區塊中,不會合併不同子區塊的標籤。沒有標籤條件時,此選項不影響篩選。預覽顯示最終收集對象。切換不會轉換既有項目的繫結區塊或修改其欄位。兩種明確模式需要自動化格式 4,既有格式仍可讀取;舊用戶端會拒絕格式 4,不會改寫資料庫。"
+ "Data": "標籤條件旁的「收集對象」提供「預設」「標籤所在區塊」和「容器區塊」。預設在清單項目首個內容區塊包含標籤且清單項目符合類型與屬性條件時優先收集清單項目,否則嘗試符合條件的標籤所在區塊;同時選取段落和清單項目也不會為同一個標籤來源收集兩個層級;標籤所在區塊依實際包含標籤的區塊類型與屬性篩選並收集;容器區塊向上選擇最近且符合類型與屬性條件的容器,並依區塊 ID 去除重複,文件只有被明確選取時才參與。要求全部標籤時,標籤必須出現在同一個來源區塊中,不會合併不同子區塊的標籤。沒有標籤條件時,此選項不影響篩選。預覽顯示最終收集對象。切換不會轉換既有項目的繫結區塊或修改其欄位。兩種明確模式需要自動化格式 4,既有格式仍可讀取;舊用戶端會拒絕格式 4,不會改寫資料庫。"
}
]
},
diff --git a/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-g3ugxml/20240530101000-3eaevtp.sy b/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-g3ugxml/20240530101000-3eaevtp.sy
index caac6ed1f1..f88ceebe20 100644
--- a/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-g3ugxml/20240530101000-3eaevtp.sy
+++ b/app/guide/20240530133126-axarxgx/20240530101000-4qitucx/20240530101000-g3ugxml/20240530101000-3eaevtp.sy
@@ -8,7 +8,7 @@
"id": "20240530101000-3eaevtp",
"title": "データベース",
"type": "doc",
- "updated": "20261017204817"
+ "updated": "20261017234820"
},
"Children": [
{
@@ -4564,12 +4564,12 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20261017204817-a41svnn",
- "updated": "20261017204817"
+ "updated": "20261017234820"
},
"Children": [
{
"Type": "NodeText",
- "Data": "タグ条件の横にある「収集対象」では、「デフォルト」「タグを含むブロック」「コンテナブロック」を選べます。デフォルトはリスト項目の最初の段落をその項目に属するものとして扱う既存の動作を維持します。「タグを含むブロック」はタグが実際にあるブロックの種類と属性で絞り込み、収集します。「コンテナブロック」は種類と属性の条件に一致する最も近いコンテナを選び、ブロック ID で重複を除きます。文書は明示的に選択した場合のみ対象になります。すべてのタグを要求する場合、同じ元ブロック内にそろっている必要があり、別々の子ブロックのタグは結合しません。タグ条件がなければ、この設定は絞り込みに影響しません。プレビューには最終的な収集対象が表示されます。切り替えても既存項目のバインド先やフィールドは変更されません。明示的な二つのモードには自動化形式 4 が必要です。既存形式は引き続き読み込めますが、古いクライアントは形式 4 を拒否し、データベースを書き換えません。"
+ "Data": "タグ条件の横にある「収集対象」では、「デフォルト」「タグを含むブロック」「コンテナブロック」を選べます。デフォルトは最初の内容ブロックにタグがあり、種類と属性の条件に合うリスト項目を優先します。それ以外は条件に合うタグ付きブロックを収集します。段落とリスト項目を両方選んでも、同じタグ元から二つの階層を収集しません。「タグを含むブロック」はタグが実際にあるブロックの種類と属性で絞り込み、収集します。「コンテナブロック」は種類と属性の条件に一致する最も近いコンテナを選び、ブロック ID で重複を除きます。文書は明示的に選択した場合のみ対象になります。すべてのタグを要求する場合、同じ元ブロック内にそろっている必要があり、別々の子ブロックのタグは結合しません。タグ条件がなければ、この設定は絞り込みに影響しません。プレビューには最終的な収集対象が表示されます。切り替えても既存項目のバインド先やフィールドは変更されません。明示的な二つのモードには自動化形式 4 が必要です。既存形式は引き続き読み込めますが、古いクライアントは形式 4 を拒否し、データベースを書き換えません。"
}
]
},
diff --git a/app/src/types/api/index.d.ts b/app/src/types/api/index.d.ts
index 1c062b8480..34137c845a 100644
--- a/app/src/types/api/index.d.ts
+++ b/app/src/types/api/index.d.ts
@@ -7819,6 +7819,7 @@ export interface APIPOSTRoutes {
* blockSource 的 tagMatch、attributeMatch 缺省为 and;spec 3 支持各组独立设置 or,空组不限制,组间仍为 and。
* spec 4 的 blockSource.tagTarget 支持 block(标签所在块)和 container(最近合格容器),缺省保持原行为。
* 容器按类型及属性条件选择并去重;全部标签须在同一个来源块中,文档容器须显式选择 d。
+ * 类型和属性始终筛选最终对象;默认首个内容块优先归属合格列表项,每次标签命中只选择一个对象。
* 无标签时收集对象不影响筛选;变更收集对象不转换已有条目,预览与实际收集使用相同规则。
* 规则的 notifyOnSuccess 缺省或 null 为开启,仅实际变更且事务成功提交后通知,同一事务合并;错误提示不受其控制。
* 手动收集、无变化、撤销重放和失败回滚不发送成功通知。
diff --git a/docs/API.ja.md b/docs/API.ja.md
index 9c7e295ff9..2d7335dde3 100644
--- a/docs/API.ja.md
+++ b/docs/API.ja.md
@@ -2212,7 +2212,7 @@ if (response.code === 0 && response.data) {
* `data.av`: 完全な `AttributeView` 定義——フィールド(`keyValues`)、フィールド順序(`keyIDs`、`null` の場合あり)、および全ビューの生のレイアウト設定(`table`/`gallery`/`kanban`)とアイテム順序(`itemIds`)。互換性フィールド `viewID` は最初に利用可能なビューから算出され、永続化されません。レンダリング後の行やページングは含まれないため、計算後の行データが必要な場合は [レンダリング](#レンダリング) を使用してください
- * `data.av.automations` は省略可能で、データベース全体のルール(`spec: 1`~`4`)を保持します。`block` トリガーの `blockSource` はノートブック/文書の範囲、ブロックの種類、タグ、カスタム属性を指定し、`collect` アクションは一致する元のブロックを現在のデータベースにバインドします。主種類はすべてのサブタイプを含みます。形式 3 は `h:h1`~`h:h6`、`l:u/o/t`、`i:u/o/t`、`callout:TYPE`(大文字小文字を区別し、独自種類も指定可能)をサポートします。種類の未選択は制限なし、複数選択は OR です。自動作成された主キー値には、カーネルが管理する `block.collectionRuleID` が含まれる場合があります。手動で追加した既存項目は保持されます。削除後に再び一致すると初期値を持つ新しい項目を作成し、元に戻す操作では元の項目とフィールドを復元します `blockSource.tagMatch` と `attributeMatch` は既定で `and`、形式 3 では各組を個別に `or` にできます。組の間は AND のままで、空の組は制限しません。 各ルールの省略可能な `notifyOnSuccess` は既定(`null` を含む)で `true` です。実際の変更をトランザクション確定後に一つの通知にまとめます。無効にしてもエラーは通知します。変更なし・明示的な収集・元に戻す・やり直し・ロールバックでは成功通知を送信しません。 形式 4 では省略可能な `blockSource.tagTarget` を追加しています。省略・空文字列は従来動作、`block` はタグを含むブロック、`container` は種類と属性の条件に一致する最も近いコンテナを収集し、ブロック ID で重複を除きます。文書には明示的な `d` の選択が必要です。AND のタグは同じ元ブロックに必要で、タグ条件がなければこの設定は影響しません。プレビューと実際の収集対象は一致し、切り替えても既存項目とフィールドは維持されます。
+ * `data.av.automations` は省略可能で、データベース全体のルール(`spec: 1`~`4`)を保持します。`block` トリガーの `blockSource` はノートブック/文書の範囲、ブロックの種類、タグ、カスタム属性を指定し、`collect` アクションは一致する元のブロックを現在のデータベースにバインドします。主種類はすべてのサブタイプを含みます。形式 3 は `h:h1`~`h:h6`、`l:u/o/t`、`i:u/o/t`、`callout:TYPE`(大文字小文字を区別し、独自種類も指定可能)をサポートします。種類の未選択は制限なし、複数選択は OR です。自動作成された主キー値には、カーネルが管理する `block.collectionRuleID` が含まれる場合があります。手動で追加した既存項目は保持されます。削除後に再び一致すると初期値を持つ新しい項目を作成し、元に戻す操作では元の項目とフィールドを復元します `blockSource.tagMatch` と `attributeMatch` は既定で `and`、形式 3 では各組を個別に `or` にできます。組の間は AND のままで、空の組は制限しません。 各ルールの省略可能な `notifyOnSuccess` は既定(`null` を含む)で `true` です。実際の変更をトランザクション確定後に一つの通知にまとめます。無効にしてもエラーは通知します。変更なし・明示的な収集・元に戻す・やり直し・ロールバックでは成功通知を送信しません。 形式 4 では省略可能な `blockSource.tagTarget` を追加しています。省略・空文字列は既定の選択で、最初の内容ブロックより条件に合うリスト項目を優先、`block` はタグを含むブロック、`container` は種類と属性の条件に一致する最も近いコンテナを収集し、ブロック ID で重複を除きます。文書には明示的な `d` の選択が必要です。AND のタグは同じ元ブロックに必要で、タグ条件がなければこの設定は影響しません。プレビューと実際の収集対象は一致し、切り替えても既存項目とフィールドは維持されます。
### 主キー値を取得
diff --git a/docs/API.md b/docs/API.md
index 86dc6b622b..0c4cd7849f 100644
--- a/docs/API.md
+++ b/docs/API.md
@@ -2222,7 +2222,7 @@ The field types (`keyType`) are:
* `data.av`: The full `AttributeView` definition — fields (`keyValues`), field ordering (`keyIDs`, may be `null`), and all views with their raw layout config (`table`/`list`/`gallery`/`kanban`) and item ordering (`itemIds`). The compatibility `viewID` is computed as the first available view and is not persisted. Returns no rendered rows or pagination; therefore, use [Render](#Render) for computed rows
- * `data.av.automations` optionally contains database-wide rules (`spec: 1` through `4`). A `block` trigger uses `blockSource` to select notebooks/documents, block types, tags, and custom attributes; its `collect` action binds matching source blocks to this database. Main types include every subtype; format 3 supports `h:h1` through `h:h6`, `l:u/o/t`, `i:u/o/t`, and `callout:TYPE` (case-sensitive, including custom types). Empty types impose no restriction, and multiple types use OR. Automatically created primary values may include `block.collectionRuleID`, which is maintained by the kernel. Existing manual rows are preserved; a new match after removal creates a new initialized row, while undo restores the original row and fields `blockSource.tagMatch` and `attributeMatch` default to `and`; format 3 also supports `or` independently within each group. Groups remain ANDed, and empty groups add no restriction. Each rule's optional `notifyOnSuccess` defaults to `true` (including `null`); successful changes are summarized once after the transaction commits. Disabled notifications do not suppress errors. No-op actions, explicit collection, undo, redo, and rolled-back transactions do not generate success messages. Format 4 adds optional `blockSource.tagTarget`: omitted/empty keeps legacy behavior, `block` collects the tagged block itself, and `container` collects the nearest container meeting type and attribute conditions, deduplicated by block ID. Documents require an explicit `d` type. AND tags must occur in one source block; without tag conditions this option has no effect. Preview and actual collection share the same targets; changing this option preserves existing rows and fields.
+ * `data.av.automations` optionally contains database-wide rules (`spec: 1` through `4`). A `block` trigger uses `blockSource` to select notebooks/documents, block types, tags, and custom attributes; its `collect` action binds matching source blocks to this database. Main types include every subtype; format 3 supports `h:h1` through `h:h6`, `l:u/o/t`, `i:u/o/t`, and `callout:TYPE` (case-sensitive, including custom types). Empty types impose no restriction, and multiple types use OR. Automatically created primary values may include `block.collectionRuleID`, which is maintained by the kernel. Existing manual rows are preserved; a new match after removal creates a new initialized row, while undo restores the original row and fields `blockSource.tagMatch` and `attributeMatch` default to `and`; format 3 also supports `or` independently within each group. Groups remain ANDed, and empty groups add no restriction. Each rule's optional `notifyOnSuccess` defaults to `true` (including `null`); successful changes are summarized once after the transaction commits. Disabled notifications do not suppress errors. No-op actions, explicit collection, undo, redo, and rolled-back transactions do not generate success messages. Format 4 adds optional `blockSource.tagTarget`: omitted/empty uses default selection, preferring an eligible list item over its first content block, `block` collects the tagged block itself, and `container` collects the nearest container meeting type and attribute conditions, deduplicated by block ID. Documents require an explicit `d` type. AND tags must occur in one source block; without tag conditions this option has no effect. Preview and actual collection share the same targets; changing this option preserves existing rows and fields.
### Get primary key values
diff --git a/docs/API.zh-CN.md b/docs/API.zh-CN.md
index acf234fd25..17981326f3 100644
--- a/docs/API.zh-CN.md
+++ b/docs/API.zh-CN.md
@@ -2218,7 +2218,7 @@ if (response.code === 0 && response.data) {
* `data.av`: 完整的 `AttributeView` 定义——字段(`keyValues`)、字段顺序(`keyIDs`,可能为 `null`),以及所有视图的原始布局配置(`table`/`list`/`gallery`/`kanban`)和条目顺序(`itemIds`)。兼容字段 `viewID` 动态取第一个可用视图,不会持久化。返回值不含渲染后的行或分页;需要计算后的行数据请使用 [渲染](#渲染)
- * `data.av.automations` 可选,保存数据库共享的规则(`spec: 1` 至 `4`)。`block` 触发器通过 `blockSource` 指定笔记本/文档范围、块类型、标签和自定义属性,`collect` 动作将符合条件的原块绑定到当前数据库。主类型包含全部子类型;格式 3 支持 `h:h1` 至 `h:h6`、`l:u/o/t`、`i:u/o/t` 和 `callout:TYPE`(区分大小写,允许自定义提示类型)。类型为空不限制,多个类型取任一匹配。自动创建的主键值可能包含由内核维护的 `block.collectionRuleID`。已有手动条目不受影响;移出后再次匹配会创建新条目并初始化字段,撤销则恢复原条目及字段 `blockSource.tagMatch` 和 `attributeMatch` 缺省为 `and`,格式 3 支持各组独立设置 `or`;组间仍取与关系,空组不限制。 每条规则的可选 `notifyOnSuccess` 缺省或 `null` 为 `true`,实际变更在事务提交成功后合并通知;关闭不影响错误提示。无变化、手动收集、撤销重做及回滚事务不发送成功通知。 格式 4 增加可选的 `blockSource.tagTarget`:缺省或空字符串沿用原行为,`block` 收集标签所在块,`container` 选择最近的符合类型和属性条件的容器并按块 ID 去重;文档需显式选择 `d`。全部标签须在同一个来源块中,无标签条件时此选项不影响筛选。预览与实际收集对象一致,切换保留已有条目及字段。
+ * `data.av.automations` 可选,保存数据库共享的规则(`spec: 1` 至 `4`)。`block` 触发器通过 `blockSource` 指定笔记本/文档范围、块类型、标签和自定义属性,`collect` 动作将符合条件的原块绑定到当前数据库。主类型包含全部子类型;格式 3 支持 `h:h1` 至 `h:h6`、`l:u/o/t`、`i:u/o/t` 和 `callout:TYPE`(区分大小写,允许自定义提示类型)。类型为空不限制,多个类型取任一匹配。自动创建的主键值可能包含由内核维护的 `block.collectionRuleID`。已有手动条目不受影响;移出后再次匹配会创建新条目并初始化字段,撤销则恢复原条目及字段 `blockSource.tagMatch` 和 `attributeMatch` 缺省为 `and`,格式 3 支持各组独立设置 `or`;组间仍取与关系,空组不限制。 每条规则的可选 `notifyOnSuccess` 缺省或 `null` 为 `true`,实际变更在事务提交成功后合并通知;关闭不影响错误提示。无变化、手动收集、撤销重做及回滚事务不发送成功通知。 格式 4 增加可选的 `blockSource.tagTarget`:缺省或空字符串使用默认选择,优先收集合格列表项而非其首个内容块,`block` 收集标签所在块,`container` 选择最近的符合类型和属性条件的容器并按块 ID 去重;文档需显式选择 `d`。全部标签须在同一个来源块中,无标签条件时此选项不影响筛选。预览与实际收集对象一致,切换保留已有条目及字段。
### 获取主键值
diff --git a/kernel/apicontract/av_automation.go b/kernel/apicontract/av_automation.go
index e4b68885d2..a8e9d698b6 100644
--- a/kernel/apicontract/av_automation.go
+++ b/kernel/apicontract/av_automation.go
@@ -34,7 +34,9 @@ type AVAutomationRule struct {
// 各条件组之间取与关系,空组不限制;标签精确匹配,全部标签必须出现在同一个来源块中。
// types 为空不限制类型;主类型匹配其全部子类型,类型之间取或关系。
// spec 3 支持 h:h1 至 h:h6、l:u/o/t、i:u/o/t 和 callout:类型名;提示块类型区分大小写,允许自定义名称。
-// 列表项首段的标签默认归属列表项;显式选择段落类型时可匹配该段落。
+// 所有模式先匹配标签来源,再选择满足类型和属性条件的最终对象,每个来源只选择一个对象。
+// 缺省优先收集首个内容块所属的合格列表项;列表项不合格时才尝试来源块。
+// 同时选择段落和列表项且两者合格时只收集列表项;仅选择段落时收集段落。
// tagTarget 缺省或空字符串沿用默认行为;block 收集直接包含标签的块,不做列表项提升。
// container 从标签来源块向上选择最近的满足类型及属性条件的容器,按块 ID 去重。
// 文档仅在 types 显式包含 d 时作为目标容器;无标签条件时 tagTarget 不改变类型及属性筛选结果。
diff --git a/kernel/apicontract/contracts.go b/kernel/apicontract/contracts.go
index 01ebc65c9f..f4a91d8dbb 100644
--- a/kernel/apicontract/contracts.go
+++ b/kernel/apicontract/contracts.go
@@ -1442,6 +1442,7 @@ var SystemAddUIProcess = define[EmptyRequest, Null]("addUIProcess", "/api/system
// blockSource 的 tagMatch、attributeMatch 缺省为 and;spec 3 支持各组独立设置 or,空组不限制,组间仍为 and。
// spec 4 的 blockSource.tagTarget 支持 block(标签所在块)和 container(最近合格容器),缺省保持原行为。
// 容器按类型及属性条件选择并去重;全部标签须在同一个来源块中,文档容器须显式选择 d。
+// 类型和属性始终筛选最终对象;默认首个内容块优先归属合格列表项,每次标签命中只选择一个对象。
// 无标签时收集对象不影响筛选;变更收集对象不转换已有条目,预览与实际收集使用相同规则。
// 规则的 notifyOnSuccess 缺省或 null 为开启,仅实际变更且事务成功提交后通知,同一事务合并;错误提示不受其控制。
// 手动收集、无变化、撤销重放和失败回滚不发送成功通知。
diff --git a/kernel/model/attribute_view_collection.go b/kernel/model/attribute_view_collection.go
index 49f8af459f..6b52d06daa 100644
--- a/kernel/model/attribute_view_collection.go
+++ b/kernel/model/attribute_view_collection.go
@@ -47,29 +47,6 @@ func collectionScopeMatches(source *av.AutomationBlockSource, tree *parse.Tree)
return false
}
-func collectionBlockMatches(source *av.AutomationBlockSource, node *ast.Node, tree *parse.Tree) bool {
- if node == nil || !node.IsBlock() || !ast.IsNodeIDPattern(node.ID) || !collectionScopeMatches(source, tree) {
- return false
- }
- if !collectionBlockConditionsMatch(source, node) {
- return false
- }
- if len(source.Tags) == 0 {
- return true
- }
- root := node
- if source.TagTarget == "" {
- if node.Type == ast.NodeListItem {
- root = treenode.FirstLeafBlock(node)
- }
- if node.Type == ast.NodeParagraph && node.Parent != nil && node.Parent.Type == ast.NodeListItem &&
- treenode.FirstLeafBlock(node.Parent) == node && !slices.Contains(source.Types, "p") {
- return false
- }
- }
- return collectionTagsMatch(source, root)
-}
-
func collectionBlockConditionsMatch(source *av.AutomationBlockSource, node *ast.Node) bool {
if len(source.Types) > 0 {
typ := treenode.TypeAbbr(node.Type.String())
@@ -113,7 +90,7 @@ func collectionTagsMatch(source *av.AutomationBlockSource, root *ast.Node) bool
})
}
-// 每个标签来源只选择最近的合格容器;整棵树共用结果,避免嵌套容器反复扫描子树。
+// 先匹配标签来源,再选择唯一的合格对象;类型和属性始终约束最终收集对象。
func collectionMatches(source *av.AutomationBlockSource, tree *parse.Tree) map[string]bool {
ret := map[string]bool{}
if !collectionScopeMatches(source, tree) {
@@ -130,18 +107,41 @@ func collectionMatches(source *av.AutomationBlockSource, tree *parse.Tree) map[s
if !node.IsBlock() || !ast.IsNodeIDPattern(node.ID) {
return ast.WalkContinue
}
- if source.TagTarget != "container" || len(source.Tags) == 0 {
- if collectionBlockMatches(source, node, tree) {
+ if len(source.Tags) == 0 {
+ if collectionBlockConditionsMatch(source, node) {
ret[node.ID] = true
}
return ast.WalkContinue
}
- if node.IsContainerBlock() && (node.Type != ast.NodeDocument || slices.Contains(source.Types, "d")) &&
+ if source.TagTarget == "container" && node.IsContainerBlock() &&
+ (node.Type != ast.NodeDocument || slices.Contains(source.Types, "d")) &&
collectionBlockConditionsMatch(source, node) {
containers = append(containers, node)
}
- if len(containers) > 0 && collectionTagsMatch(source, node) {
- ret[containers[len(containers)-1].ID] = true
+ if !collectionTagsMatch(source, node) {
+ return ast.WalkContinue
+ }
+ var target *ast.Node
+ switch source.TagTarget {
+ case "container":
+ if len(containers) > 0 {
+ target = containers[len(containers)-1]
+ }
+ case "block":
+ if collectionBlockConditionsMatch(source, node) {
+ target = node
+ }
+ default:
+ parent := node.Parent
+ if parent != nil && parent.Type == ast.NodeListItem && treenode.FirstLeafBlock(parent) == node &&
+ collectionBlockConditionsMatch(source, parent) {
+ target = parent
+ } else if collectionBlockConditionsMatch(source, node) {
+ target = node
+ }
+ }
+ if target != nil && ast.IsNodeIDPattern(target.ID) {
+ ret[target.ID] = true
}
return ast.WalkContinue
})
diff --git a/kernel/model/attribute_view_collection_fts5_test.go b/kernel/model/attribute_view_collection_fts5_test.go
index a8fcade0f9..b67fca725a 100644
--- a/kernel/model/attribute_view_collection_fts5_test.go
+++ b/kernel/model/attribute_view_collection_fts5_test.go
@@ -245,20 +245,35 @@ func TestBlockCollectionInlineTagsAndAttributes(t *testing.T) {
root.AppendChild(list)
tree := &parse.Tree{ID: rootID, Root: root, Box: "notebook", Path: "/parent/" + rootID + ".sy"}
source := &av.AutomationBlockSource{DocumentIDs: []string{"parent"}, Tags: []string{"todo"}}
- if !collectionBlockMatches(source, list, tree) || collectionBlockMatches(source, root, tree) || collectionBlockMatches(source, paragraph, tree) {
+ if !collectionMatches(source, tree)[list.ID] || collectionMatches(source, tree)[root.ID] || collectionMatches(source, tree)[paragraph.ID] {
t.Fatal("inline tags must not collect ancestor containers or duplicate a list item's first paragraph")
}
source.Types = []string{"p"}
- if !collectionBlockMatches(source, paragraph, tree) || collectionBlockMatches(source, list, tree) {
+ if !collectionMatches(source, tree)[paragraph.ID] || collectionMatches(source, tree)[list.ID] {
t.Fatal("explicit paragraph selection was not respected")
}
+ source.Types = []string{"p", "i"}
+ matches := collectionMatches(source, tree)
+ if len(matches) != 1 || !matches[list.ID] {
+ t.Fatalf("default selection duplicated a list item and its first paragraph: %v", matches)
+ }
+ source.Types = []string{"p"}
paragraph.SetIALAttr("custom-state", "A&B")
source.Attributes = []*av.AutomationBlockAttribute{{Name: "custom-state", Operator: "equals", Value: "A&B"}}
- if !collectionBlockMatches(source, paragraph, tree) {
+ source.Types = []string{"p", "i"}
+ if matches = collectionMatches(source, tree); len(matches) != 1 || !matches[paragraph.ID] {
+ t.Fatal("default selection did not filter the final object's attributes")
+ }
+ list.SetIALAttr("custom-state", "A&B")
+ if matches = collectionMatches(source, tree); len(matches) != 1 || !matches[list.ID] {
+ t.Fatal("eligible list item must take precedence over its first paragraph")
+ }
+ source.Types = []string{"p"}
+ if !collectionMatches(source, tree)[paragraph.ID] {
t.Fatal("custom attribute matching used escaped storage text")
}
source.Attributes[0].Operator = "notExists"
- if collectionBlockMatches(source, paragraph, tree) {
+ if collectionMatches(source, tree)[paragraph.ID] {
t.Fatal("existing attribute matched absence condition")
}
}
@@ -279,6 +294,7 @@ func TestBlockCollectionSubtypes(t *testing.T) {
} {
node := &ast.Node{ID: ast.NewNodeID(), Type: test.typ, HeadingLevel: test.level,
ListData: &ast.ListData{Typ: test.listType}, CalloutType: test.sub}
+ tree.Root = node
main := treenode.TypeAbbr(node.Type.String())
for _, types := range [][]string{nil, {main}, {"l:u"}, {"i:t"}, {"h:h1", "h:h2"}, {"callout:WARNING"}, {"callout:CUSTOM"}} {
source := &av.AutomationBlockSource{DocumentIDs: []string{rootID}, Types: types}
@@ -286,7 +302,7 @@ func TestBlockCollectionSubtypes(t *testing.T) {
for _, typ := range types {
want = want || typ == main || test.sub != "" && typ == main+":"+test.sub
}
- if got := collectionBlockMatches(source, node, tree); got != want {
+ if got := collectionMatches(source, tree)[node.ID]; got != want {
t.Fatalf("%s:%s with %v: %v want %v", main, test.sub, types, got, want)
}
}
@@ -309,20 +325,20 @@ func TestBlockCollectionConditionCombinations(t *testing.T) {
{"", "", false}, {"and", "and", false}, {"or", "and", false}, {"and", "or", false}, {"or", "or", true},
} {
source.TagMatch, source.AttributeMatch = modes.tags, modes.attrs
- if got := collectionBlockMatches(source, node, tree); got != modes.want {
+ if got := collectionMatches(source, tree)[node.ID]; got != modes.want {
t.Fatalf("%+v: %v", modes, got)
}
}
source.Tags = []string{"missing"}
- if collectionBlockMatches(source, node, tree) {
+ if collectionMatches(source, tree)[node.ID] {
t.Fatal("OR inside a group bypassed the other group")
}
source.Tags, source.Attributes = nil, nil
- if !collectionBlockMatches(source, node, tree) {
+ if !collectionMatches(source, tree)[node.ID] {
t.Fatal("empty OR groups restricted matches")
}
source.Types = []string{"p"}
- if collectionBlockMatches(source, node, tree) {
+ if collectionMatches(source, tree)[node.ID] {
t.Fatal("empty groups bypassed type filtering")
}
}