@hanology/cham-browser 0.4.48 → 0.4.50
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
|
@@ -125,8 +125,8 @@ onBeforeUnmount(() => {
|
|
|
125
125
|
@mouseleave="emit('tooltipLeave')"
|
|
126
126
|
>
|
|
127
127
|
<div v-if="headword" class="ann-card-head" :class="dominantKind()">
|
|
128
|
-
<div class="ann-badge-count" v-if="annotations.length > 1">{{ toChineseNumber(annotations.length) }}</div>
|
|
129
128
|
<div class="ann-headword">{{ headword }}</div>
|
|
129
|
+
<div class="ann-badge-count" v-if="annotations.length > 1">{{ toChineseNumber(annotations.length) }}注</div>
|
|
130
130
|
</div>
|
|
131
131
|
<button class="ann-card-close" @click="dismiss" aria-label="關閉">
|
|
132
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>
|
|
@@ -158,8 +158,8 @@ onBeforeUnmount(() => {
|
|
|
158
158
|
</button>
|
|
159
159
|
<div class="ann-sheet-body" :class="{ vertical }">
|
|
160
160
|
<div v-if="headword" class="ann-sheet-head" :class="dominantKind()">
|
|
161
|
-
<div class="ann-badge-count" v-if="annotations.length > 1">{{ toChineseNumber(annotations.length) }}</div>
|
|
162
161
|
<div class="ann-headword">{{ headword }}</div>
|
|
162
|
+
<div class="ann-badge-count" v-if="annotations.length > 1">{{ toChineseNumber(annotations.length) }}注</div>
|
|
163
163
|
</div>
|
|
164
164
|
<div class="ann-sheet-scroll">
|
|
165
165
|
<div v-for="ann in annotations" :key="ann.id" class="ann-entry">
|
|
@@ -175,7 +175,7 @@ onBeforeUnmount(() => {
|
|
|
175
175
|
</div>
|
|
176
176
|
<div v-if="headword" class="ann-sheet-v-head" :class="dominantKind()">
|
|
177
177
|
<span class="ann-sheet-v-word">{{ headword }}</span>
|
|
178
|
-
<span v-if="annotations.length > 1" class="ann-badge-count-v">{{ toChineseNumber(annotations.length) }}
|
|
178
|
+
<span v-if="annotations.length > 1" class="ann-badge-count-v">{{ toChineseNumber(annotations.length) }}注</span>
|
|
179
179
|
</div>
|
|
180
180
|
</div>
|
|
181
181
|
</div>
|
|
@@ -160,22 +160,27 @@ export function useAnnotationTooltip() {
|
|
|
160
160
|
bottom: '0',
|
|
161
161
|
}
|
|
162
162
|
} else if (layout.value === 'vertical') {
|
|
163
|
-
// Vertical mode:
|
|
164
|
-
const
|
|
163
|
+
// Vertical mode: card next to hovered text
|
|
164
|
+
const maxW = 260
|
|
165
165
|
const cardH = Math.min(vh - 16, 480)
|
|
166
166
|
const gap = 12
|
|
167
|
-
let left = Math.max(8, rect.left -
|
|
167
|
+
let left = Math.max(8, rect.left - maxW - gap)
|
|
168
168
|
let top = Math.max(8, Math.min(rect.top, vh - cardH))
|
|
169
169
|
|
|
170
170
|
// If not enough room on left, go right
|
|
171
|
-
if (
|
|
172
|
-
left =
|
|
171
|
+
if (left < 8) {
|
|
172
|
+
left = rect.right + gap
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
// Clamp to viewport
|
|
176
|
+
if (left + maxW > vw - 8) {
|
|
177
|
+
left = Math.max(8, vw - maxW - 8)
|
|
173
178
|
}
|
|
174
179
|
|
|
175
180
|
style.value = {
|
|
176
181
|
left: left + 'px',
|
|
177
182
|
top: top + 'px',
|
|
178
|
-
|
|
183
|
+
maxWidth: maxW + 'px',
|
|
179
184
|
maxHeight: cardH + 'px',
|
|
180
185
|
}
|
|
181
186
|
} else {
|
|
@@ -841,6 +841,9 @@ function tcy(n: number): string {
|
|
|
841
841
|
.v-nav-btn {
|
|
842
842
|
writing-mode: vertical-rl;
|
|
843
843
|
text-orientation: mixed;
|
|
844
|
+
display: flex;
|
|
845
|
+
flex-direction: row;
|
|
846
|
+
align-items: flex-start;
|
|
844
847
|
padding: 20px 14px;
|
|
845
848
|
background: var(--surface);
|
|
846
849
|
border: 1px solid var(--border-light);
|
|
@@ -857,12 +860,12 @@ function tcy(n: number): string {
|
|
|
857
860
|
.v-nav-btn:hover .v-nav-title { color: var(--vermillion); }
|
|
858
861
|
.v-nav-dir {
|
|
859
862
|
font-size: 16px; color: var(--vermillion);
|
|
860
|
-
margin-bottom: 0.
|
|
863
|
+
margin-bottom: 0.3em;
|
|
861
864
|
}
|
|
862
865
|
.v-nav-label {
|
|
863
866
|
font-size: 11px; color: var(--ink-faint);
|
|
864
867
|
font-family: var(--sans); letter-spacing: 2px;
|
|
865
|
-
margin-bottom: 0.
|
|
868
|
+
margin-bottom: 0.3em;
|
|
866
869
|
}
|
|
867
870
|
.v-nav-title {
|
|
868
871
|
font-size: 18px; font-weight: 700;
|