-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat (grapejs): new grapejs framework test
- Loading branch information
Showing
5 changed files
with
220 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"dependencies": { | ||
"grapesjs": "^0.21.11" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/* Let's highlight canvas boundaries */ | ||
#gjs { | ||
border: 3px solid #444; | ||
} | ||
|
||
/* Reset some default styling */ | ||
.gjs-cv-canvas { | ||
top: 0; | ||
width: 100%; | ||
height: 100%; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { grapesjs } from '../../node_modules/grapesjs/dist/grapes.mjs' | ||
// If you need plugins, put them below the main grapesjs script | ||
// import 'grapesjs-some-plugin'; | ||
|
||
const editor = grapesjs.init({ | ||
// Indicate where to init the editor. You can also pass an HTMLElement | ||
container: '#gjs', | ||
// Get the content for the canvas directly from the element | ||
// As an alternative we could use: `components: '<h1>Hello World Component!</h1>'`, | ||
fromElement: true, | ||
// Size of the editor | ||
height: '300px', | ||
width: 'auto', | ||
// Disable the storage manager for the moment | ||
storageManager: false, | ||
// Avoid any default panel | ||
panels: { defaults: [] }, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<title>Hello World Component!</title> | ||
|
||
<link rel="stylesheet" href="../../node_modules/grapesjs/dist/css/grapes.min.css"> | ||
<link rel="stylesheet" href="basic.css"> | ||
<script src="basic.js" type="module"></script> | ||
</head> | ||
<body> | ||
<div id="gjs"> | ||
<h1>Hello World Component!</h1> | ||
</div> | ||
</body> | ||
</html> |