shell: the Store view and install screen as framework React components, strings in the framework catalogs

Moved from wayBetter for X so every wayBetter app gets the Store UI; the app passes its native
bridge, theme adapter, translator and (optionally) its own controls and button classes.

- storeModel.ts: wire types of the native store commands (InstallPreview, StoreCatalogView,
  LinkEvent, StoreItem with `apps`), permission badges in the site's words, categories, item state
  (install/installed/update/changed locally/built in), search, free theme ids, versions, previews.
- installController.ts: the install screen's state machine (links incl. those queued before the
  shell listened, dropped files, store items, cancel, confirm), generic over the app's theme format
  (`ThemeAdapter`: parse, ids, facts, save) and its bridge (`StoreBackend`: invoke/listen).
- InstallDialog.tsx (`InstallHost`): the screen (Install enabled after 1 s, Enter never installs,
  tabs hidden via setOverlay) and the window-wide drop target. StoreView.tsx: search, kinds,
  categories, cards, permission badges, install/update/remove; default controls or the app's.
- store.css: both, themed with framework `--wb-*` tokens (documented; dark defaults).
- storeMessages.ts + every framework catalog: 120 `wb.store.*`, `wb.install.*`, `wb.permission.*`
  messages moved from the app catalogs with all existing translations; the six that named X take
  `{site}`; generic words the components need copied with their translations.
- npm package: exports for the new modules and store.css, optional react/react-dom peers; @types
  for the typecheck. Tests: models, controller flows with a fake bridge, every looked-up key exists.
This commit is contained in:
CRTkafa 2026-09-29 11:08:04 +07:00
parent d65cc08070
commit f1588c3acd
63 changed files with 7345 additions and 53 deletions

View file

@ -23,6 +23,126 @@
"wb.update.installingLabel": "正在更新…",
"wb.update.installingTitle": "正在安裝 {product} {version}",
"wb.update.problemLabel": "更新問題",
"wb.update.problemTitle": "上次更新未正確啟動。請下載目前版本。"
"wb.update.problemTitle": "上次更新未正確啟動。請下載目前版本。",
"wb.permission.storage.label": "儲存空間",
"wb.permission.storage.detail": "在此應用程式中保存自己的設定(api.storage)。",
"wb.permission.ui.label": "對話方塊",
"wb.permission.ui.detail": "顯示對話方塊、提示和通知(api.ui、api.toast)。",
"wb.permission.clipboard.label": "剪貼簿",
"wb.permission.clipboard.detail": "將文字複製到你的剪貼簿(api.copyText)。",
"wb.permission.account.label": "你的帳號",
"wb.permission.account.detail": "讀取目前登入的 {site} 帳號:帳號代碼、名稱、大頭貼(api.account)。",
"wb.permission.commands.label": "指令",
"wb.permission.commands.detail": "在指令面板(Ctrl+K)中新增可在此頁面執行的指令(api.commands)。",
"wb.permission.users.label": "帳號詳細資料",
"wb.permission.users.detail": "讀取 {site} 自身回應中關於帳號的資訊:是否已認證、是否追蹤你(api.users)。",
"wb.permission.network.label": "網際網路",
"wb.permission.network.detail": "聲明會連線到網際網路上的伺服器。",
"wb.permission.networkNone.label": "無網路",
"wb.permission.networkNone.detail": "聲明從不連線到伺服器;安裝檢查在其程式碼中未發現網路呼叫。",
"wb.permission.legacy.label": "舊版 · 完整頁面存取",
"wb.permission.legacy.detail": "沒有 @permissions 行:它會取得完整的外掛程式 API,就像有權限機制之前的外掛程式一樣。",
"wb.permission.none.label": "沒有特殊存取權",
"wb.permission.none.detail": "僅有基本頁面輔助功能(CSS、DOM、路由、按鍵、主題)。",
"wb.permission.unknown": "未知的權限。",
"wb.store.category.reading": "閱讀",
"wb.store.category.writing": "寫作",
"wb.store.category.filters": "篩選",
"wb.store.category.focus": "專注",
"wb.store.category.tools": "工具",
"wb.store.category.dark": "深色",
"wb.store.category.light": "淺色",
"wb.store.builtIn": "內建",
"wb.store.use": "使用",
"wb.store.install": "安裝",
"wb.store.updateTo": "更新至 {version}",
"wb.store.modifiedTitle": "已安裝的檔案與商店的不同(已編輯,或來自其他地方)。商店不會動它。",
"wb.store.modified": "已在本機變更",
"wb.store.replace": "取代",
"wb.store.installed": "已安裝",
"wb.store.installedVersion": "已安裝 · v{version}",
"wb.store.offline": "{when}的離線副本:{error}",
"wb.store.unreachableShort": "無法連線到商店",
"wb.store.verified": "已驗證簽署的目錄 · 更新於 {when}",
"wb.store.intro": "來自 wayBetter 商店的主題和外掛程式。目錄經過簽署;wayBetter 會先檢查簽章和每個下載項目的 SHA-256,才會顯示安裝畫面。外掛程式會列出它們要求的權限。",
"wb.store.search": "搜尋商店",
"wb.store.searchPlaceholder": "搜尋主題和外掛程式",
"wb.store.kind": "類型",
"wb.store.themes": "主題",
"wb.store.checking": "檢查中…",
"wb.store.refresh": "重新整理",
"wb.store.categories": "分類",
"wb.store.everything": "全部",
"wb.store.updates": "有 {count, plural, other {# 個更新}}可用",
"wb.store.unreachable": "無法連線到商店",
"wb.store.tryAgain": "再試一次",
"wb.store.noCatalog": "尚無目錄。",
"wb.store.nothingChanged": "沒有安裝或變更任何內容。",
"wb.store.noMatch": "沒有符合的項目",
"wb.store.noMatchHint": "試試其他關鍵字或分類。",
"wb.store.plugin": "外掛程式",
"wb.store.by": "作者:{author}",
"wb.store.permissions": "權限",
"wb.store.themeNow": "{name} 現在是你的主題。",
"wb.store.foot": "有主題或外掛程式檔案嗎?把它拖曳到 wayBetter 視窗上,或開啟來自 waybetter.fyi 的 waybetter://install 連結。你一定會先看到這個安裝畫面。",
"wb.install.lines": "{count, plural, other {# 行}}",
"wb.install.moreLines": "再顯示 {count, plural, other {# 行}}",
"wb.install.reinstall": "重新安裝",
"wb.install.update": "更新",
"wb.install.eyebrow.install": "{kind, select, plugin {安裝外掛程式} theme {安裝主題} other {安裝}}",
"wb.install.eyebrow.update": "{kind, select, plugin {更新外掛程式} theme {更新主題} other {更新}}",
"wb.install.eyebrow.reinstall": "{kind, select, plugin {重新安裝外掛程式} theme {重新安裝主題} other {重新安裝}}",
"wb.install.noAuthor": "未提供作者或版本",
"wb.install.verified": "已驗證",
"wb.install.installedNow": "目前已安裝",
"wb.install.identical": "v{version}(相同)",
"wb.install.on": "於",
"wb.install.replaces": "將取代",
"wb.install.replacesValue": "你的這個主題副本",
"wb.install.copyHash": "複製 SHA-256",
"wb.install.permissions": "它宣告的權限",
"wb.install.pageAccess": "外掛程式會在 {site} 內以與頁面相同的存取權限執行:它們可以讀取 {site} 顯示給你的內容並在其中執行操作。權限限制的是 wayBetter API 提供給外掛程式的內容,而非頁面。請只安裝你信任的程式碼。",
"wb.install.theCode": "程式碼",
"wb.install.themeCss": "主題 CSS(會像你的自訂 CSS 一樣在 {site} 中執行)",
"wb.install.code": "將安裝的程式碼",
"wb.install.staysOn": "它會保持開啟",
"wb.install.turnOn": "立即開啟",
"wb.install.useNow": "立即使用",
"wb.install.installing": "安裝中…",
"wb.install.done": "{name} 已安裝",
"wb.install.done.pluginOn": "它現在已在你的 {site} 分頁中執行。你隨時可以在「外掛程式」中將它關閉。",
"wb.install.done.pluginOff": "它目前是關閉的。需要時請在「外掛程式」中開啟。",
"wb.install.done.themeOn": "它現在是你的主題。你隨時可以在「外觀」中切換回去。",
"wb.install.done.themeOff": "它已加入「外觀」中的主題。",
"wb.install.done.fonts": "它指定了 Google 字型({fonts})。「外觀」可以幫你下載;在此之前會使用它的備用字型。",
"wb.install.openPlugins": "開啟外掛程式",
"wb.install.openAppearance": "開啟外觀",
"wb.install.doneButton": "完成",
"wb.install.drop": "放開以安裝",
"wb.install.dropHint": "主題 (.json) 或外掛程式 (.plugin.js)。在安裝任何內容之前,你會先看到它是什麼。",
"wb.install.err.theme": "無法安裝此主題",
"wb.install.stage.link": "{kind, select, plugin {從 {host} 安裝外掛程式} theme {從 {host} 安裝主題} other {從 {host} 安裝}}",
"wb.install.stage.linkDetail": "正在下載並檢查…",
"wb.install.err.kind": "「{file}」不是主題或外掛程式",
"wb.install.err.kindHint": "wayBetter 會安裝主題 (.json) 和外掛程式 (.plugin.js)。若要將檔案附加到貼文,請改為拖曳到 {site} 的發文框。",
"wb.install.err.large": "「{file}」太大",
"wb.install.err.largeHint": "{kind, select, theme {主題上限為 2 MB。} other {外掛程式上限為 2 MB。}}",
"wb.install.stage.named": "安裝 {name}",
"wb.install.stage.fileDetail": "正在檢查檔案…",
"wb.install.stage.storeDetail": "正在從 wayBetter 商店下載並檢查其簽章…",
"wb.install.err.link": "無法使用這個安裝連結",
"wb.install.err.notInstalled": "{kind, select, theme {主題未安裝} other {外掛程式未安裝}}",
"wb.install.untitled": "無標題",
"wb.install.file": "檔案",
"wb.install.size": "大小",
"wb.install.themeFile": "主題檔案",
"wb.store.all": "全部",
"wb.store.pluginsTab": "外掛程式",
"wb.store.theme": "主題",
"wb.store.remove": "移除",
"wb.store.keep": "保留",
"wb.store.removed": "已移除 {name}。",
"wb.install.cancel": "取消",
"wb.install.close": "關閉"
}
}