@hero-design/rn-work-uikit 1.4.0 → 1.6.0

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 (27) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/lib/index.js +870 -639
  3. package/package.json +2 -2
  4. package/src/components/DatePicker/__tests__/__snapshots__/index.spec.tsx.snap +36 -3
  5. package/src/components/FormGroup/__tests__/__snapshots__/index.spec.tsx.snap +26 -3
  6. package/src/components/FormGroup/__tests__/index.spec.tsx +143 -3
  7. package/src/components/FormGroup/index.tsx +16 -7
  8. package/src/components/RichTextEditor/RichTextEditor.tsx +15 -24
  9. package/src/components/RichTextEditor/RichTextEditorInput.tsx +17 -11
  10. package/src/components/RichTextEditor/StyledRichTextEditor.tsx +10 -7
  11. package/src/components/RichTextEditor/__tests__/RichTextEditor.spec.tsx +81 -0
  12. package/src/components/RichTextEditor/index.tsx +2 -4
  13. package/src/components/RichTextEditor/types.ts +12 -1
  14. package/src/components/Select/__tests__/__snapshots__/index.spec.tsx.snap +24 -2
  15. package/src/components/Select/index.tsx +11 -10
  16. package/src/components/TextInput/Group/__tests__/__snapshots__/index.spec.tsx.snap +3 -3
  17. package/src/components/TextInput/Group/index.tsx +6 -1
  18. package/src/components/TextInput/StyledTextInput.tsx +3 -3
  19. package/src/components/TextInput/__tests__/__snapshots__/index.spec.tsx.snap +17 -17
  20. package/src/components/TextInput/index.tsx +2 -2
  21. package/src/components/TextInput/types.ts +1 -1
  22. package/src/index.ts +2 -1
  23. package/src/utils/hooks.ts +10 -0
  24. package/stats/1.6.0/rn-work-uikit-stats.html +4844 -0
  25. package/testUtils/setup.tsx +19 -1
  26. package/src/components/RichTextEditor/__mocks__/hero-editor.js +0 -3
  27. package/stats/1.4.0/rn-work-uikit-stats.html +0 -4844
@@ -400,6 +400,24 @@ jest.mock('react-native/Libraries/Utilities/BackHandler', () => ({
400
400
  }));
401
401
 
402
402
  // Mock hero-editor
403
- jest.mock('hero-editor', () => ({ default: '' }), { virtual: true });
403
+ jest.mock(
404
+ 'hero-editor',
405
+ () => ({
406
+ plainSerializer: (value: unknown[]) => {
407
+ if (!value || !Array.isArray(value)) return '';
408
+ return value
409
+ .map((node: unknown) =>
410
+ (node as { children?: unknown[] })?.children &&
411
+ Array.isArray((node as { children?: unknown[] }).children)
412
+ ? (node as { children: { text?: string }[] }).children
413
+ .map((child: { text?: string }) => child.text || '')
414
+ .join('')
415
+ : ''
416
+ )
417
+ .join('\n');
418
+ },
419
+ }),
420
+ { virtual: true }
421
+ );
404
422
 
405
423
  export {};
@@ -1,3 +0,0 @@
1
- module.exports = {
2
- plainSerializer: () => 'mocked',
3
- };