Skip to content

Commit

Permalink
fix(editor): remove vuedraggable
Browse files Browse the repository at this point in the history
  • Loading branch information
Novout committed Jan 20, 2022
1 parent 1a00ac7 commit ecdf57e
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 45 deletions.
3 changes: 1 addition & 2 deletions packages/better-write-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@
"vue": "3.2.26",
"vue-i18n": "9.1.9",
"vue-router": "4.0.12",
"vue-toastification": "2.0.0-rc.5",
"vuedraggable": "4.1.0"
"vue-toastification": "2.0.0-rc.5"
},
"devDependencies": {
"@intlify/vite-plugin-vue-i18n": "3.2.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
<template>
<section
class="w-full relative px-4 md:px-14"
:class="
(style.entity.shadow ? 'shadow-winset p-0 m-0' : '',
press ? 'cursor-pointer shadow-winset' : 'cursor-text')
"
:class="style.entity.shadow ? 'shadow-winset p-0 m-0' : ''"
@mouseenter="hover = true"
@mouseleave="hover = false"
@click="onClickInEntity"
Expand All @@ -21,7 +18,7 @@
</section>
<div
ref="input"
:contenteditable="!press && editable"
:contenteditable="editable"
:spellcheck="true"
:data-placeholder="
entity.utils().isFixed(_index)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,30 +9,18 @@
:class="[project.isBlankProject() ? 'pt-28' : '']"
class="flex flex-col w-full min-h-editor overflow-y-auto overflow-x-hidden"
>
<Draggable
:list="CONTEXT.entities"
group="entities"
item-key="id"
@start="storage.normalize()"
@end="emitter.emit('entity-reset')"
>
<template #item="{ element, index }">
<EditorEntityDefaultInput
:id="`entity-${String(index)}`"
:key="index"
:entity="element"
/>
</template>
</Draggable>
<EditorEntityDefaultInput
v-for="(element, index) in CONTEXT.entities"
:id="`entity-${String(index)}`"
:key="index"
:entity="element"
/>
</section>
</template>

<script lang="ts" setup>
import { useProject } from '@/use/project'
import { useContextStore } from '@/store/context'
import { useStorage } from '@/use/storage/storage'
import useEmitter from '@/use/emitter'
import Draggable from 'vuedraggable'
import { ref, watch } from 'vue'
import { useScroll } from '@vueuse/core'
import { useAbsoluteStore } from '@/store/absolute'
Expand All @@ -41,8 +29,6 @@
const ABSOLUTE = useAbsoluteStore()
const project = useProject()
const storage = useStorage()
const emitter = useEmitter()
const editor = ref<HTMLElement | null>(null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,6 @@
:title="t('editor.preferences.shortcuts.editor.swap')"
shortcut="Shift + ↑ / ↓"
/>
<PreferencesKeyboardItem
:title="t('editor.preferences.shortcuts.editor.dragtitle')"
:shortcut="t('editor.preferences.shortcuts.editor.dragshort')"
>
Alt + Click
</PreferencesKeyboardItem>
</div>
<div
class="text-theme-text-2 text-base shadow-lg w-full lg:w-1/2 py-1 my-2"
Expand Down
12 changes: 0 additions & 12 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8398,11 +8398,6 @@ sort-keys@^4.0.0:
dependencies:
is-plain-obj "^2.0.0"

sortablejs@1.14.0:
version "1.14.0"
resolved "https://registry.yarnpkg.com/sortablejs/-/sortablejs-1.14.0.tgz#6d2e17ccbdb25f464734df621d4f35d4ab35b3d8"
integrity sha512-pBXvQCs5/33fdN1/39pPL0NZF20LeRbLQ5jtnheIPN9JQAaufGjKdWduZn4U7wCtVuzKhmRkI0DFYHYRbB2H1w==

source-map-js@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.1.tgz#a1741c131e3c77d048252adfa24e23b908670caf"
Expand Down Expand Up @@ -9709,13 +9704,6 @@ vue@3.2.26:
"@vue/server-renderer" "3.2.26"
"@vue/shared" "3.2.26"

vuedraggable@4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/vuedraggable/-/vuedraggable-4.1.0.tgz#edece68adb8a4d9e06accff9dfc9040e66852270"
integrity sha512-FU5HCWBmsf20GpP3eudURW3WdWTKIbEIQxh9/8GE806hydR9qZqRRxRE3RjqX7PkuLuMQG/A7n3cfj9rCEchww==
dependencies:
sortablejs "1.14.0"

wait-on@6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/wait-on/-/wait-on-6.0.0.tgz#7e9bf8e3d7fe2daecbb7a570ac8ca41e9311c7e7"
Expand Down

0 comments on commit ecdf57e

Please sign in to comment.