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.
- package/dist/markdown.d.ts +20 -9
- package/dist/markdown.js +4 -2
- package/package.json +1 -1
package/dist/markdown.d.ts
CHANGED
|
@@ -1,14 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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
|
|
10
|
+
export declare const blocksToMarkdown: (blocks: Block[], options?: {
|
|
11
|
+
softBreaks?: boolean;
|
|
12
|
+
}) => string;
|
|
7
13
|
|
|
8
|
-
export
|
|
14
|
+
export declare const markdownToBlocks: (markdown: string, previousBlocks?: Block[], options?: {
|
|
15
|
+
softBreaks?: boolean;
|
|
16
|
+
}) => Block[];
|
|
9
17
|
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
|
|
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
|