@seanyeh77/ui 0.38.0 → 0.40.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle.js +3 -3
- package/dist/bundle.js.map +1 -1
- package/dist/{format-entry-DEIDX9E5.js → format-entry-C7iBqN3J.js} +4 -1
- package/dist/format-entry-C7iBqN3J.js.map +1 -0
- package/dist/format.js +1 -1
- package/dist/index.d.ts +57 -6
- package/dist/index.js +157 -22
- package/dist/index.js.map +1 -1
- package/dist/styles.css +152 -3
- package/docs/ConsoleLayout.md +31 -0
- package/docs/LineChart.md +1 -0
- package/docs/Tag.md +1 -1
- package/docs/ZoneMap.md +1 -0
- package/docs/guidelines.md +2 -0
- package/package.json +2 -2
- package/dist/format-entry-DEIDX9E5.js.map +0 -1
|
@@ -51,6 +51,9 @@ const I18N = {
|
|
|
51
51
|
回到現在: "Back to now",
|
|
52
52
|
回放: "Replay",
|
|
53
53
|
停止回放: "Stop replay",
|
|
54
|
+
全螢幕: "Full screen",
|
|
55
|
+
離開全螢幕: "Exit full screen",
|
|
56
|
+
側欄: "Side panel",
|
|
54
57
|
時間控制: "Time control",
|
|
55
58
|
沒有事件: "No events",
|
|
56
59
|
人工: "Manual",
|
|
@@ -568,4 +571,4 @@ const sameDay = (a, b) => !!a && !!b && a.getFullYear() === b.getFullYear() && a
|
|
|
568
571
|
const dayAdd = (d, n) => new Date(d.getFullYear(), d.getMonth(), d.getDate() + n);
|
|
569
572
|
export { parseDate as a, addMessages as c, unitFor as d, format as i, setLocale as l, fileSize as n, sameDay as o, fmtDate as r, I18N as s, dayAdd as t, tr as u };
|
|
570
573
|
|
|
571
|
-
//# sourceMappingURL=format-entry-
|
|
574
|
+
//# sourceMappingURL=format-entry-C7iBqN3J.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-entry-C7iBqN3J.js","names":[],"sources":["../src/i18n.ts","../src/format.ts"],"sourcesContent":["/* ---------- i18n and formats ----------\n Every built-in string is the zh-TW text passed through tr(); other languages come from UI.addMessages().\n Dates and numbers go through UI.format, which uses Intl for the current locale. The zh-TW rules are the\n ones the design system chose; other locales use their own conventions from Intl. */\ninterface I18nState {\n locale: string;\n currency: string;\n messages: Record<string, Record<string, string>>;\n}\n\nexport const I18N: I18nState = {\n locale: 'zh-TW',\n currency: 'TWD',\n messages: {\n en: {\n 'Email 或帳號': 'Email or username',\n '{label}:{a} 到 {b}': '{label}: {a} to {b}',\n '{n} 個百分點': '{n} pts',\n 上一頁: 'Previous page',\n 上個月: 'Previous month',\n '上傳失敗,請再試一次。': 'Upload failed. Try again.',\n 下一頁: 'Next page',\n 下個月: 'Next month',\n 主要導覽: 'Main navigation',\n 主題: 'Theme',\n 今天: 'Today',\n 全選: 'Select all',\n 全部: 'All',\n 全部標為已讀: 'Mark all as read',\n '共 {n} 筆': '{n} items',\n 分頁: 'Pagination',\n 刪除: 'Delete',\n 危險操作: 'Danger zone',\n 取消選取: 'Clear selection',\n '可以直接輸入,例如 2026/11/14': 'Type a date, e.g. 2026/11/14',\n 回上一頁: 'Go back',\n 回首頁: 'Go home',\n '完成 ✓': 'Done ✓',\n 密碼: 'Password',\n 展開側邊欄: 'Expand sidebar',\n '已選 {n} 筆': '{n} selected',\n 帳號: 'Username',\n 強調色: 'Accent color',\n '忘記密碼?': 'Forgot password?',\n 找不到符合的選項: 'No matching options',\n '拖放檔案,或 ': 'Drop files here, or ',\n 搜尋: 'Search',\n 操作: 'Actions',\n 收合側邊欄: 'Collapse sidebar',\n 釘選側邊欄: 'Pin sidebar',\n 取消釘選: 'Unpin sidebar',\n 放棄: 'Discard',\n '放棄未儲存的變更?': 'Discard unsaved changes?',\n '{label}?': '{label}?',\n '{name} 上傳進度': 'Upload progress of {name}',\n 左右方向鍵查看每一項的數值: 'Use ← and → to read each value',\n 左右方向鍵查看每一個時間點的數值: 'Use ← and → to read each point',\n 左右方向鍵移動播放頭: 'Use ← and → to move the playhead',\n 現在: 'Now',\n 預測: 'Forecast',\n 回到現在: 'Back to now',\n 回放: 'Replay',\n 停止回放: 'Stop replay',\n 全螢幕: 'Full screen',\n 離開全螢幕: 'Exit full screen',\n 側欄: 'Side panel',\n 時間控制: 'Time control',\n 沒有事件: 'No events',\n 人工: 'Manual',\n 切換: 'Switch',\n 告警: 'Alert',\n '{v}({t})': '{v} ({t})',\n 這段時間沒有資料: 'No data for this period',\n 沒有資料: 'No data',\n 差: 'Difference',\n 正常: 'Normal',\n '⚠ 注意': '⚠ Watch',\n '⚠ 超過上限': '⚠ Over limit',\n '注意 {v}': 'Watch {v}',\n '上限 {v}': 'Limit {v}',\n '新增「{q}」': 'Add “{q}”',\n '日期格式不正確,請寫成 2026/11/14': 'Invalid date. Use 2026/11/14.',\n 更多操作: 'More actions',\n 更多: 'More',\n 左右滑動: 'Scroll sideways',\n 跳到主要內容: 'Skip to main content',\n 說明: 'Explain',\n 開啟導覽: 'Open navigation',\n 顯示方式: 'View',\n 顯示線上文字: 'Show line labels',\n 線上文字: 'Line labels',\n 圖: 'Diagram',\n 清單: 'List',\n 項目: 'Items',\n 關係: 'Relations',\n 已展開: 'Expanded',\n 已收合: 'Collapsed',\n '已展開,{n} 個子項目': 'Expanded, {n} items',\n '顯示 {n} 筆': 'Showing {n} rows',\n 排序: 'Sort',\n '排序:{list}': 'Sort: {list}',\n 由小到大: 'ascending',\n 由大到小: 'descending',\n '依 {list} 排序': 'Sorted by {list}',\n ',再依 ': ', then by ',\n '、': ', ',\n 已還原原本的順序: 'Back to the original order',\n '{name},第 {n} 排序,{dir}': '{name}, sort level {n}, {dir}',\n '「{name}」第 {n} 排序;按 Alt+↑ ↓ 調整順序': '{name}, sort level {n}. Alt+Up or Down moves it',\n '「{name}」的方向': 'Direction of {name}',\n '移除「{name}」排序': 'Remove the sort by {name}',\n '照資料原本的順序。': 'In the original order.',\n '再依…': 'Then by…',\n '排序依據…': 'Sort by…',\n 再依哪一欄: 'Then by which column',\n 依哪一欄排序: 'Sort by which column',\n '最多 {n} 層排序。': 'Up to {n} sort levels.',\n '找到 {n} 筆結果': '{n} results',\n '第 {a} 步,共 {b} 步': 'Step {a} of {b}',\n '說明 {name}': 'Explain {name}',\n 程式碼: 'Code',\n '第 {n} 行': 'Line {n}',\n '第 {n} 層': 'Level {n}',\n 第一行: 'First line',\n 最後一行: 'Last line',\n '上 20 行': '20 lines up',\n '下 20 行': '20 lines down',\n 上一段: 'Previous section',\n 下一段: 'Next section',\n '上一行/下一行': 'Previous / next line',\n '上一個/下一個連結': 'Previous / next link',\n '上一個/下一個名詞': 'Previous / next term',\n '上一個/下一個連結或名詞': 'Previous / next link or term',\n 回到這一行: 'Back to the line',\n 開啟: 'Open',\n '{name},第 {n} 行': '{name}, line {n}',\n '顯示 {n} 筆,另有 {m} 筆,請輸入更長的字': 'Showing {n}, {m} more: type more to narrow it down',\n '縮排 {n} 格': 'indented {n} spaces',\n '縮排 {n} 個 tab': 'indented {n} tabs',\n '縮排 {a} 個 tab、{b} 格': 'indented {a} tabs and {b} spaces',\n 向右捲動: 'Scroll right',\n 筆: 'rows',\n '1 筆': '1 row',\n // Separators: full-width in Chinese, ASCII and a space in English.\n ',': ', ',\n ':': ': ',\n '。': '. ',\n '來自 {from},{label}': 'From {from}, {label}',\n '{from} 到 {to},{what}': '{from} to {to}, {what}',\n 到: 'to',\n '{label}({inferred})': '{label} ({inferred})',\n 調整面板寬度: 'Resize the panel',\n 調整架構圖高度: 'Resize the diagram height',\n '調整「{name}」欄寬': 'Resize the column {name}',\n 放大表格: 'Enlarge the table',\n 表格: 'Table',\n '{n} px': '{n} px',\n '主要區域 {a} px,面板 {b} px': 'Main area {a} px, panel {b} px',\n 'repo 外': 'outside the repo',\n 詳細: 'Details',\n '展開 {name}': 'Expand {name}',\n '收合 {name}': 'Collapse {name}',\n 字: 'characters',\n 'C 語言': 'C',\n 程式語言: 'Language',\n 全部頁面: 'All pages',\n '最近 30 天': 'Last 30 days',\n '最近 7 天': 'Last 7 days',\n 期間: 'Period',\n 未讀: 'Unread',\n 本月: 'This month',\n 沒有符合的資料: 'No matching data',\n 沒有通知: 'No notifications',\n 清除: 'Clear',\n 清除搜尋: 'Clear search',\n 登入: 'Sign in',\n 發生錯誤: 'Something went wrong',\n '移除 {name}': 'Remove {name}',\n '第 {a}–{b} 筆,共 {n} 筆': '{a}–{b} of {n}',\n 繼續編輯: 'Keep editing',\n '自訂強調色(色碼)': 'Custom accent color (hex)',\n '色碼格式不正確,例如 #2457d6': 'Invalid hex, e.g. #2457d6',\n 設定分類: 'Settings sections',\n 請輸入密碼: 'Enter your password',\n 請輸入帳號: 'Enter your username',\n 請選擇: 'Select',\n 路徑: 'Breadcrumb',\n 較上週: 'vs last week',\n 載入中: 'Loading',\n '輸入 # 加 6 碼': 'Enter # and 6 digits',\n 通知: 'Notifications',\n '通知,{n} 則未讀': 'Notifications, {n} unread',\n '選取第 {n} 筆': 'Select row {n}',\n 選擇日期: 'Choose date',\n 選擇期間: 'Choose period',\n 選擇檔案: 'choose files',\n 重試: 'Retry',\n 開啟日曆: 'Open calendar',\n 關閉: 'Close',\n '關閉後,剛才的修改不會保留。': 'If you close now, your changes will be lost.',\n 關閉提示: 'Dismiss',\n 鍵盤操作: 'Keyboard',\n 顯示或關閉這份說明: 'Show or hide this list',\n 檔案總管: 'Explorer',\n 右側欄: 'Side bar',\n 下方面板: 'Panel',\n 有新內容: 'New content',\n '更多分頁({n} 個)': 'More tabs ({n})',\n '更多 {n}': '{n} more',\n 位置不變: 'Same place',\n 放開以排在這裡: 'Drop to place it here',\n '放開以移到{region}': 'Drop to move to the {region}',\n '把目前分頁移到{region}': 'Move this tab to the {region}',\n '收合{region}': 'Hide the {region}',\n '關閉{region}': 'Close the {region}',\n '{region}寬度': '{region} width',\n '{region}高度': '{region} height',\n 面板高度: 'Panel height',\n 面板分頁: 'Panel tabs',\n 目前分頁往左移: 'Move this tab left',\n 目前分頁往右移: 'Move this tab right',\n 收起面板: 'Hide the panel',\n 編輯器: 'Editor',\n 開始: 'Start',\n 'AI 說明': 'AI note',\n 'AI 撰寫': 'AI-written',\n '({v})': ' ({v})',\n 隱藏密碼: 'Hide password',\n 顯示密碼: 'Show password',\n '(今天)': ' (today)',\n 伺服器暫時無法回應: 'The server is not responding',\n 找不到這個頁面: 'Page not found',\n 沒有權限查看這個頁面: 'You do not have access to this page',\n '網址可能打錯了,或這個頁面已經移除。': 'The address may be wrong, or the page has been removed.',\n '這個問題已經記錄下來,請稍後重新整理再試。': 'The problem has been logged. Refresh the page later.',\n '請向管理員申請權限,或切換成有權限的帳號。': 'Ask an admin for access, or switch to an account that has it.',\n 自動: 'Auto',\n 淺色: 'Light',\n 深色: 'Dark',\n 藍: 'Blue',\n 靛: 'Indigo',\n 紫: 'Purple',\n 桃紅: 'Pink',\n 紅: 'Red',\n 橘: 'Orange',\n 綠: 'Green',\n 青: 'Teal',\n 草稿: 'Draft',\n 進行中: 'In progress',\n 審核中: 'In review',\n 完成: 'Done',\n 失敗: 'Failed',\n 檢視: 'Views',\n '{n} / {total} 筆': '{n} / {total}',\n '{n} / {total} {unit}': '{n} / {total} {unit}',\n '{n} / {total}': '{n} / {total}',\n '{total} {unit}中的 {n} {unit}': '{n} of {total} {unit}',\n '{total} 中的 {n}': '{n} of {total}',\n 欄位: 'Columns',\n 顯示的欄位: 'Visible columns',\n 清除篩選: 'Clear filters',\n 清除全部: 'Clear all',\n 篩選: 'Filter',\n 最低: 'Min',\n 最高: 'Max',\n '合計 {n} 筆': 'Total: {n}',\n 平均: 'Avg',\n '選取 {name}': 'Select {name}',\n '{n} 個新': '{n} new',\n '{n} 個檔案': '{n} files',\n '下載 {name}': 'Download {name}',\n '已選 {n} 個檔案': '{n} files selected',\n '共 {size}': '{size} total',\n 清除選取: 'Clear selection',\n 下載: 'Download',\n 全部展開: 'Expand all',\n 全部收合: 'Collapse all',\n 這裡還沒有檔案: 'No files here yet',\n 顯示全部: 'Show all',\n 收合: 'Show less',\n 依狀態篩選: 'Filter by status',\n 展開: 'Expand',\n 沒有項目: 'Nothing here',\n 即時: 'Live',\n 已過期: 'Stale',\n 離線: 'Offline',\n 切換專案: 'Switch project',\n '切換專案,目前是 {name}': 'Switch project, now {name}',\n 推測: 'Inferred',\n '{n} 個項目': '{n} items',\n '1 個項目': '1 item',\n '{a} 個項目使用,共 {b} 次': 'Used {b} times by {a} items',\n 共用項目: 'Shared',\n 次數越多線越粗: 'Thicker lines mean more often',\n 架構圖: 'Architecture',\n '{n} 次': '{n} calls',\n '1 次': '1 call',\n 原始碼: 'Source',\n '顯示全部 {n} 行': 'Show all {n} lines',\n '只顯示第 {n} 行前後': 'Show only around line {n}',\n '無法載入 {name} 的子項目': 'Could not load the children of {name}',\n '找不到符合「{q}」的結果': 'No results for “{q}”',\n 輸入名稱開始搜尋: 'Type a name to search',\n 搜尋中: 'Searching',\n 搜尋結果: 'Search results',\n 最近開啟: 'Recently opened',\n 選擇: 'Select',\n 打開: 'Open',\n 取消: 'Cancel',\n 略過: 'Skip',\n 上一步: 'Back',\n 下一步: 'Next',\n 建議修正: 'Suggested fix',\n 複製修正: 'Copy fix',\n 已複製: 'Copied',\n 複製程式碼: 'Copy code',\n '原本:': 'Before: ',\n '改成:': 'After: ',\n 關閉說明: 'Close explanation',\n ',有說明': ', has an explanation',\n '(說明)': ' (explain)',\n '搜尋({k})': 'Search ({k})',\n 確定的關係: 'Confirmed',\n 推測的關係: 'Inferred',\n 專案宣告的關係: 'Declared by the project',\n 宣告: 'Declared',\n 外部項目: 'External',\n },\n },\n};\n\nfunction msgsFor(loc: string): Record<string, string> | null {\n return I18N.messages[loc] || I18N.messages[loc.split('-')[0]] || null;\n}\n\n/** Translates a built-in zh-TW string into the current locale; {name} placeholders take vars. */\nexport function tr(key: string, vars?: Record<string, string | number>): string {\n // zh-TW (and zh-Hant) is the source text; other Chinese locales (zh-CN) use the messages an app adds for them.\n const m = isZhTW() ? null : msgsFor(I18N.locale);\n const out = m?.[key] ?? key;\n return vars ? out.replace(/\\{(\\w+)\\}/g, (a, k: string) => (vars[k] !== undefined ? String(vars[k]) : a)) : out;\n}\n\n/** A count's unit: a function gets the count (for plurals, 「1 row」「2 rows」); a string goes through tr(), and for 1\n * the message 「1 <unit>」 is used when the locale has one (「1 筆」 → 「1 row」), without the number. */\nexport type CountUnit = string | ((n: number) => string);\nexport function unitFor(unit: CountUnit | undefined, n: number): string {\n if (!unit) return '';\n if (typeof unit === 'function') return unit(n);\n if (n === 1) {\n const one = tr('1 ' + unit);\n if (one !== '1 ' + unit) return one.replace(/^1\\s*/, '');\n }\n return tr(unit);\n}\n\n/** Switches the interface language and, optionally, the currency used by format.money. */\nexport function setLocale(locale: string, opts?: { currency?: string }): void {\n I18N.locale = locale || 'zh-TW';\n if (opts?.currency) I18N.currency = opts.currency;\n if (typeof document !== 'undefined') document.documentElement.setAttribute('lang', I18N.locale);\n}\n\n/** Adds or overrides translations for a locale. Keys are the zh-TW strings. */\nexport function addMessages(locale: string, dict: Record<string, string>): void {\n I18N.messages[locale] = { ...I18N.messages[locale], ...dict };\n}\n\nexport const isZhTW = (): boolean => /^zh-(TW|Hant)/i.test(I18N.locale);\n","import { I18N, isZhTW, tr } from './i18n';\n\n/* Dates and numbers for the current locale (setLocale). zh-TW follows the design system's rules\n (2026/11/04(三), 24-hour clock, NT$ 1,280, 萬 and 億 in KPI cards); other locales use Intl's conventions. */\n\nexport type Decimals = number | 'money' | 'percent' | 'size' | 'count';\n\nconst DECIMALS = { money: 0, percent: 1, size: 1, count: 0 } as const;\n\nconst pad2 = (n: number): string => String(n).padStart(2, '0');\n\nfunction locale(): string {\n return I18N.locale;\n}\n\n/** zh-TW: 2026/11/04(三). Other locales: their short date with weekday. */\nfunction date(d: Date | null | undefined, o: { weekday?: boolean; long?: boolean } = {}): string {\n if (!d) return '';\n const wd = o.weekday !== false;\n if (o.long) return new Intl.DateTimeFormat(I18N.locale, { year: 'numeric', month: 'long', day: 'numeric', weekday: wd ? 'long' : undefined }).format(d);\n if (isZhTW()) return fmtDate(d) + (wd ? `(${new Intl.DateTimeFormat('zh-TW', { weekday: 'narrow' }).format(d)})` : '');\n return new Intl.DateTimeFormat(I18N.locale, { year: 'numeric', month: '2-digit', day: '2-digit', weekday: wd ? 'short' : undefined }).format(d);\n}\n\n/** zh-TW: 24-hour 15:57. Other locales: their own clock. */\nfunction time(d: Date | null | undefined): string {\n if (!d) return '';\n return new Intl.DateTimeFormat(\n I18N.locale,\n isZhTW() ? { hour: '2-digit', minute: '2-digit', hourCycle: 'h23' } : { hour: 'numeric', minute: '2-digit' },\n ).format(d);\n}\n\nfunction dateTime(d: Date | null | undefined, o?: { weekday?: boolean }): string {\n return d ? `${date(d, o)} ${time(d)}` : '';\n}\n\n/** Within 7 days: 「2 小時前」、「昨天」. Older: full date and time. Pass now to test. */\nfunction relative(d: Date | null | undefined, now: Date = new Date()): string {\n if (!d) return '';\n const s = (now.getTime() - d.getTime()) / 1000;\n if (s < 0 || s >= 604800) return dateTime(d);\n const rt = new Intl.RelativeTimeFormat(I18N.locale, { numeric: 'auto' });\n if (s < 60) return rt.format(0, 'second');\n if (s < 3600) return rt.format(-Math.floor(s / 60), 'minute');\n if (s < 86400) return rt.format(-Math.floor(s / 3600), 'hour');\n return rt.format(-Math.floor(s / 86400), 'day');\n}\n\nfunction month(d: Date): string {\n return new Intl.DateTimeFormat(I18N.locale, { year: 'numeric', month: 'long' }).format(d);\n}\n\n/** Week starts on Sunday for zh-TW; other locales use Intl's week info when the browser has it. */\nfunction firstDay(): number {\n if (isZhTW()) return 0;\n try {\n const l = new Intl.Locale(I18N.locale) as Intl.Locale & { getWeekInfo?: () => { firstDay: number }; weekInfo?: { firstDay: number } };\n const w = l.getWeekInfo ? l.getWeekInfo() : l.weekInfo;\n if (w?.firstDay) return w.firstDay % 7;\n } catch {\n /* older browsers have no week info */\n }\n return 0;\n}\n\n/** Narrow weekday names, starting from firstDay(). */\nfunction weekdays(): string[] {\n const fd = firstDay();\n const f = new Intl.DateTimeFormat(I18N.locale, { weekday: 'narrow' });\n // 2026/11/01 is a Sunday.\n return Array.from({ length: 7 }, (_, i) => f.format(new Date(2026, 10, 1 + ((fd + i) % 7))));\n}\n\n/** Decimals by unit: money 0, percent 1, size 1, count 0; pass a number to force it. */\nfunction number(v: number, dec?: Decimals): string {\n const dd = typeof dec === 'number' ? dec : dec ? DECIMALS[dec] : 0;\n return new Intl.NumberFormat(I18N.locale, { minimumFractionDigits: dd, maximumFractionDigits: dd }).format(v);\n}\n\nfunction percent(v: number, dec = 1): string {\n return new Intl.NumberFormat(I18N.locale, { style: 'percent', minimumFractionDigits: dec, maximumFractionDigits: dec }).format(v / 100);\n}\n\n/** Only KPI cards abbreviate: 1,284 萬 in zh-TW (萬、億), 12.8M in English.\n * like: format v with the unit and decimals that `like` gets, so a counting KPI keeps its width. */\nfunction compact(v: number, like?: number): string {\n const ref = like ?? v;\n if (Math.abs(ref) < 1e4) return number(v);\n if (/^zh/i.test(I18N.locale)) {\n const a = Math.abs(ref);\n const [unit, div, maxDec] = a >= 1e8 ? (['億', 1e8, 2] as const) : (['萬', 1e4, 1] as const);\n const finalStr = new Intl.NumberFormat(I18N.locale, { maximumFractionDigits: maxDec }).format(a / div);\n const sign = v < 0 ? '-' : '';\n if (like === undefined) return `${sign}${finalStr} ${unit}`;\n const digits = (finalStr.split('.')[1] || '').length;\n return `${sign}${new Intl.NumberFormat(I18N.locale, { minimumFractionDigits: digits, maximumFractionDigits: digits }).format(Math.abs(v) / div)} ${unit}`;\n }\n const nf = new Intl.NumberFormat(I18N.locale, { notation: 'compact', maximumFractionDigits: 1 });\n if (like === undefined) return nf.format(v);\n const parts = nf.formatToParts(ref);\n let num = '';\n let dec = '';\n for (const pt of parts) {\n if (pt.type === 'integer') num += pt.value;\n if (pt.type === 'fraction') {\n num += '.' + pt.value;\n dec = pt.value;\n }\n }\n const mant = parseFloat(num) || 1;\n const scale = 10 ** Math.round(Math.log10(Math.abs(ref) / mant));\n const inner = new Intl.NumberFormat(I18N.locale, { minimumFractionDigits: dec.length, maximumFractionDigits: dec.length }).format(Math.abs(v) / scale);\n let done = false;\n const body = parts\n .map((pt) => {\n if (pt.type === 'integer' || pt.type === 'group' || pt.type === 'decimal' || pt.type === 'fraction') {\n if (done) return '';\n done = true;\n return inner;\n }\n return pt.value;\n })\n .join('');\n return (v < 0 && ref >= 0 ? '-' : '') + body;\n}\n\n/** zh-TW with TWD: NT$ 1,280, negatives -NT$ 1,280. Other locales and currencies: Intl's own symbol and order. */\nfunction money(v: number, o: { currency?: string; compact?: boolean; like?: number } = {}): string {\n const cur = o.currency || I18N.currency;\n const body = o.compact ? compact(Math.abs(v), o.like !== undefined ? Math.abs(o.like) : undefined) : number(Math.abs(v), 'money');\n if (isZhTW() && cur === 'TWD') return `${v < 0 ? '-' : ''}NT$ ${body}`;\n if (o.compact) return `${v < 0 ? '-' : ''}${body} ${cur}`;\n return new Intl.NumberFormat(I18N.locale, {\n style: 'currency',\n currency: cur,\n currencyDisplay: 'narrowSymbol',\n minimumFractionDigits: 0,\n maximumFractionDigits: cur === 'TWD' || cur === 'JPY' ? 0 : 2,\n }).format(v);\n}\n\n/** Bytes to 「186 KB」「54.9 MB」「1.2 GB」. */\nexport function fileSize(b: number | null | undefined): string {\n if (b == null || Number.isNaN(b)) return '';\n // An empty file is 0 KB; anything else at least 1 KB.\n if (b < 1048576) return number(b === 0 ? 0 : Math.max(1, Math.round(b / 1024))) + ' KB';\n if (b < 1073741824) return number(b / 1048576, 1) + ' MB';\n return number(b / 1073741824, 1) + ' GB';\n}\n\n/** Shortens a path: keeps the first segment and the last two, 「src/…/hooks/ops.c:58」. */\nfunction path(p: string | null | undefined, o: { head?: number; tail?: number } = {}): string {\n const head = o.head ?? 1;\n const tail = o.tail ?? 2;\n const parts = String(p ?? '').split('/');\n return parts.length > head + tail ? `${parts.slice(0, head).join('/')}/…/${parts.slice(-tail).join('/')}` : String(p ?? '');\n}\n\n/** A part of a whole, as shown: 「1 / 1 個」「6 / 6 筆」, or 「1 / 5」 without a unit. Give screen readers\n * `fractionLabel` with it: they read the slash as 「斜線」. */\nfunction fraction(n: number, total: number, unit?: string): string {\n return tr(unit ? '{n} / {total} {unit}' : '{n} / {total}', { n: number(n), total: number(total), unit: unit ?? '' });\n}\n\n/** The same fraction as read aloud: 「1 個中的 1 個」「6 筆中的 6 筆」, or 「5 中的 1」 without a unit (English:\n * 「1 of 1」). For `aria-label`, or for visually hidden text beside the shown fraction. */\nfunction fractionLabel(n: number, total: number, unit?: string): string {\n return tr(unit ? '{total} {unit}中的 {n} {unit}' : '{total} 中的 {n}', { n: number(n), total: number(total), unit: unit ?? '' });\n}\n\n/** Every date, number, amount, size and path shown in the UI goes through these. */\nexport const format = {\n locale,\n date,\n time,\n dateTime,\n relative,\n month,\n weekdays,\n firstDay,\n number,\n percent,\n compact,\n money,\n fileSize,\n path,\n fraction,\n fractionLabel,\n};\n\n/* Calendar helpers (local dates, no time). */\nexport const fmtDate = (d: Date | null | undefined): string => (d ? `${d.getFullYear()}/${pad2(d.getMonth() + 1)}/${pad2(d.getDate())}` : '');\n\nexport function parseDate(s: string | null | undefined): Date | null {\n const m = /^(\\d{4})\\/(\\d{1,2})\\/(\\d{1,2})$/.exec(s || '');\n if (!m) return null;\n const d = new Date(+m[1], +m[2] - 1, +m[3]);\n return d.getMonth() === +m[2] - 1 ? d : null;\n}\n\nexport const sameDay = (a: Date | null | undefined, b: Date | null | undefined): boolean =>\n !!a && !!b && a.getFullYear() === b.getFullYear() && a.getMonth() === b.getMonth() && a.getDate() === b.getDate();\n\nexport const dayAdd = (d: Date, n: number): Date => new Date(d.getFullYear(), d.getMonth(), d.getDate() + n);\n"],"mappings":";AAUA,MAAa,OAAkB;CAC7B,QAAQ;CACR,UAAU;CACV,UAAU,EACR,IAAI;EACF,aAAa;EACb,qBAAqB;EACrB,YAAY;EACZ,KAAK;EACL,KAAK;EACL,eAAe;EACf,KAAK;EACL,KAAK;EACL,MAAM;EACN,IAAI;EACJ,IAAI;EACJ,IAAI;EACJ,IAAI;EACJ,Q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,EAAE,QAAQ,IAAI,CAAC"}
|
package/dist/format.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { c as addMessages, i as format, l as setLocale, u as t } from "./format-entry-
|
|
1
|
+
export { c as addMessages, i as format, l as setLocale, u as t } from "./format-entry-C7iBqN3J.js";
|
package/dist/index.d.ts
CHANGED
|
@@ -102,6 +102,7 @@ declare const PH: {
|
|
|
102
102
|
readonly 'arrows-left-right': '<path d="M213.66,181.66l-32,32a8,8,0,0,1-11.32-11.32L188.69,184H48a8,8,0,0,1,0-16H188.69l-18.35-18.34a8,8,0,0,1,11.32-11.32l32,32A8,8,0,0,1,213.66,181.66Zm-139.32-64a8,8,0,0,0,11.32-11.32L67.31,88H208a8,8,0,0,0,0-16H67.31L85.66,53.66A8,8,0,0,0,74.34,42.34l-32,32a8,8,0,0,0,0,11.32Z"/>';
|
|
103
103
|
readonly sparkle: '<path d="M197.58,129.06,146,110l-19-51.62a15.92,15.92,0,0,0-29.88,0L78,110l-51.62,19a15.92,15.92,0,0,0,0,29.88L78,178l19,51.62a15.92,15.92,0,0,0,29.88,0L146,178l51.62-19a15.92,15.92,0,0,0,0-29.88ZM137,164.22a8,8,0,0,0-4.74,4.74L112,223.85,91.78,169A8,8,0,0,0,87,164.22L32.15,144,87,123.78A8,8,0,0,0,91.78,119L112,64.15,132.22,119a8,8,0,0,0,4.74,4.74L191.85,144ZM144,40a8,8,0,0,1,8-8h16V16a8,8,0,0,1,16,0V32h16a8,8,0,0,1,0,16H184V64a8,8,0,0,1-16,0V48H152A8,8,0,0,1,144,40ZM248,88a8,8,0,0,1-8,8h-8v8a8,8,0,0,1-16,0V96h-8a8,8,0,0,1,0-16h8V72a8,8,0,0,1,16,0v8h8A8,8,0,0,1,248,88Z"/>';
|
|
104
104
|
readonly 'trend-up': '<path d="M240,56v64a8,8,0,0,1-16,0V75.31l-82.34,82.35a8,8,0,0,1-11.32,0L96,123.31,29.66,189.66a8,8,0,0,1-11.32-11.32l72-72a8,8,0,0,1,11.32,0L136,140.69,212.69,64H168a8,8,0,0,1,0-16h64A8,8,0,0,1,240,56Z"/>';
|
|
105
|
+
readonly 'corners-in': '<path d="M152,96V48a8,8,0,0,1,16,0V88h40a8,8,0,0,1,0,16H160A8,8,0,0,1,152,96ZM96,152H48a8,8,0,0,0,0,16H88v40a8,8,0,0,0,16,0V160A8,8,0,0,0,96,152Zm112,0H160a8,8,0,0,0-8,8v48a8,8,0,0,0,16,0V168h40a8,8,0,0,0,0-16ZM96,40a8,8,0,0,0-8,8V88H48a8,8,0,0,0,0,16H96a8,8,0,0,0,8-8V48A8,8,0,0,0,96,40Z"/>';
|
|
105
106
|
};
|
|
106
107
|
/** Lucide names that map to a Phosphor icon. */
|
|
107
108
|
declare const PH_ALIAS: {
|
|
@@ -1374,11 +1375,14 @@ interface LineChartProps {
|
|
|
1374
1375
|
headline?: React.ReactNode;
|
|
1375
1376
|
/** Shown in place of the lines when no series has a value. Default 「這段時間沒有資料」. */
|
|
1376
1377
|
empty?: string;
|
|
1378
|
+
/** Height of the plot in px, axes included (x labels, the status band and the legend come on top). Default 240.
|
|
1379
|
+
* Text in the chart stays at its own size however wide the chart is. */
|
|
1380
|
+
height?: number;
|
|
1377
1381
|
/** A status band under the x axis, aligned with the points (StatusBand without its own spacing). */
|
|
1378
1382
|
status?: Omit<StatusBandProps, 'count' | 'times' | 'legend' | 'className'>;
|
|
1379
1383
|
className?: string;
|
|
1380
1384
|
}
|
|
1381
|
-
export declare function LineChart({ series, labels, label, unit, decimals, max, min, labelEvery, band, now, thresholds, marker, playhead, onPlayheadChange, headline, status, empty, className }: LineChartProps): React.JSX.Element;
|
|
1385
|
+
export declare function LineChart({ series, labels, label, unit, decimals, max, min, labelEvery, band, now, thresholds, marker, playhead, onPlayheadChange, headline, status, empty, height, className }: LineChartProps): React.JSX.Element;
|
|
1382
1386
|
interface MeterProps {
|
|
1383
1387
|
/** What is measured, e.g. 「A 區進氣溫度」; also the name screen readers hear. */
|
|
1384
1388
|
label: string;
|
|
@@ -1433,8 +1437,11 @@ interface ZoneMapProps {
|
|
|
1433
1437
|
/** Columns of the grid. Default 4. Where a zone would be narrower than 150 px (phones), fewer columns are used and
|
|
1434
1438
|
* `area` placements are dropped, so zones flow in order. */
|
|
1435
1439
|
columns?: number;
|
|
1436
|
-
/** Height of one grid row in px. Default 120. */
|
|
1440
|
+
/** Height of one grid row in px. Default 120. With `fill`, the least height of a row. */
|
|
1437
1441
|
rowHeight?: number;
|
|
1442
|
+
/** Rows grow to fill the height the map is given (in ConsoleLayout's main view, or any flex column), never below
|
|
1443
|
+
* `rowHeight`. */
|
|
1444
|
+
fill?: boolean;
|
|
1438
1445
|
/** The heat scale's range for zones without a fill. Default 20 to 30. */
|
|
1439
1446
|
min?: number;
|
|
1440
1447
|
max?: number;
|
|
@@ -1442,7 +1449,7 @@ interface ZoneMapProps {
|
|
|
1442
1449
|
onSelect?: (zone: Zone) => void;
|
|
1443
1450
|
className?: string;
|
|
1444
1451
|
}
|
|
1445
|
-
export declare function ZoneMap({ zones, label, columns, rowHeight, min, max, selectedId, onSelect, className }: ZoneMapProps): React.JSX.Element;
|
|
1452
|
+
export declare function ZoneMap({ zones, label, columns, rowHeight, fill, min, max, selectedId, onSelect, className }: ZoneMapProps): React.JSX.Element;
|
|
1446
1453
|
type EventKind = 'alert' | 'switch' | 'ai' | 'manual';
|
|
1447
1454
|
interface TimelineEvent {
|
|
1448
1455
|
id?: string;
|
|
@@ -1462,6 +1469,49 @@ interface EventTimelineProps {
|
|
|
1462
1469
|
}
|
|
1463
1470
|
/** Events newest first, one row each: the time (Geist Mono), an icon for the kind, and what happened. */
|
|
1464
1471
|
export declare function EventTimeline({ events, label, empty, className }: EventTimelineProps): import("react").JSX.Element;
|
|
1472
|
+
/** A card that shows only when the screen is tall enough. */
|
|
1473
|
+
interface ConsoleExtra {
|
|
1474
|
+
/** Stable key for the card. */
|
|
1475
|
+
id: string;
|
|
1476
|
+
/** The card shows when the layout's logical height (the screen height divided by the zoom) is at least this many
|
|
1477
|
+
* px, e.g. 1040. */
|
|
1478
|
+
minHeight: number;
|
|
1479
|
+
/** The card: usually a Card. */
|
|
1480
|
+
node: React.ReactNode;
|
|
1481
|
+
}
|
|
1482
|
+
interface ConsoleLayoutProps {
|
|
1483
|
+
/** The product or screen name, the page's only heading: 「機房監控」. */
|
|
1484
|
+
title: string;
|
|
1485
|
+
/** Right after the title: `<Tag variant="demo">示範資料</Tag>`. Same size and color as the text around it. */
|
|
1486
|
+
tags?: React.ReactNode;
|
|
1487
|
+
/** Right side, before the KPIs: one short state in plain words, 「AI 最佳化中」. Shown in body size and ink color;
|
|
1488
|
+
* pass plain text, not a Badge. */
|
|
1489
|
+
status?: React.ReactNode;
|
|
1490
|
+
/** Right side: `<KpiCard size="compact" />` side by side. In the top bar they lose their card look and sit between
|
|
1491
|
+
* 1 px lines. */
|
|
1492
|
+
kpis?: React.ReactNode;
|
|
1493
|
+
/** Right side, after the KPIs: the time and whether it is live, 「16:24 即時」. */
|
|
1494
|
+
clock?: React.ReactNode;
|
|
1495
|
+
/** A 「全螢幕」 button at the right end (Fullscreen API). Default true; hidden where the browser has no full screen. */
|
|
1496
|
+
fullscreen?: boolean;
|
|
1497
|
+
/** The main view, left of the side panel; it fills its cell (pass one Card, e.g. with a ZoneMap). */
|
|
1498
|
+
main: React.ReactNode;
|
|
1499
|
+
/** The side panel, 400 px (360 px under 1280 px): cards from top to bottom (TimeControl, EventTimeline). When they
|
|
1500
|
+
* do not fit, the side panel scrolls on its own; the page never does. */
|
|
1501
|
+
side?: React.ReactNode;
|
|
1502
|
+
/** The bottom row under the main view, as tall as its content: e.g. a LineChart in a Card. The main view takes the
|
|
1503
|
+
* height that is left. */
|
|
1504
|
+
bottom?: React.ReactNode;
|
|
1505
|
+
/** Cards added at the end of the side panel on tall screens: `[{ id, minHeight: 1040, node }]`. */
|
|
1506
|
+
extras?: ConsoleExtra[];
|
|
1507
|
+
className?: string;
|
|
1508
|
+
}
|
|
1509
|
+
/** Zoom for a screen of w × h px: 1 up to 1440 × 900, then grows with the screen, at most 1.5. */
|
|
1510
|
+
export declare function consoleZoom(w: number, h: number): number;
|
|
1511
|
+
/** A full-screen monitoring layout: a top bar (title, tags, then status, KPIs, clock and full screen on the right),
|
|
1512
|
+
* the main view with a side panel beside it and a bottom row under it, filling the screen without scrolling. From
|
|
1513
|
+
* 1440 × 900 up everything zooms with the screen (at most 1.5×). Phones (under 600 px) get one scrolling column. */
|
|
1514
|
+
export declare function ConsoleLayout({ title, tags, status, kpis, clock, fullscreen, main, side, bottom, extras, className }: ConsoleLayoutProps): React.JSX.Element;
|
|
1465
1515
|
interface TimeControlProps {
|
|
1466
1516
|
/** The time on show: now when live, the replayed moment during a replay. */
|
|
1467
1517
|
time: Date;
|
|
@@ -1823,12 +1873,13 @@ interface TagProps {
|
|
|
1823
1873
|
children?: React.ReactNode;
|
|
1824
1874
|
/** `plain` (default): small gray text. `forecast`: marks a value as forecast, not measured: a trend icon and the
|
|
1825
1875
|
* words in accent text, e.g. 「預測」 beside it. `demo`: a whole page of sample values: an info icon and the words in
|
|
1826
|
-
*
|
|
1876
|
+
* the color of the text beside them, e.g. 「示範資料」 beside the brand; one per page. Both take the size of the text
|
|
1877
|
+
* beside them. */
|
|
1827
1878
|
variant?: 'plain' | 'forecast' | 'demo';
|
|
1828
1879
|
className?: string;
|
|
1829
1880
|
}
|
|
1830
1881
|
/** What kind of thing an item is (「外部」「範本」): small gray text. Status uses Badge instead. Two kinds say where
|
|
1831
|
-
* numbers come from, with an icon and
|
|
1882
|
+
* numbers come from, with an icon and no fill: forecast and demo. */
|
|
1832
1883
|
export declare function Tag({ children, variant, className }: TagProps): React.JSX.Element;
|
|
1833
1884
|
interface TermProps {
|
|
1834
1885
|
/** The word or label that needs explaining. */
|
|
@@ -2204,4 +2255,4 @@ export declare function useWorkbench(): WorkbenchApi;
|
|
|
2204
2255
|
/** An editor layout like VS Code: top bar, file explorer, main view, side bar and bottom panel, with resizable borders,
|
|
2205
2256
|
* views that move between the side bar and the panel, Ctrl B / Ctrl J / Ctrl Alt B, and a remembered layout. */
|
|
2206
2257
|
export declare function Workbench({ ref, ...p }: WorkbenchProps): React.JSX.Element;
|
|
2207
|
-
export { type AccentPickerProps, type ActionBarAction, type ActionBarProps, type AiMarkProps, type AlertProps, type AlertTone, type AppShellProps, type BadgeProps, type BadgeStatus, type BarChartProps, type BarDatum, type BreadcrumbItem, type BreadcrumbProps, type ButtonProps, type CalendarProps, type CardProps, type CheckboxProps, type CodeLanguage, type CodeLink, type CodeTextProps, type CodeViewHandle, type CodeViewProps, type CommandPaletteProps, type CountUnit, type CustomIcon, type DangerConfirm, type DangerZoneProps, type DataTableColumn, type DataTableFilter, type DataTableProps, type DataTableView, type DatePickerProps, type DateRange, type DateRangePickerProps, type DayState, type Decimals, type DetailListItem, type DetailListProps, type DialogProps, type DrawerProps, type EmptyStateProps, type ErrorPageProps, type EventKind, type EventTimelineProps, type FileUploadProps, type FilterOption, type FilterValue, type FormGridProps, type GraphLegendItem, type GraphLegendProps, type GridProps, type IconButtonHint, type IconButtonProps, type IconName, type IconProps, type IconSource, type InlineCodeProps, type KpiCardProps, type LayerGraphEdge, type LayerGraphNode, type LayerGraphProps, type LineBand, type LineChartProps, type LineSeries, type LineThreshold, type LoadingBarProps, type LoginCardProps, type MarkdownProps, type MenuItem, type MenuProps, type MeterProps, type MobileTab, type MobileTabBarProps, type MultiSelectOption, type MultiSelectProps, type NavBrand, type NavItem, type NavSection, type NotificationBellProps, type NotificationItem, type OnRef, type PageProps, type PaletteItem, type PopoverProps, type ProgressBarProps, type ProgressRingProps, type ProjectOption, type ProjectStatus, type ProjectSwitcherProps, type RadioGroupProps, type RadioOption, type RangeValue, type RefHref, type Row, type RowKey, type SearchFieldProps, type SectionGroupProps, type SectionGroupToggleProps, type SectionProps, type SegmentedControlProps, type SegmentedItem, type SelectOption, type SelectProps, type SettingsCategory, type SettingsLayoutProps, type SettingsSectionProps, type SideNavProps, type SkeletonProps, type SplitPaneProps, type StatusBandProps, type StatusSegment, type SuggestionProps, type SwitchProps, type TabItem, type TabsProps, type TagProps, type TermDef, type TermProps, type TermsMark, type TextAreaProps, type TextFieldProps, type ThemePickerProps, type ThemeSetting, type TimeControlProps, type TimelineEvent, type ToastProps, type Token, type TokenClass, type Tokenizer, type TooltipProps, type TopBarProps, type Total, type TourProps, type TourStep, type TreeListProps, type TreeMark, type TreeNode, type UploadFile, type WorkbenchApi, type WorkbenchHandle, type WorkbenchLayout, type WorkbenchProps, type WorkbenchRegion, type WorkbenchView, type Zone, type ZoneMapProps, addMessages, format, setLocale, tr as t };
|
|
2258
|
+
export { type AccentPickerProps, type ActionBarAction, type ActionBarProps, type AiMarkProps, type AlertProps, type AlertTone, type AppShellProps, type BadgeProps, type BadgeStatus, type BarChartProps, type BarDatum, type BreadcrumbItem, type BreadcrumbProps, type ButtonProps, type CalendarProps, type CardProps, type CheckboxProps, type CodeLanguage, type CodeLink, type CodeTextProps, type CodeViewHandle, type CodeViewProps, type CommandPaletteProps, type ConsoleExtra, type ConsoleLayoutProps, type CountUnit, type CustomIcon, type DangerConfirm, type DangerZoneProps, type DataTableColumn, type DataTableFilter, type DataTableProps, type DataTableView, type DatePickerProps, type DateRange, type DateRangePickerProps, type DayState, type Decimals, type DetailListItem, type DetailListProps, type DialogProps, type DrawerProps, type EmptyStateProps, type ErrorPageProps, type EventKind, type EventTimelineProps, type FileUploadProps, type FilterOption, type FilterValue, type FormGridProps, type GraphLegendItem, type GraphLegendProps, type GridProps, type IconButtonHint, type IconButtonProps, type IconName, type IconProps, type IconSource, type InlineCodeProps, type KpiCardProps, type LayerGraphEdge, type LayerGraphNode, type LayerGraphProps, type LineBand, type LineChartProps, type LineSeries, type LineThreshold, type LoadingBarProps, type LoginCardProps, type MarkdownProps, type MenuItem, type MenuProps, type MeterProps, type MobileTab, type MobileTabBarProps, type MultiSelectOption, type MultiSelectProps, type NavBrand, type NavItem, type NavSection, type NotificationBellProps, type NotificationItem, type OnRef, type PageProps, type PaletteItem, type PopoverProps, type ProgressBarProps, type ProgressRingProps, type ProjectOption, type ProjectStatus, type ProjectSwitcherProps, type RadioGroupProps, type RadioOption, type RangeValue, type RefHref, type Row, type RowKey, type SearchFieldProps, type SectionGroupProps, type SectionGroupToggleProps, type SectionProps, type SegmentedControlProps, type SegmentedItem, type SelectOption, type SelectProps, type SettingsCategory, type SettingsLayoutProps, type SettingsSectionProps, type SideNavProps, type SkeletonProps, type SplitPaneProps, type StatusBandProps, type StatusSegment, type SuggestionProps, type SwitchProps, type TabItem, type TabsProps, type TagProps, type TermDef, type TermProps, type TermsMark, type TextAreaProps, type TextFieldProps, type ThemePickerProps, type ThemeSetting, type TimeControlProps, type TimelineEvent, type ToastProps, type Token, type TokenClass, type Tokenizer, type TooltipProps, type TopBarProps, type Total, type TourProps, type TourStep, type TreeListProps, type TreeMark, type TreeNode, type UploadFile, type WorkbenchApi, type WorkbenchHandle, type WorkbenchLayout, type WorkbenchProps, type WorkbenchRegion, type WorkbenchView, type Zone, type ZoneMapProps, addMessages, format, setLocale, tr as t };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { a as parseDate, c as addMessages, d as unitFor, i as format, l as setLocale, n as fileSize, o as sameDay, r as fmtDate, s as I18N, t as dayAdd, u as tr } from "./format-entry-
|
|
2
|
+
import { a as parseDate, c as addMessages, d as unitFor, i as format, l as setLocale, n as fileSize, o as sameDay, r as fmtDate, s as I18N, t as dayAdd, u as tr } from "./format-entry-C7iBqN3J.js";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { Tooltip as Tooltip$1 } from "@base-ui/react/tooltip";
|
|
@@ -112,7 +112,8 @@ const PH = {
|
|
|
112
112
|
keyboard: "<path d=\"M224,48H32A16,16,0,0,0,16,64V192a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48Zm0,144H32V64H224V192Zm-16-64a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16H200A8,8,0,0,1,208,128Zm0-32a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16H200A8,8,0,0,1,208,96ZM72,160a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16h8A8,8,0,0,1,72,160Zm96,0a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,160Zm40,0a8,8,0,0,1-8,8h-8a8,8,0,0,1,0-16h8A8,8,0,0,1,208,160Z\"/>",
|
|
113
113
|
"arrows-left-right": "<path d=\"M213.66,181.66l-32,32a8,8,0,0,1-11.32-11.32L188.69,184H48a8,8,0,0,1,0-16H188.69l-18.35-18.34a8,8,0,0,1,11.32-11.32l32,32A8,8,0,0,1,213.66,181.66Zm-139.32-64a8,8,0,0,0,11.32-11.32L67.31,88H208a8,8,0,0,0,0-16H67.31L85.66,53.66A8,8,0,0,0,74.34,42.34l-32,32a8,8,0,0,0,0,11.32Z\"/>",
|
|
114
114
|
sparkle: "<path d=\"M197.58,129.06,146,110l-19-51.62a15.92,15.92,0,0,0-29.88,0L78,110l-51.62,19a15.92,15.92,0,0,0,0,29.88L78,178l19,51.62a15.92,15.92,0,0,0,29.88,0L146,178l51.62-19a15.92,15.92,0,0,0,0-29.88ZM137,164.22a8,8,0,0,0-4.74,4.74L112,223.85,91.78,169A8,8,0,0,0,87,164.22L32.15,144,87,123.78A8,8,0,0,0,91.78,119L112,64.15,132.22,119a8,8,0,0,0,4.74,4.74L191.85,144ZM144,40a8,8,0,0,1,8-8h16V16a8,8,0,0,1,16,0V32h16a8,8,0,0,1,0,16H184V64a8,8,0,0,1-16,0V48H152A8,8,0,0,1,144,40ZM248,88a8,8,0,0,1-8,8h-8v8a8,8,0,0,1-16,0V96h-8a8,8,0,0,1,0-16h8V72a8,8,0,0,1,16,0v8h8A8,8,0,0,1,248,88Z\"/>",
|
|
115
|
-
"trend-up": "<path d=\"M240,56v64a8,8,0,0,1-16,0V75.31l-82.34,82.35a8,8,0,0,1-11.32,0L96,123.31,29.66,189.66a8,8,0,0,1-11.32-11.32l72-72a8,8,0,0,1,11.32,0L136,140.69,212.69,64H168a8,8,0,0,1,0-16h64A8,8,0,0,1,240,56Z\"/>"
|
|
115
|
+
"trend-up": "<path d=\"M240,56v64a8,8,0,0,1-16,0V75.31l-82.34,82.35a8,8,0,0,1-11.32,0L96,123.31,29.66,189.66a8,8,0,0,1-11.32-11.32l72-72a8,8,0,0,1,11.32,0L136,140.69,212.69,64H168a8,8,0,0,1,0-16h64A8,8,0,0,1,240,56Z\"/>",
|
|
116
|
+
"corners-in": "<path d=\"M152,96V48a8,8,0,0,1,16,0V88h40a8,8,0,0,1,0,16H160A8,8,0,0,1,152,96ZM96,152H48a8,8,0,0,0,0,16H88v40a8,8,0,0,0,16,0V160A8,8,0,0,0,96,152Zm112,0H160a8,8,0,0,0-8,8v48a8,8,0,0,0,16,0V168h40a8,8,0,0,0,0-16ZM96,40a8,8,0,0,0-8,8V88H48a8,8,0,0,0,0,16H96a8,8,0,0,0,8-8V48A8,8,0,0,0,96,40Z\"/>"
|
|
116
117
|
};
|
|
117
118
|
const PH_FILL = {
|
|
118
119
|
archive: "<path d=\"M224,48H32A16,16,0,0,0,16,64V88a16,16,0,0,0,16,16v88a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V104a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48Zm-72,96H104a8,8,0,0,1,0-16h48a8,8,0,0,1,0,16Zm72-56H32V64H224V88Z\"/>",
|
|
@@ -215,7 +216,8 @@ const PH_FILL = {
|
|
|
215
216
|
keyboard: "<path d=\"M224,48H32A16,16,0,0,0,16,64V192a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48ZM64,168H48a8,8,0,0,1,0-16H64a8,8,0,0,1,0,16Zm96,0H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Zm48,0H192a8,8,0,0,1,0-16h16a8,8,0,0,1,0,16Zm0-32H48a8,8,0,0,1,0-16H208a8,8,0,0,1,0,16Zm0-32H48a8,8,0,0,1,0-16H208a8,8,0,0,1,0,16Z\"/>",
|
|
216
217
|
"arrows-left-right": "<path d=\"M42.34,85.66a8,8,0,0,1,0-11.32l32-32A8,8,0,0,1,88,48V72H208a8,8,0,0,1,0,16H88v24a8,8,0,0,1-13.66,5.66Zm171.32,84.68-32-32A8,8,0,0,0,168,144v24H48a8,8,0,0,0,0,16H168v24a8,8,0,0,0,13.66,5.66l32-32A8,8,0,0,0,213.66,170.34Z\"/>",
|
|
217
218
|
sparkle: "<path d=\"M208,144a15.78,15.78,0,0,1-10.42,14.94L146,178l-19,51.62a15.92,15.92,0,0,1-29.88,0L78,178l-51.62-19a15.92,15.92,0,0,1,0-29.88L78,110l19-51.62a15.92,15.92,0,0,1,29.88,0L146,110l51.62,19A15.78,15.78,0,0,1,208,144ZM152,48h16V64a8,8,0,0,0,16,0V48h16a8,8,0,0,0,0-16H184V16a8,8,0,0,0-16,0V32H152a8,8,0,0,0,0,16Zm88,32h-8V72a8,8,0,0,0-16,0v8h-8a8,8,0,0,0,0,16h8v8a8,8,0,0,0,16,0V96h8a8,8,0,0,0,0-16Z\"/>",
|
|
218
|
-
"trend-up": "<path d=\"M240,56v64a8,8,0,0,1-13.66,5.66L200,99.31l-58.34,58.35a8,8,0,0,1-11.32,0L96,123.31,29.66,189.66a8,8,0,0,1-11.32-11.32l72-72a8,8,0,0,1,11.32,0L136,140.69,188.69,88,162.34,61.66A8,8,0,0,1,168,48h64A8,8,0,0,1,240,56Z\"/>"
|
|
219
|
+
"trend-up": "<path d=\"M240,56v64a8,8,0,0,1-13.66,5.66L200,99.31l-58.34,58.35a8,8,0,0,1-11.32,0L96,123.31,29.66,189.66a8,8,0,0,1-11.32-11.32l72-72a8,8,0,0,1,11.32,0L136,140.69,188.69,88,162.34,61.66A8,8,0,0,1,168,48h64A8,8,0,0,1,240,56Z\"/>",
|
|
220
|
+
"corners-in": "<path d=\"M152,96V48a8,8,0,0,1,13.66-5.66l48,48A8,8,0,0,1,208,104H160A8,8,0,0,1,152,96ZM96,152H48a8,8,0,0,0-5.66,13.66l48,48A8,8,0,0,0,104,208V160A8,8,0,0,0,96,152ZM99.06,40.61a8,8,0,0,0-8.72,1.73l-48,48A8,8,0,0,0,48,104H96a8,8,0,0,0,8-8V48A8,8,0,0,0,99.06,40.61ZM208,152H160a8,8,0,0,0-8,8v48a8,8,0,0,0,13.66,5.66l48-48A8,8,0,0,0,208,152Z\"/>"
|
|
219
221
|
};
|
|
220
222
|
/** Lucide names that map to a Phosphor icon. */
|
|
221
223
|
const PH_ALIAS = {
|
|
@@ -8777,11 +8779,10 @@ function StatusLegend({ classes, label }) {
|
|
|
8777
8779
|
});
|
|
8778
8780
|
}
|
|
8779
8781
|
// src/components/LineChart/LineChart.tsx
|
|
8780
|
-
|
|
8782
|
+
/** Plot geometry in px: y labels left of L, the 現在 label above T, the playhead handle below B. */
|
|
8781
8783
|
const L = 40;
|
|
8782
|
-
const R = 630;
|
|
8783
8784
|
const T = 10;
|
|
8784
|
-
const
|
|
8785
|
+
const BELOW = 30;
|
|
8785
8786
|
/** Runs of consecutive points that have values. */
|
|
8786
8787
|
function runs(values, X, Y) {
|
|
8787
8788
|
const out = [];
|
|
@@ -8798,16 +8799,32 @@ function runs(values, X, Y) {
|
|
|
8798
8799
|
/** A trend over time: smooth lines, 5 grid lines, a guide and tooltip on hover. For monitoring it can also compare a
|
|
8799
8800
|
* forecast with what happened (band, now, thresholds, marker) and replay with a playhead. */
|
|
8800
8801
|
const colorOf = (s, i) => s?.color ? seriesColor(s.color - 1) : seriesColor(i);
|
|
8801
|
-
function LineChart({ series, labels, label, unit, decimals, max, min = 0, labelEvery = 1, band, now, thresholds, marker, playhead, onPlayheadChange, headline, status, empty, className }) {
|
|
8802
|
+
function LineChart({ series, labels, label, unit, decimals, max, min = 0, labelEvery = 1, band, now, thresholds, marker, playhead, onPlayheadChange, headline, status, empty, height = 240, className }) {
|
|
8802
8803
|
const [hi, setHi] = React.useState(-1);
|
|
8804
|
+
const plot = React.useRef(null);
|
|
8805
|
+
const [W, setW] = React.useState(640);
|
|
8806
|
+
React.useLayoutEffect(() => {
|
|
8807
|
+
const el = plot.current;
|
|
8808
|
+
if (!el) return;
|
|
8809
|
+
const fit = () => {
|
|
8810
|
+
if (el.clientWidth > 0) setW(el.clientWidth);
|
|
8811
|
+
};
|
|
8812
|
+
fit();
|
|
8813
|
+
if (typeof ResizeObserver !== "function") return;
|
|
8814
|
+
const ro = new ResizeObserver(fit);
|
|
8815
|
+
ro.observe(el);
|
|
8816
|
+
return () => ro.disconnect();
|
|
8817
|
+
}, []);
|
|
8818
|
+
const R = W - 10;
|
|
8819
|
+
const B = height - BELOW;
|
|
8803
8820
|
const stripes = "ui-stripes-" + React.useId().replace(/:/g, "");
|
|
8804
8821
|
const dragging = React.useRef(false);
|
|
8805
8822
|
const all = series.flatMap((s) => s.values.filter((v) => v != null));
|
|
8806
8823
|
const top = max ?? niceMax(Math.max(min + 1, ...all, ...(thresholds ?? []).map((t) => t.value)) - min) + min;
|
|
8807
8824
|
const n = labels.length || series[0]?.values.length || 0;
|
|
8808
|
-
const step =
|
|
8825
|
+
const step = (R - L) / Math.max(1, n - 1);
|
|
8809
8826
|
const X = (i) => L + i * step;
|
|
8810
|
-
const Y = (v) => B - (v - min) / (top - min) *
|
|
8827
|
+
const Y = (v) => B - (v - min) / (top - min) * (B - T);
|
|
8811
8828
|
const ticks = TICKS.map((f) => min + f * (top - min));
|
|
8812
8829
|
const suffix = unit ? " " + unit : "";
|
|
8813
8830
|
const num = (v) => v == null ? "—" : format.number(v, decimals) + suffix;
|
|
@@ -8827,9 +8844,12 @@ function LineChart({ series, labels, label, unit, decimals, max, min = 0, labelE
|
|
|
8827
8844
|
};
|
|
8828
8845
|
const edge = {
|
|
8829
8846
|
left: (L - step / 2) / W * 100 + "%",
|
|
8830
|
-
right: (
|
|
8847
|
+
right: (W - R - step / 2) / W * 100 + "%"
|
|
8831
8848
|
};
|
|
8832
8849
|
const legend = series.length > 1 || band;
|
|
8850
|
+
const widest = Math.max(0, ...labels.map((lb) => lb.length)) * 7.5 + 12;
|
|
8851
|
+
const every = Math.max(labelEvery, Math.ceil(n * widest / Math.max(1, R - L) / labelEvery) * labelEvery);
|
|
8852
|
+
const markerLeft = marker ? X(marker.at) + 10 + [...marker.label].reduce((w, c) => w + (c.charCodeAt(0) > 11904 ? 14 : 8), 0) > W : false;
|
|
8833
8853
|
const bandShapes = [];
|
|
8834
8854
|
if (band) {
|
|
8835
8855
|
const a = series[band.between[0]]?.values ?? [];
|
|
@@ -8882,6 +8902,7 @@ function LineChart({ series, labels, label, unit, decimals, max, min = 0, labelE
|
|
|
8882
8902
|
}), s.name] }, i)), band ? /* @__PURE__ */ jsxs("span", { children: [/* @__PURE__ */ jsx("span", { className: cx("ui-chart-swatch", "is-band", "is-" + band.tone) }), band.label] }) : null]
|
|
8883
8903
|
}) : null,
|
|
8884
8904
|
/* @__PURE__ */ jsxs("div", {
|
|
8905
|
+
ref: plot,
|
|
8885
8906
|
className: cx("ui-chart-plot", replay && "is-replay"),
|
|
8886
8907
|
tabIndex: n ? 0 : void 0,
|
|
8887
8908
|
role: "group",
|
|
@@ -8913,8 +8934,9 @@ function LineChart({ series, labels, label, unit, decimals, max, min = 0, labelE
|
|
|
8913
8934
|
},
|
|
8914
8935
|
children: [
|
|
8915
8936
|
/* @__PURE__ */ jsxs("svg", {
|
|
8916
|
-
viewBox: `0 0 ${W}
|
|
8937
|
+
viewBox: `0 0 ${W} ${height}`,
|
|
8917
8938
|
width: "100%",
|
|
8939
|
+
height,
|
|
8918
8940
|
"aria-hidden": "true",
|
|
8919
8941
|
children: [
|
|
8920
8942
|
now != null && now < n - 1 ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx("pattern", {
|
|
@@ -8932,7 +8954,7 @@ function LineChart({ series, labels, label, unit, decimals, max, min = 0, labelE
|
|
|
8932
8954
|
x: X(now),
|
|
8933
8955
|
y: T,
|
|
8934
8956
|
width: R - X(now),
|
|
8935
|
-
height:
|
|
8957
|
+
height: B - T,
|
|
8936
8958
|
fill: `url(#${stripes})`
|
|
8937
8959
|
})] }) : null,
|
|
8938
8960
|
ticks.map((v, i) => /* @__PURE__ */ jsxs("g", { children: [/* @__PURE__ */ jsx("line", {
|
|
@@ -8960,7 +8982,7 @@ function LineChart({ series, labels, label, unit, decimals, max, min = 0, labelE
|
|
|
8960
8982
|
y1: Y(t.value),
|
|
8961
8983
|
y2: Y(t.value)
|
|
8962
8984
|
}), /* @__PURE__ */ jsx("text", {
|
|
8963
|
-
x:
|
|
8985
|
+
x: R - 2,
|
|
8964
8986
|
y: Y(t.value) - 5,
|
|
8965
8987
|
textAnchor: "end",
|
|
8966
8988
|
children: t.label
|
|
@@ -8997,9 +9019,9 @@ function LineChart({ series, labels, label, unit, decimals, max, min = 0, labelE
|
|
|
8997
9019
|
r: 5.5,
|
|
8998
9020
|
style: { stroke: colorOf(series[marker.series ?? series.length - 1], marker.series ?? series.length - 1) }
|
|
8999
9021
|
}), /* @__PURE__ */ jsx("text", {
|
|
9000
|
-
x: X(marker.at) + (
|
|
9022
|
+
x: X(marker.at) + (markerLeft ? -10 : 10),
|
|
9001
9023
|
y: Y(marker.value) + 20,
|
|
9002
|
-
textAnchor:
|
|
9024
|
+
textAnchor: markerLeft ? "end" : "start",
|
|
9003
9025
|
children: marker.label
|
|
9004
9026
|
})]
|
|
9005
9027
|
}) : null,
|
|
@@ -9020,7 +9042,10 @@ function LineChart({ series, labels, label, unit, decimals, max, min = 0, labelE
|
|
|
9020
9042
|
}),
|
|
9021
9043
|
/* @__PURE__ */ jsx("div", {
|
|
9022
9044
|
className: "ui-chart-hit",
|
|
9023
|
-
style:
|
|
9045
|
+
style: {
|
|
9046
|
+
...edge,
|
|
9047
|
+
bottom: BELOW
|
|
9048
|
+
},
|
|
9024
9049
|
children: labels.map((_, j) => /* @__PURE__ */ jsx("div", {
|
|
9025
9050
|
onMouseEnter: () => !dragging.current && setHi(j),
|
|
9026
9051
|
className: "ui-chart-col",
|
|
@@ -9069,7 +9094,7 @@ function LineChart({ series, labels, label, unit, decimals, max, min = 0, labelE
|
|
|
9069
9094
|
marginLeft: edge.left,
|
|
9070
9095
|
marginRight: edge.right
|
|
9071
9096
|
},
|
|
9072
|
-
children: labels.map((lb, j) => /* @__PURE__ */ jsx("span", { children:
|
|
9097
|
+
children: labels.map((lb, j) => /* @__PURE__ */ jsx("span", { children: every > 1 && j % every ? "" : digits(lb) }, j))
|
|
9073
9098
|
}),
|
|
9074
9099
|
status ? /* @__PURE__ */ jsx(StatusLegend, {
|
|
9075
9100
|
classes: status.classes,
|
|
@@ -9194,14 +9219,14 @@ function Meter({ label, value, min, max, warn, limit, unit, decimals = 0, classN
|
|
|
9194
9219
|
* and one detail line. Zones are buttons: Tab moves between them, Enter or Space selects. The selected zone has an
|
|
9195
9220
|
* ink outline outside it; a zone needing attention has a 4 px warning or danger border and 「⚠」 in its state. */
|
|
9196
9221
|
const DATA_TOKEN = /^(heat-[1-7]|diverge-(neg|pos)(-strong)?|diverge-zero|chart-[1-4])$/;
|
|
9197
|
-
function ZoneMap({ zones, label, columns = 4, rowHeight = 120, min = 20, max = 30, selectedId, onSelect, className }) {
|
|
9222
|
+
function ZoneMap({ zones, label, columns = 4, rowHeight = 120, fill = false, min = 20, max = 30, selectedId, onSelect, className }) {
|
|
9198
9223
|
return /* @__PURE__ */ jsx("div", {
|
|
9199
|
-
className: cx("ui-zonemap", className),
|
|
9224
|
+
className: cx("ui-zonemap", fill && "is-fill", className),
|
|
9200
9225
|
role: "group",
|
|
9201
9226
|
"aria-label": label,
|
|
9202
9227
|
style: {
|
|
9203
9228
|
"--zone-cols": columns,
|
|
9204
|
-
gridAutoRows: rowHeight + "px"
|
|
9229
|
+
gridAutoRows: fill ? `minmax(${rowHeight}px, 1fr)` : rowHeight + "px"
|
|
9205
9230
|
},
|
|
9206
9231
|
children: zones.map((z) => {
|
|
9207
9232
|
const place = z.area ? {
|
|
@@ -9323,6 +9348,116 @@ function EventTimeline({ events, label, empty, className }) {
|
|
|
9323
9348
|
}, e.id ?? i))
|
|
9324
9349
|
});
|
|
9325
9350
|
}
|
|
9351
|
+
// src/components/ConsoleLayout/ConsoleLayout.tsx
|
|
9352
|
+
/** Design size: at this size and up the layout zooms in. */
|
|
9353
|
+
const BASE_W = 1440;
|
|
9354
|
+
const BASE_H = 900;
|
|
9355
|
+
const MAX_ZOOM = 1.5;
|
|
9356
|
+
const PHONE = 600;
|
|
9357
|
+
/** Zoom for a screen of w × h px: 1 up to 1440 × 900, then grows with the screen, at most 1.5. */
|
|
9358
|
+
function consoleZoom(w, h) {
|
|
9359
|
+
return Math.max(1, Math.min(MAX_ZOOM, Math.min(w / BASE_W, h / BASE_H)));
|
|
9360
|
+
}
|
|
9361
|
+
/** A full-screen monitoring layout: a top bar (title, tags, then status, KPIs, clock and full screen on the right),
|
|
9362
|
+
* the main view with a side panel beside it and a bottom row under it, filling the screen without scrolling. From
|
|
9363
|
+
* 1440 × 900 up everything zooms with the screen (at most 1.5×). Phones (under 600 px) get one scrolling column. */
|
|
9364
|
+
function ConsoleLayout({ title, tags, status, kpis, clock, fullscreen = true, main, side, bottom, extras, className }) {
|
|
9365
|
+
const ref = React.useRef(null);
|
|
9366
|
+
const [size, setSize] = React.useState(null);
|
|
9367
|
+
const [full, setFull] = React.useState(false);
|
|
9368
|
+
const canFull = typeof document !== "undefined" && document.fullscreenEnabled === true;
|
|
9369
|
+
React.useLayoutEffect(() => {
|
|
9370
|
+
const el = ref.current;
|
|
9371
|
+
if (!el) return;
|
|
9372
|
+
const measure = () => setSize({
|
|
9373
|
+
w: el.clientWidth,
|
|
9374
|
+
h: el.clientHeight
|
|
9375
|
+
});
|
|
9376
|
+
measure();
|
|
9377
|
+
if (typeof ResizeObserver === "undefined") return;
|
|
9378
|
+
const ro = new ResizeObserver(measure);
|
|
9379
|
+
ro.observe(el);
|
|
9380
|
+
return () => ro.disconnect();
|
|
9381
|
+
}, []);
|
|
9382
|
+
React.useEffect(() => {
|
|
9383
|
+
const f = () => setFull(document.fullscreenElement != null && document.fullscreenElement === ref.current);
|
|
9384
|
+
document.addEventListener("fullscreenchange", f);
|
|
9385
|
+
return () => document.removeEventListener("fullscreenchange", f);
|
|
9386
|
+
}, []);
|
|
9387
|
+
const toggleFull = () => {
|
|
9388
|
+
const el = ref.current;
|
|
9389
|
+
if (!el) return;
|
|
9390
|
+
if (document.fullscreenElement) document.exitFullscreen().catch(() => void 0);
|
|
9391
|
+
else el.requestFullscreen().catch(() => void 0);
|
|
9392
|
+
};
|
|
9393
|
+
const phone = size != null && size.w < PHONE;
|
|
9394
|
+
const zoom = size && !phone ? consoleZoom(size.w, size.h) : 1;
|
|
9395
|
+
const logicalH = size ? size.h / zoom : 0;
|
|
9396
|
+
const shown = (extras ?? []).filter((x) => phone || logicalH >= x.minHeight);
|
|
9397
|
+
const frameStyle = size && !phone && zoom !== 1 ? {
|
|
9398
|
+
zoom,
|
|
9399
|
+
width: size.w / zoom,
|
|
9400
|
+
height: size.h / zoom
|
|
9401
|
+
} : void 0;
|
|
9402
|
+
const top = /* @__PURE__ */ jsxs("header", {
|
|
9403
|
+
className: "ui-console-top",
|
|
9404
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
9405
|
+
className: "ui-console-start",
|
|
9406
|
+
children: [/* @__PURE__ */ jsx("h1", {
|
|
9407
|
+
className: "ui-console-title",
|
|
9408
|
+
children: title
|
|
9409
|
+
}), tags]
|
|
9410
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
9411
|
+
className: "ui-console-end",
|
|
9412
|
+
children: [
|
|
9413
|
+
status != null ? /* @__PURE__ */ jsx("span", {
|
|
9414
|
+
className: "ui-console-status",
|
|
9415
|
+
children: status
|
|
9416
|
+
}) : null,
|
|
9417
|
+
kpis != null ? /* @__PURE__ */ jsx("div", {
|
|
9418
|
+
className: "ui-console-kpis",
|
|
9419
|
+
children: kpis
|
|
9420
|
+
}) : null,
|
|
9421
|
+
clock != null ? /* @__PURE__ */ jsx("span", {
|
|
9422
|
+
className: "ui-console-clock",
|
|
9423
|
+
children: clock
|
|
9424
|
+
}) : null,
|
|
9425
|
+
fullscreen && canFull && !phone ? /* @__PURE__ */ jsx(IconButton, {
|
|
9426
|
+
label: full ? tr("離開全螢幕") : tr("全螢幕"),
|
|
9427
|
+
icon: full ? "corners-in" : "corners-out",
|
|
9428
|
+
onClick: toggleFull
|
|
9429
|
+
}) : null
|
|
9430
|
+
]
|
|
9431
|
+
})]
|
|
9432
|
+
});
|
|
9433
|
+
return /* @__PURE__ */ jsx("div", {
|
|
9434
|
+
ref,
|
|
9435
|
+
className: cx("ui-console", phone && "is-stacked", className),
|
|
9436
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
9437
|
+
className: "ui-console-frame",
|
|
9438
|
+
style: frameStyle,
|
|
9439
|
+
children: [
|
|
9440
|
+
top,
|
|
9441
|
+
/* @__PURE__ */ jsx("main", {
|
|
9442
|
+
className: "ui-console-main",
|
|
9443
|
+
children: main
|
|
9444
|
+
}),
|
|
9445
|
+
phone ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
9446
|
+
side,
|
|
9447
|
+
bottom,
|
|
9448
|
+
shown.map((x) => /* @__PURE__ */ jsx(React.Fragment, { children: x.node }, x.id))
|
|
9449
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("aside", {
|
|
9450
|
+
className: "ui-console-side",
|
|
9451
|
+
"aria-label": tr("側欄"),
|
|
9452
|
+
children: [side, shown.map((x) => /* @__PURE__ */ jsx(React.Fragment, { children: x.node }, x.id))]
|
|
9453
|
+
}), bottom != null ? /* @__PURE__ */ jsx("div", {
|
|
9454
|
+
className: "ui-console-bottom",
|
|
9455
|
+
children: bottom
|
|
9456
|
+
}) : null] })
|
|
9457
|
+
]
|
|
9458
|
+
})
|
|
9459
|
+
});
|
|
9460
|
+
}
|
|
9326
9461
|
// src/components/TimeControl/TimeControl.tsx
|
|
9327
9462
|
/** The clock of a monitoring screen with replay: the time in 28 px Geist Mono, two lines on what is on show, and
|
|
9328
9463
|
* 「回放」 (「停止回放」 while replaying) and 「回到現在」. Laid out as a column for a 400 px side panel. Moving within
|
|
@@ -10252,7 +10387,7 @@ function SegmentedControl({ items, value, onChange, label, iconOnly = false, cla
|
|
|
10252
10387
|
}
|
|
10253
10388
|
// src/components/Tag/Tag.tsx
|
|
10254
10389
|
/** What kind of thing an item is (「外部」「範本」): small gray text. Status uses Badge instead. Two kinds say where
|
|
10255
|
-
* numbers come from, with an icon and
|
|
10390
|
+
* numbers come from, with an icon and no fill: forecast and demo. */
|
|
10256
10391
|
function Tag({ children, variant = "plain", className }) {
|
|
10257
10392
|
return /* @__PURE__ */ jsxs("span", {
|
|
10258
10393
|
className: cx("ui-tag", variant !== "plain" && "is-" + variant, className),
|
|
@@ -12577,6 +12712,6 @@ function Workbench({ ref, ...p }) {
|
|
|
12577
12712
|
})
|
|
12578
12713
|
});
|
|
12579
12714
|
}
|
|
12580
|
-
export { AccentPicker, ActionBar, AiMark, Alert, AppShell, Badge, BarChart, Breadcrumb, Button, Calendar, Card, Checkbox, CodeText, CodeView, CommandPalette, DangerZone, DataTable, DatePicker, DateRangePicker, DetailList, Dialog, Drawer, EmptyState, ErrorPage, EventTimeline, FileUpload, FormGrid, GraphDefs, GraphLegend, Grid, Icon, IconButton, InlineCode, KpiCard, LayerGraph, LineChart, LoadingBar, LoginCard, MOTION, Markdown, Menu, Meter, MobileTabBar, MultiSelect, NotificationBell, Page, Popover, ProgressBar, ProgressRing, ProjectSwitcher, RadioGroup, SearchField, Section, SectionGroup, SectionGroupToggle, SegmentedControl, Select, SettingsLayout, SettingsSection, SideNav, Skeleton, SplitPane, StatusBand, StatusLegend, Suggestion, Switch, Tabs, Tag, Term, TextArea, TextField, ThemePicker, TimeControl, Toast, Tooltip, TopBar, Tour, TreeList, Workbench, ZoneMap, addMessages, announce, divergeToken, focusMain, format, heatToken, icons, initTheme, isCodeRef, safeHref, setAccent, setLocale, setTheme, tr as t, textOn, useTour, useWorkbench };
|
|
12715
|
+
export { AccentPicker, ActionBar, AiMark, Alert, AppShell, Badge, BarChart, Breadcrumb, Button, Calendar, Card, Checkbox, CodeText, CodeView, CommandPalette, ConsoleLayout, DangerZone, DataTable, DatePicker, DateRangePicker, DetailList, Dialog, Drawer, EmptyState, ErrorPage, EventTimeline, FileUpload, FormGrid, GraphDefs, GraphLegend, Grid, Icon, IconButton, InlineCode, KpiCard, LayerGraph, LineChart, LoadingBar, LoginCard, MOTION, Markdown, Menu, Meter, MobileTabBar, MultiSelect, NotificationBell, Page, Popover, ProgressBar, ProgressRing, ProjectSwitcher, RadioGroup, SearchField, Section, SectionGroup, SectionGroupToggle, SegmentedControl, Select, SettingsLayout, SettingsSection, SideNav, Skeleton, SplitPane, StatusBand, StatusLegend, Suggestion, Switch, Tabs, Tag, Term, TextArea, TextField, ThemePicker, TimeControl, Toast, Tooltip, TopBar, Tour, TreeList, Workbench, ZoneMap, addMessages, announce, consoleZoom, divergeToken, focusMain, format, heatToken, icons, initTheme, isCodeRef, safeHref, setAccent, setLocale, setTheme, tr as t, textOn, useTour, useWorkbench };
|
|
12581
12716
|
|
|
12582
12717
|
//# sourceMappingURL=index.js.map
|