@builder.io/sdk-svelte 0.7.1-1 → 0.7.2
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 +5 -2
- package/lib/browser/blocks/columns/columns.svelte +1 -1
- package/lib/browser/blocks/img/img.svelte +4 -1
- package/lib/browser/blocks/input/input.svelte +4 -1
- package/lib/browser/blocks/section/section.svelte +4 -1
- package/lib/browser/blocks/select/select.svelte +4 -1
- package/lib/browser/blocks/submit-button/submit-button.svelte +4 -1
- package/lib/browser/blocks/submit-button/submit-button.svelte.d.ts +2 -1
- package/lib/browser/blocks/symbol/symbol.svelte +4 -1
- package/lib/browser/blocks/textarea/textarea.svelte +4 -1
- package/lib/browser/components/block/block.svelte +24 -6
- package/lib/browser/components/block/components/block-wrapper.svelte +3 -0
- package/lib/browser/components/block/components/block-wrapper.svelte.d.ts +4 -3
- package/lib/browser/components/block/components/component-ref/component-ref.helpers.d.ts +1 -0
- package/lib/browser/components/block/components/component-ref/component-ref.svelte +2 -2
- package/lib/browser/components/blocks/blocks.svelte +3 -3
- package/lib/browser/components/content/components/enable-editor.svelte +7 -7
- package/lib/browser/components/content/components/styles.svelte +1 -2
- package/lib/browser/components/content/content.svelte +5 -5
- package/lib/browser/components/content-variants/content-variants.svelte +5 -5
- package/lib/browser/constants/builder-registered-components.js +6 -6
- package/lib/browser/constants/sdk-version.d.ts +1 -1
- package/lib/browser/constants/sdk-version.js +1 -1
- package/lib/browser/context/types.d.ts +1 -1
- package/lib/browser/functions/evaluate/choose-eval.js +1 -1
- package/lib/browser/functions/evaluate/edge-runtime/edge-runtime.js +1 -1
- package/lib/browser/functions/evaluate/evaluate.js +1 -1
- package/lib/browser/functions/evaluate/node-runtime/node-runtime.js +2 -2
- package/lib/browser/functions/evaluate/node-runtime/safeDynamicRequire.d.ts +0 -2
- package/lib/browser/functions/get-content/generate-content-url.js +1 -1
- package/lib/browser/helpers/ab-tests.d.ts +1 -1
- package/lib/browser/helpers/ab-tests.js +2 -2
- package/lib/browser/index.js +3 -0
- package/lib/browser/server-index.d.ts +2 -2
- package/lib/browser/server-index.js +1 -1
- package/lib/browser/types/builder-props.d.ts +1 -0
- package/lib/edge/blocks/button/button.svelte +5 -2
- package/lib/edge/blocks/columns/columns.svelte +1 -1
- package/lib/edge/blocks/img/img.svelte +4 -1
- package/lib/edge/blocks/input/input.svelte +4 -1
- package/lib/edge/blocks/section/section.svelte +4 -1
- package/lib/edge/blocks/select/select.svelte +4 -1
- package/lib/edge/blocks/submit-button/submit-button.svelte +4 -1
- package/lib/edge/blocks/submit-button/submit-button.svelte.d.ts +2 -1
- package/lib/edge/blocks/symbol/symbol.svelte +4 -1
- package/lib/edge/blocks/textarea/textarea.svelte +4 -1
- package/lib/edge/components/block/block.svelte +24 -6
- package/lib/edge/components/block/components/block-wrapper.svelte +3 -0
- package/lib/edge/components/block/components/block-wrapper.svelte.d.ts +4 -3
- package/lib/edge/components/block/components/component-ref/component-ref.helpers.d.ts +1 -0
- package/lib/edge/components/block/components/component-ref/component-ref.svelte +2 -2
- package/lib/edge/components/blocks/blocks.svelte +3 -3
- package/lib/edge/components/content/components/enable-editor.svelte +7 -7
- package/lib/edge/components/content/components/styles.svelte +1 -2
- package/lib/edge/components/content/content.svelte +5 -5
- package/lib/edge/components/content-variants/content-variants.svelte +5 -5
- package/lib/edge/constants/builder-registered-components.js +6 -6
- package/lib/edge/constants/sdk-version.d.ts +1 -1
- package/lib/edge/constants/sdk-version.js +1 -1
- package/lib/edge/context/types.d.ts +1 -1
- package/lib/edge/functions/evaluate/choose-eval.js +1 -1
- package/lib/edge/functions/evaluate/edge-runtime/edge-runtime.js +1 -1
- package/lib/edge/functions/evaluate/evaluate.js +1 -1
- package/lib/edge/functions/evaluate/node-runtime/node-runtime.js +2 -2
- package/lib/edge/functions/evaluate/node-runtime/safeDynamicRequire.d.ts +0 -2
- package/lib/edge/functions/get-content/generate-content-url.js +1 -1
- package/lib/edge/helpers/ab-tests.d.ts +1 -1
- package/lib/edge/helpers/ab-tests.js +2 -2
- package/lib/edge/index.js +3 -0
- package/lib/edge/server-index.d.ts +2 -2
- package/lib/edge/server-index.js +1 -1
- package/lib/edge/types/builder-props.d.ts +1 -0
- package/lib/node/blocks/button/button.svelte +5 -2
- package/lib/node/blocks/columns/columns.svelte +1 -1
- package/lib/node/blocks/img/img.svelte +4 -1
- package/lib/node/blocks/input/input.svelte +4 -1
- package/lib/node/blocks/section/section.svelte +4 -1
- package/lib/node/blocks/select/select.svelte +4 -1
- package/lib/node/blocks/submit-button/submit-button.svelte +4 -1
- package/lib/node/blocks/submit-button/submit-button.svelte.d.ts +2 -1
- package/lib/node/blocks/symbol/symbol.svelte +4 -1
- package/lib/node/blocks/textarea/textarea.svelte +4 -1
- package/lib/node/components/block/block.svelte +24 -6
- package/lib/node/components/block/components/block-wrapper.svelte +3 -0
- package/lib/node/components/block/components/block-wrapper.svelte.d.ts +4 -3
- package/lib/node/components/block/components/component-ref/component-ref.helpers.d.ts +1 -0
- package/lib/node/components/block/components/component-ref/component-ref.svelte +2 -2
- package/lib/node/components/blocks/blocks.svelte +3 -3
- package/lib/node/components/content/components/enable-editor.svelte +7 -7
- package/lib/node/components/content/components/styles.svelte +1 -2
- package/lib/node/components/content/content.svelte +5 -5
- package/lib/node/components/content-variants/content-variants.svelte +5 -5
- package/lib/node/constants/builder-registered-components.js +6 -6
- package/lib/node/constants/sdk-version.d.ts +1 -1
- package/lib/node/constants/sdk-version.js +1 -1
- package/lib/node/context/types.d.ts +1 -1
- package/lib/node/functions/evaluate/choose-eval.js +1 -1
- package/lib/node/functions/evaluate/edge-runtime/edge-runtime.js +1 -1
- package/lib/node/functions/evaluate/evaluate.js +1 -1
- package/lib/node/functions/evaluate/node-runtime/node-runtime.js +2 -2
- package/lib/node/functions/evaluate/node-runtime/safeDynamicRequire.d.ts +0 -2
- package/lib/node/functions/get-content/generate-content-url.js +1 -1
- package/lib/node/helpers/ab-tests.d.ts +1 -1
- package/lib/node/helpers/ab-tests.js +2 -2
- package/lib/node/index.js +3 -0
- package/lib/node/server-index.d.ts +2 -2
- package/lib/node/server-index.js +1 -1
- package/lib/node/types/builder-props.d.ts +1 -0
- package/package.json +3 -3
- package/src/blocks/button/button.svelte +3 -2
- package/src/blocks/columns/columns.svelte +5 -5
- package/src/blocks/img/img.svelte +2 -1
- package/src/blocks/input/input.svelte +2 -1
- package/src/blocks/section/section.svelte +2 -1
- package/src/blocks/select/select.svelte +2 -1
- package/src/blocks/submit-button/submit-button.svelte +2 -1
- package/src/blocks/symbol/symbol.svelte +5 -3
- package/src/blocks/textarea/textarea.svelte +2 -1
- package/src/components/block/block.svelte +25 -7
- package/src/components/block/components/block-wrapper.svelte +4 -3
- package/src/components/block/components/component-ref/component-ref.svelte +2 -2
- package/src/components/blocks/blocks.svelte +6 -6
- package/src/components/content/components/enable-editor.svelte +11 -12
- package/src/components/content/components/styles.svelte +1 -2
- package/src/components/content/content.svelte +8 -8
- package/src/components/content-variants/content-variants.svelte +7 -7
- package/src/constants/builder-registered-components.ts +6 -6
- package/src/constants/sdk-version.ts +1 -1
- package/src/context/types.ts +1 -1
- package/src/functions/evaluate/choose-eval.ts +1 -1
- package/src/functions/evaluate/edge-runtime/edge-runtime.ts +1 -1
- package/src/functions/evaluate/evaluate.ts +1 -1
- package/src/functions/evaluate/node-runtime/node-runtime.ts +3 -3
- package/src/functions/fetch-builder-props.ts +1 -1
- package/src/functions/get-content/generate-content-url.ts +1 -1
- package/src/helpers/ab-tests.ts +4 -4
- package/src/index.ts +3 -0
- package/src/server-index.ts +2 -2
- package/src/types/element.ts +0 -1
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
<script context="module"
|
|
1
|
+
<script context="module">/**
|
|
2
|
+
* This import is used by the Svelte SDK. Do not remove.
|
|
3
|
+
*/
|
|
4
|
+
</script>
|
|
2
5
|
|
|
3
6
|
<script>import { filterAttrs } from "../helpers.js";
|
|
4
7
|
import { setAttrs } from "../helpers.js";
|
|
@@ -20,10 +23,10 @@ function mitosis_styling(node, vars) {
|
|
|
20
23
|
|
|
21
24
|
{#if link}
|
|
22
25
|
<a
|
|
23
|
-
role="button"
|
|
24
26
|
{...filterAttrs(attributes, "on:", false)}
|
|
25
27
|
href={link}
|
|
26
28
|
target={openLinkInNewTab ? "_blank" : undefined}
|
|
29
|
+
role={"button"}
|
|
27
30
|
use:setAttrs={filterAttrs(attributes, "on:", true)}
|
|
28
31
|
>
|
|
29
32
|
{text}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<script context="module"></script>
|
|
2
2
|
|
|
3
3
|
<script>import Blocks from "../../components/blocks/blocks.svelte";
|
|
4
|
-
import { getSizesForBreakpoints } from "../../constants/device-sizes.js";
|
|
5
4
|
import InlinedStyles from "../../components/inlined-styles.svelte";
|
|
5
|
+
import { getSizesForBreakpoints } from "../../constants/device-sizes.js";
|
|
6
6
|
import { TARGET } from "../../constants/target.js";
|
|
7
7
|
import "../../functions/deopt.js";
|
|
8
8
|
export let js;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
<script context="module"
|
|
1
|
+
<script context="module">/**
|
|
2
|
+
* This import is used by the Svelte SDK. Do not remove.
|
|
3
|
+
*/
|
|
4
|
+
</script>
|
|
2
5
|
|
|
3
6
|
<script>import { onMount } from "svelte";
|
|
4
7
|
import ContentVariants from "../../components/content-variants/content-variants.svelte";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
<script context="module"></script>
|
|
2
2
|
|
|
3
3
|
<script>import { writable } from "svelte/store";
|
|
4
|
+
import "../../functions/extract-text-styles.js";
|
|
4
5
|
import { getBlockComponentOptions } from "../../functions/get-block-component-options.js";
|
|
5
6
|
import "../../functions/get-block-properties.js";
|
|
6
7
|
import { getProcessedBlock } from "../../functions/get-processed-block.js";
|
|
7
|
-
import BlockStyles from "./components/block-styles.svelte";
|
|
8
8
|
import { getComponent, getRepeatItemData, isEmptyHtmlElement, } from "./block.helpers.js";
|
|
9
|
-
import
|
|
10
|
-
import "../../functions/extract-text-styles.js";
|
|
11
|
-
import ComponentRef from "./components/component-ref/component-ref.svelte";
|
|
9
|
+
import BlockStyles from "./components/block-styles.svelte";
|
|
12
10
|
import BlockWrapper from "./components/block-wrapper.svelte";
|
|
11
|
+
import ComponentRef from "./components/component-ref/component-ref.svelte";
|
|
12
|
+
import RepeatedBlock from "./components/repeated-block.svelte";
|
|
13
13
|
export let block;
|
|
14
14
|
export let context;
|
|
15
15
|
export let registeredComponents;
|
|
@@ -114,7 +114,16 @@ let childrenContext = writable($context);
|
|
|
114
114
|
{context}
|
|
115
115
|
hasChildren={true}
|
|
116
116
|
>
|
|
117
|
-
<ComponentRef
|
|
117
|
+
<ComponentRef
|
|
118
|
+
componentRef={componentRefProps().componentRef}
|
|
119
|
+
componentOptions={componentRefProps().componentOptions}
|
|
120
|
+
blockChildren={componentRefProps().blockChildren}
|
|
121
|
+
context={componentRefProps().context}
|
|
122
|
+
registeredComponents={componentRefProps().registeredComponents}
|
|
123
|
+
builderBlock={componentRefProps().builderBlock}
|
|
124
|
+
includeBlockProps={componentRefProps().includeBlockProps}
|
|
125
|
+
isInteractive={componentRefProps().isInteractive}
|
|
126
|
+
/>
|
|
118
127
|
|
|
119
128
|
{#each childrenWithoutParentComponent() as child ("block-" + child.id)}
|
|
120
129
|
<svelte:self
|
|
@@ -130,6 +139,15 @@ let childrenContext = writable($context);
|
|
|
130
139
|
</BlockWrapper>
|
|
131
140
|
{/if}
|
|
132
141
|
{:else}
|
|
133
|
-
<ComponentRef
|
|
142
|
+
<ComponentRef
|
|
143
|
+
componentRef={componentRefProps().componentRef}
|
|
144
|
+
componentOptions={componentRefProps().componentOptions}
|
|
145
|
+
blockChildren={componentRefProps().blockChildren}
|
|
146
|
+
context={componentRefProps().context}
|
|
147
|
+
registeredComponents={componentRefProps().registeredComponents}
|
|
148
|
+
builderBlock={componentRefProps().builderBlock}
|
|
149
|
+
includeBlockProps={componentRefProps().includeBlockProps}
|
|
150
|
+
isInteractive={componentRefProps().isInteractive}
|
|
151
|
+
/>
|
|
134
152
|
{/if}
|
|
135
153
|
{/if}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
<script context="module">/**
|
|
2
|
+
* This import is used by the Svelte SDK. Do not remove.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
2
5
|
* This component renders a block's wrapper HTML element (from the block's `tagName` property).
|
|
3
6
|
* It reuses the exact same logic as the `InteractiveElement` component, but we need to have 2 separate components for
|
|
4
7
|
* Svelte's sake, as it needs to know at compile-time whether to use:
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
2
|
/**
|
|
3
3
|
* This import is used by the Svelte SDK. Do not remove.
|
|
4
|
-
*/
|
|
4
|
+
*/
|
|
5
|
+
type BlockWrapperProps = {
|
|
5
6
|
Wrapper: string;
|
|
6
7
|
block: BuilderBlock;
|
|
7
8
|
context: Writable<BuilderContextInterface>;
|
|
8
9
|
hasChildren: boolean;
|
|
9
10
|
};
|
|
10
|
-
import type { PropsWithChildren } from "../../../types/typescript.js";
|
|
11
|
-
import type { BuilderBlock } from "../../../types/builder-block.js";
|
|
12
11
|
import type { BuilderContextInterface } from "../../../context/types.js";
|
|
12
|
+
import type { BuilderBlock } from "../../../types/builder-block.js";
|
|
13
|
+
import type { PropsWithChildren } from "../../../types/typescript.js";
|
|
13
14
|
import type { Writable } from "svelte/store";
|
|
14
15
|
declare const __propDef: {
|
|
15
16
|
props: {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
<script>import
|
|
1
|
+
<script>import "../../../content/wrap-component-ref.js";
|
|
2
2
|
import Block from "../../block.svelte";
|
|
3
|
+
import BlockStyles from "../block-styles.svelte";
|
|
3
4
|
import InteractiveElement from "../interactive-element.svelte";
|
|
4
5
|
import { getWrapperProps } from "./component-ref.helpers.js";
|
|
5
|
-
import "../../../content/wrap-component-ref.js";
|
|
6
6
|
export let isInteractive;
|
|
7
7
|
export let componentRef;
|
|
8
8
|
export let componentOptions;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<script context="module"></script>
|
|
2
2
|
|
|
3
3
|
<script>import { getContext } from "svelte";
|
|
4
|
-
import BlockStyles from "../block/components/block-styles.svelte";
|
|
5
|
-
import Block from "../block/block.svelte";
|
|
6
|
-
import BlocksWrapper from "./blocks-wrapper.svelte";
|
|
7
4
|
import BuilderContext from "../../context/builder.context.js";
|
|
8
5
|
import ComponentsContext from "../../context/components.context.js";
|
|
6
|
+
import Block from "../block/block.svelte";
|
|
7
|
+
import BlockStyles from "../block/components/block-styles.svelte";
|
|
8
|
+
import BlocksWrapper from "./blocks-wrapper.svelte";
|
|
9
9
|
export let blocks;
|
|
10
10
|
export let parent;
|
|
11
11
|
export let path;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
<script context="module"></script>
|
|
2
2
|
|
|
3
3
|
<script>import { onDestroy, onMount, setContext } from "svelte";
|
|
4
|
+
import builderContext from "../../../context/builder.context.js";
|
|
4
5
|
import { evaluate } from "../../../functions/evaluate/index.js";
|
|
6
|
+
import { fastClone } from "../../../functions/fast-clone.js";
|
|
7
|
+
import { fetchOneEntry } from "../../../functions/get-content/index.js";
|
|
5
8
|
import { fetch } from "../../../functions/get-fetch.js";
|
|
6
9
|
import { isBrowser } from "../../../functions/is-browser.js";
|
|
7
10
|
import { isEditing } from "../../../functions/is-editing.js";
|
|
11
|
+
import { isPreviewing } from "../../../functions/is-previewing.js";
|
|
8
12
|
import { createRegisterComponentMessage } from "../../../functions/register-component.js";
|
|
9
13
|
import { _track } from "../../../functions/track/index.js";
|
|
10
|
-
import builderContext from "../../../context/builder.context.js";
|
|
11
|
-
import { registerInsertMenu, setupBrowserForEditing, } from "../../../scripts/init-editing.js";
|
|
12
14
|
import { getInteractionPropertiesForEvent } from "../../../functions/track/interaction.js";
|
|
13
|
-
import { fetchOneEntry } from "../../../functions/get-content/index.js";
|
|
14
|
-
import { isPreviewing } from "../../../functions/is-previewing.js";
|
|
15
|
-
import "../../../helpers/preview-lru-cache/set.js";
|
|
16
|
-
import { fastClone } from "../../../functions/fast-clone.js";
|
|
17
|
-
import { logger } from "../../../helpers/logger.js";
|
|
18
15
|
import { getDefaultCanTrack } from "../../../helpers/canTrack.js";
|
|
16
|
+
import { logger } from "../../../helpers/logger.js";
|
|
17
|
+
import "../../../helpers/preview-lru-cache/set.js";
|
|
18
|
+
import { registerInsertMenu, setupBrowserForEditing, } from "../../../scripts/init-editing.js";
|
|
19
19
|
export let builderContextSignal;
|
|
20
20
|
export let model = undefined;
|
|
21
21
|
export let context = undefined;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
<script context="module"></script>
|
|
2
2
|
|
|
3
3
|
<script>import InlinedStyles from "../../inlined-styles.svelte";
|
|
4
|
-
import { getCss } from "./styles.helpers.js";
|
|
5
|
-
import { getFontCss } from "./styles.helpers.js";
|
|
4
|
+
import { getCss, getFontCss } from "./styles.helpers.js";
|
|
6
5
|
export let cssCode = undefined;
|
|
7
6
|
export let contentId = undefined;
|
|
8
7
|
export let customFonts = undefined;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
<script>import { setContext } from "svelte";
|
|
2
2
|
import { writable } from "svelte/store";
|
|
3
3
|
import { getDefaultRegisteredComponents } from "../../constants/builder-registered-components.js";
|
|
4
|
+
import { TARGET } from "../../constants/target.js";
|
|
5
|
+
import ComponentsContext from "../../context/components.context.js";
|
|
4
6
|
import { components, serializeComponentInfo, } from "../../functions/register-component.js";
|
|
5
7
|
import Blocks from "../blocks/blocks.svelte";
|
|
6
|
-
import ContentStyles from "./components/styles.svelte";
|
|
7
|
-
import { getContentInitialValue, getContextStateInitialValue, } from "./content.helpers.js";
|
|
8
|
-
import { TARGET } from "../../constants/target.js";
|
|
9
8
|
import { getRenderContentScriptString } from "../content-variants/helpers.js";
|
|
10
|
-
import EnableEditor from "./components/enable-editor.svelte";
|
|
11
9
|
import InlinedScript from "../inlined-script.svelte";
|
|
10
|
+
import EnableEditor from "./components/enable-editor.svelte";
|
|
11
|
+
import ContentStyles from "./components/styles.svelte";
|
|
12
|
+
import { getContentInitialValue, getContextStateInitialValue, } from "./content.helpers.js";
|
|
12
13
|
import "./wrap-component-ref.js";
|
|
13
|
-
import ComponentsContext from "../../context/components.context.js";
|
|
14
14
|
export let content = undefined;
|
|
15
15
|
export let customComponents = undefined;
|
|
16
16
|
export let data = undefined;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
<script context="module"></script>
|
|
2
2
|
|
|
3
3
|
<script>import { onMount } from "svelte";
|
|
4
|
-
import {
|
|
5
|
-
import ContentComponent from "../content/content.svelte";
|
|
6
|
-
import { getDefaultCanTrack } from "../../helpers/canTrack.js";
|
|
7
|
-
import InlinedStyles from "../inlined-styles.svelte";
|
|
4
|
+
import { TARGET } from "../../constants/target.js";
|
|
8
5
|
import { handleABTestingSync } from "../../helpers/ab-tests.js";
|
|
6
|
+
import { getDefaultCanTrack } from "../../helpers/canTrack.js";
|
|
7
|
+
import ContentComponent from "../content/content.svelte";
|
|
9
8
|
import InlinedScript from "../inlined-script.svelte";
|
|
10
|
-
import
|
|
9
|
+
import InlinedStyles from "../inlined-styles.svelte";
|
|
10
|
+
import { checkShouldRunVariants, getScriptString, getVariants, getVariantsScriptString, } from "./helpers.js";
|
|
11
11
|
export let canTrack = undefined;
|
|
12
12
|
export let content = undefined;
|
|
13
13
|
export let __isNestedRender = undefined;
|
|
@@ -2,10 +2,16 @@ import { default as Button } from '../blocks/button/button.svelte';
|
|
|
2
2
|
import { componentInfo as buttonComponentInfo } from '../blocks/button/component-info.js';
|
|
3
3
|
import { default as Columns } from '../blocks/columns/columns.svelte';
|
|
4
4
|
import { componentInfo as columnsComponentInfo } from '../blocks/columns/component-info.js';
|
|
5
|
+
import { componentInfo as customCodeInfo } from '../blocks/custom-code/component-info.js';
|
|
6
|
+
import { default as customCode } from '../blocks/custom-code/custom-code.svelte';
|
|
7
|
+
import { componentInfo as embedComponentInfo } from '../blocks/embed/component-info.js';
|
|
8
|
+
import { default as embed } from '../blocks/embed/embed.svelte';
|
|
5
9
|
import { componentInfo as fragmentComponentInfo } from '../blocks/fragment/component-info.js';
|
|
6
10
|
import { default as Fragment } from '../blocks/fragment/fragment.svelte';
|
|
7
11
|
import { componentInfo as imageComponentInfo } from '../blocks/image/component-info.js';
|
|
8
12
|
import { default as Image } from '../blocks/image/image.svelte';
|
|
13
|
+
import { componentInfo as imgComponentInfo } from '../blocks/img/component-info.js';
|
|
14
|
+
import { default as Img } from '../blocks/img/img.svelte';
|
|
9
15
|
import { componentInfo as sectionComponentInfo } from '../blocks/section/component-info.js';
|
|
10
16
|
import { default as Section } from '../blocks/section/section.svelte';
|
|
11
17
|
import { componentInfo as symbolComponentInfo } from '../blocks/symbol/component-info.js';
|
|
@@ -14,12 +20,6 @@ import { componentInfo as textComponentInfo } from '../blocks/text/component-inf
|
|
|
14
20
|
import { default as Text } from '../blocks/text/text.svelte';
|
|
15
21
|
import { componentInfo as videoComponentInfo } from '../blocks/video/component-info.js';
|
|
16
22
|
import { default as Video } from '../blocks/video/video.svelte';
|
|
17
|
-
import { componentInfo as embedComponentInfo } from '../blocks/embed/component-info.js';
|
|
18
|
-
import { default as embed } from '../blocks/embed/embed.svelte';
|
|
19
|
-
import { default as Img } from '../blocks/img/img.svelte';
|
|
20
|
-
import { componentInfo as imgComponentInfo } from '../blocks/img/component-info.js';
|
|
21
|
-
import { default as customCode } from '../blocks/custom-code/custom-code.svelte';
|
|
22
|
-
import { componentInfo as customCodeInfo } from '../blocks/custom-code/component-info.js';
|
|
23
23
|
/**
|
|
24
24
|
* Returns a list of all registered components.
|
|
25
25
|
* NOTE: This needs to be a function to work around ESM circular dependencies.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.7.
|
|
1
|
+
export declare const SDK_VERSION = "0.7.2";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "0.7.
|
|
1
|
+
export const SDK_VERSION = "0.7.2";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import type { ApiVersion } from '../types/api-version.js';
|
|
1
2
|
import type { BuilderContent } from '../types/builder-content.js';
|
|
2
3
|
import type { ComponentInfo } from '../types/components.js';
|
|
3
4
|
import type { Dictionary, Nullable } from '../types/typescript.js';
|
|
4
|
-
import type { ApiVersion } from '../types/api-version.js';
|
|
5
5
|
export type RegisteredComponent = ComponentInfo & {
|
|
6
6
|
component: any;
|
|
7
7
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { runInBrowser } from './browser-runtime/browser.js';
|
|
2
1
|
import { isBrowser } from '../is-browser.js';
|
|
2
|
+
import { runInBrowser } from './browser-runtime/browser.js';
|
|
3
3
|
/**
|
|
4
4
|
* THIS IS A MAGICAL IMPORT. It is aliased by the build process of every SDK configuration, so that
|
|
5
5
|
* it points to the correct runtime for that configuration, which are expected to live exactly at:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { logger } from '../../../helpers/logger.js';
|
|
2
2
|
import { set } from '../../set.js';
|
|
3
|
-
import Interpreter from './acorn-interpreter.js';
|
|
4
3
|
import { getFunctionArguments } from '../helpers.js';
|
|
4
|
+
import Interpreter from './acorn-interpreter.js';
|
|
5
5
|
const processCode = (code) => {
|
|
6
6
|
return code.split('\n').map(line => {
|
|
7
7
|
const trimmed = line.trim();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { logger } from '../../helpers/logger.js';
|
|
2
|
-
import { getBuilderGlobals, parseCode } from './helpers.js';
|
|
3
2
|
import { chooseBrowserOrServerEval } from './choose-eval.js';
|
|
3
|
+
import { getBuilderGlobals, parseCode } from './helpers.js';
|
|
4
4
|
export function evaluate({ code, context, localState, rootState, rootSetState, event, isExpression = true }) {
|
|
5
5
|
if (code === '') {
|
|
6
6
|
logger.warn('Skipping evaluation of empty code block.');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { getFunctionArguments } from '../helpers.js';
|
|
2
|
-
import { safeDynamicRequire } from './safeDynamicRequire.js';
|
|
3
1
|
import { fastClone } from '../../fast-clone.js';
|
|
4
2
|
import { set } from '../../set.js';
|
|
3
|
+
import { getFunctionArguments } from '../helpers.js';
|
|
4
|
+
import { safeDynamicRequire } from './safeDynamicRequire.js';
|
|
5
5
|
const ivm = safeDynamicRequire('isolated-vm');
|
|
6
6
|
const getSyncValName = (key) => `bldr_${key}_sync`;
|
|
7
7
|
const BUILDER_SET_STATE_NAME = 'BUILDER_SET_STATE';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { flatten } from '../../helpers/flatten.js';
|
|
2
|
-
import { getBuilderSearchParamsFromWindow, normalizeSearchParams } from '../get-builder-search-params/index.js';
|
|
3
2
|
import { DEFAULT_API_VERSION } from '../../types/api-version.js';
|
|
3
|
+
import { getBuilderSearchParamsFromWindow, normalizeSearchParams } from '../get-builder-search-params/index.js';
|
|
4
4
|
const isPositiveNumber = (thing) => typeof thing === 'number' && !isNaN(thing) && thing >= 0;
|
|
5
5
|
export const generateContentUrl = (options) => {
|
|
6
6
|
let { noTraverse = false } = options;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { CanTrack } from '../types/can-track.js';
|
|
2
1
|
import type { BuilderContent } from '../types/builder-content.js';
|
|
2
|
+
import type { CanTrack } from '../types/can-track.js';
|
|
3
3
|
import type { Nullable } from '../types/typescript.js';
|
|
4
4
|
export declare const handleABTestingSync: ({ item, canTrack }: {
|
|
5
5
|
item: Nullable<BuilderContent>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TARGET } from '../constants/target.js';
|
|
2
2
|
import { checkIsDefined } from '../helpers/nullable.js';
|
|
3
|
+
import { getCookie, getCookieSync, setCookie } from './cookie.js';
|
|
3
4
|
import { logger } from './logger.js';
|
|
4
|
-
import { TARGET } from '../constants/target.js';
|
|
5
5
|
const BUILDER_STORE_PREFIX = 'builder.tests';
|
|
6
6
|
const getContentTestKey = (id) => `${BUILDER_STORE_PREFIX}.${id}`;
|
|
7
7
|
const getContentVariationCookie = ({ contentId }) => getCookie({
|
package/lib/browser/index.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
// ignore prettier formatting for this file because the order of exports is meaningful
|
|
2
|
+
// prettier-ignore
|
|
1
3
|
export * from './index-helpers/top-of-file.js';
|
|
4
|
+
// prettier-ignore
|
|
2
5
|
export * from './index-helpers/blocks-exports.js';
|
|
3
6
|
/**
|
|
4
7
|
* We have a separate entry point to the SDKs that guarantees no components are being imported. This is useful
|
|
@@ -6,10 +6,10 @@ export { register } from './functions/register.js';
|
|
|
6
6
|
export type { InsertMenuConfig, InsertMenuItem } from './functions/register.js';
|
|
7
7
|
export { setEditorSettings } from './functions/set-editor-settings.js';
|
|
8
8
|
export type { Settings } from './functions/set-editor-settings.js';
|
|
9
|
-
export { fetchEntries, fetchOneEntry, getAllContent, getContent
|
|
9
|
+
export { _processContentResult, fetchEntries, fetchOneEntry, getAllContent, getContent } from './functions/get-content/index.js';
|
|
10
10
|
export { getBuilderSearchParams } from './functions/get-builder-search-params/index.js';
|
|
11
11
|
export { track } from './functions/track/index.js';
|
|
12
|
+
export type { ContentProps } from './components/content/content.types.js';
|
|
12
13
|
export type { RegisteredComponent } from './context/types.js';
|
|
13
14
|
export type { ComponentInfo } from './types/components.js';
|
|
14
|
-
export type { ContentProps } from './components/content/content.types.js';
|
|
15
15
|
export { fetchBuilderProps } from './functions/fetch-builder-props.js';
|
|
@@ -4,7 +4,7 @@ export { isPreviewing } from './functions/is-previewing.js';
|
|
|
4
4
|
export { createRegisterComponentMessage } from './functions/register-component.js';
|
|
5
5
|
export { register } from './functions/register.js';
|
|
6
6
|
export { setEditorSettings } from './functions/set-editor-settings.js';
|
|
7
|
-
export { fetchEntries, fetchOneEntry, getAllContent, getContent
|
|
7
|
+
export { _processContentResult, fetchEntries, fetchOneEntry, getAllContent, getContent } from './functions/get-content/index.js';
|
|
8
8
|
export { getBuilderSearchParams } from './functions/get-builder-search-params/index.js';
|
|
9
9
|
export { track } from './functions/track/index.js';
|
|
10
10
|
export { fetchBuilderProps } from './functions/fetch-builder-props.js';
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
<script context="module"
|
|
1
|
+
<script context="module">/**
|
|
2
|
+
* This import is used by the Svelte SDK. Do not remove.
|
|
3
|
+
*/
|
|
4
|
+
</script>
|
|
2
5
|
|
|
3
6
|
<script>import { filterAttrs } from "../helpers.js";
|
|
4
7
|
import { setAttrs } from "../helpers.js";
|
|
@@ -20,10 +23,10 @@ function mitosis_styling(node, vars) {
|
|
|
20
23
|
|
|
21
24
|
{#if link}
|
|
22
25
|
<a
|
|
23
|
-
role="button"
|
|
24
26
|
{...filterAttrs(attributes, "on:", false)}
|
|
25
27
|
href={link}
|
|
26
28
|
target={openLinkInNewTab ? "_blank" : undefined}
|
|
29
|
+
role={"button"}
|
|
27
30
|
use:setAttrs={filterAttrs(attributes, "on:", true)}
|
|
28
31
|
>
|
|
29
32
|
{text}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<script context="module"></script>
|
|
2
2
|
|
|
3
3
|
<script>import Blocks from "../../components/blocks/blocks.svelte";
|
|
4
|
-
import { getSizesForBreakpoints } from "../../constants/device-sizes.js";
|
|
5
4
|
import InlinedStyles from "../../components/inlined-styles.svelte";
|
|
5
|
+
import { getSizesForBreakpoints } from "../../constants/device-sizes.js";
|
|
6
6
|
import { TARGET } from "../../constants/target.js";
|
|
7
7
|
import "../../functions/deopt.js";
|
|
8
8
|
export let js;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
<script context="module"
|
|
1
|
+
<script context="module">/**
|
|
2
|
+
* This import is used by the Svelte SDK. Do not remove.
|
|
3
|
+
*/
|
|
4
|
+
</script>
|
|
2
5
|
|
|
3
6
|
<script>import { onMount } from "svelte";
|
|
4
7
|
import ContentVariants from "../../components/content-variants/content-variants.svelte";
|