@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.
Files changed (206) hide show
  1. package/dist/module.d.mts +3 -0
  2. package/dist/module.json +1 -1
  3. package/dist/module.mjs +29 -7
  4. package/dist/runtime/assets/config/tailwind.conifg.js +37 -6
  5. package/dist/runtime/components/Gallery.d.vue.ts +0 -0
  6. package/dist/runtime/components/Gallery.vue +56 -0
  7. package/dist/runtime/components/Gallery.vue.d.ts +0 -0
  8. package/dist/runtime/composables/useMToast.d.ts +0 -5
  9. package/dist/runtime/composables/useMToast.js +9 -9
  10. package/dist/runtime/design/tokens.d.ts +0 -22
  11. package/dist/runtime/design/tokens.js +20 -20
  12. package/dist/runtime/plugins/builder.d.ts +0 -3
  13. package/dist/runtime/plugins/builder.js +328 -303
  14. package/dist/runtime/plugins/fontawesome.d.ts +0 -3
  15. package/dist/runtime/plugins/fontawesome.js +7 -7
  16. package/dist/runtime/plugins/formkit.d.ts +0 -3
  17. package/dist/runtime/plugins/formkit.js +5 -5
  18. package/dist/runtime/plugins/lightgallery.d.ts +0 -6
  19. package/dist/runtime/plugins/lightgallery.js +20 -14
  20. package/dist/runtime/plugins/motion.d.ts +0 -2
  21. package/dist/runtime/plugins/motion.js +3 -3
  22. package/dist/runtime/plugins/theme-switcher.d.ts +0 -2
  23. package/dist/runtime/plugins/theme-switcher.js +22 -25
  24. package/dist/runtime/plugins/theme.d.ts +0 -2
  25. package/dist/runtime/plugins/theme.js +46 -32
  26. package/dist/runtime/plugins/vuetify.d.ts +0 -3
  27. package/dist/runtime/plugins/vuetify.js +30 -30
  28. package/dist/runtime/search/client.d.ts +0 -2
  29. package/dist/runtime/search/client.js +12 -19
  30. package/dist/runtime/search/plugin.d.ts +0 -2
  31. package/dist/runtime/search/plugin.js +5 -5
  32. package/dist/runtime/styles/index.css +93 -0
  33. package/dist/runtime/styles/tailwind.css +1 -1
  34. package/package.json +8 -3
  35. package/dist/adapters/adapter-directus/src/types/ui.d.ts +0 -21
  36. package/dist/adapters/adapter-directus/src/types/ui.js +0 -1
  37. package/dist/module.d.ts +0 -6
  38. package/dist/module.js +0 -68
  39. package/dist/modules/ui/src/module.d.ts +0 -8
  40. package/dist/modules/ui/src/module.js +0 -75
  41. package/dist/modules/ui/src/runtime/composables/useMToast.d.ts +0 -5
  42. package/dist/modules/ui/src/runtime/composables/useMToast.js +0 -11
  43. package/dist/modules/ui/src/runtime/design/tokens.d.ts +0 -22
  44. package/dist/modules/ui/src/runtime/design/tokens.js +0 -22
  45. package/dist/modules/ui/src/runtime/plugins/builder.d.ts +0 -3
  46. package/dist/modules/ui/src/runtime/plugins/builder.js +0 -311
  47. package/dist/modules/ui/src/runtime/plugins/fontawesome.d.ts +0 -3
  48. package/dist/modules/ui/src/runtime/plugins/fontawesome.js +0 -9
  49. package/dist/modules/ui/src/runtime/plugins/formkit.d.ts +0 -3
  50. package/dist/modules/ui/src/runtime/plugins/formkit.js +0 -8
  51. package/dist/modules/ui/src/runtime/plugins/motion.d.ts +0 -2
  52. package/dist/modules/ui/src/runtime/plugins/motion.js +0 -5
  53. package/dist/modules/ui/src/runtime/plugins/theme-switcher.d.ts +0 -2
  54. package/dist/modules/ui/src/runtime/plugins/theme-switcher.js +0 -27
  55. package/dist/modules/ui/src/runtime/plugins/theme.d.ts +0 -2
  56. package/dist/modules/ui/src/runtime/plugins/theme.js +0 -44
  57. package/dist/modules/ui/src/runtime/plugins/vuetify.d.ts +0 -3
  58. package/dist/modules/ui/src/runtime/plugins/vuetify.js +0 -33
  59. package/dist/modules/ui/src/runtime/search/client.d.ts +0 -2
  60. package/dist/modules/ui/src/runtime/search/client.js +0 -21
  61. package/dist/modules/ui/src/runtime/search/plugin.d.ts +0 -2
  62. package/dist/modules/ui/src/runtime/search/plugin.js +0 -7
  63. package/dist/modules/ui/src/utils/color.d.ts +0 -2
  64. package/dist/modules/ui/src/utils/color.js +0 -11
  65. package/dist/modules/ui/src/utils/fonts.d.ts +0 -5
  66. package/dist/modules/ui/src/utils/fonts.js +0 -18
  67. package/dist/modules/ui/src/utils/formkit.d.ts +0 -12
  68. package/dist/modules/ui/src/utils/formkit.js +0 -59
  69. package/dist/modules/ui/src/utils/icons.d.ts +0 -4
  70. package/dist/modules/ui/src/utils/icons.js +0 -36
  71. package/dist/runtime/plugins/icon-switcher.d.ts +0 -2
  72. package/dist/runtime/plugins/icon-switcher.js +0 -24
  73. package/dist/types/ui/api/global-search.d.ts +0 -8
  74. package/dist/types/ui/api/global-search.js +0 -1
  75. package/dist/types/ui/blocks/block-button-group.d.ts +0 -6
  76. package/dist/types/ui/blocks/block-button-group.js +0 -1
  77. package/dist/types/ui/blocks/block-button.d.ts +0 -13
  78. package/dist/types/ui/blocks/block-button.js +0 -1
  79. package/dist/types/ui/blocks/block-column.d.ts +0 -18
  80. package/dist/types/ui/blocks/block-column.js +0 -1
  81. package/dist/types/ui/blocks/block-cta.d.ts +0 -11
  82. package/dist/types/ui/blocks/block-cta.js +0 -1
  83. package/dist/types/ui/blocks/block-divider.d.ts +0 -4
  84. package/dist/types/ui/blocks/block-divider.js +0 -1
  85. package/dist/types/ui/blocks/block-faq.d.ts +0 -11
  86. package/dist/types/ui/blocks/block-faq.js +0 -1
  87. package/dist/types/ui/blocks/block-form.d.ts +0 -7
  88. package/dist/types/ui/blocks/block-form.js +0 -1
  89. package/dist/types/ui/blocks/block-gallery.d.ts +0 -13
  90. package/dist/types/ui/blocks/block-gallery.js +0 -1
  91. package/dist/types/ui/blocks/block-hero.d.ts +0 -11
  92. package/dist/types/ui/blocks/block-hero.js +0 -1
  93. package/dist/types/ui/blocks/block-html.d.ts +0 -4
  94. package/dist/types/ui/blocks/block-html.js +0 -1
  95. package/dist/types/ui/blocks/block-logocloud.d.ts +0 -13
  96. package/dist/types/ui/blocks/block-logocloud.js +0 -1
  97. package/dist/types/ui/blocks/block-quote.d.ts +0 -10
  98. package/dist/types/ui/blocks/block-quote.js +0 -1
  99. package/dist/types/ui/blocks/block-richtext.d.ts +0 -7
  100. package/dist/types/ui/blocks/block-richtext.js +0 -1
  101. package/dist/types/ui/blocks/block-steps.d.ts +0 -21
  102. package/dist/types/ui/blocks/block-steps.js +0 -1
  103. package/dist/types/ui/blocks/block-team.d.ts +0 -6
  104. package/dist/types/ui/blocks/block-team.js +0 -1
  105. package/dist/types/ui/blocks/block-testimonial.d.ts +0 -13
  106. package/dist/types/ui/blocks/block-testimonial.js +0 -1
  107. package/dist/types/ui/blocks/block-video.d.ts +0 -9
  108. package/dist/types/ui/blocks/block-video.js +0 -1
  109. package/dist/types/ui/blocks/block.d.ts +0 -17
  110. package/dist/types/ui/blocks/block.js +0 -1
  111. package/dist/types/ui/blocks/index.d.ts +0 -18
  112. package/dist/types/ui/blocks/index.js +0 -1
  113. package/dist/types/ui/component.d.ts +0 -6
  114. package/dist/types/ui/component.js +0 -1
  115. package/dist/types/ui/content/category.d.ts +0 -10
  116. package/dist/types/ui/content/category.js +0 -1
  117. package/dist/types/ui/content/form.d.ts +0 -21
  118. package/dist/types/ui/content/form.js +0 -1
  119. package/dist/types/ui/content/index.d.ts +0 -6
  120. package/dist/types/ui/content/index.js +0 -1
  121. package/dist/types/ui/content/page.d.ts +0 -38
  122. package/dist/types/ui/content/page.js +0 -1
  123. package/dist/types/ui/content/post.d.ts +0 -38
  124. package/dist/types/ui/content/post.js +0 -1
  125. package/dist/types/ui/content/team.d.ts +0 -17
  126. package/dist/types/ui/content/team.js +0 -1
  127. package/dist/types/ui/content/testimonial.d.ts +0 -18
  128. package/dist/types/ui/content/testimonial.js +0 -1
  129. package/dist/types/ui/form.d.ts +0 -12
  130. package/dist/types/ui/form.js +0 -1
  131. package/dist/types/ui/help/index.d.ts +0 -51
  132. package/dist/types/ui/help/index.js +0 -1
  133. package/dist/types/ui/meta/analytics.d.ts +0 -21
  134. package/dist/types/ui/meta/analytics.js +0 -1
  135. package/dist/types/ui/meta/config.d.ts +0 -22
  136. package/dist/types/ui/meta/config.js +0 -1
  137. package/dist/types/ui/meta/globals.d.ts +0 -33
  138. package/dist/types/ui/meta/globals.js +0 -1
  139. package/dist/types/ui/meta/index.d.ts +0 -6
  140. package/dist/types/ui/meta/index.js +0 -1
  141. package/dist/types/ui/meta/navigation.d.ts +0 -31
  142. package/dist/types/ui/meta/navigation.js +0 -1
  143. package/dist/types/ui/meta/redirect.d.ts +0 -12
  144. package/dist/types/ui/meta/redirect.js +0 -1
  145. package/dist/types/ui/meta/seo.d.ts +0 -19
  146. package/dist/types/ui/meta/seo.js +0 -1
  147. package/dist/types/ui/os/contact.d.ts +0 -22
  148. package/dist/types/ui/os/contact.js +0 -1
  149. package/dist/types/ui/os/conversation.d.ts +0 -23
  150. package/dist/types/ui/os/conversation.js +0 -1
  151. package/dist/types/ui/os/index.d.ts +0 -16
  152. package/dist/types/ui/os/index.js +0 -1
  153. package/dist/types/ui/os/organization.d.ts +0 -51
  154. package/dist/types/ui/os/organization.js +0 -1
  155. package/dist/types/ui/os/os-activity.d.ts +0 -26
  156. package/dist/types/ui/os/os-activity.js +0 -1
  157. package/dist/types/ui/os/os-deal.d.ts +0 -42
  158. package/dist/types/ui/os/os-deal.js +0 -1
  159. package/dist/types/ui/os/os-expense.d.ts +0 -21
  160. package/dist/types/ui/os/os-expense.js +0 -1
  161. package/dist/types/ui/os/os-invoice.d.ts +0 -46
  162. package/dist/types/ui/os/os-invoice.js +0 -1
  163. package/dist/types/ui/os/os-item.d.ts +0 -17
  164. package/dist/types/ui/os/os-item.js +0 -1
  165. package/dist/types/ui/os/os-payment.d.ts +0 -27
  166. package/dist/types/ui/os/os-payment.js +0 -1
  167. package/dist/types/ui/os/os-project.d.ts +0 -45
  168. package/dist/types/ui/os/os-project.js +0 -1
  169. package/dist/types/ui/os/os-proposal.d.ts +0 -61
  170. package/dist/types/ui/os/os-proposal.js +0 -1
  171. package/dist/types/ui/os/os-settings.d.ts +0 -17
  172. package/dist/types/ui/os/os-settings.js +0 -1
  173. package/dist/types/ui/os/os-subscription.d.ts +0 -12
  174. package/dist/types/ui/os/os-subscription.js +0 -1
  175. package/dist/types/ui/os/os-task.d.ts +0 -32
  176. package/dist/types/ui/os/os-task.js +0 -1
  177. package/dist/types/ui/os/os-tax-rate.d.ts +0 -12
  178. package/dist/types/ui/os/os-tax-rate.js +0 -1
  179. package/dist/types/ui/pageComponentMap.d.ts +0 -2
  180. package/dist/types/ui/pageComponentMap.js +0 -7
  181. package/dist/types/ui/pagination.d.ts +0 -6
  182. package/dist/types/ui/pagination.js +0 -1
  183. package/dist/types/ui/schema.d.ts +0 -78
  184. package/dist/types/ui/schema.js +0 -1
  185. package/dist/types/ui/state.d.ts +0 -5
  186. package/dist/types/ui/state.js +0 -1
  187. package/dist/types/ui/system/file.d.ts +0 -47
  188. package/dist/types/ui/system/file.js +0 -1
  189. package/dist/types/ui/system/folder.d.ts +0 -8
  190. package/dist/types/ui/system/folder.js +0 -1
  191. package/dist/types/ui/system/index.d.ts +0 -4
  192. package/dist/types/ui/system/index.js +0 -1
  193. package/dist/types/ui/system/role.d.ts +0 -20
  194. package/dist/types/ui/system/role.js +0 -1
  195. package/dist/types/ui/system/user.d.ts +0 -57
  196. package/dist/types/ui/system/user.js +0 -1
  197. package/dist/types/ui.d.ts +0 -21
  198. package/dist/types/ui.js +0 -1
  199. package/dist/utils/color.d.ts +0 -2
  200. package/dist/utils/color.js +0 -11
  201. package/dist/utils/fonts.d.ts +0 -5
  202. package/dist/utils/fonts.js +0 -18
  203. package/dist/utils/formkit.d.ts +0 -12
  204. package/dist/utils/formkit.js +0 -59
  205. package/dist/utils/icons.d.ts +0 -4
  206. package/dist/utils/icons.js +0 -36
@@ -1,311 +1,336 @@
1
- import { defineNuxtPlugin } from 'nuxt/app';
2
- import 'grapesjs/dist/css/grapes.min.css';
3
- import grapesjs from 'grapesjs';
1
+ import {
2
+ defineNuxtPlugin
3
+ } from "nuxt/app";
4
+ import "grapesjs/dist/css/grapes.min.css";
5
+ import grapesjs from "grapesjs";
4
6
  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');
7
+ if (process.server) return;
8
+ const mount = () => {
9
+ const el = document.querySelector("#gjs");
10
+ if (!el) 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",
32
+ // default is `max-width`
33
+ deviceManager: {
34
+ devices: [
35
+ {
36
+ name: "Desktop",
37
+ width: "",
38
+ // default size
39
+ widthMedia: "1024px"
40
+ // this value will be used in CSS @media
41
+ },
42
+ {
43
+ name: "Mobile",
44
+ width: "320px",
45
+ // this value will be used on canvas width
46
+ widthMedia: "480px"
47
+ // this value will be used in CSS @media
48
+ }
49
+ ]
50
+ },
51
+ blockManager: {
52
+ appendTo: "#blocks",
53
+ blocks: [
54
+ {
55
+ id: "section",
56
+ // id is mandatory
57
+ label: "<b>Section</b>",
58
+ // You can use HTML/SVG inside labels
59
+ category: "Basic",
60
+ attributes: {
61
+ class: "gjs-block-section"
236
62
  },
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
63
+ content: {
64
+ tagName: "div",
65
+ draggable: false,
66
+ attributes: {
67
+ "some-attribute": "some-value"
68
+ },
69
+ components: [
70
+ {
71
+ tagName: "span",
72
+ content: "<b>Some static content</b>"
274
73
  },
275
74
  {
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
75
+ tagName: "div",
76
+ // use `content` for static strings, `components` string will be parsed
77
+ // and transformed in Components
78
+ components: "<span>HTML at some point</span>"
79
+ }
80
+ ]
81
+ }
82
+ },
83
+ {
84
+ id: "text",
85
+ label: "Text",
86
+ content: '<div data-gjs-type="text">Insert your text here</div>'
87
+ },
88
+ {
89
+ id: "image",
90
+ label: "Image",
91
+ // Select the component once it's dropped
92
+ select: true,
93
+ // You can pass components as a JSON instead of a simple HTML string,
94
+ // in this case we also use a defined component type `image`
95
+ content: {
96
+ type: "image"
97
+ },
98
+ // This triggers `active` event on dropped components and the `image`
99
+ // reacts by opening the AssetManager
100
+ activate: true
101
+ }
102
+ ]
103
+ },
104
+ panels: {
105
+ defaults: [
106
+ {
107
+ id: "layers",
108
+ el: ".panel__right",
109
+ // Make the panel resizable
110
+ resizable: {
111
+ maxDim: 350,
112
+ minDim: 200,
113
+ tc: false,
114
+ // Top handler
115
+ cl: true,
116
+ // Left handler
117
+ cr: false,
118
+ // Right handler
119
+ bc: false,
120
+ // Bottom handler
121
+ // Being a flex child we need to change `flex-basis` property
122
+ // instead of the `width` (default)
123
+ keyWidth: "flex-basis"
124
+ }
125
+ },
126
+ {
127
+ id: "panel-switcher",
128
+ el: ".panel__switcher",
129
+ buttons: [
130
+ {
131
+ id: "show-layers",
132
+ active: true,
133
+ label: "Layers",
134
+ command: "show-layers",
135
+ // Once activated disable the possibility to turn it off
136
+ togglable: false
137
+ },
138
+ {
139
+ id: "show-style",
140
+ active: true,
141
+ label: "Styles",
142
+ command: "show-styles",
143
+ togglable: false
144
+ },
145
+ {
146
+ id: "show-traits",
147
+ active: true,
148
+ label: "Traits",
149
+ command: "show-traits",
150
+ togglable: false
151
+ }
152
+ ]
153
+ },
154
+ {
155
+ id: "panel-devices",
156
+ el: ".panel__devices",
157
+ buttons: [
158
+ {
159
+ id: "device-desktop",
160
+ label: "D",
161
+ command: "set-device-desktop",
162
+ active: true,
163
+ togglable: false
164
+ },
165
+ {
166
+ id: "device-mobile",
167
+ label: "M",
168
+ command: "set-device-mobile",
169
+ togglable: false
170
+ }
171
+ ]
172
+ }
173
+ ]
174
+ },
175
+ // The Selector Manager allows to assign classes and
176
+ // different states (eg. :hover) on components.
177
+ // Generally, it's used in conjunction with Style Manager
178
+ // but it's not mandatory
179
+ selectorManager: {
180
+ appendTo: ".styles-container"
181
+ },
182
+ styleManager: {
183
+ appendTo: ".styles-container",
184
+ sectors: [
185
+ {
186
+ name: "Dimension",
187
+ open: false,
188
+ // Use built-in properties
189
+ buildProps: ["width", "min-height", "padding"],
190
+ // Use `properties` to define/override single property
191
+ properties: [{
192
+ // Type of the input,
193
+ // options: integer | radio | select | color | slider | file | composite | stack
194
+ type: "integer",
195
+ name: "The width",
196
+ // Label for the property
197
+ property: "width",
198
+ // CSS property (if buildProps contains it will be extended)
199
+ units: ["px", "%"],
200
+ // Units, available only for 'integer' types
201
+ defaults: "auto",
202
+ // Default value
203
+ min: 0
204
+ // Min value, available only for 'integer' types
205
+ }]
206
+ },
207
+ {
208
+ name: "Extra",
209
+ open: false,
210
+ buildProps: ["background-color", "box-shadow", "custom-prop"],
211
+ properties: [{
212
+ id: "custom-prop",
213
+ name: "Custom Label",
214
+ property: "font-size",
215
+ type: "select",
216
+ defaults: "32px",
217
+ // List of options, available only for 'select' and 'radio' types
218
+ options: [
219
+ {
220
+ id: "tiny",
221
+ value: "12px",
222
+ name: "Tiny"
281
223
  },
282
224
  {
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
- },
225
+ id: "medium",
226
+ value: "18px",
227
+ name: "Medium"
294
228
  },
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);
229
+ {
230
+ id: "big",
231
+ value: "32px",
232
+ name: "Big"
233
+ }
234
+ ]
235
+ }]
236
+ }
237
+ ]
238
+ }
239
+ });
240
+ editor.Commands.add("show-layers", {
241
+ getRowEl(editor2) {
242
+ return editor2.getContainer().closest(".editor-row");
243
+ },
244
+ getLayersEl(row) {
245
+ return row.querySelector(".layers-container");
246
+ },
247
+ run(editor2, sender) {
248
+ const lmEl = this.getLayersEl(this.getRowEl(editor2));
249
+ lmEl.style.display = "";
250
+ },
251
+ stop(editor2, sender) {
252
+ const lmEl = this.getLayersEl(this.getRowEl(editor2));
253
+ lmEl.style.display = "none";
254
+ }
255
+ });
256
+ editor.Commands.add("show-styles", {
257
+ getRowEl(editor2) {
258
+ return editor2.getContainer().closest(".editor-row");
259
+ },
260
+ getStyleEl(row) {
261
+ return row.querySelector(".styles-container");
262
+ },
263
+ run(editor2, sender) {
264
+ const smEl = this.getStyleEl(this.getRowEl(editor2));
265
+ smEl.style.display = "";
266
+ },
267
+ stop(editor2, sender) {
268
+ const smEl = this.getStyleEl(this.getRowEl(editor2));
269
+ smEl.style.display = "none";
270
+ }
271
+ });
272
+ editor.Commands.add("show-traits", {
273
+ getTraitsEl(editor2) {
274
+ const row = editor2.getContainer().closest(".editor-row");
275
+ return row.querySelector(".traits-container");
276
+ },
277
+ run(editor2, sender) {
278
+ this.getTraitsEl(editor2).style.display = "";
279
+ },
280
+ stop(editor2, sender) {
281
+ this.getTraitsEl(editor2).style.display = "none";
282
+ }
283
+ });
284
+ editor.Panels.addPanel({
285
+ id: "panel-top",
286
+ el: ".panel__top"
287
+ });
288
+ editor.Panels.addPanel({
289
+ id: "basic-actions",
290
+ el: ".panel__basic-actions",
291
+ buttons: [
292
+ {
293
+ id: "visibility",
294
+ active: true,
295
+ // active by default
296
+ className: "btn-toggle-borders",
297
+ label: "<u>B</u>",
298
+ command: "sw-visibility"
299
+ // Built-in command
300
+ },
301
+ {
302
+ id: "export",
303
+ className: "btn-open-export",
304
+ label: "Exp",
305
+ command: "export-template",
306
+ context: "export-template"
307
+ // For grouping context of buttons from the same panel
308
+ },
309
+ {
310
+ id: "show-json",
311
+ className: "btn-show-json",
312
+ label: "JSON",
313
+ context: "show-json",
314
+ command(editor2) {
315
+ editor2.Modal.setTitle("Components JSON").setContent(
316
+ `<textarea style="width:100%; height: 250px;">
317
+ ${JSON.stringify(editor2.getComponents())}
318
+ </textarea>`
319
+ ).open();
320
+ }
321
+ }
322
+ ]
323
+ });
324
+ editor.Commands.add("set-device-desktop", {
325
+ run: (editor2) => editor2.setDevice("Desktop")
326
+ });
327
+ editor.Commands.add("set-device-mobile", {
328
+ run: (editor2) => editor2.setDevice("Mobile")
329
+ });
330
+ editor.on("change:device", () => console.log("Current device: ", editor.getDevice()));
331
+ editor.setDevice("Mobile");
332
+ nuxtApp.provide("grapesStudio", editor);
333
+ return editor;
334
+ };
335
+ window.addEventListener("DOMContentLoaded", mount);
311
336
  });
@@ -1,3 +0,0 @@
1
- import '@fortawesome/fontawesome-free/css/all.min.css';
2
- declare const _default: import("nuxt/app").Plugin<Record<string, unknown>> & import("nuxt/app").ObjectPlugin<Record<string, unknown>>;
3
- export default _default;
@@ -1,9 +1,9 @@
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';
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
6
  export default defineNuxtPlugin((nuxtApp) => {
7
- library.add(fas);
8
- nuxtApp.vueApp.component('Fa', FontAwesomeIcon);
7
+ library.add(fas);
8
+ nuxtApp.vueApp.component("Fa", FontAwesomeIcon);
9
9
  });
@@ -1,3 +0,0 @@
1
- import '@formkit/themes/genesis';
2
- declare const _default: import("nuxt/app").Plugin<Record<string, unknown>> & import("nuxt/app").ObjectPlugin<Record<string, unknown>>;
3
- export default _default;