Skip to content

Commit

Permalink
fix: try fix errors
Browse files Browse the repository at this point in the history
  • Loading branch information
modbender committed Nov 28, 2024
1 parent 05fc110 commit f7346f5
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 34 deletions.
3 changes: 3 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"semi": false
}
51 changes: 26 additions & 25 deletions src/custom-extensions/extension-image-upload/ImagePlaceholder.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
</template>

<script setup>
import { computed, onMounted, ref } from 'vue'
import { NodeViewWrapper } from '@tiptap/vue-3'
const props = defineProps({
Expand Down Expand Up @@ -57,33 +58,33 @@ function onLoad(e) {
<style lang="scss" scoped>
.image-placeholder {
max-width: 100%;
position: relative;
width: fit-content;
max-width: 100%;
position: relative;
width: fit-content;
&.inline {
display: inline-block;
}
&.inline {
display: inline-block;
}
&.uploading::before {
content: 'Uploading...';
position: sticky;
width: 100%;
top: 20%;
left: 0;
text-align: center;
font-size: 16px;
font-weight: bold;
text-shadow: 2px 2px 14px #000;
white-space: pre;
display: block;
line-height: 44px;
}
&.uploading::before {
content: 'Uploading...';
position: sticky;
width: 100%;
top: 20%;
left: 0;
text-align: center;
font-size: 16px;
font-weight: bold;
text-shadow: 2px 2px 14px #000;
white-space: pre;
display: block;
line-height: 44px;
}
img {
margin-top: -44px;
max-width: 100%;
opacity: 0.2;
}
img {
margin-top: -44px;
max-width: 100%;
opacity: 0.2;
}
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ export interface ImagePlaceholderOptions {
HTMLAttributes: Record<string, unknown>
}

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

export const ImagePlaceholder = Node.create<ImagePlaceholderOptions>({
name: 'imagePlaceholder',
Expand Down Expand Up @@ -49,7 +48,8 @@ export const ImagePlaceholder = Node.create<ImagePlaceholderOptions>({
},

addNodeView() {
return VueNodeViewRenderer(ImagePlaceholderComponent)
const imagePlaceholderComponent = new ImagePlaceholderComponent()
return VueNodeViewRenderer(imagePlaceholderComponent)
},

addInputRules() {
Expand Down
10 changes: 4 additions & 6 deletions src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ export default defineNuxtModule<ModuleOptions>({
as: obj.as || obj.name,
name: obj.name,
from: obj.path,
// _internal_install: obj.path,
})
transpileModules.add(obj.path)
}
Expand All @@ -57,7 +56,6 @@ export default defineNuxtModule<ModuleOptions>({
as: `${options.prefix}${obj.name}`,
name: obj.name,
from: obj.path,
// _internal_install: obj.path,
})
transpileModules.add(obj.path)
}
Expand All @@ -67,7 +65,6 @@ export default defineNuxtModule<ModuleOptions>({
name: `${options.prefix}${obj.name}`,
export: obj.name,
filePath: obj.path,
// _internal_install: obj.path,
})
transpileModules.add(obj.path)
}
Expand All @@ -93,7 +90,6 @@ export default defineNuxtModule<ModuleOptions>({
as: `${options.prefix}${obj.name}`,
name: obj.name,
from: obj.path,
// _internal_install: obj.path,
})
transpileModules.add(obj.path)
}
Expand All @@ -103,7 +99,6 @@ export default defineNuxtModule<ModuleOptions>({
as: obj.as || obj.name,
name: obj.name,
from: obj.path,
// _internal_install: obj.path,
})
transpileModules.add(obj.path)
}
Expand All @@ -113,11 +108,14 @@ export default defineNuxtModule<ModuleOptions>({
name: `${options.prefix}${obj.name}`,
export: obj.name,
filePath: obj.path,
// _internal_install: obj.path,
})
transpileModules.add(obj.path)
}

transpileModules.add(
'./custom-extensions',
)

nuxt.options.build.transpile = [
...nuxt.options.build.transpile,
...Array.from(transpileModules),
Expand Down

0 comments on commit f7346f5

Please sign in to comment.