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

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 +26 -40
  2. package/package.json +11 -13
package/README.md CHANGED
@@ -1,53 +1,39 @@
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 <u>[ProseMirror](https://prosemirror.net/)</u>. Framework-agnostic headless core with first-class Angular support.
7
+ 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
8
 
7
- ## Installation
9
+ ## Links
8
10
 
9
- ```bash
10
- npm install @domternal/core @domternal/extension-code-block-lowlight lowlight
11
- ```
11
+ <u>[Website](https://domternal.dev)</u> &nbsp;&nbsp;&nbsp;•&nbsp;&nbsp;&nbsp; <u>[Documentation](https://domternal.dev/v1/introduction)</u> &nbsp;&nbsp;&nbsp;•&nbsp;&nbsp;&nbsp; <u>[StackBlitz (Vanilla TS)](https://stackblitz.com/edit/domternal-vanilla-full-example)</u> &nbsp;&nbsp;&nbsp;•&nbsp;&nbsp;&nbsp; <u>[StackBlitz (Angular)](https://stackblitz.com/edit/domternal-angular-full-example)</u>
12
12
 
13
- ## Usage
13
+ ## Features
14
14
 
15
- ```ts
16
- import { Editor, StarterKit } from '@domternal/core';
17
- import { CodeBlockLowlight } from '@domternal/extension-code-block-lowlight';
18
- import { createLowlight, common } from 'lowlight';
15
+ See <u>[Packages & Bundle Size](https://domternal.dev/v1/packages)</u> for a full breakdown of all packages and what each one includes.
19
16
 
20
- const lowlight = createLowlight(common);
17
+ - **Headless core** - use with any framework or vanilla JS/TS
18
+ - **Angular components** - editor, toolbar, bubble menu, floating menu, emoji picker (signals, OnPush, zoneless-ready)
19
+ - **57 extensions across 10 packages** - 23 nodes, 9 marks, and 25 behavior extensions
20
+ - **140+ chainable commands** - `editor.chain().focus().toggleBold().run()`
21
+ - **Full table support** - cell merging, column resize, row/column controls, cell toolbar, all free and MIT licensed
22
+ - **Tree-shakeable** - import only what you use, your bundler strips the rest
23
+ - **~38 KB gzipped** (own code), <u>[~108 KB total](https://domternal.dev/v1/packages)</u> with ProseMirror
24
+ - **TypeScript first** - 100% typed, zero `any`
25
+ - **4,400+ tests** - 2,687 unit tests and 1,796 E2E tests across 37 Playwright specs
26
+ - **Light and dark theme** - 70+ CSS custom properties for full visual control
27
+ - **Inline styles export** - `getHTML({ styled: true })` produces inline CSS ready for email clients, CMS, and Google Docs
28
+ - **SSR helpers** - `generateHTML`, `generateJSON`, `generateText` for server-side rendering
21
29
 
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
+ ## Documentation
30
31
 
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
- ```
32
+ - <u>[Getting Started](https://domternal.dev/v1/getting-started)</u> - install and create your first editor
33
+ - <u>[Introduction](https://domternal.dev/v1/introduction)</u> - core concepts, architecture, and design decisions
34
+ - <u>[Packages & Bundle Size](https://domternal.dev/v1/packages)</u> - what each package includes and bundle size breakdown
35
+ - <u>[Blog](https://domternal.dev/blog)</u>
50
36
 
51
37
  ## License
52
38
 
53
- [MIT](https://github.com/domternal/domternal/blob/main/LICENSE)
39
+ <u>[MIT](https://github.com/domternal/domternal/blob/main/LICENSE)</u>
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.3.0",
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
+ }