diff --git a/README.md b/README.md index e242333..e4061d6 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ An open source license scanning and display library for HarmonyOS. ## Features - **End-to-end** — scans your dependencies at build time and displays the license list in your app. No manual JSON editing, no drift. -- **Prebuilt UI pages** — drop-in list and detail pages built on ArkUI & UI Design Kit components. +- **Prebuilt UI pages** — drop-in list/detail UI built on ArkUI & UI Design Kit, adaptive for both phone and large screens. - **Custom UI, no problem** — use the core package alone to load and parse the license data and render it in any UI you build. - **Always up to date** — the Hvigor plugin scans `oh_modules/` on every build. The license list always matches what you ship. - **AI-assisted integration** — ships an Agent Skill so an AI can wire the library into your project for you. @@ -77,24 +77,23 @@ export default { On each build, the plugin scans `oh_modules/` and generates `entry/src/main/resources/rawfile/osslibraries.json`. -### Import the HAR pages (register named routes) +### Import the HAR page (register the named route) At the top of a page file in the `entry` module (e.g. `Index.ets`), add: ```ets -import 'osslibraries_ui/src/main/ets/pages/OSSLibrariesLicenseListPage'; -import 'osslibraries_ui/src/main/ets/pages/OSSLibrariesLicenseDetailPage'; +import 'osslibraries_ui/src/main/ets/pages/OSSLibrariesLicensePage'; ``` No changes are needed in `entry`'s `main_pages.json` — just keep its own pages. -### Navigate to the license list page +### Navigate to the license page From any page in your app, navigate via `pushNamedRoute`: ```ets this.getUIContext().getRouter().pushNamedRoute({ - name: 'OSSLibrariesLicenseListPage' + name: 'OSSLibrariesLicensePage' }); ``` diff --git a/README_zh.md b/README_zh.md index a3776e6..f4bfeae 100644 --- a/README_zh.md +++ b/README_zh.md @@ -12,7 +12,7 @@ ## 特性 - **端到端** — 从构建时扫描依赖到应用内展示 License 列表,一条链路走通,无需手动维护 JSON。 -- **预定义 UI 页面** — 提供开箱即用的列表页与详情页,基于 ArkUI 和 UI Design Kit 组件。 +- **预定义 UI 页面** — 提供开箱即用的列表/详情 UI,基于 ArkUI 和 UI Design Kit 组件,且对手机与大屏自适应。 - **自定义 UI 亦可** — 可单独使用 Core 包加载并解析许可证数据,License 列表的渲染方式完全由你决定。 - **始终同步** — Hvigor 插件在每次构建时扫描 `oh_modules/`,License 列表永远跟随实际发布的依赖。 - **AI 辅助集成** — 提供 Agent Skill,可由 AI 代为完成项目接入。 @@ -82,19 +82,18 @@ export default { 在 `entry` 模块的页面文件顶部(如 `Index.ets`)添加: ```ets -import 'osslibraries_ui/src/main/ets/pages/OSSLibrariesLicenseListPage'; -import 'osslibraries_ui/src/main/ets/pages/OSSLibrariesLicenseDetailPage'; +import 'osslibraries_ui/src/main/ets/pages/OSSLibrariesLicensePage'; ``` `entry` 模块的 `main_pages.json` 无需改动,只需保留自身页面即可。 -### 跳转到许可列表页 +### 跳转到许可页 -在应用的任意页面中,通过 `pushNamedRoute` 跳转到列表页: +在应用的任意页面中,通过 `pushNamedRoute` 跳转到许可页: ```ets this.getUIContext().getRouter().pushNamedRoute({ - name: 'OSSLibrariesLicenseListPage' + name: 'OSSLibrariesLicensePage' }); ``` diff --git a/entry/oh-package-lock.json5 b/entry/oh-package-lock.json5 index f269438..675129c 100644 --- a/entry/oh-package-lock.json5 +++ b/entry/oh-package-lock.json5 @@ -30,7 +30,7 @@ }, "osslibraries_ui@../osslibraries_ui": { "name": "osslibraries_ui", - "version": "0.0.7", + "version": "0.0.8", "resolved": "../osslibraries_ui", "registryType": "local", "dependencies": { diff --git a/entry/src/main/ets/pages/Index.ets b/entry/src/main/ets/pages/Index.ets index 99d9383..a93ab95 100644 --- a/entry/src/main/ets/pages/Index.ets +++ b/entry/src/main/ets/pages/Index.ets @@ -1,5 +1,4 @@ -import 'osslibraries_ui/src/main/ets/pages/OSSLibrariesLicenseListPage'; -import 'osslibraries_ui/src/main/ets/pages/OSSLibrariesLicenseDetailPage'; +import 'osslibraries_ui/src/main/ets/pages/OSSLibrariesLicensePage'; import { UI_LIST_PAGE_ROUTE } from 'osslibraries_ui/src/main/ets/constants/RouteNames'; @Entry diff --git a/entry/src/main/module.json5 b/entry/src/main/module.json5 index c8dd8bc..0e2e538 100644 --- a/entry/src/main/module.json5 +++ b/entry/src/main/module.json5 @@ -4,7 +4,7 @@ type: "entry", description: "$string:module_desc", mainElement: "EntryAbility", - deviceTypes: ["phone"], + deviceTypes: ["phone", "tablet", "tv"], deliveryWithInstall: true, installationFree: false, pages: "$profile:main_pages", diff --git a/entry/src/main/resources/rawfile/osslibraries.msgpack b/entry/src/main/resources/rawfile/osslibraries.msgpack index 312ee3c..ae96ec4 100644 --- a/entry/src/main/resources/rawfile/osslibraries.msgpack +++ b/entry/src/main/resources/rawfile/osslibraries.msgpack @@ -1,4 +1,4 @@ -librariesuniqueId@ohos/hamockartifactVersion1.0.0name@ohos/hamockdescription-A mock framework for OpenHarmony application.websitedevelopersnamehuaweiorganisationUrlscmorganizationfundingtaglicenses@9264a6b3c134511ccfcae48ed3808320688ae6933ec4fc547476a005095fc1efuniqueId@ohos/hypiumartifactVersion1.0.28name@ohos/hypiumdescription1A unit test framework for OpenHarmony applicationwebsite.https://gitee.com/openharmony/testfwk_arkxtestdevelopersnamehuaweiorganisationUrlscmconnectiondeveloperConnectionurl.https://gitee.com/openharmony/testfwk_arkxtestorganizationfundingtag测试框架exceptmocklicenses@0cec06e0e55fbc3dc5cee4fca9b607f66cb8f4e4dbcf3b3c013594dd156732e9uniqueId@ohos/msgpackartifactVersion1.0.2name@ohos/msgpackdescriptionَThis library is an implementation of MessagePack for TypeScript and JavaScript, providing a compact and efficient binary serialization format.websitedevelopersnameohos_tpcorganisationUrlscmconnectiondeveloperConnectionurlThttps://gitcode.com/openharmony-tpc/openharmony_tpc_samples/tree/master/ohos_msgpackorganizationfundingtagmsgpackHarmonyOSOpenHarmonylicenses@a0ecad9e3fd75dcac83c89ffe78180c784d47a37db94b87e18bd1a43e0f247cauniqueIdosslibrariesartifactVersion0.0.4nameosslibrariesdescriptiono适用于 HarmonyOS 的开放源代码许可扫描与展示库 —— 该包是 OSSLibraries 的 Core 部分。website-https://github.com/composable-tu/osslibrariesdevelopersnamecomposable-tuorganisationUrl https://github.com/composable-tuscmconnectiondeveloperConnectionurl-https://github.com/composable-tu/osslibrariesorganizationfundingtagosslibrarieslicenselicensesopen-sourceosslicenses@533c62b51f490ec5ba0118d19bb2caef961c3b630bf4355eb1e360026db6fda2uniqueIdosslibraries_uiartifactVersion0.0.7nameosslibraries_uidescriptionv适用于 HarmonyOS 的开放源代码许可扫描与展示库 —— 该包是 OSSLibraries 的预定义 UI 部分。website-https://github.com/composable-tu/osslibrariesdevelopersnamecomposable-tuorganisationUrl https://github.com/composable-tuscmconnectiondeveloperConnectionurl-https://github.com/composable-tu/osslibrariesorganizationfundingtagosslibrarieslicenselicensesopen-sourceosslicenses@533c62b51f490ec5ba0118d19bb2caef961c3b630bf4355eb1e360026db6fda2uniqueIdosslibraries_ui_wearartifactVersion0.0.3nameosslibraries_ui_weardescriptionى一个适用于 HarmonyOS 的开放源代码许可扫描与展示库 —— 该包是 OSSLibraries 的预定义 UI(Wearable)部分。website-https://github.com/composable-tu/osslibrariesdevelopersnamecomposable-tuorganisationUrl https://github.com/composable-tuscmconnectiondeveloperConnectionurl-https://github.com/composable-tu/osslibrariesorganizationfundingtagosslibrarieslicenselicensesopen-sourceosswearablewearlicenses@533c62b51f490ec5ba0118d19bb2caef961c3b630bf4355eb1e360026db6fda2licenses@533c62b51f490ec5ba0118d19bb2caef961c3b630bf4355eb1e360026db6fda2hash@533c62b51f490ec5ba0118d19bb2caef961c3b630bf4355eb1e360026db6fda2name,Mulan Permissive Software License, Version 2url&https://license.coscl.org.cn/MulanPSL2spdxIdMulanPSL-2.0content$! 木兰宽松许可证, 第2版 +librariesuniqueId@ohos/hamockartifactVersion1.0.0name@ohos/hamockdescription-A mock framework for OpenHarmony application.websitedevelopersnamehuaweiorganisationUrlscmorganizationfundingtaglicenses@9264a6b3c134511ccfcae48ed3808320688ae6933ec4fc547476a005095fc1efuniqueId@ohos/hypiumartifactVersion1.0.28name@ohos/hypiumdescription1A unit test framework for OpenHarmony applicationwebsite.https://gitee.com/openharmony/testfwk_arkxtestdevelopersnamehuaweiorganisationUrlscmconnectiondeveloperConnectionurl.https://gitee.com/openharmony/testfwk_arkxtestorganizationfundingtag测试框架exceptmocklicenses@0cec06e0e55fbc3dc5cee4fca9b607f66cb8f4e4dbcf3b3c013594dd156732e9uniqueId@ohos/msgpackartifactVersion1.0.2name@ohos/msgpackdescriptionَThis library is an implementation of MessagePack for TypeScript and JavaScript, providing a compact and efficient binary serialization format.websitedevelopersnameohos_tpcorganisationUrlscmconnectiondeveloperConnectionurlThttps://gitcode.com/openharmony-tpc/openharmony_tpc_samples/tree/master/ohos_msgpackorganizationfundingtagmsgpackHarmonyOSOpenHarmonylicenses@a0ecad9e3fd75dcac83c89ffe78180c784d47a37db94b87e18bd1a43e0f247cauniqueIdosslibrariesartifactVersion0.0.4nameosslibrariesdescriptiono适用于 HarmonyOS 的开放源代码许可扫描与展示库 —— 该包是 OSSLibraries 的 Core 部分。website-https://github.com/composable-tu/osslibrariesdevelopersnamecomposable-tuorganisationUrl https://github.com/composable-tuscmconnectiondeveloperConnectionurl-https://github.com/composable-tu/osslibrariesorganizationfundingtagosslibrarieslicenselicensesopen-sourceosslicenses@533c62b51f490ec5ba0118d19bb2caef961c3b630bf4355eb1e360026db6fda2uniqueIdosslibraries_uiartifactVersion0.0.8nameosslibraries_uidescriptionv适用于 HarmonyOS 的开放源代码许可扫描与展示库 —— 该包是 OSSLibraries 的预定义 UI 部分。website-https://github.com/composable-tu/osslibrariesdevelopersnamecomposable-tuorganisationUrl https://github.com/composable-tuscmconnectiondeveloperConnectionurl-https://github.com/composable-tu/osslibrariesorganizationfundingtagosslibrarieslicenselicensesopen-sourceosslicenses@533c62b51f490ec5ba0118d19bb2caef961c3b630bf4355eb1e360026db6fda2uniqueIdosslibraries_ui_wearartifactVersion0.0.3nameosslibraries_ui_weardescriptionى一个适用于 HarmonyOS 的开放源代码许可扫描与展示库 —— 该包是 OSSLibraries 的预定义 UI(Wearable)部分。website-https://github.com/composable-tu/osslibrariesdevelopersnamecomposable-tuorganisationUrl https://github.com/composable-tuscmconnectiondeveloperConnectionurl-https://github.com/composable-tu/osslibrariesorganizationfundingtagosslibrarieslicenselicensesopen-sourceosswearablewearlicenses@533c62b51f490ec5ba0118d19bb2caef961c3b630bf4355eb1e360026db6fda2licenses@533c62b51f490ec5ba0118d19bb2caef961c3b630bf4355eb1e360026db6fda2hash@533c62b51f490ec5ba0118d19bb2caef961c3b630bf4355eb1e360026db6fda2name,Mulan Permissive Software License, Version 2url&https://license.coscl.org.cn/MulanPSL2spdxIdMulanPSL-2.0content$! 木兰宽松许可证, 第2版 木兰宽松许可证, 第2版 2020年1月 http://license.coscl.org.cn/MulanPSL2 diff --git a/entry_wear/src/main/resources/rawfile/osslibraries.msgpack b/entry_wear/src/main/resources/rawfile/osslibraries.msgpack index 312ee3c..ae96ec4 100644 --- a/entry_wear/src/main/resources/rawfile/osslibraries.msgpack +++ b/entry_wear/src/main/resources/rawfile/osslibraries.msgpack @@ -1,4 +1,4 @@ -librariesuniqueId@ohos/hamockartifactVersion1.0.0name@ohos/hamockdescription-A mock framework for OpenHarmony application.websitedevelopersnamehuaweiorganisationUrlscmorganizationfundingtaglicenses@9264a6b3c134511ccfcae48ed3808320688ae6933ec4fc547476a005095fc1efuniqueId@ohos/hypiumartifactVersion1.0.28name@ohos/hypiumdescription1A unit test framework for OpenHarmony applicationwebsite.https://gitee.com/openharmony/testfwk_arkxtestdevelopersnamehuaweiorganisationUrlscmconnectiondeveloperConnectionurl.https://gitee.com/openharmony/testfwk_arkxtestorganizationfundingtag测试框架exceptmocklicenses@0cec06e0e55fbc3dc5cee4fca9b607f66cb8f4e4dbcf3b3c013594dd156732e9uniqueId@ohos/msgpackartifactVersion1.0.2name@ohos/msgpackdescriptionَThis library is an implementation of MessagePack for TypeScript and JavaScript, providing a compact and efficient binary serialization format.websitedevelopersnameohos_tpcorganisationUrlscmconnectiondeveloperConnectionurlThttps://gitcode.com/openharmony-tpc/openharmony_tpc_samples/tree/master/ohos_msgpackorganizationfundingtagmsgpackHarmonyOSOpenHarmonylicenses@a0ecad9e3fd75dcac83c89ffe78180c784d47a37db94b87e18bd1a43e0f247cauniqueIdosslibrariesartifactVersion0.0.4nameosslibrariesdescriptiono适用于 HarmonyOS 的开放源代码许可扫描与展示库 —— 该包是 OSSLibraries 的 Core 部分。website-https://github.com/composable-tu/osslibrariesdevelopersnamecomposable-tuorganisationUrl https://github.com/composable-tuscmconnectiondeveloperConnectionurl-https://github.com/composable-tu/osslibrariesorganizationfundingtagosslibrarieslicenselicensesopen-sourceosslicenses@533c62b51f490ec5ba0118d19bb2caef961c3b630bf4355eb1e360026db6fda2uniqueIdosslibraries_uiartifactVersion0.0.7nameosslibraries_uidescriptionv适用于 HarmonyOS 的开放源代码许可扫描与展示库 —— 该包是 OSSLibraries 的预定义 UI 部分。website-https://github.com/composable-tu/osslibrariesdevelopersnamecomposable-tuorganisationUrl https://github.com/composable-tuscmconnectiondeveloperConnectionurl-https://github.com/composable-tu/osslibrariesorganizationfundingtagosslibrarieslicenselicensesopen-sourceosslicenses@533c62b51f490ec5ba0118d19bb2caef961c3b630bf4355eb1e360026db6fda2uniqueIdosslibraries_ui_wearartifactVersion0.0.3nameosslibraries_ui_weardescriptionى一个适用于 HarmonyOS 的开放源代码许可扫描与展示库 —— 该包是 OSSLibraries 的预定义 UI(Wearable)部分。website-https://github.com/composable-tu/osslibrariesdevelopersnamecomposable-tuorganisationUrl https://github.com/composable-tuscmconnectiondeveloperConnectionurl-https://github.com/composable-tu/osslibrariesorganizationfundingtagosslibrarieslicenselicensesopen-sourceosswearablewearlicenses@533c62b51f490ec5ba0118d19bb2caef961c3b630bf4355eb1e360026db6fda2licenses@533c62b51f490ec5ba0118d19bb2caef961c3b630bf4355eb1e360026db6fda2hash@533c62b51f490ec5ba0118d19bb2caef961c3b630bf4355eb1e360026db6fda2name,Mulan Permissive Software License, Version 2url&https://license.coscl.org.cn/MulanPSL2spdxIdMulanPSL-2.0content$! 木兰宽松许可证, 第2版 +librariesuniqueId@ohos/hamockartifactVersion1.0.0name@ohos/hamockdescription-A mock framework for OpenHarmony application.websitedevelopersnamehuaweiorganisationUrlscmorganizationfundingtaglicenses@9264a6b3c134511ccfcae48ed3808320688ae6933ec4fc547476a005095fc1efuniqueId@ohos/hypiumartifactVersion1.0.28name@ohos/hypiumdescription1A unit test framework for OpenHarmony applicationwebsite.https://gitee.com/openharmony/testfwk_arkxtestdevelopersnamehuaweiorganisationUrlscmconnectiondeveloperConnectionurl.https://gitee.com/openharmony/testfwk_arkxtestorganizationfundingtag测试框架exceptmocklicenses@0cec06e0e55fbc3dc5cee4fca9b607f66cb8f4e4dbcf3b3c013594dd156732e9uniqueId@ohos/msgpackartifactVersion1.0.2name@ohos/msgpackdescriptionَThis library is an implementation of MessagePack for TypeScript and JavaScript, providing a compact and efficient binary serialization format.websitedevelopersnameohos_tpcorganisationUrlscmconnectiondeveloperConnectionurlThttps://gitcode.com/openharmony-tpc/openharmony_tpc_samples/tree/master/ohos_msgpackorganizationfundingtagmsgpackHarmonyOSOpenHarmonylicenses@a0ecad9e3fd75dcac83c89ffe78180c784d47a37db94b87e18bd1a43e0f247cauniqueIdosslibrariesartifactVersion0.0.4nameosslibrariesdescriptiono适用于 HarmonyOS 的开放源代码许可扫描与展示库 —— 该包是 OSSLibraries 的 Core 部分。website-https://github.com/composable-tu/osslibrariesdevelopersnamecomposable-tuorganisationUrl https://github.com/composable-tuscmconnectiondeveloperConnectionurl-https://github.com/composable-tu/osslibrariesorganizationfundingtagosslibrarieslicenselicensesopen-sourceosslicenses@533c62b51f490ec5ba0118d19bb2caef961c3b630bf4355eb1e360026db6fda2uniqueIdosslibraries_uiartifactVersion0.0.8nameosslibraries_uidescriptionv适用于 HarmonyOS 的开放源代码许可扫描与展示库 —— 该包是 OSSLibraries 的预定义 UI 部分。website-https://github.com/composable-tu/osslibrariesdevelopersnamecomposable-tuorganisationUrl https://github.com/composable-tuscmconnectiondeveloperConnectionurl-https://github.com/composable-tu/osslibrariesorganizationfundingtagosslibrarieslicenselicensesopen-sourceosslicenses@533c62b51f490ec5ba0118d19bb2caef961c3b630bf4355eb1e360026db6fda2uniqueIdosslibraries_ui_wearartifactVersion0.0.3nameosslibraries_ui_weardescriptionى一个适用于 HarmonyOS 的开放源代码许可扫描与展示库 —— 该包是 OSSLibraries 的预定义 UI(Wearable)部分。website-https://github.com/composable-tu/osslibrariesdevelopersnamecomposable-tuorganisationUrl https://github.com/composable-tuscmconnectiondeveloperConnectionurl-https://github.com/composable-tu/osslibrariesorganizationfundingtagosslibrarieslicenselicensesopen-sourceosswearablewearlicenses@533c62b51f490ec5ba0118d19bb2caef961c3b630bf4355eb1e360026db6fda2licenses@533c62b51f490ec5ba0118d19bb2caef961c3b630bf4355eb1e360026db6fda2hash@533c62b51f490ec5ba0118d19bb2caef961c3b630bf4355eb1e360026db6fda2name,Mulan Permissive Software License, Version 2url&https://license.coscl.org.cn/MulanPSL2spdxIdMulanPSL-2.0content$! 木兰宽松许可证, 第2版 木兰宽松许可证, 第2版 2020年1月 http://license.coscl.org.cn/MulanPSL2 diff --git a/osslibraries_ui/BuildProfile.ets b/osslibraries_ui/BuildProfile.ets index 2cdec8f..a6fd9a9 100644 --- a/osslibraries_ui/BuildProfile.ets +++ b/osslibraries_ui/BuildProfile.ets @@ -1,7 +1,7 @@ /** * Use these variables when you tailor your ArkTS code. They must be of the const type. */ -export const HAR_VERSION = '0.0.7'; +export const HAR_VERSION = '0.0.8'; export const BUILD_MODE_NAME = 'debug'; export const DEBUG = true; export const TARGET_NAME = 'default'; diff --git a/osslibraries_ui/Index.ets b/osslibraries_ui/Index.ets index 6c222b0..f8dfbdd 100644 --- a/osslibraries_ui/Index.ets +++ b/osslibraries_ui/Index.ets @@ -12,7 +12,7 @@ // OSSLibraries UI — reusable components, pages, and model types export { LicenseItem } from './src/main/ets/components/LicenseItem'; +export { LicenseDetailView } from './src/main/ets/components/LicenseDetailView'; export { buildTitleBarOpts, getMaterialLevel } from './src/main/ets/components/TitleBarBuilder'; export { LicenseDetailParams } from './src/main/ets/model/RouteParams'; -export { OSSLibrariesLicenseListPage } from './src/main/ets/pages/OSSLibrariesLicenseListPage'; -export { OSSLibrariesLicenseDetailPage } from './src/main/ets/pages/OSSLibrariesLicenseDetailPage'; +export { OSSLibrariesLicensePage } from './src/main/ets/pages/OSSLibrariesLicensePage'; diff --git a/osslibraries_ui/README.md b/osslibraries_ui/README.md index 7ee6d26..203bd6f 100644 --- a/osslibraries_ui/README.md +++ b/osslibraries_ui/README.md @@ -66,19 +66,18 @@ export default { 在 `entry` 模块的页面文件顶部(如 `Index.ets`)添加: ```ets -import 'osslibraries_ui/src/main/ets/pages/OSSLibrariesLicenseListPage'; -import 'osslibraries_ui/src/main/ets/pages/OSSLibrariesLicenseDetailPage'; +import 'osslibraries_ui/src/main/ets/pages/OSSLibrariesLicensePage'; ``` `entry` 模块的 `main_pages.json` 无需改动,只需保留自身页面即可。 -### 跳转到许可列表页 +### 跳转到许可页 -在应用的任意页面中,通过 `pushNamedRoute` 跳转到列表页: +在应用的任意页面中,通过 `pushNamedRoute` 跳转到许可页: ```ets this.getUIContext().getRouter().pushNamedRoute({ - name: 'OSSLibrariesLicenseListPage' + name: 'OSSLibrariesLicensePage' }); ``` diff --git a/osslibraries_ui/changelog.md b/osslibraries_ui/changelog.md index 669d827..eb954bb 100644 --- a/osslibraries_ui/changelog.md +++ b/osslibraries_ui/changelog.md @@ -1,5 +1,15 @@ # Changelog +## v0.0.9 + +- 优化:使 `navigateToDetail` 覆盖逻辑更安全 + +## v0.0.8 + +- 适配大屏设备,如平板、折叠屏、智慧屏。 +- 该版本存在 API 变更: + - 列表页与详情页合并为单个自适应容器页 `OSSLibrariesLicensePage`,替换 `OSSLibrariesLicenseListPage` / `OSSLibrariesLicenseDetailPage`。 + ## v0.0.7 - 列表页改用 `osslibraries` 的 `LibsLoader.fromRawfile` 加载数据。 diff --git a/osslibraries_ui/oh-package.json5 b/osslibraries_ui/oh-package.json5 index d41048d..6edaae1 100644 --- a/osslibraries_ui/oh-package.json5 +++ b/osslibraries_ui/oh-package.json5 @@ -1,6 +1,6 @@ { name: "osslibraries_ui", - version: "0.0.7", + version: "0.0.9", description: "适用于 HarmonyOS 的开放源代码许可扫描与展示库 —— 该包是 OSSLibraries 的预定义 UI 部分。", main: "Index.ets", author: { diff --git a/osslibraries_ui/src/main/ets/pages/OSSLibrariesLicenseDetailPage.ets b/osslibraries_ui/src/main/ets/components/LicenseDetailView.ets similarity index 55% rename from osslibraries_ui/src/main/ets/pages/OSSLibrariesLicenseDetailPage.ets rename to osslibraries_ui/src/main/ets/components/LicenseDetailView.ets index 1654b08..0724ac6 100644 --- a/osslibraries_ui/src/main/ets/pages/OSSLibrariesLicenseDetailPage.ets +++ b/osslibraries_ui/src/main/ets/components/LicenseDetailView.ets @@ -11,33 +11,27 @@ */ import { Library, License, Libs, LibsHolder } from 'osslibraries'; -import { LicenseDetailParams } from '../model/RouteParams'; -import { buildTitleBarOpts, getMaterialLevel } from '../components/TitleBarBuilder'; -import { hdsMaterial, HdsNavigation, HdsNavigationTitleMode } from '@kit.UIDesignKit'; import { common } from '@kit.AbilityKit'; import { BusinessError } from '@kit.BasicServicesKit'; import { hilog } from '@kit.PerformanceAnalysisKit'; /** - * 开源许可证详情页 + * 开源许可证详情内容视图。 + * + * 独立于导航容器,供 HdsNavigation 的 navDestination 在手机单栏与大屏分栏下复用。 + * 通过 LibsHolder 读取跨页面共享的数据。 */ -@Entry({ routeName: 'OSSLibrariesLicenseDetailPage' }) @Component -export struct OSSLibrariesLicenseDetailPage { +export struct LicenseDetailView { + @Prop uniqueId: string = ''; @State lib: Library = new Library(); @State notFound: boolean = false; @State scmUrl: string = ''; - @State customMaterialLevel: hdsMaterial.MaterialLevel = hdsMaterial.MaterialLevel.EXQUISITE; @State pressedLinkUrls: Set = new Set(); aboutToAppear(): void { - this.customMaterialLevel = getMaterialLevel(); - const params: Object = this.getUIContext().getRouter().getParams() as Object; - const detail: LicenseDetailParams = params as LicenseDetailParams; - const uniqueId: string = detail?.uniqueId ?? ''; - const libs: Libs | undefined = LibsHolder.get(); - const found: Library | undefined = libs?.findLibrary(uniqueId); + const found: Library | undefined = libs?.findLibrary(this.uniqueId); if (found === undefined) { this.notFound = true; @@ -49,70 +43,59 @@ export struct OSSLibrariesLicenseDetailPage { } build() { - HdsNavigation() { - if (this.notFound) { - Column() { - Text($r('app.string.osslibraries_library_not_found')) - .fontSize(16) - .fontColor($r('sys.color.font_secondary')) + if (this.notFound) { + Column() { + Text($r('app.string.osslibraries_library_not_found')) + .fontSize(16) + .fontColor($r('sys.color.font_secondary')) + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center) + .alignItems(HorizontalAlign.Center) + } else { + List({ space: 0 }) { + // 顶部链接卡片:website + 仓库地址 + if (this.lib.website.length > 0) { + ListItem() { + this.LinkCard(this.lib.website, $r('sys.symbol.link')) + } + .onClick(() => { + this.openUrl(this.lib.website); + }, 5) } - .width('100%') - .height('100%') - .justifyContent(FlexAlign.Center) - .alignItems(HorizontalAlign.Center) - } else { - List({ space: 0 }) { - // 顶部链接卡片:website + 仓库地址 - if (this.lib.website.length > 0) { - ListItem() { - this.LinkCard(this.lib.website, $r('sys.symbol.link')) - } - .onClick(() => { - this.openUrl(this.lib.website); - }, 5) + if (this.scmUrl.length > 0 && this.scmUrl !== this.lib.website) { + ListItem() { + this.LinkCard(this.scmUrl, $r('sys.symbol.link')) } - if (this.scmUrl.length > 0 && this.scmUrl !== this.lib.website) { + .onClick(() => { + this.openUrl(this.scmUrl); + }, 5) + } + + // 许可证全文(仅渲染有正文内容的许可证) + ForEach( + this.lib.licenses.filter((lic: License) => lic.licenseContent && lic.licenseContent.length > 0), + (lic: License) => { ListItem() { - this.LinkCard(this.scmUrl, $r('sys.symbol.link')) + this.LicenseContent(lic) } - .onClick(() => { - this.openUrl(this.scmUrl); - }, 5) - } - - // 许可证全文(仅渲染有正文内容的许可证) - ForEach( - this.lib.licenses.filter((lic: License) => lic.licenseContent && lic.licenseContent.length > 0), - (lic: License) => { - ListItem() { - this.LicenseContent(lic) - } - }, - (lic: License) => lic.hash - ) + }, + (lic: License) => lic.hash + ) - // 底部留白 - ListItem() { - Column().height(24).width('100%') - } + // 底部留白 + ListItem() { + Column().height(24).width('100%') } - .width('100%') - .height('100%') - .padding({ left: 16, right: 16, top: 8 }) - .clip(false) - .cachedCount(4, true) - .edgeEffect(EdgeEffect.Spring) } + .width('100%') + .height('100%') + .padding({ left: 16, right: 16, top: 8 }) + .clip(false) + .cachedCount(4, true) + .edgeEffect(EdgeEffect.Spring) } - .backgroundColor($r('sys.color.background_secondary')) - .titleMode(HdsNavigationTitleMode.MINI) - .titleBar(buildTitleBarOpts( - $r('app.string.osslibraries_title_licenses'), - this.customMaterialLevel, - undefined, - this.lib.name.length > 0 ? this.lib.name : undefined - )) - .hideBackButton(false) } @Builder @@ -182,12 +165,12 @@ export struct OSSLibrariesLicenseDetailPage { action: 'ohos.want.action.viewData', uri: url, }).catch((e: BusinessError) => { - hilog.error(0x0001, 'OSSLibrariesLicenseDetailPage', + hilog.error(0x0001, 'LicenseDetailView', `openUrl startAbility failed: code=${e.code}, message=${e.message}`); }); } catch (e) { const err: BusinessError = e as BusinessError; - hilog.error(0x0001, 'OSSLibrariesLicenseDetailPage', `openUrl failed: code=${err.code}, message=${err.message}`); + hilog.error(0x0001, 'LicenseDetailView', `openUrl failed: code=${err.code}, message=${err.message}`); } } -} +} \ No newline at end of file diff --git a/osslibraries_ui/src/main/ets/constants/RouteNames.ets b/osslibraries_ui/src/main/ets/constants/RouteNames.ets index 95624a3..3391bab 100644 --- a/osslibraries_ui/src/main/ets/constants/RouteNames.ets +++ b/osslibraries_ui/src/main/ets/constants/RouteNames.ets @@ -10,10 +10,10 @@ * See the Mulan PSL v2 for more details. */ -/** 手机端命名路由名常量,集中定义以避免拼写错误。 */ +/** 命名路由名常量,集中定义以避免拼写错误。 */ -/** 列表页路由名。 */ -export const UI_LIST_PAGE_ROUTE: string = 'OSSLibrariesLicenseListPage'; +/** 自适应容器页路由名(承载列表侧边栏 + 详情目标页)。 */ +export const UI_LIST_PAGE_ROUTE: string = 'OSSLibrariesLicensePage'; -/** 详情页路由名(由列表页 push 进入)。 */ +/** 详情目标页路由名(由列表项 pushPathByName 进入,在 navDestination 中渲染)。 */ export const UI_DETAIL_PAGE_ROUTE: string = 'OSSLibrariesLicenseDetailPage'; diff --git a/osslibraries_ui/src/main/ets/pages/OSSLibrariesLicenseListPage.ets b/osslibraries_ui/src/main/ets/pages/OSSLibrariesLicenseListPage.ets deleted file mode 100644 index 0bd2abd..0000000 --- a/osslibraries_ui/src/main/ets/pages/OSSLibrariesLicenseListPage.ets +++ /dev/null @@ -1,117 +0,0 @@ -/** - * Copyright (c) 2026 composable-tu - * OSSLibraries UI is licensed under Mulan PSL v2. - * You can use this software according to the terms and conditions of the Mulan PSL v2. - * You may obtain a copy of Mulan PSL v2 at: - * http://license.coscl.org.cn/MulanPSL2 - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, - * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, - * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v2 for more details. - */ - -import { common } from '@kit.AbilityKit'; -import { BusinessError } from '@kit.BasicServicesKit'; -import { hilog } from '@kit.PerformanceAnalysisKit'; -import { Libs, LibsHolder, LibsLoader, Library } from 'osslibraries'; -import { LicenseItem } from '../components/LicenseItem'; -import { LicenseDetailParams } from '../model/RouteParams'; -import { buildTitleBarOpts, getMaterialLevel } from '../components/TitleBarBuilder'; -import { UI_DETAIL_PAGE_ROUTE } from '../constants/RouteNames'; -import { hdsMaterial, HdsNavigation, HdsNavigationTitleMode } from '@kit.UIDesignKit'; - -/** - * 开源许可证列表页 - * - * 数据通过 core 的 LibsLoader 加载(优先 osslibraries.msgpack,回退 osslibraries.json), - * 通过 LibsHolder 跨页面共享。 - */ -@Entry({ routeName: 'OSSLibrariesLicenseListPage' }) -@Component -export struct OSSLibrariesLicenseListPage { - @State isLoaded: boolean = false; - @State libs: Libs = new Libs(); - @State errorMsg: string = ''; - @State customMaterialLevel: hdsMaterial.MaterialLevel = hdsMaterial.MaterialLevel.EXQUISITE; - - aboutToAppear(): void { - this.customMaterialLevel = getMaterialLevel(); - this.loadData(); - } - - async loadData(): Promise { - try { - const context: common.Context = this.getUIContext().getHostContext() as common.Context; - this.libs = await LibsLoader.fromRawfile(context); - LibsHolder.set(this.libs); - this.isLoaded = true; - } catch (e) { - const err: BusinessError = e as BusinessError; - this.errorMsg = err.message; - this.isLoaded = true; - } - } - - build() { - HdsNavigation() { - if (!this.isLoaded) { - Column() { - LoadingProgress() - .width(40) - .height(40) - Text($r('app.string.osslibraries_loading')) - .fontSize(14) - .fontColor($r('sys.color.font_secondary')) - .margin({ top: 8 }) - } - .width('100%') - .height('100%') - .justifyContent(FlexAlign.Center) - .alignItems(HorizontalAlign.Center) - } else if (this.errorMsg.length > 0) { - Column() { - Text($r('app.string.osslibraries_load_failed', this.errorMsg)) - .fontSize(14) - .fontColor($r('sys.color.ohos_id_color_warning')) - .textAlign(TextAlign.Center) - .padding({ left: 24, right: 24 }) - } - .width('100%') - .height('100%') - .justifyContent(FlexAlign.Center) - .alignItems(HorizontalAlign.Center) - } else { - List({ space: 12 }) { - ForEach(this.libs.libraries, (lib: Library) => { - ListItem() { - LicenseItem({ lib: lib }) - } - .onClick(() => { - if (lib.licenses.length > 0 || lib.website.length > 0) { - this.navigateToDetail(lib.uniqueId); - } - }, 5) - }, (lib: Library) => lib.uniqueId) - } - .width('100%') - .height('100%') - .padding({ left: 16, right: 16, top: 8, bottom: 24 }) - .clip(false) - .cachedCount(4, true) - .edgeEffect(EdgeEffect.Spring) - } - } - .backgroundColor($r('sys.color.background_secondary')) - .titleMode(HdsNavigationTitleMode.MINI) - .titleBar(buildTitleBarOpts($r('app.string.osslibraries_title_licenses'), this.customMaterialLevel)) - .hideBackButton(false) - } - - private navigateToDetail(uniqueId: string): void { - const params: LicenseDetailParams = { uniqueId: uniqueId }; - this.getUIContext().getRouter().pushNamedRoute({ - name: UI_DETAIL_PAGE_ROUTE, - params: params - }); - } -} diff --git a/osslibraries_ui/src/main/ets/pages/OSSLibrariesLicensePage.ets b/osslibraries_ui/src/main/ets/pages/OSSLibrariesLicensePage.ets new file mode 100644 index 0000000..2f273c7 --- /dev/null +++ b/osslibraries_ui/src/main/ets/pages/OSSLibrariesLicensePage.ets @@ -0,0 +1,182 @@ +/** + * Copyright (c) 2026 composable-tu + * OSSLibraries UI is licensed under Mulan PSL v2. + * You can use this software according to the terms and conditions of the Mulan PSL v2. + * You may obtain a copy of Mulan PSL v2 at: + * http://license.coscl.org.cn/MulanPSL2 + * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, + * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, + * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. + * See the Mulan PSL v2 for more details. + */ + +import { common } from '@kit.AbilityKit'; +import { BusinessError } from '@kit.BasicServicesKit'; +import { Libs, LibsHolder, LibsLoader, Library } from 'osslibraries'; +import { LicenseItem } from '../components/LicenseItem'; +import { LicenseDetailView } from '../components/LicenseDetailView'; +import { LicenseDetailParams } from '../model/RouteParams'; +import { buildTitleBarOpts, getMaterialLevel } from '../components/TitleBarBuilder'; +import { UI_DETAIL_PAGE_ROUTE } from '../constants/RouteNames'; +import { hdsMaterial, HdsNavigation, HdsNavigationTitleMode, HdsNavDestination, HdsNavDestinationTitleMode } from '@kit.UIDesignKit'; + +/** + * 开源许可证页(自适应容器)。 + * + * 使用单个 HdsNavigation 承载列表(侧边栏)与详情(navDestination),并保持 Auto 模式: + * - 手机/窄屏(Stack):列表占满全屏,点击项 push 详情覆盖; + * - 大屏(Split):列表常驻左侧侧边栏,详情显示在右侧内容区。 + * + * 数据通过 core 的 LibsLoader 加载(优先 osslibraries.msgpack,回退 osslibraries.json), + * 通过 LibsHolder 跨视图共享。 + */ +@Entry({ routeName: 'OSSLibrariesLicensePage' }) +@Component +export struct OSSLibrariesLicensePage { + @State pathStack: NavPathStack = new NavPathStack(); + @State isLoaded: boolean = false; + @State libs: Libs = new Libs(); + @State errorMsg: string = ''; + @State customMaterialLevel: hdsMaterial.MaterialLevel = hdsMaterial.MaterialLevel.EXQUISITE; + @State navigationMode: NavigationMode = NavigationMode.Auto; + + aboutToAppear(): void { + this.customMaterialLevel = getMaterialLevel(); + this.loadData(); + } + + async loadData(): Promise { + try { + const context: common.Context = this.getUIContext().getHostContext() as common.Context; + this.libs = await LibsLoader.fromRawfile(context); + LibsHolder.set(this.libs); + this.isLoaded = true; + } catch (e) { + const err: BusinessError = e as BusinessError; + this.errorMsg = err.message; + this.isLoaded = true; + } + } + + build() { + HdsNavigation(this.pathStack) { + this.NavBar() + } + .backgroundColor($r('sys.color.background_secondary')) + .mode(NavigationMode.Auto) + .navBarWidth('37.5%') + .titleMode(HdsNavigationTitleMode.MINI) + .titleBar(buildTitleBarOpts($r('app.string.osslibraries_title_licenses'), this.customMaterialLevel)) + .hideBackButton(false) + .navDestination(this.DetailDestination) + .onNavigationModeChange((mode: NavigationMode) => { + this.navigationMode = mode; + }) + } + + @Builder + NavBar() { + if (!this.isLoaded) { + Column() { + LoadingProgress() + .width(40) + .height(40) + Text($r('app.string.osslibraries_loading')) + .fontSize(14) + .fontColor($r('sys.color.font_secondary')) + .margin({ top: 8 }) + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center) + .alignItems(HorizontalAlign.Center) + } else if (this.errorMsg.length > 0) { + Column() { + Text($r('app.string.osslibraries_load_failed', this.errorMsg)) + .fontSize(14) + .fontColor($r('sys.color.ohos_id_color_warning')) + .textAlign(TextAlign.Center) + .padding({ left: 24, right: 24 }) + } + .width('100%') + .height('100%') + .justifyContent(FlexAlign.Center) + .alignItems(HorizontalAlign.Center) + } else { + List({ space: 12 }) { + ForEach(this.libs.libraries, (lib: Library) => { + ListItem() { + LicenseItem({ lib: lib }) + } + .onClick(() => { + if (lib.licenses.length > 0 || lib.website.length > 0) { + this.navigateToDetail(lib.uniqueId); + } + }, 5) + }, (lib: Library) => lib.uniqueId) + } + .width('100%') + .height('100%') + .padding({ left: 16, right: 16, top: 8, bottom: 24 }) + .clip(false) + .cachedCount(4, true) + .edgeEffect(EdgeEffect.Spring) + } + } + + @Builder + DetailDestination(name: string, pageInfos: Object) { + HdsNavDestination() { + LicenseDetailView({ + uniqueId: (pageInfos as LicenseDetailParams).uniqueId + }) + } + .backgroundColor($r('sys.color.background_secondary')) + .titleMode(HdsNavDestinationTitleMode.MINI) + .titleBar(buildTitleBarOpts( + this.navigationMode === NavigationMode.Split + ? this.detailTitleOf((pageInfos as LicenseDetailParams).uniqueId) + : $r('app.string.osslibraries_title_licenses'), + this.customMaterialLevel, + undefined, + this.navigationMode === NavigationMode.Split + ? undefined + : this.libNameOf((pageInfos as LicenseDetailParams).uniqueId) + )) + .hideBackButton(this.navigationMode === NavigationMode.Split) + } + + private navigateToDetail(uniqueId: string): void { + const params: LicenseDetailParams = { uniqueId: uniqueId }; + const detailIndexes: Array = this.pathStack.getIndexByName(UI_DETAIL_PAGE_ROUTE); + const topIndex: number = this.pathStack.size() - 1; + const isDetailOnTop: boolean = detailIndexes.length > 0 && detailIndexes[detailIndexes.length - 1] === topIndex; + if (isDetailOnTop) { + this.pathStack.replacePathByName(UI_DETAIL_PAGE_ROUTE, params); + } else { + this.pathStack.pushPathByName(UI_DETAIL_PAGE_ROUTE, params); + } + } + + /** + * 详情页标题栏主标题:大屏分栏下使用库名,未找到或无名时回退到默认标题。 + */ + private detailTitleOf(uniqueId: string): Resource | string { + const name: string | undefined = this.libNameOf(uniqueId); + if (name !== undefined) { + return name; + } + return $r('app.string.osslibraries_title_licenses'); + } + + /** + * 查询库名称用于详情页标题栏副标题;未找到或无名时返回 undefined。 + */ + private libNameOf(uniqueId: string): string | undefined { + const found: Library | undefined = LibsHolder.get()?.findLibrary(uniqueId); + if (found !== undefined && found.name.length > 0) { + return found.name; + } + return undefined; + } +} \ No newline at end of file diff --git a/osslibraries_ui/src/main/resources/base/profile/main_pages.json b/osslibraries_ui/src/main/resources/base/profile/main_pages.json index 5645cfa..b602b6c 100644 --- a/osslibraries_ui/src/main/resources/base/profile/main_pages.json +++ b/osslibraries_ui/src/main/resources/base/profile/main_pages.json @@ -1,3 +1,3 @@ { - "src": ["pages/OSSLibrariesLicenseListPage", "pages/OSSLibrariesLicenseDetailPage"] -} + "src": ["pages/OSSLibrariesLicensePage"] +} \ No newline at end of file diff --git a/package.json b/package.json index ed3cc8c..44bcc43 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,15 @@ { "type": "module", "devDependencies": { - "@deveco/deveco-cli": "^1.2.2", + "@deveco/deveco-cli": "^1.3.0", "osslibraries-hvigor-plugin": "^0.0.7", - "vite": "catalog:", + "vite": "npm:@voidzero-dev/vite-plus-core@0.2.8", "vite-plus": "catalog:" }, "devEngines": { "packageManager": { "name": "pnpm", - "version": "11.20.0", + "version": "11.22.0", "onFail": "download" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a282cc9..2e68720 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -7,52 +7,52 @@ importers: configDependencies: {} packageManagerDependencies: '@pnpm/exe': - specifier: 11.20.0 - version: 11.20.0 + specifier: 11.22.0 + version: 11.22.0 pnpm: - specifier: 11.20.0 - version: 11.20.0 + specifier: 11.22.0 + version: 11.22.0 packages: - '@pnpm/exe@11.20.0': - resolution: {integrity: sha512-6ZiImENLhgpKifw3CltPmwSMhFLgSeEsNjJQvxFs5uu0mjqH6Rq6f7FDA1J7lBPOerxctUstMu3n+KA2qrWRlA==} + '@pnpm/exe@11.22.0': + resolution: {integrity: sha512-B1SGeKm+v9pX9YkzMmrnO2FbgBd8TDwzZ3jSj6J6ThxdyGvI4TsOfMeHARW4Wb25visPpmMDfIXrU76EZdJM4g==} hasBin: true - '@pnpm/linux-arm64@11.20.0': - resolution: {integrity: sha512-yrly8s9sGVKaHyO1soLP1z12YmOKOM0wNnVsKAEfeOoPsFkuf+3116kb4ysDlY8PZ5xJ9KDv+UXgDNOew7c7RA==} + '@pnpm/linux-arm64@11.22.0': + resolution: {integrity: sha512-xzzn3jYG9QaiFZPaHcWM3yX4Fm9UGz5E42mzpbvUEvXYf5O9fwNolenOhGLpRl2qS5u35fjZSvDZbWlOwHMcug==} cpu: [arm64] os: [linux] - '@pnpm/linux-x64@11.20.0': - resolution: {integrity: sha512-B97xRRGMktHsPzIpEgK1BuCUtO3mwUTMpVW9fV+BoY/giCCoJvgTvZTqyY8gTKSNmiPrp7Twwn5Em0r04k2fAw==} + '@pnpm/linux-x64@11.22.0': + resolution: {integrity: sha512-isvaPctGinbsM2hsTtRsMarN8Sr5QhXDTNmn8Xv9Lp1PjincCvH2RBbhpo+xYIOxzgls1dtQSdgoORUbfRVALQ==} cpu: [x64] os: [linux] - '@pnpm/linuxstatic-arm64@11.20.0': - resolution: {integrity: sha512-pdgQdxExyVLPNedhXH6RFHYCabXzfA4gU21JFWa+aXVSKI49QA817FzfjLed+hlHL+JMH7HQZvooqw3VdvLTzQ==} + '@pnpm/linuxstatic-arm64@11.22.0': + resolution: {integrity: sha512-i4J+AQWW0T3JBdXaLsvxu8ZmMG1HLS6JZQESdOR9uBv8Zumb4yg8GYT83eWRLacr6ngVdhEBiC3W4eOG64MFbA==} cpu: [arm64] os: [linux] libc: [musl] - '@pnpm/linuxstatic-x64@11.20.0': - resolution: {integrity: sha512-n1pyBbXenYQJFi8nQ5Z0h4eUd9CTzbVFfnhODqYl27xqRxu8yODx5NzpCBfCczczcedCUU9NPq9McH0KtK7gyA==} + '@pnpm/linuxstatic-x64@11.22.0': + resolution: {integrity: sha512-QYzk8jhSuSbVthW/OxEOhU3f3zhjpw4HqgedrlwbVNb7btCWn5del2Hb5PsYYka2PbmKq5EtF5IzYN8Yp1CfxQ==} cpu: [x64] os: [linux] libc: [musl] - '@pnpm/macos-arm64@11.20.0': - resolution: {integrity: sha512-tGuwiSQWvNxKEnABtAWWLhoL3ACE6DKZstYRNjMIFouNZqHy8PsQGFnBMoKiSqtGEx7EQ7sLa+bpJsb7y6bXoA==} + '@pnpm/macos-arm64@11.22.0': + resolution: {integrity: sha512-Io8Axk5kutPgMuAfOg1QGj3J0/KpLvH5iiPcmp7up8D4q7BNWT02ndQo3RyGWqrlkf5nwspM41GFpWTShrZ4Aw==} cpu: [arm64] os: [darwin] - '@pnpm/win-arm64@11.20.0': - resolution: {integrity: sha512-F4GacJqJaRDxgkpUsfefRcMC6jgrjYUnhDc/mfPPUvWUe3ioLm5LSdjyvtTbbIs8d/nojMQyV9H1PS1w7pFshg==} + '@pnpm/win-arm64@11.22.0': + resolution: {integrity: sha512-QgaRuKGQKov7xW2utPCgDT83fn/PU5cD6HFgib48oTslz7wv26E89d4jMCxL4GRmEL2YCfkYuj5ITj1oVWg5WQ==} cpu: [arm64] os: [win32] - '@pnpm/win-x64@11.20.0': - resolution: {integrity: sha512-0Db1+7D7TtvYT0ecBRhkaD8YSMcVyiArOtWqvm0UrIu8l7wWx9FgP/8NKbpg9qKHi00UxsLd03AVPl9hx2BzSw==} + '@pnpm/win-x64@11.22.0': + resolution: {integrity: sha512-iWYsiSwpgxqur+TwsnSoPdOQaEfd4ygB84mb5tJUOgim6PHr1xhKJBndaQzH+At/WkLxLdYN+K8dYc4M7naezg==} cpu: [x64] os: [win32] @@ -116,45 +116,45 @@ packages: resolution: {integrity: sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==} engines: {node: '>=8'} - pnpm@11.20.0: - resolution: {integrity: sha512-mm8zCpW2ZEbqCI+vFSFAWooB8H/ecSTMmVjf7VLUu0NnN+ZbCPhfN7Rvy6N1CSVYrFEmK4FoRLIvY0Bu0Wa/7g==} + pnpm@11.22.0: + resolution: {integrity: sha512-H/hwxMYTPf2I+yr8Rt0T1H8JyXlLQ4xv20fKmMrzvBY4HuC+k6CRuOOCTPAfiJ9G19niCRD7C+GrD7W6qA3WIQ==} engines: {node: '>=22.13'} hasBin: true snapshots: - '@pnpm/exe@11.20.0': + '@pnpm/exe@11.22.0': dependencies: '@reflink/reflink': 0.1.19 detect-libc: 2.1.2 optionalDependencies: - '@pnpm/linux-arm64': 11.20.0 - '@pnpm/linux-x64': 11.20.0 - '@pnpm/linuxstatic-arm64': 11.20.0 - '@pnpm/linuxstatic-x64': 11.20.0 - '@pnpm/macos-arm64': 11.20.0 - '@pnpm/win-arm64': 11.20.0 - '@pnpm/win-x64': 11.20.0 - - '@pnpm/linux-arm64@11.20.0': + '@pnpm/linux-arm64': 11.22.0 + '@pnpm/linux-x64': 11.22.0 + '@pnpm/linuxstatic-arm64': 11.22.0 + '@pnpm/linuxstatic-x64': 11.22.0 + '@pnpm/macos-arm64': 11.22.0 + '@pnpm/win-arm64': 11.22.0 + '@pnpm/win-x64': 11.22.0 + + '@pnpm/linux-arm64@11.22.0': optional: true - '@pnpm/linux-x64@11.20.0': + '@pnpm/linux-x64@11.22.0': optional: true - '@pnpm/linuxstatic-arm64@11.20.0': + '@pnpm/linuxstatic-arm64@11.22.0': optional: true - '@pnpm/linuxstatic-x64@11.20.0': + '@pnpm/linuxstatic-x64@11.22.0': optional: true - '@pnpm/macos-arm64@11.20.0': + '@pnpm/macos-arm64@11.22.0': optional: true - '@pnpm/win-arm64@11.20.0': + '@pnpm/win-arm64@11.22.0': optional: true - '@pnpm/win-x64@11.20.0': + '@pnpm/win-x64@11.22.0': optional: true '@reflink/reflink-darwin-arm64@0.1.19': @@ -194,7 +194,7 @@ snapshots: detect-libc@2.1.2: {} - pnpm@11.20.0: {} + pnpm@11.22.0: {} --- lockfileVersion: '9.0' @@ -217,8 +217,8 @@ importers: .: devDependencies: '@deveco/deveco-cli': - specifier: ^1.2.2 - version: 1.2.2(debug@4.4.3) + specifier: ^1.3.0 + version: 1.3.0(debug@4.4.3) osslibraries-hvigor-plugin: specifier: ^0.0.7 version: 0.0.7 @@ -246,13 +246,13 @@ packages: '@blazediff/core@1.9.1': resolution: {integrity: sha512-ehg3jIkYKulZh+8om/O25vkvSsXXwC+skXmyA87FFx6A/45eqOkZsBltMw/TVteb0mloiGT8oGRTcjRAz66zaA==} - '@deveco/deveco-cli@1.2.2': - resolution: {integrity: sha512-pO971UQPniuwxA+EJBHzDPKQ9ABn+X5/R0mkB60QqgPYk2UEUjmQH/eHRaeicrP5F4YDIWAmxRt9uPOlcJMKSQ==} - engines: {node: '>=18'} + '@deveco/deveco-cli@1.3.0': + resolution: {integrity: sha512-eiVa8xDQTRQjrn4XdqpiDsI3yTVeKRpALmMv3o08i+nLuXdLhHakRsaNBlzHxIQ5eM/h9IuASGiGOBcP7doexA==} + engines: {node: '>=22'} hasBin: true - '@hono/node-server@2.1.0': - resolution: {integrity: sha512-XovyyCCnBzW+zKu+z/zq8hwNs4KOR5rEMAOxo2f40Q5xoOI37IMm6MIg2COOUtUApo0i6850MTBKH2u4QLGIqg==} + '@hono/node-server@2.1.1': + resolution: {integrity: sha512-ELuehkj5VCBdgEw9zs+ivkKwyzzUCSQuE96YmiPvn1ECBoZCczbFXJLeEGMTYjphP6gydh4pHMqEYPVMYUVgQg==} engines: {node: '>=20'} peerDependencies: hono: ^4 @@ -595,8 +595,8 @@ packages: resolution: {integrity: sha512-o4PXJQidqJl82ckFaXUeoAW+XysPLauYI43Abki5hABd853iMhitooc6znOnczgbTYmEP6U6/y1ZyKAIsvMKGg==} engines: {node: '>=18'} - '@testing-library/user-event@14.6.3': - resolution: {integrity: sha512-6dBq67jT8lE+JTE8Exm02Kt6ze43hz1jdiSpSJwtTZiT1xQQ6b7nZYTTQ9njdArdU8XklOwaDp/AbT/eYSKF4g==} + '@testing-library/user-event@14.6.4': + resolution: {integrity: sha512-QCGwP6QrjypBLwyj5cuyfVamkaIEy/XGY+1VDehbtbQqOggYmTFpFOdWR5mPz14vX8vXLMVjDHlRNBcClyO9ew==} engines: {node: '>=12', npm: '>=6'} peerDependencies: '@testing-library/dom': '>=7.21.4' @@ -925,8 +925,8 @@ packages: resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} engines: {node: '>=8'} - ansi-regex@6.2.2: - resolution: {integrity: sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==} + ansi-regex@6.3.0: + resolution: {integrity: sha512-WpDfL7NO6j7tH88IDBNVdUJxDh9nmCteAVW9dsep846XdwF4naCBK+/tGLX3KJgcpgMRXCFlTM2hKGoK9FsdrQ==} engines: {node: '>=12'} ansi-styles@5.2.0: @@ -1010,8 +1010,8 @@ packages: resolution: {integrity: sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==} engines: {node: '>= 0.6'} - content-type@2.0.0: - resolution: {integrity: sha512-j/O/d7GcZCyNl7/hwZAb606rzqkyvaDctLmckbxLzHvFBzTJHuGEdodATcP3yIRoDrLHkIATJuvzbFlp/ki2cQ==} + content-type@2.1.0: + resolution: {integrity: sha512-mj7UPXE0jaqaOsukNZRUEfEi2AcL7C/vwmwcHV0O97eO1E1pxBZuyjlZrx5seTaNBg1U6+o35wpa35Qfcc+7ag==} engines: {node: '>=18'} convert-source-map@2.0.0: @@ -1133,8 +1133,8 @@ packages: resolution: {integrity: sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==} engines: {node: '>= 0.6'} - eventsource-parser@3.1.0: - resolution: {integrity: sha512-kJezFj9YFAMLeORyi7aCLxLbD5/qWMQnoMVlVPyHIll7lgRJCc3JVln9Vgl9nwQi0YkMnhdGTMNn7CkRRAptMg==} + eventsource-parser@3.1.1: + resolution: {integrity: sha512-EKN1vKAMcZ8MlYMpaNuxN6R9yakzH6uajHcHVTqWJzvu5pWw9DyhbP35HH8MVBQ+dZjAfDxk+A8NiR9KWaXiyQ==} engines: {node: '>=18.0.0'} eventsource@3.0.7: @@ -1279,8 +1279,8 @@ packages: resolution: {integrity: sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A==} engines: {node: '>= 0.4'} - hono@4.13.0: - resolution: {integrity: sha512-jhunvfHWxd7J5EFfSgH4xsYJzSe/lfqbUCxiyyeaQasUsXeEHXtzVid+7EOGByc5JnFa23SSFL3Y2RV/z1T+eQ==} + hono@4.13.2: + resolution: {integrity: sha512-JydRilDRkYBQMt9qR9U92mXxmbGqsqSn/IKOrh4e7/gEbn+0zSr8igTu0obwJoNGN4sez28DIql7FBHWydoJpA==} engines: {node: '>=16.9.0'} http-errors@2.0.1: @@ -1305,8 +1305,8 @@ packages: inherits@2.0.4: resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} - ip-address@10.4.0: - resolution: {integrity: sha512-oSK96Grm3aP6OrS263xVxbNDGVL7rzBtYdpGqlDG8iQdoenDoTs/nkki+DflYbAEE8Xl6o5YxhxlrKvI3nqKXQ==} + ip-address@10.5.0: + resolution: {integrity: sha512-R5SnVLJmgYYvf2F2ZgwSBnelz5G4q5AxIC277GDfUaNbrZKNANcBC7RHqYYePlszf4kBolVkJauG0ZjHHFh55g==} engines: {node: '>= 12'} ipaddr.js@1.9.1: @@ -1353,8 +1353,8 @@ packages: jieba-wasm@2.4.0: resolution: {integrity: sha512-ZvQdS+FGifrFXZIXSgOyOgEz+1wdy1P4vSvwe37FVtku9ycSdHTZbHqF5i9tMN1JucoAmeiLBeI6/YaqcGD+KA==} - jose@6.2.8: - resolution: {integrity: sha512-Bsdjwm3Qsd/P0jR+BHDe3LytDfY7WBq2HmCCLIwuVRHMuEC9ae7/R474GIUdF1NgCyZjzVo/A9DOiOBtXq8ZoQ==} + jose@6.2.9: + resolution: {integrity: sha512-XrchZOFZUl/T3vTwRe8XK+cJrGtMF4th1ARnDfwbBXFKThGhlsxEE4Zu03AD/bjJSt/9jT/mxrOCkJWOg77aPA==} js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} @@ -1632,8 +1632,8 @@ packages: ms@2.1.3: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - nanoid@3.3.17: - resolution: {integrity: sha512-xQLf0A3HOMlgHq0n247/LRuAOYmB7dXJ/DvAxGvsSBij45XtBSmQycu+F8ODbHwns/XyFZagyL1+J0Offw1E0g==} + nanoid@3.3.18: + resolution: {integrity: sha512-DTg4MJbGMWkfi6VZFdNt2/caMbQy4Ou+Op/hJQvGEWcnVfoA1QA+xzRKAzw9jD6+GVOOeYr/mIcuDSdug6F6+w==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true @@ -1901,8 +1901,8 @@ packages: resolution: {integrity: sha512-2wcC/oGxHis/BoHkkPwldgiPSYcpZK3JU28WoMVv55yHJgcZ8rlXvuG9iZggz+sU1d4bRgIGASwyWqjxu3FM0g==} engines: {node: '>=18'} - smol-toml@1.7.1: - resolution: {integrity: sha512-PPlsspAZ4jbMBu5DMFhfUGDQLu/vrL4SyBROVS37x8ynnVmFIs1VPBz1Co8Xks3TvpIaZXmU85y4DrQ+UyVFoQ==} + smol-toml@1.8.0: + resolution: {integrity: sha512-kCZr2V3ch9i00x8zXRhjUNVcjG9ijES5dDudkXvUVCT5QlJNQWElSJdZqyPemffHoLNUYwOcou0Fy+ojN0uHSQ==} engines: {node: '>= 18'} socket.io-client@4.8.3: @@ -2117,8 +2117,8 @@ packages: wrappy@1.0.2: resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} - ws@8.21.2: - resolution: {integrity: sha512-54dMVAo4WIe6SKy3vBgN+9bJZqqQ8IMRevAkOLQALhi49qkkQDQfWdAZ8KQlXiEabw88ARXXdUrlvtbKQX+aKw==} + ws@8.21.3: + resolution: {integrity: sha512-201TZ/kPWxoPr/OKWjquZR1SWKXcvxdH+e1xrx89b3YbmzLMFCLfnaG1HFIgWzJOEWZ7MvpK++odZufgYR50Rw==} engines: {node: '>=10.0.0'} peerDependencies: bufferutil: ^4.0.1 @@ -2180,7 +2180,7 @@ snapshots: '@blazediff/core@1.9.1': {} - '@deveco/deveco-cli@1.2.2(debug@4.4.3)': + '@deveco/deveco-cli@1.3.0(debug@4.4.3)': dependencies: '@modelcontextprotocol/sdk': 1.30.0(zod@4.4.3) '@sqlite.org/sqlite-wasm': 3.49.1-build4 @@ -2202,7 +2202,7 @@ snapshots: remark-gfm: 4.0.1 remark-parse: 11.0.0 semver: 7.8.5 - smol-toml: 1.7.1 + smol-toml: 1.8.0 socket.io-client: 4.8.3 unified: 11.0.5 yauzl: 3.4.0 @@ -2214,26 +2214,26 @@ snapshots: - supports-color - utf-8-validate - '@hono/node-server@2.1.0(hono@4.13.0)': + '@hono/node-server@2.1.1(hono@4.13.2)': dependencies: - hono: 4.13.0 + hono: 4.13.2 '@jridgewell/sourcemap-codec@1.5.5': {} '@modelcontextprotocol/sdk@1.30.0(zod@4.4.3)': dependencies: - '@hono/node-server': 2.1.0(hono@4.13.0) + '@hono/node-server': 2.1.1(hono@4.13.2) ajv: 8.20.0 ajv-formats: 3.0.1(ajv@8.20.0) content-type: 1.0.5 cors: 2.8.6 cross-spawn: 7.0.6 eventsource: 3.0.7 - eventsource-parser: 3.1.0 + eventsource-parser: 3.1.1 express: 5.2.1 express-rate-limit: 8.6.2(express@5.2.1) - hono: 4.13.0 - jose: 6.2.8 + hono: 4.13.2 + jose: 6.2.9 json-schema-typed: 8.0.2 pkce-challenge: 5.0.1 raw-body: 3.0.2 @@ -2417,7 +2417,7 @@ snapshots: picocolors: 1.1.1 pretty-format: 27.5.1 - '@testing-library/user-event@14.6.3(@testing-library/dom@10.4.1)': + '@testing-library/user-event@14.6.4(@testing-library/dom@10.4.1)': dependencies: '@testing-library/dom': 10.4.1 @@ -2447,7 +2447,7 @@ snapshots: '@vitest/browser-preview@4.1.10(@voidzero-dev/vite-plus-core@0.2.8)(vitest@4.1.10)': dependencies: '@testing-library/dom': 10.4.1 - '@testing-library/user-event': 14.6.3(@testing-library/dom@10.4.1) + '@testing-library/user-event': 14.6.4(@testing-library/dom@10.4.1) '@vitest/browser': 4.1.10(@voidzero-dev/vite-plus-core@0.2.8)(vitest@4.1.10) vitest: 4.1.10(@vitest/browser-preview@4.1.10)(@voidzero-dev/vite-plus-core@0.2.8) transitivePeerDependencies: @@ -2466,7 +2466,7 @@ snapshots: sirv: 3.0.2 tinyrainbow: 3.1.1 vitest: 4.1.10(@vitest/browser-preview@4.1.10)(@voidzero-dev/vite-plus-core@0.2.8) - ws: 8.21.2 + ws: 8.21.3 transitivePeerDependencies: - bufferutil - msw @@ -2651,7 +2651,7 @@ snapshots: ansi-regex@5.0.1: {} - ansi-regex@6.2.2: {} + ansi-regex@6.3.0: {} ansi-styles@5.2.0: {} @@ -2678,7 +2678,7 @@ snapshots: body-parser@2.3.0: dependencies: bytes: 3.1.2 - content-type: 2.0.0 + content-type: 2.1.0 debug: 4.4.3 http-errors: 2.0.1 iconv-lite: 0.7.3 @@ -2731,7 +2731,7 @@ snapshots: content-type@1.0.5: {} - content-type@2.0.0: {} + content-type@2.1.0: {} convert-source-map@2.0.0: {} @@ -2801,7 +2801,7 @@ snapshots: '@socket.io/component-emitter': 3.1.2 debug: 4.4.3 engine.io-parser: 5.2.3 - ws: 8.21.2 + ws: 8.21.3 xmlhttprequest-ssl: 2.1.2 transitivePeerDependencies: - bufferutil @@ -2839,11 +2839,11 @@ snapshots: etag@1.8.1: {} - eventsource-parser@3.1.0: {} + eventsource-parser@3.1.1: {} eventsource@3.0.7: dependencies: - eventsource-parser: 3.1.0 + eventsource-parser: 3.1.1 execa@9.6.1: dependencies: @@ -2866,7 +2866,7 @@ snapshots: dependencies: debug: 4.4.3 express: 5.2.1 - ip-address: 10.4.0 + ip-address: 10.5.0 transitivePeerDependencies: - supports-color @@ -3030,7 +3030,7 @@ snapshots: dependencies: function-bind: 1.1.2 - hono@4.13.0: {} + hono@4.13.2: {} http-errors@2.0.1: dependencies: @@ -3057,7 +3057,7 @@ snapshots: inherits@2.0.4: {} - ip-address@10.4.0: {} + ip-address@10.5.0: {} ipaddr.js@1.9.1: {} @@ -3085,7 +3085,7 @@ snapshots: jieba-wasm@2.4.0: {} - jose@6.2.8: {} + jose@6.2.9: {} js-tokens@4.0.0: {} @@ -3493,7 +3493,7 @@ snapshots: ms@2.1.3: {} - nanoid@3.3.17: {} + nanoid@3.3.18: {} negotiator@1.0.0: {} @@ -3633,7 +3633,7 @@ snapshots: postcss@8.5.26: dependencies: - nanoid: 3.3.17 + nanoid: 3.3.18 picocolors: 1.1.1 source-map-js: 1.2.1 @@ -3826,7 +3826,7 @@ snapshots: mrmime: 2.0.1 totalist: 3.0.1 - smol-toml@1.7.1: {} + smol-toml@1.8.0: {} socket.io-client@4.8.3: dependencies: @@ -3888,7 +3888,7 @@ snapshots: strip-ansi@7.2.0: dependencies: - ansi-regex: 6.2.2 + ansi-regex: 6.3.0 strip-final-newline@4.0.0: {} @@ -3924,7 +3924,7 @@ snapshots: type-is@2.1.0: dependencies: - content-type: 2.0.0 + content-type: 2.1.0 media-typer: 1.1.1 mime-types: 3.0.2 @@ -4071,7 +4071,7 @@ snapshots: wrappy@1.0.2: {} - ws@8.21.2: {} + ws@8.21.3: {} xmlhttprequest-ssl@2.1.2: {} diff --git a/skills/osslibraries-usage/SKILL.md b/skills/osslibraries-usage/SKILL.md index 1d71c45..b09f341 100644 --- a/skills/osslibraries-usage/SKILL.md +++ b/skills/osslibraries-usage/SKILL.md @@ -9,7 +9,7 @@ license: "MulanPSL-2.0" OSSLibraries is an open-source license scanning and display library for HarmonyOS, distributed as OHPM packages: - **`osslibraries`** (core): data models, data loader, JSON / MessagePack parser, and cross-page holder. Used for custom UI. -- **`osslibraries_ui`**: predefined list page, detail page, and `LicenseItem` component for phone/tablet. Ready out of the box. +- **`osslibraries_ui`**: a predefined adaptive license page (list + detail) and the `LicenseItem` component for phone/tablet. Ready out of the box. - **`osslibraries_ui_wear`**: predefined list page, detail page, and `WearLicenseListItem` component for wearable devices. Adapts to screen shape via `display.screenShape`: round faces use ArkUI `ArcList` (digital-crown scroll, chain animation), square faces fall back to a regular `List`. License data is generated at compile time by a standalone Hvigor plugin **`osslibraries-hvigor-plugin`** (npm package) that scans `oh_modules/` and produces `entry/src/main/resources/rawfile/osslibraries.json`. The core package's `LibsLoader` prefers `osslibraries.msgpack` (MessagePack binary) when present and falls back to `osslibraries.json`. @@ -82,28 +82,27 @@ On each build, the plugin scans `oh_modules/` and generates `entry/src/main/reso plugins: [ossScanPlugin({ selfModules: ["mylibrary", "3rdlibrary"] })]; ``` -### 3. Import the HAR pages (register named routes) +### 3. Import the HAR page (register the named route) At the top of a page file in the `entry` module (e.g. `Index.ets`): ```ets -import 'osslibraries_ui/src/main/ets/pages/OSSLibrariesLicenseListPage'; -import 'osslibraries_ui/src/main/ets/pages/OSSLibrariesLicenseDetailPage'; +import 'osslibraries_ui/src/main/ets/pages/OSSLibrariesLicensePage'; ``` `entry/src/main/resources/base/profile/main_pages.json` **does not need changes** — keep only its own pages. -### 4. Navigate to the license list page +### 4. Navigate to the license page From any page: ```ets this.getUIContext().getRouter().pushNamedRoute({ - name: 'OSSLibrariesLicenseListPage' + name: 'OSSLibrariesLicensePage' }); ``` -The list page already implements: load JSON → `LibsHolder.set(libs)` → tap an item to navigate to the detail page. +The license page already implements: load JSON → `LibsHolder.set(libs)` → tap an item to show the detail. ## Path B: Custom UI @@ -259,14 +258,14 @@ this.getUIContext().getRouter().pushNamedRoute({ | Name | Description | | ------------------------------- | ------------------------------------------------------------ | -| `OSSLibrariesLicenseListPage` | List page (named route name is the same) | -| `OSSLibrariesLicenseDetailPage` | Detail page (named route name is the same) | +| `OSSLibrariesLicensePage` | Adaptive license page (named route name is the same) | +| `LicenseDetailView` | Detail content component for a single library | | `LicenseItem` | Single library card component | | `buildTitleBarOpts` | HdsNavigation title bar options builder | | `getMaterialLevel` | Material level probe | -| `LicenseDetailParams` | Detail page route params interface, field `uniqueId: string` | +| `LicenseDetailParams` | Detail route params interface, field `uniqueId: string` | -Route names are centralized in `RouteNames.ets` (`UI_LIST_PAGE_ROUTE` / `UI_DETAIL_PAGE_ROUTE`); host apps should import and reuse these constants instead of string literals. +Route names are centralized in `RouteNames.ets`. `UI_LIST_PAGE_ROUTE` is the router-registered entry (`OSSLibrariesLicensePage`) that host apps push via `pushNamedRoute`. `UI_DETAIL_PAGE_ROUTE` is the internal `NavPathStack` destination name used by the page's `navDestination` to render the detail view — it is **not** a router-registered page and host apps generally do not push it directly. ### ui_wear (`osslibraries_ui_wear`) exports @@ -324,8 +323,8 @@ The predefined list pages load data via `LibsLoader.fromRawfile(context)`, which ### Named route navigation fails with "route does not exist" -- A loaded page file must `import 'osslibraries_ui/src/main/ets/pages/OSSLibrariesLicenseListPage'` at its top — importing registers the named route. -- Do not add these two pages to `main_pages.json`. +- A loaded page file must `import 'osslibraries_ui/src/main/ets/pages/OSSLibrariesLicensePage'` at its top — importing registers the named route. +- Do not add this page to `main_pages.json`. ### Self-owned modules appear in the license list