@innovastudio/contentbuilder 1.3.14 → 1.3.16
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/README.md
CHANGED
|
@@ -828,7 +828,7 @@ Here is an example of a snippet definition in the snippet file:
|
|
|
828
828
|
'thumbnail': 'preview/basic-01.png',
|
|
829
829
|
'category': '120',
|
|
830
830
|
'html':
|
|
831
|
-
'<div class="row
|
|
831
|
+
'<div class="row">' +
|
|
832
832
|
'<div class="column full">' +
|
|
833
833
|
'<h1>My Heading Text</h1>' +
|
|
834
834
|
'</div>' +
|
|
@@ -869,7 +869,7 @@ The HTML content for the snippets needs to be formatted in a simple grid. Here a
|
|
|
869
869
|
Single column:
|
|
870
870
|
|
|
871
871
|
```html
|
|
872
|
-
<div class="row
|
|
872
|
+
<div class="row">
|
|
873
873
|
<div class="column full">
|
|
874
874
|
...
|
|
875
875
|
</div>
|
|
@@ -879,7 +879,7 @@ Single column:
|
|
|
879
879
|
Two columns:
|
|
880
880
|
|
|
881
881
|
```html
|
|
882
|
-
<div class="row
|
|
882
|
+
<div class="row">
|
|
883
883
|
<div class="column half">
|
|
884
884
|
...
|
|
885
885
|
</div>
|
|
@@ -892,7 +892,7 @@ Two columns:
|
|
|
892
892
|
Three columns:
|
|
893
893
|
|
|
894
894
|
```html
|
|
895
|
-
<div class="row
|
|
895
|
+
<div class="row">
|
|
896
896
|
<div class="column third">
|
|
897
897
|
...
|
|
898
898
|
</div>
|
|
@@ -908,7 +908,7 @@ Three columns:
|
|
|
908
908
|
Four columns:
|
|
909
909
|
|
|
910
910
|
```html
|
|
911
|
-
<div class="row
|
|
911
|
+
<div class="row">
|
|
912
912
|
<div class="fourth third">
|
|
913
913
|
...
|
|
914
914
|
</div>
|
|
@@ -927,7 +927,7 @@ Four columns:
|
|
|
927
927
|
Five columns:
|
|
928
928
|
|
|
929
929
|
```html
|
|
930
|
-
<div class="row
|
|
930
|
+
<div class="row">
|
|
931
931
|
<div class="column fifth">
|
|
932
932
|
...
|
|
933
933
|
</div>
|
|
@@ -949,7 +949,7 @@ Five columns:
|
|
|
949
949
|
Six columns:
|
|
950
950
|
|
|
951
951
|
```html
|
|
952
|
-
<div class="row
|
|
952
|
+
<div class="row">
|
|
953
953
|
<div class="column sixth">
|
|
954
954
|
...
|
|
955
955
|
</div>
|
|
@@ -985,7 +985,7 @@ const builder = new ContentBuilder({
|
|
|
985
985
|
Other layouts you can use to create your own your snippets:
|
|
986
986
|
|
|
987
987
|
```html
|
|
988
|
-
<div class="row
|
|
988
|
+
<div class="row">
|
|
989
989
|
<div class="column two-third">
|
|
990
990
|
...
|
|
991
991
|
</div>
|
|
@@ -1000,7 +1000,7 @@ Result:
|
|
|
1000
1000
|

|
|
1001
1001
|
|
|
1002
1002
|
```html
|
|
1003
|
-
<div class="row
|
|
1003
|
+
<div class="row">
|
|
1004
1004
|
<div class="column two-fourth">
|
|
1005
1005
|
...
|
|
1006
1006
|
</div>
|
|
@@ -1015,7 +1015,7 @@ Result:
|
|
|
1015
1015
|

|
|
1016
1016
|
|
|
1017
1017
|
```html
|
|
1018
|
-
<div class="row
|
|
1018
|
+
<div class="row">
|
|
1019
1019
|
<div class="column two-fifth">
|
|
1020
1020
|
...
|
|
1021
1021
|
</div>
|
|
@@ -1030,7 +1030,7 @@ Result:
|
|
|
1030
1030
|

|
|
1031
1031
|
|
|
1032
1032
|
```html
|
|
1033
|
-
<div class="row
|
|
1033
|
+
<div class="row">
|
|
1034
1034
|
<div class="column two-sixth">
|
|
1035
1035
|
...
|
|
1036
1036
|
</div>
|
|
@@ -1053,7 +1053,7 @@ You can also add some behavior in your HTML snippets:
|
|
|
1053
1053
|
|
|
1054
1054
|
- To make a column not editable, add the **data-noedit** attribute to the column, for example:
|
|
1055
1055
|
```html
|
|
1056
|
-
<div class="row
|
|
1056
|
+
<div class="row">
|
|
1057
1057
|
<div class="column full" data-noedit>
|
|
1058
1058
|
...
|
|
1059
1059
|
</div>
|
|
@@ -1062,7 +1062,7 @@ You can also add some behavior in your HTML snippets:
|
|
|
1062
1062
|
|
|
1063
1063
|
- To make a column not editable and cannot be deleted, moved or duplicated, add the **data-protected** attribute to the column, for example:
|
|
1064
1064
|
```html
|
|
1065
|
-
<div class="row
|
|
1065
|
+
<div class="row">
|
|
1066
1066
|
<div class="column full" data-protected>
|
|
1067
1067
|
...
|
|
1068
1068
|
</div>
|
|
@@ -1870,6 +1870,20 @@ builder.pasteHtmlAtCaret(html);
|
|
|
1870
1870
|
```
|
|
1871
1871
|
You will need to place the cursor on the content where you want to paste the HTML.
|
|
1872
1872
|
|
|
1873
|
+
## Insert Custom HTML Snippet Programmatically
|
|
1874
|
+
|
|
1875
|
+
To insert custom HTML snippet programmatically, you can pass your HTML snippet in the **addSnippet()** method:
|
|
1876
|
+
|
|
1877
|
+
```javascript
|
|
1878
|
+
builder.addSnippet(`
|
|
1879
|
+
<div class="row">
|
|
1880
|
+
<div class="column">
|
|
1881
|
+
<h3>Hello World!</h3>
|
|
1882
|
+
</div>
|
|
1883
|
+
</div>
|
|
1884
|
+
`);
|
|
1885
|
+
```
|
|
1886
|
+
|
|
1873
1887
|
## Element Selection
|
|
1874
1888
|
|
|
1875
1889
|
By default, when you press CMD-A or CTRL-A, you will select the current element where cursor is placed (not selecting all elements on the entire column).
|
|
@@ -2090,6 +2104,23 @@ const builder = new ContentBuilder({
|
|
|
2090
2104
|
});
|
|
2091
2105
|
```
|
|
2092
2106
|
|
|
2107
|
+
## Text Settings
|
|
2108
|
+
|
|
2109
|
+
With Text Settings on the toolbar, you can adjust font size, font weight, line spacing (line height) and letter spacing.
|
|
2110
|
+
|
|
2111
|
+

|
|
2112
|
+
|
|
2113
|
+
If the Bold button on the toolbar is sufficient for you, you can hide the font weight settings by setting the **simpleTextSettings** parameter to true.
|
|
2114
|
+
|
|
2115
|
+
```javascript
|
|
2116
|
+
const builder = new ContentBuilder({
|
|
2117
|
+
container: '.container',
|
|
2118
|
+
simpleTextSettings: true,
|
|
2119
|
+
});
|
|
2120
|
+
```
|
|
2121
|
+
|
|
2122
|
+

|
|
2123
|
+
|
|
2093
2124
|
## Undo & Redo
|
|
2094
2125
|
|
|
2095
2126
|
You can programmatically perform an undo or redo action.
|
package/package.json
CHANGED
|
@@ -73996,7 +73996,7 @@ class ContentBuilder {
|
|
|
73996
73996
|
useCssClasses: true,
|
|
73997
73997
|
useButtonPlugin: false,
|
|
73998
73998
|
enableDragResize: true,
|
|
73999
|
-
simpleTextSettings:
|
|
73999
|
+
simpleTextSettings: false
|
|
74000
74000
|
}; // obj.preserveSelection = true; (can be set programmatically) to prevent click that clears selection on external custom modal.
|
|
74001
74001
|
|
|
74002
74002
|
this.opts = Object.assign(this, defaults, opts);
|