refactor: new snjs support (#967)

This commit is contained in:
Mo
2022-04-11 12:48:19 -05:00
committed by GitHub
parent 3126d97dca
commit 3a2ff2f440
44 changed files with 569 additions and 799 deletions

View File

@@ -1,3 +1,3 @@
{ {
"singleQuote": true "singleQuote": true,
} }

View File

@@ -1,7 +1,7 @@
import { observer } from 'mobx-react-lite'; import { observer } from 'mobx-react-lite';
import { AppState } from '@/ui_models/app_state'; import { AppState } from '@/ui_models/app_state';
import { WebApplication } from '@/ui_models/application'; import { WebApplication } from '@/ui_models/application';
import { User as UserType } from '@standardnotes/responses'; import { User as UserType } from '@standardnotes/snjs';
type Props = { type Props = {
appState: AppState; appState: AppState;

View File

@@ -169,20 +169,18 @@ export const AttachedFilesPopover: FunctionComponent<Props> = observer(
</div> </div>
) : null} ) : null}
{filteredList.length > 0 ? ( {filteredList.length > 0 ? (
filteredList filteredList.map((file: SNFile) => {
.filter((file) => !file.deleted) return (
.map((file: SNFile) => { <PopoverFileItem
return ( key={file.uuid}
<PopoverFileItem file={file}
key={file.uuid} isAttachedToNote={attachedFiles.includes(file)}
file={file} handleFileAction={handleFileAction}
isAttachedToNote={attachedFiles.includes(file)} getIconType={application.iconsController.getIconForFileType}
handleFileAction={handleFileAction} closeOnBlur={closeOnBlur}
getIconType={application.iconsController.getIconForFileType} />
closeOnBlur={closeOnBlur} );
/> })
);
})
) : ( ) : (
<div className="flex flex-col items-center justify-center w-full py-8"> <div className="flex flex-col items-center justify-center w-full py-8">
<div className="w-18 h-18 mb-2"> <div className="w-18 h-18 mb-2">

View File

@@ -226,10 +226,7 @@ export class Footer extends PureComponent<Props, State> {
this.application.items.setDisplayOptions( this.application.items.setDisplayOptions(
ContentType.Theme, ContentType.Theme,
CollectionSort.Title, CollectionSort.Title,
'asc', 'asc'
(theme: ItemInterface) => {
return !theme.errorDecrypting;
}
); );
} }

View File

@@ -281,7 +281,7 @@ export class NoteView extends PureComponent<Props, State> {
}); });
} }
if (!note.deleted && note.locked !== this.state.noteLocked) { if (note.locked !== this.state.noteLocked) {
this.setState({ this.setState({
noteLocked: note.locked, noteLocked: note.locked,
}); });
@@ -421,7 +421,7 @@ export class NoteView extends PureComponent<Props, State> {
streamItems() { streamItems() {
this.removeComponentStreamObserver = this.application.streamItems( this.removeComponentStreamObserver = this.application.streamItems(
ContentType.Component, ContentType.Component,
async (_items, source) => { async ({ source }) => {
if ( if (
isPayloadSourceInternalChange(source) || isPayloadSourceInternalChange(source) ||
source === PayloadSource.InitialObserverRegistrationPush source === PayloadSource.InitialObserverRegistrationPush
@@ -1003,7 +1003,7 @@ export class NoteView extends PureComponent<Props, State> {
)} )}
</div> </div>
{this.note && !this.note.errorDecrypting && ( {this.note && (
<div id="editor-title-bar" className="section-title-bar w-full"> <div id="editor-title-bar" className="section-title-bar w-full">
<div className="flex items-center justify-between h-8"> <div className="flex items-center justify-between h-8">
<div <div
@@ -1089,165 +1089,127 @@ export class NoteView extends PureComponent<Props, State> {
</div> </div>
)} )}
{!this.note.errorDecrypting && ( <div
<div id={ElementIds.EditorContent}
id={ElementIds.EditorContent} className={ElementIds.EditorContent}
className={ElementIds.EditorContent} ref={this.editorContentRef}
ref={this.editorContentRef} >
> {this.state.marginResizersEnabled &&
{this.state.marginResizersEnabled && this.editorContentRef.current ? (
this.editorContentRef.current ? ( <PanelResizer
<PanelResizer minWidth={300}
minWidth={300} hoverable={true}
hoverable={true} collapsable={false}
collapsable={false} panel={this.editorContentRef.current}
panel={this.editorContentRef.current} side={PanelSide.Left}
side={PanelSide.Left} type={PanelResizeType.OffsetAndWidth}
type={PanelResizeType.OffsetAndWidth} left={this.state.leftResizerOffset}
left={this.state.leftResizerOffset} width={this.state.leftResizerWidth}
width={this.state.leftResizerWidth} resizeFinishCallback={this.onPanelResizeFinish}
resizeFinishCallback={this.onPanelResizeFinish} />
/> ) : null}
) : null}
{this.state.editorComponentViewer && ( {this.state.editorComponentViewer && (
<div className="component-view"> <div className="component-view">
<ComponentView <ComponentView
componentViewer={this.state.editorComponentViewer} componentViewer={this.state.editorComponentViewer}
onLoad={this.onEditorComponentLoad} onLoad={this.onEditorComponentLoad}
requestReload={this.editorComponentViewerRequestsReload} requestReload={this.editorComponentViewerRequestsReload}
application={this.application} application={this.application}
appState={this.appState} appState={this.appState}
/> />
</div> </div>
)}
{this.state.editorStateDidLoad &&
!this.state.editorComponentViewer &&
!this.state.textareaUnloading && (
<textarea
autocomplete="off"
className="editable font-editor"
dir="auto"
id={ElementIds.NoteTextEditor}
onChange={this.onTextAreaChange}
value={this.state.editorText}
readonly={this.state.noteLocked}
onFocus={this.onContentFocus}
spellcheck={this.state.spellcheck}
ref={(ref) => this.onSystemEditorLoad(ref)}
></textarea>
)} )}
{this.state.editorStateDidLoad && {this.state.marginResizersEnabled &&
!this.state.editorComponentViewer && this.editorContentRef.current ? (
!this.state.textareaUnloading && ( <PanelResizer
<textarea minWidth={300}
autocomplete="off" hoverable={true}
className="editable font-editor" collapsable={false}
dir="auto" panel={this.editorContentRef.current}
id={ElementIds.NoteTextEditor} side={PanelSide.Right}
onChange={this.onTextAreaChange} type={PanelResizeType.OffsetAndWidth}
value={this.state.editorText} left={this.state.rightResizerOffset}
readonly={this.state.noteLocked} width={this.state.rightResizerWidth}
onFocus={this.onContentFocus} resizeFinishCallback={this.onPanelResizeFinish}
spellcheck={this.state.spellcheck} />
ref={(ref) => this.onSystemEditorLoad(ref)} ) : null}
></textarea> </div>
)}
{this.state.marginResizersEnabled && <div id="editor-pane-component-stack">
this.editorContentRef.current ? ( {this.state.availableStackComponents.length > 0 && (
<PanelResizer <div
minWidth={300} id="component-stack-menu-bar"
hoverable={true} className="sk-app-bar no-edges"
collapsable={false} >
panel={this.editorContentRef.current} <div className="left">
side={PanelSide.Right} {this.state.availableStackComponents.map((component) => {
type={PanelResizeType.OffsetAndWidth} return (
left={this.state.rightResizerOffset} <div
width={this.state.rightResizerWidth} key={component.uuid}
resizeFinishCallback={this.onPanelResizeFinish} onClick={() => {
/> this.toggleStackComponent(component);
) : null} }}
</div> className="sk-app-bar-item"
)} >
<div className="sk-app-bar-item-column">
{this.note.errorDecrypting && ( <div
<div className="section"> className={
<div id="error-decrypting-container" className="sn-component"> (this.stackComponentExpanded(component) &&
<div id="error-decrypting-panel" className="sk-panel"> component.active
<div className="sk-panel-header"> ? 'info '
<div className="sk-panel-header-title"> : '') +
{this.note.waitingForKey (!this.stackComponentExpanded(component)
? 'Waiting for Key' ? 'neutral '
: 'Unable to Decrypt'} : '') +
</div> ' sk-circle small'
</div> }
<div className="sk-panel-content"> />
<div className="sk-panel-section">
{this.note.waitingForKey && (
<p className="sk-p">
This note is awaiting its encryption key to be ready.
Please wait for syncing to complete for this note to
be decrypted.
</p>
)}
{!this.note.waitingForKey && (
<p className="sk-p">
There was an error decrypting this item. Ensure you
are running the latest version of this app, then sign
out and sign back in to try again.
</p>
)}
</div>
</div>
</div>
</div>
</div>
)}
{!this.note.errorDecrypting && (
<div id="editor-pane-component-stack">
{this.state.availableStackComponents.length > 0 && (
<div
id="component-stack-menu-bar"
className="sk-app-bar no-edges"
>
<div className="left">
{this.state.availableStackComponents.map((component) => {
return (
<div
key={component.uuid}
onClick={() => {
this.toggleStackComponent(component);
}}
className="sk-app-bar-item"
>
<div className="sk-app-bar-item-column">
<div
className={
(this.stackComponentExpanded(component) &&
component.active
? 'info '
: '') +
(!this.stackComponentExpanded(component)
? 'neutral '
: '') +
' sk-circle small'
}
/>
</div>
<div className="sk-app-bar-item-column">
<div className="sk-label">{component.name}</div>
</div>
</div> </div>
); <div className="sk-app-bar-item-column">
})} <div className="sk-label">{component.name}</div>
</div> </div>
</div>
);
})}
</div> </div>
)}
<div className="sn-component">
{this.state.stackComponentViewers.map((viewer) => {
return (
<div className="component-view component-stack-item">
<ComponentView
key={viewer.identifier}
componentViewer={viewer}
manualDealloc={true}
application={this.application}
appState={this.appState}
/>
</div>
);
})}
</div> </div>
)}
<div className="sn-component">
{this.state.stackComponentViewers.map((viewer) => {
return (
<div className="component-view component-stack-item">
<ComponentView
key={viewer.identifier}
componentViewer={viewer}
manualDealloc={true}
application={this.application}
appState={this.appState}
/>
</div>
);
})}
</div> </div>
)} </div>
</div> </div>
</div> </div>
); );

View File

@@ -1,6 +1,7 @@
import { WebApplication } from '@/ui_models/application'; import { WebApplication } from '@/ui_models/application';
import { import {
CollectionSort, CollectionSort,
CollectionSortProperty,
sanitizeHtmlString, sanitizeHtmlString,
SNNote, SNNote,
} from '@standardnotes/snjs'; } from '@standardnotes/snjs';
@@ -18,7 +19,7 @@ type Props = {
onClick: () => void; onClick: () => void;
onContextMenu: (e: MouseEvent) => void; onContextMenu: (e: MouseEvent) => void;
selected: boolean; selected: boolean;
sortedBy?: CollectionSort; sortedBy?: CollectionSortProperty;
}; };
type NoteFlag = { type NoteFlag = {
@@ -34,25 +35,7 @@ const flagsForNote = (note: SNNote) => {
class: 'danger', class: 'danger',
}); });
} }
if (note.errorDecrypting) {
if (note.waitingForKey) {
flags.push({
text: 'Waiting For Keys',
class: 'info',
});
} else {
flags.push({
text: 'Missing Keys',
class: 'danger',
});
}
}
if (note.deleted) {
flags.push({
text: 'Deletion Pending Sync',
class: 'danger',
});
}
return flags; return flags;
}; };

View File

@@ -1,5 +1,9 @@
import { WebApplication } from '@/ui_models/application'; import { WebApplication } from '@/ui_models/application';
import { CollectionSort, PrefKey } from '@standardnotes/snjs'; import {
CollectionSort,
CollectionSortProperty,
PrefKey,
} from '@standardnotes/snjs';
import { observer } from 'mobx-react-lite'; import { observer } from 'mobx-react-lite';
import { FunctionComponent } from 'preact'; import { FunctionComponent } from 'preact';
import { useState } from 'preact/hooks'; import { useState } from 'preact/hooks';
@@ -52,7 +56,7 @@ export const NotesListOptionsMenu: FunctionComponent<Props> = observer(
setSortReverse(!sortReverse); setSortReverse(!sortReverse);
}; };
const toggleSortBy = (sort: CollectionSort) => { const toggleSortBy = (sort: CollectionSortProperty) => {
if (sortBy === sort) { if (sortBy === sort) {
toggleSortReverse(); toggleSortReverse();
} else { } else {

View File

@@ -104,7 +104,7 @@ const ListedActionsMenu: FunctionComponent<ListedActionsMenuProps> = ({
const updatedGroup: ListedMenuGroup = { const updatedGroup: ListedMenuGroup = {
name: updatedAccountInfo.display_name, name: updatedAccountInfo.display_name,
account: group.account, account: group.account,
actions: updatedAccountInfo.actions, actions: updatedAccountInfo.actions as Action[],
}; };
const updatedGroups = menuGroups.map((group) => { const updatedGroups = menuGroups.map((group) => {
@@ -145,7 +145,7 @@ const ListedActionsMenu: FunctionComponent<ListedActionsMenuProps> = ({
menuGroups.push({ menuGroups.push({
name: accountInfo.display_name, name: accountInfo.display_name,
account, account,
actions: accountInfo.actions, actions: accountInfo.actions as Action[],
}); });
} else { } else {
menuGroups.push({ menuGroups.push({

View File

@@ -219,7 +219,6 @@ export const NotesOptions = observer(
const notTrashed = notes.some((note) => !note.trashed); const notTrashed = notes.some((note) => !note.trashed);
const pinned = notes.some((note) => note.pinned); const pinned = notes.some((note) => note.pinned);
const unpinned = notes.some((note) => !note.pinned); const unpinned = notes.some((note) => !note.pinned);
const errored = notes.some((note) => note.errorDecrypting);
useEffect(() => { useEffect(() => {
const removeAltKeyObserver = application.io.addKeyObserver({ const removeAltKeyObserver = application.io.addKeyObserver({
@@ -278,26 +277,6 @@ export const NotesOptions = observer(
}); });
}; };
if (errored) {
return (
<>
{notes.length === 1 ? (
<div className="px-3 pt-1.5 pb-1 text-xs color-neutral font-medium">
<div>
<span className="font-semibold">Note ID:</span> {notes[0].uuid}
</div>
</div>
) : null}
<DeletePermanentlyButton
closeOnBlur={closeOnBlur}
onClick={async () => {
await appState.notes.deleteNotesPermanently();
}}
/>
</>
);
}
const openRevisionHistoryModal = () => { const openRevisionHistoryModal = () => {
appState.notes.setShowRevisionHistoryModal(true); appState.notes.setShowRevisionHistoryModal(true);
}; };

View File

@@ -86,7 +86,7 @@ export const ChangeEditorMenu: FunctionComponent<ChangeEditorMenuProps> = ({
) => { ) => {
if (component) { if (component) {
if (component.conflictOf) { if (component.conflictOf) {
application.mutator.changeAndSaveItem(component.uuid, (mutator) => { application.mutator.changeAndSaveItem(component, (mutator) => {
mutator.conflictOf = undefined; mutator.conflictOf = undefined;
}); });
} }

View File

@@ -1,11 +1,13 @@
import { WebApplication } from '@/ui_models/application'; import { WebApplication } from '@/ui_models/application';
import { import {
ContentType,
FeatureStatus,
SNComponent,
ComponentArea, ComponentArea,
FeatureDescription, FeatureDescription,
GetFeatures, GetFeatures,
NoteType, NoteType,
} from '@standardnotes/features'; } from '@standardnotes/snjs';
import { ContentType, FeatureStatus, SNComponent } from '@standardnotes/snjs';
import { EditorMenuItem, EditorMenuGroup } from '../ChangeEditorOption'; import { EditorMenuItem, EditorMenuGroup } from '../ChangeEditorOption';
export const PLAIN_EDITOR_NAME = 'Plain Editor'; export const PLAIN_EDITOR_NAME = 'Plain Editor';

View File

@@ -1,12 +1,6 @@
import { action, makeAutoObservable, observable } from 'mobx'; import { action, makeAutoObservable, observable } from 'mobx';
import { ExtensionsLatestVersions } from '@/components/Preferences/panes/extensions-segments'; import { ExtensionsLatestVersions } from '@/components/Preferences/panes/extensions-segments';
import { import { FeatureIdentifier, IconType } from '@standardnotes/snjs';
ComponentArea,
ContentType,
FeatureIdentifier,
SNComponent,
IconType,
} from '@standardnotes/snjs';
import { WebApplication } from '@/ui_models/application'; import { WebApplication } from '@/ui_models/application';
const PREFERENCE_IDS = [ const PREFERENCE_IDS = [
@@ -61,7 +55,6 @@ const READY_PREFERENCES_MENU_ITEMS: PreferencesMenuItem[] = [
export class PreferencesMenu { export class PreferencesMenu {
private _selectedPane: PreferenceId | FeatureIdentifier = 'account'; private _selectedPane: PreferenceId | FeatureIdentifier = 'account';
private _extensionPanes: SNComponent[] = [];
private _menu: PreferencesMenuItem[]; private _menu: PreferencesMenuItem[];
private _extensionLatestVersions: ExtensionsLatestVersions = private _extensionLatestVersions: ExtensionsLatestVersions =
new ExtensionsLatestVersions(new Map()); new ExtensionsLatestVersions(new Map());
@@ -74,7 +67,6 @@ export class PreferencesMenu {
? PREFERENCES_MENU_ITEMS ? PREFERENCES_MENU_ITEMS
: READY_PREFERENCES_MENU_ITEMS; : READY_PREFERENCES_MENU_ITEMS;
this.loadExtensionsPanes();
this.loadLatestVersions(); this.loadLatestVersions();
makeAutoObservable< makeAutoObservable<
@@ -105,64 +97,24 @@ export class PreferencesMenu {
return this._extensionLatestVersions; return this._extensionLatestVersions;
} }
loadExtensionsPanes(): void {
const excludedComponents = [
FeatureIdentifier.TwoFactorAuthManager,
'org.standardnotes.batch-manager',
'org.standardnotes.extensions-manager',
FeatureIdentifier.CloudLink,
];
this._extensionPanes = (
this.application.items.getItems([
ContentType.ActionsExtension,
ContentType.Component,
ContentType.Theme,
]) as SNComponent[]
).filter(
(extension) =>
extension.area === ComponentArea.Modal &&
!excludedComponents.includes(extension.package_info.identifier)
);
}
get menuItems(): SelectableMenuItem[] { get menuItems(): SelectableMenuItem[] {
const menuItems = this._menu.map((preference) => ({ const menuItems = this._menu.map((preference) => ({
...preference, ...preference,
selected: preference.id === this._selectedPane, selected: preference.id === this._selectedPane,
})); }));
const extensionsMenuItems: SelectableMenuItem[] = this._extensionPanes.map(
(extension) => {
return {
icon: 'window',
id: extension.package_info.identifier,
label: extension.name,
selected: extension.package_info.identifier === this._selectedPane,
};
}
);
return menuItems.concat(extensionsMenuItems); return menuItems;
} }
get selectedMenuItem(): PreferencesMenuItem | undefined { get selectedMenuItem(): PreferencesMenuItem | undefined {
return this._menu.find((item) => item.id === this._selectedPane); return this._menu.find((item) => item.id === this._selectedPane);
} }
get selectedExtension(): SNComponent | undefined {
return this._extensionPanes.find(
(extension) => extension.package_info.identifier === this._selectedPane
);
}
get selectedPaneId(): PreferenceId | FeatureIdentifier { get selectedPaneId(): PreferenceId | FeatureIdentifier {
if (this.selectedMenuItem != undefined) { if (this.selectedMenuItem != undefined) {
return this.selectedMenuItem.id; return this.selectedMenuItem.id;
} }
if (this.selectedExtension != undefined) {
return this.selectedExtension.package_info.identifier;
}
return 'account'; return 'account';
} }

View File

@@ -1,6 +1,8 @@
import { RoundIconButton } from '@/components/RoundIconButton'; import { RoundIconButton } from '@/components/RoundIconButton';
import { TitleBar, Title } from '@/components/TitleBar'; import { TitleBar, Title } from '@/components/TitleBar';
import { FunctionComponent } from 'preact'; import { FunctionComponent } from 'preact';
import { observer } from 'mobx-react-lite';
import { import {
AccountPreferences, AccountPreferences,
HelpAndFeedback, HelpAndFeedback,
@@ -8,15 +10,12 @@ import {
General, General,
Security, Security,
} from './panes'; } from './panes';
import { observer } from 'mobx-react-lite';
import { PreferencesMenu } from './PreferencesMenu'; import { PreferencesMenu } from './PreferencesMenu';
import { PreferencesMenuView } from './PreferencesMenuView'; import { PreferencesMenuView } from './PreferencesMenuView';
import { WebApplication } from '@/ui_models/application'; import { WebApplication } from '@/ui_models/application';
import { MfaProps } from './panes/two-factor-auth/MfaProps'; import { MfaProps } from './panes/two-factor-auth/MfaProps';
import { AppState } from '@/ui_models/app_state'; import { AppState } from '@/ui_models/app_state';
import { useEffect, useMemo } from 'preact/hooks'; import { useEffect, useMemo } from 'preact/hooks';
import { ExtensionPane } from './panes/ExtensionPane';
import { Backups } from '@/components/Preferences/panes/Backups'; import { Backups } from '@/components/Preferences/panes/Backups';
import { Appearance } from './panes/Appearance'; import { Appearance } from './panes/Appearance';
@@ -66,24 +65,13 @@ const PaneSelector: FunctionComponent<
case 'help-feedback': case 'help-feedback':
return <HelpAndFeedback />; return <HelpAndFeedback />;
default: default:
if (menu.selectedExtension != undefined) { return (
return ( <General
<ExtensionPane appState={appState}
application={application} application={application}
appState={appState} extensionsLatestVersions={menu.extensionsLatestVersions}
extension={menu.selectedExtension} />
preferencesMenu={menu} );
/>
);
} else {
return (
<General
appState={appState}
application={application}
extensionsLatestVersions={menu.extensionsLatestVersions}
/>
);
}
} }
}); });

View File

@@ -4,12 +4,12 @@ import { sortThemes } from '@/components/QuickSettingsMenu/QuickSettingsMenu';
import { HorizontalSeparator } from '@/components/Shared/HorizontalSeparator'; import { HorizontalSeparator } from '@/components/Shared/HorizontalSeparator';
import { Switch } from '@/components/Switch'; import { Switch } from '@/components/Switch';
import { WebApplication } from '@/ui_models/application'; import { WebApplication } from '@/ui_models/application';
import { GetFeatures } from '@standardnotes/features';
import { import {
ContentType, ContentType,
FeatureIdentifier, FeatureIdentifier,
FeatureStatus, FeatureStatus,
PrefKey, PrefKey,
GetFeatures,
SNTheme, SNTheme,
} from '@standardnotes/snjs'; } from '@standardnotes/snjs';
import { observer } from 'mobx-react-lite'; import { observer } from 'mobx-react-lite';
@@ -61,9 +61,8 @@ export const Appearance: FunctionComponent<Props> = observer(
); );
useEffect(() => { useEffect(() => {
const themesAsItems: DropdownItem[] = ( const themesAsItems: DropdownItem[] = application.items
application.items.getDisplayableItems(ContentType.Theme) as SNTheme[] .getDisplayableItems<SNTheme>(ContentType.Theme)
)
.filter((theme) => !theme.isLayerable()) .filter((theme) => !theme.isLayerable())
.sort(sortThemes) .sort(sortThemes)
.map((theme) => { .map((theme) => {

View File

@@ -1,79 +0,0 @@
import {
PreferencesGroup,
PreferencesSegment,
} from '@/components/Preferences/components';
import { WebApplication } from '@/ui_models/application';
import { ComponentViewer, SNComponent } from '@standardnotes/snjs';
import { FeatureIdentifier } from '@standardnotes/features';
import { observer } from 'mobx-react-lite';
import { FunctionComponent } from 'preact';
import { ExtensionItem } from './extensions-segments';
import { ComponentView } from '@/components/ComponentView';
import { AppState } from '@/ui_models/app_state';
import { PreferencesMenu } from '@/components/Preferences/PreferencesMenu';
import { useEffect, useState } from 'preact/hooks';
interface IProps {
application: WebApplication;
appState: AppState;
extension: SNComponent;
preferencesMenu: PreferencesMenu;
}
const urlOverrideForExtension = (extension: SNComponent) => {
if (extension.identifier === FeatureIdentifier.CloudLink) {
return 'https://extensions.standardnotes.org/components/cloudlink';
} else {
return undefined;
}
};
export const ExtensionPane: FunctionComponent<IProps> = observer(
({ extension, application, appState, preferencesMenu }) => {
const [componentViewer] = useState<ComponentViewer>(
application.componentManager.createComponentViewer(
extension,
undefined,
undefined,
urlOverrideForExtension(extension)
)
);
const latestVersion =
preferencesMenu.extensionsLatestVersions.getVersion(extension);
useEffect(() => {
return () => {
application.componentManager.destroyComponentViewer(componentViewer);
};
}, [application, componentViewer]);
return (
<div className="preferences-extension-pane color-foreground flex-grow flex flex-row overflow-y-auto min-h-0">
<div className="flex-grow flex flex-col py-6 items-center">
<div className="w-200 max-w-200 flex flex-col">
<PreferencesGroup>
<ExtensionItem
application={application}
extension={extension}
first={false}
uninstall={() =>
application.mutator
.deleteItem(extension)
.then(() => preferencesMenu.loadExtensionsPanes())
}
latestVersion={latestVersion}
/>
<PreferencesSegment>
<ComponentView
application={application}
appState={appState}
componentViewer={componentViewer}
/>
</PreferencesSegment>
</PreferencesGroup>
</div>
</div>
</div>
);
}
);

View File

@@ -13,10 +13,11 @@ import { useEffect, useRef, useState } from 'preact/hooks';
import { observer } from 'mobx-react-lite'; import { observer } from 'mobx-react-lite';
const loadExtensions = (application: WebApplication) => const loadExtensions = (application: WebApplication) =>
application.items.getItems( application.items.getItems([
[ContentType.ActionsExtension, ContentType.Component, ContentType.Theme], ContentType.ActionsExtension,
true ContentType.Component,
) as SNComponent[]; ContentType.Theme,
]) as SNComponent[];
export const Extensions: FunctionComponent<{ export const Extensions: FunctionComponent<{
application: WebApplication; application: WebApplication;

View File

@@ -13,16 +13,16 @@ import {
Text, Text,
Title, Title,
} from '../../components'; } from '../../components';
import {
EmailBackupFrequency,
MuteFailedBackupsEmailsOption,
SettingName,
} from '@standardnotes/settings';
import { Dropdown, DropdownItem } from '@/components/Dropdown'; import { Dropdown, DropdownItem } from '@/components/Dropdown';
import { Switch } from '@/components/Switch'; import { Switch } from '@/components/Switch';
import { HorizontalSeparator } from '@/components/Shared/HorizontalSeparator'; import { HorizontalSeparator } from '@/components/Shared/HorizontalSeparator';
import { FeatureIdentifier } from '@standardnotes/features'; import {
import { FeatureStatus } from '@standardnotes/snjs'; FeatureStatus,
FeatureIdentifier,
EmailBackupFrequency,
MuteFailedBackupsEmailsOption,
SettingName,
} from '@standardnotes/snjs';
type Props = { type Props = {
application: WebApplication; application: WebApplication;

View File

@@ -1,11 +1,12 @@
import { useCallback, useEffect, useState } from 'preact/hooks'; import { useCallback, useEffect, useState } from 'preact/hooks';
import { ButtonType, SettingName } from '@standardnotes/snjs';
import { import {
ButtonType,
SettingName,
CloudProvider, CloudProvider,
DropboxBackupFrequency, DropboxBackupFrequency,
GoogleDriveBackupFrequency, GoogleDriveBackupFrequency,
OneDriveBackupFrequency, OneDriveBackupFrequency,
} from '@standardnotes/settings'; } from '@standardnotes/snjs';
import { WebApplication } from '@/ui_models/application'; import { WebApplication } from '@/ui_models/application';
import { Button } from '@/components/Button'; import { Button } from '@/components/Button';
import { isDev, openInNewTab } from '@/utils'; import { isDev, openInNewTab } from '@/utils';

View File

@@ -9,14 +9,15 @@ import {
Title, Title,
} from '@/components/Preferences/components'; } from '@/components/Preferences/components';
import { HorizontalSeparator } from '@/components/Shared/HorizontalSeparator'; import { HorizontalSeparator } from '@/components/Shared/HorizontalSeparator';
import { FeatureIdentifier } from '@standardnotes/features';
import { FeatureStatus } from '@standardnotes/snjs';
import { FunctionComponent } from 'preact';
import { import {
FeatureStatus,
FeatureIdentifier,
CloudProvider, CloudProvider,
MuteFailedCloudBackupsEmailsOption, MuteFailedCloudBackupsEmailsOption,
SettingName, SettingName,
} from '@standardnotes/settings'; } from '@standardnotes/snjs';
import { FunctionComponent } from 'preact';
import { Switch } from '@/components/Switch'; import { Switch } from '@/components/Switch';
import { convertStringifiedBooleanToBoolean } from '@/utils'; import { convertStringifiedBooleanToBoolean } from '@/utils';
import { STRING_FAILED_TO_UPDATE_USER_SETTING } from '@/strings'; import { STRING_FAILED_TO_UPDATE_USER_SETTING } from '@/strings';

View File

@@ -1,4 +1,4 @@
import { displayStringForContentType, SNComponent } from '@standardnotes/snjs'; import { DisplayStringForContentType, SNComponent } from '@standardnotes/snjs';
import { Button } from '@/components/Button'; import { Button } from '@/components/Button';
import { FunctionComponent } from 'preact'; import { FunctionComponent } from 'preact';
import { Title, Text, Subtitle, PreferencesSegment } from '../../components'; import { Title, Text, Subtitle, PreferencesSegment } from '../../components';
@@ -30,7 +30,7 @@ export const ConfirmCustomExtension: FunctionComponent<{
}, },
{ {
label: 'Extension Type', label: 'Extension Type',
value: displayStringForContentType(component.content_type), value: DisplayStringForContentType(component.content_type),
}, },
]; ];

View File

@@ -47,7 +47,7 @@ export const ExtensionItem: FunctionComponent<ExtensionItemProps> = ({
const newOfflineOnly = !offlineOnly; const newOfflineOnly = !offlineOnly;
setOfflineOnly(newOfflineOnly); setOfflineOnly(newOfflineOnly);
application.mutator application.mutator
.changeAndSaveItem(extension.uuid, (m: any) => { .changeAndSaveItem(extension, (m: any) => {
if (m.content == undefined) m.content = {}; if (m.content == undefined) m.content = {};
m.content.offlineOnly = newOfflineOnly; m.content.offlineOnly = newOfflineOnly;
}) })
@@ -63,7 +63,7 @@ export const ExtensionItem: FunctionComponent<ExtensionItemProps> = ({
const changeExtensionName = (newName: string) => { const changeExtensionName = (newName: string) => {
setExtensionName(newName); setExtensionName(newName);
application.mutator application.mutator
.changeAndSaveItem(extension.uuid, (m: any) => { .changeAndSaveItem(extension, (m: any) => {
if (m.content == undefined) m.content = {}; if (m.content == undefined) m.content = {};
m.content.name = newName; m.content.name = newName;
}) })

View File

@@ -1,6 +1,9 @@
import { WebApplication } from '@/ui_models/application'; import { WebApplication } from '@/ui_models/application';
import { FeatureDescription } from '@standardnotes/features'; import {
import { SNComponent, ClientDisplayableError } from '@standardnotes/snjs'; SNComponent,
ClientDisplayableError,
FeatureDescription,
} from '@standardnotes/snjs';
import { makeAutoObservable, observable } from 'mobx'; import { makeAutoObservable, observable } from 'mobx';
export class ExtensionsLatestVersions { export class ExtensionsLatestVersions {

View File

@@ -34,7 +34,7 @@ const makeEditorDefault = (
if (currentDefault) { if (currentDefault) {
removeEditorDefault(application, currentDefault); removeEditorDefault(application, currentDefault);
} }
application.mutator.changeAndSaveItem(component.uuid, (m) => { application.mutator.changeAndSaveItem(component, (m) => {
const mutator = m as ComponentMutator; const mutator = m as ComponentMutator;
mutator.defaultEditor = true; mutator.defaultEditor = true;
}); });
@@ -44,7 +44,7 @@ const removeEditorDefault = (
application: WebApplication, application: WebApplication,
component: SNComponent component: SNComponent
) => { ) => {
application.mutator.changeAndSaveItem(component.uuid, (m) => { application.mutator.changeAndSaveItem(component, (m) => {
const mutator = m as ComponentMutator; const mutator = m as ComponentMutator;
mutator.defaultEditor = false; mutator.defaultEditor = false;
}); });

View File

@@ -1,4 +1,3 @@
import { FindNativeFeature } from '@standardnotes/features';
import { Switch } from '@/components/Switch'; import { Switch } from '@/components/Switch';
import { import {
PreferencesGroup, PreferencesGroup,
@@ -8,7 +7,11 @@ import {
Title, Title,
} from '@/components/Preferences/components'; } from '@/components/Preferences/components';
import { WebApplication } from '@/ui_models/application'; import { WebApplication } from '@/ui_models/application';
import { FeatureIdentifier, FeatureStatus } from '@standardnotes/snjs'; import {
FeatureIdentifier,
FeatureStatus,
FindNativeFeature,
} from '@standardnotes/snjs';
import { FunctionComponent } from 'preact'; import { FunctionComponent } from 'preact';
import { useCallback, useEffect, useState } from 'preact/hooks'; import { useCallback, useEffect, useState } from 'preact/hooks';
import { usePremiumModal } from '@/components/Premium'; import { usePremiumModal } from '@/components/Premium';

View File

@@ -12,7 +12,7 @@ import {
MuteSignInEmailsOption, MuteSignInEmailsOption,
LogSessionUserAgentOption, LogSessionUserAgentOption,
SettingName, SettingName,
} from '@standardnotes/settings'; } from '@standardnotes/snjs';
import { observer } from 'mobx-react-lite'; import { observer } from 'mobx-react-lite';
import { FunctionalComponent } from 'preact'; import { FunctionalComponent } from 'preact';
import { useCallback, useEffect, useState } from 'preact/hooks'; import { useCallback, useEffect, useState } from 'preact/hooks';

View File

@@ -103,15 +103,15 @@ export const QuickSettingsMenu: FunctionComponent<MenuProps> = observer(
}, [focusModeEnabled]); }, [focusModeEnabled]);
const reloadThemes = useCallback(() => { const reloadThemes = useCallback(() => {
const themes = ( const themes = application.items
application.items.getDisplayableItems(ContentType.Theme) as SNTheme[] .getDisplayableItems<SNTheme>(ContentType.Theme)
).map((item) => { .map((item) => {
return { return {
name: item.name, name: item.name,
identifier: item.identifier, identifier: item.identifier,
component: item, component: item,
}; };
}) as ThemeItem[]; }) as ThemeItem[];
GetFeatures() GetFeatures()
.filter( .filter(
@@ -140,17 +140,15 @@ export const QuickSettingsMenu: FunctionComponent<MenuProps> = observer(
}, [application]); }, [application]);
const reloadToggleableComponents = useCallback(() => { const reloadToggleableComponents = useCallback(() => {
const toggleableComponents = ( const toggleableComponents = application.items
application.items.getDisplayableItems( .getDisplayableItems<SNComponent>(ContentType.Component)
ContentType.Component .filter(
) as SNComponent[] (component) =>
).filter( [ComponentArea.EditorStack].includes(component.area) &&
(component) => component.identifier !==
[ComponentArea.EditorStack, ComponentArea.TagsList].includes( FeatureIdentifier.DeprecatedFoldersComponent
component.area );
) &&
component.identifier !== FeatureIdentifier.DeprecatedFoldersComponent
);
setToggleableComponents(toggleableComponents); setToggleableComponents(toggleableComponents);
}, [application]); }, [application]);

View File

@@ -134,7 +134,7 @@ export const HistoryListContainer: FunctionComponent<Props> = observer(
throw new Error('Could not fetch revision'); throw new Error('Could not fetch revision');
} }
setSelectedRevision(response.item as HistoryEntry); setSelectedRevision(response.item as unknown as HistoryEntry);
} catch (error) { } catch (error) {
console.error(error); console.error(error);
setSelectedRevision(undefined); setSelectedRevision(undefined);
@@ -165,7 +165,7 @@ export const HistoryListContainer: FunctionComponent<Props> = observer(
try { try {
const remoteRevision = const remoteRevision =
await application.historyManager.fetchRemoteRevision( await application.historyManager.fetchRemoteRevision(
note.uuid, note,
revisionListEntry revisionListEntry
); );
setSelectedRevision(remoteRevision); setSelectedRevision(remoteRevision);
@@ -182,7 +182,7 @@ export const HistoryListContainer: FunctionComponent<Props> = observer(
}, },
[ [
application, application,
note.uuid, note,
setIsFetchingSelectedRevision, setIsFetchingSelectedRevision,
setSelectedRemoteEntry, setSelectedRemoteEntry,
setSelectedRevision, setSelectedRevision,

View File

@@ -8,7 +8,6 @@ import {
ButtonType, ButtonType,
ContentType, ContentType,
HistoryEntry, HistoryEntry,
PayloadContent,
PayloadSource, PayloadSource,
RevisionListEntry, RevisionListEntry,
SNNote, SNNote,
@@ -148,7 +147,7 @@ export const RevisionHistoryModal: FunctionComponent<RevisionHistoryModalProps>
}).then((confirmed) => { }).then((confirmed) => {
if (confirmed) { if (confirmed) {
application.mutator.changeAndSaveItem( application.mutator.changeAndSaveItem(
selectedRevision.payload.uuid, originalNote,
(mutator) => { (mutator) => {
mutator.unsafe_setCustomContent( mutator.unsafe_setCustomContent(
selectedRevision.payload.content selectedRevision.payload.content
@@ -165,14 +164,14 @@ export const RevisionHistoryModal: FunctionComponent<RevisionHistoryModalProps>
const restoreAsCopy = async () => { const restoreAsCopy = async () => {
if (selectedRevision) { if (selectedRevision) {
const originalNote = application.items.findItem( const originalNote = application.items.findSureItem<SNNote>(
selectedRevision.payload.uuid selectedRevision.payload.uuid
) as SNNote; );
const duplicatedItem = await application.mutator.duplicateItem( const duplicatedItem = await application.mutator.duplicateItem(
originalNote, originalNote,
{ {
...(selectedRevision.payload.content as PayloadContent), ...selectedRevision.payload.content,
title: selectedRevision.payload.content.title title: selectedRevision.payload.content.title
? selectedRevision.payload.content.title + ' (copy)' ? selectedRevision.payload.content.title + ' (copy)'
: undefined, : undefined,
@@ -188,10 +187,10 @@ export const RevisionHistoryModal: FunctionComponent<RevisionHistoryModalProps>
useEffect(() => { useEffect(() => {
const fetchTemplateNote = async () => { const fetchTemplateNote = async () => {
if (selectedRevision) { if (selectedRevision) {
const newTemplateNote = (await application.mutator.createTemplateItem( const newTemplateNote = application.mutator.createTemplateItem(
ContentType.Note, ContentType.Note,
selectedRevision.payload.content selectedRevision.payload.content
)) as SNNote; ) as SNNote;
setTemplateNoteForRevision(newTemplateNote); setTemplateNoteForRevision(newTemplateNote);
} }
@@ -218,7 +217,7 @@ export const RevisionHistoryModal: FunctionComponent<RevisionHistoryModalProps>
setIsDeletingRevision(true); setIsDeletingRevision(true);
application.historyManager application.historyManager
.deleteRemoteRevision(note.uuid, selectedRemoteEntry) .deleteRemoteRevision(note, selectedRemoteEntry)
.then((res) => { .then((res) => {
if (res.error?.message) { if (res.error?.message) {
throw new Error(res.error.message); throw new Error(res.error.message);

View File

@@ -4,7 +4,7 @@ import {
PayloadSource, PayloadSource,
SNNote, SNNote,
ComponentViewer, ComponentViewer,
PayloadContent, NoteContent,
} from '@standardnotes/snjs'; } from '@standardnotes/snjs';
import { confirmDialog } from '@/services/alertService'; import { confirmDialog } from '@/services/alertService';
import { STRING_RESTORE_LOCKED_ATTEMPT } from '@/strings'; import { STRING_RESTORE_LOCKED_ATTEMPT } from '@/strings';
@@ -13,7 +13,7 @@ import { ComponentView } from './ComponentView';
interface Props { interface Props {
application: WebApplication; application: WebApplication;
content: PayloadContent; content: NoteContent;
title?: string; title?: string;
uuid: string; uuid: string;
} }
@@ -74,7 +74,7 @@ export class RevisionPreviewModal extends PureComponent<Props, State> {
}); });
} else { } else {
this.application.mutator.changeAndSaveItem( this.application.mutator.changeAndSaveItem(
this.props.uuid, this.originalNote,
(mutator) => { (mutator) => {
mutator.unsafe_setCustomContent(this.props.content); mutator.unsafe_setCustomContent(this.props.content);
}, },

View File

@@ -110,30 +110,29 @@ export const SmartViewsListItem: FunctionComponent<Props> = observer(
paddingLeft: `${level * PADDING_PER_LEVEL_PX + PADDING_BASE_PX}px`, paddingLeft: `${level * PADDING_PER_LEVEL_PX + PADDING_BASE_PX}px`,
}} }}
> >
{!view.errorDecrypting ? ( <div className="tag-info">
<div className="tag-info"> <div className={`tag-icon mr-1`}>
<div className={`tag-icon mr-1`}> <Icon
<Icon type={iconType}
type={iconType} className={`${isSelected ? 'color-info' : 'color-neutral'}`}
className={`${isSelected ? 'color-info' : 'color-neutral'}`}
/>
</div>
<input
className={`title ${isEditing ? 'editing' : ''}`}
disabled={!isEditing}
id={`react-tag-${view.uuid}`}
onBlur={onBlur}
onInput={onInput}
value={title}
onKeyUp={onKeyUp}
spellCheck={false}
ref={inputRef}
/> />
<div className="count">
{view.uuid === SystemViewId.AllNotes && tagsState.allNotesCount}
</div>
</div> </div>
) : null} <input
className={`title ${isEditing ? 'editing' : ''}`}
disabled={!isEditing}
id={`react-tag-${view.uuid}`}
onBlur={onBlur}
onInput={onInput}
value={title}
onKeyUp={onKeyUp}
spellCheck={false}
ref={inputRef}
/>
<div className="count">
{view.uuid === SystemViewId.AllNotes && tagsState.allNotesCount}
</div>
</div>
{!isSystemView(view) && ( {!isSystemView(view) && (
<div className="meta"> <div className="meta">
{view.conflictOf && ( {view.conflictOf && (
@@ -141,14 +140,7 @@ export const SmartViewsListItem: FunctionComponent<Props> = observer(
Conflicted Copy {view.conflictOf} Conflicted Copy {view.conflictOf}
</div> </div>
)} )}
{view.errorDecrypting && !view.waitingForKey && (
<div className="danger small-text font-bold">Missing Keys</div>
)}
{view.errorDecrypting && view.waitingForKey && (
<div className="info small-text font-bold">
Waiting For Keys
</div>
)}
{isSelected && ( {isSelected && (
<div className="menu"> <div className="menu">
{!isEditing && ( {!isEditing && (

View File

@@ -152,7 +152,7 @@ export const TagsListItem: FunctionComponent<Props> = observer(
() => ({ () => ({
accept: ItemTypes.TAG, accept: ItemTypes.TAG,
canDrop: (item) => { canDrop: (item) => {
return tagsState.isValidTagParent(tag.uuid, item.uuid); return tagsState.isValidTagParent(tag, item as SNTag);
}, },
drop: (item) => { drop: (item) => {
if (!hasFolders) { if (!hasFolders) {
@@ -202,70 +202,61 @@ export const TagsListItem: FunctionComponent<Props> = observer(
onContextMenu(tag, e.clientX, e.clientY); onContextMenu(tag, e.clientX, e.clientY);
}} }}
> >
{!tag.errorDecrypting ? ( <div className="tag-info" title={title} ref={dropRef}>
<div className="tag-info" title={title} ref={dropRef}> {hasAtLeastOneFolder && (
{hasAtLeastOneFolder && ( <div className="tag-fold-container">
<div className="tag-fold-container">
<button
className={`tag-fold focus:shadow-inner ${
showChildren ? 'opened' : 'closed'
} ${!hasChildren ? 'invisible' : ''}`}
onClick={hasChildren ? toggleChildren : undefined}
>
<Icon
className={`color-neutral`}
type={
showChildren
? 'menu-arrow-down-alt'
: 'menu-arrow-right'
}
/>
</button>
</div>
)}
<div className={`tag-icon draggable mr-1`} ref={dragRef}>
<Icon
type="hashtag"
className={`${isSelected ? 'color-info' : 'color-neutral'}`}
/>
</div>
<input
className={`title ${isEditing ? 'editing' : ''}`}
id={`react-tag-${tag.uuid}`}
disabled={!isEditing}
onBlur={onBlur}
onInput={onInput}
value={title}
onKeyDown={onKeyDown}
spellCheck={false}
ref={inputRef}
/>
<div className="flex items-center">
<button <button
className={`border-0 mr-2 bg-transparent hover:bg-contrast focus:shadow-inner cursor-pointer ${ className={`tag-fold focus:shadow-inner ${
isSelected ? 'visible' : 'invisible' showChildren ? 'opened' : 'closed'
}`} } ${!hasChildren ? 'invisible' : ''}`}
onClick={toggleContextMenu} onClick={hasChildren ? toggleChildren : undefined}
ref={menuButtonRef}
> >
<Icon type="more" className="color-neutral" /> <Icon
className={`color-neutral`}
type={
showChildren ? 'menu-arrow-down-alt' : 'menu-arrow-right'
}
/>
</button> </button>
<div className="count">{noteCounts.get()}</div>
</div> </div>
)}
<div className={`tag-icon draggable mr-1`} ref={dragRef}>
<Icon
type="hashtag"
className={`${isSelected ? 'color-info' : 'color-neutral'}`}
/>
</div> </div>
) : null} <input
className={`title ${isEditing ? 'editing' : ''}`}
id={`react-tag-${tag.uuid}`}
disabled={!isEditing}
onBlur={onBlur}
onInput={onInput}
value={title}
onKeyDown={onKeyDown}
spellCheck={false}
ref={inputRef}
/>
<div className="flex items-center">
<button
className={`border-0 mr-2 bg-transparent hover:bg-contrast focus:shadow-inner cursor-pointer ${
isSelected ? 'visible' : 'invisible'
}`}
onClick={toggleContextMenu}
ref={menuButtonRef}
>
<Icon type="more" className="color-neutral" />
</button>
<div className="count">{noteCounts.get()}</div>
</div>
</div>
<div className={`meta ${hasAtLeastOneFolder ? 'with-folders' : ''}`}> <div className={`meta ${hasAtLeastOneFolder ? 'with-folders' : ''}`}>
{tag.conflictOf && ( {tag.conflictOf && (
<div className="danger small-text font-bold"> <div className="danger small-text font-bold">
Conflicted Copy {tag.conflictOf} Conflicted Copy {tag.conflictOf}
</div> </div>
)} )}
{tag.errorDecrypting && !tag.waitingForKey && (
<div className="danger small-text font-bold">Missing Keys</div>
)}
{tag.errorDecrypting && tag.waitingForKey && (
<div className="info small-text font-bold">Waiting For Keys</div>
)}
</div> </div>
</button> </button>
{isAddingSubtag && ( {isAddingSubtag && (

View File

@@ -1,11 +1,10 @@
import { WebApplication } from '@/ui_models/application'; import { WebApplication } from '@/ui_models/application';
import { parseFileName } from '@standardnotes/filepicker'; import { parseFileName } from '@standardnotes/filepicker';
import { import {
EncryptionIntent,
ContentType, ContentType,
SNNote,
BackupFile, BackupFile,
PayloadContent, BackupFileDecryptedContextualPayload,
NoteContent,
} from '@standardnotes/snjs'; } from '@standardnotes/snjs';
function sanitizeFileName(name: string): string { function sanitizeFileName(name: string): string {
@@ -79,6 +78,7 @@ export class ArchiveManager {
const blob = new Blob([JSON.stringify(data, null, 2)], { const blob = new Blob([JSON.stringify(data, null, 2)], {
type: 'text/plain', type: 'text/plain',
}); });
const fileName = zippableFileName('Standard Notes Backup and Import File'); const fileName = zippableFileName('Standard Notes Backup and Import File');
await zipWriter.add(fileName, new zip.BlobReader(blob)); await zipWriter.add(fileName, new zip.BlobReader(blob));
@@ -88,9 +88,9 @@ export class ArchiveManager {
let name, contents; let name, contents;
if (item.content_type === ContentType.Note) { if (item.content_type === ContentType.Note) {
const note = item as SNNote; const note = item as BackupFileDecryptedContextualPayload<NoteContent>;
name = (note.content as PayloadContent).title; name = note.content.title;
contents = (note.content as PayloadContent).text; contents = note.content.text;
} else { } else {
name = item.content_type; name = item.content_type;
contents = JSON.stringify(item.content, null, 2); contents = JSON.stringify(item.content, null, 2);

View File

@@ -8,13 +8,11 @@ import {
removeFromArray, removeFromArray,
DesktopManagerInterface, DesktopManagerInterface,
PayloadSource, PayloadSource,
EncryptionIntent, InternalEventBus,
CreateIntentPayloadFromObject,
} from '@standardnotes/snjs'; } from '@standardnotes/snjs';
import { WebAppEvent, WebApplication } from '@/ui_models/application'; import { WebAppEvent, WebApplication } from '@/ui_models/application';
import { isDesktopApplication } from '@/utils'; import { isDesktopApplication } from '@/utils';
import { Bridge, ElectronDesktopCallbacks } from './bridge'; import { Bridge, ElectronDesktopCallbacks } from './bridge';
import { InternalEventBus } from '@standardnotes/services';
/** /**
* An interface used by the Desktop application to interact with SN * An interface used by the Desktop application to interact with SN
@@ -68,10 +66,7 @@ export class DesktopManager
* Keys are not passed into ItemParams, so the result is not encrypted * Keys are not passed into ItemParams, so the result is not encrypted
*/ */
convertComponentForTransmission(component: SNComponent) { convertComponentForTransmission(component: SNComponent) {
return CreateIntentPayloadFromObject( return component.payloadRepresentation().ejected();
component.payloadRepresentation(),
EncryptionIntent.FileDecrypted
);
} }
// All `components` should be installed // All `components` should be installed
@@ -84,11 +79,7 @@ export class DesktopManager
return this.convertComponentForTransmission(component); return this.convertComponentForTransmission(component);
}) })
).then((payloads) => { ).then((payloads) => {
this.bridge.syncComponents( this.bridge.syncComponents(payloads);
payloads.filter(
(payload) => !payload.errorDecrypting && !payload.waitingForKey
)
);
}); });
} }
@@ -137,7 +128,7 @@ export class DesktopManager
return; return;
} }
const updatedComponent = await this.application.mutator.changeAndSaveItem( const updatedComponent = await this.application.mutator.changeAndSaveItem(
component.uuid, component,
(m) => { (m) => {
const mutator = m as ComponentMutator; const mutator = m as ComponentMutator;
if (error) { if (error) {

View File

@@ -1,7 +1,6 @@
import { WebApplication } from '@/ui_models/application'; import { WebApplication } from '@/ui_models/application';
import { import {
StorageValueModes, StorageValueModes,
EncryptionIntent,
ApplicationService, ApplicationService,
SNTheme, SNTheme,
removeFromArray, removeFromArray,
@@ -11,9 +10,9 @@ import {
FeatureStatus, FeatureStatus,
PayloadSource, PayloadSource,
PrefKey, PrefKey,
CreateIntentPayloadFromObject, CreateDecryptedLocalStorageContextPayload,
InternalEventBus,
} from '@standardnotes/snjs'; } from '@standardnotes/snjs';
import { InternalEventBus } from '@standardnotes/services';
const CACHED_THEMES_KEY = 'cachedThemes'; const CACHED_THEMES_KEY = 'cachedThemes';
@@ -156,9 +155,9 @@ export class ThemeManager extends ApplicationService {
const preference = prefersDarkColorScheme const preference = prefersDarkColorScheme
? PrefKey.AutoDarkThemeIdentifier ? PrefKey.AutoDarkThemeIdentifier
: PrefKey.AutoLightThemeIdentifier; : PrefKey.AutoLightThemeIdentifier;
const themes = this.application.items.getDisplayableItems( const themes = this.application.items.getDisplayableItems<SNTheme>(
ContentType.Theme ContentType.Theme
) as SNTheme[]; );
const enableDefaultTheme = () => { const enableDefaultTheme = () => {
const activeTheme = themes.find( const activeTheme = themes.find(
@@ -206,7 +205,8 @@ export class ThemeManager extends ApplicationService {
this.unregisterStream = this.application.streamItems( this.unregisterStream = this.application.streamItems(
ContentType.Theme, ContentType.Theme,
(items, source) => { ({ changed, inserted, source }) => {
const items = changed.concat(inserted);
const themes = items as SNTheme[]; const themes = items as SNTheme[];
for (const theme of themes) { for (const theme of themes) {
if (theme.active) { if (theme.active) {
@@ -275,10 +275,7 @@ export class ThemeManager extends ApplicationService {
const mapped = themes.map((theme) => { const mapped = themes.map((theme) => {
const payload = theme.payloadRepresentation(); const payload = theme.payloadRepresentation();
return CreateIntentPayloadFromObject( return CreateDecryptedLocalStorageContextPayload(payload);
payload,
EncryptionIntent.LocalStorageDecrypted
);
}); });
return this.application.setValue( return this.application.setValue(

View File

@@ -6,7 +6,12 @@ import {
observable, observable,
runInAction, runInAction,
} from 'mobx'; } from 'mobx';
import { ApplicationEvent, ContentType, SNItem } from '@standardnotes/snjs'; import {
ApplicationEvent,
ContentType,
SNNote,
SNTag,
} from '@standardnotes/snjs';
import { WebApplication } from '@/ui_models/application'; import { WebApplication } from '@/ui_models/application';
import { AccountMenuPane } from '@/components/AccountMenu'; import { AccountMenuPane } from '@/components/AccountMenu';
@@ -23,7 +28,7 @@ export class AccountMenuState {
otherSessionsSignOut = false; otherSessionsSignOut = false;
server: string | undefined = undefined; server: string | undefined = undefined;
enableServerOption = false; enableServerOption = false;
notesAndTags: SNItem[] = []; notesAndTags: (SNNote | SNTag)[] = [];
isEncryptionEnabled = false; isEncryptionEnabled = false;
encryptionStatusString = ''; encryptionStatusString = '';
isBackupEncrypted = false; isBackupEncrypted = false;

View File

@@ -8,13 +8,14 @@ import {
ContentType, ContentType,
DeinitSource, DeinitSource,
NoteViewController, NoteViewController,
PayloadSource,
PrefKey, PrefKey,
SNNote, SNNote,
SmartView, SmartView,
SNTag, SNTag,
SystemViewId, SystemViewId,
removeFromArray, removeFromArray,
PayloadSource,
Uuid,
} from '@standardnotes/snjs'; } from '@standardnotes/snjs';
import { import {
action, action,
@@ -276,9 +277,9 @@ export class AppState {
this.application.noteControllerGroup.closeAllNoteViews(); this.application.noteControllerGroup.closeAllNoteViews();
} }
noteControllerForNote(note: SNNote) { noteControllerForNote(uuid: Uuid) {
for (const controller of this.getNoteControllers()) { for (const controller of this.getNoteControllers()) {
if (controller.note.uuid === note.uuid) { if (controller.note.uuid === uuid) {
return controller; return controller;
} }
} }
@@ -328,43 +329,61 @@ export class AppState {
} }
streamNotesAndTags() { streamNotesAndTags() {
this.application.streamItems( this.application.streamItems<SNNote | SNTag>(
[ContentType.Note, ContentType.Tag], [ContentType.Note, ContentType.Tag],
async (items, source) => { async ({ changed, inserted, removed, source }) => {
if (
![PayloadSource.PreSyncSave, PayloadSource.RemoteRetrieved].includes(
source
)
) {
return;
}
const removedNotes = removed.filter(
(i) => i.content_type === ContentType.Note
);
for (const removedNote of removedNotes) {
const noteController = this.noteControllerForNote(removedNote.uuid);
if (noteController) {
this.closeNoteController(noteController);
}
}
const changedOrInserted = [...changed, ...inserted].filter(
(i) => i.content_type === ContentType.Note
);
const selectedTag = this.tags.selected; const selectedTag = this.tags.selected;
/** Close any note controllers for deleted/trashed/archived notes */ for (const note of changedOrInserted) {
if (source === PayloadSource.PreSyncSave) { const noteController = this.noteControllerForNote(note.uuid);
const notes = items.filter( if (!noteController) {
(candidate) => candidate.content_type === ContentType.Note continue;
) as SNNote[]; }
for (const note of notes) {
const noteController = this.noteControllerForNote(note); const isBrowswingTrashedNotes =
if (!noteController) { selectedTag instanceof SmartView &&
continue; selectedTag.uuid === SystemViewId.TrashedNotes;
}
if (note.deleted) { const isBrowsingArchivedNotes =
this.closeNoteController(noteController); selectedTag instanceof SmartView &&
} else if ( selectedTag.uuid === SystemViewId.ArchivedNotes;
note.trashed &&
!( if (
selectedTag instanceof SmartView && note.trashed &&
selectedTag.uuid === SystemViewId.TrashedNotes !isBrowswingTrashedNotes &&
) && !this.searchOptions.includeTrashed
!this.searchOptions.includeTrashed ) {
) { this.closeNoteController(noteController);
this.closeNoteController(noteController); } else if (
} else if ( note.archived &&
note.archived && !isBrowsingArchivedNotes &&
!( !this.searchOptions.includeArchived &&
selectedTag instanceof SmartView && !this.application.getPreference(PrefKey.NotesShowArchived, false)
selectedTag.uuid === SystemViewId.ArchivedNotes ) {
) && this.closeNoteController(noteController);
!this.searchOptions.includeArchived &&
!this.application.getPreference(PrefKey.NotesShowArchived, false)
) {
this.closeNoteController(noteController);
}
} }
} }
} }
@@ -436,11 +455,9 @@ export class AppState {
/** Returns the tags that are referncing this note */ /** Returns the tags that are referncing this note */
public getNoteTags(note: SNNote) { public getNoteTags(note: SNNote) {
return this.application.items return this.application.items.itemsReferencingItem(note).filter((ref) => {
.itemsReferencingItem(note.uuid) return ref.content_type === ContentType.Tag;
.filter((ref) => { }) as SNTag[];
return ref.content_type === ContentType.Tag;
}) as SNTag[];
} }
panelDidResize(name: string, collapsed: boolean) { panelDidResize(name: string, collapsed: boolean) {

View File

@@ -215,7 +215,7 @@ 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) {
await this.application.mutator.changeItem(tag.uuid, (mutator) => { await this.application.mutator.changeItem(tag, (mutator) => {
mutator.removeItemAsRelationship(activeNote); mutator.removeItemAsRelationship(activeNote);
}); });
this.application.sync.sync(); this.application.sync.sync();

View File

@@ -60,15 +60,22 @@ export class NotesState {
}); });
appEventListeners.push( appEventListeners.push(
application.streamItems(ContentType.Note, (notes) => { application.streamItems<SNNote>(
runInAction(() => { ContentType.Note,
for (const note of notes) { ({ changed, inserted, removed }) => {
if (this.selectedNotes[note.uuid]) { runInAction(() => {
this.selectedNotes[note.uuid] = note as SNNote; for (const removedNote of removed) {
delete this.selectedNotes[removedNote.uuid];
} }
}
}); for (const note of [...changed, ...inserted]) {
}) if (this.selectedNotes[note.uuid]) {
this.selectedNotes[note.uuid] = note;
}
}
});
}
)
); );
} }
@@ -85,9 +92,8 @@ export class NotesState {
} }
private async selectNotesRange(selectedNote: SNNote): Promise<void> { private async selectNotesRange(selectedNote: SNNote): Promise<void> {
const notes = this.application.items.getDisplayableItems( const notes = this.application.items.getDisplayableNotes();
ContentType.Note
) as SNNote[];
const lastSelectedNoteIndex = notes.findIndex( const lastSelectedNoteIndex = notes.findIndex(
(note) => note.uuid == this.lastSelectedNote?.uuid (note) => note.uuid == this.lastSelectedNote?.uuid
); );
@@ -179,10 +185,6 @@ export class NotesState {
this.appState.noteTags.reloadTags(); this.appState.noteTags.reloadTags();
await this.onActiveEditorChanged(); await this.onActiveEditorChanged();
if (note.waitingForKey) {
this.application.presentKeyRecoveryWizard();
}
} }
setContextMenuOpen(open: boolean): void { setContextMenuOpen(open: boolean): void {
@@ -263,7 +265,7 @@ export class NotesState {
mutate: (mutator: NoteMutator) => void mutate: (mutator: NoteMutator) => void
): Promise<void> { ): Promise<void> {
await this.application.mutator.changeItems( await this.application.mutator.changeItems(
Object.keys(this.selectedNotes), Object.values(this.selectedNotes),
mutate, mutate,
false false
); );
@@ -399,7 +401,7 @@ export class NotesState {
async toggleGlobalSpellcheckForNote(note: SNNote) { async toggleGlobalSpellcheckForNote(note: SNNote) {
await this.application.mutator.changeItem<NoteMutator>( await this.application.mutator.changeItem<NoteMutator>(
note.uuid, note,
(mutator) => { (mutator) => {
mutator.toggleSpellcheck(); mutator.toggleSpellcheck();
}, },
@@ -410,11 +412,11 @@ export class NotesState {
async addTagToSelectedNotes(tag: SNTag): Promise<void> { async addTagToSelectedNotes(tag: SNTag): Promise<void> {
const selectedNotes = Object.values(this.selectedNotes); const selectedNotes = Object.values(this.selectedNotes);
const parentChainTags = this.application.items.getTagParentChain(tag.uuid); const parentChainTags = this.application.items.getTagParentChain(tag);
const tagsToAdd = [...parentChainTags, tag]; const tagsToAdd = [...parentChainTags, tag];
await Promise.all( await Promise.all(
tagsToAdd.map(async (tag) => { tagsToAdd.map(async (tag) => {
await this.application.mutator.changeItem(tag.uuid, (mutator) => { await this.application.mutator.changeItem(tag, (mutator) => {
for (const note of selectedNotes) { for (const note of selectedNotes) {
mutator.addItemAsRelationship(note); mutator.addItemAsRelationship(note);
} }
@@ -426,7 +428,7 @@ 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);
await this.application.mutator.changeItem(tag.uuid, (mutator) => { await this.application.mutator.changeItem(tag, (mutator) => {
for (const note of selectedNotes) { for (const note of selectedNotes) {
mutator.removeItemAsRelationship(note); mutator.removeItemAsRelationship(note);
} }

View File

@@ -1,6 +1,7 @@
import { import {
ApplicationEvent, ApplicationEvent,
CollectionSort, CollectionSort,
CollectionSortProperty,
ContentType, ContentType,
findInArray, findInArray,
NotesDisplayCriteria, NotesDisplayCriteria,
@@ -28,7 +29,7 @@ const ELEMENT_ID_SEARCH_BAR = 'search-bar';
const ELEMENT_ID_SCROLL_CONTAINER = 'notes-scrollable'; const ELEMENT_ID_SCROLL_CONTAINER = 'notes-scrollable';
export type DisplayOptions = { export type DisplayOptions = {
sortBy: CollectionSort; sortBy: CollectionSortProperty;
sortReverse: boolean; sortReverse: boolean;
hidePinned: boolean; hidePinned: boolean;
showArchived: boolean; showArchived: boolean;
@@ -73,18 +74,20 @@ export class NotesViewState {
this.resetPagination(); this.resetPagination();
appObservers.push( appObservers.push(
application.streamItems(ContentType.Note, () => { application.streamItems<SNNote>(ContentType.Note, () => {
this.reloadNotes(); this.reloadNotes();
const activeNote = this.appState.notes.activeNoteController?.note; const activeNote = this.appState.notes.activeNoteController?.note;
if (this.application.getAppState().notes.selectedNotesCount < 2) { if (this.application.getAppState().notes.selectedNotesCount < 2) {
if (activeNote) { if (activeNote) {
const discarded = activeNote.deleted || activeNote.trashed; const browsingTrashedNotes =
this.appState.selectedTag instanceof SmartView &&
this.appState.selectedTag?.uuid === SystemViewId.TrashedNotes;
if ( if (
discarded && activeNote.trashed &&
!( !browsingTrashedNotes &&
this.appState.selectedTag instanceof SmartView &&
this.appState.selectedTag?.uuid === SystemViewId.TrashedNotes
) &&
!this.appState?.searchOptions.includeTrashed !this.appState?.searchOptions.includeTrashed
) { ) {
this.selectNextOrCreateNew(); this.selectNextOrCreateNew();
@@ -96,19 +99,24 @@ export class NotesViewState {
} }
} }
}), }),
application.streamItems([ContentType.Tag], async (items) => {
const tags = items as SNTag[]; application.streamItems<SNTag>(
/** A tag could have changed its relationships, so we need to reload the filter */ [ContentType.Tag],
this.reloadNotesDisplayOptions(); async ({ changed, inserted }) => {
this.reloadNotes(); const tags = [...changed, ...inserted];
if ( /** A tag could have changed its relationships, so we need to reload the filter */
this.appState.selectedTag && this.reloadNotesDisplayOptions();
findInArray(tags, 'uuid', this.appState.selectedTag.uuid) this.reloadNotes();
) {
/** Tag title could have changed */ if (
this.reloadPanelTitle(); this.appState.selectedTag &&
findInArray(tags, 'uuid', this.appState.selectedTag.uuid)
) {
/** Tag title could have changed */
this.reloadPanelTitle();
}
} }
}), ),
application.addEventObserver(async () => { application.addEventObserver(async () => {
this.reloadPreferences(); this.reloadPreferences();
}, ApplicationEvent.PreferencesChanged), }, ApplicationEvent.PreferencesChanged),
@@ -223,9 +231,7 @@ export class NotesViewState {
if (!tag) { if (!tag) {
return; return;
} }
const notes = this.application.items.getDisplayableItems( const notes = this.application.items.getDisplayableNotes();
ContentType.Note
) as SNNote[];
const renderedNotes = notes.slice(0, this.notesToDisplay); const renderedNotes = notes.slice(0, this.notesToDisplay);
this.notes = notes; this.notes = notes;
@@ -250,7 +256,7 @@ export class NotesViewState {
} }
const criteria = NotesDisplayCriteria.Create({ const criteria = NotesDisplayCriteria.Create({
sortProperty: this.displayOptions.sortBy as CollectionSort, sortProperty: this.displayOptions.sortBy,
sortDirection: this.displayOptions.sortReverse ? 'asc' : 'dsc', sortDirection: this.displayOptions.sortReverse ? 'asc' : 'dsc',
tags: tag instanceof SNTag ? [tag] : [], tags: tag instanceof SNTag ? [tag] : [],
views: tag instanceof SmartView ? [tag] : [], views: tag instanceof SmartView ? [tag] : [],
@@ -498,7 +504,7 @@ export class NotesViewState {
handleEditorChange = async () => { handleEditorChange = async () => {
const activeNote = this.appState.getActiveNoteController()?.note; const activeNote = this.appState.getActiveNoteController()?.note;
if (activeNote && activeNote.conflictOf) { if (activeNote && activeNote.conflictOf) {
this.application.mutator.changeAndSaveItem(activeNote.uuid, (mutator) => { this.application.mutator.changeAndSaveItem(activeNote, (mutator) => {
mutator.conflictOf = undefined; mutator.conflictOf = undefined;
}); });
} }

View File

@@ -14,6 +14,7 @@ import {
TagMutator, TagMutator,
UuidString, UuidString,
isSystemView, isSystemView,
FindItem,
} from '@standardnotes/snjs'; } from '@standardnotes/snjs';
import { import {
action, action,
@@ -29,11 +30,9 @@ import { FeaturesState, SMART_TAGS_FEATURE_NAME } from './features_state';
type AnyTag = SNTag | SmartView; type AnyTag = SNTag | SmartView;
const rootTags = (application: SNApplication): SNTag[] => { const rootTags = (application: SNApplication): SNTag[] => {
const hasNoParent = (tag: SNTag) => !application.items.getTagParent(tag.uuid); const hasNoParent = (tag: SNTag) => !application.items.getTagParent(tag);
const allTags = application.items.getDisplayableItems( const allTags = application.items.getDisplayableItems<SNTag>(ContentType.Tag);
ContentType.Tag
) as SNTag[];
const rootTags = allTags.filter(hasNoParent); const rootTags = allTags.filter(hasNoParent);
return rootTags; return rootTags;
@@ -44,10 +43,10 @@ const tagSiblings = (application: SNApplication, tag: SNTag): SNTag[] => {
tags.filter((other) => other.uuid !== tag.uuid); tags.filter((other) => other.uuid !== tag.uuid);
const isTemplateTag = application.items.isTemplateItem(tag); const isTemplateTag = application.items.isTemplateItem(tag);
const parentTag = !isTemplateTag && application.items.getTagParent(tag.uuid); const parentTag = !isTemplateTag && application.items.getTagParent(tag);
if (parentTag) { if (parentTag) {
const siblingsAndTag = application.items.getTagChildren(parentTag.uuid); const siblingsAndTag = application.items.getTagChildren(parentTag);
return withoutCurrentTag(siblingsAndTag); return withoutCurrentTag(siblingsAndTag);
} }
@@ -148,24 +147,24 @@ export class TagsState {
appEventListeners.push( appEventListeners.push(
this.application.streamItems( this.application.streamItems(
[ContentType.Tag, ContentType.SmartView], [ContentType.Tag, ContentType.SmartView],
(items) => { ({ changed, removed }) => {
runInAction(() => { runInAction(() => {
this.tags = this.application.items.getDisplayableItems<SNTag>( this.tags = this.application.items.getDisplayableItems<SNTag>(
ContentType.Tag ContentType.Tag
); );
this.smartViews = this.application.items.getSmartViews(); this.smartViews = this.application.items.getSmartViews();
const selectedTag = this.selected_; const selectedTag = this.selected_;
if (selectedTag && !isSystemView(selectedTag as SmartView)) { if (selectedTag && !isSystemView(selectedTag as SmartView)) {
const matchingTag = items.find( if (FindItem(removed, selectedTag.uuid)) {
(candidate) => candidate.uuid === selectedTag.uuid this.selected_ = this.smartViews[0];
) as AnyTag; }
if (matchingTag) {
if (matchingTag.deleted) { const updated = FindItem(changed, selectedTag.uuid);
this.selected_ = this.smartViews[0]; if (updated) {
} else { this.selected_ = updated as AnyTag;
this.selected_ = matchingTag;
}
} }
} else { } else {
this.selected_ = this.smartViews[0]; this.selected_ = this.smartViews[0];
@@ -202,7 +201,7 @@ export class TagsState {
title title
)) as SNTag; )) as SNTag;
const futureSiblings = this.application.items.getTagChildren(parent.uuid); const futureSiblings = this.application.items.getTagChildren(parent);
if (!isValidFutureSiblings(this.application, futureSiblings, createdTag)) { if (!isValidFutureSiblings(this.application, futureSiblings, createdTag)) {
this.setAddingSubtagTo(undefined); this.setAddingSubtagTo(undefined);
@@ -319,7 +318,7 @@ export class TagsState {
return []; return [];
} }
const children = this.application.items.getTagChildren(tag.uuid); const children = this.application.items.getTagChildren(tag);
const childrenUuids = children.map((childTag) => childTag.uuid); const childrenUuids = children.map((childTag) => childTag.uuid);
const childrenTags = this.tags.filter((tag) => const childrenTags = this.tags.filter((tag) =>
@@ -328,8 +327,8 @@ export class TagsState {
return childrenTags; return childrenTags;
} }
isValidTagParent(parentUuid: UuidString, tagUuid: UuidString): boolean { isValidTagParent(parent: SNTag, tag: SNTag): boolean {
return this.application.items.isValidTagParent(parentUuid, tagUuid); return this.application.items.isValidTagParent(parent, tag);
} }
public hasParent(tagUuid: UuidString): boolean { public hasParent(tagUuid: UuidString): boolean {
@@ -343,7 +342,7 @@ export class TagsState {
): Promise<void> { ): Promise<void> {
const tag = this.application.items.findItem(tagUuid) as SNTag; const tag = this.application.items.findItem(tagUuid) as SNTag;
const currentParent = this.application.items.getTagParent(tag.uuid); const currentParent = this.application.items.getTagParent(tag);
const currentParentUuid = currentParent?.uuid; const currentParentUuid = currentParent?.uuid;
if (currentParentUuid === futureParentUuid) { if (currentParentUuid === futureParentUuid) {
@@ -361,9 +360,8 @@ export class TagsState {
} }
await this.application.mutator.unsetTagParent(tag); await this.application.mutator.unsetTagParent(tag);
} else { } else {
const futureSiblings = this.application.items.getTagChildren( const futureSiblings =
futureParent.uuid this.application.items.getTagChildren(futureParent);
);
if (!isValidFutureSiblings(this.application, futureSiblings, tag)) { if (!isValidFutureSiblings(this.application, futureSiblings, tag)) {
return; return;
} }
@@ -374,9 +372,7 @@ export class TagsState {
} }
get rootTags(): SNTag[] { get rootTags(): SNTag[] {
return this.tags.filter( return this.tags.filter((tag) => !this.application.items.getTagParent(tag));
(tag) => !this.application.items.getTagParent(tag.uuid)
);
} }
get tagsCount(): number { get tagsCount(): number {
@@ -401,7 +397,7 @@ export class TagsState {
public set selected(tag: AnyTag | undefined) { public set selected(tag: AnyTag | undefined) {
if (tag && tag.conflictOf) { if (tag && tag.conflictOf) {
this.application.mutator.changeAndSaveItem(tag.uuid, (mutator) => { this.application.mutator.changeAndSaveItem(tag, (mutator) => {
mutator.conflictOf = undefined; mutator.conflictOf = undefined;
}); });
} }
@@ -417,12 +413,9 @@ export class TagsState {
} }
public setExpanded(tag: SNTag, expanded: boolean) { public setExpanded(tag: SNTag, expanded: boolean) {
this.application.mutator.changeAndSaveItem<TagMutator>( this.application.mutator.changeAndSaveItem<TagMutator>(tag, (mutator) => {
tag.uuid, mutator.expanded = expanded;
(mutator) => { });
mutator.expanded = expanded;
}
);
} }
public get selectedUuid(): UuidString | undefined { public get selectedUuid(): UuidString | undefined {
@@ -527,7 +520,7 @@ export class TagsState {
}); });
} else { } else {
await this.application.mutator.changeAndSaveItem<TagMutator>( await this.application.mutator.changeAndSaveItem<TagMutator>(
tag.uuid, tag,
(mutator) => { (mutator) => {
mutator.title = newTitle; mutator.title = newTitle;
} }
@@ -563,9 +556,7 @@ export class TagsState {
} }
public get hasAtLeastOneFolder(): boolean { public get hasAtLeastOneFolder(): boolean {
return this.tags.some( return this.tags.some((tag) => !!this.application.items.getTagParent(tag));
(tag) => !!this.application.items.getTagParent(tag.uuid)
);
} }
} }

View File

@@ -75,15 +75,16 @@ export class WebApplication extends SNApplication {
if (source === DeinitSource.AppGroupUnload) { if (source === DeinitSource.AppGroupUnload) {
this.getThemeService().deactivateAllThemes(); this.getThemeService().deactivateAllThemes();
} }
for (const service of Object.values(this.webServices)) { for (const service of Object.values(this.webServices)) {
if ('deinit' in service) { if ('deinit' in service) {
service.deinit?.(source); service.deinit?.(source);
} }
(service as any).application = undefined; (service as any).application = undefined;
} }
this.webServices = {} as WebServices; this.webServices = {} as WebServices;
this.noteControllerGroup.deinit(); this.noteControllerGroup.deinit();
this.iconsController.deinit();
this.webEventObservers.length = 0; this.webEventObservers.length = 0;
if (source === DeinitSource.SignOut) { if (source === DeinitSource.SignOut) {

View File

@@ -6,6 +6,7 @@ import {
DeviceInterface, DeviceInterface,
Platform, Platform,
Runtime, Runtime,
InternalEventBus,
} from '@standardnotes/snjs'; } from '@standardnotes/snjs';
import { AppState } from '@/ui_models/app_state'; import { AppState } from '@/ui_models/app_state';
import { Bridge } from '@/services/bridge'; import { Bridge } from '@/services/bridge';
@@ -16,7 +17,6 @@ import { IOService } from '@/services/ioService';
import { AutolockService } from '@/services/autolock_service'; import { AutolockService } from '@/services/autolock_service';
import { StatusManager } from '@/services/statusManager'; import { StatusManager } from '@/services/statusManager';
import { ThemeManager } from '@/services/themeManager'; import { ThemeManager } from '@/services/themeManager';
import { InternalEventBus } from '@standardnotes/services';
export class ApplicationGroup extends SNApplicationGroup { export class ApplicationGroup extends SNApplicationGroup {
constructor( constructor(

View File

@@ -1,6 +1,6 @@
{ {
"name": "standard-notes-web", "name": "standard-notes-web",
"version": "3.14.0", "version": "3.15.0",
"license": "AGPL-3.0-or-later", "license": "AGPL-3.0-or-later",
"repository": { "repository": {
"type": "git", "type": "git",
@@ -26,11 +26,6 @@
"@babel/plugin-transform-react-jsx": "^7.17.3", "@babel/plugin-transform-react-jsx": "^7.17.3",
"@babel/preset-env": "^7.16.11", "@babel/preset-env": "^7.16.11",
"@babel/preset-typescript": "^7.16.7", "@babel/preset-typescript": "^7.16.7",
"@reach/disclosure": "^0.16.2",
"@reach/visually-hidden": "^0.16.0",
"@standardnotes/responses": "1.5.1",
"@standardnotes/services": "1.7.1",
"@standardnotes/stylekit": "5.20.0",
"@svgr/webpack": "^6.2.1", "@svgr/webpack": "^6.2.1",
"@types/jest": "^27.4.1", "@types/jest": "^27.4.1",
"@types/react": "^17.0.42", "@types/react": "^17.0.42",
@@ -65,26 +60,27 @@
"webpack-merge": "^5.8.0" "webpack-merge": "^5.8.0"
}, },
"dependencies": { "dependencies": {
"@reach/alert": "^0.16.0",
"@reach/alert-dialog": "^0.16.2", "@reach/alert-dialog": "^0.16.2",
"@reach/alert": "^0.16.0",
"@reach/checkbox": "^0.16.0", "@reach/checkbox": "^0.16.0",
"@reach/dialog": "^0.16.2", "@reach/dialog": "^0.16.2",
"@reach/disclosure": "^0.16.2",
"@reach/listbox": "^0.16.2", "@reach/listbox": "^0.16.2",
"@reach/tooltip": "^0.16.2", "@reach/tooltip": "^0.16.2",
"@reach/visually-hidden": "^0.16.0",
"@standardnotes/components": "1.7.14", "@standardnotes/components": "1.7.14",
"@standardnotes/features": "1.36.3", "@standardnotes/filepicker": "1.10.5",
"@standardnotes/filepicker": "1.10.4", "@standardnotes/sncrypto-web": "1.8.2",
"@standardnotes/settings": "1.13.2", "@standardnotes/snjs": "2.94.3",
"@standardnotes/sncrypto-web": "1.8.1", "@standardnotes/stylekit": "5.21.3",
"@standardnotes/snjs": "2.93.3",
"@zip.js/zip.js": "^2.4.7", "@zip.js/zip.js": "^2.4.7",
"mobx": "^6.5.0",
"mobx-react-lite": "^3.3.0", "mobx-react-lite": "^3.3.0",
"mobx": "^6.5.0",
"preact": "^10.6.6", "preact": "^10.6.6",
"qrcode.react": "^2.0.0", "qrcode.react": "^2.0.0",
"react-dnd": "^15.1.1",
"react-dnd-html5-backend": "^15.1.2", "react-dnd-html5-backend": "^15.1.2",
"react-dnd-touch-backend": "^15.1.1" "react-dnd-touch-backend": "^15.1.1",
"react-dnd": "^15.1.1"
}, },
"lint-staged": { "lint-staged": {
"app/**/*.{js,ts,jsx,tsx}": "eslint --cache --fix", "app/**/*.{js,ts,jsx,tsx}": "eslint --cache --fix",

196
yarn.lock
View File

@@ -2388,132 +2388,122 @@
dependencies: dependencies:
"@sinonjs/commons" "^1.7.0" "@sinonjs/commons" "^1.7.0"
"@standardnotes/auth@^3.18.3": "@standardnotes/auth@^3.18.5":
version "3.18.3" version "3.18.5"
resolved "https://registry.yarnpkg.com/@standardnotes/auth/-/auth-3.18.3.tgz#2c2aa19ad56fc5f3f286dbef56bd8496d1e5380f" resolved "https://registry.yarnpkg.com/@standardnotes/auth/-/auth-3.18.5.tgz#11087e0bc31c42e489a7f546d317bbbcbd48d573"
integrity sha512-crdpVHJpnY574IIwBM1QcqNMULyvQ8nOnkH4DhFNcfWF7R+A+S4lMg2KxN9bR+j2gM/WWhbfcU8owJrz1+vsqA== integrity sha512-NSeU3A9iDyZFLLfv6jOyaweykMbjUUe0XoZo6lVifQucsRW0VJ4R6m3aeXqx6/zDwmHIBqVVzrX2bqQ7r2s9SA==
dependencies: dependencies:
"@standardnotes/common" "^1.19.1" "@standardnotes/common" "^1.19.3"
jsonwebtoken "^8.5.1" jsonwebtoken "^8.5.1"
"@standardnotes/common@^1.19.1": "@standardnotes/common@^1.19.3":
version "1.19.1" version "1.19.3"
resolved "https://registry.yarnpkg.com/@standardnotes/common/-/common-1.19.1.tgz#45f0837b40bc1c583c22552a53429fe26c5ef498" resolved "https://registry.yarnpkg.com/@standardnotes/common/-/common-1.19.3.tgz#ae2ca493492eb5e0d9663abf736a9d7a26365c52"
integrity sha512-O114ZdOvur6U1mmiPfvEo/TZjKRxHWBsAAAn+XTtS70E+2VqgvCwgiYT6bG1oUcoyrIiCdRPPyiTC/UPF4gkXg== integrity sha512-nMqH+grkIgnODr5EncbG9yHqIxSBHLVTiAb+NZ2EvkhLBiuVhP2UEDNs8KcZKfgNVGGDIHQbjEXZKGog9J6gZw==
"@standardnotes/components@1.7.14": "@standardnotes/components@1.7.14":
version "1.7.14" version "1.7.14"
resolved "https://registry.yarnpkg.com/@standardnotes/components/-/components-1.7.14.tgz#ddd5b4d5787d3f90a4e1a88cfd95995f9267b1d1" resolved "https://registry.yarnpkg.com/@standardnotes/components/-/components-1.7.14.tgz#ddd5b4d5787d3f90a4e1a88cfd95995f9267b1d1"
integrity sha512-NDzP8/lmzgFBjxfmaE3OSOjPfozs3vednFfrjmjri5kCXlfClEISL6b/kh6B6wv/x9DIFveOsRj2Lrov+5IXdw== integrity sha512-NDzP8/lmzgFBjxfmaE3OSOjPfozs3vednFfrjmjri5kCXlfClEISL6b/kh6B6wv/x9DIFveOsRj2Lrov+5IXdw==
"@standardnotes/domain-events@^2.26.6": "@standardnotes/domain-events@^2.26.9":
version "2.26.6" version "2.26.9"
resolved "https://registry.yarnpkg.com/@standardnotes/domain-events/-/domain-events-2.26.6.tgz#6d19099b147f60dfe69a458463aa81759846507a" resolved "https://registry.yarnpkg.com/@standardnotes/domain-events/-/domain-events-2.26.9.tgz#09d3ac547e263ff957a9a645a6c1f0039aa85ccd"
integrity sha512-CiF7MlFlZgwzMbOkcHGOy8FL1iGlSff9s7eUOlgOcYoidolFOF8HHJJn+d8+iwEvwANDwMJmrrGcFf5X9f0wzA== integrity sha512-iQCiCdLpMw3Yp3Z9q7GU9Z48tK2jAMI32VjsQtbyqOmjR+aVmo4e2oGyshm/2+5ymKUiG7xlx3Hl63RlQbGf1A==
dependencies: dependencies:
"@standardnotes/auth" "^3.18.3" "@standardnotes/auth" "^3.18.5"
"@standardnotes/features" "^1.36.3" "@standardnotes/features" "^1.37.2"
"@standardnotes/encryption@^1.1.3": "@standardnotes/encryption@^1.2.2":
version "1.1.3" version "1.2.2"
resolved "https://registry.yarnpkg.com/@standardnotes/encryption/-/encryption-1.1.3.tgz#7554a6268d8f274c59bb9dd55117ba7dffefb5cd" resolved "https://registry.yarnpkg.com/@standardnotes/encryption/-/encryption-1.2.2.tgz#27325dff46875871c26e208d77651532573a7afc"
integrity sha512-0oelxlDMCR8I6l33R/CsdU9z25R+kCvYLt0FbypPCRaDOMTcjITR1R+VsnKznw/GbcMxcD1TTnDGRRQyLVmDmw== integrity sha512-B9RjWltLuURg6qUdFTQZeQRKX2DoP6VL/6kS2Ay3ZkrEEcCNvxeuqr9yvXbZn2kKS0dUDfzfbYWOvoVxyyUwYA==
dependencies: dependencies:
"@standardnotes/models" "^1.1.1" "@standardnotes/models" "^1.2.2"
"@standardnotes/payloads" "^1.5.1" "@standardnotes/responses" "^1.6.2"
"@standardnotes/responses" "^1.5.1" "@standardnotes/services" "^1.8.2"
"@standardnotes/services" "^1.7.1"
"@standardnotes/features@1.36.3", "@standardnotes/features@^1.36.3": "@standardnotes/features@^1.37.2":
version "1.36.3" version "1.37.2"
resolved "https://registry.yarnpkg.com/@standardnotes/features/-/features-1.36.3.tgz#c3a2c2451fe2f036c5c94e51e86c804872028763" resolved "https://registry.yarnpkg.com/@standardnotes/features/-/features-1.37.2.tgz#bedae2935a5659aa1fd30849e47ed167d45a7d3a"
integrity sha512-/38iTb22NULjtL8MitUeqsZdGwZgyP6t8p2LPc5sLFmeyU/CgZ22sh55GKAW5P/fm/oWyBqK6zjsVvtIH6AQug== integrity sha512-kNUCRMuLPmjjxWvE/OjHAewGZzv5/NAsqw/cHj+O4sbhRBWSv1dq+UzLzUxnj2kUsKObPjKqYeqo6WrXOnl3BQ==
dependencies: dependencies:
"@standardnotes/auth" "^3.18.3" "@standardnotes/auth" "^3.18.5"
"@standardnotes/common" "^1.19.1" "@standardnotes/common" "^1.19.3"
"@standardnotes/filepicker@1.10.4": "@standardnotes/filepicker@1.10.5":
version "1.10.4" version "1.10.5"
resolved "https://registry.yarnpkg.com/@standardnotes/filepicker/-/filepicker-1.10.4.tgz#a69822381dcb7910ce7ce9040bb0466b3b950985" resolved "https://registry.yarnpkg.com/@standardnotes/filepicker/-/filepicker-1.10.5.tgz#28c7cc68cb3337940a52e19b1dea76af343f2852"
integrity sha512-BnfKi+HFXX1e/fprZ2awvcrBSQkVZs1VN/hk7e9hH8qhQtbktfURKEEyOZoQnDu14BMa1tSdAVTjhXpxlbRRcA== integrity sha512-Tl9mCW/qAzupOtQAYlbPHgZU16ljtRGV0awOHT7+uulPYoyKJJ4cqlKRzFaaONTAN6GpICEeSqidcB/lb5e5uQ==
"@standardnotes/models@^1.1.1": "@standardnotes/models@^1.2.2":
version "1.1.1" version "1.2.2"
resolved "https://registry.yarnpkg.com/@standardnotes/models/-/models-1.1.1.tgz#1a54253ded5c759ac8eeb1cb2878da73da2bd8a3" resolved "https://registry.yarnpkg.com/@standardnotes/models/-/models-1.2.2.tgz#d67086319ad12ec5f6d267f77d353a0bd3740983"
integrity sha512-tl6Yjv/hlPd1xARF4o8vHNPyfoV0d5V/IkdlPA0I2GQh7pLPxHirwD5E2+rRnv59HPiV4ws+XwLtnnPZaZ38bg== integrity sha512-o762wf4pOobk4GcHJR0+lFVJeP/TifiP4OCM9ko23wkE6d6tWpM5SyvOUyZga2NNp5He8Pkm06Oo1ObxBYaWIw==
dependencies: dependencies:
"@standardnotes/payloads" "^1.5.1" "@standardnotes/features" "^1.37.2"
"@standardnotes/responses" "^1.6.2"
"@standardnotes/utils" "^1.4.8"
"@standardnotes/payloads@^1.5.1": "@standardnotes/responses@^1.6.2":
version "1.5.1" version "1.6.2"
resolved "https://registry.yarnpkg.com/@standardnotes/payloads/-/payloads-1.5.1.tgz#f0cbe309721a14811d4b11cfce9a66d6fb9c2171" resolved "https://registry.yarnpkg.com/@standardnotes/responses/-/responses-1.6.2.tgz#665702c01bd25f10763ef0230fe9df775996c424"
integrity sha512-wqL31WPGFAQPMXICCf5Kxh3UOiaGbMu6ZE8cYmuZsMhti2h8FgIE04rcrzAh0/dSYtufrfHUnjhMmkPXZQAV2g== integrity sha512-w/SNFITk7aipmN1nahH456xe/xKGPp+/dqpKF+LDoSl6C+UZ17NOtSVP/Q4nVIvGy57QOD8OvN7inCpSrLCEyw==
dependencies: dependencies:
"@standardnotes/common" "^1.19.1" "@standardnotes/auth" "^3.18.5"
"@standardnotes/features" "^1.36.3" "@standardnotes/common" "^1.19.3"
"@standardnotes/utils" "^1.4.6" "@standardnotes/features" "^1.37.2"
"@standardnotes/responses@1.5.1", "@standardnotes/responses@^1.5.1": "@standardnotes/services@^1.8.2":
version "1.5.1" version "1.8.2"
resolved "https://registry.yarnpkg.com/@standardnotes/responses/-/responses-1.5.1.tgz#a88171e0834ad363ce2284256f8630f8adee4ae3" resolved "https://registry.yarnpkg.com/@standardnotes/services/-/services-1.8.2.tgz#3a95af1573636dc288dc4efd52de8568c2cd68fe"
integrity sha512-8BodIxtIfSG9IEzCSQy2dmB9RR1FeoKYBwOrO4MKyX1TpvVPlr0dtGUxWtbt20kI49FSLU9QDeWeexNiXcDSrA== integrity sha512-+iLVngtw0avyoUM4Sn0Kpmh99KTWYbhX/HiJLbnFoW5LJrqA2FarZRPUqYpiKuEcfcdZ4brmm5ipts45n1DXXw==
dependencies: dependencies:
"@standardnotes/auth" "^3.18.3" "@standardnotes/common" "^1.19.3"
"@standardnotes/common" "^1.19.1" "@standardnotes/models" "^1.2.2"
"@standardnotes/features" "^1.36.3" "@standardnotes/responses" "^1.6.2"
"@standardnotes/payloads" "^1.5.1" "@standardnotes/utils" "^1.4.8"
"@standardnotes/services@1.7.1", "@standardnotes/services@^1.7.1": "@standardnotes/settings@^1.13.3":
version "1.7.1" version "1.13.3"
resolved "https://registry.yarnpkg.com/@standardnotes/services/-/services-1.7.1.tgz#7c3f8f379478dfeeec3b9c87868a380213947533" resolved "https://registry.yarnpkg.com/@standardnotes/settings/-/settings-1.13.3.tgz#6f46927f5cb85e3070ccd2bc6a91deadf1b9ef9f"
integrity sha512-xW5C/nqUomwxnN2zSS22t845PPRceevUNqtwFtPzodeaDNZpCMwLvHPqJhbXW6cYuPeVbPGn4ify8EnrGqu+/w== integrity sha512-hLb5ba8qFgKdhSYqJLX+7L5K2ZPwoqGlMrDDQTph+rQe08FnDoupCzz+uFOO1EJITI3XzrbvSW79GQYV0/5AkA==
"@standardnotes/sncrypto-common@^1.7.5":
version "1.7.5"
resolved "https://registry.yarnpkg.com/@standardnotes/sncrypto-common/-/sncrypto-common-1.7.5.tgz#2c4ca3923970f5360f8ae01d40e2eaa957b75c12"
integrity sha512-VfGNDAlju4h7Ai7Z7shds41Lvl7JQruYc4pemkAzcmYgrXLHy/wHMUA0kanGTW7fVr3AYmbYCqO6lycldAmrwQ==
"@standardnotes/sncrypto-web@1.8.2":
version "1.8.2"
resolved "https://registry.yarnpkg.com/@standardnotes/sncrypto-web/-/sncrypto-web-1.8.2.tgz#cf60a2ad85240e3ef56ccd5d1b45c29d16300966"
integrity sha512-C/2EkZrYBKTgnW4uluhJ3+GOnbbOL6ixg/c9pa2LZ9zT1vBRaS3vFIHC5hIMwrOsPE1QmIaJyiGtdzMA7A3VMw==
dependencies: dependencies:
"@standardnotes/common" "^1.19.1" "@standardnotes/sncrypto-common" "^1.7.5"
"@standardnotes/models" "^1.1.1"
"@standardnotes/responses" "^1.5.1"
"@standardnotes/utils" "^1.4.6"
"@standardnotes/settings@1.13.2", "@standardnotes/settings@^1.13.2":
version "1.13.2"
resolved "https://registry.yarnpkg.com/@standardnotes/settings/-/settings-1.13.2.tgz#32509823e9f1b885282d5f6e82a6fed5178e5ec2"
integrity sha512-kA2K2/xfS3dlPF//yy2GitH6bfFf4EmvNQ77OWMn1qZdLlTl4HTGps1Q5mX/BrLfC9HNutxqnLFr1N94vxdWlQ==
"@standardnotes/sncrypto-common@^1.7.4":
version "1.7.4"
resolved "https://registry.yarnpkg.com/@standardnotes/sncrypto-common/-/sncrypto-common-1.7.4.tgz#970fbe84edbdc9d632c8774ec201f1e140f693d6"
integrity sha512-6O4RjyfNyCFV32sYCO7jxDt/UelPfbvaMQXYPJ3F58r5gyFdc9K/PxjWmKhzRVxTprNLr+4uWbf1FUERTdTuhg==
"@standardnotes/sncrypto-web@1.8.1":
version "1.8.1"
resolved "https://registry.yarnpkg.com/@standardnotes/sncrypto-web/-/sncrypto-web-1.8.1.tgz#4e8192be81c2b6da2d39d4119ea95ceeb24c49a0"
integrity sha512-lTuFu8WNmUh/9+OApgBj0IU55svXEK5gQRpE9Wdn49mzPZUQx7FrrkQ8piKDBrkpxFoaeQXXgNNWk3CwGQ8WCQ==
dependencies:
"@standardnotes/sncrypto-common" "^1.7.4"
buffer "^6.0.3" buffer "^6.0.3"
libsodium-wrappers "^0.7.9" libsodium-wrappers "^0.7.9"
"@standardnotes/snjs@2.93.3": "@standardnotes/snjs@2.94.3":
version "2.93.3" version "2.94.3"
resolved "https://registry.yarnpkg.com/@standardnotes/snjs/-/snjs-2.93.3.tgz#528c257994b8602666af0d80930e55421d9d5946" resolved "https://registry.yarnpkg.com/@standardnotes/snjs/-/snjs-2.94.3.tgz#93918769025f4883f80555df61c88a838de1c4c3"
integrity sha512-XZS8vBDqc80lEYKndyNIiyZSPme1DU7H6XNCUBH5mt41CF8qvxv76eTFSxmi2oZNrNNujl/Ez1jb23F7oUEMrw== integrity sha512-wfJg8n/p1QisPlxWSyW9dYqN79/Zr16lugryHG0Tc1vXRyLcDNbaYxvo5XR3gGjsml8zARn5NdXJEkBBdPN2xA==
dependencies: dependencies:
"@standardnotes/auth" "^3.18.3" "@standardnotes/auth" "^3.18.5"
"@standardnotes/common" "^1.19.1" "@standardnotes/common" "^1.19.3"
"@standardnotes/domain-events" "^2.26.6" "@standardnotes/domain-events" "^2.26.9"
"@standardnotes/encryption" "^1.1.3" "@standardnotes/encryption" "^1.2.2"
"@standardnotes/features" "^1.36.3" "@standardnotes/features" "^1.37.2"
"@standardnotes/models" "^1.1.1" "@standardnotes/models" "^1.2.2"
"@standardnotes/payloads" "^1.5.1" "@standardnotes/responses" "^1.6.2"
"@standardnotes/responses" "^1.5.1" "@standardnotes/services" "^1.8.2"
"@standardnotes/services" "^1.7.1" "@standardnotes/settings" "^1.13.3"
"@standardnotes/settings" "^1.13.2" "@standardnotes/sncrypto-common" "^1.7.5"
"@standardnotes/sncrypto-common" "^1.7.4" "@standardnotes/utils" "^1.4.8"
"@standardnotes/utils" "^1.4.6"
"@standardnotes/stylekit@5.20.0": "@standardnotes/stylekit@5.21.3":
version "5.20.0" version "5.21.3"
resolved "https://registry.yarnpkg.com/@standardnotes/stylekit/-/stylekit-5.20.0.tgz#84ad262b39cbe307a9e06ffa8eb05119db8a7adb" resolved "https://registry.yarnpkg.com/@standardnotes/stylekit/-/stylekit-5.21.3.tgz#32d136328e7ec04f983fe635ec507a05084f3aac"
integrity sha512-R926S0NlzB97wq6PyX978s1g21KSymX3CjQCmbM3tfV7KFXfNjjDdWSTVetC8exZj/BPvsudfOtNA5bVsJ8RkA== integrity sha512-0ILhE/xtuGBbBuMRurdWDuHrtMvIoJoMwu/2wp+2WNlYzWbSzq/TQ3MYYBUUS76K/nerxJwr7kBtZeJpCdWccg==
dependencies: dependencies:
"@nanostores/preact" "^0.1.3" "@nanostores/preact" "^0.1.3"
"@reach/listbox" "^0.16.2" "@reach/listbox" "^0.16.2"
@@ -2524,12 +2514,12 @@
nanostores "^0.5.10" nanostores "^0.5.10"
prop-types "^15.8.1" prop-types "^15.8.1"
"@standardnotes/utils@^1.4.6": "@standardnotes/utils@^1.4.8":
version "1.4.6" version "1.4.8"
resolved "https://registry.yarnpkg.com/@standardnotes/utils/-/utils-1.4.6.tgz#19fadae46b594e301731989a836e1e9025ec4749" resolved "https://registry.yarnpkg.com/@standardnotes/utils/-/utils-1.4.8.tgz#4c984220903bf64733961c50633de6adf62cb78f"
integrity sha512-8k/ucqtfZd/tl7zBA5E988Kbo+9RiGq70ZNiXjvGhud8hX2JUfUtVqnpjTCIEChKyJhOJR3uVQZBHq9H9S0+lg== integrity sha512-sGROUIUdDncSyAb4w1O+qadJOTp18+9XO8MX08jOEPEMTfmVNFV1xYu6ZWe/0Ae4wCghBr8XeCCfVeE1XNyjTg==
dependencies: dependencies:
"@standardnotes/common" "^1.19.1" "@standardnotes/common" "^1.19.3"
dompurify "^2.3.6" dompurify "^2.3.6"
lodash "^4.17.21" lodash "^4.17.21"