Skip to content

Commit

Permalink
Feature/renaming (#12)
Browse files Browse the repository at this point in the history
* Rename all occurences

* 2.2.0

* Update packages

* Rename repo

* Create .npmignore

* Update README.md
  • Loading branch information
gohabereg committed Mar 2, 2019
1 parent 1f51ce7 commit 7f2e714
Show file tree
Hide file tree
Showing 7 changed files with 1,122 additions and 870 deletions.
4 changes: 4 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.idea/
src/
webpack.config.js
yarn.lock
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
![](https://badgen.net/badge/CodeX%20Editor/v2.0/blue)
![](https://badgen.net/badge/Editor.js/v2.0/blue)

# Quote Tool

Provides Quote Blocks for the [CodeX Editor](https://ifmo.su/editor).
Provides Quote Blocks for the [Editor.js](https://editorjs.io).

![](https://capella.pics/017dca46-6869-40cb-93a0-994416576e33.jpg)

Expand All @@ -13,13 +13,13 @@ Provides Quote Blocks for the [CodeX Editor](https://ifmo.su/editor).
Get the package

```shell
npm i --save-dev codex.editor.quote
npm i --save-dev @editorjs/quote
```

Include module at your application

```javascript
const Quote = require('codex.editor.quote');
const Quote = require('@editorjs/quote');
```

### Download to your project's source dir
Expand All @@ -29,22 +29,22 @@ const Quote = require('codex.editor.quote');

### Load from CDN

You can load specific version of package from [jsDelivr CDN](https://www.jsdelivr.com/package/npm/codex.editor.quote).
You can load specific version of package from [jsDelivr CDN](https://www.jsdelivr.com/package/npm/@editorjs/quote).

`https://cdn.jsdelivr.net/npm/codex.editor.quote@2.0.0`
`https://cdn.jsdelivr.net/npm/@editorjs/quote@2.0.0`

Then require this script on page with CodeX Editor.
Then require this script on page with Editor.js.

```html
<script src="..."></script>
```

## Usage

Add a new Tool to the `tools` property of the CodeX Editor initial config.
Add a new Tool to the `tools` property of the Editor.js initial config.

```javascript
var editor = CodexEditor({
var editor = EditorJS({
...

tools: {
Expand All @@ -59,7 +59,7 @@ var editor = CodexEditor({
Or init Quote Tool with additional settings

```javascript
var editor = CodexEditor({
var editor = EditorJS({
...

tools: {
Expand Down
2 changes: 1 addition & 1 deletion dist/bundle.js

Large diffs are not rendered by default.

30 changes: 14 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,34 +1,32 @@
{
"name": "codex.editor.quote",
"version": "2.1.5",
"name": "@editorjs/quote",
"version": "2.2.0",
"keywords": [
"codex editor",
"tool",
"quote"
"quote",
"editor.js",
"editorjs"
],
"description": "Quote Tool for CodeX.Editor",
"description": "Quote Tool for Editor.js",
"license": "MIT",
"repository": "https://github.com/codex-editor/quote",
"repository": "https://github.com/editor-js/quote",
"main": "./dist/bundle.js",
"scripts": {
"build": "webpack --config ./webpack.config.js --mode production --watch"
"build": "webpack --mode production",
"build:dev": "webpack --mode development --watch"
},
"author": {
"name": "CodeX Team",
"email": "team@ifmo.su"
},
"devDependencies": {
"babel-core": "^6.26.3",
"babel-loader": "^7.1.5",
"babel-preset-env": "^1.7.0",
"@babel/core": "^7.3.4",
"@babel/preset-env": "^7.3.4",
"babel-loader": "^8.0.5",
"css-loader": "^1.0.0",
"style-loader": "^0.21.0",
"webpack": "^4.16.3",
"webpack-cli": "^3.1.0"
},
"babel": {
"presets": [
"env"
]
"webpack": "^4.29.5",
"webpack-cli": "^3.2.3"
}
}
6 changes: 3 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ require('./index.css').toString();

/**
* @class Quote
* @classdesc Quote Tool for Codex Editor
* @classdesc Quote Tool for Editor.js
* @property {QuoteData} data - Tool`s input and output data
* @propert {object} api - Codex Editor API instance
* @propert {object} api - Editor.js API instance
*
* @typedef {object} QuoteData
* @description Quote Tool`s input and output data
Expand Down Expand Up @@ -139,7 +139,7 @@ class Quote {
* @param {{data: QuoteData, config: QuoteConfig, api: object}}
* data — previously saved data
* config - user config for Tool
* api - CodeX Editor API
* api - Editor.js API
*/
constructor({data, config, api}) {
const {ALIGNMENTS, DEFAULT_ALIGNMENT} = Quote;
Expand Down
15 changes: 11 additions & 4 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,20 @@ module.exports = {
{
test: /\.js$/,
exclude: /node_modules/,
use: ['babel-loader']
use: [
{
loader: 'babel-loader',
query: {
presets: [ '@babel/preset-env' ],
},
},
]
},
{
test: /\.css$/,
use: [
"style-loader",
"css-loader"
'style-loader',
'css-loader'
]
}
]
Expand All @@ -20,7 +27,7 @@ module.exports = {
path: __dirname + '/dist',
publicPath: '/',
filename: 'bundle.js',
library: "Quote",
library: 'Quote',
libraryTarget: 'umd'
}
};
Loading

0 comments on commit 7f2e714

Please sign in to comment.