@moises.ai/design-system 3.11.14 → 3.11.16
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
CHANGED
|
@@ -1,32 +1,11 @@
|
|
|
1
1
|
import classNames from 'classnames'
|
|
2
2
|
import { ContextMenu as ContextMenuRadix } from 'radix-ui'
|
|
3
|
-
import React, { forwardRef, memo
|
|
3
|
+
import React, { forwardRef, memo } from 'react'
|
|
4
4
|
import { createRenderItem, styles } from '../../lib/menu'
|
|
5
5
|
import { CanvasContextMenuTrigger } from './CanvasContextMenuTrigger'
|
|
6
6
|
|
|
7
7
|
const renderOption = createRenderItem(ContextMenuRadix)
|
|
8
8
|
|
|
9
|
-
function useLogPropChanged(label, props) {
|
|
10
|
-
const prevPropsRef = useRef({})
|
|
11
|
-
|
|
12
|
-
useEffect(() => {
|
|
13
|
-
const prevProps = prevPropsRef.current
|
|
14
|
-
prevPropsRef.current = props
|
|
15
|
-
|
|
16
|
-
const changes = {}
|
|
17
|
-
|
|
18
|
-
for (const key in props) {
|
|
19
|
-
if (props[key] !== prevProps[key]) {
|
|
20
|
-
changes[key] = [prevProps[key], props[key]]
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
if (Object.keys(changes).length > 0) {
|
|
25
|
-
console.log(`>>> ${label}`, changes)
|
|
26
|
-
}
|
|
27
|
-
}, [label, props])
|
|
28
|
-
}
|
|
29
|
-
|
|
30
9
|
/**
|
|
31
10
|
* Variant of ContextMenu for programmatic opening from non-DOM event sources
|
|
32
11
|
* (e.g. Pixi canvas). Instead of wrapping a visible trigger element, it exposes
|
|
@@ -55,16 +34,6 @@ export const CanvasContextMenu = memo(
|
|
|
55
34
|
},
|
|
56
35
|
ref,
|
|
57
36
|
) {
|
|
58
|
-
useLogPropChanged('CanvasContextMenu', {
|
|
59
|
-
options,
|
|
60
|
-
className,
|
|
61
|
-
size,
|
|
62
|
-
side,
|
|
63
|
-
align,
|
|
64
|
-
onSelectionChange,
|
|
65
|
-
closeOnSelect,
|
|
66
|
-
})
|
|
67
|
-
|
|
68
37
|
return (
|
|
69
38
|
<ContextMenuRadix.Root>
|
|
70
39
|
<ContextMenuRadix.Trigger asChild>
|