Some apps, like Google Authenticator, do not back up and restore
diff --git a/app/assets/javascripts/preferences/panes/two-factor-auth/Bullet.tsx b/app/assets/javascripts/preferences/panes/two-factor-auth/Bullet.tsx
index 86402fb3d..311e80517 100644
--- a/app/assets/javascripts/preferences/panes/two-factor-auth/Bullet.tsx
+++ b/app/assets/javascripts/preferences/panes/two-factor-auth/Bullet.tsx
@@ -3,5 +3,5 @@ import { FunctionComponent } from 'preact';
export const Bullet: FunctionComponent<{ className?: string }> = ({
className = '',
}) => (
-
+
);
diff --git a/app/assets/javascripts/views/editor/editor-view.pug b/app/assets/javascripts/views/editor/editor-view.pug
index d0fe2249c..8c7724f55 100644
--- a/app/assets/javascripts/views/editor/editor-view.pug
+++ b/app/assets/javascripts/views/editor/editor-view.pug
@@ -59,42 +59,6 @@
.sn-component(ng-if='self.note')
#editor-menu-bar.sk-app-bar.no-edges
.left
- .sk-app-bar-item(
- click-outside=`self.setMenuState('showOptionsMenu', false)`,
- is-open='self.state.showOptionsMenu',
- ng-class="{'selected' : self.state.showOptionsMenu}",
- ng-click="self.toggleMenu('showOptionsMenu')"
- )
- .sk-label Options
- .sk-menu-panel.dropdown-menu(ng-if='self.state.showOptionsMenu')
- .sk-menu-panel-section
- .sk-menu-panel-header
- .sk-menu-panel-header-title Global Display
- menu-row(
- action="self.selectedMenuItem(true); self.toggleWebPrefKey(self.prefKeyMonospace)"
- circle="self.state.monospaceFont ? 'success' : 'neutral'",
- desc="'Toggles the font style for the default editor'",
- disabled='self.state.editorComponent',
- label="'Monospace Font'",
- subtitle="self.state.editorComponent ? 'Not available with editor extensions' : null"
- )
- menu-row(
- action="self.selectedMenuItem(true); self.toggleWebPrefKey(self.prefKeySpellcheck)"
- circle="self.state.spellcheck ? 'success' : 'neutral'",
- desc="'Toggles spellcheck for the default editor'",
- disabled='self.state.editorComponent',
- label="'Spellcheck'",
- subtitle=`
- self.state.editorComponent
- ? 'Not available with editor extensions'
- : (self.state.isDesktop ? 'May degrade editor performance' : null)
- `)
- menu-row(
- action="self.selectedMenuItem(true); self.toggleWebPrefKey(self.prefKeyMarginResizers)"
- circle="self.state.marginResizersEnabled ? 'success' : 'neutral'",
- desc="'Allows for editor left and right margins to be resized'",
- label="'Margin Resizers'"
- )
.sk-app-bar-item(
click-outside=`self.setMenuState('showEditorMenu', false)`
is-open='self.state.showEditorMenu',
diff --git a/app/assets/javascripts/views/editor/editor_view.ts b/app/assets/javascripts/views/editor/editor_view.ts
index 2c3e346af..9d6c282d8 100644
--- a/app/assets/javascripts/views/editor/editor_view.ts
+++ b/app/assets/javascripts/views/editor/editor_view.ts
@@ -1,6 +1,4 @@
-import {
- STRING_SAVING_WHILE_DOCUMENT_HIDDEN,
-} from './../../strings';
+import { STRING_SAVING_WHILE_DOCUMENT_HIDDEN } from './../../strings';
import { Editor } from '@/ui_models/editor';
import { WebApplication } from '@/ui_models/application';
import { PanelPuppet, WebDirective } from '@/types';
@@ -61,7 +59,6 @@ type EditorState = {
isDesktop?: boolean;
syncTakingTooLong: boolean;
showActionsMenu: boolean;
- showOptionsMenu: boolean;
showEditorMenu: boolean;
showHistoryMenu: boolean;
spellcheck: boolean;
@@ -202,7 +199,7 @@ class EditorViewCtrl extends PureViewCtrl
{
});
this.autorun(() => {
this.setState({
- showProtectedWarning: this.appState.notes.showProtectedWarning
+ showProtectedWarning: this.appState.notes.showProtectedWarning,
});
});
}
@@ -216,7 +213,6 @@ class EditorViewCtrl extends PureViewCtrl {
spellcheck: true,
syncTakingTooLong: false,
showActionsMenu: false,
- showOptionsMenu: false,
showEditorMenu: false,
showHistoryMenu: false,
noteStatus: undefined,
@@ -272,11 +268,11 @@ class EditorViewCtrl extends PureViewCtrl {
async handleEditorNoteChange() {
this.cancelPendingSetStatus();
const note = this.editor.note;
- const showProtectedWarning = note.protected && !this.application.hasProtectionSources();
+ const showProtectedWarning =
+ note.protected && !this.application.hasProtectionSources();
this.setShowProtectedWarning(showProtectedWarning);
await this.setState({
showActionsMenu: false,
- showOptionsMenu: false,
showEditorMenu: false,
showHistoryMenu: false,
noteStatus: undefined,
@@ -364,12 +360,7 @@ class EditorViewCtrl extends PureViewCtrl {
}
closeAllMenus(exclude?: string) {
- const allMenus = [
- 'showOptionsMenu',
- 'showEditorMenu',
- 'showActionsMenu',
- 'showHistoryMenu',
- ];
+ const allMenus = ['showEditorMenu', 'showActionsMenu', 'showHistoryMenu'];
const menuState: any = {};
for (const candidate of allMenus) {
if (candidate !== exclude) {
@@ -591,7 +582,7 @@ class EditorViewCtrl extends PureViewCtrl {
}
clickedTextArea() {
- this.setMenuState('showOptionsMenu', false);
+ this.closeAllMenus();
}
// eslint-disable-next-line @typescript-eslint/no-empty-function
@@ -607,12 +598,6 @@ class EditorViewCtrl extends PureViewCtrl {
this.lastEditorFocusEventSource = undefined;
}
- selectedMenuItem(hide: boolean) {
- if (hide) {
- this.setMenuState('showOptionsMenu', false);
- }
- }
-
setShowProtectedWarning(show: boolean) {
this.appState.notes.setShowProtectedWarning(show);
}
@@ -757,13 +742,10 @@ class EditorViewCtrl extends PureViewCtrl {
/** @components */
registerComponentHandler() {
- this.unregisterComponent = this.application.componentManager!.registerHandler(
- {
+ this.unregisterComponent =
+ this.application.componentManager!.registerHandler({
identifier: 'editor',
- areas: [
- ComponentArea.EditorStack,
- ComponentArea.Editor,
- ],
+ areas: [ComponentArea.EditorStack, ComponentArea.Editor],
contextRequestHandler: (componentUuid) => {
const currentEditor = this.state.editorComponent;
if (
@@ -778,8 +760,7 @@ class EditorViewCtrl extends PureViewCtrl {
this.closeAllMenus();
}
},
- }
- );
+ });
}
async reloadStackComponents() {
@@ -809,9 +790,8 @@ class EditorViewCtrl extends PureViewCtrl {
}
async toggleStackComponentForCurrentItem(component: SNComponent) {
- const hidden = this.application.componentManager!.isComponentHidden(
- component
- );
+ const hidden =
+ this.application.componentManager!.isComponentHidden(component);
if (hidden || !component.active) {
this.application.componentManager!.setComponentHidden(component, false);
await this.associateComponentWithCurrentNote(component);
@@ -844,16 +824,14 @@ class EditorViewCtrl extends PureViewCtrl {
}
registerKeyboardShortcuts() {
- this.removeTrashKeyObserver = this.application
- .io
- .addKeyObserver({
- key: KeyboardKey.Backspace,
- notTags: ['INPUT', 'TEXTAREA'],
- modifiers: [KeyboardModifier.Meta],
- onKeyDown: () => {
- this.deleteNote(false);
- },
- });
+ this.removeTrashKeyObserver = this.application.io.addKeyObserver({
+ key: KeyboardKey.Backspace,
+ notTags: ['INPUT', 'TEXTAREA'],
+ modifiers: [KeyboardModifier.Meta],
+ onKeyDown: () => {
+ this.deleteNote(false);
+ },
+ });
}
setScrollPosition() {
@@ -883,39 +861,37 @@ class EditorViewCtrl extends PureViewCtrl {
const editor = document.getElementById(
ElementIds.NoteTextEditor
)! as HTMLInputElement;
- this.removeTabObserver = this.application
- .io
- .addKeyObserver({
- element: editor,
- key: KeyboardKey.Tab,
- onKeyDown: (event) => {
- if (document.hidden || this.note.locked || event.shiftKey) {
- return;
- }
- event.preventDefault();
- /** Using document.execCommand gives us undo support */
- const insertSuccessful = document.execCommand(
- 'insertText',
- false,
- '\t'
- );
- if (!insertSuccessful) {
- /** document.execCommand works great on Chrome/Safari but not Firefox */
- const start = editor.selectionStart!;
- const end = editor.selectionEnd!;
- const spaces = ' ';
- /** Insert 4 spaces */
- editor.value =
- editor.value.substring(0, start) +
- spaces +
- editor.value.substring(end);
- /** Place cursor 4 spaces away from where the tab key was pressed */
- editor.selectionStart = editor.selectionEnd = start + 4;
- }
- this.editorValues.text = editor.value;
- this.save(this.note, copyEditorValues(this.editorValues), true);
- },
- });
+ this.removeTabObserver = this.application.io.addKeyObserver({
+ element: editor,
+ key: KeyboardKey.Tab,
+ onKeyDown: (event) => {
+ if (document.hidden || this.note.locked || event.shiftKey) {
+ return;
+ }
+ event.preventDefault();
+ /** Using document.execCommand gives us undo support */
+ const insertSuccessful = document.execCommand(
+ 'insertText',
+ false,
+ '\t'
+ );
+ if (!insertSuccessful) {
+ /** document.execCommand works great on Chrome/Safari but not Firefox */
+ const start = editor.selectionStart!;
+ const end = editor.selectionEnd!;
+ const spaces = ' ';
+ /** Insert 4 spaces */
+ editor.value =
+ editor.value.substring(0, start) +
+ spaces +
+ editor.value.substring(end);
+ /** Place cursor 4 spaces away from where the tab key was pressed */
+ editor.selectionStart = editor.selectionEnd = start + 4;
+ }
+ this.editorValues.text = editor.value;
+ this.save(this.note, copyEditorValues(this.editorValues), true);
+ },
+ });
editor.addEventListener('scroll', this.setScrollPosition);
editor.addEventListener('input', this.resetScrollPosition);
diff --git a/app/assets/javascripts/views/footer/footer-view.pug b/app/assets/javascripts/views/footer/footer-view.pug
index 6970a442d..a8d7183bf 100644
--- a/app/assets/javascripts/views/footer/footer-view.pug
+++ b/app/assets/javascripts/views/footer/footer-view.pug
@@ -1,28 +1,37 @@
.sn-component
#footer-bar.sk-app-bar.no-edges.no-bottom-edge
.left
- .sk-app-bar-item(
+ .sk-app-bar-item.ml-0(
click-outside='ctrl.clickOutsideAccountMenu()',
is-open='ctrl.showAccountMenu',
ng-click='ctrl.accountMenuPressed()'
- )
- .sk-app-bar-item-column
- .sk-circle.small(
- ng-class="ctrl.hasError ? 'danger' : (ctrl.user ? 'info' : 'neutral')"
+ )
+ .w-8.h-full.flex.items-center.justify-center.cursor-pointer.rounded-full(
+ ng-class="ctrl.showAccountMenu ? 'bg-border' : '' "
+ )
+ .w-5.h-5(
+ ng-class="ctrl.hasError ? 'danger' : (ctrl.user ? 'info' : 'neutral')"
)
- .sk-app-bar-item-column
- .sk-label.title(ng-class='{red: ctrl.hasError}') Account
+ icon(
+ type="account-circle"
+ class-name="hover:color-info w-5 h-5 max-h-5"
+ )
account-menu(
ng-click='$event.stopPropagation()',
app-state='ctrl.appState'
application='ctrl.application'
ng-if='ctrl.showAccountMenu',
)
- .sk-app-bar-item(
+ .sk-app-bar-item.ml-0-important(
ng-click='ctrl.clickPreferences()'
ng-if='ctrl.appState.enableUnfinishedFeatures'
)
- .sk-label.title Preferences
+ .w-8.h-full.flex.items-center.justify-center.cursor-pointer
+ .h-5
+ icon(
+ type="tune"
+ class-name="rounded hover:color-info"
+ )
.sk-app-bar-item
a.no-decoration.sk-label.title(
href='https://standardnotes.com/help',
diff --git a/app/assets/stylesheets/_footer.scss b/app/assets/stylesheets/_footer.scss
index eb2d65cb5..5b813b3e9 100644
--- a/app/assets/stylesheets/_footer.scss
+++ b/app/assets/stylesheets/_footer.scss
@@ -34,17 +34,6 @@
border-bottom: 2px solid var(--sn-stylekit-info-color);
}
}
-
- svg {
- width: 12px;
- height: 12px;
- fill: var(--sn-stylekit-secondary-foreground-color);
-
- &:hover {
- fill: var(--sn-stylekit-info-color) !important;
- color: var(--sn-stylekit-info-color) !important;
- }
- }
}
#account-switcher-icon {
diff --git a/app/assets/stylesheets/_main.scss b/app/assets/stylesheets/_main.scss
index f57cc05db..b54211c3a 100644
--- a/app/assets/stylesheets/_main.scss
+++ b/app/assets/stylesheets/_main.scss
@@ -115,7 +115,7 @@ p {
background-color: var(--sn-stylekit-background-color);
}
-$footer-height: 32px;
+$footer-height: 2rem;
#resizer-overlay {
position: absolute;
diff --git a/app/assets/stylesheets/_sn.scss b/app/assets/stylesheets/_sn.scss
index c066f10b6..6ecdf4abe 100644
--- a/app/assets/stylesheets/_sn.scss
+++ b/app/assets/stylesheets/_sn.scss
@@ -154,6 +154,13 @@
@extend .font-bold;
}
+.ml-0-important {
+ margin-left: 0rem !important;
+}
+
+.ml-3 {
+ margin-left: 0.75rem;
+}
.ml-4 {
margin-left: 1rem;
}
@@ -222,10 +229,22 @@
min-height: 1.5rem;
}
+.max-h-5 {
+ max-height: 1.25rem;
+}
+
.border-danger {
border-color: var(--sn-stylekit-danger-color);
}
+.bg-inverted-default {
+ background-color: var(--sn-stylekit-contrast-foreground-color);
+}
+
+.color-inverted-default {
+ color: var(--sn-stylekit-background-color);
+}
+
.pt-1 {
padding-top: 0.25rem;
}
@@ -256,3 +275,7 @@
padding-top: 2.25rem;
padding-bottom: 2.25rem;
}
+
+.select-none {
+ user-select: none;
+}
\ No newline at end of file
diff --git a/package.json b/package.json
index ab5ad7515..442f0aae2 100644
--- a/package.json
+++ b/package.json
@@ -72,7 +72,7 @@
"@reach/dialog": "^0.13.0",
"@standardnotes/sncrypto-web": "1.5.2",
"@standardnotes/features": "1.6.1",
- "@standardnotes/snjs": "2.14.6",
+ "@standardnotes/snjs": "2.14.8",
"mobx": "^6.3.2",
"mobx-react-lite": "^3.2.0",
"preact": "^10.5.12",