Skip to content

Commit

Permalink
more structure
Browse files Browse the repository at this point in the history
  • Loading branch information
jordisala1991 committed May 29, 2024
1 parent a187895 commit 1050f9e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
6 changes: 6 additions & 0 deletions ui-src/parser/creators/createComponentInstance.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { PenpotFile } from '@ui/lib/types/penpotFile';
import { InstanceShape } from '@ui/lib/types/shapes/instanceShape';

export const createComponentInstance = (file: PenpotFile, { type, ...rest }: InstanceShape) => {
console.log(file.createComponentInstance({ ...rest }));
};
3 changes: 3 additions & 0 deletions ui-src/parser/creators/createItems.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
createBool,
createCircle,
createComponent,
createComponentInstance,
createGroup,
createPath,
createRectangle,
Expand Down Expand Up @@ -36,5 +37,7 @@ const createItem = (file: PenpotFile, node: PenpotNode) => {
return createBool(file, node);
case 'component':
return createComponent(file, node);
case 'instance':
return createComponentInstance(file, node);
}
};
3 changes: 2 additions & 1 deletion ui-src/parser/creators/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
export * from './createComponentLibrary';
export * from './createArtboard';
export * from './createBool';
export * from './createCircle';
export * from './createComponent';
export * from './createComponentInstance';
export * from './createComponentLibrary';
export * from './createGroup';
export * from './createItems';
export * from './createPage';
Expand Down

0 comments on commit 1050f9e

Please sign in to comment.