Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { FileFormat1 as FileFormat } from '@sketch-hq/sketch-file-format-ts';
import makeResizeConstraint from './resizeConstraint';
import { TextNode, ResizeConstraints, TextStyle, ViewStyle } from '../types';
import { generateID, makeColorFromCSS } from './models';
import { makeStyle, parseStyle } from './style';
import findFontName from '../utils/findFont';
export const TEXT_DECORATION_UNDERLINE = {
none: FileFormat.UnderlineStyle.None,
underline: FileFormat.UnderlineStyle.Underlined,
double: 9,
};
export const TEXT_ALIGN = {
auto: FileFormat.TextHorizontalAlignment.Left,
left: FileFormat.TextHorizontalAlignment.Left,
right: FileFormat.TextHorizontalAlignment.Right,
center: FileFormat.TextHorizontalAlignment.Centered,
justify: FileFormat.TextHorizontalAlignment.Justified,
};
const TEXT_ALIGN_REVERSE = {
[FileFormat.TextHorizontalAlignment.Right]: 'right',
[FileFormat.TextHorizontalAlignment.Centered]: 'center',
[FileFormat.TextHorizontalAlignment.Justified]: 'justify',
};
export const TEXT_DECORATION_LINETHROUGH = {
none: 0,
'line-through': 1,
};
import { TextNode, ResizeConstraints, TextStyle, ViewStyle } from '../types';
import { generateID, makeColorFromCSS } from './models';
import { makeStyle, parseStyle } from './style';
import findFontName from '../utils/findFont';
export const TEXT_DECORATION_UNDERLINE = {
none: FileFormat.UnderlineStyle.None,
underline: FileFormat.UnderlineStyle.Underlined,
double: 9,
};
export const TEXT_ALIGN = {
auto: FileFormat.TextHorizontalAlignment.Left,
left: FileFormat.TextHorizontalAlignment.Left,
right: FileFormat.TextHorizontalAlignment.Right,
center: FileFormat.TextHorizontalAlignment.Centered,
justify: FileFormat.TextHorizontalAlignment.Justified,
};
const TEXT_ALIGN_REVERSE = {
[FileFormat.TextHorizontalAlignment.Right]: 'right',
[FileFormat.TextHorizontalAlignment.Centered]: 'center',
[FileFormat.TextHorizontalAlignment.Justified]: 'justify',
};
export const TEXT_DECORATION_LINETHROUGH = {
none: 0,
'line-through': 1,
};
export const TEXT_TRANSFORM = {