@teambit/compositions 1.0.993 → 1.0.995
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/composition.section.tsx +4 -1
- package/compositions.module.scss +63 -27
- package/compositions.tsx +173 -47
- package/compositions.ui.runtime.tsx +38 -6
- package/dist/composition.section.d.ts +3 -2
- package/dist/composition.section.js +3 -1
- package/dist/composition.section.js.map +1 -1
- package/dist/compositions.d.ts +9 -2
- package/dist/compositions.js +137 -56
- package/dist/compositions.js.map +1 -1
- package/dist/compositions.module.scss +63 -27
- package/dist/compositions.ui.runtime.d.ts +17 -5
- package/dist/compositions.ui.runtime.js +24 -5
- package/dist/compositions.ui.runtime.js.map +1 -1
- package/dist/{preview-1779204000743.js → preview-1779305522985.js} +2 -2
- package/dist/ui/compositions-panel/compositions-panel.d.ts +4 -1
- package/dist/ui/compositions-panel/compositions-panel.js +19 -2
- package/dist/ui/compositions-panel/compositions-panel.js.map +1 -1
- package/dist/ui/compositions-panel/compositions-panel.module.scss +13 -0
- package/dist/ui/compositions-panel/live-control-input.module.scss +6 -7
- package/package.json +32 -32
- package/ui/compositions-panel/compositions-panel.module.scss +13 -0
- package/ui/compositions-panel/compositions-panel.tsx +29 -0
- package/ui/compositions-panel/live-control-input.module.scss +6 -7
|
@@ -12,6 +12,9 @@ import type { Composition } from '../../composition';
|
|
|
12
12
|
export type CompositionsPanelProps = {
|
|
13
13
|
compositions: Composition[];
|
|
14
14
|
onSelectComposition: (composition: Composition) => void;
|
|
15
|
+
onToggleLiveControls?: () => void;
|
|
16
|
+
hasLiveControls?: boolean;
|
|
17
|
+
liveControlsActive?: boolean;
|
|
15
18
|
active?: Composition;
|
|
16
19
|
url: string;
|
|
17
20
|
isScaling?: boolean;
|
|
@@ -24,6 +27,9 @@ export function CompositionsPanel({
|
|
|
24
27
|
compositions,
|
|
25
28
|
isScaling,
|
|
26
29
|
onSelectComposition: onSelect,
|
|
30
|
+
onToggleLiveControls,
|
|
31
|
+
hasLiveControls,
|
|
32
|
+
liveControlsActive,
|
|
27
33
|
active,
|
|
28
34
|
includesEnvTemplate,
|
|
29
35
|
useNameParam,
|
|
@@ -77,6 +83,29 @@ export function CompositionsPanel({
|
|
|
77
83
|
<span className={styles.name}>{composition.displayName}</span>
|
|
78
84
|
</a>
|
|
79
85
|
<div className={styles.itemActions}>
|
|
86
|
+
{hasLiveControls && onToggleLiveControls && composition === active && (
|
|
87
|
+
<Tooltip
|
|
88
|
+
content={liveControlsActive ? 'Hide live controls' : 'Show live controls'}
|
|
89
|
+
placement="bottom"
|
|
90
|
+
>
|
|
91
|
+
<button
|
|
92
|
+
type="button"
|
|
93
|
+
aria-label={liveControlsActive ? 'Hide live controls' : 'Show live controls'}
|
|
94
|
+
className={classNames(
|
|
95
|
+
styles.actionIcon,
|
|
96
|
+
styles.iconButton,
|
|
97
|
+
liveControlsActive && styles.actionIconActive
|
|
98
|
+
)}
|
|
99
|
+
onClick={(e) => {
|
|
100
|
+
e.preventDefault();
|
|
101
|
+
e.stopPropagation();
|
|
102
|
+
onToggleLiveControls();
|
|
103
|
+
}}
|
|
104
|
+
>
|
|
105
|
+
<Icon of="settings" />
|
|
106
|
+
</button>
|
|
107
|
+
</Tooltip>
|
|
108
|
+
)}
|
|
80
109
|
<MenuWidgetIcon
|
|
81
110
|
className={styles.actionIcon}
|
|
82
111
|
icon="Code"
|
|
@@ -53,13 +53,12 @@
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
.toggleControl {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
width: 100%;
|
|
56
|
+
// Let the Toggle keep its native dimensions. The component sizes its
|
|
57
|
+
// knob travel in `em`, so stretching the wrapper width without scaling
|
|
58
|
+
// the font-size leaves the knob short of the right edge in the "on"
|
|
59
|
+
// state.
|
|
60
|
+
display: inline-flex;
|
|
61
|
+
flex: 0 0 auto;
|
|
63
62
|
}
|
|
64
63
|
|
|
65
64
|
.rangeWrapper {
|