Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/buildMarksTree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ import type {
PortableTextMarkDefinition,
} from '@portabletext/types'

import type {ToolkitNestedPortableTextSpan, ToolkitTextNode} from './types'

import {isPortableTextSpan} from './asserters'
import {sortMarksByOccurences} from './sortMarksByOccurences'
import type {ToolkitNestedPortableTextSpan, ToolkitTextNode} from './types'

/**
* Takes a Portable Text block and returns a nested tree of nodes optimized for rendering
Expand Down
11 changes: 5 additions & 6 deletions src/nestLists.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import type {PortableTextBlock, PortableTextListItemBlock, TypedObject} from '@portabletext/types'

import {
isPortableTextListItemBlock,
isPortableTextSpan,
isPortableTextToolkitList,
} from './asserters'
import type {
ToolkitListNestMode,
ToolkitPortableTextDirectList,
Expand All @@ -8,12 +13,6 @@ import type {
ToolkitPortableTextListItem,
} from './types'

import {
isPortableTextListItemBlock,
isPortableTextSpan,
isPortableTextToolkitList,
} from './asserters'

export type ToolkitNestListsOutputNode<T> =
| T
| ToolkitPortableTextHtmlList
Expand Down
3 changes: 1 addition & 2 deletions src/spanToPlainText.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type {ToolkitNestedPortableTextSpan} from './types'

import {isPortableTextToolkitSpan, isPortableTextToolkitTextNode} from './asserters'
import type {ToolkitNestedPortableTextSpan} from './types'

/**
* Returns the plain-text representation of a
Expand Down
3 changes: 1 addition & 2 deletions test/buildMarksTree.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type {PortableTextBlock} from '@portabletext/types'

import {buildMarksTree} from '@portabletext/toolkit'
import type {PortableTextBlock} from '@portabletext/types'
import {expect, test} from 'vitest'

test('buildMarksTree: returns empty tree on empty blocks', () => {
Expand Down
3 changes: 1 addition & 2 deletions test/nestLists.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type {PortableTextListItemBlock} from '@portabletext/types'

import {LIST_NEST_MODE_DIRECT, LIST_NEST_MODE_HTML, nestLists} from '@portabletext/toolkit'
import type {PortableTextListItemBlock} from '@portabletext/types'
import {expect, test} from 'vitest'

test('nestLists: returns empty tree on no blocks', () => {
Expand Down
3 changes: 1 addition & 2 deletions test/sortMarksByOccurences.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type {PortableTextBlock} from '@portabletext/types'

import {sortMarksByOccurences} from '@portabletext/toolkit'
import type {PortableTextBlock} from '@portabletext/types'
import {expect, test} from 'vitest'

test('sortMarksByOccurences: sorts correctly', () => {
Expand Down