This repository has been archived by the owner on Feb 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3afd7b6
commit 645fae2
Showing
26 changed files
with
368 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import BookmarksState from '~/components/bookmarks/bulma/components/settings/BookmarksState.vue'; | ||
|
||
Vue.component('setting-bookmarks-state', BookmarksState); | ||
|
||
export default ({ store }, inject) => { | ||
store.commit('layout/settings/registerItem', {component: 'setting-bookmarks-state', order: 500}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import Enum from '@enso-ui/enums' | ||
|
||
export default (context, inject) => { | ||
inject('bootEnums', (enums, i18n) => { | ||
const obj = {} | ||
|
||
Object.keys(enums).forEach( | ||
(enumName) => (obj[enumName] = new Enum(enums[enumName], i18n)) | ||
) | ||
|
||
return obj | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import format from '@enso-ui/date/src/format.js'; | ||
|
||
export default ({ store }, inject) => { | ||
inject('format', (date, formatStr = null) => format( | ||
date, | ||
formatStr || store.state.meta.dateFormat, | ||
store.state.preferences.global.lang, | ||
)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import formatDistance from '@enso-ui/date/src/formatDistance.js'; | ||
|
||
export default ({ store }, inject) => { | ||
inject('formatDistance', date => formatDistance(date, store.state.preferences.global.lang)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import ro from 'date-fns/esm/locale/ro'; | ||
import en from 'date-fns/esm/locale/en-US/'; | ||
import de from 'date-fns/esm/locale/de'; | ||
import nl from 'date-fns/esm/locale/nl'; | ||
import fr from 'date-fns/esm/locale/fr'; | ||
import pt from 'date-fns/esm/locale/pt'; | ||
// import ar from 'date-fns/esm/locale/ar'; | ||
// import mn from 'date-fns/esm/locale/mn'; | ||
import hu from 'date-fns/esm/locale/hu'; | ||
import es from 'date-fns/esm/locale/es'; | ||
|
||
const i18n = { | ||
ro, en, de, nl, fr, br: pt, ar: en, mn: en, hu, es | ||
}; | ||
|
||
export default i18n; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
const map = [ | ||
{ replace: 'Y', with: 'yyyy' }, // 1999 | ||
{ replace: 'y', with: 'yy' }, // 99 | ||
{ replace: 'Y', with: 'y' }, // 1999 | ||
{ replace: 'F', with: 'MMMM' }, // January | ||
{ replace: 'M', with: 'MMM' }, // Jan | ||
{ replace: 'm', with: 'MM' }, // 01 | ||
{ replace: 'd', with: 'dd' }, // 19 | ||
{ replace: 'j', with: 'd' }, // | ||
{ replace: 'l', with: 'EEEE' }, // Tuesday | ||
{ replace: 'D', with: 'EEE' }, // Tue | ||
{ replace: 'D', with: 'EE' }, // Tue | ||
{ replace: 'a', with: 'a' }, // Am/PM | ||
{ replace: 'p', with: 'p' }, // Am/PM | ||
{ replace: 'H', with: 'HH' }, // 24-hour with leading zeros | ||
{ replace: 'G', with: 'H' }, // 24-hour without leading zeros | ||
{ replace: 'h', with: 'h' }, // 12-hour with leading zeros | ||
{ replace: 'g', with: 'K' }, // 12-hour without leading zero | ||
{ replace: 'i', with: 'mm' }, // Minutes with leading zeros | ||
{ replace: 's', with: 'ss' }, // Seconds, with leading zeros | ||
{ replace: 'T', with: 'zz' }, // Timezone abbreviation | ||
{ replace: 'e', with: 'zzzz' }, // Timezone | ||
]; | ||
|
||
|
||
const segments = formatStr => formatStr | ||
.split(new RegExp([' ', '-', '/', ':', ',', '[.]'].join('|'), '')) | ||
.sort((a, b) => b.length - a.length); // ASC -> a - b; DESC -> b - a | ||
|
||
const mapping = segment => map | ||
.find(({ replace }) => replace === segment).with; | ||
|
||
const unicode2PHP = formatStr => segments(formatStr) | ||
.reduce((string, segment) => string | ||
.replace(segment, mapping(segment)) || '', formatStr); | ||
|
||
export default unicode2PHP; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
window.io = require('socket.io-client') | ||
import Echo from 'laravel-echo' | ||
|
||
export default ({ app, env }, inject) => { | ||
const echo = new Echo({ | ||
broadcaster: 'socket.io', | ||
host: `http://localhost:3000`, | ||
}) | ||
|
||
inject('echo', echo) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
const SI = ['', 'k', 'M', 'G', 'T', 'P', 'E']; | ||
export default ({ store }, inject) => { | ||
Vue.filter('numberFormat', (value, decimals = 3) => new Intl.NumberFormat( | ||
store.state.preferences.global.lang, { | ||
style: 'decimal', | ||
minimumFractionDigits: decimals, | ||
maximumFractionDigits: decimals, | ||
}, | ||
).format(value)); | ||
|
||
Vue.filter('shortNumber', (number, precision = 2) => { | ||
number = Number.parseFloat(number); | ||
|
||
if (number < 1) { | ||
return number; | ||
} | ||
|
||
const tier = Math.floor(Math.log10(number) / 3); | ||
|
||
if (tier === 0) { | ||
return number; | ||
} | ||
|
||
const suffix = SI[tier]; | ||
const scale = 10 ** (tier * 3); | ||
const scaled = number / scale; | ||
const formatted = Number(scaled.toFixed(precision)) + suffix; | ||
|
||
return formatted; | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
import { library } from '@fortawesome/fontawesome-svg-core'; | ||
import { FontAwesomeIcon, FontAwesomeLayers, FontAwesomeLayersText } from '@fortawesome/vue-fontawesome'; | ||
import { | ||
faListAlt, | ||
faUpload, | ||
faShoePrints, | ||
faPuzzlePiece, | ||
faCalendarAlt, | ||
faFolderOpen, | ||
faVideo, | ||
faUsersCog, | ||
faBook, | ||
faUsers, | ||
faUniversalAccess, | ||
faExclamationTriangle, | ||
faUserTie, | ||
faTerminal, | ||
faLanguage, | ||
faUser, | ||
faBuilding, | ||
faCloudUploadAlt, | ||
faTasks, | ||
faTachometerAlt, | ||
faSlidersH, | ||
faList | ||
} from '@fortawesome/free-solid-svg-icons'; | ||
import { faGithub, faGoogle } from '@fortawesome/free-brands-svg-icons'; | ||
|
||
library.add( | ||
faListAlt, | ||
faGithub, | ||
faUpload, | ||
faShoePrints, | ||
faGoogle, | ||
faPuzzlePiece, | ||
faCalendarAlt, | ||
faFolderOpen, | ||
faVideo, | ||
faUsersCog, | ||
faBook, | ||
faUsers, | ||
faUniversalAccess, | ||
faExclamationTriangle, | ||
faUserTie, | ||
faTerminal, | ||
faLanguage, | ||
faUser, | ||
faBuilding, | ||
faCloudUploadAlt, | ||
faTasks, | ||
faTachometerAlt, | ||
faSlidersH, | ||
faList | ||
); | ||
|
||
Vue.component('fa', FontAwesomeIcon); | ||
Vue.component('fal', FontAwesomeLayers); | ||
Vue.component('falt', FontAwesomeLayersText); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
export default ({ store }, inject) => { | ||
inject('i18n', (key, params = null) => { | ||
if (key === null || key === '' || typeof key === 'undefined') { | ||
return null | ||
} | ||
|
||
if (!store.getters['localisation/ready']) { | ||
return key | ||
} | ||
|
||
let translation = store.getters['localisation/i18n'](key) | ||
|
||
if (typeof translation === 'undefined' || translation === null) { | ||
translation = key | ||
|
||
if (store.state.localisation.keyCollector) { | ||
store.commit('localisation/addMissingKey', key) | ||
} | ||
} | ||
|
||
return !!params && typeof params === 'object' | ||
? translation.replace(/:(\w*)/g, (e, key) => { | ||
if (typeof params[key.toLowerCase()] === 'undefined') { | ||
return key | ||
} | ||
|
||
const param = params[key.toLowerCase()] | ||
|
||
if (key === key.toUpperCase()) { | ||
return param.toUpperCase() | ||
} | ||
|
||
return key[0] === key[0].toUpperCase() | ||
? param.charAt(0).toUpperCase() + param.slice(1) | ||
: param | ||
}) | ||
: translation || key | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import IO from '~/components/io/bulma/components/navbar/IO.vue'; | ||
|
||
|
||
Vue.component('navbar-io', IO); | ||
|
||
export default ({ store }, inject) => { | ||
store.commit('layout/navbar/registerItem', { component: 'navbar-io', order: 200, permission: undefined }); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import MissingKey from '~/components/localisation/bulma/components/navbar/MissingKeys.vue'; | ||
import KeyCollector from '~/components/localisation/bulma/components/settings/KeyCollector.vue'; | ||
import LanguageSelector from '~/components/localisation/bulma/components/settings/LanguageSelector.vue'; | ||
|
||
Vue.component('navbar-missing-key', MissingKey); | ||
Vue.component('setting-key-collector', KeyCollector); | ||
Vue.component('setting-language-selector', LanguageSelector); | ||
|
||
export default ({ store }, inject) => { | ||
store.commit('layout/settings/registerItem', { component: 'setting-language-selector', order: 100 }) | ||
store.commit('layout/settings/registerItem', { component: 'setting-key-collector', order: 600 }) | ||
store.commit('layout/navbar/registerItem', { component: 'navbar-missing-key', order: 100, permission: undefined }); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import Notification from '~/components/notifications/bulma/components/navbar/Notifications.vue'; | ||
import ToastPosition from '~/components/notifications/bulma/components/settings/ToastrPosition.vue'; | ||
|
||
Vue.component('navbar-notification', Notification); | ||
Vue.component('setting-toaster-position', ToastPosition); | ||
|
||
export default ({ store }, inject) => { | ||
store.commit('layout/settings/registerItem', { component: 'setting-toaster-position', order: 300 }) | ||
store.commit('layout/navbar/registerItem', { component: 'navbar-notification', order: 300, permission: 'core.notifications.count' }); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export default ({ store }, inject) => { | ||
inject('numberFormat', (value, decimals = 3) => new Intl.NumberFormat( | ||
store.state.preferences.global.lang, { | ||
style: 'decimal', | ||
minimumFractionDigits: decimals, | ||
maximumFractionDigits: decimals, | ||
}, | ||
).format(value)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import RouteMapper from '@enso-ui/route-mapper' | ||
|
||
export default ({ store }, inject) => { | ||
inject('pRoute', (name, params, absolute) => { | ||
const { meta, routes } = store.state | ||
|
||
return new RouteMapper(meta.appUrl, routes).get(name, params, absolute) | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
export default (context, inject) => { | ||
inject('shortNumber', (number, precision = 2) => { | ||
number = Number.parseFloat(number); | ||
|
||
if (number < 1) { | ||
return number; | ||
} | ||
|
||
const tier = Math.floor(Math.log10(number) / 3); | ||
|
||
if (tier === 0) { | ||
return number; | ||
} | ||
|
||
const suffix = SI[tier]; | ||
const scale = 10 ** (tier * 3); | ||
const scaled = number / scale; | ||
const formatted = Number(scaled.toFixed(precision)) + suffix; | ||
|
||
return formatted; | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import Tasks from '~/components/tasks/bulma/components/navbar/Tasks.vue'; | ||
|
||
Vue.component('navbar-tasks', Tasks); | ||
|
||
export default ({ store }, inject) => { | ||
store.commit('layout/navbar/registerItem', { component: 'navbar-tasks', order: 150, permission: 'tasks.count' }); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import ThemeSelector from '~/components/themes/bulma/components/settings/ThemeSelector.vue'; | ||
|
||
Vue.component('setting-theme-selector', ThemeSelector); | ||
|
||
export default ({ store }, inject) => { | ||
store.commit('layout/settings/registerItem', {component: 'setting-theme-selector', order: 200}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import toastr from '@enso-ui/toastr'; | ||
|
||
Vue.prototype.$toastr = toastr; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
//import Vue from 'vue'; | ||
//import Tutorial from '~/components/tutorials/bulma/components/settings/Tutorial.vue'; | ||
|
||
//Vue.component('setting-tutorials', Tutorial); | ||
// | ||
//export default ({ store }, inject) => { | ||
// store.commit('layout/settings/registerItem', { component: 'setting-tutorials', order: 350 }) | ||
//} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import ProfileController from '~/components/users/bulma/components/navbar/ProfileControl.vue'; | ||
|
||
Vue.component('navbar-profile-controller', ProfileController); | ||
|
||
export default ({ store }, inject) => { | ||
store.commit('layout/navbar/registerItem', { component: 'navbar-profile-controller', order: 400, permission: undefined }); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import VueFbCustomerChat from 'vue-fb-customer-chat' | ||
|
||
Vue.use(VueFbCustomerChat, { | ||
page_id: 2089062604669120, // change 'null' to your Facebook Page ID, | ||
theme_color: '#333333', // theme color in HEX | ||
locale: 'en_US', // default 'en_US' | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { defineNuxtPlugin } from '#app' | ||
import VueGtag from 'vue-gtag-next' | ||
|
||
export default defineNuxtPlugin((nuxtApp) => { | ||
const getGDPR = localStorage.getItem('GDPR:accepted'); | ||
nuxtApp.vueApp.use(VueGtag, { | ||
property: { | ||
id: 'UA-208194369-1' | ||
}, | ||
appName: 'Family Tree 365', | ||
enabled: getGDPR === 'true', | ||
pageTrackerScreenviewEnabled: true | ||
}, nuxtApp.vueApp.router); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import vSelect from 'vue-select' | ||
import 'vue-select/dist/vue-select.css' | ||
Vue.component('vue-select', vSelect) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { StripeCheckout } from '@vue-stripe/vue-stripe'; | ||
|
||
export default () => { | ||
Vue.component('StripeCheckout', StripeCheckout); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// src/plugins/vuetify.js | ||
|
||
import Vuetify from 'vuetify' | ||
import 'vuetify/dist/vuetify.min.css' | ||
|
||
Vue.use(Vuetify) | ||
|
||
const opts = {} | ||
|
||
export default new Vuetify(opts) |