mango-cms 0.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/README.md +17 -0
  2. package/bin/mango +4 -0
  3. package/frontend-starter/README.md +8 -0
  4. package/frontend-starter/dist/_redirects +1 -0
  5. package/frontend-starter/dist/assets/index.00922bd5.js +99 -0
  6. package/frontend-starter/dist/assets/index.1781f175.css +1 -0
  7. package/frontend-starter/dist/favicon.png +0 -0
  8. package/frontend-starter/dist/index.html +53 -0
  9. package/frontend-starter/dist/index.js +66 -0
  10. package/frontend-starter/index.html +25 -0
  11. package/frontend-starter/index.js +197 -0
  12. package/frontend-starter/package-lock.json +5454 -0
  13. package/frontend-starter/package.json +40 -0
  14. package/frontend-starter/postcss.config.js +6 -0
  15. package/frontend-starter/public/_redirects +1 -0
  16. package/frontend-starter/public/favicon.png +0 -0
  17. package/frontend-starter/public/index.js +66 -0
  18. package/frontend-starter/src/App.vue +27 -0
  19. package/frontend-starter/src/components/layout/login.vue +212 -0
  20. package/frontend-starter/src/components/layout/modal.vue +113 -0
  21. package/frontend-starter/src/components/layout/spinner.vue +17 -0
  22. package/frontend-starter/src/components/pages/404.vue +28 -0
  23. package/frontend-starter/src/components/pages/home.vue +74 -0
  24. package/frontend-starter/src/components/partials/button.vue +31 -0
  25. package/frontend-starter/src/helpers/Mango.vue +455 -0
  26. package/frontend-starter/src/helpers/breakpoints.js +34 -0
  27. package/frontend-starter/src/helpers/darkMode.js +38 -0
  28. package/frontend-starter/src/helpers/email.js +32 -0
  29. package/frontend-starter/src/helpers/formatPhone.js +18 -0
  30. package/frontend-starter/src/helpers/localDB.js +315 -0
  31. package/frontend-starter/src/helpers/mango.js +338 -0
  32. package/frontend-starter/src/helpers/model.js +9 -0
  33. package/frontend-starter/src/helpers/multiSelect.vue +252 -0
  34. package/frontend-starter/src/helpers/pills.vue +75 -0
  35. package/frontend-starter/src/helpers/reconnecting-websocket.js +357 -0
  36. package/frontend-starter/src/helpers/uploadFile.vue +157 -0
  37. package/frontend-starter/src/helpers/uploadFiles.vue +100 -0
  38. package/frontend-starter/src/helpers/uploadImages.vue +89 -0
  39. package/frontend-starter/src/helpers/user.js +40 -0
  40. package/frontend-starter/src/index.css +281 -0
  41. package/frontend-starter/src/main.js +145 -0
  42. package/frontend-starter/tailwind.config.js +46 -0
  43. package/frontend-starter/vite.config.js +10 -0
  44. package/frontend-starter/yarn.lock +3380 -0
  45. package/mango-cms-0.0.13.tgz +0 -0
  46. package/package.json +24 -0
  47. package/src/cli.js +93 -0
  48. package/src/default-config/automation/index.js +37 -0
  49. package/src/default-config/collections/examples.js +60 -0
  50. package/src/default-config/config/.collections.json +1 -0
  51. package/src/default-config/config/globalFields.js +15 -0
  52. package/src/default-config/config/settings.json +23 -0
  53. package/src/default-config/config/statuses.js +0 -0
  54. package/src/default-config/config/users.js +35 -0
  55. package/src/default-config/endpoints/index.js +19 -0
  56. package/src/default-config/fields/vimeo.js +36 -0
  57. package/src/default-config/hooks/test.js +5 -0
  58. package/src/default-config/plugins/mango-stand/index.js +206 -0
  59. package/src/main.js +278 -0
@@ -0,0 +1,145 @@
1
+ import axios from 'axios'
2
+ import { computed, createApp, defineAsyncComponent, reactive, ref } from 'vue'
3
+ import { createRouter, createWebHistory } from 'vue-router'
4
+ import { MotionPlugin } from '@vueuse/motion'
5
+ // import { port, domain } from '../../mango/config/settings'
6
+ import { port, domain } from '../../config/config/settings'
7
+ import VueClipboard from 'vue3-clipboard'
8
+ import Vue3TouchEvents from "vue3-touch-events";
9
+ import App from './App.vue'
10
+ import './index.css'
11
+
12
+ /*
13
+ If these are dynamicly imported I end up with a blank
14
+ screen while the route is waiting for the component
15
+ to download... not sure how to fix.
16
+ */
17
+
18
+ import Home from './components/pages/home.vue'
19
+ const isDev = ['true', '1'].includes(import.meta.env.VITE_DEVMODE)
20
+
21
+ const routes = [
22
+
23
+ { path: '/', component: Home },
24
+ { path: '/protectedRoute', component: Home, meta: { protected: true, fallback: '/' } },
25
+
26
+ ]
27
+
28
+ const router = createRouter({
29
+ history: createWebHistory(),
30
+ scrollBehavior(to, from, savedPosition) {
31
+
32
+ let toPath = to.matched?.[0]?.path
33
+
34
+ let sameComponent = to.matched?.[0]?.components?.default == from.matched?.[0]?.components?.default
35
+ let sameComponentExceptions = ['/inventory/:id', /account\/*/g]
36
+ let exceptionExists = sameComponentExceptions.some(e => !!toPath?.match(e)?.length)
37
+
38
+ if (to.hash) { return { el: to.hash, behavior: 'smooth' } }
39
+ if (savedPosition) return savedPosition
40
+ if (sameComponent && !exceptionExists) return null
41
+
42
+ return { top: 0 }
43
+
44
+ },
45
+ routes,
46
+ })
47
+
48
+
49
+ const app = createApp(App)
50
+
51
+ app.use(router)
52
+ app.use(Vue3TouchEvents)
53
+ app.use(MotionPlugin)
54
+ app.use(VueClipboard, {
55
+ autoSetContainer: true,
56
+ appendToBody: true,
57
+ })
58
+
59
+ /*
60
+
61
+ Global Properties
62
+
63
+ */
64
+
65
+ import breakpoints from './helpers/breakpoints'
66
+ import darkMode from './helpers/darkMode'
67
+ import formatPhone from './helpers/formatPhone'
68
+ import { initUser } from './helpers/user';
69
+
70
+ app.provide('breakpoints', breakpoints().breakpoints)
71
+ app.provide('darkMode', darkMode().darkMode)
72
+
73
+ const user = initUser()
74
+
75
+ let api = `http://localhost:${port}`
76
+ // let api = `https://${domain}`
77
+ if (!isDev) api = `https://${domain}`
78
+
79
+ const store = reactive({
80
+
81
+ user,
82
+ api,
83
+
84
+ })
85
+
86
+ let Authorization = window.localStorage.getItem('email') + ';' + window.localStorage.getItem('user')
87
+ axios.defaults.headers.common['Authorization'] = Authorization
88
+
89
+ app.provide('store', store)
90
+ app.provide('axios', axios)
91
+
92
+ app.provide('mode', import.meta.env.MODE)
93
+ app.provide('formatPhone', formatPhone)
94
+
95
+
96
+ /*
97
+
98
+ Global Components
99
+
100
+ */
101
+
102
+ import Mango from './helpers/Mango.vue'
103
+ import Spinner from './components/layout/spinner.vue'
104
+ import Modal from './components/layout/modal.vue'
105
+ import Button from './components/partials/button.vue'
106
+
107
+ app.component('Mango', Mango)
108
+ app.component('Spinner', Spinner)
109
+ app.component('Modal', Modal)
110
+ app.component('btn', Button)
111
+ // app.component('resource', defineAsyncComponent(Layouter.vue')))
112
+
113
+ /*
114
+
115
+ Route Guard
116
+
117
+ */
118
+
119
+ router.beforeEach((to, from, next) => {
120
+
121
+ // Log in google analytics...
122
+ if (window.ga) window.ga('send', 'pageview', to.fullPath);
123
+
124
+ if (to.meta?.protected && !store.user?.id) {
125
+ console.log('protected', store.user?.id)
126
+ store.login = { next: to.path }
127
+ if (to.meta?.fallback) {
128
+ console.log('to', to)
129
+ // Get params from path and add them to the fallback path (/event/:id)
130
+ let fallback = to.meta.fallback?.split('/')?.map(p => {
131
+ if (p.includes(':')) {
132
+ let param = p.replaceAll(':', '')
133
+ return to.params[param] || ''
134
+ } else {
135
+ return p
136
+ }
137
+ })?.join('/')
138
+ return next(fallback || to.meta.fallback)
139
+ }
140
+ return next('')
141
+ }
142
+ next()
143
+ })
144
+
145
+ app.mount('#app')
@@ -0,0 +1,46 @@
1
+ const defaultTheme = require('tailwindcss/defaultTheme')
2
+
3
+ module.exports = {
4
+ darkMode: 'class',
5
+ content: [
6
+ "./index.html",
7
+ "./src/**/*.{vue,js,ts,jsx,tsx}",
8
+ ],
9
+ theme: {
10
+ screens: {
11
+ '3xs': '390px',
12
+ '2xs': '425px',
13
+ xs: '475px',
14
+ ...defaultTheme.screens,
15
+ '3xl': '1750px',
16
+ },
17
+ extend: {
18
+ fontSize: {
19
+ '3xs': '.45rem',
20
+ '2xs': '.6rem',
21
+ '10xl': '10rem'
22
+ },
23
+ lineClamp: {
24
+ 7: '7',
25
+ 8: '8',
26
+ 9: '9',
27
+ 10: '10',
28
+ },
29
+ boxShadow: {
30
+ card: '0 8px 40px 0 rgba(0, 0, 0, 0.1)',
31
+ 'card-focus': '0 8px 40px 6px rgba(0, 0, 0, 0.1)'
32
+ },
33
+ maxWidth: {
34
+ '32': '8rem',
35
+ '40': '10rem',
36
+ '48': '12rem',
37
+ '56': '14rem',
38
+ '64': '16rem',
39
+ '8xl': '88rem',
40
+ '9xl': '96rem',
41
+ '10xl': '104rem',
42
+ '11xl': '112rem',
43
+ }
44
+ },
45
+ }
46
+ }
@@ -0,0 +1,10 @@
1
+ import { defineConfig } from 'vite'
2
+ import vue from '@vitejs/plugin-vue'
3
+
4
+ // https://vitejs.dev/config/
5
+ export default defineConfig({
6
+ plugins: [vue()],
7
+ server: {
8
+ host: '0.0.0.0',
9
+ },
10
+ })