mirror of
https://github.com/penpot/penpot-exporter-figma-plugin.git
synced 2025-01-20 06:22:38 -05:00
303cc833a0
* wip * wip * wip * wip * wip * fixes * fixes * fixes * fixes * fixes * fixes * fixes * fixes * fixes
35 lines
1.1 KiB
TypeScript
35 lines
1.1 KiB
TypeScript
import { SyncGroups } from '@ui/lib/types/utils/syncGroups';
|
|
import { componentProperties } from '@ui/parser';
|
|
import { ComponentPropertyReference } from '@ui/types';
|
|
|
|
export const symbolTouched = (
|
|
visible: boolean | undefined,
|
|
characters: string | undefined,
|
|
touched: SyncGroups[] | undefined,
|
|
componentPropertyReferences: ComponentPropertyReference | undefined
|
|
): SyncGroups[] | undefined => {
|
|
if (!componentPropertyReferences) {
|
|
return touched;
|
|
}
|
|
|
|
const propertyReferenceVisible = componentPropertyReferences.visible;
|
|
const propertyReferenceCharacters = componentPropertyReferences.characters;
|
|
|
|
if (
|
|
propertyReferenceVisible &&
|
|
visible !== componentProperties.get(propertyReferenceVisible)?.defaultValue &&
|
|
!touched?.includes(':visibility-group')
|
|
) {
|
|
touched?.push(':visibility-group');
|
|
}
|
|
|
|
if (
|
|
propertyReferenceCharacters &&
|
|
characters !== componentProperties.get(propertyReferenceCharacters)?.defaultValue &&
|
|
!touched?.includes(':content-group')
|
|
) {
|
|
touched?.push(':content-group');
|
|
}
|
|
|
|
return touched;
|
|
};
|