Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/paragraph.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Paragraph check
on:
pull_request:
merge_group:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Run ESLint check
uses: ./.github/actions/lint
with:
package-name: '@editorjs/paragraph'

build:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
Comment on lines +12 to +20
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Build the package
uses: ./.github/actions/build
with:
package-name: '@editorjs/paragraph'

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
Comment on lines +21 to +27
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ A model-driven, collaboration-ready Editor.js engine split into focused packages

## Packages

### Base packages

| Package | Description |
|---|---|
| [`@editorjs/model-types`](packages/model-types) | Shared low-level types and base event classes used internally by `model` and `sdk` only — not intended for direct use by other packages or tools |
Expand All @@ -26,6 +28,12 @@ A model-driven, collaboration-ready Editor.js engine split into focused packages
| [`@editorjs/ot-server`](packages/ot-server) | Standalone WebSocket OT server (`OTServer`, `DocumentManager`) |
| [`playground`](packages/playground) | Vite dev sandbox for manual testing |

### Tools/Plugins

| Package | Description |
|---|---|
| [`@editorjs/paragraph`](packages/tools/paragraph) | Built-in Paragraph block tool |

## Documentation

In-depth architecture, flow, and API docs live in [`docs/`](docs/README.md).
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"private": true,
"packageManager": "yarn@4.0.1",
"workspaces": [
"packages/*"
"packages/*",
"packages/tools/*"
],
"scripts": {
"build": "yarn workspaces foreach -At run build",
Expand Down
1 change: 1 addition & 0 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
"@editorjs/editorjs": "^2.30.5",
"@editorjs/helpers": "^1.2.2",
"@editorjs/model": "workspace:^",
"@editorjs/paragraph": "workspace:^",
"@editorjs/sdk": "workspace:^",
"inversify": "^8.1.0",
"reflect-metadata": "^0.2.2"
Expand Down
3 changes: 2 additions & 1 deletion packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ import ToolsManager from './tools/ToolsManager.js';
import type { CoreConfigValidated, CoreConfig, EditorjsPluginConstructor, BlockTuneConstructor, ToolConstructable, EditorjsAdapterPluginConstructor } from '@editorjs/sdk';
import { EditorAPI } from './api/index.js';
import { generateId } from './utils/uid.js';
import { Paragraph, BoldInlineTool, LinkInlineTool, ItalicInlineTool } from './tools/internal';
import { Paragraph } from '@editorjs/paragraph';
import { BoldInlineTool, LinkInlineTool, ItalicInlineTool } from './tools/internal';
import { ShortcutsPlugin } from './plugins/ShortcutsPlugin.js';
import { DOMAdapters } from '@editorjs/dom-adapters';
import { BlocksManager } from './components/BlockManager.js';
Expand Down
1 change: 0 additions & 1 deletion packages/core/src/tools/internal/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
export * from './block-tools/paragraph/index.js';
export * from './inline-tools/bold/index.js';
export * from './inline-tools/italic/index.js';
export * from './inline-tools/link/index.js';
3 changes: 3 additions & 0 deletions packages/core/tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
},
{
"path": "../collaboration-manager/tsconfig.build.json"
},
{
"path": "../tools/paragraph/tsconfig.build.json"
}
]
}
3 changes: 3 additions & 0 deletions packages/core/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@
},
{
"path": "../collaboration-manager/tsconfig.build.json"
},
{
"path": "../tools/paragraph/tsconfig.build.json"
}
]
}
24 changes: 24 additions & 0 deletions packages/tools/paragraph/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

# Swap the comments on the following lines if you don't wish to use zero-installs
# Documentation here: https://yarnpkg.com/features/zero-installs
#!.yarn/cache
#.pnp.*

# IDE
.idea/*

node_modules/*
dist/*

# tests
coverage/
reports/

# stryker temp files
.stryker-tmp
3 changes: 3 additions & 0 deletions packages/tools/paragraph/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Paragraph

Built-in Editor.js Block Tool for editing plain text paragraphs.
27 changes: 27 additions & 0 deletions packages/tools/paragraph/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import CodeX from 'eslint-config-codex';

export default [
...CodeX,
{
languageOptions: {
parserOptions: {
project: './tsconfig.eslint.json',
tsconfigRootDir: import.meta.dirname,
sourceType: 'module',
},
},
rules: {
'n/no-unpublished-import': ['error', {
allowModules: [
'eslint-config-codex',
],
ignoreTypeImport: true,
}],
'n/no-missing-import': 'off',
'n/no-unsupported-features/node-builtins': ['error', {
version: '>=24.0.0',
ignores: [],
}],
},
},
];
30 changes: 30 additions & 0 deletions packages/tools/paragraph/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"name": "@editorjs/paragraph",
"version": "0.0.0",
"packageManager": "yarn@4.0.1",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"type": "module",
"scripts": {
"build": "yarn clear && tsc --build tsconfig.build.json",
"build:declaration": "yarn build --emitDeclarationOnly",
"lint": "eslint",
"lint:ci": "yarn lint --max-warnings 0",
"lint:fix": "yarn lint --fix",
"clear": "rm -rf dist && rm -f tsconfig.build.tsbuildinfo && rm -f tsconfig.tsbuildinfo"
},
"devDependencies": {
"@types/eslint": "^9.6.1",
"@types/node": "^22.10.2",
"eslint": "^9.24.0",
"eslint-config-codex": "^2.0.3",
"eslint-plugin-import": "^2.31.0",
"typescript": "^5.5.4"
},
"dependencies": {
"@codexteam/icons": "^0.3.3",
"@editorjs/dom-adapters": "workspace:^",
"@editorjs/editorjs": "^2.30.5",
"@editorjs/sdk": "workspace:^"
}
}
16 changes: 16 additions & 0 deletions packages/tools/paragraph/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"extends": "./tsconfig.json",
"exclude": [
"node_modules/**/*",
"dist/**/*",
"**/*.spec.ts"
],
"references": [
{
"path": "../../sdk/tsconfig.build.json"
},
{
"path": "../../dom-adapters/tsconfig.build.json"
}
]
}
14 changes: 14 additions & 0 deletions packages/tools/paragraph/tsconfig.eslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"compilerOptions": {
"types": ["node"],
},
"extends": "./tsconfig.json",
"include": [
"src/**/*",
"eslint.config.mjs",
],
"exclude": [
"dist/**/*",
"node_modules/**/*",
]
}
30 changes: 30 additions & 0 deletions packages/tools/paragraph/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"compilerOptions": {
"composite": true,
"target": "esnext",
"module": "esnext",
"moduleResolution": "bundler",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true,
"rootDir": "src",
"outDir": "dist",
"declaration": true,
"declarationMap": true,
"sourceMap": true
},
"include": ["src/**/*"],
"exclude": [
"node_modules/**/*",
"dist/**/*"
],
"references": [
{
"path": "../../sdk/tsconfig.build.json"
},
{
"path": "../../dom-adapters/tsconfig.build.json"
}
]
}
18 changes: 18 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2293,6 +2293,7 @@ __metadata:
"@editorjs/editorjs": "npm:^2.30.5"
"@editorjs/helpers": "npm:^1.2.2"
"@editorjs/model": "workspace:^"
"@editorjs/paragraph": "workspace:^"
"@editorjs/sdk": "workspace:^"
"@jest/globals": "npm:^29.7.0"
"@stryker-mutator/core": "npm:^7.0.2"
Expand Down Expand Up @@ -2479,6 +2480,23 @@ __metadata:
languageName: unknown
linkType: soft

"@editorjs/paragraph@workspace:^, @editorjs/paragraph@workspace:packages/tools/paragraph":
version: 0.0.0-use.local
resolution: "@editorjs/paragraph@workspace:packages/tools/paragraph"
dependencies:
"@codexteam/icons": "npm:^0.3.3"
"@editorjs/dom-adapters": "workspace:^"
"@editorjs/editorjs": "npm:^2.30.5"
"@editorjs/sdk": "workspace:^"
"@types/eslint": "npm:^9.6.1"
"@types/node": "npm:^22.10.2"
eslint: "npm:^9.24.0"
eslint-config-codex: "npm:^2.0.3"
eslint-plugin-import: "npm:^2.31.0"
typescript: "npm:^5.5.4"
languageName: unknown
linkType: soft

"@editorjs/sdk@workspace:^, @editorjs/sdk@workspace:packages/sdk":
version: 0.0.0-use.local
resolution: "@editorjs/sdk@workspace:packages/sdk"
Expand Down