create-markdown 0.2.2 → 0.4.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.
@@ -0,0 +1,40 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropNames = Object.getOwnPropertyNames;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __reExport = (target, mod, secondTarget) => {
6
+ for (let key of __getOwnPropNames(mod))
7
+ if (!__hasOwnProp.call(target, key) && key !== "default")
8
+ __defProp(target, key, {
9
+ get: () => mod[key],
10
+ enumerable: true
11
+ });
12
+ if (secondTarget) {
13
+ for (let key of __getOwnPropNames(mod))
14
+ if (!__hasOwnProp.call(secondTarget, key) && key !== "default")
15
+ __defProp(secondTarget, key, {
16
+ get: () => mod[key],
17
+ enumerable: true
18
+ });
19
+ return secondTarget;
20
+ }
21
+ };
22
+ var __moduleCache = /* @__PURE__ */ new WeakMap;
23
+ var __toCommonJS = (from) => {
24
+ var entry = __moduleCache.get(from), desc;
25
+ if (entry)
26
+ return entry;
27
+ entry = __defProp({}, "__esModule", { value: true });
28
+ if (from && typeof from === "object" || typeof from === "function")
29
+ __getOwnPropNames(from).map((key) => !__hasOwnProp.call(entry, key) && __defProp(entry, key, {
30
+ get: () => from[key],
31
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
32
+ }));
33
+ __moduleCache.set(from, entry);
34
+ return entry;
35
+ };
36
+
37
+ // src/preview.ts
38
+ var exports_preview = {};
39
+ module.exports = __toCommonJS(exports_preview);
40
+ __reExport(exports_preview, require("@create-markdown/preview"), module.exports);
@@ -0,0 +1,8 @@
1
+ /**
2
+ * create-markdown/preview
3
+ * HTML rendering with syntax highlighting and diagrams
4
+ *
5
+ * Re-exports @create-markdown/preview for convenience.
6
+ */
7
+ export * from '@create-markdown/preview';
8
+ //# sourceMappingURL=preview.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preview.d.ts","sourceRoot":"","sources":["../src/preview.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,cAAc,0BAA0B,CAAC"}
@@ -0,0 +1,2 @@
1
+ // src/preview.ts
2
+ export * from "@create-markdown/preview";
package/dist/react.cjs ADDED
@@ -0,0 +1,40 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropNames = Object.getOwnPropertyNames;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __reExport = (target, mod, secondTarget) => {
6
+ for (let key of __getOwnPropNames(mod))
7
+ if (!__hasOwnProp.call(target, key) && key !== "default")
8
+ __defProp(target, key, {
9
+ get: () => mod[key],
10
+ enumerable: true
11
+ });
12
+ if (secondTarget) {
13
+ for (let key of __getOwnPropNames(mod))
14
+ if (!__hasOwnProp.call(secondTarget, key) && key !== "default")
15
+ __defProp(secondTarget, key, {
16
+ get: () => mod[key],
17
+ enumerable: true
18
+ });
19
+ return secondTarget;
20
+ }
21
+ };
22
+ var __moduleCache = /* @__PURE__ */ new WeakMap;
23
+ var __toCommonJS = (from) => {
24
+ var entry = __moduleCache.get(from), desc;
25
+ if (entry)
26
+ return entry;
27
+ entry = __defProp({}, "__esModule", { value: true });
28
+ if (from && typeof from === "object" || typeof from === "function")
29
+ __getOwnPropNames(from).map((key) => !__hasOwnProp.call(entry, key) && __defProp(entry, key, {
30
+ get: () => from[key],
31
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
32
+ }));
33
+ __moduleCache.set(from, entry);
34
+ return entry;
35
+ };
36
+
37
+ // src/react.ts
38
+ var exports_react = {};
39
+ module.exports = __toCommonJS(exports_react);
40
+ __reExport(exports_react, require("@create-markdown/react"), module.exports);
@@ -0,0 +1,8 @@
1
+ /**
2
+ * create-markdown/react
3
+ * React components and hooks
4
+ *
5
+ * Re-exports @create-markdown/react for backwards compatibility.
6
+ */
7
+ export * from '@create-markdown/react';
8
+ //# sourceMappingURL=react.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../src/react.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,cAAc,wBAAwB,CAAC"}
package/dist/react.js ADDED
@@ -0,0 +1,2 @@
1
+ // src/react.ts
2
+ export * from "@create-markdown/react";
package/package.json CHANGED
@@ -1,17 +1,18 @@
1
1
  {
2
2
  "name": "create-markdown",
3
- "version": "0.2.2",
3
+ "version": "0.4.0",
4
+ "description": "Complete block-based markdown notes package - convenience bundle for @create-markdown packages",
4
5
  "author": "Val Alexander <val@viewdue.ai>",
6
+ "license": "MIT",
5
7
  "repository": {
6
8
  "type": "git",
7
- "url": "https://github.com/BunsDev/create-markdown"
9
+ "url": "git+https://github.com/BunsDev/create-markdown.git",
10
+ "directory": "packages/create-markdown"
8
11
  },
9
12
  "homepage": "https://github.com/BunsDev/create-markdown",
10
13
  "bugs": {
11
14
  "url": "https://github.com/BunsDev/create-markdown/issues"
12
15
  },
13
- "description": "Complete block-based markdown notes package with zero dependencies",
14
- "license": "MIT",
15
16
  "keywords": [
16
17
  "markdown",
17
18
  "md",
@@ -41,12 +42,22 @@
41
42
  },
42
43
  "./react": {
43
44
  "import": {
44
- "types": "./dist/react/index.d.ts",
45
- "default": "./dist/react/index.js"
45
+ "types": "./dist/react.d.ts",
46
+ "default": "./dist/react.js"
47
+ },
48
+ "require": {
49
+ "types": "./dist/react.d.ts",
50
+ "default": "./dist/react.cjs"
51
+ }
52
+ },
53
+ "./preview": {
54
+ "import": {
55
+ "types": "./dist/preview.d.ts",
56
+ "default": "./dist/preview.js"
46
57
  },
47
58
  "require": {
48
- "types": "./dist/react/index.d.ts",
49
- "default": "./dist/react/index.cjs"
59
+ "types": "./dist/preview.d.ts",
60
+ "default": "./dist/preview.cjs"
50
61
  }
51
62
  }
52
63
  },
@@ -54,31 +65,38 @@
54
65
  "dist"
55
66
  ],
56
67
  "scripts": {
57
- "build": "bun run build:esm && bun run build:cjs && bun run build:react-esm && bun run build:react-cjs && bun run build:types",
58
- "build:esm": "bun build ./src/index.ts --outfile ./dist/index.js --format esm --external react",
59
- "build:cjs": "bun build ./src/index.ts --outfile ./dist/index.cjs --format cjs --external react",
60
- "build:react-esm": "bun build ./src/react/index.ts --outfile ./dist/react/index.js --format esm --external react",
61
- "build:react-cjs": "bun build ./src/react/index.ts --outfile ./dist/react/index.cjs --format cjs --external react",
68
+ "build": "bun run build:esm && bun run build:cjs && bun run build:types",
69
+ "build:esm": "bun build ./src/index.ts --outfile ./dist/index.js --format esm --external @create-markdown/core --external @create-markdown/react --external @create-markdown/preview --external react && bun build ./src/react.ts --outfile ./dist/react.js --format esm --external @create-markdown/core --external @create-markdown/react --external react && bun build ./src/preview.ts --outfile ./dist/preview.js --format esm --external @create-markdown/core --external @create-markdown/preview --external shiki --external mermaid",
70
+ "build:cjs": "bun build ./src/index.ts --outfile ./dist/index.cjs --format cjs --external @create-markdown/core --external @create-markdown/react --external @create-markdown/preview --external react && bun build ./src/react.ts --outfile ./dist/react.cjs --format cjs --external @create-markdown/core --external @create-markdown/react --external react && bun build ./src/preview.ts --outfile ./dist/preview.cjs --format cjs --external @create-markdown/core --external @create-markdown/preview --external shiki --external mermaid",
62
71
  "build:types": "tsc --emitDeclarationOnly --declaration --outDir dist",
63
72
  "dev": "bun run --watch src/index.ts",
64
73
  "clean": "rm -rf dist",
65
- "prepublishOnly": "bun run clean && bun run build",
66
- "deploy": "./deploy.sh",
67
- "playground": "bun run build && cd playground && bun dev",
68
- "playground:install": "cd playground && bun install",
69
74
  "typecheck": "tsc --noEmit"
70
75
  },
76
+ "dependencies": {
77
+ "@create-markdown/core": "^0.2.0",
78
+ "@create-markdown/react": "^0.2.0",
79
+ "@create-markdown/preview": "^0.2.0"
80
+ },
71
81
  "devDependencies": {
72
82
  "@types/react": "^18.2.0",
73
83
  "react": "^18.2.0",
74
84
  "typescript": "^5.3.0"
75
85
  },
76
86
  "peerDependencies": {
77
- "react": ">=18.0.0"
87
+ "react": ">=18.0.0",
88
+ "shiki": ">=1.0.0",
89
+ "mermaid": ">=10.0.0"
78
90
  },
79
91
  "peerDependenciesMeta": {
80
92
  "react": {
81
93
  "optional": true
94
+ },
95
+ "shiki": {
96
+ "optional": true
97
+ },
98
+ "mermaid": {
99
+ "optional": true
82
100
  }
83
101
  },
84
102
  "engines": {
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Val Alexander
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
package/README.md DELETED
@@ -1,294 +0,0 @@
1
- # create-markdown
2
-
3
- [![npm version](https://img.shields.io/npm/v/create-markdown.svg)](https://www.npmjs.com/package/create-markdown)
4
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
-
6
- A complete block-based markdown notes package with zero dependencies. Parse, create, and serialize markdown with full TypeScript support.
7
-
8
- 📦 **[View on npm](https://www.npmjs.com/package/create-markdown)**
9
-
10
- ## Features
11
-
12
- - 🧱 **Block-based architecture** - Work with structured blocks instead of raw strings
13
- - 🔄 **Bidirectional conversion** - Parse markdown to blocks, serialize blocks to markdown
14
- - 📝 **Rich inline styles** - Bold, italic, code, links, strikethrough, highlights
15
- - ⚛️ **React components** - Optional React bindings for rendering and editing
16
- - ✨ **Live WYSIWYG editing** - Interactive playground with real-time markdown rendering
17
- - 🪶 **Zero dependencies** - Core package has no runtime dependencies
18
- - 🔒 **Full TypeScript** - Complete type definitions with generics
19
- - 🚀 **Framework ready** - Works with Next.js, Vite, Remix, Astro, and more
20
-
21
- ## Installation
22
-
23
- ```bash
24
- # Using bun (recommended)
25
- bun add create-markdown
26
-
27
- # Using npm
28
- npm install create-markdown
29
-
30
- # Using yarn
31
- yarn add create-markdown
32
-
33
- # Using pnpm
34
- pnpm add create-markdown
35
- ```
36
-
37
- ## Quick Start
38
-
39
- ### Parse Markdown to Blocks
40
-
41
- ```typescript
42
- import { parse } from 'create-markdown';
43
-
44
- const blocks = parse(`# Hello World
45
-
46
- This is **bold** and *italic* text.
47
-
48
- - Item one
49
- - Item two
50
- `);
51
-
52
- console.log(blocks);
53
- // [
54
- // { type: 'heading', props: { level: 1 }, content: [...] },
55
- // { type: 'paragraph', content: [...] },
56
- // { type: 'bulletList', children: [...] }
57
- // ]
58
- ```
59
-
60
- ### Create Blocks Programmatically
61
-
62
- ```typescript
63
- import { h1, paragraph, bulletList, bold, italic, spans } from 'create-markdown';
64
-
65
- const blocks = [
66
- h1('My Document'),
67
- paragraph(spans(
68
- bold('Important: '),
69
- { text: 'This is ', styles: {} },
70
- italic('really'),
71
- { text: ' cool!', styles: {} }
72
- )),
73
- bulletList(['First item', 'Second item', 'Third item']),
74
- ];
75
- ```
76
-
77
- ### Serialize Blocks to Markdown
78
-
79
- ```typescript
80
- import { stringify, h1, paragraph, codeBlock } from 'create-markdown';
81
-
82
- const markdown = stringify([
83
- h1('Hello'),
84
- paragraph('World'),
85
- codeBlock('console.log("Hi!");', 'javascript'),
86
- ]);
87
-
88
- console.log(markdown);
89
- // # Hello
90
- //
91
- // World
92
- //
93
- // ```javascript
94
- // console.log("Hi!");
95
- // ```
96
- ```
97
-
98
- ### Document Management
99
-
100
- ```typescript
101
- import {
102
- createDocument,
103
- appendBlock,
104
- removeBlock,
105
- findBlock,
106
- paragraph
107
- } from 'create-markdown';
108
-
109
- // Create a document
110
- let doc = createDocument([paragraph('First paragraph')]);
111
-
112
- // Add a block
113
- doc = appendBlock(doc, paragraph('Second paragraph'));
114
-
115
- // Find a block
116
- const block = findBlock(doc, 'some-id');
117
-
118
- // Remove a block
119
- doc = removeBlock(doc, 'some-id');
120
- ```
121
-
122
- ## React Components
123
-
124
- Optional React bindings are available via a separate import:
125
-
126
- ```tsx
127
- import { BlockRenderer, useDocument, useMarkdown } from 'create-markdown/react';
128
- import { paragraph, h1 } from 'create-markdown/react';
129
-
130
- function Editor() {
131
- const { blocks, appendBlock, toMarkdown } = useDocument();
132
-
133
- return (
134
- <div>
135
- <BlockRenderer blocks={blocks} />
136
- <button onClick={() => appendBlock(paragraph('New paragraph'))}>
137
- Add Paragraph
138
- </button>
139
- <button onClick={() => console.log(toMarkdown())}>
140
- Export Markdown
141
- </button>
142
- </div>
143
- );
144
- }
145
-
146
- function MarkdownEditor() {
147
- const { markdown, blocks, setMarkdown } = useMarkdown('# Hello');
148
-
149
- return (
150
- <div>
151
- <textarea
152
- value={markdown}
153
- onChange={(e) => setMarkdown(e.target.value)}
154
- />
155
- <BlockRenderer blocks={blocks} />
156
- </div>
157
- );
158
- }
159
- ```
160
-
161
- ## Block Types
162
-
163
- | Type | Factory Function | Description |
164
- |------|-----------------|-------------|
165
- | `paragraph` | `paragraph(content)` | Text paragraph |
166
- | `heading` | `heading(level, content)` or `h1`-`h6` | Heading levels 1-6 |
167
- | `bulletList` | `bulletList(items)` | Unordered list |
168
- | `numberedList` | `numberedList(items)` | Ordered list |
169
- | `checkList` | `checkList(items)` | Task list with checkboxes |
170
- | `codeBlock` | `codeBlock(code, language?)` | Fenced code block |
171
- | `blockquote` | `blockquote(content)` | Block quote |
172
- | `image` | `image(url, alt?)` | Image |
173
- | `divider` | `divider()` | Horizontal rule |
174
- | `table` | `table(headers, rows)` | Table with headers |
175
- | `callout` | `callout(type, content)` | Callout/admonition |
176
-
177
- ## Inline Styles
178
-
179
- ```typescript
180
- import { bold, italic, code, link, strikethrough, highlight } from 'create-markdown';
181
-
182
- // Create styled text spans
183
- const content = [
184
- bold('Bold text'),
185
- italic('Italic text'),
186
- code('inline code'),
187
- link('Click here', 'https://example.com'),
188
- strikethrough('deleted'),
189
- highlight('highlighted'),
190
- ];
191
- ```
192
-
193
- ## API Reference
194
-
195
- ### Parsing
196
-
197
- - `parse(markdown)` - Parse markdown string to blocks
198
- - `markdownToBlocks(markdown, options?)` - Full parser with options
199
- - `markdownToDocument(markdown)` - Parse to a Document object
200
-
201
- ### Serialization
202
-
203
- - `stringify(blocks)` - Serialize blocks to markdown
204
- - `blocksToMarkdown(blocks, options?)` - Full serializer with options
205
- - `documentToMarkdown(doc)` - Serialize a Document
206
-
207
- ### Document Operations
208
-
209
- - `createDocument(blocks?, options?)` - Create a new document
210
- - `insertBlock(doc, block, index?)` - Insert block at position
211
- - `appendBlock(doc, block)` - Add block at end
212
- - `removeBlock(doc, blockId)` - Remove block by ID
213
- - `updateBlock(doc, blockId, updates)` - Update block properties
214
- - `moveBlock(doc, blockId, newIndex)` - Reorder blocks
215
- - `findBlock(doc, blockId)` - Find block by ID
216
-
217
- ### React Hooks
218
-
219
- - `useDocument(initialBlocks?)` - Full document state management
220
- - `useMarkdown(initialMarkdown?)` - Bidirectional markdown/blocks
221
- - `useBlockEditor(doc)` - Selection and editing operations
222
-
223
- ## Integration
224
-
225
- For detailed framework-specific setup guides, see the **[Integration Guide](./INTEGRATION.md)**.
226
-
227
- Quick links:
228
- - [Next.js (App Router)](./INTEGRATION.md#nextjs-app-router)
229
- - [Next.js (Pages Router)](./INTEGRATION.md#nextjs-pages-router)
230
- - [Vite + React](./INTEGRATION.md#vite--react)
231
- - [Remix](./INTEGRATION.md#remix)
232
- - [Astro](./INTEGRATION.md#astro)
233
- - [Node.js / Server-side](./INTEGRATION.md#nodejs--server-side)
234
-
235
- ## Playground
236
-
237
- The package includes a full WYSIWYG playground editor demonstrating all features:
238
-
239
- ```bash
240
- # Run the interactive playground
241
- bun run playground
242
- ```
243
-
244
- **Playground Features:**
245
- - Click-to-edit blocks with live markdown rendering
246
- - Markdown shortcuts (`#` headings, `-` lists, `>` quotes, ``` code, `---` dividers)
247
- - Inline formatting (`**bold**`, `*italic*`, `` `code` ``, `~~strike~~`, `==highlight==`, `[link](url)`)
248
- - Keyboard shortcuts (Cmd/Ctrl+B, Cmd/Ctrl+I, Cmd/Ctrl+U)
249
- - List item management with Enter/Backspace/Tab
250
- - Dark/light theme toggle
251
- - Export to markdown
252
-
253
- ## Development
254
-
255
- ```bash
256
- # Install dependencies
257
- bun install
258
-
259
- # Build the package
260
- bun run build
261
-
262
- # Type check
263
- bun run typecheck
264
-
265
- # Run the playground
266
- bun run playground
267
- ```
268
-
269
- ## Requirements
270
-
271
- - Node.js 20+
272
- - Bun 1.0+ (for development)
273
- - React 18+ (optional, for React components)
274
-
275
- ## Documentation
276
-
277
- | Document | Description |
278
- |----------|-------------|
279
- | [README.md](./README.md) | Quick start and API overview |
280
- | [INTEGRATION.md](./INTEGRATION.md) | Framework-specific setup guides |
281
- | [CONTRIBUTING.md](./CONTRIBUTING.md) | Contribution guidelines |
282
- | [CHANGELOG.md](./CHANGELOG.md) | Version history |
283
-
284
- ## Contributing
285
-
286
- We welcome contributions! Please see [CONTRIBUTING.md](./CONTRIBUTING.md) for guidelines.
287
-
288
- ## Changelog
289
-
290
- See [CHANGELOG.md](./CHANGELOG.md) for release history.
291
-
292
- ## License
293
-
294
- MIT
@@ -1,136 +0,0 @@
1
- /**
2
- * create-markdown - Block Factory Functions
3
- * Create and manipulate block structures
4
- */
5
- import type { Block, BlockType, TextSpan, InlineStyle, HeadingBlock, ParagraphBlock, BulletListBlock, NumberedListBlock, CheckListBlock, CodeBlockBlock, BlockquoteBlock, ImageBlock, DividerBlock, CalloutBlock, CalloutType, TableBlock } from '../types';
6
- /**
7
- * Creates: block with the specified type and properties
8
- */
9
- export declare function createBlock<T extends BlockType>(type: T, content?: TextSpan[], props?: Block<T>['props'], children?: Block[]): Block<T>;
10
- /**
11
- * Creates: plain text span with no styles
12
- */
13
- export declare function text(content: string): TextSpan;
14
- /**
15
- * Creates: bold text span
16
- */
17
- export declare function bold(content: string): TextSpan;
18
- /**
19
- * Creates: italic text span
20
- */
21
- export declare function italic(content: string): TextSpan;
22
- /**
23
- * Creates: inline code text span
24
- */
25
- export declare function code(content: string): TextSpan;
26
- /**
27
- * Creates: strikethrough text span
28
- */
29
- export declare function strikethrough(content: string): TextSpan;
30
- /**
31
- * Creates: underlined text span
32
- */
33
- export declare function underline(content: string): TextSpan;
34
- /**
35
- * Creates: highlighted text span
36
- */
37
- export declare function highlight(content: string): TextSpan;
38
- /**
39
- * Creates: link text span
40
- */
41
- export declare function link(content: string, url: string, title?: string): TextSpan;
42
- /**
43
- * Creates: text span with custom styles
44
- */
45
- export declare function styled(content: string, styles: InlineStyle): TextSpan;
46
- /**
47
- * Combines multiple text spans into a content array
48
- */
49
- export declare function spans(...textSpans: TextSpan[]): TextSpan[];
50
- /**
51
- * Creates: paragraph block
52
- */
53
- export declare function paragraph(content: string | TextSpan[]): ParagraphBlock;
54
- /**
55
- * Creates: heading block
56
- */
57
- export declare function heading(level: 1 | 2 | 3 | 4 | 5 | 6, content: string | TextSpan[]): HeadingBlock;
58
- export declare const h1: (content: string | TextSpan[]) => HeadingBlock;
59
- export declare const h2: (content: string | TextSpan[]) => HeadingBlock;
60
- export declare const h3: (content: string | TextSpan[]) => HeadingBlock;
61
- export declare const h4: (content: string | TextSpan[]) => HeadingBlock;
62
- export declare const h5: (content: string | TextSpan[]) => HeadingBlock;
63
- export declare const h6: (content: string | TextSpan[]) => HeadingBlock;
64
- /**
65
- * Creates: bullet list block with items
66
- */
67
- export declare function bulletList(items: (string | TextSpan[] | Block)[]): BulletListBlock;
68
- /**
69
- * Creates: numbered list block with items
70
- */
71
- export declare function numberedList(items: (string | TextSpan[] | Block)[]): NumberedListBlock;
72
- /**
73
- * Creates: checklist item
74
- */
75
- export declare function checkListItem(content: string | TextSpan[], checked?: boolean): CheckListBlock;
76
- /**
77
- * Creates: checklist with multiple items
78
- */
79
- export declare function checkList(items: {
80
- content: string | TextSpan[];
81
- checked?: boolean;
82
- }[]): Block[];
83
- /**
84
- * Creates: code block
85
- */
86
- export declare function codeBlock(code: string, language?: string): CodeBlockBlock;
87
- /**
88
- * Creates: blockquote
89
- */
90
- export declare function blockquote(content: string | TextSpan[]): BlockquoteBlock;
91
- /**
92
- * Creates: horizontal divider
93
- */
94
- export declare function divider(): DividerBlock;
95
- /**
96
- * Creates: image block
97
- */
98
- export declare function image(url: string, alt?: string, options?: {
99
- title?: string;
100
- width?: number;
101
- height?: number;
102
- }): ImageBlock;
103
- /**
104
- * Creates: callout block
105
- */
106
- export declare function callout(type: CalloutType, content: string | TextSpan[]): CalloutBlock;
107
- export declare const infoCallout: (content: string | TextSpan[]) => CalloutBlock;
108
- export declare const warningCallout: (content: string | TextSpan[]) => CalloutBlock;
109
- export declare const tipCallout: (content: string | TextSpan[]) => CalloutBlock;
110
- export declare const dangerCallout: (content: string | TextSpan[]) => CalloutBlock;
111
- export declare const noteCallout: (content: string | TextSpan[]) => CalloutBlock;
112
- /**
113
- * Creates: table block
114
- */
115
- export declare function table(headers: string[], rows: string[][], alignments?: ('left' | 'center' | 'right' | null)[]): TableBlock;
116
- /**
117
- * Adds: content to an existing block
118
- */
119
- export declare function appendContent<T extends BlockType>(block: Block<T>, ...newSpans: TextSpan[]): Block<T>;
120
- /**
121
- * Prepends: content to an existing block
122
- */
123
- export declare function prependContent<T extends BlockType>(block: Block<T>, ...newSpans: TextSpan[]): Block<T>;
124
- /**
125
- * Replaces: the content of a block
126
- */
127
- export declare function setContent<T extends BlockType>(block: Block<T>, content: TextSpan[]): Block<T>;
128
- /**
129
- * Adds: children to a block
130
- */
131
- export declare function addChildren<T extends BlockType>(block: Block<T>, ...newChildren: Block[]): Block<T>;
132
- /**
133
- * Updates: block properties
134
- */
135
- export declare function updateProps<T extends BlockType>(block: Block<T>, props: Partial<Block<T>['props']>): Block<T>;
136
- //# sourceMappingURL=blocks.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"blocks.d.ts","sourceRoot":"","sources":["../../src/core/blocks.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACV,KAAK,EACL,SAAS,EACT,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,eAAe,EACf,UAAU,EACV,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,UAAU,EACX,MAAM,UAAU,CAAC;AAOlB;;GAEG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,SAAS,EAC7C,IAAI,EAAE,CAAC,EACP,OAAO,GAAE,QAAQ,EAAO,EACxB,KAAK,GAAE,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,CAA2B,EAClD,QAAQ,GAAE,KAAK,EAAO,GACrB,KAAK,CAAC,CAAC,CAAC,CAQV;AAMD;;GAEG;AACH,wBAAgB,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,QAAQ,CAE9C;AAED;;GAEG;AACH,wBAAgB,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,QAAQ,CAE9C;AAED;;GAEG;AACH,wBAAgB,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,QAAQ,CAEhD;AAED;;GAEG;AACH,wBAAgB,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,QAAQ,CAE9C;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,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