|
@@ -9,11 +9,82 @@ import i18n from 'i18next'
|
|
|
import { initReactI18next } from 'react-i18next'
|
|
import { initReactI18next } from 'react-i18next'
|
|
|
// @ts-ignore
|
|
// @ts-ignore
|
|
|
import en from '../../../services/web/locales/en.json'
|
|
import en from '../../../services/web/locales/en.json'
|
|
|
-import { ExposedSettings } from '../types/exposed-settings'
|
|
|
|
|
-import { User } from '../types/user'
|
|
|
|
|
|
|
|
|
|
-window.i18n = window.i18n || {}
|
|
|
|
|
-window.i18n.currentLangCode = window.i18n.currentLangCode || 'en'
|
|
|
|
|
|
|
+function resetMeta() {
|
|
|
|
|
+ window.metaAttributesCache = new Map()
|
|
|
|
|
+ window.metaAttributesCache.set('ol-i18n', { currentLangCode: 'en' })
|
|
|
|
|
+ window.metaAttributesCache.set('ol-ExposedSettings', {
|
|
|
|
|
+ adminEmail: 'placeholder@example.com',
|
|
|
|
|
+ appName: 'Overleaf',
|
|
|
|
|
+ cookieDomain: '.overleaf.stories',
|
|
|
|
|
+ dropboxAppName: 'Overleaf-Stories',
|
|
|
|
|
+ emailConfirmationDisabled: false,
|
|
|
|
|
+ enableSubscriptions: true,
|
|
|
|
|
+ hasAffiliationsFeature: false,
|
|
|
|
|
+ hasLinkUrlFeature: true,
|
|
|
|
|
+ hasLinkedProjectFileFeature: true,
|
|
|
|
|
+ hasLinkedProjectOutputFileFeature: true,
|
|
|
|
|
+ hasSamlFeature: true,
|
|
|
|
|
+ ieeeBrandId: 15,
|
|
|
|
|
+ isOverleaf: true,
|
|
|
|
|
+ labsEnabled: true,
|
|
|
|
|
+ maxEntitiesPerProject: 10,
|
|
|
|
|
+ maxUploadSize: 5 * 1024 * 1024,
|
|
|
|
|
+ recaptchaDisabled: {
|
|
|
|
|
+ invite: true,
|
|
|
|
|
+ login: true,
|
|
|
|
|
+ passwordReset: true,
|
|
|
|
|
+ register: true,
|
|
|
|
|
+ addEmail: true,
|
|
|
|
|
+ },
|
|
|
|
|
+ sentryAllowedOriginRegex: '',
|
|
|
|
|
+ siteUrl: 'http://localhost',
|
|
|
|
|
+ templateLinks: [],
|
|
|
|
|
+ textExtensions: [
|
|
|
|
|
+ 'tex',
|
|
|
|
|
+ 'latex',
|
|
|
|
|
+ 'sty',
|
|
|
|
|
+ 'cls',
|
|
|
|
|
+ 'bst',
|
|
|
|
|
+ 'bib',
|
|
|
|
|
+ 'bibtex',
|
|
|
|
|
+ 'txt',
|
|
|
|
|
+ 'tikz',
|
|
|
|
|
+ 'mtx',
|
|
|
|
|
+ 'rtex',
|
|
|
|
|
+ 'md',
|
|
|
|
|
+ 'asy',
|
|
|
|
|
+ 'lbx',
|
|
|
|
|
+ 'bbx',
|
|
|
|
|
+ 'cbx',
|
|
|
|
|
+ 'm',
|
|
|
|
|
+ 'lco',
|
|
|
|
|
+ 'dtx',
|
|
|
|
|
+ 'ins',
|
|
|
|
|
+ 'ist',
|
|
|
|
|
+ 'def',
|
|
|
|
|
+ 'clo',
|
|
|
|
|
+ 'ldf',
|
|
|
|
|
+ 'rmd',
|
|
|
|
|
+ 'lua',
|
|
|
|
|
+ 'gv',
|
|
|
|
|
+ 'mf',
|
|
|
|
|
+ 'lhs',
|
|
|
|
|
+ 'mk',
|
|
|
|
|
+ 'xmpdata',
|
|
|
|
|
+ 'cfg',
|
|
|
|
|
+ 'rnw',
|
|
|
|
|
+ 'ltx',
|
|
|
|
|
+ 'inc',
|
|
|
|
|
+ ],
|
|
|
|
|
+ editableFilenames: ['latexmkrc', '.latexmkrc', 'makefile', 'gnumakefile'],
|
|
|
|
|
+ validRootDocExtensions: ['tex', 'Rtex', 'ltx', 'Rnw'],
|
|
|
|
|
+ fileIgnorePattern:
|
|
|
|
|
+ '**/{{__MACOSX,.git,.texpadtmp,.R}{,/**},.!(latexmkrc),*.{dvi,aux,log,toc,out,pdfsync,synctex,synctex(busy),fdb_latexmk,fls,nlo,ind,glo,gls,glg,bbl,blg,doc,docx,gz,swp}}',
|
|
|
|
|
+ projectUploadTimeout: 12000,
|
|
|
|
|
+ })
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
i18n.use(initReactI18next).init({
|
|
i18n.use(initReactI18next).init({
|
|
|
lng: 'en',
|
|
lng: 'en',
|
|
|
|
|
|
|
@@ -41,10 +112,6 @@ i18n.use(initReactI18next).init({
|
|
|
},
|
|
},
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
-// avoid some errors by creating these objects in advance
|
|
|
|
|
-window.user = {} as User
|
|
|
|
|
-window.ExposedSettings = {} as ExposedSettings
|
|
|
|
|
-
|
|
|
|
|
const preview: Preview = {
|
|
const preview: Preview = {
|
|
|
parameters: {
|
|
parameters: {
|
|
|
// Automatically mark prop-types like onClick, onToggle, etc as Storybook
|
|
// Automatically mark prop-types like onClick, onToggle, etc as Storybook
|
|
@@ -98,6 +165,8 @@ const preview: Preview = {
|
|
|
? bootstrap5Style
|
|
? bootstrap5Style
|
|
|
: bootstrap3Style
|
|
: bootstrap3Style
|
|
|
|
|
|
|
|
|
|
+ resetMeta()
|
|
|
|
|
+
|
|
|
return (
|
|
return (
|
|
|
<>
|
|
<>
|
|
|
{activeStyle && <style>{activeStyle.default}</style>}
|
|
{activeStyle && <style>{activeStyle.default}</style>}
|
|
@@ -109,3 +178,6 @@ const preview: Preview = {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
export default preview
|
|
export default preview
|
|
|
|
|
+
|
|
|
|
|
+// Populate meta for top-level access in modules on import
|
|
|
|
|
+resetMeta()
|