-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for background in pages (#56)
* added support for background in pages * minor fix * removed eslint ignore
- Loading branch information
Showing
10 changed files
with
78 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"penpot-exporter": minor | ||
--- | ||
|
||
Added support for background colors in pages |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,14 @@ | ||
import { transformChildren } from '@plugin/transformers/partials'; | ||
import { translatePageFill } from '@plugin/translators'; | ||
|
||
import { PenpotPage } from '@ui/lib/types/penpotPage'; | ||
|
||
export const transformPageNode = async (node: PageNode): Promise<PenpotPage> => { | ||
return { | ||
name: node.name, | ||
options: { | ||
background: node.backgrounds.length ? translatePageFill(node.backgrounds[0]) : undefined | ||
}, | ||
...(await transformChildren(node)) | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,30 @@ | ||
import { SavedGrids } from '@ui/lib/types/utils/grid'; | ||
import { Uuid } from '@ui/lib/types/utils/uuid'; | ||
|
||
import { PenpotNode } from './penpotNode'; | ||
|
||
export type PenpotPage = { | ||
name: string; | ||
children?: PenpotNode[]; | ||
options?: PenpotPageOptions; | ||
}; | ||
|
||
export type PenpotPageOptions = { | ||
background?: string; // hex color | ||
savedGrids?: SavedGrids; | ||
flows?: Flow[]; | ||
guides?: { [uuid: Uuid]: Guide }; | ||
}; | ||
|
||
type Flow = { | ||
id?: Uuid; | ||
name: string; | ||
startingFrame: Uuid; | ||
}; | ||
|
||
type Guide = { | ||
id?: Uuid; | ||
axis: 'x' | 'y'; | ||
position: number; | ||
frameId?: Uuid; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.