create-packer 1.44.0 → 1.44.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/template/web-extension/package.json +1 -1
- package/template/web-extension/shared/components/app-context/view.tsx +1 -1
- package/template/web-extension/shared/styles/global-style.ts +9 -0
- package/template/web-extension/shared/styles/theme.styled.ts +12 -21
- package/template/web-extension/vite-env.d.ts +3 -3
- package/template/web-extension/wxt.config.ts +11 -1
- package/template/web-extension/shared/styles/global-style.tsx +0 -14
package/package.json
CHANGED
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
"qs": "6.11.2",
|
|
35
35
|
"react": "18.3.1",
|
|
36
36
|
"react-dom": "18.3.1",
|
|
37
|
+
"styled-components": "^6.1.17",
|
|
37
38
|
"type-fest": "4.33.0",
|
|
38
39
|
"zustand": "5.0.3"
|
|
39
40
|
},
|
|
@@ -41,7 +42,6 @@
|
|
|
41
42
|
"@commitlint/cli": "17.6.1",
|
|
42
43
|
"@commitlint/config-conventional": "17.6.1",
|
|
43
44
|
"@commitlint/cz-commitlint": "17.5.0",
|
|
44
|
-
"@emotion/babel-plugin": "11.13.5",
|
|
45
45
|
"@eslint/js": "9.15.0",
|
|
46
46
|
"@types/chrome": "0.0.254",
|
|
47
47
|
"@types/lodash-es": "4.17.12",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FunctionComponent, ReactNode } from 'react'
|
|
2
|
-
import { ThemeProvider } from '
|
|
2
|
+
import { ThemeProvider } from 'styled-components'
|
|
3
3
|
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
|
|
4
4
|
import { theme } from '@/shared/styles'
|
|
5
5
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { CSSProperties } from 'react'
|
|
2
|
-
|
|
3
2
|
import { isString } from 'lodash-es'
|
|
4
3
|
|
|
5
4
|
export const theme = {
|
|
@@ -9,12 +8,14 @@ export const theme = {
|
|
|
9
8
|
textOverflow: 'ellipsis',
|
|
10
9
|
whiteSpace: 'nowrap'
|
|
11
10
|
}),
|
|
12
|
-
lineClamp: (n: number) =>
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
lineClamp: (n: number) => {
|
|
12
|
+
return {
|
|
13
|
+
WebkitLineClamp: `${n}`,
|
|
14
|
+
WebkitBoxOrient: 'vertical',
|
|
15
|
+
overflow: 'hidden',
|
|
16
|
+
display: '-webkit-box'
|
|
17
|
+
} satisfies CSSProperties
|
|
18
|
+
},
|
|
18
19
|
size: (s: string) => ({ width: s, height: s }),
|
|
19
20
|
py: (s: string) => ({ paddingTop: s, paddingBottom: s }),
|
|
20
21
|
px: (s: string) => ({ paddingLeft: s, paddingRight: s }),
|
|
@@ -33,24 +34,14 @@ export const theme = {
|
|
|
33
34
|
} satisfies CSSProperties
|
|
34
35
|
},
|
|
35
36
|
/** 数字为元素数量,字符串为对应css的值 */
|
|
36
|
-
grid: {
|
|
37
|
-
|
|
37
|
+
grid: (rows: number | string, cols: number | string, gap?: number) => {
|
|
38
|
+
return {
|
|
38
39
|
display: 'grid',
|
|
39
40
|
gridTemplateRows: isString(rows) ? rows : `repeat(${rows}, minmax(0, 1fr))`,
|
|
40
41
|
gridTemplateColumns: isString(cols) ? cols : `repeat(${cols}, minmax(0, 1fr))`,
|
|
41
42
|
gap: gap ? `${gap}px` : void 0
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
display: 'grid',
|
|
45
|
-
gridTemplateRows: isString(rows) ? rows : `repeat(${rows}, minmax(0, 1fr))`,
|
|
46
|
-
rowGap: gap ? `${gap}px` : void 0
|
|
47
|
-
}),
|
|
48
|
-
cols: (cols: number | string, gap?: number) => ({
|
|
49
|
-
display: 'grid',
|
|
50
|
-
gridTemplateColumns: isString(cols) ? cols : `repeat(${cols}, minmax(0, 1fr))`,
|
|
51
|
-
columnGap: gap ? `${gap}px` : void 0
|
|
52
|
-
})
|
|
53
|
-
} satisfies Record<string, (...args: any) => CSSProperties>
|
|
43
|
+
} satisfies CSSProperties
|
|
44
|
+
}
|
|
54
45
|
}
|
|
55
46
|
}
|
|
56
47
|
export type themeType = typeof theme
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="vite/client" />
|
|
2
2
|
/// <reference types="./.wxt/wxt.d.ts" />
|
|
3
3
|
|
|
4
|
-
import '
|
|
4
|
+
import 'styled-components'
|
|
5
5
|
import { themeType } from './shared/styles'
|
|
6
6
|
|
|
7
7
|
declare global {
|
|
@@ -16,6 +16,6 @@ declare global {
|
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
declare module '
|
|
20
|
-
export interface
|
|
19
|
+
declare module 'styled-components' {
|
|
20
|
+
export interface DefaultTheme extends themeType {}
|
|
21
21
|
}
|
|
@@ -33,7 +33,17 @@ export default defineConfig({
|
|
|
33
33
|
svgr(),
|
|
34
34
|
react({
|
|
35
35
|
babel: {
|
|
36
|
-
plugins: [
|
|
36
|
+
plugins: [
|
|
37
|
+
[
|
|
38
|
+
'babel-plugin-styled-components',
|
|
39
|
+
{
|
|
40
|
+
ssr: false,
|
|
41
|
+
displayName: false,
|
|
42
|
+
fileName: false,
|
|
43
|
+
transpileTemplateLiterals: false
|
|
44
|
+
}
|
|
45
|
+
]
|
|
46
|
+
]
|
|
37
47
|
}
|
|
38
48
|
})
|
|
39
49
|
] as any,
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { FunctionComponent } from 'react'
|
|
2
|
-
import { css, Global } from '@emotion/react'
|
|
3
|
-
|
|
4
|
-
export const GlobalStyle: FunctionComponent<{ nameSpace?: string }> = props => {
|
|
5
|
-
return (
|
|
6
|
-
<Global
|
|
7
|
-
styles={css`
|
|
8
|
-
${props.nameSpace ? '.' + props.nameSpace : 'body'} {
|
|
9
|
-
margin: 0;
|
|
10
|
-
}
|
|
11
|
-
`}
|
|
12
|
-
/>
|
|
13
|
-
)
|
|
14
|
-
}
|