@builder.io/sdk-svelte 0.1.9 → 0.1.11

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.
Files changed (63) hide show
  1. package/package/--package.json +1 -1
  2. package/package/CHANGELOG.md +4 -0
  3. package/package/blocks/BaseText.svelte.d.ts +3 -3
  4. package/package/blocks/button/button.svelte.d.ts +3 -3
  5. package/package/blocks/columns/columns.svelte.d.ts +5 -5
  6. package/package/blocks/custom-code/custom-code.svelte.d.ts +3 -3
  7. package/package/blocks/embed/embed.svelte.d.ts +3 -3
  8. package/package/blocks/form/form.svelte.d.ts +4 -4
  9. package/package/blocks/fragment/fragment.svelte.d.ts +4 -4
  10. package/package/blocks/image/component-info.js +1 -1
  11. package/package/blocks/image/image.svelte.d.ts +3 -3
  12. package/package/blocks/img/img.svelte.d.ts +3 -3
  13. package/package/blocks/input/input.svelte.d.ts +3 -3
  14. package/package/blocks/raw-text/raw-text.svelte.d.ts +3 -3
  15. package/package/blocks/section/section.svelte.d.ts +3 -3
  16. package/package/blocks/select/select.svelte.d.ts +3 -3
  17. package/package/blocks/submit-button/submit-button.svelte.d.ts +3 -3
  18. package/package/blocks/symbol/symbol.svelte.d.ts +3 -3
  19. package/package/blocks/text/text.svelte +16 -1
  20. package/package/blocks/text/text.svelte.d.ts +3 -3
  21. package/package/blocks/textarea/textarea.svelte.d.ts +3 -3
  22. package/package/blocks/video/video.svelte.d.ts +3 -3
  23. package/package/components/render-block/block-styles.svelte.d.ts +4 -4
  24. package/package/components/render-block/render-block.svelte.d.ts +4 -4
  25. package/package/components/render-block/render-component.svelte.d.ts +4 -4
  26. package/package/components/render-block/render-repeated-block.svelte.d.ts +4 -4
  27. package/package/components/render-blocks.svelte.d.ts +4 -4
  28. package/package/components/render-content/builder-editing.svelte.d.ts +4 -4
  29. package/package/components/render-content/components/render-styles.svelte +13 -0
  30. package/package/components/render-content/components/render-styles.svelte.d.ts +3 -3
  31. package/package/components/render-content/render-content.svelte +2 -6
  32. package/package/components/render-content/render-content.svelte.d.ts +3 -3
  33. package/package/components/render-content/render-content.types.d.ts +1 -1
  34. package/package/components/render-inlined-styles.svelte.d.ts +3 -3
  35. package/package/constants/device-sizes.d.ts +1 -1
  36. package/package/context/types.d.ts +4 -4
  37. package/package/functions/get-block-actions-handler.d.ts +2 -2
  38. package/package/functions/get-block-actions.d.ts +1 -1
  39. package/package/functions/get-block-tag.d.ts +1 -1
  40. package/package/functions/get-builder-search-params/index.d.ts +1 -1
  41. package/package/functions/if-target.d.ts +1 -1
  42. package/package/functions/is-editing.js +4 -1
  43. package/package/functions/sanitize-react-native-block-styles.d.ts +1 -1
  44. package/package/functions/set-editor-settings.d.ts +1 -1
  45. package/package/functions/track/index.d.ts +2 -2
  46. package/package/functions/track/interaction.d.ts +1 -1
  47. package/package/helpers/nullable.d.ts +1 -1
  48. package/package/index.d.ts +0 -1
  49. package/package/index.js +0 -1
  50. package/package/types/builder-block.d.ts +1 -1
  51. package/package/types/can-track.d.ts +1 -1
  52. package/package/types/components.d.ts +1 -1
  53. package/package/types/deep-partial.d.ts +1 -1
  54. package/package/types/element.d.ts +1 -1
  55. package/package/types/targets.d.ts +2 -2
  56. package/package/types/typescript.d.ts +3 -3
  57. package/package.json +1 -1
  58. package/src/blocks/image/component-info.ts +1 -1
  59. package/src/blocks/text/text.svelte +16 -1
  60. package/src/components/render-content/components/render-styles.svelte +13 -0
  61. package/src/components/render-content/render-content.svelte +2 -8
  62. package/src/functions/is-editing.ts +4 -1
  63. package/src/index.ts +0 -1
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@builder.io/sdk-svelte",
3
3
  "description": "Builder.io SDK for Svelte",
4
- "version": "0.1.8",
4
+ "version": "0.1.10",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "package",
@@ -1,3 +1,7 @@
1
+ ### 0.1.10
2
+
3
+ - Fix: Text blocks styles (remove initial top padding)
4
+
1
5
  ### 0.1.9
2
6
 
3
7
  - No changes.
@@ -11,9 +11,9 @@ declare const __propDef: {
11
11
  };
12
12
  slots: {};
13
13
  };
14
- export declare type BaseTextProps = typeof __propDef.props;
15
- export declare type BaseTextEvents = typeof __propDef.events;
16
- export declare type BaseTextSlots = typeof __propDef.slots;
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 declare type ButtonProps = typeof __propDef.props;
21
- export declare type ButtonEvents = typeof __propDef.events;
22
- export declare type ButtonSlots = typeof __propDef.slots;
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
- declare type Column = {
3
+ type Column = {
4
4
  blocks: any;
5
5
  width?: number;
6
6
  };
7
- declare type StackColumnsAt = "tablet" | "mobile" | "never";
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 declare type ColumnsProps = typeof __propDef.props;
29
- export declare type ColumnsEvents = typeof __propDef.events;
30
- export declare type ColumnsSlots = typeof __propDef.slots;
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 declare type CustomCodeProps = typeof __propDef.props;
17
- export declare type CustomCodeEvents = typeof __propDef.events;
18
- export declare type CustomCodeSlots = typeof __propDef.slots;
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 declare type EmbedProps = typeof __propDef.props;
15
- export declare type EmbedEvents = typeof __propDef.events;
16
- export declare type EmbedSlots = typeof __propDef.slots;
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 declare type FormState = "unsubmitted" | "sending" | "success" | "error";
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 declare type FormProps = typeof __propDef.props;
66
- export declare type FormEvents = typeof __propDef.events;
67
- export declare type FormSlots = typeof __propDef.slots;
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 declare type FragmentProps = typeof __propDef.props;
17
- export declare type FragmentEvents = typeof __propDef.events;
18
- export declare type FragmentSlots = typeof __propDef.slots;
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%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d',
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 declare type ImageProps = typeof __propDef.props;
45
- export declare type ImageEvents = typeof __propDef.events;
46
- export declare type ImageSlots = typeof __propDef.slots;
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 declare type ImgProps = typeof __propDef.props;
25
- export declare type ImgEvents = typeof __propDef.events;
26
- export declare type ImgSlots = typeof __propDef.slots;
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 declare type InputProps = typeof __propDef.props;
27
- export declare type InputEvents = typeof __propDef.events;
28
- export declare type InputSlots = typeof __propDef.slots;
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 declare type RawTextProps = typeof __propDef.props;
17
- export declare type RawTextEvents = typeof __propDef.events;
18
- export declare type RawTextSlots = typeof __propDef.slots;
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 {};
@@ -17,9 +17,9 @@ declare const __propDef: {
17
17
  default: {};
18
18
  };
19
19
  };
20
- export declare type SectionProps = typeof __propDef.props;
21
- export declare type SectionEvents = typeof __propDef.events;
22
- export declare type SectionSlots = typeof __propDef.slots;
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 declare type SelectProps = typeof __propDef.props;
26
- export declare type SelectEvents = typeof __propDef.events;
27
- export declare type SelectSlots = typeof __propDef.slots;
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 declare type SubmitButtonProps = typeof __propDef.props;
17
- export declare type SubmitButtonEvents = typeof __propDef.events;
18
- export declare type SubmitButtonSlots = typeof __propDef.slots;
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 declare type SymbolProps = typeof __propDef.props;
32
- export declare type SymbolEvents = typeof __propDef.events;
33
- export declare type SymbolSlots = typeof __propDef.slots;
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 class="builder-text">{@html text}</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 declare type TextProps = typeof __propDef.props;
15
- export declare type TextEvents = typeof __propDef.events;
16
- export declare type TextSlots = typeof __propDef.slots;
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 declare type TextareaProps = typeof __propDef.props;
23
- export declare type TextareaEvents = typeof __propDef.events;
24
- export declare type TextareaSlots = typeof __propDef.slots;
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 declare type VideoProps = typeof __propDef.props;
37
- export declare type VideoEvents = typeof __propDef.events;
38
- export declare type VideoSlots = typeof __propDef.slots;
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 declare type BlockStylesProps = {
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 declare type BlockStylesProps = typeof __propDef.props;
19
- export declare type BlockStylesEvents = typeof __propDef.events;
20
- export declare type BlockStylesSlots = typeof __propDef.slots;
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 declare type RenderBlockProps = {
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 declare type RenderBlockProps = typeof __propDef.props;
19
- export declare type RenderBlockEvents = typeof __propDef.events;
20
- export declare type RenderBlockSlots = typeof __propDef.slots;
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
- declare type ComponentOptions = {
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 declare type RenderComponentProps = typeof __propDef.props;
29
- export declare type RenderComponentEvents = typeof __propDef.events;
30
- export declare type RenderComponentSlots = typeof __propDef.slots;
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
- declare type Props = {
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 declare type RenderRepeatedBlockProps = typeof __propDef.props;
19
- export declare type RenderRepeatedBlockEvents = typeof __propDef.events;
20
- export declare type RenderRepeatedBlockSlots = typeof __propDef.slots;
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 declare type RenderBlockProps = {
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 declare type RenderBlocksProps = typeof __propDef.props;
22
- export declare type RenderBlocksEvents = typeof __propDef.events;
23
- export declare type RenderBlocksSlots = typeof __propDef.slots;
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 declare type BuilderEditingProps = typeof __propDef.props;
10
- export declare type BuilderEditingEvents = typeof __propDef.events;
11
- export declare type BuilderEditingSlots = typeof __propDef.slots;
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 declare type RenderStylesProps = typeof __propDef.props;
20
- export declare type RenderStylesEvents = typeof __propDef.events;
21
- export declare type RenderStylesSlots = typeof __propDef.slots;
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 shouldRenderContentStyles()}
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 declare type RenderContentProps = typeof __propDef.props;
21
- export declare type RenderContentEvents = typeof __propDef.events;
22
- export declare type RenderContentSlots = typeof __propDef.slots;
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 declare type RenderContentProps = {
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 declare type RenderInlinedStylesProps = typeof __propDef.props;
15
- export declare type RenderInlinedStylesEvents = typeof __propDef.events;
16
- export declare type RenderInlinedStylesSlots = typeof __propDef.slots;
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,4 +1,4 @@
1
- export declare type SizeName = 'large' | 'medium' | 'small';
1
+ export type SizeName = 'large' | 'medium' | 'small';
2
2
  interface Size {
3
3
  min: number;
4
4
  default: number;
@@ -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 declare type RegisteredComponent = ComponentInfo & {
4
+ export type RegisteredComponent = ComponentInfo & {
5
5
  component: any;
6
6
  };
7
- export declare type RegisteredComponents = Dictionary<RegisteredComponent>;
8
- export declare type BuilderRenderState = Record<string, unknown>;
9
- export declare type BuilderRenderContext = Record<string, unknown>;
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
- declare type Options = {
3
+ type Options = {
4
4
  block: BuilderBlock;
5
5
  } & Pick<BuilderContextInterface, 'state' | 'context'>;
6
- declare type EventHandler = (event: Event) => any;
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
- declare type Actions = {
3
+ type Actions = {
4
4
  [index: string]: (event: Event) => any;
5
5
  };
6
6
  export declare function getBlockActions(options: {
@@ -1,3 +1,3 @@
1
1
  import type { BuilderBlock } from '../types/builder-block.js';
2
- export declare type TagName = string;
2
+ export type TagName = string;
3
3
  export declare function getBlockTag(block: BuilderBlock): TagName;
@@ -1,4 +1,4 @@
1
- declare type QueryObject = Record<string, string | string[]>;
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,4 @@
1
- declare type Target = import('../types/targets').Target;
1
+ type Target = import('../types/targets').Target;
2
2
  export declare function ifTarget<A, B>({ targets, doThing, elseThing, }: {
3
3
  targets: Target[];
4
4
  doThing: () => A;
@@ -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() && window.location.search.indexOf('builder.frameEditing=') !== -1);
4
+ return (isIframe() &&
5
+ (TARGET === 'reactNative' ||
6
+ window.location.search.indexOf('builder.frameEditing=') !== -1));
4
7
  }
@@ -1,3 +1,3 @@
1
- declare type Styles = Record<string, string | number>;
1
+ type Styles = Record<string, string | number>;
2
2
  export declare const sanitizeReactNativeBlockStyles: (styles: Styles) => Styles;
3
3
  export {};
@@ -1,4 +1,4 @@
1
- export declare type Settings = {
1
+ export type Settings = {
2
2
  customInsertMenu?: boolean;
3
3
  };
4
4
  export declare function setEditorSettings(newSettings: Settings): void;
@@ -35,7 +35,7 @@ interface Event {
35
35
  [index: string]: any;
36
36
  };
37
37
  }
38
- declare type EventProperties = Pick<Event, 'type'> & Pick<Event['data'], 'contentId' | 'variationId' | 'metadata'> & {
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 declare type EventProps = EventProperties & CanTrack;
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,4 +1,4 @@
1
- declare type Offset = {
1
+ type Offset = {
2
2
  x: number;
3
3
  y: number;
4
4
  };
@@ -1,2 +1,2 @@
1
- export declare type Nullable<T> = T | null | undefined;
1
+ export type Nullable<T> = T | null | undefined;
2
2
  export declare const checkIsDefined: <T>(maybeT: Nullable<T>) => maybeT is T;
@@ -1,5 +1,4 @@
1
1
  export * from './index-helpers/top-of-file.js';
2
- import './scripts/init-editing.js';
3
2
  export * from './index-helpers/blocks-exports.js';
4
3
  export * from './functions/is-editing.js';
5
4
  export * from './functions/is-previewing.js';
package/package/index.js CHANGED
@@ -1,5 +1,4 @@
1
1
  export * from './index-helpers/top-of-file.js';
2
- import './scripts/init-editing.js';
3
2
  export * from './index-helpers/blocks-exports.js';
4
3
  export * from './functions/is-editing.js';
5
4
  export * from './functions/is-previewing.js';
@@ -1,4 +1,4 @@
1
- declare type JSONValue = string | number | boolean | JSONObject | JSONArray;
1
+ type JSONValue = string | number | boolean | JSONObject | JSONArray;
2
2
  interface JSONObject {
3
3
  [x: string]: JSONValue;
4
4
  }
@@ -1,3 +1,3 @@
1
- export declare type CanTrack = {
1
+ export type CanTrack = {
2
2
  canTrack: boolean;
3
3
  };
@@ -172,5 +172,5 @@ export interface ComponentInfo {
172
172
  requiredPermissions?: Array<Permission>;
173
173
  hidden?: boolean;
174
174
  }
175
- declare type Permission = 'read' | 'publish' | 'editCode' | 'editDesigns' | 'admin' | 'create';
175
+ type Permission = 'read' | 'publish' | 'editCode' | 'editDesigns' | 'admin' | 'create';
176
176
  export {};
@@ -1,3 +1,3 @@
1
- export declare type DeepPartial<T> = {
1
+ export type DeepPartial<T> = {
2
2
  [P in keyof T]?: T[P] extends Array<infer U> ? Array<DeepPartial<U>> : T[P] extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : DeepPartial<T[P]>;
3
3
  };
@@ -1,4 +1,4 @@
1
- declare type JSONValue = string | number | boolean | JSONObject | JSONArray;
1
+ type JSONValue = string | number | boolean | JSONObject | JSONArray;
2
2
  interface JSONObject {
3
3
  [x: string]: JSONValue;
4
4
  }
@@ -1,3 +1,3 @@
1
- declare type MitosisTargets = import('@builder.io/mitosis').Target;
2
- export declare type Target = Extract<MitosisTargets, 'vue3' | 'vue2' | 'reactNative' | 'svelte' | 'qwik' | 'react' | 'solid'>;
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 declare type Nullable<T> = T | null | undefined;
2
- export declare type Dictionary<T> = {
1
+ export type Nullable<T> = T | null | undefined;
2
+ export type Dictionary<T> = {
3
3
  [key: string]: T;
4
4
  };
5
- export declare type Overwrite<T, U> = keyof U extends keyof T ? Pick<T, Exclude<keyof T, keyof U>> & U : never;
5
+ export type Overwrite<T, U> = keyof U extends keyof T ? Pick<T, Exclude<keyof T, keyof U>> & U : never;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@builder.io/sdk-svelte",
3
3
  "description": "Builder.io SDK for Svelte",
4
- "version": "0.1.9",
4
+ "version": "0.1.11",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "package",
@@ -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%2Fpwgjf0RoYWbdnJSbpBAjXNRMe9F2%2Ffb27a7c790324294af8be1c35fe30f4d',
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;
@@ -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 class="builder-text">{@html text}</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 shouldRenderContentStyles()}
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() && window.location.search.indexOf('builder.frameEditing=') !== -1
6
+ isIframe() &&
7
+ (TARGET === 'reactNative' ||
8
+ window.location.search.indexOf('builder.frameEditing=') !== -1)
6
9
  );
7
10
  }
package/src/index.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  export * from './index-helpers/top-of-file.js';
2
- import './scripts/init-editing.js';
3
2
 
4
3
  export * from './index-helpers/blocks-exports.js';
5
4