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
|
@@ -1,216 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
#import "HighlighterView.h"
|
|
3
|
-
#import <React/RCTUIManager.h>
|
|
4
|
-
|
|
5
|
-
#define kDefaultOverlayColor [UIColor colorWithWhite:0 alpha:0.8]
|
|
6
|
-
|
|
7
|
-
@interface HighlighterView ()
|
|
8
|
-
{
|
|
9
|
-
RCTBridge* _bridge;
|
|
10
|
-
CGRect _viewBasedHighlightFrame;
|
|
11
|
-
UIView *_highlightedView;
|
|
12
|
-
}
|
|
13
|
-
@end
|
|
14
|
-
|
|
15
|
-
@implementation HighlighterView
|
|
16
|
-
|
|
17
|
-
- (id)initWithFrame:(CGRect)frame bridge:(RCTBridge*)bridge
|
|
18
|
-
{
|
|
19
|
-
self = [super initWithFrame:frame];
|
|
20
|
-
if (self)
|
|
21
|
-
{
|
|
22
|
-
_bridge = bridge;
|
|
23
|
-
self.highlightFrame = CGRectNull;
|
|
24
|
-
_viewBasedHighlightFrame = CGRectNull;
|
|
25
|
-
self.backgroundColor = [UIColor clearColor];
|
|
26
|
-
self.overlayColor = kDefaultOverlayColor;
|
|
27
|
-
self.minimumRectSize = CGSizeZero;
|
|
28
|
-
self.innerPadding = 0;
|
|
29
|
-
}
|
|
30
|
-
return self;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
- (void)dealloc
|
|
34
|
-
{
|
|
35
|
-
[self clearObserver];
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
- (BOOL)isFrameValid:(CGRect)frame
|
|
39
|
-
{
|
|
40
|
-
return !CGRectIsNull(frame) && frame.size.width > 0 && frame.size.height > 0;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
-(CGRect)adjustFrame:(CGRect)frame {
|
|
44
|
-
CGFloat x = frame.origin.x;
|
|
45
|
-
CGFloat y = frame.origin.y;
|
|
46
|
-
CGFloat width = frame.size.width + self.innerPadding * 2;
|
|
47
|
-
CGFloat height = frame.size.height + self.innerPadding * 2;
|
|
48
|
-
|
|
49
|
-
width = width < self.minimumRectSize.width ? self.minimumRectSize.width : width;
|
|
50
|
-
height = height < self.minimumRectSize.height ? self.minimumRectSize.height : height;
|
|
51
|
-
x = x - ((width - frame.size.width) / 2);
|
|
52
|
-
y = y - ((height - frame.size.height) / 2);
|
|
53
|
-
|
|
54
|
-
return CGRectMake(x, y, width, height);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
-(CGRect)getHighlightRect
|
|
58
|
-
{
|
|
59
|
-
CGRect highlightRect = self.highlightFrame;
|
|
60
|
-
if ([self isFrameValid:_viewBasedHighlightFrame]) {
|
|
61
|
-
// highlightRect = _viewBasedHighlightFrame;
|
|
62
|
-
highlightRect = [self adjustFrame: _viewBasedHighlightFrame];
|
|
63
|
-
if (_highlightViewTagParams != nil) {
|
|
64
|
-
id padding = _highlightViewTagParams[@"padding"];
|
|
65
|
-
if (padding != nil) {
|
|
66
|
-
if ([padding isKindOfClass:[NSNumber class]]) {
|
|
67
|
-
CGFloat paddingValue = [(NSNumber*)padding floatValue];
|
|
68
|
-
highlightRect = CGRectMake(_viewBasedHighlightFrame.origin.x - paddingValue,
|
|
69
|
-
_viewBasedHighlightFrame.origin.y - paddingValue,
|
|
70
|
-
_viewBasedHighlightFrame.size.width + paddingValue * 2,
|
|
71
|
-
_viewBasedHighlightFrame.size.height + paddingValue * 2);
|
|
72
|
-
} else if ([padding isKindOfClass:[NSDictionary class]]) {
|
|
73
|
-
NSDictionary *paddingDic = (NSDictionary*)padding;
|
|
74
|
-
CGFloat top = [paddingDic[@"top"] floatValue];
|
|
75
|
-
CGFloat left = [paddingDic[@"left"] floatValue];
|
|
76
|
-
CGFloat bottom = [paddingDic[@"bottom"] floatValue];
|
|
77
|
-
CGFloat right = [paddingDic[@"right"] floatValue];
|
|
78
|
-
highlightRect = CGRectMake(_viewBasedHighlightFrame.origin.x - left,
|
|
79
|
-
_viewBasedHighlightFrame.origin.y - top,
|
|
80
|
-
_viewBasedHighlightFrame.size.width + right + left,
|
|
81
|
-
_viewBasedHighlightFrame.size.height + bottom + top);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
NSDictionary *offset = _highlightViewTagParams[@"offset"];
|
|
86
|
-
if (offset != nil) {
|
|
87
|
-
highlightRect = CGRectOffset(highlightRect, [offset[@"x"] floatValue], [offset[@"y"] floatValue]);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
return highlightRect;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
- (CGSize)getCornerRadiiForHighlightRect:(CGRect)highlightRect {
|
|
95
|
-
CGSize cornerRadii = CGSizeMake(highlightRect.size.width/2, highlightRect.size.height/2);
|
|
96
|
-
if (self.borderRadius != nil) {
|
|
97
|
-
CGFloat radius = [self.borderRadius floatValue];
|
|
98
|
-
cornerRadii = CGSizeMake(radius, radius);
|
|
99
|
-
}
|
|
100
|
-
return cornerRadii;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
- (void)drawRect:(CGRect)rect
|
|
104
|
-
{
|
|
105
|
-
if (![self isFrameValid:self.highlightFrame] && ![self isFrameValid:_viewBasedHighlightFrame]) {
|
|
106
|
-
UIColor *color = self.overlayColor ? self.overlayColor : [UIColor clearColor];
|
|
107
|
-
[color setFill];
|
|
108
|
-
UIRectFill(rect);
|
|
109
|
-
return;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
CGContextRef context = UIGraphicsGetCurrentContext();
|
|
113
|
-
CGContextClearRect(context, rect);
|
|
114
|
-
|
|
115
|
-
CGRect highlightRect = [self getHighlightRect];
|
|
116
|
-
CGSize cornerRadii = [self getCornerRadiiForHighlightRect:highlightRect];
|
|
117
|
-
|
|
118
|
-
UIBezierPath *clipPath = [UIBezierPath bezierPathWithRect:CGRectInfinite];
|
|
119
|
-
UIBezierPath *roundPath = [UIBezierPath bezierPathWithRoundedRect:highlightRect byRoundingCorners:UIRectCornerAllCorners cornerRadii:cornerRadii];
|
|
120
|
-
[clipPath appendPath:roundPath];
|
|
121
|
-
clipPath.usesEvenOddFillRule = YES;
|
|
122
|
-
|
|
123
|
-
CGContextSaveGState(context);
|
|
124
|
-
[clipPath addClip];
|
|
125
|
-
[self.overlayColor setFill];
|
|
126
|
-
UIRectFill(rect);
|
|
127
|
-
|
|
128
|
-
if (self.strokeColor && self.strokeWidth) {
|
|
129
|
-
CGContextAddPath(context, roundPath.CGPath);
|
|
130
|
-
[self.strokeColor setStroke];
|
|
131
|
-
CGContextSetLineWidth(context, [self.strokeWidth floatValue]);
|
|
132
|
-
CGContextStrokePath(context);
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
CGContextRestoreGState(context);
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
-(void)setHighlightFrame:(CGRect)highlightFrame
|
|
139
|
-
{
|
|
140
|
-
if ([self isFrameValid:highlightFrame]) {
|
|
141
|
-
_highlightFrame = highlightFrame;
|
|
142
|
-
[self setNeedsDisplay];
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
-(void)setOverlayColor:(UIColor *)overlayColor
|
|
147
|
-
{
|
|
148
|
-
_overlayColor = overlayColor;
|
|
149
|
-
[self setNeedsDisplay];
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
-(void)setMinimumRectSize:(CGSize)minimumRectSize
|
|
153
|
-
{
|
|
154
|
-
_minimumRectSize = minimumRectSize;
|
|
155
|
-
[self setNeedsDisplay];
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
-(void)setInnerPadding:(CGFloat)innerPadding
|
|
159
|
-
{
|
|
160
|
-
_innerPadding = innerPadding;
|
|
161
|
-
[self setNeedsDisplay];
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
-(void)setViewBasedHighlightFrameFromView:(UIView*)view {
|
|
165
|
-
_viewBasedHighlightFrame = [self convertRect:view.frame fromView:view.superview];
|
|
166
|
-
[self setNeedsDisplay];
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
-(void)setHighlightViewTag:(NSNumber *)highlightViewTag
|
|
170
|
-
{
|
|
171
|
-
if (highlightViewTag) {
|
|
172
|
-
UIView *view = [_bridge.uiManager viewForReactTag:highlightViewTag];
|
|
173
|
-
if (view != nil) {
|
|
174
|
-
if (view.frame.size.width == 0 || view.frame.size.height == 0) {
|
|
175
|
-
_highlightedView = view;
|
|
176
|
-
[_highlightedView.layer addObserver:self forKeyPath:@"frame" options:NSKeyValueObservingOptionNew context:nil];
|
|
177
|
-
[_highlightedView.layer addObserver:self forKeyPath:@"bounds" options:NSKeyValueObservingOptionNew context:NULL];
|
|
178
|
-
} else {
|
|
179
|
-
[self setViewBasedHighlightFrameFromView:view];
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
-(void)setHighlightViewTagParams:(NSDictionary*)highlightViewTagParams
|
|
186
|
-
{
|
|
187
|
-
_highlightViewTagParams = highlightViewTagParams;
|
|
188
|
-
[self setNeedsDisplay];
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
#pragma mark - KVO
|
|
192
|
-
|
|
193
|
-
-(void)clearObserver
|
|
194
|
-
{
|
|
195
|
-
if (_highlightedView != nil) {
|
|
196
|
-
[_highlightedView.layer removeObserver:self forKeyPath:@"frame"];
|
|
197
|
-
[_highlightedView.layer removeObserver:self forKeyPath:@"bounds"];
|
|
198
|
-
_highlightedView = nil;
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
|
|
203
|
-
{
|
|
204
|
-
if ((object == _highlightedView.layer) && ([keyPath isEqualToString:@"frame"] || [keyPath isEqualToString:@"bounds"]))
|
|
205
|
-
{
|
|
206
|
-
CGRect frame = [change[NSKeyValueChangeNewKey] CGRectValue];
|
|
207
|
-
if (frame.size.width > 0 && frame.size.height > 0) {
|
|
208
|
-
dispatch_async(dispatch_get_main_queue(), ^{
|
|
209
|
-
[self setViewBasedHighlightFrameFromView:_highlightedView];
|
|
210
|
-
[self clearObserver];
|
|
211
|
-
});
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
@end
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
#import "HighlighterViewManager.h"
|
|
2
|
-
#import "HighlighterView.h"
|
|
3
|
-
|
|
4
|
-
@implementation HighlighterViewManager
|
|
5
|
-
|
|
6
|
-
RCT_EXPORT_MODULE()
|
|
7
|
-
|
|
8
|
-
- (dispatch_queue_t)methodQueue {
|
|
9
|
-
return dispatch_get_main_queue();
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
- (UIView *)view
|
|
13
|
-
{
|
|
14
|
-
return [[HighlighterView alloc] initWithFrame:CGRectZero bridge:self.bridge];
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
RCT_REMAP_VIEW_PROPERTY(highlightFrame, highlightFrame, CGRect)
|
|
18
|
-
RCT_REMAP_VIEW_PROPERTY(highlightViewTag, highlightViewTag, NSNumber)
|
|
19
|
-
RCT_REMAP_VIEW_PROPERTY(highlightViewTagParams, highlightViewTagParams, NSDictionary)
|
|
20
|
-
RCT_REMAP_VIEW_PROPERTY(overlayColor, overlayColor, UIColor)
|
|
21
|
-
RCT_REMAP_VIEW_PROPERTY(borderRadius, borderRadius, NSNumber)
|
|
22
|
-
RCT_REMAP_VIEW_PROPERTY(strokeColor, strokeColor, UIColor)
|
|
23
|
-
RCT_REMAP_VIEW_PROPERTY(strokeWidth, strokeWidth, NSNumber)
|
|
24
|
-
RCT_REMAP_VIEW_PROPERTY(minimumRectSize, minimumRectSize, CGSize)
|
|
25
|
-
RCT_REMAP_VIEW_PROPERTY(innerPadding, innerPadding, CGFloat)
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
@end
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Color+Interpolation.h
|
|
3
|
-
//
|
|
4
|
-
// Created by Leo Natan on 01/10/2016.
|
|
5
|
-
// Copyright © 2016 Leo Natan. All rights reserved.
|
|
6
|
-
//
|
|
7
|
-
|
|
8
|
-
#if __has_include(<UIKit/UIKit.h>) || __has_include(<AppKit/AppKit.h>)
|
|
9
|
-
|
|
10
|
-
#import "LNInterpolable.h"
|
|
11
|
-
|
|
12
|
-
#if __has_include(<UIKit/UIKit.h>)
|
|
13
|
-
#import <UIKit/UIKit.h>
|
|
14
|
-
#else
|
|
15
|
-
#import <AppKit/AppKit.h>
|
|
16
|
-
#endif
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
Interpolate using the LAB color space for optimal quality. This constant is equal to @c LNUseDefaultInterpolationBehavior.
|
|
20
|
-
*/
|
|
21
|
-
extern LNInterpolationBehavior const RNUIInterpolationBehaviorUseLABColorSpace;
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
Interpolate using the RGB color space.
|
|
25
|
-
*/
|
|
26
|
-
extern LNInterpolationBehavior const RNUIInterpolationBehaviorUseRGBColorSpace;
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
Interpolates between colors.
|
|
30
|
-
|
|
31
|
-
By default, colors are interpolated in the Lab color space for optimal quality at the expense of some performance. Use @c LNUseRGBInterpolationBehavior for better performance but suboptimal quality.
|
|
32
|
-
*/
|
|
33
|
-
#if __has_include(<UIKit/UIKit.h>)
|
|
34
|
-
@interface UIColor (LNInterpolation) <LNInterpolable> @end
|
|
35
|
-
#else
|
|
36
|
-
@interface NSColor (LNInterpolation) <LNInterpolable> @end
|
|
37
|
-
#endif
|
|
38
|
-
|
|
39
|
-
#endif
|
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Color+Interpolation.m
|
|
3
|
-
//
|
|
4
|
-
// Created by Leo Natan on 01/10/2016.
|
|
5
|
-
// Copyright © 2016 Leo Natan. All rights reserved.
|
|
6
|
-
//
|
|
7
|
-
|
|
8
|
-
#if __has_include(<UIKit/UIKit.h>) || __has_include(<AppKit/AppKit.h>)
|
|
9
|
-
|
|
10
|
-
#import "Color+Interpolation.h"
|
|
11
|
-
|
|
12
|
-
#if __has_include(<UIKit/UIKit.h>)
|
|
13
|
-
#define Color UIColor
|
|
14
|
-
#else
|
|
15
|
-
#define Color NSColor
|
|
16
|
-
#endif
|
|
17
|
-
|
|
18
|
-
#define SWAP(x, y) do { __typeof(x) __ZZZZ__SWAP = x; x = y; y = __ZZZZ__SWAP; } while(0)
|
|
19
|
-
|
|
20
|
-
//Same value as LNInterpolationBehaviorUseDefault
|
|
21
|
-
LNInterpolationBehavior const RNUIInterpolationBehaviorUseLABColorSpace = @"LNInterpolationBehaviorUseDefault";
|
|
22
|
-
LNInterpolationBehavior const RNUIInterpolationBehaviorUseRGBColorSpace = @"LNInterpolationBehaviorUseRGB";
|
|
23
|
-
|
|
24
|
-
extern double LNLinearInterpolate(double from, double to, double p);
|
|
25
|
-
|
|
26
|
-
static NSArray<NSNumber*>* LNRGBComponentsFromColor(Color* color)
|
|
27
|
-
{
|
|
28
|
-
size_t numberOfComponents = CGColorGetNumberOfComponents(color.CGColor);
|
|
29
|
-
const CGFloat* components = CGColorGetComponents(color.CGColor);
|
|
30
|
-
|
|
31
|
-
return numberOfComponents == 2 ? @[@(components[0]), @(components[0]), @(components[0]), @(components[1])] : @[@(components[0]), @(components[1]), @(components[2]), @(components[3])];
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
static Color* LNColorFromRGBComponents(NSArray<NSNumber*>* components)
|
|
35
|
-
{
|
|
36
|
-
return [Color colorWithRed:components[0].doubleValue green:components[1].doubleValue blue:components[2].doubleValue alpha:components[3].doubleValue];
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
static NSArray<NSNumber*>* LNLabComponentsFromColor(Color* color)
|
|
40
|
-
{
|
|
41
|
-
NSArray<NSNumber*>* rgbComponents = LNRGBComponentsFromColor(color);
|
|
42
|
-
CGFloat r = rgbComponents[0].doubleValue;
|
|
43
|
-
CGFloat g = rgbComponents[1].doubleValue;
|
|
44
|
-
CGFloat b = rgbComponents[2].doubleValue;
|
|
45
|
-
|
|
46
|
-
//RGB -> XYZ
|
|
47
|
-
//http://www.brucelindbloom.com/index.html?Eqn_RGB_to_XYZ.html
|
|
48
|
-
|
|
49
|
-
r = (r > 0.04045) ? pow((r + 0.055) / 1.055, 2.4) : (r / 12.92);
|
|
50
|
-
g = (g > 0.04045) ? pow((g + 0.055) / 1.055, 2.4) : (g / 12.92);
|
|
51
|
-
b = (b > 0.04045) ? pow((b + 0.055) / 1.055, 2.4) : (b / 12.92);
|
|
52
|
-
|
|
53
|
-
//http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html (sRGB -> XYZ)
|
|
54
|
-
CGFloat x = r * 41.24564 + g * 35.75761 + b * 18.04375;
|
|
55
|
-
CGFloat y = r * 21.26729 + g * 71.51522 + b * 07.21750;
|
|
56
|
-
CGFloat z = r * 01.93339 + g * 11.91920 + b * 95.03041;
|
|
57
|
-
|
|
58
|
-
//XYZ -> Lab
|
|
59
|
-
//http://www.brucelindbloom.com/index.html?Eqn_XYZ_to_Lab.html
|
|
60
|
-
|
|
61
|
-
static const CGFloat eps = 216.0 / 24389.0;
|
|
62
|
-
static const CGFloat k = 24389.0 / 27.0;
|
|
63
|
-
|
|
64
|
-
x = x / 100.0;//95.047;
|
|
65
|
-
y = y / 100.0;//100.000;
|
|
66
|
-
z = z / 100.0;//108.883;
|
|
67
|
-
|
|
68
|
-
x = x > eps ? pow(x, 1.0 / 3.0) : (k * x + 16.0) / 116.0;
|
|
69
|
-
y = y > eps ? pow(y, 1.0 / 3.0) : (k * y + 16.0) / 116.0;
|
|
70
|
-
z = z > eps ? pow(z, 1.0 / 3.0) : (k * z + 16.0) / 116.0;
|
|
71
|
-
|
|
72
|
-
CGFloat l = 116 * y - 16;
|
|
73
|
-
CGFloat a = 500 * (x - y);
|
|
74
|
-
b = 200 * (y - z);
|
|
75
|
-
|
|
76
|
-
return @[@(l), @(a), @(b), rgbComponents[3]];
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
static Color* LNColorFromLabComponents(NSArray<NSNumber*>* components)
|
|
80
|
-
{
|
|
81
|
-
CGFloat l = components[0].doubleValue;
|
|
82
|
-
CGFloat a = components[1].doubleValue;
|
|
83
|
-
CGFloat b = components[2].doubleValue;
|
|
84
|
-
|
|
85
|
-
//Lab -> XYZ
|
|
86
|
-
//http://www.brucelindbloom.com/index.html?Eqn_Lab_to_XYZ.html
|
|
87
|
-
|
|
88
|
-
static const CGFloat eps = 216.0 / 24389.0;
|
|
89
|
-
static const CGFloat k = 24389.0 / 27.0;
|
|
90
|
-
|
|
91
|
-
CGFloat y = (l + 16.0) / 116.0;
|
|
92
|
-
CGFloat x = a / 500 + y;
|
|
93
|
-
CGFloat z = y - b / 200;
|
|
94
|
-
|
|
95
|
-
x = pow(x, 3.0) > eps ? pow(x, 3.0) : (116 * x - 16) / k;
|
|
96
|
-
y = l > k * eps ? pow((l + 16) / 116, 3.0) : l / k;
|
|
97
|
-
z = pow(z, 3.0) > eps ? pow(z, 3.0) : (116 * z - 16) / k;
|
|
98
|
-
|
|
99
|
-
x = x * 1.0;//.95047;
|
|
100
|
-
y = y * 1.0;//1.00000;
|
|
101
|
-
z = z * 1.0;//1.08883;
|
|
102
|
-
|
|
103
|
-
//XYZ -> RGB
|
|
104
|
-
|
|
105
|
-
//http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html (XYZ -> sRGB)
|
|
106
|
-
CGFloat r = x * 3.2404542 + y * -1.5371385 + z * -0.4985314;
|
|
107
|
-
CGFloat g = x * -0.9692660 + y * 1.8760108 + z * 0.0415560;
|
|
108
|
-
b = x * 0.0556434 + y * -0.2040259 + z * 1.0572252;
|
|
109
|
-
|
|
110
|
-
r = r <= 0.0031308 ? 12.92 * r : 1.055 * pow(r, 1.0 / 2.4) - 0.055;
|
|
111
|
-
g = g <= 0.0031308 ? 12.92 * g : 1.055 * pow(g, 1.0 / 2.4) - 0.055;
|
|
112
|
-
b = b <= 0.0031308 ? 12.92 * b : 1.055 * pow(b, 1.0 / 2.4) - 0.055;
|
|
113
|
-
|
|
114
|
-
// return Color
|
|
115
|
-
return LNColorFromRGBComponents(@[@(r), @(g), @(b), components[3]]);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
static inline Color* LNInterpolateColor(Color* fromValue, Color* toValue, CGFloat p, NSArray* (*compConverter)(Color*), Color* (*colorConverter)(NSArray*))
|
|
119
|
-
{
|
|
120
|
-
NSArray<NSNumber*>* arrayC1 = compConverter(fromValue);
|
|
121
|
-
NSArray<NSNumber*>* arrayC2 = compConverter(toValue);
|
|
122
|
-
|
|
123
|
-
NSMutableArray<NSNumber*>* arrayOutput = [NSMutableArray new];
|
|
124
|
-
[arrayC1 enumerateObjectsUsingBlock:^(NSNumber * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
|
125
|
-
arrayOutput[idx] = @(LNLinearInterpolate(obj.doubleValue, arrayC2[idx].doubleValue, p));
|
|
126
|
-
}];
|
|
127
|
-
|
|
128
|
-
return colorConverter(arrayOutput);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
@implementation Color (Interpolation)
|
|
132
|
-
|
|
133
|
-
- (instancetype)interpolateToValue:(Color*)toValue progress:(double)p
|
|
134
|
-
{
|
|
135
|
-
return [self interpolateToValue:toValue progress:p behavior:LNInterpolationBehaviorUseDefault];
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
- (instancetype)interpolateToValue:(id)toValue progress:(double)p behavior:(LNInterpolationBehavior)behavior
|
|
139
|
-
{
|
|
140
|
-
if([toValue isKindOfClass:[Color class]] == NO)
|
|
141
|
-
{
|
|
142
|
-
return nil;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
if(p <= 0)
|
|
146
|
-
{
|
|
147
|
-
return self;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
if(p >= 1)
|
|
151
|
-
{
|
|
152
|
-
return toValue;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
return LNInterpolateColor(self, toValue, p, behavior == RNUIInterpolationBehaviorUseRGBColorSpace ? LNRGBComponentsFromColor : LNLabComponentsFromColor, behavior == RNUIInterpolationBehaviorUseRGBColorSpace ? LNColorFromRGBComponents : LNColorFromLabComponents);
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
@end
|
|
159
|
-
|
|
160
|
-
#endif
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// LNFrameAnimator.h
|
|
3
|
-
// KeyboardTransitionDemo
|
|
4
|
-
//
|
|
5
|
-
// Created by Leo Natan (Wix) on 11/05/2017.
|
|
6
|
-
// Copyright © 2017 Wix. All rights reserved.
|
|
7
|
-
//
|
|
8
|
-
|
|
9
|
-
@import UIKit;
|
|
10
|
-
|
|
11
|
-
@protocol LNAnimationTemp <NSObject>
|
|
12
|
-
|
|
13
|
-
@property (nonatomic) CGFloat progress;
|
|
14
|
-
|
|
15
|
-
@end
|
|
16
|
-
|
|
17
|
-
@interface LNViewAnimationTemp : NSObject <LNAnimationTemp>
|
|
18
|
-
|
|
19
|
-
@property (nonatomic, strong, readonly) UIView* view;
|
|
20
|
-
@property (nonatomic, strong, readonly) NSString* keyPath;
|
|
21
|
-
@property (nonatomic, strong, readonly) id toValue;
|
|
22
|
-
|
|
23
|
-
+ (instancetype)animationWithView:(UIView*)view keyPath:(NSString*)keyPath toValue:(id)toValue;
|
|
24
|
-
|
|
25
|
-
@end
|
|
26
|
-
|
|
27
|
-
@interface LNAnimatorTemp : NSObject
|
|
28
|
-
|
|
29
|
-
@property (nonatomic, readonly) NSTimeInterval duration;
|
|
30
|
-
@property (nonatomic, strong, readonly) NSArray<id<LNAnimationTemp>>* animations;
|
|
31
|
-
|
|
32
|
-
+ (instancetype)animatorWithDuration:(NSTimeInterval)duration animations:(NSArray<id<LNAnimationTemp>>*)animations completionHandler:(void(^)(BOOL completed))completionHandler;
|
|
33
|
-
|
|
34
|
-
- (void)start;
|
|
35
|
-
|
|
36
|
-
@end
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// LNFrameAnimator.m
|
|
3
|
-
// KeyboardTransitionDemo
|
|
4
|
-
//
|
|
5
|
-
// Created by Leo Natan (Wix) on 11/05/2017.
|
|
6
|
-
// Copyright © 2017 Wix. All rights reserved.
|
|
7
|
-
//
|
|
8
|
-
|
|
9
|
-
#import "LNAnimatorTemp.h"
|
|
10
|
-
|
|
11
|
-
#import "LNInterpolation.h"
|
|
12
|
-
|
|
13
|
-
@implementation LNViewAnimationTemp
|
|
14
|
-
{
|
|
15
|
-
id _fromValue;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
@synthesize progress = _progress;
|
|
19
|
-
|
|
20
|
-
- (instancetype)init
|
|
21
|
-
{
|
|
22
|
-
[NSException raise:NSInvalidArgumentException format:@"Use animationWithView:keyPath:toValue: to create LNViewAnimationTemp objects."];
|
|
23
|
-
return nil;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
- (instancetype)_init
|
|
27
|
-
{
|
|
28
|
-
return [super init];
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
+ (instancetype)animationWithView:(UIView*)view keyPath:(NSString*)keyPath toValue:(id)toValue
|
|
32
|
-
{
|
|
33
|
-
LNViewAnimationTemp* rv = [[LNViewAnimationTemp alloc] _init];
|
|
34
|
-
|
|
35
|
-
if(rv)
|
|
36
|
-
{
|
|
37
|
-
rv->_view = view;
|
|
38
|
-
rv->_keyPath = keyPath;
|
|
39
|
-
rv->_toValue = toValue;
|
|
40
|
-
rv->_fromValue = [view valueForKeyPath:keyPath];
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
return rv;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
- (void)setProgress:(CGFloat)progress
|
|
47
|
-
{
|
|
48
|
-
_progress = progress;
|
|
49
|
-
[_view setValue:[_fromValue interpolateToValue:_toValue progress:progress] forKeyPath:_keyPath];
|
|
50
|
-
[_view layoutIfNeeded];
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
@end
|
|
54
|
-
|
|
55
|
-
@implementation LNAnimatorTemp
|
|
56
|
-
{
|
|
57
|
-
void (^_completionHandler)(BOOL);
|
|
58
|
-
CADisplayLink* _displayLink;
|
|
59
|
-
CFTimeInterval _previousFrameTimestamp;
|
|
60
|
-
CFTimeInterval _elapsedTime;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
- (instancetype)init
|
|
64
|
-
{
|
|
65
|
-
[NSException raise:NSInvalidArgumentException format:@"Use animationWithView:keyPath:toValue: to create LNViewAnimationTemp objects."];
|
|
66
|
-
return nil;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
- (instancetype)_init
|
|
70
|
-
{
|
|
71
|
-
return [super init];
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
+ (instancetype)animatorWithDuration:(NSTimeInterval)duration animations:(NSArray<id<LNAnimationTemp>>*)animations completionHandler:(void(^)(BOOL completed))completionHandler
|
|
75
|
-
{
|
|
76
|
-
LNAnimatorTemp* rv = [[LNAnimatorTemp alloc] _init];
|
|
77
|
-
if(rv)
|
|
78
|
-
{
|
|
79
|
-
rv->_duration = duration;
|
|
80
|
-
|
|
81
|
-
NSAssert(animations.count > 0, @"At least one animation must be provided.");
|
|
82
|
-
|
|
83
|
-
rv->_animations = animations;
|
|
84
|
-
rv->_completionHandler = completionHandler;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
return rv;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
- (void)start
|
|
91
|
-
{
|
|
92
|
-
_displayLink = [CADisplayLink displayLinkWithTarget:self selector:@selector(_displayLinkDidTick)];
|
|
93
|
-
// _displayLink.preferredFramesPerSecond = 30;
|
|
94
|
-
[_displayLink addToRunLoop:[NSRunLoop mainRunLoop] forMode:NSRunLoopCommonModes];
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
- (void)_displayLinkDidTick
|
|
98
|
-
{
|
|
99
|
-
if(_previousFrameTimestamp != 0)
|
|
100
|
-
{
|
|
101
|
-
_elapsedTime += _displayLink.timestamp - _previousFrameTimestamp;
|
|
102
|
-
}
|
|
103
|
-
_previousFrameTimestamp = _displayLink.timestamp;
|
|
104
|
-
|
|
105
|
-
[_animations enumerateObjectsUsingBlock:^(id<LNAnimationTemp> _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
|
106
|
-
obj.progress = MIN(_elapsedTime / _duration, 1.0);
|
|
107
|
-
}];
|
|
108
|
-
|
|
109
|
-
if(_elapsedTime / _duration >= 1.0)
|
|
110
|
-
{
|
|
111
|
-
[_displayLink invalidate];
|
|
112
|
-
_displayLink = nil;
|
|
113
|
-
|
|
114
|
-
if(_completionHandler)
|
|
115
|
-
{
|
|
116
|
-
_completionHandler(YES);
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
@end
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// LNInterpolable.h
|
|
3
|
-
//
|
|
4
|
-
// Created by Leo Natan on 01/10/2016.
|
|
5
|
-
// Copyright © 2016 Leo Natan. All rights reserved.
|
|
6
|
-
//
|
|
7
|
-
|
|
8
|
-
#import <Foundation/Foundation.h>
|
|
9
|
-
|
|
10
|
-
NS_ASSUME_NONNULL_BEGIN
|
|
11
|
-
|
|
12
|
-
NS_SWIFT_NAME(InterpolationBehavior)
|
|
13
|
-
typedef const NSString* LNInterpolationBehavior CF_STRING_ENUM;
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
Interpolate using the default behavor of each implementation.
|
|
17
|
-
*/
|
|
18
|
-
extern LNInterpolationBehavior const LNInterpolationBehaviorUseDefault;
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
Classes implementing this protocol support interpolation.
|
|
23
|
-
*/
|
|
24
|
-
NS_SWIFT_NAME(Interpolable)
|
|
25
|
-
@protocol LNInterpolable <NSObject>
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
Interpolates between @c self and @c toValue accodring to @c progress using the default behavior.
|
|
29
|
-
|
|
30
|
-
@param toValue The value to interpolate to
|
|
31
|
-
@param progress The progress of the interpolation
|
|
32
|
-
@return An object representing the interpolated value at the requested progress
|
|
33
|
-
*/
|
|
34
|
-
- (instancetype)interpolateToValue:(id)toValue progress:(double)progress NS_SWIFT_NAME(interpolate(to:progress:));
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
Interpolates between @c self and @c toValue according to @c progress using @c behavior.
|
|
38
|
-
|
|
39
|
-
@param toValue The value to interpolate to
|
|
40
|
-
@param behavior The bahvior to use for interpolation
|
|
41
|
-
@param progress The progress of the interpolation
|
|
42
|
-
@return An object representing the interpolated value at the requested progress
|
|
43
|
-
*/
|
|
44
|
-
- (instancetype)interpolateToValue:(id)toValue progress:(double)progress behavior:(LNInterpolationBehavior)behavior NS_SWIFT_NAME(interpolate(to:progress:behavior:));
|
|
45
|
-
|
|
46
|
-
NS_ASSUME_NONNULL_END
|
|
47
|
-
|
|
48
|
-
@end
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// LNInterpolable.c
|
|
3
|
-
//
|
|
4
|
-
// Created by Leo Natan on 04/10/2016.
|
|
5
|
-
// Copyright © 2016 Leo Natan. All rights reserved.
|
|
6
|
-
//
|
|
7
|
-
|
|
8
|
-
#import "LNInterpolable.h"
|
|
9
|
-
|
|
10
|
-
LNInterpolationBehavior const LNInterpolationBehaviorUseDefault = @"LNInterpolationBehaviorUseDefault";
|
|
11
|
-
|
|
12
|
-
double BackEaseOut(double p)
|
|
13
|
-
{
|
|
14
|
-
double f = (1 - p);
|
|
15
|
-
return 1 - (f * f * f - 0.4*f * sin(f * M_PI));
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
double QuarticEaseOut(double p)
|
|
19
|
-
{
|
|
20
|
-
double f = (p - 1);
|
|
21
|
-
return f * f * f * (1 - p) + 1;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
double LNLinearInterpolate(double from, double to, double p)
|
|
25
|
-
{
|
|
26
|
-
return from + QuarticEaseOut(p) * (to - from);
|
|
27
|
-
}
|