@celestia-island/hikari 0.55.455 → 0.55.457

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 (45) hide show
  1. package/dist/types/components/HkAuthScreen.d.ts +74 -0
  2. package/dist/types/components/HkAuthSsoButton.d.ts +91 -0
  3. package/dist/types/components/HkLoginFlow.d.ts +255 -0
  4. package/dist/types/index.d.ts +7 -0
  5. package/dist/types/mermaid/declare-caps.d.ts +10 -0
  6. package/dist/types/mermaid/wasmEngine.d.ts +18 -0
  7. package/dist/types/utils/qr/declare-caps.d.ts +10 -0
  8. package/dist/types/utils/qr/qrEncoder.d.ts +14 -1
  9. package/package.json +5 -2
  10. package/src/components/HkAuthScreen.scss +65 -0
  11. package/src/components/HkAuthScreen.tsx +97 -0
  12. package/src/components/HkAuthSsoButton.scss +83 -0
  13. package/src/components/HkAuthSsoButton.tsx +78 -0
  14. package/src/components/HkExpansionPanel.scss +14 -5
  15. package/src/components/HkExpansionPanel.test.tsx +34 -3
  16. package/src/components/HkExpansionPanel.tsx +9 -1
  17. package/src/components/HkLoginFlow.scss +23 -0
  18. package/src/components/HkLoginFlow.test.tsx +457 -0
  19. package/src/components/HkLoginFlow.tsx +362 -0
  20. package/src/components/HkQrCode.ready.test.tsx +72 -0
  21. package/src/components/HkQrCode.tsx +24 -4
  22. package/src/components/HkSerpentineUnlock.scss +17 -0
  23. package/src/components/HkSerpentineUnlock.test.ts +49 -2
  24. package/src/components/HkSerpentineUnlock.tsx +9 -1
  25. package/src/components/HkTabs.scss +11 -0
  26. package/src/components/HkTabs.test.ts +75 -0
  27. package/src/i18n/locales/ar/components.json +5 -1
  28. package/src/i18n/locales/de/components.json +5 -1
  29. package/src/i18n/locales/en/components.json +5 -1
  30. package/src/i18n/locales/es/components.json +5 -1
  31. package/src/i18n/locales/fr/components.json +5 -1
  32. package/src/i18n/locales/ja/components.json +5 -1
  33. package/src/i18n/locales/ko/components.json +5 -1
  34. package/src/i18n/locales/pt/components.json +5 -1
  35. package/src/i18n/locales/ru/components.json +5 -1
  36. package/src/i18n/locales/zh-Hans/components.json +5 -1
  37. package/src/i18n/locales/zh-Hant/components.json +5 -1
  38. package/src/index.ts +7 -0
  39. package/src/mermaid/declare-caps.ts +22 -0
  40. package/src/mermaid/hostSurface.test.ts +145 -0
  41. package/src/mermaid/wasmEngine.ts +76 -10
  42. package/src/utils/qr/declare-caps.ts +28 -0
  43. package/src/utils/qr/qrEncoder.ts +74 -16
  44. package/src/utils/qr/qrHostSurface.test.ts +233 -0
  45. package/src/utils/qr/qrMatrixOrientation.test.ts +28 -0
@@ -0,0 +1,74 @@
1
+ import { type PropType } from "vue";
2
+ import "./HkAuthScreen.scss";
3
+ /** One compliance footer line entry (an ICP filing number, a public-
4
+ * security filing, …). Deployments source the values from their own
5
+ * configuration; hikari only renders what it is given. */
6
+ export interface HkAuthScreenBeianEntry {
7
+ /** Display text, e.g. "京ICP备XXXXXXXX号-1". */
8
+ title: string;
9
+ /** Optional link target (government registry sites open in a new
10
+ * tab with `noopener`). */
11
+ url?: string;
12
+ }
13
+ /**
14
+ * HkAuthScreen — the screen-level shell of every Celestia auth page
15
+ * (login, register, OAuth authorize): a header strip, a BOTH-AXES
16
+ * centered stage for the auth card, and a footer that carries the
17
+ * compliance lines (ICP filing, …).
18
+ *
19
+ * Why a shell at all: the centering contract had drifted per app —
20
+ * erp's user shell pinned the card to the top with a `2rem auto 0`
21
+ * margin, chest derives a `min-height: calc(100dvh - footer - strip)`
22
+ * formula from its own chrome — so the family-wide geometry moves into
23
+ * hikari (2026-11 user direction). The shell is three stacked flex rows
24
+ * and the stage is the flexible middle one, which makes true vertical
25
+ * centering structural instead of a subtraction: whatever the header
26
+ * and footer grow to, the card sits in the middle of what remains.
27
+ *
28
+ * The stage never caps its children's width — cards carry their own
29
+ * `--hk-auth-card-max-width` contract (see HkLoginFlow). `header` and
30
+ * `footer` are plain strips: hosts put their brand row / legal links
31
+ * there; `beian` renders as the footer's own muted line of small
32
+ * links below any footer slot content.
33
+ *
34
+ * ```tsx
35
+ * <HkAuthScreen beian={[{ title: "京ICP备…号", url: "https://beian.miit.gov.cn/" }]}>
36
+ * {{ header: () => <MyBrandStrip />, default: () => <HkLoginFlow … /> }}
37
+ * </HkAuthScreen>
38
+ * ```
39
+ */
40
+ export declare const HkAuthScreen: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
41
+ /** Compliance lines rendered at the very bottom (muted, small,
42
+ * centered). Empty renders nothing — no empty footer padding. */
43
+ beian: {
44
+ type: PropType<HkAuthScreenBeianEntry[]>;
45
+ default: () => never[];
46
+ };
47
+ /** Accessible name for the compliance nav landmark. The landmark
48
+ * stays unlabeled when unset (a nav of filing links is self-
49
+ * describing enough for screen readers); hosts with a localized
50
+ * name pass it explicitly. */
51
+ beianAriaLabel: {
52
+ type: StringConstructor;
53
+ default: undefined;
54
+ };
55
+ }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
56
+ /** Compliance lines rendered at the very bottom (muted, small,
57
+ * centered). Empty renders nothing — no empty footer padding. */
58
+ beian: {
59
+ type: PropType<HkAuthScreenBeianEntry[]>;
60
+ default: () => never[];
61
+ };
62
+ /** Accessible name for the compliance nav landmark. The landmark
63
+ * stays unlabeled when unset (a nav of filing links is self-
64
+ * describing enough for screen readers); hosts with a localized
65
+ * name pass it explicitly. */
66
+ beianAriaLabel: {
67
+ type: StringConstructor;
68
+ default: undefined;
69
+ };
70
+ }>> & Readonly<{}>, {
71
+ beian: HkAuthScreenBeianEntry[];
72
+ beianAriaLabel: string;
73
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
74
+ export default HkAuthScreen;
@@ -0,0 +1,91 @@
1
+ import "./HkAuthSsoButton.scss";
2
+ /**
3
+ * HkAuthSsoButton — the PRIMARY single-provider sign-in button for auth
4
+ * screens whose whole channel is one redirect ("Continue with Celestia",
5
+ * an org channel that only offers Feishu, …).
6
+ *
7
+ * Sibling of the `HkAuthMethodList` tile, not a replacement: the tile row
8
+ * is for ALTERNATIVE methods lining up under a credentials form (44px,
9
+ * hover-revealed identity), while this button is the channel's main
10
+ * action — one large centered square tile with the provider's name in
11
+ * plain sight below it. The visual recipe (framed square, token-based
12
+ * border/surface, brand icon at native colors) is the tile's, scaled up;
13
+ * the label lives OUTSIDE the button so the click target stays a clean
14
+ * square and the name stays readable at rest, matching the third-party
15
+ * card pattern users already know.
16
+ *
17
+ * Control contract (same split as every auth card): the button never
18
+ * talks to a backend or builds an OAuth URL — the consumer owns the
19
+ * redirect and injects `on:click`. `icon` is typed loose on purpose
20
+ * (hosts materialize hikari against their own vue store; a hard VNode
21
+ * type breaks typecheck whenever the host's vue minor differs).
22
+ *
23
+ * ```tsx
24
+ * <HkAuthSsoButton
25
+ * label="Celestia 账号"
26
+ * icon={<CelestiaMark />}
27
+ * on:click={() => (window.location.href = beginUrl)}
28
+ * />
29
+ * ```
30
+ */
31
+ export declare const HkAuthSsoButton: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
32
+ /** Provider display name — rendered under the tile and used as the
33
+ * button's accessible name. */
34
+ label: {
35
+ type: StringConstructor;
36
+ required: true;
37
+ };
38
+ /** Prebuilt icon vnode (brand SVG, <img>, …) rendered inside the
39
+ * framed square. A missing icon falls back to the label's initial,
40
+ * same as an HkAuthMethodList tile. */
41
+ icon: {
42
+ type: null;
43
+ default: undefined;
44
+ };
45
+ /** Extra guard on top of the built-in in-flight checks. */
46
+ disabled: {
47
+ type: BooleanConstructor;
48
+ default: boolean;
49
+ };
50
+ /** External in-flight state (the consumer already triggered the
51
+ * redirect and is waiting for the navigation to land). */
52
+ loading: {
53
+ type: BooleanConstructor;
54
+ default: boolean;
55
+ };
56
+ }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
57
+ /** The tile was activated (click or Enter/Space). */
58
+ click: () => true;
59
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
60
+ /** Provider display name — rendered under the tile and used as the
61
+ * button's accessible name. */
62
+ label: {
63
+ type: StringConstructor;
64
+ required: true;
65
+ };
66
+ /** Prebuilt icon vnode (brand SVG, <img>, …) rendered inside the
67
+ * framed square. A missing icon falls back to the label's initial,
68
+ * same as an HkAuthMethodList tile. */
69
+ icon: {
70
+ type: null;
71
+ default: undefined;
72
+ };
73
+ /** Extra guard on top of the built-in in-flight checks. */
74
+ disabled: {
75
+ type: BooleanConstructor;
76
+ default: boolean;
77
+ };
78
+ /** External in-flight state (the consumer already triggered the
79
+ * redirect and is waiting for the navigation to land). */
80
+ loading: {
81
+ type: BooleanConstructor;
82
+ default: boolean;
83
+ };
84
+ }>> & Readonly<{
85
+ onClick?: (() => any) | undefined;
86
+ }>, {
87
+ icon: any;
88
+ loading: boolean;
89
+ disabled: boolean;
90
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
91
+ export default HkAuthSsoButton;
@@ -0,0 +1,255 @@
1
+ import { type PropType } from "vue";
2
+ import { type HkAuthMethodListEntry } from "./HkAuthMethodList";
3
+ import { type HkMfaFactor } from "./HkMfaVerifyCard";
4
+ import "./HkLoginFlow.scss";
5
+ /** A channel whose sign-in is a credentials handshake the host drives:
6
+ * the card collects the account name (password only when the host opts
7
+ * in) and `account-submit` carries it to the host's ladder. */
8
+ export interface HkLoginCredentialsChannel {
9
+ key: string;
10
+ mode: "credentials";
11
+ /** Segment label; defaults to the `hikari::loginFlow.channel*` locale
12
+ * for the conventional `cloud` / `org` keys, else the key itself. */
13
+ label?: string;
14
+ /** Card title; defaults to `hikari::loginFlow.signInTitle`. */
15
+ title?: string;
16
+ /** Card subtitle; defaults to `hikari::loginFlow.signInSubtitle`. */
17
+ subtitle?: string;
18
+ /** Username-field type; `email` renders the identifier login. */
19
+ usernameType?: "text" | "email";
20
+ usernamePlaceholder?: string;
21
+ /** Autocomplete token forwarded to the username field (e.g. "email"
22
+ * on identifier logins); HkSignInCard's runtime credential policy
23
+ * resolves the default. */
24
+ usernameAutocomplete?: string;
25
+ /** Classic two-field card. Defaults to FALSE — account-first is the
26
+ * family-wide posture since the MFA redesign: the password is proven
27
+ * on the verify step as one factor among the announced ones, so the
28
+ * opening card must not ask for it (2026-11 user direction). */
29
+ passwordField?: boolean;
30
+ submitLabel?: string;
31
+ /** Alternative sign-in tiles under the form (rendered only when
32
+ * non-empty; an empty list omits the whole methods block instead of
33
+ * padding a dead strip). */
34
+ methods?: HkAuthMethodListEntry[];
35
+ /** Divider text above the tiles; consumer-localized on purpose. */
36
+ methodsDivider?: string;
37
+ }
38
+ /** A channel whose whole sign-in is one redirect (a.celestia.world's
39
+ * "Celestia" tile jumping to the central login, an org channel that
40
+ * only offers Feishu): the card renders one centered primary tile and
41
+ * `sso-click` sends the host off to build its OAuth URL. */
42
+ export interface HkLoginSsoChannel {
43
+ key: string;
44
+ mode: "sso";
45
+ label?: string;
46
+ title?: string;
47
+ subtitle?: string;
48
+ /** Provider mark for the tile (brand SVG, <img>, …). Loose-typed like
49
+ * every auth icon: hosts materialize hikari against their own vue. */
50
+ icon: unknown;
51
+ /** Accessible name + the line under the tile; defaults to the channel
52
+ * label. */
53
+ buttonLabel?: string;
54
+ disabled?: boolean;
55
+ }
56
+ export type HkLoginChannel = HkLoginCredentialsChannel | HkLoginSsoChannel;
57
+ /**
58
+ * HkLoginFlow — the full sign-in panel every Celestia front end shares:
59
+ * the channel segment group ("Celestia / 组织登录") over a per-channel
60
+ * card, with the account→verify step machine built in.
61
+ *
62
+ * This is the business-level composition above the auth kit (extracted
63
+ * from shittim-chest's LoginView, 2026-11 user direction: the login
64
+ * screen had drifted into per-app reimplementations). It owns EVERYTHING
65
+ * visual — the pill segment group (hidden when a deployment offers a
66
+ * single channel; a lone dead segment reads as a broken switch), the
67
+ * height-morphing channel swap, the direction-aware account→verify
68
+ * slide, the methods tiles, the MFA card — while staying a CONTROLLED
69
+ * component: no endpoint, no URL building, no factor ladder policy.
70
+ * Each host (the chest migration plus the erp and arona login surfaces,
71
+ * landing as their own PRs) keeps its own auth client and drives the
72
+ * panel through props/events:
73
+ *
74
+ * - `v-model` (channel key) + `channels` — the segment group.
75
+ * - `step` — `'account' | 'verify'`; the host flips it when its ladder
76
+ * answers with factors, and the panel slides to `HkMfaVerifyCard`
77
+ * (which never renders on an sso channel: a redirect flow has no
78
+ * second step by construction — passing `step="verify"` with an sso
79
+ * channel renders the account card as a fail-safe).
80
+ * - `account-submit(channel, username, password)` — credentials
81
+ * channel submitted (password is empty while `passwordField` is off).
82
+ * - `method-select(channel, key)` — an alternative tile was picked.
83
+ * - `sso-click(channel)` — the primary sso tile was picked.
84
+ * - `verify(kind, proof)` / `verify-resend` / `verify-back` — the MFA
85
+ * card's events, re-emitted one level up.
86
+ *
87
+ * Copy rules locked by the chest blueprint (LoginView.test.ts, kept
88
+ * verbatim here): segment labels are ALWAYS the panel's own locale keys,
89
+ * never a server-provided provider name (a provider label leaked into
90
+ * the channel tabs once and read as "log in to ERP" instead of "log in
91
+ * with your organization"); the group renders only for 2+ channels; an
92
+ * empty `methods` list omits the block entirely (a null-rendered slot
93
+ * still pads the card's methods strip).
94
+ *
95
+ * `initialUsername` rides the account→verify→back round-trip (the
96
+ * credentials card remounts when the user navigates back, so the typed
97
+ * name must travel through a prop rather than die with the card).
98
+ *
99
+ * ```tsx
100
+ * <HkLoginFlow
101
+ * v-model={channel.value}
102
+ * channels={channels}
103
+ * step={mfa.value ? "verify" : "account"}
104
+ * loading={pending.value}
105
+ * verifyFactors={mfa.value?.factors ?? []}
106
+ * onAccount-submit={onBegin}
107
+ * onVerify={onVerify}
108
+ * />
109
+ * ```
110
+ */
111
+ export declare const HkLoginFlow: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
112
+ /** The deployment's sign-in channels. One entry renders a plain
113
+ * card (no segment group); two entries render the pill group. */
114
+ channels: {
115
+ type: PropType<HkLoginChannel[]>;
116
+ required: true;
117
+ };
118
+ /** Active channel key (`v-model`). */
119
+ modelValue: {
120
+ type: StringConstructor;
121
+ required: true;
122
+ };
123
+ /** Flow step: `account` (the channel cards) or `verify` (the MFA
124
+ * card). Controlled by the host's ladder state. */
125
+ step: {
126
+ type: PropType<"account" | "verify">;
127
+ default: string;
128
+ };
129
+ /** In-flight state of the credentials submit. */
130
+ loading: {
131
+ type: BooleanConstructor;
132
+ default: boolean;
133
+ };
134
+ /** Logo image URL forwarded to the active card's header. */
135
+ logoSrc: {
136
+ type: StringConstructor;
137
+ default: undefined;
138
+ };
139
+ /** Seed for the credentials card's username field — survives the
140
+ * verify round-trip (see HkSignInCard.initialUsername). */
141
+ initialUsername: {
142
+ type: StringConstructor;
143
+ default: string;
144
+ };
145
+ verifyFactors: {
146
+ type: PropType<readonly string[]>;
147
+ default: () => never[];
148
+ };
149
+ verifyProven: {
150
+ type: StringConstructor;
151
+ default: undefined;
152
+ };
153
+ verifyAccountName: {
154
+ type: StringConstructor;
155
+ default: string;
156
+ };
157
+ verifyLoading: {
158
+ type: BooleanConstructor;
159
+ default: boolean;
160
+ };
161
+ verifyResending: {
162
+ type: BooleanConstructor;
163
+ default: boolean;
164
+ };
165
+ passkeyRetryHint: {
166
+ type: StringConstructor;
167
+ default: undefined;
168
+ };
169
+ }>, () => import("vue/jsx-runtime").JSX.Element | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
170
+ "update:modelValue": (_key: string) => true;
171
+ "account-submit": (_channel: string, _username: string, _password: string) => true;
172
+ "method-select": (_channel: string, _key: string) => true;
173
+ "sso-click": (_channel: string) => true;
174
+ verify: (_kind: HkMfaFactor, _proof: string) => true;
175
+ "verify-resend": () => true;
176
+ "verify-back": () => true;
177
+ }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
178
+ /** The deployment's sign-in channels. One entry renders a plain
179
+ * card (no segment group); two entries render the pill group. */
180
+ channels: {
181
+ type: PropType<HkLoginChannel[]>;
182
+ required: true;
183
+ };
184
+ /** Active channel key (`v-model`). */
185
+ modelValue: {
186
+ type: StringConstructor;
187
+ required: true;
188
+ };
189
+ /** Flow step: `account` (the channel cards) or `verify` (the MFA
190
+ * card). Controlled by the host's ladder state. */
191
+ step: {
192
+ type: PropType<"account" | "verify">;
193
+ default: string;
194
+ };
195
+ /** In-flight state of the credentials submit. */
196
+ loading: {
197
+ type: BooleanConstructor;
198
+ default: boolean;
199
+ };
200
+ /** Logo image URL forwarded to the active card's header. */
201
+ logoSrc: {
202
+ type: StringConstructor;
203
+ default: undefined;
204
+ };
205
+ /** Seed for the credentials card's username field — survives the
206
+ * verify round-trip (see HkSignInCard.initialUsername). */
207
+ initialUsername: {
208
+ type: StringConstructor;
209
+ default: string;
210
+ };
211
+ verifyFactors: {
212
+ type: PropType<readonly string[]>;
213
+ default: () => never[];
214
+ };
215
+ verifyProven: {
216
+ type: StringConstructor;
217
+ default: undefined;
218
+ };
219
+ verifyAccountName: {
220
+ type: StringConstructor;
221
+ default: string;
222
+ };
223
+ verifyLoading: {
224
+ type: BooleanConstructor;
225
+ default: boolean;
226
+ };
227
+ verifyResending: {
228
+ type: BooleanConstructor;
229
+ default: boolean;
230
+ };
231
+ passkeyRetryHint: {
232
+ type: StringConstructor;
233
+ default: undefined;
234
+ };
235
+ }>> & Readonly<{
236
+ "onUpdate:modelValue"?: ((_key: string) => any) | undefined;
237
+ onVerify?: ((_kind: "password" | "passkey" | "totp" | "sms", _proof: string) => any) | undefined;
238
+ "onAccount-submit"?: ((_channel: string, _username: string, _password: string) => any) | undefined;
239
+ "onMethod-select"?: ((_channel: string, _key: string) => any) | undefined;
240
+ "onSso-click"?: ((_channel: string) => any) | undefined;
241
+ "onVerify-resend"?: (() => any) | undefined;
242
+ "onVerify-back"?: (() => any) | undefined;
243
+ }>, {
244
+ step: "verify" | "account";
245
+ loading: boolean;
246
+ logoSrc: string;
247
+ initialUsername: string;
248
+ passkeyRetryHint: string;
249
+ verifyFactors: readonly string[];
250
+ verifyProven: string;
251
+ verifyAccountName: string;
252
+ verifyLoading: boolean;
253
+ verifyResending: boolean;
254
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
255
+ export default HkLoginFlow;
@@ -484,6 +484,13 @@ export { HkSignInCard as HkSignInCard } from "./components/HkSignInCard";
484
484
  export { HkThirdPartySignInCard as HkThirdPartySignInCard } from "./components/HkThirdPartySignInCard";
485
485
  export { HkMfaVerifyCard as HkMfaVerifyCard } from "./components/HkMfaVerifyCard";
486
486
  export { type HkMfaFactor as HkMfaFactor } from "./components/HkMfaVerifyCard";
487
+ export { HkAuthScreen as HkAuthScreen } from "./components/HkAuthScreen";
488
+ export { type HkAuthScreenBeianEntry as HkAuthScreenBeianEntry } from "./components/HkAuthScreen";
489
+ export { HkLoginFlow as HkLoginFlow } from "./components/HkLoginFlow";
490
+ export { type HkLoginChannel as HkLoginChannel } from "./components/HkLoginFlow";
491
+ export { type HkLoginCredentialsChannel as HkLoginCredentialsChannel } from "./components/HkLoginFlow";
492
+ export { type HkLoginSsoChannel as HkLoginSsoChannel } from "./components/HkLoginFlow";
493
+ export { HkAuthSsoButton as HkAuthSsoButton } from "./components/HkAuthSsoButton";
487
494
  export { HkLocalePicker as HkLocalePicker } from "./components/HkLocalePicker";
488
495
  export { HkAdminTablePage as HkAdminTablePage } from "./components/HkAdminTablePage";
489
496
  export { HkPageHeader as HkPageHeader } from "./components/HkPageHeader";
@@ -0,0 +1,10 @@
1
+ export declare const MERMAID_CAPABILITIES: {
2
+ interfaces: string[];
3
+ wasiModules: string[];
4
+ };
5
+ /**
6
+ * The value the publish returned (the previous declaration). Exported and read
7
+ * by the engine so this module cannot be dropped as dead code by a bundler that
8
+ * honours `sideEffects`.
9
+ */
10
+ export declare const MERMAID_DECLARATION_PUBLISHED: import("@celestia-island/tairitsu-host-client").CapabilityDeclaration | undefined;
@@ -1,2 +1,20 @@
1
+ import { HostClientError } from "@celestia-island/tairitsu-host-client";
1
2
  import type { MermaidParserEngine } from "./engine";
3
+ /** The component's `hikari:mermaid/types` `parse-result` record. */
4
+ export interface MermaidParseResult {
5
+ /** JSON-serialized MermaidDiagram; absent when unrecognized. */
6
+ json?: string;
7
+ }
8
+ /** Thrown when `parse` is called before the component is usable. */
9
+ export declare class MermaidNotReadyError extends Error {
10
+ constructor(cause?: unknown);
11
+ }
12
+ /** Resolves once the component is usable; rejects if it could not be built. */
13
+ export declare const mermaidReady: Promise<void>;
14
+ /** Keeps the declaration module live for bundlers that honour `sideEffects`. */
15
+ export declare const mermaidCapabilities: {
16
+ interfaces: string[];
17
+ wasiModules: string[];
18
+ };
2
19
  export declare const wasmMermaidEngine: MermaidParserEngine;
20
+ export { HostClientError };
@@ -0,0 +1,10 @@
1
+ export declare const QR_CAPABILITIES: {
2
+ interfaces: string[];
3
+ wasiModules: string[];
4
+ };
5
+ /**
6
+ * The value the publish returned (the previous declaration). Exported and read
7
+ * by the encoder so this module cannot be dropped as dead code by a bundler that
8
+ * honours `sideEffects`.
9
+ */
10
+ export declare const QR_DECLARATION_PUBLISHED: import("@celestia-island/tairitsu-host-client").CapabilityDeclaration | undefined;
@@ -1,3 +1,4 @@
1
+ import { HostClientError } from "@celestia-island/tairitsu-host-client";
1
2
  export type QrErrorCorrectionLevel = "L" | "M" | "Q" | "H";
2
3
  export interface QrMatrixOptions {
3
4
  /** Explicit QR version 1..40, or 0 for auto-detection. Default 0. */
@@ -5,12 +6,24 @@ export interface QrMatrixOptions {
5
6
  /** Error-correction level. Default "M". */
6
7
  errorCorrectionLevel?: QrErrorCorrectionLevel;
7
8
  }
9
+ /** Thrown when `qrMatrix` is called before the component is usable. */
10
+ export declare class QrNotReadyError extends Error {
11
+ constructor(cause?: unknown);
12
+ }
13
+ /** Resolves once the component is usable; rejects if it could not be built. */
14
+ export declare const qrReady: Promise<void>;
15
+ /** Keeps the declaration module live for bundlers that honour `sideEffects`. */
16
+ export declare const qrCapabilities: {
17
+ interfaces: string[];
18
+ wasiModules: string[];
19
+ };
8
20
  /**
9
21
  * Encode `text` as a QR module matrix. `true` = dark module.
10
22
  *
11
23
  * When `typeNumber` is 0 (default), the encoder auto-selects the smallest
12
24
  * version that fits the payload and the chosen ECC level. Throws when the
13
25
  * payload overflows the largest version (same contract as the vendored
14
- * generator it replaced).
26
+ * generator it replaced), and `QrNotReadyError` if the component is unusable.
15
27
  */
16
28
  export declare function qrMatrix(text: string, opts?: QrMatrixOptions): boolean[][];
29
+ export { HostClientError };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@celestia-island/hikari",
3
- "version": "0.55.455",
3
+ "version": "0.55.457",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Hikari UI library, Vue 3 runtime — one design system for Vue 3 and Rust/WASM applications",
@@ -80,6 +80,7 @@
80
80
  },
81
81
  "dependencies": {
82
82
  "@bytecodealliance/preview2-shim": "^0.31",
83
+ "@celestia-island/tairitsu-host-client": "^0.1",
83
84
  "@celestia-island/tairitsu-transport": "^0.2",
84
85
  "@xterm/addon-fit": "^0.11",
85
86
  "@xterm/addon-image": "^0.10.0-beta.301",
@@ -104,7 +105,9 @@
104
105
  },
105
106
  "sideEffects": [
106
107
  "**/*.scss",
107
- "**/*.css"
108
+ "**/*.css",
109
+ "**/qr/declare-caps.ts",
110
+ "**/mermaid/declare-caps.ts"
108
111
  ],
109
112
  "peerDependenciesMeta": {
110
113
  "pinia": {
@@ -0,0 +1,65 @@
1
+ // HkAuthScreen — the auth page shell.
2
+ //
3
+ // Geometry: three stacked flex rows; the stage is the only flexible
4
+ // one, so BOTH-AXES centering of the auth card is structural — the
5
+ // card sits in the middle of whatever space the header/footer leave,
6
+ // and grows/shrinks with them without any dvh arithmetic. 100dvh (not
7
+ // 100vh) keeps mobile browser chrome from clipping the footer.
8
+
9
+ .hk-auth-screen {
10
+ display: flex;
11
+ flex-direction: column;
12
+ align-items: stretch;
13
+ min-height: 100dvh;
14
+ }
15
+
16
+ .hk-auth-screen-header {
17
+ flex: none;
18
+ width: 100%;
19
+ }
20
+
21
+ .hk-auth-screen-stage {
22
+ flex: 1 1 auto;
23
+ display: flex;
24
+ align-items: center;
25
+ justify-content: center;
26
+ width: 100%;
27
+ padding: var(--space-24, 1.5rem);
28
+ }
29
+
30
+ .hk-auth-screen-footer {
31
+ flex: none;
32
+ display: flex;
33
+ flex-direction: column;
34
+ align-items: center;
35
+ gap: var(--space-8, 0.5rem);
36
+ width: 100%;
37
+ padding: var(--space-16, 1rem) var(--space-16, 1rem) var(--space-24, 1.5rem);
38
+ }
39
+
40
+ // Compliance lines: the quietest row on the page — small, muted, on
41
+ // their own line so filing numbers never wrap mid-sequence.
42
+ .hk-auth-screen-beian {
43
+ display: flex;
44
+ flex-direction: column;
45
+ align-items: center;
46
+ gap: var(--space-4, 0.25rem);
47
+ font-size: 0.75rem;
48
+ line-height: 1.5;
49
+ color: color-mix(in srgb, rgb(var(--color-text, 25 30 40)) 55%, transparent);
50
+ }
51
+
52
+ .hk-auth-screen-beian-link {
53
+ color: inherit;
54
+ text-decoration: none;
55
+
56
+ &:hover,
57
+ &:focus-visible {
58
+ color: color-mix(in srgb, rgb(var(--color-text, 25 30 40)) 80%, transparent);
59
+ text-decoration: underline;
60
+ }
61
+ }
62
+
63
+ .hk-auth-screen-beian-item {
64
+ color: inherit;
65
+ }