|
|
@ -15,7 +15,7 @@ const _paq = (window._paq = window._paq || []) |
|
|
|
const profile = { |
|
|
|
const profile = { |
|
|
|
name: 'settings', |
|
|
|
name: 'settings', |
|
|
|
displayName: 'Settings', |
|
|
|
displayName: 'Settings', |
|
|
|
methods: ['get'], |
|
|
|
methods: ['get', 'updateCopilotChoice'], |
|
|
|
events: [], |
|
|
|
events: [], |
|
|
|
icon: 'assets/img/settings.webp', |
|
|
|
icon: 'assets/img/settings.webp', |
|
|
|
description: 'Remix-IDE settings', |
|
|
|
description: 'Remix-IDE settings', |
|
|
@ -36,6 +36,7 @@ module.exports = class SettingsTab extends ViewPlugin { |
|
|
|
} |
|
|
|
} |
|
|
|
element: HTMLDivElement |
|
|
|
element: HTMLDivElement |
|
|
|
public useMatomoAnalytics: any |
|
|
|
public useMatomoAnalytics: any |
|
|
|
|
|
|
|
public useCopilot: any |
|
|
|
dispatch: React.Dispatch<any> = () => {} |
|
|
|
dispatch: React.Dispatch<any> = () => {} |
|
|
|
constructor(config, editor) { |
|
|
|
constructor(config, editor) { |
|
|
|
super(profile) |
|
|
|
super(profile) |
|
|
@ -51,6 +52,7 @@ module.exports = class SettingsTab extends ViewPlugin { |
|
|
|
this.element = document.createElement('div') |
|
|
|
this.element = document.createElement('div') |
|
|
|
this.element.setAttribute('id', 'settingsTab') |
|
|
|
this.element.setAttribute('id', 'settingsTab') |
|
|
|
this.useMatomoAnalytics = null |
|
|
|
this.useMatomoAnalytics = null |
|
|
|
|
|
|
|
this.useCopilot = null |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
setDispatch(dispatch: React.Dispatch<any>) { |
|
|
|
setDispatch(dispatch: React.Dispatch<any>) { |
|
|
@ -74,6 +76,7 @@ module.exports = class SettingsTab extends ViewPlugin { |
|
|
|
editor={state.editor} |
|
|
|
editor={state.editor} |
|
|
|
_deps={state._deps} |
|
|
|
_deps={state._deps} |
|
|
|
useMatomoAnalytics={state.useMatomoAnalytics} |
|
|
|
useMatomoAnalytics={state.useMatomoAnalytics} |
|
|
|
|
|
|
|
useCopilot={state.useCopilot} |
|
|
|
themeModule={state._deps.themeModule} |
|
|
|
themeModule={state._deps.themeModule} |
|
|
|
localeModule={state._deps.localeModule} |
|
|
|
localeModule={state._deps.localeModule} |
|
|
|
/> |
|
|
|
/> |
|
|
@ -88,6 +91,14 @@ module.exports = class SettingsTab extends ViewPlugin { |
|
|
|
return this.config.get(key) |
|
|
|
return this.config.get(key) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
updateCopilotChoice(isChecked) { |
|
|
|
|
|
|
|
this.config.set('settings/copilot/suggest/activate', isChecked) |
|
|
|
|
|
|
|
this.useCopilot = isChecked |
|
|
|
|
|
|
|
this.dispatch({ |
|
|
|
|
|
|
|
...this |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
updateMatomoAnalyticsChoice(isChecked) { |
|
|
|
updateMatomoAnalyticsChoice(isChecked) { |
|
|
|
this.config.set('settings/matomo-analytics', isChecked) |
|
|
|
this.config.set('settings/matomo-analytics', isChecked) |
|
|
|
this.useMatomoAnalytics = isChecked |
|
|
|
this.useMatomoAnalytics = isChecked |
|
|
|