Update builder.html
Browse files- builder.html +19 -41
builder.html
CHANGED
@@ -7,15 +7,21 @@
|
|
7 |
<!-- GrapesJS CSS -->
|
8 |
<link rel="stylesheet" href="https://unpkg.com/grapesjs/dist/css/grapes.min.css">
|
9 |
|
10 |
-
|
11 |
<style>
|
12 |
-
.gjs-
|
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 |
</style>
|
21 |
</head>
|
@@ -60,45 +66,17 @@
|
|
60 |
},
|
61 |
});
|
62 |
|
63 |
-
// Define custom components
|
64 |
-
editor.Components.addType('custom-block', {
|
65 |
-
model: {
|
66 |
-
defaults: {
|
67 |
-
tagName: 'div',
|
68 |
-
traits: [
|
69 |
-
{
|
70 |
-
type: 'number',
|
71 |
-
label: 'Width',
|
72 |
-
name: 'width',
|
73 |
-
units: ['px', '%'],
|
74 |
-
min: 0,
|
75 |
-
default: '300px', // Добавлены настройки по умолчанию
|
76 |
-
},
|
77 |
-
{
|
78 |
-
type: 'number',
|
79 |
-
label: 'Height',
|
80 |
-
name: 'height',
|
81 |
-
units: ['px', '%'],
|
82 |
-
min: 0,
|
83 |
-
default: '80px', // Добавлены настройки по умолчанию
|
84 |
-
},
|
85 |
-
],
|
86 |
-
components: `
|
87 |
-
<div class="gjs-block">
|
88 |
-
<div></div>
|
89 |
-
<div></div>
|
90 |
-
<div></div>
|
91 |
-
</div>
|
92 |
-
`,
|
93 |
-
},
|
94 |
-
},
|
95 |
-
});
|
96 |
-
|
97 |
// Example of adding a block with custom components
|
98 |
const blockManager = editor.BlockManager;
|
99 |
-
blockManager.add('
|
100 |
-
label: '
|
101 |
-
content:
|
|
|
|
|
|
|
|
|
|
|
|
|
102 |
attributes: { class: 'gjs-block-section' }
|
103 |
});
|
104 |
</script>
|
|
|
7 |
<!-- GrapesJS CSS -->
|
8 |
<link rel="stylesheet" href="https://unpkg.com/grapesjs/dist/css/grapes.min.css">
|
9 |
|
10 |
+
<!-- Your Custom CSS -->
|
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>
|
|
|
66 |
},
|
67 |
});
|
68 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
// Example of adding a block with custom components
|
70 |
const blockManager = editor.BlockManager;
|
71 |
+
blockManager.add('horizontal-block', {
|
72 |
+
label: 'Horizontal Block',
|
73 |
+
content: `
|
74 |
+
<div class="gjs-row">
|
75 |
+
<div class="gjs-cell"></div>
|
76 |
+
<div class="gjs-cell"></div>
|
77 |
+
<div class="gjs-cell"></div>
|
78 |
+
</div>
|
79 |
+
`,
|
80 |
attributes: { class: 'gjs-block-section' }
|
81 |
});
|
82 |
</script>
|