@hanology/cham-browser 0.4.42 → 0.4.45
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,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>
|
|
@@ -189,7 +190,6 @@ onBeforeUnmount(() => {
|
|
|
189
190
|
display: flex;
|
|
190
191
|
flex-direction: row;
|
|
191
192
|
align-items: center;
|
|
192
|
-
justify-content: space-between;
|
|
193
193
|
padding: 10px 14px;
|
|
194
194
|
border-bottom: 1px solid var(--border-light);
|
|
195
195
|
background: var(--surface);
|
|
@@ -204,15 +204,17 @@ onBeforeUnmount(() => {
|
|
|
204
204
|
}
|
|
205
205
|
|
|
206
206
|
.ann-badge-count {
|
|
207
|
+
display: inline-block;
|
|
208
|
+
padding: 1px 7px;
|
|
209
|
+
border-radius: 3px;
|
|
210
|
+
font-size: 10px;
|
|
207
211
|
font-family: var(--sans);
|
|
208
|
-
font-size: 11px;
|
|
209
212
|
font-weight: 700;
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
letter-spacing: 0;
|
|
213
|
+
letter-spacing: 1px;
|
|
214
|
+
line-height: 1.5;
|
|
215
|
+
background: var(--vermillion);
|
|
216
|
+
color: #fff;
|
|
217
|
+
margin-bottom: 5px;
|
|
216
218
|
}
|
|
217
219
|
|
|
218
220
|
/* ─── Annotation entry ─── */
|
|
@@ -449,13 +451,17 @@ onBeforeUnmount(() => {
|
|
|
449
451
|
.ann-card.vertical .ann-card-head {
|
|
450
452
|
writing-mode: vertical-rl;
|
|
451
453
|
text-orientation: upright;
|
|
452
|
-
padding: 6px
|
|
454
|
+
padding: 6px 8px;
|
|
453
455
|
border-bottom: none;
|
|
454
456
|
border-right: 1px solid var(--border-light);
|
|
455
457
|
flex-direction: row;
|
|
456
458
|
align-items: center;
|
|
457
459
|
flex-shrink: 0;
|
|
458
460
|
}
|
|
461
|
+
.ann-card.vertical .ann-card-head.commentary {
|
|
462
|
+
border-right: none;
|
|
463
|
+
border-left: 1px solid var(--border-light);
|
|
464
|
+
}
|
|
459
465
|
.ann-card.vertical .ann-headword {
|
|
460
466
|
letter-spacing: 6px;
|
|
461
467
|
}
|