From 0118dd25318149b32cd305ff6039b04f894de7b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A1=8C=E8=A2=82=E9=96=8B=E8=B7=A4?= <208613607+composable-tu@users.noreply.github.com> Date: Sun, 16 Aug 2026 18:02:06 +0800 Subject: [PATCH 1/6] =?UTF-8?q?refactor(osslibraries=5Fui):=20=E5=90=88?= =?UTF-8?q?=E5=B9=B6=E8=AE=B8=E5=8F=AF=E8=AF=81=E5=88=97=E8=A1=A8=E5=92=8C?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E9=A1=B5=E9=9D=A2=E4=B8=BA=E8=87=AA=E9=80=82?= =?UTF-8?q?=E5=BA=94=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除独立的 OSSLibrariesLicenseListPage å’Œ OSSLibrariesLicenseDetailPage 页é�¢ - 新增 OSSLibrariesLicensePage 自适应页é�¢ï¼Œæ”¯æŒ�手机和大å±�设备 - 新增 LicenseDetailView 组件用于详情内容展示 - 更新路由é…�置和页é�¢å¯¼å…¥è·¯å¾„ - 修改 README 文档中的页é�¢å¼•用说明 - 添加对平æ�¿å’Œç”µè§†è®¾å¤‡çš„æ”¯æŒ� - é‡�构导航逻辑,使用 NavDestination 实现分æ �布局 --- README.md | 11 +- README_zh.md | 11 +- entry/src/main/ets/pages/Index.ets | 3 +- entry/src/main/module.json5 | 2 +- osslibraries_ui/Index.ets | 4 +- osslibraries_ui/README.md | 9 +- .../LicenseDetailView.ets} | 127 ++++++-------- .../src/main/ets/constants/RouteNames.ets | 8 +- .../ets/pages/OSSLibrariesLicenseListPage.ets | 117 ------------- .../ets/pages/OSSLibrariesLicensePage.ets | 159 ++++++++++++++++++ .../resources/base/profile/main_pages.json | 4 +- skills/osslibraries-usage/SKILL.md | 23 ++- 12 files changed, 249 insertions(+), 229 deletions(-) rename osslibraries_ui/src/main/ets/{pages/OSSLibrariesLicenseDetailPage.ets => components/LicenseDetailView.ets} (55%) delete mode 100644 osslibraries_ui/src/main/ets/pages/OSSLibrariesLicenseListPage.ets create mode 100644 osslibraries_ui/src/main/ets/pages/OSSLibrariesLicensePage.ets 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/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/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/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..1ed6fac --- /dev/null +++ b/osslibraries_ui/src/main/ets/pages/OSSLibrariesLicensePage.ets @@ -0,0 +1,159 @@ +/** + * 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; + + 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) + .titleMode(HdsNavigationTitleMode.MINI) + .titleBar(buildTitleBarOpts($r('app.string.osslibraries_title_licenses'), this.customMaterialLevel)) + .hideBackButton(false) + .navDestination(this.DetailDestination) + } + + @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( + $r('app.string.osslibraries_title_licenses'), + this.customMaterialLevel, + undefined, + this.libNameOf((pageInfos as LicenseDetailParams).uniqueId) + )) + .hideBackButton(false) + } + + private navigateToDetail(uniqueId: string): void { + const params: LicenseDetailParams = { uniqueId: uniqueId }; + if (this.pathStack.size() > 0) { + this.pathStack.replacePathByName(UI_DETAIL_PAGE_ROUTE, params); + } else { + this.pathStack.pushPathByName(UI_DETAIL_PAGE_ROUTE, params); + } + } + + /** + * 查询库å��称用于详情页标题æ �副标题;未找到或无å��时返回 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/skills/osslibraries-usage/SKILL.md b/skills/osslibraries-usage/SKILL.md index 1d71c45..0ef37a9 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,12 +258,12 @@ 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. @@ -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 From e6ed5cc9ce45072b68353de9a1c5b8b96117f655 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A1=8C=E8=A2=82=E9=96=8B=E8=B7=A4?= <208613607+composable-tu@users.noreply.github.com> Date: Sun, 16 Aug 2026 18:12:51 +0800 Subject: [PATCH 2/6] =?UTF-8?q?feat(osslibraries):=20=E9=80=82=E9=85=8D?= =?UTF-8?q?=E5=88=86=E6=A0=8F=E6=A8=A1=E5=BC=8F=E4=B8=8B=E7=9A=84=E5=AF=BC?= =?UTF-8?q?=E8=88=AA=E6=A0=8F=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加 navigationMode 状æ€�管ç�†åˆ†æ �模å¼� - 设置导航æ �宽度为 37.5% 以适é…�分æ �布局 - 监å�¬å¯¼èˆªæ¨¡å¼�å�˜åŒ–并更新界é�¢çжæ€� - æ ¹æ�®åˆ†æ �模å¼�动æ€�调整详情页标题æ �显示逻辑 - 在分æ �模å¼�下éš�è—�返回按钮并使用库å��作为主标题 - 添加 detailTitleOf 方法处ç�†åˆ†æ �模å¼�下的标题显示 --- .../ets/pages/OSSLibrariesLicensePage.ets | 26 ++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/osslibraries_ui/src/main/ets/pages/OSSLibrariesLicensePage.ets b/osslibraries_ui/src/main/ets/pages/OSSLibrariesLicensePage.ets index 1ed6fac..867f566 100644 --- a/osslibraries_ui/src/main/ets/pages/OSSLibrariesLicensePage.ets +++ b/osslibraries_ui/src/main/ets/pages/OSSLibrariesLicensePage.ets @@ -38,6 +38,7 @@ export struct OSSLibrariesLicensePage { @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(); @@ -63,10 +64,14 @@ export struct OSSLibrariesLicensePage { } .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 @@ -129,12 +134,16 @@ export struct OSSLibrariesLicensePage { .backgroundColor($r('sys.color.background_secondary')) .titleMode(HdsNavDestinationTitleMode.MINI) .titleBar(buildTitleBarOpts( - $r('app.string.osslibraries_title_licenses'), + this.navigationMode === NavigationMode.Split + ? this.detailTitleOf((pageInfos as LicenseDetailParams).uniqueId) + : $r('app.string.osslibraries_title_licenses'), this.customMaterialLevel, undefined, - this.libNameOf((pageInfos as LicenseDetailParams).uniqueId) + this.navigationMode === NavigationMode.Split + ? undefined + : this.libNameOf((pageInfos as LicenseDetailParams).uniqueId) )) - .hideBackButton(false) + .hideBackButton(this.navigationMode === NavigationMode.Split) } private navigateToDetail(uniqueId: string): void { @@ -146,6 +155,17 @@ export struct OSSLibrariesLicensePage { } } + /** + * 详情页标题æ �主标题:大å±�分æ �下使用库å��,未找到或无å��时回退到默认标题。 + */ + 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。 */ From 49b257c7b0157f3dace9bbbbc8f6118dae592e57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A1=8C=E8=A2=82=E9=96=8B=E8=B7=A4?= <208613607+composable-tu@users.noreply.github.com> Date: Sun, 16 Aug 2026 18:16:34 +0800 Subject: [PATCH 3/6] =?UTF-8?q?refactor(ui):=20=E9=80=82=E9=85=8D=E5=A4=A7?= =?UTF-8?q?=E5=B1=8F=E8=AE=BE=E5=A4=87=E5=B9=B6=E5=8D=87=E7=BA=A7=E4=BE=9D?= =?UTF-8?q?=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 适é…�大å±�设备,如平æ�¿ã€�折å� å±�ã€�智慧å±� - 列表页与详情页å�ˆå¹¶ä¸ºå�•个自适应容器页 OSSLibrariesLicensePage - 替æ�¢ OSSLibrariesLicenseListPage / OSSLibrariesLicenseDetailPage - å�‡çº§ deveco-cli 从 1.2.2 到 1.3.0 - å�‡çº§ vite 为 @voidzero-dev/vite-plus-core@0.2.8 - å�‡çº§ pnpm 版本从 11.20.0 到 11.22.0 - 更新多个ä¾�赖包版本包括 honoã€�content-typeã€�ws ç­‰ --- osslibraries_ui/changelog.md | 6 + osslibraries_ui/oh-package.json5 | 2 +- package.json | 6 +- pnpm-lock.yaml | 186 +++++++++++++++---------------- 4 files changed, 103 insertions(+), 97 deletions(-) diff --git a/osslibraries_ui/changelog.md b/osslibraries_ui/changelog.md index 669d827..f497f17 100644 --- a/osslibraries_ui/changelog.md +++ b/osslibraries_ui/changelog.md @@ -1,5 +1,11 @@ # Changelog +## 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..0cff5c9 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.8", description: "适用于 HarmonyOS 的开放æº�代ç �许å�¯æ‰«æ��与展示库 —— 该包是 OSSLibraries 的预定义 UI 部分。", main: "Index.ets", author: { 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: {} From d4e2d3037a93561024a2996b0d51783456705242 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A1=8C=E8=A2=82=E9=96=8B=E8=B7=A4?= <208613607+composable-tu@users.noreply.github.com> Date: Sun, 16 Aug 2026 18:18:34 +0800 Subject: [PATCH 4/6] =?UTF-8?q?chore(version):=20=E6=9B=B4=E6=96=B0=20ossl?= =?UTF-8?q?ibraries=5Fui=20=E7=89=88=E6=9C=AC=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - å°† HAR_VERSION 从 0.0.7 更新到 0.0.8 - æ›´æ–° entry 中ä¾�èµ–çš„ osslibraries_ui 版本å�· --- entry/oh-package-lock.json5 | 2 +- entry/src/main/resources/rawfile/osslibraries.msgpack | 2 +- entry_wear/src/main/resources/rawfile/osslibraries.msgpack | 2 +- osslibraries_ui/BuildProfile.ets | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) 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/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 @@ -‚©libraries–‹¨uniqueId¬@ohos/hamock¯artifactVersion¥1.0.0¤name¬@ohos/hamock«descriptionÙ-A mock framework for OpenHarmony application.§website ªdevelopers‘‚¤name¦huawei¯organisationUrl £scmÀ¬organizationÀ§funding�£tag�¨licenses‘Ù@9264a6b3c134511ccfcae48ed3808320688ae6933ec4fc547476a005095fc1ef‹¨uniqueId¬@ohos/hypium¯artifactVersion¦1.0.28¤name¬@ohos/hypium«descriptionÙ1A unit test framework for OpenHarmony application§websiteÙ.https://gitee.com/openharmony/testfwk_arkxtestªdevelopers‘‚¤name¦huawei¯organisationUrl £scmƒªconnection ³developerConnection £urlÙ.https://gitee.com/openharmony/testfwk_arkxtest¬organizationÀ§funding�£tag“¬æµ‹è¯•框架¦except¤mock¨licenses‘Ù@0cec06e0e55fbc3dc5cee4fca9b607f66cb8f4e4dbcf3b3c013594dd156732e9‹¨uniqueId­@ohos/msgpack¯artifactVersion¥1.0.2¤name­@ohos/msgpack«descriptionÙŽThis library is an implementation of MessagePack for TypeScript and JavaScript, providing a compact and efficient binary serialization format.§website ªdevelopers‘‚¤name¨ohos_tpc¯organisationUrl £scmƒªconnection ³developerConnection £urlÙThttps://gitcode.com/openharmony-tpc/openharmony_tpc_samples/tree/master/ohos_msgpack¬organizationÀ§funding�£tag“§msgpack©HarmonyOS«OpenHarmony¨licenses‘Ù@a0ecad9e3fd75dcac83c89ffe78180c784d47a37db94b87e18bd1a43e0f247ca‹¨uniqueId¬osslibraries¯artifactVersion¥0.0.4¤name¬osslibraries«descriptionÙo适用于 HarmonyOS 的开放æº�代ç �许å�¯æ‰«æ��与展示库 —— 该包是 OSSLibraries çš„ Core 部分。§websiteÙ-https://github.com/composable-tu/osslibrariesªdevelopers‘‚¤name­composable-tu¯organisationUrlÙ https://github.com/composable-tu£scmƒªconnection ³developerConnection £urlÙ-https://github.com/composable-tu/osslibraries¬organizationÀ§funding�£tag•¬osslibraries§license¨licenses«open-source£oss¨licenses‘Ù@533c62b51f490ec5ba0118d19bb2caef961c3b630bf4355eb1e360026db6fda2‹¨uniqueId¯osslibraries_ui¯artifactVersion¥0.0.7¤name¯osslibraries_ui«descriptionÙv适用于 HarmonyOS 的开放æº�代ç �许å�¯æ‰«æ��与展示库 —— 该包是 OSSLibraries 的预定义 UI 部分。§websiteÙ-https://github.com/composable-tu/osslibrariesªdevelopers‘‚¤name­composable-tu¯organisationUrlÙ https://github.com/composable-tu£scmƒªconnection ³developerConnection £urlÙ-https://github.com/composable-tu/osslibraries¬organizationÀ§funding�£tag•¬osslibraries§license¨licenses«open-source£oss¨licenses‘Ù@533c62b51f490ec5ba0118d19bb2caef961c3b630bf4355eb1e360026db6fda2‹¨uniqueId´osslibraries_ui_wear¯artifactVersion¥0.0.3¤name´osslibraries_ui_wear«descriptionى一个适用于 HarmonyOS 的开放æº�代ç �许å�¯æ‰«æ��与展示库 —— 该包是 OSSLibraries 的预定义 UI(Wearable)部分。§websiteÙ-https://github.com/composable-tu/osslibrariesªdevelopers‘‚¤name­composable-tu¯organisationUrlÙ https://github.com/composable-tu£scmƒªconnection ³developerConnection £urlÙ-https://github.com/composable-tu/osslibraries¬organizationÀ§funding�£tag—¬osslibraries§license¨licenses«open-source£oss¨wearable¤wear¨licenses‘Ù@533c62b51f490ec5ba0118d19bb2caef961c3b630bf4355eb1e360026db6fda2¨licenses„Ù@533c62b51f490ec5ba0118d19bb2caef961c3b630bf4355eb1e360026db6fda2…¤hashÙ@533c62b51f490ec5ba0118d19bb2caef961c3b630bf4355eb1e360026db6fda2¤nameÙ,Mulan Permissive Software License, Version 2£urlÙ&https://license.coscl.org.cn/MulanPSL2¦spdxId¬MulanPSL-2.0§contentÚ$! 木兰宽æ�¾è®¸å�¯è¯�, 第2版 +‚©libraries–‹¨uniqueId¬@ohos/hamock¯artifactVersion¥1.0.0¤name¬@ohos/hamock«descriptionÙ-A mock framework for OpenHarmony application.§website ªdevelopers‘‚¤name¦huawei¯organisationUrl £scmÀ¬organizationÀ§funding�£tag�¨licenses‘Ù@9264a6b3c134511ccfcae48ed3808320688ae6933ec4fc547476a005095fc1ef‹¨uniqueId¬@ohos/hypium¯artifactVersion¦1.0.28¤name¬@ohos/hypium«descriptionÙ1A unit test framework for OpenHarmony application§websiteÙ.https://gitee.com/openharmony/testfwk_arkxtestªdevelopers‘‚¤name¦huawei¯organisationUrl £scmƒªconnection ³developerConnection £urlÙ.https://gitee.com/openharmony/testfwk_arkxtest¬organizationÀ§funding�£tag“¬æµ‹è¯•框架¦except¤mock¨licenses‘Ù@0cec06e0e55fbc3dc5cee4fca9b607f66cb8f4e4dbcf3b3c013594dd156732e9‹¨uniqueId­@ohos/msgpack¯artifactVersion¥1.0.2¤name­@ohos/msgpack«descriptionÙŽThis library is an implementation of MessagePack for TypeScript and JavaScript, providing a compact and efficient binary serialization format.§website ªdevelopers‘‚¤name¨ohos_tpc¯organisationUrl £scmƒªconnection ³developerConnection £urlÙThttps://gitcode.com/openharmony-tpc/openharmony_tpc_samples/tree/master/ohos_msgpack¬organizationÀ§funding�£tag“§msgpack©HarmonyOS«OpenHarmony¨licenses‘Ù@a0ecad9e3fd75dcac83c89ffe78180c784d47a37db94b87e18bd1a43e0f247ca‹¨uniqueId¬osslibraries¯artifactVersion¥0.0.4¤name¬osslibraries«descriptionÙo适用于 HarmonyOS 的开放æº�代ç �许å�¯æ‰«æ��与展示库 —— 该包是 OSSLibraries çš„ Core 部分。§websiteÙ-https://github.com/composable-tu/osslibrariesªdevelopers‘‚¤name­composable-tu¯organisationUrlÙ https://github.com/composable-tu£scmƒªconnection ³developerConnection £urlÙ-https://github.com/composable-tu/osslibraries¬organizationÀ§funding�£tag•¬osslibraries§license¨licenses«open-source£oss¨licenses‘Ù@533c62b51f490ec5ba0118d19bb2caef961c3b630bf4355eb1e360026db6fda2‹¨uniqueId¯osslibraries_ui¯artifactVersion¥0.0.8¤name¯osslibraries_ui«descriptionÙv适用于 HarmonyOS 的开放æº�代ç �许å�¯æ‰«æ��与展示库 —— 该包是 OSSLibraries 的预定义 UI 部分。§websiteÙ-https://github.com/composable-tu/osslibrariesªdevelopers‘‚¤name­composable-tu¯organisationUrlÙ https://github.com/composable-tu£scmƒªconnection ³developerConnection £urlÙ-https://github.com/composable-tu/osslibraries¬organizationÀ§funding�£tag•¬osslibraries§license¨licenses«open-source£oss¨licenses‘Ù@533c62b51f490ec5ba0118d19bb2caef961c3b630bf4355eb1e360026db6fda2‹¨uniqueId´osslibraries_ui_wear¯artifactVersion¥0.0.3¤name´osslibraries_ui_wear«descriptionى一个适用于 HarmonyOS 的开放æº�代ç �许å�¯æ‰«æ��与展示库 —— 该包是 OSSLibraries 的预定义 UI(Wearable)部分。§websiteÙ-https://github.com/composable-tu/osslibrariesªdevelopers‘‚¤name­composable-tu¯organisationUrlÙ https://github.com/composable-tu£scmƒªconnection ³developerConnection £urlÙ-https://github.com/composable-tu/osslibraries¬organizationÀ§funding�£tag—¬osslibraries§license¨licenses«open-source£oss¨wearable¤wear¨licenses‘Ù@533c62b51f490ec5ba0118d19bb2caef961c3b630bf4355eb1e360026db6fda2¨licenses„Ù@533c62b51f490ec5ba0118d19bb2caef961c3b630bf4355eb1e360026db6fda2…¤hashÙ@533c62b51f490ec5ba0118d19bb2caef961c3b630bf4355eb1e360026db6fda2¤nameÙ,Mulan Permissive Software License, Version 2£urlÙ&https://license.coscl.org.cn/MulanPSL2¦spdxId¬MulanPSL-2.0§contentÚ$! 木兰宽æ�¾è®¸å�¯è¯�, 第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 @@ -‚©libraries–‹¨uniqueId¬@ohos/hamock¯artifactVersion¥1.0.0¤name¬@ohos/hamock«descriptionÙ-A mock framework for OpenHarmony application.§website ªdevelopers‘‚¤name¦huawei¯organisationUrl £scmÀ¬organizationÀ§funding�£tag�¨licenses‘Ù@9264a6b3c134511ccfcae48ed3808320688ae6933ec4fc547476a005095fc1ef‹¨uniqueId¬@ohos/hypium¯artifactVersion¦1.0.28¤name¬@ohos/hypium«descriptionÙ1A unit test framework for OpenHarmony application§websiteÙ.https://gitee.com/openharmony/testfwk_arkxtestªdevelopers‘‚¤name¦huawei¯organisationUrl £scmƒªconnection ³developerConnection £urlÙ.https://gitee.com/openharmony/testfwk_arkxtest¬organizationÀ§funding�£tag“¬æµ‹è¯•框架¦except¤mock¨licenses‘Ù@0cec06e0e55fbc3dc5cee4fca9b607f66cb8f4e4dbcf3b3c013594dd156732e9‹¨uniqueId­@ohos/msgpack¯artifactVersion¥1.0.2¤name­@ohos/msgpack«descriptionÙŽThis library is an implementation of MessagePack for TypeScript and JavaScript, providing a compact and efficient binary serialization format.§website ªdevelopers‘‚¤name¨ohos_tpc¯organisationUrl £scmƒªconnection ³developerConnection £urlÙThttps://gitcode.com/openharmony-tpc/openharmony_tpc_samples/tree/master/ohos_msgpack¬organizationÀ§funding�£tag“§msgpack©HarmonyOS«OpenHarmony¨licenses‘Ù@a0ecad9e3fd75dcac83c89ffe78180c784d47a37db94b87e18bd1a43e0f247ca‹¨uniqueId¬osslibraries¯artifactVersion¥0.0.4¤name¬osslibraries«descriptionÙo适用于 HarmonyOS 的开放æº�代ç �许å�¯æ‰«æ��与展示库 —— 该包是 OSSLibraries çš„ Core 部分。§websiteÙ-https://github.com/composable-tu/osslibrariesªdevelopers‘‚¤name­composable-tu¯organisationUrlÙ https://github.com/composable-tu£scmƒªconnection ³developerConnection £urlÙ-https://github.com/composable-tu/osslibraries¬organizationÀ§funding�£tag•¬osslibraries§license¨licenses«open-source£oss¨licenses‘Ù@533c62b51f490ec5ba0118d19bb2caef961c3b630bf4355eb1e360026db6fda2‹¨uniqueId¯osslibraries_ui¯artifactVersion¥0.0.7¤name¯osslibraries_ui«descriptionÙv适用于 HarmonyOS 的开放æº�代ç �许å�¯æ‰«æ��与展示库 —— 该包是 OSSLibraries 的预定义 UI 部分。§websiteÙ-https://github.com/composable-tu/osslibrariesªdevelopers‘‚¤name­composable-tu¯organisationUrlÙ https://github.com/composable-tu£scmƒªconnection ³developerConnection £urlÙ-https://github.com/composable-tu/osslibraries¬organizationÀ§funding�£tag•¬osslibraries§license¨licenses«open-source£oss¨licenses‘Ù@533c62b51f490ec5ba0118d19bb2caef961c3b630bf4355eb1e360026db6fda2‹¨uniqueId´osslibraries_ui_wear¯artifactVersion¥0.0.3¤name´osslibraries_ui_wear«descriptionى一个适用于 HarmonyOS 的开放æº�代ç �许å�¯æ‰«æ��与展示库 —— 该包是 OSSLibraries 的预定义 UI(Wearable)部分。§websiteÙ-https://github.com/composable-tu/osslibrariesªdevelopers‘‚¤name­composable-tu¯organisationUrlÙ https://github.com/composable-tu£scmƒªconnection ³developerConnection £urlÙ-https://github.com/composable-tu/osslibraries¬organizationÀ§funding�£tag—¬osslibraries§license¨licenses«open-source£oss¨wearable¤wear¨licenses‘Ù@533c62b51f490ec5ba0118d19bb2caef961c3b630bf4355eb1e360026db6fda2¨licenses„Ù@533c62b51f490ec5ba0118d19bb2caef961c3b630bf4355eb1e360026db6fda2…¤hashÙ@533c62b51f490ec5ba0118d19bb2caef961c3b630bf4355eb1e360026db6fda2¤nameÙ,Mulan Permissive Software License, Version 2£urlÙ&https://license.coscl.org.cn/MulanPSL2¦spdxId¬MulanPSL-2.0§contentÚ$! 木兰宽æ�¾è®¸å�¯è¯�, 第2版 +‚©libraries–‹¨uniqueId¬@ohos/hamock¯artifactVersion¥1.0.0¤name¬@ohos/hamock«descriptionÙ-A mock framework for OpenHarmony application.§website ªdevelopers‘‚¤name¦huawei¯organisationUrl £scmÀ¬organizationÀ§funding�£tag�¨licenses‘Ù@9264a6b3c134511ccfcae48ed3808320688ae6933ec4fc547476a005095fc1ef‹¨uniqueId¬@ohos/hypium¯artifactVersion¦1.0.28¤name¬@ohos/hypium«descriptionÙ1A unit test framework for OpenHarmony application§websiteÙ.https://gitee.com/openharmony/testfwk_arkxtestªdevelopers‘‚¤name¦huawei¯organisationUrl £scmƒªconnection ³developerConnection £urlÙ.https://gitee.com/openharmony/testfwk_arkxtest¬organizationÀ§funding�£tag“¬æµ‹è¯•框架¦except¤mock¨licenses‘Ù@0cec06e0e55fbc3dc5cee4fca9b607f66cb8f4e4dbcf3b3c013594dd156732e9‹¨uniqueId­@ohos/msgpack¯artifactVersion¥1.0.2¤name­@ohos/msgpack«descriptionÙŽThis library is an implementation of MessagePack for TypeScript and JavaScript, providing a compact and efficient binary serialization format.§website ªdevelopers‘‚¤name¨ohos_tpc¯organisationUrl £scmƒªconnection ³developerConnection £urlÙThttps://gitcode.com/openharmony-tpc/openharmony_tpc_samples/tree/master/ohos_msgpack¬organizationÀ§funding�£tag“§msgpack©HarmonyOS«OpenHarmony¨licenses‘Ù@a0ecad9e3fd75dcac83c89ffe78180c784d47a37db94b87e18bd1a43e0f247ca‹¨uniqueId¬osslibraries¯artifactVersion¥0.0.4¤name¬osslibraries«descriptionÙo适用于 HarmonyOS 的开放æº�代ç �许å�¯æ‰«æ��与展示库 —— 该包是 OSSLibraries çš„ Core 部分。§websiteÙ-https://github.com/composable-tu/osslibrariesªdevelopers‘‚¤name­composable-tu¯organisationUrlÙ https://github.com/composable-tu£scmƒªconnection ³developerConnection £urlÙ-https://github.com/composable-tu/osslibraries¬organizationÀ§funding�£tag•¬osslibraries§license¨licenses«open-source£oss¨licenses‘Ù@533c62b51f490ec5ba0118d19bb2caef961c3b630bf4355eb1e360026db6fda2‹¨uniqueId¯osslibraries_ui¯artifactVersion¥0.0.8¤name¯osslibraries_ui«descriptionÙv适用于 HarmonyOS 的开放æº�代ç �许å�¯æ‰«æ��与展示库 —— 该包是 OSSLibraries 的预定义 UI 部分。§websiteÙ-https://github.com/composable-tu/osslibrariesªdevelopers‘‚¤name­composable-tu¯organisationUrlÙ https://github.com/composable-tu£scmƒªconnection ³developerConnection £urlÙ-https://github.com/composable-tu/osslibraries¬organizationÀ§funding�£tag•¬osslibraries§license¨licenses«open-source£oss¨licenses‘Ù@533c62b51f490ec5ba0118d19bb2caef961c3b630bf4355eb1e360026db6fda2‹¨uniqueId´osslibraries_ui_wear¯artifactVersion¥0.0.3¤name´osslibraries_ui_wear«descriptionى一个适用于 HarmonyOS 的开放æº�代ç �许å�¯æ‰«æ��与展示库 —— 该包是 OSSLibraries 的预定义 UI(Wearable)部分。§websiteÙ-https://github.com/composable-tu/osslibrariesªdevelopers‘‚¤name­composable-tu¯organisationUrlÙ https://github.com/composable-tu£scmƒªconnection ³developerConnection £urlÙ-https://github.com/composable-tu/osslibraries¬organizationÀ§funding�£tag—¬osslibraries§license¨licenses«open-source£oss¨wearable¤wear¨licenses‘Ù@533c62b51f490ec5ba0118d19bb2caef961c3b630bf4355eb1e360026db6fda2¨licenses„Ù@533c62b51f490ec5ba0118d19bb2caef961c3b630bf4355eb1e360026db6fda2…¤hashÙ@533c62b51f490ec5ba0118d19bb2caef961c3b630bf4355eb1e360026db6fda2¤nameÙ,Mulan Permissive Software License, Version 2£urlÙ&https://license.coscl.org.cn/MulanPSL2¦spdxId¬MulanPSL-2.0§contentÚ$! 木兰宽æ�¾è®¸å�¯è¯�, 第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'; From 3d6d08734e429de7671eb617727dfbc267774ba5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A1=8C=E8=A2=82=E9=96=8B=E8=B7=A4?= <208613607+composable-tu@users.noreply.github.com> Date: Sun, 16 Aug 2026 18:25:48 +0800 Subject: [PATCH 5/6] =?UTF-8?q?fix(core):=20=E4=BF=AE=E5=A4=8D=20navigateT?= =?UTF-8?q?oDetail=20=E8=A6=86=E7=9B=96=E9=80=BB=E8=BE=91=E5=B9=B6?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - ä¿®å¤�了 navigateToDetail 方法中的页é�¢è¦†ç›–逻辑,使其更加安全 - 添加了对页é�¢æ ˆä¸­è¯¦æƒ…页状æ€�的准确判断 - 更新了 SKILL.md 中关于路由å��称使用的详细说明 - å�‘布 v0.0.9 版本 --- osslibraries_ui/changelog.md | 4 ++++ osslibraries_ui/oh-package.json5 | 2 +- .../src/main/ets/pages/OSSLibrariesLicensePage.ets | 5 ++++- skills/osslibraries-usage/SKILL.md | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/osslibraries_ui/changelog.md b/osslibraries_ui/changelog.md index f497f17..888a9e7 100644 --- a/osslibraries_ui/changelog.md +++ b/osslibraries_ui/changelog.md @@ -1,5 +1,9 @@ # Changelog +## v0.0.9 + +- ä¿®å¤�:`navigateToDetail` 覆盖逻辑更安全 + ## v0.0.8 - 适é…�大å±�设备,如平æ�¿ã€�折å� å±�ã€�智慧å±�。 diff --git a/osslibraries_ui/oh-package.json5 b/osslibraries_ui/oh-package.json5 index 0cff5c9..6edaae1 100644 --- a/osslibraries_ui/oh-package.json5 +++ b/osslibraries_ui/oh-package.json5 @@ -1,6 +1,6 @@ { name: "osslibraries_ui", - version: "0.0.8", + version: "0.0.9", description: "适用于 HarmonyOS 的开放æº�代ç �许å�¯æ‰«æ��与展示库 —— 该包是 OSSLibraries 的预定义 UI 部分。", main: "Index.ets", author: { diff --git a/osslibraries_ui/src/main/ets/pages/OSSLibrariesLicensePage.ets b/osslibraries_ui/src/main/ets/pages/OSSLibrariesLicensePage.ets index 867f566..2f273c7 100644 --- a/osslibraries_ui/src/main/ets/pages/OSSLibrariesLicensePage.ets +++ b/osslibraries_ui/src/main/ets/pages/OSSLibrariesLicensePage.ets @@ -148,7 +148,10 @@ export struct OSSLibrariesLicensePage { private navigateToDetail(uniqueId: string): void { const params: LicenseDetailParams = { uniqueId: uniqueId }; - if (this.pathStack.size() > 0) { + 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); diff --git a/skills/osslibraries-usage/SKILL.md b/skills/osslibraries-usage/SKILL.md index 0ef37a9..b09f341 100644 --- a/skills/osslibraries-usage/SKILL.md +++ b/skills/osslibraries-usage/SKILL.md @@ -265,7 +265,7 @@ this.getUIContext().getRouter().pushNamedRoute({ | `getMaterialLevel` | Material level probe | | `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 From 244f26bfac668129eb2874d37182c3a0a741523d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A1=8C=E8=A2=82=E9=96=8B=E8=B7=A4?= <208613607+composable-tu@users.noreply.github.com> Date: Sun, 16 Aug 2026 18:29:45 +0800 Subject: [PATCH 6/6] =?UTF-8?q?refactor(navigation):=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=20navigateToDetail=20=E8=A6=86=E7=9B=96=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将修å¤�类型从 bug fix 调整为代ç �é‡�构优化 - æ��å�‡ navigateToDetail 函数的安全性和稳定性 - 改进覆盖逻辑的实现方å¼�以增强å�¥å£®æ€§ --- osslibraries_ui/changelog.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osslibraries_ui/changelog.md b/osslibraries_ui/changelog.md index 888a9e7..eb954bb 100644 --- a/osslibraries_ui/changelog.md +++ b/osslibraries_ui/changelog.md @@ -2,7 +2,7 @@ ## v0.0.9 -- ä¿®å¤�:`navigateToDetail` 覆盖逻辑更安全 +- 优化:使 `navigateToDetail` 覆盖逻辑更安全 ## v0.0.8