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.
Files changed (91) hide show
  1. package/lib/commonjs/components/OverlayText.js +2 -2
  2. package/lib/commonjs/components/OverlayText.js.map +1 -1
  3. package/lib/commonjs/components/RichTextInput.js +5 -5
  4. package/lib/commonjs/components/RichTextInput.js.map +1 -1
  5. package/lib/commonjs/components/Toolbar.js +2 -2
  6. package/lib/commonjs/components/Toolbar.js.map +1 -1
  7. package/lib/commonjs/components/ToolbarButton.js +1 -1
  8. package/lib/commonjs/components/ToolbarButton.js.map +1 -1
  9. package/lib/commonjs/context/RichTextContext.js +1 -1
  10. package/lib/commonjs/context/RichTextContext.js.map +1 -1
  11. package/lib/commonjs/hooks/useFormatting.js +1 -1
  12. package/lib/commonjs/hooks/useRichText.js +4 -4
  13. package/lib/commonjs/index.d.js +12 -12
  14. package/lib/commonjs/index.js +12 -12
  15. package/lib/commonjs/utils/formatter.d.js +1 -1
  16. package/lib/commonjs/utils/formatter.js +2 -2
  17. package/lib/commonjs/utils/parser.js +1 -1
  18. package/lib/commonjs/utils/styleMapper.js +1 -1
  19. package/lib/module/components/OverlayText.js +2 -2
  20. package/lib/module/components/OverlayText.js.map +1 -1
  21. package/lib/module/components/RichTextInput.js +5 -5
  22. package/lib/module/components/RichTextInput.js.map +1 -1
  23. package/lib/module/components/Toolbar.js +2 -2
  24. package/lib/module/components/Toolbar.js.map +1 -1
  25. package/lib/module/components/ToolbarButton.js +1 -1
  26. package/lib/module/components/ToolbarButton.js.map +1 -1
  27. package/lib/module/context/RichTextContext.js +1 -1
  28. package/lib/module/context/RichTextContext.js.map +1 -1
  29. package/lib/module/hooks/useFormatting.js +1 -1
  30. package/lib/module/hooks/useFormatting.js.map +1 -1
  31. package/lib/module/hooks/useRichText.js +4 -4
  32. package/lib/module/hooks/useRichText.js.map +1 -1
  33. package/lib/module/index.d.js +12 -12
  34. package/lib/module/index.js +12 -12
  35. package/lib/module/utils/formatter.d.js +1 -1
  36. package/lib/module/utils/formatter.d.js.map +1 -1
  37. package/lib/module/utils/formatter.js +3 -3
  38. package/lib/module/utils/formatter.js.map +1 -1
  39. package/lib/module/utils/parser.js +1 -1
  40. package/lib/module/utils/parser.js.map +1 -1
  41. package/lib/module/utils/styleMapper.js +1 -1
  42. package/lib/module/utils/styleMapper.js.map +1 -1
  43. package/lib/typescript/src/components/OverlayText.d.ts +1 -1
  44. package/lib/typescript/src/components/OverlayText.d.ts.map +1 -1
  45. package/lib/typescript/src/components/RichTextInput.d.ts +1 -1
  46. package/lib/typescript/src/components/RichTextInput.d.ts.map +1 -1
  47. package/lib/typescript/src/components/Toolbar.d.ts +1 -1
  48. package/lib/typescript/src/components/Toolbar.d.ts.map +1 -1
  49. package/lib/typescript/src/components/ToolbarButton.d.ts +1 -1
  50. package/lib/typescript/src/components/ToolbarButton.d.ts.map +1 -1
  51. package/lib/typescript/src/constants/defaultStyles.d.ts +1 -1
  52. package/lib/typescript/src/constants/defaultStyles.d.ts.map +1 -1
  53. package/lib/typescript/src/context/RichTextContext.d.ts +2 -2
  54. package/lib/typescript/src/context/RichTextContext.d.ts.map +1 -1
  55. package/lib/typescript/src/hooks/useFormatting.d.ts +1 -1
  56. package/lib/typescript/src/hooks/useFormatting.d.ts.map +1 -1
  57. package/lib/typescript/src/hooks/useRichText.d.ts +1 -1
  58. package/lib/typescript/src/hooks/useRichText.d.ts.map +1 -1
  59. package/lib/typescript/src/hooks/useSelection.d.ts +1 -1
  60. package/lib/typescript/src/hooks/useSelection.d.ts.map +1 -1
  61. package/lib/typescript/src/index.d.ts +15 -15
  62. package/lib/typescript/src/utils/formatter.d.ts +2 -2
  63. package/lib/typescript/src/utils/formatter.d.ts.map +1 -1
  64. package/lib/typescript/src/utils/parser.d.ts +1 -1
  65. package/lib/typescript/src/utils/parser.d.ts.map +1 -1
  66. package/lib/typescript/src/utils/styleMapper.d.ts +1 -1
  67. package/lib/typescript/src/utils/styleMapper.d.ts.map +1 -1
  68. package/package.json +11 -10
  69. package/src/components/OverlayText.d.ts +1 -1
  70. package/src/components/OverlayText.tsx +3 -3
  71. package/src/components/RichTextInput.d.ts +1 -1
  72. package/src/components/RichTextInput.tsx +6 -6
  73. package/src/components/Toolbar.tsx +3 -3
  74. package/src/components/ToolbarButton.tsx +7 -7
  75. package/src/constants/defaultStyles.ts +1 -1
  76. package/src/context/RichTextContext.d.ts +2 -2
  77. package/src/context/RichTextContext.tsx +3 -3
  78. package/src/hooks/useFormatting.d.ts +2 -2
  79. package/src/hooks/useFormatting.ts +2 -2
  80. package/src/hooks/useRichText.d.ts +1 -1
  81. package/src/hooks/useRichText.ts +5 -5
  82. package/src/hooks/useSelection.d.ts +1 -1
  83. package/src/hooks/useSelection.ts +1 -1
  84. package/src/index.d.ts +15 -15
  85. package/src/index.ts +15 -15
  86. package/src/utils/formatter.d.ts +2 -2
  87. package/src/utils/formatter.ts +4 -4
  88. package/src/utils/parser.d.ts +1 -1
  89. package/src/utils/parser.ts +2 -2
  90. package/src/utils/styleMapper.d.ts +1 -1
  91. package/src/utils/styleMapper.ts +2 -2
@@ -1,4 +1,4 @@
1
- import type { SelectionRange } from '@/types';
1
+ import type { SelectionRange } from '../types';
2
2
  /**
3
3
  * Hook for tracking TextInput selection state.
4
4
  *
@@ -1,5 +1,5 @@
1
1
  import { useState, useCallback, useRef } from 'react';
2
- import type { SelectionRange } from '@/types';
2
+ import type { SelectionRange } from '../types';
3
3
 
4
4
  /**
5
5
  * Hook for tracking TextInput selection state.
package/src/index.d.ts CHANGED
@@ -1,15 +1,15 @@
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';
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 '@/components/RichTextInput';
3
- export { OverlayText } from '@/components/OverlayText';
4
- export { Toolbar } from '@/components/Toolbar';
5
- export { ToolbarButton } from '@/components/ToolbarButton';
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 '@/hooks/useRichText';
9
- export type { UseRichTextOptions } from '@/hooks/useRichText';
10
- export { useSelection } from '@/hooks/useSelection';
11
- export { useFormatting } from '@/hooks/useFormatting';
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 '@/context/RichTextContext';
18
- export type { RichTextProviderProps } from '@/context/RichTextContext';
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 '@/utils/parser';
27
+ } from './utils/parser';
28
28
  export {
29
29
  toggleFormatOnSelection,
30
30
  setStyleOnSelection,
31
31
  setHeadingOnLine,
32
32
  isFormatActiveInSelection,
33
33
  getSelectionStyle,
34
- } from '@/utils/formatter';
34
+ } from './utils/formatter';
35
35
  export {
36
36
  formatStyleToTextStyle,
37
37
  segmentToTextStyle,
38
38
  segmentsToTextStyles,
39
- } from '@/utils/styleMapper';
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 '@/constants/defaultStyles';
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 '@/types';
68
+ } from './types';
@@ -1,4 +1,4 @@
1
- import type { StyledSegment, FormatType, FormatStyle, HeadingLevel, SelectionRange } from '@/types';
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 '@/utils/parser';
28
+ export { createSegment } from '../utils/parser';
@@ -4,15 +4,15 @@ import type {
4
4
  FormatStyle,
5
5
  HeadingLevel,
6
6
  SelectionRange,
7
- } from '@/types';
7
+ } from '../types';
8
8
  import {
9
9
  createSegment,
10
10
  findPositionInSegments,
11
11
  splitSegment,
12
12
  mergeAdjacentSegments,
13
13
  segmentsToPlainText,
14
- } from '@/utils/parser';
15
- import { HEADING_FONT_SIZES } from '@/constants/defaultStyles';
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 '@/utils/parser';
276
+ export { createSegment } from '../utils/parser';
@@ -1,4 +1,4 @@
1
- import type { StyledSegment, FormatStyle } from '@/types';
1
+ import type { StyledSegment, FormatStyle } from '../types';
2
2
  /**
3
3
  * Creates a new segment with the given text and optional styles.
4
4
  */
@@ -1,5 +1,5 @@
1
- import type { StyledSegment, FormatStyle } from '@/types';
2
- import { EMPTY_FORMAT_STYLE } from '@/constants/defaultStyles';
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 '@/types';
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.
@@ -1,6 +1,6 @@
1
1
  import type { TextStyle } from 'react-native';
2
- import type { FormatStyle, RichTextTheme, StyledSegment } from '@/types';
3
- import { DEFAULT_THEME, HEADING_FONT_SIZES } from '@/constants/defaultStyles';
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.