@builder.io/sdk-svelte 0.11.2 → 0.11.4
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/lib/browser/blocks/button/button.svelte +0 -5
- package/lib/browser/blocks/button/button.svelte.d.ts +20 -0
- package/lib/browser/blocks/button/button.types.d.ts +6 -0
- package/lib/browser/blocks/button/button.types.js +1 -0
- package/lib/browser/blocks/columns/columns.svelte.d.ts +2 -14
- package/lib/browser/blocks/columns/columns.types.d.ts +15 -0
- package/lib/browser/blocks/columns/columns.types.js +1 -0
- package/lib/browser/blocks/fragment/fragment.svelte +0 -2
- package/lib/browser/blocks/fragment/fragment.svelte.d.ts +17 -0
- package/lib/browser/blocks/fragment/fragment.types.d.ts +5 -0
- package/lib/browser/blocks/fragment/fragment.types.js +1 -0
- package/lib/browser/blocks/image/image.svelte +0 -2
- package/lib/browser/blocks/image/image.svelte.d.ts +30 -0
- package/lib/browser/blocks/image/image.types.d.ts +19 -0
- package/lib/browser/blocks/image/image.types.js +1 -0
- package/lib/browser/blocks/section/section.svelte +0 -5
- package/lib/browser/blocks/section/section.svelte.d.ts +20 -0
- package/lib/browser/blocks/section/section.types.d.ts +6 -0
- package/lib/browser/blocks/section/section.types.js +1 -0
- package/lib/browser/blocks/symbol/symbol.svelte +0 -5
- package/lib/browser/blocks/symbol/symbol.svelte.d.ts +23 -0
- package/lib/browser/blocks/symbol/symbol.types.d.ts +18 -0
- package/lib/browser/blocks/symbol/symbol.types.js +1 -0
- package/lib/browser/blocks/text/text.svelte +0 -2
- package/lib/browser/blocks/text/text.svelte.d.ts +17 -0
- package/lib/browser/blocks/text/text.types.d.ts +3 -0
- package/lib/browser/blocks/text/text.types.js +1 -0
- package/lib/browser/blocks/video/video.svelte +0 -2
- package/lib/browser/blocks/video/video.svelte.d.ts +33 -0
- package/lib/browser/blocks/video/video.types.d.ts +21 -0
- package/lib/browser/blocks/video/video.types.js +1 -0
- package/lib/browser/components/block/block.svelte +3 -5
- package/lib/browser/components/block/components/component-ref/component-ref.svelte +1 -6
- package/lib/browser/components/blocks/blocks.svelte +1 -10
- package/lib/browser/components/blocks/blocks.svelte.d.ts +22 -0
- package/lib/browser/components/blocks/blocks.types.d.ts +8 -0
- package/lib/browser/components/blocks/blocks.types.js +1 -0
- package/lib/browser/components/content/components/enable-editor.svelte +28 -0
- package/lib/browser/components/content/components/enable-editor.svelte.d.ts +2 -1
- package/lib/browser/components/content/content.helpers.d.ts +1 -1
- package/lib/browser/components/content/content.helpers.js +1 -1
- package/lib/browser/components/content/content.svelte +3 -2
- package/lib/browser/components/content-variants/content-variants.types.d.ts +30 -1
- package/lib/browser/constants/sdk-version.d.ts +1 -1
- package/lib/browser/constants/sdk-version.js +1 -1
- package/lib/browser/functions/get-content/index.d.ts +1 -1
- package/lib/browser/functions/get-content/index.js +1 -1
- package/lib/browser/functions/get-content/types.d.ts +2 -2
- package/lib/browser/server-index.d.ts +10 -1
- package/lib/edge/blocks/button/button.svelte +0 -5
- package/lib/edge/blocks/button/button.svelte.d.ts +20 -0
- package/lib/edge/blocks/button/button.types.d.ts +6 -0
- package/lib/edge/blocks/button/button.types.js +1 -0
- package/lib/edge/blocks/columns/columns.svelte.d.ts +2 -14
- package/lib/edge/blocks/columns/columns.types.d.ts +15 -0
- package/lib/edge/blocks/columns/columns.types.js +1 -0
- package/lib/edge/blocks/fragment/fragment.svelte +0 -2
- package/lib/edge/blocks/fragment/fragment.svelte.d.ts +17 -0
- package/lib/edge/blocks/fragment/fragment.types.d.ts +5 -0
- package/lib/edge/blocks/fragment/fragment.types.js +1 -0
- package/lib/edge/blocks/image/image.svelte +0 -2
- package/lib/edge/blocks/image/image.svelte.d.ts +30 -0
- package/lib/edge/blocks/image/image.types.d.ts +19 -0
- package/lib/edge/blocks/image/image.types.js +1 -0
- package/lib/edge/blocks/section/section.svelte +0 -5
- package/lib/edge/blocks/section/section.svelte.d.ts +20 -0
- package/lib/edge/blocks/section/section.types.d.ts +6 -0
- package/lib/edge/blocks/section/section.types.js +1 -0
- package/lib/edge/blocks/symbol/symbol.svelte +0 -5
- package/lib/edge/blocks/symbol/symbol.svelte.d.ts +23 -0
- package/lib/edge/blocks/symbol/symbol.types.d.ts +18 -0
- package/lib/edge/blocks/symbol/symbol.types.js +1 -0
- package/lib/edge/blocks/text/text.svelte +0 -2
- package/lib/edge/blocks/text/text.svelte.d.ts +17 -0
- package/lib/edge/blocks/text/text.types.d.ts +3 -0
- package/lib/edge/blocks/text/text.types.js +1 -0
- package/lib/edge/blocks/video/video.svelte +0 -2
- package/lib/edge/blocks/video/video.svelte.d.ts +33 -0
- package/lib/edge/blocks/video/video.types.d.ts +21 -0
- package/lib/edge/blocks/video/video.types.js +1 -0
- package/lib/edge/components/block/block.svelte +3 -5
- package/lib/edge/components/block/components/component-ref/component-ref.svelte +1 -6
- package/lib/edge/components/blocks/blocks.svelte +1 -10
- package/lib/edge/components/blocks/blocks.svelte.d.ts +22 -0
- package/lib/edge/components/blocks/blocks.types.d.ts +8 -0
- package/lib/edge/components/blocks/blocks.types.js +1 -0
- package/lib/edge/components/content/components/enable-editor.svelte +28 -0
- package/lib/edge/components/content/components/enable-editor.svelte.d.ts +2 -1
- package/lib/edge/components/content/content.helpers.d.ts +1 -1
- package/lib/edge/components/content/content.helpers.js +1 -1
- package/lib/edge/components/content/content.svelte +3 -2
- package/lib/edge/components/content-variants/content-variants.types.d.ts +30 -1
- package/lib/edge/constants/sdk-version.d.ts +1 -1
- package/lib/edge/constants/sdk-version.js +1 -1
- package/lib/edge/functions/get-content/index.d.ts +1 -1
- package/lib/edge/functions/get-content/index.js +1 -1
- package/lib/edge/functions/get-content/types.d.ts +2 -2
- package/lib/edge/server-index.d.ts +10 -1
- package/lib/node/blocks/button/button.svelte +0 -5
- package/lib/node/blocks/button/button.svelte.d.ts +20 -0
- package/lib/node/blocks/button/button.types.d.ts +6 -0
- package/lib/node/blocks/button/button.types.js +1 -0
- package/lib/node/blocks/columns/columns.svelte.d.ts +2 -14
- package/lib/node/blocks/columns/columns.types.d.ts +15 -0
- package/lib/node/blocks/columns/columns.types.js +1 -0
- package/lib/node/blocks/fragment/fragment.svelte +0 -2
- package/lib/node/blocks/fragment/fragment.svelte.d.ts +17 -0
- package/lib/node/blocks/fragment/fragment.types.d.ts +5 -0
- package/lib/node/blocks/fragment/fragment.types.js +1 -0
- package/lib/node/blocks/image/image.svelte +0 -2
- package/lib/node/blocks/image/image.svelte.d.ts +30 -0
- package/lib/node/blocks/image/image.types.d.ts +19 -0
- package/lib/node/blocks/image/image.types.js +1 -0
- package/lib/node/blocks/section/section.svelte +0 -5
- package/lib/node/blocks/section/section.svelte.d.ts +20 -0
- package/lib/node/blocks/section/section.types.d.ts +6 -0
- package/lib/node/blocks/section/section.types.js +1 -0
- package/lib/node/blocks/symbol/symbol.svelte +0 -5
- package/lib/node/blocks/symbol/symbol.svelte.d.ts +23 -0
- package/lib/node/blocks/symbol/symbol.types.d.ts +18 -0
- package/lib/node/blocks/symbol/symbol.types.js +1 -0
- package/lib/node/blocks/text/text.svelte +0 -2
- package/lib/node/blocks/text/text.svelte.d.ts +17 -0
- package/lib/node/blocks/text/text.types.d.ts +3 -0
- package/lib/node/blocks/text/text.types.js +1 -0
- package/lib/node/blocks/video/video.svelte +0 -2
- package/lib/node/blocks/video/video.svelte.d.ts +33 -0
- package/lib/node/blocks/video/video.types.d.ts +21 -0
- package/lib/node/blocks/video/video.types.js +1 -0
- package/lib/node/components/block/block.svelte +3 -5
- package/lib/node/components/block/components/component-ref/component-ref.svelte +1 -6
- package/lib/node/components/blocks/blocks.svelte +1 -10
- package/lib/node/components/blocks/blocks.svelte.d.ts +22 -0
- package/lib/node/components/blocks/blocks.types.d.ts +8 -0
- package/lib/node/components/blocks/blocks.types.js +1 -0
- package/lib/node/components/content/components/enable-editor.svelte +28 -0
- package/lib/node/components/content/components/enable-editor.svelte.d.ts +2 -1
- package/lib/node/components/content/content.helpers.d.ts +1 -1
- package/lib/node/components/content/content.helpers.js +1 -1
- package/lib/node/components/content/content.svelte +3 -2
- package/lib/node/components/content-variants/content-variants.types.d.ts +30 -1
- package/lib/node/constants/sdk-version.d.ts +1 -1
- package/lib/node/constants/sdk-version.js +1 -1
- package/lib/node/functions/get-content/index.d.ts +1 -1
- package/lib/node/functions/get-content/index.js +1 -1
- package/lib/node/functions/get-content/types.d.ts +2 -2
- package/lib/node/server-index.d.ts +10 -1
- package/package.json +1 -1
- package/src/blocks/button/button.svelte +1 -13
- package/src/blocks/button/button.types.ts +6 -0
- package/src/blocks/columns/columns.svelte +2 -20
- package/src/blocks/columns/columns.types.ts +14 -0
- package/src/blocks/fragment/fragment.svelte +1 -8
- package/src/blocks/fragment/fragment.types.ts +5 -0
- package/src/blocks/image/image.svelte +1 -22
- package/src/blocks/image/image.types.ts +19 -0
- package/src/blocks/section/section.svelte +1 -13
- package/src/blocks/section/section.types.ts +6 -0
- package/src/blocks/symbol/symbol.svelte +2 -31
- package/src/blocks/symbol/symbol.types.ts +17 -0
- package/src/blocks/text/text.svelte +2 -6
- package/src/blocks/text/text.types.ts +3 -0
- package/src/blocks/video/video.svelte +1 -33
- package/src/blocks/video/video.types.ts +21 -0
- package/src/components/block/block.svelte +3 -5
- package/src/components/block/components/component-ref/component-ref.svelte +1 -6
- package/src/components/blocks/blocks.svelte +2 -23
- package/src/components/blocks/blocks.types.ts +7 -0
- package/src/components/content/components/enable-editor.svelte +29 -1
- package/src/components/content/content.helpers.ts +1 -1
- package/src/components/content/content.svelte +3 -2
- package/src/components/content-variants/content-variants.types.ts +43 -1
- package/src/constants/sdk-version.ts +1 -1
- package/src/functions/get-content/index.ts +1 -1
- package/src/functions/get-content/types.ts +2 -2
- package/src/server-index.ts +10 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { ButtonProps } from "./button.types.js";
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
attributes?: ButtonProps["attributes"];
|
|
6
|
+
text?: ButtonProps["text"];
|
|
7
|
+
link?: ButtonProps["link"];
|
|
8
|
+
openLinkInNewTab?: ButtonProps["openLinkInNewTab"];
|
|
9
|
+
};
|
|
10
|
+
events: {
|
|
11
|
+
[evt: string]: CustomEvent<any>;
|
|
12
|
+
};
|
|
13
|
+
slots: {};
|
|
14
|
+
};
|
|
15
|
+
type ButtonProps_ = typeof __propDef.props;
|
|
16
|
+
export { ButtonProps_ as ButtonProps };
|
|
17
|
+
export type ButtonEvents = typeof __propDef.events;
|
|
18
|
+
export type ButtonSlots = typeof __propDef.slots;
|
|
19
|
+
export default class Button extends SvelteComponent<ButtonProps, ButtonEvents, ButtonSlots> {
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,18 +1,6 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
|
-
type
|
|
3
|
-
|
|
4
|
-
width?: number;
|
|
5
|
-
};
|
|
6
|
-
type StackColumnsAt = "tablet" | "mobile" | "never";
|
|
7
|
-
export interface ColumnProps extends BuilderComponentsProp {
|
|
8
|
-
columns?: Column[];
|
|
9
|
-
builderBlock: BuilderBlock;
|
|
10
|
-
space?: number;
|
|
11
|
-
stackColumnsAt?: StackColumnsAt;
|
|
12
|
-
reverseColumnsWhenStacked?: boolean;
|
|
13
|
-
}
|
|
14
|
-
import type { BuilderBlock } from "../../types/builder-block.js";
|
|
15
|
-
import type { BuilderComponentsProp, PropsWithBuilderData } from "../../types/builder-props.js";
|
|
2
|
+
import type { PropsWithBuilderData } from "../../types/builder-props.js";
|
|
3
|
+
import type { ColumnProps } from "./columns.types.js";
|
|
16
4
|
declare const __propDef: {
|
|
17
5
|
props: {
|
|
18
6
|
js: any;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { BuilderBlock } from '../../types/builder-block.js';
|
|
2
|
+
import type { BuilderComponentsProp } from '../../types/builder-props.js';
|
|
3
|
+
type Column = {
|
|
4
|
+
blocks: BuilderBlock[];
|
|
5
|
+
width?: number;
|
|
6
|
+
};
|
|
7
|
+
type StackColumnsAt = 'tablet' | 'mobile' | 'never';
|
|
8
|
+
export interface ColumnProps extends BuilderComponentsProp {
|
|
9
|
+
columns?: Column[];
|
|
10
|
+
builderBlock: BuilderBlock;
|
|
11
|
+
space?: number;
|
|
12
|
+
stackColumnsAt?: StackColumnsAt;
|
|
13
|
+
reverseColumnsWhenStacked?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { FragmentProps } from "./fragment.types.js";
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: Record<string, never>;
|
|
5
|
+
events: {
|
|
6
|
+
[evt: string]: CustomEvent<any>;
|
|
7
|
+
};
|
|
8
|
+
slots: {
|
|
9
|
+
default: {};
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
type FragmentProps_ = typeof __propDef.props;
|
|
13
|
+
export { FragmentProps_ as FragmentProps };
|
|
14
|
+
export type FragmentEvents = typeof __propDef.events;
|
|
15
|
+
export type FragmentSlots = typeof __propDef.slots;
|
|
16
|
+
export default class Fragment extends SvelteComponent<FragmentProps, FragmentEvents, FragmentSlots> {
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { ImageProps } from "./image.types.js";
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
image: ImageProps["image"];
|
|
6
|
+
src?: ImageProps["src"];
|
|
7
|
+
srcset?: ImageProps["srcset"];
|
|
8
|
+
noWebp?: ImageProps["noWebp"];
|
|
9
|
+
aspectRatio?: ImageProps["aspectRatio"];
|
|
10
|
+
altText?: ImageProps["altText"];
|
|
11
|
+
backgroundPosition?: ImageProps["backgroundPosition"];
|
|
12
|
+
backgroundSize?: ImageProps["backgroundSize"];
|
|
13
|
+
className?: ImageProps["className"];
|
|
14
|
+
sizes?: ImageProps["sizes"];
|
|
15
|
+
builderBlock?: ImageProps["builderBlock"];
|
|
16
|
+
fitContent?: ImageProps["fitContent"];
|
|
17
|
+
};
|
|
18
|
+
events: {
|
|
19
|
+
[evt: string]: CustomEvent<any>;
|
|
20
|
+
};
|
|
21
|
+
slots: {
|
|
22
|
+
default: {};
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
type ImageProps_ = typeof __propDef.props;
|
|
26
|
+
export { ImageProps_ as ImageProps };
|
|
27
|
+
export type ImageEvents = typeof __propDef.events;
|
|
28
|
+
export type ImageSlots = typeof __propDef.slots;
|
|
29
|
+
export default class Image extends SvelteComponent<ImageProps, ImageEvents, ImageSlots> {
|
|
30
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { BuilderBlock } from '../../types/builder-block.js';
|
|
2
|
+
export interface ImageProps {
|
|
3
|
+
className?: string;
|
|
4
|
+
image: string;
|
|
5
|
+
sizes?: string;
|
|
6
|
+
lazy?: boolean;
|
|
7
|
+
height?: number;
|
|
8
|
+
width?: number;
|
|
9
|
+
altText?: string;
|
|
10
|
+
backgroundSize?: 'cover' | 'contain';
|
|
11
|
+
backgroundPosition?: string;
|
|
12
|
+
srcset?: string;
|
|
13
|
+
aspectRatio?: number;
|
|
14
|
+
children?: any;
|
|
15
|
+
fitContent?: boolean;
|
|
16
|
+
builderBlock?: BuilderBlock;
|
|
17
|
+
noWebp?: boolean;
|
|
18
|
+
src?: string;
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { SectionProps } from "./section.types.js";
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
attributes?: SectionProps["attributes"];
|
|
6
|
+
maxWidth?: SectionProps["maxWidth"];
|
|
7
|
+
};
|
|
8
|
+
events: {
|
|
9
|
+
[evt: string]: CustomEvent<any>;
|
|
10
|
+
};
|
|
11
|
+
slots: {
|
|
12
|
+
default: {};
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
type SectionProps_ = typeof __propDef.props;
|
|
16
|
+
export { SectionProps_ as SectionProps };
|
|
17
|
+
export type SectionEvents = typeof __propDef.events;
|
|
18
|
+
export type SectionSlots = typeof __propDef.slots;
|
|
19
|
+
export default class Section extends SvelteComponent<SectionProps, SectionEvents, SectionSlots> {
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
<script context="module">/**
|
|
2
|
-
* This import is used by the Svelte SDK. Do not remove.
|
|
3
|
-
*/
|
|
4
|
-
</script>
|
|
5
|
-
|
|
6
1
|
<script>import { onMount } from "svelte";
|
|
7
2
|
import ContentVariants from "../../components/content-variants/content-variants.svelte";
|
|
8
3
|
import { filterAttrs } from "../helpers.js";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { PropsWithBuilderData } from "../../types/builder-props.js";
|
|
3
|
+
import type { SymbolProps } from "./symbol.types.js";
|
|
4
|
+
declare const __propDef: {
|
|
5
|
+
props: {
|
|
6
|
+
js: any;
|
|
7
|
+
attributes?: PropsWithBuilderData<SymbolProps>["attributes"];
|
|
8
|
+
symbol?: PropsWithBuilderData<SymbolProps>["symbol"];
|
|
9
|
+
dynamic?: PropsWithBuilderData<SymbolProps>["dynamic"];
|
|
10
|
+
builderContext: PropsWithBuilderData<SymbolProps>["builderContext"];
|
|
11
|
+
builderComponents: PropsWithBuilderData<SymbolProps>["builderComponents"];
|
|
12
|
+
};
|
|
13
|
+
events: {
|
|
14
|
+
[evt: string]: CustomEvent<any>;
|
|
15
|
+
};
|
|
16
|
+
slots: {};
|
|
17
|
+
};
|
|
18
|
+
type SymbolProps_ = typeof __propDef.props;
|
|
19
|
+
export { SymbolProps_ as SymbolProps };
|
|
20
|
+
export type SymbolEvents = typeof __propDef.events;
|
|
21
|
+
export type SymbolSlots = typeof __propDef.slots;
|
|
22
|
+
export default class Symbol extends SvelteComponent<SymbolProps, SymbolEvents, SymbolSlots> {
|
|
23
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { BuilderContent } from '../../types/builder-content.js';
|
|
2
|
+
import type { BuilderComponentsProp } from '../../types/builder-props.js';
|
|
3
|
+
interface SymbolInfo {
|
|
4
|
+
model?: string;
|
|
5
|
+
entry?: string;
|
|
6
|
+
data?: any;
|
|
7
|
+
content?: BuilderContent;
|
|
8
|
+
inline?: boolean;
|
|
9
|
+
dynamic?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface SymbolProps extends BuilderComponentsProp {
|
|
12
|
+
symbol?: SymbolInfo;
|
|
13
|
+
dataOnly?: boolean;
|
|
14
|
+
dynamic?: boolean;
|
|
15
|
+
attributes?: any;
|
|
16
|
+
inheritState?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { TextProps } from "./text.types.js";
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
text?: TextProps["text"];
|
|
6
|
+
};
|
|
7
|
+
events: {
|
|
8
|
+
[evt: string]: CustomEvent<any>;
|
|
9
|
+
};
|
|
10
|
+
slots: {};
|
|
11
|
+
};
|
|
12
|
+
type TextProps_ = typeof __propDef.props;
|
|
13
|
+
export { TextProps_ as TextProps };
|
|
14
|
+
export type TextEvents = typeof __propDef.events;
|
|
15
|
+
export type TextSlots = typeof __propDef.slots;
|
|
16
|
+
export default class Text extends SvelteComponent<TextProps, TextEvents, TextSlots> {
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { VideoProps } from "./video.types.js";
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
autoPlay?: VideoProps["autoPlay"];
|
|
6
|
+
muted?: VideoProps["muted"];
|
|
7
|
+
controls?: VideoProps["controls"];
|
|
8
|
+
loop?: VideoProps["loop"];
|
|
9
|
+
playsInline?: VideoProps["playsInline"];
|
|
10
|
+
preload?: VideoProps["preload"];
|
|
11
|
+
attributes?: VideoProps["attributes"];
|
|
12
|
+
fit?: VideoProps["fit"];
|
|
13
|
+
position?: VideoProps["position"];
|
|
14
|
+
aspectRatio?: VideoProps["aspectRatio"];
|
|
15
|
+
video?: VideoProps["video"];
|
|
16
|
+
posterImage?: VideoProps["posterImage"];
|
|
17
|
+
lazyLoad?: VideoProps["lazyLoad"];
|
|
18
|
+
fitContent?: VideoProps["fitContent"];
|
|
19
|
+
builderBlock?: VideoProps["builderBlock"];
|
|
20
|
+
};
|
|
21
|
+
events: {
|
|
22
|
+
[evt: string]: CustomEvent<any>;
|
|
23
|
+
};
|
|
24
|
+
slots: {
|
|
25
|
+
default: {};
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
type VideoProps_ = typeof __propDef.props;
|
|
29
|
+
export { VideoProps_ as VideoProps };
|
|
30
|
+
export type VideoEvents = typeof __propDef.events;
|
|
31
|
+
export type VideoSlots = typeof __propDef.slots;
|
|
32
|
+
export default class Video extends SvelteComponent<VideoProps, VideoEvents, VideoSlots> {
|
|
33
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { BuilderBlock } from '../../types/builder-block.js';
|
|
2
|
+
export interface VideoProps {
|
|
3
|
+
attributes?: any;
|
|
4
|
+
video?: string;
|
|
5
|
+
autoPlay?: boolean;
|
|
6
|
+
controls?: boolean;
|
|
7
|
+
muted?: boolean;
|
|
8
|
+
loop?: boolean;
|
|
9
|
+
playsInline?: boolean;
|
|
10
|
+
aspectRatio?: number;
|
|
11
|
+
width?: number;
|
|
12
|
+
height?: number;
|
|
13
|
+
fit?: 'contain' | 'cover' | 'fill';
|
|
14
|
+
preload?: 'auto' | 'metadata' | 'none';
|
|
15
|
+
position?: 'center' | 'top' | 'left' | 'right' | 'bottom' | 'top left' | 'top right' | 'bottom left' | 'bottom right';
|
|
16
|
+
posterImage?: string;
|
|
17
|
+
lazyLoad?: boolean;
|
|
18
|
+
children?: any;
|
|
19
|
+
fitContent?: boolean;
|
|
20
|
+
builderBlock?: BuilderBlock;
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -88,6 +88,8 @@ let childrenContext = writable($context);
|
|
|
88
88
|
</script>
|
|
89
89
|
|
|
90
90
|
{#if canShowBlock()}
|
|
91
|
+
<BlockStyles {block} context={$context} />
|
|
92
|
+
|
|
91
93
|
{#if !blockComponent?.()?.noWrap}
|
|
92
94
|
{#if isEmptyHtmlElement(Tag())}
|
|
93
95
|
<BlockWrapper
|
|
@@ -126,17 +128,13 @@ let childrenContext = writable($context);
|
|
|
126
128
|
isInteractive={componentRefProps().isInteractive}
|
|
127
129
|
/>
|
|
128
130
|
|
|
129
|
-
{#each childrenWithoutParentComponent() as child (
|
|
131
|
+
{#each childrenWithoutParentComponent() as child (child.id)}
|
|
130
132
|
<svelte:self
|
|
131
133
|
block={child}
|
|
132
134
|
context={childrenContext}
|
|
133
135
|
{registeredComponents}
|
|
134
136
|
/>
|
|
135
137
|
{/each}
|
|
136
|
-
|
|
137
|
-
{#each childrenWithoutParentComponent() as child ("block-style-" + child.id)}
|
|
138
|
-
<BlockStyles block={child} context={$childrenContext} />
|
|
139
|
-
{/each}
|
|
140
138
|
</BlockWrapper>
|
|
141
139
|
{/if}
|
|
142
140
|
{:else}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<script>import "../../../content/wrap-component-ref.js";
|
|
2
2
|
import Block from "../../block.svelte";
|
|
3
|
-
import BlockStyles from "../block-styles.svelte";
|
|
4
3
|
import InteractiveElement from "../interactive-element.svelte";
|
|
5
4
|
import { getWrapperProps } from "./component-ref.helpers.js";
|
|
6
5
|
export let isInteractive;
|
|
@@ -27,12 +26,8 @@ let Wrapper = isInteractive ? InteractiveElement : componentRef;
|
|
|
27
26
|
contextValue: $context,
|
|
28
27
|
})}
|
|
29
28
|
>
|
|
30
|
-
{#each blockChildren as child (
|
|
29
|
+
{#each blockChildren as child (child.id)}
|
|
31
30
|
<Block block={child} {context} {registeredComponents} />
|
|
32
31
|
{/each}
|
|
33
|
-
|
|
34
|
-
{#each blockChildren as child ("block-style-" + child.id)}
|
|
35
|
-
<BlockStyles block={child} context={$context} />
|
|
36
|
-
{/each}
|
|
37
32
|
</svelte:component>
|
|
38
33
|
{/if}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
<script context="module"></script>
|
|
2
|
-
|
|
3
1
|
<script>import { getContext } from "svelte";
|
|
4
2
|
import BuilderContext from "../../context/builder.context.js";
|
|
5
3
|
import ComponentsContext from "../../context/components.context.js";
|
|
6
4
|
import Block from "../block/block.svelte";
|
|
7
|
-
import BlockStyles from "../block/components/block-styles.svelte";
|
|
8
5
|
import BlocksWrapper from "./blocks-wrapper.svelte";
|
|
9
6
|
export let blocks;
|
|
10
7
|
export let parent;
|
|
@@ -25,7 +22,7 @@ let componentsContext = getContext(ComponentsContext.key);
|
|
|
25
22
|
BlocksWrapperProps={$context?.BlocksWrapperProps}
|
|
26
23
|
>
|
|
27
24
|
{#if blocks}
|
|
28
|
-
{#each blocks as block (
|
|
25
|
+
{#each blocks as block (block.id)}
|
|
29
26
|
<Block
|
|
30
27
|
{block}
|
|
31
28
|
context={context || builderContext}
|
|
@@ -34,10 +31,4 @@ let componentsContext = getContext(ComponentsContext.key);
|
|
|
34
31
|
/>
|
|
35
32
|
{/each}
|
|
36
33
|
{/if}
|
|
37
|
-
|
|
38
|
-
{#if blocks}
|
|
39
|
-
{#each blocks as block ("block-style-" + block.id)}
|
|
40
|
-
<BlockStyles {block} context={$context || $builderContext} />
|
|
41
|
-
{/each}
|
|
42
|
-
{/if}
|
|
43
34
|
</BlocksWrapper>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { BlocksProps } from "./blocks.types.js";
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
blocks: BlocksProps["blocks"];
|
|
6
|
+
parent: BlocksProps["parent"];
|
|
7
|
+
path: BlocksProps["path"];
|
|
8
|
+
styleProp: BlocksProps["styleProp"];
|
|
9
|
+
context?: BlocksProps["context"];
|
|
10
|
+
registeredComponents?: BlocksProps["registeredComponents"];
|
|
11
|
+
};
|
|
12
|
+
events: {
|
|
13
|
+
[evt: string]: CustomEvent<any>;
|
|
14
|
+
};
|
|
15
|
+
slots: {};
|
|
16
|
+
};
|
|
17
|
+
type BlocksProps_ = typeof __propDef.props;
|
|
18
|
+
export { BlocksProps_ as BlocksProps };
|
|
19
|
+
export type BlocksEvents = typeof __propDef.events;
|
|
20
|
+
export type BlocksSlots = typeof __propDef.slots;
|
|
21
|
+
export default class Blocks extends SvelteComponent<BlocksProps, BlocksEvents, BlocksSlots> {
|
|
22
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="svelte" />
|
|
2
|
+
import type { Writable } from "svelte/store";
|
|
3
|
+
import type { BuilderContextInterface, RegisteredComponents } from '../../context/types.js';
|
|
4
|
+
import type { BlocksWrapperProps } from './blocks-wrapper.svelte';
|
|
5
|
+
export type BlocksProps = Partial<Omit<BlocksWrapperProps, 'BlocksWrapper' | 'BlocksWrapperProps'>> & {
|
|
6
|
+
context?: Writable<BuilderContextInterface>;
|
|
7
|
+
registeredComponents?: RegisteredComponents;
|
|
8
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -28,6 +28,19 @@ export let enrich = undefined;
|
|
|
28
28
|
export let content = undefined;
|
|
29
29
|
export let showContent;
|
|
30
30
|
export let contentWrapperProps = undefined;
|
|
31
|
+
export let data = undefined;
|
|
32
|
+
function mergeNewRootState(newData) {
|
|
33
|
+
const combinedState = {
|
|
34
|
+
...$builderContextSignal.rootState,
|
|
35
|
+
...newData,
|
|
36
|
+
};
|
|
37
|
+
if ($builderContextSignal.rootSetState) {
|
|
38
|
+
$builderContextSignal.rootSetState?.(combinedState);
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
$builderContextSignal.rootState = combinedState;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
31
44
|
function mergeNewContent(newContent) {
|
|
32
45
|
const newContentValue = {
|
|
33
46
|
...$builderContextSignal.content,
|
|
@@ -217,6 +230,7 @@ function elementRef_onInitpreviewingbldr(event) {
|
|
|
217
230
|
}
|
|
218
231
|
let elementRef;
|
|
219
232
|
let forceReRenderCount = 0;
|
|
233
|
+
let firstRender = true;
|
|
220
234
|
let lastUpdated = 0;
|
|
221
235
|
let shouldSendResetCookie = false;
|
|
222
236
|
let ContentWrapper = contentWrapper || "div";
|
|
@@ -277,6 +291,20 @@ function onUpdateFn_4(..._args) {
|
|
|
277
291
|
emitStateUpdate();
|
|
278
292
|
}
|
|
279
293
|
$: onUpdateFn_4(...[$builderContextSignal.rootState]);
|
|
294
|
+
function onUpdateFn_5(..._args) {
|
|
295
|
+
if (data) {
|
|
296
|
+
mergeNewRootState(data);
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
$: onUpdateFn_5(...[data]);
|
|
300
|
+
function onUpdateFn_6(..._args) {
|
|
301
|
+
if (locale) {
|
|
302
|
+
mergeNewRootState({
|
|
303
|
+
locale: locale,
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
$: onUpdateFn_6(...[locale]);
|
|
280
308
|
setContext(builderContext.key, builderContextSignal);
|
|
281
309
|
onDestroy(() => {
|
|
282
310
|
if (isBrowser()) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
|
-
type BuilderEditorProps = Omit<ContentProps, "customComponents" | "
|
|
2
|
+
type BuilderEditorProps = Omit<ContentProps, "customComponents" | "apiVersion" | "isSsrAbTest" | "blocksWrapper" | "blocksWrapperProps"> & {
|
|
3
3
|
builderContextSignal: Writable<BuilderContextInterface>;
|
|
4
4
|
setBuilderContextSignal?: (signal: any) => any;
|
|
5
5
|
children?: any;
|
|
@@ -21,6 +21,7 @@ declare const __propDef: {
|
|
|
21
21
|
content?: BuilderEditorProps["content"];
|
|
22
22
|
showContent: BuilderEditorProps["showContent"];
|
|
23
23
|
contentWrapperProps?: BuilderEditorProps["contentWrapperProps"];
|
|
24
|
+
data?: BuilderEditorProps["data"];
|
|
24
25
|
};
|
|
25
26
|
events: {
|
|
26
27
|
[evt: string]: CustomEvent<any>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { BuilderContent } from '../../types/builder-content.js';
|
|
2
2
|
import type { Nullable } from '../../types/typescript.js';
|
|
3
3
|
import type { ContentProps } from './content.types.js';
|
|
4
|
-
export declare const
|
|
4
|
+
export declare const getRootStateInitialValue: ({ content, data, locale }: Pick<ContentProps, 'content' | 'data' | 'locale'>) => {
|
|
5
5
|
locale?: string | undefined;
|
|
6
6
|
};
|
|
7
7
|
export declare const getContentInitialValue: ({ content, data }: Pick<ContentProps, 'content' | 'data'>) => Nullable<BuilderContent>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const
|
|
1
|
+
export const getRootStateInitialValue = ({ content, data, locale }) => {
|
|
2
2
|
const defaultValues = {};
|
|
3
3
|
const initialState = content?.data?.state || {};
|
|
4
4
|
// set default values for content state inputs
|
|
@@ -9,7 +9,7 @@ import { getUpdateVariantVisibilityScript } from "../content-variants/helpers.js
|
|
|
9
9
|
import InlinedScript from "../inlined-script.svelte";
|
|
10
10
|
import EnableEditor from "./components/enable-editor.svelte";
|
|
11
11
|
import ContentStyles from "./components/styles.svelte";
|
|
12
|
-
import { getContentInitialValue,
|
|
12
|
+
import { getContentInitialValue, getRootStateInitialValue, } from "./content.helpers.js";
|
|
13
13
|
import "./wrap-component-ref.js";
|
|
14
14
|
export let content = undefined;
|
|
15
15
|
export let customComponents = undefined;
|
|
@@ -59,7 +59,7 @@ let builderContextSignal = writable({
|
|
|
59
59
|
data: data,
|
|
60
60
|
}),
|
|
61
61
|
localState: undefined,
|
|
62
|
-
rootState:
|
|
62
|
+
rootState: getRootStateInitialValue({
|
|
63
63
|
content: content,
|
|
64
64
|
data: data,
|
|
65
65
|
locale: locale,
|
|
@@ -92,6 +92,7 @@ setContext(ComponentsContext.key, {
|
|
|
92
92
|
|
|
93
93
|
<EnableEditor
|
|
94
94
|
{content}
|
|
95
|
+
{data}
|
|
95
96
|
{model}
|
|
96
97
|
{context}
|
|
97
98
|
{apiKey}
|