@marvalt/dstyler 0.1.3
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/LICENSE +674 -0
- package/README.md +34 -0
- package/dist/components/AutoBlock.d.ts +14 -0
- package/dist/components/AutoBlock.d.ts.map +1 -0
- package/dist/components/AutoSection.d.ts +15 -0
- package/dist/components/AutoSection.d.ts.map +1 -0
- package/dist/components/StyledPage.d.ts +18 -0
- package/dist/components/StyledPage.d.ts.map +1 -0
- package/dist/components/index.d.ts +10 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/engine/detectSections.d.ts +23 -0
- package/dist/engine/detectSections.d.ts.map +1 -0
- package/dist/engine/index.d.ts +10 -0
- package/dist/engine/index.d.ts.map +1 -0
- package/dist/engine/renderBlock.d.ts +15 -0
- package/dist/engine/renderBlock.d.ts.map +1 -0
- package/dist/engine/selectTemplate.d.ts +14 -0
- package/dist/engine/selectTemplate.d.ts.map +1 -0
- package/dist/index.d.ts +288 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.esm.js +931 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.js +947 -0
- package/dist/index.js.map +1 -0
- package/dist/providers/ThemeProvider.d.ts +14 -0
- package/dist/providers/ThemeProvider.d.ts.map +1 -0
- package/dist/providers/index.d.ts +8 -0
- package/dist/providers/index.d.ts.map +1 -0
- package/dist/templates/FooterMinimal.d.ts +14 -0
- package/dist/templates/FooterMinimal.d.ts.map +1 -0
- package/dist/templates/HeroDefault.d.ts +14 -0
- package/dist/templates/HeroDefault.d.ts.map +1 -0
- package/dist/templates/SectionBase.d.ts +14 -0
- package/dist/templates/SectionBase.d.ts.map +1 -0
- package/dist/templates/SectionWave.d.ts +16 -0
- package/dist/templates/SectionWave.d.ts.map +1 -0
- package/dist/templates/blocks/BlockButton.d.ts +10 -0
- package/dist/templates/blocks/BlockButton.d.ts.map +1 -0
- package/dist/templates/blocks/BlockForm.d.ts +10 -0
- package/dist/templates/blocks/BlockForm.d.ts.map +1 -0
- package/dist/templates/blocks/BlockImage.d.ts +10 -0
- package/dist/templates/blocks/BlockImage.d.ts.map +1 -0
- package/dist/templates/blocks/BlockText.d.ts +10 -0
- package/dist/templates/blocks/BlockText.d.ts.map +1 -0
- package/dist/templates/blocks/index.d.ts +11 -0
- package/dist/templates/blocks/index.d.ts.map +1 -0
- package/dist/templates/index.d.ts +11 -0
- package/dist/templates/index.d.ts.map +1 -0
- package/dist/tokens/css-vars.d.ts +12 -0
- package/dist/tokens/css-vars.d.ts.map +1 -0
- package/dist/tokens/index.d.ts +10 -0
- package/dist/tokens/index.d.ts.map +1 -0
- package/dist/tokens/tokens.d.ts +9 -0
- package/dist/tokens/tokens.d.ts.map +1 -0
- package/dist/tokens/wordpress-to-tokens.d.ts +12 -0
- package/dist/tokens/wordpress-to-tokens.d.ts.map +1 -0
- package/dist/types/block.d.ts +12 -0
- package/dist/types/block.d.ts.map +1 -0
- package/dist/types/index.d.ts +10 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/section.d.ts +22 -0
- package/dist/types/section.d.ts.map +1 -0
- package/dist/types/theme.d.ts +58 -0
- package/dist/types/theme.d.ts.map +1 -0
- package/dist/utils/index.d.ts +8 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/responsive.d.ts +11 -0
- package/dist/utils/responsive.d.ts.map +1 -0
- package/package.json +68 -0
package/README.md
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# @marvalt/dstyler
|
|
2
|
+
|
|
3
|
+
Design system package for styling WordPress content with zero-config templates.
|
|
4
|
+
|
|
5
|
+
## Description
|
|
6
|
+
|
|
7
|
+
`@marvalt/dstyler` is a lightweight renderer that:
|
|
8
|
+
- Applies global design tokens (colors, spacing, typography)
|
|
9
|
+
- Maps parsed WordPress sections → React templates
|
|
10
|
+
- Ensures consistent responsive styling across the site
|
|
11
|
+
- Renders blocks (text, images, buttons, forms) inside sections
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install @marvalt/dstyler
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
```tsx
|
|
22
|
+
import { ThemeProvider, StyledPage } from '@marvalt/dstyler';
|
|
23
|
+
import { getThemeStyles } from '@marvalt/wadapter';
|
|
24
|
+
|
|
25
|
+
<ThemeProvider wpStyles={getThemeStyles()}>
|
|
26
|
+
<StyledPage page={page} registry={registry} />
|
|
27
|
+
</ThemeProvider>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## License
|
|
31
|
+
|
|
32
|
+
GPL-3.0-or-later
|
|
33
|
+
|
|
34
|
+
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license GPL-3.0-or-later
|
|
3
|
+
*
|
|
4
|
+
* This file is part of the MarVAlt Open SDK.
|
|
5
|
+
* Copyright (c) 2025 Vibune Pty Ltd.
|
|
6
|
+
*/
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import type { WordPressBlock, ComponentRegistry } from '@marvalt/wparser';
|
|
9
|
+
export interface AutoBlockProps {
|
|
10
|
+
block: WordPressBlock;
|
|
11
|
+
registry?: ComponentRegistry;
|
|
12
|
+
}
|
|
13
|
+
export declare const AutoBlock: React.FC<AutoBlockProps>;
|
|
14
|
+
//# sourceMappingURL=AutoBlock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AutoBlock.d.ts","sourceRoot":"","sources":["../../src/components/AutoBlock.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAO1E,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,cAAc,CAAC;IACtB,QAAQ,CAAC,EAAE,iBAAiB,CAAC;CAC9B;AAED,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAiC9C,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license GPL-3.0-or-later
|
|
3
|
+
*
|
|
4
|
+
* This file is part of the MarVAlt Open SDK.
|
|
5
|
+
* Copyright (c) 2025 Vibune Pty Ltd.
|
|
6
|
+
*/
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import type { Section } from '../types/section';
|
|
9
|
+
import type { ComponentRegistry } from '@marvalt/wparser';
|
|
10
|
+
export interface AutoSectionProps {
|
|
11
|
+
section: Section;
|
|
12
|
+
registry?: ComponentRegistry;
|
|
13
|
+
}
|
|
14
|
+
export declare const AutoSection: React.FC<AutoSectionProps>;
|
|
15
|
+
//# sourceMappingURL=AutoSection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AutoSection.d.ts","sourceRoot":"","sources":["../../src/components/AutoSection.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAOhD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAE1D,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,iBAAiB,CAAC;CAC9B;AAED,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CAqDlD,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license GPL-3.0-or-later
|
|
3
|
+
*
|
|
4
|
+
* This file is part of the MarVAlt Open SDK.
|
|
5
|
+
* Copyright (c) 2025 Vibune Pty Ltd.
|
|
6
|
+
*/
|
|
7
|
+
import React from 'react';
|
|
8
|
+
import type { ComponentRegistry, WordPressBlock } from '@marvalt/wparser';
|
|
9
|
+
export interface WordPressPage {
|
|
10
|
+
blocks?: WordPressBlock[];
|
|
11
|
+
[key: string]: any;
|
|
12
|
+
}
|
|
13
|
+
export interface StyledPageProps {
|
|
14
|
+
page: WordPressPage;
|
|
15
|
+
registry?: ComponentRegistry;
|
|
16
|
+
}
|
|
17
|
+
export declare const StyledPage: React.FC<StyledPageProps>;
|
|
18
|
+
//# sourceMappingURL=StyledPage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StyledPage.d.ts","sourceRoot":"","sources":["../../src/components/StyledPage.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAI1E,MAAM,WAAW,aAAa;IAC5B,MAAM,CAAC,EAAE,cAAc,EAAE,CAAC;IAC1B,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,aAAa,CAAC;IACpB,QAAQ,CAAC,EAAE,iBAAiB,CAAC;CAC9B;AAED,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CA6BhD,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license GPL-3.0-or-later
|
|
3
|
+
*
|
|
4
|
+
* This file is part of the MarVAlt Open SDK.
|
|
5
|
+
* Copyright (c) 2025 Vibune Pty Ltd.
|
|
6
|
+
*/
|
|
7
|
+
export * from './AutoSection';
|
|
8
|
+
export * from './AutoBlock';
|
|
9
|
+
export * from './StyledPage';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license GPL-3.0-or-later
|
|
3
|
+
*
|
|
4
|
+
* This file is part of the MarVAlt Open SDK.
|
|
5
|
+
* Copyright (c) 2025 Vibune Pty Ltd.
|
|
6
|
+
*/
|
|
7
|
+
import type { WordPressBlock } from '@marvalt/wparser';
|
|
8
|
+
import type { Section } from '../types/section';
|
|
9
|
+
/**
|
|
10
|
+
* Detect sections from WordPress blocks
|
|
11
|
+
* Sections are defined by core/group blocks (with or without alignment)
|
|
12
|
+
* Sub-sections are core/columns blocks inside groups
|
|
13
|
+
*/
|
|
14
|
+
export declare function detectSections(blocks: WordPressBlock[]): Section[];
|
|
15
|
+
/**
|
|
16
|
+
* Determine section style based on alternating logic and custom classes
|
|
17
|
+
* Rules:
|
|
18
|
+
* - default is always first
|
|
19
|
+
* - after default follows alternate
|
|
20
|
+
* - highlight resets - next section is default
|
|
21
|
+
*/
|
|
22
|
+
export declare function determineSectionStyle(section: Section, previousStyle?: 'default' | 'alternate' | 'highlight'): 'default' | 'alternate' | 'highlight';
|
|
23
|
+
//# sourceMappingURL=detectSections.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detectSections.d.ts","sourceRoot":"","sources":["../../src/engine/detectSections.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAEhD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,cAAc,EAAE,GAAG,OAAO,EAAE,CA6BlE;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,OAAO,EAChB,aAAa,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,WAAW,GACpD,SAAS,GAAG,WAAW,GAAG,WAAW,CAgCvC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license GPL-3.0-or-later
|
|
3
|
+
*
|
|
4
|
+
* This file is part of the MarVAlt Open SDK.
|
|
5
|
+
* Copyright (c) 2025 Vibune Pty Ltd.
|
|
6
|
+
*/
|
|
7
|
+
export * from './detectSections';
|
|
8
|
+
export * from './selectTemplate';
|
|
9
|
+
export * from './renderBlock';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/engine/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license GPL-3.0-or-later
|
|
3
|
+
*
|
|
4
|
+
* This file is part of the MarVAlt Open SDK.
|
|
5
|
+
* Copyright (c) 2025 Vibune Pty Ltd.
|
|
6
|
+
*/
|
|
7
|
+
import type { WordPressBlock } from '@marvalt/wparser';
|
|
8
|
+
import type { BlockRendererProps } from '../types/block';
|
|
9
|
+
import type { ComponentType } from 'react';
|
|
10
|
+
export type BlockRenderer = ComponentType<BlockRendererProps>;
|
|
11
|
+
/**
|
|
12
|
+
* Select block renderer based on block type
|
|
13
|
+
*/
|
|
14
|
+
export declare function selectBlockRenderer(block: WordPressBlock): string;
|
|
15
|
+
//# sourceMappingURL=renderBlock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderBlock.d.ts","sourceRoot":"","sources":["../../src/engine/renderBlock.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAQ3C,MAAM,MAAM,aAAa,GAAG,aAAa,CAAC,kBAAkB,CAAC,CAAC;AAE9D;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,cAAc,GAAG,MAAM,CA8BjE"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license GPL-3.0-or-later
|
|
3
|
+
*
|
|
4
|
+
* This file is part of the MarVAlt Open SDK.
|
|
5
|
+
* Copyright (c) 2025 Vibune Pty Ltd.
|
|
6
|
+
*/
|
|
7
|
+
import type { Section } from '../types/section';
|
|
8
|
+
import type { ComponentType } from 'react';
|
|
9
|
+
export type TemplateComponent = ComponentType<any>;
|
|
10
|
+
/**
|
|
11
|
+
* Select template component based on section properties
|
|
12
|
+
*/
|
|
13
|
+
export declare function selectTemplate(section: Section): string;
|
|
14
|
+
//# sourceMappingURL=selectTemplate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selectTemplate.d.ts","sourceRoot":"","sources":["../../src/engine/selectTemplate.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAQ3C,MAAM,MAAM,iBAAiB,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC;AAEnD;;GAEG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,CAsBvD"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
import React, { ComponentType } from 'react';
|
|
2
|
+
import { WordPressBlock, ComponentRegistry } from '@marvalt/wparser';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @license GPL-3.0-or-later
|
|
6
|
+
*
|
|
7
|
+
* This file is part of the MarVAlt Open SDK.
|
|
8
|
+
* Copyright (c) 2025 Vibune Pty Ltd.
|
|
9
|
+
*/
|
|
10
|
+
interface DesignTokens {
|
|
11
|
+
colors: {
|
|
12
|
+
primary: string;
|
|
13
|
+
secondary: string;
|
|
14
|
+
background: string;
|
|
15
|
+
text: string;
|
|
16
|
+
default: string;
|
|
17
|
+
alternate: string;
|
|
18
|
+
highlight: string;
|
|
19
|
+
};
|
|
20
|
+
spacing: {
|
|
21
|
+
sm: number;
|
|
22
|
+
md: number;
|
|
23
|
+
lg: number;
|
|
24
|
+
xl: number;
|
|
25
|
+
};
|
|
26
|
+
typography: {
|
|
27
|
+
body: string;
|
|
28
|
+
heading: string;
|
|
29
|
+
scale: number;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
interface ThemeStyles {
|
|
33
|
+
typography?: {
|
|
34
|
+
heading_font_family?: string;
|
|
35
|
+
body_font_family?: string;
|
|
36
|
+
base_font_size?: string;
|
|
37
|
+
line_height?: string;
|
|
38
|
+
};
|
|
39
|
+
colors?: {
|
|
40
|
+
primary?: string;
|
|
41
|
+
secondary?: string;
|
|
42
|
+
text?: string;
|
|
43
|
+
background?: string;
|
|
44
|
+
};
|
|
45
|
+
backgrounds?: {
|
|
46
|
+
image?: string;
|
|
47
|
+
repeat?: string;
|
|
48
|
+
position?: string;
|
|
49
|
+
size?: string;
|
|
50
|
+
};
|
|
51
|
+
shadows?: {
|
|
52
|
+
box_shadow?: string;
|
|
53
|
+
text_shadow?: string;
|
|
54
|
+
};
|
|
55
|
+
layout?: {
|
|
56
|
+
container_max_width?: string;
|
|
57
|
+
wide_container_max_width?: string;
|
|
58
|
+
content_padding?: string;
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* @license GPL-3.0-or-later
|
|
64
|
+
*
|
|
65
|
+
* This file is part of the MarVAlt Open SDK.
|
|
66
|
+
* Copyright (c) 2025 Vibune Pty Ltd.
|
|
67
|
+
*/
|
|
68
|
+
|
|
69
|
+
interface ThemeProviderProps {
|
|
70
|
+
children: React.ReactNode;
|
|
71
|
+
wpStyles?: ThemeStyles;
|
|
72
|
+
}
|
|
73
|
+
declare const ThemeProvider: React.FC<ThemeProviderProps>;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* @license GPL-3.0-or-later
|
|
77
|
+
*
|
|
78
|
+
* This file is part of the MarVAlt Open SDK.
|
|
79
|
+
* Copyright (c) 2025 Vibune Pty Ltd.
|
|
80
|
+
*/
|
|
81
|
+
|
|
82
|
+
interface Section {
|
|
83
|
+
id: string;
|
|
84
|
+
type: 'section' | 'subsection';
|
|
85
|
+
block: WordPressBlock;
|
|
86
|
+
blocks: WordPressBlock[];
|
|
87
|
+
index: number;
|
|
88
|
+
style?: 'default' | 'alternate' | 'highlight';
|
|
89
|
+
customClass?: string;
|
|
90
|
+
customId?: string;
|
|
91
|
+
}
|
|
92
|
+
interface SectionStyle {
|
|
93
|
+
background: 'default' | 'alternate' | 'highlight';
|
|
94
|
+
className?: string;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* @license GPL-3.0-or-later
|
|
99
|
+
*
|
|
100
|
+
* This file is part of the MarVAlt Open SDK.
|
|
101
|
+
* Copyright (c) 2025 Vibune Pty Ltd.
|
|
102
|
+
*/
|
|
103
|
+
|
|
104
|
+
interface AutoSectionProps {
|
|
105
|
+
section: Section;
|
|
106
|
+
registry?: ComponentRegistry;
|
|
107
|
+
}
|
|
108
|
+
declare const AutoSection: React.FC<AutoSectionProps>;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* @license GPL-3.0-or-later
|
|
112
|
+
*
|
|
113
|
+
* This file is part of the MarVAlt Open SDK.
|
|
114
|
+
* Copyright (c) 2025 Vibune Pty Ltd.
|
|
115
|
+
*/
|
|
116
|
+
|
|
117
|
+
interface AutoBlockProps {
|
|
118
|
+
block: WordPressBlock;
|
|
119
|
+
registry?: ComponentRegistry;
|
|
120
|
+
}
|
|
121
|
+
declare const AutoBlock: React.FC<AutoBlockProps>;
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* @license GPL-3.0-or-later
|
|
125
|
+
*
|
|
126
|
+
* This file is part of the MarVAlt Open SDK.
|
|
127
|
+
* Copyright (c) 2025 Vibune Pty Ltd.
|
|
128
|
+
*/
|
|
129
|
+
|
|
130
|
+
interface WordPressPage {
|
|
131
|
+
blocks?: WordPressBlock[];
|
|
132
|
+
[key: string]: any;
|
|
133
|
+
}
|
|
134
|
+
interface StyledPageProps {
|
|
135
|
+
page: WordPressPage;
|
|
136
|
+
registry?: ComponentRegistry;
|
|
137
|
+
}
|
|
138
|
+
declare const StyledPage: React.FC<StyledPageProps>;
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* @license GPL-3.0-or-later
|
|
142
|
+
*
|
|
143
|
+
* This file is part of the MarVAlt Open SDK.
|
|
144
|
+
* Copyright (c) 2025 Vibune Pty Ltd.
|
|
145
|
+
*/
|
|
146
|
+
|
|
147
|
+
declare const defaultTokens: DesignTokens;
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* @license GPL-3.0-or-later
|
|
151
|
+
*
|
|
152
|
+
* This file is part of the MarVAlt Open SDK.
|
|
153
|
+
* Copyright (c) 2025 Vibune Pty Ltd.
|
|
154
|
+
*/
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Convert WordPress theme styles to design tokens
|
|
158
|
+
*/
|
|
159
|
+
declare function convertWordPressToTokens(wpStyles?: ThemeStyles): DesignTokens;
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* @license GPL-3.0-or-later
|
|
163
|
+
*
|
|
164
|
+
* This file is part of the MarVAlt Open SDK.
|
|
165
|
+
* Copyright (c) 2025 Vibune Pty Ltd.
|
|
166
|
+
*/
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Inject CSS variables from design tokens into the document
|
|
170
|
+
*/
|
|
171
|
+
declare function injectCSSVariables(tokens: DesignTokens): void;
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* @license GPL-3.0-or-later
|
|
175
|
+
*
|
|
176
|
+
* This file is part of the MarVAlt Open SDK.
|
|
177
|
+
* Copyright (c) 2025 Vibune Pty Ltd.
|
|
178
|
+
*/
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Detect sections from WordPress blocks
|
|
182
|
+
* Sections are defined by core/group blocks (with or without alignment)
|
|
183
|
+
* Sub-sections are core/columns blocks inside groups
|
|
184
|
+
*/
|
|
185
|
+
declare function detectSections(blocks: WordPressBlock[]): Section[];
|
|
186
|
+
/**
|
|
187
|
+
* Determine section style based on alternating logic and custom classes
|
|
188
|
+
* Rules:
|
|
189
|
+
* - default is always first
|
|
190
|
+
* - after default follows alternate
|
|
191
|
+
* - highlight resets - next section is default
|
|
192
|
+
*/
|
|
193
|
+
declare function determineSectionStyle(section: Section, previousStyle?: 'default' | 'alternate' | 'highlight'): 'default' | 'alternate' | 'highlight';
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* @license GPL-3.0-or-later
|
|
197
|
+
*
|
|
198
|
+
* This file is part of the MarVAlt Open SDK.
|
|
199
|
+
* Copyright (c) 2025 Vibune Pty Ltd.
|
|
200
|
+
*/
|
|
201
|
+
|
|
202
|
+
type TemplateComponent = ComponentType<any>;
|
|
203
|
+
/**
|
|
204
|
+
* Select template component based on section properties
|
|
205
|
+
*/
|
|
206
|
+
declare function selectTemplate(section: Section): string;
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* @license GPL-3.0-or-later
|
|
210
|
+
*
|
|
211
|
+
* This file is part of the MarVAlt Open SDK.
|
|
212
|
+
* Copyright (c) 2025 Vibune Pty Ltd.
|
|
213
|
+
*/
|
|
214
|
+
|
|
215
|
+
interface BlockRendererProps {
|
|
216
|
+
block: WordPressBlock;
|
|
217
|
+
className?: string;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* @license GPL-3.0-or-later
|
|
222
|
+
*
|
|
223
|
+
* This file is part of the MarVAlt Open SDK.
|
|
224
|
+
* Copyright (c) 2025 Vibune Pty Ltd.
|
|
225
|
+
*/
|
|
226
|
+
|
|
227
|
+
type BlockRenderer = ComponentType<BlockRendererProps>;
|
|
228
|
+
/**
|
|
229
|
+
* Select block renderer based on block type
|
|
230
|
+
*/
|
|
231
|
+
declare function selectBlockRenderer(block: WordPressBlock): string;
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* @license GPL-3.0-or-later
|
|
235
|
+
*
|
|
236
|
+
* This file is part of the MarVAlt Open SDK.
|
|
237
|
+
* Copyright (c) 2025 Vibune Pty Ltd.
|
|
238
|
+
*/
|
|
239
|
+
|
|
240
|
+
interface SectionBaseProps {
|
|
241
|
+
section: Section;
|
|
242
|
+
children?: React.ReactNode;
|
|
243
|
+
}
|
|
244
|
+
declare const SectionBase: React.FC<SectionBaseProps>;
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* @license GPL-3.0-or-later
|
|
248
|
+
*
|
|
249
|
+
* This file is part of the MarVAlt Open SDK.
|
|
250
|
+
* Copyright (c) 2025 Vibune Pty Ltd.
|
|
251
|
+
*/
|
|
252
|
+
|
|
253
|
+
interface SectionWaveProps {
|
|
254
|
+
section: Section;
|
|
255
|
+
children?: React.ReactNode;
|
|
256
|
+
waveTop?: boolean;
|
|
257
|
+
waveBottom?: boolean;
|
|
258
|
+
}
|
|
259
|
+
declare const SectionWave: React.FC<SectionWaveProps>;
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* @license GPL-3.0-or-later
|
|
263
|
+
*
|
|
264
|
+
* This file is part of the MarVAlt Open SDK.
|
|
265
|
+
* Copyright (c) 2025 Vibune Pty Ltd.
|
|
266
|
+
*/
|
|
267
|
+
|
|
268
|
+
interface HeroDefaultProps {
|
|
269
|
+
section: Section;
|
|
270
|
+
children?: React.ReactNode;
|
|
271
|
+
}
|
|
272
|
+
declare const HeroDefault: React.FC<HeroDefaultProps>;
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* @license GPL-3.0-or-later
|
|
276
|
+
*
|
|
277
|
+
* This file is part of the MarVAlt Open SDK.
|
|
278
|
+
* Copyright (c) 2025 Vibune Pty Ltd.
|
|
279
|
+
*/
|
|
280
|
+
|
|
281
|
+
interface FooterMinimalProps {
|
|
282
|
+
section: Section;
|
|
283
|
+
children?: React.ReactNode;
|
|
284
|
+
}
|
|
285
|
+
declare const FooterMinimal: React.FC<FooterMinimalProps>;
|
|
286
|
+
|
|
287
|
+
export { AutoBlock, AutoSection, FooterMinimal, HeroDefault, SectionBase, SectionWave, StyledPage, ThemeProvider, convertWordPressToTokens, defaultTokens, detectSections, determineSectionStyle, injectCSSVariables, selectBlockRenderer, selectTemplate };
|
|
288
|
+
export type { AutoBlockProps, AutoSectionProps, BlockRenderer, BlockRendererProps, DesignTokens, FooterMinimalProps, HeroDefaultProps, Section, SectionBaseProps, SectionStyle, SectionWaveProps, StyledPageProps, TemplateComponent, ThemeProviderProps, ThemeStyles, WordPressPage };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC"}
|