@react-native-ohos/slider 5.1.2-rc.2 → 5.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +190 -187
- package/COMMITTERS.md +5 -5
- package/LICENSE +8 -8
- package/OAT.xml +72 -72
- package/README.OpenSource +10 -10
- package/README.md +12 -12
- package/babel.config.json +3 -3
- package/dist/RNCSliderNativeComponent.js +1 -1
- package/dist/Slider.js +1 -1
- package/dist/components/StepNumber.js +1 -1
- package/dist/components/StepsIndicator.js +1 -1
- package/dist/components/TrackMark.js +1 -1
- package/example/.eslintrc +18 -18
- package/example/.node-version +6 -6
- package/example/.prettierrc.js +7 -7
- package/example/.watchmanconfig +5 -5
- package/example/app.json +3 -3
- package/example/babel.config.js +9 -9
- package/example/contexts.ts +9 -9
- package/example/harmony/AppScope/app.json5 +10 -10
- package/example/harmony/AppScope/resources/base/element/string.json +8 -8
- package/example/harmony/build-profile.template.json5 +35 -35
- package/example/harmony/codelinter.json +32 -32
- package/example/harmony/entry/build-profile.json5 +21 -21
- package/example/harmony/entry/hvigorfile.ts +8 -8
- package/example/harmony/entry/oh-package.json5 +10 -10
- package/example/harmony/entry/src/main/cpp/CMakeLists.txt +41 -41
- package/example/harmony/entry/src/main/cpp/PackageProvider.cpp +16 -16
- package/example/harmony/entry/src/main/ets/RNPackagesFactory.ets +13 -13
- package/example/harmony/entry/src/main/ets/entryability/EntryAbility.ets +27 -27
- package/example/harmony/entry/src/main/ets/pages/Index.ets +125 -125
- package/example/harmony/entry/src/main/ets/pages/SurfaceDeadlockTest.ets +135 -135
- package/example/harmony/entry/src/main/ets/pages/TouchDisplayer.ets +43 -43
- package/example/harmony/entry/src/main/module.json5 +51 -51
- package/example/harmony/entry/src/main/resources/base/element/color.json +7 -7
- package/example/harmony/entry/src/main/resources/base/element/string.json +15 -15
- package/example/harmony/entry/src/main/resources/base/profile/main_pages.json +5 -5
- package/example/harmony/format.ps1 +17 -17
- package/example/harmony/hvigor/hvigor-config.json5 +20 -20
- package/example/harmony/hvigorfile.ts +8 -8
- package/example/harmony/oh-package.json5 +11 -11
- package/example/index.js +10 -10
- package/example/jest.config.js +11 -11
- package/example/metro.config.js +30 -30
- package/example/package.json +58 -58
- package/example/react-native.config.js +11 -11
- package/example/scripts/create-build-profile.js +45 -45
- package/example/src/index.tsx +22 -22
- package/example/tsconfig.json +19 -19
- package/harmony/slider/oh-package.json5 +10 -10
- package/harmony/slider.har +0 -0
- package/package.json +92 -92
- package/react-native.config.js +11 -11
- package/src/RNCSliderNativeComponent.ts +51 -51
- package/src/Slider.tsx +356 -356
- package/src/components/StepNumber.tsx +23 -23
- package/src/components/StepsIndicator.tsx +89 -89
- package/src/components/TrackMark.tsx +59 -59
- package/src/index.ts +9 -9
- package/src/utils/constants.ts +17 -17
- package/src/utils/styles.ts +61 -61
- package/tsconfig.json +23 -23
- package/typings/index.d.ts +214 -214
package/README.OpenSource
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"Name": "@react-native-community/slider",
|
|
4
|
-
"License": "MIT License",
|
|
5
|
-
"License File": " LICENSE.md ",
|
|
6
|
-
"Version Number": "5.1.1",
|
|
7
|
-
"Owner" : "xiafeng@huawei.com",
|
|
8
|
-
"Upstream URL": "https://github.com/callstack/react-native-slider",
|
|
9
|
-
"Description": "React Native component exposing Slider from iOS and SeekBar from Android"
|
|
10
|
-
}
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"Name": "@react-native-community/slider",
|
|
4
|
+
"License": "MIT License",
|
|
5
|
+
"License File": " LICENSE.md ",
|
|
6
|
+
"Version Number": "5.1.1",
|
|
7
|
+
"Owner" : "xiafeng@huawei.com",
|
|
8
|
+
"Upstream URL": "https://github.com/callstack/react-native-slider",
|
|
9
|
+
"Description": "React Native component exposing Slider from iOS and SeekBar from Android"
|
|
10
|
+
}
|
|
11
11
|
]
|
package/README.md
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
# @react-native-ohos/slider
|
|
2
|
-
|
|
3
|
-
This project is based on [react-native-slider@v5.0.0](https://github.com/callstack/react-native-slider/tree/v5.0.0)
|
|
4
|
-
|
|
5
|
-
## Documentation
|
|
6
|
-
|
|
7
|
-
[中文](https://
|
|
8
|
-
|
|
9
|
-
[English](https://
|
|
10
|
-
|
|
11
|
-
## License
|
|
12
|
-
|
|
1
|
+
# @react-native-ohos/slider
|
|
2
|
+
|
|
3
|
+
This project is based on [react-native-slider@v5.0.0](https://github.com/callstack/react-native-slider/tree/v5.0.0)
|
|
4
|
+
|
|
5
|
+
## Documentation
|
|
6
|
+
|
|
7
|
+
[中文](https://gitcode.com/OpenHarmony-RN/usage-docs/blob/master/zh-cn/react-native-community-slider.md)
|
|
8
|
+
|
|
9
|
+
[English](https://gitcode.com/OpenHarmony-RN/usage-docs/blob/master/en/react-native-community-slider.md)
|
|
10
|
+
|
|
11
|
+
## License
|
|
12
|
+
|
|
13
13
|
This library is licensed under [The MIT License (MIT)](https://github.com/callstack/react-native-slider/blob/main/LICENSE.md)
|
package/babel.config.json
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
{
|
|
2
|
-
"presets": ["module:@react-native/babel-preset"]
|
|
3
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"presets": ["module:@react-native/babel-preset"]
|
|
3
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:true});exports.default=exports.__INTERNAL_VIEW_CONFIG=void 0;var _reactNative=require("react-native");var NativeComponentRegistry=require('react-native/Libraries/NativeComponent/NativeComponentRegistry');var _require=require('react-native/Libraries/NativeComponent/ViewConfigIgnore'),ConditionallyIgnoredEventHandlers=_require.ConditionallyIgnoredEventHandlers;var nativeComponentName='RNCSlider';var __INTERNAL_VIEW_CONFIG=exports.__INTERNAL_VIEW_CONFIG={uiViewClassName:
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:true});exports.default=exports.__INTERNAL_VIEW_CONFIG=void 0;var _reactNative=require("react-native");var NativeComponentRegistry=require('react-native/Libraries/NativeComponent/NativeComponentRegistry');var _require=require('react-native/Libraries/NativeComponent/ViewConfigIgnore'),ConditionallyIgnoredEventHandlers=_require.ConditionallyIgnoredEventHandlers;var nativeComponentName='RNCSlider';var __INTERNAL_VIEW_CONFIG=exports.__INTERNAL_VIEW_CONFIG={uiViewClassName:'RNCSlider',bubblingEventTypes:{topChange:{phasedRegistrationNames:{captured:'onChangeCapture',bubbled:'onChange'}},topRNCSliderValueChange:{phasedRegistrationNames:{captured:'onRNCSliderValueChangeCapture',bubbled:'onRNCSliderValueChange'}}},directEventTypes:{topRNCSliderSlidingStart:{registrationName:'onRNCSliderSlidingStart'},topRNCSliderSlidingComplete:{registrationName:'onRNCSliderSlidingComplete'}},validAttributes:Object.assign({accessibilityUnits:true,accessibilityIncrements:true,disabled:true,inverted:true,vertical:true,tapToSeek:true,maximumTrackImage:{process:require('react-native/Libraries/Image/resolveAssetSource')},maximumTrackTintColor:{process:require('react-native/Libraries/StyleSheet/processColor').default},maximumValue:true,minimumTrackImage:{process:require('react-native/Libraries/Image/resolveAssetSource')},minimumTrackTintColor:{process:require('react-native/Libraries/StyleSheet/processColor').default},minimumValue:true,step:true,testID:true,thumbImage:{process:require('react-native/Libraries/Image/resolveAssetSource')},thumbTintColor:{process:require('react-native/Libraries/StyleSheet/processColor').default},trackImage:{process:require('react-native/Libraries/Image/resolveAssetSource')},value:true,lowerLimit:true,upperLimit:true},ConditionallyIgnoredEventHandlers({onChange:true,onRNCSliderSlidingStart:true,onRNCSliderSlidingComplete:true,onRNCSliderValueChange:true}))};var _default=exports.default=NativeComponentRegistry.get(nativeComponentName,function(){return __INTERNAL_VIEW_CONFIG;});
|
package/dist/Slider.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _index=_interopRequireDefault(require("./index"));var _StepsIndicator=require("./components/StepsIndicator");var _styles=require("./utils/styles");var _constants=require("./utils/constants");var _jsxRuntime=require("react/jsx-runtime");var _excluded=["onValueChange","onSlidingStart","onSlidingComplete","onAccessibilityAction","value","minimumValue","maximumValue","step","inverted","tapToSeek","lowerLimit","upperLimit"];var _this=this,_jsxFileName="
|
|
1
|
+
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=void 0;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _objectWithoutProperties2=_interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _index=_interopRequireDefault(require("./index"));var _StepsIndicator=require("./components/StepsIndicator");var _styles=require("./utils/styles");var _constants=require("./utils/constants");var _jsxRuntime=require("react/jsx-runtime");var _excluded=["onValueChange","onSlidingStart","onSlidingComplete","onAccessibilityAction","value","minimumValue","maximumValue","step","inverted","tapToSeek","lowerLimit","upperLimit"];var _this=this,_jsxFileName="E:\\gitcode\\rntpc_react-native-slider\\src\\Slider.tsx";function _interopRequireWildcard(e,t){if("function"==typeof WeakMap)var r=new WeakMap(),n=new WeakMap();return(_interopRequireWildcard=function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;var o,i,f={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return f;if(o=t?n:r){if(o.has(e))return o.get(e);o.set(e,f);}for(var _t in e)"default"!==_t&&{}.hasOwnProperty.call(e,_t)&&((i=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,_t))&&(i.get||i.set)?o(f,_t,i):f[_t]=e[_t]);return f;})(e,t);}var SliderComponent=function SliderComponent(_ref,forwardedRef){var _ref2,_props$accessibilityS;var onValueChange=_ref.onValueChange,onSlidingStart=_ref.onSlidingStart,onSlidingComplete=_ref.onSlidingComplete,onAccessibilityAction=_ref.onAccessibilityAction,_ref$value=_ref.value,value=_ref$value===void 0?_constants.constants.SLIDER_DEFAULT_INITIAL_VALUE:_ref$value,_ref$minimumValue=_ref.minimumValue,minimumValue=_ref$minimumValue===void 0?0:_ref$minimumValue,_ref$maximumValue=_ref.maximumValue,maximumValue=_ref$maximumValue===void 0?1:_ref$maximumValue,_ref$step=_ref.step,step=_ref$step===void 0?0:_ref$step,_ref$inverted=_ref.inverted,inverted=_ref$inverted===void 0?false:_ref$inverted,_ref$tapToSeek=_ref.tapToSeek,tapToSeek=_ref$tapToSeek===void 0?false:_ref$tapToSeek,_ref$lowerLimit=_ref.lowerLimit,lowerLimit=_ref$lowerLimit===void 0?_reactNative.Platform.select({web:minimumValue,default:_constants.constants.LIMIT_MIN_VALUE}):_ref$lowerLimit,_ref$upperLimit=_ref.upperLimit,upperLimit=_ref$upperLimit===void 0?_reactNative.Platform.select({web:maximumValue,default:_constants.constants.LIMIT_MAX_VALUE}):_ref$upperLimit,props=(0,_objectWithoutProperties2.default)(_ref,_excluded);var _useState=(0,_react.useState)((_ref2=value!=null?value:minimumValue)!=null?_ref2:_constants.constants.SLIDER_DEFAULT_INITIAL_VALUE),_useState2=(0,_slicedToArray2.default)(_useState,2),currentValue=_useState2[0],setCurrentValue=_useState2[1];var _useState3=(0,_react.useState)(0),_useState4=(0,_slicedToArray2.default)(_useState3,2),width=_useState4[0],setWidth=_useState4[1];var stepResolution=step?step:_constants.constants.DEFAULT_STEP_RESOLUTION;var defaultStep=(maximumValue-minimumValue)/stepResolution;var stepLength=step||defaultStep;var options=Array.from({length:(step?defaultStep:stepResolution)+1},function(_,index){return minimumValue+index*stepLength;});var defaultStyle=_reactNative.Platform.OS==='ios'||_reactNative.Platform.OS==='harmony'?_styles.styles.defaultSlideriOS:_styles.styles.defaultSlider;var sliderStyle={zIndex:1,width:width};var style=[defaultStyle,props.style];var onValueChangeEvent=function onValueChangeEvent(event){onValueChange&&onValueChange(event.nativeEvent.value);setCurrentValue(event.nativeEvent.value);};var _disabled=typeof props.disabled==='boolean'?props.disabled:((_props$accessibilityS=props.accessibilityState)==null?void 0:_props$accessibilityS.disabled)===true;var _accessibilityState=typeof props.disabled==='boolean'?Object.assign({},props.accessibilityState,{disabled:props.disabled}):props.accessibilityState;var onSlidingStartEvent=onSlidingStart?function(event){onSlidingStart(event.nativeEvent.value);}:null;var onSlidingCompleteEvent=onSlidingComplete?function(event){onSlidingComplete(event.nativeEvent.value);}:null;var onAccessibilityActionEvent=onAccessibilityAction?function(event){onAccessibilityAction(event);}:null;var passedValue=Number.isNaN(value)||!value?undefined:value;(0,_react.useEffect)(function(){if(lowerLimit>=upperLimit){console.warn('Invalid configuration: lower limit is supposed to be smaller than upper limit');}},[lowerLimit,upperLimit]);return(0,_jsxRuntime.jsxs)(_reactNative.View,{onLayout:function onLayout(event){setWidth(event.nativeEvent.layout.width);},style:[style,{justifyContent:'center'}],children:[props.StepMarker||!!props.renderStepNumber?(0,_jsxRuntime.jsx)(_StepsIndicator.StepsIndicator,{options:options,sliderWidth:width,currentValue:currentValue,renderStepNumber:props.renderStepNumber,thumbImage:props.thumbImage,StepMarker:props.StepMarker,isLTR:inverted}):null,(0,_jsxRuntime.jsx)(_index.default,Object.assign({},props,{minimumValue:minimumValue,maximumValue:maximumValue,step:step,inverted:inverted,tapToSeek:tapToSeek,value:passedValue,lowerLimit:lowerLimit,upperLimit:upperLimit,accessibilityState:_accessibilityState,thumbImage:_reactNative.Platform.OS==='web'?props.thumbImage:props.StepMarker||!props.thumbImage?undefined:_reactNative.Image.resolveAssetSource(props.thumbImage),ref:forwardedRef,style:[sliderStyle,defaultStyle,{alignContent:'center',alignItems:'center'}],onChange:onValueChangeEvent,onRNCSliderSlidingStart:onSlidingStartEvent,onRNCSliderSlidingComplete:onSlidingCompleteEvent,onRNCSliderValueChange:onValueChangeEvent,disabled:_disabled,onStartShouldSetResponder:function onStartShouldSetResponder(){return true;},onResponderTerminationRequest:function onResponderTerminationRequest(){return false;},onRNCSliderAccessibilityAction:onAccessibilityActionEvent,thumbTintColor:props.thumbImage&&!!props.StepMarker?'transparent':props.thumbTintColor}))]});};var SliderWithRef=_react.default.forwardRef(SliderComponent);var _default=exports.default=SliderWithRef;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.StepNumber=void 0;var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _styles=require("../utils/styles");var _jsxRuntime=require("react/jsx-runtime");var _this=this,_jsxFileName="
|
|
1
|
+
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.StepNumber=void 0;var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _styles=require("../utils/styles");var _jsxRuntime=require("react/jsx-runtime");var _this=this,_jsxFileName="E:\\gitcode\\rntpc_react-native-slider\\src\\components\\StepNumber.tsx";var StepNumber=exports.StepNumber=function StepNumber(_ref){var i=_ref.i,style=_ref.style;return(0,_jsxRuntime.jsx)(_reactNative.View,{style:_styles.styles.stepNumber,children:(0,_jsxRuntime.jsx)(_reactNative.Text,{style:style,children:i})});};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:true});exports.StepsIndicator=void 0;var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _StepNumber=require("./StepNumber");var _TrackMark=require("./TrackMark");var _styles=require("../utils/styles");var _constants=require("../utils/constants");var _jsxRuntime=require("react/jsx-runtime");var _this=this,_jsxFileName="
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:true});exports.StepsIndicator=void 0;var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _StepNumber=require("./StepNumber");var _TrackMark=require("./TrackMark");var _styles=require("../utils/styles");var _constants=require("../utils/constants");var _jsxRuntime=require("react/jsx-runtime");var _this=this,_jsxFileName="E:\\gitcode\\rntpc_react-native-slider\\src\\components\\StepsIndicator.tsx";function _interopRequireWildcard(e,t){if("function"==typeof WeakMap)var r=new WeakMap(),n=new WeakMap();return(_interopRequireWildcard=function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;var o,i,f={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return f;if(o=t?n:r){if(o.has(e))return o.get(e);o.set(e,f);}for(var _t in e)"default"!==_t&&{}.hasOwnProperty.call(e,_t)&&((i=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,_t))&&(i.get||i.set)?o(f,_t,i):f[_t]=e[_t]);return f;})(e,t);}var StepsIndicator=exports.StepsIndicator=function StepsIndicator(_ref){var options=_ref.options,sliderWidth=_ref.sliderWidth,currentValue=_ref.currentValue,StepMarker=_ref.StepMarker,renderStepNumber=_ref.renderStepNumber,thumbImage=_ref.thumbImage,isLTR=_ref.isLTR;var stepNumberFontStyle=(0,_react.useMemo)(function(){return{fontSize:options.length>9?_constants.constants.STEP_NUMBER_TEXT_FONT_SMALL:_constants.constants.STEP_NUMBER_TEXT_FONT_BIG};},[options.length]);var values=isLTR?options.reverse():options;var renderStepIndicator=(0,_react.useCallback)(function(i,index){return(0,_jsxRuntime.jsx)(_react.Fragment,{children:(0,_jsxRuntime.jsxs)(_reactNative.View,{style:_styles.styles.stepIndicatorElement,children:[(0,_jsxRuntime.jsx)(_TrackMark.SliderTrackMark,{isTrue:currentValue===i,index:i,thumbImage:thumbImage,StepMarker:StepMarker,currentValue:currentValue,min:options[0],max:options[options.length-1]},`${index}-SliderTrackMark`),renderStepNumber?(0,_jsxRuntime.jsx)(_StepNumber.StepNumber,{i:i,style:stepNumberFontStyle},`${index}th-step`):null]},`${index}-View`)},index);},[currentValue,StepMarker,options,thumbImage,renderStepNumber,stepNumberFontStyle]);return(0,_jsxRuntime.jsx)(_reactNative.View,{pointerEvents:"none",style:[_styles.styles.stepsIndicator,{marginHorizontal:sliderWidth*_constants.constants.MARGIN_HORIZONTAL_PADDING}],children:values.map(function(i,index){return renderStepIndicator(i,index);})});};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.SliderTrackMark=void 0;var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _styles=require("../utils/styles");var _jsxRuntime=require("react/jsx-runtime");var _this=this,_jsxFileName="
|
|
1
|
+
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.SliderTrackMark=void 0;var _react=_interopRequireDefault(require("react"));var _reactNative=require("react-native");var _styles=require("../utils/styles");var _jsxRuntime=require("react/jsx-runtime");var _this=this,_jsxFileName="E:\\gitcode\\rntpc_react-native-slider\\src\\components\\TrackMark.tsx";var SliderTrackMark=exports.SliderTrackMark=function SliderTrackMark(_ref){var isTrue=_ref.isTrue,index=_ref.index,thumbImage=_ref.thumbImage,StepMarker=_ref.StepMarker,currentValue=_ref.currentValue,min=_ref.min,max=_ref.max;return(0,_jsxRuntime.jsxs)(_reactNative.View,{style:_styles.styles.trackMarkContainer,children:[StepMarker?(0,_jsxRuntime.jsx)(StepMarker,{stepMarked:isTrue,index:index,currentValue:currentValue,min:min,max:max}):null,thumbImage&&isTrue?(0,_jsxRuntime.jsx)(_reactNative.View,{style:_styles.styles.thumbImageContainer,children:(0,_jsxRuntime.jsx)(_reactNative.Image,{source:thumbImage,style:_styles.styles.thumbImage})}):null]});};
|
package/example/.eslintrc
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2025 Huawei Device Co., Ltd. All rights reserved
|
|
3
|
-
* Use of this source code is governed by a MIT license that can be
|
|
4
|
-
* found in the LICENSE file.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
{
|
|
8
|
-
"extends": "@react-native",
|
|
9
|
-
"rules": {
|
|
10
|
-
"react-native/no-inline-styles": "off",
|
|
11
|
-
"react/no-unstable-nested-components": "off",
|
|
12
|
-
"react/react-in-jsx-scope": "off",
|
|
13
|
-
"@typescript-eslint/no-unused-vars": "warn",
|
|
14
|
-
"react-hooks/exhaustive-deps": "off",
|
|
15
|
-
"radix": "off",
|
|
16
|
-
"prettier/prettier": "warn",
|
|
17
|
-
"max-lines": "off"
|
|
18
|
-
}
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 Huawei Device Co., Ltd. All rights reserved
|
|
3
|
+
* Use of this source code is governed by a MIT license that can be
|
|
4
|
+
* found in the LICENSE file.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
{
|
|
8
|
+
"extends": "@react-native",
|
|
9
|
+
"rules": {
|
|
10
|
+
"react-native/no-inline-styles": "off",
|
|
11
|
+
"react/no-unstable-nested-components": "off",
|
|
12
|
+
"react/react-in-jsx-scope": "off",
|
|
13
|
+
"@typescript-eslint/no-unused-vars": "warn",
|
|
14
|
+
"react-hooks/exhaustive-deps": "off",
|
|
15
|
+
"radix": "off",
|
|
16
|
+
"prettier/prettier": "warn",
|
|
17
|
+
"max-lines": "off"
|
|
18
|
+
}
|
|
19
19
|
}
|
package/example/.node-version
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2025 Huawei Device Co., Ltd. All rights reserved
|
|
3
|
-
* Use of this source code is governed by a MIT license that can be
|
|
4
|
-
* found in the LICENSE file.
|
|
5
|
-
*/
|
|
6
|
-
18
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 Huawei Device Co., Ltd. All rights reserved
|
|
3
|
+
* Use of this source code is governed by a MIT license that can be
|
|
4
|
+
* found in the LICENSE file.
|
|
5
|
+
*/
|
|
6
|
+
18
|
package/example/.prettierrc.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
arrowParens: 'avoid',
|
|
3
|
-
bracketSameLine: true,
|
|
4
|
-
bracketSpacing: true,
|
|
5
|
-
singleQuote: true,
|
|
6
|
-
trailingComma: 'all',
|
|
7
|
-
};
|
|
1
|
+
module.exports = {
|
|
2
|
+
arrowParens: 'avoid',
|
|
3
|
+
bracketSameLine: true,
|
|
4
|
+
bracketSpacing: true,
|
|
5
|
+
singleQuote: true,
|
|
6
|
+
trailingComma: 'all',
|
|
7
|
+
};
|
package/example/.watchmanconfig
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2025 Huawei Device Co., Ltd. All rights reserved
|
|
3
|
-
* Use of this source code is governed by a MIT license that can be
|
|
4
|
-
* found in the LICENSE file.
|
|
5
|
-
*/
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 Huawei Device Co., Ltd. All rights reserved
|
|
3
|
+
* Use of this source code is governed by a MIT license that can be
|
|
4
|
+
* found in the LICENSE file.
|
|
5
|
+
*/
|
|
6
6
|
{}
|
package/example/app.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "app_name",
|
|
3
|
-
"displayName": "tester"
|
|
1
|
+
{
|
|
2
|
+
"name": "app_name",
|
|
3
|
+
"displayName": "tester"
|
|
4
4
|
}
|
package/example/babel.config.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2025 Huawei Device Co., Ltd. All rights reserved
|
|
3
|
-
* Use of this source code is governed by a MIT license that can be
|
|
4
|
-
* found in the LICENSE file.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
module.exports = {
|
|
8
|
-
presets: ['module:@react-native/babel-preset']
|
|
9
|
-
};
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 Huawei Device Co., Ltd. All rights reserved
|
|
3
|
+
* Use of this source code is governed by a MIT license that can be
|
|
4
|
+
* found in the LICENSE file.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
module.exports = {
|
|
8
|
+
presets: ['module:@react-native/babel-preset']
|
|
9
|
+
};
|
package/example/contexts.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2025 Huawei Device Co., Ltd. All rights reserved
|
|
3
|
-
* Use of this source code is governed by a MIT license that can be
|
|
4
|
-
* found in the LICENSE file.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import React from 'react';
|
|
8
|
-
|
|
9
|
-
export const AppParamsContext = React.createContext(undefined);
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 Huawei Device Co., Ltd. All rights reserved
|
|
3
|
+
* Use of this source code is governed by a MIT license that can be
|
|
4
|
+
* found in the LICENSE file.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import React from 'react';
|
|
8
|
+
|
|
9
|
+
export const AppParamsContext = React.createContext(undefined);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
{
|
|
2
|
-
"app": {
|
|
3
|
-
"bundleName": "com.harmony.wechat.lib.demo",
|
|
4
|
-
"vendor": "example",
|
|
5
|
-
"versionCode": 1000000,
|
|
6
|
-
"versionName": "1.0.0",
|
|
7
|
-
"icon": "$media:app_icon",
|
|
8
|
-
"label": "$string:app_name"
|
|
9
|
-
}
|
|
10
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"app": {
|
|
3
|
+
"bundleName": "com.harmony.wechat.lib.demo",
|
|
4
|
+
"vendor": "example",
|
|
5
|
+
"versionCode": 1000000,
|
|
6
|
+
"versionName": "1.0.0",
|
|
7
|
+
"icon": "$media:app_icon",
|
|
8
|
+
"label": "$string:app_name"
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
{
|
|
2
|
-
"string": [
|
|
3
|
-
{
|
|
4
|
-
"name": "app_name",
|
|
5
|
-
"value": "RN Tester"
|
|
6
|
-
}
|
|
7
|
-
]
|
|
8
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"string": [
|
|
3
|
+
{
|
|
4
|
+
"name": "app_name",
|
|
5
|
+
"value": "RN Tester"
|
|
6
|
+
}
|
|
7
|
+
]
|
|
8
|
+
}
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
{
|
|
2
|
-
"app": {
|
|
3
|
-
"products": [
|
|
4
|
-
{
|
|
5
|
-
"name": 'default',
|
|
6
|
-
"signingConfig": 'default',
|
|
7
|
-
"compileSdkVersion": '5.0.1(13)',
|
|
8
|
-
"compatibleSdkVersion": '5.0.0(12)',
|
|
9
|
-
"runtimeOS": 'HarmonyOS'
|
|
10
|
-
},
|
|
11
|
-
],
|
|
12
|
-
"buildModeSet": [
|
|
13
|
-
{
|
|
14
|
-
"name": 'debug',
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
"name": 'release',
|
|
18
|
-
},
|
|
19
|
-
],
|
|
20
|
-
"signingConfigs": []
|
|
21
|
-
},
|
|
22
|
-
"modules": [
|
|
23
|
-
{
|
|
24
|
-
"name": 'entry',
|
|
25
|
-
"srcPath": './entry',
|
|
26
|
-
"targets": [
|
|
27
|
-
{
|
|
28
|
-
"name": 'default',
|
|
29
|
-
"applyToProducts": [
|
|
30
|
-
'default'
|
|
31
|
-
],
|
|
32
|
-
},
|
|
33
|
-
],
|
|
34
|
-
}
|
|
35
|
-
],
|
|
1
|
+
{
|
|
2
|
+
"app": {
|
|
3
|
+
"products": [
|
|
4
|
+
{
|
|
5
|
+
"name": 'default',
|
|
6
|
+
"signingConfig": 'default',
|
|
7
|
+
"compileSdkVersion": '5.0.1(13)',
|
|
8
|
+
"compatibleSdkVersion": '5.0.0(12)',
|
|
9
|
+
"runtimeOS": 'HarmonyOS'
|
|
10
|
+
},
|
|
11
|
+
],
|
|
12
|
+
"buildModeSet": [
|
|
13
|
+
{
|
|
14
|
+
"name": 'debug',
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"name": 'release',
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
"signingConfigs": []
|
|
21
|
+
},
|
|
22
|
+
"modules": [
|
|
23
|
+
{
|
|
24
|
+
"name": 'entry',
|
|
25
|
+
"srcPath": './entry',
|
|
26
|
+
"targets": [
|
|
27
|
+
{
|
|
28
|
+
"name": 'default',
|
|
29
|
+
"applyToProducts": [
|
|
30
|
+
'default'
|
|
31
|
+
],
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
36
|
}
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
{
|
|
2
|
-
"files": ["**/*.ts", "**/*.ets"],
|
|
3
|
-
"ignore": [
|
|
4
|
-
"**/ohosTest/**/*",
|
|
5
|
-
"**/node_modules/**/*",
|
|
6
|
-
"**/hvigorfile.ts",
|
|
7
|
-
"**/node_modules/**/*",
|
|
8
|
-
"**/oh_modules/**/*",
|
|
9
|
-
"**/build/**/*",
|
|
10
|
-
"**/.preview/**/*"
|
|
11
|
-
],
|
|
12
|
-
"plugins": ["@typescript-eslint"],
|
|
13
|
-
"ruleSet": [],
|
|
14
|
-
"rules": {
|
|
15
|
-
"@typescript-eslint/await-thenable": "warn",
|
|
16
|
-
"@typescript-eslint/consistent-type-imports": "warn",
|
|
17
|
-
"@typescript-eslint/explicit-function-return-type": "warn",
|
|
18
|
-
"@typescript-eslint/explicit-module-boundary-types": "warn",
|
|
19
|
-
"@typescript-eslint/no-dynamic-delete": "warn",
|
|
20
|
-
"@typescript-eslint/no-explicit-any": "warn",
|
|
21
|
-
"@typescript-eslint/no-for-in-array": "warn",
|
|
22
|
-
"@typescript-eslint/no-this-alias": "warn",
|
|
23
|
-
"@typescript-eslint/no-unnecessary-type-constraint": "warn",
|
|
24
|
-
"@typescript-eslint/no-unsafe-argument": "warn",
|
|
25
|
-
"@typescript-eslint/no-unsafe-assignment": "warn",
|
|
26
|
-
"@typescript-eslint/no-unsafe-call": "warn",
|
|
27
|
-
"@typescript-eslint/no-unsafe-member-access": "warn",
|
|
28
|
-
"@typescript-eslint/no-unsafe-return": "warn",
|
|
29
|
-
"@typescript-eslint/prefer-literal-enum-member": "warn"
|
|
30
|
-
},
|
|
31
|
-
"overrides": []
|
|
32
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"files": ["**/*.ts", "**/*.ets"],
|
|
3
|
+
"ignore": [
|
|
4
|
+
"**/ohosTest/**/*",
|
|
5
|
+
"**/node_modules/**/*",
|
|
6
|
+
"**/hvigorfile.ts",
|
|
7
|
+
"**/node_modules/**/*",
|
|
8
|
+
"**/oh_modules/**/*",
|
|
9
|
+
"**/build/**/*",
|
|
10
|
+
"**/.preview/**/*"
|
|
11
|
+
],
|
|
12
|
+
"plugins": ["@typescript-eslint"],
|
|
13
|
+
"ruleSet": [],
|
|
14
|
+
"rules": {
|
|
15
|
+
"@typescript-eslint/await-thenable": "warn",
|
|
16
|
+
"@typescript-eslint/consistent-type-imports": "warn",
|
|
17
|
+
"@typescript-eslint/explicit-function-return-type": "warn",
|
|
18
|
+
"@typescript-eslint/explicit-module-boundary-types": "warn",
|
|
19
|
+
"@typescript-eslint/no-dynamic-delete": "warn",
|
|
20
|
+
"@typescript-eslint/no-explicit-any": "warn",
|
|
21
|
+
"@typescript-eslint/no-for-in-array": "warn",
|
|
22
|
+
"@typescript-eslint/no-this-alias": "warn",
|
|
23
|
+
"@typescript-eslint/no-unnecessary-type-constraint": "warn",
|
|
24
|
+
"@typescript-eslint/no-unsafe-argument": "warn",
|
|
25
|
+
"@typescript-eslint/no-unsafe-assignment": "warn",
|
|
26
|
+
"@typescript-eslint/no-unsafe-call": "warn",
|
|
27
|
+
"@typescript-eslint/no-unsafe-member-access": "warn",
|
|
28
|
+
"@typescript-eslint/no-unsafe-return": "warn",
|
|
29
|
+
"@typescript-eslint/prefer-literal-enum-member": "warn"
|
|
30
|
+
},
|
|
31
|
+
"overrides": []
|
|
32
|
+
}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
{
|
|
2
|
-
"apiType": 'stageMode',
|
|
3
|
-
"buildOption": {
|
|
4
|
-
"externalNativeOptions": {
|
|
5
|
-
"path": "./src/main/cpp/CMakeLists.txt",
|
|
6
|
-
"arguments": "",
|
|
7
|
-
"cppFlags": "-s",
|
|
8
|
-
"abiFilters": [
|
|
9
|
-
"arm64-v8a",
|
|
10
|
-
"x86_64"
|
|
11
|
-
]
|
|
12
|
-
},
|
|
13
|
-
},
|
|
14
|
-
"targets": [
|
|
15
|
-
{
|
|
16
|
-
"name": "default",
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
"name": "ohosTest",
|
|
20
|
-
}
|
|
21
|
-
]
|
|
1
|
+
{
|
|
2
|
+
"apiType": 'stageMode',
|
|
3
|
+
"buildOption": {
|
|
4
|
+
"externalNativeOptions": {
|
|
5
|
+
"path": "./src/main/cpp/CMakeLists.txt",
|
|
6
|
+
"arguments": "",
|
|
7
|
+
"cppFlags": "-s",
|
|
8
|
+
"abiFilters": [
|
|
9
|
+
"arm64-v8a",
|
|
10
|
+
"x86_64"
|
|
11
|
+
]
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
"targets": [
|
|
15
|
+
{
|
|
16
|
+
"name": "default",
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"name": "ohosTest",
|
|
20
|
+
}
|
|
21
|
+
]
|
|
22
22
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2025 Huawei Device Co., Ltd. All rights reserved
|
|
3
|
-
* Use of this source code is governed by a MIT license that can be
|
|
4
|
-
* found in the LICENSE file.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently.
|
|
8
|
-
export { hapTasks } from '@ohos/hvigor-ohos-plugin';
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 Huawei Device Co., Ltd. All rights reserved
|
|
3
|
+
* Use of this source code is governed by a MIT license that can be
|
|
4
|
+
* found in the LICENSE file.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently.
|
|
8
|
+
export { hapTasks } from '@ohos/hvigor-ohos-plugin';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
{
|
|
2
|
-
"license": "ISC",
|
|
3
|
-
"devDependencies": {},
|
|
4
|
-
"name": "entry",
|
|
5
|
-
"description": "example description",
|
|
6
|
-
"version": "1.0.0",
|
|
7
|
-
"dependencies": {
|
|
8
|
-
"@rnoh/react-native-openharmony": "file:../../node_modules/react-native-harmony/harmony/react_native_openharmony.har",
|
|
9
|
-
"@react-native-ohos/slider": "file:../../../harmony/slider.har"
|
|
10
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"license": "ISC",
|
|
3
|
+
"devDependencies": {},
|
|
4
|
+
"name": "entry",
|
|
5
|
+
"description": "example description",
|
|
6
|
+
"version": "1.0.0",
|
|
7
|
+
"dependencies": {
|
|
8
|
+
"@rnoh/react-native-openharmony": "file:../../node_modules/react-native-harmony/harmony/react_native_openharmony.har",
|
|
9
|
+
"@react-native-ohos/slider": "file:../../../harmony/slider.har"
|
|
10
|
+
}
|
|
11
11
|
}
|
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
project(rnapp)
|
|
2
|
-
cmake_minimum_required(VERSION 3.4.1)
|
|
3
|
-
set(CMAKE_SKIP_BUILD_RPATH TRUE)
|
|
4
|
-
set(RNOH_APP_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
|
|
5
|
-
set(NODE_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../node_modules")
|
|
6
|
-
set(OH_MODULE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../oh_modules")
|
|
7
|
-
set(RNOH_CPP_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../oh_modules/@rnoh/react-native-openharmony/src/main/cpp")
|
|
8
|
-
set(RNOH_GENERATED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/generated")
|
|
9
|
-
set(LOG_VERBOSITY_LEVEL 1)
|
|
10
|
-
set(CMAKE_ASM_FLAGS "-Wno-error=unused-command-line-argument -Qunused-arguments")
|
|
11
|
-
set(CMAKE_CXX_FLAGS "-fstack-protector-strong -Wl,-z,relro,-z,now,-z,noexecstack -s -fPIE -pie")
|
|
12
|
-
set(OH_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../oh_modules")
|
|
13
|
-
|
|
14
|
-
set(WITH_HITRACE_SYSTRACE 1) # for other CMakeLists.txt files to use
|
|
15
|
-
add_compile_definitions(WITH_HITRACE_SYSTRACE)
|
|
16
|
-
|
|
17
|
-
# (VM) Define a variable and assign it to the current module's cpp directory
|
|
18
|
-
set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR})
|
|
19
|
-
|
|
20
|
-
# Add the Header File directory, including cpp, cpp/include, and tell cmake to find the Header Files introduced by the code here
|
|
21
|
-
include_directories(${NATIVERENDER_ROOT_PATH}
|
|
22
|
-
${NATIVERENDER_ROOT_PATH}/include)
|
|
23
|
-
|
|
24
|
-
add_subdirectory("${RNOH_CPP_DIR}" ./rn)
|
|
25
|
-
|
|
26
|
-
# RNOH_BEGIN: manual_package_linking_1
|
|
27
|
-
add_subdirectory("${OH_MODULES}/@react-native-ohos/slider/src/main/cpp" ./slider)
|
|
28
|
-
# RNOH_END: manual_package_linking_1
|
|
29
|
-
|
|
30
|
-
file(GLOB GENERATED_CPP_FILES "${CMAKE_CURRENT_SOURCE_DIR}/generated/*.cpp") # this line is needed by codegen v1
|
|
31
|
-
|
|
32
|
-
add_library(rnoh_app SHARED
|
|
33
|
-
${GENERATED_CPP_FILES}
|
|
34
|
-
"./PackageProvider.cpp"
|
|
35
|
-
"${RNOH_CPP_DIR}/RNOHAppNapiBridge.cpp"
|
|
36
|
-
)
|
|
37
|
-
target_link_libraries(rnoh_app PUBLIC rnoh)
|
|
38
|
-
|
|
39
|
-
# RNOH_BEGIN: manual_package_linking_2
|
|
40
|
-
target_link_libraries(rnoh_app PUBLIC rnoh_slider)
|
|
41
|
-
# RNOH_END: manual_package_linking_2
|
|
1
|
+
project(rnapp)
|
|
2
|
+
cmake_minimum_required(VERSION 3.4.1)
|
|
3
|
+
set(CMAKE_SKIP_BUILD_RPATH TRUE)
|
|
4
|
+
set(RNOH_APP_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
|
|
5
|
+
set(NODE_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../../../node_modules")
|
|
6
|
+
set(OH_MODULE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../oh_modules")
|
|
7
|
+
set(RNOH_CPP_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../oh_modules/@rnoh/react-native-openharmony/src/main/cpp")
|
|
8
|
+
set(RNOH_GENERATED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/generated")
|
|
9
|
+
set(LOG_VERBOSITY_LEVEL 1)
|
|
10
|
+
set(CMAKE_ASM_FLAGS "-Wno-error=unused-command-line-argument -Qunused-arguments")
|
|
11
|
+
set(CMAKE_CXX_FLAGS "-fstack-protector-strong -Wl,-z,relro,-z,now,-z,noexecstack -s -fPIE -pie")
|
|
12
|
+
set(OH_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../oh_modules")
|
|
13
|
+
|
|
14
|
+
set(WITH_HITRACE_SYSTRACE 1) # for other CMakeLists.txt files to use
|
|
15
|
+
add_compile_definitions(WITH_HITRACE_SYSTRACE)
|
|
16
|
+
|
|
17
|
+
# (VM) Define a variable and assign it to the current module's cpp directory
|
|
18
|
+
set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR})
|
|
19
|
+
|
|
20
|
+
# Add the Header File directory, including cpp, cpp/include, and tell cmake to find the Header Files introduced by the code here
|
|
21
|
+
include_directories(${NATIVERENDER_ROOT_PATH}
|
|
22
|
+
${NATIVERENDER_ROOT_PATH}/include)
|
|
23
|
+
|
|
24
|
+
add_subdirectory("${RNOH_CPP_DIR}" ./rn)
|
|
25
|
+
|
|
26
|
+
# RNOH_BEGIN: manual_package_linking_1
|
|
27
|
+
add_subdirectory("${OH_MODULES}/@react-native-ohos/slider/src/main/cpp" ./slider)
|
|
28
|
+
# RNOH_END: manual_package_linking_1
|
|
29
|
+
|
|
30
|
+
file(GLOB GENERATED_CPP_FILES "${CMAKE_CURRENT_SOURCE_DIR}/generated/*.cpp") # this line is needed by codegen v1
|
|
31
|
+
|
|
32
|
+
add_library(rnoh_app SHARED
|
|
33
|
+
${GENERATED_CPP_FILES}
|
|
34
|
+
"./PackageProvider.cpp"
|
|
35
|
+
"${RNOH_CPP_DIR}/RNOHAppNapiBridge.cpp"
|
|
36
|
+
)
|
|
37
|
+
target_link_libraries(rnoh_app PUBLIC rnoh)
|
|
38
|
+
|
|
39
|
+
# RNOH_BEGIN: manual_package_linking_2
|
|
40
|
+
target_link_libraries(rnoh_app PUBLIC rnoh_slider)
|
|
41
|
+
# RNOH_END: manual_package_linking_2
|