zag-ripple 0.0.3 → 0.0.4
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/src/machine.ripple +21 -5
- package/src/normalize-props.ripple +1 -8
package/package.json
CHANGED
package/src/machine.ripple
CHANGED
|
@@ -254,11 +254,27 @@ export function useMachine(
|
|
|
254
254
|
|
|
255
255
|
let status = MachineStatus.NotStarted
|
|
256
256
|
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
257
|
+
effect(() => {
|
|
258
|
+
queueMicrotask(() => {
|
|
259
|
+
const started = status === MachineStatus.Started
|
|
260
|
+
status = MachineStatus.Started
|
|
261
|
+
debug(started ? "rehydrating..." : "initializing...")
|
|
262
|
+
state.invoke(state.initial, INIT_STATE)
|
|
263
|
+
})
|
|
264
|
+
|
|
265
|
+
return () => {
|
|
266
|
+
debug("unmounting...")
|
|
267
|
+
status = MachineStatus.Stopped
|
|
268
|
+
effects.forEach((fn) => fn?.())
|
|
269
|
+
effects = new Map()
|
|
270
|
+
transitionRef.current = null
|
|
271
|
+
queueMicrotask(() => {
|
|
272
|
+
action(machine.exit)
|
|
273
|
+
})
|
|
274
|
+
}
|
|
275
|
+
})
|
|
276
|
+
|
|
277
|
+
|
|
262
278
|
|
|
263
279
|
machine.watch?.(getParams())
|
|
264
280
|
|
|
@@ -34,16 +34,9 @@ export function toStyleString(style: Record<string, number | string>) {
|
|
|
34
34
|
return string
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
const preserveKeys = new Set<string>(
|
|
38
|
-
"viewBox,className,preserveAspectRatio,fillRule,clipPath,clipRule,strokeWidth,strokeLinecap,strokeLinejoin,strokeDasharray,strokeDashoffset,strokeMiterlimit".split(
|
|
39
|
-
",",
|
|
40
|
-
),
|
|
41
|
-
)
|
|
42
|
-
|
|
43
37
|
function toRippleProp(key: string) {
|
|
44
38
|
if (key in propMap) return propMap[key]
|
|
45
|
-
|
|
46
|
-
return key.toLowerCase()
|
|
39
|
+
return key
|
|
47
40
|
}
|
|
48
41
|
|
|
49
42
|
function toRipplePropValue(key: string, value: Dict[string]) {
|