Skip to content
This repository has been archived by the owner on Mar 2, 2022. It is now read-only.

Ju99ernaut/grapesjs-rally-widgets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Grapesjs Rally Widgets

(WIP) Library of components that rely on the rally.io API

DEMO

HTML

<link href="https://unpkg.com/grapesjs/dist/css/grapes.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://unpkg.com/grapesjs-rally-widgets/dist/grapesjs-rally-widgets.min.css">
<script src="https://unpkg.com/grapesjs"></script>
<script src="https://unpkg.com/grapesjs-rally-widgets"></script>

<div id="gjs"></div>

JS

const editor = grapesjs.init({
	container: '#gjs',
  height: '100%',
  fromElement: true,
  storageManager: false,
  plugins: ['grapesjs-rally-widgets'],
});

CSS

body, html {
  margin: 0;
  height: 100%;
}

Summary

  • Plugin name: grapesjs-rally-widgets
  • Components
    • widget
    • price-ticker
    • rally-deeplink
  • Blocks
    • price-ticker
    • rally-deeplink
  • Commands
    • widget-code

Options

Option Description Default
modalCopyTitle Modal title Widget
copyViewerOptions Options for extending the codeviewer {}
widgetComponent Options for extending the widget model {}
rallyUrl Url for rally api https://api.rally.io/v1/

Download

  • CDN
    • https://unpkg.com/grapesjs-rally-widgets
  • NPM
    • npm i grapesjs-rally-widgets
  • GIT
    • git clone https://github.com/Ju99ernaut/grapesjs-rally-widgets.git

Usage

Directly in the browser

<link href="https://unpkg.com/grapesjs/dist/css/grapes.min.css" rel="stylesheet"/>
<link rel="stylesheet" href="https://unpkg.com/grapesjs-rally-widgets/dist/grapesjs-rally-widgets.min.css">
<script src="https://unpkg.com/grapesjs"></script>
<script src="path/to/grapesjs-rally-widgets.min.js"></script>

<div id="gjs"></div>

<script type="text/javascript">
  var editor = grapesjs.init({
      container: '#gjs',
      // ...
      plugins: ['grapesjs-rally-widgets'],
      pluginsOpts: {
        'grapesjs-rally-widgets': { /* options */ }
      }
  });
</script>

Modern javascript

import grapesjs from 'grapesjs';
import plugin from 'grapesjs-rally-widgets';
import 'grapesjs/dist/css/grapes.min.css';
import 'grapesjs-rally-widgets/dist/grapesjs-rally-widgets.min.css'

const editor = grapesjs.init({
  container : '#gjs',
  // ...
  plugins: [plugin],
  pluginsOpts: {
    [plugin]: { /* options */ }
  }
  // or
  plugins: [
    editor => plugin(editor, { /* options */ }),
  ],
});

Development

Clone the repository

$ git clone https://github.com/Ju99ernaut/grapesjs-rally-widgets.git
$ cd grapesjs-rally-widgets

Install dependencies

$ npm i

Build sass

$ npm run build:css

Start the dev server

$ npm start

Build the source

$ npm run build

License

MIT

About

rally.io widgets

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published