hazo_ui 6.12.4 → 6.13.1
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/CHANGE_LOG.md +84 -0
- package/README.md +18 -1
- package/dist/index.cjs +399 -252
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +37 -5
- package/dist/index.d.ts +37 -5
- package/dist/index.js +398 -254
- package/dist/index.js.map +1 -1
- package/dist/index.locale-picker.cjs +234 -3
- package/dist/index.locale-picker.cjs.map +1 -1
- package/dist/index.locale-picker.d.cts +1 -1
- package/dist/index.locale-picker.d.ts +1 -1
- package/dist/index.locale-picker.js +235 -3
- package/dist/index.locale-picker.js.map +1 -1
- package/package.json +2 -2
package/CHANGE_LOG.md
CHANGED
|
@@ -5,6 +5,90 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## v6.13.1 (2026-10-03)
|
|
9
|
+
|
|
10
|
+
### Fixed — remaining hardcoded English strings now go through i18n
|
|
11
|
+
|
|
12
|
+
- Wired the last user-facing strings that bypassed `useHazoUiT()`: RTE output
|
|
13
|
+
tabs (HTML / Plain Text / Raw HTML), RTE `(empty)` fallbacks, RTE link
|
|
14
|
+
placeholder, kanban filter `Clear`, kanban card edit aria-label, browser tab
|
|
15
|
+
close aria-label, notification unread-count aria-label, canvas text toolbar
|
|
16
|
+
font options (Sans / Serif / Mono), and markdown editor upload placeholder.
|
|
17
|
+
- New en.json keys: `rte.tab_html`, `rte.tab_plain_text`, `rte.tab_raw_html`,
|
|
18
|
+
`rte.empty_content`, `rte.link_placeholder`, `kanban.clear`,
|
|
19
|
+
`browser_tab.close_aria`, `notification.unread_count`, `canvas_toolbar.font_sans`,
|
|
20
|
+
`canvas_toolbar.font_serif`, `canvas_toolbar.font_mono`,
|
|
21
|
+
`markdown.upload_placeholder`.
|
|
22
|
+
- `hazo_browser_tab` and `notification_count_badge` now call `useHazoUiT()`.
|
|
23
|
+
- Proper nouns (font family names), the `x` table-size separator and file-size
|
|
24
|
+
units are intentionally left untranslated.
|
|
25
|
+
|
|
26
|
+
## v6.13.0 (2026-10-03)
|
|
27
|
+
|
|
28
|
+
### Added — locale-aware i18n via `HazoUiI18nProvider`
|
|
29
|
+
|
|
30
|
+
- `HazoUiI18nProvider` + `useHazoUiT()` (and types `HazoUiTFunction`,
|
|
31
|
+
`HazoUiI18nProviderProps`) are exported from the package root. The app mounts
|
|
32
|
+
the provider under `<HazoI18nProvider>` and passes a locale-aware `t`, e.g.
|
|
33
|
+
`useTranslations("hazo_ui")` from `hazo_i18n/client`. Same pattern as
|
|
34
|
+
hazo_auth's `HazoAuthProvider` `t` prop.
|
|
35
|
+
- `defaultHazoUiT` exported for non-React callers (English, not locale-aware).
|
|
36
|
+
- `permissionToast()` accepts an optional `t` option (defaults to English).
|
|
37
|
+
|
|
38
|
+
### Fixed — hazo_ui rendered English in every locale
|
|
39
|
+
|
|
40
|
+
- v6.12.x wired strings through `createPackageT`, which is locale-blind: every
|
|
41
|
+
component read the bundled English catalog regardless of the active locale.
|
|
42
|
+
Components now call `useHazoUiT()`, which returns the app-supplied locale
|
|
43
|
+
under a provider and the English catalog otherwise.
|
|
44
|
+
- Missing keys in the active locale fall back to English per key (logged via
|
|
45
|
+
the hazo_ui logger) instead of throwing hazo_i18n's dev-mode error.
|
|
46
|
+
|
|
47
|
+
### Changed
|
|
48
|
+
|
|
49
|
+
- All 34 i18n-wired components use `useHazoUiT()` in the component body;
|
|
50
|
+
no module-level `t`. Prop defaults that used `t()` now resolve in the body
|
|
51
|
+
(`prop ?? t(key)`) — the public prop names are unchanged.
|
|
52
|
+
- Helpers that need translation take `t` explicitly: `validateInput`
|
|
53
|
+
(flex_input), `auto_detect_fields` and `default_announcements` (kanban),
|
|
54
|
+
`renderErrorState` (table).
|
|
55
|
+
- Without a provider, output is unchanged (English).
|
|
56
|
+
|
|
57
|
+
### Test-app
|
|
58
|
+
|
|
59
|
+
- `test-app/components/hazo_ui_i18n_root.tsx` bridges `useTranslations("hazo_ui")`
|
|
60
|
+
into the provider; mounted in the root layout.
|
|
61
|
+
- `src/contexts/__tests__/hazo_ui_i18n.test.tsx` covers app-supplied locale,
|
|
62
|
+
per-key English fallback, and the no-provider default.
|
|
63
|
+
|
|
64
|
+
## v6.12.5 (2026-10-03)
|
|
65
|
+
|
|
66
|
+
### Changed — i18n string wiring (remaining hardcoded strings)
|
|
67
|
+
|
|
68
|
+
- Nine previously unwired components now go through
|
|
69
|
+
`createPackageT("hazo_ui", en)`: `hazo_ui_flex_input` (validation messages),
|
|
70
|
+
`hazo_ui_textarea` / `hazo_ui_textbox` (placeholder + "Remove"),
|
|
71
|
+
`locale_picker`, `app_logo`, `app_header`, `skeleton`, `ui/spinner`,
|
|
72
|
+
`hazo_ui_kanban/kanban_filter`.
|
|
73
|
+
- Leaked literals wired in already-wired components: RTE toolbar
|
|
74
|
+
(link/table-ops/variable search) and RTE placeholder, multi-sort dialog,
|
|
75
|
+
kanban DnD announcements and card role description, `loading_timeout`,
|
|
76
|
+
icon picker tab and group labels, `error_page` correlation-ID label and
|
|
77
|
+
title default, funnel chart tooltip prefixes, toaster "Missing:" prefix.
|
|
78
|
+
- `hazo_ui_rte/index.tsx`, `hazo_ui_kanban/index.tsx`,
|
|
79
|
+
`hazo_ui_kanban/kanban_card.tsx` and `hazo_ui_charts/funnel_chart.tsx` had
|
|
80
|
+
no `createPackageT` wiring before this release; they now import it.
|
|
81
|
+
- `src/locales/en.json` grows from 133 to 207 keys (additive). Key names
|
|
82
|
+
follow the `<component>.<meaning>` convention already in use.
|
|
83
|
+
- Prop defaults resolve in the body (`prop ?? t(key)`), never in a default
|
|
84
|
+
parameter. English output is unchanged except as noted below.
|
|
85
|
+
- Known gap: `flex_input` decimal/character counts use one plural form, so a
|
|
86
|
+
count of 1 reads "1 decimal places" / "1 characters". Needs `_one`/`_other`
|
|
87
|
+
plural keys; not changed here.
|
|
88
|
+
- Intentionally left hardcoded: font family names in `canvas_text_toolbar`
|
|
89
|
+
(proper nouns), format tab labels in the RTE source view (`HTML`,
|
|
90
|
+
`Plain Text`, `Raw HTML`) — follow-up.
|
|
91
|
+
|
|
8
92
|
## v6.12.4 (2026-10-03)
|
|
9
93
|
|
|
10
94
|
### Changed — i18n string wiring (remaining components)
|
package/README.md
CHANGED
|
@@ -83,7 +83,24 @@ The `tw-animate-css` import replaces the legacy `tailwindcss-animate` plugin (us
|
|
|
83
83
|
|
|
84
84
|
## Internationalisation
|
|
85
85
|
|
|
86
|
-
All built-in user-facing strings
|
|
86
|
+
All built-in user-facing strings resolve through a `t` function from `useHazoUiT()`. The English catalogue lives in `src/locales/en.json`, and `createPackageT("hazo_ui", en)` from `hazo_core/i18n` is the English fallback. Prop defaults for labels resolve as `prop ?? t(key)`, so explicit props always override translations.
|
|
87
|
+
|
|
88
|
+
To render another locale, mount `HazoUiI18nProvider` under your hazo_i18n provider and pass a locale-aware `t` (same pattern as hazo_auth's provider):
|
|
89
|
+
|
|
90
|
+
```tsx
|
|
91
|
+
import { HazoI18nProvider, useTranslations } from "hazo_i18n/client";
|
|
92
|
+
import { HazoUiI18nProvider } from "hazo_ui";
|
|
93
|
+
|
|
94
|
+
function HazoUiI18nRoot({ children }: { children: React.ReactNode }) {
|
|
95
|
+
const t = useTranslations("hazo_ui");
|
|
96
|
+
return <HazoUiI18nProvider t={t}>{children}</HazoUiI18nProvider>;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// In your root layout, inside <HazoI18nProvider locale={locale} messages={messages}>:
|
|
100
|
+
<HazoUiI18nRoot>{children}</HazoUiI18nRoot>
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Without a provider, every component renders English. A key missing from the active locale falls back to English for that key. Other locales are generated through `hazo_i18n` (see the test-app `/translations` page).
|
|
87
104
|
|
|
88
105
|
## Color Configuration
|
|
89
106
|
|