@hanology/cham-browser 0.4.76 → 0.4.78

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hanology/cham-browser",
3
- "version": "0.4.76",
3
+ "version": "0.4.78",
4
4
  "description": "CHAM — browser-compatible parser, serializer, and site generator for Classical Han Annotated Markdown",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -144,7 +144,7 @@ function onKey(event: KeyboardEvent) {
144
144
  .about-pane-v {
145
145
  writing-mode: vertical-rl; text-orientation: mixed;
146
146
  position: relative;
147
- height: 100vh;
147
+ height: 100dvh;
148
148
  background: var(--paper);
149
149
  padding: 32px 28px;
150
150
  overflow-x: auto;
@@ -174,7 +174,7 @@ function onKey(event: KeyboardEvent) {
174
174
  display: flex;
175
175
  align-items: center;
176
176
  justify-content: center;
177
- min-height: 100vh;
177
+ min-height: 100dvh;
178
178
  }
179
179
  .route-loading-logo {
180
180
  width: 56px; height: auto;
@@ -210,7 +210,7 @@ onBeforeUnmount(() => {
210
210
  position: fixed;
211
211
  left: 0;
212
212
  top: 0;
213
- height: 100vh;
213
+ height: 100dvh;
214
214
  background: var(--surface-warm);
215
215
  border-right: 1px solid var(--border);
216
216
  z-index: 300;
@@ -568,7 +568,7 @@ onBeforeUnmount(() => {
568
568
  width: auto !important;
569
569
  max-width: 65vw !important;
570
570
  min-width: 180px;
571
- height: 100vh !important;
571
+ height: 100dvh !important;
572
572
  max-height: none !important;
573
573
  top: 0 !important;
574
574
  bottom: auto !important;
@@ -437,7 +437,7 @@ onBeforeUnmount(() => {
437
437
  top: 0;
438
438
  width: 85vw;
439
439
  max-height: none;
440
- height: 100vh;
440
+ height: 100dvh;
441
441
  border-top: none;
442
442
  border-radius: 0;
443
443
  border-right: 1px solid var(--border);
@@ -249,7 +249,7 @@ const annotationEntries = computed(() =>
249
249
  }
250
250
  .part-block--vertical :deep(.ann-num) {
251
251
  font-size: 0.45em;
252
- text-align: end;
252
+ text-align: start;
253
253
  vertical-align: baseline;
254
254
  ruby-position: under;
255
255
  }
@@ -179,7 +179,7 @@ const paragraphsHtml = computed(() => {
179
179
  .sb-vertical {
180
180
  writing-mode: vertical-rl;
181
181
  text-orientation: mixed;
182
- height: 100vh;
182
+ height: 100dvh;
183
183
  flex-shrink: 0;
184
184
  padding: 32px 24px;
185
185
  border-right: 1px solid var(--border);
@@ -130,7 +130,7 @@ function toggleSettings() { settingsOpen.value = !settingsOpen.value }
130
130
  .sidenav {
131
131
  position: fixed;
132
132
  top: 0; right: 0;
133
- width: 56px; height: 100vh;
133
+ width: 56px; height: 100dvh;
134
134
  background: var(--paper);
135
135
  border-left: 1px solid var(--border);
136
136
  display: flex; flex-direction: column;
@@ -73,7 +73,7 @@ function onTap(event: MouseEvent) {
73
73
  --ann-shadow-y: -2px;
74
74
  writing-mode: vertical-rl;
75
75
  text-orientation: mixed;
76
- height: calc(100vh - var(--nav-width, 56px));
76
+ height: calc(100dvh - var(--nav-width, 56px));
77
77
  padding: 32px 24px;
78
78
  background: var(--surface);
79
79
  border: 1px solid var(--border);
@@ -127,7 +127,7 @@ function onTap(event: MouseEvent) {
127
127
  }
128
128
  :deep(.ann-num) {
129
129
  font-size: 0.45em;
130
- text-align: end;
130
+ text-align: start;
131
131
  ruby-position: under;
132
132
  }
133
133
  :deep(.ann-num-long) {
@@ -69,7 +69,10 @@ export function renderAnnotatedText(text: string, spans: AnnSpan[], useRuby = fa
69
69
  const body = esc(text.slice(span.start, span.end))
70
70
  if (useRuby) {
71
71
  const rtCls = numText.length > 1 ? 'ann-num ann-num-long' : 'ann-num'
72
- html += `<ruby class="ann-target${overlapCls} ${kinds}" data-ann-ids="${ids}">${body}<rp></rp><rt class="${rtCls}">${numText}</rt><rp></rp></ruby>`
72
+ const chars = [...body]
73
+ html += chars.map((ch, i) =>
74
+ `<ruby class="ann-target${overlapCls} ${kinds}" data-ann-ids="${ids}">${ch}<rp></rp>${i === 0 ? `<rt class="${rtCls}">${numText}</rt>` : ''}<rp></rp></ruby>`
75
+ ).join('')
73
76
  } else {
74
77
  html += `<span class="ann-target${overlapCls} ${kinds}" data-ann-ids="${ids}">${body}<sup class="ann-num">${numText}</sup></span>`
75
78
  }
@@ -5,6 +5,13 @@
5
5
  transition: background 0.2s ease, box-shadow 0.2s ease;
6
6
  -webkit-box-decoration-break: clone;
7
7
  box-decoration-break: clone;
8
+ text-decoration: none;
9
+ }
10
+ ruby.ann-target {
11
+ text-decoration: none;
12
+ }
13
+ rt.ann-num, sup.ann-num {
14
+ text-decoration: none;
8
15
  }
9
16
 
10
17
  /* ─── Annotation kind border colors ─── */
@@ -140,7 +147,7 @@
140
147
  .v-scroll .ann-num,
141
148
  .part-block--vertical .ann-num {
142
149
  font-size: 0.45em;
143
- text-align: end;
150
+ text-align: start;
144
151
  vertical-align: baseline;
145
152
  ruby-position: under;
146
153
  }
@@ -143,7 +143,7 @@ body {
143
143
  background: var(--paper);
144
144
  color: var(--ink);
145
145
  line-height: 1.8;
146
- min-height: 100vh;
146
+ min-height: 100dvh;
147
147
  overflow-x: hidden;
148
148
  overscroll-behavior-y: contain;
149
149
  }
@@ -248,7 +248,7 @@ button:focus-visible {
248
248
 
249
249
  /* ===== VERTICAL PAGE LAYOUT ===== */
250
250
  .v-page {
251
- height: 100vh;
251
+ height: 100dvh;
252
252
  display: flex;
253
253
  flex-direction: row-reverse;
254
254
  overflow-x: auto;
@@ -298,7 +298,7 @@ button:focus-visible {
298
298
  .page-loading {
299
299
  display: flex; flex-direction: column;
300
300
  align-items: center; justify-content: center;
301
- height: 100vh;
301
+ height: 100dvh;
302
302
  }
303
303
  .page-loading-seal {
304
304
  width: 56px; height: 56px;
@@ -146,7 +146,7 @@ function goHome() { router.push('/') }
146
146
  /* ═══════ 直排模式 ═══════ */
147
147
 
148
148
  .v-page {
149
- height: 100vh;
149
+ height: 100dvh;
150
150
  display: flex;
151
151
  flex-direction: row-reverse;
152
152
  overflow-x: auto;
@@ -164,7 +164,7 @@ function goHome() { router.push('/') }
164
164
  writing-mode: vertical-rl;
165
165
  text-orientation: mixed;
166
166
  flex-shrink: 0;
167
- height: 100vh;
167
+ height: 100dvh;
168
168
  display: flex;
169
169
  flex-direction: column;
170
170
  align-items: flex-start;
@@ -198,7 +198,7 @@ function goHome() { router.push('/') }
198
198
  writing-mode: vertical-rl;
199
199
  text-orientation: mixed;
200
200
  flex-shrink: 0;
201
- height: 100vh;
201
+ height: 100dvh;
202
202
  padding: 40px 16px;
203
203
  border-right: 1px solid var(--border);
204
204
  }
@@ -247,7 +247,7 @@ function goHome() { router.push('/') }
247
247
 
248
248
  /* ═══════ 橫排模式 ═══════ */
249
249
 
250
- .h-page { min-height: 100vh; }
250
+ .h-page { min-height: 100dvh; }
251
251
  .h-nav {
252
252
  position: sticky; top: 0; z-index: 100;
253
253
  background: var(--paper);
@@ -165,7 +165,7 @@ function scrollToCatalog() {
165
165
  writing-mode: vertical-rl;
166
166
  text-orientation: mixed;
167
167
  flex-shrink: 0;
168
- height: 100vh;
168
+ height: 100dvh;
169
169
  display: flex;
170
170
  flex-direction: column;
171
171
  align-items: flex-start;
@@ -211,7 +211,7 @@ function scrollToCatalog() {
211
211
  writing-mode: vertical-rl;
212
212
  text-orientation: mixed;
213
213
  flex-shrink: 0;
214
- height: 100vh;
214
+ height: 100dvh;
215
215
  padding: 40px 16px;
216
216
  border-right: 1px solid var(--border);
217
217
  display: flex;
@@ -265,7 +265,7 @@ function scrollToCatalog() {
265
265
  grid-template-rows: repeat(auto-fill, 180px);
266
266
  gap: 10px;
267
267
  padding: 24px 16px;
268
- height: 100vh;
268
+ height: 100dvh;
269
269
  box-sizing: border-box;
270
270
  direction: rtl;
271
271
  align-items: start;
@@ -279,7 +279,7 @@ function scrollToCatalog() {
279
279
 
280
280
  .h-hero {
281
281
  position: relative;
282
- height: 100vh;
282
+ height: 100dvh;
283
283
  display: flex; flex-direction: column;
284
284
  align-items: center; justify-content: center;
285
285
  background: linear-gradient(180deg, var(--paper) 0%, var(--paper-warm) 100%);
@@ -386,7 +386,7 @@ function scrollToCatalog() {
386
386
  writing-mode: vertical-rl;
387
387
  text-orientation: mixed;
388
388
  flex-shrink: 0;
389
- height: 100vh;
389
+ height: 100dvh;
390
390
  display: flex;
391
391
  align-items: center;
392
392
  justify-content: center;
@@ -182,7 +182,7 @@ function openBook(bookId: string) {
182
182
  writing-mode: vertical-rl;
183
183
  text-orientation: mixed;
184
184
  flex-shrink: 0;
185
- height: 100vh;
185
+ height: 100dvh;
186
186
  display: flex;
187
187
  flex-direction: column;
188
188
  align-items: flex-start;
@@ -213,7 +213,7 @@ function openBook(bookId: string) {
213
213
  flex-shrink: 0;
214
214
  display: flex;
215
215
  flex-direction: column;
216
- height: 100vh;
216
+ height: 100dvh;
217
217
  box-sizing: border-box;
218
218
  overflow-x: auto;
219
219
  overflow-y: hidden;
@@ -257,7 +257,7 @@ function openBook(bookId: string) {
257
257
  flex-direction: column;
258
258
  align-items: center;
259
259
  justify-content: flex-start;
260
- height: 100vh;
260
+ height: 100dvh;
261
261
  width: 44px;
262
262
  padding: 16px 0;
263
263
  border-left: 1px solid var(--border-light);
@@ -727,7 +727,7 @@ function tcy(n: number): string {
727
727
  writing-mode: vertical-rl;
728
728
  text-orientation: mixed;
729
729
  flex-shrink: 0;
730
- height: 100vh;
730
+ height: 100dvh;
731
731
  display: flex;
732
732
  align-items: flex-start;
733
733
  justify-content: center;
@@ -781,7 +781,7 @@ function tcy(n: number): string {
781
781
  flex-direction: row-reverse;
782
782
  align-items: stretch;
783
783
  gap: 0;
784
- height: 100vh;
784
+ height: 100dvh;
785
785
  box-sizing: border-box;
786
786
  padding: 20px 16px;
787
787
  }
@@ -810,7 +810,7 @@ function tcy(n: number): string {
810
810
  writing-mode: vertical-rl;
811
811
  text-orientation: mixed;
812
812
  flex-shrink: 0;
813
- height: 100vh;
813
+ height: 100dvh;
814
814
  display: flex;
815
815
  flex-direction: row;
816
816
  align-items: center;
@@ -854,7 +854,7 @@ function tcy(n: number): string {
854
854
 
855
855
  /* ═══════ 橫排模式 ═══════ */
856
856
 
857
- .h-page { min-height: 100vh; }
857
+ .h-page { min-height: 100dvh; }
858
858
  .h-nav {
859
859
  position: sticky; top: 0; z-index: 100;
860
860
  background: var(--paper);
@@ -1037,7 +1037,7 @@ function tcy(n: number): string {
1037
1037
  }
1038
1038
  .h-pane {
1039
1039
  width: min(420px, 90vw);
1040
- height: 100vh;
1040
+ height: 100dvh;
1041
1041
  background: var(--paper);
1042
1042
  padding: 32px;
1043
1043
  overflow-y: auto;
@@ -1173,7 +1173,7 @@ function tcy(n: number): string {
1173
1173
  .v-author-pane {
1174
1174
  writing-mode: vertical-rl;
1175
1175
  text-orientation: mixed;
1176
- height: 100vh;
1176
+ height: 100dvh;
1177
1177
  background: var(--paper);
1178
1178
  padding: 32px 24px;
1179
1179
  overflow-x: auto;
@@ -1290,7 +1290,7 @@ function tcy(n: number): string {
1290
1290
  flex-direction: column;
1291
1291
  gap: 8px;
1292
1292
  flex-shrink: 0;
1293
- height: 100vh;
1293
+ height: 100dvh;
1294
1294
  align-items: center;
1295
1295
  justify-content: center;
1296
1296
  padding: 0 6px;