├── examples
├── create-react-app
│ ├── .env.example
│ ├── public
│ │ ├── robots.txt
│ │ ├── favicon.ico
│ │ ├── logo192.png
│ │ ├── logo512.png
│ │ ├── manifest.json
│ │ └── index.html
│ ├── src
│ │ ├── setupTests.js
│ │ ├── index.js
│ │ ├── App.test.js
│ │ ├── index.css
│ │ ├── App.css
│ │ ├── App.js
│ │ └── logo.svg
│ ├── .gitignore
│ ├── package.json
│ └── README.md
└── fetch-from-url
│ ├── .env.example
│ ├── src
│ ├── Fetch.css
│ ├── index.js
│ ├── index.css
│ └── Fetch.js
│ ├── .gitignore
│ ├── public
│ ├── manifest.json
│ ├── index.html
│ └── data.json
│ ├── package.json
│ └── README.md
├── tslint.json
├── .prettierrc
├── .npmignore
├── jest.config.js
├── src
├── renderers
│ ├── delimiter
│ │ ├── __snapshots__
│ │ │ └── index.test.tsx.snap
│ │ ├── index.tsx
│ │ └── index.test.tsx
│ ├── raw
│ │ ├── index.tsx
│ │ ├── __snapshots__
│ │ │ └── index.test.tsx.snap
│ │ └── index.test.tsx
│ ├── header
│ │ ├── __snapshots__
│ │ │ └── index.test.tsx.snap
│ │ ├── index.tsx
│ │ └── index.test.tsx
│ ├── paragraph
│ │ ├── __snapshots__
│ │ │ └── index.test.tsx.snap
│ │ ├── index.tsx
│ │ └── index.test.tsx
│ ├── code
│ │ ├── index.tsx
│ │ ├── __snapshots__
│ │ │ └── index.test.tsx.snap
│ │ └── index.test.tsx
│ ├── embed
│ │ ├── __snapshots__
│ │ │ └── index.test.tsx.snap
│ │ ├── index.test.tsx
│ │ └── index.tsx
│ ├── quote
│ │ ├── index.test.tsx
│ │ ├── __snapshots__
│ │ │ └── index.test.tsx.snap
│ │ └── index.tsx
│ ├── list
│ │ ├── index.tsx
│ │ ├── index.test.tsx
│ │ └── __snapshots__
│ │ │ └── index.test.tsx.snap
│ ├── image
│ │ ├── __snapshots__
│ │ │ └── index.test.tsx.snap
│ │ ├── index.tsx
│ │ └── index.test.tsx
│ └── table
│ │ ├── index.tsx
│ │ ├── index.test.tsx
│ │ └── __snapshots__
│ │ └── index.test.tsx.snap
├── index.tsx
├── __snapshots__
│ └── index.test.tsx.snap
└── index.test.tsx
├── .github
├── ISSUE_TEMPLATE.md
├── workflows
│ ├── continuous-integration.yml
│ └── codeql-analysis.yml
└── CONTRIBUTING.md
├── docs
└── PUBLISH.md
├── LICENSE
├── package.json
├── .gitignore
├── README.md
└── tsconfig.json
/examples/create-react-app/.env.example:
--------------------------------------------------------------------------------
1 | SKIP_PREFLIGHT_CHECK=true
--------------------------------------------------------------------------------
/examples/fetch-from-url/.env.example:
--------------------------------------------------------------------------------
1 | SKIP_PREFLIGHT_CHECK=true
--------------------------------------------------------------------------------
/tslint.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": ["tslint:recommended", "tslint-config-prettier"]
3 | }
4 |
--------------------------------------------------------------------------------
/examples/fetch-from-url/src/Fetch.css:
--------------------------------------------------------------------------------
1 | .Fetch {
2 | margin: 0 auto;
3 | max-width: 960px;
4 | }
--------------------------------------------------------------------------------
/.prettierrc:
--------------------------------------------------------------------------------
1 | {
2 | "printWidth": 120,
3 | "trailingComma": "all",
4 | "singleQuote": true
5 | }
6 |
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
1 | src
2 | examples
3 | jest.config.js
4 | tsconfig.json
5 | tslint.json
6 | .prettierrc
7 | .gitignore
8 | .github
--------------------------------------------------------------------------------
/examples/create-react-app/public/robots.txt:
--------------------------------------------------------------------------------
1 | # https://www.robotstxt.org/robotstxt.html
2 | User-agent: *
3 | Disallow:
4 |
--------------------------------------------------------------------------------
/jest.config.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | preset: 'ts-jest',
3 | testEnvironment: 'node',
4 | testPathIgnorePatterns : [
5 | "examples/*"
6 | ]
7 | };
--------------------------------------------------------------------------------
/examples/create-react-app/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moveyourdigital/editorjs-blocks-react-renderer/HEAD/examples/create-react-app/public/favicon.ico
--------------------------------------------------------------------------------
/examples/create-react-app/public/logo192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moveyourdigital/editorjs-blocks-react-renderer/HEAD/examples/create-react-app/public/logo192.png
--------------------------------------------------------------------------------
/examples/create-react-app/public/logo512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moveyourdigital/editorjs-blocks-react-renderer/HEAD/examples/create-react-app/public/logo512.png
--------------------------------------------------------------------------------
/src/renderers/delimiter/__snapshots__/index.test.tsx.snap:
--------------------------------------------------------------------------------
1 | // Jest Snapshot v1, https://goo.gl/fbAQLP
2 |
3 | exports[`
tag 1`] = ` 4 |
5 | Hey. Meet the new 6 | 7 | Editor 8 | 9 | . On this page you can see it in action — try to edit this text. Source code of the page contains the example of connection and configuration. 10 |
11 | `; 12 | -------------------------------------------------------------------------------- /docs/PUBLISH.md: -------------------------------------------------------------------------------- 1 | # How to publish a new version? 2 | 3 | 1. Run tests (if there are any) 4 | 2. Update `version` in `package.json` according to Semver 5 | 3. Create a git tag according to Semver 6 | 4. Push the package to Github 7 | 5. Push the package to npm `npm publish` 8 | 6. Create release notes for every update 9 | 10 | Source: [How to publish packages to npm (the way the industry does things)](https://zellwk.com/blog/publish-to-npm/) -------------------------------------------------------------------------------- /examples/create-react-app/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /examples/fetch-from-url/.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # production 12 | /build 13 | 14 | # misc 15 | .DS_Store 16 | .env.local 17 | .env.development.local 18 | .env.test.local 19 | .env.production.local 20 | 21 | npm-debug.log* 22 | yarn-debug.log* 23 | yarn-error.log* 24 | -------------------------------------------------------------------------------- /examples/create-react-app/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 5 | sans-serif; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | } 9 | 10 | code { 11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', 12 | monospace; 13 | } 14 | -------------------------------------------------------------------------------- /examples/fetch-from-url/src/index.css: -------------------------------------------------------------------------------- 1 | body { 2 | margin: 0; 3 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 4 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', 5 | sans-serif; 6 | -webkit-font-smoothing: antialiased; 7 | -moz-osx-font-smoothing: grayscale; 8 | } 9 | 10 | code { 11 | font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', 12 | monospace; 13 | } 14 | 15 | img { 16 | width: 100%; 17 | height: auto; 18 | } -------------------------------------------------------------------------------- /src/renderers/raw/index.test.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { create } from 'react-test-renderer'; 3 | import Raw, { RawBlockData } from '.'; 4 | 5 | describe('{data?.text && HTMLReactParser(data.text)}
; 19 | }; 20 | 21 | export default Paragraph; 22 | -------------------------------------------------------------------------------- /src/renderers/code/index.tsx: -------------------------------------------------------------------------------- 1 | import React, { FC } from 'react'; 2 | import { RenderFn } from '../..'; 3 | 4 | export interface CodeBlockData { 5 | code: string; 6 | lang?: string; 7 | } 8 | 9 | const Code: RenderFn{data?.code && {`${data.code}`}};
21 | };
22 |
23 | export default Code;
24 |
--------------------------------------------------------------------------------
/src/renderers/embed/__snapshots__/index.test.tsx.snap:
--------------------------------------------------------------------------------
1 | // Jest Snapshot v1, https://goo.gl/fbAQLP
2 |
3 | exports[` when receives a Embed block with actions renders a