@coze-arch/cli 0.0.6 → 0.0.7-alpha.e6346c
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/lib/__templates__/nextjs/AGENTS.md +7 -0
- package/lib/__templates__/nextjs/package.json +2 -0
- package/lib/__templates__/nuxt-vue/AGENTS.md +7 -0
- package/lib/__templates__/nuxt-vue/eslint.config.mjs +12 -0
- package/lib/__templates__/nuxt-vue/package.json +7 -1
- package/lib/__templates__/taro/eslint.config.mjs +139 -80
- package/lib/__templates__/taro/src/app.tsx +2 -0
- package/lib/__templates__/taro/src/components/ui/carousel.tsx +4 -4
- package/lib/__templates__/taro/src/components/ui/sheet.tsx +1 -1
- package/lib/__templates__/taro/src/components/ui/toast.tsx +1 -1
- package/lib/__templates__/taro/src/presets/env.ts +1 -0
- package/lib/__templates__/taro/src/presets/h5-container.tsx +2 -1
- package/lib/__templates__/taro/src/presets/h5-error-boundary.tsx +391 -0
- package/lib/__templates__/taro/src/presets/h5-navbar.tsx +4 -3
- package/lib/__templates__/taro/src/presets/h5-styles.ts +3 -1
- package/lib/__templates__/taro/src/presets/index.tsx +15 -2
- package/lib/__templates__/vite/AGENTS.md +7 -0
- package/lib/__templates__/vite/package.json +2 -0
- package/lib/cli.js +104 -9
- package/package.json +1 -1
- package/lib/__templates__/taro/components.md +0 -1686
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
"private": true,
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "bash ./scripts/build.sh",
|
|
7
|
+
"check:all": "run-p build lint ts-check",
|
|
7
8
|
"dev": "bash ./scripts/dev.sh",
|
|
8
9
|
"preinstall": "npx only-allow pnpm",
|
|
9
10
|
"lint": "eslint",
|
|
@@ -78,6 +79,7 @@
|
|
|
78
79
|
"@types/react-dom": "^19",
|
|
79
80
|
"eslint": "^9",
|
|
80
81
|
"eslint-config-next": "16.1.1",
|
|
82
|
+
"npm-run-all2": "^8.0.4",
|
|
81
83
|
"only-allow": "^1.2.2",
|
|
82
84
|
"react-dev-inspector": "^2.0.1",
|
|
83
85
|
"shadcn": "latest",
|
|
@@ -5,11 +5,14 @@
|
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "bash ./scripts/build.sh",
|
|
8
|
+
"check:all": "run-p build lint ts-check",
|
|
8
9
|
"dev": "bash ./scripts/dev.sh",
|
|
9
10
|
"generate": "nuxt generate",
|
|
11
|
+
"lint": "eslint",
|
|
10
12
|
"preinstall": "npx only-allow pnpm",
|
|
11
13
|
"preview": "nuxt preview",
|
|
12
|
-
"start": "bash ./scripts/start.sh"
|
|
14
|
+
"start": "bash ./scripts/start.sh",
|
|
15
|
+
"ts-check": "nuxt typecheck"
|
|
13
16
|
},
|
|
14
17
|
"dependencies": {
|
|
15
18
|
"@nuxt/image": "^1.8.1",
|
|
@@ -19,10 +22,13 @@
|
|
|
19
22
|
"vue-router": "^4.6.4"
|
|
20
23
|
},
|
|
21
24
|
"devDependencies": {
|
|
25
|
+
"@nuxt/eslint": "^1.5.0",
|
|
22
26
|
"@nuxtjs/tailwindcss": "^6.14.0",
|
|
23
27
|
"@types/node": "^20",
|
|
24
28
|
"autoprefixer": "^10.4.20",
|
|
25
29
|
"coze-coding-dev-sdk": "^0.7.16",
|
|
30
|
+
"eslint": "^9",
|
|
31
|
+
"npm-run-all2": "^8.0.4",
|
|
26
32
|
"only-allow": "^1.2.2",
|
|
27
33
|
"postcss": "^8.4.49",
|
|
28
34
|
"tailwindcss": "^3.4.17",
|
|
@@ -9,6 +9,130 @@ const compat = new FlatCompat({
|
|
|
9
9
|
baseDirectory: __dirname,
|
|
10
10
|
});
|
|
11
11
|
|
|
12
|
+
const baseRestrictedSyntaxRules = [
|
|
13
|
+
{
|
|
14
|
+
selector: "MemberExpression[object.name='process'][property.name='env']",
|
|
15
|
+
message:
|
|
16
|
+
'工程规范:请勿在 src 目录下直接使用 process.env\n如需获取 URL 请求前缀,请使用已经注入全局的 PROJECT_DOMAIN',
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
selector:
|
|
20
|
+
":matches(ExportNamedDeclaration, ExportDefaultDeclaration) :matches([id.name='Network'], [declaration.id.name='Network'])",
|
|
21
|
+
message:
|
|
22
|
+
"工程规范:禁止自行定义 Network,项目已提供 src/network.ts,请直接使用: import { Network } from '@/network'",
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
selector:
|
|
26
|
+
'Literal[value=/(^|\\s)(?:[^\\s:]+:)*(bg|text|border|divide|outline|ring|ring-offset|from|to|via|decoration|shadow|accent|caret|fill|stroke)-[a-z0-9-]+\\/([0-9]+|\\[[^\\]]+\\])/], TemplateElement[value.raw=/(^|\\s)(?:[^\\s:]+:)*(bg|text|border|divide|outline|ring|ring-offset|from|to|via|decoration|shadow|accent|caret|fill|stroke)-[a-z0-9-]+\\/([0-9]+|\\[[^\\]]+\\])/]',
|
|
27
|
+
message:
|
|
28
|
+
'微信小程序兼容性:禁用 Tailwind 颜色不透明度简写(如 bg-primary/10),该语法在微信小程序下 opacity 会丢失。请拆分写(如 bg-primary bg-opacity-10)。',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
selector:
|
|
32
|
+
'Literal[value=/(^|\\s)peer-[a-z0-9-]+\\b/], TemplateElement[value.raw=/(^|\\s)peer-[a-z0-9-]+\\b/]',
|
|
33
|
+
message:
|
|
34
|
+
'微信小程序兼容性:不支持 Tailwind 的 peer-*(如 peer-checked、peer-disabled)。',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
selector:
|
|
38
|
+
'Literal[value=/(^|\\s)group-[a-z0-9-]+\\b/], TemplateElement[value.raw=/(^|\\s)group-[a-z0-9-]+\\b/]',
|
|
39
|
+
message: '微信小程序兼容性:不支持 Tailwind 的 group-*(如 group-hover)。',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
selector:
|
|
43
|
+
'Literal[value=/\\b(?!gap(?:-x|-y)?-)[a-zA-Z0-9-]+\\-[0-9]+\\.[0-9]+\\b/], TemplateElement[value.raw=/\\b(?!gap(?:-x|-y)?-)[a-zA-Z0-9-]+\\-[0-9]+\\.[0-9]+\\b/]',
|
|
44
|
+
message:
|
|
45
|
+
'微信小程序兼容性:禁用 Tailwind 小数值类名(如 space-y-1.5、w-0.5),请用整数替代(如 space-y-2、w-1)。',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
selector:
|
|
49
|
+
":matches(JSXAttribute[name.name='className'], CallExpression[callee.name=/^(cn|cva)$/]) :matches(Literal[value=/\\:has\\(/], TemplateElement[value.raw=/\\:has\\(/])",
|
|
50
|
+
message: '微信小程序兼容性:WXSS 不支持 :has(...)(会导致预览上传失败)。',
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
selector:
|
|
54
|
+
":matches(JSXAttribute[name.name='className'], CallExpression[callee.name=/^(cn|cva)$/]) :matches(Literal[value=/(^|\\s)has-[^\\s]+/], TemplateElement[value.raw=/(^|\\s)has-[^\\s]+/])",
|
|
55
|
+
message:
|
|
56
|
+
'微信小程序兼容性:禁用 Tailwind 的 has-* 变体(会生成 :has,导致预览上传失败)。',
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
selector:
|
|
60
|
+
":matches(JSXAttribute[name.name='className'], CallExpression[callee.name=/^(cn|cva)$/]) :matches(Literal[value=/\\[&>\\*/], TemplateElement[value.raw=/\\[&>\\*/])",
|
|
61
|
+
message:
|
|
62
|
+
'微信小程序兼容性:禁用 [&>*...](可能生成非法 WXSS,如 >:last-child)。请改为 [&>view] 等明确标签。',
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
selector:
|
|
66
|
+
":matches(JSXAttribute[name.name='className'], CallExpression[callee.name=/^(cn|cva)$/]) :matches(Literal[value=/\\[&[^\\]]*\\[data-/], TemplateElement[value.raw=/\\[&[^\\]]*\\[data-/])",
|
|
67
|
+
message:
|
|
68
|
+
'微信小程序兼容性:禁用 Tailwind 任意选择器里的属性选择器(如 [&>[data-...]]),可能导致预览上传失败。',
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
selector:
|
|
72
|
+
":matches(JSXAttribute[name.name='className'], CallExpression[callee.name=/^(cn|cva)$/]) :matches(Literal[value=/\\[[^\\]]*&[^\\]]*~[^\\]]*\\]/], TemplateElement[value.raw=/\\[[^\\]]*&[^\\]]*~[^\\]]*\\]/])",
|
|
73
|
+
message: '微信小程序兼容性:WXSS 不支持 ~(会导致预览上传失败)。',
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
selector:
|
|
77
|
+
"JSXAttribute[name.name='color'][value.type='Literal'][value.value='currentColor'], JSXAttribute[name.name='color'] > JSXExpressionContainer > Literal[value='currentColor']",
|
|
78
|
+
message:
|
|
79
|
+
'lucide-react-taro 规范:禁止使用 color="currentColor",小程序端不会按预期继承颜色。请改为显式颜色值,或通过 LucideTaroProvider 提供默认颜色。',
|
|
80
|
+
},
|
|
81
|
+
];
|
|
82
|
+
|
|
83
|
+
const pageRestrictedSyntaxRules = [
|
|
84
|
+
{
|
|
85
|
+
selector:
|
|
86
|
+
"ImportDeclaration[source.value='@tarojs/components'] ImportSpecifier[imported.name='Button']",
|
|
87
|
+
message:
|
|
88
|
+
"组件规范:Button 优先使用 '@/components/ui/button',不要在页面中直接使用 '@tarojs/components' 的 Button。",
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
selector:
|
|
92
|
+
"ImportDeclaration[source.value='@tarojs/components'] ImportSpecifier[imported.name='Input']",
|
|
93
|
+
message:
|
|
94
|
+
"组件规范:Input 优先使用 '@/components/ui/input',不要在页面中直接使用 '@tarojs/components' 的 Input。",
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
selector:
|
|
98
|
+
"ImportDeclaration[source.value='@tarojs/components'] ImportSpecifier[imported.name='Textarea']",
|
|
99
|
+
message:
|
|
100
|
+
"组件规范:Textarea 优先使用 '@/components/ui/textarea',不要在页面中直接使用 '@tarojs/components' 的 Textarea。",
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
selector:
|
|
104
|
+
"ImportDeclaration[source.value='@tarojs/components'] ImportSpecifier[imported.name='Label']",
|
|
105
|
+
message:
|
|
106
|
+
"组件规范:Label 优先使用 '@/components/ui/label',不要在页面中直接使用 '@tarojs/components' 的 Label。",
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
selector:
|
|
110
|
+
"ImportDeclaration[source.value='@tarojs/components'] ImportSpecifier[imported.name='Switch']",
|
|
111
|
+
message:
|
|
112
|
+
"组件规范:Switch 优先使用 '@/components/ui/switch',不要在页面中直接使用 '@tarojs/components' 的 Switch。",
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
selector:
|
|
116
|
+
"ImportDeclaration[source.value='@tarojs/components'] ImportSpecifier[imported.name='Slider']",
|
|
117
|
+
message:
|
|
118
|
+
"组件规范:Slider 优先使用 '@/components/ui/slider',不要在页面中直接使用 '@tarojs/components' 的 Slider。",
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
selector:
|
|
122
|
+
"ImportDeclaration[source.value='@tarojs/components'] ImportSpecifier[imported.name='Progress']",
|
|
123
|
+
message:
|
|
124
|
+
"组件规范:Progress 优先使用 '@/components/ui/progress',不要在页面中直接使用 '@tarojs/components' 的 Progress。",
|
|
125
|
+
},
|
|
126
|
+
];
|
|
127
|
+
|
|
128
|
+
const indexPageRestrictedSyntaxRules = [
|
|
129
|
+
{
|
|
130
|
+
selector: 'JSXText[value=/\\s*应用开发中\\s*/]',
|
|
131
|
+
message:
|
|
132
|
+
'工程规范:检测到首页 (src/pages/index/index.tsx) 仍为默认占位页面,这会导致用户无法进入新增页面,请根据用户需求开发实际的首页功能与界面。如果已经开发了新的首页,也需要删除旧首页,并更新 src/app.config.ts 文件',
|
|
133
|
+
},
|
|
134
|
+
];
|
|
135
|
+
|
|
12
136
|
export default [
|
|
13
137
|
...compat.extends('taro/react'),
|
|
14
138
|
{
|
|
@@ -25,80 +149,7 @@ export default [
|
|
|
25
149
|
files: ['src/**/*.{js,jsx,ts,tsx}'],
|
|
26
150
|
ignores: ['src/network.ts'],
|
|
27
151
|
rules: {
|
|
28
|
-
'no-restricted-syntax': [
|
|
29
|
-
'error',
|
|
30
|
-
{
|
|
31
|
-
selector:
|
|
32
|
-
"MemberExpression[object.name='process'][property.name='env']",
|
|
33
|
-
message:
|
|
34
|
-
'工程规范:请勿在 src 目录下直接使用 process.env\n如需获取 URL 请求前缀,请使用已经注入全局的 PROJECT_DOMAIN',
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
selector:
|
|
38
|
-
":matches(ExportNamedDeclaration, ExportDefaultDeclaration) :matches([id.name='Network'], [declaration.id.name='Network'])",
|
|
39
|
-
message:
|
|
40
|
-
"工程规范:禁止自行定义 Network,项目已提供 src/network.ts,请直接使用: import { Network } from '@/network'",
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
selector:
|
|
44
|
-
'Literal[value=/(^|\\s)(?:[^\\s:]+:)*(bg|text|border|divide|outline|ring|ring-offset|from|to|via|decoration|shadow|accent|caret|fill|stroke)-[a-z0-9-]+\\/([0-9]+|\\[[^\\]]+\\])/], TemplateElement[value.raw=/(^|\\s)(?:[^\\s:]+:)*(bg|text|border|divide|outline|ring|ring-offset|from|to|via|decoration|shadow|accent|caret|fill|stroke)-[a-z0-9-]+\\/([0-9]+|\\[[^\\]]+\\])/]',
|
|
45
|
-
message:
|
|
46
|
-
'微信小程序兼容性:禁用 Tailwind 颜色不透明度简写(如 bg-primary/10),该语法在微信小程序下 opacity 会丢失。请拆分写(如 bg-primary bg-opacity-10)。',
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
selector:
|
|
50
|
-
'Literal[value=/(^|\\s)peer-[a-z0-9-]+\\b/], TemplateElement[value.raw=/(^|\\s)peer-[a-z0-9-]+\\b/]',
|
|
51
|
-
message:
|
|
52
|
-
'微信小程序兼容性:不支持 Tailwind 的 peer-*(如 peer-checked、peer-disabled)。',
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
selector:
|
|
56
|
-
'Literal[value=/(^|\\s)group-[a-z0-9-]+\\b/], TemplateElement[value.raw=/(^|\\s)group-[a-z0-9-]+\\b/]',
|
|
57
|
-
message:
|
|
58
|
-
'微信小程序兼容性:不支持 Tailwind 的 group-*(如 group-hover)。',
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
selector:
|
|
62
|
-
'Literal[value=/\\b(?!gap(?:-x|-y)?-)[a-zA-Z0-9-]+\\-[0-9]+\\.[0-9]+\\b/], TemplateElement[value.raw=/\\b(?!gap(?:-x|-y)?-)[a-zA-Z0-9-]+\\-[0-9]+\\.[0-9]+\\b/]',
|
|
63
|
-
message:
|
|
64
|
-
'微信小程序兼容性:禁用 Tailwind 小数值类名(如 space-y-1.5、w-0.5),请用整数替代(如 space-y-2、w-1)。',
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
selector:
|
|
68
|
-
":matches(JSXAttribute[name.name='className'], CallExpression[callee.name=/^(cn|cva)$/]) :matches(Literal[value=/\\:has\\(/], TemplateElement[value.raw=/\\:has\\(/])",
|
|
69
|
-
message:
|
|
70
|
-
'微信小程序兼容性:WXSS 不支持 :has(...)(会导致预览上传失败)。',
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
selector:
|
|
74
|
-
":matches(JSXAttribute[name.name='className'], CallExpression[callee.name=/^(cn|cva)$/]) :matches(Literal[value=/(^|\\s)has-[^\\s]+/], TemplateElement[value.raw=/(^|\\s)has-[^\\s]+/])",
|
|
75
|
-
message:
|
|
76
|
-
'微信小程序兼容性:禁用 Tailwind 的 has-* 变体(会生成 :has,导致预览上传失败)。',
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
selector:
|
|
80
|
-
":matches(JSXAttribute[name.name='className'], CallExpression[callee.name=/^(cn|cva)$/]) :matches(Literal[value=/\\[&>\\*/], TemplateElement[value.raw=/\\[&>\\*/])",
|
|
81
|
-
message:
|
|
82
|
-
'微信小程序兼容性:禁用 [&>*...](可能生成非法 WXSS,如 >:last-child)。请改为 [&>view] 等明确标签。',
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
selector:
|
|
86
|
-
":matches(JSXAttribute[name.name='className'], CallExpression[callee.name=/^(cn|cva)$/]) :matches(Literal[value=/\\[&[^\\]]*\\[data-/], TemplateElement[value.raw=/\\[&[^\\]]*\\[data-/])",
|
|
87
|
-
message:
|
|
88
|
-
'微信小程序兼容性:禁用 Tailwind 任意选择器里的属性选择器(如 [&>[data-...]]),可能导致预览上传失败。',
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
selector:
|
|
92
|
-
":matches(JSXAttribute[name.name='className'], CallExpression[callee.name=/^(cn|cva)$/]) :matches(Literal[value=/\\[[^\\]]*&[^\\]]*~[^\\]]*\\]/], TemplateElement[value.raw=/\\[[^\\]]*&[^\\]]*~[^\\]]*\\]/])",
|
|
93
|
-
message: '微信小程序兼容性:WXSS 不支持 ~(会导致预览上传失败)。',
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
selector:
|
|
97
|
-
"JSXAttribute[name.name='color'][value.type='Literal'][value.value='currentColor'], JSXAttribute[name.name='color'] > JSXExpressionContainer > Literal[value='currentColor']",
|
|
98
|
-
message:
|
|
99
|
-
'lucide-react-taro 规范:禁止使用 color="currentColor",小程序端不会按预期继承颜色。请改为显式颜色值,或通过 LucideTaroProvider 提供默认颜色。',
|
|
100
|
-
},
|
|
101
|
-
],
|
|
152
|
+
'no-restricted-syntax': ['error', ...baseRestrictedSyntaxRules],
|
|
102
153
|
'no-restricted-properties': [
|
|
103
154
|
'error',
|
|
104
155
|
{
|
|
@@ -123,15 +174,23 @@ export default [
|
|
|
123
174
|
},
|
|
124
175
|
},
|
|
125
176
|
{
|
|
126
|
-
files: ['src/pages
|
|
177
|
+
files: ['src/pages/**/*.tsx'],
|
|
127
178
|
rules: {
|
|
128
179
|
'no-restricted-syntax': [
|
|
129
180
|
'error',
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
181
|
+
...baseRestrictedSyntaxRules,
|
|
182
|
+
...pageRestrictedSyntaxRules,
|
|
183
|
+
],
|
|
184
|
+
},
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
files: ['src/pages/index/index.tsx'],
|
|
188
|
+
rules: {
|
|
189
|
+
'no-restricted-syntax': [
|
|
190
|
+
'error',
|
|
191
|
+
...baseRestrictedSyntaxRules,
|
|
192
|
+
...pageRestrictedSyntaxRules,
|
|
193
|
+
...indexPageRestrictedSyntaxRules,
|
|
135
194
|
],
|
|
136
195
|
},
|
|
137
196
|
},
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
2
|
import { LucideTaroProvider } from 'lucide-react-taro';
|
|
3
3
|
import '@/app.css';
|
|
4
|
+
import { Toaster } from '@/components/ui/toast';
|
|
4
5
|
import { Preset } from './presets';
|
|
5
6
|
|
|
6
7
|
const App = ({ children }: PropsWithChildren) => {
|
|
7
8
|
return (
|
|
8
9
|
<LucideTaroProvider defaultColor="#000" defaultSize={24}>
|
|
9
10
|
<Preset>{children}</Preset>
|
|
11
|
+
<Toaster />
|
|
10
12
|
</LucideTaroProvider>
|
|
11
13
|
);
|
|
12
14
|
};
|
|
@@ -175,8 +175,8 @@ const CarouselPrevious = React.forwardRef<
|
|
|
175
175
|
className={cn(
|
|
176
176
|
"absolute h-8 w-8 rounded-full z-10 bg-background bg-opacity-80 backdrop-blur-sm",
|
|
177
177
|
orientation === "horizontal"
|
|
178
|
-
? "-left-12 top-
|
|
179
|
-
: "-top-12 left-
|
|
178
|
+
? "-left-12 top-0 bottom-0 my-auto"
|
|
179
|
+
: "-top-12 left-0 right-0 mx-auto rotate-90",
|
|
180
180
|
className
|
|
181
181
|
)}
|
|
182
182
|
disabled={!canScrollPrev}
|
|
@@ -204,8 +204,8 @@ const CarouselNext = React.forwardRef<
|
|
|
204
204
|
className={cn(
|
|
205
205
|
"absolute h-8 w-8 rounded-full z-10 bg-background bg-opacity-80 backdrop-blur-sm",
|
|
206
206
|
orientation === "horizontal"
|
|
207
|
-
? "-right-12 top-
|
|
208
|
-
: "-bottom-12 left-
|
|
207
|
+
? "-right-12 top-0 bottom-0 my-auto"
|
|
208
|
+
: "-bottom-12 left-0 right-0 mx-auto rotate-90",
|
|
209
209
|
className
|
|
210
210
|
)}
|
|
211
211
|
disabled={!canScrollNext}
|
|
@@ -179,7 +179,7 @@ const SheetContent = React.forwardRef<
|
|
|
179
179
|
>
|
|
180
180
|
{children}
|
|
181
181
|
<View
|
|
182
|
-
className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary"
|
|
182
|
+
className="absolute right-4 top-4 flex h-8 w-8 items-center justify-center rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary"
|
|
183
183
|
data-state={state}
|
|
184
184
|
onClick={(e) => {
|
|
185
185
|
e.stopPropagation()
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const IS_H5_ENV = TARO_ENV === 'h5';
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { IS_H5_ENV } from './env';
|
|
2
3
|
import { H5NavBar } from './h5-navbar';
|
|
3
4
|
|
|
4
5
|
export const H5Container = ({ children }: PropsWithChildren) => {
|
|
5
|
-
if (
|
|
6
|
+
if (!IS_H5_ENV) {
|
|
6
7
|
return <>{children}</>;
|
|
7
8
|
}
|
|
8
9
|
|