From 4a6a87e32ea742508f07f9d9245c295b8e27d131 Mon Sep 17 00:00:00 2001 From: web-dahuyou Date: Wed, 4 Sep 2024 21:51:47 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E5=88=97=E8=A1=A8=E6=A0=91=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E6=8A=98=E5=8F=A0,=20=E5=8E=BB=E6=8E=89=E5=B1=95?= =?UTF-8?q?=E5=BC=80=E5=85=A8=E9=83=A8=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entrypoints/options/home/Home.styled.tsx | 2 +- entrypoints/options/home/hooks/treeData.ts | 3 +- entrypoints/options/home/index.tsx | 33 +++++++++++++--------- 3 files changed, 22 insertions(+), 16 deletions(-) diff --git a/entrypoints/options/home/Home.styled.tsx b/entrypoints/options/home/Home.styled.tsx index 8e1c6fd..a6687b1 100644 --- a/entrypoints/options/home/Home.styled.tsx +++ b/entrypoints/options/home/Home.styled.tsx @@ -69,7 +69,7 @@ export const StyledSidebarWrapper = styled.div<{ flex-shrink: 0; display: flex; align-items: center; - justify-content: flex-end; + justify-content: flex-start; margin-bottom: 10px; gap: 8px; button { diff --git a/entrypoints/options/home/hooks/treeData.ts b/entrypoints/options/home/hooks/treeData.ts index 951464c..66b2a97 100644 --- a/entrypoints/options/home/hooks/treeData.ts +++ b/entrypoints/options/home/hooks/treeData.ts @@ -360,7 +360,8 @@ export function useTreeData() { setLoading(false); // console.log('init-treeData', treeData); setCountInfo(tabListUtils.countInfo); - setExpandedKeys(treeData.map((tag) => tag.key)); + // 考虑到数据量大,默认不展开列表了 + // setExpandedKeys(treeData.map((tag) => tag.key)); const tag = treeData?.find( diff --git a/entrypoints/options/home/index.tsx b/entrypoints/options/home/index.tsx index ce2901b..e34be1c 100644 --- a/entrypoints/options/home/index.tsx +++ b/entrypoints/options/home/index.tsx @@ -90,15 +90,15 @@ export default function Home() { const [confirmModalVisible, setConfirmModalVisible] = useState(false); const [helpDrawerVisible, setHelpDrawerVisible] = useState(false); const [searchValue, setSearchValue] = useState(''); - const moreItems: MenuProps['items'] = [ - { - key: 'clear', - label: ( - setConfirmModalVisible(true)}>{$fmt('home.clearAll')} - ), - icon: , - }, - ]; + // const moreItems: MenuProps['items'] = [ + // { + // key: 'clear', + // label: ( + // setConfirmModalVisible(true)}>{$fmt('home.clearAll')} + // ), + // icon: , + // }, + // ]; // 确认清空全部 const handleClearConfirm = () => { handleMoreItemClick('clear'); @@ -284,20 +284,25 @@ export default function Home() { {/* 顶部操作按钮组 */}
- + {/* 隐藏展开全部按钮,自己主动打开吧 + + */} - + + {/* - + */}
{/* 列表搜索框 */} Date: Wed, 4 Sep 2024 21:52:33 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E5=AF=BC=E5=85=A5=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E9=A1=B5=E9=BB=98=E8=AE=A4=E4=B8=8D=E7=94=9F=E6=88=90=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=E5=86=85=E5=AE=B9,=E6=94=B9=E4=B8=BA=E6=89=8B?= =?UTF-8?q?=E5=8A=A8=E8=A7=A6=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../locale/modules/importExport/enUS.ts | 1 + .../locale/modules/importExport/zhCN.ts | 1 + entrypoints/options/importExport/index.tsx | 118 +++++++++++------- 3 files changed, 76 insertions(+), 44 deletions(-) diff --git a/entrypoints/common/locale/modules/importExport/enUS.ts b/entrypoints/common/locale/modules/importExport/enUS.ts index d37e3e5..bc43c96 100644 --- a/entrypoints/common/locale/modules/importExport/enUS.ts +++ b/entrypoints/common/locale/modules/importExport/enUS.ts @@ -22,6 +22,7 @@ export default { 'importExport.importFailed': 'Import Failed! Please check whether the format is correct ?', 'importExport.exportContent': 'Content to Export:', + 'importExport.getContent': 'Get Content', 'importExport.copy': 'Copy to Clipboard', 'importExport.exportToFile': 'Export to Local File', 'importExport.CopySuccess': 'Copy Success', diff --git a/entrypoints/common/locale/modules/importExport/zhCN.ts b/entrypoints/common/locale/modules/importExport/zhCN.ts index 25f5edd..596ffc2 100644 --- a/entrypoints/common/locale/modules/importExport/zhCN.ts +++ b/entrypoints/common/locale/modules/importExport/zhCN.ts @@ -27,6 +27,7 @@ export default { 'importExport.importFailed': '导入失败,请检查格式是否正确', 'importExport.exportContent': '导出内容:', + 'importExport.getContent': '生成内容', 'importExport.copy': '复制到剪贴板', 'importExport.exportToFile': '导出到本地', 'importExport.CopySuccess': '复制成功', diff --git a/entrypoints/options/importExport/index.tsx b/entrypoints/options/importExport/index.tsx index 8223624..a01d403 100644 --- a/entrypoints/options/importExport/index.tsx +++ b/entrypoints/options/importExport/index.tsx @@ -1,6 +1,6 @@ import { useCallback, useEffect, useState } from 'react'; import { Form, Button, Radio, Input, Divider, Space, Upload, message } from 'antd'; -import type { FormProps, UploadProps } from 'antd'; +import type { FormProps, UploadProps, RadioChangeEvent } from 'antd'; import styled from 'styled-components'; import { CopyToClipboard } from 'react-copy-to-clipboard'; import { saveAs } from 'file-saver'; @@ -10,7 +10,6 @@ import { tabListUtils } from '~/entrypoints/common/storage'; import { extContentImporter, extContentExporter } from '~/entrypoints/common/utils'; import { initialValues, formatTypeOptions, importModeOptions } from './constants'; - const StyledWrapper = styled.div` .module-title { margin-top: 24px; @@ -33,16 +32,18 @@ export default function ImportExport() { const [formatType, setFormatType] = useState(1); const [importMode, setImportMode] = useState('append'); const [exportFormatType, setExportFormatType] = useState(1); + const [exportLoading, setExportLoading] = useState(false); + const [downloadLoading, setDownloadLoading] = useState(false); // 导入操作 const handleImport: FormProps['onFinish'] = async (values) => { const { formatType, importContent } = values; - const formatOption = formatTypeOptions.find(option => option.type === formatType); + const formatOption = formatTypeOptions.find((option) => option.type === formatType); const funcName = formatOption?.funcName || 'niceTab'; try { const tagList = extContentImporter?.[funcName]?.(importContent); await tabListUtils.importTags(tagList, importMode); - getExportContent(); + messageApi.success($fmt('importExport.importSuccess')); form.setFieldValue('importContent', ''); } catch { @@ -55,22 +56,34 @@ export default function ImportExport() { reader.onload = () => { const content = reader.result as string; handleImport({ formatType: 1, importContent: content }); - } + }; reader.readAsText(file); return false; - } + }; + + const onExportFormatTypeChange = (e: RadioChangeEvent) => { + setExportFormatType(e.target.value); + setExportContent(''); + }; + const handlePreview = async () => { + setExportLoading(true); + await getExportContent(); + setExportLoading(false); + }; // 获取导出文本内容 const getExportContent = useCallback(async () => { const formatType = exportFormatType || 1; const exportTagList = await tabListUtils.exportTags(); - const formatOption = formatTypeOptions.find(option => option.type === formatType); + const formatOption = formatTypeOptions.find((option) => option.type === formatType); const funcName = formatOption?.funcName || 'niceTab'; try { const content = extContentExporter?.[funcName]?.(exportTagList); setExportContent(content); + return content; } catch (err) { console.error(err); - }; + return ''; + } }, [exportFormatType]); // 复制到剪切板 const handleCopy = (text: string, result: boolean) => { @@ -79,29 +92,28 @@ export default function ImportExport() { } else { messageApi.error($fmt('importExport.CopyFailed')); } - } + }; // 导出文件 - const handleDownload = useCallback(() => { + const handleDownload = useCallback(async () => { + setDownloadLoading(true); const now = dayjs().format('YYYY-MM-DD_HHmmss'); const ext = exportFormatType == 1 ? 'json' : 'txt'; const fileType = exportFormatType == 1 ? 'application/json' : 'text/plain'; - const fileName = `export_${exportFormatType == 1 ? 'nice-tab' : 'one-tab'}_${now}.${ext}`; - saveAs(new Blob([exportContent], { type: `${fileType};charset=utf-8` }), fileName); - }, [exportFormatType, exportContent]); - - useEffect(() => { - getExportContent(); + const fileName = `export_${ + exportFormatType == 1 ? 'nice-tab' : 'one-tab' + }_${now}.${ext}`; + const content = exportContent || (await getExportContent()); + saveAs(new Blob([content], { type: `${fileType};charset=utf-8` }), fileName); + setDownloadLoading(false); }, [exportFormatType]); - useEffect(() => { - getExportContent(); - }, []); - return ( <> {contextHolder} - {$fmt({ id: 'importExport.moduleTitle', values: {action: 'import'}})} + + {$fmt({ id: 'importExport.moduleTitle', values: { action: 'import' } })} +
- - setFormatType(e.target.value) }> + + setFormatType(e.target.value)}> {formatTypeOptions.map((item) => ( - {$fmt({ id: 'importExport.formatType.optionLabel', values: {label: item.label}})} + {$fmt({ + id: 'importExport.formatType.optionLabel', + values: { label: item.label }, + })} ))} - setImportMode(e.target.value) }> + setImportMode(e.target.value)}> {importModeOptions.map((item) => ( - {$fmt({ id: 'importExport.importMode.optionLabel', values: {label: item.label}})} + {$fmt({ + id: 'importExport.importMode.optionLabel', + values: { label: item.label }, + })} ))} - + - { +formatType === 1 && ( - + {+formatType === 1 && ( + - ) } + )} {/* 导出模块 */} - {$fmt({ id: 'importExport.moduleTitle', values: {action: 'export'}})} -
- - setExportFormatType(e.target.value) }> + + {$fmt({ id: 'importExport.moduleTitle', values: { action: 'export' } })} + + + + {formatTypeOptions.map((item) => ( {item.label} @@ -173,10 +196,17 @@ export default function ImportExport() { - - - - + + {exportContent && ( + + + + )} + From 2f2cc6a35fb369381e8aaae82ca08d651df8f2e0 Mon Sep 17 00:00:00 2001 From: web-dahuyou Date: Thu, 5 Sep 2024 10:13:13 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entrypoints/common/storage/tabListUtils.ts | 23 ++++++++++++++++++---- entrypoints/common/utils/importExport.ts | 2 +- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/entrypoints/common/storage/tabListUtils.ts b/entrypoints/common/storage/tabListUtils.ts index 7ee0aee..afd2a78 100644 --- a/entrypoints/common/storage/tabListUtils.ts +++ b/entrypoints/common/storage/tabListUtils.ts @@ -1106,10 +1106,25 @@ export default class TabListUtils { await this.setTagList(newTagList); } else { // append mode - // await this.setTagList([...tags, ...tagList]); - const insertIndex = tagList?.[0]?.static ? 1 : 0; - tagList.splice(insertIndex, 0, ...tags); - await this.setTagList(tagList); + let stagingAreaTag = this.createStagingAreaTag(); + const stagingAreaIndex = tagList?.findIndex((tag) => tag?.static); + if (~stagingAreaIndex) { + stagingAreaTag = tagList.splice(stagingAreaIndex, 1)?.[0] || stagingAreaTag; + } + + const stagingAreaInsertIndex = tags?.findIndex((tag) => tag?.static); + + if (~stagingAreaInsertIndex) { + stagingAreaTag.groupList = mergeGroupsAndTabs({ + targetList: stagingAreaTag.groupList, + insertList: tags?.[stagingAreaInsertIndex].groupList, + exceptValue: UNNAMED_GROUP, + }) + tags.splice(stagingAreaInsertIndex, 1); + } + + const newTagList = [stagingAreaTag, ...tags, ...tagList]; + await this.setTagList(newTagList); } } // 导出 diff --git a/entrypoints/common/utils/importExport.ts b/entrypoints/common/utils/importExport.ts index c7c3fea..487bfdb 100644 --- a/entrypoints/common/utils/importExport.ts +++ b/entrypoints/common/utils/importExport.ts @@ -38,7 +38,7 @@ export const extContentImporter: ExtContentImporterProps = { const tagList = JSON.parse(content || '[]') as TagItem[]; const createTime = newCreateTime(); tagList.forEach(tag => { - tag.tagId = getRandomId(); + tag.tagId = tag.static ? '0' : getRandomId(); tag.createTime = createTime; tag?.groupList?.forEach(group => { group.groupId = getRandomId(); From f2f50ba2d2a1e12c851471a6c167ebdc1ea156c5 Mon Sep 17 00:00:00 2001 From: web-dahuyou Date: Sat, 7 Sep 2024 16:29:57 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E6=BB=9A=E5=8A=A8=E6=9D=A1=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entrypoints/common/style/Common.styled.tsx | 84 +++++++++++++-------- entrypoints/options/home/MoveToModal.tsx | 3 + entrypoints/options/sync/SidebarContent.tsx | 7 +- entrypoints/options/sync/Sync.styled.tsx | 2 +- 4 files changed, 59 insertions(+), 37 deletions(-) diff --git a/entrypoints/common/style/Common.styled.tsx b/entrypoints/common/style/Common.styled.tsx index 6388531..f38d296 100644 --- a/entrypoints/common/style/Common.styled.tsx +++ b/entrypoints/common/style/Common.styled.tsx @@ -10,62 +10,60 @@ export const StyledEllipsis = css` white-space: nowrap; `; // 多行超长省略 -export const StyledEllipsisLines = css<{$lines?: number}>` +export const StyledEllipsisLines = css<{ $lines?: number }>` overflow: hidden; text-overflow: ellipsis; word-break: break-all; display: -webkit-box; -webkit-box-orient: vertical; - -webkit-line-clamp: ${props => props.$lines || 2}; + -webkit-line-clamp: ${(props) => props.$lines || 2}; `; - // action icon btn export const StyledActionIconBtn = styled.i<{ - theme: StyledThemeProps, - $size?: number | string, - $color?: string, - $hoverColor?: string, - $hoverScale?: number + theme: StyledThemeProps; + $size?: number | string; + $color?: string; + $hoverColor?: string; + $hoverScale?: number; }>` display: flex; align-items: center; justify-content: center; - width: ${props => `${+(props.$size || 16) + 2}px`}; - height: ${props => `${+(props.$size || 16) + 2}px`}; - font-size: ${props => `${props.$size || 14}px`}; - color: ${props => props.$color || props.theme.colorTextSecondary || '#666'}; + width: ${(props) => `${+(props.$size || 16) + 2}px`}; + height: ${(props) => `${+(props.$size || 16) + 2}px`}; + font-size: ${(props) => `${props.$size || 14}px`}; + color: ${(props) => props.$color || props.theme.colorTextSecondary || '#666'}; transition: all 0.2s; cursor: pointer; &:hover { - transform: scale(${props => props.$hoverScale || 1.2}); - color: ${props => props.$hoverColor || props.theme.colorTextSecondary || '#666'}; + transform: scale(${(props) => props.$hoverScale || 1.2}); + color: ${(props) => props.$hoverColor || props.theme.colorTextSecondary || '#666'}; } `; // toogle theme color block item export const StyledColorItem = styled.div` -position: relative; -width: 24px; -height: 24px; -border-radius: 4px; -cursor: pointer; -&.active { - &:after { - content: ""; - position: absolute; - left: 50%; - transform: translateX(-50%); - bottom: -6px; - width: 4px; - height: 4px; - border-radius: 2px; - background: red; + position: relative; + width: 24px; + height: 24px; + border-radius: 4px; + cursor: pointer; + &.active { + &:after { + content: ''; + position: absolute; + left: 50%; + transform: translateX(-50%); + bottom: -6px; + width: 4px; + height: 4px; + border-radius: 2px; + background: red; + } } -} `; - export const GlobalStyle = createGlobalStyle` :root { --bg-color: ${(props) => props.theme.colorBgContainer || '#fff'}; @@ -75,4 +73,24 @@ export const GlobalStyle = createGlobalStyle` --text-color: ${(props) => props.theme.colorText || 'rgba(0, 0, 0, 0.88)'}; color: ${(props) => props.theme.colorText || 'rgba(0, 0, 0, 0.88)'}; } -` \ No newline at end of file + + ::-webkit-scrollbar { + width: 10px; + height: 10px; + } + + ::-webkit-scrollbar-track { + border-radius: 5px; + background: var(--bg-color, #fff); + } + + ::-webkit-scrollbar-thumb { + border-radius: 5px; + background: ${(props) => props.theme.type === 'light' ? '#d9d9d9' : '#555'}; + box-shadow:inset 0 0 4px rgba(0, 0, 0, .3); + } + + ::-webkit-scrollbar-thumb:hover { + background: ${(props) => props.theme.type === 'light' ? '#bfbfbf' : '#888'}; + } +`; diff --git a/entrypoints/options/home/MoveToModal.tsx b/entrypoints/options/home/MoveToModal.tsx index 9eb6b58..987def2 100644 --- a/entrypoints/options/home/MoveToModal.tsx +++ b/entrypoints/options/home/MoveToModal.tsx @@ -10,6 +10,9 @@ import type { MoveDataProps, MoveTargetProps, CascaderOption } from './types'; import { getCascaderData } from './utils'; const StyledCascaderWrapper = styled.div` + .ant-cascader-panel { + overflow-x: visible; + } .ant-cascader-menu { min-height: 180px; max-height: 360px; diff --git a/entrypoints/options/sync/SidebarContent.tsx b/entrypoints/options/sync/SidebarContent.tsx index df60066..13d6b10 100644 --- a/entrypoints/options/sync/SidebarContent.tsx +++ b/entrypoints/options/sync/SidebarContent.tsx @@ -225,10 +225,11 @@ function CardItemMarkup({ ); } -const StyledCard = styled.div<{ $primaryColor: string }>` +const StyledCard = styled.div` .card-item { + border-color: ${(props) => props.theme.colorBorder}; &.active { - border-color: ${(props) => props.$primaryColor}; + border-color: ${(props) => props.theme.colorPrimary}; } .icon-btn-wrapper { padding: 4px; @@ -263,7 +264,7 @@ export default function SidebarContent({ return ( {remoteOptions.map((option) => ( - + props.theme.colorBorder || 'rgba(5, 5, 5, 0.06)'}; } `; From cb641eb36a85948f481eeb5513f53809be05a7b9 Mon Sep 17 00:00:00 2001 From: web-dahuyou Date: Sat, 7 Sep 2024 17:33:23 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E6=9C=AA=E5=91=BD=E5=90=8D=E5=88=86?= =?UTF-8?q?=E7=BB=84=E5=90=88=E5=B9=B6=E8=A7=84=E5=88=99=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entrypoints/common/storage/tabListUtils.ts | 2 +- entrypoints/common/utils/importExport.ts | 48 ++++++++++-------- entrypoints/options/importExport/index.tsx | 2 +- package.json | 4 +- pnpm-lock.yaml | 59 +++++++++++++++++----- wxt.config.ts | 1 + 6 files changed, 79 insertions(+), 37 deletions(-) diff --git a/entrypoints/common/storage/tabListUtils.ts b/entrypoints/common/storage/tabListUtils.ts index afd2a78..be62dda 100644 --- a/entrypoints/common/storage/tabListUtils.ts +++ b/entrypoints/common/storage/tabListUtils.ts @@ -112,7 +112,7 @@ export function mergeGroupsAndTabs({ resultList = []; for (let item of list) { if (exceptValue != undefined && item[key] === exceptValue) { - exceptList.push(item); + exceptList.push({ ...item, groupName: `group_${getRandomId()}` }); } else { resultList.push(item); } diff --git a/entrypoints/common/utils/importExport.ts b/entrypoints/common/utils/importExport.ts index 487bfdb..d3af200 100644 --- a/entrypoints/common/utils/importExport.ts +++ b/entrypoints/common/utils/importExport.ts @@ -1,6 +1,9 @@ import type { TagItem, TabItem } from '~/entrypoints/types'; import { tabListUtils } from '~/entrypoints/common/storage'; -import type { ExtContentImporterProps, ExtContentExporterProps } from '~/entrypoints/types'; +import type { + ExtContentImporterProps, + ExtContentExporterProps, +} from '~/entrypoints/types'; import { getRandomId, newCreateTime } from '~/entrypoints/common/utils'; // 解析 NiceTab、OneTab等 插件的导入内容 @@ -12,7 +15,11 @@ export const extContentImporter: ExtContentImporterProps = { if (!line.trim()) { if (tabList?.length > 0) { const newGroupItem = tabListUtils.getInitialTabGroup(); - groupList.push({ ...newGroupItem, tabList: [...tabList] }); + groupList.push({ + ...newGroupItem, + groupName: `oneTab-${getRandomId()}`, + tabList: [...tabList], + }); tabList = []; } continue; @@ -24,7 +31,11 @@ export const extContentImporter: ExtContentImporterProps = { if (tabList?.length > 0) { const newGroupItem = tabListUtils.getInitialTabGroup(); - groupList.push({ ...newGroupItem, tabList: [...tabList] }); + groupList.push({ + ...newGroupItem, + groupName: `oneTab-${getRandomId()}`, + tabList: [...tabList], + }); tabList = []; } @@ -37,34 +48,34 @@ export const extContentImporter: ExtContentImporterProps = { try { const tagList = JSON.parse(content || '[]') as TagItem[]; const createTime = newCreateTime(); - tagList.forEach(tag => { + tagList.forEach((tag) => { tag.tagId = tag.static ? '0' : getRandomId(); tag.createTime = createTime; - tag?.groupList?.forEach(group => { + tag?.groupList?.forEach((group) => { group.groupId = getRandomId(); group.createTime = createTime; - group?.tabList?.forEach(tab => { + group?.tabList?.forEach((tab) => { const { favIconUrl } = tab; tab.tabId = getRandomId(); - tab.favIconUrl = favIconUrl?.startsWith('data:image/') ? '' : favIconUrl - }) + tab.favIconUrl = favIconUrl?.startsWith('data:image/') ? '' : favIconUrl; + }); }); - }) + }); return tagList; } catch { return []; } - } -} + }, +}; // 将内容导出为 NiceTab、OneTab 等格式 export const extContentExporter: ExtContentExporterProps = { oneTab(tagList): string { let resultList: string[] = []; try { - tagList.forEach(tag => { - tag?.groupList?.forEach(group => { - group?.tabList?.forEach(tab => { + tagList.forEach((tag) => { + tag?.groupList?.forEach((group) => { + group?.tabList?.forEach((tab) => { resultList.push(`${tab.url} | ${tab.title}\n`); }); resultList.push('\n'); @@ -81,13 +92,10 @@ export const extContentExporter: ExtContentExporterProps = { } catch { return ''; } - } -} - + }, +}; export default { extContentImporter, - extContentExporter + extContentExporter, }; - - diff --git a/entrypoints/options/importExport/index.tsx b/entrypoints/options/importExport/index.tsx index a01d403..7257a4e 100644 --- a/entrypoints/options/importExport/index.tsx +++ b/entrypoints/options/importExport/index.tsx @@ -1,4 +1,4 @@ -import { useCallback, useEffect, useState } from 'react'; +import { useCallback, useState } from 'react'; import { Form, Button, Radio, Input, Divider, Space, Upload, message } from 'antd'; import type { FormProps, UploadProps, RadioChangeEvent } from 'antd'; import styled from 'styled-components'; diff --git a/package.json b/package.json index 9eace64..7c59801 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nice-tab", - "description": "A nice, convenient, powerful tab manager", + "description": "A nice, convenient, powerful tab manager [open source]", "private": true, "version": "2.2.0", "type": "module", @@ -40,6 +40,6 @@ "@types/react-dom": "^18.3.0", "@wxt-dev/module-react": "^1.1.0", "typescript": "^5.5.4", - "wxt": "^0.19.1" + "wxt": "^0.19.9" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 79e4c75..373abdb 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -60,6 +60,9 @@ importers: specifier: ^6.1.8 version: 6.1.13(react-dom@18.3.1(react@18.3.1))(react@18.3.1) devDependencies: + '@types/chrome': + specifier: ^0.0.270 + version: 0.0.270 '@types/file-saver': specifier: ^2.0.7 version: 2.0.7 @@ -74,13 +77,13 @@ importers: version: 18.3.0 '@wxt-dev/module-react': specifier: ^1.1.0 - version: 1.1.1(vite@5.4.2(@types/node@22.5.1))(wxt@0.19.8(@types/node@22.5.1)(rollup@4.21.2)) + version: 1.1.1(vite@5.4.2(@types/node@22.5.1))(wxt@0.19.9(@types/node@22.5.1)(rollup@4.21.2)) typescript: specifier: ^5.5.4 version: 5.5.4 wxt: - specifier: ^0.19.1 - version: 0.19.8(@types/node@22.5.1)(rollup@4.21.2) + specifier: ^0.19.9 + version: 0.19.9(@types/node@22.5.1)(rollup@4.21.2) packages: @@ -852,12 +855,27 @@ packages: '@types/babel__traverse@7.20.6': resolution: {integrity: sha512-r1bzfrm0tomOI8g1SzvCaQHo6Lcv6zu0EA+W2kHrt8dyrHQxGzBBL4kdkzIS+jBMV+EYcMAEAqXqYaLJq5rOZg==} + '@types/chrome@0.0.269': + resolution: {integrity: sha512-vF7x8YywnhXX2F06njQ/OE7a3Qeful43C5GUOsUksXWk89WoSFUU3iLeZW8lDpVO9atm8iZIEiLQTRC3H7NOXQ==} + + '@types/chrome@0.0.270': + resolution: {integrity: sha512-ADvkowV7YnJfycZZxL2brluZ6STGW+9oKG37B422UePf2PCXuFA/XdERI0T18wtuWPx0tmFeZqq6MOXVk1IC+Q==} + '@types/estree@1.0.5': resolution: {integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==} '@types/file-saver@2.0.7': resolution: {integrity: sha512-dNKVfHd/jk0SkR/exKGj2ggkB45MAkzvWCaqLUUgkyjITkGNzH8H+yUwr+BLJUBjZOe9w8X3wgmXhZDRg1ED6A==} + '@types/filesystem@0.0.36': + resolution: {integrity: sha512-vPDXOZuannb9FZdxgHnqSwAG/jvdGM8Wq+6N4D/d80z+D4HWH+bItqsZaVRQykAn6WEVeEkLm2oQigyHtgb0RA==} + + '@types/filewriter@0.0.33': + resolution: {integrity: sha512-xFU8ZXTw4gd358lb2jw25nxY9QAgqn2+bKKjKOYfNCzN4DKCFetK7sPtrlpg66Ywe3vWY9FNxprZawAh9wfJ3g==} + + '@types/har-format@1.2.15': + resolution: {integrity: sha512-RpQH4rXLuvTXKR0zqHq3go0RVXYv/YVqv4TnPH95VbwUxZdQlK1EtcMvQvMpDngHbt13Csh9Z4qT9AbkiQH5BA==} + '@types/hoist-non-react-statics@3.3.5': resolution: {integrity: sha512-SbcrWzkKBw2cdwRTwQAswfpB9g9LJWfjtUeW/jvNwbhC8cpmmNYVePa+ncbUe0rGTQ7G3Ff6mYUN2VMfLVr+Sg==} @@ -3053,14 +3071,9 @@ packages: utf-8-validate: optional: true - wxt@0.19.8: - resolution: {integrity: sha512-Z3LxRuM8rTZ9VOZnQ2DjtRz3uLpZpFzTfBjRVgEOHv1kf/7sRVdeKCY4pUmtimgfR2/NGclYAbCfAVTYQJg0GA==} + wxt@0.19.9: + resolution: {integrity: sha512-XUbF4JNyx2jTDpXwx2c/esaJcUD2Dr482C2GGenkGRMH2UnerzOIchGCtaa1hb2U8eAed7Akda0yRoMJU0uxUw==} hasBin: true - peerDependencies: - '@types/chrome': '*' - peerDependenciesMeta: - '@types/chrome': - optional: true xdg-basedir@5.1.0: resolution: {integrity: sha512-GCPAHLvrIH13+c0SuacwvRYj2SxJXQ4kaVTT5xgL3kPrz56XxkF21IGhjSE1+W0aw7gpBWRGXLCPnPby6lSpmQ==} @@ -3846,10 +3859,28 @@ snapshots: dependencies: '@babel/types': 7.25.6 + '@types/chrome@0.0.269': + dependencies: + '@types/filesystem': 0.0.36 + '@types/har-format': 1.2.15 + + '@types/chrome@0.0.270': + dependencies: + '@types/filesystem': 0.0.36 + '@types/har-format': 1.2.15 + '@types/estree@1.0.5': {} '@types/file-saver@2.0.7': {} + '@types/filesystem@0.0.36': + dependencies: + '@types/filewriter': 0.0.33 + + '@types/filewriter@0.0.33': {} + + '@types/har-format@1.2.15': {} + '@types/hoist-non-react-statics@3.3.5': dependencies: '@types/react': 18.3.4 @@ -3910,10 +3941,10 @@ snapshots: '@webext-core/match-patterns@1.0.3': {} - '@wxt-dev/module-react@1.1.1(vite@5.4.2(@types/node@22.5.1))(wxt@0.19.8(@types/node@22.5.1)(rollup@4.21.2))': + '@wxt-dev/module-react@1.1.1(vite@5.4.2(@types/node@22.5.1))(wxt@0.19.9(@types/node@22.5.1)(rollup@4.21.2))': dependencies: '@vitejs/plugin-react': 4.3.1(vite@5.4.2(@types/node@22.5.1)) - wxt: 0.19.8(@types/node@22.5.1)(rollup@4.21.2) + wxt: 0.19.9(@types/node@22.5.1)(rollup@4.21.2) transitivePeerDependencies: - supports-color - vite @@ -6266,9 +6297,10 @@ snapshots: ws@8.18.0: {} - wxt@0.19.8(@types/node@22.5.1)(rollup@4.21.2): + wxt@0.19.9(@types/node@22.5.1)(rollup@4.21.2): dependencies: '@aklinker1/rollup-plugin-visualizer': 5.12.0(rollup@4.21.2) + '@types/chrome': 0.0.269 '@types/webextension-polyfill': 0.10.7 '@webext-core/fake-browser': 1.3.1 '@webext-core/isolated-element': 1.1.2 @@ -6305,6 +6337,7 @@ snapshots: picocolors: 1.0.1 prompts: 2.4.2 publish-browser-extension: 2.2.1 + scule: 1.3.0 unimport: 3.11.1(rollup@4.21.2) vite: 5.4.2(@types/node@22.5.1) vite-node: 2.0.5(@types/node@22.5.1) diff --git a/wxt.config.ts b/wxt.config.ts index 728537e..9794586 100644 --- a/wxt.config.ts +++ b/wxt.config.ts @@ -2,6 +2,7 @@ import { defineConfig } from 'wxt'; export default defineConfig({ // entrypointLoader: 'jiti', + // extensionApi: 'chrome', modules: ['@wxt-dev/module-react'], manifest: { name: 'Nice Tab Manager | 标签页管理器', From b887c87ac74d56dee376152bb21257b0779518f3 Mon Sep 17 00:00:00 2001 From: web-dahuyou Date: Sat, 7 Sep 2024 17:34:02 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E5=8D=87=E7=BA=A7=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 7c59801..3258779 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "nice-tab", "description": "A nice, convenient, powerful tab manager [open source]", "private": true, - "version": "2.2.0", + "version": "2.2.1", "type": "module", "scripts": { "dev": "wxt",