From 7ad451087e1ba3334a519d09197a98ef61e1ac06 Mon Sep 17 00:00:00 2001 From: CY Date: Tue, 19 Mar 2024 06:16:54 +0000 Subject: [PATCH] see changelog --- .gitignore | 3 +- package.json | 14 +- packages/docs/package.json | 4 +- packages/react/package.json | 2 +- packages/ui/CHANGELOG.md | 4 + packages/ui/package.json | 2 +- packages/ui/src/components/Menubar.ts | 42 +- packages/ui/src/components/Setting.ts | 30 +- pnpm-lock.yaml | 1167 +++++++++---------------- 9 files changed, 460 insertions(+), 808 deletions(-) diff --git a/.gitignore b/.gitignore index 3c60e7cc..4d5724f2 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,5 @@ node_modules dist .next -out \ No newline at end of file +out +.nx diff --git a/package.json b/package.json index bd254484..05a9e291 100644 --- a/package.json +++ b/package.json @@ -42,22 +42,22 @@ "@babel/plugin-transform-template-literals": "^7.23.3", "@changesets/cli": "^2.27.1", "@rollup/plugin-babel": "^6.0.4", - "@types/node": "^18.19.24", + "@types/node": "^20.11.29", "@vitejs/plugin-react": "^4.2.1", "babel-plugin-syntax-trailing-function-commas": "^6.22.0", "concurrently": "^8.2.2", "cross-env": "^7.0.3", - "jsdom": "^22.1.0", - "lint-staged": "^13.3.0", - "nx": "^16.10.0", - "prettier": "^2.8.8", + "jsdom": "^24.0.0", + "lint-staged": "^15.2.2", + "nx": "^18.1.2", + "prettier": "^3.2.5", "rimraf": "^5.0.5", "terser": "^5.29.2", "tslib": "^2.6.2", "typescript": "^5.4.2", - "vite": "^4.5.2", + "vite": "^5.1.6", "vite-plugin-banner": "^0.7.1", - "vitest": "^0.31.4" + "vitest": "^1.4.0" }, "pnpm": { "patchedDependencies": { diff --git a/packages/docs/package.json b/packages/docs/package.json index 9f2eabc1..fcb49a72 100644 --- a/packages/docs/package.json +++ b/packages/docs/package.json @@ -19,14 +19,14 @@ "@oplayer/torrent": "workspace:*", "@oplayer/ui": "workspace:*", "mdx-embed": "^1.1.2", - "next": "^13.5.6", + "next": "^14.1.3", "nextra": "^2.13.4", "nextra-theme-docs": "^2.13.4", "react": "^18.2.0", "react-dom": "^18.2.0" }, "devDependencies": { - "@types/react": "^18.2.66", + "@types/react": "^18.2.67", "@types/react-dom": "^18.2.22", "sass": "^1.72.0" } diff --git a/packages/react/package.json b/packages/react/package.json index ab7fa4f7..04e2be0e 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -28,7 +28,7 @@ }, "devDependencies": { "@oplayer/core": "workspace:*", - "@types/react": "^18.2.66", + "@types/react": "^18.2.67", "react": "^18.2.0", "react-dom": "^18.2.0" } diff --git a/packages/ui/CHANGELOG.md b/packages/ui/CHANGELOG.md index c0a5e7e3..0f372654 100644 --- a/packages/ui/CHANGELOG.md +++ b/packages/ui/CHANGELOG.md @@ -2,6 +2,10 @@ ## UnRelease +## [1.2.36-beta.4] + +- no repeat menu/setting. + ## [1.2.36-beta.2] - fix keyboard config conflicts. diff --git a/packages/ui/package.json b/packages/ui/package.json index c29926c3..061d4d88 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -1,6 +1,6 @@ { "name": "@oplayer/ui", - "version": "1.2.36-beta.3", + "version": "1.2.36-beta.4", "description": "ui plugin for oplayer", "type": "module", "main": "./dist/index.es.js", diff --git a/packages/ui/src/components/Menubar.ts b/packages/ui/src/components/Menubar.ts index 1d84b794..73867783 100644 --- a/packages/ui/src/components/Menubar.ts +++ b/packages/ui/src/components/Menubar.ts @@ -10,7 +10,7 @@ import { icon as iconCls, tooltip } from '../style' import type { MenuBar, UIInterface } from '../types' import { siblings } from '../utils' -const _select = (elm: HTMLElement) => { +const setChecked = (elm: HTMLElement) => { const selected = elm.getAttribute('aria-checked') == 'true' elm.setAttribute('aria-checked', `${!selected}`) siblings(elm, (it) => it.setAttribute('aria-checked', `${selected}`)) @@ -31,7 +31,7 @@ export default (it: UIInterface) => { if (!target || elm.getAttribute('aria-checked') == 'true') return if (elm.tagName.toUpperCase() == 'SPAN') { - _select(elm) + setChecked(elm) target.onChange?.( target.children![+elm.getAttribute('data-index')!]!, elm.parentElement!.previousElementSibling as HTMLButtonElement, @@ -46,10 +46,14 @@ export default (it: UIInterface) => { it.addEventListener('click', clickHandler) }) - it.menu.register = function register(menu: MenuBar) { + function _register(menu: MenuBar) { + const repeated = menus.find((m) => m.name == menu.name) + if (repeated) unregister(repeated.name) + const { name, icon, children, position } = menu const isTop = position == 'top' && $targets.length == 2 let $menu: string = '' + const $button = `