@react-native-ohos/slider 5.1.2-rc.1 → 5.1.2-rc.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 +187 -183
- 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/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/dist/utils/styles.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/.github/Examples/Slider-Android-Example.gif +0 -0
- package/.github/Examples/Slider-Web-Example.gif +0 -0
- package/.github/Examples/Slider-Windows-Example.gif +0 -0
- package/.github/Examples/Slider-iOS-Example.gif +0 -0
- package/.github/ISSUE_TEMPLATE/BUG_REPORT.md +0 -38
- package/.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md +0 -14
- package/.github/ISSUE_TEMPLATE/QUESTION.md +0 -9
- package/.github/PULL_REQUEST_TEMPLATE.md +0 -11
- package/.github/workflows/ReactNativeSlider-CI.yml +0 -231
- package/harmony/slider/README.OpenSource +0 -11
|
@@ -1,44 +1,44 @@
|
|
|
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
|
-
@Component
|
|
9
|
-
export struct TouchDisplayer {
|
|
10
|
-
@State currentTouches: TouchObject[] = []
|
|
11
|
-
@State touchIndicatorOpacity: number = 0
|
|
12
|
-
@BuilderParam buildChildren: () => void
|
|
13
|
-
build() {
|
|
14
|
-
Stack() {
|
|
15
|
-
this.buildChildren()
|
|
16
|
-
ForEach(this.currentTouches, (activeTouch: TouchObject) => {
|
|
17
|
-
Stack() {
|
|
18
|
-
}
|
|
19
|
-
.width(64)
|
|
20
|
-
.height(64)
|
|
21
|
-
.backgroundColor("blue")
|
|
22
|
-
.borderWidth(2)
|
|
23
|
-
.borderColor("white")
|
|
24
|
-
.opacity(this.touchIndicatorOpacity)
|
|
25
|
-
.position({ x: activeTouch.x - 32, y: activeTouch.y - 32 })
|
|
26
|
-
.borderRadius(1000)
|
|
27
|
-
.hitTestBehavior(HitTestMode.Transparent)
|
|
28
|
-
})
|
|
29
|
-
}
|
|
30
|
-
.width("100%")
|
|
31
|
-
.height("100%")
|
|
32
|
-
.hitTestBehavior(HitTestMode.Transparent)
|
|
33
|
-
.onTouch(e => {
|
|
34
|
-
this.currentTouches = e.touches
|
|
35
|
-
this.touchIndicatorOpacity = 0.5
|
|
36
|
-
animateTo({
|
|
37
|
-
duration: 500,
|
|
38
|
-
curve: Curve.Linear,
|
|
39
|
-
}, () => {
|
|
40
|
-
this.touchIndicatorOpacity = 0
|
|
41
|
-
})
|
|
42
|
-
})
|
|
43
|
-
}
|
|
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
|
+
@Component
|
|
9
|
+
export struct TouchDisplayer {
|
|
10
|
+
@State currentTouches: TouchObject[] = []
|
|
11
|
+
@State touchIndicatorOpacity: number = 0
|
|
12
|
+
@BuilderParam buildChildren: () => void
|
|
13
|
+
build() {
|
|
14
|
+
Stack() {
|
|
15
|
+
this.buildChildren()
|
|
16
|
+
ForEach(this.currentTouches, (activeTouch: TouchObject) => {
|
|
17
|
+
Stack() {
|
|
18
|
+
}
|
|
19
|
+
.width(64)
|
|
20
|
+
.height(64)
|
|
21
|
+
.backgroundColor("blue")
|
|
22
|
+
.borderWidth(2)
|
|
23
|
+
.borderColor("white")
|
|
24
|
+
.opacity(this.touchIndicatorOpacity)
|
|
25
|
+
.position({ x: activeTouch.x - 32, y: activeTouch.y - 32 })
|
|
26
|
+
.borderRadius(1000)
|
|
27
|
+
.hitTestBehavior(HitTestMode.Transparent)
|
|
28
|
+
})
|
|
29
|
+
}
|
|
30
|
+
.width("100%")
|
|
31
|
+
.height("100%")
|
|
32
|
+
.hitTestBehavior(HitTestMode.Transparent)
|
|
33
|
+
.onTouch(e => {
|
|
34
|
+
this.currentTouches = e.touches
|
|
35
|
+
this.touchIndicatorOpacity = 0.5
|
|
36
|
+
animateTo({
|
|
37
|
+
duration: 500,
|
|
38
|
+
curve: Curve.Linear,
|
|
39
|
+
}, () => {
|
|
40
|
+
this.touchIndicatorOpacity = 0
|
|
41
|
+
})
|
|
42
|
+
})
|
|
43
|
+
}
|
|
44
44
|
}
|
|
@@ -1,52 +1,52 @@
|
|
|
1
|
-
{
|
|
2
|
-
"module": {
|
|
3
|
-
"name": "entry",
|
|
4
|
-
"type": "entry",
|
|
5
|
-
"description": "$string:module_desc",
|
|
6
|
-
"mainElement": "EntryAbility",
|
|
7
|
-
"deviceTypes": [
|
|
8
|
-
"default"
|
|
9
|
-
],
|
|
10
|
-
"querySchemes": [
|
|
11
|
-
"weixin",
|
|
12
|
-
],
|
|
13
|
-
"deliveryWithInstall": true,
|
|
14
|
-
"installationFree": false,
|
|
15
|
-
"pages": "$profile:main_pages",
|
|
16
|
-
// below property is supported from 5.0.0 - it is needed by bundleManager.canOpenLink to check if the app can open some url
|
|
17
|
-
// "querySchemes": ["maps", "http", "https", "customDomain"],
|
|
18
|
-
"requestPermissions": [
|
|
19
|
-
{
|
|
20
|
-
"name": "ohos.permission.INTERNET"
|
|
21
|
-
},
|
|
22
|
-
],
|
|
23
|
-
"metadata": [
|
|
24
|
-
{
|
|
25
|
-
"name": "OPTLazyForEach",
|
|
26
|
-
"value": "true",
|
|
27
|
-
}
|
|
28
|
-
],
|
|
29
|
-
"abilities": [
|
|
30
|
-
{
|
|
31
|
-
"name": "EntryAbility",
|
|
32
|
-
"srcEntry": "./ets/entryability/EntryAbility.ets",
|
|
33
|
-
"description": "$string:EntryAbility_desc",
|
|
34
|
-
"icon": "$media:icon",
|
|
35
|
-
"label": "$string:EntryAbility_label",
|
|
36
|
-
"startWindowIcon": "$media:icon",
|
|
37
|
-
"startWindowBackground": "$color:start_window_background",
|
|
38
|
-
"visible": true,
|
|
39
|
-
"skills": [
|
|
40
|
-
{
|
|
41
|
-
"entities": [
|
|
42
|
-
"entity.system.home"
|
|
43
|
-
],
|
|
44
|
-
"actions": [
|
|
45
|
-
"action.system.home"
|
|
46
|
-
]
|
|
47
|
-
}
|
|
48
|
-
]
|
|
49
|
-
}
|
|
50
|
-
]
|
|
51
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"module": {
|
|
3
|
+
"name": "entry",
|
|
4
|
+
"type": "entry",
|
|
5
|
+
"description": "$string:module_desc",
|
|
6
|
+
"mainElement": "EntryAbility",
|
|
7
|
+
"deviceTypes": [
|
|
8
|
+
"default"
|
|
9
|
+
],
|
|
10
|
+
"querySchemes": [
|
|
11
|
+
"weixin",
|
|
12
|
+
],
|
|
13
|
+
"deliveryWithInstall": true,
|
|
14
|
+
"installationFree": false,
|
|
15
|
+
"pages": "$profile:main_pages",
|
|
16
|
+
// below property is supported from 5.0.0 - it is needed by bundleManager.canOpenLink to check if the app can open some url
|
|
17
|
+
// "querySchemes": ["maps", "http", "https", "customDomain"],
|
|
18
|
+
"requestPermissions": [
|
|
19
|
+
{
|
|
20
|
+
"name": "ohos.permission.INTERNET"
|
|
21
|
+
},
|
|
22
|
+
],
|
|
23
|
+
"metadata": [
|
|
24
|
+
{
|
|
25
|
+
"name": "OPTLazyForEach",
|
|
26
|
+
"value": "true",
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
"abilities": [
|
|
30
|
+
{
|
|
31
|
+
"name": "EntryAbility",
|
|
32
|
+
"srcEntry": "./ets/entryability/EntryAbility.ets",
|
|
33
|
+
"description": "$string:EntryAbility_desc",
|
|
34
|
+
"icon": "$media:icon",
|
|
35
|
+
"label": "$string:EntryAbility_label",
|
|
36
|
+
"startWindowIcon": "$media:icon",
|
|
37
|
+
"startWindowBackground": "$color:start_window_background",
|
|
38
|
+
"visible": true,
|
|
39
|
+
"skills": [
|
|
40
|
+
{
|
|
41
|
+
"entities": [
|
|
42
|
+
"entity.system.home"
|
|
43
|
+
],
|
|
44
|
+
"actions": [
|
|
45
|
+
"action.system.home"
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
52
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
{
|
|
2
|
-
"color": [
|
|
3
|
-
{
|
|
4
|
-
"name": "start_window_background",
|
|
5
|
-
"value": "#FFFFFF"
|
|
6
|
-
}
|
|
7
|
-
]
|
|
1
|
+
{
|
|
2
|
+
"color": [
|
|
3
|
+
{
|
|
4
|
+
"name": "start_window_background",
|
|
5
|
+
"value": "#FFFFFF"
|
|
6
|
+
}
|
|
7
|
+
]
|
|
8
8
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
{
|
|
2
|
-
"string": [
|
|
3
|
-
{
|
|
4
|
-
"name": "module_desc",
|
|
5
|
-
"value": "module description"
|
|
6
|
-
},
|
|
7
|
-
{
|
|
8
|
-
"name": "EntryAbility_desc",
|
|
9
|
-
"value": "description"
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
"name": "EntryAbility_label",
|
|
13
|
-
"value": "RN Tester"
|
|
14
|
-
}
|
|
15
|
-
]
|
|
1
|
+
{
|
|
2
|
+
"string": [
|
|
3
|
+
{
|
|
4
|
+
"name": "module_desc",
|
|
5
|
+
"value": "module description"
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
"name": "EntryAbility_desc",
|
|
9
|
+
"value": "description"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"name": "EntryAbility_label",
|
|
13
|
+
"value": "RN Tester"
|
|
14
|
+
}
|
|
15
|
+
]
|
|
16
16
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
{
|
|
2
|
-
"src": [
|
|
3
|
-
"pages/Index"
|
|
4
|
-
]
|
|
5
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"src": [
|
|
3
|
+
"pages/Index"
|
|
4
|
+
]
|
|
5
|
+
}
|
|
@@ -1,18 +1,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
|
-
$directoryPath = Split-Path -Parent $MyInvocation.MyCommand.Path
|
|
8
|
-
$filePaths = Get-ChildItem $directoryPath -Recurse -Include *.h, *.cpp |
|
|
9
|
-
Where-Object {
|
|
10
|
-
$_.DirectoryName -notmatch 'third-party' -and
|
|
11
|
-
$_.DirectoryName -notmatch 'patches' -and
|
|
12
|
-
$_.DirectoryName -notmatch 'node_modules' -and
|
|
13
|
-
$_.DirectoryName -notmatch '.cxx' -and
|
|
14
|
-
$_.DirectoryName -notmatch 'build'
|
|
15
|
-
}
|
|
16
|
-
foreach ($filePath in $filePaths) {
|
|
17
|
-
& "clang-format.exe" -style=file -i $filePath.FullName
|
|
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
|
+
$directoryPath = Split-Path -Parent $MyInvocation.MyCommand.Path
|
|
8
|
+
$filePaths = Get-ChildItem $directoryPath -Recurse -Include *.h, *.cpp |
|
|
9
|
+
Where-Object {
|
|
10
|
+
$_.DirectoryName -notmatch 'third-party' -and
|
|
11
|
+
$_.DirectoryName -notmatch 'patches' -and
|
|
12
|
+
$_.DirectoryName -notmatch 'node_modules' -and
|
|
13
|
+
$_.DirectoryName -notmatch '.cxx' -and
|
|
14
|
+
$_.DirectoryName -notmatch 'build'
|
|
15
|
+
}
|
|
16
|
+
foreach ($filePath in $filePaths) {
|
|
17
|
+
& "clang-format.exe" -style=file -i $filePath.FullName
|
|
18
18
|
}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
{
|
|
2
|
-
"modelVersion": "5.0.0",
|
|
3
|
-
"dependencies": {
|
|
4
|
-
},
|
|
5
|
-
"execution": {
|
|
6
|
-
// "analyze": "default", /* Define the build analyze mode. Value: [ "default" | "verbose" | false ]. Default: "default" */
|
|
7
|
-
// "daemon": true, /* Enable daemon compilation. Value: [ true | false ]. Default: true */
|
|
8
|
-
// "incremental": true, /* Enable incremental compilation. Value: [ true | false ]. Default: true */
|
|
9
|
-
// "parallel": true, /* Enable parallel compilation. Value: [ true | false ]. Default: true */
|
|
10
|
-
// "typeCheck": false, /* Enable typeCheck. Value: [ true | false ]. Default: false */
|
|
11
|
-
},
|
|
12
|
-
"logging": {
|
|
13
|
-
// "level": "info" /* Define the log level. Value: [ "debug" | "info" | "warn" | "error" ]. Default: "info" */
|
|
14
|
-
},
|
|
15
|
-
"debugging": {
|
|
16
|
-
"stacktrace": false /* Disable stacktrace compilation. Value: [ true | false ]. Default: false */
|
|
17
|
-
},
|
|
18
|
-
"nodeOptions": {
|
|
19
|
-
// "maxOldSpaceSize": 4096 /* Enable nodeOptions maxOldSpaceSize compilation. Unit M. Used for the daemon process */
|
|
20
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"modelVersion": "5.0.0",
|
|
3
|
+
"dependencies": {
|
|
4
|
+
},
|
|
5
|
+
"execution": {
|
|
6
|
+
// "analyze": "default", /* Define the build analyze mode. Value: [ "default" | "verbose" | false ]. Default: "default" */
|
|
7
|
+
// "daemon": true, /* Enable daemon compilation. Value: [ true | false ]. Default: true */
|
|
8
|
+
// "incremental": true, /* Enable incremental compilation. Value: [ true | false ]. Default: true */
|
|
9
|
+
// "parallel": true, /* Enable parallel compilation. Value: [ true | false ]. Default: true */
|
|
10
|
+
// "typeCheck": false, /* Enable typeCheck. Value: [ true | false ]. Default: false */
|
|
11
|
+
},
|
|
12
|
+
"logging": {
|
|
13
|
+
// "level": "info" /* Define the log level. Value: [ "debug" | "info" | "warn" | "error" ]. Default: "info" */
|
|
14
|
+
},
|
|
15
|
+
"debugging": {
|
|
16
|
+
"stacktrace": false /* Disable stacktrace compilation. Value: [ true | false ]. Default: false */
|
|
17
|
+
},
|
|
18
|
+
"nodeOptions": {
|
|
19
|
+
// "maxOldSpaceSize": 4096 /* Enable nodeOptions maxOldSpaceSize compilation. Unit M. Used for the daemon process */
|
|
20
|
+
}
|
|
21
21
|
}
|
|
@@ -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
|
-
|
|
8
|
-
// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently.
|
|
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
|
+
// Script for compiling build behavior. It is built in the build plug-in and cannot be modified currently.
|
|
9
9
|
export { appTasks } from '@ohos/hvigor-ohos-plugin';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
{
|
|
2
|
-
"modelVersion": "5.0.0",
|
|
3
|
-
"license": "ISC",
|
|
4
|
-
"name": "rnoh",
|
|
5
|
-
"description": "example description",
|
|
6
|
-
"repository": {},
|
|
7
|
-
"version": "1.0.0",
|
|
8
|
-
"overrides": {
|
|
9
|
-
"@rnoh/react-native-openharmony": "file:./../node_modules/react-native-harmony/harmony/react_native_openharmony.har"
|
|
10
|
-
},
|
|
11
|
-
"dynamicDependencies": {}
|
|
1
|
+
{
|
|
2
|
+
"modelVersion": "5.0.0",
|
|
3
|
+
"license": "ISC",
|
|
4
|
+
"name": "rnoh",
|
|
5
|
+
"description": "example description",
|
|
6
|
+
"repository": {},
|
|
7
|
+
"version": "1.0.0",
|
|
8
|
+
"overrides": {
|
|
9
|
+
"@rnoh/react-native-openharmony": "file:./../node_modules/react-native-harmony/harmony/react_native_openharmony.har"
|
|
10
|
+
},
|
|
11
|
+
"dynamicDependencies": {}
|
|
12
12
|
}
|
package/example/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
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 {AppRegistry, View, Text} from 'react-native';
|
|
8
|
-
import {name as appName} from './app.json';
|
|
9
|
-
import SliderExample from './src/index';
|
|
10
|
-
|
|
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 {AppRegistry, View, Text} from 'react-native';
|
|
8
|
+
import {name as appName} from './app.json';
|
|
9
|
+
import SliderExample from './src/index';
|
|
10
|
+
|
|
11
11
|
AppRegistry.registerComponent(appName, () => SliderExample);
|
package/example/jest.config.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
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
|
-
/** @type {import('ts-jest').JestConfigWithTsJest} */
|
|
8
|
-
module.exports = {
|
|
9
|
-
preset: 'ts-jest',
|
|
10
|
-
testEnvironment: 'node',
|
|
11
|
-
};
|
|
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
|
+
/** @type {import('ts-jest').JestConfigWithTsJest} */
|
|
8
|
+
module.exports = {
|
|
9
|
+
preset: 'ts-jest',
|
|
10
|
+
testEnvironment: 'node',
|
|
11
|
+
};
|
package/example/metro.config.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
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
|
-
const {mergeConfig, getDefaultConfig} = require('@react-native/metro-config');
|
|
8
|
-
const {createHarmonyMetroConfig} = require('react-native-harmony/metro.config');
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* @type {import("metro-config").ConfigT}
|
|
12
|
-
*/
|
|
13
|
-
const config = {
|
|
14
|
-
transformer: {
|
|
15
|
-
getTransformOptions: async () => ({
|
|
16
|
-
transform: {
|
|
17
|
-
experimentalImportSupport: false,
|
|
18
|
-
inlineRequires: true,
|
|
19
|
-
},
|
|
20
|
-
}),
|
|
21
|
-
},
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
module.exports = mergeConfig(
|
|
25
|
-
getDefaultConfig(__dirname),
|
|
26
|
-
createHarmonyMetroConfig({
|
|
27
|
-
reactNativeHarmonyPackageName: 'react-native-harmony',
|
|
28
|
-
}),
|
|
29
|
-
config,
|
|
30
|
-
);
|
|
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
|
+
const {mergeConfig, getDefaultConfig} = require('@react-native/metro-config');
|
|
8
|
+
const {createHarmonyMetroConfig} = require('react-native-harmony/metro.config');
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* @type {import("metro-config").ConfigT}
|
|
12
|
+
*/
|
|
13
|
+
const config = {
|
|
14
|
+
transformer: {
|
|
15
|
+
getTransformOptions: async () => ({
|
|
16
|
+
transform: {
|
|
17
|
+
experimentalImportSupport: false,
|
|
18
|
+
inlineRequires: true,
|
|
19
|
+
},
|
|
20
|
+
}),
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
module.exports = mergeConfig(
|
|
25
|
+
getDefaultConfig(__dirname),
|
|
26
|
+
createHarmonyMetroConfig({
|
|
27
|
+
reactNativeHarmonyPackageName: 'react-native-harmony',
|
|
28
|
+
}),
|
|
29
|
+
config,
|
|
30
|
+
);
|
package/example/package.json
CHANGED
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "react-native-harmony-tester",
|
|
3
|
-
"version": "1.0.0",
|
|
4
|
-
"private": true,
|
|
5
|
-
"scripts": {
|
|
6
|
-
"i": "cd ../ && npm i && npm run pack && cd ./example && npm i",
|
|
7
|
-
"reStart": "npm run install:pkg && npm run codegen && hdc rport tcp:8081 tcp:8081 && react-native start",
|
|
8
|
-
"start": "hdc rport tcp:8081 tcp:8081 && react-native start",
|
|
9
|
-
"codegen": "react-native codegen-harmony --rnoh-module-path ./harmony/entry/oh_modules/@rnoh/react-native-openharmony",
|
|
10
|
-
"pack:pkg": "cd ../ && npm pack && cd ./example",
|
|
11
|
-
"install:pkg": "npm uninstall @react-native-ohos/slider && npm run pack:pkg && npm i @react-native-ohos/slider@file:../react-native-ohos-slider-5.0.1-rc.1.tgz",
|
|
12
|
-
"dev": "npm run codegen && react-native bundle-harmony --dev --minify=false",
|
|
13
|
-
"prod": "npm run codegen && react-native bundle-harmony --dev=false --minify=true",
|
|
14
|
-
"postinstall": "node ./scripts/create-build-profile",
|
|
15
|
-
"fast:pkg": "cd ../ && npm i --legacy-peer-deps && npm pack && cd ./example && npm i && npm run dev"
|
|
16
|
-
},
|
|
17
|
-
"dependencies": {
|
|
18
|
-
"@react-native-ohos/slider": "file:../react-native-ohos-slider-5.0.1-rc.1.tgz",
|
|
19
|
-
"react": "18.3.1",
|
|
20
|
-
"react-native": "0.77.1",
|
|
21
|
-
"react-native-harmony": "file:../packages/rnoh-react-native-harmony-0.77.10.tgz"
|
|
22
|
-
},
|
|
23
|
-
"devDependencies": {
|
|
24
|
-
"@babel/core": "^7.25.2",
|
|
25
|
-
"@babel/preset-env": "^7.25.3",
|
|
26
|
-
"@babel/runtime": "^7.25.0",
|
|
27
|
-
"@react-native-community/cli": "15.0.1",
|
|
28
|
-
"@react-native-community/cli-platform-android": "15.0.1",
|
|
29
|
-
"@react-native-community/cli-platform-ios": "15.0.1",
|
|
30
|
-
"@react-native-community/eslint-config": "^3.2.0",
|
|
31
|
-
"@react-native/babel-preset": "0.77.1",
|
|
32
|
-
"@react-native/eslint-config": "0.77.1",
|
|
33
|
-
"@react-native/metro-config": "^0.77.1",
|
|
34
|
-
"@react-native/typescript-config": "0.77.1",
|
|
35
|
-
"@rnoh/react-native-harmony-cli": "file:../packages/rnoh-react-native-harmony-cli-0.77.10.tgz",
|
|
36
|
-
"@tsconfig/react-native": "^3.0.0",
|
|
37
|
-
"@types/d3-scale-chromatic": "^3.0.0",
|
|
38
|
-
"@types/jest": "^29.5.13",
|
|
39
|
-
"@types/react": "^18.2.6",
|
|
40
|
-
"@types/react-test-renderer": "^18.0.0",
|
|
41
|
-
"babel-jest": "^29.6.3",
|
|
42
|
-
"eslint": "^8.19.0",
|
|
43
|
-
"jest": "^29.7.0",
|
|
44
|
-
"metro-react-native-babel-preset": "0.76.8",
|
|
45
|
-
"prettier": "2.8.8",
|
|
46
|
-
"react-test-renderer": "18.3.1",
|
|
47
|
-
"typescript": "5.5.4"
|
|
48
|
-
},
|
|
49
|
-
"overrides": {
|
|
50
|
-
"@react-native-community/cli": "15.0.1"
|
|
51
|
-
},
|
|
52
|
-
"resolutions": {
|
|
53
|
-
"@react-native-community/cli": "15.0.1"
|
|
54
|
-
},
|
|
55
|
-
"engines": {
|
|
56
|
-
"node": ">=18"
|
|
57
|
-
}
|
|
58
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "react-native-harmony-tester",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"scripts": {
|
|
6
|
+
"i": "cd ../ && npm i && npm run pack && cd ./example && npm i",
|
|
7
|
+
"reStart": "npm run install:pkg && npm run codegen && hdc rport tcp:8081 tcp:8081 && react-native start",
|
|
8
|
+
"start": "hdc rport tcp:8081 tcp:8081 && react-native start",
|
|
9
|
+
"codegen": "react-native codegen-harmony --rnoh-module-path ./harmony/entry/oh_modules/@rnoh/react-native-openharmony",
|
|
10
|
+
"pack:pkg": "cd ../ && npm pack && cd ./example",
|
|
11
|
+
"install:pkg": "npm uninstall @react-native-ohos/slider && npm run pack:pkg && npm i @react-native-ohos/slider@file:../react-native-ohos-slider-5.0.1-rc.1.tgz",
|
|
12
|
+
"dev": "npm run codegen && react-native bundle-harmony --dev --minify=false",
|
|
13
|
+
"prod": "npm run codegen && react-native bundle-harmony --dev=false --minify=true",
|
|
14
|
+
"postinstall": "node ./scripts/create-build-profile",
|
|
15
|
+
"fast:pkg": "cd ../ && npm i --legacy-peer-deps && npm pack && cd ./example && npm i && npm run dev"
|
|
16
|
+
},
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"@react-native-ohos/slider": "file:../react-native-ohos-slider-5.0.1-rc.1.tgz",
|
|
19
|
+
"react": "18.3.1",
|
|
20
|
+
"react-native": "0.77.1",
|
|
21
|
+
"react-native-harmony": "file:../packages/rnoh-react-native-harmony-0.77.10.tgz"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"@babel/core": "^7.25.2",
|
|
25
|
+
"@babel/preset-env": "^7.25.3",
|
|
26
|
+
"@babel/runtime": "^7.25.0",
|
|
27
|
+
"@react-native-community/cli": "15.0.1",
|
|
28
|
+
"@react-native-community/cli-platform-android": "15.0.1",
|
|
29
|
+
"@react-native-community/cli-platform-ios": "15.0.1",
|
|
30
|
+
"@react-native-community/eslint-config": "^3.2.0",
|
|
31
|
+
"@react-native/babel-preset": "0.77.1",
|
|
32
|
+
"@react-native/eslint-config": "0.77.1",
|
|
33
|
+
"@react-native/metro-config": "^0.77.1",
|
|
34
|
+
"@react-native/typescript-config": "0.77.1",
|
|
35
|
+
"@rnoh/react-native-harmony-cli": "file:../packages/rnoh-react-native-harmony-cli-0.77.10.tgz",
|
|
36
|
+
"@tsconfig/react-native": "^3.0.0",
|
|
37
|
+
"@types/d3-scale-chromatic": "^3.0.0",
|
|
38
|
+
"@types/jest": "^29.5.13",
|
|
39
|
+
"@types/react": "^18.2.6",
|
|
40
|
+
"@types/react-test-renderer": "^18.0.0",
|
|
41
|
+
"babel-jest": "^29.6.3",
|
|
42
|
+
"eslint": "^8.19.0",
|
|
43
|
+
"jest": "^29.7.0",
|
|
44
|
+
"metro-react-native-babel-preset": "0.76.8",
|
|
45
|
+
"prettier": "2.8.8",
|
|
46
|
+
"react-test-renderer": "18.3.1",
|
|
47
|
+
"typescript": "5.5.4"
|
|
48
|
+
},
|
|
49
|
+
"overrides": {
|
|
50
|
+
"@react-native-community/cli": "15.0.1"
|
|
51
|
+
},
|
|
52
|
+
"resolutions": {
|
|
53
|
+
"@react-native-community/cli": "15.0.1"
|
|
54
|
+
},
|
|
55
|
+
"engines": {
|
|
56
|
+
"node": ">=18"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
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
|
-
project: {
|
|
9
|
-
},
|
|
10
|
-
assets: ['./assets/fonts/'],
|
|
11
|
-
};
|
|
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
|
+
project: {
|
|
9
|
+
},
|
|
10
|
+
assets: ['./assets/fonts/'],
|
|
11
|
+
};
|