-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* wip * wip * wip * wip * wip * fixes * fixes * fixes * fixes * fixes * fixes * fixes * fixes * fixes
- Loading branch information
Showing
26 changed files
with
223 additions
and
100 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 | ||
--- | ||
|
||
Improvements in overrides management |
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,7 +1,9 @@ | ||
import { ComponentShape } from '@ui/lib/types/shapes/componentShape'; | ||
import { ComponentProperty } from '@ui/types'; | ||
|
||
export const textStyles: Map<string, TextStyle | undefined> = new Map(); | ||
export const paintStyles: Map<string, PaintStyle | undefined> = new Map(); | ||
export const overrides: Map<string, NodeChangeProperty[]> = new Map(); | ||
export const images: Map<string, Image | null> = new Map(); | ||
export const components: Map<string, ComponentShape> = new Map(); | ||
export const componentProperties: Map<string, ComponentProperty> = new Map(); |
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,23 +1,13 @@ | ||
import { overrides as overridesLibrary } from '@plugin/libraries'; | ||
import { syncAttributes } from '@plugin/utils/syncAttributes'; | ||
import { overrides } from '@plugin/libraries'; | ||
import { translateTouched } from '@plugin/translators'; | ||
|
||
import { SyncGroups } from '@ui/lib/types/utils/syncGroups'; | ||
|
||
export const transformOverrides = (node: SceneNode) => { | ||
const overrides = overridesLibrary.get(node.id); | ||
if (!overrides) { | ||
return {}; | ||
} | ||
|
||
const touched: SyncGroups[] = []; | ||
|
||
overrides.forEach(override => { | ||
if (syncAttributes[override]) { | ||
touched.push(...syncAttributes[override]); | ||
} | ||
}); | ||
import { ShapeAttributes } from '@ui/lib/types/shapes/shape'; | ||
|
||
export const transformOverrides = ( | ||
node: SceneNode | ||
): Pick<ShapeAttributes, 'touched' | 'componentPropertyReferences'> => { | ||
return { | ||
touched | ||
touched: translateTouched(overrides.get(node.id)), | ||
componentPropertyReferences: node.componentPropertyReferences | ||
}; | ||
}; |
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
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
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
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
Oops, something went wrong.