@celestia-island/hikari 0.55.458 → 0.55.460
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/HkAuthChannelList.d.ts +66 -0
- package/dist/types/components/HkLoginFlow.d.ts +13 -12
- package/dist/types/components/HkMarkdownEditor.d.ts +123 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/mermaid/wasmEngine.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/HkAuthChannelList.scss +83 -0
- package/src/components/HkAuthChannelList.test.tsx +74 -0
- package/src/components/HkAuthChannelList.tsx +88 -0
- package/src/components/HkDiffViewer.epoch.test.tsx +28 -10
- package/src/components/HkLoginFlow.scss +3 -5
- package/src/components/HkLoginFlow.test.tsx +20 -13
- package/src/components/HkLoginFlow.tsx +24 -19
- package/src/components/HkMarkdownEditor.barrel.test.ts +42 -0
- package/src/components/HkMarkdownEditor.scss +190 -0
- package/src/components/HkMarkdownEditor.test.tsx +404 -0
- package/src/components/HkMarkdownEditor.tsx +357 -0
- package/src/composables/useHighlight.coldPath.test.ts +162 -0
- package/src/composables/useHighlight.hostSurface.test.ts +220 -0
- package/src/composables/useHighlight.ts +102 -27
- package/src/i18n/locales/ar/components.json +14 -1
- package/src/i18n/locales/de/components.json +14 -1
- package/src/i18n/locales/en/components.json +14 -1
- package/src/i18n/locales/es/components.json +14 -1
- package/src/i18n/locales/fr/components.json +14 -1
- package/src/i18n/locales/ja/components.json +14 -1
- package/src/i18n/locales/ko/components.json +14 -1
- package/src/i18n/locales/pt/components.json +14 -1
- package/src/i18n/locales/ru/components.json +14 -1
- package/src/i18n/locales/zh-Hans/components.json +14 -1
- package/src/i18n/locales/zh-Hant/components.json +14 -1
- package/src/index.ts +4 -0
- package/src/mermaid/wasmEngine.ts +1 -1
- package/src/scene3d/wasmFleetSpec.ts +1 -1
- package/src/utils/qr/qrEncoder.ts +6 -1
- package/src/wasm/highlight/hikari_wasm_highlight.d.ts +3 -2
- package/src/wasm/highlight/hikari_wasm_highlight.js +486 -160
- package/src/wasm/highlight/interfaces/celestia-hikari-highlight-types.d.ts +4 -0
- package/src/wasm/highlight/interfaces/wasi-cli-exit.d.ts +1 -0
- package/src/wasm/highlight/interfaces/wasi-clocks-monotonic-clock.d.ts +2 -0
- package/src/wasm/highlight/interfaces/wasi-clocks-wall-clock.d.ts +6 -0
- package/src/wasm/mermaid/hikari_wasm_mermaid.d.ts +3 -2
- package/src/wasm/mermaid/hikari_wasm_mermaid.js +487 -161
- package/src/wasm/mermaid/interfaces/celestia-hikari-mermaid-types.d.ts +4 -0
- package/src/wasm/mermaid/interfaces/wasi-cli-exit.d.ts +1 -0
- package/src/wasm/mermaid/interfaces/wasi-clocks-monotonic-clock.d.ts +2 -0
- package/src/wasm/mermaid/interfaces/wasi-clocks-wall-clock.d.ts +6 -0
- package/src/wasm/qr/hikari_wasm_qr.d.ts +4 -3
- package/src/wasm/qr/hikari_wasm_qr.js +475 -155
- package/src/wasm/qr/interfaces/{hikari-qr-types.d.ts → celestia-hikari-qr-types.d.ts} +1 -2
- package/src/wasm/qr/interfaces/wasi-cli-exit.d.ts +1 -0
- package/src/wasm/qr/interfaces/wasi-clocks-monotonic-clock.d.ts +2 -0
- package/src/wasm/qr/interfaces/wasi-clocks-wall-clock.d.ts +6 -0
- package/src/wasm/scene3d/hikari_wasm_scene3d.d.ts +4 -3
- package/src/wasm/scene3d/hikari_wasm_scene3d.js +482 -161
- package/src/wasm/scene3d/interfaces/{hikari-scene3d-types.d.ts → celestia-hikari-scene3d-types.d.ts} +1 -1
- package/src/wasm/scene3d/interfaces/wasi-cli-exit.d.ts +1 -0
- package/src/wasm/scene3d/interfaces/wasi-clocks-monotonic-clock.d.ts +2 -0
- package/src/wasm/scene3d/interfaces/wasi-clocks-wall-clock.d.ts +6 -0
- package/src/wasm/highlight/interfaces/hikari-highlight-types.d.ts +0 -4
- package/src/wasm/mermaid/interfaces/hikari-mermaid-types.d.ts +0 -4
|
@@ -3,8 +3,7 @@ import { computed, defineComponent, ref, type PropType } from "vue";
|
|
|
3
3
|
import { useI18n } from "../i18n/context";
|
|
4
4
|
import { asPropType } from "../utils/typing";
|
|
5
5
|
import { HkAuthCard } from "./HkAuthCard";
|
|
6
|
-
import
|
|
7
|
-
import { HkAuthSsoButton } from "./HkAuthSsoButton";
|
|
6
|
+
import { HkAuthChannelList, type HkAuthChannelListEntry } from "./HkAuthChannelList";
|
|
8
7
|
import { HkMfaVerifyCard, type HkMfaFactor } from "./HkMfaVerifyCard";
|
|
9
8
|
import { HkSignInCard } from "./HkSignInCard";
|
|
10
9
|
import HkStepFlow from "./HkStepFlow";
|
|
@@ -45,28 +44,29 @@ export interface HkLoginCredentialsChannel {
|
|
|
45
44
|
* opening card must not ask for it (2026-11 user direction). */
|
|
46
45
|
passwordField?: boolean;
|
|
47
46
|
submitLabel?: string;
|
|
48
|
-
/** Alternative sign-in
|
|
47
|
+
/** Alternative sign-in rows under the form (rendered only when
|
|
49
48
|
* non-empty; an empty list omits the whole methods block instead of
|
|
50
49
|
* padding a dead strip). */
|
|
51
|
-
methods?:
|
|
52
|
-
/** Divider text above the
|
|
50
|
+
methods?: HkAuthChannelListEntry[];
|
|
51
|
+
/** Divider text above the rows; consumer-localized on purpose. */
|
|
53
52
|
methodsDivider?: string;
|
|
54
53
|
}
|
|
55
54
|
|
|
56
55
|
/** A channel whose whole sign-in is one redirect (a.celestia.world's
|
|
57
|
-
* "Celestia"
|
|
58
|
-
* only offers Feishu): the card renders
|
|
59
|
-
*
|
|
56
|
+
* "Celestia" row jumping to the central login, an org channel that
|
|
57
|
+
* only offers Feishu): the card renders the standard channel list —
|
|
58
|
+
* one full-width row naming the destination — and `sso-click` sends
|
|
59
|
+
* the host off to build its OAuth URL. */
|
|
60
60
|
export interface HkLoginSsoChannel {
|
|
61
61
|
key: string;
|
|
62
62
|
mode: "sso";
|
|
63
63
|
label?: string;
|
|
64
64
|
title?: string;
|
|
65
65
|
subtitle?: string;
|
|
66
|
-
/** Provider mark for the
|
|
66
|
+
/** Provider mark for the row (brand SVG, <img>, …). Loose-typed like
|
|
67
67
|
* every auth icon: hosts materialize hikari against their own vue. */
|
|
68
68
|
icon: unknown;
|
|
69
|
-
/**
|
|
69
|
+
/** The row's label (accessible name + visible text); defaults to the
|
|
70
70
|
* label. */
|
|
71
71
|
buttonLabel?: string;
|
|
72
72
|
disabled?: boolean;
|
|
@@ -85,7 +85,7 @@ export type HkLoginChannel = HkLoginCredentialsChannel | HkLoginSsoChannel;
|
|
|
85
85
|
* visual — the pill segment group (hidden when a deployment offers a
|
|
86
86
|
* single channel; a lone dead segment reads as a broken switch), the
|
|
87
87
|
* height-morphing channel swap, the direction-aware account→verify
|
|
88
|
-
* slide, the methods
|
|
88
|
+
* slide, the methods rows, the MFA card — while staying a CONTROLLED
|
|
89
89
|
* component: no endpoint, no URL building, no factor ladder policy.
|
|
90
90
|
* Each host (the chest migration plus the erp and arona login surfaces,
|
|
91
91
|
* landing as their own PRs) keeps its own auth client and drives the
|
|
@@ -99,8 +99,8 @@ export type HkLoginChannel = HkLoginCredentialsChannel | HkLoginSsoChannel;
|
|
|
99
99
|
* channel renders the account card as a fail-safe).
|
|
100
100
|
* - `account-submit(channel, username, password)` — credentials
|
|
101
101
|
* channel submitted (password is empty while `passwordField` is off).
|
|
102
|
-
* - `method-select(channel, key)` — an alternative
|
|
103
|
-
* - `sso-click(channel)` — the primary sso
|
|
102
|
+
* - `method-select(channel, key)` — an alternative method row was picked.
|
|
103
|
+
* - `sso-click(channel)` — the primary sso row was picked.
|
|
104
104
|
* - `verify(kind, proof)` / `verify-resend` / `verify-back` — the MFA
|
|
105
105
|
* card's events, re-emitted one level up.
|
|
106
106
|
*
|
|
@@ -256,7 +256,7 @@ export const HkLoginFlow = defineComponent({
|
|
|
256
256
|
...(methods.length > 0
|
|
257
257
|
? {
|
|
258
258
|
methods: () => (
|
|
259
|
-
<
|
|
259
|
+
<HkAuthChannelList
|
|
260
260
|
divider={channel.methodsDivider}
|
|
261
261
|
methods={methods}
|
|
262
262
|
onSelect={(key: string) => emit("method-select", channel.key, key)}
|
|
@@ -291,11 +291,16 @@ export const HkLoginFlow = defineComponent({
|
|
|
291
291
|
<>
|
|
292
292
|
{tabsEl()}
|
|
293
293
|
<div class="hk-login-flow-sso">
|
|
294
|
-
<
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
294
|
+
<HkAuthChannelList
|
|
295
|
+
methods={[
|
|
296
|
+
{
|
|
297
|
+
key: channel.key,
|
|
298
|
+
label: channel.buttonLabel ?? channelLabel(channel),
|
|
299
|
+
icon: channel.icon,
|
|
300
|
+
disabled: channel.disabled,
|
|
301
|
+
},
|
|
302
|
+
]}
|
|
303
|
+
onSelect={() => emit("sso-click", channel.key)}
|
|
299
304
|
/>
|
|
300
305
|
</div>
|
|
301
306
|
</>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
HkMarkdownEditor,
|
|
5
|
+
applyLinePrefix,
|
|
6
|
+
applyWrap,
|
|
7
|
+
type HkMarkdownEditorMode,
|
|
8
|
+
type MarkdownTextEdit,
|
|
9
|
+
} from "../index";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Public barrel guard for HkMarkdownEditor (R3 review: deleting the
|
|
13
|
+
* component's export block from src/index.ts kept the entire suite green
|
|
14
|
+
* — every other test reaches the module through the direct
|
|
15
|
+
* "./HkMarkdownEditor" path, so only an external consumer would have
|
|
16
|
+
* noticed). Same shape as HkRangeRibbon.barrel.test.ts.
|
|
17
|
+
*/
|
|
18
|
+
describe("the public barrel", () => {
|
|
19
|
+
it("re-exports the editor component under its public name", () => {
|
|
20
|
+
expect(HkMarkdownEditor, "HkMarkdownEditor must be re-exported").toBeTruthy();
|
|
21
|
+
expect(HkMarkdownEditor.name).toBe("HkMarkdownEditor");
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
it("re-exports the pure toolbar helpers hosts share", () => {
|
|
25
|
+
expect(typeof applyWrap, "applyWrap must be re-exported").toBe("function");
|
|
26
|
+
expect(typeof applyLinePrefix, "applyLinePrefix must be re-exported").toBe("function");
|
|
27
|
+
expect(applyWrap("ab", 0, 2, "**").text).toBe("**ab**");
|
|
28
|
+
expect(applyLinePrefix("x", 0, 1, "- ").text).toBe("- x");
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it("re-exports the editor's public types", () => {
|
|
32
|
+
// Type-only exports vanish at runtime, so each one is CONSUMED here: a
|
|
33
|
+
// dropped `type …` line fails vue-tsc on this file instead of leaving
|
|
34
|
+
// the runtime suite green.
|
|
35
|
+
const mode: HkMarkdownEditorMode = "plain";
|
|
36
|
+
const edit: MarkdownTextEdit = applyWrap("hi", 0, 0, "`");
|
|
37
|
+
expect(edit.text).toBe("``hi");
|
|
38
|
+
expect(edit.selectionStart).toBe(1);
|
|
39
|
+
expect(edit.selectionEnd).toBe(1);
|
|
40
|
+
expect(mode).toBe("plain");
|
|
41
|
+
});
|
|
42
|
+
});
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
// HkMarkdownEditor chrome — the two-pane markdown/plain editor.
|
|
2
|
+
//
|
|
3
|
+
// All colors ride hikari's token triplets (`rgb(var(--color-*))`,
|
|
4
|
+
// `color-mix`), spacing/radius/motion ride the `--space-*` / `--radius-*`
|
|
5
|
+
// / `--duration-*` / `--ease-*` families — no hardcoded hex anywhere, so
|
|
6
|
+
// every theme layer restyles the editor with zero per-component overrides.
|
|
7
|
+
|
|
8
|
+
.hk-md-editor {
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-direction: column;
|
|
11
|
+
width: 100%;
|
|
12
|
+
min-width: 0;
|
|
13
|
+
border: 1px solid var(--border-faint);
|
|
14
|
+
border-radius: var(--radius-md, 8px);
|
|
15
|
+
background: color-mix(in srgb, rgb(var(--color-surface)) 55%, transparent);
|
|
16
|
+
color: rgb(var(--color-text));
|
|
17
|
+
overflow: hidden;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// ── Toolbar row ──────────────────────────────────────────────────────────
|
|
21
|
+
// The markdown actions (left) and the mode segmented control (right). The
|
|
22
|
+
// mode control is part of the v-model:mode contract, not a toolbar action
|
|
23
|
+
// — it stays when `toolbar` is off and when the plain mode retires the
|
|
24
|
+
// markdown actions.
|
|
25
|
+
|
|
26
|
+
.hk-md-editor-toolbar {
|
|
27
|
+
display: flex;
|
|
28
|
+
align-items: center;
|
|
29
|
+
gap: var(--space-8);
|
|
30
|
+
padding: var(--space-4) var(--space-8);
|
|
31
|
+
border-bottom: 1px solid var(--border-faint);
|
|
32
|
+
background: color-mix(in srgb, rgb(var(--color-background)) 35%, transparent);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.hk-md-editor-actions {
|
|
36
|
+
display: flex;
|
|
37
|
+
align-items: center;
|
|
38
|
+
gap: var(--space-2);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Ghost icon button: the toolbar's smallest chrome step. Borderless and
|
|
42
|
+
// transparent until hovered — the label lives in `title`/`aria-label`.
|
|
43
|
+
.hk-md-editor-action {
|
|
44
|
+
display: inline-flex;
|
|
45
|
+
align-items: center;
|
|
46
|
+
justify-content: center;
|
|
47
|
+
width: 1.75rem;
|
|
48
|
+
height: 1.75rem;
|
|
49
|
+
padding: 0;
|
|
50
|
+
border: none;
|
|
51
|
+
border-radius: var(--radius-sm);
|
|
52
|
+
background: transparent;
|
|
53
|
+
color: rgb(var(--color-muted));
|
|
54
|
+
cursor: pointer;
|
|
55
|
+
transition-property: background-color, color;
|
|
56
|
+
transition-duration: var(--duration-short);
|
|
57
|
+
transition-timing-function: var(--ease-standard);
|
|
58
|
+
|
|
59
|
+
&:hover:not(:disabled) {
|
|
60
|
+
background: color-mix(in srgb, rgb(var(--color-text)) 10%, transparent);
|
|
61
|
+
color: rgb(var(--color-text));
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
&:focus-visible {
|
|
65
|
+
outline: none;
|
|
66
|
+
box-shadow: var(--shadow-focus);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&:disabled {
|
|
70
|
+
opacity: 0.5;
|
|
71
|
+
cursor: not-allowed;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Compact segmented control (right side of the row).
|
|
76
|
+
.hk-md-editor-modes {
|
|
77
|
+
display: inline-flex;
|
|
78
|
+
align-items: center;
|
|
79
|
+
gap: var(--space-2);
|
|
80
|
+
margin-inline-start: auto;
|
|
81
|
+
padding: var(--space-2);
|
|
82
|
+
border: 1px solid var(--border-faint);
|
|
83
|
+
border-radius: var(--radius-full);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.hk-md-editor-mode {
|
|
87
|
+
border: none;
|
|
88
|
+
padding: var(--space-2) var(--space-8);
|
|
89
|
+
border-radius: var(--radius-full);
|
|
90
|
+
background: transparent;
|
|
91
|
+
color: rgb(var(--color-muted));
|
|
92
|
+
font-size: var(--text-xs);
|
|
93
|
+
line-height: 1.4;
|
|
94
|
+
cursor: pointer;
|
|
95
|
+
transition-property: background-color, color;
|
|
96
|
+
transition-duration: var(--duration-short);
|
|
97
|
+
transition-timing-function: var(--ease-standard);
|
|
98
|
+
|
|
99
|
+
&:hover:not(:disabled) {
|
|
100
|
+
color: rgb(var(--color-text));
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// The active tint rides data-active (the segmented grammar shared with
|
|
104
|
+
// HkPillToggleGroup) — a wash of the primary channel under the ink.
|
|
105
|
+
&[data-active] {
|
|
106
|
+
background: rgb(var(--color-primary) / 16%);
|
|
107
|
+
color: rgb(var(--color-text));
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
&:disabled {
|
|
111
|
+
opacity: 0.5;
|
|
112
|
+
cursor: not-allowed;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// ── Two-pane body ────────────────────────────────────────────────────────
|
|
117
|
+
// ~50/50: each pane is flex-basis 50% with min-width 0 so long lines and
|
|
118
|
+
// wide tables scroll inside their own pane instead of pushing the split.
|
|
119
|
+
|
|
120
|
+
.hk-md-editor-body {
|
|
121
|
+
display: flex;
|
|
122
|
+
align-items: stretch;
|
|
123
|
+
flex: 1;
|
|
124
|
+
min-height: 12rem;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.hk-md-editor-input-pane {
|
|
128
|
+
position: relative;
|
|
129
|
+
display: flex;
|
|
130
|
+
flex: 1 1 50%;
|
|
131
|
+
min-width: 0;
|
|
132
|
+
|
|
133
|
+
// Drag-over highlight: an inset ring on the pane (the attribute comes
|
|
134
|
+
// from the component's dragging state; the look lives here).
|
|
135
|
+
&[data-dragging] {
|
|
136
|
+
box-shadow: inset 0 0 0 2px rgb(var(--color-focused-border));
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.hk-md-editor-input {
|
|
141
|
+
box-sizing: border-box;
|
|
142
|
+
flex: 1;
|
|
143
|
+
width: 100%;
|
|
144
|
+
border: none;
|
|
145
|
+
outline: none;
|
|
146
|
+
resize: none;
|
|
147
|
+
background: transparent;
|
|
148
|
+
color: rgb(var(--color-text));
|
|
149
|
+
font-family: inherit;
|
|
150
|
+
font-size: var(--text-base);
|
|
151
|
+
line-height: 1.6;
|
|
152
|
+
padding: var(--space-8) var(--space-12);
|
|
153
|
+
|
|
154
|
+
&::placeholder {
|
|
155
|
+
color: rgb(var(--color-muted));
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
&:disabled {
|
|
159
|
+
cursor: not-allowed;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// The preview pane carries the divider (border on the pane, not a gap) —
|
|
164
|
+
// in plain mode the renderer degrades to pre-wrapped plain text itself.
|
|
165
|
+
// Native scroll mechanics, no native bar (the house contract: the
|
|
166
|
+
// scrollbar-width/::-webkit-scrollbar suppression pair beside overflow).
|
|
167
|
+
.hk-md-editor-preview {
|
|
168
|
+
flex: 1 1 50%;
|
|
169
|
+
min-width: 0;
|
|
170
|
+
overflow: auto;
|
|
171
|
+
scrollbar-width: none;
|
|
172
|
+
&::-webkit-scrollbar {
|
|
173
|
+
display: none;
|
|
174
|
+
}
|
|
175
|
+
padding: var(--space-8) var(--space-12);
|
|
176
|
+
border-inline-start: 1px solid var(--border-faint);
|
|
177
|
+
background: color-mix(in srgb, rgb(var(--color-background)) 35%, transparent);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
// Narrow hosts stack the panes — the divider follows the block axis.
|
|
181
|
+
@media (max-width: 640px) {
|
|
182
|
+
.hk-md-editor-body {
|
|
183
|
+
flex-direction: column;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.hk-md-editor-preview {
|
|
187
|
+
border-inline-start: none;
|
|
188
|
+
border-block-start: 1px solid var(--border-faint);
|
|
189
|
+
}
|
|
190
|
+
}
|