From 7a08b20453dacaaa0bd62f61afdc4faa54338cbd Mon Sep 17 00:00:00 2001 From: sunfei Date: Fri, 23 May 2025 18:13:04 +0800 Subject: [PATCH 1/5] build koala with gn Signed-off-by: sunfei Change-Id: I5b47bd710f9b2fd6c7ec285cb782608c70d8a350 --- frameworks/bridge/arkts_frontend/BUILD.gn | 15 ++ .../arkui-ohos/src/component/common.ts | 2 +- .../arkui-ohos/src/component/navigation.ts | 2 +- .../incremental/common/BUILD.gn | 26 +++ .../incremental/common/common.gni | 39 ++++ .../incremental/common/src/Finalization.ts | 1 - .../incremental/compat/BUILD.gn | 26 +++ .../incremental/compat/compat.gni | 42 ++++ .../incremental/runtime/.gitignore | 3 +- .../incremental/runtime/BUILD.gn | 48 +++++ .../incremental/runtime/annotations/index.ts | 29 +++ .../incremental/runtime/arktsconfig-gn.json | 14 ++ .../incremental/runtime/package.json | 3 +- .../incremental/runtime/runtime.gni | 61 ++++++ .../runtime/src/animation/TimeAnimation.ts | 10 +- .../incremental/runtime/src/index.ts | 2 +- .../incremental/runtime/src/memo/remember.ts | 4 +- .../incremental/runtime/src/states/State.ts | 2 +- .../incremental/runtime/stateMgmt.ts | 18 ++ .../koala_projects/interop/BUILD.gn | 26 +++ .../koala_projects/interop/interop.gni | 43 ++++ .../interop/src/arkts/Finalizable.ts | 3 +- .../interop/src/interop/Finalizable.ts | 3 +- .../koala_projects/tools/gen_gni.py | 188 ++++++++++++++++++ frameworks/bridge/arkts_frontend/link_abc.gni | 74 +++++++ .../bridge/arkts_frontend/run_binary.py | 76 +++++++ 26 files changed, 744 insertions(+), 16 deletions(-) create mode 100644 frameworks/bridge/arkts_frontend/koala_projects/incremental/common/BUILD.gn create mode 100644 frameworks/bridge/arkts_frontend/koala_projects/incremental/common/common.gni create mode 100644 frameworks/bridge/arkts_frontend/koala_projects/incremental/compat/BUILD.gn create mode 100644 frameworks/bridge/arkts_frontend/koala_projects/incremental/compat/compat.gni create mode 100644 frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/BUILD.gn create mode 100644 frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/annotations/index.ts create mode 100644 frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/arktsconfig-gn.json create mode 100644 frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/runtime.gni create mode 100644 frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/stateMgmt.ts create mode 100644 frameworks/bridge/arkts_frontend/koala_projects/interop/BUILD.gn create mode 100644 frameworks/bridge/arkts_frontend/koala_projects/interop/interop.gni create mode 100755 frameworks/bridge/arkts_frontend/koala_projects/tools/gen_gni.py create mode 100644 frameworks/bridge/arkts_frontend/link_abc.gni create mode 100755 frameworks/bridge/arkts_frontend/run_binary.py diff --git a/frameworks/bridge/arkts_frontend/BUILD.gn b/frameworks/bridge/arkts_frontend/BUILD.gn index 87f7d611d47..dd0e9738303 100644 --- a/frameworks/bridge/arkts_frontend/BUILD.gn +++ b/frameworks/bridge/arkts_frontend/BUILD.gn @@ -13,11 +13,23 @@ import("//build/ohos.gni") import("//foundation/arkui/ace_engine/ace_config.gni") +import("./link_abc.gni") group("arkts_frontend_native_package") { deps = [ "koala_projects/arkoala-arkts/arkui-ohos/src/ani/native:ace_ani_native_package" ] } +link_abc_files("arkoala_abc") { + targets = [ + "koala_projects/interop:interop_abc", + "koala_projects/incremental/common:common_abc", + "koala_projects/incremental/compat:compat_abc", + "koala_projects/incremental/runtime:runtime_abc", + ] + + output_name = "arkoala" +} + template("arkts_frontend") { forward_variables_from(invoker, "*") @@ -29,6 +41,9 @@ template("arkts_frontend") { deps = [ ":ArkoalaNative_ark", "arkoala:arkoala_prebuild", + + # enable when use build-system to compile arkoala + # ":arkoala_abc" ] if (build_ohos_sdk) { diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/common.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/common.ts index d32f6d39726..39d4ee9ac39 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/common.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/common.ts @@ -44,7 +44,7 @@ import { PixelMap } from "./arkui-pixelmap" import { BlendMode } from "./arkui-drawing" import { StyledString } from "./styledString" import { Callback_Number_Number_Void } from "./grid" -import { memo, NodeAttach, remember } from "@koalaui/runtime" +import { memoize, NodeAttach, remember } from "@koalaui/runtime" import { Tuple_Number_Number } from "./arkui-synthetics" import { ButtonType, ButtonStyleMode, ButtonRole } from "./button" import { Callback_Number_Void } from "./alphabetIndexer" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/navigation.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/navigation.ts index d9c3c3f4139..cd0add00681 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/navigation.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/navigation.ts @@ -19,7 +19,7 @@ import { TypeChecker, ArkUIGeneratedNativeModule } from "#components" import { Finalizable, runtimeType, RuntimeType, InteropNativeModule, SerializerBase, registerCallback, wrapCallback, toPeerPtr, KPointer, MaterializedBase, NativeBuffer, nullptr, KInt, KBoolean, KStringPtr } from "@koalaui/interop" import { unsafeCast, int32, int64, float32, int8 } from "@koalaui/common" -import { GlobalStateManager, StateContext, __context, memo, memoEntry } from '@koalaui/runtime' +import { GlobalStateManager, StateContext, __context, memoize, memoEntry } from '@koalaui/runtime' import { Serializer } from "./peers/Serializer" import { CallbackKind } from "./peers/CallbackKind" import { Deserializer } from "./peers/Deserializer" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/incremental/common/BUILD.gn b/frameworks/bridge/arkts_frontend/koala_projects/incremental/common/BUILD.gn new file mode 100644 index 00000000000..e1d7bce279e --- /dev/null +++ b/frameworks/bridge/arkts_frontend/koala_projects/incremental/common/BUILD.gn @@ -0,0 +1,26 @@ +# Copyright (c) 2025 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/config/components/ets_frontend/ets2abc_config.gni") +import("//build/ohos.gni") +import("./common.gni") + +generate_static_abc("common_abc") { + base_url = "./src" + files = koalaui_common_files + package = "@koalaui/common" + paths_keys = koalaui_common_path_keys + paths_values = koalaui_common_path_values + dst_file = target_out_dir + "/common.abc" + out_puts = [ target_out_dir + "/common.abc" ] +} diff --git a/frameworks/bridge/arkts_frontend/koala_projects/incremental/common/common.gni b/frameworks/bridge/arkts_frontend/koala_projects/incremental/common/common.gni new file mode 100644 index 00000000000..1a394910500 --- /dev/null +++ b/frameworks/bridge/arkts_frontend/koala_projects/incremental/common/common.gni @@ -0,0 +1,39 @@ +# Copyright (c) 2025 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# DO NOT MODIFY THIS FILE MANUALLY. +# USE FOLLOWING COMMAND: +# ../../tools/gen_gni.py --json arktsconfig.json --output common.gni --gn-tool ../../../../../../../../../prebuilts/build-tools/linux-x86/bin/gn + +koalaui_common_files = [ + "src/Point3.ts", + "src/MarkableQueue.ts", + "src/PerfProbe.ts", + "src/koalaKey.ts", + "src/Finalization.ts", + "src/stringUtils.ts", + "src/math.ts", + "src/uniqueId.ts", + "src/index.ts", + "src/Point.ts", + "src/Matrix44.ts", + "src/LifecycleEvent.ts", + "src/sha1.ts", + "src/KoalaProfiler.ts", + "src/Matrix33.ts", + "src/Errors.ts", +] + +koalaui_common_path_keys = [ "@koalaui/compat" ] + +koalaui_common_path_values = [ "../compat/src/arkts" ] diff --git a/frameworks/bridge/arkts_frontend/koala_projects/incremental/common/src/Finalization.ts b/frameworks/bridge/arkts_frontend/koala_projects/incremental/common/src/Finalization.ts index 2ba480ca2d5..fd5bcb3301f 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/incremental/common/src/Finalization.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/incremental/common/src/Finalization.ts @@ -15,7 +15,6 @@ import { finalizerRegister as finalizerRegisterCompat, finalizerUnregister as finalizerUnregisterCompat, Thunk } from "@koalaui/compat" -export { Thunk } from "@koalaui/compat" export function finalizerRegister(target: object, thunk: Thunk) { finalizerRegisterCompat(target, thunk) diff --git a/frameworks/bridge/arkts_frontend/koala_projects/incremental/compat/BUILD.gn b/frameworks/bridge/arkts_frontend/koala_projects/incremental/compat/BUILD.gn new file mode 100644 index 00000000000..f2ca6d7b187 --- /dev/null +++ b/frameworks/bridge/arkts_frontend/koala_projects/incremental/compat/BUILD.gn @@ -0,0 +1,26 @@ +# Copyright (c) 2025 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/config/components/ets_frontend/ets2abc_config.gni") +import("//build/ohos.gni") +import("./compat.gni") + +generate_static_abc("compat_abc") { + base_url = "./src/arkts" + files = koalaui_compat_files + package = "@koalaui/compat" + paths_keys = koalaui_compat_path_keys + paths_values = koalaui_compat_path_values + dst_file = target_out_dir + "/compat.abc" + out_puts = [ target_out_dir + "/compat.abc" ] +} diff --git a/frameworks/bridge/arkts_frontend/koala_projects/incremental/compat/compat.gni b/frameworks/bridge/arkts_frontend/koala_projects/incremental/compat/compat.gni new file mode 100644 index 00000000000..61e7d07599a --- /dev/null +++ b/frameworks/bridge/arkts_frontend/koala_projects/incremental/compat/compat.gni @@ -0,0 +1,42 @@ +# Copyright (c) 2025 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# DO NOT MODIFY THIS FILE MANUALLY. +# USE FOLLOWING COMMAND: +# ../../tools/gen_gni.py --json arktsconfig.json --output compat.gni --gn-tool ../../../../../../../../../prebuilts/build-tools/linux-x86/bin/gn + +koalaui_compat_files = [ + "src/index.ts", + "src/arkts/ts-reflection.ts", + "src/arkts/strings.ts", + "src/arkts/types.ts", + "src/arkts/prop-deep-copy.ts", + "src/arkts/utils.ts", + "src/arkts/performance.ts", + "src/arkts/array.ts", + "src/arkts/atomic.ts", + "src/arkts/observable.ts", + "src/arkts/double.ts", + "src/arkts/reflection.ts", + "src/arkts/finalization.ts", +] + +koalaui_compat_path_keys = [ + "#platform", + "@koalaui/compat", +] + +koalaui_compat_path_values = [ + "src/arkts", + "src", +] diff --git a/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/.gitignore b/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/.gitignore index a8bd8b51855..5c6b8380511 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/.gitignore +++ b/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/.gitignore @@ -1 +1,2 @@ -test/ohos-index.ts \ No newline at end of file +test/ohos-index.ts +ets/ \ No newline at end of file diff --git a/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/BUILD.gn b/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/BUILD.gn new file mode 100644 index 00000000000..efc0801d561 --- /dev/null +++ b/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/BUILD.gn @@ -0,0 +1,48 @@ +# Copyright (c) 2025 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/config/components/ets_frontend/ets2abc_config.gni") +import("//build/ohos.gni") +import("./runtime.gni") + +action("run_annotate") { + outputs = [ "$target_out_dir/ets" ] + node_version = "v16.20.2" + host_arch = "${host_os}-${host_cpu}" + + script = "../../../run_binary.py" + + node_path = rebase_path( + "//prebuilts/build-tools/common/nodejs/node-${node_version}-${host_arch}/bin") + + args = [ + "path-env=${node_path}", + "npm", + "run", + "annotate", + "--prefix", + rebase_path("."), + ] +} + +generate_static_abc("runtime_abc") { + base_url = "./ets" + files = koalaui_runtime_files + package = "@koalaui/runtime" + paths_keys = koalaui_runtime_path_keys + paths_values = koalaui_runtime_path_values + ui_enable = "True" + dependencies = [ ":run_annotate" ] + dst_file = target_out_dir + "/runtime.abc" + out_puts = [ target_out_dir + "/runtime.abc" ] +} diff --git a/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/annotations/index.ts b/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/annotations/index.ts new file mode 100644 index 00000000000..7e51be7e2c8 --- /dev/null +++ b/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/annotations/index.ts @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@Retention({policy: "SOURCE"}) +export @interface memo {} + +@Retention({policy: "SOURCE"}) +export @interface memo_intrinsic {} + +@Retention({policy: "SOURCE"}) +export @interface memo_entry {} + +@Retention({policy: "SOURCE"}) +export @interface memo_stable {} + +@Retention({policy: "SOURCE"}) +export @interface memo_skip {} diff --git a/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/arktsconfig-gn.json b/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/arktsconfig-gn.json new file mode 100644 index 00000000000..71d79d0c6dd --- /dev/null +++ b/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/arktsconfig-gn.json @@ -0,0 +1,14 @@ +{ + "compilerOptions": { + "package": "@koalaui/runtime", + "outDir": "build", + "baseUrl": "./ets", + "paths": { + "@koalaui/common": ["../../common/src"], + "@koalaui/compat": ["../../compat/src/arkts"], + "@koalaui/runtime/annotations": ["../annotations"], + "@ohos.arkui.stateManagement": ["../stateMgmt.ts"] + } + }, + "include": ["ets/**/*.ts"] +} diff --git a/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/package.json b/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/package.json index 3b51b6cdb38..1e31bd055ec 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/package.json +++ b/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/package.json @@ -38,7 +38,8 @@ "link:incremental": "../tools/panda/arkts/arklink --output build/incremental.abc -- ../compat/build/compat.abc ../common/build/common.abc build/runtime.abc", "build:incremental": "npm run build:incremental:components && npm run link:incremental", "build:incremental:inc": "npm run build:incremental:components:inc && npm run link:incremental", - "clean:incremental": "npm run clean && npm run clean -C ../compat && npm run clean -C ../common" + "clean:incremental": "npm run clean && npm run clean -C ../compat && npm run clean -C ../common", + "annotate": "npm run compile --prefix ../../../koala_mirror/ui2abc/annotate && node ../../../koala_mirror/ui2abc/annotate" }, "keywords": [], "dependencies": { diff --git a/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/runtime.gni b/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/runtime.gni new file mode 100644 index 00000000000..b192a130452 --- /dev/null +++ b/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/runtime.gni @@ -0,0 +1,61 @@ +# Copyright (c) 2025 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# DO NOT MODIFY THIS FILE MANUALLY. +# USE FOLLOWING COMMAND: +# ../../tools/gen_gni.py --json arktsconfig-gn.json --output runtime.gni --gn-tool ../../../../../../../../../prebuilts/build-tools/linux-x86/bin/gn + +koalaui_runtime_files = [ + "ets/index.ts", + "ets/internals.ts", + "ets/tree/PrimeNumbers.ts", + "ets/tree/TreeUpdater.ts", + "ets/tree/ReadonlyTreeNode.ts", + "ets/tree/TreePath.ts", + "ets/tree/TreeNode.ts", + "ets/tree/IncrementalNode.ts", + "ets/states/GlobalStateManager.ts", + "ets/states/Journal.ts", + "ets/states/State.ts", + "ets/states/Disposable.ts", + "ets/states/Dependency.ts", + "ets/animation/AnimationRange.ts", + "ets/animation/TimeAnimation.ts", + "ets/animation/memo.ts", + "ets/animation/EasingSupport.ts", + "ets/animation/AnimatedState.ts", + "ets/animation/GlobalTimer.ts", + "ets/animation/Easing.ts", + "ets/memo/contextLocal.ts", + "ets/memo/remember.ts", + "ets/memo/changeListener.ts", + "ets/memo/testing.ts", + "ets/memo/bind.ts", + "ets/memo/repeat.ts", + "ets/memo/node.ts", + "ets/memo/entry.ts", +] + +koalaui_runtime_path_keys = [ + "@koalaui/common", + "@koalaui/compat", + "@koalaui/runtime/annotations", + "@ohos.arkui.stateManagement", +] + +koalaui_runtime_path_values = [ + "../common/src", + "../compat/src/arkts", + "annotations", + "stateMgmt.ts", +] diff --git a/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/src/animation/TimeAnimation.ts b/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/src/animation/TimeAnimation.ts index ad6fbbb5ebb..d3843d4de02 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/src/animation/TimeAnimation.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/src/animation/TimeAnimation.ts @@ -248,7 +248,7 @@ class TimeAnimationImpl implements TimeAnimation { private lastValue: Value private readonly compute: (time: int64) => Value - running = false + running: boolean = false constructor(compute: (time: int64) => Value, initial: int64 = 0) { this.lastState = initial @@ -296,7 +296,7 @@ class PeriodicAnimationImpl implements TimeAnimation { private readonly period: uint32 private readonly delay: int32 - running = false + running: boolean = false constructor(delay: int32, period: uint32, compute: (count: int64) => Value, initial: int64 = 0) { this.lastState = initial @@ -353,7 +353,7 @@ class ConstAnimationImpl implements TimeAnimation { this.lastValue = value } - readonly running: boolean = false + running: boolean = false getValue(time: int64): Value { return this.lastValue @@ -374,7 +374,7 @@ class FrameAnimationImpl implements TimeAnimation { private readonly compute: (time: int64) => Value private readonly time: ReadonlyArray - running = false + running: boolean = false constructor(time: ReadonlyArray, compute: (time: int64) => Value) { this.lastState = 0 @@ -440,7 +440,7 @@ class AnimationImpl implements TimeAnimation { private readonly compute: AnimationRange private isPauseRequested = false - running = false + running: boolean = false constructor( duration: uint32, diff --git a/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/src/index.ts b/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/src/index.ts index 43f19e5c7b4..888e87f7e30 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/src/index.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/src/index.ts @@ -93,7 +93,7 @@ export { contextNode, } from "./memo/node" export { - memo, + memoize, memoLifecycle, once, remember, diff --git a/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/src/memo/remember.ts b/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/src/memo/remember.ts index 97bf91867cc..827f6a6f758 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/src/memo/remember.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/src/memo/remember.ts @@ -30,7 +30,7 @@ import { ArrayState, ControlledScope, MutableState } from "../states/State" * @experimental */ /** @memo:intrinsic */ -export function memo(compute: () => Value): Value { +export function memoize(compute: () => Value): Value { const scope = __context().scope(__id()) return scope.unchanged ? scope.cached : scope.recache(compute()) } @@ -83,7 +83,7 @@ export function once(callback: () => void): void { * * @param compute - a function to compute cacheable result * @returns the last calculated value - * @see memo + * @see memoize */ /** @memo:intrinsic */ export function remember(compute: () => Value): Value { diff --git a/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/src/states/State.ts b/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/src/states/State.ts index 962d7ff1b9a..847c77691aa 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/src/states/State.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/src/states/State.ts @@ -533,7 +533,7 @@ class StateManagerImpl implements StateManager { current: ManagedScope | undefined = undefined external: Dependency | undefined = undefined updateNeeded = false - frozen = false + frozen: boolean = false private readonly callbacks = markableQueue() readonly journal = new Journal() diff --git a/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/stateMgmt.ts b/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/stateMgmt.ts new file mode 100644 index 00000000000..79ab8943823 --- /dev/null +++ b/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/stateMgmt.ts @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export { __memo_context_type, __memo_id_type} from "./ets/internals" +export interface StateDecoratedVariable {} +export { memo } from "./annotations" \ No newline at end of file diff --git a/frameworks/bridge/arkts_frontend/koala_projects/interop/BUILD.gn b/frameworks/bridge/arkts_frontend/koala_projects/interop/BUILD.gn new file mode 100644 index 00000000000..10ee17a2417 --- /dev/null +++ b/frameworks/bridge/arkts_frontend/koala_projects/interop/BUILD.gn @@ -0,0 +1,26 @@ +# Copyright (c) 2025 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/config/components/ets_frontend/ets2abc_config.gni") +import("//build/ohos.gni") +import("./interop.gni") + +generate_static_abc("interop_abc") { + base_url = "./src" + files = koalaui_interop_files + package = "@koalaui/interop" + paths_keys = koalaui_interop_path_keys + paths_values = koalaui_interop_path_values + dst_file = target_out_dir + "/interop.abc" + out_puts = [ target_out_dir + "/interop.abc" ] +} diff --git a/frameworks/bridge/arkts_frontend/koala_projects/interop/interop.gni b/frameworks/bridge/arkts_frontend/koala_projects/interop/interop.gni new file mode 100644 index 00000000000..a48609d1e96 --- /dev/null +++ b/frameworks/bridge/arkts_frontend/koala_projects/interop/interop.gni @@ -0,0 +1,43 @@ +# Copyright (c) 2025 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# DO NOT MODIFY THIS FILE MANUALLY. +# USE FOLLOWING COMMAND: +# ../tools/gen_gni.py --json arktsconfig.json --output interop.gni --gn-tool ../../../../../../../../prebuilts/build-tools/linux-x86/bin/gn + +koalaui_interop_files = [ + "src/arkts/loadLibraries.ts", + "src/arkts/NativeBuffer.ts", + "src/arkts/DeserializerBase.ts", + "src/arkts/index.ts", + "src/arkts/InteropNativeModule.ts", + "src/arkts/InteropTypes.ts", + "src/arkts/SerializerBase.ts", + "src/arkts/MaterializedBase.ts", + "src/arkts/Finalizable.ts", + "src/arkts/callback.ts", + "src/arkts/ResourceManager.ts", + "src/arkts/ResourceManager.ts", +] + +koalaui_interop_path_keys = [ + "@koalaui/compat", + "@koalaui/common", + "#common/wrappers/*", +] + +koalaui_interop_path_values = [ + "../incremental/compat/src/arkts", + "../incremental/common/src", + "src/napi/wrappers/*", +] diff --git a/frameworks/bridge/arkts_frontend/koala_projects/interop/src/arkts/Finalizable.ts b/frameworks/bridge/arkts_frontend/koala_projects/interop/src/arkts/Finalizable.ts index 6ae3ac2d8b4..ce98a298d0c 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/interop/src/arkts/Finalizable.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/interop/src/arkts/Finalizable.ts @@ -13,7 +13,8 @@ * limitations under the License. */ -import { finalizerRegister, finalizerUnregister, Thunk } from "@koalaui/common" +import { finalizerRegister, finalizerUnregister } from "@koalaui/common" +import { Thunk } from "@koalaui/compat" import { InteropNativeModule } from "./InteropNativeModule" import { pointer, nullptr } from "./InteropTypes" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/interop/src/interop/Finalizable.ts b/frameworks/bridge/arkts_frontend/koala_projects/interop/src/interop/Finalizable.ts index b130150ffe1..5067c6839ec 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/interop/src/interop/Finalizable.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/interop/src/interop/Finalizable.ts @@ -14,7 +14,8 @@ */ import { Wrapper, nullptr } from "./Wrapper" -import { finalizerRegister, finalizerUnregister, Thunk } from "@koalaui/common" +import { finalizerRegister, finalizerUnregister } from "@koalaui/common" +import { Thunk } from "@koalaui/compat" import { InteropNativeModule } from "./InteropNativeModule" import { pointer } from "./InteropTypes" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/tools/gen_gni.py b/frameworks/bridge/arkts_frontend/koala_projects/tools/gen_gni.py new file mode 100755 index 00000000000..b27e0eec841 --- /dev/null +++ b/frameworks/bridge/arkts_frontend/koala_projects/tools/gen_gni.py @@ -0,0 +1,188 @@ +#!/usr/bin/env python +# Copyright (c) 2025 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import json +import os +import glob +import argparse +from datetime import datetime +import sys +import subprocess + +def find_files(include_patterns, exclude_patterns=None, base_url=None): + """ + 根据 include 和 exclude 规则生成文件列表,路径为相对当前路径 + """ + file_list = [] + current_dir = os.getcwd() + + # 处理 include 规则 + for pattern in include_patterns: + matched_files = glob.glob(pattern, recursive=True) + for file in matched_files: + absolute_file_path = os.path.abspath(file) + relative_path = os.path.relpath(absolute_file_path, current_dir) + file_list.append(relative_path) + + # 处理 exclude 规则(如果存在) + if exclude_patterns: + filtered_file_list = [] + for file_path in file_list: + # 将 exclude 规则中的路径转换为绝对路径 + exclude_match = False + for pattern in exclude_patterns: + absolute_exclude_pattern = os.path.abspath(pattern) + relative_exclude_pattern = os.path.relpath(absolute_exclude_pattern, current_dir) + # 检查是否匹配 exclude 规则 + if glob.fnmatch.fnmatch(file_path, relative_exclude_pattern): + exclude_match = True + break + if not exclude_match: + filtered_file_list.append(file_path) + file_list = filtered_file_list + + return file_list + +def generate_files_var_name(package_name): + """ + 根据 package 字段生成变量名 + """ + var_name = package_name.replace("@", "").replace("/", "_") + return f"{var_name}_files" + +def generate_paths_arrays(package_name, paths, base_url): + """ + 解析 paths 字段,生成 keys 和 values 两个数组 + """ + var_prefix = package_name.replace("@", "").replace("/", "_") + + # 提取 keys 和 values + keys = list(paths.keys()) + values = list(paths.values()) + + # 将 values 中的路径转换为相对于当前路径的路径 + current_dir = os.getcwd() + base_url_path = os.path.abspath(base_url) + relative_values = [] + for value in values: + value_path = value[0] + absolute_value_path = os.path.abspath(os.path.join(base_url_path, value_path)) + try: + relative_path = os.path.relpath(absolute_value_path, current_dir) + relative_values.append(relative_path) + except ValueError: + continue + + keys_var_name = f"{var_prefix}_path_keys" + values_var_name = f"{var_prefix}_path_values" + + return keys_var_name, values_var_name, keys, relative_values + +def generate_gni_file(include, exclude, output_file, package_name, paths, base_url): + """ + 生成 .gni 文件,包含文件列表和 paths 的 keys 和 values 数组 + """ + # 生成文件列表变量名 + files_var_name = generate_files_var_name(package_name) + + # 根据 include 和 exclude 规则生成文件列表 + file_list = find_files(include, exclude, base_url) + + # 解析 paths 字段 + keys_var_name, values_var_name, keys, values = generate_paths_arrays(package_name, paths, base_url) + + # 获取当前年份 + current_year = datetime.now().year + + # 获取当前执行的命令 + current_command = " ".join(sys.argv) + + # 写入 .gni 文件 + with open(output_file, "w") as f: + # 写入版权头 + f.write(f"# Copyright (c) {current_year} Huawei Device Co., Ltd.\n") + f.write("# Licensed under the Apache License, Version 2.0 (the \"License\");\n") + f.write("# you may not use this file except in compliance with the License.\n") + f.write("# You may obtain a copy of the License at\n") + f.write("#\n") + f.write("# http://www.apache.org/licenses/LICENSE-2.0\n") + f.write("#\n") + f.write("# Unless required by applicable law or agreed to in writing, software\n") + f.write("# distributed under the License is distributed on an \"AS IS\" BASIS,\n") + f.write("# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n") + f.write("# See the License for the specific language governing permissions and\n") + f.write("# limitations under the License.\n\n") + + # 写入新增的两句话 + f.write("# DO NOT MODIFY THIS FILE MANUALLY.\n") + f.write(f"# USE FOLLOWING COMMAND:\n# {current_command}\n\n") + + # 写入文件列表 + f.write(f"{files_var_name} = [\n") + for file in file_list: + f.write(f' "{file}",\n') + f.write("]\n\n") + + # 写入 paths 的 keys 数组 + f.write(f"{keys_var_name} = [\n") + for key in keys: + f.write(f' "{key}",\n') + f.write("]\n\n") + + # 写入 paths 的 values 数组 + f.write(f"{values_var_name} = [\n") + for value in values: + f.write(f' "{value}",\n') + f.write("]\n") + + +def format_gni_file(gn_tool, file): + """ + 对生成的 .gni 文件,进行格式化 + """ + cmd = [gn_tool, "format", file] + print("format cmd:") + print(" ".join(cmd)) + try: + ret = subprocess.run(cmd, capture_output=True, text=True, check=True) + return 0 + except subprocess.CalledProcessError as e: + print(f"Error executing command: {e}", file=sys.stderr) + print(f"error message: {e.stderr}") + print(f"output message: {e.output}") + return 1 + + +if __name__ == "__main__": + # 解析命令行参数 + parser = argparse.ArgumentParser(description="Generate .gni file from JSON configuration.") + parser.add_argument("--json", required=True, help="Path to the input JSON file.") + parser.add_argument("--output", default="output.gni", help="Path to the output .gni file.") + parser.add_argument("--gn-tool", default="gn", help="Path to the gn tool.") + args = parser.parse_args() + + # 读取 JSON 文件 + with open(args.json, "r") as f: + json_data = json.load(f) + + # 提取所需字段 + include = json_data["include"] + exclude = json_data.get("exclude") # 使用 get 方法,避免 KeyError 异常 + package_name = json_data["compilerOptions"]["package"] + paths = json_data["compilerOptions"]["paths"] + base_url = json_data["compilerOptions"]["baseUrl"] + + # 生成 .gni 文件 + generate_gni_file(include, exclude, args.output, package_name, paths, base_url) + format_gni_file(args.gn_tool, args.output) \ No newline at end of file diff --git a/frameworks/bridge/arkts_frontend/link_abc.gni b/frameworks/bridge/arkts_frontend/link_abc.gni new file mode 100644 index 00000000000..64890734fcb --- /dev/null +++ b/frameworks/bridge/arkts_frontend/link_abc.gni @@ -0,0 +1,74 @@ +# Copyright (c) 2025 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/config/components/ets_frontend/ets2abc_config.gni") + +template("link_abc_files") { + assert(defined(invoker.targets), "Must specify 'targets'") + assert(defined(invoker.output_name), "Must specify 'output_name'") + + action(target_name) { + forward_variables_from(invoker, + [ + "deps", + "testonly", + "visibility", + ]) + + if (!defined(deps)) { + deps = [] + } + + # Add all target dependencies + foreach(target, invoker.targets) { + deps += [ target ] + } + + # Determine output directory + if (defined(invoker.output_dir)) { + output_dir = invoker.output_dir + } else { + output_dir = get_label_info(":$target_name", "target_out_dir") + } + + # Set output file + output_file = "$output_dir/${invoker.output_name}.abc" + outputs = [ output_file ] + + # Collect input .abc files + input_files = [] + foreach(target, invoker.targets) { + target_out_dir = get_label_info(target, "target_out_dir") + target_name = get_label_info(target, "name") + target_label = get_label_info(target, "label_no_toolchain") + component_name = string_replace(target_name, "_", ".") + input_files += [ "$target_out_dir/${component_name}" ] + } + + # Script that will be executed + script = "./run_binary.py" + + # Build arguments for the link command + args = [ + rebase_path("${static_linker_build_path}"), + "--output", + rebase_path(output_file, root_build_dir), + "--", + ] + + # Add all input files to the arguments + foreach(input_file, input_files) { + args += [ rebase_path(input_file, root_build_dir) ] + } + } +} diff --git a/frameworks/bridge/arkts_frontend/run_binary.py b/frameworks/bridge/arkts_frontend/run_binary.py new file mode 100755 index 00000000000..0be111294bb --- /dev/null +++ b/frameworks/bridge/arkts_frontend/run_binary.py @@ -0,0 +1,76 @@ +#!/usr/bin/env python3 + +# Copyright (c) 2025 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + + +""" +A script to run binary commands in GN build actions. +This script takes the binary name as the first argument, +followed by any arguments to pass to the binary. +If the first argument is in the format 'path-env=xxxx', +it will add xxxx to the beginning of the PATH environment variable. +""" + +import os +import sys +import subprocess +import platform + +def main(): + if len(sys.argv) < 2: + print("Error: No binary specified") + print("Usage: run_binary.py [args...]") + print(" run_binary.py path-env= [args...]") + return 1 + + # Check if the first argument is a path-env parameter + args_start_index = 1 + if sys.argv[1].startswith("path-env="): + # Extract the path from the parameter + path_to_add = sys.argv[1].split("=", 1)[1] + # Add the path to the beginning of the PATH environment variable + current_path = os.environ.get("PATH", "") + os.environ["PATH"] = path_to_add + os.pathsep + current_path + print(f"Added '{path_to_add}' to the beginning of PATH") + + args_start_index = 2 + + if len(sys.argv) < 3: + print("Error: No binary specified after path-env parameter") + print("Usage: run_binary.py path-env= [args...]") + return 1 + + # The binary name is now at args_start_index + binary = sys.argv[args_start_index] + + # All remaining arguments are passed to the binary + args = sys.argv[args_start_index + 1:] + + # Construct the full command + cmd = [binary] + args + print("start run cmd:") + print(" ".join(cmd)) + + try: + ret = subprocess.run(cmd, capture_output=True, text=True, check=True) + print(f"run cmd: {ret.stdout}") + return 0 + except subprocess.CalledProcessError as e: + print(f"Error executing command: {e}", file=sys.stderr) + print(f"error message: {e.stderr}") + print(f"output message: {e.output}") + return 1 + +if __name__ == "__main__": + sys.exit(main()) \ No newline at end of file -- Gitee From 231c0ddaf65cf875bf68f8ae0000d2c2fd35e3f4 Mon Sep 17 00:00:00 2001 From: sunfei Date: Mon, 26 May 2025 15:40:26 +0800 Subject: [PATCH 2/5] use gn to build arkoala arkui-ohos Signed-off-by: sunfei Change-Id: I753cb6faadd76f103511c8c79dcc16afe9661b5d --- frameworks/bridge/arkts_frontend/BUILD.gn | 3 +- .../arkts_frontend/arkoala/preprocess.py | 2 +- .../arkts_frontend/arkoala/process_arkoala.py | 112 +++++ .../arkts_frontend/koala_projects/.gitignore | 1 + .../koala_projects/arkoala-arkts/BUILD.gn | 44 ++ .../arkoala-arkts/annotate-config.json | 16 + .../arkoala-arkts/arktsconfig-gn.json | 86 ++++ .../arkoala-arkts/arkui-ohos/ohos.animator.ts | 18 + .../arkui-ohos/ohos.arkui.UIContext.ts | 37 +- .../arkui-ohos/ohos.arkui.componentUtils.ts | 3 + .../arkui-ohos/ohos.arkui.focusController.ts | 5 +- .../arkui-ohos/ohos.arkui.graphics.ts | 2 +- .../arkoala-arkts/arkui-ohos/ohos.font.ts | 5 +- .../arkui-ohos/ohos.graphics.common2D.ts | 3 + .../arkoala-arkts/arkui-ohos/ohos.measure.ts | 6 +- .../arkui-ohos/ohos.promptAction.ts | 8 +- .../arkoala-arkts/arkui-ohos/ohos.router.ts | 19 +- .../arkui-ohos/src/ArkCustomComponent.ts | 2 - .../arkui-ohos/src/ArkNavigation.ts | 386 ------------------ .../arkui-ohos/src/ArkTestComponent.ts | 84 ---- .../arkoala-arkts/arkui-ohos/src/Content.ts | 3 + .../arkui-ohos/src/LazyForEach.ts | 194 +++++++++ .../arkui-ohos/src/ReusablePool.ts | 3 + .../arkoala-arkts/arkui-ohos/src/UserView.ts | 4 + .../ArkUIAniUiextensionLoadLibraryHelp.ts | 3 + .../ui_extension/ArkUIAniUiextensionModal.ts | 3 + .../src/component/ArkoalaControl.ts | 3 + .../src/component/CallbackRegistry.ts | 3 + .../arkui-ohos/src/component/Declarations.ts | 3 + .../arkui-ohos/src/component/EnumsImpl.ts | 18 + .../arkui-ohos/src/component/Events.ts | 3 + .../src/component/arkts/ArkUINativeModule.ts | 3 + .../src/component/arkts/TestNativeModule.ts | 3 + .../arkui-ohos/src/component/arkui-common.ts | 3 + .../arkui-ohos/src/component/arkui-intl.ts | 3 + .../src/component/arkui-synthetics.ts | 3 + .../component/arkui-uniformtypedescriptor.ts | 3 + .../src/component/arkui-wrapper-builder.ts | 3 + .../src/component/commonTsEtsApi.ts | 3 + .../arkui-ohos/src/component/customBuilder.ts | 3 + .../src/component/customComponent.ts | 2 +- .../arkui-ohos/src/component/enums.ts | 3 + .../arkui-ohos/src/component/forEach.ts | 3 + .../arkui-ohos/src/component/index.ts | 2 +- .../src/component/lazyGridLayout.ts | 7 + .../src/component/ohos.app.ability.ts | 2 + .../src/component/peers/CallbackKind.ts | 18 + .../component/peers/CallbackTransformer.ts | 7 +- .../arkui-ohos/src/component/point.ts | 3 + .../src/component/rawfiledescriptor.ts | 3 + .../arkui-ohos/src/component/sdk-stubs.ts | 3 + .../src/component/shared/ArkResource.ts | 3 + .../arkui-ohos/src/component/span.ts | 27 ++ .../src/component/stateManagement.ts | 3 + .../arkui-ohos/src/component/stdlib.ts | 3 + .../arkui-ohos/src/component/test_utils.ts | 3 + .../src/handwritten/ForeignFunctions.ts | 4 + .../arkui-ohos/src/handwritten/RepeatImpl.ts | 1 - .../arkui-ohos/src/handwritten/Router.ts | 2 +- .../modifiers/ArkColumnModifier.ts | 67 --- .../handwritten/modifiers/ArkColumnNode.ts | 32 -- .../modifiers/ArkGridItemModifier.ts | 153 ------- .../handwritten/modifiers/ArkGridItemNode.ts | 53 --- .../handwritten/modifiers/ArkImageModifier.ts | 3 + .../modifiers/ArkSymbolGlyphModifier.ts | 251 ------------ .../modifiers/ArkSymbolGlyphNode.ts | 85 ---- .../arkoala-arkts/arkui-ohos/src/index.ts | 2 +- .../src/stateManagement/base/backingValue.ts | 3 + .../stateManagement/base/mutableStateMeta.ts | 3 + .../stateManagement/base/stateUpdateLoop.ts | 4 + .../src/stateManagement/base/types.ts | 3 + .../decorators/decoratorWatch.ts | 4 + .../src/stateManagement/index-arkts.ts | 35 ++ .../arkui-ohos/src/stateManagement/index.ts | 3 +- .../arkui-ohos/tsconfig-unmemoize.json | 7 + .../arkoala-arkts/components.gni | 335 +++++++++++++++ .../koala_projects/arkoala-arkts/package.json | 1 + 77 files changed, 1098 insertions(+), 1154 deletions(-) create mode 100755 frameworks/bridge/arkts_frontend/arkoala/process_arkoala.py create mode 100644 frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/BUILD.gn create mode 100644 frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/annotate-config.json create mode 100644 frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arktsconfig-gn.json delete mode 100644 frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/ArkNavigation.ts delete mode 100644 frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/ArkTestComponent.ts create mode 100644 frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/LazyForEach.ts delete mode 100644 frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/modifiers/ArkColumnModifier.ts delete mode 100644 frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/modifiers/ArkColumnNode.ts delete mode 100644 frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/modifiers/ArkGridItemModifier.ts delete mode 100644 frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/modifiers/ArkGridItemNode.ts delete mode 100644 frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/modifiers/ArkSymbolGlyphModifier.ts delete mode 100644 frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/modifiers/ArkSymbolGlyphNode.ts create mode 100644 frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/stateManagement/index-arkts.ts create mode 100644 frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/components.gni diff --git a/frameworks/bridge/arkts_frontend/BUILD.gn b/frameworks/bridge/arkts_frontend/BUILD.gn index dd0e9738303..932667f8c87 100644 --- a/frameworks/bridge/arkts_frontend/BUILD.gn +++ b/frameworks/bridge/arkts_frontend/BUILD.gn @@ -21,10 +21,11 @@ group("arkts_frontend_native_package") { link_abc_files("arkoala_abc") { targets = [ - "koala_projects/interop:interop_abc", + "koala_projects/arkoala-arkts:components_abc", "koala_projects/incremental/common:common_abc", "koala_projects/incremental/compat:compat_abc", "koala_projects/incremental/runtime:runtime_abc", + "koala_projects/interop:interop_abc", ] output_name = "arkoala" diff --git a/frameworks/bridge/arkts_frontend/arkoala/preprocess.py b/frameworks/bridge/arkts_frontend/arkoala/preprocess.py index 6bedcf007ec..81301fe0c57 100644 --- a/frameworks/bridge/arkts_frontend/arkoala/preprocess.py +++ b/frameworks/bridge/arkts_frontend/arkoala/preprocess.py @@ -22,7 +22,7 @@ from collections import defaultdict def get_ts_files(directory): return set( f for f in os.listdir(directory) - if os.path.isfile(os.path.join(directory, f)) and f.endswith('.ts') + if os.path.isfile(os.path.join(directory, f)) and (f.endswith('.ts') or f.endswith('.ets')) ) diff --git a/frameworks/bridge/arkts_frontend/arkoala/process_arkoala.py b/frameworks/bridge/arkts_frontend/arkoala/process_arkoala.py new file mode 100755 index 00000000000..d7e133a0f9a --- /dev/null +++ b/frameworks/bridge/arkts_frontend/arkoala/process_arkoala.py @@ -0,0 +1,112 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# Copyright (c) 2025 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Description +# +# This script is invoked by the build system and does not need to be executed directly by the developer. +# First, it checks if --release is provided as an argument. This is the only allowed type for stateMgmt +# that is included in the build image. It then verifies if the node_modules folder exists. If not, npm +# install is executed. Afterward, npm run build_release is performed, which also generates generateGni.js +# The files_to_watch.gni file contains a list of input files from tsconfig.base.json. When any of these +# files are modified, the build system triggers this script to regenerate stateMgmt.js. + +import os +import sys +import json +import time +import shutil +import subprocess +from typing import Dict, List + +from preprocess import merge_component + +class Paths: + def __init__(self): + self.project_path = None + self.node_path = None + + +def parse_argv(argv) -> Paths: + """ + parse command line arguments + """ + if len(argv) < 3: + print("Usage: python process.py ") + sys.exit(1) + + path = Paths() + path.project_path = os.path.abspath(argv[1]) + path.node_path = os.path.abspath(argv[2]) + + return path + + +def run_process(env, path: Paths): + """ + run prcoess + """ + target_path = os.path.join( + path.project_path, "arkui-preprocessed") + if os.path.exists(target_path): + shutil.rmtree(target_path) + try: + ret = subprocess.run( + ["npm", "run", "build:preprocess", "--verbose"], + capture_output=True, + env = env, + text=True, + check=True + ) + print(f"build log:\n {ret.stdout}") + except subprocess.CalledProcessError as e: + print(f"error message: {e.stderr}") + +def pre_processing(path: Paths): + start_time = time.time() + target_path = os.path.join( + path.project_path, "arkui-preprocessed") + + handwritten_path = os.path.join(target_path, "src", "handwritten", "component") + generated_path = os.path.join(target_path, "src", "component") + merge_component(handwritten_path, generated_path) + + shutil.rmtree(handwritten_path) + # rename "src" to "arkui" + shutil.move(os.path.join(target_path, "src"), os.path.join(target_path, "arkui")) + # rename "index-arkts.ets" to "index.ets" + shutil.move(os.path.join(target_path, "arkui", "stateManagement", "index-arkts.ets"), + os.path.join(target_path, "arkui", "stateManagement", "index.ets")) + end_time = time.time() + elapsed_time = end_time - start_time + print(f"Arkoala: preprocess time: {elapsed_time:.2f} seconds") + return + +def main(argv): + path = parse_argv(argv) + env = os.environ.copy() + env_old_path = env["PATH"] + env["PATH"] = f"{path.node_path}:{env['PATH']}" + os.chdir(path.project_path) + run_process(env, path) + pre_processing(path) + env["PATH"] = env_old_path + + +if __name__ == '__main__': + start_time = time.time() + main(sys.argv) + end_time = time.time() + elapsed_time = end_time - start_time + print(f"Arkoala: build time: {elapsed_time:.2f} seconds") diff --git a/frameworks/bridge/arkts_frontend/koala_projects/.gitignore b/frameworks/bridge/arkts_frontend/koala_projects/.gitignore index 9f83542604d..78c2a5d8e2f 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/.gitignore +++ b/frameworks/bridge/arkts_frontend/koala_projects/.gitignore @@ -21,3 +21,4 @@ cachegrind.out.* perf.data* **/arktsconfig-unmemoized-merged.json arkoala-arkts/arkui-ohos-preprocess/ +arkoala-arkts/arkui-preprocessed/ diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/BUILD.gn b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/BUILD.gn new file mode 100644 index 00000000000..a6544ce8e06 --- /dev/null +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/BUILD.gn @@ -0,0 +1,44 @@ +# Copyright (c) 2025 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import("//build/config/components/ets_frontend/ets2abc_config.gni") +import("//build/ohos.gni") +import("./components.gni") + +action("run_process") { + outputs = [ "$target_out_dir/ets" ] + node_version = "v16.20.2" + host_arch = "${host_os}-${host_cpu}" + + script = "../../arkoala/process_arkoala.py" + + node_path = rebase_path( + "//prebuilts/build-tools/common/nodejs/node-${node_version}-${host_arch}/bin") + + args = [ + rebase_path("."), + node_path, + ] +} + +generate_static_abc("components_abc") { + base_url = "./arkui-preprocessed" + files = arkui_files + paths_keys = arkui_path_keys + paths_values = arkui_path_values + ui_enable = "True" + dependencies = [ ":run_process" ] + dst_file = target_out_dir + "/components.abc" + out_puts = [ target_out_dir + "/components.abc" ] +} + diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/annotate-config.json b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/annotate-config.json new file mode 100644 index 00000000000..57f4c998bfc --- /dev/null +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/annotate-config.json @@ -0,0 +1,16 @@ +{ + "inputDir": "./arkui-ohos", + "outputDir": "./arkui-preprocessed", + "include": [ + "./arkui-ohos/**/*.ts", "./arkui-ohos/*.ts" + ], + "exclude": [ + "./arkui-ohos/src/ani/ts/*.ts", + "./arkui-ohos/src/peers/*.ts", + "./arkui-ohos/src/component/ts/*.ts", + "./arkui-ohos/src/external/ts/**/*.ts", + "./arkui-ohos/src/stateManagement/index.ts", + "./arkui-ohos/build/**/*.ts" + ], + "fileExtension": ".ets" +} \ No newline at end of file diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arktsconfig-gn.json b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arktsconfig-gn.json new file mode 100644 index 00000000000..d6dc57db623 --- /dev/null +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arktsconfig-gn.json @@ -0,0 +1,86 @@ +{ + "compilerOptions": { + "package": "arkui", + "outDir": "build", + "baseUrl": "./arkui-preprocessed", + "paths": { + "#components": [ + "./arkui/component/arkts" + ], + "#external": [ + "./arkui/external/arkts" + ], + "arkui.ani": [ + "./arkui/ani/arkts" + ], + "arkui": [ + "./arkui/" + ], + "arkui/*": [ + "./arkui/*" + ], + "@koalaui/interop": [ + "../../interop/src/arkts" + ], + "@koalaui/common": [ + "../../incremental/common/src" + ], + "@koalaui/compat": [ + "../../incremental/compat/src/arkts" + ], + "@koalaui/runtime": [ + "../../incremental/runtime/ets" + ], + "@ohos.arkui.stateManagement": [ + "./arkui/stateManagement/index.ets" + ], + "@koalaui/runtime/annotations": [ + "../../incremental/runtime/annotations" + ], + "@ohos/animator": [ + "ohos.animator.ets" + ], + "@ohos/arkui/UIContext": [ + "ohos.arkui.UIContext.ets" + ], + "@ohos.arkui.UIContext": [ + "ohos.arkui.UIContext.ets" + ], + "@ohos.arkui.node": [ + "./arkui/ohos.arkui.node.ets" + ], + "@ohos/measure": [ + "ohos.measure.ets" + ], + "@ohos/font": [ + "ohos.font.ets" + ], + "global/resource": [ + "global/resource/resource.ets" + ], + "@ohos/router": [ + "ohos.router.ets" + ], + "@ohos/observer": [ + "ohos.observer.ets" + ], + "@ohos/graphics/common2D": [ + "ohos.graphics.common2D.ets" + ], + "@ohos/arkui/componentUtils": [ + "ohos.arkui.componentUtils.ets" + ], + "@ohos/arkui/focusController": [ + "ohos.arkui.focusController.ets" + ] + } + }, + "include": [ + "./arkui-preprocessed/arkui/**/*.ets", + "./arkui-preprocessed/ohos.*.ets" + ], + "exclude": [ + "./arkui-preprocessed/arkui/component/main.ets", + "./arkui-preprocessed/arkui/index-test.d.ets" + ] +} \ No newline at end of file diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.animator.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.animator.ts index 6543b86ea8f..18cdc78a6af 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.animator.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.animator.ts @@ -1,3 +1,21 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// avoid memo-plugin import issue +import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; + export interface AnimatorOptions { duration: number; easing: string; diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.arkui.UIContext.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.arkui.UIContext.ts index 1714ac94e27..cfd1c75cedc 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.arkui.UIContext.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.arkui.UIContext.ts @@ -16,38 +16,37 @@ // WARNING! THIS FILE IS AUTO-GENERATED, DO NOT MAKE CHANGES, THEY WILL BE LOST ON NEXT GENERATION! -import { FrameNode, FrameNodeInternal, FrameNodeUtils } from "./src/FrameNode" -import { GlobalScope_ohos_font } from "./src/component/arkui-external" -import { GlobalScope_ohos_measure_utils } from "./src/component/arkui-external" -import { GlobalScopeUicontextFontScale, GlobalScopeUicontextTextMenu } from "./src/component/arkui-uicontext-text-utils" -import { UIContextDispatchKeyEvent, UIContextAtomicServiceBar } from "./src/component/arkui-custom" +import { FrameNode, FrameNodeInternal, FrameNodeUtils } from "arkui/FrameNode" +import { GlobalScope_ohos_font } from "arkui/component/arkui-external" +import { GlobalScope_ohos_measure_utils } from "arkui/component/arkui-external" +import { UIContextDispatchKeyEvent, UIContextAtomicServiceBar } from "arkui/component/arkui-custom" import { FontOptions, FontInfo } from "@ohos/font" import { MeasureOptions } from "@ohos/measure" -import { SizeOptions } from "./src/component/units" +import { SizeOptions } from "arkui/component/units" import { ArkUIGeneratedNativeModule } from "#components" import { int32 } from "@koalaui/common" import { nullptr } from "@koalaui/interop" -import { _animateTo } from "./src/handwritten/ArkAnimation" -import { AnimateParam } from './src/component' +import { _animateTo } from "arkui/handwritten/ArkAnimation" +import { AnimateParam } from 'arkui/component' import { AnimatorResult, AnimatorOptions, Animator} from "@ohos/animator" import { Context, PointerStyle } from "#external" import { ArkUIAniModule } from "arkui.ani" -import { Serializer } from "./src/component/peers/Serializer" +import { Serializer } from "arkui/component/peers/Serializer" import { componentUtils } from "@ohos/arkui/componentUtils" import { focusController } from "@ohos/arkui/focusController" -import { Frame } from "./src/Graphics" -import { KeyEvent } from "./src/component/common" -import { TextMenuOptions } from "./src/component/textCommon" -import { Nullable } from "./src/component/enums" -import { KeyProcessingMode } from "./src/component/focus" +import { Frame } from "arkui/Graphics" +import { KeyEvent } from "arkui/component/common" +import { Nullable } from "arkui/component/enums" +import { TextMenuOptions } from "arkui/component/textCommon" +import { KeyProcessingMode } from "arkui/component/focus" import { uiObserver } from "@ohos/arkui/observer" import { AlertDialog, AlertDialogParamWithConfirm, AlertDialogParamWithButtons, - AlertDialogParamWithOptions }from "./src/component/alertDialog" + AlertDialogParamWithOptions }from "arkui/component/alertDialog" import inspector from "@ohos/arkui/inspector" -import router from './ohos.router' -import promptAction from './ohos.promptAction'; -import { ContextMenu } from './src/component/contextMenu'; -import { GlobalScope } from "./src/component/GlobalScope" +import router from '@ohos/router' +import promptAction from '@ohos/promptAction' +import { ContextMenu } from 'arkui/component/contextMenu' +import { GlobalScope } from "arkui/component/GlobalScope" export class UIInspector { instanceId_: int32 = -1; diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.arkui.componentUtils.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.arkui.componentUtils.ts index 4810c1a75f6..b474a4dd159 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.arkui.componentUtils.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.arkui.componentUtils.ts @@ -13,6 +13,9 @@ * limitations under the License. */ +// avoid memo-plugin import issue +import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; + export declare namespace componentUtils { export interface Size { width: number diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.arkui.focusController.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.arkui.focusController.ts index 96ad4029f95..e1aa675290e 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.arkui.focusController.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.arkui.focusController.ts @@ -13,7 +13,10 @@ * limitations under the License. */ -import { KeyProcessingMode } from "./src/component/focus" +// avoid memo-plugin import issue +import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; + +import { KeyProcessingMode } from "arkui/component/focus" export declare namespace focusController { export function clearFocus(): void; export function requestFocus(key: string): void; diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.arkui.graphics.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.arkui.graphics.ts index bd3ea76904c..98ebf676783 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.arkui.graphics.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.arkui.graphics.ts @@ -13,7 +13,7 @@ * limitations under the License. */ -import { DrawContext } from "./src/Graphics"; +import { DrawContext } from "arkui/Graphics"; import { pointer } from "@koalaui/interop"; export declare class Utils { diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.font.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.font.ts index 1a60c91fdb3..e9c5d464998 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.font.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.font.ts @@ -13,8 +13,11 @@ * limitations under the License. */ +// avoid memo-plugin import issue +import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; + import { Resource } from "global/resource" -import { GlobalScope_ohos_font } from "./src/component/arkui-external" +import { GlobalScope_ohos_font } from "arkui/component/arkui-external" export namespace font { diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.graphics.common2D.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.graphics.common2D.ts index 95062d65689..344fb7d3eb0 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.graphics.common2D.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.graphics.common2D.ts @@ -13,6 +13,9 @@ * limitations under the License. */ +// avoid memo-plugin import issue +import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; + export declare namespace common2D { export interface Rect { left: number; diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.measure.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.measure.ts index f6c93cf6f96..f9bf3bf2276 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.measure.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.measure.ts @@ -13,10 +13,10 @@ * limitations under the License. */ -import { SizeOptions } from "./src/component/units" -import { GlobalScope_ohos_measure_utils } from "./src/component/arkui-external" +import { SizeOptions } from "arkui/component/units" +import { GlobalScope_ohos_measure_utils } from "arkui/component/arkui-external" import { Resource } from "global/resource" -import { FontStyle, FontWeight, TextAlign, TextOverflow, TextCase, WordBreak } from "./src/component/enums" +import { FontStyle, FontWeight, TextAlign, TextOverflow, TextCase, WordBreak } from "arkui/component/enums" export interface MeasureOptions { textContent: string | Resource; diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.promptAction.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.promptAction.ts index ec730531882..8817abcc425 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.promptAction.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.promptAction.ts @@ -14,10 +14,10 @@ */ import { Resource } from "global/resource" -import { Alignment } from "./src/component/enums" -import { ResourceColor, Offset } from "./src/component/units" -import { BlurStyle, ShadowOptions, ShadowStyle, HoverModeAreaType } from "./src/component/common" -import { Serializer } from "./src/component/peers/Serializer" +import { Alignment } from "arkui/component/enums" +import { ResourceColor, Offset } from "arkui/component/units" +import { BlurStyle, ShadowOptions, ShadowStyle, HoverModeAreaType } from "arkui/component/common" +import { Serializer } from "arkui/component/peers/Serializer" import { ArkUIGeneratedNativeModule } from "#components" namespace promptAction { diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.router.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.router.ts index d78963a0078..191c77db7f7 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.router.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.router.ts @@ -1,6 +1,21 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import { InteropNativeModule } from "@koalaui/interop/InteropNativeModule" -import { Router } from "./src/handwritten" -import { PeerNode } from "./src/PeerNode" +import { Router } from "arkui/handwritten" +import { PeerNode } from "arkui/PeerNode" namespace router { export interface RouterOptions { diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/ArkCustomComponent.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/ArkCustomComponent.ts index ac104ae8273..861423d084b 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/ArkCustomComponent.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/ArkCustomComponent.ts @@ -56,7 +56,6 @@ export interface ArkCustomComponent { onFormRecycle/* ? */(): string onFormRecover/* ? */(statusData: string): void; onBackPress/* ? */(): boolean; - /** @memo */ pageTransition/* ? */(): void; getUIContext(): UIContext; getUniqueId(): number; @@ -101,7 +100,6 @@ export class ArkCustomComponentImpl implements ArkCustomComponent { onBackPress(): boolean { throw new Error("Unexpected use of base class method") } - /** @memo */ pageTransition(): void { } getUIContext(): UIContext { diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/ArkNavigation.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/ArkNavigation.ts deleted file mode 100644 index 9a94d41c832..00000000000 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/ArkNavigation.ts +++ /dev/null @@ -1,386 +0,0 @@ -// /* -// * Copyright (c) 2024 Huawei Device Co., Ltd. -// * Licensed under the Apache License, Version 2.0 (the "License"); -// * you may not use this file except in compliance with the License. -// * You may obtain a copy of the License at -// * -// * http://www.apache.org/licenses/LICENSE-2.0 -// * -// * Unless required by applicable law or agreed to in writing, software -// * distributed under the License is distributed on an "AS IS" BASIS, -// * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// * See the License for the specific language governing permissions and -// * limitations under the License. -// */ - -// import { contextLocalScope, MutableState, NodeAttach, remember, rememberMutableState } from "@koalaui/runtime" -// import { runtimeType, RuntimeType } from "@koalaui/interop" -// import { ArkCommonMethodComponent } from "./component/ArkCommon" -// import { ArkNavigationPeer } from "./peers/ArkNavigationPeer" -// import { SystemBarStyle, NavigationCommonTitle, NavigationCustomTitle, NavigationMenuItem, NavigationOperation, NavigationMode, ToolbarItem, NavigationTitleOptions, NavigationToolbarOptions, NavigationTitleMode, NavContentInfo, NavigationAnimatedTransition, NavBarPosition } from "./component/navigation" -// import { Resource } from "global/resource"; -// import { CustomBuilder, SymbolGlyphModifier, LayoutSafeAreaType, LayoutSafeAreaEdge } from "./component/common" -// import { Length, ResourceStr, Dimension } from "./component/units" -// import { NavPathStack } from "./component/navigation" -// import { PixelMap } from "./component/ArkPixelMapMaterialized" -// import { PathData } from "./handwritten/ArkNavPathStack" -// import { NavExtender } from "./component/ArkNavExtenderMaterialized" - -// /** @memo:stable */ -// export class ArkNavigationComponent extends ArkCommonMethodComponent { -// getPeer(): ArkNavigationPeer { -// return (this.peer as ArkNavigationPeer) -// } -// private _navPathStack: MutableState | undefined = undefined -// /** @memo */ -// setNavigationOptions(pathInfos?: NavPathStack): this { -// console.log("Call ArkNavigationComponent.setNavigationOptions()") -// if (this.checkPriority("setNavigationOptions")) { -// const pathInfos_type = runtimeType(pathInfos) -// if ((((RuntimeType.OBJECT == pathInfos_type)))) { -// const pathInfos_casted = pathInfos as (NavPathStack) -// this._navPathStack = rememberMutableState(pathInfos_casted) -// return this -// } -// if ((((RuntimeType.UNDEFINED == pathInfos_type)))) { -// this.getPeer()?.setNavigationOptions0Attribute() -// return this -// } -// throw new Error("Can not select appropriate overload") -// } -// return this -// } -// /** @memo */ -// navBarWidth(value: Length): this { -// console.log("Call ArkNavigationComponent.navBarWidth()") -// if (this.checkPriority("navBarWidth")) { -// const value_casted = value as (Length) -// this.getPeer()?.navBarWidthAttribute(value_casted) -// return this -// } -// return this -// } -// /** @memo */ -// navBarPosition(value: NavBarPosition): this { -// console.log("Call ArkNavigationComponent.navBarPosition()") -// if (this.checkPriority("navBarPosition")) { -// const value_casted = value as (NavBarPosition) -// this.getPeer()?.navBarPositionAttribute(value_casted) -// return this -// } -// return this -// } -// /** @memo */ -// navBarWidthRange(value: [ Dimension, Dimension ]): this { -// console.log("Call ArkNavigationComponent.navBarWidthRange()") -// if (this.checkPriority("navBarWidthRange")) { -// const value_casted = value as ([ Dimension, Dimension ]) -// this.getPeer()?.navBarWidthRangeAttribute(value_casted) -// return this -// } -// return this -// } -// /** @memo */ -// minContentWidth(value: Dimension): this { -// console.log("Call ArkNavigationComponent.minContentWidth()") -// if (this.checkPriority("minContentWidth")) { -// const value_casted = value as (Dimension) -// this.getPeer()?.minContentWidthAttribute(value_casted) -// return this -// } -// return this -// } -// /** @memo */ -// mode(value: NavigationMode): this { -// console.log("Call ArkNavigationComponent.mode()") -// if (this.checkPriority("mode")) { -// const value_casted = value as (NavigationMode) -// this.getPeer()?.modeAttribute(value_casted) -// return this -// } -// return this -// } -// /** @memo */ -// backButtonIcon(value: string | PixelMap | Resource | SymbolGlyphModifier): this { -// console.log("Call ArkNavigationComponent.backButtonIcon()") -// if (this.checkPriority("backButtonIcon")) { -// const value_casted = value as (string | PixelMap | Resource | SymbolGlyphModifier) -// this.getPeer()?.backButtonIconAttribute(value_casted) -// return this -// } -// return this -// } -// /** @memo */ -// hideNavBar(value: boolean): this { -// console.log("Call ArkNavigationComponent.hideNavBar()") -// if (this.checkPriority("hideNavBar")) { -// const value_casted = value as (boolean) -// this.getPeer()?.hideNavBarAttribute(value_casted) -// return this -// } -// return this -// } -// /** @memo */ -// subTitle(value: string): this { -// console.log("Call ArkNavigationComponent.subTitle()") -// if (this.checkPriority("subTitle")) { -// const value_casted = value as (string) -// this.getPeer()?.subTitleAttribute(value_casted) -// return this -// } -// return this -// } -// /** @memo */ -// hideTitleBar(hide: boolean, animated?: boolean): this { -// console.log("Call ArkNavigationComponent.hideTitleBar()") -// if (this.checkPriority("hideTitleBar")) { -// const hide_type = runtimeType(hide) -// const animated_type = runtimeType(animated) -// if ((((RuntimeType.BOOLEAN == hide_type))) && (((RuntimeType.BOOLEAN == animated_type)))) { -// const hide_casted = hide as (boolean) -// const animated_casted = animated as (boolean) -// this.getPeer()?.hideTitleBar1Attribute(hide_casted, animated_casted) -// return this -// } -// if ((((RuntimeType.BOOLEAN == hide_type))) && (((RuntimeType.UNDEFINED == animated_type)))) { -// const hide_casted = hide as (boolean) -// this.getPeer()?.hideTitleBar0Attribute(hide_casted) -// return this -// } -// throw new Error("Can not select appropriate overload") -// } -// return this -// } -// /** @memo */ -// hideBackButton(value: boolean): this { -// console.log("Call ArkNavigationComponent.hideBackButton()") -// if (this.checkPriority("hideBackButton")) { -// const value_casted = value as (boolean) -// this.getPeer()?.hideBackButtonAttribute(value_casted) -// return this -// } -// return this -// } -// /** @memo */ -// titleMode(value: NavigationTitleMode): this { -// console.log("Call ArkNavigationComponent.titleMode()") -// if (this.checkPriority("titleMode")) { -// const value_casted = value as (NavigationTitleMode) -// this.getPeer()?.titleModeAttribute(value_casted) -// return this -// } -// return this -// } -// /** @memo */ -// menus(value: Array | CustomBuilder): this { -// console.log("Call ArkNavigationComponent.menus()") -// if (this.checkPriority("menus")) { -// const value_casted = value as (Array | CustomBuilder) -// this.getPeer()?.menusAttribute(value_casted) -// return this -// } -// return this -// } -// /** @memo */ -// toolBar(value: Object | CustomBuilder): this { -// console.log("Call ArkNavigationComponent.toolBar()") -// if (this.checkPriority("toolBar")) { -// const value_casted = value as (Object | CustomBuilder) -// this.getPeer()?.toolBarAttribute(value_casted) -// return this -// } -// return this -// } -// /** @memo */ -// hideToolBar(hide: boolean, animated?: boolean): this { -// console.log("Call ArkNavigationComponent.hideToolBar()") -// if (this.checkPriority("hideToolBar")) { -// const hide_type = runtimeType(hide) -// const animated_type = runtimeType(animated) -// if ((((RuntimeType.BOOLEAN == hide_type))) && (((RuntimeType.BOOLEAN == animated_type)))) { -// const hide_casted = hide as (boolean) -// const animated_casted = animated as (boolean) -// this.getPeer()?.hideToolBar1Attribute(hide_casted, animated_casted) -// return this -// } -// if ((((RuntimeType.BOOLEAN == hide_type))) && (((RuntimeType.UNDEFINED == animated_type)))) { -// const hide_casted = hide as (boolean) -// this.getPeer()?.hideToolBar0Attribute(hide_casted) -// return this -// } -// throw new Error("Can not select appropriate overload") -// } -// return this -// } -// /** @memo */ -// onTitleModeChange(value: Function1): this { -// console.log("Call ArkNavigationComponent.onTitleModeChange()") -// if (this.checkPriority("onTitleModeChange")) { -// const value_casted = value as (Function1) -// this.getPeer()?.onTitleModeChangeAttribute(value_casted) -// return this -// } -// return this -// } -// /** @memo */ -// onNavBarStateChange(value: Function1): this { -// console.log("Call ArkNavigationComponent.onNavBarStateChange()") -// if (this.checkPriority("onNavBarStateChange")) { -// const value_casted = value as (Function1) -// this.getPeer()?.onNavBarStateChangeAttribute(value_casted) -// return this -// } -// return this -// } -// /** @memo */ -// onNavigationModeChange(value: Function1): this { -// console.log("Call ArkNavigationComponent.onNavigationModeChange()") -// if (this.checkPriority("onNavigationModeChange")) { -// const value_casted = value as (Function1) -// this.getPeer()?.onNavigationModeChangeAttribute(value_casted) -// return this -// } -// return this -// } - -// /** @memo */ -// _navDestination: -// (arg0: string, arg1: object) => void = -// /** @memo */ -// (arg0: string, arg1: object) => { console.log("_navDestination is undefined.") } - -// /** @memo */ -// navDestination( -// /** @memo */ -// value: ((arg0: string, arg1: object) => void) | undefined -// ): this { -// if (value != undefined) { -// this._navDestination = value! -// } -// return this -// } - -// /** @memo */ -// customNavContentTransition(value: Function3): this { -// console.log("Call ArkNavigationComponent.customNavContentTransition()") -// if (this.checkPriority("customNavContentTransition")) { -// const value_casted = value as (Function3) -// this.getPeer()?.customNavContentTransitionAttribute(value_casted) -// return this -// } -// return this -// } -// /** @memo */ -// systemBarStyle(value?: SystemBarStyle): this { -// console.log("Call ArkNavigationComponent.systemBarStyle()") -// if (this.checkPriority("systemBarStyle")) { -// const value_casted = value as (SystemBarStyle | undefined) -// this.getPeer()?.systemBarStyleAttribute(value_casted) -// return this -// } -// return this -// } -// /** @memo */ -// recoverable(value?: boolean): this { -// console.log("Call ArkNavigationComponent.recoverable()") -// if (this.checkPriority("recoverable")) { -// const value_casted = value as (boolean | undefined) -// this.getPeer()?.recoverableAttribute(value_casted) -// return this -// } -// return this -// } -// /** @memo */ -// enableDragBar(value?: boolean): this { -// console.log("Call ArkNavigationComponent.enableDragBar()") -// if (this.checkPriority("enableDragBar")) { -// const value_casted = value as (boolean | undefined) -// this.getPeer()?.enableDragBarAttribute(value_casted) -// return this -// } -// return this -// } -// /** @memo */ -// title(value: ResourceStr | CustomBuilder | NavigationCommonTitle | NavigationCustomTitle, options?: NavigationTitleOptions): this { -// console.log("Call ArkNavigationComponent.title()") -// if (this.checkPriority("title")) { -// const value_casted = value as (ResourceStr | CustomBuilder | NavigationCommonTitle | NavigationCustomTitle) -// const options_casted = options as (NavigationTitleOptions | undefined) -// this.getPeer()?.titleAttribute(value_casted, options_casted) -// return this -// } -// return this -// } -// /** @memo */ -// toolbarConfiguration(value: Array | CustomBuilder, options?: NavigationToolbarOptions): this { -// console.log("Call ArkNavigationComponent.toolbarConfiguration()") -// if (this.checkPriority("toolbarConfiguration")) { -// const value_casted = value as (Array | CustomBuilder) -// const options_casted = options as (NavigationToolbarOptions | undefined) -// this.getPeer()?.toolbarConfigurationAttribute(value_casted, options_casted) -// return this -// } -// return this -// } -// /** @memo */ -// ignoreLayoutSafeArea(types?: Array, edges?: Array): this { -// console.log("Call ArkNavigationComponent.ignoreLayoutSafeArea()") -// if (this.checkPriority("ignoreLayoutSafeArea")) { -// const types_casted = types as (Array | undefined) -// const edges_casted = edges as (Array | undefined) -// this.getPeer()?.ignoreLayoutSafeAreaAttribute(types_casted, edges_casted) -// return this -// } -// return this -// } -// public applyAttributesFinish(): void { -// // we calls this function outside of class, so need to make it public -// super.applyAttributesFinish() -// } -// } - -// /** @memo */ -// export function ArkNavigation( -// /** @memo */ -// style: ((attributes: ArkNavigationComponent) => void) | undefined, -// /** @memo */ -// content_: (() => void) | undefined, -// pathInfos?: NavPathStack | undefined -// ) { -// const receiver = remember(() => { -// return new ArkNavigationComponent() -// }) -// //NodeAttach((): ArkNavigationPeer => ArkNavigationPeer.create(ArkUINodeType.CustomNode, receiver), (_: ArkNavigationPeer) => { -// NodeAttach((): ArkNavigationPeer => ArkNavigationPeer.create(receiver), (_: ArkNavigationPeer) => { -// receiver.setNavigationOptions(pathInfos) -// style?.(receiver) -// content_?.() -// if (pathInfos != undefined) { -// const data = rememberMutableState(PathData.EMPTY) -// remember(() => { -// const updater: () => void = -// () => { - -// } -// const value_casted = updater as ((() => void)) -// NavExtender.setUpdateStackCallback(pathInfos!, value_casted) -// }) -// withNavData(data.value, () => { -// receiver._navDestination( -// data.value.name, -// data.value.param -// ) -// }) -// } -// receiver.applyAttributesFinish() -// }) -// } - -// /** @memo */ -// function withNavData( -// pathInfo: PathData, -// /** @memo */ -// content_: () => void, -// ) { -// contextLocalScope("NavPathStack", pathInfo, content_) -// } diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/ArkTestComponent.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/ArkTestComponent.ts deleted file mode 100644 index c7c41881fad..00000000000 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/ArkTestComponent.ts +++ /dev/null @@ -1,84 +0,0 @@ -// /* -// * Copyright (c) 2024-2025 Huawei Device Co., Ltd. -// * Licensed under the Apache License, Version 2.0 (the "License"); -// * you may not use this file except in compliance with the License. -// * You may obtain a copy of the License at -// * -// * http://www.apache.org/licenses/LICENSE-2.0 -// * -// * Unless required by applicable law or agreed to in writing, software -// * distributed under the License is distributed on an "AS IS" BASIS, -// * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// * See the License for the specific language governing permissions and -// * limitations under the License. -// */ - -// import { NodeAttach, remember } from "@koalaui/runtime" -// import { ArkCommonMethodComponent } from "./component/ArkCommon" -// import { ArkTestComponentPeer } from "./peers/ArkTestComponentPeer" -// import { CommonMethod } from "./component/common" -// import { InteropNativeModule } from "@koalaui/interop" - -// /** @memo:stable */ -// export class ArkTestComponentComponent extends ArkCommonMethodComponent { -// getPeer(): ArkTestComponentPeer { -// return (this.peer as ArkTestComponentPeer) -// } -// /** @memo */ -// setTestComponentOptions(options?: TestComponentOptions): this { -// if (this.checkPriority("setColumnOptions")) { -// const options_casted = options as (TestComponentOptions | undefined) -// this.getPeer()?.setTestComponentOptionsAttribute(options_casted) -// return this -// } -// return this -// } -// /** @memo */ -// onChange(value: Function0): this { -// if (this.checkPriority("onChange")) { -// this.getPeer()?.onChangeAttribute(value) -// return this -// } -// return this -// } -// /** @memo */ -// log(message: string): this { -// if (this.checkPriority("log")) { -// this.getPeer()?.logAttribute(message) -// return this -// } -// return this -// } -// public applyAttributesFinish(): void { -// // we calls this function outside of class, so need to make it public -// super.applyAttributesFinish() -// } -// } - -// /** @memo */ -// export function ArkTestComponent( -// /** @memo */ -// style: ((attributes: ArkTestComponentComponent) => void) | undefined, -// /** @memo */ -// content_: (() => void) | undefined, -// options?: TestComponentOptions | undefined -// ) { -// const receiver = remember(() => { -// return new ArkTestComponentComponent() -// }) -// NodeAttach((): ArkTestComponentPeer => ArkTestComponentPeer.create(receiver), (_: ArkTestComponentPeer) => { -// receiver.setTestComponentOptions(options) -// style?.(receiver) -// content_?.() -// receiver.applyAttributesFinish() -// }) -// } - -// export interface TestComponentOptions { -// id?: number; -// } -// export type TestComponentInterface = (options?: TestComponentOptions) => TestComponentAttribute; -// export interface TestComponentAttribute extends CommonMethod { -// onChange?: Function0; -// log?: string -// } diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/Content.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/Content.ts index 188b7383e21..f778b09e249 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/Content.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/Content.ts @@ -16,6 +16,9 @@ // WARNING! THIS FILE IS AUTO-GENERATED, DO NOT MAKE CHANGES, THEY WILL BE LOST ON NEXT GENERATION! +// avoid memo-plugin import issue +import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; + import { int32, int64, float32 } from "@koalaui/common" import { KInt, KPointer, KBoolean, NativeBuffer, KStringPtr, wrapCallback } from "@koalaui/interop" export interface Content { diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/LazyForEach.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/LazyForEach.ts new file mode 100644 index 00000000000..1b7a9e23b75 --- /dev/null +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/LazyForEach.ts @@ -0,0 +1,194 @@ +/* + * Copyright (c) 2022-2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import { __context, __id, contextNode, DataNode, IncrementalNode, memoEntry2, remember, rememberMutableState, scheduleCallback } from "@koalaui/runtime" +import { hashCodeFromString, int32, KoalaCallsiteKey } from "@koalaui/common" +import { nullptr, pointer } from "@koalaui/interop"; +import { LazyForEachType, PeerNode, PeerNodeType } from "./PeerNode"; +import { LazyForEachOps } from "./component/arkui-custom" +import { InternalListener } from "./DataChangeListener"; +import { IDataSource } from "./component/lazyForEach"; +import { setNeedCreate } from "./ArkComponentRoot"; + +class LazyForEachManager { + static isDummy: boolean = false + // Special pointer to mark that more elements needed. + static specialPointer: pointer = 1 + static OnRangeUpdate(parent: pointer, totalCount: int32, updater: (currentIndex: int32, currentMark: pointer, end: int32) => void) { + if (LazyForEachManager.isDummy) + scheduleCallback(() => updater(0, LazyForEachManager.specialPointer, 100)) + else + LazyForEachOps.OnRangeUpdate(parent, totalCount, updater) + } + + static NeedMoreElements(parent: pointer, mark: pointer, direction: int32): pointer { + if (LazyForEachManager.isDummy) + return LazyForEachManager.specialPointer + else + return LazyForEachOps.NeedMoreElements(parent, mark, direction) + } + + static SetCurrentIndex(node: pointer, index: int32): void { + if (!LazyForEachManager.isDummy) + LazyForEachOps.SetCurrentIndex(node, index) + } + + static SetInsertMark(parent: PeerNode, mark: pointer, moreUp: boolean): void { + if (!LazyForEachManager.isDummy) + parent.setInsertMark(mark, moreUp) + } + + /** + * @param parent + * @param itemCount + * @param offset of LazyForEach in parent's children + */ + static Prepare(parent: PeerNode, itemCount: int32, offset: int32): void { + if (!LazyForEachManager.isDummy) + LazyForEachOps.Prepare(parent.peer.ptr, itemCount, offset) + } +} + +class VisibleRange { + parent: pointer = nullptr + markUp: pointer = nullptr + markDown: pointer = nullptr + indexUp: int32 + indexDown: int32 + + constructor(parent: PeerNode, indexUp: int32, indexDown: int32) { + this.parent = parent.peer.ptr + this.indexUp = indexUp + this.indexDown = indexDown + } + needFillUp(): boolean { + let more = LazyForEachManager.NeedMoreElements(this.parent, this.markUp, 0) + if (more == nullptr) return false + this.markUp = more + return true + } + + needFillDown(): boolean { + let more = LazyForEachManager.NeedMoreElements(this.parent, this.markDown, 1) + if (more == nullptr) return false + this.markDown = more + return true + } + + get activeCount(): int32 { + return this.indexDown >= 0 ? this.indexDown - this.indexUp + 1 : 0 + } +} + +class LazyForEachIdentifier { + constructor(id: KoalaCallsiteKey, totalCnt: int32, activeCnt: int32) { + this.id = id + this.totalCnt = totalCnt + this.activeCnt = activeCnt + } + readonly id: KoalaCallsiteKey + readonly totalCnt: int32 + readonly activeCnt: int32 +} + +/** + * @param id unique identifier of LazyForEach + * @returns item offset of LazyForEach in parent's children + */ +/** @memo */ +function getOffset(parent: PeerNode, id: KoalaCallsiteKey): int32 { + let offset = 0 + for (let child = parent.firstChild; child; child = child!.nextSibling) { + // corresponding DataNode is attached after the component items + let info = DataNode.extract(LazyForEachType, child!!) + if (info?.id === id) { + offset -= info!.activeCnt + // console.log(`offset = ${offset}`) + return offset + } else if (info) { + offset += info!.totalCnt - info!.activeCnt // active nodes are already counted + } else if (child!.isKind(PeerNodeType)) { + ++offset + } + } + return offset // DataNode not found, maybe throw error? +} + +/** @memo */ +export function LazyForEachImpl(dataSource: IDataSource, + /** @memo */ + itemGenerator: (item: T, index: number) => void, + keyGenerator?: (item: T, index: number) => string, +) { + let current = rememberMutableState(-1) + let mark = rememberMutableState(nullptr) + let version = rememberMutableState(0) + // console.log(`LazyForEach current=${current.value} version=${version.value} mark=${mark.value}`) + + let parent = contextNode() + const offset = getOffset(parent, __id()) + + let listener = remember(() => new InternalListener(parent.peer.ptr, version)) + const changeIndex = listener.flush(offset) // first item index that's affected by DataChange + + const currentLocal = current.value >= 0 ? Math.max(current.value - offset, 0) as int32 : -1; // translated to local index + const visibleRange = new VisibleRange(parent, currentLocal, currentLocal) + remember(() => { + dataSource.registerDataChangeListener(listener) + LazyForEachManager.OnRangeUpdate(visibleRange.parent, dataSource.totalCount() as int32, (currentIndex: int32, currentMark: pointer, end: int32) => { + // console.log(`LazyForEach[${parent}]: current updated to ${currentIndex} ${currentMark} end=${end}`) + current.value = currentIndex + mark.value = currentMark + version.value++ + }) + }) + // Subscribe to version changes. + version.value + + let generator = (element: T, index: number): int32 => keyGenerator ? hashCodeFromString(keyGenerator!(element, index)) : index as int32 + let index: number = visibleRange.indexUp as number + + LazyForEachManager.Prepare(parent, dataSource.totalCount() as int32, offset) + LazyForEachManager.SetInsertMark(parent, mark.value, false) + const prevVal = setNeedCreate(true) // force synchronous create of inner CustomComponents in order to layout them correctly + while (true) { + // console.log(`LazyForEach[${parent}]: index=${index}`) + if (index < 0 || index >= dataSource.totalCount()) break + const element: T = dataSource.getData(index as number) + memoEntry2( + __context(), + generator(element, index), + itemGenerator, + element, + index + ) + let moreUp = visibleRange.needFillUp() + if (moreUp && visibleRange.indexUp > 0) { + index = --visibleRange.indexUp + } else if (visibleRange.needFillDown()) { + index = ++visibleRange.indexDown + } else { + // console.log("No more needed") + index = -1 + } + LazyForEachManager.SetInsertMark(parent, moreUp ? visibleRange.markUp : visibleRange.markDown, moreUp) + } + setNeedCreate(prevVal) + parent.setInsertMark(nullptr, false) + + // create DataNode to provide count information to parent + const identifier = new LazyForEachIdentifier(__id(), dataSource.totalCount() as int32, visibleRange.activeCount) + DataNode.attach(LazyForEachType, identifier) +} diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/ReusablePool.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/ReusablePool.ts index a20f3776b2e..b5d727993ea 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/ReusablePool.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/ReusablePool.ts @@ -13,6 +13,9 @@ * limitations under the License. */ +// avoid memo-plugin import issue +import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; + import { Disposable, scheduleCallback } from "@koalaui/runtime"; export class ReusablePool implements Disposable { diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/UserView.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/UserView.ts index 2cba00fe525..f3ce3dd57c0 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/UserView.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/UserView.ts @@ -12,6 +12,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + +// avoid memo-plugin import issue +import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; + import { InteropNativeModule } from "@koalaui/interop" import { int32, int8Array } from "@koalaui/common" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/ani/arkts/ui_extension/ArkUIAniUiextensionLoadLibraryHelp.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/ani/arkts/ui_extension/ArkUIAniUiextensionLoadLibraryHelp.ts index 901a97b751b..3c60f53e8be 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/ani/arkts/ui_extension/ArkUIAniUiextensionLoadLibraryHelp.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/ani/arkts/ui_extension/ArkUIAniUiextensionLoadLibraryHelp.ts @@ -13,6 +13,9 @@ * limitations under the License. */ +// avoid memo-plugin import issue +import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; + import { KLong, KInt, InteropNativeModule } from "@koalaui/interop" export class ArkUIAniUiextensionLoadLibraryHelp { static hasLoadLibrary: boolean = false; diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/ani/arkts/ui_extension/ArkUIAniUiextensionModal.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/ani/arkts/ui_extension/ArkUIAniUiextensionModal.ts index 0b7d0ec984b..f0108d6b2bd 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/ani/arkts/ui_extension/ArkUIAniUiextensionModal.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/ani/arkts/ui_extension/ArkUIAniUiextensionModal.ts @@ -13,6 +13,9 @@ * limitations under the License. */ +// avoid memo-plugin import issue +import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; + import { KLong, KInt, InteropNativeModule } from "@koalaui/interop" import Want from "@ohos.app.ability.Want" import { ArkUIAniUiextensionLoadLibraryHelp } from "./ArkUIAniUiextensionLoadLibraryHelp" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/ArkoalaControl.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/ArkoalaControl.ts index 46d53f3de71..31f70fa4718 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/ArkoalaControl.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/ArkoalaControl.ts @@ -13,6 +13,9 @@ * limitations under the License. */ +// avoid memo-plugin import issue +import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; + import { ArkoalaControl } from "./Declarations" // This is a workaround for ArkTS compiler bug. diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/CallbackRegistry.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/CallbackRegistry.ts index 07fb8f45de6..48b2756d799 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/CallbackRegistry.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/CallbackRegistry.ts @@ -13,6 +13,9 @@ * limitations under the License. */ +// avoid memo-plugin import issue +import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; + import { int32 } from "@koalaui/common" import { KUint8ArrayPtr } from "@koalaui/interop" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/Declarations.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/Declarations.ts index 974d6e07121..ad82c37ffd3 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/Declarations.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/Declarations.ts @@ -13,6 +13,9 @@ * limitations under the License. */ +// avoid memo-plugin import issue +import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; + import { int32 } from "@koalaui/common" export interface ArkoalaControl { diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/EnumsImpl.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/EnumsImpl.ts index e45fb186263..12b03f1dd8e 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/EnumsImpl.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/EnumsImpl.ts @@ -1,3 +1,21 @@ +/* + * Copyright (c) 2024-2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// avoid memo-plugin import issue +import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; + import { int32, float32 } from "@koalaui/common" export enum PointerStyle { DEFAULT = 0, diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/Events.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/Events.ts index b8e37c8e5ac..6f87d78039e 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/Events.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/Events.ts @@ -13,6 +13,9 @@ * limitations under the License. */ +// avoid memo-plugin import issue +import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; + export function checkEvents() { customEventsChecker() } diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/arkts/ArkUINativeModule.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/arkts/ArkUINativeModule.ts index d0fed0f32a7..a291b4c8654 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/arkts/ArkUINativeModule.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/arkts/ArkUINativeModule.ts @@ -13,6 +13,9 @@ * limitations under the License. */ +// avoid memo-plugin import issue +import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; + import { KInt, KLong, KBoolean, KFloat, KUInt, KStringPtr, KPointer, KNativePointer, KInt32ArrayPtr, KUint8ArrayPtr, KFloat32ArrayPtr, pointer, KInteropReturnBuffer, KSerializerBuffer, loadNativeModuleLibrary, NativeBuffer } from "@koalaui/interop" import { int32, int64, float32 } from "@koalaui/common" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/arkts/TestNativeModule.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/arkts/TestNativeModule.ts index 2d197d5794e..9c0d0bcdad2 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/arkts/TestNativeModule.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/arkts/TestNativeModule.ts @@ -13,6 +13,9 @@ * limitations under the License. */ +// avoid memo-plugin import issue +import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; + import { KInt, KLong, KBoolean, KFloat, KUInt, KStringPtr, KPointer, KNativePointer, KInt32ArrayPtr, KUint8ArrayPtr, KFloat32ArrayPtr, pointer, KInteropReturnBuffer, KSerializerBuffer, loadNativeModuleLibrary, NativeBuffer } from "@koalaui/interop" import { int32, int64, float32 } from "@koalaui/common" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/arkui-common.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/arkui-common.ts index d3fe870362c..c6fe04f05cf 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/arkui-common.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/arkui-common.ts @@ -16,6 +16,9 @@ // WARNING! THIS FILE IS AUTO-GENERATED, DO NOT MAKE CHANGES, THEY WILL BE LOST ON NEXT GENERATION! +// avoid memo-plugin import issue +import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; + import { int32, int64, float32 } from "@koalaui/common" import { KInt, KPointer, KBoolean, NativeBuffer, KStringPtr, wrapCallback } from "@koalaui/interop" import { NodeAttach, remember } from "@koalaui/runtime" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/arkui-intl.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/arkui-intl.ts index 721d220e7b8..2e6dd37a310 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/arkui-intl.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/arkui-intl.ts @@ -16,6 +16,9 @@ // WARNING! THIS FILE IS AUTO-GENERATED, DO NOT MAKE CHANGES, THEY WILL BE LOST ON NEXT GENERATION! +// avoid memo-plugin import issue +import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; + import { int32, int64, float32 } from "@koalaui/common" import { KInt, KPointer, KBoolean, NativeBuffer, KStringPtr, wrapCallback } from "@koalaui/interop" import { NodeAttach, remember } from "@koalaui/runtime" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/arkui-synthetics.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/arkui-synthetics.ts index 366523a58af..7891439250f 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/arkui-synthetics.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/arkui-synthetics.ts @@ -16,6 +16,9 @@ // WARNING! THIS FILE IS AUTO-GENERATED, DO NOT MAKE CHANGES, THEY WILL BE LOST ON NEXT GENERATION! +// avoid memo-plugin import issue +import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; + import { int32, int64, float32 } from "@koalaui/common" import { KInt, KPointer, KBoolean, NativeBuffer, KStringPtr, wrapCallback } from "@koalaui/interop" import { NodeAttach, remember } from "@koalaui/runtime" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/arkui-uniformtypedescriptor.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/arkui-uniformtypedescriptor.ts index ccb13ca0a1b..01ef791cca0 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/arkui-uniformtypedescriptor.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/arkui-uniformtypedescriptor.ts @@ -16,6 +16,9 @@ // WARNING! THIS FILE IS AUTO-GENERATED, DO NOT MAKE CHANGES, THEY WILL BE LOST ON NEXT GENERATION! +// avoid memo-plugin import issue +import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; + import { int32, int64, float32 } from "@koalaui/common" import { KInt, KPointer, KBoolean, NativeBuffer, KStringPtr, wrapCallback } from "@koalaui/interop" import { NodeAttach, remember } from "@koalaui/runtime" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/arkui-wrapper-builder.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/arkui-wrapper-builder.ts index 5b14b4d649a..5d96a3f1510 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/arkui-wrapper-builder.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/arkui-wrapper-builder.ts @@ -16,6 +16,9 @@ // WARNING! THIS FILE IS AUTO-GENERATED, DO NOT MAKE CHANGES, THEY WILL BE LOST ON NEXT GENERATION! +// avoid memo-plugin import issue +import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; + import { int32, int64, float32 } from "@koalaui/common" import { KInt, KPointer, KBoolean, NativeBuffer, KStringPtr, wrapCallback } from "@koalaui/interop" import { NodeAttach, remember } from "@koalaui/runtime" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/commonTsEtsApi.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/commonTsEtsApi.ts index ca07f14f83b..ef91d53d3c9 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/commonTsEtsApi.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/commonTsEtsApi.ts @@ -16,6 +16,9 @@ // WARNING! THIS FILE IS AUTO-GENERATED, DO NOT MAKE CHANGES, THEY WILL BE LOST ON NEXT GENERATION! +// avoid memo-plugin import issue +import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; + import { int32, int64, float32 } from "@koalaui/common" import { KInt, KPointer, KBoolean, NativeBuffer, KStringPtr, wrapCallback } from "@koalaui/interop" import { NodeAttach, remember } from "@koalaui/runtime" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/customBuilder.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/customBuilder.ts index 6a534358561..9f02d627002 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/customBuilder.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/customBuilder.ts @@ -16,6 +16,9 @@ // WARNING! THIS FILE IS AUTO-GENERATED, DO NOT MAKE CHANGES, THEY WILL BE LOST ON NEXT GENERATION! +// avoid memo-plugin import issue +import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; + import { int32, int64, float32 } from "@koalaui/common" import { KInt, KPointer, KBoolean, NativeBuffer, KStringPtr, wrapCallback } from "@koalaui/interop" import { NodeAttach, remember } from "@koalaui/runtime" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/customComponent.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/customComponent.ts index cc656d34991..da207160485 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/customComponent.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/customComponent.ts @@ -162,7 +162,7 @@ export abstract class CustomComponent, T aboutToRecycle(): void {} __toRecord(param: Object): Record { return {} } - build(): void {}; + // build(): void {}; /** @memo */ _build( diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/enums.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/enums.ts index dbd0b89888a..b8dfdd7de2d 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/enums.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/enums.ts @@ -16,6 +16,9 @@ // WARNING! THIS FILE IS AUTO-GENERATED, DO NOT MAKE CHANGES, THEY WILL BE LOST ON NEXT GENERATION! +// avoid memo-plugin import issue +import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; + import { int32, int64, float32 } from "@koalaui/common" import { KInt, KPointer, KBoolean, NativeBuffer, KStringPtr, wrapCallback } from "@koalaui/interop" import { NodeAttach, remember } from "@koalaui/runtime" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/forEach.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/forEach.ts index e1707632198..b0ab6d3b830 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/forEach.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/forEach.ts @@ -16,6 +16,9 @@ // HANDWRITTEN, DO NOT REGENERATE +// avoid memo-plugin import issue +import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; + import { int32, hashCodeFromString, KoalaCallsiteKey } from "@koalaui/common" import { RepeatByArray } from "@koalaui/runtime" import { InteropNativeModule } from "@koalaui/interop" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/index.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/index.ts index 4f266842b36..ee39ca74c83 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/index.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/index.ts @@ -138,7 +138,7 @@ export * from "./rect" export * from "./refresh" export * from "./relativeContainer" export * from "./remoteWindow" -export * from "./repeat" +// export * from "./repeat" export * from "./richEditor" export * from "./richText" export * from "./rootScene" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/lazyGridLayout.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/lazyGridLayout.ts index e8112da9a4c..cc492aa8866 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/lazyGridLayout.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/lazyGridLayout.ts @@ -109,6 +109,13 @@ export class ArkLazyGridLayoutStyle extends ArkCommonMethodStyle implements Lazy export interface LazyVGridLayoutAttribute extends LazyGridLayoutAttribute { columnsTemplate(value: string | undefined): this } +<<<<<<< HEAD +======= +export interface UILazyVGridLayoutAttribute extends UILazyGridLayoutAttribute { + /** @memo */ + columnsTemplate(value: string | undefined): this +} +>>>>>>> cc1c303885f (use gn to build arkoala arkui-ohos) export class ArkLazyVGridLayoutStyle extends ArkLazyGridLayoutStyle implements LazyVGridLayoutAttribute { columnsTemplate_value?: string | undefined public columnsTemplate(value: string | undefined): this { diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/ohos.app.ability.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/ohos.app.ability.ts index 79d246a7290..45a077ab5ae 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/ohos.app.ability.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/ohos.app.ability.ts @@ -15,6 +15,8 @@ // WARNING! THIS FILE IS AUTO-GENERATED, DO NOT MAKE CHANGES, THEY WILL BE LOST ON NEXT GENERATION! +// avoid memo-plugin import issue +import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; import { int32, int64, float32 } from "@koalaui/common" import { KInt, KPointer, KBoolean, NativeBuffer, KStringPtr, wrapCallback } from "@koalaui/interop" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/peers/CallbackKind.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/peers/CallbackKind.ts index 9be08068f7e..638fef4e5c7 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/peers/CallbackKind.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/peers/CallbackKind.ts @@ -1,3 +1,21 @@ +/* + * Copyright (c) 2024-2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// avoid memo-plugin import issue +import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; + import { int32, float32 } from "@koalaui/common" export enum CallbackKind { Kind_AccessibilityCallback = 589030517, diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/peers/CallbackTransformer.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/peers/CallbackTransformer.ts index ef85bc66ca2..60b883d892b 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/peers/CallbackTransformer.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/peers/CallbackTransformer.ts @@ -25,13 +25,16 @@ export type UIDetachedRootCreator = ( /** @memo */ builder: () => void ) => PeerNode -let createUiDetachedRoot: UIDetachedRootCreator = ( +function createUiDetachedRootStub( factory: () => PeerNode, /** @memo */ builder: () => void -): PeerNode => { +): PeerNode { throw new Error("Not implemented") } + +let createUiDetachedRoot: UIDetachedRootCreator = createUiDetachedRootStub + export function setUIDetachedRootCreator(creator: UIDetachedRootCreator): void { createUiDetachedRoot = creator } diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/point.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/point.ts index cbfa63622ce..501bfaf7b24 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/point.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/point.ts @@ -16,6 +16,9 @@ // WARNING! THIS FILE IS AUTO-GENERATED, DO NOT MAKE CHANGES, THEY WILL BE LOST ON NEXT GENERATION! +// avoid memo-plugin import issue +import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; + import { int32, int64, float32 } from "@koalaui/common" import { KInt, KPointer, KBoolean, NativeBuffer, KStringPtr, wrapCallback } from "@koalaui/interop" import { NodeAttach, remember } from "@koalaui/runtime" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/rawfiledescriptor.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/rawfiledescriptor.ts index 0827972e812..ff430abd523 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/rawfiledescriptor.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/rawfiledescriptor.ts @@ -16,6 +16,9 @@ // WARNING! THIS FILE IS AUTO-GENERATED, DO NOT MAKE CHANGES, THEY WILL BE LOST ON NEXT GENERATION! +// avoid memo-plugin import issue +import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; + import { int32, int64, float32 } from "@koalaui/common" import { KInt, KPointer, KBoolean, NativeBuffer, KStringPtr, wrapCallback } from "@koalaui/interop" import { NodeAttach, remember } from "@koalaui/runtime" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/sdk-stubs.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/sdk-stubs.ts index 0fe637b075d..e776448d4b3 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/sdk-stubs.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/sdk-stubs.ts @@ -16,6 +16,9 @@ // WARNING! THIS FILE IS AUTO-GENERATED, DO NOT MAKE CHANGES, THEY WILL BE LOST ON NEXT GENERATION! +// avoid memo-plugin import issue +import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; + import { int32, int64, float32 } from "@koalaui/common" import { KInt, KPointer, KBoolean, NativeBuffer, KStringPtr, wrapCallback } from "@koalaui/interop" import { NodeAttach, remember } from "@koalaui/runtime" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/shared/ArkResource.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/shared/ArkResource.ts index 7fae724618f..e527f3de565 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/shared/ArkResource.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/shared/ArkResource.ts @@ -13,6 +13,9 @@ * limitations under the License. */ +// avoid memo-plugin import issue +import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; + export interface ArkResource { name: string, id: number; diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/span.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/span.ts index 929f158cd08..40cee28a6cd 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/span.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/span.ts @@ -351,6 +351,33 @@ export interface SpanAttribute extends BaseSpan { lineHeight(value: Length | undefined): this textShadow(value: ShadowOptions | Array | undefined): this } +<<<<<<< HEAD +======= +export interface UISpanAttribute extends UIBaseSpan { + /** @memo */ + font(value: Font | undefined): this + /** @memo */ + fontColor(value: ResourceColor | undefined): this + /** @memo */ + fontSize(value: number | string | Resource | undefined): this + /** @memo */ + fontStyle(value: FontStyle | undefined): this + /** @memo */ + fontWeight(value: number | FontWeight | string | undefined): this + /** @memo */ + fontFamily(value: string | Resource | undefined): this + /** @memo */ + decoration(value: DecorationStyleInterface | undefined): this + /** @memo */ + letterSpacing(value: number | string | undefined): this + /** @memo */ + textCase(value: TextCase | undefined): this + /** @memo */ + lineHeight(value: Length | undefined): this + /** @memo */ + textShadow(value: ShadowOptions | Array | undefined): this +} +>>>>>>> cc1c303885f (use gn to build arkoala arkui-ohos) export class ArkSpanStyle extends ArkBaseSpanStyle implements SpanAttribute { font_value?: Font | undefined fontColor_value?: ResourceColor | undefined diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/stateManagement.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/stateManagement.ts index 1aba374ae02..cfa9b807923 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/stateManagement.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/stateManagement.ts @@ -16,6 +16,9 @@ // WARNING! THIS FILE IS AUTO-GENERATED, DO NOT MAKE CHANGES, THEY WILL BE LOST ON NEXT GENERATION! +// avoid memo-plugin import issue +import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; + import { int32, int64, float32 } from "@koalaui/common" import { KInt, KPointer, KBoolean, NativeBuffer, KStringPtr, wrapCallback } from "@koalaui/interop" import { NodeAttach, remember } from "@koalaui/runtime" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/stdlib.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/stdlib.ts index 54caaf7f7dc..51d8765b6c7 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/stdlib.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/stdlib.ts @@ -16,6 +16,9 @@ // WARNING! THIS FILE IS AUTO-GENERATED, DO NOT MAKE CHANGES, THEY WILL BE LOST ON NEXT GENERATION! +// avoid memo-plugin import issue +import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; + import { int32, int64, float32 } from "@koalaui/common" import { KInt, KPointer, KBoolean, NativeBuffer, KStringPtr, wrapCallback } from "@koalaui/interop" import { NodeAttach, remember } from "@koalaui/runtime" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/test_utils.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/test_utils.ts index 4569635881e..041fd3b275a 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/test_utils.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/test_utils.ts @@ -13,6 +13,9 @@ * limitations under the License. */ +// avoid memo-plugin import issue +import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; + export function assertEquals(name: String, expected: E, actual: A) { if (expected != actual) { console.log(`TEST ${name} FAIL:\n EXPECTED "${expected}"\n ACTUAL "${actual}"`) diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/ForeignFunctions.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/ForeignFunctions.ts index 1119f35f233..794b736c0f8 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/ForeignFunctions.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/ForeignFunctions.ts @@ -12,6 +12,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + +// avoid memo-plugin import issue +import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; + import { int32 } from "@koalaui/common" import { pointer, nullptr, InteropNativeModule, SerializerBase } from "@koalaui/interop" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/RepeatImpl.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/RepeatImpl.ts index 3fb219188b5..d7d27b31f82 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/RepeatImpl.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/RepeatImpl.ts @@ -254,7 +254,6 @@ function nonVirtualRender(arr: RepeatArray, keyGenerator ? hashCodeFromString(keyGenerator!(ele, (i as number))) : i; RepeatByArray(arr, keyGen, (ele: T, i: int32) => { const ri = new RepeatItemImpl(ele, (i as number)); - /** @memo */ itemGenerator(ri); }); } \ No newline at end of file diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/Router.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/Router.ts index 4384d179528..e8869dbd155 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/Router.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/Router.ts @@ -30,7 +30,7 @@ import { runtimeType, RuntimeType } from "@koalaui/interop" import router from "../../ohos.router" import { EntryPoint, UserView, UserViewBuilder } from "../UserView" import { InteropNativeModule, nullptr } from "@koalaui/interop" -import { PeerNode } from "../../src/PeerNode" +import { PeerNode } from "../PeerNode" import { ArkUIGeneratedNativeModule, TypeChecker } from "#components" import { Visibility } from "../component" import { Serializer } from "../component/peers/Serializer" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/modifiers/ArkColumnModifier.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/modifiers/ArkColumnModifier.ts deleted file mode 100644 index 3a61cda1cbd..00000000000 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/modifiers/ArkColumnModifier.ts +++ /dev/null @@ -1,67 +0,0 @@ -// /* -// * Copyright (c) 2025 Huawei Device Co., Ltd. -// * Licensed under the Apache License, Version 2.0 (the "License"); -// * you may not use this file except in compliance with the License. -// * You may obtain a copy of the License at -// * -// * http://www.apache.org/licenses/LICENSE-2.0 -// * -// * Unless required by applicable law or agreed to in writing, software -// * distributed under the License is distributed on an "AS IS" BASIS, -// * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// * See the License for the specific language governing permissions and -// * limitations under the License. -// */ - -// import { int32 } from "@koalaui/common" -// import { ArkColumnPeer } from "../../component/peers/ArkColumnPeer"; -// import { ArkCommonMethodPeer } from "../../component/peers/ArkCommonPeer"; -// import { ArkCommonAttributeSet, modifierNullWithKey, modifierWithKey, ModifierWithKey } from "./ArkCommonModifier"; - -// class AlignItemsModifier extends ModifierWithKey { -// static identity: string = 'alignItems'; - -// constructor(value: HorizontalAlign | undefined) { -// super(value) -// } - -// applyPeer(node: ArkCommonMethodPeer, reset: boolean): void { -// let columnPeerNode = node as ArkColumnPeer -// if (reset) { -// // columnPeerNode.resetAlignItemsAttribute(); -// } else { -// if (this.value != undefined) { -// columnPeerNode.alignItemsAttribute(this.value as HorizontalAlign); -// } -// } -// } - -// static factory(value: HorizontalAlign | undefined): AlignItemsModifier { -// if (value) { -// return new AlignItemsModifier(value) -// } -// else { -// return new AlignItemsModifier(undefined); -// } -// } -// } - -// export class ArkColumnAttributeSet extends ArkCommonAttributeSet /* implements ColumnAttribute */ { - -// alignItems(value: HorizontalAlign|undefined): this { -// modifierWithKey(this._modifiersWithKeys, AlignItemsModifier.identity, AlignItemsModifier.factory, value); -// return this; -// } -// } - - -// applyNormalAttribute(instance: ColumnAttribute) { this.alignItems(HorizontalAlign.End); } - -// applyPressedAttribute(instance: ColumnAttribute) {} - -// applyFocusedAttribute(instance: ColumnAttribute){} - -// applyDisabledAttribute(instance: ColumnAttribute){} - -// applySelectedAttribute(instance: ColumnAttribute){} -// } \ No newline at end of file diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/modifiers/ArkColumnNode.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/modifiers/ArkColumnNode.ts deleted file mode 100644 index d842a5840ce..00000000000 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/modifiers/ArkColumnNode.ts +++ /dev/null @@ -1,32 +0,0 @@ -// /* -// * Copyright (c) 2025 Huawei Device Co., Ltd. -// * Licensed under the Apache License, Version 2.0 (the "License"); -// * you may not use this file except in compliance with the License. -// * You may obtain a copy of the License at -// * -// * http://www.apache.org/licenses/LICENSE-2.0 -// * -// * Unless required by applicable law or agreed to in writing, software -// * distributed under the License is distributed on an "AS IS" BASIS, -// * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// * See the License for the specific language governing permissions and -// * limitations under the License. -// */ - -// import { ColumnAttribute, HorizontalAlign } from "../../component"; -// import { ArkColumnPeer } from "../../component/peers/ArkColumnPeer"; -// import { ArkBaseNode } from "./ArkBaseNode"; - -// export class ArkColumnNode extends ArkBaseNode /* implements ColumnAttribute */ { -// alignItems(value: HorizontalAlign | undefined): this { -// if (value) { -// this.getPeer().alignItemsAttribute(value); -// } else { -// // this.getPeer().resetAlignItemsAttribute(value); -// } -// return this; -// } -// getPeer() : ArkColumnPeer { -// return this.peer as ArkColumnPeer -// } -// } \ No newline at end of file diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/modifiers/ArkGridItemModifier.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/modifiers/ArkGridItemModifier.ts deleted file mode 100644 index a891232a79e..00000000000 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/modifiers/ArkGridItemModifier.ts +++ /dev/null @@ -1,153 +0,0 @@ -// /* -// * Copyright (c) 2025 Huawei Device Co., Ltd. -// * Licensed under the Apache License, Version 2.0 (the "License"); -// * you may not use this file except in compliance with the License. -// * You may obtain a copy of the License at -// * -// * http://www.apache.org/licenses/LICENSE-2.0 -// * -// * Unless required by applicable law or agreed to in writing, software -// * distributed under the License is distributed on an "AS IS" BASIS, -// * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// * See the License for the specific language governing permissions and -// * limitations under the License. -// */ - -// import { ArkGridItemPeer } from "../../component/peers/ArkGridItemPeer"; -// import { ArkCommonMethodPeer } from "../../component/peers/ArkCommonPeer"; -// import { ArkCommonAttributeSet, modifierNullWithKey, modifierWithKey, ModifierWithKey } from "./ArkCommonModifier"; - -// class RowStartModifier extends ModifierWithKey { -// static identity: string = 'rowStart'; - -// constructor(value: number) { -// super(value) -// } - -// applyPeer(node: ArkCommonMethodPeer, reset: boolean): void { -// let gridItemPeerNode = node as ArkGridItemPeer -// if (reset) { - -// } else { -// gridItemPeerNode.rowStartAttribute(this.value as (number)); -// } -// } - -// static factory(value: number): RowStartModifier { -// return new RowStartModifier(value) -// } -// } - -// class RowEndModifier extends ModifierWithKey { -// static identity: string = 'rowEnd'; - -// constructor(value: number) { -// super(value) -// } - -// applyPeer(node: ArkCommonMethodPeer, reset: boolean): void { -// let gridItemPeerNode = node as ArkGridItemPeer -// if (reset) { - -// } else { -// gridItemPeerNode.rowEndAttribute(this.value as (number)); -// } -// } - -// static factory(value: number): RowEndModifier { -// return new RowEndModifier(value) -// } -// } - -// class ColumnStartModifier extends ModifierWithKey { -// static identity: string = 'columnStart'; - -// constructor(value: number) { -// super(value) -// } - -// applyPeer(node: ArkCommonMethodPeer, reset: boolean): void { -// let gridItemPeerNode = node as ArkGridItemPeer -// if (reset) { - -// } else { -// gridItemPeerNode.columnStartAttribute(this.value as (number)); -// } -// } - -// static factory(value: number): ColumnStartModifier { -// return new ColumnStartModifier(value) -// } -// } - -// class ColumnEndModifier extends ModifierWithKey { -// static identity: string = 'columnEnd'; - -// constructor(value: number) { -// super(value) -// } - -// applyPeer(node: ArkCommonMethodPeer, reset: boolean): void { -// let gridItemPeerNode = node as ArkGridItemPeer -// if (reset) { - -// } else { -// gridItemPeerNode.columnEndAttribute(this.value as (number)); -// } -// } - -// static factory(value: number): ColumnEndModifier { -// return new ColumnEndModifier(value) -// } -// } - -// export class ArkGridItemAttributeSet extends ArkCommonAttributeSet /* implements GridItemAttribute */ { - -// rowStart(value: number): this { -// if (value) { -// modifierWithKey(this._modifiersWithKeys, RowStartModifier.identity, RowStartModifier.factory, value); -// } else { -// modifierNullWithKey(this._modifiersWithKeys, RowStartModifier.identity); -// } -// return this; -// } - -// rowEnd(value: number): this { -// if (value) { -// modifierWithKey(this._modifiersWithKeys, RowEndModifier.identity, RowEndModifier.factory, value); -// } else { -// modifierNullWithKey(this._modifiersWithKeys, RowEndModifier.identity); -// } -// return this; -// } - -// columnStart(value: number): this { -// if (value) { -// modifierWithKey(this._modifiersWithKeys, ColumnStartModifier.identity, ColumnStartModifier.factory, value); -// } else { -// modifierNullWithKey(this._modifiersWithKeys, ColumnStartModifier.identity); -// } -// return this; -// } - -// columnEnd(value: number): this { -// if (value) { -// modifierWithKey(this._modifiersWithKeys, ColumnEndModifier.identity, ColumnEndModifier.factory, value); -// } else { -// modifierNullWithKey(this._modifiersWithKeys, ColumnEndModifier.identity); -// } -// return this; -// } -// } - - -// applyNormalAttribute(instance: GridItemAttribute){} - -// applyPressedAttribute(instance: GridItemAttribute){} - -// applyFocusedAttribute(instance: GridItemAttribute){} - -// applyDisabledAttribute(instance: GridItemAttribute){} - -// applySelectedAttribute(instance: GridItemAttribute){} -// } \ No newline at end of file diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/modifiers/ArkGridItemNode.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/modifiers/ArkGridItemNode.ts deleted file mode 100644 index 0044ac33e68..00000000000 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/modifiers/ArkGridItemNode.ts +++ /dev/null @@ -1,53 +0,0 @@ -// /* -// * Copyright (c) 2025 Huawei Device Co., Ltd. -// * Licensed under the Apache License, Version 2.0 (the "License"); -// * you may not use this file except in compliance with the License. -// * You may obtain a copy of the License at -// * -// * http://www.apache.org/licenses/LICENSE-2.0 -// * -// * Unless required by applicable law or agreed to in writing, software -// * distributed under the License is distributed on an "AS IS" BASIS, -// * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// * See the License for the specific language governing permissions and -// * limitations under the License. -// */ - -// import { GridItemAttribute } from "../../component"; -// import { ArkGridItemPeer } from "../../component/peers/ArkGridItemPeer"; -// import { ArkBaseNode } from "./ArkBaseNode"; - -// export class ArkGridItemNode extends ArkBaseNode /* implements GridItemAttribute */ { - -// rowStart(value : number) : this { -// if (value) { -// this.getPeer().rowStartAttribute(value); -// } -// return this; -// } - -// rowEnd(value : number) : this { -// if (value) { -// this.getPeer().rowEndAttribute(value); -// } -// return this; -// } - -// columnStart(value : number) : this { -// if (value) { -// this.getPeer().columnStartAttribute(value); -// } -// return this; -// } - -// columnEnd(value : number) : this { -// if (value) { -// this.getPeer().columnEndAttribute(value); -// } -// return this; -// } - -// getPeer() : ArkGridItemPeer { -// return this.peer as ArkGridItemPeer -// } -// } \ No newline at end of file diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/modifiers/ArkImageModifier.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/modifiers/ArkImageModifier.ts index d3868db117d..60dbd44e71a 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/modifiers/ArkImageModifier.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/modifiers/ArkImageModifier.ts @@ -13,6 +13,9 @@ * limitations under the License. */ +// avoid memo-plugin import issue +import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; + import { AttributeModifier, ImageAttribute } from "../.."; import { ArkCommonAttributeSet } from "./ArkCommonModifier"; diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/modifiers/ArkSymbolGlyphModifier.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/modifiers/ArkSymbolGlyphModifier.ts deleted file mode 100644 index 8f9fbbcdd23..00000000000 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/modifiers/ArkSymbolGlyphModifier.ts +++ /dev/null @@ -1,251 +0,0 @@ -// /* -// * Copyright (c) 2025 Huawei Device Co., Ltd. -// * Licensed under the Apache License, Version 2.0 (the "License"); -// * you may not use this file except in compliance with the License. -// * You may obtain a copy of the License at -// * -// * http://www.apache.org/licenses/LICENSE-2.0 -// * -// * Unless required by applicable law or agreed to in writing, software -// * distributed under the License is distributed on an "AS IS" BASIS, -// * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// * See the License for the specific language governing permissions and -// * limitations under the License. -// */ - -// import { RuntimeType, runtimeType } from "@koalaui/interop"; -// import { SymbolEffectStrategy, SymbolRenderingStrategy } from "../../component"; -// import { SymbolGlyphAttribute } from "../.."; -// import { Resource } from "../.."; -// import { FontWeight } from "../../component"; -// import { ResourceColor } from "../../component"; -// import { ArkSymbolGlyphPeer } from "../../component/peers/ArkSymbolglyphPeer"; -// import { ArkCommonMethodPeer } from "../../component/peers/ArkCommonPeer"; -// import { ArkCommonAttributeSet, modifierNullWithKey, modifierWithKey, ModifierWithKey } from "./ArkCommonModifier"; -// import { SymbolEffect } from "../.."; - -// class ArkSymbolEffect { -// symbolEffect?: SymbolEffect; -// triggerValue?: number; -// isActive?: boolean; - -// constructor() { -// this.symbolEffect = undefined; -// this.triggerValue = undefined; -// this.isActive = undefined; -// } -// } - -// class SymbolGlyphFontSizeModifier extends ModifierWithKey { -// static identity: string = 'symbolGlyphFontSize'; - -// constructor(value: number | string | Resource) { -// super(value) -// } - -// applyPeer(node: ArkCommonMethodPeer, reset: boolean): void { -// let peerNode = node as ArkSymbolGlyphPeer -// if (reset) { -// // peerNode.resetFontSizeAttribute(); -// } else { -// peerNode.fontSizeAttribute(this.value!); -// } -// } - -// static factory(value: number | string | Resource): SymbolGlyphFontSizeModifier { -// return new SymbolGlyphFontSizeModifier(value) -// } -// } - -// class SymbolGlyphFontColorModifier extends ModifierWithKey> { -// static identity: string = 'symbolGlyphFontColor'; - -// constructor(value: Array) { -// super(value) -// } - -// applyPeer(node: ArkCommonMethodPeer, reset: boolean): void { -// let peerNode = node as ArkSymbolGlyphPeer -// if (reset) { -// // peerNode.resetFontColorAttribute(); -// } else { -// peerNode.fontColorAttribute(this.value!); -// } -// } - -// static factory(value: Array): SymbolGlyphFontColorModifier { -// return new SymbolGlyphFontColorModifier(value) -// } -// } - -// class SymbolGlyphFontWeightModifier extends ModifierWithKey { -// static identity: string = 'symbolGlyphFontWeight'; - -// constructor(value: number | FontWeight | string) { -// super(value) -// } - -// applyPeer(node: ArkCommonMethodPeer, reset: boolean): void { -// let peerNode = node as ArkSymbolGlyphPeer -// if (reset) { -// // peerNode.resetFontWeightAttribute(); -// } else { -// peerNode.fontWeightAttribute(this.value!); -// } -// } - -// static factory(value: number | FontWeight | string): SymbolGlyphFontWeightModifier { -// return new SymbolGlyphFontWeightModifier(value) -// } -// } - -// class SymbolGlyphEffectStrategyModifier extends ModifierWithKey { -// static identity: string = 'symbolGlyphEffectStrategy'; - -// constructor(value: SymbolEffectStrategy) { -// super(value) -// } - -// applyPeer(node: ArkCommonMethodPeer, reset: boolean): void { -// let peerNode = node as ArkSymbolGlyphPeer -// if (reset) { -// // peerNode.resetEffectStrategyAttribute(); -// } else { -// peerNode.effectStrategyAttribute(this.value!); -// } -// } - -// static factory(value: SymbolEffectStrategy): SymbolGlyphEffectStrategyModifier { -// return new SymbolGlyphEffectStrategyModifier(value) -// } -// } - -// class SymbolGlyphRenderingStrategyModifier extends ModifierWithKey { -// static identity: string = 'symbolGlyphRenderingStrategy'; - -// constructor(value: SymbolRenderingStrategy) { -// super(value) -// } - -// applyPeer(node: ArkCommonMethodPeer, reset: boolean): void { -// let peerNode = node as ArkSymbolGlyphPeer -// if (reset) { -// // peerNode.resetRenderingStrategyAttribute(); -// } else { -// peerNode.renderingStrategyAttribute(this.value!); -// } -// } - -// static factory(value: SymbolRenderingStrategy): SymbolGlyphRenderingStrategyModifier { -// return new SymbolGlyphRenderingStrategyModifier(value) -// } -// } - -// class SymbolGlyphEffectModifier extends ModifierWithKey { -// static identity: string = 'symbolGlyphEffect'; - -// constructor(value: ArkSymbolEffect) { -// super(value) -// } - -// applyPeer(node: ArkCommonMethodPeer, reset: boolean): void { -// let peerNode = node as ArkSymbolGlyphPeer -// if (reset) { -// // peerNode.resetSymbolEffectAttribute(); -// } else { -// let symbolEffect = this.value!.symbolEffect; -// let isActive = this.value!.isActive; -// let triggerValue = this.value!.triggerValue; -// if (symbolEffect !== undefined) { -// if (isActive !== undefined) { -// peerNode.symbolEffect0Attribute(symbolEffect!, isActive); -// } else if (triggerValue !== undefined) { -// peerNode.symbolEffect1Attribute(symbolEffect!, triggerValue); -// } else { -// peerNode.symbolEffect0Attribute(symbolEffect!, undefined); -// } -// } else { -// // peerNode.resetSymbolEffectAttribute(); -// } -// } -// } - -// static factory(value: ArkSymbolEffect): SymbolGlyphEffectModifier { -// return new SymbolGlyphEffectModifier(value) -// } -// } - -// export class ArkSymbolGlyphAttributeSet extends ArkCommonAttributeSet /* implements SymbolGlyphAttribute */ { -// fontSize(value: number | string | Resource | undefined): this { -// if (value) { -// modifierWithKey(this._modifiersWithKeys, SymbolGlyphFontSizeModifier.identity, SymbolGlyphFontSizeModifier.factory, value!); -// } else { -// modifierNullWithKey(this._modifiersWithKeys, SymbolGlyphFontSizeModifier.identity); -// } -// return this; -// } -// fontColor(value: Array): this { -// if (value) { -// modifierWithKey(this._modifiersWithKeys, SymbolGlyphFontColorModifier.identity, SymbolGlyphFontColorModifier.factory, value!); -// } else { -// modifierNullWithKey(this._modifiersWithKeys, SymbolGlyphFontColorModifier.identity); -// } -// return this; -// } -// fontWeight(value: number | FontWeight | string): this { -// if (value) { -// modifierWithKey(this._modifiersWithKeys, SymbolGlyphFontWeightModifier.identity, SymbolGlyphFontWeightModifier.factory, value!); -// } else { -// modifierNullWithKey(this._modifiersWithKeys, SymbolGlyphFontWeightModifier.identity); -// } -// return this; -// } -// effectStrategy(value: SymbolEffectStrategy): this { -// if (value) { -// modifierWithKey(this._modifiersWithKeys, SymbolGlyphEffectStrategyModifier.identity, SymbolGlyphEffectStrategyModifier.factory, value! as SymbolEffectStrategy); -// } else { -// modifierNullWithKey(this._modifiersWithKeys, SymbolGlyphEffectStrategyModifier.identity); -// } -// return this; -// } -// renderingStrategy(value: SymbolRenderingStrategy): this { -// if (value) { -// modifierWithKey(this._modifiersWithKeys, SymbolGlyphRenderingStrategyModifier.identity, SymbolGlyphRenderingStrategyModifier.factory, value! as SymbolRenderingStrategy); -// } else { -// modifierNullWithKey(this._modifiersWithKeys, SymbolGlyphRenderingStrategyModifier.identity); -// } -// return this; -// } -// symbolEffect(symbolEffect: SymbolEffect, isActive?: boolean | undefined | number | undefined): this { -// let value = new ArkSymbolEffect(); -// value.symbolEffect = symbolEffect; -// const isActive_type = runtimeType(isActive); -// if (isActive_type == RuntimeType.BOOLEAN) { -// value.isActive = isActive as boolean; -// } else if (isActive_type == RuntimeType.NUMBER) { -// value.triggerValue = isActive as number; -// } else { -// value.isActive = undefined; -// value.triggerValue = undefined; -// } -// if (symbolEffect) { -// modifierWithKey(this._modifiersWithKeys, SymbolGlyphEffectModifier.identity, SymbolGlyphEffectModifier.factory, value!); -// } else { -// modifierNullWithKey(this._modifiersWithKeys, SymbolGlyphEffectModifier.identity); -// } -// return this; -// } -// } - -// _SymbolGlyphModifierStub: string = ""; - -// applyNormalAttribute(instance: SymbolGlyphAttribute){} - -// applyPressedAttribute(instance: SymbolGlyphAttribute){} - -// applyFocusedAttribute(instance: SymbolGlyphAttribute){} - -// applyDisabledAttribute(instance: SymbolGlyphAttribute){} - -// applySelectedAttribute(instance: SymbolGlyphAttribute){} -// } \ No newline at end of file diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/modifiers/ArkSymbolGlyphNode.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/modifiers/ArkSymbolGlyphNode.ts deleted file mode 100644 index e86e94c7c2f..00000000000 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/modifiers/ArkSymbolGlyphNode.ts +++ /dev/null @@ -1,85 +0,0 @@ -// /* -// * Copyright (c) 2025 Huawei Device Co., Ltd. -// * Licensed under the Apache License, Version 2.0 (the "License"); -// * you may not use this file except in compliance with the License. -// * You may obtain a copy of the License at -// * -// * http://www.apache.org/licenses/LICENSE-2.0 -// * -// * Unless required by applicable law or agreed to in writing, software -// * distributed under the License is distributed on an "AS IS" BASIS, -// * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// * See the License for the specific language governing permissions and -// * limitations under the License. -// */ - -// import { RuntimeType, runtimeType } from "@koalaui/interop"; -// import { SymbolGlyphAttribute } from "../../component"; -// import { Resource } from "../../component"; -// import { ArkSymbolGlyphPeer } from "../../component/peers/ArkSymbolglyphPeer"; -// import { ArkBaseNode } from "./ArkBaseNode"; -// import { FontWeight } from "../../component"; -// import { ResourceColor } from "../../component"; -// import { SymbolEffectStrategy, SymbolRenderingStrategy } from "../../component"; -// import { SymbolEffect } from "../../component"; - -// export class ArkSymbolGlyphNode extends ArkBaseNode /* implements SymbolGlyphAttribute */ { -// fontSize(value: number | string | Resource | undefined): this { -// if (value) { -// this.getPeer().fontSizeAttribute(value!); -// } else { -// // this.getPeer().resetFontSizeAttribute(value); -// } -// return this; -// } -// fontColor(value: Array): this { -// if (value) { -// this.getPeer().fontColorAttribute(value!); -// } else { -// // this.getPeer().resetFontColorAttribute(value); -// } -// return this; -// } -// fontWeight(value: number | FontWeight | string): this { -// if (value) { -// this.getPeer().fontWeightAttribute(value!); -// } else { -// // this.getPeer().resetFontWeightAttribute(value); -// } -// return this; -// } -// effectStrategy(value: SymbolEffectStrategy): this { -// if (value) { -// this.getPeer().effectStrategyAttribute(value!); -// } else { -// // this.getPeer().resetEffectStrategyAttribute(value); -// } -// return this; -// } -// renderingStrategy(value: SymbolRenderingStrategy): this { -// if (value) { -// this.getPeer().renderingStrategyAttribute(value!); -// } else { -// // this.getPeer().resetRenderingStrategyAttribute(value); -// } -// return this; -// } -// symbolEffect(symbolEffect: SymbolEffect, isActive?: boolean | undefined | number | undefined): this { -// if (symbolEffect) { -// const isActive_type = runtimeType(isActive); -// if (isActive_type == RuntimeType.BOOLEAN) { -// this.getPeer().symbolEffect0Attribute(symbolEffect!, isActive as boolean); -// } else if (isActive_type == RuntimeType.NUMBER) { -// this.getPeer().symbolEffect1Attribute(symbolEffect!, isActive as number); -// } else { -// this.getPeer().symbolEffect0Attribute(symbolEffect!, undefined); -// } -// } else { -// // this.getPeer().resetFontSizeAttribute(value); -// } -// return this; -// } -// getPeer() : ArkSymbolGlyphPeer { -// return this.peer as ArkSymbolGlyphPeer; -// } -// } \ No newline at end of file diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/index.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/index.ts index 26fdf3b19fd..c228b297b40 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/index.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/index.ts @@ -14,7 +14,7 @@ */ export { Observed, observableProxy } from "@koalaui/common" -export * from "@koalaui/arkui-common" +// export * from "@koalaui/arkui-common" export * from "./component" // export * from "./handwritten" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/stateManagement/base/backingValue.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/stateManagement/base/backingValue.ts index a3778f4dedb..f68a969f8cd 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/stateManagement/base/backingValue.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/stateManagement/base/backingValue.ts @@ -18,6 +18,9 @@ versioning of backing store values */ +// avoid memo-plugin import issue +import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; + export class BackingValue { private current_ : T; diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/stateManagement/base/mutableStateMeta.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/stateManagement/base/mutableStateMeta.ts index 7df17d8151a..7a13bda35e2 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/stateManagement/base/mutableStateMeta.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/stateManagement/base/mutableStateMeta.ts @@ -13,6 +13,9 @@ * limitations under the License. */ +// avoid memo-plugin import issue +import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; + import { int32 } from '@koalaui/common'; import { MutableState, mutableState } from '@koalaui/runtime'; diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/stateManagement/base/stateUpdateLoop.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/stateManagement/base/stateUpdateLoop.ts index 65545bd1b34..d31103d14d3 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/stateManagement/base/stateUpdateLoop.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/stateManagement/base/stateUpdateLoop.ts @@ -12,6 +12,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + +// avoid memo-plugin import issue +import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; + export class StateUpdateLoop { private static callbacks: Array<() => void> = new Array<() => void>(); public static add(callback: () => void): void { diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/stateManagement/base/types.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/stateManagement/base/types.ts index 503a3352215..8658ee76c09 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/stateManagement/base/types.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/stateManagement/base/types.ts @@ -13,6 +13,9 @@ * limitations under the License. */ +// avoid memo-plugin import issue +import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; + /** define base Types for decorators */ diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/stateManagement/decorators/decoratorWatch.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/stateManagement/decorators/decoratorWatch.ts index 9e6354bf083..3bb111b7e2f 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/stateManagement/decorators/decoratorWatch.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/stateManagement/decorators/decoratorWatch.ts @@ -12,6 +12,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + +// avoid memo-plugin import issue +import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; + import { int32 } from "@koalaui/common"; export type WatchFuncType = ((propertyName: string) => void); diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/stateManagement/index-arkts.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/stateManagement/index-arkts.ts new file mode 100644 index 00000000000..3578d3113c3 --- /dev/null +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/stateManagement/index-arkts.ts @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export * from './base/backingValue'; +export * from './base/decoratorBase'; +export * from './base/iObservedObject'; +export * from './base/mutableStateMeta'; +export * from './base/stateUpdateLoop'; + +export * from './decorators/decoratorState'; +export * from './decorators/decoratorProp'; +export * from './decorators/decoratorLink'; +export * from './decorators/decoratorObjectLink'; +export * from './decorators/decoratorProvide'; +export * from './decorators/decoratorConsume'; +export * from './decorators/decoratorWatch'; +export * from './decorators/decoratorStorageLink'; +export * from './decorators/decoratorStorageProp'; + +export * from './storages/appStorage'; +export * from './storages/localStorage'; +export { memo, memo_intrinsic, memo_entry, memo_stable, memo_skip } from "@koalaui/runtime/annotations" +export { __memo_id_type, __memo_context_type } from '@koalaui/runtime' \ No newline at end of file diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/stateManagement/index.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/stateManagement/index.ts index 19b34449fb0..5b4fbbc10cf 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/stateManagement/index.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/stateManagement/index.ts @@ -15,4 +15,5 @@ export * from './decorators/decoratorStorageLink'; export * from './decorators/decoratorStorageProp'; export * from './storages/appStorage'; -export * from './storages/localStorage'; \ No newline at end of file +export * from './storages/localStorage'; +export { __memo_id_type, __memo_context_type } from '@koalaui/runtime' \ No newline at end of file diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/tsconfig-unmemoize.json b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/tsconfig-unmemoize.json index a353763bb04..13557c7440b 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/tsconfig-unmemoize.json +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/tsconfig-unmemoize.json @@ -43,6 +43,12 @@ "arkui.ani": [ "./src/ani/ts" ], + "arkui/*": [ + "./src/*" + ], + "@ohos.arkui.stateManagement": [ + "./src/stateManagement/index.ts" + ], "@ohos/animator": [ "./ohos.animator.ts" ], @@ -108,6 +114,7 @@ "exclude": [ "./src/component/arkts", "./src/component/arkts/ArkUIGeneratedNativeModule.ts", + "./src/stateManagement/index-arkts.ts", "./src/component/test_utils.ts", "./src/component/main.ts", "./src/external/arkts", diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/components.gni b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/components.gni new file mode 100644 index 00000000000..8514c15bf34 --- /dev/null +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/components.gni @@ -0,0 +1,335 @@ +# Copyright (c) 2025 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# DO NOT MODIFY THIS FILE MANUALLY. +# USE FOLLOWING COMMAND: +# ../tools/gen_gni.py --json arktsconfig-gn.json --output components.gni --gn-tool ../../../../../../../../prebuilts/build-tools/linux-x86/bin/gn + +arkui_files = [ + "arkui-preprocessed/arkui/Graphics.ets", + "arkui-preprocessed/arkui/NodeController.ets", + "arkui-preprocessed/arkui/Application.ets", + "arkui-preprocessed/arkui/ArkStructBase.ets", + "arkui-preprocessed/arkui/ArkCustomComponent.ets", + "arkui-preprocessed/arkui/RenderNode.ets", + "arkui-preprocessed/arkui/NodeContent.ets", + "arkui-preprocessed/arkui/ReusablePool.ets", + "arkui-preprocessed/arkui/ArkUIEntry.ets", + "arkui-preprocessed/arkui/ComponentBase.ets", + "arkui-preprocessed/arkui/stateOf.ets", + "arkui-preprocessed/arkui/LazyForEach.ets", + "arkui-preprocessed/arkui/UserView.ets", + "arkui-preprocessed/arkui/index.ets", + "arkui-preprocessed/arkui/ohos.arkui.node.ets", + "arkui-preprocessed/arkui/ohos.arkui.modifier.ets", + "arkui-preprocessed/arkui/DataChangeListener.ets", + "arkui-preprocessed/arkui/ArkComponentRoot.ets", + "arkui-preprocessed/arkui/NativePeerNode.ets", + "arkui-preprocessed/arkui/Content.ets", + "arkui-preprocessed/arkui/FrameNode.ets", + "arkui-preprocessed/arkui/CommonModifier.ets", + "arkui-preprocessed/arkui/PeerNode.ets", + "arkui-preprocessed/arkui/AttributeUpdater.ets", + "arkui-preprocessed/arkui/ani/arkts/ArkUIAniModule.ets", + "arkui-preprocessed/arkui/ani/arkts/index.ets", + "arkui-preprocessed/arkui/ani/arkts/ui_extension/ArkUIAniUiextensionModal.ets", + "arkui-preprocessed/arkui/ani/arkts/ui_extension/ArkUIAniUiextensionLoadLibraryHelp.ets", + "arkui-preprocessed/arkui/stateManagement/index.ets", + "arkui-preprocessed/arkui/stateManagement/base/decoratorBase.ets", + "arkui-preprocessed/arkui/stateManagement/base/mutableStateMeta.ets", + "arkui-preprocessed/arkui/stateManagement/base/backingValue.ets", + "arkui-preprocessed/arkui/stateManagement/base/stateUpdateLoop.ets", + "arkui-preprocessed/arkui/stateManagement/base/iObservedObject.ets", + "arkui-preprocessed/arkui/stateManagement/base/types.ets", + "arkui-preprocessed/arkui/stateManagement/storages/localStorage.ets", + "arkui-preprocessed/arkui/stateManagement/storages/appStorage.ets", + "arkui-preprocessed/arkui/stateManagement/decorators/decoratorLink.ets", + "arkui-preprocessed/arkui/stateManagement/decorators/decoratorStorageProp.ets", + "arkui-preprocessed/arkui/stateManagement/decorators/decoratorState.ets", + "arkui-preprocessed/arkui/stateManagement/decorators/decoratorStorageLink.ets", + "arkui-preprocessed/arkui/stateManagement/decorators/decoratorConsume.ets", + "arkui-preprocessed/arkui/stateManagement/decorators/decoratorProvide.ets", + "arkui-preprocessed/arkui/stateManagement/decorators/decoratorObjectLink.ets", + "arkui-preprocessed/arkui/stateManagement/decorators/decoratorProp.ets", + "arkui-preprocessed/arkui/stateManagement/decorators/decoratorWatch.ets", + "arkui-preprocessed/arkui/handwritten/ArkPageTransition.ets", + "arkui-preprocessed/arkui/handwritten/GridItemOpsHandWritten.ets", + "arkui-preprocessed/arkui/handwritten/ArkStateStyle.ets", + "arkui-preprocessed/arkui/handwritten/ArkAnimation.ets", + "arkui-preprocessed/arkui/handwritten/RepeatImpl.ets", + "arkui-preprocessed/arkui/handwritten/ArkNavPathStack.ets", + "arkui-preprocessed/arkui/handwritten/ArkPageTransitionData.ets", + "arkui-preprocessed/arkui/handwritten/index.ets", + "arkui-preprocessed/arkui/handwritten/ForeignFunctions.ets", + "arkui-preprocessed/arkui/handwritten/Router.ets", + "arkui-preprocessed/arkui/handwritten/TabsOpsHandWritten.ets", + "arkui-preprocessed/arkui/handwritten/modifiers/ArkImageModifier.ets", + "arkui-preprocessed/arkui/handwritten/modifiers/ArkBaseNode.ets", + "arkui-preprocessed/arkui/handwritten/modifiers/ArkTextNode.ets", + "arkui-preprocessed/arkui/handwritten/modifiers/ArkTextModifier.ets", + "arkui-preprocessed/arkui/handwritten/modifiers/ArkCommonModifier.ets", + "arkui-preprocessed/arkui/handwritten/modifiers/ArkImageNode.ets", + "arkui-preprocessed/arkui/external/arkts/index.ets", + "arkui-preprocessed/arkui/component/canvas.ets", + "arkui-preprocessed/arkui/component/abilityComponent.ets", + "arkui-preprocessed/arkui/component/row.ets", + "arkui-preprocessed/arkui/component/circle.ets", + "arkui-preprocessed/arkui/component/contextMenu.ets", + "arkui-preprocessed/arkui/component/alertDialog.ets", + "arkui-preprocessed/arkui/component/embeddedComponent.ets", + "arkui-preprocessed/arkui/component/patternLock.ets", + "arkui-preprocessed/arkui/component/timePicker.ets", + "arkui-preprocessed/arkui/component/hyperlink.ets", + "arkui-preprocessed/arkui/component/gridCol.ets", + "arkui-preprocessed/arkui/component/badge.ets", + "arkui-preprocessed/arkui/component/indicatorcomponent.ets", + "arkui-preprocessed/arkui/component/ellipse.ets", + "arkui-preprocessed/arkui/component/arkui-custom.ets", + "arkui-preprocessed/arkui/component/stdlib.ets", + "arkui-preprocessed/arkui/component/navigationExtender.ets", + "arkui-preprocessed/arkui/component/dataPanel.ets", + "arkui-preprocessed/arkui/component/edgeColors.ets", + "arkui-preprocessed/arkui/component/tabs.ets", + "arkui-preprocessed/arkui/component/alphabetIndexer.ets", + "arkui-preprocessed/arkui/component/loadingProgress.ets", + "arkui-preprocessed/arkui/component/GlobalScope.ets", + "arkui-preprocessed/arkui/component/gesture.ets", + "arkui-preprocessed/arkui/component/grid.ets", + "arkui-preprocessed/arkui/component/sdk-stubs.ets", + "arkui-preprocessed/arkui/component/arkui-external.ets", + "arkui-preprocessed/arkui/component/test_utils.ets", + "arkui-preprocessed/arkui/component/rating.ets", + "arkui-preprocessed/arkui/component/toggle.ets", + "arkui-preprocessed/arkui/component/arkui-componentutils.ets", + "arkui-preprocessed/arkui/component/ohos.app.ability.ets", + "arkui-preprocessed/arkui/component/flex.ets", + "arkui-preprocessed/arkui/component/base.ets", + "arkui-preprocessed/arkui/component/borderRadiuses.ets", + "arkui-preprocessed/arkui/component/image.ets", + "arkui-preprocessed/arkui/component/refresh.ets", + "arkui-preprocessed/arkui/component/marquee.ets", + "arkui-preprocessed/arkui/component/formLink.ets", + "arkui-preprocessed/arkui/component/textClock.ets", + "arkui-preprocessed/arkui/component/imageCommon.ets", + "arkui-preprocessed/arkui/component/customComponent.ets", + "arkui-preprocessed/arkui/component/slider.ets", + "arkui-preprocessed/arkui/component/textCommon.ets", + "arkui-preprocessed/arkui/component/path.ets", + "arkui-preprocessed/arkui/component/menu.ets", + "arkui-preprocessed/arkui/component/CallbackRegistry.ets", + "arkui-preprocessed/arkui/component/arkui-common.ets", + "arkui-preprocessed/arkui/component/particle.ets", + "arkui-preprocessed/arkui/component/sidebar.ets", + "arkui-preprocessed/arkui/component/animator.ets", + "arkui-preprocessed/arkui/component/polyline.ets", + "arkui-preprocessed/arkui/component/tabContent.ets", + "arkui-preprocessed/arkui/component/test-api.ets", + "arkui-preprocessed/arkui/component/scrollBar.ets", + "arkui-preprocessed/arkui/component/isolatedComponent.ets", + "arkui-preprocessed/arkui/component/locationButton.ets", + "arkui-preprocessed/arkui/component/menuItemGroup.ets", + "arkui-preprocessed/arkui/component/column.ets", + "arkui-preprocessed/arkui/component/listItem.ets", + "arkui-preprocessed/arkui/component/checkboxgroup.ets", + "arkui-preprocessed/arkui/component/rowSplit.ets", + "arkui-preprocessed/arkui/component/arkui-uniformtypedescriptor.ets", + "arkui-preprocessed/arkui/component/gridItem.ets", + "arkui-preprocessed/arkui/component/counter.ets", + "arkui-preprocessed/arkui/component/navRouter.ets", + "arkui-preprocessed/arkui/component/customDialogController.ets", + "arkui-preprocessed/arkui/component/blank.ets", + "arkui-preprocessed/arkui/component/enums.ets", + "arkui-preprocessed/arkui/component/rect.ets", + "arkui-preprocessed/arkui/component/divider.ets", + "arkui-preprocessed/arkui/component/lazyGridLayout.ets", + "arkui-preprocessed/arkui/component/navigation.ets", + "arkui-preprocessed/arkui/component/pluginComponent.ets", + "arkui-preprocessed/arkui/component/scroll.ets", + "arkui-preprocessed/arkui/component/stepper.ets", + "arkui-preprocessed/arkui/component/textTimer.ets", + "arkui-preprocessed/arkui/component/ohos.base.ets", + "arkui-preprocessed/arkui/component/swiper.ets", + "arkui-preprocessed/arkui/component/saveButton.ets", + "arkui-preprocessed/arkui/component/griditemops.ets", + "arkui-preprocessed/arkui/component/effectComponent.ets", + "arkui-preprocessed/arkui/component/wrapBuilder.ets", + "arkui-preprocessed/arkui/component/forEach.ets", + "arkui-preprocessed/arkui/component/matrix2d.ets", + "arkui-preprocessed/arkui/component/gauge.ets", + "arkui-preprocessed/arkui/component/columnSplit.ets", + "arkui-preprocessed/arkui/component/panel.ets", + "arkui-preprocessed/arkui/component/screen.ets", + "arkui-preprocessed/arkui/component/symbolSpan.ets", + "arkui-preprocessed/arkui/component/containerSpan.ets", + "arkui-preprocessed/arkui/component/navigator.ets", + "arkui-preprocessed/arkui/component/component3d.ets", + "arkui-preprocessed/arkui/component/edgeWidths.ets", + "arkui-preprocessed/arkui/component/lazyForEach.ets", + "arkui-preprocessed/arkui/component/point.ets", + "arkui-preprocessed/arkui/component/actionSheet.ets", + "arkui-preprocessed/arkui/component/arkui-intl.ets", + "arkui-preprocessed/arkui/component/windowScene.ets", + "arkui-preprocessed/arkui/component/staticComponents.ets", + "arkui-preprocessed/arkui/component/radio.ets", + "arkui-preprocessed/arkui/component/linearindicator.ets", + "arkui-preprocessed/arkui/component/richText.ets", + "arkui-preprocessed/arkui/component/shape.ets", + "arkui-preprocessed/arkui/component/text.ets", + "arkui-preprocessed/arkui/component/richEditor.ets", + "arkui-preprocessed/arkui/component/textPicker.ets", + "arkui-preprocessed/arkui/component/index.ets", + "arkui-preprocessed/arkui/component/folderStack.ets", + "arkui-preprocessed/arkui/component/progress.ets", + "arkui-preprocessed/arkui/component/waterFlow.ets", + "arkui-preprocessed/arkui/component/imageAnimator.ets", + "arkui-preprocessed/arkui/component/arkui-drawabledescriptor.ets", + "arkui-preprocessed/arkui/component/select.ets", + "arkui-preprocessed/arkui/component/units.ets", + "arkui-preprocessed/arkui/component/gridRow.ets", + "arkui-preprocessed/arkui/component/Events.ets", + "arkui-preprocessed/arkui/component/common.ets", + "arkui-preprocessed/arkui/component/withTheme.ets", + "arkui-preprocessed/arkui/component/textArea.ets", + "arkui-preprocessed/arkui/component/ArkoalaControl.ets", + "arkui-preprocessed/arkui/component/uiExtensionComponent.ets", + "arkui-preprocessed/arkui/component/mediaCachedImage.ets", + "arkui-preprocessed/arkui/component/repeat.ets", + "arkui-preprocessed/arkui/component/listItemGroup.ets", + "arkui-preprocessed/arkui/component/imageSpan.ets", + "arkui-preprocessed/arkui/component/checkbox.ets", + "arkui-preprocessed/arkui/component/rootScene.ets", + "arkui-preprocessed/arkui/component/resources.ets", + "arkui-preprocessed/arkui/component/stateManagement.ets", + "arkui-preprocessed/arkui/component/pasteButton.ets", + "arkui-preprocessed/arkui/component/datePicker.ets", + "arkui-preprocessed/arkui/component/stepperItem.ets", + "arkui-preprocessed/arkui/component/Declarations.ets", + "arkui-preprocessed/arkui/component/remoteWindow.ets", + "arkui-preprocessed/arkui/component/inspector.ets", + "arkui-preprocessed/arkui/component/contentSlot.ets", + "arkui-preprocessed/arkui/component/calendarPicker.ets", + "arkui-preprocessed/arkui/component/nodeContainer.ets", + "arkui-preprocessed/arkui/component/arkui-synthetics.ets", + "arkui-preprocessed/arkui/component/flowItem.ets", + "arkui-preprocessed/arkui/component/menuItem.ets", + "arkui-preprocessed/arkui/component/arkui-graphics-text.ets", + "arkui-preprocessed/arkui/component/arkui-matrix4.ets", + "arkui-preprocessed/arkui/component/EnumsImpl.ets", + "arkui-preprocessed/arkui/component/gridContainer.ets", + "arkui-preprocessed/arkui/component/pageTransition.ets", + "arkui-preprocessed/arkui/component/span.ets", + "arkui-preprocessed/arkui/component/textInput.ets", + "arkui-preprocessed/arkui/component/relativeContainer.ets", + "arkui-preprocessed/arkui/component/stack.ets", + "arkui-preprocessed/arkui/component/navDestination.ets", + "arkui-preprocessed/arkui/component/polygon.ets", + "arkui-preprocessed/arkui/component/calendar.ets", + "arkui-preprocessed/arkui/component/generatorSynthetic.ets", + "arkui-preprocessed/arkui/component/arkui-drawing.ets", + "arkui-preprocessed/arkui/component/securityComponent.ets", + "arkui-preprocessed/arkui/component/symbolglyph.ets", + "arkui-preprocessed/arkui/component/line.ets", + "arkui-preprocessed/arkui/component/button.ets", + "arkui-preprocessed/arkui/component/web.ets", + "arkui-preprocessed/arkui/component/video.ets", + "arkui-preprocessed/arkui/component/styledString.ets", + "arkui-preprocessed/arkui/component/list.ets", + "arkui-preprocessed/arkui/component/formComponent.ets", + "arkui-preprocessed/arkui/component/arkui-pixelmap.ets", + "arkui-preprocessed/arkui/component/focus.ets", + "arkui-preprocessed/arkui/component/animationExtender.ets", + "arkui-preprocessed/arkui/component/type-replacements.ets", + "arkui-preprocessed/arkui/component/customBuilder.ets", + "arkui-preprocessed/arkui/component/search.ets", + "arkui-preprocessed/arkui/component/rawfiledescriptor.ets", + "arkui-preprocessed/arkui/component/xcomponent.ets", + "arkui-preprocessed/arkui/component/qrcode.ets", + "arkui-preprocessed/arkui/component/arkui-wrapper-builder.ets", + "arkui-preprocessed/arkui/component/commonTsEtsApi.ets", + "arkui-preprocessed/arkui/component/getRectangleById.ets", + "arkui-preprocessed/arkui/component/arkui-uieffect.ets", + "arkui-preprocessed/arkui/component/tabsops.ets", + "arkui-preprocessed/arkui/component/peers/Deserializer.ets", + "arkui-preprocessed/arkui/component/peers/CallbackKind.ets", + "arkui-preprocessed/arkui/component/peers/CallbackTransformer.ets", + "arkui-preprocessed/arkui/component/peers/CallbacksChecker.ets", + "arkui-preprocessed/arkui/component/peers/CallbackDeserializeCall.ets", + "arkui-preprocessed/arkui/component/peers/Serializer.ets", + "arkui-preprocessed/arkui/component/arkts/type_check.ets", + "arkui-preprocessed/arkui/component/arkts/ArkUINativeModule.ets", + "arkui-preprocessed/arkui/component/arkts/TestNativeModule.ets", + "arkui-preprocessed/arkui/component/arkts/index.ets", + "arkui-preprocessed/arkui/component/arkts/ArkUIGeneratedNativeModule.ets", + "arkui-preprocessed/arkui/component/shared/ArkResource.ets", + "arkui-preprocessed/ohos.observer.ets", + "arkui-preprocessed/ohos.arkui.componentUtils.ets", + "arkui-preprocessed/ohos.font.ets", + "arkui-preprocessed/ohos.measure.ets", + "arkui-preprocessed/ohos.graphics.common2D.ets", + "arkui-preprocessed/ohos.arkui.UIContext.ets", + "arkui-preprocessed/ohos.animator.ets", + "arkui-preprocessed/ohos.router.ets", + "arkui-preprocessed/ohos.arkui.focusController.ets", +] + +arkui_path_keys = [ + "#components", + "#external", + "arkui.ani", + "arkui", + "arkui/*", + "@koalaui/interop", + "@koalaui/common", + "@koalaui/compat", + "@koalaui/runtime", + "@ohos.arkui.stateManagement", + "@koalaui/runtime/annotations", + "@ohos/animator", + "@ohos/arkui/UIContext", + "@ohos.arkui.UIContext", + "@ohos.arkui.node", + "@ohos/measure", + "@ohos/font/font", + "global/resource", + "@ohos/router", + "@ohos/observer", + "@ohos/graphics/common2D", + "@ohos/arkui/componentUtils", + "@ohos/arkui/focusController", +] + +arkui_path_values = [ + "arkui-preprocessed/arkui/component/arkts", + "arkui-preprocessed/arkui/external/arkts", + "arkui-preprocessed/arkui/ani/arkts", + "arkui-preprocessed/arkui", + "arkui-preprocessed/arkui/*", + "../interop/src/arkts", + "../incremental/common/src", + "../incremental/compat/src/arkts", + "../incremental/runtime/ets", + "arkui-preprocessed/arkui/stateManagement/index.ets", + "../incremental/runtime/annotations", + "arkui-preprocessed/ohos.animator.ets", + "arkui-preprocessed/ohos.arkui.UIContext.ets", + "arkui-preprocessed/ohos.arkui.UIContext.ets", + "arkui-preprocessed/arkui/ohos.arkui.node.ets", + "arkui-preprocessed/ohos.measure.ets", + "arkui-preprocessed/ohos.font.ets", + "arkui-preprocessed/global/resource/resource.ets", + "arkui-preprocessed/ohos.router.ets", + "arkui-preprocessed/ohos.observer.ets", + "arkui-preprocessed/ohos.graphics.common2D.ets", + "arkui-preprocessed/ohos.arkui.componentUtils.ets", + "arkui-preprocessed/ohos.arkui.focusController.ets", +] diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/package.json b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/package.json index c313a45aea2..377b2420ca9 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/package.json +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/package.json @@ -121,6 +121,7 @@ "clear-preview": "rm -rf previewer/*", "check-preview": "if [ -f previewer/previewer/common/bin/Previewer ]; then echo 'Previewer is downloaded.'; else echo 'Previewer is not downloaded.'; fi", "list-previewers": "node scripts/list-previewers.mjs", + "build:preprocess": "npm run compile --prefix ../../koala_mirror/ui2abc/annotate && node ../../koala_mirror/ui2abc/annotate annotate-config.json", "build:arkoala:ohos": "npm run build:arkoala:components:ohos && npm run link:arkoala:ohos", "build:arkoala:components:ohos": "npm run build:incremental:inc && npm run build:interop:inc && npm run build:arkui-common:inc && npm run build:arkui-components", "build:arkui-components": "npm run build:arkui-components --prefix arkui-ohos-preprocess", -- Gitee From 0baff0052135fa6630f6676b94320156023729f1 Mon Sep 17 00:00:00 2001 From: sunfei Date: Mon, 2 Jun 2025 11:17:16 +0800 Subject: [PATCH 3/5] use py annotate process script Signed-off-by: sunfei Change-Id: I28d259aac5d0341e6ddbf2cef6c554907bdfa66c --- .../arkts_frontend/arkoala/process_arkoala.py | 32 +---- .../koala_projects/arkoala-arkts/BUILD.gn | 23 ++-- .../incremental/runtime/BUILD.gn | 16 +-- .../koala_projects/tools/annotate.py | 122 ++++++++++++++++++ 4 files changed, 142 insertions(+), 51 deletions(-) create mode 100755 frameworks/bridge/arkts_frontend/koala_projects/tools/annotate.py diff --git a/frameworks/bridge/arkts_frontend/arkoala/process_arkoala.py b/frameworks/bridge/arkts_frontend/arkoala/process_arkoala.py index d7e133a0f9a..65621b74d94 100755 --- a/frameworks/bridge/arkts_frontend/arkoala/process_arkoala.py +++ b/frameworks/bridge/arkts_frontend/arkoala/process_arkoala.py @@ -35,44 +35,21 @@ from preprocess import merge_component class Paths: def __init__(self): self.project_path = None - self.node_path = None def parse_argv(argv) -> Paths: """ parse command line arguments """ - if len(argv) < 3: - print("Usage: python process.py ") + if len(argv) < 2: + print("Usage: python process.py ") sys.exit(1) path = Paths() path.project_path = os.path.abspath(argv[1]) - path.node_path = os.path.abspath(argv[2]) return path - -def run_process(env, path: Paths): - """ - run prcoess - """ - target_path = os.path.join( - path.project_path, "arkui-preprocessed") - if os.path.exists(target_path): - shutil.rmtree(target_path) - try: - ret = subprocess.run( - ["npm", "run", "build:preprocess", "--verbose"], - capture_output=True, - env = env, - text=True, - check=True - ) - print(f"build log:\n {ret.stdout}") - except subprocess.CalledProcessError as e: - print(f"error message: {e.stderr}") - def pre_processing(path: Paths): start_time = time.time() target_path = os.path.join( @@ -95,13 +72,8 @@ def pre_processing(path: Paths): def main(argv): path = parse_argv(argv) - env = os.environ.copy() - env_old_path = env["PATH"] - env["PATH"] = f"{path.node_path}:{env['PATH']}" os.chdir(path.project_path) - run_process(env, path) pre_processing(path) - env["PATH"] = env_old_path if __name__ == '__main__': diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/BUILD.gn b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/BUILD.gn index a6544ce8e06..38330c43dd3 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/BUILD.gn +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/BUILD.gn @@ -15,20 +15,27 @@ import("//build/config/components/ets_frontend/ets2abc_config.gni") import("//build/ohos.gni") import("./components.gni") -action("run_process") { +action("arkoala_annotate") { + outputs = [ "$target_out_dir/arkui-preprocessed" ] + + script = "../tools/annotate.py" + + args = [ + rebase_path("."), + rebase_path("annotate-config.json") + ] +} + +action("arkoala_process") { outputs = [ "$target_out_dir/ets" ] - node_version = "v16.20.2" - host_arch = "${host_os}-${host_cpu}" script = "../../arkoala/process_arkoala.py" - node_path = rebase_path( - "//prebuilts/build-tools/common/nodejs/node-${node_version}-${host_arch}/bin") - args = [ rebase_path("."), - node_path, ] + + deps = [ ":arkoala_annotate" ] } generate_static_abc("components_abc") { @@ -37,7 +44,7 @@ generate_static_abc("components_abc") { paths_keys = arkui_path_keys paths_values = arkui_path_values ui_enable = "True" - dependencies = [ ":run_process" ] + dependencies = [ ":arkoala_process" ] dst_file = target_out_dir + "/components.abc" out_puts = [ target_out_dir + "/components.abc" ] } diff --git a/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/BUILD.gn b/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/BUILD.gn index efc0801d561..5c53b1c2211 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/BUILD.gn +++ b/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/BUILD.gn @@ -15,22 +15,12 @@ import("//build/config/components/ets_frontend/ets2abc_config.gni") import("//build/ohos.gni") import("./runtime.gni") -action("run_annotate") { +action("runtime_annotate") { outputs = [ "$target_out_dir/ets" ] - node_version = "v16.20.2" - host_arch = "${host_os}-${host_cpu}" - script = "../../../run_binary.py" - - node_path = rebase_path( - "//prebuilts/build-tools/common/nodejs/node-${node_version}-${host_arch}/bin") + script = "../../tools/annotate.py" args = [ - "path-env=${node_path}", - "npm", - "run", - "annotate", - "--prefix", rebase_path("."), ] } @@ -42,7 +32,7 @@ generate_static_abc("runtime_abc") { paths_keys = koalaui_runtime_path_keys paths_values = koalaui_runtime_path_values ui_enable = "True" - dependencies = [ ":run_annotate" ] + dependencies = [ ":runtime_annotate" ] dst_file = target_out_dir + "/runtime.abc" out_puts = [ target_out_dir + "/runtime.abc" ] } diff --git a/frameworks/bridge/arkts_frontend/koala_projects/tools/annotate.py b/frameworks/bridge/arkts_frontend/koala_projects/tools/annotate.py new file mode 100755 index 00000000000..07bd7b1c773 --- /dev/null +++ b/frameworks/bridge/arkts_frontend/koala_projects/tools/annotate.py @@ -0,0 +1,122 @@ +#!/usr/bin/env python +# Copyright (c) 2025 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os +import glob +from pathlib import Path + +class Config: + def __init__(self): + self.inputDir = "./src" + self.outputDir = "./ets" + self.include = ["./src/**/*"] + self.exclude = [] + self.baseUrl = "." + self.fileExtension = None + +memoImport = "@koalaui/runtime/annotations" + +def convert_memo(text: str, memo_import: str) -> str: + replacements = { + "/** @memo */": "@memo", + "/** @memo:intrinsic */": "@memo_intrinsic", + "/** @memo:stable */": "@memo_stable", + "/** @memo:entry */": "@memo_entry", + "/** @skip:memo */": "@memo_skip" + } + result = text + for k, v in replacements.items(): + result = result.replace(k, v) + if result == text: + return result + return f'import {{ memo, memo_intrinsic, memo_entry, memo_stable, memo_skip }} from "{memo_import}"\n' + result + +def get_matching_files(patterns, root_dir): + matched = set() + for pattern in patterns: + # 把pattern相对路径转成绝对路径glob匹配 + full_pattern = os.path.join(root_dir, os.path.relpath(pattern, start=root_dir)) + files = glob.glob(full_pattern, recursive=True) + for f in files: + if os.path.isfile(f): + matched.add(os.path.abspath(f)) + return matched + +def main(options: Config): + os.chdir(options.baseUrl) + input_dir = os.path.abspath(options.inputDir) + output_dir = os.path.abspath(options.outputDir) + + # 递归获取所有文件,保持相对路径 + all_files = [] + for root, _, files in os.walk(input_dir): + for file in files: + full_path = os.path.join(root, file) + rel_path = os.path.relpath(full_path, input_dir) + all_files.append((full_path, rel_path)) + + include_files = get_matching_files(options.include, ".") + exclude_files = get_matching_files(options.exclude, ".") + + os.makedirs(output_dir, exist_ok=True) + + for full_path, rel_path in all_files: + abs_path = os.path.abspath(full_path) + + # 判断是否include且不在exclude里 + if abs_path in include_files and abs_path not in exclude_files: + with open(full_path, "r", encoding="utf-8") as f: + text = f.read() + new_text = convert_memo(text, memoImport) + + output_file = os.path.join(output_dir, rel_path) + if options.fileExtension: + base, _ = os.path.splitext(output_file) + output_file = base + options.fileExtension + + if os.path.exists(output_file): + with open(output_file, "r", encoding="utf-8") as f: + old_text = f.read() + if old_text == new_text: + # 内容没变不写文件 + continue + + print(f"Writing to: {output_file}") + os.makedirs(os.path.dirname(output_file), exist_ok=True) + with open(output_file, "w", encoding="utf-8") as f: + f.write(new_text) + else: + print(f"Skipped (not in include or excluded): {rel_path}") + +if __name__ == "__main__": + import sys + import json + + if len(sys.argv) == 3: + base_url_path = os.path.abspath(sys.argv[1]) + config_path = os.path.abspath(sys.argv[2]) + with open(config_path, "r", encoding="utf-8") as f: + config_data = json.load(f) + config = Config() + config.baseUrl = base_url_path + for k, v in config_data.items(): + setattr(config, k, v) + main(config) + elif len(sys.argv) == 2: + base_url_path = os.path.abspath(sys.argv[1]) + config = Config() + config.baseUrl = base_url_path + main(config) + else: + main(Config()) -- Gitee From e3e79390e861950024352b316203c6bff050aa82 Mon Sep 17 00:00:00 2001 From: sunfei Date: Thu, 5 Jun 2025 00:16:42 +0800 Subject: [PATCH 4/5] update build arkoala Signed-off-by: sunfei Change-Id: Ieff12bcff0bfbd01fc1f8b44ada4776fb9dc81a0 --- frameworks/bridge/arkts_frontend/BUILD.gn | 6 +- .../arkts_frontend/arkoala/process_arkoala.py | 14 +- .../koala_projects/arkoala-arkts/BUILD.gn | 26 ++-- .../arkoala-arkts/annotate-config.json | 2 +- .../arkoala-arkts/arktsconfig-gn.json | 19 ++- .../arkui-ohos/arktsconfig-unmemoized.json | 3 + .../arkoala-arkts/arkui-ohos/ohos.animator.ts | 2 +- .../arkui-ohos/ohos.arkui.componentUtils.ts | 2 +- .../arkui-ohos/ohos.arkui.focusController.ts | 2 +- .../arkui-ohos/ohos.arkui.graphics.ts | 3 + .../arkui-ohos/ohos.arkui.inspector.ts | 18 +++ .../arkui-ohos/ohos.arkui.observer.ts | 18 +++ .../arkoala-arkts/arkui-ohos/ohos.font.ts | 2 +- .../arkui-ohos/ohos.graphics.common2D.ts | 2 +- .../arkui-ohos/ohos.graphics.drawing.ts | 3 + .../arkoala-arkts/arkui-ohos/src/Content.ts | 2 +- .../arkui-ohos/src/ReusablePool.ts | 2 +- .../arkoala-arkts/arkui-ohos/src/UserView.ts | 2 +- .../ArkUIAniUiextensionLoadLibraryHelp.ts | 2 +- .../ui_extension/ArkUIAniUiextensionModal.ts | 2 +- .../src/component/ArkoalaControl.ts | 2 +- .../src/component/CallbackRegistry.ts | 2 +- .../arkui-ohos/src/component/Declarations.ts | 2 +- .../arkui-ohos/src/component/EnumsImpl.ts | 2 +- .../arkui-ohos/src/component/Events.ts | 2 +- .../src/component/arkts/ArkUINativeModule.ts | 2 +- .../src/component/arkts/TestNativeModule.ts | 2 +- .../arkui-ohos/src/component/arkui-common.ts | 2 +- .../arkui-ohos/src/component/arkui-intl.ts | 2 +- .../src/component/arkui-synthetics.ts | 2 +- .../component/arkui-uniformtypedescriptor.ts | 2 +- .../src/component/arkui-wrapper-builder.ts | 2 +- .../src/component/commonTsEtsApi.ts | 2 +- .../arkui-ohos/src/component/customBuilder.ts | 2 +- .../arkui-ohos/src/component/enums.ts | 2 +- .../arkui-ohos/src/component/forEach.ts | 2 +- .../src/component/ohos.app.ability.ts | 2 +- .../src/component/peers/CallbackKind.ts | 2 +- .../arkui-ohos/src/component/point.ts | 2 +- .../src/component/rawfiledescriptor.ts | 2 +- .../arkui-ohos/src/component/sdk-stubs.ts | 2 +- .../src/component/shared/ArkResource.ts | 2 +- .../src/component/stateManagement.ts | 2 +- .../arkui-ohos/src/component/stdlib.ts | 2 +- .../arkui-ohos/src/component/test_utils.ts | 2 +- .../src/handwritten/ForeignFunctions.ts | 2 +- .../handwritten/modifiers/ArkImageModifier.ts | 2 +- .../src/stateManagement/base/backingValue.ts | 2 +- .../stateManagement/base/mutableStateMeta.ts | 2 +- .../stateManagement/base/stateUpdateLoop.ts | 2 +- .../src/stateManagement/base/types.ts | 2 +- .../decorators/decoratorWatch.ts | 2 +- .../arkui-ohos/src/stateManagement/index.ts | 3 +- .../src/stateManagement/runtime/index-ts.ts | 16 +++ .../{index-arkts.ts => runtime/index.ts} | 17 --- .../arkui-ohos/tsconfig-unmemoize.json | 7 +- .../arkoala-arkts/components.gni | 125 +++++++++++++++++- .../incremental/runtime/arktsconfig-gn.json | 2 +- .../incremental/runtime/runtime.gni | 2 +- .../incremental/runtime/stateMgmt.ts | 1 - .../koala_projects/tools/annotate.py | 3 + .../koala_projects/tools/gen_gni.py | 72 ++++++---- 62 files changed, 325 insertions(+), 119 deletions(-) create mode 100644 frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/stateManagement/runtime/index-ts.ts rename frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/stateManagement/{index-arkts.ts => runtime/index.ts} (52%) diff --git a/frameworks/bridge/arkts_frontend/BUILD.gn b/frameworks/bridge/arkts_frontend/BUILD.gn index 932667f8c87..f333e927a3b 100644 --- a/frameworks/bridge/arkts_frontend/BUILD.gn +++ b/frameworks/bridge/arkts_frontend/BUILD.gn @@ -14,6 +14,7 @@ import("//build/ohos.gni") import("//foundation/arkui/ace_engine/ace_config.gni") import("./link_abc.gni") +import("./koala_projects/arkoala-arkts/components.gni") group("arkts_frontend_native_package") { deps = [ "koala_projects/arkoala-arkts/arkui-ohos/src/ani/native:ace_ani_native_package" ] @@ -21,13 +22,16 @@ group("arkts_frontend_native_package") { link_abc_files("arkoala_abc") { targets = [ - "koala_projects/arkoala-arkts:components_abc", "koala_projects/incremental/common:common_abc", "koala_projects/incremental/compat:compat_abc", "koala_projects/incremental/runtime:runtime_abc", "koala_projects/interop:interop_abc", ] + foreach(i, arkui_parts) { + targets += ["koala_projects/arkoala-arkts:components" + i + "_abc"] + } + output_name = "arkoala" } diff --git a/frameworks/bridge/arkts_frontend/arkoala/process_arkoala.py b/frameworks/bridge/arkts_frontend/arkoala/process_arkoala.py index 65621b74d94..bc1adef6bd1 100755 --- a/frameworks/bridge/arkts_frontend/arkoala/process_arkoala.py +++ b/frameworks/bridge/arkts_frontend/arkoala/process_arkoala.py @@ -59,12 +59,18 @@ def pre_processing(path: Paths): generated_path = os.path.join(target_path, "src", "component") merge_component(handwritten_path, generated_path) - shutil.rmtree(handwritten_path) + if os.path.exists(handwritten_path): + shutil.rmtree(handwritten_path) + src_path = os.path.join(target_path, "src") + dist_path = os.path.join(target_path, "arkui") # rename "src" to "arkui" - shutil.move(os.path.join(target_path, "src"), os.path.join(target_path, "arkui")) + if os.path.exists(src_path) and (not os.path.exists(dist_path)): + shutil.move(src_path, dist_path) # rename "index-arkts.ets" to "index.ets" - shutil.move(os.path.join(target_path, "arkui", "stateManagement", "index-arkts.ets"), - os.path.join(target_path, "arkui", "stateManagement", "index.ets")) + # stateMgmt_index = os.path.join(target_path, "arkui", "stateManagement", "index-arkts.ets") + # if os.path.exists(stateMgmt_index): + # shutil.move(stateMgmt_index, + # os.path.join(target_path, "arkui", "stateManagement", "index.ets")) end_time = time.time() elapsed_time = end_time - start_time print(f"Arkoala: preprocess time: {elapsed_time:.2f} seconds") diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/BUILD.gn b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/BUILD.gn index 38330c43dd3..01d88a9f137 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/BUILD.gn +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/BUILD.gn @@ -35,17 +35,21 @@ action("arkoala_process") { rebase_path("."), ] - deps = [ ":arkoala_annotate" ] + deps = [ + ":arkoala_annotate", + "../incremental/runtime:runtime_annotate" + ] } -generate_static_abc("components_abc") { - base_url = "./arkui-preprocessed" - files = arkui_files - paths_keys = arkui_path_keys - paths_values = arkui_path_values - ui_enable = "True" - dependencies = [ ":arkoala_process" ] - dst_file = target_out_dir + "/components.abc" - out_puts = [ target_out_dir + "/components.abc" ] +foreach(i, arkui_parts) { + generate_static_abc("components" + i + "_abc") { + base_url = "./arkui-preprocessed" + files = arkui_files_array[i - 1] + paths_keys = arkui_path_keys + paths_values = arkui_path_values + ui_enable = "True" + dependencies = [ ":arkoala_process" ] + dst_file = target_out_dir + "/components" + i + ".abc" + out_puts = [ target_out_dir + "/components" + i + ".abc" ] + } } - diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/annotate-config.json b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/annotate-config.json index 57f4c998bfc..693f93e5fd5 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/annotate-config.json +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/annotate-config.json @@ -8,8 +8,8 @@ "./arkui-ohos/src/ani/ts/*.ts", "./arkui-ohos/src/peers/*.ts", "./arkui-ohos/src/component/ts/*.ts", + "./arkui-ohos/src/stateManagement/runtime/index-ts.ts", "./arkui-ohos/src/external/ts/**/*.ts", - "./arkui-ohos/src/stateManagement/index.ts", "./arkui-ohos/build/**/*.ts" ], "fileExtension": ".ets" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arktsconfig-gn.json b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arktsconfig-gn.json index d6dc57db623..1fa0d062a36 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arktsconfig-gn.json +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arktsconfig-gn.json @@ -34,6 +34,9 @@ "@ohos.arkui.stateManagement": [ "./arkui/stateManagement/index.ets" ], + "arkui.stateManagement.runtime": [ + "./arkui/stateManagement/runtime" + ], "@koalaui/runtime/annotations": [ "../../incremental/runtime/annotations" ], @@ -61,12 +64,24 @@ "@ohos/router": [ "ohos.router.ets" ], - "@ohos/observer": [ - "ohos.observer.ets" + "@ohos/arkui/observer": [ + "ohos.arkui.observer.ets" ], "@ohos/graphics/common2D": [ "ohos.graphics.common2D.ets" ], + "@ohos/graphics/drawing": [ + "ohos.graphics.drawing.ets" + ], + "@ohos/arkui/graphics": [ + "ohos.arkui.graphics.ets" + ], + "@ohos/promptAction": [ + "ohos.promptAction.ets" + ], + "@ohos/arkui/inspector": [ + "ohos.arkui.inspector.ets" + ], "@ohos/arkui/componentUtils": [ "ohos.arkui.componentUtils.ets" ], diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/arktsconfig-unmemoized.json b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/arktsconfig-unmemoized.json index 11a90a2da21..8dc12ed1016 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/arktsconfig-unmemoized.json +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/arktsconfig-unmemoized.json @@ -64,6 +64,9 @@ "@ohos.arkui.stateManagement": [ "./stateManagement/index.ts" ], + "arkui.stateManagement.runtime": [ + "./stateManagement/runtime/index-ts.ts" + ], "@ohos.arkui.node": [ "./ohos.arkui.node.ts" ], diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.animator.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.animator.ts index 18cdc78a6af..438228fd2ba 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.animator.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.animator.ts @@ -14,7 +14,7 @@ */ // avoid memo-plugin import issue -import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; +import { __memo_id_type, __memo_context_type } from "arkui.stateManagement.runtime"; export interface AnimatorOptions { duration: number; diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.arkui.componentUtils.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.arkui.componentUtils.ts index b474a4dd159..389afeb860b 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.arkui.componentUtils.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.arkui.componentUtils.ts @@ -14,7 +14,7 @@ */ // avoid memo-plugin import issue -import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; +import { __memo_id_type, __memo_context_type } from "arkui.stateManagement.runtime"; export declare namespace componentUtils { export interface Size { diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.arkui.focusController.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.arkui.focusController.ts index e1aa675290e..e8ebad0b9ff 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.arkui.focusController.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.arkui.focusController.ts @@ -14,7 +14,7 @@ */ // avoid memo-plugin import issue -import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; +import { __memo_id_type, __memo_context_type } from "arkui.stateManagement.runtime"; import { KeyProcessingMode } from "arkui/component/focus" export declare namespace focusController { diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.arkui.graphics.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.arkui.graphics.ts index 98ebf676783..98733bd826f 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.arkui.graphics.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.arkui.graphics.ts @@ -13,6 +13,9 @@ * limitations under the License. */ +// avoid memo-plugin import issue +import { __memo_id_type, __memo_context_type } from "arkui.stateManagement.runtime"; + import { DrawContext } from "arkui/Graphics"; import { pointer } from "@koalaui/interop"; diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.arkui.inspector.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.arkui.inspector.ts index 127a678dd5b..12f71d75e66 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.arkui.inspector.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.arkui.inspector.ts @@ -1,3 +1,21 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// avoid memo-plugin import issue +import { __memo_id_type, __memo_context_type } from "arkui.stateManagement.runtime"; + declare namespace inspector { export interface ComponentObserver { on(type: 'layout' | 'draw', callback: () => void): void; diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.arkui.observer.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.arkui.observer.ts index e26642c6b32..0df071f02af 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.arkui.observer.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.arkui.observer.ts @@ -1,3 +1,21 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// avoid memo-plugin import issue +import { __memo_id_type, __memo_context_type } from "arkui.stateManagement.runtime"; + export declare namespace uiObserver { export class DensityInfo { density: number; diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.font.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.font.ts index e9c5d464998..0fc4a53f637 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.font.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.font.ts @@ -14,7 +14,7 @@ */ // avoid memo-plugin import issue -import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; +import { __memo_id_type, __memo_context_type } from "arkui.stateManagement.runtime"; import { Resource } from "global/resource" import { GlobalScope_ohos_font } from "arkui/component/arkui-external" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.graphics.common2D.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.graphics.common2D.ts index 344fb7d3eb0..dfb46b6ce77 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.graphics.common2D.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.graphics.common2D.ts @@ -14,7 +14,7 @@ */ // avoid memo-plugin import issue -import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; +import { __memo_id_type, __memo_context_type } from "arkui.stateManagement.runtime"; export declare namespace common2D { export interface Rect { diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.graphics.drawing.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.graphics.drawing.ts index aa2d0833dfe..592c7f63c57 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.graphics.drawing.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.graphics.drawing.ts @@ -13,6 +13,9 @@ * limitations under the License. */ +// avoid memo-plugin import issue +import { __memo_id_type, __memo_context_type } from "arkui.stateManagement.runtime"; + export declare namespace drawing { export class Canvas { } } \ No newline at end of file diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/Content.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/Content.ts index f778b09e249..ffbfa5b10ee 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/Content.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/Content.ts @@ -17,7 +17,7 @@ // WARNING! THIS FILE IS AUTO-GENERATED, DO NOT MAKE CHANGES, THEY WILL BE LOST ON NEXT GENERATION! // avoid memo-plugin import issue -import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; +import { __memo_id_type, __memo_context_type } from "arkui.stateManagement.runtime"; import { int32, int64, float32 } from "@koalaui/common" import { KInt, KPointer, KBoolean, NativeBuffer, KStringPtr, wrapCallback } from "@koalaui/interop" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/ReusablePool.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/ReusablePool.ts index b5d727993ea..3410cfb01c9 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/ReusablePool.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/ReusablePool.ts @@ -14,7 +14,7 @@ */ // avoid memo-plugin import issue -import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; +import { __memo_id_type, __memo_context_type } from "arkui.stateManagement.runtime"; import { Disposable, scheduleCallback } from "@koalaui/runtime"; diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/UserView.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/UserView.ts index f3ce3dd57c0..398179624f2 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/UserView.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/UserView.ts @@ -14,7 +14,7 @@ */ // avoid memo-plugin import issue -import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; +import { __memo_id_type, __memo_context_type } from "arkui.stateManagement.runtime"; import { InteropNativeModule } from "@koalaui/interop" import { int32, int8Array } from "@koalaui/common" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/ani/arkts/ui_extension/ArkUIAniUiextensionLoadLibraryHelp.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/ani/arkts/ui_extension/ArkUIAniUiextensionLoadLibraryHelp.ts index 3c60f53e8be..9629911e16d 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/ani/arkts/ui_extension/ArkUIAniUiextensionLoadLibraryHelp.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/ani/arkts/ui_extension/ArkUIAniUiextensionLoadLibraryHelp.ts @@ -14,7 +14,7 @@ */ // avoid memo-plugin import issue -import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; +import { __memo_id_type, __memo_context_type } from "arkui.stateManagement.runtime"; import { KLong, KInt, InteropNativeModule } from "@koalaui/interop" export class ArkUIAniUiextensionLoadLibraryHelp { diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/ani/arkts/ui_extension/ArkUIAniUiextensionModal.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/ani/arkts/ui_extension/ArkUIAniUiextensionModal.ts index f0108d6b2bd..8bd13a775af 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/ani/arkts/ui_extension/ArkUIAniUiextensionModal.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/ani/arkts/ui_extension/ArkUIAniUiextensionModal.ts @@ -14,7 +14,7 @@ */ // avoid memo-plugin import issue -import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; +import { __memo_id_type, __memo_context_type } from "arkui.stateManagement.runtime"; import { KLong, KInt, InteropNativeModule } from "@koalaui/interop" import Want from "@ohos.app.ability.Want" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/ArkoalaControl.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/ArkoalaControl.ts index 31f70fa4718..0a7684658cb 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/ArkoalaControl.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/ArkoalaControl.ts @@ -14,7 +14,7 @@ */ // avoid memo-plugin import issue -import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; +import { __memo_id_type, __memo_context_type } from "arkui.stateManagement.runtime"; import { ArkoalaControl } from "./Declarations" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/CallbackRegistry.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/CallbackRegistry.ts index 48b2756d799..33f8d3ce584 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/CallbackRegistry.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/CallbackRegistry.ts @@ -14,7 +14,7 @@ */ // avoid memo-plugin import issue -import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; +import { __memo_id_type, __memo_context_type } from "arkui.stateManagement.runtime"; import { int32 } from "@koalaui/common" import { KUint8ArrayPtr } from "@koalaui/interop" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/Declarations.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/Declarations.ts index ad82c37ffd3..32bfef2a939 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/Declarations.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/Declarations.ts @@ -14,7 +14,7 @@ */ // avoid memo-plugin import issue -import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; +import { __memo_id_type, __memo_context_type } from "arkui.stateManagement.runtime"; import { int32 } from "@koalaui/common" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/EnumsImpl.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/EnumsImpl.ts index 12b03f1dd8e..1a75823dc7f 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/EnumsImpl.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/EnumsImpl.ts @@ -14,7 +14,7 @@ */ // avoid memo-plugin import issue -import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; +import { __memo_id_type, __memo_context_type } from "arkui.stateManagement.runtime"; import { int32, float32 } from "@koalaui/common" export enum PointerStyle { diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/Events.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/Events.ts index 6f87d78039e..a7e0ff4f14d 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/Events.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/Events.ts @@ -14,7 +14,7 @@ */ // avoid memo-plugin import issue -import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; +import { __memo_id_type, __memo_context_type } from "arkui.stateManagement.runtime"; export function checkEvents() { customEventsChecker() diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/arkts/ArkUINativeModule.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/arkts/ArkUINativeModule.ts index a291b4c8654..25f45dbb806 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/arkts/ArkUINativeModule.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/arkts/ArkUINativeModule.ts @@ -14,7 +14,7 @@ */ // avoid memo-plugin import issue -import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; +import { __memo_id_type, __memo_context_type } from "arkui.stateManagement.runtime"; import { KInt, KLong, KBoolean, KFloat, KUInt, KStringPtr, KPointer, KNativePointer, KInt32ArrayPtr, KUint8ArrayPtr, KFloat32ArrayPtr, pointer, KInteropReturnBuffer, KSerializerBuffer, loadNativeModuleLibrary, NativeBuffer } from "@koalaui/interop" import { int32, int64, float32 } from "@koalaui/common" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/arkts/TestNativeModule.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/arkts/TestNativeModule.ts index 9c0d0bcdad2..e42b96c43fa 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/arkts/TestNativeModule.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/arkts/TestNativeModule.ts @@ -14,7 +14,7 @@ */ // avoid memo-plugin import issue -import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; +import { __memo_id_type, __memo_context_type } from "arkui.stateManagement.runtime"; import { KInt, KLong, KBoolean, KFloat, KUInt, KStringPtr, KPointer, KNativePointer, KInt32ArrayPtr, KUint8ArrayPtr, KFloat32ArrayPtr, pointer, KInteropReturnBuffer, KSerializerBuffer, loadNativeModuleLibrary, NativeBuffer } from "@koalaui/interop" import { int32, int64, float32 } from "@koalaui/common" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/arkui-common.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/arkui-common.ts index c6fe04f05cf..97fae5e9f94 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/arkui-common.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/arkui-common.ts @@ -17,7 +17,7 @@ // WARNING! THIS FILE IS AUTO-GENERATED, DO NOT MAKE CHANGES, THEY WILL BE LOST ON NEXT GENERATION! // avoid memo-plugin import issue -import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; +import { __memo_id_type, __memo_context_type } from "arkui.stateManagement.runtime"; import { int32, int64, float32 } from "@koalaui/common" import { KInt, KPointer, KBoolean, NativeBuffer, KStringPtr, wrapCallback } from "@koalaui/interop" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/arkui-intl.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/arkui-intl.ts index 2e6dd37a310..927bea28ec3 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/arkui-intl.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/arkui-intl.ts @@ -17,7 +17,7 @@ // WARNING! THIS FILE IS AUTO-GENERATED, DO NOT MAKE CHANGES, THEY WILL BE LOST ON NEXT GENERATION! // avoid memo-plugin import issue -import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; +import { __memo_id_type, __memo_context_type } from "arkui.stateManagement.runtime"; import { int32, int64, float32 } from "@koalaui/common" import { KInt, KPointer, KBoolean, NativeBuffer, KStringPtr, wrapCallback } from "@koalaui/interop" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/arkui-synthetics.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/arkui-synthetics.ts index 7891439250f..4eabc82b5a1 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/arkui-synthetics.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/arkui-synthetics.ts @@ -17,7 +17,7 @@ // WARNING! THIS FILE IS AUTO-GENERATED, DO NOT MAKE CHANGES, THEY WILL BE LOST ON NEXT GENERATION! // avoid memo-plugin import issue -import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; +import { __memo_id_type, __memo_context_type } from "arkui.stateManagement.runtime"; import { int32, int64, float32 } from "@koalaui/common" import { KInt, KPointer, KBoolean, NativeBuffer, KStringPtr, wrapCallback } from "@koalaui/interop" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/arkui-uniformtypedescriptor.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/arkui-uniformtypedescriptor.ts index 01ef791cca0..54c47b10b5b 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/arkui-uniformtypedescriptor.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/arkui-uniformtypedescriptor.ts @@ -17,7 +17,7 @@ // WARNING! THIS FILE IS AUTO-GENERATED, DO NOT MAKE CHANGES, THEY WILL BE LOST ON NEXT GENERATION! // avoid memo-plugin import issue -import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; +import { __memo_id_type, __memo_context_type } from "arkui.stateManagement.runtime"; import { int32, int64, float32 } from "@koalaui/common" import { KInt, KPointer, KBoolean, NativeBuffer, KStringPtr, wrapCallback } from "@koalaui/interop" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/arkui-wrapper-builder.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/arkui-wrapper-builder.ts index 5d96a3f1510..979b9a1114d 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/arkui-wrapper-builder.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/arkui-wrapper-builder.ts @@ -17,7 +17,7 @@ // WARNING! THIS FILE IS AUTO-GENERATED, DO NOT MAKE CHANGES, THEY WILL BE LOST ON NEXT GENERATION! // avoid memo-plugin import issue -import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; +import { __memo_id_type, __memo_context_type } from "arkui.stateManagement.runtime"; import { int32, int64, float32 } from "@koalaui/common" import { KInt, KPointer, KBoolean, NativeBuffer, KStringPtr, wrapCallback } from "@koalaui/interop" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/commonTsEtsApi.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/commonTsEtsApi.ts index ef91d53d3c9..140223bfb3a 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/commonTsEtsApi.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/commonTsEtsApi.ts @@ -17,7 +17,7 @@ // WARNING! THIS FILE IS AUTO-GENERATED, DO NOT MAKE CHANGES, THEY WILL BE LOST ON NEXT GENERATION! // avoid memo-plugin import issue -import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; +import { __memo_id_type, __memo_context_type } from "arkui.stateManagement.runtime"; import { int32, int64, float32 } from "@koalaui/common" import { KInt, KPointer, KBoolean, NativeBuffer, KStringPtr, wrapCallback } from "@koalaui/interop" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/customBuilder.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/customBuilder.ts index 9f02d627002..04460aaf67f 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/customBuilder.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/customBuilder.ts @@ -17,7 +17,7 @@ // WARNING! THIS FILE IS AUTO-GENERATED, DO NOT MAKE CHANGES, THEY WILL BE LOST ON NEXT GENERATION! // avoid memo-plugin import issue -import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; +import { __memo_id_type, __memo_context_type } from "arkui.stateManagement.runtime"; import { int32, int64, float32 } from "@koalaui/common" import { KInt, KPointer, KBoolean, NativeBuffer, KStringPtr, wrapCallback } from "@koalaui/interop" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/enums.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/enums.ts index b8dfdd7de2d..69aec033dbe 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/enums.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/enums.ts @@ -17,7 +17,7 @@ // WARNING! THIS FILE IS AUTO-GENERATED, DO NOT MAKE CHANGES, THEY WILL BE LOST ON NEXT GENERATION! // avoid memo-plugin import issue -import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; +import { __memo_id_type, __memo_context_type } from "arkui.stateManagement.runtime"; import { int32, int64, float32 } from "@koalaui/common" import { KInt, KPointer, KBoolean, NativeBuffer, KStringPtr, wrapCallback } from "@koalaui/interop" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/forEach.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/forEach.ts index b0ab6d3b830..24d52dc7a79 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/forEach.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/forEach.ts @@ -17,7 +17,7 @@ // HANDWRITTEN, DO NOT REGENERATE // avoid memo-plugin import issue -import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; +import { __memo_id_type, __memo_context_type } from "arkui.stateManagement.runtime"; import { int32, hashCodeFromString, KoalaCallsiteKey } from "@koalaui/common" import { RepeatByArray } from "@koalaui/runtime" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/ohos.app.ability.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/ohos.app.ability.ts index 45a077ab5ae..87a0c0d6a3c 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/ohos.app.ability.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/ohos.app.ability.ts @@ -16,7 +16,7 @@ // WARNING! THIS FILE IS AUTO-GENERATED, DO NOT MAKE CHANGES, THEY WILL BE LOST ON NEXT GENERATION! // avoid memo-plugin import issue -import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; +import { __memo_id_type, __memo_context_type } from "arkui.stateManagement.runtime"; import { int32, int64, float32 } from "@koalaui/common" import { KInt, KPointer, KBoolean, NativeBuffer, KStringPtr, wrapCallback } from "@koalaui/interop" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/peers/CallbackKind.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/peers/CallbackKind.ts index 638fef4e5c7..fec3e437f13 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/peers/CallbackKind.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/peers/CallbackKind.ts @@ -14,7 +14,7 @@ */ // avoid memo-plugin import issue -import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; +import { __memo_id_type, __memo_context_type } from "arkui.stateManagement.runtime"; import { int32, float32 } from "@koalaui/common" export enum CallbackKind { diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/point.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/point.ts index 501bfaf7b24..25c485b93c6 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/point.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/point.ts @@ -17,7 +17,7 @@ // WARNING! THIS FILE IS AUTO-GENERATED, DO NOT MAKE CHANGES, THEY WILL BE LOST ON NEXT GENERATION! // avoid memo-plugin import issue -import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; +import { __memo_id_type, __memo_context_type } from "arkui.stateManagement.runtime"; import { int32, int64, float32 } from "@koalaui/common" import { KInt, KPointer, KBoolean, NativeBuffer, KStringPtr, wrapCallback } from "@koalaui/interop" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/rawfiledescriptor.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/rawfiledescriptor.ts index ff430abd523..184e75b59eb 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/rawfiledescriptor.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/rawfiledescriptor.ts @@ -17,7 +17,7 @@ // WARNING! THIS FILE IS AUTO-GENERATED, DO NOT MAKE CHANGES, THEY WILL BE LOST ON NEXT GENERATION! // avoid memo-plugin import issue -import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; +import { __memo_id_type, __memo_context_type } from "arkui.stateManagement.runtime"; import { int32, int64, float32 } from "@koalaui/common" import { KInt, KPointer, KBoolean, NativeBuffer, KStringPtr, wrapCallback } from "@koalaui/interop" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/sdk-stubs.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/sdk-stubs.ts index e776448d4b3..72575f7d18c 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/sdk-stubs.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/sdk-stubs.ts @@ -17,7 +17,7 @@ // WARNING! THIS FILE IS AUTO-GENERATED, DO NOT MAKE CHANGES, THEY WILL BE LOST ON NEXT GENERATION! // avoid memo-plugin import issue -import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; +import { __memo_id_type, __memo_context_type } from "arkui.stateManagement.runtime"; import { int32, int64, float32 } from "@koalaui/common" import { KInt, KPointer, KBoolean, NativeBuffer, KStringPtr, wrapCallback } from "@koalaui/interop" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/shared/ArkResource.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/shared/ArkResource.ts index e527f3de565..d5dce54c3cc 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/shared/ArkResource.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/shared/ArkResource.ts @@ -14,7 +14,7 @@ */ // avoid memo-plugin import issue -import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; +import { __memo_id_type, __memo_context_type } from "arkui.stateManagement.runtime"; export interface ArkResource { name: string, diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/stateManagement.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/stateManagement.ts index cfa9b807923..27e0c4466f1 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/stateManagement.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/stateManagement.ts @@ -17,7 +17,7 @@ // WARNING! THIS FILE IS AUTO-GENERATED, DO NOT MAKE CHANGES, THEY WILL BE LOST ON NEXT GENERATION! // avoid memo-plugin import issue -import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; +import { __memo_id_type, __memo_context_type } from "arkui.stateManagement.runtime"; import { int32, int64, float32 } from "@koalaui/common" import { KInt, KPointer, KBoolean, NativeBuffer, KStringPtr, wrapCallback } from "@koalaui/interop" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/stdlib.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/stdlib.ts index 51d8765b6c7..b6b41f7d0ee 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/stdlib.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/stdlib.ts @@ -17,7 +17,7 @@ // WARNING! THIS FILE IS AUTO-GENERATED, DO NOT MAKE CHANGES, THEY WILL BE LOST ON NEXT GENERATION! // avoid memo-plugin import issue -import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; +import { __memo_id_type, __memo_context_type } from "arkui.stateManagement.runtime"; import { int32, int64, float32 } from "@koalaui/common" import { KInt, KPointer, KBoolean, NativeBuffer, KStringPtr, wrapCallback } from "@koalaui/interop" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/test_utils.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/test_utils.ts index 041fd3b275a..17ac2e0d26e 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/test_utils.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/test_utils.ts @@ -14,7 +14,7 @@ */ // avoid memo-plugin import issue -import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; +import { __memo_id_type, __memo_context_type } from "arkui.stateManagement.runtime"; export function assertEquals(name: String, expected: E, actual: A) { if (expected != actual) { diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/ForeignFunctions.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/ForeignFunctions.ts index 794b736c0f8..c603473236d 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/ForeignFunctions.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/ForeignFunctions.ts @@ -14,7 +14,7 @@ */ // avoid memo-plugin import issue -import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; +import { __memo_id_type, __memo_context_type } from "arkui.stateManagement.runtime"; import { int32 } from "@koalaui/common" import { pointer, nullptr, InteropNativeModule, SerializerBase } from "@koalaui/interop" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/modifiers/ArkImageModifier.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/modifiers/ArkImageModifier.ts index 60dbd44e71a..74d1953944d 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/modifiers/ArkImageModifier.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/modifiers/ArkImageModifier.ts @@ -14,7 +14,7 @@ */ // avoid memo-plugin import issue -import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; +import { __memo_id_type, __memo_context_type } from "arkui.stateManagement.runtime"; import { AttributeModifier, ImageAttribute } from "../.."; import { ArkCommonAttributeSet } from "./ArkCommonModifier"; diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/stateManagement/base/backingValue.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/stateManagement/base/backingValue.ts index f68a969f8cd..3c6fa974f35 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/stateManagement/base/backingValue.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/stateManagement/base/backingValue.ts @@ -19,7 +19,7 @@ */ // avoid memo-plugin import issue -import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; +import { __memo_id_type, __memo_context_type } from "arkui.stateManagement.runtime"; export class BackingValue { private current_ : T; diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/stateManagement/base/mutableStateMeta.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/stateManagement/base/mutableStateMeta.ts index 7a13bda35e2..dd054c7f324 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/stateManagement/base/mutableStateMeta.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/stateManagement/base/mutableStateMeta.ts @@ -14,7 +14,7 @@ */ // avoid memo-plugin import issue -import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; +import { __memo_id_type, __memo_context_type } from "arkui.stateManagement.runtime"; import { int32 } from '@koalaui/common'; import { MutableState, mutableState } from '@koalaui/runtime'; diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/stateManagement/base/stateUpdateLoop.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/stateManagement/base/stateUpdateLoop.ts index d31103d14d3..c411acbbe4e 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/stateManagement/base/stateUpdateLoop.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/stateManagement/base/stateUpdateLoop.ts @@ -14,7 +14,7 @@ */ // avoid memo-plugin import issue -import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; +import { __memo_id_type, __memo_context_type } from "arkui.stateManagement.runtime"; export class StateUpdateLoop { private static callbacks: Array<() => void> = new Array<() => void>(); diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/stateManagement/base/types.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/stateManagement/base/types.ts index 8658ee76c09..1de052943f9 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/stateManagement/base/types.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/stateManagement/base/types.ts @@ -14,7 +14,7 @@ */ // avoid memo-plugin import issue -import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; +import { __memo_id_type, __memo_context_type } from "arkui.stateManagement.runtime"; /** define base Types for decorators diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/stateManagement/decorators/decoratorWatch.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/stateManagement/decorators/decoratorWatch.ts index 3bb111b7e2f..e1ecc3408d0 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/stateManagement/decorators/decoratorWatch.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/stateManagement/decorators/decoratorWatch.ts @@ -14,7 +14,7 @@ */ // avoid memo-plugin import issue -import { __memo_id_type, __memo_context_type } from "@ohos.arkui.stateManagement"; +import { __memo_id_type, __memo_context_type } from "arkui.stateManagement.runtime"; import { int32 } from "@koalaui/common"; diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/stateManagement/index.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/stateManagement/index.ts index 5b4fbbc10cf..19b34449fb0 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/stateManagement/index.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/stateManagement/index.ts @@ -15,5 +15,4 @@ export * from './decorators/decoratorStorageLink'; export * from './decorators/decoratorStorageProp'; export * from './storages/appStorage'; -export * from './storages/localStorage'; -export { __memo_id_type, __memo_context_type } from '@koalaui/runtime' \ No newline at end of file +export * from './storages/localStorage'; \ No newline at end of file diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/stateManagement/runtime/index-ts.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/stateManagement/runtime/index-ts.ts new file mode 100644 index 00000000000..82bef888b0f --- /dev/null +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/stateManagement/runtime/index-ts.ts @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export { __memo_id_type, __memo_context_type } from '@koalaui/runtime' \ No newline at end of file diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/stateManagement/index-arkts.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/stateManagement/runtime/index.ts similarity index 52% rename from frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/stateManagement/index-arkts.ts rename to frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/stateManagement/runtime/index.ts index 3578d3113c3..13ec5e2cf01 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/stateManagement/index-arkts.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/stateManagement/runtime/index.ts @@ -13,23 +13,6 @@ * limitations under the License. */ -export * from './base/backingValue'; -export * from './base/decoratorBase'; -export * from './base/iObservedObject'; -export * from './base/mutableStateMeta'; -export * from './base/stateUpdateLoop'; -export * from './decorators/decoratorState'; -export * from './decorators/decoratorProp'; -export * from './decorators/decoratorLink'; -export * from './decorators/decoratorObjectLink'; -export * from './decorators/decoratorProvide'; -export * from './decorators/decoratorConsume'; -export * from './decorators/decoratorWatch'; -export * from './decorators/decoratorStorageLink'; -export * from './decorators/decoratorStorageProp'; - -export * from './storages/appStorage'; -export * from './storages/localStorage'; export { memo, memo_intrinsic, memo_entry, memo_stable, memo_skip } from "@koalaui/runtime/annotations" export { __memo_id_type, __memo_context_type } from '@koalaui/runtime' \ No newline at end of file diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/tsconfig-unmemoize.json b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/tsconfig-unmemoize.json index 13557c7440b..2820cafcaf3 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/tsconfig-unmemoize.json +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/tsconfig-unmemoize.json @@ -49,6 +49,9 @@ "@ohos.arkui.stateManagement": [ "./src/stateManagement/index.ts" ], + "arkui.stateManagement.runtime": [ + "./src/stateManagement/runtime/index-ts.ts" + ], "@ohos/animator": [ "./ohos.animator.ts" ], @@ -73,7 +76,7 @@ "global/resource": [ "./global/resource/resource.ts" ], - "@ohos.router": [ + "@ohos/router": [ "./ohos.router.ts" ], "@ohos/arkui/observer": [ @@ -114,7 +117,7 @@ "exclude": [ "./src/component/arkts", "./src/component/arkts/ArkUIGeneratedNativeModule.ts", - "./src/stateManagement/index-arkts.ts", + "./src/stateManagement/runtime/index.ts", "./src/component/test_utils.ts", "./src/component/main.ts", "./src/external/arkts", diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/components.gni b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/components.gni index 8514c15bf34..474899e5694 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/components.gni +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/components.gni @@ -13,9 +13,9 @@ # DO NOT MODIFY THIS FILE MANUALLY. # USE FOLLOWING COMMAND: -# ../tools/gen_gni.py --json arktsconfig-gn.json --output components.gni --gn-tool ../../../../../../../../prebuilts/build-tools/linux-x86/bin/gn +# ../tools/gen_gni.py --json arktsconfig-gn.json --output components.gni --gn-tool ../../../../../../../../prebuilts/build-tools/linux-x86/bin/gn --part-size 15 -arkui_files = [ +arkui_files_1 = [ "arkui-preprocessed/arkui/Graphics.ets", "arkui-preprocessed/arkui/NodeController.ets", "arkui-preprocessed/arkui/Application.ets", @@ -31,6 +31,9 @@ arkui_files = [ "arkui-preprocessed/arkui/UserView.ets", "arkui-preprocessed/arkui/index.ets", "arkui-preprocessed/arkui/ohos.arkui.node.ets", +] + +arkui_files_2 = [ "arkui-preprocessed/arkui/ohos.arkui.modifier.ets", "arkui-preprocessed/arkui/DataChangeListener.ets", "arkui-preprocessed/arkui/ArkComponentRoot.ets", @@ -45,6 +48,10 @@ arkui_files = [ "arkui-preprocessed/arkui/ani/arkts/ui_extension/ArkUIAniUiextensionModal.ets", "arkui-preprocessed/arkui/ani/arkts/ui_extension/ArkUIAniUiextensionLoadLibraryHelp.ets", "arkui-preprocessed/arkui/stateManagement/index.ets", + "arkui-preprocessed/arkui/stateManagement/runtime/index.ets", +] + +arkui_files_3 = [ "arkui-preprocessed/arkui/stateManagement/base/decoratorBase.ets", "arkui-preprocessed/arkui/stateManagement/base/mutableStateMeta.ets", "arkui-preprocessed/arkui/stateManagement/base/backingValue.ets", @@ -60,6 +67,9 @@ arkui_files = [ "arkui-preprocessed/arkui/stateManagement/decorators/decoratorConsume.ets", "arkui-preprocessed/arkui/stateManagement/decorators/decoratorProvide.ets", "arkui-preprocessed/arkui/stateManagement/decorators/decoratorObjectLink.ets", +] + +arkui_files_4 = [ "arkui-preprocessed/arkui/stateManagement/decorators/decoratorProp.ets", "arkui-preprocessed/arkui/stateManagement/decorators/decoratorWatch.ets", "arkui-preprocessed/arkui/handwritten/ArkPageTransition.ets", @@ -73,11 +83,16 @@ arkui_files = [ "arkui-preprocessed/arkui/handwritten/ForeignFunctions.ets", "arkui-preprocessed/arkui/handwritten/Router.ets", "arkui-preprocessed/arkui/handwritten/TabsOpsHandWritten.ets", + "arkui-preprocessed/arkui/handwritten/ArkDrawModifierImpl.ets", "arkui-preprocessed/arkui/handwritten/modifiers/ArkImageModifier.ets", +] + +arkui_files_5 = [ "arkui-preprocessed/arkui/handwritten/modifiers/ArkBaseNode.ets", "arkui-preprocessed/arkui/handwritten/modifiers/ArkTextNode.ets", "arkui-preprocessed/arkui/handwritten/modifiers/ArkTextModifier.ets", "arkui-preprocessed/arkui/handwritten/modifiers/ArkCommonModifier.ets", + "arkui-preprocessed/arkui/handwritten/modifiers/ArkListNode.ets", "arkui-preprocessed/arkui/handwritten/modifiers/ArkImageNode.ets", "arkui-preprocessed/arkui/external/arkts/index.ets", "arkui-preprocessed/arkui/component/canvas.ets", @@ -88,6 +103,9 @@ arkui_files = [ "arkui-preprocessed/arkui/component/alertDialog.ets", "arkui-preprocessed/arkui/component/embeddedComponent.ets", "arkui-preprocessed/arkui/component/patternLock.ets", +] + +arkui_files_6 = [ "arkui-preprocessed/arkui/component/timePicker.ets", "arkui-preprocessed/arkui/component/hyperlink.ets", "arkui-preprocessed/arkui/component/gridCol.ets", @@ -103,6 +121,9 @@ arkui_files = [ "arkui-preprocessed/arkui/component/alphabetIndexer.ets", "arkui-preprocessed/arkui/component/loadingProgress.ets", "arkui-preprocessed/arkui/component/GlobalScope.ets", +] + +arkui_files_7 = [ "arkui-preprocessed/arkui/component/gesture.ets", "arkui-preprocessed/arkui/component/grid.ets", "arkui-preprocessed/arkui/component/sdk-stubs.ets", @@ -118,6 +139,9 @@ arkui_files = [ "arkui-preprocessed/arkui/component/image.ets", "arkui-preprocessed/arkui/component/refresh.ets", "arkui-preprocessed/arkui/component/marquee.ets", +] + +arkui_files_8 = [ "arkui-preprocessed/arkui/component/formLink.ets", "arkui-preprocessed/arkui/component/textClock.ets", "arkui-preprocessed/arkui/component/imageCommon.ets", @@ -133,6 +157,9 @@ arkui_files = [ "arkui-preprocessed/arkui/component/animator.ets", "arkui-preprocessed/arkui/component/polyline.ets", "arkui-preprocessed/arkui/component/tabContent.ets", +] + +arkui_files_9 = [ "arkui-preprocessed/arkui/component/test-api.ets", "arkui-preprocessed/arkui/component/scrollBar.ets", "arkui-preprocessed/arkui/component/isolatedComponent.ets", @@ -148,6 +175,9 @@ arkui_files = [ "arkui-preprocessed/arkui/component/navRouter.ets", "arkui-preprocessed/arkui/component/customDialogController.ets", "arkui-preprocessed/arkui/component/blank.ets", +] + +arkui_files_10 = [ "arkui-preprocessed/arkui/component/enums.ets", "arkui-preprocessed/arkui/component/rect.ets", "arkui-preprocessed/arkui/component/divider.ets", @@ -163,6 +193,9 @@ arkui_files = [ "arkui-preprocessed/arkui/component/griditemops.ets", "arkui-preprocessed/arkui/component/effectComponent.ets", "arkui-preprocessed/arkui/component/wrapBuilder.ets", +] + +arkui_files_11 = [ "arkui-preprocessed/arkui/component/forEach.ets", "arkui-preprocessed/arkui/component/matrix2d.ets", "arkui-preprocessed/arkui/component/gauge.ets", @@ -178,6 +211,9 @@ arkui_files = [ "arkui-preprocessed/arkui/component/point.ets", "arkui-preprocessed/arkui/component/actionSheet.ets", "arkui-preprocessed/arkui/component/arkui-intl.ets", +] + +arkui_files_12 = [ "arkui-preprocessed/arkui/component/windowScene.ets", "arkui-preprocessed/arkui/component/staticComponents.ets", "arkui-preprocessed/arkui/component/radio.ets", @@ -193,6 +229,9 @@ arkui_files = [ "arkui-preprocessed/arkui/component/waterFlow.ets", "arkui-preprocessed/arkui/component/imageAnimator.ets", "arkui-preprocessed/arkui/component/arkui-drawabledescriptor.ets", +] + +arkui_files_13 = [ "arkui-preprocessed/arkui/component/select.ets", "arkui-preprocessed/arkui/component/units.ets", "arkui-preprocessed/arkui/component/gridRow.ets", @@ -208,6 +247,9 @@ arkui_files = [ "arkui-preprocessed/arkui/component/imageSpan.ets", "arkui-preprocessed/arkui/component/checkbox.ets", "arkui-preprocessed/arkui/component/rootScene.ets", +] + +arkui_files_14 = [ "arkui-preprocessed/arkui/component/resources.ets", "arkui-preprocessed/arkui/component/stateManagement.ets", "arkui-preprocessed/arkui/component/pasteButton.ets", @@ -223,6 +265,9 @@ arkui_files = [ "arkui-preprocessed/arkui/component/flowItem.ets", "arkui-preprocessed/arkui/component/menuItem.ets", "arkui-preprocessed/arkui/component/arkui-graphics-text.ets", +] + +arkui_files_15 = [ "arkui-preprocessed/arkui/component/arkui-matrix4.ets", "arkui-preprocessed/arkui/component/EnumsImpl.ets", "arkui-preprocessed/arkui/component/gridContainer.ets", @@ -238,6 +283,9 @@ arkui_files = [ "arkui-preprocessed/arkui/component/arkui-drawing.ets", "arkui-preprocessed/arkui/component/securityComponent.ets", "arkui-preprocessed/arkui/component/symbolglyph.ets", +] + +arkui_files_16 = [ "arkui-preprocessed/arkui/component/line.ets", "arkui-preprocessed/arkui/component/button.ets", "arkui-preprocessed/arkui/component/web.ets", @@ -253,6 +301,9 @@ arkui_files = [ "arkui-preprocessed/arkui/component/search.ets", "arkui-preprocessed/arkui/component/rawfiledescriptor.ets", "arkui-preprocessed/arkui/component/xcomponent.ets", +] + +arkui_files_17 = [ "arkui-preprocessed/arkui/component/qrcode.ets", "arkui-preprocessed/arkui/component/arkui-wrapper-builder.ets", "arkui-preprocessed/arkui/component/commonTsEtsApi.ets", @@ -268,18 +319,70 @@ arkui_files = [ "arkui-preprocessed/arkui/component/arkts/type_check.ets", "arkui-preprocessed/arkui/component/arkts/ArkUINativeModule.ets", "arkui-preprocessed/arkui/component/arkts/TestNativeModule.ets", +] + +arkui_files_18 = [ "arkui-preprocessed/arkui/component/arkts/index.ets", "arkui-preprocessed/arkui/component/arkts/ArkUIGeneratedNativeModule.ets", "arkui-preprocessed/arkui/component/shared/ArkResource.ets", - "arkui-preprocessed/ohos.observer.ets", "arkui-preprocessed/ohos.arkui.componentUtils.ets", "arkui-preprocessed/ohos.font.ets", + "arkui-preprocessed/ohos.promptAction.ets", + "arkui-preprocessed/ohos.arkui.observer.ets", + "arkui-preprocessed/ohos.arkui.graphics.ets", "arkui-preprocessed/ohos.measure.ets", + "arkui-preprocessed/ohos.graphics.drawing.ets", "arkui-preprocessed/ohos.graphics.common2D.ets", "arkui-preprocessed/ohos.arkui.UIContext.ets", + "arkui-preprocessed/ohos.arkui.inspector.ets", "arkui-preprocessed/ohos.animator.ets", "arkui-preprocessed/ohos.router.ets", - "arkui-preprocessed/ohos.arkui.focusController.ets", +] + +arkui_files_19 = [ "arkui-preprocessed/ohos.arkui.focusController.ets" ] + +arkui_parts = [ + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, +] + +arkui_files_array = [ + arkui_files_1, + arkui_files_2, + arkui_files_3, + arkui_files_4, + arkui_files_5, + arkui_files_6, + arkui_files_7, + arkui_files_8, + arkui_files_9, + arkui_files_10, + arkui_files_11, + arkui_files_12, + arkui_files_13, + arkui_files_14, + arkui_files_15, + arkui_files_16, + arkui_files_17, + arkui_files_18, + arkui_files_19, ] arkui_path_keys = [ @@ -293,6 +396,7 @@ arkui_path_keys = [ "@koalaui/compat", "@koalaui/runtime", "@ohos.arkui.stateManagement", + "arkui.stateManagement.runtime", "@koalaui/runtime/annotations", "@ohos/animator", "@ohos/arkui/UIContext", @@ -302,8 +406,12 @@ arkui_path_keys = [ "@ohos/font/font", "global/resource", "@ohos/router", - "@ohos/observer", + "@ohos/arkui/observer", "@ohos/graphics/common2D", + "@ohos/graphics/drawing", + "@ohos/arkui/graphics", + "@ohos/promptAction", + "@ohos/arkui/inspector", "@ohos/arkui/componentUtils", "@ohos/arkui/focusController", ] @@ -319,6 +427,7 @@ arkui_path_values = [ "../incremental/compat/src/arkts", "../incremental/runtime/ets", "arkui-preprocessed/arkui/stateManagement/index.ets", + "arkui-preprocessed/arkui/stateManagement/runtime", "../incremental/runtime/annotations", "arkui-preprocessed/ohos.animator.ets", "arkui-preprocessed/ohos.arkui.UIContext.ets", @@ -328,8 +437,12 @@ arkui_path_values = [ "arkui-preprocessed/ohos.font.ets", "arkui-preprocessed/global/resource/resource.ets", "arkui-preprocessed/ohos.router.ets", - "arkui-preprocessed/ohos.observer.ets", + "arkui-preprocessed/ohos.arkui.observer.ets", "arkui-preprocessed/ohos.graphics.common2D.ets", + "arkui-preprocessed/ohos.graphics.drawing.ets", + "arkui-preprocessed/ohos.arkui.graphics.ets", + "arkui-preprocessed/ohos.promptAction.ets", + "arkui-preprocessed/ohos.arkui.inspector.ets", "arkui-preprocessed/ohos.arkui.componentUtils.ets", "arkui-preprocessed/ohos.arkui.focusController.ets", ] diff --git a/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/arktsconfig-gn.json b/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/arktsconfig-gn.json index 71d79d0c6dd..67a526bb290 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/arktsconfig-gn.json +++ b/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/arktsconfig-gn.json @@ -7,7 +7,7 @@ "@koalaui/common": ["../../common/src"], "@koalaui/compat": ["../../compat/src/arkts"], "@koalaui/runtime/annotations": ["../annotations"], - "@ohos.arkui.stateManagement": ["../stateMgmt.ts"] + "arkui.stateManagement.runtime": ["../stateMgmt.ts"] } }, "include": ["ets/**/*.ts"] diff --git a/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/runtime.gni b/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/runtime.gni index b192a130452..baca41ec7a5 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/runtime.gni +++ b/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/runtime.gni @@ -50,7 +50,7 @@ koalaui_runtime_path_keys = [ "@koalaui/common", "@koalaui/compat", "@koalaui/runtime/annotations", - "@ohos.arkui.stateManagement", + "arkui.stateManagement.runtime", ] koalaui_runtime_path_values = [ diff --git a/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/stateMgmt.ts b/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/stateMgmt.ts index 79ab8943823..c0162a0da71 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/stateMgmt.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/stateMgmt.ts @@ -14,5 +14,4 @@ */ export { __memo_context_type, __memo_id_type} from "./ets/internals" -export interface StateDecoratedVariable {} export { memo } from "./annotations" \ No newline at end of file diff --git a/frameworks/bridge/arkts_frontend/koala_projects/tools/annotate.py b/frameworks/bridge/arkts_frontend/koala_projects/tools/annotate.py index 07bd7b1c773..138caa0304d 100755 --- a/frameworks/bridge/arkts_frontend/koala_projects/tools/annotate.py +++ b/frameworks/bridge/arkts_frontend/koala_projects/tools/annotate.py @@ -14,6 +14,7 @@ import os import glob +import shutil from pathlib import Path class Config: @@ -57,6 +58,8 @@ def main(options: Config): os.chdir(options.baseUrl) input_dir = os.path.abspath(options.inputDir) output_dir = os.path.abspath(options.outputDir) + if os.path.exists(output_dir): + shutil.rmtree(output_dir) # 递归获取所有文件,保持相对路径 all_files = [] diff --git a/frameworks/bridge/arkts_frontend/koala_projects/tools/gen_gni.py b/frameworks/bridge/arkts_frontend/koala_projects/tools/gen_gni.py index b27e0eec841..f7afdeb4297 100755 --- a/frameworks/bridge/arkts_frontend/koala_projects/tools/gen_gni.py +++ b/frameworks/bridge/arkts_frontend/koala_projects/tools/gen_gni.py @@ -1,17 +1,3 @@ -#!/usr/bin/env python -# Copyright (c) 2025 Huawei Device Co., Ltd. -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - import json import os import glob @@ -54,11 +40,13 @@ def find_files(include_patterns, exclude_patterns=None, base_url=None): return file_list -def generate_files_var_name(package_name): +def generate_files_var_name(package_name, part_index=None): """ - 根据 package 字段生成变量名 + 根据 package 字段生成变量名,如果指定了 part_index,则生成带编号的变量名 """ var_name = package_name.replace("@", "").replace("/", "_") + if part_index is not None: + return f"{var_name}_files_{part_index}" return f"{var_name}_files" def generate_paths_arrays(package_name, paths, base_url): @@ -89,13 +77,10 @@ def generate_paths_arrays(package_name, paths, base_url): return keys_var_name, values_var_name, keys, relative_values -def generate_gni_file(include, exclude, output_file, package_name, paths, base_url): +def generate_gni_file(include, exclude, output_file, package_name, paths, base_url, part_size=None): """ 生成 .gni 文件,包含文件列表和 paths 的 keys 和 values 数组 """ - # 生成文件列表变量名 - files_var_name = generate_files_var_name(package_name) - # 根据 include 和 exclude 规则生成文件列表 file_list = find_files(include, exclude, base_url) @@ -128,11 +113,43 @@ def generate_gni_file(include, exclude, output_file, package_name, paths, base_u f.write("# DO NOT MODIFY THIS FILE MANUALLY.\n") f.write(f"# USE FOLLOWING COMMAND:\n# {current_command}\n\n") - # 写入文件列表 - f.write(f"{files_var_name} = [\n") - for file in file_list: - f.write(f' "{file}",\n') - f.write("]\n\n") + # 处理文件列表的分割 + if part_size and len(file_list) > part_size: + part_count = (len(file_list) + part_size - 1) // part_size # 确保不会多生成一个空列表 + # 写入分块数量变量 + parts_var_name = package_name.replace("@", "").replace("/", "_") + "_parts" + files_array_var_name = package_name.replace("@", "").replace("/", "_") + "_files_array" + + # 写入分块的文件列表 + for i in range(part_count): + start_index = i * part_size + end_index = start_index + part_size + part_file_list = file_list[start_index:end_index] + if part_file_list: # 确保列表不为空 + files_var_name = generate_files_var_name(package_name, i + 1) + f.write(f"{files_var_name} = [\n") + for file in part_file_list: + f.write(f' "{file}",\n') + f.write("]\n\n") + + # 生成 xxx_parts 数组 + f.write(f"{parts_var_name} = [\n") + for i in range(1, part_count + 1): + f.write(f' {i},\n') + f.write("]\n\n") + + # 生成 xxx_files_array 数组 + f.write(f"{files_array_var_name} = [\n") + for i in range(1, part_count + 1): + files_var_name = generate_files_var_name(package_name, i) + f.write(f' {files_var_name},\n') + f.write("]\n\n") + else: + files_var_name = generate_files_var_name(package_name) + f.write(f"{files_var_name} = [\n") + for file in file_list: + f.write(f' "{file}",\n') + f.write("]\n\n") # 写入 paths 的 keys 数组 f.write(f"{keys_var_name} = [\n") @@ -146,7 +163,6 @@ def generate_gni_file(include, exclude, output_file, package_name, paths, base_u f.write(f' "{value}",\n') f.write("]\n") - def format_gni_file(gn_tool, file): """ 对生成的 .gni 文件,进行格式化 @@ -163,13 +179,13 @@ def format_gni_file(gn_tool, file): print(f"output message: {e.output}") return 1 - if __name__ == "__main__": # 解析命令行参数 parser = argparse.ArgumentParser(description="Generate .gni file from JSON configuration.") parser.add_argument("--json", required=True, help="Path to the input JSON file.") parser.add_argument("--output", default="output.gni", help="Path to the output .gni file.") parser.add_argument("--gn-tool", default="gn", help="Path to the gn tool.") + parser.add_argument("--part-size", type=int, help="Maximum size of each file list part.") args = parser.parse_args() # 读取 JSON 文件 @@ -184,5 +200,5 @@ if __name__ == "__main__": base_url = json_data["compilerOptions"]["baseUrl"] # 生成 .gni 文件 - generate_gni_file(include, exclude, args.output, package_name, paths, base_url) + generate_gni_file(include, exclude, args.output, package_name, paths, base_url, args.part_size) format_gni_file(args.gn_tool, args.output) \ No newline at end of file -- Gitee From 4433f027e6c4dd5e30776fdd26b9f4e573c0978b Mon Sep 17 00:00:00 2001 From: sunfei Date: Fri, 6 Jun 2025 19:21:44 +0800 Subject: [PATCH 5/5] fix runtime build Signed-off-by: sunfei Change-Id: I9888003b17acb08e31fbf52fbfba0aac9c1ac0df --- .../arkui-ohos/ohos.arkui.UIContext.ts | 1 + .../arkui-ohos/src/LazyForEach.ts | 194 ------------------ .../src/component/lazyGridLayout.ts | 7 - .../arkui-ohos/src/component/span.ts | 27 --- .../arkui-ohos/tsconfig-unmemoize.json | 3 - .../arkoala-arkts/components.gni | 107 +++++----- .../arkoala/arkui-common/arktsconfig.json | 3 + .../arkui-common/tsconfig-unmemoize.json | 5 +- .../runtime/arktsconfig-run-unmemoized.json | 3 +- .../runtime/src/memo/changeListener.ts | 3 + .../runtime/src/memo/contextLocal.ts | 3 + .../incremental/runtime/src/memo/entry.ts | 3 + .../incremental/runtime/src/memo/remember.ts | 3 + .../runtime/tsconfig-unmemoize.json | 5 +- .../state_mgmt/files_to_watch.gni | 2 +- 15 files changed, 84 insertions(+), 285 deletions(-) delete mode 100644 frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/LazyForEach.ts diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.arkui.UIContext.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.arkui.UIContext.ts index cfd1c75cedc..397c62a63f0 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.arkui.UIContext.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.arkui.UIContext.ts @@ -19,6 +19,7 @@ import { FrameNode, FrameNodeInternal, FrameNodeUtils } from "arkui/FrameNode" import { GlobalScope_ohos_font } from "arkui/component/arkui-external" import { GlobalScope_ohos_measure_utils } from "arkui/component/arkui-external" +import { GlobalScopeUicontextFontScale, GlobalScopeUicontextTextMenu } from "arkui/component/arkui-uicontext-text-utils" import { UIContextDispatchKeyEvent, UIContextAtomicServiceBar } from "arkui/component/arkui-custom" import { FontOptions, FontInfo } from "@ohos/font" import { MeasureOptions } from "@ohos/measure" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/LazyForEach.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/LazyForEach.ts deleted file mode 100644 index 1b7a9e23b75..00000000000 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/LazyForEach.ts +++ /dev/null @@ -1,194 +0,0 @@ -/* - * Copyright (c) 2022-2025 Huawei Device Co., Ltd. - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import { __context, __id, contextNode, DataNode, IncrementalNode, memoEntry2, remember, rememberMutableState, scheduleCallback } from "@koalaui/runtime" -import { hashCodeFromString, int32, KoalaCallsiteKey } from "@koalaui/common" -import { nullptr, pointer } from "@koalaui/interop"; -import { LazyForEachType, PeerNode, PeerNodeType } from "./PeerNode"; -import { LazyForEachOps } from "./component/arkui-custom" -import { InternalListener } from "./DataChangeListener"; -import { IDataSource } from "./component/lazyForEach"; -import { setNeedCreate } from "./ArkComponentRoot"; - -class LazyForEachManager { - static isDummy: boolean = false - // Special pointer to mark that more elements needed. - static specialPointer: pointer = 1 - static OnRangeUpdate(parent: pointer, totalCount: int32, updater: (currentIndex: int32, currentMark: pointer, end: int32) => void) { - if (LazyForEachManager.isDummy) - scheduleCallback(() => updater(0, LazyForEachManager.specialPointer, 100)) - else - LazyForEachOps.OnRangeUpdate(parent, totalCount, updater) - } - - static NeedMoreElements(parent: pointer, mark: pointer, direction: int32): pointer { - if (LazyForEachManager.isDummy) - return LazyForEachManager.specialPointer - else - return LazyForEachOps.NeedMoreElements(parent, mark, direction) - } - - static SetCurrentIndex(node: pointer, index: int32): void { - if (!LazyForEachManager.isDummy) - LazyForEachOps.SetCurrentIndex(node, index) - } - - static SetInsertMark(parent: PeerNode, mark: pointer, moreUp: boolean): void { - if (!LazyForEachManager.isDummy) - parent.setInsertMark(mark, moreUp) - } - - /** - * @param parent - * @param itemCount - * @param offset of LazyForEach in parent's children - */ - static Prepare(parent: PeerNode, itemCount: int32, offset: int32): void { - if (!LazyForEachManager.isDummy) - LazyForEachOps.Prepare(parent.peer.ptr, itemCount, offset) - } -} - -class VisibleRange { - parent: pointer = nullptr - markUp: pointer = nullptr - markDown: pointer = nullptr - indexUp: int32 - indexDown: int32 - - constructor(parent: PeerNode, indexUp: int32, indexDown: int32) { - this.parent = parent.peer.ptr - this.indexUp = indexUp - this.indexDown = indexDown - } - needFillUp(): boolean { - let more = LazyForEachManager.NeedMoreElements(this.parent, this.markUp, 0) - if (more == nullptr) return false - this.markUp = more - return true - } - - needFillDown(): boolean { - let more = LazyForEachManager.NeedMoreElements(this.parent, this.markDown, 1) - if (more == nullptr) return false - this.markDown = more - return true - } - - get activeCount(): int32 { - return this.indexDown >= 0 ? this.indexDown - this.indexUp + 1 : 0 - } -} - -class LazyForEachIdentifier { - constructor(id: KoalaCallsiteKey, totalCnt: int32, activeCnt: int32) { - this.id = id - this.totalCnt = totalCnt - this.activeCnt = activeCnt - } - readonly id: KoalaCallsiteKey - readonly totalCnt: int32 - readonly activeCnt: int32 -} - -/** - * @param id unique identifier of LazyForEach - * @returns item offset of LazyForEach in parent's children - */ -/** @memo */ -function getOffset(parent: PeerNode, id: KoalaCallsiteKey): int32 { - let offset = 0 - for (let child = parent.firstChild; child; child = child!.nextSibling) { - // corresponding DataNode is attached after the component items - let info = DataNode.extract(LazyForEachType, child!!) - if (info?.id === id) { - offset -= info!.activeCnt - // console.log(`offset = ${offset}`) - return offset - } else if (info) { - offset += info!.totalCnt - info!.activeCnt // active nodes are already counted - } else if (child!.isKind(PeerNodeType)) { - ++offset - } - } - return offset // DataNode not found, maybe throw error? -} - -/** @memo */ -export function LazyForEachImpl(dataSource: IDataSource, - /** @memo */ - itemGenerator: (item: T, index: number) => void, - keyGenerator?: (item: T, index: number) => string, -) { - let current = rememberMutableState(-1) - let mark = rememberMutableState(nullptr) - let version = rememberMutableState(0) - // console.log(`LazyForEach current=${current.value} version=${version.value} mark=${mark.value}`) - - let parent = contextNode() - const offset = getOffset(parent, __id()) - - let listener = remember(() => new InternalListener(parent.peer.ptr, version)) - const changeIndex = listener.flush(offset) // first item index that's affected by DataChange - - const currentLocal = current.value >= 0 ? Math.max(current.value - offset, 0) as int32 : -1; // translated to local index - const visibleRange = new VisibleRange(parent, currentLocal, currentLocal) - remember(() => { - dataSource.registerDataChangeListener(listener) - LazyForEachManager.OnRangeUpdate(visibleRange.parent, dataSource.totalCount() as int32, (currentIndex: int32, currentMark: pointer, end: int32) => { - // console.log(`LazyForEach[${parent}]: current updated to ${currentIndex} ${currentMark} end=${end}`) - current.value = currentIndex - mark.value = currentMark - version.value++ - }) - }) - // Subscribe to version changes. - version.value - - let generator = (element: T, index: number): int32 => keyGenerator ? hashCodeFromString(keyGenerator!(element, index)) : index as int32 - let index: number = visibleRange.indexUp as number - - LazyForEachManager.Prepare(parent, dataSource.totalCount() as int32, offset) - LazyForEachManager.SetInsertMark(parent, mark.value, false) - const prevVal = setNeedCreate(true) // force synchronous create of inner CustomComponents in order to layout them correctly - while (true) { - // console.log(`LazyForEach[${parent}]: index=${index}`) - if (index < 0 || index >= dataSource.totalCount()) break - const element: T = dataSource.getData(index as number) - memoEntry2( - __context(), - generator(element, index), - itemGenerator, - element, - index - ) - let moreUp = visibleRange.needFillUp() - if (moreUp && visibleRange.indexUp > 0) { - index = --visibleRange.indexUp - } else if (visibleRange.needFillDown()) { - index = ++visibleRange.indexDown - } else { - // console.log("No more needed") - index = -1 - } - LazyForEachManager.SetInsertMark(parent, moreUp ? visibleRange.markUp : visibleRange.markDown, moreUp) - } - setNeedCreate(prevVal) - parent.setInsertMark(nullptr, false) - - // create DataNode to provide count information to parent - const identifier = new LazyForEachIdentifier(__id(), dataSource.totalCount() as int32, visibleRange.activeCount) - DataNode.attach(LazyForEachType, identifier) -} diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/lazyGridLayout.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/lazyGridLayout.ts index cc492aa8866..e8112da9a4c 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/lazyGridLayout.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/lazyGridLayout.ts @@ -109,13 +109,6 @@ export class ArkLazyGridLayoutStyle extends ArkCommonMethodStyle implements Lazy export interface LazyVGridLayoutAttribute extends LazyGridLayoutAttribute { columnsTemplate(value: string | undefined): this } -<<<<<<< HEAD -======= -export interface UILazyVGridLayoutAttribute extends UILazyGridLayoutAttribute { - /** @memo */ - columnsTemplate(value: string | undefined): this -} ->>>>>>> cc1c303885f (use gn to build arkoala arkui-ohos) export class ArkLazyVGridLayoutStyle extends ArkLazyGridLayoutStyle implements LazyVGridLayoutAttribute { columnsTemplate_value?: string | undefined public columnsTemplate(value: string | undefined): this { diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/span.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/span.ts index 40cee28a6cd..929f158cd08 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/span.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/span.ts @@ -351,33 +351,6 @@ export interface SpanAttribute extends BaseSpan { lineHeight(value: Length | undefined): this textShadow(value: ShadowOptions | Array | undefined): this } -<<<<<<< HEAD -======= -export interface UISpanAttribute extends UIBaseSpan { - /** @memo */ - font(value: Font | undefined): this - /** @memo */ - fontColor(value: ResourceColor | undefined): this - /** @memo */ - fontSize(value: number | string | Resource | undefined): this - /** @memo */ - fontStyle(value: FontStyle | undefined): this - /** @memo */ - fontWeight(value: number | FontWeight | string | undefined): this - /** @memo */ - fontFamily(value: string | Resource | undefined): this - /** @memo */ - decoration(value: DecorationStyleInterface | undefined): this - /** @memo */ - letterSpacing(value: number | string | undefined): this - /** @memo */ - textCase(value: TextCase | undefined): this - /** @memo */ - lineHeight(value: Length | undefined): this - /** @memo */ - textShadow(value: ShadowOptions | Array | undefined): this -} ->>>>>>> cc1c303885f (use gn to build arkoala arkui-ohos) export class ArkSpanStyle extends ArkBaseSpanStyle implements SpanAttribute { font_value?: Font | undefined fontColor_value?: ResourceColor | undefined diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/tsconfig-unmemoize.json b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/tsconfig-unmemoize.json index 2820cafcaf3..9444bd55be5 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/tsconfig-unmemoize.json +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/tsconfig-unmemoize.json @@ -127,9 +127,6 @@ "../../incremental/tools/panda/arkts/std-lib/global.d.ts" ], "references": [ - { - "path": "../../arkoala/arkui-common" - }, { "path": "../../arkoala/arkui-common/tsconfig-unmemoize.json" }, diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/components.gni b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/components.gni index 474899e5694..d4a46180f8a 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/components.gni +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/components.gni @@ -16,8 +16,10 @@ # ../tools/gen_gni.py --json arktsconfig-gn.json --output components.gni --gn-tool ../../../../../../../../prebuilts/build-tools/linux-x86/bin/gn --part-size 15 arkui_files_1 = [ + "arkui-preprocessed/arkui/DividerModifier.ets", "arkui-preprocessed/arkui/Graphics.ets", "arkui-preprocessed/arkui/NodeController.ets", + "arkui-preprocessed/arkui/BlankModifier.ets", "arkui-preprocessed/arkui/Application.ets", "arkui-preprocessed/arkui/ArkStructBase.ets", "arkui-preprocessed/arkui/ArkCustomComponent.ets", @@ -27,13 +29,12 @@ arkui_files_1 = [ "arkui-preprocessed/arkui/ArkUIEntry.ets", "arkui-preprocessed/arkui/ComponentBase.ets", "arkui-preprocessed/arkui/stateOf.ets", - "arkui-preprocessed/arkui/LazyForEach.ets", "arkui-preprocessed/arkui/UserView.ets", "arkui-preprocessed/arkui/index.ets", - "arkui-preprocessed/arkui/ohos.arkui.node.ets", ] arkui_files_2 = [ + "arkui-preprocessed/arkui/ohos.arkui.node.ets", "arkui-preprocessed/arkui/ohos.arkui.modifier.ets", "arkui-preprocessed/arkui/DataChangeListener.ets", "arkui-preprocessed/arkui/ArkComponentRoot.ets", @@ -48,10 +49,10 @@ arkui_files_2 = [ "arkui-preprocessed/arkui/ani/arkts/ui_extension/ArkUIAniUiextensionModal.ets", "arkui-preprocessed/arkui/ani/arkts/ui_extension/ArkUIAniUiextensionLoadLibraryHelp.ets", "arkui-preprocessed/arkui/stateManagement/index.ets", - "arkui-preprocessed/arkui/stateManagement/runtime/index.ets", ] arkui_files_3 = [ + "arkui-preprocessed/arkui/stateManagement/runtime/index.ets", "arkui-preprocessed/arkui/stateManagement/base/decoratorBase.ets", "arkui-preprocessed/arkui/stateManagement/base/mutableStateMeta.ets", "arkui-preprocessed/arkui/stateManagement/base/backingValue.ets", @@ -66,14 +67,16 @@ arkui_files_3 = [ "arkui-preprocessed/arkui/stateManagement/decorators/decoratorStorageLink.ets", "arkui-preprocessed/arkui/stateManagement/decorators/decoratorConsume.ets", "arkui-preprocessed/arkui/stateManagement/decorators/decoratorProvide.ets", - "arkui-preprocessed/arkui/stateManagement/decorators/decoratorObjectLink.ets", ] arkui_files_4 = [ + "arkui-preprocessed/arkui/stateManagement/decorators/decoratorObjectLink.ets", "arkui-preprocessed/arkui/stateManagement/decorators/decoratorProp.ets", "arkui-preprocessed/arkui/stateManagement/decorators/decoratorWatch.ets", "arkui-preprocessed/arkui/handwritten/ArkPageTransition.ets", + "arkui-preprocessed/arkui/handwritten/LazyForEachImpl.ets", "arkui-preprocessed/arkui/handwritten/GridItemOpsHandWritten.ets", + "arkui-preprocessed/arkui/handwritten/LazyItemNode.ets", "arkui-preprocessed/arkui/handwritten/ArkStateStyle.ets", "arkui-preprocessed/arkui/handwritten/ArkAnimation.ets", "arkui-preprocessed/arkui/handwritten/RepeatImpl.ets", @@ -82,30 +85,31 @@ arkui_files_4 = [ "arkui-preprocessed/arkui/handwritten/index.ets", "arkui-preprocessed/arkui/handwritten/ForeignFunctions.ets", "arkui-preprocessed/arkui/handwritten/Router.ets", - "arkui-preprocessed/arkui/handwritten/TabsOpsHandWritten.ets", - "arkui-preprocessed/arkui/handwritten/ArkDrawModifierImpl.ets", - "arkui-preprocessed/arkui/handwritten/modifiers/ArkImageModifier.ets", ] arkui_files_5 = [ + "arkui-preprocessed/arkui/handwritten/TabsOpsHandWritten.ets", + "arkui-preprocessed/arkui/handwritten/ArkDrawModifierImpl.ets", + "arkui-preprocessed/arkui/handwritten/modifiers/ArkImageModifier.ets", "arkui-preprocessed/arkui/handwritten/modifiers/ArkBaseNode.ets", "arkui-preprocessed/arkui/handwritten/modifiers/ArkTextNode.ets", "arkui-preprocessed/arkui/handwritten/modifiers/ArkTextModifier.ets", "arkui-preprocessed/arkui/handwritten/modifiers/ArkCommonModifier.ets", "arkui-preprocessed/arkui/handwritten/modifiers/ArkListNode.ets", "arkui-preprocessed/arkui/handwritten/modifiers/ArkImageNode.ets", + "arkui-preprocessed/arkui/handwritten/modifiers/ArkDividerNode.ets", + "arkui-preprocessed/arkui/handwritten/modifiers/ArkBlankNode.ets", "arkui-preprocessed/arkui/external/arkts/index.ets", "arkui-preprocessed/arkui/component/canvas.ets", - "arkui-preprocessed/arkui/component/abilityComponent.ets", "arkui-preprocessed/arkui/component/row.ets", "arkui-preprocessed/arkui/component/circle.ets", +] + +arkui_files_6 = [ "arkui-preprocessed/arkui/component/contextMenu.ets", "arkui-preprocessed/arkui/component/alertDialog.ets", "arkui-preprocessed/arkui/component/embeddedComponent.ets", "arkui-preprocessed/arkui/component/patternLock.ets", -] - -arkui_files_6 = [ "arkui-preprocessed/arkui/component/timePicker.ets", "arkui-preprocessed/arkui/component/hyperlink.ets", "arkui-preprocessed/arkui/component/gridCol.ets", @@ -117,13 +121,13 @@ arkui_files_6 = [ "arkui-preprocessed/arkui/component/navigationExtender.ets", "arkui-preprocessed/arkui/component/dataPanel.ets", "arkui-preprocessed/arkui/component/edgeColors.ets", +] + +arkui_files_7 = [ "arkui-preprocessed/arkui/component/tabs.ets", "arkui-preprocessed/arkui/component/alphabetIndexer.ets", "arkui-preprocessed/arkui/component/loadingProgress.ets", "arkui-preprocessed/arkui/component/GlobalScope.ets", -] - -arkui_files_7 = [ "arkui-preprocessed/arkui/component/gesture.ets", "arkui-preprocessed/arkui/component/grid.ets", "arkui-preprocessed/arkui/component/sdk-stubs.ets", @@ -135,13 +139,13 @@ arkui_files_7 = [ "arkui-preprocessed/arkui/component/ohos.app.ability.ets", "arkui-preprocessed/arkui/component/flex.ets", "arkui-preprocessed/arkui/component/base.ets", +] + +arkui_files_8 = [ "arkui-preprocessed/arkui/component/borderRadiuses.ets", "arkui-preprocessed/arkui/component/image.ets", "arkui-preprocessed/arkui/component/refresh.ets", "arkui-preprocessed/arkui/component/marquee.ets", -] - -arkui_files_8 = [ "arkui-preprocessed/arkui/component/formLink.ets", "arkui-preprocessed/arkui/component/textClock.ets", "arkui-preprocessed/arkui/component/imageCommon.ets", @@ -153,13 +157,13 @@ arkui_files_8 = [ "arkui-preprocessed/arkui/component/CallbackRegistry.ets", "arkui-preprocessed/arkui/component/arkui-common.ets", "arkui-preprocessed/arkui/component/particle.ets", +] + +arkui_files_9 = [ "arkui-preprocessed/arkui/component/sidebar.ets", "arkui-preprocessed/arkui/component/animator.ets", "arkui-preprocessed/arkui/component/polyline.ets", "arkui-preprocessed/arkui/component/tabContent.ets", -] - -arkui_files_9 = [ "arkui-preprocessed/arkui/component/test-api.ets", "arkui-preprocessed/arkui/component/scrollBar.ets", "arkui-preprocessed/arkui/component/isolatedComponent.ets", @@ -168,16 +172,17 @@ arkui_files_9 = [ "arkui-preprocessed/arkui/component/column.ets", "arkui-preprocessed/arkui/component/listItem.ets", "arkui-preprocessed/arkui/component/checkboxgroup.ets", + "arkui-preprocessed/arkui/component/arkui-uicontext-text-utils.ets", "arkui-preprocessed/arkui/component/rowSplit.ets", "arkui-preprocessed/arkui/component/arkui-uniformtypedescriptor.ets", +] + +arkui_files_10 = [ "arkui-preprocessed/arkui/component/gridItem.ets", "arkui-preprocessed/arkui/component/counter.ets", "arkui-preprocessed/arkui/component/navRouter.ets", "arkui-preprocessed/arkui/component/customDialogController.ets", "arkui-preprocessed/arkui/component/blank.ets", -] - -arkui_files_10 = [ "arkui-preprocessed/arkui/component/enums.ets", "arkui-preprocessed/arkui/component/rect.ets", "arkui-preprocessed/arkui/component/divider.ets", @@ -188,14 +193,14 @@ arkui_files_10 = [ "arkui-preprocessed/arkui/component/stepper.ets", "arkui-preprocessed/arkui/component/textTimer.ets", "arkui-preprocessed/arkui/component/ohos.base.ets", +] + +arkui_files_11 = [ "arkui-preprocessed/arkui/component/swiper.ets", "arkui-preprocessed/arkui/component/saveButton.ets", "arkui-preprocessed/arkui/component/griditemops.ets", "arkui-preprocessed/arkui/component/effectComponent.ets", "arkui-preprocessed/arkui/component/wrapBuilder.ets", -] - -arkui_files_11 = [ "arkui-preprocessed/arkui/component/forEach.ets", "arkui-preprocessed/arkui/component/matrix2d.ets", "arkui-preprocessed/arkui/component/gauge.ets", @@ -206,14 +211,14 @@ arkui_files_11 = [ "arkui-preprocessed/arkui/component/containerSpan.ets", "arkui-preprocessed/arkui/component/navigator.ets", "arkui-preprocessed/arkui/component/component3d.ets", +] + +arkui_files_12 = [ "arkui-preprocessed/arkui/component/edgeWidths.ets", "arkui-preprocessed/arkui/component/lazyForEach.ets", "arkui-preprocessed/arkui/component/point.ets", "arkui-preprocessed/arkui/component/actionSheet.ets", "arkui-preprocessed/arkui/component/arkui-intl.ets", -] - -arkui_files_12 = [ "arkui-preprocessed/arkui/component/windowScene.ets", "arkui-preprocessed/arkui/component/staticComponents.ets", "arkui-preprocessed/arkui/component/radio.ets", @@ -224,14 +229,14 @@ arkui_files_12 = [ "arkui-preprocessed/arkui/component/richEditor.ets", "arkui-preprocessed/arkui/component/textPicker.ets", "arkui-preprocessed/arkui/component/index.ets", +] + +arkui_files_13 = [ "arkui-preprocessed/arkui/component/folderStack.ets", "arkui-preprocessed/arkui/component/progress.ets", "arkui-preprocessed/arkui/component/waterFlow.ets", "arkui-preprocessed/arkui/component/imageAnimator.ets", "arkui-preprocessed/arkui/component/arkui-drawabledescriptor.ets", -] - -arkui_files_13 = [ "arkui-preprocessed/arkui/component/select.ets", "arkui-preprocessed/arkui/component/units.ets", "arkui-preprocessed/arkui/component/gridRow.ets", @@ -242,14 +247,14 @@ arkui_files_13 = [ "arkui-preprocessed/arkui/component/ArkoalaControl.ets", "arkui-preprocessed/arkui/component/uiExtensionComponent.ets", "arkui-preprocessed/arkui/component/mediaCachedImage.ets", +] + +arkui_files_14 = [ "arkui-preprocessed/arkui/component/repeat.ets", "arkui-preprocessed/arkui/component/listItemGroup.ets", "arkui-preprocessed/arkui/component/imageSpan.ets", "arkui-preprocessed/arkui/component/checkbox.ets", "arkui-preprocessed/arkui/component/rootScene.ets", -] - -arkui_files_14 = [ "arkui-preprocessed/arkui/component/resources.ets", "arkui-preprocessed/arkui/component/stateManagement.ets", "arkui-preprocessed/arkui/component/pasteButton.ets", @@ -260,14 +265,14 @@ arkui_files_14 = [ "arkui-preprocessed/arkui/component/inspector.ets", "arkui-preprocessed/arkui/component/contentSlot.ets", "arkui-preprocessed/arkui/component/calendarPicker.ets", +] + +arkui_files_15 = [ "arkui-preprocessed/arkui/component/nodeContainer.ets", "arkui-preprocessed/arkui/component/arkui-synthetics.ets", "arkui-preprocessed/arkui/component/flowItem.ets", "arkui-preprocessed/arkui/component/menuItem.ets", "arkui-preprocessed/arkui/component/arkui-graphics-text.ets", -] - -arkui_files_15 = [ "arkui-preprocessed/arkui/component/arkui-matrix4.ets", "arkui-preprocessed/arkui/component/EnumsImpl.ets", "arkui-preprocessed/arkui/component/gridContainer.ets", @@ -278,14 +283,14 @@ arkui_files_15 = [ "arkui-preprocessed/arkui/component/stack.ets", "arkui-preprocessed/arkui/component/navDestination.ets", "arkui-preprocessed/arkui/component/polygon.ets", +] + +arkui_files_16 = [ "arkui-preprocessed/arkui/component/calendar.ets", "arkui-preprocessed/arkui/component/generatorSynthetic.ets", "arkui-preprocessed/arkui/component/arkui-drawing.ets", "arkui-preprocessed/arkui/component/securityComponent.ets", "arkui-preprocessed/arkui/component/symbolglyph.ets", -] - -arkui_files_16 = [ "arkui-preprocessed/arkui/component/line.ets", "arkui-preprocessed/arkui/component/button.ets", "arkui-preprocessed/arkui/component/web.ets", @@ -296,14 +301,14 @@ arkui_files_16 = [ "arkui-preprocessed/arkui/component/arkui-pixelmap.ets", "arkui-preprocessed/arkui/component/focus.ets", "arkui-preprocessed/arkui/component/animationExtender.ets", +] + +arkui_files_17 = [ "arkui-preprocessed/arkui/component/type-replacements.ets", "arkui-preprocessed/arkui/component/customBuilder.ets", "arkui-preprocessed/arkui/component/search.ets", "arkui-preprocessed/arkui/component/rawfiledescriptor.ets", "arkui-preprocessed/arkui/component/xcomponent.ets", -] - -arkui_files_17 = [ "arkui-preprocessed/arkui/component/qrcode.ets", "arkui-preprocessed/arkui/component/arkui-wrapper-builder.ets", "arkui-preprocessed/arkui/component/commonTsEtsApi.ets", @@ -314,14 +319,14 @@ arkui_files_17 = [ "arkui-preprocessed/arkui/component/peers/CallbackKind.ets", "arkui-preprocessed/arkui/component/peers/CallbackTransformer.ets", "arkui-preprocessed/arkui/component/peers/CallbacksChecker.ets", +] + +arkui_files_18 = [ "arkui-preprocessed/arkui/component/peers/CallbackDeserializeCall.ets", "arkui-preprocessed/arkui/component/peers/Serializer.ets", "arkui-preprocessed/arkui/component/arkts/type_check.ets", "arkui-preprocessed/arkui/component/arkts/ArkUINativeModule.ets", "arkui-preprocessed/arkui/component/arkts/TestNativeModule.ets", -] - -arkui_files_18 = [ "arkui-preprocessed/arkui/component/arkts/index.ets", "arkui-preprocessed/arkui/component/arkts/ArkUIGeneratedNativeModule.ets", "arkui-preprocessed/arkui/component/shared/ArkResource.ets", @@ -332,15 +337,17 @@ arkui_files_18 = [ "arkui-preprocessed/ohos.arkui.graphics.ets", "arkui-preprocessed/ohos.measure.ets", "arkui-preprocessed/ohos.graphics.drawing.ets", +] + +arkui_files_19 = [ "arkui-preprocessed/ohos.graphics.common2D.ets", "arkui-preprocessed/ohos.arkui.UIContext.ets", "arkui-preprocessed/ohos.arkui.inspector.ets", "arkui-preprocessed/ohos.animator.ets", "arkui-preprocessed/ohos.router.ets", + "arkui-preprocessed/ohos.arkui.focusController.ets", ] -arkui_files_19 = [ "arkui-preprocessed/ohos.arkui.focusController.ets" ] - arkui_parts = [ 1, 2, @@ -403,7 +410,7 @@ arkui_path_keys = [ "@ohos.arkui.UIContext", "@ohos.arkui.node", "@ohos/measure", - "@ohos/font/font", + "@ohos/font", "global/resource", "@ohos/router", "@ohos/arkui/observer", diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala/arkui-common/arktsconfig.json b/frameworks/bridge/arkts_frontend/koala_projects/arkoala/arkui-common/arktsconfig.json index a64cf689433..2f1c47d5835 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala/arkui-common/arktsconfig.json +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala/arkui-common/arktsconfig.json @@ -19,6 +19,9 @@ "@koalaui/compat": [ "../../../../../incremental/compat/src/arkts", "../../../../../incremental/compat/src" ], + "arkui.stateManagement.runtime": [ + "../../../../../incremental/runtime/build/unmemoized/stateMgmt-unmemoize.ts" + ], "@koalaui/arkui-common": ["../"] } }, diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala/arkui-common/tsconfig-unmemoize.json b/frameworks/bridge/arkts_frontend/koala_projects/arkoala/arkui-common/tsconfig-unmemoize.json index 998bcebce05..902d6ae968d 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala/arkui-common/tsconfig-unmemoize.json +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala/arkui-common/tsconfig-unmemoize.json @@ -26,7 +26,10 @@ "#arkcompat": [ "./src/arkts", - ] + ], + "arkui.stateManagement.runtime": [ + "../../ncremental/runtime/stateMgmt-unmemoize.ts" + ], } }, "include": [ diff --git a/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/arktsconfig-run-unmemoized.json b/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/arktsconfig-run-unmemoized.json index b2d38a27865..d6ad3771259 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/arktsconfig-run-unmemoized.json +++ b/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/arktsconfig-run-unmemoized.json @@ -5,7 +5,8 @@ "baseUrl": "./build/unmemoized/src", "paths": { "@koalaui/common": ["../../../../common/src"], - "@koalaui/compat": ["../../../../compat/src/arkts"] + "@koalaui/compat": ["../../../../compat/src/arkts"], + "arkui.stateManagement.runtime": ["../stateMgmt-unmemoize.ts"] } }, "include": ["build/unmemoized/src/**/*.ts", "build/unmemoized/src/*.ts"], diff --git a/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/src/memo/changeListener.ts b/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/src/memo/changeListener.ts index b4fd4b1d35e..df9c090751d 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/src/memo/changeListener.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/src/memo/changeListener.ts @@ -13,6 +13,9 @@ * limitations under the License. */ +// avoid memo-plugin import issue +import { __memo_id_type, __memo_context_type } from "arkui.stateManagement.runtime" + import { KoalaCallsiteKey } from "@koalaui/common" import { scheduleCallback } from "../states/GlobalStateManager" import { StateContext } from "../states/State" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/src/memo/contextLocal.ts b/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/src/memo/contextLocal.ts index 756ed0ae256..820d203e0bc 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/src/memo/contextLocal.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/src/memo/contextLocal.ts @@ -13,6 +13,9 @@ * limitations under the License. */ +// avoid memo-plugin import issue +import { __memo_id_type, __memo_context_type } from "arkui.stateManagement.runtime" + import { __context, __id } from "../internals" import { State } from "../states/State" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/src/memo/entry.ts b/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/src/memo/entry.ts index 77439bafc72..0274f8e9fbc 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/src/memo/entry.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/src/memo/entry.ts @@ -13,6 +13,9 @@ * limitations under the License. */ +// avoid memo-plugin import issue +import { __memo_id_type, __memo_context_type } from "arkui.stateManagement.runtime" + import { KoalaCallsiteKey, KoalaCallsiteKeys, KoalaProfiler } from "@koalaui/common" import { GlobalStateManager } from "../states/GlobalStateManager" import { ComputableState, StateContext } from "../states/State" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/src/memo/remember.ts b/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/src/memo/remember.ts index 827f6a6f758..35be2b53ab0 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/src/memo/remember.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/src/memo/remember.ts @@ -13,6 +13,9 @@ * limitations under the License. */ +// avoid memo-plugin import issue +import { __memo_id_type, __memo_context_type } from "arkui.stateManagement.runtime" + import { functionOverValue } from "@koalaui/common" import { __context, __id } from "../internals" import { scheduleCallback } from "../states/GlobalStateManager" diff --git a/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/tsconfig-unmemoize.json b/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/tsconfig-unmemoize.json index 27497fbb2a6..75b5ce08292 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/tsconfig-unmemoize.json +++ b/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/tsconfig-unmemoize.json @@ -4,6 +4,9 @@ "outDir": "build/unmemoized/lib", "rootDir": ".", "module": "CommonJS", + "paths": { + "arkui.stateManagement.runtime": ["./stateMgmt-unmemoize.ts"] + }, "plugins": [ { "transform": "@koalaui/compiler-plugin/build/lib/src/koala-transformer.js", @@ -14,7 +17,7 @@ } ] }, - "include": [ "src/**/*.ts" ], + "include": [ "src/**/*.ts", "./stateMgmt-unmemoize.ts" ], "references": [ { "path": "../compiler-plugin" }, { "path": "../common" } diff --git a/frameworks/bridge/declarative_frontend/state_mgmt/files_to_watch.gni b/frameworks/bridge/declarative_frontend/state_mgmt/files_to_watch.gni index 20abeb4c7b6..63945ae918b 100644 --- a/frameworks/bridge/declarative_frontend/state_mgmt/files_to_watch.gni +++ b/frameworks/bridge/declarative_frontend/state_mgmt/files_to_watch.gni @@ -97,6 +97,6 @@ state_mgmt_release_files_to_watch = [ "//foundation/arkui/ace_engine/frameworks/bridge/declarative_frontend/state_mgmt/src/lib/sdk/ui_utils.ts", "//foundation/arkui/ace_engine/frameworks/bridge/declarative_frontend/state_mgmt/src/lib/common/gesture_span.ts", "//foundation/arkui/ace_engine/frameworks/bridge/declarative_frontend/state_mgmt/src/lib/common/gesture_span_native.d.ts", - "//foundation/arkui/ace_engine/frameworks/bridge/declarative_frontend/state_mgmt/src/lib/interop/interop.ts", + "//foundation/arkui/ace_engine/frameworks/bridge/declarative_frontend/state_mgmt/src/lib/interop/interop.ts", "//foundation/arkui/ace_engine/frameworks/bridge/declarative_frontend/state_mgmt/src/index.ts", ] -- Gitee