@hanology/cham-browser 0.4.47 → 0.4.49

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.47",
3
+ "version": "0.4.49",
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",
@@ -225,7 +225,6 @@ const paragraphsHtml = computed(() => {
225
225
  border-bottom: none;
226
226
  }
227
227
  .sb-vertical .sb-ann-head {
228
- flex-direction: column;
229
228
  align-items: flex-start;
230
229
  gap: 4px;
231
230
  }
@@ -160,22 +160,27 @@ export function useAnnotationTooltip() {
160
160
  bottom: '0',
161
161
  }
162
162
  } else if (layout.value === 'vertical') {
163
- // Vertical mode: wide card with multi-column layout to the left
164
- const cardW = 260
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 - cardW - gap)
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 (rect.left - cardW - gap < 8) {
172
- left = Math.min(rect.right + gap, vw - cardW - 8)
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
- width: cardW + 'px',
183
+ maxWidth: maxW + 'px',
179
184
  maxHeight: cardH + 'px',
180
185
  }
181
186
  } else {