@mframework/ui 0.0.6-beta6 → 0.1.0-beta.1
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.
- package/dist/adapters/adapter-directus/src/types/ui.d.ts +21 -0
- package/dist/module.d.mts +9 -0
- package/dist/module.d.ts +6 -0
- package/dist/module.js +68 -0
- package/dist/module.json +9 -0
- package/dist/module.mjs +38 -0
- package/dist/modules/ui/src/module.d.ts +8 -0
- package/dist/modules/ui/src/module.js +75 -0
- package/dist/modules/ui/src/runtime/composables/useMToast.d.ts +5 -0
- package/dist/modules/ui/src/runtime/composables/useMToast.js +11 -0
- package/dist/modules/ui/src/runtime/design/tokens.d.ts +22 -0
- package/dist/modules/ui/src/runtime/design/tokens.js +22 -0
- package/dist/modules/ui/src/runtime/plugins/builder.d.ts +3 -0
- package/dist/modules/ui/src/runtime/plugins/builder.js +311 -0
- package/dist/modules/ui/src/runtime/plugins/fontawesome.d.ts +3 -0
- package/dist/modules/ui/src/runtime/plugins/fontawesome.js +9 -0
- package/dist/modules/ui/src/runtime/plugins/formkit.d.ts +3 -0
- package/dist/modules/ui/src/runtime/plugins/formkit.js +8 -0
- package/dist/modules/ui/src/runtime/plugins/motion.d.ts +2 -0
- package/dist/modules/ui/src/runtime/plugins/motion.js +5 -0
- package/dist/modules/ui/src/runtime/plugins/theme-switcher.d.ts +2 -0
- package/dist/modules/ui/src/runtime/plugins/theme-switcher.js +27 -0
- package/dist/modules/ui/src/runtime/plugins/theme.d.ts +2 -0
- package/dist/modules/ui/src/runtime/plugins/theme.js +44 -0
- package/dist/modules/ui/src/runtime/plugins/vuetify.d.ts +3 -0
- package/dist/modules/ui/src/runtime/plugins/vuetify.js +33 -0
- package/dist/modules/ui/src/runtime/search/client.d.ts +2 -0
- package/dist/modules/ui/src/runtime/search/client.js +21 -0
- package/dist/modules/ui/src/runtime/search/plugin.d.ts +2 -0
- package/dist/modules/ui/src/runtime/search/plugin.js +7 -0
- package/dist/modules/ui/src/utils/color.d.ts +2 -0
- package/dist/modules/ui/src/utils/fonts.d.ts +5 -0
- package/dist/modules/ui/src/utils/formkit.d.ts +12 -0
- package/dist/modules/ui/src/utils/icons.d.ts +4 -0
- package/dist/runtime/assets/config/tailwind.conifg.d.ts +0 -0
- package/dist/runtime/components/MButton.d.vue.ts +0 -0
- package/dist/runtime/components/MButton.vue +15 -0
- package/dist/runtime/components/MButton.vue.d.ts +0 -0
- package/dist/runtime/composables/useMToast.d.ts +5 -0
- package/dist/runtime/composables/useMToast.js +11 -0
- package/dist/runtime/plugins/builder.d.ts +3 -0
- package/dist/runtime/plugins/builder.js +311 -0
- package/dist/runtime/plugins/fontawesome.d.ts +3 -0
- package/dist/runtime/plugins/fontawesome.js +9 -0
- package/dist/runtime/plugins/formkit.d.ts +3 -0
- package/dist/runtime/plugins/formkit.js +8 -0
- package/dist/runtime/plugins/icon-switcher.d.ts +1 -1
- package/dist/runtime/plugins/icon-switcher.js +15 -9
- package/dist/runtime/plugins/lightgallery.d.ts +6 -0
- package/dist/runtime/plugins/lightgallery.js +15 -0
- package/dist/runtime/plugins/motion.d.ts +2 -0
- package/dist/runtime/plugins/motion.js +5 -0
- package/dist/runtime/plugins/theme-switcher.d.ts +2 -0
- package/dist/runtime/plugins/theme-switcher.js +27 -0
- package/dist/runtime/plugins/theme.d.ts +1 -1
- package/dist/runtime/plugins/theme.js +31 -25
- package/dist/runtime/plugins/vuetify.d.ts +1 -86
- package/dist/runtime/plugins/vuetify.js +28 -55
- package/dist/runtime/search/components/MSearch.d.vue.ts +0 -0
- package/dist/runtime/search/components/MSearch.vue +19 -0
- package/dist/runtime/search/components/MSearch.vue.d.ts +0 -0
- package/dist/runtime/styles/index.css +5 -0
- package/dist/runtime/styles/tailwind.css +1 -0
- package/dist/runtime/styles/vuetify.css +3 -0
- package/dist/types.d.mts +9 -0
- package/dist/utils/color.d.ts +2 -0
- package/dist/utils/color.js +11 -0
- package/dist/utils/fonts.d.ts +5 -0
- package/dist/utils/fonts.js +18 -0
- package/dist/utils/formkit.d.ts +12 -0
- package/dist/utils/formkit.js +59 -0
- package/dist/utils/icons.d.ts +4 -0
- package/dist/utils/icons.js +36 -0
- package/package.json +32 -20
- package/src/module.ts +105 -0
- package/src/runtime/assets/config/tailwind.conifg.js +42 -0
- package/src/runtime/components/Gallery.vue +66 -0
- package/src/runtime/components/MButton.vue +17 -0
- package/src/runtime/composables/useMToast.ts +14 -0
- package/src/runtime/plugins/builder.ts +326 -0
- package/src/runtime/plugins/fontawesome.ts +11 -0
- package/src/runtime/plugins/formkit.ts +9 -0
- package/src/runtime/plugins/lightgallery.js +21 -0
- package/src/runtime/plugins/motion.ts +6 -0
- package/src/runtime/plugins/theme-switcher.ts +32 -0
- package/src/runtime/plugins/theme.ts +57 -0
- package/src/runtime/plugins/vuetify.ts +36 -0
- package/src/runtime/styles/index.scss +101 -0
- package/{runtime/assets/css → src/runtime/styles}/tailwind.css +1 -3
- package/src/runtime/styles/vuetify.scss +5 -0
- package/src/types/runtime-config.d.ts +12 -0
- package/src/utils/color.js +11 -0
- package/src/utils/fonts.js +18 -0
- package/src/utils/formkit.js +59 -0
- package/src/utils/icons.js +36 -0
- package/dist/runtime/plugins/icons.d.ts +0 -4
- package/dist/runtime/plugins/icons.js +0 -13
- package/module.ts +0 -72
- package/runtime/plugins/icon-switcher.ts +0 -32
- package/runtime/plugins/theme.ts +0 -29
- package/runtime/plugins/vuetify.js +0 -12
- package/runtime/plugins/vuetify.ts +0 -64
- package/tsconfig.json +0 -16
- package/type.d.ts +0 -5
- package/types/ui/api/global-search.js +0 -1
- package/types/ui/api/global-search.ts +0 -8
- package/types/ui/blocks/block-button-group.js +0 -1
- package/types/ui/blocks/block-button-group.ts +0 -7
- package/types/ui/blocks/block-button.js +0 -1
- package/types/ui/blocks/block-button.ts +0 -14
- package/types/ui/blocks/block-column.js +0 -1
- package/types/ui/blocks/block-column.ts +0 -20
- package/types/ui/blocks/block-cta.js +0 -1
- package/types/ui/blocks/block-cta.ts +0 -10
- package/types/ui/blocks/block-divider.js +0 -1
- package/types/ui/blocks/block-divider.ts +0 -4
- package/types/ui/blocks/block-faq.js +0 -1
- package/types/ui/blocks/block-faq.ts +0 -12
- package/types/ui/blocks/block-form.js +0 -1
- package/types/ui/blocks/block-form.ts +0 -8
- package/types/ui/blocks/block-gallery.js +0 -1
- package/types/ui/blocks/block-gallery.ts +0 -14
- package/types/ui/blocks/block-hero.js +0 -1
- package/types/ui/blocks/block-hero.ts +0 -12
- package/types/ui/blocks/block-html.js +0 -1
- package/types/ui/blocks/block-html.ts +0 -4
- package/types/ui/blocks/block-logocloud.js +0 -1
- package/types/ui/blocks/block-logocloud.ts +0 -14
- package/types/ui/blocks/block-quote.js +0 -1
- package/types/ui/blocks/block-quote.ts +0 -11
- package/types/ui/blocks/block-richtext.js +0 -1
- package/types/ui/blocks/block-richtext.ts +0 -7
- package/types/ui/blocks/block-steps.js +0 -1
- package/types/ui/blocks/block-steps.ts +0 -22
- package/types/ui/blocks/block-team.js +0 -1
- package/types/ui/blocks/block-team.ts +0 -6
- package/types/ui/blocks/block-testimonial.js +0 -1
- package/types/ui/blocks/block-testimonial.ts +0 -14
- package/types/ui/blocks/block-video.js +0 -1
- package/types/ui/blocks/block-video.ts +0 -10
- package/types/ui/blocks/block.js +0 -1
- package/types/ui/blocks/block.ts +0 -49
- package/types/ui/blocks/index.js +0 -1
- package/types/ui/blocks/index.ts +0 -18
- package/types/ui/component.js +0 -1
- package/types/ui/component.ts +0 -7
- package/types/ui/content/category.js +0 -1
- package/types/ui/content/category.ts +0 -11
- package/types/ui/content/form.js +0 -1
- package/types/ui/content/form.ts +0 -20
- package/types/ui/content/index.js +0 -1
- package/types/ui/content/index.ts +0 -6
- package/types/ui/content/page.js +0 -1
- package/types/ui/content/page.ts +0 -76
- package/types/ui/content/post.js +0 -1
- package/types/ui/content/post.ts +0 -39
- package/types/ui/content/team.js +0 -1
- package/types/ui/content/team.ts +0 -16
- package/types/ui/content/testimonial.js +0 -1
- package/types/ui/content/testimonial.ts +0 -19
- package/types/ui/env.d.ts +0 -8
- package/types/ui/form.js +0 -1
- package/types/ui/form.ts +0 -17
- package/types/ui/help/index.js +0 -1
- package/types/ui/help/index.ts +0 -53
- package/types/ui/meta/analytics.js +0 -1
- package/types/ui/meta/analytics.ts +0 -18
- package/types/ui/meta/config.js +0 -1
- package/types/ui/meta/config.ts +0 -21
- package/types/ui/meta/globals.js +0 -1
- package/types/ui/meta/globals.ts +0 -30
- package/types/ui/meta/index.js +0 -1
- package/types/ui/meta/index.ts +0 -6
- package/types/ui/meta/navigation.js +0 -1
- package/types/ui/meta/navigation.ts +0 -32
- package/types/ui/meta/redirect.js +0 -1
- package/types/ui/meta/redirect.ts +0 -13
- package/types/ui/meta/seo.js +0 -1
- package/types/ui/meta/seo.ts +0 -19
- package/types/ui/os/contact.js +0 -1
- package/types/ui/os/contact.ts +0 -23
- package/types/ui/os/conversation.js +0 -1
- package/types/ui/os/conversation.ts +0 -25
- package/types/ui/os/index.js +0 -1
- package/types/ui/os/index.ts +0 -16
- package/types/ui/os/organization.js +0 -1
- package/types/ui/os/organization.ts +0 -54
- package/types/ui/os/os-activity.js +0 -1
- package/types/ui/os/os-activity.ts +0 -28
- package/types/ui/os/os-deal.js +0 -1
- package/types/ui/os/os-deal.ts +0 -45
- package/types/ui/os/os-expense.js +0 -1
- package/types/ui/os/os-expense.ts +0 -22
- package/types/ui/os/os-invoice.js +0 -1
- package/types/ui/os/os-invoice.ts +0 -48
- package/types/ui/os/os-item.js +0 -1
- package/types/ui/os/os-item.ts +0 -18
- package/types/ui/os/os-payment.js +0 -1
- package/types/ui/os/os-payment.ts +0 -29
- package/types/ui/os/os-project.js +0 -1
- package/types/ui/os/os-project.ts +0 -47
- package/types/ui/os/os-proposal.js +0 -1
- package/types/ui/os/os-proposal.ts +0 -84
- package/types/ui/os/os-settings.js +0 -1
- package/types/ui/os/os-settings.ts +0 -19
- package/types/ui/os/os-subscription.js +0 -1
- package/types/ui/os/os-subscription.ts +0 -12
- package/types/ui/os/os-task.js +0 -1
- package/types/ui/os/os-task.ts +0 -34
- package/types/ui/os/os-tax-rate.js +0 -1
- package/types/ui/os/os-tax-rate.ts +0 -13
- package/types/ui/pageComponentMap.js +0 -7
- package/types/ui/pageComponentMap.ts +0 -8
- package/types/ui/pagination.js +0 -1
- package/types/ui/pagination.ts +0 -6
- package/types/ui/schema.d.ts +0 -39
- package/types/ui/schema.js +0 -1
- package/types/ui/schema.ts +0 -151
- package/types/ui/state.js +0 -1
- package/types/ui/state.ts +0 -5
- package/types/ui/system/file.js +0 -1
- package/types/ui/system/file.ts +0 -46
- package/types/ui/system/folder.js +0 -1
- package/types/ui/system/folder.ts +0 -8
- package/types/ui/system/index.js +0 -1
- package/types/ui/system/index.ts +0 -4
- package/types/ui/system/role.js +0 -1
- package/types/ui/system/role.ts +0 -21
- package/types/ui/system/user.js +0 -1
- package/types/ui/system/user.ts +0 -56
- package/types/ui.ts +0 -23
- /package/{types → dist/adapters/adapter-directus/src/types}/ui.js +0 -0
- /package/{utils → dist/modules/ui/src/utils}/color.js +0 -0
- /package/{utils → dist/modules/ui/src/utils}/fonts.js +0 -0
- /package/{utils → dist/modules/ui/src/utils}/formkit.js +0 -0
- /package/{utils → dist/modules/ui/src/utils}/icons.js +0 -0
- /package/{runtime → dist/runtime}/assets/config/tailwind.conifg.js +0 -0
- /package/{runtime → src/runtime}/design/tokens.ts +0 -0
- /package/{runtime → src/runtime}/search/client.ts +0 -0
- /package/{runtime → src/runtime}/search/components/MSearch.vue +0 -0
- /package/{runtime → src/runtime}/search/plugin.ts +0 -0
- /package/{utils → src/utils}/color.ts +0 -0
- /package/{utils → src/utils}/fonts.ts +0 -0
- /package/{utils → src/utils}/formkit.ts +0 -0
- /package/{utils → src/utils}/icons.ts +0 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import {
|
|
2
|
+
defineNuxtPlugin,
|
|
3
|
+
useRuntimeConfig
|
|
4
|
+
} from 'nuxt/app'
|
|
5
|
+
import {
|
|
6
|
+
useTheme
|
|
7
|
+
} from 'vuetify'
|
|
8
|
+
|
|
9
|
+
export default defineNuxtPlugin(() => {
|
|
10
|
+
if (process.server) return
|
|
11
|
+
|
|
12
|
+
const theme = useTheme()
|
|
13
|
+
const config = useRuntimeConfig()
|
|
14
|
+
|
|
15
|
+
const baseColors = {
|
|
16
|
+
primary: 'var(--m-primary)',
|
|
17
|
+
secondary: 'var(--m-secondary)',
|
|
18
|
+
accent: 'var(--m-accent)',
|
|
19
|
+
surface: 'var(--m-surface)',
|
|
20
|
+
background: 'var(--m-muted)',
|
|
21
|
+
border: 'var(--m-border)',
|
|
22
|
+
|
|
23
|
+
// Required Vuetify system colors
|
|
24
|
+
success: '#22c55e',
|
|
25
|
+
warning: '#f59e0b',
|
|
26
|
+
error: '#ef4444',
|
|
27
|
+
info: '#3b82f6',
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
// Vuetify internal required fields
|
|
31
|
+
'on-primary': '#ffffff',
|
|
32
|
+
'on-secondary': '#ffffff',
|
|
33
|
+
'on-surface': '#ffffff',
|
|
34
|
+
'on-background': '#ffffff',
|
|
35
|
+
'on-success': '#ffffff',
|
|
36
|
+
'on-warning': '#ffffff',
|
|
37
|
+
'on-error': '#ffffff',
|
|
38
|
+
'on-info': '#ffffff'
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const defaultTheme = config.public.mframeworkUi?.theme || 'light'
|
|
42
|
+
|
|
43
|
+
theme.global.name.value = defaultTheme
|
|
44
|
+
|
|
45
|
+
theme.themes.value = {
|
|
46
|
+
light: {
|
|
47
|
+
dark: false,
|
|
48
|
+
colors: baseColors,
|
|
49
|
+
variables: {}
|
|
50
|
+
},
|
|
51
|
+
dark: {
|
|
52
|
+
dark: true,
|
|
53
|
+
colors: baseColors,
|
|
54
|
+
variables: {}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
})
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { defineNuxtPlugin, useRuntimeConfig } from 'nuxt/app'
|
|
2
|
+
import { createVuetify } from 'vuetify'
|
|
3
|
+
import * as components from 'vuetify/components'
|
|
4
|
+
import * as directives from 'vuetify/directives'
|
|
5
|
+
import 'vuetify/styles'
|
|
6
|
+
|
|
7
|
+
export default defineNuxtPlugin((nuxtApp) => {
|
|
8
|
+
const config = useRuntimeConfig()
|
|
9
|
+
const theme = config.public.mframeworkUi?.theme || 'light'
|
|
10
|
+
|
|
11
|
+
const vuetify = createVuetify({
|
|
12
|
+
components,
|
|
13
|
+
directives,
|
|
14
|
+
theme: {
|
|
15
|
+
defaultTheme: theme,
|
|
16
|
+
themes: {
|
|
17
|
+
light: {
|
|
18
|
+
dark: false,
|
|
19
|
+
colors: {
|
|
20
|
+
primary: '#3b82f6',
|
|
21
|
+
secondary: '#64748b'
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
dark: {
|
|
25
|
+
dark: true,
|
|
26
|
+
colors: {
|
|
27
|
+
primary: '#3b82f6',
|
|
28
|
+
secondary: '#64748b'
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
nuxtApp.vueApp.use(vuetify)
|
|
36
|
+
})
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
@import './tailwind.css';
|
|
2
|
+
|
|
3
|
+
// Your design tokens, utilities, etc.
|
|
4
|
+
:root {
|
|
5
|
+
--m-primary: #3b82f6;
|
|
6
|
+
--m-secondary: #64748b;
|
|
7
|
+
--m-accent: #10b981;
|
|
8
|
+
--m-muted: #f3f4f6;
|
|
9
|
+
--m-surface: #ffffff;
|
|
10
|
+
--m-border: #e5e7eb;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.dark {
|
|
14
|
+
--m-primary: #60a5fa;
|
|
15
|
+
--m-secondary: #94a3b8;
|
|
16
|
+
--m-accent: #34d399;
|
|
17
|
+
--m-muted: #1f2937;
|
|
18
|
+
--m-surface: #111827;
|
|
19
|
+
--m-border: #374151;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// GrapesJS canvas and editor styling
|
|
23
|
+
/* Let's highlight canvas boundaries */
|
|
24
|
+
#gjs {
|
|
25
|
+
border: 3px solid #444;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/* Theming */
|
|
29
|
+
|
|
30
|
+
/* Primary color for the background */
|
|
31
|
+
.gjs-one-bg {
|
|
32
|
+
background-color: #78366a;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/* Secondary color for the text color */
|
|
36
|
+
.gjs-two-color {
|
|
37
|
+
color: rgba(255, 255, 255, 0.7);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/* Tertiary color for the background */
|
|
41
|
+
.gjs-three-bg {
|
|
42
|
+
background-color: #ec5896;
|
|
43
|
+
color: white;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/* Quaternary color for the text color */
|
|
47
|
+
.gjs-four-color,
|
|
48
|
+
.gjs-four-color-h:hover {
|
|
49
|
+
color: #ec5896;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/* Reset some default styling */
|
|
53
|
+
.gjs-cv-canvas {
|
|
54
|
+
top: 0;
|
|
55
|
+
width: 100%;
|
|
56
|
+
height: 100%;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.gjs-block {
|
|
60
|
+
width: auto;
|
|
61
|
+
height: auto;
|
|
62
|
+
min-height: auto;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.panel__top {
|
|
66
|
+
padding: 0;
|
|
67
|
+
width: 100%;
|
|
68
|
+
display: flex;
|
|
69
|
+
position: initial;
|
|
70
|
+
justify-content: center;
|
|
71
|
+
justify-content: space-between;
|
|
72
|
+
}
|
|
73
|
+
.panel__basic-actions {
|
|
74
|
+
position: initial;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.editor-row {
|
|
78
|
+
display: flex;
|
|
79
|
+
justify-content: flex-start;
|
|
80
|
+
align-items: stretch;
|
|
81
|
+
flex-wrap: nowrap;
|
|
82
|
+
height: 300px;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.editor-canvas {
|
|
86
|
+
flex-grow: 1;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.panel__right {
|
|
90
|
+
flex-basis: 230px;
|
|
91
|
+
position: relative;
|
|
92
|
+
overflow-y: auto;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.panel__switcher {
|
|
96
|
+
position: initial;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.panel__devices {
|
|
100
|
+
position: initial;
|
|
101
|
+
}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
/* @mframework/ui/runtime/assets/css/tailwind.css */
|
|
2
2
|
|
|
3
3
|
/* Tailwind base (if using Tailwind 3 style) */
|
|
4
|
-
@
|
|
5
|
-
@tailwind components;
|
|
6
|
-
@tailwind utilities;
|
|
4
|
+
@import "tailwindcss/preflight";
|
|
7
5
|
|
|
8
6
|
/* Vuetify + Tailwind coexistence tips:
|
|
9
7
|
- Avoid global resets that fight Vuetify
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
function getContrastColor(hexColor) {
|
|
2
|
+
// Convert hex color to RGB format
|
|
3
|
+
const red = parseInt(hexColor.slice(1, 3), 16);
|
|
4
|
+
const green = parseInt(hexColor.slice(3, 5), 16);
|
|
5
|
+
const blue = parseInt(hexColor.slice(5, 7), 16);
|
|
6
|
+
// Calculate relative luminance of the color
|
|
7
|
+
const luminance = (0.2126 * red + 0.7152 * green + 0.0722 * blue) / 255;
|
|
8
|
+
// Return black or white depending on the luminance value
|
|
9
|
+
return luminance > 0.5 ? '#000000' : '#ffffff';
|
|
10
|
+
}
|
|
11
|
+
export { getContrastColor };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export const formatFonts = (families, defaultWeights = [400]) => {
|
|
2
|
+
const formatted = [];
|
|
3
|
+
for (const font in families) {
|
|
4
|
+
const formattedFont = font.replace(/ /g, '+'); // Replace spaces with '+'
|
|
5
|
+
const weights = families[font];
|
|
6
|
+
if (weights === true) {
|
|
7
|
+
for (const weight of defaultWeights) {
|
|
8
|
+
formatted.push(`${formattedFont}:${weight}`);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
else if (Array.isArray(weights)) {
|
|
12
|
+
for (const weight of weights) {
|
|
13
|
+
formatted.push(`${formattedFont}:${weight}`);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
return formatted;
|
|
18
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { unref } from 'vue';
|
|
2
|
+
function convertBoolean(value) {
|
|
3
|
+
if (value === 'true' || value === 'false') {
|
|
4
|
+
return value === 'true';
|
|
5
|
+
}
|
|
6
|
+
else {
|
|
7
|
+
return value;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
function mapCondition(condition, target) {
|
|
11
|
+
switch (condition) {
|
|
12
|
+
case 'is_empty':
|
|
13
|
+
return `!$get(${target}).value)`;
|
|
14
|
+
case 'is_filled':
|
|
15
|
+
return `$get(${target}).value)`;
|
|
16
|
+
default:
|
|
17
|
+
return undefined;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export function mapConditions(conditions) {
|
|
21
|
+
// Both $el and $cmp schema nodes can leverage an if property that roughly equates to a v-if in Vue. If the expression assigned to the if property is truthy, the node is rendered, otherwise it is not:
|
|
22
|
+
}
|
|
23
|
+
export function transformSchema(schema) {
|
|
24
|
+
// Loop through the form schema from Directus
|
|
25
|
+
// This is required for FormKit to work
|
|
26
|
+
const items = unref(schema);
|
|
27
|
+
return items.map((item) => {
|
|
28
|
+
const { conditions, field, name, children, ...props } = item;
|
|
29
|
+
// console.log('conditions', conditions);
|
|
30
|
+
// console.log('mapCondition', mapCondition(conditions[0].condition, field));
|
|
31
|
+
const cmpSchema = {
|
|
32
|
+
$cmp: item.$el ? item.$el : 'FormKit',
|
|
33
|
+
children: children,
|
|
34
|
+
// if: conditions ? mapCondition(conditions[0].condition, field) : undefined,
|
|
35
|
+
props: {
|
|
36
|
+
id: name,
|
|
37
|
+
...props,
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
// Switch statement to handle item widths
|
|
41
|
+
switch (item.width) {
|
|
42
|
+
case '33':
|
|
43
|
+
cmpSchema.props.outerClass = 'md:col-span-2';
|
|
44
|
+
break;
|
|
45
|
+
case '50':
|
|
46
|
+
cmpSchema.props.outerClass = 'md:col-span-3';
|
|
47
|
+
break;
|
|
48
|
+
case '67':
|
|
49
|
+
cmpSchema.props.outerClass = 'md:col-span-4';
|
|
50
|
+
break;
|
|
51
|
+
case '100':
|
|
52
|
+
cmpSchema.props.outerClass = 'md:col-span-6';
|
|
53
|
+
break;
|
|
54
|
+
default:
|
|
55
|
+
cmpSchema.props.outerClass = 'md:col-span-6';
|
|
56
|
+
}
|
|
57
|
+
return cmpSchema;
|
|
58
|
+
});
|
|
59
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export const fileIconMap = {
|
|
2
|
+
folder: 'material-symbols:folder',
|
|
3
|
+
// Images
|
|
4
|
+
'image/jpeg': 'material-symbols:image',
|
|
5
|
+
'image/png': 'material-symbols:image',
|
|
6
|
+
'image/gif': 'material-symbols:image',
|
|
7
|
+
'image/svg+xml': 'material-symbols:image',
|
|
8
|
+
'image/webp': 'material-symbols:image',
|
|
9
|
+
// Videos
|
|
10
|
+
'video/mp4': 'material-symbols:smart-display',
|
|
11
|
+
'video/quicktime': 'material-symbols:smart-display',
|
|
12
|
+
// Audio
|
|
13
|
+
'audio/mp3': 'material-symbols:audio-file',
|
|
14
|
+
'audio/aac': 'material-symbols:audio-file',
|
|
15
|
+
'audio/wav': 'material-symbols:audio-file',
|
|
16
|
+
'audio/ogg': 'material-symbols:audio-file',
|
|
17
|
+
// Text
|
|
18
|
+
'text/csv': 'material-symbols:csv',
|
|
19
|
+
'text/plain': 'material-symbols:text-snippet',
|
|
20
|
+
// Files
|
|
21
|
+
'application/pdf': 'material-symbols:picture-as-pdf-sharp',
|
|
22
|
+
'application/vnd.ms-excel': 'material-symbols:sheets',
|
|
23
|
+
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet': 'material-symbols:sheets',
|
|
24
|
+
'application/msword': 'material-symbols:docs',
|
|
25
|
+
'application/vnd.openxmlformats-officedocument.wordprocessingml.document': 'material-symbols:docs',
|
|
26
|
+
'application/vnd.ms-powerpoint': 'material-symbols:slides',
|
|
27
|
+
'application/vnd.openxmlformats-officedocument.presentationml.presentation': 'material-symbols:slides',
|
|
28
|
+
};
|
|
29
|
+
export function getFileIcon(filetype) {
|
|
30
|
+
if (!filetype)
|
|
31
|
+
return 'material-symbols:attachment';
|
|
32
|
+
if (typeof filetype === 'string' && !(filetype in fileIconMap)) {
|
|
33
|
+
return 'material-symbols:attachment';
|
|
34
|
+
}
|
|
35
|
+
return fileIconMap[filetype];
|
|
36
|
+
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
// @mframework/ui/runtime/plugins/icons.ts
|
|
2
|
-
import { defineNuxtPlugin } from '#imports';
|
|
3
|
-
import { library } from '@fortawesome/fontawesome-svg-core';
|
|
4
|
-
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
|
|
5
|
-
import { fas } from '@fortawesome/free-solid-svg-icons';
|
|
6
|
-
import '@fortawesome/fontawesome-free/css/all.css';
|
|
7
|
-
import '@mdi/font/css/materialdesignicons.css';
|
|
8
|
-
export default defineNuxtPlugin((nuxtApp) => {
|
|
9
|
-
// Add all solid icons (you can be more selective if you want)
|
|
10
|
-
library.add(fas);
|
|
11
|
-
// Register global FA component
|
|
12
|
-
nuxtApp.vueApp.component('FaIcon', FontAwesomeIcon);
|
|
13
|
-
});
|
package/module.ts
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
// @mframework/ui/module.ts
|
|
2
|
-
import {
|
|
3
|
-
defineNuxtModule,
|
|
4
|
-
addPlugin,
|
|
5
|
-
addComponentsDir,
|
|
6
|
-
createResolver,
|
|
7
|
-
installModule,
|
|
8
|
-
resolveModule
|
|
9
|
-
} from '@nuxt/kit'
|
|
10
|
-
|
|
11
|
-
export interface MFrameworkUiOptions {
|
|
12
|
-
image?: Record<string, any>
|
|
13
|
-
fonts?: Record<string, any>
|
|
14
|
-
vuetify?: {
|
|
15
|
-
vuetifyOptions?: Record<string, any>
|
|
16
|
-
}
|
|
17
|
-
tailwind?: {
|
|
18
|
-
enable?: boolean
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export default defineNuxtModule<MFrameworkUiOptions>({
|
|
23
|
-
meta: {
|
|
24
|
-
name: '@mframework/ui',
|
|
25
|
-
configKey: 'mframeworkUi'
|
|
26
|
-
},
|
|
27
|
-
defaults: {
|
|
28
|
-
image: {},
|
|
29
|
-
fonts: {},
|
|
30
|
-
vuetify: {
|
|
31
|
-
vuetifyOptions: {
|
|
32
|
-
icons: {
|
|
33
|
-
defaultSet: 'mdi'
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
tailwind: {
|
|
38
|
-
enable: true
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
|
|
42
|
-
async setup(options, nuxt) {
|
|
43
|
-
const { resolve } = createResolver(import.meta.url)
|
|
44
|
-
|
|
45
|
-
//
|
|
46
|
-
// 1. Expose options to runtime
|
|
47
|
-
//
|
|
48
|
-
nuxt.options.runtimeConfig.public.mframeworkUi = options
|
|
49
|
-
|
|
50
|
-
//
|
|
51
|
-
// 2. Install @nuxt/fonts
|
|
52
|
-
//
|
|
53
|
-
await installModule('@nuxt/fonts', options.fonts || {})
|
|
54
|
-
|
|
55
|
-
//
|
|
56
|
-
// 3. Install Vuetify via vuetify-nuxt-module (optional).
|
|
57
|
-
// First check whether the consuming project actually has `vuetify`
|
|
58
|
-
// installed to avoid Nuxt failing during module resolution.
|
|
59
|
-
//
|
|
60
|
-
let vuetifyModulePath: string | null = null
|
|
61
|
-
try {
|
|
62
|
-
vuetifyModulePath = resolveModule('vuetify-nuxt-module', { paths: [nuxt.options.modulesDir] })
|
|
63
|
-
} catch (err) {
|
|
64
|
-
// Module not found, skip Vuetify installation
|
|
65
|
-
console.warn('[mframework-ui] Vuetify not found, skipping Vuetify setup.')
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
if (vuetifyModulePath) {
|
|
69
|
-
await installModule(vuetifyModulePath, options.vuetify || {})
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
})
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { defineNuxtPlugin } from '#app'
|
|
2
|
-
import { useVuetify } from 'vuetify-nuxt-module/runtime'
|
|
3
|
-
|
|
4
|
-
export default defineNuxtPlugin((nuxtApp) => {
|
|
5
|
-
const vuetify = useVuetify()
|
|
6
|
-
|
|
7
|
-
// If Vuetify isn't ready yet, skip plugin initialization
|
|
8
|
-
if (!vuetify || !vuetify.framework) {
|
|
9
|
-
console.warn('[mframework-ui] Vuetify not ready for icon-switcher plugin')
|
|
10
|
-
return
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const stored =
|
|
14
|
-
typeof localStorage !== 'undefined'
|
|
15
|
-
? localStorage.getItem('mframework-icon-set')
|
|
16
|
-
: null
|
|
17
|
-
|
|
18
|
-
const initial = stored || 'mdi'
|
|
19
|
-
|
|
20
|
-
vuetify.framework.icons = vuetify.framework.icons || {}
|
|
21
|
-
vuetify.framework.icons.defaultSet = initial
|
|
22
|
-
|
|
23
|
-
const setIconSet = (name: string) => {
|
|
24
|
-
vuetify.framework.icons.defaultSet = name
|
|
25
|
-
localStorage.setItem('mframework-icon-set', name)
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
nuxtApp.provide('mIcons', {
|
|
29
|
-
setIconSet,
|
|
30
|
-
current: () => vuetify.framework.icons.defaultSet
|
|
31
|
-
})
|
|
32
|
-
})
|
package/runtime/plugins/theme.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { useTheme } from 'vuetify'
|
|
2
|
-
|
|
3
|
-
export default (nuxtApp: any) => {
|
|
4
|
-
const theme = useTheme()
|
|
5
|
-
// Attempt to read runtime config from nuxtApp (fallbacks to undefined)
|
|
6
|
-
const config: any = (nuxtApp && (nuxtApp as any).$config && (nuxtApp as any).$config.public && (nuxtApp as any).$config.public.mframeworkUi) || {}
|
|
7
|
-
|
|
8
|
-
// 1. Load persisted theme
|
|
9
|
-
const stored = typeof localStorage !== 'undefined' ? localStorage.getItem('mframework-theme') : null
|
|
10
|
-
const initial = stored || config?.theme?.default || 'light'
|
|
11
|
-
;(theme as any).global.name.value = initial
|
|
12
|
-
|
|
13
|
-
// 2. Expose a global toggle
|
|
14
|
-
const toggleTheme = () => {
|
|
15
|
-
const newTheme = (theme as any).global.current.value.dark ? 'light' : 'dark'
|
|
16
|
-
;(theme as any).global.name.value = newTheme
|
|
17
|
-
if (typeof localStorage !== 'undefined') localStorage.setItem('mframework-theme', newTheme)
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
// 3. Expose to app
|
|
21
|
-
nuxtApp.provide('mTheme', {
|
|
22
|
-
theme,
|
|
23
|
-
toggleTheme,
|
|
24
|
-
setTheme: (name: string) => {
|
|
25
|
-
;(theme as any).global.name.value = name
|
|
26
|
-
if (typeof localStorage !== 'undefined') localStorage.setItem('mframework-theme', name)
|
|
27
|
-
}
|
|
28
|
-
})
|
|
29
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { createVuetify } from 'vuetify';
|
|
2
|
-
import * as components from 'vuetify/components';
|
|
3
|
-
import * as directives from 'vuetify/directives';
|
|
4
|
-
import 'vuetify/styles';
|
|
5
|
-
import { defineNuxtPlugin } from '#app';
|
|
6
|
-
export default defineNuxtPlugin((nuxtApp) => {
|
|
7
|
-
const vuetify = createVuetify({
|
|
8
|
-
components,
|
|
9
|
-
directives
|
|
10
|
-
});
|
|
11
|
-
nuxtApp.vueApp.use(vuetify);
|
|
12
|
-
});
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
// plugins/vuetify.ts
|
|
2
|
-
import '@mdi/font/css/materialdesignicons.css'
|
|
3
|
-
|
|
4
|
-
import 'vuetify/styles'
|
|
5
|
-
import { createVuetify } from 'vuetify'
|
|
6
|
-
import { aliases, fa } from 'vuetify/iconsets/fa-svg'
|
|
7
|
-
import { library } from '@fortawesome/fontawesome-svg-core'
|
|
8
|
-
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
|
|
9
|
-
import { fas } from '@fortawesome/free-solid-svg-icons'
|
|
10
|
-
import * as components from 'vuetify/components'
|
|
11
|
-
import * as labsComponents from 'vuetify/labs/components'
|
|
12
|
-
import * as directives from 'vuetify/directives'
|
|
13
|
-
import { mdi } from 'vuetify/iconsets/mdi'
|
|
14
|
-
|
|
15
|
-
// Register fontawesome icons at module scope
|
|
16
|
-
library.add(fas)
|
|
17
|
-
|
|
18
|
-
// Create Vuetify instance at module scope so other runtime plugins can import it
|
|
19
|
-
export const vuetify = createVuetify({
|
|
20
|
-
ssr: true,
|
|
21
|
-
directives,
|
|
22
|
-
icons: {
|
|
23
|
-
defaultSet: 'fa',
|
|
24
|
-
aliases,
|
|
25
|
-
sets: {
|
|
26
|
-
fa,
|
|
27
|
-
mdi,
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
components: {
|
|
31
|
-
...components,
|
|
32
|
-
...labsComponents,
|
|
33
|
-
},
|
|
34
|
-
theme: {
|
|
35
|
-
defaultTheme: 'light',
|
|
36
|
-
themes: {
|
|
37
|
-
light: {
|
|
38
|
-
dark: false,
|
|
39
|
-
variables: {}, // required to avoid Vuetify crash
|
|
40
|
-
colors: {
|
|
41
|
-
primary: '#6200EE',
|
|
42
|
-
'primary-darken-1': '#3700B3',
|
|
43
|
-
secondary: '#03DAC6',
|
|
44
|
-
'secondary-darken-1': '#018786',
|
|
45
|
-
error: '#B00020',
|
|
46
|
-
info: '#2196F3',
|
|
47
|
-
success: '#4CAF50',
|
|
48
|
-
warning: '#FB8C00',
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
dark: {
|
|
52
|
-
dark: true,
|
|
53
|
-
variables: {},
|
|
54
|
-
colors: {},
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
})
|
|
59
|
-
|
|
60
|
-
export default (nuxtApp: any) => {
|
|
61
|
-
// Register FontAwesome component on the actual Vue app instance
|
|
62
|
-
nuxtApp.vueApp.component('font-awesome-icon', FontAwesomeIcon)
|
|
63
|
-
nuxtApp.vueApp.use(vuetify)
|
|
64
|
-
}
|
package/tsconfig.json
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"declaration": true,
|
|
4
|
-
"emitDeclarationOnly": false,
|
|
5
|
-
"outDir": "dist",
|
|
6
|
-
"moduleResolution": "bundler",
|
|
7
|
-
"module": "ESNext",
|
|
8
|
-
"target": "ESNext",
|
|
9
|
-
"strict": true,
|
|
10
|
-
"jsx": "react-jsx",
|
|
11
|
-
"skipLibCheck": true,
|
|
12
|
-
"noEmitOnError": false
|
|
13
|
-
},
|
|
14
|
-
"include": ["runtime/**/*", "src/**/*", "types/**/*"],
|
|
15
|
-
"exclude": ["node_modules", "dist"]
|
|
16
|
-
}
|
package/type.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { Post, Page } from '../content';
|
|
2
|
-
|
|
3
|
-
export interface BlockButton {
|
|
4
|
-
id: string;
|
|
5
|
-
sort: number | null;
|
|
6
|
-
type: ('pages' | 'posts' | 'external') | null;
|
|
7
|
-
label: string | null;
|
|
8
|
-
color: 'primary' | 'white' | 'gray' | 'white' | 'black';
|
|
9
|
-
variant: 'solid' | 'outline' | 'ghost' | 'link' | 'soft';
|
|
10
|
-
page: string | Page | null;
|
|
11
|
-
post: string | Post | null;
|
|
12
|
-
external_url: string | null;
|
|
13
|
-
icon: string | null;
|
|
14
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|