@builder.io/sdk-svelte 0.13.1 → 0.13.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/lib/browser/blocks/columns/columns.svelte +0 -1
- package/lib/browser/blocks/columns/columns.svelte.d.ts +8 -10
- package/lib/browser/blocks/columns/columns.types.d.ts +2 -2
- package/lib/browser/blocks/form/form/component-info.d.ts +2 -0
- package/lib/browser/blocks/form/form/form.svelte +302 -0
- package/lib/browser/blocks/form/input/component-info.d.ts +2 -0
- package/lib/browser/blocks/{input → form/input}/input.svelte +3 -3
- package/lib/browser/blocks/form/select/component-info.d.ts +2 -0
- package/lib/{node/blocks → browser/blocks/form}/select/select.svelte +3 -3
- package/lib/browser/blocks/form/submit-button/component-info.d.ts +2 -0
- package/lib/{node/blocks → browser/blocks/form}/submit-button/submit-button.svelte +2 -2
- package/lib/browser/blocks/slot/slot.svelte +1 -0
- package/lib/browser/blocks/slot/slot.svelte.d.ts +4 -7
- package/lib/browser/blocks/symbol/symbol.svelte +0 -1
- package/lib/browser/blocks/symbol/symbol.svelte.d.ts +7 -9
- package/lib/browser/blocks/symbol/symbol.types.d.ts +2 -2
- package/lib/browser/components/block/block.svelte +4 -2
- package/lib/browser/components/block/components/block-wrapper.svelte.d.ts +4 -4
- package/lib/browser/components/block/components/component-ref/component-ref.helpers.d.ts +3 -3
- package/lib/browser/components/content/content.types.d.ts +1 -8
- package/lib/browser/components/content/contentProps.types.d.ts +12 -0
- package/lib/browser/components/content/contentProps.types.js +1 -0
- package/lib/browser/components/dynamic-renderer/dynamic-renderer.svelte +2 -0
- package/lib/browser/constants/builder-registered-components.js +5 -24
- package/lib/browser/constants/extra-components.d.ts +7 -0
- package/lib/browser/constants/extra-components.js +47 -0
- package/lib/browser/constants/sdk-version.d.ts +1 -1
- package/lib/browser/constants/sdk-version.js +1 -1
- package/lib/browser/functions/get-env.d.ts +2 -0
- package/lib/browser/functions/get-env.js +5 -0
- package/lib/browser/functions/get.d.ts +1 -0
- package/lib/browser/functions/get.js +4 -0
- package/lib/browser/types/builder-props.d.ts +1 -1
- package/lib/browser/types/input.d.ts +1 -0
- package/lib/browser/types/typescript.d.ts +0 -3
- package/lib/edge/blocks/columns/columns.svelte +0 -1
- package/lib/edge/blocks/columns/columns.svelte.d.ts +8 -10
- package/lib/edge/blocks/columns/columns.types.d.ts +2 -2
- package/lib/edge/blocks/form/form/component-info.d.ts +2 -0
- package/lib/edge/blocks/form/form/form.svelte +302 -0
- package/lib/edge/blocks/form/input/component-info.d.ts +2 -0
- package/lib/{node/blocks → edge/blocks/form}/input/input.svelte +3 -3
- package/lib/edge/blocks/form/select/component-info.d.ts +2 -0
- package/lib/{browser/blocks → edge/blocks/form}/select/select.svelte +3 -3
- package/lib/edge/blocks/form/submit-button/component-info.d.ts +2 -0
- package/lib/edge/blocks/{submit-button → form/submit-button}/submit-button.svelte +2 -2
- package/lib/edge/blocks/slot/slot.svelte +1 -0
- package/lib/edge/blocks/slot/slot.svelte.d.ts +4 -7
- package/lib/edge/blocks/symbol/symbol.svelte +0 -1
- package/lib/edge/blocks/symbol/symbol.svelte.d.ts +7 -9
- package/lib/edge/blocks/symbol/symbol.types.d.ts +2 -2
- package/lib/edge/components/block/block.svelte +4 -2
- package/lib/edge/components/block/components/block-wrapper.svelte.d.ts +4 -4
- package/lib/edge/components/block/components/component-ref/component-ref.helpers.d.ts +3 -3
- package/lib/edge/components/content/content.types.d.ts +1 -8
- package/lib/edge/components/content/contentProps.types.d.ts +12 -0
- package/lib/edge/components/content/contentProps.types.js +1 -0
- package/lib/edge/components/dynamic-renderer/dynamic-renderer.svelte +2 -0
- package/lib/edge/constants/builder-registered-components.js +5 -24
- package/lib/edge/constants/extra-components.d.ts +7 -0
- package/lib/edge/constants/extra-components.js +47 -0
- package/lib/edge/constants/sdk-version.d.ts +1 -1
- package/lib/edge/constants/sdk-version.js +1 -1
- package/lib/edge/functions/get-env.d.ts +2 -0
- package/lib/edge/functions/get-env.js +5 -0
- package/lib/edge/functions/get.d.ts +1 -0
- package/lib/edge/functions/get.js +4 -0
- package/lib/edge/types/builder-props.d.ts +1 -1
- package/lib/edge/types/input.d.ts +1 -0
- package/lib/edge/types/typescript.d.ts +0 -3
- package/lib/node/blocks/columns/columns.svelte +0 -1
- package/lib/node/blocks/columns/columns.svelte.d.ts +8 -10
- package/lib/node/blocks/columns/columns.types.d.ts +2 -2
- package/lib/node/blocks/form/form/component-info.d.ts +2 -0
- package/lib/node/blocks/form/form/form.svelte +302 -0
- package/lib/node/blocks/form/input/component-info.d.ts +2 -0
- package/lib/{edge/blocks → node/blocks/form}/input/input.svelte +3 -3
- package/lib/node/blocks/form/select/component-info.d.ts +2 -0
- package/lib/{edge/blocks → node/blocks/form}/select/select.svelte +3 -3
- package/lib/node/blocks/form/submit-button/component-info.d.ts +2 -0
- package/lib/{browser/blocks → node/blocks/form}/submit-button/submit-button.svelte +2 -2
- package/lib/node/blocks/slot/slot.svelte +1 -0
- package/lib/node/blocks/slot/slot.svelte.d.ts +4 -7
- package/lib/node/blocks/symbol/symbol.svelte +0 -1
- package/lib/node/blocks/symbol/symbol.svelte.d.ts +7 -9
- package/lib/node/blocks/symbol/symbol.types.d.ts +2 -2
- package/lib/node/components/block/block.svelte +4 -2
- package/lib/node/components/block/components/block-wrapper.svelte.d.ts +4 -4
- package/lib/node/components/block/components/component-ref/component-ref.helpers.d.ts +3 -3
- package/lib/node/components/content/content.types.d.ts +1 -8
- package/lib/node/components/content/contentProps.types.d.ts +12 -0
- package/lib/node/components/content/contentProps.types.js +1 -0
- package/lib/node/components/dynamic-renderer/dynamic-renderer.svelte +2 -0
- package/lib/node/constants/builder-registered-components.js +5 -24
- package/lib/node/constants/extra-components.d.ts +7 -0
- package/lib/node/constants/extra-components.js +47 -0
- package/lib/node/constants/sdk-version.d.ts +1 -1
- package/lib/node/constants/sdk-version.js +1 -1
- package/lib/node/functions/get-env.d.ts +2 -0
- package/lib/node/functions/get-env.js +5 -0
- package/lib/node/functions/get.d.ts +1 -0
- package/lib/node/functions/get.js +4 -0
- package/lib/node/types/builder-props.d.ts +1 -1
- package/lib/node/types/input.d.ts +1 -0
- package/lib/node/types/typescript.d.ts +0 -3
- package/package.json +1 -1
- package/src/blocks/columns/columns.svelte +8 -11
- package/src/blocks/columns/columns.types.ts +2 -2
- package/src/blocks/form/{component-info.ts → form/component-info.ts} +1 -1
- package/src/blocks/form/form/form.svelte +358 -0
- package/src/blocks/{input → form/input}/component-info.ts +1 -1
- package/src/blocks/{input → form/input}/input.svelte +3 -3
- package/src/blocks/{select → form/select}/component-info.ts +1 -1
- package/src/blocks/{select → form/select}/select.svelte +3 -3
- package/src/blocks/{submit-button → form/submit-button}/component-info.ts +1 -1
- package/src/blocks/{submit-button → form/submit-button}/submit-button.svelte +2 -2
- package/src/blocks/slot/slot.svelte +4 -6
- package/src/blocks/symbol/symbol.svelte +7 -10
- package/src/blocks/symbol/symbol.types.ts +2 -2
- package/src/components/block/block.svelte +4 -2
- package/src/components/block/components/block-wrapper.svelte +4 -4
- package/src/components/block/components/component-ref/component-ref.helpers.ts +3 -3
- package/src/components/block/components/interactive-element.svelte +7 -9
- package/src/components/blocks/blocks-wrapper.svelte +7 -7
- package/src/components/content/content.types.ts +1 -7
- package/src/components/content/contentProps.types.ts +12 -0
- package/src/components/dynamic-renderer/dynamic-renderer.svelte +12 -16
- package/src/constants/builder-registered-components.ts +5 -24
- package/src/constants/extra-components.ts +49 -0
- package/src/constants/sdk-version.ts +1 -1
- package/src/functions/get-env.ts +5 -0
- package/src/functions/get.ts +4 -0
- package/src/types/builder-props.ts +1 -1
- package/src/types/input.ts +1 -0
- package/src/types/typescript.ts +1 -4
- package/lib/browser/blocks/form/component-info.d.ts +0 -2
- package/lib/browser/blocks/form/form.svelte +0 -2
- package/lib/browser/blocks/form/form.svelte.d.ts +0 -14
- package/lib/browser/blocks/input/component-info.d.ts +0 -2
- package/lib/browser/blocks/select/component-info.d.ts +0 -2
- package/lib/browser/blocks/submit-button/component-info.d.ts +0 -2
- package/lib/browser/components/dynamic-renderer/dynamic-renderer.svelte.d.ts +0 -21
- package/lib/edge/blocks/form/component-info.d.ts +0 -2
- package/lib/edge/blocks/form/form.svelte +0 -2
- package/lib/edge/blocks/form/form.svelte.d.ts +0 -14
- package/lib/edge/blocks/input/component-info.d.ts +0 -2
- package/lib/edge/blocks/select/component-info.d.ts +0 -2
- package/lib/edge/blocks/submit-button/component-info.d.ts +0 -2
- package/lib/edge/components/dynamic-renderer/dynamic-renderer.svelte.d.ts +0 -21
- package/lib/node/blocks/form/component-info.d.ts +0 -2
- package/lib/node/blocks/form/form.svelte +0 -2
- package/lib/node/blocks/form/form.svelte.d.ts +0 -14
- package/lib/node/blocks/input/component-info.d.ts +0 -2
- package/lib/node/blocks/select/component-info.d.ts +0 -2
- package/lib/node/blocks/submit-button/component-info.d.ts +0 -2
- package/lib/node/components/dynamic-renderer/dynamic-renderer.svelte.d.ts +0 -21
- package/src/blocks/form/form.svelte +0 -2
- /package/lib/browser/blocks/form/{component-info.js → form/component-info.js} +0 -0
- /package/lib/browser/blocks/{input → form/input}/component-info.js +0 -0
- /package/lib/browser/blocks/{select → form/select}/component-info.js +0 -0
- /package/lib/browser/blocks/{submit-button → form/submit-button}/component-info.js +0 -0
- /package/lib/browser/blocks/{submit-button → form/submit-button}/submit-button.svelte.d.ts +0 -0
- /package/lib/edge/blocks/form/{component-info.js → form/component-info.js} +0 -0
- /package/lib/edge/blocks/{input → form/input}/component-info.js +0 -0
- /package/lib/edge/blocks/{select → form/select}/component-info.js +0 -0
- /package/lib/edge/blocks/{submit-button → form/submit-button}/component-info.js +0 -0
- /package/lib/edge/blocks/{submit-button → form/submit-button}/submit-button.svelte.d.ts +0 -0
- /package/lib/node/blocks/form/{component-info.js → form/component-info.js} +0 -0
- /package/lib/node/blocks/{input → form/input}/component-info.js +0 -0
- /package/lib/node/blocks/{select → form/select}/component-info.js +0 -0
- /package/lib/node/blocks/{submit-button → form/submit-button}/component-info.js +0 -0
- /package/lib/node/blocks/{submit-button → form/submit-button}/submit-button.svelte.d.ts +0 -0
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
|
-
export
|
|
2
|
+
export type DropzoneProps = BuilderDataProps & {
|
|
3
3
|
name: string;
|
|
4
|
-
builderBlock: BuilderBlock;
|
|
5
|
-
builderContext: Writable<BuilderContextInterface>;
|
|
6
4
|
attributes: any;
|
|
7
|
-
}
|
|
8
|
-
import type {
|
|
9
|
-
import type { BuilderBlock } from "../../types/builder-block.js";
|
|
10
|
-
import type { Writable } from "svelte/store";
|
|
5
|
+
};
|
|
6
|
+
import type { BuilderDataProps } from "../../types/builder-props.js";
|
|
11
7
|
declare const __propDef: {
|
|
12
8
|
props: {
|
|
9
|
+
js: any;
|
|
13
10
|
builderContext: DropzoneProps["builderContext"];
|
|
14
11
|
name: DropzoneProps["name"];
|
|
15
12
|
};
|
|
@@ -4,7 +4,6 @@ import { filterAttrs } from "../helpers.js";
|
|
|
4
4
|
import { getClassPropName } from "../../functions/get-class-prop-name.js";
|
|
5
5
|
import { setAttrs } from "../helpers.js";
|
|
6
6
|
import { fetchSymbolContent } from "./symbol.helpers.js";
|
|
7
|
-
export let js;
|
|
8
7
|
export let attributes = undefined;
|
|
9
8
|
export let symbol = undefined;
|
|
10
9
|
export let dynamic = undefined;
|
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
|
-
import type { PropsWithBuilderData } from "../../types/builder-props.js";
|
|
3
2
|
import type { SymbolProps } from "./symbol.types.js";
|
|
4
3
|
declare const __propDef: {
|
|
5
4
|
props: {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
builderLinkComponent?: PropsWithBuilderData<SymbolProps>["builderLinkComponent"];
|
|
5
|
+
attributes?: SymbolProps["attributes"];
|
|
6
|
+
symbol?: SymbolProps["symbol"];
|
|
7
|
+
dynamic?: SymbolProps["dynamic"];
|
|
8
|
+
builderContext: SymbolProps["builderContext"];
|
|
9
|
+
builderBlock: SymbolProps["builderBlock"];
|
|
10
|
+
builderComponents: SymbolProps["builderComponents"];
|
|
11
|
+
builderLinkComponent?: SymbolProps["builderLinkComponent"];
|
|
14
12
|
};
|
|
15
13
|
events: {
|
|
16
14
|
[evt: string]: CustomEvent<any>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { BuilderContent } from '../../types/builder-content.js';
|
|
2
|
-
import type { BuilderComponentsProp, BuilderLinkComponentProp } from '../../types/builder-props.js';
|
|
2
|
+
import type { BuilderComponentsProp, BuilderDataProps, BuilderLinkComponentProp } from '../../types/builder-props.js';
|
|
3
3
|
interface SymbolInfo {
|
|
4
4
|
model?: string;
|
|
5
5
|
entry?: string;
|
|
@@ -8,7 +8,7 @@ interface SymbolInfo {
|
|
|
8
8
|
inline?: boolean;
|
|
9
9
|
dynamic?: boolean;
|
|
10
10
|
}
|
|
11
|
-
export interface SymbolProps extends BuilderComponentsProp, BuilderLinkComponentProp {
|
|
11
|
+
export interface SymbolProps extends BuilderComponentsProp, BuilderDataProps, BuilderLinkComponentProp {
|
|
12
12
|
symbol?: SymbolInfo;
|
|
13
13
|
dataOnly?: boolean;
|
|
14
14
|
dynamic?: boolean;
|
|
@@ -81,13 +81,15 @@ $: componentRefProps = () => {
|
|
|
81
81
|
builderContext: context,
|
|
82
82
|
...(blockComponent?.()?.name === "Core:Button" ||
|
|
83
83
|
blockComponent?.()?.name === "Symbol" ||
|
|
84
|
-
blockComponent?.()?.name === "Columns"
|
|
84
|
+
blockComponent?.()?.name === "Columns" ||
|
|
85
|
+
blockComponent?.()?.name === "Form:Form"
|
|
85
86
|
? {
|
|
86
87
|
builderLinkComponent: linkComponent,
|
|
87
88
|
}
|
|
88
89
|
: {}),
|
|
89
90
|
...(blockComponent?.()?.name === "Symbol" ||
|
|
90
|
-
blockComponent?.()?.name === "Columns"
|
|
91
|
+
blockComponent?.()?.name === "Columns" ||
|
|
92
|
+
blockComponent?.()?.name === "Form:Form"
|
|
91
93
|
? {
|
|
92
94
|
builderComponents: registeredComponents,
|
|
93
95
|
}
|
|
@@ -4,16 +4,16 @@ type BlockWrapperProps = {
|
|
|
4
4
|
block: BuilderBlock;
|
|
5
5
|
context: Writable<BuilderContextInterface>;
|
|
6
6
|
linkComponent: any;
|
|
7
|
+
children?: any;
|
|
7
8
|
};
|
|
8
9
|
import type { BuilderContextInterface } from "../../../context/types.js";
|
|
9
10
|
import type { BuilderBlock } from "../../../types/builder-block.js";
|
|
10
|
-
import type { PropsWithChildren } from "../../../types/typescript.js";
|
|
11
11
|
import type { Writable } from "svelte/store";
|
|
12
12
|
declare const __propDef: {
|
|
13
13
|
props: {
|
|
14
|
-
Wrapper:
|
|
15
|
-
block:
|
|
16
|
-
context:
|
|
14
|
+
Wrapper: BlockWrapperProps["Wrapper"];
|
|
15
|
+
block: BlockWrapperProps["block"];
|
|
16
|
+
context: BlockWrapperProps["context"];
|
|
17
17
|
};
|
|
18
18
|
events: {
|
|
19
19
|
[evt: string]: CustomEvent<any>;
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
import type { Writable } from "svelte/store";
|
|
3
3
|
import type { BuilderContextInterface, RegisteredComponents } from '../../../../context/types.js';
|
|
4
4
|
import type { BuilderBlock } from '../../../../types/builder-block.js';
|
|
5
|
-
import type {
|
|
5
|
+
import type { BuilderDataProps } from '../../../../types/builder-props.js';
|
|
6
6
|
import type { InteractiveElementProps } from '../interactive-element.svelte';
|
|
7
|
-
type ComponentOptions =
|
|
7
|
+
type ComponentOptions = BuilderDataProps & {
|
|
8
8
|
[index: string]: any;
|
|
9
9
|
attributes?: {
|
|
10
10
|
[index: string]: any;
|
|
11
11
|
};
|
|
12
|
-
}
|
|
12
|
+
};
|
|
13
13
|
export interface ComponentProps {
|
|
14
14
|
componentRef: any;
|
|
15
15
|
componentOptions: ComponentOptions;
|
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
import type { BuilderRenderState } from '../../context/types.js';
|
|
2
|
-
|
|
3
|
-
import type { ContentVariantsPrps } from '../content-variants/content-variants.types.js';
|
|
4
|
-
interface InternalRenderProps {
|
|
5
|
-
showContent: boolean;
|
|
6
|
-
isSsrAbTest: boolean;
|
|
7
|
-
}
|
|
8
|
-
export type ContentProps = InternalRenderProps & EnforcePartials<ContentVariantsPrps>;
|
|
2
|
+
export type { ContentProps } from './contentProps.types.js';
|
|
9
3
|
export interface BuilderComponentStateChange {
|
|
10
4
|
state: BuilderRenderState;
|
|
11
5
|
ref: {
|
|
@@ -17,4 +11,3 @@ export interface BuilderComponentStateChange {
|
|
|
17
11
|
};
|
|
18
12
|
};
|
|
19
13
|
}
|
|
20
|
-
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { EnforcePartials } from '../../types/enforced-partials.js';
|
|
2
|
+
import type { ContentVariantsPrps } from '../content-variants/content-variants.types.js';
|
|
3
|
+
interface InternalRenderProps {
|
|
4
|
+
showContent: boolean;
|
|
5
|
+
isSsrAbTest: boolean;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* This is in a separate file so that we can override it (most notably in Vue,
|
|
9
|
+
* where prop types cannot be wrapped by generics like `EnforcePartials`).
|
|
10
|
+
*/
|
|
11
|
+
export type ContentProps = InternalRenderProps & EnforcePartials<ContentVariantsPrps>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -2,16 +2,10 @@ 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';
|
|
9
5
|
import { componentInfo as fragmentComponentInfo } from '../blocks/fragment/component-info.js';
|
|
10
6
|
import { default as Fragment } from '../blocks/fragment/fragment.svelte';
|
|
11
7
|
import { componentInfo as imageComponentInfo } from '../blocks/image/component-info.js';
|
|
12
8
|
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';
|
|
15
9
|
import { componentInfo as sectionComponentInfo } from '../blocks/section/component-info.js';
|
|
16
10
|
import { default as Section } from '../blocks/section/section.svelte';
|
|
17
11
|
import { componentInfo as slotComponentInfo } from '../blocks/slot/component-info.js';
|
|
@@ -20,8 +14,7 @@ import { componentInfo as symbolComponentInfo } from '../blocks/symbol/component
|
|
|
20
14
|
import { default as Symbol } from '../blocks/symbol/symbol.svelte';
|
|
21
15
|
import { componentInfo as textComponentInfo } from '../blocks/text/component-info.js';
|
|
22
16
|
import { default as Text } from '../blocks/text/text.svelte';
|
|
23
|
-
import {
|
|
24
|
-
import { default as Video } from '../blocks/video/video.svelte';
|
|
17
|
+
import { getExtraComponents } from './extra-components.js';
|
|
25
18
|
/**
|
|
26
19
|
* Returns a list of all registered components.
|
|
27
20
|
* NOTE: This needs to be a function to work around ESM circular dependencies.
|
|
@@ -32,34 +25,22 @@ export const getDefaultRegisteredComponents = () => [{
|
|
|
32
25
|
}, {
|
|
33
26
|
component: Columns,
|
|
34
27
|
...columnsComponentInfo
|
|
35
|
-
}, {
|
|
36
|
-
component: customCode,
|
|
37
|
-
...customCodeInfo
|
|
38
|
-
}, {
|
|
39
|
-
component: embed,
|
|
40
|
-
...embedComponentInfo
|
|
41
28
|
}, {
|
|
42
29
|
component: Fragment,
|
|
43
30
|
...fragmentComponentInfo
|
|
44
31
|
}, {
|
|
45
32
|
component: Image,
|
|
46
33
|
...imageComponentInfo
|
|
47
|
-
}, {
|
|
48
|
-
component: Img,
|
|
49
|
-
...imgComponentInfo
|
|
50
34
|
}, {
|
|
51
35
|
component: Section,
|
|
52
36
|
...sectionComponentInfo
|
|
37
|
+
}, {
|
|
38
|
+
component: Slot,
|
|
39
|
+
...slotComponentInfo
|
|
53
40
|
}, {
|
|
54
41
|
component: Symbol,
|
|
55
42
|
...symbolComponentInfo
|
|
56
43
|
}, {
|
|
57
44
|
component: Text,
|
|
58
45
|
...textComponentInfo
|
|
59
|
-
},
|
|
60
|
-
component: Video,
|
|
61
|
-
...videoComponentInfo
|
|
62
|
-
}, {
|
|
63
|
-
component: Slot,
|
|
64
|
-
...slotComponentInfo
|
|
65
|
-
}];
|
|
46
|
+
}, ...getExtraComponents()];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* These are in a separate file because React Native does not support them (yet).
|
|
3
|
+
* Having them in a separate file allows us to override it to be empty in the
|
|
4
|
+
* React Native SDK.
|
|
5
|
+
*/
|
|
6
|
+
import type { RegisteredComponent } from '../context/types.js';
|
|
7
|
+
export declare const getExtraComponents: () => RegisteredComponent[];
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* These are in a separate file because React Native does not support them (yet).
|
|
3
|
+
* Having them in a separate file allows us to override it to be empty in the
|
|
4
|
+
* React Native SDK.
|
|
5
|
+
*/
|
|
6
|
+
import { componentInfo as customCodeInfo } from '../blocks/custom-code/component-info.js';
|
|
7
|
+
import { default as customCode } from '../blocks/custom-code/custom-code.svelte';
|
|
8
|
+
import { componentInfo as embedComponentInfo } from '../blocks/embed/component-info.js';
|
|
9
|
+
import { default as embed } from '../blocks/embed/embed.svelte';
|
|
10
|
+
import { componentInfo as formComponentInfo } from '../blocks/form/form/component-info.js';
|
|
11
|
+
import { default as Form } from '../blocks/form/form/form.svelte';
|
|
12
|
+
import { componentInfo as formInputComponentInfo } from '../blocks/form/input/component-info.js';
|
|
13
|
+
import { default as FormInput } from '../blocks/form/input/input.svelte';
|
|
14
|
+
import { componentInfo as formSelectComponentInfo } from '../blocks/form/select/component-info.js';
|
|
15
|
+
import { default as FormSelect } from '../blocks/form/select/select.svelte';
|
|
16
|
+
import { componentInfo as formSubmitButtonComponentInfo } from '../blocks/form/submit-button/component-info.js';
|
|
17
|
+
import { default as FormSubmitButton } from '../blocks/form/submit-button/submit-button.svelte';
|
|
18
|
+
import { componentInfo as imgComponentInfo } from '../blocks/img/component-info.js';
|
|
19
|
+
import { default as Img } from '../blocks/img/img.svelte';
|
|
20
|
+
import { componentInfo as videoComponentInfo } from '../blocks/video/component-info.js';
|
|
21
|
+
import { default as Video } from '../blocks/video/video.svelte';
|
|
22
|
+
import { TARGET } from './target.js';
|
|
23
|
+
export const getExtraComponents = () => [{
|
|
24
|
+
component: customCode,
|
|
25
|
+
...customCodeInfo
|
|
26
|
+
}, {
|
|
27
|
+
component: embed,
|
|
28
|
+
...embedComponentInfo
|
|
29
|
+
}, ...(TARGET === 'rsc' ? [] : [{
|
|
30
|
+
component: Form,
|
|
31
|
+
...formComponentInfo
|
|
32
|
+
}, {
|
|
33
|
+
component: FormInput,
|
|
34
|
+
...formInputComponentInfo
|
|
35
|
+
}, {
|
|
36
|
+
component: FormSubmitButton,
|
|
37
|
+
...formSubmitButtonComponentInfo
|
|
38
|
+
}, {
|
|
39
|
+
component: FormSelect,
|
|
40
|
+
...formSelectComponentInfo
|
|
41
|
+
}]), {
|
|
42
|
+
component: Img,
|
|
43
|
+
...imgComponentInfo
|
|
44
|
+
}, {
|
|
45
|
+
component: Video,
|
|
46
|
+
...videoComponentInfo
|
|
47
|
+
}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.13.
|
|
1
|
+
export declare const SDK_VERSION = "0.13.3";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "0.13.
|
|
1
|
+
export const SDK_VERSION = "0.13.3";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export const validEnvList = ['production', 'qa', 'test', 'development', 'dev', 'cdn-qa', 'cloud', 'fast', 'cdn2', 'cdn-prod'];
|
|
2
|
+
export const getEnv = () => {
|
|
3
|
+
const env = process.env.NODE_ENV || 'production';
|
|
4
|
+
return validEnvList.includes(env) ? env : 'production';
|
|
5
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const get: (obj: any, path: string, defaultValue?: any) => any;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export const get = (obj, path, defaultValue) => {
|
|
2
|
+
const result = String.prototype.split.call(path, /[,[\].]+?/).filter(Boolean).reduce((res, key) => res !== null && res !== undefined ? res[key] : res, obj);
|
|
3
|
+
return result === undefined || result === obj ? defaultValue : result;
|
|
4
|
+
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import type { Writable } from "svelte/store";
|
|
3
3
|
import type { BuilderContextInterface, RegisteredComponents } from '../context/types.js';
|
|
4
4
|
import type { BuilderBlock } from './builder-block.js';
|
|
5
|
-
export type
|
|
5
|
+
export type BuilderDataProps = {
|
|
6
6
|
builderBlock: BuilderBlock;
|
|
7
7
|
builderContext: Writable<BuilderContextInterface>;
|
|
8
8
|
};
|
package/package.json
CHANGED
|
@@ -12,22 +12,19 @@
|
|
|
12
12
|
import { deoptSignal } from "../../functions/deopt.js";
|
|
13
13
|
import { getClassPropName } from "../../functions/get-class-prop-name.js";
|
|
14
14
|
import { mapStyleObjToStrIfNeeded } from "../../functions/get-style.js";
|
|
15
|
-
import type { PropsWithBuilderData } from "../../types/builder-props.js";
|
|
16
15
|
import type { Dictionary } from "../../types/typescript.js";
|
|
17
16
|
import type { ColumnProps } from "./columns.types.js";
|
|
18
17
|
|
|
19
|
-
export let
|
|
20
|
-
export let
|
|
21
|
-
export let
|
|
22
|
-
export let
|
|
18
|
+
export let space: ColumnProps["space"] = undefined;
|
|
19
|
+
export let columns: ColumnProps["columns"] = undefined;
|
|
20
|
+
export let stackColumnsAt: ColumnProps["stackColumnsAt"] = undefined;
|
|
21
|
+
export let reverseColumnsWhenStacked: ColumnProps["reverseColumnsWhenStacked"] =
|
|
23
22
|
undefined;
|
|
24
|
-
export let
|
|
23
|
+
export let builderContext: ColumnProps["builderContext"];
|
|
24
|
+
export let builderBlock: ColumnProps["builderBlock"];
|
|
25
|
+
export let builderLinkComponent: ColumnProps["builderLinkComponent"] =
|
|
25
26
|
undefined;
|
|
26
|
-
export let
|
|
27
|
-
export let builderBlock: PropsWithBuilderData<ColumnProps>["builderBlock"];
|
|
28
|
-
export let builderLinkComponent: PropsWithBuilderData<ColumnProps>["builderLinkComponent"] =
|
|
29
|
-
undefined;
|
|
30
|
-
export let builderComponents: PropsWithBuilderData<ColumnProps>["builderComponents"];
|
|
27
|
+
export let builderComponents: ColumnProps["builderComponents"];
|
|
31
28
|
|
|
32
29
|
function mitosis_styling(node, vars) {
|
|
33
30
|
Object.entries(vars || {}).forEach(([p, v]) => {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { BuilderBlock } from '../../types/builder-block.js';
|
|
2
|
-
import type { BuilderComponentsProp, BuilderLinkComponentProp } from '../../types/builder-props.js';
|
|
2
|
+
import type { BuilderComponentsProp, BuilderDataProps, BuilderLinkComponentProp } from '../../types/builder-props.js';
|
|
3
3
|
type Column = {
|
|
4
4
|
blocks: BuilderBlock[];
|
|
5
5
|
width?: number;
|
|
6
6
|
link?: string;
|
|
7
7
|
};
|
|
8
8
|
type StackColumnsAt = 'tablet' | 'mobile' | 'never';
|
|
9
|
-
export interface ColumnProps extends BuilderComponentsProp, BuilderLinkComponentProp {
|
|
9
|
+
export interface ColumnProps extends BuilderComponentsProp, BuilderLinkComponentProp, BuilderDataProps {
|
|
10
10
|
columns?: Column[];
|
|
11
11
|
space?: number;
|
|
12
12
|
stackColumnsAt?: StackColumnsAt;
|