Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add bidi support #1191

Merged
merged 2 commits into from
Dec 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions css/notes.css
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,28 @@ li:focus .app-navigation-entry__utils .action-item {

/* Welcome / Help */
.feature {
background-position: left center;
background-position-y: center;
width: 100%;
min-height: 32px;
line-height: 32px;
padding-left: 32px;
padding-inline-start: 32px;
margin-top: 0.3em !important;
margin-bottom: 0.3em !important;
display: inline-block;
vertical-align: middle;
}

body[dir='ltr'] .feature {
background-position-x: left;
}

body[dir='rtl'] .feature {
background-position-x: right;
}

.feature ul {
list-style: circle outside;
padding-left: 2em;
padding-inline-start: 2em;
}


Expand All @@ -66,6 +74,6 @@ li:focus .app-navigation-entry__utils .action-item {
}

.app-content {
margin-left: 0 !important;
margin-inline-start: 0 !important;
}
}
11 changes: 11 additions & 0 deletions package-lock.json

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

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"diff": "^5.1.0",
"easymde": "^2.18.0",
"markdown-it": "^13.0.2",
"markdown-it-bidi": "^0.1.0",
"markdown-it-task-checkbox": "^1.0.6",
"vue": "^2.7.16",
"vue-fragment": "^1.6.0",
Expand All @@ -46,4 +47,4 @@
"extends @nextcloud/browserslist-config"
],
"version": "4.9.1"
}
}
4 changes: 2 additions & 2 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -317,9 +317,9 @@ export default {
padding-top: 0 !important;
// Prevent shrinking or growing
flex: 0 0 auto;
padding-right: 3px;
padding-inline-end: 3px;
padding-bottom: 3px;
padding-left: 3px;
padding-inline-start: 3px;
margin: 0 3px;
}
</style>
6 changes: 3 additions & 3 deletions src/components/EditorEasyMDE.vue
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ export default {
border-radius: var(--border-radius);
background-position: center;
margin-top: 5px;
margin-left: 2px;
margin-inline-start: 2px;
}

.CodeMirror .cm-formatting-task.cm-property::before {
Expand All @@ -370,10 +370,10 @@ export default {

.upload-button {
position: fixed;
right: 64px;
inset-inline-end: 64px;
z-index: 10;
height: 40px;
margin-right: 5px;
margin-inline-end: 5px;
top: 65px;
}
</style>
14 changes: 8 additions & 6 deletions src/components/EditorMarkdownIt.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ export default {
liClass: 'task-list-item',
})

md.use(require('markdown-it-bidi'))

return {
html: '',
md,
Expand Down Expand Up @@ -196,7 +198,7 @@ export default {
}

& ul, & ol {
margin-left: 3ex;
margin-inline-start: 3ex;
}

& li > p, & li > ul, & li > ol {
Expand All @@ -220,8 +222,8 @@ export default {

& blockquote {
font-style: italic;
border-left: 4px solid var(--color-border);
padding-left: 2ex;
border-inline-start: 4px solid var(--color-border);
padding-inline-start: 2ex;
color: var(--color-text-light)
}

Expand Down Expand Up @@ -263,8 +265,8 @@ export default {
.download-icon-inner {
height: 3em;
width: auto;
margin-left: auto;
margin-right: auto;
margin-inline-start: auto;
margin-inline-end: auto;
margin-bottom: 5px;
}

Expand All @@ -281,7 +283,7 @@ export default {

& table td, & table th {
padding: 0.35em 0.5em;
text-align: left;
text-align: start;
border: 1px solid var(--color-border);
}

Expand Down
8 changes: 6 additions & 2 deletions src/components/HelpMobile.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,19 @@ export default {
<style scoped>
.badge-wrapper {
margin-top: 2em;
margin-left: 2em;
margin-inline-start: 2em;
width: 100%;
clear:both;
}

.badge {
body[dir='ltr'] .badge {
float: left;
}

body[dir='rtl'] .badge {
float: right;
}

.appstore-badge {
height: 72px;
box-sizing: border-box;
Expand Down
2 changes: 1 addition & 1 deletion src/components/Modal/EditorHint.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export default {
margin-top: 24px;

button {
margin-left: 12px;
margin-inline-start: 12px;
}
}
</style>
6 changes: 3 additions & 3 deletions src/components/NotePlain.vue
Original file line number Diff line number Diff line change
Expand Up @@ -438,9 +438,9 @@ export default {
margin: 0 auto;
}
.note-container {
padding-right: 250px;
padding-inline-end: 250px;
transition-duration: var(--animation-quick);
transition-property: padding-right;
transition-property: padding-inline-end;
}
}

Expand All @@ -467,7 +467,7 @@ export default {
.action-buttons {
position: fixed;
top: 50px;
right: 20px;
inset-inline-end: 20px;
width: 44px;
margin-top: 1em;
z-index: 2000;
Expand Down
2 changes: 1 addition & 1 deletion src/components/NoteRich.vue
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ export default {

.is-mobile:deep(.text-menubar) {
// Avoid overlapping the navigation toggle
margin-left: 44px;
margin-inline-start: 44px;
z-index: 1;
}
</style>
4 changes: 2 additions & 2 deletions src/components/NotesView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ export default {

.content-list__search {
padding: 4px;
padding-left: 50px;
padding-inline-start: 50px;
position: sticky;
top: 0;
background-color: var(--color-main-background-translucent);
Expand Down Expand Up @@ -268,6 +268,6 @@ export default {
border: 2px solid var(--color-loading-light);
border-top-color: var(--color-loading-dark);
vertical-align: top;
margin-right: 5px;
margin-inline-end: 5px;
}
</style>
Loading