@seanyeh77/ui 0.45.0 → 0.47.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.
Files changed (210) hide show
  1. package/dist/bundle.js +19 -19
  2. package/dist/components/Alert/Alert.d.ts +2 -1
  3. package/dist/components/Alert/Alert.js +15 -17
  4. package/dist/components/Alert/Alert.js.map +1 -1
  5. package/dist/components/AppShell/AppShell.d.ts +3 -3
  6. package/dist/components/AppShell/AppShell.js +9 -10
  7. package/dist/components/AppShell/AppShell.js.map +1 -1
  8. package/dist/components/Badge/Badge.d.ts +4 -4
  9. package/dist/components/Badge/Badge.js +7 -1
  10. package/dist/components/Badge/Badge.js.map +1 -1
  11. package/dist/components/Breadcrumb/Breadcrumb.js +1 -0
  12. package/dist/components/Breadcrumb/Breadcrumb.js.map +1 -1
  13. package/dist/components/Calendar/Calendar.js +6 -2
  14. package/dist/components/Calendar/Calendar.js.map +1 -1
  15. package/dist/components/ConsoleLayout/ConsoleLayout.js +15 -12
  16. package/dist/components/ConsoleLayout/ConsoleLayout.js.map +1 -1
  17. package/dist/components/DataTable/DataTable.d.ts +8 -0
  18. package/dist/components/DataTable/DataTable.js +188 -34
  19. package/dist/components/DataTable/DataTable.js.map +1 -1
  20. package/dist/components/DataTable/filters.js +10 -4
  21. package/dist/components/DataTable/filters.js.map +1 -1
  22. package/dist/components/DatePicker/DatePicker.js +1 -0
  23. package/dist/components/DatePicker/DatePicker.js.map +1 -1
  24. package/dist/components/DateRangePicker/DateRangePicker.js +1 -0
  25. package/dist/components/DateRangePicker/DateRangePicker.js.map +1 -1
  26. package/dist/components/DetailList/DetailList.d.ts +8 -1
  27. package/dist/components/DetailList/DetailList.js +16 -2
  28. package/dist/components/DetailList/DetailList.js.map +1 -1
  29. package/dist/components/EmptyState/EmptyState.js +19 -1
  30. package/dist/components/EmptyState/EmptyState.js.map +1 -1
  31. package/dist/components/EventTimeline/EventTimeline.js +6 -3
  32. package/dist/components/EventTimeline/EventTimeline.js.map +1 -1
  33. package/dist/components/FileUpload/FileUpload.js +2 -2
  34. package/dist/components/FileUpload/FileUpload.js.map +1 -1
  35. package/dist/components/Grid/Grid.d.ts +5 -2
  36. package/dist/components/Grid/Grid.js +4 -3
  37. package/dist/components/Grid/Grid.js.map +1 -1
  38. package/dist/components/InlineCode/InlineCode.js +7 -6
  39. package/dist/components/InlineCode/InlineCode.js.map +1 -1
  40. package/dist/components/KpiCard/KpiCard.d.ts +6 -4
  41. package/dist/components/KpiCard/KpiCard.js +6 -12
  42. package/dist/components/KpiCard/KpiCard.js.map +1 -1
  43. package/dist/components/LayerGraph/LayerGraph.js +47 -13
  44. package/dist/components/LayerGraph/LayerGraph.js.map +1 -1
  45. package/dist/components/MultiSelect/MultiSelect.js +73 -45
  46. package/dist/components/MultiSelect/MultiSelect.js.map +1 -1
  47. package/dist/components/NotificationBell/NotificationBell.d.ts +6 -3
  48. package/dist/components/NotificationBell/NotificationBell.js +14 -3
  49. package/dist/components/NotificationBell/NotificationBell.js.map +1 -1
  50. package/dist/components/PageHeader/PageHeader.d.ts +3 -2
  51. package/dist/components/PageHeader/PageHeader.js +10 -1
  52. package/dist/components/PageHeader/PageHeader.js.map +1 -1
  53. package/dist/components/RelativeTime/RelativeTime.js +4 -3
  54. package/dist/components/RelativeTime/RelativeTime.js.map +1 -1
  55. package/dist/components/Select/Select.js +1 -1
  56. package/dist/components/Select/Select.js.map +1 -1
  57. package/dist/components/SettingsLayout/SettingsLayout.d.ts +6 -4
  58. package/dist/components/SettingsLayout/SettingsLayout.js +38 -11
  59. package/dist/components/SettingsLayout/SettingsLayout.js.map +1 -1
  60. package/dist/components/SideNav/SideNav.d.ts +10 -5
  61. package/dist/components/SideNav/SideNav.js +10 -6
  62. package/dist/components/SideNav/SideNav.js.map +1 -1
  63. package/dist/components/SplitPane/SplitPane.d.ts +2 -2
  64. package/dist/components/SplitPane/SplitPane.js +29 -9
  65. package/dist/components/SplitPane/SplitPane.js.map +1 -1
  66. package/dist/components/TextField/TextField.d.ts +8 -2
  67. package/dist/components/TextField/TextField.js +59 -13
  68. package/dist/components/TextField/TextField.js.map +1 -1
  69. package/dist/components/TopBar/TopBar.d.ts +2 -2
  70. package/dist/components/TopBar/TopBar.js.map +1 -1
  71. package/dist/components/Workbench/Workbench.d.ts +8 -5
  72. package/dist/components/Workbench/Workbench.js +184 -157
  73. package/dist/components/Workbench/Workbench.js.map +1 -1
  74. package/dist/components/ZoneMap/ZoneMap.js +4 -4
  75. package/dist/components/ZoneMap/ZoneMap.js.map +1 -1
  76. package/dist/components/useFormErrors/useFormErrors.d.ts +5 -2
  77. package/dist/components/useFormErrors/useFormErrors.js +10 -4
  78. package/dist/components/useFormErrors/useFormErrors.js.map +1 -1
  79. package/dist/css/AccentPicker.css +19 -0
  80. package/dist/css/Alert.css +30 -7
  81. package/dist/css/AppShell.css +12 -0
  82. package/dist/css/Calendar.css +7 -0
  83. package/dist/css/ConsoleLayout.css +3 -0
  84. package/dist/css/DataTable.css +70 -8
  85. package/dist/css/DetailList.css +11 -0
  86. package/dist/css/EmptyState.css +8 -0
  87. package/dist/css/EventTimeline.css +11 -4
  88. package/dist/css/Grid.css +15 -0
  89. package/dist/css/KpiCard.css +1 -0
  90. package/dist/css/LayerGraph.css +1 -1
  91. package/dist/css/LoadingBar.css +4 -1
  92. package/dist/css/LoginCard.css +1 -1
  93. package/dist/css/MobileTabBar.css +6 -4
  94. package/dist/css/MultiSelect.css +23 -3
  95. package/dist/css/Select.css +9 -0
  96. package/dist/css/SettingsLayout.css +29 -14
  97. package/dist/css/Tabs.css +36 -17
  98. package/dist/css/Toast.css +7 -0
  99. package/dist/css/TopBar.css +6 -3
  100. package/dist/css/Workbench.css +10 -5
  101. package/dist/css/base.css +90 -3
  102. package/dist/css/end.css +5 -2
  103. package/dist/fonts-latin.css +2 -0
  104. package/dist/fonts-tc.css +2 -0
  105. package/dist/format.d.ts +4 -3
  106. package/dist/format.js +13 -12
  107. package/dist/format.js.map +1 -1
  108. package/dist/i18n.js +17 -6
  109. package/dist/i18n.js.map +1 -1
  110. package/dist/icons/Icon.d.ts +2 -1
  111. package/dist/icons/Icon.js +4 -3
  112. package/dist/icons/Icon.js.map +1 -1
  113. package/dist/icons/all.js +23 -1
  114. package/dist/icons/all.js.map +1 -1
  115. package/dist/icons/names.d.ts +22 -0
  116. package/dist/icons/names.js +11 -0
  117. package/dist/icons/names.js.map +1 -1
  118. package/dist/icons/ph/credit-card.d.ts +10 -0
  119. package/dist/icons/ph/credit-card.js +11 -0
  120. package/dist/icons/ph/credit-card.js.map +1 -0
  121. package/dist/icons/ph/map-pin.d.ts +10 -0
  122. package/dist/icons/ph/map-pin.js +11 -0
  123. package/dist/icons/ph/map-pin.js.map +1 -0
  124. package/dist/icons/ph/package.d.ts +10 -0
  125. package/dist/icons/ph/package.js +11 -0
  126. package/dist/icons/ph/package.js.map +1 -0
  127. package/dist/icons/ph/pause.d.ts +10 -0
  128. package/dist/icons/ph/pause.js +11 -0
  129. package/dist/icons/ph/pause.js.map +1 -0
  130. package/dist/icons/ph/phone.d.ts +10 -0
  131. package/dist/icons/ph/phone.js +11 -0
  132. package/dist/icons/ph/phone.js.map +1 -0
  133. package/dist/icons/ph/play.d.ts +10 -0
  134. package/dist/icons/ph/play.js +11 -0
  135. package/dist/icons/ph/play.js.map +1 -0
  136. package/dist/icons/ph/prohibit.d.ts +10 -0
  137. package/dist/icons/ph/prohibit.js +11 -0
  138. package/dist/icons/ph/prohibit.js.map +1 -0
  139. package/dist/icons/ph/receipt.d.ts +10 -0
  140. package/dist/icons/ph/receipt.js +11 -0
  141. package/dist/icons/ph/receipt.js.map +1 -0
  142. package/dist/icons/ph/shopping-cart.d.ts +10 -0
  143. package/dist/icons/ph/shopping-cart.js +11 -0
  144. package/dist/icons/ph/shopping-cart.js.map +1 -0
  145. package/dist/icons/ph/storefront.d.ts +10 -0
  146. package/dist/icons/ph/storefront.js +11 -0
  147. package/dist/icons/ph/storefront.js.map +1 -0
  148. package/dist/icons/ph/truck.d.ts +10 -0
  149. package/dist/icons/ph/truck.js +11 -0
  150. package/dist/icons/ph/truck.js.map +1 -0
  151. package/dist/icons/store.d.ts +3 -1
  152. package/dist/icons/store.js +17 -12
  153. package/dist/icons/store.js.map +1 -1
  154. package/dist/index.d.ts +2 -2
  155. package/dist/index.js +2 -2
  156. package/dist/internal/FloatingPanel.js +5 -2
  157. package/dist/internal/FloatingPanel.js.map +1 -1
  158. package/dist/internal/clickSteps.js +11 -0
  159. package/dist/internal/clickSteps.js.map +1 -0
  160. package/dist/internal/util.js +7 -1
  161. package/dist/internal/util.js.map +1 -1
  162. package/dist/styles.css +499 -162
  163. package/dist/theme.d.ts +7 -0
  164. package/dist/theme.js +39 -15
  165. package/dist/theme.js.map +1 -1
  166. package/docs/Alert.md +1 -1
  167. package/docs/AppShell.md +4 -4
  168. package/docs/Badge.md +2 -1
  169. package/docs/BarChart.md +1 -1
  170. package/docs/Checkbox.md +2 -2
  171. package/docs/CodeView.md +12 -22
  172. package/docs/ConsoleLayout.md +1 -0
  173. package/docs/DataTable.md +16 -11
  174. package/docs/DatePicker.md +1 -1
  175. package/docs/DateRangePicker.md +1 -0
  176. package/docs/DetailList.md +12 -1
  177. package/docs/Drawer.md +1 -1
  178. package/docs/EmptyState.md +1 -0
  179. package/docs/EventTimeline.md +1 -1
  180. package/docs/Format.md +2 -1
  181. package/docs/Graph.md +1 -0
  182. package/docs/Grid.md +9 -0
  183. package/docs/KpiCard.md +5 -4
  184. package/docs/LoadingBar.md +1 -1
  185. package/docs/LoginCard.md +1 -1
  186. package/docs/Markdown.md +4 -37
  187. package/docs/MobileTabBar.md +1 -1
  188. package/docs/MultiSelect.md +3 -2
  189. package/docs/NotificationBell.md +2 -2
  190. package/docs/PageHeader.md +2 -1
  191. package/docs/RadioGroup.md +1 -1
  192. package/docs/RelativeTime.md +2 -2
  193. package/docs/SettingsLayout.md +5 -4
  194. package/docs/SideNav.md +2 -1
  195. package/docs/Skeleton.md +2 -2
  196. package/docs/SplitPane.md +3 -9
  197. package/docs/Tabs.md +14 -11
  198. package/docs/Tag.md +4 -3
  199. package/docs/TextField.md +2 -0
  200. package/docs/Toast.md +1 -1
  201. package/docs/TopBar.md +2 -2
  202. package/docs/Workbench.md +9 -6
  203. package/docs/agents.md +13 -13
  204. package/docs/data.md +2 -1
  205. package/docs/guidelines.md +4 -4
  206. package/docs/icons.md +2 -2
  207. package/docs/layout.md +3 -3
  208. package/docs/theme.md +6 -3
  209. package/docs/useFormErrors.md +2 -1
  210. package/package.json +4 -2
@@ -46,14 +46,18 @@
46
46
  max-width: 45%;
47
47
  }
48
48
  }
49
- /* tags: right after the title, the title's size (a Tag with an icon takes the size of the text beside it). */
49
+ /* tags: right after the title, small and muted (12 px, ink-muted, semibold) so they never read as part of the title;
50
+ a Tag with an icon takes this size, a tone keeps its own color. */
50
51
  .ui-topbar-tags {
51
52
  flex: 0 0 auto;
52
53
  display: flex;
53
54
  align-items: center;
54
55
  gap: var(--space-2);
55
56
  margin-left: calc(var(--space-2) - var(--space-4));
56
- font-size: var(--text-h4);
57
+ color: var(--ink-muted);
58
+ font-size: var(--text-mini);
59
+ font-weight: 600;
60
+ line-height: 1.4;
57
61
  white-space: nowrap;
58
62
  }
59
63
  .ui-search {
@@ -87,7 +91,6 @@
87
91
  }
88
92
  .ui-topbar-tags {
89
93
  margin-left: 0;
90
- font-size: inherit;
91
94
  }
92
95
  .ui-topbar .ui-search {
93
96
  display: none;
@@ -51,6 +51,11 @@
51
51
  position: relative;
52
52
  display: inline-flex;
53
53
  }
54
+ .ui-wb-title {
55
+ display: flex;
56
+ margin: 0;
57
+ font: inherit;
58
+ }
54
59
  .ui-wb-brand {
55
60
  flex: none;
56
61
  display: inline-flex;
@@ -106,6 +111,10 @@
106
111
  flex: 1 1 auto;
107
112
  min-height: 0;
108
113
  }
114
+ /* The main landmark: no box of its own, the bar and the view inside are laid out against the body. */
115
+ .ui-wb-mainwrap {
116
+ display: contents;
117
+ }
109
118
  .ui-wb-main {
110
119
  position: absolute;
111
120
  top: 0;
@@ -302,13 +311,9 @@
302
311
  margin-left: -4px;
303
312
  cursor: col-resize;
304
313
  }
305
- .ui-wb-split.is-v[style*='right'] {
306
- margin-left: 0;
307
- margin-right: -4px;
308
- }
309
314
  .ui-wb-split.is-h {
310
315
  height: 8px;
311
- margin-bottom: -4px;
316
+ margin-top: -4px;
312
317
  cursor: row-resize;
313
318
  }
314
319
  .ui-wb-split-line {
package/dist/css/base.css CHANGED
@@ -179,11 +179,22 @@ html.ui-theme-fade * {
179
179
  .ui-req {
180
180
  color: var(--danger-text);
181
181
  }
182
+ /* As wide as the box and its text (max-content, up to the container, then the text wraps): the focus outline and the
183
+ click area wrap the control, not the whole row, as on Switch. Still a block, so each sits on its own line. */
182
184
  .ui-check,
183
185
  .ui-radio {
184
- display: flex;
185
- align-items: center;
186
- gap: 12px;
186
+ /* A grid, not a flex row: the box sits on the first line of a label that wraps (align-items: start, see the box's
187
+ margin), while one line stays centred in the 40 px height (align-content: center). */
188
+ display: grid;
189
+ grid-template-columns: auto;
190
+ grid-auto-flow: column;
191
+ grid-auto-columns: minmax(0, max-content);
192
+ width: max-content;
193
+ max-width: 100%;
194
+ justify-content: start;
195
+ align-items: start;
196
+ align-content: center;
197
+ column-gap: 12px;
187
198
  min-height: var(--control-height);
188
199
  padding: 0;
189
200
  border: 0;
@@ -194,6 +205,11 @@ html.ui-theme-fade * {
194
205
  text-align: left;
195
206
  cursor: pointer;
196
207
  }
208
+ .ui-check > .ui-check-box,
209
+ .ui-radio > .ui-radio-ring {
210
+ /* Centred on the first line of the label. */
211
+ margin-top: calc((1lh - 22px) / 2);
212
+ }
197
213
  .ui-check:disabled,
198
214
  .ui-radio:disabled {
199
215
  color: var(--ink-muted);
@@ -282,6 +298,77 @@ html.ui-theme-fade * {
282
298
  label:has(> .ui-switch) {
283
299
  font-size: var(--text-control);
284
300
  }
301
+ /* TextField with prefix, suffix or unit: the box draws the border (like the password field) and the input inside is
302
+ bare, so the muted text sits inside the same frame. */
303
+ .ui-field-box.has-affix {
304
+ display: flex;
305
+ align-items: center;
306
+ gap: var(--space-2);
307
+ height: var(--control-height);
308
+ box-sizing: border-box;
309
+ padding: 0 var(--space-3);
310
+ /* The frame is an inset shadow, not a border, so the input inside is the full 40 px (48 px on phones) tall: the
311
+ whole box is its touch target. */
312
+ box-shadow: inset 0 0 0 1px var(--line-strong);
313
+ border-radius: var(--radius-md);
314
+ background: var(--surface-input);
315
+ color: var(--ink);
316
+ }
317
+ .ui-field-box.has-affix .ui-input {
318
+ flex: 1 1 auto;
319
+ min-width: 0;
320
+ height: 100%;
321
+ padding: 0;
322
+ border: 0;
323
+ border-radius: 0;
324
+ background: transparent;
325
+ }
326
+ .ui-field-box.has-affix .ui-input:focus-visible {
327
+ outline: none;
328
+ }
329
+ .has-error .ui-field-box.has-affix {
330
+ box-shadow: inset 0 0 0 1.5px var(--danger);
331
+ }
332
+ .is-disabled .ui-field-box.has-affix {
333
+ box-shadow: none;
334
+ background: var(--surface-sub);
335
+ color: var(--ink-muted);
336
+ }
337
+ .ui-field-affix {
338
+ flex: none;
339
+ color: var(--ink-muted);
340
+ font-size: var(--text-control);
341
+ white-space: nowrap;
342
+ }
343
+ /* The unit after the typed text: an invisible copy of the text, on top of the input, pushes it along. */
344
+ .ui-field-unitwrap {
345
+ flex: 1 1 auto;
346
+ min-width: 0;
347
+ height: 100%;
348
+ display: grid;
349
+ }
350
+ .ui-field-unitwrap > * {
351
+ grid-area: 1 / 1;
352
+ }
353
+ .ui-field-unitline {
354
+ display: flex;
355
+ align-items: center;
356
+ overflow: hidden;
357
+ font-size: var(--text-control);
358
+ white-space: pre;
359
+ pointer-events: none;
360
+ }
361
+ .ui-field-mirror {
362
+ visibility: hidden;
363
+ min-width: 0;
364
+ overflow: hidden;
365
+ }
366
+ /* Forced colors drop shadows: the frame becomes a border. */
367
+ @media (forced-colors: active) {
368
+ .ui-field-box.has-affix {
369
+ border: 1px solid CanvasText;
370
+ }
371
+ }
285
372
  @keyframes ui-rise {
286
373
  from {
287
374
  opacity: 0;
package/dist/css/end.css CHANGED
@@ -82,6 +82,7 @@
82
82
  margin: -1px;
83
83
  overflow: hidden;
84
84
  clip: rect(0 0 0 0);
85
+ clip-path: inset(50%);
85
86
  white-space: nowrap;
86
87
  border: 0;
87
88
  }
@@ -172,13 +173,14 @@
172
173
  .ui-input,
173
174
  .ui-select-trigger,
174
175
  .ui-datefield,
175
- .ui-pwfield {
176
+ .ui-pwfield,
177
+ .ui-field-box.has-affix {
176
178
  height: var(--touch-target);
177
179
  }
178
180
  }
179
181
  @media (max-width: 599px) {
180
182
  .ui-ms {
181
- min-height: var(--touch-target);
183
+ height: var(--touch-target);
182
184
  }
183
185
  }
184
186
  @media (max-width: 599px) {
@@ -254,6 +256,7 @@
254
256
  .ui-cal-day:focus-visible,
255
257
  .ui-ms:focus-within,
256
258
  .ui-pwfield:focus-within,
259
+ .ui-field-box.has-affix:focus-within,
257
260
  .ui-dt-opt:focus-visible,
258
261
  .ui-code.is-link:focus-visible,
259
262
  .ui-code.is-link.is-name:focus-visible,
@@ -0,0 +1,2 @@
1
+ /* @seanyeh77/ui/fonts-latin.css: Inter and Geist Mono of @seanyeh77/tokens (a dependency of @seanyeh77/ui). */
2
+ @import '@seanyeh77/tokens/fonts-latin.css';
@@ -0,0 +1,2 @@
1
+ /* @seanyeh77/ui/fonts-tc.css: Noto Sans TC of @seanyeh77/tokens (a dependency of @seanyeh77/ui). */
2
+ @import '@seanyeh77/tokens/fonts-tc.css';
package/dist/format.d.ts CHANGED
@@ -12,7 +12,8 @@ declare function dateTime(d: Date | null | undefined, o?: {
12
12
  }): string;
13
13
  /** Under 1 hour: 「現在」 or 「5 分鐘前」. The same calendar day: 「2 小時前」. An earlier day: by calendar days, 「昨天」
14
14
  * for any time yesterday (also 30 minutes before midnight seen after it, once an hour has passed), 「3 天前」 up to 6
15
- * days. 7 calendar days or more, or in the future: the full date and time. Pass now to test. */
15
+ * days. 7 calendar days or more, or more than 60 s in the future: the full date and time. Up to 60 s in the future (one
16
+ * clock running a little ahead of the other) reads like the last minute. Pass now to test. */
16
17
  declare function relative(d: Date | null | undefined, now?: Date): string;
17
18
  declare function month(d: Date): string;
18
19
  /** Week starts on Sunday for zh-TW; other locales use Intl's week info when the browser has it. */
@@ -25,13 +26,13 @@ declare function percent(v: number, dec?: number): string;
25
26
  /** Only KPI cards abbreviate: 1,284 萬 in zh-TW (萬、億), 12.8M in English.
26
27
  * like: format v with the unit and decimals that `like` gets, so a counting KPI keeps its width. */
27
28
  declare function compact(v: number, like?: number): string;
28
- /** zh-TW with TWD: NT$ 1,280, negatives -NT$ 1,280. Other locales and currencies: Intl's own symbol and order. */
29
+ /** zh-TW with TWD: NT$ 1,280 (a no-break space after NT$), negatives -NT$ 1,280. Other locales and currencies: Intl's own symbol and order. */
29
30
  declare function money(v: number, o?: {
30
31
  currency?: string;
31
32
  compact?: boolean;
32
33
  like?: number;
33
34
  }): string;
34
- /** Bytes to 「186 KB」「54.9 MB」「1.2 GB」. */
35
+ /** Bytes to 「186 KB」「54.9 MB」「1.2 GB」, with a no-break space (U+00A0) so the unit never wraps away. */
35
36
  export declare function fileSize(b: number | null | undefined): string;
36
37
  /** Seconds as a clock-style length: under 1 h 「46:42」「1:30」 (minutes not zero-padded), 1 h or more 「1:54:49」.
37
38
  * Rounded to the second. Negative, NaN or missing: 「—」. */
package/dist/format.js CHANGED
@@ -52,14 +52,15 @@ function dayDiff(d, now) {
52
52
  }
53
53
  /** Under 1 hour: 「現在」 or 「5 分鐘前」. The same calendar day: 「2 小時前」. An earlier day: by calendar days, 「昨天」
54
54
  * for any time yesterday (also 30 minutes before midnight seen after it, once an hour has passed), 「3 天前」 up to 6
55
- * days. 7 calendar days or more, or in the future: the full date and time. Pass now to test. */
55
+ * days. 7 calendar days or more, or more than 60 s in the future: the full date and time. Up to 60 s in the future (one
56
+ * clock running a little ahead of the other) reads like the last minute. Pass now to test. */
56
57
  function relative(d, now = /* @__PURE__ */ new Date()) {
57
58
  if (!d) return "";
58
59
  const s = (now.getTime() - d.getTime()) / 1e3;
59
60
  const days = dayDiff(d, now);
60
- if (s < 0 || days >= 7) return dateTime(d);
61
61
  const rt = new Intl.RelativeTimeFormat(I18N.locale, { numeric: "auto" });
62
- if (s < 60) return rt.format(0, "second");
62
+ if (s >= -60 && s < 60) return rt.format(0, "second");
63
+ if (s < 0 || days >= 7) return dateTime(d);
63
64
  if (s < 3600) return rt.format(-Math.floor(s / 60), "minute");
64
65
  if (days === 0) return rt.format(-Math.floor(s / 3600), "hour");
65
66
  return rt.format(-days, "day");
@@ -119,12 +120,12 @@ function compact(v, like) {
119
120
  ];
120
121
  const finalStr = new Intl.NumberFormat(I18N.locale, { maximumFractionDigits: maxDec }).format(a / div);
121
122
  const sign = v < 0 ? "-" : "";
122
- if (like === void 0) return `${sign}${finalStr} ${unit}`;
123
+ if (like === void 0) return `${sign}${finalStr}\u00a0${unit}`;
123
124
  const digits = (finalStr.split(".")[1] || "").length;
124
125
  return `${sign}${new Intl.NumberFormat(I18N.locale, {
125
126
  minimumFractionDigits: digits,
126
127
  maximumFractionDigits: digits
127
- }).format(Math.abs(v) / div)} ${unit}`;
128
+ }).format(Math.abs(v) / div)}\u00a0${unit}`;
128
129
  }
129
130
  const nf = new Intl.NumberFormat(I18N.locale, {
130
131
  notation: "compact",
@@ -157,12 +158,12 @@ function compact(v, like) {
157
158
  }).join("");
158
159
  return (v < 0 && ref >= 0 ? "-" : "") + body;
159
160
  }
160
- /** zh-TW with TWD: NT$ 1,280, negatives -NT$ 1,280. Other locales and currencies: Intl's own symbol and order. */
161
+ /** zh-TW with TWD: NT$ 1,280 (a no-break space after NT$), negatives -NT$ 1,280. Other locales and currencies: Intl's own symbol and order. */
161
162
  function money(v, o = {}) {
162
163
  const cur = o.currency || I18N.currency;
163
164
  const body = o.compact ? compact(Math.abs(v), o.like !== void 0 ? Math.abs(o.like) : void 0) : number(Math.abs(v), "money");
164
- if (isZhTW() && cur === "TWD") return `${v < 0 ? "-" : ""}NT$ ${body}`;
165
- if (o.compact) return `${v < 0 ? "-" : ""}${body} ${cur}`;
165
+ if (isZhTW() && cur === "TWD") return `${v < 0 ? "-" : ""}NT$\u00a0${body}`;
166
+ if (o.compact) return `${v < 0 ? "-" : ""}${body}\u00a0${cur}`;
166
167
  return new Intl.NumberFormat(I18N.locale, {
167
168
  style: "currency",
168
169
  currency: cur,
@@ -171,12 +172,12 @@ function money(v, o = {}) {
171
172
  maximumFractionDigits: cur === "TWD" || cur === "JPY" ? 0 : 2
172
173
  }).format(v);
173
174
  }
174
- /** Bytes to 「186 KB」「54.9 MB」「1.2 GB」. */
175
+ /** Bytes to 「186 KB」「54.9 MB」「1.2 GB」, with a no-break space (U+00A0) so the unit never wraps away. */
175
176
  function fileSize(b) {
176
177
  if (b == null || Number.isNaN(b)) return "";
177
- if (Math.round(b / 1024) < 1024) return number(b === 0 ? 0 : Math.max(1, Math.round(b / 1024))) + " KB";
178
- if (Math.round(b / 1048576 * 10) < 10240) return number(b / 1048576, 1) + " MB";
179
- return number(b / 1073741824, 1) + " GB";
178
+ if (Math.round(b / 1024) < 1024) return number(b === 0 ? 0 : Math.max(1, Math.round(b / 1024))) + "\xA0KB";
179
+ if (Math.round(b / 1048576 * 10) < 10240) return number(b / 1048576, 1) + "\xA0MB";
180
+ return number(b / 1073741824, 1) + "\xA0GB";
180
181
  }
181
182
  /** Seconds as a clock-style length: under 1 h 「46:42」「1:30」 (minutes not zero-padded), 1 h or more 「1:54:49」.
182
183
  * Rounded to the second. Negative, NaN or missing: 「—」. */
@@ -1 +1 @@
1
- {"version":3,"file":"format.js","names":[],"sources":["../src/format.ts"],"sourcesContent":["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 if (!d) return '';\n // zh-TW: the full-width 「)」 already leaves half a character of room, so no space after it: 2026/11/04(三)13:00.\n const day = date(d, o);\n return isZhTW() && day.endsWith(')') ? day + time(d) : `${day} ${time(d)}`;\n}\n\n/** Whole local calendar days from d to now: 1 for any time yesterday, whatever the hour. */\nfunction dayDiff(d: Date, now: Date): number {\n // Through UTC dates of the local day, so a 23-hour or 25-hour day (daylight saving) still counts as one.\n const day = (x: Date) => Date.UTC(x.getFullYear(), x.getMonth(), x.getDate());\n return Math.round((day(now) - day(d)) / 86400000);\n}\n\n/** Under 1 hour: 「現在」 or 「5 分鐘前」. The same calendar day: 「2 小時前」. An earlier day: by calendar days, 「昨天」\n * for any time yesterday (also 30 minutes before midnight seen after it, once an hour has passed), 「3 天前」 up to 6\n * days. 7 calendar days or more, or in the future: the 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 const days = dayDiff(d, now);\n if (s < 0 || days >= 7) 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 (days === 0) return rt.format(-Math.floor(s / 3600), 'hour');\n return rt.format(-days, '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 // 99,999,999 rounds to 10,000.0 萬: write it as 1 億.\n const [unit, div, maxDec] = Math.round(a / 1e3) >= 1e5 ? (['億', 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 // narrowSymbol writes TWD as a bare 「$」, which reads as dollars: keep 「NT$」 (docs: 英文介面顯示 NT$486,000).\n currencyDisplay: cur === 'TWD' ? 'symbol' : '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 // Compare after rounding: 1,048,500 bytes rounds to 1,024 KB, so it is written 「1.0 MB」.\n if (Math.round(b / 1024) < 1024) return number(b === 0 ? 0 : Math.max(1, Math.round(b / 1024))) + ' KB';\n if (Math.round((b / 1048576) * 10) < 10240) return number(b / 1048576, 1) + ' MB';\n return number(b / 1073741824, 1) + ' GB';\n}\n\n/** Seconds as a clock-style length: under 1 h 「46:42」「1:30」 (minutes not zero-padded), 1 h or more 「1:54:49」.\n * Rounded to the second. Negative, NaN or missing: 「—」. */\nfunction duration(seconds: number | null | undefined): string {\n if (seconds == null || Number.isNaN(seconds) || seconds < 0 || !Number.isFinite(seconds)) return '—';\n const t = Math.round(seconds);\n const h = Math.floor(t / 3600);\n const m = Math.floor((t % 3600) / 60);\n const s = t % 60;\n return h ? `${h}:${pad2(m)}:${pad2(s)}` : `${m}:${pad2(s)}`;\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 duration,\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":";;AAOA,MAAM,WAAW;CAAE,OAAO;CAAG,SAAS;CAAG,MAAM;CAAG,OAAO;AAAE;AAE3D,MAAM,QAAQ,MAAsB,OAA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,QAAQ,IAAI,CAAC"}
1
+ {"version":3,"file":"format.js","names":[],"sources":["../src/format.ts"],"sourcesContent":["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 if (!d) return '';\n // zh-TW: the full-width 「)」 already leaves half a character of room, so no space after it: 2026/11/04(三)13:00.\n const day = date(d, o);\n return isZhTW() && day.endsWith(')') ? day + time(d) : `${day} ${time(d)}`;\n}\n\n/** Whole local calendar days from d to now: 1 for any time yesterday, whatever the hour. */\nfunction dayDiff(d: Date, now: Date): number {\n // Through UTC dates of the local day, so a 23-hour or 25-hour day (daylight saving) still counts as one.\n const day = (x: Date) => Date.UTC(x.getFullYear(), x.getMonth(), x.getDate());\n return Math.round((day(now) - day(d)) / 86400000);\n}\n\n/** Under 1 hour: 「現在」 or 「5 分鐘前」. The same calendar day: 「2 小時前」. An earlier day: by calendar days, 「昨天」\n * for any time yesterday (also 30 minutes before midnight seen after it, once an hour has passed), 「3 天前」 up to 6\n * days. 7 calendar days or more, or more than 60 s in the future: the full date and time. Up to 60 s in the future (one\n * clock running a little ahead of the other) reads like the last minute. 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 const days = dayDiff(d, now);\n const rt = new Intl.RelativeTimeFormat(I18N.locale, { numeric: 'auto' });\n if (s >= -60 && s < 60) return rt.format(0, 'second');\n if (s < 0 || days >= 7) return dateTime(d);\n if (s < 3600) return rt.format(-Math.floor(s / 60), 'minute');\n if (days === 0) return rt.format(-Math.floor(s / 3600), 'hour');\n return rt.format(-days, '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 // 99,999,999 rounds to 10,000.0 萬: write it as 1 億.\n const [unit, div, maxDec] = Math.round(a / 1e3) >= 1e5 ? (['億', 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}\\u00a0${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)}\\u00a0${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 (a no-break space after NT$), 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$\\u00a0${body}`;\n if (o.compact) return `${v < 0 ? '-' : ''}${body}\\u00a0${cur}`;\n return new Intl.NumberFormat(I18N.locale, {\n style: 'currency',\n currency: cur,\n // narrowSymbol writes TWD as a bare 「$」, which reads as dollars: keep 「NT$」 (docs: 英文介面顯示 NT$486,000).\n currencyDisplay: cur === 'TWD' ? 'symbol' : '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」, with a no-break space (U+00A0) so the unit never wraps away. */\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 // Compare after rounding: 1,048,500 bytes rounds to 1,024 KB, so it is written 「1.0 MB」.\n if (Math.round(b / 1024) < 1024) return number(b === 0 ? 0 : Math.max(1, Math.round(b / 1024))) + '\\u00a0KB';\n if (Math.round((b / 1048576) * 10) < 10240) return number(b / 1048576, 1) + '\\u00a0MB';\n return number(b / 1073741824, 1) + '\\u00a0GB';\n}\n\n/** Seconds as a clock-style length: under 1 h 「46:42」「1:30」 (minutes not zero-padded), 1 h or more 「1:54:49」.\n * Rounded to the second. Negative, NaN or missing: 「—」. */\nfunction duration(seconds: number | null | undefined): string {\n if (seconds == null || Number.isNaN(seconds) || seconds < 0 || !Number.isFinite(seconds)) return '—';\n const t = Math.round(seconds);\n const h = Math.floor(t / 3600);\n const m = Math.floor((t % 3600) / 60);\n const s = t % 60;\n return h ? `${h}:${pad2(m)}:${pad2(s)}` : `${m}:${pad2(s)}`;\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 duration,\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":";;AAOA,MAAM,WAAW;CAAE,OAAO;CAAG,SAAS;CAAG,MAAM;CAAG,OAAO;AAAE;AAE3D,MAAM,QAAQ,MAAsB,OAAO,CAAC,CAAC,CAAC,SAAS,GAAG,GAAG;AAE7D,SAAS,SAAiB;CACxB,OAAO,KAAK;AACd;;AAGA,SAAS,KAAK,GAA4B,IAA2C,CAAC,GAAW;CAC/F,IAAI,CAAC,GAAG,OAAO;CACf,MAAM,KAAK,EAAE,YAAY;CACzB,IAAI,EAAE,MAAM,OAAO,IAAI,KAAK,eAAe,KAAK,QAAQ;EAAE,MAAM;EAAW,OAAO;EAAQ,KAAK;EAAW,SAAS,KAAK,SAAS,KAAA;CAAU,CAAC,CAAC,CAAC,OAAO,CAAC;CACtJ,IAAI,OAAO,GAAG,OAAO,QAAQ,CAAC,KAAK,KAAK,IAAI,IAAI,KAAK,eAAe,SAAS,EAAE,SAAS,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,KAAK;CACnH,OAAO,IAAI,KAAK,eAAe,KAAK,QAAQ;EAAE,MAAM;EAAW,OAAO;EAAW,KAAK;EAAW,SAAS,KAAK,UAAU,KAAA;CAAU,CAAC,CAAC,CAAC,OAAO,CAAC;AAChJ;;AAGA,SAAS,KAAK,GAAoC;CAChD,IAAI,CAAC,GAAG,OAAO;CACf,OAAO,IAAI,KAAK,eACd,KAAK,QACL,OAAO,IAAI;EAAE,MAAM;EAAW,QAAQ;EAAW,WAAW;CAAM,IAAI;EAAE,MAAM;EAAW,QAA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OAAO;CACf,MAAM,IAAI,IAAI,KAAK,CAAC,EAAE,IAAI,CAAC,EAAE,KAAK,GAAG,CAAC,EAAE,EAAE;CAC1C,OAAO,EAAE,SAAS,MAAM,CAAC,EAAE,KAAK,IAAI,IAAI;AAC1C;AAEA,MAAa,WAAW,GAA4B,MAClD,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,YAAY,MAAM,EAAE,YAAY,KAAK,EAAE,SAAS,MAAM,EAAE,SAAS,KAAK,EAAE,QAAQ,MAAM,EAAE,QAAQ;AAElH,MAAa,UAAU,GAAS,MAAoB,IAAI,KAAK,EAAE,YAAY,GAAG,EAAE,SAAS,GAAG,EAAE,QAAQ,IAAI,CAAC"}
package/dist/i18n.js CHANGED
@@ -28,6 +28,7 @@ const I18N = {
28
28
  密碼: "Password",
29
29
  展開側邊欄: "Expand sidebar",
30
30
  "已選 {n} 筆": "{n} selected",
31
+ "已選 {n} {unit}": "{n} selected",
31
32
  帳號: "Username",
32
33
  強調色: "Accent color",
33
34
  忘記密碼: "Forgot password",
@@ -92,7 +93,7 @@ const I18N = {
92
93
  已展開: "Expanded",
93
94
  已收合: "Collapsed",
94
95
  "已展開,{n} 個子項目": "Expanded, {n} items",
95
- "顯示 {n} 筆": "Showing {n} rows",
96
+ "顯示 {n} {unit}": "Showing {n} {unit}",
96
97
  排序: "Sort",
97
98
  "排序:{list}": "Sort: {list}",
98
99
  由小到大: "ascending",
@@ -110,8 +111,8 @@ const I18N = {
110
111
  "拖曳或按 ← → 調整;按一下依序加寬,按 Enter 還原": "Drag or press Left and Right to resize; click to widen step by step, Enter to reset",
111
112
  "「{name}」欄寬 {n} px": "{name} column width {n} px",
112
113
  "已還原「{name}」欄寬": "{name} column width reset",
113
- ",改善": ", better",
114
- ",變差": ", worse",
114
+ "(改善)": " (better)",
115
+ "(變差)": " (worse)",
115
116
  長條圖: "Bar chart",
116
117
  折線圖: "Line chart",
117
118
  時間點: "Time",
@@ -166,6 +167,12 @@ const I18N = {
166
167
  表格: "Table",
167
168
  "{n} px": "{n} px",
168
169
  "主要區域 {a} px,面板 {b} px": "Main area {a} px, panel {b} px",
170
+ "面板 {n} px": "Panel {n} px",
171
+ "拖曳或按 ← → 調整;按一下切換預設寬度,按兩下或 Enter 還原": "Drag or press ← → to resize; click to step through preset widths; double-click or Enter to reset",
172
+ "拖曳或按方向鍵調整;按一下切換預設大小,按兩下還原": "Drag or press the arrow keys to resize; click to step through preset sizes; double-click to reset",
173
+ "{label} {n} px": "{label} {n} px",
174
+ "拖曳或按 ↑ ↓ 調整;按一下切換預設高度,按 Enter 還原": "Drag or press ↑ ↓ to resize; click to step through preset heights; Enter to reset",
175
+ "架構圖高度 {n} px": "Diagram height {n} px",
169
176
  外部: "External",
170
177
  詳細: "Details",
171
178
  "展開 {name}": "Expand {name}",
@@ -186,7 +193,10 @@ const I18N = {
186
193
  登入: "Sign in",
187
194
  發生錯誤: "Something went wrong",
188
195
  "移除 {name}": "Remove {name}",
189
- "第 {a}–{b} 筆,共 {n} 筆": "{a}–{b} of {n}",
196
+ "已移除 {name}": "Removed {name}",
197
+ "清除{name}": "Clear {name}",
198
+ "已清除{name}": "Cleared {name}",
199
+ "第 {a}–{b} {unit},共 {n} {unit}": "{a}–{b} of {n}",
190
200
  繼續編輯: "Keep editing",
191
201
  "自訂強調色(色碼)": "Custom accent color (hex)",
192
202
  "已達 {n} 字上限": "Reached the {n}-character limit",
@@ -267,11 +277,12 @@ const I18N = {
267
277
  完成: "Done",
268
278
  失敗: "Failed",
269
279
  已關閉: "Closed",
280
+ 已暫停: "Paused",
270
281
  在線: "Online",
271
282
  "(在新分頁開啟)": " (opens in a new tab)",
272
283
  "{lang} 程式碼": "{lang} code",
273
284
  檢視: "Views",
274
- "{n} / {total} 筆": "{n} / {total}",
285
+ "{n} {unit}": "{n} {unit}",
275
286
  "{n} / {total} {unit}": "{n} / {total} {unit}",
276
287
  "{n} / {total}": "{n} / {total}",
277
288
  "{total} {unit}中的 {n} {unit}": "{n} of {total} {unit}",
@@ -283,7 +294,7 @@ const I18N = {
283
294
  篩選: "Filter",
284
295
  最低: "Min",
285
296
  最高: "Max",
286
- "合計 {n} 筆": "Total: {n}",
297
+ "合計 {n} {unit}": "Total: {n}",
287
298
  平均: "Avg",
288
299
  "選取 {name}": "Select {name}",
289
300
  "{n} 個新": "{n} new",
package/dist/i18n.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"i18n.js","names":[],"sources":["../src/i18n.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 '{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 更多表格操作: 'More table actions',\n 還原預設: 'Restore defaults',\n 已還原預設的欄位與欄寬: 'Columns and widths restored to defaults',\n 套用的篩選: 'Applied filters',\n '移除篩選:{name}': 'Remove filter: {name}',\n '篩選,已套用 {n} 個條件': 'Filter, {n} conditions applied',\n '{name}:{value}': '{name}: {value}',\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}」第 {n} 排序': '{name}, sort level {n}',\n '拖曳,或按 Alt+↑ ↓ 調整順序': 'Drag, or press Alt+Up or Alt+Down to reorder',\n '上移「{name}」': 'Move {name} up',\n '下移「{name}」': 'Move {name} down',\n '拖曳或按 ← → 調整;按一下依序加寬,按 Enter 還原': 'Drag or press Left and Right to resize; click to widen step by step, Enter to reset',\n '「{name}」欄寬 {n} px': '{name} column width {n} px',\n '已還原「{name}」欄寬': '{name} column width reset',\n ',改善': ', better',\n ',變差': ', worse',\n 長條圖: 'Bar chart',\n 折線圖: 'Line chart',\n 時間點: 'Time',\n 數值: 'Value',\n '數值({unit})': 'Value ({unit})',\n '{name}({unit})': '{name} ({unit})',\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 外部: 'External',\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 '已達 {n} 字上限': 'Reached the {n}-character limit',\n '另外 {n} 個:{list}': '{n} more: {list}',\n 關閉通知: 'Close notification',\n '色碼格式不正確,請輸入 # 加 6 碼,例如 #2457d6': 'Not a color code. Type # and 6 digits, e.g. #2457d6',\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 通知中心: '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 已關閉: 'Closed',\n 在線: 'Online',\n '(在新分頁開啟)': ' (opens in a new tab)',\n '{lang} 程式碼': '{lang} code',\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 收合: 'Collapse',\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} uses',\n '1 次': '1 use',\n '使用 {n} 次': 'Used {n} times',\n 編號的線: 'Numbered lines',\n '複製成 Markdown': 'Copy as Markdown',\n '快選::上個月': 'Last month',\n 頁面: 'Page',\n 設定: 'Setting',\n 指令: 'Command',\n 檔案: 'File',\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. A key may start with a\n * context and 「::」 ('快選::上個月'): only the text after it is shown in zh-TW. */\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 // A context before 「::」 tells apart one word with two meanings ('快選::上個月' is Last month, '上個月' Previous\n // month); zh-TW shows the text after it, and a locale without the context key uses the plain one.\n const at = key.indexOf('::');\n const text = at >= 0 ? key.slice(at + 2) : key;\n const out = m?.[key] ?? (at >= 0 ? m?.[text] : undefined) ?? text;\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\nconst localeListeners = new Set<() => void>();\n\n/** Calls f after every change of locale or currency (setLocale) and of messages (addMessages); returns the unsubscribe.\n * useLocale() is built on it. */\nexport function subscribeLocale(f: () => void): () => void {\n localeListeners.add(f);\n return () => {\n localeListeners.delete(f);\n };\n}\n\n/** Switches the interface language and, optionally, the currency used by format.money. Components that read the\n * locale with useLocale() (and their children) render again. */\nexport function setLocale(locale: string, opts?: { currency?: string }): void {\n const next = locale || 'zh-TW';\n const changed = next !== I18N.locale || (!!opts?.currency && opts.currency !== I18N.currency);\n I18N.locale = next;\n if (opts?.currency) I18N.currency = opts.currency;\n if (typeof document !== 'undefined') document.documentElement.setAttribute('lang', I18N.locale);\n if (changed) emitLocale();\n}\n\n/** Tells the subscribers that the locale changed (LocaleProvider, after it set the locale while rendering). */\nexport function emitLocale(): void {\n localeListeners.forEach((f) => f());\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 emitLocale();\n}\n\nexport const isZhTW = (): boolean => /^zh-(TW|Hant)/i.test(I18N.locale);\n"],"mappings":";AAUA,MAAa,OAAkB;CAC7B,QAAQ;CACR,UAAU;CACV,UAAU,EACR,IAAI;EACF,aAAa;EACb,YAAY;EACZ,KAAK;EACL,KAAK;EACL,eAAe;EACf,KAAK;EACL,KAAK;EACL,MAAM;EACN,IAAI;EACJ,IAAI;EACJ,IAAI;EACJ,IAAI;EACJ,QAAQ;EACR,WAAW;EACX,IAAI;EACJ,IAAI;EACJ,MAAM;EACN,MAAM;EACN,wBAAwB;EACxB,MAAM;EACN,KAAK;EACL,QAAQ;EACR,IAAI;EACJ,OAAO;EACP,YAAY;EACZ,IAAI;EACJ,KAAK;EACL,MAAM;EACN,UAAU;EACV,WAAW;EACX,IAAI;EACJ,IAAI;EACJ,OAAO;EACP,OAAO;EACP,MAAM;EACN,IAAI;EACJ,aAAa;EACb,YAAY;EACZ,eAAe;EACf,eAAe;EACf,kBAAkB;EAClB,YAAY;EACZ,IAAI;EACJ,IAAI;EACJ,MAAM;EACN,IAAI;EACJ,MAAM;EACN,KAAK;EACL,OAAO;EACP,IAAI;EACJ,QAAQ;EACR,MAAM;EACN,aAAa;EACb,OAAO;EACP,eAAe;EACf,kBAAkB;EAClB,kBAAkB;EAClB,MAAM;EACN,MAAM;EACN,IAAI;EACJ,IAAI;EACJ,IAAI;EACJ,YAAY;EACZ,UAAU;EACV,MAAM;EACN,GAAG;EACH,IAAI;EACJ,QAAQ;EACR,UAAU;EACV,UAAU;EACV,UAAU;EACV,WAAW;EACX,0BAA0B;EAC1B,MAAM;EACN,IAAI;EACJ,MAAM;EACN,QAAQ;EACR,IAAI;EACJ,MAAM;EACN,MAAM;EACN,QAAQ;EACR,MAAM;EACN,GAAG;EACH,IAAI;EACJ,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AAI,OAAO,SAAS,YAAY,OAAO,KAAK,CAAC;CAC7C,IAAI,MAAM,GAAG;EACX,MAAM,MAAM,GAAG,OAAO,IAAI;EAC1B,IAAI,QAAQ,OAAO,MAAM,OAAO,IAAI,QAAQ,SAAS,EAAE;CACzD;CACA,OAAO,GAAG,IAAI;AAChB;AAEA,MAAM,kCAAkB,IAAI,IAAgB;;;AAI5C,SAAgB,gBAAgB,GAA2B;CACzD,gBAAgB,IAAI,CAAC;CACrB,aAAa;EACX,gBAAgB,OAAO,CAAC;CAC1B;AACF;;;AAIA,SAAgB,UAAU,QAAgB,MAAoC;CAC5E,MAAM,OAAO,UAAU;CACvB,MAAM,UAAU,SAAS,KAAK,UAAW,CAAC,CAAC,MAAM,YAAY,KAAK,aAAa,KAAK;CACpF,KAAK,SAAS;CACd,IAAI,MAAM,UAAU,KAAK,WAAW,KAAK;CACzC,IAAI,OAAO,aAAa,aAAa,SAAS,gBAAgB,aAAa,QAAQ,KAAK,MAAM;CAC9F,IAAI,SAAS,WAAW;AAC1B;;AAGA,SAAgB,aAAmB;CACjC,gBAAgB,SAAS,MAAM,EAAE,CAAC;AACpC;;AAGA,SAAgB,YAAY,QAAgB,MAAoC;CAC9E,KAAK,SAAS,UAAU;EAAE,GAAG,KAAK,SAAS;EAAS,GAAG;CAAK;CAC5D,WAAW;AACb;AAEA,MAAa,eAAwB,iBAAiB,KAAK,KAAK,MAAM"}
1
+ {"version":3,"file":"i18n.js","names":[],"sources":["../src/i18n.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 '{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 '已選 {n} {unit}': '{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 更多表格操作: 'More table actions',\n 還原預設: 'Restore defaults',\n 已還原預設的欄位與欄寬: 'Columns and widths restored to defaults',\n 套用的篩選: 'Applied filters',\n '移除篩選:{name}': 'Remove filter: {name}',\n '篩選,已套用 {n} 個條件': 'Filter, {n} conditions applied',\n '{name}:{value}': '{name}: {value}',\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} {unit}': 'Showing {n} {unit}',\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}」第 {n} 排序': '{name}, sort level {n}',\n '拖曳,或按 Alt+↑ ↓ 調整順序': 'Drag, or press Alt+Up or Alt+Down to reorder',\n '上移「{name}」': 'Move {name} up',\n '下移「{name}」': 'Move {name} down',\n '拖曳或按 ← → 調整;按一下依序加寬,按 Enter 還原': 'Drag or press Left and Right to resize; click to widen step by step, Enter to reset',\n '「{name}」欄寬 {n} px': '{name} column width {n} px',\n '已還原「{name}」欄寬': '{name} column width reset',\n '(改善)': ' (better)',\n '(變差)': ' (worse)',\n 長條圖: 'Bar chart',\n 折線圖: 'Line chart',\n 時間點: 'Time',\n 數值: 'Value',\n '數值({unit})': 'Value ({unit})',\n '{name}({unit})': '{name} ({unit})',\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 '面板 {n} px': 'Panel {n} px',\n '拖曳或按 ← → 調整;按一下切換預設寬度,按兩下或 Enter 還原':\n 'Drag or press ← → to resize; click to step through preset widths; double-click or Enter to reset',\n '拖曳或按方向鍵調整;按一下切換預設大小,按兩下還原': 'Drag or press the arrow keys to resize; click to step through preset sizes; double-click to reset',\n '{label} {n} px': '{label} {n} px',\n '拖曳或按 ↑ ↓ 調整;按一下切換預設高度,按 Enter 還原': 'Drag or press ↑ ↓ to resize; click to step through preset heights; Enter to reset',\n '架構圖高度 {n} px': 'Diagram height {n} px',\n 外部: 'External',\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 '已移除 {name}': 'Removed {name}',\n '清除{name}': 'Clear {name}',\n '已清除{name}': 'Cleared {name}',\n '第 {a}–{b} {unit},共 {n} {unit}': '{a}–{b} of {n}',\n 繼續編輯: 'Keep editing',\n '自訂強調色(色碼)': 'Custom accent color (hex)',\n '已達 {n} 字上限': 'Reached the {n}-character limit',\n '另外 {n} 個:{list}': '{n} more: {list}',\n 關閉通知: 'Close notification',\n '色碼格式不正確,請輸入 # 加 6 碼,例如 #2457d6': 'Not a color code. Type # and 6 digits, e.g. #2457d6',\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 通知中心: '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 已關閉: 'Closed',\n 已暫停: 'Paused',\n 在線: 'Online',\n '(在新分頁開啟)': ' (opens in a new tab)',\n '{lang} 程式碼': '{lang} code',\n 檢視: 'Views',\n '{n} {unit}': '{n} {unit}',\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} {unit}': '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 收合: 'Collapse',\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} uses',\n '1 次': '1 use',\n '使用 {n} 次': 'Used {n} times',\n 編號的線: 'Numbered lines',\n '複製成 Markdown': 'Copy as Markdown',\n '快選::上個月': 'Last month',\n 頁面: 'Page',\n 設定: 'Setting',\n 指令: 'Command',\n 檔案: 'File',\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. A key may start with a\n * context and 「::」 ('快選::上個月'): only the text after it is shown in zh-TW. */\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 // A context before 「::」 tells apart one word with two meanings ('快選::上個月' is Last month, '上個月' Previous\n // month); zh-TW shows the text after it, and a locale without the context key uses the plain one.\n const at = key.indexOf('::');\n const text = at >= 0 ? key.slice(at + 2) : key;\n const out = m?.[key] ?? (at >= 0 ? m?.[text] : undefined) ?? text;\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\nconst localeListeners = new Set<() => void>();\n\n/** Calls f after every change of locale or currency (setLocale) and of messages (addMessages); returns the unsubscribe.\n * useLocale() is built on it. */\nexport function subscribeLocale(f: () => void): () => void {\n localeListeners.add(f);\n return () => {\n localeListeners.delete(f);\n };\n}\n\n/** Switches the interface language and, optionally, the currency used by format.money. Components that read the\n * locale with useLocale() (and their children) render again. */\nexport function setLocale(locale: string, opts?: { currency?: string }): void {\n const next = locale || 'zh-TW';\n const changed = next !== I18N.locale || (!!opts?.currency && opts.currency !== I18N.currency);\n I18N.locale = next;\n if (opts?.currency) I18N.currency = opts.currency;\n if (typeof document !== 'undefined') document.documentElement.setAttribute('lang', I18N.locale);\n if (changed) emitLocale();\n}\n\n/** Tells the subscribers that the locale changed (LocaleProvider, after it set the locale while rendering). */\nexport function emitLocale(): void {\n localeListeners.forEach((f) => f());\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 emitLocale();\n}\n\nex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O;CAClB,IAAI,OAAO,SAAS,YAAY,OAAO,KAAK,CAAC;CAC7C,IAAI,MAAM,GAAG;EACX,MAAM,MAAM,GAAG,OAAO,IAAI;EAC1B,IAAI,QAAQ,OAAO,MAAM,OAAO,IAAI,QAAQ,SAAS,EAAE;CACzD;CACA,OAAO,GAAG,IAAI;AAChB;AAEA,MAAM,kCAAkB,IAAI,IAAgB;;;AAI5C,SAAgB,gBAAgB,GAA2B;CACzD,gBAAgB,IAAI,CAAC;CACrB,aAAa;EACX,gBAAgB,OAAO,CAAC;CAC1B;AACF;;;AAIA,SAAgB,UAAU,QAAgB,MAAoC;CAC5E,MAAM,OAAO,UAAU;CACvB,MAAM,UAAU,SAAS,KAAK,UAAW,CAAC,CAAC,MAAM,YAAY,KAAK,aAAa,KAAK;CACpF,KAAK,SAAS;CACd,IAAI,MAAM,UAAU,KAAK,WAAW,KAAK;CACzC,IAAI,OAAO,aAAa,aAAa,SAAS,gBAAgB,aAAa,QAAQ,KAAK,MAAM;CAC9F,IAAI,SAAS,WAAW;AAC1B;;AAGA,SAAgB,aAAmB;CACjC,gBAAgB,SAAS,MAAM,EAAE,CAAC;AACpC;;AAGA,SAAgB,YAAY,QAAgB,MAAoC;CAC9E,KAAK,SAAS,UAAU;EAAE,GAAG,KAAK,SAAS;EAAS,GAAG;CAAK;CAC5D,WAAW;AACb;AAEA,MAAa,eAAwB,iBAAiB,KAAK,KAAK,MAAM"}
@@ -20,7 +20,8 @@ export interface IconProps {
20
20
  }
21
21
  /**
22
22
  * Phosphor icon, 20 px, inherits the text color. Decorative: label the control that holds it. A name the page has not
23
- * shown before loads its module first and is an empty box of the same size until then (on the server too).
23
+ * shown before loads its module first and is an empty box of the same size until then. Server renders show only the
24
+ * icons given to `preloadIcons`.
24
25
  */
25
26
  export declare function Icon({ name, d, size, strokeWidth, filled, className }: IconProps): import("react").JSX.Element;
26
27
  export type { IconName };