Skip to content

Commit c00977e

Browse files
committed
feat: change live control event types
1 parent 139fcb7 commit c00977e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

scopes/compositions/compositions/ui/compositions-panel/compositions-panel.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export function CompositionsPanel({
8787
// listen to the mounter for live control updates
8888
useEffect(() => {
8989
function onLiveControlsSetup(e: MessageEvent<LiveControlReadyEventData>) {
90-
if (!e.data || e.data.type !== 'composition-controls:ready') return () => {};
90+
if (!e.data || e.data.type !== 'composition-live-controls:ready') return () => {};
9191
const { controls, values, timestamp } = JSON.parse(JSON.stringify(e.data.payload));
9292
const iframeWindow = e.source;
9393
setMounter(iframeWindow as Window);
@@ -106,7 +106,7 @@ export function CompositionsPanel({
106106
(key: string, value: any) => {
107107
if (mounter) {
108108
const data: LiveControlUpdateEventData = {
109-
type: 'composition-controls:update',
109+
type: 'composition-live-controls:update',
110110
payload: {
111111
key,
112112
value: JSON.parse(JSON.stringify(value)),

scopes/compositions/compositions/ui/compositions-panel/live-control.type.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// TODO: put the whole file into a sharable Bit component for custom preview mounters
22

33
export type LiveControlUpdateEventData = {
4-
type: 'composition-controls:update';
4+
type: 'composition-live-controls:update';
55
payload: {
66
key: string;
77
value: any;
@@ -10,7 +10,7 @@ export type LiveControlUpdateEventData = {
1010
};
1111

1212
export type LiveControlReadyEventData = {
13-
type: 'composition-controls:ready';
13+
type: 'composition-live-controls:ready';
1414
payload: {
1515
controls: Array<Control>;
1616
values: Record<string, any>;

0 commit comments

Comments
 (0)