Skip to content

Commit

Permalink
improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Cenadros committed Apr 17, 2024
1 parent 00afa43 commit aecd2e6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 15 deletions.
4 changes: 2 additions & 2 deletions plugin-src/transformers/partials/transformTextStyle.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { translateTextDecoration, translateTextTransform } from '@plugin/translators';

import { Paragraph, TextNode } from '@ui/lib/types/text/textContent';
import { TextStyle } from '@ui/lib/types/text/textContent';

export const transformTextStyle = (
node: Pick<
Expand All @@ -17,7 +17,7 @@ export const transformTextStyle = (
| 'textDecoration'
| 'fills'
>
): Partial<Paragraph> | Partial<TextNode> => {
): Partial<TextStyle> => {
return {
fontFamily: node.fontName.family,
fontSize: node.fontSize.toString(),
Expand Down
19 changes: 6 additions & 13 deletions ui-src/lib/types/text/textContent.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,30 +15,23 @@ type ParagraphSet = {
type Paragraph = {
type: 'paragraph';
key?: string;
fills?: Fill[];
fontFamily?: string;
fontSize?: string;
fontStyle?: string;
fontWeight?: string;
direction?: string;
textDecoration?: string;
textTransform?: string;
typographyRefId?: string;
typographyRefFile?: string;
children: TextNode[];
};
} & TextStyle;

type TextNode = {
text: string;
key?: string;
fills?: Fill[];
} & TextStyle;

type TextStyle = {
fontFamily?: string;
fontSize?: string;
fontStyle?: string;
fontWeight?: string;
direction?: string;
textDecoration?: string;
textTransform?: string;
direction?: string;
typographyRefId?: string;
typographyRefFile?: string;
fills?: Fill[];
};

0 comments on commit aecd2e6

Please sign in to comment.