create-markdown 0.2.0 → 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.0",
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,32 +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
- "prepublish": "bun run clean && bun run build",
66
- "publish": "bun publish --access public",
67
- "deploy": "./deploy.sh",
68
- "playground": "bun run build && cd playground && bun dev",
69
- "playground:install": "cd playground && bun install",
70
74
  "typecheck": "tsc --noEmit"
71
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
+ },
72
81
  "devDependencies": {
73
82
  "@types/react": "^18.2.0",
74
83
  "react": "^18.2.0",
75
84
  "typescript": "^5.3.0"
76
85
  },
77
86
  "peerDependencies": {
78
- "react": ">=18.0.0"
87
+ "react": ">=18.0.0",
88
+ "shiki": ">=1.0.0",
89
+ "mermaid": ">=10.0.0"
79
90
  },
80
91
  "peerDependenciesMeta": {
81
92
  "react": {
82
93
  "optional": true
94
+ },
95
+ "shiki": {
96
+ "optional": true
97
+ },
98
+ "mermaid": {
99
+ "optional": true
83
100
  }
84
101
  },
85
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,253 +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
- - 🪶 **Zero dependencies** - Core package has no runtime dependencies
17
- - 🔒 **Full TypeScript** - Complete type definitions with generics
18
-
19
- ## Installation
20
-
21
- ```bash
22
- # Using bun (recommended)
23
- bun add create-markdown
24
-
25
- # Using npm
26
- npm install create-markdown
27
-
28
- # Using yarn
29
- yarn add create-markdown
30
-
31
- # Using pnpm
32
- pnpm add create-markdown
33
- ```
34
-
35
- ## Quick Start
36
-
37
- ### Parse Markdown to Blocks
38
-
39
- ```typescript
40
- import { parse } from 'create-markdown';
41
-
42
- const blocks = parse(`# Hello World
43
-
44
- This is **bold** and *italic* text.
45
-
46
- - Item one
47
- - Item two
48
- `);
49
-
50
- console.log(blocks);
51
- // [
52
- // { type: 'heading', props: { level: 1 }, content: [...] },
53
- // { type: 'paragraph', content: [...] },
54
- // { type: 'bulletList', children: [...] }
55
- // ]
56
- ```
57
-
58
- ### Create Blocks Programmatically
59
-
60
- ```typescript
61
- import { h1, paragraph, bulletList, bold, italic, spans } from 'create-markdown';
62
-
63
- const blocks = [
64
- h1('My Document'),
65
- paragraph(spans(
66
- bold('Important: '),
67
- { text: 'This is ', styles: {} },
68
- italic('really'),
69
- { text: ' cool!', styles: {} }
70
- )),
71
- bulletList(['First item', 'Second item', 'Third item']),
72
- ];
73
- ```
74
-
75
- ### Serialize Blocks to Markdown
76
-
77
- ```typescript
78
- import { stringify, h1, paragraph, codeBlock } from 'create-markdown';
79
-
80
- const markdown = stringify([
81
- h1('Hello'),
82
- paragraph('World'),
83
- codeBlock('console.log("Hi!");', 'javascript'),
84
- ]);
85
-
86
- console.log(markdown);
87
- // # Hello
88
- //
89
- // World
90
- //
91
- // ```javascript
92
- // console.log("Hi!");
93
- // ```
94
- ```
95
-
96
- ### Document Management
97
-
98
- ```typescript
99
- import {
100
- createDocument,
101
- appendBlock,
102
- removeBlock,
103
- findBlock,
104
- paragraph
105
- } from 'create-markdown';
106
-
107
- // Create a document
108
- let doc = createDocument([paragraph('First paragraph')]);
109
-
110
- // Add a block
111
- doc = appendBlock(doc, paragraph('Second paragraph'));
112
-
113
- // Find a block
114
- const block = findBlock(doc, 'some-id');
115
-
116
- // Remove a block
117
- doc = removeBlock(doc, 'some-id');
118
- ```
119
-
120
- ## React Components
121
-
122
- Optional React bindings are available via a separate import:
123
-
124
- ```tsx
125
- import { BlockRenderer, useDocument, useMarkdown } from 'create-markdown/react';
126
- import { paragraph, h1 } from 'create-markdown/react';
127
-
128
- function Editor() {
129
- const { blocks, appendBlock, toMarkdown } = useDocument();
130
-
131
- return (
132
- <div>
133
- <BlockRenderer blocks={blocks} />
134
- <button onClick={() => appendBlock(paragraph('New paragraph'))}>
135
- Add Paragraph
136
- </button>
137
- <button onClick={() => console.log(toMarkdown())}>
138
- Export Markdown
139
- </button>
140
- </div>
141
- );
142
- }
143
-
144
- function MarkdownEditor() {
145
- const { markdown, blocks, setMarkdown } = useMarkdown('# Hello');
146
-
147
- return (
148
- <div>
149
- <textarea
150
- value={markdown}
151
- onChange={(e) => setMarkdown(e.target.value)}
152
- />
153
- <BlockRenderer blocks={blocks} />
154
- </div>
155
- );
156
- }
157
- ```
158
-
159
- ## Block Types
160
-
161
- | Type | Factory Function | Description |
162
- |------|-----------------|-------------|
163
- | `paragraph` | `paragraph(content)` | Text paragraph |
164
- | `heading` | `heading(level, content)` or `h1`-`h6` | Heading levels 1-6 |
165
- | `bulletList` | `bulletList(items)` | Unordered list |
166
- | `numberedList` | `numberedList(items)` | Ordered list |
167
- | `checkList` | `checkList(items)` | Task list with checkboxes |
168
- | `codeBlock` | `codeBlock(code, language?)` | Fenced code block |
169
- | `blockquote` | `blockquote(content)` | Block quote |
170
- | `image` | `image(url, alt?)` | Image |
171
- | `divider` | `divider()` | Horizontal rule |
172
- | `table` | `table(headers, rows)` | Table with headers |
173
- | `callout` | `callout(type, content)` | Callout/admonition |
174
-
175
- ## Inline Styles
176
-
177
- ```typescript
178
- import { bold, italic, code, link, strikethrough, highlight } from 'create-markdown';
179
-
180
- // Create styled text spans
181
- const content = [
182
- bold('Bold text'),
183
- italic('Italic text'),
184
- code('inline code'),
185
- link('Click here', 'https://example.com'),
186
- strikethrough('deleted'),
187
- highlight('highlighted'),
188
- ];
189
- ```
190
-
191
- ## API Reference
192
-
193
- ### Parsing
194
-
195
- - `parse(markdown)` - Parse markdown string to blocks
196
- - `markdownToBlocks(markdown, options?)` - Full parser with options
197
- - `markdownToDocument(markdown)` - Parse to a Document object
198
-
199
- ### Serialization
200
-
201
- - `stringify(blocks)` - Serialize blocks to markdown
202
- - `blocksToMarkdown(blocks, options?)` - Full serializer with options
203
- - `documentToMarkdown(doc)` - Serialize a Document
204
-
205
- ### Document Operations
206
-
207
- - `createDocument(blocks?, options?)` - Create a new document
208
- - `insertBlock(doc, block, index?)` - Insert block at position
209
- - `appendBlock(doc, block)` - Add block at end
210
- - `removeBlock(doc, blockId)` - Remove block by ID
211
- - `updateBlock(doc, blockId, updates)` - Update block properties
212
- - `moveBlock(doc, blockId, newIndex)` - Reorder blocks
213
- - `findBlock(doc, blockId)` - Find block by ID
214
-
215
- ### React Hooks
216
-
217
- - `useDocument(initialBlocks?)` - Full document state management
218
- - `useMarkdown(initialMarkdown?)` - Bidirectional markdown/blocks
219
- - `useBlockEditor(doc)` - Selection and editing operations
220
-
221
- ## Development
222
-
223
- ```bash
224
- # Install dependencies
225
- bun install
226
-
227
- # Build the package
228
- bun run build
229
-
230
- # Type check
231
- bun run typecheck
232
-
233
- # Run the playground
234
- bun run playground
235
- ```
236
-
237
- ## Requirements
238
-
239
- - Node.js 20+
240
- - Bun 1.0+ (for development)
241
- - React 18+ (optional, for React components)
242
-
243
- ## Contributing
244
-
245
- We welcome contributions! Please see [CONTRIBUTING.md](./CONTRIBUTING.md) for guidelines.
246
-
247
- ## Changelog
248
-
249
- See [CHANGELOG.md](./CHANGELOG.md) for release history.
250
-
251
- ## License
252
-
253
- 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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