@reiwuzen/blocky 1.4.1 → 1.4.2
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/dist/index.cjs +2 -0
- package/dist/index.d.cts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -37,6 +37,7 @@ __export(index_exports, {
|
|
|
37
37
|
duplicateBlock: () => duplicateBlock,
|
|
38
38
|
duplicateBlockAfter: () => duplicateBlockAfter,
|
|
39
39
|
formatNodes: () => formatNodes,
|
|
40
|
+
formatParagraphBlock: () => stripPrefix,
|
|
40
41
|
generateId: () => generateId,
|
|
41
42
|
indentBlock: () => indentBlock,
|
|
42
43
|
insertAt: () => insertAt,
|
|
@@ -894,6 +895,7 @@ var currentBlocks = (history) => history.present.blocks;
|
|
|
894
895
|
duplicateBlock,
|
|
895
896
|
duplicateBlockAfter,
|
|
896
897
|
formatNodes,
|
|
898
|
+
formatParagraphBlock,
|
|
897
899
|
generateId,
|
|
898
900
|
indentBlock,
|
|
899
901
|
insertAt,
|
package/dist/index.d.cts
CHANGED
|
@@ -118,6 +118,7 @@ type TransformResult = {
|
|
|
118
118
|
/** true if the block type was actually changed, false if no trigger matched */
|
|
119
119
|
converted: boolean;
|
|
120
120
|
};
|
|
121
|
+
declare function stripPrefix(block: Block<"paragraph">, prefix: string): Block<"paragraph">["content"];
|
|
121
122
|
/**
|
|
122
123
|
* Attempt to convert a paragraph block into another type based on a
|
|
123
124
|
* Markdown-style prefix typed by the user.
|
|
@@ -322,4 +323,4 @@ declare function duplicateBlockAfter(blocks: AnyBlock[], id: string, newId?: str
|
|
|
322
323
|
*/
|
|
323
324
|
declare function moveBlock(blocks: AnyBlock[], id: string, direction: "up" | "down"): Result<AnyBlock[], string>;
|
|
324
325
|
|
|
325
|
-
export { type AnyBlock, type Block, type BlockContent, type BlockMeta, type BlockType, type History, type HistoryEntry, type Node, type NodeSelection, applyMarkdownTransform, areBlocksSame, canRedo, canUndo, changeBlockType, createBlock, createBlockAfter, createHistory, currentBlocks, deleteBlock, deleteLastChar, deleteRange, deserialize, deserializeNodes, duplicateBlock, duplicateBlockAfter, formatNodes, generateId, indentBlock, insertAt, insertBlockAfter, mergeAdjacentNodes, mergeBlocks, moveBlock, outdentBlock, push, redo, removeLink, replaceRange, serialize, serializeNodes, setLink, splitBlock, toMarkdown, toPlainText, toggleBold, toggleColor, toggleHighlight, toggleItalic, toggleStrikethrough, toggleTodo, toggleUnderline, undo };
|
|
326
|
+
export { type AnyBlock, type Block, type BlockContent, type BlockMeta, type BlockType, type History, type HistoryEntry, type Node, type NodeSelection, applyMarkdownTransform, areBlocksSame, canRedo, canUndo, changeBlockType, createBlock, createBlockAfter, createHistory, currentBlocks, deleteBlock, deleteLastChar, deleteRange, deserialize, deserializeNodes, duplicateBlock, duplicateBlockAfter, formatNodes, stripPrefix as formatParagraphBlock, generateId, indentBlock, insertAt, insertBlockAfter, mergeAdjacentNodes, mergeBlocks, moveBlock, outdentBlock, push, redo, removeLink, replaceRange, serialize, serializeNodes, setLink, splitBlock, toMarkdown, toPlainText, toggleBold, toggleColor, toggleHighlight, toggleItalic, toggleStrikethrough, toggleTodo, toggleUnderline, undo };
|
package/dist/index.d.ts
CHANGED
|
@@ -118,6 +118,7 @@ type TransformResult = {
|
|
|
118
118
|
/** true if the block type was actually changed, false if no trigger matched */
|
|
119
119
|
converted: boolean;
|
|
120
120
|
};
|
|
121
|
+
declare function stripPrefix(block: Block<"paragraph">, prefix: string): Block<"paragraph">["content"];
|
|
121
122
|
/**
|
|
122
123
|
* Attempt to convert a paragraph block into another type based on a
|
|
123
124
|
* Markdown-style prefix typed by the user.
|
|
@@ -322,4 +323,4 @@ declare function duplicateBlockAfter(blocks: AnyBlock[], id: string, newId?: str
|
|
|
322
323
|
*/
|
|
323
324
|
declare function moveBlock(blocks: AnyBlock[], id: string, direction: "up" | "down"): Result<AnyBlock[], string>;
|
|
324
325
|
|
|
325
|
-
export { type AnyBlock, type Block, type BlockContent, type BlockMeta, type BlockType, type History, type HistoryEntry, type Node, type NodeSelection, applyMarkdownTransform, areBlocksSame, canRedo, canUndo, changeBlockType, createBlock, createBlockAfter, createHistory, currentBlocks, deleteBlock, deleteLastChar, deleteRange, deserialize, deserializeNodes, duplicateBlock, duplicateBlockAfter, formatNodes, generateId, indentBlock, insertAt, insertBlockAfter, mergeAdjacentNodes, mergeBlocks, moveBlock, outdentBlock, push, redo, removeLink, replaceRange, serialize, serializeNodes, setLink, splitBlock, toMarkdown, toPlainText, toggleBold, toggleColor, toggleHighlight, toggleItalic, toggleStrikethrough, toggleTodo, toggleUnderline, undo };
|
|
326
|
+
export { type AnyBlock, type Block, type BlockContent, type BlockMeta, type BlockType, type History, type HistoryEntry, type Node, type NodeSelection, applyMarkdownTransform, areBlocksSame, canRedo, canUndo, changeBlockType, createBlock, createBlockAfter, createHistory, currentBlocks, deleteBlock, deleteLastChar, deleteRange, deserialize, deserializeNodes, duplicateBlock, duplicateBlockAfter, formatNodes, stripPrefix as formatParagraphBlock, generateId, indentBlock, insertAt, insertBlockAfter, mergeAdjacentNodes, mergeBlocks, moveBlock, outdentBlock, push, redo, removeLink, replaceRange, serialize, serializeNodes, setLink, splitBlock, toMarkdown, toPlainText, toggleBold, toggleColor, toggleHighlight, toggleItalic, toggleStrikethrough, toggleTodo, toggleUnderline, undo };
|
package/dist/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reiwuzen/blocky",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.2",
|
|
4
4
|
"description": "Pure TypeScript block editor engine. Headless, framework-agnostic — content mutation, formatting, transforms, serialization, and history.",
|
|
5
5
|
"author": "Rei WuZen",
|
|
6
6
|
"license": "ISC",
|