Skip to content

Commit

Permalink
Merge pull request #20 from artf/update-deps
Browse files Browse the repository at this point in the history
Move to grapesjs-cli and refactor to TS
  • Loading branch information
artf authored Aug 9, 2022
2 parents 62f3595 + 5654f1c commit 8c7c08a
Show file tree
Hide file tree
Showing 17 changed files with 4,114 additions and 6,547 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ node_modules/
.eslintrc
*.log
_index.html
dist/
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,8 @@ This plugin adds the possibility to embed custom code

|Option|Description|Default|
|-|-|-
| `blockLabel` | Label of the custom code block | `Custom Code` |
| `blockCustomCode` | Object to extend the default custom code block, eg. `{ label: 'Custom Code', category: 'Extra', ... }`. Pass a falsy value to avoid adding the block | `{}` |
| `propsCustomCode` | Object to extend the default custom code properties, eg. `{ name: 'Custom Code', droppable: false, ... }` | `{}` |
| `placeholderContent` | Initial content of the custom code component | `<span>Insert here your custom code</span>` |
| `propsCustomCode` | Object to extend the default custom code properties, eg. `{ name: 'Custom Code', components: '<span>Initial content</span>' ... }` | `{}` |
| `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 | `{}` |
| `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) |
| `modalTitle` | Title for the modal | `Insert your code` |
Expand Down
3 changes: 0 additions & 3 deletions dist/grapesjs-custom-code.min.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/grapesjs-custom-code.min.js.map

This file was deleted.

26 changes: 12 additions & 14 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
<title>GrapesJS Plugin Custom Code</title>
<link href="https://unpkg.com/grapesjs/dist/css/grapes.min.css" rel="stylesheet">
<script src="https://unpkg.com/grapesjs"></script>
<script src="dist/grapesjs-plugin-boilerplate.min.js"></script>
<style>
body,
html {
Expand All @@ -25,20 +24,19 @@


<script type="text/javascript">
var editor = grapesjs.init({
height: '100%',
showOffsets: 1,
noticeOnUnload: 0,
storageManager: { autoload: 0 },
container: '#gjs',
fromElement: true,
setTimeout(() => {
window.editor = grapesjs.init({
height: '100%',
showOffsets: true,
allowScripts: true,
noticeOnUnload: false,
storageManager: false,
container: '#gjs',
fromElement: true,

plugins: ['grapesjs-custom-code'],
pluginsOpts: {
'grapesjs-custom-code': {}
}
});
window.editor = editor;
plugins: ['grapesjs-custom-code'],
});
})
</script>
</body>
</html>
Loading

0 comments on commit 8c7c08a

Please sign in to comment.