Update builder.html
Browse files- builder.html +18 -14
builder.html
CHANGED
@@ -7,21 +7,24 @@
|
|
7 |
<!-- GrapesJS CSS -->
|
8 |
<link rel="stylesheet" href="https://unpkg.com/grapesjs/dist/css/grapes.min.css">
|
9 |
|
10 |
-
|
|
|
11 |
<style>
|
|
|
12 |
.gjs-row {
|
13 |
display: flex;
|
14 |
justify-content: space-between;
|
15 |
-
border: 1px solid #ccc;
|
16 |
padding: 10px;
|
17 |
text-align: center;
|
18 |
-
min-height: 50px;
|
19 |
}
|
|
|
20 |
.gjs-cell {
|
21 |
-
border: 1px solid #ccc;
|
22 |
padding: 10px;
|
23 |
text-align: center;
|
24 |
-
min-height: 50px;
|
25 |
}
|
26 |
</style>
|
27 |
</head>
|
@@ -32,13 +35,14 @@
|
|
32 |
<script src="https://unpkg.com/grapesjs"></script>
|
33 |
<!-- Your Custom JS -->
|
34 |
<script>
|
|
|
35 |
const editor = grapesjs.init({
|
36 |
-
container: '#gjs',
|
37 |
-
fromElement: true,
|
38 |
-
height: '100vh',
|
39 |
-
storageManager: { type: 0 },
|
40 |
-
plugins: [],
|
41 |
-
pluginsOpts: {},
|
42 |
styleManager: {
|
43 |
sectors: [
|
44 |
{
|
@@ -50,7 +54,7 @@
|
|
50 |
property: 'width',
|
51 |
units: ['px', '%'],
|
52 |
min: 0,
|
53 |
-
default: '300px', //
|
54 |
},
|
55 |
{
|
56 |
type: 'number',
|
@@ -58,7 +62,7 @@
|
|
58 |
property: 'height',
|
59 |
units: ['px', '%'],
|
60 |
min: 0,
|
61 |
-
default: '80px', //
|
62 |
},
|
63 |
],
|
64 |
},
|
@@ -66,7 +70,7 @@
|
|
66 |
},
|
67 |
});
|
68 |
|
69 |
-
//
|
70 |
const blockManager = editor.BlockManager;
|
71 |
blockManager.add('horizontal-block', {
|
72 |
label: 'Horizontal Block',
|
|
|
7 |
<!-- GrapesJS CSS -->
|
8 |
<link rel="stylesheet" href="https://unpkg.com/grapesjs/dist/css/grapes.min.css">
|
9 |
|
10 |
+
|
11 |
+
<!-- Your Custom CSS -->
|
12 |
<style>
|
13 |
+
/* Styles for rows */
|
14 |
.gjs-row {
|
15 |
display: flex;
|
16 |
justify-content: space-between;
|
17 |
+
border: 1px solid #ccc;
|
18 |
padding: 10px;
|
19 |
text-align: center;
|
20 |
+
min-height: 50px;
|
21 |
}
|
22 |
+
/* Styles for cells */
|
23 |
.gjs-cell {
|
24 |
+
border: 1px solid #ccc;
|
25 |
padding: 10px;
|
26 |
text-align: center;
|
27 |
+
min-height: 50px;
|
28 |
}
|
29 |
</style>
|
30 |
</head>
|
|
|
35 |
<script src="https://unpkg.com/grapesjs"></script>
|
36 |
<!-- Your Custom JS -->
|
37 |
<script>
|
38 |
+
// Initialize GrapesJS editor
|
39 |
const editor = grapesjs.init({
|
40 |
+
container: '#gjs', // Container element for the editor
|
41 |
+
fromElement: true, // Initialize from existing HTML content
|
42 |
+
height: '100vh', // Full viewport height
|
43 |
+
storageManager: { type: 0 }, // Disable storage manager
|
44 |
+
plugins: [], // No plugins for now
|
45 |
+
pluginsOpts: {}, // No plugin options
|
46 |
styleManager: {
|
47 |
sectors: [
|
48 |
{
|
|
|
54 |
property: 'width',
|
55 |
units: ['px', '%'],
|
56 |
min: 0,
|
57 |
+
default: '300px', // Default width
|
58 |
},
|
59 |
{
|
60 |
type: 'number',
|
|
|
62 |
property: 'height',
|
63 |
units: ['px', '%'],
|
64 |
min: 0,
|
65 |
+
default: '80px', // Default height
|
66 |
},
|
67 |
],
|
68 |
},
|
|
|
70 |
},
|
71 |
});
|
72 |
|
73 |
+
// Add a block with custom components
|
74 |
const blockManager = editor.BlockManager;
|
75 |
blockManager.add('horizontal-block', {
|
76 |
label: 'Horizontal Block',
|