@hanology/cham-browser 0.4.68 → 0.4.70

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.68",
3
+ "version": "0.4.70",
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",
@@ -51,18 +51,8 @@ function onKey(event: KeyboardEvent) {
51
51
 
52
52
  <template>
53
53
  <div @keydown="onKey">
54
- <router-view v-slot="{ Component, route }">
55
- <Transition name="page-fade" mode="out-in">
56
- <Suspense :key="route.fullPath">
57
- <component :is="Component" />
58
- <template #fallback>
59
- <div class="route-loading">
60
- <img v-if="logoUrl" :src="logoUrl" alt="" class="route-loading-logo" />
61
- <div v-else class="route-loading-seal">文</div>
62
- </div>
63
- </template>
64
- </Suspense>
65
- </Transition>
54
+ <router-view v-slot="{ Component }">
55
+ <component :is="Component" />
66
56
  </router-view>
67
57
  <!-- 橫排模式才顯示浮動設定鈕 -->
68
58
  <ReadingToolbar v-if="!isVertical" />
@@ -113,6 +113,9 @@ function onTap(event: MouseEvent) {
113
113
  vertical-align: super;
114
114
  margin-right: 1px;
115
115
  }
116
+ :deep(.ann-num-long) {
117
+ letter-spacing: -1px;
118
+ }
116
119
 
117
120
  @media (max-width: 768px) {
118
121
  .h-display {
@@ -169,6 +169,10 @@ const sourceLabel = (() => {
169
169
  font-size: 0.45em;
170
170
  text-align: end;
171
171
  vertical-align: baseline;
172
+ ruby-position: under;
173
+ }
174
+ .part-block--vertical :deep(.ann-num-long) {
175
+ font-size: 0.38em;
172
176
  }
173
177
 
174
178
  .part-block--vertical .part-source {
@@ -57,6 +57,8 @@ const emit = defineEmits<{
57
57
  .part-group--vertical {
58
58
  writing-mode: vertical-rl;
59
59
  text-orientation: mixed;
60
+ margin-bottom: 0;
61
+ height: 100%;
60
62
  }
61
63
 
62
64
  .part-group--vertical .part-group-label {
@@ -113,6 +113,7 @@ function onTap(event: MouseEvent) {
113
113
  }
114
114
 
115
115
  :deep(.ann-target) {
116
+ border-bottom: none;
116
117
  border-left-width: 2px;
117
118
  border-left-style: solid;
118
119
  padding-left: 2px;
@@ -125,6 +126,7 @@ function onTap(event: MouseEvent) {
125
126
  :deep(.ann-num) {
126
127
  font-size: 0.45em;
127
128
  text-align: end;
129
+ ruby-position: under;
128
130
  }
129
131
  :deep(.ann-num-long) {
130
132
  font-size: 0.38em;
@@ -44,10 +44,12 @@ if (!import.meta.env.SSR) {
44
44
  localStorage.setItem('theme', t)
45
45
  }, { immediate: true })
46
46
 
47
+ // Layout watch must NOT be immediate — it would overwrite localStorage
48
+ // with the default 'vertical' before nextTick restores the saved value
47
49
  watch(layout, l => {
48
50
  document.documentElement.setAttribute('data-layout', l)
49
51
  localStorage.setItem('layout', l)
50
- }, { immediate: true })
52
+ })
51
53
 
52
54
  watch(mainFontSize, s => {
53
55
  document.documentElement.style.setProperty('--main-font-size', s + 'px')
@@ -15,7 +15,8 @@ export async function createApp() {
15
15
  }
16
16
 
17
17
  if (!import.meta.env.SSR) {
18
- createApp().then(({ app, router }) => {
18
+ createApp().then(async ({ app, router }) => {
19
+ await router.isReady()
19
20
  app.mount('#app')
20
21
  const loader = document.getElementById('app-loading')
21
22
  if (loader) {
@@ -16,6 +16,33 @@
16
16
  .ann-target.date { border-color: var(--ann-date); }
17
17
  .ann-target.allusion { border-color: var(--ann-allusion); }
18
18
 
19
+ /* ─── Horizontal mode: border-bottom underline ─── */
20
+ .ann-target {
21
+ border-bottom-width: 2px;
22
+ border-bottom-style: solid;
23
+ }
24
+ .ann-target.ann-overlap {
25
+ border-bottom-width: 3px;
26
+ border-bottom-style: double;
27
+ }
28
+
29
+ /* ─── Vertical mode: border-left ─── */
30
+ [data-layout="vertical"] .ann-target,
31
+ .v-scroll .ann-target,
32
+ .part-block--vertical .ann-target {
33
+ border-bottom: none;
34
+ border-left-width: 2px;
35
+ border-left-style: solid;
36
+ padding-left: 2px;
37
+ }
38
+ [data-layout="vertical"] .ann-target.ann-overlap,
39
+ .v-scroll .ann-target.ann-overlap,
40
+ .part-block--vertical .ann-target.ann-overlap {
41
+ border-left-width: 3px;
42
+ border-left-style: double;
43
+ padding-left: 3px;
44
+ }
45
+
19
46
  /* ─── Annotation kind hover states ─── */
20
47
  .ann-target:hover {
21
48
  background: color-mix(in srgb, var(--vermillion) 10%, transparent);
@@ -58,13 +85,26 @@
58
85
  box-shadow: 0 var(--ann-shadow-y, 2px) 8px color-mix(in srgb, var(--ann-translation) 8%, transparent);
59
86
  }
60
87
 
61
- /* ─── Annotation number ─── */
88
+ /* ─── Annotation number — horizontal mode (superscript) ─── */
62
89
  .ann-num {
63
90
  color: var(--vermillion);
64
91
  font-family: var(--sans);
65
92
  font-weight: 600;
66
93
  letter-spacing: 0;
94
+ font-size: 10px;
95
+ vertical-align: super;
96
+ margin-right: 1px;
97
+ }
98
+
99
+ /* ─── Annotation number — vertical mode (ruby) ─── */
100
+ .v-scroll .ann-num,
101
+ .part-block--vertical .ann-num {
102
+ font-size: 0.45em;
103
+ text-align: end;
104
+ vertical-align: baseline;
105
+ ruby-position: under;
67
106
  }
68
- .ann-num-long {
69
- letter-spacing: -1px;
107
+ .v-scroll .ann-num-long,
108
+ .part-block--vertical .ann-num-long {
109
+ font-size: 0.38em;
70
110
  }
@@ -779,7 +779,7 @@ function tcy(n: number): string {
779
779
  .v-multipart {
780
780
  display: flex;
781
781
  flex-direction: row-reverse;
782
- align-items: flex-start;
782
+ align-items: stretch;
783
783
  gap: 0;
784
784
  height: 100vh;
785
785
  box-sizing: border-box;