diff --git a/.eslintignore b/.eslintignore index 6cb140a6..99076049 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,3 +1,3 @@ build/*.js config/*.js -src/cledit/*.js \ No newline at end of file +src/libs/*.js diff --git a/package.json b/package.json index 36e27453..95fcf712 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,6 @@ "dependencies": { "bezier-easing": "^1.1.0", "clunderscore": "^1.0.3", - "debug": "^2.6.8", "diff-match-patch": "^1.0.0", "indexeddbshim": "^3.0.4", "katex": "^0.7.1", diff --git a/src/components/App.vue b/src/components/App.vue index 46766757..56b9d064 100644 --- a/src/components/App.vue +++ b/src/components/App.vue @@ -21,7 +21,7 @@ export default { 'ready', ]), loading() { - return !this.$store.getters['contents/current'].id; + return !this.$store.getters['content/current'].id; }, showModal() { return !!this.$store.state.modal.content; diff --git a/src/components/Explorer.vue b/src/components/Explorer.vue index c6f38501..197d3a97 100644 --- a/src/components/Explorer.vue +++ b/src/components/Explorer.vue @@ -70,13 +70,13 @@ export default { const recursiveDelete = (folderNode) => { folderNode.folders.forEach(recursiveDelete); folderNode.files.forEach((fileNode) => { - this.$store.commit('files/deleteItem', fileNode.item.id); + this.$store.commit('file/deleteItem', fileNode.item.id); }); - this.$store.commit('folders/deleteItem', folderNode.item.id); + this.$store.commit('folder/deleteItem', folderNode.item.id); }; recursiveDelete(selectedNode); } else { - this.$store.commit('files/deleteItem', selectedNode.item.id); + this.$store.commit('file/deleteItem', selectedNode.item.id); } } }); @@ -85,7 +85,7 @@ export default { }, created() { this.$store.watch( - () => this.$store.getters['files/current'].id, + () => this.$store.getters['file/current'].id, (currentFileId) => { this.$store.commit('explorer/setSelectedId', currentFileId); this.$store.dispatch('explorer/openNode', currentFileId); diff --git a/src/components/ExplorerNode.vue b/src/components/ExplorerNode.vue index f5cd6179..42a8d675 100644 --- a/src/components/ExplorerNode.vue +++ b/src/components/ExplorerNode.vue @@ -91,7 +91,7 @@ export default { if (node.isFolder) { this.$store.commit('explorer/toggleOpenNode', id); } else { - this.$store.commit('files/setCurrentId', id); + this.$store.commit('file/setCurrentId', id); } } }, @@ -100,20 +100,18 @@ export default { if (!cancel && !newChildNode.isNil && newChildNode.item.name) { const id = utils.uid(); if (newChildNode.isFolder) { - this.$store.commit('folders/setItem', { + this.$store.commit('folder/setItem', { ...newChildNode.item, id, }); } else { - const contentId = utils.uid(); - this.$store.commit('contents/setItem', { - id: contentId, + this.$store.commit('content/setItem', { + id: `${id}/content`, text: defaultContent, }); - this.$store.commit('files/setItem', { + this.$store.commit('file/setItem', { ...newChildNode.item, id, - contentId, }); } this.select(id); @@ -124,7 +122,7 @@ export default { const id = this.$store.getters['explorer/editingNode'].item.id; const value = this.editingValue; if (!cancel && id && value) { - this.$store.commit('files/patchItem', { + this.$store.commit('file/patchItem', { id, name: value.slice(0, 250), }); @@ -152,9 +150,9 @@ export default { parentId: targetNode.item.id, }; if (sourceNode.isFolder) { - this.$store.commit('folders/patchItem', patch); + this.$store.commit('folder/patchItem', patch); } else { - this.$store.commit('files/patchItem', patch); + this.$store.commit('file/patchItem', patch); } } }, diff --git a/src/components/Layout.vue b/src/components/Layout.vue index ccf1d75f..04e66412 100644 --- a/src/components/Layout.vue +++ b/src/components/Layout.vue @@ -127,6 +127,7 @@ export default { .layout__panel--button-bar, .layout__panel--status-bar, .layout__panel--side-bar, +.layout__panel--explorer, .layout__panel--navigation-bar { .app--loading & > * { opacity: 0.5; diff --git a/src/components/NavigationBar.vue b/src/components/NavigationBar.vue index 6821f6c1..0d188b4c 100644 --- a/src/components/NavigationBar.vue +++ b/src/components/NavigationBar.vue @@ -122,9 +122,9 @@ export default { } else { const title = this.title.trim(); if (title) { - this.$store.dispatch('files/patchCurrent', { name: title.slice(0, 250) }); + this.$store.dispatch('file/patchCurrent', { name: title.slice(0, 250) }); } else { - this.title = this.$store.getters['files/current'].name; + this.title = this.$store.getters['file/current'].name; } } }, @@ -137,7 +137,7 @@ export default { }, created() { this.$store.watch( - () => this.$store.getters['files/current'].name, + () => this.$store.getters['file/current'].name, (name) => { this.title = name; }, { immediate: true }); diff --git a/src/components/SideBar.vue b/src/components/SideBar.vue index 7f4c1e0e..7bf326bd 100644 --- a/src/components/SideBar.vue +++ b/src/components/SideBar.vue @@ -15,7 +15,7 @@