@hanology/cham-browser 0.4.41 → 0.4.43

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.41",
3
+ "version": "0.4.43",
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",
@@ -1,6 +1,7 @@
1
1
  <script setup lang="ts">
2
2
  import { computed, ref, watch, onMounted, onBeforeUnmount } from 'vue'
3
3
  import { annotationToPronSegment } from '../utils/annotationParser'
4
+ import { toChineseNumber } from '../utils/chineseNumber'
4
5
  import PronunciationGroup from './PronunciationGroup.vue'
5
6
  import type { Annotation } from '../types'
6
7
 
@@ -124,8 +125,8 @@ onBeforeUnmount(() => {
124
125
  @mouseleave="emit('tooltipLeave')"
125
126
  >
126
127
  <div v-if="headword" class="ann-card-head" :class="dominantKind()">
128
+ <span class="ann-badge-count" v-if="annotations.length > 1">{{ toChineseNumber(annotations.length) }}</span>
127
129
  <span class="ann-headword">{{ headword }}</span>
128
- <span class="ann-badge-count" v-if="annotations.length > 1">{{ annotations.length }}</span>
129
130
  </div>
130
131
  <button class="ann-card-close" @click="dismiss" aria-label="關閉">
131
132
  <svg width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3"><path d="M18 6L6 18M6 6l12 12"/></svg>
@@ -157,8 +158,8 @@ onBeforeUnmount(() => {
157
158
  </button>
158
159
  <div class="ann-sheet-body" :class="{ vertical }">
159
160
  <div v-if="headword" class="ann-sheet-head" :class="dominantKind()">
161
+ <span class="ann-badge-count" v-if="annotations.length > 1">{{ toChineseNumber(annotations.length) }}</span>
160
162
  <span class="ann-headword">{{ headword }}</span>
161
- <span class="ann-badge-count" v-if="annotations.length > 1">{{ annotations.length }}</span>
162
163
  </div>
163
164
  <div class="ann-sheet-scroll">
164
165
  <div v-for="ann in annotations" :key="ann.id" class="ann-entry">
@@ -174,7 +175,7 @@ onBeforeUnmount(() => {
174
175
  </div>
175
176
  <div v-if="headword" class="ann-sheet-v-head" :class="dominantKind()">
176
177
  <span class="ann-sheet-v-word">{{ headword }}</span>
177
- <span v-if="annotations.length > 1" class="ann-badge-count-v">{{ annotations.length }}</span>
178
+ <span v-if="annotations.length > 1" class="ann-badge-count-v">{{ toChineseNumber(annotations.length) }}</span>
178
179
  </div>
179
180
  </div>
180
181
  </div>
@@ -204,15 +205,16 @@ onBeforeUnmount(() => {
204
205
  }
205
206
 
206
207
  .ann-badge-count {
208
+ display: inline-block;
209
+ padding: 1px 7px;
210
+ border-radius: 3px;
211
+ font-size: 10px;
207
212
  font-family: var(--sans);
208
- font-size: 11px;
209
213
  font-weight: 700;
210
- color: var(--ink-faint);
211
- background: var(--surface-warm);
212
- border: 1px solid var(--border-light);
213
- border-radius: 10px;
214
- padding: 2px 8px;
215
- letter-spacing: 0;
214
+ letter-spacing: 1px;
215
+ line-height: 1.5;
216
+ background: var(--vermillion);
217
+ color: #fff;
216
218
  }
217
219
 
218
220
  /* ─── Annotation entry ─── */
@@ -221,7 +223,7 @@ onBeforeUnmount(() => {
221
223
  border-bottom: 1px solid var(--border-light);
222
224
  font-size: 14px;
223
225
  color: var(--ink-mid);
224
- letter-spacing: 0.5px;
226
+ letter-spacing: 1.5px;
225
227
  line-height: 1.8;
226
228
  }
227
229
  .ann-entry:last-child { border-bottom: none; padding-bottom: 0; }
@@ -252,7 +254,7 @@ onBeforeUnmount(() => {
252
254
  .ann-kind.etymology { background: #6b5b95; color: #fff; }
253
255
  .ann-kind.note,
254
256
  .ann-kind.definition { background: var(--ink); color: var(--paper); }
255
- .ann-kind.commentary { background: #c0392b; color: #fff; }
257
+ .ann-kind.commentary { background: #c0392b; color: #fff; align-self: center; }
256
258
  .ann-kind.translation { background: #2c6e49; color: #fff; }
257
259
  .ann-kind.person { background: var(--ann-person); color: #fff; }
258
260
  .ann-kind.place { background: var(--ann-place); color: #fff; }
@@ -273,6 +275,7 @@ onBeforeUnmount(() => {
273
275
  .ann-text {
274
276
  white-space: pre-line;
275
277
  line-height: 1.8;
278
+ padding-top: 5px;
276
279
  }
277
280
 
278
281
  /* ─── Floating card ─── */
@@ -475,7 +478,7 @@ onBeforeUnmount(() => {
475
478
  .ann-card.vertical .ann-entry {
476
479
  flex-shrink: 0;
477
480
  border-bottom: none;
478
- padding: 0 10px;
481
+ margin: 0 3px;
479
482
  border-right: 1px solid var(--border-light);
480
483
  writing-mode: vertical-rl;
481
484
  text-orientation: mixed;