diff --git a/.clang-format b/.clang-format new file mode 100755 index 0000000..f07283e --- /dev/null +++ b/.clang-format @@ -0,0 +1,160 @@ +Language: Cpp +# BasedOnStyle: LLVM +# 访问说明符(public、private等)的偏移 +AccessModifierOffset: -4 +# 开括号(开圆括号、开尖括号、开方括号)后的对齐 +AlignAfterOpenBracket: Align +# 连续赋值时,等号对齐 +AlignConsecutiveAssignments: false +# 连续赋值时,变量名对齐 +AlignConsecutiveDeclarations: false +# 左对齐逃脱换行(使用反斜杠换行)的反斜杠 +AlignEscapedNewlinesLeft: true +# 水平对齐二元和三元表达式的操作数 +AlignOperands: true +# 对齐连续的尾随的注释 +AlignTrailingComments: true +# 允许函数声明的所有参数在放在下一行 +AllowAllParametersOfDeclarationOnNextLine: false +# 允许短的块放在同一行 +AllowShortBlocksOnASingleLine: false +# 允许短的case标签放在同一行 +AllowShortCaseLabelsOnASingleLine: false +# 允许短的函数放在同一行: None, InlineOnly(定义在类中), Empty(空函数), Inline(定义在类中,空函数), All +AllowShortFunctionsOnASingleLine: Empty +# 允许短的if语句保持在同一行 +AllowShortIfStatementsOnASingleLine: false +# 允许短的循环保持在同一行 +AllowShortLoopsOnASingleLine: false +# 总是在定义返回类型后换行(deprecated) +AlwaysBreakAfterDefinitionReturnType: None +# 总是在返回类型后换行: None, All, TopLevel(顶级函数,不包括在类中的函数), +# AllDefinitions(所有的定义,不包括声明), TopLevelDefinitions(所有的顶级函数的定义) +AlwaysBreakAfterReturnType: None +# 总是在多行string字面量前换行 +AlwaysBreakBeforeMultilineStrings: true +# 总是在template声明后换行 +AlwaysBreakTemplateDeclarations: false +# false表示函数实参要么都在同一行,要么都各自一行 +BinPackArguments: true +# false表示所有形参要么都在同一行,要么都各自一行 +BinPackParameters: false +# 大括号换行,只有当BreakBeforeBraces设置为Custom时才有效 +BraceWrapping: + AfterClass: false + AfterControlStatement: false + AfterEnum: false + AfterFunction: true + AfterNamespace: false + AfterObjCDeclaration: false + AfterStruct: false + AfterUnion: false + BeforeCatch: false + BeforeElse: false + IndentBraces: false +# 在二元运算符前换行: None(在操作符后换行), NonAssignment(在非赋值的操作符前换行), All(在操作符前换行) +BreakBeforeBinaryOperators: None +# 在大括号前换行: Attach(始终将大括号附加到周围的上下文), Linux(除函数、命名空间和类定义,与Attach类似), +# Mozilla(除枚举、函数、记录定义,与Attach类似), Stroustrup(除函数定义、catch、else,与Attach类似), +# Allman(总是在大括号前换行), GNU(总是在大括号前换行,并对于控制语句的大括号增加额外的缩进), WebKit(在函数前换行), Custom +# 注:这里认为语句块也属于函数 +BreakBeforeBraces: Custom +# 在三元运算符前换行 +BreakBeforeTernaryOperators: true +# 在构造函数的初始化列表的逗号前换行 +BreakConstructorInitializersBeforeComma: false +# 每行字符的限制,0表示没有限制 +ColumnLimit: 120 +# 描述具有特殊意义的注释的正则表达式,它不应该被分割为多行或以其它方式改变 +CommentPragmas: "^ IWYU pragma:" +# 构造函数的初始化列表要么都在同一行,要么都各自一行 +ConstructorInitializerAllOnOneLineOrOnePerLine: true +# 构造函数的初始化列表的缩进宽度 +ConstructorInitializerIndentWidth: 4 +# 延续的行的缩进宽度 +ContinuationIndentWidth: 4 +# 去除C++11的列表初始化的大括号{后和}前的空格 +Cpp11BracedListStyle: true +# 继承最常用的指针和引用的对齐方式 +DerivePointerAlignment: false +# 关闭格式化 +DisableFormat: false +# 自动检测函数的调用和定义是否被格式为每行一个参数(Experimental) +ExperimentalAutoDetectBinPacking: false +# 需要被解读为foreach循环而不是函数调用的宏 +ForEachMacros: [foreach, Q_FOREACH, BOOST_FOREACH] +# 对#include进行排序,匹配了某正则表达式的#include拥有对应的优先级,匹配不到的则默认优先级为INT_MAX(优先级越小排序越靠前), +# 可以定义负数优先级从而保证某些#include永远在最前面 +IncludeCategories: + - Regex: '^"(llvm|llvm-c|clang|clang-c)/' + Priority: 2 + - Regex: '^(<|"(gtest|isl|json)/)' + Priority: 3 + - Regex: ".*" + Priority: 1 +# 缩进case标签 +IndentCaseLabels: true +# 缩进宽度 +IndentWidth: 4 +# 函数返回类型换行时,缩进函数声明或函数定义的函数名 +IndentWrappedFunctionNames: true +# 保留在块开始处的空行 +KeepEmptyLinesAtTheStartOfBlocks: true +# 开始一个块的宏的正则表达式 +MacroBlockBegin: "" +# 结束一个块的宏的正则表达式 +MacroBlockEnd: "" +# 连续空行的最大数量 +MaxEmptyLinesToKeep: 1 +# 命名空间的缩进: None, Inner(缩进嵌套的命名空间中的内容), All +NamespaceIndentation: None +# 使用ObjC块时缩进宽度 +ObjCBlockIndentWidth: 4 +# 在ObjC的@property后添加一个空格 +ObjCSpaceAfterProperty: false +# 在ObjC的protocol列表前添加一个空格 +ObjCSpaceBeforeProtocolList: true +# 在call(后对函数调用换行的penalty +PenaltyBreakBeforeFirstCallParameter: 19 +# 在一个注释中引入换行的penalty +PenaltyBreakComment: 300 +# 第一次在<<前换行的penalty +PenaltyBreakFirstLessLess: 120 +# 在一个字符串字面量中引入换行的penalty +PenaltyBreakString: 1000 +# 对于每个在行字符数限制之外的字符的penalt +PenaltyExcessCharacter: 1000000 +# 将函数的返回类型放到它自己的行的penalty +PenaltyReturnTypeOnItsOwnLine: 60 +# 指针和引用的对齐: Left, Right, Middle +PointerAlignment: Right +# 允许重新排版注释 +ReflowComments: true +# 允许排序#include +SortIncludes: true +# 在C风格类型转换后添加空格 +SpaceAfterCStyleCast: false +# 在赋值运算符之前添加空格 +SpaceBeforeAssignmentOperators: true +# 开圆括号之前添加一个空格: Never, ControlStatements, Always +SpaceBeforeParens: ControlStatements +# 在空的圆括号中添加空格 +SpaceInEmptyParentheses: false +# 在尾随的评论前添加的空格数(只适用于//) +SpacesBeforeTrailingComments: 1 +# 在尖括号的<后和>前添加空格 +SpacesInAngles: false +# 在容器(ObjC和JavaScript的数组和字典等)字面量中添加空格 +SpacesInContainerLiterals: true +# 在C风格类型转换的括号中添加空格 +SpacesInCStyleCastParentheses: false +# 在圆括号的(后和)前添加空格 +SpacesInParentheses: false +# 在方括号的[后和]前添加空格,lamda表达式和未指明大小的数组的声明不受影响 +SpacesInSquareBrackets: false +# 标准: Cpp03, Cpp11, Auto +Standard: Cpp11 +# tab宽度 +TabWidth: 4 +# 使用tab字符: Never, ForIndentation, ForContinuationAndIndentation, Always +UseTab: Never diff --git a/.gitee/ISSUE_TEMPLATE.zh-CN.md b/.gitee/ISSUE_TEMPLATE.zh-CN.md new file mode 100755 index 0000000..f09d98d --- /dev/null +++ b/.gitee/ISSUE_TEMPLATE.zh-CN.md @@ -0,0 +1,13 @@ +### 该问题是怎么引起的? + + + +### 重现步骤 + + + +### 报错信息 + + + + diff --git a/.gitee/PULL_REQUEST_TEMPLATE.zh-CN.md b/.gitee/PULL_REQUEST_TEMPLATE.zh-CN.md new file mode 100755 index 0000000..33948fd --- /dev/null +++ b/.gitee/PULL_REQUEST_TEMPLATE.zh-CN.md @@ -0,0 +1,15 @@ +### 相关的Issue + + +### 原因(目的、解决的问题等) + + +### 描述(做了什么,变更了什么) + + +### 测试用例(新增、改动、可能影响的功能) + + + + + diff --git a/.gitignore b/.gitignore new file mode 100755 index 0000000..e09a3a0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +x64/ +x32 +*.vcxproj.user +.vscode + +target/ +node_modules/ +moduletest/ diff --git a/BUILD.gn b/BUILD.gn new file mode 100755 index 0000000..de550be --- /dev/null +++ b/BUILD.gn @@ -0,0 +1,229 @@ +#Copyright (c) 2020 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/lite/config/component/lite_component.gni") +import("//build/lite/config/subsystem/aafwk/config.gni") + +declare_args() { + LOSCFG_TEST_JS_BUILD = false +} + +lite_component("jsfwk") { + features = [ ":ace_lite" ] +} + +config("ace_lite_config") { + include_dirs = [ + "//foundation/graphic/lite/interfaces/innerkits/ui", + "//foundation/graphic/lite/interfaces/innerkits/ui/dock", + "//foundation/graphic/lite/interfaces/innerkits/ui/common", + "//foundation/graphic/lite/interfaces/kits", + "//foundation/graphic/lite/interfaces/kits/config", + "//foundation/graphic/lite/interfaces/kits/surface", + "//foundation/graphic/lite/interfaces/kits/ui", + "//foundation/graphic/lite/interfaces/kits/ui/animator", + "//foundation/graphic/lite/interfaces/kits/ui/common", + "//foundation/graphic/lite/interfaces/kits/ui/components", + "//foundation/graphic/lite/interfaces/kits/ui/dfx", + "//foundation/graphic/lite/interfaces/kits/ui/events", + "//foundation/graphic/lite/interfaces/kits/ui/font", + "//foundation/graphic/lite/interfaces/kits/ui/layout", + "//foundation/graphic/lite/interfaces/kits/ui/themes", + "//foundation/graphic/lite/interfaces/kits/utils", + "//utils/native/lite/include", + "//foundation/aafwk/interfaces/kits/ability_lite", + "//foundation/aafwk/interfaces/kits/want_lite", + "//foundation/aafwk/interfaces/innerkits/abilitymgr_lite", + "//foundation/appexecfwk/interfaces/kits/bundle_lite", + "//foundation/appexecfwk/utils/bundle_lite", + "//foundation/ace/lite/tools/simulator/config", + ] + + include_dirs += ["//third_party/bounds_checking_function/include", + "//foundation/ace/interfaces/innerkits/builtin/async", + "//foundation/ace/interfaces/innerkits/builtin/base", + "//foundation/ace/interfaces/innerkits/builtin/jsi", + "include/context", + "include/base", + "include/modules", + "include/resource", + "src/core", + "src/core/animation", + "src/core/base", + "src/core/components", + "src/core/context", + "src/core/directive", + "src/core/router", + "src/core/jsi", + "src/core/modules", + "src/core/router", + "src/core/stylemgr", + "src/core/wrapper", + "targets", + "//kernel/liteos_a/kernel/include/", + "//kernel/liteos_a/kernel/common", + "//third_party/jerryscript/jerry-core/include", + "//third_party/jerryscript/jerry-ext/include/jerryscript-ext", + "///third_party/jerryscript/jerry-port/default/include", + "//third_party/cJSON", + "//utils/native/lite/timer_task/include/", + "//third_party/freetype/include", + ] + if (ohos_kernel_type == "liteos_a" || ohos_kernel_type == "liteos_m" || + ohos_kernel_type == "liteos_riscv") { + include_dirs += [ "targets/liteos_a" ] + } else if (ohos_kernel_type == "linux") { + include_dirs += [ + "targets/linux", + ] + } + + ldflags = ["-lstdc++"] + ldflags += ["-lpthread"] + ldflags += ["-Wl,-rpath-link=$ohos_root_path/$root_out_dir"] +} + +shared_library("ace_lite") { + configs -= [ "//build/lite/config:language_cpp" ] + cflags = [ + "-Wall", + "-Wno-format", + "-Wno-format-extra-args", + ] + cflags_cc = [ "-std=c++14" ] + cflags_cc += cflags + configs += [":ace_lite_config"] + + sources = [ + "src/core/animation/transition_impl.cpp", + "src/core/async/js_async_work.cpp", + "src/core/async/message_queue_utils.cpp", + "src/core/base/ace_log.cpp", + "src/core/base/ace_mem_base.cpp", + "src/core/base/js_fwk_common.cpp", + "src/core/base/key_parser.cpp", + "src/core/base/time_util.cpp", + "src/core/base/js_debugger_config.cpp", + "src/core/base/memory_heap.cpp", + "src/core/components/video_view.cpp", + "src/core/components/analog_clock_component.cpp", + "src/core/components/camera_component.cpp", + "src/core/components/canvas_component.cpp", + "src/core/components/chart_component.cpp", + "src/core/components/clock_hand_component.cpp", + "src/core/components/component.cpp", + "src/core/components/component_utils.cpp", + "src/core/components/div_component.cpp", + "src/core/components/event_listener.cpp", + "src/core/components/image_animator_component.cpp", + "src/core/components/image_component.cpp", + "src/core/components/input_component.cpp", + "src/core/components/list_adapter.cpp", + "src/core/components/list_component.cpp", + "src/core/components/marquee_component.cpp", + "src/core/components/panel_view.cpp", + "src/core/components/picker_view_component.cpp", + "src/core/components/progress_component.cpp", + "src/core/components/scroll_layer.cpp", + "src/core/components/slider_component.cpp", + "src/core/components/swiper_component.cpp", + "src/core/components/switch_component.cpp", + "src/core/components/tab_bar_component.cpp", + "src/core/components/tab_content_component.cpp", + "src/core/components/tabs_component.cpp", + "src/core/components/text_component.cpp", + "src/core/components/video_component.cpp", + "src/core/context/ace_ability.cpp", + "src/core/context/ace_event_error_code.cpp", + "src/core/context/fatal_handler.cpp", + "src/core/context/js_ability.cpp", + "src/core/context/js_ability_impl.cpp", + "src/core/context/js_app_context.cpp", + "src/core/context/js_app_environment.cpp", + "src/core/context/js_framework_raw.cpp", + "src/core/context/js_profiler.cpp", + "src/core/context/js_timer_list.cpp", + "src/core/directive/descriptor_utils.cpp", + "src/core/directive/directive_watcher_callback.cpp", + "src/core/jsi/jsi.cpp", + #"src/core/modules/presets/jstest_module.cpp", + "src/core/modules/presets/timer_module.cpp", + "src/core/modules/app_module.cpp", + "src/core/modules/module_manager.cpp", + "src/core/modules/presets/cjson_parser.cpp", + "src/core/modules/presets/console_log_impl.cpp", + "src/core/modules/presets/console_module.cpp", + "src/core/modules/presets/localization_module.cpp", + #"src/core/modules/presets/feature_ability_module.cpp", + "src/core/modules/presets/preset_module.cpp", + "src/core/modules/presets/profiler_module.cpp", + "src/core/modules/presets/render_module.cpp", + "src/core/modules/presets/require_module.cpp", + "src/core/modules/presets/version_module.cpp", + "src/core/modules/router_module.cpp", + "src/core/modules/dfx_module.cpp", + "src/core/modules/sample_module.cpp", + "src/core/resource/video_play_image_res.cpp", + "src/core/resource/video_muted_image_res.cpp", + "src/core/router/js_page_state.cpp", + "src/core/router/js_page_state_machine.cpp", + "src/core/router/js_router.cpp", + "src/core/stylemgr/app_style.cpp", + "src/core/stylemgr/app_style_item.cpp", + "src/core/stylemgr/app_style_list.cpp", + "src/core/stylemgr/app_style_manager.cpp", + "src/core/stylemgr/app_style_sheet.cpp", + "src/core/wrapper/js.cpp", + "targets/platform_adapter.cpp", + ] + + public_deps = [ + "//third_party/cJSON:cjson_shared", + "//third_party/bounds_checking_function:libsec_shared", + "//third_party/jerryscript/jerry-core:jerry-core_shared", + "//third_party/jerryscript/jerry-ext:jerry-ext_shared", + "//third_party/jerryscript/jerry-libm:jerry-libm_shared", + "//third_party/jerryscript/jerry-port/default:jerry-port-default_shared", + "//base/security/frameworks/crypto_lite/js/builtin:ace_kit_cipher", + "//utils/native/lite/js/builtin:ace_utils_kits", + "//utils/native/lite/timer_task:ace_kit_timer", + "//foundation/multimedia/frameworks/camera_lite:camera", + "//foundation/multimedia/frameworks/player_lite:player", + "//foundation/multimedia/interfaces/kits/player_lite/js/builtin:audio_api", + "//foundation/graphic/lite/frameworks/surface:surface", + ] + + defines = [] + + if (ohos_build_type == "debug") { + defines += [ + "JS_PROFILER=1" + ] + } else { + defines += [ + "JS_PROFILER=0" + ] + } + + if (LOSCFG_TEST_JS_BUILD) { + defines += [ + "JSFWK_TEST" + ] + } + + if (enable_ohos_appexecfwk_feature_ability == true) { + defines += [ + "ABILITY_WINDOW_SUPPORT" + ] + } +} diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100755 index 0000000..9014475 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,144 @@ +# Copyright (c) 2020 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. + +cmake_minimum_required(VERSION 3.16.5) + +project(jsfwk LANGUAGES CXX) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +# compile options +add_compile_options(-fpermissive -Wno-narrowing) + +set(ACE_LITE_CONFIG_PATH "${CMAKE_CURRENT_SOURCE_DIR}/targets/simulator/win") +set(ACE_LITE_INNERKITS_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../interfaces/innerkits/builtin") +set(JSFWK_INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/include") +set(JSFWK_INNERKITS_BUILTIN_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../../foundation/ace/interfaces/innerkits/builtin") +set(JSFWK_SOURCE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/src/core") +set(UIKIT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../../foundation/graphic/lite") +set(THIRTY_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../../third_party") +set(JSFWK_SIMULATOR_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../../tools/developer_tools_lite/graphic_tool/simulator") +set(JS_API_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../api/emui_band/MoltenCore/application/framework/ace/api") +set(AAFWK_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../../aafwk") + +# add definitions +# temporarily set, when ui and graphic unifid, this can be removed +add_definitions(-DSCREENRESOLUTION_CMAKE) + +# setup jerryscript +include(${CMAKE_ROOT}/Modules/ExternalProject.cmake) +ExternalProject_Add(jerryscript + SOURCE_DIR ${THIRTY_PATH}/jerryscript + BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/jerryscript + CMAKE_ARGS -DJERRY_EXTERNAL_CONTEXT=${JERRY_EXTERNAL_CONTEXT} + -DJERRY_DEBUGGER=${JERRY_DEBUGGER} + -DJERRY_CMDLINE=OFF + -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} + -DTOOLCHAIN_PATH=${TOOLCHAIN_PATH} + -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} + BUILD_COMMAND $(MAKE) VERBOSE=1 -j 8 + INSTALL_COMMAND "" + BUILD_ALWAYS 1 +) + +# header files +include_directories( + ${ACE_LITE_CONFIG_PATH} + ${ACE_LITE_INNERKITS_PATH}/async + ${ACE_LITE_INNERKITS_PATH}/base + ${ACE_LITE_INNERKITS_PATH}/jsi + ${JSFWK_INCLUDE_PATH}/async + ${JSFWK_INCLUDE_PATH}/base + ${JSFWK_INCLUDE_PATH}/context + ${JSFWK_INCLUDE_PATH}/jsi + ${JSFWK_SOURCE_PATH} + ${JSFWK_SOURCE_PATH}/animation + ${JSFWK_SOURCE_PATH}/base + ${JSFWK_SOURCE_PATH}/components + ${JSFWK_SOURCE_PATH}/context + ${JSFWK_SOURCE_PATH}/directive + ${JSFWK_SOURCE_PATH}/jsi + ${JSFWK_SOURCE_PATH}/modules + ${JSFWK_SOURCE_PATH}/modules/presets + ${JSFWK_SOURCE_PATH}/router + ${JSFWK_SOURCE_PATH}/stylemgr + ${JSFWK_SOURCE_PATH}/wrapper + ${CMAKE_CURRENT_SOURCE_DIR}/targets + ${CMAKE_CURRENT_SOURCE_DIR}/test/mock + ${CMAKE_CURRENT_SOURCE_DIR}/test/unittest + ${THIRTY_PATH}/cJSON + ${THIRTY_PATH}/jerryscript/jerry-core/include + ${THIRTY_PATH}/jerryscript/jerry-ext/include/jerryscript-ext + ${THIRTY_PATH}/jerryscript/jerry-port/default/include + ${THIRTY_PATH}/freetype/include + ${JSFWK_SIMULATOR_PATH}/config + ${JS_API_PATH}/timer + ${AAFWK_PATH}/frameworks/abilitymgr_lite/include) + +# source files +aux_source_directory(${JSFWK_SOURCE_PATH}/animation ANIMATION) +aux_source_directory(${JSFWK_SOURCE_PATH}/base BASE) +aux_source_directory(${JSFWK_SOURCE_PATH}/components COMPONENTS) +aux_source_directory(${JSFWK_SOURCE_PATH}/context CONTEXT) +aux_source_directory(${JSFWK_SOURCE_PATH}/directive DIRECTIVE) +aux_source_directory(${JSFWK_SOURCE_PATH}/jsi JSI) +aux_source_directory(${JSFWK_SOURCE_PATH}/modules MODULES) +aux_source_directory(${JSFWK_SOURCE_PATH}/modules/presets MODULES_PRESETS) +aux_source_directory(${JSFWK_SOURCE_PATH}/router ROUTER) +aux_source_directory(${JSFWK_SOURCE_PATH}/stylemgr STYLEMGR) +aux_source_directory(${JSFWK_SOURCE_PATH}/wrapper WRAPPER) +aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/targets TARGETS) +aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/test TEST) +aux_source_directory(${CMAKE_CURRENT_SOURCE_DIR}/test/unittest UNITTEST) + +list(REMOVE_ITEM CONTEXT "${JSFWK_SOURCE_PATH}/context/ace_ability.cpp") +list(REMOVE_ITEM MODULES_PRESETS "${JSFWK_SOURCE_PATH}/modules/presets/jstest_module.cpp") +list(REMOVE_ITEM UNITTEST + "${CMAKE_CURRENT_SOURCE_DIR}/test/unittest/tabs_tdd_test.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/test/unittest/js_async_work_tdd_test.cpp" + "${CMAKE_CURRENT_SOURCE_DIR}/test/unittest/message_queue_utils_tdd_test.cpp") + +add_library(jsfwk STATIC + ${ANIMATION} + ${BASE} + ${COMPONENTS} + ${CONTEXT} + ${DIRECTIVE} + ${JSI} + ${MODULES} + ${MODULES_PRESETS} + ${ROUTER} + ${STYLEMGR} + ${WRAPPER} + ${TEST} + ${TARGETS} + ) +target_include_directories(jsfwk PUBLIC + ${JSFWK_INNERKITS_BUILTIN_PATH} + ${JSFWK_INNERKITS_BUILTIN_PATH}/async + ${JSFWK_INNERKITS_BUILTIN_PATH}/base + ${JSFWK_INNERKITS_BUILTIN_PATH}/jsi + ${JSFWK_INCLUDE_PATH} + ${JSFWK_INCLUDE_PATH}/base + ${JSFWK_INCLUDE_PATH}/context + ${ACE_LITE_CONFIG_PATH} + ${AAFWK_PATH}/frameworks/abilitymgr_lite/include) +add_dependencies(jsfwk jerryscript) +target_link_directories(jsfwk PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/jerryscript/lib) +target_link_libraries(jsfwk global_resmgr ui -Wl,--whole-archive jerry-port-default jerry-ext jerry-core -Wl,--no-whole-archive) + +if (${JERRY_EXTERNAL_CONTEXT} STREQUAL ON) + target_compile_definitions(jsfwk PUBLIC -DJS_ENGINE_EXTERNAL_CONTEXT) +endif() diff --git a/LICENSE b/LICENSE new file mode 100755 index 0000000..4a45986 --- /dev/null +++ b/LICENSE @@ -0,0 +1,177 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/examples/airquality/src/main/config.json b/examples/airquality/src/main/config.json new file mode 100755 index 0000000..d78468c --- /dev/null +++ b/examples/airquality/src/main/config.json @@ -0,0 +1,48 @@ +{ + "app": { + "bundleName": "com.huawei.airquality", + "vendor": "huawei", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 3, + "target": 3 + } + }, + "deviceConfig": { + "default": { + } + }, + "module": { + "deviceType": [ + "liteWearable", + "smartVision" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry" + }, + "abilities": [ + { + "name": "default", + "icon": "$media:icon", + "label": "airquality", + "type": "page", + "visible": true + } + ], + "js": [ + { + "name": "default", + "pages": [ + "pages/index/index", + "pages/detail/detail", + "pages/history/history" + ] + } + ] + } +} diff --git a/examples/airquality/src/main/js/default/app.js b/examples/airquality/src/main/js/default/app.js new file mode 100755 index 0000000..b99bb74 --- /dev/null +++ b/examples/airquality/src/main/js/default/app.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2020 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 default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +} diff --git a/examples/airquality/src/main/js/default/common/cloud.png b/examples/airquality/src/main/js/default/common/cloud.png new file mode 100755 index 0000000..de20160 Binary files /dev/null and b/examples/airquality/src/main/js/default/common/cloud.png differ diff --git a/examples/airquality/src/main/js/default/common/cloud_green.png b/examples/airquality/src/main/js/default/common/cloud_green.png new file mode 100755 index 0000000..c608933 Binary files /dev/null and b/examples/airquality/src/main/js/default/common/cloud_green.png differ diff --git a/examples/airquality/src/main/js/default/common/cloud_red.png b/examples/airquality/src/main/js/default/common/cloud_red.png new file mode 100755 index 0000000..5f2cfd5 Binary files /dev/null and b/examples/airquality/src/main/js/default/common/cloud_red.png differ diff --git a/examples/airquality/src/main/js/default/common/cloud_yellow.png b/examples/airquality/src/main/js/default/common/cloud_yellow.png new file mode 100755 index 0000000..f00786f Binary files /dev/null and b/examples/airquality/src/main/js/default/common/cloud_yellow.png differ diff --git a/examples/airquality/src/main/js/default/common/week.png b/examples/airquality/src/main/js/default/common/week.png new file mode 100755 index 0000000..4b09ef3 Binary files /dev/null and b/examples/airquality/src/main/js/default/common/week.png differ diff --git a/examples/airquality/src/main/js/default/i18n/en-US.json b/examples/airquality/src/main/js/default/i18n/en-US.json new file mode 100755 index 0000000..54c842c --- /dev/null +++ b/examples/airquality/src/main/js/default/i18n/en-US.json @@ -0,0 +1,22 @@ +{ + "HangZhou":"HangZhou", + "ShangHai":"ShangHai", + "Good":"Good", + "Unhealth":"Unhealth", + "Normal":"Normal", + "airQuality":"Air Quality", + "History":"History", + "Close":"Close", + "updated":"Updated", + "dataSourceName":"From", + "sampledOn":"Sampled on", + "monitoringStation":"Monitoring Station", + "historicalData":"Historical Data", + "Monday":"Mo", + "Tuesday":"Tu", + "Wednesday":"We", + "Thursday":"Th", + "Friday":"Fr", + "Saturday":"Sa", + "Sunday":"Su" +} \ No newline at end of file diff --git a/examples/airquality/src/main/js/default/i18n/zh-CN.json b/examples/airquality/src/main/js/default/i18n/zh-CN.json new file mode 100755 index 0000000..d03eb48 --- /dev/null +++ b/examples/airquality/src/main/js/default/i18n/zh-CN.json @@ -0,0 +1,21 @@ +{ + "HangZhou":"杭州", + "ShangHai":"上海", + "Good":"良好", + "Unhealth":"差", + "Normal":"一般", + "airQuality":"空气质量监测", + "History":"历史", + "Close":"关闭", + "updated":"更新于", + "dataSourceName":"数据源", + "sampledOn":"采样时间", + "historicalData":"历史数据", + "Monday":"周一", + "Tuesday":"周二", + "Wednesday":"周三", + "Thursday":"周四", + "Friday":"周五", + "Saturday":"周六", + "Sunday":"周日" +} \ No newline at end of file diff --git a/examples/airquality/src/main/js/default/pages/detail/detail.css b/examples/airquality/src/main/js/default/pages/detail/detail.css new file mode 100755 index 0000000..d2928fc --- /dev/null +++ b/examples/airquality/src/main/js/default/pages/detail/detail.css @@ -0,0 +1,40 @@ +/* +* Copyright (c) 2020 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. +*/ +.line-div{ + background-color:#f5fffa; + height:2px; + width:454px; +} +.info-div-width-height{ + width:321px; + height:35px; + margin-top: 20px; +} +.gas-name{ + color:#f5fffa; + width:160px; + height:35px; +} +.gas-value{ + text-align:right; + color:#00fa9a; + width:160px; + height:35px; +} +.config-info { + height:40px; + width:321px; + color:#f5fffa; +} diff --git a/examples/airquality/src/main/js/default/pages/detail/detail.hml b/examples/airquality/src/main/js/default/pages/detail/detail.hml new file mode 100755 index 0000000..fa52725 --- /dev/null +++ b/examples/airquality/src/main/js/default/pages/detail/detail.hml @@ -0,0 +1,55 @@ + + + +
+ {{location}} +
+
+ CO + {{airData[0]}} +
+
+ NO2 + {{airData[1]}} +
+
+ PM10 + {{airData[2]}} +
+
+ PM2.5 + {{airData[3]}} +
+
+ SO2 + {{airData[4]}} +
+
+
+ +
+ {{updated}}:{{udpateStatus}} + {{dataSourceName}}:{{dataSource}} +
+
+ + +
+
+
+
\ No newline at end of file diff --git a/examples/airquality/src/main/js/default/pages/detail/detail.js b/examples/airquality/src/main/js/default/pages/detail/detail.js new file mode 100755 index 0000000..267805b --- /dev/null +++ b/examples/airquality/src/main/js/default/pages/detail/detail.js @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2020 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 router from '@system.router' + +export default { + data:{ + location:"HangZhou", + udpateStatus:"15:13", + dataSource:"tianqi.com", + updated:'Updated', + dataSourceName:'Data Source', + selectedIndex:0, + airData:['100', '90', '120', '50', '150', '40', '25'] + }, + onInit(){ + this.location = this.$t(this.location); + this.updated = this.$t("updated"); + this.dataSourceName = this.$t("dataSourceName"); + this.sampledOn = this.$t("sampledOn"); + this.monitoringStation = this.$t("monitoringStation"); + this.selectedIndex = this.selectedCityIndex; + }, + openHistroy(){ + router.replace({ + uri:'pages/history/history' + }); + }, + backMain(){ + router.replace({ + uri:'pages/index/index', + params:{selectedCityIndex:this.selectedIndex} + }); + } +} \ No newline at end of file diff --git a/examples/airquality/src/main/js/default/pages/history/history.css b/examples/airquality/src/main/js/default/pages/history/history.css new file mode 100755 index 0000000..44eb9e2 --- /dev/null +++ b/examples/airquality/src/main/js/default/pages/history/history.css @@ -0,0 +1,34 @@ +/* +* Copyright (c) 2020 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. +*/ +.div-info-location{ + color:#dcdcdc; + width:321px; + height:40px; +} +.div-info-historical-data{ + color:#f5fffa; + width:321px; + height:40px; +} +.gas-name{ + color:#f0ffff; + text-align:right; + width:321px; + height:35px; +} +.info-list-item{ + width:321px; + height:80px; +} \ No newline at end of file diff --git a/examples/airquality/src/main/js/default/pages/history/history.hml b/examples/airquality/src/main/js/default/pages/history/history.hml new file mode 100755 index 0000000..29ab8c8 --- /dev/null +++ b/examples/airquality/src/main/js/default/pages/history/history.hml @@ -0,0 +1,42 @@ + + + +
+ {{historicalData}} +
+
+ +
+
+ {{$item}} +
+
+
+
+
+
+
+
+
+ +
+
+ + + +
\ No newline at end of file diff --git a/examples/airquality/src/main/js/default/pages/history/history.js b/examples/airquality/src/main/js/default/pages/history/history.js new file mode 100755 index 0000000..9dde8ea --- /dev/null +++ b/examples/airquality/src/main/js/default/pages/history/history.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2020 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 router from '@system.router' + +export default { + data: { + historicalData:"historicalData", + datasets:["CO","PM2.5","NO2","NO","PM10","SO2"] + }, + onInit(){ + this.historicalData = this.$t(this.historicalData); + }, + backDetail(){ + router.replace({ + uri:'pages/detail/detail' + }); + } +} \ No newline at end of file diff --git a/examples/airquality/src/main/js/default/pages/index/index.css b/examples/airquality/src/main/js/default/pages/index/index.css new file mode 100755 index 0000000..1911f7e --- /dev/null +++ b/examples/airquality/src/main/js/default/pages/index/index.css @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2020 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. + */ +.pm25-value{ + text-align:center; + font-size:38px; + color:#f0ffff; + width:454px; + height:50px; + top:275px; +} +.pm25-name{ + text-align:center; + color:#a2c4a2; + width:454px; + height:50px; + top:335px; +} +.location-text{ + text-align:center; + color:#f0ffff; + width:454px; + height:50px; + top:20px; +} +.container{ + height: 454px; + width: 454px;; +} +.circleProgress{ + centerX:227px; + centerY:250px; + radius:180px; + startAngle:198; + totalAngle:320; + strokeWidth:45px; + width:454px; + height:454px; +} +.image{ + top:390px; + left:217px; + width:32px; + height:32px; +} +.airquality{ + top:220px; + text-align: center; + width:454px; + height:40px; +} diff --git a/examples/airquality/src/main/js/default/pages/index/index.hml b/examples/airquality/src/main/js/default/pages/index/index.hml new file mode 100755 index 0000000..ee85dd5 --- /dev/null +++ b/examples/airquality/src/main/js/default/pages/index/index.hml @@ -0,0 +1,34 @@ + + + + {{airData[0].airQuality}} + {{airData[0].location}} + + + {{airData[0].detailData}} + AQI + + + {{airData[1].airQuality}} + {{airData[1].location}} + + + {{airData[1].detailData}} + AQI + + \ No newline at end of file diff --git a/examples/airquality/src/main/js/default/pages/index/index.js b/examples/airquality/src/main/js/default/pages/index/index.js new file mode 100755 index 0000000..11866c7 --- /dev/null +++ b/examples/airquality/src/main/js/default/pages/index/index.js @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2020 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 router from '@system.router' + +export default { + data: { + textColor1:'#00ff00', + textColor2:'#00ff00', + bgColor1:'#669966', + bgColor2:'#669966', + swiperPage:0, + percent1:0, + percent2:0, + src1:'common/cloud_green.png', + src2:'common/cloud_green.png', + airData: [{ + location: 'HangZhou', + airQuality: 'Good', + detailData: 10 + }, { + location: 'ShangHai', + airQuality: 'Unhealth', + detailData:90 + }] + }, + onInit () { + this.airData[0].location = this.$t(this.airData[0].location); + this.airData[1].location = this.$t(this.airData[1].location); + this.airData[0].airQuality = this.$t(this.airData[0].airQuality); + this.airData[1].airQuality = this.$t(this.airData[1].airQuality); + if(this.airData[0].detailData > 100){ + this.src1 = "common/cloud_red.png"; + this.textColor1 = '#ff0000'; + this.bgColor1 = '#9d7462'; + } else if(50 < this.airData[0].detailData && this.airData[0].detailData <= 100){ + this.src1 = "common/cloud_yellow.png"; + this.textColor1 = '#ecf19a'; + this.bgColor1 = '#9d9d62'; + } + if(this.airData[1].detailData > 100){ + this.src2 = "common/cloud_red.png"; + this.textColor2 = '#ff0000'; + this.bgColor2 = '#9d7462'; + } else if(50 < this.airData[1].detailData && this.airData[1].detailData <= 100){ + this.src2 = "common/cloud_yellow.png"; + this.textColor2 = '#ecf19a'; + this.bgColor2 = '#9d9d62'; + } + if(this.selectedCityIndex){ + this.swiperPage = this.selectedCityIndex; + } + }, + onShow () { + var self = this; + var time = 1000/(self.airData[self.swiperPage].detailData); + if(time == 0){ + time = 100; + } + var interval = setInterval(function () { + if ((self.swiperPage==0?self.percent1:self.percent2) >= self.airData[self.swiperPage].detailData) { + clearInterval(interval); + return; + } + (self.swiperPage==0?self.percent1++:self.percent2++); + }, time) + }, + openDetail () { + router.replace({ + uri:'pages/detail/detail', + params:{selectedCityIndex:this.swiperPage} + }); + }, + swiperChange (e) { + this.swiperPage = e.index; + var self = this; + var time = 1000/(self.airData[self.swiperPage].detailData); + if(time == 0){ + time = 100; + } + var interval = setInterval(function () { + if ((self.swiperPage==0?self.percent1:self.percent2) >= self.airData[self.swiperPage].detailData) { + clearInterval(interval); + return; + } + (self.swiperPage==0?self.percent1++:self.percent2++); + }, time) + } +} diff --git a/examples/alarm/src/main/config.json b/examples/alarm/src/main/config.json new file mode 100755 index 0000000..93d2690 --- /dev/null +++ b/examples/alarm/src/main/config.json @@ -0,0 +1,50 @@ +{ + "app": { + "bundleName": "com.huawei.alarm", + "vendor": "huawei", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 3, + "target": 3 + } + }, + "deviceConfig": { + "default": { + } + }, + "module": { + "deviceType": [ + "liteWearable", + "smartVision" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry" + }, + "abilities": [ + { + "name": "default", + "icon": "$media:icon", + "label": "alarm", + "type": "page", + "visible": true + } + ], + "js": [ + { + "name": "default", + "pages": [ + "pages/index/index", + "pages/editAlarm/edit_alarm", + "pages/timeArrive/time_arrive", + "pages/timeSelector/time_picker_page", + "pages/weekSelector/week_select_page" + ] + } + ] + } +} diff --git a/examples/alarm/src/main/js/default/app.js b/examples/alarm/src/main/js/default/app.js new file mode 100755 index 0000000..9a2b2a5 --- /dev/null +++ b/examples/alarm/src/main/js/default/app.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2020 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 default { + onCreate() { + console.info('AceApplication onCreate'); + }, + onDestroy() { + console.info('AceApplication onDestroy'); + } +} diff --git a/examples/alarm/src/main/js/default/common/add_alarm.png b/examples/alarm/src/main/js/default/common/add_alarm.png new file mode 100755 index 0000000..07d867a Binary files /dev/null and b/examples/alarm/src/main/js/default/common/add_alarm.png differ diff --git a/examples/alarm/src/main/js/default/common/alarmClock.png b/examples/alarm/src/main/js/default/common/alarmClock.png new file mode 100755 index 0000000..0c2cc48 Binary files /dev/null and b/examples/alarm/src/main/js/default/common/alarmClock.png differ diff --git a/examples/alarm/src/main/js/default/common/cancel.png b/examples/alarm/src/main/js/default/common/cancel.png new file mode 100755 index 0000000..10d7de1 Binary files /dev/null and b/examples/alarm/src/main/js/default/common/cancel.png differ diff --git a/examples/alarm/src/main/js/default/common/jiantou.png b/examples/alarm/src/main/js/default/common/jiantou.png new file mode 100755 index 0000000..d9df574 Binary files /dev/null and b/examples/alarm/src/main/js/default/common/jiantou.png differ diff --git a/examples/alarm/src/main/js/default/common/postpone.png b/examples/alarm/src/main/js/default/common/postpone.png new file mode 100755 index 0000000..ea30b14 Binary files /dev/null and b/examples/alarm/src/main/js/default/common/postpone.png differ diff --git a/examples/alarm/src/main/js/default/common/weekSelected_Fri.png b/examples/alarm/src/main/js/default/common/weekSelected_Fri.png new file mode 100755 index 0000000..b65ebfd Binary files /dev/null and b/examples/alarm/src/main/js/default/common/weekSelected_Fri.png differ diff --git a/examples/alarm/src/main/js/default/common/weekSelected_Mon.png b/examples/alarm/src/main/js/default/common/weekSelected_Mon.png new file mode 100755 index 0000000..0e972e9 Binary files /dev/null and b/examples/alarm/src/main/js/default/common/weekSelected_Mon.png differ diff --git a/examples/alarm/src/main/js/default/common/weekSelected_Sat.png b/examples/alarm/src/main/js/default/common/weekSelected_Sat.png new file mode 100755 index 0000000..00c5ca5 Binary files /dev/null and b/examples/alarm/src/main/js/default/common/weekSelected_Sat.png differ diff --git a/examples/alarm/src/main/js/default/common/weekSelected_Sun.png b/examples/alarm/src/main/js/default/common/weekSelected_Sun.png new file mode 100755 index 0000000..26083ee Binary files /dev/null and b/examples/alarm/src/main/js/default/common/weekSelected_Sun.png differ diff --git a/examples/alarm/src/main/js/default/common/weekSelected_Thu.png b/examples/alarm/src/main/js/default/common/weekSelected_Thu.png new file mode 100755 index 0000000..5e70ced Binary files /dev/null and b/examples/alarm/src/main/js/default/common/weekSelected_Thu.png differ diff --git a/examples/alarm/src/main/js/default/common/weekSelected_Tue.png b/examples/alarm/src/main/js/default/common/weekSelected_Tue.png new file mode 100755 index 0000000..96c0a5d Binary files /dev/null and b/examples/alarm/src/main/js/default/common/weekSelected_Tue.png differ diff --git a/examples/alarm/src/main/js/default/common/weekSelected_Wed.png b/examples/alarm/src/main/js/default/common/weekSelected_Wed.png new file mode 100755 index 0000000..91754b2 Binary files /dev/null and b/examples/alarm/src/main/js/default/common/weekSelected_Wed.png differ diff --git a/examples/alarm/src/main/js/default/common/weekUnSelected_Fri.png b/examples/alarm/src/main/js/default/common/weekUnSelected_Fri.png new file mode 100755 index 0000000..add387c Binary files /dev/null and b/examples/alarm/src/main/js/default/common/weekUnSelected_Fri.png differ diff --git a/examples/alarm/src/main/js/default/common/weekUnSelected_Mon.png b/examples/alarm/src/main/js/default/common/weekUnSelected_Mon.png new file mode 100755 index 0000000..5a7c6c2 Binary files /dev/null and b/examples/alarm/src/main/js/default/common/weekUnSelected_Mon.png differ diff --git a/examples/alarm/src/main/js/default/common/weekUnSelected_Sat.png b/examples/alarm/src/main/js/default/common/weekUnSelected_Sat.png new file mode 100755 index 0000000..79a801e Binary files /dev/null and b/examples/alarm/src/main/js/default/common/weekUnSelected_Sat.png differ diff --git a/examples/alarm/src/main/js/default/common/weekUnSelected_Sun.png b/examples/alarm/src/main/js/default/common/weekUnSelected_Sun.png new file mode 100755 index 0000000..fe96c4c Binary files /dev/null and b/examples/alarm/src/main/js/default/common/weekUnSelected_Sun.png differ diff --git a/examples/alarm/src/main/js/default/common/weekUnSelected_Thu.png b/examples/alarm/src/main/js/default/common/weekUnSelected_Thu.png new file mode 100755 index 0000000..7764a54 Binary files /dev/null and b/examples/alarm/src/main/js/default/common/weekUnSelected_Thu.png differ diff --git a/examples/alarm/src/main/js/default/common/weekUnSelected_Tue.png b/examples/alarm/src/main/js/default/common/weekUnSelected_Tue.png new file mode 100755 index 0000000..ca0cbe7 Binary files /dev/null and b/examples/alarm/src/main/js/default/common/weekUnSelected_Tue.png differ diff --git a/examples/alarm/src/main/js/default/common/weekUnSelected_Wed.png b/examples/alarm/src/main/js/default/common/weekUnSelected_Wed.png new file mode 100755 index 0000000..ea336a7 Binary files /dev/null and b/examples/alarm/src/main/js/default/common/weekUnSelected_Wed.png differ diff --git a/examples/alarm/src/main/js/default/pages/editAlarm/edit_alarm.css b/examples/alarm/src/main/js/default/pages/editAlarm/edit_alarm.css new file mode 100755 index 0000000..666a343 --- /dev/null +++ b/examples/alarm/src/main/js/default/pages/editAlarm/edit_alarm.css @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2020 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. + */ +.container { + width: 454px; + height: 454px; + border-radius:227px; + border-color:#8b0000; + border-width: 1px; + flex-direction: column; + align-items: flex-end; +} + +.itemWidth { + width: 420px; +} + +.itemDiv { + width: 324px; + height: 150px; + justify-content:flex-end; +} + +.itemLeft { + width: 314px; + height: 130px; + flex-direction: column; + justify-content: center; + align-items: center; +} + +.textLarger { + width: 272px; + height: 50px; + font-size: 38px; + text-align: center; +} + +.textStandard { + width: 105px; + height: 30px; + font-size: 30px; + color:#a9a9a9; + text-align: center; +} + +.textLargeDiv { + width:120px; + height:70px; + align-items:flex-end; +} + +.textMiniDiv { + width:70px; + height:60px; + align-items:flex-start; +} \ No newline at end of file diff --git a/examples/alarm/src/main/js/default/pages/editAlarm/edit_alarm.hml b/examples/alarm/src/main/js/default/pages/editAlarm/edit_alarm.hml new file mode 100755 index 0000000..9bdce9c --- /dev/null +++ b/examples/alarm/src/main/js/default/pages/editAlarm/edit_alarm.hml @@ -0,0 +1,76 @@ + +
+ + +
+ Edit alarm +
+
+ +
+
+
+
+ {{dataWrapper.time}} +
+
+ Time +
+
+
+ +
+ +
+
+
+
+ {{dataWrapper.repeat}} +
+
+ Repeat +
+
+
+ +
+ +
+
+
+ Alarm +
+
+ Name +
+
+
+
+ +
+
+
+ OK +
+ Delete +
+
+
+
+
\ No newline at end of file diff --git a/examples/alarm/src/main/js/default/pages/editAlarm/edit_alarm.js b/examples/alarm/src/main/js/default/pages/editAlarm/edit_alarm.js new file mode 100755 index 0000000..9cbf869 --- /dev/null +++ b/examples/alarm/src/main/js/default/pages/editAlarm/edit_alarm.js @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2020 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 router from "@system.router" + +module.exports = { + data: { + dataWrapper: { + mode: "", + time: "00:00", + repeat: "Once", + alarmItemIndex: -1 + }, + originData: [], + isDebug: false + }, + onInit() { + if (this.isDebug) { + console.log("[editAlarm init] mode: " + this.dataWrapper.mode); + console.log("[editAlarm init] mode: " + this.dataWrapper.time); + console.log("[editAlarm init] mode: " + this.dataWrapper.repeat); + console.log("[editAlarm init] mode: " + this.dataWrapper.alarmItemIndex); + } + this.dataWrapper = this.dataWrapper; + this.transforTimeToTwentyFourHour(this.dataWrapper.time); + if (this.originData.toString() !== "undefined") { + this.originData = this.originData; + } + }, + transforTimeToTwentyFourHour(time) { + var timeArray = time.split(" "); + var timeDigital = timeArray[0]; + var timeAMPM = timeArray[1]; + if (timeAMPM === "PM") { + var hourTimeArray = timeDigital.split(":"); + var hour = hourTimeArray[0]; + var minute = hourTimeArray[1]; + hour = Number(hour) + 12; + this.dataWrapper.time = hour + ":" + minute; + } else { + this.dataWrapper.time = timeDigital; + } + }, + switchToTimePicker() { + router.replace({ + uri: 'pages/timeSelector/time_picker_page', + params:{dataWrapper: this.dataWrapper, originData: this.originData} + }); + }, + switchToWeekSelector() { + router.replace({ + uri: 'pages/weekSelector/week_select_page', + params:{dataWrapper: this.dataWrapper, originData: this.originData} + }); + }, + submit() { + router.replace({ + uri: 'pages/index/index', + params:{dataWrapper: this.dataWrapper, originData: this.originData} + }); + }, + remove() { + router.replace({ + uri: 'pages/index/index', + params:{dataWrapper: this.dataWrapper, deleteAlarm: true, originData: this.originData} + }); + } +} \ No newline at end of file diff --git a/examples/alarm/src/main/js/default/pages/index/index.css b/examples/alarm/src/main/js/default/pages/index/index.css new file mode 100755 index 0000000..e379f5a --- /dev/null +++ b/examples/alarm/src/main/js/default/pages/index/index.css @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2020 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. + */ +.container { + width: 454px; + height: 454px; + flex-direction: column; + align-items: center; +} + +.itemWidth { + width: 376px; +} + +.itemDiv { + width: 280px; + height: 150px; + flex-direction: column; + align-items: center; +} + +.itemDiv_right { + width: 96px; + height: 150px; + justify-content: center; + align-items: center; +} + +.itemText { + width: 280px; + height:50px; +} + +.switchStyle { + width: 65px; + height: 70px; +} \ No newline at end of file diff --git a/examples/alarm/src/main/js/default/pages/index/index.hml b/examples/alarm/src/main/js/default/pages/index/index.hml new file mode 100755 index 0000000..385d6f4 --- /dev/null +++ b/examples/alarm/src/main/js/default/pages/index/index.hml @@ -0,0 +1,34 @@ + +
+ + +
+ +
+
+ +
+ {{time[$idx]}} + {{repeat[$idx]}} +
+
+ +
+
+
+
\ No newline at end of file diff --git a/examples/alarm/src/main/js/default/pages/index/index.js b/examples/alarm/src/main/js/default/pages/index/index.js new file mode 100755 index 0000000..6d336c6 --- /dev/null +++ b/examples/alarm/src/main/js/default/pages/index/index.js @@ -0,0 +1,130 @@ +/* + * Copyright (c) 2020 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 router from "@system.router" + +module.exports = { + data: { + time: ["07:20 AM", "07:30 AM", "12:00 AM", "06:00 PM"], + repeat: ["Mon Tue Wed Thu Fri", "Mon Tue Wed Thu Fri Sat Sun", "Mon Tue Wed Thu Fri", "Once"], + mode: ["addAlarm", "editAlarm", "deleteAlarm", "timeArrive"], + switchStatus: [false, false, false, false], + + dataWrapper: { + mode: "", + time: "00:00", + repeat: "Once", + alarmItemIndex: -1 + }, + + originData: [], + isDebug: true + }, + packOriginData() { + this.originData = [this.time, this.repeat, this.switchStatus]; + }, + unPackOriginData() { + this.time = this.originData[0]; + this.repeat = this.originData[1]; + this.switchStatus = this.originData[2]; + }, + onInit() { + console.log("[mainPage init]"); + if (this.originData.length === 0) { // app first start + this.packOriginData(); + } else { + if (this.isDebug) { + console.log("[mainPage init] mode: " + this.dataWrapper.mode); + console.log("[mainPage init] mode: " + this.dataWrapper.time); + console.log("[mainPage init] mode: " + this.dataWrapper.repeat); + console.log("[mainPage init] mode: " + this.dataWrapper.alarmItemIndex); + } + + this.unPackOriginData(); // apply origin data to current enviroment + + if (this.dataWrapper.mode === this.mode[0]) { // add alarm + this.time.push(this.transforTimeToTwelvehour(this.dataWrapper.time)); + this.repeat.push(this.dataWrapper.repeat); + this.switchStatus.push(false); + + } else if (this.dataWrapper.mode === this.mode[1]) { // edit alarm + if (typeof(this.deleteAlarm) != "undefined") { + this.time.splice(this.dataWrapper.alarmItemIndex, 1); + this.repeat.splice(this.dataWrapper.alarmItemIndex, 1); + this.switchStatus.splice(this.dataWrapper.alarmItemIndex, 1); + } else { + this.time[this.dataWrapper.alarmItemIndex] = this.transforTimeToTwelvehour(this.dataWrapper.time); + this.repeat[this.dataWrapper.alarmItemIndex] = this.dataWrapper.repeat; + this.switchStatus[this.dataWrapper.alarmItemIndex] = true; + } + + } else if (this.dataWrapper.mode === this.mode[3]) { // time arrive + var switchValue = this.switchValue; + this.switchStatus[this.dataWrapper.switchIndex] = switchValue; + } + + this.packOriginData(); // wrap current enviroment data as origin data + } + }, + transforTimeToTwelvehour(time) { + var timeArray = time.split(" ")[0].split(":"); + var hour = timeArray[0]; + var minute = timeArray[1]; + if (minute.length === 1) { + minute = "0" + minute; + } + if (Number(hour) >= 12) { + hour = Number(hour) - 12; + return hour + ":" + minute + " PM"; + } else { + return hour + ":" + minute + " AM"; + } + }, + addAlarm() { + var date = new Date(); + var strHour = date.getHours(); + var strMin = date.getMinutes(); + this.dataWrapper.mode = this.mode[0]; + this.dataWrapper.time = strHour + ":" + strMin; + router.replace({ + uri: 'pages/timeSelector/time_picker_page', + params:{dataWrapper: this.dataWrapper, originData: this.originData} + }); + }, + switchToEditAlarm(index) { + this.dataWrapper.mode = this.mode[1]; + this.dataWrapper.time = this.time[index]; + this.dataWrapper.repeat = this.repeat[index]; + this.dataWrapper.alarmItemIndex = index; + router.replace({ + uri: 'pages/editAlarm/edit_alarm', + params:{dataWrapper: this.dataWrapper, originData: this.originData} + }); + }, + switchChange(index, e) { + if (e.checked) { + this.dataWrapper.time = this.time[index]; + this.dataWrapper.mode = this.mode[3]; + this.dataWrapper.alarmItemIndex = index; + var dataWrapper = this.dataWrapper; + var oriData = this.originData; + setTimeout(function () { + router.replace({ + uri: 'pages/timeArrive/time_arrive', + params:{dataWrapper: dataWrapper, originData: oriData} + }); + }, 2000); + } + } +} \ No newline at end of file diff --git a/examples/alarm/src/main/js/default/pages/timeArrive/time_arrive.css b/examples/alarm/src/main/js/default/pages/timeArrive/time_arrive.css new file mode 100755 index 0000000..3f989ef --- /dev/null +++ b/examples/alarm/src/main/js/default/pages/timeArrive/time_arrive.css @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2020 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. + */ +.container { + width: 454px; + height: 454px; + border-radius:227px; + border-color:#8b0000; + border-width: 1px; + flex-direction: column; + align-items: center; +} + +.item { + width: 454px; + height: 150px; + justify-content: center; + align-items: center; +} + +.imgStyle { + width: 93px; + height: 93px; +} \ No newline at end of file diff --git a/examples/alarm/src/main/js/default/pages/timeArrive/time_arrive.hml b/examples/alarm/src/main/js/default/pages/timeArrive/time_arrive.hml new file mode 100755 index 0000000..d7ab594 --- /dev/null +++ b/examples/alarm/src/main/js/default/pages/timeArrive/time_arrive.hml @@ -0,0 +1,30 @@ + +
+
+ + Alarm +
+
+ {{amOrPm}} + {{dataWrapper.time}} +
+
+ +
+ +
+
\ No newline at end of file diff --git a/examples/alarm/src/main/js/default/pages/timeArrive/time_arrive.js b/examples/alarm/src/main/js/default/pages/timeArrive/time_arrive.js new file mode 100755 index 0000000..2a4acb5 --- /dev/null +++ b/examples/alarm/src/main/js/default/pages/timeArrive/time_arrive.js @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2020 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 router from "@system.router" + +module.exports = { + data: { + amOrPm: "", + dataWrapper: { + mode: "", + time: "00:00", + repeat: "Once", + alarmItemIndex: -1 + }, + originData: [] + }, + onInit() { + this.dataWrapper = this.dataWrapper; + if (this.originData.toString() !== "undefined") { + this.originData = this.originData; + } + + var alarmTime = this.dataWrapper.time; + var alarmTimeArray = alarmTime.split(" "); + this.dataWrapper.time = alarmTimeArray[0]; + this.amOrPm = alarmTimeArray[1]; + }, + postpone() { + router.replace({ + uri: 'pages/index/index', + params:{dataWrapper: this.dataWrapper, switchValue: true, originData: this.originData} + }); + }, + cancel() { + router.replace({ + uri: 'pages/index/index', + params:{dataWrapper: this.dataWrapper, switchValue: false, originData: this.originData} + }); + } +} \ No newline at end of file diff --git a/examples/alarm/src/main/js/default/pages/timeSelector/time_picker_page.css b/examples/alarm/src/main/js/default/pages/timeSelector/time_picker_page.css new file mode 100755 index 0000000..3385b4c --- /dev/null +++ b/examples/alarm/src/main/js/default/pages/timeSelector/time_picker_page.css @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2020 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. + */ +.container { + width: 454px; + height: 454px; + border-radius:227px; + border-color:#8b0000; + border-width: 1px; + flex-direction: column; + align-items: center; +} + +.divBottom { + width: 454px; + height: 90px; + background-color:#a9a9a9; + border-radius:227px; + flex-direction: column; + justify-content:center; + align-items: center; +} \ No newline at end of file diff --git a/examples/alarm/src/main/js/default/pages/timeSelector/time_picker_page.hml b/examples/alarm/src/main/js/default/pages/timeSelector/time_picker_page.hml new file mode 100755 index 0000000..bfefab8 --- /dev/null +++ b/examples/alarm/src/main/js/default/pages/timeSelector/time_picker_page.hml @@ -0,0 +1,31 @@ + +
+
+ Set time +
+
+ + + +
+
+
+ Next +
+
+
\ No newline at end of file diff --git a/examples/alarm/src/main/js/default/pages/timeSelector/time_picker_page.js b/examples/alarm/src/main/js/default/pages/timeSelector/time_picker_page.js new file mode 100755 index 0000000..13ba0d1 --- /dev/null +++ b/examples/alarm/src/main/js/default/pages/timeSelector/time_picker_page.js @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2020 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 router from "@system.router" + +module.exports = { + data: { + selectedTime: "00:00", + targetHour: "00", + targetMinute: "00", + isSelectTimeChanged: false, + dataWrapper: { + mode: "", + repeat: "Once", + time: "00:00", + alarmItemIndex: -1 + }, + isDebug: false, + originData: [] + }, + onInit() { + if (this.isDebug) { + console.log("[timePicker init] mode: " + this.dataWrapper.mode); + console.log("[timePicker init] time: " + this.dataWrapper.time); + console.log("[timePicker init] repeat: " + this.dataWrapper.repeat); + console.log("[timePicker init] alarmItemIndex: " + this.dataWrapper.alarmItemIndex); + } + this.isSelectTimeChanged = false; + if (this.dataWrapper.mode === "addAlarm" || this.dataWrapper.mode === "editAlarm") { + this.selectedTime = this.dataWrapper.time; + } + if (this.originData.toString() !== "undefined") { + this.originData = this.originData; + } + }, + getSelectedTime(e) { + this.targetHour = e.hour; + this.targetMinute = e.minute; + this.isSelectTimeChanged = true; + }, + next() { + if (this.isSelectTimeChanged) { + this.targetHour = this.targetHour.toString().length === 1 ? "0" + this.targetHour : this.targetHour; + this.targetMinute = this.targetMinute.toString().length === 1 ? "0" + this.targetMinute : this.targetMinute; + this.dataWrapper.time = this.targetHour + ":" + this.targetMinute + " AM"; + } + if (this.dataWrapper.mode === "addAlarm") { + router.replace({ + uri: 'pages/weekSelector/week_select_page', + params:{dataWrapper: this.dataWrapper, originData: this.originData} + }); + }else if (this.dataWrapper.mode === "editAlarm") { + router.replace({ + uri: 'pages/editAlarm/edit_alarm', + params:{dataWrapper: this.dataWrapper, originData: this.originData} + }); + } + } +} \ No newline at end of file diff --git a/examples/alarm/src/main/js/default/pages/weekSelector/week_select_page.css b/examples/alarm/src/main/js/default/pages/weekSelector/week_select_page.css new file mode 100755 index 0000000..558ba59 --- /dev/null +++ b/examples/alarm/src/main/js/default/pages/weekSelector/week_select_page.css @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2020 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. + */ +.container { + width: 454px; + height: 454px; + border-radius:227px; + border-color:#8b0000; + border-width: 1px; + flex-direction: column; + align-items: center; +} + +.divWeek { + width: 454px; + height: 115px; + justify-content:center; + align-items: center; +} + +.imgWeek { + width: 95px; + height: 95px; +} + +.divBottom { + width: 454px; + height: 90px; + border-radius:227px; + background-color: #a9a9a9; + flex-direction: column; + justify-content: center; + align-items: center; +} \ No newline at end of file diff --git a/examples/alarm/src/main/js/default/pages/weekSelector/week_select_page.hml b/examples/alarm/src/main/js/default/pages/weekSelector/week_select_page.hml new file mode 100755 index 0000000..150d79f --- /dev/null +++ b/examples/alarm/src/main/js/default/pages/weekSelector/week_select_page.hml @@ -0,0 +1,39 @@ + +
+
+ Repeat +
+
+
+ + + +
+
+ + + + +
+
+
+
+ OK +
+
+
\ No newline at end of file diff --git a/examples/alarm/src/main/js/default/pages/weekSelector/week_select_page.js b/examples/alarm/src/main/js/default/pages/weekSelector/week_select_page.js new file mode 100755 index 0000000..ca2541a --- /dev/null +++ b/examples/alarm/src/main/js/default/pages/weekSelector/week_select_page.js @@ -0,0 +1,130 @@ +/* + * Copyright (c) 2020 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 router from "@system.router" + +module.exports = { + data: { + weekImgSrc1: "common/weekUnSelected_Mon.png", + weekImgSrc2: "common/weekUnSelected_Tue.png", + weekImgSrc3: "common/weekUnSelected_Wed.png", + weekImgSrc4: "common/weekUnSelected_Thu.png", + weekImgSrc5: "common/weekUnSelected_Fri.png", + weekImgSrc6: "common/weekUnSelected_Sat.png", + weekImgSrc7: "common/weekUnSelected_Sun.png", + dataWrapper: { + mode: "", + time: "00:00", + repeat: "", + alarmItemIndex: -1 + }, + originData: [], + isDebug: false + }, + onInit() { + if (this.isDebug) { + console.log("[weekSelector init] mode: " + this.dataWrapper.mode); + console.log("[weekSelector init] time: " + this.dataWrapper.time); + console.log("[weekSelector init] repeat: " + this.dataWrapper.repeat); + console.log("[weekSelector init] alarmItemIndex: " + this.dataWrapper.alarmItemIndex); + } + + if (this.dataWrapper.repeat.indexOf("Mon") !== -1) { + this.weekImgSrc1 = "common/weekSelected_Mon.png"; + } + if (this.dataWrapper.repeat.indexOf("Tue") !== -1) { + this.weekImgSrc2 = "common/weekSelected_Tue.png"; + } + if (this.dataWrapper.repeat.indexOf("Wed") !== -1) { + this.weekImgSrc3 = "common/weekSelected_Wed.png"; + } + if (this.dataWrapper.repeat.indexOf("Thu") !== -1) { + this.weekImgSrc4 = "common/weekSelected_Thu.png"; + } + if (this.dataWrapper.repeat.indexOf("Fri") !== -1) { + this.weekImgSrc5 = "common/weekSelected_Fri.png"; + } + if (this.dataWrapper.repeat.indexOf("Sat") !== -1) { + this.weekImgSrc6 = "common/weekSelected_Sat.png"; + } + if (this.dataWrapper.repeat.indexOf("Sun") !== -1) { + this.weekImgSrc7 = "common/weekSelected_Sun.png"; + } + + this.dataWrapper.repeat = ""; + + if (this.originData.toString() !== "undefined") { + this.originData = this.originData; + } + }, + changeWeekImgSrc1() { + this.weekImgSrc1 = this.weekImgSrc1.indexOf("UnSelected") === -1 ? "common/weekUnSelected_Mon.png" : "common/weekSelected_Mon.png"; + }, + changeWeekImgSrc2() { + this.weekImgSrc2 = this.weekImgSrc2.indexOf("UnSelected") === -1 ? "common/weekUnSelected_Tue.png" : "common/weekSelected_Tue.png"; + }, + changeWeekImgSrc3() { + this.weekImgSrc3 = this.weekImgSrc3.indexOf("UnSelected") === -1 ? "common/weekUnSelected_Wed.png" : "common/weekSelected_Wed.png"; + }, + changeWeekImgSrc4() { + this.weekImgSrc4 = this.weekImgSrc4.indexOf("UnSelected") === -1 ? "common/weekUnSelected_Thu.png" : "common/weekSelected_Thu.png"; + }, + changeWeekImgSrc5() { + this.weekImgSrc5 = this.weekImgSrc5.indexOf("UnSelected") === -1 ? "common/weekUnSelected_Fri.png" : "common/weekSelected_Fri.png"; + }, + changeWeekImgSrc6() { + this.weekImgSrc6 = this.weekImgSrc6.indexOf("UnSelected") === -1 ? "common/weekUnSelected_Sat.png" : "common/weekSelected_Sat.png"; + }, + changeWeekImgSrc7() { + this.weekImgSrc7 = this.weekImgSrc7.indexOf("UnSelected") === -1 ? "common/weekUnSelected_Sun.png" : "common/weekSelected_Sun.png"; + }, + submit() { + if (this.weekImgSrc1.indexOf("UnSelected") === -1) { + this.dataWrapper.repeat = "Mon"; + } + if (this.weekImgSrc2.indexOf("UnSelected") === -1) { + this.dataWrapper.repeat = this.dataWrapper.repeat + " Tue"; + } + if (this.weekImgSrc3.indexOf("UnSelected") === -1) { + this.dataWrapper.repeat = this.dataWrapper.repeat + " Wed"; + } + if (this.weekImgSrc4.indexOf("UnSelected") === -1) { + this.dataWrapper.repeat = this.dataWrapper.repeat + " Thu"; + } + if (this.weekImgSrc5.indexOf("UnSelected") === -1) { + this.dataWrapper.repeat = this.dataWrapper.repeat + " Fri"; + } + if (this.weekImgSrc6.indexOf("UnSelected") === -1) { + this.dataWrapper.repeat = this.dataWrapper.repeat + " Sat"; + } + if (this.weekImgSrc7.indexOf("UnSelected") === -1) { + this.dataWrapper.repeat = this.dataWrapper.repeat + " Sun"; + } + if (this.dataWrapper.repeat === "") { + this.dataWrapper.repeat = "Once"; + } + + if (this.dataWrapper.mode === "addAlarm") { + router.replace({ + uri: 'pages/index/index', + params:{dataWrapper: this.dataWrapper, originData: this.originData} + }); + } else if (this.dataWrapper.mode === "editAlarm") { + router.replace({ + uri: 'pages/editAlarm/edit_alarm', + params: {dataWrapper: this.dataWrapper, originData: this.originData} + }); + } + } +} \ No newline at end of file diff --git a/examples/music/src/main/config.json b/examples/music/src/main/config.json new file mode 100755 index 0000000..c312fec --- /dev/null +++ b/examples/music/src/main/config.json @@ -0,0 +1,46 @@ +{ + "app": { + "vendor": "huawei", + "bundleName": "com.huawei.music", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 3, + "target": 3 + } + }, + "deviceConfig": { + "default": { + } + }, + "module": { + "deviceType": [ + "liteWearable", + "smartVision" + ], + "abilities": [ + { + "name": "default", + "icon": "$media:icon", + "label": "Music", + "type": "page", + "visible": true + } + ], + "distro": { + "moduleType": "entry", + "deliveryWithInstall": true, + "moduleName": "entry" + }, + "js": [ + { + "pages": [ + "pages/index/index" + ], + "name": "default" + } + ] + } +} diff --git a/examples/music/src/main/js/default/app.js b/examples/music/src/main/js/default/app.js new file mode 100755 index 0000000..cc5a630 --- /dev/null +++ b/examples/music/src/main/js/default/app.js @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2020 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 default { + onCreate() { + console.info("Application onCreate"); + }, + onDestroy() { + console.info("Application onDestroy"); + } +} +; diff --git a/examples/music/src/main/js/default/common/ic_back.png b/examples/music/src/main/js/default/common/ic_back.png new file mode 100755 index 0000000..a456d0f Binary files /dev/null and b/examples/music/src/main/js/default/common/ic_back.png differ diff --git a/examples/music/src/main/js/default/common/ic_music_list.png b/examples/music/src/main/js/default/common/ic_music_list.png new file mode 100755 index 0000000..3b34026 Binary files /dev/null and b/examples/music/src/main/js/default/common/ic_music_list.png differ diff --git a/examples/music/src/main/js/default/common/ic_music_listcycle.png b/examples/music/src/main/js/default/common/ic_music_listcycle.png new file mode 100755 index 0000000..e8a1057 Binary files /dev/null and b/examples/music/src/main/js/default/common/ic_music_listcycle.png differ diff --git a/examples/music/src/main/js/default/common/ic_music_listorder.png b/examples/music/src/main/js/default/common/ic_music_listorder.png new file mode 100755 index 0000000..6753a5f Binary files /dev/null and b/examples/music/src/main/js/default/common/ic_music_listorder.png differ diff --git a/examples/music/src/main/js/default/common/ic_music_mode.png b/examples/music/src/main/js/default/common/ic_music_mode.png new file mode 100755 index 0000000..374af38 Binary files /dev/null and b/examples/music/src/main/js/default/common/ic_music_mode.png differ diff --git a/examples/music/src/main/js/default/common/ic_music_next.png b/examples/music/src/main/js/default/common/ic_music_next.png new file mode 100755 index 0000000..1de5d64 Binary files /dev/null and b/examples/music/src/main/js/default/common/ic_music_next.png differ diff --git a/examples/music/src/main/js/default/common/ic_music_pause.png b/examples/music/src/main/js/default/common/ic_music_pause.png new file mode 100755 index 0000000..49591eb Binary files /dev/null and b/examples/music/src/main/js/default/common/ic_music_pause.png differ diff --git a/examples/music/src/main/js/default/common/ic_music_play.png b/examples/music/src/main/js/default/common/ic_music_play.png new file mode 100755 index 0000000..178dd98 Binary files /dev/null and b/examples/music/src/main/js/default/common/ic_music_play.png differ diff --git a/examples/music/src/main/js/default/common/ic_music_previous.png b/examples/music/src/main/js/default/common/ic_music_previous.png new file mode 100755 index 0000000..7064df9 Binary files /dev/null and b/examples/music/src/main/js/default/common/ic_music_previous.png differ diff --git a/examples/music/src/main/js/default/common/ic_music_shuffle.png b/examples/music/src/main/js/default/common/ic_music_shuffle.png new file mode 100755 index 0000000..f4e9e63 Binary files /dev/null and b/examples/music/src/main/js/default/common/ic_music_shuffle.png differ diff --git a/examples/music/src/main/js/default/common/ic_music_singlecycle.png b/examples/music/src/main/js/default/common/ic_music_singlecycle.png new file mode 100755 index 0000000..da0cf1f Binary files /dev/null and b/examples/music/src/main/js/default/common/ic_music_singlecycle.png differ diff --git a/examples/music/src/main/js/default/pages/index/index.css b/examples/music/src/main/js/default/pages/index/index.css new file mode 100755 index 0000000..03120ba --- /dev/null +++ b/examples/music/src/main/js/default/pages/index/index.css @@ -0,0 +1,208 @@ +/* + * Copyright (c) 2020 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. + */ + +.container { + width: 960px; + height: 480px; +} + +.main { + display: flex; + flex-direction: column; + width: 960px; + height: 480px; +} + +.header { + width: 400px; + height: 80px; + display: flex; +} + +.back { + width: 36px; + height: 36px; + margin-left: 39px; + margin-top: 23px; +} + +.title { + width: 296px; + height: 40px; + margin-top: 20px; + margin-left: 21px; + color: #e6e6e6; +} + +.musicName { + width: 171px; + height: 55px; + margin-left: 395px; + margin-top: 25px; + font-size: 38px; + color: #ffffff; + text-align: center; +} + +.songer { + width: 114px; + height: 42px; + margin-left: 423px; + margin-top: 10px; + font-size: 30px; + color: #bfbfbf; + text-align: center; +} + +.progress-Wrapper { + flex-direction: row; + width: 960px; + height: 40px; + margin-top: 80px; +} + +.playTime { + width: 300px; + height: 40px; + text-align: right; + font-size: 30px; + color: #A2A2A2; +} + +.allTime { + width: 300px; + height: 40px; + text-align: left; + font-size: 30px; + margin-left: 18px; + text-align: left; + color: #A2A2A2; +} + +.progressBar { + width:324px; + height: 32px; + selected-color: #ffffff; + block-color: #ffffff; + color:#404040; + margin-left: 18px; + margin-top: 8px; +} + +.controlBar { + flex-direction: row; + width: 960px; + height: 98px; + margin-top: 30px; +} + +.modeBtn { + width: 36px; + height: 36px; + margin-left: 242px; + margin-top: 33px; +} + +.previousBtn { + width: 56px; + height: 56px; + margin-left: 48px; + margin-top: 21px; +} + +.nextBtn { + width: 56px; + height: 56px; + margin-left: 48px; + margin-top: 21px; +} + +.playBtn { + width: 98px; + height: 98px; + margin-left: 49px; +} + +.listBtn { + width: 36px; + height: 36px; + margin-left: 48px; + margin-top: 33px; +} + +.list-Wrapper { + width: 480px; + height: 480px; + left: 480px; + background-color: #252525; + flex-direction: column; +} + +.listText { + width: 150px; + height: 40px; + margin-left: 36px; + margin-top: 36px; + color: #ffffff; +} + +.musicList { + width: 408px; + height: 365px; + margin-top: 36px; + margin-left: 36px; + background-color: #252525; +} + +.listItem { + width: 408px; + height: 120px; + background-color: #252525; +} + +.item-Wrapper { + width: 408px; + height: 112px; + background-color: #333333; + margin-top: 8px; + border-radius: 10px; + flex-direction: column; +} + +.space-Wrapper { + width: 408px; + height: 120px; + background-color: #252525; +} + +.itemName { + width: 400px; + height: 48px; + margin-top: 16px; + margin-left: 24px; + color: #ffffff; +} + +.itemSonger { + width: 400px; + height: 48px; + margin-top: 3px; + margin-left: 24px; + color: #adadad; +} + + + + diff --git a/examples/music/src/main/js/default/pages/index/index.hml b/examples/music/src/main/js/default/pages/index/index.hml new file mode 100755 index 0000000..f2596b7 --- /dev/null +++ b/examples/music/src/main/js/default/pages/index/index.hml @@ -0,0 +1,54 @@ + + + +
+
+ + 音乐 +
+ {{curMusic.curMusicName}} + {{curMusic.songer}} +
+ {{curMusic.playTime}} + + {{curMusic.allTime}} +
+
+ + + + + +
+
+
+ 播放列表 + + +
+
+ + {{$item.name}} + + + {{$item.songer}} + +
+
+
+
+
+
diff --git a/examples/music/src/main/js/default/pages/index/index.js b/examples/music/src/main/js/default/pages/index/index.js new file mode 100755 index 0000000..22cce37 --- /dev/null +++ b/examples/music/src/main/js/default/pages/index/index.js @@ -0,0 +1,242 @@ +/* + * Copyright (c) 2020 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 audio from '@system.audio' +import file from '@system.file' +import app from '@system.app' + +var modeImages = ['common/ic_music_listorder.png', 'common/ic_music_listcycle.png', 'common/ic_music_shuffle.png', 'common/ic_music_singlecycle.png']; + +export default { + data: { + showMusicList: false, + playMode: 1, //0:sequential,1:list loop,2:random,3:single + modeImage: 'common/ic_music_listcycle.png', + playImage: 'common/ic_music_play.png', + playProgress: 0, //progress + curMusicIndex: 0, //music index + playStatus: 2, //0:play,1:pause,2:stop + curMusic: { //current music info + curMusicName: "", + songer: "", + playTime: "00:00", + allTime: "00:00" + }, + musicList: [] + }, + onInit() { + //get music duration + audio.onplay = () => { + console.log("onplay start"); + this.curMusic.allTime = this.timeChange(audio.duration); + this.playStatus = 0; + }; + //update play progress + audio.ontimeupdate = () => { + console.log("ontime update:"); + this.curMusic.playTime = this.timeChange(audio.currentTime); + console.log("ontime update:" + this.curMusic.playTime); + this.playProgress = Math.floor(audio.currentTime * 100 / audio.duration); + console.log("ontime update progress:" + this.playProgress + ",duration:" + audio.duration); + }; + //play next song when meet an error + audio.onerror = () => { + console.log("onerror"); + this.changeSong(); + }; + //perform operations based on the playback mode. + audio.onended = () => { + console.log("onend"); + this.playStatus = 2; + //after played the last song in sequential mode ,stop playback + if (this.playMode == 0 && this.curMusicIndex == (this.musicList.length - 1)) { + this.playStatus = 2; + this.playImage = "common/ic_music_play.png"; + console.log("played the last song in sequential mode"); + return; + } + let mode = ""; + if (this.playMode == 2) { + console.log("random"); + mode = "random"; + } + this.changeSong(mode); + }; + this.getMusicList(); + }, + onDestroy() { + this.stopPlay(); + }, + clickListItem(index) { + console.log("listItemClick:start:" + index); + if (index == undefined || index == null) { + index = 0; + } + this.curMusicIndex = index; + this.playStatus = 2; + this.playMusic(); + this.showMusicList = false; + console.log("listItemClick:end"); + }, + changeProgress(value) { + console.log("changeProgress start:" + value.progress); + if (value == null || value.progress == null) { + return; + } + if (this.playStatus == 2) { + return; + } + let val = Math.floor((value.progress / 100) * audio.duration); + console.log("changeProgress change:" + val); + audio.currentTime = val; + console.log("changeProgress end:"); + }, + playMusic() { + console.log("playMusic:start"); + //play music when is paused + this.playImage = "common/ic_music_pause.png"; + if (this.playStatus == 1) { + audio.play(); + this.playStatus = 0; + console.log("playMusic:play"); + return; + } else if (this.playStatus == 0) { + this.playImage = "common/ic_music_play.png"; + audio.pause(); + this.playStatus = 1; + console.log("playMusic:pause"); + return; + } + if (this.curMusicIndex == null) { + this.curMusicIndex = 0; + } + let music = this.musicList[this.curMusicIndex]; + if (music != null) { + this.playProgress = 0; + this.curMusic.curMusicName = music.name; + this.curMusic.songer = music.songer; + audio.src = music.src; + console.log("playMusic:src:" + music.src); + audio.play(); + if (this.playMode == 3) { + audio.loop = true; + } else { + audio.loop = false; + } + console.log("playMusic:end"); + } + }, + stopPlay() { + console.log("stopPlay"); + audio.src = null; + audio.onstop = null; + audio.onplay = null; + audio.ontimeupdate = null; + audio.onerror = null; + }, + changeMode() { + console.log("changeMode start"); + if (this.playMode == 3) { + this.playMode = 0; + } else { + this.playMode++; + } + if (this.playMode == 3) { + audio.loop = true; + } else { + audio.loop = false; + } + console.log("changeMode:" + this.playMode); + this.modeImage = modeImages[this.playMode]; + }, + changeSong(mode) { + console.log("ChangeSong:start"); + if (this.playStatus == 0 || this.playStatus == 1) { + this.playStatus = 2; + } + if (this.playMode == 2) { + mode = "random"; + } + //previous + if (mode == "previous") { + this.curMusicIndex == 0 ? (this.curMusicIndex = (this.musicList.length - 1)) : this.curMusicIndex--; + console.log("ChangeSong:previous:" + this.curMusicIndex); + } else if (mode == "random") { //random + this.curMusicIndex = parseInt(Math.random() * (this.musicList.length), 10); + console.log("ChangeSong:random:" + this.curMusicIndex); + } else { //next + (this.curMusicIndex == this.musicList.length - 1) ? this.curMusicIndex = 0 : this.curMusicIndex++; + console.log("ChangeSong:next" + this.curMusicIndex); + } + this.curMusic.curMusicName = this.musicList[this.curMusicIndex].name; + this.curMusic.songer = this.musicList[this.curMusicIndex].songer; + this.playMusic(this.curMusicIndex); + if(this.showMusicList){ + this.$refs.musicList.scrollTo({ index: (this.curMusicIndex == 0?0:this.curMusicIndex-1) }); + } + console.log("ChangeSong:end"); + }, + timeChange(seconds) { + console.log("timeChange:start:" + seconds); + if (seconds == null || seconds < 0) { + return "00:00"; + } + let minute, second = 0; + minute = Math.floor(seconds / 60); + second = Math.floor(seconds % 60); + let result = (minute > 9 ? minute : "0" + minute) + ":" + (second > 9 ? second : "0" + second); + console.log("timeChange:end:" + result); + return result; + }, + changePage(operation) { + console.log("changePage:start"); + if (operation != null && operation == "close") { + this.showMusicList = false; + return; + } + this.showMusicList = !this.showMusicList; + if(this.showMusicList){ + this.$refs.musicList.scrollTo({ index: (this.curMusicIndex == 0?0:this.curMusicIndex-1) }); + } + }, + exitApp(){ + console.log("start exit"); + app.terminate(); + console.log("end exit"); + }, + swipeEvent(e){ + if(e.direction == "right"){ + console.log("start exit"); + this.exitApp(); + } + }, + getMusicList(){ + let that = this; + //get all music file + file.readText({ + uri:"internal://app/musicList.txt", + success(data){ + console.log(data.text); + let music = JSON.parse(data.text); + if(music != null){ + that.musicList = music; + } + }, + fail(data,code){ + console.log("get music list failed :"+code); + } + }); + } +} diff --git a/examples/music/src/main/resources/base/media/icon.png b/examples/music/src/main/resources/base/media/icon.png new file mode 100755 index 0000000..ce307a8 Binary files /dev/null and b/examples/music/src/main/resources/base/media/icon.png differ diff --git a/examples/music/src/main/resources/base/media/icon_small.png b/examples/music/src/main/resources/base/media/icon_small.png new file mode 100755 index 0000000..0ed5fea Binary files /dev/null and b/examples/music/src/main/resources/base/media/icon_small.png differ diff --git a/examples/showcase/src/main/config.json b/examples/showcase/src/main/config.json new file mode 100755 index 0000000..2bf9789 --- /dev/null +++ b/examples/showcase/src/main/config.json @@ -0,0 +1,256 @@ +{ + "app": { + "bundleName": "com.huawei.showcase", + "vendor": "huawei", + "version": { + "code": 1, + "name": "1.0" + }, + "apiVersion": { + "compatible": 3, + "target": 3 + } + }, + "deviceConfig": {}, + "module": { + "deviceType": [ + "liteWearable", + "smartVision" + ], + "distro": { + "deliveryWithInstall": true, + "moduleName": "entry", + "moduleType": "entry" + }, + "abilities": [ + { + "name": "default", + "icon": "$media:icon", + "label": "Showcase", + "type": "page", + "visible": true + } + ], + "js": [ + { + "pages": [ + "pages/index/index", + "pages/component/index/containerIndex/index", + "pages/component/index/baseIndex/index", + "pages/component/index/formIndex/index", + "pages/component/index/otherIndex/index", + "pages/component/switch/index/index", + "pages/component/switch/attr/attr", + "pages/component/switch/event/event", + "pages/component/switch/style/style", + "pages/component/swiper/index/index", + "pages/component/swiper/indexAttr/index", + "pages/component/swiper/indexEvent/index", + "pages/component/swiper/indexSpecSet/index", + "pages/component/swiper/indexStyle/index", + "pages/component/swiper/swiper1/swiper1", + "pages/component/swiper/swiper2/swiper2", + "pages/component/swiper/swiper3/swiper3", + "pages/component/swiper/swiper4/swiper4", + "pages/component/swiper/swiper5/swiper5", + "pages/component/swiper/swiper6/swiper6", + "pages/component/swiper/swiper7/swiper7", + "pages/component/swiper/swiper8/swiper8", + "pages/component/swiper/swiper9/swiper9", + "pages/component/swiper/swiper10/swiper10", + "pages/component/swiper/swiper11/swiper11", + "pages/component/div/index/index", + "pages/component/div/indexAttr/index", + "pages/component/div/indexCommonStyle/index", + "pages/component/div/indexSpecStyle/index", + "pages/component/div/indexEvent/index", + "pages/component/div/div1/div1", + "pages/component/div/div2/div2", + "pages/component/div/div3/div3", + "pages/component/div/div4/div4", + "pages/component/div/div5/div5", + "pages/component/div/div6/div6", + "pages/component/div/div7/div7", + "pages/component/div/div8/div8", + "pages/component/div/div9/div9", + "pages/component/div/div10/div10", + "pages/component/div/div11/div11", + "pages/component/div/div12/div12", + "pages/component/stack/index/index", + "pages/component/stack/indexAttr/index", + "pages/component/stack/indexEffect/index", + "pages/component/stack/indexEvent/index", + "pages/component/stack/indexStyle/index", + "pages/component/stack/stack1/stack1", + "pages/component/stack/stack2/stack2", + "pages/component/stack/stack3/stack3", + "pages/component/stack/stack4/stack4", + "pages/component/stack/stack5/stack5", + "pages/component/stack/stack6/stack6", + "pages/component/stack/stack7/stack7", + "pages/component/stack/stack8/stack8", + "pages/component/input/index/index", + "pages/component/input/button/index/index", + "pages/component/input/button/attr/attr", + "pages/component/input/button/event/event", + "pages/component/input/button/style/style", + "pages/component/input/checkbox/index/index", + "pages/component/input/checkbox/attr/attr", + "pages/component/input/checkbox/event/event", + "pages/component/input/checkbox/style/style", + "pages/component/input/radio/index/index", + "pages/component/input/radio/attr/attr", + "pages/component/input/radio/style/style", + "pages/component/input/radio/event/event", + "pages/component/text/index/index", + "pages/component/text/attr/attr", + "pages/component/text/commonStyle/commonStyle", + "pages/component/text/specStyle/specStyle", + "pages/component/text/event/event", + "pages/component/progress/index/index", + "pages/component/progress/circle/index/index", + "pages/component/progress/circle/attr/attr", + "pages/component/progress/circle/event/event", + "pages/component/progress/circle/style/style", + "pages/component/progress/horizontal/index/index", + "pages/component/progress/horizontal/attr/attr", + "pages/component/progress/horizontal/event/event", + "pages/component/progress/horizontal/style/style", + "pages/component/marquee/index/index", + "pages/component/marquee/attr/attr", + "pages/component/marquee/commonStyle/commonStyle", + "pages/component/marquee/event/event", + "pages/component/marquee/specStyle/specStyle", + "pages/component/list/index/index", + "pages/component/list/list/index/index", + "pages/component/list/list/indexAttr/index", + "pages/component/list/list/indexCommonStyle/index", + "pages/component/list/list/indexEvent/index", + "pages/component/list/list/indexOperation/index", + "pages/component/list/list/indexSpecStyle/index", + "pages/component/list/list/list1/list1", + "pages/component/list/list/list2/list2", + "pages/component/list/list/list3/list3", + "pages/component/list/list/list4/list4", + "pages/component/list/list/list5/list5", + "pages/component/list/list/list6/list6", + "pages/component/list/list/list7/list7", + "pages/component/list/list/list8/list8", + "pages/component/list/list/list9/list9", + "pages/component/list/list/list10/list10", + "pages/component/list/list/list11/list11", + "pages/component/list/list/list12/list12", + "pages/component/list/list/list13/list13", + "pages/component/list/list-item/index/index", + "pages/component/list/list-item/indexAttr/index", + "pages/component/list/list-item/indexCommonStyle/index", + "pages/component/list/list-item/indexEvent/index", + "pages/component/list/list-item/item1/item1", + "pages/component/list/list-item/item3/item3", + "pages/component/list/list-item/item5/item5", + "pages/component/list/list-item/item8/item8", + "pages/component/list/list-item/item9/item9", + "pages/component/list/list-item/item11/item11", + "pages/component/list/list-item/item12/item12", + "pages/component/image/index/index", + "pages/component/image/indexAttr/index", + "pages/component/image/indexEvent/index", + "pages/component/image/indexStyle/index", + "pages/component/image/image1/image1", + "pages/component/image/image2/image2", + "pages/component/image/image3/image3", + "pages/component/image/image4/image4", + "pages/component/image/image5/image5", + "pages/component/image/image6/image6", + "pages/component/image/image7/image7", + "pages/component/image/image8/image8", + "pages/component/slider/index/index", + "pages/component/slider/attr/attr", + "pages/component/slider/event/event", + "pages/component/slider/style/style", + "pages/component/animation/index/index", + "pages/component/animation/index1/index", + "pages/component/animation/index2/index", + "pages/component/animation/animation1/animation1", + "pages/component/animation/animation2/animation2", + "pages/component/animation/animation3/animation3", + "pages/component/animation/animation4/animation4", + "pages/component/animation/animation5/animation5", + "pages/component/animation/animation6/animation6", + "pages/component/animation/animation7/animation7", + "pages/component/picker_view/index/index", + "pages/component/picker_view/text_picker/index/index", + "pages/component/picker_view/text_picker/indexAttr/index", + "pages/component/picker_view/text_picker/indexEvent/index", + "pages/component/picker_view/text_picker/indexStyle/index", + "pages/component/picker_view/text_picker/text_picker1/text_picker1", + "pages/component/picker_view/text_picker/text_picker2/text_picker2", + "pages/component/picker_view/text_picker/text_picker3/text_picker3", + "pages/component/picker_view/text_picker/text_picker4/text_picker4", + "pages/component/picker_view/text_picker/text_picker5/text_picker5", + "pages/component/picker_view/text_picker/text_picker6/text_picker6", + "pages/component/picker_view/text_picker/text_picker7/text_picker7", + "pages/component/picker_view/text_picker/text_picker8/text_picker8", + "pages/component/picker_view/text_picker/text_picker9/text_picker9", + "pages/component/picker_view/text_picker/text_picker10/text_picker10", + "pages/component/picker_view/time_picker/index/index", + "pages/component/picker_view/time_picker/indexAttr/index", + "pages/component/picker_view/time_picker/indexEvent/index", + "pages/component/picker_view/time_picker/indexStyle/index", + "pages/component/picker_view/time_picker/time_picker1/time_picker1", + "pages/component/picker_view/time_picker/time_picker2/time_picker2", + "pages/component/picker_view/time_picker/time_picker3/time_picker3", + "pages/component/picker_view/time_picker/time_picker4/time_picker4", + "pages/component/picker_view/time_picker/time_picker5/time_picker5", + "pages/component/picker_view/time_picker/time_picker6/time_picker6", + "pages/component/picker_view/time_picker/time_picker7/time_picker7", + "pages/component/picker_view/time_picker/time_picker8/time_picker8", + "pages/component/picker_view/time_picker/time_picker9/time_picker9", + "pages/component/picker_view/time_picker/time_picker10/time_picker10", + "pages/component/chart/index/index", + "pages/component/chart/barChart/index/index", + "pages/component/chart/barChart/indexAttr/index", + "pages/component/chart/barChart/indexEvent/index", + "pages/component/chart/barChart/indexStyle/index", + "pages/component/chart/barChart/barChart1/barChart1", + "pages/component/chart/barChart/barChart2/barChart2", + "pages/component/chart/barChart/barChart3/barChart3", + "pages/component/chart/barChart/barChart4/barChart4", + "pages/component/chart/barChart/barChart5/barChart5", + "pages/component/chart/barChart/barChart6/barChart6", + "pages/component/chart/barChart/barChart7/barChart7", + "pages/component/chart/barChart/barChart8/barChart8", + "pages/component/chart/lineChart/index/index", + "pages/component/chart/lineChart/indexAttr/index", + "pages/component/chart/lineChart/indexEvent/index", + "pages/component/chart/lineChart/indexStyle/index", + "pages/component/chart/lineChart/lineChart1/lineChart1", + "pages/component/chart/lineChart/lineChart2/lineChart2", + "pages/component/chart/lineChart/lineChart3/lineChart3", + "pages/component/chart/lineChart/lineChart4/lineChart4", + "pages/component/chart/lineChart/lineChart5/lineChart5", + "pages/component/chart/lineChart/lineChart6/lineChart6", + "pages/component/chart/lineChart/lineChart7/lineChart7", + "pages/component/chart/lineChart/lineChart8/lineChart8", + "pages/component/canvas/index/index", + "pages/component/canvas/indexAttr/index", + "pages/component/canvas/indexCommonStyle/index", + "pages/component/canvas/indexEvent/index", + "pages/component/canvas/indexAPI/index", + "pages/component/canvas/indexAPIAttr/index", + "pages/component/canvas/indexAPIDraw/index", + "pages/component/canvas/canvas1/index", + "pages/component/canvas/canvas2/index", + "pages/component/canvas/canvas3/index", + "pages/component/canvas/canvas4/index", + "pages/component/canvas/canvas5/index", + "pages/component/canvas/canvas6/index", + "pages/component/canvas/canvas7/index", + "pages/component/canvas/canvas8/index", + "pages/component/canvas/canvas9/index" + ], + "name": "default" + } + ] + } +} diff --git a/examples/showcase/src/main/js/default/app.js b/examples/showcase/src/main/js/default/app.js new file mode 100755 index 0000000..1a48cb4 --- /dev/null +++ b/examples/showcase/src/main/js/default/app.js @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2020 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 default { + onCreate() { + console.info("Application onCreate"); + }, + onDestroy() { + console.info("Application onDestroy"); + } +}; diff --git a/examples/showcase/src/main/js/default/common/js/chart.js b/examples/showcase/src/main/js/default/common/js/chart.js new file mode 100755 index 0000000..c0be255 --- /dev/null +++ b/examples/showcase/src/main/js/default/common/js/chart.js @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2020 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 const dataCommon = { + datasets: { + barsets: [ + { + fillColor: "#9c9c9c", + data: [2478, 2600, 3000, 3200, 3500, 3888, 4023, 4501, 4999, 5267] + }, + { + fillColor: "#3f9c3f", + data: [2000, 2, 800, 700, 433] + }, + { + fillColor: "#9c3f3f", + data: [100, 200, 300, 400, 500, 600, 550, 450, 350] + } + ], + linesets: [ + { + strokeColor: "#eeaaff", + data: [2478, 2600, 3000, 3200, 3500, 3888, 4023, 4501, 4999, 5267] + }, + { + strokeColor: "#ccddee", + data: [2000, 2, 800, 700, 433] + }, + { + strokeColor: "#ddaacc", + data: [100, 200, 300, 400, 500, 600, 550, 450, 350] + } + ] + }, + options: { + xAxis: { + min: 0, + max: 10, + axisTick: 5, + display: false + }, + yAxis: { + min: 0, + max: 5000, + axisTick: 5, + display: false + } + }, + optionsNoDisplay: { + xAxis: { + min: 0, + max: 10, + axisTick: 5 + }, + yAxis: { + min: 0, + max: 5000, + axisTick: 5 + } + } +}; +export const changeStatus = function() { + if (this.status == true) { + this.status = false; + } else { + this.status = true; + } +}; +export const changeDisplay = function() { + if (this.display === "flex") { + this.display = "none"; + } else { + this.display = "flex"; + } +}; \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/common/js/general.js b/examples/showcase/src/main/js/default/common/js/general.js new file mode 100755 index 0000000..f0fa790 --- /dev/null +++ b/examples/showcase/src/main/js/default/common/js/general.js @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2020 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 router from "@system.router"; +export const backPage = function(superiorUri) { + return { + backMain() { + router.replace({ uri: "pages/index/index" }); + }, + backSuperior() { + router.replace({ uri: superiorUri }); + } + }; +}; +export const goPage = function(superiorUri) { + return { + goHome() { + router.replace({ uri: "pages/index/index" }); + }, + goPrevious() { + router.replace({ uri: superiorUri }); + } + }; +}; +export const routePage = function(page) { + return { + changePage() { + router.replace({ uri: page }); + } + }; +}; +export const eventCommon = function() { + return { + text1: "点击事件未触发", + text2: "长按事件未触发", + text3: "swipe事件未触发", + clickFunc: function() { + this.text1 = "点击事件已触发"; + }, + longpressFunc: function() { + this.text2 = "长按事件已触发"; + }, + swipeFunc: function(e) { + this.text3 = "swipe方向:" + e.direction; + } + }; +}; \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/common/js/image.js b/examples/showcase/src/main/js/default/common/js/image.js new file mode 100755 index 0000000..e57b039 --- /dev/null +++ b/examples/showcase/src/main/js/default/common/js/image.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2020 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. + */ +// image.js +export const changeStatus = function () { + if (this.status == true) { + this.status = false; + } else { + this.status = true; + } +}; \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/common/js/input.js b/examples/showcase/src/main/js/default/common/js/input.js new file mode 100755 index 0000000..88fd6ca --- /dev/null +++ b/examples/showcase/src/main/js/default/common/js/input.js @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2020 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 const changeStatus = function() { + if (this.status == true) { + this.status = false; + } else { + this.status = true; + } +}; +export const changeIf = function() { + if (this.ifStatus) { + this.ifStatus = false; + } else { + this.ifStatus = true; + } +}; \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/common/js/list.js b/examples/showcase/src/main/js/default/common/js/list.js new file mode 100755 index 0000000..73efdbf --- /dev/null +++ b/examples/showcase/src/main/js/default/common/js/list.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2020 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. + */ +// list.js +export const changeStatus = function () { + if (this.status == true) { + this.status = false; + } else { + this.status = true; + } +}; \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/common/js/marquee.js b/examples/showcase/src/main/js/default/common/js/marquee.js new file mode 100755 index 0000000..873b5aa --- /dev/null +++ b/examples/showcase/src/main/js/default/common/js/marquee.js @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2020 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 const changeStatus = function() { + if (this.status == true) { + this.status = false; + } else { + this.status = true; + } +}; +export const changeIfStatus = function() { + if (this.ifstatus == true) { + this.ifstatus = false; + } else { + this.ifstatus = true; + } +}; \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/common/js/picker_view.js b/examples/showcase/src/main/js/default/common/js/picker_view.js new file mode 100755 index 0000000..82131a9 --- /dev/null +++ b/examples/showcase/src/main/js/default/common/js/picker_view.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2020 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. + */ +// picker_view.js +export const changeStatus = function () { + if (this.status == true) { + this.status = false; + } else { + this.status = true; + } +}; \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/common/js/progress.js b/examples/showcase/src/main/js/default/common/js/progress.js new file mode 100755 index 0000000..70d3b3e --- /dev/null +++ b/examples/showcase/src/main/js/default/common/js/progress.js @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2020 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 const changeStatusIf = function() { + if (this.ifStatus == true) { + this.ifStatus = false; + } else { + this.ifStatus = true; + } +}; +export const changeDisplay = function() { + if (this.display === "flex") { + this.display = "none"; + } else { + this.display = "flex"; + } +}; +export const changeStatus = function() { + if (this.status == true) { + this.status = false; + } else { + this.status = true; + } +}; +export const clickEvent = function() { + this.value = "点击已触发"; + this.percent = this.percent + 10; +}; +export const longpressEvent = function() { + this.value = "长按已触发"; + this.percent = this.percent + 20; +}; +export const swipeEvent = function(e) { + this.value = "swipe方向:" + e.direction; +}; \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/common/js/stack.js b/examples/showcase/src/main/js/default/common/js/stack.js new file mode 100755 index 0000000..be7ff8c --- /dev/null +++ b/examples/showcase/src/main/js/default/common/js/stack.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2020 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. + */ +// stack.js +export const changeStatus = function () { + if (this.status == true) { + this.status = false; + } else { + this.status = true; + } +}; \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/common/js/swiper.js b/examples/showcase/src/main/js/default/common/js/swiper.js new file mode 100755 index 0000000..f1a474b --- /dev/null +++ b/examples/showcase/src/main/js/default/common/js/swiper.js @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2020 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 const showPage = function(e) { + this.index = e.index; +}; +export const changeStatus = function() { + if (this.status == true) { + this.status = false; + } else { + this.status = true; + } +}; \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/common/js/text.js b/examples/showcase/src/main/js/default/common/js/text.js new file mode 100755 index 0000000..b427f37 --- /dev/null +++ b/examples/showcase/src/main/js/default/common/js/text.js @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2020 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 const changeShow = function() { + if (this.showStatus == true) { + this.showStatus = false; + } else { + this.showStatus = true; + } +}; +export const changeStatusIf = function() { + if (this.ifStatus == true) { + this.ifStatus = false; + } else { + this.ifStatus = true; + } +}; \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/common/leftHead.png b/examples/showcase/src/main/js/default/common/leftHead.png new file mode 100755 index 0000000..8254866 Binary files /dev/null and b/examples/showcase/src/main/js/default/common/leftHead.png differ diff --git a/examples/showcase/src/main/js/default/pages/component/animation/animation1/animation1.css b/examples/showcase/src/main/js/default/pages/component/animation/animation1/animation1.css new file mode 100755 index 0000000..3917d6b --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/animation/animation1/animation1.css @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2020 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. + */ +.stack { + left: 0px; + top: 0px; + width: 454px; + height: 454px; +} + +.divBlock { + width: 200px; + height: 80px; + left:120px; + background-color: #ff0000; +} + +.divAnimationStyle { + animation-duration: 3000ms; + animation-timing-function: linear; + animation-fill-mode: none; + animation-iteration-count:1; +} + +@keyframes animationChange1 { + from { + background-color: #ff0000; + } + to { + background-color: #0000ff; + } +} + +@keyframes animationChange2 { + from { + width:200px; + } + to { + width:250px; + } +} + +@keyframes animationChange3 { + from { + height:80px; + } + to { + height:130px; + } +} diff --git a/examples/showcase/src/main/js/default/pages/component/animation/animation1/animation1.hml b/examples/showcase/src/main/js/default/pages/component/animation/animation1/animation1.hml new file mode 100755 index 0000000..98b42a6 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/animation/animation1/animation1.hml @@ -0,0 +1,38 @@ + + + + + + + + + +
+ + background-color + +
+
+ + width + +
+
+ + height + +
+
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/animation/animation1/animation1.js b/examples/showcase/src/main/js/default/pages/component/animation/animation1/animation1.js new file mode 100755 index 0000000..57832e2 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/animation/animation1/animation1.js @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2020 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. + */ +// animation1.js +import { backPage } from "../../../../common/js/general"; +export default { + ...backPage("pages/component/animation/index1/index") +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/animation/animation2/animation2.css b/examples/showcase/src/main/js/default/pages/component/animation/animation2/animation2.css new file mode 100755 index 0000000..2de5392 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/animation/animation2/animation2.css @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2020 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. + */ +.stack { + left: 0px; + top: 0px; + width: 454px; + height: 454px; +} + +.divBlock { + width: 200px; + height: 80px; + left:120px; + background-color: #ff0000; +} + +.divAnimationStyle { + animation-duration: 3000ms; + animation-timing-function: linear; + animation-fill-mode: none; + animation-delay: 3000ms; + animation-iteration-count:1; +} + +@keyframes animationChange1 { + from { + background-color: #ff0000; + } + to { + background-color: #0000ff; + } +} diff --git a/examples/showcase/src/main/js/default/pages/component/animation/animation2/animation2.hml b/examples/showcase/src/main/js/default/pages/component/animation/animation2/animation2.hml new file mode 100755 index 0000000..3eded0f --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/animation/animation2/animation2.hml @@ -0,0 +1,28 @@ + + + + + + + + + +
+ + delay:3000ms + +
+
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/animation/animation2/animation2.js b/examples/showcase/src/main/js/default/pages/component/animation/animation2/animation2.js new file mode 100755 index 0000000..4b9764f --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/animation/animation2/animation2.js @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2020 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. + */ +// animation2.js +import { backPage } from "../../../../common/js/general"; +export default { + ...backPage("pages/component/animation/index1/index") +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/animation/animation3/animation3.css b/examples/showcase/src/main/js/default/pages/component/animation/animation3/animation3.css new file mode 100755 index 0000000..e3597bc --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/animation/animation3/animation3.css @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2020 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. + */ +.stack { + left: 0px; + top: 0px; + width: 454px; + height: 454px; +} + +.divBlock { + width: 200px; + height: 80px; + left:120px; + background-color: #ff0000; +} + +.divAnimationStyle1 { + animation-duration: 3000ms; + animation-timing-function: linear; + animation-fill-mode: none; + animation-iteration-count:1; +} + +.divAnimationStyle2 { + animation-duration: 5000ms; + animation-timing-function: linear; + animation-fill-mode: none; + animation-iteration-count:1; +} + +.divAnimationStyle3 { + animation-duration: 10000ms; + animation-timing-function: linear; + animation-fill-mode: none; + animation-iteration-count:1; +} + +@keyframes animationChange { + from { + background-color: #ff0000; + } + to { + background-color: #0000ff; + } +} diff --git a/examples/showcase/src/main/js/default/pages/component/animation/animation3/animation3.hml b/examples/showcase/src/main/js/default/pages/component/animation/animation3/animation3.hml new file mode 100755 index 0000000..d25cc0c --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/animation/animation3/animation3.hml @@ -0,0 +1,38 @@ + + + + + + + + + +
+ + duration:3000ms + +
+
+ + duration:5000ms + +
+
+ + duration:10000ms; + +
+
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/animation/animation3/animation3.js b/examples/showcase/src/main/js/default/pages/component/animation/animation3/animation3.js new file mode 100755 index 0000000..f83a823 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/animation/animation3/animation3.js @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2020 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. + */ +// animation3.js +import { backPage } from "../../../../common/js/general"; +export default { + ...backPage("pages/component/animation/index1/index") +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/animation/animation4/animation4.css b/examples/showcase/src/main/js/default/pages/component/animation/animation4/animation4.css new file mode 100755 index 0000000..f10a3e7 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/animation/animation4/animation4.css @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2020 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. + */ +.stack { + left: 0px; + top: 0px; + width: 454px; + height: 454px; +} + +.divBlock { + width: 200px; + height: 80px; + left:120px; + background-color: #ff0000; +} + +.divAnimationStyle1 { + animation-duration: 2000ms; + animation-timing-function: linear; + animation-fill-mode: none; + animation-iteration-count:1; +} + +.divAnimationStyle2 { + animation-duration: 2000ms; + animation-timing-function: linear; + animation-fill-mode: none; + animation-iteration-count:2; +} + +.divAnimationStyle3 { + animation-duration: 2000ms; + animation-timing-function: linear; + animation-fill-mode: none; + animation-iteration-count: infinite; +} + +@keyframes animationChange { + from { + background-color: #ff0000; + } + to { + background-color: #0000ff; + } +} diff --git a/examples/showcase/src/main/js/default/pages/component/animation/animation4/animation4.hml b/examples/showcase/src/main/js/default/pages/component/animation/animation4/animation4.hml new file mode 100755 index 0000000..d68cdca --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/animation/animation4/animation4.hml @@ -0,0 +1,38 @@ + + + + + + + + + +
+ + 1 + +
+
+ + 2 + +
+
+ + infinite + +
+
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/animation/animation4/animation4.js b/examples/showcase/src/main/js/default/pages/component/animation/animation4/animation4.js new file mode 100755 index 0000000..b1bf832 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/animation/animation4/animation4.js @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2020 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. + */ +// animation4.js +import { backPage } from "../../../../common/js/general"; +export default { + ...backPage("pages/component/animation/index1/index") +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/animation/animation5/animation5.css b/examples/showcase/src/main/js/default/pages/component/animation/animation5/animation5.css new file mode 100755 index 0000000..29f50b5 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/animation/animation5/animation5.css @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2020 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. + */ +.stack { + left: 0px; + top: 0px; + width: 454px; + height: 454px; +} + +.divBlock { + width: 200px; + height: 70px; + left:80px; + background-color: #ff0000; +} + +.divAnimationStyle1 { + animation-duration: 3000ms; + animation-timing-function: linear; + animation-fill-mode: none; + animation-iteration-count:1; +} + +.divAnimationStyle2 { + animation-duration: 3000ms; + animation-timing-function: ease-in; + animation-fill-mode: none; + animation-iteration-count:1; +} + +.divAnimationStyle3 { + animation-duration: 3000ms; + animation-timing-function: ease-out; + animation-fill-mode: none; + animation-iteration-count:1; +} + +.divAnimationStyle4 { + animation-duration: 3000ms; + animation-timing-function: ease-in-out; + animation-fill-mode: none; + animation-iteration-count:1; +} + +@keyframes animationChange { + from { + width:200px; + } + to { + width:280px; + } +} diff --git a/examples/showcase/src/main/js/default/pages/component/animation/animation5/animation5.hml b/examples/showcase/src/main/js/default/pages/component/animation/animation5/animation5.hml new file mode 100755 index 0000000..7c0ea73 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/animation/animation5/animation5.hml @@ -0,0 +1,43 @@ + + + + + + + + + +
+ + linear + +
+
+ + ease-in + +
+
+ + ease-out + +
+
+ + ease-in-out + +
+
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/animation/animation5/animation5.js b/examples/showcase/src/main/js/default/pages/component/animation/animation5/animation5.js new file mode 100755 index 0000000..8b96cca --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/animation/animation5/animation5.js @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2020 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. + */ +// animation5.js +import { backPage } from "../../../../common/js/general"; +export default { + ...backPage("pages/component/animation/index2/index") +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/animation/animation6/animation6.css b/examples/showcase/src/main/js/default/pages/component/animation/animation6/animation6.css new file mode 100755 index 0000000..2532a80 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/animation/animation6/animation6.css @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2020 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. + */ +.stack { + left: 0px; + top: 0px; + width: 454px; + height: 454px; +} + +.divBlock { + width: 200px; + height: 70px; + left:120px; + background-color: #ff0000; +} + +.divAnimationStyle1 { + animation-duration: 3000ms; + animation-timing-function: linear; + animation-fill-mode: none; + animation-iteration-count:1; +} + +.divAnimationStyle2 { + animation-duration: 3000ms; + animation-timing-function: linear; + animation-fill-mode: forwards; + animation-iteration-count:1; +} + +@keyframes animationChange { + from { + background-color: #ff0000; + } + to { + background-color: #0000ff; + } +} diff --git a/examples/showcase/src/main/js/default/pages/component/animation/animation6/animation6.hml b/examples/showcase/src/main/js/default/pages/component/animation/animation6/animation6.hml new file mode 100755 index 0000000..812b303 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/animation/animation6/animation6.hml @@ -0,0 +1,33 @@ + + + + + + + + + +
+ + none + +
+
+ + forwards + +
+
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/animation/animation6/animation6.js b/examples/showcase/src/main/js/default/pages/component/animation/animation6/animation6.js new file mode 100755 index 0000000..2f2d02a --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/animation/animation6/animation6.js @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2020 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. + */ +// animation6.js +import { backPage } from "../../../../common/js/general"; +export default { + ...backPage("pages/component/animation/index2/index") +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/animation/animation7/animation7.css b/examples/showcase/src/main/js/default/pages/component/animation/animation7/animation7.css new file mode 100755 index 0000000..377718a --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/animation/animation7/animation7.css @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2020 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. + */ +.stack { + left: 0px; + top: 0px; + width: 454px; + height: 454px; +} + +.divBlock { + width: 200px; + height: 60px; + left:120px; + background-color: #ff0000; +} + +.divAnimationStyle { + animation-duration: 3000ms; + animation-timing-function: linear; + animation-fill-mode: none; + animation-iteration-count:1; +} + +@keyframes animationChange1 { + from { + transform: translateX(120px); + } + to { + transform: translateX(170px); + } +} + +@keyframes animationChange2 { + from { + transform: translateY(180px); + } + to { + transform: translateY(230px); + } +} + +@keyframes animationChange3 { + from { + transform: rotate(0deg); + } + to { + transform: rotate(360deg); + } +} diff --git a/examples/showcase/src/main/js/default/pages/component/animation/animation7/animation7.hml b/examples/showcase/src/main/js/default/pages/component/animation/animation7/animation7.hml new file mode 100755 index 0000000..8500499 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/animation/animation7/animation7.hml @@ -0,0 +1,35 @@ + + + + + + + + + +
+ + translateX + +
+
+ + translateY + +
+ + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/animation/animation7/animation7.js b/examples/showcase/src/main/js/default/pages/component/animation/animation7/animation7.js new file mode 100755 index 0000000..3cb7096 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/animation/animation7/animation7.js @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2020 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. + */ +// animation7.js +import { backPage } from "../../../../common/js/general"; +export default { + ...backPage("pages/component/animation/index2/index") +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/animation/index/index.css b/examples/showcase/src/main/js/default/pages/component/animation/index/index.css new file mode 100755 index 0000000..e71ae21 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/animation/index/index.css @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2020 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. + */ +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.titleContainerStyle { + width: 454px; + height: 70px; +} + +.titleTextStyle { + width: 454px; + height: 50px; + margin-left: 160px; + margin-top: 0px; +} + +.buttonContainerStyle { + width: 454px; + height: 80px; +} + +.buttonStyle { + width: 200px; + height: 60px; + margin-left: 130px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/animation/index/index.hml b/examples/showcase/src/main/js/default/pages/component/animation/index/index.hml new file mode 100755 index 0000000..5197d7b --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/animation/index/index.hml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + animation + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/animation/index/index.js b/examples/showcase/src/main/js/default/pages/component/animation/index/index.js new file mode 100755 index 0000000..1603786 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/animation/index/index.js @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../common/js/general"; +export default { + ...backPage("pages/component/index/otherIndex/index"), + changePage1: routePage("pages/component/animation/index1/index").changePage, + changePage2: routePage("pages/component/animation/index2/index").changePage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/animation/index1/index.css b/examples/showcase/src/main/js/default/pages/component/animation/index1/index.css new file mode 100755 index 0000000..60569ee --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/animation/index1/index.css @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2020 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. + */ +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.titleContainerStyle { + width: 454px; + height: 70px; +} + +.titleTextStyle { + width: 454px; + height: 50px; + margin-left: 170px; + margin-top: 0px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/animation/index1/index.hml b/examples/showcase/src/main/js/default/pages/component/animation/index1/index.hml new file mode 100755 index 0000000..7a6d105 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/animation/index1/index.hml @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + 动画样式 + + + + + + + + animation-name + + + + + + + + + + + animation-delay + + + + + + + + + + + animation-duration + + + + + + + + + + + animation-iteration-count + + + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/animation/index1/index.js b/examples/showcase/src/main/js/default/pages/component/animation/index1/index.js new file mode 100755 index 0000000..3ff40cb --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/animation/index1/index.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../common/js/general"; +export default { + ...backPage("pages/component/animation/index/index"), + changePage1: routePage("pages/component/animation/animation1/animation1").changePage, + changePage2: routePage("pages/component/animation/animation2/animation2").changePage, + changePage3: routePage("pages/component/animation/animation3/animation3").changePage, + changePage4: routePage("pages/component/animation/animation4/animation4").changePage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/animation/index2/index.css b/examples/showcase/src/main/js/default/pages/component/animation/index2/index.css new file mode 100755 index 0000000..60569ee --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/animation/index2/index.css @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2020 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. + */ +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.titleContainerStyle { + width: 454px; + height: 70px; +} + +.titleTextStyle { + width: 454px; + height: 50px; + margin-left: 170px; + margin-top: 0px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/animation/index2/index.hml b/examples/showcase/src/main/js/default/pages/component/animation/index2/index.hml new file mode 100755 index 0000000..f6b0f2a --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/animation/index2/index.hml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + 动画样式 + + + + + + + + animation-timing-function + + + + + + + + + + + animation-fill-mode + + + + + + + + + + + transform + + + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/animation/index2/index.js b/examples/showcase/src/main/js/default/pages/component/animation/index2/index.js new file mode 100755 index 0000000..f52b360 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/animation/index2/index.js @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../common/js/general"; +export default { + ...backPage("pages/component/animation/index/index"), + changePage1: routePage("pages/component/animation/animation5/animation5").changePage, + changePage2: routePage("pages/component/animation/animation6/animation6").changePage, + changePage3: routePage("pages/component/animation/animation7/animation7").changePage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/canvas/canvas1/index.css b/examples/showcase/src/main/js/default/pages/component/canvas/canvas1/index.css new file mode 100755 index 0000000..37a167c --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/canvas/canvas1/index.css @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2020 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. + */ + +.text { + width: 280px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size: 30; +} diff --git a/examples/showcase/src/main/js/default/pages/component/canvas/canvas1/index.hml b/examples/showcase/src/main/js/default/pages/component/canvas/canvas1/index.hml new file mode 100755 index 0000000..66b5307 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/canvas/canvas1/index.hml @@ -0,0 +1,34 @@ + + +
+ + + + + + + + +
+ + + + +
+ + {{text1}} + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/canvas/canvas1/index.js b/examples/showcase/src/main/js/default/pages/component/canvas/canvas1/index.js new file mode 100755 index 0000000..09d2974 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/canvas/canvas1/index.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../common/js/general"; +export default { + data: { + text1: "点击按钮改变状态", + status: true + }, + ...backPage("pages/component/canvas/indexAttr/index"), + fillRectFunc: function () { + var canvasRef = this.$refs.canvas1; + var ctx = canvasRef.getContext("2d"); + ctx.fillRect(20,20,100,150); + }, + changeStatus: function () { + if (this.status == true) { + this.status = false; + } else { + this.status = true; + } + } +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/canvas/canvas2/index.css b/examples/showcase/src/main/js/default/pages/component/canvas/canvas2/index.css new file mode 100755 index 0000000..37a167c --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/canvas/canvas2/index.css @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2020 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. + */ + +.text { + width: 280px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size: 30; +} diff --git a/examples/showcase/src/main/js/default/pages/component/canvas/canvas2/index.hml b/examples/showcase/src/main/js/default/pages/component/canvas/canvas2/index.hml new file mode 100755 index 0000000..6520530 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/canvas/canvas2/index.hml @@ -0,0 +1,34 @@ + + +
+ + + + + + + + +
+ + + + +
+ + {{text1}} + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/canvas/canvas2/index.js b/examples/showcase/src/main/js/default/pages/component/canvas/canvas2/index.js new file mode 100755 index 0000000..53109f4 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/canvas/canvas2/index.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../common/js/general"; +export default { + data: { + text1: "点击按钮改变状态", + ifStatus: true + }, + ...backPage("pages/component/canvas/indexAttr/index"), + fillRectFunc: function () { + var canvasRef = this.$refs.canvas1; + var ctx = canvasRef.getContext("2d"); + ctx.fillRect(20,20,100,150); + }, + changeIf: function () { + if (this.ifStatus == true) { + this.ifStatus = false; + } else { + this.ifStatus = true; + } + } +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/canvas/canvas3/index.css b/examples/showcase/src/main/js/default/pages/component/canvas/canvas3/index.css new file mode 100755 index 0000000..37a167c --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/canvas/canvas3/index.css @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2020 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. + */ + +.text { + width: 280px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size: 30; +} diff --git a/examples/showcase/src/main/js/default/pages/component/canvas/canvas3/index.hml b/examples/showcase/src/main/js/default/pages/component/canvas/canvas3/index.hml new file mode 100755 index 0000000..1e1ee6b --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/canvas/canvas3/index.hml @@ -0,0 +1,32 @@ + + +
+ + + + + + + + +
+ + +
+ + {{text1}} + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/canvas/canvas3/index.js b/examples/showcase/src/main/js/default/pages/component/canvas/canvas3/index.js new file mode 100755 index 0000000..3600bc1 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/canvas/canvas3/index.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../common/js/general"; +export default { + data: { + listData:["a", "b"], + text1: "for类型canvas" + }, + ...backPage("pages/component/canvas/indexAttr/index"), + fillRectFunc: function () { + var canvasRefa = this.$refs.canvasa; + var ctxa = canvasRefa.getContext("2d"); + ctxa.fillRect(20,20,40,150); + var canvasRefb = this.$refs.canvasb; + var ctxb = canvasRefb.getContext("2d"); + ctxb.fillRect(20,20,30,100); + } +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/canvas/canvas4/index.css b/examples/showcase/src/main/js/default/pages/component/canvas/canvas4/index.css new file mode 100755 index 0000000..999830a --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/canvas/canvas4/index.css @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2020 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. + */ + +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size: 30; +} + +.stack { + left: 0px; + top: 0px; + width: 450px; + height: 450px; + border-width: 1px; + border-color: red; +} diff --git a/examples/showcase/src/main/js/default/pages/component/canvas/canvas4/index.hml b/examples/showcase/src/main/js/default/pages/component/canvas/canvas4/index.hml new file mode 100755 index 0000000..e303b5c --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/canvas/canvas4/index.hml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + {{text1}} + + + {{text2}} + + + {{text3}} + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/canvas/canvas4/index.js b/examples/showcase/src/main/js/default/pages/component/canvas/canvas4/index.js new file mode 100755 index 0000000..cfc22ed --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/canvas/canvas4/index.js @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../common/js/general"; +export default { + data: { + text1: "上面绿块为canvas", + text2: "背景=绿,", + text3: "left=85,top=120" + }, + ...backPage("pages/component/canvas/indexCommonStyle/index"), + fillRect: function () { + var canvasRef = this.$refs.canvasObj; + var ctx = canvasRef.getContext("2d"); + ctx.fillRect(20,20,100,150); + } +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/canvas/canvas5/index.css b/examples/showcase/src/main/js/default/pages/component/canvas/canvas5/index.css new file mode 100755 index 0000000..3412d2e --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/canvas/canvas5/index.css @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2020 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. + */ + +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size: 30; + border-width: 1px; + border-color: red; +} diff --git a/examples/showcase/src/main/js/default/pages/component/canvas/canvas5/index.hml b/examples/showcase/src/main/js/default/pages/component/canvas/canvas5/index.hml new file mode 100755 index 0000000..a00c423 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/canvas/canvas5/index.hml @@ -0,0 +1,34 @@ + + +
+ + + + + + + + + + {{text1}} + + + {{text2}} + + + {{text3}} + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/canvas/canvas5/index.js b/examples/showcase/src/main/js/default/pages/component/canvas/canvas5/index.js new file mode 100755 index 0000000..483f3a9 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/canvas/canvas5/index.js @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../common/js/general"; +export default { + data: { + text1: "上面黄块为canvas", + text2: "margin=20", + text3: "width=280,height=80" + }, + ...backPage("pages/component/canvas/indexCommonStyle/index") +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/canvas/canvas6/index.css b/examples/showcase/src/main/js/default/pages/component/canvas/canvas6/index.css new file mode 100755 index 0000000..285f457 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/canvas/canvas6/index.css @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2020 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. + */ + +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size: 30; +} diff --git a/examples/showcase/src/main/js/default/pages/component/canvas/canvas6/index.hml b/examples/showcase/src/main/js/default/pages/component/canvas/canvas6/index.hml new file mode 100755 index 0000000..80b3016 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/canvas/canvas6/index.hml @@ -0,0 +1,30 @@ + + +
+ + + + + + + + + + + + {{text1}} + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/canvas/canvas6/index.js b/examples/showcase/src/main/js/default/pages/component/canvas/canvas6/index.js new file mode 100755 index 0000000..aa1466d --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/canvas/canvas6/index.js @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../common/js/general"; +export default { + data: { + text1: "边框和内边距" + }, + ...backPage("pages/component/canvas/indexCommonStyle/index"), + fillStyleFunc: function () { + var canvasRef = this.$refs.canvas1; + var ctx = canvasRef.getContext("2d"); + ctx.fillStyle = "#00ff00"; + ctx.strokeStyle = "#ff0000"; // 因为是填充图形,所以边框设置无效 + ctx.fillRect(0,0,100,150); + } +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/canvas/canvas7/index.css b/examples/showcase/src/main/js/default/pages/component/canvas/canvas7/index.css new file mode 100755 index 0000000..818750a --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/canvas/canvas7/index.css @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2020 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. + */ + +.text { + width: 200px; + height: 50px; + margin-bottom: 10px; + margin-left: 10px; + font-size: 30; + border-width: 1px; + border-color: red; +} diff --git a/examples/showcase/src/main/js/default/pages/component/canvas/canvas7/index.hml b/examples/showcase/src/main/js/default/pages/component/canvas/canvas7/index.hml new file mode 100755 index 0000000..aea7691 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/canvas/canvas7/index.hml @@ -0,0 +1,34 @@ + + +
+ + + + + + + + + + {{text1}} + + + {{text2}} + + + {{text3}} + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/canvas/canvas7/index.js b/examples/showcase/src/main/js/default/pages/component/canvas/canvas7/index.js new file mode 100755 index 0000000..4c4f464 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/canvas/canvas7/index.js @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../common/js/general"; +export default { + data: { + text1: "上面绿块为canvas", + text2: "左外=40,上外=15,", + text3: "右外=10,下外=20" + }, + ...backPage("pages/component/canvas/indexCommonStyle/index") +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/canvas/canvas8/index.css b/examples/showcase/src/main/js/default/pages/component/canvas/canvas8/index.css new file mode 100755 index 0000000..3412d2e --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/canvas/canvas8/index.css @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2020 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. + */ + +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size: 30; + border-width: 1px; + border-color: red; +} diff --git a/examples/showcase/src/main/js/default/pages/component/canvas/canvas8/index.hml b/examples/showcase/src/main/js/default/pages/component/canvas/canvas8/index.hml new file mode 100755 index 0000000..cba1c29 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/canvas/canvas8/index.hml @@ -0,0 +1,36 @@ + + +
+ + + + + + + + + + + + {{text1}} + + + {{text2}} + + + {{text3}} + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/canvas/canvas8/index.js b/examples/showcase/src/main/js/default/pages/component/canvas/canvas8/index.js new file mode 100755 index 0000000..b2b1b96 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/canvas/canvas8/index.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../common/js/general"; +export default { + data: { + text1: "上面绿块为canvas", + text2: "点击按钮切换display", + text3: "支持flex/none", + displayValue: "flex" + }, + ...backPage("pages/component/canvas/indexCommonStyle/index"), + changeDisplay: function () { + if (this.displayValue === "flex") { + this.displayValue = "none"; + } else { + this.displayValue = "flex"; + } + } + +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/canvas/canvas9/index.css b/examples/showcase/src/main/js/default/pages/component/canvas/canvas9/index.css new file mode 100755 index 0000000..21072ca --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/canvas/canvas9/index.css @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2020 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. + */ + +.stack { + left: 0px; + top: 0px; + width: 454px; + height: 454px; +} + +.text { + width: 400px; + height: 100px; + margin-top: 10px; + margin-left: 10px; + font-size: 30; + text-overflow: ellipsis; +} diff --git a/examples/showcase/src/main/js/default/pages/component/canvas/canvas9/index.hml b/examples/showcase/src/main/js/default/pages/component/canvas/canvas9/index.hml new file mode 100755 index 0000000..4fa2db6 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/canvas/canvas9/index.hml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + {{text1}} + + + 矩形为canvas组件 + + + 点击/长按/滑动canvas内部任意位置触发事件 + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/canvas/canvas9/index.js b/examples/showcase/src/main/js/default/pages/component/canvas/canvas9/index.js new file mode 100755 index 0000000..fb1af4e --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/canvas/canvas9/index.js @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../common/js/general"; +export default { + data: { + text1: "" + }, + ...backPage("pages/component/canvas/indexEvent/index"), + clickFunc: function () { + this.text1 = "点击事件被触发"; + var canvasRef = this.$refs.canvas1; + var ctx = canvasRef.getContext("2d"); + ctx.fillStyle = "#ffff00"; + ctx.strokeStyle = "#ff0000"; // 因为是填充图形,所以边框设置无效 + ctx.fillRect(10,10,50,100); + }, + longPressFunc: function () { + this.text1 = "长按事件被触发"; + var canvasRef = this.$refs.canvas1; + var ctx = canvasRef.getContext("2d"); + ctx.fillStyle = "#ff0000"; + ctx.strokeStyle = "#ff0000"; // 因为是填充图形,所以边框设置无效 + ctx.fillRect(10,10,50,100); + }, + swipeFunc: function (e) { + this.text1 = "swipe方向:" + e.direction; + } +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/canvas/index/index.css b/examples/showcase/src/main/js/default/pages/component/canvas/index/index.css new file mode 100755 index 0000000..6ecd499 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/canvas/index/index.css @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2020 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. + */ + +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.titleContainerStyle { + width: 454px; + height: 70px; +} + +.titleTextStyle { + width: 454px; + height: 50px; + margin-left: 200px; + margin-top: 0px; +} + +.buttonContainerStyle { + width: 454px; + height: 80px; +} + +.buttonStyle { + width: 200px; + height: 60px; + margin-left: 130px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/canvas/index/index.hml b/examples/showcase/src/main/js/default/pages/component/canvas/index/index.hml new file mode 100755 index 0000000..29ed14f --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/canvas/index/index.hml @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/canvas/index/index.js b/examples/showcase/src/main/js/default/pages/component/canvas/index/index.js new file mode 100755 index 0000000..8f1675b --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/canvas/index/index.js @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2020 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 {goPage, routePage} from "../../../../common/js/general"; +export default { + ...goPage("pages/component/index/baseIndex/index"), + changePage1: routePage("pages/component/canvas/indexAttr/index").changePage, + changePage2: routePage("pages/component/canvas/indexCommonStyle/index").changePage, + changePage3: routePage("pages/component/canvas/indexEvent/index").changePage, + changePage4: routePage("pages/component/canvas/indexAPI/index").changePage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/canvas/indexAPI/index.css b/examples/showcase/src/main/js/default/pages/component/canvas/indexAPI/index.css new file mode 100755 index 0000000..6ecd499 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/canvas/indexAPI/index.css @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2020 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. + */ + +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.titleContainerStyle { + width: 454px; + height: 70px; +} + +.titleTextStyle { + width: 454px; + height: 50px; + margin-left: 200px; + margin-top: 0px; +} + +.buttonContainerStyle { + width: 454px; + height: 80px; +} + +.buttonStyle { + width: 200px; + height: 60px; + margin-left: 130px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/canvas/indexAPI/index.hml b/examples/showcase/src/main/js/default/pages/component/canvas/indexAPI/index.hml new file mode 100755 index 0000000..edeeadd --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/canvas/indexAPI/index.hml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/canvas/indexAPI/index.js b/examples/showcase/src/main/js/default/pages/component/canvas/indexAPI/index.js new file mode 100755 index 0000000..955b018 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/canvas/indexAPI/index.js @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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 {goPage, routePage} from "../../../../common/js/general"; +export default { + ...goPage("pages/component/canvas/index/index"), + changePage1: routePage("pages/component/canvas/indexAPIAttr/index").changePage, + changePage2: routePage("pages/component/canvas/indexAPIDraw/index").changePage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/canvas/indexAPIAttr/index.css b/examples/showcase/src/main/js/default/pages/component/canvas/indexAPIAttr/index.css new file mode 100755 index 0000000..696ba38 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/canvas/indexAPIAttr/index.css @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2020 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. + */ + +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.titleContainerStyle { + width: 454px; + height: 70px; +} + +.titleTextStyle { + width: 454px; + height: 50px; + margin-left: 170px; + margin-top: 0px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/canvas/indexAPIAttr/index.hml b/examples/showcase/src/main/js/default/pages/component/canvas/indexAPIAttr/index.hml new file mode 100755 index 0000000..8f1dedd --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/canvas/indexAPIAttr/index.hml @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + canvas属性接口 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/canvas/indexAPIAttr/index.js b/examples/showcase/src/main/js/default/pages/component/canvas/indexAPIAttr/index.js new file mode 100755 index 0000000..bfc8707 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/canvas/indexAPIAttr/index.js @@ -0,0 +1,112 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../common/js/general"; +export default { + ...backPage("pages/component/canvas/indexAPI/index"), + fillStyleFunc: function () { + var canvasRef = this.$refs.canvas1; + var ctx = canvasRef.getContext("2d"); + + var getFillStyle1 = ctx.fillStyle; // getter默认fillStyle + console.info("getFillStyle1=" + getFillStyle1); + + var getFillStyle2 = ctx.fillStyle; // 再次getter默认fillStyle + console.info("getFillStyle2=" + getFillStyle2); + + ctx.fillStyle = "#00ff00"; // setter + //ctx.fillStyle = "rgba(0,255,0,1)"; //支持 + //ctx.fillStyle = "red"; //不支持 + ctx.strokeStyle = "#ff0000"; // 因为是填充图形,所以边框设置无效 + + var getFillStyle3 = ctx.fillStyle; // setter后getter fillStyle + console.info("getFillStyle3=" + getFillStyle3); + ctx.fillRect(20,20,100,150); + }, + strokeStyleFunc: function () { + var canvasRef = this.$refs.canvas2; + var ctx = canvasRef.getContext("2d"); + + var getStrokeStyle1 = ctx.strokeStyle; // getter默认strokeStyle + console.info("getStrokeStyle1=" + getStrokeStyle1); + var getStrokeStyle2 = ctx.strokeStyle; // 再次getter默认strokeStyle + console.info("getStrokeStyle2=" + getStrokeStyle2); + + ctx.fillStyle = "#00ff00"; // 因为是画矩形框,所以填充设置无效 + ctx.strokeStyle = "#0000ff"; // setter + + var getStrokeStyle3 = ctx.strokeStyle; // setter之后getter strokeStyle + console.info("getStrokeStyle3=" + getStrokeStyle3); + ctx.strokeRect(20,20,100,150); + }, + lineWidthFunc: function () { + var canvasRef = this.$refs.canvas3; + var ctx = canvasRef.getContext("2d"); + + var getLineWidth1 = ctx.lineWidth; // getter默认lineWidth + console.info("getLineWidth1=" + getLineWidth1); + + var getLineWidth2 = ctx.lineWidth; // 再次getter默认lineWidth + console.info("getLineWidth2=" + getLineWidth2); + + ctx.strokeStyle = "#ff0000"; + ctx.lineWidth = "10"; // setter + + var getLineWidth3 = ctx.lineWidth; // setter后getter lineWidth + console.info("getLineWidth3=" + getLineWidth3); + + ctx.strokeRect(20,20,100,150); + }, + fontFunc: function () { + var canvasRef = this.$refs.canvas4; + var ctx = canvasRef.getContext("2d"); + + var getFont1 = ctx.font; // getter默认font + console.info("getFont1=" + getFont1); + + var getFont2 = ctx.font; // 再次getter默认font + console.info("getFont2=" + getFont2); + + ctx.font = " 30px HYQiHei-65S two three f "; // setter + //ctx.font = " "; // setter + + var getFont3 = ctx.font; // setter后getter font + console.info("getFont3=" + getFont3); + + ctx.fillText("Hello ACE", 10, 50); + }, + textAlignFunc: function () { + var canvasRef = this.$refs.canvas5; + var ctx = canvasRef.getContext("2d"); + + var getTextAlign1 = ctx.textAlign; // getter默认text align + console.info("getTextAlign1=" + getTextAlign1); + + var getTextAlign2 = ctx.textAlign; // 再次getter默认text align + console.info("getTextAlign2=" + getTextAlign2); + + ctx.font = "30px HYQiHei-65S"; + ctx.textAlign = "left"; // setter + ctx.fillText("left", 110, 10); + ctx.textAlign = "right"; // setter + ctx.fillText("right", 110, 50); + ctx.textAlign = "center"; // setter + ctx.fillText("center", 110, 100); + + var getTextAlign3 = ctx.textAlign; // setter后 getter text align + console.info("getTextAlign3=" + getTextAlign3); + }, + jumpFunc: routePage("pages/component/canvas/indexAPIAttr/index").changePage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/canvas/indexAPIDraw/index.css b/examples/showcase/src/main/js/default/pages/component/canvas/indexAPIDraw/index.css new file mode 100755 index 0000000..696ba38 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/canvas/indexAPIDraw/index.css @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2020 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. + */ + +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.titleContainerStyle { + width: 454px; + height: 70px; +} + +.titleTextStyle { + width: 454px; + height: 50px; + margin-left: 170px; + margin-top: 0px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/canvas/indexAPIDraw/index.hml b/examples/showcase/src/main/js/default/pages/component/canvas/indexAPIDraw/index.hml new file mode 100755 index 0000000..19c3a6f --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/canvas/indexAPIDraw/index.hml @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + canvas绘图接口 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/canvas/indexAPIDraw/index.js b/examples/showcase/src/main/js/default/pages/component/canvas/indexAPIDraw/index.js new file mode 100755 index 0000000..7fd4863 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/canvas/indexAPIDraw/index.js @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../common/js/general"; +export default { + ...backPage("pages/component/canvas/indexAPI/index"), + fillRectFunc: function () { + var canvasRef = this.$refs.canvas1; + var ctx = canvasRef.getContext("2d"); + ctx.fillRect(20,20,100,150); + }, + strokeRectFunc: function () { + var canvasRef = this.$refs.canvas2; + var ctx = canvasRef.getContext("2d"); + ctx.strokeRect(20,20,100,150); + }, + fillTextFunc: function () { + var canvasRef = this.$refs.canvas3; + var ctx = canvasRef.getContext("2d"); + ctx.font = "30px HYQiHei-65S"; + ctx.fillText("Hello ACE", 10, 50); + }, + arcFunc: function () { + var canvasRef = this.$refs.canvas4; + var ctx = canvasRef.getContext("2d"); + ctx.beginPath(); + ctx.arc(50,50,50,Math.PI*2*(1/36),Math.PI*2*(5/36),true); + ctx.stroke(); + } +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/canvas/indexAttr/index.css b/examples/showcase/src/main/js/default/pages/component/canvas/indexAttr/index.css new file mode 100755 index 0000000..696ba38 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/canvas/indexAttr/index.css @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2020 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. + */ + +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.titleContainerStyle { + width: 454px; + height: 70px; +} + +.titleTextStyle { + width: 454px; + height: 50px; + margin-left: 170px; + margin-top: 0px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/canvas/indexAttr/index.hml b/examples/showcase/src/main/js/default/pages/component/canvas/indexAttr/index.hml new file mode 100755 index 0000000..4d83a94 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/canvas/indexAttr/index.hml @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + canvas通用属性 + + + + + + + + show + + + + + + + + + + + if + + + + + + + + + + + for + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/canvas/indexAttr/index.js b/examples/showcase/src/main/js/default/pages/component/canvas/indexAttr/index.js new file mode 100755 index 0000000..a418d05 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/canvas/indexAttr/index.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../common/js/general"; +export default { + ...backPage("pages/component/canvas/index/index"), + changePage1: routePage("pages/component/canvas/canvas1/index").changePage, + changePage2: routePage("pages/component/canvas/canvas2/index").changePage, + changePage3: routePage("pages/component/canvas/canvas3/index").changePage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/canvas/indexCommonStyle/index.css b/examples/showcase/src/main/js/default/pages/component/canvas/indexCommonStyle/index.css new file mode 100755 index 0000000..696ba38 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/canvas/indexCommonStyle/index.css @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2020 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. + */ + +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.titleContainerStyle { + width: 454px; + height: 70px; +} + +.titleTextStyle { + width: 454px; + height: 50px; + margin-left: 170px; + margin-top: 0px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/canvas/indexCommonStyle/index.hml b/examples/showcase/src/main/js/default/pages/component/canvas/indexCommonStyle/index.hml new file mode 100755 index 0000000..1ce5f3a --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/canvas/indexCommonStyle/index.hml @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + canvas通用样式 + + + + + + + + 背景色 + + + left + + + top + + + + + + + + + + + margin + + + height + + + width + + + + + + + + + + + border + + + padding + + + + + + + + + + + margin-left + + + margin-top + + + margin-right + + + margin-bottom + + + + + + + + + + + display + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/canvas/indexCommonStyle/index.js b/examples/showcase/src/main/js/default/pages/component/canvas/indexCommonStyle/index.js new file mode 100755 index 0000000..afdfbfb --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/canvas/indexCommonStyle/index.js @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../common/js/general"; +export default { + ...backPage("pages/component/canvas/index/index"), + changePage1: routePage("pages/component/canvas/canvas4/index").changePage, + changePage2: routePage("pages/component/canvas/canvas5/index").changePage, + changePage3: routePage("pages/component/canvas/canvas6/index").changePage, + changePage4: routePage("pages/component/canvas/canvas7/index").changePage, + changePage5: routePage("pages/component/canvas/canvas8/index").changePage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/canvas/indexEvent/index.css b/examples/showcase/src/main/js/default/pages/component/canvas/indexEvent/index.css new file mode 100755 index 0000000..696ba38 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/canvas/indexEvent/index.css @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2020 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. + */ + +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.titleContainerStyle { + width: 454px; + height: 70px; +} + +.titleTextStyle { + width: 454px; + height: 50px; + margin-left: 170px; + margin-top: 0px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/canvas/indexEvent/index.hml b/examples/showcase/src/main/js/default/pages/component/canvas/indexEvent/index.hml new file mode 100755 index 0000000..0c0b052 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/canvas/indexEvent/index.hml @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + canvas通用事件 + + + + + + + + click + + + longpress + + + swipe + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/canvas/indexEvent/index.js b/examples/showcase/src/main/js/default/pages/component/canvas/indexEvent/index.js new file mode 100755 index 0000000..be8dbab --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/canvas/indexEvent/index.js @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../common/js/general"; +export default { + ...backPage("pages/component/canvas/index/index"), + changePage1: routePage("pages/component/canvas/canvas9/index").changePage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart1/barChart1.css b/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart1/barChart1.css new file mode 100755 index 0000000..d1559a9 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart1/barChart1.css @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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. + */ +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart1/barChart1.hml b/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart1/barChart1.hml new file mode 100755 index 0000000..88df24c --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart1/barChart1.hml @@ -0,0 +1,34 @@ + + +
+ + + + + + + + + + {{text1}} + + + {{text2}} + + + {{text3}} + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart1/barChart1.js b/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart1/barChart1.js new file mode 100755 index 0000000..0c2a70a --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart1/barChart1.js @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage, eventCommon} from "../../../../../common/js/general"; +import {dataCommon} from "../../../../../common/js/chart"; +export default { + ...backPage("pages/component/chart/barChart/indexEvent/index"), + data: { + text1: eventCommon().text1, + text2: eventCommon().text2, + text3: eventCommon().text3, + datasets: dataCommon.datasets.barsets, + options: dataCommon.options + }, + clickFunc: eventCommon().clickFunc, + longpressFunc: eventCommon().longpressFunc, + swipeFunc: eventCommon().swipeFunc +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart2/barChart2.css b/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart2/barChart2.css new file mode 100755 index 0000000..f07e5b9 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart2/barChart2.css @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2020 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. + */ +.stack { + left: 0px; + top: 0px; + width: 454px; + height: 454px; +} + +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart2/barChart2.hml b/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart2/barChart2.hml new file mode 100755 index 0000000..6f4fc83 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart2/barChart2.hml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + {{text1}} + + + {{text2}} + + + {{text3}} + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart2/barChart2.js b/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart2/barChart2.js new file mode 100755 index 0000000..748ebc2 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart2/barChart2.js @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +import {dataCommon} from "../../../../../common/js/chart"; +export default { + ...backPage("pages/component/chart/barChart/indexStyle/index"), + data: { + text1: "背景色绿色", + text2: "left设置85", + text3: "top设置170", + datasets: dataCommon.datasets.barsets, + options: dataCommon.options, + } +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart3/barChart3.css b/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart3/barChart3.css new file mode 100755 index 0000000..0e8a333 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart3/barChart3.css @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2020 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. + */ +.text { + width: 280px; + height: 50px; + font-size: 30px; +} + +.item { + width: 280px; + height: 50px; +} + +.div1 { + height: 145px; + width: 160px; + border-width: 1px; + border-color: #ff0000; +} + +.div2 { + width: 100px; + height: 50px; + background-color: #00ff00; +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart3/barChart3.hml b/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart3/barChart3.hml new file mode 100755 index 0000000..595aea0 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart3/barChart3.hml @@ -0,0 +1,60 @@ + + +
+ + + + + + +
+
+ + +
+
+ + +
+
+ + + + 宽100px;高50px + + + + + div1左边距100px + + + + + div1上边距20px + + + + + div2右边距20px + + + + + div2下边距20px + + + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart3/barChart3.js b/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart3/barChart3.js new file mode 100755 index 0000000..fb90893 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart3/barChart3.js @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +import {dataCommon} from "../../../../../common/js/chart"; +export default { + ...backPage("pages/component/chart/barChart/indexStyle/index"), + data: { + text1: "margin左边距85", + text2: "margin上边距10", + text3: "宽高已设置", + datasets: dataCommon.datasets.barsets, + options: dataCommon.options, + } +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart4/barChart4.css b/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart4/barChart4.css new file mode 100755 index 0000000..06a7a5d --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart4/barChart4.css @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2020 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. + */ diff --git a/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart4/barChart4.hml b/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart4/barChart4.hml new file mode 100755 index 0000000..224f485 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart4/barChart4.hml @@ -0,0 +1,27 @@ + + +
+ + + + + + + + + + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart4/barChart4.js b/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart4/barChart4.js new file mode 100755 index 0000000..943ad92 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart4/barChart4.js @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +import {dataCommon} from "../../../../../common/js/chart"; +export default { + ...backPage("pages/component/chart/barChart/indexStyle/index"), + data: { + datasets: dataCommon.datasets.barsets, + options: dataCommon.options, + } +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart5/barChart5.css b/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart5/barChart5.css new file mode 100755 index 0000000..06a7a5d --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart5/barChart5.css @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2020 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. + */ diff --git a/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart5/barChart5.hml b/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart5/barChart5.hml new file mode 100755 index 0000000..cd9e5f0 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart5/barChart5.hml @@ -0,0 +1,25 @@ + + +
+ + + + + + + + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart5/barChart5.js b/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart5/barChart5.js new file mode 100755 index 0000000..7428a0b --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart5/barChart5.js @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +import {dataCommon} from "../../../../../common/js/chart"; +export default { + ...backPage("pages/component/chart/barChart/indexAttr/index"), + data: { + datasets: dataCommon.datasets.barsets, + options: dataCommon.optionsNoDisplay + } +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart6/barChart6.css b/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart6/barChart6.css new file mode 100755 index 0000000..d1559a9 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart6/barChart6.css @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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. + */ +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart6/barChart6.hml b/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart6/barChart6.hml new file mode 100755 index 0000000..d2cbd07 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart6/barChart6.hml @@ -0,0 +1,30 @@ + + +
+ + + + + + + + + + + + {{text1}} + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart6/barChart6.js b/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart6/barChart6.js new file mode 100755 index 0000000..0984954 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart6/barChart6.js @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +import {dataCommon, changeStatus} from "../../../../../common/js/chart"; +export default { + ...backPage("pages/component/chart/barChart/indexAttr/index"), + data: { + text1: "显示状态改变", + chart01: "chart01", + status: true, + datasets: dataCommon.datasets.barsets, + options: dataCommon.options + }, + changeStatus: changeStatus, +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart7/barChart7.css b/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart7/barChart7.css new file mode 100755 index 0000000..d1559a9 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart7/barChart7.css @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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. + */ +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart7/barChart7.hml b/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart7/barChart7.hml new file mode 100755 index 0000000..e9eff2e --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart7/barChart7.hml @@ -0,0 +1,28 @@ + + +
+ + + + + + + + + + 循环3次,点击改变display + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart7/barChart7.js b/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart7/barChart7.js new file mode 100755 index 0000000..83d386b --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart7/barChart7.js @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +import {dataCommon, changeStatus, changeDisplay} from "../../../../../common/js/chart"; +export default { + ...backPage("pages/component/chart/barChart/indexAttr/index"), + data: { + datasets: dataCommon.datasets.barsets, + options: dataCommon.options, + status: true, + text1: "显示状态改变", + loopArray: ["1", "2", "3"], + display: "flex", + }, + changeStatus: changeStatus, + changeDisplay: changeDisplay +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart8/barChart8.css b/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart8/barChart8.css new file mode 100755 index 0000000..d1559a9 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart8/barChart8.css @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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. + */ +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart8/barChart8.hml b/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart8/barChart8.hml new file mode 100755 index 0000000..84d80b0 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart8/barChart8.hml @@ -0,0 +1,30 @@ + + +
+ + + + + + + + + + + + {{text1}} + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart8/barChart8.js b/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart8/barChart8.js new file mode 100755 index 0000000..3087601 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/barChart/barChart8/barChart8.js @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +import {dataCommon, changeStatus} from "../../../../../common/js/chart"; +export default { + ...backPage("pages/component/chart/barChart/indexAttr/index"), + data: { + datasets: dataCommon.datasets.barsets, + options: dataCommon.options, + status: true, + text1: "显示状态改变" + }, + changeStatus: changeStatus +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/chart/barChart/index/index.css b/examples/showcase/src/main/js/default/pages/component/chart/barChart/index/index.css new file mode 100755 index 0000000..e71ae21 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/barChart/index/index.css @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2020 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. + */ +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.titleContainerStyle { + width: 454px; + height: 70px; +} + +.titleTextStyle { + width: 454px; + height: 50px; + margin-left: 160px; + margin-top: 0px; +} + +.buttonContainerStyle { + width: 454px; + height: 80px; +} + +.buttonStyle { + width: 200px; + height: 60px; + margin-left: 130px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/chart/barChart/index/index.hml b/examples/showcase/src/main/js/default/pages/component/chart/barChart/index/index.hml new file mode 100755 index 0000000..624a833 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/barChart/index/index.hml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + bar-chart + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/chart/barChart/index/index.js b/examples/showcase/src/main/js/default/pages/component/chart/barChart/index/index.js new file mode 100755 index 0000000..2779495 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/barChart/index/index.js @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +export default { + ...backPage("pages/component/chart/index/index"), + changePage1: routePage("pages/component/chart/barChart/indexAttr/index").changePage, + changePage2: routePage("pages/component/chart/barChart/indexStyle/index").changePage, + changePage3: routePage("pages/component/chart/barChart/indexEvent/index").changePage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/chart/barChart/indexAttr/index.css b/examples/showcase/src/main/js/default/pages/component/chart/barChart/indexAttr/index.css new file mode 100755 index 0000000..60569ee --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/barChart/indexAttr/index.css @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2020 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. + */ +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.titleContainerStyle { + width: 454px; + height: 70px; +} + +.titleTextStyle { + width: 454px; + height: 50px; + margin-left: 170px; + margin-top: 0px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/chart/barChart/indexAttr/index.hml b/examples/showcase/src/main/js/default/pages/component/chart/barChart/indexAttr/index.hml new file mode 100755 index 0000000..defaded --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/barChart/indexAttr/index.hml @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + 通用属性 + + + + + + + + show + + + + + + + + + + + for + + + + + + + + + + + if + + + + + + + + + + 特有属性 + + + + + + + + datasets: + + + 全量属性 + + + options + + + 全量属性 + + + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/chart/barChart/indexAttr/index.js b/examples/showcase/src/main/js/default/pages/component/chart/barChart/indexAttr/index.js new file mode 100755 index 0000000..3608277 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/barChart/indexAttr/index.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +export default { + ...backPage("pages/component/chart/barChart/index/index"), + changePage1: routePage("pages/component/chart/barChart/barChart6/barChart6").changePage, + changePage2: routePage("pages/component/chart/barChart/barChart5/barChart5").changePage, + changePage3: routePage("pages/component/chart/barChart/barChart7/barChart7").changePage, + changePage4: routePage("pages/component/chart/barChart/barChart8/barChart8").changePage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/chart/barChart/indexEvent/index.css b/examples/showcase/src/main/js/default/pages/component/chart/barChart/indexEvent/index.css new file mode 100755 index 0000000..60569ee --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/barChart/indexEvent/index.css @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2020 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. + */ +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.titleContainerStyle { + width: 454px; + height: 70px; +} + +.titleTextStyle { + width: 454px; + height: 50px; + margin-left: 170px; + margin-top: 0px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/chart/barChart/indexEvent/index.hml b/examples/showcase/src/main/js/default/pages/component/chart/barChart/indexEvent/index.hml new file mode 100755 index 0000000..bf1a4cb --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/barChart/indexEvent/index.hml @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + 通用事件 + + + + + + + + click + + + longpress + + + swipe + + + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/chart/barChart/indexEvent/index.js b/examples/showcase/src/main/js/default/pages/component/chart/barChart/indexEvent/index.js new file mode 100755 index 0000000..cbcf63a --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/barChart/indexEvent/index.js @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +export default { + ...backPage("pages/component/chart/barChart/index/index"), + changePage1: routePage("pages/component/chart/barChart/barChart1/barChart1").changePage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/chart/barChart/indexStyle/index.css b/examples/showcase/src/main/js/default/pages/component/chart/barChart/indexStyle/index.css new file mode 100755 index 0000000..60569ee --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/barChart/indexStyle/index.css @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2020 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. + */ +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.titleContainerStyle { + width: 454px; + height: 70px; +} + +.titleTextStyle { + width: 454px; + height: 50px; + margin-left: 170px; + margin-top: 0px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/chart/barChart/indexStyle/index.hml b/examples/showcase/src/main/js/default/pages/component/chart/barChart/indexStyle/index.hml new file mode 100755 index 0000000..ef0254e --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/barChart/indexStyle/index.hml @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + 通用样式 + + + + + + + + 背景色 + + + left + + + top + + + + + + + + + + + margin + + + height + + + width + + + + + + + + + + + border + + + padding + + + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/chart/barChart/indexStyle/index.js b/examples/showcase/src/main/js/default/pages/component/chart/barChart/indexStyle/index.js new file mode 100755 index 0000000..2742b64 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/barChart/indexStyle/index.js @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +export default { + ...backPage("pages/component/chart/barChart/index/index"), + changePage1: routePage("pages/component/chart/barChart/barChart2/barChart2").changePage, + changePage2: routePage("pages/component/chart/barChart/barChart3/barChart3").changePage, + changePage3: routePage("pages/component/chart/barChart/barChart4/barChart4").changePage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/chart/index/index.css b/examples/showcase/src/main/js/default/pages/component/chart/index/index.css new file mode 100755 index 0000000..b57bf31 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/index/index.css @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2020 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. + */ +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} diff --git a/examples/showcase/src/main/js/default/pages/component/chart/index/index.hml b/examples/showcase/src/main/js/default/pages/component/chart/index/index.hml new file mode 100755 index 0000000..1691b09 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/index/index.hml @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + bar + + + + + + + + + + + line + + + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/chart/index/index.js b/examples/showcase/src/main/js/default/pages/component/chart/index/index.js new file mode 100755 index 0000000..334e21e --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/index/index.js @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../common/js/general"; +export default { + ...backPage("pages/component/index/baseIndex/index"), + changeBar: routePage("pages/component/chart/barChart/index/index").changePage, + changeLine: routePage("pages/component/chart/lineChart/index/index").changePage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/chart/lineChart/index/index.css b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/index/index.css new file mode 100755 index 0000000..e71ae21 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/index/index.css @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2020 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. + */ +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.titleContainerStyle { + width: 454px; + height: 70px; +} + +.titleTextStyle { + width: 454px; + height: 50px; + margin-left: 160px; + margin-top: 0px; +} + +.buttonContainerStyle { + width: 454px; + height: 80px; +} + +.buttonStyle { + width: 200px; + height: 60px; + margin-left: 130px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/chart/lineChart/index/index.hml b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/index/index.hml new file mode 100755 index 0000000..75f37b1 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/index/index.hml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + line-chart + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/chart/lineChart/index/index.js b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/index/index.js new file mode 100755 index 0000000..8ba4b1a --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/index/index.js @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +export default { + ...backPage("pages/component/chart/index/index"), + changePage1: routePage("pages/component/chart/lineChart/indexAttr/index").changePage, + changePage2: routePage("pages/component/chart/lineChart/indexStyle/index").changePage, + changePage3: routePage("pages/component/chart/lineChart/indexEvent/index").changePage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/chart/lineChart/indexAttr/index.css b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/indexAttr/index.css new file mode 100755 index 0000000..60569ee --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/indexAttr/index.css @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2020 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. + */ +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.titleContainerStyle { + width: 454px; + height: 70px; +} + +.titleTextStyle { + width: 454px; + height: 50px; + margin-left: 170px; + margin-top: 0px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/chart/lineChart/indexAttr/index.hml b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/indexAttr/index.hml new file mode 100755 index 0000000..5e0e09b --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/indexAttr/index.hml @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + 通用属性 + + + + + + + + show + + + + + + + + + + + for + + + + + + + + + + + if + + + + + + + + + + 特有属性 + + + + + + + + datasets: + + + 全量属性 + + + options + + + 全量属性 + + + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/chart/lineChart/indexAttr/index.js b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/indexAttr/index.js new file mode 100755 index 0000000..fdd1633 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/indexAttr/index.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +export default { + ...backPage("pages/component/chart/lineChart/index/index"), + changePage1: routePage("pages/component/chart/lineChart/lineChart6/lineChart6").changePage, + changePage2: routePage("pages/component/chart/lineChart/lineChart5/lineChart5").changePage, + changePage3: routePage("pages/component/chart/lineChart/lineChart7/lineChart7").changePage, + changePage4: routePage("pages/component/chart/lineChart/lineChart8/lineChart8").changePage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/chart/lineChart/indexEvent/index.css b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/indexEvent/index.css new file mode 100755 index 0000000..60569ee --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/indexEvent/index.css @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2020 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. + */ +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.titleContainerStyle { + width: 454px; + height: 70px; +} + +.titleTextStyle { + width: 454px; + height: 50px; + margin-left: 170px; + margin-top: 0px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/chart/lineChart/indexEvent/index.hml b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/indexEvent/index.hml new file mode 100755 index 0000000..bf1a4cb --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/indexEvent/index.hml @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + 通用事件 + + + + + + + + click + + + longpress + + + swipe + + + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/chart/lineChart/indexEvent/index.js b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/indexEvent/index.js new file mode 100755 index 0000000..8d0cc01 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/indexEvent/index.js @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +export default { + ...backPage("pages/component/chart/lineChart/index/index"), + changePage1: routePage("pages/component/chart/lineChart/lineChart1/lineChart1").changePage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/chart/lineChart/indexStyle/index.css b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/indexStyle/index.css new file mode 100755 index 0000000..60569ee --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/indexStyle/index.css @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2020 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. + */ +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.titleContainerStyle { + width: 454px; + height: 70px; +} + +.titleTextStyle { + width: 454px; + height: 50px; + margin-left: 170px; + margin-top: 0px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/chart/lineChart/indexStyle/index.hml b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/indexStyle/index.hml new file mode 100755 index 0000000..ef0254e --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/indexStyle/index.hml @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + 通用样式 + + + + + + + + 背景色 + + + left + + + top + + + + + + + + + + + margin + + + height + + + width + + + + + + + + + + + border + + + padding + + + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/chart/lineChart/indexStyle/index.js b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/indexStyle/index.js new file mode 100755 index 0000000..5e37a4e --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/indexStyle/index.js @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +export default { + ...backPage("pages/component/chart/lineChart/index/index"), + changePage1: routePage("pages/component/chart/lineChart/lineChart2/lineChart2").changePage, + changePage2: routePage("pages/component/chart/lineChart/lineChart3/lineChart3").changePage, + changePage3: routePage("pages/component/chart/lineChart/lineChart4/lineChart4").changePage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart1/lineChart1.css b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart1/lineChart1.css new file mode 100755 index 0000000..d1559a9 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart1/lineChart1.css @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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. + */ +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart1/lineChart1.hml b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart1/lineChart1.hml new file mode 100755 index 0000000..0ee9cdc --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart1/lineChart1.hml @@ -0,0 +1,34 @@ + + +
+ + + + + + + + + + {{text1}} + + + {{text2}} + + + {{text3}} + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart1/lineChart1.js b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart1/lineChart1.js new file mode 100755 index 0000000..e88ea25 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart1/lineChart1.js @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage, eventCommon} from "../../../../../common/js/general"; +import {dataCommon} from "../../../../../common/js/chart"; +export default { + ...backPage("pages/component/chart/lineChart/indexEvent/index"), + data: { + datasets: dataCommon.datasets.linesets, + options: dataCommon.options, + text1: eventCommon().text1, + text2: eventCommon().text2, + text3: eventCommon().text3, + }, + clickFunc: eventCommon().clickFunc, + longpressFunc: eventCommon().longpressFunc, + swipeFunc: eventCommon().swipeFunc +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart2/lineChart2.css b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart2/lineChart2.css new file mode 100755 index 0000000..f07e5b9 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart2/lineChart2.css @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2020 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. + */ +.stack { + left: 0px; + top: 0px; + width: 454px; + height: 454px; +} + +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart2/lineChart2.hml b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart2/lineChart2.hml new file mode 100755 index 0000000..4fde80c --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart2/lineChart2.hml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + {{text1}} + + + {{text2}} + + + {{text3}} + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart2/lineChart2.js b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart2/lineChart2.js new file mode 100755 index 0000000..7aecba9 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart2/lineChart2.js @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +import {dataCommon} from "../../../../../common/js/chart"; +export default { + ...backPage("pages/component/chart/lineChart/indexStyle/index"), + data: { + text1: "背景色绿色", + text2: "left设置85", + text3: "top设置170", + datasets: dataCommon.datasets.linesets, + options: dataCommon.options, + } +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart3/lineChart3.css b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart3/lineChart3.css new file mode 100755 index 0000000..0e8a333 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart3/lineChart3.css @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2020 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. + */ +.text { + width: 280px; + height: 50px; + font-size: 30px; +} + +.item { + width: 280px; + height: 50px; +} + +.div1 { + height: 145px; + width: 160px; + border-width: 1px; + border-color: #ff0000; +} + +.div2 { + width: 100px; + height: 50px; + background-color: #00ff00; +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart3/lineChart3.hml b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart3/lineChart3.hml new file mode 100755 index 0000000..2560862 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart3/lineChart3.hml @@ -0,0 +1,60 @@ + + +
+ + + + + + +
+
+ + +
+
+ + +
+
+ + + + 宽100px;高50px + + + + + div1左边距100px + + + + + div1上边距20px + + + + + div2右边距20px + + + + + div2下边距20px + + + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart3/lineChart3.js b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart3/lineChart3.js new file mode 100755 index 0000000..b7bdaed --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart3/lineChart3.js @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +import {dataCommon} from "../../../../../common/js/chart"; +export default { + ...backPage("pages/component/chart/lineChart/indexStyle/index"), + data: { + datasets: dataCommon.datasets.linesets, + options: dataCommon.options, + text1: "margin左边距85", + text2: "margin上边距10", + text3: "宽高已设置", + } +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart4/lineChart4.css b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart4/lineChart4.css new file mode 100755 index 0000000..06a7a5d --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart4/lineChart4.css @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2020 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. + */ diff --git a/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart4/lineChart4.hml b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart4/lineChart4.hml new file mode 100755 index 0000000..afdb410 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart4/lineChart4.hml @@ -0,0 +1,27 @@ + + +
+ + + + + + + + + + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart4/lineChart4.js b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart4/lineChart4.js new file mode 100755 index 0000000..17dc9ca --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart4/lineChart4.js @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +import {dataCommon} from "../../../../../common/js/chart"; +export default { + ...backPage("pages/component/chart/lineChart/indexStyle/index"), + data: { + datasets: dataCommon.datasets.linesets, + options: dataCommon.options + } +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart5/lineChart5.css b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart5/lineChart5.css new file mode 100755 index 0000000..06a7a5d --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart5/lineChart5.css @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2020 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. + */ diff --git a/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart5/lineChart5.hml b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart5/lineChart5.hml new file mode 100755 index 0000000..b610736 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart5/lineChart5.hml @@ -0,0 +1,25 @@ + + +
+ + + + + + + + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart5/lineChart5.js b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart5/lineChart5.js new file mode 100755 index 0000000..0a82238 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart5/lineChart5.js @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +import {dataCommon} from "../../../../../common/js/chart"; +export default { + ...backPage("pages/component/chart/lineChart/indexAttr/index"), + data: { + datasets: dataCommon.datasets.linesets, + options: dataCommon.optionsNoDisplay + } +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart6/lineChart6.css b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart6/lineChart6.css new file mode 100755 index 0000000..d1559a9 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart6/lineChart6.css @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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. + */ +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart6/lineChart6.hml b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart6/lineChart6.hml new file mode 100755 index 0000000..c43b856 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart6/lineChart6.hml @@ -0,0 +1,30 @@ + + +
+ + + + + + + + + + + + {{text1}} + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart6/lineChart6.js b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart6/lineChart6.js new file mode 100755 index 0000000..3fd3a81 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart6/lineChart6.js @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +import {dataCommon, changeStatus} from "../../../../../common/js/chart"; +export default { + ...backPage("pages/component/chart/lineChart/indexAttr/index"), + data: { + datasets: dataCommon.datasets.linesets, + options: dataCommon.options, + chart01: "chart01", + status: true, + text1: "显示状态改变" + }, + changeStatus: changeStatus +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart7/lineChart7.css b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart7/lineChart7.css new file mode 100755 index 0000000..d1559a9 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart7/lineChart7.css @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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. + */ +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart7/lineChart7.hml b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart7/lineChart7.hml new file mode 100755 index 0000000..13c9f22 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart7/lineChart7.hml @@ -0,0 +1,28 @@ + + +
+ + + + + + + + + + 循环3次,点击改变display + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart7/lineChart7.js b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart7/lineChart7.js new file mode 100755 index 0000000..571c789 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart7/lineChart7.js @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +import {dataCommon, changeStatus, changeDisplay} from "../../../../../common/js/chart"; +export default { + ...backPage("pages/component/chart/lineChart/indexAttr/index"), + changeStatus: changeStatus, + changeDisplay: changeDisplay, + data: { + loopArray: ["1", "2", "3"], + display: "flex", + status: true, + text1: "显示状态改变", + datasets: dataCommon.datasets.linesets, + options: dataCommon.options + } +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart8/lineChart8.css b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart8/lineChart8.css new file mode 100755 index 0000000..d1559a9 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart8/lineChart8.css @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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. + */ +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart8/lineChart8.hml b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart8/lineChart8.hml new file mode 100755 index 0000000..7abb2cf --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart8/lineChart8.hml @@ -0,0 +1,30 @@ + + +
+ + + + + + + + + + + + {{text1}} + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart8/lineChart8.js b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart8/lineChart8.js new file mode 100755 index 0000000..400785c --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/chart/lineChart/lineChart8/lineChart8.js @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +import {dataCommon, changeStatus} from "../../../../../common/js/chart"; +export default { + ...backPage("pages/component/chart/lineChart/indexAttr/index"), + data: { + status: true, + text1: "显示状态改变", + datasets: dataCommon.datasets.linesets, + options: dataCommon.options, + }, + changeStatus: changeStatus +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/div/div1/div1.css b/examples/showcase/src/main/js/default/pages/component/div/div1/div1.css new file mode 100755 index 0000000..f1f3c27 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/div/div1/div1.css @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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. + */ +.text { + width: 280px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/div/div1/div1.hml b/examples/showcase/src/main/js/default/pages/component/div/div1/div1.hml new file mode 100755 index 0000000..3769d39 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/div/div1/div1.hml @@ -0,0 +1,37 @@ + + +
+ + + + + + +
+ + 操作div触发事件 + +
+ + {{text1}} + + + {{text2}} + + + {{text3}} + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/div/div1/div1.js b/examples/showcase/src/main/js/default/pages/component/div/div1/div1.js new file mode 100755 index 0000000..52d5035 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/div/div1/div1.js @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2020 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 {backPage, eventCommon} from "../../../../common/js/general"; +export default { + ...backPage("pages/component/div/indexEvent/index"), + data: { + text1: eventCommon().text1, + text2: eventCommon().text2, + text3: eventCommon().text3 + }, + clickFunc: eventCommon().clickFunc, + longpressFunc: eventCommon().longpressFunc, + swipeFunc: eventCommon().swipeFunc +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/div/div10/div10.css b/examples/showcase/src/main/js/default/pages/component/div/div10/div10.css new file mode 100755 index 0000000..f1f3c27 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/div/div10/div10.css @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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. + */ +.text { + width: 280px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/div/div10/div10.hml b/examples/showcase/src/main/js/default/pages/component/div/div10/div10.hml new file mode 100755 index 0000000..700c3a8 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/div/div10/div10.hml @@ -0,0 +1,33 @@ + + +
+ + + + + + +
+ + 观察show属性作用 + +
+ + + + {{text1}} + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/div/div10/div10.js b/examples/showcase/src/main/js/default/pages/component/div/div10/div10.js new file mode 100755 index 0000000..4b6ae2b --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/div/div10/div10.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2020 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 {backPage} from "../../../../common/js/general"; +export default { + ...backPage("pages/component/div/indexAttr/index"), + data: { + text1: "点击按钮改变状态", + status: true, + div01: "div01" + }, + changeStatus: function () { + if (this.status == true) { + this.status = false; + } else { + this.status = true; + } + } +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/div/div11/div11.css b/examples/showcase/src/main/js/default/pages/component/div/div11/div11.css new file mode 100755 index 0000000..f1f3c27 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/div/div11/div11.css @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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. + */ +.text { + width: 280px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/div/div11/div11.hml b/examples/showcase/src/main/js/default/pages/component/div/div11/div11.hml new file mode 100755 index 0000000..18d3b3b --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/div/div11/div11.hml @@ -0,0 +1,33 @@ + + +
+ + + + + + +
+ + 观察if属性作用 + +
+ + + + {{text1}} + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/div/div11/div11.js b/examples/showcase/src/main/js/default/pages/component/div/div11/div11.js new file mode 100755 index 0000000..0bf1e19 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/div/div11/div11.js @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2020 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 {backPage} from "../../../../common/js/general"; +export default { + ...backPage("pages/component/div/indexAttr/index"), + data: { + text1: "点击按钮改变状态", + status: true + }, + changeStatus: function () { + if (this.status == true) { + this.status = false; + } else { + this.status = true; + } + } +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/div/div12/div12.css b/examples/showcase/src/main/js/default/pages/component/div/div12/div12.css new file mode 100755 index 0000000..90290c3 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/div/div12/div12.css @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2020 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. + */ +.text { + width: 130px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} + +.image { + width: 130px; + height: 50px; +} + diff --git a/examples/showcase/src/main/js/default/pages/component/div/div12/div12.hml b/examples/showcase/src/main/js/default/pages/component/div/div12/div12.hml new file mode 100755 index 0000000..df43897 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/div/div12/div12.hml @@ -0,0 +1,32 @@ + + +
+ + + + + + +
+ + loop + + +
+ + 循环3次,点击改变display + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/div/div12/div12.js b/examples/showcase/src/main/js/default/pages/component/div/div12/div12.js new file mode 100755 index 0000000..154d422 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/div/div12/div12.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2020 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 {backPage} from "../../../../common/js/general"; +export default { + ...backPage("pages/component/div/indexAttr/index"), + data: { + text1: "点击按钮改变状态", + loopArray: ["1", "2", "3"], + display: "flex" + }, + changeDisplay: function () { + if (this.display === "flex") { + this.display = "none"; + } else { + this.display = "flex"; + } + } +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/div/div2/div2.css b/examples/showcase/src/main/js/default/pages/component/div/div2/div2.css new file mode 100755 index 0000000..f07e5b9 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/div/div2/div2.css @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2020 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. + */ +.stack { + left: 0px; + top: 0px; + width: 454px; + height: 454px; +} + +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/div/div2/div2.hml b/examples/showcase/src/main/js/default/pages/component/div/div2/div2.hml new file mode 100755 index 0000000..c16ffdd --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/div/div2/div2.hml @@ -0,0 +1,37 @@ + + + + + + + + + +
+ + div已设置对应样式 + +
+ + {{text1}} + + + {{text2}} + + + {{text3}} + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/div/div2/div2.js b/examples/showcase/src/main/js/default/pages/component/div/div2/div2.js new file mode 100755 index 0000000..3bdedd2 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/div/div2/div2.js @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2020 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 {backPage} from "../../../../common/js/general"; +export default { + ...backPage("pages/component/div/indexCommonStyle/index"), + data: { + text1: "背景色绿色", + text2: "left设置85", + text3: "top设置170" + }, + clickFunc: function () { + this.text1 = "点击事件已触发"; + }, + longpressFunc: function () { + this.text2 = "长按事件已触发"; + } +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/div/div3/div3.css b/examples/showcase/src/main/js/default/pages/component/div/div3/div3.css new file mode 100755 index 0000000..0e8a333 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/div/div3/div3.css @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2020 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. + */ +.text { + width: 280px; + height: 50px; + font-size: 30px; +} + +.item { + width: 280px; + height: 50px; +} + +.div1 { + height: 145px; + width: 160px; + border-width: 1px; + border-color: #ff0000; +} + +.div2 { + width: 100px; + height: 50px; + background-color: #00ff00; +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/div/div3/div3.hml b/examples/showcase/src/main/js/default/pages/component/div/div3/div3.hml new file mode 100755 index 0000000..6784135 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/div/div3/div3.hml @@ -0,0 +1,66 @@ + + +
+ + + + + + +
+
+
+ + div1 + +
+
+
+
+ + div2 + +
+
+
+ + + + 宽100px;高50px + + + + + div1左边距100px + + + + + div1上边距20px + + + + + div2右边距20px + + + + + div2下边距20px + + + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/div/div3/div3.js b/examples/showcase/src/main/js/default/pages/component/div/div3/div3.js new file mode 100755 index 0000000..67da9f1 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/div/div3/div3.js @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2020 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. + */ +// div3.js +import { backPage } from "../../../../common/js/general"; +export default { + ...backPage("pages/component/div/indexCommonStyle/index") +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/div/div4/div4.css b/examples/showcase/src/main/js/default/pages/component/div/div4/div4.css new file mode 100755 index 0000000..d1559a9 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/div/div4/div4.css @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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. + */ +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/div/div4/div4.hml b/examples/showcase/src/main/js/default/pages/component/div/div4/div4.hml new file mode 100755 index 0000000..5b3ef40 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/div/div4/div4.hml @@ -0,0 +1,30 @@ + + +
+ + + + + + +
+
+
+ + 内边距和边框 + +
+
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/div/div4/div4.js b/examples/showcase/src/main/js/default/pages/component/div/div4/div4.js new file mode 100755 index 0000000..4a9ad8b --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/div/div4/div4.js @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2020 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. + */ +// div4.js +import { backPage } from "../../../../common/js/general"; +export default { + ...backPage("pages/component/div/indexCommonStyle/index") +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/div/div5/div5.css b/examples/showcase/src/main/js/default/pages/component/div/div5/div5.css new file mode 100755 index 0000000..06a7a5d --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/div/div5/div5.css @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2020 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. + */ diff --git a/examples/showcase/src/main/js/default/pages/component/div/div5/div5.hml b/examples/showcase/src/main/js/default/pages/component/div/div5/div5.hml new file mode 100755 index 0000000..2fcc411 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/div/div5/div5.hml @@ -0,0 +1,31 @@ + + +
+ + + + + + +
+
+
+
+
+
+
+
+
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/div/div5/div5.js b/examples/showcase/src/main/js/default/pages/component/div/div5/div5.js new file mode 100755 index 0000000..ad9ba8d --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/div/div5/div5.js @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2020 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. + */ +// div5.js +import { backPage } from "../../../../common/js/general"; +export default { + ...backPage("pages/component/div/indexSpecStyle/index") +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/div/div6/div6.css b/examples/showcase/src/main/js/default/pages/component/div/div6/div6.css new file mode 100755 index 0000000..06a7a5d --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/div/div6/div6.css @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2020 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. + */ diff --git a/examples/showcase/src/main/js/default/pages/component/div/div6/div6.hml b/examples/showcase/src/main/js/default/pages/component/div/div6/div6.hml new file mode 100755 index 0000000..c0e7f50 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/div/div6/div6.hml @@ -0,0 +1,31 @@ + + +
+ + + + + + +
+
+
+
+
+
+
+
+
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/div/div6/div6.js b/examples/showcase/src/main/js/default/pages/component/div/div6/div6.js new file mode 100755 index 0000000..94d03b3 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/div/div6/div6.js @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2020 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. + */ +// div6.js +import { backPage } from "../../../../common/js/general"; +export default { + ...backPage("pages/component/div/indexSpecStyle/index") +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/div/div7/div7.css b/examples/showcase/src/main/js/default/pages/component/div/div7/div7.css new file mode 100755 index 0000000..06a7a5d --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/div/div7/div7.css @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2020 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. + */ diff --git a/examples/showcase/src/main/js/default/pages/component/div/div7/div7.hml b/examples/showcase/src/main/js/default/pages/component/div/div7/div7.hml new file mode 100755 index 0000000..e447b40 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/div/div7/div7.hml @@ -0,0 +1,39 @@ + + +
+ + + + + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/div/div7/div7.js b/examples/showcase/src/main/js/default/pages/component/div/div7/div7.js new file mode 100755 index 0000000..77dfffb --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/div/div7/div7.js @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2020 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. + */ +// div7.js +import { backPage } from "../../../../common/js/general"; +export default { + ...backPage("pages/component/div/indexSpecStyle/index") +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/div/div8/div8.css b/examples/showcase/src/main/js/default/pages/component/div/div8/div8.css new file mode 100755 index 0000000..06a7a5d --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/div/div8/div8.css @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2020 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. + */ diff --git a/examples/showcase/src/main/js/default/pages/component/div/div8/div8.hml b/examples/showcase/src/main/js/default/pages/component/div/div8/div8.hml new file mode 100755 index 0000000..7dfa8fd --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/div/div8/div8.hml @@ -0,0 +1,31 @@ + + +
+ + + + + + +
+
+
+
+
+
+
+
+
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/div/div8/div8.js b/examples/showcase/src/main/js/default/pages/component/div/div8/div8.js new file mode 100755 index 0000000..ca6c314 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/div/div8/div8.js @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2020 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. + */ +// div8.js +import { backPage } from "../../../../common/js/general"; +export default { + ...backPage("pages/component/div/indexSpecStyle/index") +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/div/div9/div9.css b/examples/showcase/src/main/js/default/pages/component/div/div9/div9.css new file mode 100755 index 0000000..06a7a5d --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/div/div9/div9.css @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2020 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. + */ diff --git a/examples/showcase/src/main/js/default/pages/component/div/div9/div9.hml b/examples/showcase/src/main/js/default/pages/component/div/div9/div9.hml new file mode 100755 index 0000000..42521b0 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/div/div9/div9.hml @@ -0,0 +1,39 @@ + + +
+ + + + + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/div/div9/div9.js b/examples/showcase/src/main/js/default/pages/component/div/div9/div9.js new file mode 100755 index 0000000..567bab6 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/div/div9/div9.js @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2020 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. + */ +// div9.js +import { backPage } from "../../../../common/js/general"; +export default { + ...backPage("pages/component/div/indexSpecStyle/index") +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/div/index/index.css b/examples/showcase/src/main/js/default/pages/component/div/index/index.css new file mode 100755 index 0000000..1e0d265 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/div/index/index.css @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2020 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. + */ +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.titleContainerStyle { + width: 454px; + height: 70px; +} + +.titleTextStyle { + width: 454px; + height: 50px; + margin-left: 200px; + margin-top: 0px; +} + +.buttonContainerStyle { + width: 454px; + height: 80px; +} + +.buttonStyle { + width: 200px; + height: 60px; + margin-left: 130px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/div/index/index.hml b/examples/showcase/src/main/js/default/pages/component/div/index/index.hml new file mode 100755 index 0000000..a64e0eb --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/div/index/index.hml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + div + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/div/index/index.js b/examples/showcase/src/main/js/default/pages/component/div/index/index.js new file mode 100755 index 0000000..3acaa4d --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/div/index/index.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../common/js/general"; +export default { + ...backPage("pages/component/index/containerIndex/index"), + changePage1: routePage("pages/component/div/indexAttr/index").changePage, + changePage2: routePage("pages/component/div/indexCommonStyle/index").changePage, + changePage3: routePage("pages/component/div/indexSpecStyle/index").changePage, + changePage4: routePage("pages/component/div/indexEvent/index").changePage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/div/indexAttr/index.css b/examples/showcase/src/main/js/default/pages/component/div/indexAttr/index.css new file mode 100755 index 0000000..60569ee --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/div/indexAttr/index.css @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2020 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. + */ +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.titleContainerStyle { + width: 454px; + height: 70px; +} + +.titleTextStyle { + width: 454px; + height: 50px; + margin-left: 170px; + margin-top: 0px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/div/indexAttr/index.hml b/examples/showcase/src/main/js/default/pages/component/div/indexAttr/index.hml new file mode 100755 index 0000000..6fb269b --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/div/indexAttr/index.hml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + 通用属性 + + + + + + + + if + + + + + + + + + + + show + + + + + + + + + + + for + + + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/div/indexAttr/index.js b/examples/showcase/src/main/js/default/pages/component/div/indexAttr/index.js new file mode 100755 index 0000000..7df46f8 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/div/indexAttr/index.js @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../common/js/general"; +export default { + ...backPage("pages/component/div/index/index"), + changePage1: routePage("pages/component/div/div11/div11").changePage, + changePage2: routePage("pages/component/div/div10/div10").changePage, + changePage3: routePage("pages/component/div/div12/div12").changePage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/div/indexCommonStyle/index.css b/examples/showcase/src/main/js/default/pages/component/div/indexCommonStyle/index.css new file mode 100755 index 0000000..60569ee --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/div/indexCommonStyle/index.css @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2020 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. + */ +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.titleContainerStyle { + width: 454px; + height: 70px; +} + +.titleTextStyle { + width: 454px; + height: 50px; + margin-left: 170px; + margin-top: 0px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/div/indexCommonStyle/index.hml b/examples/showcase/src/main/js/default/pages/component/div/indexCommonStyle/index.hml new file mode 100755 index 0000000..c016c71 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/div/indexCommonStyle/index.hml @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + 通用样式 + + + + + + + + 背景色 + + + left + + + top + + + + + + + + + + + margin + + + height + + + width + + + + + + + + + + + border + + + padding + + + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/div/indexCommonStyle/index.js b/examples/showcase/src/main/js/default/pages/component/div/indexCommonStyle/index.js new file mode 100755 index 0000000..934e067 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/div/indexCommonStyle/index.js @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../common/js/general"; +export default { + ...backPage("pages/component/div/index/index"), + changePage1: routePage("pages/component/div/div2/div2").changePage, + changePage2: routePage("pages/component/div/div3/div3").changePage, + changePage3: routePage("pages/component/div/div4/div4").changePage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/div/indexEvent/index.css b/examples/showcase/src/main/js/default/pages/component/div/indexEvent/index.css new file mode 100755 index 0000000..60569ee --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/div/indexEvent/index.css @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2020 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. + */ +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.titleContainerStyle { + width: 454px; + height: 70px; +} + +.titleTextStyle { + width: 454px; + height: 50px; + margin-left: 170px; + margin-top: 0px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/div/indexEvent/index.hml b/examples/showcase/src/main/js/default/pages/component/div/indexEvent/index.hml new file mode 100755 index 0000000..772bd6a --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/div/indexEvent/index.hml @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + 通用事件 + + + + + + + + click + + + longpress + + + swipe + + + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/div/indexEvent/index.js b/examples/showcase/src/main/js/default/pages/component/div/indexEvent/index.js new file mode 100755 index 0000000..f883e8c --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/div/indexEvent/index.js @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../common/js/general"; +export default { + ...backPage("pages/component/div/index/index"), + changePage1: routePage("pages/component/div/div1/div1").changePage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/div/indexSpecStyle/index.css b/examples/showcase/src/main/js/default/pages/component/div/indexSpecStyle/index.css new file mode 100755 index 0000000..60569ee --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/div/indexSpecStyle/index.css @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2020 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. + */ +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.titleContainerStyle { + width: 454px; + height: 70px; +} + +.titleTextStyle { + width: 454px; + height: 50px; + margin-left: 170px; + margin-top: 0px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/div/indexSpecStyle/index.hml b/examples/showcase/src/main/js/default/pages/component/div/indexSpecStyle/index.hml new file mode 100755 index 0000000..82435d0 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/div/indexSpecStyle/index.hml @@ -0,0 +1,106 @@ + + + + + + + + + + + + + + + + + 特有样式 + + + + + + + + justify-content:flex-end; + + + align-items:center + + + + + + + + + + + flex-direction:column; + + + justify-content:space-between + + + + + + + + + + + flex-wrap:wrap; + + + justify-content:center + + + + + + + + + + + flex-direction:column; + + + align-items:flex-end + + + + + + + + + + + flex-wrap:wrap; + + + justify-content:space-around + + + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/div/indexSpecStyle/index.js b/examples/showcase/src/main/js/default/pages/component/div/indexSpecStyle/index.js new file mode 100755 index 0000000..9e9f0d1 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/div/indexSpecStyle/index.js @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../common/js/general"; +export default { + ...backPage("pages/component/div/index/index"), + changePage1: routePage("pages/component/div/div5/div5").changePage, + changePage2: routePage("pages/component/div/div6/div6").changePage, + changePage3: routePage("pages/component/div/div7/div7").changePage, + changePage4: routePage("pages/component/div/div8/div8").changePage, + changePage5: routePage("pages/component/div/div9/div9").changePage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/image/image1/image1.css b/examples/showcase/src/main/js/default/pages/component/image/image1/image1.css new file mode 100755 index 0000000..06a7a5d --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/image/image1/image1.css @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2020 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. + */ diff --git a/examples/showcase/src/main/js/default/pages/component/image/image1/image1.hml b/examples/showcase/src/main/js/default/pages/component/image/image1/image1.hml new file mode 100755 index 0000000..fe95f44 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/image/image1/image1.hml @@ -0,0 +1,27 @@ + + +
+ + + + + + + + + src设置图片显示 + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/image/image1/image1.js b/examples/showcase/src/main/js/default/pages/component/image/image1/image1.js new file mode 100755 index 0000000..db12706 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/image/image1/image1.js @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2020 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 {backPage} from "../../../../common/js/general"; +export default { + ...backPage("pages/component/image/indexAttr/index") +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/image/image2/image2.css b/examples/showcase/src/main/js/default/pages/component/image/image2/image2.css new file mode 100755 index 0000000..d1559a9 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/image/image2/image2.css @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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. + */ +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/image/image2/image2.hml b/examples/showcase/src/main/js/default/pages/component/image/image2/image2.hml new file mode 100755 index 0000000..3843609 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/image/image2/image2.hml @@ -0,0 +1,34 @@ + + +
+ + + + + + + + + + {{text1}} + + + {{text2}} + + + {{text3}} + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/image/image2/image2.js b/examples/showcase/src/main/js/default/pages/component/image/image2/image2.js new file mode 100755 index 0000000..039d9a5 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/image/image2/image2.js @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2020 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 {backPage, eventCommon} from "../../../../common/js/general"; +export default { + ...backPage("pages/component/image/indexEvent/index"), + clickFunc: eventCommon().clickFunc, + longpressFunc: eventCommon().longpressFunc, + swipeFunc: eventCommon().swipeFunc, + data: { + text3: eventCommon().text3, + text2: eventCommon().text2, + text1: eventCommon().text1 + } +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/image/image3/image3.css b/examples/showcase/src/main/js/default/pages/component/image/image3/image3.css new file mode 100755 index 0000000..26bc101 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/image/image3/image3.css @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2020 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. + */ +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} + +.stack { + left: 0px; + top: 0px; + width: 454px; + height: 454px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/image/image3/image3.hml b/examples/showcase/src/main/js/default/pages/component/image/image3/image3.hml new file mode 100755 index 0000000..f4c6212 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/image/image3/image3.hml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + {{text1}} + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/image/image3/image3.js b/examples/showcase/src/main/js/default/pages/component/image/image3/image3.js new file mode 100755 index 0000000..e635a13 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/image/image3/image3.js @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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 {backPage} from "../../../../common/js/general"; +export default { + ...backPage("pages/component/image/indexStyle/index"), + data: { + text1: "距离背景已设置" + } +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/image/image4/image4.css b/examples/showcase/src/main/js/default/pages/component/image/image4/image4.css new file mode 100755 index 0000000..a72cf8a --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/image/image4/image4.css @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2020 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. + */ +.text { + width: 280px; + height: 50px; + font-size: 30px; +} + +.item { + width: 280px; + height: 50px; +} + +.div1 { + height: 145px; + width: 160px; + border-width: 1px; + border-color: #ff0000; +} + +.image { + width: 100px; + height: 50px; + background-color: #00ff00; +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/image/image4/image4.hml b/examples/showcase/src/main/js/default/pages/component/image/image4/image4.hml new file mode 100755 index 0000000..5b0f133 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/image/image4/image4.hml @@ -0,0 +1,60 @@ + + +
+ + + + + + +
+
+ + +
+
+ + +
+
+ + + + 宽100px;高50px + + + + + 左图左边距100px + + + + + 左图上边距20px + + + + + 右图右边距20px + + + + + 右图下边距20px + + + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/image/image4/image4.js b/examples/showcase/src/main/js/default/pages/component/image/image4/image4.js new file mode 100755 index 0000000..17272dd --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/image/image4/image4.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2020 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 {backPage} from "../../../../common/js/general"; +export default { + ...backPage("pages/component/image/indexStyle/index"), + data: { + text1: "margin已设置", + text2: "宽高已设置" + } +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/image/image5/image5.css b/examples/showcase/src/main/js/default/pages/component/image/image5/image5.css new file mode 100755 index 0000000..d1559a9 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/image/image5/image5.css @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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. + */ +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/image/image5/image5.hml b/examples/showcase/src/main/js/default/pages/component/image/image5/image5.hml new file mode 100755 index 0000000..d78737f --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/image/image5/image5.hml @@ -0,0 +1,28 @@ + + +
+ + + + + + + + + + 内边距和边框 + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/image/image5/image5.js b/examples/showcase/src/main/js/default/pages/component/image/image5/image5.js new file mode 100755 index 0000000..168e427 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/image/image5/image5.js @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2020 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 {backPage} from "../../../../common/js/general"; +export default { + ...backPage("pages/component/image/indexStyle/index") +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/image/image6/image6.css b/examples/showcase/src/main/js/default/pages/component/image/image6/image6.css new file mode 100755 index 0000000..f1f3c27 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/image/image6/image6.css @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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. + */ +.text { + width: 280px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/image/image6/image6.hml b/examples/showcase/src/main/js/default/pages/component/image/image6/image6.hml new file mode 100755 index 0000000..345cdff --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/image/image6/image6.hml @@ -0,0 +1,30 @@ + + +
+ + + + + + + + + + + + {{text1}} + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/image/image6/image6.js b/examples/showcase/src/main/js/default/pages/component/image/image6/image6.js new file mode 100755 index 0000000..f71f833 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/image/image6/image6.js @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2020 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 {backPage} from "../../../../common/js/general"; +import {changeStatus} from "../../../../common/js/image"; +export default { + data: { + text1: "点击按钮改变状态", + status: true, + div01: "div01" + }, + ...backPage("pages/component/image/indexAttr/index"), + changeStatus: changeStatus +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/image/image7/image7.css b/examples/showcase/src/main/js/default/pages/component/image/image7/image7.css new file mode 100755 index 0000000..f1f3c27 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/image/image7/image7.css @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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. + */ +.text { + width: 280px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/image/image7/image7.hml b/examples/showcase/src/main/js/default/pages/component/image/image7/image7.hml new file mode 100755 index 0000000..5e11331 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/image/image7/image7.hml @@ -0,0 +1,28 @@ + + +
+ + + + + + + + + + 循环3次,点击改变display + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/image/image7/image7.js b/examples/showcase/src/main/js/default/pages/component/image/image7/image7.js new file mode 100755 index 0000000..d2d3235 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/image/image7/image7.js @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2020 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 {backPage} from "../../../../common/js/general"; +export default { + ...backPage("pages/component/image/indexAttr/index"), + changeDisplay: function () { + if (this.display === "flex") { + this.display = "none"; + } else { + this.display = "flex"; + } + }, + data: { + loopArray: ["1", "2", "3"], + display: "flex" + } +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/image/image8/image8.css b/examples/showcase/src/main/js/default/pages/component/image/image8/image8.css new file mode 100755 index 0000000..f1f3c27 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/image/image8/image8.css @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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. + */ +.text { + width: 280px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/image/image8/image8.hml b/examples/showcase/src/main/js/default/pages/component/image/image8/image8.hml new file mode 100755 index 0000000..85071a2 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/image/image8/image8.hml @@ -0,0 +1,30 @@ + + +
+ + + + + + + + + + + + {{text1}} + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/image/image8/image8.js b/examples/showcase/src/main/js/default/pages/component/image/image8/image8.js new file mode 100755 index 0000000..7a2b17a --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/image/image8/image8.js @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2020 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 {backPage} from "../../../../common/js/general"; +import {changeStatus} from "../../../../common/js/image"; +export default { + ...backPage("pages/component/image/indexAttr/index"), + changeStatus: changeStatus, + data: { + text1: "点击按钮改变状态", + status: true + } +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/image/index/index.css b/examples/showcase/src/main/js/default/pages/component/image/index/index.css new file mode 100755 index 0000000..7338de9 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/image/index/index.css @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2020 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. + */ +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.titleContainerStyle { + width: 454px; + height: 70px; +} + +.titleTextStyle { + width: 454px; + height: 50px; + margin-left: 175px; + margin-top: 0px; +} + +.buttonContainerStyle { + width: 454px; + height: 80px; +} + +.buttonStyle { + width: 200px; + height: 60px; + margin-left: 130px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/image/index/index.hml b/examples/showcase/src/main/js/default/pages/component/image/index/index.hml new file mode 100755 index 0000000..88917e6 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/image/index/index.hml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + image + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/image/index/index.js b/examples/showcase/src/main/js/default/pages/component/image/index/index.js new file mode 100755 index 0000000..90b57da --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/image/index/index.js @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../common/js/general"; +export default { + ...backPage("pages/component/index/baseIndex/index"), + changePage1: routePage("pages/component/image/indexAttr/index").changePage, + changePage2: routePage("pages/component/image/indexStyle/index").changePage, + changePage3: routePage("pages/component/image/indexEvent/index").changePage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/image/indexAttr/index.css b/examples/showcase/src/main/js/default/pages/component/image/indexAttr/index.css new file mode 100755 index 0000000..60569ee --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/image/indexAttr/index.css @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2020 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. + */ +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.titleContainerStyle { + width: 454px; + height: 70px; +} + +.titleTextStyle { + width: 454px; + height: 50px; + margin-left: 170px; + margin-top: 0px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/image/indexAttr/index.hml b/examples/showcase/src/main/js/default/pages/component/image/indexAttr/index.hml new file mode 100755 index 0000000..bf9e1fa --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/image/indexAttr/index.hml @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + 通用属性 + + + + + + + + show + + + + + + + + + for + + + + + + + + + if + + + + + + + + + + 特有属性 + + + + + + + + src + + + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/image/indexAttr/index.js b/examples/showcase/src/main/js/default/pages/component/image/indexAttr/index.js new file mode 100755 index 0000000..86b2c3e --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/image/indexAttr/index.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../common/js/general"; +export default { + ...backPage("pages/component/image/index/index"), + changePage1: routePage("pages/component/image/image6/image6").changePage, + changePage2: routePage("pages/component/image/image7/image7").changePage, + changePage3: routePage("pages/component/image/image8/image8").changePage, + changePage4: routePage("pages/component/image/image1/image1").changePage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/image/indexEvent/index.css b/examples/showcase/src/main/js/default/pages/component/image/indexEvent/index.css new file mode 100755 index 0000000..60569ee --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/image/indexEvent/index.css @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2020 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. + */ +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.titleContainerStyle { + width: 454px; + height: 70px; +} + +.titleTextStyle { + width: 454px; + height: 50px; + margin-left: 170px; + margin-top: 0px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/image/indexEvent/index.hml b/examples/showcase/src/main/js/default/pages/component/image/indexEvent/index.hml new file mode 100755 index 0000000..bf1a4cb --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/image/indexEvent/index.hml @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + 通用事件 + + + + + + + + click + + + longpress + + + swipe + + + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/image/indexEvent/index.js b/examples/showcase/src/main/js/default/pages/component/image/indexEvent/index.js new file mode 100755 index 0000000..b186105 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/image/indexEvent/index.js @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../common/js/general"; +export default { + ...backPage("pages/component/image/index/index"), + changePage1: routePage("pages/component/image/image2/image2").changePage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/image/indexStyle/index.css b/examples/showcase/src/main/js/default/pages/component/image/indexStyle/index.css new file mode 100755 index 0000000..60569ee --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/image/indexStyle/index.css @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2020 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. + */ +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.titleContainerStyle { + width: 454px; + height: 70px; +} + +.titleTextStyle { + width: 454px; + height: 50px; + margin-left: 170px; + margin-top: 0px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/image/indexStyle/index.hml b/examples/showcase/src/main/js/default/pages/component/image/indexStyle/index.hml new file mode 100755 index 0000000..ef0254e --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/image/indexStyle/index.hml @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + 通用样式 + + + + + + + + 背景色 + + + left + + + top + + + + + + + + + + + margin + + + height + + + width + + + + + + + + + + + border + + + padding + + + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/image/indexStyle/index.js b/examples/showcase/src/main/js/default/pages/component/image/indexStyle/index.js new file mode 100755 index 0000000..f3b75b0 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/image/indexStyle/index.js @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../common/js/general"; +export default { + ...backPage("pages/component/image/index/index"), + changePage1: routePage("pages/component/image/image3/image3").changePage, + changePage2: routePage("pages/component/image/image4/image4").changePage, + changePage3: routePage( "pages/component/image/image5/image5").changePage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/index/baseIndex/index.css b/examples/showcase/src/main/js/default/pages/component/index/baseIndex/index.css new file mode 100755 index 0000000..ed50bd4 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/index/baseIndex/index.css @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2020 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. + */ +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.titleContainerStyle { + width: 454px; + height: 70px; +} + +.titleTextStyle { + width: 454px; + height: 50px; + margin-left: 170px; + margin-top: 0px; +} + +.buttonContainerStyle { + width: 454px; + height: 80px; +} + +.buttonStyle { + width: 200px; + height: 60px; + margin-left: 130px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/index/baseIndex/index.hml b/examples/showcase/src/main/js/default/pages/component/index/baseIndex/index.hml new file mode 100755 index 0000000..0d1d7be --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/index/baseIndex/index.hml @@ -0,0 +1,61 @@ + + + + + + + + + + + + + 基础组件 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/index/baseIndex/index.js b/examples/showcase/src/main/js/default/pages/component/index/baseIndex/index.js new file mode 100755 index 0000000..1a53a4e --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/index/baseIndex/index.js @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../common/js/general"; +export default { + ...backPage("pages/index/index"), + changeImage: routePage("pages/component/image/index/index").changePage, + changeProgress: routePage("pages/component/progress/index/index").changePage, + changeText: routePage("pages/component/text/index/index").changePage, + changeMarquee: routePage("pages/component/marquee/index/index").changePage, + changeChart: routePage("pages/component/chart/index/index").changePage, + changeCanvas: routePage("pages/component/canvas/index/index").changePage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/index/containerIndex/index.css b/examples/showcase/src/main/js/default/pages/component/index/containerIndex/index.css new file mode 100755 index 0000000..ed50bd4 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/index/containerIndex/index.css @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2020 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. + */ +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.titleContainerStyle { + width: 454px; + height: 70px; +} + +.titleTextStyle { + width: 454px; + height: 50px; + margin-left: 170px; + margin-top: 0px; +} + +.buttonContainerStyle { + width: 454px; + height: 80px; +} + +.buttonStyle { + width: 200px; + height: 60px; + margin-left: 130px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/index/containerIndex/index.hml b/examples/showcase/src/main/js/default/pages/component/index/containerIndex/index.hml new file mode 100755 index 0000000..dcbb097 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/index/containerIndex/index.hml @@ -0,0 +1,51 @@ + + + + + + + + + + + + + 容器组件 + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/index/containerIndex/index.js b/examples/showcase/src/main/js/default/pages/component/index/containerIndex/index.js new file mode 100755 index 0000000..a642ca3 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/index/containerIndex/index.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../common/js/general"; +export default { + ...backPage("pages/index/index"), + changeDiv: routePage("pages/component/div/index/index").changePage, + changeList: routePage("pages/component/list/index/index").changePage, + changeStack: routePage("pages/component/stack/index/index").changePage, + changeSwiper: routePage("pages/component/swiper/index/index").changePage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/index/formIndex/index.css b/examples/showcase/src/main/js/default/pages/component/index/formIndex/index.css new file mode 100755 index 0000000..ed50bd4 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/index/formIndex/index.css @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2020 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. + */ +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.titleContainerStyle { + width: 454px; + height: 70px; +} + +.titleTextStyle { + width: 454px; + height: 50px; + margin-left: 170px; + margin-top: 0px; +} + +.buttonContainerStyle { + width: 454px; + height: 80px; +} + +.buttonStyle { + width: 200px; + height: 60px; + margin-left: 130px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/index/formIndex/index.hml b/examples/showcase/src/main/js/default/pages/component/index/formIndex/index.hml new file mode 100755 index 0000000..4a25244 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/index/formIndex/index.hml @@ -0,0 +1,51 @@ + + + + + + + + + + + + + 表单组件 + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/index/formIndex/index.js b/examples/showcase/src/main/js/default/pages/component/index/formIndex/index.js new file mode 100755 index 0000000..71645af --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/index/formIndex/index.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../common/js/general"; +export default { + ...backPage("pages/index/index"), + changeInput: routePage("pages/component/input/index/index").changePage, + changeSlider: routePage("pages/component/slider/index/index").changePage, + changeSwitch: routePage("pages/component/switch/index/index").changePage, + changePickerView: routePage("pages/component/picker_view/index/index").changePage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/index/otherIndex/index.css b/examples/showcase/src/main/js/default/pages/component/index/otherIndex/index.css new file mode 100755 index 0000000..1e0d265 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/index/otherIndex/index.css @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2020 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. + */ +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.titleContainerStyle { + width: 454px; + height: 70px; +} + +.titleTextStyle { + width: 454px; + height: 50px; + margin-left: 200px; + margin-top: 0px; +} + +.buttonContainerStyle { + width: 454px; + height: 80px; +} + +.buttonStyle { + width: 200px; + height: 60px; + margin-left: 130px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/index/otherIndex/index.hml b/examples/showcase/src/main/js/default/pages/component/index/otherIndex/index.hml new file mode 100755 index 0000000..7275af0 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/index/otherIndex/index.hml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + 其他 + + + + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/index/otherIndex/index.js b/examples/showcase/src/main/js/default/pages/component/index/otherIndex/index.js new file mode 100755 index 0000000..ebbe807 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/index/otherIndex/index.js @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../common/js/general"; +export default { + ...backPage("pages/index/index"), + changeAnimation: routePage("pages/component/animation/index/index").changePage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/input/button/attr/attr.css b/examples/showcase/src/main/js/default/pages/component/input/button/attr/attr.css new file mode 100755 index 0000000..afbab36 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/input/button/attr/attr.css @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2020 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. + */ +.button { + margin-left: 20px; + margin-top: 10px; + width: 200px; + height: 50px; +} + +.list { + left: 0px; + top: 0px; + width: 454px; + height: 454px; +} + +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} + +.item-title { + width: 454px; + height: 80px; +} + +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.item-types { + width: 454px; + height: 80px; +} + +.whole-text { + margin-top:10px; + margin-left:150px; + width:200px; + height:60px; + font-size:30px; + color: red; +} + +.item-two { + width: 450px; + height: 150px; +} + +.two-right-div { + width: 230px; + height: 150px; + top: 40px; + left: 0px; +} + +.two-left-div { + width: 220px; + height: 150px; + left: 0px; + top: 0px; + flex-direction: column; +} + +.two-div { + width: 450px; + height: 150px; + left: 0px; + top: 0px; +} + +.item-attribute { + width: 450px; + height: 100px; +} + +.attribute-div { + left: 0px; + top: 0px; + height: 100px; + width: 450px; + flex-direction: row; +} + +.attribute-button { + margin-left: 10px; + margin-top: 10px; + width: 150px; + height: 60px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/input/button/attr/attr.hml b/examples/showcase/src/main/js/default/pages/component/input/button/attr/attr.hml new file mode 100755 index 0000000..4bf0088 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/input/button/attr/attr.hml @@ -0,0 +1,81 @@ + + + + + + + + + + + + + 通用属性 + + + + +
+
+ show +
+
+ + +
+
+
+ + + +
+
+ if +
+
+ + +
+
+
+ + + +
+
+ for +
+
+ +
+
+
+ + + + 特有属性 + + + + +
+ value为show + +
+
+ + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/input/button/attr/attr.js b/examples/showcase/src/main/js/default/pages/component/input/button/attr/attr.js new file mode 100755 index 0000000..7d1b150 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/input/button/attr/attr.js @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2020 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 { goPage, routePage } from "../../../../../common/js/general"; +import { changeStatus, changeIf } from "../../../../../common/js/input"; +export default { + data: { + status: true, + ifStatus: true, + valueList: ["for1", "for2"] + }, + ...goPage("pages/component/input/button/index/index"), + changeStatus: changeStatus, + changeIf: changeIf +}; \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/input/button/event/event.css b/examples/showcase/src/main/js/default/pages/component/input/button/event/event.css new file mode 100755 index 0000000..32613f0 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/input/button/event/event.css @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2020 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. + */ +.button { + margin-left: 20px; + margin-top: 50px; + width: 200px; + height: 100px; +} + +.list { + left: 0px; + top: 0px; + width: 454px; + height: 454px; +} + +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} + +.item-title { + width: 454px; + height: 80px; +} + +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.item-types { + width: 454px; + height: 80px; +} + +.whole-text { + margin-top:10px; + margin-left:150px; + width:200px; + height:60px; + font-size:30px; + color: red; +} + +.item-two { + width: 450px; + height: 200px; +} + +.two-right-div { + width: 230px; + height: 200px; + top: 40px; + left: 0px; +} + +.two-left-div { + width: 220px; + height: 200px; + left: 0px; + top: 0px; + flex-direction: column; +} + +.two-div { + width: 450px; + height: 200px; + left: 0px; + top: 0px; +} + +.text2 { + width: 200px; + height: 100px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; + text-overflow: ellipsis; +} diff --git a/examples/showcase/src/main/js/default/pages/component/input/button/event/event.hml b/examples/showcase/src/main/js/default/pages/component/input/button/event/event.hml new file mode 100755 index 0000000..daf15c6 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/input/button/event/event.hml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + 通用事件 + + + + +
+
+ click + longpress + swipe +
+
+ + {{name}} +
+
+
+ + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/input/button/event/event.js b/examples/showcase/src/main/js/default/pages/component/input/button/event/event.js new file mode 100755 index 0000000..f1e8115 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/input/button/event/event.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2020 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 {goPage, routePage} from "../../../../../common/js/general"; +export default { + data: { + name: "点击触发" + }, + clickEvent() { + this.name = "点击事件触发"; + }, + longpressEvent() { + this.name = "长按事件触发"; + }, + swipeEvent(e) { + this.name = "swipe方向:" + e.direction; + }, + ...goPage("pages/component/input/button/index/index") +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/input/button/index/index.css b/examples/showcase/src/main/js/default/pages/component/input/button/index/index.css new file mode 100755 index 0000000..ed50bd4 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/input/button/index/index.css @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2020 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. + */ +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.titleContainerStyle { + width: 454px; + height: 70px; +} + +.titleTextStyle { + width: 454px; + height: 50px; + margin-left: 170px; + margin-top: 0px; +} + +.buttonContainerStyle { + width: 454px; + height: 80px; +} + +.buttonStyle { + width: 200px; + height: 60px; + margin-left: 130px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/input/button/index/index.hml b/examples/showcase/src/main/js/default/pages/component/input/button/index/index.hml new file mode 100755 index 0000000..c0b30fe --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/input/button/index/index.hml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + button + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/input/button/index/index.js b/examples/showcase/src/main/js/default/pages/component/input/button/index/index.js new file mode 100755 index 0000000..d16edff --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/input/button/index/index.js @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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 {backPage,routePage} from "../../../../../common/js/general"; +export default { + changePage1: routePage("pages/component/input/button/attr/attr").changePage, + changePage2: routePage("pages/component/input/button/style/style").changePage, + changePage3: routePage("pages/component/input/button/event/event").changePage, + ...backPage("pages/component/input/index/index") +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/input/button/style/style.css b/examples/showcase/src/main/js/default/pages/component/input/button/style/style.css new file mode 100755 index 0000000..b4f550d --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/input/button/style/style.css @@ -0,0 +1,162 @@ +/* + * Copyright (c) 2020 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. + */ +.list { + left: 0px; + top: 0px; + width: 454px; + height: 454px; +} + +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} + +.item-title { + width: 454px; + height: 80px; +} + +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.item-types { + width: 454px; + height: 80px; +} + +.whole-text { + margin-top:10px; + margin-left:150px; + width:200px; + height:60px; + font-size:30px; + color: red; +} + +.item-three { + width: 450px; + height: 200px; +} + +.three-div { + width: 450px; + height: 200px; + left: 0px; + top: 0px; +} + +.three-left-div { + width: 220px; + height: 200px; + left: 0px; + top: 0px; + flex-direction: column; +} + +.item-two { + width: 450px; + height: 150px; +} + +.two-left-div { + width: 220px; + height: 150px; + left: 0px; + top: 0px; + flex-direction: column; +} + +.two-div { + width: 450px; + height: 150px; + left: 0px; + top: 0px; +} + +.general-stack { + top: 50px; + left: 2px; + width: 200px; + height: 150px; + background-color: springgreen; +} + +.general-item { + top: 50px; + left: 50px; + width: 150px; + height: 50px; + background-color: red; +} + +.item-style { + width: 450px; + height: 250px; +} + +.style-div { + width: 450px; + height: 250px; + top: 0px; + left: 0px; +} + +.style-left-div { + width: 250px; + height: 250px; + left: 0px; + top: 0px; + flex-direction: column; +} + +.style-button { + width: 150px; + height: 50px; + font-size:38px; + color: red; + font-family: HYQiHei-65S; +} + + +.backColorBtn{ + width: 150px; + height:50px; + margin-left:100px; + margin-top: 10px; + background-color: aqua +} + +.backColorBtn:active{ +background-color: coral +} + +.backImgBtn{ + width: 150px; + height:50px; + margin-left:100px; + margin-top: 10px; + background-image: url(common/icon_small.png) +} + +.backImgBtn:active{ +background-image: url(common/icon.png) +} diff --git a/examples/showcase/src/main/js/default/pages/component/input/button/style/style.hml b/examples/showcase/src/main/js/default/pages/component/input/button/style/style.hml new file mode 100755 index 0000000..5dc7de8 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/input/button/style/style.hml @@ -0,0 +1,105 @@ + + + + + + + + + + + + + 通用样式 + + + + +
+
+ 背景 + left为50 + top为50 +
+ + + +
+
+ + + +
+
+ margin + height + width +
+
+ +
+
+
+ + + +
+
+ border + padding +
+ +
+
+ + + + 特有样式 + + + + +
+
+ color为red + font-size + font-family +
+ +
+
+ + + + 伪类支持 + + + + +
+ backgroundColor + +
+
+ + + +
+ backgroundImg + +
+
+
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/input/button/style/style.js b/examples/showcase/src/main/js/default/pages/component/input/button/style/style.js new file mode 100755 index 0000000..8796705 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/input/button/style/style.js @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2020 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 {goPage, routePage} from "../../../../../common/js/general"; +export default { + ...goPage("pages/component/input/index/index") +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/input/checkbox/attr/attr.css b/examples/showcase/src/main/js/default/pages/component/input/checkbox/attr/attr.css new file mode 100755 index 0000000..ae03a4e --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/input/checkbox/attr/attr.css @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2020 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. + */ +.checkbox { + margin-left: 10px; + margin-top: 30px; + height: 50px; + width: 50px; +} + +.list { + left: 0px; + top: 0px; + width: 454px; + height: 454px; +} + +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} + +.item-title { + width: 454px; + height: 80px; +} + +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.item-types { + width: 454px; + height: 80px; +} + +.whole-text { + margin-top:10px; + margin-left:150px; + width:200px; + height:60px; + font-size:30px; + color: red; +} + +.item-two { + width: 450px; + height: 150px; +} + +.two-right-div { + width: 230px; + height: 150px; + top: 40px; + left: 0px; +} + +.two-left-div { + width: 220px; + height: 150px; + left: 0px; + top: 0px; + flex-direction: column; +} + +.two-div { + width: 450px; + height: 150px; + left: 0px; + top: 0px; +} + +.item-attribute { + width: 450px; + height: 150px; +} + +.attribute-left-div { + width: 150px; + height: 150px; + margin-top: 20px; + margin-left: 20px; +} + +.attribute-right-div { + width: 300px; + height: 150px; + margin-top: 20px; + margin-left: 10px; + flex-direction: column; +} diff --git a/examples/showcase/src/main/js/default/pages/component/input/checkbox/attr/attr.hml b/examples/showcase/src/main/js/default/pages/component/input/checkbox/attr/attr.hml new file mode 100755 index 0000000..6f62fae --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/input/checkbox/attr/attr.hml @@ -0,0 +1,84 @@ + + + + + + + + + + + + + 通用属性 + + + + +
+
+ show +
+
+ + +
+
+
+ + + +
+
+ if +
+
+ + +
+
+
+ + + +
+
+ for +
+
+ +
+
+
+ + + + 特有属性 + + + + +
+ checked +
+
+ + 值为{{show}} +
+
+ + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/input/checkbox/attr/attr.js b/examples/showcase/src/main/js/default/pages/component/input/checkbox/attr/attr.js new file mode 100755 index 0000000..d7e99ba --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/input/checkbox/attr/attr.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2020 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 {goPage,routePage} from "../../../../../common/js/general"; +import { changeStatus, changeIf } from "../../../../../common/js/input"; +export default { + data: { + show: true, + status: true, + ifStatus:true, + listData:[true, false] + }, + ...goPage("pages/component/input/checkbox/index/index"), + changeEvent(e) { + this.checked = "change触发"; + }, + changeStatus(e) { + this.show = e.checked; + }, + changeShow: changeStatus, + changeIf: changeIf +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/input/checkbox/event/event.css b/examples/showcase/src/main/js/default/pages/component/input/checkbox/event/event.css new file mode 100755 index 0000000..9b89379 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/input/checkbox/event/event.css @@ -0,0 +1,137 @@ +/* + * Copyright (c) 2020 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. + */ +.checkbox { + margin-left: 10px; + margin-top: 30px; + height: 50px; + width: 50px; +} + +.list { + left: 0px; + top: 0px; + width: 454px; + height: 454px; +} + +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} + +.text2 { + width: 200px; + height: 100px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; + text-overflow: ellipsis; +} + +.item-title { + width: 454px; + height: 80px; +} + +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.item-types { + width: 454px; + height: 80px; +} + +.whole-text { + margin-top:10px; + margin-left:150px; + width:200px; + height:60px; + font-size:30px; + color: red; +} + +.item-two { + width: 450px; + height: 200px; +} + +.two-right-div { + width: 230px; + height: 200px; + top: 40px; + left: 0px; +} + +.two-left-div { + width: 220px; + height: 200px; + left: 0px; + top: 0px; + flex-direction: column; +} + +.two-div { + width: 450px; + height: 200px; + left: 0px; + top: 0px; +} + +.item-change { + width: 450px; + height: 200px; +} + +.change-div { + left: 0px; + width: 450px; + height: 200px; + top: 0px; +} + +.change-left-div { + left: 10px; + width: 200px; + height: 200px; + top: 20px; +} + +.change-right-div { + left: 10px; + top: 10px; + width: 250px; + height: 200px; + flex-direction: column; +} + +.change-checkbox { + margin-left: 10px; + margin-top: 10px; + width: 50px; + height: 50px; +} + +.right-div { + left: 0px; + top: 0px; + width: 200px; + height: 200px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/input/checkbox/event/event.hml b/examples/showcase/src/main/js/default/pages/component/input/checkbox/event/event.hml new file mode 100755 index 0000000..a9d33e4 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/input/checkbox/event/event.hml @@ -0,0 +1,63 @@ + + + + + + + + + + + + + 通用事件 + + + + +
+
+ click + longpress + swipe +
+
+ + {{name}} +
+
+
+ + + + 特有事件 + + + + +
+
+ change +
+
+ + {{checked}} +
+
+
+ + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/input/checkbox/event/event.js b/examples/showcase/src/main/js/default/pages/component/input/checkbox/event/event.js new file mode 100755 index 0000000..6f9e513 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/input/checkbox/event/event.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2020 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 {goPage, routePage} from "../../../../../common/js/general"; +export default { + data: { + name: "点击或长按", + checked: "触发change", + show: true + }, + clickEvent() { + this.name = "点击事件触发" + }, + longpressEvent() { + this.name = "长按事件触发"; + }, + swipeEvent(e) { + this.name = "swipe方向:" + e.direction; + }, + changeEvent(e) { + this.checked = "change触发"; + }, + ...goPage("pages/component/input/checkbox/index/index") +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/input/checkbox/index/index.css b/examples/showcase/src/main/js/default/pages/component/input/checkbox/index/index.css new file mode 100755 index 0000000..e71ae21 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/input/checkbox/index/index.css @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2020 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. + */ +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.titleContainerStyle { + width: 454px; + height: 70px; +} + +.titleTextStyle { + width: 454px; + height: 50px; + margin-left: 160px; + margin-top: 0px; +} + +.buttonContainerStyle { + width: 454px; + height: 80px; +} + +.buttonStyle { + width: 200px; + height: 60px; + margin-left: 130px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/input/checkbox/index/index.hml b/examples/showcase/src/main/js/default/pages/component/input/checkbox/index/index.hml new file mode 100755 index 0000000..16e3036 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/input/checkbox/index/index.hml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + checkbox + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/input/checkbox/index/index.js b/examples/showcase/src/main/js/default/pages/component/input/checkbox/index/index.js new file mode 100755 index 0000000..7903543 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/input/checkbox/index/index.js @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +export default { + ...backPage("pages/component/input/index/index"), + changePage1: routePage("pages/component/input/checkbox/attr/attr").changePage, + changePage2: routePage("pages/component/input/checkbox/style/style").changePage, + changePage3: routePage("pages/component/input/checkbox/event/event").changePage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/input/checkbox/style/style.css b/examples/showcase/src/main/js/default/pages/component/input/checkbox/style/style.css new file mode 100755 index 0000000..c1d0d0b --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/input/checkbox/style/style.css @@ -0,0 +1,123 @@ +/* + * Copyright (c) 2020 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. + */ +.list { + left: 0px; + top: 0px; + width: 454px; + height: 454px; +} + +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} + +.item-title { + width: 454px; + height: 80px; +} + +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.item-types { + width: 454px; + height: 80px; +} + +.whole-text { + margin-top:10px; + margin-left:150px; + width:200px; + height:60px; + font-size:30px; + color: red; +} + +.item-three { + width: 450px; + height: 200px; +} + +.three-div { + width: 450px; + height: 200px; + left: 0px; + top: 0px; +} + +.three-left-div { + width: 220px; + height: 200px; + left: 0px; + top: 0px; + flex-direction: column; +} + +.item-two { + width: 450px; + height: 150px; +} + +.two-left-div { + width: 220px; + height: 150px; + left: 0px; + top: 0px; + flex-direction: column; +} + +.two-div { + width: 450px; + height: 150px; + left: 0px; + top: 0px; +} + +.three-right-div { + width: 230px; + height: 190px; + top: 40px; + left: 0px; +} + +.general-stack { + left: 0px; + top: 0px; + width: 200px; + height: 150px; + background-color: springgreen; +} + +.general-item { + left: 50px; + top: 50px; + height: 50px; + width: 50px; + background-color: red; +} + +.right-div { + left: 0px; + top: 0px; + width: 150px; + height: 200px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/input/checkbox/style/style.hml b/examples/showcase/src/main/js/default/pages/component/input/checkbox/style/style.hml new file mode 100755 index 0000000..57f34db --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/input/checkbox/style/style.hml @@ -0,0 +1,71 @@ + + + + + + + + + + + + + 通用样式 + + + + +
+
+ 背景红色 + left为50 + top为50 +
+ + + +
+
+ + + +
+
+ margin + height + width +
+
+ +
+
+
+ + + +
+
+ border + padding +
+
+ +
+
+
+ + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/input/checkbox/style/style.js b/examples/showcase/src/main/js/default/pages/component/input/checkbox/style/style.js new file mode 100755 index 0000000..5a6cd87 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/input/checkbox/style/style.js @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2020 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 {goPage, routePage} from "../../../../../common/js/general"; +export default { + ...goPage("pages/component/input/checkbox/index/index") +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/input/index/index.css b/examples/showcase/src/main/js/default/pages/component/input/index/index.css new file mode 100755 index 0000000..16df86a --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/input/index/index.css @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2020 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. + */ +.list { + left: 0px; + top: 0px; + width: 454px; + height: 454px; +} + +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.item-title { + left: 0px; + top: 0px; + width: 400px; + height: 70px; +} + +.input-item { + width: 400px; + height: 100px; +} + +.input-button { + margin-left: 120px; + margin-top: 10px; + width: 200px; + height: 50px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/input/index/index.hml b/examples/showcase/src/main/js/default/pages/component/input/index/index.hml new file mode 100755 index 0000000..ea121a2 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/input/index/index.hml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/input/index/index.js b/examples/showcase/src/main/js/default/pages/component/input/index/index.js new file mode 100755 index 0000000..627fbb4 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/input/index/index.js @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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 {goPage, routePage} from "../../../../common/js/general"; +export default { + ...goPage("pages/component/index/formIndex/index"), + changeButton: routePage("pages/component/input/button/index/index").changePage, + changeCheckbox: routePage("pages/component/input/checkbox/index/index").changePage, + changeRadio:routePage("pages/component/input/radio/index/index").changePage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/input/radio/attr/attr.css b/examples/showcase/src/main/js/default/pages/component/input/radio/attr/attr.css new file mode 100755 index 0000000..08c2fa1 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/input/radio/attr/attr.css @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2020 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. + */ +.radio { + margin-left: 10px; + margin-top: 30px; + height: 50px; + width: 50px; +} + +.list { + left: 0px; + top: 0px; + width: 454px; + height: 454px; +} + +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size: 30px; +} + +.item-title { + width: 454px; + height: 80px; +} + +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.item-types { + width: 454px; + height: 80px; +} + +.whole-text { + margin-top: 10px; + margin-left: 150px; + width: 200px; + height: 60px; + font-size: 30px; + color: red; +} + +.item-two { + width: 450px; + height: 150px; +} + +.two-right-div { + width: 230px; + height: 150px; + top: 40px; + left: 0px; +} + +.two-left-div { + width: 220px; + height: 150px; + left: 0px; + top: 0px; + flex-direction: column; +} + +.two-div { + width: 450px; + height: 150px; + left: 0px; + top: 0px; +} + +.item-attribute { + width: 450px; + height: 150px; +} + +.attribute-left-div { + width: 150px; + height: 150px; + margin-top: 20px; + margin-left: 20px; +} + +.attribute-right-div { + width: 300px; + height: 150px; + margin-top: 20px; + margin-left: 10px; + flex-direction: column; +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/input/radio/attr/attr.hml b/examples/showcase/src/main/js/default/pages/component/input/radio/attr/attr.hml new file mode 100755 index 0000000..2f8771a --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/input/radio/attr/attr.hml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + 通用属性 + + + + +
+
+ show +
+
+ + +
+
+
+ + + + 特有属性 + + + + +
+ checked +
+
+ + 值为{{show}} +
+
+ + + +
+ name +
+
+ + 值为{{name}} +
+
+ + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/input/radio/attr/attr.js b/examples/showcase/src/main/js/default/pages/component/input/radio/attr/attr.js new file mode 100755 index 0000000..67a93ed --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/input/radio/attr/attr.js @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2020 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 {goPage, routePage} from "../../../../../common/js/general"; +export default { + data:{ + show:"false", + name:"show", + status:true + }, + ...goPage("pages/component/input/radio/index/index"), + changeShow:function() { + this.status = !this.status; + }, + showName:function(e) { + this.name = e.name; + }, + changeChecked:function(e) { + if(e.checked) { + this.show = "true"; + } else { + this.show = "false"; + } + } +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/input/radio/event/event.css b/examples/showcase/src/main/js/default/pages/component/input/radio/event/event.css new file mode 100755 index 0000000..3dea631 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/input/radio/event/event.css @@ -0,0 +1,137 @@ +/* + * Copyright (c) 2020 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. + */ +.radio { + margin-left: 10px; + margin-top: 30px; + height: 50px; + width: 50px; +} + +.list { + left: 0px; + top: 0px; + width: 454px; + height: 454px; +} + +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size: 30px; +} + +.text2 { + width: 200px; + height: 100px; + margin-top: 10px; + margin-left: 10px; + font-size: 30px; + text-overflow: ellipsis; +} + +.item-title { + width: 454px; + height: 80px; +} + +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.item-types { + width: 454px; + height: 80px; +} + +.whole-text { + margin-top: 10px; + margin-left: 150px; + width: 200px; + height: 60px; + font-size: 30px; + color: red; +} + +.item-two { + width: 450px; + height: 200px; +} + +.two-right-div { + width: 230px; + height: 200px; + top: 40px; + left: 0px; +} + +.two-left-div { + width: 220px; + height: 200px; + left: 0px; + top: 0px; + flex-direction: column; +} + +.two-div { + width: 450px; + height: 200px; + left: 0px; + top: 0px; +} + +.item-change { + width: 450px; + height: 150px; +} + +.change-div { + left: 0px; + width: 450px; + height: 150px; + top: 0px; +} + +.change-left-div { + left: 10px; + width: 200px; + height: 150px; + top: 20px; +} + +.change-right-div { + left: 10px; + top: 10px; + width: 250px; + height: 150px; + flex-direction: column; +} + +.change-radio { + margin-left: 10px; + margin-top: 10px; + width: 50px; + height: 50px; +} + +.right-div { + left: 0px; + top: 0px; + width: 150px; + height: 200px; +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/input/radio/event/event.hml b/examples/showcase/src/main/js/default/pages/component/input/radio/event/event.hml new file mode 100755 index 0000000..f9d8cad --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/input/radio/event/event.hml @@ -0,0 +1,63 @@ + + + + + + + + + + + + + 通用事件 + + + + +
+
+ click + longpress + swipe +
+
+ + {{name}} +
+
+
+ + + + 特有事件 + + + + +
+
+ change +
+
+ + {{checked}} +
+
+
+ + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/input/radio/event/event.js b/examples/showcase/src/main/js/default/pages/component/input/radio/event/event.js new file mode 100755 index 0000000..188f3e2 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/input/radio/event/event.js @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2020 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 {goPage, routePage} from "../../../../../common/js/general"; +export default { + data: { + name: "点击或长按", + checked: "触发change", + show: true + }, + ...goPage("pages/component/input/radio/index/index"), + clickEvent() { + this.name = "点击事件触发" + }, + longpressEvent() { + this.name = "长按事件触发"; + }, + swipeEvent(e) { + this.name = "swipe方向:" + e.direction; + }, + changeEvent(e) { + this.checked = "change触发"; + } +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/input/radio/index/index.css b/examples/showcase/src/main/js/default/pages/component/input/radio/index/index.css new file mode 100755 index 0000000..86615c9 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/input/radio/index/index.css @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2020 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. + */ +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.titleContainerStyle { + width: 454px; + height: 70px; +} + +.titleTextStyle { + width: 454px; + height: 50px; + margin-left: 160px; + margin-top: 0px; +} + +.buttonContainerStyle { + width: 454px; + height: 80px; +} + +.buttonStyle { + width: 200px; + height: 60px; + margin-left: 130px; +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/input/radio/index/index.hml b/examples/showcase/src/main/js/default/pages/component/input/radio/index/index.hml new file mode 100755 index 0000000..3d3fb4e --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/input/radio/index/index.hml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + radio + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/input/radio/index/index.js b/examples/showcase/src/main/js/default/pages/component/input/radio/index/index.js new file mode 100755 index 0000000..5d8c7f1 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/input/radio/index/index.js @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +export default { + goAttrs: routePage("pages/component/input/radio/attr/attr").changePage, + goStyle: routePage("pages/component/input/radio/style/style").changePage, + goEvent: routePage("pages/component/input/radio/event/event").changePage, + ...backPage("pages/component/input/index/index") +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/input/radio/style/style.css b/examples/showcase/src/main/js/default/pages/component/input/radio/style/style.css new file mode 100755 index 0000000..c96f830 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/input/radio/style/style.css @@ -0,0 +1,123 @@ +/* + * Copyright (c) 2020 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. + */ +.list { + left: 0px; + top: 0px; + width: 454px; + height: 454px; +} + +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size: 30px; +} + +.item-title { + width: 454px; + height: 80px; +} + +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.item-types { + width: 454px; + height: 80px; +} + +.whole-text { + margin-top: 10px; + margin-left: 150px; + width: 200px; + height: 60px; + font-size: 30px; + color: red; +} + +.item-three { + width: 450px; + height: 200px; +} + +.three-div { + width: 450px; + height: 200px; + left: 0px; + top: 0px; +} + +.three-left-div { + width: 220px; + height: 200px; + left: 0px; + top: 0px; + flex-direction: column; +} + +.item-two { + width: 450px; + height: 150px; +} + +.two-left-div { + width: 220px; + height: 150px; + left: 0px; + top: 0px; + flex-direction: column; +} + +.two-div { + width: 450px; + height: 150px; + left: 0px; + top: 0px; +} + +.three-right-div { + width: 230px; + height: 190px; + top: 40px; + left: 0px; +} + +.general-stack { + left: 0px; + top: 0px; + width: 200px; + height: 150px; + background-color: springgreen; +} + +.general-item { + left: 50px; + top: 50px; + height: 50px; + width: 50px; + background-color: red; +} + +.right-div { + left: 0px; + top: 0px; + width: 150px; + height: 200px; +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/input/radio/style/style.hml b/examples/showcase/src/main/js/default/pages/component/input/radio/style/style.hml new file mode 100755 index 0000000..8b09356 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/input/radio/style/style.hml @@ -0,0 +1,71 @@ + + + + + + + + + + + + + 通用样式 + + + + +
+
+ 背景红色 + left为50 + top为50 +
+ + + +
+
+ + + +
+
+ margin + height + width +
+
+ +
+
+
+ + + +
+
+ border + padding +
+
+ +
+
+
+ + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/input/radio/style/style.js b/examples/showcase/src/main/js/default/pages/component/input/radio/style/style.js new file mode 100755 index 0000000..62c3a71 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/input/radio/style/style.js @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2020 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 {goPage, routePage} from "../../../../../common/js/general"; +export default { + ...goPage("pages/component/input/radio/index/index") +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/list/index/index.css b/examples/showcase/src/main/js/default/pages/component/list/index/index.css new file mode 100755 index 0000000..b57bf31 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/index/index.css @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2020 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. + */ +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} diff --git a/examples/showcase/src/main/js/default/pages/component/list/index/index.hml b/examples/showcase/src/main/js/default/pages/component/list/index/index.hml new file mode 100755 index 0000000..ca6f245 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/index/index.hml @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + list + + + + + + + + + + + list-item + + + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/list/index/index.js b/examples/showcase/src/main/js/default/pages/component/list/index/index.js new file mode 100755 index 0000000..c488eb7 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/index/index.js @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../common/js/general"; +export default { + ...backPage("pages/component/index/containerIndex/index"), + changePage1: routePage("pages/component/list/list/index/index").changePage, + changePage2: routePage("pages/component/list/list-item/index/index").changePage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/list/list-item/index/index.css b/examples/showcase/src/main/js/default/pages/component/list/list-item/index/index.css new file mode 100755 index 0000000..1e0d265 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list-item/index/index.css @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2020 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. + */ +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.titleContainerStyle { + width: 454px; + height: 70px; +} + +.titleTextStyle { + width: 454px; + height: 50px; + margin-left: 200px; + margin-top: 0px; +} + +.buttonContainerStyle { + width: 454px; + height: 80px; +} + +.buttonStyle { + width: 200px; + height: 60px; + margin-left: 130px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/list/list-item/index/index.hml b/examples/showcase/src/main/js/default/pages/component/list/list-item/index/index.hml new file mode 100755 index 0000000..ff9b52c --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list-item/index/index.hml @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + list-item + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/list/list-item/index/index.js b/examples/showcase/src/main/js/default/pages/component/list/list-item/index/index.js new file mode 100755 index 0000000..6e7e94e --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list-item/index/index.js @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +export default { + ...backPage("pages/component/list/index/index"), + changePage1: routePage("pages/component/list/list-item/indexAttr/index").changePage, + changePage2: routePage("pages/component/list/list-item/indexCommonStyle/index").changePage, + changePage4: routePage("pages/component/list/list-item/indexEvent/index").changePage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/list/list-item/indexAttr/index.css b/examples/showcase/src/main/js/default/pages/component/list/list-item/indexAttr/index.css new file mode 100755 index 0000000..ee147fd --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list-item/indexAttr/index.css @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2020 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. + */ +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.titleContainerStyle { + width: 454px; + height: 70px; +} + +.titleTextStyle { + width: 454px; + height: 50px; + margin-left: 80px; + margin-top: 0px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/list/list-item/indexAttr/index.hml b/examples/showcase/src/main/js/default/pages/component/list/list-item/indexAttr/index.hml new file mode 100755 index 0000000..232037f --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list-item/indexAttr/index.hml @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + list-item通用属性 + + + + + + + + show + + + + + + + + + if + + + + + + + + + for + + + + + + + diff --git a/examples/showcase/src/main/js/default/pages/component/list/list-item/indexAttr/index.js b/examples/showcase/src/main/js/default/pages/component/list/list-item/indexAttr/index.js new file mode 100755 index 0000000..2619959 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list-item/indexAttr/index.js @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +export default { + ...backPage("pages/component/list/list-item/index/index"), + changePage1: routePage("pages/component/list/list-item/item8/item8").changePage, + changePage2: routePage("pages/component/list/list-item/item9/item9").changePage, + changePage3: routePage("pages/component/list/list-item/item12/item12").changePage, +} diff --git a/examples/showcase/src/main/js/default/pages/component/list/list-item/indexCommonStyle/index.css b/examples/showcase/src/main/js/default/pages/component/list/list-item/indexCommonStyle/index.css new file mode 100755 index 0000000..70f1d32 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list-item/indexCommonStyle/index.css @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2020 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. + */ +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.titleContainerStyle { + width: 454px; + height: 70px; +} + +.titleTextStyle { + width: 454px; + height: 50px; + margin-left: 85px; + margin-top: 0px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/list/list-item/indexCommonStyle/index.hml b/examples/showcase/src/main/js/default/pages/component/list/list-item/indexCommonStyle/index.hml new file mode 100755 index 0000000..36e74ae --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list-item/indexCommonStyle/index.hml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + list-item通用样式 + + + + + + + + 背景色 + + + height + + + width + + + + + + + + + + + border + + + padding + + + + + + + + + + + display + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/list/list-item/indexCommonStyle/index.js b/examples/showcase/src/main/js/default/pages/component/list/list-item/indexCommonStyle/index.js new file mode 100755 index 0000000..e7d7805 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list-item/indexCommonStyle/index.js @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +export default { + ...backPage("pages/component/list/list-item/index/index"), + changePage1: routePage("pages/component/list/list-item/item3/item3").changePage, + changePage2: routePage("pages/component/list/list-item/item5/item5").changePage, + changePage3: routePage("pages/component/list/list-item/item11/item11").changePage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/list/list-item/indexEvent/index.css b/examples/showcase/src/main/js/default/pages/component/list/list-item/indexEvent/index.css new file mode 100755 index 0000000..70f1d32 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list-item/indexEvent/index.css @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2020 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. + */ +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.titleContainerStyle { + width: 454px; + height: 70px; +} + +.titleTextStyle { + width: 454px; + height: 50px; + margin-left: 85px; + margin-top: 0px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/list/list-item/indexEvent/index.hml b/examples/showcase/src/main/js/default/pages/component/list/list-item/indexEvent/index.hml new file mode 100755 index 0000000..24644c9 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list-item/indexEvent/index.hml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + list-item通用事件 + + + + + + + + click + + + longpress + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/list/list-item/indexEvent/index.js b/examples/showcase/src/main/js/default/pages/component/list/list-item/indexEvent/index.js new file mode 100755 index 0000000..f2201d7 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list-item/indexEvent/index.js @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +export default { + ...backPage("pages/component/list/list-item/index/index"), + changePage1: routePage("pages/component/list/list-item/item1/item1").changePage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/list/list-item/item1/item1.css b/examples/showcase/src/main/js/default/pages/component/list/list-item/item1/item1.css new file mode 100755 index 0000000..99437a6 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list-item/item1/item1.css @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2020 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. + */ +.stack { + left: 0px; + top: 0px; + width: 454px; + height: 454px; +} + +.text { + width: 400px; + height: 100px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; + text-overflow: ellipsis; +} diff --git a/examples/showcase/src/main/js/default/pages/component/list/list-item/item1/item1.hml b/examples/showcase/src/main/js/default/pages/component/list/list-item/item1/item1.hml new file mode 100755 index 0000000..4ec26a7 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list-item/item1/item1.hml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + {{text1}} + + + + + 矩形为list组件 + + + 蓝色区域为list-item + + + 点击或长按list-item内部任意位置 + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/list/list-item/item1/item1.js b/examples/showcase/src/main/js/default/pages/component/list/list-item/item1/item1.js new file mode 100755 index 0000000..e9f092e --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list-item/item1/item1.js @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +export default { + data: { + text1: "" + }, + ...backPage("pages/component/list/list-item/indexEvent/index"), + changePage1: routePage("pages/component/list/list-item/item1/item1").changePage, + clickFunc: function () { + this.text1 = "点击事件被触发"; + }, + longPressFunc: function () { + this.text1 = "长按事件被触发"; + } +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/list/list-item/item11/item11.css b/examples/showcase/src/main/js/default/pages/component/list/list-item/item11/item11.css new file mode 100755 index 0000000..3e1faaa --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list-item/item11/item11.css @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2020 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. + */ +.text { + width: 430px; + height: 100px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; + border-width: 1px; + border-color: red; + text-overflow: ellipsis; +} diff --git a/examples/showcase/src/main/js/default/pages/component/list/list-item/item11/item11.hml b/examples/showcase/src/main/js/default/pages/component/list/list-item/item11/item11.hml new file mode 100755 index 0000000..6960744 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list-item/item11/item11.hml @@ -0,0 +1,40 @@ + + +
+ + + + + + + + + + abcd + + + + + efgh + + + + + + + {{text1}} + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/list/list-item/item11/item11.js b/examples/showcase/src/main/js/default/pages/component/list/list-item/item11/item11.js new file mode 100755 index 0000000..4741481 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list-item/item11/item11.js @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +var displayData = ["flex", "none"]; +export default { + data: { + text1: "item-abcd设置display,点击按钮切换display", + status: true, + displayValue: displayData[0] + }, + changeDisplay: function () { + if (this.status == true) { + this.displayValue = displayData[1]; + this.status = false; + } else { + this.displayValue = displayData[0]; + this.status = true; + } + }, + ...backPage("pages/component/list/list-item/indexCommonStyle/index") +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/list/list-item/item12/item12.css b/examples/showcase/src/main/js/default/pages/component/list/list-item/item12/item12.css new file mode 100755 index 0000000..b21bf20 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list-item/item12/item12.css @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2020 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. + */ +.text { + width: 350px; + height: 100px; + margin-top: 10px; + margin-left: 10px; + text-overflow: ellipsis; + font-size:30px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/list/list-item/item12/item12.hml b/examples/showcase/src/main/js/default/pages/component/list/list-item/item12/item12.hml new file mode 100755 index 0000000..35bbd78 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list-item/item12/item12.hml @@ -0,0 +1,33 @@ + + +
+ + + + + + + + + + {{$idx}}--{{$item}} + + + + + {{text1}} + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/list/list-item/item12/item12.js b/examples/showcase/src/main/js/default/pages/component/list/list-item/item12/item12.js new file mode 100755 index 0000000..82e48b1 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list-item/item12/item12.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +export default { + data: { + listData:["a", "b", "c", "d"], + text1: "for类型list-item包含4个item" + }, + ...backPage("pages/component/list/list-item/indexAttr/index") +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/list/list-item/item3/item3.css b/examples/showcase/src/main/js/default/pages/component/list/list-item/item3/item3.css new file mode 100755 index 0000000..26bc101 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list-item/item3/item3.css @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2020 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. + */ +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} + +.stack { + left: 0px; + top: 0px; + width: 454px; + height: 454px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/list/list-item/item3/item3.hml b/examples/showcase/src/main/js/default/pages/component/list/list-item/item3/item3.hml new file mode 100755 index 0000000..26918bd --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list-item/item3/item3.hml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + {{text1}} + + + {{text2}} + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/list/list-item/item3/item3.js b/examples/showcase/src/main/js/default/pages/component/list/list-item/item3/item3.js new file mode 100755 index 0000000..68ee906 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list-item/item3/item3.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +export default { + data: { + text1: "上面list有3个item", + text2: "item背景和宽高已设置" + }, + ...backPage("pages/component/list/list-item/indexCommonStyle/index") +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/list/list-item/item5/item5.css b/examples/showcase/src/main/js/default/pages/component/list/list-item/item5/item5.css new file mode 100755 index 0000000..2f4a3cf --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list-item/item5/item5.css @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2020 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. + */ +.text { + width: 200px; + height: 100px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; + text-overflow: ellipsis; +} diff --git a/examples/showcase/src/main/js/default/pages/component/list/list-item/item5/item5.hml b/examples/showcase/src/main/js/default/pages/component/list/list-item/item5/item5.hml new file mode 100755 index 0000000..b24bb1d --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list-item/item5/item5.hml @@ -0,0 +1,38 @@ + + +
+ + + + + + + + + + abcd + + + + + efgh + + + + + {{text1}} + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/list/list-item/item5/item5.js b/examples/showcase/src/main/js/default/pages/component/list/list-item/item5/item5.js new file mode 100755 index 0000000..a176430 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list-item/item5/item5.js @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +export default { + data: { + text1: "list-item的border边框和padding内边距" + }, + ...backPage("pages/component/list/list-item/indexCommonStyle/index") +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/list/list-item/item8/item8.css b/examples/showcase/src/main/js/default/pages/component/list/list-item/item8/item8.css new file mode 100755 index 0000000..f1df549 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list-item/item8/item8.css @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2020 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. + */ +.text { + width: 280px; + height: 50px; + font-size:30px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/list/list-item/item8/item8.hml b/examples/showcase/src/main/js/default/pages/component/list/list-item/item8/item8.hml new file mode 100755 index 0000000..384a257 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list-item/item8/item8.hml @@ -0,0 +1,40 @@ + + +
+ + + + + + + + + + item-show + + + + + item-common + + + + + + + {{text1}} + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/list/list-item/item8/item8.js b/examples/showcase/src/main/js/default/pages/component/list/list-item/item8/item8.js new file mode 100755 index 0000000..1abd8a5 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list-item/item8/item8.js @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +import {changeStatus} from "../../../../../common/js/list" +export default { + data: { + text1: "点击按钮改变状态", + status: true + }, + ...backPage("pages/component/list/list-item/indexAttr/index"), + changeStatus: changeStatus +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/list/list-item/item9/item9.css b/examples/showcase/src/main/js/default/pages/component/list/list-item/item9/item9.css new file mode 100755 index 0000000..f1f3c27 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list-item/item9/item9.css @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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. + */ +.text { + width: 280px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/list/list-item/item9/item9.hml b/examples/showcase/src/main/js/default/pages/component/list/list-item/item9/item9.hml new file mode 100755 index 0000000..b65519e --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list-item/item9/item9.hml @@ -0,0 +1,40 @@ + + +
+ + + + + + + + + + item-if + + + + + item-common + + + + + + + {{text1}} + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/list/list-item/item9/item9.js b/examples/showcase/src/main/js/default/pages/component/list/list-item/item9/item9.js new file mode 100755 index 0000000..101d932 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list-item/item9/item9.js @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +import {changeStatus} from "../../../../../common/js/list" +export default { + data: { + text1: "点击按钮改变状态", + status: true + }, + changeStatus: changeStatus, + ...backPage("pages/component/list/list-item/indexAttr/index") +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/list/list/index/index.css b/examples/showcase/src/main/js/default/pages/component/list/list/index/index.css new file mode 100755 index 0000000..1e0d265 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list/index/index.css @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2020 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. + */ +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.titleContainerStyle { + width: 454px; + height: 70px; +} + +.titleTextStyle { + width: 454px; + height: 50px; + margin-left: 200px; + margin-top: 0px; +} + +.buttonContainerStyle { + width: 454px; + height: 80px; +} + +.buttonStyle { + width: 200px; + height: 60px; + margin-left: 130px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/list/list/index/index.hml b/examples/showcase/src/main/js/default/pages/component/list/list/index/index.hml new file mode 100755 index 0000000..050cafb --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list/index/index.hml @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + list + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/list/list/index/index.js b/examples/showcase/src/main/js/default/pages/component/list/list/index/index.js new file mode 100755 index 0000000..9f6e4e0 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list/index/index.js @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +export default { + ...backPage("pages/component/list/index/index"), + changePage1: routePage("pages/component/list/list/indexAttr/index").changePage, + changePage2: routePage("pages/component/list/list/indexCommonStyle/index").changePage, + changePage3: routePage("pages/component/list/list/indexSpecStyle/index").changePage, + changePage4: routePage("pages/component/list/list/indexEvent/index").changePage, + changePage5: routePage("pages/component/list/list/indexOperation/index").changePage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/list/list/indexAttr/index.css b/examples/showcase/src/main/js/default/pages/component/list/list/indexAttr/index.css new file mode 100755 index 0000000..60569ee --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list/indexAttr/index.css @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2020 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. + */ +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.titleContainerStyle { + width: 454px; + height: 70px; +} + +.titleTextStyle { + width: 454px; + height: 50px; + margin-left: 170px; + margin-top: 0px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/list/list/indexAttr/index.hml b/examples/showcase/src/main/js/default/pages/component/list/list/indexAttr/index.hml new file mode 100755 index 0000000..33f1a04 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list/indexAttr/index.hml @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + list通用属性 + + + + + + + + show + + + + + + + + + if + + + + + + + + + for + + + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/list/list/indexAttr/index.js b/examples/showcase/src/main/js/default/pages/component/list/list/indexAttr/index.js new file mode 100755 index 0000000..5d9b87d --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list/indexAttr/index.js @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +export default { + ...backPage("pages/component/list/list/index/index"), + changePage1: routePage("pages/component/list/list/list8/list8").changePage, + changePage2: routePage("pages/component/list/list/list9/list9").changePage, + changePage3: routePage("pages/component/list/list/list12/list12").changePage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/list/list/indexCommonStyle/index.css b/examples/showcase/src/main/js/default/pages/component/list/list/indexCommonStyle/index.css new file mode 100755 index 0000000..60569ee --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list/indexCommonStyle/index.css @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2020 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. + */ +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.titleContainerStyle { + width: 454px; + height: 70px; +} + +.titleTextStyle { + width: 454px; + height: 50px; + margin-left: 170px; + margin-top: 0px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/list/list/indexCommonStyle/index.hml b/examples/showcase/src/main/js/default/pages/component/list/list/indexCommonStyle/index.hml new file mode 100755 index 0000000..95f8fcf --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list/indexCommonStyle/index.hml @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + list通用样式 + + + + + + + + 背景色 + + + left + + + top + + + + + + + + + + + margin + + + height + + + width + + + + + + + + + + + border + + + padding + + + + + + + + + + + margin-left + + + margin-top + + + margin-right + + + margin-bottom + + + + + + + + + + + display + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/list/list/indexCommonStyle/index.js b/examples/showcase/src/main/js/default/pages/component/list/list/indexCommonStyle/index.js new file mode 100755 index 0000000..06af801 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list/indexCommonStyle/index.js @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +export default { + ...backPage("pages/component/list/list/index/index"), + changePage1: routePage("pages/component/list/list/list3/list3").changePage, + changePage2: routePage("pages/component/list/list/list4/list4").changePage, + changePage3: routePage("pages/component/list/list/list5/list5").changePage, + changePage4: routePage("pages/component/list/list/list10/list10").changePage, + changePage5: routePage("pages/component/list/list/list11/list11").changePage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/list/list/indexEvent/index.css b/examples/showcase/src/main/js/default/pages/component/list/list/indexEvent/index.css new file mode 100755 index 0000000..60569ee --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list/indexEvent/index.css @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2020 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. + */ +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.titleContainerStyle { + width: 454px; + height: 70px; +} + +.titleTextStyle { + width: 454px; + height: 50px; + margin-left: 170px; + margin-top: 0px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/list/list/indexEvent/index.hml b/examples/showcase/src/main/js/default/pages/component/list/list/indexEvent/index.hml new file mode 100755 index 0000000..25f06a4 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list/indexEvent/index.hml @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + list通用事件 + + + + + + + + click + + + swipe + + + + + + + + + + list特有事件 + + + + + + + + scrollend + + + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/list/list/indexEvent/index.js b/examples/showcase/src/main/js/default/pages/component/list/list/indexEvent/index.js new file mode 100755 index 0000000..556a684 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list/indexEvent/index.js @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +export default { + ...backPage("pages/component/list/list/index/index"), + changePage1: routePage("pages/component/list/list/list1/list1").changePage, + changePage2: routePage("pages/component/list/list/list2/list2").changePage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/list/list/indexOperation/index.css b/examples/showcase/src/main/js/default/pages/component/list/list/indexOperation/index.css new file mode 100755 index 0000000..60569ee --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list/indexOperation/index.css @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2020 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. + */ +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.titleContainerStyle { + width: 454px; + height: 70px; +} + +.titleTextStyle { + width: 454px; + height: 50px; + margin-left: 170px; + margin-top: 0px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/list/list/indexOperation/index.hml b/examples/showcase/src/main/js/default/pages/component/list/list/indexOperation/index.hml new file mode 100755 index 0000000..d68d511 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list/indexOperation/index.hml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + list特有效果 + + + + + + + + list数组对象方法 + + + + + + + + + + + list组件方法 + + + + + + + diff --git a/examples/showcase/src/main/js/default/pages/component/list/list/indexOperation/index.js b/examples/showcase/src/main/js/default/pages/component/list/list/indexOperation/index.js new file mode 100755 index 0000000..b283a08 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list/indexOperation/index.js @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +export default { + ...backPage("pages/component/list/list/index/index"), + changePage1: routePage("pages/component/list/list/list7/list7").changePage, + changePage2: routePage("pages/component/list/list/list13/list13").changePage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/list/list/indexSpecStyle/index.css b/examples/showcase/src/main/js/default/pages/component/list/list/indexSpecStyle/index.css new file mode 100755 index 0000000..60569ee --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list/indexSpecStyle/index.css @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2020 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. + */ +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.titleContainerStyle { + width: 454px; + height: 70px; +} + +.titleTextStyle { + width: 454px; + height: 50px; + margin-left: 170px; + margin-top: 0px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/list/list/indexSpecStyle/index.hml b/examples/showcase/src/main/js/default/pages/component/list/list/indexSpecStyle/index.hml new file mode 100755 index 0000000..b8999fe --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list/indexSpecStyle/index.hml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + list特有样式 + + + + + + + + flex-direction: + + + row + + + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/list/list/indexSpecStyle/index.js b/examples/showcase/src/main/js/default/pages/component/list/list/indexSpecStyle/index.js new file mode 100755 index 0000000..64e4ee8 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list/indexSpecStyle/index.js @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +export default { + ...backPage("pages/component/list/list/index/index"), + changePage1: routePage("pages/component/list/list/list6/list6").changePage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/list/list/list1/list1.css b/examples/showcase/src/main/js/default/pages/component/list/list/list1/list1.css new file mode 100755 index 0000000..d1559a9 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list/list1/list1.css @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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. + */ +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/list/list/list1/list1.hml b/examples/showcase/src/main/js/default/pages/component/list/list/list1/list1.hml new file mode 100755 index 0000000..56fc60e --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list/list1/list1.hml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + 矩形为list组件 + + + + + 请在list内部点击或滑动 + + + + + {{text1}} + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/list/list/list1/list1.js b/examples/showcase/src/main/js/default/pages/component/list/list/list1/list1.js new file mode 100755 index 0000000..eed9575 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list/list1/list1.js @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +export default { + data: { + text1: "" + }, + ...backPage("pages/component/list/list/indexEvent/index"), + clickFunc: function () { + this.text1 = "点击事件已触发"; + }, + listswipe: function(e) { + this.text1 = "swipe方向:" + e.direction; + } +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/list/list/list10/list10.css b/examples/showcase/src/main/js/default/pages/component/list/list/list10/list10.css new file mode 100755 index 0000000..f2429f8 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list/list10/list10.css @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2020 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. + */ +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; + border-width: 1px; + border-color: red; +} diff --git a/examples/showcase/src/main/js/default/pages/component/list/list/list10/list10.hml b/examples/showcase/src/main/js/default/pages/component/list/list/list10/list10.hml new file mode 100755 index 0000000..160c58e --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list/list10/list10.hml @@ -0,0 +1,36 @@ + + +
+ + + + + + + + + + + + {{text1}} + + + {{text2}} + + + {{text3}} + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/list/list/list10/list10.js b/examples/showcase/src/main/js/default/pages/component/list/list/list10/list10.js new file mode 100755 index 0000000..adafd41 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list/list10/list10.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +export default { + data: { + text1: "上面绿块为list", + text2: "margin已设置", + text3: "宽高已设置" + }, + ...backPage("pages/component/list/list/indexCommonStyle/index"), + changeStatus: function () { + if (this.status == true) { + this.status = false; + } else { + this.status = true; + } + } +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/list/list/list11/list11.css b/examples/showcase/src/main/js/default/pages/component/list/list/list11/list11.css new file mode 100755 index 0000000..f2429f8 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list/list11/list11.css @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2020 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. + */ +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; + border-width: 1px; + border-color: red; +} diff --git a/examples/showcase/src/main/js/default/pages/component/list/list/list11/list11.hml b/examples/showcase/src/main/js/default/pages/component/list/list/list11/list11.hml new file mode 100755 index 0000000..3b76bac --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list/list11/list11.hml @@ -0,0 +1,38 @@ + + +
+ + + + + + + + + + + + + + {{text1}} + + + {{text2}} + + + {{text3}} + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/list/list/list11/list11.js b/examples/showcase/src/main/js/default/pages/component/list/list/list11/list11.js new file mode 100755 index 0000000..a3ea615 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list/list11/list11.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +export default { + data: { + text1: "上面绿块为list", + text2: "点击按钮切换display", + text3: "支持flex/none", + display: "flex" + }, + ...backPage("pages/component/list/list/indexCommonStyle/index"), + changeDisplay: function () { + if (this.display === "flex") { + this.display = "none"; + } else { + this.display = "flex"; + } + } +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/list/list/list12/list12.css b/examples/showcase/src/main/js/default/pages/component/list/list/list12/list12.css new file mode 100755 index 0000000..f9ba362 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list/list12/list12.css @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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. + */ +.text { + width: 350px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/list/list/list12/list12.hml b/examples/showcase/src/main/js/default/pages/component/list/list/list12/list12.hml new file mode 100755 index 0000000..ecd6208 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list/list12/list12.hml @@ -0,0 +1,30 @@ + + +
+ + + + + + + + + + + + {{text1}} + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/list/list/list12/list12.js b/examples/showcase/src/main/js/default/pages/component/list/list/list12/list12.js new file mode 100755 index 0000000..bed42ec --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list/list12/list12.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +export default { + data: { + listData:["a", "b", "c", "d"], + text1: "for类型list包含4个list" + }, + ...backPage("pages/component/list/list/indexAttr/index") +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/list/list/list13/list13.css b/examples/showcase/src/main/js/default/pages/component/list/list/list13/list13.css new file mode 100755 index 0000000..70a7105 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list/list13/list13.css @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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. + */ +.text { + width: 350px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size: 30; +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/list/list/list13/list13.hml b/examples/showcase/src/main/js/default/pages/component/list/list/list13/list13.hml new file mode 100755 index 0000000..f563ba0 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list/list13/list13.hml @@ -0,0 +1,34 @@ + + +
+ + + + + + + + + + item-{{$idx}} + + + + + + 点击button回到item-2 + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/list/list/list13/list13.js b/examples/showcase/src/main/js/default/pages/component/list/list/list13/list13.js new file mode 100755 index 0000000..fdd3890 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list/list13/list13.js @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2020 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. + */ +var router = require("@system.router"); +module.exports = { + data: { + listData: [ + "a", + "b", + "c", + "d", + "e", + "f", + "g", + "h" + ] + }, + backMain: function () { + router.replace({ uri: "pages/index/index" }); + }, + backSuperior: function () { + router.replace({ uri: "pages/component/list/list/indexOperation/index" }); + }, + listClick() { + router.replace({ uri: "pages/component/list/list/list13/list13" }); + console.log("list onclick is triggered"); + }, + scrollEnd(endState, endComponentIndex) { + console.log("list onscrollend is triggered, end component index=" + endComponentIndex); + console.log("list onscrollend is triggered, state=" + endState); + }, + clickscrollTo() { + this.$refs.listObj.scrollTo({index:2}); + }, + onInit() { + console.log("on init called..."); + }, + onShow() { + this.$refs.listObj.scrollTo({index:3}); + console.log("on Ready called..."); + }, +}; diff --git a/examples/showcase/src/main/js/default/pages/component/list/list/list2/list2.css b/examples/showcase/src/main/js/default/pages/component/list/list/list2/list2.css new file mode 100755 index 0000000..d1559a9 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list/list2/list2.css @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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. + */ +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/list/list/list2/list2.hml b/examples/showcase/src/main/js/default/pages/component/list/list/list2/list2.hml new file mode 100755 index 0000000..8b839a0 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list/list2/list2.hml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + 当前为list组件 + + + + + 滑动到底部 + + + + + + + {{text1}} + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/list/list/list2/list2.js b/examples/showcase/src/main/js/default/pages/component/list/list/list2/list2.js new file mode 100755 index 0000000..327810f --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list/list2/list2.js @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +export default { + data: { + text1: "scrollend未触发" + }, + ...backPage("pages/component/list/list/indexEvent/index"), + scrollendFunc: function () { + this.text1 = "scrollend已触发"; + } +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/list/list/list3/list3.css b/examples/showcase/src/main/js/default/pages/component/list/list/list3/list3.css new file mode 100755 index 0000000..26bc101 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list/list3/list3.css @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2020 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. + */ +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} + +.stack { + left: 0px; + top: 0px; + width: 454px; + height: 454px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/list/list/list3/list3.hml b/examples/showcase/src/main/js/default/pages/component/list/list/list3/list3.hml new file mode 100755 index 0000000..b44fd63 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list/list3/list3.hml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + {{text1}} + + + {{text2}} + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/list/list/list3/list3.js b/examples/showcase/src/main/js/default/pages/component/list/list/list3/list3.js new file mode 100755 index 0000000..c97bc34 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list/list3/list3.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +export default { + data: { + text1: "上面绿块为list", + text2: "背景距离已设置" + }, + ...backPage("pages/component/list/list/indexCommonStyle/index") +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/list/list/list4/list4.css b/examples/showcase/src/main/js/default/pages/component/list/list/list4/list4.css new file mode 100755 index 0000000..f2429f8 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list/list4/list4.css @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2020 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. + */ +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; + border-width: 1px; + border-color: red; +} diff --git a/examples/showcase/src/main/js/default/pages/component/list/list/list4/list4.hml b/examples/showcase/src/main/js/default/pages/component/list/list/list4/list4.hml new file mode 100755 index 0000000..dbd8145 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list/list4/list4.hml @@ -0,0 +1,36 @@ + + +
+ + + + + + + + + + + + {{text1}} + + + {{text2}} + + + {{text3}} + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/list/list/list4/list4.js b/examples/showcase/src/main/js/default/pages/component/list/list/list4/list4.js new file mode 100755 index 0000000..3062007 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list/list4/list4.js @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +export default { + data: { + text1: "上面绿块为list", + text2: "margin已设置", + text3: "宽高已设置" + }, + ...backPage("pages/component/list/list/indexCommonStyle/index") +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/list/list/list5/list5.css b/examples/showcase/src/main/js/default/pages/component/list/list/list5/list5.css new file mode 100755 index 0000000..d1559a9 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list/list5/list5.css @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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. + */ +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/list/list/list5/list5.hml b/examples/showcase/src/main/js/default/pages/component/list/list/list5/list5.hml new file mode 100755 index 0000000..cd3c4ec --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list/list5/list5.hml @@ -0,0 +1,34 @@ + + +
+ + + + + + + + + + + + + + + + {{text1}} + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/list/list/list5/list5.js b/examples/showcase/src/main/js/default/pages/component/list/list/list5/list5.js new file mode 100755 index 0000000..8f0d6bf --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list/list5/list5.js @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +export default { + data: { + text1: "内边距和边框" + }, + ...backPage("pages/component/list/list/indexCommonStyle/index") +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/list/list/list6/list6.css b/examples/showcase/src/main/js/default/pages/component/list/list/list6/list6.css new file mode 100755 index 0000000..d1559a9 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list/list6/list6.css @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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. + */ +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/list/list/list6/list6.hml b/examples/showcase/src/main/js/default/pages/component/list/list/list6/list6.hml new file mode 100755 index 0000000..73a7920 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list/list6/list6.hml @@ -0,0 +1,52 @@ + + +
+ + + + + + + + +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+ +
+
+
+
+ + {{text1}} + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/list/list/list6/list6.js b/examples/showcase/src/main/js/default/pages/component/list/list/list6/list6.js new file mode 100755 index 0000000..0055fd0 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list/list6/list6.js @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +export default { + data: { + text1: "div方块横向排列" + }, + ...backPage("pages/component/list/list/indexSpecStyle/index") +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/list/list/list7/list7.css b/examples/showcase/src/main/js/default/pages/component/list/list/list7/list7.css new file mode 100755 index 0000000..06a7a5d --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list/list7/list7.css @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2020 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. + */ diff --git a/examples/showcase/src/main/js/default/pages/component/list/list/list7/list7.hml b/examples/showcase/src/main/js/default/pages/component/list/list/list7/list7.hml new file mode 100755 index 0000000..f7e2bae --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list/list7/list7.hml @@ -0,0 +1,42 @@ + + +
+ + + + + + + + + + {{$item}}--{{$idx}} + + + + + + + + + + + + + + + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/list/list/list7/list7.js b/examples/showcase/src/main/js/default/pages/component/list/list/list7/list7.js new file mode 100755 index 0000000..7cbaa22 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list/list7/list7.js @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +export default { + data: { + listData: [ + "text组件b", + "text组件c", + "text组件d" + ] + }, + ...backPage("pages/component/list/list/indexOperation/index"), + pushItem: function () { + console.log("push an item."); + this.listData.push("text组件z"); + }, + popItem: function () { + console.log("pop an item."); + this.listData.pop(); + }, + shiftItem: function () { + console.log("shift an item."); + this.listData.shift(); + }, + unshiftItem: function () { + console.log("unshift an item."); + this.listData.unshift("text组件a"); + }, + spliceItem: function () { + console.log("splice items."); + this.listData.splice(0, 1, "text组件x", "text组件y"); + } +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/list/list/list8/list8.css b/examples/showcase/src/main/js/default/pages/component/list/list/list8/list8.css new file mode 100755 index 0000000..f1f3c27 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list/list8/list8.css @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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. + */ +.text { + width: 280px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/list/list/list8/list8.hml b/examples/showcase/src/main/js/default/pages/component/list/list/list8/list8.hml new file mode 100755 index 0000000..dce1652 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list/list8/list8.hml @@ -0,0 +1,32 @@ + + +
+ + + + + + + + + + + + + + {{text1}} + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/list/list/list8/list8.js b/examples/showcase/src/main/js/default/pages/component/list/list/list8/list8.js new file mode 100755 index 0000000..003d287 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list/list8/list8.js @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +import {changeStatus} from "../../../../../common/js/list" +export default { + data: { + text1: "点击按钮改变状态", + status: true + }, + ...backPage("pages/component/list/list/indexAttr/index"), + changeStatus: changeStatus +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/list/list/list9/list9.css b/examples/showcase/src/main/js/default/pages/component/list/list/list9/list9.css new file mode 100755 index 0000000..f1f3c27 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list/list9/list9.css @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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. + */ +.text { + width: 280px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/list/list/list9/list9.hml b/examples/showcase/src/main/js/default/pages/component/list/list/list9/list9.hml new file mode 100755 index 0000000..ed52ea1 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list/list9/list9.hml @@ -0,0 +1,32 @@ + + +
+ + + + + + + + + + + + + + {{text1}} + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/list/list/list9/list9.js b/examples/showcase/src/main/js/default/pages/component/list/list/list9/list9.js new file mode 100755 index 0000000..c2e96f3 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/list/list/list9/list9.js @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +import {changeStatus} from "../../../../../common/js/list" +export default { + data: { + text1: "点击按钮改变状态", + status: true + }, + changeStatus: changeStatus, + ...backPage("pages/component/list/list/indexAttr/index") +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/marquee/attr/attr.css b/examples/showcase/src/main/js/default/pages/component/marquee/attr/attr.css new file mode 100755 index 0000000..9483c19 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/marquee/attr/attr.css @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2020 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. + */ +.list { + left: 0px; + top: 0px; + width: 454px; + height: 454px; +} + +.item-title { + left: 0px; + top: 0px; + width: 400px; + height: 70px; +} + +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.item-types { + width: 454px; + height: 80px; +} + +.whole-text { + margin-top:10px; + margin-left:150px; + width:200px; + height:60px; + font-size:30px; + color: red; +} + +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} + +.text-big { + width: 70px; + height: 70px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} + +.item-attribute { + width: 454px; + height: 100px; +} + +.attribute-div { + left: 0px; + top: 0px; + height: 100px; + width: 250px; + flex-direction: row; +} + +.attribute-div-show-marquee { + left: 0px; + top: 0px; + height: 100px; + width: 200px; +} + +.attribute-div-if-marquee { + left: 0px; + top: 0px; + height: 100px; + width: 200px; + flex-direction: column; +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/marquee/attr/attr.hml b/examples/showcase/src/main/js/default/pages/component/marquee/attr/attr.hml new file mode 100755 index 0000000..5f807e6 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/marquee/attr/attr.hml @@ -0,0 +1,65 @@ + + + + + + + + + + + + + 通用属性 + + + + +
+ +
+
+ + if 标签 if status, Hello ACE + + + 如果点击if按钮,会占用上面文字滚动区域 + +
+
+ +
+ +
+
+ + 显示文字abcedfghijklmn + +
+
+ +
+ +
+
+ + {{$idx}} -- {{$item}} + +
+
+ + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/marquee/attr/attr.js b/examples/showcase/src/main/js/default/pages/component/marquee/attr/attr.js new file mode 100755 index 0000000..cafabf4 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/marquee/attr/attr.js @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2020 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 {goPage,routePage} from "../../../../common/js/general"; +import {changeStatus, changeIfStatus} from "../../../../common/js/marquee" +export default { + data: { + status: true, + ifstatus: true, + marqueefor: [ + "1.marquee测试for标签,abcdefg", + "2.marquee测试for标签,abcdefg" + ] + }, + ...goPage("pages/component/marquee/index/index"), + changeStatus: changeStatus, + changeIfStatus: changeIfStatus +}; \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/marquee/commonStyle/commonStyle.css b/examples/showcase/src/main/js/default/pages/component/marquee/commonStyle/commonStyle.css new file mode 100755 index 0000000..dad1a7a --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/marquee/commonStyle/commonStyle.css @@ -0,0 +1,138 @@ +/* + * Copyright (c) 2020 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. + */ +.list { + left: 0px; + top: 0px; + width: 454px; + height: 454px; +} + +.item-title { + left: 0px; + top: 0px; + width: 400px; + height: 70px; +} + +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.item-types { + width: 454px; + height: 80px; +} + +.whole-text { + margin-top:10px; + margin-left:150px; + width:200px; + height:60px; + font-size:30px; + color: red; +} + +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} + +.item-three { + width: 450px; + height: 200px; +} + +.three-div { + width: 450px; + height: 200px; + left: 0px; + top: 0px; +} + +.three-left-div { + width: 220px; + height: 200px; + left: 0px; + top: 0px; + flex-direction: column; +} + +.three-right-div { + width: 230px; + height: 190px; + top: 40px; + left: 0px; +} + +.item-two { + width: 450px; + height: 150px; +} + +.two-left-div { + width: 220px; + height: 150px; + left: 0px; + top: 0px; + flex-direction: column; +} + +.two-div { + width: 450px; + height: 150px; + left: 0px; + top: 0px; +} + +.general-stack { + width: 250px; + height: 200px; + left: 0px; + top: 0px; + background-color: springgreen; +} + +.general-text { + background-color: red; + left: 50px; + top: 50px; + width: 100px; + height: 60px; +} + +.right-div { + width: 250px; + height: 200px; + background-color: springgreen; + left: 0px; + top: 0px; +} + +.show { + opacity:1; + border-width: 5px; + border-color: #0000ff; + border-radius:5px; + padding:10px; + width: 150px; + height: 50px; + background-color: red; + margin-left: 10px; +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/marquee/commonStyle/commonStyle.hml b/examples/showcase/src/main/js/default/pages/component/marquee/commonStyle/commonStyle.hml new file mode 100755 index 0000000..e5e19e5 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/marquee/commonStyle/commonStyle.hml @@ -0,0 +1,94 @@ + + + + + + + + + + + 通用样式 + + + +
+
+ 背景红色 + left为50 + top为50 +
+ + show-text + +
+
+ + +
+
+ margin为40 + height为60 + width为100 +
+
+ show-text +
+
+
+ + +
+
+ border + padding +
+
+ show-text +
+
+
+ + +
+
+ display + {{displayVal}} +
+
+ display val is flex +
+
+
+ +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/marquee/commonStyle/commonStyle.js b/examples/showcase/src/main/js/default/pages/component/marquee/commonStyle/commonStyle.js new file mode 100755 index 0000000..f7cdbbf --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/marquee/commonStyle/commonStyle.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2020 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 {goPage, routePage} from "../../../../common/js/general"; +export default { + data: { + displayVal: "flex", + flag: true + }, + changeDisplay() { + if (this.flag) { + this.displayVal = "none"; + this.flag = false; + } else { + this.displayVal = "flex"; + this.flag = true; + } + }, + ...goPage("pages/component/marquee/index/index") +}; \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/marquee/event/event.css b/examples/showcase/src/main/js/default/pages/component/marquee/event/event.css new file mode 100755 index 0000000..ef7c899 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/marquee/event/event.css @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2020 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. + */ +.list { + left: 0px; + top: 0px; + width: 454px; + height: 454px; +} + +.item-title { + left: 0px; + top: 0px; + width: 400px; + height: 70px; +} + +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.item-types { + width: 454px; + height: 80px; +} + +.whole-text { + margin-top:10px; + margin-left:150px; + width:200px; + height:60px; + font-size:30px; + color: red; +} + +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} + +.item-two { + width: 450px; + height: 200px; +} + +.two-right-div { + width: 230px; + height: 200px; + top: 40px; + left: 0px; +} + +.two-left-div { + width: 220px; + height: 200px; + left: 0px; + top: 0px; + flex-direction: column; +} + +.two-div { + width: 450px; + height: 200px; + left: 0px; + top: 0px; +} + +.click-text { + margin-left: 30px; + margin-top: 30px; + width: 150px; + height: 50px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/marquee/event/event.hml b/examples/showcase/src/main/js/default/pages/component/marquee/event/event.hml new file mode 100755 index 0000000..80abbc3 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/marquee/event/event.hml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + 通用事件 + + + + +
+
+ click + longpress + swipe +
+
+ {{text}} +
+
+
+ + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/marquee/event/event.js b/examples/showcase/src/main/js/default/pages/component/marquee/event/event.js new file mode 100755 index 0000000..6194b30 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/marquee/event/event.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2020 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 { goPage, routePage } from "../../../../common/js/general"; +export default { + data: { + text: "点击/长按/滑动" + }, + ...goPage("pages/component/marquee/index/index"), + clickEvent(e) { + this.text = "点击已触发"; + }, + longpressEvent() { + this.text = "长按已触发"; + }, + swipeEvent(e) { + this.text = "swipe方向:" + e.direction; + } +}; \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/marquee/index/index.css b/examples/showcase/src/main/js/default/pages/component/marquee/index/index.css new file mode 100755 index 0000000..e71ae21 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/marquee/index/index.css @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2020 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. + */ +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.titleContainerStyle { + width: 454px; + height: 70px; +} + +.titleTextStyle { + width: 454px; + height: 50px; + margin-left: 160px; + margin-top: 0px; +} + +.buttonContainerStyle { + width: 454px; + height: 80px; +} + +.buttonStyle { + width: 200px; + height: 60px; + margin-left: 130px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/marquee/index/index.hml b/examples/showcase/src/main/js/default/pages/component/marquee/index/index.hml new file mode 100755 index 0000000..440adea --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/marquee/index/index.hml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + marquee + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/marquee/index/index.js b/examples/showcase/src/main/js/default/pages/component/marquee/index/index.js new file mode 100755 index 0000000..1f9991a --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/marquee/index/index.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../common/js/general"; +export default { + changePage1: routePage("pages/component/marquee/attr/attr").changePage, + changePage2: routePage("pages/component/marquee/commonStyle/commonStyle").changePage, + changePage3: routePage("pages/component/marquee/specStyle/specStyle").changePage, + changePage4: routePage("pages/component/marquee/event/event").changePage, + ...backPage("pages/component/index/baseIndex/index") +}; \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/marquee/specStyle/specStyle.css b/examples/showcase/src/main/js/default/pages/component/marquee/specStyle/specStyle.css new file mode 100755 index 0000000..88824f8 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/marquee/specStyle/specStyle.css @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2020 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. + */ +.list { + left: 0px; + top: 0px; + width: 454px; + height: 454px; +} + +.item-title { + left: 0px; + top: 0px; + width: 400px; + height: 70px; +} + +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.item-types { + width: 454px; + height: 80px; +} + +.whole-text { + margin-top:10px; + margin-left:150px; + width:200px; + height:60px; + font-size:30px; + color: red; +} + +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} + +.item-special { + width: 450px; + height: 200px; +} + +.special-div { + width: 450px; + height: 200px; + left: 0px; + top: 0px; +} + +.special-left-div { + width: 250px; + height: 200px; + top:0px; + left:0px; + flex-direction: column; +} + +.special-right-div { + width: 200px; + height: 200px; + top: 0px; + left: 0px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/marquee/specStyle/specStyle.hml b/examples/showcase/src/main/js/default/pages/component/marquee/specStyle/specStyle.hml new file mode 100755 index 0000000..009125c --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/marquee/specStyle/specStyle.hml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + 特有样式 + + + + +
+
+ scrollamount;color;font-size;font-family +
+
+ show-abcedfghijklmn +
+
+
+ + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/marquee/specStyle/specStyle.js b/examples/showcase/src/main/js/default/pages/component/marquee/specStyle/specStyle.js new file mode 100755 index 0000000..eb6dfe8 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/marquee/specStyle/specStyle.js @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2020 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 {goPage, routePage} from "../../../../common/js/general"; +export default { + ...goPage("pages/component/marquee/index/index") +}; \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/index/index.css b/examples/showcase/src/main/js/default/pages/component/picker_view/index/index.css new file mode 100755 index 0000000..b57bf31 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/index/index.css @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2020 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. + */ +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/index/index.hml b/examples/showcase/src/main/js/default/pages/component/picker_view/index/index.hml new file mode 100755 index 0000000..855ed35 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/index/index.hml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/index/index.js b/examples/showcase/src/main/js/default/pages/component/picker_view/index/index.js new file mode 100755 index 0000000..ea92253 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/index/index.js @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../common/js/general"; +export default { + ...backPage("pages/component/index/formIndex/index"), + changeTextPicker: routePage("pages/component/picker_view/text_picker/index/index").changePage, + changeTimePicker: routePage("pages/component/picker_view/time_picker/index/index").changePage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/index/index.css b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/index/index.css new file mode 100755 index 0000000..b59d8ea --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/index/index.css @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2020 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. + */ +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.titleContainerStyle { + width: 454px; + height: 70px; +} + +.titleTextStyle { + width: 454px; + height: 50px; + margin-left: 150px; + margin-top: 0px; +} + +.buttonContainerStyle { + width: 454px; + height: 80px; +} + +.buttonStyle { + width: 200px; + height: 60px; + margin-left: 130px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/index/index.hml b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/index/index.hml new file mode 100755 index 0000000..8c584ec --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/index/index.hml @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + text_picker + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/index/index.js b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/index/index.js new file mode 100755 index 0000000..08a310c --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/index/index.js @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +export default { + ...backPage("pages/component/picker_view/index/index"), + changePage1: routePage("pages/component/picker_view/text_picker/indexAttr/index").changePage, + changePage2: routePage("pages/component/picker_view/text_picker/indexStyle/index").changePage, + changePage3: routePage("pages/component/picker_view/text_picker/indexEvent/index").changePage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/indexAttr/index.css b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/indexAttr/index.css new file mode 100755 index 0000000..0f95b40 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/indexAttr/index.css @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2020 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. + */ +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.titleContainerStyle { + width: 454px; + height: 70px; +} + +.titleTextStyle { + width: 454px; + height: 50px; + margin-left: 170px; + margin-top: 0px; + color: red; +} diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/indexAttr/index.hml b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/indexAttr/index.hml new file mode 100755 index 0000000..c849aff --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/indexAttr/index.hml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + 通用属性 + + + + + + + + for + + + + + + + + + + + if + + + + + + + + + + + show + + + + + + + + + + 特有属性 + + + + + + + + range + + + selected + + + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/indexAttr/index.js b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/indexAttr/index.js new file mode 100755 index 0000000..96427cd --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/indexAttr/index.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +export default { + ...backPage("pages/component/picker_view/text_picker/index/index"), + changePage1: routePage("pages/component/picker_view/text_picker/text_picker6/text_picker6").changePage, + changePage2: routePage("pages/component/picker_view/text_picker/text_picker5/text_picker5").changePage, + change2If: routePage("pages/component/picker_view/text_picker/text_picker7/text_picker7").changePage, + change2For: routePage("pages/component/picker_view/text_picker/text_picker8/text_picker8").changePage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/indexEvent/index.css b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/indexEvent/index.css new file mode 100755 index 0000000..0f95b40 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/indexEvent/index.css @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2020 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. + */ +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.titleContainerStyle { + width: 454px; + height: 70px; +} + +.titleTextStyle { + width: 454px; + height: 50px; + margin-left: 170px; + margin-top: 0px; + color: red; +} diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/indexEvent/index.hml b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/indexEvent/index.hml new file mode 100755 index 0000000..6fbdc51 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/indexEvent/index.hml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + 特有事件 + + + + + + + + change + + + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/indexEvent/index.js b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/indexEvent/index.js new file mode 100755 index 0000000..e2b3de6 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/indexEvent/index.js @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +export default { + ...backPage("pages/component/picker_view/text_picker/index/index"), + changePage1: routePage("pages/component/picker_view/text_picker/text_picker1/text_picker1").changePage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/indexStyle/index.css b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/indexStyle/index.css new file mode 100755 index 0000000..0f95b40 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/indexStyle/index.css @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2020 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. + */ +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.titleContainerStyle { + width: 454px; + height: 70px; +} + +.titleTextStyle { + width: 454px; + height: 50px; + margin-left: 170px; + margin-top: 0px; + color: red; +} diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/indexStyle/index.hml b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/indexStyle/index.hml new file mode 100755 index 0000000..0ad17b6 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/indexStyle/index.hml @@ -0,0 +1,116 @@ + + + + + + + + + + + + + + + + + 通用样式 + + + + + + + + 背景色 + + + left + + + top + + + + + + + + + + + margin + + + height + + + width + + + + + + + + + + + border + + + padding + + + + + + + + + + + display + + + + + + + + + + 特有样式 + + + + + + + + color + + + font + + + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/indexStyle/index.js b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/indexStyle/index.js new file mode 100755 index 0000000..d40a3db --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/indexStyle/index.js @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +export default { + ...backPage("pages/component/picker_view/text_picker/index/index"), + changePage1: routePage("pages/component/picker_view/text_picker/text_picker2/text_picker2").changePage, + changePage2: routePage("pages/component/picker_view/text_picker/text_picker3/text_picker3").changePage, + changePage3: routePage("pages/component/picker_view/text_picker/text_picker4/text_picker4").changePage, + change2Style: routePage("pages/component/picker_view/text_picker/text_picker9/text_picker9").changePage, + change2Display: routePage("pages/component/picker_view/text_picker/text_picker10/text_picker10").changePage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker1/text_picker1.css b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker1/text_picker1.css new file mode 100755 index 0000000..d1559a9 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker1/text_picker1.css @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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. + */ +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker1/text_picker1.hml b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker1/text_picker1.hml new file mode 100755 index 0000000..c0c77ca --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker1/text_picker1.hml @@ -0,0 +1,31 @@ + + +
+ + + + + + + + + + change索引为{{text1}} + + + change值为{{text2}} + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker1/text_picker1.js b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker1/text_picker1.js new file mode 100755 index 0000000..7a3df34 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker1/text_picker1.js @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +export default { + data: { + text1: 0, + text2: "a", + textContent: ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"] + }, + ...backPage("pages/component/picker_view/text_picker/indexEvent/index"), + getText: function (e1) { + this.text1 = e1.newSelected; + this.text2 = e1.newValue; + } +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker10/text_picker10.css b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker10/text_picker10.css new file mode 100755 index 0000000..d1559a9 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker10/text_picker10.css @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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. + */ +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker10/text_picker10.hml b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker10/text_picker10.hml new file mode 100755 index 0000000..9e0f40d --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker10/text_picker10.hml @@ -0,0 +1,30 @@ + + +
+ + + + + + + + + + + + 点击改状态 + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker10/text_picker10.js b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker10/text_picker10.js new file mode 100755 index 0000000..8d416d4 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker10/text_picker10.js @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +export default { + data: { + textContent: ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"], + status: "flex" + }, + ...backPage("pages/component/picker_view/text_picker/indexStyle/index"), + changeStatus: function () { + if (this.status === "flex") { + this.status = "none"; + } else { + this.status = "flex"; + } + } +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker2/text_picker2.css b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker2/text_picker2.css new file mode 100755 index 0000000..f07e5b9 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker2/text_picker2.css @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2020 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. + */ +.stack { + left: 0px; + top: 0px; + width: 454px; + height: 454px; +} + +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker2/text_picker2.hml b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker2/text_picker2.hml new file mode 100755 index 0000000..4e529ca --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker2/text_picker2.hml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + {{text1}} + + + {{text2}} + + + {{text3}} + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker2/text_picker2.js b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker2/text_picker2.js new file mode 100755 index 0000000..0a2ba3b --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker2/text_picker2.js @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +export default { + data: { + text1: "背景色绿色", + text2: "left设置85", + text3: "top设置170", + textContent: ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"] + }, + ...backPage("pages/component/picker_view/text_picker/indexStyle/index") +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker3/text_picker3.css b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker3/text_picker3.css new file mode 100755 index 0000000..d1559a9 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker3/text_picker3.css @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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. + */ +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker3/text_picker3.hml b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker3/text_picker3.hml new file mode 100755 index 0000000..18780fc --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker3/text_picker3.hml @@ -0,0 +1,34 @@ + + +
+ + + + + + + + + + {{text1}} + + + {{text2}} + + + {{text3}} + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker3/text_picker3.js b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker3/text_picker3.js new file mode 100755 index 0000000..a23e1a1 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker3/text_picker3.js @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +export default { + data: { + text1: "margin左边距85", + text2: "margin上边距10", + text3: "宽高已设置", + textContent: ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"] + }, + ...backPage("pages/component/picker_view/text_picker/indexStyle/index") +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker4/text_picker4.css b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker4/text_picker4.css new file mode 100755 index 0000000..06a7a5d --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker4/text_picker4.css @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2020 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. + */ diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker4/text_picker4.hml b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker4/text_picker4.hml new file mode 100755 index 0000000..9691209 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker4/text_picker4.hml @@ -0,0 +1,27 @@ + + +
+ + + + + + + + + + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker4/text_picker4.js b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker4/text_picker4.js new file mode 100755 index 0000000..b6b6f57 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker4/text_picker4.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2020 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. + */ +// text_picker4.js +import { backPage, routePage } from "../../../../../common/js/general"; +export default { + data: { + textContent: ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"] + }, + ...backPage("pages/component/picker_view/text_picker/indexStyle/index") +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker5/text_picker5.css b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker5/text_picker5.css new file mode 100755 index 0000000..d1559a9 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker5/text_picker5.css @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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. + */ +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker5/text_picker5.hml b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker5/text_picker5.hml new file mode 100755 index 0000000..7c0bffb --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker5/text_picker5.hml @@ -0,0 +1,31 @@ + + +
+ + + + + + + + + + range范围a-j + + + selected为e + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker5/text_picker5.js b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker5/text_picker5.js new file mode 100755 index 0000000..525715c --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker5/text_picker5.js @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +export default { + data: { + textContent: ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"] + }, + ...backPage("pages/component/picker_view/text_picker/indexAttr/index") +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker6/text_picker6.css b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker6/text_picker6.css new file mode 100755 index 0000000..d1559a9 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker6/text_picker6.css @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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. + */ +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker6/text_picker6.hml b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker6/text_picker6.hml new file mode 100755 index 0000000..80de2a9 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker6/text_picker6.hml @@ -0,0 +1,30 @@ + + +
+ + + + + + + + + + + + 点击改状态 + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker6/text_picker6.js b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker6/text_picker6.js new file mode 100755 index 0000000..d9d4fb6 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker6/text_picker6.js @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +import {changeStatus} from "../../../../../common/js/picker_view"; +export default { + data: { + textContent: ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"], + status: true + }, + changeStatus: changeStatus, + ...backPage("pages/component/picker_view/text_picker/indexAttr/index") +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker7/text_picker7.css b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker7/text_picker7.css new file mode 100755 index 0000000..d1559a9 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker7/text_picker7.css @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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. + */ +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker7/text_picker7.hml b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker7/text_picker7.hml new file mode 100755 index 0000000..b3fb311 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker7/text_picker7.hml @@ -0,0 +1,30 @@ + + +
+ + + + + + + + + + + + 点击改状态 + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker7/text_picker7.js b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker7/text_picker7.js new file mode 100755 index 0000000..a46e778 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker7/text_picker7.js @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +import {changeStatus} from "../../../../../common/js/picker_view" +export default { + data: { + textContent: ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"], + status: true + }, + ...backPage("pages/component/picker_view/text_picker/indexAttr/index"), + changeStatus: changeStatus +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker8/text_picker8.css b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker8/text_picker8.css new file mode 100755 index 0000000..d1559a9 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker8/text_picker8.css @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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. + */ +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker8/text_picker8.hml b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker8/text_picker8.hml new file mode 100755 index 0000000..bfd6405 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker8/text_picker8.hml @@ -0,0 +1,27 @@ + + +
+ + + + + + +
+ + +
+
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker8/text_picker8.js b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker8/text_picker8.js new file mode 100755 index 0000000..e1350c2 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker8/text_picker8.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +export default { + data: { + textContent: ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"], + forData: [0, 1, 2] + }, + ...backPage("pages/component/picker_view/text_picker/indexAttr/index") +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker9/text_picker9.css b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker9/text_picker9.css new file mode 100755 index 0000000..5c389be --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker9/text_picker9.css @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2020 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. + */ +.textPickStyle { + color:green; + font-size:30px; + font-family:HYQiHei-65S; + selected-color:#7ff708; + selected-font-size:38px; + selected-font-family:HYQiHei-65S; +} diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker9/text_picker9.hml b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker9/text_picker9.hml new file mode 100755 index 0000000..259520c --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker9/text_picker9.hml @@ -0,0 +1,25 @@ + + +
+ + + + + + + + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker9/text_picker9.js b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker9/text_picker9.js new file mode 100755 index 0000000..0c20323 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/text_picker/text_picker9/text_picker9.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2020 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. + */ +// text_picker9.js +import { backPage, routePage } from "../../../../../common/js/general"; +export default { + data: { + textContent: ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"] + }, + ...backPage("pages/component/picker_view/text_picker/indexStyle/index") +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/index/index.css b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/index/index.css new file mode 100755 index 0000000..b59d8ea --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/index/index.css @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2020 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. + */ +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.titleContainerStyle { + width: 454px; + height: 70px; +} + +.titleTextStyle { + width: 454px; + height: 50px; + margin-left: 150px; + margin-top: 0px; +} + +.buttonContainerStyle { + width: 454px; + height: 80px; +} + +.buttonStyle { + width: 200px; + height: 60px; + margin-left: 130px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/index/index.hml b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/index/index.hml new file mode 100755 index 0000000..f102cef --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/index/index.hml @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + time_picker + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/index/index.js b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/index/index.js new file mode 100755 index 0000000..c7dec0c --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/index/index.js @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +export default { + ...backPage("pages/component/picker_view/index/index"), + changePage1: routePage("pages/component/picker_view/time_picker/indexAttr/index").changePage, + changePage2: routePage("pages/component/picker_view/time_picker/indexStyle/index").changePage, + changePage3: routePage("pages/component/picker_view/time_picker/indexEvent/index").changePage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/indexAttr/index.css b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/indexAttr/index.css new file mode 100755 index 0000000..0f95b40 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/indexAttr/index.css @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2020 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. + */ +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.titleContainerStyle { + width: 454px; + height: 70px; +} + +.titleTextStyle { + width: 454px; + height: 50px; + margin-left: 170px; + margin-top: 0px; + color: red; +} diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/indexAttr/index.hml b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/indexAttr/index.hml new file mode 100755 index 0000000..3997d58 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/indexAttr/index.hml @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + 通用属性 + + + + + + + + for + + + + + + + + + + + if + + + + + + + + + + + show + + + + + + + + + + 特有属性 + + + + + + + + selected + + + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/indexAttr/index.js b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/indexAttr/index.js new file mode 100755 index 0000000..9162f1a --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/indexAttr/index.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +export default { + ...backPage("pages/component/picker_view/time_picker/index/index"), + changePage1: routePage("pages/component/picker_view/time_picker/time_picker6/time_picker6").changePage, + changePage2: routePage("pages/component/picker_view/time_picker/time_picker5/time_picker5").changePage, + change2If: routePage("pages/component/picker_view/time_picker/time_picker7/time_picker7").changePage, + change2For: routePage("pages/component/picker_view/time_picker/time_picker8/time_picker8").changePage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/indexEvent/index.css b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/indexEvent/index.css new file mode 100755 index 0000000..0f95b40 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/indexEvent/index.css @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2020 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. + */ +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.titleContainerStyle { + width: 454px; + height: 70px; +} + +.titleTextStyle { + width: 454px; + height: 50px; + margin-left: 170px; + margin-top: 0px; + color: red; +} diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/indexEvent/index.hml b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/indexEvent/index.hml new file mode 100755 index 0000000..e556290 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/indexEvent/index.hml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + 特有事件 + + + + + + + + change + + + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/indexEvent/index.js b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/indexEvent/index.js new file mode 100755 index 0000000..84de335 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/indexEvent/index.js @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +export default { + ...backPage("pages/component/picker_view/time_picker/index/index"), + changePage1: routePage("pages/component/picker_view/time_picker/time_picker1/time_picker1").changePage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/indexStyle/index.css b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/indexStyle/index.css new file mode 100755 index 0000000..0f95b40 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/indexStyle/index.css @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2020 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. + */ +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.titleContainerStyle { + width: 454px; + height: 70px; +} + +.titleTextStyle { + width: 454px; + height: 50px; + margin-left: 170px; + margin-top: 0px; + color: red; +} diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/indexStyle/index.hml b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/indexStyle/index.hml new file mode 100755 index 0000000..7878d15 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/indexStyle/index.hml @@ -0,0 +1,116 @@ + + + + + + + + + + + + + + + + + 通用样式 + + + + + + + + 背景色 + + + left + + + top + + + + + + + + + + + margin + + + height + + + width + + + + + + + + + + + border + + + padding + + + + + + + + + + + display + + + + + + + + + + 特有样式 + + + + + + + + color + + + font + + + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/indexStyle/index.js b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/indexStyle/index.js new file mode 100755 index 0000000..df4019c --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/indexStyle/index.js @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +export default { + ...backPage("pages/component/picker_view/time_picker/index/index"), + changePage1: routePage("pages/component/picker_view/time_picker/time_picker2/time_picker2").changePage, + changePage2: routePage("pages/component/picker_view/time_picker/time_picker3/time_picker3").changePage, + changePage3: routePage("pages/component/picker_view/time_picker/time_picker4/time_picker4").changePage, + change2Style: routePage("pages/component/picker_view/time_picker/time_picker9/time_picker9").changePage, + change2Display: routePage("pages/component/picker_view/time_picker/time_picker10/time_picker10").changePage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker1/time_picker1.css b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker1/time_picker1.css new file mode 100755 index 0000000..d1559a9 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker1/time_picker1.css @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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. + */ +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker1/time_picker1.hml b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker1/time_picker1.hml new file mode 100755 index 0000000..561c6e1 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker1/time_picker1.hml @@ -0,0 +1,31 @@ + + +
+ + + + + + + + + + hour为{{time1}} + + + minute值为{{time2}} + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker1/time_picker1.js b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker1/time_picker1.js new file mode 100755 index 0000000..e5dc348 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker1/time_picker1.js @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +export default { + data: { + time1: -1, + time2: -1 + }, + ...backPage("pages/component/picker_view/time_picker/indexEvent/index"), + getTime: function (e1) { + this.time1 = e1.hour; + this.time2 = e1.minute; + } +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker10/time_picker10.css b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker10/time_picker10.css new file mode 100755 index 0000000..d1559a9 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker10/time_picker10.css @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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. + */ +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker10/time_picker10.hml b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker10/time_picker10.hml new file mode 100755 index 0000000..2380de7 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker10/time_picker10.hml @@ -0,0 +1,31 @@ + + +
+ + + + + + + + + + show + + + 点击改状态 + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker10/time_picker10.js b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker10/time_picker10.js new file mode 100755 index 0000000..7406cdd --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker10/time_picker10.js @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +export default { + data: { + status: "flex" + }, + ...backPage("pages/component/picker_view/time_picker/indexStyle/index"), + changeStatus: function () { + if (this.status === "flex") { + this.status = "none"; + } else { + this.status = "flex"; + } + } +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker2/time_picker2.css b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker2/time_picker2.css new file mode 100755 index 0000000..f07e5b9 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker2/time_picker2.css @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2020 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. + */ +.stack { + left: 0px; + top: 0px; + width: 454px; + height: 454px; +} + +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker2/time_picker2.hml b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker2/time_picker2.hml new file mode 100755 index 0000000..a76e29d --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker2/time_picker2.hml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + {{text1}} + + + {{text2}} + + + {{text3}} + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker2/time_picker2.js b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker2/time_picker2.js new file mode 100755 index 0000000..5e8fdd2 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker2/time_picker2.js @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +export default { + data: { + text1: "背景色绿色", + text2: "left设置85", + text3: "top设置170" + }, + ...backPage("pages/component/picker_view/time_picker/indexStyle/index") +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker3/time_picker3.css b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker3/time_picker3.css new file mode 100755 index 0000000..d1559a9 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker3/time_picker3.css @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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. + */ +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker3/time_picker3.hml b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker3/time_picker3.hml new file mode 100755 index 0000000..15fd71b --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker3/time_picker3.hml @@ -0,0 +1,34 @@ + + +
+ + + + + + + + + + {{text1}} + + + {{text2}} + + + {{text3}} + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker3/time_picker3.js b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker3/time_picker3.js new file mode 100755 index 0000000..b94169d --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker3/time_picker3.js @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +export default { + data: { + text1: "margin左边距85", + text2: "margin上边距10", + text3: "宽高已设置" + }, + ...backPage("pages/component/picker_view/time_picker/indexStyle/index") +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker4/time_picker4.css b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker4/time_picker4.css new file mode 100755 index 0000000..06a7a5d --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker4/time_picker4.css @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2020 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. + */ diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker4/time_picker4.hml b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker4/time_picker4.hml new file mode 100755 index 0000000..c388f70 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker4/time_picker4.hml @@ -0,0 +1,27 @@ + + +
+ + + + + + + + + + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker4/time_picker4.js b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker4/time_picker4.js new file mode 100755 index 0000000..e7bb9d6 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker4/time_picker4.js @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2020 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. + */ +// time_picker4.js +import { backPage, routePage } from "../../../../../common/js/general"; +export default { + ...backPage("pages/component/picker_view/time_picker/indexStyle/index") +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker5/time_picker5.css b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker5/time_picker5.css new file mode 100755 index 0000000..d1559a9 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker5/time_picker5.css @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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. + */ +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker5/time_picker5.hml b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker5/time_picker5.hml new file mode 100755 index 0000000..071dd3d --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker5/time_picker5.hml @@ -0,0 +1,28 @@ + + +
+ + + + + + + + + + 默认值为0:0 + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker5/time_picker5.js b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker5/time_picker5.js new file mode 100755 index 0000000..d7af0e0 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker5/time_picker5.js @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +export default { + ...backPage("pages/component/picker_view/time_picker/indexAttr/index") +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker6/time_picker6.css b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker6/time_picker6.css new file mode 100755 index 0000000..d1559a9 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker6/time_picker6.css @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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. + */ +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker6/time_picker6.hml b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker6/time_picker6.hml new file mode 100755 index 0000000..3e040aa --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker6/time_picker6.hml @@ -0,0 +1,31 @@ + + +
+ + + + + + + + + + show + + + 点击改状态 + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker6/time_picker6.js b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker6/time_picker6.js new file mode 100755 index 0000000..a3f651e --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker6/time_picker6.js @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2020 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. + */ +// time_picker6.js +import { backPage, routePage } from "../../../../../common/js/general"; +import {changeStatus} from "../../../../../common/js/picker_view"; +export default { + data: { + status: true + }, + ...backPage("pages/component/picker_view/time_picker/indexAttr/index"), + changeStatus: changeStatus +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker7/time_picker7.css b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker7/time_picker7.css new file mode 100755 index 0000000..d1559a9 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker7/time_picker7.css @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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. + */ +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker7/time_picker7.hml b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker7/time_picker7.hml new file mode 100755 index 0000000..cc104fb --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker7/time_picker7.hml @@ -0,0 +1,31 @@ + + +
+ + + + + + + + + + show + + + 点击改状态 + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker7/time_picker7.js b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker7/time_picker7.js new file mode 100755 index 0000000..c4e6d2d --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker7/time_picker7.js @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2020 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. + */ +// time_picker7.js +import { backPage, routePage } from "../../../../../common/js/general"; +import {changeStatus} from "../../../../../common/js/picker_view"; +export default { + data: { + status: true + }, + ...backPage("pages/component/picker_view/time_picker/indexAttr/index"), + changeStatus: changeStatus +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker8/time_picker8.css b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker8/time_picker8.css new file mode 100755 index 0000000..d1559a9 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker8/time_picker8.css @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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. + */ +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker8/time_picker8.hml b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker8/time_picker8.hml new file mode 100755 index 0000000..da5cc54 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker8/time_picker8.hml @@ -0,0 +1,27 @@ + + +
+ + + + + + +
+ + +
+
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker8/time_picker8.js b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker8/time_picker8.js new file mode 100755 index 0000000..7a1a745 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker8/time_picker8.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +export default { + data: { + status: true, + forData: [0, 1] + }, + ...backPage("pages/component/picker_view/time_picker/indexAttr/index") +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker9/time_picker9.css b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker9/time_picker9.css new file mode 100755 index 0000000..b190771 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker9/time_picker9.css @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2020 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. + */ +.timePickStyle { + color:green; + font-size:30px; + font-family:HYQiHei-65S; + selected-color:#7ff708; + selected-font-size:38px; + selected-font-family:HYQiHei-65S; +} diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker9/time_picker9.hml b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker9/time_picker9.hml new file mode 100755 index 0000000..7a54a02 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker9/time_picker9.hml @@ -0,0 +1,25 @@ + + +
+ + + + + + + + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker9/time_picker9.js b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker9/time_picker9.js new file mode 100755 index 0000000..a5ce680 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/picker_view/time_picker/time_picker9/time_picker9.js @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2020 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. + */ +// time_picker9.js +import { backPage, routePage } from "../../../../../common/js/general"; +export default { + ...backPage("pages/component/picker_view/time_picker/indexStyle/index") +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/progress/circle/attr/attr.css b/examples/showcase/src/main/js/default/pages/component/progress/circle/attr/attr.css new file mode 100755 index 0000000..ca8b256 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/progress/circle/attr/attr.css @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2020 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. + */ +.list { + left: 85px; + top: 0px; + width: 280px; + height: 454px; +} + +.item-title { + width: 454px; + height: 80px; +} + +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.item-types { + width: 454px; + height: 80px; +} + +.whole-text { + margin-top:10px; + margin-left:70px; + width:200px; + height:60px; + font-size:30px; + color: red; +} + +.item-attribute { + width: 454px; + height: 100px; +} + +.attribute-div { + left: 0px; + top: 0px; + height: 100px; + width: 450px; + flex-direction: row; +} + +.text { + width: 140px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} + +.circle { + width:100px; + height:100px; + center-x:50px; + center-y:50px; + radius:50px; + start-angle:0; + total-angle:360; + stroke-width: 6px; + background-color: #8B8B7A; + color: #ff0000 +} + +.circle2 { + width:30px; + height:30px; + center-x:15px; + center-y:15px; + radius:15px; + start-angle:0; + total-angle:360; + stroke-width: 6px; + background-color: #8B8B7A; + color: #ff0000 +} diff --git a/examples/showcase/src/main/js/default/pages/component/progress/circle/attr/attr.hml b/examples/showcase/src/main/js/default/pages/component/progress/circle/attr/attr.hml new file mode 100755 index 0000000..25a38ab --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/progress/circle/attr/attr.hml @@ -0,0 +1,71 @@ + + + + + + + + + + + + + 通用属性 + + + + +
+ + +
+
+ + + + + +
+ + +
+
+ + + + + +
+ for 3次,点击修改display + +
+
+ + + + 特有属性 + + + + +
+ percent + +
+
+ + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/progress/circle/attr/attr.js b/examples/showcase/src/main/js/default/pages/component/progress/circle/attr/attr.js new file mode 100755 index 0000000..089661f --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/progress/circle/attr/attr.js @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2020 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 {goPage,routePage} from "../../../../../common/js/general"; +import {changeStatus, changeStatusIf, changeDisplay} from "../../../../../common/js/progress" +export default { + data: { + showStatus: true, + ifStatus: true, + percentAttribute: 20, + loopArray: ["1", "2", "3"], + p01: "p01", + display: "flex" + }, + ...goPage("pages/component/progress/circle/index/index"), + changePercent() { + this.percentAttribute = this.percentAttribute + 10; + }, + changeStatus() { + if (this.showStatus == true) { + this.showStatus = false; + } else { + this.showStatus = true; + } + }, + changeStatusIf: changeStatusIf, + changeDisplay: changeDisplay +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/progress/circle/event/event.css b/examples/showcase/src/main/js/default/pages/component/progress/circle/event/event.css new file mode 100755 index 0000000..31e480e --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/progress/circle/event/event.css @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2020 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. + */ +.list { + left: 0px; + top: 0px; + width: 454px; + height: 454px; +} + +.item-title { + width: 454px; + height: 80px; +} + +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.item-types { + width: 454px; + height: 80px; +} + +.whole-text { + margin-top:10px; + margin-left:150px; + width:200px; + height:60px; + font-size:30px; + color: red; +} + +.circle { + width:100px; + height:100px; + center-x:50px; + center-y:50px; + radius:50px; + start-angle:0; + total-angle:360; +} + +.item-click { + width: 454px; + height: 200px; +} + +.click-div { + width: 450px; + height: 200px; + top: 0px; + left: 0px; +} + +.click-left-div { + width: 200px; + height: 200px; + margin-top: 30px; + margin-left: 0px; + flex-direction: column; +} + +.click-right-div { + width: 250px; + height: 200px; + top: 0px; + left: 0px; + flex-direction: column; +} + +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} + +.text2 { + width: 200px; + height: 100px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; + text-overflow: ellipsis; +} diff --git a/examples/showcase/src/main/js/default/pages/component/progress/circle/event/event.hml b/examples/showcase/src/main/js/default/pages/component/progress/circle/event/event.hml new file mode 100755 index 0000000..e36f0c7 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/progress/circle/event/event.hml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + 通用事件 + + + + +
+
+ click + longpress + swipe +
+
+ + {{value}} +
+
+
+ + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/progress/circle/event/event.js b/examples/showcase/src/main/js/default/pages/component/progress/circle/event/event.js new file mode 100755 index 0000000..70eca1f --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/progress/circle/event/event.js @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2020 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 {goPage, routePage} from "../../../../../common/js/general"; +import {clickEvent, longpressEvent, swipeEvent} from "../../../../../common/js/progress"; +export default { + data: { + percent: 20, + value: "点击/长按/滑动" + }, + ...goPage("pages/component/progress/circle/index/index"), + clickEvent: clickEvent, + longpressEvent: longpressEvent, + swipeEvent: swipeEvent +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/progress/circle/index/index.css b/examples/showcase/src/main/js/default/pages/component/progress/circle/index/index.css new file mode 100755 index 0000000..98b49f6 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/progress/circle/index/index.css @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2020 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. + */ +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.titleContainerStyle { + width: 454px; + height: 70px; +} + +.titleTextStyle { + width: 454px; + height: 50px; + margin-left: 130px; + margin-top: 0px; +} + +.buttonContainerStyle { + width: 454px; + height: 80px; +} + +.buttonStyle { + width: 200px; + height: 60px; + margin-left: 130px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/progress/circle/index/index.hml b/examples/showcase/src/main/js/default/pages/component/progress/circle/index/index.hml new file mode 100755 index 0000000..bf99430 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/progress/circle/index/index.hml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + 环形progress + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/progress/circle/index/index.js b/examples/showcase/src/main/js/default/pages/component/progress/circle/index/index.js new file mode 100755 index 0000000..befce2b --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/progress/circle/index/index.js @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../../common/js/general"; +export default { + ...backPage("pages/component/progress/index/index"), + changePage1: routePage("pages/component/progress/circle/attr/attr").changePage, + changePage2: routePage("pages/component/progress/circle/style/style").changePage, + changePage3: routePage("pages/component/progress/circle/event/event").changePage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/progress/circle/style/style.css b/examples/showcase/src/main/js/default/pages/component/progress/circle/style/style.css new file mode 100755 index 0000000..af25384 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/progress/circle/style/style.css @@ -0,0 +1,159 @@ +/* + * Copyright (c) 2020 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. + */ +.list { + left: 0px; + top: 0px; + width: 454px; + height: 454px; +} + +.item-title { + width: 454px; + height: 80px; +} + +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.item-types { + width: 454px; + height: 80px; +} + +.whole-text { + margin-top:10px; + margin-left:150px; + width:200px; + height:60px; + font-size:30px; + color: red; +} + +.item-three { + width: 450px; + height: 220px; +} + +.three-div { + width: 450px; + height: 200px; + left: 0px; + top: 0px; +} + +.three-left-div { + width: 240px; + height: 200px; + left: 0px; + top: 0px; + flex-direction: column; +} + +.three-right-div { + width: 230px; + height: 210px; + top: 40px; + left: 0px; +} + +.general-stack { + top: 50px; + left: 2px; + width: 250px; + height: 150px; +} + +.general-item { + width:130px; + height:130px; + center-x:50px; + center-y:50px; + radius:50px; + start-angle:0; + total-angle:120; + left:20px; + top:20px; + background-color: #ff0000; + stroke-width: 16px; +} + +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} + +.margin-show { + margin: 20px; + width: 70px; + height: 70px; + center-x:35px; + center-y:35px; + start-angle:0; + total-angle:360; + radius:35px; + stroke-width: 5px; +} + +.border-show { + border-width: 5px; + border-color: #0000ff; + border-radius:5px; + padding:10px; + center-x:65px; + center-y:65px; + start-angle:0; + total-angle:360; + radius:50px; + width: 130px; + height: 130px; + margin-top: 10px; + margin-left: 10px; + stroke-width: 16px; +} + +.special-style { + center-x:50px; + center-y:50px; + start-angle:10; + total-angle:180; + radius:50px; + width: 100px; + height: 100px; + color: #ff0000; + stroke-width: 16px; + margin-left: 20px; + margin-top: 10px; +} + +.two-right-div { + width: 230px; + height: 150px; + top: 40px; + left: 0px; +} + +.two-left-div { + width: 220px; + height: 150px; + left: 0px; + top: 0px; + flex-direction: column; +} diff --git a/examples/showcase/src/main/js/default/pages/component/progress/circle/style/style.hml b/examples/showcase/src/main/js/default/pages/component/progress/circle/style/style.hml new file mode 100755 index 0000000..a881c92 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/progress/circle/style/style.hml @@ -0,0 +1,113 @@ + + + + + + + + + + + + + 通用样式 + + + + +
+
+ 背景 + left为20 + top为20 +
+ + + +
+
+ + + +
+
+ margin 20 + height 70 + width 70 +
+
+ +
+
+ +
+
+
+ + + +
+ margin + left 20 + top 20 + right 20 + buttom 20 +
+ +
+
+ +
+
+
+ + + +
+
+ border + padding +
+
+ +
+
+
+ + + + 特有样式 + + + + +
+
+ color + stroke-width +
+
+ +
+
+
+ + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/progress/circle/style/style.js b/examples/showcase/src/main/js/default/pages/component/progress/circle/style/style.js new file mode 100755 index 0000000..17da017 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/progress/circle/style/style.js @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2020 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 {goPage,routePage} from "../../../../../common/js/general"; +export default { + ...goPage("pages/component/progress/circle/index/index") +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/progress/horizontal/attr/attr.css b/examples/showcase/src/main/js/default/pages/component/progress/horizontal/attr/attr.css new file mode 100755 index 0000000..0ce4fa4 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/progress/horizontal/attr/attr.css @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2020 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. + */ +.list { + left: 0px; + top: 0px; + width: 454px; + height: 454px; +} + +.item-title { + width: 454px; + height: 80px; +} + +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.item-types { + width: 454px; + height: 80px; +} + +.whole-text { + margin-top:10px; + margin-left:150px; + width:200px; + height:60px; + font-size:30px; + color: red; +} + +.horizontal-progress { + margin-left: 10px; + margin-top: 10px; + width: 100px; + height: 100px; + stroke-width: 5px; +} + +.item-attribute { + width: 450px; + height: 100px; +} + +.attribute-div { + left: 0px; + top: 0px; + height: 100px; + width: 450px; + flex-direction: row; +} + +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} + +.left-text { + margin-left: 10px; + margin-top: 10px; + width: 250px; + height: 50px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/progress/horizontal/attr/attr.hml b/examples/showcase/src/main/js/default/pages/component/progress/horizontal/attr/attr.hml new file mode 100755 index 0000000..cb8a7ed --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/progress/horizontal/attr/attr.hml @@ -0,0 +1,61 @@ + + + + + + + + + + + + + 通用属性 + + + + + + + + + + + + +
+ for +
+ +
+
+
+ + + + 特有属性 + + + + +
+ percent + +
+
+ + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/progress/horizontal/attr/attr.js b/examples/showcase/src/main/js/default/pages/component/progress/horizontal/attr/attr.js new file mode 100755 index 0000000..3be42ce --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/progress/horizontal/attr/attr.js @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2020 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 {goPage,routePage} from "../../../../../common/js/general"; +import {changeStatus, changeStatusIf} from "../../../../../common/js/progress" +export default { + data: { + listData: ["a", "b"], + status: true, + ifStatus:true, + show: 20 + }, + ...goPage("pages/component/progress/horizontal/index/index"), + changeStatus: changeStatus, + changeStatusIf: changeStatusIf +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/progress/horizontal/event/event.css b/examples/showcase/src/main/js/default/pages/component/progress/horizontal/event/event.css new file mode 100755 index 0000000..d5ea060 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/progress/horizontal/event/event.css @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2020 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. + */ +.list { + left: 0px; + top: 0px; + width: 454px; + height: 454px; +} + +.item-title { + width: 454px; + height: 80px; +} + +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.item-types { + width: 454px; + height: 80px; +} + +.whole-text { + margin-top:10px; + margin-left:150px; + width:200px; + height:60px; + font-size:30px; + color: red; +} + +.horizontal-progress { + margin-left: 10px; + margin-top: 10px; + width: 100px; + height: 100px; + stroke-width: 5px; +} + +.item-click { + width: 450px; + height: 200px; +} + +.click-div { + width: 450px; + height: 200px; + top: 0px; + left: 0px; +} + +.click-left-div { + width: 200px; + height: 200px; + margin-top: 30px; + margin-left: 0px; + flex-direction: column; +} + +.click-right-div { + width: 250px; + height: 200px; + top: 0px; + left: 0px; + flex-direction: column; +} + +.text { + width: 220px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} + +.text2 { + width: 220px; + height: 100px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; + text-overflow: ellipsis; +} diff --git a/examples/showcase/src/main/js/default/pages/component/progress/horizontal/event/event.hml b/examples/showcase/src/main/js/default/pages/component/progress/horizontal/event/event.hml new file mode 100755 index 0000000..0e09e45 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/progress/horizontal/event/event.hml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + 通用事件 + + + + +
+
+ click + longpress + swipe +
+
+ + {{value}} +
+
+
+ + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/progress/horizontal/event/event.js b/examples/showcase/src/main/js/default/pages/component/progress/horizontal/event/event.js new file mode 100755 index 0000000..2e7413a --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/progress/horizontal/event/event.js @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2020 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 {goPage,routePage} from "../../../../../common/js/general"; +import {clickEvent, longpressEvent, swipeEvent} from "../../../../../common/js/progress"; +export default { + data: { + percent: 20, + value: "点击/长按/滑动" + }, + ...goPage("pages/component/progress/horizontal/index/index"), + clickEvent: clickEvent, + longpressEvent: longpressEvent, + swipeEvent: swipeEvent +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/progress/horizontal/index/index.css b/examples/showcase/src/main/js/default/pages/component/progress/horizontal/index/index.css new file mode 100755 index 0000000..98b49f6 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/progress/horizontal/index/index.css @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2020 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. + */ +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.titleContainerStyle { + width: 454px; + height: 70px; +} + +.titleTextStyle { + width: 454px; + height: 50px; + margin-left: 130px; + margin-top: 0px; +} + +.buttonContainerStyle { + width: 454px; + height: 80px; +} + +.buttonStyle { + width: 200px; + height: 60px; + margin-left: 130px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/progress/horizontal/index/index.hml b/examples/showcase/src/main/js/default/pages/component/progress/horizontal/index/index.hml new file mode 100755 index 0000000..90cc8d5 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/progress/horizontal/index/index.hml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + 水平progress + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/progress/horizontal/index/index.js b/examples/showcase/src/main/js/default/pages/component/progress/horizontal/index/index.js new file mode 100755 index 0000000..d5eb5f3 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/progress/horizontal/index/index.js @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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 {backPage,routePage} from "../../../../../common/js/general"; +export default { + ...backPage("pages/component/progress/index/index"), + changePage1: routePage("pages/component/progress/horizontal/attr/attr").changePage, + changePage2: routePage("pages/component/progress/horizontal/style/style").changePage, + changePage3: routePage("pages/component/progress/horizontal/event/event").changePage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/progress/horizontal/style/style.css b/examples/showcase/src/main/js/default/pages/component/progress/horizontal/style/style.css new file mode 100755 index 0000000..c56ea35 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/progress/horizontal/style/style.css @@ -0,0 +1,159 @@ +/* + * Copyright (c) 2020 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. + */ +.list { + left: 0px; + top: 0px; + width: 454px; + height: 454px; +} + +.item-title { + width: 454px; + height: 80px; +} + +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.item-types { + width: 454px; + height: 80px; +} + +.whole-text { + margin-top:10px; + margin-left:150px; + width:200px; + height:60px; + font-size:30px; + color: red; +} + +.item-three { + width: 450px; + height: 200px; +} + +.three-div { + width: 450px; + height: 200px; + left: 0px; + top: 0px; +} + +.three-left-div { + width: 220px; + height: 200px; + left: 0px; + top: 0px; + flex-direction: column; +} + +.three-right-div { + width: 230px; + height: 190px; + top: 40px; + left: 0px; +} + +.general-stack { + top: 50px; + left: 2px; + width: 250px; + height: 150px; + background-color: springgreen; +} + +.general-item { + top: 50px; + left: 50px; + width: 130px; + height: 50px; + background-color: red; + stroke-width:5px; +} + +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} + +.margin-show { + margin: 40px; + height: 40px; + width: 100px; +} + +.border-show { + margin-top: 10px; + margin-left: 10px; + border-width: 5px; + border-radius: 5px; + border-color: #0000ff; + padding: 10px; + width: 100px; + height: 10px; + stroke-width: 10px; +} + +.special-style { + color: red; + stroke-width: 10px; + margin-left: 40px; + margin-right: 10px; + width:100px; + height: 40px; +} + +.item-two { + width: 450px; + height: 150px; +} + +.two-right-div { + width: 230px; + height: 150px; + top: 40px; + left: 0px; +} + +.two-left-div { + width: 220px; + height: 150px; + left: 0px; + top: 0px; + flex-direction: column; +} + +.two-div { + width: 450px; + height: 150px; + left: 0px; + top: 0px; +} + +.style-right-div { + width: 250px; + height: 200px; + left:10px; + top:10px; + flex-direction: column; +} diff --git a/examples/showcase/src/main/js/default/pages/component/progress/horizontal/style/style.hml b/examples/showcase/src/main/js/default/pages/component/progress/horizontal/style/style.hml new file mode 100755 index 0000000..d6d4514 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/progress/horizontal/style/style.hml @@ -0,0 +1,101 @@ + + + + + + + + + + + + + 通用样式 + + + + +
+
+ 背景 + left为50 + top为50 +
+ + + +
+
+ + + +
+
+ margin + height + width +
+
+ +
+
+
+ + + +
+
+ border + padding +
+
+ +
+
+
+ + + +
+
+ +
+
+ +
+
+
+ + + + 特有样式 + + + + +
+
+ color + stroke-width +
+
+ +
+
+
+ + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/progress/horizontal/style/style.js b/examples/showcase/src/main/js/default/pages/component/progress/horizontal/style/style.js new file mode 100755 index 0000000..bcac2ca --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/progress/horizontal/style/style.js @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2020 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 {goPage,routePage} from "../../../../../common/js/general"; +var displayData = ["flex", "none"]; +export default { + changeDisplay: function () { + if (this.status == true) { + this.displayValue = displayData[1]; + this.status = false; + } else { + this.displayValue = displayData[0]; + this.status = true; + } + }, + data: { + status: true, + displayValue: displayData[0] + }, + ...goPage("pages/component/progress/horizontal/index/index") +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/progress/index/index.css b/examples/showcase/src/main/js/default/pages/component/progress/index/index.css new file mode 100755 index 0000000..dac1e64 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/progress/index/index.css @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2020 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. + */ +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.input-item { + width: 454px; + height: 100px; +} + +.input-button { + width: 220px; + height: 60px; + margin-left: 120px; +} + +.list { + left: 0px; + top: 0px; + width: 454px; + height: 454px; +} + +.item-title { + width: 454px; + height: 80px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/progress/index/index.hml b/examples/showcase/src/main/js/default/pages/component/progress/index/index.hml new file mode 100755 index 0000000..4beab7f --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/progress/index/index.hml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/progress/index/index.js b/examples/showcase/src/main/js/default/pages/component/progress/index/index.js new file mode 100755 index 0000000..0eecd8d --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/progress/index/index.js @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2020 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 {goPage, routePage} from "../../../../common/js/general"; +export default { + ...goPage("pages/component/index/baseIndex/index"), + changeCircle: routePage("pages/component/progress/circle/index/index").changePage, + changeHorizontal: routePage("pages/component/progress/horizontal/index/index").changePage, +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/slider/attr/attr.css b/examples/showcase/src/main/js/default/pages/component/slider/attr/attr.css new file mode 100755 index 0000000..9d989fd --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/slider/attr/attr.css @@ -0,0 +1,117 @@ +/* + * Copyright (c) 2020 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. + */ +.list { + left: 0px; + top: 0px; + width: 454px; + height: 454px; +} + +.item-title { + width: 454px; + height: 80px; +} + +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.item-two { + width: 450px; + height: 150px; +} + +.two-div { + width: 450px; + height: 150px; + left: 0px; + top: 0px; +} + +.two-left-div { + width: 220px; + height: 150px; + left: 0px; + top: 0px; + flex-direction: column; +} + +.two-right-div { + width: 230px; + height: 150px; + top: 40px; + left: 0px; +} + +.item-three { + width: 450px; + height: 200px; +} + +.three-div { + width: 450px; + height: 200px; + left: 0px; + top: 0px; +} + +.three-left-div { + width: 220px; + height: 200px; + left: 0px; + top: 0px; + flex-direction: column; +} + +.three-right-div { + width: 230px; + height: 190px; + top: 40px; + left: 0px; +} + +.slider { + margin-left: 20px; + margin-top: 20px; + width: 100px; + height: 20px; + block-color: blue; + selected-color: #ff0000; + color: #00ff00; +} + +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} + +.item-types { + width: 454px; + height: 80px; +} + +.whole-text { + margin-top:10px; + margin-left:150px; + width:200px; + height:60px; + font-size:30px; + color: red; +} diff --git a/examples/showcase/src/main/js/default/pages/component/slider/attr/attr.hml b/examples/showcase/src/main/js/default/pages/component/slider/attr/attr.hml new file mode 100755 index 0000000..26ac273 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/slider/attr/attr.hml @@ -0,0 +1,96 @@ + + + + + + + + + + + + + 通用属性 + + + + +
+
+ show +
+
+ + +
+
+
+ +
+
+ display +
+
+ + +
+
+
+ +
+
+ if +
+
+ + +
+
+
+ +
+
+ for +
+
+ + +
+
+
+ + + + 特有属性 + + + + +
+
+ min为10 + max为80 + value为40 +
+
+ + {{slideValue}} +
+
+
+ + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/slider/attr/attr.js b/examples/showcase/src/main/js/default/pages/component/slider/attr/attr.js new file mode 100755 index 0000000..ca4378c --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/slider/attr/attr.js @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2020 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 {goPage, routePage} from "../../../../common/js/general"; +export default { + data: { + slideValue: "值:"+"40", + status: true, + sliders:[1,2], + isDisplay:'flex', + ifStatus:true + }, + ...goPage("pages/component/slider/index/index"), + slideEvent(value) { + this.slideValue = "值:"+value.progress; + }, + changeStatus: function () { + if (this.status == true) { + this.status = false; + } else { + this.status = true; + } + }, + changeIfStatus:function(){ + if(this.ifStatus == true){ + this.ifStatus = false; + } else if(this.ifStatus == false){ + this.ifStatus = true; + } + }, + changeDisplay:function(){ + if(this.isDisplay == 'flex'){ + this.isDisplay = 'none'; + } else if(this.isDisplay == 'none'){ + this.isDisplay = 'flex'; + } + } +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/slider/event/event.css b/examples/showcase/src/main/js/default/pages/component/slider/event/event.css new file mode 100755 index 0000000..304ad87 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/slider/event/event.css @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2020 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. + */ +.list { + left: 0px; + top: 0px; + width: 454px; + height: 454px; +} + +.item-title { + width: 454px; + height: 80px; +} + +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.item-two { + width: 450px; + height: 300px; +} + +.two-div { + width: 450px; + height: 300px; + left: 0px; + top: 0px; +} + +.two-left-div { + width: 220px; + height: 300px; + left: 0px; + top: 0px; + flex-direction: column; +} + +.three-right-div { + width: 230px; + height: 300px; + top: 40px; + left: 0px; +} + +.slider { + margin-left: 20px; + margin-top: 20px; + width: 100px; + height: 20px; +} + +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} + +.text2 { + width: 200px; + height: 100px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} + +.item-types { + width: 454px; + height: 80px; +} + +.whole-text { + margin-top:10px; + margin-left:150px; + width:200px; + height:60px; + font-size:30px; + color: red; +} diff --git a/examples/showcase/src/main/js/default/pages/component/slider/event/event.hml b/examples/showcase/src/main/js/default/pages/component/slider/event/event.hml new file mode 100755 index 0000000..f78018d --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/slider/event/event.hml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + 特殊事件 + + + + +
+
+ click + change + swipe +
+
+ + {{name}} + + {{changename}} + + {{swipename}} +
+
+
+ + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/slider/event/event.js b/examples/showcase/src/main/js/default/pages/component/slider/event/event.js new file mode 100755 index 0000000..6c94ba1 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/slider/event/event.js @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2020 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 {goPage,routePage} from "../../../../common/js/general"; +export default { + data: { + name: "触发click事件", + changename:"触发change事件", + swipename: "触发swipe事件", + }, + ...goPage("pages/component/slider/index/index"), + clickEvent() { + this.name = "click被触发"; + }, + changeEvent(value) { + this.changename = "change:" + value.progress; + }, + swipeEvent(e) { + this.swipename = "swipe方向:" + e.direction; + } +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/slider/index/index.css b/examples/showcase/src/main/js/default/pages/component/slider/index/index.css new file mode 100755 index 0000000..0af4319 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/slider/index/index.css @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2020 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. + */ +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.titleContainerStyle { + width: 454px; + height: 70px; +} + +.titleTextStyle { + width: 454px; + height: 50px; + margin-left: 180px; + margin-top: 0px; +} + +.buttonContainerStyle { + width: 454px; + height: 80px; +} + +.buttonStyle { + width: 200px; + height: 60px; + margin-left: 130px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/slider/index/index.hml b/examples/showcase/src/main/js/default/pages/component/slider/index/index.hml new file mode 100755 index 0000000..241bb40 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/slider/index/index.hml @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + slider + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/slider/index/index.js b/examples/showcase/src/main/js/default/pages/component/slider/index/index.js new file mode 100755 index 0000000..1b3a746 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/slider/index/index.js @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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 {backPage,routePage} from "../../../../common/js/general"; +export default { + ...backPage("pages/component/index/formIndex/index"), + changePage1: routePage("pages/component/slider/attr/attr").changePage, + changePage2: routePage("pages/component/slider/style/style").changePage, + changePage3: routePage("pages/component/slider/event/event").changePage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/slider/style/style.css b/examples/showcase/src/main/js/default/pages/component/slider/style/style.css new file mode 100755 index 0000000..3e9e29b --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/slider/style/style.css @@ -0,0 +1,157 @@ +/* + * Copyright (c) 2020 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. + */ +.list { + left: 0px; + top: 0px; + width: 454px; + height: 454px; +} + +.item-title { + width: 454px; + height: 80px; +} + +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.item-two { + width: 450px; + height: 150px; +} + +.two-div { + width: 450px; + height: 150px; + left: 0px; + top: 0px; +} + +.two-left-div { + width: 220px; + height: 150px; + left: 0px; + top: 0px; + flex-direction: column; +} + +.two-right-div { + width: 230px; + height: 150px; + top: 40px; + left: 0px; +} + +.item-three { + width: 450px; + height: 200px; +} + +.three-div { + width: 450px; + height: 200px; + left: 0px; + top: 0px; +} + +.three-left-div { + width: 220px; + height: 200px; + left: 0px; + top: 0px; + flex-direction: column; +} + +.three-right-div { + width: 230px; + height: 190px; + top: 40px; + left: 0px; +} + +.slider { + margin-left: 20px; + margin-top: 20px; + width: 100px; + height: 20px; +} + +.general-stack { + width: 200px; + height: 170px; + top: 0px; + left: 0px; + background-color: springgreen; +} + +.general-item { + left: 50px; + background-color: red; + top: 50px; + width: 100px; + height: 100px; +} + +.margin-show { + margin: 20px; + height: 10px; + width: 100px; +} + +.border-show { + border-width: 5px; + border-radius: 5px; + border-color: #0000ff; + padding: 10px; + width: 100px; + height: 32px; + margin-left: 20px; + background-color: red; +} + +.special-style { + margin-top: 10px; + margin-left: 20px; + width: 100px; + height: 20px; + color: red; + selected-color: springgreen; + block-color: blue; +} + +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} + +.item-types { + width: 454px; + height: 80px; +} + +.whole-text { + margin-top:10px; + margin-left:150px; + width:200px; + height:60px; + font-size:30px; + color: red; +} diff --git a/examples/showcase/src/main/js/default/pages/component/slider/style/style.hml b/examples/showcase/src/main/js/default/pages/component/slider/style/style.hml new file mode 100755 index 0000000..3e9a0bd --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/slider/style/style.hml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + 通用样式 + + + + +
+
+ 背景 + left为50 + top为50 +
+ + + +
+
+ + + +
+
+ margin + height + width +
+
+ +
+
+
+ + + +
+
+ border + padding +
+
+ +
+
+
+ + + + 特有样式 + + + + +
+
+ color为red + select-color + block-color +
+
+ +
+
+
+ + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/slider/style/style.js b/examples/showcase/src/main/js/default/pages/component/slider/style/style.js new file mode 100755 index 0000000..2838e37 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/slider/style/style.js @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2020 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 {goPage,routePage} from "../../../../common/js/general"; +export default { + ...goPage("pages/component/slider/index/index") +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/stack/index/index.css b/examples/showcase/src/main/js/default/pages/component/stack/index/index.css new file mode 100755 index 0000000..0af4319 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/stack/index/index.css @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2020 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. + */ +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.titleContainerStyle { + width: 454px; + height: 70px; +} + +.titleTextStyle { + width: 454px; + height: 50px; + margin-left: 180px; + margin-top: 0px; +} + +.buttonContainerStyle { + width: 454px; + height: 80px; +} + +.buttonStyle { + width: 200px; + height: 60px; + margin-left: 130px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/stack/index/index.hml b/examples/showcase/src/main/js/default/pages/component/stack/index/index.hml new file mode 100755 index 0000000..de020d4 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/stack/index/index.hml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + stack + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/stack/index/index.js b/examples/showcase/src/main/js/default/pages/component/stack/index/index.js new file mode 100755 index 0000000..1b39ea7 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/stack/index/index.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../common/js/general"; +export default { + ...backPage("pages/component/index/containerIndex/index"), + changePage1: routePage("pages/component/stack/indexAttr/index").changePage, + changePage2: routePage("pages/component/stack/indexStyle/index").changePage, + changePage3: routePage("pages/component/stack/indexEvent/index").changePage, + changePage4: routePage("pages/component/stack/indexEffect/index").changePage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/stack/indexAttr/index.css b/examples/showcase/src/main/js/default/pages/component/stack/indexAttr/index.css new file mode 100755 index 0000000..60569ee --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/stack/indexAttr/index.css @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2020 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. + */ +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.titleContainerStyle { + width: 454px; + height: 70px; +} + +.titleTextStyle { + width: 454px; + height: 50px; + margin-left: 170px; + margin-top: 0px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/stack/indexAttr/index.hml b/examples/showcase/src/main/js/default/pages/component/stack/indexAttr/index.hml new file mode 100755 index 0000000..57fe3dd --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/stack/indexAttr/index.hml @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + 通用属性 + + + + + + + + show + + + + + + + + + for + + + + + + + + + if + + + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/stack/indexAttr/index.js b/examples/showcase/src/main/js/default/pages/component/stack/indexAttr/index.js new file mode 100755 index 0000000..81d7d07 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/stack/indexAttr/index.js @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../common/js/general"; +export default { + ...backPage("pages/component/stack/index/index"), + changePage1: routePage("pages/component/stack/stack6/stack6").changePage, + changePage2: routePage("pages/component/stack/stack7/stack7").changePage, + changePage3: routePage("pages/component/stack/stack8/stack8").changePage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/stack/indexEffect/index.css b/examples/showcase/src/main/js/default/pages/component/stack/indexEffect/index.css new file mode 100755 index 0000000..60569ee --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/stack/indexEffect/index.css @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2020 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. + */ +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.titleContainerStyle { + width: 454px; + height: 70px; +} + +.titleTextStyle { + width: 454px; + height: 50px; + margin-left: 170px; + margin-top: 0px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/stack/indexEffect/index.hml b/examples/showcase/src/main/js/default/pages/component/stack/indexEffect/index.hml new file mode 100755 index 0000000..b6da5d3 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/stack/indexEffect/index.hml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + 特有效果 + + + + + + + + stack中组件设置position + + + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/stack/indexEffect/index.js b/examples/showcase/src/main/js/default/pages/component/stack/indexEffect/index.js new file mode 100755 index 0000000..2ac80c1 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/stack/indexEffect/index.js @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../common/js/general"; +export default { + ...backPage("pages/component/stack/index/index"), + changePage1: routePage("pages/component/stack/stack5/stack5").changePage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/stack/indexEvent/index.css b/examples/showcase/src/main/js/default/pages/component/stack/indexEvent/index.css new file mode 100755 index 0000000..60569ee --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/stack/indexEvent/index.css @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2020 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. + */ +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.titleContainerStyle { + width: 454px; + height: 70px; +} + +.titleTextStyle { + width: 454px; + height: 50px; + margin-left: 170px; + margin-top: 0px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/stack/indexEvent/index.hml b/examples/showcase/src/main/js/default/pages/component/stack/indexEvent/index.hml new file mode 100755 index 0000000..866d33b --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/stack/indexEvent/index.hml @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + 通用事件 + + + + + + + + click + + + longpress + + + swipe + + + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/stack/indexEvent/index.js b/examples/showcase/src/main/js/default/pages/component/stack/indexEvent/index.js new file mode 100755 index 0000000..db99260 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/stack/indexEvent/index.js @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../common/js/general"; +export default { + ...backPage("pages/component/stack/index/index"), + changePage1: routePage("pages/component/stack/stack1/stack1").changePage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/stack/indexStyle/index.css b/examples/showcase/src/main/js/default/pages/component/stack/indexStyle/index.css new file mode 100755 index 0000000..60569ee --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/stack/indexStyle/index.css @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2020 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. + */ +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.titleContainerStyle { + width: 454px; + height: 70px; +} + +.titleTextStyle { + width: 454px; + height: 50px; + margin-left: 170px; + margin-top: 0px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/stack/indexStyle/index.hml b/examples/showcase/src/main/js/default/pages/component/stack/indexStyle/index.hml new file mode 100755 index 0000000..8b419ba --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/stack/indexStyle/index.hml @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + 通用样式 + + + + + + + + 背景色 + + + left + + + top + + + + + + + + + + + margin + + + height + + + width + + + + + + + + + + + border + + + padding + + + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/stack/indexStyle/index.js b/examples/showcase/src/main/js/default/pages/component/stack/indexStyle/index.js new file mode 100755 index 0000000..c96e6d8 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/stack/indexStyle/index.js @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../common/js/general"; +export default { + ...backPage("pages/component/stack/index/index"), + changePage1: routePage("pages/component/stack/stack2/stack2").changePage, + changePage2: routePage("pages/component/stack/stack3/stack3").changePage, + changePage3: routePage("pages/component/stack/stack4/stack4").changePage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/stack/stack1/stack1.css b/examples/showcase/src/main/js/default/pages/component/stack/stack1/stack1.css new file mode 100755 index 0000000..d1559a9 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/stack/stack1/stack1.css @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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. + */ +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/stack/stack1/stack1.hml b/examples/showcase/src/main/js/default/pages/component/stack/stack1/stack1.hml new file mode 100755 index 0000000..986ee03 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/stack/stack1/stack1.hml @@ -0,0 +1,37 @@ + + +
+ + + + + + + + + 操作stack触发事件 + + + + {{text1}} + + + {{text2}} + + + {{text3}} + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/stack/stack1/stack1.js b/examples/showcase/src/main/js/default/pages/component/stack/stack1/stack1.js new file mode 100755 index 0000000..c514815 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/stack/stack1/stack1.js @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../common/js/general"; +export default { + data: { + text1: "点击事件未触发", + text2: "长按事件未触发", + text3: "swipe事件未触发", + }, + ...backPage("pages/component/stack/indexEvent/index"), + clickFunc: function () { + this.text1 = "点击事件已触发"; + }, + longpressFunc: function () { + this.text2 = "长按事件已触发"; + }, + stackswipe: function (e) { + this.text3 = "swipe方向:" + e.direction; + } +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/stack/stack2/stack2.css b/examples/showcase/src/main/js/default/pages/component/stack/stack2/stack2.css new file mode 100755 index 0000000..f07e5b9 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/stack/stack2/stack2.css @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2020 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. + */ +.stack { + left: 0px; + top: 0px; + width: 454px; + height: 454px; +} + +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/stack/stack2/stack2.hml b/examples/showcase/src/main/js/default/pages/component/stack/stack2/stack2.hml new file mode 100755 index 0000000..aabc4bd --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/stack/stack2/stack2.hml @@ -0,0 +1,37 @@ + + + + + + + + + + + + stack已设置样式 + + + + {{text1}} + + + {{text2}} + + + {{text3}} + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/stack/stack2/stack2.js b/examples/showcase/src/main/js/default/pages/component/stack/stack2/stack2.js new file mode 100755 index 0000000..481863a --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/stack/stack2/stack2.js @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../common/js/general"; +export default { + data: { + text1: "背景色绿色", + text2: "left设置85", + text3: "top设置170" + }, + ...backPage("pages/component/stack/indexStyle/index") +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/stack/stack3/stack3.css b/examples/showcase/src/main/js/default/pages/component/stack/stack3/stack3.css new file mode 100755 index 0000000..920908f --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/stack/stack3/stack3.css @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2020 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. + */ +.text { + width: 280px; + height: 50px; + font-size: 30px; +} + +.item { + width: 280px; + height: 50px; +} + +.div1 { + height: 145px; + width: 160px; + border-width: 1px; + border-color: #ff0000; +} + +.div2 { + width: 120px; + height: 50px; + background-color: #00ff00; +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/stack/stack3/stack3.hml b/examples/showcase/src/main/js/default/pages/component/stack/stack3/stack3.hml new file mode 100755 index 0000000..18c5116 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/stack/stack3/stack3.hml @@ -0,0 +1,66 @@ + + +
+ + + + + + +
+
+ + + stack1 + + +
+
+ + + stack2 + + +
+
+ + + + 宽100px;高50px + + + + + stack1左边距100px + + + + + stack1上边距20px + + + + + stack2右边距20px + + + + + stack2下边距20px + + + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/stack/stack3/stack3.js b/examples/showcase/src/main/js/default/pages/component/stack/stack3/stack3.js new file mode 100755 index 0000000..8b37718 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/stack/stack3/stack3.js @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../common/js/general"; +export default { + data: { + text1: "margin左边距85", + text2: "margin上边距10", + text3: "宽高已设置" + }, + ...backPage("pages/component/stack/indexStyle/index") +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/stack/stack4/stack4.css b/examples/showcase/src/main/js/default/pages/component/stack/stack4/stack4.css new file mode 100755 index 0000000..d1559a9 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/stack/stack4/stack4.css @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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. + */ +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/stack/stack4/stack4.hml b/examples/showcase/src/main/js/default/pages/component/stack/stack4/stack4.hml new file mode 100755 index 0000000..1bcf9c0 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/stack/stack4/stack4.hml @@ -0,0 +1,30 @@ + + +
+ + + + + + +
+
+ + + 内边距和边框 + + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/stack/stack4/stack4.js b/examples/showcase/src/main/js/default/pages/component/stack/stack4/stack4.js new file mode 100755 index 0000000..a420898 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/stack/stack4/stack4.js @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../common/js/general"; +export default { + ...backPage("pages/component/stack/indexStyle/index") +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/stack/stack5/stack5.css b/examples/showcase/src/main/js/default/pages/component/stack/stack5/stack5.css new file mode 100755 index 0000000..06a7a5d --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/stack/stack5/stack5.css @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2020 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. + */ diff --git a/examples/showcase/src/main/js/default/pages/component/stack/stack5/stack5.hml b/examples/showcase/src/main/js/default/pages/component/stack/stack5/stack5.hml new file mode 100755 index 0000000..c44cdf6 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/stack/stack5/stack5.hml @@ -0,0 +1,30 @@ + + +
+ + + + + + + + + + + 层叠显示组件 + + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/stack/stack5/stack5.js b/examples/showcase/src/main/js/default/pages/component/stack/stack5/stack5.js new file mode 100755 index 0000000..4ea65f3 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/stack/stack5/stack5.js @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../common/js/general"; +export default { + ...backPage("pages/component/stack/indexEvent/index") +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/stack/stack6/stack6.css b/examples/showcase/src/main/js/default/pages/component/stack/stack6/stack6.css new file mode 100755 index 0000000..f1f3c27 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/stack/stack6/stack6.css @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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. + */ +.text { + width: 280px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/stack/stack6/stack6.hml b/examples/showcase/src/main/js/default/pages/component/stack/stack6/stack6.hml new file mode 100755 index 0000000..56237c1 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/stack/stack6/stack6.hml @@ -0,0 +1,33 @@ + + +
+ + + + + + + + + stack的show属性 + + + + + + {{text1}} + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/stack/stack6/stack6.js b/examples/showcase/src/main/js/default/pages/component/stack/stack6/stack6.js new file mode 100755 index 0000000..ebcadef --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/stack/stack6/stack6.js @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../common/js/general"; +import {changeStatus} from "../../../../common/js/stack" +export default { + data: { + text1: "点击按钮改变状态", + status: true, + div01: "div01" + }, + ...backPage("pages/component/stack/indexAttr/index"), + changeStatus: changeStatus +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/stack/stack7/stack7.css b/examples/showcase/src/main/js/default/pages/component/stack/stack7/stack7.css new file mode 100755 index 0000000..90290c3 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/stack/stack7/stack7.css @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2020 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. + */ +.text { + width: 130px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} + +.image { + width: 130px; + height: 50px; +} + diff --git a/examples/showcase/src/main/js/default/pages/component/stack/stack7/stack7.hml b/examples/showcase/src/main/js/default/pages/component/stack/stack7/stack7.hml new file mode 100755 index 0000000..e494889 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/stack/stack7/stack7.hml @@ -0,0 +1,32 @@ + + +
+ + + + + + + + + loop + + + + + 循环3次,点击改变display + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/stack/stack7/stack7.js b/examples/showcase/src/main/js/default/pages/component/stack/stack7/stack7.js new file mode 100755 index 0000000..dd35862 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/stack/stack7/stack7.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../common/js/general"; +export default { + data: { + text1: "点击按钮改变状态", + loopArray: ["1", "2", "3"], + display: "flex" + }, + ...backPage("pages/component/stack/indexAttr/index"), + changeDisplay: function () { + if (this.display === "flex") { + this.display = "none"; + } else { + this.display = "flex"; + } + } +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/stack/stack8/stack8.css b/examples/showcase/src/main/js/default/pages/component/stack/stack8/stack8.css new file mode 100755 index 0000000..f1f3c27 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/stack/stack8/stack8.css @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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. + */ +.text { + width: 280px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/stack/stack8/stack8.hml b/examples/showcase/src/main/js/default/pages/component/stack/stack8/stack8.hml new file mode 100755 index 0000000..e73b7a8 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/stack/stack8/stack8.hml @@ -0,0 +1,33 @@ + + +
+ + + + + + + + + 观察if属性作用 + + + + + + {{text1}} + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/stack/stack8/stack8.js b/examples/showcase/src/main/js/default/pages/component/stack/stack8/stack8.js new file mode 100755 index 0000000..e7eed2c --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/stack/stack8/stack8.js @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../common/js/general"; +import {changeStatus} from "../../../../common/js/stack" +export default { + data: { + text1: "点击按钮改变状态", + status: true + }, + ...backPage("pages/component/stack/indexAttr/index"), + changeStatus: changeStatus +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/swiper/index/index.css b/examples/showcase/src/main/js/default/pages/component/swiper/index/index.css new file mode 100755 index 0000000..7338de9 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/swiper/index/index.css @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2020 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. + */ +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.titleContainerStyle { + width: 454px; + height: 70px; +} + +.titleTextStyle { + width: 454px; + height: 50px; + margin-left: 175px; + margin-top: 0px; +} + +.buttonContainerStyle { + width: 454px; + height: 80px; +} + +.buttonStyle { + width: 200px; + height: 60px; + margin-left: 130px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/swiper/index/index.hml b/examples/showcase/src/main/js/default/pages/component/swiper/index/index.hml new file mode 100755 index 0000000..ee8726c --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/swiper/index/index.hml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + swiper + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/swiper/index/index.js b/examples/showcase/src/main/js/default/pages/component/swiper/index/index.js new file mode 100755 index 0000000..22b0708 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/swiper/index/index.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../common/js/general"; +export default { + ...backPage("pages/component/index/containerIndex/index"), + changePage1: routePage("pages/component/swiper/indexAttr/index").changePage, + changePage2: routePage("pages/component/swiper/indexStyle/index").changePage, + changePage3: routePage("pages/component/swiper/indexEvent/index").changePage, + changePage4: routePage("pages/component/swiper/indexSpecSet/index").changePage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/swiper/indexAttr/index.css b/examples/showcase/src/main/js/default/pages/component/swiper/indexAttr/index.css new file mode 100755 index 0000000..60569ee --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/swiper/indexAttr/index.css @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2020 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. + */ +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.titleContainerStyle { + width: 454px; + height: 70px; +} + +.titleTextStyle { + width: 454px; + height: 50px; + margin-left: 170px; + margin-top: 0px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/swiper/indexAttr/index.hml b/examples/showcase/src/main/js/default/pages/component/swiper/indexAttr/index.hml new file mode 100755 index 0000000..91ab00f --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/swiper/indexAttr/index.hml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + 通用属性 + + + + + + + + show和style + + + + + + + + + + + class和if + + + + + + + + + + + for + + + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/swiper/indexAttr/index.js b/examples/showcase/src/main/js/default/pages/component/swiper/indexAttr/index.js new file mode 100755 index 0000000..6b51d19 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/swiper/indexAttr/index.js @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../common/js/general"; +export default { + ...backPage("pages/component/swiper/index/index"), + changePage1: routePage("pages/component/swiper/swiper6/swiper6").changePage, + changePage2: routePage("pages/component/swiper/swiper7/swiper7").changePage, + changePage3: routePage("pages/component/swiper/swiper11/swiper11").changePage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/swiper/indexEvent/index.css b/examples/showcase/src/main/js/default/pages/component/swiper/indexEvent/index.css new file mode 100755 index 0000000..60569ee --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/swiper/indexEvent/index.css @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2020 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. + */ +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.titleContainerStyle { + width: 454px; + height: 70px; +} + +.titleTextStyle { + width: 454px; + height: 50px; + margin-left: 170px; + margin-top: 0px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/swiper/indexEvent/index.hml b/examples/showcase/src/main/js/default/pages/component/swiper/indexEvent/index.hml new file mode 100755 index 0000000..7acd22a --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/swiper/indexEvent/index.hml @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + 通用事件 + + + + + + + + click + + + longpress + + + swipe + + + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/swiper/indexEvent/index.js b/examples/showcase/src/main/js/default/pages/component/swiper/indexEvent/index.js new file mode 100755 index 0000000..b9db67e --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/swiper/indexEvent/index.js @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../common/js/general"; +export default { + ...backPage("pages/component/swiper/index/index"), + changePage1: routePage("pages/component/swiper/swiper1/swiper1").changePage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/swiper/indexSpecSet/index.css b/examples/showcase/src/main/js/default/pages/component/swiper/indexSpecSet/index.css new file mode 100755 index 0000000..60569ee --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/swiper/indexSpecSet/index.css @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2020 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. + */ +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.titleContainerStyle { + width: 454px; + height: 70px; +} + +.titleTextStyle { + width: 454px; + height: 50px; + margin-left: 170px; + margin-top: 0px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/swiper/indexSpecSet/index.hml b/examples/showcase/src/main/js/default/pages/component/swiper/indexSpecSet/index.hml new file mode 100755 index 0000000..8233158 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/swiper/indexSpecSet/index.hml @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + 特有设置 + + + + + + + + index + + + vertical + + + duration + + + loop + + + change + + + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/swiper/indexSpecSet/index.js b/examples/showcase/src/main/js/default/pages/component/swiper/indexSpecSet/index.js new file mode 100755 index 0000000..5b7d55a --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/swiper/indexSpecSet/index.js @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../common/js/general"; +export default { + ...backPage("pages/component/swiper/index/index"), + changePage1: routePage("pages/component/swiper/swiper5/swiper5").changePage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/swiper/indexStyle/index.css b/examples/showcase/src/main/js/default/pages/component/swiper/indexStyle/index.css new file mode 100755 index 0000000..60569ee --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/swiper/indexStyle/index.css @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2020 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. + */ +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.titleContainerStyle { + width: 454px; + height: 70px; +} + +.titleTextStyle { + width: 454px; + height: 50px; + margin-left: 170px; + margin-top: 0px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/swiper/indexStyle/index.hml b/examples/showcase/src/main/js/default/pages/component/swiper/indexStyle/index.hml new file mode 100755 index 0000000..ee92e92 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/swiper/indexStyle/index.hml @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + 通用样式 + + + + + + + + 背景色 + + + left + + + top + + + + + + + + + + + margin + + + height + + + width + + + + + + + + + + + border + + + padding + + + + + + + + + + + margin-left + + + margin-top + + + + + + + + + + + margin-right和bottom + + + + + + + + + + + display + + + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/swiper/indexStyle/index.js b/examples/showcase/src/main/js/default/pages/component/swiper/indexStyle/index.js new file mode 100755 index 0000000..844efe9 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/swiper/indexStyle/index.js @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../common/js/general"; +export default { + ...backPage("pages/component/swiper/index/index"), + changePage1: routePage("pages/component/swiper/swiper2/swiper2").changePage, + changePage2: routePage("pages/component/swiper/swiper3/swiper3").changePage, + changePage3: routePage("pages/component/swiper/swiper4/swiper4").changePage, + changePage4: routePage("pages/component/swiper/swiper8/swiper8").changePage, + changePage5: routePage("pages/component/swiper/swiper9/swiper9").changePage, + changePage6: routePage("pages/component/swiper/swiper10/swiper10").changePage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/swiper/swiper1/swiper1.css b/examples/showcase/src/main/js/default/pages/component/swiper/swiper1/swiper1.css new file mode 100755 index 0000000..06a7a5d --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/swiper/swiper1/swiper1.css @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2020 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. + */ diff --git a/examples/showcase/src/main/js/default/pages/component/swiper/swiper1/swiper1.hml b/examples/showcase/src/main/js/default/pages/component/swiper/swiper1/swiper1.hml new file mode 100755 index 0000000..b3306f8 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/swiper/swiper1/swiper1.hml @@ -0,0 +1,68 @@ + + + + + + + + + + + + 第{{index}}页,共3页 + + + 长按空白文字改变 + + + {{text2}} + + + + + + + + + + + 第{{index}}页,共3页 + + + 点击空白文字改变 + + + {{text3}} + + + + + + + + + + + 第{{index}}页,共3页 + + + 滑动空白处触发swipe事件 + + + {{text4}} + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/swiper/swiper1/swiper1.js b/examples/showcase/src/main/js/default/pages/component/swiper/swiper1/swiper1.js new file mode 100755 index 0000000..15036d3 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/swiper/swiper1/swiper1.js @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../common/js/general"; +export default { + data: { + index: 0, + text2: "longpress未触发", + text3: "click未触发", + text4: "swipe未触发", + }, + ...backPage("pages/component/swiper/indexEvent/index"), + textChange2: function () { + this.text2 = "longpress已触发"; + }, + textChange3: function () { + this.text3 = "click已触发"; + }, + textChange4: function (e) { + this.text4 = "swipe方向:" + e.direction; + }, + showPage: function (e) { + this.index = e.index + 1; + } +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/swiper/swiper10/swiper10.css b/examples/showcase/src/main/js/default/pages/component/swiper/swiper10/swiper10.css new file mode 100755 index 0000000..f1f3c27 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/swiper/swiper10/swiper10.css @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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. + */ +.text { + width: 280px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/swiper/swiper10/swiper10.hml b/examples/showcase/src/main/js/default/pages/component/swiper/swiper10/swiper10.hml new file mode 100755 index 0000000..7b3f9f4 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/swiper/swiper10/swiper10.hml @@ -0,0 +1,30 @@ + + +
+ + + + + + + + + + + + {{text1}} + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/swiper/swiper10/swiper10.js b/examples/showcase/src/main/js/default/pages/component/swiper/swiper10/swiper10.js new file mode 100755 index 0000000..fdb2557 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/swiper/swiper10/swiper10.js @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../common/js/general"; +export default { + data: { + text1: "点击改变display", + status: "flex" + }, + ...backPage("pages/component/swiper/indexStyle/index"), + changeStatus: function () { + if (this.status === "flex") { + this.status = "none"; + } else { + this.status = "flex"; + } + } +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/swiper/swiper11/swiper11.css b/examples/showcase/src/main/js/default/pages/component/swiper/swiper11/swiper11.css new file mode 100755 index 0000000..34660ee --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/swiper/swiper11/swiper11.css @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2020 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. + */ +.text { + width: 280px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} + +.swiperStyle { + width:280px; + height:110px; + margin-top:10px; + margin-left:85px; +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/swiper/swiper11/swiper11.hml b/examples/showcase/src/main/js/default/pages/component/swiper/swiper11/swiper11.hml new file mode 100755 index 0000000..26113f7 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/swiper/swiper11/swiper11.hml @@ -0,0 +1,31 @@ + + +
+ + + + + + + + + {{$item}} + + + 由for构造出来 + + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/swiper/swiper11/swiper11.js b/examples/showcase/src/main/js/default/pages/component/swiper/swiper11/swiper11.js new file mode 100755 index 0000000..225bb35 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/swiper/swiper11/swiper11.js @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../common/js/general"; +export default { + data: { + listData: [ + "第一个swiper", + "第二个swiper" + ] + }, + ...backPage("pages/component/swiper/indexAttr/index") +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/swiper/swiper2/swiper2.css b/examples/showcase/src/main/js/default/pages/component/swiper/swiper2/swiper2.css new file mode 100755 index 0000000..06a7a5d --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/swiper/swiper2/swiper2.css @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2020 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. + */ diff --git a/examples/showcase/src/main/js/default/pages/component/swiper/swiper2/swiper2.hml b/examples/showcase/src/main/js/default/pages/component/swiper/swiper2/swiper2.hml new file mode 100755 index 0000000..48b9cde --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/swiper/swiper2/swiper2.hml @@ -0,0 +1,51 @@ + + + + + + + + + + + + 第{{index}}页,共1页 + + + 背景色设为绿色 + + + left和top设为75 + + + + + + + + + + + 第{{index}}页,共1页 + + + 背景色设为绿色 + + + left和top设为75 + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/swiper/swiper2/swiper2.js b/examples/showcase/src/main/js/default/pages/component/swiper/swiper2/swiper2.js new file mode 100755 index 0000000..56cc381 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/swiper/swiper2/swiper2.js @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2020 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. + */ +// swiper2.js +import { backPage, routePage } from "../../../../common/js/general"; +import {showPage} from "../../../../common/js/swiper"; +export default { + data: { + index: 0 + }, + ...backPage("pages/component/swiper/indexStyle/index"), + showPage: showPage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/swiper/swiper3/swiper3.css b/examples/showcase/src/main/js/default/pages/component/swiper/swiper3/swiper3.css new file mode 100755 index 0000000..06a7a5d --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/swiper/swiper3/swiper3.css @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2020 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. + */ diff --git a/examples/showcase/src/main/js/default/pages/component/swiper/swiper3/swiper3.hml b/examples/showcase/src/main/js/default/pages/component/swiper/swiper3/swiper3.hml new file mode 100755 index 0000000..015ee03 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/swiper/swiper3/swiper3.hml @@ -0,0 +1,53 @@ + + +
+ + + + + + + + + + 第{{index}}页,共1页 + + + 宽高设为300 + + + margin设为75 + + + + + + + + + + + 第{{index}}页,共1页 + + + 宽高设为300 + + + margin设为75 + + + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/swiper/swiper3/swiper3.js b/examples/showcase/src/main/js/default/pages/component/swiper/swiper3/swiper3.js new file mode 100755 index 0000000..15f1fb2 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/swiper/swiper3/swiper3.js @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2020 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. + */ +// swiper3.js +import { backPage, routePage } from "../../../../common/js/general"; +import {showPage} from "../../../../common/js/swiper"; +export default { + data: { + index: 0 + }, + ...backPage("pages/component/swiper/indexStyle/index"), + showPage: showPage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/swiper/swiper4/swiper4.css b/examples/showcase/src/main/js/default/pages/component/swiper/swiper4/swiper4.css new file mode 100755 index 0000000..06a7a5d --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/swiper/swiper4/swiper4.css @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2020 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. + */ diff --git a/examples/showcase/src/main/js/default/pages/component/swiper/swiper4/swiper4.hml b/examples/showcase/src/main/js/default/pages/component/swiper/swiper4/swiper4.hml new file mode 100755 index 0000000..a5dcabc --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/swiper/swiper4/swiper4.hml @@ -0,0 +1,45 @@ + + + + + + + + + + + + border + + + padding + + + + + + + + + + + border + + + padding + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/swiper/swiper4/swiper4.js b/examples/showcase/src/main/js/default/pages/component/swiper/swiper4/swiper4.js new file mode 100755 index 0000000..061aae0 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/swiper/swiper4/swiper4.js @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2020 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. + */ +// swiper4.js +import { backPage, routePage } from "../../../../common/js/general"; +import {showPage} from "../../../../common/js/swiper"; +export default { + data: { + index: 0 + }, + ...backPage("pages/component/swiper/indexStyle/index"), + showPage: showPage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/swiper/swiper5/swiper5.css b/examples/showcase/src/main/js/default/pages/component/swiper/swiper5/swiper5.css new file mode 100755 index 0000000..06a7a5d --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/swiper/swiper5/swiper5.css @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2020 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. + */ diff --git a/examples/showcase/src/main/js/default/pages/component/swiper/swiper5/swiper5.hml b/examples/showcase/src/main/js/default/pages/component/swiper/swiper5/swiper5.hml new file mode 100755 index 0000000..2be9365 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/swiper/swiper5/swiper5.hml @@ -0,0 +1,95 @@ + + + + + + + + + + + + 第{{index}}页,共2页 + + + change触发页号改变 + + + 页面初始index为2 + + + 滑动方向垂直 + + + 滑动时间1000 + + + loop为true + + + + + + + + + + + 第{{index}}页,共2页 + + + change触发页号改变 + + + 页面初始index为2 + + + 滑动方向垂直 + + + 滑动时间1000 + + + loop为true + + + + + + + + + + + 第{{index}}页,共2页 + + + change触发页号改变 + + + 页面初始index为2 + + + 滑动方向垂直 + + + 滑动时间1000 + + + loop为true + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/swiper/swiper5/swiper5.js b/examples/showcase/src/main/js/default/pages/component/swiper/swiper5/swiper5.js new file mode 100755 index 0000000..d9a9ca3 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/swiper/swiper5/swiper5.js @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../common/js/general"; +import {showPage} from "../../../../common/js/swiper"; +export default { + data: { + index: 2 + }, + ...backPage("pages/component/swiper/indexSpecSet/index"), + showPage: showPage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/swiper/swiper6/swiper6.css b/examples/showcase/src/main/js/default/pages/component/swiper/swiper6/swiper6.css new file mode 100755 index 0000000..f1f3c27 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/swiper/swiper6/swiper6.css @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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. + */ +.text { + width: 280px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/swiper/swiper6/swiper6.hml b/examples/showcase/src/main/js/default/pages/component/swiper/swiper6/swiper6.hml new file mode 100755 index 0000000..a46da63 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/swiper/swiper6/swiper6.hml @@ -0,0 +1,33 @@ + + +
+ + + + + + + + + 观察style设置宽高和margin样式 + + + + + + {{text1}} + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/swiper/swiper6/swiper6.js b/examples/showcase/src/main/js/default/pages/component/swiper/swiper6/swiper6.js new file mode 100755 index 0000000..c9d3233 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/swiper/swiper6/swiper6.js @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../common/js/general"; +import {changeStatus} from "../../../../common/js/swiper"; +export default { + data: { + text1: "点击按钮改变状态", + status: true + }, + ...backPage("pages/component/swiper/indexAttr/index"), + changeStatus: changeStatus +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/swiper/swiper7/swiper7.css b/examples/showcase/src/main/js/default/pages/component/swiper/swiper7/swiper7.css new file mode 100755 index 0000000..34660ee --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/swiper/swiper7/swiper7.css @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2020 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. + */ +.text { + width: 280px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} + +.swiperStyle { + width:280px; + height:110px; + margin-top:10px; + margin-left:85px; +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/swiper/swiper7/swiper7.hml b/examples/showcase/src/main/js/default/pages/component/swiper/swiper7/swiper7.hml new file mode 100755 index 0000000..7e0fcec --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/swiper/swiper7/swiper7.hml @@ -0,0 +1,33 @@ + + +
+ + + + + + + + + 观察class设置宽高和margin样式 + + + + + + {{text1}} + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/swiper/swiper7/swiper7.js b/examples/showcase/src/main/js/default/pages/component/swiper/swiper7/swiper7.js new file mode 100755 index 0000000..94ec43f --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/swiper/swiper7/swiper7.js @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../common/js/general"; +import {changeStatus} from "../../../../common/js/swiper"; +export default { + data: { + text1: "点击按钮改变状态", + status: true + }, + changeStatus: changeStatus, + ...backPage("pages/component/swiper/indexAttr/index") +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/swiper/swiper8/swiper8.css b/examples/showcase/src/main/js/default/pages/component/swiper/swiper8/swiper8.css new file mode 100755 index 0000000..06a7a5d --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/swiper/swiper8/swiper8.css @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2020 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. + */ diff --git a/examples/showcase/src/main/js/default/pages/component/swiper/swiper8/swiper8.hml b/examples/showcase/src/main/js/default/pages/component/swiper/swiper8/swiper8.hml new file mode 100755 index 0000000..4508ef2 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/swiper/swiper8/swiper8.hml @@ -0,0 +1,53 @@ + + +
+ + + + + + + + + + 第{{index}}页,共1页 + + + margin-left为75 + + + margin-top为75 + + + + + + + + + + + 第{{index}}页,共1页 + + + margin-left为75 + + + margin-top为75 + + + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/swiper/swiper8/swiper8.js b/examples/showcase/src/main/js/default/pages/component/swiper/swiper8/swiper8.js new file mode 100755 index 0000000..6b36bd6 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/swiper/swiper8/swiper8.js @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2020 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. + */ +// swiper8.js +import { backPage, routePage } from "../../../../common/js/general"; +import {showPage} from "../../../../common/js/swiper"; +export default { + data: { + index: 0 + }, + ...backPage("pages/component/swiper/indexStyle/index"), + showPage: showPage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/swiper/swiper9/swiper9.css b/examples/showcase/src/main/js/default/pages/component/swiper/swiper9/swiper9.css new file mode 100755 index 0000000..06a7a5d --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/swiper/swiper9/swiper9.css @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2020 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. + */ diff --git a/examples/showcase/src/main/js/default/pages/component/swiper/swiper9/swiper9.hml b/examples/showcase/src/main/js/default/pages/component/swiper/swiper9/swiper9.hml new file mode 100755 index 0000000..beecf19 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/swiper/swiper9/swiper9.hml @@ -0,0 +1,53 @@ + + +
+ + + + + + + + + + 第{{index}}页,共1页 + + + 底部外边距为75 + + + margin-right为75 + + + + + + + + + + + 第{{index}}页,共1页 + + + 底部外边距为75 + + + margin-right为75 + + + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/swiper/swiper9/swiper9.js b/examples/showcase/src/main/js/default/pages/component/swiper/swiper9/swiper9.js new file mode 100755 index 0000000..5276313 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/swiper/swiper9/swiper9.js @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2020 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. + */ +// swiper9.js +import { backPage, routePage } from "../../../../common/js/general"; +import {showPage} from "../../../../common/js/swiper"; +export default { + data: { + index: 0 + }, + ...backPage("pages/component/swiper/indexStyle/index"), + showPage: showPage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/switch/attr/attr.css b/examples/showcase/src/main/js/default/pages/component/switch/attr/attr.css new file mode 100755 index 0000000..23f4942 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/switch/attr/attr.css @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2020 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. + */ +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.switchStyle { + width:64px; + height:64px; + left:80px; + top:60px; +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/switch/attr/attr.hml b/examples/showcase/src/main/js/default/pages/component/switch/attr/attr.hml new file mode 100755 index 0000000..64908ce --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/switch/attr/attr.hml @@ -0,0 +1,108 @@ + + + + + + + + + + + + + + + + + 通用属性 + + + + + + + for + +
+ + 解析子组件 + + + +
+
+ + + + + show和class + + + + 设置class + + + + + + + + + + + + if和style + +
+ + 设置style + + + + + +
+
+ + + + + 特有属性 + + + + + + + + checked + + + + + 初始化值为开 + + + checked生效 + + + + + + + +
+
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/switch/attr/attr.js b/examples/showcase/src/main/js/default/pages/component/switch/attr/attr.js new file mode 100755 index 0000000..9fabf6a --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/switch/attr/attr.js @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../common/js/general"; +export default { + data: { + status: true, + statusIf: true, + listData: [ + true, + false + ] + }, + ...backPage("pages/component/switch/index/index"), + changeStatus: function () { + if (this.status == true) { + this.status = false; + } else { + this.status = true; + } + }, + changeIf: function () { + if (this.statusIf == true) { + this.statusIf = false; + } else { + this.statusIf = true; + } + } +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/switch/event/event.css b/examples/showcase/src/main/js/default/pages/component/switch/event/event.css new file mode 100755 index 0000000..b57bf31 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/switch/event/event.css @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2020 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. + */ +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} diff --git a/examples/showcase/src/main/js/default/pages/component/switch/event/event.hml b/examples/showcase/src/main/js/default/pages/component/switch/event/event.hml new file mode 100755 index 0000000..a45e8cf --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/switch/event/event.hml @@ -0,0 +1,106 @@ + + + + + + + + + + + + + + + + + 通用事件 + + + + + + + 点击事件 + + + + + + {{clickValue}} + + + + + + + + 长按事件 + + + + + + {{longpressValue}} + + + + + + + + swipe事件 + + + + + + {{swipeValue}} + + + + + + + + 特有事件 + + + + + + + + change事件 + + + + + 点击状态改变 + + + {{checkedValue}} + + + + + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/switch/event/event.js b/examples/showcase/src/main/js/default/pages/component/switch/event/event.js new file mode 100755 index 0000000..b947aa2 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/switch/event/event.js @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../common/js/general"; +export default { + data: { + clickValue: "点击文字改变", + longpressValue: "长按文字改变", + swipeValue: "滑动文字改变", + checkedValue: false + }, + ...backPage("pages/component/switch/index/index"), + click: function () { + this.clickValue = "点击已经触发"; + }, + longpress: function () { + this.longpressValue = "长按已经触发"; + }, + swipeEvent: function (e) { + this.swipeValue = "swipe方向:" + e.direction; + }, + change: function () { + if (this.checkedValue == false) { + this.checkedValue = true; + } else { + this.checkedValue = false; + } + } +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/switch/index/index.css b/examples/showcase/src/main/js/default/pages/component/switch/index/index.css new file mode 100755 index 0000000..7338de9 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/switch/index/index.css @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2020 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. + */ +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.titleContainerStyle { + width: 454px; + height: 70px; +} + +.titleTextStyle { + width: 454px; + height: 50px; + margin-left: 175px; + margin-top: 0px; +} + +.buttonContainerStyle { + width: 454px; + height: 80px; +} + +.buttonStyle { + width: 200px; + height: 60px; + margin-left: 130px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/switch/index/index.hml b/examples/showcase/src/main/js/default/pages/component/switch/index/index.hml new file mode 100755 index 0000000..ac7da9c --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/switch/index/index.hml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + switch + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/switch/index/index.js b/examples/showcase/src/main/js/default/pages/component/switch/index/index.js new file mode 100755 index 0000000..22a7827 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/switch/index/index.js @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../common/js/general"; +export default { + ...backPage("pages/component/index/formIndex/index"), + changePage1: routePage("pages/component/switch/attr/attr").changePage, + changePage2: routePage("pages/component/switch/style/style").changePage, + changePage3: routePage("pages/component/switch/event/event").changePage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/switch/style/style.css b/examples/showcase/src/main/js/default/pages/component/switch/style/style.css new file mode 100755 index 0000000..b57bf31 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/switch/style/style.css @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2020 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. + */ +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} diff --git a/examples/showcase/src/main/js/default/pages/component/switch/style/style.hml b/examples/showcase/src/main/js/default/pages/component/switch/style/style.hml new file mode 100755 index 0000000..b8df1de --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/switch/style/style.hml @@ -0,0 +1,159 @@ + + + + + + + + + + + + + + + + + 通用样式 + + + + + + + + left、top + + + 背景色 + + + + + 父组件stack + + + 距离左上110 + + + 开关背景蓝色 + + + + + + + + + + + margin + + + 宽高 + + + + + 父组件div + + + margin设80 + + + 组件宽高80 + +
+ + +
+
+
+ + + + + + margin-left和top + + + + + 观察margin-left和margin-top设置 + +
+ + +
+
+
+ + + + + + margin-right和bottom + + + + + 观察margin-right和margin-bottom + +
+ + +
+
+
+ + + + + display + + + + + + + + + + + + + + border + + + padding + + + + + border宽10 + + + padding宽10 + + + + + + + +
+
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/switch/style/style.js b/examples/showcase/src/main/js/default/pages/component/switch/style/style.js new file mode 100755 index 0000000..f366c1c --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/switch/style/style.js @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../../../common/js/general"; +export default { + data: { + status: "flex" + }, + ...backPage("pages/component/switch/index/index"), + changeStatus: function () { + if (this.status === "flex") { + this.status = "none"; + } else { + this.status = "flex"; + } + } +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/text/attr/attr.css b/examples/showcase/src/main/js/default/pages/component/text/attr/attr.css new file mode 100755 index 0000000..c546afe --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/text/attr/attr.css @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2020 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. + */ +.list { + left: 0px; + top: 0px; + width: 454px; + height: 454px; +} + +.item-title { + left: 0px; + top: 0px; + width: 400px; + height: 70px; +} + +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.item-types { + width: 454px; + height: 80px; +} + +.whole-text { + margin-top:10px; + margin-left:150px; + width:200px; + height:60px; + font-size:30px; + color: red; +} + +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} + +.item-attribute { + width: 454px; + height: 100px; +} + +.attribute-div { + left: 0px; + top: 0px; + height: 100px; + width: 250px; + flex-direction: row; +} + +.attribute-div-if-text { + left: 0px; + top: 0px; + height: 100px; + width: 200px; + flex-direction: column; +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/text/attr/attr.hml b/examples/showcase/src/main/js/default/pages/component/text/attr/attr.hml new file mode 100755 index 0000000..814942c --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/text/attr/attr.hml @@ -0,0 +1,67 @@ + + + + + + + + + + + + + 通用属性 + + + + +
+ +
+
+ + 显示文字 + +
+
+ + + +
+ +
+
+ + 显示文字 + +
+ +
+ + + +
+ +
+
+ + {{$idx}} -- {{$item}} + +
+
+ + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/text/attr/attr.js b/examples/showcase/src/main/js/default/pages/component/text/attr/attr.js new file mode 100755 index 0000000..8ac0f98 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/text/attr/attr.js @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2020 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 {goPage,routePage} from "../../../../common/js/general"; +import {changeShow, changeStatusIf} from "../../../../common/js/text" +export default { + data: { + showStatus: true, + ifStatus: true, + display: "flex", + textfor: ["text测试for标签,abcdefg", + "text测试for标签,abcdefg"] + }, + ...goPage("pages/component/text/index/index"), + changeShow: changeShow, + changeStatusIf: changeStatusIf +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/text/commonStyle/commonStyle.css b/examples/showcase/src/main/js/default/pages/component/text/commonStyle/commonStyle.css new file mode 100755 index 0000000..0a41a7b --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/text/commonStyle/commonStyle.css @@ -0,0 +1,138 @@ +/* + * Copyright (c) 2020 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. + */ +.list { + left: 0px; + top: 0px; + width: 454px; + height: 454px; +} + +.item-title { + left: 0px; + top: 0px; + width: 400px; + height: 70px; +} + +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.item-types { + width: 454px; + height: 80px; +} + +.whole-text { + margin-top:10px; + margin-left:150px; + width:200px; + height:60px; + font-size:30px; + color: red; +} + +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} + +.item-three { + width: 450px; + height: 200px; +} + +.three-div { + width: 450px; + height: 200px; + left: 0px; + top: 0px; +} + +.three-left-div { + width: 220px; + height: 200px; + left: 0px; + top: 0px; + flex-direction: column; +} + +.three-right-div { + width: 230px; + height: 190px; + top: 40px; + left: 0px; +} + +.item-two { + width: 450px; + height: 150px; +} + +.two-left-div { + width: 220px; + height: 150px; + left: 0px; + top: 0px; + flex-direction: column; +} + +.two-div { + width: 450px; + height: 150px; + left: 0px; + top: 0px; +} + +.general-stack { + width: 200px; + height: 150px; + left: 0px; + top: 0px; + background-color: springgreen; +} + +.general-text { + background-color: red; + left: 50px; + top: 50px; + width: 100px; + height: 60px; +} + +.right-div { + width: 250px; + height: 200px; + background-color: springgreen; + left: 0px; + top: 0px; +} + +.show { + opacity:1; + border-width: 5px; + border-color: #0000ff; + border-radius:5px; + padding:10px; + width: 150px; + height: 50px; + background-color: red; + margin-left: 10px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/text/commonStyle/commonStyle.hml b/examples/showcase/src/main/js/default/pages/component/text/commonStyle/commonStyle.hml new file mode 100755 index 0000000..2dbac23 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/text/commonStyle/commonStyle.hml @@ -0,0 +1,71 @@ + + + + + + + + + + + + + 通用样式 + + + + +
+
+ 背景红色 + left为50 + top为50 +
+ + show + +
+
+ + + +
+
+ margin为40 + height为60 + width为100 +
+
+ show +
+
+
+ + + +
+
+ border + padding +
+
+ show +
+
+
+ + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/text/commonStyle/commonStyle.js b/examples/showcase/src/main/js/default/pages/component/text/commonStyle/commonStyle.js new file mode 100755 index 0000000..31f8db6 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/text/commonStyle/commonStyle.js @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2020 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. + */ +// commonStyle.js +import { goPage, routePage } from "../../../../common/js/general"; +export default { + ...goPage("pages/component/text/index/index") +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/text/event/event.css b/examples/showcase/src/main/js/default/pages/component/text/event/event.css new file mode 100755 index 0000000..3658f2c --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/text/event/event.css @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2020 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. + */ +.list { + left: 0px; + top: 0px; + width: 454px; + height: 454px; +} + +.item-title { + left: 0px; + top: 0px; + width: 400px; + height: 70px; +} + +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.item-types { + width: 454px; + height: 80px; +} + +.whole-text { + margin-top:10px; + margin-left:150px; + width:200px; + height:60px; + font-size:30px; + color: red; +} + +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} + +.item-two { + width: 450px; + height: 200px; +} + +.two-right-div { + width: 230px; + height: 200px; + top: 40px; + left: 0px; +} + +.two-left-div { + width: 220px; + height: 200px; + left: 0px; + top: 0px; + flex-direction: column; +} + +.two-div { + width: 450px; + height: 200px; + left: 0px; + top: 0px; +} + +.click-text { + margin-top: 30px; + width: 200px; + height: 100px; + text-overflow: ellipsis; +} diff --git a/examples/showcase/src/main/js/default/pages/component/text/event/event.hml b/examples/showcase/src/main/js/default/pages/component/text/event/event.hml new file mode 100755 index 0000000..8562cb5 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/text/event/event.hml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + 通用事件 + + + + +
+
+ click + longpress + swipe +
+
+ {{text}} +
+
+
+ + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/text/event/event.js b/examples/showcase/src/main/js/default/pages/component/text/event/event.js new file mode 100755 index 0000000..f143eb5 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/text/event/event.js @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2020 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 {goPage,routePage} from "../../../../common/js/general"; +export default { + data: { + text: "点击/长按/滑动" + }, + ...goPage("pages/component/text/index/index"), + clickEvent(e) { + this.text = "点击已触发"; + }, + longpressEvent() { + this.text = "长按已触发"; + }, + swipeEvent(e) { + this.text = "swipe方向:" + e.direction; + } +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/text/index/index.css b/examples/showcase/src/main/js/default/pages/component/text/index/index.css new file mode 100755 index 0000000..dbb6bd6 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/text/index/index.css @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2020 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. + */ +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.titleContainerStyle { + width: 454px; + height: 70px; +} + +.titleTextStyle { + width: 454px; + height: 50px; + margin-left: 195px; + margin-top: 0px; +} + +.buttonContainerStyle { + width: 454px; + height: 80px; +} + +.buttonStyle { + width: 200px; + height: 60px; + margin-left: 130px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/text/index/index.hml b/examples/showcase/src/main/js/default/pages/component/text/index/index.hml new file mode 100755 index 0000000..9dea56c --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/text/index/index.hml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + text + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/text/index/index.js b/examples/showcase/src/main/js/default/pages/component/text/index/index.js new file mode 100755 index 0000000..1ea5b8b --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/text/index/index.js @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2020 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 {backPage,routePage} from "../../../../common/js/general"; +export default { + ...backPage("pages/component/index/baseIndex/index"), + changePage1: routePage("pages/component/text/attr/attr").changePage, + changePage2: routePage("pages/component/text/commonStyle/commonStyle").changePage, + changePage3: routePage("pages/component/text/specStyle/specStyle").changePage, + changePage4: routePage("pages/component/text/event/event").changePage +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/text/specStyle/specStyle.css b/examples/showcase/src/main/js/default/pages/component/text/specStyle/specStyle.css new file mode 100755 index 0000000..88824f8 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/text/specStyle/specStyle.css @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2020 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. + */ +.list { + left: 0px; + top: 0px; + width: 454px; + height: 454px; +} + +.item-title { + left: 0px; + top: 0px; + width: 400px; + height: 70px; +} + +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.item-types { + width: 454px; + height: 80px; +} + +.whole-text { + margin-top:10px; + margin-left:150px; + width:200px; + height:60px; + font-size:30px; + color: red; +} + +.text { + width: 200px; + height: 50px; + margin-top: 10px; + margin-left: 10px; + font-size:30px; +} + +.item-special { + width: 450px; + height: 200px; +} + +.special-div { + width: 450px; + height: 200px; + left: 0px; + top: 0px; +} + +.special-left-div { + width: 250px; + height: 200px; + top:0px; + left:0px; + flex-direction: column; +} + +.special-right-div { + width: 200px; + height: 200px; + top: 0px; + left: 0px; +} diff --git a/examples/showcase/src/main/js/default/pages/component/text/specStyle/specStyle.hml b/examples/showcase/src/main/js/default/pages/component/text/specStyle/specStyle.hml new file mode 100755 index 0000000..6d1bb7e --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/text/specStyle/specStyle.hml @@ -0,0 +1,66 @@ + + + + + + + + + + + + + 特有样式 + + + + +
+
+ color;font-size;letter-spacing +
+
+ show +
+
+
+ + + +
+
+ text-align;text-overflow;font-family +
+
+ show textabcde +
+
+
+ + + +
+
+ text-align;text-overflow; +
+
+ show textabcde +
+
+
+ + +
\ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/component/text/specStyle/specStyle.js b/examples/showcase/src/main/js/default/pages/component/text/specStyle/specStyle.js new file mode 100755 index 0000000..80fadc4 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/component/text/specStyle/specStyle.js @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2020 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. + */ +// specStyle.js +import { goPage, routePage } from "../../../../common/js/general"; +export default { + ...goPage("pages/component/text/index/index") +} \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/index/index.css b/examples/showcase/src/main/js/default/pages/index/index.css new file mode 100755 index 0000000..ed50bd4 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/index/index.css @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2020 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. + */ +.separatorContainerStyle { + width: 454px; + height: 4px; + background-color: #8b8b7a; +} + +.titleContainerStyle { + width: 454px; + height: 70px; +} + +.titleTextStyle { + width: 454px; + height: 50px; + margin-left: 170px; + margin-top: 0px; +} + +.buttonContainerStyle { + width: 454px; + height: 80px; +} + +.buttonStyle { + width: 200px; + height: 60px; + margin-left: 130px; +} diff --git a/examples/showcase/src/main/js/default/pages/index/index.hml b/examples/showcase/src/main/js/default/pages/index/index.hml new file mode 100755 index 0000000..ce25441 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/index/index.hml @@ -0,0 +1,46 @@ + + + + + + + + 功能展示 + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/showcase/src/main/js/default/pages/index/index.js b/examples/showcase/src/main/js/default/pages/index/index.js new file mode 100755 index 0000000..11c1c38 --- /dev/null +++ b/examples/showcase/src/main/js/default/pages/index/index.js @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2020 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 {backPage, routePage} from "../../common/js/general"; +export default { + changeComponent1: routePage("pages/component/index/containerIndex/index").changePage, + changeComponent2: routePage("pages/component/index/baseIndex/index").changePage, + changeComponent3: routePage("pages/component/index/formIndex/index").changePage, + changeComponent4: routePage("pages/component/index/otherIndex/index").changePage +} \ No newline at end of file diff --git a/include/base/js_config.h b/include/base/js_config.h new file mode 100755 index 0000000..c7b1003 --- /dev/null +++ b/include/base/js_config.h @@ -0,0 +1,122 @@ +/* + * Copyright (c) 2020 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. + */ + +#ifndef OHOS_ACELITE_JS_CONFIG_H +#define OHOS_ACELITE_JS_CONFIG_H + +#include "acelite_config.h" + +/* + * Usage: + * #if ENABLED(SECURE_C_FUNCTION) + * #if DISABLED(SECURE_C_FUNCTION) + * #if ENABLED(SECURE_C_FUNCTION) && DISABLED(LOG_OUTPUT) + * #if ENABLED(SECURE_C_FUNCTION) || ENABLED(LOG_OUTPUT) + */ +#define ENABLED(CONFIGURATION) ((CONFIGURATION) == 1) +#define DISABLED(CONFIGURATION) ((CONFIGURATION) != 1) + +/** + * Enable secure C functions on real device, and disable on PC simulator for + * windows sdk version issue. + * + * Allowed values: + * 0: Disable the secure C functions. + * 1: Enable the secure C functions. + * + * Default: 1 on real device and 0 on PC simulator. + */ +#if (!defined _WIN32) && (!defined _WIN64) +#ifndef SECURE_C_FUNCTION +#define SECURE_C_FUNCTION 1 // modify here for real device case +#endif +#else +#ifndef SECURE_C_FUNCTION +#define SECURE_C_FUNCTION 0 // modify here for PC simulator case +#endif +#endif + +/** + * Enable/Disable JS framework runtime performance measurement. + * + * Allowed values: + * 0: Disable the JS framework performance measurement. + * 1: Enable the JS framework performance measurement. + * + * Default: 1 + */ +#ifndef JS_PROFILER +#define JS_PROFILER 1 +#endif + +/** + * Enable/Disable log function, uncomment to disable. + * + * Allowed values: + * 0: Disable all log output. + * 1: Enable all log output. + * + * Default: 0 on real device and 1 on PC simulator. + */ +#if (defined(_WIN32) || defined(_WIN64)) +#define LOG_OUTPUT 1 // this controls JS FWK log out +#endif + +/** + * Enable/Disable log function, uncomment to disable. + * + * Allowed values: + * 0: Disable all JS console log output. + * 1: Enable all JS console log output. + * + * Default: 1 + */ +#define CONSOLE_LOG_OUTPUT 1 // this controls console log out + +/** + * Enable/Disable engine debugger initialization + * + * Allowed values: + * 0: Disable engine debugger initialization. + * 1: Enable engine debugger initialization. + * + * Default: 0 on real device and 1 on PC simulator + */ +#if defined(_WIN32) || defined(_WIN64) +#define ENGINE_DEBUGGER 1 +#else +#define ENGINE_DEBUGGER 0 +#endif + +/** + * Enable/Disable the JS API for obtain ACELite version. + * + * Allowed values: + * 0: Disable the JS API for obtain ACELite version. + * 1: Enable the JS API for obtain ACELite version. + * + * Default: 1 + */ +#ifndef ACE_LITE_VERSION_JS_API +#define ACE_LITE_VERSION_JS_API 1 +#endif + +/** + * JS engine macro for engine adapter layer. + */ +#ifndef ENABLE_JERRY +#define ENABLE_JERRY 1 +#endif +#endif // OHOS_ACELITE_JS_CONFIG_H diff --git a/include/base/js_debugger_config.h b/include/base/js_debugger_config.h new file mode 100755 index 0000000..3afe749 --- /dev/null +++ b/include/base/js_debugger_config.h @@ -0,0 +1,145 @@ +/* + * Copyright (c) 2020 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. + */ + +#ifndef OHOS_ACELITE_JS_DEBUGGER_CONFIG_H +#define OHOS_ACELITE_JS_DEBUGGER_CONFIG_H +#include +#include +#include "js_config.h" +#include "memory_heap.h" + +/** + * For now DEBUGGER is only supported in Simulator + */ +namespace OHOS { +namespace ACELite { +enum DebugProtocol { TCP, SERIAL }; +enum DebugChannel { WEBSOCKET, RAWPACKET }; +const uint16_t DEFAULT_PORT = 5001; // default port +struct DebuggerConfig : public MemoryHeap { + DebugProtocol protocol; // use tcp as default + DebugChannel channel; // use websocket as default + uint32_t heapSize; // the JS heap size want to setup, count in bytes + uint16_t port; // used for tcp, default is 5001 + bool startDebuggerServer; // default is false + bool logToFile; // default print to stdout + bool snapshotMode; // if run in snapshot mode + char *logFilePath; // the log file path + DebuggerConfig() + : protocol(TCP), + channel(WEBSOCKET), + heapSize(0), + port(DEFAULT_PORT), + startDebuggerServer(false), + logToFile(false), + snapshotMode(false), + logFilePath(nullptr) + { + } +}; + +/** + * @class Debugger + * + * @brief: Enable to start jerry ensign debugger for current JS application. + * + * This is only available for windows simulator + */ +class Debugger final : public MemoryHeap { +public: + /** + * @brief Get the debugger instance + * + * @return an instance of debugger + */ + static Debugger &GetInstance() + { + static Debugger instance; + return instance; + } + Debugger() +#if ENABLED(ENGINE_DEBUGGER) + : consoleLogFileHandler_(nullptr), +#ifdef JS_ENGINE_EXTERNAL_CONTEXT + engineContext_(nullptr), +#endif // JS_ENGINE_EXTERNAL_CONTEXT + debuggerStarted_(false) +#endif // ENABLED(ENGINE_DEBUGGER) + {} + ~Debugger() = default; + + /** + * @brief Configure related debugger + */ + void ConfigDebugger(); + + /** + * @brief Get state of the debugger + * + * @return true to enable, false to disenable + */ + bool IsDebuggerEnabled(); + + /** + * @brief Make the debugger start + */ + void StartDebugger(); + + /** + * @brief Tear down the debugger + */ + void TearDownDebugger(); + + /** + * @brief Configure debugger based on the config file + * + * @param [out] config: The configuration of the debugger + */ + void ConfigEngineDebugger(DebuggerConfig &config); + + /** + * @brief Print out the log into stdout + * + * @param [in] str: Information about log + */ + void Output(const char *str); + + /** + * @brief Flush the output buffer of stream + */ + void FlushOutput(); + + /** + * @brief Setup jerry external context if needed + */ + void SetupJSContext(); + + /** + * @brief Release jerry external context + */ + void ReleaseJSContext(); +private: +#if ENABLED(ENGINE_DEBUGGER) + FILE *consoleLogFileHandler_; +#ifdef JS_ENGINE_EXTERNAL_CONTEXT + void *engineContext_; +#endif // JS_ENGINE_EXTERNAL_CONTEXT + bool debuggerStarted_; +#endif // ENABLED(ENGINE_DEBUGGER) + DebuggerConfig debuggerConfig_; +}; +} // namespace ACELite +} // namespace OHOS +#endif // OHOS_ACELITE_JS_DEBUGGER_CONFIG_H diff --git a/include/context/js_ability.h b/include/context/js_ability.h new file mode 100755 index 0000000..8cb34b3 --- /dev/null +++ b/include/context/js_ability.h @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2020 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. + */ + +#ifndef OHOS_ACELITE_JS_ABILITY_H +#define OHOS_ACELITE_JS_ABILITY_H + +#include +#include +#include +#include "memory_heap.h" + +namespace OHOS { +namespace ACELite { +/** + * As all the UI event handling is driven by the render tick, and to make sure the the event handling is + * in JS task, the HAL layer will transfer the TE event into the loop of JS task, when JS application go forground. + */ +typedef int32_t (*RenderTickHandler)(); + +class JSAbility final : public MemoryHeap { +public: + JSAbility(const JSAbility &) = delete; + JSAbility &operator=(const JSAbility &) = delete; + JSAbility(JSAbility &&) = delete; + JSAbility &operator=(JSAbility &&) = delete; + + /** + * @fn JSAbility::JSAbility() + * + * @brief Default constructor. + */ + JSAbility() : jsAbilityImpl_(nullptr) {} + + /** + * @fn virtual JSAbility::~JSAbility() + * + * @brief Destructor. + */ + virtual ~JSAbility() {} + + /** + * @fn JSAbility::Launch() + * + * @brief Call this function to create the JS runtime environment, and it will init + * the JS framework and eval abilityPath/src/index.js as well + * @param [in] the ability path to bundle name and token of this ability + */ + void Launch(const char *abilityPath, const char *bundleName, uint16_t token); + + /** + * @fn JSAbility::Show() + * + * @brief Call this function to active the application UI + */ + void Show() const; + + /** + * @fn JSAbility::Hide() + * + * @brief Call this function to move the current JS application to background + */ + void Hide() const; + + /** + * @fn JSAbility::TransferToDestroy() + * + * @brief Tear down JS runtime, release JS engine, and invoke user's onDestroy callback + */ + void TransferToDestroy(); + + /** + * @fn JSAbility::BackPressed() + * + * @brief Called by AbilityHost to notify back key has been pressed, JS ability will tear down + */ + void BackPressed(); + + /** + * @fn JSAbility::GetPackageName() + * + * @brief Return current package name + */ + static const char *GetPackageName(); + + /** + * @fn JSAbility::ForceDestroy() + * + * @brief Force to clean up the whole application + */ + void ForceDestroy(); + + /** + * @fn JSAbility::RegisterTEHandler() + * + * @brief Register render tick event handler + */ + static void RegisterTEHandler(RenderTickHandler handler); + + /** + * @fn JSAbility::HandleRenderTick() + * + * @brief Call the render tick if it's set + */ + void HandleRenderTick(); + +private: + // the holder of JS runtime and user' JS related environment + void *jsAbilityImpl_; +}; // class JSAbility +} // namespace ACELite +} // namespace OHOS +#endif // OHOS_ACELITE_JS_ABILITY_H \ No newline at end of file diff --git a/include/resource/video_panel_image_res.h b/include/resource/video_panel_image_res.h new file mode 100755 index 0000000..25fde81 --- /dev/null +++ b/include/resource/video_panel_image_res.h @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2020 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. + */ + +#ifndef OHOS_ACELITE_VIDEO_PANEL_IMAGE_RES_H +#define OHOS_ACELITE_VIDEO_PANEL_IMAGE_RES_H +#include "acelite_config.h" +#ifdef FEATURE_COMPONENT_VIDEO + +#include "image_info.h" +namespace OHOS { +namespace ACELite { +ImageInfo* GetVideoMutedImageOnInfo(); +ImageInfo* GetVideoMutedImageOffInfo(); +ImageInfo* GetVideoPlayImageOnInfo(); +ImageInfo* GetVideoPlayImageOffInfo(); +} // namespace ACELite +} // namespace OHOS +#endif // FEATURE_COMPONENT_VIDEO +#endif // OHOS_ACELITE_VIDEO_PANEL_IMAGE_RES_H \ No newline at end of file diff --git a/packages/runtime-core/.babelrc b/packages/runtime-core/.babelrc new file mode 100755 index 0000000..98f60b9 --- /dev/null +++ b/packages/runtime-core/.babelrc @@ -0,0 +1,5 @@ +{ + "presets": [ + ["@babel/env", { "exclude": ["@babel/plugin-transform-typeof-symbol"] }] + ] +} diff --git a/packages/runtime-core/.editorconfig b/packages/runtime-core/.editorconfig new file mode 100755 index 0000000..9ad0e21 --- /dev/null +++ b/packages/runtime-core/.editorconfig @@ -0,0 +1,12 @@ +# top-most EditorConfig file +root = true + +# Unix-style newlines with a newline ending every file +[*] +end_of_line = lf +insert_final_newline = true + +[*.js] +charset = utf-8 +indent_style = space +indent_size = 2 diff --git a/packages/runtime-core/.eslintignore b/packages/runtime-core/.eslintignore new file mode 100755 index 0000000..3e2e84b --- /dev/null +++ b/packages/runtime-core/.eslintignore @@ -0,0 +1,2 @@ +build/ +node_modules/ diff --git a/packages/runtime-core/.eslintrc.js b/packages/runtime-core/.eslintrc.js new file mode 100755 index 0000000..1c65168 --- /dev/null +++ b/packages/runtime-core/.eslintrc.js @@ -0,0 +1,22 @@ +module.exports = { + env: { + browser: true, + es6: true, + node: true + }, + extends: ['google'], + globals: { + profiler: 'readonly', + initStyleSheet: 'readonly' + }, + plugins: ['jest'], + parserOptions: { + ecmaVersion: 2018, + sourceType: 'module' + }, + rules: { + 'arrow-parens': ['error', 'as-needed'], + 'object-curly-spacing': ['error', 'always'], + 'comma-dangle': ['error', 'never'] + } +}; diff --git a/packages/runtime-core/.gitignore b/packages/runtime-core/.gitignore new file mode 100755 index 0000000..c4bb26f --- /dev/null +++ b/packages/runtime-core/.gitignore @@ -0,0 +1,3 @@ +node_modules +build +.npmrc \ No newline at end of file diff --git a/packages/runtime-core/.prettierrc b/packages/runtime-core/.prettierrc new file mode 100755 index 0000000..38d8cad --- /dev/null +++ b/packages/runtime-core/.prettierrc @@ -0,0 +1,6 @@ +{ + "semi": true, + "singleQuote": true, + "useTabs": false, + "tabWidth": 2 +} diff --git a/packages/runtime-core/.size-snapshot.json b/packages/runtime-core/.size-snapshot.json new file mode 100755 index 0000000..a9cba22 --- /dev/null +++ b/packages/runtime-core/.size-snapshot.json @@ -0,0 +1,22 @@ +{ + "framework-dev.js": { + "bundled": 13004, + "minified": 3111, + "gzipped": 1238 + }, + "framework.js": { + "bundled": 11443, + "minified": 2921, + "gzipped": 1170 + }, + "framework-dev.min.js": { + "bundled": 3111, + "minified": 3111, + "gzipped": 1237 + }, + "framework.min.js": { + "bundled": 2921, + "minified": 2921, + "gzipped": 1169 + } +} diff --git a/packages/runtime-core/package-lock.json b/packages/runtime-core/package-lock.json new file mode 100755 index 0000000..641af2a --- /dev/null +++ b/packages/runtime-core/package-lock.json @@ -0,0 +1,10289 @@ +{ + "name": "runtime-core", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@babel/cli": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/cli/download/@babel/cli-7.10.1.tgz?cache=0&sync_timestamp=1590618420451&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fcli%2Fdownload%2F%40babel%2Fcli-7.10.1.tgz", + "integrity": "sha1-tuXNQ6F7j2OUQqsCeXZAjr5teaA=", + "dev": true, + "requires": { + "chokidar": "^2.1.8", + "commander": "^4.0.1", + "convert-source-map": "^1.1.0", + "fs-readdir-recursive": "^1.1.0", + "glob": "^7.0.0", + "lodash": "^4.17.13", + "make-dir": "^2.1.0", + "slash": "^2.0.0", + "source-map": "^0.5.0" + } + }, + "@babel/code-frame": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/code-frame/download/@babel/code-frame-7.10.1.tgz?cache=0&sync_timestamp=1590617448103&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fcode-frame%2Fdownload%2F%40babel%2Fcode-frame-7.10.1.tgz", + "integrity": "sha1-1UgcUJXaocV+FuVMb5GYRDr7Sf8=", + "dev": true, + "requires": { + "@babel/highlight": "^7.10.1" + } + }, + "@babel/compat-data": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/compat-data/download/@babel/compat-data-7.10.1.tgz?cache=0&sync_timestamp=1590617980292&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fcompat-data%2Fdownload%2F%40babel%2Fcompat-data-7.10.1.tgz", + "integrity": "sha1-sQhf/nLNF78sDueQ/An5YmARsts=", + "dev": true, + "requires": { + "browserslist": "^4.12.0", + "invariant": "^2.2.4", + "semver": "^5.5.0" + } + }, + "@babel/core": { + "version": "7.10.2", + "resolved": "https://registry.npm.taobao.org/@babel/core/download/@babel/core-7.10.2.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fcore%2Fdownload%2F%40babel%2Fcore-7.10.2.tgz", + "integrity": "sha1-vWeGBGZoqSWsK9L9lbV5uSojs2o=", + "dev": true, + "requires": { + "@babel/code-frame": "^7.10.1", + "@babel/generator": "^7.10.2", + "@babel/helper-module-transforms": "^7.10.1", + "@babel/helpers": "^7.10.1", + "@babel/parser": "^7.10.2", + "@babel/template": "^7.10.1", + "@babel/traverse": "^7.10.1", + "@babel/types": "^7.10.2", + "convert-source-map": "^1.7.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.1", + "json5": "^2.1.2", + "lodash": "^4.17.13", + "resolve": "^1.3.2", + "semver": "^5.4.1", + "source-map": "^0.5.0" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npm.taobao.org/debug/download/debug-4.1.1.tgz?cache=0&sync_timestamp=1589881689076&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdebug%2Fdownload%2Fdebug-4.1.1.tgz", + "integrity": "sha1-O3ImAlUQnGtYnO4FDx1RYTlmR5E=", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npm.taobao.org/ms/download/ms-2.1.2.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fms%2Fdownload%2Fms-2.1.2.tgz", + "integrity": "sha1-0J0fNXtEP0kzgqjrPM0YOHKuYAk=", + "dev": true + } + } + }, + "@babel/generator": { + "version": "7.10.2", + "resolved": "https://registry.npm.taobao.org/@babel/generator/download/@babel/generator-7.10.2.tgz?cache=0&sync_timestamp=1590868955737&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fgenerator%2Fdownload%2F%40babel%2Fgenerator-7.10.2.tgz", + "integrity": "sha1-D6W1sjiduL/fzDSStVHuIPXdaak=", + "dev": true, + "requires": { + "@babel/types": "^7.10.2", + "jsesc": "^2.5.1", + "lodash": "^4.17.13", + "source-map": "^0.5.0" + } + }, + "@babel/helper-annotate-as-pure": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/helper-annotate-as-pure/download/@babel/helper-annotate-as-pure-7.10.1.tgz", + "integrity": "sha1-9tCKzG9wu9WbQ2JiVT+y4lmhomg=", + "dev": true, + "requires": { + "@babel/types": "^7.10.1" + } + }, + "@babel/helper-builder-binary-assignment-operator-visitor": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/helper-builder-binary-assignment-operator-visitor/download/@babel/helper-builder-binary-assignment-operator-visitor-7.10.1.tgz", + "integrity": "sha1-DsfZvoF0k0UyZh+HeD6xjXIpAFk=", + "dev": true, + "requires": { + "@babel/helper-explode-assignable-expression": "^7.10.1", + "@babel/types": "^7.10.1" + } + }, + "@babel/helper-compilation-targets": { + "version": "7.10.2", + "resolved": "https://registry.npm.taobao.org/@babel/helper-compilation-targets/download/@babel/helper-compilation-targets-7.10.2.tgz?cache=0&sync_timestamp=1590869015082&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fhelper-compilation-targets%2Fdownload%2F%40babel%2Fhelper-compilation-targets-7.10.2.tgz", + "integrity": "sha1-oX2XI7bix1ApnSoU1GN8dpNtgoU=", + "dev": true, + "requires": { + "@babel/compat-data": "^7.10.1", + "browserslist": "^4.12.0", + "invariant": "^2.2.4", + "levenary": "^1.1.1", + "semver": "^5.5.0" + } + }, + "@babel/helper-create-class-features-plugin": { + "version": "7.10.2", + "resolved": "https://registry.npm.taobao.org/@babel/helper-create-class-features-plugin/download/@babel/helper-create-class-features-plugin-7.10.2.tgz?cache=0&sync_timestamp=1590869014139&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fhelper-create-class-features-plugin%2Fdownload%2F%40babel%2Fhelper-create-class-features-plugin-7.10.2.tgz", + "integrity": "sha1-dHQpV3DyF9vPKIv3Vy6yE9tG7mc=", + "dev": true, + "requires": { + "@babel/helper-function-name": "^7.10.1", + "@babel/helper-member-expression-to-functions": "^7.10.1", + "@babel/helper-optimise-call-expression": "^7.10.1", + "@babel/helper-plugin-utils": "^7.10.1", + "@babel/helper-replace-supers": "^7.10.1", + "@babel/helper-split-export-declaration": "^7.10.1" + } + }, + "@babel/helper-create-regexp-features-plugin": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/helper-create-regexp-features-plugin/download/@babel/helper-create-regexp-features-plugin-7.10.1.tgz", + "integrity": "sha1-G4/uqxWUy8+/OrWju8q6wEaO/b0=", + "dev": true, + "requires": { + "@babel/helper-annotate-as-pure": "^7.10.1", + "@babel/helper-regex": "^7.10.1", + "regexpu-core": "^4.7.0" + } + }, + "@babel/helper-define-map": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/helper-define-map/download/@babel/helper-define-map-7.10.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fhelper-define-map%2Fdownload%2F%40babel%2Fhelper-define-map-7.10.1.tgz", + "integrity": "sha1-XmnugwhkhHDdeQDRWcBEwQKFIh0=", + "dev": true, + "requires": { + "@babel/helper-function-name": "^7.10.1", + "@babel/types": "^7.10.1", + "lodash": "^4.17.13" + } + }, + "@babel/helper-explode-assignable-expression": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/helper-explode-assignable-expression/download/@babel/helper-explode-assignable-expression-7.10.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fhelper-explode-assignable-expression%2Fdownload%2F%40babel%2Fhelper-explode-assignable-expression-7.10.1.tgz", + "integrity": "sha1-6ddjBe4RYspGc1euJd+U8XmvK34=", + "dev": true, + "requires": { + "@babel/traverse": "^7.10.1", + "@babel/types": "^7.10.1" + } + }, + "@babel/helper-function-name": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/helper-function-name/download/@babel/helper-function-name-7.10.1.tgz?cache=0&sync_timestamp=1590617676520&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fhelper-function-name%2Fdownload%2F%40babel%2Fhelper-function-name-7.10.1.tgz", + "integrity": "sha1-kr1jgpv8khWsqdne+oX1a1OUVPQ=", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "^7.10.1", + "@babel/template": "^7.10.1", + "@babel/types": "^7.10.1" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/helper-get-function-arity/download/@babel/helper-get-function-arity-7.10.1.tgz?cache=0&sync_timestamp=1590617610245&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fhelper-get-function-arity%2Fdownload%2F%40babel%2Fhelper-get-function-arity-7.10.1.tgz", + "integrity": "sha1-cwM5CoG6fLWWE4laGSuThQ43P30=", + "dev": true, + "requires": { + "@babel/types": "^7.10.1" + } + }, + "@babel/helper-hoist-variables": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/helper-hoist-variables/download/@babel/helper-hoist-variables-7.10.1.tgz", + "integrity": "sha1-fnfILl3K4evxIxdMOFqq2/eH0Hc=", + "dev": true, + "requires": { + "@babel/types": "^7.10.1" + } + }, + "@babel/helper-member-expression-to-functions": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/helper-member-expression-to-functions/download/@babel/helper-member-expression-to-functions-7.10.1.tgz", + "integrity": "sha1-Qyln/X4SpK/vZsRofUyiK8BFbxU=", + "dev": true, + "requires": { + "@babel/types": "^7.10.1" + } + }, + "@babel/helper-module-imports": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/helper-module-imports/download/@babel/helper-module-imports-7.10.1.tgz", + "integrity": "sha1-3TMb1FvMxWbOdwBOnQX+F63ROHY=", + "dev": true, + "requires": { + "@babel/types": "^7.10.1" + } + }, + "@babel/helper-module-transforms": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/helper-module-transforms/download/@babel/helper-module-transforms-7.10.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fhelper-module-transforms%2Fdownload%2F%40babel%2Fhelper-module-transforms-7.10.1.tgz", + "integrity": "sha1-JOLwjuaDLGCxV7sJNshr73IQxiI=", + "dev": true, + "requires": { + "@babel/helper-module-imports": "^7.10.1", + "@babel/helper-replace-supers": "^7.10.1", + "@babel/helper-simple-access": "^7.10.1", + "@babel/helper-split-export-declaration": "^7.10.1", + "@babel/template": "^7.10.1", + "@babel/types": "^7.10.1", + "lodash": "^4.17.13" + } + }, + "@babel/helper-optimise-call-expression": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/helper-optimise-call-expression/download/@babel/helper-optimise-call-expression-7.10.1.tgz", + "integrity": "sha1-tKHyVhhwzhJHzt2wKjhg+pbXJUM=", + "dev": true, + "requires": { + "@babel/types": "^7.10.1" + } + }, + "@babel/helper-plugin-utils": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/helper-plugin-utils/download/@babel/helper-plugin-utils-7.10.1.tgz?cache=0&sync_timestamp=1590617710577&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fhelper-plugin-utils%2Fdownload%2F%40babel%2Fhelper-plugin-utils-7.10.1.tgz", + "integrity": "sha1-7Fpc8O7JJbZsYFgDKLEiwBIwoSc=", + "dev": true + }, + "@babel/helper-regex": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/helper-regex/download/@babel/helper-regex-7.10.1.tgz?cache=0&sync_timestamp=1590617980092&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fhelper-regex%2Fdownload%2F%40babel%2Fhelper-regex-7.10.1.tgz", + "integrity": "sha1-Ahzxp7qZgi+ZMiKgAcw/7IMlW5Y=", + "dev": true, + "requires": { + "lodash": "^4.17.13" + } + }, + "@babel/helper-remap-async-to-generator": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/helper-remap-async-to-generator/download/@babel/helper-remap-async-to-generator-7.10.1.tgz", + "integrity": "sha1-utaqpP85zo1Lgsyq4L/g99u19DI=", + "dev": true, + "requires": { + "@babel/helper-annotate-as-pure": "^7.10.1", + "@babel/helper-wrap-function": "^7.10.1", + "@babel/template": "^7.10.1", + "@babel/traverse": "^7.10.1", + "@babel/types": "^7.10.1" + } + }, + "@babel/helper-replace-supers": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/helper-replace-supers/download/@babel/helper-replace-supers-7.10.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fhelper-replace-supers%2Fdownload%2F%40babel%2Fhelper-replace-supers-7.10.1.tgz", + "integrity": "sha1-7GhZ0gxdgIf2otxOAU23Iol18T0=", + "dev": true, + "requires": { + "@babel/helper-member-expression-to-functions": "^7.10.1", + "@babel/helper-optimise-call-expression": "^7.10.1", + "@babel/traverse": "^7.10.1", + "@babel/types": "^7.10.1" + } + }, + "@babel/helper-simple-access": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/helper-simple-access/download/@babel/helper-simple-access-7.10.1.tgz", + "integrity": "sha1-CPt+Iqzp64Mm9+OSChwgUvE9hR4=", + "dev": true, + "requires": { + "@babel/template": "^7.10.1", + "@babel/types": "^7.10.1" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/helper-split-export-declaration/download/@babel/helper-split-export-declaration-7.10.1.tgz?cache=0&sync_timestamp=1590617609914&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fhelper-split-export-declaration%2Fdownload%2F%40babel%2Fhelper-split-export-declaration-7.10.1.tgz", + "integrity": "sha1-xvS+HLwV46ho5MZKF9XTHXVNo18=", + "dev": true, + "requires": { + "@babel/types": "^7.10.1" + } + }, + "@babel/helper-validator-identifier": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/helper-validator-identifier/download/@babel/helper-validator-identifier-7.10.1.tgz", + "integrity": "sha1-V3CwwagmxPU/Xt5eFTFj4DGOlLU=", + "dev": true + }, + "@babel/helper-wrap-function": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/helper-wrap-function/download/@babel/helper-wrap-function-7.10.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fhelper-wrap-function%2Fdownload%2F%40babel%2Fhelper-wrap-function-7.10.1.tgz", + "integrity": "sha1-lW0TENZpYlenr9R+TELf2l387ck=", + "dev": true, + "requires": { + "@babel/helper-function-name": "^7.10.1", + "@babel/template": "^7.10.1", + "@babel/traverse": "^7.10.1", + "@babel/types": "^7.10.1" + } + }, + "@babel/helpers": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/helpers/download/@babel/helpers-7.10.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fhelpers%2Fdownload%2F%40babel%2Fhelpers-7.10.1.tgz", + "integrity": "sha1-poJ7fLl1ydnO9f1h2Rn2DYhEqXM=", + "dev": true, + "requires": { + "@babel/template": "^7.10.1", + "@babel/traverse": "^7.10.1", + "@babel/types": "^7.10.1" + } + }, + "@babel/highlight": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/highlight/download/@babel/highlight-7.10.1.tgz?cache=0&sync_timestamp=1590617443727&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fhighlight%2Fdownload%2F%40babel%2Fhighlight-7.10.1.tgz", + "integrity": "sha1-hB0Ji6YTuhpCeis4PXnjVVLDiuA=", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.10.1", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "@babel/parser": { + "version": "7.10.2", + "resolved": "https://registry.npm.taobao.org/@babel/parser/download/@babel/parser-7.10.2.tgz?cache=0&sync_timestamp=1590869015720&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fparser%2Fdownload%2F%40babel%2Fparser-7.10.2.tgz", + "integrity": "sha1-hxgH8QRCuS/5fkeDubVPagyoEtA=", + "dev": true + }, + "@babel/plugin-proposal-async-generator-functions": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/plugin-proposal-async-generator-functions/download/@babel/plugin-proposal-async-generator-functions-7.10.1.tgz", + "integrity": "sha1-aRGvW6LmFcT/PEl/4vR7Nb9tflU=", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.1", + "@babel/helper-remap-async-to-generator": "^7.10.1", + "@babel/plugin-syntax-async-generators": "^7.8.0" + } + }, + "@babel/plugin-proposal-class-properties": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/plugin-proposal-class-properties/download/@babel/plugin-proposal-class-properties-7.10.1.tgz", + "integrity": "sha1-BGvH9lULsI2b0dTwYPX1pPEIfgE=", + "dev": true, + "requires": { + "@babel/helper-create-class-features-plugin": "^7.10.1", + "@babel/helper-plugin-utils": "^7.10.1" + } + }, + "@babel/plugin-proposal-dynamic-import": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/plugin-proposal-dynamic-import/download/@babel/plugin-proposal-dynamic-import-7.10.1.tgz?cache=0&sync_timestamp=1590617973039&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fplugin-proposal-dynamic-import%2Fdownload%2F%40babel%2Fplugin-proposal-dynamic-import-7.10.1.tgz", + "integrity": "sha1-42l53B3Dtz9taBb8SVHaI2NIjvA=", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.1", + "@babel/plugin-syntax-dynamic-import": "^7.8.0" + } + }, + "@babel/plugin-proposal-json-strings": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/plugin-proposal-json-strings/download/@babel/plugin-proposal-json-strings-7.10.1.tgz?cache=0&sync_timestamp=1590617715702&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fplugin-proposal-json-strings%2Fdownload%2F%40babel%2Fplugin-proposal-json-strings-7.10.1.tgz", + "integrity": "sha1-seaR7iTGUbWl4yITIisjeXNK/wk=", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.1", + "@babel/plugin-syntax-json-strings": "^7.8.0" + } + }, + "@babel/plugin-proposal-nullish-coalescing-operator": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/plugin-proposal-nullish-coalescing-operator/download/@babel/plugin-proposal-nullish-coalescing-operator-7.10.1.tgz", + "integrity": "sha1-AtyiFnOEL/L+djrCU3d/I16bv3g=", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.1", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.0" + } + }, + "@babel/plugin-proposal-numeric-separator": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/plugin-proposal-numeric-separator/download/@babel/plugin-proposal-numeric-separator-7.10.1.tgz?cache=0&sync_timestamp=1590617964898&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fplugin-proposal-numeric-separator%2Fdownload%2F%40babel%2Fplugin-proposal-numeric-separator-7.10.1.tgz", + "integrity": "sha1-qaOLw094vf2YHnkcJ8b9zsR4wSM=", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.1", + "@babel/plugin-syntax-numeric-separator": "^7.10.1" + } + }, + "@babel/plugin-proposal-object-rest-spread": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/plugin-proposal-object-rest-spread/download/@babel/plugin-proposal-object-rest-spread-7.10.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fplugin-proposal-object-rest-spread%2Fdownload%2F%40babel%2Fplugin-proposal-object-rest-spread-7.10.1.tgz", + "integrity": "sha1-y6RJCKyfFCZQtKZbiqBr80eNX7Y=", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.1", + "@babel/plugin-syntax-object-rest-spread": "^7.8.0", + "@babel/plugin-transform-parameters": "^7.10.1" + } + }, + "@babel/plugin-proposal-optional-catch-binding": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/plugin-proposal-optional-catch-binding/download/@babel/plugin-proposal-optional-catch-binding-7.10.1.tgz?cache=0&sync_timestamp=1590617710346&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fplugin-proposal-optional-catch-binding%2Fdownload%2F%40babel%2Fplugin-proposal-optional-catch-binding-7.10.1.tgz", + "integrity": "sha1-yfhtmTBfn6UxtWj/WrjJZLiyI9I=", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.1", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.0" + } + }, + "@babel/plugin-proposal-optional-chaining": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/plugin-proposal-optional-chaining/download/@babel/plugin-proposal-optional-chaining-7.10.1.tgz?cache=0&sync_timestamp=1590617794180&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fplugin-proposal-optional-chaining%2Fdownload%2F%40babel%2Fplugin-proposal-optional-chaining-7.10.1.tgz", + "integrity": "sha1-FfXW0icIYpRRqRvij4+sxVsOgYw=", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.1", + "@babel/plugin-syntax-optional-chaining": "^7.8.0" + } + }, + "@babel/plugin-proposal-private-methods": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/plugin-proposal-private-methods/download/@babel/plugin-proposal-private-methods-7.10.1.tgz", + "integrity": "sha1-7YXoBYqw/jCcP0SOXhtzyonNtZg=", + "dev": true, + "requires": { + "@babel/helper-create-class-features-plugin": "^7.10.1", + "@babel/helper-plugin-utils": "^7.10.1" + } + }, + "@babel/plugin-proposal-unicode-property-regex": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/plugin-proposal-unicode-property-regex/download/@babel/plugin-proposal-unicode-property-regex-7.10.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fplugin-proposal-unicode-property-regex%2Fdownload%2F%40babel%2Fplugin-proposal-unicode-property-regex-7.10.1.tgz", + "integrity": "sha1-3AT+sl4t1wwSsF1oAZDhOPosDG8=", + "dev": true, + "requires": { + "@babel/helper-create-regexp-features-plugin": "^7.10.1", + "@babel/helper-plugin-utils": "^7.10.1" + } + }, + "@babel/plugin-syntax-async-generators": { + "version": "7.8.4", + "resolved": "https://registry.npm.taobao.org/@babel/plugin-syntax-async-generators/download/@babel/plugin-syntax-async-generators-7.8.4.tgz", + "integrity": "sha1-qYP7Gusuw/btBCohD2QOkOeG/g0=", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-bigint": { + "version": "7.8.3", + "resolved": "https://registry.npm.taobao.org/@babel/plugin-syntax-bigint/download/@babel/plugin-syntax-bigint-7.8.3.tgz", + "integrity": "sha1-TJpvZp9dDN8bkKFnHpoUa+UwDOo=", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-class-properties": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/plugin-syntax-class-properties/download/@babel/plugin-syntax-class-properties-7.10.1.tgz", + "integrity": "sha1-1bwGRZE99bF61+2g+iMIMwveNMU=", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.1" + } + }, + "@babel/plugin-syntax-dynamic-import": { + "version": "7.8.3", + "resolved": "https://registry.npm.taobao.org/@babel/plugin-syntax-dynamic-import/download/@babel/plugin-syntax-dynamic-import-7.8.3.tgz", + "integrity": "sha1-Yr+Ysto80h1iYVT8lu5bPLaOrLM=", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-json-strings": { + "version": "7.8.3", + "resolved": "https://registry.npm.taobao.org/@babel/plugin-syntax-json-strings/download/@babel/plugin-syntax-json-strings-7.8.3.tgz", + "integrity": "sha1-AcohtmjNghjJ5kDLbdiMVBKyyWo=", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-logical-assignment-operators": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/plugin-syntax-logical-assignment-operators/download/@babel/plugin-syntax-logical-assignment-operators-7.10.1.tgz", + "integrity": "sha1-//7ne0k0znfztCdkns3dvsGVhVA=", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.1" + } + }, + "@babel/plugin-syntax-nullish-coalescing-operator": { + "version": "7.8.3", + "resolved": "https://registry.npm.taobao.org/@babel/plugin-syntax-nullish-coalescing-operator/download/@babel/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", + "integrity": "sha1-Fn7XA2iIYIH3S1w2xlqIwDtm0ak=", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-numeric-separator": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/plugin-syntax-numeric-separator/download/@babel/plugin-syntax-numeric-separator-7.10.1.tgz?cache=0&sync_timestamp=1590617975297&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fplugin-syntax-numeric-separator%2Fdownload%2F%40babel%2Fplugin-syntax-numeric-separator-7.10.1.tgz", + "integrity": "sha1-JXYe50ELyM+XMnunQe6U5KYbfZk=", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.1" + } + }, + "@babel/plugin-syntax-object-rest-spread": { + "version": "7.8.3", + "resolved": "https://registry.npm.taobao.org/@babel/plugin-syntax-object-rest-spread/download/@babel/plugin-syntax-object-rest-spread-7.8.3.tgz", + "integrity": "sha1-YOIl7cvZimQDMqLnLdPmbxr1WHE=", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-optional-catch-binding": { + "version": "7.8.3", + "resolved": "https://registry.npm.taobao.org/@babel/plugin-syntax-optional-catch-binding/download/@babel/plugin-syntax-optional-catch-binding-7.8.3.tgz", + "integrity": "sha1-YRGiZbz7Ag6579D9/X0mQCue1sE=", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-optional-chaining": { + "version": "7.8.3", + "resolved": "https://registry.npm.taobao.org/@babel/plugin-syntax-optional-chaining/download/@babel/plugin-syntax-optional-chaining-7.8.3.tgz", + "integrity": "sha1-T2nCq5UWfgGAzVM2YT+MV4j31Io=", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.8.0" + } + }, + "@babel/plugin-syntax-top-level-await": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/plugin-syntax-top-level-await/download/@babel/plugin-syntax-top-level-await-7.10.1.tgz?cache=0&sync_timestamp=1590617976470&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fplugin-syntax-top-level-await%2Fdownload%2F%40babel%2Fplugin-syntax-top-level-await-7.10.1.tgz", + "integrity": "sha1-i4cz+MVzl7PqpH3bqIQVhtyu82I=", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.1" + } + }, + "@babel/plugin-transform-arrow-functions": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/plugin-transform-arrow-functions/download/@babel/plugin-transform-arrow-functions-7.10.1.tgz?cache=0&sync_timestamp=1590617719041&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fplugin-transform-arrow-functions%2Fdownload%2F%40babel%2Fplugin-transform-arrow-functions-7.10.1.tgz", + "integrity": "sha1-y17jo28IY8BurQtAm0zEOoibKVs=", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.1" + } + }, + "@babel/plugin-transform-async-to-generator": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/plugin-transform-async-to-generator/download/@babel/plugin-transform-async-to-generator-7.10.1.tgz", + "integrity": "sha1-5RU+saPgKPeRlO2Kekv1X4YrIGI=", + "dev": true, + "requires": { + "@babel/helper-module-imports": "^7.10.1", + "@babel/helper-plugin-utils": "^7.10.1", + "@babel/helper-remap-async-to-generator": "^7.10.1" + } + }, + "@babel/plugin-transform-block-scoped-functions": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/plugin-transform-block-scoped-functions/download/@babel/plugin-transform-block-scoped-functions-7.10.1.tgz?cache=0&sync_timestamp=1590617713512&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fplugin-transform-block-scoped-functions%2Fdownload%2F%40babel%2Fplugin-transform-block-scoped-functions-7.10.1.tgz", + "integrity": "sha1-FGhW51bVSyD/8UuBlFaz4BgguF0=", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.1" + } + }, + "@babel/plugin-transform-block-scoping": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/plugin-transform-block-scoping/download/@babel/plugin-transform-block-scoping-7.10.1.tgz?cache=0&sync_timestamp=1590617960007&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fplugin-transform-block-scoping%2Fdownload%2F%40babel%2Fplugin-transform-block-scoping-7.10.1.tgz", + "integrity": "sha1-Rwktico0WBFFHNDcXZFgWYJwXV4=", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.1", + "lodash": "^4.17.13" + } + }, + "@babel/plugin-transform-classes": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/plugin-transform-classes/download/@babel/plugin-transform-classes-7.10.1.tgz", + "integrity": "sha1-bhHdbE365w9UBICkcCR37XZtcz8=", + "dev": true, + "requires": { + "@babel/helper-annotate-as-pure": "^7.10.1", + "@babel/helper-define-map": "^7.10.1", + "@babel/helper-function-name": "^7.10.1", + "@babel/helper-optimise-call-expression": "^7.10.1", + "@babel/helper-plugin-utils": "^7.10.1", + "@babel/helper-replace-supers": "^7.10.1", + "@babel/helper-split-export-declaration": "^7.10.1", + "globals": "^11.1.0" + } + }, + "@babel/plugin-transform-computed-properties": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/plugin-transform-computed-properties/download/@babel/plugin-transform-computed-properties-7.10.1.tgz?cache=0&sync_timestamp=1590617359252&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fplugin-transform-computed-properties%2Fdownload%2F%40babel%2Fplugin-transform-computed-properties-7.10.1.tgz", + "integrity": "sha1-Wao5kGRCnWTc5c9275uQtyRevQc=", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.1" + } + }, + "@babel/plugin-transform-destructuring": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/plugin-transform-destructuring/download/@babel/plugin-transform-destructuring-7.10.1.tgz?cache=0&sync_timestamp=1590617719855&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fplugin-transform-destructuring%2Fdownload%2F%40babel%2Fplugin-transform-destructuring-7.10.1.tgz", + "integrity": "sha1-q9WOUTN4Fco6IqM2uF9iuZjnGQc=", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.1" + } + }, + "@babel/plugin-transform-dotall-regex": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/plugin-transform-dotall-regex/download/@babel/plugin-transform-dotall-regex-7.10.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fplugin-transform-dotall-regex%2Fdownload%2F%40babel%2Fplugin-transform-dotall-regex-7.10.1.tgz", + "integrity": "sha1-kguf7C14u1frtkpkTVwrpnzBBO4=", + "dev": true, + "requires": { + "@babel/helper-create-regexp-features-plugin": "^7.10.1", + "@babel/helper-plugin-utils": "^7.10.1" + } + }, + "@babel/plugin-transform-duplicate-keys": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/plugin-transform-duplicate-keys/download/@babel/plugin-transform-duplicate-keys-7.10.1.tgz?cache=0&sync_timestamp=1590617721219&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fplugin-transform-duplicate-keys%2Fdownload%2F%40babel%2Fplugin-transform-duplicate-keys-7.10.1.tgz", + "integrity": "sha1-yQCnk76wlrydTQqdDN4ZUY/8g7k=", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.1" + } + }, + "@babel/plugin-transform-exponentiation-operator": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/plugin-transform-exponentiation-operator/download/@babel/plugin-transform-exponentiation-operator-7.10.1.tgz", + "integrity": "sha1-J5wxFnVqYN1ub15Ii6eVfbnFnrM=", + "dev": true, + "requires": { + "@babel/helper-builder-binary-assignment-operator-visitor": "^7.10.1", + "@babel/helper-plugin-utils": "^7.10.1" + } + }, + "@babel/plugin-transform-for-of": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/plugin-transform-for-of/download/@babel/plugin-transform-for-of-7.10.1.tgz?cache=0&sync_timestamp=1590617722286&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fplugin-transform-for-of%2Fdownload%2F%40babel%2Fplugin-transform-for-of-7.10.1.tgz", + "integrity": "sha1-/wERl4TrDuMiWOhkYVe6JQH8/aU=", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.1" + } + }, + "@babel/plugin-transform-function-name": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/plugin-transform-function-name/download/@babel/plugin-transform-function-name-7.10.1.tgz", + "integrity": "sha1-TtRv1uHY/eKi7HsDxm2FPSySQn0=", + "dev": true, + "requires": { + "@babel/helper-function-name": "^7.10.1", + "@babel/helper-plugin-utils": "^7.10.1" + } + }, + "@babel/plugin-transform-literals": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/plugin-transform-literals/download/@babel/plugin-transform-literals-7.10.1.tgz?cache=0&sync_timestamp=1590617718177&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fplugin-transform-literals%2Fdownload%2F%40babel%2Fplugin-transform-literals-7.10.1.tgz", + "integrity": "sha1-V5T42oKEayLk5mMeoWWLznCOtGo=", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.1" + } + }, + "@babel/plugin-transform-member-expression-literals": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/plugin-transform-member-expression-literals/download/@babel/plugin-transform-member-expression-literals-7.10.1.tgz?cache=0&sync_timestamp=1590617977421&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fplugin-transform-member-expression-literals%2Fdownload%2F%40babel%2Fplugin-transform-member-expression-literals-7.10.1.tgz", + "integrity": "sha1-kDR8ujG8pvOUs/e9ldK7/Z/OLzk=", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.1" + } + }, + "@babel/plugin-transform-modules-amd": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/plugin-transform-modules-amd/download/@babel/plugin-transform-modules-amd-7.10.1.tgz", + "integrity": "sha1-ZZUOjgV5fr0v5TK5bhn8VIKh1So=", + "dev": true, + "requires": { + "@babel/helper-module-transforms": "^7.10.1", + "@babel/helper-plugin-utils": "^7.10.1", + "babel-plugin-dynamic-import-node": "^2.3.3" + } + }, + "@babel/plugin-transform-modules-commonjs": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/plugin-transform-modules-commonjs/download/@babel/plugin-transform-modules-commonjs-7.10.1.tgz", + "integrity": "sha1-1f9LRBPtl//e2ZlhBW4fuYD7kwE=", + "dev": true, + "requires": { + "@babel/helper-module-transforms": "^7.10.1", + "@babel/helper-plugin-utils": "^7.10.1", + "@babel/helper-simple-access": "^7.10.1", + "babel-plugin-dynamic-import-node": "^2.3.3" + } + }, + "@babel/plugin-transform-modules-systemjs": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/plugin-transform-modules-systemjs/download/@babel/plugin-transform-modules-systemjs-7.10.1.tgz", + "integrity": "sha1-mWLksKxqry4gQxraPY7HIILL/7Y=", + "dev": true, + "requires": { + "@babel/helper-hoist-variables": "^7.10.1", + "@babel/helper-module-transforms": "^7.10.1", + "@babel/helper-plugin-utils": "^7.10.1", + "babel-plugin-dynamic-import-node": "^2.3.3" + } + }, + "@babel/plugin-transform-modules-umd": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/plugin-transform-modules-umd/download/@babel/plugin-transform-modules-umd-7.10.1.tgz", + "integrity": "sha1-6ggJEf/G6yGEClGXo57eTuZ7FZU=", + "dev": true, + "requires": { + "@babel/helper-module-transforms": "^7.10.1", + "@babel/helper-plugin-utils": "^7.10.1" + } + }, + "@babel/plugin-transform-named-capturing-groups-regex": { + "version": "7.8.3", + "resolved": "https://registry.npm.taobao.org/@babel/plugin-transform-named-capturing-groups-regex/download/@babel/plugin-transform-named-capturing-groups-regex-7.8.3.tgz", + "integrity": "sha1-oqcr/6ICrA4tBQav0JOcXsvEjGw=", + "dev": true, + "requires": { + "@babel/helper-create-regexp-features-plugin": "^7.8.3" + } + }, + "@babel/plugin-transform-new-target": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/plugin-transform-new-target/download/@babel/plugin-transform-new-target-7.10.1.tgz", + "integrity": "sha1-buQaXmSNp2MuIrb7VAEuh/YS8yQ=", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.1" + } + }, + "@babel/plugin-transform-object-super": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/plugin-transform-object-super/download/@babel/plugin-transform-object-super-7.10.1.tgz", + "integrity": "sha1-LjAWsK2/JimDvw1RIdZ2pe2cT94=", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.1", + "@babel/helper-replace-supers": "^7.10.1" + } + }, + "@babel/plugin-transform-parameters": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/plugin-transform-parameters/download/@babel/plugin-transform-parameters-7.10.1.tgz", + "integrity": "sha1-slk4o8X64DVBRKcgsHsydm9oPd0=", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "^7.10.1", + "@babel/helper-plugin-utils": "^7.10.1" + } + }, + "@babel/plugin-transform-property-literals": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/plugin-transform-property-literals/download/@babel/plugin-transform-property-literals-7.10.1.tgz?cache=0&sync_timestamp=1590617977570&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fplugin-transform-property-literals%2Fdownload%2F%40babel%2Fplugin-transform-property-literals-7.10.1.tgz", + "integrity": "sha1-z/xzFSGSMO2B3FPkYlv4aBW2BQ0=", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.1" + } + }, + "@babel/plugin-transform-regenerator": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/plugin-transform-regenerator/download/@babel/plugin-transform-regenerator-7.10.1.tgz?cache=0&sync_timestamp=1590617710070&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fplugin-transform-regenerator%2Fdownload%2F%40babel%2Fplugin-transform-regenerator-7.10.1.tgz", + "integrity": "sha1-EOF1y+e9tjzJs5+bP4I8XHxcVJA=", + "dev": true, + "requires": { + "regenerator-transform": "^0.14.2" + } + }, + "@babel/plugin-transform-reserved-words": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/plugin-transform-reserved-words/download/@babel/plugin-transform-reserved-words-7.10.1.tgz?cache=0&sync_timestamp=1590617979776&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fplugin-transform-reserved-words%2Fdownload%2F%40babel%2Fplugin-transform-reserved-words-7.10.1.tgz", + "integrity": "sha1-D8ECcxK00cMnaleJDIrjvMC2SoY=", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.1" + } + }, + "@babel/plugin-transform-shorthand-properties": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/plugin-transform-shorthand-properties/download/@babel/plugin-transform-shorthand-properties-7.10.1.tgz", + "integrity": "sha1-6LVPI4ocy65ILE3OlGGArnsxQ/M=", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.1" + } + }, + "@babel/plugin-transform-spread": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/plugin-transform-spread/download/@babel/plugin-transform-spread-7.10.1.tgz", + "integrity": "sha1-DG1higxEYaJ0QYRgooycz1I5p8g=", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.1" + } + }, + "@babel/plugin-transform-sticky-regex": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/plugin-transform-sticky-regex/download/@babel/plugin-transform-sticky-regex-7.10.1.tgz?cache=0&sync_timestamp=1590617963477&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fplugin-transform-sticky-regex%2Fdownload%2F%40babel%2Fplugin-transform-sticky-regex-7.10.1.tgz", + "integrity": "sha1-kPyJt1JiKL7ZhCz/NYgnCno5OwA=", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.1", + "@babel/helper-regex": "^7.10.1" + } + }, + "@babel/plugin-transform-template-literals": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/plugin-transform-template-literals/download/@babel/plugin-transform-template-literals-7.10.1.tgz", + "integrity": "sha1-kUx7f0dSxXDqAFU7QoTa2AcOhig=", + "dev": true, + "requires": { + "@babel/helper-annotate-as-pure": "^7.10.1", + "@babel/helper-plugin-utils": "^7.10.1" + } + }, + "@babel/plugin-transform-typeof-symbol": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/plugin-transform-typeof-symbol/download/@babel/plugin-transform-typeof-symbol-7.10.1.tgz", + "integrity": "sha1-YMAjm2mWXRZrgKhN5zFcG8fguw4=", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.1" + } + }, + "@babel/plugin-transform-unicode-escapes": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/plugin-transform-unicode-escapes/download/@babel/plugin-transform-unicode-escapes-7.10.1.tgz?cache=0&sync_timestamp=1590617592403&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fplugin-transform-unicode-escapes%2Fdownload%2F%40babel%2Fplugin-transform-unicode-escapes-7.10.1.tgz", + "integrity": "sha1-rdD4SD2rYFcNngPOzvbAI6qMmUA=", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.10.1" + } + }, + "@babel/plugin-transform-unicode-regex": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/plugin-transform-unicode-regex/download/@babel/plugin-transform-unicode-regex-7.10.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fplugin-transform-unicode-regex%2Fdownload%2F%40babel%2Fplugin-transform-unicode-regex-7.10.1.tgz", + "integrity": "sha1-a1jyrqe2jfN6xQJdnIh1JEOmtD8=", + "dev": true, + "requires": { + "@babel/helper-create-regexp-features-plugin": "^7.10.1", + "@babel/helper-plugin-utils": "^7.10.1" + } + }, + "@babel/preset-env": { + "version": "7.10.2", + "resolved": "https://registry.npm.taobao.org/@babel/preset-env/download/@babel/preset-env-7.10.2.tgz?cache=0&sync_timestamp=1590868958159&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fpreset-env%2Fdownload%2F%40babel%2Fpreset-env-7.10.2.tgz", + "integrity": "sha1-cVkw8s+Fc7CSgAXuVivtUvtl/fs=", + "dev": true, + "requires": { + "@babel/compat-data": "^7.10.1", + "@babel/helper-compilation-targets": "^7.10.2", + "@babel/helper-module-imports": "^7.10.1", + "@babel/helper-plugin-utils": "^7.10.1", + "@babel/plugin-proposal-async-generator-functions": "^7.10.1", + "@babel/plugin-proposal-class-properties": "^7.10.1", + "@babel/plugin-proposal-dynamic-import": "^7.10.1", + "@babel/plugin-proposal-json-strings": "^7.10.1", + "@babel/plugin-proposal-nullish-coalescing-operator": "^7.10.1", + "@babel/plugin-proposal-numeric-separator": "^7.10.1", + "@babel/plugin-proposal-object-rest-spread": "^7.10.1", + "@babel/plugin-proposal-optional-catch-binding": "^7.10.1", + "@babel/plugin-proposal-optional-chaining": "^7.10.1", + "@babel/plugin-proposal-private-methods": "^7.10.1", + "@babel/plugin-proposal-unicode-property-regex": "^7.10.1", + "@babel/plugin-syntax-async-generators": "^7.8.0", + "@babel/plugin-syntax-class-properties": "^7.10.1", + "@babel/plugin-syntax-dynamic-import": "^7.8.0", + "@babel/plugin-syntax-json-strings": "^7.8.0", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.0", + "@babel/plugin-syntax-numeric-separator": "^7.10.1", + "@babel/plugin-syntax-object-rest-spread": "^7.8.0", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.0", + "@babel/plugin-syntax-optional-chaining": "^7.8.0", + "@babel/plugin-syntax-top-level-await": "^7.10.1", + "@babel/plugin-transform-arrow-functions": "^7.10.1", + "@babel/plugin-transform-async-to-generator": "^7.10.1", + "@babel/plugin-transform-block-scoped-functions": "^7.10.1", + "@babel/plugin-transform-block-scoping": "^7.10.1", + "@babel/plugin-transform-classes": "^7.10.1", + "@babel/plugin-transform-computed-properties": "^7.10.1", + "@babel/plugin-transform-destructuring": "^7.10.1", + "@babel/plugin-transform-dotall-regex": "^7.10.1", + "@babel/plugin-transform-duplicate-keys": "^7.10.1", + "@babel/plugin-transform-exponentiation-operator": "^7.10.1", + "@babel/plugin-transform-for-of": "^7.10.1", + "@babel/plugin-transform-function-name": "^7.10.1", + "@babel/plugin-transform-literals": "^7.10.1", + "@babel/plugin-transform-member-expression-literals": "^7.10.1", + "@babel/plugin-transform-modules-amd": "^7.10.1", + "@babel/plugin-transform-modules-commonjs": "^7.10.1", + "@babel/plugin-transform-modules-systemjs": "^7.10.1", + "@babel/plugin-transform-modules-umd": "^7.10.1", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.8.3", + "@babel/plugin-transform-new-target": "^7.10.1", + "@babel/plugin-transform-object-super": "^7.10.1", + "@babel/plugin-transform-parameters": "^7.10.1", + "@babel/plugin-transform-property-literals": "^7.10.1", + "@babel/plugin-transform-regenerator": "^7.10.1", + "@babel/plugin-transform-reserved-words": "^7.10.1", + "@babel/plugin-transform-shorthand-properties": "^7.10.1", + "@babel/plugin-transform-spread": "^7.10.1", + "@babel/plugin-transform-sticky-regex": "^7.10.1", + "@babel/plugin-transform-template-literals": "^7.10.1", + "@babel/plugin-transform-typeof-symbol": "^7.10.1", + "@babel/plugin-transform-unicode-escapes": "^7.10.1", + "@babel/plugin-transform-unicode-regex": "^7.10.1", + "@babel/preset-modules": "^0.1.3", + "@babel/types": "^7.10.2", + "browserslist": "^4.12.0", + "core-js-compat": "^3.6.2", + "invariant": "^2.2.2", + "levenary": "^1.1.1", + "semver": "^5.5.0" + } + }, + "@babel/preset-modules": { + "version": "0.1.3", + "resolved": "https://registry.npm.taobao.org/@babel/preset-modules/download/@babel/preset-modules-0.1.3.tgz", + "integrity": "sha1-EyQrU7XvjIg8PPfd3VWzbOgPvHI=", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/plugin-proposal-unicode-property-regex": "^7.4.4", + "@babel/plugin-transform-dotall-regex": "^7.4.4", + "@babel/types": "^7.4.4", + "esutils": "^2.0.2" + } + }, + "@babel/runtime": { + "version": "7.10.2", + "resolved": "https://registry.npm.taobao.org/@babel/runtime/download/@babel/runtime-7.10.2.tgz", + "integrity": "sha1-0QPyHyYCSX04NIoy4AhjfVBtuDk=", + "dev": true, + "requires": { + "regenerator-runtime": "^0.13.4" + } + }, + "@babel/template": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/template/download/@babel/template-7.10.1.tgz?cache=0&sync_timestamp=1590617618259&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Ftemplate%2Fdownload%2F%40babel%2Ftemplate-7.10.1.tgz", + "integrity": "sha1-4WcVSpTLXxSyjcWPU1bSFi9TmBE=", + "dev": true, + "requires": { + "@babel/code-frame": "^7.10.1", + "@babel/parser": "^7.10.1", + "@babel/types": "^7.10.1" + } + }, + "@babel/traverse": { + "version": "7.10.1", + "resolved": "https://registry.npm.taobao.org/@babel/traverse/download/@babel/traverse-7.10.1.tgz", + "integrity": "sha1-u87zAx5BUqbAtQFH9JWN9Uyg3Sc=", + "dev": true, + "requires": { + "@babel/code-frame": "^7.10.1", + "@babel/generator": "^7.10.1", + "@babel/helper-function-name": "^7.10.1", + "@babel/helper-split-export-declaration": "^7.10.1", + "@babel/parser": "^7.10.1", + "@babel/types": "^7.10.1", + "debug": "^4.1.0", + "globals": "^11.1.0", + "lodash": "^4.17.13" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npm.taobao.org/debug/download/debug-4.1.1.tgz?cache=0&sync_timestamp=1589881689076&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdebug%2Fdownload%2Fdebug-4.1.1.tgz", + "integrity": "sha1-O3ImAlUQnGtYnO4FDx1RYTlmR5E=", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npm.taobao.org/ms/download/ms-2.1.2.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fms%2Fdownload%2Fms-2.1.2.tgz", + "integrity": "sha1-0J0fNXtEP0kzgqjrPM0YOHKuYAk=", + "dev": true + } + } + }, + "@babel/types": { + "version": "7.10.2", + "resolved": "https://registry.npm.taobao.org/@babel/types/download/@babel/types-7.10.2.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Ftypes%2Fdownload%2F%40babel%2Ftypes-7.10.2.tgz", + "integrity": "sha1-MCg74xytDb9vsAvUBkHKDqZ1Fy0=", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.10.1", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + }, + "@bcoe/v8-coverage": { + "version": "0.2.3", + "resolved": "https://registry.npm.taobao.org/@bcoe/v8-coverage/download/@bcoe/v8-coverage-0.2.3.tgz", + "integrity": "sha1-daLotRy3WKdVPWgEpZMteqznXDk=", + "dev": true + }, + "@cnakazawa/watch": { + "version": "1.0.4", + "resolved": "https://registry.npm.taobao.org/@cnakazawa/watch/download/@cnakazawa/watch-1.0.4.tgz", + "integrity": "sha1-+GSuhQBND8q29QvpFBxNo2jRZWo=", + "dev": true, + "requires": { + "exec-sh": "^0.3.2", + "minimist": "^1.2.0" + } + }, + "@istanbuljs/load-nyc-config": { + "version": "1.1.0", + "resolved": "https://registry.npm.taobao.org/@istanbuljs/load-nyc-config/download/@istanbuljs/load-nyc-config-1.1.0.tgz", + "integrity": "sha1-/T2x1Z7PfPEh6AZQu4ZxL5tV7O0=", + "dev": true, + "requires": { + "camelcase": "^5.3.1", + "find-up": "^4.1.0", + "get-package-type": "^0.1.0", + "js-yaml": "^3.13.1", + "resolve-from": "^5.0.0" + }, + "dependencies": { + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npm.taobao.org/find-up/download/find-up-4.1.0.tgz", + "integrity": "sha1-l6/n1s3AvFkoWEt8jXsW6KmqXRk=", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npm.taobao.org/locate-path/download/locate-path-5.0.0.tgz", + "integrity": "sha1-Gvujlq/WdqbUJQTQpno6frn2KqA=", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npm.taobao.org/p-limit/download/p-limit-2.3.0.tgz?cache=0&sync_timestamp=1591460606987&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fp-limit%2Fdownload%2Fp-limit-2.3.0.tgz", + "integrity": "sha1-PdM8ZHohT9//2DWTPrCG2g3CHbE=", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npm.taobao.org/p-locate/download/p-locate-4.1.0.tgz", + "integrity": "sha1-o0KLtwiLOmApL2aRkni3wpetTwc=", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npm.taobao.org/p-try/download/p-try-2.2.0.tgz", + "integrity": "sha1-yyhoVA4xPWHeWPr741zpAE1VQOY=", + "dev": true + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/path-exists/download/path-exists-4.0.0.tgz", + "integrity": "sha1-UTvb4tO5XXdi6METfvoZXGxhtbM=", + "dev": true + } + } + }, + "@istanbuljs/schema": { + "version": "0.1.2", + "resolved": "https://registry.npm.taobao.org/@istanbuljs/schema/download/@istanbuljs/schema-0.1.2.tgz", + "integrity": "sha1-JlIL8Jq+SlZEzVQU43ElqJVCQd0=", + "dev": true + }, + "@jest/console": { + "version": "26.0.1", + "resolved": "https://registry.npm.taobao.org/@jest/console/download/@jest/console-26.0.1.tgz", + "integrity": "sha1-YrOy+omQ88v/vvaVxCrp3byPSzk=", + "dev": true, + "requires": { + "@jest/types": "^26.0.1", + "chalk": "^4.0.0", + "jest-message-util": "^26.0.1", + "jest-util": "^26.0.1", + "slash": "^3.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npm.taobao.org/ansi-styles/download/ansi-styles-4.2.1.tgz", + "integrity": "sha1-kK51xCTQCNJiTFvynq0xd+v881k=", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/chalk/download/chalk-4.0.0.tgz", + "integrity": "sha1-bpgIHtLRf6q2FetSrGbsH+YgnnI=", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npm.taobao.org/color-convert/download/color-convert-2.0.1.tgz", + "integrity": "sha1-ctOmjVmMm9s68q0ehPIdiWq9TeM=", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npm.taobao.org/color-name/download/color-name-1.1.4.tgz", + "integrity": "sha1-wqCah6y95pVD3m9j+jmVyCbFNqI=", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/has-flag/download/has-flag-4.0.0.tgz", + "integrity": "sha1-lEdx/ZyByBJlxNaUGGDaBrtZR5s=", + "dev": true + }, + "slash": { + "version": "3.0.0", + "resolved": "https://registry.npm.taobao.org/slash/download/slash-3.0.0.tgz", + "integrity": "sha1-ZTm+hwwWWtvVJAIg2+Nh8bxNRjQ=", + "dev": true + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npm.taobao.org/supports-color/download/supports-color-7.1.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsupports-color%2Fdownload%2Fsupports-color-7.1.0.tgz", + "integrity": "sha1-aOMlkd9z4lrRxLSRCKLsUHliv9E=", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "@jest/core": { + "version": "26.0.1", + "resolved": "https://registry.npm.taobao.org/@jest/core/download/@jest/core-26.0.1.tgz", + "integrity": "sha1-qlONUkl9+rVnNe+wDlBr6D2EH64=", + "dev": true, + "requires": { + "@jest/console": "^26.0.1", + "@jest/reporters": "^26.0.1", + "@jest/test-result": "^26.0.1", + "@jest/transform": "^26.0.1", + "@jest/types": "^26.0.1", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.4", + "jest-changed-files": "^26.0.1", + "jest-config": "^26.0.1", + "jest-haste-map": "^26.0.1", + "jest-message-util": "^26.0.1", + "jest-regex-util": "^26.0.0", + "jest-resolve": "^26.0.1", + "jest-resolve-dependencies": "^26.0.1", + "jest-runner": "^26.0.1", + "jest-runtime": "^26.0.1", + "jest-snapshot": "^26.0.1", + "jest-util": "^26.0.1", + "jest-validate": "^26.0.1", + "jest-watcher": "^26.0.1", + "micromatch": "^4.0.2", + "p-each-series": "^2.1.0", + "rimraf": "^3.0.0", + "slash": "^3.0.0", + "strip-ansi": "^6.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npm.taobao.org/ansi-styles/download/ansi-styles-4.2.1.tgz", + "integrity": "sha1-kK51xCTQCNJiTFvynq0xd+v881k=", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npm.taobao.org/braces/download/braces-3.0.2.tgz", + "integrity": "sha1-NFThpGLujVmeI23zNs2epPiv4Qc=", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, + "chalk": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/chalk/download/chalk-4.0.0.tgz", + "integrity": "sha1-bpgIHtLRf6q2FetSrGbsH+YgnnI=", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npm.taobao.org/color-convert/download/color-convert-2.0.1.tgz", + "integrity": "sha1-ctOmjVmMm9s68q0ehPIdiWq9TeM=", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npm.taobao.org/color-name/download/color-name-1.1.4.tgz", + "integrity": "sha1-wqCah6y95pVD3m9j+jmVyCbFNqI=", + "dev": true + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npm.taobao.org/fill-range/download/fill-range-7.0.1.tgz", + "integrity": "sha1-GRmmp8df44ssfHflGYU12prN2kA=", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/has-flag/download/has-flag-4.0.0.tgz", + "integrity": "sha1-lEdx/ZyByBJlxNaUGGDaBrtZR5s=", + "dev": true + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npm.taobao.org/is-number/download/is-number-7.0.0.tgz", + "integrity": "sha1-dTU0W4lnNNX4DE0GxQlVUnoU8Ss=", + "dev": true + }, + "micromatch": { + "version": "4.0.2", + "resolved": "https://registry.npm.taobao.org/micromatch/download/micromatch-4.0.2.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmicromatch%2Fdownload%2Fmicromatch-4.0.2.tgz", + "integrity": "sha1-T8sJmb+fvC/L3SEvbWKbmlbDklk=", + "dev": true, + "requires": { + "braces": "^3.0.1", + "picomatch": "^2.0.5" + } + }, + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npm.taobao.org/rimraf/download/rimraf-3.0.2.tgz?cache=0&sync_timestamp=1581257110269&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Frimraf%2Fdownload%2Frimraf-3.0.2.tgz", + "integrity": "sha1-8aVAK6YiCtUswSgrrBrjqkn9Bho=", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "slash": { + "version": "3.0.0", + "resolved": "https://registry.npm.taobao.org/slash/download/slash-3.0.0.tgz", + "integrity": "sha1-ZTm+hwwWWtvVJAIg2+Nh8bxNRjQ=", + "dev": true + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npm.taobao.org/supports-color/download/supports-color-7.1.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsupports-color%2Fdownload%2Fsupports-color-7.1.0.tgz", + "integrity": "sha1-aOMlkd9z4lrRxLSRCKLsUHliv9E=", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npm.taobao.org/to-regex-range/download/to-regex-range-5.0.1.tgz", + "integrity": "sha1-FkjESq58jZiKMmAY7XL1tN0DkuQ=", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + } + } + }, + "@jest/environment": { + "version": "26.0.1", + "resolved": "https://registry.npm.taobao.org/@jest/environment/download/@jest/environment-26.0.1.tgz", + "integrity": "sha1-gvUZu6cZWb6bSDZ17onejI9ypcg=", + "dev": true, + "requires": { + "@jest/fake-timers": "^26.0.1", + "@jest/types": "^26.0.1", + "jest-mock": "^26.0.1" + } + }, + "@jest/fake-timers": { + "version": "26.0.1", + "resolved": "https://registry.npm.taobao.org/@jest/fake-timers/download/@jest/fake-timers-26.0.1.tgz", + "integrity": "sha1-967/E7nzh+nQysmo3ju6U40Z15Y=", + "dev": true, + "requires": { + "@jest/types": "^26.0.1", + "@sinonjs/fake-timers": "^6.0.1", + "jest-message-util": "^26.0.1", + "jest-mock": "^26.0.1", + "jest-util": "^26.0.1" + } + }, + "@jest/globals": { + "version": "26.0.1", + "resolved": "https://registry.npm.taobao.org/@jest/globals/download/@jest/globals-26.0.1.tgz", + "integrity": "sha1-P2e1CKfOYrbm78U289GOyd6xmpw=", + "dev": true, + "requires": { + "@jest/environment": "^26.0.1", + "@jest/types": "^26.0.1", + "expect": "^26.0.1" + } + }, + "@jest/reporters": { + "version": "26.0.1", + "resolved": "https://registry.npm.taobao.org/@jest/reporters/download/@jest/reporters-26.0.1.tgz", + "integrity": "sha1-FK4A56k+SYzsNbDACrIcN12bB48=", + "dev": true, + "requires": { + "@bcoe/v8-coverage": "^0.2.3", + "@jest/console": "^26.0.1", + "@jest/test-result": "^26.0.1", + "@jest/transform": "^26.0.1", + "@jest/types": "^26.0.1", + "chalk": "^4.0.0", + "collect-v8-coverage": "^1.0.0", + "exit": "^0.1.2", + "glob": "^7.1.2", + "graceful-fs": "^4.2.4", + "istanbul-lib-coverage": "^3.0.0", + "istanbul-lib-instrument": "^4.0.0", + "istanbul-lib-report": "^3.0.0", + "istanbul-lib-source-maps": "^4.0.0", + "istanbul-reports": "^3.0.2", + "jest-haste-map": "^26.0.1", + "jest-resolve": "^26.0.1", + "jest-util": "^26.0.1", + "jest-worker": "^26.0.0", + "node-notifier": "^7.0.0", + "slash": "^3.0.0", + "source-map": "^0.6.0", + "string-length": "^4.0.1", + "terminal-link": "^2.0.0", + "v8-to-istanbul": "^4.1.3" + }, + "dependencies": { + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npm.taobao.org/ansi-styles/download/ansi-styles-4.2.1.tgz", + "integrity": "sha1-kK51xCTQCNJiTFvynq0xd+v881k=", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/chalk/download/chalk-4.0.0.tgz", + "integrity": "sha1-bpgIHtLRf6q2FetSrGbsH+YgnnI=", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npm.taobao.org/color-convert/download/color-convert-2.0.1.tgz", + "integrity": "sha1-ctOmjVmMm9s68q0ehPIdiWq9TeM=", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npm.taobao.org/color-name/download/color-name-1.1.4.tgz", + "integrity": "sha1-wqCah6y95pVD3m9j+jmVyCbFNqI=", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/has-flag/download/has-flag-4.0.0.tgz", + "integrity": "sha1-lEdx/ZyByBJlxNaUGGDaBrtZR5s=", + "dev": true + }, + "slash": { + "version": "3.0.0", + "resolved": "https://registry.npm.taobao.org/slash/download/slash-3.0.0.tgz", + "integrity": "sha1-ZTm+hwwWWtvVJAIg2+Nh8bxNRjQ=", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npm.taobao.org/source-map/download/source-map-0.6.1.tgz", + "integrity": "sha1-dHIq8y6WFOnCh6jQu95IteLxomM=", + "dev": true + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npm.taobao.org/supports-color/download/supports-color-7.1.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsupports-color%2Fdownload%2Fsupports-color-7.1.0.tgz", + "integrity": "sha1-aOMlkd9z4lrRxLSRCKLsUHliv9E=", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "@jest/source-map": { + "version": "26.0.0", + "resolved": "https://registry.npm.taobao.org/@jest/source-map/download/@jest/source-map-26.0.0.tgz?cache=0&sync_timestamp=1588615317246&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40jest%2Fsource-map%2Fdownload%2F%40jest%2Fsource-map-26.0.0.tgz", + "integrity": "sha1-/XcGSEp9P693kq4peDkzu/SKR0k=", + "dev": true, + "requires": { + "callsites": "^3.0.0", + "graceful-fs": "^4.2.4", + "source-map": "^0.6.0" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npm.taobao.org/source-map/download/source-map-0.6.1.tgz", + "integrity": "sha1-dHIq8y6WFOnCh6jQu95IteLxomM=", + "dev": true + } + } + }, + "@jest/test-result": { + "version": "26.0.1", + "resolved": "https://registry.npm.taobao.org/@jest/test-result/download/@jest/test-result-26.0.1.tgz", + "integrity": "sha1-H/3BukvCiZGeVLlBS3TJwveytxg=", + "dev": true, + "requires": { + "@jest/console": "^26.0.1", + "@jest/types": "^26.0.1", + "@types/istanbul-lib-coverage": "^2.0.0", + "collect-v8-coverage": "^1.0.0" + } + }, + "@jest/test-sequencer": { + "version": "26.0.1", + "resolved": "https://registry.npm.taobao.org/@jest/test-sequencer/download/@jest/test-sequencer-26.0.1.tgz", + "integrity": "sha1-sFY0JHKPP+nnXRRCua5MEdpz8JA=", + "dev": true, + "requires": { + "@jest/test-result": "^26.0.1", + "graceful-fs": "^4.2.4", + "jest-haste-map": "^26.0.1", + "jest-runner": "^26.0.1", + "jest-runtime": "^26.0.1" + } + }, + "@jest/transform": { + "version": "26.0.1", + "resolved": "https://registry.npm.taobao.org/@jest/transform/download/@jest/transform-26.0.1.tgz?cache=0&sync_timestamp=1588675300509&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40jest%2Ftransform%2Fdownload%2F%40jest%2Ftransform-26.0.1.tgz", + "integrity": "sha1-Dj7Ls0oRzUsggO0KnEhWzwzrBjk=", + "dev": true, + "requires": { + "@babel/core": "^7.1.0", + "@jest/types": "^26.0.1", + "babel-plugin-istanbul": "^6.0.0", + "chalk": "^4.0.0", + "convert-source-map": "^1.4.0", + "fast-json-stable-stringify": "^2.0.0", + "graceful-fs": "^4.2.4", + "jest-haste-map": "^26.0.1", + "jest-regex-util": "^26.0.0", + "jest-util": "^26.0.1", + "micromatch": "^4.0.2", + "pirates": "^4.0.1", + "slash": "^3.0.0", + "source-map": "^0.6.1", + "write-file-atomic": "^3.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npm.taobao.org/ansi-styles/download/ansi-styles-4.2.1.tgz", + "integrity": "sha1-kK51xCTQCNJiTFvynq0xd+v881k=", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npm.taobao.org/braces/download/braces-3.0.2.tgz", + "integrity": "sha1-NFThpGLujVmeI23zNs2epPiv4Qc=", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, + "chalk": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/chalk/download/chalk-4.0.0.tgz", + "integrity": "sha1-bpgIHtLRf6q2FetSrGbsH+YgnnI=", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npm.taobao.org/color-convert/download/color-convert-2.0.1.tgz", + "integrity": "sha1-ctOmjVmMm9s68q0ehPIdiWq9TeM=", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npm.taobao.org/color-name/download/color-name-1.1.4.tgz", + "integrity": "sha1-wqCah6y95pVD3m9j+jmVyCbFNqI=", + "dev": true + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npm.taobao.org/fill-range/download/fill-range-7.0.1.tgz", + "integrity": "sha1-GRmmp8df44ssfHflGYU12prN2kA=", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/has-flag/download/has-flag-4.0.0.tgz", + "integrity": "sha1-lEdx/ZyByBJlxNaUGGDaBrtZR5s=", + "dev": true + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npm.taobao.org/is-number/download/is-number-7.0.0.tgz", + "integrity": "sha1-dTU0W4lnNNX4DE0GxQlVUnoU8Ss=", + "dev": true + }, + "micromatch": { + "version": "4.0.2", + "resolved": "https://registry.npm.taobao.org/micromatch/download/micromatch-4.0.2.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmicromatch%2Fdownload%2Fmicromatch-4.0.2.tgz", + "integrity": "sha1-T8sJmb+fvC/L3SEvbWKbmlbDklk=", + "dev": true, + "requires": { + "braces": "^3.0.1", + "picomatch": "^2.0.5" + } + }, + "slash": { + "version": "3.0.0", + "resolved": "https://registry.npm.taobao.org/slash/download/slash-3.0.0.tgz", + "integrity": "sha1-ZTm+hwwWWtvVJAIg2+Nh8bxNRjQ=", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npm.taobao.org/source-map/download/source-map-0.6.1.tgz", + "integrity": "sha1-dHIq8y6WFOnCh6jQu95IteLxomM=", + "dev": true + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npm.taobao.org/supports-color/download/supports-color-7.1.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsupports-color%2Fdownload%2Fsupports-color-7.1.0.tgz", + "integrity": "sha1-aOMlkd9z4lrRxLSRCKLsUHliv9E=", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npm.taobao.org/to-regex-range/download/to-regex-range-5.0.1.tgz", + "integrity": "sha1-FkjESq58jZiKMmAY7XL1tN0DkuQ=", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + } + } + }, + "@jest/types": { + "version": "26.0.1", + "resolved": "https://registry.npm.taobao.org/@jest/types/download/@jest/types-26.0.1.tgz?cache=0&sync_timestamp=1588675382715&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40jest%2Ftypes%2Fdownload%2F%40jest%2Ftypes-26.0.1.tgz", + "integrity": "sha1-t4Mz+9ET+nrsjTneJPiN6GhtrGc=", + "dev": true, + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^15.0.0", + "chalk": "^4.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npm.taobao.org/ansi-styles/download/ansi-styles-4.2.1.tgz", + "integrity": "sha1-kK51xCTQCNJiTFvynq0xd+v881k=", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/chalk/download/chalk-4.0.0.tgz", + "integrity": "sha1-bpgIHtLRf6q2FetSrGbsH+YgnnI=", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npm.taobao.org/color-convert/download/color-convert-2.0.1.tgz", + "integrity": "sha1-ctOmjVmMm9s68q0ehPIdiWq9TeM=", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npm.taobao.org/color-name/download/color-name-1.1.4.tgz", + "integrity": "sha1-wqCah6y95pVD3m9j+jmVyCbFNqI=", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/has-flag/download/has-flag-4.0.0.tgz", + "integrity": "sha1-lEdx/ZyByBJlxNaUGGDaBrtZR5s=", + "dev": true + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npm.taobao.org/supports-color/download/supports-color-7.1.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsupports-color%2Fdownload%2Fsupports-color-7.1.0.tgz", + "integrity": "sha1-aOMlkd9z4lrRxLSRCKLsUHliv9E=", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "@rollup/plugin-commonjs": { + "version": "13.0.0", + "resolved": "https://registry.npm.taobao.org/@rollup/plugin-commonjs/download/@rollup/plugin-commonjs-13.0.0.tgz?cache=0&sync_timestamp=1591365466597&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40rollup%2Fplugin-commonjs%2Fdownload%2F%40rollup%2Fplugin-commonjs-13.0.0.tgz", + "integrity": "sha1-ih1oS6aEiv6Lnj2FZJ1LL29yF+w=", + "dev": true, + "requires": { + "@rollup/pluginutils": "^3.0.8", + "commondir": "^1.0.1", + "estree-walker": "^1.0.1", + "glob": "^7.1.2", + "is-reference": "^1.1.2", + "magic-string": "^0.25.2", + "resolve": "^1.11.0" + } + }, + "@rollup/plugin-node-resolve": { + "version": "8.0.1", + "resolved": "https://registry.npm.taobao.org/@rollup/plugin-node-resolve/download/@rollup/plugin-node-resolve-8.0.1.tgz?cache=0&sync_timestamp=1591365388596&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40rollup%2Fplugin-node-resolve%2Fdownload%2F%40rollup%2Fplugin-node-resolve-8.0.1.tgz", + "integrity": "sha1-NktZOICO5rUWTepe9ykb4/c5UZk=", + "dev": true, + "requires": { + "@rollup/pluginutils": "^3.0.8", + "@types/resolve": "0.0.8", + "builtin-modules": "^3.1.0", + "deep-freeze": "^0.0.1", + "deepmerge": "^4.2.2", + "is-module": "^1.0.0", + "resolve": "^1.14.2" + } + }, + "@rollup/plugin-replace": { + "version": "2.3.3", + "resolved": "https://registry.npm.taobao.org/@rollup/plugin-replace/download/@rollup/plugin-replace-2.3.3.tgz", + "integrity": "sha1-zWuuOURN4Rn12QUyK5Hr1AeFYuc=", + "dev": true, + "requires": { + "@rollup/pluginutils": "^3.0.8", + "magic-string": "^0.25.5" + } + }, + "@rollup/plugin-strip": { + "version": "1.3.3", + "resolved": "https://registry.npm.taobao.org/@rollup/plugin-strip/download/@rollup/plugin-strip-1.3.3.tgz", + "integrity": "sha1-z0OAAgQUIXr/1GfaFOu2WjA6eEg=", + "dev": true, + "requires": { + "@rollup/pluginutils": "^3.0.4", + "estree-walker": "^1.0.1", + "magic-string": "^0.25.5" + } + }, + "@rollup/pluginutils": { + "version": "3.1.0", + "resolved": "https://registry.npm.taobao.org/@rollup/pluginutils/download/@rollup/pluginutils-3.1.0.tgz?cache=0&sync_timestamp=1591365464705&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40rollup%2Fpluginutils%2Fdownload%2F%40rollup%2Fpluginutils-3.1.0.tgz", + "integrity": "sha1-cGtFJO5tyLEDs8mVUz5a1oDAK5s=", + "dev": true, + "requires": { + "@types/estree": "0.0.39", + "estree-walker": "^1.0.1", + "picomatch": "^2.2.2" + } + }, + "@sinonjs/commons": { + "version": "1.8.0", + "resolved": "https://registry.npm.taobao.org/@sinonjs/commons/download/@sinonjs/commons-1.8.0.tgz", + "integrity": "sha1-yNaIIahUxVW7oXLzsGlZoAObI20=", + "dev": true, + "requires": { + "type-detect": "4.0.8" + } + }, + "@sinonjs/fake-timers": { + "version": "6.0.1", + "resolved": "https://registry.npm.taobao.org/@sinonjs/fake-timers/download/@sinonjs/fake-timers-6.0.1.tgz", + "integrity": "sha1-KTZ0/MsyYqx4LHqt/eyoaxDHXEA=", + "dev": true, + "requires": { + "@sinonjs/commons": "^1.7.0" + } + }, + "@types/babel__core": { + "version": "7.1.8", + "resolved": "https://registry.npm.taobao.org/@types/babel__core/download/@types/babel__core-7.1.8.tgz", + "integrity": "sha1-BX9yWso2QfSfwRx6h6neXsWIpdc=", + "dev": true, + "requires": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0", + "@types/babel__generator": "*", + "@types/babel__template": "*", + "@types/babel__traverse": "*" + } + }, + "@types/babel__generator": { + "version": "7.6.1", + "resolved": "https://registry.npm.taobao.org/@types/babel__generator/download/@types/babel__generator-7.6.1.tgz?cache=0&sync_timestamp=1588227921408&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Fbabel__generator%2Fdownload%2F%40types%2Fbabel__generator-7.6.1.tgz", + "integrity": "sha1-SQF2ezl+hxGuuZ3405bXunt/DgQ=", + "dev": true, + "requires": { + "@babel/types": "^7.0.0" + } + }, + "@types/babel__template": { + "version": "7.0.2", + "resolved": "https://registry.npm.taobao.org/@types/babel__template/download/@types/babel__template-7.0.2.tgz?cache=0&sync_timestamp=1588227923635&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Fbabel__template%2Fdownload%2F%40types%2Fbabel__template-7.0.2.tgz", + "integrity": "sha1-T/Y9a1Lt2sHee5daUiPtMuzqkwc=", + "dev": true, + "requires": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "@types/babel__traverse": { + "version": "7.0.12", + "resolved": "https://registry.npm.taobao.org/@types/babel__traverse/download/@types/babel__traverse-7.0.12.tgz", + "integrity": "sha1-IvSaAo5pRlOQ+HuxA+vWG9CGuPU=", + "dev": true, + "requires": { + "@babel/types": "^7.3.0" + } + }, + "@types/color-name": { + "version": "1.1.1", + "resolved": "https://registry.npm.taobao.org/@types/color-name/download/@types/color-name-1.1.1.tgz?cache=0&sync_timestamp=1588200011932&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Fcolor-name%2Fdownload%2F%40types%2Fcolor-name-1.1.1.tgz", + "integrity": "sha1-HBJhu+qhCoBVu8XYq4S3sq/IRqA=", + "dev": true + }, + "@types/estree": { + "version": "0.0.39", + "resolved": "https://registry.npm.taobao.org/@types/estree/download/@types/estree-0.0.39.tgz?cache=0&sync_timestamp=1588200104768&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Festree%2Fdownload%2F%40types%2Festree-0.0.39.tgz", + "integrity": "sha1-4Xfmme4bjCLSMXTKqnQiZEOJUJ8=", + "dev": true + }, + "@types/graceful-fs": { + "version": "4.1.3", + "resolved": "https://registry.npm.taobao.org/@types/graceful-fs/download/@types/graceful-fs-4.1.3.tgz", + "integrity": "sha1-A5rzX+Jr7DUAPo2G0u6cWGNUNI8=", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "@types/istanbul-lib-coverage": { + "version": "2.0.2", + "resolved": "https://registry.npm.taobao.org/@types/istanbul-lib-coverage/download/@types/istanbul-lib-coverage-2.0.2.tgz", + "integrity": "sha1-edeni61CGfTAPWVXocctnKa6YtU=", + "dev": true + }, + "@types/istanbul-lib-report": { + "version": "3.0.0", + "resolved": "https://registry.npm.taobao.org/@types/istanbul-lib-report/download/@types/istanbul-lib-report-3.0.0.tgz?cache=0&sync_timestamp=1588227930185&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Fistanbul-lib-report%2Fdownload%2F%40types%2Fistanbul-lib-report-3.0.0.tgz", + "integrity": "sha1-wUwk8Y6oGQwRjudWK3/5mjZVJoY=", + "dev": true, + "requires": { + "@types/istanbul-lib-coverage": "*" + } + }, + "@types/istanbul-reports": { + "version": "1.1.2", + "resolved": "https://registry.npm.taobao.org/@types/istanbul-reports/download/@types/istanbul-reports-1.1.2.tgz?cache=0&sync_timestamp=1589521505771&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Fistanbul-reports%2Fdownload%2F%40types%2Fistanbul-reports-1.1.2.tgz", + "integrity": "sha1-6HXMaJ5HvOVJ7IHz315vbxHPrrI=", + "dev": true, + "requires": { + "@types/istanbul-lib-coverage": "*", + "@types/istanbul-lib-report": "*" + } + }, + "@types/json-schema": { + "version": "7.0.4", + "resolved": "https://registry.npm.taobao.org/@types/json-schema/download/@types/json-schema-7.0.4.tgz", + "integrity": "sha1-OP1z3f2bVaux4bLtV4y1W9e30zk=", + "dev": true + }, + "@types/node": { + "version": "14.0.11", + "resolved": "https://registry.npm.taobao.org/@types/node/download/@types/node-14.0.11.tgz", + "integrity": "sha1-YdSIbiQk2nO3slVH9Z/ctTTBZaM=", + "dev": true + }, + "@types/normalize-package-data": { + "version": "2.4.0", + "resolved": "https://registry.npm.taobao.org/@types/normalize-package-data/download/@types/normalize-package-data-2.4.0.tgz?cache=0&sync_timestamp=1588201184787&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Fnormalize-package-data%2Fdownload%2F%40types%2Fnormalize-package-data-2.4.0.tgz", + "integrity": "sha1-5IbQ2XOW15vu3QpuM/RTT/a0lz4=", + "dev": true + }, + "@types/prettier": { + "version": "2.0.1", + "resolved": "https://registry.npm.taobao.org/@types/prettier/download/@types/prettier-2.0.1.tgz", + "integrity": "sha1-tumAg/E/qh5SMb+jvbGw/v9Ta20=", + "dev": true + }, + "@types/resolve": { + "version": "0.0.8", + "resolved": "https://registry.npm.taobao.org/@types/resolve/download/@types/resolve-0.0.8.tgz?cache=0&sync_timestamp=1589329012283&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Fresolve%2Fdownload%2F%40types%2Fresolve-0.0.8.tgz", + "integrity": "sha1-8mB00jjgJlnjI84aE9BB7uKA4ZQ=", + "dev": true, + "requires": { + "@types/node": "*" + } + }, + "@types/stack-utils": { + "version": "1.0.1", + "resolved": "https://registry.npm.taobao.org/@types/stack-utils/download/@types/stack-utils-1.0.1.tgz", + "integrity": "sha1-CoUdO9lkmPolwzq3J47TvWXwbD4=", + "dev": true + }, + "@types/yargs": { + "version": "15.0.5", + "resolved": "https://registry.npm.taobao.org/@types/yargs/download/@types/yargs-15.0.5.tgz", + "integrity": "sha1-lH6aZWFIO97prf/Jg+kaaQKvi3k=", + "dev": true, + "requires": { + "@types/yargs-parser": "*" + } + }, + "@types/yargs-parser": { + "version": "15.0.0", + "resolved": "https://registry.npm.taobao.org/@types/yargs-parser/download/@types/yargs-parser-15.0.0.tgz", + "integrity": "sha1-yz+fdBhp4gzOMw/765JxWQSDiC0=", + "dev": true + }, + "@typescript-eslint/experimental-utils": { + "version": "2.34.0", + "resolved": "https://registry.npm.taobao.org/@typescript-eslint/experimental-utils/download/@typescript-eslint/experimental-utils-2.34.0.tgz?cache=0&sync_timestamp=1591556826279&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40typescript-eslint%2Fexperimental-utils%2Fdownload%2F%40typescript-eslint%2Fexperimental-utils-2.34.0.tgz", + "integrity": "sha1-01JLZEzbQO687KZ/jPPkzJyPmA8=", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.3", + "@typescript-eslint/typescript-estree": "2.34.0", + "eslint-scope": "^5.0.0", + "eslint-utils": "^2.0.0" + } + }, + "@typescript-eslint/typescript-estree": { + "version": "2.34.0", + "resolved": "https://registry.npm.taobao.org/@typescript-eslint/typescript-estree/download/@typescript-eslint/typescript-estree-2.34.0.tgz?cache=0&sync_timestamp=1591556825258&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40typescript-eslint%2Ftypescript-estree%2Fdownload%2F%40typescript-eslint%2Ftypescript-estree-2.34.0.tgz", + "integrity": "sha1-FK62NTs57wcyzH8bgoUpSTfPN9U=", + "dev": true, + "requires": { + "debug": "^4.1.1", + "eslint-visitor-keys": "^1.1.0", + "glob": "^7.1.6", + "is-glob": "^4.0.1", + "lodash": "^4.17.15", + "semver": "^7.3.2", + "tsutils": "^3.17.1" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npm.taobao.org/debug/download/debug-4.1.1.tgz?cache=0&sync_timestamp=1589881689076&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdebug%2Fdownload%2Fdebug-4.1.1.tgz", + "integrity": "sha1-O3ImAlUQnGtYnO4FDx1RYTlmR5E=", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npm.taobao.org/ms/download/ms-2.1.2.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fms%2Fdownload%2Fms-2.1.2.tgz", + "integrity": "sha1-0J0fNXtEP0kzgqjrPM0YOHKuYAk=", + "dev": true + }, + "semver": { + "version": "7.3.2", + "resolved": "https://registry.npm.taobao.org/semver/download/semver-7.3.2.tgz", + "integrity": "sha1-YElisFK4HtB4aq6EOJ/7pw/9OTg=", + "dev": true + } + } + }, + "@webassemblyjs/ast": { + "version": "1.9.0", + "resolved": "https://registry.npm.taobao.org/@webassemblyjs/ast/download/@webassemblyjs/ast-1.9.0.tgz", + "integrity": "sha1-vYUGBLQEJFmlpBzX0zjL7Wle2WQ=", + "dev": true, + "requires": { + "@webassemblyjs/helper-module-context": "1.9.0", + "@webassemblyjs/helper-wasm-bytecode": "1.9.0", + "@webassemblyjs/wast-parser": "1.9.0" + } + }, + "@webassemblyjs/floating-point-hex-parser": { + "version": "1.9.0", + "resolved": "https://registry.npm.taobao.org/@webassemblyjs/floating-point-hex-parser/download/@webassemblyjs/floating-point-hex-parser-1.9.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40webassemblyjs%2Ffloating-point-hex-parser%2Fdownload%2F%40webassemblyjs%2Ffloating-point-hex-parser-1.9.0.tgz", + "integrity": "sha1-PD07Jxvd/ITesA9xNEQ4MR1S/7Q=", + "dev": true + }, + "@webassemblyjs/helper-api-error": { + "version": "1.9.0", + "resolved": "https://registry.npm.taobao.org/@webassemblyjs/helper-api-error/download/@webassemblyjs/helper-api-error-1.9.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40webassemblyjs%2Fhelper-api-error%2Fdownload%2F%40webassemblyjs%2Fhelper-api-error-1.9.0.tgz", + "integrity": "sha1-ID9nbjM7lsnaLuqzzO8zxFkotqI=", + "dev": true + }, + "@webassemblyjs/helper-buffer": { + "version": "1.9.0", + "resolved": "https://registry.npm.taobao.org/@webassemblyjs/helper-buffer/download/@webassemblyjs/helper-buffer-1.9.0.tgz", + "integrity": "sha1-oUQtJpxf6yP8vJ73WdrDVH8p3gA=", + "dev": true + }, + "@webassemblyjs/helper-code-frame": { + "version": "1.9.0", + "resolved": "https://registry.npm.taobao.org/@webassemblyjs/helper-code-frame/download/@webassemblyjs/helper-code-frame-1.9.0.tgz", + "integrity": "sha1-ZH+Iks0gQ6gqwMjF51w28dkVnyc=", + "dev": true, + "requires": { + "@webassemblyjs/wast-printer": "1.9.0" + } + }, + "@webassemblyjs/helper-fsm": { + "version": "1.9.0", + "resolved": "https://registry.npm.taobao.org/@webassemblyjs/helper-fsm/download/@webassemblyjs/helper-fsm-1.9.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40webassemblyjs%2Fhelper-fsm%2Fdownload%2F%40webassemblyjs%2Fhelper-fsm-1.9.0.tgz", + "integrity": "sha1-wFJWtxJEIUZx9LCOwQitY7cO3bg=", + "dev": true + }, + "@webassemblyjs/helper-module-context": { + "version": "1.9.0", + "resolved": "https://registry.npm.taobao.org/@webassemblyjs/helper-module-context/download/@webassemblyjs/helper-module-context-1.9.0.tgz?cache=0&sync_timestamp=1580599605432&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40webassemblyjs%2Fhelper-module-context%2Fdownload%2F%40webassemblyjs%2Fhelper-module-context-1.9.0.tgz", + "integrity": "sha1-JdiIS3aDmHGgimxvgGw5ee9xLwc=", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.9.0" + } + }, + "@webassemblyjs/helper-wasm-bytecode": { + "version": "1.9.0", + "resolved": "https://registry.npm.taobao.org/@webassemblyjs/helper-wasm-bytecode/download/@webassemblyjs/helper-wasm-bytecode-1.9.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40webassemblyjs%2Fhelper-wasm-bytecode%2Fdownload%2F%40webassemblyjs%2Fhelper-wasm-bytecode-1.9.0.tgz", + "integrity": "sha1-T+2L6sm4wU+MWLcNEk1UndH+V5A=", + "dev": true + }, + "@webassemblyjs/helper-wasm-section": { + "version": "1.9.0", + "resolved": "https://registry.npm.taobao.org/@webassemblyjs/helper-wasm-section/download/@webassemblyjs/helper-wasm-section-1.9.0.tgz", + "integrity": "sha1-WkE41aYpK6GLBMWuSXF+QWeWU0Y=", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/helper-buffer": "1.9.0", + "@webassemblyjs/helper-wasm-bytecode": "1.9.0", + "@webassemblyjs/wasm-gen": "1.9.0" + } + }, + "@webassemblyjs/ieee754": { + "version": "1.9.0", + "resolved": "https://registry.npm.taobao.org/@webassemblyjs/ieee754/download/@webassemblyjs/ieee754-1.9.0.tgz", + "integrity": "sha1-Fceg+6roP7JhQ7us9tbfFwKtOeQ=", + "dev": true, + "requires": { + "@xtuc/ieee754": "^1.2.0" + } + }, + "@webassemblyjs/leb128": { + "version": "1.9.0", + "resolved": "https://registry.npm.taobao.org/@webassemblyjs/leb128/download/@webassemblyjs/leb128-1.9.0.tgz", + "integrity": "sha1-8Zygt2ptxVYjoJz/p2noOPoeHJU=", + "dev": true, + "requires": { + "@xtuc/long": "4.2.2" + } + }, + "@webassemblyjs/utf8": { + "version": "1.9.0", + "resolved": "https://registry.npm.taobao.org/@webassemblyjs/utf8/download/@webassemblyjs/utf8-1.9.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40webassemblyjs%2Futf8%2Fdownload%2F%40webassemblyjs%2Futf8-1.9.0.tgz", + "integrity": "sha1-BNM7Y2945qaBMifoJAL3Y3tiKas=", + "dev": true + }, + "@webassemblyjs/wasm-edit": { + "version": "1.9.0", + "resolved": "https://registry.npm.taobao.org/@webassemblyjs/wasm-edit/download/@webassemblyjs/wasm-edit-1.9.0.tgz", + "integrity": "sha1-P+bXnT8PkiGDqoYALELdJWz+6c8=", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/helper-buffer": "1.9.0", + "@webassemblyjs/helper-wasm-bytecode": "1.9.0", + "@webassemblyjs/helper-wasm-section": "1.9.0", + "@webassemblyjs/wasm-gen": "1.9.0", + "@webassemblyjs/wasm-opt": "1.9.0", + "@webassemblyjs/wasm-parser": "1.9.0", + "@webassemblyjs/wast-printer": "1.9.0" + } + }, + "@webassemblyjs/wasm-gen": { + "version": "1.9.0", + "resolved": "https://registry.npm.taobao.org/@webassemblyjs/wasm-gen/download/@webassemblyjs/wasm-gen-1.9.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40webassemblyjs%2Fwasm-gen%2Fdownload%2F%40webassemblyjs%2Fwasm-gen-1.9.0.tgz", + "integrity": "sha1-ULxw7Gje2OJ2OwGhQYv0NJGnpJw=", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/helper-wasm-bytecode": "1.9.0", + "@webassemblyjs/ieee754": "1.9.0", + "@webassemblyjs/leb128": "1.9.0", + "@webassemblyjs/utf8": "1.9.0" + } + }, + "@webassemblyjs/wasm-opt": { + "version": "1.9.0", + "resolved": "https://registry.npm.taobao.org/@webassemblyjs/wasm-opt/download/@webassemblyjs/wasm-opt-1.9.0.tgz?cache=0&sync_timestamp=1580599636004&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40webassemblyjs%2Fwasm-opt%2Fdownload%2F%40webassemblyjs%2Fwasm-opt-1.9.0.tgz", + "integrity": "sha1-IhEYHlsxMmRDzIES658LkChyGmE=", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/helper-buffer": "1.9.0", + "@webassemblyjs/wasm-gen": "1.9.0", + "@webassemblyjs/wasm-parser": "1.9.0" + } + }, + "@webassemblyjs/wasm-parser": { + "version": "1.9.0", + "resolved": "https://registry.npm.taobao.org/@webassemblyjs/wasm-parser/download/@webassemblyjs/wasm-parser-1.9.0.tgz", + "integrity": "sha1-nUjkSCbfSmWYKUqmyHRp1kL/9l4=", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/helper-api-error": "1.9.0", + "@webassemblyjs/helper-wasm-bytecode": "1.9.0", + "@webassemblyjs/ieee754": "1.9.0", + "@webassemblyjs/leb128": "1.9.0", + "@webassemblyjs/utf8": "1.9.0" + } + }, + "@webassemblyjs/wast-parser": { + "version": "1.9.0", + "resolved": "https://registry.npm.taobao.org/@webassemblyjs/wast-parser/download/@webassemblyjs/wast-parser-1.9.0.tgz", + "integrity": "sha1-MDERXXmsW9JhVWzsw/qQo+9FGRQ=", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/floating-point-hex-parser": "1.9.0", + "@webassemblyjs/helper-api-error": "1.9.0", + "@webassemblyjs/helper-code-frame": "1.9.0", + "@webassemblyjs/helper-fsm": "1.9.0", + "@xtuc/long": "4.2.2" + } + }, + "@webassemblyjs/wast-printer": { + "version": "1.9.0", + "resolved": "https://registry.npm.taobao.org/@webassemblyjs/wast-printer/download/@webassemblyjs/wast-printer-1.9.0.tgz?cache=0&sync_timestamp=1580599638157&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40webassemblyjs%2Fwast-printer%2Fdownload%2F%40webassemblyjs%2Fwast-printer-1.9.0.tgz", + "integrity": "sha1-STXVTIX+9jewDOn1I3dFHQDUeJk=", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/wast-parser": "1.9.0", + "@xtuc/long": "4.2.2" + } + }, + "@xtuc/ieee754": { + "version": "1.2.0", + "resolved": "https://registry.npm.taobao.org/@xtuc/ieee754/download/@xtuc/ieee754-1.2.0.tgz", + "integrity": "sha1-7vAUoxRa5Hehy8AM0eVSM23Ot5A=", + "dev": true + }, + "@xtuc/long": { + "version": "4.2.2", + "resolved": "https://registry.npm.taobao.org/@xtuc/long/download/@xtuc/long-4.2.2.tgz", + "integrity": "sha1-0pHGpOl5ibXGHZrPOWrk/hM6cY0=", + "dev": true + }, + "abab": { + "version": "2.0.3", + "resolved": "https://registry.npm.taobao.org/abab/download/abab-2.0.3.tgz", + "integrity": "sha1-Yj4gdeAustPyR15J+ZyRhGRnkHo=", + "dev": true + }, + "acorn": { + "version": "7.2.0", + "resolved": "https://registry.npm.taobao.org/acorn/download/acorn-7.2.0.tgz", + "integrity": "sha1-F+p+QNfIZA/1SmlMiJwm8xcE7/4=", + "dev": true + }, + "acorn-globals": { + "version": "6.0.0", + "resolved": "https://registry.npm.taobao.org/acorn-globals/download/acorn-globals-6.0.0.tgz", + "integrity": "sha1-Rs3Tnw+P8IqHZhm1X1rIptx3C0U=", + "dev": true, + "requires": { + "acorn": "^7.1.1", + "acorn-walk": "^7.1.1" + } + }, + "acorn-jsx": { + "version": "5.2.0", + "resolved": "https://registry.npm.taobao.org/acorn-jsx/download/acorn-jsx-5.2.0.tgz", + "integrity": "sha1-TGYGkXPW/daO2FI5/CViJhgrLr4=", + "dev": true + }, + "acorn-walk": { + "version": "7.1.1", + "resolved": "https://registry.npm.taobao.org/acorn-walk/download/acorn-walk-7.1.1.tgz", + "integrity": "sha1-NF8N/61cc15zc9L+yaECPmpEuD4=", + "dev": true + }, + "ajv": { + "version": "6.12.2", + "resolved": "https://registry.npm.taobao.org/ajv/download/ajv-6.12.2.tgz", + "integrity": "sha1-xinF7O0XuvMUQ3kY0tqIyZ1ZWM0=", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ajv-errors": { + "version": "1.0.1", + "resolved": "https://registry.npm.taobao.org/ajv-errors/download/ajv-errors-1.0.1.tgz", + "integrity": "sha1-81mGrOuRr63sQQL72FAUlQzvpk0=", + "dev": true + }, + "ajv-keywords": { + "version": "3.4.1", + "resolved": "https://registry.npm.taobao.org/ajv-keywords/download/ajv-keywords-3.4.1.tgz", + "integrity": "sha1-75FuJxxkrBIXH9g4TqrmsjRYVNo=", + "dev": true + }, + "ansi-escapes": { + "version": "4.3.1", + "resolved": "https://registry.npm.taobao.org/ansi-escapes/download/ansi-escapes-4.3.1.tgz", + "integrity": "sha1-pcR8xDGB8fOP/XB2g3cA05VSKmE=", + "dev": true, + "requires": { + "type-fest": "^0.11.0" + }, + "dependencies": { + "type-fest": { + "version": "0.11.0", + "resolved": "https://registry.npm.taobao.org/type-fest/download/type-fest-0.11.0.tgz", + "integrity": "sha1-l6vwhyMQ/tiKXEZrJWgVdhReM/E=", + "dev": true + } + } + }, + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npm.taobao.org/ansi-regex/download/ansi-regex-5.0.0.tgz", + "integrity": "sha1-OIU59VF5vzkznIGvMKZU1p+Hy3U=", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npm.taobao.org/ansi-styles/download/ansi-styles-3.2.1.tgz", + "integrity": "sha1-QfuyAkPlCxK+DwS43tvwdSDOhB0=", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "anymatch": { + "version": "2.0.0", + "resolved": "https://registry.npm.taobao.org/anymatch/download/anymatch-2.0.0.tgz", + "integrity": "sha1-vLJLTzeTTZqnrBe0ra+J58du8us=", + "dev": true, + "requires": { + "micromatch": "^3.1.4", + "normalize-path": "^2.1.1" + }, + "dependencies": { + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npm.taobao.org/normalize-path/download/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "requires": { + "remove-trailing-separator": "^1.0.1" + } + } + } + }, + "aproba": { + "version": "1.2.0", + "resolved": "https://registry.npm.taobao.org/aproba/download/aproba-1.2.0.tgz", + "integrity": "sha1-aALmJk79GMeQobDVF/DyYnvyyUo=", + "dev": true + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npm.taobao.org/argparse/download/argparse-1.0.10.tgz?cache=0&sync_timestamp=1571657259891&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fargparse%2Fdownload%2Fargparse-1.0.10.tgz", + "integrity": "sha1-vNZ5HqWuCXJeF+WtmIE0zUCz2RE=", + "dev": true, + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/arr-diff/download/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "dev": true + }, + "arr-flatten": { + "version": "1.1.0", + "resolved": "https://registry.npm.taobao.org/arr-flatten/download/arr-flatten-1.1.0.tgz", + "integrity": "sha1-NgSLv/TntH4TZkQxbJlmnqWukfE=", + "dev": true + }, + "arr-union": { + "version": "3.1.0", + "resolved": "https://registry.npm.taobao.org/arr-union/download/arr-union-3.1.0.tgz", + "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", + "dev": true + }, + "array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npm.taobao.org/array-unique/download/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "dev": true + }, + "asn1": { + "version": "0.2.4", + "resolved": "https://registry.npm.taobao.org/asn1/download/asn1-0.2.4.tgz", + "integrity": "sha1-jSR136tVO7M+d7VOWeiAu4ziMTY=", + "dev": true, + "requires": { + "safer-buffer": "~2.1.0" + } + }, + "asn1.js": { + "version": "4.10.1", + "resolved": "https://registry.npm.taobao.org/asn1.js/download/asn1.js-4.10.1.tgz", + "integrity": "sha1-ucK/WAXx5kqt7tbfOiv6+1pz9aA=", + "dev": true, + "requires": { + "bn.js": "^4.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + }, + "dependencies": { + "bn.js": { + "version": "4.11.9", + "resolved": "https://registry.npm.taobao.org/bn.js/download/bn.js-4.11.9.tgz", + "integrity": "sha1-JtVWgpRY+dHoH8SJUkk9C6NQeCg=", + "dev": true + } + } + }, + "assert": { + "version": "1.5.0", + "resolved": "https://registry.npm.taobao.org/assert/download/assert-1.5.0.tgz", + "integrity": "sha1-VcEJqvbgrv2z3EtxJAxwv1dLGOs=", + "dev": true, + "requires": { + "object-assign": "^4.1.1", + "util": "0.10.3" + }, + "dependencies": { + "inherits": { + "version": "2.0.1", + "resolved": "https://registry.npm.taobao.org/inherits/download/inherits-2.0.1.tgz?cache=0&sync_timestamp=1560975547815&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Finherits%2Fdownload%2Finherits-2.0.1.tgz", + "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=", + "dev": true + }, + "util": { + "version": "0.10.3", + "resolved": "https://registry.npm.taobao.org/util/download/util-0.10.3.tgz", + "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", + "dev": true, + "requires": { + "inherits": "2.0.1" + } + } + } + }, + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npm.taobao.org/assert-plus/download/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + }, + "assign-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npm.taobao.org/assign-symbols/download/assign-symbols-1.0.0.tgz", + "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", + "dev": true + }, + "astral-regex": { + "version": "1.0.0", + "resolved": "https://registry.npm.taobao.org/astral-regex/download/astral-regex-1.0.0.tgz", + "integrity": "sha1-bIw/uCfdQ+45GPJ7gngqt2WKb9k=", + "dev": true + }, + "async-each": { + "version": "1.0.3", + "resolved": "https://registry.npm.taobao.org/async-each/download/async-each-1.0.3.tgz", + "integrity": "sha1-tyfb+H12UWAvBvTUrDh/R9kbDL8=", + "dev": true, + "optional": true + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npm.taobao.org/asynckit/download/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true + }, + "atob": { + "version": "2.1.2", + "resolved": "https://registry.npm.taobao.org/atob/download/atob-2.1.2.tgz", + "integrity": "sha1-bZUX654DDSQ2ZmZR6GvZ9vE1M8k=", + "dev": true + }, + "aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npm.taobao.org/aws-sign2/download/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", + "dev": true + }, + "aws4": { + "version": "1.10.0", + "resolved": "https://registry.npm.taobao.org/aws4/download/aws4-1.10.0.tgz?cache=0&sync_timestamp=1590182515104&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Faws4%2Fdownload%2Faws4-1.10.0.tgz", + "integrity": "sha1-oXs6jqgRBg501H0wYSJACtRJeuI=", + "dev": true + }, + "babel-jest": { + "version": "26.0.1", + "resolved": "https://registry.npm.taobao.org/babel-jest/download/babel-jest-26.0.1.tgz", + "integrity": "sha1-RQE5zktsFxdLE2QlvakYhcOXvEY=", + "dev": true, + "requires": { + "@jest/transform": "^26.0.1", + "@jest/types": "^26.0.1", + "@types/babel__core": "^7.1.7", + "babel-plugin-istanbul": "^6.0.0", + "babel-preset-jest": "^26.0.0", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.4", + "slash": "^3.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npm.taobao.org/ansi-styles/download/ansi-styles-4.2.1.tgz", + "integrity": "sha1-kK51xCTQCNJiTFvynq0xd+v881k=", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/chalk/download/chalk-4.0.0.tgz", + "integrity": "sha1-bpgIHtLRf6q2FetSrGbsH+YgnnI=", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npm.taobao.org/color-convert/download/color-convert-2.0.1.tgz", + "integrity": "sha1-ctOmjVmMm9s68q0ehPIdiWq9TeM=", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npm.taobao.org/color-name/download/color-name-1.1.4.tgz", + "integrity": "sha1-wqCah6y95pVD3m9j+jmVyCbFNqI=", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/has-flag/download/has-flag-4.0.0.tgz", + "integrity": "sha1-lEdx/ZyByBJlxNaUGGDaBrtZR5s=", + "dev": true + }, + "slash": { + "version": "3.0.0", + "resolved": "https://registry.npm.taobao.org/slash/download/slash-3.0.0.tgz", + "integrity": "sha1-ZTm+hwwWWtvVJAIg2+Nh8bxNRjQ=", + "dev": true + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npm.taobao.org/supports-color/download/supports-color-7.1.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsupports-color%2Fdownload%2Fsupports-color-7.1.0.tgz", + "integrity": "sha1-aOMlkd9z4lrRxLSRCKLsUHliv9E=", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "babel-plugin-dynamic-import-node": { + "version": "2.3.3", + "resolved": "https://registry.npm.taobao.org/babel-plugin-dynamic-import-node/download/babel-plugin-dynamic-import-node-2.3.3.tgz?cache=0&sync_timestamp=1587495874530&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fbabel-plugin-dynamic-import-node%2Fdownload%2Fbabel-plugin-dynamic-import-node-2.3.3.tgz", + "integrity": "sha1-hP2hnJduxcbe/vV/lCez3vZuF6M=", + "dev": true, + "requires": { + "object.assign": "^4.1.0" + } + }, + "babel-plugin-istanbul": { + "version": "6.0.0", + "resolved": "https://registry.npm.taobao.org/babel-plugin-istanbul/download/babel-plugin-istanbul-6.0.0.tgz?cache=0&sync_timestamp=1577063702695&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fbabel-plugin-istanbul%2Fdownload%2Fbabel-plugin-istanbul-6.0.0.tgz", + "integrity": "sha1-4VnM3Jr5XgtXDHW0Vzt8NNZx12U=", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@istanbuljs/load-nyc-config": "^1.0.0", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-instrument": "^4.0.0", + "test-exclude": "^6.0.0" + } + }, + "babel-plugin-jest-hoist": { + "version": "26.0.0", + "resolved": "https://registry.npm.taobao.org/babel-plugin-jest-hoist/download/babel-plugin-jest-hoist-26.0.0.tgz?cache=0&sync_timestamp=1588614796976&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fbabel-plugin-jest-hoist%2Fdownload%2Fbabel-plugin-jest-hoist-26.0.0.tgz", + "integrity": "sha1-/R01+Vz4hJ/GXLAbXliu3XELNKg=", + "dev": true, + "requires": { + "@babel/template": "^7.3.3", + "@babel/types": "^7.3.3", + "@types/babel__traverse": "^7.0.6" + } + }, + "babel-preset-current-node-syntax": { + "version": "0.1.2", + "resolved": "https://registry.npm.taobao.org/babel-preset-current-node-syntax/download/babel-preset-current-node-syntax-0.1.2.tgz", + "integrity": "sha1-+0pMUf44ymD+3h3HSrNeuEPLQdY=", + "dev": true, + "requires": { + "@babel/plugin-syntax-async-generators": "^7.8.4", + "@babel/plugin-syntax-bigint": "^7.8.3", + "@babel/plugin-syntax-class-properties": "^7.8.3", + "@babel/plugin-syntax-json-strings": "^7.8.3", + "@babel/plugin-syntax-logical-assignment-operators": "^7.8.3", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", + "@babel/plugin-syntax-numeric-separator": "^7.8.3", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", + "@babel/plugin-syntax-optional-chaining": "^7.8.3" + } + }, + "babel-preset-jest": { + "version": "26.0.0", + "resolved": "https://registry.npm.taobao.org/babel-preset-jest/download/babel-preset-jest-26.0.0.tgz?cache=0&sync_timestamp=1588614801833&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fbabel-preset-jest%2Fdownload%2Fbabel-preset-jest-26.0.0.tgz", + "integrity": "sha1-HqyC9ROtNsTbLpJj18SFyCWx+qY=", + "dev": true, + "requires": { + "babel-plugin-jest-hoist": "^26.0.0", + "babel-preset-current-node-syntax": "^0.1.2" + } + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npm.taobao.org/balanced-match/download/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "base": { + "version": "0.11.2", + "resolved": "https://registry.npm.taobao.org/base/download/base-0.11.2.tgz", + "integrity": "sha1-e95c7RRbbVUakNuH+DxVi060io8=", + "dev": true, + "requires": { + "cache-base": "^1.0.1", + "class-utils": "^0.3.5", + "component-emitter": "^1.2.1", + "define-property": "^1.0.0", + "isobject": "^3.0.1", + "mixin-deep": "^1.2.0", + "pascalcase": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npm.taobao.org/define-property/download/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npm.taobao.org/is-accessor-descriptor/download/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha1-FpwvbT3x+ZJhgHI2XJsOofaHhlY=", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npm.taobao.org/is-data-descriptor/download/is-data-descriptor-1.0.0.tgz", + "integrity": "sha1-2Eh2Mh0Oet0DmQQGq7u9NrqSaMc=", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npm.taobao.org/is-descriptor/download/is-descriptor-1.0.2.tgz", + "integrity": "sha1-OxWXRqZmBLBPjIFSS6NlxfFNhuw=", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "base64-js": { + "version": "1.3.1", + "resolved": "https://registry.npm.taobao.org/base64-js/download/base64-js-1.3.1.tgz", + "integrity": "sha1-WOzoy3XdB+ce0IxzarxfrE2/jfE=", + "dev": true + }, + "bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://registry.npm.taobao.org/bcrypt-pbkdf/download/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "dev": true, + "requires": { + "tweetnacl": "^0.14.3" + } + }, + "big.js": { + "version": "5.2.2", + "resolved": "https://registry.npm.taobao.org/big.js/download/big.js-5.2.2.tgz", + "integrity": "sha1-ZfCvOC9Xi83HQr2cKB6cstd2gyg=", + "dev": true + }, + "binary-extensions": { + "version": "1.13.1", + "resolved": "https://registry.npm.taobao.org/binary-extensions/download/binary-extensions-1.13.1.tgz", + "integrity": "sha1-WYr+VHVbKGilMw0q/51Ou1Mgm2U=", + "dev": true, + "optional": true + }, + "bindings": { + "version": "1.5.0", + "resolved": "https://registry.npm.taobao.org/bindings/download/bindings-1.5.0.tgz", + "integrity": "sha1-EDU8npRTNLwFEabZCzj7x8nFBN8=", + "dev": true, + "optional": true, + "requires": { + "file-uri-to-path": "1.0.0" + } + }, + "bluebird": { + "version": "3.7.2", + "resolved": "https://registry.npm.taobao.org/bluebird/download/bluebird-3.7.2.tgz", + "integrity": "sha1-nyKcFb4nJFT/qXOs4NvueaGww28=", + "dev": true + }, + "bn.js": { + "version": "5.1.2", + "resolved": "https://registry.npm.taobao.org/bn.js/download/bn.js-5.1.2.tgz", + "integrity": "sha1-yWhpAtPJoncp9DqxD515wgBNp7A=", + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npm.taobao.org/brace-expansion/download/brace-expansion-1.1.11.tgz", + "integrity": "sha1-PH/L9SnYcibz0vUrlm/1Jx60Qd0=", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npm.taobao.org/braces/download/braces-2.3.2.tgz", + "integrity": "sha1-WXn9PxTNUxVl5fot8av/8d+u5yk=", + "dev": true, + "requires": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npm.taobao.org/extend-shallow/download/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "brorand": { + "version": "1.1.0", + "resolved": "https://registry.npm.taobao.org/brorand/download/brorand-1.1.0.tgz", + "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=", + "dev": true + }, + "browser-process-hrtime": { + "version": "1.0.0", + "resolved": "https://registry.npm.taobao.org/browser-process-hrtime/download/browser-process-hrtime-1.0.0.tgz", + "integrity": "sha1-PJtLfXgsgSHlbxAQbYTA0P/JRiY=", + "dev": true + }, + "browserify-aes": { + "version": "1.2.0", + "resolved": "https://registry.npm.taobao.org/browserify-aes/download/browserify-aes-1.2.0.tgz", + "integrity": "sha1-Mmc0ZC9APavDADIJhTu3CtQo70g=", + "dev": true, + "requires": { + "buffer-xor": "^1.0.3", + "cipher-base": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.3", + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "browserify-cipher": { + "version": "1.0.1", + "resolved": "https://registry.npm.taobao.org/browserify-cipher/download/browserify-cipher-1.0.1.tgz", + "integrity": "sha1-jWR0wbhwv9q807z8wZNKEOlPFfA=", + "dev": true, + "requires": { + "browserify-aes": "^1.0.4", + "browserify-des": "^1.0.0", + "evp_bytestokey": "^1.0.0" + } + }, + "browserify-des": { + "version": "1.0.2", + "resolved": "https://registry.npm.taobao.org/browserify-des/download/browserify-des-1.0.2.tgz", + "integrity": "sha1-OvTx9Zg5QDVy8cZiBDdfen9wPpw=", + "dev": true, + "requires": { + "cipher-base": "^1.0.1", + "des.js": "^1.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "browserify-rsa": { + "version": "4.0.1", + "resolved": "https://registry.npm.taobao.org/browserify-rsa/download/browserify-rsa-4.0.1.tgz", + "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "randombytes": "^2.0.1" + }, + "dependencies": { + "bn.js": { + "version": "4.11.9", + "resolved": "https://registry.npm.taobao.org/bn.js/download/bn.js-4.11.9.tgz", + "integrity": "sha1-JtVWgpRY+dHoH8SJUkk9C6NQeCg=", + "dev": true + } + } + }, + "browserify-sign": { + "version": "4.2.0", + "resolved": "https://registry.npm.taobao.org/browserify-sign/download/browserify-sign-4.2.0.tgz", + "integrity": "sha1-VF0LGwfmssmSEQgr8bEsznoLDhE=", + "dev": true, + "requires": { + "bn.js": "^5.1.1", + "browserify-rsa": "^4.0.1", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "elliptic": "^6.5.2", + "inherits": "^2.0.4", + "parse-asn1": "^5.1.5", + "readable-stream": "^3.6.0", + "safe-buffer": "^5.2.0" + }, + "dependencies": { + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npm.taobao.org/readable-stream/download/readable-stream-3.6.0.tgz?cache=0&sync_timestamp=1581624324274&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Freadable-stream%2Fdownload%2Freadable-stream-3.6.0.tgz", + "integrity": "sha1-M3u9o63AcGvT4CRCaihtS0sskZg=", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npm.taobao.org/safe-buffer/download/safe-buffer-5.2.1.tgz?cache=0&sync_timestamp=1589129103371&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsafe-buffer%2Fdownload%2Fsafe-buffer-5.2.1.tgz", + "integrity": "sha1-Hq+fqb2x/dTsdfWPnNtOa3gn7sY=", + "dev": true + } + } + }, + "browserify-zlib": { + "version": "0.2.0", + "resolved": "https://registry.npm.taobao.org/browserify-zlib/download/browserify-zlib-0.2.0.tgz", + "integrity": "sha1-KGlFnZqjviRf6P4sofRuLn9U1z8=", + "dev": true, + "requires": { + "pako": "~1.0.5" + } + }, + "browserslist": { + "version": "4.12.0", + "resolved": "https://registry.npm.taobao.org/browserslist/download/browserslist-4.12.0.tgz", + "integrity": "sha1-BsbVcVoe3mxR/Dn/Z/1kf3QLZW0=", + "dev": true, + "requires": { + "caniuse-lite": "^1.0.30001043", + "electron-to-chromium": "^1.3.413", + "node-releases": "^1.1.53", + "pkg-up": "^2.0.0" + } + }, + "bser": { + "version": "2.1.1", + "resolved": "https://registry.npm.taobao.org/bser/download/bser-2.1.1.tgz?cache=0&sync_timestamp=1571761384718&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fbser%2Fdownload%2Fbser-2.1.1.tgz", + "integrity": "sha1-5nh9og7OnQeZhTPP2d5vXDj0vAU=", + "dev": true, + "requires": { + "node-int64": "^0.4.0" + } + }, + "buffer": { + "version": "4.9.2", + "resolved": "https://registry.npm.taobao.org/buffer/download/buffer-4.9.2.tgz", + "integrity": "sha1-Iw6tNEACmIZEhBqwJEr4xEu+Pvg=", + "dev": true, + "requires": { + "base64-js": "^1.0.2", + "ieee754": "^1.1.4", + "isarray": "^1.0.0" + } + }, + "buffer-from": { + "version": "1.1.1", + "resolved": "https://registry.npm.taobao.org/buffer-from/download/buffer-from-1.1.1.tgz", + "integrity": "sha1-MnE7wCj3XAL9txDXx7zsHyxgcO8=", + "dev": true + }, + "buffer-xor": { + "version": "1.0.3", + "resolved": "https://registry.npm.taobao.org/buffer-xor/download/buffer-xor-1.0.3.tgz", + "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=", + "dev": true + }, + "builtin-modules": { + "version": "3.1.0", + "resolved": "https://registry.npm.taobao.org/builtin-modules/download/builtin-modules-3.1.0.tgz", + "integrity": "sha1-qtl8FRMet2tltQ7yCOdYTNdqdIQ=", + "dev": true + }, + "builtin-status-codes": { + "version": "3.0.0", + "resolved": "https://registry.npm.taobao.org/builtin-status-codes/download/builtin-status-codes-3.0.0.tgz", + "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=", + "dev": true + }, + "bytes": { + "version": "3.1.0", + "resolved": "https://registry.npm.taobao.org/bytes/download/bytes-3.1.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fbytes%2Fdownload%2Fbytes-3.1.0.tgz", + "integrity": "sha1-9s95M6Ng4FiPqf3oVlHNx/gF0fY=", + "dev": true + }, + "cacache": { + "version": "12.0.4", + "resolved": "https://registry.npm.taobao.org/cacache/download/cacache-12.0.4.tgz", + "integrity": "sha1-ZovL0QWutfHZL+JVcOyVJcj6pAw=", + "dev": true, + "requires": { + "bluebird": "^3.5.5", + "chownr": "^1.1.1", + "figgy-pudding": "^3.5.1", + "glob": "^7.1.4", + "graceful-fs": "^4.1.15", + "infer-owner": "^1.0.3", + "lru-cache": "^5.1.1", + "mississippi": "^3.0.0", + "mkdirp": "^0.5.1", + "move-concurrently": "^1.0.1", + "promise-inflight": "^1.0.1", + "rimraf": "^2.6.3", + "ssri": "^6.0.1", + "unique-filename": "^1.1.1", + "y18n": "^4.0.0" + } + }, + "cache-base": { + "version": "1.0.1", + "resolved": "https://registry.npm.taobao.org/cache-base/download/cache-base-1.0.1.tgz", + "integrity": "sha1-Cn9GQWgxyLZi7jb+TnxZ129marI=", + "dev": true, + "requires": { + "collection-visit": "^1.0.0", + "component-emitter": "^1.2.1", + "get-value": "^2.0.6", + "has-value": "^1.0.0", + "isobject": "^3.0.1", + "set-value": "^2.0.0", + "to-object-path": "^0.3.0", + "union-value": "^1.0.0", + "unset-value": "^1.0.0" + } + }, + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npm.taobao.org/callsites/download/callsites-3.1.0.tgz", + "integrity": "sha1-s2MKvYlDQy9Us/BRkjjjPNffL3M=", + "dev": true + }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npm.taobao.org/camelcase/download/camelcase-5.3.1.tgz", + "integrity": "sha1-48mzFWnhBoEd8kL3FXJaH0xJQyA=", + "dev": true + }, + "caniuse-lite": { + "version": "1.0.30001078", + "resolved": "https://registry.npm.taobao.org/caniuse-lite/download/caniuse-lite-1.0.30001078.tgz", + "integrity": "sha1-4bbirjJ7ah7BH2Xseg3eHnCTB0w=", + "dev": true + }, + "capture-exit": { + "version": "2.0.0", + "resolved": "https://registry.npm.taobao.org/capture-exit/download/capture-exit-2.0.0.tgz", + "integrity": "sha1-+5U7+uvreB9iiYI52rtCbQilCaQ=", + "dev": true, + "requires": { + "rsvp": "^4.8.4" + } + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npm.taobao.org/caseless/download/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", + "dev": true + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npm.taobao.org/chalk/download/chalk-2.4.2.tgz", + "integrity": "sha1-zUJUFnelQzPPVBpJEIwUMrRMlCQ=", + "dev": true, + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "char-regex": { + "version": "1.0.2", + "resolved": "https://registry.npm.taobao.org/char-regex/download/char-regex-1.0.2.tgz", + "integrity": "sha1-10Q1giYhf5ge1Y9Hmx1rzClUXc8=", + "dev": true + }, + "chardet": { + "version": "0.7.0", + "resolved": "https://registry.npm.taobao.org/chardet/download/chardet-0.7.0.tgz?cache=0&sync_timestamp=1588893331057&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fchardet%2Fdownload%2Fchardet-0.7.0.tgz", + "integrity": "sha1-kAlISfCTfy7twkJdDSip5fDLrZ4=", + "dev": true + }, + "chokidar": { + "version": "2.1.8", + "resolved": "https://registry.npm.taobao.org/chokidar/download/chokidar-2.1.8.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fchokidar%2Fdownload%2Fchokidar-2.1.8.tgz", + "integrity": "sha1-gEs6e2qZNYw8XGHnHYco8EHP+Rc=", + "dev": true, + "optional": true, + "requires": { + "anymatch": "^2.0.0", + "async-each": "^1.0.1", + "braces": "^2.3.2", + "fsevents": "^1.2.7", + "glob-parent": "^3.1.0", + "inherits": "^2.0.3", + "is-binary-path": "^1.0.0", + "is-glob": "^4.0.0", + "normalize-path": "^3.0.0", + "path-is-absolute": "^1.0.0", + "readdirp": "^2.2.1", + "upath": "^1.1.1" + } + }, + "chownr": { + "version": "1.1.4", + "resolved": "https://registry.npm.taobao.org/chownr/download/chownr-1.1.4.tgz?cache=0&sync_timestamp=1581474805672&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fchownr%2Fdownload%2Fchownr-1.1.4.tgz", + "integrity": "sha1-b8nXtC0ypYNZYzdmbn0ICE2izGs=", + "dev": true + }, + "chrome-trace-event": { + "version": "1.0.2", + "resolved": "https://registry.npm.taobao.org/chrome-trace-event/download/chrome-trace-event-1.0.2.tgz", + "integrity": "sha1-I0CQ7pfH1K0aLEvq4nUF3v/GCKQ=", + "dev": true, + "requires": { + "tslib": "^1.9.0" + } + }, + "ci-info": { + "version": "2.0.0", + "resolved": "https://registry.npm.taobao.org/ci-info/download/ci-info-2.0.0.tgz", + "integrity": "sha1-Z6npZL4xpR4V5QENWObxKDQAL0Y=", + "dev": true + }, + "cipher-base": { + "version": "1.0.4", + "resolved": "https://registry.npm.taobao.org/cipher-base/download/cipher-base-1.0.4.tgz", + "integrity": "sha1-h2Dk7MJy9MNjUy+SbYdKriwTl94=", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "class-utils": { + "version": "0.3.6", + "resolved": "https://registry.npm.taobao.org/class-utils/download/class-utils-0.3.6.tgz", + "integrity": "sha1-+TNprouafOAv1B+q0MqDAzGQxGM=", + "dev": true, + "requires": { + "arr-union": "^3.1.0", + "define-property": "^0.2.5", + "isobject": "^3.0.0", + "static-extend": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npm.taobao.org/define-property/download/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "cli-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npm.taobao.org/cli-cursor/download/cli-cursor-3.1.0.tgz", + "integrity": "sha1-JkMFp65JDR0Dvwybp8kl0XU68wc=", + "dev": true, + "requires": { + "restore-cursor": "^3.1.0" + } + }, + "cli-width": { + "version": "2.2.1", + "resolved": "https://registry.npm.taobao.org/cli-width/download/cli-width-2.2.1.tgz", + "integrity": "sha1-sEM9C06chH7xiGik7xb9X8gnHEg=", + "dev": true + }, + "cliui": { + "version": "6.0.0", + "resolved": "https://registry.npm.taobao.org/cliui/download/cliui-6.0.0.tgz", + "integrity": "sha1-UR1wLAxOQcoVbX0OlgIfI+EyJbE=", + "dev": true, + "requires": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "co": { + "version": "4.6.0", + "resolved": "https://registry.npm.taobao.org/co/download/co-4.6.0.tgz", + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", + "dev": true + }, + "collect-v8-coverage": { + "version": "1.0.1", + "resolved": "https://registry.npm.taobao.org/collect-v8-coverage/download/collect-v8-coverage-1.0.1.tgz", + "integrity": "sha1-zCyOlPwYu9/+ZNZTRXDIpnOyf1k=", + "dev": true + }, + "collection-visit": { + "version": "1.0.0", + "resolved": "https://registry.npm.taobao.org/collection-visit/download/collection-visit-1.0.0.tgz", + "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", + "dev": true, + "requires": { + "map-visit": "^1.0.0", + "object-visit": "^1.0.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npm.taobao.org/color-convert/download/color-convert-1.9.3.tgz", + "integrity": "sha1-u3GFBpDh8TZWfeYp0tVHHe2kweg=", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npm.taobao.org/color-name/download/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npm.taobao.org/combined-stream/download/combined-stream-1.0.8.tgz", + "integrity": "sha1-w9RaizT9cwYxoRCoolIGgrMdWn8=", + "dev": true, + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "commander": { + "version": "4.1.1", + "resolved": "https://registry.npm.taobao.org/commander/download/commander-4.1.1.tgz", + "integrity": "sha1-n9YCvZNilOnp70aj9NaWQESxgGg=", + "dev": true + }, + "commondir": { + "version": "1.0.1", + "resolved": "https://registry.npm.taobao.org/commondir/download/commondir-1.0.1.tgz", + "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=", + "dev": true + }, + "component-emitter": { + "version": "1.3.0", + "resolved": "https://registry.npm.taobao.org/component-emitter/download/component-emitter-1.3.0.tgz", + "integrity": "sha1-FuQHD7qK4ptnnyIVhT7hgasuq8A=", + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npm.taobao.org/concat-map/download/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npm.taobao.org/concat-stream/download/concat-stream-1.6.2.tgz", + "integrity": "sha1-kEvfGUzTEi/Gdcd/xKw9T/D9GjQ=", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + } + }, + "console-browserify": { + "version": "1.2.0", + "resolved": "https://registry.npm.taobao.org/console-browserify/download/console-browserify-1.2.0.tgz", + "integrity": "sha1-ZwY871fOts9Jk6KrOlWECujEkzY=", + "dev": true + }, + "constants-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npm.taobao.org/constants-browserify/download/constants-browserify-1.0.0.tgz", + "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=", + "dev": true + }, + "convert-source-map": { + "version": "1.7.0", + "resolved": "https://registry.npm.taobao.org/convert-source-map/download/convert-source-map-1.7.0.tgz", + "integrity": "sha1-F6LLiC1/d9NJBYXizmxSRCSjpEI=", + "dev": true, + "requires": { + "safe-buffer": "~5.1.1" + } + }, + "copy-concurrently": { + "version": "1.0.5", + "resolved": "https://registry.npm.taobao.org/copy-concurrently/download/copy-concurrently-1.0.5.tgz", + "integrity": "sha1-kilzmMrjSTf8r9bsgTnBgFHwteA=", + "dev": true, + "requires": { + "aproba": "^1.1.1", + "fs-write-stream-atomic": "^1.0.8", + "iferr": "^0.1.5", + "mkdirp": "^0.5.1", + "rimraf": "^2.5.4", + "run-queue": "^1.0.0" + } + }, + "copy-descriptor": { + "version": "0.1.1", + "resolved": "https://registry.npm.taobao.org/copy-descriptor/download/copy-descriptor-0.1.1.tgz", + "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", + "dev": true + }, + "core-js-compat": { + "version": "3.6.5", + "resolved": "https://registry.npm.taobao.org/core-js-compat/download/core-js-compat-3.6.5.tgz", + "integrity": "sha1-KlHZpOJd/W5pAlGqgfmePAVIHxw=", + "dev": true, + "requires": { + "browserslist": "^4.8.5", + "semver": "7.0.0" + }, + "dependencies": { + "semver": { + "version": "7.0.0", + "resolved": "https://registry.npm.taobao.org/semver/download/semver-7.0.0.tgz", + "integrity": "sha1-XzyjV2HkfgWyBsba/yz4FPAxa44=", + "dev": true + } + } + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npm.taobao.org/core-util-is/download/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "create-ecdh": { + "version": "4.0.3", + "resolved": "https://registry.npm.taobao.org/create-ecdh/download/create-ecdh-4.0.3.tgz", + "integrity": "sha1-yREbbzMEXEaX8UR4f5JUzcd8Rf8=", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "elliptic": "^6.0.0" + }, + "dependencies": { + "bn.js": { + "version": "4.11.9", + "resolved": "https://registry.npm.taobao.org/bn.js/download/bn.js-4.11.9.tgz", + "integrity": "sha1-JtVWgpRY+dHoH8SJUkk9C6NQeCg=", + "dev": true + } + } + }, + "create-hash": { + "version": "1.2.0", + "resolved": "https://registry.npm.taobao.org/create-hash/download/create-hash-1.2.0.tgz", + "integrity": "sha1-iJB4rxGmN1a8+1m9IhmWvjqe8ZY=", + "dev": true, + "requires": { + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "md5.js": "^1.3.4", + "ripemd160": "^2.0.1", + "sha.js": "^2.4.0" + } + }, + "create-hmac": { + "version": "1.1.7", + "resolved": "https://registry.npm.taobao.org/create-hmac/download/create-hmac-1.1.7.tgz", + "integrity": "sha1-aRcMeLOrlXFHsriwRXLkfq0iQ/8=", + "dev": true, + "requires": { + "cipher-base": "^1.0.3", + "create-hash": "^1.1.0", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npm.taobao.org/cross-spawn/download/cross-spawn-6.0.5.tgz?cache=0&sync_timestamp=1590420971248&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcross-spawn%2Fdownload%2Fcross-spawn-6.0.5.tgz", + "integrity": "sha1-Sl7Hxk364iw6FBJNus3uhG2Ay8Q=", + "dev": true, + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + }, + "dependencies": { + "which": { + "version": "1.3.1", + "resolved": "https://registry.npm.taobao.org/which/download/which-1.3.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fwhich%2Fdownload%2Fwhich-1.3.1.tgz", + "integrity": "sha1-pFBD1U9YBTFtqNYvn1CRjT2nCwo=", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } + }, + "crypto-browserify": { + "version": "3.12.0", + "resolved": "https://registry.npm.taobao.org/crypto-browserify/download/crypto-browserify-3.12.0.tgz", + "integrity": "sha1-OWz58xN/A+S45TLFj2mCVOAPgOw=", + "dev": true, + "requires": { + "browserify-cipher": "^1.0.0", + "browserify-sign": "^4.0.0", + "create-ecdh": "^4.0.0", + "create-hash": "^1.1.0", + "create-hmac": "^1.1.0", + "diffie-hellman": "^5.0.0", + "inherits": "^2.0.1", + "pbkdf2": "^3.0.3", + "public-encrypt": "^4.0.0", + "randombytes": "^2.0.0", + "randomfill": "^1.0.3" + } + }, + "cssom": { + "version": "0.4.4", + "resolved": "https://registry.npm.taobao.org/cssom/download/cssom-0.4.4.tgz?cache=0&sync_timestamp=1573719337707&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcssom%2Fdownload%2Fcssom-0.4.4.tgz", + "integrity": "sha1-WmbPk9LQtmHYC/akT7ZfXC5OChA=", + "dev": true + }, + "cssstyle": { + "version": "2.3.0", + "resolved": "https://registry.npm.taobao.org/cssstyle/download/cssstyle-2.3.0.tgz", + "integrity": "sha1-/2ZaDdvcMYZLCWR/NBY0Q9kLCFI=", + "dev": true, + "requires": { + "cssom": "~0.3.6" + }, + "dependencies": { + "cssom": { + "version": "0.3.8", + "resolved": "https://registry.npm.taobao.org/cssom/download/cssom-0.3.8.tgz?cache=0&sync_timestamp=1573719337707&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcssom%2Fdownload%2Fcssom-0.3.8.tgz", + "integrity": "sha1-nxJ29bK0Y/IRTT8sdSUK+MGjb0o=", + "dev": true + } + } + }, + "cyclist": { + "version": "1.0.1", + "resolved": "https://registry.npm.taobao.org/cyclist/download/cyclist-1.0.1.tgz", + "integrity": "sha1-WW6WmP0MgOEgOMK4LW6xs1tiJNk=", + "dev": true + }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npm.taobao.org/dashdash/download/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0" + } + }, + "data-urls": { + "version": "2.0.0", + "resolved": "https://registry.npm.taobao.org/data-urls/download/data-urls-2.0.0.tgz?cache=0&sync_timestamp=1577997348324&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdata-urls%2Fdownload%2Fdata-urls-2.0.0.tgz", + "integrity": "sha1-FWSFpyljqXD11YIar2Qr7yvy25s=", + "dev": true, + "requires": { + "abab": "^2.0.3", + "whatwg-mimetype": "^2.3.0", + "whatwg-url": "^8.0.0" + } + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npm.taobao.org/debug/download/debug-2.6.9.tgz?cache=0&sync_timestamp=1589881689076&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdebug%2Fdownload%2Fdebug-2.6.9.tgz", + "integrity": "sha1-XRKFFd8TT/Mn6QpMk/Tgd6U2NB8=", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npm.taobao.org/decamelize/download/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true + }, + "decimal.js": { + "version": "10.2.0", + "resolved": "https://registry.npm.taobao.org/decimal.js/download/decimal.js-10.2.0.tgz", + "integrity": "sha1-OUZhE6ngNhEdAvgkibX9awte0jE=", + "dev": true + }, + "decode-uri-component": { + "version": "0.2.0", + "resolved": "https://registry.npm.taobao.org/decode-uri-component/download/decode-uri-component-0.2.0.tgz", + "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", + "dev": true + }, + "deep-freeze": { + "version": "0.0.1", + "resolved": "https://registry.npm.taobao.org/deep-freeze/download/deep-freeze-0.0.1.tgz", + "integrity": "sha1-OgsABd4YZygZ39OM0x+RF5yJPoQ=", + "dev": true + }, + "deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npm.taobao.org/deep-is/download/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "dev": true + }, + "deepmerge": { + "version": "4.2.2", + "resolved": "https://registry.npm.taobao.org/deepmerge/download/deepmerge-4.2.2.tgz", + "integrity": "sha1-RNLqNnm49NT/ujPwPYZfwee/SVU=", + "dev": true + }, + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npm.taobao.org/define-properties/download/define-properties-1.1.3.tgz", + "integrity": "sha1-z4jabL7ib+bbcJT2HYcMvYTO6fE=", + "dev": true, + "requires": { + "object-keys": "^1.0.12" + } + }, + "define-property": { + "version": "2.0.2", + "resolved": "https://registry.npm.taobao.org/define-property/download/define-property-2.0.2.tgz", + "integrity": "sha1-1Flono1lS6d+AqgX+HENcCyxbp0=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" + }, + "dependencies": { + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npm.taobao.org/is-accessor-descriptor/download/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha1-FpwvbT3x+ZJhgHI2XJsOofaHhlY=", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npm.taobao.org/is-data-descriptor/download/is-data-descriptor-1.0.0.tgz", + "integrity": "sha1-2Eh2Mh0Oet0DmQQGq7u9NrqSaMc=", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npm.taobao.org/is-descriptor/download/is-descriptor-1.0.2.tgz", + "integrity": "sha1-OxWXRqZmBLBPjIFSS6NlxfFNhuw=", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npm.taobao.org/delayed-stream/download/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "dev": true + }, + "des.js": { + "version": "1.0.1", + "resolved": "https://registry.npm.taobao.org/des.js/download/des.js-1.0.1.tgz", + "integrity": "sha1-U4IULhvcU/hdhtU+X0qn3rkeCEM=", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + } + }, + "detect-newline": { + "version": "3.1.0", + "resolved": "https://registry.npm.taobao.org/detect-newline/download/detect-newline-3.1.0.tgz", + "integrity": "sha1-V29d/GOuGhkv8ZLYrTr2MImRtlE=", + "dev": true + }, + "diff": { + "version": "4.0.2", + "resolved": "https://registry.npm.taobao.org/diff/download/diff-4.0.2.tgz", + "integrity": "sha1-YPOuy4nV+uUgwRqhnvwruYKq3n0=", + "dev": true + }, + "diff-sequences": { + "version": "26.0.0", + "resolved": "https://registry.npm.taobao.org/diff-sequences/download/diff-sequences-26.0.0.tgz", + "integrity": "sha1-B2AFmlwodje4Qr1whTEdtwYOiKY=", + "dev": true + }, + "diffie-hellman": { + "version": "5.0.3", + "resolved": "https://registry.npm.taobao.org/diffie-hellman/download/diffie-hellman-5.0.3.tgz", + "integrity": "sha1-QOjumPVaIUlgcUaSHGPhrl89KHU=", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "miller-rabin": "^4.0.0", + "randombytes": "^2.0.0" + }, + "dependencies": { + "bn.js": { + "version": "4.11.9", + "resolved": "https://registry.npm.taobao.org/bn.js/download/bn.js-4.11.9.tgz", + "integrity": "sha1-JtVWgpRY+dHoH8SJUkk9C6NQeCg=", + "dev": true + } + } + }, + "doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npm.taobao.org/doctrine/download/doctrine-3.0.0.tgz", + "integrity": "sha1-rd6+rXKmV023g2OdyHoSF3OXOWE=", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + }, + "domain-browser": { + "version": "1.2.0", + "resolved": "https://registry.npm.taobao.org/domain-browser/download/domain-browser-1.2.0.tgz", + "integrity": "sha1-PTH1AZGmdJ3RN1p/Ui6CPULlTto=", + "dev": true + }, + "domexception": { + "version": "2.0.1", + "resolved": "https://registry.npm.taobao.org/domexception/download/domexception-2.0.1.tgz?cache=0&sync_timestamp=1576355459111&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdomexception%2Fdownload%2Fdomexception-2.0.1.tgz", + "integrity": "sha1-+0Su+6eT4VdLCvau0oAdBXUp8wQ=", + "dev": true, + "requires": { + "webidl-conversions": "^5.0.0" + }, + "dependencies": { + "webidl-conversions": { + "version": "5.0.0", + "resolved": "https://registry.npm.taobao.org/webidl-conversions/download/webidl-conversions-5.0.0.tgz", + "integrity": "sha1-rlnIoAsSFUOirMZcBDT1ew/BGv8=", + "dev": true + } + } + }, + "duplexer": { + "version": "0.1.1", + "resolved": "https://registry.npm.taobao.org/duplexer/download/duplexer-0.1.1.tgz", + "integrity": "sha1-rOb/gIwc5mtX0ev5eXessCM0z8E=", + "dev": true + }, + "duplexify": { + "version": "3.7.1", + "resolved": "https://registry.npm.taobao.org/duplexify/download/duplexify-3.7.1.tgz", + "integrity": "sha1-Kk31MX9sz9kfhtb9JdjYoQO4gwk=", + "dev": true, + "requires": { + "end-of-stream": "^1.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.0.0", + "stream-shift": "^1.0.0" + } + }, + "ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://registry.npm.taobao.org/ecc-jsbn/download/ecc-jsbn-0.1.2.tgz", + "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "dev": true, + "requires": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, + "electron-to-chromium": { + "version": "1.3.464", + "resolved": "https://registry.npm.taobao.org/electron-to-chromium/download/electron-to-chromium-1.3.464.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Felectron-to-chromium%2Fdownload%2Felectron-to-chromium-1.3.464.tgz", + "integrity": "sha1-/hP+qgj2+GXTyJ1dcuVMGU9GOqU=", + "dev": true + }, + "elliptic": { + "version": "6.5.2", + "resolved": "https://registry.npm.taobao.org/elliptic/download/elliptic-6.5.2.tgz", + "integrity": "sha1-BcVnjXFzwEnYykM1UiJKSV0ON2I=", + "dev": true, + "requires": { + "bn.js": "^4.4.0", + "brorand": "^1.0.1", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.0" + }, + "dependencies": { + "bn.js": { + "version": "4.11.9", + "resolved": "https://registry.npm.taobao.org/bn.js/download/bn.js-4.11.9.tgz", + "integrity": "sha1-JtVWgpRY+dHoH8SJUkk9C6NQeCg=", + "dev": true + } + } + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npm.taobao.org/emoji-regex/download/emoji-regex-8.0.0.tgz?cache=0&sync_timestamp=1586511397703&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Femoji-regex%2Fdownload%2Femoji-regex-8.0.0.tgz", + "integrity": "sha1-6Bj9ac5cz8tARZT4QpY79TFkzDc=", + "dev": true + }, + "emojis-list": { + "version": "3.0.0", + "resolved": "https://registry.npm.taobao.org/emojis-list/download/emojis-list-3.0.0.tgz", + "integrity": "sha1-VXBmIEatKeLpFucariYKvf9Pang=", + "dev": true + }, + "end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npm.taobao.org/end-of-stream/download/end-of-stream-1.4.4.tgz", + "integrity": "sha1-WuZKX0UFe682JuwU2gyl5LJDHrA=", + "dev": true, + "requires": { + "once": "^1.4.0" + } + }, + "enhanced-resolve": { + "version": "4.1.1", + "resolved": "https://registry.npm.taobao.org/enhanced-resolve/download/enhanced-resolve-4.1.1.tgz?cache=0&sync_timestamp=1591175115319&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fenhanced-resolve%2Fdownload%2Fenhanced-resolve-4.1.1.tgz", + "integrity": "sha1-KTfiuAZs0P584JkKmPDXGjUYn2Y=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "memory-fs": "^0.5.0", + "tapable": "^1.0.0" + } + }, + "errno": { + "version": "0.1.7", + "resolved": "https://registry.npm.taobao.org/errno/download/errno-0.1.7.tgz", + "integrity": "sha1-RoTXF3mtOa8Xfj8AeZb3xnyFJhg=", + "dev": true, + "requires": { + "prr": "~1.0.1" + } + }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npm.taobao.org/error-ex/download/error-ex-1.3.2.tgz", + "integrity": "sha1-tKxAZIEH/c3PriQvQovqihTU8b8=", + "dev": true, + "requires": { + "is-arrayish": "^0.2.1" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npm.taobao.org/escape-string-regexp/download/escape-string-regexp-1.0.5.tgz?cache=0&sync_timestamp=1587627107924&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fescape-string-regexp%2Fdownload%2Fescape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "escodegen": { + "version": "1.14.2", + "resolved": "https://registry.npm.taobao.org/escodegen/download/escodegen-1.14.2.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fescodegen%2Fdownload%2Fescodegen-1.14.2.tgz", + "integrity": "sha1-FKtxv1AmwqoIFzr7oixvMXMoSoQ=", + "dev": true, + "requires": { + "esprima": "^4.0.1", + "estraverse": "^4.2.0", + "esutils": "^2.0.2", + "optionator": "^0.8.1", + "source-map": "~0.6.1" + }, + "dependencies": { + "levn": { + "version": "0.3.0", + "resolved": "https://registry.npm.taobao.org/levn/download/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "dev": true, + "requires": { + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" + } + }, + "optionator": { + "version": "0.8.3", + "resolved": "https://registry.npm.taobao.org/optionator/download/optionator-0.8.3.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Foptionator%2Fdownload%2Foptionator-0.8.3.tgz", + "integrity": "sha1-hPodA2/p08fiHZmIS2ARZ+yPtJU=", + "dev": true, + "requires": { + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.6", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "word-wrap": "~1.2.3" + } + }, + "prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npm.taobao.org/prelude-ls/download/prelude-ls-1.1.2.tgz?cache=0&sync_timestamp=1585868608597&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fprelude-ls%2Fdownload%2Fprelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npm.taobao.org/source-map/download/source-map-0.6.1.tgz", + "integrity": "sha1-dHIq8y6WFOnCh6jQu95IteLxomM=", + "dev": true, + "optional": true + }, + "type-check": { + "version": "0.3.2", + "resolved": "https://registry.npm.taobao.org/type-check/download/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "dev": true, + "requires": { + "prelude-ls": "~1.1.2" + } + } + } + }, + "eslint": { + "version": "7.2.0", + "resolved": "https://registry.npm.taobao.org/eslint/download/eslint-7.2.0.tgz?cache=0&sync_timestamp=1591401814806&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Feslint%2Fdownload%2Feslint-7.2.0.tgz", + "integrity": "sha1-1BsuR4BLMNursJOpZ/soPVYAguY=", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "eslint-scope": "^5.1.0", + "eslint-utils": "^2.0.0", + "eslint-visitor-keys": "^1.2.0", + "espree": "^7.1.0", + "esquery": "^1.2.0", + "esutils": "^2.0.2", + "file-entry-cache": "^5.0.1", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^5.0.0", + "globals": "^12.1.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "inquirer": "^7.0.0", + "is-glob": "^4.0.0", + "js-yaml": "^3.13.1", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash": "^4.17.14", + "minimatch": "^3.0.4", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "progress": "^2.0.0", + "regexpp": "^3.1.0", + "semver": "^7.2.1", + "strip-ansi": "^6.0.0", + "strip-json-comments": "^3.1.0", + "table": "^5.2.3", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + }, + "dependencies": { + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npm.taobao.org/ansi-styles/download/ansi-styles-4.2.1.tgz", + "integrity": "sha1-kK51xCTQCNJiTFvynq0xd+v881k=", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/chalk/download/chalk-4.0.0.tgz", + "integrity": "sha1-bpgIHtLRf6q2FetSrGbsH+YgnnI=", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npm.taobao.org/color-convert/download/color-convert-2.0.1.tgz", + "integrity": "sha1-ctOmjVmMm9s68q0ehPIdiWq9TeM=", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npm.taobao.org/color-name/download/color-name-1.1.4.tgz", + "integrity": "sha1-wqCah6y95pVD3m9j+jmVyCbFNqI=", + "dev": true + }, + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npm.taobao.org/cross-spawn/download/cross-spawn-7.0.3.tgz?cache=0&sync_timestamp=1590420971248&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcross-spawn%2Fdownload%2Fcross-spawn-7.0.3.tgz", + "integrity": "sha1-9zqFudXUHQRVUcF34ogtSshXKKY=", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npm.taobao.org/debug/download/debug-4.1.1.tgz?cache=0&sync_timestamp=1589881689076&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdebug%2Fdownload%2Fdebug-4.1.1.tgz", + "integrity": "sha1-O3ImAlUQnGtYnO4FDx1RYTlmR5E=", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "glob-parent": { + "version": "5.1.1", + "resolved": "https://registry.npm.taobao.org/glob-parent/download/glob-parent-5.1.1.tgz", + "integrity": "sha1-tsHvQXxOVmPqSY8cRa+saRa7wik=", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "globals": { + "version": "12.4.0", + "resolved": "https://registry.npm.taobao.org/globals/download/globals-12.4.0.tgz", + "integrity": "sha1-oYgTV2pBsAokqX5/gVkYwuGZJfg=", + "dev": true, + "requires": { + "type-fest": "^0.8.1" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/has-flag/download/has-flag-4.0.0.tgz", + "integrity": "sha1-lEdx/ZyByBJlxNaUGGDaBrtZR5s=", + "dev": true + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npm.taobao.org/ms/download/ms-2.1.2.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fms%2Fdownload%2Fms-2.1.2.tgz", + "integrity": "sha1-0J0fNXtEP0kzgqjrPM0YOHKuYAk=", + "dev": true + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npm.taobao.org/path-key/download/path-key-3.1.1.tgz?cache=0&sync_timestamp=1574441322626&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fpath-key%2Fdownload%2Fpath-key-3.1.1.tgz", + "integrity": "sha1-WB9q3mWMu6ZaDTOA3ndTKVBU83U=", + "dev": true + }, + "semver": { + "version": "7.3.2", + "resolved": "https://registry.npm.taobao.org/semver/download/semver-7.3.2.tgz", + "integrity": "sha1-YElisFK4HtB4aq6EOJ/7pw/9OTg=", + "dev": true + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npm.taobao.org/shebang-command/download/shebang-command-2.0.0.tgz", + "integrity": "sha1-zNCvT4g1+9wmW4JGGq8MNmY/NOo=", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npm.taobao.org/shebang-regex/download/shebang-regex-3.0.0.tgz", + "integrity": "sha1-rhbxZE2HPsrYQ7AwexQzYtTEIXI=", + "dev": true + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npm.taobao.org/supports-color/download/supports-color-7.1.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsupports-color%2Fdownload%2Fsupports-color-7.1.0.tgz", + "integrity": "sha1-aOMlkd9z4lrRxLSRCKLsUHliv9E=", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "eslint-config-google": { + "version": "0.14.0", + "resolved": "https://registry.npm.taobao.org/eslint-config-google/download/eslint-config-google-0.14.0.tgz", + "integrity": "sha1-T1+HWbpuEbQkKUohnb+hjFCLzBo=", + "dev": true + }, + "eslint-plugin-jest": { + "version": "23.13.2", + "resolved": "https://registry.npm.taobao.org/eslint-plugin-jest/download/eslint-plugin-jest-23.13.2.tgz", + "integrity": "sha1-e3mTtOCb5wjGlrAlVQg93v1+TMc=", + "dev": true, + "requires": { + "@typescript-eslint/experimental-utils": "^2.5.0" + } + }, + "eslint-scope": { + "version": "5.1.0", + "resolved": "https://registry.npm.taobao.org/eslint-scope/download/eslint-scope-5.1.0.tgz", + "integrity": "sha1-0Plx3+WcaeDK2mhLI9Sdv4JgDOU=", + "dev": true, + "requires": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + } + }, + "eslint-utils": { + "version": "2.0.0", + "resolved": "https://registry.npm.taobao.org/eslint-utils/download/eslint-utils-2.0.0.tgz", + "integrity": "sha1-e+HMcPJ6cqds0UqmmLyr7WiQ4c0=", + "dev": true, + "requires": { + "eslint-visitor-keys": "^1.1.0" + } + }, + "eslint-visitor-keys": { + "version": "1.2.0", + "resolved": "https://registry.npm.taobao.org/eslint-visitor-keys/download/eslint-visitor-keys-1.2.0.tgz?cache=0&sync_timestamp=1591268823690&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Feslint-visitor-keys%2Fdownload%2Feslint-visitor-keys-1.2.0.tgz", + "integrity": "sha1-dEFayISHRJX3jsKpc0lSU0TJgfo=", + "dev": true + }, + "espree": { + "version": "7.1.0", + "resolved": "https://registry.npm.taobao.org/espree/download/espree-7.1.0.tgz?cache=0&sync_timestamp=1591269463485&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fespree%2Fdownload%2Fespree-7.1.0.tgz", + "integrity": "sha1-qcfxinUgVnNb8boUyxtwrcOlzhw=", + "dev": true, + "requires": { + "acorn": "^7.2.0", + "acorn-jsx": "^5.2.0", + "eslint-visitor-keys": "^1.2.0" + } + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npm.taobao.org/esprima/download/esprima-4.0.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fesprima%2Fdownload%2Fesprima-4.0.1.tgz", + "integrity": "sha1-E7BM2z5sXRnfkatph6hpVhmwqnE=", + "dev": true + }, + "esquery": { + "version": "1.3.1", + "resolved": "https://registry.npm.taobao.org/esquery/download/esquery-1.3.1.tgz?cache=0&sync_timestamp=1587061286348&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fesquery%2Fdownload%2Fesquery-1.3.1.tgz", + "integrity": "sha1-t4tYKKqOIU4p+3TE1bdS4cAz2lc=", + "dev": true, + "requires": { + "estraverse": "^5.1.0" + }, + "dependencies": { + "estraverse": { + "version": "5.1.0", + "resolved": "https://registry.npm.taobao.org/estraverse/download/estraverse-5.1.0.tgz", + "integrity": "sha1-N0MJ05/ZNa5QDnuS6Ka0xyDllkI=", + "dev": true + } + } + }, + "esrecurse": { + "version": "4.2.1", + "resolved": "https://registry.npm.taobao.org/esrecurse/download/esrecurse-4.2.1.tgz", + "integrity": "sha1-AHo7n9vCs7uH5IeeoZyS/b05Qs8=", + "dev": true, + "requires": { + "estraverse": "^4.1.0" + } + }, + "estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npm.taobao.org/estraverse/download/estraverse-4.3.0.tgz", + "integrity": "sha1-OYrT88WiSUi+dyXoPRGn3ijNvR0=", + "dev": true + }, + "estree-walker": { + "version": "1.0.1", + "resolved": "https://registry.npm.taobao.org/estree-walker/download/estree-walker-1.0.1.tgz", + "integrity": "sha1-MbxdYSyWtwQQa0d+bdXYqhOMtwA=", + "dev": true + }, + "esutils": { + "version": "2.0.3", + "resolved": "https://registry.npm.taobao.org/esutils/download/esutils-2.0.3.tgz?cache=0&sync_timestamp=1564535492241&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fesutils%2Fdownload%2Fesutils-2.0.3.tgz", + "integrity": "sha1-dNLrTeC42hKTcRkQ1Qd1ubcQ72Q=", + "dev": true + }, + "events": { + "version": "3.1.0", + "resolved": "https://registry.npm.taobao.org/events/download/events-3.1.0.tgz", + "integrity": "sha1-hCea8bNMt1qoi/X/KR9tC9mzGlk=", + "dev": true + }, + "evp_bytestokey": { + "version": "1.0.3", + "resolved": "https://registry.npm.taobao.org/evp_bytestokey/download/evp_bytestokey-1.0.3.tgz", + "integrity": "sha1-f8vbGY3HGVlDLv4ThCaE4FJaywI=", + "dev": true, + "requires": { + "md5.js": "^1.3.4", + "safe-buffer": "^5.1.1" + } + }, + "exec-sh": { + "version": "0.3.4", + "resolved": "https://registry.npm.taobao.org/exec-sh/download/exec-sh-0.3.4.tgz", + "integrity": "sha1-OgGM61JsxvbfK7UEsr/o46STTsU=", + "dev": true + }, + "execa": { + "version": "1.0.0", + "resolved": "https://registry.npm.taobao.org/execa/download/execa-1.0.0.tgz?cache=0&sync_timestamp=1590156636749&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fexeca%2Fdownload%2Fexeca-1.0.0.tgz", + "integrity": "sha1-xiNqW7TfbW8V6I5/AXeYIWdJ3dg=", + "dev": true, + "requires": { + "cross-spawn": "^6.0.0", + "get-stream": "^4.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + } + }, + "exit": { + "version": "0.1.2", + "resolved": "https://registry.npm.taobao.org/exit/download/exit-0.1.2.tgz", + "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=", + "dev": true + }, + "expand-brackets": { + "version": "2.1.4", + "resolved": "https://registry.npm.taobao.org/expand-brackets/download/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "dev": true, + "requires": { + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npm.taobao.org/define-property/download/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npm.taobao.org/extend-shallow/download/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "expect": { + "version": "26.0.1", + "resolved": "https://registry.npm.taobao.org/expect/download/expect-26.0.1.tgz", + "integrity": "sha1-GGl7lhGn4nJeILo86t2km8mGVCE=", + "dev": true, + "requires": { + "@jest/types": "^26.0.1", + "ansi-styles": "^4.0.0", + "jest-get-type": "^26.0.0", + "jest-matcher-utils": "^26.0.1", + "jest-message-util": "^26.0.1", + "jest-regex-util": "^26.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npm.taobao.org/ansi-styles/download/ansi-styles-4.2.1.tgz", + "integrity": "sha1-kK51xCTQCNJiTFvynq0xd+v881k=", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npm.taobao.org/color-convert/download/color-convert-2.0.1.tgz", + "integrity": "sha1-ctOmjVmMm9s68q0ehPIdiWq9TeM=", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npm.taobao.org/color-name/download/color-name-1.1.4.tgz", + "integrity": "sha1-wqCah6y95pVD3m9j+jmVyCbFNqI=", + "dev": true + } + } + }, + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npm.taobao.org/extend/download/extend-3.0.2.tgz", + "integrity": "sha1-+LETa0Bx+9jrFAr/hYsQGewpFfo=", + "dev": true + }, + "extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npm.taobao.org/extend-shallow/download/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "dev": true, + "requires": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npm.taobao.org/is-extendable/download/is-extendable-1.0.1.tgz", + "integrity": "sha1-p0cPnkJnM9gb2B4RVSZOOjUHyrQ=", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "external-editor": { + "version": "3.1.0", + "resolved": "https://registry.npm.taobao.org/external-editor/download/external-editor-3.1.0.tgz?cache=0&sync_timestamp=1562602052556&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fexternal-editor%2Fdownload%2Fexternal-editor-3.1.0.tgz", + "integrity": "sha1-ywP3QL764D6k0oPK7SdBqD8zVJU=", + "dev": true, + "requires": { + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", + "tmp": "^0.0.33" + } + }, + "extglob": { + "version": "2.0.4", + "resolved": "https://registry.npm.taobao.org/extglob/download/extglob-2.0.4.tgz", + "integrity": "sha1-rQD+TcYSqSMuhxhxHcXLWrAoVUM=", + "dev": true, + "requires": { + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npm.taobao.org/define-property/download/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npm.taobao.org/extend-shallow/download/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npm.taobao.org/is-accessor-descriptor/download/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha1-FpwvbT3x+ZJhgHI2XJsOofaHhlY=", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npm.taobao.org/is-data-descriptor/download/is-data-descriptor-1.0.0.tgz", + "integrity": "sha1-2Eh2Mh0Oet0DmQQGq7u9NrqSaMc=", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npm.taobao.org/is-descriptor/download/is-descriptor-1.0.2.tgz", + "integrity": "sha1-OxWXRqZmBLBPjIFSS6NlxfFNhuw=", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npm.taobao.org/extsprintf/download/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", + "dev": true + }, + "fast-deep-equal": { + "version": "3.1.1", + "resolved": "https://registry.npm.taobao.org/fast-deep-equal/download/fast-deep-equal-3.1.1.tgz?cache=0&sync_timestamp=1575383928809&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ffast-deep-equal%2Fdownload%2Ffast-deep-equal-3.1.1.tgz", + "integrity": "sha1-VFFFB3xQFJHjOxXsQIwpQ3bpSuQ=", + "dev": true + }, + "fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npm.taobao.org/fast-json-stable-stringify/download/fast-json-stable-stringify-2.1.0.tgz?cache=0&sync_timestamp=1576340291001&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ffast-json-stable-stringify%2Fdownload%2Ffast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha1-h0v2nG9ATCtdmcSBNBOZ/VWJJjM=", + "dev": true + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npm.taobao.org/fast-levenshtein/download/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "fb-watchman": { + "version": "2.0.1", + "resolved": "https://registry.npm.taobao.org/fb-watchman/download/fb-watchman-2.0.1.tgz", + "integrity": "sha1-/IT7OdJwnPP/bXQ3BhV7tXCKioU=", + "dev": true, + "requires": { + "bser": "2.1.1" + } + }, + "figgy-pudding": { + "version": "3.5.2", + "resolved": "https://registry.npm.taobao.org/figgy-pudding/download/figgy-pudding-3.5.2.tgz", + "integrity": "sha1-tO7oFIq7Adzx0aw0Nn1Z4S+mHW4=", + "dev": true + }, + "figures": { + "version": "3.2.0", + "resolved": "https://registry.npm.taobao.org/figures/download/figures-3.2.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ffigures%2Fdownload%2Ffigures-3.2.0.tgz", + "integrity": "sha1-YlwYvSk8YE3EqN2y/r8MiDQXRq8=", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.5" + } + }, + "file-entry-cache": { + "version": "5.0.1", + "resolved": "https://registry.npm.taobao.org/file-entry-cache/download/file-entry-cache-5.0.1.tgz", + "integrity": "sha1-yg9u+m3T1WEzP7FFFQZcL6/fQ5w=", + "dev": true, + "requires": { + "flat-cache": "^2.0.1" + } + }, + "file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npm.taobao.org/file-uri-to-path/download/file-uri-to-path-1.0.0.tgz?cache=0&sync_timestamp=1570825475173&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ffile-uri-to-path%2Fdownload%2Ffile-uri-to-path-1.0.0.tgz", + "integrity": "sha1-VTp7hEb/b2hDWcRF8eN6BdrMM90=", + "dev": true, + "optional": true + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/fill-range/download/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npm.taobao.org/extend-shallow/download/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "find-cache-dir": { + "version": "2.1.0", + "resolved": "https://registry.npm.taobao.org/find-cache-dir/download/find-cache-dir-2.1.0.tgz?cache=0&sync_timestamp=1583734591888&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ffind-cache-dir%2Fdownload%2Ffind-cache-dir-2.1.0.tgz", + "integrity": "sha1-jQ+UzRP+Q8bHwmGg2GEVypGMBfc=", + "dev": true, + "requires": { + "commondir": "^1.0.1", + "make-dir": "^2.0.0", + "pkg-dir": "^3.0.0" + }, + "dependencies": { + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npm.taobao.org/find-up/download/find-up-3.0.0.tgz", + "integrity": "sha1-SRafHXmTQwZG2mHsxa41XCHJe3M=", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npm.taobao.org/locate-path/download/locate-path-3.0.0.tgz", + "integrity": "sha1-2+w7OrdZdYBxtY/ln8QYca8hQA4=", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npm.taobao.org/p-limit/download/p-limit-2.3.0.tgz?cache=0&sync_timestamp=1591460606987&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fp-limit%2Fdownload%2Fp-limit-2.3.0.tgz", + "integrity": "sha1-PdM8ZHohT9//2DWTPrCG2g3CHbE=", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npm.taobao.org/p-locate/download/p-locate-3.0.0.tgz", + "integrity": "sha1-Mi1poFwCZLJZl9n0DNiokasAZKQ=", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npm.taobao.org/p-try/download/p-try-2.2.0.tgz", + "integrity": "sha1-yyhoVA4xPWHeWPr741zpAE1VQOY=", + "dev": true + }, + "pkg-dir": { + "version": "3.0.0", + "resolved": "https://registry.npm.taobao.org/pkg-dir/download/pkg-dir-3.0.0.tgz", + "integrity": "sha1-J0kCDyOe2ZCIGx9xIQ1R62UjvqM=", + "dev": true, + "requires": { + "find-up": "^3.0.0" + } + } + } + }, + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npm.taobao.org/find-up/download/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "^2.0.0" + } + }, + "flat-cache": { + "version": "2.0.1", + "resolved": "https://registry.npm.taobao.org/flat-cache/download/flat-cache-2.0.1.tgz", + "integrity": "sha1-XSltbwS9pEpGMKMBQTvbwuwIXsA=", + "dev": true, + "requires": { + "flatted": "^2.0.0", + "rimraf": "2.6.3", + "write": "1.0.3" + } + }, + "flatted": { + "version": "2.0.2", + "resolved": "https://registry.npm.taobao.org/flatted/download/flatted-2.0.2.tgz?cache=0&sync_timestamp=1590517213403&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fflatted%2Fdownload%2Fflatted-2.0.2.tgz", + "integrity": "sha1-RXWyHivO50NKqb5mL0t7X5wrUTg=", + "dev": true + }, + "flush-write-stream": { + "version": "1.1.1", + "resolved": "https://registry.npm.taobao.org/flush-write-stream/download/flush-write-stream-1.1.1.tgz", + "integrity": "sha1-jdfYc6G6vCB9lOrQwuDkQnbr8ug=", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "readable-stream": "^2.3.6" + } + }, + "for-in": { + "version": "1.0.2", + "resolved": "https://registry.npm.taobao.org/for-in/download/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "dev": true + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npm.taobao.org/forever-agent/download/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", + "dev": true + }, + "form-data": { + "version": "2.3.3", + "resolved": "https://registry.npm.taobao.org/form-data/download/form-data-2.3.3.tgz?cache=0&sync_timestamp=1573027118125&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fform-data%2Fdownload%2Fform-data-2.3.3.tgz", + "integrity": "sha1-3M5SwF9kTymManq5Nr1yTO/786Y=", + "dev": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + } + }, + "fragment-cache": { + "version": "0.2.1", + "resolved": "https://registry.npm.taobao.org/fragment-cache/download/fragment-cache-0.2.1.tgz", + "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", + "dev": true, + "requires": { + "map-cache": "^0.2.2" + } + }, + "from2": { + "version": "2.3.0", + "resolved": "https://registry.npm.taobao.org/from2/download/from2-2.3.0.tgz", + "integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "readable-stream": "^2.0.0" + } + }, + "fs-readdir-recursive": { + "version": "1.1.0", + "resolved": "https://registry.npm.taobao.org/fs-readdir-recursive/download/fs-readdir-recursive-1.1.0.tgz", + "integrity": "sha1-4y/AMKLM7kSmtTcTCNpUvgs5fSc=", + "dev": true + }, + "fs-write-stream-atomic": { + "version": "1.0.10", + "resolved": "https://registry.npm.taobao.org/fs-write-stream-atomic/download/fs-write-stream-atomic-1.0.10.tgz", + "integrity": "sha1-tH31NJPvkR33VzHnCp3tAYnbQMk=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "iferr": "^0.1.5", + "imurmurhash": "^0.1.4", + "readable-stream": "1 || 2" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npm.taobao.org/fs.realpath/download/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "fsevents": { + "version": "1.2.13", + "resolved": "https://registry.npm.taobao.org/fsevents/download/fsevents-1.2.13.tgz", + "integrity": "sha1-8yXLBFVZJCi88Rs4M3DvcOO/zDg=", + "dev": true, + "optional": true, + "requires": { + "bindings": "^1.5.0", + "nan": "^2.12.1" + } + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npm.taobao.org/function-bind/download/function-bind-1.1.1.tgz", + "integrity": "sha1-pWiZ0+o8m6uHS7l3O3xe3pL0iV0=", + "dev": true + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npm.taobao.org/functional-red-black-tree/download/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, + "gensync": { + "version": "1.0.0-beta.1", + "resolved": "https://registry.npm.taobao.org/gensync/download/gensync-1.0.0-beta.1.tgz", + "integrity": "sha1-WPQ2H/mH5f9uHnohCCeqNx6qwmk=", + "dev": true + }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npm.taobao.org/get-caller-file/download/get-caller-file-2.0.5.tgz", + "integrity": "sha1-T5RBKoLbMvNuOwuXQfipf+sDH34=", + "dev": true + }, + "get-package-type": { + "version": "0.1.0", + "resolved": "https://registry.npm.taobao.org/get-package-type/download/get-package-type-0.1.0.tgz", + "integrity": "sha1-jeLYA8/0TfO8bEVuZmizbDkm4Ro=", + "dev": true + }, + "get-stream": { + "version": "4.1.0", + "resolved": "https://registry.npm.taobao.org/get-stream/download/get-stream-4.1.0.tgz", + "integrity": "sha1-wbJVV189wh1Zv8ec09K0axw6VLU=", + "dev": true, + "requires": { + "pump": "^3.0.0" + } + }, + "get-value": { + "version": "2.0.6", + "resolved": "https://registry.npm.taobao.org/get-value/download/get-value-2.0.6.tgz", + "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", + "dev": true + }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npm.taobao.org/getpass/download/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0" + } + }, + "glob": { + "version": "7.1.6", + "resolved": "https://registry.npm.taobao.org/glob/download/glob-7.1.6.tgz?cache=0&sync_timestamp=1573078079496&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fglob%2Fdownload%2Fglob-7.1.6.tgz", + "integrity": "sha1-FB8zuBp8JJLhJVlDB0gMRmeSeKY=", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-parent": { + "version": "3.1.0", + "resolved": "https://registry.npm.taobao.org/glob-parent/download/glob-parent-3.1.0.tgz", + "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", + "dev": true, + "optional": true, + "requires": { + "is-glob": "^3.1.0", + "path-dirname": "^1.0.0" + }, + "dependencies": { + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npm.taobao.org/is-glob/download/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "dev": true, + "optional": true, + "requires": { + "is-extglob": "^2.1.0" + } + } + } + }, + "globals": { + "version": "11.12.0", + "resolved": "https://registry.npm.taobao.org/globals/download/globals-11.12.0.tgz", + "integrity": "sha1-q4eVM4hooLq9hSV1gBjCp+uVxC4=", + "dev": true + }, + "graceful-fs": { + "version": "4.2.4", + "resolved": "https://registry.npm.taobao.org/graceful-fs/download/graceful-fs-4.2.4.tgz?cache=0&sync_timestamp=1588086876757&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fgraceful-fs%2Fdownload%2Fgraceful-fs-4.2.4.tgz", + "integrity": "sha1-Ila94U02MpWMRl68ltxGfKB6Kfs=", + "dev": true + }, + "growly": { + "version": "1.3.0", + "resolved": "https://registry.npm.taobao.org/growly/download/growly-1.3.0.tgz", + "integrity": "sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE=", + "dev": true, + "optional": true + }, + "gzip-size": { + "version": "5.1.1", + "resolved": "https://registry.npm.taobao.org/gzip-size/download/gzip-size-5.1.1.tgz", + "integrity": "sha1-y5vuaS+HwGErIyhAqHOQTkwTUnQ=", + "dev": true, + "requires": { + "duplexer": "^0.1.1", + "pify": "^4.0.1" + } + }, + "har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npm.taobao.org/har-schema/download/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", + "dev": true + }, + "har-validator": { + "version": "5.1.3", + "resolved": "https://registry.npm.taobao.org/har-validator/download/har-validator-5.1.3.tgz", + "integrity": "sha1-HvievT5JllV2de7ZiTEQ3DUPoIA=", + "dev": true, + "requires": { + "ajv": "^6.5.5", + "har-schema": "^2.0.0" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npm.taobao.org/has-flag/download/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "has-symbols": { + "version": "1.0.1", + "resolved": "https://registry.npm.taobao.org/has-symbols/download/has-symbols-1.0.1.tgz", + "integrity": "sha1-n1IUdYpEGWxAbZvXbOv4HsLdMeg=", + "dev": true + }, + "has-value": { + "version": "1.0.0", + "resolved": "https://registry.npm.taobao.org/has-value/download/has-value-1.0.0.tgz", + "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", + "dev": true, + "requires": { + "get-value": "^2.0.6", + "has-values": "^1.0.0", + "isobject": "^3.0.0" + } + }, + "has-values": { + "version": "1.0.0", + "resolved": "https://registry.npm.taobao.org/has-values/download/has-values-1.0.0.tgz", + "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "kind-of": "^4.0.0" + }, + "dependencies": { + "kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/kind-of/download/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "hash-base": { + "version": "3.1.0", + "resolved": "https://registry.npm.taobao.org/hash-base/download/hash-base-3.1.0.tgz", + "integrity": "sha1-VcOB2eBuHSmXqIO0o/3f5/DTrzM=", + "dev": true, + "requires": { + "inherits": "^2.0.4", + "readable-stream": "^3.6.0", + "safe-buffer": "^5.2.0" + }, + "dependencies": { + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npm.taobao.org/readable-stream/download/readable-stream-3.6.0.tgz?cache=0&sync_timestamp=1581624324274&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Freadable-stream%2Fdownload%2Freadable-stream-3.6.0.tgz", + "integrity": "sha1-M3u9o63AcGvT4CRCaihtS0sskZg=", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npm.taobao.org/safe-buffer/download/safe-buffer-5.2.1.tgz?cache=0&sync_timestamp=1589129103371&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsafe-buffer%2Fdownload%2Fsafe-buffer-5.2.1.tgz", + "integrity": "sha1-Hq+fqb2x/dTsdfWPnNtOa3gn7sY=", + "dev": true + } + } + }, + "hash.js": { + "version": "1.1.7", + "resolved": "https://registry.npm.taobao.org/hash.js/download/hash.js-1.1.7.tgz", + "integrity": "sha1-C6vKU46NTuSg+JiNaIZlN6ADz0I=", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + } + }, + "hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npm.taobao.org/hmac-drbg/download/hmac-drbg-1.0.1.tgz", + "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", + "dev": true, + "requires": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "hosted-git-info": { + "version": "2.8.8", + "resolved": "https://registry.npm.taobao.org/hosted-git-info/download/hosted-git-info-2.8.8.tgz?cache=0&sync_timestamp=1583017354488&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fhosted-git-info%2Fdownload%2Fhosted-git-info-2.8.8.tgz", + "integrity": "sha1-dTm9S8Hg4KiVgVouAmJCCxKFhIg=", + "dev": true + }, + "html-encoding-sniffer": { + "version": "2.0.1", + "resolved": "https://registry.npm.taobao.org/html-encoding-sniffer/download/html-encoding-sniffer-2.0.1.tgz", + "integrity": "sha1-QqbcT9M/ACgRduiyN1nKTk+hhfM=", + "dev": true, + "requires": { + "whatwg-encoding": "^1.0.5" + } + }, + "html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npm.taobao.org/html-escaper/download/html-escaper-2.0.2.tgz", + "integrity": "sha1-39YAJ9o2o238viNiYsAKWCJoFFM=", + "dev": true + }, + "http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npm.taobao.org/http-signature/download/http-signature-1.2.0.tgz?cache=0&sync_timestamp=1585807874533&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fhttp-signature%2Fdownload%2Fhttp-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + } + }, + "https-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npm.taobao.org/https-browserify/download/https-browserify-1.0.0.tgz", + "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=", + "dev": true + }, + "human-signals": { + "version": "1.1.1", + "resolved": "https://registry.npm.taobao.org/human-signals/download/human-signals-1.1.1.tgz", + "integrity": "sha1-xbHNFPUK6uCatsWf5jujOV/k36M=", + "dev": true + }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npm.taobao.org/iconv-lite/download/iconv-lite-0.4.24.tgz?cache=0&sync_timestamp=1579333981154&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ficonv-lite%2Fdownload%2Ficonv-lite-0.4.24.tgz", + "integrity": "sha1-ICK0sl+93CHS9SSXSkdKr+czkIs=", + "dev": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "ieee754": { + "version": "1.1.13", + "resolved": "https://registry.npm.taobao.org/ieee754/download/ieee754-1.1.13.tgz", + "integrity": "sha1-7BaFWOlaoYH9h9N/VcMrvLZwi4Q=", + "dev": true + }, + "iferr": { + "version": "0.1.5", + "resolved": "https://registry.npm.taobao.org/iferr/download/iferr-0.1.5.tgz", + "integrity": "sha1-xg7taebY/bazEEofy8ocGS3FtQE=", + "dev": true + }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npm.taobao.org/ignore/download/ignore-4.0.6.tgz?cache=0&sync_timestamp=1590809289115&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fignore%2Fdownload%2Fignore-4.0.6.tgz", + "integrity": "sha1-dQ49tYYgh7RzfrrIIH/9HvJ7Jfw=", + "dev": true + }, + "import-fresh": { + "version": "3.2.1", + "resolved": "https://registry.npm.taobao.org/import-fresh/download/import-fresh-3.2.1.tgz", + "integrity": "sha1-Yz/2GFBueTr1rJG/SLcmd+FcvmY=", + "dev": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "dependencies": { + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/resolve-from/download/resolve-from-4.0.0.tgz", + "integrity": "sha1-SrzYUq0y3Xuqv+m0DgCjbbXzkuY=", + "dev": true + } + } + }, + "import-local": { + "version": "3.0.2", + "resolved": "https://registry.npm.taobao.org/import-local/download/import-local-3.0.2.tgz", + "integrity": "sha1-qM/QQx0d5KIZlwPQA+PmI2T6bbY=", + "dev": true, + "requires": { + "pkg-dir": "^4.2.0", + "resolve-cwd": "^3.0.0" + } + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npm.taobao.org/imurmurhash/download/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, + "infer-owner": { + "version": "1.0.4", + "resolved": "https://registry.npm.taobao.org/infer-owner/download/infer-owner-1.0.4.tgz", + "integrity": "sha1-xM78qo5RBRwqQLos6KPScpWvlGc=", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npm.taobao.org/inflight/download/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npm.taobao.org/inherits/download/inherits-2.0.4.tgz?cache=0&sync_timestamp=1560975547815&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Finherits%2Fdownload%2Finherits-2.0.4.tgz", + "integrity": "sha1-D6LGT5MpF8NDOg3tVTY6rjdBa3w=", + "dev": true + }, + "inquirer": { + "version": "7.1.0", + "resolved": "https://registry.npm.taobao.org/inquirer/download/inquirer-7.1.0.tgz", + "integrity": "sha1-EpigGFmIPhfHJkuChwrhA0+S3Sk=", + "dev": true, + "requires": { + "ansi-escapes": "^4.2.1", + "chalk": "^3.0.0", + "cli-cursor": "^3.1.0", + "cli-width": "^2.0.0", + "external-editor": "^3.0.3", + "figures": "^3.0.0", + "lodash": "^4.17.15", + "mute-stream": "0.0.8", + "run-async": "^2.4.0", + "rxjs": "^6.5.3", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0", + "through": "^2.3.6" + }, + "dependencies": { + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npm.taobao.org/ansi-styles/download/ansi-styles-4.2.1.tgz", + "integrity": "sha1-kK51xCTQCNJiTFvynq0xd+v881k=", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "3.0.0", + "resolved": "https://registry.npm.taobao.org/chalk/download/chalk-3.0.0.tgz", + "integrity": "sha1-P3PCv1JlkfV0zEksUeJFY0n4ROQ=", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npm.taobao.org/color-convert/download/color-convert-2.0.1.tgz", + "integrity": "sha1-ctOmjVmMm9s68q0ehPIdiWq9TeM=", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npm.taobao.org/color-name/download/color-name-1.1.4.tgz", + "integrity": "sha1-wqCah6y95pVD3m9j+jmVyCbFNqI=", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/has-flag/download/has-flag-4.0.0.tgz", + "integrity": "sha1-lEdx/ZyByBJlxNaUGGDaBrtZR5s=", + "dev": true + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npm.taobao.org/supports-color/download/supports-color-7.1.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsupports-color%2Fdownload%2Fsupports-color-7.1.0.tgz", + "integrity": "sha1-aOMlkd9z4lrRxLSRCKLsUHliv9E=", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "invariant": { + "version": "2.2.4", + "resolved": "https://registry.npm.taobao.org/invariant/download/invariant-2.2.4.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Finvariant%2Fdownload%2Finvariant-2.2.4.tgz", + "integrity": "sha1-YQ88ksk1nOHbYW5TgAjSP/NRWOY=", + "dev": true, + "requires": { + "loose-envify": "^1.0.0" + } + }, + "ip-regex": { + "version": "2.1.0", + "resolved": "https://registry.npm.taobao.org/ip-regex/download/ip-regex-2.1.0.tgz", + "integrity": "sha1-+ni/XS5pE8kRzp+BnuUUa7bYROk=", + "dev": true + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npm.taobao.org/is-accessor-descriptor/download/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npm.taobao.org/kind-of/download/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npm.taobao.org/is-arrayish/download/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "is-binary-path": { + "version": "1.0.1", + "resolved": "https://registry.npm.taobao.org/is-binary-path/download/is-binary-path-1.0.1.tgz", + "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", + "dev": true, + "optional": true, + "requires": { + "binary-extensions": "^1.0.0" + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npm.taobao.org/is-buffer/download/is-buffer-1.1.6.tgz?cache=0&sync_timestamp=1588707106955&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fis-buffer%2Fdownload%2Fis-buffer-1.1.6.tgz", + "integrity": "sha1-76ouqdqg16suoTqXsritUf776L4=", + "dev": true + }, + "is-ci": { + "version": "2.0.0", + "resolved": "https://registry.npm.taobao.org/is-ci/download/is-ci-2.0.0.tgz", + "integrity": "sha1-a8YzQYGBDgS1wis9WJ/cpVAmQEw=", + "dev": true, + "requires": { + "ci-info": "^2.0.0" + } + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npm.taobao.org/is-data-descriptor/download/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npm.taobao.org/kind-of/download/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npm.taobao.org/is-descriptor/download/is-descriptor-0.1.6.tgz", + "integrity": "sha1-Nm2CQN3kh8pRgjsaufB6EKeCUco=", + "dev": true, + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "dependencies": { + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npm.taobao.org/kind-of/download/kind-of-5.1.0.tgz", + "integrity": "sha1-cpyR4thXt6QZofmqZWhcTDP1hF0=", + "dev": true + } + } + }, + "is-docker": { + "version": "2.0.0", + "resolved": "https://registry.npm.taobao.org/is-docker/download/is-docker-2.0.0.tgz", + "integrity": "sha1-LLDfDnXi0GT+GGTDfN6st7Lc8ls=", + "dev": true, + "optional": true + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npm.taobao.org/is-extendable/download/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npm.taobao.org/is-extglob/download/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npm.taobao.org/is-fullwidth-code-point/download/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha1-8Rb4Bk/pCz94RKOJl8C3UFEmnx0=", + "dev": true + }, + "is-generator-fn": { + "version": "2.1.0", + "resolved": "https://registry.npm.taobao.org/is-generator-fn/download/is-generator-fn-2.1.0.tgz", + "integrity": "sha1-fRQK3DiarzARqPKipM+m+q3/sRg=", + "dev": true + }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npm.taobao.org/is-glob/download/is-glob-4.0.1.tgz", + "integrity": "sha1-dWfb6fL14kZ7x3q4PEopSCQHpdw=", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-module": { + "version": "1.0.0", + "resolved": "https://registry.npm.taobao.org/is-module/download/is-module-1.0.0.tgz", + "integrity": "sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE=", + "dev": true + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npm.taobao.org/is-number/download/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npm.taobao.org/kind-of/download/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npm.taobao.org/is-plain-object/download/is-plain-object-2.0.4.tgz", + "integrity": "sha1-LBY7P6+xtgbZ0Xko8FwqHDjgdnc=", + "dev": true, + "requires": { + "isobject": "^3.0.1" + } + }, + "is-potential-custom-element-name": { + "version": "1.0.0", + "resolved": "https://registry.npm.taobao.org/is-potential-custom-element-name/download/is-potential-custom-element-name-1.0.0.tgz", + "integrity": "sha1-DFLlS8yjkbssSUsh6GJtczbG45c=", + "dev": true + }, + "is-reference": { + "version": "1.2.0", + "resolved": "https://registry.npm.taobao.org/is-reference/download/is-reference-1.2.0.tgz", + "integrity": "sha1-2Tiwz4Wg3wmElBeydPAvtQkpNZk=", + "dev": true, + "requires": { + "@types/estree": "0.0.44" + }, + "dependencies": { + "@types/estree": { + "version": "0.0.44", + "resolved": "https://registry.npm.taobao.org/@types/estree/download/@types/estree-0.0.44.tgz?cache=0&sync_timestamp=1588200104768&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40types%2Festree%2Fdownload%2F%40types%2Festree-0.0.44.tgz", + "integrity": "sha1-mAzFopo+876m/x99AhBH1+pXXiE=", + "dev": true + } + } + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npm.taobao.org/is-stream/download/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "dev": true + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npm.taobao.org/is-typedarray/download/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true + }, + "is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npm.taobao.org/is-windows/download/is-windows-1.0.2.tgz", + "integrity": "sha1-0YUOuXkezRjmGCzhKjDzlmNLsZ0=", + "dev": true + }, + "is-wsl": { + "version": "2.2.0", + "resolved": "https://registry.npm.taobao.org/is-wsl/download/is-wsl-2.2.0.tgz", + "integrity": "sha1-dKTHbnfKn9P5MvKQwX6jJs0VcnE=", + "dev": true, + "optional": true, + "requires": { + "is-docker": "^2.0.0" + } + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npm.taobao.org/isarray/download/isarray-1.0.0.tgz?cache=0&sync_timestamp=1562592096220&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fisarray%2Fdownload%2Fisarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npm.taobao.org/isexe/download/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npm.taobao.org/isobject/download/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npm.taobao.org/isstream/download/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", + "dev": true + }, + "istanbul-lib-coverage": { + "version": "3.0.0", + "resolved": "https://registry.npm.taobao.org/istanbul-lib-coverage/download/istanbul-lib-coverage-3.0.0.tgz", + "integrity": "sha1-9ZRKN8cLVQsCp4pcOyBVsoDOyOw=", + "dev": true + }, + "istanbul-lib-instrument": { + "version": "4.0.3", + "resolved": "https://registry.npm.taobao.org/istanbul-lib-instrument/download/istanbul-lib-instrument-4.0.3.tgz", + "integrity": "sha1-hzxv/4l0UBGCIndGlqPyiQLXfB0=", + "dev": true, + "requires": { + "@babel/core": "^7.7.5", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.0.0", + "semver": "^6.3.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npm.taobao.org/semver/download/semver-6.3.0.tgz", + "integrity": "sha1-7gpkyK9ejO6mdoexM3YeG+y9HT0=", + "dev": true + } + } + }, + "istanbul-lib-report": { + "version": "3.0.0", + "resolved": "https://registry.npm.taobao.org/istanbul-lib-report/download/istanbul-lib-report-3.0.0.tgz?cache=0&sync_timestamp=1577062405578&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fistanbul-lib-report%2Fdownload%2Fistanbul-lib-report-3.0.0.tgz", + "integrity": "sha1-dRj+UupE3jcvRgp2tezan/tz2KY=", + "dev": true, + "requires": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^3.0.0", + "supports-color": "^7.1.0" + }, + "dependencies": { + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/has-flag/download/has-flag-4.0.0.tgz", + "integrity": "sha1-lEdx/ZyByBJlxNaUGGDaBrtZR5s=", + "dev": true + }, + "make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npm.taobao.org/make-dir/download/make-dir-3.1.0.tgz?cache=0&sync_timestamp=1587567576732&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmake-dir%2Fdownload%2Fmake-dir-3.1.0.tgz", + "integrity": "sha1-QV6WcEazp/HRhSd9hKpYIDcmoT8=", + "dev": true, + "requires": { + "semver": "^6.0.0" + } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npm.taobao.org/semver/download/semver-6.3.0.tgz", + "integrity": "sha1-7gpkyK9ejO6mdoexM3YeG+y9HT0=", + "dev": true + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npm.taobao.org/supports-color/download/supports-color-7.1.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsupports-color%2Fdownload%2Fsupports-color-7.1.0.tgz", + "integrity": "sha1-aOMlkd9z4lrRxLSRCKLsUHliv9E=", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "istanbul-lib-source-maps": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/istanbul-lib-source-maps/download/istanbul-lib-source-maps-4.0.0.tgz?cache=0&sync_timestamp=1577062405633&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fistanbul-lib-source-maps%2Fdownload%2Fistanbul-lib-source-maps-4.0.0.tgz", + "integrity": "sha1-dXQ85tlruG3H7kNSz2Nmoj8LGtk=", + "dev": true, + "requires": { + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0", + "source-map": "^0.6.1" + }, + "dependencies": { + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npm.taobao.org/debug/download/debug-4.1.1.tgz?cache=0&sync_timestamp=1589881689076&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdebug%2Fdownload%2Fdebug-4.1.1.tgz", + "integrity": "sha1-O3ImAlUQnGtYnO4FDx1RYTlmR5E=", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npm.taobao.org/ms/download/ms-2.1.2.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fms%2Fdownload%2Fms-2.1.2.tgz", + "integrity": "sha1-0J0fNXtEP0kzgqjrPM0YOHKuYAk=", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npm.taobao.org/source-map/download/source-map-0.6.1.tgz", + "integrity": "sha1-dHIq8y6WFOnCh6jQu95IteLxomM=", + "dev": true + } + } + }, + "istanbul-reports": { + "version": "3.0.2", + "resolved": "https://registry.npm.taobao.org/istanbul-reports/download/istanbul-reports-3.0.2.tgz", + "integrity": "sha1-1ZMhDlAAaDdQywn8BkTktuJ/1Ts=", + "dev": true, + "requires": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + } + }, + "jest": { + "version": "26.0.1", + "resolved": "https://registry.npm.taobao.org/jest/download/jest-26.0.1.tgz", + "integrity": "sha1-XFGi5Y3/dSW2XxaXIXZxc7+DJpQ=", + "dev": true, + "requires": { + "@jest/core": "^26.0.1", + "import-local": "^3.0.2", + "jest-cli": "^26.0.1" + }, + "dependencies": { + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npm.taobao.org/ansi-styles/download/ansi-styles-4.2.1.tgz", + "integrity": "sha1-kK51xCTQCNJiTFvynq0xd+v881k=", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/chalk/download/chalk-4.0.0.tgz", + "integrity": "sha1-bpgIHtLRf6q2FetSrGbsH+YgnnI=", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npm.taobao.org/color-convert/download/color-convert-2.0.1.tgz", + "integrity": "sha1-ctOmjVmMm9s68q0ehPIdiWq9TeM=", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npm.taobao.org/color-name/download/color-name-1.1.4.tgz", + "integrity": "sha1-wqCah6y95pVD3m9j+jmVyCbFNqI=", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/has-flag/download/has-flag-4.0.0.tgz", + "integrity": "sha1-lEdx/ZyByBJlxNaUGGDaBrtZR5s=", + "dev": true + }, + "jest-cli": { + "version": "26.0.1", + "resolved": "https://registry.npm.taobao.org/jest-cli/download/jest-cli-26.0.1.tgz", + "integrity": "sha1-OkI5mky8lqUZuZrQaaEX2VVXDKw=", + "dev": true, + "requires": { + "@jest/core": "^26.0.1", + "@jest/test-result": "^26.0.1", + "@jest/types": "^26.0.1", + "chalk": "^4.0.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.4", + "import-local": "^3.0.2", + "is-ci": "^2.0.0", + "jest-config": "^26.0.1", + "jest-util": "^26.0.1", + "jest-validate": "^26.0.1", + "prompts": "^2.0.1", + "yargs": "^15.3.1" + } + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npm.taobao.org/supports-color/download/supports-color-7.1.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsupports-color%2Fdownload%2Fsupports-color-7.1.0.tgz", + "integrity": "sha1-aOMlkd9z4lrRxLSRCKLsUHliv9E=", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "jest-changed-files": { + "version": "26.0.1", + "resolved": "https://registry.npm.taobao.org/jest-changed-files/download/jest-changed-files-26.0.1.tgz", + "integrity": "sha1-EzRjDGoa11eEEg85w6qSeOWfNJ8=", + "dev": true, + "requires": { + "@jest/types": "^26.0.1", + "execa": "^4.0.0", + "throat": "^5.0.0" + }, + "dependencies": { + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npm.taobao.org/cross-spawn/download/cross-spawn-7.0.3.tgz?cache=0&sync_timestamp=1590420971248&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fcross-spawn%2Fdownload%2Fcross-spawn-7.0.3.tgz", + "integrity": "sha1-9zqFudXUHQRVUcF34ogtSshXKKY=", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "execa": { + "version": "4.0.2", + "resolved": "https://registry.npm.taobao.org/execa/download/execa-4.0.2.tgz?cache=0&sync_timestamp=1590156636749&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fexeca%2Fdownload%2Fexeca-4.0.2.tgz", + "integrity": "sha1-rYf7ey2dVk9w0rYtURvuQdXLskA=", + "dev": true, + "requires": { + "cross-spawn": "^7.0.0", + "get-stream": "^5.0.0", + "human-signals": "^1.1.1", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.0", + "onetime": "^5.1.0", + "signal-exit": "^3.0.2", + "strip-final-newline": "^2.0.0" + } + }, + "get-stream": { + "version": "5.1.0", + "resolved": "https://registry.npm.taobao.org/get-stream/download/get-stream-5.1.0.tgz", + "integrity": "sha1-ASA83JJZf5uQkGfD5lbMH008Tck=", + "dev": true, + "requires": { + "pump": "^3.0.0" + } + }, + "is-stream": { + "version": "2.0.0", + "resolved": "https://registry.npm.taobao.org/is-stream/download/is-stream-2.0.0.tgz", + "integrity": "sha1-venDJoDW+uBBKdasnZIc54FfeOM=", + "dev": true + }, + "npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npm.taobao.org/npm-run-path/download/npm-run-path-4.0.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fnpm-run-path%2Fdownload%2Fnpm-run-path-4.0.1.tgz", + "integrity": "sha1-t+zR5e1T2o43pV4cImnguX7XSOo=", + "dev": true, + "requires": { + "path-key": "^3.0.0" + } + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npm.taobao.org/path-key/download/path-key-3.1.1.tgz?cache=0&sync_timestamp=1574441322626&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fpath-key%2Fdownload%2Fpath-key-3.1.1.tgz", + "integrity": "sha1-WB9q3mWMu6ZaDTOA3ndTKVBU83U=", + "dev": true + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npm.taobao.org/shebang-command/download/shebang-command-2.0.0.tgz", + "integrity": "sha1-zNCvT4g1+9wmW4JGGq8MNmY/NOo=", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npm.taobao.org/shebang-regex/download/shebang-regex-3.0.0.tgz", + "integrity": "sha1-rhbxZE2HPsrYQ7AwexQzYtTEIXI=", + "dev": true + } + } + }, + "jest-config": { + "version": "26.0.1", + "resolved": "https://registry.npm.taobao.org/jest-config/download/jest-config-26.0.1.tgz", + "integrity": "sha1-CWo9QVCvrfcZ0fqwDppvstbWdQc=", + "dev": true, + "requires": { + "@babel/core": "^7.1.0", + "@jest/test-sequencer": "^26.0.1", + "@jest/types": "^26.0.1", + "babel-jest": "^26.0.1", + "chalk": "^4.0.0", + "deepmerge": "^4.2.2", + "glob": "^7.1.1", + "graceful-fs": "^4.2.4", + "jest-environment-jsdom": "^26.0.1", + "jest-environment-node": "^26.0.1", + "jest-get-type": "^26.0.0", + "jest-jasmine2": "^26.0.1", + "jest-regex-util": "^26.0.0", + "jest-resolve": "^26.0.1", + "jest-util": "^26.0.1", + "jest-validate": "^26.0.1", + "micromatch": "^4.0.2", + "pretty-format": "^26.0.1" + }, + "dependencies": { + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npm.taobao.org/ansi-styles/download/ansi-styles-4.2.1.tgz", + "integrity": "sha1-kK51xCTQCNJiTFvynq0xd+v881k=", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npm.taobao.org/braces/download/braces-3.0.2.tgz", + "integrity": "sha1-NFThpGLujVmeI23zNs2epPiv4Qc=", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, + "chalk": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/chalk/download/chalk-4.0.0.tgz", + "integrity": "sha1-bpgIHtLRf6q2FetSrGbsH+YgnnI=", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npm.taobao.org/color-convert/download/color-convert-2.0.1.tgz", + "integrity": "sha1-ctOmjVmMm9s68q0ehPIdiWq9TeM=", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npm.taobao.org/color-name/download/color-name-1.1.4.tgz", + "integrity": "sha1-wqCah6y95pVD3m9j+jmVyCbFNqI=", + "dev": true + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npm.taobao.org/fill-range/download/fill-range-7.0.1.tgz", + "integrity": "sha1-GRmmp8df44ssfHflGYU12prN2kA=", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/has-flag/download/has-flag-4.0.0.tgz", + "integrity": "sha1-lEdx/ZyByBJlxNaUGGDaBrtZR5s=", + "dev": true + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npm.taobao.org/is-number/download/is-number-7.0.0.tgz", + "integrity": "sha1-dTU0W4lnNNX4DE0GxQlVUnoU8Ss=", + "dev": true + }, + "micromatch": { + "version": "4.0.2", + "resolved": "https://registry.npm.taobao.org/micromatch/download/micromatch-4.0.2.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmicromatch%2Fdownload%2Fmicromatch-4.0.2.tgz", + "integrity": "sha1-T8sJmb+fvC/L3SEvbWKbmlbDklk=", + "dev": true, + "requires": { + "braces": "^3.0.1", + "picomatch": "^2.0.5" + } + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npm.taobao.org/supports-color/download/supports-color-7.1.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsupports-color%2Fdownload%2Fsupports-color-7.1.0.tgz", + "integrity": "sha1-aOMlkd9z4lrRxLSRCKLsUHliv9E=", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npm.taobao.org/to-regex-range/download/to-regex-range-5.0.1.tgz", + "integrity": "sha1-FkjESq58jZiKMmAY7XL1tN0DkuQ=", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + } + } + }, + "jest-diff": { + "version": "26.0.1", + "resolved": "https://registry.npm.taobao.org/jest-diff/download/jest-diff-26.0.1.tgz", + "integrity": "sha1-xEqzzdWXfUZt5pxGkp4OV/iaod4=", + "dev": true, + "requires": { + "chalk": "^4.0.0", + "diff-sequences": "^26.0.0", + "jest-get-type": "^26.0.0", + "pretty-format": "^26.0.1" + }, + "dependencies": { + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npm.taobao.org/ansi-styles/download/ansi-styles-4.2.1.tgz", + "integrity": "sha1-kK51xCTQCNJiTFvynq0xd+v881k=", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/chalk/download/chalk-4.0.0.tgz", + "integrity": "sha1-bpgIHtLRf6q2FetSrGbsH+YgnnI=", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npm.taobao.org/color-convert/download/color-convert-2.0.1.tgz", + "integrity": "sha1-ctOmjVmMm9s68q0ehPIdiWq9TeM=", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npm.taobao.org/color-name/download/color-name-1.1.4.tgz", + "integrity": "sha1-wqCah6y95pVD3m9j+jmVyCbFNqI=", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/has-flag/download/has-flag-4.0.0.tgz", + "integrity": "sha1-lEdx/ZyByBJlxNaUGGDaBrtZR5s=", + "dev": true + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npm.taobao.org/supports-color/download/supports-color-7.1.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsupports-color%2Fdownload%2Fsupports-color-7.1.0.tgz", + "integrity": "sha1-aOMlkd9z4lrRxLSRCKLsUHliv9E=", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "jest-docblock": { + "version": "26.0.0", + "resolved": "https://registry.npm.taobao.org/jest-docblock/download/jest-docblock-26.0.0.tgz?cache=0&sync_timestamp=1588614998936&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjest-docblock%2Fdownload%2Fjest-docblock-26.0.0.tgz", + "integrity": "sha1-Pi+iCJn8koyxO9D/aL03EaNoibU=", + "dev": true, + "requires": { + "detect-newline": "^3.0.0" + } + }, + "jest-each": { + "version": "26.0.1", + "resolved": "https://registry.npm.taobao.org/jest-each/download/jest-each-26.0.1.tgz", + "integrity": "sha1-YzCDBhYZMC/JDdj1g1D5131nvgQ=", + "dev": true, + "requires": { + "@jest/types": "^26.0.1", + "chalk": "^4.0.0", + "jest-get-type": "^26.0.0", + "jest-util": "^26.0.1", + "pretty-format": "^26.0.1" + }, + "dependencies": { + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npm.taobao.org/ansi-styles/download/ansi-styles-4.2.1.tgz", + "integrity": "sha1-kK51xCTQCNJiTFvynq0xd+v881k=", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/chalk/download/chalk-4.0.0.tgz", + "integrity": "sha1-bpgIHtLRf6q2FetSrGbsH+YgnnI=", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npm.taobao.org/color-convert/download/color-convert-2.0.1.tgz", + "integrity": "sha1-ctOmjVmMm9s68q0ehPIdiWq9TeM=", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npm.taobao.org/color-name/download/color-name-1.1.4.tgz", + "integrity": "sha1-wqCah6y95pVD3m9j+jmVyCbFNqI=", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/has-flag/download/has-flag-4.0.0.tgz", + "integrity": "sha1-lEdx/ZyByBJlxNaUGGDaBrtZR5s=", + "dev": true + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npm.taobao.org/supports-color/download/supports-color-7.1.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsupports-color%2Fdownload%2Fsupports-color-7.1.0.tgz", + "integrity": "sha1-aOMlkd9z4lrRxLSRCKLsUHliv9E=", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "jest-environment-jsdom": { + "version": "26.0.1", + "resolved": "https://registry.npm.taobao.org/jest-environment-jsdom/download/jest-environment-jsdom-26.0.1.tgz", + "integrity": "sha1-IXaQhS5b3XyEak47UMj/1EHf0kk=", + "dev": true, + "requires": { + "@jest/environment": "^26.0.1", + "@jest/fake-timers": "^26.0.1", + "@jest/types": "^26.0.1", + "jest-mock": "^26.0.1", + "jest-util": "^26.0.1", + "jsdom": "^16.2.2" + } + }, + "jest-environment-node": { + "version": "26.0.1", + "resolved": "https://registry.npm.taobao.org/jest-environment-node/download/jest-environment-node-26.0.1.tgz", + "integrity": "sha1-WEqf9iMST/butJ4BMbX3YSsxCxM=", + "dev": true, + "requires": { + "@jest/environment": "^26.0.1", + "@jest/fake-timers": "^26.0.1", + "@jest/types": "^26.0.1", + "jest-mock": "^26.0.1", + "jest-util": "^26.0.1" + } + }, + "jest-get-type": { + "version": "26.0.0", + "resolved": "https://registry.npm.taobao.org/jest-get-type/download/jest-get-type-26.0.0.tgz?cache=0&sync_timestamp=1588615294899&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjest-get-type%2Fdownload%2Fjest-get-type-26.0.0.tgz", + "integrity": "sha1-OB6YanGJmNv6/NXsBZNL5TjbQDk=", + "dev": true + }, + "jest-haste-map": { + "version": "26.0.1", + "resolved": "https://registry.npm.taobao.org/jest-haste-map/download/jest-haste-map-26.0.1.tgz", + "integrity": "sha1-QNzAPEOslNJbhhgHWATQnNXUnec=", + "dev": true, + "requires": { + "@jest/types": "^26.0.1", + "@types/graceful-fs": "^4.1.2", + "anymatch": "^3.0.3", + "fb-watchman": "^2.0.0", + "fsevents": "^2.1.2", + "graceful-fs": "^4.2.4", + "jest-serializer": "^26.0.0", + "jest-util": "^26.0.1", + "jest-worker": "^26.0.0", + "micromatch": "^4.0.2", + "sane": "^4.0.3", + "walker": "^1.0.7", + "which": "^2.0.2" + }, + "dependencies": { + "anymatch": { + "version": "3.1.1", + "resolved": "https://registry.npm.taobao.org/anymatch/download/anymatch-3.1.1.tgz", + "integrity": "sha1-xV7PAhheJGklk5kxDBc84xIzsUI=", + "dev": true, + "requires": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + } + }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npm.taobao.org/braces/download/braces-3.0.2.tgz", + "integrity": "sha1-NFThpGLujVmeI23zNs2epPiv4Qc=", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npm.taobao.org/fill-range/download/fill-range-7.0.1.tgz", + "integrity": "sha1-GRmmp8df44ssfHflGYU12prN2kA=", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "fsevents": { + "version": "2.1.3", + "resolved": "https://registry.npm.taobao.org/fsevents/download/fsevents-2.1.3.tgz", + "integrity": "sha1-+3OHA66NL5/pAMM4Nt3r7ouX8j4=", + "dev": true, + "optional": true + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npm.taobao.org/is-number/download/is-number-7.0.0.tgz", + "integrity": "sha1-dTU0W4lnNNX4DE0GxQlVUnoU8Ss=", + "dev": true + }, + "micromatch": { + "version": "4.0.2", + "resolved": "https://registry.npm.taobao.org/micromatch/download/micromatch-4.0.2.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmicromatch%2Fdownload%2Fmicromatch-4.0.2.tgz", + "integrity": "sha1-T8sJmb+fvC/L3SEvbWKbmlbDklk=", + "dev": true, + "requires": { + "braces": "^3.0.1", + "picomatch": "^2.0.5" + } + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npm.taobao.org/to-regex-range/download/to-regex-range-5.0.1.tgz", + "integrity": "sha1-FkjESq58jZiKMmAY7XL1tN0DkuQ=", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + } + } + }, + "jest-jasmine2": { + "version": "26.0.1", + "resolved": "https://registry.npm.taobao.org/jest-jasmine2/download/jest-jasmine2-26.0.1.tgz", + "integrity": "sha1-lHxA7oFmNrojESrzIG1vp7I8HBw=", + "dev": true, + "requires": { + "@babel/traverse": "^7.1.0", + "@jest/environment": "^26.0.1", + "@jest/source-map": "^26.0.0", + "@jest/test-result": "^26.0.1", + "@jest/types": "^26.0.1", + "chalk": "^4.0.0", + "co": "^4.6.0", + "expect": "^26.0.1", + "is-generator-fn": "^2.0.0", + "jest-each": "^26.0.1", + "jest-matcher-utils": "^26.0.1", + "jest-message-util": "^26.0.1", + "jest-runtime": "^26.0.1", + "jest-snapshot": "^26.0.1", + "jest-util": "^26.0.1", + "pretty-format": "^26.0.1", + "throat": "^5.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npm.taobao.org/ansi-styles/download/ansi-styles-4.2.1.tgz", + "integrity": "sha1-kK51xCTQCNJiTFvynq0xd+v881k=", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/chalk/download/chalk-4.0.0.tgz", + "integrity": "sha1-bpgIHtLRf6q2FetSrGbsH+YgnnI=", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npm.taobao.org/color-convert/download/color-convert-2.0.1.tgz", + "integrity": "sha1-ctOmjVmMm9s68q0ehPIdiWq9TeM=", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npm.taobao.org/color-name/download/color-name-1.1.4.tgz", + "integrity": "sha1-wqCah6y95pVD3m9j+jmVyCbFNqI=", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/has-flag/download/has-flag-4.0.0.tgz", + "integrity": "sha1-lEdx/ZyByBJlxNaUGGDaBrtZR5s=", + "dev": true + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npm.taobao.org/supports-color/download/supports-color-7.1.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsupports-color%2Fdownload%2Fsupports-color-7.1.0.tgz", + "integrity": "sha1-aOMlkd9z4lrRxLSRCKLsUHliv9E=", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "jest-leak-detector": { + "version": "26.0.1", + "resolved": "https://registry.npm.taobao.org/jest-leak-detector/download/jest-leak-detector-26.0.1.tgz", + "integrity": "sha1-ebGas/QRcOCnjrj6dUoRbTRH+4w=", + "dev": true, + "requires": { + "jest-get-type": "^26.0.0", + "pretty-format": "^26.0.1" + } + }, + "jest-matcher-utils": { + "version": "26.0.1", + "resolved": "https://registry.npm.taobao.org/jest-matcher-utils/download/jest-matcher-utils-26.0.1.tgz", + "integrity": "sha1-EuH8OG/k8UZ49MyNvVunWlgJKRE=", + "dev": true, + "requires": { + "chalk": "^4.0.0", + "jest-diff": "^26.0.1", + "jest-get-type": "^26.0.0", + "pretty-format": "^26.0.1" + }, + "dependencies": { + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npm.taobao.org/ansi-styles/download/ansi-styles-4.2.1.tgz", + "integrity": "sha1-kK51xCTQCNJiTFvynq0xd+v881k=", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/chalk/download/chalk-4.0.0.tgz", + "integrity": "sha1-bpgIHtLRf6q2FetSrGbsH+YgnnI=", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npm.taobao.org/color-convert/download/color-convert-2.0.1.tgz", + "integrity": "sha1-ctOmjVmMm9s68q0ehPIdiWq9TeM=", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npm.taobao.org/color-name/download/color-name-1.1.4.tgz", + "integrity": "sha1-wqCah6y95pVD3m9j+jmVyCbFNqI=", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/has-flag/download/has-flag-4.0.0.tgz", + "integrity": "sha1-lEdx/ZyByBJlxNaUGGDaBrtZR5s=", + "dev": true + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npm.taobao.org/supports-color/download/supports-color-7.1.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsupports-color%2Fdownload%2Fsupports-color-7.1.0.tgz", + "integrity": "sha1-aOMlkd9z4lrRxLSRCKLsUHliv9E=", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "jest-message-util": { + "version": "26.0.1", + "resolved": "https://registry.npm.taobao.org/jest-message-util/download/jest-message-util-26.0.1.tgz?cache=0&sync_timestamp=1588675383416&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjest-message-util%2Fdownload%2Fjest-message-util-26.0.1.tgz", + "integrity": "sha1-B68bQvxFC0zI6Q5MnO8RszzpsKw=", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "@jest/types": "^26.0.1", + "@types/stack-utils": "^1.0.1", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.4", + "micromatch": "^4.0.2", + "slash": "^3.0.0", + "stack-utils": "^2.0.2" + }, + "dependencies": { + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npm.taobao.org/ansi-styles/download/ansi-styles-4.2.1.tgz", + "integrity": "sha1-kK51xCTQCNJiTFvynq0xd+v881k=", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npm.taobao.org/braces/download/braces-3.0.2.tgz", + "integrity": "sha1-NFThpGLujVmeI23zNs2epPiv4Qc=", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, + "chalk": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/chalk/download/chalk-4.0.0.tgz", + "integrity": "sha1-bpgIHtLRf6q2FetSrGbsH+YgnnI=", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npm.taobao.org/color-convert/download/color-convert-2.0.1.tgz", + "integrity": "sha1-ctOmjVmMm9s68q0ehPIdiWq9TeM=", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npm.taobao.org/color-name/download/color-name-1.1.4.tgz", + "integrity": "sha1-wqCah6y95pVD3m9j+jmVyCbFNqI=", + "dev": true + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npm.taobao.org/fill-range/download/fill-range-7.0.1.tgz", + "integrity": "sha1-GRmmp8df44ssfHflGYU12prN2kA=", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/has-flag/download/has-flag-4.0.0.tgz", + "integrity": "sha1-lEdx/ZyByBJlxNaUGGDaBrtZR5s=", + "dev": true + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npm.taobao.org/is-number/download/is-number-7.0.0.tgz", + "integrity": "sha1-dTU0W4lnNNX4DE0GxQlVUnoU8Ss=", + "dev": true + }, + "micromatch": { + "version": "4.0.2", + "resolved": "https://registry.npm.taobao.org/micromatch/download/micromatch-4.0.2.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmicromatch%2Fdownload%2Fmicromatch-4.0.2.tgz", + "integrity": "sha1-T8sJmb+fvC/L3SEvbWKbmlbDklk=", + "dev": true, + "requires": { + "braces": "^3.0.1", + "picomatch": "^2.0.5" + } + }, + "slash": { + "version": "3.0.0", + "resolved": "https://registry.npm.taobao.org/slash/download/slash-3.0.0.tgz", + "integrity": "sha1-ZTm+hwwWWtvVJAIg2+Nh8bxNRjQ=", + "dev": true + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npm.taobao.org/supports-color/download/supports-color-7.1.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsupports-color%2Fdownload%2Fsupports-color-7.1.0.tgz", + "integrity": "sha1-aOMlkd9z4lrRxLSRCKLsUHliv9E=", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npm.taobao.org/to-regex-range/download/to-regex-range-5.0.1.tgz", + "integrity": "sha1-FkjESq58jZiKMmAY7XL1tN0DkuQ=", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + } + } + }, + "jest-mock": { + "version": "26.0.1", + "resolved": "https://registry.npm.taobao.org/jest-mock/download/jest-mock-26.0.1.tgz?cache=0&sync_timestamp=1588702712448&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjest-mock%2Fdownload%2Fjest-mock-26.0.1.tgz", + "integrity": "sha1-f9FRftSVU5fPFiCncdwtYfrY/UA=", + "dev": true, + "requires": { + "@jest/types": "^26.0.1" + } + }, + "jest-pnp-resolver": { + "version": "1.2.1", + "resolved": "https://registry.npm.taobao.org/jest-pnp-resolver/download/jest-pnp-resolver-1.2.1.tgz", + "integrity": "sha1-7NrmBMB3p/vHDe+21RfDwciYkjo=", + "dev": true + }, + "jest-regex-util": { + "version": "26.0.0", + "resolved": "https://registry.npm.taobao.org/jest-regex-util/download/jest-regex-util-26.0.0.tgz?cache=0&sync_timestamp=1588614796820&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjest-regex-util%2Fdownload%2Fjest-regex-util-26.0.0.tgz", + "integrity": "sha1-0l5xhLNuOf1GbDvEG+CXHoIf7ig=", + "dev": true + }, + "jest-resolve": { + "version": "26.0.1", + "resolved": "https://registry.npm.taobao.org/jest-resolve/download/jest-resolve-26.0.1.tgz?cache=0&sync_timestamp=1588675359135&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjest-resolve%2Fdownload%2Fjest-resolve-26.0.1.tgz", + "integrity": "sha1-IdHuBvnqJwo0OoiTBRru2UDN5zY=", + "dev": true, + "requires": { + "@jest/types": "^26.0.1", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.4", + "jest-pnp-resolver": "^1.2.1", + "jest-util": "^26.0.1", + "read-pkg-up": "^7.0.1", + "resolve": "^1.17.0", + "slash": "^3.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npm.taobao.org/ansi-styles/download/ansi-styles-4.2.1.tgz", + "integrity": "sha1-kK51xCTQCNJiTFvynq0xd+v881k=", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/chalk/download/chalk-4.0.0.tgz", + "integrity": "sha1-bpgIHtLRf6q2FetSrGbsH+YgnnI=", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npm.taobao.org/color-convert/download/color-convert-2.0.1.tgz", + "integrity": "sha1-ctOmjVmMm9s68q0ehPIdiWq9TeM=", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npm.taobao.org/color-name/download/color-name-1.1.4.tgz", + "integrity": "sha1-wqCah6y95pVD3m9j+jmVyCbFNqI=", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/has-flag/download/has-flag-4.0.0.tgz", + "integrity": "sha1-lEdx/ZyByBJlxNaUGGDaBrtZR5s=", + "dev": true + }, + "slash": { + "version": "3.0.0", + "resolved": "https://registry.npm.taobao.org/slash/download/slash-3.0.0.tgz", + "integrity": "sha1-ZTm+hwwWWtvVJAIg2+Nh8bxNRjQ=", + "dev": true + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npm.taobao.org/supports-color/download/supports-color-7.1.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsupports-color%2Fdownload%2Fsupports-color-7.1.0.tgz", + "integrity": "sha1-aOMlkd9z4lrRxLSRCKLsUHliv9E=", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "jest-resolve-dependencies": { + "version": "26.0.1", + "resolved": "https://registry.npm.taobao.org/jest-resolve-dependencies/download/jest-resolve-dependencies-26.0.1.tgz", + "integrity": "sha1-YHunzMMhUdGFpHfP9FvzO85Bfws=", + "dev": true, + "requires": { + "@jest/types": "^26.0.1", + "jest-regex-util": "^26.0.0", + "jest-snapshot": "^26.0.1" + } + }, + "jest-runner": { + "version": "26.0.1", + "resolved": "https://registry.npm.taobao.org/jest-runner/download/jest-runner-26.0.1.tgz", + "integrity": "sha1-6gNYS3rkus+35TPWgKV1pJrjXVA=", + "dev": true, + "requires": { + "@jest/console": "^26.0.1", + "@jest/environment": "^26.0.1", + "@jest/test-result": "^26.0.1", + "@jest/types": "^26.0.1", + "chalk": "^4.0.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.4", + "jest-config": "^26.0.1", + "jest-docblock": "^26.0.0", + "jest-haste-map": "^26.0.1", + "jest-jasmine2": "^26.0.1", + "jest-leak-detector": "^26.0.1", + "jest-message-util": "^26.0.1", + "jest-resolve": "^26.0.1", + "jest-runtime": "^26.0.1", + "jest-util": "^26.0.1", + "jest-worker": "^26.0.0", + "source-map-support": "^0.5.6", + "throat": "^5.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npm.taobao.org/ansi-styles/download/ansi-styles-4.2.1.tgz", + "integrity": "sha1-kK51xCTQCNJiTFvynq0xd+v881k=", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/chalk/download/chalk-4.0.0.tgz", + "integrity": "sha1-bpgIHtLRf6q2FetSrGbsH+YgnnI=", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npm.taobao.org/color-convert/download/color-convert-2.0.1.tgz", + "integrity": "sha1-ctOmjVmMm9s68q0ehPIdiWq9TeM=", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npm.taobao.org/color-name/download/color-name-1.1.4.tgz", + "integrity": "sha1-wqCah6y95pVD3m9j+jmVyCbFNqI=", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/has-flag/download/has-flag-4.0.0.tgz", + "integrity": "sha1-lEdx/ZyByBJlxNaUGGDaBrtZR5s=", + "dev": true + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npm.taobao.org/supports-color/download/supports-color-7.1.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsupports-color%2Fdownload%2Fsupports-color-7.1.0.tgz", + "integrity": "sha1-aOMlkd9z4lrRxLSRCKLsUHliv9E=", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "jest-runtime": { + "version": "26.0.1", + "resolved": "https://registry.npm.taobao.org/jest-runtime/download/jest-runtime-26.0.1.tgz", + "integrity": "sha1-oSGmMhI1mH0pQWjigtUrNk19P4k=", + "dev": true, + "requires": { + "@jest/console": "^26.0.1", + "@jest/environment": "^26.0.1", + "@jest/fake-timers": "^26.0.1", + "@jest/globals": "^26.0.1", + "@jest/source-map": "^26.0.0", + "@jest/test-result": "^26.0.1", + "@jest/transform": "^26.0.1", + "@jest/types": "^26.0.1", + "@types/yargs": "^15.0.0", + "chalk": "^4.0.0", + "collect-v8-coverage": "^1.0.0", + "exit": "^0.1.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.4", + "jest-config": "^26.0.1", + "jest-haste-map": "^26.0.1", + "jest-message-util": "^26.0.1", + "jest-mock": "^26.0.1", + "jest-regex-util": "^26.0.0", + "jest-resolve": "^26.0.1", + "jest-snapshot": "^26.0.1", + "jest-util": "^26.0.1", + "jest-validate": "^26.0.1", + "slash": "^3.0.0", + "strip-bom": "^4.0.0", + "yargs": "^15.3.1" + }, + "dependencies": { + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npm.taobao.org/ansi-styles/download/ansi-styles-4.2.1.tgz", + "integrity": "sha1-kK51xCTQCNJiTFvynq0xd+v881k=", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/chalk/download/chalk-4.0.0.tgz", + "integrity": "sha1-bpgIHtLRf6q2FetSrGbsH+YgnnI=", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npm.taobao.org/color-convert/download/color-convert-2.0.1.tgz", + "integrity": "sha1-ctOmjVmMm9s68q0ehPIdiWq9TeM=", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npm.taobao.org/color-name/download/color-name-1.1.4.tgz", + "integrity": "sha1-wqCah6y95pVD3m9j+jmVyCbFNqI=", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/has-flag/download/has-flag-4.0.0.tgz", + "integrity": "sha1-lEdx/ZyByBJlxNaUGGDaBrtZR5s=", + "dev": true + }, + "slash": { + "version": "3.0.0", + "resolved": "https://registry.npm.taobao.org/slash/download/slash-3.0.0.tgz", + "integrity": "sha1-ZTm+hwwWWtvVJAIg2+Nh8bxNRjQ=", + "dev": true + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npm.taobao.org/supports-color/download/supports-color-7.1.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsupports-color%2Fdownload%2Fsupports-color-7.1.0.tgz", + "integrity": "sha1-aOMlkd9z4lrRxLSRCKLsUHliv9E=", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "jest-serializer": { + "version": "26.0.0", + "resolved": "https://registry.npm.taobao.org/jest-serializer/download/jest-serializer-26.0.0.tgz?cache=0&sync_timestamp=1588614796801&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjest-serializer%2Fdownload%2Fjest-serializer-26.0.0.tgz", + "integrity": "sha1-9sUh3bl2lDuT5mLA1NeSRavscqM=", + "dev": true, + "requires": { + "graceful-fs": "^4.2.4" + } + }, + "jest-snapshot": { + "version": "26.0.1", + "resolved": "https://registry.npm.taobao.org/jest-snapshot/download/jest-snapshot-26.0.1.tgz", + "integrity": "sha1-G6qUK9g9R7g3qEr3/PX9SiNto5k=", + "dev": true, + "requires": { + "@babel/types": "^7.0.0", + "@jest/types": "^26.0.1", + "@types/prettier": "^2.0.0", + "chalk": "^4.0.0", + "expect": "^26.0.1", + "graceful-fs": "^4.2.4", + "jest-diff": "^26.0.1", + "jest-get-type": "^26.0.0", + "jest-matcher-utils": "^26.0.1", + "jest-message-util": "^26.0.1", + "jest-resolve": "^26.0.1", + "make-dir": "^3.0.0", + "natural-compare": "^1.4.0", + "pretty-format": "^26.0.1", + "semver": "^7.3.2" + }, + "dependencies": { + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npm.taobao.org/ansi-styles/download/ansi-styles-4.2.1.tgz", + "integrity": "sha1-kK51xCTQCNJiTFvynq0xd+v881k=", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/chalk/download/chalk-4.0.0.tgz", + "integrity": "sha1-bpgIHtLRf6q2FetSrGbsH+YgnnI=", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npm.taobao.org/color-convert/download/color-convert-2.0.1.tgz", + "integrity": "sha1-ctOmjVmMm9s68q0ehPIdiWq9TeM=", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npm.taobao.org/color-name/download/color-name-1.1.4.tgz", + "integrity": "sha1-wqCah6y95pVD3m9j+jmVyCbFNqI=", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/has-flag/download/has-flag-4.0.0.tgz", + "integrity": "sha1-lEdx/ZyByBJlxNaUGGDaBrtZR5s=", + "dev": true + }, + "make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npm.taobao.org/make-dir/download/make-dir-3.1.0.tgz?cache=0&sync_timestamp=1587567576732&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmake-dir%2Fdownload%2Fmake-dir-3.1.0.tgz", + "integrity": "sha1-QV6WcEazp/HRhSd9hKpYIDcmoT8=", + "dev": true, + "requires": { + "semver": "^6.0.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npm.taobao.org/semver/download/semver-6.3.0.tgz", + "integrity": "sha1-7gpkyK9ejO6mdoexM3YeG+y9HT0=", + "dev": true + } + } + }, + "semver": { + "version": "7.3.2", + "resolved": "https://registry.npm.taobao.org/semver/download/semver-7.3.2.tgz", + "integrity": "sha1-YElisFK4HtB4aq6EOJ/7pw/9OTg=", + "dev": true + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npm.taobao.org/supports-color/download/supports-color-7.1.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsupports-color%2Fdownload%2Fsupports-color-7.1.0.tgz", + "integrity": "sha1-aOMlkd9z4lrRxLSRCKLsUHliv9E=", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "jest-util": { + "version": "26.0.1", + "resolved": "https://registry.npm.taobao.org/jest-util/download/jest-util-26.0.1.tgz?cache=0&sync_timestamp=1588675386111&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjest-util%2Fdownload%2Fjest-util-26.0.1.tgz", + "integrity": "sha1-csTFEXe2lf3XlcoHKm+U49fO8Ao=", + "dev": true, + "requires": { + "@jest/types": "^26.0.1", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.4", + "is-ci": "^2.0.0", + "make-dir": "^3.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npm.taobao.org/ansi-styles/download/ansi-styles-4.2.1.tgz", + "integrity": "sha1-kK51xCTQCNJiTFvynq0xd+v881k=", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/chalk/download/chalk-4.0.0.tgz", + "integrity": "sha1-bpgIHtLRf6q2FetSrGbsH+YgnnI=", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npm.taobao.org/color-convert/download/color-convert-2.0.1.tgz", + "integrity": "sha1-ctOmjVmMm9s68q0ehPIdiWq9TeM=", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npm.taobao.org/color-name/download/color-name-1.1.4.tgz", + "integrity": "sha1-wqCah6y95pVD3m9j+jmVyCbFNqI=", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/has-flag/download/has-flag-4.0.0.tgz", + "integrity": "sha1-lEdx/ZyByBJlxNaUGGDaBrtZR5s=", + "dev": true + }, + "make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npm.taobao.org/make-dir/download/make-dir-3.1.0.tgz?cache=0&sync_timestamp=1587567576732&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmake-dir%2Fdownload%2Fmake-dir-3.1.0.tgz", + "integrity": "sha1-QV6WcEazp/HRhSd9hKpYIDcmoT8=", + "dev": true, + "requires": { + "semver": "^6.0.0" + } + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npm.taobao.org/semver/download/semver-6.3.0.tgz", + "integrity": "sha1-7gpkyK9ejO6mdoexM3YeG+y9HT0=", + "dev": true + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npm.taobao.org/supports-color/download/supports-color-7.1.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsupports-color%2Fdownload%2Fsupports-color-7.1.0.tgz", + "integrity": "sha1-aOMlkd9z4lrRxLSRCKLsUHliv9E=", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "jest-validate": { + "version": "26.0.1", + "resolved": "https://registry.npm.taobao.org/jest-validate/download/jest-validate-26.0.1.tgz?cache=0&sync_timestamp=1588675384729&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjest-validate%2Fdownload%2Fjest-validate-26.0.1.tgz", + "integrity": "sha1-pimH4dpbf3JBMPkEcl4i9OWy4jw=", + "dev": true, + "requires": { + "@jest/types": "^26.0.1", + "camelcase": "^6.0.0", + "chalk": "^4.0.0", + "jest-get-type": "^26.0.0", + "leven": "^3.1.0", + "pretty-format": "^26.0.1" + }, + "dependencies": { + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npm.taobao.org/ansi-styles/download/ansi-styles-4.2.1.tgz", + "integrity": "sha1-kK51xCTQCNJiTFvynq0xd+v881k=", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "camelcase": { + "version": "6.0.0", + "resolved": "https://registry.npm.taobao.org/camelcase/download/camelcase-6.0.0.tgz", + "integrity": "sha1-Uln3ww414njxvcKk2RIws3ytmB4=", + "dev": true + }, + "chalk": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/chalk/download/chalk-4.0.0.tgz", + "integrity": "sha1-bpgIHtLRf6q2FetSrGbsH+YgnnI=", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npm.taobao.org/color-convert/download/color-convert-2.0.1.tgz", + "integrity": "sha1-ctOmjVmMm9s68q0ehPIdiWq9TeM=", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npm.taobao.org/color-name/download/color-name-1.1.4.tgz", + "integrity": "sha1-wqCah6y95pVD3m9j+jmVyCbFNqI=", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/has-flag/download/has-flag-4.0.0.tgz", + "integrity": "sha1-lEdx/ZyByBJlxNaUGGDaBrtZR5s=", + "dev": true + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npm.taobao.org/supports-color/download/supports-color-7.1.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsupports-color%2Fdownload%2Fsupports-color-7.1.0.tgz", + "integrity": "sha1-aOMlkd9z4lrRxLSRCKLsUHliv9E=", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "jest-watcher": { + "version": "26.0.1", + "resolved": "https://registry.npm.taobao.org/jest-watcher/download/jest-watcher-26.0.1.tgz", + "integrity": "sha1-W14+u98QwkDiKpivZtZFYxr9p3A=", + "dev": true, + "requires": { + "@jest/test-result": "^26.0.1", + "@jest/types": "^26.0.1", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "jest-util": "^26.0.1", + "string-length": "^4.0.1" + }, + "dependencies": { + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npm.taobao.org/ansi-styles/download/ansi-styles-4.2.1.tgz", + "integrity": "sha1-kK51xCTQCNJiTFvynq0xd+v881k=", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/chalk/download/chalk-4.0.0.tgz", + "integrity": "sha1-bpgIHtLRf6q2FetSrGbsH+YgnnI=", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npm.taobao.org/color-convert/download/color-convert-2.0.1.tgz", + "integrity": "sha1-ctOmjVmMm9s68q0ehPIdiWq9TeM=", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npm.taobao.org/color-name/download/color-name-1.1.4.tgz", + "integrity": "sha1-wqCah6y95pVD3m9j+jmVyCbFNqI=", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/has-flag/download/has-flag-4.0.0.tgz", + "integrity": "sha1-lEdx/ZyByBJlxNaUGGDaBrtZR5s=", + "dev": true + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npm.taobao.org/supports-color/download/supports-color-7.1.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsupports-color%2Fdownload%2Fsupports-color-7.1.0.tgz", + "integrity": "sha1-aOMlkd9z4lrRxLSRCKLsUHliv9E=", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "jest-worker": { + "version": "26.0.0", + "resolved": "https://registry.npm.taobao.org/jest-worker/download/jest-worker-26.0.0.tgz?cache=0&sync_timestamp=1588614797364&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjest-worker%2Fdownload%2Fjest-worker-26.0.0.tgz", + "integrity": "sha1-SSDHcU8KlsZBJGRxjQxYo98/sGY=", + "dev": true, + "requires": { + "merge-stream": "^2.0.0", + "supports-color": "^7.0.0" + }, + "dependencies": { + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/has-flag/download/has-flag-4.0.0.tgz", + "integrity": "sha1-lEdx/ZyByBJlxNaUGGDaBrtZR5s=", + "dev": true + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npm.taobao.org/supports-color/download/supports-color-7.1.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsupports-color%2Fdownload%2Fsupports-color-7.1.0.tgz", + "integrity": "sha1-aOMlkd9z4lrRxLSRCKLsUHliv9E=", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/js-tokens/download/js-tokens-4.0.0.tgz", + "integrity": "sha1-GSA/tZmR35jjoocFDUZHzerzJJk=", + "dev": true + }, + "js-yaml": { + "version": "3.14.0", + "resolved": "https://registry.npm.taobao.org/js-yaml/download/js-yaml-3.14.0.tgz?cache=0&sync_timestamp=1590172246873&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjs-yaml%2Fdownload%2Fjs-yaml-3.14.0.tgz", + "integrity": "sha1-p6NBcPJqIbsWJCTYray0ETpp5II=", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npm.taobao.org/jsbn/download/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "dev": true + }, + "jsdom": { + "version": "16.2.2", + "resolved": "https://registry.npm.taobao.org/jsdom/download/jsdom-16.2.2.tgz", + "integrity": "sha1-dvL3VBZGvrRqk49dxHa4hwW+3ys=", + "dev": true, + "requires": { + "abab": "^2.0.3", + "acorn": "^7.1.1", + "acorn-globals": "^6.0.0", + "cssom": "^0.4.4", + "cssstyle": "^2.2.0", + "data-urls": "^2.0.0", + "decimal.js": "^10.2.0", + "domexception": "^2.0.1", + "escodegen": "^1.14.1", + "html-encoding-sniffer": "^2.0.1", + "is-potential-custom-element-name": "^1.0.0", + "nwsapi": "^2.2.0", + "parse5": "5.1.1", + "request": "^2.88.2", + "request-promise-native": "^1.0.8", + "saxes": "^5.0.0", + "symbol-tree": "^3.2.4", + "tough-cookie": "^3.0.1", + "w3c-hr-time": "^1.0.2", + "w3c-xmlserializer": "^2.0.0", + "webidl-conversions": "^6.0.0", + "whatwg-encoding": "^1.0.5", + "whatwg-mimetype": "^2.3.0", + "whatwg-url": "^8.0.0", + "ws": "^7.2.3", + "xml-name-validator": "^3.0.0" + } + }, + "jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npm.taobao.org/jsesc/download/jsesc-2.5.2.tgz", + "integrity": "sha1-gFZNLkg9rPbo7yCWUKZ98/DCg6Q=", + "dev": true + }, + "json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npm.taobao.org/json-parse-better-errors/download/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha1-u4Z8+zRQ5pEHwTHRxRS6s9yLyqk=", + "dev": true + }, + "json-schema": { + "version": "0.2.3", + "resolved": "https://registry.npm.taobao.org/json-schema/download/json-schema-0.2.3.tgz?cache=0&sync_timestamp=1567740732347&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjson-schema%2Fdownload%2Fjson-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", + "dev": true + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npm.taobao.org/json-schema-traverse/download/json-schema-traverse-0.4.1.tgz", + "integrity": "sha1-afaofZUTq4u4/mO9sJecRI5oRmA=", + "dev": true + }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npm.taobao.org/json-stable-stringify-without-jsonify/download/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npm.taobao.org/json-stringify-safe/download/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", + "dev": true + }, + "json5": { + "version": "2.1.3", + "resolved": "https://registry.npm.taobao.org/json5/download/json5-2.1.3.tgz?cache=0&sync_timestamp=1586045700847&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjson5%2Fdownload%2Fjson5-2.1.3.tgz", + "integrity": "sha1-ybD3+pIzv+WAf+ZvzzpWF+1ZfUM=", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, + "jsprim": { + "version": "1.4.1", + "resolved": "https://registry.npm.taobao.org/jsprim/download/jsprim-1.4.1.tgz", + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "dev": true, + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + } + }, + "kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npm.taobao.org/kind-of/download/kind-of-6.0.3.tgz", + "integrity": "sha1-B8BQNKbDSfoG4k+jWqdttFgM5N0=", + "dev": true + }, + "kleur": { + "version": "3.0.3", + "resolved": "https://registry.npm.taobao.org/kleur/download/kleur-3.0.3.tgz", + "integrity": "sha1-p5yezIbuHOP6YgbRIWxQHxR/wH4=", + "dev": true + }, + "leven": { + "version": "3.1.0", + "resolved": "https://registry.npm.taobao.org/leven/download/leven-3.1.0.tgz", + "integrity": "sha1-d4kd6DQGTMy6gq54QrtrFKE+1/I=", + "dev": true + }, + "levenary": { + "version": "1.1.1", + "resolved": "https://registry.npm.taobao.org/levenary/download/levenary-1.1.1.tgz", + "integrity": "sha1-hCqe6Y0gdap/ru2+MmeekgX0b3c=", + "dev": true, + "requires": { + "leven": "^3.1.0" + } + }, + "levn": { + "version": "0.4.1", + "resolved": "https://registry.npm.taobao.org/levn/download/levn-0.4.1.tgz", + "integrity": "sha1-rkViwAdHO5MqYgDUAyaN0v/8at4=", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + } + }, + "lines-and-columns": { + "version": "1.1.6", + "resolved": "https://registry.npm.taobao.org/lines-and-columns/download/lines-and-columns-1.1.6.tgz", + "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=", + "dev": true + }, + "loader-runner": { + "version": "2.4.0", + "resolved": "https://registry.npm.taobao.org/loader-runner/download/loader-runner-2.4.0.tgz", + "integrity": "sha1-7UcGa/5TTX6ExMe5mYwqdWB9k1c=", + "dev": true + }, + "loader-utils": { + "version": "1.4.0", + "resolved": "https://registry.npm.taobao.org/loader-utils/download/loader-utils-1.4.0.tgz?cache=0&sync_timestamp=1584445207623&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Floader-utils%2Fdownload%2Floader-utils-1.4.0.tgz", + "integrity": "sha1-xXm140yzSxp07cbB+za/o3HVphM=", + "dev": true, + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^1.0.1" + }, + "dependencies": { + "json5": { + "version": "1.0.1", + "resolved": "https://registry.npm.taobao.org/json5/download/json5-1.0.1.tgz?cache=0&sync_timestamp=1586045700847&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fjson5%2Fdownload%2Fjson5-1.0.1.tgz", + "integrity": "sha1-d5+wAYYE+oVOrL9iUhgNg1Q+Pb4=", + "dev": true, + "requires": { + "minimist": "^1.2.0" + } + } + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npm.taobao.org/locate-path/download/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + } + }, + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npm.taobao.org/lodash/download/lodash-4.17.15.tgz", + "integrity": "sha1-tEf2ZwoEVbv+7dETku/zMOoJdUg=", + "dev": true + }, + "lodash.hasin": { + "version": "4.5.2", + "resolved": "https://registry.npm.taobao.org/lodash.hasin/download/lodash.hasin-4.5.2.tgz", + "integrity": "sha1-+R41I3jSHvcJC552h8LKNcW01So=", + "dev": true + }, + "lodash.isempty": { + "version": "4.4.0", + "resolved": "https://registry.npm.taobao.org/lodash.isempty/download/lodash.isempty-4.4.0.tgz", + "integrity": "sha1-b4bL7di+TsmHvpqvM8loTbGzHn4=", + "dev": true + }, + "lodash.isnil": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/lodash.isnil/download/lodash.isnil-4.0.0.tgz", + "integrity": "sha1-SeKM1VkBNFjIFMVHnTxmOiG/qmw=", + "dev": true + }, + "lodash.omitby": { + "version": "4.6.0", + "resolved": "https://registry.npm.taobao.org/lodash.omitby/download/lodash.omitby-4.6.0.tgz", + "integrity": "sha1-XBX/R1StVVAWtTwEExHo8HkgR5E=", + "dev": true + }, + "lodash.sortby": { + "version": "4.7.0", + "resolved": "https://registry.npm.taobao.org/lodash.sortby/download/lodash.sortby-4.7.0.tgz", + "integrity": "sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=", + "dev": true + }, + "loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npm.taobao.org/loose-envify/download/loose-envify-1.4.0.tgz", + "integrity": "sha1-ce5R+nvkyuwaY4OffmgtgTLTDK8=", + "dev": true, + "requires": { + "js-tokens": "^3.0.0 || ^4.0.0" + } + }, + "lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npm.taobao.org/lru-cache/download/lru-cache-5.1.1.tgz", + "integrity": "sha1-HaJ+ZxAnGUdpXa9oSOhH8B2EuSA=", + "dev": true, + "requires": { + "yallist": "^3.0.2" + } + }, + "magic-string": { + "version": "0.25.7", + "resolved": "https://registry.npm.taobao.org/magic-string/download/magic-string-0.25.7.tgz", + "integrity": "sha1-P0l9b9NMZpxnmNy4IfLvMfVEUFE=", + "dev": true, + "requires": { + "sourcemap-codec": "^1.4.4" + } + }, + "make-dir": { + "version": "2.1.0", + "resolved": "https://registry.npm.taobao.org/make-dir/download/make-dir-2.1.0.tgz?cache=0&sync_timestamp=1587567576732&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmake-dir%2Fdownload%2Fmake-dir-2.1.0.tgz", + "integrity": "sha1-XwMQ4YuL6JjMBwCSlaMK5B6R5vU=", + "dev": true, + "requires": { + "pify": "^4.0.1", + "semver": "^5.6.0" + } + }, + "makeerror": { + "version": "1.0.11", + "resolved": "https://registry.npm.taobao.org/makeerror/download/makeerror-1.0.11.tgz", + "integrity": "sha1-4BpckQnyr3lmDk6LlYd5AYT1qWw=", + "dev": true, + "requires": { + "tmpl": "1.0.x" + } + }, + "map-cache": { + "version": "0.2.2", + "resolved": "https://registry.npm.taobao.org/map-cache/download/map-cache-0.2.2.tgz", + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", + "dev": true + }, + "map-visit": { + "version": "1.0.0", + "resolved": "https://registry.npm.taobao.org/map-visit/download/map-visit-1.0.0.tgz", + "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "dev": true, + "requires": { + "object-visit": "^1.0.0" + } + }, + "md5.js": { + "version": "1.3.5", + "resolved": "https://registry.npm.taobao.org/md5.js/download/md5.js-1.3.5.tgz", + "integrity": "sha1-tdB7jjIW4+J81yjXL3DR5qNCAF8=", + "dev": true, + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "memory-fs": { + "version": "0.5.0", + "resolved": "https://registry.npm.taobao.org/memory-fs/download/memory-fs-0.5.0.tgz?cache=0&sync_timestamp=1570537491040&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmemory-fs%2Fdownload%2Fmemory-fs-0.5.0.tgz", + "integrity": "sha1-MkwBKIuIZSlm0WHbd4OHIIRajjw=", + "dev": true, + "requires": { + "errno": "^0.1.3", + "readable-stream": "^2.0.1" + } + }, + "merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npm.taobao.org/merge-stream/download/merge-stream-2.0.0.tgz", + "integrity": "sha1-UoI2KaFN0AyXcPtq1H3GMQ8sH2A=", + "dev": true + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npm.taobao.org/micromatch/download/micromatch-3.1.10.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmicromatch%2Fdownload%2Fmicromatch-3.1.10.tgz", + "integrity": "sha1-cIWbyVyYQJUvNZoGij/En57PrCM=", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } + }, + "miller-rabin": { + "version": "4.0.1", + "resolved": "https://registry.npm.taobao.org/miller-rabin/download/miller-rabin-4.0.1.tgz", + "integrity": "sha1-8IA1HIZbDcViqEYpZtqlNUPHik0=", + "dev": true, + "requires": { + "bn.js": "^4.0.0", + "brorand": "^1.0.1" + }, + "dependencies": { + "bn.js": { + "version": "4.11.9", + "resolved": "https://registry.npm.taobao.org/bn.js/download/bn.js-4.11.9.tgz", + "integrity": "sha1-JtVWgpRY+dHoH8SJUkk9C6NQeCg=", + "dev": true + } + } + }, + "mime-db": { + "version": "1.44.0", + "resolved": "https://registry.npm.taobao.org/mime-db/download/mime-db-1.44.0.tgz", + "integrity": "sha1-+hHF6wrKEzS0Izy01S8QxaYnL5I=", + "dev": true + }, + "mime-types": { + "version": "2.1.27", + "resolved": "https://registry.npm.taobao.org/mime-types/download/mime-types-2.1.27.tgz?cache=0&sync_timestamp=1587700357245&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmime-types%2Fdownload%2Fmime-types-2.1.27.tgz", + "integrity": "sha1-R5SfmOJ56lMRn1ci4PNOUpvsAJ8=", + "dev": true, + "requires": { + "mime-db": "1.44.0" + } + }, + "mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npm.taobao.org/mimic-fn/download/mimic-fn-2.1.0.tgz", + "integrity": "sha1-ftLCzMyvhNP/y3pptXcR/CCDQBs=", + "dev": true + }, + "minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npm.taobao.org/minimalistic-assert/download/minimalistic-assert-1.0.1.tgz", + "integrity": "sha1-LhlN4ERibUoQ5/f7wAznPoPk1cc=", + "dev": true + }, + "minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npm.taobao.org/minimalistic-crypto-utils/download/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npm.taobao.org/minimatch/download/minimatch-3.0.4.tgz", + "integrity": "sha1-UWbihkV/AzBgZL5Ul+jbsMPTIIM=", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npm.taobao.org/minimist/download/minimist-1.2.5.tgz?cache=0&sync_timestamp=1584051509720&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fminimist%2Fdownload%2Fminimist-1.2.5.tgz", + "integrity": "sha1-Z9ZgFLZqaoqqDAg8X9WN9OTpdgI=", + "dev": true + }, + "mississippi": { + "version": "3.0.0", + "resolved": "https://registry.npm.taobao.org/mississippi/download/mississippi-3.0.0.tgz", + "integrity": "sha1-6goykfl+C16HdrNj1fChLZTGcCI=", + "dev": true, + "requires": { + "concat-stream": "^1.5.0", + "duplexify": "^3.4.2", + "end-of-stream": "^1.1.0", + "flush-write-stream": "^1.0.0", + "from2": "^2.1.0", + "parallel-transform": "^1.1.0", + "pump": "^3.0.0", + "pumpify": "^1.3.3", + "stream-each": "^1.1.0", + "through2": "^2.0.0" + } + }, + "mixin-deep": { + "version": "1.3.2", + "resolved": "https://registry.npm.taobao.org/mixin-deep/download/mixin-deep-1.3.2.tgz?cache=0&sync_timestamp=1561436244196&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmixin-deep%2Fdownload%2Fmixin-deep-1.3.2.tgz", + "integrity": "sha1-ESC0PcNZp4Xc5ltVuC4lfM9HlWY=", + "dev": true, + "requires": { + "for-in": "^1.0.2", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npm.taobao.org/is-extendable/download/is-extendable-1.0.1.tgz", + "integrity": "sha1-p0cPnkJnM9gb2B4RVSZOOjUHyrQ=", + "dev": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "mkdirp": { + "version": "0.5.5", + "resolved": "https://registry.npm.taobao.org/mkdirp/download/mkdirp-0.5.5.tgz?cache=0&sync_timestamp=1587535418745&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmkdirp%2Fdownload%2Fmkdirp-0.5.5.tgz", + "integrity": "sha1-2Rzv1i0UNsoPQWIOJRKI1CAJne8=", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, + "move-concurrently": { + "version": "1.0.1", + "resolved": "https://registry.npm.taobao.org/move-concurrently/download/move-concurrently-1.0.1.tgz", + "integrity": "sha1-viwAX9oy4LKa8fBdfEszIUxwH5I=", + "dev": true, + "requires": { + "aproba": "^1.1.1", + "copy-concurrently": "^1.0.0", + "fs-write-stream-atomic": "^1.0.8", + "mkdirp": "^0.5.1", + "rimraf": "^2.5.4", + "run-queue": "^1.0.3" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npm.taobao.org/ms/download/ms-2.0.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fms%2Fdownload%2Fms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "mute-stream": { + "version": "0.0.8", + "resolved": "https://registry.npm.taobao.org/mute-stream/download/mute-stream-0.0.8.tgz", + "integrity": "sha1-FjDEKyJR/4HiooPelqVJfqkuXg0=", + "dev": true + }, + "nan": { + "version": "2.14.1", + "resolved": "https://registry.npm.taobao.org/nan/download/nan-2.14.1.tgz?cache=0&sync_timestamp=1587497111086&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fnan%2Fdownload%2Fnan-2.14.1.tgz", + "integrity": "sha1-174036MQW5FJTDFHCJMV7/iHSwE=", + "dev": true, + "optional": true + }, + "nanomatch": { + "version": "1.2.13", + "resolved": "https://registry.npm.taobao.org/nanomatch/download/nanomatch-1.2.13.tgz", + "integrity": "sha1-uHqKpPwN6P5r6IiVs4mD/yZb0Rk=", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "fragment-cache": "^0.2.1", + "is-windows": "^1.0.2", + "kind-of": "^6.0.2", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + } + }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npm.taobao.org/natural-compare/download/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, + "neo-async": { + "version": "2.6.1", + "resolved": "https://registry.npm.taobao.org/neo-async/download/neo-async-2.6.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fneo-async%2Fdownload%2Fneo-async-2.6.1.tgz", + "integrity": "sha1-rCetpmFn+ohJpq3dg39rGJrSCBw=", + "dev": true + }, + "nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npm.taobao.org/nice-try/download/nice-try-1.0.5.tgz", + "integrity": "sha1-ozeKdpbOfSI+iPybdkvX7xCJ42Y=", + "dev": true + }, + "node-int64": { + "version": "0.4.0", + "resolved": "https://registry.npm.taobao.org/node-int64/download/node-int64-0.4.0.tgz", + "integrity": "sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs=", + "dev": true + }, + "node-libs-browser": { + "version": "2.2.1", + "resolved": "https://registry.npm.taobao.org/node-libs-browser/download/node-libs-browser-2.2.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fnode-libs-browser%2Fdownload%2Fnode-libs-browser-2.2.1.tgz", + "integrity": "sha1-tk9RPRgzhiX5A0bSew0jXmMfZCU=", + "dev": true, + "requires": { + "assert": "^1.1.1", + "browserify-zlib": "^0.2.0", + "buffer": "^4.3.0", + "console-browserify": "^1.1.0", + "constants-browserify": "^1.0.0", + "crypto-browserify": "^3.11.0", + "domain-browser": "^1.1.1", + "events": "^3.0.0", + "https-browserify": "^1.0.0", + "os-browserify": "^0.3.0", + "path-browserify": "0.0.1", + "process": "^0.11.10", + "punycode": "^1.2.4", + "querystring-es3": "^0.2.0", + "readable-stream": "^2.3.3", + "stream-browserify": "^2.0.1", + "stream-http": "^2.7.2", + "string_decoder": "^1.0.0", + "timers-browserify": "^2.0.4", + "tty-browserify": "0.0.0", + "url": "^0.11.0", + "util": "^0.11.0", + "vm-browserify": "^1.0.1" + }, + "dependencies": { + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npm.taobao.org/punycode/download/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "dev": true + } + } + }, + "node-modules-regexp": { + "version": "1.0.0", + "resolved": "https://registry.npm.taobao.org/node-modules-regexp/download/node-modules-regexp-1.0.0.tgz", + "integrity": "sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA=", + "dev": true + }, + "node-notifier": { + "version": "7.0.1", + "resolved": "https://registry.npm.taobao.org/node-notifier/download/node-notifier-7.0.1.tgz", + "integrity": "sha1-o1XjPmvrrO+b+FYmia7Q9CMMpvk=", + "dev": true, + "optional": true, + "requires": { + "growly": "^1.3.0", + "is-wsl": "^2.1.1", + "semver": "^7.2.1", + "shellwords": "^0.1.1", + "uuid": "^7.0.3", + "which": "^2.0.2" + }, + "dependencies": { + "semver": { + "version": "7.3.2", + "resolved": "https://registry.npm.taobao.org/semver/download/semver-7.3.2.tgz", + "integrity": "sha1-YElisFK4HtB4aq6EOJ/7pw/9OTg=", + "dev": true, + "optional": true + } + } + }, + "node-releases": { + "version": "1.1.58", + "resolved": "https://registry.npm.taobao.org/node-releases/download/node-releases-1.1.58.tgz", + "integrity": "sha1-juIO7zD6YOUnVfzAlC3vWnNP6TU=", + "dev": true + }, + "normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npm.taobao.org/normalize-package-data/download/normalize-package-data-2.5.0.tgz", + "integrity": "sha1-5m2xg4sgDB38IzIl0SyzZSDiNKg=", + "dev": true, + "requires": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npm.taobao.org/normalize-path/download/normalize-path-3.0.0.tgz", + "integrity": "sha1-Dc1p/yOhybEf0JeDFmRKA4ghamU=", + "dev": true + }, + "npm-run-path": { + "version": "2.0.2", + "resolved": "https://registry.npm.taobao.org/npm-run-path/download/npm-run-path-2.0.2.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fnpm-run-path%2Fdownload%2Fnpm-run-path-2.0.2.tgz", + "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "dev": true, + "requires": { + "path-key": "^2.0.0" + } + }, + "nwsapi": { + "version": "2.2.0", + "resolved": "https://registry.npm.taobao.org/nwsapi/download/nwsapi-2.2.0.tgz", + "integrity": "sha1-IEh5qePQaP8qVROcLHcngGgaOLc=", + "dev": true + }, + "oauth-sign": { + "version": "0.9.0", + "resolved": "https://registry.npm.taobao.org/oauth-sign/download/oauth-sign-0.9.0.tgz", + "integrity": "sha1-R6ewFrqmi1+g7PPe4IqFxnmsZFU=", + "dev": true + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npm.taobao.org/object-assign/download/object-assign-4.1.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fobject-assign%2Fdownload%2Fobject-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + }, + "object-copy": { + "version": "0.1.0", + "resolved": "https://registry.npm.taobao.org/object-copy/download/object-copy-0.1.0.tgz", + "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", + "dev": true, + "requires": { + "copy-descriptor": "^0.1.0", + "define-property": "^0.2.5", + "kind-of": "^3.0.3" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npm.taobao.org/define-property/download/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npm.taobao.org/kind-of/download/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npm.taobao.org/object-keys/download/object-keys-1.1.1.tgz", + "integrity": "sha1-HEfyct8nfzsdrwYWd9nILiMixg4=", + "dev": true + }, + "object-visit": { + "version": "1.0.1", + "resolved": "https://registry.npm.taobao.org/object-visit/download/object-visit-1.0.1.tgz", + "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", + "dev": true, + "requires": { + "isobject": "^3.0.0" + } + }, + "object.assign": { + "version": "4.1.0", + "resolved": "https://registry.npm.taobao.org/object.assign/download/object.assign-4.1.0.tgz", + "integrity": "sha1-lovxEA15Vrs8oIbwBvhGs7xACNo=", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "function-bind": "^1.1.1", + "has-symbols": "^1.0.0", + "object-keys": "^1.0.11" + } + }, + "object.pick": { + "version": "1.3.0", + "resolved": "https://registry.npm.taobao.org/object.pick/download/object.pick-1.3.0.tgz", + "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "dev": true, + "requires": { + "isobject": "^3.0.1" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npm.taobao.org/once/download/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "onetime": { + "version": "5.1.0", + "resolved": "https://registry.npm.taobao.org/onetime/download/onetime-5.1.0.tgz", + "integrity": "sha1-//DzyRYX/mK7UBiWNumayKbfe+U=", + "dev": true, + "requires": { + "mimic-fn": "^2.1.0" + } + }, + "optionator": { + "version": "0.9.1", + "resolved": "https://registry.npm.taobao.org/optionator/download/optionator-0.9.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Foptionator%2Fdownload%2Foptionator-0.9.1.tgz", + "integrity": "sha1-TyNqY3Pa4FZqbUPhMmZ09QwpFJk=", + "dev": true, + "requires": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" + } + }, + "os-browserify": { + "version": "0.3.0", + "resolved": "https://registry.npm.taobao.org/os-browserify/download/os-browserify-0.3.0.tgz", + "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=", + "dev": true + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npm.taobao.org/os-tmpdir/download/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true + }, + "p-each-series": { + "version": "2.1.0", + "resolved": "https://registry.npm.taobao.org/p-each-series/download/p-each-series-2.1.0.tgz", + "integrity": "sha1-lhyN0/GV6pbHR+Y2smK4AKaxr0g=", + "dev": true + }, + "p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npm.taobao.org/p-finally/download/p-finally-1.0.0.tgz?cache=0&sync_timestamp=1560955759606&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fp-finally%2Fdownload%2Fp-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", + "dev": true + }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npm.taobao.org/p-limit/download/p-limit-1.3.0.tgz?cache=0&sync_timestamp=1591460606987&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fp-limit%2Fdownload%2Fp-limit-1.3.0.tgz", + "integrity": "sha1-uGvV8MJWkJEcdZD8v8IBDVSzzLg=", + "dev": true, + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npm.taobao.org/p-locate/download/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "^1.1.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npm.taobao.org/p-try/download/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true + }, + "pako": { + "version": "1.0.11", + "resolved": "https://registry.npm.taobao.org/pako/download/pako-1.0.11.tgz", + "integrity": "sha1-bJWZ00DVTf05RjgCUqNXBaa5kr8=", + "dev": true + }, + "parallel-transform": { + "version": "1.2.0", + "resolved": "https://registry.npm.taobao.org/parallel-transform/download/parallel-transform-1.2.0.tgz", + "integrity": "sha1-kEnKN9bLIYLDsdLHIL6U0UpYFPw=", + "dev": true, + "requires": { + "cyclist": "^1.0.1", + "inherits": "^2.0.3", + "readable-stream": "^2.1.5" + } + }, + "parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npm.taobao.org/parent-module/download/parent-module-1.0.1.tgz", + "integrity": "sha1-aR0nCeeMefrjoVZiJFLQB2LKqqI=", + "dev": true, + "requires": { + "callsites": "^3.0.0" + } + }, + "parse-asn1": { + "version": "5.1.5", + "resolved": "https://registry.npm.taobao.org/parse-asn1/download/parse-asn1-5.1.5.tgz", + "integrity": "sha1-ADJxND2ljclMrOSU+u89IUfs6g4=", + "dev": true, + "requires": { + "asn1.js": "^4.0.0", + "browserify-aes": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.0", + "pbkdf2": "^3.0.3", + "safe-buffer": "^5.1.1" + } + }, + "parse-json": { + "version": "5.0.0", + "resolved": "https://registry.npm.taobao.org/parse-json/download/parse-json-5.0.0.tgz", + "integrity": "sha1-c+URTJhtFD76NxLU6iTbmkJm9g8=", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1", + "lines-and-columns": "^1.1.6" + } + }, + "parse5": { + "version": "5.1.1", + "resolved": "https://registry.npm.taobao.org/parse5/download/parse5-5.1.1.tgz", + "integrity": "sha1-9o5OW6GFKsLK3AD0VV//bCq7YXg=", + "dev": true + }, + "pascalcase": { + "version": "0.1.1", + "resolved": "https://registry.npm.taobao.org/pascalcase/download/pascalcase-0.1.1.tgz", + "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", + "dev": true + }, + "path-browserify": { + "version": "0.0.1", + "resolved": "https://registry.npm.taobao.org/path-browserify/download/path-browserify-0.0.1.tgz", + "integrity": "sha1-5sTd1+06onxoogzE5Q4aTug7vEo=", + "dev": true + }, + "path-dirname": { + "version": "1.0.2", + "resolved": "https://registry.npm.taobao.org/path-dirname/download/path-dirname-1.0.2.tgz", + "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", + "dev": true, + "optional": true + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npm.taobao.org/path-exists/download/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npm.taobao.org/path-is-absolute/download/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npm.taobao.org/path-key/download/path-key-2.0.1.tgz?cache=0&sync_timestamp=1574441322626&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fpath-key%2Fdownload%2Fpath-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true + }, + "path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npm.taobao.org/path-parse/download/path-parse-1.0.6.tgz", + "integrity": "sha1-1i27VnlAXXLEc37FhgDp3c8G0kw=", + "dev": true + }, + "pbkdf2": { + "version": "3.1.1", + "resolved": "https://registry.npm.taobao.org/pbkdf2/download/pbkdf2-3.1.1.tgz", + "integrity": "sha1-y4cksPramEWWhW0abrr9NYRlS5Q=", + "dev": true, + "requires": { + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4", + "ripemd160": "^2.0.1", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npm.taobao.org/performance-now/download/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", + "dev": true + }, + "picomatch": { + "version": "2.2.2", + "resolved": "https://registry.npm.taobao.org/picomatch/download/picomatch-2.2.2.tgz", + "integrity": "sha1-IfMz6ba46v8CRo9RRupAbTRfTa0=", + "dev": true + }, + "pify": { + "version": "4.0.1", + "resolved": "https://registry.npm.taobao.org/pify/download/pify-4.0.1.tgz", + "integrity": "sha1-SyzSXFDVmHNcUCkiJP2MbfQeMjE=", + "dev": true + }, + "pirates": { + "version": "4.0.1", + "resolved": "https://registry.npm.taobao.org/pirates/download/pirates-4.0.1.tgz", + "integrity": "sha1-ZDqSyviUVm+RsrmG0sZpUKji+4c=", + "dev": true, + "requires": { + "node-modules-regexp": "^1.0.0" + } + }, + "pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npm.taobao.org/pkg-dir/download/pkg-dir-4.2.0.tgz", + "integrity": "sha1-8JkTPfft5CLoHR2ESCcO6z5CYfM=", + "dev": true, + "requires": { + "find-up": "^4.0.0" + }, + "dependencies": { + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npm.taobao.org/find-up/download/find-up-4.1.0.tgz", + "integrity": "sha1-l6/n1s3AvFkoWEt8jXsW6KmqXRk=", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npm.taobao.org/locate-path/download/locate-path-5.0.0.tgz", + "integrity": "sha1-Gvujlq/WdqbUJQTQpno6frn2KqA=", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npm.taobao.org/p-limit/download/p-limit-2.3.0.tgz?cache=0&sync_timestamp=1591460606987&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fp-limit%2Fdownload%2Fp-limit-2.3.0.tgz", + "integrity": "sha1-PdM8ZHohT9//2DWTPrCG2g3CHbE=", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npm.taobao.org/p-locate/download/p-locate-4.1.0.tgz", + "integrity": "sha1-o0KLtwiLOmApL2aRkni3wpetTwc=", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npm.taobao.org/p-try/download/p-try-2.2.0.tgz", + "integrity": "sha1-yyhoVA4xPWHeWPr741zpAE1VQOY=", + "dev": true + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/path-exists/download/path-exists-4.0.0.tgz", + "integrity": "sha1-UTvb4tO5XXdi6METfvoZXGxhtbM=", + "dev": true + } + } + }, + "pkg-up": { + "version": "2.0.0", + "resolved": "https://registry.npm.taobao.org/pkg-up/download/pkg-up-2.0.0.tgz", + "integrity": "sha1-yBmscoBZpGHKscOImivjxJoATX8=", + "dev": true, + "requires": { + "find-up": "^2.1.0" + } + }, + "posix-character-classes": { + "version": "0.1.1", + "resolved": "https://registry.npm.taobao.org/posix-character-classes/download/posix-character-classes-0.1.1.tgz", + "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", + "dev": true + }, + "prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npm.taobao.org/prelude-ls/download/prelude-ls-1.2.1.tgz?cache=0&sync_timestamp=1585868608597&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fprelude-ls%2Fdownload%2Fprelude-ls-1.2.1.tgz", + "integrity": "sha1-3rxkidem5rDnYRiIzsiAM30xY5Y=", + "dev": true + }, + "prettier": { + "version": "2.0.5", + "resolved": "https://registry.npm.taobao.org/prettier/download/prettier-2.0.5.tgz?cache=0&sync_timestamp=1588723451380&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fprettier%2Fdownload%2Fprettier-2.0.5.tgz", + "integrity": "sha1-1tVigkVSQ/L5LMFxZpLAiqMVItQ=", + "dev": true + }, + "pretty-format": { + "version": "26.0.1", + "resolved": "https://registry.npm.taobao.org/pretty-format/download/pretty-format-26.0.1.tgz?cache=0&sync_timestamp=1588675385734&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fpretty-format%2Fdownload%2Fpretty-format-26.0.1.tgz", + "integrity": "sha1-pP5U/kKK0v00E8prvR7IwuJ34Zc=", + "dev": true, + "requires": { + "@jest/types": "^26.0.1", + "ansi-regex": "^5.0.0", + "ansi-styles": "^4.0.0", + "react-is": "^16.12.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npm.taobao.org/ansi-styles/download/ansi-styles-4.2.1.tgz", + "integrity": "sha1-kK51xCTQCNJiTFvynq0xd+v881k=", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npm.taobao.org/color-convert/download/color-convert-2.0.1.tgz", + "integrity": "sha1-ctOmjVmMm9s68q0ehPIdiWq9TeM=", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npm.taobao.org/color-name/download/color-name-1.1.4.tgz", + "integrity": "sha1-wqCah6y95pVD3m9j+jmVyCbFNqI=", + "dev": true + } + } + }, + "private": { + "version": "0.1.8", + "resolved": "https://registry.npm.taobao.org/private/download/private-0.1.8.tgz", + "integrity": "sha1-I4Hts2ifelPWUxkAYPz4ItLzaP8=", + "dev": true + }, + "process": { + "version": "0.11.10", + "resolved": "https://registry.npm.taobao.org/process/download/process-0.11.10.tgz", + "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=", + "dev": true + }, + "process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npm.taobao.org/process-nextick-args/download/process-nextick-args-2.0.1.tgz", + "integrity": "sha1-eCDZsWEgzFXKmud5JoCufbptf+I=", + "dev": true + }, + "progress": { + "version": "2.0.3", + "resolved": "https://registry.npm.taobao.org/progress/download/progress-2.0.3.tgz", + "integrity": "sha1-foz42PW48jnBvGi+tOt4Vn1XLvg=", + "dev": true + }, + "promise-inflight": { + "version": "1.0.1", + "resolved": "https://registry.npm.taobao.org/promise-inflight/download/promise-inflight-1.0.1.tgz", + "integrity": "sha1-mEcocL8igTL8vdhoEputEsPAKeM=", + "dev": true + }, + "prompts": { + "version": "2.3.2", + "resolved": "https://registry.npm.taobao.org/prompts/download/prompts-2.3.2.tgz", + "integrity": "sha1-SAVy2J7POVZtK9P+LJ/Mt8TAsGg=", + "dev": true, + "requires": { + "kleur": "^3.0.3", + "sisteransi": "^1.0.4" + } + }, + "prr": { + "version": "1.0.1", + "resolved": "https://registry.npm.taobao.org/prr/download/prr-1.0.1.tgz", + "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=", + "dev": true + }, + "psl": { + "version": "1.8.0", + "resolved": "https://registry.npm.taobao.org/psl/download/psl-1.8.0.tgz", + "integrity": "sha1-kyb4vPsBOtzABf3/BWrM4CDlHCQ=", + "dev": true + }, + "public-encrypt": { + "version": "4.0.3", + "resolved": "https://registry.npm.taobao.org/public-encrypt/download/public-encrypt-4.0.3.tgz", + "integrity": "sha1-T8ydd6B+SLp1J+fL4N4z0HATMeA=", + "dev": true, + "requires": { + "bn.js": "^4.1.0", + "browserify-rsa": "^4.0.0", + "create-hash": "^1.1.0", + "parse-asn1": "^5.0.0", + "randombytes": "^2.0.1", + "safe-buffer": "^5.1.2" + }, + "dependencies": { + "bn.js": { + "version": "4.11.9", + "resolved": "https://registry.npm.taobao.org/bn.js/download/bn.js-4.11.9.tgz", + "integrity": "sha1-JtVWgpRY+dHoH8SJUkk9C6NQeCg=", + "dev": true + } + } + }, + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npm.taobao.org/pump/download/pump-3.0.0.tgz", + "integrity": "sha1-tKIRaBW94vTh6mAjVOjHVWUQemQ=", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "pumpify": { + "version": "1.5.1", + "resolved": "https://registry.npm.taobao.org/pumpify/download/pumpify-1.5.1.tgz?cache=0&sync_timestamp=1569938200736&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fpumpify%2Fdownload%2Fpumpify-1.5.1.tgz", + "integrity": "sha1-NlE74karJ1cLGjdKXOJ4v9dDcM4=", + "dev": true, + "requires": { + "duplexify": "^3.6.0", + "inherits": "^2.0.3", + "pump": "^2.0.0" + }, + "dependencies": { + "pump": { + "version": "2.0.1", + "resolved": "https://registry.npm.taobao.org/pump/download/pump-2.0.1.tgz", + "integrity": "sha1-Ejma3W5M91Jtlzy8i1zi4pCLOQk=", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + } + } + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npm.taobao.org/punycode/download/punycode-2.1.1.tgz", + "integrity": "sha1-tYsBCsQMIsVldhbI0sLALHv0eew=", + "dev": true + }, + "qs": { + "version": "6.5.2", + "resolved": "https://registry.npm.taobao.org/qs/download/qs-6.5.2.tgz", + "integrity": "sha1-yzroBuh0BERYTvFUzo7pjUA/PjY=", + "dev": true + }, + "querystring": { + "version": "0.2.0", + "resolved": "https://registry.npm.taobao.org/querystring/download/querystring-0.2.0.tgz", + "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=", + "dev": true + }, + "querystring-es3": { + "version": "0.2.1", + "resolved": "https://registry.npm.taobao.org/querystring-es3/download/querystring-es3-0.2.1.tgz", + "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=", + "dev": true + }, + "randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npm.taobao.org/randombytes/download/randombytes-2.1.0.tgz", + "integrity": "sha1-32+ENy8CcNxlzfYpE0mrekc9Tyo=", + "dev": true, + "requires": { + "safe-buffer": "^5.1.0" + } + }, + "randomfill": { + "version": "1.0.4", + "resolved": "https://registry.npm.taobao.org/randomfill/download/randomfill-1.0.4.tgz", + "integrity": "sha1-ySGW/IarQr6YPxvzF3giSTHWFFg=", + "dev": true, + "requires": { + "randombytes": "^2.0.5", + "safe-buffer": "^5.1.0" + } + }, + "react-is": { + "version": "16.13.1", + "resolved": "https://registry.npm.taobao.org/react-is/download/react-is-16.13.1.tgz", + "integrity": "sha1-eJcppNw23imZ3BVt1sHZwYzqVqQ=", + "dev": true + }, + "read-pkg": { + "version": "5.2.0", + "resolved": "https://registry.npm.taobao.org/read-pkg/download/read-pkg-5.2.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fread-pkg%2Fdownload%2Fread-pkg-5.2.0.tgz", + "integrity": "sha1-e/KVQ4yloz5WzTDgU7NO5yUMk8w=", + "dev": true, + "requires": { + "@types/normalize-package-data": "^2.4.0", + "normalize-package-data": "^2.5.0", + "parse-json": "^5.0.0", + "type-fest": "^0.6.0" + }, + "dependencies": { + "type-fest": { + "version": "0.6.0", + "resolved": "https://registry.npm.taobao.org/type-fest/download/type-fest-0.6.0.tgz", + "integrity": "sha1-jSojcNPfiG61yQraHFv2GIrPg4s=", + "dev": true + } + } + }, + "read-pkg-up": { + "version": "7.0.1", + "resolved": "https://registry.npm.taobao.org/read-pkg-up/download/read-pkg-up-7.0.1.tgz?cache=0&sync_timestamp=1575620436254&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fread-pkg-up%2Fdownload%2Fread-pkg-up-7.0.1.tgz", + "integrity": "sha1-86YTV1hFlzOuK5VjgFbhhU5+9Qc=", + "dev": true, + "requires": { + "find-up": "^4.1.0", + "read-pkg": "^5.2.0", + "type-fest": "^0.8.1" + }, + "dependencies": { + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npm.taobao.org/find-up/download/find-up-4.1.0.tgz", + "integrity": "sha1-l6/n1s3AvFkoWEt8jXsW6KmqXRk=", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npm.taobao.org/locate-path/download/locate-path-5.0.0.tgz", + "integrity": "sha1-Gvujlq/WdqbUJQTQpno6frn2KqA=", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npm.taobao.org/p-limit/download/p-limit-2.3.0.tgz?cache=0&sync_timestamp=1591460606987&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fp-limit%2Fdownload%2Fp-limit-2.3.0.tgz", + "integrity": "sha1-PdM8ZHohT9//2DWTPrCG2g3CHbE=", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npm.taobao.org/p-locate/download/p-locate-4.1.0.tgz", + "integrity": "sha1-o0KLtwiLOmApL2aRkni3wpetTwc=", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npm.taobao.org/p-try/download/p-try-2.2.0.tgz", + "integrity": "sha1-yyhoVA4xPWHeWPr741zpAE1VQOY=", + "dev": true + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/path-exists/download/path-exists-4.0.0.tgz", + "integrity": "sha1-UTvb4tO5XXdi6METfvoZXGxhtbM=", + "dev": true + } + } + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npm.taobao.org/readable-stream/download/readable-stream-2.3.7.tgz?cache=0&sync_timestamp=1581624324274&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Freadable-stream%2Fdownload%2Freadable-stream-2.3.7.tgz", + "integrity": "sha1-Hsoc9xGu+BTAT2IlKjamL2yyO1c=", + "dev": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "readdirp": { + "version": "2.2.1", + "resolved": "https://registry.npm.taobao.org/readdirp/download/readdirp-2.2.1.tgz", + "integrity": "sha1-DodiKjMlqjPokihcr4tOhGUppSU=", + "dev": true, + "optional": true, + "requires": { + "graceful-fs": "^4.1.11", + "micromatch": "^3.1.10", + "readable-stream": "^2.0.2" + } + }, + "regenerate": { + "version": "1.4.1", + "resolved": "https://registry.npm.taobao.org/regenerate/download/regenerate-1.4.1.tgz", + "integrity": "sha1-ytkq2Oa1kXc0hfvgWkhcr09Ffm8=", + "dev": true + }, + "regenerate-unicode-properties": { + "version": "8.2.0", + "resolved": "https://registry.npm.taobao.org/regenerate-unicode-properties/download/regenerate-unicode-properties-8.2.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fregenerate-unicode-properties%2Fdownload%2Fregenerate-unicode-properties-8.2.0.tgz", + "integrity": "sha1-5d5xEdZV57pgwFfb6f83yH5lzew=", + "dev": true, + "requires": { + "regenerate": "^1.4.0" + } + }, + "regenerator-runtime": { + "version": "0.13.5", + "resolved": "https://registry.npm.taobao.org/regenerator-runtime/download/regenerator-runtime-0.13.5.tgz?cache=0&sync_timestamp=1584052392667&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fregenerator-runtime%2Fdownload%2Fregenerator-runtime-0.13.5.tgz", + "integrity": "sha1-2Hih0JS0MG0QuQlkhLM+vVXiZpc=", + "dev": true + }, + "regenerator-transform": { + "version": "0.14.4", + "resolved": "https://registry.npm.taobao.org/regenerator-transform/download/regenerator-transform-0.14.4.tgz", + "integrity": "sha1-UmaFeJZRjRYWp4oEeTN6MOqXTMc=", + "dev": true, + "requires": { + "@babel/runtime": "^7.8.4", + "private": "^0.1.8" + } + }, + "regex-not": { + "version": "1.0.2", + "resolved": "https://registry.npm.taobao.org/regex-not/download/regex-not-1.0.2.tgz", + "integrity": "sha1-H07OJ+ALC2XgJHpoEOaoXYOldSw=", + "dev": true, + "requires": { + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" + } + }, + "regexpp": { + "version": "3.1.0", + "resolved": "https://registry.npm.taobao.org/regexpp/download/regexpp-3.1.0.tgz", + "integrity": "sha1-IG0K0KVkjP+9uK5GQ489xRyfeOI=", + "dev": true + }, + "regexpu-core": { + "version": "4.7.0", + "resolved": "https://registry.npm.taobao.org/regexpu-core/download/regexpu-core-4.7.0.tgz", + "integrity": "sha1-/L9FjFBDGwu3tF1pZ7gZLZHz2Tg=", + "dev": true, + "requires": { + "regenerate": "^1.4.0", + "regenerate-unicode-properties": "^8.2.0", + "regjsgen": "^0.5.1", + "regjsparser": "^0.6.4", + "unicode-match-property-ecmascript": "^1.0.4", + "unicode-match-property-value-ecmascript": "^1.2.0" + } + }, + "regjsgen": { + "version": "0.5.2", + "resolved": "https://registry.npm.taobao.org/regjsgen/download/regjsgen-0.5.2.tgz", + "integrity": "sha1-kv8pX7He7L9uzaslQ9IH6RqjNzM=", + "dev": true + }, + "regjsparser": { + "version": "0.6.4", + "resolved": "https://registry.npm.taobao.org/regjsparser/download/regjsparser-0.6.4.tgz", + "integrity": "sha1-p2n4aEMIQBpm6bUp0kNv9NBmYnI=", + "dev": true, + "requires": { + "jsesc": "~0.5.0" + }, + "dependencies": { + "jsesc": { + "version": "0.5.0", + "resolved": "https://registry.npm.taobao.org/jsesc/download/jsesc-0.5.0.tgz", + "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", + "dev": true + } + } + }, + "remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npm.taobao.org/remove-trailing-separator/download/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", + "dev": true + }, + "repeat-element": { + "version": "1.1.3", + "resolved": "https://registry.npm.taobao.org/repeat-element/download/repeat-element-1.1.3.tgz", + "integrity": "sha1-eC4NglwMWjuzlzH4Tv7mt0Lmsc4=", + "dev": true + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npm.taobao.org/repeat-string/download/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true + }, + "request": { + "version": "2.88.2", + "resolved": "https://registry.npm.taobao.org/request/download/request-2.88.2.tgz", + "integrity": "sha1-1zyRhzHLWofaBH4gcjQUb2ZNErM=", + "dev": true, + "requires": { + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.3", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.5.0", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" + }, + "dependencies": { + "tough-cookie": { + "version": "2.5.0", + "resolved": "https://registry.npm.taobao.org/tough-cookie/download/tough-cookie-2.5.0.tgz", + "integrity": "sha1-zZ+yoKodWhK0c72fuW+j3P9lreI=", + "dev": true, + "requires": { + "psl": "^1.1.28", + "punycode": "^2.1.1" + } + }, + "uuid": { + "version": "3.4.0", + "resolved": "https://registry.npm.taobao.org/uuid/download/uuid-3.4.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fuuid%2Fdownload%2Fuuid-3.4.0.tgz", + "integrity": "sha1-sj5DWK+oogL+ehAK8fX4g/AgB+4=", + "dev": true + } + } + }, + "request-promise-core": { + "version": "1.1.3", + "resolved": "https://registry.npm.taobao.org/request-promise-core/download/request-promise-core-1.1.3.tgz", + "integrity": "sha1-6aPAgbUTgN/qZ3M2Bh/qh5qCnuk=", + "dev": true, + "requires": { + "lodash": "^4.17.15" + } + }, + "request-promise-native": { + "version": "1.0.8", + "resolved": "https://registry.npm.taobao.org/request-promise-native/download/request-promise-native-1.0.8.tgz?cache=0&sync_timestamp=1572829762814&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Frequest-promise-native%2Fdownload%2Frequest-promise-native-1.0.8.tgz", + "integrity": "sha1-pFW5YLgm5E4r+Jma9k3/K/5YyzY=", + "dev": true, + "requires": { + "request-promise-core": "1.1.3", + "stealthy-require": "^1.1.1", + "tough-cookie": "^2.3.3" + }, + "dependencies": { + "tough-cookie": { + "version": "2.5.0", + "resolved": "https://registry.npm.taobao.org/tough-cookie/download/tough-cookie-2.5.0.tgz", + "integrity": "sha1-zZ+yoKodWhK0c72fuW+j3P9lreI=", + "dev": true, + "requires": { + "psl": "^1.1.28", + "punycode": "^2.1.1" + } + } + } + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npm.taobao.org/require-directory/download/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true + }, + "require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npm.taobao.org/require-main-filename/download/require-main-filename-2.0.0.tgz", + "integrity": "sha1-0LMp7MfMD2Fkn2IhW+aa9UqomJs=", + "dev": true + }, + "resolve": { + "version": "1.17.0", + "resolved": "https://registry.npm.taobao.org/resolve/download/resolve-1.17.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fresolve%2Fdownload%2Fresolve-1.17.0.tgz", + "integrity": "sha1-sllBtUloIxzC0bt2p5y38sC/hEQ=", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } + }, + "resolve-cwd": { + "version": "3.0.0", + "resolved": "https://registry.npm.taobao.org/resolve-cwd/download/resolve-cwd-3.0.0.tgz", + "integrity": "sha1-DwB18bslRHZs9zumpuKt/ryxPy0=", + "dev": true, + "requires": { + "resolve-from": "^5.0.0" + } + }, + "resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npm.taobao.org/resolve-from/download/resolve-from-5.0.0.tgz", + "integrity": "sha1-w1IlhD3493bfIcV1V7wIfp39/Gk=", + "dev": true + }, + "resolve-url": { + "version": "0.2.1", + "resolved": "https://registry.npm.taobao.org/resolve-url/download/resolve-url-0.2.1.tgz", + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", + "dev": true + }, + "restore-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npm.taobao.org/restore-cursor/download/restore-cursor-3.1.0.tgz", + "integrity": "sha1-OfZ8VLOnpYzqUjbZXPADQjljH34=", + "dev": true, + "requires": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + } + }, + "ret": { + "version": "0.1.15", + "resolved": "https://registry.npm.taobao.org/ret/download/ret-0.1.15.tgz", + "integrity": "sha1-uKSCXVvbH8P29Twrwz+BOIaBx7w=", + "dev": true + }, + "rimraf": { + "version": "2.6.3", + "resolved": "https://registry.npm.taobao.org/rimraf/download/rimraf-2.6.3.tgz?cache=0&sync_timestamp=1581257110269&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Frimraf%2Fdownload%2Frimraf-2.6.3.tgz", + "integrity": "sha1-stEE/g2Psnz54KHNqCYt04M8bKs=", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "ripemd160": { + "version": "2.0.2", + "resolved": "https://registry.npm.taobao.org/ripemd160/download/ripemd160-2.0.2.tgz", + "integrity": "sha1-ocGm9iR1FXe6XQeRTLyShQWFiQw=", + "dev": true, + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1" + } + }, + "rollup": { + "version": "2.14.0", + "resolved": "https://registry.npm.taobao.org/rollup/download/rollup-2.14.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Frollup%2Fdownload%2Frollup-2.14.0.tgz", + "integrity": "sha1-O945otULkE8zYhkkHfVdHqPV8RU=", + "dev": true, + "requires": { + "fsevents": "~2.1.2" + }, + "dependencies": { + "fsevents": { + "version": "2.1.3", + "resolved": "https://registry.npm.taobao.org/fsevents/download/fsevents-2.1.3.tgz", + "integrity": "sha1-+3OHA66NL5/pAMM4Nt3r7ouX8j4=", + "dev": true, + "optional": true + } + } + }, + "rollup-plugin-babel": { + "version": "4.4.0", + "resolved": "https://registry.npm.taobao.org/rollup-plugin-babel/download/rollup-plugin-babel-4.4.0.tgz", + "integrity": "sha1-0VvSWUZqnRrMvbL+L/8XxS0DCss=", + "dev": true, + "requires": { + "@babel/helper-module-imports": "^7.0.0", + "rollup-pluginutils": "^2.8.1" + } + }, + "rollup-plugin-eslint": { + "version": "7.0.0", + "resolved": "https://registry.npm.taobao.org/rollup-plugin-eslint/download/rollup-plugin-eslint-7.0.0.tgz", + "integrity": "sha1-ptvLwUaZp6AhVWl8DD36Jsylmps=", + "dev": true, + "requires": { + "eslint": "^6.0.0", + "rollup-pluginutils": "^2.7.1" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npm.taobao.org/ansi-regex/download/ansi-regex-4.1.0.tgz", + "integrity": "sha1-i5+PCM8ay4Q3Vqg5yox+MWjFGZc=", + "dev": true + }, + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npm.taobao.org/debug/download/debug-4.1.1.tgz?cache=0&sync_timestamp=1589881689076&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fdebug%2Fdownload%2Fdebug-4.1.1.tgz", + "integrity": "sha1-O3ImAlUQnGtYnO4FDx1RYTlmR5E=", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "eslint": { + "version": "6.8.0", + "resolved": "https://registry.npm.taobao.org/eslint/download/eslint-6.8.0.tgz?cache=0&sync_timestamp=1591401814806&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Feslint%2Fdownload%2Feslint-6.8.0.tgz", + "integrity": "sha1-YiYtZylzn5J1cjgkMC+yJ8jJP/s=", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "ajv": "^6.10.0", + "chalk": "^2.1.0", + "cross-spawn": "^6.0.5", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "eslint-scope": "^5.0.0", + "eslint-utils": "^1.4.3", + "eslint-visitor-keys": "^1.1.0", + "espree": "^6.1.2", + "esquery": "^1.0.1", + "esutils": "^2.0.2", + "file-entry-cache": "^5.0.1", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^5.0.0", + "globals": "^12.1.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "inquirer": "^7.0.0", + "is-glob": "^4.0.0", + "js-yaml": "^3.13.1", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.3.0", + "lodash": "^4.17.14", + "minimatch": "^3.0.4", + "mkdirp": "^0.5.1", + "natural-compare": "^1.4.0", + "optionator": "^0.8.3", + "progress": "^2.0.0", + "regexpp": "^2.0.1", + "semver": "^6.1.2", + "strip-ansi": "^5.2.0", + "strip-json-comments": "^3.0.1", + "table": "^5.2.3", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + } + }, + "eslint-utils": { + "version": "1.4.3", + "resolved": "https://registry.npm.taobao.org/eslint-utils/download/eslint-utils-1.4.3.tgz", + "integrity": "sha1-dP7HxU0Hdrb2fgJRBAtYBlZOmB8=", + "dev": true, + "requires": { + "eslint-visitor-keys": "^1.1.0" + } + }, + "espree": { + "version": "6.2.1", + "resolved": "https://registry.npm.taobao.org/espree/download/espree-6.2.1.tgz?cache=0&sync_timestamp=1591269463485&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fespree%2Fdownload%2Fespree-6.2.1.tgz", + "integrity": "sha1-d/xy4f10SiBSwg84pbV1gy6Cc0o=", + "dev": true, + "requires": { + "acorn": "^7.1.1", + "acorn-jsx": "^5.2.0", + "eslint-visitor-keys": "^1.1.0" + } + }, + "glob-parent": { + "version": "5.1.1", + "resolved": "https://registry.npm.taobao.org/glob-parent/download/glob-parent-5.1.1.tgz", + "integrity": "sha1-tsHvQXxOVmPqSY8cRa+saRa7wik=", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "globals": { + "version": "12.4.0", + "resolved": "https://registry.npm.taobao.org/globals/download/globals-12.4.0.tgz", + "integrity": "sha1-oYgTV2pBsAokqX5/gVkYwuGZJfg=", + "dev": true, + "requires": { + "type-fest": "^0.8.1" + } + }, + "levn": { + "version": "0.3.0", + "resolved": "https://registry.npm.taobao.org/levn/download/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "dev": true, + "requires": { + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npm.taobao.org/ms/download/ms-2.1.2.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fms%2Fdownload%2Fms-2.1.2.tgz", + "integrity": "sha1-0J0fNXtEP0kzgqjrPM0YOHKuYAk=", + "dev": true + }, + "optionator": { + "version": "0.8.3", + "resolved": "https://registry.npm.taobao.org/optionator/download/optionator-0.8.3.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Foptionator%2Fdownload%2Foptionator-0.8.3.tgz", + "integrity": "sha1-hPodA2/p08fiHZmIS2ARZ+yPtJU=", + "dev": true, + "requires": { + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.6", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "word-wrap": "~1.2.3" + } + }, + "prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npm.taobao.org/prelude-ls/download/prelude-ls-1.1.2.tgz?cache=0&sync_timestamp=1585868608597&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fprelude-ls%2Fdownload%2Fprelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "dev": true + }, + "regexpp": { + "version": "2.0.1", + "resolved": "https://registry.npm.taobao.org/regexpp/download/regexpp-2.0.1.tgz", + "integrity": "sha1-jRnTHPYySCtYkEn4KB+T28uk0H8=", + "dev": true + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npm.taobao.org/semver/download/semver-6.3.0.tgz", + "integrity": "sha1-7gpkyK9ejO6mdoexM3YeG+y9HT0=", + "dev": true + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npm.taobao.org/strip-ansi/download/strip-ansi-5.2.0.tgz", + "integrity": "sha1-jJpTb+tq/JYr36WxBKUJHBrZwK4=", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + }, + "type-check": { + "version": "0.3.2", + "resolved": "https://registry.npm.taobao.org/type-check/download/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "dev": true, + "requires": { + "prelude-ls": "~1.1.2" + } + } + } + }, + "rollup-plugin-prettier": { + "version": "2.1.0", + "resolved": "https://registry.npm.taobao.org/rollup-plugin-prettier/download/rollup-plugin-prettier-2.1.0.tgz", + "integrity": "sha1-BrQhaeKMsjFj1GSL70EuV/9wrLQ=", + "dev": true, + "requires": { + "diff": "4.0.2", + "lodash.hasin": "4.5.2", + "lodash.isempty": "4.4.0", + "lodash.isnil": "4.0.0", + "lodash.omitby": "4.6.0", + "magic-string": "0.25.7" + } + }, + "rollup-plugin-size-snapshot": { + "version": "0.12.0", + "resolved": "https://registry.npm.taobao.org/rollup-plugin-size-snapshot/download/rollup-plugin-size-snapshot-0.12.0.tgz", + "integrity": "sha1-WJU0lK/SJBy16FY5LhI0FuKYAD8=", + "dev": true, + "requires": { + "@rollup/plugin-replace": "^2.3.2", + "acorn": "^7.2.0", + "bytes": "^3.1.0", + "chalk": "^4.0.0", + "gzip-size": "^5.1.1", + "jest-diff": "^26.0.1", + "memory-fs": "^0.5.0", + "terser": "^4.7.0", + "webpack": "^4.43.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npm.taobao.org/ansi-styles/download/ansi-styles-4.2.1.tgz", + "integrity": "sha1-kK51xCTQCNJiTFvynq0xd+v881k=", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/chalk/download/chalk-4.0.0.tgz", + "integrity": "sha1-bpgIHtLRf6q2FetSrGbsH+YgnnI=", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npm.taobao.org/color-convert/download/color-convert-2.0.1.tgz", + "integrity": "sha1-ctOmjVmMm9s68q0ehPIdiWq9TeM=", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npm.taobao.org/color-name/download/color-name-1.1.4.tgz", + "integrity": "sha1-wqCah6y95pVD3m9j+jmVyCbFNqI=", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/has-flag/download/has-flag-4.0.0.tgz", + "integrity": "sha1-lEdx/ZyByBJlxNaUGGDaBrtZR5s=", + "dev": true + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npm.taobao.org/supports-color/download/supports-color-7.1.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsupports-color%2Fdownload%2Fsupports-color-7.1.0.tgz", + "integrity": "sha1-aOMlkd9z4lrRxLSRCKLsUHliv9E=", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "rollup-plugin-terser": { + "version": "6.1.0", + "resolved": "https://registry.npm.taobao.org/rollup-plugin-terser/download/rollup-plugin-terser-6.1.0.tgz", + "integrity": "sha1-BxhmWFrqEEv7ud0QGaxSPmPIHkU=", + "dev": true, + "requires": { + "@babel/code-frame": "^7.8.3", + "jest-worker": "^26.0.0", + "serialize-javascript": "^3.0.0", + "terser": "^4.7.0" + } + }, + "rollup-pluginutils": { + "version": "2.8.2", + "resolved": "https://registry.npm.taobao.org/rollup-pluginutils/download/rollup-pluginutils-2.8.2.tgz", + "integrity": "sha1-cvKvB0i1kjZNvTOJ5gDlqURKNR4=", + "dev": true, + "requires": { + "estree-walker": "^0.6.1" + }, + "dependencies": { + "estree-walker": { + "version": "0.6.1", + "resolved": "https://registry.npm.taobao.org/estree-walker/download/estree-walker-0.6.1.tgz", + "integrity": "sha1-UwSRQ/QMbrkYsjZx0f4yGfOhs2I=", + "dev": true + } + } + }, + "rsvp": { + "version": "4.8.5", + "resolved": "https://registry.npm.taobao.org/rsvp/download/rsvp-4.8.5.tgz", + "integrity": "sha1-yPFVMR0Wf2jyHhaN9x7FsIMRNzQ=", + "dev": true + }, + "run-async": { + "version": "2.4.1", + "resolved": "https://registry.npm.taobao.org/run-async/download/run-async-2.4.1.tgz", + "integrity": "sha1-hEDsz5nqPnC9QJ1JqriOEMGJpFU=", + "dev": true + }, + "run-queue": { + "version": "1.0.3", + "resolved": "https://registry.npm.taobao.org/run-queue/download/run-queue-1.0.3.tgz", + "integrity": "sha1-6Eg5bwV9Ij8kOGkkYY4laUFh7Ec=", + "dev": true, + "requires": { + "aproba": "^1.1.1" + } + }, + "rxjs": { + "version": "6.5.5", + "resolved": "https://registry.npm.taobao.org/rxjs/download/rxjs-6.5.5.tgz", + "integrity": "sha1-xciE4wlMjP7jG/J+uH5UzPyH+ew=", + "dev": true, + "requires": { + "tslib": "^1.9.0" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npm.taobao.org/safe-buffer/download/safe-buffer-5.1.2.tgz?cache=0&sync_timestamp=1589129103371&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsafe-buffer%2Fdownload%2Fsafe-buffer-5.1.2.tgz", + "integrity": "sha1-mR7GnSluAxN0fVm9/St0XDX4go0=", + "dev": true + }, + "safe-regex": { + "version": "1.1.0", + "resolved": "https://registry.npm.taobao.org/safe-regex/download/safe-regex-1.1.0.tgz", + "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", + "dev": true, + "requires": { + "ret": "~0.1.10" + } + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npm.taobao.org/safer-buffer/download/safer-buffer-2.1.2.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsafer-buffer%2Fdownload%2Fsafer-buffer-2.1.2.tgz", + "integrity": "sha1-RPoWGwGHuVSd2Eu5GAL5vYOFzWo=", + "dev": true + }, + "sane": { + "version": "4.1.0", + "resolved": "https://registry.npm.taobao.org/sane/download/sane-4.1.0.tgz", + "integrity": "sha1-7Ygf2SJzOmxGG8GJ3CtsAG8//e0=", + "dev": true, + "requires": { + "@cnakazawa/watch": "^1.0.3", + "anymatch": "^2.0.0", + "capture-exit": "^2.0.0", + "exec-sh": "^0.3.2", + "execa": "^1.0.0", + "fb-watchman": "^2.0.0", + "micromatch": "^3.1.4", + "minimist": "^1.1.1", + "walker": "~1.0.5" + } + }, + "saxes": { + "version": "5.0.1", + "resolved": "https://registry.npm.taobao.org/saxes/download/saxes-5.0.1.tgz", + "integrity": "sha1-7rq5U/o7dgjb6U5drbFciI+maW0=", + "dev": true, + "requires": { + "xmlchars": "^2.2.0" + } + }, + "schema-utils": { + "version": "1.0.0", + "resolved": "https://registry.npm.taobao.org/schema-utils/download/schema-utils-1.0.0.tgz", + "integrity": "sha1-C3mpMgTXtgDUsoUNH2bCo0lRx3A=", + "dev": true, + "requires": { + "ajv": "^6.1.0", + "ajv-errors": "^1.0.0", + "ajv-keywords": "^3.1.0" + } + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npm.taobao.org/semver/download/semver-5.7.1.tgz", + "integrity": "sha1-qVT5Ma66UI0we78Gnv8MAclhFvc=", + "dev": true + }, + "serialize-javascript": { + "version": "3.1.0", + "resolved": "https://registry.npm.taobao.org/serialize-javascript/download/serialize-javascript-3.1.0.tgz?cache=0&sync_timestamp=1590665980012&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fserialize-javascript%2Fdownload%2Fserialize-javascript-3.1.0.tgz", + "integrity": "sha1-i/OpFwcSZk7yVhtEtpHq/jmSFOo=", + "dev": true, + "requires": { + "randombytes": "^2.1.0" + } + }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npm.taobao.org/set-blocking/download/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "dev": true + }, + "set-value": { + "version": "2.0.1", + "resolved": "https://registry.npm.taobao.org/set-value/download/set-value-2.0.1.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fset-value%2Fdownload%2Fset-value-2.0.1.tgz", + "integrity": "sha1-oY1AUw5vB95CKMfe/kInr4ytAFs=", + "dev": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npm.taobao.org/extend-shallow/download/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npm.taobao.org/setimmediate/download/setimmediate-1.0.5.tgz", + "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=", + "dev": true + }, + "sha.js": { + "version": "2.4.11", + "resolved": "https://registry.npm.taobao.org/sha.js/download/sha.js-2.4.11.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsha.js%2Fdownload%2Fsha.js-2.4.11.tgz", + "integrity": "sha1-N6XPC4HsvGlD3hCbopYNGyZYSuc=", + "dev": true, + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npm.taobao.org/shebang-command/download/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npm.taobao.org/shebang-regex/download/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true + }, + "shellwords": { + "version": "0.1.1", + "resolved": "https://registry.npm.taobao.org/shellwords/download/shellwords-0.1.1.tgz", + "integrity": "sha1-1rkYHBpI05cyTISHHvvPxz/AZUs=", + "dev": true, + "optional": true + }, + "signal-exit": { + "version": "3.0.3", + "resolved": "https://registry.npm.taobao.org/signal-exit/download/signal-exit-3.0.3.tgz", + "integrity": "sha1-oUEMLt2PB3sItOJTyOrPyvBXRhw=", + "dev": true + }, + "sisteransi": { + "version": "1.0.5", + "resolved": "https://registry.npm.taobao.org/sisteransi/download/sisteransi-1.0.5.tgz", + "integrity": "sha1-E01oEpd1ZDfMBcoBNw06elcQde0=", + "dev": true + }, + "slash": { + "version": "2.0.0", + "resolved": "https://registry.npm.taobao.org/slash/download/slash-2.0.0.tgz", + "integrity": "sha1-3lUoUaF1nfOo8gZTVEL17E3eq0Q=", + "dev": true + }, + "slice-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npm.taobao.org/slice-ansi/download/slice-ansi-2.1.0.tgz", + "integrity": "sha1-ys12k0YaY3pXiNkqfdT7oGjoFjY=", + "dev": true, + "requires": { + "ansi-styles": "^3.2.0", + "astral-regex": "^1.0.0", + "is-fullwidth-code-point": "^2.0.0" + }, + "dependencies": { + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npm.taobao.org/is-fullwidth-code-point/download/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + } + } + }, + "snapdragon": { + "version": "0.8.2", + "resolved": "https://registry.npm.taobao.org/snapdragon/download/snapdragon-0.8.2.tgz", + "integrity": "sha1-ZJIufFZbDhQgS6GqfWlkJ40lGC0=", + "dev": true, + "requires": { + "base": "^0.11.1", + "debug": "^2.2.0", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "map-cache": "^0.2.2", + "source-map": "^0.5.6", + "source-map-resolve": "^0.5.0", + "use": "^3.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npm.taobao.org/define-property/download/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npm.taobao.org/extend-shallow/download/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "snapdragon-node": { + "version": "2.1.1", + "resolved": "https://registry.npm.taobao.org/snapdragon-node/download/snapdragon-node-2.1.1.tgz", + "integrity": "sha1-bBdfhv8UvbByRWPo88GwIaKGhTs=", + "dev": true, + "requires": { + "define-property": "^1.0.0", + "isobject": "^3.0.0", + "snapdragon-util": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npm.taobao.org/define-property/download/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npm.taobao.org/is-accessor-descriptor/download/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha1-FpwvbT3x+ZJhgHI2XJsOofaHhlY=", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npm.taobao.org/is-data-descriptor/download/is-data-descriptor-1.0.0.tgz", + "integrity": "sha1-2Eh2Mh0Oet0DmQQGq7u9NrqSaMc=", + "dev": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npm.taobao.org/is-descriptor/download/is-descriptor-1.0.2.tgz", + "integrity": "sha1-OxWXRqZmBLBPjIFSS6NlxfFNhuw=", + "dev": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "snapdragon-util": { + "version": "3.0.1", + "resolved": "https://registry.npm.taobao.org/snapdragon-util/download/snapdragon-util-3.0.1.tgz", + "integrity": "sha1-+VZHlIbyrNeXAGk/b3uAXkWrVuI=", + "dev": true, + "requires": { + "kind-of": "^3.2.0" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npm.taobao.org/kind-of/download/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "source-list-map": { + "version": "2.0.1", + "resolved": "https://registry.npm.taobao.org/source-list-map/download/source-list-map-2.0.1.tgz", + "integrity": "sha1-OZO9hzv8SEecyp6jpUeDXHwVSzQ=", + "dev": true + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npm.taobao.org/source-map/download/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + }, + "source-map-resolve": { + "version": "0.5.3", + "resolved": "https://registry.npm.taobao.org/source-map-resolve/download/source-map-resolve-0.5.3.tgz?cache=0&sync_timestamp=1584829515586&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsource-map-resolve%2Fdownload%2Fsource-map-resolve-0.5.3.tgz", + "integrity": "sha1-GQhmvs51U+H48mei7oLGBrVQmho=", + "dev": true, + "requires": { + "atob": "^2.1.2", + "decode-uri-component": "^0.2.0", + "resolve-url": "^0.2.1", + "source-map-url": "^0.4.0", + "urix": "^0.1.0" + } + }, + "source-map-support": { + "version": "0.5.19", + "resolved": "https://registry.npm.taobao.org/source-map-support/download/source-map-support-0.5.19.tgz?cache=0&sync_timestamp=1587719289626&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsource-map-support%2Fdownload%2Fsource-map-support-0.5.19.tgz", + "integrity": "sha1-qYti+G3K9PZzmWSMCFKRq56P7WE=", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npm.taobao.org/source-map/download/source-map-0.6.1.tgz", + "integrity": "sha1-dHIq8y6WFOnCh6jQu95IteLxomM=", + "dev": true + } + } + }, + "source-map-url": { + "version": "0.4.0", + "resolved": "https://registry.npm.taobao.org/source-map-url/download/source-map-url-0.4.0.tgz", + "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", + "dev": true + }, + "sourcemap-codec": { + "version": "1.4.8", + "resolved": "https://registry.npm.taobao.org/sourcemap-codec/download/sourcemap-codec-1.4.8.tgz", + "integrity": "sha1-6oBL2UhXQC5pktBaOO8a41qatMQ=", + "dev": true + }, + "spdx-correct": { + "version": "3.1.1", + "resolved": "https://registry.npm.taobao.org/spdx-correct/download/spdx-correct-3.1.1.tgz?cache=0&sync_timestamp=1590162035755&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fspdx-correct%2Fdownload%2Fspdx-correct-3.1.1.tgz", + "integrity": "sha1-3s6BrJweZxPl99G28X1Gj6U9iak=", + "dev": true, + "requires": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.3.0", + "resolved": "https://registry.npm.taobao.org/spdx-exceptions/download/spdx-exceptions-2.3.0.tgz?cache=0&sync_timestamp=1587422410312&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fspdx-exceptions%2Fdownload%2Fspdx-exceptions-2.3.0.tgz", + "integrity": "sha1-PyjOGnegA3JoPq3kpDMYNSeiFj0=", + "dev": true + }, + "spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npm.taobao.org/spdx-expression-parse/download/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha1-z3D1BILu/cmOPOCmgz5KU87rpnk=", + "dev": true, + "requires": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.5", + "resolved": "https://registry.npm.taobao.org/spdx-license-ids/download/spdx-license-ids-3.0.5.tgz", + "integrity": "sha1-NpS1gEVnpFjTyARYQqY1hjL2JlQ=", + "dev": true + }, + "split-string": { + "version": "3.1.0", + "resolved": "https://registry.npm.taobao.org/split-string/download/split-string-3.1.0.tgz", + "integrity": "sha1-fLCd2jqGWFcFxks5pkZgOGguj+I=", + "dev": true, + "requires": { + "extend-shallow": "^3.0.0" + } + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npm.taobao.org/sprintf-js/download/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "sshpk": { + "version": "1.16.1", + "resolved": "https://registry.npm.taobao.org/sshpk/download/sshpk-1.16.1.tgz", + "integrity": "sha1-+2YcC+8ps520B2nuOfpwCT1vaHc=", + "dev": true, + "requires": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" + } + }, + "ssri": { + "version": "6.0.1", + "resolved": "https://registry.npm.taobao.org/ssri/download/ssri-6.0.1.tgz", + "integrity": "sha1-KjxBso3UW2K2Nnbst0ABJlrp7dg=", + "dev": true, + "requires": { + "figgy-pudding": "^3.5.1" + } + }, + "stack-utils": { + "version": "2.0.2", + "resolved": "https://registry.npm.taobao.org/stack-utils/download/stack-utils-2.0.2.tgz", + "integrity": "sha1-XPSLRVe+y0Y40LxPIdI/XRlYZZM=", + "dev": true, + "requires": { + "escape-string-regexp": "^2.0.0" + }, + "dependencies": { + "escape-string-regexp": { + "version": "2.0.0", + "resolved": "https://registry.npm.taobao.org/escape-string-regexp/download/escape-string-regexp-2.0.0.tgz?cache=0&sync_timestamp=1587627107924&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fescape-string-regexp%2Fdownload%2Fescape-string-regexp-2.0.0.tgz", + "integrity": "sha1-owME6Z2qMuI7L9IPUbq9B8/8o0Q=", + "dev": true + } + } + }, + "static-extend": { + "version": "0.1.2", + "resolved": "https://registry.npm.taobao.org/static-extend/download/static-extend-0.1.2.tgz", + "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", + "dev": true, + "requires": { + "define-property": "^0.2.5", + "object-copy": "^0.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npm.taobao.org/define-property/download/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "stealthy-require": { + "version": "1.1.1", + "resolved": "https://registry.npm.taobao.org/stealthy-require/download/stealthy-require-1.1.1.tgz", + "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=", + "dev": true + }, + "stream-browserify": { + "version": "2.0.2", + "resolved": "https://registry.npm.taobao.org/stream-browserify/download/stream-browserify-2.0.2.tgz?cache=0&sync_timestamp=1587041545531&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fstream-browserify%2Fdownload%2Fstream-browserify-2.0.2.tgz", + "integrity": "sha1-h1IdOKRKp+6RzhzSpH3wy0ndZgs=", + "dev": true, + "requires": { + "inherits": "~2.0.1", + "readable-stream": "^2.0.2" + } + }, + "stream-each": { + "version": "1.2.3", + "resolved": "https://registry.npm.taobao.org/stream-each/download/stream-each-1.2.3.tgz", + "integrity": "sha1-6+J6DDibBPvMIzZClS4Qcxr6m64=", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "stream-shift": "^1.0.0" + } + }, + "stream-http": { + "version": "2.8.3", + "resolved": "https://registry.npm.taobao.org/stream-http/download/stream-http-2.8.3.tgz", + "integrity": "sha1-stJCRpKIpaJ+xP6JM6z2I95lFPw=", + "dev": true, + "requires": { + "builtin-status-codes": "^3.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.3.6", + "to-arraybuffer": "^1.0.0", + "xtend": "^4.0.0" + } + }, + "stream-shift": { + "version": "1.0.1", + "resolved": "https://registry.npm.taobao.org/stream-shift/download/stream-shift-1.0.1.tgz", + "integrity": "sha1-1wiCgVWasneEJCebCHfaPDktWj0=", + "dev": true + }, + "string-length": { + "version": "4.0.1", + "resolved": "https://registry.npm.taobao.org/string-length/download/string-length-4.0.1.tgz", + "integrity": "sha1-Spc78x73fE7bzq3WryYRmWmF+KE=", + "dev": true, + "requires": { + "char-regex": "^1.0.2", + "strip-ansi": "^6.0.0" + } + }, + "string-width": { + "version": "4.2.0", + "resolved": "https://registry.npm.taobao.org/string-width/download/string-width-4.2.0.tgz?cache=0&sync_timestamp=1573488535785&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fstring-width%2Fdownload%2Fstring-width-4.2.0.tgz", + "integrity": "sha1-lSGCxGzHssMT0VluYjmSvRY7crU=", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npm.taobao.org/string_decoder/download/string_decoder-1.1.1.tgz", + "integrity": "sha1-nPFhG6YmhdcDCunkujQUnDrwP8g=", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npm.taobao.org/strip-ansi/download/strip-ansi-6.0.0.tgz", + "integrity": "sha1-CxVx3XZpzNTz4G4U7x7tJiJa5TI=", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + }, + "strip-bom": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/strip-bom/download/strip-bom-4.0.0.tgz", + "integrity": "sha1-nDUFwdtFvO3KPZz3oW9cWqOQGHg=", + "dev": true + }, + "strip-eof": { + "version": "1.0.0", + "resolved": "https://registry.npm.taobao.org/strip-eof/download/strip-eof-1.0.0.tgz", + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", + "dev": true + }, + "strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npm.taobao.org/strip-final-newline/download/strip-final-newline-2.0.0.tgz", + "integrity": "sha1-ibhS+y/L6Tb29LMYevsKEsGrWK0=", + "dev": true + }, + "strip-json-comments": { + "version": "3.1.0", + "resolved": "https://registry.npm.taobao.org/strip-json-comments/download/strip-json-comments-3.1.0.tgz?cache=0&sync_timestamp=1586159975241&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fstrip-json-comments%2Fdownload%2Fstrip-json-comments-3.1.0.tgz", + "integrity": "sha1-djjTFCISns9EV0QACfugP5+awYA=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npm.taobao.org/supports-color/download/supports-color-5.5.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsupports-color%2Fdownload%2Fsupports-color-5.5.0.tgz", + "integrity": "sha1-4uaaRKyHcveKHsCzW2id9lMO/I8=", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + }, + "supports-hyperlinks": { + "version": "2.1.0", + "resolved": "https://registry.npm.taobao.org/supports-hyperlinks/download/supports-hyperlinks-2.1.0.tgz", + "integrity": "sha1-9mPfJSr183xdSbvX7u+p4Lnlnkc=", + "dev": true, + "requires": { + "has-flag": "^4.0.0", + "supports-color": "^7.0.0" + }, + "dependencies": { + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/has-flag/download/has-flag-4.0.0.tgz", + "integrity": "sha1-lEdx/ZyByBJlxNaUGGDaBrtZR5s=", + "dev": true + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npm.taobao.org/supports-color/download/supports-color-7.1.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fsupports-color%2Fdownload%2Fsupports-color-7.1.0.tgz", + "integrity": "sha1-aOMlkd9z4lrRxLSRCKLsUHliv9E=", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "symbol-tree": { + "version": "3.2.4", + "resolved": "https://registry.npm.taobao.org/symbol-tree/download/symbol-tree-3.2.4.tgz", + "integrity": "sha1-QwY30ki6d+B4iDlR+5qg7tfGP6I=", + "dev": true + }, + "table": { + "version": "5.4.6", + "resolved": "https://registry.npm.taobao.org/table/download/table-5.4.6.tgz", + "integrity": "sha1-EpLRlQDOP4YFOwXw6Ofko7shB54=", + "dev": true, + "requires": { + "ajv": "^6.10.2", + "lodash": "^4.17.14", + "slice-ansi": "^2.1.0", + "string-width": "^3.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npm.taobao.org/ansi-regex/download/ansi-regex-4.1.0.tgz", + "integrity": "sha1-i5+PCM8ay4Q3Vqg5yox+MWjFGZc=", + "dev": true + }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npm.taobao.org/emoji-regex/download/emoji-regex-7.0.3.tgz?cache=0&sync_timestamp=1586511397703&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Femoji-regex%2Fdownload%2Femoji-regex-7.0.3.tgz", + "integrity": "sha1-kzoEBShgyF6DwSJHnEdIqOTHIVY=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npm.taobao.org/is-fullwidth-code-point/download/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npm.taobao.org/string-width/download/string-width-3.1.0.tgz?cache=0&sync_timestamp=1573488535785&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fstring-width%2Fdownload%2Fstring-width-3.1.0.tgz", + "integrity": "sha1-InZ74htirxCBV0MG9prFG2IgOWE=", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npm.taobao.org/strip-ansi/download/strip-ansi-5.2.0.tgz", + "integrity": "sha1-jJpTb+tq/JYr36WxBKUJHBrZwK4=", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } + } + }, + "tapable": { + "version": "1.1.3", + "resolved": "https://registry.npm.taobao.org/tapable/download/tapable-1.1.3.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftapable%2Fdownload%2Ftapable-1.1.3.tgz", + "integrity": "sha1-ofzMBrWNth/XpF2i2kT186Pme6I=", + "dev": true + }, + "terminal-link": { + "version": "2.1.1", + "resolved": "https://registry.npm.taobao.org/terminal-link/download/terminal-link-2.1.1.tgz", + "integrity": "sha1-FKZKJ6s8Dfkz6lRvulXy0HjtyZQ=", + "dev": true, + "requires": { + "ansi-escapes": "^4.2.1", + "supports-hyperlinks": "^2.0.0" + } + }, + "terser": { + "version": "4.7.0", + "resolved": "https://registry.npm.taobao.org/terser/download/terser-4.7.0.tgz", + "integrity": "sha1-FYUs8aCOMlaoBCjoZaL6iT/7oAY=", + "dev": true, + "requires": { + "commander": "^2.20.0", + "source-map": "~0.6.1", + "source-map-support": "~0.5.12" + }, + "dependencies": { + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npm.taobao.org/commander/download/commander-2.20.3.tgz", + "integrity": "sha1-/UhehMA+tIgcIHIrpIA16FMa6zM=", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npm.taobao.org/source-map/download/source-map-0.6.1.tgz", + "integrity": "sha1-dHIq8y6WFOnCh6jQu95IteLxomM=", + "dev": true + } + } + }, + "terser-webpack-plugin": { + "version": "1.4.4", + "resolved": "https://registry.npm.taobao.org/terser-webpack-plugin/download/terser-webpack-plugin-1.4.4.tgz?cache=0&sync_timestamp=1591189528067&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fterser-webpack-plugin%2Fdownload%2Fterser-webpack-plugin-1.4.4.tgz", + "integrity": "sha1-LGNUQ0cyS6r6mla6rd8WNMir/C8=", + "dev": true, + "requires": { + "cacache": "^12.0.2", + "find-cache-dir": "^2.1.0", + "is-wsl": "^1.1.0", + "schema-utils": "^1.0.0", + "serialize-javascript": "^3.1.0", + "source-map": "^0.6.1", + "terser": "^4.1.2", + "webpack-sources": "^1.4.0", + "worker-farm": "^1.7.0" + }, + "dependencies": { + "is-wsl": { + "version": "1.1.0", + "resolved": "https://registry.npm.taobao.org/is-wsl/download/is-wsl-1.1.0.tgz", + "integrity": "sha1-HxbkqiKwTRM2tmGIpmrzxgDDpm0=", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npm.taobao.org/source-map/download/source-map-0.6.1.tgz", + "integrity": "sha1-dHIq8y6WFOnCh6jQu95IteLxomM=", + "dev": true + } + } + }, + "test-exclude": { + "version": "6.0.0", + "resolved": "https://registry.npm.taobao.org/test-exclude/download/test-exclude-6.0.0.tgz", + "integrity": "sha1-BKhphmHYBepvopO2y55jrARO8V4=", + "dev": true, + "requires": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" + } + }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npm.taobao.org/text-table/download/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, + "throat": { + "version": "5.0.0", + "resolved": "https://registry.npm.taobao.org/throat/download/throat-5.0.0.tgz", + "integrity": "sha1-xRmSNYA6rRh1SmZ9ZZtecs4Wdks=", + "dev": true + }, + "through": { + "version": "2.3.8", + "resolved": "https://registry.npm.taobao.org/through/download/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "dev": true + }, + "through2": { + "version": "2.0.5", + "resolved": "https://registry.npm.taobao.org/through2/download/through2-2.0.5.tgz", + "integrity": "sha1-AcHjnrMdB8t9A6lqcIIyYLIxMs0=", + "dev": true, + "requires": { + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" + } + }, + "timers-browserify": { + "version": "2.0.11", + "resolved": "https://registry.npm.taobao.org/timers-browserify/download/timers-browserify-2.0.11.tgz", + "integrity": "sha1-gAsfPu4nLlvFPuRloE0OgEwxIR8=", + "dev": true, + "requires": { + "setimmediate": "^1.0.4" + } + }, + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npm.taobao.org/tmp/download/tmp-0.0.33.tgz", + "integrity": "sha1-bTQzWIl2jSGyvNoKonfO07G/rfk=", + "dev": true, + "requires": { + "os-tmpdir": "~1.0.2" + } + }, + "tmpl": { + "version": "1.0.4", + "resolved": "https://registry.npm.taobao.org/tmpl/download/tmpl-1.0.4.tgz", + "integrity": "sha1-I2QN17QtAEM5ERQIIOXPRA5SHdE=", + "dev": true + }, + "to-arraybuffer": { + "version": "1.0.1", + "resolved": "https://registry.npm.taobao.org/to-arraybuffer/download/to-arraybuffer-1.0.1.tgz", + "integrity": "sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M=", + "dev": true + }, + "to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npm.taobao.org/to-fast-properties/download/to-fast-properties-2.0.0.tgz?cache=0&sync_timestamp=1580550317222&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fto-fast-properties%2Fdownload%2Fto-fast-properties-2.0.0.tgz", + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "dev": true + }, + "to-object-path": { + "version": "0.3.0", + "resolved": "https://registry.npm.taobao.org/to-object-path/download/to-object-path-0.3.0.tgz", + "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", + "dev": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npm.taobao.org/kind-of/download/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "to-regex": { + "version": "3.0.2", + "resolved": "https://registry.npm.taobao.org/to-regex/download/to-regex-3.0.2.tgz", + "integrity": "sha1-E8/dmzNlUvMLUfM6iuG0Knp1mc4=", + "dev": true, + "requires": { + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "regex-not": "^1.0.2", + "safe-regex": "^1.1.0" + } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npm.taobao.org/to-regex-range/download/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + } + }, + "tough-cookie": { + "version": "3.0.1", + "resolved": "https://registry.npm.taobao.org/tough-cookie/download/tough-cookie-3.0.1.tgz", + "integrity": "sha1-nfT1fnOcJpMKAYGEiH9K233Kc7I=", + "dev": true, + "requires": { + "ip-regex": "^2.1.0", + "psl": "^1.1.28", + "punycode": "^2.1.1" + } + }, + "tr46": { + "version": "2.0.2", + "resolved": "https://registry.npm.taobao.org/tr46/download/tr46-2.0.2.tgz", + "integrity": "sha1-Ayc1ht7xWVrgj+2zjXczzukdJHk=", + "dev": true, + "requires": { + "punycode": "^2.1.1" + } + }, + "tslib": { + "version": "1.13.0", + "resolved": "https://registry.npm.taobao.org/tslib/download/tslib-1.13.0.tgz", + "integrity": "sha1-yIHhPMcBWJTtkUhi0nZDb6mkcEM=", + "dev": true + }, + "tsutils": { + "version": "3.17.1", + "resolved": "https://registry.npm.taobao.org/tsutils/download/tsutils-3.17.1.tgz", + "integrity": "sha1-7XGZF/EcoN7lhicrKsSeAVot11k=", + "dev": true, + "requires": { + "tslib": "^1.8.1" + } + }, + "tty-browserify": { + "version": "0.0.0", + "resolved": "https://registry.npm.taobao.org/tty-browserify/download/tty-browserify-0.0.0.tgz", + "integrity": "sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=", + "dev": true + }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npm.taobao.org/tunnel-agent/download/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "dev": true, + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npm.taobao.org/tweetnacl/download/tweetnacl-0.14.5.tgz?cache=0&sync_timestamp=1581364252466&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ftweetnacl%2Fdownload%2Ftweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "dev": true + }, + "type-check": { + "version": "0.4.0", + "resolved": "https://registry.npm.taobao.org/type-check/download/type-check-0.4.0.tgz", + "integrity": "sha1-B7ggO/pwVsBlcFDjzNLDdzC6uPE=", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1" + } + }, + "type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npm.taobao.org/type-detect/download/type-detect-4.0.8.tgz", + "integrity": "sha1-dkb7XxiHHPu3dJ5pvTmmOI63RQw=", + "dev": true + }, + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npm.taobao.org/type-fest/download/type-fest-0.8.1.tgz", + "integrity": "sha1-CeJJ696FHTseSNJ8EFREZn8XuD0=", + "dev": true + }, + "typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npm.taobao.org/typedarray/download/typedarray-0.0.6.tgz", + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", + "dev": true + }, + "typedarray-to-buffer": { + "version": "3.1.5", + "resolved": "https://registry.npm.taobao.org/typedarray-to-buffer/download/typedarray-to-buffer-3.1.5.tgz", + "integrity": "sha1-qX7nqf9CaRufeD/xvFES/j/KkIA=", + "dev": true, + "requires": { + "is-typedarray": "^1.0.0" + } + }, + "unicode-canonical-property-names-ecmascript": { + "version": "1.0.4", + "resolved": "https://registry.npm.taobao.org/unicode-canonical-property-names-ecmascript/download/unicode-canonical-property-names-ecmascript-1.0.4.tgz", + "integrity": "sha1-JhmADEyCWADv3YNDr33Zkzy+KBg=", + "dev": true + }, + "unicode-match-property-ecmascript": { + "version": "1.0.4", + "resolved": "https://registry.npm.taobao.org/unicode-match-property-ecmascript/download/unicode-match-property-ecmascript-1.0.4.tgz", + "integrity": "sha1-jtKjJWmWG86SJ9Cc0/+7j+1fAgw=", + "dev": true, + "requires": { + "unicode-canonical-property-names-ecmascript": "^1.0.4", + "unicode-property-aliases-ecmascript": "^1.0.4" + } + }, + "unicode-match-property-value-ecmascript": { + "version": "1.2.0", + "resolved": "https://registry.npm.taobao.org/unicode-match-property-value-ecmascript/download/unicode-match-property-value-ecmascript-1.2.0.tgz?cache=0&sync_timestamp=1583949910462&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Funicode-match-property-value-ecmascript%2Fdownload%2Funicode-match-property-value-ecmascript-1.2.0.tgz", + "integrity": "sha1-DZH2AO7rMJaqlisdb8iIduZOpTE=", + "dev": true + }, + "unicode-property-aliases-ecmascript": { + "version": "1.1.0", + "resolved": "https://registry.npm.taobao.org/unicode-property-aliases-ecmascript/download/unicode-property-aliases-ecmascript-1.1.0.tgz?cache=0&sync_timestamp=1583946096584&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Funicode-property-aliases-ecmascript%2Fdownload%2Funicode-property-aliases-ecmascript-1.1.0.tgz", + "integrity": "sha1-3Vepn2IHvt/0Yoq++5TFDblByPQ=", + "dev": true + }, + "union-value": { + "version": "1.0.1", + "resolved": "https://registry.npm.taobao.org/union-value/download/union-value-1.0.1.tgz", + "integrity": "sha1-C2/nuDWuzaYcbqTU8CwUIh4QmEc=", + "dev": true, + "requires": { + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^2.0.1" + } + }, + "unique-filename": { + "version": "1.1.1", + "resolved": "https://registry.npm.taobao.org/unique-filename/download/unique-filename-1.1.1.tgz", + "integrity": "sha1-HWl2k2mtoFgxA6HmrodoG1ZXMjA=", + "dev": true, + "requires": { + "unique-slug": "^2.0.0" + } + }, + "unique-slug": { + "version": "2.0.2", + "resolved": "https://registry.npm.taobao.org/unique-slug/download/unique-slug-2.0.2.tgz", + "integrity": "sha1-uqvOkQg/xk6UWw861hPiZPfNTmw=", + "dev": true, + "requires": { + "imurmurhash": "^0.1.4" + } + }, + "unset-value": { + "version": "1.0.0", + "resolved": "https://registry.npm.taobao.org/unset-value/download/unset-value-1.0.0.tgz", + "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", + "dev": true, + "requires": { + "has-value": "^0.3.1", + "isobject": "^3.0.0" + }, + "dependencies": { + "has-value": { + "version": "0.3.1", + "resolved": "https://registry.npm.taobao.org/has-value/download/has-value-0.3.1.tgz", + "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", + "dev": true, + "requires": { + "get-value": "^2.0.3", + "has-values": "^0.1.4", + "isobject": "^2.0.0" + }, + "dependencies": { + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npm.taobao.org/isobject/download/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "requires": { + "isarray": "1.0.0" + } + } + } + }, + "has-values": { + "version": "0.1.4", + "resolved": "https://registry.npm.taobao.org/has-values/download/has-values-0.1.4.tgz", + "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", + "dev": true + } + } + }, + "upath": { + "version": "1.2.0", + "resolved": "https://registry.npm.taobao.org/upath/download/upath-1.2.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fupath%2Fdownload%2Fupath-1.2.0.tgz", + "integrity": "sha1-j2bbzVWog6za5ECK+LA1pQRMGJQ=", + "dev": true, + "optional": true + }, + "uri-js": { + "version": "4.2.2", + "resolved": "https://registry.npm.taobao.org/uri-js/download/uri-js-4.2.2.tgz", + "integrity": "sha1-lMVA4f93KVbiKZUHwBCupsiDjrA=", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, + "urix": { + "version": "0.1.0", + "resolved": "https://registry.npm.taobao.org/urix/download/urix-0.1.0.tgz", + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", + "dev": true + }, + "url": { + "version": "0.11.0", + "resolved": "https://registry.npm.taobao.org/url/download/url-0.11.0.tgz", + "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", + "dev": true, + "requires": { + "punycode": "1.3.2", + "querystring": "0.2.0" + }, + "dependencies": { + "punycode": { + "version": "1.3.2", + "resolved": "https://registry.npm.taobao.org/punycode/download/punycode-1.3.2.tgz", + "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=", + "dev": true + } + } + }, + "use": { + "version": "3.1.1", + "resolved": "https://registry.npm.taobao.org/use/download/use-3.1.1.tgz", + "integrity": "sha1-1QyMrHmhn7wg8pEfVuuXP04QBw8=", + "dev": true + }, + "util": { + "version": "0.11.1", + "resolved": "https://registry.npm.taobao.org/util/download/util-0.11.1.tgz", + "integrity": "sha1-MjZzNyDsZLsn9uJvQhqqLhtYjWE=", + "dev": true, + "requires": { + "inherits": "2.0.3" + }, + "dependencies": { + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npm.taobao.org/inherits/download/inherits-2.0.3.tgz?cache=0&sync_timestamp=1560975547815&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Finherits%2Fdownload%2Finherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + } + } + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npm.taobao.org/util-deprecate/download/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true + }, + "uuid": { + "version": "7.0.3", + "resolved": "https://registry.npm.taobao.org/uuid/download/uuid-7.0.3.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fuuid%2Fdownload%2Fuuid-7.0.3.tgz", + "integrity": "sha1-xcnyyM8l3Ao3LE3xRBxB9b0MaAs=", + "dev": true, + "optional": true + }, + "v8-compile-cache": { + "version": "2.1.1", + "resolved": "https://registry.npm.taobao.org/v8-compile-cache/download/v8-compile-cache-2.1.1.tgz", + "integrity": "sha1-VLw83UMxe8qR413K8wWxpyN950U=", + "dev": true + }, + "v8-to-istanbul": { + "version": "4.1.4", + "resolved": "https://registry.npm.taobao.org/v8-to-istanbul/download/v8-to-istanbul-4.1.4.tgz?cache=0&sync_timestamp=1588807592994&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fv8-to-istanbul%2Fdownload%2Fv8-to-istanbul-4.1.4.tgz", + "integrity": "sha1-uXk28hwOLZmW1JheXFFW6dTknNY=", + "dev": true, + "requires": { + "@types/istanbul-lib-coverage": "^2.0.1", + "convert-source-map": "^1.6.0", + "source-map": "^0.7.3" + }, + "dependencies": { + "source-map": { + "version": "0.7.3", + "resolved": "https://registry.npm.taobao.org/source-map/download/source-map-0.7.3.tgz", + "integrity": "sha1-UwL4FpAxc1ImVECS5kmB91F1A4M=", + "dev": true + } + } + }, + "validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npm.taobao.org/validate-npm-package-license/download/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha1-/JH2uce6FchX9MssXe/uw51PQQo=", + "dev": true, + "requires": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "verror": { + "version": "1.10.0", + "resolved": "https://registry.npm.taobao.org/verror/download/verror-1.10.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fverror%2Fdownload%2Fverror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + } + }, + "vm-browserify": { + "version": "1.1.2", + "resolved": "https://registry.npm.taobao.org/vm-browserify/download/vm-browserify-1.1.2.tgz?cache=0&sync_timestamp=1572870772154&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fvm-browserify%2Fdownload%2Fvm-browserify-1.1.2.tgz", + "integrity": "sha1-eGQcSIuObKkadfUR56OzKobl3aA=", + "dev": true + }, + "w3c-hr-time": { + "version": "1.0.2", + "resolved": "https://registry.npm.taobao.org/w3c-hr-time/download/w3c-hr-time-1.0.2.tgz", + "integrity": "sha1-ConN9cwVgi35w2BUNnaWPgzDCM0=", + "dev": true, + "requires": { + "browser-process-hrtime": "^1.0.0" + } + }, + "w3c-xmlserializer": { + "version": "2.0.0", + "resolved": "https://registry.npm.taobao.org/w3c-xmlserializer/download/w3c-xmlserializer-2.0.0.tgz", + "integrity": "sha1-PnEEoFt1FGzGD1ZDgLf2g6zxAgo=", + "dev": true, + "requires": { + "xml-name-validator": "^3.0.0" + } + }, + "walker": { + "version": "1.0.7", + "resolved": "https://registry.npm.taobao.org/walker/download/walker-1.0.7.tgz", + "integrity": "sha1-L3+bj9ENZ3JisYqITijRlhjgKPs=", + "dev": true, + "requires": { + "makeerror": "1.0.x" + } + }, + "watchpack": { + "version": "1.7.2", + "resolved": "https://registry.npm.taobao.org/watchpack/download/watchpack-1.7.2.tgz", + "integrity": "sha1-wC5NTUmRPD5+EiwzJTZa+dMx6ao=", + "dev": true, + "requires": { + "chokidar": "^3.4.0", + "graceful-fs": "^4.1.2", + "neo-async": "^2.5.0", + "watchpack-chokidar2": "^2.0.0" + }, + "dependencies": { + "anymatch": { + "version": "3.1.1", + "resolved": "https://registry.npm.taobao.org/anymatch/download/anymatch-3.1.1.tgz", + "integrity": "sha1-xV7PAhheJGklk5kxDBc84xIzsUI=", + "dev": true, + "optional": true, + "requires": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + } + }, + "binary-extensions": { + "version": "2.0.0", + "resolved": "https://registry.npm.taobao.org/binary-extensions/download/binary-extensions-2.0.0.tgz", + "integrity": "sha1-I8DfFPaogHf1+YbA0WfsA8PVU3w=", + "dev": true, + "optional": true + }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npm.taobao.org/braces/download/braces-3.0.2.tgz", + "integrity": "sha1-NFThpGLujVmeI23zNs2epPiv4Qc=", + "dev": true, + "optional": true, + "requires": { + "fill-range": "^7.0.1" + } + }, + "chokidar": { + "version": "3.4.0", + "resolved": "https://registry.npm.taobao.org/chokidar/download/chokidar-3.4.0.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fchokidar%2Fdownload%2Fchokidar-3.4.0.tgz", + "integrity": "sha1-swYRQjzjdjV8dlubj5BLn7o8C+g=", + "dev": true, + "optional": true, + "requires": { + "anymatch": "~3.1.1", + "braces": "~3.0.2", + "fsevents": "~2.1.2", + "glob-parent": "~5.1.0", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.4.0" + } + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npm.taobao.org/fill-range/download/fill-range-7.0.1.tgz", + "integrity": "sha1-GRmmp8df44ssfHflGYU12prN2kA=", + "dev": true, + "optional": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "fsevents": { + "version": "2.1.3", + "resolved": "https://registry.npm.taobao.org/fsevents/download/fsevents-2.1.3.tgz", + "integrity": "sha1-+3OHA66NL5/pAMM4Nt3r7ouX8j4=", + "dev": true, + "optional": true + }, + "glob-parent": { + "version": "5.1.1", + "resolved": "https://registry.npm.taobao.org/glob-parent/download/glob-parent-5.1.1.tgz", + "integrity": "sha1-tsHvQXxOVmPqSY8cRa+saRa7wik=", + "dev": true, + "optional": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npm.taobao.org/is-binary-path/download/is-binary-path-2.1.0.tgz", + "integrity": "sha1-6h9/O4DwZCNug0cPhsCcJU+0Wwk=", + "dev": true, + "optional": true, + "requires": { + "binary-extensions": "^2.0.0" + } + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npm.taobao.org/is-number/download/is-number-7.0.0.tgz", + "integrity": "sha1-dTU0W4lnNNX4DE0GxQlVUnoU8Ss=", + "dev": true, + "optional": true + }, + "readdirp": { + "version": "3.4.0", + "resolved": "https://registry.npm.taobao.org/readdirp/download/readdirp-3.4.0.tgz", + "integrity": "sha1-n9zN+ekVWAVEkiGsZF6DA6tbmto=", + "dev": true, + "optional": true, + "requires": { + "picomatch": "^2.2.1" + } + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npm.taobao.org/to-regex-range/download/to-regex-range-5.0.1.tgz", + "integrity": "sha1-FkjESq58jZiKMmAY7XL1tN0DkuQ=", + "dev": true, + "optional": true, + "requires": { + "is-number": "^7.0.0" + } + } + } + }, + "watchpack-chokidar2": { + "version": "2.0.0", + "resolved": "https://registry.npm.taobao.org/watchpack-chokidar2/download/watchpack-chokidar2-2.0.0.tgz", + "integrity": "sha1-mUihhmy71suCTeoTp+1pH2yN3/A=", + "dev": true, + "optional": true, + "requires": { + "chokidar": "^2.1.8" + } + }, + "webidl-conversions": { + "version": "6.1.0", + "resolved": "https://registry.npm.taobao.org/webidl-conversions/download/webidl-conversions-6.1.0.tgz", + "integrity": "sha1-kRG01+qArNQPUnDWZmIa+ni2lRQ=", + "dev": true + }, + "webpack": { + "version": "4.43.0", + "resolved": "https://registry.npm.taobao.org/webpack/download/webpack-4.43.0.tgz", + "integrity": "sha1-xIVHsR1WMiTFYdrRFyyKoLimeOY=", + "dev": true, + "requires": { + "@webassemblyjs/ast": "1.9.0", + "@webassemblyjs/helper-module-context": "1.9.0", + "@webassemblyjs/wasm-edit": "1.9.0", + "@webassemblyjs/wasm-parser": "1.9.0", + "acorn": "^6.4.1", + "ajv": "^6.10.2", + "ajv-keywords": "^3.4.1", + "chrome-trace-event": "^1.0.2", + "enhanced-resolve": "^4.1.0", + "eslint-scope": "^4.0.3", + "json-parse-better-errors": "^1.0.2", + "loader-runner": "^2.4.0", + "loader-utils": "^1.2.3", + "memory-fs": "^0.4.1", + "micromatch": "^3.1.10", + "mkdirp": "^0.5.3", + "neo-async": "^2.6.1", + "node-libs-browser": "^2.2.1", + "schema-utils": "^1.0.0", + "tapable": "^1.1.3", + "terser-webpack-plugin": "^1.4.3", + "watchpack": "^1.6.1", + "webpack-sources": "^1.4.1" + }, + "dependencies": { + "acorn": { + "version": "6.4.1", + "resolved": "https://registry.npm.taobao.org/acorn/download/acorn-6.4.1.tgz", + "integrity": "sha1-Ux5Yuj9RudrLmmZGyk3r9bFMpHQ=", + "dev": true + }, + "eslint-scope": { + "version": "4.0.3", + "resolved": "https://registry.npm.taobao.org/eslint-scope/download/eslint-scope-4.0.3.tgz", + "integrity": "sha1-ygODMxD2iJoyZHgaqC5j65z+eEg=", + "dev": true, + "requires": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + } + }, + "memory-fs": { + "version": "0.4.1", + "resolved": "https://registry.npm.taobao.org/memory-fs/download/memory-fs-0.4.1.tgz?cache=0&sync_timestamp=1570537491040&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fmemory-fs%2Fdownload%2Fmemory-fs-0.4.1.tgz", + "integrity": "sha1-OpoguEYlI+RHz7x+i7gO1me/xVI=", + "dev": true, + "requires": { + "errno": "^0.1.3", + "readable-stream": "^2.0.1" + } + } + } + }, + "webpack-sources": { + "version": "1.4.3", + "resolved": "https://registry.npm.taobao.org/webpack-sources/download/webpack-sources-1.4.3.tgz", + "integrity": "sha1-7t2OwLko+/HL/plOItLYkPMwqTM=", + "dev": true, + "requires": { + "source-list-map": "^2.0.0", + "source-map": "~0.6.1" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npm.taobao.org/source-map/download/source-map-0.6.1.tgz", + "integrity": "sha1-dHIq8y6WFOnCh6jQu95IteLxomM=", + "dev": true + } + } + }, + "whatwg-encoding": { + "version": "1.0.5", + "resolved": "https://registry.npm.taobao.org/whatwg-encoding/download/whatwg-encoding-1.0.5.tgz", + "integrity": "sha1-WrrPd3wyFmpR0IXWtPPn0nET3bA=", + "dev": true, + "requires": { + "iconv-lite": "0.4.24" + } + }, + "whatwg-mimetype": { + "version": "2.3.0", + "resolved": "https://registry.npm.taobao.org/whatwg-mimetype/download/whatwg-mimetype-2.3.0.tgz", + "integrity": "sha1-PUseAxLSB5h5+Cav8Y2+7KWWD78=", + "dev": true + }, + "whatwg-url": { + "version": "8.1.0", + "resolved": "https://registry.npm.taobao.org/whatwg-url/download/whatwg-url-8.1.0.tgz?cache=0&sync_timestamp=1588965133257&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fwhatwg-url%2Fdownload%2Fwhatwg-url-8.1.0.tgz", + "integrity": "sha1-xiis3PRbgidM5yge4x3TyDl5F3E=", + "dev": true, + "requires": { + "lodash.sortby": "^4.7.0", + "tr46": "^2.0.2", + "webidl-conversions": "^5.0.0" + }, + "dependencies": { + "webidl-conversions": { + "version": "5.0.0", + "resolved": "https://registry.npm.taobao.org/webidl-conversions/download/webidl-conversions-5.0.0.tgz", + "integrity": "sha1-rlnIoAsSFUOirMZcBDT1ew/BGv8=", + "dev": true + } + } + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npm.taobao.org/which/download/which-2.0.2.tgz?cache=0&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fwhich%2Fdownload%2Fwhich-2.0.2.tgz", + "integrity": "sha1-fGqN0KY2oDJ+ELWckobu6T8/UbE=", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "which-module": { + "version": "2.0.0", + "resolved": "https://registry.npm.taobao.org/which-module/download/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "dev": true + }, + "word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npm.taobao.org/word-wrap/download/word-wrap-1.2.3.tgz", + "integrity": "sha1-YQY29rH3A4kb00dxzLF/uTtHB5w=", + "dev": true + }, + "worker-farm": { + "version": "1.7.0", + "resolved": "https://registry.npm.taobao.org/worker-farm/download/worker-farm-1.7.0.tgz", + "integrity": "sha1-JqlMU5G7ypJhUgAvabhKS/dy5ag=", + "dev": true, + "requires": { + "errno": "~0.1.7" + } + }, + "wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npm.taobao.org/wrap-ansi/download/wrap-ansi-6.2.0.tgz", + "integrity": "sha1-6Tk7oHEC5skaOyIUePAlfNKFblM=", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npm.taobao.org/ansi-styles/download/ansi-styles-4.2.1.tgz", + "integrity": "sha1-kK51xCTQCNJiTFvynq0xd+v881k=", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npm.taobao.org/color-convert/download/color-convert-2.0.1.tgz", + "integrity": "sha1-ctOmjVmMm9s68q0ehPIdiWq9TeM=", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npm.taobao.org/color-name/download/color-name-1.1.4.tgz", + "integrity": "sha1-wqCah6y95pVD3m9j+jmVyCbFNqI=", + "dev": true + } + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npm.taobao.org/wrappy/download/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "write": { + "version": "1.0.3", + "resolved": "https://registry.npm.taobao.org/write/download/write-1.0.3.tgz", + "integrity": "sha1-CADhRSO5I6OH5BUSPIZWFqrg9cM=", + "dev": true, + "requires": { + "mkdirp": "^0.5.1" + } + }, + "write-file-atomic": { + "version": "3.0.3", + "resolved": "https://registry.npm.taobao.org/write-file-atomic/download/write-file-atomic-3.0.3.tgz", + "integrity": "sha1-Vr1cWlxwSBzRnFcb05q5ZaXeVug=", + "dev": true, + "requires": { + "imurmurhash": "^0.1.4", + "is-typedarray": "^1.0.0", + "signal-exit": "^3.0.2", + "typedarray-to-buffer": "^3.1.5" + } + }, + "ws": { + "version": "7.3.0", + "resolved": "https://registry.npm.taobao.org/ws/download/ws-7.3.0.tgz", + "integrity": "sha1-Sy9/IZs9Nze8Gi+/FF2CW5TTj/0=", + "dev": true + }, + "xml-name-validator": { + "version": "3.0.0", + "resolved": "https://registry.npm.taobao.org/xml-name-validator/download/xml-name-validator-3.0.0.tgz", + "integrity": "sha1-auc+Bt5NjG5H+fsYH3jWSK1FfGo=", + "dev": true + }, + "xmlchars": { + "version": "2.2.0", + "resolved": "https://registry.npm.taobao.org/xmlchars/download/xmlchars-2.2.0.tgz", + "integrity": "sha1-Bg/hvLf5x2/ioX24apvDq4lCEMs=", + "dev": true + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npm.taobao.org/xtend/download/xtend-4.0.2.tgz", + "integrity": "sha1-u3J3n1+kZRhrH0OPZ0+jR/2121Q=", + "dev": true + }, + "y18n": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/y18n/download/y18n-4.0.0.tgz", + "integrity": "sha1-le+U+F7MgdAHwmThkKEg8KPIVms=", + "dev": true + }, + "yallist": { + "version": "3.1.1", + "resolved": "https://registry.npm.taobao.org/yallist/download/yallist-3.1.1.tgz", + "integrity": "sha1-27fa+b/YusmrRev2ArjLrQ1dCP0=", + "dev": true + }, + "yargs": { + "version": "15.3.1", + "resolved": "https://registry.npm.taobao.org/yargs/download/yargs-15.3.1.tgz", + "integrity": "sha1-lQW0cnY5Y+VK/mAUitJ6MwgY6Ys=", + "dev": true, + "requires": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.1" + }, + "dependencies": { + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npm.taobao.org/find-up/download/find-up-4.1.0.tgz", + "integrity": "sha1-l6/n1s3AvFkoWEt8jXsW6KmqXRk=", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npm.taobao.org/locate-path/download/locate-path-5.0.0.tgz", + "integrity": "sha1-Gvujlq/WdqbUJQTQpno6frn2KqA=", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npm.taobao.org/p-limit/download/p-limit-2.3.0.tgz?cache=0&sync_timestamp=1591460606987&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fp-limit%2Fdownload%2Fp-limit-2.3.0.tgz", + "integrity": "sha1-PdM8ZHohT9//2DWTPrCG2g3CHbE=", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npm.taobao.org/p-locate/download/p-locate-4.1.0.tgz", + "integrity": "sha1-o0KLtwiLOmApL2aRkni3wpetTwc=", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npm.taobao.org/p-try/download/p-try-2.2.0.tgz", + "integrity": "sha1-yyhoVA4xPWHeWPr741zpAE1VQOY=", + "dev": true + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npm.taobao.org/path-exists/download/path-exists-4.0.0.tgz", + "integrity": "sha1-UTvb4tO5XXdi6METfvoZXGxhtbM=", + "dev": true + } + } + }, + "yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npm.taobao.org/yargs-parser/download/yargs-parser-18.1.3.tgz", + "integrity": "sha1-vmjEl1xrKr9GkjawyHA2L6sJp7A=", + "dev": true, + "requires": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + } + } + } +} diff --git a/packages/runtime-core/package.json b/packages/runtime-core/package.json new file mode 100755 index 0000000..b9d2f6b --- /dev/null +++ b/packages/runtime-core/package.json @@ -0,0 +1,33 @@ +{ + "name": "runtime-core", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "build": "node scripts/build.js", + "test": "jest" + }, + "keywords": [], + "author": "", + "license": "ISC", + "devDependencies": { + "@babel/cli": "^7.10.1", + "@babel/core": "^7.10.2", + "@babel/preset-env": "^7.10.2", + "@rollup/plugin-commonjs": "^13.0.0", + "@rollup/plugin-node-resolve": "^8.0.1", + "@rollup/plugin-strip": "^1.3.3", + "babel-jest": "^26.0.1", + "eslint": "^7.2.0", + "eslint-config-google": "^0.14.0", + "eslint-plugin-jest": "^23.13.2", + "jest": "^26.0.1", + "prettier": "^2.0.5", + "rollup": "^2.14.0", + "rollup-plugin-babel": "^4.4.0", + "rollup-plugin-eslint": "^7.0.0", + "rollup-plugin-prettier": "^2.1.0", + "rollup-plugin-size-snapshot": "^0.12.0", + "rollup-plugin-terser": "^6.1.0" + } +} diff --git a/packages/runtime-core/scripts/build.js b/packages/runtime-core/scripts/build.js new file mode 100755 index 0000000..db77537 --- /dev/null +++ b/packages/runtime-core/scripts/build.js @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2020 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. + */ +const configs = require('./configs'); +const rollup = require('rollup'); + +configs.forEach(async function(config) { + const { output: outputOptions, ...inputOption } = config; + const bundle = await rollup.rollup(inputOption); + + if (!Array.isArray(outputOptions)) { + outputOptions = [outputOptions]; + } + + for (const outputOption of outputOptions) { + await bundle.write(outputOption); + } +}); diff --git a/packages/runtime-core/scripts/configs.js b/packages/runtime-core/scripts/configs.js new file mode 100755 index 0000000..12081aa --- /dev/null +++ b/packages/runtime-core/scripts/configs.js @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2020 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. + */ +const babel = require('rollup-plugin-babel'); +const commonjs = require('@rollup/plugin-commonjs'); +const { eslint } = require('rollup-plugin-eslint'); +const prettier = require('rollup-plugin-prettier'); +const { nodeResolve } = require('@rollup/plugin-node-resolve'); +const { sizeSnapshot } = require('rollup-plugin-size-snapshot'); +const strip = require('@rollup/plugin-strip'); +const { terser } = require('rollup-plugin-terser'); + +const format = 'umd'; +const name = 'ViewModel'; +const input = 'src/index.js'; +const extensions = ['.js']; +const exclude = 'node_modules/**'; +const beautifyPlugins = [prettier({ parser: 'babel' }), sizeSnapshot()]; +const minimizePlugins = [terser(), sizeSnapshot()]; + +const banner = `/* +* Copyright (c) 2020 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. +*/`; + +module.exports = [ + { + input, + plugins: [ + eslint({ fix: true }), + strip({ functions: ['startTracing', 'stopTracing'] }), + nodeResolve({ extensions }), + commonjs(), + babel({ exclude, extensions }), + ], + output: [ + { + name, + banner, + format, + file: 'build/framework.js', + plugins: beautifyPlugins, + }, + { + name, + banner, + format, + file: 'build/framework.min.js', + plugins: minimizePlugins, + }, + ], + }, + { + input, + plugins: [ + eslint({ fix: true }), + nodeResolve({ extensions }), + commonjs(), + babel({ exclude, extensions }), + ], + output: [ + { + name, + banner, + format, + file: 'build/framework-dev.js', + plugins: beautifyPlugins, + }, + { + name, + banner, + format, + file: 'build/framework-dev.min.js', + plugins: minimizePlugins, + }, + ], + }, +]; diff --git a/packages/runtime-core/src/__test__/index.test.js b/packages/runtime-core/src/__test__/index.test.js new file mode 100755 index 0000000..a318693 --- /dev/null +++ b/packages/runtime-core/src/__test__/index.test.js @@ -0,0 +1,350 @@ +/* + * Copyright (c) 2020 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 ViewModel from '..'; + +describe('ViewModel', () => { + test('01_proxy_data', () => { + const options = { data: { count: 1 } }; + const vm = new ViewModel(options); + expect(vm.count).toBe(options.data.count); + vm.count = 2; + expect(options.data.count).toBe(2); + }); + test('02_data_type', () => { + const as1 = new ViewModel({ data: { count: 1 } }); + const as2 = new ViewModel({ + data() { + return { count: 2 }; + }, + }); + expect(as1.count).toBe(1); + expect(as2.count).toBe(2); + }); + test('03_handler', () => { + const vm = new ViewModel({ + data() { + return { count: 1 }; + }, + increase() { + ++this.count; + }, + decrease() { + --this.count; + }, + }); + expect(typeof vm.increase).toBe('function'); + expect(typeof vm.decrease).toBe('function'); + vm.increase(); + expect(vm.count).toBe(2); + vm.decrease(); + expect(vm.count).toBe(1); + }); + test('04_watch_basic_usage', (done) => { + const vm = new ViewModel({ + data: function () { + return { count: 1 }; + }, + increase() { + ++this.count; + }, + decrease() { + --this.count; + }, + }); + expect(vm.count).toBe(1); + const watcher = vm.$watch( + () => vm.count, + (value) => { + expect(value).toBe(2); + watcher.unsubscribe(); + done(); + } + ); + vm.increase(); + }); + test('05_watch_nested_object', (done) => { + const vm = new ViewModel({ + data: function () { + return { user: { name: 'Chen' } }; + }, + + setName(name) { + this.user.name = name; + }, + }); + + const watcher = vm.$watch( + () => vm.user.name, + (name) => { + expect(name).toBe('Chen2'); + watcher.unsubscribe(); + done(); + } + ); + + vm.setName('Chen2'); + }); + test('06_watch_array', (done) => { + const vm = new ViewModel({ + data: function () { + return { cities: ['HangZhou'] }; + }, + add(city) { + this.cities.push(city); + }, + }); + + const watcher = vm.$watch( + () => vm.cities, + (value) => { + expect(value.length).toBe(2); + expect(value[1]).toBe('ShenZhen'); + watcher.unsubscribe(); + done(); + } + ); + + vm.add('ShenZhen'); + }); + test('07_observed_array_push', (done) => { + const vm = new ViewModel({ + data: { + address: [], + }, + }); + + const watcher = vm.$watch( + () => vm.address[0], + (value) => { + expect(value).toBe('BeiJing'); + watcher.unsubscribe(); + done(); + } + ); + + vm.address.push('BeiJing'); + }); + test('08_observed_array_pop', (done) => { + const vm = new ViewModel({ + data: { + address: ['HangZhou', 'BeiJing'], + }, + }); + + const watcher = vm.$watch( + () => vm.address[1], + (value) => { + expect(value).toBeUndefined(); + watcher.unsubscribe(); + done(); + } + ); + + vm.address.pop(); + }); + test('09_observed_array_unshift', (done) => { + const vm = new ViewModel({ + data: { + address: [], + }, + }); + + const watcher = vm.$watch( + () => vm.address[0], + (value) => { + expect(value).toBe('HangZhou'); + watcher.unsubscribe(); + done(); + } + ); + + vm.address.unshift('HangZhou'); + }); + test('10_observed_array_shift', (done) => { + const vm = new ViewModel({ + data: { + address: ['BeiJing', 'HangZhou'], + }, + }); + + const watcher = vm.$watch( + () => vm.address[0], + (value) => { + expect(value).toBe('HangZhou'); + watcher.unsubscribe(); + done(); + } + ); + + vm.address.shift(); + }); + test('11_observed_array_splice', (done) => { + const vm = new ViewModel({ + data: { + address: ['BeiJing', 'HangZhou'], + }, + }); + + const watcher = vm.$watch( + () => vm.address[0], + (value) => { + expect(value).toBe('ShenZhen'); + watcher.unsubscribe(); + done(); + } + ); + + vm.address.splice(0, 1, 'ShenZhen'); + }); + test('12_observed_array_splice', (done) => { + const vm = new ViewModel({ + data: { + address: ['BeiJing', 'HangZhou'], + }, + }); + + vm.$watch( + () => vm.address[0], + (value) => { + expect(value).toBe('HangZhou'); + done(); + } + ); + + vm.address.reverse(); + }); + test('13_watch_multidimensional_array', (done) => { + const vm = new ViewModel({ + data: function () { + return { + numbers: [ + [0, 0, 0, 2], + [0, 0, 0, 0], + [0, 0, 0, 0], + [0, 0, 0, 0], + ], + }; + }, + }); + + const watcher = vm.$watch( + () => vm.numbers[0][0], + (value) => { + expect(value).toBe(4); + watcher.unsubscribe(); + done(); + } + ); + + vm.numbers[0].splice(0, 1, 4); + }); + test('14_watch_multidimensional_array', (done) => { + const vm = new ViewModel({ + data: function () { + return { + numbers: [ + [0, 0, 0, 2], + [0, 0, 0, 0], + [0, 0, 0, 0], + [0, 0, 0, 0], + ], + }; + }, + }); + + const watcher = vm.$watch( + () => vm.numbers[0][0], + (value) => { + expect(value).toBe(4); + watcher.unsubscribe(); + done(); + } + ); + + vm.numbers.splice(0, 1, [4, 4, 4, 4]); + }); + test('15_change_array_by_index', (done) => { + const vm = new ViewModel({ + data: { + users: ['Jack', 'Mike'], + }, + }); + + const watcher = vm.$watch( + () => vm.users[0], + (value) => { + expect(value).toBe('Enzo'); + watcher.unsubscribe(); + done(); + } + ); + + vm.users[0] = 'Enzo'; + }); + test('15_watch_object_array', (done) => { + const vm = new ViewModel({ + data: { + users: [], + }, + }); + + const watcher = vm.$watch( + () => vm.users[0], + (user) => { + expect(user.name).toEqual('Jack'); + watcher.unsubscribe(); + } + ); + vm.users.push({ name: 'Jack' }); + + const watcher2 = vm.$watch( + () => vm.users[0] && vm.users[0].name, + (name) => { + expect(name).toEqual('Enzo'); + watcher2.unsubscribe(); + done(); + } + ); + + vm.users[0].name = 'Enzo'; + }); + test('99_lifecycle', () => { + const onInit = jest.fn().mockReturnValue('onInit'); + const onReady = jest.fn().mockReturnValue('onReady'); + const onShow = jest.fn().mockReturnValue('onShow'); + const onDestroy = jest.fn().mockReturnValue('onDestroy'); + const onDataChange = jest.fn().mockReturnValue('onDataChange'); + + const vm = new ViewModel({ + onInit, + onReady, + onShow, + onDestroy, + onDataChange, + }); + + expect(vm.onInit()).toBe('onInit'); + expect(vm.onDataChange()).toBe('onDataChange'); + expect(vm.onReady()).toBe('onReady'); + expect(vm.onShow()).toBe('onShow'); + expect(vm.onDestroy()).toBe('onDestroy'); + + expect(onInit.mock.instances[0]).toBe(vm); + expect(onDataChange.mock.instances[0]).toBe(vm); + expect(onReady.mock.instances[0]).toBe(vm); + expect(onShow.mock.instances[0]).toBe(vm); + expect(onDestroy.mock.instances[0]).toBe(vm); + }); +}); diff --git a/packages/runtime-core/src/core/index.js b/packages/runtime-core/src/core/index.js new file mode 100755 index 0000000..3ede15c --- /dev/null +++ b/packages/runtime-core/src/core/index.js @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2020 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 { Observer, Subject } from '../observer'; +import { + PHASE_APP_INIT, + PHASE_FWK_EVAL, + PHASE_INIT_DATA_GET_DATA, + PHASE_INIT_DATA_OBSERVE, + PHASE_INIT_DATA_PROXY, + PHASE_INIT_STATE, + startTracing, + stopTracing +} from '../profiler'; + +startTracing(PHASE_APP_INIT); + +/** + * ViewModel constructor + * @param {Object} options the options of ViewModel + * @return {ViewModel} ViewModel instance + */ +export function ViewModel(options) { + startTracing(PHASE_FWK_EVAL); + if (!(this instanceof ViewModel)) { + return new ViewModel(options); + } + + const vm = (this._vm = this); + + if (Object.prototype.toString.call(options) === '[object Object]') { + Object.keys(options).forEach(key => { + const value = options[key]; + if (key === 'render') { + vm.$render = value; + } else if (key === 'data') { + initState(vm, value); + } else if (key === 'styleSheet') { + initStyleSheet(value); + } else if (typeof value === 'function') { + vm[key] = value.bind(vm); + } else { + // do nothing + } + }); + } + + stopTracing(); +} + +ViewModel.prototype.$watch = function(getter, callback, meta) { + return new Observer(this, getter, callback, meta); +}; + +/** + * initialize the state of ViewModel instance + * @param {ViewModel} vm ViewModel instance + * @param {Object} data the data to be observe + */ +function initState(vm, data) { + startTracing(PHASE_INIT_STATE); + + startTracing(PHASE_INIT_DATA_GET_DATA); + if (typeof data === 'function') { + data = data.call(vm, vm); + } + stopTracing(); // PHASE_INIT_DATA_GET_DATA + + startTracing(PHASE_INIT_DATA_PROXY); + Object.keys(data).forEach(key => proxy(vm, data, key)); + stopTracing(); // PHASE_INIT_DATA_PROXY + + startTracing(PHASE_INIT_DATA_OBSERVE); + Subject.of(data); + stopTracing(); // PHASE_INIT_DATA_OBSERVE + + stopTracing(); // PHASE_INIT_STATE +} + +/** + * proxy data + * @param {ViewModel} target ViewModel instance + * @param {Object} source the data to be proxy + * @param {String} key the key to be proxy + */ +function proxy(target, source, key) { + Object.defineProperty(target, key, { + enumerable: false, + configurable: true, + get() { + return source[key]; + }, + set(value) { + source[key] = value; + } + }); +} + +stopTracing(); diff --git a/packages/runtime-core/src/index.js b/packages/runtime-core/src/index.js new file mode 100755 index 0000000..9c51bce --- /dev/null +++ b/packages/runtime-core/src/index.js @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2020 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 { ViewModel } from './core'; + +export default ViewModel; diff --git a/packages/runtime-core/src/observer/index.js b/packages/runtime-core/src/observer/index.js new file mode 100755 index 0000000..cfb32e9 --- /dev/null +++ b/packages/runtime-core/src/observer/index.js @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2020 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 { Observer } from './observer'; +export { Subject } from './subject'; diff --git a/packages/runtime-core/src/observer/observer.js b/packages/runtime-core/src/observer/observer.js new file mode 100755 index 0000000..64de0e2 --- /dev/null +++ b/packages/runtime-core/src/observer/observer.js @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2020 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 { ObserverStack, canObserve } from './utils'; + +/** + * Observer constructor + * @param {ViewModel} context execute context of callback + * @param {Function} getter getter function + * @param {Function} callback callback function + * @param {Object} meta meta data that Observer object don't care about + */ +export function Observer(context, getter, callback, meta) { + this._ctx = context; + this._getter = getter; + this._fn = callback; + this._meta = meta; + this._lastValue = this._get(); +} + +Observer.prototype._get = function() { + try { + ObserverStack.push(this); + return this._getter.call(this._ctx); + } finally { + ObserverStack.pop(); + } +}; + +Observer.prototype.update = function() { + const lastValue = this._lastValue; + const nextValue = this._get(); + const context = this._ctx; + const meta = this._meta; + + if (nextValue !== lastValue || canObserve(nextValue)) { + this._fn.call(context, nextValue, lastValue, meta); + this._lastValue = nextValue; + } +}; + +Observer.prototype.subscribe = function(subject, key) { + const detach = subject.attach(key, this); + if (typeof detach !== 'function') { + return void 0; + } + if (!this._detaches) { + this._detaches = []; + } + this._detaches.push(detach); +}; + +Observer.prototype.unsubscribe = function() { + const detaches = this._detaches; + if (!detaches) { + return void 0; + } + while (detaches.length) { + detaches.pop()(); + } +}; diff --git a/packages/runtime-core/src/observer/subject.js b/packages/runtime-core/src/observer/subject.js new file mode 100755 index 0000000..478b0b6 --- /dev/null +++ b/packages/runtime-core/src/observer/subject.js @@ -0,0 +1,166 @@ +/* + * Copyright (c) 2020 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 { + ObserverStack, + SYMBOL_OBSERVABLE, + canObserve, + defineProp +} from './utils'; + + +/** + * Subject constructor + * @param {any} target the target object to be observed + */ +export function Subject(target) { + const subject = this; + subject._hijacking = true; + defineProp(target, SYMBOL_OBSERVABLE, subject); + + if (Array.isArray(target)) { + hijackArray(target); + } + + Object.keys(target).forEach(key => hijack(target, key, target[key])); +} + +Subject.of = function(target) { + if (!target || !canObserve(target)) { + return target; + } + if (target[SYMBOL_OBSERVABLE]) { + return target[SYMBOL_OBSERVABLE]; + } + return new Subject(target); +}; + +Subject.is = function(target) { + return target && target._hijacking; +}; +Subject.prototype.attach = function(key, observer) { + if (typeof key === 'undefined' || !observer) { + return void 0; + } + if (!this._obsMap) { + this._obsMap = {}; + } + if (!this._obsMap[key]) { + this._obsMap[key] = []; + } + const observers = this._obsMap[key]; + if (observers.indexOf(observer) < 0) { + observers.push(observer); + return function() { + observers.splice(observers.indexOf(observer), 1); + }; + } +}; + +Subject.prototype.notify = function(key) { + if ( + typeof key === 'undefined' || + !this._obsMap || + !this._obsMap[key] + ) { + return void 0; + } + this._obsMap[key].forEach(observer => observer.update()); +}; + +Subject.prototype.setParent = function(parent, key) { + this._parent = parent; + this._key = key; +}; + +Subject.prototype.notifyParent = function() { + this._parent && this._parent.notify(this._key); +}; + +const ObservedMethods = { + PUSH: 'push', + POP: 'pop', + UNSHIFT: 'unshift', + SHIFT: 'shift', + SPLICE: 'splice', + REVERSE: 'reverse' +}; + +const OBSERVED_METHODS = Object.keys(ObservedMethods).map( + key => ObservedMethods[key] +); + +/** + * observe the change of array + * @param {Array} target a plain JavaScript array to be observed + */ +function hijackArray(target) { + OBSERVED_METHODS.forEach(key => { + const originalMethod = target[key]; + + defineProp(target, key, function() { + // eslint-disable-next-line + const args = Array.prototype.slice.call(arguments); + // eslint-disable-next-line + originalMethod.apply(this, args); + + let inserted; + if (ObservedMethods.PUSH === key || ObservedMethods.UNSHIFT === key) { + inserted = args; + } else if (ObservedMethods.SPLICE) { + inserted = args.slice(2); + } + + if (inserted && inserted.length) { + inserted.forEach(Subject.of); + } + + const subject = target[SYMBOL_OBSERVABLE]; + if (subject) { + subject.notifyParent(); + } + }); + }); +} + +/** + * observe object + * @param {any} target the object to be observed + * @param {String} key the key to be observed + * @param {any} cache the cached value + */ +function hijack(target, key, cache) { + const subject = target[SYMBOL_OBSERVABLE]; + + Object.defineProperty(target, key, { + enumerable: true, + get() { + const observer = ObserverStack.top(); + if (observer) { + observer.subscribe(subject, key); + } + + const subSubject = Subject.of(cache); + if (Subject.is(subSubject)) { + subSubject.setParent(subject, key); + } + + return cache; + }, + set(value) { + cache = value; + subject.notify(key); + } + }); +} diff --git a/packages/runtime-core/src/observer/utils.js b/packages/runtime-core/src/observer/utils.js new file mode 100755 index 0000000..47134dd --- /dev/null +++ b/packages/runtime-core/src/observer/utils.js @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2020 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 const ObserverStack = { + stack: [], + push(observer) { + this.stack.push(observer); + }, + pop() { + return this.stack.pop(); + }, + top() { + return this.stack[this.stack.length - 1]; + } +}; + +export const SYMBOL_OBSERVABLE = '__ob__'; + +export const canObserve = target => typeof target === 'object'; + +export const defineProp = (target, key, value) => { + Object.defineProperty(target, key, { enumerable: false, value }); +}; diff --git a/packages/runtime-core/src/profiler/index.js b/packages/runtime-core/src/profiler/index.js new file mode 100755 index 0000000..a9a3830 --- /dev/null +++ b/packages/runtime-core/src/profiler/index.js @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2020 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. + */ +/** + * start to trace + * @param {number} phase the phase of tracing + */ +export function startTracing(phase) { + if (typeof profiler !== 'undefined') { + profiler.startTracing(phase); + } +} + +/** + * stop to trace + */ +export function stopTracing() { + if (typeof profiler !== 'undefined') { + profiler.stopTracing(); + } +} + +/** + * keep sync with js_profiler.h + */ + +export const PHASE_FWK_EVAL = 5; +export const PHASE_APP_INIT = 6; +export const PHASE_INIT_STATE = 7; +export const PHASE_INIT_DATA_GET_DATA = 8; +export const PHASE_INIT_DATA_PROXY = 9; +export const PHASE_INIT_DATA_OBSERVE = 10; diff --git a/readme.md b/readme.md new file mode 100755 index 0000000..20d9820 --- /dev/null +++ b/readme.md @@ -0,0 +1 @@ +详见:https://gitee.com/openharmony/docs/blob/master/readme/ACE开发框架README.md diff --git a/src/core/animation/transition_impl.cpp b/src/core/animation/transition_impl.cpp new file mode 100755 index 0000000..f0e22d6 --- /dev/null +++ b/src/core/animation/transition_impl.cpp @@ -0,0 +1,433 @@ +/* + * Copyright (c) 2020 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. + */ +#include "transition_impl.h" + +#include +#if ENABLED(SECURE_C_FUNCTION) +#include "securec.h" +#endif // ENABLED(SECURE_C_FUNCTION) +#include "ace_log.h" +#include "ace_mem_base.h" +#include "easing_equation.h" +#include "root_view.h" + +namespace OHOS { +namespace ACELite { +void TransitionImpl::Init() +{ + if (animator_ != nullptr) { + return; + } + animator_ = new Animator(this, view_, 0, true); + if (animator_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "animator create failed"); + return; + } + AnimatorManager::GetInstance()->Add(animator_); +} + +void TransitionImpl::Callback(UIView* view) +{ + if (animator_ == nullptr) { + return; + } + int32_t elapsedTime = animator_->GetRunTime() - params_.delay; // animation execution time + if (elapsedTime <= 0) { + return; + } + if (elapsedTime >= params_.during) { + timeArrivaled_ = true; + } + + Perform(elapsedTime); +} + +void TransitionImpl::Start() +{ + if (animator_) { + uint8_t state = animator_->GetState(); + if (((state == Animator::STOP) || (state == Animator::PAUSE)) && (params_.during > 0)) { + RecordViewStatus(); + InitTransitionParams(); + animator_->Start(); + } + } else { + HILOG_INFO(HILOG_MODULE_ACE, "animator not initial or has been started"); + } +} + +void TransitionImpl::Stop() const +{ + if (animator_) { + uint8_t state = animator_->GetState(); + if (state == Animator::START || state == Animator::RUNNING) { + animator_->Stop(); + } + } else { + HILOG_INFO(HILOG_MODULE_ACE, "animator not initial or is not running"); + } +} + +void TransitionImpl::InitTransitionParams() +{ + InitTransitionParamsStyle(); + InitTransitionParamsTransform(); + InitTransitionParamsEasing(); +} + +void TransitionImpl::InitTransitionParamsStyle() +{ + params_.delay = (params_.delay <= 0) ? 0 : params_.delay; + params_.during = (params_.during <= 0) ? 0 : params_.during; + oriIteration_ = params_.iterations; + + if (params_.fill == OptionsFill::FORWARDS) { + fill_ = OptionsFill::FORWARDS; + } + + if (params_.height_from >= 0 && params_.height_to >= 0) { + isTransitionSet_[GeneralType::IS_HEIGHT_TRANSITION_SET] = true; + heightSrc_ = params_.height_from; + } + if (params_.width_from >= 0 && params_.width_to >= 0) { + isTransitionSet_[GeneralType::IS_WIDTH_TRANSITION_SET] = true; + widthSrc_ = params_.width_from; + } + if (params_.opacity_from >= 0 && params_.opacity_to >= 0) { + isTransitionSet_[GeneralType::IS_OPCITY_TRANSITION_SET] = true; + opacitySrc_ = (params_.opacity_from <= OPA_OPAQUE) ? params_.opacity_from : OPA_OPAQUE; + params_.opacity_to = (params_.opacity_to <= OPA_OPAQUE) ? params_.opacity_to : OPA_OPAQUE; + } + + const uint32_t rgbValueMin = 0x000000; + const uint32_t rgbValueMax = 0xFFFFFF; + if ((params_.background_color_from >= rgbValueMin) && (params_.background_color_from <= rgbValueMax) && + (params_.background_color_to >= rgbValueMin) && (params_.background_color_to <= rgbValueMax)) { + isTransitionSet_[GeneralType::IS_BACKGROUND_COLOR_TRANSITION_SET] = true; + GetRGB(params_.background_color_from, rSrc_, gSrc_, bSrc_); + GetRGB(params_.background_color_to, rTo_, gTo_, bTo_); + steps_ = params_.during / INTERVAL; + } +} + +void TransitionImpl::InitTransitionParamsTransform() +{ + if (params_.transformType == nullptr) { + return; + } + if (!strcmp(params_.transformType, TRANSITION_TRANSFORM_X)) { + transformType_ = TransformType::TRANSLATE_X; + xSrc_ = viewStatus_.x + params_.transform_from; + } else if (!strcmp(params_.transformType, TRANSITION_TRANSFORM_Y)) { + transformType_ = TransformType::TRANSLATE_Y; + ySrc_ = viewStatus_.y + params_.transform_from; + } else if (!strcmp(params_.transformType, TRANSITION_ROTATE)) { + transformType_ = TransformType::ROTATE; + rotateSrc_ = params_.transform_from; + } +} + +void TransitionImpl::InitTransitionParamsEasing() +{ + switch (params_.easing) { + case EasingType::EASE_IN: + easingType_[EasingType::EASE_IN] = true; + break; + case EasingType::EASE_OUT: + easingType_[EasingType::EASE_OUT] = true; + break; + case EasingType::EASE_IN_OUT: + easingType_[EasingType::EASE_IN_OUT] = true; + break; + default: + easingType_[EasingType::LINEAR] = true; + break; + } +} + +void TransitionImpl::GetRGB(const uint32_t color, uint8_t& r, uint8_t& g, uint8_t& b) const +{ + r = uint8_t((color & TEXT_RED_COLOR_MASK) >> RED_COLOR_START_BIT); + g = uint8_t((color & TEXT_GREEN_COLOR_MASK) >> GREEN_COLOR_START_BIT); + b = uint8_t((color & TEXT_BLUE_COLOR_MASK)); +} + +int16_t TransitionImpl::GetNextFrameValue(int16_t from, int16_t to, int32_t elapsedTime) const +{ + int16_t nextPoint; + if (easingType_[EasingType::EASE_IN]) { + nextPoint = EasingEquation::CubicEaseIn(from, to, elapsedTime, params_.during); + } else if (easingType_[EasingType::EASE_OUT]) { + nextPoint = EasingEquation::CubicEaseOut(from, to, elapsedTime, params_.during); + } else if (easingType_[EasingType::EASE_IN_OUT]) { + nextPoint = EasingEquation::CubicEaseInOut(from, to, elapsedTime, params_.during); + } else { + nextPoint = EasingEquation::LinearEaseNone(from, to, elapsedTime, params_.during); + } + + return nextPoint; +} + +void TransitionImpl::SetTransformSrcPosition() +{ + if (params_.transformType == nullptr) { + return; + } + if (!strcmp(params_.transformType, TRANSITION_TRANSFORM_X)) { + view_->SetPosition(xSrc_, viewStatus_.y); + view_->GetParent()->Invalidate(); + } else if (!strcmp(params_.transformType, TRANSITION_TRANSFORM_Y)) { + view_->SetPosition(viewStatus_.x, ySrc_); + view_->GetParent()->Invalidate(); + } else if (!strcmp(params_.transformType, TRANSITION_ROTATE)) { + RotateAroundCenterPoint(rotateSrc_); + } else { + // do nothing + } +} + +void TransitionImpl::RotateAroundCenterPoint(int16_t angle) +{ + TransformMap transMap(view_->GetOrigRect()); + const int circleRate = 360; + angle = angle % circleRate; + uint8_t halfVal = 2; + pivot_.x_ = view_->GetWidth() / halfVal; + pivot_.y_ = view_->GetHeight() / halfVal; + transMap.Rotate((angle), pivot_); + view_->SetTransformMap(transMap); +} + +void TransitionImpl::Perform(int32_t elapsedTime) +{ + if (timeArrivaled_) { + if (!RepeatAnimator()) { + this->Stop(); + } + } + + if (!isTransformSrcSet_) { + SetTransformSrcPosition(); + isTransformSrcSet_ = true; + } + + if (transformType_ == TransformType::TRANSLATE_X) { + PerformTransition(params_.transform_from, params_.transform_to, TransitionType::TTRANSLATE_X, xSrc_, + elapsedTime); + } else if (transformType_ == TransformType::TRANSLATE_Y) { + PerformTransition(params_.transform_from, params_.transform_to, TransitionType::TTRANSLATE_Y, ySrc_, + elapsedTime); + } else if (transformType_ == TransformType::ROTATE) { + PerformTransition(params_.transform_from, params_.transform_to, TransitionType::TROTATE, rotateSrc_, + elapsedTime); + } + + if (isTransitionSet_[GeneralType::IS_HEIGHT_TRANSITION_SET]) { + PerformTransition(params_.height_from, params_.height_to, TransitionType::HEIGHT, heightSrc_, elapsedTime); + } + if (isTransitionSet_[GeneralType::IS_WIDTH_TRANSITION_SET]) { + PerformTransition(params_.width_from, params_.width_to, TransitionType::WIDTH, widthSrc_, elapsedTime); + } + + if (isTransitionSet_[GeneralType::IS_OPCITY_TRANSITION_SET]) { + PerformTransition(params_.opacity_from, params_.opacity_to, TransitionType::OPACITY, opacitySrc_, elapsedTime); + } + + if (isTransitionSet_[GeneralType::IS_BACKGROUND_COLOR_TRANSITION_SET]) { + PerformTransitionBgColorLinear(elapsedTime); + } + + if (fill_ == OptionsFill::FNONE && timeArrivaled_) { + RecoveryViewStatus(view_->GetRect()); + } + + if (timeArrivaled_) { + ResetRepeatParam(); + } +} + +void TransitionImpl::PerformTransitionBgColorLinear(int32_t elapsedTime) +{ + if (timeArrivaled_) { + HILOG_DEBUG(HILOG_MODULE_ACE, "time arrived"); + view_->SetStyle(STYLE_BACKGROUND_COLOR, Color::GetColorFromRGB(rTo_, gTo_, bTo_).full); + return; + } + if ((steps_ != 0) && (count_ <= steps_) && (elapsedTime <= params_.during)) { + if ((elapsedTime - bgcolorTimeSrc_) > INTERVAL) { + ColorType color = Color::GetColorFromRGB(rSrc_ + (rTo_ - rSrc_) * count_ / steps_, + gSrc_ + (gTo_ - gSrc_) * count_ / steps_, + bSrc_ + (bTo_ - bSrc_) * count_ / steps_); + view_->SetStyle(STYLE_BACKGROUND_COLOR, color.full); + view_->Invalidate(); + bgcolorTimeSrc_ = elapsedTime; + count_++; + } + } +} + +void TransitionImpl::PerformTransition(int16_t from, + int16_t to, + TransitionType transitionType, + int16_t& updateAttrValue, + int32_t elapsedTime) +{ + bool needUpdate = true; + + if (timeArrivaled_) { + updateAttrValue = to; + } else { + int16_t prefectchedValue = 0; + prefectchedValue = GetNextFrameValue(from, to, elapsedTime); + int16_t diffDistance = prefectchedValue - updateAttrValue; + if (((diffDistance < 1) && (diffDistance > -1)) || (elapsedTime > params_.during)) { + needUpdate = false; + } else { + updateAttrValue = static_cast(prefectchedValue); + } + } + + if (needUpdate) { + Rect invalidatedArea = view_->GetRect(); + + switch (transitionType) { + case TransitionType::TTRANSLATE_X: + view_->SetPosition((updateAttrValue + viewStatus_.x), viewStatus_.y); + break; + case TransitionType::TTRANSLATE_Y: + view_->SetPosition(viewStatus_.x, (updateAttrValue + viewStatus_.y)); + break; + case TransitionType::TROTATE: { + RotateAroundCenterPoint(updateAttrValue); + break; + } + case TransitionType::HEIGHT: + view_->SetHeight(updateAttrValue); + break; + case TransitionType::WIDTH: + view_->SetWidth(updateAttrValue); + break; + case TransitionType::OPACITY: { + double rate = (double)updateAttrValue / ALPHA_MAX; + view_->SetStyle(STYLE_BACKGROUND_OPA, viewStatus_.rectOpacity * rate); + view_->SetStyle(STYLE_IMAGE_OPA, viewStatus_.imageOpacity * rate); + view_->SetStyle(STYLE_LINE_OPA, viewStatus_.lineOpacity * rate); + view_->SetStyle(STYLE_TEXT_OPA, viewStatus_.textOpacity * rate); + break; + } + default: + HILOG_INFO(HILOG_MODULE_ACE, "animation nothing to do."); + break; + } + + invalidatedArea.Join(invalidatedArea, view_->GetRect()); + view_->InvalidateRect(invalidatedArea); + } +} +int8_t TransitionImpl::GetNumIterations(const char* iterations) +{ + if (!strcmp(iterations, "infinite")) { + return TransitionImpl::ITERATIONS_INFINITY; + } + + int8_t min = 1; + int8_t max = 127; + long value = strtol(iterations, nullptr, DEC); + if ((value < min) || (value > max)) { + HILOG_ERROR(HILOG_MODULE_ACE, "animation iterations should set between 1 and 127"); + return min; + } else { + return (int8_t)value; + } +} + +bool TransitionImpl::IsEndWith(const char* src, const char* end) +{ + if (src == nullptr || end == nullptr) { + return false; + } + + size_t strLen = strlen(src); + size_t endLen = strlen(end); + if (strLen < endLen || strLen == 0 || endLen == 0) { + return false; + } + + while ((endLen > 0) && (strLen > 0)) { + if (src[strLen - 1] != end[endLen - 1]) { + return false; + } + endLen--; + strLen--; + } + return true; +} + +bool TransitionImpl::RepeatAnimator() +{ + if (oriIteration_ != TransitionImpl::ITERATIONS_INFINITY) { + oriIteration_--; + if (oriIteration_ == 0) { + oriIteration_ = params_.iterations; + return false; + } + } + HILOG_DEBUG(HILOG_MODULE_ACE, "repeat"); + return true; +} + +void TransitionImpl::ResetRepeatParam() +{ + if (animator_ != nullptr) { + animator_->SetRunTime(0); // reset animation executing time + } + timeArrivaled_ = false; // reset timeArrivaled flag + bgcolorTimeSrc_ = 0; // reset bg-color last update time + count_ = 1; // reset bg-color update number of times +} + +void TransitionImpl::RecordViewStatus() +{ + viewStatus_.x = view_->GetX(); + viewStatus_.y = view_->GetY(); + viewStatus_.oriRect = view_->GetOrigRect(); + viewStatus_.height = view_->GetHeight(); + viewStatus_.width = view_->GetWidth(); + viewStatus_.background_color.full = view_->GetStyle(STYLE_BACKGROUND_COLOR); + viewStatus_.rectOpacity = view_->GetStyle(STYLE_BACKGROUND_OPA); + viewStatus_.imageOpacity = view_->GetStyle(STYLE_IMAGE_OPA); + viewStatus_.lineOpacity = view_->GetStyle(STYLE_LINE_OPA); + viewStatus_.textOpacity = view_->GetStyle(STYLE_TEXT_OPA); +} + +void TransitionImpl::RecoveryViewStatus(Rect invalidatedAreaBefore) const +{ + view_->SetX(viewStatus_.x); + view_->SetY(viewStatus_.y); + view_->SetHeight(viewStatus_.height); + view_->SetWidth(viewStatus_.width); + TransformMap& transMap = view_->GetTransformMap(); + Polygon polygon(Rect(0, 0, 0, 0)); + transMap.SetPolygon(polygon); + view_->SetStyle(STYLE_BACKGROUND_COLOR, viewStatus_.background_color.full); + view_->SetStyle(STYLE_BACKGROUND_OPA, viewStatus_.rectOpacity); + view_->SetStyle(STYLE_IMAGE_OPA, viewStatus_.imageOpacity); + view_->SetStyle(STYLE_LINE_OPA, viewStatus_.lineOpacity); + view_->SetStyle(STYLE_TEXT_OPA, viewStatus_.textOpacity); + invalidatedAreaBefore.Join(invalidatedAreaBefore, view_->GetRect()); + view_->InvalidateRect(invalidatedAreaBefore); +} +} // namespace ACELite +} // namespace OHOS diff --git a/src/core/animation/transition_impl.h b/src/core/animation/transition_impl.h new file mode 100755 index 0000000..864feb1 --- /dev/null +++ b/src/core/animation/transition_impl.h @@ -0,0 +1,217 @@ +/* + * Copyright (c) 2020 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. + */ + +#ifndef OHOS_ACELITE_TRANSITION_IMPL_H +#define OHOS_ACELITE_TRANSITION_IMPL_H +#include + +#include "animator.h" +#include "js_fwk_common.h" +#include "non_copyable.h" + +namespace OHOS { +namespace ACELite { +enum EasingType { LINEAR, EASE_IN, EASE_OUT, EASE_IN_OUT, EEND }; + +enum OptionsFill { FNONE, FORWARDS }; + +struct TransitionParams { + /* animation execution time (ms), default is 0, means no animation effect. */ + int32_t during; + /* the time interval (ms) between requesting an animation operation and executing it. */ + int32_t delay; + /* animation execution times, default is 1. */ + int8_t iterations; + /* specify whether to return to the initial state after the animation finishes, + default is 'none', means to return to the initial state; 'forwards' means not return to. */ + OptionsFill fill; + /* specify the speed curve of the animation */ + EasingType easing; + + /* transformType include "translateX/translateY", you can only specify one of these once a time. */ + char* transformType; + /* transform from source (px) to target (px) */ + int16_t transform_from; + int16_t transform_to; + + int16_t height_from; + int16_t height_to; + int16_t width_from; + int16_t width_to; + int16_t opacity_from; + int16_t opacity_to; + uint32_t background_color_from; + uint32_t background_color_to; + + TransitionParams() + : during(0), + delay(0), + iterations(1), + fill(OptionsFill::FNONE), + easing(EasingType::LINEAR), + transformType(nullptr), + transform_from(0), + transform_to(0), + height_from(-1), + height_to(-1), + width_from(-1), + width_to(-1), + opacity_from(-1), + opacity_to(-1), + background_color_from(RGB_COLOR_VALUE_MAX), + background_color_to(RGB_COLOR_VALUE_MAX){}; +}; + +struct ViewStatus { + int16_t x; + int16_t y; + int16_t height; + int16_t width; + int16_t rectOpacity; + int16_t imageOpacity; + int16_t lineOpacity; + int16_t textOpacity; + Rect oriRect; + ColorType background_color; + + ACE_DISALLOW_COPY_AND_MOVE(ViewStatus); + ViewStatus() : x(0), y(0), height(0), width(0), rectOpacity(0), imageOpacity(0), lineOpacity(0), textOpacity(0), + oriRect(), background_color() {}; +}; + +enum TransformType { TRANSLATE_X, TRANSLATE_Y, ROTATE, NONE }; // rotate only support image + +enum GeneralType { + IS_HEIGHT_TRANSITION_SET, + IS_WIDTH_TRANSITION_SET, + IS_BACKGROUND_COLOR_TRANSITION_SET, + IS_OPCITY_TRANSITION_SET, + END +}; + +enum TransitionType { + TTRANSLATE_X, + TTRANSLATE_Y, + TROTATE, + HEIGHT, + WIDTH, + BACKGROUND_COLOR, + OPACITY +}; + +/** + * @brief: animation callback implement. + * supported parameters can refer to struct TransitionParams + */ +class TransitionImpl final : public AnimatorCallback { +public: + /** + * @brief: Construct function + * + * @param: params animation transition effect + * @param: view target view which run the animation + */ + ACE_DISALLOW_COPY_AND_MOVE(TransitionImpl); + TransitionImpl(TransitionParams& params, UIView* view) + : view_(view), + params_(params), + oriIteration_(1), + animator_(nullptr), + xSrc_(0), ySrc_(0), rotateSrc_(0), widthSrc_(0), heightSrc_(0), opacitySrc_(0), bgcolorTimeSrc_(0) + { + } + TransitionImpl() = delete; + ~TransitionImpl() + { + if (animator_ != nullptr) { + AnimatorManager *am = AnimatorManager::GetInstance(); + if (am != nullptr) { + AnimatorManager::GetInstance()->Remove(animator_); + } + delete (animator_); + animator_ = nullptr; + } + } + + /** + * @brief: must call this to do initialization after create TransitionImpl instance + */ + void Init(); + /** + * brief: start the animation + */ + void Start(); + static int8_t GetNumIterations(const char* iterations); + static bool IsEndWith(const char* src, const char *end); + void Stop() const; + +private: + void Callback(UIView* view) override; + bool RepeatAnimator(); + void ResetRepeatParam(); + void RecordViewStatus(); + void RecoveryViewStatus(Rect invalidatedAreaBefore) const; + void InitTransitionParams(); + void InitTransitionParamsStyle(); + void InitTransitionParamsTransform(); + void InitTransitionParamsEasing(); + void GetRGB(const uint32_t color, uint8_t& r, uint8_t& g, uint8_t& b) const; + int16_t GetNextFrameValue(int16_t from, int16_t to, int32_t elapsedTime) const; + void SetTransformSrcPosition(); + void RotateAroundCenterPoint(int16_t angle); + void Perform(int32_t elapsedTime); + void PerformTransitionBgColorLinear(int32_t elapsedTime); + void PerformTransition(int16_t from, + int16_t to, + TransitionType transitionType, + int16_t& updateAttrValue, + int32_t elapsedTime); + + UIView* view_; + TransitionParams& params_; + int8_t oriIteration_; + Animator* animator_; + Vector2 pivot_; + int16_t xSrc_; + int16_t ySrc_; + int16_t rotateSrc_; + int16_t widthSrc_; + int16_t heightSrc_; + int16_t opacitySrc_; + ViewStatus viewStatus_; + bool isTransformSrcSet_ = false; + bool timeArrivaled_ = false; + bool easingType_[EasingType::EEND] = {0}; + bool isTransitionSet_[GeneralType::END] = {0}; + OptionsFill fill_ = OptionsFill::FNONE; + TransformType transformType_ = TransformType::NONE; + + /* used for background-color */ + uint8_t rSrc_ = 0; // used to record the last time red value + uint8_t gSrc_ = 0; + uint8_t bSrc_ = 0; + uint8_t rTo_ = 0; + uint8_t gTo_ = 0; + uint8_t bTo_ = 0; + int8_t count_ = 1; // used to record the current number of times of updating the bg-color + int8_t steps_ = 1; // total target number of times of updating the bg-color (during_/INTERVAL) + int32_t bgcolorTimeSrc_ = 0; // used to record the last time bg-color + const static int8_t ITERATIONS_INFINITY = -1; + const static int16_t INTERVAL = 150; // update the bg-color every INTERVAL (ms) +}; +} // namespace ACELite +} // namespace OHOS + +#endif // OHOS_ACELITE_TRANSITION_IMPL_H diff --git a/src/core/async/BUILD.gn b/src/core/async/BUILD.gn new file mode 100755 index 0000000..4e95508 --- /dev/null +++ b/src/core/async/BUILD.gn @@ -0,0 +1,24 @@ +#Copyright (c) 2020 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. + +source_set("async") { + configs += [ + "//foundation/ace/lite/jsfwk:ace_config", + ] + sources = [ + "js_async_work.cpp", + "message_queue_utils.cpp", + ] + include_dirs = [ + ] +} diff --git a/src/core/async/js_async_work.cpp b/src/core/async/js_async_work.cpp new file mode 100755 index 0000000..6765bd7 --- /dev/null +++ b/src/core/async/js_async_work.cpp @@ -0,0 +1,119 @@ +/* + * Copyright (c) 2020 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. + */ +#include "js_async_work.h" +#include "ace_log.h" +#include "fatal_handler.h" +#include "js_fwk_common.h" +#if (defined(__LINUX__) || defined(__LITEOS__)) +#include "ace_ability.h" +#endif + +namespace OHOS { +namespace ACELite { +// Initialization of static variables +QueueHandler JsAsyncWork::appQueuehandler_ = nullptr; + +void JsAsyncWork::SetAppQueueHandler(const QueueHandler handler) +{ + appQueuehandler_ = handler; +} + +bool JsAsyncWork::DispatchToLoop(AbilityMsgId msgId, void *data) +{ + if ((appQueuehandler_ == nullptr) || (msgId >= MSG_ID_MAX) || + (FatalHandler::GetInstance().IsFatalErrorHitted()) || + (FatalHandler::GetInstance().IsAppExiting())) { + // For the cases fatal error handling or the JS task is exiting, do not allow any async work dispatching, + // as the messages after DESTROY will never be handled. + return false; + } + + AbilityInnerMsg innerMsg; + innerMsg.msgId = msgId; + innerMsg.data = data; + int8_t ret = MessageQueueUtils::PutMessage(appQueuehandler_, static_cast(&innerMsg), 0); + return (ret == MSGQ_OK); +} + +bool JsAsyncWork::DispatchAsyncWork(AsyncWorkHandler workHandler, void *data) +{ + return DispatchAsyncWorkInner(workHandler, nullptr, data); +} + +bool JsAsyncWork::DispatchAsyncWork(AsyncHandler handler, void *data) +{ + return DispatchAsyncWorkInner(nullptr, handler, data); +} + +bool JsAsyncWork::DispatchAsyncWorkInner(AsyncWorkHandler workHandler, AsyncHandler handler, void *data) +{ + if (((workHandler == nullptr) && (handler == nullptr)) || (FatalHandler::GetInstance().IsFatalErrorHitted())) { + HILOG_ERROR(HILOG_MODULE_ACE, "JsAsyncWork:DispatchAsyncWork parameters invalid or fatal error!"); + return false; + } + +#if (defined(__LINUX__) || defined(__LITEOS__)) + if (workHandler != nullptr) { + auto task1 = [workHandler, data]() { + workHandler(data); + }; + return AceAbility::PostUITask(task1); + } + if (handler != nullptr) { + auto task2 = [handler, data]() { + handler(data, ERR_OK); + }; + return AceAbility::PostUITask(task2); + } + return false; +#else + AsyncWork* asyncWork = new AsyncWork(); + if (asyncWork == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "JsAsyncWork:DispatchAsyncWork create async work failed!"); + return false; + } + asyncWork->workHandler = workHandler; + asyncWork->handler = handler; + asyncWork->data = data; + + bool ret = DispatchToLoop(ASYNCWORK, static_cast(asyncWork)); + if (!ret) { + HILOG_ERROR(HILOG_MODULE_ACE, "JsAsyncWork:DispatchAsyncWork failed!, handler[%p]", asyncWork->workHandler); + delete(asyncWork); + asyncWork = nullptr; + } + return ret; +#endif +} + +void JsAsyncWork::ExecuteAsyncWork(AsyncWork *&asyncWork, int8_t statusCode) +{ + if (asyncWork == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "JsAsyncWork:ExecuteAsyncWork parameters invalid!"); + return; + } + AsyncWorkHandler workHandler = asyncWork->workHandler; + if (workHandler != nullptr) { + workHandler(asyncWork->data); + } + AsyncHandler handler = asyncWork->handler; + if (handler != nullptr) { + handler(asyncWork->data, statusCode); + } + delete asyncWork; + asyncWork = nullptr; +} +} // namespace ACELite +} // namespace OHOS diff --git a/src/core/async/message_queue_utils.cpp b/src/core/async/message_queue_utils.cpp new file mode 100755 index 0000000..0f097f1 --- /dev/null +++ b/src/core/async/message_queue_utils.cpp @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2020 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. + */ + +#include "message_queue_utils.h" +#include "ace_event_error_code.h" +#include "ace_log.h" +#include "acelite_config.h" +#ifdef OHOS_ACELITE_PRODUCT_WATCH +#include "cmsis_os.h" +#endif + +namespace OHOS { +namespace ACELite { +QueueHandler MessageQueueUtils::CreateMessageQueue(uint32_t capacity, uint32_t msgSize) +{ + if (capacity == 0 || msgSize == 0) { + HILOG_ERROR(HILOG_MODULE_ACE, "MessageQueueUtils:CreateMessageQueue parameters invalid!"); + return nullptr; + } +#if (defined(__LINUX__) || defined(__LITEOS__)) + HILOG_WARN(HILOG_MODULE_ACE, "todo call linux createMessageQueue interface here!"); + return nullptr; +#else + osMessageQueueId_t queueId = osMessageQueueNew(capacity, msgSize, nullptr); + return static_cast(queueId); +#endif +} + +int8_t MessageQueueUtils::DeleteMessageQueue(QueueHandler handler) +{ + if (handler == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "MessageQueueUtils:DeleteMessageQueue parameters invalid!"); + return MSGQ_FAIL; + } +#if (defined(__LINUX__) || defined(__LITEOS__)) + HILOG_WARN(HILOG_MODULE_ACE, "todo call linux deleteMessageQueue interface here!"); + return MSGQ_FAIL; +#else + osMessageQueueId_t queueId = static_cast(handler); + if (osMessageQueueDelete(queueId) != osOK) { + HILOG_ERROR(HILOG_MODULE_ACE, "MessageQueueUtils:DeleteMessageQueue failed!"); + return MSGQ_FAIL; + } + return MSGQ_OK; +#endif +} + +int8_t MessageQueueUtils::PutMessage(QueueHandler handler, const void* msgPtr, uint32_t timeOut) +{ + if ((handler == nullptr) || (msgPtr == nullptr)) { + HILOG_ERROR(HILOG_MODULE_ACE, "MessageQueueUtils:PutMessage parameters invalid!"); + return MSGQ_FAIL; + } +#if (defined(__LINUX__) || defined(__LITEOS__)) + HILOG_WARN(HILOG_MODULE_ACE, "todo call linux putmsg interface here!"); + return MSGQ_FAIL; +#else + osMessageQueueId_t queueId = static_cast(handler); + if (osMessageQueuePut(queueId, msgPtr, 0, timeOut) != osOK) { + HILOG_ERROR(HILOG_MODULE_ACE, "MessageQueueUtils:PutMessage failed!"); + ACE_ERROR_CODE_PRINT(EXCE_ACE_ASYNC_WORK_FAILED, EXCE_ACE_ASYNC_WORK_DISPATCH_FAILED); + return MSGQ_FAIL; + } + return MSGQ_OK; +#endif +} + +int8_t MessageQueueUtils::GetMessage(QueueHandler handler, void* msgPtr, uint32_t timeOut) +{ + if ((handler == nullptr) || (msgPtr == nullptr)) { + HILOG_ERROR(HILOG_MODULE_ACE, "MessageQueueUtils:GetMessage parameters invalid!"); + return MSGQ_FAIL; + } +#if (defined(__LINUX__) || defined(__LITEOS__)) + HILOG_WARN(HILOG_MODULE_ACE, "todo call linux getmsg interface here!"); + return MSGQ_FAIL; +#else + osMessageQueueId_t queueId = static_cast(handler); + if (osMessageQueueGet(queueId, msgPtr, 0, timeOut) != osOK) { + HILOG_ERROR(HILOG_MODULE_ACE, "MessageQueueUtils:GetMessage failed!"); + return MSGQ_FAIL; + } + return MSGQ_OK; +#endif +} +} // namespace ACELite +} // namespace OHOS diff --git a/src/core/base/BUILD.gn b/src/core/base/BUILD.gn new file mode 100755 index 0000000..ebbefa1 --- /dev/null +++ b/src/core/base/BUILD.gn @@ -0,0 +1,26 @@ +#Copyright (c) 2020 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. + +source_set("base") { + configs += [ + "//foundation/ace/lite/jsfwk:ace_config", + ] + sources = [ + "js_fwk_common.cpp", + "key_parser.cpp", + "ace_log.cpp", + "time_util.cpp", + ] + include_dirs = [ + ] +} diff --git a/src/core/base/ace_log.cpp b/src/core/base/ace_log.cpp new file mode 100755 index 0000000..ee524ba --- /dev/null +++ b/src/core/base/ace_log.cpp @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2020 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. + */ + +#include "ace_log.h" +#include +#include + +#if (defined(_WIN32) || defined(_WIN64)) +namespace OHOS { +namespace ACELite { +void PrintInfo(const char *format, va_list args) +{ + vprintf(format, args); + printf("\n"); +} + +void HILOG_FATAL(HiLogModuleType mod, const char *msg, ...) +{ + printf("[FATAL]:"); + va_list args; + va_start(args, msg); + PrintInfo(msg, args); + va_end(args); +} + +void HILOG_ERROR(HiLogModuleType mod, const char *msg, ...) +{ + printf("[ERROR]:"); + va_list args; + va_start(args, msg); + PrintInfo(msg, args); + va_end(args); +} + +void HILOG_INFO(HiLogModuleType mod, const char *msg, ...) +{ + printf("[INFO]:"); + va_list args; + va_start(args, msg); + PrintInfo(msg, args); + va_end(args); +} + +void HILOG_WARN(HiLogModuleType mod, const char *msg, ...) +{ + printf("[WARN]:"); + va_list args; + va_start(args, msg); + PrintInfo(msg, args); + va_end(args); +} + +void HILOG_DEBUG(HiLogModuleType mod, const char *msg, ...) +{ + printf("[DEBUG]:"); + va_list args; + va_start(args, msg); + PrintInfo(msg, args); + va_end(args); +} +} // namespace ACELite +} // namespace OHOS +#endif diff --git a/src/core/base/ace_log.h b/src/core/base/ace_log.h new file mode 100755 index 0000000..5efa394 --- /dev/null +++ b/src/core/base/ace_log.h @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2020 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. + */ + +#ifndef OHOS_ACELITE_ACE_LOG_H +#define OHOS_ACELITE_ACE_LOG_H + +#include "acelite_config.h" + +#if defined(FEATURE_ACELITE_HI_LOG_PRINTF) && defined(FEATURE_ACELITE_MC_LOG_PRINTF) +#error Only one marco can be defined +#elif defined(FEATURE_ACELITE_HI_LOG_PRINTF) && (defined(_WIN32) || defined(_WIN64)) +#error Only one marco can be defined +#elif defined(FEATURE_ACELITE_MC_LOG_PRINTF) && (defined(_WIN32) || defined(_WIN64)) +#error Only one macro can be defined +#endif + +#if defined(FEATURE_ACELITE_HI_LOG_PRINTF) +#undef LOG_DOMAIN +#undef LOG_TAG +#define LOG_DOMAIN 0xD003900 +#define LOG_TAG "ACE" +#include "hilog/log.h" +#elif defined(FEATURE_ACELITE_MC_LOG_PRINTF) +#ifndef HILOG_DEBUG +#define HILOG_DEBUG(mod, format, ...) +#endif +#ifndef HILOG_ERROR +#define HILOG_ERROR(mod, format, ...) +#endif +#ifndef HILOG_FATAL +#define HILOG_FATAL(mod, format, ...) +#endif +#ifndef HILOG_INFO +#define HILOG_INFO(mod, format, ...) +#endif +#ifndef HILOG_WARN +#define HILOG_WARN(mod, format, ...) +#endif +#ifndef HILOG_RACE +#define HILOG_RACE(mod, format, ...) +#endif +#elif (defined(_WIN32) || defined(_WIN64)) +namespace OHOS { +namespace ACELite { +typedef enum { HILOG_MODULE_ACE = 1 } HiLogModuleType; + +void HILOG_FATAL(HiLogModuleType mod, const char *msg, ...); +void HILOG_ERROR(HiLogModuleType mod, const char *msg, ...); +void HILOG_INFO(HiLogModuleType mod, const char *msg, ...); +void HILOG_WARN(HiLogModuleType mod, const char *msg, ...); +void HILOG_DEBUG(HiLogModuleType mod, const char *msg, ...); +} // namespace ACELite +} // namespace OHOS +#else +#error One macro must be defined +#endif +#endif // OHOS_ACELITE_ACE_LOG_H diff --git a/src/core/base/ace_mem_base.cpp b/src/core/base/ace_mem_base.cpp new file mode 100755 index 0000000..594a591 --- /dev/null +++ b/src/core/base/ace_mem_base.cpp @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2020 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. + */ +#include "ace_mem_base.h" + +#include +#include "acelite_config.h" + +#if defined(FEATURE_ACELITE_MC_MEMORY_POOL) && defined(FEATURE_ACELITE_MEMORY_POOL) +#error Only one marco can be defined +#elif defined(FEATURE_ACELITE_MC_MEMORY_POOL) && (defined(_WIN32) || defined(_WIN64)) +#error Only one marco can be defined +#elif defined(FEATURE_ACELITE_PRODUCT_MEMORY_POOL) && (defined(_WIN32) || defined(_WIN64)) +#error Only one macro can be defined +#elif defined(FEATURE_ACELITE_MEMORY_POOL) && (defined(_WIN32) || defined(_WIN64)) +#error Only one macro can be defined +#endif + +#if defined(FEATURE_ACELITE_MC_MEMORY_POOL) +#include "mc_memory.h" +#elif defined(FEATURE_ACELITE_PRODUCT_MEMORY_POOL) +#include "mem_pool.h" +#elif defined(FEATURE_ACELITE_MEMORY_POOL) +#include "hos_errno.h" +#include "hos_memory.h" +#elif (defined(_WIN32) || defined(_WIN64)) +#include +#elif (defined(__LINUX__) || defined(__LITEOS__)) +#include +#else +#error One macro must be defined +#endif + +namespace OHOS { +namespace ACELite { +void* ace_malloc(size_t size) +{ +#if defined(FEATURE_ACELITE_MC_MEMORY_POOL) + return MC_UI_MEM_ALLOC(size); +#elif defined(FEATURE_ACELITE_PRODUCT_MEMORY_POOL) + return MemPool::GetInstance()->Malloc(size); +#elif defined(FEATURE_ACELITE_MEMORY_POOL) + return HOS_MemAlloc(0, size); +#elif (defined(_WIN32) || defined(_WIN64)) + return malloc(size); +#elif (defined(__LINUX__) || defined(__LITEOS__)) + return malloc(size); +#else + #error One macro must be defined +#endif +} + +void* ace_calloc(size_t num, size_t size) +{ +#if (defined(_WIN32) || defined(_WIN64)) + return calloc(num, size); +#else + return nullptr; +#endif +} + +void ace_free(void* ptr) +{ +#if defined(FEATURE_ACELITE_MC_MEMORY_POOL) + MC_UI_MEM_FREE(ptr); +#elif defined(FEATURE_ACELITE_PRODUCT_MEMORY_POOL) + MemPool::GetInstance()->Free(ptr); +#elif defined(FEATURE_ACELITE_MEMORY_POOL) + HOS_MemFree(0, ptr); +#elif (defined(_WIN32) || defined(_WIN64)) + free(ptr); +#elif (defined(__LINUX__) || defined(__LITEOS__)) + free(ptr); +#else + #error One macro must be defined +#endif +} +} // namespace ACELite +} // namespace OHOS diff --git a/src/core/base/ace_version.h b/src/core/base/ace_version.h new file mode 100755 index 0000000..71e16f3 --- /dev/null +++ b/src/core/base/ace_version.h @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2020 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. + */ + +// THIS FILE IS AUTO GENERATED, PLEASE DO NOT EDIT DIRECTLY + +#ifndef OHOS_ACELITE_ACE_VERSION_H +#define OHOS_ACELITE_ACE_VERSION_H + +#include "js_config.h" + +#if ENABLED(ACE_LITE_VERSION_JS_API) + +namespace OHOS { +namespace ACELite { +class ACEVersion final { +public: + static const char* GetStr() + { + return "1.0.16"; + } + + static const char* GetCommit() + { + return "1e53ee81c"; + } + + static const char* GetTimeStamp() + { + return "2020-08-13 17:25:20"; + } +}; // class ACEVersion +} // namespace ACELite +} // namespace OHOS + +#endif // ENABLED(ACE_LITE_VERSION_JS_API) +#endif // OHOS_ACELITE_ACE_VERSION_H diff --git a/src/core/base/framework_min_bc.h b/src/core/base/framework_min_bc.h new file mode 100755 index 0000000..954a3d6 --- /dev/null +++ b/src/core/base/framework_min_bc.h @@ -0,0 +1,233 @@ +/* + * Copyright (c) 2020 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. + */ + +// AUTO GENERATED, PLEASE DO NOT EDIT DIRECTLY + +#ifndef ACELITE_FRAMEWORK_RAW_BUFFER +#error THIS FILE CAN ONLY BE INCLUDED BY RAW BUFFER CPP +#endif + +#ifndef OHOS_ACELITE_FRAMEWORK_MIN_SNAPSHOT_BUFFER +#define OHOS_ACELITE_FRAMEWORK_MIN_SNAPSHOT_BUFFER +const char g_frameworkBCBuffer[] = +{ + 0x4a, 0x52, 0x52, 0x59, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x0a, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x04, 0x00, 0x01, 0x00, 0x01, 0x00, 0x03, 0x00, + 0x00, 0x00, 0x00, 0x02, 0x20, 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0x00, 0x28, 0x00, 0x30, 0x28, + 0x01, 0xc3, 0x4f, 0x08, 0x46, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x21, 0x00, 0x03, 0x02, + 0x02, 0x06, 0x0c, 0x0c, 0x07, 0x00, 0x00, 0x00, 0xa7, 0x00, 0x00, 0x00, 0x27, 0x01, 0x00, 0x00, + 0xa7, 0x01, 0x00, 0x00, 0x07, 0x02, 0x00, 0x00, 0x87, 0x02, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, + 0x47, 0x03, 0x00, 0x00, 0xe7, 0x03, 0x00, 0x00, 0x47, 0x04, 0x00, 0x00, 0x28, 0x06, 0x56, 0x02, + 0x60, 0x21, 0x07, 0x28, 0x07, 0x56, 0x03, 0x63, 0x11, 0x0a, 0x2b, 0x03, 0x08, 0x01, 0xb7, 0xc9, + 0x01, 0x21, 0x28, 0x09, 0x56, 0x04, 0x60, 0x21, 0x05, 0x36, 0x04, 0x0a, 0x11, 0x08, 0x29, 0x04, + 0x01, 0xbd, 0x01, 0x0f, 0x28, 0x00, 0x1d, 0x04, 0x28, 0x05, 0xcc, 0x00, 0x28, 0x01, 0xb7, 0xd2, + 0x0b, 0x04, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x01, 0x00, 0x09, 0x00, 0x04, 0x00, + 0x00, 0x09, 0x25, 0x39, 0x07, 0x05, 0x00, 0x00, 0x47, 0x05, 0x00, 0x00, 0x87, 0x05, 0x00, 0x00, + 0xc7, 0x05, 0x00, 0x00, 0x07, 0x06, 0x00, 0x00, 0x47, 0x06, 0x00, 0x00, 0x87, 0x06, 0x00, 0x00, + 0xc7, 0x06, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00, 0x87, 0x07, 0x00, 0x00, 0x07, 0x08, 0x00, 0x00, + 0x67, 0x08, 0x00, 0x00, 0xc7, 0x08, 0x00, 0x00, 0x27, 0x09, 0x00, 0x00, 0xe7, 0x09, 0x00, 0x00, + 0x47, 0x0a, 0x00, 0x00, 0xc7, 0x0a, 0x00, 0x00, 0x87, 0x0b, 0x00, 0x00, 0x67, 0x0c, 0x00, 0x00, + 0xa7, 0x0c, 0x00, 0x00, 0xe7, 0x0c, 0x00, 0x00, 0x67, 0x0d, 0x00, 0x00, 0xe7, 0x0d, 0x00, 0x00, + 0xa7, 0x0e, 0x00, 0x00, 0x87, 0x0f, 0x00, 0x00, 0xe7, 0x0f, 0x00, 0x00, 0x47, 0x10, 0x00, 0x00, + 0xe7, 0x10, 0x00, 0x00, 0x87, 0x11, 0x00, 0x00, 0x07, 0x12, 0x00, 0x00, 0x87, 0x12, 0x00, 0x00, + 0x07, 0x13, 0x00, 0x00, 0x87, 0x13, 0x00, 0x00, 0x27, 0x14, 0x00, 0x00, 0xc7, 0x14, 0x00, 0x00, + 0x27, 0x15, 0x00, 0x00, 0x87, 0x15, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, 0xa0, 0x01, 0x00, 0x00, + 0xc0, 0x01, 0x00, 0x00, 0xe8, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x30, 0x02, 0x00, 0x00, + 0x70, 0x02, 0x00, 0x00, 0xf8, 0x04, 0x00, 0x00, 0x38, 0x05, 0x00, 0x00, 0x90, 0x05, 0x00, 0x00, + 0xd0, 0x05, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x38, 0x06, 0x00, 0x00, 0x50, 0x06, 0x00, 0x00, + 0xf0, 0x06, 0x00, 0x00, 0x40, 0x07, 0x00, 0x00, 0x60, 0x07, 0x00, 0x00, 0x88, 0x07, 0x00, 0x00, + 0xa0, 0x07, 0x00, 0x00, 0x78, 0x09, 0x00, 0x00, 0x41, 0x04, 0x43, 0x05, 0x07, 0x2a, 0x2b, 0x37, + 0x14, 0x1c, 0x18, 0x09, 0x48, 0x25, 0x0a, 0x48, 0x26, 0x0b, 0x48, 0x27, 0x0c, 0xcb, 0x00, 0xce, + 0x28, 0x01, 0xce, 0x29, 0x02, 0x36, 0x05, 0x0d, 0x28, 0x2c, 0xd1, 0x0e, 0x36, 0x05, 0x0d, 0x28, + 0x2d, 0xd1, 0x0f, 0x36, 0x05, 0x0d, 0x28, 0x2e, 0xd1, 0x10, 0x36, 0x05, 0x0d, 0x28, 0x2f, 0xd1, + 0x11, 0x2b, 0x06, 0x12, 0x30, 0xc8, 0x2b, 0x06, 0x13, 0x31, 0xc8, 0x36, 0x06, 0x0d, 0x28, 0x32, + 0xd1, 0x14, 0x36, 0x06, 0x0d, 0x28, 0x33, 0xd1, 0x15, 0x36, 0x06, 0x0d, 0x28, 0x34, 0xd1, 0x16, + 0x36, 0x06, 0x0d, 0x28, 0x35, 0xd1, 0x17, 0x14, 0x48, 0x0a, 0x18, 0x48, 0x0b, 0x19, 0x48, 0x1b, + 0x1a, 0x48, 0x1d, 0x1c, 0x48, 0x1f, 0x1e, 0x48, 0x21, 0x20, 0xcb, 0x04, 0x3b, 0x08, 0x22, 0x28, + 0x04, 0xc0, 0x3a, 0x23, 0x28, 0x36, 0xc0, 0xcb, 0x03, 0x36, 0x07, 0x0d, 0x28, 0x38, 0xd1, 0x24, + 0x47, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x01, 0x00, 0x29, 0x00, 0x04, 0x01, + 0x01, 0x01, 0x03, 0x03, 0x87, 0x07, 0x00, 0x00, 0x07, 0x08, 0x00, 0x00, 0x37, 0x01, 0x3a, 0x02, + 0x28, 0x00, 0xbf, 0x46, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x01, 0x00, 0x29, 0x00, 0x03, 0x00, + 0x00, 0x00, 0x02, 0x02, 0x87, 0x07, 0x00, 0x00, 0x67, 0x08, 0x00, 0x00, 0x37, 0x00, 0x3a, 0x01, + 0xba, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x01, 0x00, 0x29, 0x00, 0x02, 0x00, + 0x00, 0x00, 0x03, 0x03, 0x87, 0x07, 0x00, 0x00, 0x07, 0x16, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x37, 0x00, 0x37, 0x00, 0x35, 0x01, 0x8b, 0x02, 0x34, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x01, 0x00, 0x29, 0x00, 0x02, 0x01, 0x01, 0x01, 0x02, 0x02, 0x07, 0x02, 0x00, 0x00, + 0x28, 0x01, 0x56, 0x00, 0x60, 0x45, 0x00, 0x00, 0x06, 0x00, 0x01, 0x00, 0x29, 0x00, 0x07, 0x03, + 0x03, 0x04, 0x07, 0x07, 0x07, 0x07, 0x00, 0x00, 0x87, 0x16, 0x00, 0x00, 0x87, 0x17, 0x00, 0x00, + 0x47, 0x18, 0x00, 0x00, 0x3b, 0x03, 0x04, 0x29, 0x00, 0x01, 0x14, 0x32, 0x00, 0x4f, 0x18, 0x05, + 0x48, 0x02, 0x06, 0xb3, 0x03, 0x46, 0x00, 0x00, 0x08, 0x00, 0x01, 0x00, 0x29, 0x00, 0x03, 0x04, + 0x04, 0x04, 0x0a, 0x0a, 0xc7, 0x18, 0x00, 0x00, 0x27, 0x19, 0x00, 0x00, 0xc7, 0x19, 0x00, 0x00, + 0x27, 0x1a, 0x00, 0x00, 0xa7, 0x1a, 0x00, 0x00, 0xe7, 0x09, 0x00, 0x00, 0x28, 0x00, 0xd4, 0x04, + 0x28, 0x01, 0xd4, 0x05, 0x28, 0x02, 0xd4, 0x06, 0x28, 0x03, 0xd4, 0x07, 0x3c, 0x09, 0xba, 0xd4, + 0x08, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x09, 0x00, 0x04, 0x01, + 0x01, 0x05, 0x0a, 0x0c, 0x47, 0x05, 0x00, 0x00, 0x87, 0x05, 0x00, 0x00, 0x67, 0x1b, 0x00, 0x00, + 0x07, 0x07, 0x00, 0x00, 0xe7, 0x1b, 0x00, 0x00, 0xa7, 0x1c, 0x00, 0x00, 0x27, 0x1d, 0x00, 0x00, + 0xc7, 0x14, 0x00, 0x00, 0xc7, 0x1d, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00, + 0x42, 0x01, 0x00, 0x31, 0x4f, 0xd4, 0x05, 0x2b, 0x02, 0x01, 0x06, 0x30, 0xb0, 0x03, 0x3b, 0x03, + 0x07, 0x28, 0x01, 0xc0, 0x21, 0x06, 0x29, 0x0a, 0x01, 0xbd, 0x04, 0x3b, 0x04, 0x08, 0x28, 0x01, + 0xc0, 0x3a, 0x09, 0x28, 0x0b, 0xbf, 0x46, 0x00, 0x05, 0x00, 0x01, 0x00, 0x09, 0x00, 0x04, 0x01, + 0x01, 0x03, 0x04, 0x05, 0x07, 0x05, 0x00, 0x00, 0xc7, 0x05, 0x00, 0x00, 0xc7, 0x1d, 0x00, 0x00, + 0x28, 0x00, 0x00, 0x00, 0x42, 0x01, 0x00, 0x3b, 0x02, 0x03, 0x28, 0x04, 0xbf, 0x46, 0x00, 0x00, + 0x07, 0x00, 0x01, 0x00, 0x09, 0x00, 0x04, 0x01, 0x01, 0x05, 0x05, 0x06, 0x47, 0x06, 0x00, 0x00, + 0x47, 0x05, 0x00, 0x00, 0x07, 0x05, 0x00, 0x00, 0x87, 0x05, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, + 0x41, 0x01, 0x42, 0x02, 0x00, 0x36, 0x03, 0x02, 0xcb, 0x01, 0x2b, 0x04, 0x03, 0x02, 0x28, 0x05, + 0xb0, 0x03, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x01, 0x00, 0x19, 0x00, 0x05, 0x00, + 0x00, 0x0a, 0x16, 0x16, 0x87, 0x05, 0x00, 0x00, 0xc7, 0x05, 0x00, 0x00, 0xc7, 0x06, 0x00, 0x00, + 0x67, 0x1b, 0x00, 0x00, 0x67, 0x1e, 0x00, 0x00, 0x47, 0x06, 0x00, 0x00, 0x07, 0x06, 0x00, 0x00, + 0x47, 0x05, 0x00, 0x00, 0x87, 0x06, 0x00, 0x00, 0x07, 0x05, 0x00, 0x00, 0x27, 0x09, 0x00, 0x00, + 0x27, 0x1f, 0x00, 0x00, 0xa7, 0x1f, 0x00, 0x00, 0x07, 0x20, 0x00, 0x00, 0x87, 0x0f, 0x00, 0x00, + 0x47, 0x10, 0x00, 0x00, 0x87, 0x12, 0x00, 0x00, 0x07, 0x16, 0x00, 0x00, 0xc7, 0x1d, 0x00, 0x00, + 0x67, 0x0c, 0x00, 0x00, 0xa7, 0x1c, 0x00, 0x00, 0xa7, 0x0e, 0x00, 0x00, 0x41, 0x02, 0x36, 0x03, + 0x0a, 0x35, 0x0b, 0x3a, 0x0c, 0x28, 0x04, 0xc0, 0xcb, 0x01, 0x3b, 0x05, 0x0d, 0x2a, 0x01, 0xc5, + 0x36, 0x06, 0x0e, 0x67, 0x07, 0x1d, 0x07, 0x36, 0x06, 0x0f, 0x67, 0x07, 0x11, 0x07, 0xcf, 0x01, + 0x00, 0x01, 0x0f, 0x36, 0x06, 0x10, 0x21, 0x0a, 0x3b, 0x01, 0x0b, 0x32, 0x01, 0xc0, 0xcc, 0x00, + 0x04, 0x28, 0x00, 0x21, 0x0e, 0x36, 0x00, 0x11, 0x21, 0x09, 0x3b, 0x00, 0x12, 0x36, 0x08, 0x13, + 0xc0, 0x04, 0x36, 0x09, 0x14, 0xcb, 0x02, 0x28, 0x02, 0x21, 0x06, 0x3b, 0x02, 0x15, 0xba, 0x04, + 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x01, 0x00, 0x29, 0x00, 0x04, 0x01, + 0x01, 0x02, 0x02, 0x03, 0x47, 0x05, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x2b, 0x02, 0x01, 0x00, + 0x36, 0x01, 0x00, 0xb1, 0x03, 0x45, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x09, 0x00, 0x07, 0x03, + 0x03, 0x07, 0x0c, 0x0e, 0x07, 0x06, 0x00, 0x00, 0x87, 0x05, 0x00, 0x00, 0x47, 0x06, 0x00, 0x00, + 0x07, 0x07, 0x00, 0x00, 0xa7, 0x1c, 0x00, 0x00, 0x87, 0x16, 0x00, 0x00, 0x87, 0x17, 0x00, 0x00, + 0x87, 0x20, 0x00, 0x00, 0xe7, 0x20, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, + 0x41, 0x03, 0x42, 0x04, 0x01, 0x42, 0x05, 0x02, 0x36, 0x00, 0x07, 0xcb, 0x03, 0x3b, 0x06, 0x08, + 0x29, 0x00, 0x04, 0x14, 0x31, 0x4f, 0x18, 0x09, 0x48, 0x0c, 0x0a, 0x48, 0x0d, 0x0b, 0xb3, 0x03, + 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x29, 0x00, 0x05, 0x00, + 0x02, 0x07, 0x0c, 0x0c, 0x07, 0x05, 0x00, 0x00, 0x07, 0x06, 0x00, 0x00, 0x87, 0x05, 0x00, 0x00, + 0x87, 0x06, 0x00, 0x00, 0x47, 0x06, 0x00, 0x00, 0xc7, 0x08, 0x00, 0x00, 0xc7, 0x0a, 0x00, 0x00, + 0x67, 0x0c, 0x00, 0x00, 0xa7, 0x0c, 0x00, 0x00, 0xe7, 0x0d, 0x00, 0x00, 0x3b, 0x02, 0x07, 0xba, + 0xd7, 0x00, 0x28, 0x00, 0x21, 0x09, 0x3b, 0x00, 0x08, 0x29, 0x03, 0x04, 0xc6, 0x04, 0x3b, 0x05, + 0x09, 0x28, 0x06, 0xc0, 0xd7, 0x01, 0x3b, 0x05, 0x0a, 0x28, 0x01, 0xc0, 0x21, 0x09, 0x3b, 0x01, + 0x0b, 0x29, 0x03, 0x04, 0xc6, 0x04, 0x47, 0x06, 0x05, 0x00, 0x01, 0x00, 0x29, 0x00, 0x04, 0x01, + 0x01, 0x04, 0x05, 0x05, 0x47, 0x06, 0x00, 0x00, 0x07, 0x06, 0x00, 0x00, 0x87, 0x05, 0x00, 0x00, + 0x67, 0x0d, 0x00, 0x00, 0xce, 0x00, 0x01, 0x3b, 0x02, 0x04, 0x28, 0x03, 0xbf, 0x46, 0x00, 0x00, + 0x08, 0x00, 0x01, 0x00, 0x29, 0x00, 0x06, 0x00, 0x00, 0x01, 0x06, 0x06, 0x07, 0x05, 0x00, 0x00, + 0x07, 0x08, 0x00, 0x00, 0x27, 0x19, 0x00, 0x00, 0xa7, 0x1f, 0x00, 0x00, 0xc7, 0x18, 0x00, 0x00, + 0x67, 0x08, 0x00, 0x00, 0x00, 0x15, 0x10, 0x3b, 0x00, 0x01, 0x30, 0xbf, 0x37, 0x02, 0x3a, 0x03, + 0x37, 0x04, 0xc0, 0x45, 0x00, 0x1d, 0x08, 0x3b, 0x00, 0x05, 0xb9, 0x10, 0x46, 0x00, 0x00, 0x00, + 0x0b, 0x00, 0x01, 0x00, 0x29, 0x00, 0x07, 0x00, 0x04, 0x05, 0x0b, 0x0b, 0x47, 0x05, 0x00, 0x00, + 0xa7, 0x1a, 0x00, 0x00, 0xe7, 0x09, 0x00, 0x00, 0xc7, 0x18, 0x00, 0x00, 0x27, 0x1a, 0x00, 0x00, + 0xc7, 0x19, 0x00, 0x00, 0xa7, 0x1f, 0x00, 0x00, 0x37, 0x05, 0xd7, 0x00, 0x3c, 0x06, 0xba, 0xd7, + 0x01, 0x37, 0x07, 0xd7, 0x02, 0x37, 0x08, 0xd7, 0x03, 0x6b, 0x01, 0x00, 0x1d, 0x06, 0x29, 0x04, + 0x01, 0xbd, 0x21, 0x12, 0x37, 0x09, 0x3a, 0x0a, 0x2b, 0x02, 0x01, 0x00, 0x28, 0x03, 0xb3, 0x04, + 0x28, 0x01, 0xd5, 0x05, 0x04, 0x46, 0x00, 0x00, 0x08, 0x00, 0x01, 0x00, 0x29, 0x00, 0x05, 0x02, + 0x03, 0x03, 0x07, 0x07, 0xe7, 0x0c, 0x00, 0x00, 0x47, 0x03, 0x00, 0x00, 0x47, 0x21, 0x00, 0x00, + 0x07, 0x08, 0x00, 0x00, 0x3b, 0x00, 0x03, 0x28, 0x01, 0x30, 0xc6, 0xd7, 0x02, 0x28, 0x04, 0x56, + 0x02, 0x60, 0x21, 0x11, 0x37, 0x05, 0x1d, 0x05, 0x1c, 0xd5, 0x05, 0x04, 0x37, 0x05, 0x3a, 0x06, + 0x28, 0x02, 0xc0, 0x04, 0x46, 0x00, 0x00, 0x00, 0x06, 0x00, 0x01, 0x00, 0x29, 0x00, 0x03, 0x00, + 0x01, 0x01, 0x04, 0x04, 0x47, 0x21, 0x00, 0x00, 0x67, 0x08, 0x00, 0x00, 0x07, 0x16, 0x00, 0x00, + 0x37, 0x01, 0xd7, 0x00, 0x28, 0x00, 0x11, 0x0e, 0x01, 0x07, 0x3b, 0x00, 0x02, 0xba, 0xb6, 0x36, + 0x00, 0x03, 0x0d, 0x08, 0x46, 0x00, 0x00, 0x00, 0x07, 0x00, 0x01, 0x00, 0x29, 0x00, 0x02, 0x01, + 0x01, 0x03, 0x04, 0x04, 0x47, 0x05, 0x00, 0x00, 0x87, 0x06, 0x00, 0x00, 0xa7, 0x1c, 0x00, 0x00, + 0x28, 0x00, 0x21, 0x06, 0x29, 0x01, 0x00, 0xbd, 0x11, 0x12, 0x36, 0x00, 0x03, 0x11, 0x07, 0x36, + 0x00, 0x03, 0x01, 0x06, 0x29, 0x02, 0x00, 0x3f, 0x01, 0x04, 0x28, 0x00, 0x45, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x01, 0x00, 0x29, 0x00, 0x01, 0x01, 0x01, 0x01, 0x02, 0x02, 0xe7, 0x1b, 0x00, 0x00, + 0x28, 0x00, 0x21, 0x05, 0x36, 0x00, 0x01, 0x45, 0x0e, 0x00, 0x01, 0x00, 0x09, 0x00, 0x04, 0x02, + 0x02, 0x04, 0x08, 0x09, 0x87, 0x05, 0x00, 0x00, 0x47, 0x05, 0x00, 0x00, 0x07, 0x22, 0x00, 0x00, + 0xa7, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x08, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, + 0x41, 0x02, 0x42, 0x03, 0x01, 0x31, 0x53, 0x6a, 0x00, 0x21, 0x04, 0x28, 0x03, 0x11, 0x34, 0x37, + 0x04, 0x1d, 0x05, 0x14, 0xd5, 0x04, 0x04, 0x37, 0x04, 0x35, 0x00, 0x1d, 0x08, 0x37, 0x04, 0x28, + 0x00, 0x1c, 0xc9, 0x04, 0x37, 0x04, 0x35, 0x00, 0xcb, 0x02, 0x3b, 0x02, 0x05, 0x28, 0x03, 0xc0, + 0x6d, 0x06, 0x11, 0x0c, 0x3b, 0x02, 0x07, 0x28, 0x03, 0xbf, 0x28, 0x08, 0x01, 0x04, 0x31, 0x53, + 0x45, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x01, 0x00, 0x29, 0x00, 0x07, 0x00, + 0x00, 0x02, 0x04, 0x04, 0x87, 0x05, 0x00, 0x00, 0x47, 0x05, 0x00, 0x00, 0x07, 0x13, 0x00, 0x00, + 0xa7, 0x22, 0x00, 0x00, 0x3b, 0x00, 0x02, 0x3b, 0x00, 0x03, 0x28, 0x01, 0xc0, 0x32, 0x00, 0xc5, + 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x01, 0x00, 0x29, 0x00, 0x04, 0x01, + 0x01, 0x01, 0x03, 0x04, 0x07, 0x22, 0x00, 0x00, 0xc7, 0x1d, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, + 0x31, 0x53, 0x6a, 0x00, 0x21, 0x15, 0x37, 0x01, 0x21, 0x11, 0x37, 0x01, 0x35, 0x00, 0x21, 0x0b, + 0x37, 0x01, 0x35, 0x00, 0x3a, 0x02, 0x28, 0x03, 0xc0, 0x04, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x01, 0x00, 0x29, 0x00, 0x03, 0x01, 0x01, 0x01, 0x02, 0x02, 0x47, 0x0a, 0x00, 0x00, + 0x3b, 0x00, 0x01, 0xba, 0x45, 0x00, 0x00, 0x00, 0x04, 0x00, 0x01, 0x00, 0x29, 0x00, 0x02, 0x02, + 0x02, 0x02, 0x04, 0x04, 0x47, 0x23, 0x00, 0x00, 0xe7, 0x23, 0x00, 0x00, 0x28, 0x00, 0xd4, 0x02, + 0x28, 0x01, 0xd4, 0x03, 0x46, 0x00, 0x00, 0x00, 0x05, 0x00, 0x01, 0x00, 0x29, 0x00, 0x04, 0x00, + 0x00, 0x00, 0x03, 0x03, 0x47, 0x23, 0x00, 0x00, 0x67, 0x0d, 0x00, 0x00, 0xe7, 0x23, 0x00, 0x00, + 0x37, 0x00, 0x21, 0x09, 0x37, 0x00, 0x3a, 0x01, 0x37, 0x02, 0xc0, 0x04, 0x46, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x01, 0x00, 0x29, 0x00, 0x01, 0x01, 0x01, 0x02, 0x02, 0x02, 0x07, 0x06, 0x00, 0x00, + 0x36, 0x01, 0x00, 0x45, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x01, 0x00, 0x09, 0x00, 0x04, 0x01, + 0x01, 0x05, 0x08, 0x09, 0x47, 0x05, 0x00, 0x00, 0x07, 0x05, 0x00, 0x00, 0xc7, 0x06, 0x00, 0x00, + 0x07, 0x07, 0x00, 0x00, 0x47, 0x24, 0x00, 0x00, 0xc7, 0x14, 0x00, 0x00, 0xc7, 0x1d, 0x00, 0x00, + 0x50, 0x00, 0x00, 0x00, 0x41, 0x01, 0x42, 0x02, 0x00, 0x2a, 0x03, 0x7b, 0x4f, 0x11, 0x07, 0x29, + 0x03, 0x02, 0x3f, 0x45, 0x30, 0xd5, 0x05, 0xcb, 0x01, 0x3b, 0x04, 0x06, 0x28, 0x02, 0xc0, 0x3a, + 0x07, 0x28, 0x08, 0xbf, 0x46, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x01, 0x00, 0x29, 0x00, 0x06, 0x01, + 0x02, 0x05, 0x0b, 0x0c, 0x07, 0x05, 0x00, 0x00, 0x47, 0x05, 0x00, 0x00, 0xa7, 0x24, 0x00, 0x00, + 0xa7, 0x25, 0x00, 0x00, 0x27, 0x26, 0x00, 0x00, 0xc7, 0x26, 0x00, 0x00, 0x27, 0x27, 0x00, 0x00, + 0x47, 0x03, 0x00, 0x00, 0xe7, 0x27, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x36, 0x02, 0x00, 0xd7, + 0x01, 0x68, 0x05, 0x00, 0x11, 0x09, 0x2b, 0x03, 0x06, 0x01, 0xc9, 0x01, 0x2a, 0x68, 0x07, 0x00, + 0x11, 0x09, 0x2b, 0x0b, 0x03, 0x01, 0xc3, 0x01, 0x1e, 0x68, 0x08, 0x00, 0x11, 0x08, 0x29, 0x04, + 0x01, 0xbd, 0x01, 0x13, 0x28, 0x09, 0x56, 0x01, 0x60, 0x21, 0x0c, 0x2b, 0x03, 0x00, 0x01, 0x3a, + 0x0a, 0x28, 0x03, 0xc0, 0xc9, 0x04, 0x46, 0x00, 0x0c, 0x00, 0x01, 0x00, 0x09, 0x00, 0x05, 0x02, + 0x02, 0x06, 0x0b, 0x0c, 0x07, 0x05, 0x00, 0x00, 0x47, 0x05, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00, + 0x87, 0x06, 0x00, 0x00, 0x47, 0x03, 0x00, 0x00, 0xa7, 0x1f, 0x00, 0x00, 0xc7, 0x14, 0x00, 0x00, + 0xc7, 0x1d, 0x00, 0x00, 0x67, 0x0c, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x42, 0x02, 0x00, 0x42, + 0x03, 0x01, 0x28, 0x06, 0x56, 0x03, 0x60, 0x21, 0x0b, 0x3b, 0x03, 0x07, 0x29, 0x02, 0x02, 0xc6, + 0xcc, 0x03, 0x04, 0x3b, 0x04, 0x08, 0x28, 0x03, 0xc0, 0x3a, 0x09, 0x28, 0x0b, 0xbf, 0x3b, 0x05, + 0x0a, 0x28, 0x03, 0xbf, 0x46, 0x00, 0x00, 0x00, 0x05, 0x00, 0x01, 0x00, 0x29, 0x00, 0x04, 0x01, + 0x01, 0x03, 0x03, 0x04, 0x07, 0x05, 0x00, 0x00, 0x47, 0x05, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, + 0x2b, 0x03, 0x01, 0x02, 0x28, 0x00, 0xb1, 0x03, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x0b, 0x00, 0x01, 0x00, 0x09, 0x00, 0x07, 0x03, 0x03, 0x06, 0x0b, 0x0d, 0x47, 0x05, 0x00, 0x00, + 0x87, 0x05, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00, 0x87, 0x16, 0x00, 0x00, 0x87, 0x17, 0x00, 0x00, + 0x47, 0x28, 0x00, 0x00, 0x87, 0x20, 0x00, 0x00, 0xe7, 0x20, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, + 0x70, 0x00, 0x00, 0x00, 0x42, 0x03, 0x01, 0x42, 0x04, 0x02, 0x3b, 0x05, 0x06, 0x29, 0x00, 0x04, + 0x14, 0x32, 0x00, 0x4f, 0x18, 0x07, 0x31, 0x4f, 0x18, 0x08, 0x48, 0x0b, 0x09, 0x48, 0x0c, 0x0a, + 0xb3, 0x03, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x01, 0x00, 0x29, 0x00, 0x01, 0x00, + 0x00, 0x02, 0x02, 0x02, 0x47, 0x05, 0x00, 0x00, 0x87, 0x05, 0x00, 0x00, 0x36, 0x00, 0x01, 0x45, + 0x04, 0x00, 0x01, 0x00, 0x29, 0x00, 0x03, 0x01, 0x01, 0x03, 0x03, 0x03, 0x47, 0x05, 0x00, 0x00, + 0x87, 0x05, 0x00, 0x00, 0x2b, 0x01, 0x02, 0x00, 0xc8, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x01, 0x00, 0x29, 0x00, 0x05, 0x03, 0x03, 0x04, 0x04, 0x04, 0x47, 0x06, 0x00, 0x00, + 0x28, 0x03, 0x2a, 0x00, 0x29, 0x01, 0x02, 0x3d, 0x04, 0x45, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x07, 0x00, 0x65, 0x78, 0x70, 0x6f, 0x72, 0x74, 0x73, 0x00, 0x06, 0x00, 0x6d, 0x6f, 0x64, 0x75, + 0x6c, 0x65, 0x06, 0x00, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, 0x04, 0x00, 0x73, 0x65, 0x6c, 0x66, + 0x06, 0x00, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x09, 0x00, 0x75, 0x6e, 0x64, 0x65, 0x66, 0x69, + 0x6e, 0x65, 0x64, 0x00, 0x08, 0x00, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x03, 0x00, + 0x61, 0x6d, 0x64, 0x00, 0x09, 0x00, 0x56, 0x69, 0x65, 0x77, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x00, + 0x01, 0x00, 0x74, 0x00, 0x01, 0x00, 0x65, 0x00, 0x01, 0x00, 0x6e, 0x00, 0x01, 0x00, 0x72, 0x00, + 0x01, 0x00, 0x73, 0x00, 0x01, 0x00, 0x69, 0x00, 0x01, 0x00, 0x6f, 0x00, 0x01, 0x00, 0x63, 0x00, + 0x06, 0x00, 0x4f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x05, 0x00, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x00, + 0x04, 0x00, 0x70, 0x75, 0x73, 0x68, 0x03, 0x00, 0x70, 0x6f, 0x70, 0x00, 0x03, 0x00, 0x74, 0x6f, + 0x70, 0x00, 0x09, 0x00, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x74, 0x79, 0x70, 0x65, 0x00, 0x04, 0x00, + 0x5f, 0x67, 0x65, 0x74, 0x06, 0x00, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x09, 0x00, 0x73, 0x75, + 0x62, 0x73, 0x63, 0x72, 0x69, 0x62, 0x65, 0x00, 0x0b, 0x00, 0x75, 0x6e, 0x73, 0x75, 0x62, 0x73, + 0x63, 0x72, 0x69, 0x62, 0x65, 0x00, 0x02, 0x00, 0x6f, 0x66, 0x02, 0x00, 0x69, 0x73, 0x06, 0x00, + 0x61, 0x74, 0x74, 0x61, 0x63, 0x68, 0x06, 0x00, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x09, 0x00, + 0x73, 0x65, 0x74, 0x50, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x00, 0x0c, 0x00, 0x6e, 0x6f, 0x74, 0x69, + 0x66, 0x79, 0x50, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x04, 0x00, 0x50, 0x55, 0x53, 0x48, 0x03, 0x00, + 0x50, 0x4f, 0x50, 0x00, 0x07, 0x00, 0x55, 0x4e, 0x53, 0x48, 0x49, 0x46, 0x54, 0x00, 0x07, 0x00, + 0x75, 0x6e, 0x73, 0x68, 0x69, 0x66, 0x74, 0x00, 0x05, 0x00, 0x53, 0x48, 0x49, 0x46, 0x54, 0x00, + 0x05, 0x00, 0x73, 0x68, 0x69, 0x66, 0x74, 0x00, 0x06, 0x00, 0x53, 0x50, 0x4c, 0x49, 0x43, 0x45, + 0x06, 0x00, 0x73, 0x70, 0x6c, 0x69, 0x63, 0x65, 0x07, 0x00, 0x52, 0x45, 0x56, 0x45, 0x52, 0x53, + 0x45, 0x00, 0x07, 0x00, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x00, 0x04, 0x00, 0x6b, 0x65, + 0x79, 0x73, 0x03, 0x00, 0x6d, 0x61, 0x70, 0x00, 0x06, 0x00, 0x24, 0x77, 0x61, 0x74, 0x63, 0x68, + 0x06, 0x00, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x0e, 0x00, 0x64, 0x65, 0x66, 0x69, 0x6e, 0x65, + 0x50, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x79, 0x0a, 0x00, 0x65, 0x6e, 0x75, 0x6d, 0x65, 0x72, + 0x61, 0x62, 0x6c, 0x65, 0x05, 0x00, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x00, 0x04, 0x00, 0x5f, 0x63, + 0x74, 0x78, 0x07, 0x00, 0x5f, 0x67, 0x65, 0x74, 0x74, 0x65, 0x72, 0x00, 0x03, 0x00, 0x5f, 0x66, + 0x6e, 0x00, 0x05, 0x00, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x00, 0x0a, 0x00, 0x5f, 0x6c, 0x61, 0x73, + 0x74, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x05, 0x00, 0x41, 0x72, 0x72, 0x61, 0x79, 0x00, 0x0a, 0x00, + 0x5f, 0x68, 0x69, 0x6a, 0x61, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x06, 0x00, 0x5f, 0x5f, 0x6f, 0x62, + 0x5f, 0x5f, 0x07, 0x00, 0x69, 0x73, 0x41, 0x72, 0x72, 0x61, 0x79, 0x00, 0x07, 0x00, 0x66, 0x6f, + 0x72, 0x45, 0x61, 0x63, 0x68, 0x00, 0x09, 0x00, 0x61, 0x72, 0x67, 0x75, 0x6d, 0x65, 0x6e, 0x74, + 0x73, 0x00, 0x05, 0x00, 0x73, 0x6c, 0x69, 0x63, 0x65, 0x00, 0x04, 0x00, 0x63, 0x61, 0x6c, 0x6c, + 0x05, 0x00, 0x61, 0x70, 0x70, 0x6c, 0x79, 0x00, 0x03, 0x00, 0x67, 0x65, 0x74, 0x00, 0x03, 0x00, + 0x73, 0x65, 0x74, 0x00, 0x09, 0x00, 0x5f, 0x64, 0x65, 0x74, 0x61, 0x63, 0x68, 0x65, 0x73, 0x00, + 0x07, 0x00, 0x5f, 0x6f, 0x62, 0x73, 0x4d, 0x61, 0x70, 0x00, 0x07, 0x00, 0x69, 0x6e, 0x64, 0x65, + 0x78, 0x4f, 0x66, 0x00, 0x07, 0x00, 0x5f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x00, 0x04, 0x00, + 0x5f, 0x6b, 0x65, 0x79, 0x03, 0x00, 0x5f, 0x76, 0x6d, 0x00, 0x0e, 0x00, 0x69, 0x6e, 0x69, 0x74, + 0x53, 0x74, 0x79, 0x6c, 0x65, 0x53, 0x68, 0x65, 0x65, 0x74, 0x06, 0x00, 0x72, 0x65, 0x6e, 0x64, + 0x65, 0x72, 0x07, 0x00, 0x24, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x00, 0x04, 0x00, 0x64, 0x61, + 0x74, 0x61, 0x0a, 0x00, 0x73, 0x74, 0x79, 0x6c, 0x65, 0x53, 0x68, 0x65, 0x65, 0x74, 0x04, 0x00, + 0x62, 0x69, 0x6e, 0x64, 0x0c, 0x00, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x75, 0x72, 0x61, 0x62, + 0x6c, 0x65 +}; +#endif \ No newline at end of file diff --git a/src/core/base/framework_min_js.h b/src/core/base/framework_min_js.h new file mode 100755 index 0000000..646cc54 --- /dev/null +++ b/src/core/base/framework_min_js.h @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2020 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. + */ + +// AUTO GENERATED, PLEASE DO NOT EDIT DIRECTLY + +#ifndef ACELITE_FRAMEWORK_RAW_BUFFER +#error THIS FILE CAN ONLY BE INCLUDED BY RAW BUFFER CPP +#endif + +#ifndef OHOS_ACELITE_FRAMEWORK_MIN_JS_BUFFER +#define OHOS_ACELITE_FRAMEWORK_MIN_JS_BUFFER +const char * const g_frameworkJSBuffer = + "!function(t,e){'object'==typeof exports&&'undefined'!=typeof module?module.exports=e():'fun" + "ction'==typeof define&&define.amd?define(e):(t=t||self).ViewModel=e()}(this,(function(){'u" + "se strict';var t={stack:[],push:function(t){this.stack.push(t)},pop:function(){return this" + ".stack.pop()},top:function(){return this.stack[this.stack.length-1]}},e=function(t){return" + "'object'==typeof t},n=function(t,e,n){Object.defineProperty(t,e,{enumerable:!1,value:n})};" + "function i(t,e,n,i){this._ctx=t,this._getter=e,this._fn=n,this._meta=i,this._lastValue=thi" + "s._get()}function o(e){this._hijacking=!0,n(e,'__ob__',this),Array.isArray(e)&&function(t)" + "{r.forEach((function(e){var i=t[e];n(t,e,(function(){var n,r=Array.prototype.slice.call(ar" + "guments);i.apply(this,r),s.PUSH===e||s.UNSHIFT===e?n=r:s.SPLICE&&(n=r.slice(2)),n&&n.lengt" + "h&&n.forEach(o.of);var c=t.__ob__;c&&c.notifyParent()}))}))}(e),Object.keys(e).forEach((fu" + "nction(n){return function(e,n,i){var s=e.__ob__;Object.defineProperty(e,n,{enumerable:!0,g" + "et:function(){var e=t.top();e&&e.subscribe(s,n);var r=o.of(i);return o.is(r)&&r.setParent(" + "s,n),i},set:function(t){i=t,s.notify(n)}})}(e,n,e[n])}))}i.prototype._get=function(){try{r" + "eturn t.push(this),this._getter.call(this._ctx)}finally{t.pop()}},i.prototype.update=funct" + "ion(){var t=this._lastValue,n=this._get(),i=this._ctx,o=this._meta;(n!==t||e(n))&&(this._f" + "n.call(i,n,t,o),this._lastValue=n)},i.prototype.subscribe=function(t,e){var n=t.attach(e,t" + "his);'function'==typeof n&&(this._detaches||(this._detaches=[]),this._detaches.push(n))},i" + ".prototype.unsubscribe=function(){var t=this._detaches;if(t)for(;t.length;)t.pop()()},o.of" + "=function(t){return t&&e(t)?t.__ob__?t.__ob__:new o(t):t},o.is=function(t){return t&&t._hi" + "jacking},o.prototype.attach=function(t,e){if(void 0!==t&&e){this._obsMap||(this._obsMap={}" + "),this._obsMap[t]||(this._obsMap[t]=[]);var n=this._obsMap[t];return n.indexOf(e)<0?(n.pus" + "h(e),function(){n.splice(n.indexOf(e),1)}):void 0}},o.prototype.notify=function(t){void 0!" + "==t&&this._obsMap&&this._obsMap[t]&&this._obsMap[t].forEach((function(t){return t.update()" + "}))},o.prototype.setParent=function(t,e){this._parent=t,this._key=e},o.prototype.notifyPar" + "ent=function(){this._parent&&this._parent.notify(this._key)};var s={PUSH:'push',POP:'pop'," + "UNSHIFT:'unshift',SHIFT:'shift',SPLICE:'splice',REVERSE:'reverse'},r=Object.keys(s).map((f" + "unction(t){return s[t]}));function c(t){if(!(this instanceof c))return new c(t);var e=this" + "._vm=this;Object.keys(t).forEach((function(n){var i=t[n];'render'===n?e.$render=i:'data'==" + "=n?function(t,e){'function'==typeof e&&(e=e.call(t,t));Object.keys(e).forEach((function(n)" + "{return function(t,e,n){Object.defineProperty(t,n,{enumerable:!1,configurable:!0,get:funct" + "ion(){return e[n]},set:function(t){e[n]=t}})}(t,e,n)})),o.of(e)}(e,i):'styleSheet'===n?ini" + "tStyleSheet(i):'function'==typeof i&&(e[n]=i.bind(e))}))}return c.prototype.$watch=functio" + "n(t,e,n){return new i(this,t,e,n)},c}));"; +#endif \ No newline at end of file diff --git a/src/core/base/js_debugger_config.cpp b/src/core/base/js_debugger_config.cpp new file mode 100755 index 0000000..fc9f3ce --- /dev/null +++ b/src/core/base/js_debugger_config.cpp @@ -0,0 +1,184 @@ +/* + * Copyright (c) 2020 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. + */ +#include "js_debugger_config.h" +#include +#include "ace_log.h" +#include "debugger.h" +#include "handler.h" +#include "jerryscript-port-default.h" +#include "jerryscript-port.h" +#include "js_fwk_common.h" + +namespace OHOS { +namespace ACELite { +#if ENABLED(ENGINE_DEBUGGER) +bool Debugger::IsDebuggerEnabled() +{ + return debuggerConfig_.startDebuggerServer; +} + +void Debugger::ConfigEngineDebugger(DebuggerConfig &config) +{ + if (memcpy_s(&debuggerConfig_, sizeof(DebuggerConfig), &config, sizeof(DebuggerConfig)) != 0) { + HILOG_ERROR(HILOG_MODULE_ACE, "ConfigEngineDebugger memcpy_s failed!"); + return; + } + ConfigDebugger(); +} + +void Debugger::StartDebugger() +{ + if ((!debuggerConfig_.startDebuggerServer) || !(jerry_is_feature_enabled(JERRY_FEATURE_DEBUGGER))) { + return; + } + + if (debuggerStarted_) { + // already started, avoid creating tcp repeat + return; + } + // increase jerry log level to see the Waiting for client connection message + jerry_port_default_set_log_level(JERRY_LOG_LEVEL_DEBUG); + // currently, only support tcp::websocket + HILOG_INFO(HILOG_MODULE_ACE, "please connect to debugger server with localhost:%d", debuggerConfig_.port); + bool protocol = jerryx_debugger_tcp_create(debuggerConfig_.port); + bool connected = jerryx_debugger_ws_create(); + jerryx_debugger_after_connect(protocol && connected); + debuggerStarted_ = true; +} +void Debugger::TearDownDebugger() +{ + if (consoleLogFileHandler_ != nullptr) { + fclose(consoleLogFileHandler_); + consoleLogFileHandler_ = nullptr; + } + if ((!debuggerConfig_.startDebuggerServer) || !(jerry_is_feature_enabled(JERRY_FEATURE_DEBUGGER))) { + return; + } + // no need to check debuggerStarted_ flag, as the lower interface is reenterable + jerry_debugger_stop(); + debuggerStarted_ = false; +} + +void Debugger::ConfigDebugger() +{ + if (consoleLogFileHandler_ != nullptr) { + fclose(consoleLogFileHandler_); + consoleLogFileHandler_ = nullptr; + } + + if ((debuggerConfig_.logToFile)) { + if ((debuggerConfig_.logFilePath != nullptr) && (strlen(debuggerConfig_.logFilePath) > 0)) { + consoleLogFileHandler_ = fopen(debuggerConfig_.logFilePath, "w+"); + if (consoleLogFileHandler_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "can not open the console log output file"); + } + } + } +} + +void Debugger::Output(const char * const str) +{ + // if debugger enabled, get config from debugger config + if (consoleLogFileHandler_ != nullptr) { + int res = fputs(str, consoleLogFileHandler_); + if (res == EOF) { + // write file error + HILOG_ERROR(HILOG_MODULE_ACE, "write log file failed"); + } + } + // print out the log into stdout anyway + printf("%s", str); +} +void Debugger::FlushOutput() +{ + if (consoleLogFileHandler_ != nullptr) { + fflush(consoleLogFileHandler_); + } + fflush(stdout); +} + +#ifdef JS_ENGINE_EXTERNAL_CONTEXT +static void *AllocEngineContext(size_t size, void *cbDataP) +{ + (void)(cbDataP); + return ace_malloc(size); +} +#endif // JS_ENGINE_EXTERNAL_CONTEXT + +void Debugger::SetupJSContext() +{ +#ifdef JS_ENGINE_EXTERNAL_CONTEXT + if (engineContext_ != nullptr) { + // do not repeat the setup process + return; + } + uint32_t heapSize = debuggerConfig_.heapSize; + if (heapSize == 0) { + // default is 48KB + const uint32_t DEFAULT_HEAP_SIZE = 48 * 1024; + heapSize = DEFAULT_HEAP_SIZE; + } + engineContext_ = jerry_create_context(heapSize, AllocEngineContext, nullptr); + if (engineContext_ == nullptr) { + return; + } + jerry_port_default_set_current_context(static_cast(engineContext_)); +#endif // JS_ENGINE_EXTERNAL_CONTEXT +} + +void Debugger::ReleaseJSContext() +{ +#ifdef JS_ENGINE_EXTERNAL_CONTEXT + if (engineContext_ == nullptr) { + return; + } + ace_free(engineContext_); + engineContext_ = nullptr; +#endif // JS_ENGINE_EXTERNAL_CONTEXT +} +#else // ENABLED(ENGINE_DEBUGGER) +bool Debugger::IsDebuggerEnabled() +{ + return true; +} +void Debugger::ConfigEngineDebugger(DebuggerConfig &config) +{ + UNUSED(config); +} +void Debugger::StartDebugger() +{ +} +void Debugger::TearDownDebugger() +{ +} +void Debugger::ConfigDebugger() +{ +} +void Debugger::Output(const char * const str) +{ + UNUSED(str); +} +void Debugger::FlushOutput() +{ +} +void Debugger::SetupJSContext() +{ +} +void Debugger::ReleaseJSContext() +{ +} +#endif // ENABLED(ENGINE_DEBUGGER) +} // namespace ACELite +} // namespace OHOS diff --git a/src/core/base/js_fwk_common.cpp b/src/core/base/js_fwk_common.cpp new file mode 100755 index 0000000..b2da8b0 --- /dev/null +++ b/src/core/base/js_fwk_common.cpp @@ -0,0 +1,1317 @@ +/* + * Copyright (c) 2020 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. + */ +#include "js_fwk_common.h" +#include "ace_event_error_code.h" +#include "ace_log.h" +#include "ace_mem_base.h" +#include "component.h" +#include "component_utils.h" +#include "fatal_handler.h" +#include "file.h" +#include "js_app_context.h" +#include "js_app_environment.h" +#include "js_profiler.h" +#if ENABLED(CONSOLE_LOG_OUTPUT) +#include "presets/console_module.h" +#endif +#if ENABLED(SECURE_C_FUNCTION) +#include "securec.h" +#endif // ENABLED(SECURE_C_FUNCTION) +#include "presets/console_log_impl.h" +#include "task_manager.h" + +#if defined(__LITEOS__) +#include +#include +#include +#endif + +#if ((defined __LITEOS__) || (defined __linux__) || (defined SCREENRESOLUTION_CMAKE)) +#include +#endif + +#include +#include +#include + +namespace OHOS { +namespace ACELite { +void JerrySetNamedProperty(jerry_value_t object, const char * const name, jerry_value_t propValue) +{ + jerry_release_value(jerryx_set_property_str(object, name, propValue)); +} + +void JerrySetNumberProperty(jerry_value_t object, const char * const name, double value) +{ + jerry_value_t numValue = jerry_create_number(value); + JerrySetNamedProperty(object, name, numValue); + jerry_release_value(numValue); +} + +void JerrySetStringProperty(jerry_value_t object, const char * const name, const char * const value) +{ + jerry_value_t strValue = jerry_create_string(reinterpret_cast(value)); + JerrySetNamedProperty(object, name, strValue); + jerry_release_value(strValue); +} + +void JerrySetStringProperty(jerry_value_t object, const char * const name, const char * const value, uint32_t length) +{ + jerry_value_t strValue = jerry_create_string_sz_from_utf8(reinterpret_cast(value), length); + JerrySetNamedProperty(object, name, strValue); + jerry_release_value(strValue); +} + +char *JerryMallocStringProperty(const jerry_value_t object, const char * const name, uint16_t &length) +{ + jerry_value_t propValue = jerryx_get_property_str(object, name); + char *res = MallocStringOf(propValue, &length); + jerry_release_value(propValue); + return res; +} + +int16_t JerryGetIntegerProperty(jerry_value_t object, const char * const name) +{ + jerry_value_t value = jerryx_get_property_str(object, name); + int16_t result = IntegerOf(value); + jerry_release_value(value); + return result; +} + +void JerrySetFuncProperty(jerry_value_t object, const char * const name, jerry_external_handler_t handler) +{ + if (name == nullptr || !strlen(name)) { + HILOG_ERROR(HILOG_MODULE_ACE, "Failed to set function property cause by empty name."); + return; + } + + if (handler == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "Failed to set function property cause by empty handler."); + return; + } + + jerry_value_t func = jerry_create_external_function(handler); + jerryx_set_property_str(object, name, func); + jerry_release_value(func); +} + +/* return value must be freed by caller, except the returned value is nullptr */ +char *MallocStringOf(jerry_value_t source) +{ + uint16_t length = 0; + return MallocStringOf(source, &length); +} + +char *MallocStringOf(jerry_value_t source, uint16_t *strLength) +{ + if (strLength == nullptr) { + return nullptr; + } + *strLength = 0; + if (IS_UNDEFINED(source)) { + return nullptr; + } + jerry_value_t target; + if (jerry_value_is_symbol(source)) { + target = jerry_get_symbol_descriptive_string(source); + } else { + target = jerry_value_to_string(source); + } + if (IS_ERROR_VALUE(target)) { + HILOG_ERROR(HILOG_MODULE_ACE, "jerry_value_to_string failed, can not continue to generate char buffer"); + jerry_release_value(target); + return nullptr; + } + jerry_size_t size = jerry_get_string_size(target); + if (size == 0) { + jerry_release_value(target); + // return empty char instead of nullptr, so caller can free safely if source is JS empty string + char *emptyStr = static_cast(ace_malloc(sizeof(char))); + if (emptyStr == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "malloc buffer failed for empty str"); + return nullptr; + } + emptyStr[0] = '\0'; + return emptyStr; + } + if (size >= UINT16_MAX) { + jerry_release_value(target); + return nullptr; + } + jerry_char_t *buffer = static_cast(ace_malloc(sizeof(jerry_char_t) * (size + 1))); + if (buffer == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "malloc buffer for convert jerry string failed"); + jerry_release_value(target); + return nullptr; + } + jerry_size_t length = jerry_string_to_char_buffer(target, buffer, size); + if ((length == 0) || (length >= UINT16_MAX) || (length > size)) { + HILOG_ERROR(HILOG_MODULE_ACE, "jerry string to char buffer failed, target size[%d]", size); + jerry_release_value(target); + ace_free(buffer); + buffer = nullptr; + return nullptr; + } + // end character + buffer[length] = '\0'; + jerry_release_value(target); + *strLength = length; + return reinterpret_cast(buffer); +} + +bool BoolOf(jerry_value_t source) +{ + if (!jerry_value_is_boolean(source)) { + HILOG_ERROR(HILOG_MODULE_ACE, "js value is not bool."); + } + return jerry_value_to_boolean(source); +} + +int16_t IntegerOf(jerry_value_t source) +{ + if (!jerry_value_is_number(source)) { + char *strValue = MallocStringOf(source); + if (strValue == nullptr) { + return 0; + } + int16_t intValue = static_cast(strtol(strValue, nullptr, DEC)); + ace_free(strValue); + return intValue; + } + int number = jerry_get_number_value(source); + if (number >= INT16_MAX) { + HILOG_DEBUG(HILOG_MODULE_ACE, "js number value is out of range."); + return INT16_MAX; + } + if (number <= INT16_MIN) { + HILOG_DEBUG(HILOG_MODULE_ACE, "js number value is out of range."); + return INT16_MIN; + } + return static_cast(number); +} + +jerry_value_t WatcherCallbackFunc(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t *args, + const jerry_length_t argsLength) +{ + if (argsLength != ARG_LENGTH_WATCHER_CALLBACK) { + return UNDEFINED; + } + + START_TRACING(WATCHER_CALLBACK_FUNC); + jerry_value_t value = args[0]; + const uint8_t optionIndex = 2; + jerry_value_t options = args[optionIndex]; + jerry_value_t nativeElement = jerryx_get_property_str(options, ARG_WATCH_EL); + jerry_value_t attrKey = jerryx_get_property_str(options, ARG_WATCH_ATTR); + + Component *component = ComponentUtils::GetComponentFromBindingObject(nativeElement); + if (component != nullptr) { + uint16_t attrKeyStrLen = 0; + char *attrKeyStr = MallocStringOf(attrKey, &attrKeyStrLen); + if (attrKeyStr != nullptr) { + uint16_t attrKeyId = KeyParser::ParseKeyId(attrKeyStr, attrKeyStrLen); + bool updateResult = component->UpdateView(attrKeyId, value); + if (updateResult) { + component->Invalidate(); + } + ace_free(attrKeyStr); + attrKeyStr = nullptr; + } + } + STOP_TRACING(); + ReleaseJerryValue(attrKey, nativeElement, VA_ARG_END_FLAG); + return UNDEFINED; +} + +// print out error information from jerry value +void PrintErrorMessage(const jerry_value_t errorValue) +{ + const uint8_t errorMsgMaxLength = 128; + if (!jerry_is_feature_enabled(JERRY_FEATURE_ERROR_MESSAGES)) { + return; + } + + jerry_value_t errValue = jerry_get_value_from_error(errorValue, false); + jerry_value_t errStrVal = jerry_value_to_string(errValue); + jerry_release_value(errValue); + + if (jerry_value_is_error(errStrVal)) { + /* Avoid recursive error throws. */ + HILOG_ERROR(HILOG_MODULE_ACE, "[Error value to string failed]"); + jerry_release_value(errStrVal); + return; + } + + jerry_size_t errStrSize = jerry_get_utf8_string_size(errStrVal); + if (errStrSize >= errorMsgMaxLength) { + HILOG_ERROR(HILOG_MODULE_ACE, "[Error message too long]"); + jerry_release_value(errStrVal); + return; + } + + jerry_char_t errStrBuffer[errorMsgMaxLength]; + jerry_size_t stringEnd = jerry_string_to_utf8_char_buffer(errStrVal, errStrBuffer, errStrSize); + errStrBuffer[stringEnd] = 0; + // output to platform trace + HILOG_ERROR(HILOG_MODULE_ACE, " [JS Error]: %s", reinterpret_cast(errStrBuffer)); + // output to user console + LogString(LogLevel::LOG_LEVEL_ERR, "[JS Exception]: "); + LogString(LogLevel::LOG_LEVEL_ERR, reinterpret_cast(errStrBuffer)); + // output line seperator to trigger trace output + LogString(LogLevel::LOG_LEVEL_ERR, "\n"); +#if ENABLED(ENGINE_DEBUGGER) + FlushOutput(); +#endif + jerry_release_value(errStrVal); +} + +// wrapper function for jerry_call_function +jerry_value_t CallJSFunction(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t args[], + jerry_size_t argsCount) +{ + jerry_value_t ret = jerry_call_function(func, context, args, argsCount); + // trace out error infomation if the result contains error + if (jerry_value_is_error(ret)) { + PrintErrorMessage(ret); + } + return ret; +} + +void CallJSFunctionAutoRelease(const jerry_value_t funcObj, + const jerry_value_t thisVal, + const jerry_value_t args[], + const jerry_size_t argc) +{ + jerry_release_value(CallJSFunction(funcObj, thisVal, args, argc)); +} + +jerry_value_t CallJSFunctionOnRoot(const jerry_value_t funcObj, /**< function object to call */ + const jerry_value_t args[], /**< function's call arguments */ + const jerry_size_t argc) /**< number of the arguments */ +{ + jerry_value_t globalObject = jerry_get_global_object(); + jerry_value_t pageViewModel = jerryx_get_property_str(globalObject, ATTR_ROOT); + jerry_value_t ret = CallJSFunction(funcObj, pageViewModel, args, argc); + ReleaseJerryValue(globalObject, pageViewModel, VA_ARG_END_FLAG); + return ret; +} + +// arg1:target object watched, arg2:watcher callback, arg3:other argument +jerry_value_t CallJSWatcher(jerry_value_t arg1, + jerry_value_t (*watcherCB)(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t *args, + const jerry_length_t argsLength), + jerry_value_t arg3) +{ + jerry_value_t globalObject = jerry_get_global_object(); + jerry_value_t appViewModel = jerryx_get_property_str(globalObject, ATTR_ROOT); + const char * const attrWatch = "$watch"; + jerry_value_t watchFunction = jerryx_get_property_str(appViewModel, attrWatch); + jerry_value_t callbackFunc = jerry_create_external_function(watcherCB); + jerry_value_t args[ARG_LENGTH_WATCHER] = {arg1, callbackFunc, arg3}; + jerry_value_t watcher = CallJSFunction(watchFunction, appViewModel, args, ARG_LENGTH_WATCHER); + ReleaseJerryValue(callbackFunc, watchFunction, appViewModel, globalObject, VA_ARG_END_FLAG); + return watcher; +} + +#ifdef JS_TOUCH_EVENT_SUPPORT +bool CallBaseEvent(const jerry_value_t func, const Event &event, const uint16_t id) +{ + if (!jerry_value_is_function(func)) { + return false; + } + + jerry_value_t *args = ConvertBaseEventInfo(event, id); + jerry_release_value(CallJSFunctionOnRoot(func, args, 1)); + ClearEventListener(args, 1); + return true; +} + +jerry_value_t *ConvertBaseEventInfo(const Event &event, const uint16_t id) +{ + const uint8_t argsNum = 1; + jerry_value_t *args = new jerry_value_t[argsNum]; + args[0] = jerry_create_object(); + JerrySetStringProperty(args[0], "type", KeyParser::GetKeyById(id)); + JerrySetNumberProperty(args[0], "timestamp", event.GetTimeStamp()); + jerry_value_t point = jerry_create_object(); + JerrySetNumberProperty(point, "x", event.GetCurrentPos().x); + JerrySetNumberProperty(point, "y", event.GetCurrentPos().y); + JerrySetNamedProperty(args[0], "point", point); + jerry_release_value(point); + return args; +} + +jerry_value_t *ConvertDragEventInfo(const DragEvent &event, const uint16_t id) +{ + jerry_value_t *args = ConvertBaseEventInfo(event, id); + jerry_value_t touches = jerry_create_array(1); + jerry_value_t point = jerry_create_object(); + JerrySetNumberProperty(point, "globalX", event.GetCurrentPos().x); + JerrySetNumberProperty(point, "globalY", event.GetCurrentPos().y); + jerry_release_value(jerry_set_property_by_index(touches, 0, point)); + jerry_release_value(point); + JerrySetNamedProperty(args[0], "touches", touches); + jerry_release_value(touches); + return args; +} + +jerry_value_t *ConvertKeyEventInfo(const KeyEvent &event) +{ + const uint8_t argsNum = 1; + jerry_value_t *args = new jerry_value_t[argsNum]; + args[0] = jerry_create_object(); + JerrySetNumberProperty(args[0], "code", event.GetState()); + JerrySetNumberProperty(args[0], "action", event.GetKeyId()); + JerrySetNumberProperty(args[0], "repeatCount", 0); + JerrySetNumberProperty(args[0], "timeStampStart", event.GetTimeStamp()); + return args; +} + +void ClearEventListener(const jerry_value_t args[], const uint8_t argc) +{ + for (uint8_t i = 0; i < argc; i++) { + jerry_release_value(args[i]); + } + delete[] args; + args = nullptr; +} +#endif + +/** + * only used in this file, caller must make sure the target buffer is big enough. + * return the copied byte count. + */ +static size_t AppendTwoPath(char * const first, uint8_t startIndex, const char * const sec, const uint16_t destSize) +{ + if ((first == nullptr) || (sec == nullptr) || (strlen(sec) == 0)) { + return 0; + } + + size_t secLength = strlen(sec); + if ((secLength >= PATH_LENGTH_MAX) || (destSize - startIndex < 0) || + (secLength > (size_t)(destSize - startIndex))) { + HILOG_ERROR(HILOG_MODULE_ACE, "secLength is too long."); + return 0; + } + if (startIndex == 0) { + // this is the first + if (memcpy_s(first, destSize, sec, secLength) != 0) { + return 0; + } + first[secLength] = 0; + return secLength; + } + + size_t copiedLength = 0; + // we dont append '/' at the first index + bool sepNeeded = (first[startIndex - 1] != PATH_SEPERATOR); + if (sepNeeded) { + first[startIndex] = PATH_SEPERATOR; + copiedLength++; + startIndex++; + } + + if (sec[0] == PATH_SEPERATOR) { + if (secLength > 1) { + // we have make sure '/' appened to the target already, skip it + if (memcpy_s(first + startIndex, (destSize - startIndex), (sec + 1), (secLength - 1)) != 0) { + HILOG_ERROR(HILOG_MODULE_ACE, "append path error"); + return 0; + }; + + copiedLength = copiedLength + (secLength - 1); + startIndex = startIndex + (secLength - 1); + } + } else { + // sec string do not have '/' + if (memcpy_s(first + startIndex, (destSize - startIndex), sec, secLength) != 0) { + HILOG_ERROR(HILOG_MODULE_ACE, "error happen when append path"); + return 0; + } + copiedLength = copiedLength + secLength; + startIndex = startIndex + secLength; + } + first[startIndex] = 0; + + return copiedLength; +} + +char *RelocateFilePath(const char *appRootPath, const char *subPath, const char *fileName) +{ + size_t appRootPathLength = 0; + size_t fileNameLength = 0; + if ((appRootPath == nullptr) || ((appRootPathLength = strlen(appRootPath)) == 0) || + (fileName == nullptr) || ((fileNameLength = strlen(fileName)) == 0)) { + HILOG_ERROR(HILOG_MODULE_ACE, "input path or fileName is invalid"); + return nullptr; + } + + size_t subPathLength = (subPath == nullptr) ? 0 : strlen(subPath); + if ((appRootPathLength >= PATH_LENGTH_MAX) || (subPathLength >= PATH_LENGTH_MAX) || + (fileNameLength >= NAME_LENGTH_MAX)) { + HILOG_ERROR(HILOG_MODULE_ACE, "input path or fileName is too long"); + return nullptr; + } + // alawys consume subPath does not have '/' + const uint8_t addedLength = 2; + size_t totalLength = appRootPathLength + subPathLength + fileNameLength + addedLength; + char *fullPath = static_cast(ace_malloc(totalLength + 1)); + if (fullPath == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "malloc buffer for path failed, needed length[%u]", (totalLength + 1)); + return nullptr; + } + fullPath[0] = '\0'; + // copy root path + size_t copiedLength = AppendTwoPath(fullPath, 0, appRootPath, totalLength); + size_t index = copiedLength; + // copy sub folder name if it's given + if (subPathLength > 0) { + copiedLength = AppendTwoPath(fullPath, index, subPath, totalLength); + index += copiedLength; + } + // copy filename part + index += AppendTwoPath(fullPath, index, fileName, totalLength); + fullPath[index] = '\0'; + return fullPath; +} + +// judge absolute path or relative path (start with . is absolute otherwise relative) +static bool PathIsRelative(const char * const resPath) +{ + return strncmp(PATH_PREFIX, resPath, strlen(PATH_PREFIX)) == 0; +} + +char *RelocateFilePathRelative(const char * const appRootPath, const char * const resFileName) +{ + const char * const jsPath = JsAppContext::GetInstance()->GetCurrentJsPath(); + if (jsPath == nullptr) { + return nullptr; + } + const char * const ret = strrchr(jsPath, RESOURCE_SEPERATOR); + if (ret == nullptr) { + return nullptr; + } + size_t jsPathLen = strlen(jsPath); + if (jsPathLen >= PATH_LENGTH_MAX) { + return nullptr; + } + int len = jsPathLen - strlen(ret); + if (len <= 0) { + return nullptr; + } + char *dirPath = static_cast(ace_malloc(len + 1)); + if (dirPath == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "malloc dirPath memory heap failed."); + return nullptr; + } + if (memcpy_s(dirPath, len, jsPath, len) != 0) { + ace_free(dirPath); + dirPath = nullptr; + return nullptr; + } + dirPath[len] = '\0'; + // first splice resFileName with directory path + char *filePath = RelocateFilePath(dirPath, SRC_SUB_FOLDER_NAME, resFileName); + if (dirPath != nullptr) { + ace_free(dirPath); + dirPath = nullptr; + } + // second splice root path with res file path + char *realPath = nullptr; + if (filePath != nullptr) { + realPath = RelocateFilePath(appRootPath, SRC_SUB_FOLDER_NAME, filePath); + ace_free(filePath); + } + return realPath; +} + +// relocate file name to appRootPath/common/fileName +// e.x. /system/app/73709738-2d9d-4947-ac63-9858dcae7ccb/common/right.png +char *RelocateResourceFilePath(const char * const appRootPath, const char * const resFileName) +{ + if (PathIsRelative(resFileName)) { + // deal with relative path + return RelocateFilePathRelative(appRootPath, resFileName); + } + + // deal with absolute path + return RelocateFilePath(appRootPath, SRC_SUB_FOLDER_NAME, resFileName); +} + +// relocate file name to appRootPath/src/fileName +// e.x. /system/app/73709738-2d9d-4947-ac63-9858dcae7ccb/src/index.js +// NOTE: srcFileName must be the relative path to src folder +char *RelocateJSSourceFilePath(const char * const appRootPath, const char * const srcFileName) +{ + return RelocateFilePath(appRootPath, SRC_SUB_FOLDER_NAME, srcFileName); +} + +char *ReadJSFile(const char * const appPath, const char * const jsFileName) +{ + uint32_t contentLength = 0; + return ReadJSFile(appPath, jsFileName, &contentLength); +} + +/** + * Check if the given file exists or not. + */ +bool IsFileExisted(const char * const filePath) +{ + if (filePath == nullptr) { + return false; + } +#if defined(__LITEOS__) + struct stat info; + if (stat(filePath, &info) != 0) { + return false; + } +#else + FileStatInfo fileStat; + if (FileStat(filePath, &fileStat) != 0) { + return false; + } +#endif + return true; +} + +/** + * Whether file existed and 0 represents file not existed. + */ +int32_t GetFileSize(const char * const filePath) +{ + if (filePath == nullptr) { + return 0; + } +#if defined(__LITEOS__) + struct stat info; + info.st_size = 0; + int32_t ret = stat(filePath, &info); + if ((ret != 0) || (info.st_size == 0)) { + HILOG_ERROR(HILOG_MODULE_ACE, "file [%s], file.size =%lld", filePath, info.st_size); + } + return info.st_size; +#else + FileStatInfo fileStat; + fileStat.size = 0; + int32_t ret = FileStat(filePath, &fileStat); + if ((ret == FILE_RET_FAIL) || (fileStat.size == 0)) { + HILOG_ERROR(HILOG_MODULE_ACE, "file doesn't exit or it's empty, [%s]", filePath); + } + return fileStat.size; +#endif +} + +static int32_t OpenFileInternal(const char * const orgFullPath, bool binary = false) +{ +#if defined(__LITEOS__) + char fullPath[PATH_MAX + 1] = {0}; + if (realpath(orgFullPath, fullPath) == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "realpath handle failed, [%s]", orgFullPath); + return FILE_RET_FAIL; + } + return open(fullPath, O_RDONLY, S_IREAD | S_IWRITE); +#endif + +#if (defined(_WIN32) || defined(_WIN64)) + return FileOpen(orgFullPath, (binary ? _O_BINARY : DEFAULT_FILE_PERMISSION)); +#else + return FileOpen(orgFullPath, O_RDONLY); +#endif // (defined(_WIN32) || defined(_WIN64)) +} + +static int32_t ReadFileInternal(const int32_t fd, void *buffer, const uint32_t targetLength) +{ +#if defined(__LITEOS__) + int32_t count = read(fd, buffer, targetLength); +#else + int32_t count = FileRead(fd, buffer, targetLength); +#endif + return count; +} + +static void CloseFileInternal(int32_t fd) +{ +#if defined(__LITEOS__) + close(fd); +#else + FileClose(fd); +#endif +} + +/** + * Read file content from one give full file path. + * Return value must be freed by caller. + */ +char *ReadFile(const char * const fullPath, uint32_t *fileSize, const bool binary) +{ + if (fileSize == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "open file[%s] failed for reading, fileSize == nullptr", fullPath); + return nullptr; + } + int32_t scriptLength = GetFileSize(fullPath); + if (scriptLength <= 0) { + HILOG_ERROR(HILOG_MODULE_ACE, "open file[%s] failed for reading, scriptLength has error.", fullPath); + return nullptr; + } + + if (scriptLength > FILE_CONTENT_LENGTH_MAX) { + ACE_ERROR_CODE_PRINT(EXCE_ACE_ROUTER_REPLACE_FAILED, EXCE_ACE_PAGE_FILE_TOO_HUGE); + return nullptr; + } + + *fileSize = 0; + // open file + int32_t fd = OpenFileInternal(fullPath, binary); + if (fd == FILE_RET_FAIL) { + HILOG_ERROR(HILOG_MODULE_ACE, "open file[fd: %d] failed for reading", fd); + HILOG_ERROR(HILOG_MODULE_ACE, "open file[path: %s] failed for reading", fullPath); + return nullptr; + } + char *scriptBuffer = static_cast(ace_malloc(scriptLength + 1)); + if (scriptBuffer == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "malloc buffer for file content failed, file length[%d]", scriptLength); + CloseFileInternal(fd); + return nullptr; + } + int32_t count = ReadFileInternal(fd, scriptBuffer, scriptLength); + if ((count <= 0) || (count > scriptLength)) { + HILOG_ERROR(HILOG_MODULE_ACE, "FileRead failed, count(%d), targetLength(%u), filePath(%s)", count, scriptLength, + fullPath); + CloseFileInternal(fd); + ace_free(scriptBuffer); + scriptBuffer = nullptr; + return nullptr; + } + scriptBuffer[count] = '\0'; + CloseFileInternal(fd); + *fileSize = binary ? scriptLength : count; + return scriptBuffer; +} + +/* + * give app path, such as /system/app/uuid/, read script string from /system/app/uuid/src/index.js, + * return value must be freed by caller. + */ +char *ReadJSFile(const char * const appPath, const char * const jsFileName, uint32_t *fileSize) +{ + if (fileSize == nullptr) { + return nullptr; + } + *fileSize = 0; + // RelocateFilePath() will check the input parameters + char *fullPath = RelocateJSSourceFilePath(appPath, jsFileName); + if (fullPath == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "error index.js file path after locate"); + return nullptr; + } + + if (strlen(fullPath) == 0) { + HILOG_ERROR(HILOG_MODULE_ACE, "empty index.js file path after locate"); + ace_free(fullPath); + fullPath = nullptr; + return nullptr; + } + + char *fileBuffer = ReadFile(fullPath, fileSize, JsAppEnvironment::GetInstance()->IsSnapshotMode()); + ace_free(fullPath); + fullPath = nullptr; + return fileBuffer; +} + +static void CalculatePathPosFromUri(const char * const url, const size_t length, size_t *start, size_t *pathLength) +{ + const uint8_t minLength = 4; + if ((url == nullptr) || (length <= minLength)) { + return; + } + + if (strstr(url, "url") != url) { + // just the path itself + *start = 0; + *pathLength = length; + return; + } + + // consider this is the url pattern + const uint8_t index = 3; + const char *pathP = strstr((url + index), "("); + if (pathP == nullptr) { + return; + } + *start = (pathP - url) + 1; + if (*start >= (length - 1)) { + return; // '(' is at the last, not meet the pattern + } + + // path end url(common) + const char *pathPE = strstr((pathP + 1), ")"); + if (pathPE == nullptr) { + return; + } + *pathLength = pathPE - (pathP + 1); +} + +/** + * @brief give out the path string from an url pattern, "url(common/logo.png)". + * + * @param url the given url + * + * @return the url itself, "common/logo.png" + */ +char *CreatePathStrFromUrl(const char * const url) +{ + if (url == nullptr) { + return nullptr; + } + size_t length = strlen(url); + if (length >= PATH_LENGTH_MAX) { + return nullptr; + } + size_t start = 0; + size_t pathLength = 0; + CalculatePathPosFromUri(url, length, &start, &pathLength); + if ((pathLength == 0) || (pathLength > (length - start))) { + return nullptr; + } + char *filePath = static_cast(ace_malloc(pathLength + 1)); + if (filePath == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "malloc buffer for file path calculating from url, file length[%d]", pathLength); + return nullptr; + } + if (memcpy_s(filePath, pathLength, (url + start), pathLength) != 0) { + HILOG_ERROR(HILOG_MODULE_ACE, "append path error when calculating from url"); + ace_free(filePath); + filePath = nullptr; + return nullptr; + } + filePath[pathLength] = '\0'; + return filePath; +} + +static uint32_t g_jsfwkErrorCount = 0; +void ThrowError() +{ + // just for debug mode, never used on release mode + g_jsfwkErrorCount++; + if (g_jsfwkErrorCount >= INT32_MAX) { + g_jsfwkErrorCount = 0; + } +} + +void ReleaseJerryValue(jerry_value_t value, ...) +{ + va_list args; + va_start(args, value); + + jerry_value_t member = value; + do { + jerry_release_value(member); + member = va_arg(args, jerry_value_t); + } while (member != (jerry_value_t)VA_ARG_END_FLAG); + + va_end(args); +} + +void InsertWatcherCommon(Watcher *&head, const jerry_value_t watcher) +{ + if (IS_UNDEFINED(watcher)) { + HILOG_ERROR(HILOG_MODULE_ACE, "watcher is undefined when inserting a watcher."); + return; + } + Watcher *node = new Watcher(); + if (node == nullptr) { + jerry_value_t unsubscribe = jerryx_get_property_str(watcher, "unsubscribe"); + ReleaseJerryValue(CallJSFunction(unsubscribe, watcher, nullptr, 0), unsubscribe, watcher, VA_ARG_END_FLAG); + HILOG_ERROR(HILOG_MODULE_ACE, "malloc memory watcher failed."); + return; + } + node->watcher = watcher; + if (head == nullptr) { + head = node; + } else { + node->next = head; + head = node; + } +} + +void ClearWatchersCommon(Watcher *&head) +{ + Watcher *node = head; + while (node) { + head = node->next; + // avoid allocating any JS objects when JS runtime broken + if (!(FatalHandler::GetInstance().IsJSRuntimeFatal())) { + // call js watcher.unsubscribe to release watcher + jerry_value_t watcher = node->watcher; + jerry_value_t unsubscribe = jerryx_get_property_str(watcher, "unsubscribe"); + ReleaseJerryValue(CallJSFunction(unsubscribe, watcher, nullptr, 0), unsubscribe, watcher, VA_ARG_END_FLAG); + } + delete node; + node = head; + } + head = nullptr; +} + +/** + * @brief Call jerry_has_property and return the result + * + * @param container the target JS object to check + * @param property the property string value + */ +bool JerryHasProperty(const jerry_value_t container, const jerry_value_t property) +{ + if (IS_UNDEFINED(container) || IS_UNDEFINED(property)) { + return false; + } + + jerry_value_t result = jerry_has_property(container, property); + bool res = jerry_value_to_boolean(result); + jerry_release_value(result); + return res; +} + +/** + * @brief Call jerry_has_own_property and return the result + * + * @param container the target JS object to check + * @param property the property string value + */ +bool HasOwnProperty(const jerry_value_t container, const jerry_value_t property) +{ + if (IS_UNDEFINED(container) || IS_UNDEFINED(property)) { + return false; + } + + jerry_value_t result = jerry_has_own_property(container, property); + bool res = jerry_value_to_boolean(result); + jerry_release_value(result); + return res; +} + +// this callback is triggered by two conditions: +// 1. the array's length changed.(ie. array.push(value)) +// 2. the array replaced by another new array but length is the same.(ie. array1 = array2) +jerry_value_t ListForWatcherCallbackFunc(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t *args, + const jerry_length_t argsLength) +{ + if (argsLength != ARG_LENGTH_WATCHER_CALLBACK) { + return UNDEFINED; + } + // args[0]==>new changed data watchered + // args[1]==>original data watchered, the data here had been updated + // args[2]==>new changed children of this component + START_TRACING(FOR_WATCHER_CALLBACK_FUNC); + const int argsNum = 2; + jerry_value_t options = args[argsNum]; + jerry_value_t nativeElement = jerryx_get_property_str(options, ARG_WATCH_EL); + Component *component = ComponentUtils::GetComponentFromBindingObject(nativeElement); + if (component) { + bool updateResult = component->UpdateForView(); + if (updateResult) { + component->Invalidate(); + } + } else { + HILOG_ERROR(HILOG_MODULE_ACE, "No component binds element."); + } + STOP_TRACING(); + jerry_release_value(nativeElement); + return UNDEFINED; +} +bool StartWith(const char *sequence, const char *prefix) +{ + while (*prefix) { + if (*prefix++ != *sequence++) { + return false; + } + } + return true; +} + +bool IsHexColor(const char * const target) +{ + return StartWith(target, PREFIX_HEX_COLOR); +} +bool IsRgbColor(const char * const target) +{ + return StartWith(target, PREFIX_RGB_COLOR); +} +bool IsRgbaColor(const char * const target) +{ + return StartWith(target, PREFIX_RGBA_COLOR); +} + +constexpr uint8_t LENGTH_RGB = 3; +constexpr uint8_t LENGTH_RRGGBB = 6; +constexpr uint8_t LENGTH_ARGB = 8; +constexpr uint8_t IDX_RGB_RED = 1; +constexpr uint8_t IDX_RGB_GREEN = 2; +constexpr uint8_t IDX_RGB_BLUE = 3; +constexpr uint8_t LENGTH_ALPHA = 2; +constexpr uint8_t IDX_ARGB_ALPHA_BEGIN = 1; +constexpr uint8_t IDX_ARGB_ALPHA_END = 2; +constexpr uint8_t IDX_ARGB_COLOR_BEGIN = 3; +constexpr uint8_t BITS_PER_BYTE = 8; + +bool ParseHexColor(const char * const source, uint32_t &color, uint8_t &alpha) +{ + if ((source == nullptr) || (strlen(source) <= 1)) { + return false; + } + uint8_t length = strlen(source + 1); + // Parse HEX color like #ABC + if (length == LENGTH_RGB) { + // #ABC equals to #AABBCC + char buffer[LENGTH_RRGGBB + 1] = { + source[IDX_RGB_RED], + source[IDX_RGB_RED], + source[IDX_RGB_GREEN], + source[IDX_RGB_GREEN], + source[IDX_RGB_BLUE], + source[IDX_RGB_BLUE], + 0 + }; + color = strtol(buffer, nullptr, HEX); + alpha = ALPHA_MAX; + return true; + } + + // Parse HEX color like #AABBCC + if (length == LENGTH_RRGGBB) { + color = strtol(source + 1, nullptr, HEX); + alpha = ALPHA_MAX; + return true; + } + + // Parse HEX color like #FFAABBCC + if (length == LENGTH_ARGB) { + char buffer[LENGTH_ALPHA + 1] = {source[IDX_ARGB_ALPHA_BEGIN], source[IDX_ARGB_ALPHA_END], 0}; + alpha = strtol(buffer, nullptr, HEX); + color = strtol(source + IDX_ARGB_COLOR_BEGIN, nullptr, HEX); + return true; + } + + return false; +} + +bool ParseRgbaColor(const char * const source, uint32_t &color, uint8_t &alpha) +{ + uint8_t idxOpenBrace = 0; + uint8_t idxCloseBrace = 0; + if (source == nullptr) { + return false; + } + size_t size = strlen(source); + if (size >= UINT8_MAX) { + return false; + } + for (uint8_t idx = 0; idx < size; ++idx) { + if (source[idx] == BRACE_OPEN) { + idxOpenBrace = idx; + continue; + } + if (source[idx] == BRACE_CLOSE) { + idxCloseBrace = idx; + continue; + } + } + + if (idxOpenBrace == 0 || idxCloseBrace == 0 || idxCloseBrace <= idxOpenBrace) { + return false; + } + + uint8_t bufSize = idxCloseBrace - idxOpenBrace - 1; + char *buffer = static_cast(ace_malloc(sizeof(char) * (bufSize + 1))); + if (buffer == nullptr) { + return false; + } + if (memcpy_s(buffer, bufSize, source + idxOpenBrace + 1, bufSize) != 0) { + ace_free(buffer); + buffer = nullptr; + return false; + } + buffer[bufSize] = 0; + char *token; + int8_t move = 16; + char *next = nullptr; + token = strtok_s(buffer, DELIMITER, &next); + color = 0; + while ((token != nullptr) && (move >= 0)) { + long value = strtol(token, nullptr, DEC); + if ((value < 0) || (value > UINT8_MAX)) { + ace_free(buffer); + buffer = nullptr; + color = 0; + return false; + } + color += ((uint8_t)value << (uint8_t)move); + token = strtok_s(nullptr, DELIMITER, &next); + move -= BITS_PER_BYTE; + } + if (token != nullptr) { + alpha = strtod(token, nullptr) * ALPHA_MAX; + } else { + alpha = ALPHA_MAX; + } + ace_free(buffer); + buffer = nullptr; + return true; +} + +bool ParseColor(const char * const source, uint32_t &color, uint8_t &alpha) +{ + if (source == nullptr) { + return false; + } + + if (IsHexColor(source)) { + return ParseHexColor(source, color, alpha); + } + + if (IsRgbaColor(source) || IsRgbColor(source)) { + return ParseRgbaColor(source, color, alpha); + } + + return false; +} + +#if JS_PAGE_SPECIFIC +struct JSPageSpecific jsPageSpecific; +#endif // JS_PAGE_SPECIFIC + +#if (defined(_WIN32) || defined(_WIN64)) +/** + * Add this configuration for the simulator executable for IDE. + * As for IDE simulator, framework.min.js is located in app path. + */ +static bool g_seperatedSimulatorMode = false; + +void SetSeperatedSimulatorMode(bool seperatedMode) +{ + g_seperatedSimulatorMode = seperatedMode; +} + +bool IsSeperatedSimulatorMode() +{ + return g_seperatedSimulatorMode; +} +#endif + +uint16_t GetHorizontalResolution() +{ +// SCREENRESOLUTION_CMAKE is temporarily set, when ui and graphic unifid, this can be removed +#if ((defined __LITEOS__) || (defined __linux__) || (defined SCREENRESOLUTION_CMAKE)) + return Screen::GetInstance().GetWidth(); +#else + uint16_t horizontalResolution = 454; + return horizontalResolution; +#endif // OHOS_ACELITE_PRODUCT_WATCH +} + +uint16_t GetVerticalResolution() +{ +#if ((defined __LITEOS__) || (defined __linux__) || (defined SCREENRESOLUTION_CMAKE)) + return Screen::GetInstance().GetHeight(); +#else + uint16_t verticalResolution = 454; + return verticalResolution; +#endif // OHOS_ACELITE_PRODUCT_WATCH +} + +JSValue GetRootAbilitySlice() +{ + return JSGlobal::Get(ATTR_ROOT); +} + +JSValue CallWithRootAbilitySlice(JSValue func, JSValue args[], JSSize size) +{ + JSValue abilitySlice = GetRootAbilitySlice(); + JSValue result = JSFunction::Call(func, abilitySlice, args, size); + JSRelease(abilitySlice); + return result; +} + +JSValue CallWithRootAbilitySlice(JSValue func) +{ + return CallWithRootAbilitySlice(func, nullptr, 0); +} + +JSValue CreateWatcher(JSValue getter, JSHandler handler, JSValue options) +{ + JSValue abilitySlice = GetRootAbilitySlice(); + JSValue callback = JSFunction::Create(handler); + JSValue args[ARG_LENGTH_WATCHER] = {getter, callback, options}; + JSValue watcher = JSObject::Call(abilitySlice, ATTR_WATCH, args, ARG_LENGTH_WATCHER); + JSRelease(callback); + JSRelease(abilitySlice); + return watcher; +} + +void ExpandImagePathMem(char *&imagePath, const int16_t dotPos, const int16_t suffixLen, const int16_t imagePathLen) +{ + if (dotPos < 0 || suffixLen < 0 || imagePathLen < 0) { + return; + } + int16_t len = dotPos + 1 + suffixLen + 1; + if (len <= 0) { + return; + } + char *newImagePath = static_cast(ace_malloc(len)); + if (newImagePath == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "malloc buffer for path failed, needed length[%u]", (dotPos + 1 + suffixLen + 1)); + ACE_FREE(imagePath); + return; + } + + errno_t err = strcpy_s(newImagePath, len, imagePath); + if (err != 0) { + HILOG_ERROR(HILOG_MODULE_ACE, "use strcpy_s secure function errro(%d)", err); + ace_free(newImagePath); + newImagePath = nullptr; + ACE_FREE(imagePath); + return; + } + + ace_free(imagePath); + imagePath = newImagePath; +} + +#ifdef OHOS_ACELITE_PRODUCT_WATCH +void CureImagePath(char *&imagePath) +{ + if (imagePath == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "get imagePath failed!"); + return; + } + int16_t lastPathPos = -1; + int16_t dotPos = -1; + const int16_t suffixLen = 3; + const size_t imagePathLen = strlen(imagePath); + const char * const suffixName = "bin"; + + if (imagePathLen >= PATH_LENGTH_MAX) { + return; + } + // find the dot and last path position + for (int16_t index = imagePathLen - 1; index >= 0; index--) { + if (dotPos < 0) { + if (*(imagePath + index) == PATH_PREFIX[0]) { + dotPos = index; + } + } + + if (lastPathPos < 0) { + if (*(imagePath + index) == PATH_SEPERATOR) { + lastPathPos = index; + } + } + } + + // if dot position - last path position > 1, the suffix need to be proceed, + // else means the file name is wrong. + if ((dotPos - lastPathPos) > 1) { + // if suffix length < 3, need expand memory first. + if (imagePathLen < (suffixLen + dotPos + 1)) { + ExpandImagePathMem(imagePath, dotPos, suffixLen, imagePathLen); + if (imagePath == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "malloc buffer for path failed, needed length[%u]", + (dotPos + 1 + suffixLen + 1)); + return; + } + } + + *(imagePath + dotPos + 1) = '\0'; + if (strcat_s(imagePath, dotPos + 1 + suffixLen + 1, suffixName) != 0) { + HILOG_ERROR(HILOG_MODULE_ACE, "strcat_s failed!"); + ace_free(imagePath); + imagePath = nullptr; + return; + } + } else { + HILOG_ERROR(HILOG_MODULE_ACE, "the image suffix error, please check!"); + ace_free(imagePath); + imagePath = nullptr; + return; + } + return; +} +#endif // OHOS_ACELITE_PRODUCT_WATCH + +const char *ParseImageSrc(jerry_value_t source) +{ + uint16_t length = 0; + char *rawSrc = MallocStringOf(source, &length); + if (rawSrc == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "Failed to parse image src cause by empty source."); + return nullptr; + } + if (length == 0) { + HILOG_ERROR(HILOG_MODULE_ACE, "Failed to parse image src cause by empty source."); + ace_free(rawSrc); + rawSrc = nullptr; + return nullptr; + } + + if ((strstr(rawSrc, PATH_RELATIVE_WHOLE) != nullptr) || (strstr(rawSrc, PATH_RELATIVE_PART) != nullptr)) { + HILOG_ERROR(HILOG_MODULE_ACE, "Ralative path is not allowed in image src."); + ace_free(rawSrc); + rawSrc = nullptr; + return nullptr; + } + + const char * const rootPath = JsAppContext::GetInstance()->GetCurrentAbilityPath(); + char *imageSrc = RelocateResourceFilePath(rootPath, rawSrc); + ace_free(rawSrc); + rawSrc = nullptr; +#ifdef OHOS_ACELITE_PRODUCT_WATCH + CureImagePath(imageSrc); +#endif // OHOS_ACELITE_PRODUCT_WATCH + return imageSrc; +} + +bool CopyFontFamily(char *&destination, const char * const fontFamily) +{ + ACE_FREE(destination); + if (fontFamily == nullptr) { + return true; // the destination is alread nullptr + } + size_t fontFamilyLen = strlen(fontFamily); + if (fontFamilyLen >= UINT8_MAX) { + HILOG_ERROR(HILOG_MODULE_ACE, "the fontFamily is too long"); + return false; + } + size_t len = fontFamilyLen + 1; + destination = static_cast(ace_malloc(len)); + if (destination == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "malloc string failed"); + return false; + } + if (strcpy_s(destination, len, fontFamily) != 0) { + HILOG_ERROR(HILOG_MODULE_ACE, "copy fontFamily failed"); + ace_free(destination); + destination = nullptr; + return false; + } + return true; +} +} // namespace ACELite +} // namespace OHOS diff --git a/src/core/base/js_fwk_common.h b/src/core/base/js_fwk_common.h new file mode 100755 index 0000000..2aece12 --- /dev/null +++ b/src/core/base/js_fwk_common.h @@ -0,0 +1,346 @@ +/* + * Copyright (c) 2020 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. + */ + +#ifndef OHOS_ACELITE_JS_FWK_COMMON_H +#define OHOS_ACELITE_JS_FWK_COMMON_H + +#include "handler.h" +#include "js_config.h" +#include "non_copyable.h" +#ifdef JS_TOUCH_EVENT_SUPPORT +#include "root_view.h" +#endif +#include "graphic_config.h" +#include "wrapper/js.h" + +namespace OHOS { +namespace ACELite { +struct Watcher : public MemoryHeap { + ACE_DISALLOW_COPY_AND_MOVE(Watcher); + Watcher() : watcher(jerry_create_undefined()), next(nullptr) {} + jerry_value_t watcher; + struct Watcher *next; +}; + +#if (!defined(_WIN32) && !defined(_WIN64)) +#define SECURE_ENABLED +#endif + +/* + * Remove parameters, variables, or expressions compiling warning. + */ +#undef UNUSED // incase others define the same macro +#define UNUSED(a) (void)(a) + +#ifndef UNDEFINED +#define UNDEFINED jerry_create_undefined() +#endif + +#ifndef IS_UNDEFINED +#define IS_UNDEFINED(v) jerry_value_is_undefined(v) +#endif + +#ifndef IS_ERROR_VALUE +#define IS_ERROR_VALUE(v) jerry_value_is_error(v) +#endif + +#ifndef ACE_FREE +#define ACE_FREE(pointer) \ + if (pointer != nullptr) { \ + ace_free(pointer); \ + pointer = nullptr; \ + } +#endif // ACE_FREE + +#ifndef ACE_DELETE +#define ACE_DELETE(pointer) \ + if (pointer != nullptr) { \ + delete pointer; \ + pointer = nullptr; \ + } +#endif // ACE_DELETE + +void ThrowError(); + +#if ENABLED(JS_PROFILER) +#ifndef LOG_PROFILER_TRACE +#define LOG_PROFILER(format, ...) printf(format "\n", ##__VA_ARGS__) +#define LOG_PROFILER_TRACE(format, ...) printf("[PERFORMANCE]:" format "\n", ##__VA_ARGS__) +#endif +#else +#ifndef LOG_PROFILER_TRACE +#define LOG_PROFILER(format, ...) +#define LOG_PROFILER_TRACE(format, ...) +#endif +#endif + +constexpr uint16_t PATH_LENGTH_MAX = 1024; +constexpr uint8_t NAME_LENGTH_MAX = 255; +constexpr uint8_t DEVICE_ID_LENGTH_MAX = 65; +constexpr uint16_t FILE_CONTENT_LENGTH_MAX = 1024 * 30; + +// hex code +constexpr uint8_t DEC = 10; +constexpr uint8_t HEX = 16; + +constexpr int SIZE_EXPRESSION_PLACE_HOLDER = 4; +constexpr int IDX_EXPRESSSION_STRING = 2; +constexpr int ARG_LENGTH_WATCHER = 3; +constexpr int ARG_LENGTH_WATCHER_CALLBACK = 3; + +constexpr char ATTR_ROOT[] = "$root"; // global.$root represents for abilitySlice + +constexpr uint32_t RGB_COLOR_VALUE_MAX = 0x1000000; +constexpr uint32_t TEXT_RED_COLOR_MASK = 0xff0000; +constexpr uint32_t TEXT_GREEN_COLOR_MASK = 0x00ff00; +constexpr uint32_t TEXT_BLUE_COLOR_MASK = 0x0000ff; +constexpr int RED_COLOR_START_BIT = 16; +constexpr int GREEN_COLOR_START_BIT = 8; +constexpr char ATTR_SRC[] = "src"; // image-animator +#ifdef FEATURE_COMPONENT_ANALOG_CLOCK +constexpr char CLOCK_HAND_IS_IMAGE[] = "isImage"; +constexpr char COMMON_STYLE_OPACITY[] = "opacity"; +constexpr char COMMON_STYLE_COLOR[] = "color"; +#endif // FEATURE_COMPONENT_ANALOG_CLOCK +constexpr uint8_t DEFAULT_FONT_SIZE = 30; +#ifdef FEATURE_COMPONENT_CANVAS +constexpr uint8_t DEFAULT_FONT_LETTERSPACE = 2; +#endif // FEATURE_COMPONENT_CANVAS +constexpr char DEFAULT_FONT_FAMILY[] = DEFAULT_VECTOR_FONT_FILENAME; + +// common attributes +constexpr char ATTR_WIDTH[] = "width"; // tab-bar | image-animator +constexpr char ATTR_HEIGHT[] = "height"; // tab-bar | image-animator +constexpr char ATTR_LEFT[] = "left"; // image-animator +constexpr char ATTR_TOP[] = "top"; // image-animator +constexpr char ATTR_TYPE[] = "type"; +constexpr char COMMON_STYLE_BACKGROUND_COLOR[] = "backgroundColor"; +constexpr char ARG_WATCH_EL[] = "el"; +constexpr char ARG_WATCH_ATTR[] = "attr"; +constexpr char ATTR_ATTRS[] = "attrs"; +constexpr char ABILITY_LIFECYCLE_CALLBACK_ON_CREATE[] = "onCreate"; +constexpr char ABILITY_LIFECYCLE_CALLBACK_ON_DESTROY[] = "onDestroy"; +constexpr char BACK_PRESSED_NAME[] = "$backPress"; +constexpr char ROUTER_PAGE_URI[] = "uri"; +constexpr char ROUTER_PAGE_PARAMS[] = "params"; +constexpr char ROUTER_PAGE_PATH[] = "path"; +constexpr char ROUTER_PAGE[] = "$page"; +constexpr char ATTR_REFS[] = "$refs"; +constexpr char ATTR_SUCCESS[] = "success"; +constexpr char ATTR_FAIL[] = "fail"; +constexpr char ATTR_COMPLETE[] = "complete"; + +// chart style +constexpr uint8_t POINT_SIZE = 5; + +// animation style +constexpr char ANIMATION_VALUE_SEP[] = ","; +constexpr char ATTR_APP[] = "$app"; +constexpr char ATTR_CHILDREN[] = "children"; +constexpr char ATTR_RENDER[] = "$render"; +constexpr char ATTR_WATCH[] = "$watch"; +constexpr char DESCRIPTOR_ATTR_FOR[] = "for"; +constexpr char DESCRIPTOR_ATTR_NODES[] = "nodes"; +constexpr char DESCRIPTOR_ATTR_RENDER[] = "render"; +constexpr char DESCRIPTOR_ATTR_GETTER[] = "getter"; +constexpr char TRANSITION_ROTATE[] = "rotate"; +constexpr char TRANSITION_TRANSFORM_X[] = "translateX"; +constexpr char TRANSITION_TRANSFORM_Y[] = "translateY"; +constexpr char CONSTRUCTOR_VIEW_MODEL[] = "ViewModel"; +constexpr char CONSTRUCTOR_ABILITY_SLICE[] = "AbilitySlice"; + +// get screen horizontal resolution +uint16_t GetHorizontalResolution(); +// get screen vertical resolution +uint16_t GetVerticalResolution(); + +#if (defined(_WIN32) || defined(_WIN64)) +void SetSeperatedSimulatorMode(bool seperatedMode); +bool IsSeperatedSimulatorMode(); +#endif +// global functions +void JerrySetNamedProperty(jerry_value_t object, const char * const name, jerry_value_t propValue); +void JerrySetNumberProperty(jerry_value_t object, const char * const name, double value); +void JerrySetStringProperty(jerry_value_t object, const char * const name, const char * const value); +void JerrySetStringProperty(jerry_value_t object, const char * const name, const char * const value, uint32_t length); +// value returned should be freed by caller when it's not nullptr and won't be used any more +char *JerryMallocStringProperty(const jerry_value_t object, const char * const name, uint16_t &length); +int16_t JerryGetIntegerProperty(jerry_value_t object, const char * const name); +void JerrySetFuncProperty(jerry_value_t object, const char * const name, jerry_external_handler_t handler); +char *MallocStringOf(jerry_value_t source); +// convert one jerry string value to char*, and return the string length +char *MallocStringOf(jerry_value_t source, uint16_t *strLength); +int16_t IntegerOf(jerry_value_t source); +bool BoolOf(jerry_value_t source); + +// relocate file name to full path of the current app path +char *RelocateFilePath(const char *appRootPath, const char *subPath, const char *fileName); + +// relocate file name to appRootPath/dirA/dirB/fileName +// e.x. /system/app/73709738-2d9d-4947-ac63-9858dcae7ccb/pages/index/right.png +char *RelocateFilePathRelative(const char * const appRootPath, const char * const resFileName); + +// returned value must be freed by caller +char *RelocateResourceFilePath(const char * const appRootPath, const char * const resFileName); +// returned value must be freed by caller +char *RelocateJSSourceFilePath(const char * const appRootPath, const char * const srcFileName); +// read from src file, return value must be freed by caller +char *ReadJSFile(const char * const appPath, const char * const jsFileName); +// read the given file and return the whole file content +char *ReadJSFile(const char * const appPath, const char * const jsFileName, uint32_t *fileSize); +// read the given file and return the whole file content +char *ReadFile(const char * const fullPath, uint32_t *fileSize, const bool binary); +// check whether the given file exists +bool IsFileExisted(const char * const filePath); +// Whether file existed and return the file size. 0 represents file not existed. +int32_t GetFileSize(const char * const filePath); + +/** + * @brief give out the path string from an url pattern, "url(common/logo.png)". + * + * @param url the given url + * + * @return the url itself, "common/logo.png" + */ +char *CreatePathStrFromUrl(const char * const url); +/** + * @brief Call jerry_has_property and return the result + * + * @param container the target JS object to check + * @param property the property string value + */ +bool JerryHasProperty(const jerry_value_t container, const jerry_value_t property); +/** + * @brief Call jerry_has_own_property and return the result + * + * @param container the target JS object to check + * @param property the property string value + */ +bool HasOwnProperty(const jerry_value_t container, const jerry_value_t property); +// watcher callback function +jerry_value_t WatcherCallbackFunc(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t *args, + const jerry_length_t argsLength); +// print out error information from jerry value +void PrintErrorMessage(const jerry_value_t errorValue); +// wrapper function for jerry_call_function +jerry_value_t CallJSFunction(const jerry_value_t func, /**< function object to call */ + const jerry_value_t context, /**< object for 'this' binding */ + const jerry_value_t args[], /**< function's call arguments */ + const jerry_size_t argsCount); /**< number of the arguments */ +void CallJSFunctionAutoRelease(const jerry_value_t funcObj, /**< function object to call */ + const jerry_value_t thisVal, /**< object for 'this' binding */ + const jerry_value_t args[], /**< function's call arguments */ + const jerry_size_t argc); /**< number of the arguments */ +jerry_value_t CallJSFunctionOnRoot(const jerry_value_t funcObj, /**< function object to call */ + const jerry_value_t args[], /**< function's call arguments */ + const jerry_size_t argc); /**< number of the arguments */ +jerry_value_t CallJSWatcher(jerry_value_t arg1, + jerry_value_t (*watcherCB)(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t *args, + const jerry_length_t argsLength), + jerry_value_t arg3); +void ReleaseJerryValue(jerry_value_t value, ...); +void InsertWatcherCommon(Watcher *&head, const jerry_value_t watcher); +void ClearWatchersCommon(Watcher *&head); +jerry_value_t ListForWatcherCallbackFunc(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t *args, + const jerry_length_t argsLength); +#ifdef JS_TOUCH_EVENT_SUPPORT +jerry_value_t *ConvertBaseEventInfo(const Event &event, const uint16_t id); +bool CallBaseEvent(const jerry_value_t func, const Event &event, const uint16_t id); +jerry_value_t *ConvertDragEventInfo(const DragEvent &event, const uint16_t id); +jerry_value_t *ConvertKeyEventInfo(const KeyEvent &event); +void ClearEventListener(const jerry_value_t args[], uint8_t argc); +#endif +JSValue GetRootAbilitySlice(); +JSValue CallWithRootAbilitySlice(JSValue func, JSValue args[], JSSize size); +JSValue CallWithRootAbilitySlice(JSValue func); +JSValue CreateWatcher(JSValue getter, JSHandler handler, JSValue options); + +void ExpandImagePathMem(char *&imagePath, const int16_t dotPos, const int16_t suffixLen, const int16_t imagePathLen); +#ifdef OHOS_ACELITE_PRODUCT_WATCH +void CureImagePath(char *&imagePath); +#endif // OHOS_ACELITE_PRODUCT_WATCH +const char *ParseImageSrc(jerry_value_t source); + +constexpr char PATH_PREFIX[] = "."; +constexpr char PATH_DEFAULT[] = "/"; + +constexpr char PREFIX_HEX_COLOR[] = "#"; +constexpr char PREFIX_RGB_COLOR[] = "rgb"; +constexpr char PREFIX_RGBA_COLOR[] = "rgba"; +constexpr uint8_t ALPHA_MAX = 255; +constexpr char BRACE_OPEN = '('; +constexpr char BRACE_CLOSE = ')'; +constexpr char DELIMITER[] = ","; +constexpr char RESOURCE_SEPERATOR = '/'; + +bool StartWith(const char *sequence, const char *prefix); +bool IsHexColor(const char * const target); +bool IsRgbColor(const char * const target); +bool IsRgbaColor(const char * const target); +bool ParseHexColor(const char * const source, uint32_t &color, uint8_t &alpha); +bool ParseRgbaColor(const char * const source, uint32_t &color, uint8_t &alpha); +bool ParseColor(const char * const source, uint32_t &color, uint8_t &alpha); +bool CopyFontFamily(char *&destination, const char * const fontFamily); + +#if (defined(_WIN32) || defined(_WIN64)) +constexpr char PATH_SEPERATOR = '\\'; +constexpr char PATH_RELATIVE_WHOLE[] = "\\..\\"; +constexpr char PATH_RELATIVE_PART[] = "..\\"; +constexpr char SRC_SUB_FOLDER_NAME[] = ""; +constexpr char JS_INDEX_FILE_PATH[] = "pages\\index\\index"; +#else +constexpr char PATH_SEPERATOR = '/'; +constexpr char PATH_RELATIVE_WHOLE[] = "/../"; +constexpr char PATH_RELATIVE_PART[] = "../"; +constexpr char SRC_SUB_FOLDER_NAME[] = ""; +constexpr char JS_INDEX_FILE_PATH[] = "pages/index/index"; +#endif + +// for error definition +enum { + FAILED = -1, + SUCCESS = 0, + ERROR_BASE = 0x10000, + ERROR_INPUT_PARAMETER, + ERROR_MALLOC, + ERROR_SECURE_USE // use secure function error +}; + +constexpr int VA_ARG_END_FLAG = -1; + +// switch on random path +#ifndef JS_PAGE_SPECIFIC +#define JS_PAGE_SPECIFIC 0 +#endif + +#if JS_PAGE_SPECIFIC +constexpr char servicePrefix[] = "pages"; +constexpr char serviceSuffix[] = "index"; + +struct JSPageSpecific : public MemoryHeap { + char *jsIndexFilePath; // page path + JSPageSpecific() : jsIndexFilePath(nullptr) {} +}; + +#endif // JS_PAGE_SPECIFIC +} // namespace ACELite +} // namespace OHOS +#endif // OHOS_ACELITE_JS_FWK_COMMON_H diff --git a/src/core/base/key_parser.cpp b/src/core/base/key_parser.cpp new file mode 100755 index 0000000..02d3631 --- /dev/null +++ b/src/core/base/key_parser.cpp @@ -0,0 +1,704 @@ +/* + * Copyright (c) 2020 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. + */ + +#include "key_parser.h" +#include +#include "acelite_config.h" +#include "js_config.h" +#include "keys.h" + +namespace OHOS { +namespace ACELite { +#ifdef KEYWORD +#undef KEYWORD +#endif // KEYWORD + +// Replace the struct keys.h "KEYWORD" sector for init +#if defined(ENABLE_KEY) +#define KEYWORD(enumkey, keystr) {#keystr, K_##enumkey, static_cast(strlen(#enumkey))}, +#else // ENABLE_KEY +#define KEYWORD(enumkey, keystr) {K_##enumkey, static_cast(strlen(#enumkey))}, +#endif // ENABLE_KEY + +static const struct { +#if defined(ENABLE_KEY) + const char * const key; +#endif + const uint16_t ID; + const uint8_t LENGTH; +} G_KEYWORD_INFO[KEYWORDS_MAX] = { +#if defined(ENABLE_KEY) + {"UNKNOWN", K_UNKNOWN, static_cast(strlen("UNKNOWN"))}, +#else // ENABLE_KEY + {K_UNKNOWN, static_cast(strlen("UNKNOWN"))}, +#endif // ENABLE_KEY + +#ifdef OHOS_ACELITE_KEYS_H +// include the keys.h again to redefine the "KEYWORD" +#undef OHOS_ACELITE_KEYS_H +#include "keys.h" +#endif // OHOS_ACELITE_KEYS_H +}; +#undef KEYWORD + +uint16_t KeyParser::ParseKeyId(const char *s, const size_t len) +{ + if (s == nullptr || len >= UINT16_MAX || len == 0) { + return K_UNKNOWN; + } + /* + * The string was compared should be the same as the js define, + * with xxx-yyy instead the xxx_yyy, + * but the enum type use K_xxx_yyy for Id return + */ + switch (*s++) { + // clang-format off + case 'a': + if (!strcmp(s, "lignItems")) { + return K_ALIGN_ITEMS; + } +#ifdef FEATURE_COMPONENT_ANALOG_CLOCK + if (!strcmp(s, "nalog-clock")) { + return K_ANALOG_CLOCK; + } +#endif // FEATURE_COMPONENT_ANALOG_CLOCK + if (!strcmp(s, "nimationDelay")) { + return K_ANIMATION_DELAY; + } + if (!strcmp(s, "nimationDuration")) { + return K_ANIMATION_DURATION; + } + if (!strcmp(s, "nimationFillMode")) { + return K_ANIMATION_FILL_MODE; + } + if (!strcmp(s, "nimationIterationCount")) { + return K_ANIMATION_ITERATION_COUNT; + } + if (!strcmp(s, "nimationName")) { + return K_ANIMATION_NAME; + } + if (!strcmp(s, "nimationTimingFunction")) { + return K_ANIMATION_TIMING_FUNCTION; + } + if (!strcmp(s, "rc")) { + return K_ARC; + } +#ifdef FEATURE_COMPONENT_VIDEO + if (!strcmp(s, "utoplay")) { + return K_AUTOPLAY; + } +#endif // FEATURE_COMPONENT_VIDEO + break; + case 'b': + if (!strcmp(s, "ackgroundColor")) { + return K_BACKGROUND_COLOR; + } + if (!strcmp(s, "ackgroundImage")) { + return K_BACKGROUND_IMAGE; + } + if (!strcmp(s, "lockColor")) { + return K_BLOCK_COLOR; + } + if (!strcmp(s, "orderBottomColor")) { + return K_BORDER_BOTTOM_COLOR; + } + if (!strcmp(s, "orderLeftColor")) { + return K_BORDER_LEFT_COLOR; + } + if (!strcmp(s, "orderRightColor")) { + return K_BORDER_RIGHT_COLOR; + } + if (!strcmp(s, "orderTopColor")) { + return K_BORDER_TOP_COLOR; + } + if (!strcmp(s, "orderColor")) { + return K_BORDER_COLOR; + } + if (!strcmp(s, "orderRadius")) { + return K_BORDER_RADIUS; + } + if (!strcmp(s, "orderBottomWidth")) { + return K_BORDER_BOTTOM_WIDTH; + } + if (!strcmp(s, "orderLeftWidth")) { + return K_BORDER_LEFT_WIDTH; + } + if (!strcmp(s, "orderRightWidth")) { + return K_BORDER_RIGHT_WIDTH; + } + if (!strcmp(s, "orderTopWidth")) { + return K_BORDER_TOP_WIDTH; + } + if (!strcmp(s, "orderWidth")) { + return K_BORDER_WIDTH; + } + if (!strcmp(s, "reak")) { + return K_BREAK; + } + break; + case 'c': +#ifdef FEATURE_COMPONENT_CAMERA + if (!strcmp(s, "amera")) { + return K_CAMERA; + } +#endif // FEATURE_COMPONENT_CAMERA +#ifdef FEATURE_COMPONENT_CANVAS + if (!strcmp(s, "anvas")) { + return K_CANVAS; + } +#endif // FEATURE_COMPONENT_CANVAS + if (!strcmp(s, "enter")) { + return K_CENTER; + } + if (!strcmp(s, "enterX")) { + return K_CENTER_X; + } + if (!strcmp(s, "enterY")) { + return K_CENTER_Y; + } + if (!strcmp(s, "olor")) { + return K_COLOR; + } + if (!strcmp(s, "olumn")) { + return K_COLUMN; + } + if (!strcmp(s, "olumn-reverse")) { + return K_COLUMN_REVERSE; + } +#ifdef FEATURE_COMPONENT_VIDEO + if (!strcmp(s, "ontrols")) { + return K_CONTROLS; + } +#endif // FEATURE_COMPONENT_VIDEO + if (!strcmp(s, "hange")) { + return K_CHANGE; + } + if (!strcmp(s, "heckbox")) { + return K_CHECKBOX; + } + if (!strcmp(s, "hecked")) { + return K_CHECKED; + } + if (!strcmp(s, "lick")) { + return K_CLICK; + } + if (!strcmp(s, "hart")) { + return K_CHART; + } + if (!strcmp(s, "lip")) { + return K_CLIP; + } +#ifdef FEATURE_COMPONENT_ANALOG_CLOCK + if (!strcmp(s, "lock-hand")) { + return K_CLOCK_HAND; + } +#endif // FEATURE_COMPONENT_ANALOG_CLOCK + case 'd': + if (!strcmp(s, "atasets")) { + return K_DATASETS; + } +#ifdef FEATURE_COMPONENT_DATE_PICKER + if (!strcmp(s, "ate")) { + return K_DATE; + } +#endif // FEATURE_COMPONENT_DATE_PICKER + if (!strcmp(s, "irection")) { + return K_DIRECTION; + } + if (!strcmp(s, "isplay")) { + return K_DISPLAY; + } + if (!strcmp(s, "iv")) { + return K_DIV; + } + if (!strcmp(s, "rag")) { + return K_DRAG; + } + if (!strcmp(s, "uration")) { + return K_DURATION; + } + break; + case 'e': + if (!strcmp(s, "ase-in")) { + return K_EASE_IN; + } + if (!strcmp(s, "ase-in-out")) { + return K_EASE_IN_OUT; + } + if (!strcmp(s, "ase-out")) { + return K_EASE_OUT; + } + if (!strcmp(s, "llipsis")) { + return K_ELLIPSIS; + } +#ifdef FEATURE_COMPONENT_DATE_PICKER + if (!strcmp(s, "nd")) { + return K_END; + } +#endif // FEATURE_COMPONENT_DATE_PICKER +#if (defined(FEATURE_COMPONENT_CAMERA) || defined(FEATURE_COMPONENT_VIDEO)) + if (!strcmp(s, "rror")) { + return K_ERROR; + } +#endif // defined(FEATURE_COMPONENT_CAMERA) || defined(FEATURE_COMPONENT_VIDEO) + if (!strcmp(s, "xpand")) { + return K_EXPAND; + } + break; + case 'f': + if (!strcmp(s, "alse")) { + return K_FALSE; + } + if (!strcmp(s, "ixedsize")) { + return K_FIXED_SIZE; + } +#ifdef FEATURE_COMPONENT_VIDEO + if (!strcmp(s, "inish")) { + return K_FINISH; + } +#endif // FEATURE_COMPONENT_VIDEO + if (!strcmp(s, "lex-end")) { + return K_FLEX_END; + } + if (!strcmp(s, "lex-start")) { + return K_FLEX_START; + } + if (!strcmp(s, "lexDirection")) { + return K_FLEX_DIRECTION; + } + if (!strcmp(s, "lexWrap")) { + return K_FLEX_WRAP; + } + if (!strcmp(s, "ontSize")) { + return K_FONT_SIZE; + } + if (!strcmp(s, "ontFamily")) { + return K_FONT_FAMILY; + } + if (!strcmp(s, "orwards")) { + return K_FORWARDS; + } + break; + case 'h': + if (!strcmp(s, "eight")) { + return K_HEIGHT; + } +#ifdef FEATURE_COMPONENT_ANALOG_CLOCK + if (!strcmp(s, "our")) { + return K_HOUR; + } +#endif // FEATURE_COMPONENT_ANALOG_CLOCK + break; + case 'i': + if (!strcmp(s, "d")) { + return K_ID; + } + if (!strcmp(s, "mage")) { + return K_IMAGE; + } + if (!strcmp(s, "mage-animator")) { + return K_IMAGE_ANIMATOR; + } + if (!strcmp(s, "mages")) { + return K_IMAGES; + } + if (!strcmp(s, "nput")) { + return K_INPUT; + } + if (!strcmp(s, "ndex")) { + return K_INDEX; + } + if (!strcmp(s, "temselected")) { + return K_ITEM_SELECTED; + } + if (!strcmp(s, "teration")) { + return K_ITERATION; + } + break; + case 'j': + if (!strcmp(s, "ustifyContent")) { + return K_JUSTIFY_CONTENT; + } + break; +#ifdef JS_TOUCH_EVENT_SUPPORT + case 'k': + if (!strcmp(s, "ey")) { + return K_KEY; + } + break; +#endif + case 'l': + if (!strcmp(s, "abels")) { + return K_LABELS; + } + if (!strcmp(s, "arger")) { + return K_LARGER; + } + if (!strcmp(s, "eft")) { + return K_LEFT; + } + if (!strcmp(s, "etterSpacing")) { + return K_LETTER_SPACING; + } + if (!strcmp(s, "ineHeight")) { + return K_LINE_HEIGHT; + } + if (!strcmp(s, "ist")) { + return K_LIST; + } + if (!strcmp(s, "ist-item")) { + return K_LIST_ITEM; + } + if (!strcmp(s, "ongpress")) { + return K_LONGPRESS; + } + if (!strcmp(s, "oop")) { + return K_LOOP; + } + break; + case 'm': + if (!strcmp(s, "argin")) { + return K_MARGIN; + } + if (!strcmp(s, "arginBottom")) { + return K_MARGIN_BOTTOM; + } + if (!strcmp(s, "arginLeft")) { + return K_MARGIN_LEFT; + } + if (!strcmp(s, "arginRight")) { + return K_MARGIN_RIGHT; + } + if (!strcmp(s, "arginTop")) { + return K_MARGIN_TOP; + } + if (!strcmp(s, "arquee")) { + return K_MARQUEE; + } + if (!strcmp(s, "ax")) { + return K_MAX; + } + if (!strcmp(s, "in")) { + return K_MIN; + } + if (!strcmp(s, "ini")) { + return K_MINI; + } +#ifdef FEATURE_COMPONENT_VIDEO + if (!strcmp(s, "uted")) { + return K_MUTED; + } +#endif // FEATURE_COMPONENT_VIDEO + break; + case 'n': + if (!strcmp(s, "ame")) { + return K_NAME; + } + if (!strcmp(s, "one")) { + return K_NONE; + } + break; + case 'o': + if (!strcmp(s, "pacity")) { + return K_OPACITY; + } + if (!strcmp(s, "ptions")) { + return K_OPATIONS; + } + break; + case 'p': + if (!strcmp(s, "adding")) { + return K_PADDING; + } + if (!strcmp(s, "addingBottom")) { + return K_PADDING_BOTTOM; + } + if (!strcmp(s, "addingLeft")) { + return K_PADDING_LEFT; + } + if (!strcmp(s, "addingRight")) { + return K_PADDING_RIGHT; + } + if (!strcmp(s, "addingTop")) { + return K_PADDING_TOP; + } +#ifdef FEATURE_COMPONENT_VIDEO + if (!strcmp(s, "ause")) { + return K_PAUSE; + } +#endif // FEATURE_COMPONENT_VIDEO + if (!strcmp(s, "ercent")) { + return K_PERCENT; + } + if (!strcmp(s, "icker-view")) { + return K_PICKER_VIEW; + } +#ifdef FEATURE_COMPONENT_ANALOG_CLOCK + if (!strcmp(s, "ivotX")) { + return K_PIVOT_X; + } + if (!strcmp(s, "ivotY")) { + return K_PIVOT_Y; + } +#endif // FEATURE_COMPONENT_ANALOG_CLOCK +#ifdef FEATURE_COMPONENT_VIDEO + if (!strcmp(s, "repared")) { + return K_PREPARED; + } +#endif // FEATURE_COMPONENT_VIDEO + if (!strcmp(s, "rogress")) { + return K_PROGRESS; + } + break; + case 'r': + if (!strcmp(s, "adio")) { + return K_RADIO; + } + if (!strcmp(s, "adius")) { + return K_RADIUS; + } + if (!strcmp(s, "ange")) { + return K_RANGE; + } + if (!strcmp(s, "ef")) { + return K_REF; + } + if (!strcmp(s, "everse")) { + return K_REVERSE; + } + if (!strcmp(s, "ight")) { + return K_RIGHT; + } + if (!strcmp(s, "otate")) { + return K_ROTATE; + } + if (!strcmp(s, "ow")) { + return K_ROW; + } + if (!strcmp(s, "ow-reverse")) { + return K_ROW_REVERSE; + } + break; + case 's': + if (!strcmp(s, "crollamount")) { + return K_SCROLLAMOUNT; + } + if (!strcmp(s, "crollend")) { + return K_SCROLLEND; + } + if (!strcmp(s, "crollstart")) { + return K_SCROLLSTART; + } +#ifdef FEATURE_COMPONENT_ANALOG_CLOCK + if (!strcmp(s, "ec")) { + return K_SEC; + } +#endif // FEATURE_COMPONENT_ANALOG_CLOCK +#ifdef FEATURE_COMPONENT_VIDEO + if (!strcmp(s, "eeked")) { + return K_SEEKED; + } + if (!strcmp(s, "eeking")) { + return K_SEEKING; + } +#endif // FEATURE_COMPONENT_VIDEO + if (!strcmp(s, "elected")) { + return K_SELECTED; + } + if (!strcmp(s, "electedColor")) { + return K_SELECTED_COLOR; + } + if (!strcmp(s, "electedFontFamily")) { + return K_SELECTED_FONT_FAMILY; + } + if (!strcmp(s, "electedFontSize")) { + return K_SELECTED_FONT_SIZE; + } + if (!strcmp(s, "how")) { + return K_SHOW; + } + if (!strcmp(s, "lider")) { + return K_SLIDER; + } + if (!strcmp(s, "pace-around")) { + return K_SPACE_AROUND; + } + if (!strcmp(s, "pace-between")) { + return K_SPACE_BETWEEN; + } + if (!strcmp(s, "rc")) { + return K_SRC; + } + if (!strcmp(s, "tack")) { + return K_STACK; + } + if (!strcmp(s, "top")) { + return K_STOP; + } +#if (defined(FEATURE_COMPONENT_DATE_PICKER) || defined(FEATURE_COMPONENT_VIDEO)) + if (!strcmp(s, "tart")) { + return K_START; + } +#endif // (defined(FEATURE_COMPONENT_DATE_PICKER) || defined(FEATURE_COMPONENT_VIDEO) + if (!strcmp(s, "tartAngle")) { + return K_START_ANGLE; + } + if (!strcmp(s, "tandard")) { + return K_STANDARD; + } + if (!strcmp(s, "trokeWidth")) { + return K_STROKE_WIDTH; + } + if (!strcmp(s, "wipe")) { + return K_SWIPE; + } + if (!strcmp(s, "wiper")) { + return K_SWIPER; + } + if (!strcmp(s, "witch")) { + return K_SWITCH; + } + break; + case 't': +#ifdef FEATURE_COMPONENT_TABS + if (!strcmp(s, "ab-bar")) { + return K_TAB_BAR; + } + if (!strcmp(s, "ab-content")) { + return K_TAB_CONTENT; + } + if (!strcmp(s, "abs")) { + return K_TABS; + } +#endif // FEATURE_COMPONENT_TABS + if (!strcmp(s, "ime")) { + return K_TIME; + } +#ifdef FEATURE_COMPONENT_VIDEO + if (!strcmp(s, "imeupdate")) { + return K_TIME_UPDATE; + } +#endif // FEATURE_COMPONENT_VIDEO + if (!strcmp(s, "op")) { + return K_TOP; + } + if (!strcmp(s, "otalAngle")) { + return K_TOTAL_ANGLE; + } +#ifdef JS_TOUCH_EVENT_SUPPORT + if (!strcmp(s, "ouchcancel")) { + return K_TOUCHCANCEL; + } + if (!strcmp(s, "ouchend")) { + return K_TOUCHEND; + } + if (!strcmp(s, "ouchmove")) { + return K_TOUCHMOVE; + } + if (!strcmp(s, "ouchstart")) { + return K_TOUCHSTART; + } +#endif + if (!strcmp(s, "ext")) { + return K_TEXT; + } + if (!strcmp(s, "ranslateX")) { + return K_TRANSLATE_X; + } + if (!strcmp(s, "ranslateY")) { + return K_TRANSLATE_Y; + } + if (!strcmp(s, "rue")) { + return K_TRUE; + } + if (!strcmp(s, "extAlign")) { + return K_TEXT_ALIGN; + } + if (!strcmp(s, "extOverflow")) { + return K_TEXT_OVERFLOW; + } +#ifdef FEATURE_COMPONENT_ANALOG_CLOCK + if (!strcmp(s, "ype")) { + return K_TYPE; + } +#endif // FEATURE_COMPONENT_ANALOG_CLOCK + break; + case 'v': + if (!strcmp(s, "alue")) { + return K_VALUE; + } + if (!strcmp(s, "ertical")) { + return K_VERTICAL; + } +#ifdef FEATURE_COMPONENT_VIDEO + if (!strcmp(s, "ideo")) { + return K_VIDEO; + } +#endif // FEATURE_COMPONENT_VIDEO + break; + case 'w': + if (!strcmp(s, "idth")) { + return K_WIDTH; + } + if (!strcmp(s, "rap")) { + return K_WRAP; + } + break; + default: + break; + // clang-format on + } + return K_UNKNOWN; +} + +uint16_t KeyParser::ParseKeyId(const char * const s) +{ + if (s == nullptr) { + return K_UNKNOWN; + } + + size_t len = strlen(s); + if (len >= UINT16_MAX) { + return K_UNKNOWN; + } + return ParseKeyId(s, len); +} + +bool KeyParser::IsKeyValid(uint16_t id) +{ + return ((id > K_UNKNOWN) && (id < KEYWORDS_MAX)); +} + +const char *KeyParser::GetKeyById(uint16_t id) +{ + if (!IsKeyValid(id)) { + return "UNKNOWN"; + } +#if defined(ENABLE_KEY) + return G_KEYWORD_INFO[id].key; +#else + return "UNKNOWN"; +#endif // ENABLE_KEY +} + +uint8_t KeyParser::GetKeyLengthById(uint16_t id) +{ + if (!IsKeyValid(id)) { + return 0; + } + return G_KEYWORD_INFO[id].LENGTH; +} +} // namespace ACELite +} // namespace OHOS diff --git a/src/core/base/key_parser.h b/src/core/base/key_parser.h new file mode 100755 index 0000000..ad1b05e --- /dev/null +++ b/src/core/base/key_parser.h @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2020 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. + */ + +#ifndef OHOS_ACELITE_KEY_PARSER_H +#define OHOS_ACELITE_KEY_PARSER_H +#include +#include "ace_mem_base.h" +#include "memory_heap.h" +#include "non_copyable.h" +namespace OHOS { +namespace ACELite { +class KeyParser final : public MemoryHeap { +public: + ACE_DISALLOW_COPY_AND_MOVE(KeyParser); + /** + * @fn uint16_t ParseKeyId(const char* s) + * + * @brief Search the key id in the keyword info with key string, + * do not use by default + * + * @param[in] The key string to be parsed + * + * @return The key id enum value + */ + static uint16_t ParseKeyId(const char * const s); + + /** + * @fn uint16_t ParseKeyId(const char* s, const size_t len) + * + * @brief Search the key id in the keyword info with key string, + * add the length string has better performance + * + * @param[in] The key string to be parsed + * + * @param[in] The key string length + * + * @return The key id enum value + */ + static uint16_t ParseKeyId(const char *keystr, const size_t len); + + /** + * @fn bool IsKeyValid(uint16_t id) + * + * @brief Check if the input id is supported. + * + * @param[in] The id + * + * @return true if the given id is valid, false for otherwise + */ + static bool IsKeyValid(uint16_t id); + + /** + * @fn const char* GetKeyById(uint16_t id); + * + * @brief Get the key string by id index, for debugging print, + * do not support by default + * + * @param[in] The key id for index + * + * @return The key string + */ + static const char *GetKeyById(uint16_t id); + + /** + * @fn uint8_t GetKeyLengthById(uint16_t id); + * + * @brief Get the key string length, + * + * @param[in] The key id for index + * + * @return The key string length, less than UINT8_MAX + */ + static uint8_t GetKeyLengthById(uint16_t id); + +private: + KeyParser() {} + ~KeyParser() {} +}; +} // namespace ACELite +} // namespace OHOS +#endif // OHOS_ACELITE_KEY_PARSER_H diff --git a/src/core/base/keys.h b/src/core/base/keys.h new file mode 100755 index 0000000..e0f379d --- /dev/null +++ b/src/core/base/keys.h @@ -0,0 +1,268 @@ +/* + * Copyright (c) 2020 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. + */ + +#ifndef OHOS_ACELITE_KEYS_H +#define OHOS_ACELITE_KEYS_H + +#include "acelite_config.h" + +#ifndef KEYWORD +#define KEYWORDS_ENUM_DEFINE +#define KEYWORD(enumkey, keystr) K_##enumkey, + +namespace OHOS { +namespace ACELite { +enum { + K_UNKNOWN, // enum start from 0 +#endif // KEYWORD + + /* + * Rules to define the KEYWORD: + * Should not be duplicated, + * and use xxx_yyy instead the xxx-yyy as enumstr + * because of enum define limitation + */ + // clang-format off + // Reused by the struct begin + // Sample:KEYWORD(enum_string, real-key-string) + KEYWORD(ALIGN_ITEMS, alignItems) // layout style +#ifdef FEATURE_COMPONENT_ANALOG_CLOCK + KEYWORD(ANALOG_CLOCK, analog-clock) // tag name +#endif // FEATURE_COMPONENT_ANALOG_CLOCK + KEYWORD(ANIMATION_DELAY, animationDelay) // animation delay + KEYWORD(ANIMATION_DURATION, animationDuration) // animation during + KEYWORD(ANIMATION_FILL_MODE, animationFillMode) // animation fill mode + KEYWORD(ANIMATION_ITERATION_COUNT, animationIterationCount) // animation iteration count + KEYWORD(ANIMATION_NAME, animationName) // animation name + KEYWORD(ANIMATION_TIMING_FUNCTION, animationTimingFunction) // animation timing function + KEYWORD(ARC, arc) // circle progress +#ifdef FEATURE_COMPONENT_VIDEO + KEYWORD(AUTOPLAY, autoplay) // video component autoplay attribute +#endif // FEATURE_COMPONENT_VIDEO + KEYWORD(BACKGROUND_COLOR, backgroundColor) // chart line color + KEYWORD(BACKGROUND_IMAGE, backgroundImage) // common style, but only button, checkbox, radio support + KEYWORD(BLOCK_COLOR, blockColor) + KEYWORD(BORDER_BOTTOM_COLOR, borderBottomColor) // common style border bottom color + KEYWORD(BORDER_LEFT_COLOR, borderLeftColor) // common style border left color + KEYWORD(BORDER_RIGHT_COLOR, borderRightColor) // common style border right color + KEYWORD(BORDER_TOP_COLOR, borderTopColor) // common style border top color + KEYWORD(BORDER_COLOR, borderColor) // common style, horizon progress style + KEYWORD(BORDER_RADIUS, borderRadius) // horizon progress style + KEYWORD(BORDER_BOTTOM_WIDTH, borderBottomWidth) // common style border bottom width + KEYWORD(BORDER_LEFT_WIDTH, borderLeftWidth) // common style border left width + KEYWORD(BORDER_RIGHT_WIDTH, borderRightWidth) // common style border right width + KEYWORD(BORDER_TOP_WIDTH, borderTopWidth) // common style border top width + KEYWORD(BORDER_WIDTH, borderWidth) // common style, horizon progress style + KEYWORD(BREAK, break) // text overflow type +#ifdef FEATURE_COMPONENT_CAMERA + KEYWORD(CAMERA, camera) // camera component +#endif // FEATURE_COMPONENT_CAMERA +#ifdef FEATURE_COMPONENT_CANVAS + KEYWORD(CANVAS, canvas) // tag name +#endif // FEATURE_COMPONENT_CANVAS + KEYWORD(CENTER, center) // text align type + KEYWORD(CENTER_X, centerX) // circle progress x + KEYWORD(CENTER_Y, centerY) // circle progress y + KEYWORD(CHANGE, change) // the input component event name, picker-view event name + KEYWORD(CHECKED, checked) // the input and switch component of checkbox attribute + KEYWORD(CHECKBOX, checkbox) // the input component type value + KEYWORD(CLICK, click) // click event listener + KEYWORD(CLIP, clip) // text overflow type + KEYWORD(CHART, chart) // tag name +#ifdef FEATURE_COMPONENT_ANALOG_CLOCK + KEYWORD(CLOCK_HAND, clock-hand) // tag name +#endif // FEATURE_COMPONENT_ANALOG_CLOCK + KEYWORD(COLOR, color) // text style type, rectangular clock-hand fill color, horizon progress style + KEYWORD(COLUMN, column) // layout style + KEYWORD(COLUMN_REVERSE, column-reverse) // layout style +#ifdef FEATURE_COMPONENT_VIDEO + KEYWORD(CONTROLS, controls) // video component controls attribute +#endif // FEATURE_COMPONENT_VIDEO + KEYWORD(DATASETS, datasets) // chart data +#ifdef FEATURE_COMPONENT_DATE_PICKER + KEYWORD(DATE, date) // picker-view attr value +#endif // FEATURE_COMPONENT_DATE_PICKER + KEYWORD(DIRECTION, direction) // progress direction + KEYWORD(DISPLAY, display) // div layout + KEYWORD(DIV, div) // tag name + KEYWORD(DRAG, drag) // drag event listener + KEYWORD(DURATION, duration) + KEYWORD(EASE_IN, ease-in) // animation time function value + KEYWORD(EASE_IN_OUT, ease-in-out) // animation time function value + KEYWORD(EASE_OUT, ease-out) // animation time function value + KEYWORD(ELLIPSIS, ellipsis) // text overflow type +#ifdef FEATURE_COMPONENT_DATE_PICKER + KEYWORD(END, end) // date picker-view attr +#endif // FEATURE_COMPONENT_DATE_PICKER +#if (defined(FEATURE_COMPONENT_CAMERA) || defined(FEATURE_COMPONENT_VIDEO)) + KEYWORD(ERROR, error) // camera component error event +#endif // FEATURE_COMPONENT_CAMERA + KEYWORD(EXPAND, expand) // text overflow type + KEYWORD(FALSE, false) // common attributes +#ifdef FEATURE_COMPONENT_VIDEO + KEYWORD(FINISH, finish) // video component finish event tag +#endif // FEATURE_COMPONENT_VIDEO + KEYWORD(FIXED_SIZE, fixedsize) // image-animator attribute + KEYWORD(FLEX_DIRECTION, flexDirection) // layout style + KEYWORD(FLEX_END, flex-end) // layout style + KEYWORD(FLEX_START, flex-start) // layout style + KEYWORD(FLEX_WRAP, flexWrap) // layout style + KEYWORD(FONT_SIZE, fontSize) // text style type + KEYWORD(FONT_FAMILY, fontFamily) // text style type + KEYWORD(FORWARDS, forwards) // animation fill value + KEYWORD(HEIGHT, height) // common attributes +#ifdef FEATURE_COMPONENT_ANALOG_CLOCK + KEYWORD(HOUR, hour) // analog-clock hour +#endif // FEATURE_COMPONENT_ANALOG_CLOCK + KEYWORD(ID, id) // common attributes + KEYWORD(IMAGE, image) // tag name + KEYWORD(IMAGE_ANIMATOR, image-animator) // tag name + KEYWORD(IMAGES, images) // image-animator attribute + KEYWORD(INDEX, index) // swiper attr index + KEYWORD(INPUT, input) // input component name + KEYWORD(ITEM_SELECTED, itemselected) // scroll item selected event listener + KEYWORD(ITERATION, iteration) // image-animator attribute + KEYWORD(JUSTIFY_CONTENT, justifyContent) // layout style +#ifdef JS_TOUCH_EVENT_SUPPORT + KEYWORD(KEY, key) // onkey event +#endif + KEYWORD(LABELS, labels) // chart labels + KEYWORD(LARGER, larger) // text font size type + KEYWORD(LEFT, left) // text align type + KEYWORD(LETTER_SPACING, letterSpacing) // text style type + KEYWORD(LINE_HEIGHT, lineHeight) // text style type + KEYWORD(LIST, list) // list tag name + KEYWORD(LIST_ITEM, list-item) // list-item tag name + KEYWORD(LONGPRESS, longpress) // long progress event listener + KEYWORD(LOOP, loop) // swiper loop attribute + KEYWORD(MARGIN, margin) // common style margin + KEYWORD(MARGIN_BOTTOM, marginBottom) // common style margin + KEYWORD(MARGIN_LEFT, marginLeft) // common style margin left + KEYWORD(MARGIN_RIGHT, marginRight) // common style margin right + KEYWORD(MARGIN_TOP, marginTop) // common style margin top + KEYWORD(MARQUEE, marquee) // marquee tag name + KEYWORD(MAX, max) // common attributes + KEYWORD(MIN, min) // common attributes, analog-clock minute + KEYWORD(MINI, mini) // text font size type +#ifdef FEATURE_COMPONENT_VIDEO + KEYWORD(MUTED, muted) // video component muted attribute +#endif // FEATURE_COMPONENT_VIDEO + KEYWORD(NAME, name) // the attribute name + KEYWORD(NONE, none) // animation fill value + KEYWORD(OPACITY, opacity) // common style opacity + KEYWORD(OPATIONS, opations) // chart options + KEYWORD(PADDING, padding) + KEYWORD(PADDING_BOTTOM, paddingBottom) + KEYWORD(PADDING_LEFT, paddingLeft) + KEYWORD(PADDING_RIGHT, paddingRight) + KEYWORD(PADDING_TOP, paddingTop) + KEYWORD(PERCENT, percent) + KEYWORD(PICKER_VIEW, picker-view) // tag name + KEYWORD(REF, ref) // common attribute +#ifdef FEATURE_COMPONENT_VIDEO + KEYWORD(PREPARED, prepared) // video component prepared event +#endif // FEATURE_COMPONENT_VIDEO +#ifdef FEATURE_COMPONENT_ANALOG_CLOCK + KEYWORD(PIVOT_X, pivotX) // clock-hand pivot-x + KEYWORD(PIVOT_Y, pivotY) // clock-hand pivot-y +#endif // FEATURE_COMPONENT_ANALOG_CLOCK + KEYWORD(PROGRESS, progress) // progress tag name + KEYWORD(RADIO, radio) // the type in input + KEYWORD(RADIUS, radius) // circle progress radius + KEYWORD(RANGE, range) // picker-view attr +#ifdef FEATURE_COMPONENT_VIDEO + KEYWORD(PAUSE, pause) // video component pause event tag +#endif // FEATURE_COMPONENT_VIDEO + KEYWORD(REVERSE, reverse) // image-animator attribute + KEYWORD(RIGHT, right) // text align type + KEYWORD(ROTATE, rotate) // animation rotate + KEYWORD(ROW, row) // layout style + KEYWORD(ROW_REVERSE, row-reverse) // layout style + KEYWORD(SCROLLAMOUNT, scrollamount) // marquee scroll speed + KEYWORD(SCROLLEND, scrollend) // scroll end event listener + KEYWORD(SCROLLSTART, scrollstart) // scroll start event listener +#ifdef FEATURE_COMPONENT_ANALOG_CLOCK + KEYWORD(SEC, sec) // analog-clock second +#endif // FEATURE_COMPONENT_ANALOG_CLOCK +#ifdef FEATURE_COMPONENT_VIDEO + KEYWORD(SEEKING, seeking) // // video component seeking event tag + KEYWORD(SEEKED, seeked) // // video component seeked event tag +#endif // FEATURE_COMPONENT_VIDEO + KEYWORD(SELECTED, selected) // picker-view attr + KEYWORD(SELECTED_COLOR, selectedColor) // picker-view style + KEYWORD(SELECTED_FONT_FAMILY, selectedFontFamily) // picker-view style + KEYWORD(SELECTED_FONT_SIZE, selectedFontSize) // picker-view style + KEYWORD(SHOW, show) + KEYWORD(SLIDER, slider) // tag name + KEYWORD(SPACE_AROUND, space-around) // layout style + KEYWORD(SPACE_BETWEEN, space-between) // layout style + KEYWORD(SRC, src) // common attributes, use for image view, video compnent + KEYWORD(STACK, stack) // tag name + KEYWORD(STANDARD, standard) // text font size type + KEYWORD(STOP, stop) // image-animator stop event, video component end event tag +#if (defined(FEATURE_COMPONENT_DATE_PICKER) || defined(FEATURE_COMPONENT_VIDEO)) + KEYWORD(START, start) // date picker-view attr, video component start event tag +#endif // (defined(FEATURE_COMPONENT_DATE_PICKER) || defined(FEATURE_COMPONENT_VIDEO) + KEYWORD(START_ANGLE, startAngle) // circle progress start angle + KEYWORD(STEP, step) + KEYWORD(STROKE_WIDTH, strokeWidth) // horizon/arc progress style + KEYWORD(SWIPE, swipe) // swipe event listener + KEYWORD(SWIPER, swiper) // tag name + KEYWORD(SWITCH, switch) // tag name +#ifdef FEATURE_COMPONENT_TABS + KEYWORD(TAB_BAR, tab-bar) // tag name + KEYWORD(TAB_CONTENT, tab-content) // tag name + KEYWORD(TABS, tabs) // tag name +#endif // FEATURE_COMPONENT_TABS + KEYWORD(TEXT, text) // tag name, picker-view attr value + KEYWORD(TEXT_ALIGN, textAlign) // text style type + KEYWORD(TEXT_OVERFLOW, textOverflow) // text style type + KEYWORD(TIME, time) // picker-view attr value +#ifdef FEATURE_COMPONENT_VIDEO + KEYWORD(TIME_UPDATE, timeupdate) // video component timeupdate event tag +#endif // FEATURE_COMPONENT_VIDEO + KEYWORD(TOP, top) + KEYWORD(TOTAL_ANGLE, total-angle) // circle progress style +#ifdef JS_TOUCH_EVENT_SUPPORT + KEYWORD(TOUCHCANCEL, touchcancel) // ontouchcancel event + KEYWORD(TOUCHEND, touchend) // ontouchend event + KEYWORD(TOUCHMOVE, touchmove) // ontouchmove event + KEYWORD(TOUCHSTART, touchstart) // ontouchstart event +#endif + KEYWORD(TRANSLATE_X, translateX) // animation transform x + KEYWORD(TRANSLATE_Y, translateY) // animation transform y + KEYWORD(TRUE, true) // common attributes +#ifdef FEATURE_COMPONENT_ANALOG_CLOCK + KEYWORD(TYPE, type) // clock-hand type +#endif // FEATURE_COMPONENT_ANALOG_CLOCK + KEYWORD(VALUE, value) // common attributes + KEYWORD(VERTICAL, vertical) // swiper attr vertical +#ifdef FEATURE_COMPONENT_VIDEO + KEYWORD(VIDEO, video) // video tag name +#endif // FEATURE_COMPONENT_VIDEO + KEYWORD(WIDTH, width) // common attributes + KEYWORD(WRAP, wrap) // flex wrap + // Reused by the struct end +// clang-format on +#ifdef KEYWORDS_ENUM_DEFINE + KEYWORDS_MAX, // max size is UINT16_MAX +}; +#undef KEYWORDS_ENUM_DEFINE +#undef KEYWORD +} // namespace ACELite +} // OHOS namespace +#endif // KEYWORDS_ENUM_DEFINE + +#endif // OHOS_ACELITE_KEYS_H diff --git a/src/core/base/memory_heap.cpp b/src/core/base/memory_heap.cpp new file mode 100755 index 0000000..1350529 --- /dev/null +++ b/src/core/base/memory_heap.cpp @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2020 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. + */ +#include "memory_heap.h" +#include "ace_mem_base.h" + +namespace OHOS { +namespace ACELite { +void *MemoryHeap::operator new(size_t size) +{ + return ace_malloc(size); +} + +void *MemoryHeap::operator new[](size_t size) +{ + return ace_malloc(size); +} + +void MemoryHeap::operator delete(void *p) +{ + ace_free(p); +} + +void MemoryHeap::operator delete[](void *p) +{ + ace_free(p); +} +} // namespace ACELite +} // namespace OHOS \ No newline at end of file diff --git a/src/core/base/non_copyable.h b/src/core/base/non_copyable.h new file mode 100755 index 0000000..b2b2c54 --- /dev/null +++ b/src/core/base/non_copyable.h @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2020 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. + */ + +#ifndef OHOS_ACELITE_NON_COPYABLE_H +#define OHOS_ACELITE_NON_COPYABLE_H + +namespace OHOS { +namespace ACELITE { +#define ACE_DISALLOW_COPY_AND_MOVE(className) \ + ACE_DISALLOW_COPY(className); \ + ACE_DISALLOW_MOVE(className) + +#define ACE_DISALLOW_COPY(className) \ + className(const className &) = delete; \ + className &operator=(const className &) = delete + +#define ACE_DISALLOW_MOVE(className) \ + className(className &&) = delete; \ + className &operator=(className &&) = delete + +class NonCopyable { +protected: + NonCopyable() = default; + virtual ~NonCopyable() = default; + +private: + ACE_DISALLOW_COPY_AND_MOVE(NonCopyable); +}; +} // namespace ACELITE +} // namespace OHOS +#endif // OHOS_ACELITE_NON_COPYABLE_H diff --git a/src/core/base/time_util.cpp b/src/core/base/time_util.cpp new file mode 100755 index 0000000..2dc52dc --- /dev/null +++ b/src/core/base/time_util.cpp @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2020 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. + */ + +#include "time_util.h" +#include +#include +#include "ace_mem_base.h" +#include "js_fwk_common.h" + +namespace OHOS { +namespace ACELite { +constexpr char CHAR_M = 'm'; +constexpr char CHAR_S = 's'; +constexpr int32_t MILLIONS_PER_SECOND = 1000; +constexpr uint8_t IDX_PENULT = 2; +int32_t ParseToMilliseconds(const char *time) +{ + if ((time == nullptr) || (strlen(time) == 0)) { + return 0; + } + size_t size = strlen(time); + if (size >= UINT8_MAX) { + return 0; + } + int32_t milliseconds = 0; + if (size == 1) { + milliseconds = strtol(time, nullptr, DEC); + return (milliseconds < 0) ? 0 : milliseconds; + } + + size_t bufSize = size; + char last = time[size - 1]; + char penult = time[size - IDX_PENULT]; + bool isSecond = false; + if (penult == CHAR_M && last == CHAR_S) { + bufSize = size - IDX_PENULT; + } else if (last == CHAR_S) { + bufSize = size - 1; + isSecond = true; + } + if (bufSize == 0) { + return 0; + } + + char *buffer = static_cast(ace_malloc(bufSize + 1)); + if (buffer == nullptr) { + return 0; + } + if (strncpy_s(buffer, bufSize + 1, time, bufSize) == 0) { + buffer[bufSize] = '\0'; + milliseconds = isSecond ? (strtod(buffer, nullptr) * MILLIONS_PER_SECOND) : strtol(buffer, nullptr, DEC); + } + ace_free(buffer); + buffer = nullptr; + return (milliseconds < 0) ? 0 : milliseconds; +} +} // namespace ACELite +} // namespace OHOS diff --git a/src/core/base/time_util.h b/src/core/base/time_util.h new file mode 100755 index 0000000..ad6b0e9 --- /dev/null +++ b/src/core/base/time_util.h @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2020 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. + */ + +#ifndef OHOS_ACELITE_TIME_UTIL_H +#define OHOS_ACELITE_TIME_UTIL_H +#include +#include "js_config.h" +#if ENABLED(SECURE_C_FUNCTION) +#include "securec.h" +#endif // ENABLED(SECURE_C_FUNCTION) + +namespace OHOS { +namespace ACELite { +int32_t ParseToMilliseconds(const char* time); +} // namespace ACELite +} // namespace OHOS + +#endif // OHOS_ACELITE_TIME_UTIL_H \ No newline at end of file diff --git a/src/core/components/BUILD.gn b/src/core/components/BUILD.gn new file mode 100755 index 0000000..02e39c3 --- /dev/null +++ b/src/core/components/BUILD.gn @@ -0,0 +1,45 @@ +#Copyright (c) 2020 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. + +source_set("components") { + configs += [ + "//foundation/ace/lite/jsfwk:ace_config", + ] + sources = [ + "analog_clock_component.cpp", + "canvas_component.cpp", + "chart_component.cpp", + "clock_hand_component.cpp", + "component.cpp", + "component_utils.cpp", + "div_component.cpp", + "image_animator_component.cpp", + "image_component.cpp", + "input_component.cpp", + "list_adapter.cpp", + "list_component.cpp", + "marquee_component.cpp", + "picker_view_component.cpp", + "progress_component.cpp", + "slider_component.cpp", + "swiper_component.cpp", + "switch_component.cpp", + "tab_bar_component.cpp", + "tab_content_component.cpp", + "tabs_component.cpp", + "text_component.cpp", + "scroll_layer.cpp", + ] + include_dirs = [ + ] +} diff --git a/src/core/components/analog_clock_component.cpp b/src/core/components/analog_clock_component.cpp new file mode 100755 index 0000000..0842f82 --- /dev/null +++ b/src/core/components/analog_clock_component.cpp @@ -0,0 +1,211 @@ +/* + * Copyright (c) 2020 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. + */ + +#include "acelite_config.h" + +#ifdef FEATURE_COMPONENT_ANALOG_CLOCK + +#include "ace_log.h" +#include "analog_clock_component.h" +#include "keys.h" +#include "ui_image_view.h" + +namespace OHOS { +namespace ACELite { +AnalogClockComponent::AnalogClockComponent(jerry_value_t options, jerry_value_t children, AppStyleManager* styleManager) + : Component(options, children, styleManager), hour_(0), min_(0), sec_(0), children_(children), clockView_(nullptr), +{ + SetComponentName(K_ANALOG_CLOCK); +} + +bool AnalogClockComponent::CreateNativeViews() +{ + clockView_ = new UIAnalogClock(); + if (clockView_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "AnalogClockComponent: create native view failed!"); + return false; + } + return true; +} + +void AnalogClockComponent::ReleaseNativeViews() +{ + if (clockView_) { + delete clockView_; + clockView_ = nullptr; + } +} + +inline UIView* AnalogClockComponent::GetComponentRootView() const +{ + return clockView_; +} + +bool AnalogClockComponent::SetPrivateAttribute(uint16_t attrKeyId, jerry_value_t attrValue) +{ + if ((clockView_ == nullptr) || !KeyParser::IsKeyValid(attrKeyId) || IS_UNDEFINED(attrValue)) { + HILOG_ERROR(HILOG_MODULE_ACE, "AnalogClockComponent: set private attribute failed!"); + return false; + } + switch (attrKeyId) { + case K_HOUR: + hour_ = IntegerOf(attrValue); + break; + case K_MIN: + min_ = IntegerOf(attrValue); + break; + case K_SEC: + sec_ = IntegerOf(attrValue); + break; + default: + return false; + } + UpdateClock(); + return true; +} + +void AnalogClockComponent::UpdateClock() +{ + if (clockView_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "AnalogClockComponent: update clock failed!"); + return; + } + clockView_->SetTime24Hour(hour_, min_, sec_); +} + +bool AnalogClockComponent::ProcessChildren() +{ + if (jerry_value_is_undefined(children_) || (clockView_ == nullptr)) { + HILOG_ERROR(HILOG_MODULE_ACE, "AnalogClockComponent: process children failed!"); + return false; + } + + uint16_t length = jerry_get_array_length(children_); + for (uint16_t index = 0; index < length; index++) { + jerry_value_t child = jerry_get_property_by_index(children_, index); + if (jerry_value_is_undefined(child)) { + continue; + } + UIView* childView = ComponentUtils::GetViewFromBindingObject(child); + if (childView == nullptr) { + jerry_release_value(child); + continue; + } + + uint16_t handType = GetIntegerProperty(child, ATTR_TYPE); + if (handType > 0) { // clock-hand + bool isImage = GetBoolProperty(child, CLOCK_HAND_IS_IMAGE); + if (isImage) { + SetImageHand(handType, child, childView); + } else { + SetRectHand(handType, child, childView); + } + } else { // clock background + clockView_->Add(childView); + } + jerry_release_value(child); + } + clockView_->SetInitTime24Hour(hour_, min_, sec_); + clockView_->SetDragParentInstead(true); + return true; +} + +void AnalogClockComponent::SetImageHand(uint16_t handType, jerry_value_t child, UIView* childView) +{ + UIImageView* imageView = reinterpret_cast(childView); + if (imageView == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "AnalogClockComponent: childView reinterpret_cast failed!"); + return; + } + int16_t posX = imageView->GetX(); + int16_t posY = imageView->GetY(); + int16_t pivotX = GetIntegerProperty(child, clockHandPivotX); + int16_t pivotY = GetIntegerProperty(child, clockHandPivotY); + switch (handType) { + case K_HOUR: + clockView_->SetHandImage(UIAnalogClock::HandType::HOUR_HAND, + *imageView, {posX, posY}, {pivotX, pivotY}); + break; + case K_MIN: + clockView_->SetHandImage(UIAnalogClock::HandType::MINUTE_HAND, + *imageView, {posX, posY}, {pivotX, pivotY}); + break; + case K_SEC: + clockView_->SetHandImage(UIAnalogClock::HandType::SECOND_HAND, + *imageView, {posX, posY}, {pivotX, pivotY}); + break; + default: + HILOG_ERROR(HILOG_MODULE_ACE, "AnalogClockComponent: UIImageView hand type error!"); + break; + } +} + +void AnalogClockComponent::SetRectHand(uint16_t handType, jerry_value_t child, UIView* childView) +{ + int16_t posX = childView->GetX(); + int16_t posY = childView->GetY(); + int16_t width = childView->GetWidth(); + int16_t height = childView->GetHeight(); + int16_t pivotX = GetIntegerProperty(child, clockHandPivotX); + int16_t pivotY = GetIntegerProperty(child, clockHandPivotY); + int32_t fillColor = GetIntegerProperty(child, COMMON_STYLE_COLOR); + ColorType colorRGB = GetRGBColor(fillColor); + uint16_t opacity = GetIntegerProperty(child, COMMON_STYLE_OPACITY); + switch (handType) { + case K_HOUR: + clockView_->SetHandLine(UIAnalogClock::HandType::HOUR_HAND, {posX, posY}, + {pivotX, pivotY}, colorRGB, width, height, opacity); + break; + case K_MIN: + clockView_->SetHandLine(UIAnalogClock::HandType::MINUTE_HAND, {posX, posY}, + {pivotX, pivotY}, colorRGB, width, height, opacity); + break; + case K_SEC: + clockView_->SetHandLine(UIAnalogClock::HandType::SECOND_HAND, {posX, posY}, + {pivotX, pivotY}, colorRGB, width, height, opacity); + break; + default: + HILOG_ERROR(HILOG_MODULE_ACE, "AnalogClockComponent: rectangle hand type error!"); + break; + } +} + +int32_t AnalogClockComponent::GetIntegerProperty(jerry_value_t obj, const char * const name) +{ + jerry_value_t propName = jerry_create_string((const jerry_char_t*)name); + jerry_value_t propValue = jerry_get_property(obj, propName); + + jerry_value_t target = jerry_value_to_number(propValue); + int32_t res = (int32_t)jerry_get_number_value(target); + jerry_release_value(target); + jerry_release_value(propValue); + jerry_release_value(propName); + return res; +} + +bool AnalogClockComponent::GetBoolProperty(jerry_value_t obj, const char * const name) +{ + jerry_value_t propName = jerry_create_string((const jerry_char_t*)name); + jerry_value_t propValue = jerry_get_property(obj, propName); + + bool res = jerry_value_to_boolean(propValue); + jerry_release_value(propValue); + jerry_release_value(propName); + return res; +} +} // namespace ACELite +} // namespace OHOS + +#endif // FEATURE_COMPONENT_ANALOG_CLOCK diff --git a/src/core/components/analog_clock_component.h b/src/core/components/analog_clock_component.h new file mode 100755 index 0000000..01520a9 --- /dev/null +++ b/src/core/components/analog_clock_component.h @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2020 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. + */ + +#ifndef OHOS_ACELITE_ANALOG_CLOCK_COMPONENT_H +#define OHOS_ACELITE_ANALOG_CLOCK_COMPONENT_H + +#include "acelite_config.h" + +#ifdef FEATURE_COMPONENT_ANALOG_CLOCK + +#include "component.h" +#include "non_copyable.h" +#include "stylemgr/app_style.h" +#include "ui_analog_clock.h" + +namespace OHOS { +namespace ACELite { +class AnalogClockComponent final : public Component { +public: + ACE_DISALLOW_COPY_AND_MOVE(AnalogClockComponent); + AnalogClockComponent() = delete; + AnalogClockComponent(jerry_value_t options, jerry_value_t children, AppStyleManager* styleManager); + ~AnalogClockComponent() {} + +protected: + bool CreateNativeViews() override; + void ReleaseNativeViews() override; + UIView *GetComponentRootView() const override; + bool SetPrivateAttribute(uint16_t attrKeyId, jerry_value_t attrValue) override; + bool ProcessChildren() override; + +private: + int32_t GetIntegerProperty(jerry_value_t obj, const char * const name); + bool GetBoolProperty(jerry_value_t obj, const char * const name); + void SetImageHand(uint16_t handType, jerry_value_t child, UIView* childView); + void SetRectHand(uint16_t handType, jerry_value_t child, UIView* childView); + void UpdateClock(); + + uint8_t hour_; + uint8_t min_; + uint8_t sec_; + jerry_value_t children_; + UIAnalogClock* clockView_; + const char * const clockHandPivotX = "pivot-x"; + const char * const clockHandPivotY = "pivot-y"; +}; +} // namespace ACELite +} // namespace OHOS + +#endif // OHOS_ACELITE_ANALOG_CLOCK_COMPONENT_H + +#endif // FEATURE_COMPONENT_ANALOG_CLOCK diff --git a/src/core/components/camera_component.cpp b/src/core/components/camera_component.cpp new file mode 100755 index 0000000..09a9352 --- /dev/null +++ b/src/core/components/camera_component.cpp @@ -0,0 +1,423 @@ +/* + * Copyright (c) 2020 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. + */ + +#include "acelite_config.h" +#ifdef FEATURE_COMPONENT_CAMERA + +#include "camera_component.h" +#include +#include +#include +#include "ability_env.h" +#include "ace_log.h" +#include "ace_mem_base.h" +#include "js_async_work.h" +#include "key_parser.h" +#include "keys.h" +#include + +using namespace std; + +namespace OHOS { +namespace ACELite { +jerry_value_t CameraComponent::successCallback_; +jerry_value_t CameraComponent::failCallback_; +jerry_value_t CameraComponent::completeCallback_; +jerry_value_t CameraComponent::jsContext_; +bool CameraComponent::lastCaptureCompleted_ = true; + +const char * const CameraComponent::TAKE_PHOTO = "takePhoto"; + +const uint32_t CameraComponent::IMAG_W_PIXELS_LOW = 720; +const uint32_t CameraComponent::IMAG_H_PIXELS_LOW = 576; +const uint32_t CameraComponent::IMAG_W_PIXELS_NORMAL = 1280; +const uint32_t CameraComponent::IMAG_H_PIXELS_NORMAL = 720; +const uint32_t CameraComponent::IMAG_W_PIXELS_HIGH = 1920; +const uint32_t CameraComponent::IMAG_H_PIXELS_HIGH = 1080; + +void FrameCallback::OnFrameFinished(Media::Camera &camera, + Media::FrameConfig &frameConfig, + Media::FrameResult &frameResult) +{ + if (frameConfig.GetFrameConfigType() != Media::FRAME_CONFIG_CAPTURE) { + CameraComponent::ReleaseStaticResources(); + return; + } + auto surfaceList = frameConfig.GetSurfaces(); + if (surfaceList.empty()) { + CameraComponent::ReleaseStaticResources(); + return; + } + Surface *surface = surfaceList.front(); + SurfaceBuffer *buffer = (surface == nullptr) ? nullptr : surface->AcquireBuffer(); + if (buffer == nullptr) { + CameraComponent::ReleaseStaticResources(); + return; + } + string *filePath = CreateFilePath(); + if (filePath == nullptr) { + surface->ReleaseBuffer(buffer); + CameraComponent::ReleaseStaticResources(); + return; + } + + bool writeSuccess = WriteCapture(*filePath, static_cast(buffer->GetVirAddr()), buffer->GetSize()); + CallbackData *callbackData = new CallbackData(); + if ((!writeSuccess) || (callbackData == nullptr)) { + delete filePath; + filePath = nullptr; + surface->ReleaseBuffer(buffer); + CameraComponent::ReleaseStaticResources(); + if (callbackData != nullptr) { + delete callbackData; + callbackData = nullptr; + } + return; + } + + callbackData->isSucceed_ = true; + callbackData->uri_ = filePath; + if (!JsAsyncWork::DispatchAsyncWork(ExecuteJsCallback, callbackData)) { + delete callbackData; + callbackData = nullptr; + CameraComponent::ReleaseStaticResources(); + } + surface->ReleaseBuffer(buffer); +} + +void FrameCallback::OnFrameError(Media::Camera &camera, + Media::FrameConfig &frameConfig, + int32_t errorCode, + Media::FrameResult &frameResult) +{ + CallbackData *callbackData = new CallbackData(); + if (callbackData == nullptr) { + CameraComponent::ReleaseStaticResources(); + return; + } + callbackData->isSucceed_ = false; + callbackData->errorCode_ = errorCode; + callbackData->errorMsg_ = new string("takePhoto failed due to frame error!"); + if (!JsAsyncWork::DispatchAsyncWork(ExecuteJsCallback, callbackData)) { + delete callbackData; + callbackData = nullptr; + CameraComponent::ReleaseStaticResources(); + } +} + +void FrameCallback::ExecuteJsCallback(void *data) +{ + CallbackData *callbackData = static_cast(data); + if (callbackData == nullptr) { + CameraComponent::ReleaseStaticResources(); + return; + } + + if ((callbackData->isSucceed_) && (callbackData->uri_ != nullptr)) { + CallSuccessFunc(callbackData->uri_->c_str()); + CallCompleteFunc(); + } else if ((!callbackData->isSucceed_) && (callbackData->errorMsg_ != nullptr)) { + CallFailFunc(callbackData->errorCode_, callbackData->errorMsg_->c_str()); + CallCompleteFunc(); + } + delete callbackData; + callbackData = nullptr; + CameraComponent::ReleaseStaticResources(); +} + +string *FrameCallback::CreateFilePath() const +{ + const char *dataPath = GetDataPath(); + if (dataPath == nullptr) { + return nullptr; + } + string dataPathStr(dataPath); + string prefix = dataPathStr + "/Img_"; + ostringstream oss; + struct timeval timeVal; + bool getTimeSuccess = false; + if (gettimeofday(&timeVal, nullptr) == 0) { + struct tm *ltm = localtime(&(timeVal.tv_sec)); + if (ltm != nullptr) { + oss << prefix << (ltm->tm_year) << (ltm->tm_mon + 1) << ltm->tm_mday << "_" << ltm->tm_hour << ltm->tm_min + << ltm->tm_sec << ".jpg"; + getTimeSuccess = true; + } + } + if (!getTimeSuccess) { + oss << prefix << ".jpg"; + } + return new string(oss.str()); +} + +bool FrameCallback::WriteCapture(string &filePath, const char * const buffer, const uint32_t size) const +{ + if (buffer == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "FrameCallback: write capture with null buffer!"); + return false; + } + ofstream file(filePath); + if (!file.is_open()) { + HILOG_ERROR(HILOG_MODULE_ACE, "FrameCallback: open file failed when write capture!"); + return false; + } + file.write(buffer, size); + if (file.fail() || file.bad()) { + HILOG_ERROR(HILOG_MODULE_ACE, "FrameCallback: write file failed when write capture!"); + file.close(); + return false; + } + file.close(); + return true; +} + +void FrameCallback::CallSuccessFunc(const char * const uri) +{ + if (jerry_value_is_function(CameraComponent::successCallback_) && (uri != nullptr)) { + const char * const uriKey = "uri"; + jerry_value_t arg = jerry_create_object(); + JerrySetStringProperty(arg, uriKey, uri); + CallJSFunctionAutoRelease(CameraComponent::successCallback_, CameraComponent::jsContext_, &arg, 1); + jerry_release_value(arg); + } +} + +void FrameCallback::CallFailFunc(const int32_t errorCode, const char * const errorMsg) +{ + if (jerry_value_is_function(CameraComponent::failCallback_) && (errorMsg != nullptr)) { + jerry_value_t erromsg = jerry_create_string(reinterpret_cast(errorMsg)); + jerry_value_t errocode = jerry_create_number(errorCode); + jerry_value_t failArg[] = {erromsg, errocode}; + const uint8_t agrc = 2; // 2 arguments for fail callback + CallJSFunctionAutoRelease(CameraComponent::failCallback_, CameraComponent::jsContext_, failArg, agrc); + ReleaseJerryValue(erromsg, errocode, VA_ARG_END_FLAG); + } +} + +void FrameCallback::CallCompleteFunc() +{ + if (jerry_value_is_function(CameraComponent::completeCallback_)) { + CallJSFunctionAutoRelease(CameraComponent::completeCallback_, CameraComponent::jsContext_, nullptr, 0); + } +} + +void CameraCallback::OnCreated(Media::Camera &camera) +{ + frameCallback_ = make_unique(); + Media::CameraConfig *config = Media::CameraConfig::CreateCameraConfig(); + if (config == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "CameraCallback: create camera config failed!"); + return; + } + config->SetFrameStateCallback(frameCallback_.get(), eventHandler_.get()); + camera.Configure(*config); + camera_ = &camera; + + if (previewSurface_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "CameraCallback: fail to start preview due to null surface!"); + return; + } + frameConfig_ = new Media::FrameConfig(Media::FRAME_CONFIG_PREVIEW); + if (frameConfig_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "CameraCallback: create frame config for preview failed!"); + return; + } + frameConfig_->AddSurface(*previewSurface_); + camera.TriggerLoopingCapture(*frameConfig_); +} + +void CameraCallback::OnCreateFailed(const string cameraId, int32_t errorCode) +{ + HILOG_ERROR(HILOG_MODULE_ACE, "CameraCallback: camera:%s unavailable, errorCode:%d", cameraId.c_str(), errorCode); + if (jerry_value_is_function(errorCallback_)) { + const char * const detailKey = "detail"; + const char * const detailValue = "camera unavailable"; + const char * const errorCodeKey = "errorCode"; + jerry_value_t arg = jerry_create_object(); + JerrySetStringProperty(arg, detailKey, detailValue); + JerrySetNumberProperty(arg, errorCodeKey, errorCode); + CallJSFunctionAutoRelease(errorCallback_, UNDEFINED, &arg, 1); + jerry_release_value(arg); + } +} + +CameraComponent::CameraComponent(jerry_value_t options, jerry_value_t children, AppStyleManager *styleManager) + : Component(options, children, styleManager), cameraKit_(nullptr), frameConfig_(nullptr), captureSurface_(nullptr) +{ + SetComponentName(K_CAMERA); + RegisterNamedFunction(TAKE_PHOTO, TakePhoto); +} + +bool CameraComponent::CreateNativeViews() +{ + cameraView_ = make_unique(); + captureSurface_ = Surface::CreateSurface(); + if ((cameraView_ == nullptr) || (captureSurface_ == nullptr)) { + HILOG_ERROR(HILOG_MODULE_ACE, "CameraComponent: create camera view failed!"); + return false; + } + cameraKit_ = Media::CameraKit::GetInstance(); + cameraCallback_ = make_unique(); + frameConfig_ = new Media::FrameConfig(Media::FRAME_CONFIG_CAPTURE); + if (frameConfig_ != nullptr) { + frameConfig_->AddSurface(*captureSurface_); + } + return true; +} + +void CameraComponent::ReleaseNativeViews() +{ + if (cameraCallback_ != nullptr) { + Media::Camera *camera = const_cast(cameraCallback_->GetCameraInstance()); + if (camera != nullptr) { + camera->StopLoopingCapture(); + } + cameraCallback_.reset(); + } + if (frameConfig_ != nullptr) { + delete frameConfig_; + frameConfig_ = nullptr; + } + if (captureSurface_ != nullptr) { + delete captureSurface_; + captureSurface_ = nullptr; + } +} + +inline UIView *CameraComponent::GetComponentRootView() const +{ + return static_cast(cameraView_.get()); +} + +bool CameraComponent::RegisterPrivateEventListener(uint16_t eventTypeId, jerry_value_t funcValue) +{ + bool result = false; + switch (eventTypeId) { + case K_ERROR: { + if (cameraCallback_ != nullptr) { + cameraCallback_->SetErrorCallback(funcValue); + result = true; + } + break; + } + default: + break; + } + return result; +} + +void CameraComponent::PostRender() +{ + if ((cameraView_ == nullptr) || (cameraKit_ == nullptr) || (cameraCallback_ == nullptr)) { + HILOG_ERROR(HILOG_MODULE_ACE, "CameraComponent: post render failed due to null native object!"); + return; + } + list camList = cameraKit_->GetCameraIds(); + if (camList.empty()) { + return; + } + const string cameraId = camList.front(); + Surface *previewSurface = cameraView_->GetSurface(); + if (previewSurface != nullptr) { + previewSurface->SetWidthAndHeight(IMAG_W_PIXELS_NORMAL, IMAG_H_PIXELS_NORMAL); + cameraCallback_->SetPreviewSurface(*previewSurface); + } + cameraKit_->CreateCamera(cameraId, *cameraCallback_.get(), *cameraCallback_->GetEventHandler()); +} + +jerry_value_t CameraComponent::TakePhoto(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t args[], + const jerry_length_t size) +{ + // capture processing flag + if (!lastCaptureCompleted_) { + HILOG_INFO(HILOG_MODULE_ACE, + "Please wait until the last capture processing is over before trying to take a photo"); + return UNDEFINED; + } + lastCaptureCompleted_ = false; + if (size != 1) { + HILOG_ERROR(HILOG_MODULE_ACE, "CameraComponent: call TakePhoto with invalid arguments!"); + lastCaptureCompleted_ = true; + return UNDEFINED; + } + + UISurfaceView *cameraView = static_cast(ComponentUtils::GetViewFromBindingObject(context)); + CameraComponent *component = static_cast(ComponentUtils::GetComponentFromBindingObject(context)); + if ((cameraView == nullptr) || (component == nullptr)) { + HILOG_ERROR(HILOG_MODULE_ACE, "CameraComponent: call TakePhoto failed due to null component object!"); + lastCaptureCompleted_ = true; + return UNDEFINED; + } + + uint16_t length = 0; + const char * const qualityKey = "quality"; + char *quality = JerryMallocStringProperty(args[0], qualityKey, length); + successCallback_ = jerryx_get_property_str(args[0], ATTR_SUCCESS); + failCallback_ = jerryx_get_property_str(args[0], ATTR_FAIL); + completeCallback_ = jerryx_get_property_str(args[0], ATTR_COMPLETE); + jsContext_ = jerry_acquire_value(context); + + if (!CaptureFrame(component, quality)) { + HILOG_ERROR(HILOG_MODULE_ACE, "CameraComponent: capture frame failed!"); + ReleaseStaticResources(); + } + ACE_FREE(quality); + return UNDEFINED; +} + +void CameraComponent::ReleaseStaticResources() +{ + ReleaseJerryValue(successCallback_, failCallback_, completeCallback_, jsContext_, VA_ARG_END_FLAG); + lastCaptureCompleted_ = true; +} + +bool CameraComponent::CaptureFrame(const CameraComponent *component, const char *quality) +{ + Media::FrameConfig *frameConfig = component->GetFrameConfig(); + Surface *surface = const_cast(component->GetCaptureSurface()); + if ((frameConfig == nullptr) || (surface == nullptr)) { + return false; + } + + uint32_t surfWidth = IMAG_W_PIXELS_NORMAL; // corresponding to default resolution + uint32_t surfHeight = IMAG_H_PIXELS_NORMAL; // corresponding to default resolution + if (quality != nullptr) { + const char * const qualityLow = "low"; + const char * const qualityHigh = "high"; + if (strcmp(quality, qualityLow) == 0) { + surfWidth = IMAG_W_PIXELS_LOW; + surfHeight = IMAG_H_PIXELS_LOW; + } else if (strcmp(quality, qualityHigh) == 0) { + surfWidth = IMAG_W_PIXELS_HIGH; + surfHeight = IMAG_H_PIXELS_HIGH; + } + } + surface->SetWidthAndHeight(surfWidth, surfHeight); + + const CameraCallback *cameraCallback = component->GetCameraCallback(); + if (cameraCallback == nullptr) { + return false; + } + Media::Camera *camera = const_cast(cameraCallback->GetCameraInstance()); + if (camera == nullptr) { + return false; + } + return camera->TriggerSingleCapture(*frameConfig) == MEDIA_OK; +} +} // namespace ACELite +} // namespace OHOS +#endif // FEATURE_COMPONENT_CAMERA \ No newline at end of file diff --git a/src/core/components/camera_component.h b/src/core/components/camera_component.h new file mode 100755 index 0000000..b090467 --- /dev/null +++ b/src/core/components/camera_component.h @@ -0,0 +1,188 @@ +/* + * Copyright (c) 2020 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. + */ + +#ifndef OHOS_ACELITE_CAMERA_COMPONENT_H +#define OHOS_ACELITE_CAMERA_COMPONENT_H + +#include "acelite_config.h" +#ifdef FEATURE_COMPONENT_CAMERA + +#include "component.h" +#include "camera_kit.h" +#include "ui_surface_view.h" + +namespace OHOS { +namespace ACELite { +class FrameCallback final : public Media::FrameStateCallback { +public: + ACE_DISALLOW_COPY_AND_MOVE(FrameCallback); + FrameCallback() = default; + ~FrameCallback() = default; + static void ExecuteJsCallback(void *data); + + class CallbackData final : public MemoryHeap { + public: + ACE_DISALLOW_COPY_AND_MOVE(CallbackData); + CallbackData() : isSucceed_(false), uri_(nullptr), errorCode_(0), errorMsg_(nullptr) {} + ~CallbackData() + { + if (uri_ != nullptr) { + delete uri_; + uri_ = nullptr; + } + if (errorMsg_ != nullptr) { + delete errorMsg_; + errorMsg_ = nullptr; + } + } + + bool isSucceed_; + std::string *uri_; + int32_t errorCode_; + std::string *errorMsg_; + }; + +protected: + void OnFrameFinished(Media::Camera &camera, + Media::FrameConfig &frameConfig, + Media::FrameResult &frameResult) override; + void OnFrameError(Media::Camera &camera, + Media::FrameConfig &frameConfig, + int32_t errorCode, + Media::FrameResult &frameResult) override; + +private: + std::string *CreateFilePath() const; + bool WriteCapture(std::string &filePath, const char * const buffer, const uint32_t size) const; + static void CallSuccessFunc(const char * const uri); + static void CallFailFunc(const int32_t errorCode, const char * const errorMsg); + static void CallCompleteFunc(); +}; + +class CameraCallback final : public Media::CameraStateCallback { +public: + ACE_DISALLOW_COPY_AND_MOVE(CameraCallback); + CameraCallback() : camera_(nullptr), previewSurface_(nullptr), frameConfig_(nullptr), errorCallback_(UNDEFINED) + { + eventHandler_ = std::make_unique(); + } + + ~CameraCallback() + { + jerry_release_value(errorCallback_); + eventHandler_.reset(); + frameCallback_.reset(); + if (frameConfig_ != nullptr) { + delete frameConfig_; + frameConfig_ = nullptr; + } + if (camera_ != nullptr) { + camera_->Release(); + } + } + + void SetPreviewSurface(Surface &surface) + { + previewSurface_ = &surface; + } + + void SetErrorCallback(jerry_value_t callback) + { + errorCallback_ = jerry_acquire_value(callback); + } + + const Media::Camera *GetCameraInstance() const + { + return camera_; + } + + Media::EventHandler *GetEventHandler() const + { + return eventHandler_.get(); + } + +protected: + void OnCreated(Media::Camera &camera) override; + void OnCreateFailed(const std::string cameraId, int32_t errorCode) override; + void OnReleased(Media::Camera &camera) override {} + +private: + Media::Camera *camera_; + Surface *previewSurface_; + Media::FrameConfig *frameConfig_; + std::unique_ptr eventHandler_; + std::unique_ptr frameCallback_; + jerry_value_t errorCallback_; +}; + +class CameraComponent final : public Component { +public: + ACE_DISALLOW_COPY_AND_MOVE(CameraComponent); + CameraComponent() = delete; + CameraComponent(jerry_value_t options, jerry_value_t children, AppStyleManager *styleManager); + ~CameraComponent() override {} + const CameraCallback *GetCameraCallback() const + { + return cameraCallback_.get(); + } + + static void ReleaseStaticResources(); + static jerry_value_t successCallback_; + static jerry_value_t failCallback_; + static jerry_value_t completeCallback_; + static jerry_value_t jsContext_; + static bool lastCaptureCompleted_; + +protected: + bool CreateNativeViews() override; + void ReleaseNativeViews() override; + UIView *GetComponentRootView() const override; + bool RegisterPrivateEventListener(uint16_t eventTypeId, jerry_value_t funcValue) override; + void PostRender() override; + +private: + std::unique_ptr cameraView_; + Media::CameraKit *cameraKit_; + std::unique_ptr cameraCallback_; + Media::FrameConfig *frameConfig_; + Surface *captureSurface_; + static const char * const TAKE_PHOTO; + static const uint32_t IMAG_W_PIXELS_LOW; + static const uint32_t IMAG_H_PIXELS_LOW; + static const uint32_t IMAG_W_PIXELS_NORMAL; + static const uint32_t IMAG_H_PIXELS_NORMAL; + static const uint32_t IMAG_W_PIXELS_HIGH; + static const uint32_t IMAG_H_PIXELS_HIGH; + + Media::FrameConfig *GetFrameConfig() const + { + return frameConfig_; + } + + const Surface *GetCaptureSurface() const + { + return captureSurface_; + } + + static bool CaptureFrame(const CameraComponent *component, const char *quality); + static jerry_value_t TakePhoto(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t args[], + const jerry_length_t size); +}; +} // namespace ACELite +} // namespace OHOS +#endif // FEATURE_COMPONENT_CAMERA +#endif // OHOS_ACELITE_CAMERA_COMPONENT_H diff --git a/src/core/components/canvas_component.cpp b/src/core/components/canvas_component.cpp new file mode 100755 index 0000000..af6adbd --- /dev/null +++ b/src/core/components/canvas_component.cpp @@ -0,0 +1,673 @@ +/* + * Copyright (c) 2020 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. + */ + +#include "acelite_config.h" + +#ifdef FEATURE_COMPONENT_CANVAS +#include "canvas_component.h" +#include "js_fwk_common.h" + +namespace OHOS { +namespace ACELite { +// default fill style color=black +const char * const CanvasComponent::DEFAULT_FILLSTYLE = "#000000"; +// default stroke style color=black +const char * const CanvasComponent::DEFAULT_STROKESTYLE = "#000000"; +// default font size=30px, font family=HYQiHei-65S +const char * const CanvasComponent::DEFAULT_FONT = "30px HYQiHei-65S"; +// default text align=left +const char * const CanvasComponent::DEFAULT_TEXTALIGN = "left"; + +const uint8_t CanvasComponent::ARGS_COUNT_ONE = 1; +const uint8_t CanvasComponent::ARGS_COUNT_THREE = 3; +const uint8_t CanvasComponent::ARGS_COUNT_FOUR = 4; +const uint8_t CanvasComponent::ARGS_INDEX_0 = 0; +const uint8_t CanvasComponent::ARGS_INDEX_1 = 1; +const uint8_t CanvasComponent::ARGS_INDEX_2 = 2; +const uint8_t CanvasComponent::ARGS_INDEX_3 = 3; + +// API-attribute +const char * const CanvasComponent::ATTR_FILLSTYLE = "fillStyle"; +const char * const CanvasComponent::ATTR_STROKESTYLE = "strokeStyle"; +const char * const CanvasComponent::ATTR_LINEWIDTH = "lineWidth"; +const char * const CanvasComponent::ATTR_FONT = "font"; +const char * const CanvasComponent::ATTR_TEXTALIGN = "textAlign"; + +// API-method +const char * const CanvasComponent::FUNC_GETCONTEXT = "getContext"; +const char * const CanvasComponent::FUNC_FILLRECT = "fillRect"; +const char * const CanvasComponent::FUNC_STROKERECT = "strokeRect"; +const char * const CanvasComponent::FUNC_FILLTEXT = "fillText"; + +// create canvas draw attribute-callback mapping +const AttrMap CanvasComponent::attrMap_[] = { + {ATTR_FILLSTYLE, FillStyleSetter, FillStyleGetter}, + {ATTR_STROKESTYLE, StrokeStyleSetter, StrokeStyleGetter}, + {ATTR_LINEWIDTH, LineWidthSetter, LineWidthGetter}, + {ATTR_FONT, FontSetter, FontGetter}, + {ATTR_TEXTALIGN, TextAlignSetter, TextAlignGetter} +}; + +// create canvas draw method-callback mapping +const MethodMap CanvasComponent::methodMap_[] = { + {FUNC_GETCONTEXT, CanvasGetContext}, + {FUNC_FILLRECT, CanvasFillRect}, + {FUNC_STROKERECT, CanvasStrokeRect}, + {FUNC_FILLTEXT, CanvasFillText} +}; + +CanvasComponent::CanvasComponent(jerry_value_t options, jerry_value_t children, AppStyleManager *styleManager) + : Component(options, children, styleManager), + canvas_(nullptr), + canvas2dContext_(UNDEFINED), + fillStyleValue_(nullptr), + strokeStyleValue_(nullptr), + fontValue_(nullptr), + textAlignValue_(nullptr), + lineWidthValue_(1) +{ + SetComponentName(K_CANVAS); + // set default paint pattern + paint_.SetFillColor(Color::Black()); + paint_.SetOpacity(OPA_OPAQUE); + paint_.SetStrokeColor(Color::Black()); + paint_.SetStrokeWidth(1); + + // set default text font pattern + fontStyle_.align = TEXT_ALIGNMENT_LEFT; + fontStyle_.direct = TEXT_DIRECT_LTR; + fontStyle_.fontSize = DEFAULT_FONT_SIZE; + char *defaultFontName = nullptr; + CopyFontFamily(defaultFontName, DEFAULT_FONT_FAMILY); + fontStyle_.fontName = defaultFontName; + fontStyle_.letterSpace = DEFAULT_FONT_LETTERSPACE; + + RegisterNamedFunction(methodMap_[0].methodName, methodMap_[0].callbackName); +} +// Create FlexLayout +bool CanvasComponent::CreateNativeViews() +{ + canvas_ = new UICanvas(); + if (canvas_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "create native canvas view failed"); + return false; + } + return true; +} + +void CanvasComponent::ReleaseNativeViews() +{ + ACE_DELETE(canvas_); + ACE_FREE(fillStyleValue_); + ACE_FREE(strokeStyleValue_); + ACE_FREE(fontValue_); + ACE_FREE(textAlignValue_); + if (!IS_UNDEFINED(canvas2dContext_)) { + bool deleted = jerry_delete_object_native_pointer(canvas2dContext_, nullptr); + if (!deleted) { + HILOG_WARN(HILOG_MODULE_ACE, "canvas_component: delete object native pointer canvas2dContext_ failed!"); + } + jerry_release_value(canvas2dContext_); + } +} + +UIView *CanvasComponent::GetComponentRootView() const +{ + return canvas_; +} + +jerry_value_t CanvasComponent::CanvasGetContext(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t args[], + const jerry_length_t argsNum) +{ + (void)func; + (void)args; + if (argsNum != ARGS_COUNT_ONE) { + HILOG_ERROR(HILOG_MODULE_ACE, "canvas_component: the number of getContext method parameter error!"); + return UNDEFINED; + } + + CanvasComponent *component = static_cast(ComponentUtils::GetComponentFromBindingObject(context)); + if (component == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "canvas_component: get canvas component from js object failed!"); + return UNDEFINED; + } + + if (IS_UNDEFINED(component->canvas2dContext_)) { + component->canvas2dContext_ = jerry_create_object(); + jerry_set_object_native_pointer(component->canvas2dContext_, component, nullptr); + + // register fillStyle, strokeStyle, lineWidth, font, textAlign attribute + uint16_t attrMapLength = sizeof(attrMap_) / sizeof(attrMap_[0]); + for (uint16_t index = 0; index < attrMapLength; index++) { + RegisterAttributeFunc(component->canvas2dContext_, attrMap_[index].attrName, attrMap_[index].setterName, + attrMap_[index].getterName); + } + + // register fillRect, strokeRect, fillText method + uint16_t methodMapLength = sizeof(methodMap_) / sizeof(methodMap_[0]); + for (uint16_t index = 1; index < methodMapLength; index++) { + RegisterDrawMethodFunc(component->canvas2dContext_, methodMap_[index].methodName, + methodMap_[index].callbackName); + } + } + + jerry_acquire_value(component->canvas2dContext_); + return component->canvas2dContext_; +} + +jerry_value_t CanvasComponent::FillStyleSetter(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t args[], + const jerry_length_t argsNum) +{ + (void)func; + if (argsNum != ARGS_COUNT_ONE) { + HILOG_ERROR(HILOG_MODULE_ACE, "canvas_component: the value of fillStyle is null!"); + return UNDEFINED; + } + + CanvasComponent *component = static_cast(ComponentUtils::GetComponentFromBindingObject(context)); + if (component == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "canvas_component: get canvas component from js object failed!"); + return UNDEFINED; + } + + ACE_FREE(component->fillStyleValue_); + + component->fillStyleValue_ = MallocStringOf(args[ARGS_INDEX_0]); + if (component->fillStyleValue_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "canvas_component: get fillStyle value failed"); + return UNDEFINED; + } + + uint32_t color = 0; + uint8_t alpha = OPA_OPAQUE; + ParseColor(component->fillStyleValue_, color, alpha); + component->paint_.SetFillColor(component->GetRGBColor(color)); + component->paint_.SetOpacity(alpha); + return UNDEFINED; +} + +jerry_value_t CanvasComponent::FillStyleGetter(const jerry_value_t func, + const jerry_value_t dom, + const jerry_value_t args[], + const jerry_length_t argsNum) +{ + (void)func; + (void)args; + (void)argsNum; + CanvasComponent *component = static_cast(ComponentUtils::GetComponentFromBindingObject(dom)); + if (component == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "canvas_component: get canvas component from js object failed!"); + return UNDEFINED; + } + + if (component->fillStyleValue_ == nullptr) { + CopyFontFamily(component->fillStyleValue_, DEFAULT_FILLSTYLE); + } + + if (component->fillStyleValue_ != nullptr) { + return jerry_create_string(reinterpret_cast(component->fillStyleValue_)); + } else { + return UNDEFINED; + } +} + +jerry_value_t CanvasComponent::StrokeStyleSetter(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t args[], + const jerry_length_t argsNum) +{ + (void)func; + if (argsNum != ARGS_COUNT_ONE) { + HILOG_ERROR(HILOG_MODULE_ACE, "canvas_component: the value of strokeStyle is null!"); + return UNDEFINED; + } + + CanvasComponent *component = static_cast(ComponentUtils::GetComponentFromBindingObject(context)); + if (component == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "canvas_component: get canvas component from js object failed!"); + return UNDEFINED; + } + + ACE_FREE(component->strokeStyleValue_); + + component->strokeStyleValue_ = MallocStringOf(args[ARGS_INDEX_0]); + if (component->strokeStyleValue_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "canvas_component: get strokeStyle value failed"); + return UNDEFINED; + } + + uint32_t color = 0; + uint8_t alpha = OPA_OPAQUE; + ParseColor(component->strokeStyleValue_, color, alpha); + component->paint_.SetStrokeColor(component->GetRGBColor(color)); + component->paint_.SetOpacity(alpha); + return UNDEFINED; +} + +jerry_value_t CanvasComponent::StrokeStyleGetter(const jerry_value_t func, + const jerry_value_t dom, + const jerry_value_t args[], + const jerry_length_t argsNum) +{ + (void)func; + (void)args; + (void)argsNum; + CanvasComponent *component = static_cast(ComponentUtils::GetComponentFromBindingObject(dom)); + if (component == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "canvas_component: get canvas component from js object failed!"); + return UNDEFINED; + } + + if (component->strokeStyleValue_ == nullptr) { + CopyFontFamily(component->strokeStyleValue_, DEFAULT_STROKESTYLE); + } + + if (component->strokeStyleValue_ != nullptr) { + return jerry_create_string(reinterpret_cast(component->strokeStyleValue_)); + } else { + return UNDEFINED; + } +} + +jerry_value_t CanvasComponent::LineWidthSetter(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t args[], + const jerry_length_t argsNum) +{ + (void)func; + if (argsNum != ARGS_COUNT_ONE) { + HILOG_ERROR(HILOG_MODULE_ACE, "canvas_component: the value of lineWidth is null!"); + return UNDEFINED; + } + + CanvasComponent *component = static_cast(ComponentUtils::GetComponentFromBindingObject(context)); + if (component == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "canvas_component: get canvas component from js object failed!"); + return UNDEFINED; + } + + component->lineWidthValue_ = IntegerOf(args[ARGS_INDEX_0]); + component->paint_.SetStrokeWidth(component->lineWidthValue_); + return UNDEFINED; +} + +jerry_value_t CanvasComponent::LineWidthGetter(const jerry_value_t func, + const jerry_value_t dom, + const jerry_value_t args[], + const jerry_length_t argsNum) +{ + (void)func; + (void)args; + (void)argsNum; + CanvasComponent *component = static_cast(ComponentUtils::GetComponentFromBindingObject(dom)); + if (component == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "canvas_component: get canvas component from js object failed!"); + return UNDEFINED; + } + return jerry_create_number(component->lineWidthValue_); +} + +jerry_value_t CanvasComponent::FontSetter(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t args[], + const jerry_length_t argsNum) +{ + (void)func; + if (argsNum != ARGS_COUNT_ONE) { + HILOG_ERROR(HILOG_MODULE_ACE, "canvas_component: the value of font is null!"); + return UNDEFINED; + } + + CanvasComponent *component = static_cast(ComponentUtils::GetComponentFromBindingObject(context)); + if (component == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "canvas_component: get canvas component from js object failed!"); + return UNDEFINED; + } + + ACE_FREE(component->fontValue_); + + component->fontValue_ = MallocStringOf(args[ARGS_INDEX_0]); + if (component->fontValue_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "canvas_component: get text font value failed"); + return UNDEFINED; + } + + const int8_t maxParamCount = 2; + for (int8_t index = 0; index < maxParamCount; index++) { + // get font size or font family from fontValue. + char *mallocSubFont = nullptr; + component->GetSubFont(component->fontValue_, index, mallocSubFont); + if (mallocSubFont == nullptr) { + HILOG_WARN(HILOG_MODULE_ACE, "canvas_component: get text font size or font family failed"); + ace_free(component->fontValue_); + component->fontValue_ = nullptr; + return UNDEFINED; + } + + // if it is a font size + if (*mallocSubFont >= '0' && *mallocSubFont <= '9') { + component->fontStyle_.fontSize = strtol(mallocSubFont, nullptr, DEC); + ace_free(mallocSubFont); + mallocSubFont = nullptr; + } else { // if it is a font family + // free default component->fontStyle_.fontName memory. + if (component->fontStyle_.fontName != nullptr) { + ace_free(const_cast(component->fontStyle_.fontName)); + component->fontStyle_.fontName = nullptr; + } + // set customized font name, the memory of mallocFontFamily need be free in CanvasFillText method. + component->fontStyle_.fontName = mallocSubFont; + } + } + return UNDEFINED; +} + +jerry_value_t CanvasComponent::FontGetter(const jerry_value_t func, + const jerry_value_t dom, + const jerry_value_t args[], + const jerry_length_t argsNum) +{ + (void)func; + (void)args; + (void)argsNum; + CanvasComponent *component = static_cast(ComponentUtils::GetComponentFromBindingObject(dom)); + if (component == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "canvas_component: get canvas component from js object failed!"); + return UNDEFINED; + } + + if (component->fontValue_ == nullptr) { + CopyFontFamily(component->fontValue_, DEFAULT_FONT); + } + + if (component->fontValue_ != nullptr) { + return jerry_create_string(reinterpret_cast(component->fontValue_)); + } else { + return UNDEFINED; + } +} + +jerry_value_t CanvasComponent::TextAlignSetter(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t args[], + const jerry_length_t argsNum) +{ + (void)func; + if (argsNum != ARGS_COUNT_ONE) { + HILOG_ERROR(HILOG_MODULE_ACE, "canvas_component: the value of textAlign is null!"); + return UNDEFINED; + } + + CanvasComponent *component = static_cast(ComponentUtils::GetComponentFromBindingObject(context)); + if (component == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "canvas_component: get canvas component from js object failed!"); + return UNDEFINED; + } + + ACE_FREE(component->textAlignValue_); + + uint16_t textAlignLength = 0; + component->textAlignValue_ = MallocStringOf(args[ARGS_INDEX_0], &textAlignLength); + if (component->textAlignValue_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "canvas_component: get text align value failed"); + return UNDEFINED; + } + + uint16_t textAlignId = KeyParser::ParseKeyId(component->textAlignValue_, textAlignLength); + if (textAlignId == K_LEFT) { + component->fontStyle_.align = TEXT_ALIGNMENT_LEFT; + } else if (textAlignId == K_RIGHT) { + component->fontStyle_.align = TEXT_ALIGNMENT_RIGHT; + } else if (textAlignId == K_CENTER) { + component->fontStyle_.align = TEXT_ALIGNMENT_CENTER; + } else { + // do nothing(use defualt align=TEXT_ALIGNMENT_LEFT) + } + return UNDEFINED; +} + +jerry_value_t CanvasComponent::TextAlignGetter(const jerry_value_t func, + const jerry_value_t dom, + const jerry_value_t args[], + const jerry_length_t argsNum) +{ + (void)func; + (void)args; + (void)argsNum; + CanvasComponent *component = static_cast(ComponentUtils::GetComponentFromBindingObject(dom)); + if (component == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "canvas_component: get canvas component from js object failed!"); + return UNDEFINED; + } + + if (component->textAlignValue_ == nullptr) { + CopyFontFamily(component->textAlignValue_, DEFAULT_TEXTALIGN); + } + + if (component->textAlignValue_ != nullptr) { + return jerry_create_string(reinterpret_cast(component->textAlignValue_)); + } else { + return UNDEFINED; + } +} + +jerry_value_t CanvasComponent::CanvasFillRect(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t args[], + const jerry_length_t argsNum) +{ + (void)func; + if (argsNum != ARGS_COUNT_FOUR) { + HILOG_ERROR(HILOG_MODULE_ACE, "canvas_component: the number of fillRect method parameter error!"); + return UNDEFINED; + } + + CanvasComponent *component = static_cast(ComponentUtils::GetComponentFromBindingObject(context)); + if (component == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "canvas_component: get canvas component from js object failed!"); + return UNDEFINED; + } + + int16_t startX = IntegerOf(args[ARGS_INDEX_0]); + int16_t startY = IntegerOf(args[ARGS_INDEX_1]); + int16_t endX = IntegerOf(args[ARGS_INDEX_2]); + int16_t endY = IntegerOf(args[ARGS_INDEX_3]); + + // FILL_STYLE: fill rect support fill shapses only + component->paint_.SetStyle(component->paint_.FILL_STYLE); + + Point startPoint; + startPoint.x = startX; + startPoint.y = startY; + component->canvas_->DrawRect(startPoint, endX, endY, component->paint_); + return UNDEFINED; +} + +jerry_value_t CanvasComponent::CanvasStrokeRect(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t args[], + const jerry_length_t argsNum) +{ + (void)func; + if (argsNum != ARGS_COUNT_FOUR) { + HILOG_ERROR(HILOG_MODULE_ACE, "canvas_component: the number of strokeRect method parameter error!"); + return UNDEFINED; + } + + CanvasComponent *component = static_cast(ComponentUtils::GetComponentFromBindingObject(context)); + if (component == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "canvas_component: get canvas component from js object failed!"); + return UNDEFINED; + } + + int16_t startX = IntegerOf(args[ARGS_INDEX_0]); + int16_t startY = IntegerOf(args[ARGS_INDEX_1]); + int16_t endX = IntegerOf(args[ARGS_INDEX_2]); + int16_t endY = IntegerOf(args[ARGS_INDEX_3]); + + // STROKE_STYLE: stroke rect support draw borders only + component->paint_.SetStyle(component->paint_.STROKE_STYLE); + + Point startPoint; + startPoint.x = startX; + startPoint.y = startY; + component->canvas_->DrawRect(startPoint, endX, endY, component->paint_); + return UNDEFINED; +} + +jerry_value_t CanvasComponent::CanvasFillText(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t args[], + const jerry_length_t argsNum) +{ + (void)func; + if (argsNum != ARGS_COUNT_THREE) { + HILOG_ERROR(HILOG_MODULE_ACE, "canvas_component: the number of fillText method parameter error!"); + return UNDEFINED; + } + + CanvasComponent *component = static_cast(ComponentUtils::GetComponentFromBindingObject(context)); + if (component == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "canvas_component: get canvas component from js object failed!"); + return UNDEFINED; + } + + char *textValue = MallocStringOf(args[ARGS_INDEX_0]); + if (textValue == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "canvas_component: get text value failed"); + return UNDEFINED; + } + + int16_t startX = IntegerOf(args[ARGS_INDEX_1]); + int16_t startY = IntegerOf(args[ARGS_INDEX_2]); + int16_t maxWidth = component->canvas_->GetWidth(); + + // FILL_STYLE: fillText support fill shapses only + component->paint_.SetStyle(component->paint_.FILL_STYLE); + + Point startPoint; + const int8_t half = 2; + startPoint.x = startX; + startPoint.y = startY; + + // if textAlign=left, not need transfer startX, if textAlign=right or center, need transfer startX + if (component->fontStyle_.align == TEXT_ALIGNMENT_RIGHT) { + startPoint.x = startX - maxWidth; + } else if (component->fontStyle_.align == TEXT_ALIGNMENT_CENTER) { + startPoint.x = (startX + startX - maxWidth) / half; + } else { + startPoint.x = startX; + } + + component->canvas_->DrawLabel(startPoint, textValue, maxWidth, component->fontStyle_, component->paint_); + + // free component->fontStyle_.fontName memory which malloc in FontSetter method. + if (component->fontStyle_.fontName != nullptr) { + ace_free(const_cast(component->fontStyle_.fontName)); + component->fontStyle_.fontName = nullptr; + } + + ACE_FREE(textValue); + return UNDEFINED; +} + +void CanvasComponent::GetSubFont(const char *font, const uint8_t index, char *&subFont) const +{ + if (font == nullptr || *font == '\0') { + HILOG_ERROR(HILOG_MODULE_ACE, "canvas_component: get font attribute failed"); + return; + } + + if (strlen(font) >= UINT16_MAX) { + HILOG_ERROR(HILOG_MODULE_ACE, "canvas_component: font size overflow."); + return; + } + + // skip space character at the head of string. + while (*font != '\0') { + if (*font == ' ') { + font++; + } else { + break; + } + } + + uint8_t currentIndex = 0; + const char *currentPos = font; + const char *endPos = font; + while (*currentPos != '\0') { + // find the sub font string + if (currentIndex == index) { + if (*endPos != ' ' && *endPos != '\0') { + endPos++; + continue; + } + uint16_t len = endPos - currentPos; + uint16_t startIndex = currentPos - font; + subFont = static_cast(ace_malloc(len + 1)); + if (subFont == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "canvas_component: malloc buffer failed for subFont"); + return; + } + errno_t error = strncpy_s(subFont, len + 1, font + startIndex, len); + if (error != 0) { + HILOG_ERROR(HILOG_MODULE_ACE, "canvas_component: copy string failed"); + ace_free(subFont); + subFont = nullptr; + return; + } + subFont[len] = '\0'; + break; + } else { // go forward to next sub font string. + if (*(currentPos) == ' ' && *(currentPos + 1) != ' ') { + currentIndex = currentIndex + 1; + endPos = currentPos + 1; + } + currentPos++; + } + } +} + +void CanvasComponent::RegisterAttributeFunc(jerry_value_t canvas2dContext, + const char *attributeName, + jerry_external_handler_t setterHandler, + jerry_external_handler_t getterHandler) +{ + // register canvas js attribute setter property via the jerry_define_own_property method + jerry_value_t propName = jerry_create_string(reinterpret_cast(attributeName)); + jerry_property_descriptor_t desc; + jerry_init_property_descriptor_fields(&desc); + desc.is_set_defined = true; + desc.setter = jerry_create_external_function(setterHandler); + desc.is_get_defined = true; + desc.getter = jerry_create_external_function(getterHandler); + jerry_value_t returnValue = jerry_define_own_property(canvas2dContext, propName, &desc); + jerry_free_property_descriptor_fields(&desc); + ReleaseJerryValue(propName, returnValue, VA_ARG_END_FLAG); +} + +void CanvasComponent::RegisterDrawMethodFunc(jerry_value_t canvas2dContext, + const char *drawMethodName, + jerry_external_handler_t handler) +{ + JerrySetFuncProperty(canvas2dContext, drawMethodName, handler); +} +} // namespace ACELite +} // namespace OHOS +#endif // FEATURE_COMPONENT_CANVAS diff --git a/src/core/components/canvas_component.h b/src/core/components/canvas_component.h new file mode 100755 index 0000000..335ee18 --- /dev/null +++ b/src/core/components/canvas_component.h @@ -0,0 +1,169 @@ +/* + * Copyright (c) 2020 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. + */ + +#ifndef OHOS_ACELITE_CANVAS_COMPONENT_H +#define OHOS_ACELITE_CANVAS_COMPONENT_H + +#include "acelite_config.h" + +#ifdef FEATURE_COMPONENT_CANVAS +#include "component.h" +#include "non_copyable.h" +#include "ui_canvas.h" + +namespace OHOS { +namespace ACELite { +struct AttrMap { + ACE_DISALLOW_COPY_AND_MOVE(AttrMap); + const char *attrName; + jerry_external_handler_t setterName; + jerry_external_handler_t getterName; +}; +struct MethodMap { + ACE_DISALLOW_COPY_AND_MOVE(MethodMap); + const char *methodName; + jerry_external_handler_t callbackName; +}; + +class CanvasComponent final : public Component { +public: + ACE_DISALLOW_COPY_AND_MOVE(CanvasComponent); + CanvasComponent() = delete; + CanvasComponent(jerry_value_t options, jerry_value_t children, AppStyleManager *styleManager); + ~CanvasComponent() override {} + +protected: + bool CreateNativeViews() override; + void ReleaseNativeViews() override; + UIView *GetComponentRootView() const override; + +private: + void GetSubFont(const char *font, const uint8_t index, char *&subFont) const; + + static void RegisterAttributeFunc(jerry_value_t canvas2dContext, + const char *attributeName, + jerry_external_handler_t setterHandler, + jerry_external_handler_t getterHandler); + + static void RegisterDrawMethodFunc(jerry_value_t canvas2dContext, + const char *drawMethodName, + jerry_external_handler_t handler); + + static jerry_value_t CanvasGetContext(const jerry_value_t func, + const jerry_value_t dom, + const jerry_value_t args[], + const jerry_length_t argsNum); + + static jerry_value_t FillStyleSetter(const jerry_value_t func, + const jerry_value_t dom, + const jerry_value_t args[], + const jerry_length_t argsNum); + + static jerry_value_t FillStyleGetter(const jerry_value_t func, + const jerry_value_t dom, + const jerry_value_t args[], + const jerry_length_t argsNum); + + static jerry_value_t StrokeStyleSetter(const jerry_value_t func, + const jerry_value_t dom, + const jerry_value_t args[], + const jerry_length_t argsNum); + + static jerry_value_t StrokeStyleGetter(const jerry_value_t func, + const jerry_value_t dom, + const jerry_value_t args[], + const jerry_length_t argsNum); + + static jerry_value_t LineWidthSetter(const jerry_value_t func, + const jerry_value_t dom, + const jerry_value_t args[], + const jerry_length_t argsNum); + + static jerry_value_t LineWidthGetter(const jerry_value_t func, + const jerry_value_t dom, + const jerry_value_t args[], + const jerry_length_t argsNum); + + static jerry_value_t FontSetter(const jerry_value_t func, + const jerry_value_t dom, + const jerry_value_t args[], + const jerry_length_t argsNum); + + static jerry_value_t FontGetter(const jerry_value_t func, + const jerry_value_t dom, + const jerry_value_t args[], + const jerry_length_t argsNum); + + static jerry_value_t TextAlignSetter(const jerry_value_t func, + const jerry_value_t dom, + const jerry_value_t args[], + const jerry_length_t argsNum); + + static jerry_value_t TextAlignGetter(const jerry_value_t func, + const jerry_value_t dom, + const jerry_value_t args[], + const jerry_length_t argsNum); + + static jerry_value_t CanvasFillRect(const jerry_value_t func, + const jerry_value_t dom, + const jerry_value_t args[], + const jerry_length_t argsNum); + + static jerry_value_t CanvasStrokeRect(const jerry_value_t func, + const jerry_value_t dom, + const jerry_value_t args[], + const jerry_length_t argsNum); + + static jerry_value_t CanvasFillText(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t args[], + const jerry_length_t argsNum); + + UICanvas *canvas_; + jerry_value_t canvas2dContext_; + Paint paint_; + UICanvas::FontStyle fontStyle_; + char *fillStyleValue_; + char *strokeStyleValue_; + char *fontValue_; + char *textAlignValue_; + int16_t lineWidthValue_; + static const char * const DEFAULT_FILLSTYLE; + static const char * const DEFAULT_STROKESTYLE; + static const char * const DEFAULT_FONT; + static const char * const DEFAULT_TEXTALIGN; + static const AttrMap attrMap_[]; + static const MethodMap methodMap_[]; + static const uint8_t ARGS_COUNT_ONE; + static const uint8_t ARGS_COUNT_THREE; + static const uint8_t ARGS_COUNT_FOUR; + static const uint8_t ARGS_INDEX_0; + static const uint8_t ARGS_INDEX_1; + static const uint8_t ARGS_INDEX_2; + static const uint8_t ARGS_INDEX_3; + static const char * const ATTR_FILLSTYLE; + static const char * const ATTR_STROKESTYLE; + static const char * const ATTR_LINEWIDTH; + static const char * const ATTR_FONT; + static const char * const ATTR_TEXTALIGN; + static const char * const FUNC_GETCONTEXT; + static const char * const FUNC_FILLRECT; + static const char * const FUNC_STROKERECT; + static const char * const FUNC_FILLTEXT; +}; +} // namespace ACELite +} // namespace OHOS +#endif // FEATURE_COMPONENT_CANVAS +#endif // OHOS_ACELITE_CANVAS_COMPONENT_H diff --git a/src/core/components/chart_component.cpp b/src/core/components/chart_component.cpp new file mode 100755 index 0000000..23b7c09 --- /dev/null +++ b/src/core/components/chart_component.cpp @@ -0,0 +1,1032 @@ +/* + * Copyright (c) 2020 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. + */ + +#include "components/chart_component.h" +#include "ace_log.h" +#include "ace_mem_base.h" +#include "flex_layout.h" +#include "keys.h" +#include "ui_chart.h" +#include "ui_circle_progress.h" +#include "font/ui_font_header.h" + +namespace OHOS { +namespace ACELite { +const char * const ChartComponent::DATA = "data"; +const char * const ChartComponent::APPEND_SERIAL_INDEX = "serial"; +const char * const ChartComponent::LINE = "line"; +const char * const ChartComponent::BAR = "bar"; +const char * const ChartComponent::FUNC_JS_API = "append"; +const char * const ChartComponent::STROKE_COLOR = "strokeColor"; +const char * const ChartComponent::STROKE_WIDTH = "strokeWidth"; +const char * const ChartComponent::FILL_COLOR = "fillColor"; +const char * const ChartComponent::GRADIENT = "gradient"; +const char * const ChartComponent::LINE_STYLE = "lineStyle"; +const char * const ChartComponent::SMOOTH = "smooth"; +const char * const ChartComponent::HEAD_POINT = "headPoint"; +const char * const ChartComponent::SHAPE = "shape"; +const char * const ChartComponent::SIZE = "size"; +const char * const ChartComponent::TOP_POINT = "topPoint"; +const char * const ChartComponent::BOTTOM_POINT = "bottomPoint"; +const char * const ChartComponent::X_AXIS = "xAxis"; +const char * const ChartComponent::Y_AXIS = "yAxis"; +const char * const ChartComponent::MIN = "min"; +const char * const ChartComponent::MAX = "max"; +const char * const ChartComponent::TYPE = "type"; +const char * const ChartComponent::SERIES = "series"; +const char * const ChartComponent::COLOR = "color"; +const char * const ChartComponent::WIDTH = "width"; +const char * const ChartComponent::LOOP = "loop"; +const char * const ChartComponent::MARGIN = "margin"; +const char * const ChartComponent::DISPLAY = "display"; + +ChartComponent::ChartComponent(jerry_value_t options, jerry_value_t children, AppStyleManager* styleManager) + : Component(options, children, styleManager), + xAxis_(nullptr), + yAxis_(nullptr), + yMinValue_(0), + yMaxValue_(0), + xMinValue_(0), + xMaxValue_(0), + options_(options), + chartView_(nullptr), + serials_(nullptr), + totalSerialsNum_(0), + dataSetsRecord_(UNDEFINED), + seriesOptions_(nullptr), + chartType_(const_cast(LINE)), + headPointStyle_(nullptr), + topPointStyle_(nullptr), + bottomPointStyle_(nullptr){} + +bool ChartComponent::CreateNativeViews() +{ + jerry_value_t attrsPropValue = jerryx_get_property_str(options_, ATTR_ATTRS); + jerry_value_t typeStrHandler = jerry_create_string(reinterpret_cast(TYPE)); + jerry_value_t hasTypeProp = jerry_has_property(attrsPropValue, typeStrHandler); + if (jerry_get_boolean_value(hasTypeProp)) { + jerry_value_t typeValHandler = jerry_get_property(attrsPropValue, typeStrHandler); + char *type = MallocStringOf(typeValHandler); + jerry_release_value(typeValHandler); + if ((type != nullptr) && !strcmp(type, BAR)) { + chartView_ = new UIChartPillar(); + chartType_ = const_cast(BAR); + } + ACE_FREE(type); + } + ReleaseJerryValue(hasTypeProp, typeStrHandler, attrsPropValue, VA_ARG_END_FLAG); + if (!strcmp(chartType_, LINE)) { + chartView_ = new UIChartPolyline(); + } + if (chartView_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "create chart view error"); + return false; + } + if (!Init()) { + return false; + } + return true; +} + +bool ChartComponent::SetPrivateAttribute(uint16_t attrKeyId, jerry_value_t attrValue) +{ + if ((chartView_ == nullptr) || !KeyParser::IsKeyValid(attrKeyId) || IS_UNDEFINED(attrValue)) { + HILOG_ERROR(HILOG_MODULE_ACE, "chart view has not been created"); + return false; + } + switch (attrKeyId) { + case K_DATASETS: { + dataSetsRecord_ = attrValue; + break; + } + case K_OPATIONS: { + SetOptions(attrValue); + break; + } + default: { + break; + } + } + return false; +} + +void ChartComponent::PostUpdate(uint16_t attrKeyId, bool updateResult) +{ + chartView_->ClearDataSerial(); + chartView_->Invalidate(); + ClearAllDataSerials(); + Reset(); + PostRender(); +} + +void ChartComponent::PostRender() +{ + uint8_t serialsCount = jerry_get_array_length(dataSetsRecord_); + jerry_value_t data = jerry_create_string(reinterpret_cast(DATA)); + UpdateData(dataSetsRecord_, data, serialsCount); + jerry_release_value(data); + chartView_->Invalidate(); +} + +void ChartComponent::ReleaseNativeViews() +{ + if (chartView_) { + delete (chartView_); + chartView_ = nullptr; + } + ClearAllDataSerials(); + if (seriesOptions_ != nullptr) { + if (seriesOptions_->head) { + delete(seriesOptions_->head); + seriesOptions_->head = nullptr; + } + if (seriesOptions_->top) { + delete(seriesOptions_->top); + seriesOptions_->top = nullptr; + } + if (seriesOptions_->bottom) { + delete(seriesOptions_->bottom); + seriesOptions_->bottom = nullptr; + } + delete(seriesOptions_); + seriesOptions_ = nullptr; + } + if (headPointStyle_ != nullptr) { + delete(headPointStyle_); + headPointStyle_ = nullptr; + } + if (topPointStyle_ != nullptr) { + delete(topPointStyle_); + topPointStyle_ = nullptr; + } + if (bottomPointStyle_ != nullptr) { + delete(bottomPointStyle_); + bottomPointStyle_ = nullptr; + } +} + +inline UIView *ChartComponent::GetComponentRootView() const +{ + return chartView_; +} + +void ChartComponent::UpdateStrokeColorToSerial(jerry_value_t dataSet, UIChartDataSerial &dataserial) +{ + if (!strcmp(chartType_, BAR)) { + HILOG_WARN(HILOG_MODULE_ACE, "bar not support stroke color set"); + return; + } + UpdateColorToSerial(dataSet, dataserial, true); +} + +void ChartComponent::UpdateFillColorToSerial(jerry_value_t dataSet, UIChartDataSerial& dataserial) +{ + UpdateColorToSerial(dataSet, dataserial, false); +} + +void ChartComponent::UpdateStrokeSmoothToSerial(UIChartDataSerial& dataserial) +{ + dataserial.EnableSmooth(seriesOptions_->smooth); +} + +bool ChartComponent::UpdatePointToSerial(UIChartDataSerial* dataserial, PointType type) +{ + switch (type) { + case PointType::HEAD: { + if (headPointStyle_ == nullptr) { + headPointStyle_ = new UIChartDataSerial::PointStyle(); + if (headPointStyle_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "malloc headPointStyle heap error"); + return false; + } + } + headPointStyle_->fillColor = GetRGBColor(seriesOptions_->head->fillColor); + headPointStyle_->strokeColor = GetRGBColor(seriesOptions_->head->strokeColor); + headPointStyle_->strokeWidth = 1; + headPointStyle_->radius = seriesOptions_->head->size; + headPointStyle_->strokeWidth = seriesOptions_->head->strokeWidth; + dataserial->SetHeadPointStyle(*headPointStyle_); + break; + } + case PointType::TOP: { + if (topPointStyle_ == nullptr) { + topPointStyle_ = new UIChartDataSerial::PointStyle(); + if (topPointStyle_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "malloc topPointStyle heap error"); + return false; + } + } + topPointStyle_->fillColor = GetRGBColor(seriesOptions_->top->fillColor); + topPointStyle_->strokeColor = GetRGBColor(seriesOptions_->top->strokeColor); + topPointStyle_->strokeWidth = 1; + topPointStyle_->radius = seriesOptions_->top->size; + topPointStyle_->strokeWidth = seriesOptions_->top->strokeWidth; + dataserial->SetTopPointStyle(*topPointStyle_); + break; + } + case PointType::BOTTOM: { + if (bottomPointStyle_ == nullptr) { + bottomPointStyle_ = new UIChartDataSerial::PointStyle(); + if (bottomPointStyle_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "malloc bottomPointStyle heap error"); + return false; + } + } + bottomPointStyle_->fillColor = GetRGBColor(seriesOptions_->bottom->fillColor); + bottomPointStyle_->strokeColor = GetRGBColor(seriesOptions_->bottom->strokeColor); + bottomPointStyle_->strokeWidth = 1; + bottomPointStyle_->radius = seriesOptions_->bottom->size; + bottomPointStyle_->strokeWidth = seriesOptions_->bottom->strokeWidth; + dataserial->SetBottomPointStyle(*bottomPointStyle_); + break; + } + default: { + break; + } + } + return true; +} + +bool ChartComponent::UpdatePoints(UIChartDataSerial* dataserial) +{ + if (seriesOptions_->isTopSet) { + if (UpdatePointToSerial(dataserial, PointType::TOP)) { + dataserial->EnableTopPoint(true); + } else { + return false; + } + } else { + dataserial->EnableTopPoint(false); + } + if (seriesOptions_->isHeadSet) { + if (UpdatePointToSerial(dataserial, PointType::HEAD)) { + dataserial->EnableHeadPoint(true); + } else { + return false; + } + } else { + dataserial->EnableHeadPoint(false); + } + if (seriesOptions_->isBottomSet) { + if (UpdatePointToSerial(dataserial, PointType::BOTTOM)) { + dataserial->EnableBottomPoint(true); + } else { + return false; + } + } else { + dataserial->EnableBottomPoint(false); + } + return true; +} + +void ChartComponent::UpdateGradientToSerial(jerry_value_t dataSet, UIChartDataSerial* dataserial) +{ + jerry_value_t jNeedGradient = jerry_create_string(reinterpret_cast(const_cast(GRADIENT))); + jerry_value_t hasGradientProperty = jerry_has_property(dataSet, jNeedGradient); + if (hasGradientProperty) { + bool needGradient = jerry_get_boolean_value(jerry_get_property(dataSet, jNeedGradient)); + if (!strcmp(chartType_, LINE) && needGradient) { + dataserial->EnableGradient(true); + } + } + ReleaseJerryValue(hasGradientProperty, jNeedGradient, VA_ARG_END_FLAG); +} + +bool ChartComponent::UpdateValuesToSerial(jerry_value_t dataSet, UIChartDataSerial* dataserial, uint16_t dataLen) +{ + bool isSetOk = true; + jerry_value_t jData = jerry_create_string(reinterpret_cast(DATA)); + jerry_value_t hasDataProp = jerry_has_property(dataSet, jData); + if (hasDataProp) { + jerry_value_t jDataValue = jerry_get_property(dataSet, jData); + uint16_t len = 0; + if (!strcmp(chartType_, BAR)) { + len = jerry_get_array_length(jDataValue); + } else { + if ((xMaxValue_ >= (UINT16_MAX - 1)) || (dataLen < xMinValue_)) { + HILOG_WARN(HILOG_MODULE_ACE, "customMaxCount or customMinValue is set out of boundary"); + } + uint16_t customMaxCount = xMaxValue_ + 1; // the max data count speciafied by user + uint16_t actualMaxCount = dataLen - xMinValue_; // the actual max data count setted in data array + len = (customMaxCount < actualMaxCount) ? customMaxCount : actualMaxCount; + } + if (isSetOk) { + Point* pointArray = (len > 0) ? (static_cast(ace_malloc(sizeof(Point) * len))) : nullptr; + if (pointArray == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "malloc point array memory heap failed"); + isSetOk = false; + } else { + for (int i = 0; i < len; i++) { + pointArray[i] = { 0, 0 }; + } + uint16_t interval = 0; + ParseDataValue(jDataValue, interval, pointArray, len); + dataserial->AddPoints(pointArray, len); + chartView_->AddDataSerial(dataserial); + ace_free(pointArray); + pointArray = nullptr; + } + } + jerry_release_value(jDataValue); + } else { + HILOG_ERROR(HILOG_MODULE_ACE, "data not set"); + isSetOk = false; + } + ReleaseJerryValue(hasDataProp, jData, VA_ARG_END_FLAG); + // need to set after datas setted + isSetOk = isSetOk ? UpdatePoints(dataserial) : false; + return isSetOk; +} + +bool ChartComponent::AppendValuesToSerial(jerry_value_t dataSet, UIChartDataSerial* dataserial, uint16_t dataLen) +{ + if (dataserial == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "dataserial is null"); + return false; + } + bool isSetOk = true; + jerry_value_t jData = jerry_create_string(reinterpret_cast("data")); + jerry_value_t hasDataProp = jerry_has_property(dataSet, jData); + if (hasDataProp) { + jerry_value_t jDataValue = dataSet; + uint16_t interval = dataserial->GetDataCount(); + Point* pointArray = (dataLen > 0) ? (static_cast(ace_malloc(sizeof(Point) * dataLen))) : nullptr; + if (pointArray == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "malloc point array memory heap failed!"); + isSetOk = false; + } else { + for (int i = 0; i < dataLen; i++) { + pointArray[i] = { 0, 0 }; + } + ParseDataValue(jDataValue, interval, pointArray, dataLen); + AppendValues(*dataserial, pointArray, dataLen); + chartView_->RefreshChart(); + ace_free(pointArray); + pointArray = nullptr; + } + } else { + HILOG_ERROR(HILOG_MODULE_ACE, "data not set!"); + isSetOk = false; + } + ReleaseJerryValue(hasDataProp, jData, VA_ARG_END_FLAG); + return isSetOk; +} + +void ChartComponent::AppendValues(UIChartDataSerial& dataserial, Point* pointArray, uint16_t dataLen) +{ + if (!(seriesOptions_->isLoopSet)) { + dataserial.AddPoints(pointArray, dataLen); + return; + } + // the index of the latest updated point (include add or modify) + uint16_t latestIndex = dataserial.GetLatestIndex(); + // the length that will become after adding new data + uint16_t expectedDatasLen = latestIndex + dataLen + 1; + if ((dataLen == UINT16_MAX) || (UINT16_MAX - latestIndex) < (dataLen + 1)) { + HILOG_ERROR(HILOG_MODULE_ACE, "dataLen out of boundary"); + return; + } + // the amount of data already in the current data series + uint16_t existingDataLen = dataserial.GetDataCount(); + if (expectedDatasLen > (xMaxValue_ + 1)) { + if (latestIndex < existingDataLen - 1) { + // means need to modify the value between lastestIndex and existingDataLen + for (uint16_t i = 0; i < xMaxValue_ - latestIndex; i++) { + if (i >= dataLen) { + HILOG_ERROR(HILOG_MODULE_ACE, "append data error1"); + return; + } + pointArray[i].x = i + latestIndex + 1; + dataserial.ModifyPoint(i + latestIndex + 1, pointArray[i]); + dataserial.HidePoint(i + latestIndex + 1, seriesOptions_->margin); + } + } else { // means need to add new data to the series + dataserial.AddPoints(pointArray, xMaxValue_ - latestIndex); + } + // Get the data set beyond the screen, and replace the existing data in the sequence one by one + // from the beginning + for (uint16_t i = 0; i < (expectedDatasLen - (xMaxValue_ + 1)); i++) { + if (((xMaxValue_ - latestIndex) + i) >= dataLen) { + HILOG_ERROR(HILOG_MODULE_ACE, "append data error2"); + return; + } + pointArray[(xMaxValue_ - latestIndex) + i].x = i; + dataserial.ModifyPoint(i, pointArray[(xMaxValue_ - latestIndex) + i]); + dataserial.HidePoint(i + latestIndex + 1, seriesOptions_->margin); + } + } else { // after adding data, the length will not exceed the maximum value of the x axis + if (latestIndex < existingDataLen - 1) { + // means need to modify the value between lastestIndex and dataLen + for (uint16_t i = 0; i < dataLen; i++) { + pointArray[i].x = latestIndex + 1 + i; + dataserial.ModifyPoint(latestIndex + 1 + i, pointArray[i]); + dataserial.HidePoint(i + latestIndex + 1, seriesOptions_->margin); + } + } else { // means need to add new data to the series + dataserial.AddPoints(pointArray, dataLen); + } + } +} + +bool ChartComponent::ParseDataValue(jerry_value_t dataValue, uint16_t interval, Point* pointArray, uint16_t arrayLen) +{ + for (size_t index = 0; index < arrayLen; index++) { + // interval == 0 means update series, otherwise means append data to series + jerry_value_t data = (interval == 0) ? jerry_get_property_by_index(dataValue, (index + xMinValue_)) : + jerry_get_property_by_index(dataValue, index); + if (!jerry_value_is_number(data)) { + jerry_release_value(data); + HILOG_ERROR(HILOG_MODULE_ACE, "chart data is not a number"); + return false; + } + size_t dataValue = static_cast(jerry_get_number_value(data)); + pointArray[index].x = (index + interval); + if (dataValue < yMinValue_) { + HILOG_WARN(HILOG_MODULE_ACE, "the value %d is less than min value, and will use minValue instead", + dataValue); + pointArray[index].y = yMinValue_; + } else if (dataValue > yMaxValue_) { + HILOG_WARN(HILOG_MODULE_ACE, "the value %d is larger than max value, and will use maxValue instead", + dataValue); + pointArray[index].y = yMaxValue_; + } else { + pointArray[index].y = dataValue; + } + jerry_release_value(data); + } + return true; +} + +jerry_value_t ChartComponent::AppendDatas(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t *args, + const jerry_length_t argsNum) +{ + uint8_t functionParamsNum = 1; // js append function just recieve 1 number params + if (argsNum != functionParamsNum) { + HILOG_ERROR(HILOG_MODULE_ACE, "append function params error"); + } else { + if (jerry_value_is_undefined(args[0])) { + HILOG_ERROR(HILOG_MODULE_ACE, "append function params error"); + return UNDEFINED; + } + jerry_value_t jAppendDataObj = args[0]; + uint8_t serialIndex = JerryGetIntegerProperty(jAppendDataObj, APPEND_SERIAL_INDEX); + jerry_value_t jDatas = jerryx_get_property_str(jAppendDataObj, DATA); + ChartComponent* chartComponent = ChartComponent::GetChartComponent(context); + if (chartComponent != nullptr) { + DataSerials* tarSerial = const_cast(GetDataSerial(chartComponent, serialIndex)); + if (tarSerial != nullptr) { + chartComponent->AppendData(jDatas, tarSerial); + } + } + jerry_release_value(jDatas); + } + return UNDEFINED; +} + +bool ChartComponent::SetOptions(jerry_value_t options) +{ + if (!SetOptionsAxis(options, true)) { + return false; + } + if (!SetOptionsAxis(options, false)) { + return false; + } + RecordOptionsSeries(options); + return true; +} + +void ChartComponent::UpdateData(jerry_value_t dataSets, jerry_value_t keyName, uint8_t serialsCount) +{ + if (serials_ != nullptr) { + chartView_->ClearDataSerial(); + ClearAllDataSerials(); // clear all data serials + } + bool isSetOk = false; + for (uint8_t index = 0; index < serialsCount; index++) { // every data set + jerry_value_t dataSet = jerry_get_property_by_index(dataSets, index); + // check data is set correctlly, if the data is not set correctly, need not to set other attribute left + jerry_value_t dataValue = jerry_get_property(dataSet, keyName); + if ((!jerry_value_is_undefined(dataValue)) && jerry_value_is_array(dataValue)) { + uint16_t dataLen = jerry_get_array_length(dataValue); + // add to serial linked list, delete all before next update or component finish + DataSerials* dataSerialNode = new DataSerials(); + if (dataSerialNode == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "new dataSerialNode memory heap fail"); + ReleaseJerryValue(dataValue, dataSet, VA_ARG_END_FLAG); + break; + } + AddDataSerial(dataSerialNode); + // create dataserial + uint16_t dataCount = 0; + if (!strcmp(chartType_, BAR)) { + jerry_value_t jData = jerry_create_string(reinterpret_cast(DATA)); + jerry_value_t jDataValue = jerry_get_property(dataSet, jData); + dataCount = jerry_get_array_length(jDataValue); + ReleaseJerryValue(jDataValue, jData, VA_ARG_END_FLAG); + } else { + dataCount = xMaxValue_ + 1; + } + UIChartDataSerial* dataserial = new UIChartDataSerial(); + if (dataserial == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "new UIChartDataSerial memory heap fail"); + ReleaseJerryValue(dataValue, dataSet, VA_ARG_END_FLAG); + break; + } + dataserial->SetMaxDataCount(dataCount); + dataSerialNode->dataSerial = dataserial; + isSetOk = UpdataDataInOrder(dataSet, *dataserial, dataLen); + } else { + HILOG_ERROR(HILOG_MODULE_ACE, "chart data is not defined or is not array"); + } + ReleaseJerryValue(dataValue, dataSet, VA_ARG_END_FLAG); + if (!isSetOk) { + break; + } + } +} + +bool ChartComponent::UpdataDataInOrder(jerry_value_t dataSet, UIChartDataSerial& dataserial, uint16_t dataLen) +{ + UpdateStrokeColorToSerial(dataSet, dataserial); + UpdateFillColorToSerial(dataSet, dataserial); + UpdateGradientToSerial(dataSet, &dataserial); + UpdateStrokeSmoothToSerial(dataserial); + bool isSetOk = UpdateValuesToSerial(dataSet, &dataserial, dataLen); + return isSetOk; +} + +void ChartComponent::AppendData(jerry_value_t dataSet, DataSerials* dataSerialNode) +{ + if (dataSerialNode == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "data serial is null"); + return; + } + if (!strcmp(chartType_, BAR)) { + HILOG_WARN(HILOG_MODULE_ACE, "bar not support append data"); + return; + } + uint16_t dataLen = jerry_get_array_length(dataSet); + AppendValuesToSerial(dataSet, dataSerialNode->dataSerial, dataLen); +} + +void ChartComponent::UpdateColorToSerial(jerry_value_t dataSet, UIChartDataSerial& dataserial, bool isStrokeColor) +{ + bool isColorSet = false; + const char* styleName = isStrokeColor ? STROKE_COLOR : FILL_COLOR; + if (jerryx_has_property_str(dataSet, styleName)) { + isColorSet = true; + } else { + // Compatible with old versions (chart1.0) + styleName = COMMON_STYLE_BACKGROUND_COLOR; + if (jerryx_has_property_str(dataSet, styleName)) { + isColorSet = true; + } + } + uint32_t defaultColorVal = 0xFF6384; // pink + uint32_t colorVal = defaultColorVal; + if (isColorSet) { + colorVal = GetColor(dataSet, const_cast(styleName), defaultColorVal); + } + ColorType bgColor = GetRGBColor(colorVal); + if (isStrokeColor) { + dataserial.SetLineColor(bgColor); + } else { + dataserial.SetFillColor(bgColor); + } +} + +bool ChartComponent::SetOptionsAxis(jerry_value_t attrValue, bool isXAxis) +{ + bool isSetOk = false; + jerry_value_t jAxisName; + if (isXAxis) { + jAxisName = jerry_create_string(reinterpret_cast(X_AXIS)); + } else { + jAxisName = jerry_create_string(reinterpret_cast(Y_AXIS)); + } + jerry_value_t hasXAxisProp = jerry_has_property(attrValue, jAxisName); + if (!jerry_get_boolean_value(hasXAxisProp)) { + HILOG_ERROR(HILOG_MODULE_ACE, "xAxis and yAxis param must set"); + } else { + jerry_value_t axisValue = jerry_get_property(attrValue, jAxisName); + isSetOk = SetOptionsAxisDataRange(axisValue, isXAxis); + if (isSetOk) { + SetOptionsAxisTick(axisValue, isXAxis); + isSetOk = SetOptionsAxisDisplay(axisValue, isXAxis); + } + if (isSetOk) { + SetOptionsAxisColor(axisValue, isXAxis); + } + jerry_release_value(axisValue); + } + ReleaseJerryValue(jAxisName, hasXAxisProp, VA_ARG_END_FLAG); + return isSetOk; +} + +bool ChartComponent::SetOptionsAxisDataRange(jerry_value_t xAxisValue, bool isXAxis) +{ + bool isSetOk = true; + uint8_t defaultMinValue = 0; + uint8_t defaultMaxValue = 100; + jerry_value_t jMinValue = jerryx_get_property_str(xAxisValue, MIN); + jerry_value_t jMaxValue = jerryx_get_property_str(xAxisValue, MAX); + uint16_t minValue = jerry_get_number_value(jMinValue); + uint16_t maxValue = jerry_get_number_value(jMaxValue); + if (maxValue == 0) { + if (!jerryx_has_property_str(xAxisValue, "max")) { + HILOG_WARN(HILOG_MODULE_ACE, + "max value is not defined, and will use default value %d instead", defaultMaxValue); + maxValue = defaultMaxValue; + } + } + if (isXAxis) { + if (!strcmp(chartType_, BAR)) { + xAxis_->SetDataRange(0, 0); + } else { + isSetOk = SetOptionsAxisDataRange(minValue, maxValue, defaultMinValue, defaultMaxValue, true); + } + } else { + isSetOk = SetOptionsAxisDataRange(minValue, maxValue, defaultMinValue, defaultMaxValue, false); + } + ReleaseJerryValue(jMinValue, jMaxValue, VA_ARG_END_FLAG); + return isSetOk; +} + +bool ChartComponent::SetOptionsAxisDataRange(uint16_t minValue, uint16_t maxValue, uint8_t defaultMinValue, + uint8_t defaultMaxValue, bool isXaxis) +{ + bool isSetOk = true; + uint8_t supportMinValue = 0; + uint16_t supportedMaxValue = 65535; + const char * const xOrY = isXaxis ? "x" : "y"; + if ((minValue < supportMinValue) || (minValue > supportedMaxValue)) { + HILOG_WARN(HILOG_MODULE_ACE, + "%s min value: %d is not between %d ~ %d, and will use default value %d instead", + xOrY, minValue, supportMinValue, supportedMaxValue, defaultMinValue); + minValue = defaultMinValue; + } + if ((maxValue < supportMinValue) || (maxValue > supportedMaxValue)) { + HILOG_WARN(HILOG_MODULE_ACE, + "%s max value: %d is not between %d ~ %d, and will use default value %d instead", + xOrY, maxValue, supportMinValue, supportedMaxValue, defaultMaxValue); + maxValue = defaultMaxValue; + } + if (minValue <= maxValue) { + if (isXaxis) { + xAxis_->SetDataRange(0, maxValue - minValue); + xMaxValue_ = maxValue - minValue; + xMinValue_ = minValue; + } else { + yAxis_->SetDataRange(minValue, maxValue); + yMinValue_ = minValue; + yMaxValue_ = maxValue; + } + } else { + HILOG_ERROR(HILOG_MODULE_ACE, "%s min value is larger than max value", xOrY); + isSetOk = false; + } + return isSetOk; +} + +void ChartComponent::SetOptionsAxisTick(jerry_value_t xAxisValue, bool isXAxis) +{ + jerry_value_t jAxisTickValue = jerryx_get_property_str(xAxisValue, "axisTick"); + int16_t axisTickValue = jerry_get_number_value(jAxisTickValue); + const int8_t minTickValue = 1; + const int8_t maxTickValue = 20; + if ((axisTickValue < minTickValue) || (axisTickValue > maxTickValue)) { + int16_t defaultValue = 10; // default value, means total number of ticks + axisTickValue = defaultValue; + } + jerry_release_value(jAxisTickValue); + if (isXAxis) { + xAxis_->SetMarkNum(axisTickValue); + } else { + yAxis_->SetMarkNum(axisTickValue); + } +} + +bool ChartComponent::SetOptionsAxisDisplay(jerry_value_t xAxisValue, bool isXAxis) +{ + bool displayValue = false; // default value, means not show axis + jerry_value_t jDisplayValue = jerryx_get_property_str(xAxisValue, DISPLAY); + displayValue = jerry_get_boolean_value(jDisplayValue); + if (isXAxis) { + xAxis_->SetVisible(displayValue); + } else { + yAxis_->SetVisible(displayValue); + } + return true; +} + +void ChartComponent::SetOptionsAxisColor(jerry_value_t xAxisValue, bool isXAxis) +{ + const char * const styleName = COLOR; + uint32_t color = 0xc0c0c0; // default color + if (jerryx_has_property_str(xAxisValue, styleName)) { + uint16_t len = 0; + char* styleValue = JerryMallocStringProperty(xAxisValue, styleName, len); + uint8_t alpha = 0; + (void)ParseColor(styleValue, color, alpha); + ACE_FREE(styleValue); + } + ColorType axisColor = GetRGBColor(color); + if (isXAxis) { + xAxis_->SetLineColor(axisColor); + } else { + yAxis_->SetLineColor(axisColor); + } +} + +void ChartComponent::RecordOptionsSeries(jerry_value_t options) +{ + if (!jerryx_has_property_str(options, SERIES)) { + return; + } else { + jerry_value_t jSeriesVal = jerryx_get_property_str(options, SERIES); + RecordOptionsSeriesLineStyle(jSeriesVal); + RecordOptionsSeriesPoint(jSeriesVal, PointType::HEAD); + RecordOptionsSeriesPoint(jSeriesVal, PointType::TOP); + RecordOptionsSeriesPoint(jSeriesVal, PointType::BOTTOM); + RecordOptionsSeriesLoop(jSeriesVal); + jerry_release_value(jSeriesVal); + } +} + +void ChartComponent::RecordOptionsSeriesLineStyle(jerry_value_t jSeriesVal) +{ + char* styleName = const_cast(LINE_STYLE); + if (!jerryx_has_property_str(jSeriesVal, styleName)) { + return; + } else { + jerry_value_t jLineStyleVal = jerryx_get_property_str(jSeriesVal, styleName); + styleName = const_cast(WIDTH); + uint16_t widthVal = GetSizeVal(jLineStyleVal, styleName, 1); + chartView_->SetStyle(STYLE_LINE_WIDTH, widthVal); // chart width set can affect all the series + seriesOptions_->width = widthVal; + styleName = const_cast(SMOOTH); + if (jerryx_has_property_str(jLineStyleVal, styleName)) { + jerry_value_t jSmoothVal = jerryx_get_property_str(jLineStyleVal, styleName); + seriesOptions_->smooth = jerry_get_boolean_value(jSmoothVal); + jerry_release_value(jSmoothVal); + } + jerry_release_value(jLineStyleVal); + } +} + +void ChartComponent::RecordOptionsSeriesPoint(jerry_value_t jSeriesVal, PointType type) +{ + char* styleName = nullptr; + switch (type) { + case PointType::HEAD: { + styleName = const_cast(HEAD_POINT); + break; + } + case PointType::TOP: { + styleName = const_cast(TOP_POINT); + break; + } + case PointType::BOTTOM: { + styleName = const_cast(BOTTOM_POINT); + break; + } + default: { + break; + } + } + if ((styleName == nullptr) || !jerryx_has_property_str(jSeriesVal, styleName)) { + return; + } + jerry_value_t jPointStyleVal = jerryx_get_property_str(jSeriesVal, styleName); + styleName = const_cast(SIZE); + uint8_t defaultValue = 4; + uint8_t size = GetSizeVal(jPointStyleVal, styleName, defaultValue); + uint32_t defalutColorVal = 0xff0000; + styleName = const_cast(STROKE_COLOR); + uint32_t strokeColor = GetColor(jPointStyleVal, styleName, defalutColorVal); + defaultValue = 1; + styleName = const_cast(STROKE_WIDTH); + uint8_t strokeWidth = GetSizeVal(jPointStyleVal, styleName, defaultValue); + styleName = const_cast(FILL_COLOR); + uint32_t fillColor = GetColor(jPointStyleVal, styleName, defalutColorVal); + bool isDisplay = GetDisplayStatus(jPointStyleVal); + + jerry_release_value(jPointStyleVal); + switch (type) { + case PointType::HEAD: { + seriesOptions_->isHeadSet = isDisplay; + seriesOptions_->head->size = size; + seriesOptions_->head->strokeColor = strokeColor; + seriesOptions_->head->fillColor = fillColor; + seriesOptions_->head->strokeWidth = strokeWidth; + break; + } + case PointType::TOP: { + seriesOptions_->isTopSet = isDisplay; + seriesOptions_->top->size = size; + seriesOptions_->top->strokeColor = strokeColor; + seriesOptions_->top->fillColor = fillColor; + seriesOptions_->top->strokeWidth = strokeWidth; + break; + } + case PointType::BOTTOM: { + seriesOptions_->isBottomSet = isDisplay; + seriesOptions_->bottom->size = size; + seriesOptions_->bottom->strokeColor = strokeColor; + seriesOptions_->bottom->fillColor = fillColor; + seriesOptions_->bottom->strokeWidth = strokeWidth; + break; + } + default: { + break; + } + } +} + +void ChartComponent::RecordOptionsSeriesLoop(jerry_value_t jSeriesVal) +{ + char* styleName = const_cast(LOOP); + if (!jerryx_has_property_str(jSeriesVal, styleName)) { + return; + } + + jerry_value_t jLoopStyleVal = jerryx_get_property_str(jSeriesVal, styleName); + seriesOptions_->isLoopSet = GetDisplayStatus(jLoopStyleVal); + + styleName = const_cast(MARGIN); + if (!jerryx_has_property_str(jLoopStyleVal, styleName)) { + seriesOptions_->margin = 1; + } else { + int16_t marginVal = JerryGetIntegerProperty(jLoopStyleVal, styleName); + seriesOptions_->margin = marginVal; + } + jerry_release_value(jLoopStyleVal); +} + +inline void ChartComponent::Reset() +{ + totalSerialsNum_ = 0; +} + +void ChartComponent::AddDataSerial(DataSerials *serial) +{ + if (serial == nullptr) { + return; + } + if (serials_) { + serial->next = serials_; + totalSerialsNum_++; + } else { + totalSerialsNum_ = 1; + } + serials_ = serial; +} + +ChartComponent* ChartComponent::GetChartComponent(jerry_value_t nativeElement) +{ + ChartComponent* chartComponent = + reinterpret_cast(ComponentUtils::GetComponentFromBindingObject(nativeElement)); + if (chartComponent == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "get binded component fail"); + } + return chartComponent; +} + +const DataSerials* ChartComponent::GetDataSerial(ChartComponent* chartComponent, uint8_t index) +{ + if (chartComponent == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "chartComponent is null"); + return nullptr; + } + uint8_t targetSerial = index + 1; + if (targetSerial > chartComponent->totalSerialsNum_) { + HILOG_ERROR(HILOG_MODULE_ACE, "data serial index should not larger than total serials num - 1"); + return nullptr; + } + targetSerial = chartComponent->totalSerialsNum_ - targetSerial + 1; // serials_ is added reversed before + DataSerials* serial = chartComponent->serials_; + while (targetSerial > 1) { + serial = serial->next; + targetSerial--; + } + return serial; +} + +void ChartComponent::ClearDataSerialsNode(DataSerials* serial) +{ + if (serial == nullptr) { + return; + } else { + if (serial->next) { + ClearDataSerialsNode(serial->next); + } + if (serial->dataSerial) { + delete (serial->dataSerial); + serial->dataSerial = nullptr; + } + delete (serial); + serial = nullptr; + } +} + +void ChartComponent::ClearAllDataSerials() +{ + ClearDataSerialsNode(serials_); + serials_ = nullptr; +} + +uint16_t ChartComponent::GetSizeVal(jerry_value_t obj, const char * const styleName, uint16_t defaultValue) +{ + if (jerryx_has_property_str(obj, styleName)) { + uint16_t len = 0; + char* sizeVal = JerryMallocStringProperty(obj, styleName, len); + if (sizeVal == nullptr) { + HILOG_WARN(HILOG_MODULE_ACE, "Get Style String value failed, return default value!"); + return defaultValue; + } + uint16_t size = strtol(sizeVal, nullptr, DEC); + ace_free(sizeVal); + sizeVal = nullptr; + return size; + } + return defaultValue; +} + +uint32_t ChartComponent::GetColor(jerry_value_t obj, const char * const styleName, uint32_t defaultValue) +{ + uint8_t alpha = 0; + uint32_t color = defaultValue; + uint16_t len = 0; + char* styleValue = JerryMallocStringProperty(obj, styleName, len); + if (!ParseColor(styleValue, color, alpha)) { + HILOG_WARN(HILOG_MODULE_ACE, "color format error"); + } + ACE_FREE(styleValue); + return color; +} + +bool ChartComponent::GetDisplayStatus(jerry_value_t obj) +{ + if (!jerryx_has_property_str(obj, DISPLAY)) { + return true; + } else { + jerry_value_t jDisplayValue = jerryx_get_property_str(obj, DISPLAY); + return jerry_get_boolean_value(jDisplayValue); + } +} + +bool ChartComponent::Init() +{ + seriesOptions_ = new SeriesOptions(); + if (seriesOptions_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "malloc seriesOptions heap error"); + return false; + } + seriesOptions_->head = new PointOptions(); + if (seriesOptions_->head == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "malloc PointOptions head heap error"); + return false; + } + seriesOptions_->top = new PointOptions(); + if (seriesOptions_->top == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "malloc PointOptions top heap error"); + return false; + } + seriesOptions_->bottom = new PointOptions(); + if (seriesOptions_->bottom == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "malloc PointOptions bottom heap error"); + return false; + } + + xAxis_ = &(chartView_->GetXAxis()); + yAxis_ = &(chartView_->GetYAxis()); + if ((xAxis_ == nullptr) || (yAxis_ == nullptr)) { + HILOG_ERROR(HILOG_MODULE_ACE, "get axis error"); + return false; + } + const int8_t originPosition = 0; + chartView_->SetPosition(originPosition, originPosition); + chartView_->SetStyle(StyleDefault::GetBrightStyle()); + chartView_->SetStyle(STYLE_BACKGROUND_OPA, 0); + chartView_->SetStyle(STYLE_BORDER_OPA, 0); + chartView_->SetStyle(STYLE_BORDER_WIDTH, 0); + chartView_->SetStyle(STYLE_PADDING_LEFT, 0); + RegisterNamedFunction(FUNC_JS_API, AppendDatas); + return true; +} +} // namespace ACELite +} // namespace OHOS diff --git a/src/core/components/chart_component.h b/src/core/components/chart_component.h new file mode 100755 index 0000000..1713656 --- /dev/null +++ b/src/core/components/chart_component.h @@ -0,0 +1,172 @@ +/* + * Copyright (c) 2020 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. + */ + +#ifndef OHOS_ACELITE_CHART_COMPONENT_H +#define OHOS_ACELITE_CHART_COMPONENT_H + +#include "component.h" +#include "non_copyable.h" +#include "ui_chart.h" +#include "ui_label.h" + +namespace OHOS { +namespace ACELite { +struct DataSerials : public MemoryHeap { + UIChartDataSerial *dataSerial; + DataSerials *next; + ACE_DISALLOW_COPY_AND_MOVE(DataSerials); + DataSerials() : dataSerial(nullptr), next(nullptr) {} +}; + +enum class PointType { HEAD, TOP, BOTTOM }; + +struct PointOptions : public MemoryHeap { + uint8_t size; + uint8_t strokeWidth; + uint32_t strokeColor; + uint32_t fillColor; + ACE_DISALLOW_COPY_AND_MOVE(PointOptions); + PointOptions() : size(POINT_SIZE), strokeWidth(1), strokeColor(0xFF0000), fillColor(0xFF0000) {} +}; + +struct SeriesOptions : public MemoryHeap { + uint8_t width; + uint8_t margin; + PointOptions *head; + PointOptions *top; + PointOptions *bottom; + bool smooth; + bool isHeadSet; + bool isTopSet; + bool isBottomSet; + bool isLoopSet; + ACE_DISALLOW_COPY_AND_MOVE(SeriesOptions); + SeriesOptions() : width(1), margin(1), head(nullptr), top(nullptr), bottom(nullptr), smooth(false), + isHeadSet(false), isTopSet(false), isBottomSet(false), isLoopSet(false){}; +}; + +class ChartComponent final : public Component { +public: + ACE_DISALLOW_COPY_AND_MOVE(ChartComponent); + ChartComponent() = delete; + ChartComponent(jerry_value_t options, jerry_value_t children, AppStyleManager *styleManager); + ~ChartComponent() {} + virtual bool CreateNativeViews() override; + virtual bool SetPrivateAttribute(uint16_t attrKeyId, jerry_value_t attrValue) override; + virtual void PostUpdate(uint16_t attrKeyId, bool updateResult) override; + virtual void PostRender() override; + virtual void ReleaseNativeViews() override; + +protected: + virtual UIView *GetComponentRootView() const override; + +private: + bool Init(); + void UpdateData(jerry_value_t dataSets, jerry_value_t keyName, uint8_t serialsCount); + bool UpdataDataInOrder(jerry_value_t dataSet, UIChartDataSerial &dataserial, uint16_t dataLen); + void AppendData(jerry_value_t dataSet, DataSerials *dataSerialNode); + void UpdateColorToSerial(jerry_value_t dataSet, UIChartDataSerial &dataserial, bool isStrokeColor); + void UpdateStrokeColorToSerial(jerry_value_t dataSet, UIChartDataSerial &dataserial); + void UpdateFillColorToSerial(jerry_value_t dataSet, UIChartDataSerial &dataserial); + void UpdateStrokeSmoothToSerial(UIChartDataSerial &dataserial); + bool UpdatePointToSerial(UIChartDataSerial *dataserial, PointType type); + bool UpdatePoints(UIChartDataSerial *dataserial); + void UpdateGradientToSerial(jerry_value_t dataSet, UIChartDataSerial *dataserial); + bool UpdateValuesToSerial(jerry_value_t dataSet, UIChartDataSerial *dataserial, uint16_t dataLen); + bool AppendValuesToSerial(jerry_value_t dataSet, UIChartDataSerial *dataserial, uint16_t dataLen); + void AppendValues(UIChartDataSerial &dataserial, Point *pointArray, uint16_t dataLen); + bool ParseDataValue(jerry_value_t dataValue, uint16_t interval, Point *pointArray, uint16_t arrayLen); + bool SetOptions(jerry_value_t options); + bool SetOptionsAxis(jerry_value_t options, bool isXAxis); + bool SetOptionsAxisDataRange(jerry_value_t options, bool isXAxis); + bool SetOptionsAxisDataRange(uint16_t minValue, uint16_t maxValue, uint8_t defaultMinValue, + uint8_t defaultMaxValue, bool isXaxis); + void SetOptionsAxisTick(jerry_value_t options, bool isXAxis); + bool SetOptionsAxisDisplay(jerry_value_t options, bool isXAxis); + void SetOptionsAxisColor(jerry_value_t options, bool isXAxis); + /** + * @brief record series options in seriesOptions_ + * + * @param [in] options. + */ + void RecordOptionsSeries(jerry_value_t options); + void RecordOptionsSeriesLineStyle(jerry_value_t jSeriesVal); + void RecordOptionsSeriesPoint(jerry_value_t jSeriesVal, PointType type); + void RecordOptionsSeriesLoop(jerry_value_t jSeriesVal); + void Reset(); + /** + * @brief record DataSerials into linked list + * + * @param [in] serial. + */ + void AddDataSerial(DataSerials *serial); + void ClearDataSerialsNode(DataSerials *serial); + void ClearAllDataSerials(); + uint16_t GetSizeVal(jerry_value_t obj, const char * const styleName, uint16_t defaultValue); + uint32_t GetColor(jerry_value_t obj, const char * const styleName, uint32_t defaultValue); + bool GetDisplayStatus(jerry_value_t obj); + static jerry_value_t AppendDatas(const jerry_value_t func, const jerry_value_t context, + const jerry_value_t *args, const jerry_length_t argsNum); + static ChartComponent *GetChartComponent(jerry_value_t nativeElement); + static const DataSerials *GetDataSerial(ChartComponent *chartComponent, uint8_t index); + + UIXAxis *xAxis_; + UIYAxis *yAxis_; + size_t yMinValue_; + size_t yMaxValue_; + uint16_t xMinValue_; + uint16_t xMaxValue_; + jerry_value_t options_; + UIChart *chartView_; + DataSerials *serials_; + uint8_t totalSerialsNum_; + jerry_value_t dataSetsRecord_; + SeriesOptions *seriesOptions_; + char *chartType_; + UIChartDataSerial::PointStyle *headPointStyle_; + UIChartDataSerial::PointStyle *topPointStyle_; + UIChartDataSerial::PointStyle *bottomPointStyle_; + static const char * const DATA; + static const char * const APPEND_SERIAL_INDEX; + static const char * const LINE; + static const char * const BAR; + static const char * const FUNC_JS_API; + static const char * const STROKE_COLOR; + static const char * const STROKE_WIDTH; + static const char * const FILL_COLOR; + static const char * const GRADIENT; + static const char * const LINE_STYLE; + static const char * const SMOOTH; + static const char * const HEAD_POINT; + static const char * const SHAPE; + static const char * const SIZE; + static const char * const TOP_POINT; + static const char * const BOTTOM_POINT; + static const char * const X_AXIS; + static const char * const Y_AXIS; + static const char * const MIN; + static const char * const MAX; + static const char * const TYPE; + static const char * const SERIES; + static const char * const COLOR; + static const char * const WIDTH; + static const char * const LOOP; + static const char * const MARGIN; + static const char * const DISPLAY; +}; +} // namespace ACELite +} // namespace OHOS + +#endif // !OHOS_ACELITE_CHART_COMPONENT_H diff --git a/src/core/components/clock_hand_component.cpp b/src/core/components/clock_hand_component.cpp new file mode 100755 index 0000000..d40cabe --- /dev/null +++ b/src/core/components/clock_hand_component.cpp @@ -0,0 +1,258 @@ +/* + * Copyright (c) 2020 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. + */ + +#include "acelite_config.h" + +#ifdef FEATURE_COMPONENT_ANALOG_CLOCK + +#include "ace_log.h" +#include "ace_mem_base.h" +#include "clock_hand_component.h" +#include "js_app_context.h" +#include "key_parser.h" +#include "keys.h" +#include "ui_image_view.h" + +namespace OHOS { +namespace ACELite { +ClockHandComponent::ClockHandComponent(jerry_value_t options, jerry_value_t children, AppStyleManager *styleManager) + : Component(options, children, styleManager), + options_(options), + layoutType_(LayoutType::RECT), + clockHandView_(nullptr), + pivotX_(0), + pivotY_(0), + fillColor_(0), + opacity_(OPA_MAX), + handType_(nullptr) +{ + SetComponentName(K_CLOCK_HAND); + combinedStyle_ = styleManager->GetCombinedStyle(); +} + +bool ClockHandComponent::CreateNativeViews() +{ + // Get clock hand layout type + layoutType_ = GetLayoutType(); + if (layoutType_ == LayoutType::RECT) { + clockHandView_ = new UIView(); + } else { + clockHandView_ = new UIImageView(); + } + + if (clockHandView_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "ClockHandComponent: create native view failed!"); + return false; + } + return true; +} + +void ClockHandComponent::ReleaseNativeViews() +{ + if (clockHandView_) { + delete clockHandView_; + clockHandView_ = nullptr; + } + + if (handType_) { + ace_free(handType_); + handType_ = nullptr; + } +} + +inline UIView *ClockHandComponent::GetComponentRootView() const +{ + return clockHandView_; +} + +void ClockHandComponent::PostRender() +{ + const char * const stylePivotX = "pivot-x"; + const char * const stylePivotY = "pivot-y"; + if ((combinedStyle_ == nullptr) || (clockHandView_ == nullptr)) { + HILOG_ERROR(HILOG_MODULE_ACE, "ClockHandComponent: post render failed!"); + return; + } + + // Verify hand type + if ((handType_ == nullptr)) { + HILOG_ERROR(HILOG_MODULE_ACE, "ClockHandComponent: hand type invalid!"); + return; + } + + // Set params to current js object + jerry_value_t pivotXValue = jerry_create_number(pivotX_); + jerry_value_t pivotYValue = jerry_create_number(pivotY_); + uint16_t typeId = KeyParser::ParseKeyId(handType_, strlen(handType_)); + jerry_value_t typeIdValue = jerry_create_number(typeId); + + jerry_value_t nativeObj = GetNativeElement(); + if (jerry_value_is_undefined(nativeObj)) { + return; + } + SetNamedProperty(nativeObj, stylePivotX, pivotXValue); + SetNamedProperty(nativeObj, stylePivotY, pivotYValue); + SetNamedProperty(nativeObj, ATTR_TYPE, typeIdValue); + + jerry_value_t isImage; + if (layoutType_ == LayoutType::RECT) { + isImage = jerry_create_boolean(false); + jerry_value_t fillColorValue = jerry_create_number(fillColor_); + SetNamedProperty(nativeObj, COMMON_STYLE_COLOR, fillColorValue); + jerry_value_t opacityValue = jerry_create_number(opacity_); + SetNamedProperty(nativeObj, COMMON_STYLE_OPACITY, opacityValue); + } else { + isImage = jerry_create_boolean(true); + } + SetNamedProperty(nativeObj, CLOCK_HAND_IS_IMAGE, isImage); +} + +bool ClockHandComponent::ApplyPrivateStyle(const AppStyleItem *style) +{ + if ((combinedStyle_ == nullptr) || (clockHandView_ == nullptr)) { + HILOG_ERROR(HILOG_MODULE_ACE, "ClockHandComponent: apply private style failed!"); + return false; + } + + uint16_t styleNameId = GetStylePropNameId(style); + if (!KeyParser::IsKeyValid(styleNameId)) { + HILOG_ERROR(HILOG_MODULE_ACE, "ClockHandComponent: id invalid when apply private style!"); + return false; + } + + switch (styleNameId) { + case K_PIVOT_X: + pivotX_ = GetStyleNumValue(style); + break; + case K_PIVOT_Y: + pivotY_ = GetStyleNumValue(style); + break; + case K_COLOR: + fillColor_ = GetStyleNumValue(style); + break; + case K_OPACITY: + opacity_ = GetStyleNumValue(style); + break; + default: + HILOG_DEBUG(HILOG_MODULE_ACE, "ClockHandComponent: style invalid when apply private style!"); + return false; + } + return true; +} + +bool ClockHandComponent::SetPrivateAttribute(uint16_t attrKeyId, jerry_value_t attrValue) +{ + if ((clockHandView_ == nullptr) || !KeyParser::IsKeyValid(attrKeyId) || IS_UNDEFINED(attrValue)) { + HILOG_ERROR(HILOG_MODULE_ACE, "ClockHandComponent: set private attribute failed!"); + return false; + } + + bool setResult = true; + switch (attrKeyId) { + case K_SRC: { + uint16_t length = 0; + char *attrValueStr = MallocStringOf(attrValue, &length); + if (attrValueStr == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "ClockHandComponent: image path invalid!"); + setResult = false; + break; + } + + if (length != 0) { + UIImageView *image = reinterpret_cast(clockHandView_); + if (image == nullptr) { + ace_free(attrValueStr); + attrValueStr = nullptr; + HILOG_ERROR(HILOG_MODULE_ACE, "ClockHandComponent: reinterpret_cast UIImageView failed!"); + setResult = false; + break; + } + + const char * const rootPath = JsAppContext::GetInstance()->GetCurrentAbilityPath(); + char *imagePath = RelocateResourceFilePath(rootPath, attrValueStr); + if (imagePath != nullptr) { + image->SetSrc(imagePath); + ace_free(imagePath); + imagePath = nullptr; + } + } + + ace_free(attrValueStr); + attrValueStr = nullptr; + break; + } + case K_TYPE: + ACE_FREE(handType_); + handType_ = MallocStringOf(attrValue); + break; + default: + setResult = false; + break; + } + return setResult; +} + +void ClockHandComponent::SetNamedProperty(jerry_value_t obj, const char * const name, jerry_value_t value) +{ + jerry_value_t propName = jerry_create_string((const jerry_char_t *)name); + jerry_release_value(jerry_set_property(obj, propName, value)); + jerry_release_value(propName); + jerry_release_value(value); +} + +char *ClockHandComponent::GetStringAttrByName(const char * const name) +{ + if (jerry_value_is_undefined(options_)) { + HILOG_ERROR(HILOG_MODULE_ACE, "ClockHandComponent: options undefined!"); + return nullptr; + } + + char *strValue = nullptr; + jerry_value_t attrsPropName = jerry_create_string(reinterpret_cast(ATTR_ATTRS)); + jerry_value_t attrsPropValue = jerry_get_property(options_, attrsPropName); + if (!jerry_value_is_undefined(attrsPropValue)) { + jerry_value_t attrPropName = jerry_create_string(reinterpret_cast(name)); + jerry_value_t attrPropValue = jerry_get_property(attrsPropValue, attrPropName); + if (jerry_value_is_string(attrPropValue)) { + strValue = MallocStringOf(attrPropValue); + } else { + HILOG_INFO(HILOG_MODULE_ACE, "ClockHandComponent: attribute: %s does not exits", name); + } + jerry_release_value(attrPropValue); + jerry_release_value(attrPropName); + } else { + HILOG_INFO(HILOG_MODULE_ACE, "ClockHandComponent: attrs undefined"); + } + jerry_release_value(attrsPropValue); + jerry_release_value(attrsPropName); + + return strValue; +} + +ClockHandComponent::LayoutType ClockHandComponent::GetLayoutType() +{ + LayoutType type = LayoutType::RECT; + char *handSrc = GetStringAttrByName(ATTR_SRC); + if (handSrc != nullptr) { + type = LayoutType::IMAGE; + ace_free(handSrc); + handSrc = nullptr; + } + return type; +} +} // namespace ACELite +} // namespace OHOS + +#endif // FEATURE_COMPONENT_ANALOG_CLOCK diff --git a/src/core/components/clock_hand_component.h b/src/core/components/clock_hand_component.h new file mode 100755 index 0000000..2af26c3 --- /dev/null +++ b/src/core/components/clock_hand_component.h @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2020 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. + */ + +#ifndef OHOS_ACELITE_CLOCK_HAND_COMPONENT_H +#define OHOS_ACELITE_CLOCK_HAND_COMPONENT_H + +#include "acelite_config.h" + +#ifdef FEATURE_COMPONENT_ANALOG_CLOCK + +#include "component.h" +#include "non_copyable.h" +#include "stylemgr/app_style.h" + +namespace OHOS { +namespace ACELite { +class ClockHandComponent final : public Component { +public: + ACE_DISALLOW_COPY_AND_MOVE(ClockHandComponent); + ClockHandComponent() = delete; + ClockHandComponent(jerry_value_t options, jerry_value_t children, AppStyleManager* styleManager); + ~ClockHandComponent() {} + +protected: + bool CreateNativeViews() override; + void ReleaseNativeViews() override; + UIView *GetComponentRootView() const override; + bool SetPrivateAttribute(uint16_t attrKeyId, jerry_value_t attrValue) override; + bool ApplyPrivateStyle(const AppStyleItem* style) override; + void PostRender() override; + + /** + * @enum LayoutType + * + * @brief Values that represent different clock-hand layout types + */ + enum class LayoutType { + // UIImageView layout + IMAGE, + // Rectangle layout + RECT + }; + +private: + char* GetStringAttrByName(const char * const name); + void SetNamedProperty(jerry_value_t obj, const char * const name, jerry_value_t value); + LayoutType GetLayoutType(); + + jerry_value_t options_; + const AppStyle* combinedStyle_; + LayoutType layoutType_; + UIView* clockHandView_; + int16_t pivotX_; + int16_t pivotY_; + int32_t fillColor_; + uint16_t opacity_; + char* handType_; +}; +} // namespace ACELite +} // namespace OHOS +#endif // FEATURE_COMPONENT_ANALOG_CLOCK +#endif // OHOS_ACELITE_CLOCK_HAND_COMPONENT_H diff --git a/src/core/components/component.cpp b/src/core/components/component.cpp new file mode 100755 index 0000000..590f4d4 --- /dev/null +++ b/src/core/components/component.cpp @@ -0,0 +1,1554 @@ +/* + * Copyright (c) 2020 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. + */ +#include "component.h" +#include "ace_log.h" +#include "ace_mem_base.h" +#include "directive/descriptor_utils.h" +#include "fatal_handler.h" +#include "handler.h" +#include "js_ability_impl.h" +#include "js_app_context.h" +#include "js_app_environment.h" +#include "js_profiler.h" +#include "js_router.h" +#include "key_parser.h" +#include "keys.h" +#include "stylemgr/app_style.h" +#include "stylemgr/app_style_manager.h" +#include "time_util.h" +#include "wrapper/js.h" +#if ENABLED(SECURE_C_FUNCTION) +#include "securec.h" +#endif // ENABLED(SECURE_C_FUNCTION) + +namespace OHOS { +namespace ACELite { +static Component::AnimationsNode *g_animationListHead = nullptr; +static bool g_isAnimatorStarted = false; +void Component::HandlerAnimations() +{ + Component::AnimationsNode *point = g_animationListHead; + while (point != nullptr) { + point->transitionImpl->Start(); + point = point->next; + } + g_isAnimatorStarted = true; +} + +void Component::ReleaseAnimations() +{ + Component::AnimationsNode *point = g_animationListHead; + while (point != nullptr) { + Component::AnimationsNode *temp = point->next; + if (point->transitionImpl) { + delete (point->transitionImpl); + } + delete (point); + point = temp; + } + g_animationListHead = nullptr; + g_isAnimatorStarted = false; +} + +Component::Component(jerry_value_t options, jerry_value_t children, AppStyleManager *styleManager) + : styleManager_(styleManager), + options_(options), + children_(UNDEFINED), + onClickListener_(nullptr), + onLongPressListener_(nullptr), + onSwipeListener_(nullptr), +#ifdef JS_TOUCH_EVENT_SUPPORT + onTouchStartListener_(nullptr), + onTouchMoveListener_(nullptr), + onTouchCancelListener_(nullptr), + onTouchEndListener_(nullptr), + keyBoardEventListener_(nullptr), +#endif + viewId_(nullptr), + componentName_(K_UNKNOWN), + rendered_(false), + isAnimationKeyFramesSet_(false), + curTransitionImpl_(nullptr), + trans_(nullptr), + descriptors_(jerry_acquire_value(children)), + watchersHead_(nullptr), + height_(-1), + width_(-1) +{ + // create native element object before combining styles, as style data binding need it + nativeElement_ = jerry_create_object(); + jerry_value_t global = jerry_get_global_object(); + viewModel_ = jerryx_get_property_str(global, ATTR_ROOT); + jerry_release_value(global); + if (styleManager_) { + // combine app style for this component by app style list. + // style apply priority: inline(static style) > #id > .class + START_TRACING_WITH_COMPONENT_NAME(RENDER_COMBINE_STYLE, componentName_); + styleManager_->CombineStylesForCurrentTag(options_, *this); + STOP_TRACING(); + } +} + +/** + * @brief After construct a specific component, call this function to setup this component's native view + * and process attribute/events/style/children properly before binding it on an JS object. + * It generally calls a series of functions to complete the render work, some of which are needed to be + * implemented by child class. See step1~step6 function notes. + * + * NOTE: Caller should check the return result to decide if it's needed to recycle the component if the + * rendering failed. + * + * @return true if success, false if any error occurs + */ +bool Component::Render() +{ + if (rendered_) { + HILOG_ERROR(HILOG_MODULE_ACE, "Render one component twice is not allowed."); + return false; + } + + PreRender(); + bool renderResult = false; + // step1: create native view/views + START_TRACING_WITH_COMPONENT_NAME(RENDER_CREATE_COMPONENT, componentName_); + renderResult = CreateNativeViews(); + if (!renderResult) { + return false; + } + STOP_TRACING(); + + // step2: binding js object with this component + jerry_set_object_native_pointer(nativeElement_, this, nullptr); + + // step3: parse options for attributes and events, will call child class's according methods + ParseOptions(); + // step4: apply styles + START_TRACING_WITH_COMPONENT_NAME(RENDER_APPLY_STYLE, componentName_); + ApplyStyles(); + STOP_TRACING(); + + // step5:process this component's children + START_TRACING_WITH_COMPONENT_NAME(RENDER_PROCESS_CHILDREN, componentName_); + renderResult = ProcessChildren(); + STOP_TRACING(); + if (!renderResult) { + return false; + } else { + RecordAnimation(); + } + PostRender(); + rendered_ = true; + + return renderResult; +} + +void Component::Release() +{ + // detach self from fatal handler monitoring + FatalHandler::GetInstance().DetachComponentNode(this); + // stop view animation + if (curTransitionImpl_) { + curTransitionImpl_->Stop(); + } + // release all native views + ReleaseNativeViews(); + // release transition param + ReleaseTransitionParam(); + // release the common event listeners if any + ReleaseCommonEventListeners(); + // release children = jerry_create_array() in Init() + ClearWatchersCommon(watchersHead_); + // free viewId string if it's set + ACE_FREE(viewId_); + // release js object + jerry_release_value(nativeElement_); + jerry_release_value(descriptors_); + jerry_release_value(children_); + jerry_release_value(viewModel_); +} + +bool Component::UpdateView(uint16_t attrKeyId, jerry_value_t attrValue) +{ + if (!KeyParser::IsKeyValid(attrKeyId)) { + return false; + } + + START_TRACING_WITH_EXTRA_INFO(SET_ATTR_SET_TO_NATIVE, componentName_, attrKeyId); + PreUpdate(); + + bool updateResult = SetAttribute(attrKeyId, attrValue); + if (!updateResult) { + AppStyleItem *styleItem = AppStyleItem::CreateStyleItem(attrKeyId, attrValue); + if (styleItem != nullptr) { + updateResult = ApplyStyle(styleItem); + delete styleItem; + styleItem = nullptr; + } + } + + RefreshRect(); + ReLayoutChildrenIfNeeded(attrKeyId); + + PostUpdate(attrKeyId, updateResult); + StartAnimation(); + STOP_TRACING(); + + return updateResult; +} +void Component::RegisterNamedFunction(const char * const name, jerry_external_handler_t handler) const +{ + JerrySetFuncProperty(nativeElement_, name, handler); +} +// default implementation +bool Component::SetAttribute(uint16_t attrKeyId, jerry_value_t attrValue) +{ + UIView *uiView = GetComponentRootView(); + if ((uiView == nullptr) || !KeyParser::IsKeyValid(attrKeyId) || IS_UNDEFINED(attrValue)) { + return false; + } + + // try private first + bool setResult = SetPrivateAttribute(attrKeyId, attrValue); + if (!setResult) { + // this means no private attributes matches, so need to try private ones + setResult = SetCommonAttribute(*uiView, attrKeyId, attrValue); + } + + return setResult; +} + +bool Component::SetCommonAttribute(UIView &view, const uint16_t attrKeyId, const jerry_value_t attrValue) +{ + switch (attrKeyId) { + case K_ID: { + // this string in component itself. + ACE_FREE(viewId_); + viewId_ = MallocStringOf(attrValue); + if (viewId_ == nullptr) { + return false; + } + view.SetViewId(viewId_); + break; + } + case K_SHOW: { + view.SetVisible(BoolOf(attrValue)); + break; + } + case K_REF: { + uint16_t length = 0; + char *refName = MallocStringOf(attrValue, &length); + if (refName == nullptr) { + break; + } + if (length != 0) { + jerry_value_t refs = jerryx_get_property_str(viewModel_, ATTR_REFS); + if (jerry_value_is_undefined(refs)) { + jerry_release_value(refs); + refs = jerry_create_object(); + jerryx_set_property_str(viewModel_, ATTR_REFS, refs); + } + jerryx_set_property_str(refs, refName, nativeElement_); + jerry_release_value(refs); + } + ace_free(refName); + refName = nullptr; + break; + } + default: { + // this is not error case, just no one get matched + return false; + } + } + + return true; +} + +void Component::ApplyStyles() +{ + const AppStyle *combinedStyle = GetStyleManager()->GetCombinedStyle(); + if (combinedStyle != nullptr) { + const AppStyleItem *style = combinedStyle->GetFirst(); + while (style != nullptr) { + START_TRACING_WITH_EXTRA_INFO(APPLY_STYLE_ITEM, componentName_, GetStylePropNameId(style)); + // call children's apply method + ApplyStyle(style); + STOP_TRACING(); + style = style->GetNext(); + } + } + RefreshRect(); +} + +bool Component::RefreshRect() const +{ + UIView *uiView = GetComponentRootView(); + if (uiView == nullptr) { + return false; + } + // set view height and width + uint8_t borderNum = 2; + if (height_ >= 0) { + if ((uiView->GetStyle(STYLE_BORDER_WIDTH) < 0) || (uiView->GetStyle(STYLE_PADDING_TOP) < 0) || + (uiView->GetStyle(STYLE_PADDING_BOTTOM) < 0)) { + HILOG_WARN(HILOG_MODULE_ACE, "border and padding size should not less than 0"); + } + int16_t contentHeight = height_ - (uiView->GetStyle(STYLE_BORDER_WIDTH) * borderNum) - + uiView->GetStyle(STYLE_PADDING_TOP) - uiView->GetStyle(STYLE_PADDING_BOTTOM); + if (contentHeight <= 0) { + HILOG_WARN(HILOG_MODULE_ACE, + "component height can not include padding and border width, padding and border will be set 0"); + uiView->SetStyle(STYLE_BORDER_WIDTH, 0); + uiView->SetStyle(STYLE_PADDING_TOP, 0); + uiView->SetStyle(STYLE_PADDING_BOTTOM, 0); + uiView->SetHeight(height_); + } else { + uiView->SetHeight(contentHeight); + } + } + if (width_ >= 0) { + if ((uiView->GetStyle(STYLE_BORDER_WIDTH) < 0) || (uiView->GetStyle(STYLE_PADDING_LEFT) < 0) || + (uiView->GetStyle(STYLE_PADDING_RIGHT) < 0)) { + HILOG_WARN(HILOG_MODULE_ACE, "border and padding size should not less than 0"); + } + int16_t contentWidth = width_ - (uiView->GetStyle(STYLE_BORDER_WIDTH) * borderNum) - + uiView->GetStyle(STYLE_PADDING_LEFT) - uiView->GetStyle(STYLE_PADDING_RIGHT); + if (contentWidth <= 0) { + HILOG_WARN(HILOG_MODULE_ACE, + "component width can not include padding and border width, padding and border will be set 0"); + uiView->SetStyle(STYLE_BORDER_WIDTH, 0); + uiView->SetStyle(STYLE_PADDING_LEFT, 0); + uiView->SetStyle(STYLE_PADDING_RIGHT, 0); + uiView->SetWidth(width_); + } else { + uiView->SetWidth(contentWidth); + } + } + return true; +} + +bool Component::ApplyStyle(const AppStyleItem *style) +{ + UIView *uiView = GetComponentRootView(); + if (uiView == nullptr) { + return false; + } + + // Try private styles first + bool applyResult = ApplyPrivateStyle(style); + if (applyResult) { + // one private style get matched, no need to try private style ones + return true; + } + applyResult = ApplyCommonStyle(*uiView, style); + return applyResult; +} + +/* + * support common style items: + * [left|top]: number # flex layout not work + * 'width': number, + * 'height': number, + * 'margin': number, # flex layout work + * 'border-width': number, + * 'border-color':number, + * 'border-radius': number, + * 'background-color': number, + * 'opacity': number, + * 'visibility': bool, + * + * not suport common style item: + * border-[left|top|right|bottom]-width, + * border-[left|top|right|bottom]-color, + * border-[top|bottom]-[left|right]-radius, + * border-style, + * padding:number, + * right|bottom + */ +bool Component::ApplyCommonStyle(UIView &view, const AppStyleItem *style) +{ + uint16_t styleNameId = GetStylePropNameId(style); + if (!KeyParser::IsKeyValid(styleNameId)) { + return false; + } + + // we do not support pseudo class for all styles, child must handle itself + if (style->IsPseudoClassItem()) { + return false; + } + + switch (styleNameId) { + case K_HEIGHT: { + SetHeight(style); + break; + } + case K_WIDTH: { + SetWidth(style); + break; + } + case K_DISPLAY: { + SetVisible(view, style); + break; + } + case K_MARGIN: { + SetMargin(view, *style); + break; + } + case K_MARGIN_BOTTOM: { + SetBottomMargin(view, *style); + break; + } + case K_MARGIN_LEFT: { + SetLeftMargin(view, *style); + break; + } + case K_MARGIN_RIGHT: { + SetRightMargin(view, *style); + break; + } + case K_MARGIN_TOP: { + SetTopMargin(view, *style); + break; + } + case K_PADDING: + SetPadding(view, *style); + break; + case K_PADDING_BOTTOM: + SetBottomPadding(view, *style); + break; + case K_PADDING_LEFT: + SetLeftPadding(view, *style); + break; + case K_PADDING_RIGHT: + SetRightPadding(view, *style); + break; + case K_PADDING_TOP: { + SetTopPadding(view, *style); + break; + } + case K_BORDER_BOTTOM_WIDTH: + case K_BORDER_LEFT_WIDTH: + case K_BORDER_RIGHT_WIDTH: + case K_BORDER_TOP_WIDTH: + case K_BORDER_WIDTH: { + SetBorderWidth(view, *style); + break; + } + case K_BORDER_BOTTOM_COLOR: + case K_BORDER_LEFT_COLOR: + case K_BORDER_RIGHT_COLOR: + case K_BORDER_TOP_COLOR: + case K_BORDER_COLOR: { + SetBorderColor(view, *style); + break; + } + case K_BORDER_RADIUS: { + SetBorderRadius(view, *style); + break; + } + case K_BACKGROUND_COLOR: { + SetBackgroundColor(view, *style); + break; + } + case K_LEFT: { + SetLeft(view, style); + break; + } + case K_TOP: { + SetTop(view, style); + break; + } + case K_ANIMATION_DURATION: { + SetAnimationStyle(view, style, K_ANIMATION_DURATION); + break; + } + case K_ANIMATION_TIMING_FUNCTION: { + SetAnimationStyle(view, style, K_ANIMATION_TIMING_FUNCTION); + break; + } + case K_ANIMATION_FILL_MODE: { + SetAnimationStyle(view, style, K_ANIMATION_FILL_MODE); + break; + } + case K_ANIMATION_DELAY: { + SetAnimationStyle(view, style, K_ANIMATION_DELAY); + break; + } + case K_ANIMATION_ITERATION_COUNT: { + SetAnimationStyle(view, style, K_ANIMATION_ITERATION_COUNT); + break; + } + case K_ANIMATION_NAME: { + SetAnimationKeyFrames(view, style); + break; + } + default: { + return false; + } + } + return true; +} + +void Component::Invalidate() +{ + UIView *view = GetComponentRootView(); + if (view == nullptr) { + return; + } + view->Invalidate(); +} + +void Component::ParseOptions() +{ + if (JSUndefined::Is(options_)) { + HILOG_WARN(HILOG_MODULE_ACE, "options is null"); + return; + } + + if (!JSObject::Is(options_)) { + HILOG_WARN(HILOG_MODULE_ACE, "options is not a object type."); + return; + } + + jerry_value_t attrsPropValue = jerryx_get_property_str(options_, ATTR_ATTRS); + const char * const attrEvent = "on"; + jerry_value_t eventPropValue = jerryx_get_property_str(options_, attrEvent); + + if (!jerry_value_is_undefined(attrsPropValue)) { + START_TRACING(RENDER_PARSE_ATTR); + ParseAttrs(attrsPropValue); + STOP_TRACING(); + } + + if (!jerry_value_is_undefined(eventPropValue)) { + START_TRACING(RENDER_PARSE_EVENT); + ParseEvent(eventPropValue); + STOP_TRACING(); + } + ReleaseJerryValue(eventPropValue, attrsPropValue, VA_ARG_END_FLAG); +} + +void Component::SetAnimationKeyFrames(const UIView &view, const AppStyleItem *styleItem) +{ + if (trans_ == nullptr) { + trans_ = new TransitionParams(); + + if (trans_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "create TransitionParams object error"); + return; + } + } + + const char * const value = GetStyleStrValue(styleItem); + if (value == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "animation name is not string value"); + return; + } + + const AppStyleSheet *styleSheet = GetStyleManager()->GetStyleSheet(); + if (styleSheet == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "styleSheet must set when you set animation attribute"); + return; + } + AppStyle *style = styleSheet->GetStyleFromKeyFramesSelectors(value); + + if (style) { + const AppStyleItem *item = style->GetFirst(); + if (item == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "keyFrame style is not set!"); + return; + } + SetAnimationKeyFrames(item); + } +} + +void Component::SetAnimationKeyFrames(const AppStyleItem *item) +{ + if (item == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "keyFrame style is not set!"); + return; + } + + const int8_t animatorFrom = 1; + const int8_t animatorTo = 2; + + isAnimationKeyFramesSet_ = false; + while (item) { + const char * const itemValue = item->GetStrValue(); + + if ((itemValue == nullptr) || (strlen(itemValue) == 0)) { + return; + } + size_t valLength = strlen(itemValue); + if ((valLength <= 0) || (valLength >= UINT8_MAX)) { + item = item->GetNext(); + continue; + } + char *animationValue = reinterpret_cast(ace_malloc(sizeof(char) * (valLength + 1))); + if (animationValue == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "malloc animationValue memory heap failed."); + return; + } + if (memcpy_s(animationValue, valLength, itemValue, valLength) != 0) { + ace_free(animationValue); + animationValue = nullptr; + return; + } + animationValue[valLength] = '\0'; + int32_t valueTo; + int32_t valueFrom; + int16_t keyId = item->GetPropNameId(); + if (keyId == K_OPACITY) { + valueTo = GetAnimatorValue(animationValue, animatorTo, true); + valueFrom = GetAnimatorValue(animationValue, animatorFrom, true); + } else { + valueTo = GetAnimatorValue(animationValue, animatorTo); + valueFrom = GetAnimatorValue(animationValue, animatorFrom); + } + ace_free(animationValue); + animationValue = nullptr; + SetAnimationKeyFrames(keyId, valueFrom, valueTo); + item = item->GetNext(); + } +} + +void Component::SetAnimationKeyFrames(int16_t keyId, int32_t valueFrom, int32_t valueTo) +{ + switch (keyId) { + case K_ROTATE: + trans_->transformType = const_cast(TRANSITION_ROTATE); + trans_->transform_from = valueFrom; + trans_->transform_to = valueTo; + isAnimationKeyFramesSet_ = true; + break; + case K_TRANSLATE_X: + trans_->transformType = const_cast(TRANSITION_TRANSFORM_X); + trans_->transform_from = valueFrom; + trans_->transform_to = valueTo; + isAnimationKeyFramesSet_ = true; + break; + case K_TRANSLATE_Y: + trans_->transformType = const_cast(TRANSITION_TRANSFORM_Y); + trans_->transform_from = valueFrom; + trans_->transform_to = valueTo; + isAnimationKeyFramesSet_ = true; + break; + case K_HEIGHT: + trans_->height_from = valueFrom; + trans_->height_to = valueTo; + isAnimationKeyFramesSet_ = true; + break; + case K_WIDTH: + trans_->width_from = valueFrom; + trans_->width_to = valueTo; + isAnimationKeyFramesSet_ = true; + break; + case K_BACKGROUND_COLOR: + trans_->background_color_from = valueFrom; + trans_->background_color_to = valueTo; + isAnimationKeyFramesSet_ = true; + break; + case K_OPACITY: + trans_->opacity_from = valueFrom; + trans_->opacity_to = valueTo; + isAnimationKeyFramesSet_ = true; + break; + default: + break; + } +} + +void Component::SetAnimationStyle(const UIView &view, const AppStyleItem *styleItem, const int16_t keyId) +{ + // special for "animation-iteration-count" which value could be a number or string "infinite" + if ((styleItem == nullptr) || (!const_cast(styleItem)->UpdateNumValToStr())) { + HILOG_ERROR(HILOG_MODULE_ACE, "SetAnimationStyle fail"); + return; + } + if (trans_ == nullptr) { + trans_ = new TransitionParams(); + if (trans_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "create TransitionParams object error"); + return; + } + } + + const char * const strValue = GetStyleStrValue(styleItem); + const size_t strLen = GetStyleStrValueLen(styleItem); + if (strValue == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "animation style item is null"); + return; + } + switch (keyId) { + case K_ANIMATION_DURATION: { + if (!IsStyleValueTypeString(styleItem)) { + HILOG_ERROR(HILOG_MODULE_ACE, "style animation during value is invalid!"); + return; + } + trans_->during = ParseToMilliseconds(strValue); + break; + } + case K_ANIMATION_TIMING_FUNCTION: { + uint16_t animationTimingKeyId = KeyParser::ParseKeyId(strValue, strLen); + switch (animationTimingKeyId) { + case K_EASE_IN: + trans_->easing = EasingType::EASE_IN; + break; + case K_EASE_OUT: + trans_->easing = EasingType::EASE_OUT; + break; + case K_EASE_IN_OUT: + trans_->easing = EasingType::EASE_IN_OUT; + break; + default: + trans_->easing = EasingType::LINEAR; + break; + } + break; + } + case K_ANIMATION_FILL_MODE: { + uint16_t animationFillKeyId = KeyParser::ParseKeyId(strValue, strLen); + switch (animationFillKeyId) { + case K_FORWARDS: + trans_->fill = OptionsFill::FORWARDS; + break; + default: + trans_->fill = OptionsFill::FNONE; + break; + } + break; + } + case K_ANIMATION_DELAY: { + if (!IsStyleValueTypeString(styleItem)) { + HILOG_ERROR(HILOG_MODULE_ACE, "style animation delay value is invalid!"); + return; + } + trans_->delay = ParseToMilliseconds(strValue); + break; + } + case K_ANIMATION_ITERATION_COUNT: { + if (!IsStyleValueTypeString(styleItem)) { + HILOG_ERROR(HILOG_MODULE_ACE, "style iteration count value is invalid!"); + return; + } + trans_->iterations = TransitionImpl::GetNumIterations(strValue); + break; + } + default: + break; + } +} + +void Component::AddAnimationToList(const TransitionImpl *transitionImpl) const +{ + AnimationsNode *animation = new AnimationsNode(); + if (animation == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "create animation node error in startAnimation"); + return; + } + animation->transitionImpl = const_cast(transitionImpl); + animation->next = g_animationListHead; + g_animationListHead = animation; +} + +void Component::RecordAnimation() +{ + if (trans_ == nullptr) { + return; + } + + if (trans_->during > 0 && isAnimationKeyFramesSet_) { + UIView *uiView = GetComponentRootView(); + if (uiView) { + curTransitionImpl_ = new TransitionImpl(*trans_, uiView); + if (curTransitionImpl_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "create transitionImpl error"); + isAnimationKeyFramesSet_ = false; + return; + } + curTransitionImpl_->Init(); + AddAnimationToList(curTransitionImpl_); + isAnimationKeyFramesSet_ = false; + // special for "if" situation, if g_isAnimatorStarted is started means the page has started all the + // animators, and the current component is created by "if" situation, so the animator can start immediattly + if (g_isAnimatorStarted) { + curTransitionImpl_->Start(); + } + } + } +} + +void Component::StartAnimation() +{ + if (trans_ == nullptr) { + return; + } + + if (trans_->during > 0 && isAnimationKeyFramesSet_) { + UIView *uiView = GetComponentRootView(); + if (uiView) { + if (curTransitionImpl_ != nullptr) { + curTransitionImpl_->Stop(); + } + curTransitionImpl_ = new TransitionImpl(*trans_, uiView); + if (curTransitionImpl_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "create transitionImpl error!"); + isAnimationKeyFramesSet_ = false; + return; + } + curTransitionImpl_->Init(); + AddAnimationToList(curTransitionImpl_); + curTransitionImpl_->Start(); + isAnimationKeyFramesSet_ = false; + } + } +} + +void Component::ReleaseTransitionParam() +{ + if (trans_) { + delete trans_; + trans_ = nullptr; + } +} + +int32_t Component::GetAnimatorValue(char *animatorValue, const int8_t index, bool isOpacity) const +{ + if ((animatorValue == nullptr) || (strlen(animatorValue) == 0) || (strlen(animatorValue) >= UINT8_MAX)) { + return 0; + } + const int8_t animatorfrom = 1; + const int8_t animatorTo = 2; + if ((index != animatorfrom) && (index != animatorTo)) { + return 0; + } + + char *next = nullptr; + // try to get from part + char *value = strtok_s(animatorValue, ANIMATION_VALUE_SEP, &next); + if (index == animatorTo) { + // get to part then if needed + if (value != nullptr) { + value = strtok_s(nullptr, ANIMATION_VALUE_SEP, &next); + } + } + if (value == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "GetAnimatorValue strtok_s failed."); + return 0; + } + + long convertedValue = isOpacity ? (strtod(value, nullptr) * ALPHA_MAX) : strtol(value, nullptr, DEC); + if (TransitionImpl::IsEndWith(value, "rad")) { + uint8_t degConversionRate = 57; + convertedValue = convertedValue * degConversionRate; + } + return convertedValue; +} + +/** + * check if the pass-in attrValue is an Expression, if it is, calculate it and bind watcher instance. + * if it's not, just return the passed-in attrValue itself. + */ +jerry_value_t Component::ParseExpression(jerry_value_t attrKey, jerry_value_t attrValue) +{ + jerry_value_t options = jerry_create_object(); + JerrySetNamedProperty(options, ARG_WATCH_EL, nativeElement_); + JerrySetNamedProperty(options, ARG_WATCH_ATTR, attrKey); + jerry_value_t watcher = CallJSWatcher(attrValue, WatcherCallbackFunc, options); + jerry_value_t propValue = UNDEFINED; + if (IS_UNDEFINED(watcher) || jerry_value_is_error(watcher)) { + HILOG_ERROR(HILOG_MODULE_ACE, "Failed to create Watcher instance."); + } else { + InsertWatcherCommon(watchersHead_, watcher); + propValue = jerryx_get_property_str(watcher, "_lastValue"); + } + jerry_release_value(options); + return propValue; +} + +void Component::ParseAttrs(jerry_value_t attrs) +{ + jerry_value_t attrKeys = jerry_get_object_keys(attrs); + if (jerry_value_is_undefined(attrKeys)) { + HILOG_ERROR(HILOG_MODULE_ACE, "None attributes to parse."); + return; + } + + uint16_t length = jerry_get_array_length(attrKeys); + uint16_t attrKeyStrLength = 0; + for (uint32_t index = 0; index < length; ++index) { + jerry_value_t attrKey = jerry_get_property_by_index(attrKeys, index); + jerry_value_t attrValue = jerry_get_property(attrs, attrKey); + jerry_value_t newAttrValue = attrValue; + + if (jerry_value_is_function(attrValue)) { + START_TRACING_WITH_COMPONENT_NAME(SET_ATTR_PARSE_EXPRESSION, componentName_); + newAttrValue = ParseExpression(attrKey, attrValue); + STOP_TRACING(); + } + + char *attrKeyStr = MallocStringOf(attrKey, &attrKeyStrLength); + if (attrKeyStr != nullptr) { + if (attrKeyStrLength != 0) { + uint16_t attrKeyId = KeyParser::ParseKeyId(attrKeyStr, attrKeyStrLength); + // ignore the return result for no need to invalided views here + START_TRACING_WITH_EXTRA_INFO(SET_ATTR_SET_TO_NATIVE, componentName_, attrKeyId); + SetAttribute(attrKeyId, newAttrValue); + STOP_TRACING(); + } + ace_free(attrKeyStr); + attrKeyStr = nullptr; + } + if (newAttrValue != attrValue) { + // the new value has been calculated out by ParseExpression, need to be released + jerry_release_value(newAttrValue); + } + ReleaseJerryValue(attrKey, attrValue, VA_ARG_END_FLAG); + } + jerry_release_value(attrKeys); +} + +void Component::SetClickEventListener(UIView &view, const jerry_value_t eventFunc, const uint16_t eventTypeId) +{ + onClickListener_ = new ViewOnClickListener(eventFunc, eventTypeId); + if (onClickListener_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "click listener create failed"); + return; + } + + view.SetOnClickListener(onClickListener_); + view.SetTouchable(true); +} + +#ifdef JS_TOUCH_EVENT_SUPPORT +void Component::SetTouchStartEventListener(UIView &view, jerry_value_t eventFunc, uint16_t eventTypeId) +{ + onTouchStartListener_ = new ViewOnTouchStartListener(eventFunc, eventTypeId); + if (onTouchStartListener_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "touch move event listener create failed"); + return; + } + + view.SetOnTouchListener(onTouchStartListener_); + view.SetTouchable(true); +} + +void Component::SetTouchMoveEventListener(UIView &view, jerry_value_t eventFunc, uint16_t eventTypeId) +{ + onTouchMoveListener_ = new ViewOnTouchMoveListener(eventFunc, eventTypeId); + if (onTouchMoveListener_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "touch start event listener create failed"); + return; + } + + view.SetOnDragListener(onTouchMoveListener_); + view.SetTouchable(true); + view.SetDraggable(true); +} + +void Component::SetTouchCancelEventListener(UIView &view, jerry_value_t eventFunc, uint16_t eventTypeId) +{ + onTouchCancelListener_ = new ViewOnTouchCancelListener(eventFunc, eventTypeId); + if (onTouchCancelListener_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "touch cancel event listener create failed"); + return; + } + + view.SetOnTouchListener(onTouchCancelListener_); + view.SetTouchable(true); + view.SetDraggable(true); +} + +void Component::SetTouchEndEventListener(UIView &view, jerry_value_t eventFunc, uint16_t eventTypeId) +{ + onTouchEndListener_ = new ViewOnTouchEndListener(eventFunc, eventTypeId); + if (onTouchEndListener_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "touch end event listener create failed"); + return; + } + + view.SetOnTouchListener(onTouchEndListener_); + view.SetTouchable(true); +} + +void Component::SetKeyBoardEventListener(jerry_value_t eventFunc, uint16_t eventTypeId) +{ + RootView *rootView = RootView::GetInstance(); + if (rootView == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "get rootView is nullptr"); + return; + } + keyBoardEventListener_ = new KeyBoardEventListener(eventFunc, eventTypeId); + if (keyBoardEventListener_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "on key borard event listener create failed"); + return; + } + rootView->SetOnKeyActListener(keyBoardEventListener_); +} +#endif + +void Component::SetLongPressEventListener(UIView &view, const jerry_value_t eventFunc, const uint16_t eventTypeId) +{ + onLongPressListener_ = new ViewOnLongPressListener(eventFunc, eventTypeId); + if (onLongPressListener_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "long press listener create failed"); + return; + } + + view.SetOnLongPressListener(onLongPressListener_); + view.SetTouchable(true); +} + +void Component::SetSwipeEventListener(UIView &view, jerry_value_t eventFunc) +{ + onSwipeListener_ = new ViewOnSwipeListener(eventFunc); + if (onSwipeListener_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "swipe listener create failed"); + return; + } + + view.SetOnDragListener(onSwipeListener_); + view.SetDraggable(true); + view.SetTouchable(true); + view.SetIntercept(false); +} + +// default implementation +bool Component::RegisterEventListener(uint16_t eventTypeId, jerry_value_t funcValue) +{ + UIView *uiView = GetComponentRootView(); + if ((uiView == nullptr) || !KeyParser::IsKeyValid(eventTypeId) || IS_UNDEFINED(funcValue)) { + return false; + } + + bool registerResult = RegisterPrivateEventListener(eventTypeId, funcValue); + if (registerResult) { + return true; + } + + return RegisterCommonEventListener(*uiView, eventTypeId, funcValue); +} + +bool Component::RegisterCommonEventListener(UIView &view, const uint16_t eventTypeId, const jerry_value_t funcValue) +{ + switch (eventTypeId) { + case K_CLICK: { + SetClickEventListener(view, funcValue, eventTypeId); + break; + } + case K_LONGPRESS: { + SetLongPressEventListener(view, funcValue, eventTypeId); + break; + } +#ifdef JS_TOUCH_EVENT_SUPPORT + case K_KEY: { + SetKeyBoardEventListener(funcValue, eventTypeId); + break; + } + case K_TOUCHSTART: { + SetTouchStartEventListener(view, funcValue, eventTypeId); + break; + } + case K_TOUCHCANCEL: { + SetTouchCancelEventListener(view, funcValue, eventTypeId); + break; + } + case K_TOUCHMOVE: { + SetTouchMoveEventListener(view, funcValue, eventTypeId); + break; + } + case K_TOUCHEND: { + SetTouchEndEventListener(view, funcValue, eventTypeId); + break; + } +#endif + case K_SWIPE: { + SetSwipeEventListener(view, funcValue); + break; + } + default: { + return false; + } + } + return true; +} + +void Component::ReleaseCommonEventListeners() +{ + ACE_DELETE(onClickListener_); + ACE_DELETE(onLongPressListener_); +#ifdef JS_TOUCH_EVENT_SUPPORT + ACE_DELETE(keyBoardEventListener_); + ACE_DELETE(onTouchStartListener_); + ACE_DELETE(onTouchCancelListener_); + ACE_DELETE(onTouchMoveListener_); + ACE_DELETE(onTouchEndListener_); +#endif + ACE_DELETE(onSwipeListener_); +} + +void Component::AppendDescriptorOrElements(UIViewGroup *viewGroup, const JSValue descriptorOrElements) +{ + if (!JSUndefined::Is(descriptorOrElements)) { + uint16_t size = JSArray::Length(descriptorOrElements); + for (uint16_t idx = 0; idx < size; ++idx) { + JSValue descriptorOrElement = JSArray::Get(descriptorOrElements, idx); + AppendDescriptorOrElement(viewGroup, descriptorOrElement); + JSRelease(descriptorOrElement); + } + } +} + +void Component::ReLayoutChildrenIfNeeded(uint16_t attrKeyId) const +{ + UIView *uiView = GetComponentRootView(); + if ((uiView == nullptr) || !KeyParser::IsKeyValid(attrKeyId)) { + return; + } + + if (attrKeyId == K_HEIGHT || attrKeyId == K_WIDTH || attrKeyId == K_MARGIN || attrKeyId == K_MARGIN_BOTTOM || + attrKeyId == K_MARGIN_LEFT || attrKeyId == K_MARGIN_RIGHT || attrKeyId == K_MARGIN_TOP || + attrKeyId == K_PADDING || attrKeyId == K_PADDING_BOTTOM || attrKeyId == K_PADDING_LEFT || + attrKeyId == K_PADDING_RIGHT || attrKeyId == K_PADDING_TOP || attrKeyId == K_BORDER_BOTTOM_WIDTH || + attrKeyId == K_BORDER_LEFT_WIDTH || attrKeyId == K_BORDER_RIGHT_WIDTH || attrKeyId == K_BORDER_TOP_WIDTH || + attrKeyId == K_BORDER_WIDTH || attrKeyId == K_BORDER_RADIUS || attrKeyId == K_LEFT || attrKeyId == K_TOP) { + UIView *parent = uiView->GetParent(); + if (parent != nullptr) { + parent->LayoutChildren(); + parent->Invalidate(); + } + } +} + +void Component::ParseEvent(jerry_value_t events) +{ + jerry_value_t eventKeys = jerry_get_object_keys(events); + if (jerry_value_is_undefined(eventKeys)) { + HILOG_ERROR(HILOG_MODULE_ACE, "None event to parse."); + return; + } + + uint16_t length = jerry_get_array_length(eventKeys); + if (length == 0) { + HILOG_ERROR(HILOG_MODULE_ACE, "None event to parse."); + jerry_release_value(eventKeys); + return; + } + + uint16_t eventTypeStrLen = 0; + for (uint16_t index = 0; index < length; ++index) { + jerry_value_t eventKey = jerry_get_property_by_index(eventKeys, index); + jerry_value_t eventFunc = jerry_get_property(events, eventKey); + + char *eventType = MallocStringOf(eventKey, &eventTypeStrLen); + if (eventType != nullptr) { + if (eventTypeStrLen != 0) { + uint16_t eventTypeId = KeyParser::ParseKeyId(eventType, eventTypeStrLen); + bool isSuccess = RegisterEventListener(eventTypeId, eventFunc); + if (!isSuccess) { + HILOG_ERROR(HILOG_MODULE_ACE, "Register event listener error."); + } + } + ace_free(eventType); + eventType = nullptr; + } + ReleaseJerryValue(eventKey, eventFunc, VA_ARG_END_FLAG); + } + jerry_release_value(eventKeys); +} + +// set component's left coordinate relative to its parent +void Component::SetLeft(UIView &view, const AppStyleItem *styleItem) const +{ + int16_t left = GetStylePixelValue(styleItem); + view.SetX(left); +} + +// set component's top coordinate relative to its parent +void Component::SetTop(UIView &view, const AppStyleItem *styleItem) const +{ + int16_t top = GetStylePixelValue(styleItem); + view.SetY(top); +} + +void Component::SetHeight(const AppStyleItem *styleItem) +{ + height_ = GetStylePixelValue(styleItem); +} + +void Component::SetWidth(const AppStyleItem *styleItem) +{ + width_ = GetStylePixelValue(styleItem); +} + +void Component::SetVisible(UIView &view, const AppStyleItem *styleItem) const +{ + if (!IsStyleValueTypeString(styleItem)) { + HILOG_ERROR(HILOG_MODULE_ACE, "Visible style value is invalid!"); + return; + } + const char * const strValue = GetStyleStrValue(styleItem); + if (strValue == nullptr) { + return; + } + + uint16_t valueId = KeyParser::ParseKeyId(strValue, GetStyleStrValueLen(styleItem)); + view.SetVisible((valueId == K_NONE) ? false : true); +} + +void Component::SetBackgroundColor(UIView &view, const AppStyleItem &styleItem) const +{ + uint32_t color = 0; + uint8_t alpha = OPA_OPAQUE; + + if (GetStyleColorValue(&styleItem, color, alpha)) { + ColorType backgroundRGBColor = GetRGBColor(color); + view.SetStyle(STYLE_BACKGROUND_COLOR, backgroundRGBColor.full); + view.SetStyle(STYLE_BACKGROUND_OPA, alpha); + } +} + +void Component::SetOpacity(UIView &view, const AppStyleItem &styleItem) const +{ + if (styleItem.GetValueType() != STYLE_PROP_VALUE_TYPE_FLOATING) { + return; + } + double opacity = styleItem.GetFloatingValue(); + view.SetStyle(STYLE_BACKGROUND_OPA, view.GetStyle(STYLE_BACKGROUND_OPA) * opacity); + view.SetStyle(STYLE_IMAGE_OPA, view.GetStyle(STYLE_IMAGE_OPA) * opacity); + view.SetStyle(STYLE_LINE_OPA, view.GetStyle(STYLE_LINE_OPA) * opacity); + view.SetStyle(STYLE_TEXT_OPA, view.GetStyle(STYLE_TEXT_OPA) * opacity); +} + +void Component::SetMargin(UIView &view, const AppStyleItem &styleItem) const +{ + SetLeftMargin(view, styleItem); + SetTopMargin(view, styleItem); + SetRightMargin(view, styleItem); + SetBottomMargin(view, styleItem); +} + +void Component::SetLeftMargin(UIView &view, const AppStyleItem &styleItem) const +{ + view.SetStyle(STYLE_MARGIN_LEFT, GetStylePixelValue(&styleItem)); +} + +void Component::SetTopMargin(UIView &view, const AppStyleItem &styleItem) const +{ + view.SetStyle(STYLE_MARGIN_TOP, GetStylePixelValue(&styleItem)); +} + +void Component::SetRightMargin(UIView &view, const AppStyleItem &styleItem) const +{ + view.SetStyle(STYLE_MARGIN_RIGHT, GetStylePixelValue(&styleItem)); +} + +void Component::SetBottomMargin(UIView &view, const AppStyleItem &styleItem) const +{ + view.SetStyle(STYLE_MARGIN_BOTTOM, GetStylePixelValue(&styleItem)); +} + +void Component::SetPadding(UIView &view, const AppStyleItem &styleItem) const +{ + SetLeftPadding(view, styleItem); + SetTopPadding(view, styleItem); + SetRightPadding(view, styleItem); + SetBottomPadding(view, styleItem); +} + +void Component::SetLeftPadding(UIView &view, const AppStyleItem &styleItem) const +{ + int32_t paddingLeft = GetStylePixelValue(&styleItem); + if (paddingLeft >= 0) { + view.SetStyle(STYLE_PADDING_LEFT, paddingLeft); + } +} + +void Component::SetTopPadding(UIView &view, const AppStyleItem &styleItem) const +{ + int32_t paddingTop = GetStylePixelValue(&styleItem); + if (paddingTop >= 0) { + view.SetStyle(STYLE_PADDING_TOP, paddingTop); + } +} + +void Component::SetRightPadding(UIView &view, const AppStyleItem &styleItem) const +{ + int32_t paddingRight = GetStylePixelValue(&styleItem); + if (paddingRight >= 0) { + view.SetStyle(STYLE_PADDING_RIGHT, paddingRight); + } +} + +void Component::SetBottomPadding(UIView &view, const AppStyleItem &styleItem) const +{ + int32_t paddingBottom = GetStylePixelValue(&styleItem); + if (paddingBottom >= 0) { + view.SetStyle(STYLE_PADDING_BOTTOM, paddingBottom); + } +} + +void Component::SetBorderColor(UIView &view, const AppStyleItem &styleItem) const +{ + uint32_t color = 0; + uint8_t alpha = OPA_OPAQUE; + if (GetStyleColorValue(&styleItem, color, alpha)) { + view.SetStyle(STYLE_BORDER_COLOR, GetRGBColor(color).full); + view.SetStyle(STYLE_BORDER_OPA, alpha); + } +} + +void Component::SetBorderRadius(UIView &view, const AppStyleItem &styleItem) const +{ + view.SetStyle(STYLE_BORDER_RADIUS, GetStylePixelValue(&styleItem)); +} + +void Component::SetBorderWidth(UIView &view, const AppStyleItem &styleItem) const +{ + view.SetStyle(STYLE_BORDER_WIDTH, GetStylePixelValue(&styleItem)); +} + +jerry_value_t Component::SetListForWatcher(jerry_value_t getter, jerry_value_t children) +{ + jerry_value_t options = jerry_create_object(); + JerrySetNamedProperty(options, ARG_WATCH_EL, nativeElement_); + + jerry_value_t watcher = CallJSWatcher(getter, ListForWatcherCallbackFunc, options); + if (IS_UNDEFINED(watcher) || jerry_value_is_error(watcher)) { + HILOG_ERROR(HILOG_MODULE_ACE, "Failed to create ListForWatcher instance."); + } else { + InsertWatcherCommon(watchersHead_, watcher); + } + jerry_release_value(options); + return UNDEFINED; +} + +void Component::HandleListForDireactive() +{ + uint16_t childrenLength = jerry_get_array_length(descriptors_); + for (uint16_t index = 0; index < childrenLength; index++) { + jerry_value_t child = jerry_get_property_by_index(descriptors_, index); + jerry_value_t getterName = jerry_create_string(reinterpret_cast(DESCRIPTOR_ATTR_GETTER)); + // add watcher to the array which the getter function returned + if (JerryHasProperty(child, getterName)) { + jerry_value_t getter = jerry_get_property(child, getterName); + SetListForWatcher(getter, descriptors_); + jerry_release_value(getter); + } + ReleaseJerryValue(getterName, child, VA_ARG_END_FLAG); + } +} + +void Component::AppendChildren(UIViewGroup *viewGroup) +{ + if (JSUndefined::Is(descriptors_)) { + return; + } + + children_ = JSArray::Create(0); + uint16_t size = JSArray::Length(descriptors_); + for (uint16_t index = 0; index < size; ++index) { + JSValue descriptorOrElement = JSArray::Get(descriptors_, index); + if (!JSUndefined::Is(descriptorOrElement)) { + bool isDescriptor = AppendDescriptorOrElement(viewGroup, descriptorOrElement); + if (isDescriptor) { + CreateDirectiveWatcher(descriptorOrElement); + } + } + JSRelease(descriptorOrElement); + } +} + +bool Component::AppendDescriptorOrElement(UIViewGroup *viewGroup, const jerry_value_t descriptorOrElement) +{ + if (DescriptorUtils::IsIfDescriptor(descriptorOrElement)) { + AppendIfDescriptor(viewGroup, descriptorOrElement); + return true; + } + + if (DescriptorUtils::IsForDescriptor(descriptorOrElement)) { + AppendForDescriptor(viewGroup, descriptorOrElement); + return true; + } + AppendElement(viewGroup, descriptorOrElement); + return false; +} + +void Component::AppendIfDescriptor(UIViewGroup *viewGroup, const jerry_value_t descriptor) +{ + bool isShown = DescriptorUtils::IsIfDescriptorShown(descriptor); + if (isShown) { + JSValue decriptorOrElement = DescriptorUtils::GetDescriptorRendered(descriptor); + if (!JSUndefined::Is(decriptorOrElement)) { + AppendDescriptorOrElement(viewGroup, decriptorOrElement); + JSRelease(decriptorOrElement); + } else { + // Don't release decriptorOrElement + // because decriptorOrElement is the result of jerry_create_object but jerry_get_property + decriptorOrElement = DescriptorUtils::RenderIfDescriptor(descriptor); + AppendDescriptorOrElement(viewGroup, decriptorOrElement); + + // does decriptorOrElement need to be release if decriptorOrElement is descriptor + } + } else { + DescriptorUtils::DelIfDescriptorRendered(descriptor); + } +} +void Component::AppendForDescriptor(UIViewGroup *viewGroup, const jerry_value_t descriptor) +{ + JSValue descriptorOrelements = DescriptorUtils::GetDescriptorRendered(descriptor); + if (!JSUndefined::Is(descriptorOrelements)) { + AppendDescriptorOrElements(viewGroup, descriptorOrelements); + JSRelease(descriptorOrelements); + } else { + // Don't release decriptorOrElements + // because decriptorOrElements is the result of jerry_create_object but jerry_get_property + descriptorOrelements = DescriptorUtils::RenderForDescriptor(descriptor); + AppendDescriptorOrElements(viewGroup, descriptorOrelements); + } +} +void Component::AppendElement(UIViewGroup *viewGroup, const jerry_value_t element) +{ + Component *component = nullptr; + if (!JSObject::GetNativePointer(element, reinterpret_cast(&component))) { + // if get binding component native pointer failed from a child element, just release that element + HILOG_ERROR(HILOG_MODULE_ACE, "fatal error, no component is binded to the child element, not allowed."); + // try to release this element and its children, it means we drop them all + DescriptorUtils::ReleaseDescriptorOrElement(element); + return; + } + JSArray::Push(children_, element); + viewGroup->Add(component->GetComponentRootView()); +} +void Component::CreateDirectiveWatcher(jerry_value_t descriptor) +{ + JSValue watcher = DescriptorUtils::CreateDescriptorWatcher(nativeElement_, descriptor); + if (!JSUndefined::Is(watcher)) { + InsertWatcherCommon(watchersHead_, watcher); + } +} +void Component::HandleChildrenChange(jerry_value_t descriptor) +{ + UIViewGroup *viewGroup = reinterpret_cast(GetComponentRootView()); + + if (viewGroup != nullptr) { + viewGroup->RemoveAll(); + } else { + HILOG_ERROR(HILOG_MODULE_ACE, "Get root component error"); + return; + } + + if (!JSUndefined::Is(children_)) { + JSRelease(children_); + children_ = JSArray::Create(0); + } + + uint16_t size = JSArray::Length(descriptors_); + for (uint16_t idx = 0; idx < size; ++idx) { + JSValue descriptorOrElement = JSArray::Get(descriptors_, idx); + if (IS_UNDEFINED(descriptorOrElement)) { + continue; + } + if (descriptorOrElement == descriptor) { + UpdateDescriptor(viewGroup, descriptorOrElement); + } else { + ReappendDescriptorOrElement(viewGroup, descriptorOrElement); + } + JSRelease(descriptorOrElement); + } + + viewGroup->LayoutChildren(); + viewGroup->Invalidate(); +} + +void Component::UpdateDescriptor(UIViewGroup *viewGroup, const jerry_value_t descriptor) +{ + if (DescriptorUtils::IsIfDescriptor(descriptor)) { + AppendIfDescriptor(viewGroup, descriptor); + } else if (DescriptorUtils::IsForDescriptor(descriptor)) { + // Release descriptor last rendered + DescriptorUtils::DelForDescriptorRendered(descriptor); + + // Re-render descriptor + JSValue descriptorOrElements = DescriptorUtils::RenderForDescriptor(descriptor); + AppendDescriptorOrElements(viewGroup, descriptorOrElements); + } else { + // never + } +} + +void Component::ReappendDescriptorOrElement(UIViewGroup *viewGroup, const jerry_value_t descriptor) +{ + if (DescriptorUtils::IsIfDescriptor(descriptor)) { + JSValue descriptorOrElement = DescriptorUtils::GetDescriptorRendered(descriptor); + if (!JSUndefined::Is(descriptorOrElement)) { + AppendDescriptorOrElement(viewGroup, descriptor); + } + JSRelease(descriptorOrElement); + } else if (DescriptorUtils::IsForDescriptor(descriptor)) { + JSValue descriptorOrElements = DescriptorUtils::GetDescriptorRendered(descriptor); + if (!JSUndefined::Is(descriptorOrElements)) { + AppendDescriptorOrElements(viewGroup, descriptorOrElements); + } + JSRelease(descriptorOrElements); + } else { + AppendElement(viewGroup, descriptor); + } +} + +int32_t Component::GetStylePixelValue(const AppStyleItem *style, int32_t defaultValue) const +{ + if (style->GetValueType() == STYLE_PROP_VALUE_TYPE_NUMBER) { + return style->GetNumValue(); + } + if (style->GetValueType() == STYLE_PROP_VALUE_TYPE_STRING) { + if (style->GetStrValue() == nullptr) { + HILOG_WARN(HILOG_MODULE_ACE, "Get Style PixelValue failed, return default value!"); + return defaultValue; + } + return strtol(style->GetStrValue(), nullptr, DEC); + } + return defaultValue; +} + +int16_t Component::GetStyleDegValue(const AppStyleItem *style, int16_t defaultValue) const +{ + if (style->GetValueType() == STYLE_PROP_VALUE_TYPE_NUMBER) { + return style->GetNumValue(); + } + if (style->GetValueType() == STYLE_PROP_VALUE_TYPE_STRING) { + if (style->GetStrValue() == nullptr) { + HILOG_WARN(HILOG_MODULE_ACE, "Get Style DegValue failed, return default value!"); + return defaultValue; + } + return strtol(style->GetStrValue(), nullptr, DEC); + } + return defaultValue; +} + +bool Component::GetStyleColorValue(const AppStyleItem *style, uint32_t &color, uint8_t &alpha) const +{ + if (style->GetValueType() == STYLE_PROP_VALUE_TYPE_NUMBER) { + color = style->GetNumValue(); + alpha = OPA_OPAQUE; + return true; + } else if (style->GetValueType() == STYLE_PROP_VALUE_TYPE_STRING) { + return ParseColor(style->GetStrValue(), color, alpha); + } else { + HILOG_ERROR(HILOG_MODULE_ACE, "invalid color format!"); + return false; + } +} +} // namespace ACELite +} // namespace OHOS diff --git a/src/core/components/component.h b/src/core/components/component.h new file mode 100755 index 0000000..f1d916e --- /dev/null +++ b/src/core/components/component.h @@ -0,0 +1,446 @@ +/* + * Copyright (c) 2020 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. + */ + +#ifndef OHOS_ACELITE_COMPONENT_H +#define OHOS_ACELITE_COMPONENT_H + +#include "ace_log.h" +#include "ace_mem_base.h" +#include "component_utils.h" +#include "event_listener.h" +#include "memory_heap.h" +#include "non_copyable.h" +#include "stylemgr/app_style_manager.h" +#include "transition_impl.h" + +namespace OHOS { +namespace ACELite { +class Component : public MemoryHeap { +public: + ACE_DISALLOW_COPY_AND_MOVE(Component); + Component() = delete; + Component(jerry_value_t options, jerry_value_t children, AppStyleManager *styleManager); + virtual ~Component() + { + if (trans_ != nullptr) { + delete (trans_); + trans_ = nullptr; + } + } + + /** + * @brief After construct a specific component, call this function to setup this component's native view + * and process attribute/events/style/children properly before binding it on an JS object. + * It generally calls a series of functions to complete the render work, some of which are needed to be + * implemented by child class. See step1~step6 function notes. + * + * @return true if success, false if any error occurs + */ + bool Render(); + /** + * @brief Call this function to release all the resource related to this component, includes the native views, + * JS objects and any event listeners. + */ + void Release(); + /** + * @brief This method is called to change/update the attribute/style values on native view. + * It mainly is used by watcher callbacks to do the view updating. + * + * NOTE: currently, we don't support style data binding. + * + * @return true if any attribute/style matches and update successfully, otherwise false + */ + bool UpdateView(uint16_t attrKeyId, jerry_value_t attrValue); + /** + * @brief Child class must implement this method to return its own native view, if it only creates one + * native view, just return it simaply, if it creates multiple views out, it should return the root of + * those views, it's child class's responsibility to organize their hierarchy. + * + * @return the root of the component's native view + */ + virtual UIView *GetComponentRootView() const = 0; + + /** + * Call this to invalidate the views this component is holding, the default implementation is just to + * invalidate the root view of the component, if the child class has special requirement, override this + * method to do that. + */ + virtual void Invalidate(); + jerry_value_t GetNativeElement() const + { + return nativeElement_; + } + + uint16_t GetComponentName() const + { + return componentName_; + } + + // update this view binded by for instruction when watch triggered. + virtual bool UpdateForView() + { + return false; + } + + jerry_value_t GetChildren() const + { + return children_; + } + + jerry_value_t GetDescriptors() const + { + return descriptors_; + } + + jerry_value_t ParseExpression(jerry_value_t attrKey, jerry_value_t attrValue); + + void HandleChildrenChange(jerry_value_t descriptor); + + struct AnimationsNode : public MemoryHeap { + TransitionImpl *transitionImpl; + AnimationsNode *next; + + AnimationsNode() : transitionImpl(nullptr), next(nullptr){}; + }; + + static void HandlerAnimations(); + static void ReleaseAnimations(); + +protected: + void SetComponentName(uint16_t name) + { + componentName_ = name; + } + + void RegisterNamedFunction(const char * const name, jerry_external_handler_t handler) const; + + /** + * @brief The child class can implement this function to do some initialization before the whole render process + * begining. See PostRender() also. The default implementation just does nothing. + */ + virtual void PreRender() {} + /** + * @brief This function will be called after the whole render process is done for current component. + * The child class can implement this function to do some tail work. + * See PreRender() also. The default implementation just does nothing. + */ + virtual void PostRender() {} + /** + * @brief This function will be called when UpdateView begin to execute (attribute change which bind with data + * will trigger UpdateView to execute), you can override this function to do some customise actions. + * The default implementation just does nothing. + */ + virtual void PreUpdate() {} + /** + * @brief This function will be called when UpdateView execute finished. See PreUpdate() also. + * The default implementation just does nothing. + */ + virtual void PostUpdate(uint16_t attrKeyId, bool updateResult) {} + /** + * @brief step1: inherited class must override this method to create the native views, it's the child class's + * responsibility to record the native views it creates out, and they should be released properly in release + * method. + * + * NOTE: child class must check if the native views are not null after new xxx call, return true if it is + * not nullptr, otherwise return false, so framework know this component's rendering is failing and it can + * do the recycling action accordingly. + * + * @return true for success, false for failure + */ + virtual bool CreateNativeViews() = 0; + /** + * @brief This function must be implemented by child classes. Should release all the native views it + * creates out in CreateNativeViews() function. + */ + virtual void ReleaseNativeViews() = 0; + /** + * @brief This is the entry to set all attributes into one specific component, one default + * implementation is provided, which calls SetPrivateAttribute() to try the component's private special + * attribute first, if one gets matched, the setting process ends, if not, common attributes will be + * tried by calling SetCommonAttribute() method. + * + * NOTE: The default implementation just apply attribute into the ui view returned by GetComponentRootView(), + * if this doesn't meet your requirement, go ahead to override this whole function as you want. + * + * @return true if the given attribute gets matched and is set properly, false for otherwise. + */ + virtual bool SetAttribute(uint16_t attrKeyId, jerry_value_t attrValue); + /** + * @brief Child class should call this to set common attribute to a given native view. + * + * @return true if any common attribute key matchs successfully, false if no match at all + */ + bool SetCommonAttribute(UIView& view, const uint16_t attrKeyId, const jerry_value_t attrValue); + /** + * @brief Child class should call this to set own special attribute setting/update actions + * + * @return true if any common attribute key matchs successfully, false if no match at all + */ + virtual bool SetPrivateAttribute(uint16_t attrKeyId, jerry_value_t attrValue) + { + return false; + } + + /** + * @brief This is the entry to register all event listener into one specific component, one default + * implementation is provided, which calls RegisterPrivateEventListener() to try the component's private + * special event type first, if one gets matched, the registering process ends, if not, common attributes + * will be tried by calling RegisterCommonEventListener() method. + * + * NOTE: The default implementation just apply attribute into the ui view returned by GetComponentRootView(), + * if this doesn't meet your requirement, go ahead to override this whole function as you want. + * + * @return true if the given event gets matched and is set properly, false for otherwise. + */ + virtual bool RegisterEventListener(uint16_t eventTypeId, jerry_value_t funcValue); + /** + * @brief Child class should call this to set common event listener to a given native view. + * + * @return true if any common event type matchs successfully, false if no match at all + */ + bool RegisterCommonEventListener(UIView& view, const uint16_t eventTypeId, const jerry_value_t funcValue); + /** + * @brief Child class should call this to set own special event setting/update actions. + * + * @return true if any common event type matchs successfully, false if no match at all + */ + virtual bool RegisterPrivateEventListener(uint16_t eventTypeId, jerry_value_t funcValue) + { + return false; + } + + /** + * @brief This is the entry to set all combined styles into one specific component, one default + * implementation is provided, which calls ApplyPrivateStyle() to try the component's private special + * style first, if one gets matched, the appling process ends, if not, common styles will be + * tried by calling ApplyCommonStyle() method. + * + * NOTE: The default implementation just apply styles into the ui view returned by GetComponentRootView(), + * if this doesn't meet your requirement, go ahead to override this whole function as you want. + * + * @return true if the given style gets matched and is set properly, false for otherwise. + */ + virtual bool ApplyStyle(const AppStyleItem *style); + /** + * @brief Used to set all common styles for all kinds of component. + * + * @return true if any common attribute key matchs successfully, false if no match at all + */ + bool ApplyCommonStyle(UIView& view, const AppStyleItem *style); + /** + * @brief Child class should call this to set own special attribute setting/update actions + * + * @return true if any common attribute key matchs successfully, false if no match at all + */ + virtual bool ApplyPrivateStyle(const AppStyleItem *style) + { + return false; + } + + /** + * @brief If a child component is a container, it should implement this method to add children into itself. + * This function returns true as default if child doesn't override it. + */ + virtual bool ProcessChildren() + { + return true; + } + + AppStyleManager *GetStyleManager() const + { + return styleManager_; + } + + jerry_value_t GetOptions() const + { + return options_; + } + + /** + * @brief combine RGB color by red, green, blue from int color value, + * + * @param [in] colorIntValue. + */ + ColorType GetRGBColor(uint32_t colorIntValue) const + { + uint32_t colorUintValue = colorIntValue; + uint8_t red8 = uint8_t((colorUintValue & TEXT_RED_COLOR_MASK) >> RED_COLOR_START_BIT); + uint8_t green8 = uint8_t((colorUintValue & TEXT_GREEN_COLOR_MASK) >> GREEN_COLOR_START_BIT); + uint8_t blue8 = uint8_t((colorUintValue & TEXT_BLUE_COLOR_MASK)); + return Color::GetColorFromRGB(red8, green8, blue8); + } + + jerry_value_t SetListForWatcher(jerry_value_t getter, jerry_value_t children); + void HandleListForDireactive(); + void AppendChildren(UIViewGroup *viewGroup); + bool AppendDescriptorOrElement(UIViewGroup *viewGroup, const jerry_value_t descriptorOrElement); + void AppendIfDescriptor(UIViewGroup *viewGroup, const jerry_value_t descriptor); + void AppendForDescriptor(UIViewGroup *viewGroup, const jerry_value_t descriptor); + void AppendElement(UIViewGroup *viewGroup, const jerry_value_t element); + void CreateDirectiveWatcher(jerry_value_t descriptor); + void UpdateDescriptor(UIViewGroup *viewGroup, const jerry_value_t descriptor); + void ReappendDescriptorOrElement(UIViewGroup *viewGroup, const jerry_value_t descriptor); + int32_t GetStyleNumValue(const AppStyleItem *style) const + { + return style->GetNumValue(); + } + uint16_t GetStylePropNameId(const AppStyleItem *style) const + { + return style->GetPropNameId(); + } + const char *GetStyleStrValue(const AppStyleItem *style) const + { + return style->GetStrValue(); + } + uint8_t GetStyleStrValueLen(const AppStyleItem *style) const + { + return style->GetStrValueLen(); + } + bool IsStyleValueTypeNum(const AppStyleItem *styleItem) const + { + return styleItem->GetValueType() == STYLE_PROP_VALUE_TYPE_NUMBER; + } + bool IsStyleValueTypeString(const AppStyleItem *styleItem) const + { + return styleItem->GetValueType() == STYLE_PROP_VALUE_TYPE_STRING; + } + int16_t GetHeight() const + { + return height_; + } + int16_t GetWidth() const + { + return width_; + } + + int32_t GetStylePixelValue(const AppStyleItem *style, int32_t defaultValue = 0) const; + int16_t GetStyleDegValue(const AppStyleItem *style, int16_t defaultValue = 0) const; + bool GetStyleColorValue(const AppStyleItem *style, uint32_t &color, uint8_t &alpha) const; + void SetPadding(UIView &view, const AppStyleItem& styleItem) const; + void SetLeftPadding(UIView &view, const AppStyleItem& styleItem) const; + void SetTopPadding(UIView &view, const AppStyleItem& styleItem) const; + void SetRightPadding(UIView &view, const AppStyleItem& styleItem) const; + void SetBottomPadding(UIView &view, const AppStyleItem& styleItem) const; + void SetLeftMargin(UIView &view, const AppStyleItem& styleItem) const; + void SetTopMargin(UIView &view, const AppStyleItem& styleItem) const; + void SetRightMargin(UIView &view, const AppStyleItem& styleItem) const; + void SetBottomMargin(UIView &view, const AppStyleItem& styleItem) const; + void SetMargin(UIView &view, const AppStyleItem& styleItem) const; + void SetBorderWidth(UIView &view, const AppStyleItem& styleItem) const; + void SetBorderColor(UIView &view, const AppStyleItem& styleItem) const; + void SetBorderRadius(UIView &view, const AppStyleItem& styleItem) const; + void SetBackgroundColor(UIView &view, const AppStyleItem& styleItem) const; + void SetOpacity(UIView &view, const AppStyleItem &styleItem) const; + +private: + /** + * @brief Used to set animation keyframes, such as transform, background-color, height etc. + * it is set as attribute, and support binding to data, so it can be changed dynamiclly. + * + * the following three functions will called in order + */ + void SetAnimationKeyFrames(const UIView& view, const AppStyleItem *styleItem); + void SetAnimationKeyFrames(const AppStyleItem *item); + void SetAnimationKeyFrames(int16_t keyId, int32_t valueFrom, int32_t valueTo); + /** + * @brief Used to set animation style, such as animation during, delay, iteration count etc. + * it is set as style, now it not support binding to data, so it can not be changed dynamiclly. + */ + void SetAnimationStyle(const UIView& view, const AppStyleItem *styleItem, const int16_t keyId); + /** + * @brief Record current component`s animation. All animations of components will be called when the whole page + * render complete. + */ + void RecordAnimation(); + /** + * @brief In updateView progress, the current component`s animation will be called immediately. + */ + void StartAnimation(); + void ReleaseTransitionParam(); + /** + * @brief Used to get animation item value. + * for example: tranformX from 100px to 200px, index = 1 to get from value, index = 2 to get to value. + * + * @return animation value, such as 100px + */ + int32_t GetAnimatorValue(char *animatorValue, const int8_t index, bool isOpacity = false) const; + + void ParseOptions(); + void ParseAttrs(jerry_value_t attrs); + void ParseEvent(jerry_value_t events); + /** + * @brief Apply combined styles into native view. + */ + void ApplyStyles(); + /** + * @brief This function will be called after the ApplyCommonStyle, make padding style work. + */ + bool RefreshRect() const; + void SetHeight(const AppStyleItem *styleItem); + void SetWidth(const AppStyleItem *styleItem); + void SetVisible(UIView& view, const AppStyleItem *styleItem) const; + void SetLeft(UIView& view, const AppStyleItem *styleItem) const; + void SetTop(UIView& view, const AppStyleItem *styleItem) const; + void SetClickEventListener(UIView& view, const jerry_value_t eventFunc, const uint16_t eventTypeId); + void SetLongPressEventListener(UIView& view, const jerry_value_t eventFunc, const uint16_t eventTypeId); + void SetSwipeEventListener(UIView& view, jerry_value_t eventFunc); +#ifdef JS_TOUCH_EVENT_SUPPORT + void SetTouchStartEventListener(UIView &view, jerry_value_t eventFunc, const uint16_t eventTypeId); + void SetTouchMoveEventListener(UIView &view, jerry_value_t eventFunc, const uint16_t eventTypeId); + void SetTouchEndEventListener(UIView &view, jerry_value_t eventFunc, const uint16_t eventTypeId); + void SetTouchCancelEventListener(UIView &view, jerry_value_t eventFunc, const uint16_t eventTypeId); + void SetKeyBoardEventListener(jerry_value_t eventFunc, const uint16_t eventTypeId); +#endif + /** + * @brief release common event listeners if any is set + */ + void ReleaseCommonEventListeners(); + void AppendDescriptorOrElements(UIViewGroup *viewGroup, const JSValue descriptorOrElements); + void ReLayoutChildrenIfNeeded(uint16_t attrKeyId) const; + void AddAnimationToList(const TransitionImpl *transitionImpl) const; + + AppStyleManager *styleManager_; + jerry_value_t nativeElement_; + jerry_value_t viewModel_; + jerry_value_t options_; + jerry_value_t children_; + ViewOnClickListener *onClickListener_; + ViewOnLongPressListener *onLongPressListener_; + ViewOnSwipeListener *onSwipeListener_; +#ifdef JS_TOUCH_EVENT_SUPPORT + ViewOnTouchStartListener *onTouchStartListener_; + ViewOnTouchMoveListener *onTouchMoveListener_; + ViewOnTouchCancelListener *onTouchCancelListener_; + ViewOnTouchEndListener *onTouchEndListener_; + KeyBoardEventListener *keyBoardEventListener_; +#endif + /** + * record view id, need to be released when this component get released + */ + char *viewId_; + uint16_t componentName_; + bool rendered_; + bool isAnimationKeyFramesSet_; + TransitionImpl *curTransitionImpl_; + TransitionParams *trans_; + jerry_value_t descriptors_; + Watcher *watchersHead_; + int16_t height_; + int16_t width_; +}; +} // namespace ACELite +} // namespace OHOS + +#endif // OHOS_ACELITE_COMPONENT_H diff --git a/src/core/components/component_factory.h b/src/core/components/component_factory.h new file mode 100755 index 0000000..bcc1862 --- /dev/null +++ b/src/core/components/component_factory.h @@ -0,0 +1,167 @@ +/* + * Copyright (c) 2020 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. + */ +#ifndef OHOS_ACELITE_COMPONENT_FACTORY_H +#define OHOS_ACELITE_COMPONENT_FACTORY_H + +#include "acelite_config.h" + +#ifdef FEATURE_COMPONENT_ANALOG_CLOCK +#include "analog_clock_component.h" +#include "clock_hand_component.h" +#endif // FEATURE_COMPONENT_ANALOG_CLOCK +#ifdef FEATURE_COMPONENT_CAMERA +#include "camera_component.h" +#endif // FEATURE_COMPONENT_CAMERA +#ifdef FEATURE_COMPONENT_CANVAS +#include "canvas_component.h" +#endif // FEATURE_COMPONENT_CANVAS +#include "chart_component.h" +#include "component.h" +#include "div_component.h" +#include "fatal_handler.h" +#include "image_component.h" +#include "input_component.h" +#include "js_fwk_common.h" +#include "key_parser.h" +#include "keys.h" +#include "list_component.h" +#include "marquee_component.h" +#include "non_copyable.h" +#include "picker_view_component.h" +#include "progress_component.h" +#include "slider_component.h" +#include "swiper_component.h" +#include "switch_component.h" +#include "image_animator_component.h" +#ifdef FEATURE_COMPONENT_TABS +#include "tab_bar_component.h" +#include "tab_content_component.h" +#include "tabs_component.h" +#endif // FEATURE_COMPONENT_TABS +#include "text_component.h" +#include "video_component.h" + +namespace OHOS { +namespace ACELite { +class ComponentFactory final : public MemoryHeap { +public: + ACE_DISALLOW_COPY_AND_MOVE(ComponentFactory); + ~ComponentFactory() {} + static Component* CreateComponent(uint16_t componentNameId, jerry_value_t options, jerry_value_t children) + { + if (!KeyParser::IsKeyValid(componentNameId)) { + return nullptr; + } + + JsAppContext* context = JsAppContext::GetInstance(); + if (context == nullptr) { + return nullptr; + } + AppStyleManager* styleManager = const_cast(context->GetStyleManager()); + + Component* component; + switch (componentNameId) { +#ifdef FEATURE_COMPONENT_CAMERA + case K_CAMERA: + component = new CameraComponent(options, children, styleManager); + break; +#endif +#ifdef FEATURE_COMPONENT_CANVAS + case K_CANVAS: + component = new CanvasComponent(options, children, styleManager); + break; +#endif // FEATURE_COMPONENT_CANVAS + case K_DIV: + component = new DivComponent(options, children, styleManager, DivComponent::LayoutType::FLEX); + break; + case K_STACK: + component = new DivComponent(options, children, styleManager, DivComponent::LayoutType::POSITION); + break; + case K_IMAGE: + component = new ImageComponent(options, children, styleManager); + break; + case K_IMAGE_ANIMATOR: + component = new ImageAnimatorComponent(options, children, styleManager); + break; + case K_PROGRESS: + component = new ProgressComponent(options, children, styleManager); + break; +#ifdef FEATURE_COMPONENT_TABS + case K_TAB_BAR: + component = new TabBarComponent(options, children, styleManager); + break; + case K_TAB_CONTENT: + component = new TabContentComponent(options, children, styleManager); + break; + case K_TABS: + component = new TabsComponent(options, children, styleManager); + break; +#endif // FEATURE_COMPONENT_TABS + case K_TEXT: + component = new TextComponent(options, children, styleManager); + break; + case K_SWIPER: + component = new SwiperComponent(options, children, styleManager); + break; + case K_SWITCH: + component = new SwitchComponent(options, children, styleManager); + break; + case K_SLIDER: + component = new SliderComponent(options, children, styleManager); + break; + case K_LIST: + component = new ListComponent(options, children, styleManager); + break; + case K_LIST_ITEM: + component = new DivComponent(options, children, styleManager, DivComponent::LayoutType::FLEX); + break; +#ifdef FEATURE_COMPONENT_ANALOG_CLOCK + case K_CLOCK_HAND: + component = new ClockHandComponent(options, children, styleManager); + break; + case K_ANALOG_CLOCK: + component = new AnalogClockComponent(options, children, styleManager); + break; +#endif // FEATURE_COMPONENT_ANALOG_CLOCK + case K_INPUT: + component = new InputComponent(options, children, styleManager); + break; + case K_MARQUEE: + component = new MarqueeComponent(options, children, styleManager); + break; + case K_CHART: + component = new ChartComponent(options, children, styleManager); + break; + case K_PICKER_VIEW: + component = new PickerViewComponent(options, children, styleManager); + break; +#ifdef FEATURE_COMPONENT_VIDEO + case K_VIDEO: + component = new VideoComponent(options, children, styleManager); + break; +#endif // FEATURE_COMPONENT_VIDEO + default: + component = nullptr; + break; + } + + FatalHandler::GetInstance().AttachComponentNode(component); + return component; + } +}; +} // namespace ACELite +} // namespace OHOS + +#endif // OHOS_ACELITE_COMPONENT_FACTORY_H diff --git a/src/core/components/component_utils.cpp b/src/core/components/component_utils.cpp new file mode 100755 index 0000000..d48c8b0 --- /dev/null +++ b/src/core/components/component_utils.cpp @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2020 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. + */ + +#include "component_utils.h" +#include "ace_log.h" +#include "component.h" + +namespace OHOS { +namespace ACELite { +UIView* ComponentUtils::GetViewFromBindingObject(jerry_value_t value) +{ + Component* component = GetComponentFromBindingObject(value); + return component ? component->GetComponentRootView() : nullptr; +} + +Component* ComponentUtils::GetComponentFromBindingObject(jerry_value_t value) +{ + if (IS_UNDEFINED(value)) { + return nullptr; + } + + Component* component = nullptr; + bool isBinded = jerry_get_object_native_pointer(value, reinterpret_cast(&component), nullptr); + if (!isBinded || (component == nullptr)) { + return nullptr; + } + return component; +} +} // namespace ACELite +} // namespace OHOS diff --git a/src/core/components/component_utils.h b/src/core/components/component_utils.h new file mode 100755 index 0000000..fff9c61 --- /dev/null +++ b/src/core/components/component_utils.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2020 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. + */ + +#ifndef OHOS_ACELITE_COMPONENT_UTILS_H +#define OHOS_ACELITE_COMPONENT_UTILS_H + +#include "js_fwk_common.h" +#include "non_copyable.h" +#include "ui_view.h" + +namespace OHOS { +namespace ACELite { +class Component; + +class ComponentUtils final : public MemoryHeap { +public: + ACE_DISALLOW_COPY_AND_MOVE(ComponentUtils); + ~ComponentUtils() {} + /** + * @brief Easy method to get the root UIView from the component binded to the given JS object. + */ + static UIView* GetViewFromBindingObject(jerry_value_t value); + /** + * @brief Easy method to get the the component binded to the given JS object. + */ + static Component* GetComponentFromBindingObject(jerry_value_t value); +}; +} // namespace ACELite +} // namespace OHOS +#endif // OHOS_ACELITE_COMPONENT_UTILS_H diff --git a/src/core/components/div_component.cpp b/src/core/components/div_component.cpp new file mode 100755 index 0000000..738c35f --- /dev/null +++ b/src/core/components/div_component.cpp @@ -0,0 +1,190 @@ +/* + * Copyright (c) 2020 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. + */ + +#include "div_component.h" +#include "ace_log.h" +#include "key_parser.h" +#include "keys.h" + +namespace OHOS { +namespace ACELite { +DivComponent::DivComponent(jerry_value_t options, + jerry_value_t children, + AppStyleManager* styleManager, + const LayoutType type) + : Component(options, children, styleManager), + isSecondaryAxisAlignSet_(false), + combinedStyle_(nullptr), + nativeView_(nullptr), + layoutType_(FLEX) +{ + SetComponentName(K_DIV); + // get combined style for style items + combinedStyle_ = GetStyleManager()->GetCombinedStyle(); + layoutType_ = type; +} + +bool DivComponent::CreateNativeViews() +{ + if (layoutType_ == LayoutType::POSITION) { + nativeView_ = new UIViewGroup(); + } else { + nativeView_ = new FlexLayout(); + } + + if (nativeView_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "div create fail"); + return false; + } + + return true; +} + +void DivComponent::ReleaseNativeViews() +{ + if (nativeView_) { + delete nativeView_; + nativeView_ = nullptr; + } +} + +inline UIView *DivComponent::GetComponentRootView() const +{ + return nativeView_; +} + +bool DivComponent::ApplyPrivateStyle(const AppStyleItem* style) +{ + bool applyResult = true; + // set layout + if (layoutType_ == LayoutType::POSITION) { + // do nothing + applyResult = false; + } else { + // Set default value + if (!isSecondaryAxisAlignSet_) { + (reinterpret_cast(nativeView_))->SetSecondaryAxisAlign(OHOS::ALIGN_START); + } + uint16_t stylePropNameId = GetStylePropNameId(style); + if (!KeyParser::IsKeyValid(stylePropNameId)) { + return false; + } + const char * const strValue = GetStyleStrValue(style); + if (strValue == nullptr) { + return false; + } + uint16_t valueId = KeyParser::ParseKeyId(strValue, GetStyleStrValueLen(style)); + switch (stylePropNameId) { + case K_FLEX_DIRECTION: { + switch (valueId) { + case K_COLUMN: + (reinterpret_cast(nativeView_))->SetLayoutDirection(LAYOUT_VER); + break; + case K_ROW: + (reinterpret_cast(nativeView_))->SetLayoutDirection(LAYOUT_HOR); + break; + case K_ROW_REVERSE: + (reinterpret_cast(nativeView_))->SetLayoutDirection(LAYOUT_HOR_R); + break; + case K_COLUMN_REVERSE: + (reinterpret_cast(nativeView_))->SetLayoutDirection(LAYOUT_VER_R); + break; + default: + applyResult = false; + break; + } + break; + } + case K_JUSTIFY_CONTENT: { + switch (valueId) { + case K_FLEX_START: + (reinterpret_cast(nativeView_))->SetMajorAxisAlign(OHOS::ALIGN_START); + break; + case K_FLEX_END: + (reinterpret_cast(nativeView_))->SetMajorAxisAlign(OHOS::ALIGN_END); + break; + case K_CENTER: + (reinterpret_cast(nativeView_))->SetMajorAxisAlign(OHOS::ALIGN_CENTER); + break; + case K_SPACE_BETWEEN: + (reinterpret_cast(nativeView_))->SetMajorAxisAlign(OHOS::ALIGN_BETWEEN); + break; + case K_SPACE_AROUND: + (reinterpret_cast(nativeView_))->SetMajorAxisAlign(OHOS::ALIGN_EVENLY); + break; + default: + applyResult = false; + break; + } + break; + } + case K_ALIGN_ITEMS: { + switch (valueId) { + case K_FLEX_START: + (reinterpret_cast(nativeView_))->SetSecondaryAxisAlign(OHOS::ALIGN_START); + break; + case K_FLEX_END: + (reinterpret_cast(nativeView_))->SetSecondaryAxisAlign(OHOS::ALIGN_END); + break; + case K_CENTER: + (reinterpret_cast(nativeView_))->SetSecondaryAxisAlign(OHOS::ALIGN_CENTER); + break; + default: + applyResult = false; + break; + } + if (applyResult) + isSecondaryAxisAlignSet_ = true; + break; + } + case K_FLEX_WRAP: { + if (valueId == K_WRAP) { + (reinterpret_cast(nativeView_))->SetFlexWrap(FlexLayout::WRAP); + } else { + (reinterpret_cast(nativeView_))->SetFlexWrap(FlexLayout::NOWRAP); + } + break; + } + default: + applyResult = false; + break; + } + } + + return applyResult; +} + +bool DivComponent::ProcessChildren() +{ + if (!nativeView_) { + return false; + } + + // first, add all children to this container + AppendChildren(nativeView_); + // second, layout them + if (layoutType_ != LayoutType::POSITION) { + nativeView_->LayoutChildren(); + } + + return true; +} + +void DivComponent::PostUpdate(uint16_t attrKeyId, bool updateResult) +{ + nativeView_->LayoutChildren(); +} +} // namespace ACELite +} // namespace OHOS diff --git a/src/core/components/div_component.h b/src/core/components/div_component.h new file mode 100755 index 0000000..8055685 --- /dev/null +++ b/src/core/components/div_component.h @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2020 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. + */ + +#ifndef OHOS_ACELITE_DIV_COMPONENT_H +#define OHOS_ACELITE_DIV_COMPONENT_H +#include "component.h" +#include "flex_layout.h" +#include "non_copyable.h" + +namespace OHOS { +namespace ACELite { +class DivComponent final : public Component { +public: + enum LayoutType { + POSITION, + FLEX + }; + + ACE_DISALLOW_COPY_AND_MOVE(DivComponent); + DivComponent() = delete; + DivComponent(jerry_value_t options, jerry_value_t children, AppStyleManager* styleManager, const LayoutType type); + ~DivComponent() override {} + +protected: + bool CreateNativeViews() override; + void ReleaseNativeViews() override; + UIView *GetComponentRootView() const override; + bool ApplyPrivateStyle(const AppStyleItem* style) override; + bool ProcessChildren() override; + void PostUpdate(uint16_t attrKeyId, bool updateResult) override; + +private: + bool isSecondaryAxisAlignSet_; + const AppStyle* combinedStyle_; + UIViewGroup* nativeView_; + LayoutType layoutType_; +}; +} // namespace ACELite +} // namespace OHOS + +#endif // OHOS_ACELITE_DIV_COMPONENT_H diff --git a/src/core/components/event_listener.cpp b/src/core/components/event_listener.cpp new file mode 100755 index 0000000..e670351 --- /dev/null +++ b/src/core/components/event_listener.cpp @@ -0,0 +1,165 @@ +/* + * Copyright (c) 2020 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. + */ +#include "event_listener.h" +#include "ace_log.h" +#include "jerryscript.h" +#include "js_fwk_common.h" +#include "root_view.h" + +namespace OHOS { +namespace ACELite { +#ifdef JS_TOUCH_EVENT_SUPPORT +KeyBoardEventListener::KeyBoardEventListener(jerry_value_t fn, const uint16_t id) +{ + fn_ = jerry_acquire_value(fn); + id_ = id; +} + +KeyBoardEventListener::~KeyBoardEventListener() +{ + jerry_release_value(fn_); +} + +bool KeyBoardEventListener::OnKeyAct(UIView &view, const KeyEvent &event) +{ + if (jerry_value_is_undefined(fn_)) { + return false; + } + + jerry_value_t *args = ConvertKeyEventInfo(event); + jerry_release_value(CallJSFunctionOnRoot(fn_, args, 1)); + ClearEventListener(args, 1); + return true; +} + +ViewOnTouchStartListener::ViewOnTouchStartListener(jerry_value_t fn, uint16_t id) +{ + fn_ = jerry_acquire_value(fn); + id_ = id; +} + +ViewOnTouchStartListener::~ViewOnTouchStartListener() +{ + jerry_release_value(fn_); +} + +bool ViewOnTouchStartListener::OnPress(UIView &view, const PressEvent &event) +{ + return CallBaseEvent(fn_, event, id_); +} + +ViewOnTouchMoveListener::ViewOnTouchMoveListener(jerry_value_t fn, uint16_t id) +{ + fn_ = jerry_acquire_value(fn); + id_ = id; +} + +ViewOnTouchMoveListener::~ViewOnTouchMoveListener() +{ + jerry_release_value(fn_); +} + +bool ViewOnTouchMoveListener::OnDrag(UIView &view, const DragEvent &event) +{ + if (jerry_value_is_undefined(fn_)) { + return false; + } + + jerry_value_t *args = ConvertDragEventInfo(event, id_); + jerry_release_value(CallJSFunctionOnRoot(fn_, args, 1)); + ClearEventListener(args, 1); + return true; +} + +ViewOnTouchEndListener::ViewOnTouchEndListener(jerry_value_t fn, uint16_t id) +{ + fn_ = jerry_acquire_value(fn); + id_ = id; +} + +ViewOnTouchEndListener::~ViewOnTouchEndListener() +{ + jerry_release_value(fn_); +} + +bool ViewOnTouchEndListener::OnRelease(UIView &view, const ReleaseEvent &event) +{ + return CallBaseEvent(fn_, event, id_); +} + +ViewOnTouchCancelListener::ViewOnTouchCancelListener(jerry_value_t fn, uint16_t id) +{ + fn_ = jerry_acquire_value(fn); + id_ = id; +} + +ViewOnTouchCancelListener::~ViewOnTouchCancelListener() +{ + jerry_release_value(fn_); +} +bool ViewOnTouchCancelListener::OnCancel(UIView &view, const CancelEvent &event) +{ + return CallBaseEvent(fn_, event, id_); +} +#endif // JS_TOUCH_EVENT_SUPPORT + +bool ViewOnSwipeListener::OnDragStart(UIView &view, const DragEvent &event) +{ + UNUSED(view); + UNUSED(event); + HILOG_DEBUG(HILOG_MODULE_ACE, "OnDragStart received"); + return true; +} + +bool ViewOnSwipeListener::OnDragEnd(UIView &view, const DragEvent &event) +{ + UNUSED(view); + if (jerry_value_is_undefined(fn_)) { + HILOG_ERROR(HILOG_MODULE_ACE, "OnDragEnd received, but no JS function to call"); + return false; + } + + HILOG_DEBUG(HILOG_MODULE_ACE, "OnDragEnd received"); + + jerry_value_t directionValue; + switch (event.GetDragDirection()) { + case DragEvent::DIRECTION_LEFT_TO_RIGHT: + directionValue = jerry_create_string(reinterpret_cast(SWIPE_RIGHT)); + break; + case DragEvent::DIRECTION_RIGHT_TO_LEFT: + directionValue = jerry_create_string(reinterpret_cast(SWIPE_LEFT)); + break; + case DragEvent::DIRECTION_TOP_TO_BOTTOM: + directionValue = jerry_create_string(reinterpret_cast(SWIPE_DOWN)); + break; + case DragEvent::DIRECTION_BOTTOM_TO_TOP: + directionValue = jerry_create_string(reinterpret_cast(SWIPE_UP)); + break; + default: + directionValue = UNDEFINED; + break; + } + + jerry_value_t args[1] = {jerry_create_object()}; + const char * const directionName = "direction"; + jerry_value_t result = jerryx_set_property_str(args[0], directionName, directionValue); + if (!jerry_value_is_error(result)) { + CallJSFunctionAutoRelease(fn_, UNDEFINED, args, 1); + } + ReleaseJerryValue(result, args[0], directionValue, VA_ARG_END_FLAG); + return true; +} +} // namespace ACELite +} // namespace OHOS diff --git a/src/core/components/event_listener.h b/src/core/components/event_listener.h new file mode 100755 index 0000000..58767c7 --- /dev/null +++ b/src/core/components/event_listener.h @@ -0,0 +1,380 @@ +/* + * Copyright (c) 2020 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. + */ + +#ifndef OHOS_ACELITE_EVENT_LISTENER_H +#define OHOS_ACELITE_EVENT_LISTENER_H + +#include "js_fwk_common.h" +#include "keys.h" +#include "non_copyable.h" +#include "ui_checkbox.h" +#include "ui_list.h" +#include "ui_radiobutton.h" +#include "ui_scroll_view.h" +#include "ui_slider.h" +#include "ui_toggle_button.h" + +namespace OHOS { +namespace ACELite { +class StateChangeListener final : public UICheckBox::OnChangeListener { +public: + ACE_DISALLOW_COPY_AND_MOVE(StateChangeListener); + StateChangeListener(jerry_value_t fn, uint16_t componentId) + { + fn_ = jerry_acquire_value(fn); + componentId_ = componentId; + isChanging_ = false; + radio_ = nullptr; + state_ = UICheckBox::UICheckBoxState::UNSELECTED; + } + + bool OnChange(UICheckBox::UICheckBoxState state) override + { + if (radio_ != nullptr) { + state_ = state; + } + if (isChanging_) { + return false; + } + isChanging_ = true; + jerry_value_t args[1]; + bool result = (UICheckBox::UICheckBoxState::SELECTED == state) ? true : false; + jerry_value_t resultProp = jerry_create_boolean(result); + args[0] = jerry_create_object(); + const char * const checked = "checked"; + ReleaseJerryValue(jerryx_set_property_str(args[0], checked, resultProp), resultProp, VA_ARG_END_FLAG); + if (radio_ != nullptr) { + const char * const name = "name"; + if (radio_->GetName() != nullptr) { + jerry_value_t nameVal = jerry_create_string(reinterpret_cast(radio_->GetName())); + ReleaseJerryValue(jerryx_set_property_str(args[0], name, nameVal), nameVal, VA_ARG_END_FLAG); + } + } + jerry_value_t globalObject = jerry_get_global_object(); + jerry_value_t appViewModel = jerryx_get_property_str(globalObject, ATTR_APP); + if (jerry_value_is_function(fn_)) { + CallJSFunctionAutoRelease(fn_, appViewModel, args, 1); + } + ReleaseJerryValue(globalObject, appViewModel, args[0], VA_ARG_END_FLAG); + isChanging_ = false; + return true; + } + + void TriggerChange(UIView *view) + { + UICheckBox::UICheckBoxState state = UICheckBox::UICheckBoxState::UNSELECTED; + if (componentId_ == K_SWITCH) { + UIToggleButton *toggleButton = reinterpret_cast(view); + if (toggleButton) { + state = (toggleButton->GetState()) ? UICheckBox::UICheckBoxState::SELECTED + : UICheckBox::UICheckBoxState::UNSELECTED; + } + } else if (componentId_ == K_CHECKBOX) { + UICheckBox *checkbox = reinterpret_cast(view); + if (checkbox) { + state = checkbox->GetState(); + } + } else if (radio_ != nullptr) { + state = radio_->GetState(); + if (state == state_) { + return; + } + } + OnChange(state); + } + + void SetView(UIRadioButton* radioButton) + { + radio_ = radioButton; + } + + ~StateChangeListener() + { + jerry_release_value(fn_); + } + +private: + jerry_value_t fn_; + uint16_t componentId_; + UIRadioButton* radio_; + UICheckBox::UICheckBoxState state_; + bool isChanging_; // the flag to avoid change event cycle execute +}; + +class ViewOnClickListener final : public UIView::OnClickListener { +public: + ACE_DISALLOW_COPY_AND_MOVE(ViewOnClickListener); + explicit ViewOnClickListener(jerry_value_t fn, const uint16_t id) + : fn_(jerry_acquire_value(fn)), +#ifdef JS_TOUCH_EVENT_SUPPORT + id_(id), +#endif + changeListener_(nullptr) {} + ~ViewOnClickListener() + { + jerry_release_value(fn_); + } + + bool OnClick(UIView &view, const ClickEvent &event) override + { + if (changeListener_) { + changeListener_->TriggerChange(&view); + } + if (jerry_value_is_undefined(fn_)) { + return false; + } +#ifdef JS_TOUCH_EVENT_SUPPORT + jerry_value_t *args = ConvertBaseEventInfo(event, id_); + jerry_release_value(CallJSFunctionOnRoot(fn_, args, 1)); + ClearEventListener(args, 1); +#else + jerry_release_value(CallJSFunctionOnRoot(fn_, nullptr, 0)); +#endif + return true; + } + + void SetComponentListener(StateChangeListener *changeListener) + { + changeListener_ = changeListener; + } + +private: + jerry_value_t fn_; +#ifdef JS_TOUCH_EVENT_SUPPORT + uint16_t id_; +#endif + StateChangeListener *changeListener_; +}; + +class ViewOnLongPressListener final : public UIView::OnLongPressListener { +public: + ACE_DISALLOW_COPY_AND_MOVE(ViewOnLongPressListener); + explicit ViewOnLongPressListener(jerry_value_t fn, const uint16_t id) : +#ifdef JS_TOUCH_EVENT_SUPPORT + id_(id), +#endif + fn_(jerry_acquire_value(fn)) {} + + ~ViewOnLongPressListener() + { + jerry_release_value(fn_); + } + + bool OnLongPress(UIView &view, const LongPressEvent &event) override + { + if (jerry_value_is_undefined(fn_)) { + return false; + } +#ifdef JS_TOUCH_EVENT_SUPPORT + jerry_value_t *args = ConvertBaseEventInfo(event, id_); + jerry_release_value(CallJSFunctionOnRoot(fn_, args, 1)); + ClearEventListener(args, 1); +#else + jerry_release_value(CallJSFunctionOnRoot(fn_, nullptr, 0)); +#endif + return true; + } + +private: +#ifdef JS_TOUCH_EVENT_SUPPORT + uint16_t id_; +#endif + jerry_value_t fn_; +}; + +#ifdef JS_TOUCH_EVENT_SUPPORT +class ViewOnTouchStartListener final : public UIView::OnTouchListener { +public: + ACE_DISALLOW_COPY_AND_MOVE(ViewOnTouchStartListener); + explicit ViewOnTouchStartListener(jerry_value_t fn, const uint16_t id); + ~ViewOnTouchStartListener(); + bool OnPress(UIView &view, const PressEvent &event) override; + +private: + jerry_value_t fn_; + uint16_t id_; +}; + +class ViewOnTouchMoveListener final : public UIView::OnDragListener { +public: + ACE_DISALLOW_COPY_AND_MOVE(ViewOnTouchMoveListener); + ViewOnTouchMoveListener(jerry_value_t fn, const uint16_t id); + ~ViewOnTouchMoveListener(); + bool OnDrag(UIView &view, const DragEvent &event) override; + +private: + jerry_value_t fn_; + uint16_t id_; +}; + +class ViewOnTouchEndListener final : public UIView::OnTouchListener { +public: + ACE_DISALLOW_COPY_AND_MOVE(ViewOnTouchEndListener); + ViewOnTouchEndListener(jerry_value_t fn, const uint16_t id); + ~ViewOnTouchEndListener(); + bool OnRelease(UIView &view, const ReleaseEvent &event) override; + +private: + jerry_value_t fn_; + uint16_t id_; +}; + +class ViewOnTouchCancelListener final : public UIView::OnTouchListener { +public: + ACE_DISALLOW_COPY_AND_MOVE(ViewOnTouchCancelListener); + ViewOnTouchCancelListener(jerry_value_t fn, const uint16_t id); + ~ViewOnTouchCancelListener(); + bool OnCancel(UIView &view, const CancelEvent &event) override; + +private: + jerry_value_t fn_; + uint16_t id_; +}; + +class KeyBoardEventListener final : public RootView::OnKeyActListener { +public: + ACE_DISALLOW_COPY_AND_MOVE(KeyBoardEventListener); + explicit KeyBoardEventListener(jerry_value_t fn, const uint16_t id); + ~KeyBoardEventListener(); + bool OnKeyAct(UIView &view, const KeyEvent &event) override; + +private: + jerry_value_t fn_; + uint16_t id_; +}; +#endif + +class ViewOnSwipeListener final : public UIView::OnDragListener { +public: + ACE_DISALLOW_COPY_AND_MOVE(ViewOnSwipeListener); + explicit ViewOnSwipeListener(jerry_value_t fn) + : SWIPE_LEFT("left"), SWIPE_RIGHT("right"), SWIPE_UP("up"), SWIPE_DOWN("down") + { + fn_ = jerry_acquire_value(fn); + } + + ~ViewOnSwipeListener() + { + jerry_release_value(fn_); + } + + bool OnDragStart(UIView& view, const DragEvent& event) override; + bool OnDragEnd(UIView &view, const DragEvent &event) override; + +private: + jerry_value_t fn_; + const char * const SWIPE_LEFT; + const char * const SWIPE_RIGHT; + const char * const SWIPE_UP; + const char * const SWIPE_DOWN; +}; + +class SliderEventListener final : public UISlider::UISliderEventListener { +public: + ACE_DISALLOW_COPY_AND_MOVE(SliderEventListener); + SliderEventListener() : bindChangeFunc_(UNDEFINED) {} + ~SliderEventListener() + { + jerry_release_value(bindChangeFunc_); + } + void OnChange(int16_t progress) override + { + jerry_value_t knobValue = jerry_create_number(progress); + jerry_value_t args[1]; + args[0] = jerry_create_object(); + constexpr char sliderAttrProgress[] = "progress"; + jerry_value_t result = jerryx_set_property_str(args[0], sliderAttrProgress, knobValue); + if (!jerry_value_is_error(result)) { + CallJSFunctionAutoRelease(bindChangeFunc_, UNDEFINED, args, 1); + } + ReleaseJerryValue(result, args[0], knobValue, VA_ARG_END_FLAG); + } + + void SetBindChangeFuncName(jerry_value_t bindChageFunc) + { + bindChangeFunc_ = jerry_acquire_value(bindChageFunc); + } + +private: + jerry_value_t bindChangeFunc_; +}; + +class ListEventListener final : public ListScrollListener { +public: + ACE_DISALLOW_COPY_AND_MOVE(ListEventListener); + ListEventListener() + : bindScrollStartFunc_(UNDEFINED), bindScrollEndFunc_(UNDEFINED), bindScrollSelectedFunc_(UNDEFINED) + { + } + ~ListEventListener() + { + ReleaseJerryValue(bindScrollStartFunc_, bindScrollEndFunc_, bindScrollSelectedFunc_, VA_ARG_END_FLAG); + } + + void EventExcute(const int16_t index, jerry_value_t bindScrollFunc) const + { + int8_t currentState = this->GetScrollState(); + jerry_value_t currentStateValue = jerry_create_number(currentState); + jerry_value_t componentIndex = jerry_create_number(index); + jerry_value_t args[ARGS_LEN] = {currentStateValue, componentIndex}; + CallJSFunctionAutoRelease(bindScrollFunc, UNDEFINED, args, ARGS_LEN); + ReleaseJerryValue(currentStateValue, componentIndex, VA_ARG_END_FLAG); + } + +// list specific event switch +#ifdef FEATURE_LIST_SPECIFIC_EVENT_ENABLE + void OnScrollStart(int16_t index, UIView *view) override + { + EventExcute(index, bindScrollStartFunc_); + } + void OnItemSelected(int16_t index, UIView *view) override + { + EventExcute(index, bindScrollSelectedFunc_); + } + void SetBindScrollStartFuncName(jerry_value_t bindScrollStartFunc) + { + if (!jerry_value_is_undefined(bindScrollStartFunc)) { + bindScrollStartFunc_ = jerry_acquire_value(bindScrollStartFunc); + } + } + void SetBindScrollItemSelectedFuncName(jerry_value_t bindScrollItemSelectedFunc) + { + if (!jerry_value_is_undefined(bindScrollItemSelectedFunc)) { + bindScrollSelectedFunc_ = jerry_acquire_value(bindScrollItemSelectedFunc); + } + } +#endif // FEATURE_LIST_SPECIFIC_EVENT_ENABLE + + void OnScrollEnd(int16_t index, UIView* view) override + { + EventExcute(index, bindScrollEndFunc_); + } + + void SetBindScrollEndFuncName(jerry_value_t bindScrollEndFunc) + { + if (!jerry_value_is_undefined(bindScrollEndFunc)) { + bindScrollEndFunc_ = jerry_acquire_value(bindScrollEndFunc); + } + } + +private: + static constexpr int8_t ARGS_LEN = 2; + jerry_value_t bindScrollStartFunc_; + jerry_value_t bindScrollEndFunc_; + jerry_value_t bindScrollSelectedFunc_; +}; +} // namespace ACELite +} // namespace OHOS +#endif // OHOS_ACELITE_EVENT_LISTENER_H diff --git a/src/core/components/image_animator_component.cpp b/src/core/components/image_animator_component.cpp new file mode 100755 index 0000000..f06c194 --- /dev/null +++ b/src/core/components/image_animator_component.cpp @@ -0,0 +1,380 @@ +/* + * Copyright (c) 2020 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. + */ +#include "image_animator_component.h" +#include "ace_log.h" +#include "handler.h" +#include "key_parser.h" +#include "keys.h" +#include "time_util.h" + +namespace OHOS { +namespace ACELite { +constexpr char ITR_INFINITE[] = "infinite"; +constexpr char FUNC_START[] = "start"; +constexpr char FUNC_PAUSE[] = "pause"; +constexpr char FUNC_RESUME[] = "resume"; +constexpr char FUNC_STOP[] = "stop"; +constexpr char FUNC_GET_STATE[] = "getState"; +constexpr char STATUS_PLAYING[] = "playing"; +constexpr char STATUS_PAUSED[] = "paused"; +constexpr char STATUS_STOPED[] = "stopped"; + +ImageAnimatorComponent::ImageAnimatorComponent(jerry_value_t options, + jerry_value_t children, + AppStyleManager *styleManager) + : Component(options, children, styleManager), + viewGroup_(nullptr), + imageAnimator_(nullptr), + onStopListener_(nullptr), + frames_(nullptr), + duration_(nullptr), + framesSize_(0) +{ + SetComponentName(K_IMAGE_ANIMATOR); + RegisterNamedFunction(FUNC_START, StartAnimator); + RegisterNamedFunction(FUNC_PAUSE, PauseAnimator); + RegisterNamedFunction(FUNC_RESUME, ResumeAnimator); + RegisterNamedFunction(FUNC_STOP, StopAnimator); + RegisterNamedFunction(FUNC_GET_STATE, GetAnimatorState); +} + +bool ImageAnimatorComponent::CreateNativeViews() +{ + viewGroup_ = new UIViewGroup(); + + if (viewGroup_ == nullptr) { + return false; + } + viewGroup_->SetStyle(STYLE_BACKGROUND_OPA, OPA_TRANSPARENT); + imageAnimator_ = new UIImageAnimatorView(); + + if (imageAnimator_ == nullptr) { + delete (viewGroup_); + viewGroup_ = nullptr; + return false; + } + + viewGroup_->Add(imageAnimator_); + imageAnimator_->SetRepeat(true); + imageAnimator_->SetReverse(false); + imageAnimator_->SetSizeFixed(true); + return true; +} + +void ImageAnimatorComponent::ReleaseNativeViews() +{ + ReleaseFrame(); + ACE_FREE(duration_); + ACE_DELETE(viewGroup_); + ACE_DELETE(imageAnimator_); + ACE_DELETE(onStopListener_); +} + +inline UIView *ImageAnimatorComponent::GetComponentRootView() const +{ + return viewGroup_; +} + +bool ImageAnimatorComponent::SetPrivateAttribute(uint16_t attrKeyId, jerry_value_t attrValue) +{ + switch (attrKeyId) { + case K_FIXED_SIZE: + return ParseToFixedSize(attrValue); + case K_IMAGES: + return ParseToFrames(attrValue); + case K_ITERATION: + return ParseToIteration(attrValue); + case K_REVERSE: + return ParseToReverse(attrValue); + case K_DURATION: + return ParseToDuration(attrValue); + default: + return false; + } +} + +void ImageAnimatorComponent::PostRender() +{ + UpdateAnimator(); +} + +void ImageAnimatorComponent::PostUpdate(uint16_t attrKeyId, bool updateResult) +{ + if ((K_IMAGES == attrKeyId) || (K_DURATION == attrKeyId)) { + UpdateAnimator(); + } +} + +bool ImageAnimatorComponent::RegisterPrivateEventListener(uint16_t eventTypeId, jerry_value_t funcValue) +{ + if (eventTypeId == K_STOP) { + onStopListener_ = new ImageAnimatorStopListener(funcValue); + if (onStopListener_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "Failed to register stop event listener."); + return false; + } + imageAnimator_->SetAnimatorStopListener(onStopListener_); + return true; + } + + return false; +} + +bool ImageAnimatorComponent::ParseToFixedSize(jerry_value_t value) const +{ + if (!jerry_value_is_boolean(value)) { + HILOG_ERROR(HILOG_MODULE_ACE, "fixedsize is not a boolean value."); + return false; + } + imageAnimator_->SetSizeFixed(jerry_get_boolean_value(value)); + return true; +} + +void ImageAnimatorComponent::ReleaseFrame() +{ + if (frames_ == nullptr) { + return; + } + + for (uint8_t idx = 0; idx < framesSize_; ++idx) { + ImageAnimatorInfo frame = frames_[idx]; + if (frame.imageInfo != nullptr) { + ace_free(const_cast(frame.imageInfo)); + frame.imageInfo = nullptr; + } + } + ACE_FREE(frames_); +} + +bool ImageAnimatorComponent::ParseToFrames(jerry_value_t value) +{ + ReleaseFrame(); + if (!jerry_value_is_array(value)) { + HILOG_ERROR(HILOG_MODULE_ACE, "images is not a array value."); + return false; + } + framesSize_ = jerry_get_array_length(value); + if (framesSize_ == 0) { + HILOG_ERROR(HILOG_MODULE_ACE, "images is empty."); + return false; + } + if (framesSize_ > UINT8_MAX) { + framesSize_ = UINT8_MAX; + } + + frames_ = static_cast(ace_malloc(sizeof(ImageAnimatorInfo) * framesSize_)); + if (frames_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "fail to set images cause by out of memory."); + return false; + } + for (uint16_t idx = 0; idx < framesSize_; ++idx) { + jerry_value_t image = jerry_get_property_by_index(value, idx); + if (jerry_value_is_undefined(image) || !jerry_value_is_object(image)) { + HILOG_WARN(HILOG_MODULE_ACE, "the %d frame is null or not a object.", idx); + continue; + } + + jerry_value_t src = jerryx_get_property_str(image, ATTR_SRC); + if (jerry_value_is_undefined(src)) { + jerry_release_value(image); + HILOG_WARN(HILOG_MODULE_ACE, "the src of %d frame is null.", src); + continue; + } + + ImageAnimatorInfo frame = {0}; + frame.imageInfo = ParseImageSrc(src); + jerry_release_value(src); + frame.width = JerryGetIntegerProperty(image, ATTR_WIDTH); + frame.height = JerryGetIntegerProperty(image, ATTR_HEIGHT); + Point point = {0}; + point.x = JerryGetIntegerProperty(image, ATTR_LEFT); + point.y = JerryGetIntegerProperty(image, ATTR_TOP); + frame.pos = point; + jerry_release_value(image); + frames_[idx] = frame; + } + return true; +} + +bool ImageAnimatorComponent::ParseToIteration(jerry_value_t value) const +{ + uint16_t length = 0; + char *iteration = MallocStringOf(value, &length); + if (iteration == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "fail to set iteration cause by out of memory."); + return false; + } + + if (length == 0 || !strcmp(iteration, ITR_INFINITE)) { + imageAnimator_->SetRepeat(true); + } else { + imageAnimator_->SetRepeat(false); + imageAnimator_->SetRepeatTimes(strtol(iteration, nullptr, DEC)); + } + + ace_free(iteration); + iteration = nullptr; + return true; +} + +bool ImageAnimatorComponent::ParseToReverse(jerry_value_t value) const +{ + if (!jerry_value_is_boolean(value)) { + HILOG_ERROR(HILOG_MODULE_ACE, "reverse is not a boolean value."); + return false; + } + imageAnimator_->SetReverse(jerry_get_boolean_value(value)); + return true; +} + +bool ImageAnimatorComponent::ParseToDuration(jerry_value_t value) +{ + ACE_FREE(duration_); + uint16_t length = 0; + duration_ = MallocStringOf(value, &length); + if (length == 0) { + HILOG_ERROR(HILOG_MODULE_ACE, "fail to set duration cause by out of memory"); + ACE_FREE(duration_); + return false; + } + return true; +} + +void ImageAnimatorComponent::UpdateAnimator() const +{ + if (frames_ != nullptr && framesSize_ != 0 && duration_ != nullptr) { + imageAnimator_->SetImageAnimatorSrc(reinterpret_cast(frames_), framesSize_); + + int32_t millions = ParseToMilliseconds(duration_); + uint16_t timeOfUpdate = 0; + if (millions > 0) { + timeOfUpdate = static_cast(millions / framesSize_); + if (timeOfUpdate == 0) { + timeOfUpdate = DEFAULT_TASK_PERIOD; + } + } + imageAnimator_->SetTimeOfUpdate(timeOfUpdate); + imageAnimator_->Start(); + } +} + +jerry_value_t ImageAnimatorComponent::StartAnimator(const jerry_value_t func, + const jerry_value_t dom, + const jerry_value_t args[], + const jerry_length_t size) +{ + ImageAnimatorComponent *component = + static_cast(ComponentUtils::GetComponentFromBindingObject(dom)); + if (component == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "Failed to get DOM."); + return UNDEFINED; + } + UIImageAnimatorView *animator = component->GetImageAnimator(); + + if (animator != nullptr) { + animator->Start(); + } + + return UNDEFINED; +} +jerry_value_t ImageAnimatorComponent::PauseAnimator(const jerry_value_t func, + const jerry_value_t dom, + const jerry_value_t args[], + const jerry_length_t size) +{ + ImageAnimatorComponent *component = + static_cast(ComponentUtils::GetComponentFromBindingObject(dom)); + if (component == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "Failed to get DOM."); + return UNDEFINED; + } + UIImageAnimatorView *animator = component->GetImageAnimator(); + + if (animator != nullptr) { + animator->Pause(); + } + + return UNDEFINED; +} +jerry_value_t ImageAnimatorComponent::ResumeAnimator(const jerry_value_t func, + const jerry_value_t dom, + const jerry_value_t args[], + const jerry_length_t size) +{ + ImageAnimatorComponent *component = + static_cast(ComponentUtils::GetComponentFromBindingObject(dom)); + if (component == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "Failed to get DOM."); + return UNDEFINED; + } + UIImageAnimatorView *animator = component->GetImageAnimator(); + + if (animator != nullptr) { + animator->Resume(); + } + + return UNDEFINED; +} +jerry_value_t ImageAnimatorComponent::StopAnimator(const jerry_value_t func, + const jerry_value_t dom, + const jerry_value_t args[], + const jerry_length_t size) +{ + ImageAnimatorComponent *component = + static_cast(ComponentUtils::GetComponentFromBindingObject(dom)); + if (component == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "Failed to get DOM."); + return UNDEFINED; + } + UIImageAnimatorView *animator = component->GetImageAnimator(); + + if (animator != nullptr) { + animator->Stop(); + } + + return UNDEFINED; +} + +jerry_value_t ImageAnimatorComponent::GetAnimatorState(const jerry_value_t func, + const jerry_value_t dom, + const jerry_value_t args[], + const jerry_length_t size) +{ + ImageAnimatorComponent *component = + static_cast(ComponentUtils::GetComponentFromBindingObject(dom)); + if (component == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "Failed to get DOM."); + return UNDEFINED; + } + UIImageAnimatorView *animator = component->GetImageAnimator(); + + if (animator != nullptr) { + uint8_t state = animator->GetState(); + + switch (state) { + case Animator::START: + return jerry_create_string(reinterpret_cast(STATUS_PLAYING)); + case Animator::PAUSE: + return jerry_create_string(reinterpret_cast(STATUS_PAUSED)); + case Animator::STOP: + return jerry_create_string(reinterpret_cast(STATUS_STOPED)); + default: + break; + } + } + return UNDEFINED; +} +} // namespace ACELite +} // namespace OHOS diff --git a/src/core/components/image_animator_component.h b/src/core/components/image_animator_component.h new file mode 100755 index 0000000..3926576 --- /dev/null +++ b/src/core/components/image_animator_component.h @@ -0,0 +1,112 @@ +/* + * Copyright (c) 2020 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. + */ + +#ifndef OHOS_ACELITE_IMAGE_ANIMATOR_COMPNENT_H +#define OHOS_ACELITE_IMAGE_ANIMATOR_COMPNENT_H + +#include "component.h" +#include "non_copyable.h" +#include "ui_image_animator.h" + +namespace OHOS { +namespace ACELite { +class ImageAnimatorStopListener final : public UIImageAnimatorView::AnimatorStopListener { +public: + ACE_DISALLOW_COPY_AND_MOVE(ImageAnimatorStopListener); + explicit ImageAnimatorStopListener(jerry_value_t fn) + { + fn_ = jerry_acquire_value(fn); + } + ~ImageAnimatorStopListener() + { + if (!jerry_value_is_undefined(fn_)) { + jerry_release_value(fn_); + } + } + + void OnAnimatorStop(UIView& view) override + { + if (jerry_value_is_undefined(fn_)) { + return; + } + + jerry_release_value(CallJSFunction(fn_, UNDEFINED, nullptr, 0)); + } + +private: + jerry_value_t fn_; +}; + +class ImageAnimatorComponent final : public Component { +public: + ImageAnimatorComponent() = delete; + ImageAnimatorComponent(jerry_value_t options, jerry_value_t children, AppStyleManager* styleManager); + ~ImageAnimatorComponent() override {} + +protected: + bool CreateNativeViews() override; + void ReleaseNativeViews() override; + UIView *GetComponentRootView() const override; + bool SetPrivateAttribute(uint16_t attrKeyId, jerry_value_t attrValue) override; + void PostRender() override; + void PostUpdate(uint16_t attrKeyId, bool updateResult) override; + bool RegisterPrivateEventListener(uint16_t eventTypeId, jerry_value_t funcValue) override; + +private: + void ReleaseFrame(); + bool ParseToFixedSize(jerry_value_t value) const; + bool ParseToFrames(jerry_value_t value); + bool ParseToIteration(jerry_value_t value) const; + bool ParseToReverse(jerry_value_t value) const; + bool ParseToDuration(jerry_value_t value); + void UpdateAnimator() const; + + UIImageAnimatorView* GetImageAnimator() const + { + return imageAnimator_; + } + + static jerry_value_t StartAnimator(const jerry_value_t func, + const jerry_value_t dom, + const jerry_value_t args[], + const jerry_length_t size); + static jerry_value_t PauseAnimator(const jerry_value_t func, + const jerry_value_t dom, + const jerry_value_t args[], + const jerry_length_t size); + static jerry_value_t ResumeAnimator(const jerry_value_t func, + const jerry_value_t dom, + const jerry_value_t args[], + const jerry_length_t size); + static jerry_value_t StopAnimator(const jerry_value_t func, + const jerry_value_t dom, + const jerry_value_t args[], + const jerry_length_t size); + static jerry_value_t GetAnimatorState(const jerry_value_t func, + const jerry_value_t dom, + const jerry_value_t args[], + const jerry_length_t size); + + UIViewGroup *viewGroup_; + UIImageAnimatorView *imageAnimator_; + ImageAnimatorStopListener* onStopListener_; + ImageAnimatorInfo *frames_; + char *duration_; + uint8_t framesSize_; +}; +} // namespace ACELite +} // namespace OHOS + +#endif // OHOS_ACELITE_IMAGE_ANIMATOR_COMPNENT_H diff --git a/src/core/components/image_component.cpp b/src/core/components/image_component.cpp new file mode 100755 index 0000000..9542ba0 --- /dev/null +++ b/src/core/components/image_component.cpp @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2020 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. + */ + +#include "image_component.h" +#include "ace_log.h" +#include "ace_mem_base.h" +#include "js_app_context.h" +#include "js_fwk_common.h" +#include "key_parser.h" +#include "keys.h" + +namespace OHOS { +namespace ACELite { +ImageComponent::ImageComponent(jerry_value_t options, jerry_value_t children, AppStyleManager *styleManager) + : Component(options, children, styleManager), imageView_(nullptr) +{ + SetComponentName(K_IMAGE); +} + +bool ImageComponent::CreateNativeViews() +{ + imageView_ = new UIImageView(); + + if (imageView_ == nullptr) { + return false; + } else { + // set default value + imageView_->SetAutoEnable(false); + const int16_t defaultOpacity = 0; + imageView_->SetStyle(STYLE_BACKGROUND_OPA, defaultOpacity); + } + return true; +} + +void ImageComponent::ReleaseNativeViews() +{ + if (imageView_) { + delete imageView_; + imageView_ = nullptr; + } +} + +inline UIView *ImageComponent::GetComponentRootView() const +{ + return imageView_; +} + +bool ImageComponent::SetPrivateAttribute(uint16_t attrKeyId, jerry_value_t attrValue) +{ + bool setResult = true; + switch (attrKeyId) { + case K_SRC: { + char *src = const_cast(ParseImageSrc(attrValue)); + imageView_->SetSrc(src); + ACE_FREE(src); + break; + } + default: + setResult = false; + break; + } + + return setResult; +} + +bool ImageComponent::ApplyPrivateStyle(const AppStyleItem *style) +{ + uint16_t styleKey = style->GetPropNameId(); + switch (styleKey) { + case K_OPACITY: { + SetOpacity(*imageView_, *style); + return true; + } + default: + return false; + } +} +} // namespace ACELite +} // namespace OHOS diff --git a/src/core/components/image_component.h b/src/core/components/image_component.h new file mode 100755 index 0000000..3f1e2ee --- /dev/null +++ b/src/core/components/image_component.h @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2020 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. + */ + +#ifndef OHOS_ACELITE_IMAGE_COMPONENT_H +#define OHOS_ACELITE_IMAGE_COMPONENT_H + +#include "component.h" +#include "key_parser.h" +#include "layout/flex_layout.h" +#include "non_copyable.h" +#include "ui_image_view.h" + +namespace OHOS { +namespace ACELite { +class ImageComponent final : public Component { +public: + ACE_DISALLOW_COPY_AND_MOVE(ImageComponent); + ImageComponent() = delete; + ImageComponent(jerry_value_t options, jerry_value_t children, AppStyleManager *styleManager); + ~ImageComponent() override {} + +protected: + bool CreateNativeViews() override; + void ReleaseNativeViews() override; + UIView *GetComponentRootView() const override; + bool SetPrivateAttribute(uint16_t attrKeyId, jerry_value_t attrValue) override; + bool ApplyPrivateStyle(const AppStyleItem *style) override; + +private: + UIImageView *imageView_; +}; +} // namespace ACELite +} // namespace OHOS + +#endif // OHOS_ACELITE_IMAGE_COMPONENT_H diff --git a/src/core/components/input_component.cpp b/src/core/components/input_component.cpp new file mode 100755 index 0000000..14f2f39 --- /dev/null +++ b/src/core/components/input_component.cpp @@ -0,0 +1,537 @@ +/* + * Copyright (c) 2020 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. + */ + +#include "input_component.h" +#include "ace_log.h" +#include "ace_mem_base.h" +#include "js_app_context.h" +#include "js_fwk_common.h" +#include "key_parser.h" +#include "keys.h" +#include "ui_button.h" +#include "font/ui_font_header.h" + +namespace OHOS { +namespace ACELite { +bool InputComponent::CreateNativeViews() +{ + CreateCheckboxOrRadio(); + if ((checkbox_ == nullptr) && (radioButton_ == nullptr)) { + button_ = new UILabelButton(); + if (button_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "create button failed"); + return false; + } + // set font family + if (!CopyFontFamily(fontFamily_, DEFAULT_FONT_FAMILY)) { + return false; + } + const uint8_t defaultWidth = 100; + const uint8_t defaultHeight = 50; + button_->SetWidth(defaultWidth); + button_->SetHeight(defaultHeight); + button_->SetStateForStyle(UIButton::ButtonState::PRESSED); + button_->SetStyle(STYLE_BACKGROUND_OPA, OPA_OPAQUE); + button_->SetStateForStyle(UIButton::ButtonState::RELEASED); + button_->SetStyle(STYLE_BACKGROUND_OPA, OPA_OPAQUE); + } + return (checkbox_ != nullptr) || (button_ != nullptr) || (radioButton_ != nullptr); +} + +void InputComponent::CreateCheckboxOrRadio() +{ + jerry_value_t attrsPropValue = jerryx_get_property_str(options_, ATTR_ATTRS); + // create component according to attribute type + const char * const attrType = "type"; + jerry_value_t typeValHandler = jerryx_get_property_str(attrsPropValue, attrType); + if (!jerry_value_is_undefined(typeValHandler)) { + uint16_t len = 0; + char *type = MallocStringOf(typeValHandler, &len); + uint16_t typeId = KeyParser::ParseKeyId(type, len); + if (typeId == K_CHECKBOX) { + checkbox_ = new UICheckBox(); + if (checkbox_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "create checkbox failed."); + } + } else if (typeId == K_RADIO) { + // get the property name + const char * const nameAttr = "name"; + char *name = nullptr; + jerry_value_t nameAttrVal = jerryx_get_property_str(attrsPropValue, nameAttr); + if (!jerry_value_is_undefined(nameAttrVal)) { + name = MallocStringOf(nameAttrVal); + } + jerry_release_value(nameAttrVal); + if (name == nullptr) { + const char * const tmpNameVal = ""; + radioButton_ = new UIRadioButton(tmpNameVal); + } else { + radioButton_ = new UIRadioButton(name); + } + ACE_FREE(name); + if (radioButton_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "create radioButton failed"); + } + } + ACE_FREE(type); + } + ReleaseJerryValue(typeValHandler, attrsPropValue, VA_ARG_END_FLAG); +} + +void InputComponent::ReleaseNativeViews() +{ + if (checkbox_ != nullptr) { + delete checkbox_; + checkbox_ = nullptr; + } + if (button_ != nullptr) { + delete button_; + button_ = nullptr; + } + if (radioButton_ != nullptr) { + delete radioButton_; + radioButton_ = nullptr; + } + if (changeListener_ != nullptr) { + delete changeListener_; + changeListener_ = nullptr; + } + if (clickListener_ != nullptr) { + delete clickListener_; + clickListener_ = nullptr; + } + ACE_FREE(textValue_); + ACE_FREE(fontFamily_); + ACE_FREE(normalBackGroundImg_); + ACE_FREE(pressedBackGroundImg_); +} +bool InputComponent::SetPrivateAttribute(uint16_t attrKeyId, jerry_value_t attrValue) +{ + switch (attrKeyId) { + case K_CHECKED: + // set the state of checkbox and radioButton + if ((checkbox_ != nullptr) || (radioButton_ != nullptr)) { + if (jerry_value_is_boolean(attrValue)) { + bool checked = jerry_get_boolean_value(attrValue); + UICheckBox::UICheckBoxState state = + checked ? UICheckBox::UICheckBoxState::SELECTED : UICheckBox::UICheckBoxState::UNSELECTED; + if (checkbox_ != nullptr) { + checkbox_->SetState(state); + } else { + radioButton_->SetState(state); + } + return true; + } else { + HILOG_ERROR(HILOG_MODULE_ACE, "the checkbox checked is error value"); + return false; + } + } + break; + case K_VALUE: + if (button_ != nullptr) { + ACE_FREE(textValue_); + textValue_ = MallocStringOf(attrValue); + return true; + } + break; + case K_NAME: + if (radioButton_ != nullptr) { + char *name = MallocStringOf(attrValue); + UIRadioButton *radio = static_cast(radioButton_); + if (name == nullptr) { + const char * const tmpName = ""; + radio->SetName(tmpName); + } else { + radio->SetName(name); + ACE_FREE(name); + } + return true; + } + break; + default: + break; + } + return false; +} + +bool InputComponent::RegisterPrivateEventListener(uint16_t eventTypeId, jerry_value_t funcValue) +{ + if (eventTypeId == K_CHANGE) { + if ((checkbox_ != nullptr) || (radioButton_ != nullptr)) { + if (checkbox_ != nullptr) { + changeListener_ = new StateChangeListener(funcValue, K_CHECKBOX); + } else { + changeListener_ = new StateChangeListener(funcValue, K_RADIO); + } + if (changeListener_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "create change listener failed"); + return false; + } + return true; + } + } else if (eventTypeId == K_CLICK) { + clickListener_ = new ViewOnClickListener(funcValue, eventTypeId); + if (clickListener_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "create click listener failed"); + return false; + } + return true; + } + return false; +} + +bool InputComponent::ApplyPrivateStyle(const AppStyleItem *style) +{ + if (button_ == nullptr) { + return HandleImage(*style); + } + bool result = true; + uint16_t styleKey = GetStylePropNameId(style); + switch (styleKey) { + case K_FONT_SIZE: + result = SetFontSize(style); + break; + case K_FONT_FAMILY: + if (IsStyleValueTypeString(style)) { + // the style would be freed after this method + result = CopyFontFamily(fontFamily_, GetStyleStrValue(style)); + } else { + result = false; + } + break; + case K_TEXT_ALIGN: + result = SetTextAlign(style); + break; + case K_COLOR: + result = SetColor(*style); + break; + case K_BACKGROUND_COLOR: + result = SetBackgroundColor(*style); + break; + case K_BACKGROUND_IMAGE: + result = HandleButtonBackGroundImg(*style); + break; + case K_MARGIN: { + button_->SetStateForStyle(UIButton::ButtonState::RELEASED); + SetMargin(*button_, *style); + button_->SetStateForStyle(UIButton::ButtonState::PRESSED); + SetMargin(*button_, *style); + break; + } + case K_MARGIN_BOTTOM: { + button_->SetStateForStyle(UIButton::ButtonState::RELEASED); + SetBottomMargin(*button_, *style); + button_->SetStateForStyle(UIButton::ButtonState::PRESSED); + SetBottomMargin(*button_, *style); + break; + } + case K_MARGIN_LEFT: { + button_->SetStateForStyle(UIButton::ButtonState::RELEASED); + SetLeftMargin(*button_, *style); + button_->SetStateForStyle(UIButton::ButtonState::PRESSED); + SetLeftMargin(*button_, *style); + break; + } + case K_MARGIN_RIGHT: { + button_->SetStateForStyle(UIButton::ButtonState::RELEASED); + SetRightMargin(*button_, *style); + button_->SetStateForStyle(UIButton::ButtonState::PRESSED); + SetRightMargin(*button_, *style); + break; + } + case K_MARGIN_TOP: { + button_->SetStateForStyle(UIButton::ButtonState::RELEASED); + SetTopMargin(*button_, *style); + button_->SetStateForStyle(UIButton::ButtonState::PRESSED); + SetTopMargin(*button_, *style); + break; + } + case K_PADDING: + button_->SetStateForStyle(UIButton::ButtonState::RELEASED); + SetPadding(*button_, *style); + button_->SetStateForStyle(UIButton::ButtonState::PRESSED); + SetPadding(*button_, *style); + break; + case K_PADDING_BOTTOM: + button_->SetStateForStyle(UIButton::ButtonState::RELEASED); + SetBottomPadding(*button_, *style); + button_->SetStateForStyle(UIButton::ButtonState::PRESSED); + SetBottomPadding(*button_, *style); + break; + case K_PADDING_LEFT: + button_->SetStateForStyle(UIButton::ButtonState::RELEASED); + SetLeftPadding(*button_, *style); + button_->SetStateForStyle(UIButton::ButtonState::PRESSED); + SetLeftPadding(*button_, *style); + break; + case K_PADDING_RIGHT: + button_->SetStateForStyle(UIButton::ButtonState::RELEASED); + SetRightPadding(*button_, *style); + button_->SetStateForStyle(UIButton::ButtonState::PRESSED); + SetRightPadding(*button_, *style); + break; + case K_PADDING_TOP: { + button_->SetStateForStyle(UIButton::ButtonState::RELEASED); + SetTopPadding(*button_, *style); + button_->SetStateForStyle(UIButton::ButtonState::PRESSED); + SetTopPadding(*button_, *style); + break; + } + case K_BORDER_BOTTOM_WIDTH: + case K_BORDER_LEFT_WIDTH: + case K_BORDER_RIGHT_WIDTH: + case K_BORDER_TOP_WIDTH: + case K_BORDER_WIDTH: { + button_->SetStateForStyle(UIButton::ButtonState::RELEASED); + SetBorderWidth(*button_, *style); + button_->SetStateForStyle(UIButton::ButtonState::PRESSED); + SetBorderWidth(*button_, *style); + break; + } + case K_BORDER_BOTTOM_COLOR: + case K_BORDER_LEFT_COLOR: + case K_BORDER_RIGHT_COLOR: + case K_BORDER_TOP_COLOR: + case K_BORDER_COLOR: { + button_->SetStateForStyle(UIButton::ButtonState::RELEASED); + SetBorderColor(*button_, *style); + button_->SetStateForStyle(UIButton::ButtonState::PRESSED); + SetBorderColor(*button_, *style); + break; + } + case K_BORDER_RADIUS: { + button_->SetStateForStyle(UIButton::ButtonState::RELEASED); + SetBorderRadius(*button_, *style); + button_->SetStateForStyle(UIButton::ButtonState::PRESSED); + SetBorderRadius(*button_, *style); + break; + } + default: + result = false; + break; + } + return result; +} + +bool InputComponent::HandleImage(const AppStyleItem &style) +{ + if ((checkbox_ != nullptr) || (radioButton_ != nullptr)) { + uint16_t styleKey = GetStylePropNameId(&style); + if (styleKey == K_BACKGROUND_IMAGE) { + return HandleButtonBackGroundImg(style); + } + } + return false; +} + +bool InputComponent::SetBackgroundColor(const AppStyleItem &style) +{ + if (style.GetPseudoClassType() != PSEUDO_CLASS_ACTIVE) { + // let parent handle the normal state background color style, + // will be set for released state style of ui button + button_->SetStateForStyle(UIButton::ButtonState::PRESSED); + Component::SetBackgroundColor(*button_, style); + button_->SetStateForStyle(UIButton::ButtonState::RELEASED); + Component::SetBackgroundColor(*button_, style); + return true; + } + uint32_t color = 0; + uint8_t alpha = OPA_OPAQUE; + if (!GetStyleColorValue(&style, color, alpha)) { + return false; + } + pressedBackGroundColorValue_ = color; + pressedOpacityValue_ = alpha; + return true; +} + +bool InputComponent::SetColor(const AppStyleItem &style) const +{ + bool result = true; + uint32_t color = 0; + uint8_t alpha = OPA_OPAQUE; + if (GetStyleColorValue(&style, color, alpha)) { + button_->SetLabelStyle(STYLE_TEXT_COLOR, GetRGBColor(color).full); + button_->SetLabelStyle(STYLE_TEXT_OPA, alpha); + } else { + result = false; + } + return result; +} + +bool InputComponent::SetTextAlign(const AppStyleItem *style) const +{ + bool result = true; + if (IsStyleValueTypeString(style) && GetStyleStrValue(style)) { + uint16_t valueId = KeyParser::ParseKeyId(GetStyleStrValue(style), GetStyleStrValueLen(style)); + switch (valueId) { + case K_LEFT: + button_->SetAlign(UITextLanguageAlignment::TEXT_ALIGNMENT_LEFT); + break; + case K_CENTER: + button_->SetAlign(UITextLanguageAlignment::TEXT_ALIGNMENT_CENTER); + break; + case K_RIGHT: + button_->SetAlign(UITextLanguageAlignment::TEXT_ALIGNMENT_RIGHT); + break; + default: + HILOG_ERROR(HILOG_MODULE_ACE, "the value of text-align in input component is error"); + result = false; + break; + } + } else { + HILOG_ERROR(HILOG_MODULE_ACE, "the type of style align is error"); + result = false; + } + return result; +} + +bool InputComponent::SetFontSize(const AppStyleItem *style) +{ + bool result = true; + fontSize_ = GetStylePixelValue(style); + return result; +} + +bool InputComponent::HandleButtonBackGroundImg(const AppStyleItem &styleItem) +{ + bool result = false; + if (styleItem.GetValueType() == STYLE_PROP_VALUE_TYPE_STRING) { + const char * const url = styleItem.GetStrValue(); + char *filePath = CreatePathStrFromUrl(url); + if (filePath != nullptr) { + const char * const rootPath = JsAppContext::GetInstance()->GetCurrentAbilityPath(); + char *imagePath = RelocateResourceFilePath(rootPath, filePath); + if (imagePath == nullptr) { + ace_free(filePath); + filePath = nullptr; + return result; + } +#ifdef OHOS_ACELITE_PRODUCT_WATCH + // convert .png/jpeg/bmp to .bin subfix + CureImagePath(imagePath); +#endif // OHOS_ACELITE_PRODUCT_WATCH + if ((styleItem.GetPseudoClassType() == PSEUDO_CLASS_ACTIVE) + || (styleItem.GetPseudoClassType() == PSEUDO_CLASS_CHECKED)) { + // in case we don't free the buffer after using + ACE_FREE(pressedBackGroundImg_); + pressedBackGroundImg_ = imagePath; + } else { + // in case we don't free the buffer after using + ACE_FREE(normalBackGroundImg_); + normalBackGroundImg_ = imagePath; + } + ace_free(filePath); + filePath = nullptr; + result = true; + } + } + return result; +} + +void InputComponent::PostRender() +{ + if (button_ != nullptr) { + if (textValue_ != nullptr && fontFamily_ != nullptr) { + button_->SetFont(fontFamily_, fontSize_); + button_->SetText(textValue_); + } + if (clickListener_ != nullptr) { + button_->SetOnClickListener(clickListener_); + } + if (pressedBackGroundColorValue_ >= 0) { + button_->SetStateForStyle(UIButton::ButtonState::PRESSED); + button_->SetStyle(STYLE_BACKGROUND_COLOR, GetRGBColor(pressedBackGroundColorValue_).full); + button_->SetStyle(STYLE_BACKGROUND_OPA, pressedOpacityValue_); + } + if (normalBackGroundImg_ != nullptr || pressedBackGroundImg_ != nullptr) { + // make sure the normal and pressed image same in case user only set one of them + char *normalImg = (normalBackGroundImg_ == nullptr) ? pressedBackGroundImg_ : normalBackGroundImg_; + char *pressedImg = (pressedBackGroundImg_ == nullptr) ? normalBackGroundImg_ : pressedBackGroundImg_; + button_->SetImageSrc(normalImg, pressedImg); + } + } + DealEvent(); + ACE_FREE(normalBackGroundImg_); + ACE_FREE(pressedBackGroundImg_); +} + +void InputComponent::DealEvent() +{ + if ((checkbox_ == nullptr) && (radioButton_ == nullptr)) { + return; + } + if (changeListener_ != nullptr) { + if (checkbox_ != nullptr) { + checkbox_->SetOnChangeListener(changeListener_); + } else { + changeListener_->SetView(radioButton_); + radioButton_->SetOnChangeListener(changeListener_); + } + if (clickListener_ == nullptr) { + // trigger changeEvent + clickListener_ = new ViewOnClickListener(UNDEFINED, K_CLICK); + if (clickListener_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "create click listener failed"); + return; + } + } + } + if (clickListener_ != nullptr) { + clickListener_->SetComponentListener(changeListener_); + if (checkbox_ != nullptr) { + checkbox_->SetOnClickListener(clickListener_); + } else { + radioButton_->SetOnClickListener(clickListener_); + } + } + if (normalBackGroundImg_ != nullptr || pressedBackGroundImg_ != nullptr) { + // make sure the normal and pressed image same in case user only set one of them + char *normalImg = (normalBackGroundImg_ == nullptr) ? pressedBackGroundImg_ : normalBackGroundImg_; + char *pressedImg = (pressedBackGroundImg_ == nullptr) ? normalBackGroundImg_ : pressedBackGroundImg_; + if (checkbox_ != nullptr) { + checkbox_->SetImages(pressedImg, normalImg); + } else { + radioButton_->SetImages(pressedImg, normalImg); + } + } +} + +void InputComponent::PostUpdate(uint16_t attrKeyId, bool updateResult) +{ + if (!updateResult || !KeyParser::IsKeyValid(attrKeyId)) { + HILOG_ERROR(HILOG_MODULE_ACE, "input component post update check args failed"); + return; + } + if (button_ != nullptr) { + switch (attrKeyId) { + case K_VALUE: + if (textValue_ != nullptr) { + button_->SetText(textValue_); + } + break; + case K_FONT_SIZE: + case K_FONT_FAMILY: + if (fontFamily_ != nullptr) { + button_->SetFont(fontFamily_, fontSize_); + } + break; + default: + break; + } + } +} +} // namespace ACELite +} // namespace OHOS diff --git a/src/core/components/input_component.h b/src/core/components/input_component.h new file mode 100755 index 0000000..ef5ea9d --- /dev/null +++ b/src/core/components/input_component.h @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2020 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. + */ +#ifndef OHOS_ACELITE_INPUT_COMPONENT_H +#define OHOS_ACELITE_INPUT_COMPONENT_H +#include "component.h" +#include "key_parser.h" +#include "non_copyable.h" +#include "ui_checkbox.h" +#include "ui_label_button.h" +#include "ui_radiobutton.h" + +namespace OHOS { +namespace ACELite { +class InputComponent final : public Component { +public: + ACE_DISALLOW_COPY_AND_MOVE(InputComponent); + InputComponent() = delete; + InputComponent(jerry_value_t options, jerry_value_t children, AppStyleManager *manager) + : Component(options, children, manager), + options_(options), + checkbox_(nullptr), + button_(nullptr), + radioButton_(nullptr), + changeListener_(nullptr), + clickListener_(nullptr), + pressedBackGroundColorValue_(-1), + normalBackGroundImg_(nullptr), + pressedBackGroundImg_(nullptr), + textValue_(nullptr), + fontFamily_(nullptr), + fontSize_(DEFAULT_FONT_SIZE) + { + uint8_t pressedOpacityValue = 255; + pressedOpacityValue_ = pressedOpacityValue; + SetComponentName(K_INPUT); + } + ~InputComponent() override {} + bool CreateNativeViews() override; + void ReleaseNativeViews() override; + bool SetPrivateAttribute(uint16_t attrKeyId, jerry_value_t attrValue) override; + bool RegisterPrivateEventListener(uint16_t eventTypeId, jerry_value_t funcValue) override; + bool ApplyPrivateStyle(const AppStyleItem *style) override; + void PostRender() override; + void PostUpdate(uint16_t attrKeyId, bool updateResult) override; + +protected: + UIView *GetComponentRootView() const override + { + if (checkbox_ != nullptr) { + return checkbox_; + } else if (radioButton_ != nullptr) { + return radioButton_; + } else { + return button_; + } + } + +private: + bool SetTextAlign(const AppStyleItem *style) const; + bool SetFontSize(const AppStyleItem *style); + bool HandleButtonBackGroundImg(const AppStyleItem &styleItem); + void DealEvent(); + void CreateCheckboxOrRadio(); + bool SetBackgroundColor(const AppStyleItem &style); + bool SetColor(const AppStyleItem &style) const; + bool HandleImage(const AppStyleItem &style); + jerry_value_t options_; + UICheckBox *checkbox_; + UILabelButton *button_; + UIRadioButton *radioButton_; + StateChangeListener *changeListener_; + ViewOnClickListener *clickListener_; + int32_t pressedBackGroundColorValue_; + uint8_t pressedOpacityValue_; + char *normalBackGroundImg_; + char *pressedBackGroundImg_; + char *textValue_; + char *fontFamily_; + uint8_t fontSize_; +}; +} // namespace ACELite +} // namespace OHOS +#endif // OHOS_ACELITE_INPUT_COMPONENT_H \ No newline at end of file diff --git a/src/core/components/list_adapter.cpp b/src/core/components/list_adapter.cpp new file mode 100755 index 0000000..ba23195 --- /dev/null +++ b/src/core/components/list_adapter.cpp @@ -0,0 +1,370 @@ +/* + * Copyright (c) 2020 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. + */ + +#include "list_adapter.h" + +#include + +#include "ace_log.h" +#include "ace_mem_base.h" +#include "component_utils.h" +#include "directive/descriptor_utils.h" +#include "fatal_handler.h" +#if ENABLED(SECURE_C_FUNCTION) +#include "securec.h" +#endif // ENABLED(SECURE_C_FUNCTION) + +namespace OHOS { +namespace ACELite { +ListAdapter::ListAdapter() + : listItems_(nullptr), headNode_(nullptr), tailNode_(nullptr), itemsCount_(0), listItemsCount_(0) +{ +} + +ListAdapter::~ListAdapter() +{ + if (listItems_) { + delete[] listItems_; + listItems_ = nullptr; + } + + ViewNativePair *currentNode = headNode_; + ViewNativePair *nextNode = nullptr; + + if (currentNode == nullptr) { + HILOG_DEBUG(HILOG_MODULE_ACE, "the viewNativePair linked list is null"); + } + + // delete nativeElement in viewNativePair link list, then free viewNativePair link list. + while (currentNode != nullptr) { + nextNode = currentNode->next; + // only let list component release its children when the whole application + // is not in fatal error handling process, as FatalHandler will do the recycle + if (!FatalHandler::GetInstance().IsFatalErrorHandling()) { + DescriptorUtils::ReleaseDescriptorOrElement(currentNode->nativeElement); + } + ace_free(currentNode); + currentNode = nextNode; + } + headNode_ = nullptr; + tailNode_ = nullptr; + + itemsCount_ = 0; + listItemsCount_ = 0; +} + +bool ListAdapter::Initialize(const JSValue descriptors) +{ + // check the children can be initialized. + if (jerry_value_is_undefined(descriptors) || !jerry_value_is_array(descriptors)) { + HILOG_ERROR(HILOG_MODULE_ACE, "List adapter: initialize children failed!"); + return false; + } + + int16_t size = JSArray::Length(descriptors); + if ((size == 0) || (size >= INT16_MAX)) { + HILOG_ERROR(HILOG_MODULE_ACE, "List adapter: descriptors size invalid."); + return false; + } + listItems_ = new ListItemValue[size]; + // initialize the listItems_ array. + if (listItems_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "List adapter: listItems_ array failed to allocate memory!"); + return false; + } + + // generate the listItems_ array and return result. + return GenerateListItems(descriptors, size); +} + +bool ListAdapter::GenerateListItems(const JSValue descriptors, int16_t size) +{ + bool result = false; + int16_t listItemsIndex = 0; + int16_t startIndex = 0; + + for (int16_t index = 0; index < size; ++index) { + JSValue descriptorOrElement = JSArray::Get(descriptors, index); + if (JSUndefined::Is(descriptorOrElement)) { + HILOG_ERROR(HILOG_MODULE_ACE, "List adapter: get descriptorOrElement from descriptors failed!"); + continue; + } + + listItems_[listItemsIndex].descriptorOrElement = descriptorOrElement; + listItems_[listItemsIndex].startIndex = startIndex; + + // if it is a for type list-item + if (DescriptorUtils::IsForDescriptor(descriptorOrElement)) { + bool success = AddForDescriptorToList(descriptorOrElement, listItemsIndex); + if (!success) { + JSRelease(descriptorOrElement); + continue; + } + } else { // if it is a if or common type list-item + if (DescriptorUtils::IsIfDescriptor(descriptorOrElement)) { + bool isShown = DescriptorUtils::IsIfDescriptorShown(descriptorOrElement); + if (!isShown) { + JSRelease(descriptorOrElement); + result = true; + continue; + } + } + listItems_[listItemsIndex].getterRetList = UNDEFINED; + listItems_[listItemsIndex].itemsCount = 1; + } + + // sum of all descriptors list-items. + itemsCount_ = itemsCount_ + listItems_[listItemsIndex].itemsCount; + // sum of all descriptors. + listItemsCount_ = listItemsCount_ + 1; + startIndex = startIndex + listItems_[listItemsIndex].itemsCount; + listItemsIndex++; + + JSRelease(descriptorOrElement); + result = true; + } + return result; +} + +bool ListAdapter::AddForDescriptorToList(JSValue descriptorOrElement, int16_t listItemsIndex) const +{ + JSValue getterPropValue = jerryx_get_property_str(descriptorOrElement, DESCRIPTOR_ATTR_GETTER); + if (!jerry_value_is_function(getterPropValue)) { + ReleaseJerryValue(getterPropValue, VA_ARG_END_FLAG); + HILOG_ERROR(HILOG_MODULE_ACE, "List adapter: Getter argument is not a function."); + return false; + } + + JSValue getterRetList = CallJSFunctionOnRoot(getterPropValue, nullptr, 0); + // check whether result is an array + if (!jerry_value_is_array(getterRetList)) { + ReleaseJerryValue(getterPropValue, getterRetList, VA_ARG_END_FLAG); + HILOG_ERROR(HILOG_MODULE_ACE, "List adapter: fetch getter array error."); + return false; + } + + // save getterRetList. + listItems_[listItemsIndex].getterRetList = getterRetList; + // save getterRetList length.(the length is the count of current descriptor list-item) + listItems_[listItemsIndex].itemsCount = jerry_get_array_length(getterRetList); + ReleaseJerryValue(getterPropValue, getterRetList, VA_ARG_END_FLAG); + return true; +} + +// find listItemsIndex according the itemIndex +int16_t ListAdapter::CalculateItemIndex(int16_t itemIndex) const +{ + if (listItems_ == nullptr) { + return FAILED; + } + + for (int16_t listItemsIndex = 0; listItemsIndex < listItemsCount_; listItemsIndex++) { + if (itemIndex >= listItems_[listItemsIndex].startIndex && + itemIndex <= (listItems_[listItemsIndex].startIndex + listItems_[listItemsIndex].itemsCount - 1) && + itemIndex < itemsCount_) { + // found. + return listItemsIndex; + } + } + // not found. + return FAILED; +} + +// 1. get UIView according to index which will show in list. +// 2. delete inView if it is not null(if inView not null, it means this view is out of the list visible area, need +// delete.) if the UIView found belongs to "For type" child, need create it dynamically, or else just get it from native +// Element. +UIView *ListAdapter::GetView(UIView *inView, int16_t index) +{ + if (index < 0) { + HILOG_ERROR(HILOG_MODULE_ACE, "List adapter: GetView function parameter index error!"); + return nullptr; + } + + // find listItemsIndex according the item index + int16_t listItemsIndex = CalculateItemIndex(index); + if (listItemsIndex < 0) { + return nullptr; + } + // delete "For type" UIView that are not visible in list + if (inView != nullptr) { + // this function will check whether the inView is For type UIView, if it is, delete it, or else do nothing. + DeleteItem(inView); + } + + bool isFor = false; + JSValue element = GetElement(listItemsIndex, index, isFor); + if (jerry_value_is_undefined(element)) { + HILOG_ERROR(HILOG_MODULE_ACE, "List adapter: Failed to get element."); + return nullptr; + } + + // get rootview from nativeElement + UIView *newView = ComponentUtils::GetViewFromBindingObject(element); + if (newView == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "List adapter: Failed to get view from js object."); + jerry_release_value(element); + return nullptr; + } + + if (isFor) { + InsertItem(element, newView); + } + return newView; +} + +JSValue ListAdapter::GetElement(int16_t listItemsIndex, int16_t index, bool &isFor) const +{ + JSValue element = UNDEFINED; + JSValue descriptorOrElement = listItems_[listItemsIndex].descriptorOrElement; + JSValue getterRetList = listItems_[listItemsIndex].getterRetList; + int16_t startIndex = listItems_[listItemsIndex].startIndex; + isFor = DescriptorUtils::IsForDescriptor(descriptorOrElement); + // if it is a for or for+if type list-item, we need create view dynamically. + if (isFor) { + // get render argument + const int8_t argsLen = 2; + JSValue item = jerry_get_property_by_index(getterRetList, index - startIndex); + if (jerry_value_is_undefined(item)) { + HILOG_ERROR(HILOG_MODULE_ACE, "List adapter: Get item from getterRetList failed."); + return UNDEFINED; + } + JSValue itemIdx = jerry_create_number(index - startIndex); + JSValue args[argsLen]; + args[0] = {item}; + args[1] = {itemIdx}; + + // get render function + JSValue renderPropValue = jerryx_get_property_str(descriptorOrElement, DESCRIPTOR_ATTR_RENDER); + if (!jerry_value_is_function(renderPropValue)) { + HILOG_ERROR(HILOG_MODULE_ACE, "List adapter: Get View failed, render argument is not a function."); + ReleaseJerryValue(item, itemIdx, renderPropValue, VA_ARG_END_FLAG); + return UNDEFINED; + } + + // excute render function, get nativeElement + JSValue nativeElement = CallJSFunction(renderPropValue, UNDEFINED, args, argsLen); + if (jerry_value_is_undefined(nativeElement)) { + ReleaseJerryValue(item, itemIdx, renderPropValue, nativeElement, VA_ARG_END_FLAG); + return UNDEFINED; + } + + // if it is a for+if type list-item, here will ignore if attribure + if (DescriptorUtils::IsIfDescriptor(nativeElement)) { + element = DescriptorUtils::RenderIfDescriptor(nativeElement); + ReleaseJerryValue(nativeElement, VA_ARG_END_FLAG); + HILOG_ERROR(HILOG_MODULE_ACE, "List_adapter: list-item not support setting if and for attribute at once."); + } else { // if it is a for type list-item + element = nativeElement; + } + ReleaseJerryValue(item, itemIdx, renderPropValue, VA_ARG_END_FLAG); + } else if (DescriptorUtils::IsIfDescriptor(descriptorOrElement)) { // if it is a if type list-item + element = DescriptorUtils::RenderIfDescriptor(descriptorOrElement); + } else { // if it is a common list-item + element = descriptorOrElement; + } + return element; +} + +void ListAdapter::InsertItem(JSValue nativeElement, UIView *uiView) +{ + ViewNativePair *insertNode; + + insertNode = (ViewNativePair *)ace_malloc(sizeof(ViewNativePair)); + if (insertNode == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "List adapter: insertNode failed to allocate memory!"); + return; + } + + insertNode->nativeElement = nativeElement; + insertNode->uiView = uiView; + insertNode->next = nullptr; + + // if the link list is null, insertNode as head node. + if (headNode_ == nullptr) { + headNode_ = insertNode; + tailNode_ = headNode_; + return; + } + + tailNode_->next = insertNode; + // update the tailNode_ position + tailNode_ = insertNode; + return; +} + +void ListAdapter::DeleteItem(const UIView *uiView) +{ + ViewNativePair *delNode; + ViewNativePair *preNode; + + // delNode point to head node. + delNode = headNode_; + preNode = nullptr; + + // if viewNativePair not exsit, can not confirm whether the uiView is belongs For type child or common child, + // although it can not be deleted, does not effect rendering new View. + if (delNode == nullptr) { + return; + } + + // check this view is belongs For type child + while (delNode->uiView != uiView && delNode->next != nullptr) { + preNode = delNode; + delNode = delNode->next; + } + + if (delNode->uiView == uiView) { + // if found it, delete this view's nativeElement. + if (delNode == headNode_) { + // it is the head node. + headNode_ = delNode->next; + // update the tailNode_ position + if (headNode_ == nullptr) { + tailNode_ = headNode_; + } + } else if (preNode != nullptr) { + // it is not head node. + preNode->next = delNode->next; + // update the tailNode_ position + if (preNode->next == nullptr) { + tailNode_ = preNode; + } + } else { + // Do nothing + } + + DescriptorUtils::ReleaseDescriptorOrElement(delNode->nativeElement); + ace_free(delNode); + delNode = nullptr; + } else { + // if not found, it means this view is not belongs For type child, do nothing. + HILOG_INFO(HILOG_MODULE_ACE, + "not found the view can be free, it means this inView is not belongs For type child"); + } +} + +void ListAdapter::CleanUp() +{ + itemsCount_ = 0; + listItemsCount_ = 0; + + if (listItems_ != nullptr) { + delete[] listItems_; + listItems_ = nullptr; + } +} +} // namespace ACELite +} // namespace OHOS diff --git a/src/core/components/list_adapter.h b/src/core/components/list_adapter.h new file mode 100755 index 0000000..b88bf37 --- /dev/null +++ b/src/core/components/list_adapter.h @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2020 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. + */ + +#ifndef OHOS_ACELITE_LIST_ADAPTER_H +#define OHOS_ACELITE_LIST_ADAPTER_H + +#include "abstract_adapter.h" +#include "js_fwk_common.h" +#include "non_copyable.h" + +namespace OHOS { +namespace ACELite { +struct ListItemValue : public MemoryHeap { + JSValue descriptorOrElement; // "For type" child or common child + JSValue getterRetList; // "For type" list-item list data + int16_t itemsCount; // list-item inside "For type" child count + int16_t startIndex; // start index of list-item inside "For type" child + ListItemValue() : descriptorOrElement(UNDEFINED), getterRetList(UNDEFINED), itemsCount(0), startIndex(0) {} + ACE_DISALLOW_COPY_AND_MOVE(ListItemValue); +}; + +// mapping link list of UIView<--->nativeElement +struct ViewNativePair : public MemoryHeap { + JSValue nativeElement; + UIView *uiView; + ViewNativePair *next; + ACE_DISALLOW_COPY_AND_MOVE(ViewNativePair); +}; + +class ListAdapter final : public AbstractAdapter { +public: + ACE_DISALLOW_COPY_AND_MOVE(ListAdapter); + ListAdapter(); + ~ListAdapter(); + bool Initialize(const JSValue descriptors); + // Get the view from index. + // if inView is null, adapter will new a view. if not, adapter will delete the inView and new a view. + UIView *GetView(UIView *inView, int16_t index) override; + void DeleteView(UIView *&view) override {} + + uint16_t GetCount() override + { + return itemsCount_; + } + + void CleanUp(); + +private: + bool GenerateListItems(const JSValue descriptors, int16_t size); + int16_t CalculateItemIndex(int16_t itemIndex) const; + JSValue GetElement(int16_t listItemsIndex, int16_t index, bool &isFor) const; + bool AddForDescriptorToList(JSValue descriptorOrElement, int16_t listItemsIndex) const; + void InsertItem(JSValue nativeElement, UIView *uiView); + void DeleteItem(const UIView *uiView); + ListItemValue *listItems_; + ViewNativePair *headNode_; + ViewNativePair *tailNode_; + int16_t itemsCount_; + int16_t listItemsCount_; +}; +} // namespace ACELite +} // namespace OHOS +#endif // OHOS_ACELITE_LIST_ADAPTER_H diff --git a/src/core/components/list_component.cpp b/src/core/components/list_component.cpp new file mode 100755 index 0000000..c01df3a --- /dev/null +++ b/src/core/components/list_component.cpp @@ -0,0 +1,219 @@ +/* + * Copyright (c) 2020 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. + */ +#include "list_component.h" +#include "ace_log.h" +#include "component.h" +#include "component_utils.h" +#include "directive/descriptor_utils.h" +#include "fatal_handler.h" +#include "key_parser.h" +#include "keys.h" + +namespace OHOS { +namespace ACELite { +const char * const ListComponent::FUNC_SCROLLTO = "scrollTo"; +const char * const ListComponent::INDEX_SCROLLTO = "index"; +ListComponent::ListComponent(JSValue options, JSValue children, AppStyleManager *styleManager) + : Component(options, children, styleManager), + list_(nullptr), + adapter_(nullptr), + combinedStyle_(nullptr), + listEventListener_(nullptr), + flexDirectionDefault("column") +{ + SetComponentName(K_LIST); + RegisterNamedFunction(FUNC_SCROLLTO, ListScrollTo); + combinedStyle_ = styleManager->GetCombinedStyle(); +} + +// Create list +bool ListComponent::CreateNativeViews() +{ + if (combinedStyle_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "get list style failed"); + return false; + } + + // Step1. get list flex-direction + const AppStyleItem *item = combinedStyle_->GetStyleItemByNameId(K_FLEX_DIRECTION); + const char * const directionValue = (item == nullptr) ? flexDirectionDefault : item->GetStrValue(); + if (directionValue == nullptr) { + return false; + } + size_t directionValueLength = (item == nullptr) ? strlen(flexDirectionDefault) : item->GetStrValueLen(); + uint16_t directionValueId = KeyParser::ParseKeyId(directionValue, directionValueLength); + // Step2. create list + if (directionValueId == K_ROW) { + list_ = new UIList(UIList::HORIZONTAL); + } else { + list_ = new UIList(UIList::VERTICAL); + } + + if (list_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "create native list view failed"); + return false; + } + + // set list default attributes + list_->SetThrowDrag(true); + // list event listener position + const int16_t listenPosition = 10; + list_->SetSelectPosition(listenPosition); + + return true; +} + +void ListComponent::ReleaseNativeViews() +{ + if (list_) { + list_->RemoveAll(); + delete list_; + list_ = nullptr; + } + // only let list component release its children when the whole application + // is not in fatal error handling process, as FatalHandler will do the recycle + if (!FatalHandler::GetInstance().IsFatalErrorHandling()) { + if (!IS_UNDEFINED(GetDescriptors())) { + DescriptorUtils::ReleaseDescriptorOrElements(GetDescriptors()); + } + } + if (adapter_) { + delete adapter_; + adapter_ = nullptr; + } + if (listEventListener_) { + delete listEventListener_; + listEventListener_ = nullptr; + } +} + +UIView *ListComponent::GetComponentRootView() const +{ + return list_; +} + +bool ListComponent::RegisterPrivateEventListener(uint16_t eventTypeId, JSValue funcValue) +{ + if (listEventListener_ == nullptr) { + listEventListener_ = new ListEventListener(); + if (listEventListener_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "create list listener failed"); + return false; + } + list_->SetScrollStateListener(listEventListener_); + } + + switch (eventTypeId) { +// list specific event switch +#ifdef FEATURE_LIST_SPECIFIC_EVENT_ENABLE + // when scroll start, this listening event will be triggered + case K_SCROLLSTART: + listEventListener_->SetBindScrollStartFuncName(funcValue); + break; + // when item pass through the listenning position, this listening event will be triggered + case K_ITEM_SELECTED: + listEventListener_->SetBindScrollItemSelectedFuncName(funcValue); + break; +#endif // FEATURE_LIST_SPECIFIC_EVENT_ENABLE + // when scroll end, this listening event will be triggered + case K_SCROLLEND: + listEventListener_->SetBindScrollEndFuncName(funcValue); + break; + default: + return false; + } + return true; +} + +bool ListComponent::ProcessChildren() +{ + // Step1. get children, if not exsit, return false. + const JSValue descriptors = GetDescriptors(); + if (jerry_value_is_undefined(descriptors)) { + HILOG_ERROR(HILOG_MODULE_ACE, "List Component: process children failed!"); + return false; + } + + // Step2. handle For type children(list-item) + HandleListForDireactive(); + + // Step3. create list adapter + adapter_ = new ListAdapter(); + if (adapter_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "create list adapter failed"); + return false; + } + bool ret = adapter_->Initialize(descriptors); + if (!ret) { + delete adapter_; + adapter_ = nullptr; + HILOG_ERROR(HILOG_MODULE_ACE, "Initialize list adapter failed."); + return false; + } + + // Step4. add children to list dynamically. + list_->SetAdapter(adapter_); + + return true; +} + +bool ListComponent::UpdateForView() +{ + if ((adapter_ == nullptr) || (list_ == nullptr)) { + HILOG_ERROR(HILOG_MODULE_ACE, "List Component: adapter or list is null, UpdateForView failed."); + return false; + } + + // Step1. get new children, if not exsit, return false. + const JSValue descriptors = GetDescriptors(); + if (jerry_value_is_undefined(descriptors)) { + HILOG_ERROR(HILOG_MODULE_ACE, "List Component: update ForView failed!"); + return false; + } + + // free listItems_ array memory and reset listItemCount_. + // here not need delete UIView and free viewNativePair_ link list memory, + // it will be excuted in RefreshList() function. + adapter_->CleanUp(); + + // save all children's information into listItems_ array(contain For type child and common child). + bool ret = adapter_->Initialize(descriptors); + if (!ret) { + HILOG_ERROR(HILOG_MODULE_ACE, "Initialize list adapter failed."); + return false; + } + + // refresh the list, load new child dynamically in list. + list_->RefreshList(); + return true; +} + +JSValue + ListComponent::ListScrollTo(const JSValue func, const JSValue dom, const JSValue args[], const jerry_length_t size) +{ + if (size != 1) { + HILOG_ERROR(HILOG_MODULE_ACE, "scrollTo function parameter error"); + return UNDEFINED; + } + + UIList *list = reinterpret_cast(ComponentUtils::GetViewFromBindingObject(dom)); + if (list != nullptr) { + int16_t startIndex = JerryGetIntegerProperty(args[0], INDEX_SCROLLTO); + list->ScrollTo(startIndex); + } + return UNDEFINED; +} +} // namespace ACELite +} // namespace OHOS diff --git a/src/core/components/list_component.h b/src/core/components/list_component.h new file mode 100755 index 0000000..e059df2 --- /dev/null +++ b/src/core/components/list_component.h @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2020 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. + */ + +#ifndef OHOS_ACELITE_LIST_COMPONENT_H +#define OHOS_ACELITE_LIST_COMPONENT_H + +#include "component.h" +#include "list_adapter.h" +#include "ui_list.h" + +namespace OHOS { +namespace ACELite { +class ListComponent final : public Component { +public: + ACE_DISALLOW_COPY_AND_MOVE(ListComponent); + ListComponent() = delete; + ListComponent(JSValue options, JSValue children, AppStyleManager *styleManager); + ~ListComponent() override {} + +protected: + bool CreateNativeViews() override; + void ReleaseNativeViews() override; + UIView *GetComponentRootView() const override; + bool RegisterPrivateEventListener(uint16_t eventTypeId, JSValue funcValue) override; + bool ProcessChildren() override; + bool UpdateForView() override; + +private: + UIList *list_; + ListAdapter *adapter_; + const AppStyle *combinedStyle_; + ListEventListener *listEventListener_; + const char *flexDirectionDefault; + static const char * const FUNC_SCROLLTO; + static const char * const INDEX_SCROLLTO; + static JSValue ListScrollTo(const JSValue func, const JSValue dom, const JSValue args[], const jerry_length_t size); +}; +} // namespace ACELite +} // namespace OHOS + +#endif // OHOS_ACELITE_LIST_COMPONENT_H diff --git a/src/core/components/marquee_component.cpp b/src/core/components/marquee_component.cpp new file mode 100755 index 0000000..b8830df --- /dev/null +++ b/src/core/components/marquee_component.cpp @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2020 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. + */ +#include "marquee_component.h" +#include "key_parser.h" +#include "keys.h" + +namespace OHOS { +namespace ACELite { +MarqueeComponent::MarqueeComponent(jerry_value_t options, jerry_value_t children, AppStyleManager* styleManager) + : TextComponent(options, children, styleManager) +{ + SetComponentName(K_MARQUEE); +} + +bool MarqueeComponent::CreateNativeViews() +{ + if (TextComponent::CreateNativeViews()) { + UILabel* uiLabel = TextComponent::GetUILabelView(); + if (uiLabel != nullptr) { + // default mode, speed + uiLabel->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE); + uiLabel->SetRollSpeed(DEFAULT_SPEED); + return true; + } + } + + return false; +} +} // namespace ACELite +} // namespace OHOS diff --git a/src/core/components/marquee_component.h b/src/core/components/marquee_component.h new file mode 100755 index 0000000..6a3c2e3 --- /dev/null +++ b/src/core/components/marquee_component.h @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2020 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. + */ +#ifndef OHOS_ACELITE_MARQUEE_COMPONENT_H +#define OHOS_ACELITE_MARQUEE_COMPONENT_H + +#include "non_copyable.h" +#include "text_component.h" + +namespace OHOS { +namespace ACELite { +class MarqueeComponent final : public TextComponent { +// default animator speed value +static constexpr int16_t DEFAULT_SPEED = 6; + +public: + ACE_DISALLOW_COPY_AND_MOVE(MarqueeComponent); + MarqueeComponent() = delete; + MarqueeComponent(jerry_value_t options, jerry_value_t children, AppStyleManager* styleManager); + ~MarqueeComponent() override {} + +protected: + bool CreateNativeViews() override; +}; +} // namespace ACELite +} // namespace OHOS + +#endif // OHOS_ACELITE_MARQUEE_COMPONENT_H diff --git a/src/core/components/panel_view.cpp b/src/core/components/panel_view.cpp new file mode 100755 index 0000000..38095e6 --- /dev/null +++ b/src/core/components/panel_view.cpp @@ -0,0 +1,163 @@ +/* + * Copyright (c) 2020 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. + */ +#include "acelite_config.h" +#ifdef FEATURE_COMPONENT_VIDEO + +#include "panel_view.h" +#include "graphic_config.h" + +namespace OHOS { +namespace ACELite { +const char * const PanelView::DEFAULT_PLAY_TIME = "00:00"; +const uint16_t PanelView::DEFAULT_VOLUME_VALUE = 50; +const uint16_t PanelView::DEFAULT_PANEL_HEIGHT = 51; +const uint8_t PanelView::SECONDS_PER_MINUTE = 60; +const uint16_t PanelView::MILLIONS_PER_SECOND = 1000; +const uint16_t PanelView::SECONDS_PER_HOUR = 3600; +const uint8_t PanelView::MAX_HOURS = 9; +const int64_t PanelView::MAX_SHOW_TIME = MAX_HOURS * SECONDS_PER_HOUR * MILLIONS_PER_SECOND; +const uint16_t PanelView::UPDATE_CYCLE = 250; +const uint32_t PanelView::UPDATE_CYCLE_MICRO_SECONDS = UPDATE_CYCLE * MILLIONS_PER_SECOND; + +PanelView::PanelView() + : curTimeLabel_(nullptr), + playImage_(nullptr), + videoSlider_(nullptr), + totalTimeLabel_(nullptr), + mutedImage_(nullptr) +{ +} + +bool PanelView::InitView() +{ + curTimeLabel_ = new UILabel(); + playImage_ = new UIImageView(); + videoSlider_ = new UISlider(); + totalTimeLabel_ = new UILabel(); + mutedImage_ = new UIImageView(); + if (curTimeLabel_ == nullptr || playImage_ == nullptr || videoSlider_ == nullptr || totalTimeLabel_ == nullptr || + mutedImage_ == nullptr) { + return false; + } + /* add to panel & layout */ + Add(playImage_); + Add(curTimeLabel_); + Add(videoSlider_); + Add(totalTimeLabel_); + Add(mutedImage_); + LayoutChildren(); + return true; +} + + +PanelView::~PanelView() +{ + ACE_DELETE(curTimeLabel_); + ACE_DELETE(playImage_); + ACE_DELETE(videoSlider_); + ACE_DELETE(totalTimeLabel_); + ACE_DELETE(mutedImage_); +} + +const UILabel *PanelView::GetCurTimeText() const +{ + return curTimeLabel_; +} + +const UIImageView *PanelView::GetVideoPlayImage() const +{ + return playImage_; +} + +const UISlider *PanelView::GetVideoSlider() const +{ + return videoSlider_; +} + +const UILabel *PanelView::GetVideoTotalTimeText() const +{ + return totalTimeLabel_; +} + +const UIImageView *PanelView::GetVideoMutedImage() const +{ + return mutedImage_; +} + + +void PanelView::SetImageInPanel( + UIImageView *image, + int16_t imageWidth, + int16_t imageHeight, + const ImageInfo* imageSrc) +{ + if (image == nullptr || imageSrc == nullptr) { + return; + } + image->SetSrc(imageSrc); + image->SetWidth(imageWidth); + image->SetHeight(imageHeight); +} + +void PanelView::SetTextInPanel(UILabel *label) +{ + if (label == nullptr) { + return; + } + label->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT); + uint8_t fontSize = 18; + label->SetFont(DEFAULT_VECTOR_FONT_FILENAME, fontSize); + label->SetText(DEFAULT_PLAY_TIME); +} + +void PanelView::SetVideoSlider() +{ + if (videoSlider_ == nullptr || curTimeLabel_ == nullptr || totalTimeLabel_ == nullptr || playImage_ == nullptr + || mutedImage_ == nullptr) { + return; + } + const int8_t sliderWidth = 5; // default slider width + const int8_t knobWidth = 18; // default knob width + const int8_t defaultBorderRadius = 0; + const int8_t knobRadius = 10; + const int8_t hundred = 100; + const int8_t margin = 75; + int16_t visibleHeight = 30; + const int8_t miniVisibleWidth = 100; + int16_t visibleWidth = (GetWidth() - (curTimeLabel_->GetWidth()) - (totalTimeLabel_->GetWidth()) - + (playImage_->GetWidth()) - (mutedImage_->GetWidth()) - margin); + if (visibleWidth < miniVisibleWidth) { + visibleWidth = miniVisibleWidth; + } + videoSlider_->SetHeight(visibleHeight); + videoSlider_->SetWidth(visibleWidth); + videoSlider_->SetRange(hundred, 0); + videoSlider_->SetValue(0); + videoSlider_->SetValidHeight(sliderWidth); + videoSlider_->SetValidWidth(visibleWidth - knobWidth); + videoSlider_->SetKnobWidth(knobWidth); + videoSlider_->SetSliderRadius(defaultBorderRadius, defaultBorderRadius, knobRadius); + const uint8_t alpha = OPA_OPAQUE; + /* set videoSlider_ background color */ + videoSlider_->SetBackgroundStyle(STYLE_BACKGROUND_COLOR, Color::White().full); + videoSlider_->SetBackgroundStyle(STYLE_BACKGROUND_OPA, alpha); + /* set videoSlider_ selected color */ + videoSlider_->SetForegroundStyle(STYLE_BACKGROUND_COLOR, Color::Green().full); + videoSlider_->SetForegroundStyle(STYLE_BACKGROUND_OPA, alpha); +} +} // namespace ACELite +} // namespace OHOS + +#endif // FEATURE_COMPONENT_VIDEO \ No newline at end of file diff --git a/src/core/components/panel_view.h b/src/core/components/panel_view.h new file mode 100755 index 0000000..50c75fd --- /dev/null +++ b/src/core/components/panel_view.h @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2020 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. + */ +#ifndef OHOS_ACELITE_PANEL_VIEW_H +#define OHOS_ACELITE_PANEL_VIEW_H + +#include "acelite_config.h" +#ifdef FEATURE_COMPONENT_VIDEO + +#include "ace_log.h" +#include "flex_layout.h" +#include "js_fwk_common.h" +#include "memory_heap.h" +#include "non_copyable.h" +#include "ui_font.h" +#include "ui_image_view.h" +#include "ui_label.h" +#include "ui_slider.h" +#include "ui_text_language.h" +#include "video_panel_image_res.h" + +namespace OHOS { +namespace ACELite { +class PanelView : public FlexLayout, public MemoryHeap { +public: + ACE_DISALLOW_COPY_AND_MOVE(PanelView); + PanelView(); + ~PanelView(); + + const UILabel* GetCurTimeText() const; + + const UILabel* GetVideoTotalTimeText() const; + + const UISlider* GetVideoSlider() const; + + const UIImageView* GetVideoPlayImage() const; + + const UIImageView* GetVideoMutedImage() const; + + bool InitView(); + + void SetVideoSlider(); + + void SetTextInPanel(UILabel* label); + + void SetImageInPanel(UIImageView* image, int16_t imageWidth, int16_t imageHeight, const ImageInfo* imageSrc); + + static const char * const DEFAULT_PLAY_TIME; + static const uint16_t DEFAULT_VOLUME_VALUE; + static const uint16_t DEFAULT_PANEL_HEIGHT; + static const uint8_t SECONDS_PER_MINUTE; + static const uint16_t MILLIONS_PER_SECOND; + static const uint16_t SECONDS_PER_HOUR; + static const uint8_t MAX_HOURS; + static const uint16_t THOUSAND_MILLISECOND; + static const int64_t MAX_SHOW_TIME; + static const uint16_t UPDATE_CYCLE; + static const uint32_t UPDATE_CYCLE_MICRO_SECONDS; +private: + UILabel* curTimeLabel_; + UIImageView* playImage_; + UISlider* videoSlider_; + UILabel* totalTimeLabel_; + UIImageView* mutedImage_; +}; +} // namespace ACELite +} // namespace OHOS + +#endif // FEATURE_COMPONENT_VIDEO +#endif // OHOS_ACELITE_PANEL_VIEW_H \ No newline at end of file diff --git a/src/core/components/picker_view_component.cpp b/src/core/components/picker_view_component.cpp new file mode 100755 index 0000000..f8f9632 --- /dev/null +++ b/src/core/components/picker_view_component.cpp @@ -0,0 +1,609 @@ +/* + * Copyright (c) 2020 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. + */ + +#include "picker_view_component.h" +#include "ace_log.h" +#include "ace_mem_base.h" +#include "key_parser.h" +#include "keys.h" +#include "ui_font.h" + +namespace OHOS { +namespace ACELite { +#ifdef FEATURE_COMPONENT_DATE_PICKER +void DatePickerListener::OnDatePickerStoped(UIDatePicker &picker) +{ + if (!jerry_value_is_function(dateCallback_)) { + HILOG_ERROR(HILOG_MODULE_ACE, "DatePickerListener: callback type invalid!"); + return; + } + uint32_t year = (picker.GetSelectYear() == nullptr) ? 0 : strtol(picker.GetSelectYear(), nullptr, DEC); + uint32_t month = (picker.GetSelectMonth() == nullptr) ? 0 : strtol(picker.GetSelectMonth(), nullptr, DEC); + uint32_t day = (picker.GetSelectDay() == nullptr) ? 0 : strtol(picker.GetSelectDay(), nullptr, DEC); + + jerry_value_t arg = jerry_create_object(); + JerrySetNumberProperty(arg, DATE_PICKER_YEAR, year); + JerrySetNumberProperty(arg, DATE_PICKER_MONTH, month); + JerrySetNumberProperty(arg, DATE_PICKER_DAY, day); + CallJSFunctionAutoRelease(dateCallback_, UNDEFINED, &arg, 1); + jerry_release_value(arg); +} +#endif // FEATURE_COMPONENT_DATE_PICKER + +void TextPickerListener::OnPickerStoped(UIPicker& picker) +{ + if (!jerry_value_is_function(textCallback_)) { + HILOG_ERROR(HILOG_MODULE_ACE, "TextPickerListener: callback type invalid!"); + return; + } + uint16_t index = picker.GetSelected(); + jerry_value_t arg = jerry_create_object(); + JerrySetStringProperty(arg, TEXT_PICKER_NEW_VALUE, pTextArray_[index]); + JerrySetNumberProperty(arg, TEXT_PICKER_NEW_SELECTED, index); + CallJSFunctionAutoRelease(textCallback_, UNDEFINED, &arg, 1); + jerry_release_value(arg); +} + +void TimePickerListener::OnTimePickerStoped(UITimePicker &picker) +{ + if (!jerry_value_is_function(timeCallback_)) { + HILOG_ERROR(HILOG_MODULE_ACE, "TimePickerListener: callback type invalid!"); + return; + } + uint32_t hour = (picker.GetSelectHour() == nullptr) ? 0 : strtol(picker.GetSelectHour(), nullptr, DEC); + uint32_t minute = (picker.GetSelectMinute() == nullptr) ? 0 : strtol(picker.GetSelectMinute(), nullptr, DEC); + + jerry_value_t arg = jerry_create_object(); + JerrySetNumberProperty(arg, TIME_PICKER_HOUR, hour); + JerrySetNumberProperty(arg, TIME_PICKER_MINUTE, minute); + CallJSFunctionAutoRelease(timeCallback_, UNDEFINED, &arg, 1); + jerry_release_value(arg); +} + +PickerViewComponent::PickerViewComponent(jerry_value_t options, jerry_value_t children, AppStyleManager *styleManager) + : Component(options, children, styleManager), + options_(options), + pickerType_(PickerType::TEXT), + pickerView_(nullptr), + color_(Color::Gray()), + fontSize_(DEFAULT_FONT_SIZE), + fontFamily_(nullptr), + selectedColor_(Color::White()), + selectedFontSize_(PICKER_SELECTED_FONT_SIZE), + selectedFontFamily_(nullptr), + textSelected_(0), + pTextArray_(nullptr), + textArraySize_(0), + textPickerListener_(nullptr), +#ifdef FEATURE_COMPONENT_DATE_PICKER + dateSelected_(nullptr), + dateStart_(nullptr), + dateEnd_(nullptr), + datePickerListener_(nullptr), +#endif // FEATURE_COMPONENT_DATE_PICKER + timePickerListener_(nullptr), + timeSelected_(nullptr) +{ + SetComponentName(K_PICKER_VIEW); +} + +bool PickerViewComponent::CreateNativeViews() +{ + bool result = false; + pickerType_ = GetPickerType(); + switch (pickerType_) { + case PickerType::TEXT: { + result = CreateTextPicker(); + break; + } + case PickerType::TIME: { + result = CreateTimePicker(); + break; + } +#ifdef FEATURE_COMPONENT_DATE_PICKER + case PickerType::DATE: { + result = CreateDatePicker(); + break; + } +#endif // FEATURE_COMPONENT_DATE_PICKER + case PickerType::UNKNOWN: { + HILOG_ERROR(HILOG_MODULE_ACE, "PickerViewComponent: picker view type invalid!"); + break; + } + default: + break; + } + + if (pickerView_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "PickerViewComponent: create native view failed!"); + result = false; + } + if (result) { + result = (CopyFontFamily(fontFamily_, DEFAULT_FONT_FAMILY)) && + (CopyFontFamily(selectedFontFamily_, DEFAULT_FONT_FAMILY)); + } + return result; +} + +bool PickerViewComponent::CreateTextPicker() +{ + UIPicker *uiPicker = new UIPicker(); + if (uiPicker == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "PickerViewComponent: create text picker failed!"); + return false; + } + textPickerListener_ = new TextPickerListener(); + if (textPickerListener_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "PickerViewComponent: create text picker listener failed!"); + delete uiPicker; + uiPicker = nullptr; + return false; + } + uiPicker->SetItemHeight(PICKER_ITEM_HEIGHT); + pickerView_ = static_cast(uiPicker); + return true; +} + +bool PickerViewComponent::CreateTimePicker() +{ + UITimePicker *uiTimePicker = new UITimePicker(); + if (uiTimePicker == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "PickerViewComponent: create time picker failed"); + return false; + } + timePickerListener_ = new TimePickerListener(); + if (timePickerListener_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "PickerViewComponent: create time picker listener failed"); + delete uiTimePicker; + uiTimePicker = nullptr; + return false; + } + uiTimePicker->SetItemHeight(PICKER_ITEM_HEIGHT); + pickerView_ = static_cast(uiTimePicker); + return true; +} + +#ifdef FEATURE_COMPONENT_DATE_PICKER +bool PickerViewComponent::CreateDatePicker() +{ + UIDatePicker *uiDatePicker = new UIDatePicker(); + if (uiDatePicker == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "PickerViewComponent: create date picker failed"); + return false; + } + datePickerListener_ = new DatePickerListener(); + if (datePickerListener_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "PickerViewComponent: create date picker failed"); + delete uiDatePicker; + uiDatePicker = nullptr; + return false; + } + uiDatePicker->SetItemHeight(PICKER_ITEM_HEIGHT); + pickerView_ = static_cast(uiDatePicker); + return true; +} +#endif // FEATURE_COMPONENT_DATE_PICKER + +void PickerViewComponent::ReleaseTextRange() +{ + // free text picker resources + if ((textArraySize_ > 0) && pTextArray_) { + for (uint16_t index = 0; index < textArraySize_; index++) { + if (pTextArray_[index]) { + ace_free(pTextArray_[index]); + pTextArray_[index] = nullptr; + } + } + delete[] pTextArray_; + pTextArray_ = nullptr; + } +} +void PickerViewComponent::ReleaseNativeViews() +{ + if (pickerView_ != nullptr) { + delete pickerView_; + pickerView_ = nullptr; + } + + ReleaseTextRange(); + + if (textPickerListener_ != nullptr) { + delete textPickerListener_; + textPickerListener_ = nullptr; + } + + // free time picker resources + if (timePickerListener_ != nullptr) { + delete timePickerListener_; + timePickerListener_ = nullptr; + } + ACE_FREE(timeSelected_); + ACE_FREE(fontFamily_); + ACE_FREE(selectedFontFamily_); + +#ifdef FEATURE_COMPONENT_DATE_PICKER + // free date picker resources + if (datePickerListener_ != nullptr) { + delete datePickerListener_; + datePickerListener_ = nullptr; + } + ACE_FREE(dateSelected_); + ACE_FREE(dateStart_); + ACE_FREE(dateEnd_); +#endif // FEATURE_COMPONENT_DATE_PICKER +} + +inline UIView *PickerViewComponent::GetComponentRootView() const +{ + return pickerView_; +} + +void PickerViewComponent::PostRender() +{ + if (pickerView_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "PickerViewComponent: no native view for post render!"); + return; + } + + UpdatePickerStyles(); + UpdatePickerAttrs(); +} + +void PickerViewComponent::PostUpdate(uint16_t attrKeyId, bool updateResult) +{ + if ((pickerView_ == nullptr) || !updateResult) { + HILOG_ERROR(HILOG_MODULE_ACE, "PickerViewComponent: post update failed!"); + return; + } + + switch (attrKeyId) { + case K_SELECTED: +#ifdef FEATURE_COMPONENT_DATE_PICKER + case K_START: + case K_END: +#endif // FEATURE_COMPONENT_DATE_PICKER + UpdatePickerAttrs(); + break; + case K_COLOR: + case K_FONT_SIZE: + case K_FONT_FAMILY: + case K_SELECTED_COLOR: + case K_SELECTED_FONT_SIZE: + case K_SELECTED_FONT_FAMILY: + UpdatePickerStyles(); + break; + default: + break; + } +} + +void PickerViewComponent::UpdatePickerStyles() const +{ + if (pickerView_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "PickerViewComponent: update picker styles failed!"); + return; + } + if ((fontFamily_ == nullptr) || (fontSize_ == 0) || + (selectedFontFamily_ == nullptr) || (selectedFontSize_ == 0)) { + HILOG_ERROR(HILOG_MODULE_ACE, "PickerViewComponent: font family or size invalid!"); + return; + } + UIFont* font = UIFont::GetInstance(); + if (font == nullptr) { + return; + } + + switch (pickerType_) { + case PickerType::TEXT: { + UIPicker *textPicker = reinterpret_cast(pickerView_); + textPicker->SetBackgroundFont(fontFamily_, fontSize_); + textPicker->SetHighlightFont(selectedFontFamily_, selectedFontSize_); + textPicker->SetTextColor(color_, selectedColor_); + break; + } + case PickerType::TIME: { + UITimePicker *timePicker = reinterpret_cast(pickerView_); + timePicker->SetBackgroundFont(fontFamily_, fontSize_); + timePicker->SetHighlightFont(selectedFontFamily_, selectedFontSize_); + timePicker->SetTextColor(color_, selectedColor_); + break; + } +#ifdef FEATURE_COMPONENT_DATE_PICKER + case PickerType::DATE: { + uint8_t fontId = font->GetFontId(fontFamily_, fontSize_); + uint8_t selectedFontId = font->GetFontId(selectedFontFamily_, selectedFontSize_); + UIDatePicker *datePicker = reinterpret_cast(pickerView_); + datePicker->SetTextStyle(fontId, selectedFontId, color_, selectedColor_); + break; + } +#endif // FEATURE_COMPONENT_DATE_PICKER + default: + break; + } +} + +void PickerViewComponent::UpdatePickerAttrs() const +{ + if (pickerView_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "PickerViewComponent: update picker attributes failed!"); + return; + } + switch (pickerType_) { + case PickerType::TEXT: { + UIPicker *textPicker = reinterpret_cast(pickerView_); + textPicker->SetSelected(textSelected_); + break; + } + case PickerType::TIME: { + UITimePicker *timePicker = reinterpret_cast(pickerView_); + if (timeSelected_ != nullptr) { + timePicker->SetSelected(timeSelected_); + } + break; + } +#ifdef FEATURE_COMPONENT_DATE_PICKER + case PickerType::DATE: { + UIDatePicker *datePicker = reinterpret_cast(pickerView_); + if (dateStart_ != nullptr) { + datePicker->SetStart(dateStart_); + } + if (dateEnd_ != nullptr) { + datePicker->SetEnd(dateEnd_); + } + if (dateSelected_ != nullptr) { + datePicker->SetSelected(dateSelected_); + } + break; + } +#endif // FEATURE_COMPONENT_DATE_PICKER + default: + break; + } +} + +bool PickerViewComponent::SetPrivateAttribute(uint16_t attrKeyId, jerry_value_t attrValue) +{ + bool result = true; + switch (attrKeyId) { + case K_SELECTED: { + result = SetPickerSelected(attrValue); + break; + } + case K_RANGE: { + if (pickerType_ == PickerType::TEXT) { + result = SetTextPickerRange(attrValue); + } + break; + } +#ifdef FEATURE_COMPONENT_DATE_PICKER + case K_START: { + if (pickerType_ == PickerType::DATE) { + ACE_FREE(dateStart_); + dateStart_ = MallocStringOf(attrValue); + } + break; + } + case K_END: { + if (pickerType_ == PickerType::DATE) { + ACE_FREE(dateEnd_); + dateEnd_ = MallocStringOf(attrValue); + } + break; + } +#endif // FEATURE_COMPONENT_DATE_PICKER + default: + result = false; + break; + } + return result; +} + +bool PickerViewComponent::ApplyPrivateStyle(const AppStyleItem *styleItem) +{ + uint16_t styleNameId = GetStylePropNameId(styleItem); + if (!KeyParser::IsKeyValid(styleNameId)) { + HILOG_ERROR(HILOG_MODULE_ACE, "PickerViewComponent: apply private style failed!"); + return false; + } + uint32_t color = 0; + uint8_t alpha = OPA_OPAQUE; + switch (styleNameId) { + case K_COLOR: + if (!GetStyleColorValue(styleItem, color, alpha)) { + return false; + } + color_ = GetRGBColor(color); + break; + case K_FONT_SIZE: + fontSize_ = GetStylePixelValue(styleItem); + break; + case K_FONT_FAMILY: + CopyFontFamily(fontFamily_, GetStyleStrValue(styleItem)); + break; + case K_SELECTED_COLOR: + if (!GetStyleColorValue(styleItem, color, alpha)) { + return false; + } + selectedColor_ = GetRGBColor(color); + break; + case K_SELECTED_FONT_SIZE: + selectedFontSize_ = GetStylePixelValue(styleItem); + break; + case K_SELECTED_FONT_FAMILY: + CopyFontFamily(selectedFontFamily_, GetStyleStrValue(styleItem)); + break; + default: + return false; + } + return true; +} + +bool PickerViewComponent::RegisterPrivateEventListener(uint16_t eventTypeId, jerry_value_t funcValue) +{ + bool result = false; + switch (eventTypeId) { + case K_CHANGE: { + SetPickerListener(funcValue); + result = true; + break; + } + default: + break; + } + return result; +} + +char *PickerViewComponent::GetStringAttrByName(const char * const name, uint16_t &length) const +{ + if (jerry_value_is_undefined(options_)) { + HILOG_ERROR(HILOG_MODULE_ACE, "PickerViewComponent: options undefined!"); + return nullptr; + } + + char *strValue = nullptr; + jerry_value_t attrsPropValue = jerryx_get_property_str(options_, ATTR_ATTRS); + if (!jerry_value_is_undefined(attrsPropValue)) { + strValue = JerryMallocStringProperty(attrsPropValue, name, length); + } + jerry_release_value(attrsPropValue); + return strValue; +} + +PickerViewComponent::PickerType PickerViewComponent::GetPickerType() const +{ + uint16_t length = 0; + char *typeStr = GetStringAttrByName(ATTR_TYPE, length); + if (typeStr == nullptr) { + return PickerType::TEXT; + } + + PickerType type = PickerType::UNKNOWN; + uint16_t typeId = KeyParser::ParseKeyId(typeStr, length); + switch (typeId) { + case K_TEXT: + type = PickerType::TEXT; + break; + case K_TIME: + type = PickerType::TIME; + break; +#ifdef FEATURE_COMPONENT_DATE_PICKER + case K_DATE: + type = PickerType::DATE; + break; +#endif // FEATURE_COMPONENT_DATE_PICKER + default: + type = PickerType::UNKNOWN; + break; + } + ace_free(typeStr); + typeStr = nullptr; + return type; +} + +bool PickerViewComponent::SetPickerSelected(jerry_value_t selectedValue) +{ + switch (pickerType_) { + case PickerType::TEXT: { + textSelected_ = IntegerOf(selectedValue); + break; + } + case PickerType::TIME: { + ACE_FREE(timeSelected_); + timeSelected_ = MallocStringOf(selectedValue); + break; + } +#ifdef FEATURE_COMPONENT_DATE_PICKER + case PickerType::DATE: { + ACE_FREE(dateSelected_); + dateSelected_ = MallocStringOf(selectedValue); + break; + } +#endif // FEATURE_COMPONENT_DATE_PICKER + default: + break; + } + return true; +} + +void PickerViewComponent::SetPickerListener(jerry_value_t funcValue) const +{ + switch (pickerType_) { + case PickerType::TEXT: { + if (textPickerListener_ != nullptr) { + UIPicker *textPicker = reinterpret_cast(pickerView_); + textPickerListener_->SetTextCallback(funcValue); + textPicker->RegisterSelectedListener(textPickerListener_); + } + break; + } + case PickerType::TIME: { + if (timePickerListener_ != nullptr) { + UITimePicker *timePicker = reinterpret_cast(pickerView_); + timePickerListener_->SetTimeCallback(funcValue); + timePicker->RegisterSelectedListener(timePickerListener_); + } + break; + } +#ifdef FEATURE_COMPONENT_DATE_PICKER + case PickerType::DATE: { + if (datePickerListener_ != nullptr) { + UIDatePicker *datePicker = reinterpret_cast(pickerView_); + datePickerListener_->SetDateCallback(funcValue); + datePicker->RegisterSelectedListener(datePickerListener_); + } + break; + } +#endif // FEATURE_COMPONENT_DATE_PICKER + default: + break; + } +} + +bool PickerViewComponent::SetTextPickerRange(jerry_value_t rangeValue) +{ + textArraySize_ = jerry_get_array_length(rangeValue); + if (textArraySize_ == 0) { + HILOG_ERROR(HILOG_MODULE_ACE, "PickerViewComponent: text picker range invalid!"); + return false; + } + + ReleaseTextRange(); + + pTextArray_ = new char *[textArraySize_]; + if (pTextArray_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "PickerViewComponent: allocate memory for dynamic array failed!"); + return false; + } + + for (uint16_t index = 0; index < textArraySize_; index++) { + jerry_value_t element = jerry_get_property_by_index(rangeValue, index); + char *elementStr = MallocStringOf(element); + jerry_release_value(element); + if (elementStr == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "PickerViewComponent: text picker range contents invalid!"); + textArraySize_ = index; + return false; + } + pTextArray_[index] = elementStr; + } + UIPicker *textPicker = reinterpret_cast(pickerView_); + if (textPickerListener_ != nullptr) { + textPickerListener_->SetTextRange(pTextArray_); // call SetTextRange before SetValues! + } + textPicker->SetValues(const_cast(pTextArray_), textArraySize_); + return true; +} +} // namespace ACELite +} // namespace OHOS diff --git a/src/core/components/picker_view_component.h b/src/core/components/picker_view_component.h new file mode 100755 index 0000000..cd76307 --- /dev/null +++ b/src/core/components/picker_view_component.h @@ -0,0 +1,202 @@ +/* + * Copyright (c) 2020 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. + */ + +#ifndef OHOS_ACELITE_PICKER_VIEW_COMPONENT_H +#define OHOS_ACELITE_PICKER_VIEW_COMPONENT_H + +#include "acelite_config.h" +#include "component.h" +#include "non_copyable.h" +#ifdef FEATURE_COMPONENT_DATE_PICKER +#include "ui_date_picker.h" +#endif // FEATURE_COMPONENT_DATE_PICKER +#include "ui_time_picker.h" + +namespace OHOS { +namespace ACELite { +static constexpr char TEXT_PICKER_NEW_VALUE[] = "newValue"; +static constexpr char TEXT_PICKER_NEW_SELECTED[] = "newSelected"; +static constexpr char TIME_PICKER_HOUR[] = "hour"; +static constexpr char TIME_PICKER_MINUTE[] = "minute"; +#ifdef FEATURE_COMPONENT_DATE_PICKER +static constexpr char DATE_PICKER_YEAR[] = "year"; +static constexpr char DATE_PICKER_MONTH[] = "month"; +static constexpr char DATE_PICKER_DAY[] = "day"; +#endif // FEATURE_COMPONENT_DATE_PICKER +static constexpr int16_t PICKER_ITEM_HEIGHT = 50; // default picker item height +static constexpr uint8_t PICKER_SELECTED_FONT_SIZE = 38; // F_HYQIHEI_65S_38_4 + +/** + * @brief listener class for text picker onchange event. + */ +class TextPickerListener final : public OHOS::UIPicker::SelectedListener { +public: + ACE_DISALLOW_COPY_AND_MOVE(TextPickerListener); + TextPickerListener() : pTextArray_(nullptr), textCallback_(UNDEFINED) {} + ~TextPickerListener() + { + jerry_release_value(textCallback_); + } + + void OnPickerStoped(UIPicker& picker) override; + + void SetTextCallback(jerry_value_t callback) + { + jerry_release_value(textCallback_); + textCallback_ = jerry_acquire_value(callback); + } + + void SetTextRange(char** range) + { + pTextArray_ = range; + } + +private: + char** pTextArray_; + jerry_value_t textCallback_; +}; + +/** + * @brief listener class for time picker onchange event. + */ +class TimePickerListener final : public OHOS::UITimePicker::SelectedListener { +public: + ACE_DISALLOW_COPY_AND_MOVE(TimePickerListener); + TimePickerListener() : timeCallback_(UNDEFINED) {} + ~TimePickerListener() + { + jerry_release_value(timeCallback_); + } + + void OnTimePickerStoped(UITimePicker& picker) override; + + void SetTimeCallback(jerry_value_t callback) + { + jerry_release_value(timeCallback_); + timeCallback_ = jerry_acquire_value(callback); + } + +private: + jerry_value_t timeCallback_; +}; + +#ifdef FEATURE_COMPONENT_DATE_PICKER +/** + * @brief listener class for date picker onchange event. + */ +class DatePickerListener final : public UIDatePicker::SelectedListener { +public: + ACE_DISALLOW_COPY_AND_MOVE(DatePickerListener); + DatePickerListener() : dateCallback_(UNDEFINED) {} + ~DatePickerListener() + { + jerry_release_value(dateCallback_); + } + + void OnDatePickerStoped(UIDatePicker& picker) override; + + void SetDateCallback(jerry_value_t callback) + { + jerry_release_value(dateCallback_); + dateCallback_ = jerry_acquire_value(callback); + } + +private: + jerry_value_t dateCallback_; +}; +#endif // FEATURE_COMPONENT_DATE_PICKER + +/** + * @brief class for picker-view component adaptation. + */ +class PickerViewComponent final : public Component { +public: + ACE_DISALLOW_COPY_AND_MOVE(PickerViewComponent); + PickerViewComponent() = delete; + PickerViewComponent(jerry_value_t options, jerry_value_t children, AppStyleManager* styleManager); + ~PickerViewComponent() override {} + +protected: + bool CreateNativeViews() override; + void ReleaseNativeViews() override; + UIView *GetComponentRootView() const override; + bool SetPrivateAttribute(uint16_t attrKeyId, jerry_value_t attrValue) override; + bool ApplyPrivateStyle(const AppStyleItem* styleItem) override; + bool RegisterPrivateEventListener(uint16_t eventTypeId, jerry_value_t funcValue) override; + void PostRender() override; + void PostUpdate(uint16_t attrKeyId, bool updateResult) override; + + /** + * @enum PickerType + * + * @brief Values that represent different types of picker-view + */ + enum class PickerType { + UNKNOWN, + TEXT, + TIME, +#ifdef FEATURE_COMPONENT_DATE_PICKER + DATE, +#endif // FEATURE_COMPONENT_DATE_PICKER + TYPE_MAX + }; + +private: + char* GetStringAttrByName(const char * const name, uint16_t& length) const; + PickerType GetPickerType() const; + bool CreateTextPicker(); + bool CreateTimePicker(); +#ifdef FEATURE_COMPONENT_DATE_PICKER + bool CreateDatePicker(); +#endif // FEATURE_COMPONENT_DATE_PICKER + bool SetPickerSelected(jerry_value_t selectedValue); + void SetPickerListener(jerry_value_t funcValue) const; + bool SetTextPickerRange(jerry_value_t rangeValue); + void ReleaseTextRange(); + void UpdatePickerAttrs() const; + void UpdatePickerStyles() const; + + jerry_value_t options_; + PickerType pickerType_; + UIView* pickerView_; + ColorType color_; + uint8_t fontSize_; + char* fontFamily_; + ColorType selectedColor_; + uint8_t selectedFontSize_; + char* selectedFontFamily_; + + // text picker-view attributes + uint16_t textSelected_; + char** pTextArray_; + uint16_t textArraySize_; + TextPickerListener* textPickerListener_; + +#ifdef FEATURE_COMPONENT_DATE_PICKER + // date picker-view attributes + char* dateSelected_; + char* dateStart_; + char* dateEnd_; + DatePickerListener* datePickerListener_; +#endif // FEATURE_COMPONENT_DATE_PICKER + + // time picker-view listener + TimePickerListener* timePickerListener_; + char* timeSelected_; +}; +} // namespace ACELite +} // namespace OHOS + +#endif // OHOS_ACELITE_PICKER_VIEW_COMPONENT_H diff --git a/src/core/components/progress_component.cpp b/src/core/components/progress_component.cpp new file mode 100755 index 0000000..6b73047 --- /dev/null +++ b/src/core/components/progress_component.cpp @@ -0,0 +1,336 @@ +/* + * Copyright (c) 2020 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. + */ + +#include "progress_component.h" +#include "ace_log.h" +#include "ace_mem_base.h" +#include "component.h" +#include "key_parser.h" +#include "keys.h" +#include "stylemgr/app_style.h" +#include "ui_box_progress.h" +#include "ui_circle_progress.h" + +namespace OHOS { +namespace ACELite { +ProgressComponent::ProgressComponent(jerry_value_t options, jerry_value_t children, AppStyleManager *styleManager) + : Component(options, children, styleManager), + options_(options), + progressView_(nullptr), + type_(HORIZONTAL), + hStrokeWidth_(0), + startAngle_(-1), + totalAngle_(-1) +{ + SetComponentName(K_PROGRESS); +} + +bool ProgressComponent::CreateNativeViews() +{ + // Step1. get progress type + type_ = GetType(); + // Step2. create progress object + if (type_ == ARC) { + progressView_ = new UICircleProgress(); + + if (progressView_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "create circle progress error"); + return false; + } + + // set default value + UICircleProgress *circleProgress = reinterpret_cast(progressView_); + circleProgress->SetRadius(circleProgress->GetRadius()); + circleProgress->SetStartAngle(circleProgress->GetStartAngle()); + circleProgress->SetEndAngle(circleProgress->GetEndAngle()); + + circleProgress->SetBackgroundStyle(StyleDefault::GetBrightStyle()); + const int8_t defaultLineWidth = 32; + circleProgress->SetBackgroundStyle(STYLE_LINE_WIDTH, defaultLineWidth); // Compatible with rich devices + circleProgress->SetBackgroundStyle(STYLE_LINE_CAP, CapType::CAP_ROUND); + + circleProgress->SetForegroundStyle(StyleDefault::GetBrightColorStyle()); + circleProgress->SetForegroundStyle(STYLE_BACKGROUND_OPA, 0); + circleProgress->SetForegroundStyle(STYLE_BORDER_OPA, 0); + circleProgress->SetForegroundStyle(STYLE_LINE_WIDTH, defaultLineWidth); + circleProgress->SetForegroundStyle(STYLE_LINE_CAP, CapType::CAP_ROUND); + } else { + progressView_ = new UIBoxProgress(); + + if (progressView_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "create horizon progress error"); + return false; + } + + UIBoxProgress *horizonProgress = reinterpret_cast(progressView_); + // set default style for progress & background + Style progressStyle = StyleDefault::GetBrightColorStyle(); + Style backStyle = StyleDefault::GetBrightStyle(); + horizonProgress->SetForegroundStyle(progressStyle); + horizonProgress->SetBackgroundStyle(backStyle); + + // set default progress self border width + horizonProgress->SetForegroundStyle(STYLE_BORDER_WIDTH, 0); + horizonProgress->SetBackgroundStyle(STYLE_BORDER_WIDTH, 0); + // set defaut progress stroke width & canvas width & canvas height & border width + hStrokeWidth_ = DEFAULT_STROKE_WIDTH; + } + return true; +} + +void ProgressComponent::ReleaseNativeViews() +{ + if (progressView_) { + delete progressView_; + progressView_ = nullptr; + } +} + +inline UIView *ProgressComponent::GetComponentRootView() const +{ + return progressView_; +} + +bool ProgressComponent::SetPrivateAttribute(uint16_t attrKeyId, jerry_value_t attrValue) +{ + switch (attrKeyId) { + case K_PERCENT: { + // set the specific attribute of this progress view + int16_t rangeMax = 100; + int16_t rangeMin = 0; + progressView_->SetRange(rangeMax, rangeMin); + progressView_->SetValue(IntegerOf(attrValue)); + return true; + } + default: { + return false; + } + } +} + +bool ProgressComponent::ApplyPrivateStyle(const AppStyleItem *style) +{ + bool setResult = true; + + if (type_ == ARC) { + setResult = SetArcProgressStyle(style); + } else { + setResult = SetHorizonProgressStyle(style); + } + return setResult; +} + +ProgressType ProgressComponent::GetType() const +{ + ProgressType pType = HORIZONTAL; + uint16_t len = 0; + char *typeValue = GetStringAttrByName(ATTR_TYPE, &len); + if (typeValue == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "type value is a nullptr"); + return pType; + } + uint16_t typeValueId = KeyParser::ParseKeyId(typeValue, len); + if (typeValueId == K_ARC) { + pType = ARC; + } + ace_free(typeValue); + typeValue = nullptr; + return pType; +} + +char *ProgressComponent::GetStringAttrByName(const char * const name, uint16_t *len) const +{ + char *strValue = nullptr; + jerry_value_t attrsPropValue = jerryx_get_property_str(options_, ATTR_ATTRS); + if (!jerry_value_is_undefined(attrsPropValue)) { + jerry_value_t attrPropValue = jerryx_get_property_str(attrsPropValue, name); + if (jerry_value_is_string(attrPropValue)) { + strValue = MallocStringOf(attrPropValue, len); + } else { + HILOG_ERROR(HILOG_MODULE_ACE, "progress_component: target attribute: %s, value format is error", name); + } + jerry_release_value(attrPropValue); + } else { + HILOG_INFO(HILOG_MODULE_ACE, "progress_component: target attribute: %s, not exist", name); + } + jerry_release_value(attrsPropValue); + return strValue; +} + +void ProgressComponent::HorizonProgressPostDeal() const +{ + // set width & height of progress + UIBoxProgress *horizonProgress = reinterpret_cast(progressView_); + if (horizonProgress->GetWidth() < 0) { + horizonProgress->SetValidWidth(0); + } else { + horizonProgress->SetValidWidth(horizonProgress->GetWidth()); + } + horizonProgress->SetValidHeight(hStrokeWidth_); +} + +void ProgressComponent::SetAngles() const +{ + UICircleProgress *circleProgress = reinterpret_cast(progressView_); + uint8_t defaultStartAngle = 240; + if (startAngle_ == -1) { + circleProgress->SetStartAngle(defaultStartAngle); + } else { + circleProgress->SetStartAngle(startAngle_); + } + if (totalAngle_ == -1) { + uint8_t defaultTotalAngle = 240; + circleProgress->SetEndAngle(defaultStartAngle + defaultTotalAngle); + } else { + circleProgress->SetEndAngle(startAngle_ + totalAngle_); + } +} + +bool ProgressComponent::SetArcProgressStyle(const AppStyleItem *style) +{ + if (progressView_ == nullptr) { + return false; + } + + UICircleProgress *circleProgress = reinterpret_cast(progressView_); + + uint16_t stylePropNameId = GetStylePropNameId(style); + + switch (stylePropNameId) { + case K_CENTER_X: { + Point point = circleProgress->GetCenterPosition(); + point.x = GetStylePixelValue(style); + circleProgress->SetCenterPosition(point.x, point.y); + return true; + } + case K_CENTER_Y: { + Point point = circleProgress->GetCenterPosition(); + point.y = GetStylePixelValue(style); + circleProgress->SetCenterPosition(point.x, point.y); + return true; + } + case K_RADIUS: { + circleProgress->SetRadius(GetStylePixelValue(style)); + return true; + } + case K_START_ANGLE: { + const int16_t minStartAngle = 0; + const int16_t maxStartAngle = 360; + startAngle_ = GetStyleDegValue(style); // Compatible with rich devices, value should between -180 and 0 + if (startAngle_ > maxStartAngle) { + startAngle_ = maxStartAngle; + } else if (startAngle_ < minStartAngle) { + startAngle_ = minStartAngle; + } + return true; + } + case K_TOTAL_ANGLE: { + const int16_t minStartAngle = -360; + const int16_t maxStartAngle = 360; + totalAngle_ = GetStyleDegValue(style); // Compatible with rich devices, value should between 0 and 180 + if (totalAngle_ < minStartAngle) { + totalAngle_ = minStartAngle; + } else if (totalAngle_ > maxStartAngle) { + totalAngle_ = maxStartAngle; + } + return true; + } + case K_COLOR: { + uint32_t color = 0; + uint8_t alpha = OPA_OPAQUE; + if (!GetStyleColorValue(style, color, alpha)) { + return false; + } + circleProgress->SetForegroundStyle(STYLE_LINE_COLOR, GetRGBColor(color).full); + circleProgress->SetForegroundStyle(STYLE_LINE_OPA, alpha); + return true; + } + case K_STROKE_WIDTH: { + circleProgress->SetBackgroundStyle(STYLE_LINE_WIDTH, GetStylePixelValue(style)); + circleProgress->SetForegroundStyle(STYLE_LINE_WIDTH, GetStylePixelValue(style)); + return true; + } + case K_BACKGROUND_COLOR: { + uint32_t color = 0; + uint8_t alpha = OPA_OPAQUE; + if (!GetStyleColorValue(style, color, alpha)) { + return false; + } + circleProgress->SetBackgroundStyle(STYLE_LINE_COLOR, GetRGBColor(color).full); + circleProgress->SetBackgroundStyle(STYLE_LINE_OPA, alpha); + return true; + } + default: { + return false; + } + } +} + +bool ProgressComponent::SetHorizonProgressStyle(const AppStyleItem *style) +{ + if (progressView_ == nullptr) { + return false; + } + + UIBoxProgress *horizonProgress = reinterpret_cast(progressView_); + uint16_t stylePropNameId = GetStylePropNameId(style); + + switch (stylePropNameId) { + // Get stroke width. + case K_STROKE_WIDTH: { + hStrokeWidth_ = GetStylePixelValue(style); + break; + } + // Set horizon progress style: color. + case K_COLOR: { + uint32_t color = 0; + uint8_t alpha = OPA_OPAQUE; + if (!GetStyleColorValue(style, color, alpha)) { + return false; + } + horizonProgress->SetForegroundStyle(STYLE_BACKGROUND_COLOR, GetRGBColor(color).full); + horizonProgress->SetForegroundStyle(STYLE_BACKGROUND_OPA, alpha); + break; + } + default: { + return false; + } + } + return true; +} + +void ProgressComponent::PostRender() +{ + if (type_ == HORIZONTAL) { + HorizonProgressPostDeal(); + } else if (type_ == ARC) { + SetAngles(); + } +} + +void ProgressComponent::PostUpdate(uint16_t attrKeyId, bool updateResult) +{ + if (type_ == HORIZONTAL) { + HorizonProgressPostDeal(); + } else if (type_ == ARC) { + if ((attrKeyId == K_DIRECTION) || (attrKeyId == K_START_ANGLE) || (attrKeyId == K_TOTAL_ANGLE)) { + SetAngles(); + } + } else { + // Do nothing + } +} +} // namespace ACELite +} // namespace OHOS diff --git a/src/core/components/progress_component.h b/src/core/components/progress_component.h new file mode 100755 index 0000000..9ae06e0 --- /dev/null +++ b/src/core/components/progress_component.h @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2020 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. + */ + +#ifndef OHOS_ACELITE_PROGRESS_COMPONENT_H +#define OHOS_ACELITE_PROGRESS_COMPONENT_H + +#include "component.h" +#include "non_copyable.h" +#include "ui_abstract_progress.h" + +namespace OHOS { +namespace ACELite { +enum ProgressType { ARC = 0x01, HORIZONTAL = 0x02 }; + +constexpr int16_t DEFAULT_STROKE_WIDTH = 32; + +class ProgressComponent final : public Component { +public: + ACE_DISALLOW_COPY_AND_MOVE(ProgressComponent); + ProgressComponent() = delete; + ProgressComponent(jerry_value_t options, jerry_value_t children, AppStyleManager* styleManager); + ~ProgressComponent() override {} + +protected: + bool CreateNativeViews() override; + void ReleaseNativeViews() override; + UIView *GetComponentRootView() const override; + bool SetPrivateAttribute(uint16_t attrKeyId, jerry_value_t attrValue) override; + bool ApplyPrivateStyle(const AppStyleItem* style) override; + void PostRender() override; + void PostUpdate(uint16_t attrKeyId, bool updateResult) override; + +private: + ProgressType GetType() const; + char* GetStringAttrByName(const char * const name, uint16_t* len) const; + void SetAngles() const; + void HorizonProgressPostDeal() const; + bool SetArcProgressStyle(const AppStyleItem* style); + bool SetHorizonProgressStyle(const AppStyleItem* style); + jerry_value_t options_; + UIAbstractProgress* progressView_; + ProgressType type_; + int16_t hStrokeWidth_; + int16_t startAngle_; + int16_t totalAngle_; +}; +} // namespace ACELite +} // namespace OHOS + +#endif // OHOS_ACELITE_PROGRESS_COMPONENT_H diff --git a/src/core/components/scroll_layer.cpp b/src/core/components/scroll_layer.cpp new file mode 100755 index 0000000..5490615 --- /dev/null +++ b/src/core/components/scroll_layer.cpp @@ -0,0 +1,127 @@ +/* + * Copyright (c) 2020 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. + */ + +#include "scroll_layer.h" +#include "ace_log.h" +#include "component_utils.h" +#include "root_view.h" + +namespace OHOS { +namespace ACELite { +ScrollLayer::ScrollLayer() : scroll_(nullptr), origView_(nullptr) {} + +ScrollLayer::~ScrollLayer() +{ + if (scroll_ != nullptr) { + delete (scroll_); + scroll_ = nullptr; + } + origView_ = nullptr; +} + +UIScrollView *ScrollLayer::AddScrollLayer(UIView &view) const +{ + int16_t viewWidth = view.GetWidth(); + int16_t viewHeight = view.GetHeight(); + int16_t viewBorderWidth = view.GetStyle(STYLE_BORDER_WIDTH); + int16_t scrollWidth = viewWidth + viewBorderWidth + viewBorderWidth; + int16_t scrollHeight = viewHeight + viewBorderWidth + viewBorderWidth; + + if (scrollWidth <= 0 || scrollHeight <= 0) { + HILOG_ERROR(HILOG_MODULE_ACE, "Scroll Layer: Get scroll width or height failed."); + return nullptr; + } + + uint16_t horizontalResolution = GetHorizontalResolution(); + uint16_t verticalResolution = GetVerticalResolution(); + if (scrollWidth > horizontalResolution || scrollHeight > verticalResolution) { + UIScrollView *scroll = new UIScrollView(); + if (scroll == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "Scroll Layer: Create scroll view failed."); + return nullptr; + } + + if (scrollHeight > verticalResolution) { + scrollHeight = verticalResolution; + } + if (scrollWidth > horizontalResolution) { + scrollWidth = horizontalResolution; + } + + scroll->SetPosition(0, 0); + scroll->SetWidth(scrollWidth); + scroll->SetHeight(scrollHeight); + scroll->SetXScrollBarVisible(false); + scroll->SetYScrollBarVisible(false); + scroll->SetThrowDrag(true); + scroll->Add(&view); + scroll->SetReboundSize(0); + return scroll; + } else { + return nullptr; + } +} + +void ScrollLayer::AppendScrollLayer(jerry_value_t nativeElement) +{ + if (IS_UNDEFINED(nativeElement)) { + HILOG_ERROR(HILOG_MODULE_ACE, "Scroll Layer: AppendScrollLayer function parameter nativeElement error."); + return; + } + + UIView *view = ComponentUtils::GetViewFromBindingObject(nativeElement); + if (view == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "Scroll Layer: Failed to get view from js object."); + return; + } + + scroll_ = AddScrollLayer(*view); + origView_ = view; +} + +void ScrollLayer::Hide() const +{ + RootView *rootView = RootView::GetInstance(); + if (rootView == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "get rootView is nullptr"); + return; + } + rootView->RemoveAll(); + rootView->Invalidate(); +} + +void ScrollLayer::Show() const +{ + RootView *rootView = RootView::GetInstance(); + if (rootView == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "get rootView is nullptr"); + return; + } + rootView->SetPosition(0, 0); + rootView->SetWidth(GetHorizontalResolution()); + rootView->SetHeight(GetVerticalResolution()); +#ifdef FEATURE_ROOTVIEW_CUSTOM_BACKGROUND_COLOR + // set no-blank background color on root view for easy using before the window's mouse showing is optimized + rootView->SetStyle(STYLE_BACKGROUND_COLOR, Color::Olive().full); +#endif + if (scroll_ == nullptr) { + rootView->Add(origView_); + } else { + rootView->Add(scroll_); + } + rootView->Invalidate(); +} +} // namespace ACELite +} // namespace OHOS diff --git a/src/core/components/scroll_layer.h b/src/core/components/scroll_layer.h new file mode 100755 index 0000000..4dcb355 --- /dev/null +++ b/src/core/components/scroll_layer.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2020 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. + */ + +#ifndef OHOS_ACELITE_SCROLL_LAYER_H +#define OHOS_ACELITE_SCROLL_LAYER_H + +#include "js_fwk_common.h" +#include "non_copyable.h" +#include "ui_scroll_view.h" + +namespace OHOS { +namespace ACELite { +class ScrollLayer final : public MemoryHeap { +public: + ACE_DISALLOW_COPY_AND_MOVE(ScrollLayer); + ScrollLayer(); + ~ScrollLayer(); + void AppendScrollLayer(jerry_value_t nativeElement); + void Hide() const; + void Show() const; + +private: + UIScrollView *AddScrollLayer(UIView &view) const; + UIScrollView *scroll_; + UIView *origView_; +}; +} // namespace ACELite +} // namespace OHOS + +#endif // OHOS_ACELITE_SCROLL_LAYER_H diff --git a/src/core/components/slider_component.cpp b/src/core/components/slider_component.cpp new file mode 100755 index 0000000..2644f0b --- /dev/null +++ b/src/core/components/slider_component.cpp @@ -0,0 +1,266 @@ +/* + * Copyright (c) 2020 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. + */ + +#include "slider_component.h" +#include "ace_log.h" +#include "js_fwk_common.h" +#include "key_parser.h" +#include "keys.h" + +namespace OHOS { +namespace ACELite { +SliderComponent::SliderComponent(jerry_value_t options, jerry_value_t children, AppStyleManager *styleManager) + : Component(options, children, styleManager), + minValue_(0), + maxValue_(DEFAULT_VALUE), + value_(0), + visibleWidth_(0), + visibleHeight_(0), + startPosition_({0, 0}), + sliderView_(nullptr), + eventListener_(nullptr), + direction_(UISlider::Direction::DIR_LEFT_TO_RIGHT) +{ + SetComponentName(K_SLIDER); +} + +bool SliderComponent::CreateNativeViews() +{ + sliderView_ = new UISlider(); + if (sliderView_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "create native slider view failed"); + return false; + } + eventListener_ = new SliderEventListener(); + if (eventListener_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "create listener event failed"); + return false; + } + return true; +} + +void SliderComponent::ReleaseNativeViews() +{ + if (sliderView_) { + delete sliderView_; + sliderView_ = nullptr; + } + + if (eventListener_) { + delete eventListener_; + eventListener_ = nullptr; + } +} + +inline UIView *SliderComponent::GetComponentRootView() const +{ + return sliderView_; +} + +bool SliderComponent::SetPrivateAttribute(uint16_t attrKeyId, jerry_value_t attrValue) +{ + switch (attrKeyId) { + case K_MIN: + minValue_ = IntegerOf(attrValue); + break; + case K_MAX: + maxValue_ = IntegerOf(attrValue); + break; + case K_STEP: + // depend on native implementation + break; + case K_VALUE: + value_ = IntegerOf(attrValue); + break; + default: + return false; + } + return true; +} + +bool SliderComponent::RegisterEventListener(uint16_t eventTypeId, jerry_value_t funcValue) +{ + if ((sliderView_ == nullptr) || !KeyParser::IsKeyValid(eventTypeId) || IS_UNDEFINED(funcValue)) { + return false; + } + + // slider's event type has bigger priority than common ones, so try private handler first + bool registerResult = RegisterPrivateEventListener(eventTypeId, funcValue); + if (registerResult) { + return true; + } + // try common ones if no private ones get hitted + registerResult = RegisterCommonEventListener(*sliderView_, eventTypeId, funcValue); + return registerResult; +} + +bool SliderComponent::RegisterPrivateEventListener(uint16_t eventTypeId, jerry_value_t funcValue) +{ + switch (eventTypeId) { + case K_CHANGE: + sliderView_->SetSliderEventListener(eventListener_); + eventListener_->SetBindChangeFuncName(funcValue); + break; + default: + return false; + } + + sliderView_->SetDraggable(true); + sliderView_->SetTouchable(true); + return true; +} + +bool SliderComponent::ApplyPrivateStyle(const AppStyleItem *style) +{ + uint32_t color = 0; + uint8_t alpha = OPA_OPAQUE; + uint16_t stylePropNameId = GetStylePropNameId(style); + switch (stylePropNameId) { + case K_COLOR: { + // set slider background style color + if (!GetStyleColorValue(style, color, alpha)) { + return false; + } + sliderView_->SetBackgroundStyle(STYLE_BACKGROUND_COLOR, GetRGBColor(color).full); + sliderView_->SetBackgroundStyle(STYLE_BACKGROUND_OPA, alpha); + break; + } + case K_SELECTED_COLOR: { + // set slider indicator style color + if (!GetStyleColorValue(style, color, alpha)) { + return false; + } + sliderView_->SetForegroundStyle(STYLE_BACKGROUND_COLOR, GetRGBColor(color).full); + sliderView_->SetForegroundStyle(STYLE_BACKGROUND_OPA, alpha); + break; + } + case K_BLOCK_COLOR: { + // set slider knob style color + if (!GetStyleColorValue(style, color, alpha)) { + return false; + } + sliderView_->SetKnobStyle(STYLE_BACKGROUND_COLOR, GetRGBColor(color).full); + sliderView_->SetKnobStyle(STYLE_BACKGROUND_OPA, alpha); + break; + } + case K_LEFT: { + startPosition_.x = GetStylePixelValue(style); + break; + } + case K_TOP: { + startPosition_.y = GetStylePixelValue(style); + break; + } + case K_DIRECTION: { + SetDirection(GetStyleStrValue(style)); + break; + } + case K_HEIGHT: { + visibleHeight_ = GetStylePixelValue(style); + break; + } + case K_WIDTH: { + visibleWidth_ = GetStylePixelValue(style); + break; + } + default: { + return false; + } + } + return true; +} + +void SliderComponent::PostUpdate(uint16_t attrKeyId, bool updateResult) +{ + if ((sliderView_ == nullptr) || !updateResult || !KeyParser::IsKeyValid(attrKeyId)) { + HILOG_ERROR(HILOG_MODULE_ACE, "slider component post update check args failed"); + return; + } + switch (attrKeyId) { + case K_LEFT: + case K_TOP: + sliderView_->SetPosition(startPosition_.x, startPosition_.y); + sliderView_->Invalidate(); + break; + case K_HEIGHT: + case K_WIDTH: + sliderView_->SetHeight(visibleHeight_); + sliderView_->SetWidth(visibleWidth_); + if (direction_ == UISlider::Direction::DIR_BOTTOM_TO_TOP) { + sliderView_->SetValidWidth(SLIDER_WIDTH); + sliderView_->SetValidHeight(visibleHeight_ - KNOB_WIDTH); + } else { + sliderView_->SetValidHeight(SLIDER_WIDTH); + sliderView_->SetValidWidth(visibleWidth_ - KNOB_WIDTH); + } + sliderView_->Invalidate(); + break; + case K_MAX: + case K_MIN: + case K_VALUE: + sliderView_->SetRange(maxValue_, minValue_); + sliderView_->SetValue(value_); + sliderView_->Invalidate(); + break; + default: + break; + } +} + +void SliderComponent::PostRender() +{ + if (sliderView_ == nullptr) { + return; + } + + if (value_ < minValue_) { + value_ = minValue_; + } else if (value_ > maxValue_) { + value_ = maxValue_; + } + sliderView_->SetDirection(direction_); + sliderView_->SetPosition(startPosition_.x, startPosition_.y); + sliderView_->SetRange(maxValue_, minValue_); + sliderView_->SetHeight(visibleHeight_); + sliderView_->SetWidth(visibleWidth_); + if (direction_ == UISlider::Direction::DIR_BOTTOM_TO_TOP) { + sliderView_->SetValidWidth(SLIDER_WIDTH); + sliderView_->SetValidHeight(visibleHeight_ - KNOB_WIDTH); + } else { + sliderView_->SetValidHeight(SLIDER_WIDTH); + sliderView_->SetValidWidth(visibleWidth_ - KNOB_WIDTH); + } + sliderView_->SetKnobWidth(KNOB_WIDTH); + sliderView_->SetSliderRadius(DEFAULT_BORDER_RADIUS, DEFAULT_BORDER_RADIUS, KNOB_RADIUS); + sliderView_->SetBackgroundStyle(STYLE_LINE_CAP, CapType::CAP_ROUND); + sliderView_->SetForegroundStyle(STYLE_LINE_CAP, CapType::CAP_ROUND); + sliderView_->SetBackgroundStyle(STYLE_BORDER_WIDTH, 0); + sliderView_->SetForegroundStyle(STYLE_BORDER_WIDTH, 0); + sliderView_->SetKnobStyle(STYLE_BORDER_WIDTH, 0); + sliderView_->SetValue(value_); +} + +void SliderComponent::SetDirection(const char * const directionValue) +{ + if (directionValue == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "get js slider direction is nullptr."); + return; + } + const char * const sliderDirectionColumn = "column"; + direction_ = (!strcmp(directionValue, sliderDirectionColumn)) ? UISlider::Direction::DIR_BOTTOM_TO_TOP + : UISlider::Direction::DIR_LEFT_TO_RIGHT; +} +} // namespace ACELite +} // namespace OHOS diff --git a/src/core/components/slider_component.h b/src/core/components/slider_component.h new file mode 100755 index 0000000..c5fd4c0 --- /dev/null +++ b/src/core/components/slider_component.h @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2020 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. + */ + +#ifndef OHOS_ACELITE_SLIDER_COMPONENT_H +#define OHOS_ACELITE_SLIDER_COMPONENT_H + +#include "component.h" +#include "event_listener.h" +#include "non_copyable.h" +#include "ui_slider.h" + +namespace OHOS { +namespace ACELite { +class SliderComponent final : public Component { +public: + ACE_DISALLOW_COPY_AND_MOVE(SliderComponent); + SliderComponent() = delete; + SliderComponent(jerry_value_t options, jerry_value_t children, AppStyleManager* styleManager); + ~SliderComponent() override {} + +protected: + bool CreateNativeViews() override; + void ReleaseNativeViews() override; + UIView *GetComponentRootView() const override; + bool SetPrivateAttribute(uint16_t attrKeyId, jerry_value_t attrValue) override; + bool RegisterEventListener(uint16_t eventTypeId, jerry_value_t funcValue) override; + bool RegisterPrivateEventListener(uint16_t eventTypeId, jerry_value_t funcValue) override; + bool ApplyPrivateStyle(const AppStyleItem* style) override; + void PostRender() override; + void PostUpdate(uint16_t attrKeyId, bool updateResult) override; + +private: + static const int16_t DEFAULT_VALUE = 100; + static const int8_t SLIDER_WIDTH = 5; // default slider width + static const int8_t KNOB_WIDTH = 18; // default knob width + static const int8_t KNOB_RADIUS = 10; // default knob radius + static const int8_t DEFAULT_BORDER_RADIUS = 0; // default border radius + void SetKnobValue(jerry_value_t attrValue); + void SetDirection(const char * const directionValue); + int16_t minValue_; + int16_t maxValue_; + int16_t value_; + int16_t visibleWidth_; + int16_t visibleHeight_; + Point startPosition_; + UISlider* sliderView_; + SliderEventListener* eventListener_; + UISlider::Direction direction_; +}; +} // namespace ACELite +} // namespace OHOS + +#endif // OHOS_ACELITE_SLIDER_COMPONENT_H diff --git a/src/core/components/swiper_component.cpp b/src/core/components/swiper_component.cpp new file mode 100755 index 0000000..325ab52 --- /dev/null +++ b/src/core/components/swiper_component.cpp @@ -0,0 +1,183 @@ +/* + * Copyright (c) 2020 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. + */ + +#include "swiper_component.h" +#include "ace_log.h" +#include "js_fwk_common.h" +#include "key_parser.h" +#include "keys.h" + +namespace OHOS { +namespace ACELite { +SwiperComponent::SwiperComponent(jerry_value_t options, jerry_value_t children, AppStyleManager* styleManager) + : Component(options, children, styleManager), + swiperView_(nullptr), + hasChildren_(false), + index_(0), + changeListener_(nullptr) +{ + SetComponentName(K_SWIPER); +} + +bool SwiperComponent::CreateNativeViews() +{ + swiperView_ = new UISwipeView(); + if (swiperView_ == nullptr) { + return false; + } + swiperView_->SetLoopState(true); + return true; +} + +void SwiperComponent::ReleaseNativeViews() +{ + if (swiperView_) { + delete swiperView_; + swiperView_ = nullptr; + } + if (changeListener_) { + delete changeListener_; + changeListener_ = nullptr; + } +} + +inline UIView *SwiperComponent::GetComponentRootView() const +{ + return swiperView_; +} + +bool SwiperComponent::SetPrivateAttribute(uint16_t attrKeyId, jerry_value_t attrValue) +{ + if (attrKeyId == K_DURATION) { + int16_t duration = IntegerOf(attrValue); + if (duration < 0) { + HILOG_ERROR(HILOG_MODULE_ACE, "duration value has problem."); + return false; + } + swiperView_->SetAnimatorTime(duration); + return true; + } else if (attrKeyId == K_LOOP) { + if (jerry_value_is_boolean(attrValue)) { + swiperView_->SetLoopState(BoolOf(attrValue)); + } else { + swiperView_->SetLoopState(true); + } + return true; + } else if (attrKeyId == K_INDEX) { + if (!jerry_value_is_number(attrValue) && !jerry_value_is_string(attrValue)) { + index_ = 0; + } else { + index_ = IntegerOf(attrValue); + } + return true; + } else if (attrKeyId == K_VERTICAL) { + if (!hasChildren_) { + if (jerry_value_is_boolean(attrValue)) { + swiperView_->SetDirection(BoolOf(attrValue)); + } else { + swiperView_->SetDirection(0); + } + } + } + + return false; +} + +void SwiperComponent::PostUpdate(uint16_t attrKeyId, bool updateResult) +{ + if (updateResult) { + SetPageIndex(); + } +} + +void SwiperComponent::PostRender() +{ + SetPageIndex(); +} + +bool SwiperComponent::ProcessChildren() +{ + if (swiperView_ == nullptr) { + return false; + } + AppendChildren(swiperView_); + hasChildren_ = true; + return true; +} + +bool SwiperComponent::RegisterPrivateEventListener(uint16_t eventTypeId, jerry_value_t funcValue) +{ + if (eventTypeId == K_CHANGE) { + if (swiperView_) { + changeListener_ = new ChangeListener(funcValue); + if (changeListener_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "Create ChangeListener error."); + return false; + } + swiperView_->SetOnSwipeListener(changeListener_); + return true; + } + } + return false; +} + +void SwiperComponent::SetPageIndex() const +{ + if (jerry_value_is_undefined(GetChildren())) { + HILOG_INFO(HILOG_MODULE_ACE, "Swiper children don't exsit."); + return; + } + uint16_t length = jerry_get_array_length(GetChildren()); + if (index_ < 0 || index_ >= length) { + swiperView_->SetCurrentPage(0); + } else { + swiperView_->SetCurrentPage(index_); + } +} + +void SwiperComponent::ChangeListener::OnSwipe(UISwipeView& view) +{ + if (jerry_value_is_undefined(fn_)) { + return; + } + UISwipeView* swipeView = reinterpret_cast(&view); + if (swipeView == nullptr) { + return; + } + const uint8_t argsNum = 1; + jerry_value_t args[argsNum]; + args[0] = jerry_create_object(); + jerry_value_t indexValHandler = jerry_create_number(swipeView->GetCurrentPage()); + jerry_value_t result = jerryx_set_property_str(args[0], SWIPER_ATTR_INDEX, indexValHandler); + jerry_release_value(indexValHandler); + if (jerry_value_is_error(result)) { + HILOG_ERROR(HILOG_MODULE_ACE, "set index value failed."); + ReleaseJerryValue(args[0], result, VA_ARG_END_FLAG); + return; + } + jerry_release_value(result); + if (jerry_value_is_function(fn_)) { + jerry_value_t retVal = CallJSFunctionOnRoot(fn_, args, argsNum); + if (jerry_value_is_error(retVal)) { + HILOG_ERROR(HILOG_MODULE_ACE, "Change event is error."); + } + jerry_release_value(retVal); + } else { + HILOG_ERROR(HILOG_MODULE_ACE, "Change event is not a function."); + } + jerry_release_value(args[0]); +} +} // namespace ACELite +} // namespace OHOS diff --git a/src/core/components/swiper_component.h b/src/core/components/swiper_component.h new file mode 100755 index 0000000..638110b --- /dev/null +++ b/src/core/components/swiper_component.h @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2020 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. + */ + +#ifndef OHOS_ACELITE_SWIPER_COMPONENT_H +#define OHOS_ACELITE_SWIPER_COMPONENT_H + +#include "component.h" +#include "non_copyable.h" +#include "ui_swipe_view.h" + +namespace OHOS { +namespace ACELite { +constexpr char SWIPER_ATTR_INDEX[] = "index"; +class SwiperComponent final : public Component { +public: + ACE_DISALLOW_COPY_AND_MOVE(SwiperComponent); + SwiperComponent() = delete; + SwiperComponent(jerry_value_t options, jerry_value_t children, AppStyleManager *styleManager); + ~SwiperComponent() override {} + +protected: + bool CreateNativeViews() override; + void ReleaseNativeViews() override; + UIView *GetComponentRootView() const override; + bool SetPrivateAttribute(uint16_t attrKeyId, jerry_value_t attrValue) override; + void PostUpdate(uint16_t attrKeyId, bool updateResult) override; + void PostRender() override; + bool ProcessChildren() override; + bool RegisterPrivateEventListener(uint16_t eventTypeId, jerry_value_t funcValue) override; + +private: + class ChangeListener : public UISwipeView::OnSwipeListener { + public: + ACE_DISALLOW_COPY_AND_MOVE(ChangeListener); + explicit ChangeListener(jerry_value_t fn) : fn_(jerry_acquire_value(fn)) {} + ChangeListener() = delete; + ~ChangeListener() + { + jerry_release_value(fn_); + } + void OnSwipe(UISwipeView &view) override; + + private: + jerry_value_t fn_; + }; + void SetPageIndex() const; + UISwipeView *swiperView_; + bool hasChildren_; + int16_t index_; + ChangeListener *changeListener_; +}; +} // namespace ACELite +} // namespace OHOS + +#endif // OHOS_ACELITE_SWIPER_COMPONENT_H diff --git a/src/core/components/switch_component.cpp b/src/core/components/switch_component.cpp new file mode 100755 index 0000000..5b47e0f --- /dev/null +++ b/src/core/components/switch_component.cpp @@ -0,0 +1,147 @@ +/* + * Copyright (c) 2020 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. + */ + +#include "switch_component.h" +#include "ace_log.h" +#include "js_fwk_common.h" +#include "key_parser.h" +#include "keys.h" + +namespace OHOS { +namespace ACELite { +SwitchComponent::SwitchComponent(jerry_value_t options, jerry_value_t children, AppStyleManager *styleManager) + : Component(options, children, styleManager), + toggleButton_(nullptr), + changeListener_(nullptr), + clickListener_(nullptr) +{ + SetComponentName(K_SWITCH); + combinedStyle_ = GetStyleManager()->GetCombinedStyle(); +} + +SwitchComponent::~SwitchComponent() +{ + if (changeListener_) { + delete changeListener_; + changeListener_ = nullptr; + } + if (clickListener_) { + delete clickListener_; + clickListener_ = nullptr; + } +} + +bool SwitchComponent::ApplyPrivateStyle(const AppStyleItem *style) +{ + uint16_t stylePropNameId = GetStylePropNameId(style); + if (!KeyParser::IsKeyValid(stylePropNameId)) { + return false; + } + + if (stylePropNameId == K_BACKGROUND_COLOR) { + uint32_t color = 0; + uint8_t alpha = OPA_OPAQUE; + if (GetStyleColorValue(style, color, alpha)) { + toggleButton_->SetStyle(STYLE_BACKGROUND_COLOR, GetRGBColor(color).full); + toggleButton_->SetStyle(STYLE_BACKGROUND_OPA, alpha); + return true; + } + } + + return false; +} + +bool SwitchComponent::CreateNativeViews() +{ + toggleButton_ = new UIToggleButton(); + + if (toggleButton_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "create switch component fail"); + return false; + } + + toggleButton_->SetState(false); + toggleButton_->SetStyle(STYLE_BORDER_OPA, OPA_OPAQUE); + toggleButton_->SetStyle(STYLE_BACKGROUND_OPA, OPA_TRANSPARENT); + + return true; +} + +void SwitchComponent::ReleaseNativeViews() +{ + if (toggleButton_) { + delete toggleButton_; + toggleButton_ = nullptr; + } +} + +UIView *SwitchComponent::GetComponentRootView() const +{ + return toggleButton_; +} + +bool SwitchComponent::SetPrivateAttribute(uint16_t attrKeyId, jerry_value_t attrValue) +{ + if (attrKeyId == K_CHECKED) { + toggleButton_->SetState(BoolOf(attrValue)); + return true; + } + + return false; +} + +bool SwitchComponent::RegisterPrivateEventListener(uint16_t eventTypeId, jerry_value_t funcValue) +{ + if (eventTypeId == K_CHANGE) { + if (toggleButton_) { + changeListener_ = new StateChangeListener(funcValue, K_SWITCH); + if (changeListener_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "create change listener failed"); + return false; + } + return true; + } + } else if (eventTypeId == K_CLICK) { + clickListener_ = new ViewOnClickListener(funcValue, eventTypeId); + if (clickListener_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "create click listener failed"); + return false; + } + return true; + } + return false; +} + +void SwitchComponent::PostRender() +{ + // the change event should be dealed after checked attribute + if (changeListener_) { + toggleButton_->SetOnChangeListener(changeListener_); + if (clickListener_ == nullptr) { + // trigger changeEvent + clickListener_ = new ViewOnClickListener(UNDEFINED, K_CLICK); + if (clickListener_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "create click listener failed"); + return; + } + } + } + if (clickListener_) { + clickListener_->SetComponentListener(changeListener_); + toggleButton_->SetOnClickListener(clickListener_); + } +} +} // namespace ACELite +} // namespace OHOS diff --git a/src/core/components/switch_component.h b/src/core/components/switch_component.h new file mode 100755 index 0000000..e87bb0c --- /dev/null +++ b/src/core/components/switch_component.h @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2020 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. + */ + +#ifndef OHOS_ACELITE_SWITCH_COMPONENT_H +#define OHOS_ACELITE_SWITCH_COMPONENT_H +#include "component.h" +#include "non_copyable.h" +#include "ui_toggle_button.h" + +namespace OHOS { +namespace ACELite { +class SwitchComponent final : public Component { +public: + ACE_DISALLOW_COPY_AND_MOVE(SwitchComponent); + SwitchComponent() = delete; + SwitchComponent(jerry_value_t options, jerry_value_t children, AppStyleManager *styleManager); + ~SwitchComponent() override; + +protected: + bool ApplyPrivateStyle(const AppStyleItem *style) override; + bool CreateNativeViews() override; + void ReleaseNativeViews() override; + bool SetPrivateAttribute(uint16_t attrKeyId, jerry_value_t attrValue) override; + bool RegisterPrivateEventListener(uint16_t eventTypeId, jerry_value_t funcValue) override; + UIView *GetComponentRootView() const override; + void PostRender() override; + +private: + UIToggleButton *toggleButton_; + StateChangeListener *changeListener_; + ViewOnClickListener *clickListener_; + const AppStyle *combinedStyle_; +}; +} // namespace ACELite +} // namespace OHOS + +#endif // OHOS_ACELITE_SWITCH_COMPONENT_H diff --git a/src/core/components/tab_bar_component.cpp b/src/core/components/tab_bar_component.cpp new file mode 100755 index 0000000..194373b --- /dev/null +++ b/src/core/components/tab_bar_component.cpp @@ -0,0 +1,191 @@ +/* + * Copyright (c) 2020 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. + */ + +#include "acelite_config.h" + +#ifdef FEATURE_COMPONENT_TABS + +#include "js_fwk_common.h" +#include "key_parser.h" +#include "keys.h" +#include "tab_bar_component.h" +#include "ui_label.h" +#include "ace_log.h" +#include "ace_mem_base.h" + +namespace OHOS { +namespace ACELite { +TabBarComponent::TabBarComponent(jerry_value_t options, jerry_value_t children, AppStyleManager* styleManager) + : Component(options, children, styleManager), + options_(options), + children_(children), + width_(0), + height_(0), + mode_(nullptr) +{ + SetComponentName(K_TAB_BAR); + combinedStyle_ = GetStyleManager()->GetCombinedStyle(); +} + +uint8_t TabBarComponent::GetChildrenLength() +{ + return jerry_get_array_length(children_); +} + +void TabBarComponent::ReleaseNativeViews() +{ + if (mode_) { + ace_free(mode_); + mode_ = nullptr; + } +} + +const char* TabBarComponent::GetTextByIndex(uint8_t index) +{ + jerry_value_t childHandler = jerry_get_property_by_index(children_, index); + Component* textComponent = ComponentUtils::GetComponentFromBindingObject(childHandler); + if (textComponent == nullptr) { + jerry_release_value(childHandler); + return nullptr; + } + if (textComponent->GetComponentName() == K_TEXT) { + UIView* view = textComponent->GetComponentRootView(); + UILabel* label = reinterpret_cast(view); + if (label == nullptr) { + jerry_release_value(childHandler); + return nullptr; + } + jerry_release_value(childHandler); + return label->GetText(); + } + + jerry_release_value(childHandler); + return nullptr; +} + +void TabBarComponent::PreRender() +{ + SetWidth(); + SetHeight(); + SetMode(); +} + +void TabBarComponent::SetWidth() +{ + jerry_value_t widthKeyHandler = jerry_create_string(reinterpret_cast(ATTR_WIDTH)); + jerry_value_t widthValHandler = GetAttrValHandler(widthKeyHandler); + int32_t defaultWidth = GetHorizontalResolution(); + width_ = defaultWidth; + if (jerry_value_is_undefined(widthValHandler)) { + if (combinedStyle_) { + const AppStyleItem* item = combinedStyle_->GetStyleItemByNameId(K_WIDTH); + defaultWidth = (item == nullptr) ? defaultWidth : item->GetNumValue(); + } + } + if (defaultWidth >= 0 && defaultWidth <= INT16_MAX) { + width_ = defaultWidth; + } else { + HILOG_DEBUG(HILOG_MODULE_ACE, "set width of tab-bar fail."); + } + jerry_release_value(widthValHandler); + jerry_release_value(widthKeyHandler); +} + +void TabBarComponent::SetHeight() +{ + jerry_value_t heightKeyHandler = jerry_create_string(reinterpret_cast(ATTR_HEIGHT)); + jerry_value_t heightValHandler = GetAttrValHandler(heightKeyHandler); + int32_t defaultHeight = 50; + height_ = defaultHeight; + if (jerry_value_is_undefined(heightValHandler)) { + if (combinedStyle_) { + const AppStyleItem* item = combinedStyle_->GetStyleItemByNameId(K_HEIGHT); + defaultHeight = (item == nullptr) ? defaultHeight : item->GetNumValue(); + } + } + if (defaultHeight >= 0 && defaultHeight <= VERTICAL_RESOLUTION) { + height_ = defaultHeight; + } else { + HILOG_DEBUG(HILOG_MODULE_ACE, "set height of tab-bar fail."); + } + jerry_release_value(heightValHandler); + jerry_release_value(heightKeyHandler); +} + +void TabBarComponent::SetMode() +{ + const char * const attrMode = "mode"; + jerry_value_t modeKeyHandler = jerry_create_string(reinterpret_cast(attrMode)); + jerry_value_t modeValHandler = GetAttrValHandler(modeKeyHandler); + char defaultMode[] = "fixed"; + mode_ = static_cast(ace_malloc(sizeof(defaultMode))); + if (mode_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "malloc mode_ failed."); + } else { + if (memcpy_s(mode_, sizeof(defaultMode), defaultMode, sizeof(defaultMode)) != 0) { + HILOG_ERROR(HILOG_MODULE_ACE, "memcpy mode_ failed."); + ace_free(mode_); + mode_ = nullptr; + jerry_release_value(modeValHandler); + jerry_release_value(modeKeyHandler); + return; + } + if (!jerry_value_is_undefined(modeValHandler) && jerry_value_is_string(modeValHandler)) { + char* newMode_ = MallocStringOf(modeValHandler); + if (newMode_ != nullptr) { + ace_free(mode_); + mode_ = newMode_; + } + } else { + HILOG_DEBUG(HILOG_MODULE_ACE, "tab-bar mode value is not define or error."); + } + } + jerry_release_value(modeValHandler); + jerry_release_value(modeKeyHandler); +} + +jerry_value_t TabBarComponent::GetAttrValHandler(jerry_value_t attrKeyHandler) +{ + jerry_value_t attrsKeyHandler = jerry_create_string(reinterpret_cast(ATTR_ATTRS)); + jerry_value_t attrsValHandler = jerry_get_property(options_, attrsKeyHandler); + if (jerry_value_is_undefined(attrsValHandler)) { + jerry_release_value(attrsKeyHandler); + return UNDEFINED; + } + + jerry_value_t attrValHandler = jerry_get_property(attrsValHandler, attrKeyHandler); + if (jerry_value_is_function(attrValHandler)) { + jerry_value_t globalObject = jerry_get_global_object(); + jerry_value_t appPropName = jerry_create_string((const jerry_char_t*)ATTR_ROOT); + jerry_value_t appViewModel = jerry_get_property(globalObject, appPropName); + jerry_value_t newAttrValHandler = jerry_call_function(attrValHandler, appViewModel, nullptr, 0); + if (newAttrValHandler != attrValHandler) { + jerry_release_value(attrValHandler); + attrValHandler = newAttrValHandler; + } + ReleaseJerryValue(appViewModel, appPropName, globalObject, VA_ARG_END_FLAG); + } + if (jerry_value_is_undefined(attrValHandler) || jerry_value_is_error(attrValHandler)) { + jerry_release_value(attrValHandler); + attrValHandler = UNDEFINED; + } + jerry_release_value(attrsValHandler); + jerry_release_value(attrsKeyHandler); + return attrValHandler; +} +} // namespace ACELite +} // namespace OHOS + +#endif // FEATURE_COMPONENT_TABS diff --git a/src/core/components/tab_bar_component.h b/src/core/components/tab_bar_component.h new file mode 100755 index 0000000..3317275 --- /dev/null +++ b/src/core/components/tab_bar_component.h @@ -0,0 +1,78 @@ +/* + * Copyright (c) 2020 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. + */ + +#ifndef OHOS_ACELITE_TAB_BAR_COMPONENT_H +#define OHOS_ACELITE_TAB_BAR_COMPONENT_H + +#include "acelite_config.h" + +#ifdef FEATURE_COMPONENT_TABS + +#include "component.h" +#include "non_copyable.h" + +namespace OHOS { +namespace ACELite { +class TabBarComponent final : public Component { +public: + ACE_DISALLOW_COPY_AND_MOVE(TabBarComponent); + TabBarComponent() = delete; + TabBarComponent(jerry_value_t options, jerry_value_t children, AppStyleManager* styleManager); + ~TabBarComponent(){}; + int16_t GetWidth() const + { + return width_; + } + int16_t GetHeight() const + { + return height_; + } + char* GetMode() const + { + return mode_; + } + uint8_t GetChildrenLength(); + const char* GetTextByIndex(uint8_t index); + +protected: + void PreRender() override; + inline bool CreateNativeViews() override + { + return true; + } + void ReleaseNativeViews() override; + UIView *GetComponentRootView() const override + { + return nullptr; + } + +private: + jerry_value_t GetAttrValHandler(jerry_value_t attrKeyHandler); + void SetWidth(); + void SetHeight(); + void SetMode(); + jerry_value_t options_; + jerry_value_t children_; + uint16_t width_; + uint16_t height_; + char* mode_; + const AppStyle* combinedStyle_; +}; +} // namespace ACELite +} // namespace OHOS + +#endif // FEATURE_COMPONENT_TABS + +#endif // OHOS_ACELITE_TAB_BAR_COMPONENT_H diff --git a/src/core/components/tab_content_component.cpp b/src/core/components/tab_content_component.cpp new file mode 100755 index 0000000..7cbabe0 --- /dev/null +++ b/src/core/components/tab_content_component.cpp @@ -0,0 +1,52 @@ +/* + * Copyright (c) 2020 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. + */ + +#include "acelite_config.h" + +#ifdef FEATURE_COMPONENT_TABS + +#include "js_fwk_common.h" +#include "keys.h" +#include "tab_content_component.h" +#include "ui_view_group.h" + +namespace OHOS { +namespace ACELite { +TabContentComponent::TabContentComponent(jerry_value_t options, jerry_value_t children, AppStyleManager* styleManager) + : Component(options, children, styleManager), + children_(children) +{ + SetComponentName(K_TAB_CONTENT); +} + +uint8_t TabContentComponent::GetChildrenLength() +{ + return jerry_get_array_length(children_); +} + +Component* TabContentComponent::GetComponentByIndex(uint8_t index) +{ + jerry_value_t childHandler = jerry_get_property_by_index(children_, index); + if (jerry_value_is_undefined(childHandler)) { + return nullptr; + } + Component* component = ComponentUtils::GetComponentFromBindingObject(childHandler); + jerry_release_value(childHandler); + return component; +} +} // namespace ACELite +} // namespace OHOS + +#endif // FEATURE_COMPONENT_TABS diff --git a/src/core/components/tab_content_component.h b/src/core/components/tab_content_component.h new file mode 100755 index 0000000..f1dd7ab --- /dev/null +++ b/src/core/components/tab_content_component.h @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2020 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. + */ + +#ifndef OHOS_ACELITE_TAB_CONTENT_COMPONENT_H +#define OHOS_ACELITE_TAB_CONTENT_COMPONENT_H + +#include "acelite_config.h" + +#ifdef FEATURE_COMPONENT_TABS + +#include "component.h" +#include "non_copyable.h" + +namespace OHOS { +namespace ACELite { +class TabContentComponent final : public Component { +public: + ACE_DISALLOW_COPY_AND_MOVE(TabContentComponent); + TabContentComponent() = delete; + TabContentComponent(jerry_value_t options, jerry_value_t children, AppStyleManager* styleManager); + ~TabContentComponent() {} + inline UIView *GetComponentRootView() const override + { + return nullptr; + } + uint8_t GetChildrenLength(); + Component* GetComponentByIndex(uint8_t index); + +protected: + inline bool CreateNativeViews() override + { + return true; + } + inline void ReleaseNativeViews() override {} + +private: + jerry_value_t children_; +}; +} // namespace ACELite +} // namespace OHOS + +#endif // FEATURE_COMPONENT_TABS + +#endif // OHOS_ACELITE_TAB_CONTENT_COMPONENT_H diff --git a/src/core/components/tabs_component.cpp b/src/core/components/tabs_component.cpp new file mode 100755 index 0000000..5edccda --- /dev/null +++ b/src/core/components/tabs_component.cpp @@ -0,0 +1,342 @@ +/* + * Copyright (c) 2020 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. + */ + +#include "acelite_config.h" + +#ifdef FEATURE_COMPONENT_TABS + +#include "ace_log.h" +#include "keys.h" +#include "tabs_component.h" +#include "ui_label.h" +#include "ui_view_group.h" + +namespace OHOS { +namespace ACELite { +TabsComponent::TabsComponent(jerry_value_t options, jerry_value_t children, AppStyleManager* styleManager) + : Component(options, children, styleManager), + options_(options), + children_(children), + tabBarComponent_(nullptr), + tabContentComponent_(nullptr), + tabView_(nullptr), + changeListener_(nullptr), + list_(nullptr) +{ + SetComponentName(K_TABS); +} + +void TabsComponent::PreRender() +{ + if (!MatchChildren()) { + HILOG_ERROR(HILOG_MODULE_ACE, "Children not matched."); + } +} + +inline UIView *TabsComponent::GetComponentRootView() const +{ + return tabView_; +} + +bool TabsComponent::CreateNativeViews() +{ + if (tabBarComponent_ == nullptr || tabContentComponent_ == nullptr) { + return false; + } + tabView_ = new UITabView(GetTabBarLocation()); + if (tabView_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "Create tabView failed."); + return false; + } + tabView_->SetTitleSize(CalculateBarHeight()); + tabView_->SetTabSize(CalculateBarWidth()); + tabView_->SetAnimatorTime(tabsAnimationTime); + return true; +} + +void TabsComponent::ReleaseNativeViews() +{ + if (tabView_) { + delete tabView_; + tabView_ = nullptr; + } + if (changeListener_) { + delete changeListener_; + changeListener_ = nullptr; + } + if (list_) { + while (list_->Size() > 0) { + UIViewGroup* viewGroup = list_->Front(); + if (viewGroup) { + delete viewGroup; + viewGroup = nullptr; + } + list_->PopFront(); + } + delete list_; + list_ = nullptr; + } +} + +bool TabsComponent::ProcessChildren() +{ + uint8_t barLength = tabBarComponent_->GetChildrenLength(); + uint8_t contentLength = tabContentComponent_->GetChildrenLength(); + uint8_t length = (barLength > contentLength) ? contentLength : barLength; + + for (uint8_t index = 0; index < length; ++index) { + Component* component = tabContentComponent_->GetComponentByIndex(index); + if (component == nullptr) { + return false; + } + UIViewGroup* viewGroup = nullptr; + if (component->GetComponentName() == K_DIV || component->GetComponentName() == K_STACK) { + viewGroup = reinterpret_cast(component->GetComponentRootView()); + if (viewGroup == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "ViewGroup does not existed."); + return false; + } + } else { + if (list_ == nullptr) { + list_ = new List; + if (list_ == nullptr) { + return false; + } + } + viewGroup = new UIViewGroup(); + if (viewGroup == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "Create viewGroup failed."); + return false; + } + viewGroup->SetPosition(0, 0); + viewGroup->SetHeight(GetVerticalResolution()); + viewGroup->SetWidth(GetHorizontalResolution()); + viewGroup->Add(component->GetComponentRootView()); + list_->PushBack(viewGroup); + } + const char* text = tabBarComponent_->GetTextByIndex(index); + if (text == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "tab-bar's children is error."); + text = " "; + } + tabView_->AddPage(viewGroup, text); + } + return true; +} + +void TabsComponent::PostRender() +{ + tabView_->SetCurrentPage(GetInitPageIndex()); + tabView_->Layout(); +} + +bool TabsComponent::RegisterPrivateEventListener(uint16_t eventTypeId, jerry_value_t funcValue) +{ + if (!KeyParser::IsKeyValid(eventTypeId) || IS_UNDEFINED(funcValue)) { + return false; + } + if (eventTypeId == K_CHANGE) { + if (tabView_) { + changeListener_ = new ChangeListener(funcValue); + if (changeListener_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "Create ChangeListener error."); + return false; + } + tabView_->SetOnSwipeListener(changeListener_); + return true; + } + } + return false; +} + +bool TabsComponent::MatchChildren() +{ + if (jerry_value_is_undefined(children_)) { + HILOG_ERROR(HILOG_MODULE_ACE, "tabs's children does not exist."); + return false; + } + uint8_t length = jerry_get_array_length(children_); + if (length != tabsChildrenNum) { + HILOG_ERROR(HILOG_MODULE_ACE, "Only if one tab-bar and one tab-content."); + return false; + } + + for (uint8_t index = 0; index < length; ++index) { + jerry_value_t child = jerry_get_property_by_index(children_, index); + Component* component = ComponentUtils::GetComponentFromBindingObject(child); + if (component == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "tabs' children does not exist."); + jerry_release_value(child); + return false; + } + if (component->GetComponentName() == K_TAB_BAR) { + TabBarComponent* tabBarComponent = reinterpret_cast(component); + if (tabBarComponent == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "tabs children type is error."); + jerry_release_value(child); + return false; + } + tabBarComponent_ = tabBarComponent; + } else if (component->GetComponentName() == K_TAB_CONTENT) { + TabContentComponent* tabContentComponent = reinterpret_cast(component); + if (tabContentComponent == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "tabs children type is error."); + jerry_release_value(child); + return false; + } + tabContentComponent_ = tabContentComponent; + } else { + jerry_release_value(child); + HILOG_ERROR(HILOG_MODULE_ACE, "tabs children type is error."); + return false; + } + jerry_release_value(child); + } + if (tabBarComponent_ == nullptr || tabContentComponent_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "Only if one tab-bar and one tab-content."); + return false; + } + return true; +} + +UITabView::TitleLocation TabsComponent::GetTabBarLocation() +{ + jerry_value_t firstChildHandler = jerry_get_property_by_index(children_, 0); + + Component* component = ComponentUtils::GetComponentFromBindingObject(firstChildHandler); + if (component == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "MatchChildren should not passed."); + jerry_release_value(firstChildHandler); + return UITabView::TitleLocation::TOP; + } + UITabView::TitleLocation location; + if (component->GetComponentName() == K_TAB_BAR) { + location = UITabView::TitleLocation::TOP; + } else { + location = UITabView::TitleLocation::BOTTOM; + } + jerry_release_value(firstChildHandler); + return location; +} + +int16_t TabsComponent::CalculateBarHeight() +{ + return tabBarComponent_->GetHeight(); +} + +int16_t TabsComponent::CalculateBarWidth() +{ + int16_t width; + uint8_t barLength = tabBarComponent_->GetChildrenLength(); + uint8_t contentLength = tabContentComponent_->GetChildrenLength(); + uint8_t length = (barLength > contentLength) ? contentLength : barLength; + if ((tabBarComponent_->GetMode() != nullptr) && !strcmp(tabBarComponent_->GetMode(), TABS_VAL_SCROLL)) { + width = tabBarComponent_->GetWidth(); + } else { + width = GetHorizontalResolution(); + } + if (length == 0) { + return 0; + } + return width / length; +} + +int16_t TabsComponent::GetInitPageIndex() +{ + uint8_t barLength = tabBarComponent_->GetChildrenLength(); + uint8_t contentLength = tabContentComponent_->GetChildrenLength(); + uint8_t length = (barLength > contentLength) ? contentLength : barLength; + + jerry_value_t attrsKeyHandler = jerry_create_string(reinterpret_cast(ATTR_ATTRS)); + jerry_value_t attrsValHandler = jerry_get_property(options_, attrsKeyHandler); + if (jerry_value_is_undefined(attrsValHandler)) { + jerry_release_value(attrsKeyHandler); + return 0; + } + + jerry_value_t indexKeyHandler = jerry_create_string(reinterpret_cast(TABS_ATTR_INDEX)); + jerry_value_t indexValHandler = jerry_get_property(attrsValHandler, indexKeyHandler); + if (jerry_value_is_function(indexValHandler)) { + jerry_value_t globalObject = jerry_get_global_object(); + jerry_value_t appPropName = jerry_create_string((const jerry_char_t*)ATTR_ROOT); + jerry_value_t appViewModel = jerry_get_property(globalObject, appPropName); + jerry_value_t newIndexValHandler = jerry_call_function(indexValHandler, appViewModel, nullptr, 0); + if (newIndexValHandler != indexValHandler) { + jerry_release_value(indexValHandler); + indexValHandler = newIndexValHandler; + } + ReleaseJerryValue(appViewModel, appPropName, globalObject, VA_ARG_END_FLAG); + } + int16_t currentPage; + if (!jerry_value_is_undefined(indexValHandler) && !jerry_value_is_error(indexValHandler) + && (jerry_value_is_number(indexValHandler) || jerry_value_is_string(indexValHandler))) { + currentPage = IntegerOf(indexValHandler); + if (currentPage >= length || currentPage < 0) { + currentPage = 0; + } + } else { + currentPage = 0; + } + + ReleaseJerryValue(indexValHandler, indexKeyHandler, attrsValHandler, attrsKeyHandler, VA_ARG_END_FLAG); + + return currentPage; +} + +void TabsComponent::ChangeListener::OnSwipe(UISwipeView& view) +{ + if (jerry_value_is_undefined(fn_)) { + return; + } + + UITabView* tabView = reinterpret_cast(&view); + if (tabView == nullptr) { + return; + } + + const uint8_t argsNum = 1; + jerry_value_t args[argsNum]; + args[0] = jerry_create_object(); + jerry_value_t indexKeyHandler = jerry_create_string((const jerry_char_t*)TABS_ATTR_INDEX); + jerry_value_t indexValHandler = jerry_create_number(tabView->GetCurrentPage()); + jerry_value_t result = jerry_set_property(args[0], indexKeyHandler, indexValHandler); + ReleaseJerryValue(indexValHandler, indexKeyHandler, VA_ARG_END_FLAG); + if (jerry_value_is_error(result)) { + HILOG_ERROR(HILOG_MODULE_ACE, "set index value failed."); + jerry_release_value(args[0]); + jerry_release_value(result); + return; + } + jerry_release_value(result); + + jerry_value_t globalObject = jerry_get_global_object(); + jerry_value_t appPropName = jerry_create_string((const jerry_char_t*)ATTR_ROOT); + jerry_value_t appViewModel = jerry_get_property(globalObject, appPropName); + if (jerry_value_is_function(fn_)) { + jerry_value_t retVal = CallJSFunction(fn_, appViewModel, args, argsNum); + if (jerry_value_is_error(retVal)) { + HILOG_ERROR(HILOG_MODULE_ACE, "Change event is error."); + } + jerry_release_value(retVal); + } else { + HILOG_ERROR(HILOG_MODULE_ACE, "Change event is not a function."); + } + + ReleaseJerryValue(appViewModel, appPropName, globalObject, args[0], VA_ARG_END_FLAG); +} +} // namespace ACELite +} // namespace OHOS + +#endif // FEATURE_COMPONENT_TABS diff --git a/src/core/components/tabs_component.h b/src/core/components/tabs_component.h new file mode 100755 index 0000000..d518488 --- /dev/null +++ b/src/core/components/tabs_component.h @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2020 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. + */ + +#ifndef OHOS_ACELITE_TABS_COMPONENT_H +#define OHOS_ACELITE_TABS_COMPONENT_H + +#include "acelite_config.h" + +#ifdef FEATURE_COMPONENT_TABS + +#include "component.h" +#include "non_copyable.h" +#include "tab_bar_component.h" +#include "tab_content_component.h" +#include "ui_tab_view.h" + +namespace OHOS { +namespace ACELite { +constexpr char TABS_ATTR_INDEX[] = "index"; +constexpr char TABS_VAL_SCROLL[] = "scrollable"; +class TabsComponent final : public Component { +public: + ACE_DISALLOW_COPY_AND_MOVE(TabsComponent); + TabsComponent() = delete; + TabsComponent(jerry_value_t options, jerry_value_t children, AppStyleManager* styleManager); + ~TabsComponent() {} + +protected: + void PreRender() override; + bool CreateNativeViews() override; + UIView *GetComponentRootView() const override; + void ReleaseNativeViews() override; + bool ProcessChildren() override; + void PostRender() override; + bool RegisterPrivateEventListener(uint16_t eventTypeId, jerry_value_t funcValue) override; + +private: + bool MatchChildren(); + UITabView::TitleLocation GetTabBarLocation(); + int16_t CalculateBarHeight(); + int16_t CalculateBarWidth(); + int16_t GetInitPageIndex(); + + class ChangeListener : public UISwipeView::OnSwipeListener { + public: + ACE_DISALLOW_COPY_AND_MOVE(ChangeListener); + ChangeListener() = delete; + explicit ChangeListener(jerry_value_t fn) : fn_(jerry_acquire_value(fn)) {}; + ~ChangeListener() + { + jerry_release_value(fn_); + } + void OnSwipe(UISwipeView& view) override; + + private: + jerry_value_t fn_ = 0; + }; + jerry_value_t options_; + jerry_value_t children_; + TabBarComponent* tabBarComponent_; + TabContentComponent* tabContentComponent_; + UITabView* tabView_; + const int tabsChildrenNum = 2; + const int tabsAnimationTime = 0; + ChangeListener* changeListener_; + List* list_; +}; +} // namespace ACELite +} // namespace OHOS + +#endif // FEATURE_COMPONENT_TABS + +#endif // OHOS_ACELITE_TABS_COMPONENT_H diff --git a/src/core/components/text_component.cpp b/src/core/components/text_component.cpp new file mode 100755 index 0000000..0281818 --- /dev/null +++ b/src/core/components/text_component.cpp @@ -0,0 +1,251 @@ +/* + * Copyright (c) 2020 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. + */ + +#include "text_component.h" +#include +#include +#include "ace_log.h" +#include "font/ui_font_header.h" +#include "key_parser.h" +#include "keys.h" + +using namespace OHOS; + +namespace OHOS { +namespace ACELite { +TextComponent::TextComponent(jerry_value_t options, jerry_value_t children, AppStyleManager *styleManager) + : Component(options, children, styleManager), + uiLabel_(nullptr), + fontSize_(DEFAULT_FONT_SIZE), + fontFamily_(nullptr), + textValue_(nullptr), + overflowMode_(UILabel::LINE_BREAK_CLIP) +{ + SetComponentName(K_TEXT); +} + +bool TextComponent::CreateNativeViews() +{ + uiLabel_ = new UILabel(); + if (uiLabel_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "create native label failed"); + return false; + } + /* set default text OverFlow clip */ + uiLabel_->SetLineBreakMode(overflowMode_); + return CopyFontFamily(fontFamily_, DEFAULT_FONT_FAMILY); +} + +void TextComponent::ReleaseNativeViews() +{ + if (uiLabel_) { + delete uiLabel_; + uiLabel_ = nullptr; + } + ACE_FREE(textValue_); + ACE_FREE(fontFamily_); +} + +inline UIView *TextComponent::GetComponentRootView() const +{ + return uiLabel_; +} + +UILabel *TextComponent::GetUILabelView() const +{ + return uiLabel_; +} + +bool TextComponent::SetPrivateAttribute(uint16_t attrKeyId, jerry_value_t attrValue) +{ + switch (attrKeyId) { + case K_VALUE: { + ACE_FREE(textValue_); + textValue_ = MallocStringOf(attrValue); + break; + } + case K_SCROLLAMOUNT: { + int16_t speed = IntegerOf(attrValue); + uiLabel_->SetRollSpeed(speed); + break; + } + default: { + return false; + } + } + + return true; +} + +bool TextComponent::ApplyPrivateStyle(const AppStyleItem *styleItem) +{ + switch (GetStylePropNameId(styleItem)) { + case K_COLOR: + SetTextColor(*uiLabel_, styleItem); + break; + case K_LETTER_SPACING: + SetTextLetterSpace(*uiLabel_, styleItem); + break; + case K_TEXT_ALIGN: + SetTextAlign(*uiLabel_, styleItem); + break; + case K_FONT_SIZE: + SetTextSize(styleItem); + break; + case K_FONT_FAMILY: + if (!IsStyleValueTypeString(styleItem)) { + HILOG_ERROR(HILOG_MODULE_ACE, "text Family style value type is invalid!"); + return false; + } + CopyFontFamily(fontFamily_, GetStyleStrValue(styleItem)); + break; + case K_TEXT_OVERFLOW: + SetTextOverflow(*uiLabel_, styleItem); + break; + case K_LINE_HEIGHT: + SetTextLineHeight(*uiLabel_, styleItem); + break; + default: + return false; + } + + return true; +} + +void TextComponent::SetTextLetterSpace(UILabel &label, const AppStyleItem *styleItem) const +{ + label.SetStyle(STYLE_LETTER_SPACE, (int16_t)GetStylePixelValue(styleItem)); +} + +void TextComponent::SetTextLineHeight(UILabel &label, const AppStyleItem *styleItem) const +{ + label.SetStyle(STYLE_LINE_SPACE, (int16_t)GetStylePixelValue(styleItem)); +} + +void TextComponent::SetTextOverflow(UILabel &label, const AppStyleItem *styleItem) +{ + if (!IsStyleValueTypeString(styleItem)) { + HILOG_ERROR(HILOG_MODULE_ACE, "text overflow style value is invalid!"); + return; + } + // set ui label text OverFlow, LINE_BREAK_CLIP, TEXT_OVERFLOW_ELLIPSIS and TEXT_OVERFLOW_EXPAND are support + uint16_t propNameId = KeyParser::ParseKeyId(GetStyleStrValue(styleItem), GetStyleStrValueLen(styleItem)); + + switch (propNameId) { + case K_CLIP: + overflowMode_ = UILabel::LINE_BREAK_CLIP; + break; + case K_ELLIPSIS: + overflowMode_ = UILabel::LINE_BREAK_ELLIPSIS; + break; + case K_EXPAND: + overflowMode_ = UILabel::LINE_BREAK_ADAPT; + break; + case K_BREAK: + overflowMode_ = UILabel::LINE_BREAK_WRAP; + break; + default: + HILOG_WARN(HILOG_MODULE_ACE, "TextOverFlow id=%d is invalid, using default instead", propNameId); + break; + } + label.SetLineBreakMode(overflowMode_); +} + +void TextComponent::SetTextColor(UILabel &label, const AppStyleItem *styleItem) const +{ + uint32_t color = 0; + uint8_t alpha = OPA_OPAQUE; + if (GetStyleColorValue(styleItem, color, alpha)) { + label.SetStyle(STYLE_TEXT_COLOR, GetRGBColor(color).full); + label.SetStyle(STYLE_TEXT_OPA, alpha); + } +} + +void TextComponent::SetTextSize(const AppStyleItem *styleItem) +{ + fontSize_ = GetStylePixelValue(styleItem); +} + +void TextComponent::PostRender() +{ + if (GetHeight() < 0 && GetWidth() < 0) { + /* component height & width adjust text context when not set text height & text width */ + uiLabel_->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT); + } else if (GetHeight() < 0 && GetWidth() >= 0) { + /* component height adjust text context when set width not set text height */ + uiLabel_->SetLineBreakMode(UILabel::LINE_BREAK_WRAP); + } else if (GetHeight() >= 0 && GetWidth() < 0) { + /* component width adjust text context when not set text width */ + uiLabel_->SetLineBreakMode(UILabel::LINE_BREAK_STRETCH); + } + if (textValue_ != nullptr && fontFamily_ != nullptr) { + uiLabel_->SetFont(fontFamily_, fontSize_); + uiLabel_->SetText(textValue_); + } +} + +/* watchcallback update text context*/ +void TextComponent::PostUpdate(uint16_t attrKeyId, bool updateResult) +{ + if ((uiLabel_ == nullptr) || !updateResult || !KeyParser::IsKeyValid(attrKeyId)) { + HILOG_ERROR(HILOG_MODULE_ACE, "text component post update check args failed"); + return; + } + switch (attrKeyId) { + case K_VALUE: + if (textValue_ != nullptr) { + uiLabel_->SetText(textValue_); + } + break; + case K_FONT_SIZE: + case K_FONT_FAMILY: + if (fontFamily_ != nullptr) { + uiLabel_->SetFont(fontFamily_, fontSize_); + } + break; + default: + break; + } +} + +void TextComponent::SetTextAlign(UILabel &label, const AppStyleItem *styleItem) const +{ + if (!IsStyleValueTypeString(styleItem)) { + HILOG_ERROR(HILOG_MODULE_ACE, "text text align style value is invalid!"); + return; + } + // set ui label text align, ALIGN_LEFT, ALIGN_RIGHT, ALIGN_CENTER are support. + const char * const stylePropValue = GetStyleStrValue(styleItem); + uint16_t alignId = KeyParser::ParseKeyId(stylePropValue, GetStyleStrValueLen(styleItem)); + UITextLanguageAlignment align = UITextLanguageAlignment::TEXT_ALIGNMENT_LEFT; + switch (alignId) { + case K_LEFT: + align = UITextLanguageAlignment::TEXT_ALIGNMENT_LEFT; + break; + case K_RIGHT: + align = UITextLanguageAlignment::TEXT_ALIGNMENT_RIGHT; + break; + case K_CENTER: + align = UITextLanguageAlignment::TEXT_ALIGNMENT_CENTER; + break; + default: + HILOG_WARN(HILOG_MODULE_ACE, "text textAlign style value =%s is invalid, using default instead", + stylePropValue); + break; + } + label.SetAlign(align); +} +} // namespace ACELite +} // namespace OHOS diff --git a/src/core/components/text_component.h b/src/core/components/text_component.h new file mode 100755 index 0000000..31d6d3c --- /dev/null +++ b/src/core/components/text_component.h @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2020 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. + */ +#ifndef OHOS_ACELITE_TEXT_COMPONENT_H +#define OHOS_ACELITE_TEXT_COMPONENT_H + +#include "component.h" + +#include "js_app_context.h" +#include "js_fwk_common.h" +#include "non_copyable.h" +#include "ui_label.h" + +namespace OHOS { +namespace ACELite { +class TextComponent : public Component { +public: + ACE_DISALLOW_COPY_AND_MOVE(TextComponent); + TextComponent() = delete; + TextComponent(jerry_value_t options, jerry_value_t children, AppStyleManager* styleManager); + ~TextComponent() override {} + +protected: + bool CreateNativeViews() override; + void ReleaseNativeViews() override; + UIView *GetComponentRootView() const override; + bool SetPrivateAttribute(uint16_t attrKeyId, jerry_value_t attrValue) override; + bool ApplyPrivateStyle(const AppStyleItem* styleItem) override; + UILabel* GetUILabelView() const; + void PostRender() override; + void PostUpdate(uint16_t attrKeyId, bool updateResult) override; + +private: + // parse js text align style to ui_label + void SetTextAlign(UILabel& label, const AppStyleItem* styleItem) const; + // parse js text size style to fontSize_ + void SetTextSize(const AppStyleItem* styleItem); + // parse js text color style to ui_label + void SetTextColor(UILabel& label, const AppStyleItem* styleItem) const; + // parse js text overflow style to ui_label + void SetTextOverflow(UILabel& label, const AppStyleItem* styleItem); + // parse js text letter space style to ui_label + void SetTextLetterSpace(UILabel& label, const AppStyleItem* styleItem) const; + // parse js text line height style to ui_label + void SetTextLineHeight(UILabel& label, const AppStyleItem* styleItem) const; + UILabel* uiLabel_; + uint8_t fontSize_; + char* fontFamily_; + char* textValue_; + uint8_t overflowMode_; +}; +} // namespace ACELite +} // namespace OHOS + +#endif // OHOS_ACELITE_TEXT_COMPONENT_H diff --git a/src/core/components/video_component.cpp b/src/core/components/video_component.cpp new file mode 100755 index 0000000..5661001 --- /dev/null +++ b/src/core/components/video_component.cpp @@ -0,0 +1,633 @@ +/* + * Copyright (c) 2020 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. + */ +#include "acelite_config.h" +#ifdef FEATURE_COMPONENT_VIDEO +#include "video_component.h" +#include "ace_log.h" +#include "key_parser.h" +#include "keys.h" + +#ifdef FEATURE_UPDATE_VIDEO_PROGRESS_ASYNC +#include +#include "ace_ability.h" +#endif // FEATURE_UPDATE_VIDEO_PROGRESS_ASYNC + +namespace OHOS { +namespace ACELite { +const char * const VideoComponent::FUNC_START = "start"; +const char * const VideoComponent::FUNC_PAUSE = "pause"; +const char * const VideoComponent::FUNC_SET_CURRENT_TIME = "setCurrentTime"; +const char * const VideoComponent::FUNC_SET_Volume = "setVolume"; +List VideoComponent::componentNodes_; + +#ifdef FEATURE_UPDATE_VIDEO_PROGRESS_ASYNC +pthread_mutex_t VideoComponent::updateLock_ = PTHREAD_MUTEX_INITIALIZER; +pthread_cond_t VideoComponent::updateCondition_ = PTHREAD_COND_INITIALIZER; +#endif // FEATURE_UPDATE_VIDEO_PROGRESS_ASYN + +VideoComponent::VideoComponent(jerry_value_t options, jerry_value_t children, AppStyleManager *styleManager) + : Component(options, children, styleManager), + videoSourceUrl_(nullptr), + videoView_(nullptr), + videoEventListener_(nullptr), + videoSliderListener_(nullptr), + videoPlayImageClickListener_(nullptr), + autoPlay_(false), + videoMuted_(false), + isPlaying_(false), + isReleasing_(false), + isUpdatingHandlerQuited_(false) +{ + SetComponentName(K_VIDEO); + RegisterNativeFunctions(); +} + +void VideoComponent::RegisterNativeFunctions() +{ + RegisterNamedFunction(FUNC_START, Start); + RegisterNamedFunction(FUNC_PAUSE, Pause); + RegisterNamedFunction(FUNC_SET_CURRENT_TIME, SetCurrentTime); + RegisterNamedFunction(FUNC_SET_Volume, SetVolume); +} + +void VideoComponent::UpdatePlayImageInfo(bool playFlag) +{ + PanelView* panelView = const_cast(videoView_->GetPanelView()); + if (panelView == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "video panel get panelview is nullptr"); + return; + } + UIImageView *playImageView = const_cast(panelView->GetVideoPlayImage()); + if (playImageView == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "video panel get play image view is nullptr"); + return; + } + const ImageInfo* imageSrc = playFlag ? GetVideoPlayImageOffInfo() : GetVideoPlayImageOnInfo(); + playImageView->SetSrc(imageSrc); + if (videoPlayImageClickListener_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "video panel get image click listener is nullptr"); + return; + } + videoPlayImageClickListener_->setVideoPlayImageClickStatus(playFlag); +} +JSValue VideoComponent::Start(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t args[], + const jerry_length_t argsNum) +{ + VideoView *nativeVideo = reinterpret_cast(ComponentUtils::GetViewFromBindingObject(context)); + if (nativeVideo == nullptr) { + return UNDEFINED; + } + VideoComponent *videoComponent + = reinterpret_cast(ComponentUtils::GetComponentFromBindingObject(context)); + if (videoComponent == nullptr) { + return UNDEFINED; + } + if ((nativeVideo->Play()) != 0) { + HILOG_ERROR(HILOG_MODULE_ACE, "call VideoComponent::Start failed"); + return UNDEFINED; + } + videoComponent->UpdatePlayImageInfo(true); + HILOG_DEBUG(HILOG_MODULE_ACE, "nativeVideo Start"); + return UNDEFINED; +} + +JSValue VideoComponent::Pause(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t args[], + const jerry_length_t argsNum) +{ + VideoView *nativeVideo = reinterpret_cast(ComponentUtils::GetViewFromBindingObject(context)); + if (nativeVideo == nullptr) { + return UNDEFINED; + } + VideoComponent *videoComponent = + reinterpret_cast(ComponentUtils::GetComponentFromBindingObject(context)); + if (videoComponent == nullptr) { + return UNDEFINED; + } + if ((nativeVideo->Pause()) != 0) { + HILOG_ERROR(HILOG_MODULE_ACE, "call VideoComponent::Pause failed"); + return UNDEFINED; + } + // update panel info + videoComponent->UpdatePlayImageInfo(false); + return UNDEFINED; +} + +JSValue VideoComponent::SetCurrentTime(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t args[], + const jerry_length_t argsNum) +{ + VideoView *nativeVideo = reinterpret_cast(ComponentUtils::GetViewFromBindingObject(context)); + if (nativeVideo == nullptr || argsNum != 1) { + return UNDEFINED; + } + int16_t currentTime = IntegerOf(args[0]); + if (nativeVideo->SeekTo(currentTime * PanelView::MILLIONS_PER_SECOND) != 0) { + HILOG_ERROR(HILOG_MODULE_ACE, "call VideoComponent::SetCurrentTime failed"); + return UNDEFINED; + } + // update panel view slider info + nativeVideo->UpdatePanelTimeText(true); + return UNDEFINED; +} + +JSValue VideoComponent::SetVolume(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t args[], + const jerry_length_t argsNum) +{ + VideoView *nativeVideo = reinterpret_cast(ComponentUtils::GetViewFromBindingObject(context)); + if (nativeVideo != nullptr && argsNum == 1) { + int16_t volumeValue = IntegerOf(args[0]); + if ((nativeVideo->SetVolume(volumeValue)) != 0) { + HILOG_ERROR(HILOG_MODULE_ACE, "call VideoComponent::SetVolume failed"); + return UNDEFINED; + } + } + return UNDEFINED; +} + +bool VideoComponent::CreateNativeViews() +{ + videoView_ = new VideoView(); + if (videoView_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "VideoComponent: create VideoView object failed!"); + return false; + } + videoView_->SetPlayStateCallback(this); + if (!videoView_->CreateVideoView()) { + return false; + } + videoSliderListener_ = new VideoSliderEventListener(videoView_); + if (videoSliderListener_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "create videoSliderListener_ event failed"); + return false; + } + videoPlayImageClickListener_ = new VideoPlayImageOnClickListener(videoView_); + if (videoPlayImageClickListener_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "create video slider listener failed"); + return false; + } + videoEventListener_ = std::make_shared(videoView_, videoPlayImageClickListener_); + if (videoEventListener_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "VideoComponent: create videoEventListener_ failed!"); + return false; + } + if (!RegisterVideoEventListener()) { + return false; + } + AddComponentNode(this); + PrepareProgressUpdatingThread(); + return true; +} + +void VideoComponent::ReleaseNativeViews() +{ + RemoveComponentNode(this); + SetComponentReleasingFlag(true); + // wait until the updating thread destroyed + pthread_cond_signal(&updateCondition_); + while (!isUpdatingHandlerQuited_) { + const uint16_t waitThreadDestoryTime = 20000; + usleep(waitThreadDestoryTime); + } + ACE_DELETE(videoView_); + ACE_DELETE(videoSliderListener_); + ACE_DELETE(videoPlayImageClickListener_); + ACE_FREE(videoSourceUrl_); + SetComponentReleasingFlag(false); +} +UIView *VideoComponent::GetComponentRootView() const +{ + return videoView_; +} + +VideoView *VideoComponent::GetVideoView() const +{ + return videoView_; +} + +bool VideoComponent::RegisterVideoEventListener() +{ + PanelView* videoPanelView = const_cast(videoView_->GetPanelView()); + if (videoPanelView == nullptr) { + return false; + } + + UISlider *videoSlider = const_cast(videoPanelView->GetVideoSlider()); + if (videoSlider == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "create get video slider failed"); + return false; + } + videoSlider->SetSliderEventListener(videoSliderListener_); + videoSlider->SetOnClickListener(videoSliderListener_); + videoSlider->SetTouchable(true); + videoSlider->SetDraggable(true); + + UIImageView *videoPlayImage = const_cast(videoPanelView->GetVideoPlayImage()); + if (videoPlayImage == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "create get video play image failed"); + return false; + } + videoPlayImage->SetOnClickListener(videoPlayImageClickListener_); + videoPlayImage->SetTouchable(true); + + UIImageView *videoMutedImage = const_cast(videoPanelView->GetVideoMutedImage()); + if (videoMutedImage == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "create get video muted image failed"); + return false; + } + videoMutedImage->SetOnClickListener(videoPlayImageClickListener_); + videoMutedImage->SetTouchable(true); + + Media::Player *videoPlayer = const_cast(videoView_->GetVideoPlayer()); + if (videoPlayer == nullptr) { + return false; + } + videoPlayer->SetPlayerCallback(videoEventListener_); + videoView_->SetPlayEventListener(videoEventListener_); + return true; +} + +bool VideoComponent::RegisterPrivateEventListener(uint16_t eventTypeId, jerry_value_t funcValue) +{ + if (videoEventListener_ == nullptr || videoView_ == nullptr || videoSliderListener_ == nullptr) { + return false; + } + switch (eventTypeId) { + case K_ERROR: + HILOG_DEBUG(HILOG_MODULE_ACE, "VideoComponent: RegisterListener && bind ERROR callback function"); + videoEventListener_->SetOnErrorFuncName(funcValue); + break; + case K_PREPARED: + HILOG_DEBUG(HILOG_MODULE_ACE, "VideoComponent: RegisterListener && bind PREPARED callback function"); + videoView_->SetPrepareSyncCBFunc(funcValue); + break; + case K_START: + HILOG_DEBUG(HILOG_MODULE_ACE, "VideoComponent: RegisterListener && bind START callback function"); + videoView_->SetStartSyncCBFunc(funcValue); + break; + case K_PAUSE: + HILOG_DEBUG(HILOG_MODULE_ACE, "VideoComponent: RegisterListener && bind PAUSE callback function"); + videoView_->SetPauseSyncCBFunc(funcValue); + break; + case K_FINISH: + HILOG_DEBUG(HILOG_MODULE_ACE, "VideoComponent: RegisterListener && bind FINISH callback function"); + videoEventListener_->SetOnPlayCompleteFuncName(funcValue); + break; + case K_SEEKING: + HILOG_DEBUG(HILOG_MODULE_ACE, "VideoComponent: RegisterListener && bind SEEKING callback function"); + videoSliderListener_->SetOnPlaySeekingFuncName(funcValue); + break; + case K_SEEKED: + HILOG_DEBUG(HILOG_MODULE_ACE, "VideoComponent: RegisterListener && bind SEEKED callback function"); + videoEventListener_->SetOnPlaySeekedFuncName(funcValue); + break; + case K_TIME_UPDATE: + HILOG_DEBUG(HILOG_MODULE_ACE, "VideoComponent: RegisterListener && bind TIME_UPDATE callback function"); + videoView_->SetTimeUpdateSyncCBFunc(funcValue); + break; + default: + return false; + } + return true; +} + +bool VideoComponent::SetPrivateAttribute(uint16_t attrKeyId, jerry_value_t attrValue) +{ + switch (attrKeyId) { + case K_MUTED: { + SetMuted(attrValue); + break; + } + case K_SRC: { + SetVideoSource(attrValue); + break; + } + case K_AUTOPLAY: { + SetVideoAutoPlay(attrValue); + break; + } + case K_CONTROLS: { + SetVideoControls(attrValue); + break; + } + default: { + return false; + } + } + return true; +} + +void VideoComponent::SetMuted(jerry_value_t attrValue) +{ + videoMuted_ = BoolOf(attrValue); + if (videoView_ != nullptr) { + videoView_->setMuted(videoMuted_); + } +} + +void VideoComponent::SetVideoSource(jerry_value_t attrValue) +{ + ACE_FREE(videoSourceUrl_); + videoSourceUrl_ = MallocStringOf(attrValue); + if (videoView_ != nullptr) { + videoView_->SetVideoSrc(videoSourceUrl_); + } +} + +void VideoComponent::SetVideoAutoPlay(jerry_value_t attrValue) +{ + autoPlay_ = BoolOf(attrValue); + if (videoView_ != nullptr) { + videoView_->SetAutoPlayFlag(autoPlay_); + } +} + +void VideoComponent::SetVideoControls(jerry_value_t attrValue) +{ + if ((videoView_ != nullptr) && !BoolOf(attrValue)) { + videoView_->HideVideoPanel(); + } +} + +bool VideoComponent::ApplyPrivateStyle(const AppStyleItem *style) +{ + return false; +} + +bool VideoComponent::SetPanelView() +{ + if (videoView_ == nullptr || videoPlayImageClickListener_ == nullptr) { + return false; + } + PanelView *panelView = const_cast(videoView_->GetPanelView()); + if (panelView == nullptr) { + return false; + } + /* set video total time and slider range */ + int64_t totalPlayTime = 0; + if (videoView_->GetDuration(totalPlayTime) == 0) { + UISlider *slider = const_cast(panelView->GetVideoSlider()); + if (slider == nullptr || totalPlayTime < 0 || totalPlayTime >= PanelView::MAX_SHOW_TIME) { + return false; + } + slider->SetRange(totalPlayTime / PanelView::MILLIONS_PER_SECOND, 0); + } + + /* set panel info when autoPlay */ + UIImageView *playImageView = const_cast(panelView->GetVideoPlayImage()); + if (playImageView == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "video panel get play image view is nullptr"); + return false; + } + // set total video time to total label + videoView_->UpdatePanelTimeText(false); + if (autoPlay_) { + if ((videoView_->Play()) == 0) { + playImageView->SetSrc(GetVideoPlayImageOffInfo()); + videoPlayImageClickListener_->setVideoPlayImageClickStatus(true); + } else { + HILOG_ERROR(HILOG_MODULE_ACE, "video play failed"); + return false; + } + } else { + playImageView->SetSrc(GetVideoPlayImageOnInfo()); + videoPlayImageClickListener_->setVideoPlayImageClickStatus(false); + } + /* set video volume & panel muted image */ + videoView_->UpdateMutedStatus(); + videoPlayImageClickListener_->setVideoMutedImageClickStatus(videoMuted_); + videoView_->PanelRefreshLayout(); + return true; +} + +void VideoComponent::PostRender() +{ + if (videoView_ == nullptr) { + return; + } + videoView_->SetVideoView(); + if (videoView_->SetSource(videoSourceUrl_) != 0) { + HILOG_ERROR(HILOG_MODULE_ACE, "PostRender video view SetSource failed"); + return; + } + if (videoView_->Prepare() != 0) { + HILOG_ERROR(HILOG_MODULE_ACE, "PostRender video view prepare failed"); + return; + } + if (SetPanelView() == false) { + HILOG_ERROR(HILOG_MODULE_ACE, "PostRender set panel view failed"); + return; + } +} + +void VideoComponent::PostUpdate(uint16_t attrKeyId, bool updateResult) +{ + if ((videoView_ == nullptr) || !updateResult) { + HILOG_ERROR(HILOG_MODULE_ACE, "video component post update check args failed"); + return; + } + videoView_->WaitRebuildPlayerFinish(); + videoView_->SetVideoView(); + if (SetPanelView() == false) { + HILOG_ERROR(HILOG_MODULE_ACE, "PostUpdate set panel view failed"); + return; + } +} +void VideoComponent::SetComponentReleasingFlag(bool releasing) +{ + isReleasing_ = releasing; +} + +#ifdef FEATURE_UPDATE_VIDEO_PROGRESS_ASYNC +void VideoComponent::PrepareProgressUpdatingThread() +{ + int ret = pthread_mutex_init(&updateLock_, nullptr); + if (ret != 0) { + HILOG_ERROR(HILOG_MODULE_ACE, "mutex init failed, %{public}d", ret); + return; + } + ret = pthread_cond_init(&updateCondition_, nullptr); + if (ret != 0) { + HILOG_ERROR(HILOG_MODULE_ACE, "condition init failed, %{public}d", ret); + (void)pthread_mutex_destroy(&updateLock_); + return; + } + pthread_t tid; + pthread_attr_t attr; + pthread_attr_init(&attr); + pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); + ret = pthread_create(&tid, &attr, VideoComponent::UpdateProgressHandler, this); + if (ret != 0) { + HILOG_ERROR(HILOG_MODULE_ACE, "create video progress updating thread error, %{public}d", ret); + (void)pthread_mutex_destroy(&updateLock_); + (void)pthread_cond_destroy(&updateCondition_); + return; + } +} + +void VideoComponent::UpdateProgress() +{ + if (isReleasing_ || !(isPlaying_)) { + return; + } + if (videoView_ != nullptr) { + videoView_->UpdatePanelProgress(); + } +} + +void VideoComponent::SetVideoPlayingFlag(bool playing) +{ + isPlaying_ = playing; +} + +bool VideoComponent::IsVideoPlaying() const +{ + return isPlaying_; +} + +bool VideoComponent::IsComponentReleasing() const +{ + return isReleasing_; +} + +void VideoComponent::NotifyUpdatingThreadDestroy() +{ + (void)pthread_cond_destroy(&updateCondition_); + (void)pthread_mutex_destroy(&updateLock_); + isUpdatingHandlerQuited_ = true; +} + +void VideoComponent::AddComponentNode(Component *component) +{ + if (component == nullptr) { + return; + } + componentNodes_.PushBack(component); +} + +void VideoComponent::RemoveComponentNode(const Component *component) +{ + if (component == nullptr) { + return; + } + ListNode *node = componentNodes_.Begin(); + while (node != componentNodes_.End()) { + if (node->data_ == component) { + componentNodes_.Remove(node); + break; + } + node = node->next_; + } +} + +bool VideoComponent::ContainComponentNode(Component *component) +{ + if (component == nullptr) { + return false; + } + ListNode *node = componentNodes_.Begin(); + while (node != componentNodes_.End()) { + if (node->data_ == component) { + return true; + } + node = node->next_; + } + return false; +} + +void VideoComponent::OnPlayStateChanged(VideoPlayState newState) +{ + HILOG_INFO(HILOG_MODULE_ACE, "OnPlayStateChanged called newState[%{public}d]", newState); + int ret = pthread_mutex_lock(&updateLock_); + if (ret != 0) { + HILOG_ERROR(HILOG_MODULE_ACE, "mutex lock failed when playing state changed, %{public}d", ret); + return; + } + switch (newState) { + case VideoPlayState::STATE_PLAYING: + SetVideoPlayingFlag(true); + ret = pthread_cond_signal(&updateCondition_); + if (ret != 0) { + HILOG_ERROR(HILOG_MODULE_ACE, "condition signal failed when playing state changed, %{public}d", ret); + } + break; + default: + SetVideoPlayingFlag(false); + break; + } + ret = pthread_mutex_unlock(&updateLock_); + if (ret != 0) { + HILOG_ERROR(HILOG_MODULE_ACE, "mutex unlock failed when playing state changed, %{public}d", ret); + } +} + +/* seperated thread to trigger all update progress request */ +void *VideoComponent::UpdateProgressHandler(void *arg) +{ + prctl(PR_SET_NAME, "UpdateProgressHandler"); + auto videoComponent = static_cast(arg); + if (videoComponent == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "videoComponent is nullptr, fail to start loop"); + return nullptr; + } + + HILOG_INFO(HILOG_MODULE_ACE, "start video progress updating loop"); + while (!(videoComponent->IsComponentReleasing())) { + if (videoComponent->IsVideoPlaying()) { + auto task = [videoComponent]() { + // critical case that the video component has been released but the task is already in queue + if (!ContainComponentNode(videoComponent)) { + return; + } + videoComponent->UpdateProgress(); + }; + HILOG_DEBUG(HILOG_MODULE_ACE, "video update progress"); + AceAbility::PostUITask(task); + usleep(PanelView::UPDATE_CYCLE_MICRO_SECONDS); // request to update for every 250ms + } else { + // if the video is paused no need to post task + int ret = pthread_mutex_lock(&updateLock_); + if (ret != 0) { + HILOG_ERROR(HILOG_MODULE_ACE, "mutex lock failed when updating progress, %{public}d", ret); + break; + } + HILOG_INFO(HILOG_MODULE_ACE, "--- video panel update thread wating ----"); + ret = pthread_cond_wait(&updateCondition_, &updateLock_); + if (ret != 0) { + HILOG_ERROR(HILOG_MODULE_ACE, "condition wait failed when updating progress, %{public}d", ret); + (void)pthread_mutex_unlock(&updateLock_); + break; + } + ret = pthread_mutex_unlock(&updateLock_); + if (ret != 0) { + HILOG_ERROR(HILOG_MODULE_ACE, "mutex unlock failed when updating progress, %{public}d", ret); + break; + } + } + } + videoComponent->NotifyUpdatingThreadDestroy(); + return nullptr; +} +#endif // FEATURE_UPDATE_VIDEO_PROGRESS_ASYNC +} // namespace ACELite +} // namespace OHOS + +#endif // FEATURE_COMPONENT_VIDEO diff --git a/src/core/components/video_component.h b/src/core/components/video_component.h new file mode 100755 index 0000000..cc08ca4 --- /dev/null +++ b/src/core/components/video_component.h @@ -0,0 +1,393 @@ +/* + * Copyright (c) 2020 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. + */ +#ifndef OHOS_ACELITE_VIDEO_COMPONENT_H +#define OHOS_ACELITE_VIDEO_COMPONENT_H + +#include "acelite_config.h" +#ifdef FEATURE_COMPONENT_VIDEO +#ifdef FEATURE_UPDATE_VIDEO_PROGRESS_ASYNC +#include +#include +#endif // FEATURE_UPDATE_VIDEO_PROGRESS_ASYNC +#include "component.h" +#include "list.h" +#include "panel_view.h" +#include "video_state_callback.h" +#include "video_view.h" + +namespace OHOS { +namespace ACELite { +class VideoPlayImageOnClickListener final : public UIView::OnClickListener { +public: + ACE_DISALLOW_COPY_AND_MOVE(VideoPlayImageOnClickListener); + explicit VideoPlayImageOnClickListener(VideoView *aceVideo) + : video_(aceVideo), + videoPlayImageClick_(false), + videoMutedImageClick_(false) {} + ~VideoPlayImageOnClickListener() {} + bool OnClick(UIView &view, const ClickEvent &event) override + { + if (video_ == nullptr) { + return false; + } + UIImageView *image = reinterpret_cast(&view); + if (image == nullptr) { + return false; + } + PanelView* panelView = const_cast(video_->GetPanelView()); + if (panelView == nullptr) { + return false; + } + UIImageView* playImage = const_cast(panelView->GetVideoPlayImage()); + if (playImage != nullptr && playImage == image) { + if (SetPlayImageInfo(playImage) == false) { + HILOG_ERROR(HILOG_MODULE_ACE, "set play image info failed."); + return false; + } + } + + UIImageView* mutedImage = const_cast(panelView->GetVideoMutedImage()); + if (mutedImage != nullptr && mutedImage == image) { + if (SetMutedImageInfo(mutedImage) == false) { + HILOG_ERROR(HILOG_MODULE_ACE, "set muted image info failed."); + return false; + } + } + video_->PanelRefreshLayout(); + return true; + } + + bool SetPlayImageInfo(UIImageView* playImage) + { + if (video_ == nullptr || playImage == nullptr) { + return false; + } + if (videoPlayImageClick_) { + if ((video_->Pause()) == 0) { + playImage->SetSrc(GetVideoPlayImageOnInfo()); + videoPlayImageClick_ = false; + return true; + } + } else { + if ((video_->Play()) == 0) { + playImage->SetSrc(GetVideoPlayImageOffInfo()); + videoPlayImageClick_ = true; + return true; + } + } + return false; + } + + bool SetMutedImageInfo(UIImageView* mutedImage) + { + if (video_ == nullptr || mutedImage == nullptr) { + return false; + } + if (videoMutedImageClick_) { + if (video_->SetVolume(PanelView::DEFAULT_VOLUME_VALUE) == 0) { + mutedImage->SetSrc(GetVideoMutedImageOnInfo()); + videoMutedImageClick_ = false; + return true; + } + } else { + if (video_->SetVolume(0) == 0) { + mutedImage->SetSrc(GetVideoMutedImageOffInfo()); + video_->setMuted(true); + videoMutedImageClick_ = true; + return true; + } + } + return false; + } + + bool setVideoPlayImageClickStatus(bool status) + { + videoPlayImageClick_ = status; + return true; + } + + bool setVideoMutedImageClickStatus(bool status) + { + videoMutedImageClick_ = status; + return true; + } + +private: + VideoView* video_; + bool videoPlayImageClick_; + bool videoMutedImageClick_; +}; + +class VideoSliderEventListener final: public UISlider::UISliderEventListener, public UISlider::OnClickListener { +public: + ACE_DISALLOW_COPY_AND_MOVE(VideoSliderEventListener); + explicit VideoSliderEventListener(VideoView *aceVideo) + : video_(aceVideo), playSeekingFunc_(UNDEFINED), progressValue_(0) {} + ~VideoSliderEventListener() + { + ReleaseJerryValue(playSeekingFunc_, VA_ARG_END_FLAG); + } + + void OnChange(int16_t progress) override + { + if (video_ == nullptr) { + return; + } + progressValue_ = progress; + Media::Player* videoPlayer = const_cast(video_->GetPlayer()); + if (videoPlayer != nullptr && videoPlayer->IsPlaying()) { + // when slider changing && videoPlayer is playing, notify UpdateProgressHandler stop update + video_->UpdatePlayState(VideoPlayState::STATE_STOPPED); + } + video_->SetCurrentPlayTimeText(progress); + // call js registered on seeking function + if (!jerry_value_is_function(playSeekingFunc_)) { + return; + } + video_->CallJSFunctionWithOnePara(playSeekingFunc_, progress); + } + + bool OnClick(UIView& view, const ClickEvent& event) override + { + if (SetPlayPositionInfo(progressValue_)) { + HILOG_DEBUG(HILOG_MODULE_ACE, "slider onClick video to %{public}d", progressValue_); + return true; + } + return false; + } + void OnRelease(int16_t progress) override + { + if (SetPlayPositionInfo(progress)) { + HILOG_DEBUG(HILOG_MODULE_ACE, "slider release video to %{public}d", progress); + } + } + + bool SetPlayPositionInfo(int16_t progressValue) + { + if (video_ == nullptr) { + return false; + } + int64_t playPosition = progressValue * PanelView::MILLIONS_PER_SECOND; + if (video_->SeekTo(playPosition) == 0) { + video_->SetCurrentPlayTimeText(progressValue); + Media::Player* videoPlayer = const_cast(video_->GetPlayer()); + if (videoPlayer != nullptr && videoPlayer->IsPlaying()) { + // when slider clicked && videoPlayer is playing, notify UpdateProgressHandler start update + video_->UpdatePlayState(VideoPlayState::STATE_PLAYING); + } + } + return true; + } + + void SetOnPlaySeekingFuncName(jerry_value_t bindFunc) + { + playSeekingFunc_ = jerry_acquire_value(bindFunc); + } +private: + VideoView* video_; + jerry_value_t playSeekingFunc_; + int16_t progressValue_; +}; + +class VideoEventListener final: public OHOS::Media::PlayerCallback { +public: + ACE_DISALLOW_COPY_AND_MOVE(VideoEventListener); + VideoEventListener(VideoView *aceVideo, VideoPlayImageOnClickListener *imageClickListener) + : playErrorFunc_(UNDEFINED), + playCompleteFunc_(UNDEFINED), + playSeekedFunc_(UNDEFINED), + video_(aceVideo), + playImageListener_(imageClickListener) {} + + ~VideoEventListener() + { + ReleaseJerryValue(playErrorFunc_, playCompleteFunc_, playSeekedFunc_, VA_ARG_END_FLAG); + } + void OnError(int32_t errorType, int32_t errorCode) override + { + if (video_ == nullptr) { + return; + } + video_->UpdatePlayState(VideoPlayState::STATE_STOPPED); + if (jerry_value_is_function(playErrorFunc_)) { + CallJSFunctionAutoRelease(playErrorFunc_, UNDEFINED, nullptr, 0); + } + HILOG_DEBUG(HILOG_MODULE_ACE, "video play errorType = %{public}d, errCode= %{public}d", errorType, errorCode); + } + + void OnPlaybackComplete() override + { + if (video_ == nullptr) { + return; + } + video_->UpdatePlayState(VideoPlayState::STATE_STOPPED); + video_->PrepareRebuildPlayerThread(); + // call js complete function + if (jerry_value_is_function(playCompleteFunc_)) { + CallJSFunctionAutoRelease(playCompleteFunc_, UNDEFINED, nullptr, 0); + } + // update play image when video play complete + PanelView* panelView = const_cast(video_->GetPanelView()); + if (panelView == nullptr) { + return; + } + UIImageView* playImage = const_cast(panelView->GetVideoPlayImage()); + if (playImage == nullptr || playImageListener_ == nullptr) { + return; + } + playImage->SetSrc(GetVideoPlayImageOnInfo()); + playImageListener_->setVideoPlayImageClickStatus(false); + video_->PanelRefreshLayout(); + HILOG_DEBUG(HILOG_MODULE_ACE, "video play complete."); + } + + void OnInfo(int type, int extra) override + { + HILOG_DEBUG(HILOG_MODULE_ACE, "video play on Info. type= %{public}d, extra= %{public}d", type, extra); + } + + void OnVideoSizeChanged(int width, int height) override + { + HILOG_DEBUG(HILOG_MODULE_ACE, "Video Size Changed. width= %{public}d, height= %{public}d", width, height); + } + + void OnRewindToComplete() override + { + if (video_ == nullptr) { + return; + } + PanelView* panelView = const_cast(video_->GetPanelView()); + if (panelView == nullptr) { + return; + } + const UISlider* slider = panelView->GetVideoSlider(); + if (slider == nullptr) { + return; + } + int16_t sliderValue = slider->GetValue(); + if (!jerry_value_is_function(playSeekedFunc_)) { + return; + } + video_->CallJSFunctionWithOnePara(playSeekedFunc_, sliderValue); + HILOG_DEBUG(HILOG_MODULE_ACE, "video seek to play complete."); + } + + void SetOnErrorFuncName(jerry_value_t bindFunc) + { + playErrorFunc_ = jerry_acquire_value(bindFunc); + } + + void SetOnPlayCompleteFuncName(jerry_value_t bindFunc) + { + playCompleteFunc_ = jerry_acquire_value(bindFunc); + } + + void SetOnPlaySeekedFuncName(jerry_value_t bindFunc) + { + playSeekedFunc_ = jerry_acquire_value(bindFunc); + } + +private: + jerry_value_t playErrorFunc_; + jerry_value_t playCompleteFunc_; + jerry_value_t playSeekedFunc_; + VideoView* video_; + VideoPlayImageOnClickListener* playImageListener_; +}; + +class VideoComponent : public Component, public VideoStateCallback { +public: + ACE_DISALLOW_COPY_AND_MOVE(VideoComponent); + VideoComponent(jerry_value_t options, jerry_value_t children, AppStyleManager* styleManager); + ~VideoComponent() override {} + void OnPlayStateChanged(VideoPlayState newState) override; + +protected: + bool CreateNativeViews() override; + void ReleaseNativeViews() override; + UIView *GetComponentRootView() const override; + bool SetPrivateAttribute(uint16_t attrKeyId, jerry_value_t attrValue) override; + bool ApplyPrivateStyle(const AppStyleItem* style) override; + void PostRender() override; + void PostUpdate(uint16_t attrKeyId, bool updateResult) override; + bool RegisterPrivateEventListener(uint16_t eventTypeId, jerry_value_t funcValue) override; + + static List componentNodes_; + +private: + VideoView *GetVideoView() const; + bool SetPanelView(); + void SetMuted(jerry_value_t attrValue); + void SetVideoSource(jerry_value_t attrValue); + void SetVideoAutoPlay(jerry_value_t attrValue); + void SetVideoControls(jerry_value_t attrValue); + void RegisterNativeFunctions(); + bool RegisterVideoEventListener(); + void PrepareProgressUpdatingThread(); + void UpdatePlayImageInfo(bool playFlag); + void UpdateProgress(); + void SetVideoPlayingFlag(bool playing); + void SetComponentReleasingFlag(bool releasing); + bool IsComponentReleasing() const; + bool IsVideoPlaying() const; + void NotifyUpdatingThreadDestroy(); + static void AddComponentNode(Component *component); + static void RemoveComponentNode(const Component *component); + static bool ContainComponentNode(Component *component); + static void VideoStateCallback(VideoPlayState state); + static void *UpdateProgressHandler(void *arg); + + static JSValue Start(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t args[], + const jerry_length_t argsNum); + static JSValue Pause(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t args[], + const jerry_length_t argsNum); + static JSValue SetCurrentTime(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t args[], + const jerry_length_t argsNum); + + static JSValue SetVolume(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t args[], + const jerry_length_t argsNum); + + static const char * const FUNC_START; + static const char * const FUNC_PAUSE; + static const char * const FUNC_SET_CURRENT_TIME; + static const char * const FUNC_SET_Volume; + + char* videoSourceUrl_; + VideoView* videoView_; + std::shared_ptr videoEventListener_; + VideoSliderEventListener* videoSliderListener_; + VideoPlayImageOnClickListener* videoPlayImageClickListener_; + bool autoPlay_; + bool videoMuted_; + bool isPlaying_; + bool isReleasing_; + bool isUpdatingHandlerQuited_; +#ifdef FEATURE_UPDATE_VIDEO_PROGRESS_ASYNC + static pthread_mutex_t updateLock_; + static pthread_cond_t updateCondition_; +#endif // FEATURE_UPDATE_VIDEO_PROGRESS_ASYNC +}; +} // namespace ACELite +} // namespace OHOS +#endif // FEATURE_COMPONENT_VIDEO +#endif // OHOS_ACELITE_VIDEO_COMPONENT_H diff --git a/src/core/components/video_state_callback.h b/src/core/components/video_state_callback.h new file mode 100755 index 0000000..189fd07 --- /dev/null +++ b/src/core/components/video_state_callback.h @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2020 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. + */ +#ifndef OHOS_ACELITE_VIDEO_STATE_CALLBACK_H +#define OHOS_ACELITE_VIDEO_STATE_CALLBACK_H + +#include "acelite_config.h" +#ifdef FEATURE_COMPONENT_VIDEO + +#include + +#include "non_copyable.h" + +namespace OHOS { +namespace ACELite { +/* playing state */ +enum VideoPlayState : uint8_t { + STATE_PLAYING, + STATE_PAUSED, + STATE_STOPPED +}; + +class VideoStateCallback : public MemoryHeap { +public: + ACE_DISALLOW_COPY_AND_MOVE(VideoStateCallback); + VideoStateCallback() = default; + ~VideoStateCallback() = default; + virtual void OnPlayStateChanged(VideoPlayState newState) = 0; +}; +} +} +#endif // FEATURE_COMPONENT_VIDEO +#endif // OHOS_ACELITE_VIDEO_STATE_CALLBACK_H \ No newline at end of file diff --git a/src/core/components/video_view.cpp b/src/core/components/video_view.cpp new file mode 100755 index 0000000..dd13108 --- /dev/null +++ b/src/core/components/video_view.cpp @@ -0,0 +1,532 @@ +/* + * Copyright (c) 2020 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. + */ +#include "acelite_config.h" +#ifdef FEATURE_COMPONENT_VIDEO + +#include "video_view.h" +#include "video_state_callback.h" + +namespace OHOS { +namespace ACELite { +pthread_mutex_t VideoView::rebuildPlayerlock_ = PTHREAD_MUTEX_INITIALIZER; +pthread_cond_t VideoView::rebuildPlayerCondition_ = PTHREAD_COND_INITIALIZER; + +VideoView::VideoView() + : panelView_(nullptr), + videoPlayer_(nullptr), + surfaceView_(nullptr), + playEventListener_(nullptr), + playStateCallback_(nullptr), + preparedSyncCallBackFunc_(UNDEFINED), + startSyncCallBackFunc_(UNDEFINED), + pauseSyncCallBackFunc_(UNDEFINED), + timeUpdateSyncCallBackFunc_(UNDEFINED), + videoSrc_(nullptr), + mutedFlag_(false), + autoPlayFlag_(false) {} + +bool VideoView::CreateVideoView() +{ + videoPlayer_ = new Media::Player(); + surfaceView_ = new UISurfaceView(); + panelView_ = new PanelView(); + if (videoPlayer_ == nullptr || surfaceView_ == nullptr || panelView_ == nullptr || !(panelView_->InitView())) { + return false; + } + Add(surfaceView_); + Add(panelView_); + SetLayoutDirection(LAYOUT_VER); + SetMajorAxisAlign(OHOS::ALIGN_END); + LayoutChildren(); + return true; +} +void VideoView::SetVideoView() +{ + SetSurfaceView(); + SetVideoPanel(); +} + +void VideoView::SetSurfaceView() +{ + if (surfaceView_ == nullptr) { + HILOG_DEBUG(HILOG_MODULE_ACE, "native VideoView get surfaceView is nullptr"); + return; + } + surfaceView_->SetPosition(0, 0); + surfaceView_->SetWidth(GetWidth()); + surfaceView_->SetHeight(GetHeight() - PanelView::DEFAULT_PANEL_HEIGHT); +} + +void VideoView::PanelRefreshLayout() +{ + if (panelView_ == nullptr) { + return; + } + panelView_->LayoutChildren(); + panelView_->Invalidate(); + LayoutChildren(); +} + +VideoView::~VideoView() +{ + if (!DestoryPlayer()) { + HILOG_ERROR(HILOG_MODULE_ACE, "videoView destroy player failed"); + } + ACE_DELETE(panelView_); + ACE_DELETE(surfaceView_); + jerry_release_value(preparedSyncCallBackFunc_); + jerry_release_value(startSyncCallBackFunc_); + jerry_release_value(pauseSyncCallBackFunc_); + jerry_release_value(timeUpdateSyncCallBackFunc_); + (void)pthread_mutex_destroy(&rebuildPlayerlock_); + (void)pthread_cond_destroy(&rebuildPlayerCondition_); +} + +const Media::Player *VideoView::GetVideoPlayer() const +{ + return videoPlayer_; +} + +/* player info */ +int32_t VideoView::Prepare() +{ + if ((videoPlayer_ != nullptr) && (surfaceView_ != nullptr) && (videoPlayer_->Prepare() == 0)) { + Surface *surface = surfaceView_->GetSurface(); + if (surface == nullptr) { + HILOG_DEBUG(HILOG_MODULE_ACE, "surfaceView get surface failed"); + return -1; + } + videoPlayer_->SetVideoSurface(surface); + /* call js prepare sync callback function */ + if (jerry_value_is_function(preparedSyncCallBackFunc_)) { + CallJSFunctionAutoRelease(preparedSyncCallBackFunc_, UNDEFINED, nullptr, 0); + } + HILOG_DEBUG(HILOG_MODULE_ACE, "native VideoView prepare"); + return 0; + } + return -1; +} +int32_t VideoView::Play() +{ + if ((videoPlayer_ != nullptr) && (videoPlayer_->Play() == 0)) { + /* call js start play sync callback function */ + if (jerry_value_is_function(startSyncCallBackFunc_)) { + CallJSFunctionAutoRelease(startSyncCallBackFunc_, UNDEFINED, nullptr, 0); + } + UpdatePlayState(VideoPlayState::STATE_PLAYING); + HILOG_DEBUG(HILOG_MODULE_ACE, "native VideoView play"); + return 0; + } + return -1; +} +int32_t VideoView::Pause() +{ + if ((videoPlayer_ != nullptr) && (videoPlayer_->Pause() == 0)) { + /* call js pause play sync callback function */ + if (jerry_value_is_function(pauseSyncCallBackFunc_)) { + CallJSFunctionAutoRelease(pauseSyncCallBackFunc_, UNDEFINED, nullptr, 0); + } + UpdatePlayState(VideoPlayState::STATE_PAUSED); + HILOG_DEBUG(HILOG_MODULE_ACE, "native VideoView Pause"); + return 0; + } + return -1; +} +int32_t VideoView::Stop() +{ + if ((videoPlayer_ != nullptr) && (videoPlayer_->Stop() == 0)) { + HILOG_DEBUG(HILOG_MODULE_ACE, "native VideoView Stop"); + UpdatePlayState(VideoPlayState::STATE_STOPPED); + return 0; + } + return -1; +} + +bool VideoView::WaitRebuildPlayerFinish() +{ + int retCode = pthread_mutex_lock(&rebuildPlayerlock_); + if (retCode != 0) { + HILOG_ERROR(HILOG_MODULE_ACE, "WaitRebuildPlayerFinish mutex lock failed: %d", retCode); + return false; + } + PrepareRebuildPlayerThread(); + (void)pthread_cond_wait(&rebuildPlayerCondition_, &rebuildPlayerlock_); + retCode = pthread_mutex_unlock(&rebuildPlayerlock_); + if (retCode != 0) { + HILOG_ERROR(HILOG_MODULE_ACE, "WaitRebuildPlayerFinish mutex unlock failed: %d", retCode); + return false; + } + return true; +} +void VideoView::PrepareRebuildPlayerThread() +{ + pthread_t threadId; + pthread_attr_t attr; + pthread_attr_init(&attr); + pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); + int retCode = pthread_create(&threadId, &attr, VideoView::RebuildPlayerHandler, this); + if (retCode != 0) { + HILOG_ERROR(HILOG_MODULE_ACE, "fork play complete thread failed, %{public}d", retCode); + return; + } +} + +void *VideoView::RebuildPlayerHandler(void *arg) +{ + VideoView *videoView = (VideoView *)arg; + HILOG_DEBUG(HILOG_MODULE_ACE, "rebuild player handler"); + prctl(PR_SET_NAME, "VideoPlayerRebuildHandler"); + if (!videoView->ResetPlayer()) { + HILOG_ERROR(HILOG_MODULE_ACE, "videoView reset player failed"); + } + return nullptr; +} + +bool VideoView::ResetPlayer() +{ + (void)pthread_mutex_lock(&rebuildPlayerlock_); + if (!DestoryPlayer()) { + HILOG_ERROR(HILOG_MODULE_ACE, "videoView destroy player failed"); + } + if (!CreatePlayer()) { + HILOG_ERROR(HILOG_MODULE_ACE, "videoView create player failed"); + } + (void)pthread_mutex_unlock(&rebuildPlayerlock_); + int retCode = pthread_cond_signal(&rebuildPlayerCondition_); + if (retCode != 0) { + HILOG_ERROR(HILOG_MODULE_ACE, "mutex unlock failed: %d", retCode); + return false; + } + return true; +} + +bool VideoView::DestoryPlayer() +{ + if (videoPlayer_ == nullptr) { + return false; + } + if (videoPlayer_->IsPlaying() && videoPlayer_->Stop() != 0) { + HILOG_ERROR(HILOG_MODULE_ACE, "DestoryPlayer fail to stop videoplayer"); + } + if (videoPlayer_->Reset() != 0) { + HILOG_ERROR(HILOG_MODULE_ACE, "DestoryPlayer fail to reset videoplayer"); + } + if (videoPlayer_->Release() != 0) { + HILOG_ERROR(HILOG_MODULE_ACE, "DestoryPlayer fail to release videoplayer"); + } + delete videoPlayer_; + videoPlayer_ = nullptr; + HILOG_DEBUG(HILOG_MODULE_ACE, "delete player"); + return true; +} + +bool VideoView::CreatePlayer() +{ + videoPlayer_ = new Media::Player(); + if (videoPlayer_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "fail to create videoplayer"); + return false; + } + videoPlayer_->SetPlayerCallback(playEventListener_); + const float volumeValue = mutedFlag_ ? 0 : PanelView::DEFAULT_VOLUME_VALUE; + SetVolume(volumeValue); + if (SetSource(videoSrc_) != 0) { + HILOG_ERROR(HILOG_MODULE_ACE, "video view SetSource failed"); + return false; + } + if (Prepare() != 0) { + HILOG_ERROR(HILOG_MODULE_ACE, "video view prepare failed"); + return false; + } + HILOG_DEBUG(HILOG_MODULE_ACE, "reCreate player success"); + return true; +} + +void VideoView::UpdatePlayState(VideoPlayState newState) +{ + if (playStateCallback_ != nullptr) { + playStateCallback_->OnPlayStateChanged(newState); + } +} + +int32_t VideoView::SeekTo(int64_t currentTime) +{ + if ((videoPlayer_ != nullptr) && + videoPlayer_->Rewind(currentTime, Media::PlayerSeekMode::PLAYER_SEEK_CLOSEST_SYNC) == 0) { + HILOG_DEBUG(HILOG_MODULE_ACE, "native VideoView SeekTo %{public}lld", currentTime); + return 0; + } + return -1; +} + +int32_t VideoView::SetVolume(float volumeValue) +{ + if ((videoPlayer_ != nullptr) && videoPlayer_->SetVolume(volumeValue, volumeValue) == 0) { + HILOG_DEBUG(HILOG_MODULE_ACE, "native VideoView setVolume %{public}f", volumeValue); + return 0; + } + return -1; +} + +int32_t VideoView::GetCurrentPosition(int64_t ¤tPosition) +{ + if ((videoPlayer_ != nullptr) && videoPlayer_->GetCurrentTime(currentPosition) == 0) { + HILOG_DEBUG(HILOG_MODULE_ACE, "native VideoView GetCurrentTime %{public}lld", currentPosition); + return 0; + } + return -1; +} + +/* get video total time */ +int32_t VideoView::GetDuration(int64_t &duration) +{ + if ((videoPlayer_ != nullptr) && videoPlayer_->GetDuration(duration) == 0) { + HILOG_DEBUG(HILOG_MODULE_ACE, "native VideoView GetDuration %{public}lld", duration); + return 0; + } + return -1; +} + +int32_t VideoView::SetSource(const char * const videoSourceUrl) +{ + if ((videoPlayer_ == nullptr) || (videoSourceUrl == nullptr)) { + HILOG_DEBUG(HILOG_MODULE_ACE, "native VideoView videoSourceUrl is nullptr"); + return -1; + } + std::string uri(videoSourceUrl); + std::map header; + Media::Source source(uri, header); + if (videoPlayer_->SetSource(source) == 0) { + HILOG_DEBUG(HILOG_MODULE_ACE, "native VideoView set source success, %{public}s", videoSourceUrl); + return 0; + } + return -1; +} + +/* pannel info */ +bool VideoView::HideVideoPanel() +{ + if (panelView_ == nullptr) { + return false; + } + UILabel* curPlayTime = const_cast(panelView_->GetCurTimeText()); + if (curPlayTime != nullptr) { + curPlayTime->SetVisible(false); + } + UIImageView* playImage = const_cast(panelView_->GetVideoPlayImage()); + if (playImage != nullptr) { + playImage->SetVisible(false); + } + UISlider* slider = const_cast(panelView_->GetVideoSlider()); + if (slider != nullptr) { + slider->SetVisible(false); + } + UILabel* totalTimeLabel = const_cast(panelView_->GetVideoTotalTimeText()); + if (totalTimeLabel != nullptr) { + totalTimeLabel->SetVisible(false); + } + UIImageView* mutedImage = const_cast(panelView_->GetVideoMutedImage()); + if (mutedImage != nullptr) { + mutedImage->SetVisible(false); + } + + panelView_->SetVisible(false); + PanelRefreshLayout(); + HILOG_DEBUG(HILOG_MODULE_ACE, "native VideoView hide control panel"); + return true; +} + +void VideoView::SetVideoPanel() +{ + if (panelView_ == nullptr) { + HILOG_DEBUG(HILOG_MODULE_ACE, "native VideoView get panel view is nullptr"); + return; + } + const int16_t panelViewWidth = GetWidth(); + const int16_t panelViewHeight = PanelView::DEFAULT_PANEL_HEIGHT; + const int16_t imageWidth = 48; + const int16_t imageHeight = 48; + /* set panelView layout children from left to right in one row */ + (reinterpret_cast(panelView_))->SetLayoutDirection(LAYOUT_HOR); + SetMajorAxisAlign(OHOS::ALIGN_CENTER); + panelView_->SetWidth(panelViewWidth); + panelView_->SetHeight(panelViewHeight); + /* set video current play time label in video panel */ + + UILabel* curTimeLabel = const_cast(panelView_->GetCurTimeText()); + if (curTimeLabel != nullptr) { + panelView_->SetTextInPanel(curTimeLabel); + } + UIImageView* playImage = const_cast(panelView_->GetVideoPlayImage()); + if (playImage != nullptr) { + panelView_->SetImageInPanel(playImage, imageWidth, imageHeight, GetVideoPlayImageOnInfo()); + } + /* set video total time label in video panel */ + UILabel* totalTimeLabel = const_cast(panelView_->GetVideoTotalTimeText()); + if (totalTimeLabel != nullptr) { + panelView_->SetTextInPanel(totalTimeLabel); + } + /* set muted image in video panel */ + UIImageView* mutedImage = const_cast(panelView_->GetVideoMutedImage()); + if (mutedImage != nullptr) { + panelView_->SetImageInPanel(mutedImage, imageWidth, imageHeight, GetVideoMutedImageOffInfo()); + } + /* video slider set last in video panel, because slider width depend others */ + panelView_->SetVideoSlider(); +} + +void VideoView::UpdatePanelProgress() +{ + // update current play postion time + UpdatePanelTimeText(true); +} + +void VideoView::SetCurrentPlayTimeText(int16_t inSeconds) +{ + if (panelView_ == nullptr || inSeconds <= 0 || inSeconds >= (PanelView::MAX_HOURS * PanelView::SECONDS_PER_HOUR)) { + HILOG_ERROR(HILOG_MODULE_ACE, "input duration inSeconds time exception"); + return; + } + UILabel *curTimeLabel = const_cast(panelView_->GetCurTimeText()); + if (curTimeLabel == nullptr) { + return; + } + const uint8_t timeStrLength = 16; + char timeStr[timeStrLength] = {0}; + FormatTime(inSeconds, timeStr, timeStrLength); + curTimeLabel->SetText(timeStr); + curTimeLabel->Invalidate(); +} + +void VideoView::UpdatePanelTimeText(bool currentTime) +{ + if (panelView_ == nullptr) { + return; + } + UILabel *timeLabel = currentTime ? + const_cast(panelView_->GetCurTimeText()) : + const_cast(panelView_->GetVideoTotalTimeText()); + if (timeLabel == nullptr) { + return; + } + + int64_t duration = 0; + if (currentTime) { + if (GetCurrentPosition(duration) != 0) { + HILOG_ERROR(HILOG_MODULE_ACE, "UpdatePanelTimeText GetCurrentPosition failed"); + return; + } + } else { + if (GetDuration(duration) != 0) { + HILOG_ERROR(HILOG_MODULE_ACE, "UpdatePanelTimeText GetDuration failed"); + return; + } + } + if (duration < 0 || duration >= PanelView::MAX_SHOW_TIME) { + HILOG_ERROR(HILOG_MODULE_ACE, "input duration exception"); + duration = 0; + } + const uint8_t timeStrLength = 16; + char timeStr[timeStrLength] = {0}; + FormatTime((duration / PanelView::MILLIONS_PER_SECOND), timeStr, timeStrLength); + HILOG_DEBUG(HILOG_MODULE_ACE, "--- set time =%{public}s -----", timeStr); + timeLabel->SetText(timeStr); + timeLabel->Invalidate(); + // update video slider status when play changed + UISlider* videoSlider = const_cast(panelView_->GetVideoSlider()); + if (videoSlider != nullptr && currentTime) { + videoSlider->SetValue(duration / PanelView::MILLIONS_PER_SECOND); + videoSlider->Invalidate(); + // call js timeupdate callback function + if (!jerry_value_is_function(timeUpdateSyncCallBackFunc_)) { + return; + } + CallJSFunctionWithOnePara(timeUpdateSyncCallBackFunc_, duration / PanelView::MILLIONS_PER_SECOND); + } +} + +void VideoView::UpdateMutedStatus() +{ + if (panelView_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "video view get mpanelView_ is nullptr"); + return; + } + UIImageView *mutedImageView = const_cast(panelView_->GetVideoMutedImage()); + if (mutedImageView == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "video view get muted image view is nullptr"); + return; + } + float volumeValue = mutedFlag_ ? 0 : PanelView::DEFAULT_VOLUME_VALUE; + const ImageInfo* mutedImageSrc = mutedFlag_ ? GetVideoMutedImageOffInfo() : GetVideoMutedImageOnInfo(); + if (SetVolume(volumeValue) != 0) { + HILOG_ERROR(HILOG_MODULE_ACE, "video set volume failed"); + return; + } + mutedImageView->SetSrc(mutedImageSrc); +} + +void VideoView::FormatTime(uint32_t inSeconds, char *outBuffer, uint8_t bufferLength) +{ + if (inSeconds >= (PanelView::MAX_HOURS * PanelView::SECONDS_PER_HOUR)) { + HILOG_ERROR(HILOG_MODULE_ACE, "input duration time exception"); + return; + } + const uint8_t minBufferLength = 6; // xx:xx + const uint8_t minBufferLength2 = 9; // xx:xx:xx + if (outBuffer == nullptr) { + return; + } + uint8_t hours = inSeconds / PanelView::SECONDS_PER_HOUR; + uint32_t remainSeconds = inSeconds % PanelView::SECONDS_PER_HOUR; + uint8_t minutes = remainSeconds / PanelView::SECONDS_PER_MINUTE; + uint8_t seconds = remainSeconds % PanelView::SECONDS_PER_MINUTE; + if (hours >= PanelView::MAX_HOURS) { + HILOG_ERROR(HILOG_MODULE_ACE, "input video length more than the max length"); + return; + } + if (hours == 0) { + if (sprintf_s(outBuffer, bufferLength, "%02d:%02d", minutes, seconds) < 0) { + HILOG_ERROR(HILOG_MODULE_ACE, "xx:xx transfer error"); + return; + } + outBuffer[minBufferLength - 1] = '\0'; + } else { + if (sprintf_s(outBuffer, bufferLength, "%02d:%02d:%02d", hours, minutes, seconds) < 0) { + HILOG_ERROR(HILOG_MODULE_ACE, "xx:xx:xx transfer error"); + return; + } + outBuffer[minBufferLength2 - 1] = '\0'; + } +} + +void VideoView::CallJSFunctionWithOnePara(const jerry_value_t &callBackFunc, const int64_t inputValue) +{ + if (!jerry_value_is_function(callBackFunc)) { + return; + } + jerry_value_t value = jerry_create_number(inputValue); + jerry_value_t args[1]; + args[0] = jerry_create_object(); + const char attrName[] = "currenttime"; + jerry_value_t result = jerryx_set_property_str(args[0], attrName, value); + if (!jerry_value_is_error(result)) { + CallJSFunctionAutoRelease(callBackFunc, jerry_create_undefined(), args, 1); + } + ReleaseJerryValue(result, args[0], value, VA_ARG_END_FLAG); +} +} // namespace ACELite +} // namespace OHOS + +#endif // FEATURE_COMPONENT_VIDEO diff --git a/src/core/components/video_view.h b/src/core/components/video_view.h new file mode 100755 index 0000000..3b25b41 --- /dev/null +++ b/src/core/components/video_view.h @@ -0,0 +1,203 @@ +/* + * Copyright (c) 2020 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. + */ +#ifndef OHOS_ACELITE_VIDEO_VIEW_H +#define OHOS_ACELITE_VIDEO_VIEW_H + +#include "acelite_config.h" +#ifdef FEATURE_COMPONENT_VIDEO +#include +#include +#include +#include "ace_log.h" +#include "flex_layout.h" +#include "js_fwk_common.h" +#include "js_app_context.h" +#include "panel_view.h" +#include "player.h" +#include "ui_font.h" +#include "ui_image_view.h" +#include "ui_label.h" +#include "ui_slider.h" +#include "ui_surface_view.h" +#include "ui_text_language.h" +#include "ui_view.h" +#include "ui_view_group.h" +#include "video_state_callback.h" + +namespace OHOS { +namespace ACELite { +class VideoView : public FlexLayout, public MemoryHeap { +public: + ACE_DISALLOW_COPY_AND_MOVE(VideoView); + VideoView(); + ~VideoView(); + bool CreateVideoView(); + void SetVideoView(); + void PanelRefreshLayout(); + + /* player info */ + int32_t Prepare(); + + int32_t Play(); + + int32_t Pause(); + + int32_t Stop(); + + int32_t SeekTo(int64_t currentTime); + + int32_t SetVolume(float volumeValue); + + int32_t GetCurrentPosition(int64_t ¤tPosition); + + int32_t GetDuration(int64_t &duration); + + int32_t SetSource(const char * const videoSourceUrl); + + const Media::Player* GetPlayer() const + { + return videoPlayer_; + } + + /* video pannel info */ + const PanelView* GetPanelView() const + { + return panelView_; + } + + const bool GetMuted() const + { + return mutedFlag_; + } + + void setMuted(bool muted) + { + mutedFlag_ = muted; + } + + void SetVideoSrc(char* src) + { + videoSrc_ = src; + } + + const bool GetAutoPlayFlag() const + { + return autoPlayFlag_; + } + + void SetAutoPlayFlag(bool autoPlayFlag) + { + autoPlayFlag_ = autoPlayFlag; + } + + void UpdateMutedStatus(); + + bool HideVideoPanel(); + + const Media::Player* GetVideoPlayer() const; + + void UpdatePanelProgress(); + + void SetPlayStateCallback(VideoStateCallback *callback) + { + playStateCallback_ = callback; + } + + void UpdatePlayState(VideoPlayState newState); + + bool WaitRebuildPlayerFinish(); + + void PrepareRebuildPlayerThread(); + + /* set video event sync call back functions */ + void SetPlayEventListener(const std::shared_ptr &cb) + { + playEventListener_ = cb; + } + + const std::shared_ptr GetPlayEventListener() const + { + return playEventListener_; + } + + const jerry_value_t GetPrepareSyncCBFunc() const + { + return preparedSyncCallBackFunc_; + } + + const jerry_value_t GetStartSyncCBFunc() const + { + return startSyncCallBackFunc_; + } + + const jerry_value_t GetPauseSyncCBFunc() const + { + return pauseSyncCallBackFunc_; + } + + const jerry_value_t GetTimeUpdateSyncCBFunc() const + { + return timeUpdateSyncCallBackFunc_; + } + + void SetPrepareSyncCBFunc(jerry_value_t& callBackFunc) + { + preparedSyncCallBackFunc_ = jerry_acquire_value(callBackFunc); + } + void SetStartSyncCBFunc(jerry_value_t& callBackFunc) + { + startSyncCallBackFunc_ = jerry_acquire_value(callBackFunc); + } + void SetPauseSyncCBFunc(jerry_value_t& callBackFunc) + { + pauseSyncCallBackFunc_ = jerry_acquire_value(callBackFunc); + } + void SetTimeUpdateSyncCBFunc(jerry_value_t& callBackFunc) + { + timeUpdateSyncCallBackFunc_ = jerry_acquire_value(callBackFunc); + } + + void FormatTime(uint32_t inSeconds, char* outBuffer, uint8_t bufferLength); + void UpdatePanelTimeText(bool currentTime = true); + void SetCurrentPlayTimeText(int16_t progress); + void CallJSFunctionWithOnePara(const jerry_value_t &callBackFunc, const int64_t inputValue); +private: + void SetVideoPanel(); + void SetSurfaceView(); + bool ResetPlayer(); + bool DestoryPlayer(); + bool CreatePlayer(); + static void *RebuildPlayerHandler(void *arg); + static pthread_mutex_t rebuildPlayerlock_; + static pthread_cond_t rebuildPlayerCondition_; + + PanelView* panelView_; + Media::Player* videoPlayer_; + UISurfaceView* surfaceView_; + std::shared_ptr playEventListener_; + VideoStateCallback* playStateCallback_; + jerry_value_t preparedSyncCallBackFunc_; + jerry_value_t startSyncCallBackFunc_; + jerry_value_t pauseSyncCallBackFunc_; + jerry_value_t timeUpdateSyncCallBackFunc_; + char* videoSrc_; + bool mutedFlag_; + bool autoPlayFlag_; +}; +} // namespace ACELite +} // namespace OHOS + +#endif // FEATURE_COMPONENT_VIDEO +#endif // OHOS_ACELITE_VIDEO_VIEW_H diff --git a/src/core/context/BUILD.gn b/src/core/context/BUILD.gn new file mode 100755 index 0000000..99dff77 --- /dev/null +++ b/src/core/context/BUILD.gn @@ -0,0 +1,37 @@ +#Copyright (c) 2020 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. + +declare_args() { + enable_hos_ace_fafwk_test = false +} + +source_set("context") { + configs += [ + "//foundation/ace/lite/jsfwk:ace_config", + ] + + if(enable_hos_ace_fafwk_test == true) { + defines += ["HOS_ACE_FAFWK_TEST"] + } + + sources = [ + "js_ability.cpp", + "js_ability_impl.cpp", + "js_app_context.cpp", + "js_app_environment.cpp", + "js_profiler.cpp", + "js_timer_list.cpp", + ] + include_dirs = [ + ] +} diff --git a/src/core/context/ace_ability.cpp b/src/core/context/ace_ability.cpp new file mode 100755 index 0000000..3e82981 --- /dev/null +++ b/src/core/context/ace_ability.cpp @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2020 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. + */ +#include "ace_ability.h" + +#include "ability_env.h" +#include "ace_log.h" +#include "ace_mem_base.h" +#include "js_fwk_common.h" +#include "root_view.h" + +namespace OHOS { +namespace ACELite { +AbilityEventHandler *AceAbility::eventHandler_ = nullptr; +AceAbility *AceAbility::topAbility_ = nullptr; + +REGISTER_AA(AceAbility) + +void AceAbility::OnStart(const Want &want) +{ + HILOG_DEBUG(HILOG_MODULE_ACE, "AceAbility OnStart"); + eventHandler_ = AbilityEventHandler::GetCurrentHandler(); + + const char * const abilitySrcPath = GetSrcPath(); + const char * const bundleName = GetBundleName(); + HILOG_DEBUG(HILOG_MODULE_ACE, "ace ability src path = %s", abilitySrcPath); + HILOG_DEBUG(HILOG_MODULE_ACE, "ace ability bundle name = %s", bundleName); + + char* jsBundlePath = RelocateJSSourceFilePath(abilitySrcPath, "assets/js/default/"); + HILOG_DEBUG(HILOG_MODULE_ACE, "ace ability js bundle path = %s", jsBundlePath); + const uint16_t token = 0xff; // js ability's token is hidden by AMS + jsAbility_.Launch(jsBundlePath, bundleName, (uint16_t)token); + ACE_FREE(jsBundlePath); + RootView *rootView = RootView::GetInstance(); + if (rootView == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "get rootView is nullptr"); + return; + } + SetUIContent(rootView); + Ability::OnStart(want); + HILOG_DEBUG(HILOG_MODULE_ACE, "AceAbility OnStart Done"); +} + +void AceAbility::OnInactive() +{ + HILOG_DEBUG(HILOG_MODULE_ACE, "AceAbility OnInactive"); + topAbility_ = nullptr; + Ability::OnInactive(); + HILOG_DEBUG(HILOG_MODULE_ACE, "AceAbility OnInactive Done"); +} + +void AceAbility::OnActive(const Want &want) +{ + HILOG_DEBUG(HILOG_MODULE_ACE, "AceAbility OnActive"); + Ability::OnActive(want); + jsAbility_.Show(); + topAbility_ = this; + HILOG_DEBUG(HILOG_MODULE_ACE, "AceAbility OnActive Done"); +} + +void AceAbility::OnBackground() +{ + HILOG_DEBUG(HILOG_MODULE_ACE, "AceAbility OnBackground"); + Ability::OnBackground(); + jsAbility_.Hide(); + HILOG_DEBUG(HILOG_MODULE_ACE, "AceAbility OnBackground Done"); +} + +void AceAbility::OnStop() +{ + HILOG_DEBUG(HILOG_MODULE_ACE, "AceAbility OnStop"); + Ability::OnStop(); + jsAbility_.TransferToDestroy(); + HILOG_DEBUG(HILOG_MODULE_ACE, "AceAbility OnStop Done"); +} + +bool AceAbility::PostUITask(std::function task) +{ + if (eventHandler_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "AceAbility PostUITask failed as eventHandler_ is null!"); + return false; + } + eventHandler_->PostTask(task); + return true; +} + +void AceAbility::TerminateSelf() +{ + if (topAbility_ != nullptr) { + topAbility_->TerminateAbility(); + } +} +} // namespace ACELite +} // namespace OHOS diff --git a/src/core/context/ace_ability.h b/src/core/context/ace_ability.h new file mode 100755 index 0000000..539d037 --- /dev/null +++ b/src/core/context/ace_ability.h @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2020 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. + */ +#ifndef OHOS_ACELITE_ACE_ABILITY_H +#define OHOS_ACELITE_ACE_ABILITY_H + +#include + +#include "ability.h" +#include "ability_event_handler.h" +#include "ability_loader.h" +#include "js_ability.h" + +#ifdef OHOS_ACELITE_PRODUCT_WATCH +#error AceAbility only be used for L1 upper +#endif + +namespace OHOS { +namespace ACELite { +class AceAbility final : public Ability { +public: + static bool PostUITask(std::function task); + static void TerminateSelf(); + +protected: + void OnStart(const Want &want) override; + void OnInactive() override; + void OnActive(const Want &want) override; + void OnBackground() override; + void OnStop() override; + +private: + JSAbility jsAbility_; + static AbilityEventHandler *eventHandler_; + static AceAbility *topAbility_; +}; +} // namespace ACELite +} // namespace OHOS +#endif // OHOS_ACELITE_ACE_ABILITY_H diff --git a/src/core/context/ace_event_error_code.cpp b/src/core/context/ace_event_error_code.cpp new file mode 100755 index 0000000..0e4c12a --- /dev/null +++ b/src/core/context/ace_event_error_code.cpp @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2020 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. + */ + + +#include "ace_event_error_code.h" +#ifdef FEATURE_ACELITE_MC_EVENT_ERROR_CODE_PRINT +namespace OHOS { +namespace ACELite { +EventErrorCodePrint *EventErrorCodePrint::GetInstance() +{ + static EventErrorCodePrint printInstance; + return &printInstance; +} + +void EventErrorCodePrint::AceEventPrint(MC_U8 info2, MC_U8 info3) +{ + EventPrintf(MT_ACE, MT_ACE_FWK, info2, info3); +} + +void EventErrorCodePrint::AceEventPrint(MC_U8 info1, MC_U8 info2, MC_U8 info3) +{ + EventPrintf(MT_ACE, info1, info2, info3); +} + +void EventErrorCodePrint::AceErrorCodePrint(MC_U8 info2, MC_U16 rfu) +{ + ErrorCodePrintf(EXCE_ACE, EXCE_ACE_FWK, info2, rfu); +} +} // namespace ACELite +} // namespace OHOS +#endif // FEATURE_ACELITE_MC_EVENT_ERROR_CODE_PRINT diff --git a/src/core/context/ace_event_error_code.h b/src/core/context/ace_event_error_code.h new file mode 100755 index 0000000..95e90a2 --- /dev/null +++ b/src/core/context/ace_event_error_code.h @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2020 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. + */ + +#ifndef OHOS_ACELITE_ACE_EVENT_ERROR_CODE_H +#define OHOS_ACELITE_ACE_EVENT_ERROR_CODE_H + +#include "acelite_config.h" + +#if defined(FEATURE_ACELITE_MC_EVENT_ERROR_CODE_PRINT) +#include "mc_hal_log.h" +#include "memory_heap.h" +#include "non_copyable.h" +#define ACE_EVENT_PRINT(info2, info3) \ + EventErrorCodePrint::GetInstance()->AceEventPrint(info2, info3) +#define ACE_FEATURE_EVENT_PRINT(info1, info2, info3) \ + EventErrorCodePrint::GetInstance()->AceEventPrint(info1, info2, info3) +#define ACE_ERROR_CODE_PRINT(info2, rfu) \ + EventErrorCodePrint::GetInstance()->AceErrorCodePrint(info2, rfu) +#else +#define ACE_EVENT_PRINT(info2, info3) +#define ACE_FEATURE_EVENT_PRINT(info1, info2, info3) +#define ACE_ERROR_CODE_PRINT(info2, rfu) +#endif // ENABLED(FEATURE_ACELITE_MC_EVENT_ERROR_CODE_PRINT) + +#if defined(FEATURE_ACELITE_MC_EVENT_ERROR_CODE_PRINT) +namespace OHOS { +namespace ACELite { +class EventErrorCodePrint final : public MemoryHeap { +public: + ACE_DISALLOW_COPY_AND_MOVE(EventErrorCodePrint); + + EventErrorCodePrint() = default; + + ~EventErrorCodePrint() = default; + + static EventErrorCodePrint *GetInstance(); + + void AceEventPrint(MC_U8 info2, MC_U8 info3); + + void AceEventPrint(MC_U8 info1, MC_U8 info2, MC_U8 info3); + + void AceErrorCodePrint(MC_U8 info2, MC_U16 rfu); +}; +} // namespace ACELite +} // namespace OHOS +#endif // FEATURE_ACELITE_MC_EVENT_ERROR_CODE_PRINT +#endif // OHOS_ACELITE_ACE_EVENT_ERROR_CODE_H \ No newline at end of file diff --git a/src/core/context/fatal_handler.cpp b/src/core/context/fatal_handler.cpp new file mode 100755 index 0000000..ec23c38 --- /dev/null +++ b/src/core/context/fatal_handler.cpp @@ -0,0 +1,325 @@ +/* + * Copyright (c) 2020 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. + */ + +#include "fatal_handler.h" +#include "ace_event_error_code.h" +#include "ace_log.h" +#ifdef OHOS_ACELITE_PRODUCT_WATCH +#include "cmsis_os.h" +#endif // OHOS_ACELITE_PRODUCT_WATCH +#include "jerryscript-port-default.h" +#include "js_fwk_common.h" +#include "presets/console_log_impl.h" +#include "presets/feature_ability_module.h" +#include "root_view.h" +#include "task_manager.h" +#include "ui_label.h" + +namespace OHOS { +namespace ACELite { +/** + * Global instance for saving fatal error code and handling fatal errors + */ +FatalHandler &FatalHandler::GetInstance() +{ + static FatalHandler instance; + return instance; +} + +#ifdef OHOS_ACELITE_PRODUCT_WATCH +extern "C" int ForceStopAbility(); +extern "C" void RenderEnd(); +#endif // OHOS_ACELITE_PRODUCT_WATCH +static void HandleFatal(int errorCode) +{ +#ifdef FEATURE_FATAL_ERROR_HANDLING + HILOG_ERROR(HILOG_MODULE_ACE, "hitted by fatal error[%d]", errorCode); + if (FatalHandler::GetInstance().IsFatalErrorHitted()) { + // fatal hitted again during one fatal handing, return to avoid dead loop + return; + } + // record error code + FatalHandler::GetInstance().SetFatalError(errorCode); + // send message to AMS to tear down us +#ifdef OHOS_ACELITE_PRODUCT_WATCH + // inform AMS we are facing fatal error + (void)ForceStopAbility(); + // sleep to stuck engien to make ANR for triggering force-stop + const uint32_t sleepTime = 3000; + uint8_t maxRetryCount = 5; + while (!(FatalHandler::GetInstance().IsFatalErrorHandleDone()) && (maxRetryCount > 0)) { + osDelay(sleepTime); + maxRetryCount--; + } + HILOG_ERROR(HILOG_MODULE_ACE, "the JS task is not killed after sleep very long time"); +#endif // OHOS_ACELITE_PRODUCT_WATCH +#else + const char * const fatalErrorStr = FatalHandler::GetInstance().GetErrorStr(errorCode); + LogString(LogLevel::LOG_LEVEL_ERR, "[JS Exception]: "); + LogString(LogLevel::LOG_LEVEL_ERR, fatalErrorStr); + LogString(LogLevel::LOG_LEVEL_ERR, "\n"); +#endif // FEATURE_FATAL_ERROR_HANDLING +} + +void FatalHandler::RegisterFatalHandler() const +{ + // set callback into jerry + jerry_port_default_set_fatal_handler(HandleFatal); +} + +bool FatalHandler::IsErrorSupported(int errorCode) const +{ + switch (errorCode) { + case ERR_NATIVE_OUT_OF_MEMORY: + // fall through + case ERR_READ_FWK_FILE_FAILED: + // fall through + case ERR_EVAL_FWK_FAILED: + // fall through + case ERR_READ_JS_FILE_FAILED: + // fall through + case ERR_EVAL_JS_FAILED: + // fall through + case ERR_OUT_OF_MEMORY: // JS heap overflow + // fall through + case ERR_REF_COUNT_LIMIT: + // fall through + case ERR_DISABLED_BYTE_CODE: + // fall through + case ERR_FAILED_INTERNAL_ASSERTION: + return true; + default: + break; + } + return false; +} + +void FatalHandler::HandleFatalError(int errorCode) +{ + if (errorCode == ERR_INVALID && fatalErrorCode_ == ERR_INVALID) { + // no fatal error happens + return; + } + + if (errorCode != ERR_INVALID) { + // update fatal error to new one if it's valid + fatalErrorCode_ = errorCode; + } + isFatalHandled_ = false; + if (!isRecycling_) { + // recycle any remain components first + RecycleComponents(); + } else { + HILOG_WARN(HILOG_MODULE_ACE, "hitted again when handling fatal error"); + } + + // reset the low layer rendering flag if needed + FatalHandler::GetInstance().ResetRendering(); + FeaAbilityModule::Release(); + componentNodes_.Clear(); + isFatalHandled_ = true; +} + +/* + * Reset render flag or task handler mutex if needed + */ +void FatalHandler::ResetRendering() +{ + if (IsTEHandling()) { + // release the render flag as we are going into sleep and will be force killed +#ifdef OHOS_ACELITE_PRODUCT_WATCH + TaskManager::GetInstance()->ResetTaskHandlerMutex(); +#endif + SetTEHandlingFlag(false); + } +#ifdef OHOS_ACELITE_PRODUCT_WATCH + RenderEnd(); +#endif +} + +const char *FatalHandler::GetErrorStr(int errorCode) const +{ + switch (errorCode) { + case ERR_NATIVE_OUT_OF_MEMORY: + return "NATIVE OOM"; + case ERR_READ_FWK_FILE_FAILED: + return "READ FWK FAILED"; + case ERR_EVAL_FWK_FAILED: + return "EVAL FWK FAILED"; + case ERR_READ_JS_FILE_FAILED: + return "READ JS FAILED"; + case ERR_EVAL_JS_FAILED: + return "EVAL JS FAILED"; + case ERR_OUT_OF_MEMORY: + return "JS HEAP OOM"; + case ERR_REF_COUNT_LIMIT: + return "JS REF LIMIT"; + case ERR_DISABLED_BYTE_CODE: + return "JS DISABLED BYTE CODE"; + case ERR_FAILED_INTERNAL_ASSERTION: + return "JS ASSERTION FAILED"; + default: + break; + } + return ""; +} + +void FatalHandler::SetFatalError(int errorCode) +{ + switch (errorCode) { + case ERR_OUT_OF_MEMORY: + ACE_ERROR_CODE_PRINT(EXCE_ACE_ENGINE_RUNTIME_ERROR, EXCE_ACE_JS_HEAP_OOM); + break; + case ERR_REF_COUNT_LIMIT: + ACE_ERROR_CODE_PRINT(EXCE_ACE_ENGINE_RUNTIME_ERROR, EXCE_ACE_JS_REF_COUNT_LIMIT); + break; + case ERR_DISABLED_BYTE_CODE: + ACE_ERROR_CODE_PRINT(EXCE_ACE_ENGINE_RUNTIME_ERROR, EXCE_ACE_JS_DISABLED_BYTE_CODE); + break; + case ERR_FAILED_INTERNAL_ASSERTION: + ACE_ERROR_CODE_PRINT(EXCE_ACE_ENGINE_RUNTIME_ERROR, EXCE_ACE_JS_FAILED_INTERNAL_ASSERTION); + break; + default: + break; + } + + if (fatalErrorCode_ == ERR_INVALID && IsErrorSupported(errorCode)) { + // reset handling flag + isFatalHandled_ = false; + fatalErrorCode_ = errorCode; + } +} + +void FatalHandler::RecycleComponents() +{ + isRecycling_ = true; + ListNode *node = componentNodes_.Begin(); + while (node != componentNodes_.End()) { + if (node->data_ != nullptr) { + Component *component = node->data_; + component->Release(); + delete component; + component = nullptr; + node->data_ = nullptr; + } + node = node->next_; + } + isRecycling_ = false; +} + +void FatalHandler::CleanUpFatalResource() +{ + // make sure we have released all nodes + componentNodes_.Clear(); + isFatalHandled_ = false; + // reset error code when exitting the whole application + fatalErrorCode_ = ERR_INVALID; + isExiting_ = false; +} + +bool FatalHandler::IsJSRuntimeFatal() const +{ + bool result = false; + switch (fatalErrorCode_) { + case ERR_OUT_OF_MEMORY: // JS heap overflow + result = true; + break; + case ERR_REF_COUNT_LIMIT: + result = true; + break; + case ERR_DISABLED_BYTE_CODE: + result = true; + break; + case ERR_FAILED_INTERNAL_ASSERTION: + result = true; + break; + default: + result = false; + break; + } + return result; +} + +bool FatalHandler::IsJSHeapOverflow() const +{ + return (fatalErrorCode_ == ERR_OUT_OF_MEMORY); +} + +/** + * As the exception can interrupt the tree rationship building, so we can't recycle the Components as normal, + * because we even not get the root Component object when exception happen. So we record all Components when + * they are created out, and remove them when they are released normally, if exception happens, if any Componets + * still in our list, that means there is no chance to release them through the normal way, we must release them + * manually. + */ +void FatalHandler::AttachComponentNode(Component *component) +{ + if (component == nullptr) { + return; + } + componentNodes_.PushBack(component); +} + +void FatalHandler::DetachComponentNode(const Component *component) +{ + if ((component == nullptr) || isRecycling_) { + return; + } + ListNode *node = componentNodes_.Begin(); + while (node != componentNodes_.End()) { + if (node->data_ == component) { + componentNodes_.Remove(node); + break; + } + node = node->next_; + } +} + +bool FatalHandler::IsFatalErrorHitted() const +{ + return (fatalErrorCode_ != ERR_INVALID); +} + +bool FatalHandler::IsFatalErrorHandling() const +{ + return isRecycling_; +} + +bool FatalHandler::IsFatalErrorHandleDone() const +{ + return isFatalHandled_; +} + +void FatalHandler::SetTEHandlingFlag(bool flag) +{ + isTEHandling_ = flag; +} + +bool FatalHandler::IsTEHandling() const +{ + return isTEHandling_; +} + +void FatalHandler::SetExitingFlag(bool flag) +{ + isExiting_ = flag; +} + +bool FatalHandler::IsAppExiting() const +{ + return isExiting_; +} +} // namespace ACELite +} // namespace OHOS diff --git a/src/core/context/fatal_handler.h b/src/core/context/fatal_handler.h new file mode 100755 index 0000000..93fa377 --- /dev/null +++ b/src/core/context/fatal_handler.h @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2020 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. + */ + +#ifndef OHOS_ACELITE_FATAL_HANDLER_H +#define OHOS_ACELITE_FATAL_HANDLER_H + +#include "component.h" +#include "list.h" +#include "non_copyable.h" + +namespace OHOS { +namespace ACELite { +class FatalHandler final : public MemoryHeap { +public: + ACE_DISALLOW_COPY_AND_MOVE(FatalHandler); + static FatalHandler& GetInstance(); + const char* GetErrorStr(int errorCode) const; + void RegisterFatalHandler() const; + void SetFatalError(int errorCode); + void HandleFatalError(int errorCode); + void CleanUpFatalResource(); + bool IsJSRuntimeFatal() const; + bool IsJSHeapOverflow() const; + bool IsFatalErrorHitted() const; + bool IsFatalErrorHandling() const; + bool IsFatalErrorHandleDone() const; + void AttachComponentNode(Component* component); + void DetachComponentNode(const Component* component); + void SetTEHandlingFlag(bool flag); + bool IsTEHandling() const; + void ResetRendering(); + void SetExitingFlag(bool flag); + bool IsAppExiting() const; + // define all fatal error below, please note the jerry fatal defines, avoid conflicts + static const int ERR_INVALID = 0; + static const int ERR_NATIVE_OUT_OF_MEMORY = 200; + static const int ERR_READ_FWK_FILE_FAILED = 201; + static const int ERR_EVAL_FWK_FAILED = 202; + static const int ERR_READ_JS_FILE_FAILED = 203; + static const int ERR_EVAL_JS_FAILED = 204; + +private: + FatalHandler() + : componentNodes_(), + fatalErrorCode_(0), + isRecycling_(false), + isFatalHandled_(false), + isTEHandling_(false), + isExiting_(false) {} + ~FatalHandler() {} + bool IsErrorSupported(int errorCode) const; + void RecycleComponents(); + List componentNodes_; + int fatalErrorCode_; + bool isRecycling_; + bool isFatalHandled_; + bool isTEHandling_; + bool isExiting_; +}; +} // namespace ACELite +} // namespace OHOS +#endif // OHOS_ACELITE_FATAL_HANDLER_H \ No newline at end of file diff --git a/src/core/context/js_ability.cpp b/src/core/context/js_ability.cpp new file mode 100755 index 0000000..1d8d84d --- /dev/null +++ b/src/core/context/js_ability.cpp @@ -0,0 +1,177 @@ +/* + * Copyright (c) 2020 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. + */ + +#include "js_ability.h" + +#include +#include "ace_event_error_code.h" +#include "ace_log.h" +#include "acelite_config.h" +#include "fatal_handler.h" +#include "js_ability_impl.h" +#include "js_profiler.h" +#ifdef FEATURE_ACELITE_PRODUCT_MEMORY_POOL +#include "mem_pool.h" +#endif + +namespace OHOS { +namespace ACELite { +/** + * This is a helper function to cast void* to JSAbilityImpl*, for header seperating purpose. + */ +static JSAbilityImpl *CastAbilityImpl(void *abilityImpl) +{ + if (abilityImpl == nullptr) { + return nullptr; + } + + return static_cast(abilityImpl); +} + +static void DumpNativeMemoryUsage() +{ +#ifdef FEATURE_ACELITE_PRODUCT_MEMORY_POOL + MemPool::MemInfo memInfo; + MemPool::GetInstance()->GetMemInfo(&memInfo); + HILOG_DEBUG(HILOG_MODULE_ACE, "avaliable free size: %d", memInfo.freeSize); +#endif // FEATURE_ACELITE_PRODUCT_MEMORY_POOL +} + +void JSAbility::Launch(const char * const abilityPath, const char * const bundleName, uint16_t token) +{ + if (jsAbilityImpl_ != nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "Launch only can be triggered once"); + ACE_ERROR_CODE_PRINT(EXCE_ACE_FWK_LAUNCH_FAILED, EXCE_ACE_APP_ALREADY_LAUNCHED); + return; + } + + if ((abilityPath == nullptr) || (strlen(abilityPath) == 0)) { + HILOG_ERROR(HILOG_MODULE_ACE, "invalid app path"); + ACE_ERROR_CODE_PRINT(EXCE_ACE_FWK_LAUNCH_FAILED, EXCE_ACE_INVALID_APP_PATH); + return; + } + + if ((bundleName == nullptr) || (strlen(bundleName) == 0)) { + HILOG_ERROR(HILOG_MODULE_ACE, "invalid bundle name"); + ACE_ERROR_CODE_PRINT(EXCE_ACE_FWK_LAUNCH_FAILED, EXCE_ACE_INVALID_BUNDLE_NAME); + return; + } + + DumpNativeMemoryUsage(); + jsAbilityImpl_ = new JSAbilityImpl(); + if (jsAbilityImpl_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "Create JSAbilityRuntime failed"); + return; + } + START_TRACING(LAUNCH); + JSAbilityImpl *jsAbilityImpl = CastAbilityImpl(jsAbilityImpl_); + FatalHandler::GetInstance().RegisterFatalHandler(); + jsAbilityImpl->InitEnvironment(abilityPath, bundleName, token); + jsAbilityImpl->DeliverCreate(); + STOP_TRACING(); + OUTPUT_TRACE(); +} + +void JSAbility::Show() const +{ + if (jsAbilityImpl_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "Must trigger Launch first"); + return; + } + + JSAbilityImpl *jsAbilityImpl = CastAbilityImpl(jsAbilityImpl_); + jsAbilityImpl->Show(); +} + +void JSAbility::Hide() const +{ + if (jsAbilityImpl_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "Must trigger Launch first"); + return; + } + + JSAbilityImpl *jsAbilityImpl = CastAbilityImpl(jsAbilityImpl_); + jsAbilityImpl->Hide(); +} + +void JSAbility::TransferToDestroy() +{ + if (jsAbilityImpl_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "Must trigger Launch first"); + return; + } + + JSAbilityImpl *jsAbilityImpl = CastAbilityImpl(jsAbilityImpl_); + jsAbilityImpl->CleanUp(); + delete reinterpret_cast(jsAbilityImpl_); + jsAbilityImpl_ = nullptr; + // Reset render flag or low layer task mutex in case we are during the rendering process, + // this situation might happen if the destroy function is called outside of JS thread, such as AMS. + FatalHandler::GetInstance().ResetRendering(); + FatalHandler::GetInstance().SetExitingFlag(false); + DumpNativeMemoryUsage(); +} + +void JSAbility::BackPressed() +{ + if (jsAbilityImpl_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "Must trigger Launch first"); + return; + } + + JSAbilityImpl *jsAbilityImpl = CastAbilityImpl(jsAbilityImpl_); + jsAbilityImpl->NotifyBackPressed(); +} + +const char *JSAbility::GetPackageName() +{ + return JsAppContext::GetInstance()->GetCurrentBundleName(); +} + +void JSAbility::ForceDestroy() +{ +#ifdef OHOS_ACELITE_PRODUCT_WATCH + FatalHandler::GetInstance().HandleFatalError(FatalHandler::ERR_INVALID); + TransferToDestroy(); + FatalHandler::GetInstance().CleanUpFatalResource(); +#endif // OHOS_ACELITE_PRODUCT_WATCH +} + +#ifdef OHOS_ACELITE_PRODUCT_WATCH +static RenderTickHandler g_renderTick = nullptr; +#endif // OHOS_ACELITE_PRODUCT_WATCH +void JSAbility::RegisterTEHandler(RenderTickHandler handler) +{ +#ifdef OHOS_ACELITE_PRODUCT_WATCH + if (g_renderTick != nullptr) { + // the TE handler registering only can be performed once after whole system booting up + return; + } + g_renderTick = handler; +#endif // OHOS_ACELITE_PRODUCT_WATCH +} + +void JSAbility::HandleRenderTick() +{ +#ifdef OHOS_ACELITE_PRODUCT_WATCH + if ((g_renderTick != nullptr) && !(FatalHandler::GetInstance().IsAppExiting())) { + FatalHandler::GetInstance().SetTEHandlingFlag(true); + g_renderTick(); + FatalHandler::GetInstance().SetTEHandlingFlag(false); + } +#endif // OHOS_ACELITE_PRODUCT_WATCH +} +} // namespace ACELite +} // namespace OHOS diff --git a/src/core/context/js_ability_impl.cpp b/src/core/context/js_ability_impl.cpp new file mode 100755 index 0000000..bfb4318 --- /dev/null +++ b/src/core/context/js_ability_impl.cpp @@ -0,0 +1,204 @@ +/* + * Copyright (c) 2020 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. + */ +#include "js_ability_impl.h" +#include "component.h" +#include "js_app_context.h" +#include "js_app_environment.h" +#if ENABLED(SECURE_C_FUNCTION) +#include "securec.h" +#endif // ENABLED(SECURE_C_FUNCTION) +#include "ace_event_error_code.h" +#include "ace_log.h" +#include "component_utils.h" +#include "fatal_handler.h" +#include "js_profiler.h" +#include "module_manager.h" +#include "presets/localization_module.h" +#include "presets/timer_module.h" + +namespace OHOS { +namespace ACELite { +void JSAbilityImpl::InitEnvironment(const char * const abilityPath, const char * const bundleName, uint16_t token) +{ + if ((abilityPath == nullptr) || strlen(abilityPath) == 0 || (bundleName == nullptr) || strlen(bundleName) == 0) { + HILOG_ERROR(HILOG_MODULE_ACE, "invalid input parameters"); + return; + } + + if (isEnvInit_) { + HILOG_ERROR(HILOG_MODULE_ACE, "already initialized, return"); + return; + } + // init engine && js fwk + JsAppEnvironment *appJsEnv = JsAppEnvironment::GetInstance(); + appContext_ = JsAppContext::GetInstance(); + // check if we should use snapshot mode, do this before everything, + // but after debugger config is set + appJsEnv->InitRuntimeMode(); + appContext_->SetCurrentAbilityInfo(abilityPath, bundleName, token); + appContext_->SetTopJSAbilityImpl(this); + appJsEnv->InitJsFramework(); + + // initialize js object after engine started up + abilityModel_ = UNDEFINED; + nativeElement_ = UNDEFINED; + isEnvInit_ = true; + + // relocate app.js fullpath + const char * const appJSFileName = (appJsEnv->IsSnapshotMode()) ? "app.bc" : "app.js"; + char *fileFullPath = RelocateJSSourceFilePath(abilityPath, appJSFileName); + if (fileFullPath == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "relocate js file failed"); + ACE_ERROR_CODE_PRINT(EXCE_ACE_FWK_LAUNCH_FAILED, EXCE_ACE_APP_ENTRY_MISSING); + return; + } + + START_TRACING(APP_CODE_EVAL); + abilityModel_ = appContext_->Eval(fileFullPath, strlen(fileFullPath), true); // generate global.$app js object + STOP_TRACING(); + + ace_free(fileFullPath); + fileFullPath = nullptr; + router_ = new Router(); + if (router_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "malloc router heap memory failed."); + return; + } +} + +void JSAbilityImpl::CleanUp() +{ + START_TRACING(APP_ON_DESTROY); + // clean up user's js + InvokeOnDestroy(); + STOP_TRACING(); + + // delete router's resources about page + if (router_ != nullptr) { + delete router_; + router_ = nullptr; + } + TimersModule::Clear(); + LocalModule::Clear(); + if (appContext_) { + appContext_->ClearContext(); + } + ModuleManager::GetInstance()->OnTerminate(); + JsAppEnvironment::GetInstance()->Cleanup(); + // clean up engin + if (isEnvInit_) { + jerry_cleanup(); + isEnvInit_ = false; + } + OUTPUT_TRACE(); +} + +void JSAbilityImpl::DeliverCreate() +{ + START_TRACING(APP_ON_CREATE); + // call InvokeOnCreate + InvokeOnCreate(); + STOP_TRACING(); + // if we have done the render or not initialized yet, don't call render + if (rendered_ || (appContext_ == nullptr)) { + ACE_ERROR_CODE_PRINT(EXCE_ACE_FWK_LAUNCH_FAILED, EXCE_ACE_APP_RENDER_FAILED); + return; + } + // call render to setup user interface + jerry_value_t object = jerry_create_object(); + JerrySetStringProperty(object, ROUTER_PAGE_URI, PATH_DEFAULT); + if (router_) { + jerry_release_value(router_->Replace(object, false)); + rendered_ = true; + } + jerry_release_value(object); +} + +void JSAbilityImpl::Show() const +{ + if (router_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "no router instance to perform the show request"); + return; + } + router_->Show(); +} + +void JSAbilityImpl::Hide() const +{ + if (router_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "no router instance to perform the hide request"); + return; + } + router_->Hide(); +} + +void JSAbilityImpl::NotifyBackPressed() const +{ + if (appContext_ == nullptr) { + return; + } + + InvokeOnBackPressed(); + + appContext_->TerminateAbility(); +} + +void JSAbilityImpl::InvokeOnCreate() const +{ + if (IS_UNDEFINED(abilityModel_)) { + HILOG_ERROR(HILOG_MODULE_ACE, "view model is undefined when call user's init"); + return; + } + jerry_value_t onCreateFunction = jerryx_get_property_str(abilityModel_, ABILITY_LIFECYCLE_CALLBACK_ON_CREATE); + if (IS_UNDEFINED(onCreateFunction)) { + // user does not set onInit method + return; + } + CallJSFunctionAutoRelease(onCreateFunction, abilityModel_, nullptr, 0); + jerry_release_value(onCreateFunction); +} + +void JSAbilityImpl::InvokeOnDestroy() const +{ + InvokeMethodWithoutParameter(ABILITY_LIFECYCLE_CALLBACK_ON_DESTROY); + // release FeatureAbility object + jerry_release_value(abilityModel_); +} + +void JSAbilityImpl::InvokeOnBackPressed() const +{ + InvokeMethodWithoutParameter(BACK_PRESSED_NAME); +} + +void JSAbilityImpl::InvokeMethodWithoutParameter(const char * const name) const +{ + if (FatalHandler::GetInstance().IsJSRuntimeFatal()) { + // can not continue to involve any JS object creating on engine in case runtime fatal + return; + } + if ((name == nullptr) || strlen(name) == 0) { + return; + } + + jerry_value_t function = jerryx_get_property_str(abilityModel_, name); + if (IS_UNDEFINED(function)) { + // user does not set onBackpress method + return; + } + CallJSFunctionAutoRelease(function, abilityModel_, nullptr, 0); + jerry_release_value(function); +} +} // namespace ACELite +} // namespace OHOS diff --git a/src/core/context/js_ability_impl.h b/src/core/context/js_ability_impl.h new file mode 100755 index 0000000..6ae1677 --- /dev/null +++ b/src/core/context/js_ability_impl.h @@ -0,0 +1,134 @@ +/* + * Copyright (c) 2020 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. + */ + +#ifndef OHOS_ACELITE_JS_ABILITY_IMPL_H +#define OHOS_ACELITE_JS_ABILITY_IMPL_H + +#include "js_app_context.h" +#include "js_debugger_config.h" +#include "js_router.h" +#include "js_timer_list.h" +#if ENABLED(JS_PROFILER) +#include "js_profiler.h" +#endif +#include "non_copyable.h" + +namespace OHOS { +namespace ACELite { +class JSAbilityImpl final : public MemoryHeap { +public: + ACE_DISALLOW_COPY_AND_MOVE(JSAbilityImpl); + /** + * @fn JSAbilityImpl::JSAbilityImpl() + * + * @brief constructor with the ability path parameter. + */ + JSAbilityImpl() + : appContext_(nullptr), + abilityModel_(UNDEFINED), + nativeElement_(UNDEFINED), + rendered_(false), + isEnvInit_(false), + router_(nullptr) + { +#if ENABLED(JS_PROFILER) + // Call GetInstance() to prepare data + JSProfiler::GetInstance()->PrepareDataBuffer(); +#endif + } + + /** + * @fn virtual JSAbilityImpl::~JSAbilityImpl() + * + * @brief Destructor. + * + * Destructor. + */ + virtual ~JSAbilityImpl() + { +#if ENABLED(JS_PROFILER) + // Call release() to free all performance data + JSProfiler::GetInstance()->Release(); +#endif + } + + /** + * @fn JSAbilityRuntime::Init(char* path, uint16_t token) + * + * @brief initialize JS executing environment, including JS engine and JS fwk + */ + void InitEnvironment(const char * const abilityPath, const char * const bundleName, uint16_t token); + + /** + * @fn JSAbilityRuntime::CleanUp() + * + * @brief destroy JS executing environment + */ + void CleanUp(); + + /** + * @fn JSAbilityRuntime::DeliverCreate(); + * + * @brief call this function when transfer lifecycle into init + */ + void DeliverCreate(); + + /** + * @fn JSAbilityRuntime::Show(); + * + * @brief move JS application to active state + */ + void Show() const; + + /** + * @fn JSAbilityRuntime::Hide(); + * + * @brief move the JS application to background state + */ + void Hide() const; + + /** + * @fn JSAbilityRuntime::NotifyBackPressed() + * + * @brief call this function when back key pressed + */ + void NotifyBackPressed() const; + + /** + * @fn JSAbilityRuntime::GetRouter(); + * + * @brief call this function when replace new page + */ + const Router* GetRouter() const + { + return router_; + } + +private: + void InvokeOnCreate() const; + void InvokeOnDestroy() const; + void InvokeOnBackPressed() const; + void InvokeMethodWithoutParameter(const char * const name) const; + + JsAppContext* appContext_; + jerry_value_t abilityModel_; // the object evaled from user JS code + jerry_value_t nativeElement_; // the object returned from render function + bool rendered_; + bool isEnvInit_; + Router* router_; +}; +} // namespace ACELite +} // namespace OHOS +#endif // OHOS_ACELITE_JS_ABILITY_IMPL_H diff --git a/src/core/context/js_app_context.cpp b/src/core/context/js_app_context.cpp new file mode 100755 index 0000000..c9261d9 --- /dev/null +++ b/src/core/context/js_app_context.cpp @@ -0,0 +1,266 @@ +/* + * Copyright (c) 2020 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. + */ + +#include "js_app_context.h" +#include "ace_event_error_code.h" +#include "ace_log.h" +#if (defined(__LINUX__) || defined(__LITEOS__)) +#include "ace_ability.h" +#endif +#include "component_factory.h" +#include "component_utils.h" +#include "js_app_environment.h" +#include "platform_adapter.h" +#if ENABLED(SECURE_C_FUNCTION) +#include "securec.h" +#endif // ENABLED(SECURE_C_FUNCTION) +#include "root_view.h" +#include "task_manager.h" +#include "ui_view_group.h" +#if (!defined(_WIN32) && !defined(_WIN64)) +#ifdef SERVICE_MANAGER_API_SUPPORTED +// no AMS support on PC simulator +#include "ability_service_interface.h" +#include "iunknown.h" +#include "samgr_lite.h" +#endif // SERVICE_MANAGER_API_SUPPORTED +#endif // (!defined(_WIN32) && !defined(_WIN64)) +#include "fatal_handler.h" +#include "js_profiler.h" + +namespace OHOS { +namespace ACELite { +void JsAppContext::ClearContext() +{ + // reset current ability path and uuid + ReleaseAbilityInfo(); +} + +/** + * return value should be released by caller when it's not used + */ +jerry_value_t JsAppContext::Eval(const char * const jsFileFullPath, size_t fileNameLength, bool isAppEval) const +{ + if ((jsFileFullPath == nullptr) || (fileNameLength == 0)) { + HILOG_ERROR(HILOG_MODULE_ACE, "Failed to eval js code cause by empty JavaScript script."); + ACE_ERROR_CODE_PRINT(EXCE_ACE_ROUTER_REPLACE_FAILED, EXCE_ACE_PAGE_INDEX_MISSING); + return UNDEFINED; + } + + uint32_t contentLength = 0; + START_TRACING(PAGE_CODE_LOAD); + bool snapshotMode = JsAppEnvironment::GetInstance()->IsSnapshotMode(); + char *jsCode = ReadFile(jsFileFullPath, &contentLength, snapshotMode); + STOP_TRACING(); + if (jsCode == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "empty js file, eval user code failed"); + ACE_ERROR_CODE_PRINT(EXCE_ACE_ROUTER_REPLACE_FAILED, EXCE_ACE_PAGE_FILE_READ_FAILED); + return UNDEFINED; + } + + START_TRACING(PAGE_CODE_EVAL); + jerry_value_t viewModel = UNDEFINED; + if (snapshotMode) { + viewModel = jerry_exec_snapshot(reinterpret_cast(jsCode), contentLength, 0, 1); + } else { + const jerry_char_t *jsScript = reinterpret_cast(jsCode); + jerry_value_t retValue = jerry_parse(reinterpret_cast(jsFileFullPath), fileNameLength, + jsScript, contentLength, JERRY_PARSE_NO_OPTS); + if (jerry_value_is_error(retValue)) { + ACE_ERROR_CODE_PRINT(EXCE_ACE_ROUTER_REPLACE_FAILED, EXCE_ACE_PAGE_JS_EVAL_FAILED); + PrintErrorMessage(retValue); + // free js code buffer + ace_free(jsCode); + jsCode = nullptr; + jerry_release_value(retValue); + STOP_TRACING(); + return UNDEFINED; + } + viewModel = jerry_run(retValue); + jerry_release_value(retValue); + } + + STOP_TRACING(); + // free js code buffer + ace_free(jsCode); + jsCode = nullptr; + + if (jerry_value_is_error(viewModel)) { + ACE_ERROR_CODE_PRINT(EXCE_ACE_ROUTER_REPLACE_FAILED, EXCE_ACE_PAGE_JS_EVAL_FAILED); + PrintErrorMessage(viewModel); + jerry_release_value(viewModel); + return UNDEFINED; + } + + SetGlobalNamedProperty(isAppEval, viewModel); + return viewModel; +} + +void JsAppContext::SetGlobalNamedProperty(bool isAppEval, jerry_value_t viewModel) const +{ + jerry_value_t globalObject = jerry_get_global_object(); + if (isAppEval) { + JerrySetNamedProperty(globalObject, ATTR_APP, viewModel); + } else { + JerrySetNamedProperty(globalObject, ATTR_ROOT, viewModel); + } + jerry_release_value(globalObject); +} + +jerry_value_t JsAppContext::Render(jerry_value_t viewModel) const +{ + if (jerry_value_is_error(viewModel)) { + HILOG_ERROR(HILOG_MODULE_ACE, "Failed to render app cause by render error."); + return UNDEFINED; + } + + if (jerry_value_is_undefined(viewModel)) { + HILOG_ERROR(HILOG_MODULE_ACE, "Nothing to render as it is undefined."); + return UNDEFINED; + } + + jerry_value_t renderFunction = jerryx_get_property_str(viewModel, ATTR_RENDER); + if (jerry_value_is_undefined(renderFunction)) { + ACE_ERROR_CODE_PRINT(EXCE_ACE_ROUTER_REPLACE_FAILED, EXCE_ACE_PAGE_NO_RENDER_FUNC); + return UNDEFINED; + } + jerry_value_t nativeElement = CallJSFunction(renderFunction, viewModel, nullptr, 0); + if (jerry_value_is_undefined(nativeElement)) { + ACE_ERROR_CODE_PRINT(EXCE_ACE_ROUTER_REPLACE_FAILED, EXCE_ACE_PAGE_RENDER_FAILED); + } + jerry_release_value(renderFunction); + return nativeElement; +} + +void JsAppContext::Show() const +{ + RootView *rootView = RootView::GetInstance(); + if (rootView == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "get rootView is nullptr"); + return; + } + rootView->Invalidate(); +} + +void JsAppContext::RemoveAllView() const +{ + RootView *rootView = RootView::GetInstance(); + if (rootView == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "get rootView is nullptr"); + return; + } + rootView->RemoveAll(); + rootView->Invalidate(); +} + +void JsAppContext::TerminateAbility() const +{ + if (currentToken_ == 0) { + // if no running js ability, drop + return; + } + FatalHandler::GetInstance().SetExitingFlag(true); + Terminate(currentToken_); +} + +void JsAppContext::SetCurrentAbilityInfo(const char * const abilityPath, const char * const bundleName, uint16_t token) +{ + // release old first + ReleaseAbilityInfo(); + + if (abilityPath != nullptr) { + size_t abilityPathLen = strlen(abilityPath); + if ((abilityPathLen > 0) && (abilityPathLen < PATH_LENGTH_MAX)) { + currentAbilityPath_ = static_cast(ace_malloc(abilityPathLen + 1)); + if (currentAbilityPath_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "malloc buffer for current ability path failed"); + return; + } + if (memcpy_s(currentAbilityPath_, abilityPathLen, abilityPath, abilityPathLen) != 0) { + ace_free(currentAbilityPath_); + currentAbilityPath_ = nullptr; + return; + } + currentAbilityPath_[abilityPathLen] = 0; + } + } + + if (bundleName != nullptr) { + size_t bundleNameLen = strlen(bundleName); + if ((bundleNameLen > 0) && (bundleNameLen < NAME_LENGTH_MAX)) { + currentBundleName_ = static_cast(ace_malloc(bundleNameLen + 1)); + if (currentBundleName_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "malloc buffer for current uuid failed"); + return; + } + if (memcpy_s(currentBundleName_, bundleNameLen, bundleName, bundleNameLen) != 0) { + ace_free(currentAbilityPath_); + currentAbilityPath_ = nullptr; + ace_free(currentBundleName_); + currentBundleName_ = nullptr; + return; + } + currentBundleName_[bundleNameLen] = 0; + } + } + + currentToken_ = token; +} + +void JsAppContext::SetCurrentJsPath(const char * const jsPath) +{ + // release old first + if (currentJsPath_) { + ace_free(currentJsPath_); + currentJsPath_ = nullptr; + } + + if (jsPath != nullptr) { + size_t jsPathLen = strlen(jsPath); + if ((jsPathLen > 0) && (jsPathLen < PATH_LENGTH_MAX)) { + currentJsPath_ = static_cast(ace_malloc(jsPathLen + 1)); + if (currentJsPath_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "malloc buffer for current js path failed"); + return; + } + if (memcpy_s(currentJsPath_, jsPathLen, jsPath, jsPathLen) != 0) { + ace_free(currentJsPath_); + currentJsPath_ = nullptr; + return; + } + currentJsPath_[jsPathLen] = '\0'; + } + } +} + +void JsAppContext::ReleaseAbilityInfo() +{ + if (currentBundleName_) { + ace_free(currentBundleName_); + currentBundleName_ = nullptr; + } + + if (currentAbilityPath_) { + ace_free(currentAbilityPath_); + currentAbilityPath_ = nullptr; + } + + if (currentJsPath_) { + ace_free(currentJsPath_); + currentJsPath_ = nullptr; + } +} +} // namespace ACELite +} // namespace OHOS diff --git a/src/core/context/js_app_context.h b/src/core/context/js_app_context.h new file mode 100755 index 0000000..4b4a4d8 --- /dev/null +++ b/src/core/context/js_app_context.h @@ -0,0 +1,145 @@ +/* + * Copyright (c) 2020 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. + */ + +#ifndef OHOS_ACELITE_JS_APP_CONTEXT_H +#define OHOS_ACELITE_JS_APP_CONTEXT_H + +#include "stylemgr/app_style_manager.h" + +namespace OHOS { +namespace ACELite { +class JSAbilityImpl; +/** + * @brief Global App context. + */ +class JsAppContext final : public MemoryHeap { +public: + static JsAppContext* GetInstance() + { + static JsAppContext instance; + return &instance; + } + + /** + * @brief trigger terminate request + */ + void TerminateAbility() const; + /** + * @brief eval user's JS Code and return FeatureAbility object + * + * @param: jsFileFullPath js file full path + * @param: fileNameLength the given file name length + * @param: the flag for app eval or page eval.True is eval flag. + */ + jerry_value_t Eval(const char * const jsFileFullPath, size_t fileNameLength, bool isAppEval) const; + /** + * @brief call FeatureAbility's render function + * + * @param: page instance, viewModel to call render on + */ + jerry_value_t Render(jerry_value_t viewModel) const; + /** + * @brief call FeatureAbility's show function + * + * @param: page instance, nativeElement to call show on + */ + void Show() const; + void RemoveAllView() const; + /** + * @brief set the ability path, bundle name and token info for current ability + * + * @param: ability's path, bundle name and token info + */ + void SetCurrentAbilityInfo(const char * const abilityPath, const char * const bundleName, uint16_t token); + /** + * @brief return ability path + */ + const char* GetCurrentAbilityPath() const + { + return currentAbilityPath_; + } + /** + * @brief set the js path and uuid info for current ability + * + * @param: js's path + */ + void SetCurrentJsPath(const char * const jsPath); + /** + * @brief return js path + */ + const char* GetCurrentJsPath() const + { + return currentJsPath_; + } + /** + * @brief return current bundle name + */ + const char* GetCurrentBundleName() const + { + return currentBundleName_; + } + + const JSAbilityImpl* GetTopJSAbilityImpl() const + { + return topJSAbilityImpl_; + } + /** + * @brief return current ability implementation + */ + void SetTopJSAbilityImpl(JSAbilityImpl* object) + { + topJSAbilityImpl_ = object; + } + + const AppStyleManager* GetStyleManager() + { + if (styleManage_ == nullptr) { + styleManage_ = new AppStyleManager(); + } + return styleManage_; + } + + void ReleaseStyles() + { + if (styleManage_) { + delete styleManage_; + styleManage_ = nullptr; + } + } + + /* + * @brief: clear app env. + */ + void ClearContext(); + +private: + /** + * @brief: release the ability info saved + */ + void ReleaseAbilityInfo(); + + void SetGlobalNamedProperty(bool isAppEval, jerry_value_t viewModel) const; + char* currentBundleName_ = nullptr; + char* currentAbilityPath_ = nullptr; + char* currentJsPath_ = nullptr; + JSAbilityImpl* topJSAbilityImpl_ = nullptr; + AppStyleManager* styleManage_ = nullptr; + // record current runing ability's uuid && ability path, will be release during app-cleanup + uint16_t currentToken_ = 0; +}; +} // namespace ACELite +} // namespace OHOS + +#endif // OHOS_ACELITE_JS_APP_CONTEXT_H diff --git a/src/core/context/js_app_environment.cpp b/src/core/context/js_app_environment.cpp new file mode 100755 index 0000000..ecf7c00 --- /dev/null +++ b/src/core/context/js_app_environment.cpp @@ -0,0 +1,122 @@ +/* + * Copyright (c) 2020 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. + */ +#include "js_app_environment.h" +#include "ace_event_error_code.h" +#include "ace_log.h" +#include "handler.h" +#include "js_app_context.h" +#include "js_framework_raw.h" +#include "js_fwk_common.h" +#include "js_profiler.h" +#include "module_manager.h" +#include "platform_adapter.h" +#include "presets/console_module.h" +#include "presets/feature_ability_module.h" +#include "presets/jstest_module.h" +#include "presets/localization_module.h" +#include "presets/profiler_module.h" +#include "presets/render_module.h" +#include "presets/require_module.h" +#include "presets/timer_module.h" +#include "presets/version_module.h" + +namespace OHOS { +namespace ACELite { +JsAppEnvironment::JsAppEnvironment() +{ + SetEngineSnapshotMode(snapshotMode_); +} + +void JsAppEnvironment::LoadAceBuiltInModules() const +{ + ConsoleModule::Load(); + RenderModule::Load(); + RequireModule::Load(); + FeaAbilityModule::Load(); + JsTestModule::Load(); + TimersModule::Load(); + PerformaceProfilerModule::Load(); + AceVersionModule::Load(); +} + +void JsAppEnvironment::InitJsFramework() const +{ + START_TRACING(ENGINE_INIT); + Srand((unsigned)jerry_port_get_current_time()); + Debugger::GetInstance().SetupJSContext(); + jerry_init(JERRY_INIT_EMPTY); + STOP_TRACING(); + START_TRACING(FWK_INIT); +#ifdef JSFWK_TEST + jerry_value_t globalThis = jerry_get_global_object(); + jerry_release_value(jerryx_set_property_str(globalThis, "globalThis", globalThis)); + jerry_release_value(globalThis); +#endif // JSFWK_TEST + LoadAceBuiltInModules(); + LoadFramework(); + LocalModule::Load(); + STOP_TRACING(); +} + +void JsAppEnvironment::LoadFramework() const +{ + size_t len = 0; + // load framework js/snapshot file to buffer + const char * const jsFrameworkScript = GetFrameworkRawBuffer(snapshotMode_, len); + const jerry_char_t *jScript = reinterpret_cast(jsFrameworkScript); + // eval framework to expose + START_TRACING(FWK_CODE_EVAL); + + jerry_value_t retValue = UNDEFINED; + if (snapshotMode_) { + retValue = jerry_exec_snapshot(reinterpret_cast(jScript), len, 0, 1); + } else { + retValue = jerry_eval(jScript, len, JERRY_PARSE_NO_OPTS); + } + STOP_TRACING(); + bool hasError = jerry_value_is_error(retValue); + if (hasError) { + HILOG_ERROR(HILOG_MODULE_ACE, "Failed to load JavaScript framework."); + ACE_ERROR_CODE_PRINT(EXCE_ACE_FWK_LAUNCH_FAILED, EXCE_ACE_INIT_FWK_FAILED); + PrintErrorMessage(retValue); + } else { + HILOG_INFO(HILOG_MODULE_ACE, "Success to load JavaScript framework."); + } + jerry_release_value(retValue); + Debugger::GetInstance().StartDebugger(); +} + +void JsAppEnvironment::Cleanup() +{ + Debugger::GetInstance().TearDownDebugger(); + FeaAbilityModule::Release(); + Debugger::GetInstance().ReleaseJSContext(); +} + +/** + * Decide the runtime mode of jerry + */ +void JsAppEnvironment::InitRuntimeMode() +{ + // if debugger is disabled, give a chance to use JS mode manually on device + SetEngineSnapshotModeManually(snapshotMode_); + if (snapshotMode_) { + HILOG_DEBUG(HILOG_MODULE_ACE, "ACELite is running in snapshot mode"); + } else { + HILOG_DEBUG(HILOG_MODULE_ACE, "ACELite is running in JS parser mode"); + } +} +} // namespace ACELite +} // namespace OHOS diff --git a/src/core/context/js_app_environment.h b/src/core/context/js_app_environment.h new file mode 100755 index 0000000..6fa4496 --- /dev/null +++ b/src/core/context/js_app_environment.h @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2020 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. + */ + +#ifndef OHOS_ACELITE_JS_APP_ENVIRONMENT_H +#define OHOS_ACELITE_JS_APP_ENVIRONMENT_H + +#include "js_debugger_config.h" +#include "non_copyable.h" + +namespace OHOS { +namespace ACELite { +/** + * @brief Environment of js app. + */ +class JsAppEnvironment final : public MemoryHeap { +public: + ACE_DISALLOW_COPY_AND_MOVE(JsAppEnvironment); + /** + * @brief: get instance of js app Environment. + * + * @returns: js app environment instance + */ + static JsAppEnvironment *GetInstance() + { + static JsAppEnvironment instance; + return &instance; + } + + /** + * @brief: init js framework. + */ + void InitJsFramework() const; + /** + * @brief: cleanup resources + */ + void Cleanup(); + /* + * @brief: this is called when preparing the environment for the application running, to decide + * the snapshot mode or JS parsing mode. + */ + void InitRuntimeMode(); + bool IsSnapshotMode() const + { + return snapshotMode_; + } + +private: + void LoadAceBuiltInModules() const; + JsAppEnvironment(); + ~JsAppEnvironment() {} + void LoadFramework() const; + // we use snapshot as default on device and JS parser as default on simulator + bool snapshotMode_; +}; +} // namespace ACELite +} // namespace OHOS + +#endif // OHOS_ACELITE_JS_APP_ENVIRONMENT_H diff --git a/src/core/context/js_framework_raw.cpp b/src/core/context/js_framework_raw.cpp new file mode 100755 index 0000000..cefab13 --- /dev/null +++ b/src/core/context/js_framework_raw.cpp @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2020 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. + */ +#include "js_framework_raw.h" + +#include + +namespace OHOS { +namespace ACELite { +// The following two header files should can only be included from this source file, +// define one macro to alert any incorrect using. +#define ACELITE_FRAMEWORK_RAW_BUFFER +// The build result from `js/framework` +#include "framework_min_bc.h" +#include "framework_min_js.h" + +const char *GetFrameworkRawBuffer(bool snapshotMode, size_t &bufLen) +{ + if (snapshotMode) { + bufLen = sizeof(g_frameworkBCBuffer); + return g_frameworkBCBuffer; + } else { + bufLen = strlen(g_frameworkJSBuffer); + return g_frameworkJSBuffer; + } +} +} // namespace ACELite +} // namespace OHOS diff --git a/src/core/context/js_framework_raw.h b/src/core/context/js_framework_raw.h new file mode 100755 index 0000000..e28e9fd --- /dev/null +++ b/src/core/context/js_framework_raw.h @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2020 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. + */ + +#ifndef OHOS_ACELITE_JS_FRAMEWORK_RAW_H +#define OHOS_ACELITE_JS_FRAMEWORK_RAW_H + +#include + +namespace OHOS { +namespace ACELite { +const char *GetFrameworkRawBuffer(bool snapshotMode, size_t &bufLen); +} // namespace ACELite +} // namespace OHOS +#endif // OHOS_ACELITE_JS_FRAMEWORK_RAW_H \ No newline at end of file diff --git a/src/core/context/js_profiler.cpp b/src/core/context/js_profiler.cpp new file mode 100755 index 0000000..c773630 --- /dev/null +++ b/src/core/context/js_profiler.cpp @@ -0,0 +1,445 @@ +/* + * Copyright (c) 2020 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. + */ + +#include "js_profiler.h" +// invoked into compiling only if performance measurement enabled +#if ENABLED(JS_PROFILER) +#include "ace_log.h" +#include "ace_mem_base.h" +#include "js_async_work.h" +#include "js_fwk_common.h" +#include "key_parser.h" +#if defined(FEATURE_ACELITE_MC_JS_PROFILER) +#include "common/file.h" +#include "los_swtmr.h" +#elif defined(FEATURE_ACELITE_JS_PROFILER) +#include +#else +#include +#endif // FEATURE_ACELITE_MC_JS_PROFILER +#if ENABLED(SECURE_C_FUNCTION) +#include "securec.h" +#else // ENABLED(SECURE_C_FUNCTION) +#include +#endif // ENABLED(SECURE_C_FUNCTION) + +#include + +namespace OHOS { +namespace ACELite { +/** + * Global instance, will be initialized when the first call of JSProfiler::GetInstance(). + */ + +static bool g_isFirst = true; +#if defined(FEATURE_ACELITE_MC_JS_PROFILER) +static uint16_t g_profiler_msg_index = 0; +#else +static constexpr uint8_t PHASE_NAME_LENGTH = 50; +#endif + +struct ProfilerPhase { + uint8_t phaseId; +#ifndef FEATURE_ACELITE_MC_JS_PROFILER + char phaseName[PHASE_NAME_LENGTH]; +#endif + PerformanceTag parentPhase; +}; + +/** + * Use static const strings other than accepting strings from tracing apis's caller, + * as that will need to do the string copy, which may make the cost bigger. + * NOTE: Keep this array sync with PerformanceTag definations + */ +static const ProfilerPhase g_profilerPhaseConfig[] = { +#if defined(FEATURE_ACELITE_MC_JS_PROFILER) + // id, parent + {P_UNKNOWN, P_UNKNOWN}, + {LAUNCH, P_UNKNOWN}, + {ENGINE_INIT, LAUNCH}, + {FWK_INIT, LAUNCH}, + {JS_BEGIN, P_UNKNOWN}, + {JS_FWK_EVAL, PAGE_CODE_EVAL}, + {JS_APP_INIT, FWK_CODE_EVAL}, + {JS_INIT_STATE, JS_FWK_EVAL}, + {JS_INIT_DATA_GET_DATA, JS_INIT_STATE}, + {JS_INIT_DATA_PROXY, JS_INIT_STATE}, + {JS_INIT_DATA_OBSERVE, JS_INIT_STATE}, + {JS_END, P_UNKNOWN}, + {FWK_CODE_LOAD, FWK_INIT}, + {FWK_CODE_EVAL, FWK_INIT}, + {APP_CODE_LOAD, LAUNCH}, + {APP_CODE_EVAL, LAUNCH}, + {PAGE_CODE_LOAD, ROUTER_REPLACE}, + {PAGE_CODE_EVAL, ROUTER_REPLACE}, + {STYLESHEET_INIT, JS_FWK_EVAL}, + {APP_ON_CREATE, LAUNCH}, + {APP_ON_DESTROY, LAUNCH}, + {ROUTER_REPLACE, LAUNCH}, + {PAGE_TRANSFER_DATA, ROUTER_REPLACE}, + {PAGE_ON_INIT, ROUTER_REPLACE}, + {PAGE_ON_READY, ROUTER_REPLACE}, + {PAGE_ON_SHOW, ROUTER_REPLACE}, + {PAGE_ON_DESTROY, P_UNKNOWN}, + {RENDER, ROUTER_REPLACE}, + {ADD_TO_ROOT_VIEW, LAUNCH}, + {RENDER_CREATE_COMPONENT, RENDER}, + {RENDER_COMBINE_STYLE, RENDER}, + {RENDER_BIND_JS_OBJECT, RENDER}, + {RENDER_PARSE_ATTR, RENDER}, + {RENDER_PARSE_EVENT, RENDER}, + {RENDER_APPLY_STYLE, RENDER}, + {RENDER_PROCESS_CHILDREN, RENDER}, + {SET_ATTR_PARSE_EXPRESSION, RENDER_PARSE_ATTR}, + {SET_ATTR_STRING_OF, RENDER_PARSE_ATTR}, + {SET_ATTR_PARSE_KEY_ID, RENDER_PARSE_ATTR}, + {SET_ATTR_SET_TO_NATIVE, RENDER_PARSE_ATTR}, + {APPLY_STYLE_ITEM, RENDER_APPLY_STYLE}, + {WATCHER_CALLBACK_FUNC, P_UNKNOWN}, + {FOR_WATCHER_CALLBACK_FUNC, P_UNKNOWN}, + {WATCHER_CONSTRUCT, SET_ATTR_PARSE_EXPRESSION} +#else + // id, name, parent + {P_UNKNOWN, "UNKNOWN", P_UNKNOWN}, + {LAUNCH, "LAUNCH", P_UNKNOWN}, + {ENGINE_INIT, "ENGINE_INIT", LAUNCH}, + {FWK_INIT, "FWK_INIT", LAUNCH}, + {JS_BEGIN, "JS_BEGIN", P_UNKNOWN}, // not used + {JS_FWK_EVAL, "JS_FWK_EVAL", PAGE_CODE_EVAL}, // 5 + {JS_APP_INIT, "JS_APP_INIT", FWK_CODE_EVAL}, // 6 + {JS_INIT_STATE, "JS_INIT_STATE", JS_FWK_EVAL}, // 7 + {JS_INIT_DATA_GET_DATA, "JS_INIT_DATA_GET_DATA", JS_INIT_STATE}, // 8 + {JS_INIT_DATA_PROXY, "JS_INIT_DATA_PROXY", JS_INIT_STATE}, // 9 + {JS_INIT_DATA_OBSERVE, "JS_INIT_DATA_OBSERVE", JS_INIT_STATE}, // 10 + {JS_END, "JS_END", P_UNKNOWN}, // not used + {FWK_CODE_LOAD, "FWK_CODE_LOAD", FWK_INIT}, + {FWK_CODE_EVAL, "FWK_CODE_EVAL", FWK_INIT}, + {APP_CODE_LOAD, "APP_CODE_LOAD", LAUNCH}, + {APP_CODE_EVAL, "APP_CODE_EVAL", LAUNCH}, + {PAGE_CODE_LOAD, "PAGE_CODE_LOAD", ROUTER_REPLACE}, + {PAGE_CODE_EVAL, "PAGE_CODE_EVAL", ROUTER_REPLACE}, + {STYLESHEET_INIT, "STYLESHEET_INIT", JS_FWK_EVAL}, + {APP_ON_CREATE, "APP_ON_CREATE", LAUNCH}, + {APP_ON_DESTROY, "APP_ON_DESTROY", LAUNCH}, + {ROUTER_REPLACE, "ROUTER_REPLACE", LAUNCH}, + {PAGE_TRANSFER_DATA, "PAGE_TRANSFER_DATA", ROUTER_REPLACE}, + {PAGE_ON_INIT, "PAGE_ON_INIT", ROUTER_REPLACE}, + {PAGE_ON_READY, "PAGE_ON_READY", ROUTER_REPLACE}, + {PAGE_ON_SHOW, "PAGE_ON_SHOW", ROUTER_REPLACE}, + {PAGE_ON_DESTROY, "PAGE_ON_DESTROY", P_UNKNOWN}, + {RENDER, "RENDER", ROUTER_REPLACE}, + {ADD_TO_ROOT_VIEW, "ADD_TO_ROOT_VIEW", LAUNCH}, + {RENDER_CREATE_COMPONENT, "RENDER_CREATE_COMPONENT", RENDER}, + {RENDER_COMBINE_STYLE, "RENDER_COMBINE_STYLE", RENDER}, + {RENDER_BIND_JS_OBJECT, "RENDER_BIND_JS_OBJECT", RENDER}, + {RENDER_PARSE_ATTR, "RENDER_PARSE_ATTR", RENDER}, + {RENDER_PARSE_EVENT, "RENDER_PARSE_EVENT", RENDER}, + {RENDER_APPLY_STYLE, "RENDER_APPLY_STYLE", RENDER}, + {RENDER_PROCESS_CHILDREN, "RENDER_PROCESS_CHILDREN", RENDER}, + {SET_ATTR_PARSE_EXPRESSION, "SET_ATTR_PARSE_EXPRESSION", RENDER_PARSE_ATTR}, + {SET_ATTR_STRING_OF, "SET_ATTR_STRING_OF", RENDER_PARSE_ATTR}, + {SET_ATTR_PARSE_KEY_ID, "SET_ATTR_PARSE_KEY_ID", RENDER_PARSE_ATTR}, + {SET_ATTR_SET_TO_NATIVE, "SET_ATTR_SET_TO_NATIVE", RENDER_PARSE_ATTR}, + {APPLY_STYLE_ITEM, "APPLY_STYLE_ITEM", RENDER_APPLY_STYLE}, + {WATCHER_CALLBACK_FUNC, "WATCHER_CALLBACK_FUNC", P_UNKNOWN}, + {FOR_WATCHER_CALLBACK_FUNC, "FOR_WATCHER_CALLBACK_FUNC", P_UNKNOWN}, + {WATCHER_CONSTRUCT, "WATCHER_CONSTRUCT", SET_ATTR_PARSE_EXPRESSION} +#endif +}; + +#ifdef FEATURE_ACELITE_MC_JS_PROFILER +JSProfiler::JSProfiler() : data_(nullptr), dataCount_(0), traceIdSlot_(0), enabled_(false), msg_(nullptr) {} +#else +JSProfiler::JSProfiler() : data_(nullptr), dataCount_(0), traceIdSlot_(0), enabled_(false) {} +#endif + +JSProfiler::~JSProfiler() +{ +} + +JSProfiler *JSProfiler::GetInstance() +{ + static JSProfiler profilerInstance; + return &profilerInstance; +} + +bool JSProfiler::IsEnabled() +{ + bool isEnabled = enabled_ && (data_ != nullptr); +#ifdef FEATURE_ACELITE_MC_JS_PROFILER + isEnabled = isEnabled && (msg_ != nullptr); +#endif + return isEnabled; +} + +void JSProfiler::PrepareDataBuffer() +{ + enabled_ = IsFileExisted(PROFILER_ENABLE_FLAG_FILE); + if (!enabled_) { + return; + } + data_ = static_cast(ace_malloc(maxTracingDataCount * sizeof(PerformanceData))); + if (data_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "malloc performance data buffer failed"); + return; + } +#ifdef FEATURE_ACELITE_MC_JS_PROFILER + msg_ = static_cast(ace_malloc(PROFILER_MSG_LENGTH * sizeof(ProfilerMsg))); + if (msg_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "malloc performance data buffer failed"); + ace_free(data_); + data_ = nullptr; + return; + } +#endif + ResetData(); +} + +#ifdef FEATURE_ACELITE_MC_JS_PROFILER +void JSProfiler::FlushProfilerMsg(void *data) +{ + if (data == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "sync js profiler msg error"); + return; + } + + uint32_t timestamp = JSProfiler::GetInstance()->GetCurrentClockTick(); + char fileName[TEXT_LENGTH] = {'\0'}; + if (sprintf_s(fileName, TEXT_LENGTH, "ace_profiler_%d.log", timestamp) < 0) { + HILOG_ERROR(HILOG_MODULE_ACE, "ace js profiler flushmsg sprintf error"); + return; + } + + char *fullPath = RelocateJSSourceFilePath(DEFAULT_PROFILER_MSG_PATH, fileName); + if (fullPath == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "ace js profiler create error"); + return; + } + + int32_t fd = FileOpen(fullPath, O_CREAT | O_RDWR); + if (fd < 0) { + HILOG_ERROR(HILOG_MODULE_ACE, "ace js profiler open error"); + ace_free(fullPath); + fullPath = nullptr; + return; + } + + for (uint16_t i = 0; i < g_profiler_msg_index; i++) { + if (FileWrite(fd, JSProfiler::GetInstance()->msg_[i].msg, strlen(JSProfiler::GetInstance()->msg_[i].msg)) < 0) { + HILOG_ERROR(HILOG_MODULE_ACE, "ace dump js profiler msg error"); + break; + } + } + + if (FileClose(fd) < 0) { + HILOG_ERROR(HILOG_MODULE_ACE, "ace js profiler close error"); + } + + ace_free(fullPath); + fullPath = nullptr; + g_profiler_msg_index = 0; + JSProfiler::GetInstance()->ResetData(); +} +#endif + +void JSProfiler::Release() +{ + ACE_FREE(data_); +#ifdef FEATURE_ACELITE_MC_JS_PROFILER + ACE_FREE(msg_); +#endif +} + +void JSProfiler::ResetData() +{ + if (data_) { +#if ENABLED(SECURE_C_FUNCTION) + if (memset_s(data_, (maxTracingDataCount * sizeof(PerformanceData)), 0, + (maxTracingDataCount * sizeof(PerformanceData))) != 0) { + HILOG_ERROR(HILOG_MODULE_ACE, "ace js profiler memset_s failed"); + return; + } +#else + for (uint16_t i = 0; i < maxTracingDataCount; i++) { + data_[i].start = 0; + data_[i].end = 0; + data_[i].label = 0; + data_[i].description = 0; + data_[i].component = 0; + } +#endif + } + +#ifdef FEATURE_ACELITE_MC_JS_PROFILER + if (msg_) { + if (memset_s(msg_, (PROFILER_MSG_LENGTH * sizeof(ProfilerMsg)), 0, + (PROFILER_MSG_LENGTH * sizeof(ProfilerMsg))) != 0) { + HILOG_ERROR(HILOG_MODULE_ACE, "ace js profiler memset_s failed"); + return; + } + } +#endif + dataCount_ = 0; + g_isFirst = true; +} + +static uint64_t g_startOffset = 0; +void JSProfiler::PushTrace(PerformanceTag tag, uint8_t name, uint8_t description) +{ + if (!IsEnabled()) { + return; + } + + // skip some redundant modules + if (g_isFirst) { + if ((tag != LAUNCH) && (tag != ROUTER_REPLACE)) { + return; + } else { + g_isFirst = false; + } + } + + if (g_startOffset == 0) { + g_startOffset = GetCurrentClockTick(); + } + if (traceIdSlot_ >= maxCountAllAtOnce) { + // the trace id is running out, can not process this tracing request util any STOP_TRACING called + return; + } + + if (dataCount_ >= maxTracingDataCount) { + return; + } + + uint16_t dataIndex = dataCount_; + // record current time stamp + data_[dataIndex].start = GetCurrentClockTick() - g_startOffset; + data_[dataIndex].label = tag; + data_[dataIndex].component = name; + data_[dataIndex].description = description; + + // record the new trace id into stack + traceIdStack_[traceIdSlot_] = dataIndex; + traceIdSlot_++; + // increase data count + dataCount_++; +} + +/** + * @brief Calculate time cost and output to trace. + */ +void JSProfiler::PopTrace() +{ + if (!IsEnabled()) { + return; + } + if ((traceIdSlot_ == 0) || (traceIdSlot_ > maxCountAllAtOnce)) { + return; + } + uint16_t traceId = traceIdStack_[traceIdSlot_ - 1]; + traceIdSlot_--; + data_[traceId].end = GetCurrentClockTick() - g_startOffset; +} + +void JSProfiler::Output() +{ + if (!IsEnabled()) { + return; + } + for (uint16_t dataIndex = 0; dataIndex < dataCount_; dataIndex++) { + PerformanceData data = data_[dataIndex]; + if ((data.label > ADD_TO_ROOT_VIEW) && (data.start >= data.end)) { + // for too many round details, we just print out bigger than 0 items to save the log IO band width + continue; + } +#if defined(FEATURE_ACELITE_MC_JS_PROFILER) + if (g_profiler_msg_index == 0) { + if ((data.label != LAUNCH) && (data.label != ROUTER_REPLACE)) { + continue; + } + } + + if (g_profiler_msg_index >= PROFILER_MSG_LENGTH) { + continue; + } + + char buf[MSG_LENGTH] = {'\0'}; + if (sprintf_s(buf, MSG_LENGTH, "%d %d %llu %d %d\n", data.component, data.label, + CalculateElapsedTime(data.start, data.end), data.description, data.label) < 0) { + HILOG_ERROR(HILOG_MODULE_ACE, "ace js profiler memset_s msg failed"); + return; + } + if (strcpy_s(msg_[g_profiler_msg_index].msg, MSG_LENGTH, buf) != 0) { + HILOG_ERROR(HILOG_MODULE_ACE, "ace js profiler write msg failed"); + return; + } + g_profiler_msg_index++; + +#else + LOG_PROFILER("COST %s %s %llu ms [%s] %s", KeyParser::GetKeyById(data.component), + g_profilerPhaseConfig[data.label].phaseName, CalculateElapsedTime(data.start, data.end), + (data.description != 0) ? KeyParser::GetKeyById(data.description) : "", + g_profilerPhaseConfig[g_profilerPhaseConfig[data.label].parentPhase].phaseName); +#endif + } +#ifdef FEATURE_ACELITE_MC_JS_PROFILER + JsAsyncWork::DispatchAsyncWork(FlushProfilerMsg, this); +#else + // reset all records after output to trace + ResetData(); +#endif +} + +uint64_t JSProfiler::GetCurrentClockTick() const +{ +#if defined(FEATURE_ACELITE_MC_JS_PROFILER) + // real device + return LOS_TickCountGet(); // count in clock ticks, usually is ms +#elif defined(FEATURE_ACELITE_JS_PROFILER) + const uint32_t unit = 1000; + // ipcamera + timeval timeVal; + timezone timeZone; + return (gettimeofday(&timeVal, &timeZone) == 0) ? (timeVal.tv_usec / unit + timeVal.tv_sec * unit) : 0; +#else + // PC simulator + return clock(); // count in clock ticks, usually is ms +#endif +} + +// convert clock tick intervals into milliseconds +uint64_t JSProfiler::CalculateElapsedTime(uint64_t start, uint64_t end) const +{ +#ifndef FEATURE_ACELITE_JS_PROFILER + const uint32_t msPerSec = 1000; +#endif + if (start >= end) { + return 0; + } + + uint64_t interval = end - start; +#if defined(FEATURE_ACELITE_MC_JS_PROFILER) + // real device + return (interval * msPerSec) / LOSCFG_BASE_CORE_TICK_PER_SECOND; +#elif defined(FEATURE_ACELITE_JS_PROFILER) + return interval; +#else + // PC simulator + return (interval * msPerSec) / CLOCKS_PER_SEC; +#endif +} +} // namespace ACELite +} // namespace OHOS +#endif // ENABLED(JS_PROFILER) diff --git a/src/core/context/js_profiler.h b/src/core/context/js_profiler.h new file mode 100755 index 0000000..7168406 --- /dev/null +++ b/src/core/context/js_profiler.h @@ -0,0 +1,248 @@ +/* + * Copyright (c) 2020 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. + */ +#ifndef OHOS_ACELITE_JS_PROFILER_H +#define OHOS_ACELITE_JS_PROFILER_H +#include "acelite_config.h" +#include "js_config.h" +#include "memory_heap.h" +#include "non_copyable.h" +#include +#include + +/* + * Wrapper macro, use directly in code after including this header file. + */ +#if ENABLED(JS_PROFILER) +// start tracing for one given phase, and return a traceId which will be used when calling STOP_TRACING +#define START_TRACING(traceTag) JSProfiler::GetInstance()->PushTrace(traceTag, 0, 0) +// start tracing for one given phase, and provids the component name together +#define START_TRACING_WITH_COMPONENT_NAME(traceTag, componentNameId) \ + JSProfiler::GetInstance()->PushTrace(traceTag, componentNameId, 0) +#define START_TRACING_WITH_EXTRA_INFO(traceTag, componentNameId, extraInfoId) \ + JSProfiler::GetInstance()->PushTrace(traceTag, componentNameId, extraInfoId) +// stop tracing +#define STOP_TRACING() JSProfiler::GetInstance()->PopTrace() +#define OUTPUT_TRACE() JSProfiler::GetInstance()->Output() +#else // ENABLED(JS_PROFILER) +#define START_TRACING(traceTag) +#define START_TRACING_WITH_COMPONENT_NAME(traceTag, componentNameId) +#define START_TRACING_WITH_EXTRA_INFO(traceTag, componentNameId, extraInfoId) +#define STOP_TRACING() +#define OUTPUT_TRACE() +#endif // ENABLED(JS_PROFILER) + +// invoked into compiling only if performance measurement enabled +#if ENABLED(JS_PROFILER) +namespace OHOS { +namespace ACELite { +/** + * Define all trace point tags for performance measurement. + * + * NOTE: KEEP SYNC WITH g_PerformanceTagName in cpp file + */ +enum PerformanceTag { + P_UNKNOWN = 0X00, + LAUNCH, + ENGINE_INIT, + FWK_INIT, + JS_BEGIN, + JS_FWK_EVAL, // 5 + JS_APP_INIT, // 6 + JS_INIT_STATE, // 7 + JS_INIT_DATA_GET_DATA, // 8 + JS_INIT_DATA_PROXY, // 9 + JS_INIT_DATA_OBSERVE, // 10 + JS_END, + FWK_CODE_LOAD, + FWK_CODE_EVAL, + APP_CODE_LOAD, + APP_CODE_EVAL, + PAGE_CODE_LOAD, + PAGE_CODE_EVAL, + STYLESHEET_INIT, + APP_ON_CREATE, + APP_ON_DESTROY, + ROUTER_REPLACE, + PAGE_TRANSFER_DATA, + PAGE_ON_INIT, + PAGE_ON_READY, + PAGE_ON_SHOW, + PAGE_ON_DESTROY, + RENDER, + ADD_TO_ROOT_VIEW, + RENDER_CREATE_COMPONENT, + RENDER_COMBINE_STYLE, + RENDER_BIND_JS_OBJECT, + RENDER_PARSE_ATTR, + RENDER_PARSE_EVENT, + RENDER_APPLY_STYLE, + RENDER_PROCESS_CHILDREN, + SET_ATTR_PARSE_EXPRESSION, + SET_ATTR_STRING_OF, + SET_ATTR_PARSE_KEY_ID, + SET_ATTR_SET_TO_NATIVE, + APPLY_STYLE_ITEM, + WATCHER_CALLBACK_FUNC, + FOR_WATCHER_CALLBACK_FUNC, + WATCHER_CONSTRUCT +}; + +/** + * The max count of tracing we can support at the same time. + * NOTE: please define this value as a multiple of 2, and dont make it's bigger than 256 + */ +constexpr uint8_t maxCountAllAtOnce = 16; + +// need more data slots for static profiling mode, as we record them all before output the result +constexpr uint16_t maxTracingDataCount = 512; + +/** + * Performance data holder. + */ +struct PerformanceData { + uint64_t start; // count in clock ticks (usually 1ms) + uint64_t end; + uint8_t label; // what's the phase this time cost data is representing + uint8_t description; // other description, NOTE: we don't do string copy, so const char* must be given + uint8_t component; +}; + +#ifdef FEATURE_ACELITE_MC_JS_PROFILER +static constexpr uint8_t MSG_LENGTH = 20; + +struct ProfilerMsg { + char msg[MSG_LENGTH] = {'\0'}; +}; +#endif + +/** + * @brief The JSProfiler class is an runtime performance recorder and outputter, used for recording + * runtime timecost mainly. Implemented for development and will be disabled for release version. + */ +class JSProfiler final : public MemoryHeap { +public: + ACE_DISALLOW_COPY_AND_MOVE(JSProfiler); + /** + * @brief Default constructor. + */ + JSProfiler(); + + /** + * @brief Default destructor. + */ + ~JSProfiler(); + + /** + * @brief Use static global variable for easy access in different source code file. + * + * @return global JSProfiler object + */ + static JSProfiler *GetInstance(); + + /** + * Called to free all performance data records and the global JSProfiler object. + */ + void Release(); + +#ifdef FEATURE_ACELITE_MC_JS_PROFILER + /** + * @brief Flush output to file. + */ + static void FlushProfilerMsg(void *data); +#endif + + /** + * @brief Clean all performance record in data_. + */ + void ResetData(); + + /** + * @brief Record the current timestamp for the given tag. + * + * @param [in] tag The given phase's trace name, must be given. + * @param [in] name The component name of the current tracing phase, default is null. + * @param [in] description The extra description string id (must can be parsed by KeyParser) + * for this trace, default is null. + * + */ + void PushTrace(PerformanceTag tag, uint8_t name, uint8_t description); + + /** + * @brief Calculate the time interval and log out. + * + */ + void PopTrace(); + + /** + * @brief Calculate all time cost and output to trace. + * + * NOTE: Delay the elapsed time calculating to this method to save band width. + */ + void Output(); + + /** + * @brief Get current timestamp for recording. + * + * @return the current timestamp, count in clock tick, will be converted into ms during output performance data + */ + uint64_t GetCurrentClockTick() const; + + /** + * @brief Calculate the elapsed milliseconds from two input clock timestamp. + * + * @param [in] start The start timestamp, must count in clock tick. + * @param [in] end The end timestamp, must count in clock tick. + * + * @return the elapsed time from start to end, count in ms + */ + uint64_t CalculateElapsedTime(uint64_t start, uint64_t end) const; + + /** + * @brief Check if the profiler is enabled or not. + * + * @return true for enabled, false for not + */ + bool IsEnabled(); + + /** + * @brief malloc data buffer for saving performance data. + */ + void PrepareDataBuffer(); + +private: + /** + * The trace id stack, MAX_COUNT_ALL_AT_ONCE at the same time + */ + uint16_t traceIdStack_[maxTracingDataCount] = {0}; + + /** + * The tracing data + */ + PerformanceData *data_ = nullptr; + + uint16_t dataCount_ = 0; + uint16_t traceIdSlot_ = 0; + bool enabled_ = false; +#ifdef FEATURE_ACELITE_MC_JS_PROFILER + static constexpr uint8_t PROFILER_MSG_LENGTH = 128; + static constexpr uint8_t TEXT_LENGTH = 30; + ProfilerMsg *msg_ = nullptr; +#endif +}; +} // namespace ACELite +} // namespace OHOS + +#endif // ENABLED(JS_PROFILER) +#endif // OHOS_ACELITE_JS_PROFILER_H diff --git a/src/core/context/js_timer_list.cpp b/src/core/context/js_timer_list.cpp new file mode 100755 index 0000000..dd4f05c --- /dev/null +++ b/src/core/context/js_timer_list.cpp @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2020 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. + */ + +#include "acelite_config.h" + +#ifdef FEATURE_TIMER_MODULE +#include "js_timer_list.h" +#include "presets/timer_module.h" +#include "ace_mem_base.h" + +namespace OHOS { +namespace ACELite { +jerry_value_t TimerList::AddTimer(timerHandle_t timerId, Arguments *&arg) +{ + TimerNode *timer = static_cast(ace_malloc(sizeof(TimerNode))); + if (timer == nullptr) { + return UNDEFINED; + } + uint8_t index = GetIndex(); + timer->index = index; + timer->next = timerListHead_; + timer->timerId = timerId; + arg->index = index; + timer->arguments = arg; + timerListHead_ = timer; + timer = nullptr; + return jerry_create_number(index); +} + +TimerList::TimerNode* TimerList::GetTimer(uint8_t id) +{ + TimerNode *current = timerListHead_; + while (current != nullptr) { + if (current->index == id) { + break; + } + current = current->next; + } + return current; +} + +void TimerList::DeleteTimer(uint8_t timer) +{ + if (timerListHead_ == nullptr) { + return; + } + TimerNode *current = timerListHead_; + TimerNode *preNode = nullptr; + while ((timer != current->index) && (current->next != nullptr)) { + preNode = current; + current = current->next; + } + if (timer == current->index) { + if (current == timerListHead_) { + timerListHead_ = current->next; + } else { + preNode->next = current->next; + } + ReleaseTimer(current); + } +} + +void TimerList::ClearTimerList() +{ + while (timerListHead_ != nullptr) { + TimerNode *current = timerListHead_; + timerListHead_ = timerListHead_->next; + StopTimerTask(current->timerId); + ReleaseTimer(current); + } +} + +void TimerList::ReleaseTimer(TimerNode *¤t) +{ + if (current == nullptr) { + return; + } + ReleaseArguments(current->arguments); + ace_free(current); + current = nullptr; +} + +void TimerList::ReleaseArguments(Arguments *&argument) +{ + if (argument) { + jerry_release_value(argument->func); + if ((argument->argsNum > 0) && (argument->args != nullptr)) { + for (uint32_t i = 0; i < argument->argsNum; i++) { + jerry_release_value((argument->args)[i]); + } + } + ACE_FREE(argument->args); + delete argument; + argument = nullptr; + } +} +} // namespace ACELite +} // namespace OHOS +#endif // FEATURE_TIMER_MODULE diff --git a/src/core/context/js_timer_list.h b/src/core/context/js_timer_list.h new file mode 100755 index 0000000..7caccdd --- /dev/null +++ b/src/core/context/js_timer_list.h @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2020 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. + */ + + +#ifndef OHOS_ACELITE_JS_TIMER_LIST_H +#define OHOS_ACELITE_JS_TIMER_LIST_H + +#include "acelite_config.h" + +#ifdef FEATURE_TIMER_MODULE +#include +#include +#include "memory_heap.h" +#include "nativeapi_timer_task.h" +#include "non_copyable.h" + +namespace OHOS { +namespace ACELite { +class TimerList final : public MemoryHeap { +public: + ACE_DISALLOW_COPY_AND_MOVE(TimerList); + /** + * @fn TimerList::TimerList() + * @brief Constructor + */ + TimerList() : timerListHead_(nullptr), index_(0) {} + + /** + * @fn TimerList::~TimerList() + * + */ + ~TimerList() = default; + + void ClearTimerList(); + + // the struct of timer task arguments + struct Arguments : public MemoryHeap { + uint8_t index; + bool repeated; + jerry_length_t argsNum = 0; + jerry_value_t func; + jerry_value_t context; + jerry_value_t *args = nullptr; + }; + + // the struct of timer + struct TimerNode : public MemoryHeap { + uint8_t index; + timerHandle_t timerId; + Arguments *arguments; + struct TimerNode *next; + }; + + jerry_value_t AddTimer(timerHandle_t timerId, Arguments *&arguments); + + TimerNode* GetTimer(uint8_t id); + + void DeleteTimer(uint8_t timer); + + void ReleaseArguments(Arguments *&argument); + + uint8_t GetIndex() + { + return ++index_; + } + +private: + void ReleaseTimer(TimerNode *¤t); + + TimerNode *timerListHead_; + uint8_t index_; +}; +} // namespace ACELite +} // namespace OHOS +#endif // FEATURE_TIMER_MODULE +#endif // OHOS_ACELITE_JS_TIMER_LIST_H diff --git a/src/core/directive/BUILD.gn b/src/core/directive/BUILD.gn new file mode 100755 index 0000000..7bebaef --- /dev/null +++ b/src/core/directive/BUILD.gn @@ -0,0 +1,24 @@ +#Copyright (c) 2020 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. + +source_set("directive") { + configs += [ + "//foundation/ace/lite/jsfwk:ace_config", + ] + sources = [ + "descriptor_utils.cpp", + "directive_watcher_callback.cpp" + ] + include_dirs = [ + ] +} diff --git a/src/core/directive/descriptor_utils.cpp b/src/core/directive/descriptor_utils.cpp new file mode 100755 index 0000000..f3ee62f --- /dev/null +++ b/src/core/directive/descriptor_utils.cpp @@ -0,0 +1,246 @@ +/* + * Copyright (c) 2020 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. + */ + +#include "directive/descriptor_utils.h" +#include "ace_log.h" +#include "directive/directive_watcher_callback.h" +#include "wrapper/js.h" + +namespace OHOS { +namespace ACELite { +const char * const DescriptorUtils::DESCRIPTOR_ATTR_GETTER = "getter"; +const char * const DescriptorUtils::DESCRIPTOR_ATTR_RENDER = "render"; +const char * const DescriptorUtils::DESCRIPTOR_ATTR_IF = "if"; +const char * const DescriptorUtils::DESCRIPTOR_ATTR_FOR = "for"; +const char * const DescriptorUtils::DESCRIPTOR_ATTR_RENDERED = "rendered"; +const char * const DescriptorUtils::WATCHER_OPTION_ELEMENT = "element"; +const char * const DescriptorUtils::WATCHER_OPTION_DESCRIPTOR = "descriptor"; + +JSValue DescriptorUtils::CreateIfDescriptor(JSValue getter, JSValue render) +{ + return CreateDescriptor(DESCRIPTOR_ATTR_IF, getter, render); +} + +JSValue DescriptorUtils::CreateForDescriptor(JSValue getter, JSValue render) +{ + return CreateDescriptor(DESCRIPTOR_ATTR_FOR, getter, render); +} + +JSValue DescriptorUtils::CreateDescriptorWatcher(JSValue element, JSValue descriptor) +{ + JSValue getter = JSObject::Get(descriptor, DESCRIPTOR_ATTR_GETTER); + JSValue options = JSObject::Create(); + JSObject::Set(options, WATCHER_OPTION_ELEMENT, element); + JSObject::Set(options, WATCHER_OPTION_DESCRIPTOR, descriptor); + + JSValue watcher = CreateWatcher(getter, DirectiveWatcherCallback::Handler, options); + JSRelease(options); + JSRelease(getter); + + return watcher; +} + +bool DescriptorUtils::IsIfDescriptor(JSValue descriptor) +{ + return IsDescriptor(DESCRIPTOR_ATTR_IF, descriptor); +} + +bool DescriptorUtils::IsForDescriptor(JSValue descriptor) +{ + return IsDescriptor(DESCRIPTOR_ATTR_FOR, descriptor); +} + +bool DescriptorUtils::IsIfDescriptorShown(JSValue descriptor) +{ + JSValue getter = JSObject::Get(descriptor, DESCRIPTOR_ATTR_GETTER); + JSValue condition = CallWithRootAbilitySlice(getter); + bool isShown = JSBoolean::Value(condition); + JSRelease(condition); + JSRelease(getter); + return isShown; +} + +JSValue DescriptorUtils::RenderIfDescriptor(JSValue descriptor) +{ + JSValue render = JSObject::Get(descriptor, DESCRIPTOR_ATTR_RENDER); + JSValue rendered = CallWithRootAbilitySlice(render); + JSRelease(render); + JSObject::Set(descriptor, DESCRIPTOR_ATTR_RENDERED, rendered); + return rendered; +} + +JSValue DescriptorUtils::RenderForDescriptor(JSValue descriptor) +{ + JSValue getter = JSObject::Get(descriptor, DESCRIPTOR_ATTR_GETTER); + + JSValue array = CallWithRootAbilitySlice(getter); + JSRelease(getter); + + if (JSUndefined::Is(array)) { + HILOG_ERROR(HILOG_MODULE_ACE, "Failed to RenderForDescriptor because the result value is undefined."); + return JSUndefined::Create(); + } + + JSValue render = JSObject::Get(descriptor, DESCRIPTOR_ATTR_RENDER); + + JSValue rendered = JSArray::Map(array, render); + JSRelease(render); + JSRelease(array); + JSObject::Set(descriptor, DESCRIPTOR_ATTR_RENDERED, rendered); + return rendered; +} + +JSValue DescriptorUtils::GetDescriptorRendered(JSValue descriptor) +{ + return JSObject::Get(descriptor, DESCRIPTOR_ATTR_RENDERED); +} + +void DescriptorUtils::DelIfDescriptorRendered(JSValue descriptor) +{ + JSValue descriptorOrElement = GetDescriptorRendered(descriptor); + if (!JSUndefined::Is(descriptorOrElement)) { + JSObject::Del(descriptor, DESCRIPTOR_ATTR_RENDERED); + // the rendered property need to be released + // and ReleaseDescriptorOrElement function will release it. + ReleaseDescriptorOrElement(descriptorOrElement); + } + // decrease the count of reference increased by jerry_get_property + JSRelease(descriptorOrElement); +} + +void DescriptorUtils::DelForDescriptorRendered(JSValue descriptor) +{ + JSValue descriptorOrElements = GetDescriptorRendered(descriptor); + if (!JSUndefined::Is(descriptorOrElements)) { + JSObject::Del(descriptor, DESCRIPTOR_ATTR_RENDERED); + ReleaseDescriptorOrElements(descriptorOrElements); + // the rendered property need to be released + // but ReleaseDescriptorOrElements function only release its element. + JSRelease(descriptorOrElements); + } + // decrease the count of reference increased by jerry_get_property + JSRelease(descriptorOrElements); +} + +void DescriptorUtils::ReleaseDescriptorOrElements(JSValue descriptorOrElements) +{ + uint16_t size = JSArray::Length(descriptorOrElements); + for (uint16_t idx = 0; idx < size; ++idx) { + JSValue descriptorOrElement = JSArray::Get(descriptorOrElements, idx); + // Don't release descriptorOrElement after ReleaseDescriptorOrElement function + // because ReleaseDescriptorOrElement will release descriptorOrElement + ReleaseDescriptorOrElement(descriptorOrElement); + } +} + +void DescriptorUtils::ReleaseDescriptorOrElement(JSValue descriptorOrElement) +{ + if (IsForDescriptor(descriptorOrElement)) { + ReleaseForDescriptor(descriptorOrElement); + } else if (IsIfDescriptor(descriptorOrElement)) { + ReleaseIfDescriptor(descriptorOrElement); + } else { + ReleaseElement(descriptorOrElement); + } +} + +void DescriptorUtils::ReleaseForDescriptor(JSValue descriptor) +{ + if (JSUndefined::Is(descriptor)) { + return; + } + DelForDescriptorRendered(descriptor); + JSRelease(descriptor); +} + +void DescriptorUtils::ReleaseIfDescriptor(JSValue descriptor) +{ + if (JSUndefined::Is(descriptor)) { + return; + } + DelIfDescriptorRendered(descriptor); + JSRelease(descriptor); +} + +void DescriptorUtils::ReleaseElement(JSValue element) +{ + if (JSUndefined::Is(element)) { + return; + } + + Component *component = nullptr; + bool isBinded = JSObject::GetNativePointer(element, reinterpret_cast(&component)); + if (!isBinded || (component == nullptr)) { + return; + } + + bool isSuccess = JSObject::DelNativePointer(element); + if (!isSuccess) { + HILOG_WARN(HILOG_MODULE_ACE, "delete native view pointer from native element failed."); + } + + if (component->GetComponentName() != K_LIST) { + JSValue descriptors = component->GetDescriptors(); + if (!JSUndefined::Is(descriptors)) { + ReleaseDescriptorOrElements(descriptors); + } + } + + component->Release(); + delete component; + component = nullptr; +} + +JSValue DescriptorUtils::CreateDescriptor(const char * const type, JSValue getter, JSValue render) +{ + if ((type == nullptr) || (strlen(type) == 0)) { + HILOG_ERROR(HILOG_MODULE_ACE, "Failed to create descriptor because the type argument is null or empty."); + return UNDEFINED; + } + + if (!JSFunction::Is(getter)) { + HILOG_ERROR(HILOG_MODULE_ACE, "Failed to create descriptor because the getter argument is not a function."); + return UNDEFINED; + } + + if (!JSFunction::Is(render)) { + HILOG_ERROR(HILOG_MODULE_ACE, "Failed to create descriptor because the render argument is not a function."); + return UNDEFINED; + } + + JSValue descriptor = JSObject::Create(); + JSValue value = JSBoolean::Create(true); + JSObject::Set(descriptor, type, value); + JSRelease(value); + + JSObject::Set(descriptor, DESCRIPTOR_ATTR_GETTER, getter); + JSObject::Set(descriptor, DESCRIPTOR_ATTR_RENDER, render); + + return descriptor; +} + +bool DescriptorUtils::IsDescriptor(const char * const type, JSValue descriptor) +{ + if (JSUndefined::Is(descriptor)) { + return false; + } + + JSValue value = JSObject::Get(descriptor, type); + bool result = JSBoolean::Value(value); + JSRelease(value); + return result; +} +} // namespace ACELite +} // namespace OHOS diff --git a/src/core/directive/descriptor_utils.h b/src/core/directive/descriptor_utils.h new file mode 100755 index 0000000..f979631 --- /dev/null +++ b/src/core/directive/descriptor_utils.h @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2020 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. + */ + +#ifndef OHOS_ACELITE_DESCRIPTOR_UTILS_H +#define OHOS_ACELITE_DESCRIPTOR_UTILS_H + +#include "component.h" +#include "non_copyable.h" +#include "wrapper/js.h" + +namespace OHOS { +namespace ACELite { +class DescriptorUtils final : public MemoryHeap { +public: + ACE_DISALLOW_COPY_AND_MOVE(DescriptorUtils); + ~DescriptorUtils() {} + static JSValue CreateIfDescriptor(JSValue getter, JSValue render); + static JSValue CreateForDescriptor(JSValue getter, JSValue render); + static JSValue CreateDescriptorWatcher(JSValue element, JSValue descriptor); + static bool IsIfDescriptor(JSValue descriptor); + static bool IsForDescriptor(JSValue descriptor); + static bool IsIfDescriptorShown(JSValue descriptor); + static JSValue RenderIfDescriptor(JSValue descriptor); + static JSValue RenderForDescriptor(JSValue descriptor); + static JSValue GetDescriptorRendered(JSValue descriptor); + static void DelIfDescriptorRendered(JSValue descriptor); + static void DelForDescriptorRendered(JSValue descriptor); + static void ReleaseDescriptorOrElements(JSValue descriptorOrElements); + static void ReleaseDescriptorOrElement(JSValue descriptorOrElement); + static void ReleaseForDescriptor(JSValue descriptor); + static void ReleaseIfDescriptor(JSValue descriptor); + static void ReleaseElement(JSValue element); + + static const char * const DESCRIPTOR_ATTR_RENDERED; + static const char * const DESCRIPTOR_ATTR_GETTER; + static const char * const DESCRIPTOR_ATTR_RENDER; + static const char * const WATCHER_OPTION_ELEMENT; + static const char * const WATCHER_OPTION_DESCRIPTOR; + +private: + static JSValue CreateDescriptor(const char * const type, JSValue getter, JSValue render); + static bool IsDescriptor(const char * const type, JSValue descriptor); + static const char * const DESCRIPTOR_ATTR_IF; + static const char * const DESCRIPTOR_ATTR_FOR; +}; +} // namespace ACELite +} // namespace OHOS + +#endif // OHOS_ACELITE_DESCRIPTOR_UTILS_H diff --git a/src/core/directive/directive_watcher_callback.cpp b/src/core/directive/directive_watcher_callback.cpp new file mode 100755 index 0000000..d2525cf --- /dev/null +++ b/src/core/directive/directive_watcher_callback.cpp @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2020 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. + */ + +#include "directive/directive_watcher_callback.h" + +namespace OHOS { +namespace ACELite { +const int DirectiveWatcherCallback::CALLBACK_ARGS_LENGTH = 3; +const int DirectiveWatcherCallback::ARG_IDX_OPTIONS = 2; + +JSValue DirectiveWatcherCallback::Handler(const JSValue func, + const JSValue context, + const JSValue args[], + const JSSize argsSize) +{ + if (argsSize != CALLBACK_ARGS_LENGTH) { + return JSUndefined::Create(); + } + + JSValue options = args[ARG_IDX_OPTIONS]; + + JSValue parentElement = JSObject::Get(options, DescriptorUtils::WATCHER_OPTION_ELEMENT); + JSValue descriptor = JSObject::Get(options, DescriptorUtils::WATCHER_OPTION_DESCRIPTOR); + + Component *component = ComponentUtils::GetComponentFromBindingObject(parentElement); + if (component) { + component->HandleChildrenChange(descriptor); + } + JSRelease(descriptor); + JSRelease(parentElement); + return JSUndefined::Create(); +} +} // namespace ACELite +} // namespace OHOS diff --git a/src/core/directive/directive_watcher_callback.h b/src/core/directive/directive_watcher_callback.h new file mode 100755 index 0000000..aaf2344 --- /dev/null +++ b/src/core/directive/directive_watcher_callback.h @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2020 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. + */ + +#ifndef OHOS_ACELITE_DIRECTIVE_WATCHER_CALLBACK_H +#define OHOS_ACELITE_DIRECTIVE_WATCHER_CALLBACK_H + +#include "directive/descriptor_utils.h" +#include "non_copyable.h" +#include "wrapper/js.h" + +namespace OHOS { +namespace ACELite { +class DirectiveWatcherCallback final : public MemoryHeap { +public: + ACE_DISALLOW_COPY_AND_MOVE(DirectiveWatcherCallback); + ~DirectiveWatcherCallback() {} + static JSValue Handler(const JSValue func, const JSValue context, const JSValue args[], const JSSize argsSize); + +private: + static const int CALLBACK_ARGS_LENGTH; + static const int ARG_IDX_OPTIONS; +}; +} // namespace ACELite +} // namespace OHOS + +#endif // OHOS_ACELITE_DIRECTIVE_WATCHER_CALLBACK_H diff --git a/src/core/jsi/BUILD.gn b/src/core/jsi/BUILD.gn new file mode 100755 index 0000000..b8fa9cd --- /dev/null +++ b/src/core/jsi/BUILD.gn @@ -0,0 +1,24 @@ +#Copyright (c) 2020 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. + +source_set("jsi") { + configs += [ + "//foundation/ace/lite/jsfwk:ace_config", + ] + sources = [ + "jsi.cpp", + ] + include_dirs = [ + "internal", + ] +} diff --git a/src/core/jsi/internal/jsi_internal.h b/src/core/jsi/internal/jsi_internal.h new file mode 100755 index 0000000..2f4f3c1 --- /dev/null +++ b/src/core/jsi/internal/jsi_internal.h @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2020 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. + */ + +#ifndef OHOS_ACELITE_JSI_INTERNAL_H +#define OHOS_ACELITE_JSI_INTERNAL_H + +#include "js_config.h" +#if defined(ENABLE_JERRY) +#include "jerryscript.h" +#endif + +/** + * Macros for conversions between jsi-values and jerry-values. + */ +#if defined (ENABLE_JERRY) +#define AS_JERRY_VALUE(jsiValue) (jerry_value_t)(uintptr_t) jsiValue +#define AS_JLENGTH_VALUE(jsiValue) (jerry_length_t)(uintptr_t) jsiValue +#define AS_JSI_VALUE(jValue) (JSIValue)(uintptr_t) jValue +#endif + +/** + * A convenience macro to create jerry-values. + */ +#if defined (ENABLE_JERRY) +#define JERRY_CREATE(var, create) jerry_value_t var = (create); +#endif + +/** + * Key words for native module callbacks. + */ +constexpr char ON_TERMINATE[] = "onTerminate"; +constexpr char ON_DESTROY_HANDLER[] = "onDestroyHandler"; +constexpr char ON_TERMINATE_HANDLER[] = "onTerminateHandler"; + +#endif // OHOS_ACELITE_JSI_INTERNAL_H diff --git a/src/core/jsi/jsi.cpp b/src/core/jsi/jsi.cpp new file mode 100755 index 0000000..cb00881 --- /dev/null +++ b/src/core/jsi/jsi.cpp @@ -0,0 +1,1061 @@ +/* + * Copyright (c) 2020 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. + */ +#include "jsi.h" + +#include +#include +#include "acelite_config.h" +#ifdef OHOS_ACELITE_PRODUCT_WATCH +#include "securec.h" +#endif // OHOS_ACELITE_PRODUCT_WATCH +#include "ace_log.h" +#include "ace_mem_base.h" +#include "acelite_config.h" +#include "internal/jsi_internal.h" +#include "js_fwk_common.h" + +namespace OHOS { +namespace ACELite { +JSIValue JSI::GetGlobalObject() +{ +#if defined(ENABLE_JERRY) + return AS_JSI_VALUE(jerry_get_global_object()); +#else + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:GetGlobalObject has not been implemented in this js engine!"); + return CreateUndefined(); +#endif +} + +JSIValue JSI::CreateObject() +{ +#if defined(ENABLE_JERRY) + return AS_JSI_VALUE(jerry_create_object()); +#else + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:CreateObject has not been implemented in this js engine!"); + return CreateUndefined(); +#endif +} + +void JSI::SetProperty(JSIValue object, JSIValue key, JSIValue value) +{ + if (!ValueIsObject(object)) { + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:SetProperty failed!"); + return; + } +#if defined(ENABLE_JERRY) + jerry_value_t jObject = AS_JERRY_VALUE(object); + jerry_value_t jKey = AS_JERRY_VALUE(key); + jerry_value_t jVal = AS_JERRY_VALUE(value); + + jerry_release_value(jerry_set_property(jObject, jKey, jVal)); +#else + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:SetProperty has not been implemented in this js engine!"); +#endif +} + +void JSI::SetNamedProperty(JSIValue object, const char * const propName, JSIValue value) +{ + if (!ValueIsObject(object) || (propName == nullptr)) { + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:SetNamedProperty failed!"); + return; + } +#if defined(ENABLE_JERRY) + jerry_value_t jKey = jerry_create_string((const jerry_char_t *)propName); + SetProperty(object, AS_JSI_VALUE(jKey), value); + jerry_release_value(jKey); +#else + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:SetNamedProperty has not been implemented in this js engine!"); +#endif +} + +void JSI::SetNumberProperty(JSIValue object, const char * const propName, double value) +{ + if (!ValueIsObject(object)) { + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:SetNumberProperty failed!"); + return; + } + JSIValue numValue = CreateNumber(value); + SetNamedProperty(object, propName, numValue); + ReleaseValue(numValue); +} + +void JSI::SetBooleanProperty(JSIValue object, const char * const propName, bool value) +{ + if (!ValueIsObject(object)) { + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:SetBooleanProperty failed!"); + return; + } + JSIValue boolValue = CreateBoolean(value); + SetNamedProperty(object, propName, boolValue); + ReleaseValue(boolValue); +} + +void JSI::SetStringProperty(JSIValue object, const char * const propName, const char *value) +{ + if (!ValueIsObject(object)) { + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:SetStringProperty failed!"); + return; + } + JSIValue strValue = CreateString(value); + SetNamedProperty(object, propName, strValue); + ReleaseValue(strValue); +} + +#if defined(ENABLE_JERRY) +/** + * @brief: CreateJerryFuncHelper is used to create jerry function + * along with JSI::CreateFunction, for internal use only. + */ +static jerry_value_t CreateJerryFuncHelper(const jerry_value_t func, + const jerry_value_t thisVal, + const jerry_value_t *args, + const jerry_length_t argsNum) +{ + void *nativePointer = nullptr; + bool exist = jerry_get_object_native_pointer(func, &nativePointer, nullptr); + if (!exist || (nativePointer == nullptr) || (argsNum >= UINT8_MAX)) { + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:CreateJerryFuncHelper get function pointer failed!"); + return jerry_create_undefined(); + } + + JSIFunctionHandler handler = reinterpret_cast(nativePointer); + JSIValue jsiThis = AS_JSI_VALUE(thisVal); + uint8_t jsiArgsNum = (uint8_t)argsNum; + if ((args == nullptr) || (jsiArgsNum == 0)) { + return AS_JERRY_VALUE(handler(jsiThis, nullptr, 0)); + } + JSIValue *jsiArgs = static_cast(ace_malloc(sizeof(JSIValue) * jsiArgsNum)); + if (jsiArgs == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:CreateJerryFuncHelper allocate memory failed!"); + return jerry_create_undefined(); + } + + for (uint8_t index = 0; index < jsiArgsNum; index++) { + jsiArgs[index] = AS_JSI_VALUE(args[index]); + } + JSIValue res = handler(jsiThis, jsiArgs, jsiArgsNum); + ace_free(jsiArgs); + jsiArgs = nullptr; + return AS_JERRY_VALUE(res); +} +#endif + +JSIValue JSI::CreateFunction(JSIFunctionHandler handler) +{ + if (handler == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:CreateFunction failed!"); + return CreateUndefined(); + } +#if defined(ENABLE_JERRY) + jerry_value_t jFunc = jerry_create_external_function(CreateJerryFuncHelper); + void *nativePointer = reinterpret_cast(handler); + jerry_set_object_native_pointer(jFunc, nativePointer, nullptr); + return AS_JSI_VALUE(jFunc); +#else + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:CreateFunction has not been implemented in this js engine!"); + return CreateUndefined(); +#endif +} + +JSIValue JSI::CreateString(const char * const str) +{ + if (str == nullptr) { + return CreateUndefined(); + } +#if defined(ENABLE_JERRY) + return AS_JSI_VALUE(jerry_create_string(reinterpret_cast(str))); +#else + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:CreateString has not been implemented in this js engine!"); + return CreateUndefined(); +#endif +} + +JSIValue JSI::CreateUndefined() +{ +#if defined(ENABLE_JERRY) + return AS_JSI_VALUE(jerry_create_undefined()); +#else + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:CreateUndefined has not been implemented in this js engine!"); + return nullptr; +#endif +} + +bool JSI::ValueIsFunction(JSIValue value) +{ +#if defined(ENABLE_JERRY) + return jerry_value_is_function(AS_JERRY_VALUE(value)); +#else + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:ValueIsFunction has not been implemented in this js engine!"); + return false; +#endif +} + +bool JSI::ValueIsUndefined(JSIValue value) +{ +#if defined(ENABLE_JERRY) + return jerry_value_is_undefined(AS_JERRY_VALUE(value)); +#else + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:ValueIsUndefined has not been implemented in this js engine!"); + return false; +#endif +} + +bool JSI::ValueIsNumber(JSIValue value) +{ +#if defined(ENABLE_JERRY) + return jerry_value_is_number(AS_JERRY_VALUE(value)); +#else + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:ValueIsNumber has not been implemented in this js engine!"); + return false; +#endif +} + +bool JSI::ValueIsString(JSIValue value) +{ +#if defined(ENABLE_JERRY) + return jerry_value_is_string(AS_JERRY_VALUE(value)); +#else + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:ValueIsString has not been implemented in this js engine!"); + return false; +#endif +} + +bool JSI::ValueIsBoolean(JSIValue value) +{ +#if defined(ENABLE_JERRY) + return jerry_value_is_boolean(AS_JERRY_VALUE(value)); +#else + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:ValueIsBoolean has not been implemented in this js engine!"); + return false; +#endif +} + +bool JSI::ValueIsNull(JSIValue value) +{ +#if defined(ENABLE_JERRY) + return jerry_value_is_null(AS_JERRY_VALUE(value)); +#else + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:ValueIsNull has not been implemented in this js engine!"); + return false; +#endif +} + +bool JSI::ValueIsObject(JSIValue value) +{ +#if defined(ENABLE_JERRY) + return jerry_value_is_object(AS_JERRY_VALUE(value)); +#else + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:ValueIsObject has not been implemented in this js engine!"); + return false; +#endif +} + +bool JSI::ValueIsError(JSIValue value) +{ +#if defined(ENABLE_JERRY) + return jerry_value_is_error(AS_JERRY_VALUE(value)); +#else + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:ValueIsError has not been implemented in this js engine!"); + return false; +#endif +} + +char *JSI::JsonStringify(JSIValue value) +{ + if (!ValueIsObject(value)) { + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:JsonStringify failed!"); + return nullptr; + } +#if defined(ENABLE_JERRY) + jerry_value_t stringified = jerry_json_stringify(AS_JERRY_VALUE(value)); + char *res = ValueToString(AS_JSI_VALUE(stringified)); + jerry_release_value(stringified); + return res; +#else + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:JsonStringify has not been implemented in this js engine!"); + return nullptr; +#endif +} + +JSIValue JSI::JsonParse(const char * const str) +{ + if (str == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:JsonParse failed!"); + return CreateUndefined(); + } +#if defined(ENABLE_JERRY) + jerry_value_t jVal = jerry_json_parse(reinterpret_cast(str), strlen(str)); + return AS_JSI_VALUE(jVal); +#else + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:JsonParse has not been implemented in this js engine!"); + return CreateUndefined(); +#endif +} + +JSIValue JSI::GetProperty(JSIValue object, JSIValue key) +{ + if (!ValueIsObject(object)) { + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:GetProperty failed!"); + return CreateUndefined(); + } +#if defined(ENABLE_JERRY) + jerry_value_t jObject = AS_JERRY_VALUE(object); + jerry_value_t jKey = AS_JERRY_VALUE(key); + return AS_JSI_VALUE(jerry_get_property(jObject, jKey)); +#else + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:GetProperty has not been implemented in this js engine!"); + return CreateUndefined(); +#endif +} + +JSIValue JSI::GetNamedProperty(JSIValue object, const char * const propName) +{ + if (!ValueIsObject(object) || (propName == nullptr)) { + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:GetNamedProperty failed!"); + return CreateUndefined(); + } +#if defined(ENABLE_JERRY) + jerry_value_t jKey = jerry_create_string(reinterpret_cast(propName)); + JSIValue result = GetProperty(object, AS_JSI_VALUE(jKey)); + jerry_release_value(jKey); + return result; +#else + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:GetNamedProperty has not been implemented in this js engine!"); + return CreateUndefined(); +#endif +} + +double JSI::GetNumberProperty(JSIValue object, const char * const propName) +{ + if (!ValueIsObject(object)) { + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:GetNumberProperty failed!"); + return 0.0; + } + JSIValue propValue = GetNamedProperty(object, propName); + double res = ValueToNumber(propValue); + ReleaseValue(propValue); + return res; +} + +bool JSI::GetBooleanProperty(JSIValue object, const char * const propName) +{ + if (!ValueIsObject(object)) { + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:GetBooleanProperty failed!"); + return false; + } + JSIValue propValue = GetNamedProperty(object, propName); + bool res = ValueToBoolean(propValue); + ReleaseValue(propValue); + return res; +} + +char *JSI::GetStringProperty(JSIValue object, const char * const propName) +{ + if (!ValueIsObject(object)) { + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:GetStringProperty failed!"); + return nullptr; + } + JSIValue propValue = GetNamedProperty(object, propName); + char *res = ValueToString(propValue); + ReleaseValue(propValue); + return res; +} + +void JSI::ReleaseValue(JSIValue value) +{ +#if defined(ENABLE_JERRY) + if (value != ARGS_END) { + jerry_release_value(AS_JERRY_VALUE(value)); + } +#else + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:ReleaseValue has not been implemented in this js engine!"); +#endif +} + +void JSI::ReleaseString(char *&str) +{ + if (str != nullptr) { + ace_free(str); + str = nullptr; + } +} + +void JSI::CallFunction(JSIValue funcObj, JSIValue thisVal, const JSIValue *argv, uint8_t argc) +{ + if (!ValueIsFunction(funcObj)) { + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:CallFunction failed!"); + return; + } +#if defined(ENABLE_JERRY) + jerry_value_t jFunc = AS_JERRY_VALUE(funcObj); + jerry_value_t jThis = AS_JERRY_VALUE(thisVal); + if ((argv == nullptr) || argc == 0) { + CallJSFunctionAutoRelease(jFunc, jThis, nullptr, 0); + return; + } + jerry_value_t *jArgv = new jerry_value_t[argc]; + if (jArgv == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:CallFunction allocate memory failed!"); + return; + } + + for (uint8_t index = 0; index < argc; index++) { + jArgv[index] = AS_JERRY_VALUE(argv[index]); + } + CallJSFunctionAutoRelease(jFunc, jThis, jArgv, argc); + delete[] jArgv; + jArgv = nullptr; +#else + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:CallFunction has not been implemented in this js engine!"); +#endif +} + +JSIValue JSI::CreateNumber(double value) +{ +#if defined(ENABLE_JERRY) + return AS_JSI_VALUE(jerry_create_number(value)); +#else + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:CreateNumber has not been implemented in this js engine!"); + return CreateUndefined(); +#endif +} + +JSIValue JSI::CreateNumberNaN() +{ +#if defined(ENABLE_JERRY) + return AS_JSI_VALUE(jerry_create_number_nan()); +#else + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:CreateNumberNan has not been implemented in this js engine!"); + return CreateUndefined(); +#endif +} + +#if defined(ENABLE_JERRY) +static jerry_error_t GetJerryErrorType(JsiErrorType jsiType) +{ + jerry_error_t jerryType; + switch (jsiType) { + case JsiErrorType::JSI_ERROR_COMMON: + jerryType = JERRY_ERROR_COMMON; + break; + case JsiErrorType::JSI_ERROR_EVAL: + jerryType = JERRY_ERROR_EVAL; + break; + case JsiErrorType::JSI_ERROR_RANGE: + jerryType = JERRY_ERROR_RANGE; + break; + case JsiErrorType::JSI_ERROR_REFERENCE: + jerryType = JERRY_ERROR_REFERENCE; + break; + case JsiErrorType::JSI_ERROR_SYNTAX: + jerryType = JERRY_ERROR_SYNTAX; + break; + case JsiErrorType::JSI_ERROR_TYPE: + jerryType = JERRY_ERROR_TYPE; + break; + case JsiErrorType::JSI_ERROR_URI: + jerryType = JERRY_ERROR_URI; + break; + default: + jerryType = JERRY_ERROR_COMMON; + break; + } + return jerryType; +} + +static JsiErrorType GetJsiErrorType(jerry_error_t jerryType) +{ + JsiErrorType jsiType; + switch (jerryType) { + case JERRY_ERROR_COMMON: + jsiType = JsiErrorType::JSI_ERROR_COMMON; + break; + case JERRY_ERROR_EVAL: + jsiType = JsiErrorType::JSI_ERROR_EVAL; + break; + case JERRY_ERROR_RANGE: + jsiType = JsiErrorType::JSI_ERROR_RANGE; + break; + case JERRY_ERROR_REFERENCE: + jsiType = JsiErrorType::JSI_ERROR_REFERENCE; + break; + case JERRY_ERROR_SYNTAX: + jsiType = JsiErrorType::JSI_ERROR_SYNTAX; + break; + case JERRY_ERROR_TYPE: + jsiType = JsiErrorType::JSI_ERROR_TYPE; + break; + case JERRY_ERROR_URI: + jsiType = JsiErrorType::JSI_ERROR_URI; + break; + default: + jsiType = JsiErrorType::JSI_ERROR_INVALID; + break; + } + return jsiType; +} +#endif + +JSIValue JSI::CreateError(JsiErrorType type, const char * const errorMsg) +{ + if ((type <= JsiErrorType::JSI_ERROR_INVALID) || + (type >= JsiErrorType::JSI_ERROR_MAX) || (errorMsg == nullptr)) { + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:CreateError parameters invalid!"); + return CreateUndefined(); + } +#if defined(ENABLE_JERRY) + jerry_error_t jerryType = GetJerryErrorType(type); + jerry_value_t jError = jerry_create_error(jerryType, reinterpret_cast(errorMsg)); + return AS_JSI_VALUE(jError); +#else + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:CreateError has not been implemented in this js engine!"); + return CreateUndefined(); +#endif +} + +JsiErrorType JSI::GetErrorType(JSIValue errorValue) +{ + if (!ValueIsError(errorValue)) { + return JsiErrorType::JSI_ERROR_INVALID; + } +#if defined(ENABLE_JERRY) + jerry_value_t jError = AS_JERRY_VALUE(errorValue); + jerry_error_t jerryType = jerry_get_error_type(jError); + return GetJsiErrorType(jerryType); +#else + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:GetErrorType has not been implemented in this js engine!"); + return JsiErrorType::JSI_ERROR_INVALID; +#endif +} + +JSIValue JSI::CreateBoolean(bool value) +{ +#if defined(ENABLE_JERRY) + return AS_JSI_VALUE(jerry_create_boolean(value)); +#else + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:CreateBoolean has not been implemented in this js engine!"); + return CreateUndefined(); +#endif +} + +JSIValue JSI::CreateNull() +{ +#if defined(ENABLE_JERRY) + return AS_JSI_VALUE(jerry_create_null()); +#else + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:CreateNull has not been implemented in this js engine!"); + return CreateUndefined(); +#endif +} + +#if defined(JS_FWK_SYMBOL) +JSIValue JSI::CreateSymbol(JSIValue description) +{ +#if defined(ENABLE_JERRY) + jerry_value_t jDsc = AS_JERRY_VALUE(description); + return AS_JSI_VALUE(jerry_create_symbol(jDsc)); +#else + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:CreateSymbol has not been implemented in this js engine!"); + return CreateUndefined(); +#endif +} + +bool JSI::ValueIsSymbol(JSIValue value) +{ +#if defined(ENABLE_JERRY) + return jerry_value_is_symbol(AS_JERRY_VALUE(value)); +#else + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:ValueIsSymbol has not been implemented in this js engine!"); + return false; +#endif +} +#endif // JS_FWK_SYMBOL + +JSIValue JSI::CreateArray(uint32_t length) +{ +#if defined(ENABLE_JERRY) + return AS_JSI_VALUE(jerry_create_array(length)); +#else + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:CreateArray has not been implemented in this js engine!"); + return CreateUndefined(); +#endif +} + +bool JSI::SetPropertyByIndex(JSIValue object, uint32_t index, JSIValue value) +{ +#if defined(ENABLE_JERRY) + jerry_value_t jObject = AS_JERRY_VALUE(object); + jerry_value_t jVal = AS_JERRY_VALUE(value); + + jerry_value_t res = jerry_set_property_by_index(jObject, index, jVal); + if (jerry_value_is_error(res)) { + jerry_release_value(res); + return false; + } + jerry_release_value(res); + return true; +#else + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:SetPropertyByIndex has not been implemented in this js engine!"); + return false; +#endif +} + +char *JSI::ValueToString(JSIValue value) +{ +#if defined(ENABLE_JERRY) + char *result = nullptr; + jerry_value_t jVal = AS_JERRY_VALUE(value); + if (!jerry_value_is_string(jVal)) { + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:ValueToString params invalid!"); + return nullptr; + } + + jerry_size_t size = jerry_get_string_size(jVal); + if ((size == 0) || (size == UINT32_MAX)) { + // Output empty char instead of nullptr, thus caller can free safely + result = static_cast(ace_malloc(sizeof(char))); + if (result == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:ValueToString malloc memory for empty char failed!"); + return nullptr; + } + result[0] = '\0'; + return result; + } else { + jerry_char_t *buffer = static_cast(ace_malloc(sizeof(jerry_char_t) * (size + 1))); + if (buffer == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:ValueToString malloc memory failed!"); + return nullptr; + } + jerry_size_t length = jerry_string_to_char_buffer(jVal, buffer, size); + if ((length == 0) || (length > size)) { + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:ValueToString jerry string to char buffer failed"); + ace_free(buffer); + buffer = nullptr; + return nullptr; + } + buffer[length] = '\0'; + result = reinterpret_cast(buffer); + return result; + } +#else + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:ValueToString has not been implemented in this js engine!"); + return nullptr; +#endif +} + +double JSI::ValueToNumber(JSIValue value) +{ +#if defined(ENABLE_JERRY) + jerry_value_t jVal = AS_JERRY_VALUE(value); + if (!jerry_value_is_number(jVal)) { + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:ValueToNumber params invalid!"); + return 0.0; + } + return jerry_get_number_value(jVal); +#else + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:ValueToNumber has not been implemented in this js engine!"); + return 0.0; +#endif +} + +bool JSI::ValueToBoolean(JSIValue value) +{ +#if defined(ENABLE_JERRY) + jerry_value_t jVal = AS_JERRY_VALUE(value); + if (!jerry_value_is_boolean(jVal)) { + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:ValueToBoolean params invalid!"); + return false; + } + return jerry_value_to_boolean(jVal); +#else + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:ValueToBoolean has not been implemented in this js engine!"); + return false; +#endif +} + +uint32_t JSI::GetArrayLength(JSIValue value) +{ +#if defined(ENABLE_JERRY) + jerry_value_t jVal = AS_JERRY_VALUE(value); + if (!jerry_value_is_array(jVal)) { + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:GetArrayLength params invalid!"); + return 0; + } + return jerry_get_array_length(jVal); +#else + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:GetArrayLength has not been implemented in this js engine!"); + return 0; +#endif +} + +JSIValue JSI::GetPropertyByIndex(JSIValue object, uint32_t index) +{ +#if defined(ENABLE_JERRY) + jerry_value_t jVal = AS_JERRY_VALUE(object); + return AS_JSI_VALUE(jerry_get_property_by_index(jVal, index)); +#else + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:GetPropertyByIndex has not been implemented in this js engine!"); + return CreateUndefined(); +#endif +} + +JSIValue JSI::GetObjectKeys(JSIValue object) +{ + if (!ValueIsObject(object)) { + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:GetObjectKeys failed!"); + return CreateUndefined(); + } +#if defined(ENABLE_JERRY) + jerry_value_t jVal = AS_JERRY_VALUE(object); + return AS_JSI_VALUE(jerry_get_object_keys(jVal)); +#else + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:GetObjectKeys has not been implemented in this js engine!"); + return CreateUndefined(); +#endif +} + +bool JSI::GetJSHeapStatus(JSHeapStatus &heapStatus) +{ +#if defined(ENABLE_JERRY) + jerry_heap_stats_t stats = {0}; + if (!jerry_get_memory_stats(&stats)) { + return false; + } + heapStatus.totalBytes = stats.size; + heapStatus.allocBytes = stats.allocated_bytes; + heapStatus.peakAllocBytes = stats.peak_allocated_bytes; + return true; +#else + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:GetJSHeapStatus has not been implemented in this js engine!"); + return false; +#endif +} + +bool JSI::ValueIsArray(JSIValue value) +{ +#if defined(ENABLE_JERRY) + return jerry_value_is_array(AS_JERRY_VALUE(value)); +#else + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:ValueIsArray has not been implemented in this js engine!"); + return false; +#endif +} + +JSIValue JSI::AcquireValue(JSIValue value) +{ +#if defined(ENABLE_JERRY) + jerry_value_t jVal = AS_JERRY_VALUE(value); + return AS_JSI_VALUE(jerry_acquire_value(jVal)); +#else + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:AcquireValue has not been implemented in this js engine!"); + return CreateUndefined(); +#endif +} + +void JSI::SetModuleAPI(JSIValue exports, const char * const name, JSIFunctionHandler handler) +{ + if (!ValueIsObject(exports) || (handler == nullptr)) { + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:SetModuleAPI failed!"); + return; + } + JSIValue jsFunc = CreateFunction(handler); + SetNamedProperty(exports, name, jsFunc); + ReleaseValue(jsFunc); +} + +void JSI::SetOnDestroy(JSIValue object, NativeCallback callback) +{ + if (!ValueIsObject(object) || (callback == nullptr)) { + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:SetOnDestroy failed!"); + return; + } +#if defined(ENABLE_JERRY) + void *nativePtr = reinterpret_cast(callback); + jerry_set_object_native_pointer(AS_JERRY_VALUE(object), nativePtr, nullptr); +#else + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:SetOnDestroy has not been implemented in this js engine!"); +#endif +} + +void JSI::SetOnDestroy(JSIValue object, JsiCallback callback) +{ + SetNamedPointer(object, ON_DESTROY_HANDLER, callback); +} + +void JSI::SetOnTerminate(JSIValue object, NativeCallback callback) +{ + if (!ValueIsObject(object) || (callback == nullptr)) { + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:SetOnTerminate failed!"); + return; + } + JSIValue funObj = JSI::CreateObject(); + JSI::SetOnDestroy(funObj, callback); + JSI::SetNamedProperty(object, ON_TERMINATE, funObj); + JSI::ReleaseValue(funObj); +} + +void JSI::SetOnTerminate(JSIValue object, JsiCallback callback) +{ + SetNamedPointer(object, ON_TERMINATE_HANDLER, callback); +} + +void JSI::SetNamedPointer(JSIValue object, const char * const name, JsiCallback callback) +{ + if (!ValueIsObject(object) || (callback == nullptr)) { + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:SetNamedPointer failed!"); + return; + } +#if defined(ENABLE_JERRY) + JSIValue funObj = JSI::CreateObject(); + void *nativePtr = reinterpret_cast(callback); + jerry_set_object_native_pointer(AS_JERRY_VALUE(funObj), nativePtr, nullptr); + SetNamedProperty(object, name, funObj); + ReleaseValue(funObj); +#else + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:SetNamedPointer has not been implemented in this js engine!"); +#endif +} + +#if defined(JS_FWK_TYPEDARRAY) +#if defined(ENABLE_JERRY) +// Helper function for JSI TypedArray type convert +TypedArrayType GetJsiArrayType(jerry_typedarray_type_t jerryType) +{ + TypedArrayType jsiType; + switch (jerryType) { + case JERRY_TYPEDARRAY_INT8: + jsiType = TypedArrayType::JSI_INT8_ARRAY; + break; + case JERRY_TYPEDARRAY_UINT8: + jsiType = TypedArrayType::JSI_UINT8_ARRAY; + break; + case JERRY_TYPEDARRAY_UINT8CLAMPED: + jsiType = TypedArrayType::JSI_UINT8CLAMPED_ARRAY; + break; + case JERRY_TYPEDARRAY_INT16: + jsiType = TypedArrayType::JSI_INT16_ARRAY; + break; + case JERRY_TYPEDARRAY_UINT16: + jsiType = TypedArrayType::JSI_UINT16_ARRAY; + break; + case JERRY_TYPEDARRAY_INT32: + jsiType = TypedArrayType::JSI_INT32_ARRAY; + break; + case JERRY_TYPEDARRAY_UINT32: + jsiType = TypedArrayType::JSI_UINT32_ARRAY; + break; + case JERRY_TYPEDARRAY_FLOAT32: + jsiType = TypedArrayType::JSI_FLOAT32_ARRAY; + break; + case JERRY_TYPEDARRAY_FLOAT64: + jsiType = TypedArrayType::JSI_FLOAT64_ARRAY; + break; + default: + jsiType = TypedArrayType::JSI_INVALID_ARRAY; + break; + } + return jsiType; +} +#endif + +uint8_t *JSI::GetTypedArrayInfo(JSIValue typedArray, + TypedArrayType &type, + size_t &length, + JSIValue &arrayBuffer, + size_t &byteOffset) +{ + if (!ValueIsTypedArray(typedArray)) { + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:GetTypedArrayInfo failed!"); + return nullptr; + } +#if defined(ENABLE_JERRY) + jerry_value_t jVal = AS_JERRY_VALUE(typedArray); + jerry_typedarray_type_t jType = jerry_get_typedarray_type(jVal); + type = GetJsiArrayType(jType); + + jerry_length_t jLength = jerry_get_typedarray_length(jVal); + jerry_length_t jByteOffset; + jerry_length_t jByteLength; + jerry_value_t jArrayBuffer = jerry_get_typedarray_buffer(jVal, &jByteOffset, &jByteLength); + + length = (size_t)jLength; + arrayBuffer = AS_JSI_VALUE(jArrayBuffer); + byteOffset = (size_t)jByteOffset; + return jerry_get_arraybuffer_pointer(jArrayBuffer); +#else + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:GetTypedArrayInfo has not been implemented in this js engine!"); + return nullptr; +#endif +} + +#if defined(ENABLE_JERRY) +// Helper function for jerry TypedArray type convert +jerry_typedarray_type_t GetJerryArrayType(TypedArrayType jsiType) +{ + jerry_typedarray_type_t jerryType; + switch (jsiType) { + case TypedArrayType::JSI_INT8_ARRAY: + jerryType = JERRY_TYPEDARRAY_INT8; + break; + case TypedArrayType::JSI_UINT8_ARRAY: + jerryType = JERRY_TYPEDARRAY_UINT8; + break; + case TypedArrayType::JSI_UINT8CLAMPED_ARRAY: + jerryType = JERRY_TYPEDARRAY_UINT8CLAMPED; + break; + case TypedArrayType::JSI_INT16_ARRAY: + jerryType = JERRY_TYPEDARRAY_INT16; + break; + case TypedArrayType::JSI_UINT16_ARRAY: + jerryType = JERRY_TYPEDARRAY_UINT16; + break; + case TypedArrayType::JSI_INT32_ARRAY: + jerryType = JERRY_TYPEDARRAY_INT32; + break; + case TypedArrayType::JSI_UINT32_ARRAY: + jerryType = JERRY_TYPEDARRAY_UINT32; + break; + case TypedArrayType::JSI_FLOAT32_ARRAY: + jerryType = JERRY_TYPEDARRAY_FLOAT32; + break; + case TypedArrayType::JSI_FLOAT64_ARRAY: + jerryType = JERRY_TYPEDARRAY_FLOAT64; + break; + default: + jerryType = JERRY_TYPEDARRAY_INVALID; + break; + } + return jerryType; +} +#endif + +JSIValue JSI::CreateTypedArray(TypedArrayType type, size_t length, JSIValue arrayBuffer, size_t byteOffset) +{ +#if defined(ENABLE_JERRY) + jerry_typedarray_type_t jType = GetJerryArrayType(type); + jerry_value_t jArrayBuffer = AS_JERRY_VALUE(arrayBuffer); + jerry_value_t jVal = jerry_create_typedarray_for_arraybuffer_sz(jType, jArrayBuffer, (jerry_length_t)byteOffset, + (jerry_length_t)length); + return AS_JSI_VALUE(jVal); +#else + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:CreateTypedArray has not been implemented in this js engine!"); + return CreateUndefined(); +#endif +} + +uint8_t *JSI::GetArrayBufferInfo(JSIValue arrayBuffer, size_t &byteLength) +{ + if (!ValueIsArrayBuffer(arrayBuffer)) { + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:GetArrayBufferInfo failed!"); + return nullptr; + } +#if defined(ENABLE_JERRY) + jerry_value_t jVal = AS_JERRY_VALUE(arrayBuffer); + jerry_length_t len = jerry_get_arraybuffer_byte_length(jVal); + + byteLength = (size_t)len; + return jerry_get_arraybuffer_pointer(jVal); +#else + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:GetArrayBufferInfo has not been implemented in this js engine!"); + return nullptr; +#endif +} + +JSIValue JSI::CreateArrayBuffer(size_t byteLength, uint8_t *&buffPtr) +{ + if (byteLength == 0) { + return CreateUndefined(); + } +#if defined(ENABLE_JERRY) + jerry_value_t jVal = jerry_create_arraybuffer((jerry_length_t)byteLength); + buffPtr = jerry_get_arraybuffer_pointer(jVal); + return AS_JSI_VALUE(jVal); +#else + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:CreateArrayBuffer has not been implemented in this js engine!"); + return CreateUndefined(); +#endif +} + +bool JSI::ValueIsArrayBuffer(JSIValue value) +{ +#if defined(ENABLE_JERRY) + return jerry_value_is_arraybuffer(AS_JERRY_VALUE(value)); +#else + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:ValueIsArrayBuffer has not been implemented in this js engine!"); + return false; +#endif +} + +bool JSI::ValueIsTypedArray(JSIValue value) +{ +#if defined(ENABLE_JERRY) + return jerry_value_is_typedarray(AS_JERRY_VALUE(value)); +#else + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:ValueIsTypedArray has not been implemented in this js engine!"); + return false; +#endif +} +#endif // JS_FWK_TYPEDARRAY + +bool JSI::DefineProperty(JSIValue object, JSIValue propName, JSPropertyDescriptor descriptor) +{ + if (!ValueIsObject(object)) { + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:DefineProperty failed!"); + return false; + } +#if defined(ENABLE_JERRY) + jerry_property_descriptor_t jerryDesc; + jerry_init_property_descriptor_fields(&jerryDesc); + + jerryDesc.is_set_defined = true; + jerryDesc.setter = + (descriptor.setter == nullptr) ? jerry_create_undefined() : AS_JERRY_VALUE(CreateFunction(descriptor.setter)); + jerryDesc.is_get_defined = true; + jerryDesc.getter = + (descriptor.getter == nullptr) ? jerry_create_undefined() : AS_JERRY_VALUE(CreateFunction(descriptor.getter)); + + jerry_value_t retValue = jerry_define_own_property(AS_JERRY_VALUE(object), AS_JERRY_VALUE(propName), &jerryDesc); + jerry_free_property_descriptor_fields(&jerryDesc); + + bool res = true; + if (jerry_value_is_error(retValue)) { + res = false; + } + jerry_release_value(retValue); + return res; +#else + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:DefineProperty has not been implemented in this js engine!"); + return false; +#endif +} + +bool JSI::DefineNamedProperty(JSIValue object, const char * const propNameStr, JSPropertyDescriptor descriptor) +{ + if (!ValueIsObject(object) || (propNameStr == nullptr)) { + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:DefineNamedProperty failed!"); + return false; + } +#if defined(ENABLE_JERRY) + jerry_value_t propName = jerry_create_string(reinterpret_cast(propNameStr)); + bool res = DefineProperty(object, AS_JSI_VALUE(propName), descriptor); + jerry_release_value(propName); + return res; +#else + HILOG_ERROR(HILOG_MODULE_ACE, "JSI:DefineNamedProperty has not been implemented in this js engine!"); + return false; +#endif +} +} // namespace ACELite +} // namespace OHOS diff --git a/src/core/modules/BUILD.gn b/src/core/modules/BUILD.gn new file mode 100755 index 0000000..bfb7aa6 --- /dev/null +++ b/src/core/modules/BUILD.gn @@ -0,0 +1,43 @@ +#Copyright (c) 2020 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. + +source_set("modules") { + configs += [ + "//foundation/ace/lite/jsfwk:ace_config", + ] + sources = [ + "module_manager.cpp", + "presets/console_log_impl.cpp", + "presets/console_module.cpp", + "presets/feature_ability_module.cpp", + "presets/preset_module.cpp", + "presets/profiler_module.cpp", + "presets/render_module.cpp", + "presets/require_module.cpp", + #"presets/jstest_module.cpp", + "presets/timer_module.cpp", + "app_module.cpp", + #"sample_module.cpp", + "router_module.cpp", + "presets/localization_module.cpp", + "presets/cjson_parser.cpp", + ] + include_dirs = [ + "presets", + "maplejs", + "//test/lite/testservice/include", + "//vendor/huawei/watchgt/devkit/hal/include", + "//foundation/distributedschedule/interfaces/innerkits/samgr_lite/communication/mpc/transport", + "//foundation/distributedschedule/interfaces/innerkits/samgr_lite/communication/mpc", + ] +} diff --git a/src/core/modules/app_module.cpp b/src/core/modules/app_module.cpp new file mode 100755 index 0000000..72df18a --- /dev/null +++ b/src/core/modules/app_module.cpp @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2020 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. + */ + +#include "app_module.h" +#include "ace_log.h" +#include "js_app_context.h" + +namespace OHOS { +namespace ACELite { +const char * const AppModule::FILE_MANIFEST = "manifest.json"; +const char * const AppModule::KEY_APP_NAME = "appName"; +const char * const AppModule::KEY_VERSION_NAME = "versionName"; +const char * const AppModule::KEY_VERSION_CODE = "versionCode"; + +JSIValue AppModule::GetInfo(const JSIValue thisVal, const JSIValue *args, uint8_t argsNum) +{ + JSIValue result = JSI::CreateUndefined(); + + cJSON *manifest = ReadManifest(); + if (manifest == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "Fail to get the content of manifest."); + return result; + } + + cJSON *appName = cJSON_GetObjectItem(manifest, KEY_APP_NAME); + cJSON *versionName = cJSON_GetObjectItem(manifest, KEY_VERSION_NAME); + cJSON *versionCode = cJSON_GetObjectItem(manifest, KEY_VERSION_CODE); + + result = JSI::CreateObject(); + if (appName != nullptr) { + JSI::SetStringProperty(result, KEY_APP_NAME, appName->valuestring); + } + if (versionName != nullptr) { + JSI::SetStringProperty(result, KEY_VERSION_NAME, versionName->valuestring); + } + if (versionCode != nullptr) { + JSI::SetNumberProperty(result, KEY_VERSION_CODE, versionCode->valuedouble); + } + cJSON_Delete(manifest); + manifest = nullptr; + return result; +} + +cJSON *AppModule::ReadManifest() +{ + char *appPath = const_cast(JsAppContext::GetInstance()->GetCurrentAbilityPath()); + if ((appPath == nullptr) || !strlen(appPath)) { + HILOG_ERROR(HILOG_MODULE_ACE, "Fail to get app information because the app path is null or empty."); + return nullptr; + } + + char *manifestPath = RelocateJSSourceFilePath(appPath, FILE_MANIFEST); + if (manifestPath == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "Fail to get app information because the manifest.json path is null."); + return nullptr; + } + if (!strlen(manifestPath)) { + HILOG_ERROR(HILOG_MODULE_ACE, "Fail to get app information because the manifest.json path is empty."); + ace_free(manifestPath); + manifestPath = nullptr; + return nullptr; + } + + uint32_t fileSize = 0; + char *manifestContent = ReadFile(manifestPath, &fileSize, false); + + ace_free(manifestPath); + manifestPath = nullptr; + + if (manifestContent == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "Fail to get app information because the manifest.json context is null."); + return nullptr; + } + if (fileSize == 0) { + HILOG_ERROR(HILOG_MODULE_ACE, "Fail to get app information because the manifest.json context is empty."); + ace_free(manifestContent); + manifestContent = nullptr; + return nullptr; + } + + cJSON *manifest = cJSON_Parse(manifestContent); + + ace_free(manifestContent); + manifestContent = nullptr; + + return manifest; +} + +JSIValue AppModule::Terminate(const JSIValue thisVal, const JSIValue *args, uint8_t argsNum) +{ + UNUSED(thisVal); + UNUSED(args); + UNUSED(argsNum); + JsAppContext::GetInstance()->TerminateAbility(); + return JSI::CreateUndefined(); +} +} // namespace ACELite +} // namespace OHOS diff --git a/src/core/modules/app_module.h b/src/core/modules/app_module.h new file mode 100755 index 0000000..7c06cf9 --- /dev/null +++ b/src/core/modules/app_module.h @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2020 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. + */ + +#ifndef OHOS_ACELITE_APP_MODULE_H +#define OHOS_ACELITE_APP_MODULE_H + +#include +#include "jsi.h" +#include "non_copyable.h" + +namespace OHOS { +namespace ACELite { +class AppModule final : public MemoryHeap { +public: + ACE_DISALLOW_COPY_AND_MOVE(AppModule); + AppModule() = default; + ~AppModule() = default; + static JSIValue GetInfo(const JSIValue thisVal, const JSIValue* args, uint8_t argsNum); + static JSIValue Terminate(const JSIValue thisVal, const JSIValue* args, uint8_t argsNum); + +private: + static const char * const FILE_MANIFEST; + static const char * const KEY_APP_NAME; + static const char * const KEY_VERSION_NAME; + static const char * const KEY_VERSION_CODE; + + static cJSON* ReadManifest(); +}; +void InitAppModule(JSIValue exports) +{ + JSI::SetModuleAPI(exports, "getInfo", AppModule::GetInfo); + JSI::SetModuleAPI(exports, "terminate", AppModule::Terminate); +} +} // namespace ACELite +} // namespace OHOS +#endif // OHOS_ACELITE_APP_MODULE_H diff --git a/src/core/modules/dfx_module.cpp b/src/core/modules/dfx_module.cpp new file mode 100755 index 0000000..6d2e29f --- /dev/null +++ b/src/core/modules/dfx_module.cpp @@ -0,0 +1,226 @@ +/* + * Copyright (c) 2020 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. + */ + +#include "dfx_module.h" +#include "ace_log.h" +#include "ui_dump_dom_tree.h" +#ifdef FEATURE_ACELITE_MC_DFX_MODULE +#include "ui_snapshot.h" +#elif defined(FEATURE_ACELITE_LITE_DFX_MODULE) +#include "ability_env.h" +#include "ace_mem_base.h" +#include "js_fwk_common.h" +#include "ui_screenshot.h" +#endif + +namespace OHOS { +namespace ACELite { +const char * const DfxModule::DOM_TREE_PATH = "dump_dom_tree.json"; + +const char * const DfxModule::SCREEN_SNAP_PATH = "screensnap.bin"; + +bool DfxModule::PreCheck(uint8_t argsNum) +{ + if (argsNum > 1) { + HILOG_ERROR(HILOG_MODULE_ACE, "Dfx Module args num(%d) is invalid, at most one parameter", argsNum); + return false; + } + return true; +} + +char *DfxModule::GetDomViewId(const JSIValue *args) +{ + if (args == nullptr) { + return nullptr; + } + return JSI::ValueToString(args[0]); +} + +bool DfxModule::IsEventInjectorRegistered(EventDataType type) +{ + if ((EventInjector::GetInstance() == nullptr) || (!EventInjector::GetInstance()->IsEventInjectorRegistered(type) && + !EventInjector::GetInstance()->RegisterEventInjector(type))) { + HILOG_ERROR(HILOG_MODULE_ACE, "register event error"); + return false; + } + return true; +} + +#ifdef FEATURE_ACELITE_DFX_MODULE +JSIValue DfxModule::Screenshot(const JSIValue thisVal, const JSIValue *args, uint8_t argsNum) +{ +#ifdef FEATURE_ACELITE_MC_DFX_MODULE + JSIValue retVal = JSI::CreateBoolean(true); + if (!UISnapShot::ScreenshotToFile()) { + HILOG_ERROR(HILOG_MODULE_ACE, "screenshot failed"); + JSI::ReleaseValue(retVal); + retVal = JSI::CreateBoolean(false); + } + return retVal; +#elif defined(FEATURE_ACELITE_LITE_DFX_MODULE) + JSIValue retVal = JSI::CreateBoolean(true); + const char * const dataPath = GetDataPath(); + char *path = RelocateResourceFilePath(dataPath, SCREEN_SNAP_PATH); + // uikit will deal with if path is null + if ((UIScreenshot::GetInstance() == nullptr) || (!UIScreenshot::GetInstance()->ScreenshotToFile(path))) { + HILOG_ERROR(HILOG_MODULE_ACE, "screenshot failed"); + JSI::ReleaseValue(retVal); + retVal = JSI::CreateBoolean(false); + } + if (path != nullptr) { + ace_free(path); + } + return retVal; +#endif +} +#endif + +JSIValue DfxModule::DumpDomTree(const JSIValue thisVal, const JSIValue *args, uint8_t argsNum) +{ + JSIValue retVal = JSI::CreateBoolean(false); + if (!PreCheck(argsNum)) { + return retVal; + } + + char *viewId = GetDomViewId(args); +#ifdef FEATURE_ACELITE_LITE_DFX_MODULE + const char * const dataPath = GetDataPath(); + char *path = RelocateResourceFilePath(dataPath, DOM_TREE_PATH); + // uikit will deal with if path and viewid is null + if ((UIDumpDomTree::GetInstance() != nullptr) && (UIDumpDomTree::GetInstance()->DumpDomTree(viewId, path))) { +#else + if ((UIDumpDomTree::GetInstance() != nullptr) && (UIDumpDomTree::GetInstance()->DumpDomTree(viewId))) { +#endif + JSI::ReleaseValue(retVal); + retVal = JSI::CreateBoolean(true); + } + +#ifdef FEATURE_ACELITE_LITE_DFX_MODULE + if (path != nullptr) { + ace_free(path); + } +#endif + JSI::ReleaseString(viewId); + return retVal; +} + +JSIValue DfxModule::DumpDomNode(const JSIValue thisVal, const JSIValue *args, uint8_t argsNum) +{ + if (!PreCheck(argsNum) || (UIDumpDomTree::GetInstance() == nullptr)) { + return JSI::CreateUndefined(); + } + + char *viewId = GetDomViewId(args); + char *msg = UIDumpDomTree::GetInstance()->DumpDomNode(viewId); + if (msg == nullptr) { + JSI::ReleaseString(viewId); + return JSI::CreateUndefined(); + } + JSIValue retVal = JSI::CreateString(msg); + free(msg); // use heap memory, use free() instead of ace_free() + JSI::ReleaseString(viewId); + return retVal; +} + +JSIValue DfxModule::InjectPointEvent(const JSIValue *args, EventDataType type) +{ + JSIValue retVal = JSI::CreateBoolean(true); + const uint8_t index = 2; + const uint32_t maxLen = 40; + // over 40 are ignored, ignore from beginning of the array + uint32_t len = JSI::GetArrayLength(args[0]); + uint32_t arrIndex = 0; + uint32_t realLen = (len > maxLen) ? maxLen : len; + DeviceData *data = (realLen > 0) ? static_cast(ace_malloc(sizeof(DeviceData) * realLen)) : nullptr; + if (len > maxLen) { + arrIndex = len - maxLen; + } + if (data == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "create device data failed"); + JSI::ReleaseValue(retVal); + return JSI::CreateBoolean(false); + } + + for (uint16_t i = 0; arrIndex < len; i++, arrIndex++) { + JSIValue point = JSI::GetPropertyByIndex(args[0], arrIndex); + if (JSI::ValueIsUndefined(point)) { + HILOG_ERROR(HILOG_MODULE_ACE, "point is error"); + ace_free(data); + JSI::ReleaseValue(retVal); + return JSI::CreateBoolean(false); + } + JSIValue point_x = JSI::GetPropertyByIndex(point, 0); + JSIValue point_y = JSI::GetPropertyByIndex(point, 1); + JSIValue state = JSI::GetPropertyByIndex(point, index); + data[i].point = { + static_cast(JSI::ValueToNumber(point_x)), + static_cast(JSI::ValueToNumber(point_y)) + }; + data[i].state = static_cast(JSI::ValueToNumber(state)); + JSI::ReleaseValueList(point_x, point_y, state, point); + } + + // simulate point event + if ((EventInjector::GetInstance() != nullptr) && + (EventInjector::GetInstance()->SetInjectEvent(data, realLen, type))) { + ace_free(data); + return retVal; + } else { + HILOG_ERROR(HILOG_MODULE_ACE, "simulator point event error"); + ace_free(data); + JSI::ReleaseValue(retVal); + return JSI::CreateBoolean(false); + } +} + +JSIValue DfxModule::InjectEvent(const JSIValue thisVal, const JSIValue *args, uint8_t argsNum) +{ + // pre check + const uint8_t num = 2; + if (argsNum != num) { + HILOG_ERROR(HILOG_MODULE_ACE, "Dfx Module args num(%d) is invalid, only one parameter", argsNum); + return JSI::CreateBoolean(false); + } + + // dispatch register event + char *eventType = JSI::ValueToString(args[1]); + if (eventType == nullptr) { + return JSI::CreateBoolean(false); + } + if (!strcmp(eventType, "point")) { + JSI::ReleaseString(eventType); + EventDataType type = EventDataType::POINT_TYPE; + if (!IsEventInjectorRegistered(type)) { + return JSI::CreateBoolean(false); + } + return InjectPointEvent(args, type); + } else { + HILOG_ERROR(HILOG_MODULE_ACE, "only support point event"); + } + + JSI::ReleaseString(eventType); + return JSI::CreateBoolean(false); +} + +void DfxModule::OnDestroy() +{ + // iterator remove all registered event + if (EventInjector::GetInstance() != nullptr) { + EventInjector::GetInstance()->UnregisterEventInjector(EventDataType::POINT_TYPE); + EventInjector::GetInstance()->UnregisterEventInjector(EventDataType::OTHERS); + } +} +} // namespace ACELite +} // namespace OHOS diff --git a/src/core/modules/dfx_module.h b/src/core/modules/dfx_module.h new file mode 100755 index 0000000..18aca8f --- /dev/null +++ b/src/core/modules/dfx_module.h @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2020 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. + */ + +#ifndef OHOS_ACELITE_DFX_MODULE_H +#define OHOS_ACELITE_DFX_MODULE_H + +#include "acelite_config.h" +#include "event_injector.h" +#include "jsi.h" +#include "non_copyable.h" + +namespace OHOS { +namespace ACELite { +class DfxModule final : public MemoryHeap { +public: + ACE_DISALLOW_COPY_AND_MOVE(DfxModule); +#ifdef FEATURE_ACELITE_DFX_MODULE + static JSIValue Screenshot(const JSIValue thisVal, const JSIValue *args, uint8_t argsNum); +#endif + static JSIValue InjectEvent(const JSIValue thisVal, const JSIValue *args, uint8_t argsNum); + static JSIValue DumpDomNode(const JSIValue thisVal, const JSIValue *args, uint8_t argsNum); + static JSIValue DumpDomTree(const JSIValue thisVal, const JSIValue *args, uint8_t argsNum); + static void OnDestroy(); + +private: + static const char * const DOM_TREE_PATH; + static const char * const SCREEN_SNAP_PATH; + + DfxModule() {} + ~DfxModule() {} + + static char *GetDomViewId(const JSIValue *args); + static bool PreCheck(uint8_t argsNum); + static JSIValue InjectPointEvent(const JSIValue *args, EventDataType type); + static bool IsEventInjectorRegistered(EventDataType type); +}; + +void InitDfxModule(JSIValue exports) +{ +#ifdef FEATURE_ACELITE_DFX_MODULE + JSI::SetModuleAPI(exports, "screenshotToFile", DfxModule::Screenshot); +#endif // FEATURE_ACELITE_DFX_MODULE + JSI::SetModuleAPI(exports, "injectEvent", DfxModule::InjectEvent); + JSI::SetModuleAPI(exports, "dumpDomNode", DfxModule::DumpDomNode); + JSI::SetModuleAPI(exports, "dumpDomTree", DfxModule::DumpDomTree); + JSI::SetOnDestroy(exports, DfxModule::OnDestroy); +} +} // namespace ACELite +} // namespace OHOS + +#endif // OHOS_ACELITE_DFX_MODULE_H diff --git a/src/core/modules/maplejs/readme.txt b/src/core/modules/maplejs/readme.txt new file mode 100755 index 0000000..2ca80f6 --- /dev/null +++ b/src/core/modules/maplejs/readme.txt @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2020 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. + */ +maplejs's module api will be combined here \ No newline at end of file diff --git a/src/core/modules/module_manager.cpp b/src/core/modules/module_manager.cpp new file mode 100755 index 0000000..ef872fb --- /dev/null +++ b/src/core/modules/module_manager.cpp @@ -0,0 +1,338 @@ +/* + * Copyright (c) 2020 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. + */ +#include "module_manager.h" +#include +#include +#include "acelite_config.h" +#ifdef OHOS_ACELITE_PRODUCT_WATCH +#include "securec.h" +#endif // OHOS_ACELITE_PRODUCT_WATCH +#include "ace_log.h" +#include "fatal_handler.h" +#include "internal/jsi_internal.h" +#include "js_app_context.h" +#include "js_fwk_common.h" +#include "ohos_module_config.h" + +namespace OHOS { +namespace ACELite { +// external methods for JS modules +#ifdef FEATURE_PRODUCT_MODULE +extern const Module* GetProductModules(uint16_t& moduleCount); +#endif // FEATURE_PRODUCT_MODULE +#ifdef FEATURE_PRIVATE_MODULE +extern const PrivateModule* GetPrivateModules(uint16_t& moduleCount); +#endif // FEATURE_PRIVATE_MODULE + +// Initialization of static variables +JSIValue ModuleManager::requiredSystemModules = 0; +JSIValue ModuleManager::requiredHistoryModules = 0; + +JSIValue ModuleManager::RequireModule(const char * const moduleName) +{ + char* category = nullptr; + char* name = nullptr; + if (!ParseModuleName(moduleName, &category, &name)) { + HILOG_ERROR(HILOG_MODULE_ACE, "ModuleManager::RequireModule: parse module name failed"); + return JSI::CreateUndefined(); + } + + JSIValue moduleObj; + if (!strcmp(category, CATEGORY_SYSTEM)) { + uint16_t moduleCount = sizeof(OHOS_MODULES) / sizeof(Module); + moduleObj = GetModuleObject(name, OHOS_MODULES, moduleCount, requiredSystemModules); +#ifdef FEATURE_PRODUCT_MODULE + if (JSI::ValueIsUndefined(moduleObj)) { + uint16_t prodModCount; + const Module* prodModules = GetProductModules(prodModCount); + moduleObj = GetModuleObject(name, prodModules, prodModCount, requiredSystemModules); + } +#endif // FEATURE_PRODUCT_MODULE +#ifdef FEATURE_PRIVATE_MODULE + if (JSI::ValueIsUndefined(moduleObj)) { + const char * const bundleName = JsAppContext::GetInstance()->GetCurrentBundleName(); + moduleObj = GetModuleObject(name, nullptr, 0, requiredSystemModules, bundleName); + } +#endif // FEATURE_PRIVATE_MODULE + } else { + moduleObj = JSI::CreateUndefined(); + HILOG_ERROR(HILOG_MODULE_ACE, "ModuleManager:RequireModule category %s does not exists!", category); + } + + ace_free(category); + category = nullptr; + ace_free(name); + name = nullptr; + return moduleObj; +} + +void ModuleManager::CleanUpModule() +{ + if (requiredSystemModules != 0) { + JSI::ReleaseValue(requiredSystemModules); + requiredSystemModules = 0; + } + InvokeCallbacks(onDestroyHead_); +} + +bool ModuleManager::ParseModuleName(const char * const moduleName, char** category, char** name) const +{ + if ((moduleName == nullptr) || (category == nullptr) || (name == nullptr)) { + return false; + } + // Get moduleName str + char* str = nullptr; + if (!CreateString(moduleName, &str)) { + return false; + } + + // Get category + char* next = nullptr; + char* tokenStr = strtok_s(str, ".", &next); + if (!CreateString(tokenStr, category)) { + ace_free(str); + str = nullptr; + return false; + } + + // Get name + tokenStr = strtok_s(nullptr, ".", &next); + if (!CreateString(tokenStr, name)) { + ace_free(str); + str = nullptr; + ace_free(*category); + *category = nullptr; + return false; + } + + ace_free(str); + str = nullptr; + tokenStr = nullptr; + next = nullptr; + return true; +} + +bool ModuleManager::CreateString(const char * const srcStr, char** resPtr) const +{ + if ((srcStr == nullptr) || (resPtr == nullptr)) { + return false; + } + size_t length = strlen(srcStr); + if (length >= UINT16_MAX) { + return false; + } + (*resPtr) = static_cast(ace_malloc(length + 1)); + if ((*resPtr) == nullptr) { + return false; + } + if (memcpy_s((*resPtr), length, srcStr, length) != 0) { + ace_free(*resPtr); + *resPtr = nullptr; + return false; + } + + (*resPtr)[length] = '\0'; + return true; +} + +JSIValue ModuleManager::GetModuleObject(const char * const moduleName, const Module* modules, uint16_t modulesCount, + JSIValue& categoryObj, const char * const bundleName) +{ + if (moduleName == nullptr) { + return JSI::CreateUndefined(); + } + if (bundleName == nullptr) { + if (modules == nullptr) { + return JSI::CreateUndefined(); + } + for (uint16_t i = 0; i < modulesCount; i++) { + const char *regName = modules[i].name; + if ((regName != nullptr) && (strcmp(moduleName, regName) == 0)) { + return InitModuleObject(moduleName, modules[i], categoryObj); + } + } + } +#ifdef FEATURE_PRIVATE_MODULE + else { + uint16_t count; + const PrivateModule* privateModules = GetPrivateModules(count); + if (privateModules == nullptr) { + return JSI::CreateUndefined(); + } + for (uint16_t i = 0; i < count; i++) { + const char *regBundleName = privateModules[i].bundleName; + const char *regPrivateName = privateModules[i].module.name; + if ((regBundleName != nullptr) && (regPrivateName != nullptr) && + (strcmp(bundleName, regBundleName) == 0) && + (strcmp(moduleName, regPrivateName) == 0)) { + return InitModuleObject(moduleName, privateModules[i].module, categoryObj); + } + } + HILOG_WARN(HILOG_MODULE_ACE, "ModuleManager:module %s does not exists!", moduleName); + } +#endif + return JSI::CreateUndefined(); +} + +JSIValue ModuleManager::InitModuleObject(const char * const name, Module module, JSIValue& categoryObj) +{ + if (categoryObj == 0) { + categoryObj = JSI::CreateObject(); + } + + // Get module object from cached object + JSIValue moduleObj = JSI::GetNamedProperty(categoryObj, name); + if (JSI::ValueIsUndefined(moduleObj)) { + JSIValue exports = JSI::CreateObject(); + module.initFunc(exports); + + // Get OnDestroy callback from module object + NativeCallback destroy = GetNativeCallback(exports, nullptr); + JsiCallback destroyHandler = GetJsiCallback(exports, ON_DESTROY_HANDLER); + InsertCallback(onDestroyHead_, destroy, destroyHandler); + + // Insert OnTerminate callback to callback list + InsertTerminateCallback(name, exports); + + // Set module object to cached object + JSI::SetNamedProperty(categoryObj, name, exports); + JSI::ReleaseValue(exports); + moduleObj = JSI::GetNamedProperty(categoryObj, name); + } + return moduleObj; +} + +void ModuleManager::InsertTerminateCallback(const char * const name, const JSIValue& moduleObj) +{ + if (requiredHistoryModules == 0) { + requiredHistoryModules = JSI::CreateObject(); + } + JSIValue object = JSI::GetNamedProperty(requiredHistoryModules, name); + if (JSI::ValueIsUndefined(object)) { + JSI::SetNamedProperty(requiredHistoryModules, name, moduleObj); + // Get OnTerminate callback from module object + NativeCallback terminate = GetNativeCallback(moduleObj, ON_TERMINATE); + JsiCallback terminateHandler = GetJsiCallback(moduleObj, ON_TERMINATE_HANDLER); + InsertCallback(onTerminateHead_, terminate, terminateHandler); + } + JSI::ReleaseValue(object); +} + +void ModuleManager::OnTerminate() +{ + if (requiredHistoryModules != 0) { + JSI::ReleaseValue(requiredHistoryModules); + requiredHistoryModules = 0; + } + InvokeCallbacks(onTerminateHead_); +} + +void ModuleManager::InsertCallback(CallbackNode *&head, NativeCallback callback, JsiCallback callbackHandler) const +{ + if ((callback == nullptr) && (callbackHandler == nullptr)) { + return; + } + auto node = new CallbackNode(); + if (node == nullptr) { + return; + } + node->callback = callback; + node->callbackHandler = callbackHandler; + if (head == nullptr) { + head = node; + } else { + node->next = head; + head = node; + } +} + +void ModuleManager::InvokeCallbacks(CallbackNode *&head) const +{ + CallbackNode *node = head; + while (node != nullptr) { + NativeCallback callback = node->callback; + JsiCallback callbackHandler = node->callbackHandler; + if (callback != nullptr) { + (*callback)(); + } + if (callbackHandler != nullptr) { + (*callbackHandler)(JSI_ERR_OK); + } + + head = node->next; + delete node; + node = head; + } + head = nullptr; +} + +void* ModuleManager::GetObjectPointer(JSIValue object) const +{ + if (!JSI::ValueIsObject(object)) { + return nullptr; + } + void *nativePtr = nullptr; + jerry_value_t jObj = AS_JERRY_VALUE(object); + bool exist = jerry_get_object_native_pointer(jObj, &nativePtr, nullptr); + if (!exist || (nativePtr == nullptr)) { + return nullptr; + } + jerry_delete_object_native_pointer(jObj, nullptr); + return nativePtr; +} + +void* ModuleManager::GetObjectNamedPointer(JSIValue object, const char * const name) const +{ + if (!JSI::ValueIsObject(object)) { + return nullptr; + } + JSIValue funObj = JSI::GetNamedProperty(object, name); + void *nativePtr = nullptr; + if (JSI::ValueIsObject(funObj)) { + nativePtr = GetObjectPointer(funObj); + DeleteObjectProperty(object, name); + } + JSI::ReleaseValue(funObj); + return nativePtr; +} + +void ModuleManager::DeleteObjectProperty(JSIValue object, const char * const name) const +{ + if (name == nullptr) { + return; + } + jerry_value_t jName = jerry_create_string(reinterpret_cast(name)); + jerry_delete_property(AS_JERRY_VALUE(object), jName); + jerry_release_value(jName); +} + +NativeCallback ModuleManager::GetNativeCallback(JSIValue object, const char * const name) const +{ + void *callback = nullptr; + if (name == nullptr) { + callback = GetObjectPointer(object); + } else { + callback = GetObjectNamedPointer(object, name); + } + return reinterpret_cast(callback); +} + +JsiCallback ModuleManager::GetJsiCallback(JSIValue object, const char * const name) const +{ + void *callback = GetObjectNamedPointer(object, name); + return reinterpret_cast(callback); +} +} // namespace ACELite +} // namespace OHOS diff --git a/src/core/modules/module_manager.h b/src/core/modules/module_manager.h new file mode 100755 index 0000000..3c0ac57 --- /dev/null +++ b/src/core/modules/module_manager.h @@ -0,0 +1,129 @@ +/* + * Copyright (c) 2020 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. + */ + +#ifndef OHOS_ACELITE_MODULE_MANAGER_H +#define OHOS_ACELITE_MODULE_MANAGER_H + +#include "jsi.h" +#include "non_copyable.h" + +namespace OHOS { +namespace ACELite { +/** + * @brief module manager for module load. + */ +class ModuleManager final : public MemoryHeap { +public: + ACE_DISALLOW_COPY_AND_MOVE(ModuleManager); + /** + * @brief Get the single instance of ModuleManager + * + * @returns the instance. + */ + static ModuleManager* GetInstance() + { + static ModuleManager instance; + return &instance; + } + + /** + * @brief: require javascript module object with given module name. + * + * @param: moduleName name of the module required + * @returns: javascript module object + */ + JSIValue RequireModule(const char * const moduleName); + + /** + * @brief: Release module object created by RequireModule. + * This Method should be called when current js page is + * going to destroy + */ + void CleanUpModule(); + + /** + * @brief: Call OnTerminate callbacks of required modules. + * This Method should be called when current application is + * going to terminate + */ + void OnTerminate(); + +private: + struct CallbackNode : public MemoryHeap { + ACE_DISALLOW_COPY_AND_MOVE(CallbackNode); + CallbackNode() : callback(nullptr), callbackHandler(nullptr), next(nullptr) {} + NativeCallback callback; + JsiCallback callbackHandler; + struct CallbackNode *next; + }; + + ModuleManager() : onDestroyHead_(nullptr), onTerminateHead_(nullptr) {} + virtual ~ModuleManager() {} + + /** + * @brief: get category and name with given moduleName. + * + * @param [in] moduleName module name passed from JS, e.g. system.vibrator + * @param [out] category pointer to category which this module belongs to + * Content should be freed with free() when it is not used anymore + * @param [out] name pointer to module name parsed from moduleName, e.g. vibrator + * Content should be freed with free() when it is not used anymore + * @return whether operation succeed + */ + bool ParseModuleName(const char * const moduleName, char** category, char** name) const; + + /** + * @brief: get module object with given module name. + * + * @param [in] moduleName module name + * @param [in] modules array of module infos + * @param [in] modulesCount length of modules + * @param [inout] categoryObj pointer to static object, e.g. requiredSystemModules + * @param [in] bundleName bundle name of specific private module + * @return javascript required module object + */ + JSIValue GetModuleObject(const char * const moduleName, const Module* modules, uint16_t modulesCount, + JSIValue& categoryObj, const char * const bundleName = nullptr); + + JSIValue InitModuleObject(const char * const name, Module module, JSIValue& categoryObj); + + // *resPtr should be freed by caller when it's not nullptr and won't be used any more + bool CreateString(const char * const srcStr, char** resPtr) const; + + void InsertCallback(CallbackNode *&head, NativeCallback callback, JsiCallback callbackHandler) const; + void InsertTerminateCallback(const char * const name, const JSIValue& moduleObj); + void InvokeCallbacks(CallbackNode *&head) const; + void* GetObjectPointer(JSIValue object) const; + void* GetObjectNamedPointer(JSIValue object, const char * const name) const; + void DeleteObjectProperty(JSIValue object, const char * const name) const; + NativeCallback GetNativeCallback(JSIValue object, const char * const name) const; + JsiCallback GetJsiCallback(JSIValue object, const char * const name) const; + + // For different native module type + const char* CATEGORY_SYSTEM = "system"; + + // JS object for caching modules + static JSIValue requiredSystemModules; + + // JS object for required history modules before ability terminating + static JSIValue requiredHistoryModules; + + CallbackNode *onDestroyHead_; + CallbackNode *onTerminateHead_; +}; +} // namespace ACELite +} // namespace OHOS + +#endif // OHOS_ACELITE_MODULE_MANAGER_H diff --git a/src/core/modules/ohos_module_config.h b/src/core/modules/ohos_module_config.h new file mode 100755 index 0000000..eb394de --- /dev/null +++ b/src/core/modules/ohos_module_config.h @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2020 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. + */ + +#ifndef OHOS_ACELITE_OHOS_MODULE_CONFIG_H +#define OHOS_ACELITE_OHOS_MODULE_CONFIG_H + +#include "acelite_config.h" +#include "jsi_types.h" + +namespace OHOS { +namespace ACELite { +#ifdef ENABLE_MODULE_REQUIRE_TEST +extern void InitSampleModule(JSIValue exports); +#endif +extern void InitRouterModule(JSIValue exports); +extern void InitAppModule(JSIValue exports); +#ifdef FEATURE_MODULE_AUDIO +extern void InitAudioModule(JSIValue exports); +#endif // FEATURE_MODULE_AUDIO +extern void InitDfxModule(JSIValue exports); +#ifdef ENABLE_MODULE_CIPHER +extern void InitCipherModule(JSIValue exports); +#endif + +#ifdef FEATURE_MODULE_STORAGE +extern void InitNativeApiFs(JSIValue exports); +extern void InitNativeApiKv(JSIValue exports); +#endif + +#ifdef FEATURE_MODULE_DEVICE +extern void InitDeviceModule(JSIValue exports); +#endif + +// Config information for built-in JS modules of OHOS platform +const Module OHOS_MODULES[] = { +#ifdef ENABLE_MODULE_REQUIRE_TEST + {"sample", InitSampleModule}, +#endif + {"app", InitAppModule}, +#ifdef FEATURE_MODULE_AUDIO + {"audio", InitAudioModule}, +#endif // FEATURE_MODULE_AUDIO + {"dfx", InitDfxModule}, + {"router", InitRouterModule}, +#ifdef ENABLE_MODULE_CIPHER + {"cipher", InitCipherModule}, +#endif + +#ifdef FEATURE_MODULE_STORAGE + {"file", InitNativeApiFs}, + {"storage", InitNativeApiKv}, +#endif +#ifdef FEATURE_MODULE_DEVICE + {"device", InitDeviceModule}, +#endif +}; +} // namespace ACELite +} // namespace OHOS + +#endif // OHOS_ACELITE_OHOS_MODULE_CONFIG_H diff --git a/src/core/modules/presets/cjson_parser.cpp b/src/core/modules/presets/cjson_parser.cpp new file mode 100755 index 0000000..4a363e1 --- /dev/null +++ b/src/core/modules/presets/cjson_parser.cpp @@ -0,0 +1,690 @@ +/* + * Copyright (c) 2020 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. + */ + +#include "cjson_parser.h" +#ifdef FEATURE_LOCALIZATION_MODULE +#include "ace_log.h" +#include "global.h" +#include "js_fwk_common.h" +#if (defined(_WIN32) || defined(_WIN64)) +#include +#else +#include "file.h" +#endif +#if ENABLED(SECURE_C_FUNCTION) +#include "securec.h" +#endif +#include "ui_text_language.h" +#include + +namespace OHOS { +namespace ACELite { +CJSONParser::CJSONParser() + : curFileIndex_(0), + totalFiles_(0), + countries_(nullptr), + language_(nullptr), + filePath_(nullptr), + fileList_(nullptr) +{ + char left = '{'; + leftDelemeter_ = left; + char right = '}'; + rightDelemeter_ = right; +} + +bool CJSONParser::Init() +{ + const char * const filePath = JsAppContext::GetInstance()->GetCurrentAbilityPath(); + const char * const folderName = "i18n"; + filePath_ = RelocateResourceFilePath(filePath, folderName); + return (filePath_ != nullptr); +} + +bool CJSONParser::ChangeJsonFile(cJSON *¤tItem) +{ + if (currentItem != nullptr) { // if the currentItem is not null, it must be free + cJSON_Delete(currentItem); + currentItem = nullptr; + } + SetLanguage(); // get the new locale string + if (totalFiles_ == 0) { + return false; + } + char *name = nullptr; + if (curFileIndex_ == totalFiles_) { + return false; + } else { + // read the next json resource file + name = GetNode(fileList_, curFileIndex_ + 1); + } + char *content = ReadJSFile(filePath_, name); + if (content == nullptr) { + currentItem = nullptr; + curFileIndex_++; + return true; + } + currentItem = cJSON_Parse(content); + ace_free(content); + content = nullptr; + // point to next file + curFileIndex_++; + return true; +} + +bool CJSONParser::GetFiles() +{ + ClearNode(fileList_); + totalFiles_ = 0; + if (language_ == nullptr) { + return false; + } + ListNode *languageFile = nullptr; // save language-XXX.json + ListNode *countryFile = nullptr; // save language-country-XXX.json +#if (defined(_WIN32) || defined(_WIN64)) + if (!ReadWinFile(languageFile, countryFile)) { + ClearNode(languageFile); + ClearNode(countryFile); + return false; + } +#else + if (!ReadFile(languageFile, countryFile)) { + ClearNode(languageFile); + ClearNode(countryFile); + return false; + } +#endif + SortFileName(fileList_); + SortFileName(languageFile); + SortFileName(countryFile); + const char *defaultFileName = "en-US.json"; // add the default file name + ListNode *defaultFile = new ListNode(); + if (defaultFile == nullptr) { + // release the list which stores atrget file name, the fileList_ release in destructor or next used time + ClearNode(languageFile); + ClearNode(countryFile); + return false; + } + defaultFile->value = SubStr(defaultFileName, 0, strlen(defaultFileName)); + totalFiles_++; + MergeList(countryFile, defaultFile); + MergeList(languageFile, countryFile); + MergeList(fileList_, languageFile); + return true; +} + +#if (!defined(_WIN32) && !defined(_WIN64)) +bool CJSONParser::ReadFile(ListNode *&languageFile, ListNode *&countryFile) +{ + void *files = FileOpenDir(filePath_); + FileDirentInfo info; + if (files == nullptr) { + return false; + } + bool result = true; + while ((FileReadDir(files, &info) == 0) && (totalFiles_ < UINT8_MAX)) { + if ((info.name == nullptr) || (strncmp(info.name, language_, strlen(language_)) != 0)) { + continue; + } + size_t infoNameLen = strlen(info.name); + if (infoNameLen >= NAME_LENGTH_MAX) { + break; + } + char *value = static_cast(ace_malloc(infoNameLen + 1)); + if (value == nullptr) { + break; + } + errno_t error = strcpy_s(value, infoNameLen + 1, info.name); + if (error != 0) { + ace_free(value); + value = nullptr; + break; + } + bool check = true; + int8_t fileType = CompareFileName(info.name); + if (fileType == COUNTRY) { + check = AddNode(fileList_, value); + } else if (fileType == LANG) { + check = AddNode(languageFile, value); + } else if (fileType == OTHERCOUNTRY) { + check = AddNode(countryFile, value); + } else { + ace_free(value); + value = nullptr; + result = false; // the country and lang list would be release if return false + break; + } + if (!check) { + ace_free(value); + value = nullptr; + } else { + totalFiles_++; + } + } + FileCloseDir(files); + return result; +} +#endif + +#ifdef LOCALIZATION_PLURAL +char *CJSONParser::FillPlaceholder(char *format, jerry_value_t arg, jerry_length_t num, bool isPlural) +#else +char *CJSONParser::FillPlaceholder(char *format, jerry_value_t arg, jerry_length_t num) +#endif // LOCALIZATION_PLURAL +{ + if (format == nullptr) { + return nullptr; + } +#ifdef LOCALIZATION_PLURAL + if (isPlural) { + format = GetPluralValue(format, arg); + if (format == nullptr) { + return nullptr; + } + } +#endif + ListNode *values = nullptr; // store the value after split. +#ifdef LOCALIZATION_PLURAL + uint8_t length = FormatString(format, arg, values, isPlural, num); + if (isPlural) { + ACE_FREE(format); + } +#else + uint8_t length = FormatString(format, arg, values, num); +#endif // LOCALIZATION_PLURAL + char *result = nullptr; + if (values != nullptr) { + result = ToString(values, length); + ClearNode(values); + } + return result; +} + +#ifdef LOCALIZATION_PLURAL +uint8_t CJSONParser::FormatString(char *format, jerry_value_t arg, ListNode *&values, bool isPlural, jerry_length_t num) +#else +uint8_t CJSONParser::FormatString(char *format, jerry_value_t arg, ListNode *&values, jerry_length_t num) +#endif +{ + uint8_t length = 0; + int index = 0; + int leftIndex = IndexOf(format, leftDelemeter_, index); // get the index of '{' + while (leftIndex >= 0) { + char* value = SubStr(format, index, leftIndex - index); + if (AddNode(values, value)) { + length++; + } else { + ACE_FREE(value); + } + leftIndex++; + index = IndexOf(format, rightDelemeter_, leftIndex); // get the index of '}' + if (index > 0 && num > 1) { + char *content = nullptr; + content = SubStr(format, leftIndex, index - leftIndex); +#ifdef LOCALIZATION_PLURAL + char *contentValue = GetParamValue(content, arg, isPlural); +#else + char *contentValue = GetParamValue(content, arg); +#endif // LOCALIZATION_PLURAL + if (AddNode(values, contentValue)) { + length++; + } else { + ACE_FREE(contentValue); + } + } + if ((index > 0) && (index < strlen(format))) { + index++; // move the index '}' to the next char + } else { + // add the remain character to node.eg.the value is {count}aa, add the last aa to the node + char* currentVal = SubStr(format, index, strlen(format) - index); + if (AddNode(values, currentVal)) { + length++; + } else { + ACE_FREE(currentVal); + } + } + leftIndex = IndexOf(format, leftDelemeter_, index); + } + if (leftIndex < 0 && (index < strlen(format))) { + char* currentVal = SubStr(format, index, strlen(format) - index); + if (AddNode(values, currentVal)) { + length++; + } else { + ACE_FREE(currentVal); + } + } + return length; +} + +#ifdef LOCALIZATION_PLURAL +char *CJSONParser::GetPluralValue(char *value, jerry_value_t param) +{ + ListNode *plurals = nullptr; + int defaultNum = jerry_value_is_number(param) ? IntegerOf(param) : 1; + const char delemeter = '|'; // if the function is get plural, split the value in json by '|' + int len = Split(value, delemeter, plurals); + const int maxLen = 2; + // get the index in plural array + if (len <= maxLen) { + value = (defaultNum != 1) ? GetNode(plurals, 1) : GetNode(plurals, len); + } else { + int index = (abs(defaultNum) < maxLen) ? abs(defaultNum) : maxLen; // get the index in plurals + value = GetNode(plurals, len - index); + } + char *result = SubStr(value, 0, strlen(value)); + if (plurals) { + ClearNode(plurals); + } + return result; +} +#endif // LOCALIZATION_PLURAL + +void CJSONParser::ResetIndex() +{ + curFileIndex_ = 0; +} + +bool CJSONParser::AddNode(ListNode *&head, char *current) +{ + if (current == nullptr || strlen(current) == 0) { + return false; + } + ListNode *node = new ListNode(); + if (node == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "create node failed"); + return false; + } + node->next = head; + node->value = current; + head = node; + return true; +} + +char *CJSONParser::GetNode(ListNode *node, int index) +{ + for (int i = 0; i < index - 1; i++) { + if (node == nullptr) { + break; + } + node = node->next; + } + return (node == nullptr) ? nullptr : node->value; +} + +void CJSONParser::ClearNode(ListNode *&node) +{ + while (node != nullptr) { + ListNode *current = node->next; + ACE_FREE(node->value); + delete node; + node = current; + } +} + +char *CJSONParser::ToString(ListNode *node, uint8_t length) +{ + if (node == nullptr || (length == 0)) { + return nullptr; + } + char **temp = static_cast(ace_malloc(length * sizeof(char*))); + if (temp == nullptr) { + return nullptr; + } + // reverse node value + uint8_t index = 0; + uint16_t strLength = 0; // the length of result + while (node != nullptr) { + if ((length - index - 1 >= 0) && (node->value != nullptr)) { + if (strLength > (UINT16_MAX - (uint16_t)(strlen(node->value)))) { + ACE_FREE(temp); + return nullptr; + } + temp[length - 1 - index] = node->value; + strLength += strlen(node->value); + } + node = node->next; + index++; + } + if (strLength == UINT16_MAX) { + HILOG_ERROR(HILOG_MODULE_ACE, "the str length is too long"); + ACE_FREE(temp); + return nullptr; + } + strLength++; + char *result = static_cast(ace_malloc(strLength)); + if (result == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "malloc localization result failed"); + ACE_FREE(temp); + return nullptr; + } + // convert the value in node to string + if (strcpy_s(result, strLength, temp[0]) != 0) { + HILOG_ERROR(HILOG_MODULE_ACE, "merge string failed"); + ACE_FREE(result); + ACE_FREE(temp); + return nullptr; + } + for (int i = 1; i < length; i++) { + if (strcat_s(result, strLength, temp[i]) != 0) { + HILOG_INFO(HILOG_MODULE_ACE, "merge string failed"); + ACE_FREE(result); + ACE_FREE(temp); + return nullptr; + } + } + ACE_FREE(temp); + return result; +} + +char *CJSONParser::SubStr(const char *src, size_t start, size_t length) +{ + if (src == nullptr || start >= strlen(src)) { + return nullptr; + } + if (length >= UINT8_MAX) { + HILOG_ERROR(HILOG_MODULE_ACE, "the length is too long"); + return nullptr; + } + size_t len = length + 1; + char *result = static_cast(ace_malloc(len)); + if (result == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "malloc failed"); + return nullptr; + } + errno_t error = strncpy_s(result, len, src + start, length); + if (error != 0) { + HILOG_ERROR(HILOG_MODULE_ACE, "copy string failed"); + ACE_FREE(result); + return nullptr; + } + result[length] = '\0'; + return result; +} + +int8_t CJSONParser::CompareFileName(const char *name) +{ + if ((name == nullptr) || (language_ == nullptr)) { + return ERRORCODE; + } + size_t languageLen = strlen(language_); + if (languageLen >= UINT8_MAX) { + return ERRORCODE; + } + const char delemeter = '-'; + const int countryLen = 2; + size_t minLen = languageLen + 1 + countryLen; // the length of .json + if ((strlen(name) <= minLen) || (name[languageLen] != delemeter)) { + return 1; + } else { + int result = COUNTRY; + if (countries_ == nullptr) { + return ERRORCODE; + } + char *countryName = static_cast(ace_malloc(countryLen + 1)); + if (countryName == nullptr) { + return ERRORCODE; + } + for (int i = 0; i < countryLen; i++) { + countryName[i] = name[languageLen + 1 + i]; + } + countryName[countryLen] = '\0'; + if (strstr(countries_, countryName) == nullptr) { + const char startIndex = 'A'; + int index = countryName[0] - startIndex; + const char * const countries = GetCountries(index); + if ((countries != nullptr) && (IndexOf(const_cast(countries), countryName[1], 0) > 0)) { + result = OTHERCOUNTRY; + } else { + result = LANG; + } + } + ace_free(countryName); + countryName = nullptr; + return result; + } +} + +void CJSONParser::SetLanguage() +{ + char* currentLanguage = static_cast(ace_malloc(MAX_LANGUAGE_LENGTH)); + if (currentLanguage == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "malloc language failed\n"); + return; + } + if (GLOBAL_GetLanguage(currentLanguage, MAX_LANGUAGE_LENGTH) != 0) { + HILOG_ERROR(HILOG_MODULE_ACE, "get language failed\n"); + ace_free(currentLanguage); + currentLanguage = nullptr; + return; + } + + char* currentOrigion = static_cast(ace_malloc(MAX_REGION_LENGTH)); + if (currentOrigion == nullptr) { + ace_free(currentLanguage); + currentLanguage = nullptr; + return; + } + if (GLOBAL_GetRegion(currentOrigion, MAX_REGION_LENGTH) != 0) { + HILOG_ERROR(HILOG_MODULE_ACE, "get origion failed"); + ace_free(currentOrigion); + currentOrigion = nullptr; + ace_free(currentLanguage); + currentLanguage = nullptr; + return; + } + if ((language_ != nullptr) && (strcmp(currentLanguage, language_) == 0) + && (countries_ != nullptr) && (strcmp(currentOrigion, countries_) == 0)) { + ace_free(currentLanguage); + currentLanguage = nullptr; + ace_free(currentOrigion); + currentOrigion = nullptr; + return; + } + ACE_FREE(language_); + language_ = currentLanguage; + ACE_FREE(countries_); + countries_ = currentOrigion; + if (!GetFiles()) { // get the files whose name begins with the local string + return; + } + curFileIndex_ = 0; +} + +#if (defined(_WIN32) || (defined(_WIN64))) +bool CJSONParser::ReadWinFile(ListNode *&languageFile, ListNode *&countryFile) +{ + _finddata_t file; + intptr_t opendir; + const char * const match = "*.*"; + char* fileDir = RelocateResourceFilePath(filePath_, match); + if (fileDir == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "get localization path failed"); + return false; + } + if ((opendir = _findfirst(fileDir, &file)) == -1) { + HILOG_ERROR(HILOG_MODULE_ACE, "file not defined"); + ACE_FREE(fileDir); + return false; + } + bool result = true; + // get the file start with the split locale string, for example, en-US_XXX.json + while ((_findnext(opendir, &file) == 0) && (totalFiles_ < UINT8_MAX)) { + // if the file name is not start with the language , go to the next file + if (strncmp(file.name, language_, strlen(language_)) != 0) { + continue; + } + char *value = SubStr(file.name, 0, strlen(file.name)); + bool check = true; + int8_t fileType = CompareFileName(file.name); + if (fileType == COUNTRY) { + check = AddNode(fileList_, value); + } else if (fileType == LANG) { + check = AddNode(languageFile, value); + } else if (fileType == OTHERCOUNTRY) { + check = AddNode(countryFile, value); + } else { + ACE_FREE(value); + result = false; // the country and lang list would be release if return false + break; + } + if (!check) { + ACE_FREE(value); + } else { + totalFiles_++; + } + } + _findclose(opendir); + ACE_FREE(fileDir); + return result; +} +#endif + +uint8_t CJSONParser::Split(const char *target, char delemeter, ListNode *&node) +{ + if (target == nullptr) { + return 0; + } + uint8_t nodeCount = 0; + char *current = nullptr; + int startPos = 0; + // get the position of delemeter + int pos = IndexOf(target, delemeter, startPos); + while (pos != -1) { + // add the value between startPos and index to node + current = SubStr(target, startPos, pos - startPos); + if (AddNode(node, current)) { + nodeCount++; + } else { + ACE_FREE(current); + } + startPos = pos + 1; + pos = IndexOf(target, delemeter, startPos); + } + if ((startPos != -1) && (startPos < strlen(target))) { + current = SubStr(target, startPos, strlen(target) - startPos); + if (AddNode(node, current)) { + nodeCount++; + } else { + ACE_FREE(current); + } + } + // deal the key from lastIndex to strlen(target), the last find would return -1 + return nodeCount; +} + +int CJSONParser::IndexOf(const char *string, char delemeter, int index) +{ + if (string == nullptr) { + return -1; + } + if ((index >= strlen(string)) || (index < 0) || (strlen(string) >= INT8_MAX)) { + return -1; + } + int length = strlen(string); + int i = index; + do { + if (string[i] == delemeter) { + return i; + } + i++; + } while (i < length); + // if the delemeter is not find return the length of string + return -1; +} + +#ifdef LOCALIZATION_PLURAL +char *CJSONParser::GetParamValue(char *attrName, jerry_value_t param, bool isPlural) +#else +char *CJSONParser::GetParamValue(char *attrName, jerry_value_t param) +{ + char *contentValue = nullptr; // store the value defined in param + uint16_t contentLen = 0; +#ifdef LOCALIZATION_PLURAL + if (jerry_value_is_number(param)) { + contentValue = MallocStringOf(param, &contentLen); + } +#else + jerry_value_t propName = jerry_create_string(reinterpret_cast(attrName)); + if (JerryHasProperty(param, propName)) { // get the placehoder {...} value defined in param + jerry_value_t paramValue = jerry_get_property(param, propName); + // the contentValue would be released in clearNode values + contentValue = MallocStringOf(paramValue, &contentLen); + jerry_release_value(paramValue); + } + jerry_release_value(propName); +#endif + // if the length of attrVal is 0, the node wouldn't add to the list + if ((contentValue != nullptr) && contentLen != 0) { + return contentValue; + } else { + ACE_FREE(contentValue); // if the contentValue is \0 + return nullptr; + } +} +#endif + +void CJSONParser::SortFileName(ListNode *node) +{ + if (node == nullptr || (node->next == nullptr)) { + return; + } + ListNode *current = node; + ListNode *compare = nullptr; + const int suffixLen = 5; + while (current != nullptr) { + compare = current->next; + int currentLen = strlen(current->value); + while (compare != nullptr) { + int min = (currentLen < strlen(compare->value)) ? currentLen : strlen(compare->value); + int compareResult = strncmp(compare->value, current->value, min - suffixLen); + // when the file name is zh-CN.json and zh-CN-1.json, the sort result is zh-CN.json,zh-CN-1.json + if ((compareResult < 0) || ((compareResult == 0) && (min != currentLen))) { + char *value = compare->value; + compare->value = current->value; + current->value = value; + } + compare = compare->next; + } + current = current->next; + } +} + +const char *CJSONParser::GetCountries(int8_t index) +{ + if ((index >= maxLen_) || (index < 0)) { + return nullptr; + } + return allCountries_[index]; +} + +void CJSONParser::MergeList(ListNode *&destination, ListNode *source) +{ + // merge two list + if (source == nullptr) { + return; + } + if (destination == nullptr) { + destination = source; + return; + } + ListNode *current = destination; + while (current->next != nullptr) { + current = current->next; + } + current->next = source; +} +} // namespace ACELite +} // namespace OHOS +#endif diff --git a/src/core/modules/presets/cjson_parser.h b/src/core/modules/presets/cjson_parser.h new file mode 100755 index 0000000..bb7ab90 --- /dev/null +++ b/src/core/modules/presets/cjson_parser.h @@ -0,0 +1,192 @@ +/* + * Copyright (c) 2020 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. + */ +#ifndef OHOS_ACELITE_CJSON_PARSER_H +#define OHOS_ACELITE_CJSON_PARSER_H +#include "acelite_config.h" + +#ifdef FEATURE_LOCALIZATION_MODULE +#include +#include +#include "ace_mem_base.h" +#include "js_app_context.h" +#include "non_copyable.h" + +namespace OHOS { +namespace ACELite { +class CJSONParser final : public MemoryHeap { +public: + ACE_DISALLOW_COPY_AND_MOVE(CJSONParser); + struct ListNode : public MemoryHeap { + char *value; + ListNode *next; + }; + + CJSONParser(); + + ~CJSONParser() + { + if (fileList_ != nullptr) { + ClearNode(fileList_); + } + ACE_FREE(countries_); + ACE_FREE(language_); + ACE_FREE(filePath_); + } + + /** + * @breif: read the next file which matches the language-country, and then transfer the file content + * to json. + * + * @return if the fileList is nullptr or read the last one return false.if get the correct content return true. + */ + bool ChangeJsonFile(cJSON *¤tItem); + + /** + * @brief: replace the placeholder in result with the data defined by user + * if plural is true, it will replace the number in placeholder, + * replace the same name in js object. + */ +#ifdef LOCALIZATION_PLURAL + char *FillPlaceholder(char *format, jerry_value_t arg, jerry_length_t num, bool isPlural); +#else + char *FillPlaceholder(char *format, jerry_value_t arg, jerry_length_t num); +#endif // LOCALIZATION_PLURAL + + /** + * @brief:set the readIndex_ = 0; the value of index is the index where the key is defined + */ + void ResetIndex(); + + /** + * @brief: get the filePath name + */ + bool Init(); + + /** + * @brief: merge string destination and resource, save the merge result in destination + * if check is true, it will free destination string + */ + char *SubStr(const char *src, size_t start, size_t length); + + /** + * @brief: split the string by delemeter and save the split result in node + * + * @return the length of node + */ + uint8_t Split(const char *target, char delemeter, ListNode *&node); + + static bool AddNode(ListNode *&head, char *current); + static char *GetNode(ListNode *node, int index); + static void ClearNode(ListNode *&node); + static char *ToString(ListNode *node, uint8_t length); + +private: + constexpr static int maxLen_ = 26; + const char * const allCountries_[maxLen_] = { + "DEFGILMOQRSTUWXZ", + "ABDEFGHIJLMNORSTVWYZ", + "ACDFGHIKLMNORUVWXYZ", + "EJKMOZ", + "CEGHRST", + "IJKMOR", + "ABDEFGHILMNPQRSTUWY", + "KMNRTU", + "DELMNOQRST", + "EMOP", + "EGHIMNPRWYZ", + "ABCIKRSTUVY", + "ACDEFGHKLMNOPQRSTUVWXYZ", + "ACEFGILOPRUZ", + "M", + "AEFGHKLMNRSTWY", + "A", + "EOSUW", + "ABCDEGHIJKLMNORSTVXYZ", + "CDFGHJKLMNORTVWZ", + "AGMSYZ", + "ACEGINU", + "FS", + "", + "ET", + "AMW", + }; + enum FILETYPE { COUNTRY = 0, LANG = 1, OTHERCOUNTRY = -1, ERRORCODE = -2}; + const char *GetCountries(int8_t index); + + bool GetFiles(); + /** + * @brief:compare the fileName with the string language-country + * + * @return 0:the file name is language-countryXXXX.json + * 1:the file name is language -XXX.json + * 2:the file name is language-otherCountryXXX.json + */ + int8_t CompareFileName(const char *name); + /** + * @Brief get the locale string and split it by ',' + */ + void SetLanguage(); + + /** + * @Brief: get the positon of delemeter after index + * @return if the index is upper than the length of string, return -1 + * else if the index is not defined in string, return the length, else return the position of it + */ + int IndexOf(const char *string, char delemeter, int index); + + /** + * @Brief: split the string defined in value by '|', and get value in the split string + * For example: the string is car|cars, if the value of param is odd, assign value car,else cars + */ +#ifdef LOCALIZATION_PLURAL + char *GetPluralValue(char *value, jerry_value_t param); + uint8_t FormatString(char *format, jerry_value_t arg, ListNode *&node, bool isPlural, jerry_value_t num); + /** + * @brief: get the value defined in param + * @param: attrName:the attrbute name in param, for example "name" + * param: the object defined attrName, for example {"name":"Jane"} + * @return: the value in param + */ + char *GetParamValue(char *attrName, jerry_value_t param, bool isPlural); +#else + uint8_t FormatString(char *format, jerry_value_t arg, ListNode *&node, jerry_value_t num); + char *GetParamValue(char *attrName, jerry_value_t param); +#endif + + /** + * @Brief: sort the file name alphabetical order + */ + void SortFileName(ListNode *node); + + void MergeList(ListNode *&destination, ListNode *source); + + uint8_t curFileIndex_; // the file index current read + uint8_t totalFiles_; + char *countries_; // the current country and origion + char *language_; // the current system language + char leftDelemeter_; + char rightDelemeter_; + char *filePath_; + ListNode *fileList_; +#if (defined(_WIN32) || defined(_WIN64)) + bool ReadWinFile(ListNode *&languageFile, ListNode *&countryFile); +#else + bool ReadFile(ListNode *&languageFile, ListNode *&countryFile); +#endif +}; +} // namespace ACELite +} // namespace OHOS +#endif // LOCALIZATION_MODULE +#endif // OHOS_ACELITE_CJSON_PARSER_H diff --git a/src/core/modules/presets/console_log_impl.cpp b/src/core/modules/presets/console_log_impl.cpp new file mode 100755 index 0000000..802ac40 --- /dev/null +++ b/src/core/modules/presets/console_log_impl.cpp @@ -0,0 +1,255 @@ +/* + * Copyright (c) 2020 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. + */ + +#include "console_log_impl.h" +#if ENABLED(CONSOLE_LOG_OUTPUT) +#include "js_app_environment.h" +#ifdef FEATURE_USER_MC_LOG_PRINTF +#include "log_js.h" // mc js console log header +#endif // FEATURE_USER_MC_LOG_PRINTF +#ifdef FEATURE_ACELITE_HI_LOG_PRINTF +#undef LOG_DOMAIN +#undef LOG_TAG +#define LOG_DOMAIN 0xD003B00 +#define LOG_TAG "JS-3RD-APP" +#include "hilog/log.h" +#endif // FEATURE_ACELITE_HI_LOG_PRINTF +#include +#include + +namespace OHOS { +namespace ACELite { +#ifdef CONSOLE_LOG_LINE_MAX_LENGTH +const int16_t LOG_BUFFER_SIZE = CONSOLE_LOG_LINE_MAX_LENGTH; +#else +const int16_t LOG_BUFFER_SIZE = 256; // use 256 as default if it's not config +#endif // CONSOLE_LOG_LINE_MAX_LENGTH +jerry_value_t LogNative(const LogLevel logLevel, + const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t *args, + const jerry_length_t argc) +{ + (void)func; /* unused */ + (void)context; /* unused */ + + // print out log level if needed + LogOutLevel(logLevel); + + const char * const nullStr = "\\u0000"; + jerry_value_t retVal = jerry_create_undefined(); + + for (jerry_length_t argIndex = 0; argIndex < argc; argIndex++) { + jerry_value_t strVal; + + if (jerry_value_is_symbol(args[argIndex])) { + strVal = jerry_get_symbol_descriptive_string(args[argIndex]); + } else { + strVal = jerry_value_to_string(args[argIndex]); + } + + if (jerry_value_is_error(strVal)) { + /* There is no need to free the undefined value. */ + retVal = strVal; + break; + } + + jerry_length_t length = jerry_get_utf8_string_length(strVal); + jerry_length_t substrPos = 0; + const uint16_t bufLength = LOG_BUFFER_SIZE; + jerry_char_t substrBuf[bufLength] = {0}; + + do { + jerry_size_t substrSize = + jerry_substring_to_utf8_char_buffer(strVal, substrPos, length, substrBuf, bufLength - 1); + + jerry_char_t *bufEndPos = substrBuf + substrSize; + + /* Update start position by the number of utf-8 characters. */ + for (jerry_char_t *bufPos = substrBuf; bufPos < bufEndPos; bufPos++) { + /* Skip intermediate utf-8 octets. */ + if ((*bufPos & 0xc0) != 0x80) { + substrPos++; + } + } + + for (jerry_char_t *bufPos = substrBuf; bufPos < bufEndPos; bufPos++) { + char chr = static_cast(*bufPos); + + if (chr != '\0') { + LogChar(chr, logLevel); + continue; + } + + for (jerry_size_t null_index = 0; nullStr[null_index] != '\0'; null_index++) { + LogChar(nullStr[null_index], logLevel); + } + } + } while (substrPos < length); + + jerry_release_value(strVal); + } + // output end + LogChar('\n', logLevel, true); + FlushOutput(); + return retVal; +} + +void LogOutLevel(const LogLevel logLevel) +{ + switch (logLevel) { + case LOG_LEVEL_ERR: + LogString(logLevel, "[Console Error] "); // console error + break; + case LOG_LEVEL_WARN: + LogString(logLevel, "[Console Warn] "); // console warn + break; + case LOG_LEVEL_INFO: + LogString(logLevel, "[Console Info] "); // console info + break; + case LOG_LEVEL_DEBUG: + LogString(logLevel, "[Console Debug] "); // console debug + break; + case LOG_LEVEL_TRACE: + LogString(logLevel, "[Console Trace] "); // console trace, this is not supported yet + break; + case LOG_LEVEL_NONE: + LogString(logLevel, "[Console Debug] "); // console.log(), default apply the DEBUG level + break; + default: // just return for not supported log level + break; + } +} + +/** + * @brief: the str to print out. + * + * @param str the string to print out + */ +void LogString(const LogLevel logLevel, const char * const str) +{ + if (str == nullptr) { + return; + } +#if defined(FEATURE_ACELITE_HI_LOG_PRINTF) || defined(FEATURE_USER_MC_LOG_PRINTF) + size_t strLength = strlen(str); + for (size_t i = 0; i < strLength; i++) { + LogChar(str[i], logLevel, false); + } +#else + Output(logLevel, str, strlen(str)); +#endif +} + +static char logBuffer[LOG_BUFFER_SIZE] = {0}; +static uint16_t logBufferIndex = 0; + +void LogChar(char c, const LogLevel logLevel, bool endFlag) +{ + logBuffer[logBufferIndex++] = c; + if ((logBufferIndex == (LOG_BUFFER_SIZE - 1)) || (c == '\n')) { + if ((c == '\n') && (logBufferIndex > 0)) { + logBufferIndex--; // will trace out line seperator after print the content out + } + logBuffer[logBufferIndex] = '\0'; + Output(logLevel, logBuffer, logBufferIndex); + logBufferIndex = 0; + if (c == '\n' || !endFlag) { + // this is the newline during the console log, need to append the loglevel prefix, + // example: console.log("aa\nbb"); +#if !defined(FEATURE_ACELITE_HI_LOG_PRINTF) && !defined(FEATURE_USER_MC_LOG_PRINTF) + Output(logLevel, "\n", 1); // hilog will trace our the line seperator directly +#endif + if (!endFlag) { + LogOutLevel(logLevel); + } + } + } +} + +#ifdef FEATURE_ACELITE_HI_LOG_PRINTF +static void OutputToHiLog(const LogLevel logLevel, const char * const str) +{ + switch (logLevel) { + case LOG_LEVEL_ERR: + HILOG_ERROR(HILOG_MODULE_APP, "%{public}s", str); + break; + case LOG_LEVEL_WARN: + HILOG_WARN(HILOG_MODULE_APP, "%{public}s", str); + break; + case LOG_LEVEL_INFO: + HILOG_INFO(HILOG_MODULE_APP, "%{public}s", str); + break; + case LOG_LEVEL_DEBUG: + HILOG_DEBUG(HILOG_MODULE_APP, "%{public}s", str); + break; + case LOG_LEVEL_TRACE: + HILOG_INFO(HILOG_MODULE_APP, "%{public}s", str); + break; + case LOG_LEVEL_NONE: + HILOG_DEBUG(HILOG_MODULE_APP, "%{public}s", str); + break; + default: + break; + } +} +#elif defined(FEATURE_USER_MC_LOG_PRINTF) +static void OutputToHiLog(const LogLevel logLevel, const char * const str) +{ + switch (logLevel) { + case LOG_LEVEL_ERR: + HILOG_ERROR_JS(str); + break; + case LOG_LEVEL_WARN: + HILOG_WARN_JS(str); + break; + case LOG_LEVEL_INFO: + HILOG_INFO_JS(str); + break; + case LOG_LEVEL_DEBUG: + HILOG_DEBUG_JS(str); + break; + case LOG_LEVEL_TRACE: + HILOG_INFO_JS(str); + break; + case LOG_LEVEL_NONE: + HILOG_DEBUG_JS(str); + break; + default: + break; + } +} +#endif + +void Output(const LogLevel logLevel, const char * const str, const uint8_t length) +{ + if (str == nullptr) { + return; + } + (void)length; + Debugger::GetInstance().Output(str); +#if defined(FEATURE_ACELITE_HI_LOG_PRINTF) || defined(FEATURE_USER_MC_LOG_PRINTF) + OutputToHiLog(logLevel, str); +#endif +} + +void FlushOutput() +{ + Debugger::GetInstance().FlushOutput(); +} +} // namespace ACELite +} // namespace OHOS + +#endif // ENABLED(CONSOLE_LOG_OUTPUT) diff --git a/src/core/modules/presets/console_log_impl.h b/src/core/modules/presets/console_log_impl.h new file mode 100755 index 0000000..7f44258 --- /dev/null +++ b/src/core/modules/presets/console_log_impl.h @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2020 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. + */ + +#ifndef OHOS_ACELITE_CONSOLE_LOG_IMPL_H +#define OHOS_ACELITE_CONSOLE_LOG_IMPL_H + +#include "acelite_config.h" +#include "js_config.h" + +#if ENABLED(CONSOLE_LOG_OUTPUT) + +#include "jerryscript.h" + +namespace OHOS { +namespace ACELite { +/** + * The log level definations. + */ +enum LogLevel { + LOG_LEVEL_FATAL, // fatal, no console.fatal + LOG_LEVEL_ERR, // console.error + LOG_LEVEL_WARN, // console.warn + LOG_LEVEL_INFO, // console.info + LOG_LEVEL_DEBUG, // console.debug + LOG_LEVEL_TRACE, // console.trace + LOG_LEVEL_NONE, // console.log +}; + +/** + * @brief: the str to print out. + * + * @param logLevel the log level + * @param str the string to print out + */ +void LogString(const LogLevel logLevel, const char * const str); + +/** + * @brief: Output given string into stdout or the log file. + * + * @param logLevel the log level + * @param str the string to print + * @param length the string's length + */ +void Output(const LogLevel logLevel, const char * const str, const uint8_t length); + +/** + * @brief: Flush the output. + */ +void FlushOutput(); + +/** + * @fn ConsoleModule::LogNative() + * + * @brief The real implementation for all console log function, same implementation with the jerry's default IO. + * + * @param logLevel the log level, please refer to LogNative definations + * @param func function object + * @param context the context of function execution + * @param args the list of arguments + * @param length the length of arguments list + */ +jerry_value_t LogNative(const LogLevel logLevel, + const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t* args, + const jerry_length_t length); + +/** + * @brief: Print log level if needed. + * + * @param logLevel the log level + */ +void LogOutLevel(const LogLevel logLevel); + +/** + * @brief: Log a single character to standard output or the log buffer. + * If log to buffer, will flush to file or stdout when '\n' or buffer is full. + * + * @param c the character to print + * @param logLevel the loglevel, need to output if c is '\n' + * @param endFlag the flag presents if this is the end of the console log, default is false + */ +void LogChar(char c, const LogLevel logLevel, bool endFlag = false); +} // namespace ACELite +} // namespace OHOS +#endif // ENABLED(CONSOLE_LOG_OUTPUT) +#endif // OHOS_ACELITE_CONSOLE_LOG_IMPL_H diff --git a/src/core/modules/presets/console_module.cpp b/src/core/modules/presets/console_module.cpp new file mode 100755 index 0000000..67f1c55 --- /dev/null +++ b/src/core/modules/presets/console_module.cpp @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2020 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. + */ + +#include "presets/console_module.h" +#if (defined(_WIN32) || defined(_WIN64)) +#include "handler.h" +#endif /* defined(_WIN32) || defined(_WIN64) */ +#if ENABLED(CONSOLE_LOG_OUTPUT) +#include "presets/console_log_impl.h" +#endif // ENABLED(CONSOLE_LOG_OUTPUT) + +namespace OHOS { +namespace ACELite { +void ConsoleModule::Init() +{ + const char * const debug = "debug"; + const char * const info = "info"; + const char * const warn = "warn"; + const char * const log = "log"; + const char * const error = "error"; + CreateNamedFunction(debug, LogDebug); + CreateNamedFunction(info, LogInfo); + CreateNamedFunction(warn, LogWarn); + CreateNamedFunction(log, Log); + CreateNamedFunction(error, LogError); +} + +jerry_value_t ConsoleModule::LogDebug(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t* args, + const jerry_length_t length) +{ +#if DISABLED(CONSOLE_LOG_OUTPUT) + return UNDEFINED; +#else + return LogNative(LOG_LEVEL_DEBUG, func, context, args, length); +#endif /* !defined(_WIN32) && !defined(_WIN64) */ +} + +jerry_value_t ConsoleModule::LogInfo(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t* args, + const jerry_length_t length) +{ +#if DISABLED(CONSOLE_LOG_OUTPUT) + return UNDEFINED; +#else + return LogNative(LOG_LEVEL_INFO, func, context, args, length); +#endif /* !defined(_WIN32) && !defined(_WIN64) */ +} + +jerry_value_t ConsoleModule::LogWarn(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t* args, + const jerry_length_t length) +{ +#if DISABLED(CONSOLE_LOG_OUTPUT) + return UNDEFINED; +#else + return LogNative(LOG_LEVEL_WARN, func, context, args, length); +#endif /* !defined(_WIN32) && !defined(_WIN64) */ +} + +jerry_value_t ConsoleModule::Log(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t* args, + const jerry_length_t length) +{ +#if DISABLED(CONSOLE_LOG_OUTPUT) + return UNDEFINED; +#else + return LogNative(LOG_LEVEL_NONE, func, context, args, length); +#endif /* !defined(_WIN32) && !defined(_WIN64) */ +} + +jerry_value_t ConsoleModule::LogError(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t* args, + const jerry_length_t length) +{ +#if DISABLED(CONSOLE_LOG_OUTPUT) + return UNDEFINED; +#else + return LogNative(LOG_LEVEL_ERR, func, context, args, length); +#endif /* !defined(_WIN32) && !defined(_WIN64) */ +} +} // namespace ACELite +} // namespace OHOS diff --git a/src/core/modules/presets/console_module.h b/src/core/modules/presets/console_module.h new file mode 100755 index 0000000..feb23fc --- /dev/null +++ b/src/core/modules/presets/console_module.h @@ -0,0 +1,123 @@ +/* + * Copyright (c) 2020 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. + */ +#ifndef OHOS_ACELITE_CONSOLE_MODULE_H +#define OHOS_ACELITE_CONSOLE_MODULE_H + +#include "non_copyable.h" +#include "presets/preset_module.h" + +namespace OHOS { +namespace ACELite { +static constexpr char console[] = "console"; +class ConsoleModule final : public PresetModule { +public: + ACE_DISALLOW_COPY_AND_MOVE(ConsoleModule); + /** + * @fn ConsoleModule::ConsoleModule() + * + * @brief Constructor. + */ + ConsoleModule() : PresetModule(console) {} + + /** + * @fn ConsoleModule::~ConsoleModule() + * + * @brief Constructor. + */ + ~ConsoleModule() = default; + + void Init() override; + + static void Load() + { + ConsoleModule consoleModule; + consoleModule.Init(); + } + +private: + /** + * @fn ConsoleModule::LogDebug() + * + * @brief Outputs a message to the console with the log level "debug". + * @param func function object + * @param context the context of function execution + * @param args the list of arguments + * @param length the length of arguments list + */ + static jerry_value_t LogDebug(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t* args, + const jerry_length_t length); + + /** + * @fn ConsoleModule::LogInfo() + * + * @brief Outputs a message to the console with the log level "info". + * @param func function object + * @param context the context of function execution + * @param args the list of arguments + * @param length the length of arguments list + */ + static jerry_value_t LogInfo(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t* args, + const jerry_length_t length); + + /** + * @fn ConsoleModule::LogWarn() + * + * @brief Outputs a message to the console with the log level "warn". + * @param func function object + * @param context the context of function execution + * @param args the list of arguments + * @param length the length of arguments list + */ + static jerry_value_t LogWarn(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t* args, + const jerry_length_t length); + + /** + * @fn ConsoleModule::Log() + * + * @brief Outputs a message to the console with the log level "log". + * @param func function object + * @param context the context of function execution + * @param args the list of arguments + * @param length the length of arguments list + */ + static jerry_value_t Log(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t* args, + const jerry_length_t length); + + /** + * @fn ConsoleModule::LogError() + * + * @brief Outputs a message to the console with the log level "error". + * @param func function object + * @param context the context of function execution + * @param args the list of arguments + * @param length the length of arguments list + */ + static jerry_value_t LogError(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t* args, + const jerry_length_t length); +}; +} // namespace ACELite +} // namespace OHOS + +#endif // OHOS_ACELITE_CONSOLE_MODULE_H diff --git a/src/core/modules/presets/feature_ability_module.cpp b/src/core/modules/presets/feature_ability_module.cpp new file mode 100755 index 0000000..bb08ed6 --- /dev/null +++ b/src/core/modules/presets/feature_ability_module.cpp @@ -0,0 +1,408 @@ +/* + * Copyright (c) 2020 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. + */ + +#include "feature_ability_module.h" +#ifdef FEATURE_FEATURE_ABILITY_MODULE +#include "ace_event_error_code.h" +#include "ace_log.h" +#include "fatal_handler.h" +#include "js_app_context.h" +#include "js_async_work.h" +#include "js_fwk_common.h" +#if ENABLED(SECURE_C_FUNCTION) +#include "securec.h" +#endif // ENABLED(SECURE_C_FUNCTION) + +namespace OHOS { +namespace ACELite { +constexpr char FUNC_SUBSCRIBE[] = "subscribeMsg"; +constexpr char FUNC_UNSUBSCRIBE[] = "unsubscribeMsg"; +constexpr char FUNC_SEND_MSG[] = "sendMsg"; +constexpr char ATTR_DEVICE_ID[] = "deviceId"; +constexpr char ATTR_BUNDLE_NAME[] = "bundleName"; +constexpr char ATTR_ABILITY_NAME[] = "abilityName"; +constexpr char ATTR_MESSAGE[] = "message"; +constexpr char ERR_MESSAGE[] = "Invalid parameter"; +constexpr char ERR_SEND_FAIL[] = "Send message fail"; +constexpr uint8_t ARG_LENGTH_SUCCESS = 1; +constexpr uint8_t ARG_LENGTH_FAIL = 2; +constexpr uint16_t ERR_CODE_INVALID_PARAMETER = 202; +constexpr uint16_t ERR_CODE_SEND_MSG_FAILED = 2060; +jerry_value_t FeatureAbilityModule::callbackContext_; +jerry_value_t FeatureAbilityModule::successCallback_; +jerry_value_t FeatureAbilityModule::failCallback_; +bool FeatureAbilityModule::registed = false; +void FeatureAbilityModule::Init() +{ + callbackContext_ = UNDEFINED; + successCallback_ = UNDEFINED; + failCallback_ = UNDEFINED; + CreateNamedFunction(FUNC_SUBSCRIBE, SubscribeMessage); + CreateNamedFunction(FUNC_UNSUBSCRIBE, UnsubscribeMessage); + CreateNamedFunction(FUNC_SEND_MSG, SendMsgToPeer); +} + +void FeatureAbilityModule::Release() +{ + ReleaseJsValues(); + if (registed) { + char *bundleName = const_cast(JsAppContext::GetInstance()->GetCurrentBundleName()); + AbilityKit::UnregisterReceiver(bundleName); + registed = false; + } +} + +void FeatureAbilityModule::SyncFailCallback(jerry_value_t &failCb, + const jerry_value_t &context, + const char * const data, + uint16_t errorCode) +{ + const char * const emptyStr = ""; + jerry_value_t args[ARG_LENGTH_FAIL]; + jerry_value_t cbContext = jerry_acquire_value(context); + if (data == nullptr) { + args[0] = jerry_create_string(reinterpret_cast(emptyStr)); + } else { + args[0] = jerry_create_string(reinterpret_cast(data)); + } + args[1] = jerry_create_number(errorCode); + CallJSFunctionAutoRelease(failCb, callbackContext_, args, ARG_LENGTH_FAIL); + ReleaseJerryValue(args[0], args[1], cbContext, VA_ARG_END_FLAG); +} +void FeatureAbilityModule::SyncSendMsgCallback(const jerry_value_t &arg, + const jerry_value_t &context, + const char *errMsg, + const uint16_t errCode, + bool success) +{ + if (success) { + jerry_value_t successCbValue = jerryx_get_property_str(arg, ATTR_SUCCESS); + if (jerry_value_is_function(successCbValue)) { + CallJSFunctionAutoRelease(successCbValue, context, nullptr, 0); + } + jerry_release_value(successCbValue); + } else { + jerry_value_t failCbValue = jerryx_get_property_str(arg, ATTR_FAIL); + if (jerry_value_is_function(failCbValue)) { + SyncFailCallback(failCbValue, context, errMsg, errCode); + } + jerry_release_value(failCbValue); + } + + jerry_value_t cmpltCbValue = jerryx_get_property_str(arg, ATTR_COMPLETE); + if (jerry_value_is_function(cmpltCbValue)) { + CallJSFunctionAutoRelease(cmpltCbValue, context, nullptr, 0); + } + jerry_release_value(cmpltCbValue); +} + +jerry_value_t FeatureAbilityModule::SendMsgToPeer(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t args[], + const jerry_length_t length) +{ + if (length <= 0) { + return UNDEFINED; + } + + uint16_t nameLength = 0; + jerry_value_t nameValue = jerryx_get_property_str(args[0], ATTR_BUNDLE_NAME); + char *dstBundleName = MallocStringOf(nameValue, &nameLength); + + uint16_t msgLength = 0; + jerry_value_t msgValue = jerryx_get_property_str(args[0], ATTR_MESSAGE); + char *message = MallocStringOf(msgValue, &msgLength); + + uint16_t idLength = 0; + jerry_value_t devIdValue = jerryx_get_property_str(args[0], ATTR_DEVICE_ID); + char *deviceId = MallocStringOf(devIdValue, &idLength); + if ((dstBundleName == nullptr) || (nameLength == 0) || (message == nullptr) || (msgLength == 0) || + (deviceId == nullptr)) { + SyncSendMsgCallback(args[0], context, ERR_MESSAGE, ERR_CODE_INVALID_PARAMETER, false); + } else { + char *bundleName = const_cast(JsAppContext::GetInstance()->GetCurrentBundleName()); + int32_t ret = AbilityKit::SendMsgToPeerApp((idLength == 0), bundleName, dstBundleName, + (reinterpret_cast(message)), strlen(message)); + if (ret == 0) { + SyncSendMsgCallback(args[0], context, nullptr, 0, true); + } else { + SyncSendMsgCallback(args[0], context, ERR_SEND_FAIL, ERR_CODE_SEND_MSG_FAILED, false); + } + } + ReleaseJerryValue(nameValue, msgValue, devIdValue, VA_ARG_END_FLAG); + ACE_FREE(dstBundleName); + ACE_FREE(message); + ACE_FREE(deviceId); + return UNDEFINED; +} + +jerry_value_t FeatureAbilityModule::SubscribeMessage(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t args[], + const jerry_length_t length) +{ + if (length <= 0) { + return UNDEFINED; + } + + ReleaseJsValues(); + + callbackContext_ = jerry_acquire_value(context); + jerry_value_t options = args[0]; + jerry_value_t successCallback = jerryx_get_property_str(options, ATTR_SUCCESS); + if (!IS_UNDEFINED(successCallback)) { + if (!jerry_value_is_function(successCallback)) { + HILOG_ERROR(HILOG_MODULE_ACE, "the success callback should be a function."); + } else { + successCallback_ = jerry_acquire_value(successCallback); + } + } + jerry_release_value(successCallback); + jerry_value_t failCallback = jerryx_get_property_str(options, ATTR_FAIL); + if (!IS_UNDEFINED(failCallback)) { + if (!jerry_value_is_function(failCallback)) { + HILOG_ERROR(HILOG_MODULE_ACE, "the fail callback should be a function."); + } else { + failCallback_ = jerry_acquire_value(failCallback); + } + } + jerry_release_value(failCallback); + + if (!registed) { + char *bundleName = const_cast(JsAppContext::GetInstance()->GetCurrentBundleName()); + AbilityKit::RegisterReceiver(bundleName, MessageSuccessCallback, MessageFailCallback); + registed = true; + } + + return UNDEFINED; +} + +jerry_value_t FeatureAbilityModule::UnsubscribeMessage(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t args[], + const jerry_length_t length) +{ + Release(); + ACE_FEATURE_EVENT_PRINT(MT_ACE_FEATUREABILITY, MT_ACE_FEATUREABILITY_UNSUBSCRIBEMSG, 0); + return UNDEFINED; +} + +int32_t FeatureAbilityModule::MessageSuccessCallback(void *data) +{ + if (FatalHandler::GetInstance().IsFatalErrorHitted()) { + HILOG_ERROR(HILOG_MODULE_ACE, "drop message as handling fatal error"); + return -1; + } + if (data == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "message error"); + return -1; + } else { + ACE_FEATURE_EVENT_PRINT(MT_ACE_FEATUREABILITY, MT_ACE_FEATUREABILITY_SUBSCRIBEMSG, 0); + FeatureAbilityDataInfo *origin = static_cast(data); + FeatureAbilityDataInfo *target = + static_cast(ace_malloc(sizeof(FeatureAbilityDataInfo))); + if (target == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "Failed to ace_malloc data"); + return -1; + } +#if ENABLED(SECURE_C_FUNCTION) + if (memset_s(target, sizeof(FeatureAbilityDataInfo), 0, sizeof(FeatureAbilityDataInfo)) != 0) { + HILOG_ERROR(HILOG_MODULE_ACE, "MessageSuccessCallback memset_s failed"); + ACE_FREE(target); + return -1; + } +#else + target->deviceID = nullptr; + target->bundleName = nullptr; + target->abilityName = nullptr; + target->messageLength = 0; + target->message = nullptr; +#endif + CopySuccessMessage(origin, target); + if (!JsAsyncWork::DispatchAsyncWork(AsyncSuccessCallback, target)) { + ACE_FREE(target->deviceID); + ACE_FREE(target->bundleName); + ACE_FREE(target->abilityName); + ACE_FREE(target->message); + ACE_FREE(target); + } + } + + return 0; +} +void FeatureAbilityModule::CopySuccessMessage(FeatureAbilityDataInfo *origin, FeatureAbilityDataInfo *&target) +{ + size_t bufSize = 0; + if (origin->deviceID != nullptr) { + bufSize = strlen(origin->deviceID); + if (bufSize < DEVICE_ID_LENGTH_MAX) { + target->deviceID = static_cast(ace_malloc(sizeof(char) * (bufSize + 1))); + if (target->deviceID != nullptr && memcpy_s(target->deviceID, bufSize, origin->deviceID, bufSize) == 0) { + target->deviceID[bufSize] = '\0'; + } else { + ACE_FREE(target->deviceID); + } + } + } + + if (origin->bundleName != nullptr) { + bufSize = strlen(origin->bundleName); + if (bufSize < NAME_LENGTH_MAX) { + target->bundleName = static_cast(ace_malloc(sizeof(char) * (bufSize + 1))); + if (target->bundleName != nullptr && + memcpy_s(target->bundleName, bufSize, origin->bundleName, bufSize) == 0) { + target->bundleName[bufSize] = '\0'; + } else { + ACE_FREE(target->bundleName); + } + } + } + + if (origin->abilityName != nullptr) { + bufSize = strlen(origin->abilityName); + if (bufSize < NAME_LENGTH_MAX) { + target->abilityName = static_cast(ace_malloc(sizeof(char) * (bufSize + 1))); + if (target->abilityName != nullptr && + memcpy_s(target->abilityName, bufSize, origin->abilityName, bufSize) == 0) { + target->abilityName[bufSize] = '\0'; + } else { + ACE_FREE(target->abilityName); + } + } + } + + if ((origin->message != nullptr) && (origin->messageLength > 0) && (origin->messageLength < UINT16_MAX)) { + bufSize = origin->messageLength; + char *buffer = static_cast(ace_malloc(sizeof(char) * (bufSize + 1))); + if (buffer != nullptr && memcpy_s(buffer, bufSize, static_cast(origin->message), bufSize) == 0) { + buffer[bufSize] = '\0'; + target->messageLength = bufSize; + target->message = buffer; + } else { + ACE_FREE(buffer); + target->messageLength = 0; + target->message = nullptr; + } + } +} +int32_t FeatureAbilityModule::MessageFailCallback(void *data, uint16_t dataLength, uint16_t errorCode) +{ + if (FatalHandler::GetInstance().IsFatalErrorHitted()) { + HILOG_ERROR(HILOG_MODULE_ACE, "drop message as handling fatal error"); + return -1; + } + FailCallbackParams *params = new FailCallbackParams(); + if (params == nullptr) { + return -1; + } + if ((data != nullptr) && (dataLength > 0)) { + char *buffer = static_cast(ace_malloc(sizeof(char) * (dataLength + 1))); + if (buffer != nullptr && memcpy_s(buffer, dataLength, static_cast(data), dataLength) == 0) { + buffer[dataLength] = '\0'; + params->dataLength = dataLength; + params->data = buffer; + } else { + ACE_FREE(buffer); + params->dataLength = 0; + params->data = nullptr; + } + } + params->errorCode = errorCode; + + if (!JsAsyncWork::DispatchAsyncWork(AsyncFailCallback, static_cast(params))) { + ACE_FREE(params->data); + delete params; + params = nullptr; + } + return 0; +} + +void FeatureAbilityModule::AsyncSuccessCallback(void *data) +{ + if (data == nullptr) { + CallJSFunctionAutoRelease(successCallback_, callbackContext_, nullptr, 0); + return; + } + + FeatureAbilityDataInfo *nativeData = static_cast(data); + jerry_value_t object = jerry_create_object(); + if (nativeData->deviceID != nullptr) { + JerrySetStringProperty(object, ATTR_DEVICE_ID, nativeData->deviceID); + ace_free(nativeData->deviceID); + nativeData->deviceID = nullptr; + } + if (nativeData->bundleName != nullptr) { + JerrySetStringProperty(object, ATTR_BUNDLE_NAME, nativeData->bundleName); + ace_free(nativeData->bundleName); + nativeData->bundleName = nullptr; + } + if (nativeData->abilityName != nullptr) { + JerrySetStringProperty(object, ATTR_ABILITY_NAME, nativeData->abilityName); + ace_free(nativeData->abilityName); + nativeData->abilityName = nullptr; + } + if ((nativeData->message != nullptr) && (nativeData->messageLength > 0)) { + JerrySetStringProperty(object, ATTR_MESSAGE, static_cast(nativeData->message), + nativeData->messageLength); + ace_free(nativeData->message); + nativeData->message = nullptr; + } + + jerry_value_t args[ARG_LENGTH_SUCCESS] = {object}; + CallJSFunctionAutoRelease(successCallback_, callbackContext_, args, ARG_LENGTH_SUCCESS); + jerry_release_value(object); + ace_free(nativeData); + nativeData = nullptr; +} +void FeatureAbilityModule::AsyncFailCallback(void *data) +{ + if (data == nullptr) { + return; + } + + FailCallbackParams *params = static_cast(data); + jerry_value_t args[ARG_LENGTH_FAIL]; + if (params->data == nullptr || params->dataLength <= 0) { + args[0] = jerry_create_string(reinterpret_cast("")); + } else { + args[0] = jerry_create_string_sz_from_utf8(static_cast(params->data), params->dataLength); + ace_free(params->data); + params->data = nullptr; + } + + args[1] = jerry_create_number(params->errorCode); + CallJSFunctionAutoRelease(failCallback_, callbackContext_, args, ARG_LENGTH_FAIL); + ReleaseJerryValue(args[0], args[1], VA_ARG_END_FLAG); + delete (params); + params = nullptr; +} + +void FeatureAbilityModule::ReleaseJsValues() +{ + ReleaseJsValue(callbackContext_); + ReleaseJsValue(successCallback_); + ReleaseJsValue(failCallback_); +} + +void FeatureAbilityModule::ReleaseJsValue(jerry_value_t &value) +{ + if (!IS_UNDEFINED(value)) { + jerry_release_value(value); + value = UNDEFINED; + } +} +} // namespace ACELite +} // namespace OHOS +#endif diff --git a/src/core/modules/presets/feature_ability_module.h b/src/core/modules/presets/feature_ability_module.h new file mode 100755 index 0000000..7cb94fe --- /dev/null +++ b/src/core/modules/presets/feature_ability_module.h @@ -0,0 +1,170 @@ +/* + * Copyright (c) 2020 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. + */ + +#ifndef OHOS_ACELITE_FEATURE_ABILITY_MODULE_H +#define OHOS_ACELITE_FEATURE_ABILITY_MODULE_H + +#include "acelite_config.h" +#include "non_copyable.h" + +#ifdef FEATURE_FEATURE_ABILITY_MODULE +#include "ability_kit.h" +#include "presets/preset_module.h" +namespace OHOS { +namespace ACELite { +static constexpr char FEATURE_ABILITY[] = "FeatureAbility"; +struct FailCallbackParams : public MemoryHeap { + void *data; + uint16_t dataLength; + uint16_t errorCode; + FailCallbackParams() : data(nullptr), dataLength(0), errorCode(0) {} + ACE_DISALLOW_COPY_AND_MOVE(FailCallbackParams); +}; +class FeatureAbilityModule final : public PresetModule { +public: + ACE_DISALLOW_COPY_AND_MOVE(FeatureAbilityModule); + /** + * @fn FeatureAbilityModule::FeatureAbilityModule() + * + * @brief Constructor. + */ + FeatureAbilityModule() : PresetModule(FEATURE_ABILITY) {} + + /** + * @fn FeatureAbilityModule::~FeatureAbilityModule() + * + * @brief Constructor. + */ + ~FeatureAbilityModule() = default; + + void Init() override; + + static void Release(); + +private: + /** + * @fn FeatureAbilityModule::SubscribeMessage + * + * @brief subscribe message which comes from other device + * @param func function object + * @param context the context of function execution + * @param args the list of arguments + * @param length the length of arguments list + */ + static jerry_value_t SubscribeMessage(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t args[], + const jerry_length_t length); + + /** + * @fn FeatureAbilityModule::UnsubscribeMessage + * + * @brief unsubscribe message which comes from other device + * @param func function object + * @param context the context of function execution + * @param args the list of arguments + * @param length the length of arguments list + */ + static jerry_value_t UnsubscribeMessage(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t args[], + const jerry_length_t length); + + /** + * @fn FeatureAbilityModule::SendMsgToPeer + * + * @brief send message to phone app + * @param func function object + * @param context the context of function execution + * @param args the list of arguments + * @param length the length of arguments list + */ + static jerry_value_t SendMsgToPeer(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t args[], + const jerry_length_t length); + + static void SyncFailCallback(jerry_value_t &failCb, + const jerry_value_t &context, + const char * const data, + uint16_t errorCode); + + static void SyncSendMsgCallback(const jerry_value_t &arg, + const jerry_value_t &context, + const char *errMsg, + const uint16_t errCode, + bool success); + + static int32_t MessageSuccessCallback(void *data); + + static void CopySuccessMessage(FeatureAbilityDataInfo *origin, FeatureAbilityDataInfo *&target); + + static int32_t MessageFailCallback(void *data, uint16_t dataLength, uint16_t errorCode); + + static void AsyncSuccessCallback(void *data); + + static void AsyncFailCallback(void *data); + + static void ReleaseJsValues(); + + static void ReleaseJsValue(jerry_value_t &value); + + /** + * the execute context of callback + */ + static jerry_value_t callbackContext_; + + /** + * success callback + */ + static jerry_value_t successCallback_; + + /** + * fail callback + */ + static jerry_value_t failCallback_; + + /** + * register callback whether of not + */ + static bool registed; +}; +} // namespace ACELite +} // namespace OHOS +#endif +namespace OHOS { +namespace ACELite { +class FeaAbilityModule final { +public: + ACE_DISALLOW_COPY_AND_MOVE(FeaAbilityModule); + FeaAbilityModule() = default; + ~FeaAbilityModule() = default; + static void Load() + { +#ifdef FEATURE_FEATURE_ABILITY_MODULE + FeatureAbilityModule featureAbilityModule; + featureAbilityModule.Init(); +#endif + } + static void Release() + { +#ifdef FEATURE_FEATURE_ABILITY_MODULE + FeatureAbilityModule::Release(); +#endif + } +}; +} // namespace ACELite +} // namespace OHOS +#endif // OHOS_ACELITE_FEATURE_ABILITY_MODULE_H diff --git a/src/core/modules/presets/jstest_module.cpp b/src/core/modules/presets/jstest_module.cpp new file mode 100755 index 0000000..af4aa3f --- /dev/null +++ b/src/core/modules/presets/jstest_module.cpp @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2020 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. + */ +#include "jstest_module.h" +#if (defined(JSFWK_TEST) && defined(OHOS_ACELITE_PRODUCT_WATCH)) +#include +#include "ace_mem_base.h" +#include "test_fwk.h" +namespace OHOS { +namespace ACELite { +void JSTestModule::Init() +{ + const char * const funcName = "jstestPrint"; + CreateNamedFunction(funcName, JSTestPrint); +} + +jerry_value_t JSTestModule::JSTestPrint(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t *args, + const jerry_length_t argsNum) +{ + if (argsNum == 0) { + return UNDEFINED; + } + + char *msg = MallocStringOf(args[0]); + + if (msg != nullptr) { + LiteTestPrint(msg); + ace_free(msg); + msg = nullptr; + } + + return UNDEFINED; +} +} // namespace ACELite +} // namespace OHOS +#endif \ No newline at end of file diff --git a/src/core/modules/presets/jstest_module.h b/src/core/modules/presets/jstest_module.h new file mode 100755 index 0000000..91b2531 --- /dev/null +++ b/src/core/modules/presets/jstest_module.h @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2020 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. + */ +#ifndef OHOS_ACELITE_JSTEST_MODULE_H +#define OHOS_ACELITE_JSTEST_MODULE_H + +#include "acelite_config.h" +#include "non_copyable.h" +#if (defined(JSFWK_TEST) && defined(OHOS_ACELITE_PRODUCT_WATCH)) +#include "presets/preset_module.h" +namespace OHOS { +namespace ACELite { +class JSTestModule final : public PresetModule { +public: + /** + * @fn JSTestModule::JSTestModule() + * + * @brief Constructor. + */ + JSTestModule() : PresetModule(nullptr) {} + + /** + * @fn JSTestModule::~JSTestModule() + * + * @brief Constructor. + */ + ~JSTestModule() = default; + + void Init() override; + +private: + static jerry_value_t JSTestPrint(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t *args, + const jerry_length_t argsNum); +}; +} // namespace ACELite +} // namespace OHOS +#endif +namespace OHOS { +namespace ACELite { +class JsTestModule final { +public: + ACE_DISALLOW_COPY_AND_MOVE(JsTestModule); + JsTestModule() = default; + ~JsTestModule() = default; + static void Load() + { +#if (defined(JSFWK_TEST) && defined(OHOS_ACELITE_PRODUCT_WATCH)) + JSTestModule jsTestModule; + jsTestModule.Init(); +#endif + } +}; +} // namespace ACELite +} // namespace OHOS +#endif // OHOS_ACELITE_JSTEST_MODULE_H diff --git a/src/core/modules/presets/localization_module.cpp b/src/core/modules/presets/localization_module.cpp new file mode 100755 index 0000000..b4983aa --- /dev/null +++ b/src/core/modules/presets/localization_module.cpp @@ -0,0 +1,171 @@ +/* + * Copyright (c) 2020 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. + */ + +#include "localization_module.h" +#include "ace_event_error_code.h" +#ifdef FEATURE_LOCALIZATION_MODULE +#include "ace_log.h" +#if (defined(_WIN32) || defined(_WIN64)) +#include +#else +#include "securec.h" +#endif +#include "file.h" +#include "js_fwk_common.h" +#include + +namespace OHOS { +namespace ACELite { +void LocalizationModule::Init() +{ + jerry_value_t globalContext = jerry_get_global_object(); + const char * const name = "ViewModel"; + jerry_value_t propertyName = jerry_create_string(reinterpret_cast(name)); + if (JerryHasProperty(globalContext, propertyName)) { + // get the prototype of AbilitySlice + jerry_value_t currentApp = jerry_get_property(globalContext, propertyName); + jerry_value_t protoType = jerryx_get_property_str(currentApp, "prototype"); + // register $t to the prototype of abilitySlice + jerry_value_t functionHandle = jerry_create_external_function(Translate); + const char * const propName = "$t"; + JerrySetNamedProperty(protoType, propName, functionHandle); + // register $tc to the prototype of abilitySlice +#ifdef LOCALIZATION_PLURAL + jerry_value_t pluralHandle = jerry_create_external_function(TranslatePlural); + const char * const pluralFuncName = "$tc"; + JerrySetNamedProperty(protoType, pluralFuncName, pluralHandle); + jerry_release_value(pluralHandle); +#endif // LOCALIZATION_PLURAL + ReleaseJerryValue(functionHandle, protoType, currentApp, VA_ARG_END_FLAG); + } else { + HILOG_ERROR(HILOG_MODULE_ACE, "app is not create."); + } + ReleaseJerryValue(propertyName, globalContext, VA_ARG_END_FLAG); +} + +void LocalizationModule::Clear() +{ + if (parser_ != nullptr) { + delete parser_; + parser_ = nullptr; + } + if (currentList_ != nullptr) { + cJSON_Delete(currentList_); + currentList_ = nullptr; + } +} + +#ifdef LOCALIZATION_PLURAL +jerry_value_t LocalizationModule::GetValueByKey(const jerry_value_t *args, const jerry_length_t argsNum, bool isPlural) +#else +jerry_value_t LocalizationModule::GetValueByKey(const jerry_value_t *args, const jerry_length_t argsNum) +#endif +{ + if (argsNum == 0) { + return UNDEFINED; + } + char *result = nullptr; + LocalizationModule *localization = GetInstance(); + char *param = MallocStringOf(args[0]); + if (param == nullptr) { + return UNDEFINED; + } + cJSON *currentItem = localization->GetJSONByKey(param); + if (currentItem == nullptr) { + jerry_value_t paramProp = jerry_create_string(reinterpret_cast(param)); + ace_free(param); + param = nullptr; + return paramProp; + } + jerry_value_t arg = UNDEFINED; + if (argsNum > 1) { + arg = args[1]; + } + if (currentItem->type == cJSON_String) { +#ifdef LOCALIZATION_PLURAL + result = localization->parser_->FillPlaceholder(currentItem->valuestring, arg, argsNum, isPlural); +#else + result = localization->parser_->FillPlaceholder(currentItem->valuestring, arg, argsNum); +#endif // LOCALIZATION_PLURAL + } else if (currentItem->type == cJSON_Object || (currentItem->type == cJSON_Array)) { + char* format = cJSON_Print(currentItem); +#ifdef LOCALIZATION_PLURAL + result = localization->parser_->FillPlaceholder(format, arg, argsNum, isPlural); +#else + result = localization->parser_->FillPlaceholder(format, arg, argsNum); +#endif // LOCALIZATION_PLURAL + if (format != nullptr) { + cJSON_free(format); + format = nullptr; + } + } + if (result != nullptr) { + ace_free(param); + param = nullptr; + } else { + // if currentItem is invalid, return the whole key.e.g.the currrentItem is nullptr + result = param; + } + jerry_value_t resultProp = jerry_create_string(reinterpret_cast(result)); + ACE_FREE(result); + cJSON_Delete(localization->currentList_); + localization->currentList_ = nullptr; + return resultProp; +} + +cJSON *LocalizationModule::GetJSONByKey(const char *key) +{ + char delemeter = '.'; + if (parser_ == nullptr) { + parser_ = new CJSONParser(); + if (parser_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "create json parser failed"); + return nullptr; + } + if (!parser_->Init()) { + ACE_ERROR_CODE_PRINT(EXCE_ACE_LOCALIZATION_FAILED, EXCE_ACE_LOCALIZATION_SYSTEM_LANGUAGE_NOT_INITIALIZED); + Clear(); // parser init failed, release the resource of this module + return nullptr; + } + } + + cJSON *curJsonItem = nullptr; + CJSONParser::ListNode *keySplited = nullptr; + // split the key by '.' + uint8_t keyCount = parser_->Split(key, delemeter, keySplited); + uint8_t curKeyIndex = 0; + // get the json object which defined the key + do { + if (curJsonItem == nullptr) { + curKeyIndex = 0; + // read the next json file and assign it to currentList_ + if (!parser_->ChangeJsonFile(currentList_)) { + break; + } + curJsonItem = currentList_; + } + // get the current splited key + char *message = CJSONParser::GetNode(keySplited, keyCount - curKeyIndex); + curJsonItem = cJSON_GetObjectItem(curJsonItem, message); + curKeyIndex++; + } while (!(curKeyIndex == keyCount && (curJsonItem != nullptr))); + CJSONParser::ClearNode(keySplited); + // reset the index of read file + parser_->ResetIndex(); + return curJsonItem; +} +} // namespace ACELite +} // namespace OHOS +#endif // LOCALIZATION_MODULE diff --git a/src/core/modules/presets/localization_module.h b/src/core/modules/presets/localization_module.h new file mode 100755 index 0000000..490a3eb --- /dev/null +++ b/src/core/modules/presets/localization_module.h @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2020 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. + */ +#ifndef OHOS_ACELITE_LOCALIZATION_MODULE_H +#define OHOS_ACELITE_LOCALIZATION_MODULE_H + +#include "acelite_config.h" +#include "non_copyable.h" +#ifdef FEATURE_LOCALIZATION_MODULE +#include "cjson_parser.h" +#include "presets/preset_module.h" +namespace OHOS { +namespace ACELite { +class LocalizationModule final { +public: + ACE_DISALLOW_COPY_AND_MOVE(LocalizationModule); + void Clear(); + + void Init(); + + static LocalizationModule *GetInstance() + { + static LocalizationModule localizationModule; + return &localizationModule; + } + static jerry_value_t Translate(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t *args, + const jerry_length_t argNum) + { +#ifdef LOCALIZATION_PLURAL + return GetValueByKey(args, argNum, false); +#else + return GetValueByKey(args, argNum); +#endif + } + + static jerry_value_t TranslatePlural(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t *args, + const jerry_length_t argNum) + { +#ifdef LOCALIZATION_PLURAL + return GetValueByKey(args, argNum, true); +#else + return GetValueByKey(args, argNum); +#endif + } + +#ifdef LOCALIZATION_PLURAL + static jerry_value_t GetValueByKey(const jerry_value_t *args, const jerry_length_t argsNum, bool isPlural); +#else + static jerry_value_t GetValueByKey(const jerry_value_t *args, const jerry_length_t argsNum); +#endif + +private: + LocalizationModule() : parser_(nullptr), currentList_(nullptr) {} + ~LocalizationModule() + { + Clear(); + } + cJSON *GetJSONByKey(const char *key); + CJSONParser *parser_; + cJSON *currentList_; +}; +} // namespace ACELite +} // namespace OHOS +#endif // LOCALIZATION_MODULE + +namespace OHOS { +namespace ACELite { +class LocalModule final { +public: + ACE_DISALLOW_COPY_AND_MOVE(LocalModule); + LocalModule() = default; + ~LocalModule() = default; + static void Load() + { +#ifdef FEATURE_LOCALIZATION_MODULE + LocalizationModule *localizationModule = LocalizationModule::GetInstance(); + localizationModule->Init(); +#endif + } + static void Clear() + { +#ifdef FEATURE_LOCALIZATION_MODULE + LocalizationModule *localization = LocalizationModule::GetInstance(); + localization->Clear(); +#endif + } +}; +} // namespace ACELite +} // namespace OHOS +#endif // OHOS_ACELITE_LOCALIZATION_MODULE_H diff --git a/src/core/modules/presets/preset_module.cpp b/src/core/modules/presets/preset_module.cpp new file mode 100755 index 0000000..d2afe57 --- /dev/null +++ b/src/core/modules/presets/preset_module.cpp @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2020 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. + */ + +#include "presets/preset_module.h" +#include +#include "ace_log.h" + +namespace OHOS { +namespace ACELite { +PresetModule::PresetModule(const char * const name) +{ + jerry_value_t globalObject = jerry_get_global_object(); + moduleName_ = const_cast(name); + if (moduleName_ != nullptr) { + module_ = jerry_create_object(); + JerrySetNamedProperty(globalObject, moduleName_, module_); + jerry_release_value(globalObject); + } else { + module_ = globalObject; + } +} + +PresetModule::~PresetModule() +{ + jerry_release_value(module_); +} + +void PresetModule::CreateNamedFunction(const char * const funcName, jerry_external_handler_t handler) +{ + if (funcName == nullptr) { + return; + } + JerrySetFuncProperty(module_, funcName, handler); +} +} // namespace ACELite +} // namespace OHOS diff --git a/src/core/modules/presets/preset_module.h b/src/core/modules/presets/preset_module.h new file mode 100755 index 0000000..b532e77 --- /dev/null +++ b/src/core/modules/presets/preset_module.h @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2020 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. + */ +#ifndef OHOS_ACELITE_PRESET_MODULE_H +#define OHOS_ACELITE_PRESET_MODULE_H + +#include "js_fwk_common.h" +#include "non_copyable.h" + +namespace OHOS { +namespace ACELite { +class PresetModule : public MemoryHeap { +public: + ACE_DISALLOW_COPY_AND_MOVE(PresetModule); + /** + * @fn PresetModule::PresetModule() + * + * @brief Constructor. + */ + PresetModule() = delete; + + /** + * @fn PresetModule::PresetModule(const char* name) + * + * @brief Constructor. + */ + PresetModule(const char * const name); + + /** + * @fn PresetModule::~PresetModule() + * + * @brief Destructor. + */ + ~PresetModule(); + + /** + * @fn PresetModule::Init + * + * @brief Initialize module + */ + virtual void Init() = 0; + +protected: + /** + * @fn PresetModule::CreateNamedFunction(char* funcName, jerry_external_handler_t handler) + * + * @brief create a new named function + * @param funcName the name of new function + * @param handler the handler of new function + */ + void CreateNamedFunction(const char * const funcName, jerry_external_handler_t handler); + +private: + jerry_value_t module_; + char* moduleName_; +}; +} // namespace ACELite +} // namespace OHOS + +#endif // OHOS_ACELITE_PRESET_MODULE_H diff --git a/src/core/modules/presets/profiler_module.cpp b/src/core/modules/presets/profiler_module.cpp new file mode 100755 index 0000000..33a8939 --- /dev/null +++ b/src/core/modules/presets/profiler_module.cpp @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2020 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. + */ +#include "profiler_module.h" +#if ENABLED(JS_PROFILER) +namespace OHOS { +namespace ACELite { +/** + * Useage: + * profiler.startTracing(5); + * xxxx + * profiler.stopTracing(); + * the parameter of profiler.startTracing must be one of PerformanceTag in js_profile.h + */ +void ProfilerModule::Init() +{ + const char * const startTracingFunc = "startTracing"; + const char * const stopTracingFunc = "stopTracing"; + CreateNamedFunction(startTracingFunc, StartTracing); + CreateNamedFunction(stopTracingFunc, StopTracing); +} + +jerry_value_t ProfilerModule::StartTracing(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t* args, + const jerry_length_t argsNum) +{ +#if ENABLED(JS_PROFILER) + if ((args == nullptr) || (argsNum < 1)) { + return UNDEFINED; + } + + uint8_t tag = (uint8_t)jerry_get_number_value(args[0]); + uint8_t component = 0; + uint16_t description = 0; + const uint8_t leastArgsNum = 2; + if (argsNum >= leastArgsNum) { + component = (uint8_t)jerry_get_number_value(args[1]); + } + const uint8_t jsArgsNum = 3; + if (argsNum == jsArgsNum) { + const uint8_t descriptionIndex = 2; + description = (uint16_t)jerry_get_number_value(args[descriptionIndex]); + } + + START_TRACING_WITH_EXTRA_INFO((PerformanceTag)tag, component, description); +#endif // ENABLED(JS_PROFILER) + return UNDEFINED; +} + +jerry_value_t ProfilerModule::StopTracing(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t* args, + const jerry_length_t argsNum) +{ +#if ENABLED(JS_PROFILER) + STOP_TRACING(); +#endif + return UNDEFINED; +} +} // namespace ACELite +} // namespace OHOS +#endif \ No newline at end of file diff --git a/src/core/modules/presets/profiler_module.h b/src/core/modules/presets/profiler_module.h new file mode 100755 index 0000000..c33751e --- /dev/null +++ b/src/core/modules/presets/profiler_module.h @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2020 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. + */ +#ifndef OHOS_ACELITE_PROFILER_MODULE_H +#define OHOS_ACELITE_PROFILER_MODULE_H + +#include "js_profiler.h" +#include "non_copyable.h" +#if ENABLED(JS_PROFILER) +#include "presets/preset_module.h" +namespace OHOS { +namespace ACELite { +static constexpr char profiler[] = "profiler"; +class ProfilerModule final : public PresetModule { +public: + ACE_DISALLOW_COPY_AND_MOVE(ProfilerModule); + /** + * @fn ProfilerModule::ProfilerModule() + * + * @brief Constructor. + */ + ProfilerModule() : PresetModule(profiler) {} + + /** + * @fn ProfilerModule::~ProfilerModule() + * + * @brief Constructor. + */ + ~ProfilerModule() = default; + + void Init() override; + +private: + /** + * @fn ProfilerModule::StartTracing() + * + * @brief request to start the tracing. + * @param func function object + * @param context the context of function execution + * @param args the list of arguments + * @param argsNum the num of arguments list + */ + static jerry_value_t StartTracing(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t *args, + const jerry_length_t argsNum); + + /** + * @fn ProfilerModule::StopTracing() + * + * @brief request to start the tracing. + * @param func function object + * @param context the context of function execution + * @param args the list of arguments + * @param argsNum the num of arguments list + */ + static jerry_value_t StopTracing(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t *args, + const jerry_length_t argsNum); +}; +} // namespace ACELite +} // namespace OHOS +#endif +namespace OHOS { +namespace ACELite { +class PerformaceProfilerModule final { +public: + ACE_DISALLOW_COPY_AND_MOVE(PerformaceProfilerModule); + PerformaceProfilerModule() = default; + ~PerformaceProfilerModule() = default; + static void Load() + { +#if ENABLED(JS_PROFILER) + ProfilerModule profilerModule; + profilerModule.Init(); +#endif + } +}; +} // namespace ACELite +} // namespace OHOS +#endif // OHOS_ACELITE_PROFILER_MODULE_H diff --git a/src/core/modules/presets/render_module.cpp b/src/core/modules/presets/render_module.cpp new file mode 100755 index 0000000..9a967a3 --- /dev/null +++ b/src/core/modules/presets/render_module.cpp @@ -0,0 +1,162 @@ +/* + * Copyright (c) 2020 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. + */ + +#include "presets/render_module.h" +#include "ace_log.h" +#include "component_factory.h" +#include "component_utils.h" +#include "directive/descriptor_utils.h" +#include "js_app_context.h" +#include "js_profiler.h" +namespace OHOS { +namespace ACELite { +const char * const RenderModule::FUNC_CREATE_ELEMENT = "_c"; +const char * const RenderModule::FUNC_INIT_STYLE_SHEET = "initStyleSheet"; +const char * const RenderModule::FUNC_LOOP_RENDER = "_l"; +const char * const RenderModule::FUNC_CONDITIONAL_RENDER = "_i"; +const int RenderModule::ARG_LENGTH_TAG_ONLY = 1; +const int RenderModule::ARG_LENGTH_WITHOUT_OPTIONS = 2; +const int RenderModule::ARG_LENGTH_WITH_OPTIONS = 3; +const int RenderModule::ARG_LENGTH_RENDER = 2; + +void RenderModule::Init() +{ + CreateNamedFunction(FUNC_CREATE_ELEMENT, CreateElement); + CreateNamedFunction(FUNC_LOOP_RENDER, LoopRender); + CreateNamedFunction(FUNC_CONDITIONAL_RENDER, ConditionalRender); + CreateNamedFunction(FUNC_INIT_STYLE_SHEET, InitStyleSheet); +} + +jerry_value_t RenderModule::CreateElement(jerry_value_t tagName, jerry_value_t options, jerry_value_t children) +{ + uint16_t tagNameLength = 0; + char *componentName = MallocStringOf(tagName, &tagNameLength); + if (componentName == nullptr) { + return UNDEFINED; + } + if (tagNameLength == 0) { + ace_free(componentName); + componentName = nullptr; + return UNDEFINED; + } + + uint16_t componentNameId = KeyParser::ParseKeyId(componentName, tagNameLength); + ace_free(componentName); + componentName = nullptr; + + // create component by tag name using factory + Component *component = ComponentFactory::CreateComponent(componentNameId, options, children); + if (component == nullptr) { + // Release all children before we return UNDEFINED to avoid the children becoming ownerless in this case. + HILOG_ERROR(HILOG_MODULE_ACE, "Fail to create element because the tag is not supported."); + DescriptorUtils::ReleaseDescriptorOrElements(children); + return UNDEFINED; + } + + // component begin to render + bool renderResult = component->Render(); + if (!renderResult) { + // render failed, drop this element by release its all children and itself + DescriptorUtils::ReleaseDescriptorOrElements(children); + component->Release(); + delete component; + component = nullptr; + return UNDEFINED; + } + + // render successfully + return component->GetNativeElement(); +} + +jerry_value_t RenderModule::CreateElement(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t *args, + const jerry_length_t argsNum) +{ + jerry_value_t tagName; + jerry_value_t options; + jerry_value_t children; + if (argsNum == ARG_LENGTH_WITH_OPTIONS) { + tagName = args[0]; + options = args[1]; + const int8_t childrenNum = 2; + children = args[childrenNum]; + } else if (argsNum == ARG_LENGTH_WITHOUT_OPTIONS) { + tagName = args[0]; + if (jerry_value_is_array(args[1])) { + options = UNDEFINED; + children = args[1]; + } else { + options = args[1]; + children = UNDEFINED; + } + } else if (argsNum == ARG_LENGTH_TAG_ONLY) { + tagName = args[0]; + options = UNDEFINED; + children = UNDEFINED; + } else { + HILOG_ERROR(HILOG_MODULE_ACE, "Failed to create element cause by invalid arguments."); + return UNDEFINED; + } + + return CreateElement(tagName, options, children); +} + +jerry_value_t RenderModule::InitStyleSheet(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t *args, + const jerry_length_t argsNum) +{ + AppStyleManager *manager = const_cast(JsAppContext::GetInstance()->GetStyleManager()); + + if (argsNum == 0 || manager == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "Failed to initialize style sheet cause by invalid arguments or empty manager!"); + return jerry_create_boolean(false); + } + START_TRACING(STYLESHEET_INIT); + manager->InitStyleSheet(args[0]); + STOP_TRACING(); + return jerry_create_boolean(true); +} + +jerry_value_t RenderModule::LoopRender(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t *args, + const jerry_length_t length) +{ + if (length != ARG_LENGTH_RENDER) { + HILOG_ERROR(HILOG_MODULE_ACE, "Failed to LoopRender as the length of arguments invalid. Expect 2 but %d", + length); + return UNDEFINED; + } + + return DescriptorUtils::CreateForDescriptor(args[0], args[1]); +} + +jerry_value_t RenderModule::ConditionalRender(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t *args, + const jerry_length_t argsNum) +{ + if (argsNum != ARG_LENGTH_RENDER) { + HILOG_ERROR(HILOG_MODULE_ACE, "Failed to ConditionalRender cause by invlaid paramters. Expect 2 but %d", + argsNum); + return UNDEFINED; + } + + return DescriptorUtils::CreateIfDescriptor(args[0], args[1]); +} +} // namespace ACELite +} // namespace OHOS diff --git a/src/core/modules/presets/render_module.h b/src/core/modules/presets/render_module.h new file mode 100755 index 0000000..cd7ff11 --- /dev/null +++ b/src/core/modules/presets/render_module.h @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2020 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. + */ +#ifndef OHOS_ACELITE_RENDER_MODULE_H +#define OHOS_ACELITE_RENDER_MODULE_H + +#include "non_copyable.h" +#include "presets/preset_module.h" + +namespace OHOS { +namespace ACELite { +class RenderModule final : public PresetModule { +public: + ACE_DISALLOW_COPY_AND_MOVE(RenderModule); + /** + * @fn RenderModule::RenderModule() + * + * @brief Constructor. + */ + RenderModule() : PresetModule(nullptr) {} + + /** + * @fn RenderModule::~RenderModule() + * + * @brief Constructor. + */ + ~RenderModule() = default; + + void Init() override; + + static void Load() + { + RenderModule renderModule; + renderModule.Init(); + } + +private: + static jerry_value_t + CreateElement(const jerry_value_t tagName, const jerry_value_t options, const jerry_value_t children); + + static jerry_value_t CreateElement(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t *args, + const jerry_length_t argsNum); + + static jerry_value_t InitStyleSheet(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t *args, + const jerry_length_t argsNum); + + static jerry_value_t LoopRender(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t *args, + const jerry_length_t argsNum); + + static jerry_value_t ConditionalRender(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t *args, + const jerry_length_t argsNum); + + static const char * const FUNC_CREATE_ELEMENT; + static const char * const FUNC_INIT_STYLE_SHEET; + static const char * const FUNC_LOOP_RENDER; + static const char * const FUNC_CONDITIONAL_RENDER; + static const int ARG_LENGTH_TAG_ONLY; + static const int ARG_LENGTH_WITH_OPTIONS; + static const int ARG_LENGTH_WITHOUT_OPTIONS; + static const int ARG_LENGTH_RENDER; +}; +} // namespace ACELite +} // namespace OHOS +#endif // OHOS_ACELITE_RENDER_MODULE_H diff --git a/src/core/modules/presets/require_module.cpp b/src/core/modules/presets/require_module.cpp new file mode 100755 index 0000000..3c4086d --- /dev/null +++ b/src/core/modules/presets/require_module.cpp @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2020 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. + */ +#include "presets/require_module.h" +#include "ace_mem_base.h" +#include "module_manager.h" + +namespace OHOS { +namespace ACELite { +void RequireModule::Init() +{ + const char * const funcNameRequire = "requireNative"; + CreateNamedFunction(funcNameRequire, ImportModule); +} + +jerry_value_t RequireModule::ImportModule(const jerry_value_t func, + const jerry_value_t obj, + const jerry_value_t* args, + const jerry_length_t argsNum) +{ + const uint8_t requireArgc = 1; + if (argsNum != requireArgc) { + return UNDEFINED; + } + char* name = MallocStringOf(args[0]); + if (name == nullptr) { + return UNDEFINED; + } + + ModuleManager* moduleManager = ModuleManager::GetInstance(); + jerry_value_t moduleObj = (jerry_value_t)(uintptr_t)(moduleManager->RequireModule(name)); + ace_free(name); + name = nullptr; + return moduleObj; +} +} // namespace ACELite +} // namespace OHOS diff --git a/src/core/modules/presets/require_module.h b/src/core/modules/presets/require_module.h new file mode 100755 index 0000000..d82f097 --- /dev/null +++ b/src/core/modules/presets/require_module.h @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2020 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. + */ +#ifndef OHOS_ACELITE_REQUIRE_MODULE_H +#define OHOS_ACELITE_REQUIRE_MODULE_H + +#include "non_copyable.h" +#include "presets/preset_module.h" + +namespace OHOS { +namespace ACELite { +class RequireModule final : public PresetModule { +public: + ACE_DISALLOW_COPY_AND_MOVE(RequireModule); + /** + * @fn RequireModule::RequireModule() + * + * @brief Constructor. + */ + RequireModule() : PresetModule(nullptr) {} + + /** + * @fn RequireModule::~RequireModule() + * + * @brief Constructor. + */ + ~RequireModule() = default; + + void Init() override; + + static void Load() + { + RequireModule requireModule; + requireModule.Init(); + } + +private: + static jerry_value_t ImportModule(const jerry_value_t func, + const jerry_value_t obj, + const jerry_value_t *args, + const jerry_length_t argsNum); +}; +} // namespace ACELite +} // namespace OHOS +#endif // OHOS_ACELITE_REQUIRE_MODULE_H diff --git a/src/core/modules/presets/timer_module.cpp b/src/core/modules/presets/timer_module.cpp new file mode 100755 index 0000000..993ed02 --- /dev/null +++ b/src/core/modules/presets/timer_module.cpp @@ -0,0 +1,217 @@ +/* + * Copyright (c) 2020 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. + */ + +#include "timer_module.h" +#ifdef FEATURE_TIMER_MODULE +#if (!defined(_WIN32) && !defined(_WIN64)) +#include "js_async_work.h" +#endif +#include "ace_log.h" +#include "ace_mem_base.h" +#include "js_fwk_common.h" +#include +#include +#include "nativeapi_timer_task.h" + +namespace OHOS { +namespace ACELite { +void TimerModule::Init() +{ + const char * const setTimeout = "setTimeout"; + const char * const clearTimeout = "clearTimeout"; + const char * const setInterval = "setInterval"; + const char * const clearInterval = "clearInterval"; + CreateNamedFunction(setTimeout, SetTimeout); + CreateNamedFunction(clearTimeout, ClearTimer); + CreateNamedFunction(setInterval, SetInterval); + CreateNamedFunction(clearInterval, ClearTimer); + InitTimerTask(); +} + +jerry_value_t TimerModule::CreateTimer(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t *args, + const jerry_length_t argsNum, + bool repeated) +{ + const uint8_t leastArguments = 2; + if ((argsNum < leastArguments) || (GetInstance()->GetTimerList() == nullptr)) { + return UNDEFINED; + } else { + TimerList::Arguments *arguments = new TimerList::Arguments(); + if (arguments == nullptr) { + return jerry_create_error(JERRY_ERROR_EVAL, reinterpret_cast("memory error")); + } + arguments->context = context; + jerry_value_t function = args[0]; + arguments->func = jerry_acquire_value(function); + arguments->repeated = repeated; + TimerList* timerList = GetInstance()->GetTimerList(); + if (argsNum > leastArguments) { + uint8_t funcNumber = argsNum - leastArguments; + jerry_value_t *funcArg = + static_cast(ace_malloc(sizeof(jerry_value_t) * (funcNumber))); + if (funcArg == nullptr) { + timerList->ReleaseArguments(arguments); + return jerry_create_error(JERRY_ERROR_EVAL, reinterpret_cast("memory error")); + } + for (uint8_t i = 0; i < funcNumber; i++) { + funcArg[i] = jerry_acquire_value(args[i + leastArguments]); + } + arguments->args = funcArg; + arguments->argsNum = funcNumber; + } + jerry_value_t retVal = StartTask(arguments, args[1], repeated); + if (jerry_value_is_undefined(retVal)) { + timerList->ReleaseArguments(arguments); + } + return retVal; + } +} + +jerry_value_t TimerModule::StartTask(TimerList::Arguments *arguments, jerry_value_t time, bool repeated) +{ + timerHandle_t timerId = nullptr; + TimerList *timerList = GetInstance()->GetTimerList(); + jerry_value_t retVal = UNDEFINED; + if (timerList == nullptr) { + return retVal; + } + if (!jerry_value_is_number(time)) { + retVal = timerList->AddTimer(timerId, arguments); + if (jerry_value_is_undefined(retVal)) { + return retVal; + } + Task(arguments); + } else { + jerry_value_t numProp = jerry_value_to_number(time); + int64_t num = jerry_get_number_value(numProp); + jerry_release_value(numProp); + if (num <= 0 || num >= UINT32_MAX) { + retVal = timerList->AddTimer(timerId, arguments); + if (jerry_value_is_undefined(retVal)) { + return retVal; + } + Task(arguments); + } else { + int result = StartTimerTask(repeated, (uint32_t)num, reinterpret_cast(Task), arguments, &timerId); + if (result < 0) { + return UNDEFINED; + } + retVal = timerList->AddTimer(timerId, arguments); + } + } + return retVal; +} + +jerry_value_t TimerModule::ClearTimer(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t *args, + const jerry_length_t argsNum) +{ + if (argsNum == 0) { + return UNDEFINED; + } + TimerList* timerList = GetInstance()->GetTimerList(); + if ((timerList != nullptr) && (jerry_value_is_number(args[0]))) { + int16_t timerKey = IntegerOf(args[0]); + if (timerKey < 0) { + return UNDEFINED; + } + uint8_t index = (uint8_t)(timerKey); + TimerList::TimerNode* timer = timerList->GetTimer(index); + if (timer != nullptr) { + int result = StopTimerTask(timer->timerId); + if (result >= 0) { + timerList->DeleteTimer(index); + } + } + } + return UNDEFINED; +} + +void TimerModule::Task(void *arguments) +{ + TimerList::Arguments *arg = static_cast(arguments); + if (arg == nullptr) { + return; + } + TimerList *timerList = GetInstance()->GetTimerList(); + if (timerList == nullptr) { + return; + } +#if (!defined _WIN32) && (!defined _WIN64) + uint8_t* index = static_cast(ace_malloc(sizeof(uint8_t))); + bool check = true; + if (index == nullptr) { + check = false; + HILOG_ERROR(HILOG_MODULE_ACE, "copy timer id failed\n"); + } else { + *index = arg->index; + if (!JsAsyncWork::DispatchAsyncWork(TimerModule::Execute, index)) { + ACE_FREE(index); + check = false; + } + } + if (!check && (!arg->repeated)) { +#if defined(__LITEOS__) + TimerList::TimerNode* timer = timerList->GetTimer(arg->index); + if (timer != nullptr) { + StopTimerTask(timer->timerId); + } +#endif + timerList->DeleteTimer(arg->index); + } +#else + if (jerry_value_is_function(arg->func)) { + CallJSFunctionAutoRelease(arg->func, arg->context, arg->args, arg->argsNum); + } + if (!arg->repeated) { + timerList->DeleteTimer(arg->index); + } +#endif +} + +#if (!defined(_WIN32) && !defined(_WIN64)) +void TimerModule::Execute(void *data) +{ + uint8_t* timerId = static_cast(data); + if (timerId == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "timer index is invalid"); + return; + } + TimerList* timerList = GetInstance()->GetTimerList(); + if (timerList != nullptr) { + TimerList::TimerNode* timer = timerList->GetTimer(*timerId); + if (timer != nullptr) { + TimerList::Arguments* funcArgs = timer->arguments; + if (jerry_value_is_function(funcArgs->func)) { + CallJSFunctionAutoRelease(funcArgs->func, funcArgs->context, funcArgs->args, funcArgs->argsNum); + } + // if timer is once, release the arguments + if (!funcArgs->repeated) { +#if defined(__LITEOS__) + StopTimerTask(timer->timerId); +#endif + timerList->DeleteTimer(funcArgs->index); + } + } + } + ACE_FREE(timerId); +} +#endif +} // namespace ACELite +} // namespace OHOS +#endif // FEATURE_TIMER_MODULE diff --git a/src/core/modules/presets/timer_module.h b/src/core/modules/presets/timer_module.h new file mode 100755 index 0000000..714d2d1 --- /dev/null +++ b/src/core/modules/presets/timer_module.h @@ -0,0 +1,160 @@ +/* + * Copyright (c) 2020 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. + */ +#ifndef OHOS_ACELITE_TIMER_MODULE_H +#define OHOS_ACELITE_TIMER_MODULE_H + +#include "acelite_config.h" +#include "non_copyable.h" +#ifdef FEATURE_TIMER_MODULE +#include "ace_log.h" +#include "js_timer_list.h" +#include "presets/preset_module.h" + +namespace OHOS { +namespace ACELite { +class TimerModule final : PresetModule { +public: + ACE_DISALLOW_COPY_AND_MOVE(TimerModule); + static TimerModule *GetInstance() + { + static TimerModule instance; + return &instance; + } + + void Init() override; + + void Clear() + { + if (timerList_ != nullptr) { + timerList_->ClearTimerList(); + delete (timerList_); + timerList_ = nullptr; + } + } + +private: + /** + * @fn TimerModule::TimerModule() + * @brief Constructor + */ + TimerModule() : PresetModule(nullptr), + timerList_(nullptr) + { + } + + /** + * @fn TimerModule::~TimerModule() + * + */ + ~TimerModule() = default; + + TimerList *GetTimerList() + { + if (timerList_ == nullptr) { + timerList_ = new TimerList(); + if (timerList_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "malloc timer heap memory failed."); + } + } + return timerList_; + } + + /** + * @brief set the scheduled tasks, execute only once. + * @return the id of timer + */ + static jerry_value_t SetTimeout(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t *args, + const jerry_length_t argsNum) + { + return CreateTimer(func, context, args, argsNum, false); + } + + /** + * @brief start timer task + */ + static jerry_value_t StartTask(TimerList::Arguments *argument, jerry_value_t time, bool repeated); + + /** + * @brief set the repeated timer + * @return the timer id + */ + static jerry_value_t SetInterval(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t *args, + const jerry_length_t argsNum) + { + return CreateTimer(func, context, args, argsNum, true); + } + + /** + * @brief set the repeated timer + * @return the timer id + */ + static jerry_value_t CreateTimer(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t *args, + const jerry_length_t argsNum, + bool repeated); + + /** + * @brief set the timer task + * @return the value of task executed + */ + static void Task(void *arguments); + + /** + * @brief cancel the timer which is not execute + * @return the result of cancel timer + */ + static jerry_value_t ClearTimer(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t *args, + const jerry_length_t argsNum); + +#if (!defined(_WIN32) && !defined(_WIN64)) + static void Execute(void *data); +#endif + TimerList *timerList_; +}; +} // namespace ACELite +} // namespace OHOS +#endif +namespace OHOS { +namespace ACELite { +class TimersModule final { +public: + ACE_DISALLOW_COPY_AND_MOVE(TimersModule); + TimersModule() = default; + ~TimersModule() = default; + static void Load() + { +#ifdef FEATURE_TIMER_MODULE + TimerModule *timerModule = const_cast(TimerModule::GetInstance()); + timerModule->Init(); +#endif + } + static void Clear() + { +#ifdef FEATURE_TIMER_MODULE + TimerModule *timerModule = const_cast(TimerModule::GetInstance()); + timerModule->Clear(); +#endif + } +}; +} // namespace ACELite +} // namespace OHOS +#endif // OHOS_ACELITE_TIMER_MODULE_H diff --git a/src/core/modules/presets/version_module.cpp b/src/core/modules/presets/version_module.cpp new file mode 100755 index 0000000..593201f --- /dev/null +++ b/src/core/modules/presets/version_module.cpp @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2020 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. + */ + +#include "version_module.h" +#if ENABLED(ACE_LITE_VERSION_JS_API) +#include "ace_log.h" +#include "ace_version.h" +#include "platform_adapter.h" + +namespace OHOS { +namespace ACELite { +void VersionModule::Init() +{ + constexpr char FUNC_GET_VERSION[] = "getAceVersion"; + constexpr char FUNC_GET_COMMIT[] = "getAceCommit"; + constexpr char FUNC_GET_STAMP[] = "getAceStamp"; + CreateNamedFunction(FUNC_GET_VERSION, GetACEVersion); + CreateNamedFunction(FUNC_GET_COMMIT, GetACECommit); + CreateNamedFunction(FUNC_GET_STAMP, GetACEBuildStamp); + PrintVersionTrace(); +} + +jerry_value_t VersionModule::GetACEVersion(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t args[], + const jerry_length_t argsNum) +{ + const char * const versionStr = ACEVersion::GetStr(); + return jerry_create_string(reinterpret_cast(versionStr)); +} + +jerry_value_t VersionModule::GetACECommit(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t args[], + const jerry_length_t argsNum) +{ + const char * const commitStr = ACEVersion::GetCommit(); + return jerry_create_string(reinterpret_cast(commitStr)); +} + +jerry_value_t VersionModule::GetACEBuildStamp(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t args[], + const jerry_length_t argsNum) +{ + const char * const stampStr = ACEVersion::GetTimeStamp(); + return jerry_create_string(reinterpret_cast(stampStr)); +} +} // namespace ACELite +} // namespace OHOS +#endif // ENABLED(ACE_LITE_VERSION_JS_API) \ No newline at end of file diff --git a/src/core/modules/presets/version_module.h b/src/core/modules/presets/version_module.h new file mode 100755 index 0000000..2f3248e --- /dev/null +++ b/src/core/modules/presets/version_module.h @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2020 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. + */ + +#ifndef OHOS_ACELITE_VERSION_MODULE_H +#define OHOS_ACELITE_VERSION_MODULE_H + +#include "acelite_config.h" +#include "js_config.h" +#include "non_copyable.h" +#if ENABLED(ACE_LITE_VERSION_JS_API) +#include "presets/preset_module.h" +namespace OHOS { +namespace ACELite { +class VersionModule final : public PresetModule { +public: + ACE_DISALLOW_COPY_AND_MOVE(VersionModule); + /** + * @fn VersionModule::VersionModule() + * + * @brief Constructor. + */ + VersionModule() : PresetModule(nullptr) {} + + /** + * @fn VersionModule::~VersionModule() + * + * @brief Constructor. + */ + ~VersionModule() = default; + + void Init() override; + +private: + static jerry_value_t GetACEVersion(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t args[], + const jerry_length_t argsNum); + + static jerry_value_t GetACECommit(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t args[], + const jerry_length_t argsNum); + + static jerry_value_t GetACEBuildStamp(const jerry_value_t func, + const jerry_value_t context, + const jerry_value_t args[], + const jerry_length_t argsNum); +}; +} // namespace ACELite +} // namespace OHOS +#endif // ENABLED(ACE_LITE_VERSION_JS_API) +namespace OHOS { +namespace ACELite { +class AceVersionModule final { +public: + ACE_DISALLOW_COPY_AND_MOVE(AceVersionModule); + AceVersionModule() = default; + ~AceVersionModule() = default; + static void Load() + { +#if ENABLED(ACE_LITE_VERSION_JS_API) + VersionModule versionModule; + versionModule.Init(); +#endif + } +}; +} // namespace ACELite +} // namespace OHOS +#endif // OHOS_ACELITE_VERSION_MODULE_H diff --git a/src/core/modules/router_module.cpp b/src/core/modules/router_module.cpp new file mode 100755 index 0000000..f2d7407 --- /dev/null +++ b/src/core/modules/router_module.cpp @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2020 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. + */ +#include "router_module.h" +#include "ace_log.h" +#include "js_ability_impl.h" +#include "js_app_context.h" +#include "js_profiler.h" +#include "jsi/internal/jsi_internal.h" + +namespace OHOS { +namespace ACELite { +JSIValue RouterModule::Replace(const JSIValue thisVal, const JSIValue* args, uint8_t argsNum) +{ + if (argsNum != 1) { + HILOG_ERROR(HILOG_MODULE_ACE, "Replace args num(%d) is invalid.", argsNum); + return AS_JSI_VALUE(jerry_create_error(JERRY_ERROR_TYPE, + reinterpret_cast("params should only be one object."))); + } + jerry_value_t object = AS_JERRY_VALUE(args[0]); + // router.replace({uri: 'About', params: {id:'1'}} + JsAppContext* appContext = JsAppContext::GetInstance(); + const JSAbilityImpl* topJsAbilityImpl = appContext->GetTopJSAbilityImpl(); + if (topJsAbilityImpl == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "topJsAbilityImpl is null."); + return AS_JSI_VALUE(UNDEFINED); + } + // get top ability's router + Router* router = const_cast(topJsAbilityImpl->GetRouter()); + if (router == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "router is null."); + return AS_JSI_VALUE(UNDEFINED); + } + jerry_value_t replaceResult = router->Replace(object); + return AS_JSI_VALUE(replaceResult); +} +} // namespace ACELite +} // namespace OHOS diff --git a/src/core/modules/router_module.h b/src/core/modules/router_module.h new file mode 100755 index 0000000..c0f8365 --- /dev/null +++ b/src/core/modules/router_module.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2020 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. + */ + +#ifndef OHOS_ACELITE_ROUTER_MODULE_H +#define OHOS_ACELITE_ROUTER_MODULE_H + +#include "jsi.h" +#include "non_copyable.h" + +namespace OHOS { +namespace ACELite { +/** + * @brief: The module of router + */ +class RouterModule final : public MemoryHeap { +public: + ACE_DISALLOW_COPY_AND_MOVE(RouterModule); + RouterModule() {} + ~RouterModule() {} + static JSIValue Replace(const JSIValue thisVal, const JSIValue* args, uint8_t argsNum); +}; + +void InitRouterModule(JSIValue exports) +{ + JSI::SetModuleAPI(exports, "replace", RouterModule::Replace); +} +} // namespace ACELite +} // namespace OHOS + +#endif // OHOS_ACELITE_ROUTER_MODULE_H diff --git a/src/core/modules/sample_module.cpp b/src/core/modules/sample_module.cpp new file mode 100755 index 0000000..0dbb44f --- /dev/null +++ b/src/core/modules/sample_module.cpp @@ -0,0 +1,212 @@ +/* + * Copyright (c) 2020 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. + */ + +#include "sample_module.h" +#ifdef ENABLE_MODULE_REQUIRE_TEST +#if (!defined _WIN32) && (!defined _WIN64) +#include "js_async_work.h" +#endif +#include "ace_log.h" + +namespace OHOS { +namespace ACELite { +JSIValue SampleModule::TestCallFunc(const JSIValue thisVal, const JSIValue *args, uint8_t argsNum) +{ + return JSI::CreateUndefined(); +} + +JSIValue SampleModule::TestCallback(const JSIValue thisVal, const JSIValue *args, uint8_t argsNum) +{ + JSIValue undefValue = JSI::CreateUndefined(); + if ((args == nullptr) || (argsNum == 0) || JSI::ValueIsUndefined(args[0])) { + return undefValue; + } + + JSIValue callback = JSI::GetNamedProperty(args[0], CB_CALLBACK); + JSIValue result = JSI::CreateObject(); + const double defaultVal = 111; + JSI::SetNumberProperty(result, "x", defaultVal); + JSIValue argv[ARGC_ONE] = {result}; + JSI::CallFunction(callback, thisVal, argv, ARGC_ONE); + JSI::ReleaseValueList(callback, result); + return undefValue; +} + +JSIValue SampleModule::TestStandardCallback(const JSIValue thisVal, const JSIValue *args, uint8_t argsNum) +{ + JSIValue undefValue = JSI::CreateUndefined(); + if ((args == nullptr) || (argsNum == 0) || JSI::ValueIsUndefined(args[0])) { + return undefValue; + } + JSIValue success = JSI::GetNamedProperty(args[0], CB_SUCCESS); + JSIValue fail = JSI::GetNamedProperty(args[0], CB_FAIL); + JSIValue complete = JSI::GetNamedProperty(args[0], CB_COMPLETE); + // callbacks can be invoked on demand + JSI::CallFunction(success, thisVal, nullptr, 0); + JSI::CallFunction(complete, thisVal, nullptr, 0); + JSI::ReleaseValueList(success, fail, complete); + return undefValue; +} + +#if (!defined _WIN32) && (!defined _WIN64) +struct AsyncParams : public MemoryHeap { + AsyncParams() : result(nullptr), callback(nullptr), context(nullptr) {} + + JSIValue result; + JSIValue callback; + JSIValue context; +}; + +static void Execute(void *data) +{ + AsyncParams *params = static_cast(data); + if (params == nullptr) { + return; + } + JSIValue callback = params->callback; + JSIValue result = params->result; + JSIValue context = params->context; + + JSI::CallFunction(callback, context, &result, ARGC_ONE); + JSI::ReleaseValueList(callback, result, context); + delete params; + params = nullptr; +} +#endif + +JSIValue SampleModule::TestCallbackWithArgs(const JSIValue thisVal, const JSIValue *args, uint8_t argsNum) +{ + JSIValue undefValue = JSI::CreateUndefined(); + if ((args == nullptr) || (argsNum == 0) || JSI::ValueIsUndefined(args[0])) { + return undefValue; + } + JSIValue callback = JSI::GetNamedProperty(args[0], CB_CALLBACK); + double num = JSI::GetNumberProperty(args[0], "param1"); + char *str = JSI::GetStringProperty(args[0], "param2"); + + JSIValue result = JSI::CreateObject(); + JSI::SetNumberProperty(result, "param1", num); + if (str != nullptr) { + JSI::SetStringProperty(result, "param2", str); + JSI::ReleaseString(str); + } +#if (!defined _WIN32) && (!defined _WIN64) + AsyncParams *params = new AsyncParams(); + if (params == nullptr) { + return undefValue; + } + params->result = result; + params->callback = callback; + params->context = JSI::AcquireValue(thisVal); + if (!(JsAsyncWork::DispatchAsyncWork(Execute, static_cast(params)))) { + JSI::ReleaseValueList(result, callback, params->context); + delete params; + params = nullptr; + } + return undefValue; +#else + JSI::CallFunction(callback, thisVal, &result, ARGC_ONE); + JSI::ReleaseValueList(result, callback); + return undefValue; +#endif +} + +JSIValue SampleModule::TestStandardCallbackWithArgs(const JSIValue thisVal, const JSIValue *args, uint8_t argsNum) +{ + JSIValue undefValue = JSI::CreateUndefined(); + if ((args == nullptr) || (argsNum == 0) || JSI::ValueIsUndefined(args[0])) { + return undefValue; + } + JSIValue success = JSI::GetNamedProperty(args[0], CB_SUCCESS); + JSIValue fail = JSI::GetNamedProperty(args[0], CB_FAIL); + JSIValue complete = JSI::GetNamedProperty(args[0], CB_COMPLETE); + double num = JSI::GetNumberProperty(args[0], "param1"); + char *str = JSI::GetStringProperty(args[0], "param2"); + + JSIValue result = JSI::CreateObject(); + JSI::SetNumberProperty(result, "param1", num); + if (str != nullptr) { + JSI::SetStringProperty(result, "param2", str); + JSI::ReleaseString(str); + } + + // callbacks can be invoked on demand + JSIValue argv[ARGC_ONE] = {result}; + JSI::CallFunction(success, thisVal, argv, ARGC_ONE); + JSI::CallFunction(fail, thisVal, argv, ARGC_ONE); + JSI::CallFunction(complete, thisVal, argv, ARGC_ONE); + JSI::ReleaseValueList(success, fail, complete, result); + return undefValue; +} + +JSIValue SampleModule::TestGeneralFunc(const JSIValue thisVal, const JSIValue *args, uint8_t argsNum) +{ + JSIValue result; + if ((args == nullptr) || (argsNum < ARGC_TWO)) { + return JSI::CreateUndefined(); + } + + char *param1 = JSI::ValueToString(args[0]); + if (param1 == nullptr) { + return JSI::CreateUndefined(); + } + double param2 = JSI::ValueToNumber(args[ARGC_ONE]); + result = JSI::CreateObject(); + JSI::SetStringProperty(result, "prop1", param1); + JSI::SetNumberProperty(result, "prop2", param2); + JSI::ReleaseString(param1); + + JSPropertyDescriptor desc; + const char * const propName = "prop3"; + desc.getter = Getter; + desc.setter = Setter; + JSI::DefineNamedProperty(result, propName, desc); + return result; +} + +int8_t SampleModule::counter_ = 0; + +JSIValue SampleModule::Setter(const JSIValue thisVal, const JSIValue *args, uint8_t argsNum) +{ + if ((args == nullptr) || (argsNum == 0) || JSI::ValueIsUndefined(args[0])) { + return JSI::CreateUndefined(); + } + double newValue = JSI::ValueToNumber(args[0]); + counter_ = (int8_t)newValue; + + HILOG_DEBUG(HILOG_MODULE_ACE, "SampleModule: Setter called, setting: %d", counter_); + return JSI::CreateUndefined(); +} + +JSIValue SampleModule::Getter(const JSIValue thisVal, const JSIValue *args, uint8_t argsNum) +{ + counter_++; + HILOG_DEBUG(HILOG_MODULE_ACE, "SampleModule: Getter called, returning: %d", counter_); + return JSI::CreateNumber(counter_); +} + +void SampleModule::OnDestroy() +{ + HILOG_DEBUG(HILOG_MODULE_ACE, "SampleModule: OnDestroy called"); +} + +void SampleModule::OnTerminate() +{ + HILOG_DEBUG(HILOG_MODULE_ACE, "SampleModule: OnTerminate called"); +} +} // namespace ACELite +} // namespace OHOS + +#endif // ENABLE_MODULE_REQUIRE_TEST diff --git a/src/core/modules/sample_module.h b/src/core/modules/sample_module.h new file mode 100755 index 0000000..23dcc02 --- /dev/null +++ b/src/core/modules/sample_module.h @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2020 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. + */ + +#ifndef OHOS_ACELITE_SAMPLE_MODULE_H +#define OHOS_ACELITE_SAMPLE_MODULE_H + +#include "acelite_config.h" +#ifdef ENABLE_MODULE_REQUIRE_TEST + +#include "jsi.h" +#include "non_copyable.h" + +namespace OHOS { +namespace ACELite { +class SampleModule final : public MemoryHeap { +public: + ACE_DISALLOW_COPY_AND_MOVE(SampleModule); + SampleModule() {} + ~SampleModule() {} + static JSIValue TestCallFunc(const JSIValue thisVal, const JSIValue *args, uint8_t argsNum); + static JSIValue TestCallback(const JSIValue thisVal, const JSIValue *args, uint8_t argsNum); + static JSIValue TestStandardCallback(const JSIValue thisVal, const JSIValue *args, uint8_t argsNum); + static JSIValue TestCallbackWithArgs(const JSIValue thisVal, const JSIValue *args, uint8_t argsNum); + static JSIValue TestStandardCallbackWithArgs(const JSIValue thisVal, const JSIValue *args, uint8_t argsNum); + static JSIValue TestGeneralFunc(const JSIValue thisVal, const JSIValue *args, uint8_t argsNum); + static JSIValue Getter(const JSIValue thisVal, const JSIValue *args, uint8_t argsNum); + static JSIValue Setter(const JSIValue thisVal, const JSIValue *args, uint8_t argsNum); + static void OnDestroy(); + static void OnTerminate(); +private: + static int8_t counter_; // used for js descriptor test +}; + +void InitSampleModule(JSIValue exports) +{ + JSI::SetModuleAPI(exports, "testCallFunc", SampleModule::TestCallFunc); + JSI::SetModuleAPI(exports, "testCallback", SampleModule::TestCallback); + JSI::SetModuleAPI(exports, "testStandardCallback", SampleModule::TestStandardCallback); + JSI::SetModuleAPI(exports, "testCallbackWithArgs", SampleModule::TestCallbackWithArgs); + JSI::SetModuleAPI(exports, "testStandardCallbackWithArgs", SampleModule::TestStandardCallbackWithArgs); + JSI::SetModuleAPI(exports, "testGeneralFunc", SampleModule::TestGeneralFunc); + JSI::SetOnDestroy(exports, SampleModule::OnDestroy); + JSI::SetOnTerminate(exports, SampleModule::OnTerminate); +} +} // namespace ACELite +} // namespace OHOS + +#endif // ENABLE_MODULE_REQUIRE_TEST + +#endif // OHOS_ACELITE_SAMPLE_MODULE_H diff --git a/src/core/resource/video_muted_image_res.cpp b/src/core/resource/video_muted_image_res.cpp new file mode 100755 index 0000000..137b8f2 --- /dev/null +++ b/src/core/resource/video_muted_image_res.cpp @@ -0,0 +1,1035 @@ +/* + * Copyright (c) 2020 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. + */ +#include "acelite_config.h" +#ifdef FEATURE_COMPONENT_VIDEO + +#include "video_panel_image_res.h" +#include "graphic_types.h" +namespace OHOS { +namespace ACELite { +const uint8_t VIDEO_MUTED_IMAGE_ON_MAP[] = { + /* Pixel format: ARGB8888 */ + /* Pixel format: Alpha 8 bit, Red: 8 bit, Green: 8 bit, Blue: 8 bit */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x29, 0xff, 0xff, 0xff, 0xd1, 0xff, + 0xff, 0xff, 0xee, 0xff, 0xff, 0xff, 0x72, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xb0, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x5d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, + 0xff, 0xff, 0x31, 0xff, 0xff, 0xff, 0x75, 0xff, 0xff, 0xff, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xb0, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0xff, 0xff, 0xff, 0x36, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, + 0x75, 0xff, 0xff, 0xff, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, + 0x2c, 0xff, 0xff, 0xff, 0xf5, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xe6, 0xff, 0xff, 0xff, 0x1a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x0d, 0xff, 0xff, 0xff, 0xad, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xee, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x54, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xb8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x2a, 0xff, 0xff, 0xff, 0xd8, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xee, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x4d, + 0xff, 0xff, 0xff, 0xda, 0xff, 0xff, 0xff, 0xce, 0xff, 0xff, 0xff, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x81, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x57, 0xff, 0xff, 0xff, 0xf3, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xee, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x03, 0xff, 0xff, + 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xea, 0xff, 0xff, 0xff, 0x1f, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x01, 0xff, 0xff, 0xff, 0xbc, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xca, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xff, 0x04, 0xff, 0xff, 0xff, 0x8e, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xee, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x05, + 0xff, 0xff, 0xff, 0xf6, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xd0, 0xff, 0xff, 0xff, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, + 0xff, 0x31, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, + 0xff, 0x18, 0xff, 0xff, 0xff, 0xc2, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xee, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xff, 0x74, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x91, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xa6, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xc8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xff, 0x0e, 0xff, 0xff, 0xff, 0x26, 0xff, 0xff, 0xff, 0x26, 0xff, 0xff, 0xff, 0x26, 0xff, + 0xff, 0xff, 0x26, 0xff, 0xff, 0xff, 0x26, 0xff, 0xff, 0xff, 0x26, 0xff, 0xff, 0xff, 0x26, 0xff, 0xff, 0xff, 0x48, + 0xff, 0xff, 0xff, 0xe6, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xee, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xa6, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf9, 0xff, 0xff, 0xff, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x23, 0xff, 0xff, 0xff, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xff, 0x66, 0xff, 0xff, 0xff, 0xfb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xee, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xff, 0xff, 0xff, 0x01, 0xff, 0xff, 0xff, 0x59, 0xff, 0xff, 0xff, 0x77, 0xff, 0xff, 0xff, 0x19, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x09, 0xff, 0xff, 0xff, 0xdb, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xa3, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xc4, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xff, 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xee, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x7c, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe4, + 0xff, 0xff, 0xff, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, + 0x57, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfa, 0xff, 0xff, + 0xff, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x76, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xb3, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xee, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xbe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xbc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, + 0xff, 0xff, 0x01, 0xff, 0xff, 0xff, 0xd5, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, + 0x28, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0xff, 0xff, + 0xff, 0x05, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xee, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x73, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x48, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x83, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xa6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xe5, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x1d, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xee, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x03, 0xff, 0xff, 0xff, 0xca, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xab, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x37, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xd7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xc9, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x36, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xee, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x3b, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf1, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xaf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x50, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xee, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, + 0xff, 0x06, 0xff, 0xff, 0xff, 0xf9, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xf5, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0a, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x96, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x69, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xee, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x1b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, + 0xff, 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x12, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x8e, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x71, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xee, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xff, 0x1d, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x06, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf9, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xa6, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x59, 0x00, 0x00, 0x00, 0x00, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xee, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x86, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xcc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, + 0xff, 0x22, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe1, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xbf, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x40, 0x00, 0x00, 0x00, + 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xee, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xff, 0x34, 0xff, 0xff, 0xff, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x79, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xff, 0x66, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xbe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, + 0xff, 0xd8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x27, 0x00, + 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xee, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xb9, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xec, 0xff, 0xff, 0xff, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xff, 0xb4, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x0f, + 0xff, 0xff, 0xff, 0xfb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x0d, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xf9, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xee, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xba, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xff, 0x28, 0xff, 0xff, 0xff, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, + 0xff, 0x58, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xd0, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xac, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xee, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x2f, 0xff, 0xff, 0xff, 0xd6, 0xff, 0xff, 0xff, + 0xef, 0xff, 0xff, 0xff, 0x6d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xff, 0xad, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xd0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xff, 0xa6, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x83, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x07, 0xff, 0xff, 0xff, 0x63, 0xff, 0xff, + 0xff, 0x80, 0xff, 0xff, 0xff, 0x80, 0xff, 0xff, 0xff, 0x80, 0xff, 0xff, 0xff, 0x80, 0xff, 0xff, 0xff, 0x80, 0xff, + 0xff, 0xff, 0x80, 0xff, 0xff, 0xff, 0x80, 0xff, 0xff, 0xff, 0xa2, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xee, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xff, 0x59, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x4d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, + 0xff, 0x08, 0xff, 0xff, 0xff, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x59, 0xff, 0xff, + 0xff, 0xf5, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xee, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, + 0xff, 0x33, 0xff, 0xff, 0xff, 0xf6, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xc4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xff, 0x73, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xe6, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xff, 0x2d, 0xff, 0xff, 0xff, 0xdb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xee, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xff, 0xd6, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xf6, 0xff, 0xff, 0xff, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, + 0xff, 0x0f, 0xff, 0xff, 0xff, 0xec, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0x86, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x0f, 0xff, 0xff, 0xff, 0xb2, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xee, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, + 0xff, 0x05, 0xff, 0xff, 0xff, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0x57, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xff, 0x84, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xee, 0xff, 0xff, 0xff, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x01, 0xff, 0xff, 0xff, + 0x7d, 0xff, 0xff, 0xff, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xee, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x93, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, + 0xff, 0x39, 0xff, 0xff, 0xff, 0xf9, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0x75, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x48, 0xff, 0xff, 0xff, 0xed, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xee, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x33, 0xff, 0xff, 0xff, 0x2a, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x1c, + 0xff, 0xff, 0xff, 0xe7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xe4, 0xff, 0xff, 0xff, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x21, 0xff, 0xff, 0xff, 0xce, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x09, 0xff, 0xff, + 0xff, 0xcc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xff, + 0xff, 0xff, 0x4f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x09, + 0xff, 0xff, 0xff, 0x92, 0xff, 0xff, 0xff, 0xe2, 0xff, 0xff, 0xff, 0x6b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x86, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, + 0xff, 0xb8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xab, 0xff, + 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xff, 0x58, 0xff, 0xff, 0xff, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xcb, 0xff, 0xff, 0xff, + 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x2a, 0xff, 0xff, 0xff, 0x49, 0xff, 0xff, 0xff, 0x06, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, +}; +const uint8_t VIDEO_MUTED_IMAGE_OFF_MAP[] = { + /* Pixel format: ARGB8888 */ + /* Pixel format: Alpha 8 bit, Red: 8 bit, Green: 8 bit, Blue: 8 bit */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x42, 0xff, 0xff, + 0xff, 0x93, 0xff, 0xff, 0xff, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x01, 0xff, 0xff, 0xff, 0x80, 0xff, 0xff, 0xff, 0xfe, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x0e, 0xff, 0xff, 0xff, 0xb2, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x28, 0xff, 0xff, 0xff, 0xd8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xff, 0xff, 0xff, 0x4f, 0xff, 0xff, 0xff, 0xf2, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x01, 0xff, + 0xff, 0xff, 0x81, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x0f, 0xff, 0xff, 0xff, + 0xb3, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x29, 0xff, 0xff, 0xff, 0xd9, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x50, 0xff, 0xff, 0xff, 0xf2, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x0a, 0xff, 0xff, 0xff, 0x21, 0xff, 0xff, 0xff, + 0x21, 0xff, 0xff, 0xff, 0x21, 0xff, 0xff, 0xff, 0x21, 0xff, 0xff, 0xff, 0x21, 0xff, 0xff, 0xff, 0x21, 0xff, 0xff, + 0xff, 0x21, 0xff, 0xff, 0xff, 0x21, 0xff, 0xff, 0xff, 0x82, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xff, 0x32, 0xff, 0xff, 0xff, 0xc7, 0xff, 0xff, 0xff, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xff, 0x2a, 0xff, 0xff, 0xff, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xff, 0xb3, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xec, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xea, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xae, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x25, 0xff, 0xff, 0xff, 0xf5, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, + 0xff, 0x29, 0xff, 0xff, 0xff, 0xbb, 0xff, 0xff, 0xff, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x04, 0xff, 0xff, 0xff, 0x15, 0xff, 0xff, 0xff, + 0x15, 0xff, 0xff, 0xff, 0x15, 0xff, 0xff, 0xff, 0x15, 0xff, 0xff, 0xff, 0x15, 0xff, 0xff, 0xff, 0x15, 0xff, 0xff, + 0xff, 0x15, 0xff, 0xff, 0xff, 0x15, 0xff, 0xff, 0xff, 0x77, 0xff, 0xff, 0xff, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x47, 0xff, 0xff, 0xff, + 0xee, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, + 0xff, 0xff, 0x23, 0xff, 0xff, 0xff, 0xd3, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x0c, 0xff, 0xff, 0xff, 0xac, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x01, 0xff, 0xff, 0xff, 0x7b, + 0xff, 0xff, 0xff, 0xfd, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xff, 0x4b, 0xff, 0xff, 0xff, 0xf0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x26, 0xff, 0xff, 0xff, 0xd6, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x0d, 0xff, + 0xff, 0xff, 0xb1, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xff, 0xff, 0xff, 0x01, 0xff, 0xff, 0xff, 0x80, 0xff, 0xff, 0xff, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xeb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x44, 0xff, 0xff, 0xff, 0x9d, + 0xff, 0xff, 0xff, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, +}; +ImageInfo g_videoMutedImageOn = {}; + +ImageInfo* GetVideoMutedImageOnInfo() +{ + /* 48 : video muted image width */ + g_videoMutedImageOn.header.width = 48; + /* 48 : video muted image heigh */ + g_videoMutedImageOn.header.height = 48; + /* 5 : video muted image cf format */ + g_videoMutedImageOn.header.colorMode = ARGB8888; + /* 2304 * 4 : video muted image size */ + g_videoMutedImageOn.dataSize = 2304 * 4; + g_videoMutedImageOn.data = VIDEO_MUTED_IMAGE_ON_MAP; + return &g_videoMutedImageOn; +} + +ImageInfo g_videoMutedImageOff = {}; + +ImageInfo* GetVideoMutedImageOffInfo() +{ + /* 48 : video muted image width */ + g_videoMutedImageOff.header.width = 48; + /* 48 : video muted image heigh */ + g_videoMutedImageOff.header.height = 48; + /* 5 : video muted image cf format */ + g_videoMutedImageOff.header.colorMode = ARGB8888; + /* 2304 * 4 : video muted image size */ + g_videoMutedImageOff.dataSize = 2304 * 4; + g_videoMutedImageOff.data = VIDEO_MUTED_IMAGE_OFF_MAP; + return &g_videoMutedImageOff; +} +} // namespace ACELite +} // namespace OHOS +#endif // FEATURE_COMPONENT_VIDEO \ No newline at end of file diff --git a/src/core/resource/video_play_image_res.cpp b/src/core/resource/video_play_image_res.cpp new file mode 100755 index 0000000..af83feb --- /dev/null +++ b/src/core/resource/video_play_image_res.cpp @@ -0,0 +1,1036 @@ +/* + * Copyright (c) 2020 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. + */ +#include "acelite_config.h" +#ifdef FEATURE_COMPONENT_VIDEO + +#include "video_panel_image_res.h" +#include "graphic_types.h" +namespace OHOS { +namespace ACELite { +const uint8_t VIDEO_PLAY_IMAGE_ON_MAP[] = { + /* Pixel format: ARGB8888 */ + /* Pixel format: Alpha 8 bit, Red: 8 bit, Green: 8 bit, Blue: 8 bit */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x12, 0xff, 0xff, 0xff, + 0x7f, 0xff, 0xff, 0xff, 0xc6, 0xff, 0xff, 0xff, 0xc9, 0xff, 0xff, 0xff, 0x7e, 0xff, 0xff, 0xff, 0x17, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x12, 0xff, 0xff, 0xff, 0xd5, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, + 0xff, 0xff, 0xff, 0x6a, 0xff, 0xff, 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x9c, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xcb, 0xff, 0xff, 0xff, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xe9, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0xff, 0xff, 0xff, + 0x95, 0xff, 0xff, 0xff, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe8, 0xff, 0xff, 0xff, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xbf, 0xff, 0xff, + 0xff, 0x29, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xfa, 0xff, 0xff, 0xff, 0x86, 0xff, 0xff, 0xff, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0xff, 0xff, 0xff, 0x4e, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xb1, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf5, 0xff, 0xff, 0xff, 0x78, 0xff, 0xff, 0xff, 0x05, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xd6, 0xff, 0xff, 0xff, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xa3, 0xff, 0xff, 0xff, 0x17, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xff, + 0xff, 0xff, 0x6a, 0xff, 0xff, 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xcb, 0xff, 0xff, 0xff, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0xff, 0xff, 0xff, 0x95, + 0xff, 0xff, 0xff, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xe8, 0xff, 0xff, 0xff, 0x4f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xff, 0xff, 0xff, 0x57, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xed, 0xff, + 0xff, 0xff, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xeb, 0xff, 0xff, 0xff, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xfd, 0xff, 0xff, 0xff, 0x5f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xe8, 0xff, 0xff, 0xff, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0xff, 0xff, 0xff, 0x95, 0xff, + 0xff, 0xff, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xcb, 0xff, 0xff, 0xff, 0x34, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xff, 0xff, 0xff, 0x6a, 0xff, 0xff, 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xa3, 0xff, 0xff, 0xff, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xd6, 0xff, 0xff, + 0xff, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf5, 0xff, 0xff, 0xff, 0x79, 0xff, 0xff, 0xff, 0x05, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xb1, 0xff, 0xff, 0xff, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xe0, 0xff, 0xff, 0xff, 0x4e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfa, 0xff, 0xff, 0xff, + 0x87, 0xff, 0xff, 0xff, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xbf, 0xff, 0xff, 0xff, 0x29, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe8, 0xff, 0xff, 0xff, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xff, 0xdf, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xfd, 0xff, 0xff, 0xff, 0x95, 0xff, 0xff, 0xff, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xff, 0x97, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xcb, + 0xff, 0xff, 0xff, 0x34, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x10, 0xff, 0xff, 0xff, 0xdb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xff, 0xff, 0xff, 0x6a, 0xff, 0xff, + 0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x0c, 0xff, 0xff, 0xff, 0x84, 0xff, + 0xff, 0xff, 0xc4, 0xff, 0xff, 0xff, 0xcc, 0xff, 0xff, 0xff, 0x89, 0xff, 0xff, 0xff, 0x17, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, +}; + +const uint8_t VIDEO_PLAY_IMAGE_OFF_MAP[] = { + /* Pixel format: ARGB8888 */ + /* Pixel format: Alpha 8 bit, Red: 8 bit, Green: 8 bit, Blue: 8 bit */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x49, 0xff, 0xff, 0xff, 0xe3, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xe3, 0xff, 0xff, 0xff, 0x49, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xff, 0xff, 0xff, 0x49, 0xff, 0xff, 0xff, 0xe3, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xe3, 0xff, 0xff, 0xff, 0x49, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xe3, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xe3, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xe3, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe3, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xe3, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x49, 0xff, + 0xff, 0xff, 0xe3, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe3, 0xff, 0xff, 0xff, 0x49, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x49, 0xff, 0xff, 0xff, 0xe3, 0xff, + 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe3, 0xff, 0xff, 0xff, 0x49, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, +}; +ImageInfo g_videoPlayImageOn = {}; + +ImageInfo* GetVideoPlayImageOnInfo() +{ + /* 48 : video play image width */ + g_videoPlayImageOn.header.width = 48; + /* 48 : video play image height */ + g_videoPlayImageOn.header.height = 48; + /* 5 : video play image cf format */ + g_videoPlayImageOn.header.colorMode = ARGB8888; + /* 2304 * 4 : video play image size */ + g_videoPlayImageOn.dataSize = 2304 * 4; + g_videoPlayImageOn.data = VIDEO_PLAY_IMAGE_ON_MAP; + return &g_videoPlayImageOn; +} + +ImageInfo g_videoPlayImageOff = {}; + +ImageInfo* GetVideoPlayImageOffInfo() +{ + /* 48 : video play off image width */ + g_videoPlayImageOff.header.width = 48; + /* 48 : video play off image height */ + g_videoPlayImageOff.header.height = 48; + /* 5 : video play off image cf format */ + g_videoPlayImageOff.header.colorMode = ARGB8888; + /* 2304 * 4 : video play off image size */ + g_videoPlayImageOff.dataSize = 2304 * 4; + g_videoPlayImageOff.data = VIDEO_PLAY_IMAGE_OFF_MAP; + return &g_videoPlayImageOff; +} +} // namespace ACELite +} // namespace OHOS +#endif // FEATURE_COMPONENT_VIDEO \ No newline at end of file diff --git a/src/core/router/BUILD.gn b/src/core/router/BUILD.gn new file mode 100755 index 0000000..c027925 --- /dev/null +++ b/src/core/router/BUILD.gn @@ -0,0 +1,25 @@ +#Copyright (c) 2020 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. + +source_set("router") { + configs += [ + "//foundation/ace/lite/jsfwk:ace_config", + ] + sources = [ + "js_page_state_machine.cpp", + "js_router.cpp", + "js_page_state.cpp", + ] + include_dirs = [ + ] +} diff --git a/src/core/router/js_page_state.cpp b/src/core/router/js_page_state.cpp new file mode 100755 index 0000000..de9cf49 --- /dev/null +++ b/src/core/router/js_page_state.cpp @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2020 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. + */ + +#include "ace_event_error_code.h" +#include "ace_log.h" +#include "fatal_handler.h" +#include "js_page_state.h" + +namespace OHOS { +namespace ACELite { +void PageInitState::Handle(StateMachine &sm) +{ + int currState = sm.GetCurrentState(); + if (currState == UNDEFINED_STATE) { + sm.SetCurrentState(INIT_STATE); + HILOG_INFO(HILOG_MODULE_ACE, "undefined state -> init state"); + sm.BindParameters(); + // do this state's action: eval user js code and invoke life cycle callback + sm.EvalPage(); + sm.InvokePageLifeCycleCallback(PAGE_LIFECYCLE_ON_INIT); + sm.ChangeState(READY_STATE); + } else { + HILOG_ERROR(HILOG_MODULE_ACE, "current state(%d) is invalid when changing undefined state to init state.", + currState); + } +} + +void PageReadyState::Handle(StateMachine &sm) +{ + int currState = sm.GetCurrentState(); + if (currState == INIT_STATE) { + HILOG_INFO(HILOG_MODULE_ACE, "init state -> ready state"); + // do this state's action:call render to setup user interface + sm.RenderPage(); + sm.InvokePageLifeCycleCallback(PAGE_LIFECYCLE_CALLBACK_ON_READY); + sm.SetCurrentState(READY_STATE); + } else { + HILOG_ERROR(HILOG_MODULE_ACE, "current state(%d) is invalid when changing init state to ready state.", + currState); + } +} + +void PageShowState::Handle(StateMachine &sm) +{ + int currState = sm.GetCurrentState(); + if ((currState == READY_STATE) || (currState == BACKGROUND_STATE)) { + HILOG_INFO(HILOG_MODULE_ACE, "current state(%d) -> show state", currState); + // do this state's action: call show to display user interface + sm.ShowPage(); + sm.InvokePageLifeCycleCallback(PAGE_LIFECYCLE_CALLBACK_ON_SHOW); + sm.SetCurrentState(SHOW_STATE); + } else { + HILOG_ERROR(HILOG_MODULE_ACE, "current state(%d) is invalid when changing ready state to show state.", + currState); + } +} + +void PageBackgroundState::Handle(StateMachine &sm) +{ + int currState = sm.GetCurrentState(); + if ((currState == READY_STATE) || (currState == SHOW_STATE)) { + HILOG_INFO(HILOG_MODULE_ACE, "current state(%d) -> background state", currState); + sm.HidePage(); + sm.InvokePageLifeCycleCallback(PAGE_LIFECYCLE_CALLBACK_ON_HIDE); + sm.SetCurrentState(BACKGROUND_STATE); + } else { + HILOG_ERROR(HILOG_MODULE_ACE, "current state(%d) is invalid when changing show state to background state.", + currState); + } +} + +void PageDestroyState::Handle(StateMachine &sm) +{ + int currState = sm.GetCurrentState(); + // any normal state can jump to destory state + if ((currState >= INIT_STATE) || (FatalHandler::GetInstance().IsFatalErrorHitted())) { + HILOG_INFO(HILOG_MODULE_ACE, "current state(%d) -> destroy state", currState); + ACE_EVENT_PRINT(MT_ACE_RELEASE_HISTORY_PAGE, 0); + sm.InvokePageLifeCycleCallback(PAGE_LIFECYCLE_CALLBACK_ON_DESTROY); + sm.ReleaseHistoryPageResource(); + sm.SetCurrentState(DESTROY_STATE); + } else { + HILOG_ERROR(HILOG_MODULE_ACE, "current state(%d) is invalid when changing show state to destroy state.", + currState); + } +} +} // namespace ACELite +} // namespace OHOS diff --git a/src/core/router/js_page_state.h b/src/core/router/js_page_state.h new file mode 100755 index 0000000..dc90427 --- /dev/null +++ b/src/core/router/js_page_state.h @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2020 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. + */ + +#ifndef OHOS_ACELITE_JS_PAGE_STATE_H +#define OHOS_ACELITE_JS_PAGE_STATE_H + +#include "js_page_state_machine.h" + +namespace OHOS { +namespace ACELite { +class State : public MemoryHeap { +public: + State() {} + virtual ~State() {} + virtual void Handle(StateMachine& sm) = 0; +}; + +class PageInitState final : public State { + void Handle(StateMachine& sm) override; +}; + +class PageReadyState final : public State { + void Handle(StateMachine& sm) override; +}; + +class PageShowState final : public State { + void Handle(StateMachine& sm) override; +}; + +class PageBackgroundState final : public State { + void Handle(StateMachine& sm) override; +}; + +class PageDestroyState final : public State { + void Handle(StateMachine& sm) override; +}; +} // namespace ACELite +} // namespace OHOS +#endif // OHOS_ACELITE_JS_PAGE_STATE_H diff --git a/src/core/router/js_page_state_machine.cpp b/src/core/router/js_page_state_machine.cpp new file mode 100755 index 0000000..1c1dd8d --- /dev/null +++ b/src/core/router/js_page_state_machine.cpp @@ -0,0 +1,450 @@ +/* + * Copyright (c) 2020 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. + */ +#include "js_page_state_machine.h" +#include "ace_log.h" +#include "component.h" +#include "js_async_work.h" +#include "js_page_state.h" +#include "module_manager.h" +#include "root_view.h" +#if ENABLED(SECURE_C_FUNCTION) +#include "securec.h" +#endif // ENABLED(SECURE_C_FUNCTION) +#include "directive/descriptor_utils.h" +#include "fatal_handler.h" +#include "js_app_environment.h" +#include "js_profiler.h" +#include "jsi.h" + +namespace OHOS { +namespace ACELite { +StateMachine::StateMachine() +{ + currentState_ = UNDEFINED_STATE; + for (int i = 0; i < PAGE_STATE_SIZE; i++) { + stateMap_[i] = nullptr; + } + jsPagePath_ = nullptr; + appRootPath_ = nullptr; + appContext_ = nullptr; + uri_ = nullptr; + viewModel_ = UNDEFINED; + nativeElement_ = UNDEFINED; + object_ = UNDEFINED; + hasParams_ = false; + isEntireHidden_ = false; + watchersHead_ = nullptr; + scrollLayer_ = nullptr; +} + +StateMachine::~StateMachine() +{ + // release this page's all resource + // if error hapens, statemachie must force to jump to destroy state for releasing resource. + if ((currentState_ >= INIT_STATE) || FatalHandler::GetInstance().IsFatalErrorHitted()) { + ChangeState(BACKGROUND_STATE); + ChangeState(DESTROY_STATE); + } + for (int i = 0; i < PAGE_STATE_SIZE; i++) { + if (stateMap_[i] != nullptr) { + delete stateMap_[i]; + } + } + if (uri_ != nullptr) { + ace_free(uri_); + uri_ = nullptr; + } + if (jsPagePath_ != nullptr) { + ace_free(jsPagePath_); + jsPagePath_ = nullptr; + } + if (!jerry_value_is_undefined(object_)) { + jerry_release_value(object_); + } +} + +void StateMachine::SetCurrentState(int8_t newState) +{ + if (newState <= UNDEFINED_STATE || newState >= END_STATE) { + HILOG_ERROR(HILOG_MODULE_ACE, "error input state:%d", newState); + return; + } + currentState_ = newState; +} + +int StateMachine::GenerateJsPagePath(const char * const uri) +{ + size_t uriLen = strlen(uri); + if (uriLen >= PATH_LENGTH_MAX) { + return ERROR_INPUT_PARAMETER; + } + size_t len = uriLen; + // if path is "/", load defaut page of app.(appRootPath/index/index.js) +#if JS_PAGE_SPECIFIC + if (jsPageSpecific.jsIndexFilePath == nullptr) { + jsPageSpecific.jsIndexFilePath = const_cast(JS_INDEX_FILE_PATH); + } + len = strlen(jsPageSpecific.jsIndexFilePath); + if (len < uriLen) { + len = uriLen; + } +#else + if ((uriLen == 1) && (uri[0] == PATH_DEFAULT[0])) { + len = strlen(JS_INDEX_FILE_PATH); + } +#endif + const char * const sourceFileSuffix = (JsAppEnvironment::GetInstance()->IsSnapshotMode()) ? ".bc" : ".js"; + len += strlen(sourceFileSuffix); + // add ending character:'\0' + len += 1; + jsPagePath_ = static_cast(ace_malloc(len)); + if (jsPagePath_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "malloc path memory heap failed."); + return ERROR_MALLOC; + } + jsPagePath_[0] = '\0'; + errno_t err = 0; + if ((uriLen == 1) && (uri[0] == PATH_DEFAULT[0])) { +#if JS_PAGE_SPECIFIC + err = strcpy_s(jsPagePath_, len, jsPageSpecific.jsIndexFilePath); +#else + err = strcpy_s(jsPagePath_, len, JS_INDEX_FILE_PATH); +#endif + } else { + err = strcpy_s(jsPagePath_, len, uri); + } + err += strcat_s(jsPagePath_, len, sourceFileSuffix); + if (err != 0) { + HILOG_ERROR(HILOG_MODULE_ACE, "use secure function errro(%d)", err); + ace_free(jsPagePath_); + jsPagePath_ = nullptr; + return ERROR_SECURE_USE; + } + return SUCCESS; +} + +void StateMachine::RegisterUriAndParamsToPage(const char * const uri, jerry_value_t params) +{ + jerry_value_t globalObject = jerry_get_global_object(); + if (!IS_UNDEFINED(params)) { + // add $page.path property + JerrySetStringProperty(params, ROUTER_PAGE_PATH, uri); + JerrySetNamedProperty(globalObject, ROUTER_PAGE, params); + hasParams_ = true; + } else { + jerry_value_t pagePropName = jerry_create_string(reinterpret_cast(ROUTER_PAGE)); + bool success = jerry_delete_property(globalObject, pagePropName); + if (!success) { + HILOG_ERROR(HILOG_MODULE_ACE, "delete $page property failed from global object."); + } + jerry_release_value(pagePropName); + } + jerry_release_value(globalObject); +} + +bool StateMachine::Init(jerry_value_t object, jerry_value_t &jsRes) +{ + appContext_ = JsAppContext::GetInstance(); + appRootPath_ = const_cast(appContext_->GetCurrentAbilityPath()); + if ((appRootPath_ == nullptr) || (strlen(appRootPath_) == 0)) { + HILOG_ERROR(HILOG_MODULE_ACE, "statemachine init failed as this app's root path is invalid."); + return false; + } + // create new references to object's value,otherwise jerry engine will crash. + object_ = jerry_acquire_value(object); + appContext_->SetCurrentJsPath(jsPagePath_); + stateMap_[INIT_STATE] = new PageInitState(); + stateMap_[READY_STATE] = new PageReadyState(); + stateMap_[SHOW_STATE] = new PageShowState(); + stateMap_[BACKGROUND_STATE] = new PageBackgroundState(); + stateMap_[DESTROY_STATE] = new PageDestroyState(); + return BindUri(jsRes); +} + +bool StateMachine::BindUri(jerry_value_t &jsRes) +{ + // check1:object undefined or type error + if (!jerry_value_is_object(object_)) { + HILOG_ERROR(HILOG_MODULE_ACE, "statemachine init failed as object is invalid."); + jsRes = jerry_create_error(JERRY_ERROR_TYPE, + reinterpret_cast("param of router should be object.")); + return false; + } + // check2:object's uri is undefined or is not string + jerry_value_t uriValue = jerryx_get_property_str(object_, ROUTER_PAGE_URI); + if (!jerry_value_is_string(uriValue)) { + jerry_release_value(uriValue); + HILOG_ERROR(HILOG_MODULE_ACE, "statemachine init failed as uri is invalid."); + jsRes = jerry_create_error(JERRY_ERROR_TYPE, + reinterpret_cast("uri value type should be string.")); + return false; + } + uri_ = MallocStringOf(uriValue); + jerry_release_value(uriValue); + if (uri_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "statemachine init failed as uri is invalid."); + return false; + } + // check3:object's uri is empty + if (strlen(uri_) == 0) { + ace_free(uri_); + uri_ = nullptr; + HILOG_ERROR(HILOG_MODULE_ACE, "statemachine init failed as uri is empty."); + jsRes = jerry_create_error(JERRY_ERROR_URI, + reinterpret_cast("uri value can't be empty.")); + return false; + } + int result = GenerateJsPagePath(uri_); + // check4:generate js file's path failed + if (result != SUCCESS) { + ace_free(uri_); + uri_ = nullptr; + HILOG_ERROR(HILOG_MODULE_ACE, "statemachine init failed as generating js file's path failed."); + jsRes = jerry_create_error(JERRY_ERROR_URI, reinterpret_cast("uri value path error.")); + return false; + } + // check5:object's uri is not existed, need to move + char *fullPath = RelocateJSSourceFilePath(appRootPath_, jsPagePath_); + if (GetFileSize(fullPath) == 0) { + ACE_FREE(fullPath); + ace_free(uri_); + uri_ = nullptr; + HILOG_ERROR(HILOG_MODULE_ACE, "statemachine init failed as js file isn't existed."); + jsRes = jerry_create_error(JERRY_ERROR_URI, + reinterpret_cast("route target doesn't existed.")); + return false; + } + ACE_FREE(fullPath); + return true; +} + +void StateMachine::BindParameters() +{ + jerry_value_t params = jerryx_get_property_str(object_, ROUTER_PAGE_PARAMS); + RegisterUriAndParamsToPage(uri_, params); + jerry_release_value(params); + if (uri_ != nullptr) { + ace_free(uri_); + uri_ = nullptr; + } +} + +void StateMachine::ChangeState(int newState) +{ + if ((newState <= UNDEFINED_STATE) || (newState >= END_STATE)) { + HILOG_ERROR(HILOG_MODULE_ACE, "error input state:%d", newState); + return; + } + // jump to new State + State *state = stateMap_[newState]; + if (state != nullptr) { + state->Handle(*this); + } +} + +void StateMachine::EvalPage() +{ + // load user's js code and eval it, rootPath/jsPagePath_. + // for example, router.replace("/"), should load rootPath/index/index.js + // router.replace("pages/detail/detail"), should load rootPath/pages/detail/detail.js + char *pageFilePath = RelocateJSSourceFilePath(appRootPath_, jsPagePath_); + if (pageFilePath == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "relocat page JS file failed"); + return; + } + + viewModel_ = appContext_->Eval(pageFilePath, strlen(pageFilePath), false); + if (IS_UNDEFINED(viewModel_)) { + HILOG_ERROR(HILOG_MODULE_ACE, "Eval JS file failed"); + ace_free(pageFilePath); + pageFilePath = nullptr; + return; + } + + jerry_value_t params = jerryx_get_property_str(object_, ROUTER_PAGE_PARAMS); + jerry_value_t keys = jerry_get_object_keys(params); + uint16_t size = jerry_get_array_length(keys); + for (uint16_t idx = 0; idx < size; ++idx) { + jerry_value_t key = jerry_get_property_by_index(keys, idx); + jerry_value_t value = jerry_get_property(params, key); + jerry_release_value(jerry_set_property(viewModel_, key, value)); + ReleaseJerryValue(value, key, VA_ARG_END_FLAG); + } + ReleaseJerryValue(keys, params, VA_ARG_END_FLAG); + + ace_free(pageFilePath); + pageFilePath = nullptr; +} + +static void ForceGC(void *data) +{ + static_cast(data); + jerry_gc(jerry_gc_mode_t::JERRY_GC_PRESSURE_HIGH); +#if ENABLED(JS_PROFILER) + if (JSProfiler::GetInstance()->IsEnabled()) { + // dump the JS heap status + JSHeapStatus heapStatus; + if (JSI::GetJSHeapStatus(heapStatus)) { + HILOG_DEBUG(HILOG_MODULE_ACE, "JS Heap allocBytes[%d], peakAllocBytes[%d]", heapStatus.allocBytes, + heapStatus.peakAllocBytes); + } + } +#endif +} + +void StateMachine::RenderPage() +{ + START_TRACING(RENDER); + nativeElement_ = appContext_->Render(viewModel_); + // append scroll layer to the outermost view + scrollLayer_ = new ScrollLayer(); + if (scrollLayer_ != nullptr) { + scrollLayer_->AppendScrollLayer(nativeElement_); + } + Component::HandlerAnimations(); + // trigger an async full GC after completing the heavy work, which will + // be executed after the whole page showing process + JsAsyncWork::DispatchAsyncWork(ForceGC, nullptr); + STOP_TRACING(); +} + +jerry_value_t StateMachine::ShowPage() const +{ + if (isEntireHidden_) { + HILOG_WARN(HILOG_MODULE_ACE, "showpage: the whole application already in background, do not operate rootview"); + return nativeElement_; + } + START_TRACING(ADD_TO_ROOT_VIEW); + if (scrollLayer_ != nullptr) { + scrollLayer_->Show(); + } + STOP_TRACING(); + return nativeElement_; +} + +void StateMachine::HidePage() const +{ + if (isEntireHidden_) { + HILOG_WARN(HILOG_MODULE_ACE, "hidepage: the whole application already in background, do not operate rootview"); + return; + } + if (scrollLayer_ != nullptr) { + scrollLayer_->Hide(); + } + // trigger an async full GC after hiding the page + JsAsyncWork::DispatchAsyncWork(ForceGC, nullptr); +} + +void StateMachine::InvokePageLifeCycleCallback(const char * const name) const +{ + if (FatalHandler::GetInstance().IsJSRuntimeFatal()) { + // can not continue to involve any JS object creating on engine in case runtime fatal + return; + } + if ((name == nullptr) || (strlen(name) == 0)) { + HILOG_ERROR(HILOG_MODULE_ACE, "input parameter is invalid when invoking page life cycle callback."); + return; + } + + jerry_value_t function = jerryx_get_property_str(viewModel_, name); + if (IS_UNDEFINED(function)) { + // user does not set onInit method + return; + } + CallJSFunctionAutoRelease(function, viewModel_, nullptr, 0); + jerry_release_value(function); +} + +void StateMachine::ReleaseRootObject() const +{ + if (FatalHandler::GetInstance().IsJSRuntimeFatal()) { + // can not continue to involve any JS object creating on engine in case runtime fatal + return; + } + // delete params properties from global object + jerry_value_t globalObject = jerry_get_global_object(); + if (hasParams_) { + jerry_value_t pagePropName = jerry_create_string(reinterpret_cast(ROUTER_PAGE)); + bool success = jerry_delete_property(globalObject, pagePropName); + if (!success) { + HILOG_ERROR(HILOG_MODULE_ACE, "delete $page property failed from global object."); + } + jerry_release_value(pagePropName); + } + + // delete "$root" attribute from global object + jerry_value_t appPropName = jerry_create_string(reinterpret_cast(ATTR_ROOT)); + bool success = jerry_delete_property(globalObject, appPropName); + if (!success) { + HILOG_ERROR(HILOG_MODULE_ACE, "delete $root property failed from global object."); + } + ReleaseJerryValue(globalObject, appPropName, VA_ARG_END_FLAG); +} + +void StateMachine::ReleaseHistoryPageResource() +{ + // remove all native views and release components styles. + if (appContext_ != nullptr) { + appContext_->ReleaseStyles(); + if (!isEntireHidden_) { + // if the whole application is in background, avoid operating the rootview + appContext_->RemoveAllView(); + } + } + // release scroll layer object. + if (scrollLayer_ != nullptr) { + delete (scrollLayer_); + scrollLayer_ = nullptr; + } + // if some fatal error happens and is hanled by FatalHandler, the resource is already + // recycled by it, do not repeat the recycling + if (!FatalHandler::GetInstance().IsFatalErrorHandleDone()) { + // release all native views and their binding js objects + DescriptorUtils::ReleaseDescriptorOrElement(nativeElement_); + } + + ReleaseRootObject(); + + // release current page's viewModel js object + jerry_release_value(viewModel_); + + // release animations + Component::ReleaseAnimations(); + + // clean up native module objects required + ModuleManager::GetInstance()->CleanUpModule(); +} + +void StateMachine::DeleteViewModelProperties() const +{ + if (IS_UNDEFINED(viewModel_)) { + return; + } + jerry_value_t keys = jerry_get_object_keys(viewModel_); + uint32_t size = jerry_get_array_length(keys); + for (uint32_t index = 0; index < size; index++) { + jerry_value_t key = jerry_get_property_by_index(keys, index); + jerry_delete_property(viewModel_, key); + jerry_release_value(key); + } + jerry_release_value(keys); +} + +void StateMachine::SetHiddenFlag(bool flag) +{ + isEntireHidden_ = flag; +} +} // namespace ACELite +} // namespace OHOS diff --git a/src/core/router/js_page_state_machine.h b/src/core/router/js_page_state_machine.h new file mode 100755 index 0000000..2b2e3d1 --- /dev/null +++ b/src/core/router/js_page_state_machine.h @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2020 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. + */ + +#ifndef OHOS_ACELITE_JS_PAGE_STATE_MACHINE_H +#define OHOS_ACELITE_JS_PAGE_STATE_MACHINE_H + +#include "js_app_context.h" +#include "non_copyable.h" +#include "scroll_layer.h" + +namespace OHOS { +namespace ACELite { +enum { + UNDEFINED_STATE = -1, + INIT_STATE, // 0 + READY_STATE, + SHOW_STATE, + BACKGROUND_STATE, + DESTROY_STATE, + END_STATE +}; +#define PAGE_STATE_SIZE END_STATE + +constexpr char PAGE_LIFECYCLE_ON_INIT[] = "onInit"; +constexpr char PAGE_LIFECYCLE_CALLBACK_ON_READY[] = "onReady"; +constexpr char PAGE_LIFECYCLE_CALLBACK_ON_SHOW[] = "onShow"; +constexpr char PAGE_LIFECYCLE_CALLBACK_ON_HIDE[] = "onHide"; +constexpr char PAGE_LIFECYCLE_CALLBACK_ON_DESTROY[] = "onDestroy"; + +#if JS_PAGE_SPECIFIC +extern JSPageSpecific jsPageSpecific; +#endif + +class State; +class StateMachine final : public MemoryHeap { +public: + ACE_DISALLOW_COPY_AND_MOVE(StateMachine); + StateMachine(); + ~StateMachine(); + bool Init(jerry_value_t object, jerry_value_t &msg); + void ChangeState(int newState); + void BindParameters(); + bool BindUri(jerry_value_t &msg); + int8_t GetCurrentState() const + { + return currentState_; + } + void EvalPage(); + void RenderPage(); + jerry_value_t ShowPage() const; + void HidePage() const; + void SetCurrentState(int8_t newState); + void InvokePageLifeCycleCallback(const char * const name) const; + void ReleaseHistoryPageResource(); + void SetHiddenFlag(bool flag); + +private: + void RegisterUriAndParamsToPage(const char * const uri, jerry_value_t params); + int GenerateJsPagePath(const char * const uri); + void DeleteViewModelProperties() const; + void ReleaseRootObject() const; + +private: + int8_t currentState_; + State *stateMap_[PAGE_STATE_SIZE]; + char *jsPagePath_; + char *appRootPath_; + char *uri_; + JsAppContext *appContext_; + jerry_value_t viewModel_; // the object evaled from user JS code + jerry_value_t nativeElement_; // the object returned from render function + jerry_value_t object_; // object transferred from one page to another page + bool hasParams_; // the flag representation for whether having params of object_ + bool isEntireHidden_; // representing if the whole app is in background + Watcher *watchersHead_; // head of watchers list + ScrollLayer *scrollLayer_; +}; +} // namespace ACELite +} // namespace OHOS + +#endif // OHOS_ACELITE_JS_PAGE_STATE_MACHINE_H diff --git a/src/core/router/js_router.cpp b/src/core/router/js_router.cpp new file mode 100755 index 0000000..2f19659 --- /dev/null +++ b/src/core/router/js_router.cpp @@ -0,0 +1,125 @@ +/* + * Copyright (c) 2020 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. + */ + +#include "js_router.h" + +#include "ace_log.h" +#include "js_async_work.h" +#include "js_page_state_machine.h" +#include "js_profiler.h" + +namespace OHOS { +namespace ACELite { +static void ReplaceAsync(void *data) +{ + if (data == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "replace async failed with null input parameter"); + return; + } + // void* can not be dynamically_casted from + auto router = static_cast(data); + router->ReplaceSync(); + OUTPUT_TRACE(); +} + +jerry_value_t Router::Replace(jerry_value_t object, bool async) +{ + if (newSm_ != nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "router is replacing, can not handle the new request"); + return UNDEFINED; + } + StateMachine *newSm = new StateMachine(); + if (newSm == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "malloc state machine memory heap failed."); + return UNDEFINED; + } + // init new state machine + jerry_value_t jsRes = jerry_create_undefined(); + bool res = newSm->Init(object, jsRes); + if (!res) { + delete newSm; + return jsRes; + } + newSm_ = newSm; + // dispatch the new page rendering to the async handling as the current context of + // router.replace need to be released, which need to return out from the scope + if (async) { + if (!JsAsyncWork::DispatchAsyncWork(ReplaceAsync, this)) { + // request replacing failed, no chance to do it, release the new state machine + HILOG_ERROR(HILOG_MODULE_ACE, "dispatch replacing request failed"); + delete newSm_; + newSm_ = nullptr; + } + } else { + // for the first startup of application, no need to do the async replace + ReplaceSync(); + } + return jsRes; +} + +void Router::ReplaceSync() +{ + if (newSm_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "replace sync failed, new sm should be prepared"); + return; + } + START_TRACING(ROUTER_REPLACE); + // new state machine run successfully to show new page, then need to release old state machine. + if (currentSm_ != nullptr) { + delete currentSm_; + currentSm_ = nullptr; + } + // new state machine should to be current. + currentSm_ = newSm_; + newSm_ = nullptr; + currentSm_->SetHiddenFlag(hidden_); + // run state machine and start to jump to init state. + currentSm_->ChangeState(INIT_STATE); + if (hidden_) { + HILOG_DEBUG(HILOG_MODULE_ACE, "the whole application is in background, move to HIDE state directly"); + // the whole app is in background, move to HIDE state immediately + currentSm_->ChangeState(BACKGROUND_STATE); + } else { + // above call will move sm into ready state, than let the page show + currentSm_->ChangeState(SHOW_STATE); + } + STOP_TRACING(); +} + +void Router::Show() +{ + if (currentSm_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "no SM when performing show"); + return; + } + + hidden_ = false; + currentSm_->SetHiddenFlag(hidden_); + currentSm_->ChangeState(SHOW_STATE); +} + +void Router::Hide() +{ + if (currentSm_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "no SM when performing background"); + return; + } + + currentSm_->ChangeState(BACKGROUND_STATE); + hidden_ = true; + currentSm_->SetHiddenFlag(hidden_); +} +} // namespace ACELite +} // namespace OHOS diff --git a/src/core/router/js_router.h b/src/core/router/js_router.h new file mode 100755 index 0000000..fa561a6 --- /dev/null +++ b/src/core/router/js_router.h @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2020 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. + */ +#ifndef OHOS_ACELITE_JS_ROUTER_H +#define OHOS_ACELITE_JS_ROUTER_H + +#include "js_page_state_machine.h" +#include "non_copyable.h" + +namespace OHOS { +namespace ACELite { +class Router final : public MemoryHeap { +public: + ACE_DISALLOW_COPY_AND_MOVE(Router); + Router() : currentSm_(nullptr), newSm_(nullptr), hidden_(false) {} + ~Router() + { + if (currentSm_ != nullptr) { + delete currentSm_; + } + } + jerry_value_t Replace(jerry_value_t object, bool async = true); + void ReplaceSync(); + void Show(); + void Hide(); + +private: + StateMachine *currentSm_; // current state machine for current shown page + StateMachine *newSm_; // current state machine for target showing page + bool hidden_; // the flag representing whether the whole app is moved to background +}; +} // namespace ACELite +} // namespace OHOS + +#endif // OHOS_ACELITE_JS_ROUTER_H diff --git a/src/core/stylemgr/BUILD.gn b/src/core/stylemgr/BUILD.gn new file mode 100755 index 0000000..6b8002c --- /dev/null +++ b/src/core/stylemgr/BUILD.gn @@ -0,0 +1,27 @@ +#Copyright (c) 2020 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. + +source_set("stylemgr") { + configs += [ + "//foundation/ace/lite/jsfwk:ace_config", + ] + sources = [ + "app_style_list.cpp", + "app_style_sheet.cpp", + "app_style_item.cpp", + "app_style_manager.cpp", + "app_style.cpp", + ] + include_dirs = [ + ] +} diff --git a/src/core/stylemgr/app_style.cpp b/src/core/stylemgr/app_style.cpp new file mode 100755 index 0000000..0a74e32 --- /dev/null +++ b/src/core/stylemgr/app_style.cpp @@ -0,0 +1,336 @@ +/* + * Copyright (c) 2020 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. + */ + +#include "stylemgr/app_style.h" +#include "ace_log.h" +#if ENABLED(SECURE_C_FUNCTION) +#include "securec.h" +#endif // ENABLED(SECURE_C_FUNCTION) + +namespace OHOS { +namespace ACELite { +void AppStyle::SetStyleName(const char * const name, size_t nameLen) +{ + if ((name == nullptr) || (strlen(name) == 0) || (nameLen <= 0) || (nameLen >= NAME_LENGTH_MAX)) { + return; + } + styleName_ = static_cast(ace_malloc(sizeof(char) * (nameLen + 1))); + if (styleName_ == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "create style_name failed."); + return; + } + if (memcpy_s(styleName_, nameLen, name, nameLen) != 0) { + HILOG_ERROR(HILOG_MODULE_ACE, "style_name set string value error"); + ace_free(styleName_); + styleName_ = nullptr; + return; + } + *(styleName_ + nameLen) = '\0'; +} + +void AppStyle::Reset() +{ + const AppStyleItem *next = nullptr; + while (firstStyleItem_ != nullptr) { + next = firstStyleItem_->GetNext(); + delete firstStyleItem_; + firstStyleItem_ = next; + } + lastStyleItem_ = nullptr; + if (styleName_ != nullptr) { + ace_free(styleName_); + styleName_ = nullptr; + } +} + +void AppStyle::AddStyleItem(AppStyleItem *newStyleItem) +{ + if (newStyleItem == nullptr) { + return; + } + + if (firstStyleItem_ == nullptr) { + firstStyleItem_ = newStyleItem; + lastStyleItem_ = newStyleItem; + } else { + newStyleItem->SetPre(lastStyleItem_); + lastStyleItem_->SetNext(newStyleItem); + lastStyleItem_ = newStyleItem; + } +} + +const AppStyleItem *AppStyle::GetStyleItemByName(const char * const stylePropName) const +{ + if (stylePropName == nullptr) { + return nullptr; + } + size_t len = strlen(stylePropName); + uint16_t keyId = KeyParser::ParseKeyId(stylePropName, len); + return GetStyleItemByNameId(keyId); +} + +const AppStyleItem *AppStyle::GetStyleItemByNameId(uint16_t stylePropNameId) const +{ + if (!KeyParser::IsKeyValid(stylePropNameId)) { + return nullptr; + } + + const AppStyleItem *styleItem = firstStyleItem_; + while (styleItem != nullptr) { + if (styleItem->GetPropNameId() == stylePropNameId) { + return styleItem; + } + + styleItem = styleItem->GetNext(); + } + return nullptr; +} + +void AppStyle::AddItemsInLoop(jerry_value_t object, AppStyle &newStyle) +{ + jerry_value_t propKeys = jerry_get_object_keys(object); + uint16_t propKeySize = jerry_get_array_length(propKeys); + for (uint16_t index = 0; index < propKeySize; index++) { + // convert prop key into char + jerry_value_t propKey = jerry_get_property_by_index(propKeys, index); + jerry_value_t propValue = jerry_get_property(object, propKey); + AppStyleItem *newStyleItem = AppStyleItem::GenerateFromJSValue(propKey, propValue); + newStyle.AddStyleItem(newStyleItem); + ReleaseJerryValue(propKey, propValue, VA_ARG_END_FLAG); + } + jerry_release_value(propKeys); +} + +void AppStyle::AddKeyFramesItemsInLoop(jerry_value_t objFrom, jerry_value_t objTo, AppStyle &newStyle) +{ + if (jerry_value_is_null(objFrom) || jerry_value_is_null(objTo)) { + return; + } + jerry_value_t propKeysFrom = jerry_get_object_keys(objFrom); + uint16_t propKeySizeFrom = jerry_get_array_length(propKeysFrom); + + jerry_value_t propKeyFrom; + jerry_value_t propValueFrom; + jerry_value_t propValueTo; + jerry_value_t propValue = UNDEFINED; + + char *keyFrom = nullptr; + AppStyleItem *newStyleItem = nullptr; + for (uint16_t i = 0; i < propKeySizeFrom; i++) { + bool isItemNeedToAdd = false; + propKeyFrom = jerry_get_property_by_index(propKeysFrom, i); // transform, height, background-color + propValueFrom = jerry_get_property(objFrom, propKeyFrom); // {\"translateX\":\"50px\"}, -5px, #f76160 + propValueTo = jerry_get_property(objTo, propKeyFrom); + + if (JerryHasProperty(objTo, propKeyFrom)) { // key exist in to object + keyFrom = MallocStringOf(propKeyFrom); + const char * const transitionTransform = "transform"; + if ((keyFrom != nullptr) && + !strcmp(keyFrom, transitionTransform)) { // transform type, include "translateX, translateY, rotate" + propValue = AddKeyFramesTransformValue(propValueFrom, propValueTo, isItemNeedToAdd, propKeyFrom); + } else { + isItemNeedToAdd = true; + propValue = ConcatJerryString(propValueFrom, propValueTo); + } + if (keyFrom != nullptr) { + ace_free(keyFrom); + keyFrom = nullptr; + } + } + + if (isItemNeedToAdd) { + newStyleItem = AppStyleItem::GenerateFromJSValue(propKeyFrom, propValue); + newStyle.AddStyleItem(newStyleItem); + jerry_release_value(propValue); + } + ReleaseJerryValue(propKeyFrom, propValueFrom, propValueTo, VA_ARG_END_FLAG); + } + + jerry_release_value(propKeysFrom); +} + +jerry_value_t AppStyle::AddKeyFramesTransformValue(jerry_value_t propValueFrom, + jerry_value_t propValueTo, + bool &isItemNeedToAdd, + jerry_value_t &propKeyFrom) +{ + jerry_value_t propValue = UNDEFINED; + if (jerry_value_is_undefined(propValueFrom) || jerry_value_is_undefined(propValueTo)) { + HILOG_ERROR(HILOG_MODULE_ACE, "transform prop value must be set."); + return propValue; + } + jerry_value_t transformKeysFrom = jerry_get_object_keys(propValueFrom); + jerry_value_t transformKeysTo = jerry_get_object_keys(propValueTo); + if ((!jerry_value_is_undefined(transformKeysFrom)) && (!jerry_value_is_undefined(transformKeysTo))) { + int8_t valueIndex = 0; + jerry_value_t transformKeyFrom = jerry_get_property_by_index(transformKeysFrom, valueIndex); + jerry_value_t transformKeyTo = jerry_get_property_by_index(transformKeysTo, valueIndex); + if (transformKeyFrom == transformKeyTo) { + jerry_value_t transformValueFrom = jerry_get_property(propValueFrom, transformKeyFrom); + jerry_value_t transformValueTo = jerry_get_property(propValueTo, transformKeyTo); + if ((!jerry_value_is_undefined(transformValueFrom)) && (!jerry_value_is_undefined(transformValueTo))) { + jerry_release_value(propKeyFrom); + propKeyFrom = jerry_acquire_value(transformKeyFrom); + isItemNeedToAdd = true; + propValue = ConcatJerryString(transformValueFrom, transformValueTo); + } else { + HILOG_ERROR(HILOG_MODULE_ACE, "None style to parse."); + } + ReleaseJerryValue(transformValueFrom, transformValueTo, VA_ARG_END_FLAG); + } + ReleaseJerryValue(transformKeyFrom, transformKeyTo, VA_ARG_END_FLAG); + } else { + HILOG_ERROR(HILOG_MODULE_ACE, "None style to parse."); + } + ReleaseJerryValue(transformKeysFrom, transformKeysTo, VA_ARG_END_FLAG); + + return propValue; +} + +bool AppStyle::MergeAnimationString(char *dest, uint16_t destSz, const char * const src1, const char * const src2) +{ + if (strcat_s(dest, destSz, src1) != 0) { + return false; + } + if (strcat_s(dest, destSz, ANIMATION_VALUE_SEP) != 0) { + return false; + } + if (strcat_s(dest, destSz, src2) != 0) { + return false; + } + dest[destSz - 1] = '\0'; + return true; +} + +jerry_value_t AppStyle::ConcatJerryString(jerry_value_t strA, jerry_value_t strB) +{ + char *stringA = MallocStringOf(strA); + if (stringA == nullptr) { + return jerry_create_null(); + } + char *stringB = MallocStringOf(strB); + if (stringB == nullptr) { + ace_free(stringA); + stringA = nullptr; + return jerry_create_null(); + } + const char * const pixelUnit = "px"; + char *next = nullptr; + char *strtokA = stringA; + char *strtokB = stringB; + if (strstr(stringA, pixelUnit)) { + strtokA = strtok_s(stringA, pixelUnit, &next); + } + if (strstr(stringB, pixelUnit)) { + strtokB = strtok_s(stringB, pixelUnit, &next); + } + if ((strtokA == nullptr) || (strtokB == nullptr)) { + ace_free(stringA); + stringA = nullptr; + ace_free(stringB); + stringB = nullptr; + return jerry_create_null(); + } + size_t strtokALen = strlen(strtokA); + size_t strtokBLen = strlen(strtokB); + if ((strtokALen == 0) || (strtokALen >= (UINT16_MAX - 1)) || (strtokBLen == 0) || + (strtokBLen >= (UINT16_MAX - 1))) { + ace_free(stringA); + stringA = nullptr; + ace_free(stringB); + stringB = nullptr; + return jerry_create_null(); + } + bool result = true; + size_t size = strlen(strtokA) + strlen(strtokB) + strlen(ANIMATION_VALUE_SEP) + 1; + const uint16_t maxBytesNum = 1024; + if ((size == 0) || (size >= maxBytesNum)) { // we only support 1kb + result = false; + } + char *newStr = nullptr; + if (result) { + newStr = static_cast(ace_malloc(size)); + if (newStr == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "malloc space error"); + ace_free(stringA); + stringA = nullptr; + ace_free(stringB); + stringB = nullptr; + return jerry_create_null(); + } + newStr[0] = '\0'; + } + + if (result) { + result = MergeAnimationString(newStr, size, strtokA, strtokB); + } + + jerry_value_t propValue; + if (result) { + propValue = jerry_create_string(reinterpret_cast(newStr)); + } else { + propValue = jerry_create_null(); + } + ace_free(stringA); + stringA = nullptr; + ace_free(stringB); + stringB = nullptr; + ace_free(newStr); + newStr = nullptr; + return propValue; +} + +AppStyle *AppStyle::GenerateFromJS(jerry_value_t styleKey, jerry_value_t styleValue, bool isKeyFrames) +{ + char *styleNameBuffer = MallocStringOf(styleKey); + size_t strLen = 0; + if (styleNameBuffer == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "convert style name to char failed, will be dropped\n"); + return nullptr; + } else { + strLen = strlen(styleNameBuffer); + if (strLen == 0 || (strLen >= UINT16_MAX)) { + HILOG_ERROR(HILOG_MODULE_ACE, "style name length is 0 or max, will be dropped\n"); + ace_free(styleNameBuffer); + styleNameBuffer = nullptr; + return nullptr; + } + } + + AppStyle *newStyle = new AppStyle(); + if (newStyle == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "create style error"); + ace_free(styleNameBuffer); + styleNameBuffer = nullptr; + return nullptr; + } + + newStyle->SetStyleName((const char *)styleNameBuffer, strLen); // translateX #aaa + ace_free(styleNameBuffer); + styleNameBuffer = nullptr; + + if (isKeyFrames) { + jerry_value_t fromObj = jerry_get_property_by_index(styleValue, 0); + jerry_value_t toObj = jerry_get_property_by_index(styleValue, 1); + AddKeyFramesItemsInLoop(fromObj, toObj, *newStyle); + ReleaseJerryValue(toObj, fromObj, VA_ARG_END_FLAG); + } else { + AddItemsInLoop(styleValue, *newStyle); + } + + return newStyle; +} +} // namespace ACELite +} // namespace OHOS diff --git a/src/core/stylemgr/app_style.h b/src/core/stylemgr/app_style.h new file mode 100755 index 0000000..2795da4 --- /dev/null +++ b/src/core/stylemgr/app_style.h @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2020 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. + */ +#ifndef OHOS_ACELITE_APP_STYLE_H +#define OHOS_ACELITE_APP_STYLE_H + +#include "non_copyable.h" +#include "stylemgr/app_style_item.h" +#if ENABLED(SECURE_C_FUNCTION) +#include "securec.h" +#endif // ENABLED(SECURE_C_FUNCTION) + +namespace OHOS { +namespace ACELite { +class AppStyle final : public MemoryHeap { +public: + ACE_DISALLOW_COPY_AND_MOVE(AppStyle); + AppStyle() : firstStyleItem_(nullptr), lastStyleItem_(nullptr), pre_(nullptr), next_(nullptr), styleName_(nullptr) + { + } + + ~AppStyle() + { + Reset(); + } + + const char* GetStyleName() + { + return styleName_; + } + + const AppStyleItem* GetFirst() const + { + return firstStyleItem_; + } + + void SetPre(AppStyle* preStyle) + { + if (preStyle == nullptr) { + return; + } + + pre_ = preStyle; + } + + AppStyle* GetPre() + { + return pre_; + } + + void SetNext(AppStyle* nextStyle) + { + if (nextStyle == nullptr) { + return; + } + next_ = nextStyle; + } + + const AppStyle* GetNext() + { + return next_; + } + + void Reset(); + void AddStyleItem(AppStyleItem* newStyleItem); + const AppStyleItem* GetStyleItemByName(const char * const stylePropName) const; + const AppStyleItem* GetStyleItemByNameId(uint16_t stylePropNameId) const; + static AppStyle* GenerateFromJS(jerry_value_t styleKey, jerry_value_t styleValue, bool isKeyFrames); + +private: + void SetStyleName(const char * const name, size_t nameLen); + static void AddItemsInLoop(jerry_value_t object, AppStyle& newStyle); + static void AddKeyFramesItemsInLoop(jerry_value_t objFrom, jerry_value_t objTo, AppStyle& newStyle); + static jerry_value_t AddKeyFramesTransformValue(jerry_value_t propValueFrom, + jerry_value_t propValueTo, + bool& isItemNeedToAdd, + jerry_value_t& propKeyFrom); + static jerry_value_t ConcatJerryString(jerry_value_t strA, jerry_value_t strB); + static bool MergeAnimationString(char* dest, uint16_t destSz, const char * const src1, const char * const src2); + const AppStyleItem* firstStyleItem_; + AppStyleItem* lastStyleItem_; + AppStyle* pre_; + AppStyle* next_; + char *styleName_; +}; +} // namespace ACELite +} // namespace OHOS + +#endif // OHOS_ACELITE_APP_STYLE_H diff --git a/src/core/stylemgr/app_style_item.cpp b/src/core/stylemgr/app_style_item.cpp new file mode 100755 index 0000000..5556369 --- /dev/null +++ b/src/core/stylemgr/app_style_item.cpp @@ -0,0 +1,183 @@ +/* + * Copyright (c) 2020 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. + */ + +#include "stylemgr/app_style_item.h" +#include "ace_log.h" +#include "keys.h" + +namespace OHOS { +namespace ACELite { +uint8_t AppStyleItem::EstimatePseudoClassType(const char * const styleKey, uint16_t *keyLength) +{ + char *p = strchr(const_cast(styleKey), ':'); + if (p == nullptr) { + return PSEUDO_CLASS_UNKNOWN; + } + + uint8_t type = PSEUDO_CLASS_UNKNOWN; + // :active meets + if (!strcmp(p, PSEUDO_CLASS_TYPE_ACTIVE)) { + type = PSEUDO_CLASS_ACTIVE; + } else if (!strcmp(p, PSEUDO_CLASS_TYPE_CHECKED)) { + type = PSEUDO_CLASS_CHECKED; + } + + // drop :xxxx + if (type != PSEUDO_CLASS_UNKNOWN) { + *p = '\0'; + *keyLength = (uint16_t)(p - styleKey); + } + return type; +} + +void AppStyleItem::SetStringValue(const char * const value) +{ + if (value == nullptr) { + return; + } + size_t len = strlen(value); + if (len >= UINT16_MAX) { + return; + } + valueType_ = STYLE_PROP_VALUE_TYPE_STRING; + styleValue_.string = static_cast(ace_malloc(sizeof(char) * (len + 1))); + if (styleValue_.string == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "create style item string failed."); + return; + } + if (memcpy_s(styleValue_.string, len, value, len) != 0) { + HILOG_ERROR(HILOG_MODULE_ACE, "app_style set string value error"); + ace_free(styleValue_.string); + styleValue_.string = nullptr; + return; + } + *(styleValue_.string + len) = '\0'; +} + +bool AppStyleItem::UpdateNumValToStr() +{ + if (GetValueType() == STYLE_PROP_VALUE_TYPE_NUMBER) { + int32_t numVal = GetNumValue(); + const uint8_t len = 11; // max size of int32_t + char strVal[len] = { 0 }; + if (sprintf_s(strVal, len, "%d", numVal) < 0) { + HILOG_ERROR(HILOG_MODULE_ACE, "style item tranform num to string fail"); + return false; + } + SetStringValue((const char *)strVal); + } + return true; +} + +AppStyleItem *AppStyleItem::GenerateFromJSValue(jerry_value_t stylePropName, jerry_value_t stylePropValue) +{ + uint16_t strLen = 0; + char *keyNameBuffer = MallocStringOf(stylePropName, &strLen); + if (keyNameBuffer == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "convert style prop name to char failed, will be dropped"); + return nullptr; + } else { + if (strLen == 0) { + HILOG_ERROR(HILOG_MODULE_ACE, "style prop name length is 0, will be dropped"); + ace_free(keyNameBuffer); + keyNameBuffer = nullptr; + return nullptr; + } + } + uint8_t pseudoType_ = EstimatePseudoClassType(static_cast(keyNameBuffer), &strLen); + AppStyleItem *styleItem = + CreateStyleItem(KeyParser::ParseKeyId((const char *)keyNameBuffer, strLen), stylePropValue, pseudoType_); + ace_free(keyNameBuffer); + keyNameBuffer = nullptr; + return styleItem; +} + +AppStyleItem *AppStyleItem::CreateStyleItem(uint16_t keyId, const jerry_value_t stylePropValue, uint8_t pseudoClassType) +{ + AppStyleItem *newStyleItem = new AppStyleItem(); + if (newStyleItem == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "new styleItem error"); + return nullptr; + } + + char *strValueBuffer = nullptr; + + newStyleItem->propNameId_ = keyId; + newStyleItem->pseudoClassType_ = pseudoClassType; + + if (jerry_value_is_number(stylePropValue)) { + if (keyId == K_OPACITY) { + newStyleItem->SetFloatingValue(jerry_get_number_value(stylePropValue)); + } else { + newStyleItem->SetNumValue((int32_t)(jerry_get_number_value(stylePropValue))); + } + } else if (jerry_value_is_boolean(stylePropValue)) { + newStyleItem->SetBoolValue(jerry_get_boolean_value(stylePropValue)); + } else { + strValueBuffer = MallocStringOf(stylePropValue); + if (strValueBuffer == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "convert style value to char failed, will be dropped"); + delete newStyleItem; + newStyleItem = nullptr; + return nullptr; + } else { + newStyleItem->SetStringValue((const char *)strValueBuffer); + ace_free(strValueBuffer); + strValueBuffer = nullptr; + } + } + + return newStyleItem; +} + +AppStyleItem *AppStyleItem::CopyFrom(const AppStyleItem *from) +{ + if (from == nullptr) { + return nullptr; + } + + AppStyleItem *styleItem = new AppStyleItem(); + if (styleItem == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "new styleItem error"); + return nullptr; + } + + styleItem->propNameId_ = from->propNameId_; + styleItem->pseudoClassType_ = from->pseudoClassType_; + switch (from->GetValueType()) { + case STYLE_PROP_VALUE_TYPE_STRING: { + const char *strValue = from->GetStrValue(); + if (strValue != nullptr) { + styleItem->SetStringValue(strValue); + } + break; + } + case STYLE_PROP_VALUE_TYPE_BOOL: + styleItem->SetBoolValue(from->GetBoolValue()); + break; + case STYLE_PROP_VALUE_TYPE_NUMBER: + styleItem->SetNumValue(from->GetNumValue()); + break; + case STYLE_PROP_VALUE_TYPE_FLOATING: + styleItem->SetFloatingValue(from->GetFloatingValue()); + break; + default: + break; + } + + return styleItem; +} +} // namespace ACELite +} // namespace OHOS diff --git a/src/core/stylemgr/app_style_item.h b/src/core/stylemgr/app_style_item.h new file mode 100755 index 0000000..3828487 --- /dev/null +++ b/src/core/stylemgr/app_style_item.h @@ -0,0 +1,195 @@ +/* + * Copyright (c) 2020 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. + */ + +#ifndef OHOS_ACELITE_APP_STYLE_ITEM_H +#define OHOS_ACELITE_APP_STYLE_ITEM_H + +#include +#include + +#include "js_fwk_common.h" +#include "key_parser.h" +#include "non_copyable.h" +#if ENABLED(SECURE_C_FUNCTION) +#include "securec.h" +#endif // ENABLED(SECURE_C_FUNCTION) + +namespace OHOS { +namespace ACELite { +constexpr char PSEUDO_CLASS_TYPE_ACTIVE[] = ":active"; +constexpr char PSEUDO_CLASS_TYPE_CHECKED[] = ":checked"; + +enum { + STYLE_PROP_VALUE_TYPE_UNKOWN = 0x00, + STYLE_PROP_VALUE_TYPE_STRING = 0x01, + STYLE_PROP_VALUE_TYPE_NUMBER = 0x02, + STYLE_PROP_VALUE_TYPE_BOOL = 0x03, + STYLE_PROP_VALUE_TYPE_FLOATING = 0x04, +}; + +union StyleValue { + double floating; + int32_t number; + char *string; + bool boolean; +}; + +/** + * pseudo class support + */ +enum { + PSEUDO_CLASS_ACTIVE = 0x00, // :active + PSEUDO_CLASS_CHECKED = 0x01, // :checked + PSEUDO_CLASS_UNKNOWN = 0xFF // please add new type above +}; + +class AppStyleItem final : public MemoryHeap { +public: + ACE_DISALLOW_COPY_AND_MOVE(AppStyleItem); + AppStyleItem() + : pre_(nullptr), + next_(nullptr), + styleValue_({ 0.0 }), + propNameId_(0), + valueType_(STYLE_PROP_VALUE_TYPE_UNKOWN), + pseudoClassType_(PSEUDO_CLASS_UNKNOWN) + { + } + + ~AppStyleItem() + { + if (valueType_ == STYLE_PROP_VALUE_TYPE_STRING) { + ACE_FREE(styleValue_.string); + } + } + + uint16_t GetPropNameId() const + { + return propNameId_; + } + + uint8_t GetValueType() const + { + return valueType_; + } + + const char *GetStrValue() const + { + return (valueType_ != STYLE_PROP_VALUE_TYPE_STRING || GetStrValueLen() == 0) ? nullptr : styleValue_.string; + } + + size_t GetStrValueLen() const + { + return (styleValue_.string != nullptr) ? strlen(styleValue_.string) : 0; + } + + int32_t GetNumValue() const + { + return (valueType_ != STYLE_PROP_VALUE_TYPE_NUMBER) ? 0 : styleValue_.number; + } + + bool GetBoolValue() const + { + return (valueType_ != STYLE_PROP_VALUE_TYPE_BOOL) ? false : styleValue_.boolean; + } + + double GetFloatingValue() const + { + return (valueType_ != STYLE_PROP_VALUE_TYPE_FLOATING) ? false : styleValue_.floating; + } + + const AppStyleItem *GetNext() const + { + return next_; + } + + void SetNext(AppStyleItem *nextStyle) + { + next_ = nextStyle; + } + + void SetPre(AppStyleItem *preStyle) + { + pre_ = preStyle; + } + + const AppStyleItem *GetPre() const + { + return pre_; + } + + bool IsPseudoClassItem() const + { + return (pseudoClassType_ != PSEUDO_CLASS_UNKNOWN); + } + + uint8_t GetPseudoClassType() const + { + return pseudoClassType_; + } + + bool UpdateNumValToStr(); + static AppStyleItem *GenerateFromJSValue(jerry_value_t stylePropName, jerry_value_t stylePropValue); + static AppStyleItem *CreateStyleItem(uint16_t keyId, + const jerry_value_t stylePropValue, + uint8_t pseudoClassType = PSEUDO_CLASS_UNKNOWN); + // copy constructor can not return null, so define a static method instead + static AppStyleItem *CopyFrom(const AppStyleItem *from); + /** + * @brief Check if the given style is one pseudo class type, if it is, the corrensponding pseudo class enum + * will be calculated and returned, the style name also will be cutted to the key without the pseudo + * class name, the new key length also will be given out. + * + * @param[in] styleKey: the target style name to check + * @param[in] keyLength: the target style name length + * @param[out] keyLength: the new style name length + * + * @return unkown or the corrensponding pseudo class type + */ + static uint8_t EstimatePseudoClassType(const char * const styleKey, uint16_t *keyLength); + +private: + void SetNumValue(int32_t value) + { + valueType_ = STYLE_PROP_VALUE_TYPE_NUMBER; + styleValue_.number = value; + } + + void SetBoolValue(bool value) + { + valueType_ = STYLE_PROP_VALUE_TYPE_BOOL; + styleValue_.boolean = value; + } + + void SetFloatingValue(double value) + { + valueType_ = STYLE_PROP_VALUE_TYPE_FLOATING; + styleValue_.floating = value; + } + + void SetStringValue(const char * const value); + + AppStyleItem *pre_; + AppStyleItem *next_; + + StyleValue styleValue_; + uint16_t propNameId_; + uint8_t valueType_; + uint8_t pseudoClassType_; +}; +} // namespace ACELite +} // namespace OHOS + +#endif // OHOS_ACELITE_APP_STYLE_ITEM_H diff --git a/src/core/stylemgr/app_style_list.cpp b/src/core/stylemgr/app_style_list.cpp new file mode 100755 index 0000000..4413b6a --- /dev/null +++ b/src/core/stylemgr/app_style_list.cpp @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2020 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. + */ + +#include "stylemgr/app_style_list.h" + +namespace OHOS { +namespace ACELite { +void AppStyleList::Reset() +{ + AppStyle* next = nullptr; + while (firstStyle_ != nullptr) { + next = const_cast(firstStyle_->GetNext()); + firstStyle_->Reset(); + delete firstStyle_; + firstStyle_ = next; + } + lastStyle_ = nullptr; +} + +void AppStyleList::AddStyle(AppStyle* newStyle) +{ + if (newStyle == nullptr) { + return; + } + + if (firstStyle_ == nullptr) { + firstStyle_ = newStyle; + lastStyle_ = newStyle; + } else { + newStyle->SetPre(lastStyle_); + lastStyle_->SetNext(newStyle); + lastStyle_ = newStyle; + } +} +} // namespace ACELite +} // namespace OHOS diff --git a/src/core/stylemgr/app_style_list.h b/src/core/stylemgr/app_style_list.h new file mode 100755 index 0000000..1369396 --- /dev/null +++ b/src/core/stylemgr/app_style_list.h @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2020 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. + */ +#ifndef OHOS_ACELITE_APP_STYLE_LIST_H +#define OHOS_ACELITE_APP_STYLE_LIST_H + +#include "non_copyable.h" +#include "stylemgr/app_style.h" +#include "stylemgr/app_style_item.h" + +namespace OHOS { +namespace ACELite { +class AppStyleList final : public MemoryHeap { +public: + ACE_DISALLOW_COPY_AND_MOVE(AppStyleList); + AppStyleList() : firstStyle_(nullptr), lastStyle_(nullptr) {} + + ~AppStyleList() + { + Reset(); + } + + const AppStyle* GetFirst() + { + return firstStyle_; + } + + void Reset(); + void AddStyle(AppStyle* newStyle); + +private: + AppStyle* firstStyle_; + AppStyle* lastStyle_; +}; +} // namespace ACELite +} // namespace OHOS +#endif // OHOS_ACELITE_STYLE_LIST_H diff --git a/src/core/stylemgr/app_style_manager.cpp b/src/core/stylemgr/app_style_manager.cpp new file mode 100755 index 0000000..c7a6ef1 --- /dev/null +++ b/src/core/stylemgr/app_style_manager.cpp @@ -0,0 +1,326 @@ +/* + * Copyright (c) 2020 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. + */ + +#include "stylemgr/app_style_manager.h" +#include "ace_log.h" +#include "component.h" + +namespace OHOS { +namespace ACELite { +const char * const AppStyleManager::ID = "id"; +const char * const AppStyleManager::ATTR_STATIC_STYLE = "staticStyle"; +const char * const AppStyleManager::ATTR_DYNAMIC_STYLE = "dynamicStyle"; +const char * const AppStyleManager::ATTR_STATIC_CLASS = "staticClass"; +AppStyleManager::AppStyleManager() : styleSheet_(nullptr), combinedStyle_(nullptr) +{ + // prepare jerry string value in advance to less the overhead + idStrValue_ = jerry_create_string(reinterpret_cast(ID)); + attrsStrValue_ = jerry_create_string(reinterpret_cast(ATTR_ATTRS)); + staticStyleStrValue_ = jerry_create_string(reinterpret_cast(ATTR_STATIC_STYLE)); + dynamicStyleStrValue_ = jerry_create_string(reinterpret_cast(ATTR_DYNAMIC_STYLE)); + staticClassStrValue_ = jerry_create_string(reinterpret_cast(ATTR_STATIC_CLASS)); +} + +AppStyleManager::~AppStyleManager() +{ + if (combinedStyle_ != nullptr) { + combinedStyle_->Reset(); + delete combinedStyle_; + combinedStyle_ = nullptr; + } + + if (styleSheet_ != nullptr) { + styleSheet_->Reset(); + delete styleSheet_; + styleSheet_ = nullptr; + } + ReleaseJerryValue(idStrValue_, attrsStrValue_, dynamicStyleStrValue_, staticStyleStrValue_, staticClassStrValue_, + VA_ARG_END_FLAG); +} + +const AppStyle *AppStyleManager::GetCombinedStyle() const +{ + return combinedStyle_; +} + +const AppStyleItem *AppStyleManager::GetCombinedStyleItem(const char * const name) const +{ + if (combinedStyle_ != nullptr) { + return combinedStyle_->GetStyleItemByName(name); + } + return nullptr; +} + +void AppStyleManager::ResetCombinedStyle() +{ + // do not free the combinedStyle_ object, just reset the content of it, + // that will slow down the next combining action for next component, + // it will be freed in ~AppStyleManager after the app exits + if (combinedStyle_ != nullptr) { + combinedStyle_->Reset(); + } +} + +const AppStyleSheet *AppStyleManager::GetStyleSheet() const +{ + return styleSheet_; +} + +void AppStyleManager::InitStyleSheet(jerry_value_t jsStyleSheetObj) +{ + if (jerry_value_is_undefined(jsStyleSheetObj) || jerry_value_is_error(jsStyleSheetObj)) { + return; + } + + if (styleSheet_ == nullptr) { + styleSheet_ = new AppStyleSheet(); + } + + if (styleSheet_ != nullptr) { + styleSheet_->InitSheet(jsStyleSheetObj); + } +} + +// { attrs: { x: '0', y: '0' }, staticClass: 'divStyle', staticStyle: {display: 'flex', width: 454, height: 454} } +void AppStyleManager::CombineStylesForCurrentTag(const jerry_value_t options, Component ¤tComponent) +{ + // reset first + ResetCombinedStyle(); + + if (jerry_value_is_undefined(options)) { + HILOG_WARN(HILOG_MODULE_ACE, "combine styles for current tag failed"); + return; + } + + // handle static styles + HandleInlineStyles(options, currentComponent); + + // handle id selector + HandleIDSelectors(options); + + // handle class selector + HandleClassSelectors(options); +} + +// return value must be released by caller +jerry_value_t AppStyleManager::GetStyleObjFromOptions(jerry_value_t options, const jerry_value_t name) +{ + jerry_value_t value = UNDEFINED; + if (jerry_value_is_undefined(options) || jerry_value_is_undefined(name)) { + return value; + } + + jerry_value_t valueContainer = options; + bool containerNeedReleased = false; + if (name == idStrValue_) { + // get attrs object from options + if (!HasOwnProperty(options, attrsStrValue_)) { + // if no attrs in options, return undefined directly + return value; + } + valueContainer = jerry_get_property(options, attrsStrValue_); + // mark that the valueContainer need to be released when getting out of scope + containerNeedReleased = true; + } + + // check if container object have target property, if not, just return undefined + if (HasOwnProperty(valueContainer, name)) { + value = jerry_get_property(valueContainer, name); + } + + if (containerNeedReleased) { + jerry_release_value(valueContainer); + } + return value; +} + +void AppStyleManager::HandleInlineStyles(const jerry_value_t options, Component ¤tComponent) +{ + // handle static inline styles + HandleStaticStyle(options); + // handle dynamic inline styles + HandleDynamicStyle(options, currentComponent); +} + +void AppStyleManager::HandleStaticStyle(const jerry_value_t options) +{ + jerry_value_t staticStyleValue = GetStyleObjFromOptions(options, staticStyleStrValue_); + if (jerry_value_is_undefined(staticStyleValue)) { + return; + } + + jerry_value_t propKeys = jerry_get_object_keys(staticStyleValue); + uint32_t propKeySize = jerry_get_array_length(propKeys); + for (uint32_t index = 0; index < propKeySize; index++) { + jerry_value_t propKey = jerry_get_property_by_index(propKeys, index); + jerry_value_t propValue = jerry_get_property(staticStyleValue, propKey); + CombineStyleItem(propKey, propValue); + ReleaseJerryValue(propKey, propValue, VA_ARG_END_FLAG); + } + ReleaseJerryValue(propKeys, staticStyleValue, VA_ARG_END_FLAG); +} + +void AppStyleManager::HandleDynamicStyle(const jerry_value_t options, Component ¤tComponent) +{ + jerry_value_t dynamicStyleValue = GetStyleObjFromOptions(options, dynamicStyleStrValue_); + if (jerry_value_is_undefined(dynamicStyleValue)) { + return; + } + + jerry_value_t propKeys = jerry_get_object_keys(dynamicStyleValue); + uint32_t propKeySize = jerry_get_array_length(propKeys); + for (uint32_t index = 0; index < propKeySize; index++) { + jerry_value_t propKey = jerry_get_property_by_index(propKeys, index); + jerry_value_t propValue = jerry_get_property(dynamicStyleValue, propKey); + // parse expression and new watcher for it + if (jerry_value_is_function(propValue)) { + jerry_value_t expressionValue = currentComponent.ParseExpression(propKey, propValue); + // the expression's calculating result should be used, not the function value itself + CombineStyleItem(propKey, expressionValue); + if (expressionValue != propValue) { + // generally, ParseExpression() will calculate the expression function's value and return + // the result back, so it's need to be released + jerry_release_value(expressionValue); + } + } + ReleaseJerryValue(propKey, propValue, VA_ARG_END_FLAG); + } + ReleaseJerryValue(propKeys, dynamicStyleValue, VA_ARG_END_FLAG); +} + +void AppStyleManager::HandleSingleSelector(const jerry_value_t prop, const jerry_value_t type) +{ + if (jerry_value_is_undefined(prop) || jerry_value_is_undefined(type)) { + return; + } + + uint16_t strLen = 0; + char *valueBuffer = MallocStringOf(prop, &strLen); + if (valueBuffer == nullptr) { + HILOG_ERROR(HILOG_MODULE_ACE, "convert id value to char failed, will be dropped"); + return; + } else { + if (strLen == 0) { + ace_free(valueBuffer); + valueBuffer = nullptr; + return; + } + } + + AppStyle *style = nullptr; + if (type == idStrValue_ && styleSheet_ != nullptr) { + style = styleSheet_->GetStyleFromIDSelectors(valueBuffer); + } else if (type == staticClassStrValue_ && styleSheet_ != nullptr) { + style = styleSheet_->GetStyleFromClassSelectors(valueBuffer); + } else { + HILOG_WARN(HILOG_MODULE_ACE, "not supported yet"); + } + ace_free(valueBuffer); + valueBuffer = nullptr; + CombineStyle(style); +} + +void AppStyleManager::HandleSelectors(const jerry_value_t options, const jerry_value_t type) +{ + if (styleSheet_ == nullptr) { + return; + } + + jerry_value_t propValue = GetStyleObjFromOptions(options, type); + if (jerry_value_is_undefined(propValue)) { + return; + } + + if (!jerry_value_is_array(propValue)) { + // if is not array, just handle it + HandleSingleSelector(propValue, type); + } else { + // support array + uint32_t propCount = jerry_get_array_length(propValue); + if (propCount > 0 && propCount < UINT8_MAX) { + // do reverse traversal to ensure style override correctly + while (propCount > 0) { + jerry_value_t property = jerry_get_property_by_index(propValue, (propCount - 1)); + HandleSingleSelector(property, type); + jerry_release_value(property); + propCount--; + } + } else { + HILOG_ERROR(HILOG_MODULE_ACE, "invalid prop count"); + } + } + jerry_release_value(propValue); +} + +void AppStyleManager::HandleIDSelectors(const jerry_value_t options) +{ + HandleSelectors(options, idStrValue_); +} + +void AppStyleManager::HandleClassSelectors(const jerry_value_t options) +{ + HandleSelectors(options, staticClassStrValue_); +} + +void AppStyleManager::CombineStyle(AppStyle *appStyle) +{ + if (appStyle == nullptr) { + return; + } + + // go through id style's all items, add it to combinedStyle_ if it's not in it + const AppStyleItem *styleItem = appStyle->GetFirst(); + while (styleItem != nullptr) { + if (combinedStyle_) { + uint16_t styleItemNameId = styleItem->GetPropNameId(); + // if it's already in combined style, skip, as it's lower priority + const AppStyleItem *exitCombinedStyleItem = combinedStyle_->GetStyleItemByNameId(styleItemNameId); + if ((exitCombinedStyleItem == nullptr) || + (exitCombinedStyleItem->GetPseudoClassType() != styleItem->GetPseudoClassType())) { + AppStyleItem *newItem = AppStyleItem::CopyFrom(styleItem); + AppendToCombinedStyle(newItem); + } + styleItem = styleItem->GetNext(); + } else { + /* if combinedStyle_ is null, add all items directly */ + while (styleItem != nullptr) { + AppStyleItem *newItem = AppStyleItem::CopyFrom(styleItem); + AppendToCombinedStyle(newItem); + styleItem = styleItem->GetNext(); + } + } + } +} + +void AppStyleManager::CombineStyleItem(jerry_value_t stylePropName, jerry_value_t stylePropValue) +{ + AppStyleItem *newStyleItem = AppStyleItem::GenerateFromJSValue(stylePropName, stylePropValue); + AppendToCombinedStyle(newStyleItem); +} + +void AppStyleManager::AppendToCombinedStyle(AppStyleItem *newStyleItem) +{ + if (newStyleItem == nullptr) { + return; + } + + if (combinedStyle_ == nullptr) { + combinedStyle_ = new AppStyle(); + } + + combinedStyle_->AddStyleItem(newStyleItem); +} +} // namespace ACELite +} // namespace OHOS diff --git a/src/core/stylemgr/app_style_manager.h b/src/core/stylemgr/app_style_manager.h new file mode 100755 index 0000000..596afb0 --- /dev/null +++ b/src/core/stylemgr/app_style_manager.h @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2020 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. + */ + +#ifndef OHOS_ACELITE_APP_STYLE_MANAGER_H +#define OHOS_ACELITE_APP_STYLE_MANAGER_H + +#include "non_copyable.h" +#include "stylemgr/app_style.h" +#include "stylemgr/app_style_sheet.h" + +namespace OHOS { +namespace ACELite { +class Component; +class AppStyleManager final : public MemoryHeap { +public: + ACE_DISALLOW_COPY_AND_MOVE(AppStyleManager); + AppStyleManager(); + ~AppStyleManager(); + + void InitStyleSheet(jerry_value_t jsStyleSheetObj); + // combine id/static class/static styles for current tag from arguments of createElement function + void CombineStylesForCurrentTag(const jerry_value_t options, Component& currentComponent); + const AppStyle* GetCombinedStyle() const; + const AppStyleItem* GetCombinedStyleItem(const char * const name) const; + void ResetCombinedStyle(); + const AppStyleSheet* GetStyleSheet() const; + +private: + void HandleInlineStyles(const jerry_value_t options, Component& currentComponent); + void HandleStaticStyle(const jerry_value_t options); + void HandleDynamicStyle(const jerry_value_t options, Component& currentComponent); + void HandleIDSelectors(const jerry_value_t options); + void HandleClassSelectors(const jerry_value_t options); + void HandleSelectors(const jerry_value_t options, const jerry_value_t type); + void HandleSingleSelector(const jerry_value_t selectorValue, const jerry_value_t type); + void CombineStyleItem(jerry_value_t stylePropName, jerry_value_t stylePropValue); + void AppendToCombinedStyle(AppStyleItem* newStyle); + void CombineStyle(AppStyle* appStyle); + jerry_value_t GetStyleObjFromOptions(jerry_value_t options, const jerry_value_t name); + AppStyleSheet* styleSheet_; + AppStyle* combinedStyle_; // record the combined styles for current tag + // prepare jerry string value in advance to speed up + jerry_value_t idStrValue_; + jerry_value_t attrsStrValue_; + jerry_value_t dynamicStyleStrValue_; + jerry_value_t staticStyleStrValue_; + jerry_value_t staticClassStrValue_; + static const char * const ID; + static const char * const ATTR_STATIC_STYLE; + static const char * const ATTR_DYNAMIC_STYLE; + static const char * const ATTR_STATIC_CLASS; +}; +} // namespace ACELite +} // namespace OHOS + +#endif // OHOS_ACELITE_APP_STYLE_MANAGER_H diff --git a/src/core/stylemgr/app_style_sheet.cpp b/src/core/stylemgr/app_style_sheet.cpp new file mode 100755 index 0000000..4ce2eb4 --- /dev/null +++ b/src/core/stylemgr/app_style_sheet.cpp @@ -0,0 +1,140 @@ +/* + * Copyright (c) 2020 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. + */ + +#include "stylemgr/app_style_sheet.h" + +namespace OHOS { +namespace ACELite { +void AppStyleSheet::Reset() +{ + if (idSelectors_ != nullptr) { + idSelectors_->Reset(); + delete idSelectors_; + idSelectors_ = nullptr; + } + + if (classSelectors_ != nullptr) { + classSelectors_->Reset(); + delete classSelectors_; + classSelectors_ = nullptr; + } + + if (keyFrameSelectors_ != nullptr) { + keyFrameSelectors_->Reset(); + delete keyFrameSelectors_; + keyFrameSelectors_ = nullptr; + } +} + +void AppStyleSheet::InitSheet(jerry_value_t styleSheetObj) +{ + if (jerry_value_is_undefined(styleSheetObj)) { + return; + } + + Reset(); + + // init all id selectors + const char * const attrIdSelectors = "idSelectors"; + jerry_value_t propName = jerry_create_string(reinterpret_cast(const_cast(attrIdSelectors))); + jerry_value_t propValue = UNDEFINED; + if (HasOwnProperty(styleSheetObj, propName)) { + propValue = jerry_get_property(styleSheetObj, propName); + InitSelectors(&idSelectors_, propValue, false); + jerry_release_value(propValue); + } + jerry_release_value(propName); + + // init all class selectors + const char * const attrClassSelectors = "classSelectors"; + propName = jerry_create_string(reinterpret_cast(const_cast(attrClassSelectors))); + if (HasOwnProperty(styleSheetObj, propName)) { + propValue = jerry_get_property(styleSheetObj, propName); + InitSelectors(&classSelectors_, propValue, false); + jerry_release_value(propValue); + } + jerry_release_value(propName); + + // init styleSheet + const char * const keyFrames = "@keyframes"; + propName = jerry_create_string(reinterpret_cast(const_cast(keyFrames))); + if (HasOwnProperty(styleSheetObj, propName)) { + propValue = jerry_get_property(styleSheetObj, propName); + InitSelectors(&keyFrameSelectors_, propValue, true); + jerry_release_value(propValue); + } + jerry_release_value(propName); +} + +void AppStyleSheet::InitSelectors(AppStyleList** selectorsList, jerry_value_t selectorsObj, bool isKeyFrames) +{ + if (jerry_value_is_undefined(selectorsObj)) { + return; + } + + if ((*selectorsList) == nullptr) { + (*selectorsList) = new AppStyleList(); + } + + jerry_value_t styleKeys = jerry_get_object_keys(selectorsObj); + uint16_t styleKeySize = jerry_get_array_length(styleKeys); + for (uint16_t index = 0; index < styleKeySize; index++) { + /* convert style key into char */ + jerry_value_t styleKey = jerry_get_property_by_index(styleKeys, index); + jerry_value_t styleValue = jerry_get_property(selectorsObj, styleKey); + AppStyle* newStyle = AppStyle::GenerateFromJS(styleKey, styleValue, isKeyFrames); + if (newStyle != nullptr) { + (*selectorsList)->AddStyle(newStyle); + } + ReleaseJerryValue(styleKey, styleValue, VA_ARG_END_FLAG); + } + + jerry_release_value(styleKeys); +} + +AppStyle* AppStyleSheet::GetStyleFromIDSelectors(const char * const name) const +{ + return GetStyleFromSelectors(idSelectors_, name); +} + +AppStyle* AppStyleSheet::GetStyleFromClassSelectors(const char * const name) const +{ + return GetStyleFromSelectors(classSelectors_, name); +} + +AppStyle* AppStyleSheet::GetStyleFromKeyFramesSelectors(const char * const name) const +{ + return GetStyleFromSelectors(keyFrameSelectors_, name); +} + +AppStyle* AppStyleSheet::GetStyleFromSelectors(AppStyleList* selectors, const char * const name) const +{ + if ((selectors == nullptr) || (name == nullptr) || strlen(name) == 0) { + return nullptr; + } + + AppStyle* first = const_cast(selectors->GetFirst()); + while (first != nullptr) { + const char *styleName = first->GetStyleName(); + if (styleName != nullptr && !strcmp(name, styleName)) { + return first; + } + first = const_cast(first->GetNext()); + } + + return first; +} +} // namespace ACELite +} // namespace OHOS diff --git a/src/core/stylemgr/app_style_sheet.h b/src/core/stylemgr/app_style_sheet.h new file mode 100755 index 0000000..51032d9 --- /dev/null +++ b/src/core/stylemgr/app_style_sheet.h @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2020 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. + */ + +#ifndef OHOS_ACELITE_APP_STYLE_SHEET_H +#define OHOS_ACELITE_APP_STYLE_SHEET_H + +#include "non_copyable.h" +#include "stylemgr/app_style_item.h" +#include "stylemgr/app_style_list.h" + +namespace OHOS { +namespace ACELite { +class AppStyleSheet final : public MemoryHeap { +public: + ACE_DISALLOW_COPY_AND_MOVE(AppStyleSheet); + AppStyleSheet() : idSelectors_(nullptr), classSelectors_(nullptr), keyFrameSelectors_(nullptr) {} + ~AppStyleSheet() + { + Reset(); + } + void InitSheet(jerry_value_t jsObj); + void Reset(); + AppStyle* GetStyleFromIDSelectors(const char * const name) const; + AppStyle* GetStyleFromClassSelectors(const char * const name) const; + AppStyle* GetStyleFromKeyFramesSelectors(const char * const name) const; + AppStyle* GetStyleFromSelectors(AppStyleList* selectors, const char * const name) const; + +private: + void InitSelectors(AppStyleList** selectorsList, jerry_value_t selectorsObj, bool isKeyFrames); + AppStyleList* idSelectors_; + AppStyleList* classSelectors_; + AppStyleList* keyFrameSelectors_; +}; +} // namespace ACELite +} // namespace OHOS + +#endif // OHOS_ACELITE_APP_STYLE_SHEET_H \ No newline at end of file diff --git a/src/core/wrapper/BUILD.gn b/src/core/wrapper/BUILD.gn new file mode 100755 index 0000000..f7ba3df --- /dev/null +++ b/src/core/wrapper/BUILD.gn @@ -0,0 +1,23 @@ +#Copyright (c) 2020 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. + +source_set("wrapper") { + configs += [ + "//foundation/ace/lite/jsfwk:ace_config", + ] + sources = [ + "js.cpp" + ] + include_dirs = [ + ] +} diff --git a/src/core/wrapper/js.cpp b/src/core/wrapper/js.cpp new file mode 100755 index 0000000..40c66b9 --- /dev/null +++ b/src/core/wrapper/js.cpp @@ -0,0 +1,270 @@ +/* + * Copyright (c) 2020 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. + */ + +#include "ace_mem_base.h" +#include "acelite_config.h" +#include "wrapper/js.h" + +namespace OHOS { +namespace ACELite { +void JSRelease(JSValue value) +{ + return jerry_release_value(value); +} + +JSValue JSString::Create(const char * const value) +{ + return jerry_create_string(reinterpret_cast(value)); +} + +bool JSString::Is(JSValue target) +{ + return jerry_value_is_string(target); +} + +char* JSString::Value(JSValue value) +{ + if (jerry_value_is_undefined(value)) { + return nullptr; + } + + jerry_value_t target; + if (jerry_value_is_symbol(value)) { + target = jerry_get_symbol_descriptive_string(value); + } else { + target = jerry_value_to_string(value); + } + + if (jerry_value_is_error(target)) { + jerry_release_value(target); + return nullptr; + } + + jerry_size_t size = jerry_get_string_size(target); + if (size == 0) { + jerry_release_value(target); + // return empty char instead of nullptr, so caller can free safely + char* emptyStr = static_cast(ace_malloc(sizeof(char))); + if (emptyStr == nullptr) { + return nullptr; + } + emptyStr[0] = '\0'; + return emptyStr; + } + if (size >= UINT16_MAX) { + jerry_release_value(target); + return nullptr; + } + jerry_char_t* buffer = static_cast(ace_malloc(sizeof(jerry_char_t) * (size + 1))); + if (buffer == nullptr) { + jerry_release_value(target); + return nullptr; + } + jerry_size_t length = jerry_string_to_char_buffer(target, buffer, size); + if (length == 0) { + jerry_release_value(target); + ace_free(buffer); + buffer = nullptr; + return nullptr; + } + // end character + buffer[length] = '\0'; + jerry_release_value(target); + return reinterpret_cast(buffer); +} + +JSValue JSFunction::Create(JSHandler handler) +{ + return jerry_create_external_function(handler); +} + +JSValue JSFunction::Call(JSValue func, JSValue context, JSValue args[], JSSize size) +{ + return jerry_call_function(func, context, args, size); +} + +bool JSFunction::Is(JSValue target) +{ + return jerry_value_is_function(target); +} + +JSValue JSObject::Create() +{ + return jerry_create_object(); +} + +JSValue JSObject::Get(JSValue target, const char * const prop) +{ + JSValue key = JSString::Create(prop); + JSValue value = jerry_get_property(target, key); + JSRelease(key); + return value; +} + +void JSObject::Set(JSValue target, const char * const prop, JSValue value) +{ + JSValue key = JSString::Create(prop); + jerry_release_value(jerry_set_property(target, key, value)); + JSRelease(key); +} + +void JSObject::Set(JSValue target, const char * const prop, JSHandler handler) +{ + JSValue func = JSFunction::Create(handler); + JSObject::Set(target, prop, func); + JSRelease(func); +} + +bool JSObject::Del(JSValue target, const char * const prop) +{ + JSValue key = JSString::Create(prop); + bool result = jerry_delete_property(target, key); + JSRelease(key); + return result; +} + +bool JSObject::GetNativePointer(JSValue target, void** nativePointer) +{ + return jerry_get_object_native_pointer(target, nativePointer, nullptr); +} + +void JSObject::SetNativePointer(JSValue target, void* nativePointer) +{ + return jerry_set_object_native_pointer(target, nativePointer, nullptr); +} + +bool JSObject::DelNativePointer(JSValue target) +{ + return jerry_delete_object_native_pointer(target, nullptr); +} + +JSValue JSObject::Call(JSValue target, const char * const prop, JSValue args[], JSSize size) +{ + JSValue func = Get(target, prop); + JSValue value = JSFunction::Call(func, target, args, size); + JSRelease(func); + return value; +} + +JSValue JSObject::Call(JSValue target, const char * const prop) +{ + return JSObject::Call(target, prop, nullptr, 0); +} + +bool JSObject::Is(JSValue target) +{ + return jerry_value_is_object(target); +} + +JSValue JSGlobal::Get() +{ + return jerry_get_global_object(); +} + +JSValue JSGlobal::Get(const char * const prop) +{ + JSValue global = JSGlobal::Get(); + JSValue result = JSObject::Get(global, prop); + JSRelease(global); + return result; +} + +void JSGlobal::Set(const char * const prop, JSValue value) +{ + JSValue global = JSGlobal::Get(); + JSObject::Set(global, prop, value); + JSRelease(global); +} + +JSValue JSGlobal::Call(const char * const prop, JSValue args[], JSSize size) +{ + JSValue global = JSGlobal::Get(); + JSValue result = JSObject::Call(global, prop, args, size); + JSRelease(global); + return result; +} +JSValue JSGlobal::Call(const char * const prop) +{ + return JSGlobal::Call(prop, nullptr, 0); +} + +JSValue JSUndefined::Create() +{ + return jerry_create_undefined(); +} + +bool JSUndefined::Is(JSValue value) +{ + return jerry_value_is_undefined(value); +} + +JSValue JSNumber::Create(uint32_t number) +{ + return jerry_create_number(number); +} + +bool JSNumber::Is(JSValue target) +{ + return jerry_value_is_number(target); +} + +double JSNumber::Value(JSValue value) +{ + return jerry_get_number_value(value); +} + +JSValue JSBoolean::Create(bool value) +{ + return jerry_create_boolean(value); +} + +bool JSBoolean::Is(JSValue target) +{ + return jerry_value_is_boolean(target); +} + +bool JSBoolean::Value(JSValue value) +{ + return jerry_get_boolean_value(value); +} + +JSValue JSArray::Create(uint32_t size) +{ + return jerry_create_array(size); +} + +uint32_t JSArray::Length(const JSValue array) +{ + return jerry_get_array_length(array); +} + +JSValue JSArray::Get(JSValue array, uint32_t index) +{ + return jerry_get_property_by_index(array, index); +} + +JSValue JSArray::Map(JSValue array, JSValue func) +{ + JSValue args[1] = {func}; + return JSObject::Call(array, "map", args, 1); +} + +void JSArray::Push(JSValue array, JSValue element) +{ + JSValue args[1] = {element}; + JSRelease(JSObject::Call(array, "push", args, 1)); +} +} // namespace ACELite +} // namespace OHOS diff --git a/src/core/wrapper/js.h b/src/core/wrapper/js.h new file mode 100755 index 0000000..832c2c8 --- /dev/null +++ b/src/core/wrapper/js.h @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2020 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. + */ + +#ifndef OHOS_ACELITE_JS_H +#define OHOS_ACELITE_JS_H + +#include "jerryscript.h" +#include "memory_heap.h" +#include + +namespace OHOS { +namespace ACELite { +typedef jerry_value_t JSValue; +typedef jerry_size_t JSSize; +typedef JSValue (*JSHandler)(const JSValue func, const JSValue ctx, const JSValue args[], JSSize argsSize); + +void JSRelease(JSValue value); + +class JSString final : public MemoryHeap { +public: + static JSValue Create(const char * const value); + static bool Is(JSValue target); + static char* Value(JSValue value); +}; + +class JSFunction final : public MemoryHeap { +public: + static JSValue Create(JSHandler handler); + static JSValue Call(JSValue func, JSValue context, JSValue args[], JSSize size); + static bool Is(JSValue target); +}; + +class JSObject final : public MemoryHeap { +public: + static JSValue Create(); + static JSValue Get(JSValue target, const char * const prop); + static void Set(JSValue target, const char * const prop, JSValue value); + static void Set(JSValue target, const char * const prop, JSHandler handler); + static bool Del(JSValue target, const char * const prop); + static JSValue Call(JSValue target, const char * const prop, JSValue args[], JSSize size); + static JSValue Call(JSValue target, const char * const prop); + static bool GetNativePointer(JSValue target, void** nativePointer); + static void SetNativePointer(JSValue target, void* nativePointer); + static bool DelNativePointer(JSValue target); + static bool Is(JSValue target); +}; + +class JSGlobal final : public MemoryHeap { +public: + static JSValue Get(); + static JSValue Get(const char * const prop); + static void Set(const char * const prop, JSValue value); + static JSValue Call(const char * const prop, JSValue args[], JSSize size); + static JSValue Call(const char * const prop); +}; + +class JSUndefined final : public MemoryHeap { +public: + static JSValue Create(); + static bool Is(JSValue value); +}; + +class JSNumber final : public MemoryHeap { +public: + static JSValue Create(uint32_t number); + static bool Is(JSValue target); + static double Value(JSValue value); +}; + +class JSBoolean final : public MemoryHeap { +public: + static JSValue Create(bool value); + static bool Is(JSValue target); + static bool Value(JSValue value); +}; + +class JSArray final : public MemoryHeap { +public: + static JSValue Create(uint32_t size); + static uint32_t Length(const JSValue array); + static JSValue Get(JSValue array, uint32_t index); + static JSValue Map(JSValue array, JSValue func); + static void Push(JSValue array, JSValue element); +}; +} // namespace ACELite +} // namespace OHOS +#endif // OHOS_ACELITE_JS_H diff --git a/targets/default/acelite_config.h b/targets/default/acelite_config.h new file mode 100755 index 0000000..e03494c --- /dev/null +++ b/targets/default/acelite_config.h @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2020 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. + */ + +#ifndef OHOS_ACELITE_CONFIG_H +#define OHOS_ACELITE_CONFIG_H + +/** + * ================================================================================================ + * the default config for hmf + * ================================================================================================ + */ +#define OHOS_ACELITE_HMF // NOTE: DO NOT use this macro directly + +/** + * Compile all test entry for hmf + */ +#ifdef FEATURE_TEST_IMPLEMENTATION +#error "must keep the global configuration unique" +#else +#define FEATURE_TEST_IMPLEMENTATION +#endif + +/** + * support hi log module trace + */ +#ifdef FEATURE_ACELITE_HI_LOG_PRINTF +#error "must keep the global configuration unique" +#else +#define FEATURE_ACELITE_HI_LOG_PRINTF +#endif + +/** + * support memory pool module + */ +#ifdef FEATURE_ACELITE_MEMORY_POOL +#error "must keep the global configuration unique" +#else +#define FEATURE_ACELITE_MEMORY_POOL +#endif + +////////////////////////////////////////////////////////////////////////////////////////////////// +// // +// Component support configurations // +// // +////////////////////////////////////////////////////////////////////////////////////////////////// + +/** + * analog clock component + */ +#ifdef FEATURE_COMPONENT_ANALOG_CLOCK +#error "must keep the global configuration unique" +#else +#define FEATURE_COMPONENT_ANALOG_CLOCK +#endif + +/** + * tabs component + */ +#ifdef FEATURE_COMPONENT_TABS +#error "must keep the global configuration unique" +#else +#define FEATURE_COMPONENT_TABS +#endif + +/** + * define the max length of user's console log + */ +#ifndef CONSOLE_LOG_LINE_MAX_LENGTH +#define CONSOLE_LOG_LINE_MAX_LENGTH (256) +#endif + +#define DEFAULT_PROFILER_MSG_PATH "user/log/" + +#define PROFILER_ENABLE_FLAG_FILE "user/data/profiler_enable" + +#define RUNTIME_MODE_FILE_PATH "user/data/jsparser_enable" + +#endif // OHOS_ACELITE_CONFIG_H diff --git a/targets/linux/acelite_config.h b/targets/linux/acelite_config.h new file mode 100755 index 0000000..acd76ea --- /dev/null +++ b/targets/linux/acelite_config.h @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2020 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. + */ + +#ifndef OHOS_ACELITE_CONFIG_H +#define OHOS_ACELITE_CONFIG_H + +/** + * ================================================================================================ + * hi3516_linux config for hmf + * ================================================================================================ + */ +#define OHOS_ACELITE_LINUX // NOTE: DO NOT use this macro directly + +/** + * Compile all test entry for hmf + */ +#ifdef FEATURE_TEST_IMPLEMENTATION +#error "must keep the global configuration unique" +#else +#define FEATURE_TEST_IMPLEMENTATION +#endif + +/** + * use hi log interface to trace out + */ +#ifdef FEATURE_ACELITE_HI_LOG_PRINTF +#error "must keep the global configuration unique" +#else +#define FEATURE_ACELITE_HI_LOG_PRINTF +#endif + +#define DEFAULT_PROFILER_MSG_PATH "/user/data/" + +#define PROFILER_ENABLE_FLAG_FILE "/user/data/profiler_enable" + +#define RUNTIME_MODE_FILE_PATH "/user/data/jsparser_enable" + +#endif // OHOS_ACELITE_CONFIG_H + diff --git a/targets/liteos_a/acelite_config.h b/targets/liteos_a/acelite_config.h new file mode 100755 index 0000000..93b7863 --- /dev/null +++ b/targets/liteos_a/acelite_config.h @@ -0,0 +1,119 @@ +/* + * Copyright (c) 2020 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. + */ + +#ifndef OHOS_ACELITE_CONFIG_H +#define OHOS_ACELITE_CONFIG_H + +/** + * ================================================================================================ + * liteos_a config for hmf + * ================================================================================================ + */ +#define OHOS_ACELITE_LITEOS_A // NOTE: DO NOT use this macro directly + +/** + * Compile all test entry for hmf + */ +#ifdef FEATURE_TEST_IMPLEMENTATION +#error "must keep the global configuration unique" +#else +#define FEATURE_TEST_IMPLEMENTATION +#endif + +/** + * use hi log interface to trace out + */ +#ifdef FEATURE_ACELITE_HI_LOG_PRINTF +#error "must keep the global configuration unique" +#else +#define FEATURE_ACELITE_HI_LOG_PRINTF +#endif + +/** + * append no blank color to rootview for easy using, delete this after the mouse showing is optimized + */ +#ifdef FEATURE_ROOTVIEW_CUSTOM_BACKGROUND_COLOR +#error "must keep the global configuration unique" +#else +#define FEATURE_ROOTVIEW_CUSTOM_BACKGROUND_COLOR +#endif + +/** + * js profiler switch + */ +#ifdef FEATURE_ACELITE_JS_PROFILER +#error "must keep the global configuration unique" +#else +#define FEATURE_ACELITE_JS_PROFILER +#endif + +/** + * support audio API for JS + */ +#define FEATURE_MODULE_AUDIO + +/** + * switch for cipher module + */ +#define ENABLE_MODULE_CIPHER + +/** + * support storage and file API for JS + */ +#define FEATURE_MODULE_STORAGE + +/** + * support device API for JS + */ +#define FEATURE_MODULE_DEVICE + +/** + * timer module + */ +#define FEATURE_TIMER_MODULE + +/** + * support lite ace dfx module + */ +#define FEATURE_ACELITE_DFX_MODULE + +#define FEATURE_ACELITE_LITE_DFX_MODULE + +/** + * enable Canvas component Feature API on ipcamera real devices + */ +#define FEATURE_COMPONENT_CANVAS + +#ifdef FEATURE_COMPONENT_CAMERA +#error "must keep the global configuration unique" +#else +#define FEATURE_COMPONENT_CAMERA +#endif + +#ifdef FEATURE_COMPONENT_VIDEO +#error "must keep the global configuration unique" +#else +#define FEATURE_COMPONENT_VIDEO +#endif + +#define FEATURE_UPDATE_VIDEO_PROGRESS_ASYNC + +#define DEFAULT_PROFILER_MSG_PATH "/storage/user/data/" + +#define PROFILER_ENABLE_FLAG_FILE "/storage/user/data/profiler_enable" + +#define RUNTIME_MODE_FILE_PATH "/storage/user/data/jsparser_enable" + +#endif // OHOS_ACELITE_CONFIG_H diff --git a/targets/liteos_m/acelite_config.h b/targets/liteos_m/acelite_config.h new file mode 100755 index 0000000..a15ef50 --- /dev/null +++ b/targets/liteos_m/acelite_config.h @@ -0,0 +1,131 @@ +/* + * Copyright (c) 2020 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. + */ + +#ifndef OHOS_ACELITE_CONFIG_H +#define OHOS_ACELITE_CONFIG_H + +/** + * ================================================================================================ + * config for wearable + * ================================================================================================ + */ +/** + * the flag indicating watch product + */ +#define OHOS_ACELITE_PRODUCT_WATCH + +/** + * support terminate() API from JS + */ +#define FEATURE_TERMINATE_ABILITY + +/** + * support storage and file API for JS + */ +#define FEATURE_MODULE_STORAGE + +/** + * enable FeatureAbility API + */ +#define FEATURE_FEATURE_ABILITY_MODULE + +/** + * enable timer JS API + */ +#define FEATURE_TIMER_MODULE + +/** + * enable localization feature + */ +#define FEATURE_LOCALIZATION_MODULE + +/** + * support sensor API for JS + */ +#define FEATURE_MODULE_SENSOR + +/** + * support device API for JS + */ +#define FEATURE_MODULE_DEVICE + +/** + * support geo location API for JS + */ +#define FEATURE_MODULE_GEO + +/** + * support mc ace log module trace + */ +#define FEATURE_ACELITE_MC_LOG_PRINTF + +/** + * support mc ace event and error code print + */ +#define FEATURE_ACELITE_MC_EVENT_ERROR_CODE_PRINT + +/** + * support mc console log + */ +#define FEATURE_USER_MC_LOG_PRINTF + +/** + * support config for product JS modules + */ +#define FEATURE_PRODUCT_MODULE + +/** + * support config for private JS modules + */ +#define FEATURE_PRIVATE_MODULE + +/** + * support using memory pool from product side + */ +#define FEATURE_ACELITE_PRODUCT_MEMORY_POOL + +/** + * define the max length of user's console log + */ +#ifndef CONSOLE_LOG_LINE_MAX_LENGTH +#define CONSOLE_LOG_LINE_MAX_LENGTH (96) +#endif + +/** + * support mc ace dfx module + */ +#define FEATURE_ACELITE_DFX_MODULE + +#define FEATURE_ACELITE_MC_DFX_MODULE + +/** + * support fatal error handling on device which not support process + */ +#ifndef FEATURE_FATAL_ERROR_HANDLING +#define FEATURE_FATAL_ERROR_HANDLING +#endif + +/** + * support js profiler + */ +#define FEATURE_ACELITE_MC_JS_PROFILER + +#define DEFAULT_PROFILER_MSG_PATH "user/log/" + +#define PROFILER_ENABLE_FLAG_FILE "user/data/profiler_enable" + +#define RUNTIME_MODE_FILE_PATH "user/data/jsparser_enable" + +#endif // OHOS_ACELITE_CONFIG_H diff --git a/targets/platform_adapter.cpp b/targets/platform_adapter.cpp new file mode 100755 index 0000000..6731c9a --- /dev/null +++ b/targets/platform_adapter.cpp @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2020 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. + */ + +#include "platform_adapter.h" +#include +#include "acelite_config.h" +#if (defined(__LINUX__) || defined(__LITEOS__)) +#include "ace_ability.h" +#endif +#include "ace_log.h" +#include "ace_version.h" +#include "js_fwk_common.h" + +namespace OHOS { +namespace ACELite { +void PrintVersionTrace() +{ +#ifdef TARGET_SIMULATOR + // output version trace on simulator + HILOG_DEBUG(HILOG_MODULE_ACE, "ACELite version: %s", ACEVersion::GetStr()); + HILOG_DEBUG(HILOG_MODULE_ACE, "ACELite commit: %s", ACEVersion::GetCommit()); + HILOG_DEBUG(HILOG_MODULE_ACE, "ACELite build stamp: %s", ACEVersion::GetTimeStamp()); +#endif // TARGET_SIMULATOR +} + +void SetEngineSnapshotMode(bool &mode) +{ +#ifndef TARGET_SIMULATOR + mode = true; +#else + mode = false; +#endif +} + +void SetEngineSnapshotModeManually(bool &mode) +{ +#ifndef TARGET_SIMULATOR + // if not startting debugger, on real device, give a chance to use JS mode manually + mode = !(IsFileExisted(RUNTIME_MODE_FILE_PATH)); +#endif // TARGET_SIMULATOR +} + +#ifdef FEATURE_TERMINATE_ABILITY +extern "C" int TerminateAbility(uint16_t token); +#endif +void Terminate(uint16_t token) +{ +#ifndef TARGET_SIMULATOR // no AMS support on PC simulator +#ifdef FEATURE_TERMINATE_ABILITY + (void)TerminateAbility(token); +#else + AceAbility::TerminateSelf(); +#endif +#endif +} + +void Srand(unsigned seed) +{ +#ifdef TARGET_SIMULATOR + srand(seed); +#endif // TARGET_SIMULATOR +} +} // namespace ACELite +} // namespace OHOS diff --git a/targets/platform_adapter.h b/targets/platform_adapter.h new file mode 100755 index 0000000..c8c5755 --- /dev/null +++ b/targets/platform_adapter.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2020 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. + */ +#ifndef OHOS_ACELITE_ADAPTER_H +#define OHOS_ACELITE_ADAPTER_H +#include + +namespace OHOS { +namespace ACELite { +void PrintVersionTrace(); +void SetEngineSnapshotMode(bool &mode); +void SetEngineSnapshotModeManually(bool &mode); +void Terminate(uint16_t token); +void Srand(unsigned seed); +} // namespace ACELite +} // namespace OHOS +#endif // OHOS_ACELITE_ADAPTER_H \ No newline at end of file diff --git a/targets/simulator/win/acelite_config.h b/targets/simulator/win/acelite_config.h new file mode 100755 index 0000000..1a1c714 --- /dev/null +++ b/targets/simulator/win/acelite_config.h @@ -0,0 +1,103 @@ +/* + * Copyright (c) 2020 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. + */ +#ifndef OHOS_ACELITE_CONFIG_H +#define OHOS_ACELITE_CONFIG_H + +/** + * ================================================================================================ + * config for win simulator + * ================================================================================================ + */ +#define OHOS_ACELITE_SIMULATOR_WIN // NOTE: DO NOT use this macro directly + +#define JSFWK_TEST + +/** + * The macro is used to distingush the real device and simulator. + */ +#define TARGET_SIMULATOR + +/** + * Compile all test entry for hmf + */ +#ifdef FEATURE_TEST_IMPLEMENTATION +#error "must keep the global configuration unique" +#else +#define FEATURE_TEST_IMPLEMENTATION +#endif + +/** + * enable FeatureAbility API + */ +#define FEATURE_FEATURE_ABILITY_MODULE + +/** + * support device API for JS + */ +#define FEATURE_MODULE_DEVICE + +/** + * support geo location API for JS + */ +#define FEATURE_MODULE_GEO + +/** + * support sensor API for JS + */ +#define FEATURE_MODULE_SENSOR +/** + * timer module + */ +#define FEATURE_TIMER_MODULE + +/** + * support storage API for JS + */ +#define FEATURE_MODULE_STORAGE + +/** + * localization module + */ +#define FEATURE_LOCALIZATION_MODULE + +/** + * support config for product JS modules + */ +#define FEATURE_PRODUCT_MODULE + +/** + * module require test + */ +#ifdef ENABLE_MODULE_REQUIRE_TEST +#error "must keep the global configuration unique" +#else +#define ENABLE_MODULE_REQUIRE_TEST +#endif + +/** + * define the max length of user's console log + */ +#ifndef CONSOLE_LOG_LINE_MAX_LENGTH +#define CONSOLE_LOG_LINE_MAX_LENGTH (96) +#endif + +/** + * enable Canvas component Feature API on simulator + */ +#define FEATURE_COMPONENT_CANVAS + +#define PROFILER_ENABLE_FLAG_FILE "..\\profiler_enable" + +#endif // OHOS_ACELITE_CONFIG_H diff --git a/tools/profiler/README.md b/tools/profiler/README.md new file mode 100755 index 0000000..600f190 --- /dev/null +++ b/tools/profiler/README.md @@ -0,0 +1,28 @@ +# Js Profiler转换工具说明 + +将真机的数字化文本转换成js性能打点记录 + +## 文件说明 + +- `js_profiler.py` 入口文件,根据参数进行信息转换 +- `js_profiler_config.py` 配置文件 + +## 使用方法 + +#### 环境搭建 + +1. 安装python环境 + - python >= 3.6 +2. 使用python 运行`js_profiler.py`文件 + +#### 使用示例: + +``` bash +# 转换 +python js_profiler.py --source D:\workspace\hmf\ace\lite\ace_profiler_582.log --destination D:\workspace\hmf\ace\lite\ace_profiler_582_real.log +``` + +#### 参数说明 + +* `--source` 带转换的文件,例如 `D:\workspace\hmf\ace\lite\ace_profiler_582.log` +* `--destination` 生成的文件,例如 `D:\workspace\hmf\ace\lite\ace_profiler_582_real.log` diff --git a/tools/profiler/js_profiler.py b/tools/profiler/js_profiler.py new file mode 100755 index 0000000..e07bba6 --- /dev/null +++ b/tools/profiler/js_profiler.py @@ -0,0 +1,81 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2020 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 sys +import argparse + +from js_profiler_config import key_word +from js_profiler_config import label_name +from js_profiler_config import profiler_name + +sys.path.append('./js_profiler_config.py') + + +def add_label(index): + return label_name[index] + + +def add_parent_label(index): + parent_info = profiler_name[label_name[index]] + return 'UNKNOWN' if parent_info == 'P_UNKNOWN' else parent_info + + +def add_component_info(component_id): + return key_word[component_id] + + +def add_description_info(description_id): + return '' if description_id == 0 else key_word[description_id] + + +def parser(opt): + source_file = opt.source + try: + with open(source_file, 'r') as source: + for line in source.readlines(): + strlist = line.split(' ') + if len(strlist) == 5: + msg = 'COST ' + add_component_info(int(strlist[0])) + msg = msg + ' ' + add_label(int(strlist[1])) + msg = msg + ' ' + strlist[2] + 'ms' + msg = msg + ' [' + \ + add_description_info(int(strlist[3])) + ']' + msg = msg + ' ' + add_parent_label(int(strlist[4])) + print(msg) + output(msg, opt.destination) + except Exception: + print('open source file error') + + +def output(msg, dest): + try: + with open(dest, 'a+') as destination: + destination.write(msg + '\n') + except Exception: + print('open destination file error') + + +def get_parameters(): + parser_config = argparse.ArgumentParser() + parser_config.add_argument('--source', type=str, default='', + help='input file') + parser_config.add_argument('--destination', type=str, default='.', + help='output file') + config = parser_config.parse_args() + return config + + +if __name__ == '__main__': + parser(get_parameters()) diff --git a/tools/profiler/js_profiler_config.py b/tools/profiler/js_profiler_config.py new file mode 100755 index 0000000..ac7e904 --- /dev/null +++ b/tools/profiler/js_profiler_config.py @@ -0,0 +1,295 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2020 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. + + +""" +config file +if ace js framework add config, when you use the util should adapter the config +""" + +key_word = [ + 'UNKNOWN', + 'alignItems', + # ifdef FEATURE_COMPONENT_ANALOG_CLOCK + # 'analog-clock' + # endif + 'animationDelay', + 'animationDuration', + 'animationFillMode', + 'animationIterationCount', + 'animationName', + 'animationTimingFunction', + 'arc', + 'backgroundColor', + 'backgroundImage', + 'blockColor', + 'borderBottomColor', + 'borderLeftColor', + 'borderRightColor', + 'borderTopColor', + 'borderColor', + 'borderRadius', + 'borderBottomWidth', + 'borderLeftWidth', + 'borderRightWidth', + 'borderTopWidth', + 'borderWidth', + 'break', + 'center', + 'centerX', + 'centerY', + 'change', + 'checked', + 'checkbox', + 'click', + 'clip', + 'chart', + # ifdef FEATURE_COMPONENT_ANALOG_CLOCK + # 'clock-hand', + # endif + 'color', + 'column', + 'column-reverse', + 'columns', + 'datasets', + # ifdef FEATURE_COMPONENT_DATE_PICKER + # 'date', + # endif + 'direction', + 'display', + 'div', + 'drag', + 'duration', + 'ease-in', + 'ease-in-out', + 'ease-out', + 'ellipsis', + # ifdef FEATURE_COMPONENT_DATE_PICKER + # 'end', + # endif + 'expand', + 'false', + 'fixedsize', + 'flexDirection', + 'flex-end', + 'flex-start', + 'flexWrap', + 'fontSize', + 'fontFamily', + 'forwards', + 'height', + # ifdef FEATURE_COMPONENT_ANALOG_CLOCK + # 'hour', + # endif + 'id', + 'image', + 'image-animator', + 'images', + 'index', + 'input', + 'itemselected', + 'iteration', + 'justifyContent', + # 'key', + 'labels', + 'larger', + 'left', + 'letterSpacing', + 'lineHeight', + 'list-weak', + 'list', + 'list-item', + 'longpress', + 'loop', + 'margin', + 'marginBottom', + 'marginLeft', + 'marginRight', + 'marginTop', + 'marquee', + 'max', + 'min', + 'mini', + 'name', + 'none', + 'opacity', + 'opations', + 'padding', + 'paddingBottom', + 'paddingLeft', + 'paddingRight', + 'paddingTop', + 'percent', + 'picker-view', + 'ref', + # ifdef FEATURE_COMPONENT_ANALOG_CLOCK + # 'pivotX', + # 'pivotY', + # endif + 'progress', + 'radio', + 'radius', + 'range', + 'reverse', + 'right', + 'rotate', + 'row', + 'row-reverse', + 'scrollamount', + 'scrollend', + 'scrollstart', + # ifdef FEATURE_COMPONENT_ANALOG_CLOCK + # 'sec', + # endif + 'selected', + 'selectedColor', + 'selectedFontFamily', + 'selectedFontSize', + 'show', + 'slider', + 'space-around', + 'space-between', + 'src', + 'stack', + 'standard', + 'stop', + # ifdef FEATURE_COMPONENT_DATE_PICKER + # 'start', + # endif + 'startAngle', + 'step', + 'strokeWidth', + 'swipe', + 'swiper', + 'switch', + # ifdef FEATURE_COMPONENT_TABS + # 'tab-bar', + # 'tab-content', + # 'tabs', + # endif + 'text', + 'textAlign', + 'textOverflow', + 'time', + 'top', + 'total-angle', + # 'touchcancel', + # 'touchend', + # 'touchmove', + # 'touchstart', + 'translateX', + 'translateY', + 'true', + # ifdef FEATURE_COMPONENT_ANALOG_CLOCK + # 'type', + # endif + 'value', + 'vertical', + 'width', + 'wrap' +] + +label_name = [ + 'UNKNOWN', + 'LAUNCH', + 'ENGINE_INIT', + 'FWK_INIT', + 'JS_BEGIN', + 'JS_FWK_EVAL', + 'JS_APP_INIT', + 'JS_INIT_STATE', + 'JS_INIT_DATA_GET_DATA', + 'JS_INIT_DATA_PROXY', + 'JS_INIT_DATA_OBSERVE', + 'JS_END', + 'FWK_CODE_LOAD', + 'FWK_CODE_EVAL', + 'APP_CODE_LOAD', + 'APP_CODE_EVAL', + 'PAGE_CODE_LOAD', + 'PAGE_CODE_EVAL', + 'STYLESHEET_INIT', + 'APP_ON_CREATE', + 'APP_ON_DESTROY', + 'ROUTER_REPLACE', + 'PAGE_TRANSFER_DATA', + 'PAGE_ON_INIT', + 'PAGE_ON_READY', + 'PAGE_ON_SHOW', + 'PAGE_ON_DESTROY', + 'RENDER', + 'ADD_TO_ROOT_VIEW', + 'RENDER_CREATE_COMPONENT', + 'RENDER_COMBINE_STYLE', + 'RENDER_BIND_JS_OBJECT', + 'RENDER_PARSE_ATTR', + 'RENDER_PARSE_EVENT', + 'RENDER_APPLY_STYLE', + 'RENDER_PROCESS_CHILDREN', + 'SET_ATTR_PARSE_EXPRESSION', + 'SET_ATTR_STRING_OF', + 'SET_ATTR_PARSE_KEY_ID', + 'SET_ATTR_SET_TO_NATIVE', + 'APPLY_STYLE_ITEM', + 'WATCHER_CALLBACK_FUNC', + 'FOR_WATCHER_CALLBACK_FUNC', + 'WATCHER_CONSTRUCT' +] + +profiler_name = { + 'UNKNOWN': 'P_UNKNOWN', + 'LAUNCH': 'P_UNKNOWN', + 'ENGINE_INIT': 'LAUNCH', + 'FWK_INIT': 'LAUNCH', + 'JS_BEGIN': 'P_UNKNOWN', + 'JS_FWK_EVAL': 'PAGE_CODE_EVAL', + 'JS_APP_INIT': 'FWK_CODE_EVAL', + 'JS_INIT_STATE': 'JS_FWK_EVAL', + 'JS_INIT_DATA_GET_DATA': 'JS_INIT_STATE', + 'JS_INIT_DATA_PROXY': 'JS_INIT_STATE', + 'JS_INIT_DATA_OBSERVE': 'JS_INIT_STATE', + 'JS_END': 'P_UNKNOWN', + 'FWK_CODE_LOAD': 'FWK_INIT', + 'FWK_CODE_EVAL': 'FWK_INIT', + 'APP_CODE_LOAD': 'LAUNCH', + 'APP_CODE_EVAL': 'LAUNCH', + 'PAGE_CODE_LOAD': 'ROUTER_REPLACE', + 'PAGE_CODE_EVAL': 'ROUTER_REPLACE', + 'STYLESHEET_INIT': 'JS_FWK_EVAL', + 'APP_ON_CREATE': 'LAUNCH', + 'APP_ON_DESTROY': 'LAUNCH', + 'ROUTER_REPLACE': 'LAUNCH', + 'PAGE_TRANSFER_DATA': 'ROUTER_REPLACE', + 'PAGE_ON_INIT': 'ROUTER_REPLACE', + 'PAGE_ON_READY': 'ROUTER_REPLACE', + 'PAGE_ON_SHOW': 'ROUTER_REPLACE', + 'PAGE_ON_DESTROY': 'P_UNKNOWN', + 'RENDER': 'ROUTER_REPLACE', + 'ADD_TO_ROOT_VIEW': 'LAUNCH', + 'RENDER_CREATE_COMPONENT': 'RENDER', + 'RENDER_COMBINE_STYLE': 'RENDER', + 'RENDER_BIND_JS_OBJECT': 'RENDER', + 'RENDER_PARSE_ATTR': 'RENDER', + 'RENDER_PARSE_EVENT': 'RENDER', + 'RENDER_APPLY_STYLE': 'RENDER', + 'RENDER_PROCESS_CHILDREN': 'RENDER', + 'SET_ATTR_PARSE_EXPRESSION': 'RENDER_PARSE_ATTR', + 'SET_ATTR_STRING_OF': 'RENDER_PARSE_ATTR', + 'SET_ATTR_PARSE_KEY_ID': 'RENDER_PARSE_ATTR', + 'SET_ATTR_SET_TO_NATIVE': 'RENDER_PARSE_ATTR', + 'APPLY_STYLE_ITEM': 'RENDER_APPLY_STYLE', + 'WATCHER_CALLBACK_FUNC': 'P_UNKNOWN', + 'FOR_WATCHER_CALLBACK_FUNC': 'P_UNKNOWN', + 'WATCHER_CONSTRUCT': 'SET_ATTR_PARSE_EXPRESSION' +} diff --git a/tools/snapshot/framework2char.py b/tools/snapshot/framework2char.py new file mode 100755 index 0000000..7c78d48 --- /dev/null +++ b/tools/snapshot/framework2char.py @@ -0,0 +1,130 @@ +# -*- coding: utf-8 -*- +# Copyright (c) 2020 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 + +HMF_ACE_BASE_PATH = os.path.join("..", "..") +FRAMEWORK_SNAPSHOT_FILE_PATH = os.path.join( + HMF_ACE_BASE_PATH, "packages", "runtime-core", + "build", "framework.min.bc") +SNAPSHOT_OUTPUT_C_FILE_PATH = os.path.join( + HMF_ACE_BASE_PATH, "src", "core", "base", "framework_min_bc.h") + +FRAMEWORK_JS_FILE_PATH = os.path.join( + HMF_ACE_BASE_PATH, "packages", "runtime-core", + "build", "framework.min.js") +JS_OUTPUT_C_FILE_PATH = os.path.join( + HMF_ACE_BASE_PATH, "src", "core", "base", "framework_min_js.h") + + +def output_copyright(output): + output.write("/*\n") + output.write(" * Copyright (c) 2020 Huawei Device Co., Ltd.\n") + output.write(" * Licensed under the Apache License, Version 2.0") + output.write(" (the \"License\");\n") + output.write(" * you may not use this file except in compliance ") + output.write("with the License.\n") + output.write(" * You may obtain a copy of the License at\n") + output.write(" *\n") + output.write(" * http://www.apache.org/licenses/LICENSE-2.0\n") + output.write(" *\n") + output.write(" * Unless required by applicable law or agreed to in ") + output.write("writing, software\n") + output.write(" * distributed under the License is distributed on an ") + output.write("\"AS IS\" BASIS,\n") + output.write(" * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either ") + output.write("express or implied.\n") + output.write(" * See the License for the specific language governing ") + output.write("permissions and\n") + output.write(" * limitations under the License.\n") + output.write(" */\n") + output.write("\n") + + +def output_check_notes(output): + output.write("// AUTO GENERATED, PLEASE DO NOT EDIT DIRECTLY\n\n") + output.write("#ifndef ACELITE_FRAMEWORK_RAW_BUFFER\n") + output.write("#error THIS FILE CAN ONLY BE INCLUDED BY RAW BUFFER CPP\n") + output.write("#endif\n\n") + + +def convert_bc(): + with open(FRAMEWORK_SNAPSHOT_FILE_PATH, 'rb') as input_file: + byte_code_buffer = input_file.read() + with open(SNAPSHOT_OUTPUT_C_FILE_PATH, 'w') as output: + output_copyright(output) + output_check_notes(output) + output.write( + "#ifndef OHOS_ACELITE_FRAMEWORK_MIN_SNAPSHOT_BUFFER\n") + output.write( + "#define OHOS_ACELITE_FRAMEWORK_MIN_SNAPSHOT_BUFFER\n") + output.write("const char g_frameworkBCBuffer[] =\n{\n ") + index = 1 + max_count = len(byte_code_buffer) + for data in byte_code_buffer: + hex_string = '0x%02x' % data + final_hex_string = hex_string + if index != max_count: + if index % 16 == 0: + final_hex_string = '%s,' % hex_string + else: + final_hex_string = '%s, ' % hex_string + output.write(final_hex_string) + if index % 16 == 0: + output.write("\n ") + else: + output.write(final_hex_string + '\n') + index = index + 1 + output.write("};\n") + output.write("#endif") + + + +def convert_js(): + with open(FRAMEWORK_JS_FILE_PATH, 'r') as input_file: + javascript_buffer = input_file.read() + with open(JS_OUTPUT_C_FILE_PATH, 'w') as output: + output_copyright(output) + output_check_notes(output) + output.write( + "#ifndef OHOS_ACELITE_FRAMEWORK_MIN_JS_BUFFER\n") + output.write( + "#define OHOS_ACELITE_FRAMEWORK_MIN_JS_BUFFER\n") + output.write( + "const char * const g_frameworkJSBuffer =\n \"") + max_count = len(javascript_buffer) + index = 0 + for data in javascript_buffer: + cha = data + if cha == '\"': + cha = '\'' + if cha == '\n': + continue + final_string = '%c' % cha + if index != (max_count - 1): + if (index != 0 and index % 90 == 0): + final_string = '%c\"' % cha + output.write(final_string) + if (index != 0 and index % 90 == 0): + output.write("\n \"") + else: + output.write(final_string) + index = index + 1 + output.write("\";\n") + output.write("#endif") + + +if __name__ == '__main__': + convert_js() + convert_bc() diff --git a/tools/snapshot/jerry_bin/ReadMe.md b/tools/snapshot/jerry_bin/ReadMe.md new file mode 100755 index 0000000..670512a --- /dev/null +++ b/tools/snapshot/jerry_bin/ReadMe.md @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2020 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. + */ + +**Linux** + +`./jerry-snapshot generate -o out.snapshot.bc input.js` + +**Windows** + +`./jerry-snapshot.exe generate -o out.snapshot.bc input.js` + diff --git a/tools/snapshot/jerry_bin/build_jerry.bat b/tools/snapshot/jerry_bin/build_jerry.bat new file mode 100755 index 0000000..0ab4c4a --- /dev/null +++ b/tools/snapshot/jerry_bin/build_jerry.bat @@ -0,0 +1,19 @@ +@rem Copyright (c) 2020 Huawei Device Co., Ltd. +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem http://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. + +@echo off + +python ../../../../../external/jerryscript/tools/build.py --mem-heap=16 --snapshot-exec=ON --snapshot-save=ON --profile=es5.1 --error-messages=ON --logging=ON --mem-stats=ON --jerry-cmdline-snapshot=ON +cp ..\..\..\..\..\external\jerryscript\build\bin\MinSizeRel\jerry.exe .\win\ +cp ..\..\..\..\..\external\jerryscript\build\bin\MinSizeRel\jerry-snapshot.exe .\win\ + diff --git a/tools/snapshot/jerry_bin/build_jerry.sh b/tools/snapshot/jerry_bin/build_jerry.sh new file mode 100755 index 0000000..05920a4 --- /dev/null +++ b/tools/snapshot/jerry_bin/build_jerry.sh @@ -0,0 +1,17 @@ +#!/bin/sh +#Copyright (c) 2020 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. + +python ../../../../../external/jerryscript/tools/build.py --mem-heap=16 --snapshot-exec=ON --snapshot-save=ON --profile=es5.1 --error-messages=ON --logging=ON --mem-stats=ON --jerry-cmdline-snapshot=ON +cp ../../../../../external/jerryscript/build/bin/jerry ./linux/ +cp ../../../../../external/jerryscript/build/bin/jerry-snapshot ./linux/