@levo-so/studio 0.1.0
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/blockSmith/ContentSchemaGenerator.d.ts +4 -0
- package/dist/blockSmith/DefaultContentGenerator.d.ts +2 -0
- package/dist/blockSmith/DefaultStylesGenerator.d.ts +2 -0
- package/dist/blockSmith/index.d.ts +3 -0
- package/dist/blockSmith/variablePropertMap.d.ts +2 -0
- package/dist/bridge/Highlighter.d.ts +8 -0
- package/dist/bridge/PreviewHighlighter.d.ts +2 -0
- package/dist/bridge/StudioBlockPreview.d.ts +7 -0
- package/dist/bridge/StudioPagePreview.d.ts +16 -0
- package/dist/bridge/StudioPreview.d.ts +20 -0
- package/dist/bridge/constants.d.ts +7 -0
- package/dist/bridge/index.d.ts +5 -0
- package/dist/bridge/types.d.ts +33 -0
- package/dist/bridge/utils.d.ts +7 -0
- package/dist/components/ActionWrapper.d.ts +8 -0
- package/dist/components/BackgroundVideo.d.ts +6 -0
- package/dist/components/backgroundPresets/Beams.d.ts +10 -0
- package/dist/components/backgroundPresets/Dots.d.ts +12 -0
- package/dist/components/backgroundPresets/Gradient.d.ts +10 -0
- package/dist/components/backgroundPresets/Grid.d.ts +14 -0
- package/dist/components/backgroundPresets/Waves.d.ts +12 -0
- package/dist/components/backgroundPresets/exports.d.ts +10 -0
- package/dist/components/backgroundPresets/index.d.ts +9 -0
- package/dist/components/backgroundPresets/presetSystem.d.ts +10 -0
- package/dist/components/backgroundPresets/presetUtils.d.ts +19 -0
- package/dist/components/backgroundPresets/presets.d.ts +39 -0
- package/dist/components/withBlockProps copy.d.ts +61 -0
- package/dist/components/withBlockProps.d.ts +61 -0
- package/dist/contentEngine/cache.d.ts +5 -0
- package/dist/contentEngine/config.d.ts +3 -0
- package/dist/contentEngine/content.d.ts +21 -0
- package/dist/contentEngine/getPage.d.ts +8 -0
- package/dist/contentEngine/head_code.d.ts +3 -0
- package/dist/contentEngine/index.d.ts +7 -0
- package/dist/contentEngine/sourceFetcher.d.ts +12 -0
- package/dist/contentEngine/themeUtils.d.ts +81 -0
- package/dist/contentEngine/types.d.ts +25 -0
- package/dist/contentEngine/urlBuilder.d.ts +3 -0
- package/dist/contentEngine/useContentEngine.d.ts +9 -0
- package/dist/core/BlockRegistry.d.ts +20 -0
- package/dist/core/LevoBlock.d.ts +15 -0
- package/dist/core/LevoPage.d.ts +12 -0
- package/dist/core/index.d.ts +4 -0
- package/dist/elements/Box.d.ts +7 -0
- package/dist/elements/Button.d.ts +10 -0
- package/dist/elements/Carousel.d.ts +19 -0
- package/dist/elements/Container.d.ts +6 -0
- package/dist/elements/Form.d.ts +6 -0
- package/dist/elements/Heading.d.ts +7 -0
- package/dist/elements/Icon.d.ts +10 -0
- package/dist/elements/Iframe.d.ts +7 -0
- package/dist/elements/Image.d.ts +17 -0
- package/dist/elements/Link.d.ts +6 -0
- package/dist/elements/Media.d.ts +22 -0
- package/dist/elements/Section.d.ts +7 -0
- package/dist/elements/Typography.d.ts +8 -0
- package/dist/elements/accordion/index.d.ts +20 -0
- package/dist/elements/index.d.ts +16 -0
- package/dist/elements/popover/index.d.ts +17 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +10762 -0
- package/dist/interfaces/block.d.ts +50 -0
- package/dist/interfaces/contentSchema.d.ts +29 -0
- package/dist/interfaces/index.d.ts +7 -0
- package/dist/interfaces/levoBlock.d.ts +203 -0
- package/dist/interfaces/site.d.ts +179 -0
- package/dist/interfaces/sites.d.ts +32 -0
- package/dist/interfaces/theme.d.ts +144 -0
- package/dist/pixel/constants/borderRadius.d.ts +43 -0
- package/dist/pixel/constants/colorOptions.d.ts +73 -0
- package/dist/pixel/constants/fontSizeOptions.d.ts +58 -0
- package/dist/pixel/constants/marginOptions.d.ts +183 -0
- package/dist/pixel/constants/spaceOptions.d.ts +178 -0
- package/dist/pixel/index.d.ts +3 -0
- package/dist/pixel/optionsMap.d.ts +14 -0
- package/dist/pixel/propertyMap.d.ts +2 -0
- package/dist/providers/AuthProvider.d.ts +25 -0
- package/dist/providers/BlockContext.d.ts +16 -0
- package/dist/providers/index.d.ts +3 -0
- package/dist/theme/defaultTheme.d.ts +3 -0
- package/dist/utils/blockHelpers.d.ts +5 -0
- package/dist/utils/blocksLevoClient.d.ts +5 -0
- package/dist/utils/colorUtils.d.ts +54 -0
- package/dist/utils/getKeysWithValue.d.ts +3 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/withBlockPropsUtils.d.ts +132 -0
- package/package.json +72 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { IBlockSource, IFieldConfig } from './levoBlock';
|
|
2
|
+
import { ComponentType, LazyExoticComponent } from 'react';
|
|
3
|
+
import { CSSStyleKeys } from '../pixel/propertyMap';
|
|
4
|
+
export type IStyles = {
|
|
5
|
+
[key in CSSStyleKeys]?: string;
|
|
6
|
+
} & {
|
|
7
|
+
mobile?: {
|
|
8
|
+
[key in CSSStyleKeys]?: string;
|
|
9
|
+
};
|
|
10
|
+
tablet?: {
|
|
11
|
+
[key in CSSStyleKeys]?: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
type DeepStyles<T> = T extends Array<infer U> ? IStyles & {
|
|
15
|
+
[index: number]: DeepStyles<U>;
|
|
16
|
+
} : T extends object ? {
|
|
17
|
+
[K in keyof T]: DeepStyles<T[K]>;
|
|
18
|
+
} : IStyles;
|
|
19
|
+
type DeepConfig<T> = T extends Array<infer U> ? IFieldConfig & {
|
|
20
|
+
[index: number]: DeepConfig<U>;
|
|
21
|
+
} : T extends object ? IFieldConfig & {
|
|
22
|
+
[K in keyof T]: DeepConfig<T[K]>;
|
|
23
|
+
} & {
|
|
24
|
+
[x: string]: IFieldConfig;
|
|
25
|
+
} : IFieldConfig;
|
|
26
|
+
export type ISettingsType = {
|
|
27
|
+
[key: string]: any;
|
|
28
|
+
};
|
|
29
|
+
export interface ILevoBlockBaseProps<ContentType = Record<string, any>> {
|
|
30
|
+
content: ContentType & {
|
|
31
|
+
[x: string]: any;
|
|
32
|
+
};
|
|
33
|
+
styles: DeepStyles<ContentType & {
|
|
34
|
+
[x: string]: any;
|
|
35
|
+
}>;
|
|
36
|
+
config: DeepConfig<ContentType & {
|
|
37
|
+
[x: string]: any;
|
|
38
|
+
}>;
|
|
39
|
+
id: string;
|
|
40
|
+
}
|
|
41
|
+
export interface ILevoBlockProps<ContentType = Record<string, any>> extends ILevoBlockBaseProps<ContentType> {
|
|
42
|
+
id: string;
|
|
43
|
+
block_key: string;
|
|
44
|
+
block_version: string;
|
|
45
|
+
settings: ISettingsType;
|
|
46
|
+
source: IBlockSource[];
|
|
47
|
+
}
|
|
48
|
+
export type BlockComponent = React.FC<ILevoBlockBaseProps> | LazyExoticComponent<ComponentType<ILevoBlockBaseProps<any>>>;
|
|
49
|
+
export {};
|
|
50
|
+
//# sourceMappingURL=block.d.ts.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export declare const KindList: readonly ["element", "group"];
|
|
2
|
+
export declare const StudioWidgetList: readonly ["BoxWidget", "ButtonWidget", "LayoutWidget", "HeadingWidget", "IframeWidget", "ImageWidget", "IconWidget", "MediaWidget", "TypographyWidget", "CarouselWidget", "FormWidget", "ContainerWidget", "CardWidget", "TitleWidget", "TextWidget", "NumberWidget", "URLWidget", "ImageUploadWidget", "MultiImageUploadWidget", "TextareaWidget", "RichTextWidget", "DropdownWidget", "SwitchWidget", "DateWidget", "ArrayWidget", "RecordWidget"];
|
|
3
|
+
export declare const StudioWidgetMap: Record<"BoxWidget" | "ButtonWidget" | "LayoutWidget" | "HeadingWidget" | "IframeWidget" | "ImageWidget" | "IconWidget" | "MediaWidget" | "TypographyWidget" | "CarouselWidget" | "FormWidget" | "ContainerWidget" | "CardWidget" | "TitleWidget" | "TextWidget" | "NumberWidget" | "URLWidget" | "ImageUploadWidget" | "MultiImageUploadWidget" | "TextareaWidget" | "RichTextWidget" | "DropdownWidget" | "SwitchWidget" | "DateWidget" | "ArrayWidget" | "RecordWidget", "BoxWidget" | "ButtonWidget" | "LayoutWidget" | "HeadingWidget" | "IframeWidget" | "ImageWidget" | "IconWidget" | "MediaWidget" | "TypographyWidget" | "CarouselWidget" | "FormWidget" | "ContainerWidget" | "CardWidget" | "TitleWidget" | "TextWidget" | "NumberWidget" | "URLWidget" | "ImageUploadWidget" | "MultiImageUploadWidget" | "TextareaWidget" | "RichTextWidget" | "DropdownWidget" | "SwitchWidget" | "DateWidget" | "ArrayWidget" | "RecordWidget">;
|
|
4
|
+
type MediaHint = {
|
|
5
|
+
orientation?: "landscape" | "portrait" | "square";
|
|
6
|
+
size?: "icon" | "small" | "medium" | "large" | "cover";
|
|
7
|
+
usecase?: "avatar" | "icon" | "hero" | "background" | "logo" | "other";
|
|
8
|
+
};
|
|
9
|
+
type ContentHint = {
|
|
10
|
+
min_characters?: number;
|
|
11
|
+
max_characters?: number;
|
|
12
|
+
};
|
|
13
|
+
type GroupHint = {
|
|
14
|
+
min_items?: number;
|
|
15
|
+
max_items?: number;
|
|
16
|
+
};
|
|
17
|
+
export interface IStudioWidget {
|
|
18
|
+
label: string;
|
|
19
|
+
key: string;
|
|
20
|
+
field_interface: (typeof StudioWidgetList)[number];
|
|
21
|
+
kind?: (typeof KindList)[number];
|
|
22
|
+
fields?: IStudioWidget[];
|
|
23
|
+
options?: Record<string, any>;
|
|
24
|
+
hint?: {
|
|
25
|
+
prompt_description?: string;
|
|
26
|
+
} & (MediaHint | ContentHint | GroupHint);
|
|
27
|
+
}
|
|
28
|
+
export {};
|
|
29
|
+
//# sourceMappingURL=contentSchema.d.ts.map
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import { IField, ILemaCollection, IMediaObject } from '@levo-so/core';
|
|
2
|
+
import { MotionProps } from 'motion/react';
|
|
3
|
+
import { IStudioWidget } from './contentSchema';
|
|
4
|
+
export interface IBlockLayouts {
|
|
5
|
+
key: string;
|
|
6
|
+
title: string;
|
|
7
|
+
styles: IElementStyle;
|
|
8
|
+
content: any;
|
|
9
|
+
config: Record<string, IFieldConfig>;
|
|
10
|
+
}
|
|
11
|
+
export interface IBlock {
|
|
12
|
+
category_id: string;
|
|
13
|
+
title: string;
|
|
14
|
+
key: string;
|
|
15
|
+
version: string;
|
|
16
|
+
prompt_description?: string;
|
|
17
|
+
content_schema: IStudioWidget[];
|
|
18
|
+
layouts: IBlockLayouts[];
|
|
19
|
+
}
|
|
20
|
+
export interface IBlockCategory {
|
|
21
|
+
id: string;
|
|
22
|
+
title: string;
|
|
23
|
+
description: string;
|
|
24
|
+
media?: any[];
|
|
25
|
+
}
|
|
26
|
+
export declare const BlockSourceModuleList: readonly ["collection", "event", "blog", "context"];
|
|
27
|
+
export type IStudioSource = {
|
|
28
|
+
id?: string;
|
|
29
|
+
workspace_id: string;
|
|
30
|
+
module: (typeof BlockSourceModuleList)[number];
|
|
31
|
+
identifier: string;
|
|
32
|
+
field_key: string;
|
|
33
|
+
params?: Record<string, any>;
|
|
34
|
+
options?: {
|
|
35
|
+
sub_module?: "popular_posts" | "related_posts";
|
|
36
|
+
blog_id?: string;
|
|
37
|
+
context_key?: string;
|
|
38
|
+
};
|
|
39
|
+
metadata?: Record<string, any>;
|
|
40
|
+
filters?: string[];
|
|
41
|
+
created_at?: string;
|
|
42
|
+
updated_at?: string;
|
|
43
|
+
};
|
|
44
|
+
export type IBlockSource = IStudioSource & {
|
|
45
|
+
block_instance_id?: string;
|
|
46
|
+
};
|
|
47
|
+
export type IPageSource = IStudioSource & {
|
|
48
|
+
page_id?: string;
|
|
49
|
+
};
|
|
50
|
+
export type ISettingsField = {
|
|
51
|
+
type: "custom";
|
|
52
|
+
schema: {
|
|
53
|
+
field_interface: string;
|
|
54
|
+
settings?: Record<string, any>;
|
|
55
|
+
};
|
|
56
|
+
} | {
|
|
57
|
+
type: "collection";
|
|
58
|
+
schema: IField;
|
|
59
|
+
};
|
|
60
|
+
type MutableDeep<T> = T extends readonly (infer U)[] ? MutableDeep<U>[] : T extends object ? {
|
|
61
|
+
-readonly [K in keyof T]: MutableDeep<T[K]>;
|
|
62
|
+
} : T;
|
|
63
|
+
export interface AnimationConfig {
|
|
64
|
+
initial?: MutableDeep<MotionProps["initial"]>;
|
|
65
|
+
exit?: MutableDeep<MotionProps["exit"]>;
|
|
66
|
+
whileHover?: MutableDeep<MotionProps["whileHover"]>;
|
|
67
|
+
}
|
|
68
|
+
export interface BackgroundEffectConfig {
|
|
69
|
+
type: "beams" | "dots" | "grid" | "gradient" | "waves";
|
|
70
|
+
colors?: {
|
|
71
|
+
primary?: string;
|
|
72
|
+
secondary?: string;
|
|
73
|
+
accent?: string;
|
|
74
|
+
};
|
|
75
|
+
settings?: {
|
|
76
|
+
size?: number;
|
|
77
|
+
spacing?: number;
|
|
78
|
+
direction?: string;
|
|
79
|
+
opacity?: number;
|
|
80
|
+
amplitude?: number;
|
|
81
|
+
frequency?: number;
|
|
82
|
+
speed?: number;
|
|
83
|
+
isInteractive?: boolean;
|
|
84
|
+
rows?: number;
|
|
85
|
+
cols?: number;
|
|
86
|
+
gridSize?: number;
|
|
87
|
+
hoverColor?: string;
|
|
88
|
+
lineWidth?: number;
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
export interface BackgroundPreset {
|
|
92
|
+
id: string;
|
|
93
|
+
name: string;
|
|
94
|
+
description?: string;
|
|
95
|
+
category: "minimal" | "dynamic" | "interactive" | "custom";
|
|
96
|
+
effect: BackgroundEffectConfig;
|
|
97
|
+
thumbnail?: string;
|
|
98
|
+
}
|
|
99
|
+
export interface IFieldConfig {
|
|
100
|
+
selectedVariants?: Record<string, string>;
|
|
101
|
+
animation?: AnimationConfig;
|
|
102
|
+
form?: {
|
|
103
|
+
collection_id: string;
|
|
104
|
+
collection_name?: string;
|
|
105
|
+
submit_button_label?: string;
|
|
106
|
+
workspace_id: string;
|
|
107
|
+
schema: ILemaCollection;
|
|
108
|
+
hidden_fields: string[];
|
|
109
|
+
};
|
|
110
|
+
action?: {
|
|
111
|
+
type: "page" | "external_link" | "email" | "phone" | "login" | "none";
|
|
112
|
+
value: string;
|
|
113
|
+
options: {
|
|
114
|
+
openInNewTab?: boolean;
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
button_icons?: {
|
|
118
|
+
left?: {
|
|
119
|
+
enabled?: boolean;
|
|
120
|
+
};
|
|
121
|
+
right?: {
|
|
122
|
+
enabled?: boolean;
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
heading?: {
|
|
126
|
+
level?: number;
|
|
127
|
+
};
|
|
128
|
+
backgroundVideo?: {
|
|
129
|
+
media?: IMediaObject;
|
|
130
|
+
};
|
|
131
|
+
backgroundEffects?: BackgroundEffectConfig;
|
|
132
|
+
backgroundPresetId?: string;
|
|
133
|
+
action_type?: "link" | "email" | "phone" | "login" | "none";
|
|
134
|
+
action_value?: string;
|
|
135
|
+
carousel?: {
|
|
136
|
+
autoScroll?: boolean;
|
|
137
|
+
loop?: boolean;
|
|
138
|
+
autoPlay?: boolean;
|
|
139
|
+
speed?: number;
|
|
140
|
+
time_per_slide?: number;
|
|
141
|
+
stopOnFocusIn?: boolean;
|
|
142
|
+
stopOnInteraction?: boolean;
|
|
143
|
+
stopOnMouseEnter?: boolean;
|
|
144
|
+
};
|
|
145
|
+
image?: {
|
|
146
|
+
high_priority?: boolean;
|
|
147
|
+
};
|
|
148
|
+
media?: {
|
|
149
|
+
autoPlay?: boolean;
|
|
150
|
+
controls?: boolean;
|
|
151
|
+
muted?: boolean;
|
|
152
|
+
loop?: boolean;
|
|
153
|
+
poster?: IMediaObject;
|
|
154
|
+
high_priority?: boolean;
|
|
155
|
+
};
|
|
156
|
+
custom_html?: {
|
|
157
|
+
before?: string;
|
|
158
|
+
after?: string;
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
export interface IBlockInstance {
|
|
162
|
+
id: string;
|
|
163
|
+
workspace_id: string;
|
|
164
|
+
key: string;
|
|
165
|
+
version: string;
|
|
166
|
+
title: string;
|
|
167
|
+
status: string;
|
|
168
|
+
content: Record<string, any>;
|
|
169
|
+
source: IBlockSource[];
|
|
170
|
+
settings: {
|
|
171
|
+
[key: string]: any;
|
|
172
|
+
sources?: never;
|
|
173
|
+
};
|
|
174
|
+
layout: string | null;
|
|
175
|
+
category: string;
|
|
176
|
+
config: Record<string, IFieldConfig>;
|
|
177
|
+
styles: IElementStyle;
|
|
178
|
+
theme: Record<string, any>;
|
|
179
|
+
view_count: number;
|
|
180
|
+
impression_count: number;
|
|
181
|
+
page_count: number;
|
|
182
|
+
source_count: number;
|
|
183
|
+
created_at: string;
|
|
184
|
+
updated_at: string;
|
|
185
|
+
deleted_at: any;
|
|
186
|
+
}
|
|
187
|
+
export interface IMyCategory {
|
|
188
|
+
name: string;
|
|
189
|
+
count: number;
|
|
190
|
+
}
|
|
191
|
+
export interface IMyBlockPages {
|
|
192
|
+
id: string;
|
|
193
|
+
title: string;
|
|
194
|
+
url: string;
|
|
195
|
+
kind: string;
|
|
196
|
+
status: string;
|
|
197
|
+
}
|
|
198
|
+
export type IBlockCategoryExpanded = IBlockCategory & {
|
|
199
|
+
block: IBlock;
|
|
200
|
+
};
|
|
201
|
+
export type IElementStyle = Record<string, any>;
|
|
202
|
+
export {};
|
|
203
|
+
//# sourceMappingURL=levoBlock.d.ts.map
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { IMediaObject, LevoQuery, IWorkspace } from '@levo-so/core';
|
|
2
|
+
import { ISite } from './sites';
|
|
3
|
+
import { IBlockInstance, IPageSource } from './levoBlock';
|
|
4
|
+
export interface IPageSpeedData {
|
|
5
|
+
audit_id: string;
|
|
6
|
+
mobile: Scores;
|
|
7
|
+
desktop: Scores;
|
|
8
|
+
completed_at: string;
|
|
9
|
+
}
|
|
10
|
+
interface Scores {
|
|
11
|
+
performance: number;
|
|
12
|
+
seo: number;
|
|
13
|
+
"best-practices": number;
|
|
14
|
+
accessibility: number;
|
|
15
|
+
}
|
|
16
|
+
export interface IStudioTags {
|
|
17
|
+
id: string;
|
|
18
|
+
title: string;
|
|
19
|
+
slug: string;
|
|
20
|
+
}
|
|
21
|
+
export interface IPageStatMetric {
|
|
22
|
+
current: number | null;
|
|
23
|
+
past: number | null;
|
|
24
|
+
change: number | null;
|
|
25
|
+
}
|
|
26
|
+
export interface IPage {
|
|
27
|
+
id: string;
|
|
28
|
+
workspace_id: string;
|
|
29
|
+
site_id: string;
|
|
30
|
+
title: string;
|
|
31
|
+
description: string;
|
|
32
|
+
key: string;
|
|
33
|
+
url: string;
|
|
34
|
+
live_url: string;
|
|
35
|
+
domain: string;
|
|
36
|
+
status: "published" | "draft";
|
|
37
|
+
meta: IPageMeta;
|
|
38
|
+
tags: IStudioTags[];
|
|
39
|
+
pagespeed_score: IPageSpeedData;
|
|
40
|
+
access: IPageAccess[];
|
|
41
|
+
settings: {
|
|
42
|
+
structured_data_json?: string;
|
|
43
|
+
[key: string]: any;
|
|
44
|
+
};
|
|
45
|
+
theme: {
|
|
46
|
+
colors: {
|
|
47
|
+
brand: {
|
|
48
|
+
main: string;
|
|
49
|
+
foreground: string;
|
|
50
|
+
background: string;
|
|
51
|
+
};
|
|
52
|
+
brandSecondary: {
|
|
53
|
+
main: string;
|
|
54
|
+
foreground: string;
|
|
55
|
+
background: string;
|
|
56
|
+
};
|
|
57
|
+
text1: string;
|
|
58
|
+
text2: string;
|
|
59
|
+
text3: string;
|
|
60
|
+
[x: string]: any;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
block_count: number;
|
|
64
|
+
variable_count: number;
|
|
65
|
+
source_count: number;
|
|
66
|
+
url_count: number;
|
|
67
|
+
created_at: string;
|
|
68
|
+
updated_at: string;
|
|
69
|
+
source?: IPageSource[];
|
|
70
|
+
kind: IPageKind;
|
|
71
|
+
sample_url: string;
|
|
72
|
+
insights: {
|
|
73
|
+
bounce_rate: IPageStatMetric;
|
|
74
|
+
page_views: IPageStatMetric;
|
|
75
|
+
scroll_depth: IPageStatMetric;
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
export interface IPageMeta {
|
|
79
|
+
meta_title: string;
|
|
80
|
+
meta_description: string;
|
|
81
|
+
og_title: string;
|
|
82
|
+
og_description: string;
|
|
83
|
+
og_image: IMediaObject | null;
|
|
84
|
+
og_url: string;
|
|
85
|
+
keywords: string;
|
|
86
|
+
disable_indexing: boolean;
|
|
87
|
+
}
|
|
88
|
+
export type IPageKind = "blog.page" | "collection.page" | "event.page" | "static";
|
|
89
|
+
export interface IPageExpanded extends IPage {
|
|
90
|
+
workspace: IWorkspace;
|
|
91
|
+
site: ISite;
|
|
92
|
+
source?: IPageSource[];
|
|
93
|
+
kind: IPageKind;
|
|
94
|
+
blocks: (IBlockInstance & {
|
|
95
|
+
isPreview?: boolean;
|
|
96
|
+
})[];
|
|
97
|
+
access: IPageAccess[];
|
|
98
|
+
}
|
|
99
|
+
export interface IPageFromPath {
|
|
100
|
+
workspace: IWorkspace;
|
|
101
|
+
site: ISite;
|
|
102
|
+
query: Record<string, string>;
|
|
103
|
+
data: IPageExpanded | null;
|
|
104
|
+
access: IPageAccessCheck | null;
|
|
105
|
+
}
|
|
106
|
+
export interface IPageAccessGatingOptions {
|
|
107
|
+
collection: string;
|
|
108
|
+
field: string;
|
|
109
|
+
condition?: LevoQuery.Where;
|
|
110
|
+
default_value?: Record<string, any>;
|
|
111
|
+
hidden?: string[];
|
|
112
|
+
}
|
|
113
|
+
export declare const IMembershipAuthenticationMethods: readonly ["linkedin", "google", "otp", "magiclink", "password"];
|
|
114
|
+
export interface IPageAccessAuthenticationOptions {
|
|
115
|
+
methods: (typeof IMembershipAuthenticationMethods)[number][];
|
|
116
|
+
primary_method: (typeof IMembershipAuthenticationMethods)[number];
|
|
117
|
+
}
|
|
118
|
+
export type IPageAccessGating = {
|
|
119
|
+
kind: "gating";
|
|
120
|
+
options: IPageAccessGatingOptions;
|
|
121
|
+
};
|
|
122
|
+
export type IPageAccessAuthentication = {
|
|
123
|
+
kind: "authentication";
|
|
124
|
+
options: IPageAccessAuthenticationOptions;
|
|
125
|
+
};
|
|
126
|
+
export type IPageAccess = (IPageAccessGating | IPageAccessAuthentication) & {
|
|
127
|
+
enabled: boolean;
|
|
128
|
+
};
|
|
129
|
+
export type IPageAccessAuthenticationCodes =
|
|
130
|
+
/**
|
|
131
|
+
* if `options.methods` is empty
|
|
132
|
+
*/
|
|
133
|
+
"authentication.NOT_CONFIGURED"
|
|
134
|
+
/**
|
|
135
|
+
* if `getNullableAccount` returns `null`, when `kind: authentication` is not optional
|
|
136
|
+
*/
|
|
137
|
+
| "authentication.NOT_LOGGED_IN" | "authentication.SUCCESS";
|
|
138
|
+
export type IPageAccessGatingCodes =
|
|
139
|
+
/**
|
|
140
|
+
* if `options.collection` is empty
|
|
141
|
+
*/
|
|
142
|
+
"gating.NOT_CONFIGURED"
|
|
143
|
+
/**
|
|
144
|
+
* if not `email` is given, and it could not fetched with authentication also
|
|
145
|
+
*/
|
|
146
|
+
| "gating.IDENTIFIER_NOT_FOUND"
|
|
147
|
+
/**
|
|
148
|
+
* if `options.collection` does not have entry with the given `email`
|
|
149
|
+
*/
|
|
150
|
+
| "gating.ENTRY_NOT_FOUND"
|
|
151
|
+
/**
|
|
152
|
+
* if `options.collection` has entry, but doesn't pass the `options.condition` criteria
|
|
153
|
+
*/
|
|
154
|
+
| "gating.ENTRY_CONDITION_NOT_FULFILLED" | "gating.SUCCESS";
|
|
155
|
+
export interface IPageAccessCheck {
|
|
156
|
+
has_access: boolean;
|
|
157
|
+
code?: IPageAccessAuthenticationCodes | IPageAccessGatingCodes;
|
|
158
|
+
message: string;
|
|
159
|
+
options?: Pick<IPageAccessGatingOptions, "collection" | "field"> | IPageAccessAuthenticationOptions;
|
|
160
|
+
}
|
|
161
|
+
export interface ISitemap {
|
|
162
|
+
created_at: string;
|
|
163
|
+
filename: string;
|
|
164
|
+
id: string;
|
|
165
|
+
location: string;
|
|
166
|
+
name: string;
|
|
167
|
+
page_id: string | null;
|
|
168
|
+
path: string;
|
|
169
|
+
updated_at: string;
|
|
170
|
+
url_count: number;
|
|
171
|
+
workspace_id: string;
|
|
172
|
+
}
|
|
173
|
+
export interface ISitemapsSettings {
|
|
174
|
+
allow: string[];
|
|
175
|
+
disallow: string[];
|
|
176
|
+
sitemaps: string[];
|
|
177
|
+
}
|
|
178
|
+
export {};
|
|
179
|
+
//# sourceMappingURL=site.d.ts.map
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { IMediaObject } from '@levo-so/core';
|
|
2
|
+
import { ITheme } from './theme';
|
|
3
|
+
import { ISitemapsSettings } from './site';
|
|
4
|
+
export type ISiteCompact = Pick<ISite, "object" | "id" | "name" | "slug" | "icon" | "logo" | "is_default" | "created_at" | "updated_at">;
|
|
5
|
+
export interface ISite {
|
|
6
|
+
object: string;
|
|
7
|
+
id: string;
|
|
8
|
+
workspace_id: string;
|
|
9
|
+
name: string;
|
|
10
|
+
slug: string;
|
|
11
|
+
timezone: string;
|
|
12
|
+
description: string;
|
|
13
|
+
logo: IMediaObject | null;
|
|
14
|
+
icon: IMediaObject | null;
|
|
15
|
+
industry: string | null;
|
|
16
|
+
domain: string | null;
|
|
17
|
+
theme: ITheme;
|
|
18
|
+
settings: {
|
|
19
|
+
head_code?: string;
|
|
20
|
+
[key: string]: any;
|
|
21
|
+
};
|
|
22
|
+
page_count: number;
|
|
23
|
+
domain_count: number;
|
|
24
|
+
robots: ISitemapsSettings;
|
|
25
|
+
is_default: boolean;
|
|
26
|
+
is_proxied: boolean;
|
|
27
|
+
host_domain: string | null;
|
|
28
|
+
proxy_domain: string | null;
|
|
29
|
+
created_at: string;
|
|
30
|
+
updated_at: string;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=sites.d.ts.map
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { IElementStyle } from './levoBlock';
|
|
2
|
+
/**
|
|
3
|
+
* OKLCH color representation for theme storage
|
|
4
|
+
* Provides better color accuracy and perceptual uniformity than hex
|
|
5
|
+
*/
|
|
6
|
+
export interface OKLCHColor {
|
|
7
|
+
l: number;
|
|
8
|
+
c: number;
|
|
9
|
+
h: number;
|
|
10
|
+
alpha?: number;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Font configuration for the theme system
|
|
14
|
+
* Defines which fonts to use for different text elements
|
|
15
|
+
*/
|
|
16
|
+
export type IThemeFonts = {
|
|
17
|
+
heading: string;
|
|
18
|
+
body: string;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Configuration for a single variant group within a component theme
|
|
22
|
+
*
|
|
23
|
+
* Variant groups organize related style variations (e.g., "Button Sizes", "Heading Levels")
|
|
24
|
+
* Each group contains multiple variants that users can select from
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* // Button sizes variant group
|
|
28
|
+
* {
|
|
29
|
+
* id: "sizes",
|
|
30
|
+
* name: "Button Sizes",
|
|
31
|
+
* variants: {
|
|
32
|
+
* small: { fontSize: "12px", padding: "8px 12px" },
|
|
33
|
+
* medium: { fontSize: "14px", padding: "10px 16px" },
|
|
34
|
+
* large: { fontSize: "16px", padding: "12px 20px" }
|
|
35
|
+
* }
|
|
36
|
+
* }
|
|
37
|
+
*/
|
|
38
|
+
export interface IVariantGroupConfig {
|
|
39
|
+
id: string;
|
|
40
|
+
name: string;
|
|
41
|
+
variants: Record<string, IElementStyle>;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Complete theme configuration for a single component type
|
|
45
|
+
*
|
|
46
|
+
* Combines default styles that apply to all instances of the component
|
|
47
|
+
* with variant groups that provide specific style options
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* // Heading component theme
|
|
51
|
+
* {
|
|
52
|
+
* defaultStyles: { fontFamily: "Inter", color: "#000" },
|
|
53
|
+
* variantGroups: {
|
|
54
|
+
* headingLevel: {
|
|
55
|
+
* id: "headingLevel",
|
|
56
|
+
* name: "Heading Level",
|
|
57
|
+
* variants: {
|
|
58
|
+
* h1: { fontSize: "32px", fontWeight: "bold" },
|
|
59
|
+
* h2: { fontSize: "28px", fontWeight: "bold" }
|
|
60
|
+
* }
|
|
61
|
+
* }
|
|
62
|
+
* }
|
|
63
|
+
* }
|
|
64
|
+
*/
|
|
65
|
+
export interface IComponentTheme {
|
|
66
|
+
defaultStyles?: IElementStyle;
|
|
67
|
+
variantGroups?: Record<string, IVariantGroupConfig>;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Container for all component themes in the system
|
|
71
|
+
*
|
|
72
|
+
* Pre-defines common component types while allowing custom components
|
|
73
|
+
* through the index signature
|
|
74
|
+
*/
|
|
75
|
+
export interface IThemeComponents {
|
|
76
|
+
heading?: IComponentTheme;
|
|
77
|
+
button?: IComponentTheme;
|
|
78
|
+
typography?: IComponentTheme;
|
|
79
|
+
container?: IComponentTheme;
|
|
80
|
+
icon?: IComponentTheme;
|
|
81
|
+
section?: IComponentTheme;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Complete theme configuration for a workspace/page
|
|
85
|
+
*
|
|
86
|
+
* Combines legacy primitive theme properties (colors, fonts, sizes) with the new
|
|
87
|
+
* component-based theme system for maximum flexibility and backward compatibility
|
|
88
|
+
*
|
|
89
|
+
* CSS Generation:
|
|
90
|
+
* - Colors/fonts/sizes generate CSS custom properties (--color-brand, --font-heading, etc.)
|
|
91
|
+
* - Component default styles generate [data-levo_element_type] selectors
|
|
92
|
+
* - Component variants generate .levo-variant-{group}-{variant} class selectors
|
|
93
|
+
*
|
|
94
|
+
* @example
|
|
95
|
+
* // Complete theme structure
|
|
96
|
+
* {
|
|
97
|
+
* colors: { brand: { main: "#007bff", foreground: "#fff" } },
|
|
98
|
+
* fonts: { heading: "Inter", body: "Inter" },
|
|
99
|
+
* sizes: { radius: "4px", spacing: "8px", fontSize: "14px" },
|
|
100
|
+
* components: {
|
|
101
|
+
* button: {
|
|
102
|
+
* defaultStyles: { fontSize: "14px", borderRadius: "4px" },
|
|
103
|
+
* variantGroups: {
|
|
104
|
+
* variants: { variants: { primary: { backgroundColor: "#007bff" } } },
|
|
105
|
+
* sizes: { variants: { large: { padding: "12px 20px" } } }
|
|
106
|
+
* }
|
|
107
|
+
* }
|
|
108
|
+
* }
|
|
109
|
+
* }
|
|
110
|
+
*/
|
|
111
|
+
export interface ITheme {
|
|
112
|
+
colors: {
|
|
113
|
+
brand: {
|
|
114
|
+
main: OKLCHColor;
|
|
115
|
+
foreground: OKLCHColor;
|
|
116
|
+
};
|
|
117
|
+
brandSecondary: {
|
|
118
|
+
main: OKLCHColor;
|
|
119
|
+
foreground: OKLCHColor;
|
|
120
|
+
};
|
|
121
|
+
text1: OKLCHColor;
|
|
122
|
+
text2: OKLCHColor;
|
|
123
|
+
text3: OKLCHColor;
|
|
124
|
+
page: OKLCHColor;
|
|
125
|
+
border: OKLCHColor;
|
|
126
|
+
background1: OKLCHColor;
|
|
127
|
+
background2: OKLCHColor;
|
|
128
|
+
background3: OKLCHColor;
|
|
129
|
+
iconPrimary: OKLCHColor;
|
|
130
|
+
iconSecondary: OKLCHColor;
|
|
131
|
+
};
|
|
132
|
+
fonts: IThemeFonts;
|
|
133
|
+
sizes: {
|
|
134
|
+
radius: string;
|
|
135
|
+
spacing: string;
|
|
136
|
+
fontSize: string;
|
|
137
|
+
};
|
|
138
|
+
effects: {
|
|
139
|
+
shadow: string;
|
|
140
|
+
};
|
|
141
|
+
components: IThemeComponents;
|
|
142
|
+
[x: string]: unknown;
|
|
143
|
+
}
|
|
144
|
+
//# sourceMappingURL=theme.d.ts.map
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export declare const borderRadius: {
|
|
2
|
+
readonly none: {
|
|
3
|
+
readonly label: "None";
|
|
4
|
+
readonly value: "none";
|
|
5
|
+
readonly css: "0px";
|
|
6
|
+
};
|
|
7
|
+
readonly sm: {
|
|
8
|
+
readonly label: "SM";
|
|
9
|
+
readonly value: "sm";
|
|
10
|
+
readonly css: "calc(var(--base-radius, 4px) * 0.5)";
|
|
11
|
+
};
|
|
12
|
+
readonly base: {
|
|
13
|
+
readonly label: "Base";
|
|
14
|
+
readonly value: "base";
|
|
15
|
+
readonly css: "var(--base-radius, 4px)";
|
|
16
|
+
};
|
|
17
|
+
readonly md: {
|
|
18
|
+
readonly label: "MD";
|
|
19
|
+
readonly value: "md";
|
|
20
|
+
readonly css: "calc(var(--base-radius, 4px) * 1.5)";
|
|
21
|
+
};
|
|
22
|
+
readonly lg: {
|
|
23
|
+
readonly label: "LG";
|
|
24
|
+
readonly value: "lg";
|
|
25
|
+
readonly css: "calc(var(--base-radius, 4px) * 2)";
|
|
26
|
+
};
|
|
27
|
+
readonly xl: {
|
|
28
|
+
readonly label: "XL";
|
|
29
|
+
readonly value: "xl";
|
|
30
|
+
readonly css: "calc(var(--base-radius, 4px) * 3)";
|
|
31
|
+
};
|
|
32
|
+
readonly "2xl": {
|
|
33
|
+
readonly label: "2XL";
|
|
34
|
+
readonly value: "2xl";
|
|
35
|
+
readonly css: "calc(var(--base-radius, 4px) * 4)";
|
|
36
|
+
};
|
|
37
|
+
readonly "3xl": {
|
|
38
|
+
readonly label: "3XL";
|
|
39
|
+
readonly value: "3xl";
|
|
40
|
+
readonly css: "calc(var(--base-radius, 4px) * 6)";
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=borderRadius.d.ts.map
|