├── .gitignore ├── example-react ├── .gitignore ├── src │ ├── index.html │ └── js │ │ ├── client.js │ │ └── constants.js ├── webpack.config.js └── package.json ├── example ├── assets │ ├── codex2x.png │ ├── json-preview.js │ └── demo.css ├── example.html ├── example-vue.html ├── dist │ └── anchor.js └── example-dev.html ├── src ├── index.css ├── util.js └── index.js ├── readme-dev.md ├── .gitmodules ├── webpack.config.js ├── package.json ├── readme.md ├── dist ├── bundle.js └── main.js └── yarn.lock /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/* 2 | npm-debug.log 3 | /.idea/ 4 | .DS_Store -------------------------------------------------------------------------------- /example-react/.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/* 2 | npm-debug.log 3 | /.idea/ 4 | .DS_Store -------------------------------------------------------------------------------- /example/assets/codex2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kaaaaaaaaaaai/editorjs-alignment-blocktune/master/example/assets/codex2x.png -------------------------------------------------------------------------------- /src/index.css: -------------------------------------------------------------------------------- 1 | .ce-tune-alignment--right { 2 | text-align: right; 3 | } 4 | .ce-tune-alignment--center { 5 | text-align: center; 6 | } 7 | .ce-tune-alignment--left { 8 | text-align: left; 9 | } -------------------------------------------------------------------------------- /example-react/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /readme-dev.md: -------------------------------------------------------------------------------- 1 | yarn init 2 | 3 | yarn add -D @babel/core babel-loader webpack @babel/preset-env style-loader css-loader raw-loader webpack-cli 4 | 5 | それぞれのmoduleを追加(手動じゃだめっぽい) 6 | 7 | git submodule add https://github.com/editor-js/paragraph example/tools/paragraph 8 | 9 | webで読みこめば良い 10 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "example/tools/paragraph"] 2 | path = example/tools/paragraph 3 | url = https://github.com/editor-js/paragraph 4 | [submodule "example/tools/header"] 5 | path = example/tools/header 6 | url = https://github.com/editor-js/header 7 | [submodule "example/tools/delimiter"] 8 | path = example/tools/delimiter 9 | url = https://github.com/editor-js/delimiter 10 | -------------------------------------------------------------------------------- /src/util.js: -------------------------------------------------------------------------------- 1 | /** 2 | * node 作成用 3 | * @param tagName 4 | * @param classNames 5 | * @param attributes 6 | * @returns {*} 7 | */ 8 | export function make(tagName, classNames = null, attributes = {}) { 9 | const el = document.createElement(tagName); 10 | 11 | if (Array.isArray(classNames)) { 12 | el.classList.add(...classNames); 13 | } else if (classNames) { 14 | el.classList.add(classNames); 15 | } 16 | 17 | for (const attrName in attributes) { 18 | el[attrName] = attributes[attrName]; 19 | } 20 | return el; 21 | } -------------------------------------------------------------------------------- /example-react/webpack.config.js: -------------------------------------------------------------------------------- 1 | var debug = process.env.NODE_ENV !== "production"; 2 | var webpack = require('webpack'); 3 | var path = require('path'); 4 | 5 | module.exports = { 6 | context: path.join(__dirname, "src"), 7 | entry: "./js/client.js", 8 | module: { 9 | rules: [{ 10 | test: /\.jsx?$/, 11 | exclude: /(node_modules|bower_components)/, 12 | use: [{ 13 | loader: 'babel-loader', 14 | options: { 15 | presets: ['@babel/preset-react', '@babel/preset-env'] 16 | } 17 | }] 18 | }] 19 | }, 20 | output: { 21 | path: __dirname + "/src/", 22 | filename: "client.min.js" 23 | }, 24 | plugins: debug ? [] : [ 25 | new webpack.optimize.OccurrenceOrderPlugin(), 26 | new webpack.optimize.UglifyJsPlugin({ mangle: false, sourcemap: false }), 27 | ] 28 | }; -------------------------------------------------------------------------------- /example-react/src/js/client.js: -------------------------------------------------------------------------------- 1 | import ReactDOM from "react-dom"; 2 | import React, { Component } from "react"; 3 | 4 | import EditorJs from "react-editor-js"; 5 | 6 | import { EDITOR_JS_TOOLS } from "./constants"; 7 | 8 | class ReactEditor extends Component { 9 | render() { 10 | return ( 11 |yarn pull_tools
33 | yarn pull_tools
33 |