slidev-theme-gtlabo 2.1.9 → 2.2.1
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/components/Citation.vue +1 -1
- package/components/MathText.vue +17 -5
- package/package.json +1 -1
package/components/Citation.vue
CHANGED
|
@@ -67,7 +67,7 @@ const apaInline = computed(() => {
|
|
|
67
67
|
if (!citationData.value) return '(?)'
|
|
68
68
|
const firstAuthor = citationData.value.first_author || '?'
|
|
69
69
|
const year = citationData.value.year || '?'
|
|
70
|
-
return `(${firstAuthor} ${year})`
|
|
70
|
+
return `(${firstAuthor}, ${year})`
|
|
71
71
|
})
|
|
72
72
|
|
|
73
73
|
// スタイルに応じて表示テキストを切り替え
|
package/components/MathText.vue
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
2
|
+
<component
|
|
3
3
|
:is="containerTag"
|
|
4
|
-
|
|
5
|
-
:
|
|
4
|
+
ref="containerRef"
|
|
5
|
+
:class="['math-text-container', containerClass, eq ? 'has-eq-number' : '']"
|
|
6
|
+
:style="eq ? { paddingRight: eqPadding } : {}"
|
|
6
7
|
>
|
|
7
8
|
<!-- スロットが使われている場合 -->
|
|
8
9
|
<template v-if="hasSlotContent">
|
|
@@ -124,12 +125,18 @@ const props = defineProps({
|
|
|
124
125
|
eq: {
|
|
125
126
|
type: String,
|
|
126
127
|
default: null
|
|
128
|
+
},
|
|
129
|
+
eqPadding: {
|
|
130
|
+
type: String,
|
|
131
|
+
default: '2.5em'
|
|
127
132
|
}
|
|
128
133
|
})
|
|
129
134
|
|
|
130
135
|
// 数式レジストリ
|
|
131
136
|
const equationRegistry = inject('equationRegistry', null)
|
|
132
137
|
|
|
138
|
+
const containerRef = ref(null)
|
|
139
|
+
|
|
133
140
|
const eqNumber = computed(() => {
|
|
134
141
|
if (!props.eq || !equationRegistry) return null
|
|
135
142
|
return equationRegistry.getNumber(props.eq)
|
|
@@ -413,8 +420,8 @@ const renderMathElements = async () => {
|
|
|
413
420
|
}
|
|
414
421
|
|
|
415
422
|
onMounted(() => {
|
|
416
|
-
if (props.eq && equationRegistry) {
|
|
417
|
-
equationRegistry.register(props.eq)
|
|
423
|
+
if (props.eq && equationRegistry && containerRef.value) {
|
|
424
|
+
equationRegistry.register(props.eq, containerRef.value)
|
|
418
425
|
}
|
|
419
426
|
renderMathElements()
|
|
420
427
|
})
|
|
@@ -481,6 +488,11 @@ watch([processedTextSegments, processedSlotSegments], () => {
|
|
|
481
488
|
border-radius: 3px;
|
|
482
489
|
}
|
|
483
490
|
|
|
491
|
+
.math-text-container.has-eq-number {
|
|
492
|
+
position: relative;
|
|
493
|
+
display: block;
|
|
494
|
+
}
|
|
495
|
+
|
|
484
496
|
.eq-number {
|
|
485
497
|
position: absolute;
|
|
486
498
|
right: 0;
|