react-native-richify 1.0.0 → 1.0.2
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/lib/commonjs/components/OverlayText.js +2 -2
- package/lib/commonjs/components/OverlayText.js.map +1 -1
- package/lib/commonjs/components/RichTextInput.js +5 -5
- package/lib/commonjs/components/RichTextInput.js.map +1 -1
- package/lib/commonjs/components/Toolbar.js +2 -2
- package/lib/commonjs/components/Toolbar.js.map +1 -1
- package/lib/commonjs/components/ToolbarButton.js +1 -1
- package/lib/commonjs/components/ToolbarButton.js.map +1 -1
- package/lib/commonjs/context/RichTextContext.js +1 -1
- package/lib/commonjs/context/RichTextContext.js.map +1 -1
- package/lib/commonjs/hooks/useFormatting.js +1 -1
- package/lib/commonjs/hooks/useRichText.js +4 -4
- package/lib/commonjs/index.d.js +12 -12
- package/lib/commonjs/index.js +12 -12
- package/lib/commonjs/utils/formatter.d.js +1 -1
- package/lib/commonjs/utils/formatter.js +2 -2
- package/lib/commonjs/utils/parser.js +1 -1
- package/lib/commonjs/utils/styleMapper.js +1 -1
- package/lib/module/components/OverlayText.js +2 -2
- package/lib/module/components/OverlayText.js.map +1 -1
- package/lib/module/components/RichTextInput.js +5 -5
- package/lib/module/components/RichTextInput.js.map +1 -1
- package/lib/module/components/Toolbar.js +2 -2
- package/lib/module/components/Toolbar.js.map +1 -1
- package/lib/module/components/ToolbarButton.js +1 -1
- package/lib/module/components/ToolbarButton.js.map +1 -1
- package/lib/module/context/RichTextContext.js +1 -1
- package/lib/module/context/RichTextContext.js.map +1 -1
- package/lib/module/hooks/useFormatting.js +1 -1
- package/lib/module/hooks/useFormatting.js.map +1 -1
- package/lib/module/hooks/useRichText.js +4 -4
- package/lib/module/hooks/useRichText.js.map +1 -1
- package/lib/module/index.d.js +12 -12
- package/lib/module/index.js +12 -12
- package/lib/module/utils/formatter.d.js +1 -1
- package/lib/module/utils/formatter.d.js.map +1 -1
- package/lib/module/utils/formatter.js +3 -3
- package/lib/module/utils/formatter.js.map +1 -1
- package/lib/module/utils/parser.js +1 -1
- package/lib/module/utils/parser.js.map +1 -1
- package/lib/module/utils/styleMapper.js +1 -1
- package/lib/module/utils/styleMapper.js.map +1 -1
- package/lib/typescript/src/components/OverlayText.d.ts +1 -1
- package/lib/typescript/src/components/OverlayText.d.ts.map +1 -1
- package/lib/typescript/src/components/RichTextInput.d.ts +1 -1
- package/lib/typescript/src/components/RichTextInput.d.ts.map +1 -1
- package/lib/typescript/src/components/Toolbar.d.ts +1 -1
- package/lib/typescript/src/components/Toolbar.d.ts.map +1 -1
- package/lib/typescript/src/components/ToolbarButton.d.ts +1 -1
- package/lib/typescript/src/components/ToolbarButton.d.ts.map +1 -1
- package/lib/typescript/src/constants/defaultStyles.d.ts +1 -1
- package/lib/typescript/src/constants/defaultStyles.d.ts.map +1 -1
- package/lib/typescript/src/context/RichTextContext.d.ts +2 -2
- package/lib/typescript/src/context/RichTextContext.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useFormatting.d.ts +1 -1
- package/lib/typescript/src/hooks/useFormatting.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useRichText.d.ts +1 -1
- package/lib/typescript/src/hooks/useRichText.d.ts.map +1 -1
- package/lib/typescript/src/hooks/useSelection.d.ts +1 -1
- package/lib/typescript/src/hooks/useSelection.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +15 -15
- package/lib/typescript/src/utils/formatter.d.ts +2 -2
- package/lib/typescript/src/utils/formatter.d.ts.map +1 -1
- package/lib/typescript/src/utils/parser.d.ts +1 -1
- package/lib/typescript/src/utils/parser.d.ts.map +1 -1
- package/lib/typescript/src/utils/styleMapper.d.ts +1 -1
- package/lib/typescript/src/utils/styleMapper.d.ts.map +1 -1
- package/package.json +11 -10
- package/src/components/OverlayText.d.ts +1 -1
- package/src/components/OverlayText.tsx +3 -3
- package/src/components/RichTextInput.d.ts +1 -1
- package/src/components/RichTextInput.tsx +6 -6
- package/src/components/Toolbar.tsx +3 -3
- package/src/components/ToolbarButton.tsx +7 -7
- package/src/constants/defaultStyles.ts +1 -1
- package/src/context/RichTextContext.d.ts +2 -2
- package/src/context/RichTextContext.tsx +3 -3
- package/src/hooks/useFormatting.d.ts +2 -2
- package/src/hooks/useFormatting.ts +2 -2
- package/src/hooks/useRichText.d.ts +1 -1
- package/src/hooks/useRichText.ts +5 -5
- package/src/hooks/useSelection.d.ts +1 -1
- package/src/hooks/useSelection.ts +1 -1
- package/src/index.d.ts +15 -15
- package/src/index.ts +15 -15
- package/src/utils/formatter.d.ts +2 -2
- package/src/utils/formatter.ts +4 -4
- package/src/utils/parser.d.ts +1 -1
- package/src/utils/parser.ts +2 -2
- package/src/utils/styleMapper.d.ts +1 -1
- package/src/utils/styleMapper.ts +2 -2
package/src/index.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
export { RichTextInput } from '
|
|
2
|
-
export { OverlayText } from '
|
|
3
|
-
export { Toolbar } from '
|
|
4
|
-
export { ToolbarButton } from '
|
|
5
|
-
export { useRichText } from '
|
|
6
|
-
export type { UseRichTextOptions } from '
|
|
7
|
-
export { useSelection } from '
|
|
8
|
-
export { useFormatting } from '
|
|
9
|
-
export { RichTextProvider, useRichTextContext, } from '
|
|
10
|
-
export type { RichTextProviderProps } from '
|
|
11
|
-
export { createSegment, segmentsToPlainText, getTotalLength, mergeAdjacentSegments, reconcileTextChange, } from '
|
|
12
|
-
export { toggleFormatOnSelection, setStyleOnSelection, setHeadingOnLine, isFormatActiveInSelection, getSelectionStyle, } from '
|
|
13
|
-
export { formatStyleToTextStyle, segmentToTextStyle, segmentsToTextStyles, } from '
|
|
14
|
-
export { DEFAULT_COLORS, DEFAULT_THEME, DEFAULT_TOOLBAR_ITEMS, DEFAULT_BASE_TEXT_STYLE, HEADING_FONT_SIZES, EMPTY_FORMAT_STYLE, } from '
|
|
15
|
-
export type { FormatType, HeadingLevel, ListType, FormatStyle, StyledSegment, SelectionRange, RichTextState, RichTextActions, UseRichTextReturn, RichTextTheme, ToolbarItem, OverlayTextProps, ToolbarButtonProps, ToolbarProps, RichTextInputProps, } from '
|
|
1
|
+
export { RichTextInput } from './components/RichTextInput';
|
|
2
|
+
export { OverlayText } from './components/OverlayText';
|
|
3
|
+
export { Toolbar } from './components/Toolbar';
|
|
4
|
+
export { ToolbarButton } from './components/ToolbarButton';
|
|
5
|
+
export { useRichText } from './hooks/useRichText';
|
|
6
|
+
export type { UseRichTextOptions } from './hooks/useRichText';
|
|
7
|
+
export { useSelection } from './hooks/useSelection';
|
|
8
|
+
export { useFormatting } from './hooks/useFormatting';
|
|
9
|
+
export { RichTextProvider, useRichTextContext, } from './context/RichTextContext';
|
|
10
|
+
export type { RichTextProviderProps } from './context/RichTextContext';
|
|
11
|
+
export { createSegment, segmentsToPlainText, getTotalLength, mergeAdjacentSegments, reconcileTextChange, } from './utils/parser';
|
|
12
|
+
export { toggleFormatOnSelection, setStyleOnSelection, setHeadingOnLine, isFormatActiveInSelection, getSelectionStyle, } from './utils/formatter';
|
|
13
|
+
export { formatStyleToTextStyle, segmentToTextStyle, segmentsToTextStyles, } from './utils/styleMapper';
|
|
14
|
+
export { DEFAULT_COLORS, DEFAULT_THEME, DEFAULT_TOOLBAR_ITEMS, DEFAULT_BASE_TEXT_STYLE, HEADING_FONT_SIZES, EMPTY_FORMAT_STYLE, } from './constants/defaultStyles';
|
|
15
|
+
export type { FormatType, HeadingLevel, ListType, FormatStyle, StyledSegment, SelectionRange, RichTextState, RichTextActions, UseRichTextReturn, RichTextTheme, ToolbarItem, OverlayTextProps, ToolbarButtonProps, ToolbarProps, RichTextInputProps, } from './types';
|
package/src/index.ts
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
// ─── Components ──────────────────────────────────────────────────────────────
|
|
2
|
-
export { RichTextInput } from '
|
|
3
|
-
export { OverlayText } from '
|
|
4
|
-
export { Toolbar } from '
|
|
5
|
-
export { ToolbarButton } from '
|
|
2
|
+
export { RichTextInput } from './components/RichTextInput';
|
|
3
|
+
export { OverlayText } from './components/OverlayText';
|
|
4
|
+
export { Toolbar } from './components/Toolbar';
|
|
5
|
+
export { ToolbarButton } from './components/ToolbarButton';
|
|
6
6
|
|
|
7
7
|
// ─── Hooks ───────────────────────────────────────────────────────────────────
|
|
8
|
-
export { useRichText } from '
|
|
9
|
-
export type { UseRichTextOptions } from '
|
|
10
|
-
export { useSelection } from '
|
|
11
|
-
export { useFormatting } from '
|
|
8
|
+
export { useRichText } from './hooks/useRichText';
|
|
9
|
+
export type { UseRichTextOptions } from './hooks/useRichText';
|
|
10
|
+
export { useSelection } from './hooks/useSelection';
|
|
11
|
+
export { useFormatting } from './hooks/useFormatting';
|
|
12
12
|
|
|
13
13
|
// ─── Context ─────────────────────────────────────────────────────────────────
|
|
14
14
|
export {
|
|
15
15
|
RichTextProvider,
|
|
16
16
|
useRichTextContext,
|
|
17
|
-
} from '
|
|
18
|
-
export type { RichTextProviderProps } from '
|
|
17
|
+
} from './context/RichTextContext';
|
|
18
|
+
export type { RichTextProviderProps } from './context/RichTextContext';
|
|
19
19
|
|
|
20
20
|
// ─── Utilities ───────────────────────────────────────────────────────────────
|
|
21
21
|
export {
|
|
@@ -24,19 +24,19 @@ export {
|
|
|
24
24
|
getTotalLength,
|
|
25
25
|
mergeAdjacentSegments,
|
|
26
26
|
reconcileTextChange,
|
|
27
|
-
} from '
|
|
27
|
+
} from './utils/parser';
|
|
28
28
|
export {
|
|
29
29
|
toggleFormatOnSelection,
|
|
30
30
|
setStyleOnSelection,
|
|
31
31
|
setHeadingOnLine,
|
|
32
32
|
isFormatActiveInSelection,
|
|
33
33
|
getSelectionStyle,
|
|
34
|
-
} from '
|
|
34
|
+
} from './utils/formatter';
|
|
35
35
|
export {
|
|
36
36
|
formatStyleToTextStyle,
|
|
37
37
|
segmentToTextStyle,
|
|
38
38
|
segmentsToTextStyles,
|
|
39
|
-
} from '
|
|
39
|
+
} from './utils/styleMapper';
|
|
40
40
|
|
|
41
41
|
// ─── Constants ───────────────────────────────────────────────────────────────
|
|
42
42
|
export {
|
|
@@ -46,7 +46,7 @@ export {
|
|
|
46
46
|
DEFAULT_BASE_TEXT_STYLE,
|
|
47
47
|
HEADING_FONT_SIZES,
|
|
48
48
|
EMPTY_FORMAT_STYLE,
|
|
49
|
-
} from '
|
|
49
|
+
} from './constants/defaultStyles';
|
|
50
50
|
|
|
51
51
|
// ─── Types ───────────────────────────────────────────────────────────────────
|
|
52
52
|
export type {
|
|
@@ -65,4 +65,4 @@ export type {
|
|
|
65
65
|
ToolbarButtonProps,
|
|
66
66
|
ToolbarProps,
|
|
67
67
|
RichTextInputProps,
|
|
68
|
-
} from '
|
|
68
|
+
} from './types';
|
package/src/utils/formatter.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { StyledSegment, FormatType, FormatStyle, HeadingLevel, SelectionRange } from '
|
|
1
|
+
import type { StyledSegment, FormatType, FormatStyle, HeadingLevel, SelectionRange } from '../types';
|
|
2
2
|
/**
|
|
3
3
|
* Toggle an inline format (bold, italic, etc.) on the selected range.
|
|
4
4
|
*
|
|
@@ -25,4 +25,4 @@ export declare function isFormatActiveInSelection(segments: StyledSegment[], sel
|
|
|
25
25
|
* For properties where segments disagree, the value is undefined.
|
|
26
26
|
*/
|
|
27
27
|
export declare function getSelectionStyle(segments: StyledSegment[], selection: SelectionRange): FormatStyle;
|
|
28
|
-
export { createSegment } from '
|
|
28
|
+
export { createSegment } from '../utils/parser';
|
package/src/utils/formatter.ts
CHANGED
|
@@ -4,15 +4,15 @@ import type {
|
|
|
4
4
|
FormatStyle,
|
|
5
5
|
HeadingLevel,
|
|
6
6
|
SelectionRange,
|
|
7
|
-
} from '
|
|
7
|
+
} from '../types';
|
|
8
8
|
import {
|
|
9
9
|
createSegment,
|
|
10
10
|
findPositionInSegments,
|
|
11
11
|
splitSegment,
|
|
12
12
|
mergeAdjacentSegments,
|
|
13
13
|
segmentsToPlainText,
|
|
14
|
-
} from '
|
|
15
|
-
import { HEADING_FONT_SIZES } from '
|
|
14
|
+
} from '../utils/parser';
|
|
15
|
+
import { HEADING_FONT_SIZES } from '../constants/defaultStyles';
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* Toggle an inline format (bold, italic, etc.) on the selected range.
|
|
@@ -273,4 +273,4 @@ function getLineRange(
|
|
|
273
273
|
}
|
|
274
274
|
|
|
275
275
|
// Re-export for convenience
|
|
276
|
-
export { createSegment } from '
|
|
276
|
+
export { createSegment } from '../utils/parser';
|
package/src/utils/parser.d.ts
CHANGED
package/src/utils/parser.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { StyledSegment, FormatStyle } from '
|
|
2
|
-
import { EMPTY_FORMAT_STYLE } from '
|
|
1
|
+
import type { StyledSegment, FormatStyle } from '../types';
|
|
2
|
+
import { EMPTY_FORMAT_STYLE } from '../constants/defaultStyles';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Creates a new segment with the given text and optional styles.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TextStyle } from 'react-native';
|
|
2
|
-
import type { FormatStyle, RichTextTheme, StyledSegment } from '
|
|
2
|
+
import type { FormatStyle, RichTextTheme, StyledSegment } from '../types';
|
|
3
3
|
/**
|
|
4
4
|
* Maps a FormatStyle to a React Native TextStyle.
|
|
5
5
|
* Applies formatting properties based on the segment's style.
|
package/src/utils/styleMapper.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { TextStyle } from 'react-native';
|
|
2
|
-
import type { FormatStyle, RichTextTheme, StyledSegment } from '
|
|
3
|
-
import { DEFAULT_THEME, HEADING_FONT_SIZES } from '
|
|
2
|
+
import type { FormatStyle, RichTextTheme, StyledSegment } from '../types';
|
|
3
|
+
import { DEFAULT_THEME, HEADING_FONT_SIZES } from '../constants/defaultStyles';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Maps a FormatStyle to a React Native TextStyle.
|