@builder.io/sdk-svelte 0.2.2 → 0.2.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/package/--package.json +1 -1
- package/package/blocks/columns/columns.svelte +20 -23
- package/package/blocks/columns/columns.svelte.d.ts +1 -1
- package/package/blocks/image/image.svelte +1 -2
- package/package/blocks/image/image.svelte.d.ts +2 -2
- package/package/blocks/symbol/symbol.svelte +0 -2
- package/package/blocks/symbol/symbol.svelte.d.ts +2 -2
- package/package/components/render-block/block-styles.svelte +0 -2
- package/package/components/render-block/block-styles.svelte.d.ts +2 -2
- package/package/components/render-block/render-block.svelte +1 -4
- package/package/components/render-block/render-block.svelte.d.ts +2 -2
- package/package/components/render-block/render-component.svelte +1 -3
- package/package/components/render-block/render-component.svelte.d.ts +2 -2
- package/package/components/render-block/render-repeated-block.svelte +1 -2
- package/package/components/render-block/render-repeated-block.svelte.d.ts +2 -2
- package/package/components/render-blocks.svelte +0 -1
- package/package/components/render-blocks.svelte.d.ts +1 -1
- package/package/components/render-content/components/render-styles.svelte +8 -9
- package/package/components/render-content/components/render-styles.svelte.d.ts +1 -1
- package/package/components/render-content/render-content.svelte +3 -4
- package/package/components/render-content/render-content.svelte.d.ts +1 -1
- package/package/functions/get-content/index.js +1 -1
- package/package/index.d.ts +1 -0
- package/package.json +1 -1
- package/src/blocks/columns/columns.svelte +25 -25
- package/src/blocks/image/image.svelte +3 -3
- package/src/blocks/symbol/symbol.svelte +2 -2
- package/src/components/render-block/block-styles.svelte +2 -2
- package/src/components/render-block/render-block.svelte +3 -3
- package/src/components/render-block/render-component.svelte +2 -2
- package/src/components/render-block/render-repeated-block.svelte +3 -2
- package/src/components/render-blocks.svelte +1 -1
- package/src/components/render-content/components/render-styles.svelte +9 -9
- package/src/components/render-content/render-content.svelte +10 -4
- package/src/functions/get-content/index.ts +1 -1
- package/src/index.ts +1 -0
package/package/--package.json
CHANGED
|
@@ -2,13 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
<script>import { getContext } from "svelte";
|
|
4
4
|
import RenderBlocks from "../../components/render-blocks.svelte";
|
|
5
|
-
import "../../types/builder-block";
|
|
6
5
|
import { getSizesForBreakpoints } from "../../constants/device-sizes";
|
|
7
|
-
import "../../constants/device-sizes";
|
|
8
6
|
import RenderInlinedStyles from "../../components/render-inlined-styles.svelte";
|
|
9
7
|
import { TARGET } from "../../constants/target.js";
|
|
10
8
|
import BuilderContext from "../../context/builder.context.js";
|
|
11
|
-
import "../../types/typescript";
|
|
12
9
|
export let space;
|
|
13
10
|
export let columns;
|
|
14
11
|
export let stackColumnsAt;
|
|
@@ -90,30 +87,30 @@ $: columnsCssVars = () => {
|
|
|
90
87
|
};
|
|
91
88
|
$: columnsStyles = () => {
|
|
92
89
|
return `
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
90
|
+
@media (max-width: ${getWidthForBreakpointSize("medium")}px) {
|
|
91
|
+
.${builderBlock.id}-breakpoints {
|
|
92
|
+
flex-direction: var(--flex-dir-tablet);
|
|
93
|
+
align-items: stretch;
|
|
94
|
+
}
|
|
98
95
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
96
|
+
.${builderBlock.id}-breakpoints > .builder-column {
|
|
97
|
+
width: var(--column-width-tablet) !important;
|
|
98
|
+
margin-left: var(--column-margin-left-tablet) !important;
|
|
99
|
+
}
|
|
102
100
|
}
|
|
103
|
-
}
|
|
104
101
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
102
|
+
@media (max-width: ${getWidthForBreakpointSize("small")}px) {
|
|
103
|
+
.${builderBlock.id}-breakpoints {
|
|
104
|
+
flex-direction: var(--flex-dir);
|
|
105
|
+
align-items: stretch;
|
|
106
|
+
}
|
|
110
107
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
108
|
+
.${builderBlock.id}-breakpoints > .builder-column {
|
|
109
|
+
width: var(--column-width-mobile) !important;
|
|
110
|
+
margin-left: var(--column-margin-left-mobile) !important;
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
`;
|
|
117
114
|
};
|
|
118
115
|
let gutterSize = typeof space === "number" ? space || 0 : 20;
|
|
119
116
|
let cols = columns || [];
|
|
@@ -11,7 +11,7 @@ export interface ColumnProps {
|
|
|
11
11
|
stackColumnsAt?: StackColumnsAt;
|
|
12
12
|
reverseColumnsWhenStacked?: boolean;
|
|
13
13
|
}
|
|
14
|
-
import { BuilderBlock } from "../../types/builder-block";
|
|
14
|
+
import type { BuilderBlock } from "../../types/builder-block";
|
|
15
15
|
declare const __propDef: {
|
|
16
16
|
props: {
|
|
17
17
|
space: ColumnProps["space"];
|
|
@@ -8,7 +8,7 @@ export interface ImageProps {
|
|
|
8
8
|
height?: number;
|
|
9
9
|
width?: number;
|
|
10
10
|
altText?: string;
|
|
11
|
-
backgroundSize?:
|
|
11
|
+
backgroundSize?: "cover" | "contain";
|
|
12
12
|
backgroundPosition?: string;
|
|
13
13
|
srcset?: string;
|
|
14
14
|
aspectRatio?: number;
|
|
@@ -18,7 +18,7 @@ export interface ImageProps {
|
|
|
18
18
|
noWebp?: boolean;
|
|
19
19
|
src?: string;
|
|
20
20
|
}
|
|
21
|
-
import { BuilderBlock } from "../../types/builder-block.js";
|
|
21
|
+
import type { BuilderBlock } from "../../types/builder-block.js";
|
|
22
22
|
declare const __propDef: {
|
|
23
23
|
props: {
|
|
24
24
|
image: ImageProps["image"];
|
|
@@ -4,8 +4,6 @@
|
|
|
4
4
|
import RenderContent from "../../components/render-content/render-content.svelte";
|
|
5
5
|
import BuilderContext from "../../context/builder.context.js";
|
|
6
6
|
import { getContent } from "../../functions/get-content/index.js";
|
|
7
|
-
import "../../types/builder-content.js";
|
|
8
|
-
import "../../types/builder-block.js";
|
|
9
7
|
import { TARGET } from "../../constants/target";
|
|
10
8
|
import { logger } from "../../helpers/logger";
|
|
11
9
|
const isEvent = (attr) => attr.startsWith("on:");
|
|
@@ -15,8 +15,8 @@ export interface SymbolProps {
|
|
|
15
15
|
attributes?: any;
|
|
16
16
|
inheritState?: boolean;
|
|
17
17
|
}
|
|
18
|
-
import { BuilderContent } from "../../types/builder-content.js";
|
|
19
|
-
import { BuilderBlock } from "../../types/builder-block.js";
|
|
18
|
+
import type { BuilderContent } from "../../types/builder-content.js";
|
|
19
|
+
import type { BuilderBlock } from "../../types/builder-block.js";
|
|
20
20
|
declare const __propDef: {
|
|
21
21
|
props: {
|
|
22
22
|
attributes: SymbolProps["attributes"];
|
|
@@ -2,11 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
<script>import { getMaxWidthQueryForSize, getSizesForBreakpoints, } from "../../constants/device-sizes.js";
|
|
4
4
|
import { TARGET } from "../../constants/target.js";
|
|
5
|
-
import "../../context/types.js";
|
|
6
5
|
import { getProcessedBlock } from "../../functions/get-processed-block.js";
|
|
7
6
|
import { createCssClass } from "../../helpers/css.js";
|
|
8
7
|
import { checkIsDefined } from "../../helpers/nullable.js";
|
|
9
|
-
import "../../types/builder-block.js";
|
|
10
8
|
import RenderInlinedStyles from "../render-inlined-styles.svelte";
|
|
11
9
|
export let block;
|
|
12
10
|
export let context;
|
|
@@ -3,8 +3,8 @@ export type BlockStylesProps = {
|
|
|
3
3
|
block: BuilderBlock;
|
|
4
4
|
context: BuilderContextInterface;
|
|
5
5
|
};
|
|
6
|
-
import { BuilderContextInterface } from "../../context/types.js";
|
|
7
|
-
import { BuilderBlock } from "../../types/builder-block.js";
|
|
6
|
+
import type { BuilderContextInterface } from "../../context/types.js";
|
|
7
|
+
import type { BuilderBlock } from "../../types/builder-block.js";
|
|
8
8
|
declare const __propDef: {
|
|
9
9
|
props: {
|
|
10
10
|
block: BlockStylesProps["block"];
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
<script context="module"></script>
|
|
2
2
|
|
|
3
|
-
<script>import "../../
|
|
4
|
-
import { getBlockActions } from "../../functions/get-block-actions.js";
|
|
3
|
+
<script>import { getBlockActions } from "../../functions/get-block-actions.js";
|
|
5
4
|
import { getBlockComponentOptions } from "../../functions/get-block-component-options.js";
|
|
6
5
|
import { getBlockProperties } from "../../functions/get-block-properties.js";
|
|
7
6
|
import { getProcessedBlock } from "../../functions/get-processed-block.js";
|
|
8
|
-
import "../../types/builder-block.js";
|
|
9
7
|
import BlockStyles from "./block-styles.svelte";
|
|
10
8
|
import { getComponent, getProxyState, getRepeatItemData, isEmptyHtmlElement, } from "./render-block.helpers.js";
|
|
11
|
-
import "./render-component.svelte";
|
|
12
9
|
import RenderRepeatedBlock from "./render-repeated-block.svelte";
|
|
13
10
|
import { TARGET } from "../../constants/target.js";
|
|
14
11
|
import { extractTextStyles } from "../../functions/extract-text-styles.js";
|
|
@@ -3,8 +3,8 @@ export type RenderBlockProps = {
|
|
|
3
3
|
block: BuilderBlock;
|
|
4
4
|
context: BuilderContextInterface;
|
|
5
5
|
};
|
|
6
|
-
import { BuilderContextInterface } from "../../context/types.js";
|
|
7
|
-
import { BuilderBlock } from "../../types/builder-block.js";
|
|
6
|
+
import type { BuilderContextInterface } from "../../context/types.js";
|
|
7
|
+
import type { BuilderBlock } from "../../types/builder-block.js";
|
|
8
8
|
declare const __propDef: {
|
|
9
9
|
props: {
|
|
10
10
|
block: RenderBlockProps["block"];
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
<script context="module"></script>
|
|
2
2
|
|
|
3
|
-
<script>import "
|
|
4
|
-
import BlockStyles from "./block-styles.svelte";
|
|
3
|
+
<script>import BlockStyles from "./block-styles.svelte";
|
|
5
4
|
import RenderBlock from "./render-block.svelte";
|
|
6
|
-
import "../../context/types.js";
|
|
7
5
|
export let componentRef;
|
|
8
6
|
export let componentOptions;
|
|
9
7
|
export let blockChildren;
|
|
@@ -11,8 +11,8 @@ export interface RenderComponentProps {
|
|
|
11
11
|
blockChildren: BuilderBlock[];
|
|
12
12
|
context: BuilderContextInterface;
|
|
13
13
|
}
|
|
14
|
-
import { BuilderBlock } from "../../types/builder-block.js";
|
|
15
|
-
import { BuilderContextInterface } from "../../context/types.js";
|
|
14
|
+
import type { BuilderBlock } from "../../types/builder-block.js";
|
|
15
|
+
import type { BuilderContextInterface } from "../../context/types.js";
|
|
16
16
|
declare const __propDef: {
|
|
17
17
|
props: {
|
|
18
18
|
componentRef: RenderComponentProps["componentRef"];
|
|
@@ -11,8 +11,6 @@
|
|
|
11
11
|
|
|
12
12
|
<script>import { setContext } from "svelte";
|
|
13
13
|
import BuilderContext from "../../context/builder.context.js";
|
|
14
|
-
import "../../context/types.js";
|
|
15
|
-
import "../../types/builder-block";
|
|
16
14
|
import RenderBlock from "./render-block.svelte";
|
|
17
15
|
export let block;
|
|
18
16
|
export let repeatContext;
|
|
@@ -24,6 +22,7 @@ setContext(BuilderContext.key, {
|
|
|
24
22
|
apiKey: repeatContext.apiKey,
|
|
25
23
|
registeredComponents: repeatContext.registeredComponents,
|
|
26
24
|
inheritedStyles: repeatContext.inheritedStyles,
|
|
25
|
+
apiVersion: repeatContext.apiVersion,
|
|
27
26
|
});
|
|
28
27
|
</script>
|
|
29
28
|
|
|
@@ -3,8 +3,8 @@ type Props = {
|
|
|
3
3
|
block: BuilderBlock;
|
|
4
4
|
repeatContext: BuilderContextInterface;
|
|
5
5
|
};
|
|
6
|
-
import { BuilderContextInterface } from "../../context/types.js";
|
|
7
|
-
import { BuilderBlock } from "../../types/builder-block";
|
|
6
|
+
import type { BuilderContextInterface } from "../../context/types.js";
|
|
7
|
+
import type { BuilderBlock } from "../../types/builder-block";
|
|
8
8
|
declare const __propDef: {
|
|
9
9
|
props: {
|
|
10
10
|
block: Props["block"];
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
<script>import { getContext } from "svelte";
|
|
4
4
|
import BuilderContext from "../context/builder.context.js";
|
|
5
5
|
import { isEditing } from "../functions/is-editing.js";
|
|
6
|
-
import "../types/builder-block.js";
|
|
7
6
|
import BlockStyles from "./render-block/block-styles.svelte";
|
|
8
7
|
import RenderBlock from "./render-block/render-block.svelte";
|
|
9
8
|
export let blocks;
|
|
@@ -5,7 +5,7 @@ export type RenderBlockProps = {
|
|
|
5
5
|
path?: string;
|
|
6
6
|
styleProp?: Record<string, any>;
|
|
7
7
|
};
|
|
8
|
-
import { BuilderBlock } from "../types/builder-block.js";
|
|
8
|
+
import type { BuilderBlock } from "../types/builder-block.js";
|
|
9
9
|
declare const __propDef: {
|
|
10
10
|
props: {
|
|
11
11
|
blocks: RenderBlockProps["blocks"];
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<script context="module"></script>
|
|
2
2
|
|
|
3
3
|
<script>import RenderInlinedStyles from "../../render-inlined-styles.svelte";
|
|
4
|
-
import "./render-styles.helpers";
|
|
5
4
|
import { getCss } from "./render-styles.helpers";
|
|
6
5
|
import { getFontCss } from "./render-styles.helpers";
|
|
7
6
|
export let cssCode;
|
|
@@ -17,16 +16,16 @@ ${getFontCss({
|
|
|
17
16
|
})}
|
|
18
17
|
|
|
19
18
|
.builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
|
|
20
|
-
margin: 0;
|
|
19
|
+
margin: 0;
|
|
21
20
|
}
|
|
22
21
|
.builder-text > p, .builder-text > .builder-paragraph {
|
|
23
|
-
color: inherit;
|
|
24
|
-
line-height: inherit;
|
|
25
|
-
letter-spacing: inherit;
|
|
26
|
-
font-weight: inherit;
|
|
27
|
-
font-size: inherit;
|
|
28
|
-
text-align: inherit;
|
|
29
|
-
font-family: inherit;
|
|
22
|
+
color: inherit;
|
|
23
|
+
line-height: inherit;
|
|
24
|
+
letter-spacing: inherit;
|
|
25
|
+
font-weight: inherit;
|
|
26
|
+
font-size: inherit;
|
|
27
|
+
text-align: inherit;
|
|
28
|
+
font-family: inherit;
|
|
30
29
|
}
|
|
31
30
|
`;
|
|
32
31
|
</script>
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<script>import { onDestroy, onMount, setContext } from "svelte";
|
|
2
2
|
import { getDefaultRegisteredComponents } from "../../constants/builder-registered-components.js";
|
|
3
|
-
import "../../context/types.js";
|
|
4
3
|
import { evaluate } from "../../functions/evaluate.js";
|
|
5
4
|
import { getContent } from "../../functions/get-content/index.js";
|
|
6
5
|
import { fetch } from "../../functions/get-fetch.js";
|
|
@@ -9,15 +8,12 @@ import { isEditing } from "../../functions/is-editing.js";
|
|
|
9
8
|
import { isPreviewing } from "../../functions/is-previewing.js";
|
|
10
9
|
import { components, createRegisterComponentMessage, } from "../../functions/register-component.js";
|
|
11
10
|
import { _track } from "../../functions/track/index.js";
|
|
12
|
-
import "../../types/builder-content.js";
|
|
13
|
-
import "../../types/typescript.js";
|
|
14
11
|
import RenderBlocks from "../render-blocks.svelte";
|
|
15
12
|
import RenderContentStyles from "./components/render-styles.svelte";
|
|
16
13
|
import builderContext from "../../context/builder.context.js";
|
|
17
14
|
import { registerInsertMenu, setupBrowserForEditing, } from "../../scripts/init-editing.js";
|
|
18
15
|
import { checkIsDefined } from "../../helpers/nullable.js";
|
|
19
16
|
import { getInteractionPropertiesForEvent } from "../../functions/track/interaction.js";
|
|
20
|
-
import "./render-content.types.js";
|
|
21
17
|
import { getContentInitialValue, getContextStateInitialValue, } from "./render-content.helpers.js";
|
|
22
18
|
import { TARGET } from "../../constants/target.js";
|
|
23
19
|
import { logger } from "../../helpers/logger.js";
|
|
@@ -309,6 +305,9 @@ setContext(builderContext.key, {
|
|
|
309
305
|
get registeredComponents() {
|
|
310
306
|
return allRegisteredComponents;
|
|
311
307
|
},
|
|
308
|
+
get inheritedStyles() {
|
|
309
|
+
return {};
|
|
310
|
+
},
|
|
312
311
|
});
|
|
313
312
|
onDestroy(() => {
|
|
314
313
|
if (isBrowser()) {
|
|
@@ -15,7 +15,7 @@ export async function getAllContent(options) {
|
|
|
15
15
|
const res = await fetch(url.href);
|
|
16
16
|
const content = await res.json();
|
|
17
17
|
if ('status' in content && !('results' in content)) {
|
|
18
|
-
logger.error('Error fetching data. ', content, options);
|
|
18
|
+
logger.error('Error fetching data. ', { url, content, options });
|
|
19
19
|
return content;
|
|
20
20
|
}
|
|
21
21
|
const canTrack = options.canTrack !== false;
|
package/package/index.d.ts
CHANGED
|
@@ -10,3 +10,4 @@ export * from './functions/get-builder-search-params/index.js';
|
|
|
10
10
|
export { track } from './functions/track/index.js';
|
|
11
11
|
export type { RegisteredComponent } from './context/types';
|
|
12
12
|
export type { ComponentInfo } from './types/components';
|
|
13
|
+
export type { RenderContentProps } from './components/render-content/render-content.types.js';
|
package/package.json
CHANGED
|
@@ -25,13 +25,13 @@
|
|
|
25
25
|
import { getContext } from "svelte";
|
|
26
26
|
|
|
27
27
|
import RenderBlocks from "../../components/render-blocks.svelte";
|
|
28
|
-
import { BuilderBlock } from "../../types/builder-block";
|
|
28
|
+
import type { BuilderBlock } from "../../types/builder-block";
|
|
29
29
|
import { getSizesForBreakpoints } from "../../constants/device-sizes";
|
|
30
|
-
import { SizeName } from "../../constants/device-sizes";
|
|
30
|
+
import type { SizeName } from "../../constants/device-sizes";
|
|
31
31
|
import RenderInlinedStyles from "../../components/render-inlined-styles.svelte";
|
|
32
32
|
import { TARGET } from "../../constants/target.js";
|
|
33
33
|
import BuilderContext from "../../context/builder.context.js";
|
|
34
|
-
import { Dictionary } from "../../types/typescript";
|
|
34
|
+
import type { Dictionary } from "../../types/typescript";
|
|
35
35
|
|
|
36
36
|
export let space: ColumnProps["space"];
|
|
37
37
|
export let columns: ColumnProps["columns"];
|
|
@@ -130,30 +130,30 @@
|
|
|
130
130
|
};
|
|
131
131
|
$: columnsStyles = () => {
|
|
132
132
|
return `
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
133
|
+
@media (max-width: ${getWidthForBreakpointSize("medium")}px) {
|
|
134
|
+
.${builderBlock.id}-breakpoints {
|
|
135
|
+
flex-direction: var(--flex-dir-tablet);
|
|
136
|
+
align-items: stretch;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.${builderBlock.id}-breakpoints > .builder-column {
|
|
140
|
+
width: var(--column-width-tablet) !important;
|
|
141
|
+
margin-left: var(--column-margin-left-tablet) !important;
|
|
142
|
+
}
|
|
137
143
|
}
|
|
138
144
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
.${builderBlock.id}-breakpoints > .builder-column {
|
|
152
|
-
width: var(--column-width-mobile) !important;
|
|
153
|
-
margin-left: var(--column-margin-left-mobile) !important;
|
|
154
|
-
}
|
|
155
|
-
},
|
|
156
|
-
`;
|
|
145
|
+
@media (max-width: ${getWidthForBreakpointSize("small")}px) {
|
|
146
|
+
.${builderBlock.id}-breakpoints {
|
|
147
|
+
flex-direction: var(--flex-dir);
|
|
148
|
+
align-items: stretch;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.${builderBlock.id}-breakpoints > .builder-column {
|
|
152
|
+
width: var(--column-width-mobile) !important;
|
|
153
|
+
margin-left: var(--column-margin-left-mobile) !important;
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
`;
|
|
157
157
|
};
|
|
158
158
|
|
|
159
159
|
let gutterSize = typeof space === "number" ? space || 0 : 20;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
height?: number;
|
|
8
8
|
width?: number;
|
|
9
9
|
altText?: string;
|
|
10
|
-
backgroundSize?:
|
|
10
|
+
backgroundSize?: "cover" | "contain";
|
|
11
11
|
backgroundPosition?: string;
|
|
12
12
|
srcset?: string;
|
|
13
13
|
aspectRatio?: number;
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
</script>
|
|
21
21
|
|
|
22
22
|
<script lang="ts">
|
|
23
|
-
import { BuilderBlock } from "../../types/builder-block.js";
|
|
23
|
+
import type { BuilderBlock } from "../../types/builder-block.js";
|
|
24
24
|
import { getSrcSet } from "./image.helpers.js";
|
|
25
25
|
|
|
26
26
|
export let image: ImageProps["image"];
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
width: "100%",
|
|
82
82
|
left: "0px",
|
|
83
83
|
top: "0px",
|
|
84
|
-
};
|
|
84
|
+
} as const;
|
|
85
85
|
const out = aspectRatio ? aspectRatioStyles : undefined;
|
|
86
86
|
return out;
|
|
87
87
|
};
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
import RenderContent from "../../components/render-content/render-content.svelte";
|
|
25
25
|
import BuilderContext from "../../context/builder.context.js";
|
|
26
26
|
import { getContent } from "../../functions/get-content/index.js";
|
|
27
|
-
import { BuilderContent } from "../../types/builder-content.js";
|
|
28
|
-
import { BuilderBlock } from "../../types/builder-block.js";
|
|
27
|
+
import type { BuilderContent } from "../../types/builder-content.js";
|
|
28
|
+
import type { BuilderBlock } from "../../types/builder-block.js";
|
|
29
29
|
import { TARGET } from "../../constants/target";
|
|
30
30
|
import { logger } from "../../helpers/logger";
|
|
31
31
|
|
|
@@ -11,11 +11,11 @@
|
|
|
11
11
|
getSizesForBreakpoints,
|
|
12
12
|
} from "../../constants/device-sizes.js";
|
|
13
13
|
import { TARGET } from "../../constants/target.js";
|
|
14
|
-
import { BuilderContextInterface } from "../../context/types.js";
|
|
14
|
+
import type { BuilderContextInterface } from "../../context/types.js";
|
|
15
15
|
import { getProcessedBlock } from "../../functions/get-processed-block.js";
|
|
16
16
|
import { createCssClass } from "../../helpers/css.js";
|
|
17
17
|
import { checkIsDefined } from "../../helpers/nullable.js";
|
|
18
|
-
import { BuilderBlock } from "../../types/builder-block.js";
|
|
18
|
+
import type { BuilderBlock } from "../../types/builder-block.js";
|
|
19
19
|
import RenderInlinedStyles from "../render-inlined-styles.svelte";
|
|
20
20
|
|
|
21
21
|
export let block: BlockStylesProps["block"];
|
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
</script>
|
|
7
7
|
|
|
8
8
|
<script lang="ts">
|
|
9
|
-
import { BuilderContextInterface } from "../../context/types.js";
|
|
9
|
+
import type { BuilderContextInterface } from "../../context/types.js";
|
|
10
10
|
import { getBlockActions } from "../../functions/get-block-actions.js";
|
|
11
11
|
import { getBlockComponentOptions } from "../../functions/get-block-component-options.js";
|
|
12
12
|
import { getBlockProperties } from "../../functions/get-block-properties.js";
|
|
13
13
|
import { getProcessedBlock } from "../../functions/get-processed-block.js";
|
|
14
|
-
import { BuilderBlock } from "../../types/builder-block.js";
|
|
14
|
+
import type { BuilderBlock } from "../../types/builder-block.js";
|
|
15
15
|
import BlockStyles from "./block-styles.svelte";
|
|
16
16
|
import {
|
|
17
17
|
getComponent,
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
getRepeatItemData,
|
|
20
20
|
isEmptyHtmlElement,
|
|
21
21
|
} from "./render-block.helpers.js";
|
|
22
|
-
import { RenderComponentProps } from "./render-component.svelte";
|
|
22
|
+
import type { RenderComponentProps } from "./render-component.svelte";
|
|
23
23
|
import RenderRepeatedBlock from "./render-repeated-block.svelte";
|
|
24
24
|
import { TARGET } from "../../constants/target.js";
|
|
25
25
|
import { extractTextStyles } from "../../functions/extract-text-styles.js";
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
</script>
|
|
16
16
|
|
|
17
17
|
<script lang="ts">
|
|
18
|
-
import { BuilderBlock } from "../../types/builder-block.js";
|
|
18
|
+
import type { BuilderBlock } from "../../types/builder-block.js";
|
|
19
19
|
import BlockStyles from "./block-styles.svelte";
|
|
20
20
|
import RenderBlock from "./render-block.svelte";
|
|
21
|
-
import { BuilderContextInterface } from "../../context/types.js";
|
|
21
|
+
import type { BuilderContextInterface } from "../../context/types.js";
|
|
22
22
|
|
|
23
23
|
export let componentRef: RenderComponentProps["componentRef"];
|
|
24
24
|
export let componentOptions: RenderComponentProps["componentOptions"];
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
import { setContext } from "svelte";
|
|
20
20
|
|
|
21
21
|
import BuilderContext from "../../context/builder.context.js";
|
|
22
|
-
import { BuilderContextInterface } from "../../context/types.js";
|
|
23
|
-
import { BuilderBlock } from "../../types/builder-block";
|
|
22
|
+
import type { BuilderContextInterface } from "../../context/types.js";
|
|
23
|
+
import type { BuilderBlock } from "../../types/builder-block";
|
|
24
24
|
import RenderBlock from "./render-block.svelte";
|
|
25
25
|
|
|
26
26
|
export let block: Props["block"];
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
apiKey: repeatContext.apiKey,
|
|
35
35
|
registeredComponents: repeatContext.registeredComponents,
|
|
36
36
|
inheritedStyles: repeatContext.inheritedStyles,
|
|
37
|
+
apiVersion: repeatContext.apiVersion,
|
|
37
38
|
});
|
|
38
39
|
</script>
|
|
39
40
|
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
import BuilderContext from "../context/builder.context.js";
|
|
14
14
|
import { isEditing } from "../functions/is-editing.js";
|
|
15
|
-
import { BuilderBlock } from "../types/builder-block.js";
|
|
15
|
+
import type { BuilderBlock } from "../types/builder-block.js";
|
|
16
16
|
import BlockStyles from "./render-block/block-styles.svelte";
|
|
17
17
|
import RenderBlock from "./render-block/render-block.svelte";
|
|
18
18
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
<script lang="ts">
|
|
10
10
|
import RenderInlinedStyles from "../../render-inlined-styles.svelte";
|
|
11
|
-
import { CustomFont } from "./render-styles.helpers";
|
|
11
|
+
import type { CustomFont } from "./render-styles.helpers";
|
|
12
12
|
import { getCss } from "./render-styles.helpers";
|
|
13
13
|
import { getFontCss } from "./render-styles.helpers";
|
|
14
14
|
|
|
@@ -26,16 +26,16 @@ ${getFontCss({
|
|
|
26
26
|
})}
|
|
27
27
|
|
|
28
28
|
.builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
|
|
29
|
-
margin: 0;
|
|
29
|
+
margin: 0;
|
|
30
30
|
}
|
|
31
31
|
.builder-text > p, .builder-text > .builder-paragraph {
|
|
32
|
-
color: inherit;
|
|
33
|
-
line-height: inherit;
|
|
34
|
-
letter-spacing: inherit;
|
|
35
|
-
font-weight: inherit;
|
|
36
|
-
font-size: inherit;
|
|
37
|
-
text-align: inherit;
|
|
38
|
-
font-family: inherit;
|
|
32
|
+
color: inherit;
|
|
33
|
+
line-height: inherit;
|
|
34
|
+
letter-spacing: inherit;
|
|
35
|
+
font-weight: inherit;
|
|
36
|
+
font-size: inherit;
|
|
37
|
+
text-align: inherit;
|
|
38
|
+
font-family: inherit;
|
|
39
39
|
}
|
|
40
40
|
`;
|
|
41
41
|
</script>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { onDestroy, onMount, setContext } from "svelte";
|
|
3
3
|
|
|
4
4
|
import { getDefaultRegisteredComponents } from "../../constants/builder-registered-components.js";
|
|
5
|
-
import {
|
|
5
|
+
import type {
|
|
6
6
|
BuilderRenderState,
|
|
7
7
|
RegisteredComponent,
|
|
8
8
|
RegisteredComponents,
|
|
@@ -18,8 +18,11 @@
|
|
|
18
18
|
createRegisterComponentMessage,
|
|
19
19
|
} from "../../functions/register-component.js";
|
|
20
20
|
import { _track } from "../../functions/track/index.js";
|
|
21
|
-
import {
|
|
22
|
-
|
|
21
|
+
import type {
|
|
22
|
+
Breakpoints,
|
|
23
|
+
BuilderContent,
|
|
24
|
+
} from "../../types/builder-content.js";
|
|
25
|
+
import type { Nullable } from "../../types/typescript.js";
|
|
23
26
|
import RenderBlocks from "../render-blocks.svelte";
|
|
24
27
|
import RenderContentStyles from "./components/render-styles.svelte";
|
|
25
28
|
import builderContext from "../../context/builder.context.js";
|
|
@@ -29,7 +32,7 @@
|
|
|
29
32
|
} from "../../scripts/init-editing.js";
|
|
30
33
|
import { checkIsDefined } from "../../helpers/nullable.js";
|
|
31
34
|
import { getInteractionPropertiesForEvent } from "../../functions/track/interaction.js";
|
|
32
|
-
import {
|
|
35
|
+
import type {
|
|
33
36
|
RenderContentProps,
|
|
34
37
|
BuilderComponentStateChange,
|
|
35
38
|
} from "./render-content.types.js";
|
|
@@ -363,6 +366,9 @@
|
|
|
363
366
|
get registeredComponents() {
|
|
364
367
|
return allRegisteredComponents;
|
|
365
368
|
},
|
|
369
|
+
get inheritedStyles() {
|
|
370
|
+
return {};
|
|
371
|
+
},
|
|
366
372
|
});
|
|
367
373
|
|
|
368
374
|
onDestroy(() => {
|
|
@@ -35,7 +35,7 @@ export async function getAllContent(
|
|
|
35
35
|
const content = await (res.json() as Promise<ContentResponse>);
|
|
36
36
|
|
|
37
37
|
if ('status' in content && !('results' in content)) {
|
|
38
|
-
logger.error('Error fetching data. ', content, options);
|
|
38
|
+
logger.error('Error fetching data. ', { url, content, options });
|
|
39
39
|
return content;
|
|
40
40
|
}
|
|
41
41
|
|
package/src/index.ts
CHANGED
|
@@ -12,3 +12,4 @@ export * from './functions/get-builder-search-params/index.js';
|
|
|
12
12
|
export { track } from './functions/track/index.js';
|
|
13
13
|
export type { RegisteredComponent } from './context/types';
|
|
14
14
|
export type { ComponentInfo } from './types/components';
|
|
15
|
+
export type { RenderContentProps } from './components/render-content/render-content.types.js';
|