Update builder.html
Browse files- builder.html +62 -26
builder.html
CHANGED
|
@@ -24,37 +24,73 @@
|
|
| 24 |
selectorManager: {
|
| 25 |
componentFirst: true,
|
| 26 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
});
|
| 28 |
|
| 29 |
-
//
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
};
|
| 34 |
|
| 35 |
-
// Define
|
| 36 |
-
editor.Components.addType('
|
| 37 |
model: {
|
| 38 |
defaults: {
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
label: 'Test block',
|
| 56 |
-
attributes: { class: 'fa fa-text' },
|
| 57 |
-
content: { type: 'comp-with-js' },
|
| 58 |
});
|
| 59 |
</script>
|
| 60 |
</body>
|
|
|
|
| 24 |
selectorManager: {
|
| 25 |
componentFirst: true,
|
| 26 |
},
|
| 27 |
+
styleManager: {
|
| 28 |
+
sectors: [
|
| 29 |
+
{
|
| 30 |
+
name: 'Dimensions',
|
| 31 |
+
properties: [
|
| 32 |
+
{
|
| 33 |
+
type: 'integer',
|
| 34 |
+
name: 'width',
|
| 35 |
+
units: ['px', '%'],
|
| 36 |
+
defaults: 'auto',
|
| 37 |
+
min: 0,
|
| 38 |
+
},
|
| 39 |
+
{
|
| 40 |
+
type: 'integer',
|
| 41 |
+
name: 'height',
|
| 42 |
+
units: ['px', '%'],
|
| 43 |
+
defaults: 'auto',
|
| 44 |
+
min: 0,
|
| 45 |
+
},
|
| 46 |
+
],
|
| 47 |
+
},
|
| 48 |
+
{
|
| 49 |
+
name: 'Typography',
|
| 50 |
+
properties: [
|
| 51 |
+
{
|
| 52 |
+
type: 'select',
|
| 53 |
+
name: 'font-family',
|
| 54 |
+
},
|
| 55 |
+
{
|
| 56 |
+
type: 'integer',
|
| 57 |
+
name: 'font-size',
|
| 58 |
+
units: ['px'],
|
| 59 |
+
defaults: '14px',
|
| 60 |
+
},
|
| 61 |
+
],
|
| 62 |
+
},
|
| 63 |
+
// Add more sectors and properties as needed
|
| 64 |
+
],
|
| 65 |
+
},
|
| 66 |
});
|
| 67 |
|
| 68 |
+
// Add a block for the button
|
| 69 |
+
editor.Blocks.add('button-block', {
|
| 70 |
+
label: 'Button',
|
| 71 |
+
content: `<button id="i1epvz" data-gjs-type="button" draggable="true" type="button" class="sub-btn" autocomplete="off">Submit</button>`,
|
| 72 |
+
});
|
| 73 |
|
| 74 |
+
// Define the button component type
|
| 75 |
+
editor.Components.addType('button', {
|
| 76 |
model: {
|
| 77 |
defaults: {
|
| 78 |
+
traits: [
|
| 79 |
+
{
|
| 80 |
+
type: 'integer',
|
| 81 |
+
name: 'width',
|
| 82 |
+
label: 'Width',
|
| 83 |
+
changeProp: true,
|
| 84 |
+
},
|
| 85 |
+
{
|
| 86 |
+
type: 'integer',
|
| 87 |
+
name: 'height',
|
| 88 |
+
label: 'Height',
|
| 89 |
+
changeProp: true,
|
| 90 |
+
},
|
| 91 |
+
],
|
| 92 |
+
},
|
| 93 |
+
},
|
|
|
|
|
|
|
|
|
|
| 94 |
});
|
| 95 |
</script>
|
| 96 |
</body>
|