diff --git a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/TabsOpsHandWritten.ts b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/TabsOpsHandWritten.ts index 4c3f0ae79560011e42b2a2eaeea47e84aa6aec6c..ea093b487389fc4c65cbeaed6c0284fcd694f16b 100644 --- a/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/TabsOpsHandWritten.ts +++ b/frameworks/bridge/arkts_frontend/koala_projects/arkoala-arkts/arkui-ohos/src/handwritten/TabsOpsHandWritten.ts @@ -14,7 +14,8 @@ */ import { KPointer, InteropNativeModule } from "@koalaui/interop" -import { TabsOps, BarMode, ScrollableBarModeOptions, BlurStyle, BackgroundBlurStyleOptions, Bindable } from "../component" +import { TabsOps, BarMode, ScrollableBarModeOptions, BlurStyle, BackgroundBlurStyleOptions, SubTabBarStyle, BottomTabBarStyle, CustomBuilder, TabBarOptions, Bindable } from '../component'; +import { ComponentContent } from '../component/arkui-custom' export class TabsOpsHandWritten { static hookTabsAttributeBarModeImpl(node: KPointer, value: BarMode | undefined, options: ScrollableBarModeOptions | undefined) { diff --git a/frameworks/bridge/arkts_frontend/koala_projects/gn/command/npm_util.py b/frameworks/bridge/arkts_frontend/koala_projects/gn/command/npm_util.py index 3f76c1e25a6fba7f38c62fbf39220feac90e5e05..0cd1e6beae7ec83c77d1c056234e89993e92a277 100755 --- a/frameworks/bridge/arkts_frontend/koala_projects/gn/command/npm_util.py +++ b/frameworks/bridge/arkts_frontend/koala_projects/gn/command/npm_util.py @@ -56,24 +56,7 @@ os.environ["PANDA_SDK_PATH"] = os.path.join(os.path.dirname(os.path.realpath(__f def run(args, dir = None): os.chdir(dir or project_path) - if os.environ.get("KOALA_LOG_STDOUT"): - subprocess.run(["npm"] + args, env=os.environ, text=True, check=True, stderr=subprocess.STDOUT) - return - try: - ret = subprocess.run(["npm"] + args, capture_output=True, env=os.environ, text=True, check=True) - print("install log:\n" + ret.stdout + "\n") - with open(koala_log, "a+") as f: - f.write("\n") - f.write("install log:\n" + ret.stdout) - f.close() - except subprocess.CalledProcessError as e: - print("error message: "+ e.stderr + "\n") - with open(koala_log, "a+") as f: - f.write("\n") - f.write(e.stdout + "\n") - f.write("error message: "+ e.stderr + "\n") - f.close() - + subprocess.run(["npm"] + args, env=os.environ, text=True, check=True, stderr=subprocess.STDOUT) def get_check_install_path(dir, project_path): if dir and os.path.exists(dir) and os.path.isdir(dir): base_path = dir diff --git a/frameworks/core/components_ng/pattern/web/web_model_static.cpp b/frameworks/core/components_ng/pattern/web/web_model_static.cpp index 0ddd71c45d50f640beeffd87848d5ff88e731e42..3fb49f9d84a216d62827b048b1a6c5e9671d3ea7 100644 --- a/frameworks/core/components_ng/pattern/web/web_model_static.cpp +++ b/frameworks/core/components_ng/pattern/web/web_model_static.cpp @@ -689,12 +689,15 @@ void WebModelStatic::SetOnRequestFocus(FrameNode* frameNode, std::function&& callback, int dialogEventType) { + TAG_LOGI(AceLogTag::ACE_WEB, "XIA WebModelStatic::SetOnCommonDialog start"); CHECK_NULL_VOID(frameNode); auto uiCallback = [func = callback](const std::shared_ptr& info) -> bool { + TAG_LOGI(AceLogTag::ACE_WEB, "XIA WebModelStatic::SetOnCommonDialog return"); return func(info.get()); }; auto webEventHub = frameNode->GetEventHub(); CHECK_NULL_VOID(webEventHub); + TAG_LOGI(AceLogTag::ACE_WEB, "XIA WebModelStatic::SetOnCommonDialog success"); webEventHub->SetOnCommonDialogEvent(std::move(uiCallback), static_cast(dialogEventType)); } diff --git a/frameworks/core/interfaces/native/implementation/web_modifier.cpp b/frameworks/core/interfaces/native/implementation/web_modifier.cpp index 91ba878b9bde7a4f1d319e2fedeca7167d7fb886..3c2dfa41e4edcb5c948b65b94175c6cdd7f7e832 100644 --- a/frameworks/core/interfaces/native/implementation/web_modifier.cpp +++ b/frameworks/core/interfaces/native/implementation/web_modifier.cpp @@ -710,19 +710,23 @@ void OnPromptImpl(Ark_NativePointer node, const Opt_Callback_OnPromptEvent_Boolean* value) { #ifdef WEB_SUPPORTED +LOGI("XIA OnPromptImpl start"); auto frameNode = reinterpret_cast(node); CHECK_NULL_VOID(frameNode); auto optValue = Converter::GetOptPtr(value); if (!optValue) { // TODO: Reset value + LOGI("XIA OnPromptImpl return 1"); return; } auto instanceId = Container::CurrentId(); WeakPtr weakNode = AceType::WeakClaim(frameNode); auto onPrompt = [callback = CallbackHelper(*optValue), weakNode, instanceId]( const BaseEventInfo* info) -> bool { + LOGI("XIA OnPromptImpl return 2"); return OnPrompt(callback, weakNode, instanceId, info); }; + LOGI("XIA OnPromptImpl success"); WebModelStatic::SetOnCommonDialog(frameNode, onPrompt, DialogEventType::DIALOG_EVENT_PROMPT); #endif // WEB_SUPPORTED } @@ -2061,6 +2065,7 @@ void OnViewportFitChangedImpl(Ark_NativePointer node, const Opt_OnViewportFitChangedCallback* value) { #ifdef WEB_SUPPORTED + LOGE("Enter OnViewportFitChangedImpl"); auto frameNode = reinterpret_cast(node); CHECK_NULL_VOID(frameNode); auto optValue = Converter::GetOptPtr(value); @@ -2074,6 +2079,7 @@ void OnViewportFitChangedImpl(Ark_NativePointer node, const BaseEventInfo* info) { OnViewportFitChanged(callback, weakNode, instanceId, info); }; + LOGE("Get onViewportFitChanged succeed"); WebModelStatic::SetViewportFitChangedId(frameNode, onViewportFitChanged); #endif // WEB_SUPPORTED } diff --git a/frameworks/core/interfaces/native/implementation/web_modifier_callbacks.cpp b/frameworks/core/interfaces/native/implementation/web_modifier_callbacks.cpp index 53b66c1df2eeadac8af4f7112308c856def95766..6f2861d538d99272f3b2ffbdd53e14d9fb3c904e 100644 --- a/frameworks/core/interfaces/native/implementation/web_modifier_callbacks.cpp +++ b/frameworks/core/interfaces/native/implementation/web_modifier_callbacks.cpp @@ -26,7 +26,7 @@ #else #include "image_source_preview.h" #endif // PREVIEW - +#include "base/log/log.h" #include "core/components_ng/pattern/web/web_model_ng.h" #include "core/interfaces/native/implementation/console_message_peer_impl.h" #include "core/interfaces/native/implementation/controller_handler_peer_impl.h" @@ -212,21 +212,40 @@ bool OnConfirm(const CallbackHelper& arkCallbac bool OnPrompt(const CallbackHelper& arkCallback, WeakPtr weakNode, int32_t instanceId, const BaseEventInfo* info) { + LOGI("XIA OnPrompt start"); const auto refNode = weakNode.Upgrade(); + LOGI("XIA GetRefNode success"); CHECK_NULL_RETURN(refNode, false); + LOGI("XIA GetRefNode not Null"); ContainerScope scope(instanceId); auto pipelineContext = PipelineContext::GetCurrentContextSafelyWithCheck(); + LOGI("XIA GetCurrentContextSafelyWithCheck success"); CHECK_NULL_RETURN(pipelineContext, false); pipelineContext->UpdateCurrentActiveNode(weakNode); auto* eventInfo = TypeInfoHelper::DynamicCast(info); CHECK_NULL_RETURN(eventInfo, false); Ark_OnPromptEvent parameter; + LOGI("XIA Init parameter"); parameter.message = Converter::ArkValue(eventInfo->GetMessage()); + TAG_LOGI(AceLogTag::ACE_WEB, " XIA WebModifierCallbacks::OnPort::GetMessage(): %{public}s", + eventInfo->GetMessage().c_str()); parameter.url = Converter::ArkValue(eventInfo->GetUrl()); + TAG_LOGI(AceLogTag::ACE_WEB, "XIA WebModifierCallbacks::OnPort::GetUrl(): %{public}s", eventInfo->GetUrl().c_str()); auto peer = new JsResultPeer(); peer->result = eventInfo->GetResult(); parameter.result = peer; + LOGI("XIA Init parameter success"); + if (!arkCallback.IsValid()) { + TAG_LOGE(AceLogTag::ACE_WEB, "XIA Invalid callback"); + } + LOGI("XIA valid callback"); const auto result = arkCallback.InvokeWithOptConvertResult(parameter); + if (!result.has_value()) { + TAG_LOGE(AceLogTag::ACE_WEB, "XIA Callback returned no value"); + } + LOGI("XIA Callback returned value"); + LOGI("XIA OnPrompt get result success"); + TAG_LOGI(AceLogTag::ACE_WEB, "XIA Callback result: %{public}d", result.value()); return result.value_or(false); } diff --git a/frameworks/core/interfaces/native/utility/callback_helper.h b/frameworks/core/interfaces/native/utility/callback_helper.h index 645824bcb8c6c36e9524977ec511785878439c4d..515487eb9455a6f5290e092f55640e512761b067 100644 --- a/frameworks/core/interfaces/native/utility/callback_helper.h +++ b/frameworks/core/interfaces/native/utility/callback_helper.h @@ -24,6 +24,7 @@ #include "core/interfaces/native/generated/interface/arkoala_api_generated.h" #include "core/interfaces/native/utility/callback_keeper.h" #include "core/interfaces/native/utility/converter.h" +#include "base/log/log.h" namespace OHOS::Ace::NG { @@ -112,13 +113,18 @@ public: template std::optional InvokeWithOptConvertResult(Params&&... args) const { + LOGI("XIA Enter callback_helper::InvokeWithOptConvertResult"); std::optional retValueOpt = std::nullopt; CallbackKeeper::AnyResultHandlerType handler = [&retValueOpt](const void *valuePtr) { retValueOpt = Converter::OptConvert(*(reinterpret_cast(valuePtr))); }; + LOGI("XIA callback_helper::AnyResultHandlerType Success"); auto continuation = CallbackKeeper::RegisterReverseCallback(handler); + LOGI("XIA callback_helper::RegisterReverseCallback Success"); InvokeSync(std::forward(args)..., continuation); + LOGI("XIA callback_helper::InvokeSync Success"); CallbackKeeper::ReleaseReverseCallback(continuation); + LOGI("XIA callback_helper::ReleaseReverseCallback Success"); return retValueOpt; }