Skip to content

Commit

Permalink
feat (grapejs): new grapejs framework test
Browse files Browse the repository at this point in the history
  • Loading branch information
santanche committed Aug 4, 2024
1 parent 7dc6320 commit 800d5bf
Show file tree
Hide file tree
Showing 5 changed files with 220 additions and 0 deletions.
171 changes: 171 additions & 0 deletions frameworks/grapesjs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions frameworks/grapesjs/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"dependencies": {
"grapesjs": "^0.21.11"
}
}
11 changes: 11 additions & 0 deletions frameworks/grapesjs/tests/test01/basic.css
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%;
}
18 changes: 18 additions & 0 deletions frameworks/grapesjs/tests/test01/basic.js
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: [] },
});
15 changes: 15 additions & 0 deletions frameworks/grapesjs/tests/test01/index.html
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>

0 comments on commit 800d5bf

Please sign in to comment.