Skip to content

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

:bug: Preserve saved location values and show longitude first https://github.com/siyuan-note/siyuan/issues/20325

Daniel9f98737ee10d
diff --git a/app/appearance/langs/ar.json b/app/appearance/langs/ar.json
index fb254599aa..d787a7f4d5 100644
--- a/app/appearance/langs/ar.json
+++ b/app/appearance/langs/ar.json
@@ -54,7 +54,7 @@
"mapTooManyMarkers": "تحتوي هذه الصفحة على أكثر من ${limit} موقعًا. استخدم عوامل التصفية أو قلّل حجم الصفحة لعرض الخريطة",
"defaultCoordinateSystem": "نظام الإحداثيات الافتراضي للإدخال الجديد",
"defaultCoordinateSystemTip": "ينطبق على الإدخال الجديد فقط؛ تبقى المواقع الحالية دون تغيير ولا يتم تحويل الإحداثيات",
- "locationPasteInEditor": "الصق أزواج الإحداثيات في محرر الموقع، حيث يُوضَّح ترتيب خط العرض ثم خط الطول ونظام الإحداثيات",
+ "locationPasteInEditor": "الصق أزواج الإحداثيات في محرر الموقع؛ الترتيب الافتراضي هو خط الطول ثم خط العرض. تحقّق من نظام الإحداثيات واختر الترتيب يدويًا؛ لا يُبدَّل الترتيب تلقائيًا",
"location": "الموقع",
"locationName": "الاسم (اختياري)",
"latitude": "خط العرض",
@@ -62,7 +62,7 @@
"coordinateSystem": "نظام الإحداثيات",
"coordinateSystemUnknown": "غير معروف",
"pasteCoordinates": "لصق الإحداثيات",
- "coordinateOrderTip": "إحداثيات عشرية بترتيب خط العرض ثم خط الطول؛ لا يتم تبديل الترتيب تلقائيًا",
+ "coordinateOrderTip": "تُقرأ الإحداثيات بالترتيب المحدد؛ الترتيب الافتراضي هو خط الطول ثم خط العرض",
"invalidCoordinates": "أدخل خط عرض محدودًا من -90 إلى 90 وخط طول من -180 إلى 180، أو اترك كليهما فارغًا",
"invalidCoordinateSystem": "اختر نظام إحداثيات مدعومًا",
"coordinateSystemTip": "اختر نظام الإحداثيات المستخدم فعليًا؛ تغيير التسمية لا يحوّل الإحداثيات",
diff --git a/app/appearance/langs/de.json b/app/appearance/langs/de.json
index fba7c34bac..7fe5dd8149 100644
--- a/app/appearance/langs/de.json
+++ b/app/appearance/langs/de.json
@@ -54,7 +54,7 @@
"mapTooManyMarkers": "Diese Seite enthält mehr als ${limit} Standorte. Filter verwenden oder die Seitengröße verkleinern, um die Karte anzuzeigen",
"defaultCoordinateSystem": "Standardkoordinatensystem für neue Eingaben",
"defaultCoordinateSystemTip": "Gilt nur für neue Eingaben; vorhandene Standorte bleiben unverändert und Koordinaten werden nicht umgerechnet",
- "locationPasteInEditor": "Koordinatenpaare im Standorteditor einfügen, wo die Reihenfolge Breitengrad, Längengrad und das Koordinatensystem ausdrücklich angegeben sind",
+ "locationPasteInEditor": "Koordinatenpaare im Standorteditor einfügen; standardmäßig gilt Längengrad, Breitengrad. Koordinatensystem prüfen und Reihenfolge manuell auswählen; sie wird nie automatisch vertauscht",
"location": "Standort",
"locationName": "Name (optional)",
"latitude": "Breitengrad",
@@ -62,7 +62,7 @@
"coordinateSystem": "Koordinatensystem",
"coordinateSystemUnknown": "Unbekannt",
"pasteCoordinates": "Koordinaten einfügen",
- "coordinateOrderTip": "Dezimalgrad in der Reihenfolge Breitengrad, Längengrad; die Reihenfolge wird nie vertauscht",
+ "coordinateOrderTip": "Koordinaten werden in der ausgewählten Reihenfolge gelesen; standardmäßig gilt Längengrad, Breitengrad",
"invalidCoordinates": "Endlichen Breitengrad von -90 bis 90 und Längengrad von -180 bis 180 eingeben oder beide leer lassen",
"invalidCoordinateSystem": "Ein unterstütztes Koordinatensystem auswählen",
"coordinateSystemTip": "Wählen Sie das tatsächliche Koordinatensystem der Koordinaten; eine Änderung der Bezeichnung rechnet die Koordinaten nicht um",
diff --git a/app/appearance/langs/en.json b/app/appearance/langs/en.json
index e1b463befb..8f40e22fcb 100644
--- a/app/appearance/langs/en.json
+++ b/app/appearance/langs/en.json
@@ -54,7 +54,7 @@
"mapTooManyMarkers": "This page has more than ${limit} locations. Use filters or a smaller page size to display the map",
"defaultCoordinateSystem": "Default coordinate system for new input",
"defaultCoordinateSystemTip": "Applies only to new input; existing locations stay unchanged and coordinates are not converted",
- "locationPasteInEditor": "Paste coordinate pairs in the location editor, where latitude, longitude order and the coordinate system are explicit",
+ "locationPasteInEditor": "Paste coordinate pairs in the location editor; the default is longitude, latitude. Check the coordinate system and select the order manually; it is never swapped automatically",
"location": "Location",
"locationName": "Name (optional)",
"latitude": "Latitude",
@@ -62,7 +62,7 @@
"coordinateSystem": "Coordinate system",
"coordinateSystemUnknown": "Unknown",
"pasteCoordinates": "Paste coordinates",
- "coordinateOrderTip": "Decimal coordinates in latitude, longitude order; coordinates are never swapped",
+ "coordinateOrderTip": "Coordinates are read in the selected order; longitude, latitude is the default",
"invalidCoordinates": "Enter a finite latitude from -90 to 90 and longitude from -180 to 180, or leave both empty",
"invalidCoordinateSystem": "Choose a supported coordinate system",
"coordinateSystemTip": "Select the coordinate system actually used by the coordinates; changing the label does not convert coordinates",
diff --git a/app/appearance/langs/es.json b/app/appearance/langs/es.json
index 9b388fa4a4..08b5d38613 100644
--- a/app/appearance/langs/es.json
+++ b/app/appearance/langs/es.json
@@ -54,7 +54,7 @@
"mapTooManyMarkers": "Esta página tiene más de ${limit} ubicaciones. Use filtros o reduzca el tamaño de página para mostrar el mapa",
"defaultCoordinateSystem": "Sistema de coordenadas predeterminado para nuevas entradas",
"defaultCoordinateSystemTip": "Solo se aplica a nuevas entradas; las ubicaciones existentes no cambian y las coordenadas no se convierten",
- "locationPasteInEditor": "Pega los pares de coordenadas en el editor de ubicación, donde se indican el orden latitud, longitud y el sistema de coordenadas",
+ "locationPasteInEditor": "Pega los pares de coordenadas en el editor de ubicación; el orden predeterminado es longitud, latitud. Comprueba el sistema de coordenadas y selecciona el orden manualmente; nunca se intercambia de forma automática",
"location": "Ubicación",
"locationName": "Nombre (opcional)",
"latitude": "Latitud",
@@ -62,7 +62,7 @@
"coordinateSystem": "Sistema de coordenadas",
"coordinateSystemUnknown": "Desconocido",
"pasteCoordinates": "Pegar coordenadas",
- "coordinateOrderTip": "Coordenadas decimales en orden latitud, longitud; nunca se intercambia el orden",
+ "coordinateOrderTip": "Las coordenadas se leen en el orden seleccionado; el predeterminado es longitud, latitud",
"invalidCoordinates": "Introduce una latitud finita entre -90 y 90 y una longitud entre -180 y 180, o deja ambas vacías",
"invalidCoordinateSystem": "Elige un sistema de coordenadas compatible",
"coordinateSystemTip": "Seleccione el sistema que utilizan realmente las coordenadas; cambiar la etiqueta no convierte las coordenadas",
diff --git a/app/appearance/langs/fr.json b/app/appearance/langs/fr.json
index 26d71588a0..fc84a2c620 100644
--- a/app/appearance/langs/fr.json
+++ b/app/appearance/langs/fr.json
@@ -54,7 +54,7 @@
"mapTooManyMarkers": "Cette page comporte plus de ${limit} localisations. Utilisez des filtres ou réduisez la taille des pages pour afficher la carte",
"defaultCoordinateSystem": "Système de coordonnées par défaut des nouvelles saisies",
"defaultCoordinateSystemTip": "S’applique uniquement aux nouvelles saisies ; les lieux existants restent inchangés et les coordonnées ne sont pas converties",
- "locationPasteInEditor": "Collez les paires de coordonnées dans l’éditeur de lieu, où l’ordre latitude, longitude et le système de coordonnées sont précisés",
+ "locationPasteInEditor": "Collez les paires de coordonnées dans l’éditeur de lieu ; l’ordre par défaut est longitude, latitude. Vérifiez le système de coordonnées et choisissez l’ordre manuellement ; il n’est jamais inversé automatiquement",
"location": "Lieu",
"locationName": "Nom (facultatif)",
"latitude": "Latitude",
@@ -62,7 +62,7 @@
"coordinateSystem": "Système de coordonnées",
"coordinateSystemUnknown": "Inconnu",
"pasteCoordinates": "Coller les coordonnées",
- "coordinateOrderTip": "Coordonnées décimales dans l’ordre latitude, longitude ; cet ordre n’est jamais inversé",
+ "coordinateOrderTip": "Les coordonnées sont lues dans l’ordre sélectionné ; longitude, latitude est l’ordre par défaut",
"invalidCoordinates": "Saisissez une latitude finie entre -90 et 90 et une longitude entre -180 et 180, ou laissez les deux vides",
"invalidCoordinateSystem": "Choisissez un système de coordonnées pris en charge",
"coordinateSystemTip": "Sélectionnez le système réellement utilisé par les coordonnées ; changer l’étiquette ne convertit pas les coordonnées",
diff --git a/app/appearance/langs/he.json b/app/appearance/langs/he.json
index 26815ade84..7fe3830666 100644
--- a/app/appearance/langs/he.json
+++ b/app/appearance/langs/he.json
@@ -54,7 +54,7 @@
"mapTooManyMarkers": "בדף זה יש יותר מ-${limit} מיקומים. השתמש במסננים או הקטן את גודל הדף כדי להציג את המפה",
"defaultCoordinateSystem": "מערכת קואורדינטות כברירת מחדל לקלט חדש",
"defaultCoordinateSystemTip": "חל רק על קלט חדש; מיקומים קיימים אינם משתנים והקואורדינטות אינן מומרות",
- "locationPasteInEditor": "יש להדביק זוגות קואורדינטות בעורך המיקום, שבו סדר קו הרוחב וקו האורך ומערכת הקואורדינטות מצוינים במפורש",
+ "locationPasteInEditor": "יש להדביק זוגות קואורדינטות בעורך המיקום; סדר ברירת המחדל הוא קו אורך, קו רוחב. יש לבדוק את מערכת הקואורדינטות ולבחור את הסדר ידנית; הסדר לעולם לא מוחלף אוטומטית",
"location": "מיקום",
"locationName": "שם (רשות)",
"latitude": "קו רוחב",
@@ -62,7 +62,7 @@
"coordinateSystem": "מערכת קואורדינטות",
"coordinateSystemUnknown": "לא ידועה",
"pasteCoordinates": "הדבקת קואורדינטות",
- "coordinateOrderTip": "קואורדינטות עשרוניות בסדר קו רוחב, קו אורך; הסדר לעולם לא מוחלף אוטומטית",
+ "coordinateOrderTip": "הקואורדינטות נקראות לפי הסדר שנבחר; סדר ברירת המחדל הוא קו אורך, קו רוחב",
"invalidCoordinates": "יש להזין קו רוחב סופי בין ‎-90 ל-90 וקו אורך בין ‎-180 ל-180, או להשאיר את שניהם ריקים",
"invalidCoordinateSystem": "יש לבחור מערכת קואורדינטות נתמכת",
"coordinateSystemTip": "בחרו את המערכת שבה הקואורדינטות משתמשות בפועל; שינוי התווית אינו ממיר את הקואורדינטות",
diff --git a/app/appearance/langs/hi.json b/app/appearance/langs/hi.json
index fa080d7587..48ceca414d 100644
--- a/app/appearance/langs/hi.json
+++ b/app/appearance/langs/hi.json
@@ -54,7 +54,7 @@
"mapTooManyMarkers": "इस पृष्ठ पर ${limit} से अधिक स्थान हैं। मानचित्र दिखाने के लिए फ़िल्टर उपयोग करें या पृष्ठ का आकार कम करें",
"defaultCoordinateSystem": "नए इनपुट के लिए डिफ़ॉल्ट निर्देशांक प्रणाली",
"defaultCoordinateSystemTip": "केवल नए इनपुट पर लागू होता है; मौजूदा स्थान अपरिवर्तित रहते हैं और निर्देशांक परिवर्तित नहीं होते",
- "locationPasteInEditor": "निर्देशांक जोड़े स्थान संपादक में पेस्ट करें, जहाँ अक्षांश, देशांतर का क्रम और निर्देशांक प्रणाली स्पष्ट हैं",
+ "locationPasteInEditor": "निर्देशांक जोड़े स्थान संपादक में पेस्ट करें; डिफ़ॉल्ट क्रम देशांतर, अक्षांश है। निर्देशांक प्रणाली जाँचें और क्रम मैन्युअल रूप से चुनें; क्रम कभी अपने आप नहीं बदलेगा",
"location": "स्थान",
"locationName": "नाम (वैकल्पिक)",
"latitude": "अक्षांश",
@@ -62,7 +62,7 @@
"coordinateSystem": "निर्देशांक प्रणाली",
"coordinateSystemUnknown": "अज्ञात",
"pasteCoordinates": "निर्देशांक पेस्ट करें",
- "coordinateOrderTip": "दशमलव निर्देशांक अक्षांश, देशांतर के क्रम में दें; क्रम कभी अपने आप नहीं बदलेगा",
+ "coordinateOrderTip": "निर्देशांक चुने गए क्रम में पढ़े जाते हैं; डिफ़ॉल्ट क्रम देशांतर, अक्षांश है",
"invalidCoordinates": "-90 से 90 तक सीमित अक्षांश और -180 से 180 तक सीमित देशांतर दर्ज करें, या दोनों खाली छोड़ें",
"invalidCoordinateSystem": "समर्थित निर्देशांक प्रणाली चुनें",
"coordinateSystemTip": "वह प्रणाली चुनें जिसका निर्देशांक वास्तव में उपयोग करते हैं; लेबल बदलने से निर्देशांक परिवर्तित नहीं होते",
diff --git a/app/appearance/langs/id.json b/app/appearance/langs/id.json
index 386ccbcb6d..320d8f78f3 100644
--- a/app/appearance/langs/id.json
+++ b/app/appearance/langs/id.json
@@ -54,7 +54,7 @@
"mapTooManyMarkers": "Halaman ini memiliki lebih dari ${limit} lokasi. Gunakan filter atau ukuran halaman yang lebih kecil untuk menampilkan peta",
"defaultCoordinateSystem": "Sistem koordinat bawaan untuk masukan baru",
"defaultCoordinateSystemTip": "Hanya berlaku untuk masukan baru; lokasi yang ada tidak berubah dan koordinat tidak dikonversi",
- "locationPasteInEditor": "Tempel pasangan koordinat di editor lokasi, tempat urutan lintang, bujur dan sistem koordinat ditentukan dengan jelas",
+ "locationPasteInEditor": "Tempel pasangan koordinat di editor lokasi; urutan bawaan adalah bujur, lintang. Periksa sistem koordinat dan pilih urutan secara manual; urutan tidak pernah ditukar otomatis",
"location": "Lokasi",
"locationName": "Nama (opsional)",
"latitude": "Lintang",
@@ -62,7 +62,7 @@
"coordinateSystem": "Sistem koordinat",
"coordinateSystemUnknown": "Tidak diketahui",
"pasteCoordinates": "Tempel koordinat",
- "coordinateOrderTip": "Koordinat desimal dalam urutan lintang, bujur; urutan tidak pernah ditukar otomatis",
+ "coordinateOrderTip": "Koordinat dibaca sesuai urutan yang dipilih; urutan bawaan adalah bujur, lintang",
"invalidCoordinates": "Masukkan lintang terhingga dari -90 hingga 90 dan bujur dari -180 hingga 180, atau kosongkan keduanya",
"invalidCoordinateSystem": "Pilih sistem koordinat yang didukung",
"coordinateSystemTip": "Pilih sistem yang sebenarnya digunakan oleh koordinat; mengubah label tidak mengonversi koordinat",
diff --git a/app/appearance/langs/it.json b/app/appearance/langs/it.json
index 0b2df8b0d5..c67d37bf0f 100644
--- a/app/appearance/langs/it.json
+++ b/app/appearance/langs/it.json
@@ -54,7 +54,7 @@
"mapTooManyMarkers": "Questa pagina contiene più di ${limit} posizioni. Usa i filtri o riduci la dimensione della pagina per visualizzare la mappa",
"defaultCoordinateSystem": "Sistema di coordinate predefinito per nuovi inserimenti",
"defaultCoordinateSystemTip": "Si applica solo ai nuovi inserimenti; le posizioni esistenti restano invariate e le coordinate non vengono convertite",
- "locationPasteInEditor": "Incolla le coppie di coordinate nell’editor della posizione, dove sono indicati l’ordine latitudine, longitudine e il sistema di coordinate",
+ "locationPasteInEditor": "Incolla le coppie di coordinate nell’editor della posizione; l’ordine predefinito è longitudine, latitudine. Verifica il sistema di coordinate e seleziona l’ordine manualmente; non viene mai invertito automaticamente",
"location": "Posizione",
"locationName": "Nome (facoltativo)",
"latitude": "Latitudine",
@@ -62,7 +62,7 @@
"coordinateSystem": "Sistema di coordinate",
"coordinateSystemUnknown": "Sconosciuto",
"pasteCoordinates": "Incolla coordinate",
- "coordinateOrderTip": "Coordinate decimali nell’ordine latitudine, longitudine; l’ordine non viene mai invertito",
+ "coordinateOrderTip": "Le coordinate vengono lette nell’ordine selezionato; quello predefinito è longitudine, latitudine",
"invalidCoordinates": "Inserisci una latitudine finita da -90 a 90 e una longitudine da -180 a 180, oppure lascia entrambe vuote",
"invalidCoordinateSystem": "Scegli un sistema di coordinate supportato",
"coordinateSystemTip": "Seleziona il sistema effettivamente usato dalle coordinate; modificare l’etichetta non converte le coordinate",
diff --git a/app/appearance/langs/ja.json b/app/appearance/langs/ja.json
index 3a785a6714..a81479aca1 100644
--- a/app/appearance/langs/ja.json
+++ b/app/appearance/langs/ja.json
@@ -54,7 +54,7 @@
"mapTooManyMarkers": "このページには ${limit} 件を超える位置があります。フィルターを使用するか、ページあたりの件数を減らして地図を表示してください",
"defaultCoordinateSystem": "新規入力の既定の座標系",
"defaultCoordinateSystemTip": "新規入力にのみ適用されます。既存の位置は変わらず、座標も変換されません",
- "locationPasteInEditor": "緯度、経度の順序と座標系を確認できる位置エディターで座標の組を貼り付けてください",
+ "locationPasteInEditor": "位置エディターに座標の組を貼り付けてください。既定の順序は経度、緯度です。座標系を確認し、順序は手動で選択してください。順序は自動で入れ替わりません",
"location": "位置",
"locationName": "名前(任意)",
"latitude": "緯度",
@@ -62,7 +62,7 @@
"coordinateSystem": "座標系",
"coordinateSystemUnknown": "不明",
"pasteCoordinates": "座標を貼り付け",
- "coordinateOrderTip": "緯度、経度の順に十進度で入力します。順序は自動で入れ替わりません",
+ "coordinateOrderTip": "座標は選択した順序で読み取られます。既定の順序は経度、緯度です",
"invalidCoordinates": "緯度は -90 から 90、経度は -180 から 180 の有限値を入力するか、両方を空欄にしてください",
"invalidCoordinateSystem": "対応する座標系を選択してください",
"coordinateSystemTip": "座標が実際に使用している座標系を選択してください。ラベルを変更しても座標は変換されません",
diff --git a/app/appearance/langs/ko.json b/app/appearance/langs/ko.json
index 8801b635a7..4ba8304a14 100644
--- a/app/appearance/langs/ko.json
+++ b/app/appearance/langs/ko.json
@@ -54,7 +54,7 @@
"mapTooManyMarkers": "이 페이지의 위치가 ${limit}개를 초과합니다. 지도를 표시하려면 필터를 사용하거나 페이지 크기를 줄이세요",
"defaultCoordinateSystem": "새 입력의 기본 좌표계",
"defaultCoordinateSystemTip": "새 입력에만 적용되며 기존 위치는 변경되지 않고 좌표도 변환되지 않습니다",
- "locationPasteInEditor": "위도, 경도 순서와 좌표계가 명확하게 표시된 위치 편집기에 좌표 쌍을 붙여넣으세요",
+ "locationPasteInEditor": "위치 편집기에 좌표 쌍을 붙여넣으세요. 기본 순서는 경도, 위도입니다. 좌표계를 확인하고 순서를 직접 선택하세요. 순서는 자동으로 바뀌지 않습니다",
"location": "위치",
"locationName": "이름(선택 사항)",
"latitude": "위도",
@@ -62,7 +62,7 @@
"coordinateSystem": "좌표계",
"coordinateSystemUnknown": "알 수 없음",
"pasteCoordinates": "좌표 붙여넣기",
- "coordinateOrderTip": "위도, 경도 순서로 십진수 좌표를 입력하며 순서는 자동으로 바뀌지 않습니다",
+ "coordinateOrderTip": "좌표는 선택한 순서로 읽으며 기본 순서는 경도, 위도입니다",
"invalidCoordinates": "위도는 -90~90, 경도는 -180~180 사이의 유한한 값을 입력하거나 둘 다 비워 두세요",
"invalidCoordinateSystem": "지원되는 좌표계를 선택하세요",
"coordinateSystemTip": "좌표에 실제로 사용된 좌표계를 선택하세요. 표시를 변경해도 좌표는 변환되지 않습니다",
diff --git a/app/appearance/langs/nl.json b/app/appearance/langs/nl.json
index d5cd596cb7..af0a982404 100644
--- a/app/appearance/langs/nl.json
+++ b/app/appearance/langs/nl.json
@@ -54,7 +54,7 @@
"mapTooManyMarkers": "Deze pagina heeft meer dan ${limit} locaties. Gebruik filters of verklein de paginagrootte om de kaart weer te geven",
"defaultCoordinateSystem": "Standaardcoördinatenstelsel voor nieuwe invoer",
"defaultCoordinateSystemTip": "Geldt alleen voor nieuwe invoer; bestaande locaties blijven ongewijzigd en coördinaten worden niet geconverteerd",
- "locationPasteInEditor": "Plak coördinatenparen in de locatie-editor, waar de volgorde breedtegraad, lengtegraad en het coördinatenstelsel expliciet zijn aangegeven",
+ "locationPasteInEditor": "Plak coördinatenparen in de locatie-editor; de standaardvolgorde is lengtegraad, breedtegraad. Controleer het coördinatenstelsel en kies de volgorde handmatig; deze wordt nooit automatisch omgewisseld",
"location": "Locatie",
"locationName": "Naam (optioneel)",
"latitude": "Breedtegraad",
@@ -62,7 +62,7 @@
"coordinateSystem": "Coördinatenstelsel",
"coordinateSystemUnknown": "Onbekend",
"pasteCoordinates": "Coördinaten plakken",
- "coordinateOrderTip": "Decimale coördinaten in de volgorde breedtegraad, lengtegraad; de volgorde wordt nooit omgewisseld",
+ "coordinateOrderTip": "Coördinaten worden in de gekozen volgorde gelezen; de standaardvolgorde is lengtegraad, breedtegraad",
"invalidCoordinates": "Voer een eindige breedtegraad van -90 tot 90 en lengtegraad van -180 tot 180 in, of laat beide leeg",
"invalidCoordinateSystem": "Kies een ondersteund coördinatenstelsel",
"coordinateSystemTip": "Selecteer het coördinatenstelsel dat de coördinaten daadwerkelijk gebruiken; het wijzigen van het label converteert de coördinaten niet",
diff --git a/app/appearance/langs/pl.json b/app/appearance/langs/pl.json
index 737a12c4a1..050fba4a3d 100644
--- a/app/appearance/langs/pl.json
+++ b/app/appearance/langs/pl.json
@@ -54,7 +54,7 @@
"mapTooManyMarkers": "Ta strona zawiera więcej niż ${limit} lokalizacji. Użyj filtrów lub zmniejsz rozmiar strony, aby wyświetlić mapę",
"defaultCoordinateSystem": "Domyślny układ współrzędnych dla nowych wpisów",
"defaultCoordinateSystemTip": "Dotyczy tylko nowych wpisów; istniejące lokalizacje pozostają bez zmian, a współrzędne nie są przeliczane",
- "locationPasteInEditor": "Wklej pary współrzędnych w edytorze lokalizacji, w którym określono kolejność szerokość, długość geograficzna oraz układ współrzędnych",
+ "locationPasteInEditor": "Wklej pary współrzędnych w edytorze lokalizacji; domyślna kolejność to długość, szerokość geograficzna. Sprawdź układ współrzędnych i wybierz kolejność ręcznie; nigdy nie jest zmieniana automatycznie",
"location": "Lokalizacja",
"locationName": "Nazwa (opcjonalna)",
"latitude": "Szerokość geograficzna",
@@ -62,7 +62,7 @@
"coordinateSystem": "Układ współrzędnych",
"coordinateSystemUnknown": "Nieznany",
"pasteCoordinates": "Wklej współrzędne",
- "coordinateOrderTip": "Współrzędne dziesiętne w kolejności szerokość, długość geograficzna; kolejność nie jest automatycznie zamieniana",
+ "coordinateOrderTip": "Współrzędne są odczytywane w wybranej kolejności; domyślna to długość, szerokość geograficzna",
"invalidCoordinates": "Podaj skończoną szerokość od -90 do 90 i długość od -180 do 180 lub pozostaw oba pola puste",
"invalidCoordinateSystem": "Wybierz obsługiwany układ współrzędnych",
"coordinateSystemTip": "Wybierz układ rzeczywiście używany przez współrzędne; zmiana etykiety nie przelicza współrzędnych",
diff --git a/app/appearance/langs/pt-BR.json b/app/appearance/langs/pt-BR.json
index d3661d9413..2fc7a307b1 100644
--- a/app/appearance/langs/pt-BR.json
+++ b/app/appearance/langs/pt-BR.json
@@ -54,7 +54,7 @@
"mapTooManyMarkers": "Esta página tem mais de ${limit} localizações. Use filtros ou reduza o tamanho da página para exibir o mapa",
"defaultCoordinateSystem": "Sistema de coordenadas padrão para novas entradas",
"defaultCoordinateSystemTip": "Aplica-se apenas a novas entradas; as localizações existentes não mudam e as coordenadas não são convertidas",
- "locationPasteInEditor": "Cole os pares de coordenadas no editor de localização, onde a ordem latitude, longitude e o sistema de coordenadas são explícitos",
+ "locationPasteInEditor": "Cole os pares de coordenadas no editor de localização; a ordem padrão é longitude, latitude. Verifique o sistema de coordenadas e selecione a ordem manualmente; ela nunca é invertida automaticamente",
"location": "Localização",
"locationName": "Nome (opcional)",
"latitude": "Latitude",
@@ -62,7 +62,7 @@
"coordinateSystem": "Sistema de coordenadas",
"coordinateSystemUnknown": "Desconhecido",
"pasteCoordinates": "Colar coordenadas",
- "coordinateOrderTip": "Coordenadas decimais na ordem latitude, longitude; a ordem nunca é invertida",
+ "coordinateOrderTip": "As coordenadas são lidas na ordem selecionada; longitude, latitude é a ordem padrão",
"invalidCoordinates": "Insira uma latitude finita de -90 a 90 e uma longitude de -180 a 180, ou deixe ambas vazias",
"invalidCoordinateSystem": "Escolha um sistema de coordenadas compatível",
"coordinateSystemTip": "Selecione o sistema realmente usado pelas coordenadas; alterar o rótulo não converte as coordenadas",
diff --git a/app/appearance/langs/ru.json b/app/appearance/langs/ru.json
index 08c5644733..09210ed429 100644
--- a/app/appearance/langs/ru.json
+++ b/app/appearance/langs/ru.json
@@ -54,7 +54,7 @@
"mapTooManyMarkers": "На этой странице больше ${limit} местоположений. Используйте фильтры или уменьшите размер страницы, чтобы отобразить карту",
"defaultCoordinateSystem": "Система координат по умолчанию для новых данных",
"defaultCoordinateSystemTip": "Применяется только к новым данным; существующие местоположения не меняются, координаты не преобразуются",
- "locationPasteInEditor": "Вставляйте пары координат в редакторе местоположения, где явно указаны порядок широта, долгота и система координат",
+ "locationPasteInEditor": "Вставляйте пары координат в редакторе местоположения; по умолчанию используется порядок долгота, широта. Проверьте систему координат и выберите порядок вручную; он никогда не меняется автоматически",
"location": "Местоположение",
"locationName": "Название (необязательно)",
"latitude": "Широта",
@@ -62,7 +62,7 @@
"coordinateSystem": "Система координат",
"coordinateSystemUnknown": "Неизвестна",
"pasteCoordinates": "Вставить координаты",
- "coordinateOrderTip": "Десятичные координаты в порядке широта, долгота; порядок никогда не меняется автоматически",
+ "coordinateOrderTip": "Координаты считываются в выбранном порядке; по умолчанию — долгота, широта",
"invalidCoordinates": "Введите конечную широту от -90 до 90 и долготу от -180 до 180 или оставьте оба поля пустыми",
"invalidCoordinateSystem": "Выберите поддерживаемую систему координат",
"coordinateSystemTip": "Выберите систему, в которой фактически заданы координаты; изменение метки не преобразует координаты",
diff --git a/app/appearance/langs/sk.json b/app/appearance/langs/sk.json
index b383b6d355..31a71cc2de 100644
--- a/app/appearance/langs/sk.json
+++ b/app/appearance/langs/sk.json
@@ -54,7 +54,7 @@
"mapTooManyMarkers": "Táto stránka obsahuje viac ako ${limit} polôh. Na zobrazenie mapy použite filtre alebo menšiu veľkosť stránky",
"defaultCoordinateSystem": "Predvolený súradnicový systém pre nové údaje",
"defaultCoordinateSystemTip": "Platí iba pre nové údaje; existujúce polohy zostanú nezmenené a súradnice sa neprepočítajú",
- "locationPasteInEditor": "Dvojice súradníc vkladajte v editore polohy, kde je uvedené poradie šírka, dĺžka a súradnicový systém",
+ "locationPasteInEditor": "Dvojice súradníc vkladajte v editore polohy; predvolené poradie je dĺžka, šírka. Skontrolujte súradnicový systém a poradie vyberte ručne; nikdy sa nemení automaticky",
"location": "Poloha",
"locationName": "Názov (voliteľný)",
"latitude": "Zemepisná šírka",
@@ -62,7 +62,7 @@
"coordinateSystem": "Súradnicový systém",
"coordinateSystemUnknown": "Neznámy",
"pasteCoordinates": "Vložiť súradnice",
- "coordinateOrderTip": "Desatinné súradnice v poradí šírka, dĺžka; poradie sa nikdy automaticky nevymieňa",
+ "coordinateOrderTip": "Súradnice sa čítajú vo vybranom poradí; predvolené poradie je dĺžka, šírka",
"invalidCoordinates": "Zadajte konečnú šírku od -90 do 90 a dĺžku od -180 do 180 alebo nechajte obe polia prázdne",
"invalidCoordinateSystem": "Vyberte podporovaný súradnicový systém",
"coordinateSystemTip": "Vyberte súradnicový systém, ktorý súradnice skutočne používajú; zmena označenia neprepočíta súradnice",
diff --git a/app/appearance/langs/sr.json b/app/appearance/langs/sr.json
index 7d10778642..2d01dd71b9 100644
--- a/app/appearance/langs/sr.json
+++ b/app/appearance/langs/sr.json
@@ -54,7 +54,7 @@
"mapTooManyMarkers": "Ова страница има више од ${limit} локација. Користите филтере или смањите величину странице да бисте приказали мапу",
"defaultCoordinateSystem": "Подразумевани координатни систем за нове уносе",
"defaultCoordinateSystemTip": "Примењује се само на нове уносе; постојеће локације остају непромењене, а координате се не претварају",
- "locationPasteInEditor": "Налепите парове координата у уређивачу локације, где су јасно наведени редослед ширина, дужина и координатни систем",
+ "locationPasteInEditor": "Налепите парове координата у уређивачу локације; подразумевани редослед је дужина, ширина. Проверите координатни систем и ручно изаберите редослед; он се никада не мења аутоматски",
"location": "Локација",
"locationName": "Назив (опционо)",
"latitude": "Географска ширина",
@@ -62,7 +62,7 @@
"coordinateSystem": "Координатни систем",
"coordinateSystemUnknown": "Непознат",
"pasteCoordinates": "Налепи координате",
- "coordinateOrderTip": "Децималне координате редом ширина, дужина; редослед се никада аутоматски не мења",
+ "coordinateOrderTip": "Координате се читају изабраним редоследом; подразумевани редослед је дужина, ширина",
"invalidCoordinates": "Унесите коначну ширину од -90 до 90 и дужину од -180 до 180 или оставите оба поља празна",
"invalidCoordinateSystem": "Изаберите подржани координатни систем",
"coordinateSystemTip": "Изаберите систем који координате заиста користе; промена ознаке не претвара координате",
diff --git a/app/appearance/langs/th.json b/app/appearance/langs/th.json
index 5749231676..c62f11ced7 100644
--- a/app/appearance/langs/th.json
+++ b/app/appearance/langs/th.json
@@ -54,7 +54,7 @@
"mapTooManyMarkers": "หน้านี้มีตำแหน่งมากกว่า ${limit} รายการ ใช้ตัวกรองหรือลดขนาดหน้าเพื่อแสดงแผนที่",
"defaultCoordinateSystem": "ระบบพิกัดเริ่มต้นสำหรับข้อมูลใหม่",
"defaultCoordinateSystemTip": "ใช้กับข้อมูลใหม่เท่านั้น ตำแหน่งเดิมจะไม่เปลี่ยนแปลงและจะไม่มีการแปลงพิกัด",
- "locationPasteInEditor": "วางคู่พิกัดในตัวแก้ไขตำแหน่ง ซึ่งระบุลำดับละติจูด ลองจิจูด และระบบพิกัดไว้อย่างชัดเจน",
+ "locationPasteInEditor": "วางคู่พิกัดในตัวแก้ไขตำแหน่ง โดยลำดับเริ่มต้นคือลองจิจูด ละติจูด ตรวจสอบระบบพิกัดและเลือกลำดับด้วยตนเอง ระบบจะไม่สลับลำดับอัตโนมัติ",
"location": "ตำแหน่ง",
"locationName": "ชื่อ (ไม่บังคับ)",
"latitude": "ละติจูด",
@@ -62,7 +62,7 @@
"coordinateSystem": "ระบบพิกัด",
"coordinateSystemUnknown": "ไม่ทราบ",
"pasteCoordinates": "วางพิกัด",
- "coordinateOrderTip": "พิกัดทศนิยมเรียงตามละติจูด ลองจิจูด โดยจะไม่สลับลำดับอัตโนมัติ",
+ "coordinateOrderTip": "อ่านพิกัดตามลำดับที่เลือก โดยลำดับเริ่มต้นคือลองจิจูด ละติจูด",
"invalidCoordinates": "ป้อนละติจูดที่เป็นจำนวนจำกัดตั้งแต่ -90 ถึง 90 และลองจิจูดตั้งแต่ -180 ถึง 180 หรือเว้นว่างทั้งคู่",
"invalidCoordinateSystem": "เลือกระบบพิกัดที่รองรับ",
"coordinateSystemTip": "เลือกระบบที่พิกัดใช้งานจริง การเปลี่ยนป้ายกำกับจะไม่แปลงพิกัด",
diff --git a/app/appearance/langs/tr.json b/app/appearance/langs/tr.json
index e44d2e7e04..79a0a8a93d 100644
--- a/app/appearance/langs/tr.json
+++ b/app/appearance/langs/tr.json
@@ -54,7 +54,7 @@
"mapTooManyMarkers": "Bu sayfada ${limit} konumdan fazla konum var. Haritayı göstermek için filtreleri kullanın veya sayfa boyutunu küçültün",
"defaultCoordinateSystem": "Yeni girişler için varsayılan koordinat sistemi",
"defaultCoordinateSystemTip": "Yalnızca yeni girişlere uygulanır; mevcut konumlar değişmez ve koordinatlar dönüştürülmez",
- "locationPasteInEditor": "Koordinat çiftlerini enlem, boylam sırasının ve koordinat sisteminin açıkça belirtildiği konum düzenleyicisine yapıştırın",
+ "locationPasteInEditor": "Koordinat çiftlerini konum düzenleyicisine yapıştırın; varsayılan sıra boylam, enlemdir. Koordinat sistemini kontrol edin ve sırayı elle seçin; sıra hiçbir zaman otomatik değiştirilmez",
"location": "Konum",
"locationName": "Ad (isteğe bağlı)",
"latitude": "Enlem",
@@ -62,7 +62,7 @@
"coordinateSystem": "Koordinat sistemi",
"coordinateSystemUnknown": "Bilinmiyor",
"pasteCoordinates": "Koordinatları yapıştır",
- "coordinateOrderTip": "Enlem, boylam sırasında ondalık koordinatlar; sıra hiçbir zaman otomatik değiştirilmez",
+ "coordinateOrderTip": "Koordinatlar seçilen sırayla okunur; varsayılan sıra boylam, enlemdir",
"invalidCoordinates": "-90 ile 90 arasında sonlu bir enlem ve -180 ile 180 arasında bir boylam girin veya ikisini de boş bırakın",
"invalidCoordinateSystem": "Desteklenen bir koordinat sistemi seçin",
"coordinateSystemTip": "Koordinatların gerçekte kullandığı sistemi seçin; etiketi değiştirmek koordinatları dönüştürmez",
diff --git a/app/appearance/langs/uk.json b/app/appearance/langs/uk.json
index c9e42f90cc..43138ea1c8 100644
--- a/app/appearance/langs/uk.json
+++ b/app/appearance/langs/uk.json
@@ -54,7 +54,7 @@
"mapTooManyMarkers": "На цій сторінці понад ${limit} місцеположень. Використайте фільтри або зменште розмір сторінки, щоб показати мапу",
"defaultCoordinateSystem": "Типова система координат для нових даних",
"defaultCoordinateSystemTip": "Застосовується лише до нових даних; наявні розташування не змінюються, координати не перетворюються",
- "locationPasteInEditor": "Вставляйте пари координат у редакторі розташування, де явно вказано порядок широта, довгота та систему координат",
+ "locationPasteInEditor": "Вставляйте пари координат у редакторі розташування; типовий порядок — довгота, широта. Перевірте систему координат і виберіть порядок вручну; він ніколи не змінюється автоматично",
"location": "Розташування",
"locationName": "Назва (необов’язково)",
"latitude": "Широта",
@@ -62,7 +62,7 @@
"coordinateSystem": "Система координат",
"coordinateSystemUnknown": "Невідома",
"pasteCoordinates": "Вставити координати",
- "coordinateOrderTip": "Десяткові координати в порядку широта, довгота; порядок ніколи не змінюється автоматично",
+ "coordinateOrderTip": "Координати зчитуються у вибраному порядку; типовий порядок — довгота, широта",
"invalidCoordinates": "Введіть скінченну широту від -90 до 90 і довготу від -180 до 180 або залиште обидва поля порожніми",
"invalidCoordinateSystem": "Виберіть підтримувану систему координат",
"coordinateSystemTip": "Виберіть систему, у якій фактично задано координати; зміна позначки не перетворює координати",
diff --git a/app/appearance/langs/zh-CN.json b/app/appearance/langs/zh-CN.json
index 19f4a1a7b3..140a059946 100644
--- a/app/appearance/langs/zh-CN.json
+++ b/app/appearance/langs/zh-CN.json
@@ -54,7 +54,7 @@
"mapTooManyMarkers": "当前页面的位置超过 ${limit} 个,请使用筛选或减小每页记录数以显示地图",
"defaultCoordinateSystem": "新录入默认坐标系",
"defaultCoordinateSystemTip": "仅用于新录入;已有位置保持不变,不转换坐标",
- "locationPasteInEditor": "请在位置编辑器中粘贴坐标对,明确纬度、经度顺序和坐标系",
+ "locationPasteInEditor": "请在位置编辑器中粘贴坐标对,默认顺序为经度、纬度;请确认坐标系并手动选择顺序,不会自动交换",
"location": "位置",
"locationName": "名称(可选)",
"latitude": "纬度",
@@ -62,7 +62,7 @@
"coordinateSystem": "坐标系",
"coordinateSystemUnknown": "未知",
"pasteCoordinates": "粘贴坐标",
- "coordinateOrderTip": "按纬度、经度顺序输入十进制度坐标,不会自动交换顺序",
+ "coordinateOrderTip": "按所选顺序读取坐标,默认为经度、纬度",
"invalidCoordinates": "请输入 -90 至 90 的有限纬度和 -180 至 180 的有限经度,或同时留空",
"invalidCoordinateSystem": "请选择支持的坐标系",
"coordinateSystemTip": "请选择坐标实际使用的坐标系;修改标记不会转换坐标",
diff --git a/app/appearance/langs/zh-TW.json b/app/appearance/langs/zh-TW.json
index af538cd7c2..31e5a4346a 100644
--- a/app/appearance/langs/zh-TW.json
+++ b/app/appearance/langs/zh-TW.json
@@ -54,7 +54,7 @@
"mapTooManyMarkers": "目前頁面的位置超過 ${limit} 個,請使用篩選或減少每頁記錄數以顯示地圖",
"defaultCoordinateSystem": "新輸入預設座標系",
"defaultCoordinateSystemTip": "僅用於新輸入;既有位置保持不變,不轉換座標",
- "locationPasteInEditor": "請在位置編輯器中貼上座標對,明確緯度、經度順序和座標系",
+ "locationPasteInEditor": "請在位置編輯器中貼上座標對,預設順序為經度、緯度;請確認座標系並手動選擇順序,不會自動交換",
"location": "位置",
"locationName": "名稱(選填)",
"latitude": "緯度",
@@ -62,7 +62,7 @@
"coordinateSystem": "座標系",
"coordinateSystemUnknown": "未知",
"pasteCoordinates": "貼上座標",
- "coordinateOrderTip": "依緯度、經度順序輸入十進位度數座標,不會自動交換順序",
+ "coordinateOrderTip": "依所選順序讀取座標,預設為經度、緯度",
"invalidCoordinates": "請輸入 -90 至 90 的有限緯度和 -180 至 180 的有限經度,或同時留空",
"invalidCoordinateSystem": "請選擇支援的座標系",
"coordinateSystemTip": "請選擇座標實際使用的座標系;修改標記不會轉換座標",
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 e754b72f18..22faa03744 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": "20261009101102"
+ "updated": "20261009112101"
},
"Children": [
{
@@ -74,7 +74,7 @@
"HeadingLevel": 2,
"Properties": {
"id": "20261009034010-6kd9rk5",
- "updated": "20261009101102"
+ "updated": "20261009112101"
},
"Children": [
{
@@ -88,12 +88,12 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20261009034010-0yhiv8g",
- "updated": "20261009101102"
+ "updated": "20261009111821"
},
"Children": [
{
"Type": "NodeText",
- "Data": "Add a field of type Location, then click a cell to edit its name and coordinates. The name is optional. Enter both latitude and longitude in decimal degrees. Latitude ranges from -90 to 90 and longitude from -180 to 180; zero is a valid value. Leave both coordinates blank to save only a name. In the field settings, Default coordinate system for new input only presets new input; existing locations stay unchanged, each value can choose its own coordinate system, and copied or imported locations retain their saved coordinate system. Existing locations without a labeled coordinate system are preserved as saved; when editing, explicitly select the coordinate system actually used by their coordinates. Coordinates are not converted automatically."
+ "Data": "Add a field of type Location, then click a cell to edit its name and coordinates. The name is optional. Enter both longitude and latitude in decimal degrees. Longitude ranges from -180 to 180 and latitude from -90 to 90; zero is a valid value. Leave both coordinates blank to save only a name. In the field settings, Default coordinate system for new input only presets new input; existing locations stay unchanged, each value can choose its own coordinate system, and copied or imported locations retain their saved coordinate system. Existing locations without a labeled coordinate system are preserved as saved; when editing, explicitly select the coordinate system actually used by their coordinates. Coordinates are not converted automatically."
}
]
},
@@ -102,12 +102,12 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20261009034010-h9vridq",
- "updated": "20261009101102"
+ "updated": "20261009111821"
},
"Children": [
{
"Type": "NodeText",
- "Data": "To import coordinates, enter a pair such as 39.9042, 116.4074 in Paste coordinates and click Confirm. The default Coordinate order is latitude, longitude; if the source uses longitude, latitude, switch the order manually. SiYuan does not infer the order. A coordinate pair may be enclosed in ASCII parentheses. Choose WGS84 (OpenFreeMap), GCJ-02 (AMap, Tencent Maps), or BD-09 (Baidu Maps) for the coordinate system; changing this label does not convert coordinates. Imported text is retained unchanged as source metadata. Manually changing the coordinates or coordinate system clears that source text."
+ "Data": "To import coordinates, enter a pair such as 116.4074, 39.9042 in Paste coordinates and click Confirm. The default Coordinate order is longitude, latitude; if the source uses latitude, longitude, manually select latitude, longitude. SiYuan reads coordinates in the selected order and never infers or swaps the order automatically. This input accepts coordinate pairs only. A coordinate pair may be enclosed in ASCII parentheses. Choose WGS84 (OpenFreeMap), GCJ-02 (AMap, Tencent Maps), or BD-09 (Baidu Maps) for the coordinate system; changing this label does not convert coordinates. Imported text is retained unchanged as source metadata. Manually changing the coordinates or coordinate system clears that source text."
}
]
},
@@ -116,12 +116,12 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20261009034010-dub50kq",
- "updated": "20261009040533"
+ "updated": "20261009112101"
},
"Children": [
{
"Type": "NodeText",
- "Data": "Click Save to apply edits or Cancel to discard them. Clear removes the location value. Text filters and sorting use the combined name, coordinates, and coordinate-system label. This field does not load maps or contact external location services."
+ "Data": "Click Save to apply edits or Cancel to discard them. Clear removes the location value. Text filters and sorting use the combined name, coordinates, and coordinate-system label. This field does not load maps or contact external location services. Coordinates are displayed in longitude, latitude order in the app. Plain-text copying and export keep latitude, longitude; to reuse those coordinates, paste only the pair into the location editor and explicitly select latitude, longitude. The complete copied or exported location text is not accepted as a coordinate pair. Structured database copying preserves named coordinate values. Named JSON fields and previously saved locations are unchanged."
},
{
"Type": "NodeText",
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 14f3c4f2ae..63c889249a 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": "20261009101102"
+ "updated": "20261009112101"
},
"Children": [
{
@@ -74,7 +74,7 @@
"HeadingLevel": 2,
"Properties": {
"id": "20261009034010-m7nwg3o",
- "updated": "20261009101102"
+ "updated": "20261009112101"
},
"Children": [
{
@@ -88,12 +88,12 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20261009034010-8ihp92l",
- "updated": "20261009101102"
+ "updated": "20261009111821"
},
"Children": [
{
"Type": "NodeText",
- "Data": "添加类型为「位置」的字段后,点击单元格编辑名称和坐标。名称可留空。纬度和经度须成对填写,使用十进制度数。纬度范围为 -90 到 90,经度范围为 -180 到 180,零是有效值。将两个坐标都留空时,可仅保存名称。字段设置中的「新录入默认坐标系」仅用于新录入的位置;已有位置保持不变,每个值仍可单独选择坐标系,复制或导入的位置保留其已保存的坐标系。已有未标注坐标系的位置按原值保留;编辑时需明确选择坐标实际使用的坐标系,不会自动转换坐标。"
+ "Data": "添加类型为「位置」的字段后,点击单元格编辑名称和坐标。名称可留空。经度和纬度须成对填写,使用十进制度数。经度范围为 -180 到 180,纬度范围为 -90 到 90,零是有效值。将两个坐标都留空时,可仅保存名称。字段设置中的「新录入默认坐标系」仅用于新录入的位置;已有位置保持不变,每个值仍可单独选择坐标系,复制或导入的位置保留其已保存的坐标系。已有未标注坐标系的位置按原值保留;编辑时需明确选择坐标实际使用的坐标系,不会自动转换坐标。"
}
]
},
@@ -102,12 +102,12 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20261009034010-grvs8hv",
- "updated": "20261009101102"
+ "updated": "20261009111821"
},
"Children": [
{
"Type": "NodeText",
- "Data": "导入坐标时,在「粘贴坐标」中输入 39.9042, 116.4074 这样的坐标对,再点击「确定」。「坐标顺序」默认为纬度、经度;若来源为经度、纬度,请手动切换,思源不会自动判断。坐标对可用英文括号包裹。坐标系可选择 WGS84(OpenFreeMap)、GCJ-02(高德、腾讯)或 BD-09(百度);修改此标记不会转换坐标。导入的原始文本会原样保留为来源信息,手动修改坐标或坐标系会清除该来源文本。"
+ "Data": "导入坐标时,在「粘贴坐标」中输入 116.4074, 39.9042 这样的坐标对,再点击「确定」。「坐标顺序」默认为经度、纬度;若来源为纬度、经度,请手动切换到该顺序。思源按所选顺序读取坐标,不会自动判断或交换顺序。此输入框仅接受坐标对。坐标对可用英文括号包裹。坐标系可选择 WGS84(OpenFreeMap)、GCJ-02(高德、腾讯)或 BD-09(百度);修改此标记不会转换坐标。导入的原始文本会原样保留为来源信息,手动修改坐标或坐标系会清除该来源文本。"
}
]
},
@@ -116,12 +116,12 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20261009034010-kag8uox",
- "updated": "20261009040533"
+ "updated": "20261009112101"
},
"Children": [
{
"Type": "NodeText",
- "Data": "点击「保存」应用修改,点击「取消」放弃修改,「清空」会移除位置值。文本过滤和排序使用名称、坐标及坐标系标记组合后的文本。此字段不加载地图,也不调用外部位置服务。"
+ "Data": "点击「保存」应用修改,点击「取消」放弃修改,「清空」会移除位置值。文本过滤和排序使用名称、坐标及坐标系标记组合后的文本。此字段不加载地图,也不调用外部位置服务。应用内按经度、纬度顺序显示坐标。纯文本复制和导出仍使用纬度、经度顺序;复用这些坐标时,请仅将坐标对粘贴到位置编辑器,并明确选择纬度、经度顺序。完整的复制或导出位置文本不能作为坐标对解析。数据库内的结构化复制保留经纬度各自的值,JSON 命名字段和已保存的位置均保持不变。"
},
{
"Type": "NodeText",
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 232a169d08..4d644507fd 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": "20261009101102"
+ "updated": "20261009112101"
},
"Children": [
{
@@ -74,7 +74,7 @@
"HeadingLevel": 2,
"Properties": {
"id": "20261009034010-5oq6h7a",
- "updated": "20261009101102"
+ "updated": "20261009112101"
},
"Children": [
{
@@ -88,12 +88,12 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20261009034010-m2e4n60",
- "updated": "20261009101102"
+ "updated": "20261009111821"
},
"Children": [
{
"Type": "NodeText",
- "Data": "新增類型為「位置」的欄位後,點擊儲存格編輯名稱和座標。名稱可留空。緯度和經度須成對填寫,使用十進位度數。緯度範圍為 -90 到 90,經度範圍為 -180 到 180,零是有效值。將兩個座標都留空時,可僅保存名稱。欄位設定中的「新輸入預設座標系」僅用於新輸入的位置;既有位置保持不變,每個值仍可單獨選擇座標系,複製或匯入的位置保留其已保存的座標系。既有未標註座標系的位置按原值保留;編輯時需明確選擇座標實際使用的座標系,不會自動轉換座標。"
+ "Data": "新增類型為「位置」的欄位後,點擊儲存格編輯名稱和座標。名稱可留空。經度和緯度須成對填寫,使用十進位度數。經度範圍為 -180 到 180,緯度範圍為 -90 到 90,零是有效值。將兩個座標都留空時,可僅保存名稱。欄位設定中的「新輸入預設座標系」僅用於新輸入的位置;既有位置保持不變,每個值仍可單獨選擇座標系,複製或匯入的位置保留其已保存的座標系。既有未標註座標系的位置按原值保留;編輯時需明確選擇座標實際使用的座標系,不會自動轉換座標。"
}
]
},
@@ -102,12 +102,12 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20261009034010-ue87c6m",
- "updated": "20261009101102"
+ "updated": "20261009111821"
},
"Children": [
{
"Type": "NodeText",
- "Data": "匯入座標時,在「貼上座標」中輸入 39.9042, 116.4074 這樣的座標對,再點擊「確定」。「座標順序」預設為緯度、經度;若來源為經度、緯度,請手動切換,思源不會自動判斷。座標對可用英文括號包裹。座標系可選擇 WGS84(OpenFreeMap)、GCJ-02(高德、騰訊)或 BD-09(百度);修改此標記不會轉換座標。匯入的原始文字會原樣保留為來源資訊,手動修改座標或座標系會清除該來源文字。"
+ "Data": "匯入座標時,在「貼上座標」中輸入 116.4074, 39.9042 這樣的座標對,再點擊「確定」。「座標順序」預設為經度、緯度;若來源為緯度、經度,請手動切換到該順序。思源依所選順序讀取座標,不會自動判斷或交換順序。此輸入框僅接受座標對。座標對可用英文括號包裹。座標系可選擇 WGS84(OpenFreeMap)、GCJ-02(高德、騰訊)或 BD-09(百度);修改此標記不會轉換座標。匯入的原始文字會原樣保留為來源資訊,手動修改座標或座標系會清除該來源文字。"
}
]
},
@@ -116,12 +116,12 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20261009034010-g7jsd2p",
- "updated": "20261009040533"
+ "updated": "20261009112101"
},
"Children": [
{
"Type": "NodeText",
- "Data": "點擊「保存」套用修改,點擊「取消」放棄修改,「清空」會移除位置值。文字過濾和排序使用名稱、座標及座標系標記組合後的文字。此欄位不載入地圖,也不呼叫外部位置服務。"
+ "Data": "點擊「保存」套用修改,點擊「取消」放棄修改,「清空」會移除位置值。文字過濾和排序使用名稱、座標及座標系標記組合後的文字。此欄位不載入地圖,也不呼叫外部位置服務。應用程式內依經度、緯度順序顯示座標。純文字複製和匯出仍使用緯度、經度順序;重用這些座標時,請僅將座標對貼到位置編輯器,並明確選擇緯度、經度順序。完整的複製或匯出位置文字不能作為座標對解析。資料庫內的結構化複製保留經緯度各自的值,JSON 具名欄位和已儲存的位置均保持不變。"
},
{
"Type": "NodeText",
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 2210efc5e6..9e4388fdec 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": "20261009101102"
+ "updated": "20261009112101"
},
"Children": [
{
@@ -75,7 +75,7 @@
"HeadingLevel": 2,
"Properties": {
"id": "20261009034010-6j4iniw",
- "updated": "20261009101102"
+ "updated": "20261009112101"
},
"Children": [
{
@@ -89,12 +89,12 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20261009034010-x0x9tob",
- "updated": "20261009101102"
+ "updated": "20261009111821"
},
"Children": [
{
"Type": "NodeText",
- "Data": "「位置」タイプのフィールドを追加し、セルをクリックして名前と座標を編集します。名前は省略できます。緯度と経度は十進数の度数で、必ず両方を指定します。緯度は -90 から 90、経度は -180 から 180 の範囲で、ゼロも有効な値です。両方の座標を空欄にすると、名前だけを保存できます。フィールド設定の「新規入力の既定の座標系」は新しく入力する位置にのみ適用され、既存の位置は変更されず、各値の座標系は個別に選択でき、コピーまたはインポートした位置では保存済みの座標系が維持されます。座標系が設定されていない既存の位置は保存された値のまま保持されます。編集時には座標が実際に使用している座標系を明示的に選択してください。座標は自動変換されません。"
+ "Data": "「位置」タイプのフィールドを追加し、セルをクリックして名前と座標を編集します。名前は省略できます。経度と緯度は十進数の度数で、必ず両方を指定します。経度は -180 から 180、緯度は -90 から 90 の範囲で、ゼロも有効な値です。両方の座標を空欄にすると、名前だけを保存できます。フィールド設定の「新規入力の既定の座標系」は新しく入力する位置にのみ適用され、既存の位置は変更されず、各値の座標系は個別に選択でき、コピーまたはインポートした位置では保存済みの座標系が維持されます。座標系が設定されていない既存の位置は保存された値のまま保持されます。編集時には座標が実際に使用している座標系を明示的に選択してください。座標は自動変換されません。"
}
]
},
@@ -103,12 +103,12 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20261009034010-1609sdo",
- "updated": "20261009101102"
+ "updated": "20261009111821"
},
"Children": [
{
"Type": "NodeText",
- "Data": "座標を取り込むには、「座標を貼り付け」に 39.9042, 116.4074 のような座標の組を入力し、「確認」をクリックします。「座標の順序」の既定値は緯度、経度です。元データが経度、緯度の順の場合は手動で切り替えてください。SiYuan は順序を自動判定しません。座標の組を半角括弧で囲むこともできます。座標系には WGS84(OpenFreeMap)、GCJ-02(AMap、Tencent Maps)、BD-09(Baidu Maps)を選択できますが、このラベルを変更しても座標は変換されません。取り込んだ元のテキストは出典情報としてそのまま保持されます。座標または座標系を手動で変更すると、この出典テキストは消去されます。"
+ "Data": "座標を取り込むには、「座標を貼り付け」に 116.4074, 39.9042 のような座標の組を入力し、「確認」をクリックします。「座標の順序」の既定値は経度、緯度です。元データが緯度、経度の順の場合は、手動でその順序に切り替えてください。SiYuan は選択した順序で座標を読み取り、順序を自動判定したり入れ替えたりしません。この入力欄は座標の組のみを受け付けます。座標の組を半角括弧で囲むこともできます。座標系には WGS84(OpenFreeMap)、GCJ-02(AMap、Tencent Maps)、BD-09(Baidu Maps)を選択できますが、このラベルを変更しても座標は変換されません。取り込んだ元のテキストは出典情報としてそのまま保持されます。座標または座標系を手動で変更すると、この出典テキストは消去されます。"
}
]
},
@@ -117,12 +117,12 @@
"Type": "NodeParagraph",
"Properties": {
"id": "20261009034010-fry67po",
- "updated": "20261009040533"
+ "updated": "20261009112101"
},
"Children": [
{
"Type": "NodeText",
- "Data": "「保存」で変更を適用し、「キャンセル」で変更を破棄します。「消去」は位置の値を削除します。テキストのフィルターとソートには、名前、座標、座標系のラベルを組み合わせたテキストを使用します。このフィールドは地図を読み込まず、外部の位置情報サービスにも接続しません。"
+ "Data": "「保存」で変更を適用し、「キャンセル」で変更を破棄します。「消去」は位置の値を削除します。テキストのフィルターとソートには、名前、座標、座標系のラベルを組み合わせたテキストを使用します。このフィールドは地図を読み込まず、外部の位置情報サービスにも接続しません。アプリ内では経度、緯度の順に座標を表示します。プレーンテキストのコピーとエクスポートでは緯度、経度の順序を維持します。これらの座標を再利用するには、座標の組だけを位置エディターに貼り付け、緯度、経度の順序を明示的に選択してください。コピーまたはエクスポートした位置テキスト全体は、座標の組として解析できません。データベース内の構造化されたコピーでは、経度と緯度それぞれの値を保持します。JSON の名前付きフィールドと保存済みの位置は変更されません。"
},
{
"Type": "NodeText",
diff --git a/app/src/block/popover.ts b/app/src/block/popover.ts
index 1470e5c3d7..bf9139c3d5 100644
--- a/app/src/block/popover.ts
+++ b/app/src/block/popover.ts
@@ -210,9 +210,9 @@ export const initBlockPopover = (app: App) => {
const desc = aElement.getAttribute("data-desc");
if (textElement.scrollWidth > textElement.clientWidth + 0.5 || desc) {
if (desc) {
- tip = `${getCellText(aElement)}<div class='ft__on-surface'>${escapeAriaLabel(desc)}</div>`;
+ tip = `${getCellText(aElement, "display")}<div class='ft__on-surface'>${escapeAriaLabel(desc)}</div>`;
} else {
- tip = getCellText(aElement);
+ tip = getCellText(aElement, "display");
}
}
} else {
@@ -229,7 +229,7 @@ export const initBlockPopover = (app: App) => {
!hasClosestByClassName(event.target, "block__icon")) {
aElement.style.overflow = "auto";
if (hasAVCellContentOverflow(aElement, richTextElement)) {
- tip = escapeHtmlTextAndAttr(getCellText(aElement));
+ tip = escapeHtmlTextAndAttr(getCellText(aElement, "display"));
}
aElement.style.overflow = "";
}
@@ -257,7 +257,7 @@ export const initBlockPopover = (app: App) => {
if (cellElement && (cellElement.clientWidth + 0.5 < cellElement.scrollWidth ||
(textElement && textElement.clientWidth + 0.5 < textElement.scrollWidth))) {
tip = escapeHtmlTextAndAttr(cellElement.querySelector(".b3-menu__label")?.textContent ||
- getCellText(cellElement));
+ getCellText(cellElement, "display"));
tooltipTarget = cellElement;
tooltipPositionOverride = "north";
}
diff --git a/app/src/protyle/render/av/attributeValue.ts b/app/src/protyle/render/av/attributeValue.ts
index 8350ffc7bf..b0a6c161ab 100644
--- a/app/src/protyle/render/av/attributeValue.ts
+++ b/app/src/protyle/render/av/attributeValue.ts
@@ -13,7 +13,7 @@ import {
import {getAVColorStyle} from "./color";
import {getHostCapabilities} from "../../../util/hostCapabilities";
import {getAVRichTextPreviewHTML, getAVTextSource} from "./richText";
-import {getAVLocationText} from "./locationValue";
+import {getAVLocationDisplayText} from "./locationValue";
export {createEmptyAVValue} from "./cellValue";
@@ -94,7 +94,7 @@ const genAVRollupHTML = (value: IAVCellValue) => {
html = escapeHtml(value.text.content);
break;
case "location":
- html = escapeHtml(getAVLocationText(value.location));
+ html = escapeHtml(getAVLocationDisplayText(value.location));
break;
case "number":
html = value.number.formattedContent || value.number.content.toString();
@@ -150,7 +150,7 @@ export const genAVValueHTML = (value: IAVCellValue, dateFormat: TAVDateFormat =
break;
}
case "location":
- html = `<div class="av__celltext fn__flex-1" data-cell-value="${escapeAttr(encodeURIComponent(JSON.stringify(cloneAVCellValueSnapshot(value))))}" placeholder="${window.siyuan.languages.empty}">${escapeHtml(getAVLocationText(value.location))}</div>`;
+ html = `<div class="av__celltext fn__flex-1" data-cell-value="${escapeAttr(encodeURIComponent(JSON.stringify(cloneAVCellValueSnapshot(value))))}" placeholder="${window.siyuan.languages.empty}">${escapeHtml(getAVLocationDisplayText(value.location))}</div>`;
break;
case "number":
html = `<span class="av__celltext" data-content="${value.number.isNotEmpty ? value.number.content : ""}" placeholder="${window.siyuan.languages.empty}">${value.number.formattedContent || (value.number.isNotEmpty ? value.number.content : "")}</span>`;
diff --git a/app/src/protyle/render/av/cell.ts b/app/src/protyle/render/av/cell.ts
index ef5fc35af4..29c9fd6aaa 100644
--- a/app/src/protyle/render/av/cell.ts
+++ b/app/src/protyle/render/av/cell.ts
@@ -64,7 +64,7 @@ import {getAVData, getAVPrimaryCell} from "./virtualScroll";
import {AV_CELL_EDITOR_CLOSE_EVENT, getAVCellEditorOwner} from "./cellEditor";
import {getAVBlockIconHTML, renderAVBlockIcon} from "./blockIcon";
import {bindAVCellInputPosition} from "./cellInputPosition";
-import {createAVLocationFromText, createAVLocationReplacement, getAVLocationText, isAVLocationCoordinateInput, isAVLocationEmpty} from "./locationValue";
+import {createAVLocationFromText, createAVLocationReplacement, getAVLocationDisplayText, getAVLocationText, isAVLocationCoordinateInput, isAVLocationEmpty} from "./locationValue";
import {openAVLocationEditor} from "./locationEditor";
import {showMessage} from "../../../dialog/message";
@@ -194,10 +194,16 @@ const getStoredCellValueByElement = (cellElement: HTMLElement) => {
}
};
-export const getCellText = (cellElement: HTMLElement | false) => {
+export const getCellText = (cellElement: HTMLElement | false, purpose: "copy" | "display" = "copy") => {
if (!cellElement) {
return "";
}
+ const formatLocation = purpose === "display" ? getAVLocationDisplayText : getAVLocationText;
+ const ownValue = cellElement.dataset?.cellValue && cellElement.matches(".av__celltext") ?
+ getStoredCellValueByElement(cellElement) : undefined;
+ if (ownValue?.type === "location" && !cellElement.matches(".av__celltext--template")) {
+ return formatLocation(ownValue.location);
+ }
const richTextElement = cellElement.matches(".av__celltext--rich[data-cell-value]") ? cellElement :
cellElement.querySelector<HTMLElement>(".av__celltext--rich[data-cell-value]");
const storedCellValue = richTextElement ? getStoredCellValueByElement(richTextElement) : undefined;
@@ -208,7 +214,10 @@ export const getCellText = (cellElement: HTMLElement | false) => {
const textElements = cellElement.querySelectorAll(".b3-chip, .av__celltext--ref, .av__celltext");
if (textElements.length > 0) {
textElements.forEach(item => {
- if (item.querySelector(".av__cellicon")) {
+ const storedValue = (item as HTMLElement).dataset?.cellValue ? getStoredCellValueByElement(item as HTMLElement) : undefined;
+ if (storedValue?.type === "location" && !item.matches(".av__celltext--template")) {
+ cellText += formatLocation(storedValue.location) + ", ";
+ } else if (item.querySelector(".av__cellicon")) {
cellText += `${item.firstChild.textContent} → ${item.lastChild.textContent}, `;
} else if (item.getAttribute("data-type") === "url") {
cellText = item.getAttribute("data-href") + ", ";
@@ -1479,7 +1488,7 @@ export const renderCell = (cellValue: IAVCellValue, rowIndex = 0, showIcon = tru
text = `<span class="av__celltext">${cellValue ? escapeHtmlTextAndAttr(cellValue.text.content || "") : ""}</span>`;
}
} else if (cellValue.type === "location") {
- text = `<span class="av__celltext" data-cell-value="${escapeAttr(encodeURIComponent(JSON.stringify(cloneAVCellValueSnapshot(cellValue))))}">${escapeHtmlTextAndAttr(getAVLocationText(cellValue.location))}</span>`;
+ text = `<span class="av__celltext" data-cell-value="${escapeAttr(encodeURIComponent(JSON.stringify(cloneAVCellValueSnapshot(cellValue))))}">${escapeHtmlTextAndAttr(getAVLocationDisplayText(cellValue.location))}</span>`;
} else if ((cellValue.type === "email" || cellValue.type === "phone")) {
text = `<span class="av__celltext av__celltext--url" data-type="${cellValue.type}">${cellValue ? escapeHtmlTextAndAttr(cellValue[cellValue.type as "email"].content || "") : ""}</span>`;
} else if ("url" === cellValue.type) {
@@ -1583,6 +1592,9 @@ export const renderCell = (cellValue: IAVCellValue, rowIndex = 0, showIcon = tru
};
export const getCellValueText = (value: IAVCellValue, column?: IAVColumn, rowIndex = 0) => {
+ if (value.type === "location" && !hasAVRenderTemplateResult(value, column?.renderTemplate)) {
+ return getAVLocationText(value.location);
+ }
if (value.type === "text" && !hasAVRenderTemplateResult(value, column?.renderTemplate) &&
getAVTextSource(value).kind === "rich") {
return getAVTextCopyContent(value);
diff --git a/app/src/protyle/render/av/fieldValueEditor.ts b/app/src/protyle/render/av/fieldValueEditor.ts
index 65ad86468b..5422c6966d 100644
--- a/app/src/protyle/render/av/fieldValueEditor.ts
+++ b/app/src/protyle/render/av/fieldValueEditor.ts
@@ -11,7 +11,7 @@ import {getFileTreeIconHTML} from "../../../emoji/fileTreeIcon";
import {renderAVBlockIcon} from "./blockIcon";
import {formatDateValue} from "./dateFormat";
import {bindLunarDateEditor, getLunarDateHTML} from "./lunarDate";
-import {createAVLocationReplacement, getAVLocationText} from "./locationValue";
+import {createAVLocationReplacement, getAVLocationDisplayText} from "./locationValue";
import {openAVLocationEditor} from "./locationEditor";
export const getSelectedOptionNames = (element: HTMLElement) => {
@@ -138,7 +138,7 @@ export const getValueInputHTML = (column: IAVColumn, fieldValue?: IAVNewItemFiel
if (column.type === "location") {
const location = value ? value.location || {coordinateSystem: "unknown"} :
{coordinateSystem: column.location?.defaultCoordinateSystem || "unknown"};
- return `<button type="button" class="b3-button b3-button--cancel fn__flex-1" data-role="field-value" data-value-type="location" data-location="${escapeAttr(encodeURIComponent(JSON.stringify(location)))}">${escapeHtml(getAVLocationText(location) || window.siyuan.languages.empty)}</button>`;
+ return `<button type="button" class="b3-button b3-button--cancel fn__flex-1" data-role="field-value" data-value-type="location" data-location="${escapeAttr(encodeURIComponent(JSON.stringify(location)))}">${escapeHtml(getAVLocationDisplayText(location) || window.siyuan.languages.empty)}</button>`;
}
if (column.type === "checkbox") {
const checked = value?.checkbox?.checked || false;
@@ -200,7 +200,7 @@ export const openFieldLocationEditor = (target: HTMLElement) => {
return;
}
target.dataset.location = encodeURIComponent(JSON.stringify(value));
- target.textContent = getAVLocationText(value) || window.siyuan.languages.empty;
+ target.textContent = getAVLocationDisplayText(value) || window.siyuan.languages.empty;
target.dispatchEvent(new Event("change", {bubbles: true}));
},
});
diff --git a/app/src/protyle/render/av/locationEditor.test.ts b/app/src/protyle/render/av/locationEditor.test.ts
index e9eb71b2a1..3c3ca703e6 100644
--- a/app/src/protyle/render/av/locationEditor.test.ts
+++ b/app/src/protyle/render/av/locationEditor.test.ts
@@ -142,8 +142,11 @@ describe("database location editor", () => {
const editor = createEditor({mobile});
assert.equal((editor.markup.match(/<div class="b3-label b3-label--inner(?: fn__flex)?">/g) || []).length, 5);
assert.doesNotMatch(editor.markup, /<label class="b3-label/);
- assert.match(editor.markup, /<div class="b3-label b3-label--inner fn__flex">\s*<label class="fn__flex-1">latitude/);
- assert.match(editor.markup, /<label class="fn__flex-1">longitude/);
+ assert.match(editor.markup, /<div class="b3-label b3-label--inner fn__flex">\s*<label class="fn__flex-1">longitude/);
+ assert.match(editor.markup, /<label class="fn__flex-1">latitude/);
+ assert.equal(editor.fields.coordinateOrder.value, "longitudeLatitude");
+ assert.match(editor.markup, /<option value="longitudeLatitude">longitude, latitude<\/option>\s*<option value="latitudeLongitude">latitude, longitude<\/option>/);
+ assert.match(editor.markup, /class="b3-label__text">coordinateOrderTip/);
assert.match(editor.markup, /data-field="paste"[^>]*><\/textarea>\s*<\/label>\s*<\/div>\s*<button[^>]*data-action="parse"/);
}
});
@@ -167,33 +170,83 @@ describe("database location editor", () => {
assert.equal(editor.saved[0].longitude, value.longitude);
});
- it("parses parenthesized longitude-first input only after explicit order selection", async () => {
+ it("defaults to longitude-first imports on desktop and mobile without guessing", async () => {
+ for (const mobile of [false, true]) {
+ for (const [source, latitude, longitude] of [["(102.42,25.04)", 25.04, 102.42], ["20,30", 30, 20]] as const) {
+ const editor = createEditor({mobile});
+ editor.fields.paste.value = source;
+ editor.buttons.parse.dispatch("click");
+ editor.buttons.parse.dispatch("click");
+ assert.equal(editor.fields.latitude.value, String(latitude));
+ assert.equal(editor.fields.longitude.value, String(longitude));
+ editor.buttons.save.dispatch("click");
+ await editor.settle();
+ assert.deepEqual(editor.saved[0], {name: "", latitude, longitude, coordinateSystem: "wgs84", originalInput: source});
+ }
+ }
+ });
+
+ it("keeps latitude-first input as an explicit choice without automatic swapping", async () => {
const editor = createEditor();
- editor.fields.paste.value = "(102.42,25.04)";
+ editor.fields.paste.value = "25.04,102.42";
editor.buttons.parse.dispatch("click");
assert.equal(editor.error.textContent, "invalidCoordinates");
- assert.equal(editor.fields.paste.focused, true);
+ assert.equal(editor.fields.paste.value, "25.04,102.42");
assert.equal(editor.fields.latitude.value, "");
- editor.fields.coordinateOrder.value = "longitudeLatitude";
+ editor.fields.coordinateOrder.value = "latitudeLongitude";
editor.fields.coordinateOrder.dispatch("change");
editor.buttons.parse.dispatch("click");
assert.equal(editor.fields.latitude.value, "25.04");
assert.equal(editor.fields.longitude.value, "102.42");
editor.buttons.save.dispatch("click");
await editor.settle();
- assert.equal(editor.saved[0].originalInput, "(102.42,25.04)");
+ assert.equal(editor.saved[0].originalInput, "25.04,102.42");
+ });
+
+ it("does not reinterpret saved source text under the new default order on reopen", async () => {
+ for (const mobile of [false, true]) {
+ for (const coordinateSystem of ["wgs84", "gcj02", "bd09"] as const) {
+ const value = {latitude: 20, longitude: 30, originalInput: "20,30", coordinateSystem};
+ const editor = createEditor({value, mobile});
+ editor.buttons.parse.dispatch("click");
+ editor.buttons.parse.dispatch("click");
+ assert.equal(editor.fields.latitude.value, "20");
+ assert.equal(editor.fields.longitude.value, "30");
+ assert.equal(editor.fields.paste.value, value.originalInput);
+ editor.buttons.save.dispatch("click");
+ await editor.settle();
+ assert.deepEqual(editor.saved, []);
+ }
+ }
+ });
+
+ it("rejects copied canonical text instead of interpreting it with the new default order", async () => {
+ for (const name of [undefined, "Office"]) {
+ const editor = createEditor({value: {latitude: 10, longitude: 40}});
+ const copied = locationValue.getAVLocationText({name, latitude: 20, longitude: 30, coordinateSystem: "wgs84"});
+ editor.fields.paste.value = copied;
+ editor.buttons.parse.dispatch("click");
+ assert.equal(editor.error.textContent, "invalidCoordinates");
+ assert.equal(editor.fields.paste.value, copied);
+ assert.equal(editor.fields.latitude.value, "10");
+ assert.equal(editor.fields.longitude.value, "40");
+ editor.buttons.save.dispatch("click");
+ await editor.settle();
+ assert.deepEqual(editor.saved, []);
+ }
});
it("changing import order requires confirmation without changing existing coordinates", async () => {
- const editor = createEditor({value: {latitude: 20, longitude: 30, originalInput: "20,30"}});
- editor.fields.coordinateOrder.value = "longitudeLatitude";
+ const editor = createEditor({value: {latitude: 30, longitude: 20, originalInput: "20,30"}});
+ editor.fields.coordinateOrder.value = "latitudeLongitude";
editor.fields.coordinateOrder.dispatch("change");
editor.buttons.save.dispatch("click");
await editor.settle();
assert.equal(editor.saved.length, 0);
- assert.equal(editor.fields.latitude.value, "20");
- editor.buttons.parse.dispatch("click");
assert.equal(editor.fields.latitude.value, "30");
+ editor.buttons.parse.dispatch("click");
+ assert.equal(editor.fields.latitude.value, "20");
+ assert.equal(editor.fields.longitude.value, "30");
});
it("does not create overlapping editors on repeated open events", () => {
@@ -240,6 +293,31 @@ describe("database location editor", () => {
assert.equal(editor.lifecycle.includes("destroy"), false);
});
+ it("saves valid manual coordinate fields with an explicit CRS on desktop and mobile", async () => {
+ for (const mobile of [false, true]) {
+ for (const coordinateSystem of ["wgs84", "gcj02", "bd09"] as const) {
+ for (const shortcut of [false, true]) {
+ const editor = createEditor({mobile, unspecifiedSystem: true});
+ editor.fields.longitude.value = "102.42";
+ editor.fields.longitude.dispatch("input");
+ editor.fields.latitude.value = "25.04";
+ editor.fields.latitude.dispatch("input");
+ editor.fields.coordinateSystem.value = coordinateSystem;
+ editor.fields.coordinateSystem.dispatch("change");
+ if (shortcut) {
+ editor.key("Enter", {ctrlKey: true});
+ } else {
+ editor.buttons.save.dispatch("click");
+ }
+ await editor.settle();
+ assert.equal(editor.error.textContent, "");
+ assert.deepEqual(editor.saved, [{name: "", latitude: 25.04, longitude: 102.42, coordinateSystem, originalInput: ""}]);
+ assert.equal(editor.lifecycle.includes("destroy"), true);
+ }
+ }
+ }
+ });
+
it("preserves exact provenance when only the name changes", async () => {
const initial = {name: "Old", latitude: 0, longitude: 0, originalInput: " 0.00, +0 "};
const editor = createEditor({value: initial});
@@ -266,10 +344,10 @@ describe("database location editor", () => {
it("keeps failed imports and existing coordinates untouched, then saves an exact re-paste", async () => {
const editor = createEditor({value: {latitude: 0, longitude: 0, originalInput: "0,0"}});
- editor.fields.paste.value = "121,31";
+ editor.fields.paste.value = "31,121";
editor.buttons.parse.dispatch("click");
assert.equal(editor.error.textContent, "invalidCoordinates");
- assert.equal(editor.fields.paste.value, "121,31");
+ assert.equal(editor.fields.paste.value, "31,121");
assert.equal(editor.fields.latitude.value, "0");
assert.equal(editor.fields.longitude.value, "0");
editor.buttons.save.dispatch("click");
diff --git a/app/src/protyle/render/av/locationEditor.ts b/app/src/protyle/render/av/locationEditor.ts
index f8f13371a6..cdb8b6229b 100644
--- a/app/src/protyle/render/av/locationEditor.ts
+++ b/app/src/protyle/render/av/locationEditor.ts
@@ -52,13 +52,13 @@ export const openAVLocationEditor = (options: AVLocationEditorOptions) => {
</label>
</div>
<div class="b3-label b3-label--inner fn__flex">
- <label class="fn__flex-1">${escapeHtml(languages.latitude)}
- <span class="fn__hr"></span><input class="b3-text-field fn__block" data-field="latitude" type="text" inputmode="decimal" spellcheck="false">
- </label>
- <div class="fn__space"></div>
<label class="fn__flex-1">${escapeHtml(languages.longitude)}
<span class="fn__hr"></span><input class="b3-text-field fn__block" data-field="longitude" type="text" inputmode="decimal" spellcheck="false">
</label>
+ <div class="fn__space"></div>
+ <label class="fn__flex-1">${escapeHtml(languages.latitude)}
+ <span class="fn__hr"></span><input class="b3-text-field fn__block" data-field="latitude" type="text" inputmode="decimal" spellcheck="false">
+ </label>
</div>
<div class="b3-label b3-label--inner">
<label>${escapeHtml(languages.coordinateSystem)}
@@ -74,10 +74,11 @@ export const openAVLocationEditor = (options: AVLocationEditorOptions) => {
<div class="b3-label b3-label--inner">
<label>${escapeHtml(languages.coordinateOrder)}
<span class="fn__hr"></span><select class="b3-select fn__block" data-field="coordinateOrder">
- <option value="latitudeLongitude">${escapeHtml(languages.latitude)}, ${escapeHtml(languages.longitude)}</option>
<option value="longitudeLatitude">${escapeHtml(languages.longitude)}, ${escapeHtml(languages.latitude)}</option>
+ <option value="latitudeLongitude">${escapeHtml(languages.latitude)}, ${escapeHtml(languages.longitude)}</option>
</select>
</label>
+ <div class="b3-label__text">${escapeHtml(languages.coordinateOrderTip)}</div>
</div>
<div class="b3-label b3-label--inner">
<label>${escapeHtml(languages.pasteCoordinates)}
@@ -108,7 +109,7 @@ export const openAVLocationEditor = (options: AVLocationEditorOptions) => {
const longitudeInput = root.querySelector<HTMLInputElement>('[data-field="longitude"]');
const systemInput = root.querySelector<HTMLSelectElement>('[data-field="coordinateSystem"]');
const orderInput = root.querySelector<HTMLSelectElement>('[data-field="coordinateOrder"]');
- orderInput.value = "latitudeLongitude";
+ orderInput.value = "longitudeLatitude";
const pasteInput = root.querySelector<HTMLTextAreaElement>('[data-field="paste"]');
const errorElement = root.querySelector<HTMLElement>('[data-role="error"]');
const controls = root.querySelectorAll<HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement | HTMLButtonElement>(
@@ -266,6 +267,11 @@ export const openAVLocationEditor = (options: AVLocationEditorOptions) => {
systemInput.focus();
return;
}
+ // 已确认的来源文本不按新默认顺序重新解释;修改文本或切换顺序后才重新导入。
+ if (pasteInput.value.trim() && pasteInput.value === parsedInput) {
+ setError();
+ return;
+ }
const parsed = parsePaste();
if (!parsed) {
setError(languages.invalidCoordinates);
diff --git a/app/src/protyle/render/av/locationIntegration.test.ts b/app/src/protyle/render/av/locationIntegration.test.ts
index 92a1cf3556..90f6059008 100644
--- a/app/src/protyle/render/av/locationIntegration.test.ts
+++ b/app/src/protyle/render/av/locationIntegration.test.ts
@@ -35,13 +35,13 @@ const loadModule = <T>(file: string, extra: Record<string, unknown> = {}) => {
const cell = loadModule<typeof import("./cell")>("cell");
-test("location cells render the same escaped canonical value in all layouts and row attributes", () => {
+test("location cells display longitude first in every layout, row attributes and rollups", () => {
const value: IAVCellValue = {type: "location", location: {
name: "<Home>", latitude: 0, longitude: 180, coordinateSystem: "wgs84", originalInput: "untrusted raw",
}};
- for (const type of ["table", "list", "gallery", "kanban"] as TAVView[]) {
+ for (const type of ["table", "list", "gallery", "kanban", "map"] as TAVView[]) {
const html = cell.renderCell(value, 0, false, type);
- assert.match(html, /&lt;Home&gt;; 0, 180 \[WGS84\]/);
+ assert.match(html, /&lt;Home&gt;; 180, 0 \[WGS84\]/);
assert.doesNotMatch(html, /<Home>/);
const data = /data-cell-value="([^"]+)"/.exec(html)?.[1];
assert.deepEqual(JSON.parse(decodeURIComponent(data)), value);
@@ -49,10 +49,62 @@ test("location cells render the same escaped canonical value in all layouts and
}
const attr = loadModule<typeof import("./attributeValue")>("attributeValue");
const html = attr.genAVValueHTML(value);
- assert.match(html, /&lt;Home>; 0, 180 \[WGS84\]/);
+ assert.match(html, /&lt;Home>; 180, 0 \[WGS84\]/);
assert.match(html, /data-cell-value=/);
const rollupHTML = cell.renderCell({type: "rollup", rollup: {contents: [value]}}, 0, false, "table");
- assert.match(rollupHTML, /0, 180 \[WGS84\]/);
+ assert.match(rollupHTML, /180, 0 \[WGS84\]/);
+});
+
+test("location copies preserve canonical text for cells, nested leaves and templates", () => {
+ const first: IAVCellValue = {type: "location", location: {latitude: 20, longitude: 30, coordinateSystem: "wgs84"}};
+ const second: IAVCellValue = {type: "location", location: {name: "Other", latitude: 40, longitude: 50, coordinateSystem: "gcj02"}};
+ const makeLeaf = (value?: IAVCellValue, template = false) => ({
+ dataset: value ? {cellValue: encodeURIComponent(JSON.stringify(value))} : {},
+ textContent: template ? "Custom display" : value ? locationValue.getAVLocationDisplayText(value.location) : "Ordinary text",
+ matches: (selector: string) => selector === ".av__celltext" && !!value || template && selector === ".av__celltext--template",
+ querySelector: (): HTMLElement => null,
+ querySelectorAll: (): HTMLElement[] => [],
+ getAttribute: (): string => null,
+ });
+ const firstLeaf = makeLeaf(first);
+ const secondLeaf = makeLeaf(second);
+ const wrapper = (leaves: ReturnType<typeof makeLeaf>[]) => ({
+ ...makeLeaf(), querySelectorAll: () => leaves,
+ }) as unknown as HTMLElement;
+ assert.equal(cell.getCellText(firstLeaf as unknown as HTMLElement), "20, 30 [WGS84]");
+ assert.equal(cell.getCellText(wrapper([firstLeaf])), "20, 30 [WGS84]");
+ assert.equal(cell.getCellText(wrapper([firstLeaf, makeLeaf(), secondLeaf])), "20, 30 [WGS84], Ordinary text, Other; 40, 50 [GCJ-02]");
+ assert.equal(cell.getCellText(firstLeaf as unknown as HTMLElement, "display"), "30, 20 [WGS84]");
+ assert.equal(cell.getCellText(wrapper([firstLeaf, makeLeaf(), secondLeaf]), "display"), "30, 20 [WGS84], Ordinary text, Other; 50, 40 [GCJ-02]");
+ assert.equal(cell.getCellText(makeLeaf(first, true) as unknown as HTMLElement), "Custom display");
+ assert.equal(cell.getCellText(wrapper([makeLeaf(first, true)])), "Custom display");
+ assert.equal(cell.getCellText(wrapper([makeLeaf(first, true)]), "display"), "Custom display");
+ const attributeTemplate = {...makeLeaf(), dataset: firstLeaf.dataset, textContent: "Custom display"} as unknown as HTMLElement;
+ assert.equal(cell.getCellText(attributeTemplate), "Custom display");
+ assert.equal(cell.getCellText(attributeTemplate, "display"), "Custom display");
+ assert.equal(cell.getCellValueText(first), "20, 30 [WGS84]");
+ assert.equal(locationValue.parseAVLocationCoordinates(cell.getCellValueText(first), "wgs84", "longitudeLatitude"), undefined);
+ assert.throws(() => cell.genCellValue("location", cell.getCellValueText(first)));
+});
+
+test("location hover text explicitly uses display order instead of clipboard order", () => {
+ const source = readFileSync("src/block/popover.ts", "utf8");
+ assert.doesNotMatch(source, /getCellText\((?:aElement|cellElement)\)/);
+ assert.match(source, /escapeHtmlTextAndAttr\(getCellText\(aElement, "display"\)\)/);
+ assert.match(source, /getCellText\(cellElement, "display"\)/);
+});
+
+test("selected location copies keep structured values and latitude-first TSV independent of display", () => {
+ const value: IAVCellValue = {type: "location", location: {
+ name: "Office", latitude: 20, longitude: 30, coordinateSystem: "wgs84", originalInput: "20,30",
+ }};
+ const selected = [{rowID: "row", rowIndex: 0, cell: {value}, column: {type: "location"}},
+ {rowID: "row", rowIndex: 0, cell: {value}, column: {type: "location"}}] as import("./selectionState").IAVSelectedCell[];
+ const copied = cell.getAVCellData(selected);
+ assert.equal(copied.text, "Office; 20, 30 [WGS84]\tOffice; 20, 30 [WGS84]");
+ assert.deepEqual(JSON.parse(JSON.stringify(copied.json[0])), [value, value]);
+ assert.notEqual(copied.json[0][0].location, value.location);
+ assert.deepEqual(cell.genCellValue("location", copied.json[0][0].location).location, value.location);
});
test("location generic paste keeps place names and rejects coordinates without guessing", () => {
@@ -108,7 +160,7 @@ test("location update, clear, structured paste and undo send full replacement pa
"../../../dialog/message": {showMessage: (message: string) => warnings.push(message)},
});
const block = {dataset: {avId: "av", nodeId: "block"}, getAttribute: () => "table"} as unknown as HTMLElement;
- const oldLocation: IAVCellLocationValue = {name: "Old", latitude: 0, longitude: 0, coordinateSystem: "wgs84", originalInput: "0,0"};
+ const oldLocation: IAVCellLocationValue = {name: "Old", latitude: 20, longitude: 30, coordinateSystem: "wgs84", originalInput: "20,30"};
const selected = (location?: IAVCellLocationValue): import("./selectionState").IAVSelectedCell[] => [{
rowID: "row", colID: "key", groupID: "", colIndex: 0, rowIndex: 0,
cell: {id: "value", color: "", bgColor: "", valueType: "location", value: {type: "location", location}},
@@ -136,6 +188,12 @@ test("location update, clear, structured paste and undo send full replacement pa
assert.deepEqual(JSON.parse(JSON.stringify(undo.data.location)), oldLocation);
}
const fromEmpty = await update({type: "location", location: oldLocation}, {});
+ const pasted = fromEmpty.doOperations[0];
+ if (pasted.action === "updateAttrViewCell") {
+ assert.deepEqual(JSON.parse(JSON.stringify(pasted.data.location)), oldLocation);
+ } else {
+ assert.fail("expected structured location paste");
+ }
const undo = fromEmpty.undoOperations[0];
assert.equal(undo.action, "updateAttrViewCell");
if (undo.action === "updateAttrViewCell") {
@@ -154,7 +212,7 @@ test("template and automation value buttons preserve the structured location unt
const column = {type: "location"} as IAVColumn;
const html = editor.getValueInputHTML(column, {mode: "static", value: {type: "location", location}});
assert.match(html, /data-value-type="location"/);
- assert.match(html, /-90, -180 \[GCJ-02\]/);
+ assert.match(html, /-180, -90 \[GCJ-02\]/);
const input = {dataset: {location: encodeURIComponent(JSON.stringify(location))}} as unknown as HTMLElement;
assert.deepEqual(JSON.parse(JSON.stringify(editor.genFieldValue(column, input))), {
type: "location", location: locationValue.createAVLocationReplacement(location),
diff --git a/app/src/protyle/render/av/locationValue.test.ts b/app/src/protyle/render/av/locationValue.test.ts
index 2e3b4e1208..e44479678a 100644
--- a/app/src/protyle/render/av/locationValue.test.ts
+++ b/app/src/protyle/render/av/locationValue.test.ts
@@ -5,6 +5,7 @@ import {
createAVLocationFromText,
createAVLocationReplacement,
formatAVLocationCoordinate,
+ getAVLocationDisplayText,
getAVLocationText,
isAVLocationCoordinateInput,
isAVLocationEmpty,
@@ -102,6 +103,21 @@ describe("database location values", () => {
assert.equal(formatAVLocationCoordinate(-0), "0");
});
+ it("displays longitude first while preserving canonical text, named fields and provenance", () => {
+ assert.equal(getAVLocationDisplayText(), "");
+ assert.equal(getAVLocationDisplayText({name: " Office "}), "Office");
+ for (const system of ["unknown", "wgs84", "gcj02", "bd09"] as const) {
+ const location = {name: "Office", latitude: 20, longitude: 30, coordinateSystem: system, originalInput: "20,30"};
+ const before = {...location};
+ const label = {unknown: "unknown", wgs84: "WGS84", gcj02: "GCJ-02", bd09: "BD-09"}[system];
+ assert.equal(getAVLocationDisplayText(location), `Office; 30, 20 [${label}]`);
+ assert.equal(getAVLocationText(location), `Office; 20, 30 [${label}]`);
+ assert.deepEqual(location, before);
+ assert.equal(parseAVLocationCoordinates(getAVLocationText(location), system, "longitudeLatitude"), undefined);
+ }
+ assert.equal(getAVLocationDisplayText({latitude: 1e-7, longitude: -1e-8}), "-0.00000001, 0.0000001 [unknown]");
+ });
+
it("excludes provenance from emptiness, display, and semantic equality", () => {
const sourceOnly = {originalInput: "private imported source", coordinateSystem: "wgs84" as const};
assert.equal(isAVLocationEmpty(sourceOnly), true);
diff --git a/app/src/protyle/render/av/locationValue.ts b/app/src/protyle/render/av/locationValue.ts
index a09f2c7ee2..ca5952b1f8 100644
--- a/app/src/protyle/render/av/locationValue.ts
+++ b/app/src/protyle/render/av/locationValue.ts
@@ -50,16 +50,23 @@ export const formatAVLocationCoordinate = (value: number) => {
return (negative ? "-" : "") + expanded;
};
-export const getAVLocationText = (location?: IAVCellLocationValue) => {
+const formatAVLocationText = (location?: IAVCellLocationValue, longitudeFirst = false) => {
const name = location?.name?.trim() || "";
if (!hasAVLocationCoordinates(location)) {
return name;
}
const system = location.coordinateSystem || "unknown";
const label = {unknown: "unknown", wgs84: "WGS84", gcj02: "GCJ-02", bd09: "BD-09"}[system] || "unknown";
- return `${name ? name + "; " : ""}${formatAVLocationCoordinate(location.latitude)}, ${formatAVLocationCoordinate(location.longitude)} [${label}]`;
+ const coordinates = longitudeFirst ? [location.longitude, location.latitude] : [location.latitude, location.longitude];
+ return `${name ? name + "; " : ""}${coordinates.map(formatAVLocationCoordinate).join(", ")} [${label}]`;
};
+// 复制、类型转换和内核导出保持既有的纬度、经度文本契约。
+export const getAVLocationText = (location?: IAVCellLocationValue) => formatAVLocationText(location);
+
+// 界面与编辑器统一按经度、纬度显示,不改变持久化值或文本交换格式。
+export const getAVLocationDisplayText = (location?: IAVCellLocationValue) => formatAVLocationText(location, true);
+
// 事务按字段合并,删除旧坐标或来源时必须显式发送空值。
export const createAVLocationReplacement = (location?: IAVCellLocationValue): IAVCellLocationValue => ({
name: location?.name?.trim() || "",
diff --git a/kernel/api/av_contract_mapping.go b/kernel/api/av_contract_mapping.go
index bd2e6c0eaa..aeb88d9d2b 100644
--- a/kernel/api/av_contract_mapping.go
+++ b/kernel/api/av_contract_mapping.go
@@ -139,6 +139,7 @@ func toContractAVValue(value *av.Value) *apicontract.AVValue {
URL: toContractAVValueURL(value.URL),
Email: toContractAVValueEmail(value.Email),
Phone: toContractAVValuePhone(value.Phone),
+ Location: toContractAVValueLocation(value.Location),
MAsset: avContractSlice(value.MAsset, func(value *av.ValueAsset) *apicontract.AVValueAsset { return toContractAVValueAsset(value) }),
Template: toContractAVValueTemplate(value.Template),
Created: toContractAVValueCreated(value.Created),
@@ -170,6 +171,7 @@ func fromContractAVValue(value *apicontract.AVValue) *av.Value {
URL: fromContractAVValueURL(value.URL),
Email: fromContractAVValueEmail(value.Email),
Phone: fromContractAVValuePhone(value.Phone),
+ Location: fromContractAVValueLocation(value.Location),
MAsset: avContractSlice(value.MAsset, func(value *apicontract.AVValueAsset) *av.ValueAsset { return fromContractAVValueAsset(value) }),
Template: fromContractAVValueTemplate(value.Template),
Created: fromContractAVValueCreated(value.Created),
@@ -639,6 +641,7 @@ func toContractAVKey(value *av.Key) *apicontract.AVKey {
Relation: toContractAVRelation(value.Relation),
Rollup: toContractAVRollup(value.Rollup),
Date: toContractAVDate(value.Date),
+ Location: toContractAVLocation(value.Location),
Created: toContractAVCreated(value.Created),
Updated: toContractAVUpdated(value.Updated),
}
@@ -761,6 +764,7 @@ func toContractAVBaseInstanceField(value *av.BaseInstanceField) *apicontract.AVB
Relation: toContractAVRelation(value.Relation),
Rollup: toContractAVRollup(value.Rollup),
Date: toContractAVDate(value.Date),
+ Location: toContractAVLocation(value.Location),
Created: toContractAVCreated(value.Created),
Updated: toContractAVUpdated(value.Updated),
}
@@ -1349,3 +1353,30 @@ func toContractAVItemConditionalColors(value *av.ItemConditionalColors) *apicont
}
return result
}
+
+func toContractAVValueLocation(value *av.ValueLocation) *apicontract.AVValueLocation {
+ if value == nil {
+ return nil
+ }
+ return &apicontract.AVValueLocation{
+ Name: value.Name, Latitude: value.Latitude, Longitude: value.Longitude,
+ CoordinateSystem: value.CoordinateSystem, OriginalInput: value.OriginalInput,
+ }
+}
+
+func fromContractAVValueLocation(value *apicontract.AVValueLocation) *av.ValueLocation {
+ if value == nil {
+ return nil
+ }
+ return &av.ValueLocation{
+ Name: value.Name, Latitude: value.Latitude, Longitude: value.Longitude,
+ CoordinateSystem: value.CoordinateSystem, OriginalInput: value.OriginalInput,
+ }
+}
+
+func toContractAVLocation(value *av.Location) *apicontract.AVLocation {
+ if value == nil {
+ return nil
+ }
+ return &apicontract.AVLocation{DefaultCoordinateSystem: value.DefaultCoordinateSystem}
+}
diff --git a/kernel/api/contract_av_location_mapping_test.go b/kernel/api/contract_av_location_mapping_test.go
new file mode 100644
index 0000000000..3925c03275
--- /dev/null
+++ b/kernel/api/contract_av_location_mapping_test.go
@@ -0,0 +1,48 @@
+package api
+
+import (
+ "testing"
+
+ "github.com/siyuan-note/siyuan/kernel/av"
+)
+
+func TestAVContractLocationTransportMapping(t *testing.T) {
+ zero, longitude := 0.0, 102.42
+ for _, location := range []*av.ValueLocation{nil, {}, {Name: "Office"}, {
+ Name: "Office", Latitude: &zero, Longitude: &longitude,
+ CoordinateSystem: "gcj02", OriginalInput: "(102.42,0)",
+ }, {Latitude: &zero, Longitude: &zero, CoordinateSystem: "unknown"}} {
+ value := &av.Value{ID: "value", KeyID: "location", BlockID: "item", Type: av.KeyTypeLocation, Location: location}
+ t.Run(value.String(false), func(t *testing.T) {
+ assertAVContractJSONEqual(t, value, toContractAVValue(value))
+ assertAVContractJSONEqual(t, value, fromContractAVValue(toContractAVValue(value)))
+ for _, nested := range []*av.Value{
+ {Type: av.KeyTypeRelation, Relation: &av.ValueRelation{Contents: []*av.Value{value}}},
+ {Type: av.KeyTypeRollup, Rollup: &av.ValueRollup{Contents: []*av.Value{value}}},
+ } {
+ assertAVContractJSONEqual(t, nested, toContractAVValue(nested))
+ assertAVContractJSONEqual(t, nested, fromContractAVValue(toContractAVValue(nested)))
+ }
+ })
+ }
+}
+
+func TestAVContractLocationFieldAndRenderMapping(t *testing.T) {
+ zero, longitude := 0.0, 102.42
+ for _, system := range []string{"", "unknown", "wgs84", "gcj02", "bd09"} {
+ location := &av.Location{DefaultCoordinateSystem: system}
+ key := &av.Key{ID: "location", Type: av.KeyTypeLocation, Location: location}
+ field := &av.BaseInstanceField{ID: key.ID, Type: key.Type, Location: location}
+ value := &av.Value{Type: av.KeyTypeLocation, Location: &av.ValueLocation{
+ Latitude: &zero, Longitude: &longitude, CoordinateSystem: system, OriginalInput: "(102.42,0)",
+ }}
+ assertAVContractJSONEqual(t, key, toContractAVKey(key))
+ assertAVContractJSONEqual(t, field, toContractAVBaseInstanceField(field))
+ table := &av.Table{BaseInstance: &av.BaseInstance{ID: "view"},
+ Columns: []*av.TableColumn{{BaseInstanceField: field}},
+ Rows: []*av.TableRow{{ID: "item", Cells: []*av.TableCell{{BaseValue: &av.BaseValue{Value: value, ValueType: key.Type}}}}}}
+ for _, view := range []av.Viewable{table, &av.List{Table: table}, &av.Map{Table: table}} {
+ assertAVContractJSONEqual(t, view, avContractView(view))
+ }
+ }
+}
diff --git a/kernel/api/contract_av_location_save_test.go b/kernel/api/contract_av_location_save_test.go
new file mode 100644
index 0000000000..e9ee7156cb
--- /dev/null
+++ b/kernel/api/contract_av_location_save_test.go
@@ -0,0 +1,137 @@
+package api
+
+import (
+ "net/http"
+ "testing"
+
+ "github.com/88250/lute/ast"
+ "github.com/siyuan-note/siyuan/kernel/av"
+ "github.com/siyuan-note/siyuan/kernel/cache"
+ "github.com/siyuan-note/siyuan/kernel/model"
+)
+
+func TestAVContractLocationSaveAndRender(t *testing.T) {
+ fixture := setupAttributeViewContextFilterAPITest(t)
+ database, view := fixture.attrView, fixture.attrView.Views[0]
+ primary := database.GetBlockKeyValues()
+ key := av.NewKey(ast.NewNodeID(), "Location", "", av.KeyTypeLocation)
+ key.Location = &av.Location{DefaultCoordinateSystem: "gcj02"}
+ coordinatesID, nameID, emptyID, unknownID := ast.NewNodeID(), ast.NewNodeID(), ast.NewNodeID(), ast.NewNodeID()
+ view.ItemIDs = []string{coordinatesID, nameID, emptyID, unknownID}
+ for _, id := range view.ItemIDs {
+ primary.Values = append(primary.Values, &av.Value{ID: ast.NewNodeID(), KeyID: primary.Key.ID, BlockID: id,
+ Type: av.KeyTypeBlock, IsDetached: true, Block: &av.ValueBlock{Content: id}})
+ }
+ database.KeyValues = []*av.KeyValues{primary, {Key: key, Values: []*av.Value{
+ {ID: ast.NewNodeID(), KeyID: key.ID, BlockID: emptyID, Type: av.KeyTypeLocation, Location: &av.ValueLocation{}},
+ {ID: ast.NewNodeID(), KeyID: key.ID, BlockID: unknownID, Type: av.KeyTypeLocation,
+ Location: &av.ValueLocation{CoordinateSystem: "unknown"}},
+ }}}
+ view.Table.Columns = []*av.ViewTableColumn{
+ {BaseField: &av.BaseField{ID: primary.Key.ID}},
+ {BaseField: &av.BaseField{ID: key.ID}},
+ }
+ if err := av.SaveAttributeView(database); err != nil {
+ t.Fatal(err)
+ }
+
+ render := func() *av.Table {
+ t.Helper()
+ const path = "/api/av/renderAttributeView"
+ response := callAttributeViewContextFilterAPI(t, path, map[string]any{
+ "id": database.ID, "viewID": view.ID, "createIfNotExist": false,
+ }, renderAttributeView)
+ requireAPIContract(t, http.MethodPost, path, response)
+ var result struct {
+ Code int
+ Data struct{ View *av.Table }
+ }
+ decodeAttributeViewContextFilterAPIResponse(t, response, &result)
+ if result.Code != 0 || result.Data.View == nil || len(result.Data.View.Rows) != len(view.ItemIDs) {
+ t.Fatalf("location render failed: %s", response.Body.String())
+ }
+ for _, column := range result.Data.View.Columns {
+ if column.ID == key.ID {
+ if column.Location == nil || column.Location.DefaultCoordinateSystem != "gcj02" {
+ t.Fatalf("location column default was lost: %+v", column.Location)
+ }
+ return result.Data.View
+ }
+ }
+ t.Fatal("location column was not rendered")
+ return nil
+ }
+ assertLocation := func(value *av.Value, want *av.ValueLocation) {
+ t.Helper()
+ if value == nil || value.Type != av.KeyTypeLocation || value.Location == nil {
+ t.Fatalf("location payload was lost: %+v", value)
+ }
+ assertAVContractJSONEqual(t, want, value.Location)
+ }
+ assertEmptyValues := func(table *av.Table) {
+ t.Helper()
+ assertLocation(table.GetValue(emptyID, key.ID), &av.ValueLocation{})
+ assertLocation(table.GetValue(unknownID, key.ID), &av.ValueLocation{CoordinateSystem: "unknown"})
+ }
+
+ // 只给缺少持久化值的单元格应用默认坐标系,已存空值及显式未知值保持原意。
+ table := render()
+ for _, id := range []string{coordinatesID, nameID} {
+ assertLocation(table.GetValue(id, key.ID), &av.ValueLocation{CoordinateSystem: "gcj02"})
+ }
+ assertEmptyValues(table)
+ cache.ClearAVCache()
+ stored, err := av.ParseAttributeView(database.ID)
+ if err != nil {
+ t.Fatal(err)
+ }
+ for _, id := range []string{coordinatesID, nameID} {
+ if stored.GetValue(key.ID, id) != nil {
+ t.Fatal("rendering persisted a missing location value")
+ }
+ }
+
+ // 再次渲染后保存新位置,验证渲染操作不影响持久化。
+ render()
+ zero, longitude := 0.0, 102.42
+ saves := []struct {
+ itemID string
+ location *av.ValueLocation
+ }{
+ {coordinatesID, &av.ValueLocation{Name: "Office", Latitude: &zero, Longitude: &longitude,
+ CoordinateSystem: "gcj02", OriginalInput: "(102.42,0)"}},
+ {nameID, &av.ValueLocation{Name: "Home", CoordinateSystem: "gcj02", OriginalInput: "Home"}},
+ }
+ for _, save := range saves {
+ value, updateErr := model.UpdateAttributeViewCell(nil, database.ID, key.ID, save.itemID,
+ &av.Value{Type: av.KeyTypeLocation, Location: save.location})
+ if updateErr != nil {
+ t.Fatal(updateErr)
+ }
+ assertLocation(value, save.location)
+ if value.IsRenderAutoFill {
+ t.Fatal("saved location retained its render-only marker")
+ }
+ }
+
+ // 清除缓存后重新读取文件,确认保存后的坐标、名称和来源都进入持久化数据及 HTTP 响应。
+ cache.ClearAVCache()
+ stored, err = av.ParseAttributeView(database.ID)
+ if err != nil {
+ t.Fatal(err)
+ }
+ for _, save := range saves {
+ value := stored.GetValue(key.ID, save.itemID)
+ assertLocation(value, save.location)
+ if value.IsRenderAutoFill {
+ t.Fatal("persisted location retained its render-only marker")
+ }
+ }
+ assertLocation(stored.GetValue(key.ID, emptyID), &av.ValueLocation{})
+ assertLocation(stored.GetValue(key.ID, unknownID), &av.ValueLocation{CoordinateSystem: "unknown"})
+ table = render()
+ for _, save := range saves {
+ assertLocation(table.GetValue(save.itemID, key.ID), save.location)
+ }
+ assertEmptyValues(table)
+}
diff --git a/kernel/apicontract/av_types.go b/kernel/apicontract/av_types.go
index 1f4a6dcf4a..45ef594fad 100644
--- a/kernel/apicontract/av_types.go
+++ b/kernel/apicontract/av_types.go
@@ -149,7 +149,8 @@ type AVValuePhone struct {
}
// AVValueLocation 保存单个位置的原始坐标,不执行坐标系转换。
-// API 使用具名成员;界面、粘贴和文本导出统一为“纬度, 经度”,不接受无标签的坐标数组。
+// API 使用具名成员,不接受无标签的坐标数组。
+// 界面按经度、纬度显示,坐标对粘贴默认经度在前且可显式切换;规范文本复制与导出保留纬度、经度顺序。
// 纬度和经度必须同时为空或同时提供,范围分别为 [-90,90] 和 [-180,180],零是有效坐标。
// 更新时省略成员保留原值,显式 null 同时清空两个坐标;名称可以独立存在。
// 坐标系省略或为空时按 unknown 处理,不推断 WGS84;其他非枚举值会被拒绝。