File tree Expand file tree Collapse file tree 9 files changed +60
-9
lines changed Expand file tree Collapse file tree 9 files changed +60
-9
lines changed Original file line number Diff line number Diff line change 2
2
3
3
A editor for creative writers.
4
4
5
- ## Tasks for v0.1.0
5
+ ## Tasks
6
6
7
7
- [X] Initial Page Entry-Text
8
8
- [X] Simple Parser Style-Raw
9
9
- [X] Final Text Defines
10
10
- [ ] Grammar Corrections
11
11
- [X] Project Control Pages
12
- - [ ] Aside Graph-Tree
13
- - [ ] PDF Generator + Customization
12
+ - [X] Aside Graph-Tree
13
+
14
+ ### PDF
15
+
16
+ - [ ] Generator
17
+ - [ ] Page Types
18
+ - [ ] Customization
14
19
15
20
## Setup
16
21
Original file line number Diff line number Diff line change 211
211
</HeroIcon >
212
212
</template >
213
213
<AsideProjectNew />
214
- <AsidePageNew />
214
+ <AsidePageNew v-if = " store.state.project.name !== '__NOT_CREATED__' " />
215
215
</AsideBarItem >
216
216
</template >
217
217
Original file line number Diff line number Diff line change 12
12
rgba (0, 0, 0, 0.05) 0px 1px 1px 0px ;
13
13
"
14
14
>
15
+ <div class =" flex w-full justify-end items-center" >
16
+ <HeroIcon
17
+ class =" relative wb-icon inline-flex"
18
+ @click.prevent =" onDeletePage"
19
+ >
20
+ <svg
21
+ xmlns =" http://www.w3.org/2000/svg"
22
+ class =" h-4 w-4"
23
+ viewBox =" 0 0 20 20"
24
+ fill =" currentColor"
25
+ >
26
+ <path d =" M4 3a2 2 0 100 4h12a2 2 0 100-4H4z" />
27
+ <path
28
+ fill-rule =" evenodd"
29
+ d =" M3 8h14v7a2 2 0 01-2 2H5a2 2 0 01-2-2V8zm5 3a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1z"
30
+ clip-rule =" evenodd"
31
+ />
32
+ </svg >
33
+ </HeroIcon >
34
+ </div >
15
35
<EditorBaseBlocked
16
36
v-if =" store.state.project.name === '__NOT_CREATED__'"
17
37
/>
61
81
62
82
entry .value = ' '
63
83
}
84
+
85
+ const onDeletePage = async () => {
86
+ if (store .state .project .pages .length <= 1 ) return
87
+
88
+ store .commit (' project/deletePage' , store .state .context )
89
+ await nextTick
90
+
91
+ store .commit (' context/load' , store .state .project .pages [0 ])
92
+ }
64
93
</script >
65
94
66
95
<style scoped>
Original file line number Diff line number Diff line change 11
11
:position =" props.entity.id"
12
12
/>
13
13
<div class =" w-full" @click.prevent =" onEdit" >
14
- <p
14
+ <div
15
15
v-if =" !edit"
16
16
ref =" show"
17
17
class =" overflow-hidden w-full"
Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ export default {
35
35
confirm : 'Criar' ,
36
36
content : {
37
37
name : 'Um Novo Projeto Incrível' ,
38
+ nameNew : 'Sem Título' ,
38
39
version : '0.1.0' ,
39
40
} ,
40
41
} ,
Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ export default {
35
35
confirm : 'Create' ,
36
36
content : {
37
37
name : 'Nice New Project' ,
38
+ nameNew : 'Untitled' ,
38
39
version : '0.1.0' ,
39
40
} ,
40
41
} ,
Original file line number Diff line number Diff line change @@ -43,7 +43,6 @@ export default {
43
43
44
44
const index = state . entity . indexOf ( content )
45
45
46
- state . totalEntityCreated --
47
46
state . entity . splice ( index , 1 )
48
47
} ,
49
48
switchInPage ( state : any , obj : Record < any , any > ) {
Original file line number Diff line number Diff line change 1
1
import { ProjectState } from '@/types/project'
2
2
import { useText } from '@/use/text'
3
3
import { useFormat } from '@/use/format'
4
- import { ContextState } from '@/types/context'
4
+ import { ContextState , ContextStatePageContent } from '@/types/context'
5
+ import { useI18n } from 'vue-i18n'
5
6
6
7
export default {
7
8
namespaced : true ,
@@ -66,13 +67,13 @@ export default {
66
67
67
68
const init : ContextState = {
68
69
id : state . totalPagesCreated ,
69
- totalEntityCreated : 0 ,
70
+ totalEntityCreated : 2 ,
70
71
onlyHeadingOne : false ,
71
72
entity : [
72
73
{
73
74
id : 0 ,
74
75
type : 'heading-one' ,
75
- raw : state . nameRaw ,
76
+ raw : 'Untitled' ,
76
77
createdAt : useFormat ( ) . actually ( ) ,
77
78
updatedAt : useFormat ( ) . actually ( ) ,
78
79
} ,
@@ -89,6 +90,17 @@ export default {
89
90
state . pageLoaded = init . id
90
91
state . pages . push ( init )
91
92
} ,
93
+ deletePage ( state : any , context : ContextState ) {
94
+ const content = state . pages . find (
95
+ ( content : ContextStatePageContent ) => content . id === context . id
96
+ )
97
+
98
+ if ( ! content ) return
99
+
100
+ const index = state . pages . indexOf ( content )
101
+
102
+ state . pages . splice ( index , 1 )
103
+ } ,
92
104
} ,
93
105
actions : { } ,
94
106
getters : { } ,
Original file line number Diff line number Diff line change 21
21
@apply text-black dark:text-gray-200;
22
22
}
23
23
24
+ .wb-icon {
25
+ @apply text-black dark:text-gray-200 hover:text-gray-700 dark:hover:text-white;
26
+ }
27
+
24
28
.wb-background-color {
25
29
@apply bg-gray-100 dark:bg-gray-700;
26
30
}
You can’t perform that action at this time.
0 commit comments