@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
@@ -1,4 +1,4 @@
1
- // HkMarkdownEditor chrome — the two-pane markdown/plain editor.
1
+ // HkMarkdownEditor chrome — the two-pane source/rendering editor.
2
2
  //
3
3
  // All colors ride hikari's token triplets (`rgb(var(--color-*))`,
4
4
  // `color-mix`), spacing/radius/motion ride the `--space-*` / `--radius-*`
@@ -18,10 +18,14 @@
18
18
  }
19
19
 
20
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.
21
+ // Two family components, nothing hand-drawn: the formatting actions are
22
+ // HkIconButtonGroup in "buttons" mode (the toolbar grammar — a tight
23
+ // action strip with the hover reveal built in), retuned to the editor's
24
+ // compact 28px chrome step through the group's own documented size
25
+ // variable; the view segmented control is HkPillToggleGroup (a
26
+ // single-choice host keeps one value in the set). The view control is
27
+ // part of the v-model:view contract, not a toolbar action — it stays
28
+ // when `toolbar` is off.
25
29
 
26
30
  .hk-md-editor-toolbar {
27
31
  display: flex;
@@ -32,90 +36,26 @@
32
36
  background: color-mix(in srgb, rgb(var(--color-background)) 35%, transparent);
33
37
  }
34
38
 
35
- .hk-md-editor-actions {
36
- display: flex;
37
- align-items: center;
38
- gap: var(--space-2);
39
+ // Compound on purpose: the group's own size class ties this selector at
40
+ // (0,1,0), and source order between two sheets is not a contract.
41
+ .hk-icon-group.hk-md-editor-actions {
42
+ --hk-icon-group-item-size: 1.75rem;
39
43
  }
40
44
 
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);
45
+ .hk-md-editor-views {
80
46
  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
47
  }
115
48
 
116
49
  // ── 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.
50
+ // The body is `flex: 1` under the root, and each pane wrapper is a
51
+ // flex item with `min-height: 0`: under a host-bounded root (a
52
+ // `flex: 1` + `min-height: 0` chain or an explicit height — the root's
53
+ // `overflow: hidden` makes it shrinkable) neither pane's CONTENT can
54
+ // push the editor past its host. A long rendering scrolls inside its
55
+ // pane instead of growing the page, and the textarea (whose intrinsic
56
+ // height is its `rows`, never its text) fills the same row. A
57
+ // content-sized host gets the 12rem floor below, and the rendering may
58
+ // grow it — bound the editor when the page must not scroll.
119
59
 
120
60
  .hk-md-editor-body {
121
61
  display: flex;
@@ -129,18 +69,33 @@
129
69
  display: flex;
130
70
  flex: 1 1 50%;
131
71
  min-width: 0;
72
+ min-height: 0;
132
73
 
133
74
  // Drag-over highlight: an inset ring on the pane (the attribute comes
134
75
  // from the component's dragging state; the look lives here).
135
76
  &[data-dragging] {
136
77
  box-shadow: inset 0 0 0 2px rgb(var(--color-focused-border));
137
78
  }
79
+
80
+ // `display: flex` above outranks the UA `[hidden]` rule, so the
81
+ // attribute's own display: none is restated here.
82
+ &[hidden] {
83
+ display: none;
84
+ }
138
85
  }
139
86
 
140
87
  .hk-md-editor-input {
141
88
  box-sizing: border-box;
142
89
  flex: 1;
143
90
  width: 100%;
91
+ // Native scroll mechanics, no native bar (the house contract: the
92
+ // scrollbar-width/::-webkit-scrollbar suppression pair beside
93
+ // overflow) — the shared overlay rail attaches to the textarea.
94
+ overflow-y: auto;
95
+ scrollbar-width: none;
96
+ &::-webkit-scrollbar {
97
+ display: none;
98
+ }
144
99
  border: none;
145
100
  outline: none;
146
101
  resize: none;
@@ -160,14 +115,23 @@
160
115
  }
161
116
  }
162
117
 
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 {
118
+ // The preview pane's wrapper is the rails' host: the box that wraps
119
+ // EXACTLY the scroll viewport (positioned, sized by the flex row), the
120
+ // mount every other overlay-scrollbar consumer uses.
121
+ .hk-md-editor-preview-pane {
122
+ position: relative;
123
+ display: flex;
168
124
  flex: 1 1 50%;
169
125
  min-width: 0;
170
- overflow: auto;
126
+ min-height: 0;
127
+ }
128
+
129
+ // The preview viewport carries the divider (border on the pane, not a
130
+ // gap). Native scroll mechanics, no native bar — the shared overlay rail
131
+ // attaches to it (the same house contract as the textarea).
132
+ .hk-md-editor-preview {
133
+ flex: 1;
134
+ overflow-y: auto;
171
135
  scrollbar-width: none;
172
136
  &::-webkit-scrollbar {
173
137
  display: none;
@@ -177,14 +141,33 @@
177
141
  background: color-mix(in srgb, rgb(var(--color-background)) 35%, transparent);
178
142
  }
179
143
 
144
+ // A single-pane view takes the whole row — no divider without a sibling.
145
+ .hk-md-editor-body[data-view="text"] .hk-md-editor-input-pane,
146
+ .hk-md-editor-body[data-view="preview"] .hk-md-editor-preview-pane {
147
+ flex-basis: 100%;
148
+ }
149
+
150
+ .hk-md-editor-body[data-view="preview"] .hk-md-editor-preview {
151
+ border-inline-start: none;
152
+ }
153
+
180
154
  // Narrow hosts stack the panes — the divider follows the block axis.
181
155
  @media (max-width: 640px) {
182
156
  .hk-md-editor-body {
183
157
  flex-direction: column;
184
158
  }
185
159
 
160
+ .hk-md-editor-input-pane,
161
+ .hk-md-editor-preview-pane {
162
+ flex: 1 1 0%;
163
+ }
164
+
186
165
  .hk-md-editor-preview {
187
166
  border-inline-start: none;
188
167
  border-block-start: 1px solid var(--border-faint);
189
168
  }
169
+
170
+ .hk-md-editor-body[data-view="preview"] .hk-md-editor-preview {
171
+ border-block-start: none;
172
+ }
190
173
  }