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

Upgraded and improved editor features #1744

Closed
wants to merge 8 commits into from
Closed
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
268 changes: 213 additions & 55 deletions dev/External/SquireUI.js

Large diffs are not rendered by default.

55 changes: 47 additions & 8 deletions dev/Styles/User/SquireUI.less
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@
.squire-toolbar {
border-bottom: 1px solid #b6b6b6;
min-height: 28px;
overflow-x: auto;
overflow-y: hidden;
padding: 2px;
overflow: hidden;
padding: 10px 5px;
position: relative;
white-space: nowrap;
display: flex;
flex-wrap: wrap;
align-content: center;
box-sizing: content-box;

}

.squire-toolbar input[type="color"] {
Expand All @@ -17,18 +21,31 @@
width: 40px;
}

.squire-toolbar input[type="color"][list="squire-colors"] {
top: 10px;
}

.squire-toolbar select {
font-size: 85%;
padding: 4px 1.5em 4px 6px;
text-align: var(--left, left);
text-align: left;
vertical-align: middle;
width: 7em;
width: fit-content;;
background-color: unset;
border: unset;
text-shadow: none;
box-shadow: none !important;
}
.squire-toolbar select[data-action="fontSize"] {
width: 5em;
}
.squire-toolbar button {
font-family: snappymail, var(--fontSans)
font-family: snappymail, var(--fontSans);
padding: 2px 10px 4px 10px !important;
background-color: unset;
border: unset;
text-shadow: none;
box-shadow: none !important;
}
.squire-toolbar button[data-action="bold"] {
font-weight: bold;
Expand All @@ -44,6 +61,25 @@
text-decoration: line-through;
}
*/
.squire-toolbar button:hover {
transform: scale(1.2);
}

.squire-toolbar button img {
width: 12px;
height: 12px;
}

.squire-toolbar button svg {
width: 18px;
height: 18px;
margin-top: 8px;
}

[dir="rtl"] .squire-toolbar.btn-toolbar div.btn-group {
display: flex;
flex-direction: row-reverse;
}

.squire-wysiwyg, .squire-plain {
height: 100%;
Expand All @@ -55,16 +91,19 @@

.squire-wysiwyg {
font-family: var(--fontSans);
line-height: 1.6;

ul {
padding-left: 40px;
padding-left: 20px;
padding-right: 20px;
li {
list-style-type: disc !important;
}
}

ol {
padding-left: 40px;
padding-left: 20px;
padding-right: 20px;
li {
list-style-type: decimal !important;
}
Expand Down
6 changes: 5 additions & 1 deletion snappymail/v/0.0.0/app/localization/en/user.json
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,11 @@
"IMAGEUPLOAD": "Image select",
"UNDO": "Undo",
"REDO": "Redo",
"REMOVESTYLE": "Remove style"
"REMOVESTYLE": "Remove style",
"LEFTALIGN": "Right",
"CENTERALIGN": "Center",
"RIGHTALIGN": "Left",
"JUSTIFYALIGN": "Justify"
},
"SETTINGS_LABELS": {
"GENERAL": "General",
Expand Down
10 changes: 7 additions & 3 deletions snappymail/v/0.0.0/app/localization/fa/user.json
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,11 @@
"IMAGEUPLOAD": "Image select",
"UNDO": "Undo",
"REDO": "Redo",
"REMOVESTYLE": "Remove style"
"REMOVESTYLE": "Remove style",
"LEFTALIGN": "Right",
"CENTERALIGN": "Center",
"RIGHTALIGN": "Left",
"JUSTIFYALIGN": "Justify"
},
"SETTINGS_LABELS": {
"GENERAL": "عمومی",
Expand Down Expand Up @@ -465,8 +469,8 @@
"LAYOUT_HORIZONTAL_SPLIT": "تقسیم افقی",
"SHOW_NEXT_MESSAGE": "Show next message when (re)move current message",
"EDITOR": "ویرایشگر پیش‌فرض",
"EDITOR_HTML": "تحت فرمت Html",
"EDITOR_PLAIN": "ساده",
"EDITOR_HTML": "فرمت HTML",
"EDITOR_PLAIN": "فرمت ساده",
"VIEW_OPTIONS": "مشاهده گزینه‌ها",
"USE_PREVIEW_PANE": "استفاده از پنجره پیش‌نمایش",
"HIDE_DELETED_MESSAGES": "پنهان کردن پیام های علامت گذاری شده برای حذف",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@
</div>
</div>

<div class="bodyText"></div>
<div class="bodyText" dir="auto"></div>
</div>
</div>
</div>
Expand Down
38 changes: 17 additions & 21 deletions snappymail/v/0.0.0/themes/NextcloudV25+/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -342,9 +342,9 @@

/* #region button */

#rl-app .btn,
#rl-app button,
#rl-app button.btn:not(.button-vue) {
#rl-app .btn:not(.squire-toolbar *),
#rl-app button:not(.squire-toolbar *),
#rl-app button.btn:not(.button-vue):not(.squire-toolbar *) {
min-height: 36px;
height: 36px;
box-sizing: border-box;
Expand Down Expand Up @@ -514,20 +514,20 @@
margin-left: 0.5px;
}

#rl-app .btn-group .btn:nth-child(n+2 of :not([style*="display: none;"])):nth-last-child(n+2 of :not([style*="display: none;"])) {
#rl-app .btn-group .btn:nth-child(n+2 of :not([style*="display: none;"])):nth-last-child(n+2 of :not([style*="display: none;"])):not(.squire-toolbar *) {
border-radius: 0 !important;
margin-right: 0.5px;
margin-left: 0.5px;
}

/* fallback */
#rl-app .btn-group .btn:not(:first-of-type):not(:last-of-type) {
#rl-app .btn-group .btn:not(:first-of-type):not(:last-of-type):not(.squire-toolbar *) {
border-radius: 0;
margin: 0 0.5px;
}

#rl-app .btn-group .btn:nth-child(1 of :not([style*="display: none;"])),
[dir="rtl"] #rl-app .btn-group .btn:nth-last-child(1 of :not([style*="display: none;"])) {
#rl-app .btn-group .btn:nth-child(1 of :not([style*="display: none;"])):not(.squire-toolbar *),
[dir="rtl"] #rl-app .btn-group .btn:nth-last-child(1 of :not([style*="display: none;"])):not(.squire-toolbar *) {
border-radius: 0 !important;
border-top-left-radius: var(--nc-border-radius-pill) !important;
border-bottom-left-radius: var(--nc-border-radius-pill) !important;
Expand All @@ -541,8 +541,8 @@
border-bottom-left-radius: var(--nc-border-radius-pill);
}

#rl-app .btn-group .btn:nth-last-child(1 of :not([style*="display: none;"])),
[dir="rtl"] #rl-app .btn-group .btn:nth-child(1 of :not([style*="display: none;"])) {
#rl-app .btn-group .btn:nth-last-child(1 of :not([style*="display: none;"])):not(.squire-toolbar *),
[dir="rtl"] #rl-app .btn-group .btn:nth-child(1 of :not([style*="display: none;"])):not(.squire-toolbar *) {
border-radius: 0 !important;
border-top-right-radius: var(--nc-border-radius-pill) !important;
border-bottom-right-radius: var(--nc-border-radius-pill) !important;
Expand All @@ -556,14 +556,14 @@
border-bottom-right-radius: var(--nc-border-radius-pill);
}

#rl-app .btn-group .btn:nth-child(1 of :not([style*="display: none;"])):nth-last-child(1 of :not([style*="display: none;"])),
[dir="rtl"] #rl-app .btn-group .btn:nth-child(1 of :not([style*="display: none;"])):nth-last-child(1 of :not([style*="display: none;"])) {
#rl-app .btn-group .btn:nth-child(1 of :not([style*="display: none;"])):nth-last-child(1 of :not([style*="display: none;"])):not(.squire-toolbar *),
[dir="rtl"] #rl-app .btn-group .btn:nth-child(1 of :not([style*="display: none;"])):nth-last-child(1 of :not([style*="display: none;"])):not(.squire-toolbar *) {
border-radius: var(--nc-border-radius-pill) !important;
}

/* fallback */
#rl-app .btn-group .btn:first-of-type:last-of-type,
[dir="rtl"] #rl-app .btn-group .btn:first-of-type:last-of-type {
#rl-app .btn-group .btn:first-of-type:last-of-type:not(.squire-toolbar *),
[dir="rtl"] #rl-app .btn-group .btn:first-of-type:last-of-type:not(.squire-toolbar *) {
border-radius: var(--nc-border-radius-pill) !important;
}

Expand Down Expand Up @@ -612,17 +612,15 @@

/* #region input & select */

#rl-app select,
#rl-app .select,
#rl-app .emailaddresses,
#rl-app input:not([type="checkbox"]) {
#rl-app select:not(.squire-toolbar *),
#rl-app .select:not(.squire-toolbar *),
#rl-app .emailaddresses:not(.squire-toolbar *),
#rl-app input:not([type="checkbox"]):not(.squire-toolbar *) {
padding: 0 12px;
font-size: var(--nc-default-font-size);
color: var(--nc-color-main-text);
background-color: unset;
height: 36px;
border: 2px solid var(--nc-color-border-maxcontrast);
border-radius: var(--nc-border-radius-large);
line-height: 32px;
outline: none;
}
Expand Down Expand Up @@ -842,8 +840,6 @@ input[type="checkbox"] {
/* #region textarea */

#rl-app .squire-toolbar {
height: 50px;
padding: 5px;
box-sizing: content-box;
border: none;
}
Expand Down
3 changes: 2 additions & 1 deletion tasks/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ config.paths.js = {
'vendors/bootstrap/js/bootstrap.native.js',
'vendors/knockout/build/output/knockout-latest.js',
// 'vendors/knockout/build/output/knockout-latest.debug.js',
'vendors/squire/build/squire-raw.js',
// 'vendors/dompurify/dist/purify.js',
'vendors/squire-rte/dist/squire-raw.js',
'vendors/mathiasbynens/punycode.js',
'dev/External/SquireUI.js'
]
Expand Down
Loading
Loading