Skip to content

Commit

Permalink
Merge pull request microsoft#2728 from microsoft/u/xiameng/expose-spl…
Browse files Browse the repository at this point in the history
…it-text-api

Expose splittext api
  • Loading branch information
FrancisMengx authored Jun 26, 2024
2 parents a69e21a + 8a2ed84 commit da46dcb
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 11 deletions.
1 change: 1 addition & 0 deletions packages/roosterjs-content-model-api/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export { setTextColor } from './publicApi/segment/setTextColor';
export { changeFontSize } from './publicApi/segment/changeFontSize';
export { applySegmentFormat } from './publicApi/segment/applySegmentFormat';
export { changeCapitalization } from './publicApi/segment/changeCapitalization';
export { splitTextSegment } from './publicApi/segment/splitTextSegment';
export { insertImage } from './publicApi/image/insertImage';
export { setListStyle } from './publicApi/list/setListStyle';
export { setListStartNumber } from './publicApi/list/setListStartNumber';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ import type {
} from 'roosterjs-content-model-types';

/**
* @internal
* Split given text segments from the given range
* @param textSegment segment to split
* @param parent parent paragraph the text segment exist in
* @param start starting point of the split
* @param end ending point of the split
* @returns text segment from the indicated split.
*/
export function splitTextSegment(
textSegment: ContentModelText,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ContentModelParagraph, ContentModelText } from 'roosterjs-content-model-types';
import { splitTextSegment } from '../../lib/pluginUtils/splitTextSegment';
import { splitTextSegment } from '../../../lib/publicApi/segment/splitTextSegment';

describe('splitTextSegment', () => {
function runTest(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { splitTextSegment } from '../../pluginUtils/splitTextSegment';
import { splitTextSegment } from 'roosterjs-content-model-api';
import type {
ContentModelText,
FormatContentModelContext,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { matchLink } from 'roosterjs-content-model-api';
import { splitTextSegment } from '../../pluginUtils/splitTextSegment';
import { matchLink, splitTextSegment } from 'roosterjs-content-model-api';
import type {
ContentModelText,
FormatContentModelContext,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { splitTextSegment } from '../../pluginUtils/splitTextSegment';
import { splitTextSegment } from 'roosterjs-content-model-api';
import type {
ContentModelText,
FormatContentModelContext,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { splitTextSegment } from '../../pluginUtils/splitTextSegment';
import { splitTextSegment } from 'roosterjs-content-model-api';
import type {
ContentModelText,
FormatContentModelContext,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { formatTextSegmentBeforeSelectionMarker } from 'roosterjs-content-model-api';
import { splitTextSegment } from '../../pluginUtils/splitTextSegment';

import {
formatTextSegmentBeforeSelectionMarker,
splitTextSegment,
} from 'roosterjs-content-model-api';
import type {
ContentModelCodeFormat,
ContentModelSegmentFormat,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { splitTextSegment } from '../pluginUtils/splitTextSegment';
import { splitTextSegment } from 'roosterjs-content-model-api';
import type {
ContentModelText,
ShallowMutableContentModelParagraph,
Expand Down

0 comments on commit da46dcb

Please sign in to comment.