@meistrari/tela-build 1.23.0 → 1.25.0

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.
@@ -22,6 +22,8 @@ const props = withDefaults(
22
22
  highlightPage?: number | null
23
23
  /** When true, uses exact matching instead of fuzzy word-based matching for highlights. */
24
24
  highlightExact?: boolean
25
+ /** Override the initial zoom scale. Defaults to 1 for minimal, 0.75 for default. */
26
+ initialScale?: number
25
27
  }>(),
26
28
  {
27
29
  variant: 'default',
@@ -29,6 +31,7 @@ const props = withDefaults(
29
31
  highlightText: undefined,
30
32
  highlightPage: undefined,
31
33
  highlightExact: false,
34
+ initialScale: undefined,
32
35
  },
33
36
  )
34
37
 
@@ -79,7 +82,7 @@ const currentDocumentPage = ref(1)
79
82
  const isPageInputFocused = ref(false)
80
83
  const isProgrammaticScroll = ref(false)
81
84
 
82
- const scale = ref(props.variant === 'minimal' ? 1 : 0.75)
85
+ const scale = ref(props.initialScale ?? (props.variant === 'minimal' ? 1 : 0.75))
83
86
  const scrollContainerRef = ref<HTMLElement | null>(null)
84
87
  const isDragging = ref(false)
85
88
  const dragEnabled = ref(false)
@@ -4,6 +4,8 @@ import { nextTick, ref, toValue } from 'vue'
4
4
  export interface CitationTarget {
5
5
  file: string
6
6
  page: number
7
+ literal?: string
8
+ rationale?: string
7
9
  }
8
10
 
9
11
  export function useCitationNavigation(options: {
@@ -40,7 +42,7 @@ export function useCitationNavigation(options: {
40
42
  return null
41
43
 
42
44
  if ('file' in current && current.file)
43
- return { file: current.file, page: current.page }
45
+ return { file: current.file, page: current.page, literal: current.literal, rationale: current.rationale }
44
46
 
45
47
  return null
46
48
  }
@@ -62,9 +64,8 @@ export function useCitationNavigation(options: {
62
64
  nextTick(() => {
63
65
  activeFile.value = citation.file
64
66
  highlightPage.value = citation.page
65
- highlightText.value = value != null
66
- ? (typeof value === 'string' ? value : String(value))
67
- : null
67
+ highlightText.value = citation.literal
68
+ ?? (value != null ? (typeof value === 'string' ? value : String(value)) : null)
68
69
  highlightExact.value = true
69
70
  })
70
71
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meistrari/tela-build",
3
- "version": "1.23.0",
3
+ "version": "1.25.0",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "app.config.ts",