vuewrite 1.0.0 → 1.0.1

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.
@@ -1,14 +1,25 @@
1
- import { Block } from 'vuewrite-markdown';
2
- import { blocksToMarkdown } from 'vuewrite-markdown';
3
- import { markdownToBlocks } from 'vuewrite-markdown';
4
- import { Style } from 'vuewrite-markdown';
1
+ export declare type Block = {
2
+ id: string;
3
+ text: string;
4
+ type?: string;
5
+ styles?: Style[];
6
+ editable?: boolean;
7
+ [key: string]: unknown;
8
+ };
5
9
 
6
- export { Block }
10
+ export declare const blocksToMarkdown: (blocks: Block[], options?: {
11
+ softBreaks?: boolean;
12
+ }) => string;
7
13
 
8
- export { blocksToMarkdown }
14
+ export declare const markdownToBlocks: (markdown: string, previousBlocks?: Block[], options?: {
15
+ softBreaks?: boolean;
16
+ }) => Block[];
9
17
 
10
- export { markdownToBlocks }
11
-
12
- export { Style }
18
+ export declare type Style = {
19
+ start: number;
20
+ end: number;
21
+ style: string;
22
+ meta?: Record<string, unknown>;
23
+ };
13
24
 
14
25
  export { }
package/dist/markdown.js CHANGED
@@ -1,6 +1,6 @@
1
1
  let _counter = 0;
2
2
  const uid = () => (++_counter).toString();
3
- function markdownToBlocks(markdown, previousBlocks = [], options = {}) {
3
+ function markdownToBlocks$1(markdown, previousBlocks = [], options = {}) {
4
4
  const raw = parseBlocks(markdown.split("\n"), options.softBreaks ?? false);
5
5
  return reconcileIds(raw, previousBlocks);
6
6
  }
@@ -227,7 +227,7 @@ const MARKERS = {
227
227
  };
228
228
  const STANDARD_FIELDS = /* @__PURE__ */ new Set(["id", "text", "type", "styles", "editable"]);
229
229
  const isListType = (type) => type === "li" || type === "ol";
230
- function blocksToMarkdown(blocks, options = {}) {
230
+ function blocksToMarkdown$1(blocks, options = {}) {
231
231
  const parts = [];
232
232
  let olCounter = 0;
233
233
  for (const block of blocks) {
@@ -368,6 +368,8 @@ function renderInline(text, styles) {
368
368
  }
369
369
  return result;
370
370
  }
371
+ const markdownToBlocks = markdownToBlocks$1;
372
+ const blocksToMarkdown = blocksToMarkdown$1;
371
373
  export {
372
374
  blocksToMarkdown,
373
375
  markdownToBlocks
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "vuewrite",
3
3
  "description": "Rich Text Editor based on Vue3 reactivity",
4
4
  "private": false,
5
- "version": "1.0.0",
5
+ "version": "1.0.1",
6
6
  "type": "module",
7
7
  "license": "MIT",
8
8
  "author": "den59k",