# atlassian-editorkit

> Provides basic tooling an infrastructure for developing or creating new EditorKit components

Latest version **0.2.0** (published 2016-08-23) · Apache-2.0 license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install atlassian-editorkit
pnpm add atlassian-editorkit
yarn add atlassian-editorkit
bun add atlassian-editorkit
```

Provides the command `editorkit`.

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2016-08-23 |
| First published | 2016-08-09 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=6.1 |
| Dependencies | 23 |
| Known vulnerabilities | 0 (+7 in 1 direct dependencies) |
| Install scripts | no |
| Author | Atlassian Pty Ltd |
| Maintainers | bradley.ayers, mitermayer, stevemao |

## Links

- npm: https://www.npmjs.com/package/atlassian-editorkit
- Repository: https://bitbucket.org/atlassian/editorkit
- Homepage: https://bitbucket.org/atlassian/editorkit#readme
- npm.io page: https://npm.io/package/atlassian-editorkit

## Dependencies (23)

- [colors](https://npm.io/package/colors.md) ^1.1.2
- [rimraf](https://npm.io/package/rimraf.md) ^2.5.3
- [tslint](https://npm.io/package/tslint.md) ^3.14.0
- [typings](https://npm.io/package/typings.md) ^1.3.1
- [webpack](https://npm.io/package/webpack.md) ^1.13.1
- [domready](https://npm.io/package/domready.md) ^1.0.8
- [jest-cli](https://npm.io/package/jest-cli.md) ^14.1.0
- [optimist](https://npm.io/package/optimist.md) ^0.6.1
- [babel-core](https://npm.io/package/babel-core.md) ^6.10.4
- [node-watch](https://npm.io/package/node-watch.md) ^0.4.0
- [typescript](https://npm.io/package/typescript.md) ^1.8.10
- [npm-run-all](https://npm.io/package/npm-run-all.md) ^3.0.0
- [prosemirror](https://npm.io/package/prosemirror.md) ^0.9.1
- [babel-loader](https://npm.io/package/babel-loader.md) ^6.2.4
- [babel-runtime](https://npm.io/package/babel-runtime.md) ^6.9.2
- [babel-polyfill](https://npm.io/package/babel-polyfill.md) ^6.9.1
- [jasmine-reporters](https://npm.io/package/jasmine-reporters.md) ^2.2.0
- [webpack-dev-server](https://npm.io/package/webpack-dev-server.md) ^1.14.1
- [babel-preset-es2015](https://npm.io/package/babel-preset-es2015.md) ^6.9.0
- [html-webpack-plugin](https://npm.io/package/html-webpack-plugin.md) ^2.21.0
- [babel-preset-stage-0](https://npm.io/package/babel-preset-stage-0.md) ^6.5.0
- [babel-plugin-transform-runtime](https://npm.io/package/babel-plugin-transform-runtime.md) ^6.9.0
- [atlassian-prosemirror-type-definitions](https://npm.io/package/atlassian-prosemirror-type-definitions.md) *

## Recent versions

- 0.2.0 (latest) — 2016-08-23
- 0.1.44 — 2016-08-11
- 0.1.43 — 2016-08-09
- 0.1.42 — 2016-08-09

## README

# EditorKit
---

### Purpose

Providing the basic tooling and structure to create new EditorKit components.

EditorKit does this by exposing a set of tasks to aid the development.

### Usage

Install EditorKit as a dev dependency of your project:

`npm install atlassian-editorkit --save-dev`

### Available tasks

* sandbox - Starts a server on port 1988 with an editor instance and your plugin integrated to it
* build - build files using typescript
* compile - builds typescript file
* typings - install typings that are used on editorkit dependencies
* lint - lint files on the repo
* test - run tests
* dev - watch, lint, test and build files upon file change

### Using the binary

`./node_modules/.bin/editorkit --$CMD`

### Adding as a npm run task

Modify the `scripts` section of your `package.json`

example of a modified `package.json`:

```javascript
{
  ...
  scripts: {
    ...
    'sandbox': 'editorkit --sandbox',
    'build': 'editorkit --build',
    'compile': 'editorkit --compile',
    'typings': 'editorkit --typings',
    'lint': 'editorkit --lint',
    'test': 'editorkit --test',
    'dev': 'editorkit --dev'
  }
}
```

Then execute your tasks:

`npm run sandbox`


### Component Creation

EditorKit components should have their entry points defined on `src/index.js`.
And they should export a class in the following form:

example `src/index/js`:

```javascript
class MyPlugin {
  constructor(EditorKITInstance) {
    // initialize your plugin here
    ...
  }

  detach(EditorKITInstance) {
    // called to allow your plugin to do cleanups
    ...
  }
}

module.exports = MyPlugin;
```

#### Configuring prosemirror default initializer settings

Sometimes you may want to overwrite default prosemirror settings such as schema to do so you can
supply a static 'configure()' method on your Plugin, and output of it will be used as the initialization settings for prosemirror.

this will be called prior to prosemirror being initialized and the output of configure should be a configuration object to be used to instantiate prosemirror.

example:

```
class MyPlugin {
  ...
}

MyPlugin.configure = function(settings) {
  ...
  settings.foo = bar;
  return settings;
};

module.exports = MyPlugin;
```

---
_Source: https://npm.io/package/atlassian-editorkit · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
