Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/packages/address/address.scss
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@
font-size: 12px;
border-radius: 4px;
margin-bottom: 7px;
/* #ifdef harmony*/
/* #ifdef harmony dynamic*/
margin-right: 6px;
/* #endif */
/* #ifndef harmony*/
/* #ifndef harmony dynamic*/
margin-right: 7px;
/* #endif */
Comment on lines +70 to 75
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

条件编译更新与整体策略保持一致

条件编译标志的更新(添加 dynamic 后缀)与其他 SCSS 文件的改动保持一致,这种统一的更新模式表明是为了支持新的 td 平台环境。

建议验证所有相关文件中的条件编译更新都已完成,确保平台适配的完整性。


🏁 Script executed:

#!/bin/bash
# 检查所有 SCSS 文件中是否还有未更新的 harmony 条件编译
rg "#ifdef harmony[^[:space:]]" --type scss
rg "#ifndef harmony[^[:space:]]" --type scss

Length of output: 150


由于 ripgrep 默认不识别 scss 类型,建议改为按扩展名匹配并重新扫描:


🏁 Script executed:

#!/bin/bash
# 检查所有 SCSS 文件中是否还有未更新的 harmony 条件编译
rg "#ifdef harmony" -g '*.scss'
rg "#ifndef harmony" -g '*.scss'

Length of output: 1758


请统一更新 SCSS 条件编译标志至 dynamic 后缀

经扫描,以下文件中仍存在未加 dynamic 后缀的 harmony 条件编译,需要同步更新:

  • src/styles/variables.scss
    • /* #ifdef harmony */
    • /* #ifndef harmony */
  • src/styles/variables-jrkf.scss
    • /* #ifdef harmony */
    • /* #ifndef harmony */
  • src/styles/variables-jmapp.scss
    • /* #ifdef harmony */
    • /* #ifndef harmony */

建议将以上标志修改为:

- /* #ifdef harmony */
+ /* #ifdef harmony dynamic */
- /* #ifndef harmony */
+ /* #ifndef harmony dynamic */

其他组件中的条件编译已按该策略更新,请确保所有 SCSS 文件保持一致。

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In src/packages/address/address.scss around lines 70 to 75, the conditional
compilation flags for harmony have been updated to include the dynamic suffix.
However, similar flags in src/styles/variables.scss,
src/styles/variables-jrkf.scss, and src/styles/variables-jmapp.scss still use
the old format without the dynamic suffix. To fix this, update all occurrences
of /* #ifdef harmony */ and /* #ifndef harmony */ in these files to /* #ifdef
harmony dynamic */ and /* #ifndef harmony dynamic */ respectively, ensuring
consistency across all SCSS files for platform adaptation.

background-color: $color-background-sunken;
Expand Down
4 changes: 2 additions & 2 deletions src/packages/avatar/avatar.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
import { User } from '@nutui/icons-react-taro'
import { AvatarContext } from '@/packages/avatargroup/context'
import { ComponentDefaults } from '@/utils/typings'
import { harmony } from '@/utils/taro/platform'
import { harmony, td } from '@/utils/taro/platform'
import AvatarGroup from '@/packages/avatargroup/index.taro'
import { pxTransform } from '@/utils/taro/px-transform'
import { TaroAvatarProps } from '@/types'

const defaultProps = {
...ComponentDefaults,
size: harmony() ? '40' : '',
size: harmony() || td() ? '40' : '',
shape: 'round',
icon: '',
background: '#eee',
Expand Down Expand Up @@ -104,7 +104,7 @@
) {
setShowMax(true)
}
}, [avatarIndex, groupCount])

Check warning on line 107 in src/packages/avatar/avatar.taro.tsx

View workflow job for this annotation

GitHub Actions / lint

React Hook useEffect has a missing dependency: 'groupMax'. Either include it or remove the dependency array

const errorEvent = () => {
onError && onError()
Expand Down
9 changes: 5 additions & 4 deletions src/packages/avatar/demos/taro/demo4.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
import React from 'react'
import { Avatar, Cell, harmony } from '@nutui/nutui-react-taro'
import { Avatar, Cell, harmony, td } from '@nutui/nutui-react-taro'
import { User } from '@nutui/icons-react-taro'

const Demo4 = () => {
const styles = { marginRight: 30 }
const variableDisabled = harmony() || td()
return (
<Cell className="cell-avatar">
<Avatar
color="#ffffff"
background={`${harmony() ? '#ff0f23' : 'var(--nutui-color-primary)'}`}
background={`${variableDisabled ? '#ff0f23' : 'var(--nutui-color-primary)'}`}
icon={<User />}
style={styles}
/>
<Avatar
color={`${harmony() ? '#ff0f23' : 'var(--nutui-color-primary)'}`}
background={`${harmony() ? '#ffebf1' : 'var(--nutui-color-primary-light-pressed)'}`}
color={`${variableDisabled ? '#ff0f23' : 'var(--nutui-color-primary)'}`}
background={`${variableDisabled ? '#ffebf1' : 'var(--nutui-color-primary-light-pressed)'}`}
>
U
</Avatar>
Expand Down
11 changes: 6 additions & 5 deletions src/packages/avatar/demos/taro/demo6.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
import React from 'react'
import { Avatar, Cell, harmony } from '@nutui/nutui-react-taro'
import { Avatar, Cell, harmony, td } from '@nutui/nutui-react-taro'
import { User } from '@nutui/icons-react-taro'

const Demo6 = () => {
const variableDisabled = harmony() || td()
return (
<>
<Cell>
<Avatar.Group gap="-4">
<Avatar src="https://img12.360buyimg.com/imagetools/jfs/t1/196430/38/8105/14329/60c806a4Ed506298a/e6de9fb7b8490f38.png" />
<Avatar icon={<User />} />
<Avatar
color={`${harmony() ? '#ff0f23' : 'var(--nutui-color-primary)'}`}
background={`${harmony() ? '#ffd6e1' : 'var(--nutui-brand-2)'}`}
color={`${variableDisabled ? '#ff0f23' : 'var(--nutui-color-primary)'}`}
background={`${variableDisabled ? '#ffd6e1' : 'var(--nutui-brand-2)'}`}
>
U
</Avatar>
Expand All @@ -22,8 +23,8 @@ const Demo6 = () => {
<Avatar src="https://img12.360buyimg.com/imagetools/jfs/t1/196430/38/8105/14329/60c806a4Ed506298a/e6de9fb7b8490f38.png" />
<Avatar icon={<User />} />
<Avatar
color={`${harmony() ? '#ff0f23' : 'var(--nutui-color-primary)'}`}
background={`${harmony() ? '#ffd6e1' : 'var(--nutui-brand-2)'}`}
color={`${variableDisabled ? '#ff0f23' : 'var(--nutui-color-primary)'}`}
background={`${variableDisabled ? '#ffd6e1' : 'var(--nutui-brand-2)'}`}
>
U
</Avatar>
Expand Down
7 changes: 4 additions & 3 deletions src/packages/avatar/demos/taro/demo7.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import React from 'react'
import { Avatar, Cell, harmony } from '@nutui/nutui-react-taro'
import { Avatar, Cell, harmony, td } from '@nutui/nutui-react-taro'
import { User } from '@nutui/icons-react-taro'

const Demo7 = () => {
const variableDisabled = harmony() || td()
return (
<Cell className="cell-avatar">
<Avatar.Group max="3" level="right" maxContent="...">
<Avatar src="https://img12.360buyimg.com/imagetools/jfs/t1/196430/38/8105/14329/60c806a4Ed506298a/e6de9fb7b8490f38.png" />
<Avatar icon={<User />} />
<Avatar
color={`${harmony() ? '#ff0f23' : 'var(--nutui-color-primary)'}`}
background={`${harmony() ? '#ffd6e1' : 'var(--nutui-brand-2)'}`}
color={`${variableDisabled ? '#ff0f23' : 'var(--nutui-color-primary)'}`}
background={`${variableDisabled ? '#ffd6e1' : 'var(--nutui-brand-2)'}`}
>
U
</Avatar>
Expand Down
6 changes: 3 additions & 3 deletions src/packages/button/button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
position: relative;
display: flex;
display: inline-block;
/* #ifdef harmony*/
/* #ifdef harmony dynamic*/
width: 80px;
/* #endif */
/* #ifndef harmony*/
/* #ifndef harmony dynamic*/
width: auto;
/* #endif */
flex-direction: row;
Expand Down Expand Up @@ -72,7 +72,7 @@
flex-direction: row;
align-items: center;
justify-content: center;
/* #ifndef harmony */
/* #ifndef harmony dynamic*/
background: initial;
/* #endif */
.nut-icon {
Expand Down
4 changes: 2 additions & 2 deletions src/packages/collapseitem/collapseitem.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@
left: 16px;
bottom: 0;
border-bottom: $collapse-item-header-border-bottom;
/* #ifdef harmony */
/* #ifdef harmony dynamic*/
transform: scale(1, 1);
/* #endif */
/* #ifndef harmony */
/* #ifndef harmony dynamic*/
transform: scale(1, 0.5);
/* #endif */
}
Expand Down
2 changes: 1 addition & 1 deletion src/packages/dialog/dialog.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
align-items: center;
width: $dialog-width;
min-width: $dialog-min-width;
/* #ifndef harmony*/
/* #ifndef harmony dynamic*/
max-height: 67%;
/* #endif */
min-height: $dialog-min-height;
Expand Down
File renamed without changes.
3 changes: 2 additions & 1 deletion src/packages/icon/demos/h5/demo6.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react'
import { IconFontConfig, IconFont } from '@nutui/icons-react'
import { Cell, Toast, camelCase } from '@nutui/nutui-react'
import { Cell, Toast } from '@nutui/nutui-react'
import { camelCase } from '../camel-case'

const generateCopyText = (name: string) => {
return `<${camelCase(name, { pascalCase: true })} />`
Expand Down
3 changes: 2 additions & 1 deletion src/packages/icon/demos/h5/demo7.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react'
import { IconFontConfig, IconFont } from '@nutui/icons-react'
import { Cell, Toast, camelCase } from '@nutui/nutui-react'
import { Cell, Toast } from '@nutui/nutui-react'
import { camelCase } from '../camel-case'

const generateAMCopyText = (icon: any) => {
return `<${camelCase(icon.name, {
Expand Down
3 changes: 2 additions & 1 deletion src/packages/icon/demos/taro/demo6.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React, { useState } from 'react'
import * as iconfonts from '@nutui/icons-react-taro'
import { Cell, Toast, camelCase } from '@nutui/nutui-react-taro'
import { Cell, Toast } from '@nutui/nutui-react-taro'
import { View } from '@tarojs/components'
import { camelCase } from '../camel-case'

const Demo6 = () => {
const generateCopyText = (name: string) => {
Expand Down
3 changes: 2 additions & 1 deletion src/packages/icon/demos/taro/demo7.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React, { useState } from 'react'
import * as iconfonts from '@nutui/icons-react-taro'
import { Cell, Toast, camelCase } from '@nutui/nutui-react-taro'
import { Cell, Toast } from '@nutui/nutui-react-taro'
import { View } from '@tarojs/components'
import { camelCase } from '../camel-case'

const Demo7 = () => {
const generateAMCopyText = (icon: any) => {
Expand Down
5 changes: 0 additions & 5 deletions src/packages/indicator/demo.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,14 @@ const IndicatorDemo = () => {
<ScrollView className={`demo ${Taro.getEnv() === 'WEB' ? 'web' : ''}`}>
<View className="h2">{translated.basic}</View>
<Demo1 />

<View className="h2">{translated.white}</View>
<Demo5 />

<View className="h2">{translated.type}</View>
<Demo6 />

<View className="h2">{translated.customNode}</View>
<Demo2 />

<View className="h2">{translated.custom}</View>
<Demo3 />

<View className="h2">{translated.vertical}</View>
<Demo4 />
</ScrollView>
Expand Down
10 changes: 1 addition & 9 deletions src/packages/indicator/demos/taro/demo4.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,7 @@ const Demo4 = () => {
/>
</Cell>
<Cell style={{ background: '#C2C4CC' }}>
<Indicator
total={6}
current={2}
direction="vertical"
color="default"
style={{
marginLeft: pxTransform(50),
}}
/>
<Indicator total={6} current={2} direction="vertical" color="default" />
</Cell>
</>
)
Expand Down
5 changes: 1 addition & 4 deletions src/packages/loading/loading.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ const defaultProps = {
type: 'circular',
direction: 'horizontal',
} as TaroLoadingProps
const defaultLottieProps = {
loop: true,
autoplay: true,
}

export const Loading = React.forwardRef<LoadingRef, Partial<TaroLoadingProps>>(
(props, ref) => {
const { className, style, children, direction, icon, ...rest } = {
Expand Down
4 changes: 2 additions & 2 deletions src/packages/numberkeyboard/numberkeyboard.scss
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@
&-wrapper {
position: relative;
flex: 1;
/* #ifdef harmony */
/* #ifdef harmony dynamic*/
width: 33%;
/* #endif */
/* #ifndef harmony */
/* #ifndef harmony dynamic*/
flex-basis: 33%;
/* #endif */
box-sizing: border-box;
Expand Down
6 changes: 3 additions & 3 deletions src/packages/pagination/demos/taro/demo5.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState } from 'react'
import { View } from '@tarojs/components'
import { Text } from '@tarojs/components'
import { Pagination } from '@nutui/nutui-react-taro'
import { ArrowLeft, ArrowRight } from '@nutui/icons-react-taro'

Expand All @@ -11,9 +11,9 @@ const Demo5 = () => {
}
const itemRender = (page: any, current: number) => {
return (
<View style={{ color: current === page.number ? '#fff' : '#ff0f23' }}>
<Text style={{ color: current === page.number ? '#fff' : '#ff0f23' }}>
{page.number === 3 ? 'hot' : page.text}
</View>
</Text>
)
}
return (
Expand Down
8 changes: 4 additions & 4 deletions src/packages/pagination/pagination.taro.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { FunctionComponent } from 'react'
import classNames from 'classnames'
import { View } from '@tarojs/components'
import { View, Text } from '@tarojs/components'
import { useConfig } from '@/packages/configprovider/index.taro'
import { usePropsValue } from '@/hooks/use-props-value'
import { ComponentDefaults } from '@/utils/typings'
Expand Down Expand Up @@ -134,9 +134,9 @@ export const Pagination: FunctionComponent<
)}
{mode === 'lite' && (
<View className={`${classPrefix}-lite`}>
<View className={`${classPrefix}-lite-active`}>{current}</View>
<View className={`${classPrefix}-lite-spliterator`}>/</View>
<View className={`${classPrefix}-lite-default`}>{pageCount}</View>
<Text className={`${classPrefix}-lite-active`}>{current}</Text>
<Text className={`${classPrefix}-lite-spliterator`}>/</Text>
<Text className={`${classPrefix}-lite-default`}>{pageCount}</Text>
</View>
)}
</View>
Expand Down
5 changes: 3 additions & 2 deletions src/packages/skeleton/demos/taro/demo4.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import React from 'react'
import { Cell, Skeleton, pxTransform } from '@nutui/nutui-react-taro'
import { View } from '@tarojs/components'

const Demo4 = () => {
return (
<Cell>
<Skeleton width={pxTransform(132)} height={pxTransform(132)} />
<div
<View
style={{
display: 'flex',
flexGrow: 1,
Expand All @@ -16,7 +17,7 @@ const Demo4 = () => {
<Skeleton size="large" style={{ marginBottom: pxTransform(5) }} />
<Skeleton width="30%" style={{ marginBottom: pxTransform(5) }} />
<Skeleton width="80%" size="small" rows={3} />
</div>
</View>
</Cell>
)
}
Expand Down
2 changes: 1 addition & 1 deletion src/packages/steps/steps.scss
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@

// 纵向滚动条
&-vertical {
/* #ifdef harmony*/
/* #ifdef harmony dynamic*/
flex: 1;
min-width: 0;
/* #endif */
Expand Down
8 changes: 4 additions & 4 deletions src/packages/tabbaritem/tabbaritem.scss
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
width: 24px;
height: 24px;
font-size: 24px;
/* #ifdef harmony*/
/* #ifdef harmony dynamic*/
color: $tabbar-inactive-color;
/* #endif*/
/* #ifndef harmony*/
/* #ifndef harmony dynamic*/
color: inherit;
/* #endif*/
}
Expand Down Expand Up @@ -54,10 +54,10 @@

.nut-tabbar-item-text,
.nut-icon {
/* #ifdef harmony*/
/* #ifdef harmony dynamic*/
color: $tabbar-active-color;
/* #endif*/
/* #ifndef harmony*/
/* #ifndef harmony dynamic*/
color: inherit;
/* #endif*/
}
Expand Down
4 changes: 2 additions & 2 deletions src/packages/tabs/tabs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -214,10 +214,10 @@
.nut-tabs-vertical {
.nut-tabs-ellipsis {
white-space: break-spaces;
/* #ifdef harmony */
/* #ifdef harmony dynamic*/
padding-left: 12px;
/* #endif */
/* #ifndef harmony */
/* #ifndef harmony dynamic*/
padding-left: 6px;
/* #endif */
width: 90px;
Expand Down
4 changes: 2 additions & 2 deletions src/packages/toast/toast.scss
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
}

&-overlay-default-taro {
/* #ifdef harmony */
/* #ifdef harmony dynamic*/
background-color: rgba(0, 0, 0, 0);
/* #endif */
/* #ifndef harmony */
/* #ifndef harmony dynamic*/
--nutui-overlay-bg-color: rgba(0, 0, 0, 0);
/* #endif */
}
Expand Down
1 change: 0 additions & 1 deletion src/utils/index.taro.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
export * from './taro/add-color-for-harmony'
export * from './bound'
export * from './camel-case'
export * from './can-use-dom'
export * from './clamp'
export * from './date'
Expand Down
1 change: 0 additions & 1 deletion src/utils/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
export * from './bound'
export * from './camel-case'
export * from './can-use-dom'
export * from './clamp'
export * from './date'
Expand Down
4 changes: 4 additions & 0 deletions src/utils/taro/platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@ export const web = () => {
export const miniprogram = () => {
return ['mini'].includes(getEnv().toLowerCase())
}

export const td = () => {
return ['dynamic'].includes(getEnv().toLowerCase())
}
Loading
Loading