diff --git a/frameworks/bridge/arkts_frontend/BUILD.gn b/frameworks/bridge/arkts_frontend/BUILD.gn index 87f7d611d4719b8ae53ab7aef74a6fa4942dc919..f333e927a3b085f280bc45dce98fffae76f068a4 100644 --- a/frameworks/bridge/arkts_frontend/BUILD.gn +++ b/frameworks/bridge/arkts_frontend/BUILD.gn @@ -13,11 +13,28 @@ 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" ] } +link_abc_files("arkoala_abc") { + targets = [ + "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" +} + template("arkts_frontend") { forward_variables_from(invoker, "*") @@ -29,6 +46,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/arkoala/preprocess.py b/frameworks/bridge/arkts_frontend/arkoala/preprocess.py index 6bedcf007ec563f028d74bc81eec4e42658d8dbd..81301fe0c570cb8ee12225917544d36234adfa8f 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 0000000000000000000000000000000000000000..bc1adef6bd15cb2ccb7ac9f3347beeab421cf438 --- /dev/null +++ b/frameworks/bridge/arkts_frontend/arkoala/process_arkoala.py @@ -0,0 +1,90 @@ +#!/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 + + +def parse_argv(argv) -> Paths: + """ + parse command line arguments + """ + if len(argv) < 2: + print("Usage: python process.py ") + sys.exit(1) + + path = Paths() + path.project_path = os.path.abspath(argv[1]) + + return path + +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) + + 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" + 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" + # 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") + return + +def main(argv): + path = parse_argv(argv) + os.chdir(path.project_path) + pre_processing(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 9f83542604d8f579de2c3ac562bc811f4301e229..78c2a5d8e2f3b75d18e4f3a3397ed8284995e1d7 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 0000000000000000000000000000000000000000..01d88a9f1379f227f7239aba3cb336521162be2d --- /dev/null +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/BUILD.gn @@ -0,0 +1,55 @@ +# 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("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" ] + + script = "../../arkoala/process_arkoala.py" + + args = [ + rebase_path("."), + ] + + deps = [ + ":arkoala_annotate", + "../incremental/runtime:runtime_annotate" + ] +} + +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 new file mode 100644 index 0000000000000000000000000000000000000000..693f93e5fd5c80a4f2e3b354a163baefe3e6f247 --- /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/stateManagement/runtime/index-ts.ts", + "./arkui-ohos/src/external/ts/**/*.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 0000000000000000000000000000000000000000..1fa0d062a36d2ab97ebdb58725486e14925136eb --- /dev/null +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arktsconfig-gn.json @@ -0,0 +1,101 @@ +{ + "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" + ], + "arkui.stateManagement.runtime": [ + "./arkui/stateManagement/runtime" + ], + "@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/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" + ], + "@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/arktsconfig-unmemoized.json b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/arktsconfig-unmemoized.json index 11a90a2da211f683d570a77f419f9f9939d7663b..8dc12ed10166d117b4e9584fec0861b3ddc0bc8e 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 6543b86ea8f34a0ccdb1079f291605237d9952b3..438228fd2bafa81eb6f24d2ee0367340f995ac3c 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 "arkui.stateManagement.runtime"; + 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 1714ac94e270782882465130c1012eb85c5537ac..397c62a63f0a4eda3f9dec0b65744e4548d01ff3 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,38 @@ // 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 { 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" -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 4810c1a75f64c0784730112027dca0d67b8ac4ba..389afeb860befa9e24c84771dc8327ea6d04fbd3 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 "arkui.stateManagement.runtime"; + 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 96ad4029f9506d83a74fea34d88e6525b7f1d694..e8ebad0b9ff21179fc209c5a6479dff6026e0d6e 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 "arkui.stateManagement.runtime"; + +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 bd3ea76904c5391dce17dd716c346994b693c404..98733bd826f7e0e41438ac3efcd373931ed3cb9b 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,10 @@ * limitations under the License. */ -import { DrawContext } from "./src/Graphics"; +// 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"; export declare class Utils { 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 127a678dd5b90810dc353e7ae20f09d75d0db565..12f71d75e66df4d454609b1281378a243e98d51c 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 e26642c6b32f54a15e5d559b7e1b80bccb36bca8..0df071f02afb3727fea89b81376f723402131f9e 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 1a60c91fdb316f351b4aa2b87dc3219a18770669..0fc4a53f6376a4b7571049659a7d2b94836c31bd 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 "arkui.stateManagement.runtime"; + 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 95062d656894131275125ca154c0e34b97daf2d2..dfb46b6ce77777f7a9d8d8a9656ee2c931dd1bd3 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 "arkui.stateManagement.runtime"; + export declare namespace common2D { export interface Rect { left: number; 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 aa2d0833dfe7932a02e95f7fe079bdf081b5031e..592c7f63c57963342a3f8944a9033e339e45ada7 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/ohos.measure.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/ohos.measure.ts index f6c93cf6f96a2bc287469a8884dd566c5ddc6e63..f9bf3bf2276d98e217e0bb2c84dae38c0b66bd67 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 ec7305318820e022c92595b71d480319d91c2e5f..8817abcc4258628900bea2854bc485876420fcd3 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 d78963a0078bd406a3b248f0e7209aab924a5049..191c77db7f7ebcfd31b9992f6d8782de4ad1fd21 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 ac104ae8273de0a7ef3b0eff9d547e2758aedde4..861423d084b402b5c176384c94d12084fb7fcfe6 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 9a94d41c832af2c5dbac8fc166e3a8b5959ef59f..0000000000000000000000000000000000000000 --- 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 c7c41881fadc5d95d4e160ae3032bd62523e3109..0000000000000000000000000000000000000000 --- 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 188b7383e2102866a66f75490eae6faea6d1ee26..ffbfa5b10eef73f4e52ddaeec5ed9730dc0818ae 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 "arkui.stateManagement.runtime"; + 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/ReusablePool.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/ReusablePool.ts index a20f3776b2e21c2bb1a8852123dc8a47a477be1b..3410cfb01c9d3466cea24ef0931d971ea2b9f605 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 "arkui.stateManagement.runtime"; + 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 2cba00fe525426588f8163fb87ffab6ad9bab5cc..398179624f2c165b72bcf8deea2e1becca177632 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 "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 901a97b751bf284828d4f6f684504b64ce92a778..9629911e16d453ce55bbdbd8eb417e43d260635d 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 "arkui.stateManagement.runtime"; + 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 0b7d0ec984bd50d63db360795f81e467f0a1f2cf..8bd13a775af978e48d7d91ae3c982cf0d0a0d4c0 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 "arkui.stateManagement.runtime"; + 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 46d53f3de7113100ba97a9ca18538e701b001bb3..0a7684658cb1a20b57e98047021e052128945358 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 "arkui.stateManagement.runtime"; + 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 07fb8f45de60cba60b1d89b9a71e964a3deb0d86..33f8d3ce5840e276608c88f5edb30e30846b1862 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 "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 974d6e07121175eb12ae37f6cf700ba464511b5a..32bfef2a939b169212d5b86f65e06de9c8503f8d 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 "arkui.stateManagement.runtime"; + 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 e45fb1862632ccb5091ae1625b551bedcb5f8c2f..1a75823dc7ff61764f0d26fc8885a1a57a1872e3 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 "arkui.stateManagement.runtime"; + 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 b8e37c8e5aca8d549c1534b712c587c4a22f61f6..a7e0ff4f14db743921c7a9fd791b11322526c7b9 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 "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 d0fed0f32a70e7d6a37431d89cf91394c118d4b4..25f45dbb806e5d6d3e99a2e408ae8a92b9f3f1fa 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 "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 2d197d5794e68f2f36d0b9c69af6131496cd91f6..e42b96c43fad967ba9b989d05cf66bb0e8ed0899 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 "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 d3fe870362c7605a4f521e9ba8b324278bbcaa9a..97fae5e9f949e24db5e41740a6e306c006b064bd 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 "arkui.stateManagement.runtime"; + 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 721d220e7b862b8170ccc50c799787142c263147..927bea28ec3eaedbaea145ed23e9edd325146e97 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 "arkui.stateManagement.runtime"; + 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 366523a58afd3c9c034503c57db8c41fb7764fdd..4eabc82b5a1349db9ccb2801fd04576a233f717b 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 "arkui.stateManagement.runtime"; + 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 ccb13ca0a1b431fbb38cdee47e6b55c8bf374fa7..54c47b10b5bc32e0ed790422497217a86c9ebdf6 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 "arkui.stateManagement.runtime"; + 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 5b14b4d649aaa48218acc34640caf1dffc23b316..979b9a1114d50261e0eaeec3d7ac0b57637aa50d 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 "arkui.stateManagement.runtime"; + 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/common.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/common.ts index d32f6d3972627d945ac32fa5931f2718aeccd5f7..39d4ee9ac3935801174caf2e26e149b9d88cd1a9 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/commonTsEtsApi.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/commonTsEtsApi.ts index ca07f14f83b5aec74b8e855884b39dc4d9fd8246..140223bfb3ab1a22aa31c49b86f1c51712ae6e4e 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 "arkui.stateManagement.runtime"; + 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 6a5343585614678747ec084043f937d8951df591..04460aaf67f7564340e4888fe5d92d0c64535def 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 "arkui.stateManagement.runtime"; + 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 cc656d349915be17083899e1dc057396c8fd7442..da207160485386b356dbb7ba922efabb82891dff 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 dbd0b89888a5284373f141b7f2444826cdb70cd3..69aec033dbe5eb66b6332c861050123aaa951691 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 "arkui.stateManagement.runtime"; + 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 e170763219849f36bd5b2e4b2f76ddb3cef986cb..24d52dc7a79e6458f9f423e45d068b012f4ea540 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 "arkui.stateManagement.runtime"; + 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 4f266842b36933fb59e7c816a8ba3c2f01f5e2b2..ee39ca74c83e464364ae30d244cd5c5570099f3c 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/navigation.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/component/navigation.ts index d9c3c3f41397e833bc31a5b6fb8cc5a77ea89444..cd0add00681b2711454ca2c7d0439c003e4fb19b 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/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 79d246a729048055c11227e8a253fdb9231a73af..87a0c0d6a3c156f6b234d95c5e9f03dc5a3e1dc3 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 "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 9be08068f7e4c2f63b4a19d5e380c05c80ee93d6..fec3e437f13e10948eef527e4f65b2c24a3f6d66 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 "arkui.stateManagement.runtime"; + 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 ef85bc66ca207e9b9daf160e83ff12542ba6aeb1..60b883d892b8570a685a204860edb1347f907f47 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 cbfa63622cec03ac010dfafc3f0e44c56a420a72..25c485b93c64a79ec20c0cf87f425454af113684 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 "arkui.stateManagement.runtime"; + 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 0827972e812cd00c0d4a72ff2bbc765ba9efe631..184e75b59ebdb7ea494f83ca8a04c3ac2739b383 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 "arkui.stateManagement.runtime"; + 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 0fe637b075d2b3b5fa4689996819f41eabb72960..72575f7d18c2a47216312fdf00a5f3bdf774d7b7 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 "arkui.stateManagement.runtime"; + 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 7fae724618f2b355e045a5f6cd3cadfa7678a5f2..d5dce54c3cc4e964f9bad33ef12ee33d945b5c29 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 "arkui.stateManagement.runtime"; + export interface ArkResource { name: string, id: number; 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 1aba374ae024fc48f06dce1380ef6e88a22145b6..27e0c4466f1d3b2bf7f312e1de4ccf8aa2553473 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 "arkui.stateManagement.runtime"; + 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 54caaf7f7dcccc3c688830919176bb62a86e4812..b6b41f7d0ee39635d86b4ec5f77aa8af366f5ca1 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 "arkui.stateManagement.runtime"; + 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 4569635881eb8b550de2b730d9cf14eca9e190a8..17ac2e0d26e7c96c5b2856815a6c1f698d08a7be 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 "arkui.stateManagement.runtime"; + 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 1119f35f2335aa8611c087764ef2ee4d33bbb287..c603473236d76bd89479005e07b4da7f65e5df25 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 "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/RepeatImpl.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/RepeatImpl.ts index 3fb219188b5c73aabc80d9ab470306b8684f95ab..d7d27b31f823f057d66d158af2f9647611c1a7ad 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 4384d1795287652acf3990468c6d9cf8728f3cd7..e8869dbd155b9ca592cab4c68af3b021cfbe6039 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 3a61cda1cbd29c210666855636f16bbcad3adba7..0000000000000000000000000000000000000000 --- 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 d842a5840ced50b2a305267dff4357fd7d198b3a..0000000000000000000000000000000000000000 --- 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 a891232a79ea4232e9372e0f0f2304d619521405..0000000000000000000000000000000000000000 --- 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 0044ac33e68e7b41584cfa1445e29a63458abdf3..0000000000000000000000000000000000000000 --- 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 d3868db117deeea7581218e3d9d6d6932dbe8afe..74d1953944de565f69a7f595f242b95dadc21782 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 "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/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 8f9fbbcdd23cf340c5366a3c2dd6db5dc5c64b55..0000000000000000000000000000000000000000 --- 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 e86e94c7c2ff45a2c6b13c51d2d2ec5dfab1ae52..0000000000000000000000000000000000000000 --- 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 26fdf3b19fdea5e090095efdac050cec2266830c..c228b297b40f853fe6378d18d30c00dfaa303b48 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 a3778f4dedb63779735e364d3cc6a181ef871f72..3c6fa974f35e845298131af6633ccfde9ec03cda 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 "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 7df17d8151a942f652c63d4a3d8039c2d5f3f125..dd054c7f3249347fe6c353867b9319e8042216b1 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 "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 65545bd1b34787e765b30d86484ed11e2cef5178..c411acbbe4ea8f7a99c265555696139413fd0e4d 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 "arkui.stateManagement.runtime"; + 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 503a33522154b2c410ba75912fcd88d205006510..1de052943f9307cd09ec173120a263547be74088 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 "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 9e6354bf0830149d8b6226961e731fd89cf69779..e1ecc3408d0f4e98017634530f7ebfcd0bda66ef 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 "arkui.stateManagement.runtime"; + 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/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 0000000000000000000000000000000000000000..82bef888b0f39705448497816eab7fde686d6c6c --- /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/runtime/index.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/stateManagement/runtime/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..13ec5e2cf010ab372f39371c3d55233e07881717 --- /dev/null +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/stateManagement/runtime/index.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, 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 a353763bb043382ce090cf361ab90abb75b06b57..9444bd55be50447817460e8d26bfcdb7e676b38e 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,15 @@ "arkui.ani": [ "./src/ani/ts" ], + "arkui/*": [ + "./src/*" + ], + "@ohos.arkui.stateManagement": [ + "./src/stateManagement/index.ts" + ], + "arkui.stateManagement.runtime": [ + "./src/stateManagement/runtime/index-ts.ts" + ], "@ohos/animator": [ "./ohos.animator.ts" ], @@ -67,7 +76,7 @@ "global/resource": [ "./global/resource/resource.ts" ], - "@ohos.router": [ + "@ohos/router": [ "./ohos.router.ts" ], "@ohos/arkui/observer": [ @@ -108,6 +117,7 @@ "exclude": [ "./src/component/arkts", "./src/component/arkts/ArkUIGeneratedNativeModule.ts", + "./src/stateManagement/runtime/index.ts", "./src/component/test_utils.ts", "./src/component/main.ts", "./src/external/arkts", @@ -117,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 new file mode 100644 index 0000000000000000000000000000000000000000..d4a46180f8ab32df0bca2a87a712b7e745e8ff3b --- /dev/null +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/components.gni @@ -0,0 +1,455 @@ +# 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 --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", + "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/UserView.ets", + "arkui-preprocessed/arkui/index.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", + "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_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", + "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_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", + "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_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/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-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_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-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_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-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_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-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/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-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_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-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_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-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_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-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_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-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_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-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_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-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_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-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_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-preprocessed/arkui/component/arkts/index.ets", + "arkui-preprocessed/arkui/component/arkts/ArkUIGeneratedNativeModule.ets", + "arkui-preprocessed/arkui/component/shared/ArkResource.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_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_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 = [ + "#components", + "#external", + "arkui.ani", + "arkui", + "arkui/*", + "@koalaui/interop", + "@koalaui/common", + "@koalaui/compat", + "@koalaui/runtime", + "@ohos.arkui.stateManagement", + "arkui.stateManagement.runtime", + "@koalaui/runtime/annotations", + "@ohos/animator", + "@ohos/arkui/UIContext", + "@ohos.arkui.UIContext", + "@ohos.arkui.node", + "@ohos/measure", + "@ohos/font", + "global/resource", + "@ohos/router", + "@ohos/arkui/observer", + "@ohos/graphics/common2D", + "@ohos/graphics/drawing", + "@ohos/arkui/graphics", + "@ohos/promptAction", + "@ohos/arkui/inspector", + "@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", + "arkui-preprocessed/arkui/stateManagement/runtime", + "../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.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/arkoala-arkts/package.json b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/package.json index c313a45aea21aa705df107a8444c836973ae1deb..377b2420ca9a4a6ea0dadb8d29231bcde5075ee6 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", 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 a64cf68943381b191c3da8b67efaa7b01fdd951c..2f1c47d58357ea3490cd4b763341cfd436d458f0 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 998bcebce0547deafca3f5a39cfbe44a448be380..902d6ae968d383beee6566ed43542231fc6f6e9c 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/common/BUILD.gn b/frameworks/bridge/arkts_frontend/koala_projects/incremental/common/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..e1d7bce279eccc8e03710a9c89916854c46d5292 --- /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 0000000000000000000000000000000000000000..1a39491050006e028142f7d9a22647f54f4e2b9b --- /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 2ba480ca2d549e5299bb8d71454f9c7b0294c57f..fd5bcb3301f0919060de39003cbb0a9bdcf2d239 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 0000000000000000000000000000000000000000..f2ca6d7b187373c6787149b84fadf4140d297ce6 --- /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 0000000000000000000000000000000000000000..61e7d07599a7643a563375bdbf7572823512c5ba --- /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 a8bd8b51855a0d0270eb8605817a4f0f3cbd9914..5c6b83805118a0771ecafa016a6a5f7205003037 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 0000000000000000000000000000000000000000..5c53b1c2211b4b57627ccd980a6a5220a5296c2a --- /dev/null +++ b/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/BUILD.gn @@ -0,0 +1,38 @@ +# 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("runtime_annotate") { + outputs = [ "$target_out_dir/ets" ] + + script = "../../tools/annotate.py" + + args = [ + 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 = [ ":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/incremental/runtime/annotations/index.ts b/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/annotations/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..7e51be7e2c8aa179fa907cb89633b29cde413eeb --- /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 0000000000000000000000000000000000000000..67a526bb290c736caf71acebde64951eab2b90c4 --- /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"], + "arkui.stateManagement.runtime": ["../stateMgmt.ts"] + } + }, + "include": ["ets/**/*.ts"] +} 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 b2d38a2786582539c24ffced380094cb833dbb4a..d6ad3771259c8c456fc434b2aaf1223b4bfdfe3e 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/package.json b/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/package.json index 3b51b6cdb38a2d22d0185bc7739034c36a4986e6..1e31bd055ec5bf6ebb461353d8ecda5f2c82f3c6 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 0000000000000000000000000000000000000000..baca41ec7a582149f6e7a5189158b6c7cbd64750 --- /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", + "arkui.stateManagement.runtime", +] + +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 ad6fbbb5ebbbf7c969d350690a3367c4e3791539..d3843d4de02839a5cdc302094ca3fb8a222e89a5 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 43f19e5c7b4032b803359a5e25d3f7f0660a00c8..888e87f7e30942002a9ee174fdb6287da5869f5d 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/changeListener.ts b/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/src/memo/changeListener.ts index b4fd4b1d35e4a3849f5cb47e023afee7db2a079b..df9c090751d6151b3a2713fdabb8c290bd38b92a 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 756ed0ae2560ded078dd0065ec26ec441fad6be2..820d203e0bc754e06c438ccc7785985bdb72f722 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 77439bafc722a1e00662dffa28097d11852eec95..0274f8e9fbcc256055ce0283d15069615decb3c9 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 97bf91867ccf8ba2a78d14cd65f610cc436c8d1e..35be2b53ab07e3e066fdbdd59aff4c42731ed63a 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" @@ -30,7 +33,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 +86,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 962d7ff1b9a99680033b1cecdd31656496de8485..847c77691aa9d3f80577cb48313675b1e4e04f3c 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 0000000000000000000000000000000000000000..c0162a0da71b21e8a0a96a00a78e156c94ad9985 --- /dev/null +++ b/frameworks/bridge/arkts_frontend/koala_projects/incremental/runtime/stateMgmt.ts @@ -0,0 +1,17 @@ +/* + * 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 { memo } from "./annotations" \ No newline at end of file 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 27497fbb2a69c3ae9937184cb1859c755ec4803d..75b5ce082920aa2032f5f84b665602e06c4dbed9 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/arkts_frontend/koala_projects/interop/BUILD.gn b/frameworks/bridge/arkts_frontend/koala_projects/interop/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..10ee17a241748502a107444e0f90f6ea1684cdd5 --- /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 0000000000000000000000000000000000000000..a48609d1e9684b957f28bce24be2fc9af0874542 --- /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 6ae3ac2d8b4f612072e37bee9b64eae3d91a2b01..ce98a298d0ce603d219c36cd78d4f48b184ce912 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 b130150ffe19e3a2cbce5bec549f480af945cfc7..5067c6839ec43664d9d96ad0533a7f9979dcb6b0 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/annotate.py b/frameworks/bridge/arkts_frontend/koala_projects/tools/annotate.py new file mode 100755 index 0000000000000000000000000000000000000000..138caa0304d41817f3b8c1092ca300d159b3b026 --- /dev/null +++ b/frameworks/bridge/arkts_frontend/koala_projects/tools/annotate.py @@ -0,0 +1,125 @@ +#!/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 +import shutil +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) + if os.path.exists(output_dir): + shutil.rmtree(output_dir) + + # 递归获取所有文件,保持相对路径 + 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()) 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 0000000000000000000000000000000000000000..f7afdeb429778c89f9f81eac4aad44c1f8ab81e6 --- /dev/null +++ b/frameworks/bridge/arkts_frontend/koala_projects/tools/gen_gni.py @@ -0,0 +1,204 @@ +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, part_index=None): + """ + 根据 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): + """ + 解析 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, part_size=None): + """ + 生成 .gni 文件,包含文件列表和 paths 的 keys 和 values 数组 + """ + # 根据 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") + + # 处理文件列表的分割 + 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") + 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.") + parser.add_argument("--part-size", type=int, help="Maximum size of each file list part.") + 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, args.part_size) + 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 0000000000000000000000000000000000000000..64890734fcbccab67cd0dfc6e33831e70fc9aa31 --- /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 0000000000000000000000000000000000000000..0be111294bb56edc114ee456d59ffb8d2663c8ea --- /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 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 20abeb4c7b6d981509ae23ff7cbb525fdbf3147b..63945ae918ba71d4dff85689b78317b11af7d07b 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", ]