-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
560 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<template> | ||
<node-view-wrapper | ||
as="div" | ||
class="custom-block" | ||
:class="node?.attrs.type" | ||
> | ||
<!-- when image is break text or float bubble menu's position is miscalculated use el-popover instead bubble menu --> | ||
<el-popover | ||
placement="top" | ||
:show-arrow="false" | ||
trigger="hover" | ||
popper-class="editor-custom-block-popper" | ||
> | ||
<CustomBlockBubbleMenu | ||
:node="node" | ||
:editor="editor" | ||
:update-attrs="updateAttributes" | ||
/> | ||
<template #reference> | ||
<NodeViewContent /> | ||
</template> | ||
</el-popover> | ||
</node-view-wrapper> | ||
</template> | ||
<script setup> | ||
import { defineProps } from 'vue'; | ||
import { NodeViewWrapper, NodeViewContent, nodeViewProps } from '@tiptap/vue-3'; | ||
import { ElPopover } from 'element-plus'; | ||
import CustomBlockBubbleMenu from '../menuBubble/CustomBlockBubbleMenu.vue' | ||
const props = defineProps(nodeViewProps) | ||
console.log(props.node) | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
<template> | ||
<div class="custom-block-bubble-menu"> | ||
<div | ||
class="custom-checkbox tips" | ||
:class="[node.attrs.type === 'tips' && 'checked']" | ||
@click="handleCheckboxClick('tips')" | ||
> | ||
<input | ||
class="custom-checkbox__original" | ||
type="checkbox" | ||
aria-hidden="false" | ||
> | ||
<span class="custom-checkbox__inner" /> | ||
</div> | ||
<div | ||
class="custom-checkbox info" | ||
:class="[node.attrs.type === 'info' && 'checked']" | ||
@click="handleCheckboxClick('info')" | ||
> | ||
<input | ||
class="custom-checkbox__original" | ||
type="checkbox" | ||
aria-hidden="false" | ||
> | ||
<span class="custom-checkbox__inner" /> | ||
</div> | ||
<div | ||
class="custom-checkbox warning" | ||
:class="[node.attrs.type === 'warning' && 'checked']" | ||
@click="handleCheckboxClick('warning')" | ||
> | ||
<input | ||
class="custom-checkbox__original" | ||
type="checkbox" | ||
aria-hidden="false" | ||
> | ||
<span class="custom-checkbox__inner" /> | ||
</div> | ||
<div | ||
class="custom-checkbox success" | ||
:class="[node.attrs.type === 'success' && 'checked']" | ||
@click="handleCheckboxClick('success')" | ||
> | ||
<input | ||
class="custom-checkbox__original" | ||
type="checkbox" | ||
aria-hidden="false" | ||
> | ||
<span class="custom-checkbox__inner" /> | ||
</div> | ||
<div | ||
class="custom-checkbox danger" | ||
:class="[node.attrs.type === 'danger' && 'checked']" | ||
@click="handleCheckboxClick('danger')" | ||
> | ||
<input | ||
class="custom-checkbox__original" | ||
type="checkbox" | ||
aria-hidden="false" | ||
> | ||
<span class="custom-checkbox__inner" /> | ||
</div> | ||
<div | ||
class="custom-checkbox color1" | ||
:class="[node.attrs.type === 'color1' && 'checked']" | ||
@click="handleCheckboxClick('color1')" | ||
> | ||
<input | ||
class="custom-checkbox__original" | ||
type="checkbox" | ||
aria-hidden="false" | ||
> | ||
<span class="custom-checkbox__inner" /> | ||
</div> | ||
<div | ||
class="custom-checkbox color2" | ||
:class="[node.attrs.type === 'color2' && 'checked']" | ||
@click="handleCheckboxClick('color2')" | ||
> | ||
<input | ||
class="custom-checkbox__original" | ||
type="checkbox" | ||
aria-hidden="false" | ||
> | ||
<span class="custom-checkbox__inner" /> | ||
</div> | ||
<div | ||
class="custom-checkbox color3" | ||
:class="[node.attrs.type === 'color3' && 'checked']" | ||
@click="handleCheckboxClick('color3')" | ||
> | ||
<input | ||
class="custom-checkbox__original" | ||
type="checkbox" | ||
aria-hidden="false" | ||
> | ||
<span class="custom-checkbox__inner" /> | ||
</div> | ||
<div | ||
class="custom-checkbox color4" | ||
:class="[node.attrs.type === 'color4' && 'checked']" | ||
@click="handleCheckboxClick('color4')" | ||
> | ||
<input | ||
class="custom-checkbox__original" | ||
type="checkbox" | ||
aria-hidden="false" | ||
> | ||
<span class="custom-checkbox__inner" /> | ||
</div> | ||
<div | ||
class="custom-checkbox color5" | ||
:class="[node.attrs.type === 'color5' && 'checked']" | ||
@click="handleCheckboxClick('color5')" | ||
> | ||
<input | ||
class="custom-checkbox__original" | ||
type="checkbox" | ||
aria-hidden="false" | ||
> | ||
<span class="custom-checkbox__inner" /> | ||
</div> | ||
</div> | ||
</template> | ||
|
||
<script lang="ts" setup> | ||
import { defineProps } from 'vue'; | ||
import { nodeViewProps } from '@tiptap/vue-3'; | ||
const props = defineProps({ | ||
editor: nodeViewProps.editor, | ||
node: nodeViewProps.node, | ||
updateAttrs: nodeViewProps.updateAttributes, | ||
}) | ||
const handleCheckboxClick = (type: string) => { | ||
props.updateAttrs({ type }) | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.