Home
Softono
a

appleple

Professional software vendor delivering innovative solutions on the Softono platform. Specialized in both open-source and proprietary software development.

Total Products
3

Software by appleple

smartblock
Open Source

smartblock

# SmartBlock ![](https://github.com/appleple/smartblock/workflows/Node%20CI/badge.svg) [![npm version](https://badge.fury.io/js/smartblock.svg)](https://badge.fury.io/js/smartblock) [![npm download](http://img.shields.io/npm/dm/smartblock.svg)](https://www.npmjs.com/package/smartblock) [![GitHub license](https://img.shields.io/badge/license-MIT-brightgreen.svg)](https://raw.githubusercontent.com/appleple/smartblock/master/LICENSE) [![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=Awesome%20block-based%20JavaScript%20%Editor&url=https://github.com/appleple/smartblock&via=appleplecom&hashtags=blocks,smartblock) SmartBlock.js is a JavaScript block based editor which enables you to write contents easily on websites even with **SmartPhone**. | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt="IE / Edge" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>IE11 / Edge | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Firefox | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png" alt="Chrome" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Chrome | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png" alt="Safari" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Safari | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari-ios/safari-ios_48x48.png" alt="iOS Safari" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>iOS Safari | | --------- | --------- | --------- | --------- | --------- | ## ScreenShot <img src="./screenshots/paragraph.png" /> ## Features * Easy to use with SmartPhone * Fully customizable * Block based * Keep clean HTML and wipe out unnecessary tags * Get the result as **HTML** or **JSON** * copy and paste contents ## Install ```sh $ npm install smartblock --save ``` ## Usage ```js import * as React from 'react'; import { render } from 'react-dom'; import 'smartblock/css/smartblock.css'; import { SmartBlock, Extensions } from 'smartblock'; render(<> <SmartBlock extensions={Extensions} html={'<h2>Hello World</h2><p>hello</p>'} onChange={({ json, html }) => { console.log(json, html);}} /> </>, document.getElementById("app")); ``` ## Try it on CodeSandbox [![Edit hardcore-kalam-tghp9](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/hardcore-kalam-tghp9?fontsize=14&hidenavigation=1&theme=dark) ## Customize You can add custom block like this ```js import * as React from 'react'; import { Extensions, CustomBlock, CustomMark } from 'smartblock'; Extensions.push(new CustomBlock({ tagName: 'div', className: '.alert', icon: <SomeIconComponent /> }); render(<> <SmartBlock extensions={Extensions} html={'<h2>Hello World</h2><p>hello</p>'} onChange={({ json, html }) => { console.log(json, html);}} /> </>, document.getElementById("app")); ``` You can add custom inline element like this ```js import * as React from 'react'; import { Extension, CustomBlock, CustomMark } from 'smartblock'; import 'smartblock/css/smartblock.css'; Extension.push(new CustomMark({ tagName: 'span', className: '.small', icon: <SomeIconComponent /> }); render(<> <SmartBlock extensions={Extensions} html={'<h2>Hello World</h2><p><small>hello</small></p>'} onChange={({ json, html }) => { console.log(json, html);}} /> </>, document.getElementById("app")); ``` ## Options | Props | description | type | default | | ------------ | ----------------------------------------------------------------------------------------------------------- | ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | extensions | Array of extensions which extend the feature of SmartBlock | Extension[] | array of extensions | | onChange | Callback function which is called when the content of the editor is changed. You can get both html and json | Function | | | onInit | Callback function which is called when the editor is initialized | Function | | | json | The editor contents will be initialized with the json data | Object | {} | | HTML | The editor contents will be initialized with the HTML | String | '' | | showTitle | Title will be shown | Boolean | false | | showBackBtn | Btn to support history back will be shown | Boolean | false | | autoSave | The HTML will be stored to the localstorage every time the content is changed | Boolean | false | | getEditorRef | Get the editor ref object | Function | | ## Download [Download ZIP](https://github.com/appleple/smartblock/archive/master.zip) ## Github [https://github.com/appleple/smartblock](https://github.com/appleple/smartblock) ## Contributor [@steelydylan](https://github.com/steelydylan) ## License Code and documentation copyright 2020 by appleple, Inc. Code released under the [MIT License](https://github.com/appleple/smartblock/blob/master/LICENSE).

Web Components & Widgets Code Editors & IDEs
318 Github Stars
react-modal-video
Open Source

react-modal-video

# react-modal-video React Modal Video Component ## Features - Not affected by dom structure. - Beautiful transition - Accessible for keyboard navigation and screen readers. - Rich options for youtube API and Vimeo API ## Demo [https://unpkg.com/react-modal-video@latest/test/index.html](https://unpkg.com/react-modal-video@latest/test/index.html) ## Install ### npm ```sh npm install react-modal-video ``` ## Usage import sass file to your project ```scss @import 'node_modules/react-modal-video/scss/modal-video.scss'; ``` ### Functional Implementation with Hooks ```jsx import React, { useState } from 'react'; import ReactDOM from 'react-dom'; import ModalVideo from 'react-modal-video'; const App = () => { const [isOpen, setOpen] = useState(false); return ( <React.Fragment> <ModalVideo channel="youtube" youtube={{ mute: 0, autoplay: 0 }} isOpen={isOpen} videoId="L61p2uyiMSo" onClose={() => setOpen(false)} /> <button className="btn-primary" onClick={() => setOpen(true)}> VIEW DEMO </button> </React.Fragment> ); }; ReactDOM.render(<App />, document.getElementById('root')); ``` ### Class Implementation change "isOpen" property to open and close the modal-video ```jsx import React from 'react'; import ReactDOM from 'react-dom'; import ModalVideo from 'react-modal-video'; class App extends React.Component { constructor() { super(); this.state = { isOpen: false, }; this.openModal = this.openModal.bind(this); } openModal() { this.setState({ isOpen: true }); } render() { return ( <React.Fragment> <ModalVideo channel="youtube" isOpen={this.state.isOpen} videoId="L61p2uyiMSo" onClose={() => this.setState({ isOpen: false })} /> <button onClick={this.openModal}>Open</button> </React.Fragment> ); } } ReactDOM.render(<App />, document.getElementById('root')); ``` ## Options - About YouTube options, please refer to https://developers.google.com/youtube/player_parameters?hl=en - About Vimeo options, please refer to https://developer.vimeo.com/apis/oembed <table style="min-width:100%;"> <tbody><tr> <th colspan="2">properties</th> <th>default</th> </tr> <tr> <td colspan="2">channel</td> <td>'youtube'</td> </tr> <tr> <td rowspan="23">youtube</td> <td>autoplay</td> <td>1</td> </tr> <tr> <td>cc_load_policy</td> <td>1</td> </tr> <tr> <td>color</td> <td>null</td> </tr> <tr> <td>controls</td> <td>1</td> </tr> <tr> <td>disablekb</td> <td>0</td> </tr> <tr> <td>enablejsapi</td> <td>0</td> </tr> <tr> <td>end</td> <td>null</td> </tr> <tr> <td>fs</td> <td>1</td> </tr> <tr> <td>h1</td> <td>null</td> </tr> <tr> <td>iv_load_policy</td> <td>1</td> </tr> <tr> <td>list</td> <td>null</td> </tr> <tr> <td>listType</td> <td>null</td> </tr> <tr> <td>loop</td> <td>0</td> </tr> <tr> <td>modestbranding</td> <td>null</td> </tr> <tr> <td>origin</td> <td>null</td> </tr> <tr> <td>playlist</td> <td>null</td> </tr> <tr> <td>playsinline</td> <td>null</td> </tr> <tr> <td>rel</td> <td>0</td> </tr> <tr> <td>showinfo</td> <td>1</td> </tr> <tr> <td>start</td> <td>0</td> </tr> <tr> <td>wmode</td> <td>'transparent'</td> </tr> <tr> <td>theme</td> <td>'dark'</td> </tr> <tr> <td>mute</td> <td>0</td> </tr> <tr> <td rowspan="15">vimeo</td> <td>api</td> <td>false</td> </tr> <tr> <td>autopause</td> <td>true</td> </tr> <tr> <td>autoplay</td> <td>true</td> </tr> <tr> <td>byline</td> <td>true</td> </tr> <tr> <td>callback</td> <td>null</td> </tr> <tr> <td>color</td> <td>null</td> </tr> <tr> <td>height</td> <td>null</td> </tr> <tr> <td>loop</td> <td>false</td> </tr> <tr> <td>maxheight</td> <td>null</td> </tr> <tr> <td>maxwidth</td> <td>null</td> </tr> <tr> <td>player_id</td> <td>null</td> </tr> <tr> <td>portrait</td> <td>true</td> </tr> <tr> <td>title</td> <td>true</td> </tr> <tr> <td>width</td> <td>null</td> </tr> <tr> <td>xhtml</td> <td>false</td> </tr> <tr> <td rowspan="2">youku</td> <td>autoplay</td> <td>1</td> </tr> <tr> <td>show_related</td> <td>0</td> </tr> <tr> <td rowspan="1">custom</td> <td>url</td> <td>MP4 URL / iframe URL</td> </tr> <tr> <td colspan="2">ratio</td> <td>'16:9'</td> </tr> <tr> <td colspan="2">allowFullScreen</td> <td>true</td> </tr> <tr> <td colspan="2">animationSpeed</td> <td>300</td> </tr> <tr> <td rowspan="6">classNames</td> <td>modalVideo</td> <td>'modal-video'</td> </tr> <tr> <td>modalVideoClose</td> <td>'modal-video-close'</td> </tr> <tr> <td>modalVideoBody</td> <td>'modal-video-body'</td> </tr> <tr> <td>modalVideoInner</td> <td>'modal-video-inner'</td> </tr> <tr> <td>modalVideoIframeWrap</td> <td>'modal-video-movie-wrap'</td> </tr> <tr> <td>modalVideoCloseBtn</td> <td>'modal-video-close-btn'</td> </tr> <tr> <td rowspan="2">aria</td> <td>openMessage</td> <td>'You just opened the modal video'</td> </tr> <tr> <td>dismissBtnMessage</td> <td>'Close the modal by clicking here'</td> </tr> </tbody></table> ## FAQ ### How to track YouTube videos playing in modal-video by GA4?</h3> 1. Enable JS API. Turn `enablejsapi` property to `1`. 2. Load YouTube Iframe API. Add `<script src="https://www.youtube.com/iframe_api"></script>` in HTML file. ## Licence [MIT](https://github.com/appleple/modal-video.js/blob/master/LICENSE)

JavaScript Libraries & Components
183 Github Stars
lite-editor
Open Source

lite-editor

# LiteEditor [![npm version](https://badge.fury.io/js/lite-editor.svg)](https://badge.fury.io/js/lite-editor) [![CircleCI](https://circleci.com/gh/appleple/lite-editor/tree/master.svg?style=shield)](https://circleci.com/gh/appleple/lite-editor/tree/master) [![npm download](http://img.shields.io/npm/dm/lite-editor.svg)](https://www.npmjs.com/package/lite-editor) [![GitHub license](https://img.shields.io/badge/license-MIT-brightgreen.svg)](https://raw.githubusercontent.com/appleple/lite-editor/master/LICENSE) A Modern WYSIWYG Editor especially for inline elements ## Feature - focuses on inline elements such as b, a, i, strong - Prevent unnecessary tags insertion - Control how to make newlines - You can register custom button easily ## Installation - [npm](https://www.npmjs.com/package/lite-editor) - [standalone](https://unpkg.com/[email protected]/js/lite-editor.es.js) via npm ```shell npm install lite-editor --save ``` or yarn ```shell yarn add lite-editor ``` ## Usage require ```js import LiteEditor from 'lite-editor'; ``` ```js window.addEventListener('DOMContentLoaded',function(){ new LiteEditor('.js-editor'); }); ``` ## Document [https://appleple.github.io/lite-editor/about.html](https://appleple.github.io/lite-editor/about.html) ## Download [Download ZIP](https://github.com/appleple/lite-editor/archive/master.zip) ## Plugins - [lite-editor-emoji-picker-plugin](https://github.com/appleple/lite-editor-emoji-picker-plugin) ## Github [https://github.com/appleple/lite-editor](https://github.com/appleple/lite-editor) ## Contributor [@steelydylan](https://github.com/steelydylan) ## License Code and documentation copyright 2017 by appleple, Inc. Code released under the [MIT License](https://github.com/appleple/lite-editor/blob/master/LICENSE).

JavaScript Libraries & Components Documentation
177 Github Stars