Skip to content

Commit 8c7c08a

Browse files
authored
Merge pull request #20 from artf/update-deps
Move to grapesjs-cli and refactor to TS
2 parents 62f3595 + 5654f1c commit 8c7c08a

17 files changed

+4114
-6547
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ node_modules/
44
.eslintrc
55
*.log
66
_index.html
7+
dist/

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,8 @@ This plugin adds the possibility to embed custom code
2424

2525
|Option|Description|Default|
2626
|-|-|-
27-
| `blockLabel` | Label of the custom code block | `Custom Code` |
2827
| `blockCustomCode` | Object to extend the default custom code block, eg. `{ label: 'Custom Code', category: 'Extra', ... }`. Pass a falsy value to avoid adding the block | `{}` |
29-
| `propsCustomCode` | Object to extend the default custom code properties, eg. `{ name: 'Custom Code', droppable: false, ... }` | `{}` |
30-
| `placeholderContent` | Initial content of the custom code component | `<span>Insert here your custom code</span>` |
28+
| `propsCustomCode` | Object to extend the default custom code properties, eg. `{ name: 'Custom Code', components: '<span>Initial content</span>' ... }` | `{}` |
3129
| `toolbarBtnCustomCode` | Object to extend the default component's toolbar button for the code, eg. `{ label: '</>', attributes: { title: 'Open custom code' } }`. Pass a falsy value to avoid adding the button | `{}` |
3230
| `placeholderScript` | Content to show when the custom code contains `<script>` | [Check the source](https://github.com/artf/grapesjs-custom-code/tree/master/src/index.js) |
3331
| `modalTitle` | Title for the modal | `Insert your code` |

dist/grapesjs-custom-code.min.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

dist/grapesjs-custom-code.min.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

index.html

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
<title>GrapesJS Plugin Custom Code</title>
66
<link href="https://unpkg.com/grapesjs/dist/css/grapes.min.css" rel="stylesheet">
77
<script src="https://unpkg.com/grapesjs"></script>
8-
<script src="dist/grapesjs-plugin-boilerplate.min.js"></script>
98
<style>
109
body,
1110
html {
@@ -25,20 +24,19 @@
2524

2625

2726
<script type="text/javascript">
28-
var editor = grapesjs.init({
29-
height: '100%',
30-
showOffsets: 1,
31-
noticeOnUnload: 0,
32-
storageManager: { autoload: 0 },
33-
container: '#gjs',
34-
fromElement: true,
27+
setTimeout(() => {
28+
window.editor = grapesjs.init({
29+
height: '100%',
30+
showOffsets: true,
31+
allowScripts: true,
32+
noticeOnUnload: false,
33+
storageManager: false,
34+
container: '#gjs',
35+
fromElement: true,
3536

36-
plugins: ['grapesjs-custom-code'],
37-
pluginsOpts: {
38-
'grapesjs-custom-code': {}
39-
}
40-
});
41-
window.editor = editor;
37+
plugins: ['grapesjs-custom-code'],
38+
});
39+
})
4240
</script>
4341
</body>
4442
</html>

0 commit comments

Comments
 (0)