react-native-ui-lib 8.0.1 → 8.1.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.
- package/jestSetup/jest-setup.js +154 -0
- package/lib/components/DynamicFonts/FontDownloader.d.js +1 -0
- package/lib/components/DynamicFonts/FontLoader.d.js +1 -0
- package/lib/components/DynamicFonts/NoPermissionsAcquirer.d.js +1 -0
- package/lib/components/DynamicFonts/PermissionsAcquirer.android.d.js +1 -0
- package/lib/components/DynamicFonts/PermissionsAcquirer.ios.d.js +2 -0
- package/lib/components/DynamicFonts/PermissionsAcquirer.web.d.js +2 -0
- package/lib/components/DynamicFonts/RNFSPackage.d.js +1 -0
- package/lib/components/DynamicFonts/index.d.js +3 -0
- package/lib/components/HighlighterOverlayView/index.d.js +1 -0
- package/lib/components/HighlighterOverlayView/index.web.d.js +1 -0
- package/lib/components/Keyboard/KeyboardAccessoryView/CustomKeyboardView/CustomKeyboardView.android.d.js +2 -0
- package/lib/components/Keyboard/KeyboardAccessoryView/CustomKeyboardView/CustomKeyboardView.ios.d.js +2 -0
- package/lib/components/Keyboard/KeyboardAccessoryView/CustomKeyboardView/CustomKeyboardViewBase.d.js +2 -0
- package/lib/components/Keyboard/KeyboardAccessoryView/CustomKeyboardView/index.d.js +1 -0
- package/lib/components/Keyboard/KeyboardAccessoryView/CustomKeyboardView/index.web.d.js +1 -0
- package/lib/components/Keyboard/KeyboardAccessoryView/KeyboardRegistry/EventEmitterManager/index.d.js +1 -0
- package/lib/components/Keyboard/KeyboardAccessoryView/KeyboardRegistry/index.d.js +5 -0
- package/lib/components/Keyboard/KeyboardAccessoryView/KeyboardUtils/index.d.js +1 -0
- package/lib/components/Keyboard/KeyboardAccessoryView/TextInputKeyboardManager/TextInputKeyboardManager.android.d.js +1 -0
- package/lib/components/Keyboard/KeyboardAccessoryView/TextInputKeyboardManager/TextInputKeyboardManager.ios.d.js +1 -0
- package/lib/components/Keyboard/KeyboardAccessoryView/TextInputKeyboardManager/index.d.js +1 -0
- package/lib/components/Keyboard/KeyboardAccessoryView/index.d.js +7 -0
- package/lib/components/Keyboard/KeyboardAwareInsetsView/index.d.js +1 -0
- package/lib/components/Keyboard/KeyboardTrackingView/KeyboardTrackingView.android.d.js +1 -0
- package/lib/components/Keyboard/KeyboardTrackingView/KeyboardTrackingView.ios.d.js +10 -0
- package/lib/components/Keyboard/KeyboardTrackingView/index.d.js +1 -0
- package/lib/components/Keyboard/KeyboardTrackingView/index.web.d.js +1 -0
- package/lib/components/Keyboard/index.d.js +4 -0
- package/lib/components/SafeArea/SafeAreaInsetsManager.d.js +1 -0
- package/lib/components/SafeArea/SafeAreaSpacerView.d.js +1 -0
- package/lib/components/SafeArea/SafeAreaSpacerView.web.d.js +1 -0
- package/lib/components/SafeArea/index.d.js +1 -0
- package/lib/components/index.d.js +6 -0
- package/lib/scripts/releaseNative.js +72 -0
- package/lib/specs/HighlighterViewNativeComponent.d.js +1 -0
- package/lib/specs/HighlighterViewNativeComponent.d.ts +61 -0
- package/lib/specs/HighlighterViewNativeComponent.js +8 -0
- package/lib/specs/KeyboardTrackingViewNativeComponent.d.js +1 -0
- package/lib/specs/KeyboardTrackingViewNativeComponent.d.ts +58 -0
- package/lib/specs/KeyboardTrackingViewNativeComponent.js +8 -0
- package/package.json +7 -31
- package/scripts/build/build.js +35 -0
- package/scripts/build/buildPackages/buildComponentsPackages.js +18 -0
- package/scripts/build/buildPackages/buildCustomPackages.js +106 -0
- package/scripts/build/buildPackages/index.js +6 -0
- package/scripts/createCalendarMockData.js +37 -0
- package/scripts/docs/buildDocs.js +1 -0
- package/scripts/prepush.js +71 -0
- package/scripts/release/prReleaseNotes.js +6 -0
- package/scripts/release/release.js +99 -0
- package/scripts/updateWebAssets.js +88 -0
- package/scripts/utils.js +21 -0
- package/src/assets/__tests__/Assets.spec.js +110 -0
- package/src/commons/__tests__/baseComponent.spec.js +36 -0
- package/src/commons/__tests__/constants.spec.js +202 -0
- package/src/commons/__tests__/modifiers.spec.js +453 -0
- package/src/components/WheelPicker/__tests__/index.spec.js +121 -0
- package/src/components/WheelPicker/__tests__/useListMiddleIndex.spec.js +40 -0
- package/src/components/WheelPicker/__tests__/usePresenter.spec.js +87 -0
- package/src/components/avatar/__tests__/index.spec.js +25 -0
- package/src/components/badge/__tests__/index.spec.js +84 -0
- package/src/components/button/__tests__/index.driver.spec.js +209 -0
- package/src/components/button/__tests__/index.spec.js +287 -0
- package/src/components/button/index.js +30 -8
- package/src/components/card/__tests__/CardPresenter.spec.js +35 -0
- package/src/components/carousel/__tests__/CarouselPresenter.spec.js +52 -0
- package/src/components/carousel/__tests__/index.spec.js +89 -0
- package/src/components/carousel/index.js +2 -1
- package/src/components/checkbox/__tests__/index.spec.js +357 -0
- package/src/components/chip/__tests__/index.spec.js +63 -0
- package/src/components/colorSwatch/index.js +1 -1
- package/src/components/connectionStatusBar/__tests__/index.spec.js +41 -0
- package/src/components/dateTimePicker/__tests__/index.spec.js +44 -0
- package/src/components/dialog/__tests__/index.new.spec.js +118 -0
- package/src/components/featureHighlight/__tests__/index.spec.js +76 -0
- package/src/components/floatingButton/__tests__/index.spec.js +229 -0
- package/src/components/floatingButton/index.js +66 -35
- package/src/components/hint/__tests__/index.spec.js +108 -0
- package/src/components/image/__tests__/index.spec.js +56 -0
- package/src/components/image/image.api.json +193 -1
- package/src/components/maskedInput/__tests__/maskedInput.new.spec.js +19 -0
- package/src/components/maskedInput/__tests__/maskedInput.old.spec.js +20 -0
- package/src/components/modal/__tests__/index.spec.js +58 -0
- package/src/components/numberInput/__tests__/Presenter.spec.js +374 -0
- package/src/components/numberInput/__tests__/index.spec.js +38 -0
- package/src/components/numberInput/numberInput.api.json +131 -6
- package/src/components/overlay/index.js +2 -1
- package/src/components/pageControl/pageControl.api.json +175 -1
- package/src/components/panView/__tests__/panningUtil.spec.js +693 -0
- package/src/components/picker/__tests__/PickerPresenter.spec.js +15 -0
- package/src/components/picker/__tests__/index.spec.js +364 -0
- package/src/components/picker/helpers/__tests__/usePickerLabel.spec.js +96 -0
- package/src/components/radioButton/__tests__/index.spec.js +43 -0
- package/src/components/radioGroup/__tests__/index.spec.js +96 -0
- package/src/components/sectionsWheelPicker/__tests__/index.spec.js +35 -0
- package/src/components/sectionsWheelPicker/__tests__/mockSections.js +28 -0
- package/src/components/segmentedControl/__tests__/index.spec.js +25 -0
- package/src/components/slider/__tests__/index.spec.js +35 -0
- package/src/components/slider/index.js +12 -1
- package/src/components/slider/slider.api.json +11 -0
- package/src/components/sortableGridList/__tests__/index.spec.js +51 -0
- package/src/components/sortableGridList/__tests__/usePresenter.spec.js +231 -0
- package/src/components/sortableGridList/sortableGridList.api.json +44 -1
- package/src/components/sortableList/SortableList.api.json +51 -3
- package/src/components/sortableList/__tests__/index.spec.js +105 -0
- package/src/components/stackAggregator/assets/arrow-down.png +0 -0
- package/src/components/stackAggregator/assets/arrow-down@2x.png +0 -0
- package/src/components/stackAggregator/assets/arrow-down@3x.png +0 -0
- package/src/components/switch/__tests__/index.spec.js +96 -0
- package/src/components/text/__tests__/index.driver.spec.js +124 -0
- package/src/components/text/__tests__/index.spec.js +245 -0
- package/src/components/textField/__tests__/Presenter.spec.js +240 -0
- package/src/components/textField/__tests__/index.driver.spec.js +639 -0
- package/src/components/timeline/__tests__/driver.index.spec.js +133 -0
- package/src/helpers/__tests__/AvatarHelper.spec.js +170 -0
- package/src/hooks/useDidUpdate/__tests__/useDidUpdate.spec.js +80 -0
- package/src/hooks/useOrientation/__tests__/useOrientation.spec.js +70 -0
- package/src/hooks/useToggleValue/__tests__/useToggleValue.spec.js +89 -0
- package/src/incubator/calendar/__tests__/DateUtils.spec.js +367 -0
- package/src/incubator/expandableOverlay/__tests__/index.spec.js +114 -0
- package/src/incubator/gradient/__tests__/useAngleTransform.spec.js +126 -0
- package/src/incubator/slider/__tests__/SliderPresenter.spec.js +43 -0
- package/src/incubator/slider/__tests__/index.spec.js +34 -0
- package/src/incubator/slider/slider.api.json +11 -0
- package/src/incubator/toast/__tests__/index.spec.js +64 -0
- package/src/style/__tests__/colors.spec.js +313 -0
- package/src/style/__tests__/scheme.spec.js +119 -0
- package/src/style/typographyPresets.js +26 -23
- package/src/utils/__tests__/Playground.perf.js +14 -0
- package/src/utils/__tests__/imageUtils.spec.js +54 -0
- package/src/utils/__tests__/textUtils.spec.js +446 -0
- package/.eslintrc.js +0 -56
- package/babel.config.js +0 -35
- package/index.js +0 -10
- package/lib/android/build.gradle +0 -32
- package/lib/android/src/main/AndroidManifest.xml +0 -4
- package/lib/android/src/main/java/com/wix/reactnativeuilib/UiLibPackageList.java +0 -28
- package/lib/android/src/main/java/com/wix/reactnativeuilib/dynamicfont/DynamicFontModule.java +0 -139
- package/lib/android/src/main/java/com/wix/reactnativeuilib/dynamicfont/DynamicFontPackage.java +0 -28
- package/lib/android/src/main/java/com/wix/reactnativeuilib/highlighterview/HighlightFrame.java +0 -33
- package/lib/android/src/main/java/com/wix/reactnativeuilib/highlighterview/HighlightViewTagParams.java +0 -50
- package/lib/android/src/main/java/com/wix/reactnativeuilib/highlighterview/HighlighterView.java +0 -167
- package/lib/android/src/main/java/com/wix/reactnativeuilib/highlighterview/HighlighterViewManager.java +0 -131
- package/lib/android/src/main/java/com/wix/reactnativeuilib/highlighterview/HighlighterViewPackage.java +0 -28
- package/lib/android/src/main/java/com/wix/reactnativeuilib/highlighterview/UiUtils.java +0 -50
- package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/AppContextHolder.java +0 -52
- package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/CustomKeyboardLayout.java +0 -213
- package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/CustomKeyboardRootView.java +0 -39
- package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/CustomKeyboardRootViewManager.java +0 -29
- package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/CustomKeyboardRootViewShadow.java +0 -29
- package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/KeyboardInputModule.java +0 -34
- package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/KeyboardInputPackage.java +0 -49
- package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/ReactContextHolder.java +0 -16
- package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/ReactScreenMonitor.java +0 -83
- package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/ReactSoftKeyboardMonitor.java +0 -163
- package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/utils/PredicateFunc.java +0 -5
- package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/utils/RuntimeUtils.java +0 -33
- package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/utils/ViewUtils.java +0 -65
- package/lib/android/src/main/java/com/wix/reactnativeuilib/utils/LogForwarder.java +0 -45
- package/lib/android/src/main/res/layout/wheel_picker.xml +0 -9
- package/lib/android/src/main/res/values/colors.xml +0 -9
- package/lib/android/src/main/res/values/styles.xml +0 -9
- package/lib/components/Keyboard/KeyboardAccessoryView/KeyboardRegistry/keyboardRegistry.api.json +0 -50
- package/lib/components/Keyboard/KeyboardAccessoryView/keyboardAccessoryView.api.json +0 -58
- package/lib/components/Keyboard/KeyboardAwareInsetsView/keyboardAwareInsetsView.api.json +0 -14
- package/lib/components/Keyboard/KeyboardTrackingView/keyboardTrackingView.api.json +0 -86
- package/lib/ios/reactnativeuilib/dynamicfont/DynamicFont.h +0 -9
- package/lib/ios/reactnativeuilib/dynamicfont/DynamicFont.m +0 -115
- package/lib/ios/reactnativeuilib/highlighterview/HighlighterView.h +0 -19
- package/lib/ios/reactnativeuilib/highlighterview/HighlighterView.m +0 -216
- package/lib/ios/reactnativeuilib/highlighterview/HighlighterViewManager.h +0 -6
- package/lib/ios/reactnativeuilib/highlighterview/HighlighterViewManager.m +0 -28
- package/lib/ios/reactnativeuilib/keyboardinput/lninterpolation/Color+Interpolation.h +0 -39
- package/lib/ios/reactnativeuilib/keyboardinput/lninterpolation/Color+Interpolation.m +0 -160
- package/lib/ios/reactnativeuilib/keyboardinput/lninterpolation/LNAnimatorTemp.h +0 -36
- package/lib/ios/reactnativeuilib/keyboardinput/lninterpolation/LNAnimatorTemp.m +0 -121
- package/lib/ios/reactnativeuilib/keyboardinput/lninterpolation/LNInterpolable.h +0 -48
- package/lib/ios/reactnativeuilib/keyboardinput/lninterpolation/LNInterpolable.m +0 -27
- package/lib/ios/reactnativeuilib/keyboardinput/lninterpolation/LNInterpolation.h +0 -16
- package/lib/ios/reactnativeuilib/keyboardinput/lninterpolation/NSValue+Interpolation.h +0 -19
- package/lib/ios/reactnativeuilib/keyboardinput/lninterpolation/NSValue+Interpolation.mm +0 -155
- package/lib/ios/reactnativeuilib/keyboardinput/rctcustomInputcontroller/RCTCustomInputControllerTemp.h +0 -16
- package/lib/ios/reactnativeuilib/keyboardinput/rctcustomInputcontroller/RCTCustomInputControllerTemp.m +0 -450
- package/lib/ios/reactnativeuilib/keyboardinput/rctcustomInputcontroller/RCTCustomKeyboardViewControllerTemp.h +0 -18
- package/lib/ios/reactnativeuilib/keyboardinput/rctcustomInputcontroller/RCTCustomKeyboardViewControllerTemp.m +0 -99
- package/lib/ios/reactnativeuilib/keyboardtrackingview/KeyboardTrackingViewTempManager.h +0 -14
- package/lib/ios/reactnativeuilib/keyboardtrackingview/KeyboardTrackingViewTempManager.m +0 -827
- package/lib/ios/reactnativeuilib/keyboardtrackingview/ObservingInputAccessoryViewTemp.h +0 -44
- package/lib/ios/reactnativeuilib/keyboardtrackingview/ObservingInputAccessoryViewTemp.m +0 -171
- package/lib/ios/reactnativeuilib/keyboardtrackingview/UIResponder+FirstResponderTemp.h +0 -6
- package/lib/ios/reactnativeuilib/keyboardtrackingview/UIResponder+FirstResponderTemp.m +0 -17
- package/lib/ios/reactnativeuilib/safearea/SafeAreaManager.h +0 -6
- package/lib/ios/reactnativeuilib/safearea/SafeAreaManager.m +0 -105
- package/lib/ios/reactnativeuilib/safearea/SafeAreaSpacerShadowView.h +0 -5
- package/lib/ios/reactnativeuilib/safearea/SafeAreaSpacerShadowView.m +0 -20
- package/lib/ios/reactnativeuilib/safearea/SafeAreaSpacerView.h +0 -7
- package/lib/ios/reactnativeuilib/safearea/SafeAreaSpacerView.m +0 -76
- package/lib/ios/reactnativeuilib/safearea/SafeAreaSpacerViewLocalData.h +0 -9
- package/lib/ios/reactnativeuilib/safearea/SafeAreaSpacerViewLocalData.m +0 -14
- package/lib/ios/reactnativeuilib/safearea/SafeAreaSpacerViewManager.h +0 -5
- package/lib/ios/reactnativeuilib/safearea/SafeAreaSpacerViewManager.m +0 -26
- package/lib/ios/reactnativeuilib.xcodeproj/project.pbxproj +0 -435
- package/metro.config.js +0 -23
- package/src/.babelrc.json +0 -23
- package/src/assets/Assets.d.ts +0 -5
- package/src/assets/emojis/index.d.ts +0 -1343
- package/src/assets/index.d.ts +0 -3
- package/src/assets/internal/index.d.ts +0 -4
- package/src/commons/Config.d.ts +0 -24
- package/src/commons/Constants.d.ts +0 -54
- package/src/commons/UIComponent.d.ts +0 -4
- package/src/commons/asBaseComponent.d.ts +0 -15
- package/src/commons/baseComponent.d.ts +0 -2
- package/src/commons/forwardRef.d.ts +0 -8
- package/src/commons/modifiers.d.ts +0 -118
- package/src/commons/new.d.ts +0 -8
- package/src/commons/withScrollEnabler.d.ts +0 -13
- package/src/commons/withScrollReached.d.ts +0 -35
- package/src/components/WheelPicker/Item.d.ts +0 -28
- package/src/components/WheelPicker/WheelPicker.driver.d.ts +0 -18
- package/src/components/WheelPicker/WheelPickerItem.driver.d.ts +0 -8
- package/src/components/WheelPicker/helpers/useListMiddleIndex.d.ts +0 -6
- package/src/components/WheelPicker/index.d.ts +0 -88
- package/src/components/WheelPicker/types.d.ts +0 -6
- package/src/components/WheelPicker/usePresenter.d.ts +0 -21
- package/src/components/actionBar/index.d.ts +0 -35
- package/src/components/actionSheet/index.d.ts +0 -80
- package/src/components/animatedImage/index.d.ts +0 -28
- package/src/components/avatar/index.d.ts +0 -382
- package/src/components/badge/index.d.ts +0 -879
- package/src/components/baseInput/Validators.d.ts +0 -8
- package/src/components/baseInput/index.d.ts +0 -29
- package/src/components/button/Button.driver.new.d.ts +0 -34
- package/src/components/button/ButtonConstants.d.ts +0 -26
- package/src/components/button/index.d.ts +0 -572
- package/src/components/button/types.d.ts +0 -153
- package/src/components/card/CardContext.d.ts +0 -3
- package/src/components/card/CardImage.d.ts +0 -20
- package/src/components/card/CardPresenter.d.ts +0 -12
- package/src/components/card/CardSection.d.ts +0 -79
- package/src/components/card/asCardChild.d.ts +0 -6
- package/src/components/card/index.d.ts +0 -120
- package/src/components/carousel/Carousel.driver.new.d.ts +0 -9
- package/src/components/carousel/CarouselPresenter.d.ts +0 -9
- package/src/components/carousel/index.d.ts +0 -73
- package/src/components/carousel/types.d.ts +0 -107
- package/src/components/checkbox/Checkbox.driver.d.ts +0 -15
- package/src/components/checkbox/index.d.ts +0 -129
- package/src/components/chip/chip.driver.d.ts +0 -33
- package/src/components/chip/index.d.ts +0 -209
- package/src/components/chipsInput/index.d.ts +0 -55
- package/src/components/colorPalette/index.d.ts +0 -116
- package/src/components/colorPicker/ColorPickerDialog.d.ts +0 -39
- package/src/components/colorPicker/ColorPickerDialogHeader.d.ts +0 -9
- package/src/components/colorPicker/ColorPickerDialogSliders.d.ts +0 -10
- package/src/components/colorPicker/ColorPickerPresenter.d.ts +0 -16
- package/src/components/colorPicker/ColorPickerPreview.d.ts +0 -12
- package/src/components/colorPicker/index.d.ts +0 -45
- package/src/components/colorSwatch/index.d.ts +0 -50
- package/src/components/connectionStatusBar/index.d.ts +0 -33
- package/src/components/connectionStatusBar/types.d.ts +0 -28
- package/src/components/dash/index.d.ts +0 -19
- package/src/components/dateTimePicker/DateTimePicker.driver.d.ts +0 -7
- package/src/components/dateTimePicker/index.d.ts +0 -288
- package/src/components/dateTimePicker/useOldApi.d.ts +0 -27
- package/src/components/dialog/Dialog.driver.new.d.ts +0 -6
- package/src/components/dialog/DialogHeader.d.ts +0 -4
- package/src/components/dialog/index.d.ts +0 -15
- package/src/components/dialog/types.d.ts +0 -138
- package/src/components/dialog/useDialogContent.d.ts +0 -13
- package/src/components/drawer/Swipeable.d.ts +0 -94
- package/src/components/drawer/index.d.ts +0 -161
- package/src/components/expandableSection/index.d.ts +0 -40
- package/src/components/fadedScrollView/index.d.ts +0 -59
- package/src/components/fader/index.d.ts +0 -37
- package/src/components/featureHighlight/index.d.ts +0 -147
- package/src/components/floatingButton/index.d.ts +0 -85
- package/src/components/gradient/index.d.ts +0 -19
- package/src/components/gridList/index.d.ts +0 -5
- package/src/components/gridList/types.d.ts +0 -29
- package/src/components/gridList/useGridLayout.d.ts +0 -15
- package/src/components/gridListItem/index.d.ts +0 -132
- package/src/components/gridView/index.d.ts +0 -80
- package/src/components/hint/Hint.driver.d.ts +0 -6
- package/src/components/hint/Hint.driver.new.d.ts +0 -19
- package/src/components/hint/HintAnchor.d.ts +0 -13
- package/src/components/hint/HintBubble.d.ts +0 -12
- package/src/components/hint/HintMockChildren.d.ts +0 -8
- package/src/components/hint/HintOld.d.ts +0 -196
- package/src/components/hint/hooks/useHintAccessibility.d.ts +0 -10
- package/src/components/hint/hooks/useHintLayout.d.ts +0 -13
- package/src/components/hint/hooks/useHintPosition.d.ts +0 -29
- package/src/components/hint/hooks/useHintVisibility.d.ts +0 -6
- package/src/components/hint/index.d.ts +0 -14
- package/src/components/hint/types.d.ts +0 -106
- package/src/components/icon/index.d.ts +0 -97
- package/src/components/image/Image.driver.d.ts +0 -4
- package/src/components/image/Image.driver.new.d.ts +0 -2
- package/src/components/image/index.d.ts +0 -192
- package/src/components/listItem/ListItemPart.d.ts +0 -15
- package/src/components/listItem/index.d.ts +0 -52
- package/src/components/listItem/types.d.ts +0 -60
- package/src/components/loaderScreen/index.d.ts +0 -13
- package/src/components/loaderScreen/types.d.ts +0 -32
- package/src/components/marquee/index.d.ts +0 -5
- package/src/components/marquee/types.d.ts +0 -35
- package/src/components/maskedInput/index.d.ts +0 -5
- package/src/components/maskedInput/new.d.ts +0 -22
- package/src/components/modal/Modal.driver.new.d.ts +0 -8
- package/src/components/modal/TopBar.d.ts +0 -89
- package/src/components/modal/index.d.ts +0 -64
- package/src/components/numberInput/NumberInput.driver.d.ts +0 -6
- package/src/components/numberInput/Presenter.d.ts +0 -21
- package/src/components/numberInput/index.d.ts +0 -57
- package/src/components/overlay/index.d.ts +0 -68
- package/src/components/pageControl/index.d.ts +0 -56
- package/src/components/panView/index.d.ts +0 -21
- package/src/components/panView/panningUtil.d.ts +0 -38
- package/src/components/panView/usePanGesture.d.ts +0 -49
- package/src/components/picker/Picker.driver.new.d.ts +0 -44
- package/src/components/picker/PickerContext.d.ts +0 -4
- package/src/components/picker/PickerItem.d.ts +0 -11
- package/src/components/picker/PickerItemsList.d.ts +0 -4
- package/src/components/picker/PickerPresenter.d.ts +0 -7
- package/src/components/picker/PickerSelectionStatusBar.d.ts +0 -3
- package/src/components/picker/helpers/useFieldType.d.ts +0 -373
- package/src/components/picker/helpers/useImperativePickerHandle.d.ts +0 -5
- package/src/components/picker/helpers/useNewPickerProps.d.ts +0 -3
- package/src/components/picker/helpers/usePickerLabel.d.ts +0 -17
- package/src/components/picker/helpers/usePickerMigrationWarnings.d.ts +0 -4
- package/src/components/picker/helpers/usePickerSearch.d.ts +0 -9
- package/src/components/picker/helpers/usePickerSelection.d.ts +0 -16
- package/src/components/picker/index.d.ts +0 -15
- package/src/components/picker/types.d.ts +0 -321
- package/src/components/pieChart/PieSegment.d.ts +0 -34
- package/src/components/pieChart/index.d.ts +0 -15
- package/src/components/progressBar/index.d.ts +0 -65
- package/src/components/progressiveImage/index.d.ts +0 -23
- package/src/components/radioButton/RadioButton.driver.d.ts +0 -9
- package/src/components/radioButton/index.d.ts +0 -121
- package/src/components/radioGroup/RadioGroup.driver.d.ts +0 -13
- package/src/components/radioGroup/RadioGroupContext.d.ts +0 -14
- package/src/components/radioGroup/asRadioGroupChild.d.ts +0 -2
- package/src/components/radioGroup/index.d.ts +0 -47
- package/src/components/scrollBar/index.d.ts +0 -88
- package/src/components/searchInput/index.d.ts +0 -37
- package/src/components/searchInput/types.d.ts +0 -66
- package/src/components/sectionsWheelPicker/SectionsWheelPicker.driver.d.ts +0 -25
- package/src/components/sectionsWheelPicker/index.d.ts +0 -43
- package/src/components/segmentedControl/index.d.ts +0 -90
- package/src/components/segmentedControl/segment.d.ts +0 -111
- package/src/components/segmentedControl/useSegmentedControlPreset.d.ts +0 -10
- package/src/components/skeletonView/index.d.ts +0 -163
- package/src/components/slider/ColorSliderGroup.d.ts +0 -13
- package/src/components/slider/GradientSlider.d.ts +0 -20
- package/src/components/slider/SliderContext.d.ts +0 -8
- package/src/components/slider/Thumb.d.ts +0 -32
- package/src/components/slider/index.d.ts +0 -31
- package/src/components/slider/slider.driver.d.ts +0 -5
- package/src/components/slider/types.d.ts +0 -197
- package/src/components/sortableGridList/SortableItem.d.ts +0 -6
- package/src/components/sortableGridList/index.d.ts +0 -5
- package/src/components/sortableGridList/types.d.ts +0 -34
- package/src/components/sortableGridList/usePresenter.d.ts +0 -21
- package/src/components/sortableList/SortableList.driver.new.d.ts +0 -2
- package/src/components/sortableList/SortableListContext.d.ts +0 -19
- package/src/components/sortableList/SortableListItem.d.ts +0 -8
- package/src/components/sortableList/SortableListItem.driver.new.d.ts +0 -11
- package/src/components/sortableList/index.d.ts +0 -5
- package/src/components/sortableList/types.d.ts +0 -48
- package/src/components/sortableList/usePresenter.d.ts +0 -12
- package/src/components/stackAggregator/index.d.ts +0 -89
- package/src/components/stateScreen/index.d.ts +0 -5
- package/src/components/stateScreen/types.d.ts +0 -30
- package/src/components/stepper/index.d.ts +0 -47
- package/src/components/svgImage/index.d.ts +0 -14
- package/src/components/svgImage/index.web.d.ts +0 -18
- package/src/components/switch/index.d.ts +0 -102
- package/src/components/switch/switch.driver.d.ts +0 -18
- package/src/components/tabController/PageCarousel.d.ts +0 -9
- package/src/components/tabController/TabBar.d.ts +0 -97
- package/src/components/tabController/TabBarContext.d.ts +0 -18
- package/src/components/tabController/TabBarItem.d.ts +0 -105
- package/src/components/tabController/TabPage.d.ts +0 -33
- package/src/components/tabController/index.d.ts +0 -48
- package/src/components/tabController/useImperativeTabControllerHandle.d.ts +0 -6
- package/src/components/tabController/useScrollToItem.d.ts +0 -79
- package/src/components/text/Text.driver.d.ts +0 -7
- package/src/components/text/Text.driver.new.d.ts +0 -17
- package/src/components/text/index.d.ts +0 -195
- package/src/components/textField/CharCounter.d.ts +0 -7
- package/src/components/textField/ClearButton.d.ts +0 -4
- package/src/components/textField/FieldContext.d.ts +0 -4
- package/src/components/textField/FloatingPlaceholder.d.ts +0 -7
- package/src/components/textField/Input.d.ts +0 -8
- package/src/components/textField/Label.d.ts +0 -7
- package/src/components/textField/Presenter.d.ts +0 -7
- package/src/components/textField/TextField.driver.new.d.ts +0 -129
- package/src/components/textField/ValidationMessage.d.ts +0 -7
- package/src/components/textField/index.d.ts +0 -114
- package/src/components/textField/presets/outline.d.ts +0 -737
- package/src/components/textField/presets/underline.d.ts +0 -735
- package/src/components/textField/textInput/index.d.ts +0 -1
- package/src/components/textField/textInput/index.web.d.ts +0 -3
- package/src/components/textField/types.d.ts +0 -287
- package/src/components/textField/useFieldState.d.ts +0 -16
- package/src/components/textField/useImperativeInputHandle.d.ts +0 -4
- package/src/components/textField/usePreset.d.ts +0 -1696
- package/src/components/textField/validators.d.ts +0 -9
- package/src/components/textFieldOld/index.d.ts +0 -71
- package/src/components/timeline/Line.d.ts +0 -10
- package/src/components/timeline/Point.d.ts +0 -9
- package/src/components/timeline/index.d.ts +0 -11
- package/src/components/timeline/line.driver.d.ts +0 -10
- package/src/components/timeline/point.driver.d.ts +0 -8
- package/src/components/timeline/timeline.driver.d.ts +0 -25
- package/src/components/timeline/types.d.ts +0 -50
- package/src/components/touchableOpacity/index.d.ts +0 -50
- package/src/components/view/View.driver.new.d.ts +0 -7
- package/src/components/view/index.d.ts +0 -46
- package/src/components/wizard/WizardStates.d.ts +0 -2
- package/src/components/wizard/WizardStep.d.ts +0 -4
- package/src/components/wizard/index.d.ts +0 -31
- package/src/components/wizard/types.d.ts +0 -90
- package/src/helpers/AvatarHelper.d.ts +0 -9
- package/src/helpers/FormattingPresenter.d.ts +0 -6
- package/src/helpers/Profiler.d.ts +0 -22
- package/src/helpers/index.d.ts +0 -3
- package/src/hooks/index.d.ts +0 -14
- package/src/hooks/useCombinedRefs/index.d.ts +0 -3
- package/src/hooks/useDebounce/index.d.ts +0 -5
- package/src/hooks/useDidUpdate/index.d.ts +0 -6
- package/src/hooks/useHiddenLocation/index.d.ts +0 -13
- package/src/hooks/useHiddenLocation/index.web.d.ts +0 -13
- package/src/hooks/useKeyboardHeight/index.d.ts +0 -5
- package/src/hooks/useMeasure/index.d.ts +0 -15
- package/src/hooks/useModifiers/index.d.ts +0 -3
- package/src/hooks/useOrientation/index.d.ts +0 -7
- package/src/hooks/useScrollEnabler/index.d.ts +0 -23
- package/src/hooks/useScrollReached/index.d.ts +0 -28
- package/src/hooks/useScrollTo/index.d.ts +0 -37
- package/src/hooks/useScrollToItem/index.d.ts +0 -65
- package/src/hooks/useThemeProps/index.d.ts +0 -2
- package/src/hooks/useToggleValue/index.d.ts +0 -2
- package/src/incubator/TouchableOpacity.d.ts +0 -52
- package/src/incubator/calendar/Agenda.d.ts +0 -4
- package/src/incubator/calendar/CalendarContext.d.ts +0 -4
- package/src/incubator/calendar/CalendarItem.d.ts +0 -5
- package/src/incubator/calendar/Day.d.ts +0 -4
- package/src/incubator/calendar/Day_OLD.d.ts +0 -4
- package/src/incubator/calendar/Header.d.ts +0 -4
- package/src/incubator/calendar/Month.d.ts +0 -4
- package/src/incubator/calendar/TodayButton.d.ts +0 -4
- package/src/incubator/calendar/Week.d.ts +0 -4
- package/src/incubator/calendar/WeekDaysNames.d.ts +0 -4
- package/src/incubator/calendar/helpers/CalendarProcessor.d.ts +0 -2
- package/src/incubator/calendar/helpers/DataProcessor.d.ts +0 -2
- package/src/incubator/calendar/helpers/DateUtils.d.ts +0 -23
- package/src/incubator/calendar/index.d.ts +0 -7
- package/src/incubator/calendar/types.d.ts +0 -118
- package/src/incubator/expandableOverlay/ExpandableOverlay.driver.d.ts +0 -7
- package/src/incubator/expandableOverlay/index.d.ts +0 -83
- package/src/incubator/gradient/BorderGradient.d.ts +0 -4
- package/src/incubator/gradient/CircleGradient.d.ts +0 -4
- package/src/incubator/gradient/RectangleGradient.d.ts +0 -4
- package/src/incubator/gradient/index.d.ts +0 -5
- package/src/incubator/gradient/types.d.ts +0 -26
- package/src/incubator/gradient/useAngleTransform.d.ts +0 -27
- package/src/incubator/index.d.ts +0 -9
- package/src/incubator/slider/Slider.driver.d.ts +0 -5
- package/src/incubator/slider/SliderPresenter.d.ts +0 -6
- package/src/incubator/slider/Thumb.d.ts +0 -24
- package/src/incubator/slider/Track.d.ts +0 -13
- package/src/incubator/slider/index.d.ts +0 -139
- package/src/incubator/toast/Toast.driver.new.d.ts +0 -54
- package/src/incubator/toast/helpers/useToastAnimation.d.ts +0 -22
- package/src/incubator/toast/helpers/useToastPresets.d.ts +0 -8
- package/src/incubator/toast/helpers/useToastTimer.d.ts +0 -6
- package/src/incubator/toast/index.d.ts +0 -9
- package/src/incubator/toast/types.d.ts +0 -111
- package/src/index.d.ts +0 -92
- package/src/optionalDependencies/BlurViewPackage.d.ts +0 -2
- package/src/optionalDependencies/BlurViewPackage.web.d.ts +0 -2
- package/src/optionalDependencies/DateTimePickerPackage.d.ts +0 -2
- package/src/optionalDependencies/FlashListPackage.d.ts +0 -2
- package/src/optionalDependencies/HapticFeedbackPackage.d.ts +0 -2
- package/src/optionalDependencies/LinearGradientPackage.d.ts +0 -2
- package/src/optionalDependencies/MomentPackage.d.ts +0 -2
- package/src/optionalDependencies/NetInfoPackage.d.ts +0 -2
- package/src/optionalDependencies/PostCssPackage.d.ts +0 -5
- package/src/optionalDependencies/ShimmerPackage.d.ts +0 -2
- package/src/optionalDependencies/SvgPackage.d.ts +0 -3
- package/src/optionalDependencies/index.d.ts +0 -9
- package/src/optionalDependencies/index.web.d.ts +0 -7
- package/src/services/HapticService.d.ts +0 -15
- package/src/services/LogService.d.ts +0 -35
- package/src/services/index.d.ts +0 -2
- package/src/style/borderRadiuses.d.ts +0 -30
- package/src/style/colorName.d.ts +0 -8
- package/src/style/colorNameMap.d.ts +0 -2
- package/src/style/colors.d.ts +0 -274
- package/src/style/colorsPalette.d.ts +0 -101
- package/src/style/components.d.ts +0 -15
- package/src/style/componentsColors.d.ts +0 -5
- package/src/style/designTokens.d.ts +0 -69
- package/src/style/designTokensDM.d.ts +0 -69
- package/src/style/dividers.d.ts +0 -11
- package/src/style/index.d.ts +0 -13
- package/src/style/scheme.d.ts +0 -57
- package/src/style/shadows.d.ts +0 -223
- package/src/style/spacings.d.ts +0 -32
- package/src/style/themeManager.d.ts +0 -22
- package/src/style/typography.d.ts +0 -26
- package/src/style/typographyPresets.d.ts +0 -7
- package/src/testkit/Component.driver.d.ts +0 -30
- package/src/testkit/DriverException.d.ts +0 -12
- package/src/testkit/UniDriver.d.ts +0 -29
- package/src/testkit/drivers/TestingLibraryDriver.d.ts +0 -26
- package/src/testkit/index.d.ts +0 -25
- package/src/testkit/new/Component.driver.d.ts +0 -16
- package/src/testkit/new/useDraggable.driver.d.ts +0 -15
- package/src/testkit/new/usePressable.driver.d.ts +0 -14
- package/src/testkit/new/useScrollable.driver.d.ts +0 -13
- package/src/typings/assets.d.ts +0 -52
- package/src/typings/common.d.ts +0 -12
- package/src/typings/module.d.ts +0 -13
- package/src/typings/recorderTypes.d.ts +0 -13
- package/src/uilib-test-renderer/helper.d.ts +0 -8
- package/src/uilib-test-renderer/index.d.ts +0 -4
- package/src/uilib-test-renderer/scrollViewHelper.d.ts +0 -9
- package/src/utils/dateUtils.d.ts +0 -2
- package/src/utils/imageUtils.d.ts +0 -5
- package/src/utils/index.d.ts +0 -4
- package/src/utils/styleUtils.d.ts +0 -7
- package/src/utils/textUtils.d.ts +0 -8
- /package/{src → scripts/build}/.babelrc.exports.js +0 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import {isSvgUri, isSvg, isBase64ImageContent, getAsset} from '../imageUtils';
|
|
2
|
+
|
|
3
|
+
const svgImage = {uri: 'https://example.com/image.svg'};
|
|
4
|
+
const randomPngImage = {uri: 'https://picsum.photos/300'};
|
|
5
|
+
const svgString =
|
|
6
|
+
'<?xml version="1.0" encoding="UTF-8"?><svg data-bbox="4 2.122 17.878 17.878" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" height="24" width="24" data-type="color"><g><path fill="#116DFF" d="M15.232 2.854a2.5 2.5 0 0 1 3.536 0l2.378 2.378a2.5 2.5 0 0 1 0 3.536L10.5 19.414A2 2 0 0 1 9.086 20H5a1 1 0 0 1-1-1v-4.086a2 2 0 0 1 .586-1.414L15.232 2.854ZM6 18h3.086l7.255-7.255-3.086-3.086L6 14.914V18Zm8.67-11.755 3.085 3.086 1.977-1.977a.5.5 0 0 0 0-.708l-2.378-2.378a.5.5 0 0 0-.708 0L14.67 6.245Z" clip-rule="evenodd" fill-rule="evenodd" data-color="1"/></g></svg>';
|
|
7
|
+
const base64Image =
|
|
8
|
+
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAApgAAAKYB3X3/OAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAANCSURBVEiJtZZPbBtFFMZ/M7ubXdtdb1xSFyeilBapySVU8h8OoFaooFSqiihIVIpQBKci6KEg9Q6H9kovIHoCIVQJJCKE1ENFjnAgcaSGC6rEnxBwA04Tx43t2FnvDAfjkNibxgHxnWb2e/u992bee7tCa00YFsffekFY+nUzFtjW0LrvjRXrCDIAaPLlW0nHL0SsZtVoaF98mLrx3pdhOqLtYPHChahZcYYO7KvPFxvRl5XPp1sN3adWiD1ZAqD6XYK1b/dvE5IWryTt2udLFedwc1+9kLp+vbbpoDh+6TklxBeAi9TL0taeWpdmZzQDry0AcO+jQ12RyohqqoYoo8RDwJrU+qXkjWtfi8Xxt58BdQuwQs9qC/afLwCw8tnQbqYAPsgxE1S6F3EAIXux2oQFKm0ihMsOF71dHYx+f3NND68ghCu1YIoePPQN1pGRABkJ6Bus96CutRZMydTl+TvuiRW1m3n0eDl0vRPcEysqdXn+jsQPsrHMquGeXEaY4Yk4wxWcY5V/9scqOMOVUFthatyTy8QyqwZ+kDURKoMWxNKr2EeqVKcTNOajqKoBgOE28U4tdQl5p5bwCw7BWquaZSzAPlwjlithJtp3pTImSqQRrb2Z8PHGigD4RZuNX6JYj6wj7O4TFLbCO/Mn/m8R+h6rYSUb3ekokRY6f/YukArN979jcW+V/S8g0eT/N3VN3kTqWbQ428m9/8k0P/1aIhF36PccEl6EhOcAUCrXKZXXWS3XKd2vc/TRBG9O5ELC17MmWubD2nKhUKZa26Ba2+D3P+4/MNCFwg59oWVeYhkzgN/JDR8deKBoD7Y+ljEjGZ0sosXVTvbc6RHirr2reNy1OXd6pJsQ+gqjk8VWFYmHrwBzW/n+uMPFiRwHB2I7ih8ciHFxIkd/3Omk5tCDV1t+2nNu5sxxpDFNx+huNhVT3/zMDz8usXC3ddaHBj1GHj/As08fwTS7Kt1HBTmyN29vdwAw+/wbwLVOJ3uAD1wi/dUH7Qei66PfyuRj4Ik9is+hglfbkbfR3cnZm7chlUWLdwmprtCohX4HUtlOcQjLYCu+fzGJH2QRKvP3UNz8bWk1qMxjGTOMThZ3kvgLI5AzFfo379UAAAAASUVORK5CYII=';
|
|
9
|
+
|
|
10
|
+
describe('ImageUtils', () => {
|
|
11
|
+
describe('isSvgUri', () => {
|
|
12
|
+
it('should return true if the uri is svg', () => {
|
|
13
|
+
const result = isSvgUri(svgImage);
|
|
14
|
+
expect(result).toBe(true);
|
|
15
|
+
});
|
|
16
|
+
it('should return false if the uri is not svg', () => {
|
|
17
|
+
const result = isSvgUri(randomPngImage);
|
|
18
|
+
expect(result).toBe(false);
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
describe('isSvg', () => {
|
|
23
|
+
it('should return true if the string is svg', () => {
|
|
24
|
+
const result = isSvg(svgString);
|
|
25
|
+
expect(result).toBe(true);
|
|
26
|
+
});
|
|
27
|
+
it('should return false if the string is not svg', () => {
|
|
28
|
+
const result = isSvg('<svg data-bbox="4.../>');
|
|
29
|
+
expect(result).toBe(false);
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
describe('isBase64ImageContent', () => {
|
|
34
|
+
it('should return true if the string is base64', () => {
|
|
35
|
+
const result = isBase64ImageContent(base64Image);
|
|
36
|
+
expect(result).toBe(true);
|
|
37
|
+
});
|
|
38
|
+
it('should return false if the string is not base64', () => {
|
|
39
|
+
const result = isBase64ImageContent(svgString);
|
|
40
|
+
expect(result).toBe(false);
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
describe('getAsset', () => {
|
|
45
|
+
it('should return the asset if asset group and asset name exsist', () => {
|
|
46
|
+
const result = getAsset('search', 'internal.icons');
|
|
47
|
+
expect(result).toBeDefined();
|
|
48
|
+
});
|
|
49
|
+
it('should return the asset if asset group and asset name exsist', () => {
|
|
50
|
+
const result = getAsset('blah', 'internal.icons');
|
|
51
|
+
expect(result).toBeUndefined();
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
});
|
|
@@ -0,0 +1,446 @@
|
|
|
1
|
+
import {getTextPartsByHighlight, getArrayPartsByHighlight} from '../textUtils';
|
|
2
|
+
|
|
3
|
+
describe('Text', () => {
|
|
4
|
+
const mockHighlightStringProps = {
|
|
5
|
+
onPress: jest.fn(),
|
|
6
|
+
style: {color: 'red'},
|
|
7
|
+
testID: 'highlighted-string-test-id'
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
describe('getTextPartsByHighlight', () => {
|
|
11
|
+
describe('Simple string', () => {
|
|
12
|
+
it('should return the whole string as a single part when highlight string is undefined', () => {
|
|
13
|
+
const result = getTextPartsByHighlight('Playground Screen', undefined);
|
|
14
|
+
expect(result).toEqual([{string: 'Playground Screen', shouldHighlight: false}]);
|
|
15
|
+
});
|
|
16
|
+
it('should return the whole string as a single part when highlight string is empty', () => {
|
|
17
|
+
const result = getTextPartsByHighlight('Playground Screen', '');
|
|
18
|
+
expect(result).toEqual([{string: 'Playground Screen', shouldHighlight: false}]);
|
|
19
|
+
});
|
|
20
|
+
it('should return the whole string as a single part when highlight string dont match', () => {
|
|
21
|
+
const result = getTextPartsByHighlight('Playground Screen', 'aaa');
|
|
22
|
+
expect(result).toEqual([{string: 'Playground Screen', shouldHighlight: false}]);
|
|
23
|
+
});
|
|
24
|
+
it('should break text to parts according to highlight string', () => {
|
|
25
|
+
const result = getTextPartsByHighlight('Playground Screen', 'Scr');
|
|
26
|
+
expect(result).toEqual([
|
|
27
|
+
{string: 'Playground ', shouldHighlight: false},
|
|
28
|
+
{string: 'Scr', shouldHighlight: true},
|
|
29
|
+
{string: 'een', shouldHighlight: false}
|
|
30
|
+
]);
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
it('should handle case when highlight repeats more than once', () => {
|
|
34
|
+
const result = getTextPartsByHighlight('Dancing in the Dark', 'Da');
|
|
35
|
+
expect(result).toEqual([
|
|
36
|
+
{string: 'Da', shouldHighlight: true},
|
|
37
|
+
{string: 'ncing in the ', shouldHighlight: false},
|
|
38
|
+
{string: 'Da', shouldHighlight: true},
|
|
39
|
+
{string: 'rk', shouldHighlight: false}
|
|
40
|
+
]);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it('should be case-insensitive', () => {
|
|
44
|
+
const result = getTextPartsByHighlight('Dancing in the Dark', 'da');
|
|
45
|
+
expect(result).toEqual([
|
|
46
|
+
{string: 'Da', shouldHighlight: true},
|
|
47
|
+
{string: 'ncing in the ', shouldHighlight: false},
|
|
48
|
+
{string: 'Da', shouldHighlight: true},
|
|
49
|
+
{string: 'rk', shouldHighlight: false}
|
|
50
|
+
]);
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
it('Should handle special characters @', () => {
|
|
54
|
+
const result = getTextPartsByHighlight('@ancing in the @ark', '@a');
|
|
55
|
+
expect(result).toEqual([
|
|
56
|
+
{string: '@a', shouldHighlight: true},
|
|
57
|
+
{string: 'ncing in the ', shouldHighlight: false},
|
|
58
|
+
{string: '@a', shouldHighlight: true},
|
|
59
|
+
{string: 'rk', shouldHighlight: false}
|
|
60
|
+
]);
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it('Should handle special characters !', () => {
|
|
64
|
+
const result = getTextPartsByHighlight('!ancing in the !ark', '!a');
|
|
65
|
+
expect(result).toEqual([
|
|
66
|
+
{string: '!a', shouldHighlight: true},
|
|
67
|
+
{string: 'ncing in the ', shouldHighlight: false},
|
|
68
|
+
{string: '!a', shouldHighlight: true},
|
|
69
|
+
{string: 'rk', shouldHighlight: false}
|
|
70
|
+
]);
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
it('Should handle special characters starts with @', () => {
|
|
74
|
+
const result = getTextPartsByHighlight('uilib@wix.com', '@wix');
|
|
75
|
+
expect(result).toEqual([
|
|
76
|
+
{string: 'uilib', shouldHighlight: false},
|
|
77
|
+
{string: '@wix', shouldHighlight: true},
|
|
78
|
+
{string: '.com', shouldHighlight: false}
|
|
79
|
+
]);
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
it('Should handle empty string.', () => {
|
|
83
|
+
const result = getTextPartsByHighlight('@ancing in the @ark', '');
|
|
84
|
+
expect(result).toEqual([{string: '@ancing in the @ark', shouldHighlight: false}]);
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
it('Should handle full string.', () => {
|
|
88
|
+
const result = getTextPartsByHighlight('Dancing in the Dark', 'Dancing in the Dark');
|
|
89
|
+
expect(result).toEqual([{string: 'Dancing in the Dark', shouldHighlight: true}]);
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
it('Should handle longer string.', () => {
|
|
93
|
+
const result = getTextPartsByHighlight('Dancing in the Dark', 'Dancing in the Darker');
|
|
94
|
+
expect(result).toEqual([{string: 'Dancing in the Dark', shouldHighlight: false}]);
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
describe('HighlightStringProps object', () => {
|
|
99
|
+
it('should return the whole string as a single part when highlight string is empty', () => {
|
|
100
|
+
const highlightString = {
|
|
101
|
+
string: '',
|
|
102
|
+
...mockHighlightStringProps
|
|
103
|
+
};
|
|
104
|
+
const result = getTextPartsByHighlight('Playground Screen', highlightString);
|
|
105
|
+
expect(result).toEqual([{string: 'Playground Screen', shouldHighlight: false}]);
|
|
106
|
+
});
|
|
107
|
+
it('should return the whole string as a single part when highlight string dont match', () => {
|
|
108
|
+
const highlightString = {
|
|
109
|
+
string: 'aaa',
|
|
110
|
+
onPress: () => {},
|
|
111
|
+
style: {color: 'red'},
|
|
112
|
+
testID: 'highlighted-string-1'
|
|
113
|
+
};
|
|
114
|
+
const result = getTextPartsByHighlight('Playground Screen', highlightString);
|
|
115
|
+
expect(result).toEqual([{string: 'Playground Screen', shouldHighlight: false}]);
|
|
116
|
+
});
|
|
117
|
+
it('should break text to parts according to highlight string', () => {
|
|
118
|
+
const highlightString = {
|
|
119
|
+
string: 'Scr',
|
|
120
|
+
...mockHighlightStringProps
|
|
121
|
+
};
|
|
122
|
+
const result = getTextPartsByHighlight('Playground Screen', highlightString);
|
|
123
|
+
expect(result).toEqual([
|
|
124
|
+
{string: 'Playground ', shouldHighlight: false},
|
|
125
|
+
{string: 'Scr', shouldHighlight: true, ...mockHighlightStringProps},
|
|
126
|
+
{string: 'een', shouldHighlight: false}
|
|
127
|
+
]);
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
it('should handle case when highlight repeats more than once', () => {
|
|
131
|
+
const highlightString = {
|
|
132
|
+
string: 'Da',
|
|
133
|
+
...mockHighlightStringProps
|
|
134
|
+
};
|
|
135
|
+
const result = getTextPartsByHighlight('Dancing in the Dark', highlightString);
|
|
136
|
+
expect(result).toEqual([
|
|
137
|
+
{string: 'Da', shouldHighlight: true, ...mockHighlightStringProps},
|
|
138
|
+
{string: 'ncing in the ', shouldHighlight: false},
|
|
139
|
+
{string: 'Da', shouldHighlight: true, ...mockHighlightStringProps},
|
|
140
|
+
{string: 'rk', shouldHighlight: false}
|
|
141
|
+
]);
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
it('should be case-insensitive', () => {
|
|
145
|
+
const highlightString = {
|
|
146
|
+
string: 'da',
|
|
147
|
+
...mockHighlightStringProps
|
|
148
|
+
};
|
|
149
|
+
const result = getTextPartsByHighlight('Dancing in the Dark', highlightString);
|
|
150
|
+
expect(result).toEqual([
|
|
151
|
+
{string: 'Da', shouldHighlight: true, ...mockHighlightStringProps},
|
|
152
|
+
{string: 'ncing in the ', shouldHighlight: false},
|
|
153
|
+
{string: 'Da', shouldHighlight: true, ...mockHighlightStringProps},
|
|
154
|
+
{string: 'rk', shouldHighlight: false}
|
|
155
|
+
]);
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
it('Should handle special characters @', () => {
|
|
159
|
+
const highlightString = {
|
|
160
|
+
string: '@a',
|
|
161
|
+
...mockHighlightStringProps
|
|
162
|
+
};
|
|
163
|
+
const result = getTextPartsByHighlight('@ancing in the @ark', highlightString);
|
|
164
|
+
expect(result).toEqual([
|
|
165
|
+
{string: '@a', shouldHighlight: true, ...mockHighlightStringProps},
|
|
166
|
+
{string: 'ncing in the ', shouldHighlight: false},
|
|
167
|
+
{string: '@a', shouldHighlight: true, ...mockHighlightStringProps},
|
|
168
|
+
{string: 'rk', shouldHighlight: false}
|
|
169
|
+
]);
|
|
170
|
+
});
|
|
171
|
+
|
|
172
|
+
it('Should handle special characters !', () => {
|
|
173
|
+
const highlightString = {
|
|
174
|
+
string: '!a',
|
|
175
|
+
...mockHighlightStringProps
|
|
176
|
+
};
|
|
177
|
+
const result = getTextPartsByHighlight('!ancing in the !ark', highlightString);
|
|
178
|
+
expect(result).toEqual([
|
|
179
|
+
{string: '!a', shouldHighlight: true, ...mockHighlightStringProps},
|
|
180
|
+
{string: 'ncing in the ', shouldHighlight: false},
|
|
181
|
+
{string: '!a', shouldHighlight: true, ...mockHighlightStringProps},
|
|
182
|
+
{string: 'rk', shouldHighlight: false}
|
|
183
|
+
]);
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
it('Should handle special characters starts with @', () => {
|
|
187
|
+
const highlightString = {
|
|
188
|
+
string: '@wix',
|
|
189
|
+
...mockHighlightStringProps
|
|
190
|
+
};
|
|
191
|
+
const result = getTextPartsByHighlight('uilib@wix.com', highlightString);
|
|
192
|
+
expect(result).toEqual([
|
|
193
|
+
{string: 'uilib', shouldHighlight: false},
|
|
194
|
+
{string: '@wix', shouldHighlight: true, ...mockHighlightStringProps},
|
|
195
|
+
{string: '.com', shouldHighlight: false}
|
|
196
|
+
]);
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
it('Should handle empty string.', () => {
|
|
200
|
+
const highlightString = {
|
|
201
|
+
string: '',
|
|
202
|
+
...mockHighlightStringProps
|
|
203
|
+
};
|
|
204
|
+
const result = getTextPartsByHighlight('@ancing in the @ark', highlightString);
|
|
205
|
+
expect(result).toEqual([{string: '@ancing in the @ark', shouldHighlight: false}]);
|
|
206
|
+
});
|
|
207
|
+
|
|
208
|
+
it('Should handle full string.', () => {
|
|
209
|
+
const highlightString = {
|
|
210
|
+
string: 'Dancing in the Dark',
|
|
211
|
+
...mockHighlightStringProps
|
|
212
|
+
};
|
|
213
|
+
const result = getTextPartsByHighlight('Dancing in the Dark', highlightString);
|
|
214
|
+
expect(result).toEqual([{string: 'Dancing in the Dark', shouldHighlight: true, ...mockHighlightStringProps}]);
|
|
215
|
+
});
|
|
216
|
+
|
|
217
|
+
it('Should handle longer string.', () => {
|
|
218
|
+
const highlightString = {
|
|
219
|
+
string: 'Dancing in the Darker',
|
|
220
|
+
...mockHighlightStringProps
|
|
221
|
+
};
|
|
222
|
+
const result = getTextPartsByHighlight('Dancing in the Dark', highlightString);
|
|
223
|
+
expect(result).toEqual([{string: 'Dancing in the Dark', shouldHighlight: false}]);
|
|
224
|
+
});
|
|
225
|
+
});
|
|
226
|
+
});
|
|
227
|
+
|
|
228
|
+
describe('getArrayPartsByHighlight', () => {
|
|
229
|
+
describe('Simple string array', () => {
|
|
230
|
+
it('should return the whole string as a single part when highlight array is empty', () => {
|
|
231
|
+
const result = getArrayPartsByHighlight('Playground Screen', []);
|
|
232
|
+
expect(result).toEqual([{string: 'Playground Screen', shouldHighlight: false}]);
|
|
233
|
+
});
|
|
234
|
+
it('should return the whole string as a single part when highlight string is empty', () => {
|
|
235
|
+
const result = getArrayPartsByHighlight('Playground Screen', ['']);
|
|
236
|
+
expect(result).toEqual([{string: 'Playground Screen', shouldHighlight: false}]);
|
|
237
|
+
});
|
|
238
|
+
it('should return the whole string as a single part when highlight string dont match', () => {
|
|
239
|
+
const result = getArrayPartsByHighlight('Playground Screen', ['aaa']);
|
|
240
|
+
expect(result).toEqual([{string: 'Playground Screen', shouldHighlight: false}]);
|
|
241
|
+
});
|
|
242
|
+
it('should break text to parts according to highlight string', () => {
|
|
243
|
+
const result = getArrayPartsByHighlight('Playground Screen', ['Scr']);
|
|
244
|
+
expect(result).toEqual([
|
|
245
|
+
{string: 'Playground ', shouldHighlight: false},
|
|
246
|
+
{string: 'Scr', shouldHighlight: true},
|
|
247
|
+
{string: 'een', shouldHighlight: false}
|
|
248
|
+
]);
|
|
249
|
+
});
|
|
250
|
+
|
|
251
|
+
it('highlight repeats more than once should color the first match', () => {
|
|
252
|
+
const result = getArrayPartsByHighlight('Dancing in the Dark', ['Da']);
|
|
253
|
+
expect(result).toEqual([
|
|
254
|
+
{string: 'Da', shouldHighlight: true},
|
|
255
|
+
{string: 'ncing in the Dark', shouldHighlight: false}
|
|
256
|
+
]);
|
|
257
|
+
});
|
|
258
|
+
|
|
259
|
+
it('should be case-insensitive', () => {
|
|
260
|
+
const result = getArrayPartsByHighlight('Dancing in the Dark', ['da']);
|
|
261
|
+
expect(result).toEqual([
|
|
262
|
+
{string: 'Da', shouldHighlight: true},
|
|
263
|
+
{string: 'ncing in the Dark', shouldHighlight: false}
|
|
264
|
+
]);
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
it('Should handle special characters @', () => {
|
|
268
|
+
const result = getArrayPartsByHighlight('@ancing in the @ark', ['@a']);
|
|
269
|
+
expect(result).toEqual([
|
|
270
|
+
{string: '@a', shouldHighlight: true},
|
|
271
|
+
{string: 'ncing in the @ark', shouldHighlight: false}
|
|
272
|
+
]);
|
|
273
|
+
});
|
|
274
|
+
|
|
275
|
+
it('Should handle special characters !', () => {
|
|
276
|
+
const result = getArrayPartsByHighlight('!ancing in the !ark', ['!a']);
|
|
277
|
+
expect(result).toEqual([
|
|
278
|
+
{string: '!a', shouldHighlight: true},
|
|
279
|
+
{string: 'ncing in the !ark', shouldHighlight: false}
|
|
280
|
+
]);
|
|
281
|
+
});
|
|
282
|
+
|
|
283
|
+
it('Should handle special characters starts with @', () => {
|
|
284
|
+
const result = getArrayPartsByHighlight('uilib@wix.com', ['@wix']);
|
|
285
|
+
expect(result).toEqual([
|
|
286
|
+
{string: 'uilib', shouldHighlight: false},
|
|
287
|
+
{string: '@wix', shouldHighlight: true},
|
|
288
|
+
{string: '.com', shouldHighlight: false}
|
|
289
|
+
]);
|
|
290
|
+
});
|
|
291
|
+
|
|
292
|
+
it('Should handle full string.', () => {
|
|
293
|
+
const result = getArrayPartsByHighlight('Dancing in the Dark', ['Dancing in the Dark']);
|
|
294
|
+
expect(result).toEqual([{string: 'Dancing in the Dark', shouldHighlight: true}]);
|
|
295
|
+
});
|
|
296
|
+
|
|
297
|
+
it('Should handle longer string.', () => {
|
|
298
|
+
const result = getArrayPartsByHighlight('Dancing in the Dark', ['Dancing in the Darker']);
|
|
299
|
+
expect(result).toEqual([{string: 'Dancing in the Dark', shouldHighlight: false}]);
|
|
300
|
+
});
|
|
301
|
+
|
|
302
|
+
it('Should handle multiple strings.', () => {
|
|
303
|
+
const result = getArrayPartsByHighlight('Dancing in the Dark', ['Dancing', 'Dark']);
|
|
304
|
+
expect(result).toEqual([
|
|
305
|
+
{string: 'Dancing', shouldHighlight: true},
|
|
306
|
+
{string: ' in the ', shouldHighlight: false},
|
|
307
|
+
{string: 'Dark', shouldHighlight: true}
|
|
308
|
+
]);
|
|
309
|
+
});
|
|
310
|
+
});
|
|
311
|
+
|
|
312
|
+
describe('HighlightStringProps objects array', () => {
|
|
313
|
+
it('should return the whole string as a single part when highlight string is empty', () => {
|
|
314
|
+
const highlightString = [{
|
|
315
|
+
string: '',
|
|
316
|
+
...mockHighlightStringProps
|
|
317
|
+
}];
|
|
318
|
+
const result = getArrayPartsByHighlight('Playground Screen', highlightString);
|
|
319
|
+
expect(result).toEqual([{string: 'Playground Screen', shouldHighlight: false}]);
|
|
320
|
+
});
|
|
321
|
+
it('should return the whole string as a single part when highlight string dont match', () => {
|
|
322
|
+
const highlightString = [{
|
|
323
|
+
string: 'aaa',
|
|
324
|
+
...mockHighlightStringProps
|
|
325
|
+
}];
|
|
326
|
+
const result = getArrayPartsByHighlight('Playground Screen', highlightString);
|
|
327
|
+
expect(result).toEqual([{string: 'Playground Screen', shouldHighlight: false}]);
|
|
328
|
+
});
|
|
329
|
+
it('should break text to parts according to highlight string', () => {
|
|
330
|
+
const highlightString = [{
|
|
331
|
+
string: 'Scr',
|
|
332
|
+
...mockHighlightStringProps
|
|
333
|
+
}];
|
|
334
|
+
const result = getArrayPartsByHighlight('Playground Screen', highlightString);
|
|
335
|
+
expect(result).toEqual([
|
|
336
|
+
{string: 'Playground ', shouldHighlight: false},
|
|
337
|
+
{string: 'Scr', shouldHighlight: true, ...mockHighlightStringProps},
|
|
338
|
+
{string: 'een', shouldHighlight: false}
|
|
339
|
+
]);
|
|
340
|
+
});
|
|
341
|
+
|
|
342
|
+
it('highlight repeats more than once should color the first match', () => {
|
|
343
|
+
const highlightString = [{
|
|
344
|
+
string: 'Da',
|
|
345
|
+
...mockHighlightStringProps
|
|
346
|
+
}];
|
|
347
|
+
const result = getArrayPartsByHighlight('Dancing in the Dark', highlightString);
|
|
348
|
+
expect(result).toEqual([
|
|
349
|
+
{string: 'Da', shouldHighlight: true, ...mockHighlightStringProps},
|
|
350
|
+
{string: 'ncing in the Dark', shouldHighlight: false}
|
|
351
|
+
]);
|
|
352
|
+
});
|
|
353
|
+
|
|
354
|
+
it('should be case-insensitive', () => {
|
|
355
|
+
const highlightString = [{
|
|
356
|
+
string: 'da',
|
|
357
|
+
...mockHighlightStringProps
|
|
358
|
+
}];
|
|
359
|
+
const result = getArrayPartsByHighlight('Dancing in the Dark', highlightString);
|
|
360
|
+
expect(result).toEqual([
|
|
361
|
+
{string: 'Da', shouldHighlight: true, ...mockHighlightStringProps},
|
|
362
|
+
{string: 'ncing in the Dark', shouldHighlight: false}
|
|
363
|
+
]);
|
|
364
|
+
});
|
|
365
|
+
|
|
366
|
+
it('Should handle special characters @', () => {
|
|
367
|
+
const highlightString = [{
|
|
368
|
+
string: '@a',
|
|
369
|
+
...mockHighlightStringProps
|
|
370
|
+
}];
|
|
371
|
+
const result = getArrayPartsByHighlight('@ancing in the @ark', highlightString);
|
|
372
|
+
expect(result).toEqual([
|
|
373
|
+
{string: '@a', shouldHighlight: true, ...mockHighlightStringProps},
|
|
374
|
+
{string: 'ncing in the @ark', shouldHighlight: false}
|
|
375
|
+
]);
|
|
376
|
+
});
|
|
377
|
+
|
|
378
|
+
it('Should handle special characters !', () => {
|
|
379
|
+
const highlightString = [{
|
|
380
|
+
string: '!a',
|
|
381
|
+
...mockHighlightStringProps
|
|
382
|
+
}];
|
|
383
|
+
const result = getArrayPartsByHighlight('!ancing in the !ark', highlightString);
|
|
384
|
+
expect(result).toEqual([
|
|
385
|
+
{string: '!a', shouldHighlight: true, ...mockHighlightStringProps},
|
|
386
|
+
{string: 'ncing in the !ark', shouldHighlight: false}
|
|
387
|
+
]);
|
|
388
|
+
});
|
|
389
|
+
|
|
390
|
+
it('Should handle special characters starts with @', () => {
|
|
391
|
+
const highlightString = [{
|
|
392
|
+
string: '@wix',
|
|
393
|
+
...mockHighlightStringProps
|
|
394
|
+
}];
|
|
395
|
+
const result = getArrayPartsByHighlight('uilib@wix.com', highlightString);
|
|
396
|
+
expect(result).toEqual([
|
|
397
|
+
{string: 'uilib', shouldHighlight: false},
|
|
398
|
+
{string: '@wix', shouldHighlight: true, ...mockHighlightStringProps},
|
|
399
|
+
{string: '.com', shouldHighlight: false}
|
|
400
|
+
]);
|
|
401
|
+
});
|
|
402
|
+
|
|
403
|
+
it('Should handle full string.', () => {
|
|
404
|
+
const highlightString = [{
|
|
405
|
+
string: 'Dancing in the Dark',
|
|
406
|
+
...mockHighlightStringProps
|
|
407
|
+
}];
|
|
408
|
+
const result = getArrayPartsByHighlight('Dancing in the Dark', highlightString);
|
|
409
|
+
expect(result).toEqual([{string: 'Dancing in the Dark', shouldHighlight: true, ...mockHighlightStringProps}]);
|
|
410
|
+
});
|
|
411
|
+
|
|
412
|
+
it('Should handle longer string.', () => {
|
|
413
|
+
const highlightString = [{
|
|
414
|
+
string: 'Dancing in the Darker',
|
|
415
|
+
...mockHighlightStringProps
|
|
416
|
+
}];
|
|
417
|
+
const result = getArrayPartsByHighlight('Dancing in the Dark', highlightString);
|
|
418
|
+
expect(result).toEqual([{string: 'Dancing in the Dark', shouldHighlight: false}]);
|
|
419
|
+
});
|
|
420
|
+
|
|
421
|
+
it('Should handle multiple string.', () => {
|
|
422
|
+
const mockHighlightStringProps2 = {
|
|
423
|
+
onPress: jest.fn(),
|
|
424
|
+
style: {color: 'blue'},
|
|
425
|
+
testID: 'highlighted-string-test-id-2'
|
|
426
|
+
};
|
|
427
|
+
|
|
428
|
+
const highlightString = [
|
|
429
|
+
{
|
|
430
|
+
string: 'Dancing',
|
|
431
|
+
...mockHighlightStringProps
|
|
432
|
+
},
|
|
433
|
+
{
|
|
434
|
+
string: 'Dark',
|
|
435
|
+
...mockHighlightStringProps2
|
|
436
|
+
}];
|
|
437
|
+
const result = getArrayPartsByHighlight('Dancing in the Dark', highlightString);
|
|
438
|
+
expect(result).toEqual([
|
|
439
|
+
{string: 'Dancing', shouldHighlight: true, ...mockHighlightStringProps},
|
|
440
|
+
{string: ' in the ', shouldHighlight: false},
|
|
441
|
+
{string: 'Dark', shouldHighlight: true, ...mockHighlightStringProps2}
|
|
442
|
+
]);
|
|
443
|
+
});
|
|
444
|
+
});
|
|
445
|
+
});
|
|
446
|
+
});
|
package/.eslintrc.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
extends: ['plugin:@typescript-eslint/recommended', 'wix/react-native', 'plugin:react-hooks/recommended'],
|
|
3
|
-
parser: '@typescript-eslint/parser',
|
|
4
|
-
// plugins: ['@typescript-eslint'],
|
|
5
|
-
rules: {
|
|
6
|
-
/* Disabled rules for typescript */
|
|
7
|
-
'no-dupe-class-members': 'off',
|
|
8
|
-
'no-undef': 'off',
|
|
9
|
-
/* Other Rules */
|
|
10
|
-
'no-unused-expressions': 'off',
|
|
11
|
-
'no-restricted-syntax': [
|
|
12
|
-
'error',
|
|
13
|
-
{
|
|
14
|
-
selector: `CallExpression[callee.object.name='console'][callee.property.name='error']`,
|
|
15
|
-
message: 'Using console.error is not allowed as it is sent to Sentry, please use LogService.error instead'
|
|
16
|
-
}
|
|
17
|
-
],
|
|
18
|
-
'arrow-parens': 'off',
|
|
19
|
-
// TODO: remove after migration of legacy lifecycle methods
|
|
20
|
-
camelcase: 'off',
|
|
21
|
-
'comma-dangle': ['error', 'never'],
|
|
22
|
-
complexity: ['warn', {max: 25}],
|
|
23
|
-
'no-mixed-operators': ['off'],
|
|
24
|
-
'no-trailing-spaces': 'off',
|
|
25
|
-
'operator-linebreak': 'off',
|
|
26
|
-
'max-len': ['warn', {code: 120, ignoreComments: true, ignoreStrings: true}],
|
|
27
|
-
'react/jsx-no-bind': [
|
|
28
|
-
'off',
|
|
29
|
-
{
|
|
30
|
-
ignoreRefs: true,
|
|
31
|
-
allowArrowFunctions: false,
|
|
32
|
-
allowBind: false
|
|
33
|
-
}
|
|
34
|
-
],
|
|
35
|
-
'function-paren-newline': ['warn', 'never'],
|
|
36
|
-
'new-cap': ['off'], // TODO: fix this in colors.js and remove this
|
|
37
|
-
'default-case': ['off'],
|
|
38
|
-
'@typescript-eslint/no-use-before-define': 0,
|
|
39
|
-
'@typescript-eslint/explicit-function-return-type': 0,
|
|
40
|
-
'@typescript-eslint/no-var-requires': 0,
|
|
41
|
-
'@typescript-eslint/no-explicit-any': 0,
|
|
42
|
-
'@typescript-eslint/member-delimiter-style': 0,
|
|
43
|
-
'@typescript-eslint/no-unused-vars': [2, {args: 'all', argsIgnorePattern: '^_'}],
|
|
44
|
-
// "@typescript-eslint/no-unused-vars": 0, //todo: uncomment this line and use the the better unused rule above ^
|
|
45
|
-
'@typescript-eslint/no-non-null-assertion': 0,
|
|
46
|
-
'@typescript-eslint/explicit-member-accessibility': 0,
|
|
47
|
-
'@typescript-eslint/prefer-optional-chain': 'error',
|
|
48
|
-
'@typescript-eslint/ban-ts-ignore': 0,
|
|
49
|
-
'@typescript-eslint/ban-ts-comment': 0,
|
|
50
|
-
'@typescript-eslint/ban-types': 0,
|
|
51
|
-
'@typescript-eslint/no-empty-function': 0,
|
|
52
|
-
'@typescript-eslint/camelcase': 0,
|
|
53
|
-
'@typescript-eslint/indent': 0,
|
|
54
|
-
'@typescript-eslint/explicit-module-boundary-types': 0
|
|
55
|
-
}
|
|
56
|
-
};
|
package/babel.config.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
presets: ['module:@react-native/babel-preset'],
|
|
3
|
-
env: {
|
|
4
|
-
test: {
|
|
5
|
-
presets: [
|
|
6
|
-
[
|
|
7
|
-
'module:@react-native/babel-preset',
|
|
8
|
-
{
|
|
9
|
-
disableStaticViewConfigsCodegen: true
|
|
10
|
-
}
|
|
11
|
-
]
|
|
12
|
-
]
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
plugins: [
|
|
16
|
-
'react-native-reanimated/plugin',
|
|
17
|
-
[
|
|
18
|
-
'module-resolver',
|
|
19
|
-
{
|
|
20
|
-
extensions: ['.js', '.jsx', '.ts', '.tsx'],
|
|
21
|
-
root: ['.'],
|
|
22
|
-
alias: {
|
|
23
|
-
'react-native-ui-lib': './src/index.ts',
|
|
24
|
-
commons: './src/commons',
|
|
25
|
-
helpers: './src/helpers',
|
|
26
|
-
utils: './src/utils',
|
|
27
|
-
hooks: './src/hooks',
|
|
28
|
-
optionalDeps: './src/optionalDependencies',
|
|
29
|
-
services: './src/services',
|
|
30
|
-
style: './src/style'
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
]
|
|
34
|
-
]
|
|
35
|
-
};
|
package/index.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import 'setimmediate';
|
|
2
|
-
require('./demo/src/index');
|
|
3
|
-
require('./demo/src/demoApp'); // this is separated from demo/src/index by purpose
|
|
4
|
-
|
|
5
|
-
// comment out when measuring performance
|
|
6
|
-
// if (process.env.NODE_ENV !== 'production') {
|
|
7
|
-
// const whyDidYouRender = require('@welldone-software/why-did-you-render');
|
|
8
|
-
// const React = require('react');
|
|
9
|
-
// whyDidYouRender(React);
|
|
10
|
-
// }
|
package/lib/android/build.gradle
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
apply plugin: 'com.android.library'
|
|
2
|
-
|
|
3
|
-
project.ext {
|
|
4
|
-
buildToolsVersion = rootProject.ext.has("buildToolsVersion") ? rootProject.ext.buildToolsVersion : '35.0.0'
|
|
5
|
-
minSdkVersion = rootProject.ext.has("minSdkVersion") ? rootProject.ext.minSdkVersion : 24
|
|
6
|
-
compileSdkVersion = rootProject.ext.has("compileSdkVersion") ? rootProject.ext.compileSdkVersion : 35
|
|
7
|
-
targetSdkVersion = rootProject.ext.has("targetSdkVersion") ? rootProject.ext.targetSdkVersion : 34
|
|
8
|
-
supportLibVersion = rootProject.ext.has("supportLibVersion") ? rootProject.ext.supportLibVersion : '28.0.0'
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
android {
|
|
12
|
-
namespace "com.wix.reactnativeuilib"
|
|
13
|
-
compileSdkVersion project.ext.compileSdkVersion
|
|
14
|
-
buildToolsVersion project.ext.buildToolsVersion
|
|
15
|
-
|
|
16
|
-
defaultConfig {
|
|
17
|
-
minSdkVersion project.ext.minSdkVersion
|
|
18
|
-
targetSdkVersion project.ext.targetSdkVersion
|
|
19
|
-
versionCode 1
|
|
20
|
-
versionName "1.0"
|
|
21
|
-
}
|
|
22
|
-
buildTypes {
|
|
23
|
-
release {
|
|
24
|
-
minifyEnabled false
|
|
25
|
-
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
dependencies {
|
|
31
|
-
implementation 'com.facebook.react:react-native:+'
|
|
32
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
package com.wix.reactnativeuilib;
|
|
2
|
-
|
|
3
|
-
import android.app.Application;
|
|
4
|
-
import com.facebook.react.ReactPackage;
|
|
5
|
-
|
|
6
|
-
import com.wix.reactnativeuilib.dynamicfont.DynamicFontPackage;
|
|
7
|
-
import com.wix.reactnativeuilib.highlighterview.HighlighterViewPackage;
|
|
8
|
-
import com.wix.reactnativeuilib.keyboardinput.KeyboardInputPackage;
|
|
9
|
-
|
|
10
|
-
import java.util.Arrays;
|
|
11
|
-
import java.util.List;
|
|
12
|
-
|
|
13
|
-
public class UiLibPackageList {
|
|
14
|
-
|
|
15
|
-
private final Application application;
|
|
16
|
-
|
|
17
|
-
public UiLibPackageList(Application application) {
|
|
18
|
-
this.application = application;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
public List<ReactPackage> getPackageList() {
|
|
22
|
-
return Arrays.asList(
|
|
23
|
-
new DynamicFontPackage(),
|
|
24
|
-
new HighlighterViewPackage(),
|
|
25
|
-
new KeyboardInputPackage(application)
|
|
26
|
-
);
|
|
27
|
-
}
|
|
28
|
-
}
|