Skip to content

Commit d8d419e

Browse files
authored
Fix a couple of bugs in the Designer plugin (#266)
1 parent c440b52 commit d8d419e

File tree

2 files changed

+7
-1
lines changed
  • packages/adaptive-ui-designer-figma-plugin/src

2 files changed

+7
-1
lines changed

packages/adaptive-ui-designer-figma-plugin/src/figma/node.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -868,6 +868,8 @@ export class FigmaPluginNode extends PluginNode {
868868
const gradient = value as Gradient;
869869
paint = gradientToGradientPaint(gradient);
870870
}
871+
} else if (value && typeof value === "string" && value === "transparent") {
872+
paint = SOLID_TRANSPARENT;
871873
} else {
872874
throw `unexpected value at paintColor: ${typeof value}, ${value}, ${target}`;
873875
}

packages/adaptive-ui-designer-figma-plugin/src/ui/app.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ function tokenOrGroupStyles(tokenOrGroup: AdaptiveDesignTokenOrGroup, tokenTypes
8585
null;
8686
}
8787

88+
function appliedStyleProperties(tokenTypes: StyleProperty[], tokenIntendedFor: StyleProperty[]): StyleProperty[] {
89+
return tokenTypes.filter(element => tokenIntendedFor.includes(element));
90+
}
91+
8892
const appliedTokensTemplate = (
8993
tokenTypes: StyleProperty[],
9094
tokens: AppliedDesignTokenItem[] | null,
@@ -150,7 +154,7 @@ const availableTokensTemplate = (
150154
:styles=${x => tokenOrGroupStyles(x, tokenTypes)}
151155
glyphType=${(_) => glyphType}
152156
content-button
153-
@itemClick=${(x, c) => c.parent.controller.styles.applyDesignToken(x.intendedFor || [], x)}
157+
@itemClick=${(x, c) => c.parent.controller.styles.applyDesignToken(appliedStyleProperties(tokenTypes, x.intendedFor), x)}
154158
>
155159
</designer-style-token-item>
156160
`

0 commit comments

Comments
 (0)