react-native-ui-lib 8.1.1 → 8.1.5
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/android/build.gradle +32 -0
- package/lib/android/src/main/AndroidManifest.xml +4 -0
- package/lib/android/src/main/java/com/wix/reactnativeuilib/UiLibPackageList.java +28 -0
- package/lib/android/src/main/java/com/wix/reactnativeuilib/dynamicfont/DynamicFontModule.java +139 -0
- package/lib/android/src/main/java/com/wix/reactnativeuilib/dynamicfont/DynamicFontPackage.java +28 -0
- package/lib/android/src/main/java/com/wix/reactnativeuilib/highlighterview/HighlightFrame.java +33 -0
- package/lib/android/src/main/java/com/wix/reactnativeuilib/highlighterview/HighlightViewTagParams.java +50 -0
- package/lib/android/src/main/java/com/wix/reactnativeuilib/highlighterview/HighlighterView.java +167 -0
- package/lib/android/src/main/java/com/wix/reactnativeuilib/highlighterview/HighlighterViewManager.java +131 -0
- package/lib/android/src/main/java/com/wix/reactnativeuilib/highlighterview/HighlighterViewPackage.java +28 -0
- package/lib/android/src/main/java/com/wix/reactnativeuilib/highlighterview/UiUtils.java +50 -0
- package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/AppContextHolder.java +52 -0
- package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/CustomKeyboardLayout.java +213 -0
- package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/CustomKeyboardRootView.java +39 -0
- package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/CustomKeyboardRootViewManager.java +29 -0
- package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/CustomKeyboardRootViewShadow.java +29 -0
- package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/KeyboardInputModule.java +34 -0
- package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/KeyboardInputPackage.java +49 -0
- package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/ReactContextHolder.java +16 -0
- package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/ReactScreenMonitor.java +83 -0
- package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/ReactSoftKeyboardMonitor.java +163 -0
- package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/utils/PredicateFunc.java +5 -0
- package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/utils/RuntimeUtils.java +33 -0
- package/lib/android/src/main/java/com/wix/reactnativeuilib/keyboardinput/utils/ViewUtils.java +65 -0
- package/lib/android/src/main/java/com/wix/reactnativeuilib/utils/LogForwarder.java +45 -0
- package/lib/android/src/main/res/layout/wheel_picker.xml +9 -0
- package/lib/android/src/main/res/values/colors.xml +9 -0
- package/lib/android/src/main/res/values/styles.xml +9 -0
- package/lib/components/Keyboard/KeyboardAccessoryView/KeyboardRegistry/keyboardRegistry.api.json +50 -0
- package/lib/components/Keyboard/KeyboardAccessoryView/keyboardAccessoryView.api.json +58 -0
- package/lib/components/Keyboard/KeyboardAwareInsetsView/keyboardAwareInsetsView.api.json +14 -0
- package/lib/components/Keyboard/KeyboardTrackingView/keyboardTrackingView.api.json +86 -0
- package/lib/ios/reactnativeuilib/dynamicfont/DynamicFont.h +9 -0
- package/lib/ios/reactnativeuilib/dynamicfont/DynamicFont.m +115 -0
- package/lib/ios/reactnativeuilib/highlighterview/HighlighterView.h +19 -0
- package/lib/ios/reactnativeuilib/highlighterview/HighlighterView.m +216 -0
- package/lib/ios/reactnativeuilib/highlighterview/HighlighterViewManager.h +6 -0
- package/lib/ios/reactnativeuilib/highlighterview/HighlighterViewManager.m +28 -0
- package/lib/ios/reactnativeuilib/keyboardinput/lninterpolation/Color+Interpolation.h +39 -0
- package/lib/ios/reactnativeuilib/keyboardinput/lninterpolation/Color+Interpolation.m +160 -0
- package/lib/ios/reactnativeuilib/keyboardinput/lninterpolation/LNAnimatorTemp.h +36 -0
- package/lib/ios/reactnativeuilib/keyboardinput/lninterpolation/LNAnimatorTemp.m +121 -0
- package/lib/ios/reactnativeuilib/keyboardinput/lninterpolation/LNInterpolable.h +48 -0
- package/lib/ios/reactnativeuilib/keyboardinput/lninterpolation/LNInterpolable.m +27 -0
- package/lib/ios/reactnativeuilib/keyboardinput/lninterpolation/LNInterpolation.h +16 -0
- package/lib/ios/reactnativeuilib/keyboardinput/lninterpolation/NSValue+Interpolation.h +19 -0
- package/lib/ios/reactnativeuilib/keyboardinput/lninterpolation/NSValue+Interpolation.mm +155 -0
- package/lib/ios/reactnativeuilib/keyboardinput/rctcustomInputcontroller/RCTCustomInputControllerTemp.h +16 -0
- package/lib/ios/reactnativeuilib/keyboardinput/rctcustomInputcontroller/RCTCustomInputControllerTemp.m +450 -0
- package/lib/ios/reactnativeuilib/keyboardinput/rctcustomInputcontroller/RCTCustomKeyboardViewControllerTemp.h +18 -0
- package/lib/ios/reactnativeuilib/keyboardinput/rctcustomInputcontroller/RCTCustomKeyboardViewControllerTemp.m +99 -0
- package/lib/ios/reactnativeuilib/keyboardtrackingview/KeyboardTrackingViewTempManager.h +14 -0
- package/lib/ios/reactnativeuilib/keyboardtrackingview/KeyboardTrackingViewTempManager.m +827 -0
- package/lib/ios/reactnativeuilib/keyboardtrackingview/ObservingInputAccessoryViewTemp.h +44 -0
- package/lib/ios/reactnativeuilib/keyboardtrackingview/ObservingInputAccessoryViewTemp.m +171 -0
- package/lib/ios/reactnativeuilib/keyboardtrackingview/UIResponder+FirstResponderTemp.h +6 -0
- package/lib/ios/reactnativeuilib/keyboardtrackingview/UIResponder+FirstResponderTemp.m +17 -0
- package/lib/ios/reactnativeuilib/safearea/SafeAreaManager.h +6 -0
- package/lib/ios/reactnativeuilib/safearea/SafeAreaManager.m +105 -0
- package/lib/ios/reactnativeuilib/safearea/SafeAreaSpacerShadowView.h +5 -0
- package/lib/ios/reactnativeuilib/safearea/SafeAreaSpacerShadowView.m +20 -0
- package/lib/ios/reactnativeuilib/safearea/SafeAreaSpacerView.h +7 -0
- package/lib/ios/reactnativeuilib/safearea/SafeAreaSpacerView.m +76 -0
- package/lib/ios/reactnativeuilib/safearea/SafeAreaSpacerViewLocalData.h +9 -0
- package/lib/ios/reactnativeuilib/safearea/SafeAreaSpacerViewLocalData.m +14 -0
- package/lib/ios/reactnativeuilib/safearea/SafeAreaSpacerViewManager.h +5 -0
- package/lib/ios/reactnativeuilib/safearea/SafeAreaSpacerViewManager.m +26 -0
- package/lib/specs/HighlighterViewNativeComponent.ts +78 -0
- package/lib/specs/KeyboardTrackingViewNativeComponent.ts +74 -0
- package/package.json +2 -25
- package/src/assets/Assets.d.ts +5 -0
- package/src/assets/emojis/index.d.ts +1343 -0
- package/src/assets/index.d.ts +3 -0
- package/src/assets/internal/index.d.ts +4 -0
- package/src/commons/Config.d.ts +24 -0
- package/src/commons/Constants.d.ts +54 -0
- package/src/commons/UIComponent.d.ts +4 -0
- package/src/commons/asBaseComponent.d.ts +15 -0
- package/src/commons/baseComponent.d.ts +2 -0
- package/src/commons/forwardRef.d.ts +8 -0
- package/src/commons/modifiers.d.ts +118 -0
- package/src/commons/new.d.ts +8 -0
- package/src/commons/withScrollEnabler.d.ts +13 -0
- package/src/commons/withScrollReached.d.ts +35 -0
- package/src/components/WheelPicker/Item.d.ts +28 -0
- package/src/components/WheelPicker/WheelPicker.driver.d.ts +18 -0
- package/src/components/WheelPicker/WheelPickerItem.driver.d.ts +8 -0
- package/src/components/WheelPicker/helpers/useListMiddleIndex.d.ts +6 -0
- package/src/components/WheelPicker/index.d.ts +88 -0
- package/src/components/WheelPicker/types.d.ts +6 -0
- package/src/components/WheelPicker/usePresenter.d.ts +21 -0
- package/src/components/actionBar/index.d.ts +35 -0
- package/src/components/actionSheet/index.d.ts +80 -0
- package/src/components/animatedImage/index.d.ts +28 -0
- package/src/components/avatar/index.d.ts +382 -0
- package/src/components/badge/index.d.ts +879 -0
- package/src/components/baseInput/Validators.d.ts +8 -0
- package/src/components/baseInput/index.d.ts +29 -0
- package/src/components/button/Button.driver.new.d.ts +34 -0
- package/src/components/button/ButtonConstants.d.ts +26 -0
- package/src/components/button/index.d.ts +573 -0
- package/src/components/button/types.d.ts +157 -0
- package/src/components/card/CardContext.d.ts +3 -0
- package/src/components/card/CardImage.d.ts +20 -0
- package/src/components/card/CardPresenter.d.ts +12 -0
- package/src/components/card/CardSection.d.ts +79 -0
- package/src/components/card/asCardChild.d.ts +6 -0
- package/src/components/card/index.d.ts +120 -0
- package/src/components/carousel/Carousel.driver.new.d.ts +9 -0
- package/src/components/carousel/CarouselPresenter.d.ts +9 -0
- package/src/components/carousel/index.d.ts +73 -0
- package/src/components/carousel/types.d.ts +107 -0
- package/src/components/checkbox/Checkbox.driver.d.ts +15 -0
- package/src/components/checkbox/index.d.ts +129 -0
- package/src/components/chip/chip.driver.d.ts +33 -0
- package/src/components/chip/index.d.ts +209 -0
- package/src/components/chipsInput/index.d.ts +55 -0
- package/src/components/colorPalette/index.d.ts +116 -0
- package/src/components/colorPicker/ColorPickerDialog.d.ts +39 -0
- package/src/components/colorPicker/ColorPickerDialogHeader.d.ts +9 -0
- package/src/components/colorPicker/ColorPickerDialogSliders.d.ts +10 -0
- package/src/components/colorPicker/ColorPickerPresenter.d.ts +16 -0
- package/src/components/colorPicker/ColorPickerPreview.d.ts +12 -0
- package/src/components/colorPicker/index.d.ts +45 -0
- package/src/components/colorSwatch/index.d.ts +50 -0
- package/src/components/connectionStatusBar/index.d.ts +33 -0
- package/src/components/connectionStatusBar/types.d.ts +28 -0
- package/src/components/dash/index.d.ts +19 -0
- package/src/components/dateTimePicker/DateTimePicker.driver.d.ts +7 -0
- package/src/components/dateTimePicker/index.d.ts +288 -0
- package/src/components/dateTimePicker/useOldApi.d.ts +27 -0
- package/src/components/dialog/Dialog.driver.new.d.ts +6 -0
- package/src/components/dialog/DialogHeader.d.ts +4 -0
- package/src/components/dialog/index.d.ts +15 -0
- package/src/components/dialog/types.d.ts +138 -0
- package/src/components/dialog/useDialogContent.d.ts +13 -0
- package/src/components/drawer/Swipeable.d.ts +94 -0
- package/src/components/drawer/index.d.ts +161 -0
- package/src/components/expandableSection/index.d.ts +40 -0
- package/src/components/fadedScrollView/index.d.ts +59 -0
- package/src/components/fader/index.d.ts +37 -0
- package/src/components/featureHighlight/index.d.ts +147 -0
- package/src/components/floatingButton/index.d.ts +89 -0
- package/src/components/gradient/index.d.ts +19 -0
- package/src/components/gridList/index.d.ts +5 -0
- package/src/components/gridList/types.d.ts +29 -0
- package/src/components/gridList/useGridLayout.d.ts +15 -0
- package/src/components/gridListItem/index.d.ts +132 -0
- package/src/components/gridView/index.d.ts +80 -0
- package/src/components/hint/Hint.driver.d.ts +6 -0
- package/src/components/hint/Hint.driver.new.d.ts +19 -0
- package/src/components/hint/HintAnchor.d.ts +13 -0
- package/src/components/hint/HintBubble.d.ts +12 -0
- package/src/components/hint/HintMockChildren.d.ts +8 -0
- package/src/components/hint/HintOld.d.ts +196 -0
- package/src/components/hint/hooks/useHintAccessibility.d.ts +10 -0
- package/src/components/hint/hooks/useHintLayout.d.ts +13 -0
- package/src/components/hint/hooks/useHintPosition.d.ts +29 -0
- package/src/components/hint/hooks/useHintVisibility.d.ts +6 -0
- package/src/components/hint/index.d.ts +14 -0
- package/src/components/hint/types.d.ts +106 -0
- package/src/components/icon/index.d.ts +97 -0
- package/src/components/image/Image.driver.d.ts +4 -0
- package/src/components/image/Image.driver.new.d.ts +2 -0
- package/src/components/image/index.d.ts +192 -0
- package/src/components/listItem/ListItemPart.d.ts +15 -0
- package/src/components/listItem/index.d.ts +52 -0
- package/src/components/listItem/types.d.ts +60 -0
- package/src/components/loaderScreen/index.d.ts +13 -0
- package/src/components/loaderScreen/types.d.ts +32 -0
- package/src/components/marquee/index.d.ts +5 -0
- package/src/components/marquee/types.d.ts +35 -0
- package/src/components/maskedInput/index.d.ts +5 -0
- package/src/components/maskedInput/new.d.ts +22 -0
- package/src/components/modal/Modal.driver.new.d.ts +8 -0
- package/src/components/modal/TopBar.d.ts +89 -0
- package/src/components/modal/index.d.ts +64 -0
- package/src/components/numberInput/NumberInput.driver.d.ts +6 -0
- package/src/components/numberInput/Presenter.d.ts +21 -0
- package/src/components/numberInput/index.d.ts +57 -0
- package/src/components/overlay/index.d.ts +68 -0
- package/src/components/pageControl/index.d.ts +56 -0
- package/src/components/panView/index.d.ts +21 -0
- package/src/components/panView/panningUtil.d.ts +38 -0
- package/src/components/panView/usePanGesture.d.ts +49 -0
- package/src/components/picker/Picker.driver.new.d.ts +44 -0
- package/src/components/picker/PickerContext.d.ts +4 -0
- package/src/components/picker/PickerItem.d.ts +11 -0
- package/src/components/picker/PickerItemsList.d.ts +4 -0
- package/src/components/picker/PickerPresenter.d.ts +7 -0
- package/src/components/picker/PickerSelectionStatusBar.d.ts +3 -0
- package/src/components/picker/helpers/useFieldType.d.ts +373 -0
- package/src/components/picker/helpers/useImperativePickerHandle.d.ts +5 -0
- package/src/components/picker/helpers/useNewPickerProps.d.ts +3 -0
- package/src/components/picker/helpers/usePickerLabel.d.ts +17 -0
- package/src/components/picker/helpers/usePickerMigrationWarnings.d.ts +4 -0
- package/src/components/picker/helpers/usePickerSearch.d.ts +9 -0
- package/src/components/picker/helpers/usePickerSelection.d.ts +16 -0
- package/src/components/picker/index.d.ts +15 -0
- package/src/components/picker/types.d.ts +321 -0
- package/src/components/pieChart/PieSegment.d.ts +34 -0
- package/src/components/pieChart/index.d.ts +15 -0
- package/src/components/progressBar/index.d.ts +65 -0
- package/src/components/progressiveImage/index.d.ts +23 -0
- package/src/components/radioButton/RadioButton.driver.d.ts +9 -0
- package/src/components/radioButton/index.d.ts +121 -0
- package/src/components/radioGroup/RadioGroup.driver.d.ts +13 -0
- package/src/components/radioGroup/RadioGroupContext.d.ts +14 -0
- package/src/components/radioGroup/asRadioGroupChild.d.ts +2 -0
- package/src/components/radioGroup/index.d.ts +47 -0
- package/src/components/scrollBar/index.d.ts +88 -0
- package/src/components/searchInput/index.d.ts +37 -0
- package/src/components/searchInput/types.d.ts +66 -0
- package/src/components/sectionsWheelPicker/SectionsWheelPicker.driver.d.ts +25 -0
- package/src/components/sectionsWheelPicker/index.d.ts +43 -0
- package/src/components/segmentedControl/index.d.ts +90 -0
- package/src/components/segmentedControl/segment.d.ts +111 -0
- package/src/components/segmentedControl/useSegmentedControlPreset.d.ts +10 -0
- package/src/components/skeletonView/index.d.ts +163 -0
- package/src/components/slider/ColorSliderGroup.d.ts +13 -0
- package/src/components/slider/GradientSlider.d.ts +20 -0
- package/src/components/slider/SliderContext.d.ts +8 -0
- package/src/components/slider/Thumb.d.ts +32 -0
- package/src/components/slider/index.d.ts +31 -0
- package/src/components/slider/slider.driver.d.ts +5 -0
- package/src/components/slider/types.d.ts +197 -0
- package/src/components/sortableGridList/SortableItem.d.ts +6 -0
- package/src/components/sortableGridList/index.d.ts +5 -0
- package/src/components/sortableGridList/types.d.ts +34 -0
- package/src/components/sortableGridList/usePresenter.d.ts +21 -0
- package/src/components/sortableList/SortableList.driver.new.d.ts +2 -0
- package/src/components/sortableList/SortableListContext.d.ts +19 -0
- package/src/components/sortableList/SortableListItem.d.ts +8 -0
- package/src/components/sortableList/SortableListItem.driver.new.d.ts +11 -0
- package/src/components/sortableList/index.d.ts +5 -0
- package/src/components/sortableList/types.d.ts +48 -0
- package/src/components/sortableList/usePresenter.d.ts +12 -0
- package/src/components/stackAggregator/index.d.ts +89 -0
- package/src/components/stateScreen/index.d.ts +5 -0
- package/src/components/stateScreen/types.d.ts +30 -0
- package/src/components/stepper/index.d.ts +47 -0
- package/src/components/svgImage/index.d.ts +14 -0
- package/src/components/svgImage/index.web.d.ts +18 -0
- package/src/components/switch/index.d.ts +102 -0
- package/src/components/switch/switch.driver.d.ts +18 -0
- package/src/components/tabController/PageCarousel.d.ts +9 -0
- package/src/components/tabController/TabBar.d.ts +97 -0
- package/src/components/tabController/TabBarContext.d.ts +18 -0
- package/src/components/tabController/TabBarItem.d.ts +105 -0
- package/src/components/tabController/TabPage.d.ts +33 -0
- package/src/components/tabController/index.d.ts +48 -0
- package/src/components/tabController/useImperativeTabControllerHandle.d.ts +6 -0
- package/src/components/tabController/useScrollToItem.d.ts +79 -0
- package/src/components/text/Text.driver.d.ts +7 -0
- package/src/components/text/Text.driver.new.d.ts +17 -0
- package/src/components/text/index.d.ts +195 -0
- package/src/components/textField/CharCounter.d.ts +7 -0
- package/src/components/textField/ClearButton.d.ts +4 -0
- package/src/components/textField/FieldContext.d.ts +4 -0
- package/src/components/textField/FloatingPlaceholder.d.ts +7 -0
- package/src/components/textField/Input.d.ts +8 -0
- package/src/components/textField/Label.d.ts +7 -0
- package/src/components/textField/Presenter.d.ts +7 -0
- package/src/components/textField/TextField.driver.new.d.ts +129 -0
- package/src/components/textField/ValidationMessage.d.ts +7 -0
- package/src/components/textField/index.d.ts +114 -0
- package/src/components/textField/presets/outline.d.ts +737 -0
- package/src/components/textField/presets/underline.d.ts +735 -0
- package/src/components/textField/textInput/index.d.ts +1 -0
- package/src/components/textField/textInput/index.web.d.ts +3 -0
- package/src/components/textField/types.d.ts +287 -0
- package/src/components/textField/useFieldState.d.ts +16 -0
- package/src/components/textField/useImperativeInputHandle.d.ts +4 -0
- package/src/components/textField/usePreset.d.ts +1696 -0
- package/src/components/textField/validators.d.ts +9 -0
- package/src/components/textFieldOld/index.d.ts +71 -0
- package/src/components/timeline/Line.d.ts +10 -0
- package/src/components/timeline/Point.d.ts +9 -0
- package/src/components/timeline/index.d.ts +11 -0
- package/src/components/timeline/line.driver.d.ts +10 -0
- package/src/components/timeline/point.driver.d.ts +8 -0
- package/src/components/timeline/timeline.driver.d.ts +25 -0
- package/src/components/timeline/types.d.ts +50 -0
- package/src/components/touchableOpacity/index.d.ts +50 -0
- package/src/components/view/View.driver.new.d.ts +7 -0
- package/src/components/view/index.d.ts +46 -0
- package/src/components/wizard/WizardStates.d.ts +2 -0
- package/src/components/wizard/WizardStep.d.ts +4 -0
- package/src/components/wizard/index.d.ts +31 -0
- package/src/components/wizard/types.d.ts +90 -0
- package/src/helpers/AvatarHelper.d.ts +9 -0
- package/src/helpers/FormattingPresenter.d.ts +6 -0
- package/src/helpers/Profiler.d.ts +22 -0
- package/src/helpers/index.d.ts +3 -0
- package/src/hooks/index.d.ts +14 -0
- package/src/hooks/useCombinedRefs/index.d.ts +3 -0
- package/src/hooks/useDebounce/index.d.ts +5 -0
- package/src/hooks/useDidUpdate/index.d.ts +6 -0
- package/src/hooks/useHiddenLocation/index.d.ts +13 -0
- package/src/hooks/useHiddenLocation/index.web.d.ts +13 -0
- package/src/hooks/useKeyboardHeight/index.d.ts +5 -0
- package/src/hooks/useMeasure/index.d.ts +15 -0
- package/src/hooks/useModifiers/index.d.ts +3 -0
- package/src/hooks/useOrientation/index.d.ts +7 -0
- package/src/hooks/useScrollEnabler/index.d.ts +23 -0
- package/src/hooks/useScrollReached/index.d.ts +28 -0
- package/src/hooks/useScrollTo/index.d.ts +37 -0
- package/src/hooks/useScrollToItem/index.d.ts +65 -0
- package/src/hooks/useThemeProps/index.d.ts +2 -0
- package/src/hooks/useToggleValue/index.d.ts +2 -0
- package/src/incubator/TouchableOpacity.d.ts +52 -0
- package/src/incubator/calendar/Agenda.d.ts +4 -0
- package/src/incubator/calendar/CalendarContext.d.ts +4 -0
- package/src/incubator/calendar/CalendarItem.d.ts +5 -0
- package/src/incubator/calendar/Day.d.ts +4 -0
- package/src/incubator/calendar/Day_OLD.d.ts +4 -0
- package/src/incubator/calendar/Header.d.ts +4 -0
- package/src/incubator/calendar/Month.d.ts +4 -0
- package/src/incubator/calendar/TodayButton.d.ts +4 -0
- package/src/incubator/calendar/Week.d.ts +4 -0
- package/src/incubator/calendar/WeekDaysNames.d.ts +4 -0
- package/src/incubator/calendar/helpers/CalendarProcessor.d.ts +2 -0
- package/src/incubator/calendar/helpers/DataProcessor.d.ts +2 -0
- package/src/incubator/calendar/helpers/DateUtils.d.ts +23 -0
- package/src/incubator/calendar/index.d.ts +7 -0
- package/src/incubator/calendar/types.d.ts +118 -0
- package/src/incubator/expandableOverlay/ExpandableOverlay.driver.d.ts +7 -0
- package/src/incubator/expandableOverlay/index.d.ts +83 -0
- package/src/incubator/gradient/BorderGradient.d.ts +4 -0
- package/src/incubator/gradient/CircleGradient.d.ts +4 -0
- package/src/incubator/gradient/RectangleGradient.d.ts +4 -0
- package/src/incubator/gradient/index.d.ts +5 -0
- package/src/incubator/gradient/types.d.ts +26 -0
- package/src/incubator/gradient/useAngleTransform.d.ts +27 -0
- package/src/incubator/index.d.ts +9 -0
- package/src/incubator/slider/Slider.driver.d.ts +5 -0
- package/src/incubator/slider/SliderPresenter.d.ts +6 -0
- package/src/incubator/slider/Thumb.d.ts +24 -0
- package/src/incubator/slider/Track.d.ts +13 -0
- package/src/incubator/slider/index.d.ts +139 -0
- package/src/incubator/toast/Toast.driver.new.d.ts +54 -0
- package/src/incubator/toast/helpers/useToastAnimation.d.ts +22 -0
- package/src/incubator/toast/helpers/useToastPresets.d.ts +8 -0
- package/src/incubator/toast/helpers/useToastTimer.d.ts +6 -0
- package/src/incubator/toast/index.d.ts +9 -0
- package/src/incubator/toast/index.js +4 -1
- package/src/incubator/toast/types.d.ts +111 -0
- package/src/index.d.ts +92 -0
- package/src/optionalDependencies/BlurViewPackage.d.ts +2 -0
- package/src/optionalDependencies/BlurViewPackage.web.d.ts +2 -0
- package/src/optionalDependencies/DateTimePickerPackage.d.ts +2 -0
- package/src/optionalDependencies/FlashListPackage.d.ts +2 -0
- package/src/optionalDependencies/HapticFeedbackPackage.d.ts +2 -0
- package/src/optionalDependencies/LinearGradientPackage.d.ts +2 -0
- package/src/optionalDependencies/MomentPackage.d.ts +2 -0
- package/src/optionalDependencies/NetInfoPackage.d.ts +2 -0
- package/src/optionalDependencies/PostCssPackage.d.ts +5 -0
- package/src/optionalDependencies/ShimmerPackage.d.ts +2 -0
- package/src/optionalDependencies/SvgPackage.d.ts +3 -0
- package/src/optionalDependencies/index.d.ts +9 -0
- package/src/optionalDependencies/index.web.d.ts +7 -0
- package/src/services/HapticService.d.ts +15 -0
- package/src/services/LogService.d.ts +35 -0
- package/src/services/index.d.ts +2 -0
- package/src/style/borderRadiuses.d.ts +30 -0
- package/src/style/colorName.d.ts +8 -0
- package/src/style/colorNameMap.d.ts +2 -0
- package/src/style/colors.d.ts +274 -0
- package/src/style/colorsPalette.d.ts +101 -0
- package/src/style/components.d.ts +15 -0
- package/src/style/componentsColors.d.ts +5 -0
- package/src/style/designTokens.d.ts +69 -0
- package/src/style/designTokensDM.d.ts +69 -0
- package/src/style/dividers.d.ts +11 -0
- package/src/style/index.d.ts +13 -0
- package/src/style/scheme.d.ts +57 -0
- package/src/style/shadows.d.ts +223 -0
- package/src/style/spacings.d.ts +32 -0
- package/src/style/themeManager.d.ts +22 -0
- package/src/style/typography.d.ts +26 -0
- package/src/style/typographyPresets.d.ts +7 -0
- package/src/testkit/Component.driver.d.ts +30 -0
- package/src/testkit/DriverException.d.ts +12 -0
- package/src/testkit/UniDriver.d.ts +29 -0
- package/src/testkit/drivers/TestingLibraryDriver.d.ts +26 -0
- package/src/testkit/index.d.ts +25 -0
- package/src/testkit/new/Component.driver.d.ts +16 -0
- package/src/testkit/new/useDraggable.driver.d.ts +15 -0
- package/src/testkit/new/usePressable.driver.d.ts +14 -0
- package/src/testkit/new/useScrollable.driver.d.ts +13 -0
- package/src/typings/assets.d.ts +52 -0
- package/src/typings/common.d.ts +12 -0
- package/src/typings/module.d.ts +13 -0
- package/src/typings/recorderTypes.d.ts +13 -0
- package/src/uilib-test-renderer/helper.d.ts +8 -0
- package/src/uilib-test-renderer/index.d.ts +4 -0
- package/src/uilib-test-renderer/scrollViewHelper.d.ts +9 -0
- package/src/utils/dateUtils.d.ts +2 -0
- package/src/utils/imageUtils.d.ts +5 -0
- package/src/utils/index.d.ts +4 -0
- package/src/utils/styleUtils.d.ts +7 -0
- package/src/utils/textUtils.d.ts +8 -0
- package/jestSetup/jest-setup.js +0 -154
- package/lib/components/DynamicFonts/FontDownloader.d.js +0 -1
- package/lib/components/DynamicFonts/FontLoader.d.js +0 -1
- package/lib/components/DynamicFonts/NoPermissionsAcquirer.d.js +0 -1
- package/lib/components/DynamicFonts/PermissionsAcquirer.android.d.js +0 -1
- package/lib/components/DynamicFonts/PermissionsAcquirer.ios.d.js +0 -2
- package/lib/components/DynamicFonts/PermissionsAcquirer.web.d.js +0 -2
- package/lib/components/DynamicFonts/RNFSPackage.d.js +0 -1
- package/lib/components/DynamicFonts/index.d.js +0 -3
- package/lib/components/HighlighterOverlayView/index.d.js +0 -1
- package/lib/components/HighlighterOverlayView/index.web.d.js +0 -1
- package/lib/components/Keyboard/KeyboardAccessoryView/CustomKeyboardView/CustomKeyboardView.android.d.js +0 -2
- package/lib/components/Keyboard/KeyboardAccessoryView/CustomKeyboardView/CustomKeyboardView.ios.d.js +0 -2
- package/lib/components/Keyboard/KeyboardAccessoryView/CustomKeyboardView/CustomKeyboardViewBase.d.js +0 -2
- package/lib/components/Keyboard/KeyboardAccessoryView/CustomKeyboardView/index.d.js +0 -1
- package/lib/components/Keyboard/KeyboardAccessoryView/CustomKeyboardView/index.web.d.js +0 -1
- package/lib/components/Keyboard/KeyboardAccessoryView/KeyboardRegistry/EventEmitterManager/index.d.js +0 -1
- package/lib/components/Keyboard/KeyboardAccessoryView/KeyboardRegistry/index.d.js +0 -5
- package/lib/components/Keyboard/KeyboardAccessoryView/KeyboardUtils/index.d.js +0 -1
- package/lib/components/Keyboard/KeyboardAccessoryView/TextInputKeyboardManager/TextInputKeyboardManager.android.d.js +0 -1
- package/lib/components/Keyboard/KeyboardAccessoryView/TextInputKeyboardManager/TextInputKeyboardManager.ios.d.js +0 -1
- package/lib/components/Keyboard/KeyboardAccessoryView/TextInputKeyboardManager/index.d.js +0 -1
- package/lib/components/Keyboard/KeyboardAccessoryView/index.d.js +0 -7
- package/lib/components/Keyboard/KeyboardAwareInsetsView/index.d.js +0 -1
- package/lib/components/Keyboard/KeyboardTrackingView/KeyboardTrackingView.android.d.js +0 -1
- package/lib/components/Keyboard/KeyboardTrackingView/KeyboardTrackingView.ios.d.js +0 -10
- package/lib/components/Keyboard/KeyboardTrackingView/index.d.js +0 -1
- package/lib/components/Keyboard/KeyboardTrackingView/index.web.d.js +0 -1
- package/lib/components/Keyboard/index.d.js +0 -4
- package/lib/components/SafeArea/SafeAreaInsetsManager.d.js +0 -1
- package/lib/components/SafeArea/SafeAreaSpacerView.d.js +0 -1
- package/lib/components/SafeArea/SafeAreaSpacerView.web.d.js +0 -1
- package/lib/components/SafeArea/index.d.js +0 -1
- package/lib/components/index.d.js +0 -6
- package/lib/scripts/releaseNative.js +0 -72
- package/lib/specs/HighlighterViewNativeComponent.d.js +0 -1
- package/lib/specs/HighlighterViewNativeComponent.js +0 -8
- package/lib/specs/KeyboardTrackingViewNativeComponent.d.js +0 -1
- package/lib/specs/KeyboardTrackingViewNativeComponent.js +0 -8
- package/scripts/build/.babelrc.exports.js +0 -6
- package/scripts/build/build.js +0 -35
- package/scripts/build/buildPackages/buildComponentsPackages.js +0 -18
- package/scripts/build/buildPackages/buildCustomPackages.js +0 -106
- package/scripts/build/buildPackages/index.js +0 -6
- package/scripts/createCalendarMockData.js +0 -37
- package/scripts/docs/buildDocs.js +0 -1
- package/scripts/prepush.js +0 -71
- package/scripts/release/prReleaseNotes.js +0 -6
- package/scripts/release/release.js +0 -99
- package/scripts/updateWebAssets.js +0 -88
- package/scripts/utils.js +0 -21
- package/src/assets/__tests__/Assets.spec.js +0 -110
- package/src/commons/__tests__/baseComponent.spec.js +0 -36
- package/src/commons/__tests__/constants.spec.js +0 -202
- package/src/commons/__tests__/modifiers.spec.js +0 -453
- package/src/components/WheelPicker/__tests__/index.spec.js +0 -121
- package/src/components/WheelPicker/__tests__/useListMiddleIndex.spec.js +0 -40
- package/src/components/WheelPicker/__tests__/usePresenter.spec.js +0 -87
- package/src/components/avatar/__tests__/index.spec.js +0 -25
- package/src/components/badge/__tests__/index.spec.js +0 -84
- package/src/components/button/__tests__/index.driver.spec.js +0 -209
- package/src/components/button/__tests__/index.spec.js +0 -287
- package/src/components/card/__tests__/CardPresenter.spec.js +0 -35
- package/src/components/carousel/__tests__/CarouselPresenter.spec.js +0 -52
- package/src/components/carousel/__tests__/index.spec.js +0 -89
- package/src/components/checkbox/__tests__/index.spec.js +0 -357
- package/src/components/chip/__tests__/index.spec.js +0 -63
- package/src/components/connectionStatusBar/__tests__/index.spec.js +0 -41
- package/src/components/dateTimePicker/__tests__/index.spec.js +0 -44
- package/src/components/dialog/__tests__/index.new.spec.js +0 -118
- package/src/components/featureHighlight/__tests__/index.spec.js +0 -76
- package/src/components/floatingButton/__tests__/index.spec.js +0 -229
- package/src/components/hint/__tests__/index.spec.js +0 -108
- package/src/components/image/__tests__/index.spec.js +0 -56
- package/src/components/maskedInput/__tests__/maskedInput.new.spec.js +0 -19
- package/src/components/maskedInput/__tests__/maskedInput.old.spec.js +0 -20
- package/src/components/modal/__tests__/index.spec.js +0 -58
- package/src/components/numberInput/__tests__/Presenter.spec.js +0 -374
- package/src/components/numberInput/__tests__/index.spec.js +0 -38
- package/src/components/panView/__tests__/panningUtil.spec.js +0 -693
- package/src/components/picker/__tests__/PickerPresenter.spec.js +0 -15
- package/src/components/picker/__tests__/index.spec.js +0 -364
- package/src/components/picker/helpers/__tests__/usePickerLabel.spec.js +0 -96
- package/src/components/radioButton/__tests__/index.spec.js +0 -43
- package/src/components/radioGroup/__tests__/index.spec.js +0 -96
- package/src/components/sectionsWheelPicker/__tests__/index.spec.js +0 -35
- package/src/components/sectionsWheelPicker/__tests__/mockSections.js +0 -28
- package/src/components/segmentedControl/__tests__/index.spec.js +0 -25
- package/src/components/slider/__tests__/index.spec.js +0 -35
- package/src/components/sortableGridList/__tests__/index.spec.js +0 -51
- package/src/components/sortableGridList/__tests__/usePresenter.spec.js +0 -231
- package/src/components/sortableList/__tests__/index.spec.js +0 -105
- package/src/components/switch/__tests__/index.spec.js +0 -96
- package/src/components/text/__tests__/index.driver.spec.js +0 -124
- package/src/components/text/__tests__/index.spec.js +0 -245
- package/src/components/textField/__tests__/Presenter.spec.js +0 -240
- package/src/components/textField/__tests__/index.driver.spec.js +0 -639
- package/src/components/timeline/__tests__/driver.index.spec.js +0 -133
- package/src/helpers/__tests__/AvatarHelper.spec.js +0 -170
- package/src/hooks/useDidUpdate/__tests__/useDidUpdate.spec.js +0 -80
- package/src/hooks/useOrientation/__tests__/useOrientation.spec.js +0 -70
- package/src/hooks/useToggleValue/__tests__/useToggleValue.spec.js +0 -89
- package/src/incubator/calendar/__tests__/DateUtils.spec.js +0 -367
- package/src/incubator/expandableOverlay/__tests__/index.spec.js +0 -114
- package/src/incubator/gradient/__tests__/useAngleTransform.spec.js +0 -126
- package/src/incubator/slider/__tests__/SliderPresenter.spec.js +0 -43
- package/src/incubator/slider/__tests__/index.spec.js +0 -34
- package/src/incubator/toast/__tests__/index.spec.js +0 -64
- package/src/style/__tests__/colors.spec.js +0 -313
- package/src/style/__tests__/scheme.spec.js +0 -119
- package/src/utils/__tests__/Playground.perf.js +0 -14
- package/src/utils/__tests__/imageUtils.spec.js +0 -54
- package/src/utils/__tests__/textUtils.spec.js +0 -446
package/scripts/prepush.js
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const semver = require('semver');
|
|
4
|
-
const fs = require('fs');
|
|
5
|
-
const path = require('path');
|
|
6
|
-
|
|
7
|
-
const nodeVersion = fs.readFileSync(path.resolve(process.cwd(), '.nvmrc'), 'utf-8').trim();
|
|
8
|
-
if (!semver.gte(process.version.substring(1), nodeVersion)) {
|
|
9
|
-
throw new Error(`Node version must be at least ${nodeVersion}`);
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
const cp = require('child_process');
|
|
13
|
-
const {logGreen, logError} = require('./utils');
|
|
14
|
-
const {Spinner} = require('@topcli/spinner');
|
|
15
|
-
|
|
16
|
-
const ARGS = process.argv.slice(2);
|
|
17
|
-
const TEST_ARG = 'test';
|
|
18
|
-
const TEST_COMMAND = 'yarn test';
|
|
19
|
-
|
|
20
|
-
const PRE_PUSH_COMMANDS = [
|
|
21
|
-
'yarn constraints',
|
|
22
|
-
'yarn dedupe --check',
|
|
23
|
-
'yarn lint --quiet',
|
|
24
|
-
'yarn build:dev >/dev/null'
|
|
25
|
-
];
|
|
26
|
-
|
|
27
|
-
async function run() {
|
|
28
|
-
logGreen('Running pre-push checks...');
|
|
29
|
-
const commands = [...PRE_PUSH_COMMANDS];
|
|
30
|
-
if (ARGS.includes(TEST_ARG)) {
|
|
31
|
-
commands.push(TEST_COMMAND);
|
|
32
|
-
}
|
|
33
|
-
const promises = commands.map(execute);
|
|
34
|
-
const results = await Promise.allSettled(promises);
|
|
35
|
-
const failed = results.filter(result => result.status === 'rejected');
|
|
36
|
-
if (failed.length > 0) {
|
|
37
|
-
logError('Pre-push checks failed!');
|
|
38
|
-
failed.forEach(result => logFailedCommand(result.reason));
|
|
39
|
-
process.exit(1);
|
|
40
|
-
}
|
|
41
|
-
process.exit(0);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
function logFailedCommand({command, stdout, stderr}) {
|
|
45
|
-
logError(`${command}:`);
|
|
46
|
-
if (stdout) {
|
|
47
|
-
logError('STDOUT:');
|
|
48
|
-
logError(stdout);
|
|
49
|
-
}
|
|
50
|
-
if (stderr) {
|
|
51
|
-
logError('STDERR:');
|
|
52
|
-
logError(stderr);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
async function execute(command) {
|
|
57
|
-
const spinner = new Spinner();
|
|
58
|
-
return new Promise((resolve, reject) => {
|
|
59
|
-
spinner.start(command);
|
|
60
|
-
cp.exec(command, {encoding: 'utf-8'}, (error, stdout, stderr) => {
|
|
61
|
-
if (error) {
|
|
62
|
-
spinner.failed();
|
|
63
|
-
reject({command, error, stdout, stderr});
|
|
64
|
-
}
|
|
65
|
-
spinner.succeed();
|
|
66
|
-
resolve();
|
|
67
|
-
});
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
run();
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
const exec = require('shell-utils').exec;
|
|
2
|
-
const cp = require('child_process');
|
|
3
|
-
const semver = require('semver');
|
|
4
|
-
const _ = require('lodash');
|
|
5
|
-
|
|
6
|
-
// Workaround JS
|
|
7
|
-
|
|
8
|
-
// Export buildkite variables for Release build
|
|
9
|
-
// We cast toString() because function returns 'object'
|
|
10
|
-
const isRelease = process.env.BUILDKITE_MESSAGE?.match?.(/^release$/i);
|
|
11
|
-
let VERSION;
|
|
12
|
-
if (isRelease) {
|
|
13
|
-
VERSION = cp.execSync(`buildkite-agent meta-data get version`).toString();
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const VERSION_TAG = isRelease ? 'latest' : 'snapshot';
|
|
17
|
-
const VERSION_INC = 'patch';
|
|
18
|
-
function run() {
|
|
19
|
-
console.log('Release UI Lib');
|
|
20
|
-
if (!validateEnv()) {
|
|
21
|
-
console.log('Not a valid environment to release in!');
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
console.log('Valid environment - releasing...');
|
|
26
|
-
setupGit();
|
|
27
|
-
configureNpmToken();
|
|
28
|
-
versionTagAndPublish();
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function validateEnv() {
|
|
32
|
-
if (!process.env.CI) {
|
|
33
|
-
throw new Error('releasing is only available from CI');
|
|
34
|
-
}
|
|
35
|
-
return (
|
|
36
|
-
process.env.BUILDKITE_BRANCH === 'master' ||
|
|
37
|
-
process.env.BUILDKITE_BRANCH === 'release' ||
|
|
38
|
-
process.env.BUILDKITE_MESSAGE === 'snapshot'
|
|
39
|
-
);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
function setupGit() {
|
|
43
|
-
exec.execSyncSilent('git config --global push.default simple');
|
|
44
|
-
exec.execSyncSilent(`git config --global user.email "${process.env.GIT_EMAIL}"`);
|
|
45
|
-
exec.execSyncSilent(`git config --global user.name "${process.env.GIT_USER}"`);
|
|
46
|
-
const remoteUrl = new RegExp('https?://(\\S+)').exec(exec.execSyncRead('git remote -v'))[1];
|
|
47
|
-
exec.execSyncSilent(`git remote add deploy "https://${process.env.GIT_USER}:${process.env.GIT_TOKEN}@${remoteUrl}"`);
|
|
48
|
-
// exec.execSync(`git checkout ${ONLY_ON_BRANCH}`);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
function configureNpmToken() {
|
|
52
|
-
exec.execSync(`yarn config set npmAuthToken "${process.env.NPM_TOKEN}"`);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
function versionTagAndPublish() {
|
|
56
|
-
const currentPublished = findCurrentPublishedVersion();
|
|
57
|
-
console.log(`current published version: ${currentPublished}`);
|
|
58
|
-
|
|
59
|
-
const version = isRelease ? VERSION : `${currentPublished}-snapshot.${process.env.BUILDKITE_BUILD_NUMBER}`;
|
|
60
|
-
console.log(`Publishing version: ${version}`);
|
|
61
|
-
|
|
62
|
-
tryPublishAndTag(version);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
function findCurrentPublishedVersion() {
|
|
66
|
-
const result = exec.execSyncRead(`yarn npm info ${process.env.npm_package_name} --fields dist-tags --json`);
|
|
67
|
-
const parsed = JSON.parse(result);
|
|
68
|
-
return parsed['dist-tags'].latest;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
function tryPublishAndTag(version) {
|
|
72
|
-
let theCandidate = version;
|
|
73
|
-
for (let retry = 0; retry < 5; retry++) {
|
|
74
|
-
try {
|
|
75
|
-
tagAndPublish(theCandidate);
|
|
76
|
-
console.log(`Released ${theCandidate}`);
|
|
77
|
-
return;
|
|
78
|
-
} catch (err) {
|
|
79
|
-
const alreadyPublished = _.includes(err.toString(), 'You cannot publish over the previously published version');
|
|
80
|
-
if (!alreadyPublished) {
|
|
81
|
-
throw err;
|
|
82
|
-
}
|
|
83
|
-
console.log(`previously published. retrying with increased ${VERSION_INC}...`);
|
|
84
|
-
theCandidate = semver.inc(theCandidate, VERSION_INC);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
function tagAndPublish(newVersion) {
|
|
90
|
-
console.log(`trying to publish ${newVersion}...`);
|
|
91
|
-
exec.execSync(`yarn version ${newVersion}`);
|
|
92
|
-
exec.execSync(`yarn npm publish --tag ${VERSION_TAG}`);
|
|
93
|
-
if (isRelease) {
|
|
94
|
-
exec.execSync(`git tag -a ${newVersion} -m "${newVersion}"`);
|
|
95
|
-
}
|
|
96
|
-
exec.execSyncSilent(`git push deploy ${newVersion} || true`);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
run();
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
2
|
-
const path = require('path');
|
|
3
|
-
const mime = require('mime-types');
|
|
4
|
-
const {imageSize: sizeOf} = require('image-size');
|
|
5
|
-
|
|
6
|
-
// Base paths
|
|
7
|
-
const ICONS_PATH = path.resolve(__dirname, '../packages/react-native-ui-lib/src/assets/internal/icons');
|
|
8
|
-
const IMAGES_PATH = path.resolve(__dirname, '../packages/react-native-ui-lib/src/assets/internal/images');
|
|
9
|
-
|
|
10
|
-
// Function to check if file is an image
|
|
11
|
-
function isImageFile(filePath) {
|
|
12
|
-
const mimeType = mime.lookup(filePath);
|
|
13
|
-
return !!mimeType && mimeType.includes('image');
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
// Function to get dimensions of an image
|
|
17
|
-
function getDimensions(imagePath) {
|
|
18
|
-
try {
|
|
19
|
-
if (!isImageFile(imagePath)) {
|
|
20
|
-
console.warn(`File is not an image: ${imagePath}`);
|
|
21
|
-
return {width: 0, height: 0};
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
try {
|
|
25
|
-
const buffer = fs.readFileSync(imagePath);
|
|
26
|
-
const dimensions = sizeOf(buffer);
|
|
27
|
-
return {
|
|
28
|
-
width: dimensions.width,
|
|
29
|
-
height: dimensions.height
|
|
30
|
-
};
|
|
31
|
-
} catch (sizeError) {
|
|
32
|
-
// eslint-disable-next-line no-restricted-syntax
|
|
33
|
-
console.error(`Error getting dimensions for ${imagePath}:`, sizeError);
|
|
34
|
-
// Default dimensions if sizeOf fails
|
|
35
|
-
return {width: 24, height: 24};
|
|
36
|
-
}
|
|
37
|
-
} catch (error) {
|
|
38
|
-
// eslint-disable-next-line no-restricted-syntax
|
|
39
|
-
console.error(`Error getting dimensions for ${imagePath}:`, error);
|
|
40
|
-
return {width: 0, height: 0};
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
// Function to create index files with dimensions
|
|
45
|
-
function createIndexFile(sourcePath, targetPath, fileType) {
|
|
46
|
-
const files = fs.readdirSync(sourcePath).filter(file => !file.includes('@'));
|
|
47
|
-
|
|
48
|
-
let content = '';
|
|
49
|
-
|
|
50
|
-
if (fileType === 'icons') {
|
|
51
|
-
content = 'export const icons = {\n';
|
|
52
|
-
} else if (fileType === 'images') {
|
|
53
|
-
content = 'export const images = {\n';
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
files.forEach((file, index) => {
|
|
57
|
-
const filePath = path.join(sourcePath, file);
|
|
58
|
-
const mimeType = mime.lookup(filePath);
|
|
59
|
-
const isImage = !!mimeType && mimeType.includes('image');
|
|
60
|
-
|
|
61
|
-
if (!isImage) {
|
|
62
|
-
console.warn(`Skipping non-image file: ${filePath}`);
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
const name = path.basename(file, path.extname(file));
|
|
67
|
-
const dimensions = getDimensions(filePath);
|
|
68
|
-
|
|
69
|
-
// Handle hyphenated filenames by converting to camelCase
|
|
70
|
-
const propertyName = name.replace(/-([a-z])/g, (_match, letter) => letter.toUpperCase());
|
|
71
|
-
|
|
72
|
-
content += ` get ${propertyName}() {\n`;
|
|
73
|
-
// eslint-disable-next-line max-len
|
|
74
|
-
content += ` return {uri: require('./${file}'), width: ${dimensions.width}, height: ${dimensions.height}};\n`;
|
|
75
|
-
content += index === files.length - 1 ? ` }\n` : ` },\n`; // Conditional check for the last file
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
content += '};\n';
|
|
79
|
-
|
|
80
|
-
fs.writeFileSync(targetPath, content);
|
|
81
|
-
console.log(`Created ${targetPath}`);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
// Create index files
|
|
85
|
-
createIndexFile(ICONS_PATH, path.join(ICONS_PATH, 'index.web.js'), 'icons');
|
|
86
|
-
createIndexFile(IMAGES_PATH, path.join(IMAGES_PATH, 'index.web.js'), 'images');
|
|
87
|
-
|
|
88
|
-
console.log('Index files created successfully!');
|
package/scripts/utils.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
const chalk = require('chalk');
|
|
2
|
-
|
|
3
|
-
function logDebug() {
|
|
4
|
-
console.log(chalk.gray(...arguments));
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
function logGreen() {
|
|
8
|
-
console.log(chalk.green(...arguments));
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
function logError() {
|
|
12
|
-
// eslint-disable-next-line no-restricted-syntax
|
|
13
|
-
console.error(chalk.red(...arguments));
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
module.exports = {
|
|
18
|
-
logDebug,
|
|
19
|
-
logGreen,
|
|
20
|
-
logError
|
|
21
|
-
};
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import {Assets} from '../Assets';
|
|
2
|
-
|
|
3
|
-
describe('Assets', () => {
|
|
4
|
-
let assets;
|
|
5
|
-
|
|
6
|
-
beforeEach(() => {
|
|
7
|
-
assets = new Assets();
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
describe('.loadAssetsGroup(groupName, assets)', () => {
|
|
11
|
-
it('should return the assets object itself', () => {
|
|
12
|
-
expect(assets.loadAssetsGroup('emojis', {})).toBe(assets);
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
it('should create nested groups', () => {
|
|
16
|
-
assets.loadAssetsGroup('emojis.ascii', {smile: ':)'});
|
|
17
|
-
expect(assets.emojis.ascii.smile).toBe(':)');
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
describe('edge cases', () => {
|
|
21
|
-
it('should throw if group name is not a string', () => {
|
|
22
|
-
expect(() => assets.loadAssetsGroup(42, {})).toThrowErrorMatchingSnapshot();
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
it('should throw if assets are not a plain object', () => {
|
|
26
|
-
expect(() => assets.loadAssetsGroup('assets', new class {}())).toThrowErrorMatchingSnapshot();
|
|
27
|
-
});
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
describe('when called with empty group name', () => {
|
|
31
|
-
describe('and plain object of assets', () => {
|
|
32
|
-
it('should create root asset groups', () => {
|
|
33
|
-
const emojis = {};
|
|
34
|
-
const icons = {};
|
|
35
|
-
assets.loadAssetsGroup('', {emojis, icons});
|
|
36
|
-
|
|
37
|
-
expect(assets.emojis).toBe(emojis);
|
|
38
|
-
expect(assets.icons).toBe(icons);
|
|
39
|
-
});
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
describe('and an object with assets getters', () => {
|
|
43
|
-
it('should create lazy root asset groups', () => {
|
|
44
|
-
const emojis = {};
|
|
45
|
-
const heavyIconsModule = {};
|
|
46
|
-
const requireHeavyIcons = jest.fn().mockReturnValue(heavyIconsModule);
|
|
47
|
-
|
|
48
|
-
assets.loadAssetsGroup('', {
|
|
49
|
-
emojis,
|
|
50
|
-
get icons() {
|
|
51
|
-
return requireHeavyIcons();
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
expect(assets.emojis).toBe(emojis);
|
|
56
|
-
|
|
57
|
-
expect(requireHeavyIcons).not.toHaveBeenCalled();
|
|
58
|
-
expect(assets.icons).toBe(heavyIconsModule);
|
|
59
|
-
expect(requireHeavyIcons).toHaveBeenCalled();
|
|
60
|
-
});
|
|
61
|
-
});
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
describe('when has a lazy group', () => {
|
|
65
|
-
let iconsModule;
|
|
66
|
-
|
|
67
|
-
beforeEach(() => {
|
|
68
|
-
iconsModule = {
|
|
69
|
-
get apply() {
|
|
70
|
-
return './apply.png';
|
|
71
|
-
},
|
|
72
|
-
get back() {
|
|
73
|
-
return './back.png';
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
assets.loadAssetsGroup('', {
|
|
78
|
-
get icons() {
|
|
79
|
-
return iconsModule;
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
describe('and called with the same group name', () => {
|
|
85
|
-
beforeEach(() => {
|
|
86
|
-
assets.loadAssetsGroup('icons', {
|
|
87
|
-
get back() {
|
|
88
|
-
return './back-dark.png';
|
|
89
|
-
},
|
|
90
|
-
get forward() {
|
|
91
|
-
return './forward-dark.png';
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
});
|
|
95
|
-
|
|
96
|
-
it('should preserve existing assets upon load', () => {
|
|
97
|
-
expect(assets.icons.apply).toBe('./apply.png');
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
it('should overwrite existing assets if they have the same names', () => {
|
|
101
|
-
expect(assets.icons.back).toBe('./back-dark.png');
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
it('should append extra assets to the group', () => {
|
|
105
|
-
expect(assets.icons.forward).toBe('./forward-dark.png');
|
|
106
|
-
});
|
|
107
|
-
});
|
|
108
|
-
});
|
|
109
|
-
});
|
|
110
|
-
});
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import baseComponent from '../baseComponent';
|
|
2
|
-
import {Colors} from '../../style';
|
|
3
|
-
|
|
4
|
-
const BaseComponent = baseComponent(false);
|
|
5
|
-
|
|
6
|
-
describe('BaseComponent', () => {
|
|
7
|
-
|
|
8
|
-
describe('updateModifiers', () => {
|
|
9
|
-
it('should update state with new modifiers values if modifiers props have changed', () => {
|
|
10
|
-
const uut = new BaseComponent({});
|
|
11
|
-
jest.spyOn(uut, 'setState');
|
|
12
|
-
|
|
13
|
-
uut.updateModifiers({someProp: true, 'bg-grey20': true}, {someProp: true, 'bg-grey30': true});
|
|
14
|
-
expect(uut.setState).toHaveBeenCalledWith({backgroundColor: Colors.grey30});
|
|
15
|
-
|
|
16
|
-
uut.updateModifiers({someProp: 'text'}, {'bg-red50': true, 'padding-20': true});
|
|
17
|
-
expect(uut.setState).toHaveBeenCalledWith({backgroundColor: Colors.red50, paddings: {padding: 20}});
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
it('should not update state if modifiers prop have not changed', () => {
|
|
21
|
-
const uut = new BaseComponent({});
|
|
22
|
-
jest.spyOn(uut, 'setState');
|
|
23
|
-
|
|
24
|
-
uut.updateModifiers({someProp: true, 'bg-grey20': true}, {someProp: false, 'bg-grey20': true});
|
|
25
|
-
expect(uut.setState).not.toHaveBeenCalled();
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
it('should not update state if any prop value has changed', () => {
|
|
29
|
-
const uut = new BaseComponent({});
|
|
30
|
-
jest.spyOn(uut, 'setState');
|
|
31
|
-
|
|
32
|
-
uut.updateModifiers({someProp: true, 'bg-grey20': true}, {someProp: true, 'bg-grey20': true});
|
|
33
|
-
expect(uut.setState).not.toHaveBeenCalled();
|
|
34
|
-
});
|
|
35
|
-
});
|
|
36
|
-
});
|
|
@@ -1,202 +0,0 @@
|
|
|
1
|
-
import { default as Constants, updateConstants, _reset } from "../Constants";
|
|
2
|
-
describe('Constants', () => {
|
|
3
|
-
beforeEach(() => {
|
|
4
|
-
_reset();
|
|
5
|
-
});
|
|
6
|
-
describe('Breakpoints and Page Margins', () => {
|
|
7
|
-
it('getPageMargins without init should return 0', () => {
|
|
8
|
-
expect(Constants.getPageMargins()).toBe(0);
|
|
9
|
-
});
|
|
10
|
-
it('getPageMargins with one breakpoint', () => {
|
|
11
|
-
const original = {
|
|
12
|
-
screen: {
|
|
13
|
-
width: Constants.screenWidth,
|
|
14
|
-
height: Constants.screenHeight
|
|
15
|
-
},
|
|
16
|
-
window: {
|
|
17
|
-
width: Constants.windowWidth,
|
|
18
|
-
height: Constants.windowHeight
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
updateConstants({
|
|
22
|
-
screen: {
|
|
23
|
-
width: 50,
|
|
24
|
-
height: 50
|
|
25
|
-
},
|
|
26
|
-
window: {
|
|
27
|
-
width: 50,
|
|
28
|
-
height: 50
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
Constants.setBreakpoints([{
|
|
32
|
-
breakpoint: 100,
|
|
33
|
-
pageMargin: 5
|
|
34
|
-
}]);
|
|
35
|
-
expect(Constants.getPageMargins()).toBe(0);
|
|
36
|
-
updateConstants(original);
|
|
37
|
-
expect(Constants.getPageMargins()).toBe(5);
|
|
38
|
-
});
|
|
39
|
-
it('getPageMargins with one breakpoint and a default', () => {
|
|
40
|
-
const original = {
|
|
41
|
-
screen: {
|
|
42
|
-
width: Constants.screenWidth,
|
|
43
|
-
height: Constants.screenHeight
|
|
44
|
-
},
|
|
45
|
-
window: {
|
|
46
|
-
width: Constants.windowWidth,
|
|
47
|
-
height: Constants.windowHeight
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
updateConstants({
|
|
51
|
-
screen: {
|
|
52
|
-
width: 50,
|
|
53
|
-
height: 50
|
|
54
|
-
},
|
|
55
|
-
window: {
|
|
56
|
-
width: 50,
|
|
57
|
-
height: 50
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
Constants.setBreakpoints([{
|
|
61
|
-
breakpoint: 100,
|
|
62
|
-
pageMargin: 5
|
|
63
|
-
}], {
|
|
64
|
-
defaultMargin: 3
|
|
65
|
-
});
|
|
66
|
-
expect(Constants.getPageMargins()).toBe(3);
|
|
67
|
-
updateConstants(original);
|
|
68
|
-
expect(Constants.getPageMargins()).toBe(5);
|
|
69
|
-
});
|
|
70
|
-
it('getPageMargins with three breakpoints', () => {
|
|
71
|
-
const original = {
|
|
72
|
-
screen: {
|
|
73
|
-
width: Constants.screenWidth,
|
|
74
|
-
height: Constants.screenHeight
|
|
75
|
-
},
|
|
76
|
-
window: {
|
|
77
|
-
width: Constants.windowWidth,
|
|
78
|
-
height: Constants.windowHeight
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
updateConstants({
|
|
82
|
-
screen: {
|
|
83
|
-
width: 50,
|
|
84
|
-
height: 50
|
|
85
|
-
},
|
|
86
|
-
window: {
|
|
87
|
-
width: 50,
|
|
88
|
-
height: 50
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
Constants.setBreakpoints([{
|
|
92
|
-
breakpoint: 100,
|
|
93
|
-
pageMargin: 5
|
|
94
|
-
}, {
|
|
95
|
-
breakpoint: 1000,
|
|
96
|
-
pageMargin: 10
|
|
97
|
-
}]);
|
|
98
|
-
expect(Constants.getPageMargins()).toBe(0);
|
|
99
|
-
updateConstants({
|
|
100
|
-
screen: {
|
|
101
|
-
width: 1200,
|
|
102
|
-
height: 1200
|
|
103
|
-
},
|
|
104
|
-
window: {
|
|
105
|
-
width: 1200,
|
|
106
|
-
height: 1200
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
|
-
expect(Constants.getPageMargins()).toBe(10);
|
|
110
|
-
updateConstants(original);
|
|
111
|
-
expect(Constants.getPageMargins()).toBe(5);
|
|
112
|
-
});
|
|
113
|
-
it('getPageMargins with three breakpoints and a default', () => {
|
|
114
|
-
const original = {
|
|
115
|
-
screen: {
|
|
116
|
-
width: Constants.screenWidth,
|
|
117
|
-
height: Constants.screenHeight
|
|
118
|
-
},
|
|
119
|
-
window: {
|
|
120
|
-
width: Constants.windowWidth,
|
|
121
|
-
height: Constants.windowHeight
|
|
122
|
-
}
|
|
123
|
-
};
|
|
124
|
-
updateConstants({
|
|
125
|
-
screen: {
|
|
126
|
-
width: 50,
|
|
127
|
-
height: 50
|
|
128
|
-
},
|
|
129
|
-
window: {
|
|
130
|
-
width: 50,
|
|
131
|
-
height: 50
|
|
132
|
-
}
|
|
133
|
-
});
|
|
134
|
-
Constants.setBreakpoints([{
|
|
135
|
-
breakpoint: 100,
|
|
136
|
-
pageMargin: 5
|
|
137
|
-
}, {
|
|
138
|
-
breakpoint: 1000,
|
|
139
|
-
pageMargin: 10
|
|
140
|
-
}], {
|
|
141
|
-
defaultMargin: 3
|
|
142
|
-
});
|
|
143
|
-
expect(Constants.getPageMargins()).toBe(3);
|
|
144
|
-
updateConstants({
|
|
145
|
-
screen: {
|
|
146
|
-
width: 1200,
|
|
147
|
-
height: 1200
|
|
148
|
-
},
|
|
149
|
-
window: {
|
|
150
|
-
width: 1200,
|
|
151
|
-
height: 1200
|
|
152
|
-
}
|
|
153
|
-
});
|
|
154
|
-
expect(Constants.getPageMargins()).toBe(10);
|
|
155
|
-
updateConstants(original);
|
|
156
|
-
expect(Constants.getPageMargins()).toBe(5);
|
|
157
|
-
});
|
|
158
|
-
it('setBreakpoints should arrange input in order', () => {
|
|
159
|
-
const original = {
|
|
160
|
-
screen: {
|
|
161
|
-
width: Constants.screenWidth,
|
|
162
|
-
height: Constants.screenHeight
|
|
163
|
-
},
|
|
164
|
-
window: {
|
|
165
|
-
width: Constants.windowWidth,
|
|
166
|
-
height: Constants.windowHeight
|
|
167
|
-
}
|
|
168
|
-
};
|
|
169
|
-
updateConstants({
|
|
170
|
-
screen: {
|
|
171
|
-
width: 50,
|
|
172
|
-
height: 50
|
|
173
|
-
},
|
|
174
|
-
window: {
|
|
175
|
-
width: 50,
|
|
176
|
-
height: 50
|
|
177
|
-
}
|
|
178
|
-
});
|
|
179
|
-
Constants.setBreakpoints([{
|
|
180
|
-
breakpoint: 1000,
|
|
181
|
-
pageMargin: 10
|
|
182
|
-
}, {
|
|
183
|
-
breakpoint: 100,
|
|
184
|
-
pageMargin: 5
|
|
185
|
-
}]);
|
|
186
|
-
expect(Constants.getPageMargins()).toBe(0);
|
|
187
|
-
updateConstants({
|
|
188
|
-
screen: {
|
|
189
|
-
width: 1200,
|
|
190
|
-
height: 1200
|
|
191
|
-
},
|
|
192
|
-
window: {
|
|
193
|
-
width: 1200,
|
|
194
|
-
height: 1200
|
|
195
|
-
}
|
|
196
|
-
});
|
|
197
|
-
expect(Constants.getPageMargins()).toBe(10);
|
|
198
|
-
updateConstants(original);
|
|
199
|
-
expect(Constants.getPageMargins()).toBe(5);
|
|
200
|
-
});
|
|
201
|
-
});
|
|
202
|
-
});
|