@blocksuite/virgo
Advanced tools
Comparing version 0.4.0-20230209220133-3a31da9 to 0.4.0-20230210031655-264744e
import type { DeltaInsert } from '../types.js'; | ||
export declare function transformDelta(delta: DeltaInsert): (DeltaInsert | '\n')[]; | ||
/** | ||
* convert a delta insert array to chunks, each chunk is a line | ||
*/ | ||
export declare function deltaInsersToChunks(delta: DeltaInsert[]): DeltaInsert[][]; | ||
export declare function deltaInsertsToChunks(delta: DeltaInsert[]): DeltaInsert[][]; | ||
//# sourceMappingURL=convert.d.ts.map |
@@ -1,3 +0,2 @@ | ||
// TODO unit test | ||
function transformDelta(delta) { | ||
export function transformDelta(delta) { | ||
const result = []; | ||
@@ -28,3 +27,3 @@ let tmpString = delta.insert; | ||
*/ | ||
export function deltaInsersToChunks(delta) { | ||
export function deltaInsertsToChunks(delta) { | ||
if (delta.length === 0) { | ||
@@ -31,0 +30,0 @@ return [[]]; |
@@ -5,3 +5,3 @@ import { assertExists, Signal } from '@blocksuite/global/utils'; | ||
import { ZERO_WIDTH_SPACE } from './constant.js'; | ||
import { deltaInsersToChunks } from './utils/convert.js'; | ||
import { deltaInsertsToChunks } from './utils/convert.js'; | ||
import { baseRenderElement } from './utils/render.js'; | ||
@@ -580,3 +580,3 @@ export class VEditor { | ||
function renderDeltas(deltas, rootElement, render) { | ||
const chunks = deltaInsersToChunks(deltas); | ||
const chunks = deltaInsertsToChunks(deltas); | ||
// every chunk is a line | ||
@@ -583,0 +583,0 @@ const lines = []; |
{ | ||
"name": "@blocksuite/virgo", | ||
"version": "0.4.0-20230209220133-3a31da9", | ||
"version": "0.4.0-20230210031655-264744e", | ||
"description": "A micro editor.", | ||
@@ -26,3 +26,3 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@blocksuite/global": "0.4.0-20230209220133-3a31da9", | ||
"@blocksuite/global": "0.4.0-20230210031655-264744e", | ||
"zod": "^3.20.2" | ||
@@ -32,5 +32,9 @@ }, | ||
"build": "tsc", | ||
"test": "playwright test" | ||
"test:unit": "vitest --run", | ||
"test:unit:coverage": "vitest run --coverage", | ||
"test:unit:ui": "vitest --ui", | ||
"test:e2e": "playwright test", | ||
"test": "pnpm test:unit && pnpm test:e2e" | ||
}, | ||
"types": "dist/index.d.ts" | ||
} |
import type { DeltaInsert } from '../types.js'; | ||
// TODO unit test | ||
function transformDelta(delta: DeltaInsert): (DeltaInsert | '\n')[] { | ||
export function transformDelta(delta: DeltaInsert): (DeltaInsert | '\n')[] { | ||
const result: (DeltaInsert | '\n')[] = []; | ||
@@ -35,3 +34,3 @@ | ||
*/ | ||
export function deltaInsersToChunks(delta: DeltaInsert[]): DeltaInsert[][] { | ||
export function deltaInsertsToChunks(delta: DeltaInsert[]): DeltaInsert[][] { | ||
if (delta.length === 0) { | ||
@@ -38,0 +37,0 @@ return [[]]; |
@@ -8,3 +8,3 @@ import { assertExists, Signal } from '@blocksuite/global/utils'; | ||
import type { DeltaInsert, TextAttributes, TextElement } from './types.js'; | ||
import { deltaInsersToChunks } from './utils/convert.js'; | ||
import { deltaInsertsToChunks } from './utils/convert.js'; | ||
import { baseRenderElement } from './utils/render.js'; | ||
@@ -808,3 +808,3 @@ | ||
) { | ||
const chunks = deltaInsersToChunks(deltas); | ||
const chunks = deltaInsertsToChunks(deltas); | ||
@@ -811,0 +811,0 @@ // every chunk is a line |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
219971
77
2909
+ Added@blocksuite/global@0.4.0-20230210031655-264744e(transitive)
- Removed@blocksuite/global@0.4.0-20230209220133-3a31da9(transitive)