@cntrl-site/components 1.0.69-alpha.3 → 1.0.69
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +82 -4154
- package/dist/index.mjs +8409 -14984
- package/package.json +1 -1
- package/dist/Components/Pretext/Pretext.d.ts +0 -121
- package/dist/Components/Pretext/PretextComponent.d.ts +0 -46
package/package.json
CHANGED
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import { CommonComponentProps } from '../props';
|
|
2
|
-
import { TextStyles } from '../utils/textStylesToCss';
|
|
3
|
-
export declare const SHAPE_IDS: readonly ["diamond", "parallelogram", "vase", "circle", "shield", "bobbin", "custom"];
|
|
4
|
-
export type ShapeId = typeof SHAPE_IDS[number];
|
|
5
|
-
type Align = 'left' | 'center' | 'right' | 'justify';
|
|
6
|
-
type PathFit = 'stretch' | 'viewbox';
|
|
7
|
-
type RichLeaf = {
|
|
8
|
-
text?: string;
|
|
9
|
-
fontFamily?: string;
|
|
10
|
-
fontWeight?: number;
|
|
11
|
-
fontStyle?: string;
|
|
12
|
-
textDecoration?: string;
|
|
13
|
-
textTransform?: string;
|
|
14
|
-
fontVariant?: string;
|
|
15
|
-
verticalAlign?: string;
|
|
16
|
-
};
|
|
17
|
-
type RichLink = {
|
|
18
|
-
type: 'link';
|
|
19
|
-
value?: string;
|
|
20
|
-
target?: string;
|
|
21
|
-
children?: RichNode[];
|
|
22
|
-
};
|
|
23
|
-
type RichNode = RichLeaf | RichLink;
|
|
24
|
-
type RichBlock = {
|
|
25
|
-
type?: string;
|
|
26
|
-
children?: RichNode[];
|
|
27
|
-
};
|
|
28
|
-
type PretextContentItem = {
|
|
29
|
-
text?: RichBlock[];
|
|
30
|
-
};
|
|
31
|
-
type PretextSettings = {
|
|
32
|
-
shape?: ShapeId;
|
|
33
|
-
customPath?: string;
|
|
34
|
-
pathFit?: PathFit;
|
|
35
|
-
pathViewBox?: string;
|
|
36
|
-
pathSnap?: number;
|
|
37
|
-
shapeMode?: 'A' | 'B';
|
|
38
|
-
overflowMode?: 'clip' | 'visible';
|
|
39
|
-
fitText?: 'on' | 'off';
|
|
40
|
-
dropCapLines?: number;
|
|
41
|
-
dropCapSize?: number;
|
|
42
|
-
image?: string | null;
|
|
43
|
-
imageFocalX?: number;
|
|
44
|
-
imageFocalY?: number;
|
|
45
|
-
imageScale?: number;
|
|
46
|
-
backgroundColor?: string;
|
|
47
|
-
textColor?: string;
|
|
48
|
-
linkColor?: string;
|
|
49
|
-
textFontFamily?: string;
|
|
50
|
-
textFontSettings?: {
|
|
51
|
-
fontWeight: number;
|
|
52
|
-
fontStyle: string;
|
|
53
|
-
};
|
|
54
|
-
textFontSize?: number;
|
|
55
|
-
textLineHeight?: number;
|
|
56
|
-
textLetterSpacing?: number;
|
|
57
|
-
textWordSpacing?: number;
|
|
58
|
-
textAlign?: Align;
|
|
59
|
-
textTextAppearance?: TextStyles['textAppearance'];
|
|
60
|
-
};
|
|
61
|
-
type PretextProps = {
|
|
62
|
-
settings?: PretextSettings;
|
|
63
|
-
content?: PretextContentItem[];
|
|
64
|
-
isEditor?: boolean;
|
|
65
|
-
isPreviewMode?: boolean;
|
|
66
|
-
isEditMode?: boolean;
|
|
67
|
-
isSelected?: boolean;
|
|
68
|
-
onUpdateSettings?: (settings: PretextSettings) => void;
|
|
69
|
-
} & CommonComponentProps;
|
|
70
|
-
type Pt = {
|
|
71
|
-
x: number;
|
|
72
|
-
y: number;
|
|
73
|
-
};
|
|
74
|
-
type Ring = Pt[];
|
|
75
|
-
export type VecNode = {
|
|
76
|
-
p: Pt;
|
|
77
|
-
in?: Pt | null;
|
|
78
|
-
out?: Pt | null;
|
|
79
|
-
};
|
|
80
|
-
export type VecContour = {
|
|
81
|
-
nodes: VecNode[];
|
|
82
|
-
closed: boolean;
|
|
83
|
-
};
|
|
84
|
-
export declare const EDIT_VIEW_BOX = "0 0 100 100";
|
|
85
|
-
export declare function mapContours(contours: VecContour[], transform: (point: Pt) => Pt): VecContour[];
|
|
86
|
-
export declare function scaleContours(contours: VecContour[], origin: Pt, scaleX: number, scaleY?: number): VecContour[];
|
|
87
|
-
export declare function parsePathNodes(d: string): VecContour[];
|
|
88
|
-
export declare function serializeContours(contours: VecContour[]): string;
|
|
89
|
-
export declare function flattenContours(contours: VecContour[]): Ring[];
|
|
90
|
-
export declare function ringsToContours(rings: Ring[]): VecContour[];
|
|
91
|
-
export declare function settingsForEditablePreset(shape: ShapeId): {
|
|
92
|
-
shape: ShapeId;
|
|
93
|
-
customPath: string;
|
|
94
|
-
pathFit: 'viewbox';
|
|
95
|
-
pathViewBox: string;
|
|
96
|
-
};
|
|
97
|
-
export declare function moveNodeTo(contours: VecContour[], contourIndex: number, nodeIndex: number, point: Pt): VecContour[];
|
|
98
|
-
export declare function moveSelectedNodesBy(contours: VecContour[], selection: {
|
|
99
|
-
contour: number;
|
|
100
|
-
node: number;
|
|
101
|
-
}[], dx: number, dy: number): VecContour[];
|
|
102
|
-
export declare function removeContourNodes(contours: VecContour[], selection: {
|
|
103
|
-
contour: number;
|
|
104
|
-
node: number;
|
|
105
|
-
}[]): VecContour[];
|
|
106
|
-
export declare function setNodeHandle(contours: VecContour[], contourIndex: number, nodeIndex: number, which: 'in' | 'out', point: Pt, mirror: boolean): VecContour[];
|
|
107
|
-
export declare function clearNodeHandle(contours: VecContour[], contourIndex: number, nodeIndex: number, which: 'in' | 'out'): VecContour[];
|
|
108
|
-
export declare function insertNodeOnSegment(contours: VecContour[], contourIndex: number, segmentIndex: number, t: number): {
|
|
109
|
-
contours: VecContour[];
|
|
110
|
-
nodeIndex: number;
|
|
111
|
-
};
|
|
112
|
-
export declare function removeContourNode(contours: VecContour[], contourIndex: number, nodeIndex: number): VecContour[];
|
|
113
|
-
export declare function toggleNodeSmooth(contours: VecContour[], contourIndex: number, nodeIndex: number): VecContour[];
|
|
114
|
-
export declare function nearestSegmentHit(contours: VecContour[], point: Pt): {
|
|
115
|
-
contour: number;
|
|
116
|
-
segment: number;
|
|
117
|
-
t: number;
|
|
118
|
-
distance: number;
|
|
119
|
-
} | null;
|
|
120
|
-
export declare function Pretext({ settings, content, isEditor, isPreviewMode, isEditMode, isSelected, onUpdateSettings }: PretextProps): import("react/jsx-runtime").JSX.Element;
|
|
121
|
-
export {};
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { Pretext } from './Pretext';
|
|
2
|
-
import { ComponentSchemaV1 } from '../../types/SchemaV1';
|
|
3
|
-
export declare const PretextComponent: {
|
|
4
|
-
element: typeof Pretext;
|
|
5
|
-
id: string;
|
|
6
|
-
name: string;
|
|
7
|
-
category: string;
|
|
8
|
-
version: number;
|
|
9
|
-
normalizeLayoutSettingsUpdate: (nextSettings: Record<string, any>, prevSettings: Record<string, any>) => Record<string, any>;
|
|
10
|
-
defaultSize: {
|
|
11
|
-
d: {
|
|
12
|
-
width: number;
|
|
13
|
-
height: number;
|
|
14
|
-
};
|
|
15
|
-
t: {
|
|
16
|
-
width: number;
|
|
17
|
-
height: number;
|
|
18
|
-
};
|
|
19
|
-
m: {
|
|
20
|
-
width: number;
|
|
21
|
-
height: number;
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
preview: {
|
|
25
|
-
type: "image";
|
|
26
|
-
url: string;
|
|
27
|
-
};
|
|
28
|
-
schema: ComponentSchemaV1;
|
|
29
|
-
sourceCode: string;
|
|
30
|
-
assetsPaths: {
|
|
31
|
-
content: never[];
|
|
32
|
-
parameters: {
|
|
33
|
-
path: string;
|
|
34
|
-
placeholderEnabled: boolean;
|
|
35
|
-
}[];
|
|
36
|
-
};
|
|
37
|
-
fontSettingsPaths: {
|
|
38
|
-
content: never[];
|
|
39
|
-
parameters: {
|
|
40
|
-
path: string;
|
|
41
|
-
}[];
|
|
42
|
-
};
|
|
43
|
-
fontRelations: {
|
|
44
|
-
textFontSettings: string;
|
|
45
|
-
};
|
|
46
|
-
};
|