@bagelink/blox 1.5.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 +21 -0
- package/README.md +844 -0
- package/components/base/Button.vue +140 -0
- package/components/base/Container.vue +64 -0
- package/components/base/Image.vue +75 -0
- package/components/base/Spacer.vue +33 -0
- package/components/base/Text.vue +37 -0
- package/components/base/Title.vue +55 -0
- package/components/index.ts +20 -0
- package/config/baseComponents.ts +342 -0
- package/core/communication.ts +140 -0
- package/core/registry.ts +108 -0
- package/core/renderer.ts +217 -0
- package/core/types.ts +148 -0
- package/dist/blox.css +296 -0
- package/dist/components/base/Button.vue.d.ts +26 -0
- package/dist/components/base/Button.vue.d.ts.map +1 -0
- package/dist/components/base/Container.vue.d.ts +37 -0
- package/dist/components/base/Container.vue.d.ts.map +1 -0
- package/dist/components/base/Image.vue.d.ts +26 -0
- package/dist/components/base/Image.vue.d.ts.map +1 -0
- package/dist/components/base/Spacer.vue.d.ts +16 -0
- package/dist/components/base/Spacer.vue.d.ts.map +1 -0
- package/dist/components/base/Text.vue.d.ts +13 -0
- package/dist/components/base/Text.vue.d.ts.map +1 -0
- package/dist/components/base/Title.vue.d.ts +14 -0
- package/dist/components/base/Title.vue.d.ts.map +1 -0
- package/dist/components/index.d.ts +18 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/config/baseComponents.d.ts +39 -0
- package/dist/config/baseComponents.d.ts.map +1 -0
- package/dist/core/communication.d.ts +44 -0
- package/dist/core/communication.d.ts.map +1 -0
- package/dist/core/registry.d.ts +56 -0
- package/dist/core/registry.d.ts.map +1 -0
- package/dist/core/renderer.d.ts +27 -0
- package/dist/core/renderer.d.ts.map +1 -0
- package/dist/core/types.d.ts +105 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/index.cjs +1305 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.mjs +1260 -0
- package/dist/setup.d.ts +24 -0
- package/dist/setup.d.ts.map +1 -0
- package/dist/utils/normalizer.d.ts +18 -0
- package/dist/utils/normalizer.d.ts.map +1 -0
- package/dist/utils/styles.d.ts +13 -0
- package/dist/utils/styles.d.ts.map +1 -0
- package/dist/views/ExternalPreview.vue.d.ts +12 -0
- package/dist/views/ExternalPreview.vue.d.ts.map +1 -0
- package/dist/views/RenderPage.vue.d.ts +10 -0
- package/dist/views/RenderPage.vue.d.ts.map +1 -0
- package/dist/vite.config.d.ts +3 -0
- package/dist/vite.config.d.ts.map +1 -0
- package/index.ts +27 -0
- package/package.json +94 -0
- package/setup.ts +56 -0
- package/utils/normalizer.ts +74 -0
- package/utils/styles.ts +228 -0
- package/views/ExternalPreview.vue +420 -0
- package/views/RenderPage.vue +127 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base Container Component
|
|
3
|
+
*
|
|
4
|
+
* A wrapper component for grouping other blocks
|
|
5
|
+
*/
|
|
6
|
+
interface Props {
|
|
7
|
+
maxWidth?: number | string;
|
|
8
|
+
padding?: number | string;
|
|
9
|
+
gap?: number;
|
|
10
|
+
layout?: 'vertical' | 'horizontal' | 'grid';
|
|
11
|
+
columns?: number;
|
|
12
|
+
isMobile?: boolean;
|
|
13
|
+
}
|
|
14
|
+
declare function __VLS_template(): {
|
|
15
|
+
attrs: Partial<{}>;
|
|
16
|
+
slots: {
|
|
17
|
+
default?(_: {}): any;
|
|
18
|
+
};
|
|
19
|
+
refs: {};
|
|
20
|
+
rootEl: HTMLDivElement;
|
|
21
|
+
};
|
|
22
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
23
|
+
declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
24
|
+
maxWidth: number | string;
|
|
25
|
+
padding: number | string;
|
|
26
|
+
gap: number;
|
|
27
|
+
layout: "vertical" | "horizontal" | "grid";
|
|
28
|
+
columns: number;
|
|
29
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
30
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
31
|
+
export default _default;
|
|
32
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
33
|
+
new (): {
|
|
34
|
+
$slots: S;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=Container.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Container.vue.d.ts","sourceRoot":"","sources":["../../../components/base/Container.vue"],"names":[],"mappings":"AAkEA;;;;GAIG;AAEH,UAAU,KAAK;IACd,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAC1B,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACzB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,UAAU,GAAG,YAAY,GAAG,MAAM,CAAA;IAC3C,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAA;CAClB;AA0BD,iBAAS,cAAc;WAkCT,OAAO,IAA6B;;yBAVrB,GAAG;;;;EAe/B;AAUD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;cAlFT,MAAM,GAAG,MAAM;aAChB,MAAM,GAAG,MAAM;SACnB,MAAM;YACH,UAAU,GAAG,YAAY,GAAG,MAAM;aACjC,MAAM;wFAsFf,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAapG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base Image Component
|
|
3
|
+
*
|
|
4
|
+
* Displays an image with optional link and captions
|
|
5
|
+
*/
|
|
6
|
+
interface Props {
|
|
7
|
+
src?: string;
|
|
8
|
+
alt?: string;
|
|
9
|
+
caption?: string;
|
|
10
|
+
link?: string;
|
|
11
|
+
linkTarget?: '_self' | '_blank' | '_parent' | '_top';
|
|
12
|
+
objectFit?: 'contain' | 'cover' | 'fill' | 'none' | 'scale-down';
|
|
13
|
+
aspectRatio?: string;
|
|
14
|
+
isMobile?: boolean;
|
|
15
|
+
}
|
|
16
|
+
declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
17
|
+
link: string;
|
|
18
|
+
caption: string;
|
|
19
|
+
src: string;
|
|
20
|
+
alt: string;
|
|
21
|
+
linkTarget: "_self" | "_blank" | "_parent" | "_top";
|
|
22
|
+
objectFit: "contain" | "cover" | "fill" | "none" | "scale-down";
|
|
23
|
+
aspectRatio: string;
|
|
24
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLElement>;
|
|
25
|
+
export default _default;
|
|
26
|
+
//# sourceMappingURL=Image.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Image.vue.d.ts","sourceRoot":"","sources":["../../../components/base/Image.vue"],"names":[],"mappings":"AA6EA;;;;GAIG;AAEH,UAAU,KAAK;IACd,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,UAAU,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,CAAA;IACpD,SAAS,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,YAAY,CAAA;IAChE,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAA;CAClB;;UALO,MAAM;aADH,MAAM;SAFV,MAAM;SACN,MAAM;gBAGC,OAAO,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM;eACxC,SAAS,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,YAAY;iBAClD,MAAM;;AAsGrB,wBAQG"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base Spacer Component
|
|
3
|
+
*
|
|
4
|
+
* Creates vertical spacing between blocks
|
|
5
|
+
*/
|
|
6
|
+
interface Props {
|
|
7
|
+
height?: number | string;
|
|
8
|
+
heightMobile?: number | string;
|
|
9
|
+
isMobile?: boolean;
|
|
10
|
+
}
|
|
11
|
+
declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
12
|
+
height: number | string;
|
|
13
|
+
heightMobile: number | string;
|
|
14
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
15
|
+
export default _default;
|
|
16
|
+
//# sourceMappingURL=Spacer.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Spacer.vue.d.ts","sourceRoot":"","sources":["../../../components/base/Spacer.vue"],"names":[],"mappings":"AAmCA;;;;GAIG;AAEH,UAAU,KAAK;IACd,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACxB,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAA;CAClB;;YAHS,MAAM,GAAG,MAAM;kBACT,MAAM,GAAG,MAAM;;AA8D/B,wBAQG"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base Text Component
|
|
3
|
+
*
|
|
4
|
+
* A simple text/paragraph component for displaying rich content
|
|
5
|
+
*/
|
|
6
|
+
interface Props {
|
|
7
|
+
content?: string;
|
|
8
|
+
tag?: 'p' | 'div' | 'span' | 'article' | 'section';
|
|
9
|
+
align?: 'left' | 'center' | 'right' | 'justify';
|
|
10
|
+
}
|
|
11
|
+
declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
12
|
+
export default _default;
|
|
13
|
+
//# sourceMappingURL=Text.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Text.vue.d.ts","sourceRoot":"","sources":["../../../components/base/Text.vue"],"names":[],"mappings":"AAuCA;;;;GAIG;AAEH,UAAU,KAAK;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,GAAG,CAAC,EAAE,GAAG,GAAG,KAAK,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,CAAA;IAClD,KAAK,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,SAAS,CAAA;CAC/C;;AAwDD,wBAOG"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base Title Component
|
|
3
|
+
*
|
|
4
|
+
* Renders headings with customizable tag and styling
|
|
5
|
+
*/
|
|
6
|
+
interface Props {
|
|
7
|
+
title?: string;
|
|
8
|
+
subTitle?: string;
|
|
9
|
+
tag?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
10
|
+
align?: 'left' | 'center' | 'right';
|
|
11
|
+
}
|
|
12
|
+
declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
13
|
+
export default _default;
|
|
14
|
+
//# sourceMappingURL=Title.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Title.vue.d.ts","sourceRoot":"","sources":["../../../components/base/Title.vue"],"names":[],"mappings":"AAyDA;;;;GAIG;AAEH,UAAU,KAAK;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,GAAG,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAA;IAC7C,KAAK,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAA;CACnC;;AAsED,wBAOG"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Component Exports
|
|
3
|
+
*
|
|
4
|
+
* Export all base components for easy importing
|
|
5
|
+
*/
|
|
6
|
+
export { default as Button } from './base/Button.vue';
|
|
7
|
+
export * from './base/Button.vue';
|
|
8
|
+
export { default as Container } from './base/Container.vue';
|
|
9
|
+
export * from './base/Container.vue';
|
|
10
|
+
export { default as Image } from './base/Image.vue';
|
|
11
|
+
export * from './base/Image.vue';
|
|
12
|
+
export { default as Spacer } from './base/Spacer.vue';
|
|
13
|
+
export * from './base/Spacer.vue';
|
|
14
|
+
export { default as Text } from './base/Text.vue';
|
|
15
|
+
export * from './base/Text.vue';
|
|
16
|
+
export { default as Title } from './base/Title.vue';
|
|
17
|
+
export * from './base/Title.vue';
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../components/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,mBAAmB,CAAA;AACrD,cAAc,mBAAmB,CAAA;AACjC,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAC3D,cAAc,sBAAsB,CAAA;AACpC,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,kBAAkB,CAAA;AACnD,cAAc,kBAAkB,CAAA;AAEhC,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,mBAAmB,CAAA;AACrD,cAAc,mBAAmB,CAAA;AACjC,OAAO,EAAE,OAAO,IAAI,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAEjD,cAAc,iBAAiB,CAAA;AAC/B,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,kBAAkB,CAAA;AACnD,cAAc,kBAAkB,CAAA"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ComponentConstructor } from '../core/types';
|
|
2
|
+
export interface ComponentSchema {
|
|
3
|
+
type: 'text' | 'richtext' | 'number' | 'checkbox' | 'select' | 'upload' | 'color' | 'array' | 'row';
|
|
4
|
+
key: string;
|
|
5
|
+
label: string;
|
|
6
|
+
defaultValue?: any;
|
|
7
|
+
options?: Array<{
|
|
8
|
+
label: string;
|
|
9
|
+
value: any;
|
|
10
|
+
}>;
|
|
11
|
+
height?: string | number;
|
|
12
|
+
fields?: ComponentSchema[];
|
|
13
|
+
class?: string;
|
|
14
|
+
placeholder?: string;
|
|
15
|
+
[key: string]: any;
|
|
16
|
+
}
|
|
17
|
+
export interface ComponentConfig {
|
|
18
|
+
id: string;
|
|
19
|
+
label: string;
|
|
20
|
+
icon: string;
|
|
21
|
+
img?: string;
|
|
22
|
+
order?: number;
|
|
23
|
+
component: ComponentConstructor;
|
|
24
|
+
content?: ComponentSchema[];
|
|
25
|
+
settings?: ComponentSchema[];
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Base component configurations
|
|
29
|
+
*/
|
|
30
|
+
export declare const baseComponentConfigs: ComponentConfig[];
|
|
31
|
+
/**
|
|
32
|
+
* Get all base component configurations
|
|
33
|
+
*/
|
|
34
|
+
export declare function getBaseComponentConfigs(): ComponentConfig[];
|
|
35
|
+
/**
|
|
36
|
+
* Get a base component configuration by ID
|
|
37
|
+
*/
|
|
38
|
+
export declare function getBaseComponentConfig(id: string): ComponentConfig | undefined;
|
|
39
|
+
//# sourceMappingURL=baseComponents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"baseComponents.d.ts","sourceRoot":"","sources":["../../config/baseComponents.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAA;AAUzD,MAAM,WAAW,eAAe;IAC/B,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,QAAQ,GAAG,UAAU,GAAG,QAAQ,GAAG,QAAQ,GAAG,OAAO,GAAG,OAAO,GAAG,KAAK,CAAA;IACnG,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,YAAY,CAAC,EAAE,GAAG,CAAA;IAClB,OAAO,CAAC,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,GAAG,CAAA;KAAE,CAAC,CAAA;IAC9C,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACxB,MAAM,CAAC,EAAE,eAAe,EAAE,CAAA;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CAClB;AAED,MAAM,WAAW,eAAe;IAC/B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,oBAAoB,CAAA;IAC/B,OAAO,CAAC,EAAE,eAAe,EAAE,CAAA;IAC3B,QAAQ,CAAC,EAAE,eAAe,EAAE,CAAA;CAC5B;AAED;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,eAAe,EA4RjD,CAAA;AAED;;GAEG;AACH,wBAAgB,uBAAuB,IAAI,eAAe,EAAE,CAE3D;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,EAAE,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS,CAE9E"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { EditorMessage, MessageType } from './types';
|
|
2
|
+
export type MessageHandler = (message: EditorMessage) => void;
|
|
3
|
+
interface CommunicationConfig {
|
|
4
|
+
origin: string;
|
|
5
|
+
targetWindow?: Window;
|
|
6
|
+
onMessage?: MessageHandler;
|
|
7
|
+
}
|
|
8
|
+
export declare class CommunicationBridge {
|
|
9
|
+
private origin;
|
|
10
|
+
private targetWindow;
|
|
11
|
+
private handlers;
|
|
12
|
+
private boundMessageHandler;
|
|
13
|
+
constructor(config: CommunicationConfig);
|
|
14
|
+
/**
|
|
15
|
+
* Handle incoming messages
|
|
16
|
+
*/
|
|
17
|
+
private handleMessage;
|
|
18
|
+
/**
|
|
19
|
+
* Register a handler for a specific message type
|
|
20
|
+
*/
|
|
21
|
+
on(type: MessageType | '*', handler: MessageHandler): () => void;
|
|
22
|
+
/**
|
|
23
|
+
* Unregister a handler
|
|
24
|
+
*/
|
|
25
|
+
off(type: MessageType | '*', handler: MessageHandler): void;
|
|
26
|
+
/**
|
|
27
|
+
* Send a message to the target window (editor)
|
|
28
|
+
*/
|
|
29
|
+
send(type: MessageType, message?: any, data?: any): void;
|
|
30
|
+
/**
|
|
31
|
+
* Cleanup
|
|
32
|
+
*/
|
|
33
|
+
destroy(): void;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Create a communication bridge instance
|
|
37
|
+
*/
|
|
38
|
+
export declare function createCommunicationBridge(config: CommunicationConfig): CommunicationBridge;
|
|
39
|
+
/**
|
|
40
|
+
* Simple send helper for one-off messages
|
|
41
|
+
*/
|
|
42
|
+
export declare function sendMessage(type: MessageType, message?: any, targetWindow?: Window, origin?: string): void;
|
|
43
|
+
export {};
|
|
44
|
+
//# sourceMappingURL=communication.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"communication.d.ts","sourceRoot":"","sources":["../../core/communication.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAEzD,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,EAAE,aAAa,KAAK,IAAI,CAAA;AAE7D,UAAU,mBAAmB;IAC5B,MAAM,EAAE,MAAM,CAAA;IACd,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,SAAS,CAAC,EAAE,cAAc,CAAA;CAC1B;AAED,qBAAa,mBAAmB;IAC/B,OAAO,CAAC,MAAM,CAAQ;IACtB,OAAO,CAAC,YAAY,CAAQ;IAC5B,OAAO,CAAC,QAAQ,CAAuC;IACvD,OAAO,CAAC,mBAAmB,CAA+B;gBAE9C,MAAM,EAAE,mBAAmB;IAYvC;;OAEG;IACH,OAAO,CAAC,aAAa;IAyCrB;;OAEG;IACH,EAAE,CAAC,IAAI,EAAE,WAAW,GAAG,GAAG,EAAE,OAAO,EAAE,cAAc,GAAG,MAAM,IAAI;IAWhE;;OAEG;IACH,GAAG,CAAC,IAAI,EAAE,WAAW,GAAG,GAAG,EAAE,OAAO,EAAE,cAAc,GAAG,IAAI;IAO3D;;OAEG;IACH,IAAI,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,GAAG,GAAG,IAAI;IAMxD;;OAEG;IACH,OAAO,IAAI,IAAI;CAKf;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,mBAAmB,GAAG,mBAAmB,CAE1F;AAED;;GAEG;AACH,wBAAgB,WAAW,CAC1B,IAAI,EAAE,WAAW,EACjB,OAAO,CAAC,EAAE,GAAG,EACb,YAAY,GAAE,MAAsB,EACpC,MAAM,GAAE,MAAY,GAClB,IAAI,CAGN"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { ComponentRegistry, ComponentConstructor } from './types';
|
|
2
|
+
declare const registry: ComponentRegistry;
|
|
3
|
+
/**
|
|
4
|
+
* Register a component for a specific block type
|
|
5
|
+
* @param type - The block type (e.g., 'Text', 'Button', 'Hero')
|
|
6
|
+
* @param component - The Vue component to render
|
|
7
|
+
*/
|
|
8
|
+
export declare function registerComponent(type: string, component: ComponentConstructor): void;
|
|
9
|
+
/**
|
|
10
|
+
* Register multiple components at once
|
|
11
|
+
* @param components - Object mapping block types to components
|
|
12
|
+
*/
|
|
13
|
+
export declare function registerComponents(components: ComponentRegistry): void;
|
|
14
|
+
/**
|
|
15
|
+
* Get a registered component by type
|
|
16
|
+
* @param type - The block type
|
|
17
|
+
* @returns The component or undefined if not found
|
|
18
|
+
*/
|
|
19
|
+
export declare function getComponent(type: string): ComponentConstructor | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* Check if a component type is registered
|
|
22
|
+
* @param type - The block type
|
|
23
|
+
* @returns True if registered
|
|
24
|
+
*/
|
|
25
|
+
export declare function hasComponent(type: string): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Get all registered components
|
|
28
|
+
* @returns The full registry
|
|
29
|
+
*/
|
|
30
|
+
export declare function getAllComponents(): ComponentRegistry;
|
|
31
|
+
/**
|
|
32
|
+
* Unregister a component
|
|
33
|
+
* @param type - The block type to remove
|
|
34
|
+
*/
|
|
35
|
+
export declare function unregisterComponent(type: string): void;
|
|
36
|
+
/**
|
|
37
|
+
* Clear all registered components
|
|
38
|
+
*/
|
|
39
|
+
export declare function clearRegistry(): void;
|
|
40
|
+
/**
|
|
41
|
+
* Get a list of all registered component types
|
|
42
|
+
* @returns Array of registered type names
|
|
43
|
+
*/
|
|
44
|
+
export declare function getRegisteredTypes(): string[];
|
|
45
|
+
/**
|
|
46
|
+
* Create a namespaced registry for multi-tenant scenarios
|
|
47
|
+
*/
|
|
48
|
+
export declare function createNamespacedRegistry(namespace: string): {
|
|
49
|
+
register: (type: string, component: ComponentConstructor) => void;
|
|
50
|
+
get: (type: string) => any;
|
|
51
|
+
getAll: () => {
|
|
52
|
+
[key: string]: any;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
export { registry };
|
|
56
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../core/registry.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAGtE,QAAA,MAAM,QAAQ,EAAE,iBAAsB,CAAA;AAEtC;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,oBAAoB,GAAG,IAAI,CAMrF;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,iBAAiB,GAAG,IAAI,CAItE;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,oBAAoB,GAAG,SAAS,CAE3E;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAElD;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,iBAAiB,CAEpD;AAED;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAGtD;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,IAAI,CAGpC;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,EAAE,CAE7C;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,MAAM;qBAIvC,MAAM,aAAa,oBAAoB;gBAK5C,MAAM;;;;EAMnB;AAGD,OAAO,EAAE,QAAQ,EAAE,CAAA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { PageData, ComponentData } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Inject responsive CSS into the page
|
|
4
|
+
*/
|
|
5
|
+
export declare function injectResponsiveCSS(): void;
|
|
6
|
+
/**
|
|
7
|
+
* Inject custom code into head or body
|
|
8
|
+
*/
|
|
9
|
+
export declare function injectCode(code: string | undefined, target: 'head' | 'body'): void;
|
|
10
|
+
export declare function loadGoogleFont(fontName: string): Promise<void>;
|
|
11
|
+
/**
|
|
12
|
+
* Load all fonts used in components
|
|
13
|
+
*/
|
|
14
|
+
export declare function loadComponentFonts(components: ComponentData[]): Promise<void>;
|
|
15
|
+
/**
|
|
16
|
+
* Apply global font to the page
|
|
17
|
+
*/
|
|
18
|
+
export declare function applyGlobalFont(fontName: string): void;
|
|
19
|
+
/**
|
|
20
|
+
* Apply page settings to the document
|
|
21
|
+
*/
|
|
22
|
+
export declare function applyPageSettings(pageData: PageData): void;
|
|
23
|
+
/**
|
|
24
|
+
* Initialize the page for rendering
|
|
25
|
+
*/
|
|
26
|
+
export declare function initializePage(pageData: PageData): Promise<void>;
|
|
27
|
+
//# sourceMappingURL=renderer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../../core/renderer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAGtD;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CAU1C;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CASlF;AAOD,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA2B9D;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CAAC,UAAU,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAanF;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CA2BtD;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAqC1D;AAsCD;;GAEG;AACH,wBAAsB,cAAc,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAatE"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core type definitions for the Blox external preview library
|
|
3
|
+
*/
|
|
4
|
+
export interface ComponentData {
|
|
5
|
+
id: string;
|
|
6
|
+
type: string;
|
|
7
|
+
data: Record<string, any>;
|
|
8
|
+
}
|
|
9
|
+
export interface PageData {
|
|
10
|
+
id?: string;
|
|
11
|
+
components: ComponentData[];
|
|
12
|
+
pageSettings?: PageSettings;
|
|
13
|
+
header_code?: string;
|
|
14
|
+
body_code?: string;
|
|
15
|
+
language?: Record<string, any>;
|
|
16
|
+
}
|
|
17
|
+
export interface PageSettings {
|
|
18
|
+
selectedGoogleFont?: string;
|
|
19
|
+
pageLanguage?: string;
|
|
20
|
+
pageDirection?: 'ltr' | 'rtl';
|
|
21
|
+
additionalHeadCode?: string;
|
|
22
|
+
additionalBodyCode?: string;
|
|
23
|
+
customFavicon?: string;
|
|
24
|
+
customOgImage?: string;
|
|
25
|
+
customKeywords?: string;
|
|
26
|
+
customRobotsMeta?: string;
|
|
27
|
+
customAnalyticsCode?: string;
|
|
28
|
+
disableGlobalHeadCode?: boolean;
|
|
29
|
+
disableGlobalBodyCode?: boolean;
|
|
30
|
+
disableGoogleAnalytics?: boolean;
|
|
31
|
+
disableFacebookPixel?: boolean;
|
|
32
|
+
}
|
|
33
|
+
export interface GlobalSettings {
|
|
34
|
+
selectedGoogleFont?: string;
|
|
35
|
+
pageLanguage?: string;
|
|
36
|
+
pageDirection?: 'ltr' | 'rtl';
|
|
37
|
+
globalHeadCode?: string;
|
|
38
|
+
globalBodyCode?: string;
|
|
39
|
+
favicon?: string;
|
|
40
|
+
ogImage?: string;
|
|
41
|
+
siteKeywords?: string;
|
|
42
|
+
googleAnalyticsId?: string;
|
|
43
|
+
facebookPixelId?: string;
|
|
44
|
+
}
|
|
45
|
+
export type MessageType = 'ready' | 'update' | 'focus' | 'highlight' | 'preview' | 'meta' | 'delete' | 'disableLinks' | 'newBlock';
|
|
46
|
+
export interface EditorMessage {
|
|
47
|
+
type: MessageType;
|
|
48
|
+
message?: any;
|
|
49
|
+
data?: any;
|
|
50
|
+
isMobile?: boolean;
|
|
51
|
+
}
|
|
52
|
+
export interface BlockProps {
|
|
53
|
+
isMobile?: boolean;
|
|
54
|
+
[key: string]: any;
|
|
55
|
+
}
|
|
56
|
+
export interface StyleConfig {
|
|
57
|
+
marginTop?: number;
|
|
58
|
+
marginBottom?: number;
|
|
59
|
+
marginTopMobile?: number;
|
|
60
|
+
marginBottomMobile?: number;
|
|
61
|
+
padding?: number;
|
|
62
|
+
paddingMobile?: number;
|
|
63
|
+
width?: number;
|
|
64
|
+
widthMobile?: number;
|
|
65
|
+
widthPercent?: number;
|
|
66
|
+
widthPercentMobile?: number;
|
|
67
|
+
fullWidth?: boolean;
|
|
68
|
+
fullWidthMobile?: boolean;
|
|
69
|
+
backgroundColor?: string;
|
|
70
|
+
backgroundColorMobile?: string;
|
|
71
|
+
textColor?: string;
|
|
72
|
+
textColorMobile?: string;
|
|
73
|
+
borderWidth?: number;
|
|
74
|
+
borderWidthMobile?: number;
|
|
75
|
+
borderStyle?: string;
|
|
76
|
+
borderStyleMobile?: string;
|
|
77
|
+
borderColor?: string;
|
|
78
|
+
borderColorMobile?: string;
|
|
79
|
+
borderRadius?: number;
|
|
80
|
+
borderRadiusMobile?: number;
|
|
81
|
+
fontFamily?: string;
|
|
82
|
+
fontFamilyMobile?: string;
|
|
83
|
+
center?: boolean;
|
|
84
|
+
centerMobile?: boolean;
|
|
85
|
+
shadowType?: 'none' | 'sm' | 'md' | 'lg' | 'xl' | 'custom';
|
|
86
|
+
shadowTypeMobile?: 'none' | 'sm' | 'md' | 'lg' | 'xl' | 'custom';
|
|
87
|
+
zIndex?: number;
|
|
88
|
+
zIndexMobile?: number;
|
|
89
|
+
showDesktop?: boolean;
|
|
90
|
+
showMobile?: boolean;
|
|
91
|
+
customId?: string;
|
|
92
|
+
customCSS?: string;
|
|
93
|
+
}
|
|
94
|
+
export type ComponentConstructor = any;
|
|
95
|
+
export interface ComponentRegistry {
|
|
96
|
+
[key: string]: ComponentConstructor;
|
|
97
|
+
}
|
|
98
|
+
export interface RendererConfig {
|
|
99
|
+
components: ComponentRegistry;
|
|
100
|
+
pageData: PageData;
|
|
101
|
+
isMobile?: boolean;
|
|
102
|
+
previewMode?: boolean;
|
|
103
|
+
editorMode?: boolean;
|
|
104
|
+
}
|
|
105
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../core/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,MAAM,WAAW,aAAa;IAC7B,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CACzB;AAGD,MAAM,WAAW,QAAQ;IACxB,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,UAAU,EAAE,aAAa,EAAE,CAAA;IAC3B,YAAY,CAAC,EAAE,YAAY,CAAA;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;IACl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