Add the news report model, markers and source

The pure half of a news layer: validated records for a news server's
`/api/news/hotspots|feed|outline` contract, a presentation model and canvas
markers and picture cards, and a fetch client.

- Colour carries severity only (0 no physical event, 1 minor, 2 significant,
  3 major), never a side; the category is the icon, the rim is attestation
  (confirmed, a claim, one side's own press), size grows with sources and
  markers fade with age.
- Cards say "Reported by {side} sources" and mark official channels; a
  machine-read English headline is labelled as such.
- `createNewsSource` reads same-origin routes with a 15 s timeout, a 4 MiB cap
  and record-by-record validation; `NEWS_API_PATHS` and `newsQueryAllowed`
  let a host proxy exactly what the client sends. A 503 marked unavailable
  means "not configured": no retries.
- Exported as `./layers/news/source`, with its own package boundary.
This commit is contained in:
Denis Groshev committed 2026-11-06 00:45:22 +01:00
1 parent dd83812a21
commit 2d9d518946
21 files changed
+2653

No files matched your search

+51
View File
@@ -1,4 +1,55 @@
{
"News feed unavailable": "新聞來源無法使用",
"Disputed: {name}": "爭議地區:{name}",
"Administered by {holder} · claimed by {claimant}": "由{holder}管轄 · {claimant}主張主權",
"Self-administered · claimed by {claimant}": "自治 · {claimant}主張主權",
"UN-patrolled zone": "聯合國巡邏區",
"Claimed by neither neighbour": "兩個鄰國均未主張",
"Video": "影片",
"Photos": "照片",
"Claimed by {who}": "{who}聲稱",
"Claimed": "聲稱",
"Not yet confirmed by others": "尚未獲他方證實",
"Reported by {side} sources": "{side}方來源報導",
"Reported by {sides}": "報導來源:{sides}",
"{side} sources": "{side}方來源",
"Official": "官方",
"Reported by both sides": "雙方均有報導",
"Independently reported": "有獨立來源報導",
"Single source": "單一來源",
"International": "國際",
"Independent": "獨立",
"Unattributed": "未註明來源",
"Outside party": "外部方",
"Ukraine–Russia": "烏克蘭–俄羅斯",
"Israel–Gaza–Lebanon": "以色列–加薩–黎巴嫩",
"Iran–Hormuz": "伊朗–荷莫茲",
"Yemen–Red Sea": "葉門–紅海",
"Sudan": "蘇丹",
"Sahel": "薩赫爾",
"Elsewhere": "其他地區",
"Strike": "打擊",
"Alert": "警報",
"Air defence": "防空",
"Ground fighting": "地面戰鬥",
"Casualties": "傷亡",
"Humanitarian": "人道",
"Disaster": "災害",
"Protest": "抗議",
"Political": "政治",
"No physical event": "無實際事件",
"Minor incident": "輕微事件",
"Significant": "重大",
"Major": "嚴重",
"age|now": "剛剛",
"{minutes} min": "{minutes} 分鐘",
"{hours} h": "{hours} 小時",
"{count} sources": {
"other": "{count} 個來源"
},
"News feed not configured on this server": "此伺服器未設定新聞來源",
"Malformed news hotspots response": "新聞熱點回應格式錯誤",
"Malformed news feed response": "新聞來源回應格式錯誤",
"Pick a shape, then click the map.": "先選擇形狀,再在地圖上點擊。",
"Enter to place the pin, Esc to cancel.": "按 Enter 放置圖釘,按 Esc 取消。",
"Click where the pin goes.": "點擊圖釘的放置位置。",