-
Notifications
You must be signed in to change notification settings - Fork 6
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
1 parent
2681336
commit a35cbfe
Showing
11 changed files
with
155 additions
and
85,690 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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,14 @@ | ||
/*! | ||
* The buffer module from node.js, for the browser. | ||
* | ||
* @author Feross Aboukhadijeh <http://feross.org> | ||
* @license MIT | ||
*/ | ||
|
||
/*! | ||
* vuex v4.1.0 | ||
* (c) 2022 Evan You | ||
* @license MIT | ||
*/ | ||
|
||
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */ |
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 |
---|---|---|
@@ -1,45 +1,60 @@ | ||
<template> | ||
<Modal :show="true"> | ||
<form | ||
@submit.prevent="$emit('confirm')" | ||
class="mx-auto bg-white dark:bg-gray-800 rounded-lg shadow-lg overflow-hidden" | ||
> | ||
<div class="mx-auto bg-white dark:bg-gray-800 rounded-lg shadow-lg overflow-hidden"> | ||
<slot> | ||
<ModalHeader> | ||
Insert link | ||
</ModalHeader> | ||
<ModalContent> | ||
<input | ||
class="form-control form-input form-control-bordered" | ||
/> | ||
<Input v-model="link" placeholder="https://example.com" /> | ||
</ModalContent> | ||
</slot> | ||
|
||
<ModalFooter> | ||
<div class="ml-auto"> | ||
<link-button | ||
<div> | ||
<Button | ||
v-if="value.length > 0" | ||
@click="this.$emit('remove')" | ||
type="button" | ||
@click.prevent="this.$emit('close')" | ||
state="danger" | ||
class="mr-3" | ||
> | ||
Cancel | ||
</link-button> | ||
|
||
<Button ref="confirmButton" type="submit"> | ||
Link | ||
Remove | ||
</Button> | ||
|
||
<Button | ||
@click="this.$emit('confirm', link)" | ||
type="button" | ||
> | ||
Save | ||
</Button> | ||
|
||
<link-button @click.prevent="this.$emit('cancel')" class="ml-auto"> | ||
Cancel | ||
</link-button> | ||
</div> | ||
</ModalFooter> | ||
</form> | ||
</div> | ||
</Modal> | ||
</template> | ||
|
||
<script> | ||
import { Button } from 'laravel-nova-ui' | ||
import { Button, Input } from 'laravel-nova-ui' | ||
export default { | ||
emits: ["close", "confirm"], | ||
components: { Button }, | ||
emits: ['cancel', 'remove', 'confirm'], | ||
components: { Input, Button }, | ||
props: { | ||
value: { | ||
type: String, | ||
default: '' | ||
} | ||
}, | ||
data () { | ||
return { | ||
link: this.value | ||
} | ||
} | ||
}; | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
<template> | ||
<button | ||
type="button" | ||
class="hover:text-primary-600 disabled:opacity-50" | ||
:class="{ 'text-primary-600': isActive }" | ||
@click="openModal" | ||
> | ||
<LinkIcon class="h-5 w-5" /> | ||
</button> | ||
|
||
<InsertLink | ||
v-if="insertingLink" | ||
:value="currentLink" | ||
@confirm="insertLink" | ||
@remove="removeLink" | ||
@cancel="insertingLink = false" | ||
/> | ||
</template> | ||
|
||
<script> | ||
import tippy from 'tippy.js' | ||
import BaseTool from './BaseTool' | ||
import { LinkIcon } from '@heroicons/vue/24/outline' | ||
import InsertLink from '../Modals/InsertLink.vue' | ||
export default { | ||
extends: BaseTool, | ||
components: { | ||
InsertLink, | ||
LinkIcon | ||
}, | ||
data () { | ||
return { | ||
insertingLink: false | ||
} | ||
}, | ||
computed: { | ||
isActive () { | ||
return this.editor.isActive('link') | ||
}, | ||
currentLink () { | ||
return this.editor.getAttributes('link').href | ||
} | ||
}, | ||
methods: { | ||
/** | ||
* Open the insert link modal. | ||
*/ | ||
openModal () { | ||
this.insertingLink = true | ||
}, | ||
/** | ||
* Insert the provided link into the selected text. | ||
* | ||
* @param {String} link | ||
*/ | ||
insertLink (link) { | ||
this.editor.chain().focus().extendMarkRange('link').setLink({ href: link }).run() | ||
// Close the insert link modal. | ||
this.insertingLink = false | ||
}, | ||
/** | ||
* Remove the currently selected link. | ||
*/ | ||
removeLink () { | ||
this.editor.chain().focus().extendMarkRange('link').unsetLink().run() | ||
// Close the insert link modal. | ||
this.insertingLink = false | ||
} | ||
} | ||
} | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<template> | ||
|
||
</template> |
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,11 @@ | ||
import LinkComponent from '../../components/Tools/Link.vue' | ||
import Link from '@tiptap/extension-link' | ||
|
||
export default { | ||
component: LinkComponent, | ||
extension () { | ||
return Link.configure({ | ||
openOnClick: false | ||
}) | ||
} | ||
} |
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