@mframework/ui 0.1.0-beta.3 → 0.1.0-beta.5
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 +29 -7
- package/dist/runtime/assets/config/tailwind.conifg.js +37 -6
- package/dist/runtime/components/Gallery.d.vue.ts +0 -0
- package/dist/runtime/components/Gallery.vue +56 -0
- 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 +8 -3
- 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
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import iziToast from 'izitoast';
|
|
2
|
-
import 'izitoast/dist/css/iziToast.min.css';
|
|
3
|
-
export const useMToast = () => {
|
|
4
|
-
const success = (message, title = 'Success') => {
|
|
5
|
-
iziToast.success({ title, message });
|
|
6
|
-
};
|
|
7
|
-
const error = (message, title = 'Error') => {
|
|
8
|
-
iziToast.error({ title, message });
|
|
9
|
-
};
|
|
10
|
-
return { success, error };
|
|
11
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export declare const tokens: {
|
|
2
|
-
colors: {
|
|
3
|
-
primary: string;
|
|
4
|
-
secondary: string;
|
|
5
|
-
success: string;
|
|
6
|
-
warning: string;
|
|
7
|
-
error: string;
|
|
8
|
-
surface: string;
|
|
9
|
-
background: string;
|
|
10
|
-
};
|
|
11
|
-
radius: {
|
|
12
|
-
sm: string;
|
|
13
|
-
md: string;
|
|
14
|
-
lg: string;
|
|
15
|
-
};
|
|
16
|
-
spacing: {
|
|
17
|
-
xs: string;
|
|
18
|
-
sm: string;
|
|
19
|
-
md: string;
|
|
20
|
-
lg: string;
|
|
21
|
-
};
|
|
22
|
-
};
|
|
@@ -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,311 +0,0 @@
|
|
|
1
|
-
import { defineNuxtPlugin } from 'nuxt/app';
|
|
2
|
-
import 'grapesjs/dist/css/grapes.min.css';
|
|
3
|
-
import grapesjs from 'grapesjs';
|
|
4
|
-
export default defineNuxtPlugin((nuxtApp) => {
|
|
5
|
-
if (process.server)
|
|
6
|
-
return;
|
|
7
|
-
const mount = () => {
|
|
8
|
-
const el = document.querySelector('#gjs');
|
|
9
|
-
if (!el)
|
|
10
|
-
return null;
|
|
11
|
-
const editor = grapesjs.init({
|
|
12
|
-
container: `${el}`,
|
|
13
|
-
fromElement: true,
|
|
14
|
-
height: '100%',
|
|
15
|
-
width: 'auto',
|
|
16
|
-
storageManager: {
|
|
17
|
-
type: 'local',
|
|
18
|
-
autosave: true,
|
|
19
|
-
autoload: true,
|
|
20
|
-
stepsBeforeSave: 1,
|
|
21
|
-
options: {
|
|
22
|
-
local: {
|
|
23
|
-
key: 'gjsProject'
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
// Avoid any default panel
|
|
28
|
-
layerManager: {
|
|
29
|
-
appendTo: '.layers-container',
|
|
30
|
-
},
|
|
31
|
-
mediaCondition: 'min-width', // default is `max-width`
|
|
32
|
-
deviceManager: {
|
|
33
|
-
devices: [{
|
|
34
|
-
name: 'Desktop',
|
|
35
|
-
width: '', // default size
|
|
36
|
-
widthMedia: '1024px', // this value will be used in CSS @media
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
name: 'Mobile',
|
|
40
|
-
width: '320px', // this value will be used on canvas width
|
|
41
|
-
widthMedia: '480px', // this value will be used in CSS @media
|
|
42
|
-
},
|
|
43
|
-
],
|
|
44
|
-
},
|
|
45
|
-
blockManager: {
|
|
46
|
-
appendTo: '#blocks',
|
|
47
|
-
blocks: [{
|
|
48
|
-
id: 'section', // id is mandatory
|
|
49
|
-
label: '<b>Section</b>', // You can use HTML/SVG inside labels
|
|
50
|
-
category: 'Basic',
|
|
51
|
-
attributes: {
|
|
52
|
-
class: 'gjs-block-section'
|
|
53
|
-
},
|
|
54
|
-
content: {
|
|
55
|
-
tagName: 'div',
|
|
56
|
-
draggable: false,
|
|
57
|
-
attributes: {
|
|
58
|
-
'some-attribute': 'some-value'
|
|
59
|
-
},
|
|
60
|
-
components: [{
|
|
61
|
-
tagName: 'span',
|
|
62
|
-
content: '<b>Some static content</b>',
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
tagName: 'div',
|
|
66
|
-
// use `content` for static strings, `components` string will be parsed
|
|
67
|
-
// and transformed in Components
|
|
68
|
-
components: '<span>HTML at some point</span>',
|
|
69
|
-
},
|
|
70
|
-
],
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
id: 'text',
|
|
75
|
-
label: 'Text',
|
|
76
|
-
content: '<div data-gjs-type="text">Insert your text here</div>',
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
id: 'image',
|
|
80
|
-
label: 'Image',
|
|
81
|
-
// Select the component once it's dropped
|
|
82
|
-
select: true,
|
|
83
|
-
// You can pass components as a JSON instead of a simple HTML string,
|
|
84
|
-
// in this case we also use a defined component type `image`
|
|
85
|
-
content: {
|
|
86
|
-
type: 'image'
|
|
87
|
-
},
|
|
88
|
-
// This triggers `active` event on dropped components and the `image`
|
|
89
|
-
// reacts by opening the AssetManager
|
|
90
|
-
activate: true,
|
|
91
|
-
},
|
|
92
|
-
],
|
|
93
|
-
},
|
|
94
|
-
panels: {
|
|
95
|
-
defaults: [{
|
|
96
|
-
id: 'layers',
|
|
97
|
-
el: '.panel__right',
|
|
98
|
-
// Make the panel resizable
|
|
99
|
-
resizable: {
|
|
100
|
-
maxDim: 350,
|
|
101
|
-
minDim: 200,
|
|
102
|
-
tc: false, // Top handler
|
|
103
|
-
cl: true, // Left handler
|
|
104
|
-
cr: false, // Right handler
|
|
105
|
-
bc: false, // Bottom handler
|
|
106
|
-
// Being a flex child we need to change `flex-basis` property
|
|
107
|
-
// instead of the `width` (default)
|
|
108
|
-
keyWidth: 'flex-basis',
|
|
109
|
-
},
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
id: 'panel-switcher',
|
|
113
|
-
el: '.panel__switcher',
|
|
114
|
-
buttons: [{
|
|
115
|
-
id: 'show-layers',
|
|
116
|
-
active: true,
|
|
117
|
-
label: 'Layers',
|
|
118
|
-
command: 'show-layers',
|
|
119
|
-
// Once activated disable the possibility to turn it off
|
|
120
|
-
togglable: false,
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
id: 'show-style',
|
|
124
|
-
active: true,
|
|
125
|
-
label: 'Styles',
|
|
126
|
-
command: 'show-styles',
|
|
127
|
-
togglable: false,
|
|
128
|
-
},
|
|
129
|
-
{
|
|
130
|
-
id: 'show-traits',
|
|
131
|
-
active: true,
|
|
132
|
-
label: 'Traits',
|
|
133
|
-
command: 'show-traits',
|
|
134
|
-
togglable: false,
|
|
135
|
-
},
|
|
136
|
-
],
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
id: 'panel-devices',
|
|
140
|
-
el: '.panel__devices',
|
|
141
|
-
buttons: [{
|
|
142
|
-
id: 'device-desktop',
|
|
143
|
-
label: 'D',
|
|
144
|
-
command: 'set-device-desktop',
|
|
145
|
-
active: true,
|
|
146
|
-
togglable: false,
|
|
147
|
-
},
|
|
148
|
-
{
|
|
149
|
-
id: 'device-mobile',
|
|
150
|
-
label: 'M',
|
|
151
|
-
command: 'set-device-mobile',
|
|
152
|
-
togglable: false,
|
|
153
|
-
},
|
|
154
|
-
],
|
|
155
|
-
},
|
|
156
|
-
],
|
|
157
|
-
},
|
|
158
|
-
// The Selector Manager allows to assign classes and
|
|
159
|
-
// different states (eg. :hover) on components.
|
|
160
|
-
// Generally, it's used in conjunction with Style Manager
|
|
161
|
-
// but it's not mandatory
|
|
162
|
-
selectorManager: {
|
|
163
|
-
appendTo: '.styles-container',
|
|
164
|
-
},
|
|
165
|
-
styleManager: {
|
|
166
|
-
appendTo: '.styles-container',
|
|
167
|
-
sectors: [{
|
|
168
|
-
name: 'Dimension',
|
|
169
|
-
open: false,
|
|
170
|
-
// Use built-in properties
|
|
171
|
-
buildProps: ['width', 'min-height', 'padding'],
|
|
172
|
-
// Use `properties` to define/override single property
|
|
173
|
-
properties: [{
|
|
174
|
-
// Type of the input,
|
|
175
|
-
// options: integer | radio | select | color | slider | file | composite | stack
|
|
176
|
-
type: 'integer',
|
|
177
|
-
name: 'The width', // Label for the property
|
|
178
|
-
property: 'width', // CSS property (if buildProps contains it will be extended)
|
|
179
|
-
units: ['px', '%'], // Units, available only for 'integer' types
|
|
180
|
-
defaults: 'auto', // Default value
|
|
181
|
-
min: 0, // Min value, available only for 'integer' types
|
|
182
|
-
},],
|
|
183
|
-
},
|
|
184
|
-
{
|
|
185
|
-
name: 'Extra',
|
|
186
|
-
open: false,
|
|
187
|
-
buildProps: ['background-color', 'box-shadow', 'custom-prop'],
|
|
188
|
-
properties: [{
|
|
189
|
-
id: 'custom-prop',
|
|
190
|
-
name: 'Custom Label',
|
|
191
|
-
property: 'font-size',
|
|
192
|
-
type: 'select',
|
|
193
|
-
defaults: '32px',
|
|
194
|
-
// List of options, available only for 'select' and 'radio' types
|
|
195
|
-
options: [{
|
|
196
|
-
id: 'tiny',
|
|
197
|
-
value: '12px',
|
|
198
|
-
name: 'Tiny'
|
|
199
|
-
},
|
|
200
|
-
{
|
|
201
|
-
id: 'medium',
|
|
202
|
-
value: '18px',
|
|
203
|
-
name: 'Medium'
|
|
204
|
-
},
|
|
205
|
-
{
|
|
206
|
-
id: 'big',
|
|
207
|
-
value: '32px',
|
|
208
|
-
name: 'Big'
|
|
209
|
-
},
|
|
210
|
-
],
|
|
211
|
-
},],
|
|
212
|
-
},
|
|
213
|
-
],
|
|
214
|
-
},
|
|
215
|
-
});
|
|
216
|
-
// Define commands
|
|
217
|
-
editor.Commands.add('show-layers', {
|
|
218
|
-
getRowEl(editor) {
|
|
219
|
-
return editor.getContainer().closest('.editor-row');
|
|
220
|
-
},
|
|
221
|
-
getLayersEl(row) {
|
|
222
|
-
return row.querySelector('.layers-container');
|
|
223
|
-
},
|
|
224
|
-
run(editor, sender) {
|
|
225
|
-
const lmEl = this.getLayersEl(this.getRowEl(editor));
|
|
226
|
-
lmEl.style.display = '';
|
|
227
|
-
},
|
|
228
|
-
stop(editor, sender) {
|
|
229
|
-
const lmEl = this.getLayersEl(this.getRowEl(editor));
|
|
230
|
-
lmEl.style.display = 'none';
|
|
231
|
-
},
|
|
232
|
-
});
|
|
233
|
-
editor.Commands.add('show-styles', {
|
|
234
|
-
getRowEl(editor) {
|
|
235
|
-
return editor.getContainer().closest('.editor-row');
|
|
236
|
-
},
|
|
237
|
-
getStyleEl(row) {
|
|
238
|
-
return row.querySelector('.styles-container');
|
|
239
|
-
},
|
|
240
|
-
run(editor, sender) {
|
|
241
|
-
const smEl = this.getStyleEl(this.getRowEl(editor));
|
|
242
|
-
smEl.style.display = '';
|
|
243
|
-
},
|
|
244
|
-
stop(editor, sender) {
|
|
245
|
-
const smEl = this.getStyleEl(this.getRowEl(editor));
|
|
246
|
-
smEl.style.display = 'none';
|
|
247
|
-
},
|
|
248
|
-
});
|
|
249
|
-
editor.Commands.add('show-traits', {
|
|
250
|
-
getTraitsEl(editor) {
|
|
251
|
-
const row = editor.getContainer().closest('.editor-row');
|
|
252
|
-
return row.querySelector('.traits-container');
|
|
253
|
-
},
|
|
254
|
-
run(editor, sender) {
|
|
255
|
-
this.getTraitsEl(editor).style.display = '';
|
|
256
|
-
},
|
|
257
|
-
stop(editor, sender) {
|
|
258
|
-
this.getTraitsEl(editor).style.display = 'none';
|
|
259
|
-
},
|
|
260
|
-
});
|
|
261
|
-
editor.Panels.addPanel({
|
|
262
|
-
id: 'panel-top',
|
|
263
|
-
el: '.panel__top',
|
|
264
|
-
});
|
|
265
|
-
editor.Panels.addPanel({
|
|
266
|
-
id: 'basic-actions',
|
|
267
|
-
el: '.panel__basic-actions',
|
|
268
|
-
buttons: [{
|
|
269
|
-
id: 'visibility',
|
|
270
|
-
active: true, // active by default
|
|
271
|
-
className: 'btn-toggle-borders',
|
|
272
|
-
label: '<u>B</u>',
|
|
273
|
-
command: 'sw-visibility', // Built-in command
|
|
274
|
-
},
|
|
275
|
-
{
|
|
276
|
-
id: 'export',
|
|
277
|
-
className: 'btn-open-export',
|
|
278
|
-
label: 'Exp',
|
|
279
|
-
command: 'export-template',
|
|
280
|
-
context: 'export-template', // For grouping context of buttons from the same panel
|
|
281
|
-
},
|
|
282
|
-
{
|
|
283
|
-
id: 'show-json',
|
|
284
|
-
className: 'btn-show-json',
|
|
285
|
-
label: 'JSON',
|
|
286
|
-
context: 'show-json',
|
|
287
|
-
command(editor) {
|
|
288
|
-
editor.Modal.setTitle('Components JSON')
|
|
289
|
-
.setContent(`<textarea style="width:100%; height: 250px;">
|
|
290
|
-
${JSON.stringify(editor.getComponents())}
|
|
291
|
-
</textarea>`)
|
|
292
|
-
.open();
|
|
293
|
-
},
|
|
294
|
-
},
|
|
295
|
-
],
|
|
296
|
-
});
|
|
297
|
-
editor.Commands.add('set-device-desktop', {
|
|
298
|
-
run: (editor) => editor.setDevice('Desktop'),
|
|
299
|
-
});
|
|
300
|
-
editor.Commands.add('set-device-mobile', {
|
|
301
|
-
run: (editor) => editor.setDevice('Mobile'),
|
|
302
|
-
});
|
|
303
|
-
editor.on('change:device', () => console.log('Current device: ', editor.getDevice()));
|
|
304
|
-
// Set initial device as Mobile
|
|
305
|
-
editor.setDevice('Mobile');
|
|
306
|
-
nuxtApp.provide('grapesStudio', editor);
|
|
307
|
-
return editor;
|
|
308
|
-
};
|
|
309
|
-
// Auto‑mount when page loads
|
|
310
|
-
window.addEventListener('DOMContentLoaded', mount);
|
|
311
|
-
});
|
|
@@ -1,9 +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
|
-
export default defineNuxtPlugin((nuxtApp) => {
|
|
7
|
-
library.add(fas);
|
|
8
|
-
nuxtApp.vueApp.component('Fa', FontAwesomeIcon);
|
|
9
|
-
});
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { defineNuxtPlugin } from 'nuxt/app';
|
|
2
|
-
import { plugin as formKitPlugin, defaultConfig } from '@formkit/vue';
|
|
3
|
-
import '@formkit/themes/genesis';
|
|
4
|
-
export default defineNuxtPlugin((nuxtApp) => {
|
|
5
|
-
nuxtApp.vueApp.use(formKitPlugin, defaultConfig({
|
|
6
|
-
// You can inject your own inputs, locales, etc. here
|
|
7
|
-
}));
|
|
8
|
-
});
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { defineNuxtPlugin } from 'nuxt/app';
|
|
2
|
-
import { useTheme } from 'vuetify';
|
|
3
|
-
export default defineNuxtPlugin((nuxtApp) => {
|
|
4
|
-
if (process.server)
|
|
5
|
-
return;
|
|
6
|
-
const theme = useTheme();
|
|
7
|
-
const setTheme = (mode) => {
|
|
8
|
-
theme.global.name.value = mode;
|
|
9
|
-
document.documentElement.classList.toggle('dark', mode === 'dark');
|
|
10
|
-
localStorage.setItem('mframework-theme', mode);
|
|
11
|
-
};
|
|
12
|
-
const toggleTheme = () => {
|
|
13
|
-
const current = theme.global.name.value === 'light' ? 'dark' : 'light';
|
|
14
|
-
setTheme(current);
|
|
15
|
-
};
|
|
16
|
-
// Load saved theme
|
|
17
|
-
const saved = localStorage.getItem('mframework-theme');
|
|
18
|
-
if (saved === 'light' || saved === 'dark') {
|
|
19
|
-
setTheme(saved);
|
|
20
|
-
}
|
|
21
|
-
// Expose composable
|
|
22
|
-
nuxtApp.provide('mTheme', {
|
|
23
|
-
setTheme,
|
|
24
|
-
toggleTheme,
|
|
25
|
-
current: () => theme.global.name.value
|
|
26
|
-
});
|
|
27
|
-
});
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { defineNuxtPlugin, useRuntimeConfig } from 'nuxt/app';
|
|
2
|
-
import { useTheme } from 'vuetify';
|
|
3
|
-
export default defineNuxtPlugin(() => {
|
|
4
|
-
if (process.server)
|
|
5
|
-
return;
|
|
6
|
-
const theme = useTheme();
|
|
7
|
-
const config = useRuntimeConfig();
|
|
8
|
-
const baseColors = {
|
|
9
|
-
primary: 'var(--m-primary)',
|
|
10
|
-
secondary: 'var(--m-secondary)',
|
|
11
|
-
accent: 'var(--m-accent)',
|
|
12
|
-
surface: 'var(--m-surface)',
|
|
13
|
-
background: 'var(--m-muted)',
|
|
14
|
-
border: 'var(--m-border)',
|
|
15
|
-
// Required Vuetify system colors
|
|
16
|
-
success: '#22c55e',
|
|
17
|
-
warning: '#f59e0b',
|
|
18
|
-
error: '#ef4444',
|
|
19
|
-
info: '#3b82f6',
|
|
20
|
-
// Vuetify internal required fields
|
|
21
|
-
'on-primary': '#ffffff',
|
|
22
|
-
'on-secondary': '#ffffff',
|
|
23
|
-
'on-surface': '#ffffff',
|
|
24
|
-
'on-background': '#ffffff',
|
|
25
|
-
'on-success': '#ffffff',
|
|
26
|
-
'on-warning': '#ffffff',
|
|
27
|
-
'on-error': '#ffffff',
|
|
28
|
-
'on-info': '#ffffff'
|
|
29
|
-
};
|
|
30
|
-
const defaultTheme = config.public.mframeworkUi?.theme || 'light';
|
|
31
|
-
theme.global.name.value = defaultTheme;
|
|
32
|
-
theme.themes.value = {
|
|
33
|
-
light: {
|
|
34
|
-
dark: false,
|
|
35
|
-
colors: baseColors,
|
|
36
|
-
variables: {}
|
|
37
|
-
},
|
|
38
|
-
dark: {
|
|
39
|
-
dark: true,
|
|
40
|
-
colors: baseColors,
|
|
41
|
-
variables: {}
|
|
42
|
-
}
|
|
43
|
-
};
|
|
44
|
-
});
|
|
@@ -1,33 +0,0 @@
|
|
|
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
|
-
export default defineNuxtPlugin((nuxtApp) => {
|
|
7
|
-
const config = useRuntimeConfig();
|
|
8
|
-
const theme = config.public.mframeworkUi?.theme || 'light';
|
|
9
|
-
const vuetify = createVuetify({
|
|
10
|
-
components,
|
|
11
|
-
directives,
|
|
12
|
-
theme: {
|
|
13
|
-
defaultTheme: theme,
|
|
14
|
-
themes: {
|
|
15
|
-
light: {
|
|
16
|
-
dark: false,
|
|
17
|
-
colors: {
|
|
18
|
-
primary: '#3b82f6',
|
|
19
|
-
secondary: '#64748b'
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
dark: {
|
|
23
|
-
dark: true,
|
|
24
|
-
colors: {
|
|
25
|
-
primary: '#3b82f6',
|
|
26
|
-
secondary: '#64748b'
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
nuxtApp.vueApp.use(vuetify);
|
|
33
|
-
});
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
export function getSearchClient() {
|
|
2
|
-
let mod;
|
|
3
|
-
try {
|
|
4
|
-
mod = require('@searchkit/instantsearch-client');
|
|
5
|
-
}
|
|
6
|
-
catch {
|
|
7
|
-
console.warn('[mframework-ui] Searchkit client missing');
|
|
8
|
-
return null;
|
|
9
|
-
}
|
|
10
|
-
const candidate = mod?.default?.default ||
|
|
11
|
-
mod?.default?.createClient ||
|
|
12
|
-
mod?.default ||
|
|
13
|
-
mod?.createClient ||
|
|
14
|
-
mod;
|
|
15
|
-
if (typeof candidate !== 'function')
|
|
16
|
-
return null;
|
|
17
|
-
const host = process.env.NUXT_PUBLIC_SEARCHKIT_HOST;
|
|
18
|
-
if (!host)
|
|
19
|
-
return null;
|
|
20
|
-
return candidate({ host });
|
|
21
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { getSearchClient } from './client';
|
|
2
|
-
export default (nuxtApp) => {
|
|
3
|
-
const client = getSearchClient();
|
|
4
|
-
const indexName = process.env.NUXT_PUBLIC_SEARCH_INDEX || 'default';
|
|
5
|
-
nuxtApp.provide('mSearchClient', client);
|
|
6
|
-
nuxtApp.provide('mSearchIndex', indexName);
|
|
7
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
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 };
|
|
@@ -1,18 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export interface Condition {
|
|
2
|
-
field: string;
|
|
3
|
-
action: 'show' | 'hide';
|
|
4
|
-
condition: 'is_empty' | 'is_filled' | 'contains' | 'not_contains' | 'equals' | 'not_equal';
|
|
5
|
-
value: string;
|
|
6
|
-
}
|
|
7
|
-
export declare function mapConditions(conditions: Condition[]): void;
|
|
8
|
-
export declare function transformSchema(schema: Array<object>): {
|
|
9
|
-
$cmp: any;
|
|
10
|
-
children: any;
|
|
11
|
-
props: any;
|
|
12
|
-
}[];
|