Merge remote-tracking branch 'upstream/develop' into account-menu-splitted
# Conflicts: # app/assets/javascripts/directives/views/accountMenu.ts
This commit is contained in:
@@ -19,6 +19,7 @@ export const AutocompleteTagHint = observer(
|
|||||||
|
|
||||||
const onTagHintClick = async () => {
|
const onTagHintClick = async () => {
|
||||||
await appState.noteTags.createAndAddNewTag();
|
await appState.noteTags.createAndAddNewTag();
|
||||||
|
appState.noteTags.setAutocompleteInputFocused(true);
|
||||||
};
|
};
|
||||||
|
|
||||||
const onFocus = () => {
|
const onFocus = () => {
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import { AppState } from '@/ui_models/app_state';
|
|||||||
import { AutocompleteTagResult } from './AutocompleteTagResult';
|
import { AutocompleteTagResult } from './AutocompleteTagResult';
|
||||||
import { AutocompleteTagHint } from './AutocompleteTagHint';
|
import { AutocompleteTagHint } from './AutocompleteTagHint';
|
||||||
import { observer } from 'mobx-react-lite';
|
import { observer } from 'mobx-react-lite';
|
||||||
|
import { SNTag } from '@standardnotes/snjs';
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
appState: AppState;
|
appState: AppState;
|
||||||
@@ -41,8 +42,13 @@ export const AutocompleteTagInput = observer(({ appState }: Props) => {
|
|||||||
|
|
||||||
const onSearchQueryChange = (event: Event) => {
|
const onSearchQueryChange = (event: Event) => {
|
||||||
const query = (event.target as HTMLInputElement).value;
|
const query = (event.target as HTMLInputElement).value;
|
||||||
appState.noteTags.setAutocompleteSearchQuery(query);
|
|
||||||
appState.noteTags.searchActiveNoteAutocompleteTags();
|
if (query === '') {
|
||||||
|
appState.noteTags.clearAutocompleteSearch();
|
||||||
|
} else {
|
||||||
|
appState.noteTags.setAutocompleteSearchQuery(query);
|
||||||
|
appState.noteTags.searchActiveNoteAutocompleteTags();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const onFormSubmit = async (event: Event) => {
|
const onFormSubmit = async (event: Event) => {
|
||||||
@@ -83,10 +89,6 @@ export const AutocompleteTagInput = observer(({ appState }: Props) => {
|
|||||||
appState.noteTags.setAutocompleteInputFocused(false);
|
appState.noteTags.setAutocompleteInputFocused(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
appState.noteTags.searchActiveNoteAutocompleteTags();
|
|
||||||
}, [appState.noteTags]);
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (autocompleteInputFocused) {
|
if (autocompleteInputFocused) {
|
||||||
inputRef.current.focus();
|
inputRef.current.focus();
|
||||||
@@ -120,7 +122,7 @@ export const AutocompleteTagInput = observer(({ appState }: Props) => {
|
|||||||
onBlur={closeOnBlur}
|
onBlur={closeOnBlur}
|
||||||
>
|
>
|
||||||
<div className="overflow-y-auto">
|
<div className="overflow-y-auto">
|
||||||
{autocompleteTagResults.map((tagResult) => (
|
{autocompleteTagResults.map((tagResult: SNTag) => (
|
||||||
<AutocompleteTagResult
|
<AutocompleteTagResult
|
||||||
key={tagResult.uuid}
|
key={tagResult.uuid}
|
||||||
appState={appState}
|
appState={appState}
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { ApplicationService } from '@standardnotes/snjs';
|
import { ApplicationService } from '@standardnotes/snjs';
|
||||||
import { isDesktopApplication } from '@/utils';
|
|
||||||
|
|
||||||
const MILLISECONDS_PER_SECOND = 1000;
|
const MILLISECONDS_PER_SECOND = 1000;
|
||||||
const POLL_INTERVAL = 50;
|
const POLL_INTERVAL = 50;
|
||||||
@@ -18,9 +17,7 @@ export class AutolockService extends ApplicationService {
|
|||||||
private lockAfterDate?: Date
|
private lockAfterDate?: Date
|
||||||
|
|
||||||
onAppLaunch() {
|
onAppLaunch() {
|
||||||
if (!isDesktopApplication()) {
|
this.beginPolling();
|
||||||
this.beginPolling();
|
|
||||||
}
|
|
||||||
return super.onAppLaunch();
|
return super.onAppLaunch();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -33,10 +33,6 @@ export class NativeExtManager extends ApplicationService {
|
|||||||
return (window as any)._extensions_manager_location;
|
return (window as any)._extensions_manager_location;
|
||||||
}
|
}
|
||||||
|
|
||||||
get batchMgrUrl() {
|
|
||||||
return (window as any)._batch_manager_location;
|
|
||||||
}
|
|
||||||
|
|
||||||
reload() {
|
reload() {
|
||||||
this.application!.singletonManager!.registerPredicate(this.extManagerPred);
|
this.application!.singletonManager!.registerPredicate(this.extManagerPred);
|
||||||
this.resolveExtensionsManager();
|
this.resolveExtensionsManager();
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ export class NoteTagsState {
|
|||||||
|
|
||||||
clearAutocompleteSearch(): void {
|
clearAutocompleteSearch(): void {
|
||||||
this.setAutocompleteSearchQuery('');
|
this.setAutocompleteSearchQuery('');
|
||||||
this.searchActiveNoteAutocompleteTags();
|
this.setAutocompleteTagResults([]);
|
||||||
}
|
}
|
||||||
|
|
||||||
async createAndAddNewTag(): Promise<void> {
|
async createAndAddNewTag(): Promise<void> {
|
||||||
@@ -198,15 +198,9 @@ export class NoteTagsState {
|
|||||||
async removeTagFromActiveNote(tag: SNTag): Promise<void> {
|
async removeTagFromActiveNote(tag: SNTag): Promise<void> {
|
||||||
const { activeNote } = this;
|
const { activeNote } = this;
|
||||||
if (activeNote) {
|
if (activeNote) {
|
||||||
const descendantTags = this.application.getTagDescendants(tag);
|
await this.application.changeItem(tag.uuid, (mutator) => {
|
||||||
const tagsToRemove = [...descendantTags, tag];
|
mutator.removeItemAsRelationship(activeNote);
|
||||||
await Promise.all(
|
});
|
||||||
tagsToRemove.map(async (tag) => {
|
|
||||||
await this.application.changeItem(tag.uuid, (mutator) => {
|
|
||||||
mutator.removeItemAsRelationship(activeNote);
|
|
||||||
});
|
|
||||||
})
|
|
||||||
);
|
|
||||||
this.application.sync();
|
this.application.sync();
|
||||||
this.reloadTags();
|
this.reloadTags();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -346,17 +346,11 @@ export class NotesState {
|
|||||||
|
|
||||||
async removeTagFromSelectedNotes(tag: SNTag): Promise<void> {
|
async removeTagFromSelectedNotes(tag: SNTag): Promise<void> {
|
||||||
const selectedNotes = Object.values(this.selectedNotes);
|
const selectedNotes = Object.values(this.selectedNotes);
|
||||||
const descendantTags = this.application.getTagDescendants(tag);
|
await this.application.changeItem(tag.uuid, (mutator) => {
|
||||||
const tagsToRemove = [...descendantTags, tag];
|
for (const note of selectedNotes) {
|
||||||
await Promise.all(
|
mutator.removeItemAsRelationship(note);
|
||||||
tagsToRemove.map(async (tag) => {
|
}
|
||||||
await this.application.changeItem(tag.uuid, (mutator) => {
|
});
|
||||||
for (const note of selectedNotes) {
|
|
||||||
mutator.removeItemAsRelationship(note);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
})
|
|
||||||
);
|
|
||||||
this.application.sync();
|
this.application.sync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -92,7 +92,6 @@
|
|||||||
action="self.selectedMenuItem(true); self.toggleWebPrefKey(self.prefKeyMarginResizers)"
|
action="self.selectedMenuItem(true); self.toggleWebPrefKey(self.prefKeyMarginResizers)"
|
||||||
circle="self.state.marginResizersEnabled ? 'success' : 'neutral'",
|
circle="self.state.marginResizersEnabled ? 'success' : 'neutral'",
|
||||||
desc="'Allows for editor left and right margins to be resized'",
|
desc="'Allows for editor left and right margins to be resized'",
|
||||||
faded='!self.state.marginResizersEnabled',
|
|
||||||
label="'Margin Resizers'"
|
label="'Margin Resizers'"
|
||||||
)
|
)
|
||||||
.sk-app-bar-item(
|
.sk-app-bar-item(
|
||||||
|
|||||||
@@ -285,9 +285,6 @@ class EditorViewCtrl extends PureViewCtrl<unknown, EditorState> {
|
|||||||
if (note.dirty) {
|
if (note.dirty) {
|
||||||
this.showSavingStatus();
|
this.showSavingStatus();
|
||||||
}
|
}
|
||||||
if (note.safeText().length === 0 && !showProtectedWarning) {
|
|
||||||
this.focusTitle();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async dismissProtectedWarning() {
|
async dismissProtectedWarning() {
|
||||||
|
|||||||
@@ -411,6 +411,8 @@ class NotesViewCtrl extends PureViewCtrl<unknown, NotesCtrlState> {
|
|||||||
await this.flushUI();
|
await this.flushUI();
|
||||||
await this.reloadNotes();
|
await this.reloadNotes();
|
||||||
await this.appState.noteTags.reloadTags();
|
await this.appState.noteTags.reloadTags();
|
||||||
|
const noteTitleEditorElement = document.getElementById('note-title-editor');
|
||||||
|
noteTitleEditorElement?.focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
async handleTagChange(tag: SNTag) {
|
async handleTagChange(tag: SNTag) {
|
||||||
@@ -789,7 +791,10 @@ class NotesViewCtrl extends PureViewCtrl<unknown, NotesCtrlState> {
|
|||||||
return candidate.uuid === this.activeEditorNote?.uuid;
|
return candidate.uuid === this.activeEditorNote?.uuid;
|
||||||
});
|
});
|
||||||
if (currentIndex + 1 < displayableNotes.length) {
|
if (currentIndex + 1 < displayableNotes.length) {
|
||||||
this.selectNote(displayableNotes[currentIndex + 1]);
|
const nextNote = displayableNotes[currentIndex + 1];
|
||||||
|
this.selectNote(nextNote);
|
||||||
|
const nextNoteElement = document.getElementById(`note-${nextNote.uuid}`);
|
||||||
|
nextNoteElement?.focus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -806,7 +811,10 @@ class NotesViewCtrl extends PureViewCtrl<unknown, NotesCtrlState> {
|
|||||||
const displayableNotes = this.state.notes;
|
const displayableNotes = this.state.notes;
|
||||||
const currentIndex = displayableNotes.indexOf(this.activeEditorNote!);
|
const currentIndex = displayableNotes.indexOf(this.activeEditorNote!);
|
||||||
if (currentIndex - 1 >= 0) {
|
if (currentIndex - 1 >= 0) {
|
||||||
this.selectNote(displayableNotes[currentIndex - 1]);
|
const previousNote = displayableNotes[currentIndex - 1];
|
||||||
|
this.selectNote(previousNote);
|
||||||
|
const previousNoteElement = document.getElementById(`note-${previousNote.uuid}`);
|
||||||
|
previousNoteElement?.focus();
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ $footer-height: 32px;
|
|||||||
top: 0;
|
top: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
z-index: $z-index-panel-resizer;
|
z-index: $z-index-panel-resizer;
|
||||||
width: 8px;
|
width: 2px;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
cursor: col-resize;
|
cursor: col-resize;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "standard-notes-web",
|
"name": "standard-notes-web",
|
||||||
"version": "3.8.2",
|
"version": "3.8.3",
|
||||||
"license": "AGPL-3.0-or-later",
|
"license": "AGPL-3.0-or-later",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
"bundle": "webpack --config webpack.prod.js && yarn tsc",
|
"bundle": "webpack --config webpack.prod.js && yarn tsc",
|
||||||
"bundle:desktop": "webpack --config webpack.prod.js --env.platform='desktop'",
|
"bundle:desktop": "webpack --config webpack.prod.js --env.platform='desktop'",
|
||||||
"bundle:desktop:beta": "webpack --config webpack.prod.js --env.platform='desktop' --env.public_beta='true'",
|
"bundle:desktop:beta": "webpack --config webpack.prod.js --env.platform='desktop' --env.public_beta='true'",
|
||||||
"build": "bundle install && yarn install --pure-lockfile && bundle exec rails assets:precompile && yarn bundle",
|
"build": "bundle install && yarn install --frozen-lockfile && bundle exec rails assets:precompile && yarn bundle",
|
||||||
"submodules": "git submodule update --init --force",
|
"submodules": "git submodule update --init --force",
|
||||||
"lint": "eslint --fix app/assets/javascripts",
|
"lint": "eslint --fix app/assets/javascripts",
|
||||||
"tsc": "tsc --project app/assets/javascripts/tsconfig.json"
|
"tsc": "tsc --project app/assets/javascripts/tsconfig.json"
|
||||||
|
|||||||
Reference in New Issue
Block a user