Coder Social home page Coder Social logo

touch's Introduction

Build Status Chat CDNJS npm

If you looking to embed the Studio editor in your application, we now offer the Studio SDK, a ready-to-use visual builder that's easy to embed in external applications, with GrapesJS team support included.

GrapesJS

GrapesJS is a free and open source Web Builder Framework which helps building HTML templates, faster and easily, to be delivered in sites, newsletters or mobile apps. Mainly, GrapesJS was designed to be used inside a CMS to speed up the creation of dynamic templates. To better understand this concept check the image below


GrapesJS - Style Manager


Generally any 'template system', that you'd find in various applications like CMS, is composed by the structure (HTML), style (CSS) and variables, which are then replaced with other templates and contents on server-side and rendered on client.

This demos show examples of what is possible to achieve:
Webpage Demo - http://grapesjs.com/demo.html
Newsletter Demo - http://grapesjs.com/demo-newsletter-editor.html

Table of contents

Features

Blocks Style Manager Layer Manager
GrapesJS - Block Manager GrapesJS - Style Manager GrapesJS - Layer Manager
Code Viewer Asset Manager
GrapesJS - Code Viewer GrapesJS - Asset Manager
  • Local and remote storage

  • Default built-in commands (basically for creating and managing different components)

Download

  • CDNs
    • UNPKG (resolves to the latest version)
      • https://unpkg.com/grapesjs
      • https://unpkg.com/grapesjs/dist/css/grapes.min.css
    • CDNJS (replace X.X.X with the current version)
      • https://cdnjs.cloudflare.com/ajax/libs/grapesjs/X.X.X/grapes.min.js
      • https://cdnjs.cloudflare.com/ajax/libs/grapesjs/X.X.X/css/grapes.min.css
  • NPM
    • npm i grapesjs
  • GIT
    • git clone https://github.com/GrapesJS/grapesjs.git

For the development purpose you should follow instructions below.

Usage

<link rel="stylesheet" href="path/to/grapes.min.css" />
<script src="path/to/grapes.min.js"></script>

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

<script type="text/javascript">
  var editor = grapesjs.init({
    container: '#gjs',
    components: '<div class="txt-red">Hello world!</div>',
    style: '.txt-red{color: red}',
  });
</script>

For a more practical example I'd suggest looking up the code inside this demo: http://grapesjs.com/demo.html

Development

Clone the repository and install all the necessary dependencies (yarn is highly recommended)

$ git clone https://github.com/GrapesJS/grapesjs.git
$ cd grapesjs
$ yarn

Start the dev server

$ yarn start

Once the development server is started you should be able to reach the demo page (eg. http://localhost:8080)

Documentation

Check the getting started guide here: Documentation

API

API References could be found here: API-Reference

Testing

$ yarn test

Plugins

Official Plugins | Community Plugins

Wrappers

  • @grapesjs/react - GrapesJS wrapper for React that allows you to build custom and declarative UI for your editor.

Extensions

Presets

Find out more about plugins here: Creating plugins

Support

If you like the project and you wish to see it grow, please consider supporting us with a donation of your choice or become a backer/sponsor via Open Collective

PayPalMe Bitcoin


BrowserStack
Thanks to BrowserStack for providing us browser testing services

License

BSD 3-clause

touch's People

Contributors

artf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

touch's Issues

Text edit not working on tablets/ipad

Hi I'm facing some issue related to edit text on tablets and iPad. I have installed this package which enable the touch support on grapesjs. Everything is working except text editing. I can select the text but keyboard not showing up. I try to check the Dom element during this testing. The Dom parameter "contenteditable" is not there.

Doesn't work in iOS Safari and Chrome

I was testing the demo site (index.html) in iOS 12.1.4 with Safari and Chrome and it doesn't work. I cannot select the text on the canvas, so I cannot access the context menu with the icons.
It works in a desktop Chrome with mobile emulation.

On my iOS/Safari and iOS/Chrome, I have tried the demo of DragDropTouch.js and it works fine.

The version of GrapesJS I was testing with: 0.14.52
The version of grapesjs-touch: 0.1.1
I was also using these plugins:

grapesjs-blocks-basic 0.1.8
grapesjs-blocks-flexbox 0.1.1

But as I mentioned I have also tried the demo index.html from the grapesjs-touch source.

Issue resolving touch points for nested iframes

Hello there,

I recently started integrating grapesjs into a web application that I work on. In order to support mobile devices, I added the touch plugin.

I am noticing that when I have the editor nested in a specific location within the document, touch events are not propagated to the correct component within the iframe. This seems to stem from the getTarget function of DragDropTouch, where the iframe's absolute offset within the document is subtracted from the coordinates of the event.

My testing demonstrates that instead of calculating and using the iframe's offset within the document, its offset from the viewport should instead be used (via el.getBoundingClientRect)

Somebody had posted an issue in the main grapesjs repository with similar effects to what I am experiencing, but they closed it themselves without explaining if they found a different solution:
GrapesJS/grapesjs#1571

I do not observe these problems when using the live demo for the newsletter editor.

My question is: Is my assumption correct that the plugin should be calculating offset in terms of viewport, or have I made an error on my own part when setting up the editor?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.