32 |
33 |
34 | Step {currentStepIndex + 1} of {PROGRESS_STEPS.length}
35 | {' '}
36 | — {STEP_NAMES[currentStep]}
37 |
38 |
39 |
40 | {PROGRESS_STEPS.map((step, index) => {
41 | const isCompleted = index < currentStepIndex;
42 | const isCurrent = index === currentStepIndex;
43 | const isNextStep = index > currentStepIndex;
44 |
45 | return (
46 |
53 | {isCurrent ? (
54 |
55 | ) : isCompleted ? (
56 |
57 | ) : (
58 |
59 | )}
60 | {STEP_NAMES[step]}
61 |
62 | );
63 | })}
64 |
65 |
66 | );
67 | };
68 |
--------------------------------------------------------------------------------
/ui-src/lib/types/shapes/textShape.ts:
--------------------------------------------------------------------------------
1 | import type { LayoutChildAttributes } from '@ui/lib/types/shapes/layout';
2 | import type {
3 | ShapeAttributes,
4 | ShapeBaseAttributes,
5 | ShapeGeomAttributes
6 | } from '@ui/lib/types/shapes/shape';
7 | import type { Fill } from '@ui/lib/types/utils/fill';
8 | import type { Typography } from '@ui/lib/types/utils/typography';
9 |
10 | export type TextShape = ShapeBaseAttributes &
11 | ShapeGeomAttributes &
12 | ShapeAttributes &
13 | TextAttributes &
14 | LayoutChildAttributes;
15 |
16 | export type TextAttributes = {
17 | type?: 'text';
18 | content?: TextContent;
19 | characters?: string; // @ TODO: move to any other place
20 | };
21 |
22 | export type TextContent = {
23 | type: 'root';
24 | key?: string;
25 | verticalAlign?: TextVerticalAlign;
26 | children?: ParagraphSet[];
27 | };
28 |
29 | export type TextVerticalAlign = 'top' | 'bottom' | 'center';
30 | export type TextHorizontalAlign = 'left' | 'right' | 'center' | 'justify';
31 | export type TextFontStyle = 'normal' | 'italic';
32 |
33 | export type ParagraphSet = {
34 | type: 'paragraph-set';
35 | key?: string;
36 | children: Paragraph[];
37 | };
38 |
39 | export type Paragraph = {
40 | type: 'paragraph';
41 | key?: string;
42 | children: TextNode[];
43 | } & TextStyle;
44 |
45 | export type TextNode = {
46 | text: string;
47 | key?: string;
48 | } & TextStyle;
49 |
50 | export type TextStyle = TextTypography & {
51 | textDecoration?: string;
52 | direction?: string;
53 | typographyRefId?: string;
54 | typographyRefFile?: string;
55 | textAlign?: TextHorizontalAlign;
56 | textDirection?: 'ltr' | 'rtl' | 'auto';
57 | fills?: Fill[];
58 |
59 | fillStyleId?: string; // @TODO: move to any other place
60 | textStyleId?: string; // @TODO: move to any other place
61 | };
62 |
63 | export type TextTypography = FontId & {
64 | fontFamily?: string;
65 | fontSize?: string;
66 | fontWeight?: string;
67 | fontStyle?: TextFontStyle;
68 | lineHeight?: string;
69 | letterSpacing?: string;
70 | textTransform?: string;
71 | };
72 |
73 | export type FontId = {
74 | fontId?: string;
75 | fontVariantId?: string;
76 | };
77 |
78 | export type TypographyStyle = {
79 | name: string;
80 | textStyle: TextStyle;
81 | typography: Typography;
82 | };
83 |
--------------------------------------------------------------------------------
/plugin-src/translators/text/paragraph/List.ts:
--------------------------------------------------------------------------------
1 | import { ListTypeFactory } from '@plugin/translators/text/paragraph/ListTypeFactory';
2 | import type { TextSegment } from '@plugin/translators/text/paragraph/translateParagraphProperties';
3 |
4 | import type { TextNode as PenpotTextNode } from '@ui/lib/types/shapes/textShape';
5 |
6 | type Level = {
7 | style: PenpotTextNode;
8 | counter: number;
9 | type: ListType;
10 | };
11 |
12 | type ListType = 'ORDERED' | 'UNORDERED' | 'NONE';
13 |
14 | export class List {
15 | private levels: Map