@troshab/slidev-theme-troshab 0.1.1 → 0.1.3

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.
@@ -31,6 +31,7 @@ const props = withDefaults(defineProps<{
31
31
  direction?: 'horizontal' | 'vertical'
32
32
  mode?: 'static' | 'clicks'
33
33
  current?: number
34
+ start?: number
34
35
  color?: SemanticColor
35
36
  trackValign?: VAlign
36
37
  contentValign?: VAlign
@@ -39,6 +40,7 @@ const props = withDefaults(defineProps<{
39
40
  direction: 'horizontal',
40
41
  mode: 'static',
41
42
  color: 'primary',
43
+ start: 1,
42
44
  trackValign: 'center',
43
45
  contentValign: 'center',
44
46
  })
@@ -72,7 +74,7 @@ const clicksContext = inject<Ref<ClicksContext>>('$$slidev-clicks-context', ref(
72
74
 
73
75
  // --- Auto v-click registration (clicks mode) ---
74
76
  const rootEl = ref<HTMLElement | null>(null)
75
- const autoActiveStep = ref(1)
77
+ const autoActiveStep = ref(props.start)
76
78
  const isAutoRegistered = ref(false)
77
79
 
78
80
  onMounted(() => {
@@ -80,7 +82,7 @@ onMounted(() => {
80
82
  const ctx = clicksContext.value
81
83
  if (!ctx?.calculateSince || !rootEl.value) return
82
84
 
83
- const size = normalizedItems.value.length - 1
85
+ const size = normalizedItems.value.length - props.start
84
86
  if (size <= 0) return
85
87
 
86
88
  const info = ctx.calculateSince('+1', size)
@@ -95,7 +97,7 @@ onMounted(() => {
95
97
  watchEffect(() => {
96
98
  const active = isActiveRef.value
97
99
  const offset = offsetRef.value
98
- autoActiveStep.value = active ? Math.min(offset + 2, normalizedItems.value.length) : 1
100
+ autoActiveStep.value = active ? Math.min(offset + props.start + 1, normalizedItems.value.length) : props.start
99
101
  })
100
102
  })
101
103
 
@@ -111,7 +113,7 @@ const activeStep = computed(() => {
111
113
  if (isAutoRegistered.value) return autoActiveStep.value
112
114
  // Fallback: direct click count (non-Slidev contexts)
113
115
  const clicks = clicksContext.value?.current ?? 0
114
- return Math.min(clicks + 1, normalizedItems.value.length)
116
+ return Math.min(clicks + props.start, normalizedItems.value.length)
115
117
  }
116
118
  return props.current
117
119
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@troshab/slidev-theme-troshab",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "A minimal, universal Slidev theme with flexible layouts and ready-to-use slide templates",
5
5
  "author": "troshab",
6
6
  "license": "PolyForm-Noncommercial-1.0.0",
@@ -23,7 +23,8 @@
23
23
  ],
24
24
  "defaults": {
25
25
  "layout": "slide",
26
- "transition": "t-fade"
26
+ "transition": "t-fade",
27
+ "canvasWidth": 1920
27
28
  }
28
29
  },
29
30
  "engines": {