@clepit/core 0.4.0 → 0.5.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.
- package/CHANGELOG.md +9 -0
- package/README.md +13 -53
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/tools/block/header/css.d.ts +1 -1
- package/dist/types.d.ts +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -7,13 +7,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.5.0] - 2026-08-31
|
|
11
|
+
|
|
12
|
+
Note: 0.4.0 was released without a changelog entry, so the notes below cover
|
|
13
|
+
everything since 0.3.0, part of which already shipped as 0.4.0.
|
|
14
|
+
|
|
10
15
|
### Added
|
|
11
16
|
- Block identity flows end to end: `createBlockElement` honors an incoming `block.id` as the rendered `data-id` (minting one only when the block has none), `getBlockData` returns the id, and `EditorAPI.blocks.insert` accepts an optional `id` so a caller can insert a block under an identity it already holds. Previously the id existed only in the store and evaporated through every DOM-derived path.
|
|
12
17
|
- `BLOCK_TOOLS` is exported as a value, so a host can check whether a block type is one this editor understands.
|
|
18
|
+
- `INLINE_TOOLS` is exported as a value, and it now names `status`, the badge tool the inline toolbar already serves; `InlineToolType` widens with it.
|
|
13
19
|
|
|
14
20
|
### Changed
|
|
15
21
|
- `BlockTunes` narrowed to the flat map its writer actually produces; the nested contract had no implementation on any path.
|
|
16
22
|
|
|
23
|
+
### Fixed
|
|
24
|
+
- Rendered headings are sized again. The output stylesheet keyed its per-level sizes on a `data-level` attribute no render path ever wrote, so every heading in `renderBlocks`/`draw` output fell back to browser defaults. Sizes now key on the heading tags the renderer actually emits.
|
|
25
|
+
|
|
17
26
|
## [0.3.0] — 2026-08-11
|
|
18
27
|
|
|
19
28
|
### Added
|
package/README.md
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
# @clepit/core
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
**Homepage:** [clepit.com](https://clepit.com) · **Docs:** [clepit.com/docs](https://clepit.com/docs)
|
|
3
|
+
[Clepit](https://clepit.com) is a block-style editor with clean JSON output and a renderer that works with or without a browser. This package is the framework-agnostic core behind clepit.com: the editor, the renderer, and the theming engine, with no framework dependency.
|
|
6
4
|
|
|
7
5
|
## Install
|
|
8
6
|
|
|
@@ -14,65 +12,27 @@ npm install @clepit/core
|
|
|
14
12
|
|
|
15
13
|
## Quick start
|
|
16
14
|
|
|
17
|
-
```html
|
|
18
|
-
<div id="editor"></div>
|
|
19
|
-
```
|
|
20
|
-
|
|
21
15
|
```ts
|
|
22
16
|
import { Editor } from '@clepit/core';
|
|
23
17
|
|
|
24
|
-
const editor = Editor.create({
|
|
25
|
-
containerId: 'editor',
|
|
26
|
-
theme: 'auto', // 'auto' | 'light' | 'dark'
|
|
27
|
-
});
|
|
28
|
-
|
|
18
|
+
const editor = Editor.create({ containerId: 'editor', theme: 'auto' });
|
|
29
19
|
const data = editor.data.extract();
|
|
30
|
-
console.log(data.blocks);
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
## Features
|
|
34
|
-
|
|
35
|
-
- **12 built-in block types** — header, paragraph, list, checklist, quote, code, alert, table, image, video, delimiter, json.
|
|
36
|
-
- **8 inline tools** — link, marker, tooltip, bold, italic, underline, strikethrough, inline-code.
|
|
37
|
-
- **Framework-agnostic** — no React, Vue, or Svelte dependency. Drop into any app that can mount a DOM node.
|
|
38
|
-
- **TypeScript-first** — every public API is typed. No `any`.
|
|
39
|
-
- **Theme-aware** — pass `theme: 'auto'` and the editor follows the OS color scheme. Override any token with `themeOverrides`.
|
|
40
|
-
- **Clean JSON output** — persist, sync, and render wherever you like.
|
|
41
|
-
|
|
42
|
-
## Theming
|
|
43
|
-
|
|
44
|
-
```ts
|
|
45
|
-
Editor.create({
|
|
46
|
-
containerId: 'editor',
|
|
47
|
-
theme: 'auto',
|
|
48
|
-
themeOverrides: {
|
|
49
|
-
accentPrimary: '#5b5bff',
|
|
50
|
-
bgDefault: '#ffffff',
|
|
51
|
-
textPrimary: '#0a0a0a',
|
|
52
|
-
},
|
|
53
|
-
});
|
|
54
20
|
```
|
|
55
21
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
```ts
|
|
59
|
-
import { StyleManager } from '@clepit/core';
|
|
60
|
-
|
|
61
|
-
const unsub = StyleManager.subscribe(tokens => {
|
|
62
|
-
// sync surrounding UI with editor theme
|
|
63
|
-
});
|
|
64
|
-
```
|
|
22
|
+
## Documentation
|
|
65
23
|
|
|
66
|
-
|
|
24
|
+
The full documentation lives at [clepit.com/docs](https://clepit.com/docs) and is rendered with this package:
|
|
67
25
|
|
|
68
|
-
|
|
69
|
-
|
|
26
|
+
- [Getting started](https://clepit.com/docs/getting-started)
|
|
27
|
+
- [Core concepts](https://clepit.com/docs/core-concepts)
|
|
28
|
+
- [Block types](https://clepit.com/docs/blocks)
|
|
29
|
+
- [Inline tools](https://clepit.com/docs/inline-tools)
|
|
30
|
+
- [Configuration](https://clepit.com/docs/configuration)
|
|
31
|
+
- [Theming](https://clepit.com/docs/themes)
|
|
32
|
+
- [Rendering and embedding](https://clepit.com/docs/embedding)
|
|
33
|
+
- [API reference](https://clepit.com/docs/api)
|
|
70
34
|
|
|
71
|
-
|
|
72
|
-
containerId: 'view',
|
|
73
|
-
data, // block JSON from editor.data.extract()
|
|
74
|
-
});
|
|
75
|
-
```
|
|
35
|
+
Using React? [`@clepit/react`](https://www.npmjs.com/package/@clepit/react) wraps this core in server-first components. Building with Dart or Flutter? [`clepit_core`](https://pub.dev/packages/clepit_core) is the native twin.
|
|
76
36
|
|
|
77
37
|
## License
|
|
78
38
|
|
package/dist/index.d.ts
CHANGED
|
@@ -9,6 +9,6 @@ export { type ThemeTokens, tokensToLightDarkBlock } from './core/theme';
|
|
|
9
9
|
export type { OpenApiGroup, OpenApiModel, OpenApiOperation, OpenApiServer } from './tools/block/openapi/spec';
|
|
10
10
|
export { parseOpenApi } from './tools/block/openapi/spec';
|
|
11
11
|
export type { ALERT_VARIANTS, AlertData, AlertVariant, AudioData, Block, BlockClassNames, BlockMargins, BlockStyles, BlockTune, CodeData, CodeVariant, CSSProperties, CSSValue, DelimiterData, DelimiterVariant, EditorAPI, EditorClassNames, EditorConfig, EditorData, EditorStyles, GlanceData, GlanceRow, HeaderData, HeaderLevel, ImageData, InlineToolType as InlineTool, InputClassNames, InputConfig, InputStyles, ListData, ListType, OpenApiData, OpenApiFilter, OutputComponent, OutputConfig, ParagraphData, QuoteData, RendererConfig, TableData, ToolType as BlockType, UploadFunction, VideoData, } from './types';
|
|
12
|
-
export { BLOCK_TOOLS } from './types';
|
|
12
|
+
export { BLOCK_TOOLS, INLINE_TOOLS } from './types';
|
|
13
13
|
export { sanitizeHtmlWithoutDom } from './utils/sanitize-html-nodom';
|
|
14
14
|
//# sourceMappingURL=index.d.ts.map
|