@celestia-island/hikari 0.55.501 → 0.55.503
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/types/components/HkDirectionalSwap.d.ts +157 -0
- package/dist/types/components/HkLoginFlow.d.ts +7 -4
- package/dist/types/components/centralAuthMarkData.d.ts +10 -0
- package/dist/types/components/loginProviders.d.ts +108 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/mermaid/types.d.ts +4 -1
- package/package.json +1 -1
- package/src/components/HkDirectionalSwap.scss +116 -0
- package/src/components/HkDirectionalSwap.test.tsx +224 -0
- package/src/components/HkDirectionalSwap.tsx +278 -0
- package/src/components/HkLoginFlow.test.tsx +107 -4
- package/src/components/HkLoginFlow.tsx +18 -7
- package/src/components/HkMermaidDiagram.scss +33 -0
- package/src/components/HkMermaidDiagram.test.tsx +45 -0
- package/src/components/HkMermaidDiagram.tsx +73 -0
- package/src/components/__tests__/hkMermaidLayout.test.ts +50 -0
- package/src/components/centralAuthMarkData.ts +35 -0
- package/src/components/loginProviders.test.ts +236 -0
- package/src/components/loginProviders.ts +132 -0
- package/src/errorLandingStandalone/error-landing.html +1 -1
- package/src/i18n/locales/ar/components.json +1 -0
- package/src/i18n/locales/de/components.json +1 -0
- package/src/i18n/locales/en/components.json +1 -0
- package/src/i18n/locales/es/components.json +1 -0
- package/src/i18n/locales/fr/components.json +1 -0
- package/src/i18n/locales/ja/components.json +1 -0
- package/src/i18n/locales/ko/components.json +1 -0
- package/src/i18n/locales/pt/components.json +1 -0
- package/src/i18n/locales/ru/components.json +1 -0
- package/src/i18n/locales/zh-Hans/components.json +1 -0
- package/src/i18n/locales/zh-Hant/components.json +1 -0
- package/src/index.ts +15 -0
- package/src/mermaid/layout.ts +19 -0
- package/src/mermaid/types.ts +16 -1
- package/src/wasm/mermaid/hikari_wasm_mermaid.js +1 -1
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HkDirectionalSwap — the state-keyed, DIRECTION-AWARE content swap.
|
|
3
|
+
*
|
|
4
|
+
* The sibling of HkCrossfade, for the one job a pure dissolve cannot
|
|
5
|
+
* express: a swap where the reader moved FORWARD or BACK, and the motion
|
|
6
|
+
* should say so. Panes slide in from one side and out to the other while
|
|
7
|
+
* they cross-fade — the vocabulary a step flow, a wizard, an onboarding
|
|
8
|
+
* carousel and a source/preview toggle all speak.
|
|
9
|
+
*
|
|
10
|
+
* Why a separate component and not a prop on HkCrossfade: that component's
|
|
11
|
+
* contract is "pure opacity, no transform, EVER" — its consumers (sidebar
|
|
12
|
+
* rail swap, login steps, tabs, settings) rely on the dissolve never
|
|
13
|
+
* translating anything, because a translated live region is a different
|
|
14
|
+
* layout. Adding motion there would silently change every one of them.
|
|
15
|
+
*
|
|
16
|
+
* Contracts this carries, all of them learned by the family's own swaps:
|
|
17
|
+
*
|
|
18
|
+
* - CONCURRENT, IN ONE CELL. Old and new occupy the same grid cell
|
|
19
|
+
* (HkCrossfade's geometry), so the surface keeps the taller
|
|
20
|
+
* generation's height for the whole exchange — a swap can never
|
|
21
|
+
* collapse the page mid-animation. No `mode="out-in"`: that would
|
|
22
|
+
* reintroduce an exit blank.
|
|
23
|
+
* - DIRECTION IS DATA, NOT A CLASS THE HOST HAS TO REMEMBER. `direction`
|
|
24
|
+
* flips the travel axis per swap: forward enters from the end edge and
|
|
25
|
+
* leaves through the start edge; back mirrors. RTL mirrors again (the
|
|
26
|
+
* stylesheet flips on `[dir="rtl"]`).
|
|
27
|
+
* - THE LEAVING COPY IS DEAD CONTENT. It gets `inert` + `aria-hidden` for
|
|
28
|
+
* the dissolve, so it leaves the tab order and the accessibility tree —
|
|
29
|
+
* a frozen duplicate of a pane is otherwise reachable by Tab and by a
|
|
30
|
+
* screen reader's virtual cursor.
|
|
31
|
+
* - REDUCED MOTION KEEPS THE FADE, DROPS THE TRAVEL. Translation is the
|
|
32
|
+
* part motion-sensitive readers ask to be spared; a short opacity
|
|
33
|
+
* exchange carries the change of state without it. (`HkPhaseTransition`
|
|
34
|
+
* precedent.)
|
|
35
|
+
* - CLIENT-ONLY. It measures nothing, but its Transition runs on the
|
|
36
|
+
* client; SSR renders the first generation only, which is the no-JS
|
|
37
|
+
* baseline hosts already ship.
|
|
38
|
+
* - A STALL WATCHDOG, same shape as HkCrossfade's: if the browser wedges
|
|
39
|
+
* the Transition engine (rAF frozen), the frozen leaving item is swept
|
|
40
|
+
* and the wrapper is dropped so keys apply synchronously from then on.
|
|
41
|
+
*/
|
|
42
|
+
import { type PropType } from "vue";
|
|
43
|
+
import "./HkDirectionalSwap.scss";
|
|
44
|
+
/** Which way the reader moved. See the module note. */
|
|
45
|
+
export type SwapDirection = "forward" | "back";
|
|
46
|
+
/**
|
|
47
|
+
* The direction a key change implies, given the two ends' positions in the
|
|
48
|
+
* host's own sequence. Pure, so a host can pin it without a DOM.
|
|
49
|
+
*
|
|
50
|
+
* Unknown positions (either key absent from `order`) resolve FORWARD: a
|
|
51
|
+
* content swap that is not a step (a tab, a mode toggle) still wants a
|
|
52
|
+
* consistent, repeatable direction rather than a flicker between two.
|
|
53
|
+
*/
|
|
54
|
+
export declare function resolveSwapDirection(order: ReadonlyArray<string | number>, previous: string | number, next: string | number): SwapDirection;
|
|
55
|
+
declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
56
|
+
/** Identity of the content on stage; changing it starts the swap. */
|
|
57
|
+
swapKey: {
|
|
58
|
+
type: PropType<string | number>;
|
|
59
|
+
required: true;
|
|
60
|
+
};
|
|
61
|
+
/** Travel direction of THIS swap. Hosts that own a sequence can derive
|
|
62
|
+
* it with `resolveSwapDirection`; a plain toggle passes `"forward"`. */
|
|
63
|
+
direction: {
|
|
64
|
+
type: PropType<SwapDirection>;
|
|
65
|
+
default: string;
|
|
66
|
+
};
|
|
67
|
+
/** Travel axis. `horizontal` (the default) is the reading-direction
|
|
68
|
+
* vocabulary: forward enters from the end edge. `vertical` is for
|
|
69
|
+
* stacked surfaces (a wizard moving down a page). */
|
|
70
|
+
axis: {
|
|
71
|
+
type: PropType<"horizontal" | "vertical">;
|
|
72
|
+
default: string;
|
|
73
|
+
};
|
|
74
|
+
/** Exchange duration, ms. Family default 300. */
|
|
75
|
+
duration: {
|
|
76
|
+
type: NumberConstructor;
|
|
77
|
+
default: number;
|
|
78
|
+
};
|
|
79
|
+
/** Travel distance, px. */
|
|
80
|
+
travel: {
|
|
81
|
+
type: NumberConstructor;
|
|
82
|
+
default: number;
|
|
83
|
+
};
|
|
84
|
+
/** Drop the Transition wrapper entirely (synchronous key swaps) — the
|
|
85
|
+
* escape a host uses when it knows the engine is wedged, and what the
|
|
86
|
+
* watchdog switches to on its own. */
|
|
87
|
+
disabled: {
|
|
88
|
+
type: BooleanConstructor;
|
|
89
|
+
default: boolean;
|
|
90
|
+
};
|
|
91
|
+
tag: {
|
|
92
|
+
type: StringConstructor;
|
|
93
|
+
default: string;
|
|
94
|
+
};
|
|
95
|
+
}>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
96
|
+
/** Fired once the exchange settles — hosts forward this to their own
|
|
97
|
+
* scrollers/focus management, the HkTransitionContainer contract. */
|
|
98
|
+
swap: (_payload: {
|
|
99
|
+
key: string | number;
|
|
100
|
+
previous: string | number;
|
|
101
|
+
direction: SwapDirection;
|
|
102
|
+
}) => true;
|
|
103
|
+
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
104
|
+
/** Identity of the content on stage; changing it starts the swap. */
|
|
105
|
+
swapKey: {
|
|
106
|
+
type: PropType<string | number>;
|
|
107
|
+
required: true;
|
|
108
|
+
};
|
|
109
|
+
/** Travel direction of THIS swap. Hosts that own a sequence can derive
|
|
110
|
+
* it with `resolveSwapDirection`; a plain toggle passes `"forward"`. */
|
|
111
|
+
direction: {
|
|
112
|
+
type: PropType<SwapDirection>;
|
|
113
|
+
default: string;
|
|
114
|
+
};
|
|
115
|
+
/** Travel axis. `horizontal` (the default) is the reading-direction
|
|
116
|
+
* vocabulary: forward enters from the end edge. `vertical` is for
|
|
117
|
+
* stacked surfaces (a wizard moving down a page). */
|
|
118
|
+
axis: {
|
|
119
|
+
type: PropType<"horizontal" | "vertical">;
|
|
120
|
+
default: string;
|
|
121
|
+
};
|
|
122
|
+
/** Exchange duration, ms. Family default 300. */
|
|
123
|
+
duration: {
|
|
124
|
+
type: NumberConstructor;
|
|
125
|
+
default: number;
|
|
126
|
+
};
|
|
127
|
+
/** Travel distance, px. */
|
|
128
|
+
travel: {
|
|
129
|
+
type: NumberConstructor;
|
|
130
|
+
default: number;
|
|
131
|
+
};
|
|
132
|
+
/** Drop the Transition wrapper entirely (synchronous key swaps) — the
|
|
133
|
+
* escape a host uses when it knows the engine is wedged, and what the
|
|
134
|
+
* watchdog switches to on its own. */
|
|
135
|
+
disabled: {
|
|
136
|
+
type: BooleanConstructor;
|
|
137
|
+
default: boolean;
|
|
138
|
+
};
|
|
139
|
+
tag: {
|
|
140
|
+
type: StringConstructor;
|
|
141
|
+
default: string;
|
|
142
|
+
};
|
|
143
|
+
}>> & Readonly<{
|
|
144
|
+
onSwap?: ((_payload: {
|
|
145
|
+
key: string | number;
|
|
146
|
+
previous: string | number;
|
|
147
|
+
direction: SwapDirection;
|
|
148
|
+
}) => any) | undefined;
|
|
149
|
+
}>, {
|
|
150
|
+
direction: SwapDirection;
|
|
151
|
+
disabled: boolean;
|
|
152
|
+
axis: "horizontal" | "vertical";
|
|
153
|
+
tag: string;
|
|
154
|
+
duration: number;
|
|
155
|
+
travel: number;
|
|
156
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
157
|
+
export default _default;
|
|
@@ -86,10 +86,13 @@ export type HkLoginChannel = HkLoginCredentialsChannel | HkLoginSsoChannel;
|
|
|
86
86
|
* - `v-model` (channel key) + `channels` — the segment group.
|
|
87
87
|
* - `step` — `'account' | 'verify'`; the host flips it when its ladder
|
|
88
88
|
* answers with factors, and the SAME card swaps its header copy and
|
|
89
|
-
* body over to the step-up
|
|
90
|
-
*
|
|
91
|
-
*
|
|
92
|
-
*
|
|
89
|
+
* body over to the step-up. A redirect (sso) channel has no second step
|
|
90
|
+
* of its own, so `step="verify"` without an announced factor table
|
|
91
|
+
* renders the account body as a fail-safe — but a host that RECEIVED a
|
|
92
|
+
* ladder (the OAuth hand-off calling back with `mfa_pending` /
|
|
93
|
+
* `mfa_factors`, which is the only way an SSO-only deployment can ask
|
|
94
|
+
* for a second factor) passes `verifyFactors` and gets the real step-up
|
|
95
|
+
* on the sso channel too.
|
|
93
96
|
* - `account-submit(channel, username, password)` — credentials
|
|
94
97
|
* channel submitted (password is empty while `passwordField` is off).
|
|
95
98
|
* - `sso-click(channel)` — the primary sso row was picked.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The central identity provider's mark, ready for `src=` / CSS `url(…)`.
|
|
3
|
+
*
|
|
4
|
+
* A 64×64 WebP data URI (transparent background) generated from the landing
|
|
5
|
+
* repo's logo — the single home for Celestia artwork — and committed as text
|
|
6
|
+
* so no host has to serve or resolve a separate asset file. Render it at
|
|
7
|
+
* 16×16; the source carries a 2 px margin so it optically matches the
|
|
8
|
+
* surrounding icons.
|
|
9
|
+
*/
|
|
10
|
+
export declare const hkCentralAuthMarkSrc = "data:image/webp;base64,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";
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The built-in presentation of the central identity provider's sign-in row.
|
|
3
|
+
*
|
|
4
|
+
* Celestia's central identity provider has one wire id (`"erp"` — the id every
|
|
5
|
+
* live service already emits, which this module deliberately does NOT rename)
|
|
6
|
+
* and no name or icon of its own. Every host therefore shipped its own answer:
|
|
7
|
+
* a bare id in the row, or a hand-typed "Celestia ID" with no mark. This module
|
|
8
|
+
* is the single home for both, so chest, 0721 and future front ends render the
|
|
9
|
+
* same row.
|
|
10
|
+
*
|
|
11
|
+
* The module is free of Vue dependencies EXCEPT for reading the name out of
|
|
12
|
+
* hikari's own i18n context ({@link hkCentralAuthName}): the predicate and the
|
|
13
|
+
* constants below stay pure, so a non-Vue consumer can still import them.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```tsx
|
|
17
|
+
* import {
|
|
18
|
+
* HK_CENTRAL_AUTH_PROVIDER_ID, hkCentralAuthMarkSrc, hkCentralAuthName,
|
|
19
|
+
* hkProviderLabelIsId,
|
|
20
|
+
* } from "@celestia-island/hikari/vue";
|
|
21
|
+
*
|
|
22
|
+
* const name = hkCentralAuthName();
|
|
23
|
+
* const label =
|
|
24
|
+
* method.provider === HK_CENTRAL_AUTH_PROVIDER_ID && hkProviderLabelIsId(method.provider, method.label)
|
|
25
|
+
* ? name
|
|
26
|
+
* : method.label;
|
|
27
|
+
* const icon =
|
|
28
|
+
* method.provider === HK_CENTRAL_AUTH_PROVIDER_ID && !method.icon
|
|
29
|
+
* ? hkCentralAuthMarkSrc
|
|
30
|
+
* : method.icon;
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* The rules a host must honour, in order of precedence:
|
|
34
|
+
*
|
|
35
|
+
* 1. **Nothing an operator configures is overridden.** A provider `label` or
|
|
36
|
+
* `icon` set in the host's own configuration always wins; a deployment that
|
|
37
|
+
* renames the row to its company's portal keeps that name.
|
|
38
|
+
* 2. **The built-in name fills a fallback, not a default.** Serve the translated
|
|
39
|
+
* name only when the label has degenerated to the id — the long-standing
|
|
40
|
+
* server-side convention where an unset label is emitted as the id. Use
|
|
41
|
+
* `hkProviderLabelIsId` for that test; it matches the id exactly, so a
|
|
42
|
+
* deliberately lower-cased alias ("erp-europe") is left alone. Read the name
|
|
43
|
+
* through {@link hkCentralAuthName}.
|
|
44
|
+
* 3. **The built-in mark fills a gap, not a default.** Use
|
|
45
|
+
* {@link hkCentralAuthMarkSrc} only when the server supplied no icon.
|
|
46
|
+
* 4. **A deployment that does not configure this provider sees no change.** The
|
|
47
|
+
* self-hosted default is still local username/password: nothing here is
|
|
48
|
+
* imported unless the login-policy document actually lists the provider.
|
|
49
|
+
* 5. **The icon is a 64×64 inline WebP data URI.** Render it at 16×16 — the
|
|
50
|
+
* same box as the surrounding row glyphs; the source is scaled for exactly
|
|
51
|
+
* that and carries the margin to match their optical weight.
|
|
52
|
+
*/
|
|
53
|
+
/**
|
|
54
|
+
* The central identity provider's wire id: the value every live host already
|
|
55
|
+
* emits in its login-policy document under `methods[].provider`.
|
|
56
|
+
*
|
|
57
|
+
* This is a wire contract with kirino and with each deployed service. It is
|
|
58
|
+
* named here so a host does not have to hard-code the literal, NOT to
|
|
59
|
+
* introduce a new id — the asset in this module (name and mark) is what
|
|
60
|
+
* changed, the id is not.
|
|
61
|
+
*/
|
|
62
|
+
export declare const HK_CENTRAL_AUTH_PROVIDER_ID = "erp";
|
|
63
|
+
/**
|
|
64
|
+
* The i18n key of the provider's display name, in every shipped locale.
|
|
65
|
+
*
|
|
66
|
+
* `hkCentralAuthName()` reads it; a host whose own catalog merges the
|
|
67
|
+
* `hikari::` keys may also pass it to its `t()` directly, with
|
|
68
|
+
* {@link HK_CENTRAL_AUTH_NAME_EN} as the fallback.
|
|
69
|
+
*/
|
|
70
|
+
export declare const HK_CENTRAL_AUTH_NAME_KEY = "hikari::loginFlow.providerCelestiaAuth";
|
|
71
|
+
/** The provider's display name in English — the canonical literal and the
|
|
72
|
+
* fallback behind {@link HK_CENTRAL_AUTH_NAME_KEY}. */
|
|
73
|
+
export declare const HK_CENTRAL_AUTH_NAME_EN = "Celestia Unified Authentication Platform";
|
|
74
|
+
/**
|
|
75
|
+
* The provider's display name in the language hikari's locale context is
|
|
76
|
+
* currently in — THE entry point hosts should render.
|
|
77
|
+
*
|
|
78
|
+
* Why not `t(HK_CENTRAL_AUTH_NAME_KEY, HK_CENTRAL_AUTH_NAME_EN)` in the host's
|
|
79
|
+
* own translator: that only works for a host whose i18n catalog actually merges
|
|
80
|
+
* hikari's `hikari::` keys. 0721's vue-i18n instance deliberately does not, so
|
|
81
|
+
* the same call would sit on the English fallback in every language. Every host
|
|
82
|
+
* does, however, keep hikari's context in step with the app language when the
|
|
83
|
+
* user switches (`setLocale` / `setHikariLocale` on that switch), which is
|
|
84
|
+
* exactly the state this function reads — so it is the one spelling that works
|
|
85
|
+
* everywhere. A host that DOES merge the keys may keep using `t(...)` with
|
|
86
|
+
* {@link HK_CENTRAL_AUTH_NAME_KEY} and {@link HK_CENTRAL_AUTH_NAME_EN}.
|
|
87
|
+
*
|
|
88
|
+
* Reads hikari's reactive locale state, so calling it inside a render or a
|
|
89
|
+
* `computed` makes the row re-render on a language switch. Call it there — do
|
|
90
|
+
* not hoist the result into a module-level constant, which would freeze
|
|
91
|
+
* whichever language happened to be active at import time. It returns whatever
|
|
92
|
+
* hikari's current language is; a host that never calls `setLocale` sees
|
|
93
|
+
* English.
|
|
94
|
+
*/
|
|
95
|
+
export declare function hkCentralAuthName(): string;
|
|
96
|
+
/**
|
|
97
|
+
* Whether a provider's `label` has degenerated to its id — the server-side
|
|
98
|
+
* convention for "the operator did not name this provider", so the host should
|
|
99
|
+
* substitute its built-in name.
|
|
100
|
+
*
|
|
101
|
+
* True when the label is absent, empty, or whitespace only, and when it equals
|
|
102
|
+
* `providerId` character for character. Case differences are NOT a match:
|
|
103
|
+
* `"ERP"` over `"erp"` is a name an operator typed, and a host must not
|
|
104
|
+
* overwrite it. An empty `providerId` is never a match — every empty label
|
|
105
|
+
* would otherwise collapse onto it.
|
|
106
|
+
*/
|
|
107
|
+
export declare function hkProviderLabelIsId(providerId: string, label: string | null | undefined): boolean;
|
|
108
|
+
export { hkCentralAuthMarkSrc } from "./centralAuthMarkData";
|
package/dist/types/index.d.ts
CHANGED
|
@@ -302,6 +302,8 @@ export { default as HkConfirmDialog } from "./components/HkConfirmDialog";
|
|
|
302
302
|
export { default as HkCrossfade } from "./components/HkCrossfade";
|
|
303
303
|
export { default as HkDebugFloat } from "./components/HkDebugFloat";
|
|
304
304
|
export { clampDebugFloatPosition, debugFloatStorageKey, HK_DEBUG_FLOAT_DOCUMENT_Z, HK_DEBUG_FLOAT_STORAGE_PREFIX, type HkDebugFloatCorner, type HkDebugFloatPersisted, type HkDebugFloatSection, } from "./components/debugFloat";
|
|
305
|
+
export { default as HkDirectionalSwap, resolveSwapDirection } from "./components/HkDirectionalSwap";
|
|
306
|
+
export type { SwapDirection } from "./components/HkDirectionalSwap";
|
|
305
307
|
export { default as HkTransitionContainer } from "./components/HkTransitionContainer";
|
|
306
308
|
export { default as HkPaneHolder } from "./components/HkPaneHolder";
|
|
307
309
|
export { default as HkWindowControls, isApplePlatform } from "./components/HkWindowControls";
|
|
@@ -502,6 +504,7 @@ export { type HkAuthChannelListEntry as HkAuthChannelListEntry } from "./compone
|
|
|
502
504
|
export { HkAuthHandoff as HkAuthHandoff } from "./components/HkAuthHandoff";
|
|
503
505
|
export { type HkAuthHandoffAction as HkAuthHandoffAction, type HkAuthHandoffStatus as HkAuthHandoffStatus, } from "./components/HkAuthHandoff";
|
|
504
506
|
export { hkIsSameOriginPath as hkIsSameOriginPath, hkLoginPlanFromDiscovery as hkLoginPlanFromDiscovery, hkRelayEntryHref as hkRelayEntryHref, type HkLoginDiscovery as HkLoginDiscovery, type HkLoginMethod as HkLoginMethod, type HkLoginMode as HkLoginMode, type HkLoginPlan as HkLoginPlan, type HkLoginPlanCopy as HkLoginPlanCopy, } from "./components/loginDiscovery";
|
|
507
|
+
export { HK_CENTRAL_AUTH_NAME_EN as HK_CENTRAL_AUTH_NAME_EN, HK_CENTRAL_AUTH_NAME_KEY as HK_CENTRAL_AUTH_NAME_KEY, HK_CENTRAL_AUTH_PROVIDER_ID as HK_CENTRAL_AUTH_PROVIDER_ID, hkCentralAuthMarkSrc as hkCentralAuthMarkSrc, hkCentralAuthName as hkCentralAuthName, hkProviderLabelIsId as hkProviderLabelIsId, } from "./components/loginProviders";
|
|
505
508
|
export { HkLocalePicker as HkLocalePicker } from "./components/HkLocalePicker";
|
|
506
509
|
export { HkAdminTablePage as HkAdminTablePage } from "./components/HkAdminTablePage";
|
|
507
510
|
export { HkMasterDetail as HkMasterDetail } from "./components/HkMasterDetail";
|
|
@@ -19,7 +19,10 @@
|
|
|
19
19
|
/** Flow direction of a node-edge diagram. */
|
|
20
20
|
export type MermaidDirection = "TD" | "BT" | "LR" | "RL";
|
|
21
21
|
/** Node border shape (the four shapes the family grammar supports). */
|
|
22
|
-
|
|
22
|
+
/** Node border shape. The Rust grammar emits these tokens (see
|
|
23
|
+
* `packages/wasm/mermaid/src/mermaid/types.rs` NodeShape); every one of them
|
|
24
|
+
* is painted by HkMermaidDiagram's node slot. */
|
|
25
|
+
export type MermaidNodeShape = "rect" | "rounded" | "diamond" | "circle" | "stadium" | "subroutine" | "cylinder" | "hexagon" | "parallelogram" | "trapezoid" | "asymmetric" | "doublecircle";
|
|
23
26
|
export interface MermaidNode {
|
|
24
27
|
id: string;
|
|
25
28
|
label: string;
|
package/package.json
CHANGED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
// HkDirectionalSwap — state-keyed, direction-aware content exchange.
|
|
2
|
+
//
|
|
3
|
+
// Geometry is HkCrossfade's (one-cell grid, both generations stacked in
|
|
4
|
+
// the SAME cell) so the surface keeps the taller generation's height for
|
|
5
|
+
// the whole exchange and can never collapse mid-swap. What this sheet adds
|
|
6
|
+
// is the TRAVEL: the outgoing copy leaves toward one edge while the
|
|
7
|
+
// incoming copy arrives from the other, each riding its own opacity ramp.
|
|
8
|
+
//
|
|
9
|
+
// Direction is data on the host (`data-direction`), axis too
|
|
10
|
+
// (`data-axis`), and RTL mirrors the horizontal vocabulary — the reader's
|
|
11
|
+
// "forward" is the reading direction's end edge, not the screen's right.
|
|
12
|
+
//
|
|
13
|
+
// Reduced motion keeps the opacity exchange and zeroes the travel: motion
|
|
14
|
+
// is what the preference is about, and the fade already carries the change
|
|
15
|
+
// of state (HkPhaseTransition precedent).
|
|
16
|
+
|
|
17
|
+
.hk-dswap {
|
|
18
|
+
display: grid;
|
|
19
|
+
overflow: clip;
|
|
20
|
+
|
|
21
|
+
> .hk-dswap-item {
|
|
22
|
+
grid-area: 1 / 1;
|
|
23
|
+
width: 100%;
|
|
24
|
+
min-width: 0;
|
|
25
|
+
// The block-axis twin: a grid item refuses to shrink below its content,
|
|
26
|
+
// which would let whole-pane swaps overflow a constrained host.
|
|
27
|
+
min-height: 0;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// ── travel ───────────────────────────────────────────────────────────
|
|
32
|
+
// The entering copy starts offset toward the edge it comes FROM and
|
|
33
|
+
// settles to 0; the leaving copy goes on to the opposite edge. Offsets are
|
|
34
|
+
// CSS custom properties so one rule set serves both axes.
|
|
35
|
+
|
|
36
|
+
.hk-dswap[data-axis="horizontal"] {
|
|
37
|
+
--hk-dswap-enter-from: translateX(var(--hk-swap-travel, 24px));
|
|
38
|
+
--hk-dswap-leave-to: translateX(calc(-1 * var(--hk-swap-travel, 24px)));
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.hk-dswap[data-axis="horizontal"][data-direction="back"] {
|
|
42
|
+
--hk-dswap-enter-from: translateX(calc(-1 * var(--hk-swap-travel, 24px)));
|
|
43
|
+
--hk-dswap-leave-to: translateX(var(--hk-swap-travel, 24px));
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.hk-dswap[data-axis="vertical"] {
|
|
47
|
+
--hk-dswap-enter-from: translateY(var(--hk-swap-travel, 24px));
|
|
48
|
+
--hk-dswap-leave-to: translateY(calc(-1 * var(--hk-swap-travel, 24px)));
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.hk-dswap[data-axis="vertical"][data-direction="back"] {
|
|
52
|
+
--hk-dswap-enter-from: translateY(calc(-1 * var(--hk-swap-travel, 24px)));
|
|
53
|
+
--hk-dswap-leave-to: translateY(var(--hk-swap-travel, 24px));
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// RTL mirrors the horizontal vocabulary: "forward" travels the other way on
|
|
57
|
+
// screen because the reading direction does.
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
// RTL mirrors the horizontal vocabulary: "forward" travels the other way on
|
|
61
|
+
// screen because the reading direction does.
|
|
62
|
+
[dir="rtl"] .hk-dswap[data-axis="horizontal"] {
|
|
63
|
+
--hk-dswap-enter-from: translateX(calc(-1 * var(--hk-swap-travel, 24px)));
|
|
64
|
+
--hk-dswap-leave-to: translateX(var(--hk-swap-travel, 24px));
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
[dir="rtl"] .hk-dswap[data-axis="horizontal"][data-direction="back"] {
|
|
68
|
+
--hk-dswap-enter-from: translateX(var(--hk-swap-travel, 24px));
|
|
69
|
+
--hk-dswap-leave-to: translateX(calc(-1 * var(--hk-swap-travel, 24px)));
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// ── exchange ─────────────────────────────────────────────────────────
|
|
73
|
+
// Both sides run the same duration with an ease-OUT curve: midway through
|
|
74
|
+
// the swap the incoming layer already carries most of the opacity while
|
|
75
|
+
// the outgoing one has shed most of its, so the composite never dips toward
|
|
76
|
+
// the background (the double-exposure artifact of symmetric fades).
|
|
77
|
+
|
|
78
|
+
.hk-dswap-enter-active {
|
|
79
|
+
transition:
|
|
80
|
+
opacity var(--hk-swap-duration, 300ms) var(--ease-out-expo, cubic-bezier(0.19, 1, 0.22, 1)),
|
|
81
|
+
transform var(--hk-swap-duration, 300ms) var(--ease-out-expo, cubic-bezier(0.19, 1, 0.22, 1));
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.hk-dswap-leave-active {
|
|
85
|
+
transition:
|
|
86
|
+
opacity var(--hk-swap-duration, 300ms) ease-out,
|
|
87
|
+
transform var(--hk-swap-duration, 300ms) ease-out;
|
|
88
|
+
// Dead content for the exchange: `inert`/`aria-hidden` (component side)
|
|
89
|
+
// cover keyboard and the a11y tree; this covers the pointer.
|
|
90
|
+
pointer-events: none;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.hk-dswap-enter-from {
|
|
94
|
+
opacity: 0;
|
|
95
|
+
transform: var(--hk-dswap-enter-from);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.hk-dswap-leave-to {
|
|
99
|
+
opacity: 0;
|
|
100
|
+
transform: var(--hk-dswap-leave-to);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// Reduced motion: keep the fade (shortened), drop the travel entirely — the
|
|
104
|
+
// component also zeroes `--hk-swap-travel`, this is the belt to that brace
|
|
105
|
+
// for a host that sets the property itself.
|
|
106
|
+
@media (prefers-reduced-motion: reduce) {
|
|
107
|
+
.hk-dswap-enter-active,
|
|
108
|
+
.hk-dswap-leave-active {
|
|
109
|
+
transition: opacity var(--duration-fast, 0.15s) ease;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.hk-dswap-enter-from,
|
|
113
|
+
.hk-dswap-leave-to {
|
|
114
|
+
transform: none;
|
|
115
|
+
}
|
|
116
|
+
}
|