Skip to content

Commit f7346f5

Browse files
committed
fix: try fix errors
1 parent 05fc110 commit f7346f5

File tree

4 files changed

+36
-34
lines changed

4 files changed

+36
-34
lines changed

.prettierrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"semi": false
3+
}

src/custom-extensions/extension-image-upload/ImagePlaceholder.vue

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
</template>
1919

2020
<script setup>
21+
import { computed, onMounted, ref } from 'vue'
2122
import { NodeViewWrapper } from '@tiptap/vue-3'
2223
2324
const props = defineProps({
@@ -57,33 +58,33 @@ function onLoad(e) {
5758
5859
<style lang="scss" scoped>
5960
.image-placeholder {
60-
max-width: 100%;
61-
position: relative;
62-
width: fit-content;
61+
max-width: 100%;
62+
position: relative;
63+
width: fit-content;
6364
64-
&.inline {
65-
display: inline-block;
66-
}
65+
&.inline {
66+
display: inline-block;
67+
}
6768
68-
&.uploading::before {
69-
content: 'Uploading...';
70-
position: sticky;
71-
width: 100%;
72-
top: 20%;
73-
left: 0;
74-
text-align: center;
75-
font-size: 16px;
76-
font-weight: bold;
77-
text-shadow: 2px 2px 14px #000;
78-
white-space: pre;
79-
display: block;
80-
line-height: 44px;
81-
}
69+
&.uploading::before {
70+
content: 'Uploading...';
71+
position: sticky;
72+
width: 100%;
73+
top: 20%;
74+
left: 0;
75+
text-align: center;
76+
font-size: 16px;
77+
font-weight: bold;
78+
text-shadow: 2px 2px 14px #000;
79+
white-space: pre;
80+
display: block;
81+
line-height: 44px;
82+
}
8283
83-
img {
84-
margin-top: -44px;
85-
max-width: 100%;
86-
opacity: 0.2;
87-
}
84+
img {
85+
margin-top: -44px;
86+
max-width: 100%;
87+
opacity: 0.2;
88+
}
8889
}
8990
</style>

src/custom-extensions/extension-image-upload/imagePlaceholder.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ export interface ImagePlaceholderOptions {
77
HTMLAttributes: Record<string, unknown>
88
}
99

10-
export const inputRegex
11-
= /(?:^|\s)(!\[(.+|:?)\]\((\S+)(?:\s+["'](\S+)["'])?\))$/
10+
export const inputRegex = /(?:^|\s)(!\[(.+|:?)\]\((\S+)(?:\s+["'](\S+)["'])?\))$/
1211

1312
export const ImagePlaceholder = Node.create<ImagePlaceholderOptions>({
1413
name: 'imagePlaceholder',
@@ -49,7 +48,8 @@ export const ImagePlaceholder = Node.create<ImagePlaceholderOptions>({
4948
},
5049

5150
addNodeView() {
52-
return VueNodeViewRenderer(ImagePlaceholderComponent)
51+
const imagePlaceholderComponent = new ImagePlaceholderComponent()
52+
return VueNodeViewRenderer(imagePlaceholderComponent)
5353
},
5454

5555
addInputRules() {

src/module.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ export default defineNuxtModule<ModuleOptions>({
4747
as: obj.as || obj.name,
4848
name: obj.name,
4949
from: obj.path,
50-
// _internal_install: obj.path,
5150
})
5251
transpileModules.add(obj.path)
5352
}
@@ -57,7 +56,6 @@ export default defineNuxtModule<ModuleOptions>({
5756
as: `${options.prefix}${obj.name}`,
5857
name: obj.name,
5958
from: obj.path,
60-
// _internal_install: obj.path,
6159
})
6260
transpileModules.add(obj.path)
6361
}
@@ -67,7 +65,6 @@ export default defineNuxtModule<ModuleOptions>({
6765
name: `${options.prefix}${obj.name}`,
6866
export: obj.name,
6967
filePath: obj.path,
70-
// _internal_install: obj.path,
7168
})
7269
transpileModules.add(obj.path)
7370
}
@@ -93,7 +90,6 @@ export default defineNuxtModule<ModuleOptions>({
9390
as: `${options.prefix}${obj.name}`,
9491
name: obj.name,
9592
from: obj.path,
96-
// _internal_install: obj.path,
9793
})
9894
transpileModules.add(obj.path)
9995
}
@@ -103,7 +99,6 @@ export default defineNuxtModule<ModuleOptions>({
10399
as: obj.as || obj.name,
104100
name: obj.name,
105101
from: obj.path,
106-
// _internal_install: obj.path,
107102
})
108103
transpileModules.add(obj.path)
109104
}
@@ -113,11 +108,14 @@ export default defineNuxtModule<ModuleOptions>({
113108
name: `${options.prefix}${obj.name}`,
114109
export: obj.name,
115110
filePath: obj.path,
116-
// _internal_install: obj.path,
117111
})
118112
transpileModules.add(obj.path)
119113
}
120114

115+
transpileModules.add(
116+
'./custom-extensions',
117+
)
118+
121119
nuxt.options.build.transpile = [
122120
...nuxt.options.build.transpile,
123121
...Array.from(transpileModules),

0 commit comments

Comments
 (0)