@celestia-island/hikari 0.55.519 → 0.55.521

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 (38) hide show
  1. package/dist/types/components/HkDirectionalSwap.d.ts +53 -6
  2. package/dist/types/components/HkInput.d.ts +1 -1
  3. package/dist/types/components/HkMarkdownEditor.d.ts +33 -30
  4. package/dist/types/components/HkMenu.d.ts +1 -1
  5. package/dist/types/components/HkPillToggleGroup.d.ts +13 -0
  6. package/dist/types/components/HkRowActions.d.ts +1 -1
  7. package/dist/types/components/HkTable.d.ts +1 -1
  8. package/dist/types/components/HkTimePicker.d.ts +1 -1
  9. package/dist/types/index.d.ts +1 -1
  10. package/package.json +1 -1
  11. package/src/components/HkDirectionalSwap.test.tsx +614 -23
  12. package/src/components/HkDirectionalSwap.tsx +219 -26
  13. package/src/components/HkMarkdownEditor.barrel.test.ts +3 -3
  14. package/src/components/HkMarkdownEditor.rails.test.tsx +103 -0
  15. package/src/components/HkMarkdownEditor.scss +72 -89
  16. package/src/components/HkMarkdownEditor.test.tsx +319 -45
  17. package/src/components/HkMarkdownEditor.tsx +152 -90
  18. package/src/components/HkPillToggleGroup.scss +9 -2
  19. package/src/components/HkPillToggleGroup.test.tsx +36 -0
  20. package/src/components/HkPillToggleGroup.tsx +11 -2
  21. package/src/components/HkScrollProgressDock.scss +71 -2
  22. package/src/components/HkScrollProgressDock.test.tsx +508 -1
  23. package/src/components/HkScrollProgressDock.tsx +424 -40
  24. package/src/components/HkThemeToggle.test.ts +32 -1
  25. package/src/errorLandingStandalone/error-landing.html +1 -1
  26. package/src/i18n/locales/ar/components.json +9 -3
  27. package/src/i18n/locales/de/components.json +9 -3
  28. package/src/i18n/locales/en/components.json +9 -3
  29. package/src/i18n/locales/es/components.json +9 -3
  30. package/src/i18n/locales/fr/components.json +9 -3
  31. package/src/i18n/locales/ja/components.json +9 -3
  32. package/src/i18n/locales/ko/components.json +9 -3
  33. package/src/i18n/locales/pt/components.json +9 -3
  34. package/src/i18n/locales/ru/components.json +9 -3
  35. package/src/i18n/locales/zh-Hans/components.json +9 -3
  36. package/src/i18n/locales/zh-Hant/components.json +9 -3
  37. package/src/index.ts +1 -1
  38. package/src/res/themeLoaderBehaviour.test.ts +27 -0
@@ -44,14 +44,39 @@
44
44
  * still snaps — taller the moment the exchange starts, shorter the
45
45
  * frame it ends (measured on the docs shell's preview/source card,
46
46
  * 2026-11-29: 360px → 278px in ONE frame). With the prop on, the
47
- * wrapper freezes at its rendered height, transitions to the incoming
48
- * generation's height over the same duration/easing as the travel,
49
- * and releases back to auto on settle. Reduced motion (duration 0)
47
+ * wrapper tweens from the height it had BEFORE the incoming copy
48
+ * inserted (read in the leaving copy's before-hook — by the enter
49
+ * hook the row has already grown to the taller generation) to the
50
+ * incoming generation's OWN height (read with the item un-stretched:
51
+ * a grid item renders at the row's height, i.e. the outgoing copy's),
52
+ * over the same duration/easing as the travel, and releases back to
53
+ * auto once BOTH the enter has settled AND no leaving copy remains in
54
+ * the cell — either alone would jump. Reduced motion (duration 0)
50
55
  * keeps the snap — the instant change IS that preference. A faster
51
56
  * follow-up swap interrupts the running exchange: Vue cancels the
52
- * enter (which releases), and the next freeze reads the cell's
53
- * CURRENT rendered height — the interrupted tween's mid-state —
54
- * never the old start.
57
+ * enter, the tween STAYS ARMED at its animated mid-state, the next
58
+ * before-leave reads that as its start, and the next enter re-freezes
59
+ * from it without a jump. The Transition's own teardown (the host
60
+ * flipping to `disabled`, a watchdog sweep, unmount) is what releases
61
+ * a stranded tween.
62
+ * - The first cut of this tween (2026-11-29) never ran in a browser:
63
+ * it read BOTH ends after the insertion, so `from` and `target` were
64
+ * the same stretched row height and the whole change happened at the
65
+ * release (measured live 2026-11-30: writes 200px → 200px, the host
66
+ * flat for the exchange, a 200 → 189 snap the frame it ended). The
67
+ * tests were green because happy-dom has no layout and the stubbed
68
+ * heights ignored the stretch; they now model the grid (see the
69
+ * `stubGrid` pins).
70
+ * - Two contracts the tween assumes of its host. (a) Hosts do not pin
71
+ * `height`/`min-height` on `.hk-dswap-item`: an explicit box defeats
72
+ * the un-stretched read — the read returns the pin, and a pin at the
73
+ * row is the no-op again (see `readUnstretchedHeight`); hosts size
74
+ * the pane, the item's child. (b) The host is BORDER-BOX with no
75
+ * padding or border of its own: `offsetHeight` is a border-box figure
76
+ * and is written into `height`, which under `box-sizing: content-box`
77
+ * is the content box — a padded or bordered `.hk-dswap` would offset
78
+ * the tween by its box extra (the docs shell's host is border-box with
79
+ * neither, so the target path is exact).
55
80
  */
56
81
  import { type PropType } from "vue";
57
82
  import "./HkDirectionalSwap.scss";
@@ -66,6 +91,28 @@ export type SwapDirection = "forward" | "back";
66
91
  * consistent, repeatable direction rather than a flicker between two.
67
92
  */
68
93
  export declare function resolveSwapDirection(order: ReadonlyArray<string | number>, previous: string | number, next: string | number): SwapDirection;
94
+ /**
95
+ * Read a grid item's OWN content height. Under the cell's geometry a
96
+ * grid item stretches to the row (the taller generation), so its
97
+ * rendered height is the outgoing copy's; `align-self: start` sizes it
98
+ * to its content for the read. The item's inline `align-self` is put
99
+ * back exactly as it was — value AND priority — so a style the item
100
+ * arrived with survives. Exported for its own pin: the swap creates the
101
+ * item in the same tick its enter hook reads it, so no test can hand it
102
+ * a prior inline style through the component.
103
+ *
104
+ * CONTRACT: the item's box belongs to the component — hosts must not pin
105
+ * `height` or `min-height` on `.hk-dswap-item`. Un-stretching defeats the
106
+ * ROW, not an explicit box: a pinned item reads its PIN — the explicit
107
+ * box wins over both the row stretch and the content height — and a pin
108
+ * at the row turns the tween back into the no-op this component just
109
+ * fixed (measured, Chrome 155, R5: with the item pinned to the row's
110
+ * 240px, stretched and un-stretched both read 240 while the content is
111
+ * 100). Hosts size the PANE (the item's child); that is where the docs
112
+ * shell's band-fill lives, and this read runs before its attribute
113
+ * exists.
114
+ */
115
+ export declare function readUnstretchedHeight(item: HTMLElement): number;
69
116
  declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
70
117
  /** Identity of the content on stage; changing it starts the swap. */
71
118
  swapKey: {
@@ -450,6 +450,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
450
450
  modelValue: string;
451
451
  align: "center" | "end" | "start";
452
452
  placeholder: string;
453
+ rows: number;
453
454
  placeholderVariant: "marquee" | "truncate";
454
455
  readonly: boolean;
455
456
  autocomplete: string;
@@ -461,7 +462,6 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
461
462
  strengthEvaluator: PasswordStrengthEvaluator;
462
463
  hint: string;
463
464
  spellcheck: boolean;
464
- rows: number;
465
465
  autoGrow: boolean;
466
466
  hideLabel: boolean;
467
467
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -1,8 +1,11 @@
1
1
  import "./HkMarkdownEditor.scss";
2
- /** Editing dialect of the editor body. `markdown` runs the toolbar and the
3
- * rendered live preview; `plain` reduces the surface to a textarea (the
4
- * split preview degrades to pre-wrapped plain text). */
5
- export type HkMarkdownEditorMode = "markdown" | "plain";
2
+ /** Which panes the editor shows. The source textarea is the document;
3
+ * the preview is its live rendering (markdown is the convenient way to
4
+ * write it, not a mode the writer has to pick). `text` = the source
5
+ * alone, `both` = the split (source | preview), `preview` = the
6
+ * rendering alone. */
7
+ export type HkMarkdownEditorView = "text" | "both" | "preview";
8
+ declare function isView(value: unknown): value is HkMarkdownEditorView;
6
9
  /** The result of one pure text transform: the rewritten source plus the
7
10
  * selection the editor should restore afterwards. Selections are plain
8
11
  * string indices into `text` — the same coordinates a textarea's
@@ -30,27 +33,33 @@ export declare function applyWrap(source: string, selectionStart: number, select
30
33
  */
31
34
  export declare function applyLinePrefix(source: string, selectionStart: number, selectionEnd: number, prefix: string | ((lineIndex: number) => string)): MarkdownTextEdit;
32
35
  /**
33
- * HkMarkdownEditor — the family's standard two-pane markdown/plain-text
34
- * editor. Left: the textarea (every toolbar action a pure string transform
35
- * over the current selection, refocused with a restored selection after
36
- * each action). Right: the live preview through HkMarkdownRenderer,
37
- * shown in split view — markdown mode renders, plain mode degrades to
38
- * pre-wrapped plain text. Image drops/pastes are REPORTED (one
39
- * `imageDrop` event per file) and never embedded or uploaded: the host
40
- * owns the upload and inserts its own markdown marker.
36
+ * HkMarkdownEditor — the family's standard two-pane rich-text editor.
37
+ * Left: the textarea (every toolbar action a pure string transform over
38
+ * the current selection, refocused with a restored selection after each
39
+ * action). Right: the live rendering of that source through
40
+ * HkMarkdownRenderer. The right-hand segmented control (the family's
41
+ * HkPillToggleGroup, single-choice) picks which panes show — the source
42
+ * alone, both, or the rendering alone. Image drops/pastes are REPORTED
43
+ * (one `imageDrop` event per file) and never embedded or uploaded: the
44
+ * host owns the upload and inserts its own marker.
45
+ *
46
+ * Geometry: the root is `overflow: hidden` and every pane wrapper is a
47
+ * `min-height: 0` flex item, so a host that bounds the root (a
48
+ * `flex: 1` + `min-height: 0` chain, or an explicit height) gets two
49
+ * panes that scroll INSIDE themselves under the house overlay rail — a
50
+ * long rendering never grows the editor past its host. A host that
51
+ * leaves it content-sized gets a 12rem floor and may grow with the
52
+ * rendering.
41
53
  */
42
54
  declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
43
55
  modelValue: {
44
56
  type: StringConstructor;
45
57
  default: string;
46
58
  };
47
- mode: {
48
- type: () => HkMarkdownEditorMode;
49
- default: string;
50
- };
51
59
  view: {
52
- type: () => "split" | "edit";
60
+ type: () => HkMarkdownEditorView;
53
61
  default: string;
62
+ validator: typeof isView;
54
63
  };
55
64
  placeholder: {
56
65
  type: StringConstructor;
@@ -60,8 +69,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
60
69
  type: BooleanConstructor;
61
70
  default: boolean;
62
71
  };
63
- /** Toolbar actions row (markdown mode only — plain mode has no
64
- * markdown to insert). The mode segmented control always renders. */
72
+ /** Toolbar actions row. The view segmented control always renders. */
65
73
  toolbar: {
66
74
  type: BooleanConstructor;
67
75
  default: boolean;
@@ -73,20 +81,17 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
73
81
  };
74
82
  }>, () => import("vue/jsx-runtime").JSX.Element, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
75
83
  "update:modelValue": (_value: string) => true;
76
- "update:mode": (_mode: HkMarkdownEditorMode) => true;
84
+ "update:view": (_view: HkMarkdownEditorView) => true;
77
85
  imageDrop: (_file: File) => true;
78
86
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
79
87
  modelValue: {
80
88
  type: StringConstructor;
81
89
  default: string;
82
90
  };
83
- mode: {
84
- type: () => HkMarkdownEditorMode;
85
- default: string;
86
- };
87
91
  view: {
88
- type: () => "split" | "edit";
92
+ type: () => HkMarkdownEditorView;
89
93
  default: string;
94
+ validator: typeof isView;
90
95
  };
91
96
  placeholder: {
92
97
  type: StringConstructor;
@@ -96,8 +101,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
96
101
  type: BooleanConstructor;
97
102
  default: boolean;
98
103
  };
99
- /** Toolbar actions row (markdown mode only — plain mode has no
100
- * markdown to insert). The mode segmented control always renders. */
104
+ /** Toolbar actions row. The view segmented control always renders. */
101
105
  toolbar: {
102
106
  type: BooleanConstructor;
103
107
  default: boolean;
@@ -110,10 +114,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
110
114
  }>> & Readonly<{
111
115
  "onUpdate:modelValue"?: ((_value: string) => any) | undefined;
112
116
  onImageDrop?: ((_file: File) => any) | undefined;
113
- "onUpdate:mode"?: ((_mode: HkMarkdownEditorMode) => any) | undefined;
117
+ "onUpdate:view"?: ((_view: HkMarkdownEditorView) => any) | undefined;
114
118
  }>, {
115
- view: "split" | "edit";
116
- mode: HkMarkdownEditorMode;
119
+ view: HkMarkdownEditorView;
117
120
  toolbar: boolean;
118
121
  disabled: boolean;
119
122
  modelValue: string;
@@ -405,7 +405,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
405
405
  variant: "popup" | "sidebar";
406
406
  title: string;
407
407
  offset: number;
408
- placement: "bottom-start" | "bottom-end" | "top-start" | "top-end" | "right-start" | "left-start";
408
+ placement: "bottom-start" | "bottom-end" | "top-start" | "top-end" | "left-start" | "right-start";
409
409
  maxHeight: string;
410
410
  anchorRef: PanelAnchor | null;
411
411
  autoFlip: boolean;
@@ -67,6 +67,12 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
67
67
  type: StringConstructor;
68
68
  default: undefined;
69
69
  };
70
+ /** Disables every pill (the all-pill included): a disabled editor's
71
+ * view strip must not offer a switch its host would refuse. */
72
+ disabled: {
73
+ type: BooleanConstructor;
74
+ default: boolean;
75
+ };
70
76
  /** Pill-suffix renderer (2026-11-19, the filter-chip sort arrows): one
71
77
  * call per rendered pill — a null value scopes the ALL-pill, a value
72
78
  * scopes that option — rendered UNWRAPPED after the label so the
@@ -102,6 +108,12 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
102
108
  type: StringConstructor;
103
109
  default: undefined;
104
110
  };
111
+ /** Disables every pill (the all-pill included): a disabled editor's
112
+ * view strip must not offer a switch its host would refuse. */
113
+ disabled: {
114
+ type: BooleanConstructor;
115
+ default: boolean;
116
+ };
105
117
  /** Pill-suffix renderer (2026-11-19, the filter-chip sort arrows): one
106
118
  * call per rendered pill — a null value scopes the ALL-pill, a value
107
119
  * scopes that option — rendered UNWRAPPED after the label so the
@@ -118,6 +130,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
118
130
  onAll?: (() => any) | undefined;
119
131
  }>, {
120
132
  options: HkPillToggleGroupOption[];
133
+ disabled: boolean;
121
134
  selected: Set<string>;
122
135
  allLabel: string;
123
136
  renderTrailing: (value: string | null) => VNode | undefined;
@@ -91,7 +91,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
91
91
  size: 16 | 24 | 40 | 32 | 36 | 28;
92
92
  label: string;
93
93
  disabled: boolean;
94
- placement: "bottom-start" | "bottom-end" | "top-start" | "top-end" | "right-start" | "left-start";
94
+ placement: "bottom-start" | "bottom-end" | "top-start" | "top-end" | "left-start" | "right-start";
95
95
  items: HkMenuItem[];
96
96
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
97
97
  export default _default;
@@ -285,8 +285,8 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
285
285
  caption: string;
286
286
  total: number;
287
287
  draggable: boolean;
288
- hover: boolean;
289
288
  rows: readonly object[];
289
+ hover: boolean;
290
290
  emptyText: string;
291
291
  rowKey: string;
292
292
  bordered: boolean;
@@ -156,9 +156,9 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
156
156
  title: string;
157
157
  disabled: boolean;
158
158
  modelValue: string;
159
+ placeholder: string;
159
160
  confirmLabel: string;
160
161
  cancelLabel: string;
161
- placeholder: string;
162
162
  hideLabel: boolean;
163
163
  clearable: boolean;
164
164
  minuteStep: number;
@@ -353,7 +353,7 @@ export { default as HkListTransition } from "./components/HkListTransition";
353
353
  export { default as HkLoadMore } from "./components/HkLoadMore";
354
354
  export { default as HkMarkdownRenderer } from "./components/HkMarkdownRenderer";
355
355
  export { default as HkMarkdownEditor, applyLinePrefix, applyWrap } from "./components/HkMarkdownEditor";
356
- export type { HkMarkdownEditorMode, MarkdownTextEdit } from "./components/HkMarkdownEditor";
356
+ export type { HkMarkdownEditorView, MarkdownTextEdit } from "./components/HkMarkdownEditor";
357
357
  export { default as HkMermaidDiagram } from "./components/HkMermaidDiagram";
358
358
  export { default as HkTerminal } from "./components/HkTerminal";
359
359
  export { default as HkModal } from "./components/HkModal";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@celestia-island/hikari",
3
- "version": "0.55.519",
3
+ "version": "0.55.521",
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",