@builder.io/sdk-svelte 0.1.8 → 0.1.10
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/CHANGELOG.md +8 -0
- package/package/blocks/BaseText.svelte.d.ts +3 -3
- package/package/blocks/button/button.svelte.d.ts +3 -3
- package/package/blocks/columns/columns.svelte.d.ts +5 -5
- package/package/blocks/custom-code/custom-code.svelte.d.ts +3 -3
- package/package/blocks/embed/embed.svelte.d.ts +3 -3
- package/package/blocks/form/form.svelte.d.ts +4 -4
- package/package/blocks/fragment/fragment.svelte.d.ts +4 -4
- package/package/blocks/image/component-info.js +1 -1
- package/package/blocks/image/image.svelte.d.ts +3 -3
- package/package/blocks/img/img.svelte.d.ts +3 -3
- package/package/blocks/input/input.svelte.d.ts +3 -3
- package/package/blocks/raw-text/raw-text.svelte.d.ts +3 -3
- package/package/blocks/section/section.svelte +2 -2
- package/package/blocks/section/section.svelte.d.ts +3 -3
- package/package/blocks/select/select.svelte.d.ts +3 -3
- package/package/blocks/submit-button/submit-button.svelte.d.ts +3 -3
- package/package/blocks/symbol/symbol.svelte.d.ts +3 -3
- package/package/blocks/text/text.svelte +16 -1
- package/package/blocks/text/text.svelte.d.ts +3 -3
- package/package/blocks/textarea/textarea.svelte.d.ts +3 -3
- package/package/blocks/video/video.svelte.d.ts +3 -3
- package/package/components/render-block/block-styles.svelte.d.ts +4 -4
- package/package/components/render-block/render-block.svelte.d.ts +4 -4
- package/package/components/render-block/render-component.svelte.d.ts +4 -4
- package/package/components/render-block/render-repeated-block.svelte.d.ts +4 -4
- package/package/components/render-blocks.svelte.d.ts +4 -4
- package/package/components/render-content/builder-editing.svelte.d.ts +4 -4
- package/package/components/render-content/components/render-styles.svelte +13 -0
- package/package/components/render-content/components/render-styles.svelte.d.ts +3 -3
- package/package/components/render-content/render-content.svelte +2 -6
- package/package/components/render-content/render-content.svelte.d.ts +3 -3
- package/package/components/render-content/render-content.types.d.ts +1 -1
- package/package/components/render-inlined-styles.svelte.d.ts +3 -3
- package/package/constants/device-sizes.d.ts +1 -1
- package/package/context/types.d.ts +4 -4
- package/package/functions/get-block-actions-handler.d.ts +2 -2
- package/package/functions/get-block-actions.d.ts +1 -1
- package/package/functions/get-block-tag.d.ts +1 -1
- package/package/functions/get-builder-search-params/index.d.ts +1 -1
- package/package/functions/if-target.d.ts +1 -1
- package/package/functions/is-editing.js +4 -1
- package/package/functions/sanitize-react-native-block-styles.d.ts +1 -1
- package/package/functions/set-editor-settings.d.ts +1 -1
- package/package/functions/track/index.d.ts +2 -2
- package/package/functions/track/interaction.d.ts +1 -1
- package/package/helpers/nullable.d.ts +1 -1
- package/package/index.d.ts +0 -1
- package/package/index.js +0 -1
- package/package/types/builder-block.d.ts +1 -1
- package/package/types/can-track.d.ts +1 -1
- package/package/types/components.d.ts +1 -1
- package/package/types/deep-partial.d.ts +1 -1
- package/package/types/element.d.ts +1 -1
- package/package/types/targets.d.ts +2 -2
- package/package/types/typescript.d.ts +3 -3
- package/package.json +1 -1
- package/src/blocks/image/component-info.ts +1 -1
- package/src/blocks/section/section.svelte +2 -2
- package/src/blocks/text/text.svelte +16 -1
- package/src/components/render-content/components/render-styles.svelte +13 -0
- package/src/components/render-content/render-content.svelte +2 -8
- package/src/functions/is-editing.ts +4 -1
- package/src/index.ts +0 -1
package/package/--package.json
CHANGED
package/package/CHANGELOG.md
CHANGED
|
@@ -11,9 +11,9 @@ declare const __propDef: {
|
|
|
11
11
|
};
|
|
12
12
|
slots: {};
|
|
13
13
|
};
|
|
14
|
-
export
|
|
15
|
-
export
|
|
16
|
-
export
|
|
14
|
+
export type BaseTextProps = typeof __propDef.props;
|
|
15
|
+
export type BaseTextEvents = typeof __propDef.events;
|
|
16
|
+
export type BaseTextSlots = typeof __propDef.slots;
|
|
17
17
|
export default class BaseText extends SvelteComponentTyped<BaseTextProps, BaseTextEvents, BaseTextSlots> {
|
|
18
18
|
}
|
|
19
19
|
export {};
|
|
@@ -17,9 +17,9 @@ declare const __propDef: {
|
|
|
17
17
|
};
|
|
18
18
|
slots: {};
|
|
19
19
|
};
|
|
20
|
-
export
|
|
21
|
-
export
|
|
22
|
-
export
|
|
20
|
+
export type ButtonProps = typeof __propDef.props;
|
|
21
|
+
export type ButtonEvents = typeof __propDef.events;
|
|
22
|
+
export type ButtonSlots = typeof __propDef.slots;
|
|
23
23
|
export default class Button extends SvelteComponentTyped<ButtonProps, ButtonEvents, ButtonSlots> {
|
|
24
24
|
}
|
|
25
25
|
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
2
|
import type { BuilderBlock } from "../../types/builder-block";
|
|
3
|
-
|
|
3
|
+
type Column = {
|
|
4
4
|
blocks: any;
|
|
5
5
|
width?: number;
|
|
6
6
|
};
|
|
7
|
-
|
|
7
|
+
type StackColumnsAt = "tablet" | "mobile" | "never";
|
|
8
8
|
export interface ColumnProps {
|
|
9
9
|
columns?: Column[];
|
|
10
10
|
builderBlock: BuilderBlock;
|
|
@@ -25,9 +25,9 @@ declare const __propDef: {
|
|
|
25
25
|
};
|
|
26
26
|
slots: {};
|
|
27
27
|
};
|
|
28
|
-
export
|
|
29
|
-
export
|
|
30
|
-
export
|
|
28
|
+
export type ColumnsProps = typeof __propDef.props;
|
|
29
|
+
export type ColumnsEvents = typeof __propDef.events;
|
|
30
|
+
export type ColumnsSlots = typeof __propDef.slots;
|
|
31
31
|
export default class Columns extends SvelteComponentTyped<ColumnsProps, ColumnsEvents, ColumnsSlots> {
|
|
32
32
|
}
|
|
33
33
|
export {};
|
|
@@ -13,9 +13,9 @@ declare const __propDef: {
|
|
|
13
13
|
};
|
|
14
14
|
slots: {};
|
|
15
15
|
};
|
|
16
|
-
export
|
|
17
|
-
export
|
|
18
|
-
export
|
|
16
|
+
export type CustomCodeProps = typeof __propDef.props;
|
|
17
|
+
export type CustomCodeEvents = typeof __propDef.events;
|
|
18
|
+
export type CustomCodeSlots = typeof __propDef.slots;
|
|
19
19
|
export default class CustomCode extends SvelteComponentTyped<CustomCodeProps, CustomCodeEvents, CustomCodeSlots> {
|
|
20
20
|
}
|
|
21
21
|
export {};
|
|
@@ -11,9 +11,9 @@ declare const __propDef: {
|
|
|
11
11
|
};
|
|
12
12
|
slots: {};
|
|
13
13
|
};
|
|
14
|
-
export
|
|
15
|
-
export
|
|
16
|
-
export
|
|
14
|
+
export type EmbedProps = typeof __propDef.props;
|
|
15
|
+
export type EmbedEvents = typeof __propDef.events;
|
|
16
|
+
export type EmbedSlots = typeof __propDef.slots;
|
|
17
17
|
export default class Embed extends SvelteComponentTyped<EmbedProps, EmbedEvents, EmbedSlots> {
|
|
18
18
|
}
|
|
19
19
|
export {};
|
|
@@ -35,7 +35,7 @@ export interface FormProps {
|
|
|
35
35
|
* This component was copied over from the old SDKs and has a lot of code pointing to invalid functions/env vars. It needs
|
|
36
36
|
* to be cleaned up before the component can actually be usable.
|
|
37
37
|
*/
|
|
38
|
-
export
|
|
38
|
+
export type FormState = "unsubmitted" | "sending" | "success" | "error";
|
|
39
39
|
declare const __propDef: {
|
|
40
40
|
props: {
|
|
41
41
|
previewState: FormProps["previewState"];
|
|
@@ -62,9 +62,9 @@ declare const __propDef: {
|
|
|
62
62
|
};
|
|
63
63
|
slots: {};
|
|
64
64
|
};
|
|
65
|
-
export
|
|
66
|
-
export
|
|
67
|
-
export
|
|
65
|
+
export type FormProps = typeof __propDef.props;
|
|
66
|
+
export type FormEvents = typeof __propDef.events;
|
|
67
|
+
export type FormSlots = typeof __propDef.slots;
|
|
68
68
|
export default class Form extends SvelteComponentTyped<FormProps, FormEvents, FormSlots> {
|
|
69
69
|
}
|
|
70
70
|
export {};
|
|
@@ -5,7 +5,7 @@ export interface FragmentProps {
|
|
|
5
5
|
children?: any;
|
|
6
6
|
}
|
|
7
7
|
declare const __propDef: {
|
|
8
|
-
props:
|
|
8
|
+
props: Record<string, never>;
|
|
9
9
|
events: {
|
|
10
10
|
[evt: string]: CustomEvent<any>;
|
|
11
11
|
};
|
|
@@ -13,9 +13,9 @@ declare const __propDef: {
|
|
|
13
13
|
default: {};
|
|
14
14
|
};
|
|
15
15
|
};
|
|
16
|
-
export
|
|
17
|
-
export
|
|
18
|
-
export
|
|
16
|
+
export type FragmentProps = typeof __propDef.props;
|
|
17
|
+
export type FragmentEvents = typeof __propDef.events;
|
|
18
|
+
export type FragmentSlots = typeof __propDef.slots;
|
|
19
19
|
export default class Fragment extends SvelteComponentTyped<FragmentProps, FragmentEvents, FragmentSlots> {
|
|
20
20
|
}
|
|
21
21
|
export {};
|
|
@@ -17,7 +17,7 @@ export const componentInfo = {
|
|
|
17
17
|
bubble: true,
|
|
18
18
|
allowedFileTypes: ['jpeg', 'jpg', 'png', 'svg'],
|
|
19
19
|
required: true,
|
|
20
|
-
defaultValue: 'https://cdn.builder.io/api/v1/image/assets%
|
|
20
|
+
defaultValue: 'https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F72c80f114dc149019051b6852a9e3b7a',
|
|
21
21
|
onChange: serializeFn((options) => {
|
|
22
22
|
const DEFAULT_ASPECT_RATIO = 0.7041;
|
|
23
23
|
options.delete('srcset');
|
|
@@ -41,9 +41,9 @@ declare const __propDef: {
|
|
|
41
41
|
default: {};
|
|
42
42
|
};
|
|
43
43
|
};
|
|
44
|
-
export
|
|
45
|
-
export
|
|
46
|
-
export
|
|
44
|
+
export type ImageProps = typeof __propDef.props;
|
|
45
|
+
export type ImageEvents = typeof __propDef.events;
|
|
46
|
+
export type ImageSlots = typeof __propDef.slots;
|
|
47
47
|
export default class Image extends SvelteComponentTyped<ImageProps, ImageEvents, ImageSlots> {
|
|
48
48
|
}
|
|
49
49
|
export {};
|
|
@@ -21,9 +21,9 @@ declare const __propDef: {
|
|
|
21
21
|
};
|
|
22
22
|
slots: {};
|
|
23
23
|
};
|
|
24
|
-
export
|
|
25
|
-
export
|
|
26
|
-
export
|
|
24
|
+
export type ImgProps = typeof __propDef.props;
|
|
25
|
+
export type ImgEvents = typeof __propDef.events;
|
|
26
|
+
export type ImgSlots = typeof __propDef.slots;
|
|
27
27
|
export default class Img extends SvelteComponentTyped<ImgProps, ImgEvents, ImgSlots> {
|
|
28
28
|
}
|
|
29
29
|
export {};
|
|
@@ -23,9 +23,9 @@ declare const __propDef: {
|
|
|
23
23
|
};
|
|
24
24
|
slots: {};
|
|
25
25
|
};
|
|
26
|
-
export
|
|
27
|
-
export
|
|
28
|
-
export
|
|
26
|
+
export type InputProps = typeof __propDef.props;
|
|
27
|
+
export type InputEvents = typeof __propDef.events;
|
|
28
|
+
export type InputSlots = typeof __propDef.slots;
|
|
29
29
|
export default class Input extends SvelteComponentTyped<InputProps, InputEvents, InputSlots> {
|
|
30
30
|
}
|
|
31
31
|
export {};
|
|
@@ -13,9 +13,9 @@ declare const __propDef: {
|
|
|
13
13
|
};
|
|
14
14
|
slots: {};
|
|
15
15
|
};
|
|
16
|
-
export
|
|
17
|
-
export
|
|
18
|
-
export
|
|
16
|
+
export type RawTextProps = typeof __propDef.props;
|
|
17
|
+
export type RawTextEvents = typeof __propDef.events;
|
|
18
|
+
export type RawTextSlots = typeof __propDef.slots;
|
|
19
19
|
export default class RawText extends SvelteComponentTyped<RawTextProps, RawTextEvents, RawTextSlots> {
|
|
20
20
|
}
|
|
21
21
|
export {};
|
|
@@ -45,9 +45,9 @@ function mitosis_styling(node, vars) {
|
|
|
45
45
|
use:mitosis_styling={{
|
|
46
46
|
width: "100%",
|
|
47
47
|
alignSelf: "stretch",
|
|
48
|
-
flexGrow:
|
|
48
|
+
flexGrow: 1,
|
|
49
49
|
boxSizing: "border-box",
|
|
50
|
-
maxWidth:
|
|
50
|
+
maxWidth: maxWidth || 1200,
|
|
51
51
|
display: "flex",
|
|
52
52
|
flexDirection: "column",
|
|
53
53
|
alignItems: "stretch",
|
|
@@ -17,9 +17,9 @@ declare const __propDef: {
|
|
|
17
17
|
default: {};
|
|
18
18
|
};
|
|
19
19
|
};
|
|
20
|
-
export
|
|
21
|
-
export
|
|
22
|
-
export
|
|
20
|
+
export type SectionProps = typeof __propDef.props;
|
|
21
|
+
export type SectionEvents = typeof __propDef.events;
|
|
22
|
+
export type SectionSlots = typeof __propDef.slots;
|
|
23
23
|
export default class Section extends SvelteComponentTyped<SectionProps, SectionEvents, SectionSlots> {
|
|
24
24
|
}
|
|
25
25
|
export {};
|
|
@@ -22,9 +22,9 @@ declare const __propDef: {
|
|
|
22
22
|
};
|
|
23
23
|
slots: {};
|
|
24
24
|
};
|
|
25
|
-
export
|
|
26
|
-
export
|
|
27
|
-
export
|
|
25
|
+
export type SelectProps = typeof __propDef.props;
|
|
26
|
+
export type SelectEvents = typeof __propDef.events;
|
|
27
|
+
export type SelectSlots = typeof __propDef.slots;
|
|
28
28
|
export default class Select extends SvelteComponentTyped<SelectProps, SelectEvents, SelectSlots> {
|
|
29
29
|
}
|
|
30
30
|
export {};
|
|
@@ -13,9 +13,9 @@ declare const __propDef: {
|
|
|
13
13
|
};
|
|
14
14
|
slots: {};
|
|
15
15
|
};
|
|
16
|
-
export
|
|
17
|
-
export
|
|
18
|
-
export
|
|
16
|
+
export type SubmitButtonProps = typeof __propDef.props;
|
|
17
|
+
export type SubmitButtonEvents = typeof __propDef.events;
|
|
18
|
+
export type SubmitButtonSlots = typeof __propDef.slots;
|
|
19
19
|
export default class SubmitButton extends SvelteComponentTyped<SubmitButtonProps, SubmitButtonEvents, SubmitButtonSlots> {
|
|
20
20
|
}
|
|
21
21
|
export {};
|
|
@@ -28,9 +28,9 @@ declare const __propDef: {
|
|
|
28
28
|
};
|
|
29
29
|
slots: {};
|
|
30
30
|
};
|
|
31
|
-
export
|
|
32
|
-
export
|
|
33
|
-
export
|
|
31
|
+
export type SymbolProps = typeof __propDef.props;
|
|
32
|
+
export type SymbolEvents = typeof __propDef.events;
|
|
33
|
+
export type SymbolSlots = typeof __propDef.slots;
|
|
34
34
|
export default class Symbol extends SvelteComponentTyped<SymbolProps, SymbolEvents, SymbolSlots> {
|
|
35
35
|
}
|
|
36
36
|
export {};
|
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
<script context="module"></script>
|
|
2
2
|
|
|
3
3
|
<script>export let text;
|
|
4
|
+
function mitosis_styling(node, vars) {
|
|
5
|
+
Object.entries(vars || {}).forEach(([p, v]) => {
|
|
6
|
+
if (p.startsWith("--")) {
|
|
7
|
+
node.style.setProperty(p, v);
|
|
8
|
+
}
|
|
9
|
+
else {
|
|
10
|
+
node.style[p] = v;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
}
|
|
4
14
|
</script>
|
|
5
15
|
|
|
6
|
-
<span
|
|
16
|
+
<span
|
|
17
|
+
use:mitosis_styling={{
|
|
18
|
+
outline: "none",
|
|
19
|
+
}}
|
|
20
|
+
class="builder-text">{@html text}</span
|
|
21
|
+
>
|
|
@@ -11,9 +11,9 @@ declare const __propDef: {
|
|
|
11
11
|
};
|
|
12
12
|
slots: {};
|
|
13
13
|
};
|
|
14
|
-
export
|
|
15
|
-
export
|
|
16
|
-
export
|
|
14
|
+
export type TextProps = typeof __propDef.props;
|
|
15
|
+
export type TextEvents = typeof __propDef.events;
|
|
16
|
+
export type TextSlots = typeof __propDef.slots;
|
|
17
17
|
export default class Text extends SvelteComponentTyped<TextProps, TextEvents, TextSlots> {
|
|
18
18
|
}
|
|
19
19
|
export {};
|
|
@@ -19,9 +19,9 @@ declare const __propDef: {
|
|
|
19
19
|
};
|
|
20
20
|
slots: {};
|
|
21
21
|
};
|
|
22
|
-
export
|
|
23
|
-
export
|
|
24
|
-
export
|
|
22
|
+
export type TextareaProps = typeof __propDef.props;
|
|
23
|
+
export type TextareaEvents = typeof __propDef.events;
|
|
24
|
+
export type TextareaSlots = typeof __propDef.slots;
|
|
25
25
|
export default class Textarea extends SvelteComponentTyped<TextareaProps, TextareaEvents, TextareaSlots> {
|
|
26
26
|
}
|
|
27
27
|
export {};
|
|
@@ -33,9 +33,9 @@ declare const __propDef: {
|
|
|
33
33
|
};
|
|
34
34
|
slots: {};
|
|
35
35
|
};
|
|
36
|
-
export
|
|
37
|
-
export
|
|
38
|
-
export
|
|
36
|
+
export type VideoProps = typeof __propDef.props;
|
|
37
|
+
export type VideoEvents = typeof __propDef.events;
|
|
38
|
+
export type VideoSlots = typeof __propDef.slots;
|
|
39
39
|
export default class Video extends SvelteComponentTyped<VideoProps, VideoEvents, VideoSlots> {
|
|
40
40
|
}
|
|
41
41
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
2
|
import type { BuilderContextInterface } from "../../context/types.js";
|
|
3
3
|
import type { BuilderBlock } from "../../types/builder-block.js";
|
|
4
|
-
export
|
|
4
|
+
export type BlockStylesProps = {
|
|
5
5
|
block: BuilderBlock;
|
|
6
6
|
context: BuilderContextInterface;
|
|
7
7
|
};
|
|
@@ -15,9 +15,9 @@ declare const __propDef: {
|
|
|
15
15
|
};
|
|
16
16
|
slots: {};
|
|
17
17
|
};
|
|
18
|
-
export
|
|
19
|
-
export
|
|
20
|
-
export
|
|
18
|
+
export type BlockStylesProps = typeof __propDef.props;
|
|
19
|
+
export type BlockStylesEvents = typeof __propDef.events;
|
|
20
|
+
export type BlockStylesSlots = typeof __propDef.slots;
|
|
21
21
|
export default class BlockStyles extends SvelteComponentTyped<BlockStylesProps, BlockStylesEvents, BlockStylesSlots> {
|
|
22
22
|
}
|
|
23
23
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
2
|
import type { BuilderContextInterface } from "../../context/types.js";
|
|
3
3
|
import type { BuilderBlock } from "../../types/builder-block.js";
|
|
4
|
-
export
|
|
4
|
+
export type RenderBlockProps = {
|
|
5
5
|
block: BuilderBlock;
|
|
6
6
|
context: BuilderContextInterface;
|
|
7
7
|
};
|
|
@@ -15,9 +15,9 @@ declare const __propDef: {
|
|
|
15
15
|
};
|
|
16
16
|
slots: {};
|
|
17
17
|
};
|
|
18
|
-
export
|
|
19
|
-
export
|
|
20
|
-
export
|
|
18
|
+
export type RenderBlockProps = typeof __propDef.props;
|
|
19
|
+
export type RenderBlockEvents = typeof __propDef.events;
|
|
20
|
+
export type RenderBlockSlots = typeof __propDef.slots;
|
|
21
21
|
export default class RenderBlock extends SvelteComponentTyped<RenderBlockProps, RenderBlockEvents, RenderBlockSlots> {
|
|
22
22
|
}
|
|
23
23
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
2
|
import type { BuilderBlock } from "../../types/builder-block.js";
|
|
3
3
|
import type { BuilderContextInterface } from "../../context/types.js";
|
|
4
|
-
|
|
4
|
+
type ComponentOptions = {
|
|
5
5
|
[index: string]: any;
|
|
6
6
|
attributes?: {
|
|
7
7
|
[index: string]: any;
|
|
@@ -25,9 +25,9 @@ declare const __propDef: {
|
|
|
25
25
|
};
|
|
26
26
|
slots: {};
|
|
27
27
|
};
|
|
28
|
-
export
|
|
29
|
-
export
|
|
30
|
-
export
|
|
28
|
+
export type RenderComponentProps = typeof __propDef.props;
|
|
29
|
+
export type RenderComponentEvents = typeof __propDef.events;
|
|
30
|
+
export type RenderComponentSlots = typeof __propDef.slots;
|
|
31
31
|
export default class RenderComponent extends SvelteComponentTyped<RenderComponentProps, RenderComponentEvents, RenderComponentSlots> {
|
|
32
32
|
}
|
|
33
33
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
2
|
import type { BuilderContextInterface } from "../../context/types.js";
|
|
3
3
|
import type { BuilderBlock } from "../../types/builder-block";
|
|
4
|
-
|
|
4
|
+
type Props = {
|
|
5
5
|
block: BuilderBlock;
|
|
6
6
|
repeatContext: BuilderContextInterface;
|
|
7
7
|
};
|
|
@@ -15,9 +15,9 @@ declare const __propDef: {
|
|
|
15
15
|
};
|
|
16
16
|
slots: {};
|
|
17
17
|
};
|
|
18
|
-
export
|
|
19
|
-
export
|
|
20
|
-
export
|
|
18
|
+
export type RenderRepeatedBlockProps = typeof __propDef.props;
|
|
19
|
+
export type RenderRepeatedBlockEvents = typeof __propDef.events;
|
|
20
|
+
export type RenderRepeatedBlockSlots = typeof __propDef.slots;
|
|
21
21
|
export default class RenderRepeatedBlock extends SvelteComponentTyped<RenderRepeatedBlockProps, RenderRepeatedBlockEvents, RenderRepeatedBlockSlots> {
|
|
22
22
|
}
|
|
23
23
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
2
|
import type { BuilderBlock } from "../types/builder-block.js";
|
|
3
|
-
export
|
|
3
|
+
export type RenderBlockProps = {
|
|
4
4
|
blocks?: BuilderBlock[];
|
|
5
5
|
parent?: string;
|
|
6
6
|
path?: string;
|
|
@@ -18,9 +18,9 @@ declare const __propDef: {
|
|
|
18
18
|
};
|
|
19
19
|
slots: {};
|
|
20
20
|
};
|
|
21
|
-
export
|
|
22
|
-
export
|
|
23
|
-
export
|
|
21
|
+
export type RenderBlocksProps = typeof __propDef.props;
|
|
22
|
+
export type RenderBlocksEvents = typeof __propDef.events;
|
|
23
|
+
export type RenderBlocksSlots = typeof __propDef.slots;
|
|
24
24
|
export default class RenderBlocks extends SvelteComponentTyped<RenderBlocksProps, RenderBlocksEvents, RenderBlocksSlots> {
|
|
25
25
|
}
|
|
26
26
|
export {};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
2
|
declare const __propDef: {
|
|
3
|
-
props:
|
|
3
|
+
props: Record<string, never>;
|
|
4
4
|
events: {
|
|
5
5
|
[evt: string]: CustomEvent<any>;
|
|
6
6
|
};
|
|
7
7
|
slots: {};
|
|
8
8
|
};
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export
|
|
9
|
+
export type BuilderEditingProps = typeof __propDef.props;
|
|
10
|
+
export type BuilderEditingEvents = typeof __propDef.events;
|
|
11
|
+
export type BuilderEditingSlots = typeof __propDef.slots;
|
|
12
12
|
export default class BuilderEditing extends SvelteComponentTyped<BuilderEditingProps, BuilderEditingEvents, BuilderEditingSlots> {
|
|
13
13
|
}
|
|
14
14
|
export {};
|
|
@@ -14,6 +14,19 @@ ${getCss({
|
|
|
14
14
|
${getFontCss({
|
|
15
15
|
customFonts: customFonts,
|
|
16
16
|
})}
|
|
17
|
+
|
|
18
|
+
.builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
|
|
19
|
+
margin: 0;
|
|
20
|
+
}
|
|
21
|
+
.builder-text > p, .builder-text > .builder-paragraph {
|
|
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;
|
|
29
|
+
}
|
|
17
30
|
`;
|
|
18
31
|
</script>
|
|
19
32
|
|
|
@@ -16,9 +16,9 @@ declare const __propDef: {
|
|
|
16
16
|
};
|
|
17
17
|
slots: {};
|
|
18
18
|
};
|
|
19
|
-
export
|
|
20
|
-
export
|
|
21
|
-
export
|
|
19
|
+
export type RenderStylesProps = typeof __propDef.props;
|
|
20
|
+
export type RenderStylesEvents = typeof __propDef.events;
|
|
21
|
+
export type RenderStylesSlots = typeof __propDef.slots;
|
|
22
22
|
export default class RenderStyles extends SvelteComponentTyped<RenderStylesProps, RenderStylesEvents, RenderStylesSlots> {
|
|
23
23
|
}
|
|
24
24
|
export {};
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
<script>import { onDestroy, onMount, setContext } from "svelte";
|
|
4
4
|
import { getDefaultRegisteredComponents } from "../../constants/builder-registered-components.js";
|
|
5
|
-
import { TARGET } from "../../constants/target.js";
|
|
6
5
|
import { evaluate } from "../../functions/evaluate.js";
|
|
7
6
|
import { getContent } from "../../functions/get-content/index.js";
|
|
8
7
|
import { fetch } from "../../functions/get-fetch.js";
|
|
@@ -18,6 +17,7 @@ import { registerInsertMenu, setupBrowserForEditing, } from "../../scripts/init-
|
|
|
18
17
|
import { checkIsDefined } from "../../helpers/nullable.js";
|
|
19
18
|
import { getInteractionPropertiesForEvent } from "../../functions/track/interaction.js";
|
|
20
19
|
import { getContentInitialValue, getContextStateInitialValue, } from "./render-content.helpers.js";
|
|
20
|
+
import { TARGET } from "../../constants/target.js";
|
|
21
21
|
export let content;
|
|
22
22
|
export let data;
|
|
23
23
|
export let canTrack;
|
|
@@ -164,10 +164,6 @@ function emitStateUpdate() {
|
|
|
164
164
|
}));
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
|
-
$: shouldRenderContentStyles = () => {
|
|
168
|
-
return Boolean((useContent?.data?.cssCode || useContent?.data?.customFonts?.length) &&
|
|
169
|
-
TARGET !== "reactNative");
|
|
170
|
-
};
|
|
171
167
|
let elementRef;
|
|
172
168
|
let forceReRenderCount = 0;
|
|
173
169
|
let overrideContent = null;
|
|
@@ -316,7 +312,7 @@ onDestroy(() => {
|
|
|
316
312
|
builder-content-id={useContent?.id}
|
|
317
313
|
builder-model={model}
|
|
318
314
|
>
|
|
319
|
-
{#if
|
|
315
|
+
{#if TARGET !== "reactNative"}
|
|
320
316
|
<RenderContentStyles
|
|
321
317
|
contentId={useContent?.id}
|
|
322
318
|
cssCode={useContent?.data?.cssCode}
|
|
@@ -17,9 +17,9 @@ declare const __propDef: {
|
|
|
17
17
|
};
|
|
18
18
|
slots: {};
|
|
19
19
|
};
|
|
20
|
-
export
|
|
21
|
-
export
|
|
22
|
-
export
|
|
20
|
+
export type RenderContentProps = typeof __propDef.props;
|
|
21
|
+
export type RenderContentEvents = typeof __propDef.events;
|
|
22
|
+
export type RenderContentSlots = typeof __propDef.slots;
|
|
23
23
|
export default class RenderContent extends SvelteComponentTyped<RenderContentProps, RenderContentEvents, RenderContentSlots> {
|
|
24
24
|
}
|
|
25
25
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { BuilderRenderContext, RegisteredComponent, BuilderRenderState } from '../../context/types';
|
|
2
2
|
import type { BuilderContent } from '../../types/builder-content';
|
|
3
3
|
import type { Nullable } from '../../types/typescript';
|
|
4
|
-
export
|
|
4
|
+
export type RenderContentProps = {
|
|
5
5
|
content?: Nullable<BuilderContent>;
|
|
6
6
|
model?: string;
|
|
7
7
|
data?: {
|
|
@@ -11,9 +11,9 @@ declare const __propDef: {
|
|
|
11
11
|
};
|
|
12
12
|
slots: {};
|
|
13
13
|
};
|
|
14
|
-
export
|
|
15
|
-
export
|
|
16
|
-
export
|
|
14
|
+
export type RenderInlinedStylesProps = typeof __propDef.props;
|
|
15
|
+
export type RenderInlinedStylesEvents = typeof __propDef.events;
|
|
16
|
+
export type RenderInlinedStylesSlots = typeof __propDef.slots;
|
|
17
17
|
export default class RenderInlinedStyles extends SvelteComponentTyped<RenderInlinedStylesProps, RenderInlinedStylesEvents, RenderInlinedStylesSlots> {
|
|
18
18
|
}
|
|
19
19
|
export {};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { BuilderContent } from '../types/builder-content.js';
|
|
2
2
|
import type { ComponentInfo } from '../types/components.js';
|
|
3
3
|
import type { Dictionary, Nullable } from '../types/typescript.js';
|
|
4
|
-
export
|
|
4
|
+
export type RegisteredComponent = ComponentInfo & {
|
|
5
5
|
component: any;
|
|
6
6
|
};
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
7
|
+
export type RegisteredComponents = Dictionary<RegisteredComponent>;
|
|
8
|
+
export type BuilderRenderState = Record<string, unknown>;
|
|
9
|
+
export type BuilderRenderContext = Record<string, unknown>;
|
|
10
10
|
export interface BuilderContextInterface {
|
|
11
11
|
content: Nullable<BuilderContent>;
|
|
12
12
|
context: BuilderRenderContext;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { BuilderContextInterface } from '../context/types.js';
|
|
2
2
|
import type { BuilderBlock } from '../types/builder-block.js';
|
|
3
|
-
|
|
3
|
+
type Options = {
|
|
4
4
|
block: BuilderBlock;
|
|
5
5
|
} & Pick<BuilderContextInterface, 'state' | 'context'>;
|
|
6
|
-
|
|
6
|
+
type EventHandler = (event: Event) => any;
|
|
7
7
|
export declare const createEventHandler: (value: string, options: Options) => EventHandler;
|
|
8
8
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { BuilderContextInterface } from '../context/types.js';
|
|
2
2
|
import type { BuilderBlock } from '../types/builder-block.js';
|
|
3
|
-
|
|
3
|
+
type Actions = {
|
|
4
4
|
[index: string]: (event: Event) => any;
|
|
5
5
|
};
|
|
6
6
|
export declare function getBlockActions(options: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
type QueryObject = Record<string, string | string[]>;
|
|
2
2
|
export declare const convertSearchParamsToQueryObject: (searchParams: URLSearchParams) => QueryObject;
|
|
3
3
|
export declare const getBuilderSearchParams: (_options: QueryObject | URLSearchParams | undefined) => QueryObject;
|
|
4
4
|
export declare const getBuilderSearchParamsFromWindow: () => QueryObject;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
+
import { TARGET } from '../constants/target.js';
|
|
1
2
|
import { isIframe } from './is-iframe.js';
|
|
2
3
|
export function isEditing() {
|
|
3
|
-
return (isIframe() &&
|
|
4
|
+
return (isIframe() &&
|
|
5
|
+
(TARGET === 'reactNative' ||
|
|
6
|
+
window.location.search.indexOf('builder.frameEditing=') !== -1));
|
|
4
7
|
}
|
|
@@ -35,7 +35,7 @@ interface Event {
|
|
|
35
35
|
[index: string]: any;
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
|
-
|
|
38
|
+
type EventProperties = Pick<Event, 'type'> & Pick<Event['data'], 'contentId' | 'variationId' | 'metadata'> & {
|
|
39
39
|
/**
|
|
40
40
|
* Your organization's API key.
|
|
41
41
|
*/
|
|
@@ -45,7 +45,7 @@ declare type EventProperties = Pick<Event, 'type'> & Pick<Event['data'], 'conten
|
|
|
45
45
|
*/
|
|
46
46
|
[index: string]: any;
|
|
47
47
|
};
|
|
48
|
-
export
|
|
48
|
+
export type EventProps = EventProperties & CanTrack;
|
|
49
49
|
export declare function _track(eventProps: EventProps): Promise<void | Response>;
|
|
50
50
|
export declare const track: (args: EventProperties) => Promise<void | Response>;
|
|
51
51
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type Nullable<T> = T | null | undefined;
|
|
2
2
|
export declare const checkIsDefined: <T>(maybeT: Nullable<T>) => maybeT is T;
|
package/package/index.d.ts
CHANGED
package/package/index.js
CHANGED
|
@@ -172,5 +172,5 @@ export interface ComponentInfo {
|
|
|
172
172
|
requiredPermissions?: Array<Permission>;
|
|
173
173
|
hidden?: boolean;
|
|
174
174
|
}
|
|
175
|
-
|
|
175
|
+
type Permission = 'read' | 'publish' | 'editCode' | 'editDesigns' | 'admin' | 'create';
|
|
176
176
|
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
1
|
+
type MitosisTargets = import('@builder.io/mitosis').Target;
|
|
2
|
+
export type Target = Extract<MitosisTargets, 'vue3' | 'vue2' | 'reactNative' | 'svelte' | 'qwik' | 'react' | 'solid'>;
|
|
3
3
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export type Nullable<T> = T | null | undefined;
|
|
2
|
+
export type Dictionary<T> = {
|
|
3
3
|
[key: string]: T;
|
|
4
4
|
};
|
|
5
|
-
export
|
|
5
|
+
export type Overwrite<T, U> = keyof U extends keyof T ? Pick<T, Exclude<keyof T, keyof U>> & U : never;
|
package/package.json
CHANGED
|
@@ -22,7 +22,7 @@ export const componentInfo: ComponentInfo = {
|
|
|
22
22
|
allowedFileTypes: ['jpeg', 'jpg', 'png', 'svg'],
|
|
23
23
|
required: true,
|
|
24
24
|
defaultValue:
|
|
25
|
-
'https://cdn.builder.io/api/v1/image/assets%
|
|
25
|
+
'https://cdn.builder.io/api/v1/image/assets%2FYJIGb4i01jvw0SRdL5Bt%2F72c80f114dc149019051b6852a9e3b7a',
|
|
26
26
|
onChange: serializeFn(
|
|
27
27
|
(options: Map<string, any>): void | Promise<void> => {
|
|
28
28
|
const DEFAULT_ASPECT_RATIO = 0.7041;
|
|
@@ -55,9 +55,9 @@
|
|
|
55
55
|
use:mitosis_styling={{
|
|
56
56
|
width: "100%",
|
|
57
57
|
alignSelf: "stretch",
|
|
58
|
-
flexGrow:
|
|
58
|
+
flexGrow: 1,
|
|
59
59
|
boxSizing: "border-box",
|
|
60
|
-
maxWidth:
|
|
60
|
+
maxWidth: maxWidth || 1200,
|
|
61
61
|
display: "flex",
|
|
62
62
|
flexDirection: "column",
|
|
63
63
|
alignItems: "stretch",
|
|
@@ -6,6 +6,21 @@
|
|
|
6
6
|
|
|
7
7
|
<script lang="ts">
|
|
8
8
|
export let text: TextProps["text"];
|
|
9
|
+
|
|
10
|
+
function mitosis_styling(node, vars) {
|
|
11
|
+
Object.entries(vars || {}).forEach(([p, v]) => {
|
|
12
|
+
if (p.startsWith("--")) {
|
|
13
|
+
node.style.setProperty(p, v);
|
|
14
|
+
} else {
|
|
15
|
+
node.style[p] = v;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
}
|
|
9
19
|
</script>
|
|
10
20
|
|
|
11
|
-
<span
|
|
21
|
+
<span
|
|
22
|
+
use:mitosis_styling={{
|
|
23
|
+
outline: "none",
|
|
24
|
+
}}
|
|
25
|
+
class="builder-text">{@html text}</span
|
|
26
|
+
>
|
|
@@ -25,6 +25,19 @@ ${getCss({
|
|
|
25
25
|
${getFontCss({
|
|
26
26
|
customFonts: customFonts,
|
|
27
27
|
})}
|
|
28
|
+
|
|
29
|
+
.builder-text > p:first-of-type, .builder-text > .builder-paragraph:first-of-type {
|
|
30
|
+
margin: 0;
|
|
31
|
+
}
|
|
32
|
+
.builder-text > p, .builder-text > .builder-paragraph {
|
|
33
|
+
color: inherit;
|
|
34
|
+
line-height: inherit;
|
|
35
|
+
letter-spacing: inherit;
|
|
36
|
+
font-weight: inherit;
|
|
37
|
+
font-size: inherit;
|
|
38
|
+
text-align: inherit;
|
|
39
|
+
font-family: inherit;
|
|
40
|
+
}
|
|
28
41
|
`;
|
|
29
42
|
</script>
|
|
30
43
|
|
|
@@ -22,7 +22,6 @@
|
|
|
22
22
|
import { onDestroy, onMount, setContext } from "svelte";
|
|
23
23
|
|
|
24
24
|
import { getDefaultRegisteredComponents } from "../../constants/builder-registered-components.js";
|
|
25
|
-
import { TARGET } from "../../constants/target.js";
|
|
26
25
|
import { evaluate } from "../../functions/evaluate.js";
|
|
27
26
|
import { getContent } from "../../functions/get-content/index.js";
|
|
28
27
|
import { fetch } from "../../functions/get-fetch.js";
|
|
@@ -47,6 +46,7 @@
|
|
|
47
46
|
getContentInitialValue,
|
|
48
47
|
getContextStateInitialValue,
|
|
49
48
|
} from "./render-content.helpers.js";
|
|
49
|
+
import { TARGET } from "../../constants/target.js";
|
|
50
50
|
|
|
51
51
|
export let content: RenderContentProps["content"];
|
|
52
52
|
export let data: RenderContentProps["data"];
|
|
@@ -202,12 +202,6 @@
|
|
|
202
202
|
);
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
|
-
$: shouldRenderContentStyles = () => {
|
|
206
|
-
return Boolean(
|
|
207
|
-
(useContent?.data?.cssCode || useContent?.data?.customFonts?.length) &&
|
|
208
|
-
TARGET !== "reactNative"
|
|
209
|
-
);
|
|
210
|
-
};
|
|
211
205
|
|
|
212
206
|
let elementRef;
|
|
213
207
|
|
|
@@ -378,7 +372,7 @@
|
|
|
378
372
|
builder-content-id={useContent?.id}
|
|
379
373
|
builder-model={model}
|
|
380
374
|
>
|
|
381
|
-
{#if
|
|
375
|
+
{#if TARGET !== "reactNative"}
|
|
382
376
|
<RenderContentStyles
|
|
383
377
|
contentId={useContent?.id}
|
|
384
378
|
cssCode={useContent?.data?.cssCode}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import { TARGET } from '../constants/target.js';
|
|
1
2
|
import { isIframe } from './is-iframe.js';
|
|
2
3
|
|
|
3
4
|
export function isEditing(): boolean {
|
|
4
5
|
return (
|
|
5
|
-
isIframe() &&
|
|
6
|
+
isIframe() &&
|
|
7
|
+
(TARGET === 'reactNative' ||
|
|
8
|
+
window.location.search.indexOf('builder.frameEditing=') !== -1)
|
|
6
9
|
);
|
|
7
10
|
}
|