@coze-arch/cli 0.0.25 → 0.0.26

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.
@@ -1,6 +1,7 @@
1
1
  import * as React from "react"
2
2
  import { View } from "@tarojs/components"
3
- import Taro, { type ITouchEvent } from "@tarojs/taro"
3
+ import Taro from "@tarojs/taro"
4
+ import { type ITouchEvent } from "@tarojs/components"
4
5
 
5
6
  import { cn } from "@/lib/utils"
6
7
 
@@ -27,7 +28,7 @@ const Slider = React.forwardRef<
27
28
  const [rect, setRect] = React.useState<{ left: number; top: number; width: number; height: number } | null>(null)
28
29
  const rectRef = React.useRef<{ left: number; top: number; width: number; height: number } | null>(null)
29
30
  const idRef = React.useRef(`slider-${Math.random().toString(36).substr(2, 9)}`)
30
-
31
+
31
32
  const value = valueProp !== undefined ? valueProp : localValue
32
33
  const currentValue = value[0] ?? min
33
34
 
@@ -69,7 +70,7 @@ const Slider = React.forwardRef<
69
70
  const rawValue = min + percentage * (max - min)
70
71
  const steppedValue = Math.round((rawValue - min) / step) * step + min
71
72
  const newValue = Math.min(Math.max(steppedValue, min), max)
72
-
73
+
73
74
  if (newValue !== currentValue) {
74
75
  const nextValue = [newValue]
75
76
  if (valueProp === undefined) {
@@ -104,7 +105,7 @@ const Slider = React.forwardRef<
104
105
  const handleMouseDown = (e: React.MouseEvent) => {
105
106
  if (disabled) return
106
107
  setIsDragging(true)
107
-
108
+
108
109
  const query = Taro.createSelectorQuery()
109
110
  query
110
111
  .select(`#${idRef.current}`)
@@ -170,16 +171,16 @@ const Slider = React.forwardRef<
170
171
  onMouseDown={handleMouseDown}
171
172
  {...props}
172
173
  >
173
- <View
174
+ <View
174
175
  className={cn(
175
176
  "relative grow overflow-hidden rounded-full bg-secondary",
176
177
  orientation === "horizontal" ? "h-1 w-full" : "w-1 h-full",
177
178
  trackClassName
178
179
  )}
179
180
  >
180
- <View
181
- className={cn("absolute bg-primary", orientation === "horizontal" ? "h-full" : "w-full bottom-0", rangeClassName)}
182
- style={orientation === "horizontal" ? { width: `${percentage}%` } : { height: `${percentage}%` }}
181
+ <View
182
+ className={cn("absolute bg-primary", orientation === "horizontal" ? "h-full" : "w-full bottom-0", rangeClassName)}
183
+ style={orientation === "horizontal" ? { width: `${percentage}%` } : { height: `${percentage}%` }}
183
184
  />
184
185
  </View>
185
186
  <View
@@ -190,8 +191,8 @@ const Slider = React.forwardRef<
190
191
  thumbClassName
191
192
  )}
192
193
  style={
193
- orientation === "horizontal"
194
- ? { left: `${percentage}%`, transform: 'translateX(-50%)' }
194
+ orientation === "horizontal"
195
+ ? { left: `${percentage}%`, transform: 'translateX(-50%)' }
195
196
  : { bottom: `${percentage}%`, transform: 'translateY(50%)' }
196
197
  }
197
198
  />
@@ -1,6 +1,5 @@
1
1
  import * as React from "react"
2
- import { View } from "@tarojs/components"
3
- import { type ITouchEvent } from "@tarojs/taro"
2
+ import { View, type ITouchEvent } from "@tarojs/components"
4
3
  import { cn } from "@/lib/utils"
5
4
 
6
5
  const TabsContext = React.createContext<{
@@ -18,7 +17,7 @@ const Tabs = React.forwardRef<
18
17
  >(({ className, value: valueProp, defaultValue, onValueChange, ...props }, ref) => {
19
18
  const [valueState, setValueState] = React.useState<string | undefined>(defaultValue)
20
19
  const value = valueProp !== undefined ? valueProp : valueState
21
-
20
+
22
21
  const handleValueChange = (newValue: string) => {
23
22
  if (valueProp === undefined) {
24
23
  setValueState(newValue)
@@ -62,7 +61,7 @@ const TabsTrigger = React.forwardRef<
62
61
  >(({ className, value, onClick, disabled, ...props }, ref) => {
63
62
  const context = React.useContext(TabsContext)
64
63
  const isActive = context?.value === value
65
-
64
+
66
65
  const handleClick = (e: ITouchEvent) => {
67
66
  if (disabled) return
68
67
  context?.onValueChange?.(value)
@@ -12,7 +12,7 @@ const toNumber = (v: unknown) => {
12
12
  return 0
13
13
  }
14
14
 
15
- const normalizeRect = (r: Record<string, unknown> | null | undefined): Rect | null => {
15
+ const normalizeRect = (r: DOMRect | Taro.NodesRef.BoundingClientRectCallbackResult | null | undefined): Rect | null => {
16
16
  if (!r) return null
17
17
  return {
18
18
  left: toNumber(r.left),
package/lib/cli.js CHANGED
@@ -2107,7 +2107,7 @@ const EventBuilder = {
2107
2107
  };
2108
2108
 
2109
2109
  var name = "@coze-arch/cli";
2110
- var version = "0.0.24";
2110
+ var version = "0.0.26";
2111
2111
  var description = "coze coding devtools cli";
2112
2112
  var license = "MIT";
2113
2113
  var author = "fanwenjie.fe@bytedance.com";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coze-arch/cli",
3
- "version": "0.0.25",
3
+ "version": "0.0.26",
4
4
  "private": false,
5
5
  "description": "coze coding devtools cli",
6
6
  "license": "MIT",