UNPKG

apostrophe

Version:
35 lines (34 loc) 836 B
module.exports = { options: { alias: 'ui', widgetMargin: '20px 0' }, icons: { 'earth-icon': 'Earth', 'database-check-icon': 'DatabaseCheck' }, init(self) { self.enableBrowserData(); self.uiDebug = self.options.debug ?? process.env.NODE_ENV !== 'production'; }, methods(self) { return { getBrowserData(req) { const theme = { primary: 'default' }; if (req.data.global && req.data.global.aposThemePrimary) { theme.primary = req.data.global.aposThemePrimary; } if (req.data.user && req.data.user.aposThemePrimary) { theme.primary = req.data.user.aposThemePrimary; } return { debug: self.uiDebug, theme, widgetMargin: self.options.widgetMargin }; } }; } };