Skip to content

Commit

Permalink
Add VueQuill edit HTML BTN
Browse files Browse the repository at this point in the history
  • Loading branch information
PrestaSafe committed Aug 29, 2024
1 parent f831169 commit e57c5be
Show file tree
Hide file tree
Showing 5 changed files with 1,200 additions and 277 deletions.
112 changes: 87 additions & 25 deletions _dev/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions _dev/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"dropzone": "^6.0.0-beta.2",
"pinia": "^2.1.7",
"postcss": "^8.4.35",
"quill-html-edit-button": "^3.0.0",
"sortablejs": "^1.15.2",
"tailwindcss": "^3.4.1",
"tiny-emitter": "^2.1.0",
Expand Down
12 changes: 10 additions & 2 deletions _dev/src/components/FieldRepeater.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ import Editor from '@tinymce/tinymce-vue'
// vue quill or tinymce
import { QuillEditor } from '@vueup/vue-quill'
import htmlEditButton from "quill-html-edit-button";
import '@vueup/vue-quill/dist/vue-quill.snow.css';
import '@vueup/vue-quill/dist/vue-quill.bubble.css';
Expand Down Expand Up @@ -53,6 +55,12 @@ defineComponent({
Choices,
MultiSelect
})
const VueQuillHTMLEditButton = {
name: 'htmlEditButton',
module: htmlEditButton,
}
const formatDateFromString = (date) => {
return new Date(date)
}
Expand All @@ -77,7 +85,7 @@ const removeTinyNotifications = () => {
}
let tinymce_api_key = ref(window.security_app.tinymce_api_key)
const toolbarOptions = [
['bold', 'italic', 'underline', 'strike',{ 'color': [] }, { 'background': [] }, 'link', 'video'], // toggled buttons
['bold','italic', 'underline', 'strike',{ 'color': [] }, { 'background': [] }, 'link', 'video'], // toggled buttons
[{ 'list': 'ordered'}, { 'list': 'bullet' }, { 'list': 'check' }],
[{ 'size': ['small', false, 'large', 'huge'] }], // custom dropdown
[{ 'header': [1, 2, 3, 4, 5, 6, false] }],
Expand Down Expand Up @@ -127,7 +135,7 @@ const toolbarOptions = [
<div v-else-if="f.type == 'editor' && (f.provider !== 'tinymce' || f.provider == 'vuequill')" class="clearfix">
<Title :title="f.label" />
<div class="bg-white">
<QuillEditor v-model:content="f.value" contentType="html" theme="snow" :toolbar="toolbarOptions" />
<QuillEditor :modules="VueQuillHTMLEditButton" v-model:content="f.value" contentType="html" theme="snow" :toolbar="toolbarOptions" />
</div>
</div>
<div class="my-4" v-if="f.type == 'select'">
Expand Down
66 changes: 55 additions & 11 deletions _dev/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
resolved "https://registry.npmjs.org/@babel/parser/-/parser-7.24.8.tgz"
integrity sha512-WzfbgXOkGzZiXXCqk43kKwZjzwx4oulxZi3nq2TYL9mOjQv6kYwul9mz6ID36njuL7Xkp6nJEfok848Zj10j/w==

"@esbuild/linux-x64@0.21.5":
"@esbuild/darwin-arm64@0.21.5":
version "0.21.5"
resolved "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.21.5.tgz"
integrity sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==
resolved "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.21.5.tgz"
integrity sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==

"@headlessui/vue@^1.7.19":
version "1.7.22"
Expand Down Expand Up @@ -107,15 +107,10 @@
resolved "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz"
integrity sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==

"@rollup/rollup-linux-x64-gnu@4.19.0":
"@rollup/rollup-darwin-arm64@4.19.0":
version "4.19.0"
resolved "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.19.0.tgz"
integrity sha512-HBndjQLP8OsdJNSxpNIN0einbDmRFg9+UQeZV1eiYupIRuZsDEoeGU43NQsS34Pp166DtwQOnpcbV/zQxM+rWA==

"@rollup/[email protected]":
version "4.19.0"
resolved "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.19.0.tgz"
integrity sha512-HxfbvfCKJe/RMYJJn0a12eiOI9OOtAUF4G6ozrFUK95BNyoJaSiBjIOHjZskTUffUrB84IPKkFG9H9nEvJGW6A==
resolved "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.19.0.tgz"
integrity sha512-emvKHL4B15x6nlNTBMtIaC9tLPRpeA5jMvRLXVbl/W9Ie7HhkrE7KQjvgS9uxgatL1HmHWDXk5TTS4IaNJxbAA==

"@swc/helpers@^0.2.13":
version "0.2.14"
Expand Down Expand Up @@ -627,11 +622,21 @@ eventemitter3@^2.0.3:
resolved "https://registry.npmjs.org/eventemitter3/-/eventemitter3-2.0.3.tgz"
integrity sha512-jLN68Dx5kyFHaePoXWPsCGW5qdyZQtLYHkxkg02/Mz6g0kYpDx4FyP6XfArhQdlOC4b8Mv+EMxPo/8La7Tzghg==

eventemitter3@^5.0.1:
version "5.0.1"
resolved "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz"
integrity sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==

extend@^3.0.2:
version "3.0.2"
resolved "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz"
integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==

fast-diff@^1.3.0:
version "1.3.0"
resolved "https://registry.npmjs.org/fast-diff/-/fast-diff-1.3.0.tgz"
integrity sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==

[email protected]:
version "1.1.2"
resolved "https://registry.npmjs.org/fast-diff/-/fast-diff-1.1.2.tgz"
Expand Down Expand Up @@ -693,6 +698,11 @@ fs.realpath@^1.0.0:
resolved "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz"
integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==

fsevents@~2.3.2, fsevents@~2.3.3:
version "2.3.3"
resolved "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz"
integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==

function-bind@^1.1.2:
version "1.1.2"
resolved "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz"
Expand Down Expand Up @@ -924,6 +934,11 @@ loader-utils@^1.0.2:
emojis-list "^3.0.0"
json5 "^1.0.1"

lodash-es@^4.17.21:
version "4.17.21"
resolved "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz"
integrity sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==

lodash.clonedeep@^4.5.0:
version "4.5.0"
resolved "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz"
Expand Down Expand Up @@ -1067,6 +1082,11 @@ parchment@^1.1.4:
resolved "https://registry.npmjs.org/parchment/-/parchment-1.1.4.tgz"
integrity sha512-J5FBQt/pM2inLzg4hEWmzQx/8h8D0CiDxaG3vyp9rKrQRSDgBlhjdP5jQGgosEajXPSQouXGHOmVdgo7QmJuOg==

parchment@^3.0.0:
version "3.0.0"
resolved "https://registry.npmjs.org/parchment/-/parchment-3.0.0.tgz"
integrity sha512-HUrJFQ/StvgmXRcQ1ftY6VEZUq3jA2t9ncFN4F84J/vN0/FPpQF+8FKXb3l6fLces6q0uOHj6NJn+2xvZnxO6A==

path-is-absolute@^1.0.0:
version "1.0.1"
resolved "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz"
Expand Down Expand Up @@ -1194,6 +1214,20 @@ quill-delta@^4.2.2:
lodash.clonedeep "^4.5.0"
lodash.isequal "^4.5.0"

quill-delta@^5.1.0:
version "5.1.0"
resolved "https://registry.npmjs.org/quill-delta/-/quill-delta-5.1.0.tgz"
integrity sha512-X74oCeRI4/p0ucjb5Ma8adTXd9Scumz367kkMK5V/IatcX6A0vlgLgKbzXWy5nZmCGeNJm2oQX0d2Eqj+ZIlCA==
dependencies:
fast-diff "^1.3.0"
lodash.clonedeep "^4.5.0"
lodash.isequal "^4.5.0"

quill-html-edit-button@^3.0.0:
version "3.0.0"
resolved "https://registry.npmjs.org/quill-html-edit-button/-/quill-html-edit-button-3.0.0.tgz"
integrity sha512-ZUV3rYjEvXz+v/7f8N0Mkp2+0D8VGDj6yCYPfagSLmyshczeMawS7vZJzaJ18dJp35IfjiPnzqyVk3KCI8qN1w==

quill@^1.3.7:
version "1.3.7"
resolved "https://registry.npmjs.org/quill/-/quill-1.3.7.tgz"
Expand All @@ -1206,6 +1240,16 @@ quill@^1.3.7:
parchment "^1.1.4"
quill-delta "^3.6.2"

quill@^2.x:
version "2.0.2"
resolved "https://registry.npmjs.org/quill/-/quill-2.0.2.tgz"
integrity sha512-QfazNrhMakEdRG57IoYFwffUIr04LWJxbS/ZkidRFXYCQt63c1gK6Z7IHUXMx/Vh25WgPBU42oBaNzQ0K1R/xw==
dependencies:
eventemitter3 "^5.0.1"
lodash-es "^4.17.21"
parchment "^3.0.0"
quill-delta "^5.1.0"

read-cache@^1.0.0:
version "1.0.0"
resolved "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz"
Expand Down
Loading

0 comments on commit e57c5be

Please sign in to comment.