diff --git a/app/assets/javascripts/components/Footer.tsx b/app/assets/javascripts/components/Footer.tsx index b9aa73535..1966f4055 100644 --- a/app/assets/javascripts/components/Footer.tsx +++ b/app/assets/javascripts/components/Footer.tsx @@ -57,7 +57,6 @@ type State = { export class Footer extends PureComponent { public user?: unknown; private didCheckForOffline = false; - private observerRemovers: Array<() => void> = []; private completedInitialSync = false; private showingDownloadStatus = false; private webEventListenerDestroyer: () => void; @@ -86,17 +85,9 @@ export class Footer extends PureComponent { } } ); - - this.syncResolutionClickHandler = - this.syncResolutionClickHandler.bind(this); - this.closeAccountMenu = this.closeAccountMenu.bind(this); } deinit() { - for (const remove of this.observerRemovers) remove(); - this.observerRemovers.length = 0; - (this.closeAccountMenu as unknown) = undefined; - (this.syncResolutionClickHandler as unknown) = undefined; this.webEventListenerDestroyer(); (this.webEventListenerDestroyer as unknown) = undefined; super.deinit(); diff --git a/app/assets/javascripts/components/NotesOptions/changeEditor/createEditorMenuGroups.ts b/app/assets/javascripts/components/NotesOptions/changeEditor/createEditorMenuGroups.ts index 6df9d95c6..14911e808 100644 --- a/app/assets/javascripts/components/NotesOptions/changeEditor/createEditorMenuGroups.ts +++ b/app/assets/javascripts/components/NotesOptions/changeEditor/createEditorMenuGroups.ts @@ -1,7 +1,7 @@ import { ComponentArea, FeatureDescription, - Features, + GetFeatures, NoteType, } from '@standardnotes/features'; import { ContentType, SNComponent } from '@standardnotes/snjs'; @@ -49,20 +49,24 @@ export const createEditorMenuGroups = (editors: SNComponent[]) => { others: [], }; - Features.filter( - (feature) => - feature.content_type === ContentType.Component && - feature.area === ComponentArea.Editor - ).forEach((editorFeature) => { - if ( - !editors.find((editor) => editor.identifier === editorFeature.identifier) - ) { - editorItems[getEditorGroup(editorFeature)].push({ - name: editorFeature.name as string, - isPremiumFeature: true, - }); - } - }); + GetFeatures() + .filter( + (feature) => + feature.content_type === ContentType.Component && + feature.area === ComponentArea.Editor + ) + .forEach((editorFeature) => { + if ( + !editors.find( + (editor) => editor.identifier === editorFeature.identifier + ) + ) { + editorItems[getEditorGroup(editorFeature)].push({ + name: editorFeature.name as string, + isPremiumFeature: true, + }); + } + }); editors.forEach((editor) => { const editorItem: EditorMenuItem = { diff --git a/app/assets/javascripts/components/QuickSettingsMenu/QuickSettingsMenu.tsx b/app/assets/javascripts/components/QuickSettingsMenu/QuickSettingsMenu.tsx index bd6692741..7fea580bb 100644 --- a/app/assets/javascripts/components/QuickSettingsMenu/QuickSettingsMenu.tsx +++ b/app/assets/javascripts/components/QuickSettingsMenu/QuickSettingsMenu.tsx @@ -9,7 +9,7 @@ import { ComponentArea, ContentType, FeatureIdentifier, - Features, + GetFeatures, SNComponent, SNTheme, } from '@standardnotes/snjs'; @@ -115,20 +115,22 @@ export const QuickSettingsMenu: FunctionComponent = observer( }; }) as ThemeItem[]; - Features.filter( - (feature) => - feature.content_type === ContentType.Theme && !feature.layerable - ).forEach((theme) => { - if ( - themes.findIndex((item) => item.identifier === theme.identifier) === - -1 - ) { - themes.push({ - name: theme.name as string, - identifier: theme.identifier, - }); - } - }); + GetFeatures() + .filter( + (feature) => + feature.content_type === ContentType.Theme && !feature.layerable + ) + .forEach((theme) => { + if ( + themes.findIndex((item) => item.identifier === theme.identifier) === + -1 + ) { + themes.push({ + name: theme.name as string, + identifier: theme.identifier, + }); + } + }); setThemes(themes); diff --git a/app/assets/javascripts/preferences/panes/Appearance.tsx b/app/assets/javascripts/preferences/panes/Appearance.tsx index ce09c4db9..85c7f56ce 100644 --- a/app/assets/javascripts/preferences/panes/Appearance.tsx +++ b/app/assets/javascripts/preferences/panes/Appearance.tsx @@ -4,7 +4,7 @@ import { sortThemes } from '@/components/QuickSettingsMenu/QuickSettingsMenu'; import { HorizontalSeparator } from '@/components/shared/HorizontalSeparator'; import { Switch } from '@/components/Switch'; import { WebApplication } from '@/ui_models/application'; -import { Features } from '@standardnotes/features'; +import { GetFeatures } from '@standardnotes/features'; import { ContentType, FeatureIdentifier, @@ -73,21 +73,24 @@ export const Appearance: FunctionComponent = observer( }; }); - Features.filter( - (feature) => - feature.content_type === ContentType.Theme && !feature.layerable - ).forEach((theme) => { - if ( - themesAsItems.findIndex((item) => item.value === theme.identifier) === - -1 - ) { - themesAsItems.push({ - label: theme.name as string, - value: theme.identifier, - icon: 'premium-feature', - }); - } - }); + GetFeatures() + .filter( + (feature) => + feature.content_type === ContentType.Theme && !feature.layerable + ) + .forEach((theme) => { + if ( + themesAsItems.findIndex( + (item) => item.value === theme.identifier + ) === -1 + ) { + themesAsItems.push({ + label: theme.name as string, + value: theme.identifier, + icon: 'premium-feature', + }); + } + }); themesAsItems.unshift({ label: 'Default', diff --git a/package.json b/package.json index 399256472..03154783d 100644 --- a/package.json +++ b/package.json @@ -82,9 +82,9 @@ "@reach/dialog": "^0.16.2", "@reach/listbox": "^0.16.2", "@reach/tooltip": "^0.16.2", - "@standardnotes/components": "1.5.0", - "@standardnotes/features": "1.27.0", - "@standardnotes/snjs": "2.51.2", + "@standardnotes/components": "1.7.0", + "@standardnotes/features": "1.29.0", + "@standardnotes/snjs": "2.52.1", "@standardnotes/settings": "^1.11.3", "@standardnotes/sncrypto-web": "1.6.2", "mobx": "^6.3.5", diff --git a/yarn.lock b/yarn.lock index 7143bbf89..dbbf0f601 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2597,39 +2597,39 @@ dependencies: "@sinonjs/commons" "^1.7.0" -"@standardnotes/auth@^3.15.3": - version "3.15.3" - resolved "https://registry.yarnpkg.com/@standardnotes/auth/-/auth-3.15.3.tgz#bf77332e0ac3d846acc45f25083459e42f4a4374" - integrity sha512-16wgMl0qmq8w+HUktfQ7ODoprkngSs0vsSF5G9aHM1L+lFMwlGeVOztHH2zwG91pFkl7BaK6LcEimoYiml6VAw== +"@standardnotes/auth@^3.15.4": + version "3.15.4" + resolved "https://registry.yarnpkg.com/@standardnotes/auth/-/auth-3.15.4.tgz#acb2e9497724e1ba290664f199f3cc165c0fce3e" + integrity sha512-QhOnM8yPL63RrS+0qQjT4PIlHT3a+Ht17BmTEoNeNw3hc0QSXb3wqkwHoqyMfxWZKcAVjOSPhl+aOO9O2JUC3w== dependencies: - "@standardnotes/common" "^1.8.0" + "@standardnotes/common" "^1.9.0" jsonwebtoken "^8.5.1" -"@standardnotes/common@^1.8.0": - version "1.8.0" - resolved "https://registry.yarnpkg.com/@standardnotes/common/-/common-1.8.0.tgz#af72ad85f0d410ae31c0c110137911e2595634de" - integrity sha512-R3nfAvhaXp5ufMB0M0fmV9yizE/Of2PGNJKnxtdxwowAq/ZakHu8Rh/v485PXrCaCFREVOZQO8kg0RQM8YngSw== +"@standardnotes/common@^1.9.0": + version "1.9.0" + resolved "https://registry.yarnpkg.com/@standardnotes/common/-/common-1.9.0.tgz#45c0a8da16cb6e3c56ee53e8abde73934c5cf91e" + integrity sha512-4c/7f/sFBykmiu/SqYn3OfmMSdJ6dNVsl6yDm4aPB37EAyNPhOfhOeY8kQ12606EZArtUJ8FYo5sKPbLV0PCug== -"@standardnotes/components@1.5.0": - version "1.5.0" - resolved "https://registry.yarnpkg.com/@standardnotes/components/-/components-1.5.0.tgz#29f46734ac8837b74cd15c8ba78358205a56d4bc" - integrity sha512-Xz8JsGxDuBClIu+US0UM1tqCbuSFJ5xHCmRWXBPEXQpkCFCENQ6avheIXp3oJKR2iYxwwgZuHAfnZClyIEMxSg== +"@standardnotes/components@1.7.0": + version "1.7.0" + resolved "https://registry.yarnpkg.com/@standardnotes/components/-/components-1.7.0.tgz#192f358ddffe275a9ab3709ef31b7b8bf3b58ec1" + integrity sha512-4J9iuos5WZvl+/Z7dNvhgEY9SRTdSm6JiUHbo6rRtryjvlJB4EkvnARxexJvw17MBmTWjvHY8c3aLm/w1dzv0A== -"@standardnotes/domain-events@^2.21.2": - version "2.21.2" - resolved "https://registry.yarnpkg.com/@standardnotes/domain-events/-/domain-events-2.21.2.tgz#e28a0c1a65b09cf9712ce1efab279af33f68cae6" - integrity sha512-wZuTpgFFhV6CxwWHxU1Y0rtlR7SLZAccnT+GIbWk77WlkbdyJydpMIgcr5I94+9wFZuzMGA3SU+HyYbAE08ozg== +"@standardnotes/domain-events@^2.21.4": + version "2.21.4" + resolved "https://registry.yarnpkg.com/@standardnotes/domain-events/-/domain-events-2.21.4.tgz#d6a78e5e9ff700208e7ed407edf492bd289137a4" + integrity sha512-1odojLlirCNB8h8O3PKPgaSmbjRtkg1MYTovg4uvcDPRbPecw+2F70dA9gMS33224JlorBhjBi4qcn+ehraP8w== dependencies: - "@standardnotes/auth" "^3.15.3" - "@standardnotes/features" "^1.27.0" + "@standardnotes/auth" "^3.15.4" + "@standardnotes/features" "^1.29.0" -"@standardnotes/features@1.27.0", "@standardnotes/features@^1.27.0": - version "1.27.0" - resolved "https://registry.yarnpkg.com/@standardnotes/features/-/features-1.27.0.tgz#eac735cafaa90f2d174fea65757034bfd841b056" - integrity sha512-RJXtBw5PCGNXuvUZDn1UJHQuF9+V0kZcGI4leWZJNRFDCQeuESOopVXvVIPCske/vUTHy8BGJttc2m9OatTlPw== +"@standardnotes/features@1.29.0", "@standardnotes/features@^1.29.0": + version "1.29.0" + resolved "https://registry.yarnpkg.com/@standardnotes/features/-/features-1.29.0.tgz#f7c4c2cb9fdf5c7cc08bae177a40ec09eb73be95" + integrity sha512-OTxAtj1nA5yj6yEh3m2AsMnpd+JU6xQ8MBd6Vn3nxx3WKux5d+hTJkkskkbERc+0MZhIFLCiBUrkSolJc8Yo+g== dependencies: - "@standardnotes/auth" "^3.15.3" - "@standardnotes/common" "^1.8.0" + "@standardnotes/auth" "^3.15.4" + "@standardnotes/common" "^1.9.0" "@standardnotes/settings@^1.11.3": version "1.11.3" @@ -2650,15 +2650,15 @@ buffer "^6.0.3" libsodium-wrappers "^0.7.9" -"@standardnotes/snjs@2.51.2": - version "2.51.2" - resolved "https://registry.yarnpkg.com/@standardnotes/snjs/-/snjs-2.51.2.tgz#9804e27071a8d139bf72095d94231a1e29a61593" - integrity sha512-sxS/QnDnOqUx88Mv8BVR2sd4UAvrBQj0Daa9rH5+INryY5qkLdlTod6MqDfxy+MRkyioVpDAE+yYuBJbcPyqQw== +"@standardnotes/snjs@2.52.1": + version "2.52.1" + resolved "https://registry.yarnpkg.com/@standardnotes/snjs/-/snjs-2.52.1.tgz#00e2e1f7eaeef2c95b6830470031496e48ff4b83" + integrity sha512-U35dangXmhl1uEnPcDmWrRlqHyT/N5KIE5izT8w0xkhrWpc5a62j+m0u2uJNYU7C00d6ERqVWXeHCDsdSXTx8A== dependencies: - "@standardnotes/auth" "^3.15.3" - "@standardnotes/common" "^1.8.0" - "@standardnotes/domain-events" "^2.21.2" - "@standardnotes/features" "^1.27.0" + "@standardnotes/auth" "^3.15.4" + "@standardnotes/common" "^1.9.0" + "@standardnotes/domain-events" "^2.21.4" + "@standardnotes/features" "^1.29.0" "@standardnotes/settings" "^1.11.3" "@standardnotes/sncrypto-common" "^1.6.0"