├── .github ├── FUNDING.yml └── workflows │ ├── test.yml │ ├── release.yml │ ├── linter.yml │ └── codeql-analysis.yml ├── .prettierignore ├── .prettierrc.json ├── src ├── EditorJSInlineElement │ ├── index.ts │ ├── createDialog.ts │ └── EditorJSInlineElement.ts ├── index.ts ├── EditorJSInlineError.ts ├── window.ts └── EditorJSInlineTool.ts ├── .gitignore ├── tsconfig.json ├── webpack.config.js ├── LICENSE ├── package.json ├── docs └── index.html ├── README.md └── CODE_OF_CONDUCT.md /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | github: [hata6502] 2 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | DISCLAIMER.md 2 | dist 3 | -------------------------------------------------------------------------------- /.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true 3 | } 4 | -------------------------------------------------------------------------------- /src/EditorJSInlineElement/index.ts: -------------------------------------------------------------------------------- 1 | export { EditorJSInlineElement } from './EditorJSInlineElement'; 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .cache 2 | .DS_Store 3 | coverage 4 | dist 5 | node_modules 6 | super-linter.log 7 | yarn-error.log 8 | -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | export { EditorJSInlineTool } from './EditorJSInlineTool'; 2 | export type { EditorJSInlineToolConfig } from './window'; 3 | -------------------------------------------------------------------------------- /src/EditorJSInlineError.ts: -------------------------------------------------------------------------------- 1 | class EditorJSInlineError extends Error { 2 | constructor(...args: any[]) { 3 | super(...args); 4 | 5 | this.name = 'EditorJSInlineError'; 6 | } 7 | } 8 | 9 | export { EditorJSInlineError }; 10 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "allowSyntheticDefaultImports": true, 4 | "declaration": true, 5 | "lib": ["ESNext", "DOM"], 6 | "module": "ESNext", 7 | "moduleResolution": "node", 8 | "outDir": "dist", 9 | "pretty": true, 10 | "skipLibCheck": true, 11 | "sourceMap": true, 12 | "strict": true, 13 | "target": "ES2015" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /webpack.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | mode: 'production', 3 | module: { 4 | rules: [ 5 | { 6 | test: /\.tsx?$/, 7 | loader: 'ts-loader', 8 | }, 9 | ], 10 | }, 11 | resolve: { 12 | extensions: ['.js', '.jsx', '.ts', '.tsx'], 13 | }, 14 | entry: './src/index.ts', 15 | output: { 16 | filename: 'index.js', 17 | library: 'EditorJSInline', 18 | libraryTarget: 'umd', 19 | }, 20 | }; 21 | -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: Test 2 | on: 3 | push: 4 | branches: 5 | - master 6 | pull_request: 7 | branches: 8 | - master 9 | jobs: 10 | test: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - uses: actions/checkout@v2 14 | - uses: actions/setup-node@v1 15 | with: 16 | node-version: 12.x 17 | - run: yarn 18 | - run: yarn test 19 | - uses: codecov/codecov-action@v1 20 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: Release 2 | on: 3 | push: 4 | branches: 5 | - master 6 | jobs: 7 | release: 8 | runs-on: ubuntu-latest 9 | steps: 10 | - uses: actions/checkout@v2 11 | - uses: actions/setup-node@v1 12 | with: 13 | node-version: 12.x 14 | - run: yarn 15 | - run: yarn webpack 16 | - env: 17 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 18 | NPM_TOKEN: ${{ secrets.NPM_TOKEN }} 19 | run: yarn semantic-release 20 | -------------------------------------------------------------------------------- /src/window.ts: -------------------------------------------------------------------------------- 1 | import type EditorJS from '@editorjs/editorjs'; 2 | import type { EditorConfig } from '@editorjs/editorjs'; 3 | 4 | interface EditorJSInlineToolConfig { 5 | EditorJS: typeof EditorJS; 6 | editorJSConfig: Omit< 7 | EditorConfig, 8 | 'holder' | 'data' | 'minHeight' | 'readOnly' 9 | >; 10 | } 11 | 12 | interface EditorJSInlineWindow extends Window { 13 | editorJSInline: { 14 | tool: { 15 | config: EditorJSInlineToolConfig; 16 | }; 17 | }; 18 | } 19 | 20 | export type { EditorJSInlineToolConfig, EditorJSInlineWindow }; 21 | -------------------------------------------------------------------------------- /.github/workflows/linter.yml: -------------------------------------------------------------------------------- 1 | name: Lint Code Base 2 | on: 3 | push: 4 | branches: 5 | - master 6 | pull_request: 7 | branches: 8 | - master 9 | jobs: 10 | build: 11 | name: Lint Code Base 12 | runs-on: ubuntu-latest 13 | steps: 14 | - name: Checkout Code 15 | uses: actions/checkout@v2 16 | - name: Lint Code Base 17 | uses: docker://github/super-linter:v3 18 | env: 19 | DEFAULT_BRANCH: master 20 | VALIDATE_ALL_CODEBASE: false 21 | VALIDATE_JAVASCRIPT_STANDARD: false 22 | VALIDATE_TYPESCRIPT_STANDARD: false 23 | -------------------------------------------------------------------------------- /.github/workflows/codeql-analysis.yml: -------------------------------------------------------------------------------- 1 | name: CodeQL 2 | on: 3 | push: 4 | branches: [master] 5 | pull_request: 6 | branches: [master] 7 | schedule: 8 | - cron: '0 3 * * 1' 9 | jobs: 10 | analyze: 11 | runs-on: ubuntu-latest 12 | strategy: 13 | fail-fast: false 14 | matrix: 15 | language: ['javascript'] 16 | steps: 17 | - uses: actions/checkout@v2 18 | with: 19 | fetch-depth: 2 20 | - run: git checkout HEAD^2 21 | if: ${{ github.event_name == 'pull_request' }} 22 | - uses: github/codeql-action/init@v1 23 | with: 24 | languages: ${{ matrix.language }} 25 | - uses: github/codeql-action/autobuild@v1 26 | - uses: github/codeql-action/analyze@v1 27 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Tomoyuki Hata 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "editorjs-inline", 3 | "version": "0.0.0", 4 | "description": "Inline-Editor.js Tool for Editor.js", 5 | "keywords": [ 6 | "codex", 7 | "editor", 8 | "inline", 9 | "tool", 10 | "editor.js", 11 | "editorjs" 12 | ], 13 | "repository": "https://github.com/hata6502/editorjs-inline", 14 | "funding": { 15 | "type": "github", 16 | "url": "https://github.com/sponsors/hata6502" 17 | }, 18 | "license": "MIT", 19 | "author": "Tomoyuki Hata ", 20 | "main": "dist/index.js", 21 | "files": [ 22 | "dist" 23 | ], 24 | "scripts": { 25 | "check-license": "license-checker --excludePackages 'css-select@1.2.0;dictionary-en@3.0.0;domutils@1.5.1;optimist@0.6.1;tiny-segmenter@0.2.0;trim@0.0.1;union@0.5.0;unorm@1.6.0;zlibjs@0.2.0' --excludePrivatePackages --onlyAllow 'Apache-2.0;BSD;BSD-2-Clause;BSD-3-Clause;CC0-1.0;CC-BY-3.0;CC-BY-4.0;ISC;MIT;Public Domain;Unlicense;WTFPL' --production --unknown > /dev/null", 26 | "fix": "prettier --write .", 27 | "generate-disclaimer": "yarn licenses generate-disclaimer --ignore-platform > DISCLAIMER.md", 28 | "semantic-release": "semantic-release", 29 | "test": "yarn check-license && prettier --check . && tsc --noEmit", 30 | "webpack": "webpack" 31 | }, 32 | "dependencies": { 33 | "@editorjs/editorjs": "^2.19.1" 34 | }, 35 | "devDependencies": { 36 | "@types/uuid": "^8.3.0", 37 | "license-checker": "^25.0.1", 38 | "prettier": "^2.0.5", 39 | "semantic-release": "^17.4.2", 40 | "ts-loader": "^8.0.3", 41 | "typescript": "^4.0.2", 42 | "uuid": "^8.3.0", 43 | "webpack": "^4.44.1", 44 | "webpack-cli": "^3.3.12" 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/EditorJSInlineElement/createDialog.ts: -------------------------------------------------------------------------------- 1 | import type { OutputData } from '@editorjs/editorjs'; 2 | import { v4 as uuidv4 } from 'uuid'; 3 | import type { EditorJSInlineWindow } from '../window'; 4 | 5 | declare const window: EditorJSInlineWindow; 6 | 7 | const createDialog = ({ 8 | editorJSData, 9 | onClose, 10 | }: { 11 | editorJSData: OutputData; 12 | onClose?: (event: { editorJSData: OutputData }) => void; 13 | }) => { 14 | const dialog = document.createElement('dialog'); 15 | 16 | dialog.style.maxWidth = '960px'; 17 | // Make be not able to click inner 18 | dialog.style.padding = '0'; 19 | dialog.style.width = 'calc(100% - 64px)'; 20 | 21 | const editorJSHolder = document.createElement('div'); 22 | const editorJSHolderID = uuidv4(); 23 | 24 | editorJSHolder.id = editorJSHolderID; 25 | 26 | dialog.append(editorJSHolder); 27 | 28 | const config = window.editorJSInline.tool.config; 29 | 30 | const editorJS = new config.EditorJS({ 31 | ...config.editorJSConfig, 32 | holder: editorJSHolderID, 33 | data: editorJSData, 34 | }); 35 | 36 | const handleDialogClick = (event: MouseEvent) => { 37 | if (!(event.target instanceof Node) || !event.target.isEqualNode(dialog)) { 38 | return; 39 | } 40 | 41 | // @ts-expect-error 42 | dialog.close(); 43 | }; 44 | 45 | dialog.addEventListener('click', handleDialogClick); 46 | 47 | const handleDialogClose = async () => { 48 | const editorJSData = await editorJS.save(); 49 | 50 | editorJS.destroy(); 51 | 52 | dialog.removeEventListener('click', handleDialogClick); 53 | dialog.removeEventListener('close', handleDialogClose); 54 | dialog.remove(); 55 | 56 | onClose?.({ editorJSData }); 57 | }; 58 | 59 | dialog.addEventListener('close', handleDialogClose); 60 | 61 | return dialog; 62 | }; 63 | 64 | export { createDialog }; 65 | -------------------------------------------------------------------------------- /src/EditorJSInlineElement/EditorJSInlineElement.ts: -------------------------------------------------------------------------------- 1 | import type EditorJS from '@editorjs/editorjs'; 2 | import type { OutputData } from '@editorjs/editorjs'; 3 | import { v4 as uuidv4 } from 'uuid'; 4 | import { EditorJSInlineError } from '../EditorJSInlineError'; 5 | import type { EditorJSInlineWindow } from '../window'; 6 | import { createDialog } from './createDialog'; 7 | 8 | declare const window: EditorJSInlineWindow; 9 | 10 | class EditorJSInlineElement extends HTMLElement { 11 | #editorJS?: EditorJS; 12 | #editorJSHolder?: HTMLDivElement; 13 | 14 | constructor() { 15 | super(); 16 | 17 | this.contentEditable = 'false'; 18 | this.style.cursor = 'pointer'; 19 | 20 | this.addEventListener('click', this.#handleClick); 21 | } 22 | 23 | connectedCallback() { 24 | // To paste editorjs-inline correctly. 25 | this.innerHTML = ''; 26 | 27 | const editorJSHolderID = uuidv4(); 28 | 29 | this.#editorJSHolder = document.createElement('div'); 30 | this.#editorJSHolder.id = editorJSHolderID; 31 | 32 | this.append(this.#editorJSHolder); 33 | 34 | const config = window.editorJSInline.tool.config; 35 | const editorJSDataJSONString = this.dataset.editorjs; 36 | 37 | if (!editorJSDataJSONString) { 38 | throw new EditorJSInlineError(); 39 | } 40 | 41 | this.#editorJS = new config.EditorJS({ 42 | ...config.editorJSConfig, 43 | holder: editorJSHolderID, 44 | data: JSON.parse(editorJSDataJSONString), 45 | minHeight: 0, 46 | readOnly: true, 47 | }); 48 | } 49 | 50 | disconnectedCallback() { 51 | this.#editorJS?.destroy(); 52 | this.#editorJSHolder?.remove(); 53 | } 54 | 55 | #handleClick = () => { 56 | const editorJSDataJSONString = this.dataset.editorjs; 57 | 58 | if (!editorJSDataJSONString) { 59 | throw new EditorJSInlineError(); 60 | } 61 | 62 | const dialog = createDialog({ 63 | editorJSData: JSON.parse(editorJSDataJSONString), 64 | onClose: async ({ editorJSData }) => { 65 | const filteredEditorJSData: OutputData = { 66 | blocks: editorJSData.blocks, 67 | }; 68 | 69 | this.dataset.editorjs = JSON.stringify(filteredEditorJSData); 70 | 71 | await this.#editorJS?.render(filteredEditorJSData); 72 | }, 73 | }); 74 | 75 | document.body.append(dialog); 76 | // @ts-expect-error 77 | dialog.showModal(); 78 | }; 79 | } 80 | 81 | export { EditorJSInlineElement }; 82 | -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | editorjs-inline 6 | 7 | 8 | 9 |
10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /src/EditorJSInlineTool.ts: -------------------------------------------------------------------------------- 1 | import type { 2 | API, 3 | InlineTool, 4 | InlineToolConstructorOptions, 5 | OutputData, 6 | } from '@editorjs/editorjs'; 7 | import { EditorJSInlineElement } from './EditorJSInlineElement'; 8 | import type { EditorJSInlineToolConfig, EditorJSInlineWindow } from './window'; 9 | 10 | declare const window: EditorJSInlineWindow; 11 | 12 | class EditorJSInlineTool implements InlineTool { 13 | static get isInline() { 14 | return true; 15 | } 16 | 17 | static get sanitize() { 18 | return { 19 | 'editorjs-inline': (element: EditorJSInlineElement) => { 20 | const editorJSDataJSONString = element.dataset.editorjs; 21 | 22 | const editorJSData: OutputData | undefined = 23 | editorJSDataJSONString && JSON.parse(editorJSDataJSONString); 24 | 25 | return editorJSData && editorJSData.blocks.length !== 0 26 | ? { 27 | 'data-editorjs': true, 28 | } 29 | : false; 30 | }, 31 | }; 32 | } 33 | 34 | static get title() { 35 | return 'EditorJS'; 36 | } 37 | 38 | static prepare({ config }: { config: EditorJSInlineToolConfig }) { 39 | window.editorJSInline = { 40 | tool: { 41 | config, 42 | }, 43 | }; 44 | 45 | if (customElements.get('editorjs-inline')) { 46 | return; 47 | } 48 | 49 | customElements.define('editorjs-inline', EditorJSInlineElement); 50 | } 51 | 52 | #api: API; 53 | 54 | constructor({ api }: InlineToolConstructorOptions) { 55 | this.#api = api; 56 | } 57 | 58 | get shortcut() { 59 | return 'CMD+E'; 60 | } 61 | 62 | checkState() { 63 | return false; 64 | } 65 | 66 | render() { 67 | const button = document.createElement('button'); 68 | 69 | button.classList.add(this.#api.styles.inlineToolButton); 70 | button.type = 'button'; 71 | button.innerHTML = ` 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | `; 80 | 81 | /* 82 | saved: () => { 83 | if (!editorJSInline) { 84 | return; 85 | } 86 | 87 | const { outputData } = messageData as SavedMessageData; 88 | 89 | editorJSInline.dataset.output = JSON.stringify(outputData); 90 | }, 91 | */ 92 | 93 | return button; 94 | } 95 | 96 | surround(range: Range) { 97 | const editorJSInlineElement = new EditorJSInlineElement(); 98 | const text = range.extractContents().textContent ?? ''; 99 | 100 | const editorJSData: OutputData = { 101 | blocks: [ 102 | { 103 | type: 'paragraph', 104 | data: { 105 | text, 106 | }, 107 | }, 108 | ], 109 | }; 110 | 111 | editorJSInlineElement.dataset.editorjs = JSON.stringify(editorJSData); 112 | 113 | range.insertNode(editorJSInlineElement); 114 | } 115 | } 116 | 117 | export { EditorJSInlineTool }; 118 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 |

Welcome to editorjs-inline 👋

3 |

4 | 5 | Version 6 | 7 | 8 | License: MIT 9 | 10 | 11 | Twitter: hata6502 12 | 13 |

14 | 15 | > Inline-Editor.js Tool for Editor.js 16 | 17 | ## 💡 Motivation 18 | 19 | Editor.js inline tools are need to control DOM directly, 20 | so they may be able to provide only simple functions. 21 | By launching another Editor.js instance as inline element, 22 | existing block tools can be reused as inline tool. 23 | 24 | I recommend to use it with [editorjs-inline-template](https://github.com/hata6502/editorjs-inline-template) and [editorjs-style](https://github.com/hata6502/editorjs-style). 25 | 26 | Alternative solution: [editorjs-layout](https://github.com/hata6502/editorjs-layout) 27 | 28 | ### ✨ [Demo](https://hata6502.github.io/editorjs-inline/) 29 | 30 | ![demo](https://user-images.githubusercontent.com/7702653/105579110-cc284b80-5dc7-11eb-939f-d8864b129ed8.gif) 31 | 32 | ## Install 33 | 34 | ### Install via yarn 35 | 36 | ```sh 37 | yarn add editorjs-inline 38 | ``` 39 | 40 | ### Load from CDN 41 | 42 | ```html 43 | 44 | ``` 45 | 46 | ## Usage 47 | 48 | Please see [Demo HTML](https://github.com/hata6502/editorjs-inline/blob/master/docs/index.html). 49 | 50 | ## Config params 51 | 52 | Please see [EditorJSInlineToolConfig](https://github.com/hata6502/editorjs-inline/blob/master/src/window.ts). 53 | 54 | ## Output data 55 | 56 | Please see [Demo](https://hata6502.github.io/editorjs-inline/). 57 | 58 | ## Build 59 | 60 | ```sh 61 | yarn webpack 62 | ``` 63 | 64 | ## Format 65 | 66 | ```sh 67 | yarn fix 68 | ``` 69 | 70 | ## Run tests 71 | 72 | ```sh 73 | yarn test 74 | ``` 75 | 76 | ## Author 77 | 78 | hata6502 **Tomoyuki Hata ** 79 | 80 | ## 🤝 Contributing 81 | 82 | Contributions, issues and feature requests are welcome!
Feel free to check [issues page](https://github.com/hata6502/editorjs-inline/issues). 83 | 84 | ## Show your support 85 | 86 | Give a ⭐️ if this project helped you! 87 | 88 | ## 📝 License 89 | 90 | Copyright © 2020 [Tomoyuki Hata](https://github.com/hata6502).
91 | This project is [MIT](https://github.com/hata6502/editorjs-inline/blob/master/LICENSE) licensed. 92 | 93 | ## Disclaimer 94 | 95 | The following creations are included in this product: 96 | 97 | - [ionic-team/ionicons](https://github.com/ionic-team/ionicons/blob/master/LICENSE) 98 | 99 | Please see also [DISCLAIMER.md](https://github.com/hata6502/editorjs-inline/blob/master/DISCLAIMER.md). 100 | 101 | --- 102 | 103 | _This README was generated with ❤️ by [readme-md-generator](https://github.com/kefranabg/readme-md-generator)_ 104 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | We as members, contributors, and leaders pledge to make participation in our 6 | community a harassment-free experience for everyone, regardless of age, body 7 | size, visible or invisible disability, ethnicity, sex characteristics, gender 8 | identity and expression, level of experience, education, socio-economic status, 9 | nationality, personal appearance, race, religion, or sexual identity 10 | and orientation. 11 | 12 | We pledge to act and interact in ways that contribute to an open, welcoming, 13 | diverse, inclusive, and healthy community. 14 | 15 | ## Our Standards 16 | 17 | Examples of behavior that contributes to a positive environment for our 18 | community include: 19 | 20 | - Demonstrating empathy and kindness toward other people 21 | - Being respectful of differing opinions, viewpoints, and experiences 22 | - Giving and gracefully accepting constructive feedback 23 | - Accepting responsibility and apologizing to those affected by our mistakes, 24 | and learning from the experience 25 | - Focusing on what is best not just for us as individuals, but for the 26 | overall community 27 | 28 | Examples of unacceptable behavior include: 29 | 30 | - The use of sexualized language or imagery, and sexual attention or 31 | advances of any kind 32 | - Trolling, insulting or derogatory comments, and personal or political attacks 33 | - Public or private harassment 34 | - Publishing others' private information, such as a physical or email 35 | address, without their explicit permission 36 | - Other conduct which could reasonably be considered inappropriate in a 37 | professional setting 38 | 39 | ## Enforcement Responsibilities 40 | 41 | Community leaders are responsible for clarifying and enforcing our standards of 42 | acceptable behavior and will take appropriate and fair corrective action in 43 | response to any behavior that they deem inappropriate, threatening, offensive, 44 | or harmful. 45 | 46 | Community leaders have the right and responsibility to remove, edit, or reject 47 | comments, commits, code, wiki edits, issues, and other contributions that are 48 | not aligned to this Code of Conduct, and will communicate reasons for moderation 49 | decisions when appropriate. 50 | 51 | ## Scope 52 | 53 | This Code of Conduct applies within all community spaces, and also applies when 54 | an individual is officially representing the community in public spaces. 55 | Examples of representing our community include using an official e-mail address, 56 | posting via an official social media account, or acting as an appointed 57 | representative at an online or offline event. 58 | 59 | ## Enforcement 60 | 61 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 62 | reported to the community leaders responsible for enforcement at 63 | hato6502@gmail.com. 64 | All complaints will be reviewed and investigated promptly and fairly. 65 | 66 | All community leaders are obligated to respect the privacy and security of the 67 | reporter of any incident. 68 | 69 | ## Enforcement Guidelines 70 | 71 | Community leaders will follow these Community Impact Guidelines in determining 72 | the consequences for any action they deem in violation of this Code of Conduct: 73 | 74 | ### 1. Correction 75 | 76 | **Community Impact**: Use of inappropriate language or other behavior deemed 77 | unprofessional or unwelcome in the community. 78 | 79 | **Consequence**: A private, written warning from community leaders, providing 80 | clarity around the nature of the violation and an explanation of why the 81 | behavior was inappropriate. A public apology may be requested. 82 | 83 | ### 2. Warning 84 | 85 | **Community Impact**: A violation through a single incident or series 86 | of actions. 87 | 88 | **Consequence**: A warning with consequences for continued behavior. No 89 | interaction with the people involved, including unsolicited interaction with 90 | those enforcing the Code of Conduct, for a specified period of time. This 91 | includes avoiding interactions in community spaces as well as external channels 92 | like social media. Violating these terms may lead to a temporary or 93 | permanent ban. 94 | 95 | ### 3. Temporary Ban 96 | 97 | **Community Impact**: A serious violation of community standards, including 98 | sustained inappropriate behavior. 99 | 100 | **Consequence**: A temporary ban from any sort of interaction or public 101 | communication with the community for a specified period of time. No public or 102 | private interaction with the people involved, including unsolicited interaction 103 | with those enforcing the Code of Conduct, is allowed during this period. 104 | Violating these terms may lead to a permanent ban. 105 | 106 | ### 4. Permanent Ban 107 | 108 | **Community Impact**: Demonstrating a pattern of violation of community 109 | standards, including sustained inappropriate behavior, harassment of an 110 | individual, or aggression toward or disparagement of classes of individuals. 111 | 112 | **Consequence**: A permanent ban from any sort of public interaction within 113 | the community. 114 | 115 | ## Attribution 116 | 117 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], 118 | version 2.0, available at 119 | https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. 120 | 121 | Community Impact Guidelines were inspired by [Mozilla's code of conduct 122 | enforcement ladder](https://github.com/mozilla/diversity). 123 | 124 | [homepage]: https://www.contributor-covenant.org 125 | 126 | For answers to common questions about this code of conduct, see the FAQ at 127 | https://www.contributor-covenant.org/faq. Translations are available at 128 | https://www.contributor-covenant.org/translations. 129 | --------------------------------------------------------------------------------