@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
package/src/module.ts
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
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
|
+
})
|
|
@@ -0,0 +1,42 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<lightgallery :settings="{ speed: 500, plugins: plugins }" :onInit="onInit" :onBeforeSlide="onBeforeSlide">
|
|
3
|
+
<a data-lg-size="1406-1390" class="gallery-item"
|
|
4
|
+
data-src="https://images.unsplash.com/photo-1581894158358-5ecd2c518883?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=1406&q=80"
|
|
5
|
+
data-sub-html="<h4>Photo by - <a href='https://unsplash.com/@entrycube' >Diego Guzmán </a></h4> <p> Location - <a href='https://unsplash.com/s/photos/fushimi-inari-taisha-shrine-senbontorii%2C-68%E7%95%AA%E5%9C%B0-fukakusa-yabunouchicho%2C-fushimi-ward%2C-kyoto%2C-japan'>Fushimi Ward, Kyoto, Japan</a></p>">
|
|
6
|
+
<img class="img-responsive"
|
|
7
|
+
src="https://images.unsplash.com/photo-1581894158358-5ecd2c518883?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=240&q=80" />
|
|
8
|
+
</a>
|
|
9
|
+
<a data-lg-size="1400-1400" class="gallery-item"
|
|
10
|
+
data-src="https://images.unsplash.com/photo-1544550285-f813152fb2fd?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=1400&q=80"
|
|
11
|
+
data-sub-html="<h4>Photo by - <a href='https://unsplash.com/@asoshiation' >Shah </a></h4><p> Location - <a href='https://unsplash.com/s/photos/shinimamiya%2C-osaka%2C-japan'>Shinimamiya, Osaka, Japan</a></p>">
|
|
12
|
+
<img class="img-responsive"
|
|
13
|
+
src="https://images.unsplash.com/photo-1544550285-f813152fb2fd?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=240&q=80" />
|
|
14
|
+
</a>
|
|
15
|
+
<a data-lg-size="1400-1400" class="gallery-item"
|
|
16
|
+
data-src="https://images.unsplash.com/photo-1584592740039-cddf0671f3d4?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=1400&q=80"
|
|
17
|
+
data-sub-html="<h4>Photo by - <a href='https://unsplash.com/@katherine_xx11' >Katherine Gu </a></h4><p> For all those years we were alone and helpless.</p>">
|
|
18
|
+
<img style="width: 200px" class="img-responsive"
|
|
19
|
+
src="https://images.unsplash.com/photo-1584592740039-cddf0671f3d4?ixid=MXwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHw%3D&ixlib=rb-1.2.1&auto=format&fit=crop&w=240&q=80" />
|
|
20
|
+
</a>
|
|
21
|
+
<a class="gallery-item"
|
|
22
|
+
data-video='{"source": [{"src":"https://www.lightgalleryjs.com/videos/video1.mp4", "type":"video/mp4"}], "attributes": {"preload": false, "controls": true}}'
|
|
23
|
+
data-poster=""
|
|
24
|
+
data-sub-html="<h4>Photo by - <a href='https://unsplash.com/@katherine_xx11' >Katherine Gu </a></h4><p> For all those years we were alone and helpless.</p>">
|
|
25
|
+
<img width="200" class="img-responsive"
|
|
26
|
+
src="https://www.lightgalleryjs.com/images/demo/html5-video-poster.jpg" />
|
|
27
|
+
</a>
|
|
28
|
+
</lightgallery>
|
|
29
|
+
</template>
|
|
30
|
+
|
|
31
|
+
<script>
|
|
32
|
+
import Lightgallery from 'lightgallery/vue';
|
|
33
|
+
import lgZoom from 'lightgallery/plugins/zoom';
|
|
34
|
+
import lgVideo from 'lightgallery/plugins/video';
|
|
35
|
+
|
|
36
|
+
export default {
|
|
37
|
+
name: 'App',
|
|
38
|
+
components: {
|
|
39
|
+
Lightgallery,
|
|
40
|
+
},
|
|
41
|
+
data: () => ({
|
|
42
|
+
plugins: [lgZoom, lgVideo],
|
|
43
|
+
}),
|
|
44
|
+
methods: {
|
|
45
|
+
onInit: () => {
|
|
46
|
+
console.log('lightGallery has been initialized');
|
|
47
|
+
},
|
|
48
|
+
onBeforeSlide: () => {
|
|
49
|
+
console.log('calling before slide');
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
</script>
|
|
54
|
+
<style lang="css">
|
|
55
|
+
@import url('https://cdn.jsdelivr.net/npm/lightgallery@2.0.0-beta.4/css/lightgallery.css');
|
|
56
|
+
@import url('https://cdn.jsdelivr.net/npm/lightgallery@2.0.0-beta.4/css/lg-zoom.css');
|
|
57
|
+
@import url('https://cdn.jsdelivr.net/npm/lightgallery@2.0.0-beta.4/css/lg-video.css');
|
|
58
|
+
|
|
59
|
+
body {
|
|
60
|
+
margin: 0;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.gallery-item {
|
|
64
|
+
margin: 5px;
|
|
65
|
+
}
|
|
66
|
+
</style>
|
|
@@ -0,0 +1,17 @@
|
|
|
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>
|
|
@@ -0,0 +1,14 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,326 @@
|
|
|
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
|
+
})
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
+
})
|
|
@@ -0,0 +1,9 @@
|
|
|
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
|
+
})
|
|
@@ -0,0 +1,21 @@
|
|
|
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
|
+
})
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
+
})
|