@mframework/ui 0.1.0-beta.2 → 0.1.0-beta.4
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/module.d.mts +3 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +28 -6
- package/dist/runtime/assets/config/tailwind.conifg.js +37 -6
- package/dist/runtime/components/Gallery.d.vue.ts +0 -0
- package/{src → dist}/runtime/components/Gallery.vue +23 -33
- package/dist/runtime/components/Gallery.vue.d.ts +0 -0
- package/dist/runtime/composables/useMToast.d.ts +0 -5
- package/dist/runtime/composables/useMToast.js +9 -9
- package/dist/runtime/design/tokens.d.ts +0 -22
- package/dist/runtime/design/tokens.js +20 -20
- package/dist/runtime/plugins/builder.d.ts +0 -3
- package/dist/runtime/plugins/builder.js +328 -303
- package/dist/runtime/plugins/fontawesome.d.ts +0 -3
- package/dist/runtime/plugins/fontawesome.js +7 -7
- package/dist/runtime/plugins/formkit.d.ts +0 -3
- package/dist/runtime/plugins/formkit.js +5 -5
- package/dist/runtime/plugins/lightgallery.d.ts +0 -6
- package/dist/runtime/plugins/lightgallery.js +20 -14
- package/dist/runtime/plugins/motion.d.ts +0 -2
- package/dist/runtime/plugins/motion.js +3 -3
- package/dist/runtime/plugins/theme-switcher.d.ts +0 -2
- package/dist/runtime/plugins/theme-switcher.js +22 -25
- package/dist/runtime/plugins/theme.d.ts +0 -2
- package/dist/runtime/plugins/theme.js +46 -32
- package/dist/runtime/plugins/vuetify.d.ts +0 -3
- package/dist/runtime/plugins/vuetify.js +30 -30
- package/dist/runtime/search/client.d.ts +0 -2
- package/dist/runtime/search/client.js +12 -19
- package/dist/runtime/search/plugin.d.ts +0 -2
- package/dist/runtime/search/plugin.js +5 -5
- package/dist/runtime/styles/index.css +93 -0
- package/dist/runtime/styles/tailwind.css +1 -1
- package/package.json +3 -4
- package/dist/adapters/adapter-directus/src/types/ui.d.ts +0 -21
- package/dist/adapters/adapter-directus/src/types/ui.js +0 -1
- package/dist/module.d.ts +0 -6
- package/dist/module.js +0 -68
- package/dist/modules/ui/src/module.d.ts +0 -8
- package/dist/modules/ui/src/module.js +0 -75
- package/dist/modules/ui/src/runtime/composables/useMToast.d.ts +0 -5
- package/dist/modules/ui/src/runtime/composables/useMToast.js +0 -11
- package/dist/modules/ui/src/runtime/design/tokens.d.ts +0 -22
- package/dist/modules/ui/src/runtime/design/tokens.js +0 -22
- package/dist/modules/ui/src/runtime/plugins/builder.d.ts +0 -3
- package/dist/modules/ui/src/runtime/plugins/builder.js +0 -311
- package/dist/modules/ui/src/runtime/plugins/fontawesome.d.ts +0 -3
- package/dist/modules/ui/src/runtime/plugins/fontawesome.js +0 -9
- package/dist/modules/ui/src/runtime/plugins/formkit.d.ts +0 -3
- package/dist/modules/ui/src/runtime/plugins/formkit.js +0 -8
- package/dist/modules/ui/src/runtime/plugins/motion.d.ts +0 -2
- package/dist/modules/ui/src/runtime/plugins/motion.js +0 -5
- package/dist/modules/ui/src/runtime/plugins/theme-switcher.d.ts +0 -2
- package/dist/modules/ui/src/runtime/plugins/theme-switcher.js +0 -27
- package/dist/modules/ui/src/runtime/plugins/theme.d.ts +0 -2
- package/dist/modules/ui/src/runtime/plugins/theme.js +0 -44
- package/dist/modules/ui/src/runtime/plugins/vuetify.d.ts +0 -3
- package/dist/modules/ui/src/runtime/plugins/vuetify.js +0 -33
- package/dist/modules/ui/src/runtime/search/client.d.ts +0 -2
- package/dist/modules/ui/src/runtime/search/client.js +0 -21
- package/dist/modules/ui/src/runtime/search/plugin.d.ts +0 -2
- package/dist/modules/ui/src/runtime/search/plugin.js +0 -7
- package/dist/modules/ui/src/utils/color.d.ts +0 -2
- package/dist/modules/ui/src/utils/color.js +0 -11
- package/dist/modules/ui/src/utils/fonts.d.ts +0 -5
- package/dist/modules/ui/src/utils/fonts.js +0 -18
- package/dist/modules/ui/src/utils/formkit.d.ts +0 -12
- package/dist/modules/ui/src/utils/formkit.js +0 -59
- package/dist/modules/ui/src/utils/icons.d.ts +0 -4
- package/dist/modules/ui/src/utils/icons.js +0 -36
- package/dist/runtime/plugins/icon-switcher.d.ts +0 -2
- package/dist/runtime/plugins/icon-switcher.js +0 -24
- package/dist/types/ui/api/global-search.d.ts +0 -8
- package/dist/types/ui/api/global-search.js +0 -1
- package/dist/types/ui/blocks/block-button-group.d.ts +0 -6
- package/dist/types/ui/blocks/block-button-group.js +0 -1
- package/dist/types/ui/blocks/block-button.d.ts +0 -13
- package/dist/types/ui/blocks/block-button.js +0 -1
- package/dist/types/ui/blocks/block-column.d.ts +0 -18
- package/dist/types/ui/blocks/block-column.js +0 -1
- package/dist/types/ui/blocks/block-cta.d.ts +0 -11
- package/dist/types/ui/blocks/block-cta.js +0 -1
- package/dist/types/ui/blocks/block-divider.d.ts +0 -4
- package/dist/types/ui/blocks/block-divider.js +0 -1
- package/dist/types/ui/blocks/block-faq.d.ts +0 -11
- package/dist/types/ui/blocks/block-faq.js +0 -1
- package/dist/types/ui/blocks/block-form.d.ts +0 -7
- package/dist/types/ui/blocks/block-form.js +0 -1
- package/dist/types/ui/blocks/block-gallery.d.ts +0 -13
- package/dist/types/ui/blocks/block-gallery.js +0 -1
- package/dist/types/ui/blocks/block-hero.d.ts +0 -11
- package/dist/types/ui/blocks/block-hero.js +0 -1
- package/dist/types/ui/blocks/block-html.d.ts +0 -4
- package/dist/types/ui/blocks/block-html.js +0 -1
- package/dist/types/ui/blocks/block-logocloud.d.ts +0 -13
- package/dist/types/ui/blocks/block-logocloud.js +0 -1
- package/dist/types/ui/blocks/block-quote.d.ts +0 -10
- package/dist/types/ui/blocks/block-quote.js +0 -1
- package/dist/types/ui/blocks/block-richtext.d.ts +0 -7
- package/dist/types/ui/blocks/block-richtext.js +0 -1
- package/dist/types/ui/blocks/block-steps.d.ts +0 -21
- package/dist/types/ui/blocks/block-steps.js +0 -1
- package/dist/types/ui/blocks/block-team.d.ts +0 -6
- package/dist/types/ui/blocks/block-team.js +0 -1
- package/dist/types/ui/blocks/block-testimonial.d.ts +0 -13
- package/dist/types/ui/blocks/block-testimonial.js +0 -1
- package/dist/types/ui/blocks/block-video.d.ts +0 -9
- package/dist/types/ui/blocks/block-video.js +0 -1
- package/dist/types/ui/blocks/block.d.ts +0 -17
- package/dist/types/ui/blocks/block.js +0 -1
- package/dist/types/ui/blocks/index.d.ts +0 -18
- package/dist/types/ui/blocks/index.js +0 -1
- package/dist/types/ui/component.d.ts +0 -6
- package/dist/types/ui/component.js +0 -1
- package/dist/types/ui/content/category.d.ts +0 -10
- package/dist/types/ui/content/category.js +0 -1
- package/dist/types/ui/content/form.d.ts +0 -21
- package/dist/types/ui/content/form.js +0 -1
- package/dist/types/ui/content/index.d.ts +0 -6
- package/dist/types/ui/content/index.js +0 -1
- package/dist/types/ui/content/page.d.ts +0 -38
- package/dist/types/ui/content/page.js +0 -1
- package/dist/types/ui/content/post.d.ts +0 -38
- package/dist/types/ui/content/post.js +0 -1
- package/dist/types/ui/content/team.d.ts +0 -17
- package/dist/types/ui/content/team.js +0 -1
- package/dist/types/ui/content/testimonial.d.ts +0 -18
- package/dist/types/ui/content/testimonial.js +0 -1
- package/dist/types/ui/form.d.ts +0 -12
- package/dist/types/ui/form.js +0 -1
- package/dist/types/ui/help/index.d.ts +0 -51
- package/dist/types/ui/help/index.js +0 -1
- package/dist/types/ui/meta/analytics.d.ts +0 -21
- package/dist/types/ui/meta/analytics.js +0 -1
- package/dist/types/ui/meta/config.d.ts +0 -22
- package/dist/types/ui/meta/config.js +0 -1
- package/dist/types/ui/meta/globals.d.ts +0 -33
- package/dist/types/ui/meta/globals.js +0 -1
- package/dist/types/ui/meta/index.d.ts +0 -6
- package/dist/types/ui/meta/index.js +0 -1
- package/dist/types/ui/meta/navigation.d.ts +0 -31
- package/dist/types/ui/meta/navigation.js +0 -1
- package/dist/types/ui/meta/redirect.d.ts +0 -12
- package/dist/types/ui/meta/redirect.js +0 -1
- package/dist/types/ui/meta/seo.d.ts +0 -19
- package/dist/types/ui/meta/seo.js +0 -1
- package/dist/types/ui/os/contact.d.ts +0 -22
- package/dist/types/ui/os/contact.js +0 -1
- package/dist/types/ui/os/conversation.d.ts +0 -23
- package/dist/types/ui/os/conversation.js +0 -1
- package/dist/types/ui/os/index.d.ts +0 -16
- package/dist/types/ui/os/index.js +0 -1
- package/dist/types/ui/os/organization.d.ts +0 -51
- package/dist/types/ui/os/organization.js +0 -1
- package/dist/types/ui/os/os-activity.d.ts +0 -26
- package/dist/types/ui/os/os-activity.js +0 -1
- package/dist/types/ui/os/os-deal.d.ts +0 -42
- package/dist/types/ui/os/os-deal.js +0 -1
- package/dist/types/ui/os/os-expense.d.ts +0 -21
- package/dist/types/ui/os/os-expense.js +0 -1
- package/dist/types/ui/os/os-invoice.d.ts +0 -46
- package/dist/types/ui/os/os-invoice.js +0 -1
- package/dist/types/ui/os/os-item.d.ts +0 -17
- package/dist/types/ui/os/os-item.js +0 -1
- package/dist/types/ui/os/os-payment.d.ts +0 -27
- package/dist/types/ui/os/os-payment.js +0 -1
- package/dist/types/ui/os/os-project.d.ts +0 -45
- package/dist/types/ui/os/os-project.js +0 -1
- package/dist/types/ui/os/os-proposal.d.ts +0 -61
- package/dist/types/ui/os/os-proposal.js +0 -1
- package/dist/types/ui/os/os-settings.d.ts +0 -17
- package/dist/types/ui/os/os-settings.js +0 -1
- package/dist/types/ui/os/os-subscription.d.ts +0 -12
- package/dist/types/ui/os/os-subscription.js +0 -1
- package/dist/types/ui/os/os-task.d.ts +0 -32
- package/dist/types/ui/os/os-task.js +0 -1
- package/dist/types/ui/os/os-tax-rate.d.ts +0 -12
- package/dist/types/ui/os/os-tax-rate.js +0 -1
- package/dist/types/ui/pageComponentMap.d.ts +0 -2
- package/dist/types/ui/pageComponentMap.js +0 -7
- package/dist/types/ui/pagination.d.ts +0 -6
- package/dist/types/ui/pagination.js +0 -1
- package/dist/types/ui/schema.d.ts +0 -78
- package/dist/types/ui/schema.js +0 -1
- package/dist/types/ui/state.d.ts +0 -5
- package/dist/types/ui/state.js +0 -1
- package/dist/types/ui/system/file.d.ts +0 -47
- package/dist/types/ui/system/file.js +0 -1
- package/dist/types/ui/system/folder.d.ts +0 -8
- package/dist/types/ui/system/folder.js +0 -1
- package/dist/types/ui/system/index.d.ts +0 -4
- package/dist/types/ui/system/index.js +0 -1
- package/dist/types/ui/system/role.d.ts +0 -20
- package/dist/types/ui/system/role.js +0 -1
- package/dist/types/ui/system/user.d.ts +0 -57
- package/dist/types/ui/system/user.js +0 -1
- package/dist/types/ui.d.ts +0 -21
- package/dist/types/ui.js +0 -1
- package/dist/utils/color.d.ts +0 -2
- package/dist/utils/color.js +0 -11
- package/dist/utils/fonts.d.ts +0 -5
- package/dist/utils/fonts.js +0 -18
- package/dist/utils/formkit.d.ts +0 -12
- package/dist/utils/formkit.js +0 -59
- package/dist/utils/icons.d.ts +0 -4
- package/dist/utils/icons.js +0 -36
- package/src/module.ts +0 -105
- package/src/runtime/assets/config/tailwind.conifg.js +0 -42
- package/src/runtime/components/MButton.vue +0 -17
- package/src/runtime/composables/useMToast.ts +0 -14
- package/src/runtime/design/tokens.ts +0 -22
- package/src/runtime/plugins/builder.ts +0 -326
- package/src/runtime/plugins/fontawesome.ts +0 -11
- package/src/runtime/plugins/formkit.ts +0 -9
- package/src/runtime/plugins/lightgallery.js +0 -21
- package/src/runtime/plugins/motion.ts +0 -6
- package/src/runtime/plugins/theme-switcher.ts +0 -32
- package/src/runtime/plugins/theme.ts +0 -57
- package/src/runtime/plugins/vuetify.ts +0 -36
- package/src/runtime/search/client.ts +0 -25
- package/src/runtime/search/components/MSearch.vue +0 -19
- package/src/runtime/search/plugin.ts +0 -9
- package/src/runtime/styles/index.scss +0 -101
- package/src/runtime/styles/tailwind.css +0 -9
- package/src/runtime/styles/vuetify.scss +0 -5
- package/src/types/runtime-config.d.ts +0 -12
- package/src/utils/color.js +0 -11
- package/src/utils/color.ts +0 -14
- package/src/utils/fonts.js +0 -18
- package/src/utils/fonts.ts +0 -24
- package/src/utils/formkit.js +0 -59
- package/src/utils/formkit.ts +0 -75
- package/src/utils/icons.js +0 -36
- package/src/utils/icons.ts +0 -62
package/src/module.ts
DELETED
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
defineNuxtModule,
|
|
3
|
-
addPlugin,
|
|
4
|
-
createResolver,
|
|
5
|
-
addComponentsDir,
|
|
6
|
-
addImportsDir
|
|
7
|
-
} from 'nuxt/kit'
|
|
8
|
-
|
|
9
|
-
export interface MFrameworkUiOptions {
|
|
10
|
-
theme ? : 'light' | 'dark'
|
|
11
|
-
builder ? : boolean | {
|
|
12
|
-
enabled ? : boolean
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export default defineNuxtModule < MFrameworkUiOptions > ({
|
|
17
|
-
meta: {
|
|
18
|
-
name: '@mframework/ui',
|
|
19
|
-
configKey: 'mframeworkUi'
|
|
20
|
-
},
|
|
21
|
-
|
|
22
|
-
defaults: {
|
|
23
|
-
theme: 'light',
|
|
24
|
-
builder: true
|
|
25
|
-
},
|
|
26
|
-
|
|
27
|
-
setup(options, nuxt) {
|
|
28
|
-
const resolver = createResolver(import.meta.url)
|
|
29
|
-
|
|
30
|
-
//
|
|
31
|
-
// 1. Ensure Vuetify loads FIRST
|
|
32
|
-
//
|
|
33
|
-
addPlugin({
|
|
34
|
-
src: resolver.resolve('./runtime/plugins/vuetify'),
|
|
35
|
-
mode: 'all'
|
|
36
|
-
})
|
|
37
|
-
|
|
38
|
-
//
|
|
39
|
-
// 2. Global styles (Tailwind, Vuetify overrides, tokens)
|
|
40
|
-
//
|
|
41
|
-
nuxt.options.css = nuxt.options.css || []
|
|
42
|
-
nuxt.options.css.push(resolver.resolve('./runtime/styles/index.scss'))
|
|
43
|
-
|
|
44
|
-
//
|
|
45
|
-
// 3. Register core UI plugins
|
|
46
|
-
//
|
|
47
|
-
const plugins = [
|
|
48
|
-
'formkit',
|
|
49
|
-
'fontawesome',
|
|
50
|
-
'lightgallery',
|
|
51
|
-
'motion',
|
|
52
|
-
'theme'
|
|
53
|
-
]
|
|
54
|
-
|
|
55
|
-
plugins.forEach((name) => {
|
|
56
|
-
addPlugin({
|
|
57
|
-
src: resolver.resolve(`./runtime/plugins/${name}`),
|
|
58
|
-
mode: 'all'
|
|
59
|
-
})
|
|
60
|
-
})
|
|
61
|
-
|
|
62
|
-
//
|
|
63
|
-
// 4. Register GrapesJS builder (client‑only)
|
|
64
|
-
//
|
|
65
|
-
if (options.builder) {
|
|
66
|
-
addPlugin({
|
|
67
|
-
src: resolver.resolve('./runtime/plugins/builder'),
|
|
68
|
-
mode: 'client'
|
|
69
|
-
})
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
//
|
|
73
|
-
// 5. Auto‑import components & composables
|
|
74
|
-
//
|
|
75
|
-
addComponentsDir({
|
|
76
|
-
path: resolver.resolve('./runtime/components'),
|
|
77
|
-
prefix: 'M'
|
|
78
|
-
})
|
|
79
|
-
|
|
80
|
-
addImportsDir(resolver.resolve('./runtime/composables'))
|
|
81
|
-
|
|
82
|
-
//
|
|
83
|
-
// 6. Expose runtime config
|
|
84
|
-
//
|
|
85
|
-
// Normalize builder option
|
|
86
|
-
const normalizedBuilder =
|
|
87
|
-
typeof options.builder === 'boolean' ? {
|
|
88
|
-
enabled: options.builder
|
|
89
|
-
} :
|
|
90
|
-
options.builder || {
|
|
91
|
-
enabled: true
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
nuxt.options.runtimeConfig.public.mframeworkUi = {
|
|
95
|
-
theme: options.theme,
|
|
96
|
-
builder: normalizedBuilder
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
// Safe assignment without TS errors
|
|
100
|
-
;(nuxt.options as any).tailwindcss = (nuxt.options as any).tailwindcss || {}
|
|
101
|
-
;(nuxt.options as any).tailwindcss.configPath = resolver.resolve(
|
|
102
|
-
'./runtime/assets/config/tailwind.config.js'
|
|
103
|
-
)
|
|
104
|
-
}
|
|
105
|
-
})
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/** @type {import('tailwindcss').Config} */
|
|
2
|
-
export default {
|
|
3
|
-
content: [], // Nuxt will inject its own paths
|
|
4
|
-
|
|
5
|
-
theme: {
|
|
6
|
-
extend: {
|
|
7
|
-
colors: {
|
|
8
|
-
primary: 'var(--m-primary)',
|
|
9
|
-
secondary: 'var(--m-secondary)',
|
|
10
|
-
accent: 'var(--m-accent)',
|
|
11
|
-
muted: 'var(--m-muted)',
|
|
12
|
-
surface: 'var(--m-surface)',
|
|
13
|
-
border: 'var(--m-border)'
|
|
14
|
-
},
|
|
15
|
-
|
|
16
|
-
fontFamily: {
|
|
17
|
-
sans: ['Inter', 'system-ui', 'sans-serif'],
|
|
18
|
-
heading: ['Inter', 'system-ui', 'sans-serif']
|
|
19
|
-
},
|
|
20
|
-
|
|
21
|
-
borderRadius: {
|
|
22
|
-
sm: '4px',
|
|
23
|
-
DEFAULT: '8px',
|
|
24
|
-
lg: '12px',
|
|
25
|
-
xl: '16px'
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
spacing: {
|
|
29
|
-
'1/2': '50%',
|
|
30
|
-
'full': '100%'
|
|
31
|
-
},
|
|
32
|
-
|
|
33
|
-
boxShadow: {
|
|
34
|
-
soft: '0 2px 8px rgba(0,0,0,0.06)',
|
|
35
|
-
medium: '0 4px 16px rgba(0,0,0,0.08)',
|
|
36
|
-
strong: '0 8px 24px rgba(0,0,0,0.12)'
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
plugins: []
|
|
42
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<v-btn :color="color" class="m-btn" v-bind="$attrs">
|
|
3
|
-
<slot />
|
|
4
|
-
</v-btn>
|
|
5
|
-
</template>
|
|
6
|
-
|
|
7
|
-
<script setup lang="ts">
|
|
8
|
-
defineProps < {
|
|
9
|
-
color ? : string
|
|
10
|
-
} > ()
|
|
11
|
-
</script>
|
|
12
|
-
|
|
13
|
-
<style scoped>
|
|
14
|
-
.m-btn {
|
|
15
|
-
@apply px-4 py-2 rounded-md;
|
|
16
|
-
}
|
|
17
|
-
</style>
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import iziToast from 'izitoast'
|
|
2
|
-
import 'izitoast/dist/css/iziToast.min.css'
|
|
3
|
-
|
|
4
|
-
export const useMToast = () => {
|
|
5
|
-
const success = (message: string, title = 'Success') => {
|
|
6
|
-
iziToast.success({ title, message })
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
const error = (message: string, title = 'Error') => {
|
|
10
|
-
iziToast.error({ title, message })
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
return { success, error }
|
|
14
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export const tokens = {
|
|
2
|
-
colors: {
|
|
3
|
-
primary: '#4f46e5',
|
|
4
|
-
secondary: '#64748b',
|
|
5
|
-
success: '#22c55e',
|
|
6
|
-
warning: '#f59e0b',
|
|
7
|
-
error: '#ef4444',
|
|
8
|
-
surface: '#ffffff',
|
|
9
|
-
background: '#f8fafc'
|
|
10
|
-
},
|
|
11
|
-
radius: {
|
|
12
|
-
sm: '4px',
|
|
13
|
-
md: '8px',
|
|
14
|
-
lg: '12px'
|
|
15
|
-
},
|
|
16
|
-
spacing: {
|
|
17
|
-
xs: '4px',
|
|
18
|
-
sm: '8px',
|
|
19
|
-
md: '16px',
|
|
20
|
-
lg: '24px'
|
|
21
|
-
}
|
|
22
|
-
}
|
|
@@ -1,326 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
defineNuxtPlugin
|
|
3
|
-
} from 'nuxt/app'
|
|
4
|
-
import 'grapesjs/dist/css/grapes.min.css'
|
|
5
|
-
import grapesjs from 'grapesjs'
|
|
6
|
-
|
|
7
|
-
export default defineNuxtPlugin((nuxtApp) => {
|
|
8
|
-
if (process.server) return
|
|
9
|
-
|
|
10
|
-
const mount = () => {
|
|
11
|
-
const el = document.querySelector('#gjs')
|
|
12
|
-
if (!el) return null
|
|
13
|
-
|
|
14
|
-
const editor = grapesjs.init({
|
|
15
|
-
container: `${el}`,
|
|
16
|
-
fromElement: true,
|
|
17
|
-
height: '100%',
|
|
18
|
-
width: 'auto',
|
|
19
|
-
storageManager: {
|
|
20
|
-
type: 'local',
|
|
21
|
-
autosave: true,
|
|
22
|
-
autoload: true,
|
|
23
|
-
stepsBeforeSave: 1,
|
|
24
|
-
options: {
|
|
25
|
-
local: {
|
|
26
|
-
key: 'gjsProject'
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
|
|
31
|
-
// Avoid any default panel
|
|
32
|
-
layerManager: {
|
|
33
|
-
appendTo: '.layers-container',
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
mediaCondition: 'min-width', // default is `max-width`
|
|
37
|
-
deviceManager: {
|
|
38
|
-
devices: [{
|
|
39
|
-
name: 'Desktop',
|
|
40
|
-
width: '', // default size
|
|
41
|
-
widthMedia: '1024px', // this value will be used in CSS @media
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
name: 'Mobile',
|
|
45
|
-
width: '320px', // this value will be used on canvas width
|
|
46
|
-
widthMedia: '480px', // this value will be used in CSS @media
|
|
47
|
-
},
|
|
48
|
-
],
|
|
49
|
-
},
|
|
50
|
-
|
|
51
|
-
blockManager: {
|
|
52
|
-
appendTo: '#blocks',
|
|
53
|
-
blocks: [{
|
|
54
|
-
id: 'section', // id is mandatory
|
|
55
|
-
label: '<b>Section</b>', // You can use HTML/SVG inside labels
|
|
56
|
-
category: 'Basic',
|
|
57
|
-
attributes: {
|
|
58
|
-
class: 'gjs-block-section'
|
|
59
|
-
},
|
|
60
|
-
content: {
|
|
61
|
-
tagName: 'div',
|
|
62
|
-
draggable: false,
|
|
63
|
-
attributes: {
|
|
64
|
-
'some-attribute': 'some-value'
|
|
65
|
-
},
|
|
66
|
-
components: [{
|
|
67
|
-
tagName: 'span',
|
|
68
|
-
content: '<b>Some static content</b>',
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
tagName: 'div',
|
|
72
|
-
// use `content` for static strings, `components` string will be parsed
|
|
73
|
-
// and transformed in Components
|
|
74
|
-
components: '<span>HTML at some point</span>',
|
|
75
|
-
},
|
|
76
|
-
],
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
id: 'text',
|
|
81
|
-
label: 'Text',
|
|
82
|
-
content: '<div data-gjs-type="text">Insert your text here</div>',
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
id: 'image',
|
|
86
|
-
label: 'Image',
|
|
87
|
-
// Select the component once it's dropped
|
|
88
|
-
select: true,
|
|
89
|
-
// You can pass components as a JSON instead of a simple HTML string,
|
|
90
|
-
// in this case we also use a defined component type `image`
|
|
91
|
-
content: {
|
|
92
|
-
type: 'image'
|
|
93
|
-
},
|
|
94
|
-
// This triggers `active` event on dropped components and the `image`
|
|
95
|
-
// reacts by opening the AssetManager
|
|
96
|
-
activate: true,
|
|
97
|
-
},
|
|
98
|
-
],
|
|
99
|
-
},
|
|
100
|
-
panels: {
|
|
101
|
-
defaults: [{
|
|
102
|
-
id: 'layers',
|
|
103
|
-
el: '.panel__right',
|
|
104
|
-
// Make the panel resizable
|
|
105
|
-
resizable: {
|
|
106
|
-
maxDim: 350,
|
|
107
|
-
minDim: 200,
|
|
108
|
-
tc: false, // Top handler
|
|
109
|
-
cl: true, // Left handler
|
|
110
|
-
cr: false, // Right handler
|
|
111
|
-
bc: false, // Bottom handler
|
|
112
|
-
// Being a flex child we need to change `flex-basis` property
|
|
113
|
-
// instead of the `width` (default)
|
|
114
|
-
keyWidth: 'flex-basis',
|
|
115
|
-
},
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
id: 'panel-switcher',
|
|
119
|
-
el: '.panel__switcher',
|
|
120
|
-
buttons: [{
|
|
121
|
-
id: 'show-layers',
|
|
122
|
-
active: true,
|
|
123
|
-
label: 'Layers',
|
|
124
|
-
command: 'show-layers',
|
|
125
|
-
// Once activated disable the possibility to turn it off
|
|
126
|
-
togglable: false,
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
id: 'show-style',
|
|
130
|
-
active: true,
|
|
131
|
-
label: 'Styles',
|
|
132
|
-
command: 'show-styles',
|
|
133
|
-
togglable: false,
|
|
134
|
-
},
|
|
135
|
-
{
|
|
136
|
-
id: 'show-traits',
|
|
137
|
-
active: true,
|
|
138
|
-
label: 'Traits',
|
|
139
|
-
command: 'show-traits',
|
|
140
|
-
togglable: false,
|
|
141
|
-
},
|
|
142
|
-
],
|
|
143
|
-
},
|
|
144
|
-
{
|
|
145
|
-
id: 'panel-devices',
|
|
146
|
-
el: '.panel__devices',
|
|
147
|
-
buttons: [{
|
|
148
|
-
id: 'device-desktop',
|
|
149
|
-
label: 'D',
|
|
150
|
-
command: 'set-device-desktop',
|
|
151
|
-
active: true,
|
|
152
|
-
togglable: false,
|
|
153
|
-
},
|
|
154
|
-
{
|
|
155
|
-
id: 'device-mobile',
|
|
156
|
-
label: 'M',
|
|
157
|
-
command: 'set-device-mobile',
|
|
158
|
-
togglable: false,
|
|
159
|
-
},
|
|
160
|
-
],
|
|
161
|
-
},
|
|
162
|
-
],
|
|
163
|
-
},
|
|
164
|
-
// The Selector Manager allows to assign classes and
|
|
165
|
-
// different states (eg. :hover) on components.
|
|
166
|
-
// Generally, it's used in conjunction with Style Manager
|
|
167
|
-
// but it's not mandatory
|
|
168
|
-
selectorManager: {
|
|
169
|
-
appendTo: '.styles-container',
|
|
170
|
-
},
|
|
171
|
-
styleManager: {
|
|
172
|
-
appendTo: '.styles-container',
|
|
173
|
-
sectors: [{
|
|
174
|
-
name: 'Dimension',
|
|
175
|
-
open: false,
|
|
176
|
-
// Use built-in properties
|
|
177
|
-
buildProps: ['width', 'min-height', 'padding'],
|
|
178
|
-
// Use `properties` to define/override single property
|
|
179
|
-
properties: [{
|
|
180
|
-
// Type of the input,
|
|
181
|
-
// options: integer | radio | select | color | slider | file | composite | stack
|
|
182
|
-
type: 'integer',
|
|
183
|
-
name: 'The width', // Label for the property
|
|
184
|
-
property: 'width', // CSS property (if buildProps contains it will be extended)
|
|
185
|
-
units: ['px', '%'], // Units, available only for 'integer' types
|
|
186
|
-
defaults: 'auto', // Default value
|
|
187
|
-
min: 0, // Min value, available only for 'integer' types
|
|
188
|
-
}, ],
|
|
189
|
-
},
|
|
190
|
-
{
|
|
191
|
-
name: 'Extra',
|
|
192
|
-
open: false,
|
|
193
|
-
buildProps: ['background-color', 'box-shadow', 'custom-prop'],
|
|
194
|
-
properties: [{
|
|
195
|
-
id: 'custom-prop',
|
|
196
|
-
name: 'Custom Label',
|
|
197
|
-
property: 'font-size',
|
|
198
|
-
type: 'select',
|
|
199
|
-
defaults: '32px',
|
|
200
|
-
// List of options, available only for 'select' and 'radio' types
|
|
201
|
-
options: [{
|
|
202
|
-
id: 'tiny',
|
|
203
|
-
value: '12px',
|
|
204
|
-
name: 'Tiny'
|
|
205
|
-
},
|
|
206
|
-
{
|
|
207
|
-
id: 'medium',
|
|
208
|
-
value: '18px',
|
|
209
|
-
name: 'Medium'
|
|
210
|
-
},
|
|
211
|
-
{
|
|
212
|
-
id: 'big',
|
|
213
|
-
value: '32px',
|
|
214
|
-
name: 'Big'
|
|
215
|
-
},
|
|
216
|
-
],
|
|
217
|
-
}, ],
|
|
218
|
-
},
|
|
219
|
-
],
|
|
220
|
-
},
|
|
221
|
-
});
|
|
222
|
-
|
|
223
|
-
// Define commands
|
|
224
|
-
editor.Commands.add('show-layers', {
|
|
225
|
-
getRowEl(editor: any) {
|
|
226
|
-
return editor.getContainer().closest('.editor-row');
|
|
227
|
-
},
|
|
228
|
-
getLayersEl(row: any) {
|
|
229
|
-
return row.querySelector('.layers-container');
|
|
230
|
-
},
|
|
231
|
-
|
|
232
|
-
run(editor: any, sender: any) {
|
|
233
|
-
const lmEl = this.getLayersEl(this.getRowEl(editor));
|
|
234
|
-
lmEl.style.display = '';
|
|
235
|
-
},
|
|
236
|
-
stop(editor: any, sender: any) {
|
|
237
|
-
const lmEl = this.getLayersEl(this.getRowEl(editor));
|
|
238
|
-
lmEl.style.display = 'none';
|
|
239
|
-
},
|
|
240
|
-
});
|
|
241
|
-
editor.Commands.add('show-styles', {
|
|
242
|
-
getRowEl(editor: any) {
|
|
243
|
-
return editor.getContainer().closest('.editor-row');
|
|
244
|
-
},
|
|
245
|
-
getStyleEl(row: any) {
|
|
246
|
-
return row.querySelector('.styles-container');
|
|
247
|
-
},
|
|
248
|
-
|
|
249
|
-
run(editor: any, sender: any) {
|
|
250
|
-
const smEl = this.getStyleEl(this.getRowEl(editor));
|
|
251
|
-
smEl.style.display = '';
|
|
252
|
-
},
|
|
253
|
-
stop(editor: any, sender: any) {
|
|
254
|
-
const smEl = this.getStyleEl(this.getRowEl(editor));
|
|
255
|
-
smEl.style.display = 'none';
|
|
256
|
-
},
|
|
257
|
-
});
|
|
258
|
-
|
|
259
|
-
editor.Commands.add('show-traits', {
|
|
260
|
-
getTraitsEl(editor: any) {
|
|
261
|
-
const row = editor.getContainer().closest('.editor-row');
|
|
262
|
-
return row.querySelector('.traits-container');
|
|
263
|
-
},
|
|
264
|
-
run(editor: any, sender: any) {
|
|
265
|
-
this.getTraitsEl(editor).style.display = '';
|
|
266
|
-
},
|
|
267
|
-
stop(editor: any, sender: any) {
|
|
268
|
-
this.getTraitsEl(editor).style.display = 'none';
|
|
269
|
-
},
|
|
270
|
-
});
|
|
271
|
-
|
|
272
|
-
editor.Panels.addPanel({
|
|
273
|
-
id: 'panel-top',
|
|
274
|
-
el: '.panel__top',
|
|
275
|
-
});
|
|
276
|
-
editor.Panels.addPanel({
|
|
277
|
-
id: 'basic-actions',
|
|
278
|
-
el: '.panel__basic-actions',
|
|
279
|
-
buttons: [{
|
|
280
|
-
id: 'visibility',
|
|
281
|
-
active: true, // active by default
|
|
282
|
-
className: 'btn-toggle-borders',
|
|
283
|
-
label: '<u>B</u>',
|
|
284
|
-
command: 'sw-visibility', // Built-in command
|
|
285
|
-
},
|
|
286
|
-
{
|
|
287
|
-
id: 'export',
|
|
288
|
-
className: 'btn-open-export',
|
|
289
|
-
label: 'Exp',
|
|
290
|
-
command: 'export-template',
|
|
291
|
-
context: 'export-template', // For grouping context of buttons from the same panel
|
|
292
|
-
},
|
|
293
|
-
{
|
|
294
|
-
id: 'show-json',
|
|
295
|
-
className: 'btn-show-json',
|
|
296
|
-
label: 'JSON',
|
|
297
|
-
context: 'show-json',
|
|
298
|
-
command(editor: any) {
|
|
299
|
-
editor.Modal.setTitle('Components JSON')
|
|
300
|
-
.setContent(
|
|
301
|
-
`<textarea style="width:100%; height: 250px;">
|
|
302
|
-
${JSON.stringify(editor.getComponents())}
|
|
303
|
-
</textarea>`,
|
|
304
|
-
)
|
|
305
|
-
.open();
|
|
306
|
-
},
|
|
307
|
-
},
|
|
308
|
-
],
|
|
309
|
-
});
|
|
310
|
-
editor.Commands.add('set-device-desktop', {
|
|
311
|
-
run: (editor) => editor.setDevice('Desktop'),
|
|
312
|
-
});
|
|
313
|
-
editor.Commands.add('set-device-mobile', {
|
|
314
|
-
run: (editor) => editor.setDevice('Mobile'),
|
|
315
|
-
});
|
|
316
|
-
editor.on('change:device', () => console.log('Current device: ', editor.getDevice()));
|
|
317
|
-
// Set initial device as Mobile
|
|
318
|
-
editor.setDevice('Mobile');
|
|
319
|
-
|
|
320
|
-
nuxtApp.provide('grapesStudio', editor)
|
|
321
|
-
return editor
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
// Auto‑mount when page loads
|
|
325
|
-
window.addEventListener('DOMContentLoaded', mount)
|
|
326
|
-
})
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { defineNuxtPlugin } from 'nuxt/app'
|
|
2
|
-
import { library } from '@fortawesome/fontawesome-svg-core'
|
|
3
|
-
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
|
|
4
|
-
import { fas } from '@fortawesome/free-solid-svg-icons'
|
|
5
|
-
import '@fortawesome/fontawesome-free/css/all.min.css'
|
|
6
|
-
|
|
7
|
-
export default defineNuxtPlugin((nuxtApp) => {
|
|
8
|
-
library.add(fas)
|
|
9
|
-
|
|
10
|
-
nuxtApp.vueApp.component('Fa', FontAwesomeIcon)
|
|
11
|
-
})
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { defineNuxtPlugin } from 'nuxt/app'
|
|
2
|
-
import { plugin as formKitPlugin, defaultConfig } from '@formkit/vue'
|
|
3
|
-
import '@formkit/themes/genesis'
|
|
4
|
-
|
|
5
|
-
export default defineNuxtPlugin((nuxtApp) => {
|
|
6
|
-
nuxtApp.vueApp.use(formKitPlugin, defaultConfig({
|
|
7
|
-
// You can inject your own inputs, locales, etc. here
|
|
8
|
-
}))
|
|
9
|
-
})
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { defineNuxtPlugin } from 'nuxt/app'
|
|
2
|
-
import lightGallery from 'lightgallery'
|
|
3
|
-
import lgZoom from 'lg-zoom'
|
|
4
|
-
import lgVideo from 'lg-video'
|
|
5
|
-
import lgThumbnail from 'lg-thumbnail'
|
|
6
|
-
import 'lightgallery/css/lightgallery.css'
|
|
7
|
-
import 'lightgallery/css/lg-zoom.css'
|
|
8
|
-
import 'lightgallery/css/lg-thumbnail.css'
|
|
9
|
-
import 'lightgallery/css/lg-video.css'
|
|
10
|
-
|
|
11
|
-
export default defineNuxtPlugin(() => {
|
|
12
|
-
// You can expose a composable or directive later if you want.
|
|
13
|
-
// For now, this ensures CSS + plugins are bundled.
|
|
14
|
-
// Example directive could be added here if needed.
|
|
15
|
-
document.querySelectorAll('.lightgallery').forEach((element) => {
|
|
16
|
-
lightGallery(element as HTMLElement, {
|
|
17
|
-
plugins: [lgZoom, lgVideo, lgThumbnail],
|
|
18
|
-
speed: 500,
|
|
19
|
-
})
|
|
20
|
-
})
|
|
21
|
-
})
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { defineNuxtPlugin } from 'nuxt/app'
|
|
2
|
-
import { useTheme } from 'vuetify'
|
|
3
|
-
|
|
4
|
-
export default defineNuxtPlugin((nuxtApp) => {
|
|
5
|
-
if (process.server) return
|
|
6
|
-
|
|
7
|
-
const theme = useTheme()
|
|
8
|
-
|
|
9
|
-
const setTheme = (mode: 'light' | 'dark') => {
|
|
10
|
-
theme.global.name.value = mode
|
|
11
|
-
document.documentElement.classList.toggle('dark', mode === 'dark')
|
|
12
|
-
localStorage.setItem('mframework-theme', mode)
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const toggleTheme = () => {
|
|
16
|
-
const current = theme.global.name.value === 'light' ? 'dark' : 'light'
|
|
17
|
-
setTheme(current)
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
// Load saved theme
|
|
21
|
-
const saved = localStorage.getItem('mframework-theme')
|
|
22
|
-
if (saved === 'light' || saved === 'dark') {
|
|
23
|
-
setTheme(saved)
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
// Expose composable
|
|
27
|
-
nuxtApp.provide('mTheme', {
|
|
28
|
-
setTheme,
|
|
29
|
-
toggleTheme,
|
|
30
|
-
current: () => theme.global.name.value
|
|
31
|
-
})
|
|
32
|
-
})
|
|
@@ -1,57 +0,0 @@
|
|
|
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
|
-
})
|