@domternal/extension-code-block-lowlight 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +23 -40
  2. package/package.json +11 -13
package/README.md CHANGED
@@ -1,52 +1,35 @@
1
1
  # @domternal/extension-code-block-lowlight
2
2
 
3
- Syntax-highlighted code blocks for the Domternal editor, powered by [lowlight](https://github.com/wooorm/lowlight) (highlight.js).
3
+ [![Version](https://img.shields.io/npm/v/@domternal/extension-code-block-lowlight.svg)](https://www.npmjs.com/package/@domternal/extension-code-block-lowlight)
4
+ [![MIT License](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/domternal/domternal/blob/main/LICENSE)
4
5
 
5
- Part of the [Domternal](https://github.com/domternal/domternal) toolkit. Full docs at [domternal.dev](https://domternal.dev).
6
+ A lightweight, extensible rich text editor toolkit built on [ProseMirror](https://prosemirror.net/). Framework-agnostic headless core with first-class **Angular** support. Use it headless with vanilla JS/TS, add the built-in toolbar and theme, or drop in ready-made Angular components. Fully tree-shakeable, import only what you use, unused extensions are stripped from your bundle.
6
7
 
7
- ## Installation
8
+ **[Website](https://domternal.dev)** · **[Documentation](https://domternal.dev/v1/introduction)** · **[StackBlitz (Vanilla TS)](https://stackblitz.com/edit/domternal-vanilla-full-example)** · **[StackBlitz (Angular)](https://stackblitz.com/edit/domternal-angular-full-example)**
8
9
 
9
- ```bash
10
- npm install @domternal/core @domternal/extension-code-block-lowlight lowlight
11
- ```
10
+ ## Features
12
11
 
13
- ## Usage
12
+ See [Packages & Bundle Size](https://domternal.dev/v1/packages) for a full breakdown of all packages and what each one includes.
14
13
 
15
- ```ts
16
- import { Editor, StarterKit } from '@domternal/core';
17
- import { CodeBlockLowlight } from '@domternal/extension-code-block-lowlight';
18
- import { createLowlight, common } from 'lowlight';
14
+ - **Headless core** - use with any framework or vanilla JS/TS
15
+ - **Angular components** - editor, toolbar, bubble menu, floating menu, emoji picker (signals, OnPush, zoneless-ready)
16
+ - **57 extensions across 10 packages** - 23 nodes, 9 marks, and 25 behavior extensions
17
+ - **140+ chainable commands** - `editor.chain().focus().toggleBold().run()`
18
+ - **Full table support** - cell merging, column resize, row/column controls, cell toolbar, all free and MIT licensed
19
+ - **Tree-shakeable** - import only what you use, your bundler strips the rest
20
+ - **~38 KB gzipped** (own code), [~108 KB total](https://domternal.dev/v1/packages) with ProseMirror
21
+ - **TypeScript first** - 100% typed, zero `any`
22
+ - **4,200+ tests** - 2,675 unit tests and 1,550 E2E tests across 34 Playwright specs
23
+ - **Light and dark theme** - 70+ CSS custom properties for full visual control
24
+ - **Inline styles export** - `getHTML({ styled: true })` produces inline CSS ready for email clients, CMS, and Google Docs
25
+ - **SSR helpers** - `generateHTML`, `generateJSON`, `generateText` for server-side rendering
19
26
 
20
- const lowlight = createLowlight(common);
27
+ ## Documentation
21
28
 
22
- const editor = new Editor({
23
- element: document.getElementById('editor')!,
24
- extensions: [
25
- StarterKit.configure({ codeBlock: false }), // disable the default CodeBlock
26
- CodeBlockLowlight.configure({ lowlight }),
27
- ],
28
- });
29
- ```
30
-
31
- ### Options
32
-
33
- | Option | Default | Description |
34
- |---|---|---|
35
- | `lowlight` | (required) | A lowlight instance created with `createLowlight()` |
36
- | `defaultLanguage` | `null` | Default language when none is specified |
37
- | `autoDetect` | `true` | Auto-detect language when none is specified |
38
- | `tabIndentation` | `true` | Tab key inserts spaces inside code blocks |
39
- | `tabSize` | `2` | Number of spaces per tab |
40
-
41
- ### Server-Side Rendering
42
-
43
- Use `generateHighlightedHTML` to produce syntax-highlighted HTML on the server:
44
-
45
- ```ts
46
- import { generateHighlightedHTML } from '@domternal/extension-code-block-lowlight';
47
-
48
- const html = generateHighlightedHTML(jsonContent, { lowlight });
49
- ```
29
+ - [Getting Started](https://domternal.dev/v1/getting-started) - install and create your first editor
30
+ - [Introduction](https://domternal.dev/v1/introduction) - core concepts, architecture, and design decisions
31
+ - [Packages & Bundle Size](https://domternal.dev/v1/packages) - what each package includes and bundle size breakdown
32
+ - [Blog](https://domternal.dev/blog)
50
33
 
51
34
  ## License
52
35
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@domternal/extension-code-block-lowlight",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Code block with syntax highlighting via lowlight for Domternal editor",
5
5
  "author": "https://github.com/ThomasNowHere",
6
6
  "license": "MIT",
@@ -27,16 +27,6 @@
27
27
  "files": [
28
28
  "dist"
29
29
  ],
30
- "scripts": {
31
- "build": "tsup --clean",
32
- "dev": "tsup --watch",
33
- "test": "vitest run",
34
- "test:watch": "vitest",
35
- "lint": "eslint src",
36
- "typecheck": "tsc --noEmit",
37
- "prepublishOnly": "node -e \"const p=JSON.parse(require('fs').readFileSync('package.json','utf8'));delete p.devDependencies;if(p.dependencies){for(const[k,v]of Object.entries(p.dependencies)){if(v==='workspace:*')p.dependencies[k]='>=0.2.0'}}require('fs').writeFileSync('package.json',JSON.stringify(p,null,2)+'\\n')\"",
38
- "postpublish": "git checkout package.json"
39
- },
40
30
  "dependencies": {
41
31
  "hast-util-to-html": "^9.0.0"
42
32
  },
@@ -61,5 +51,13 @@
61
51
  "bugs": {
62
52
  "url": "https://github.com/domternal/domternal/issues"
63
53
  },
64
- "homepage": "https://domternal.dev"
65
- }
54
+ "homepage": "https://domternal.dev",
55
+ "scripts": {
56
+ "build": "tsup --clean",
57
+ "dev": "tsup --watch",
58
+ "test": "vitest run",
59
+ "test:watch": "vitest",
60
+ "lint": "eslint src",
61
+ "typecheck": "tsc --noEmit"
62
+ }
63
+ }