@builder.io/sdk-vue 0.2.2 → 0.3.1

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 (122) hide show
  1. package/package.json +2 -5
  2. package/packages/_vue2/dist/block-styles.ae2c8895.cjs +1 -0
  3. package/packages/_vue2/dist/block-styles.b09f50da.js +75 -0
  4. package/packages/_vue2/dist/css.e6670a83.cjs +6 -0
  5. package/packages/_vue2/dist/css.fb10bcf8.js +74 -0
  6. package/packages/_vue2/dist/{index.eb91dc82.js → index.36f3710d.js} +432 -402
  7. package/packages/_vue2/dist/index.ae3f58f8.cjs +29 -0
  8. package/packages/_vue2/dist/render-block.74bc834e.cjs +3 -0
  9. package/packages/_vue2/dist/{render-block.6f9a607a.js → render-block.c14ab4be.js} +96 -90
  10. package/packages/_vue2/dist/render-component.2b74ef23.cjs +1 -0
  11. package/packages/_vue2/dist/render-component.d7f78e3d.js +38 -0
  12. package/packages/_vue2/dist/render-inlined-styles.04d09a3c.js +34 -0
  13. package/packages/_vue2/dist/render-inlined-styles.c8d80bc4.cjs +1 -0
  14. package/packages/_vue2/dist/render-repeated-block.58333f68.cjs +1 -0
  15. package/packages/_vue2/dist/render-repeated-block.a8717618.js +45 -0
  16. package/packages/_vue2/dist/render-styles.4a1edc25.cjs +31 -0
  17. package/packages/_vue2/dist/{render-styles.0d1f8872.js → render-styles.a49c2339.js} +26 -25
  18. package/packages/_vue2/dist/sdk.cjs +1 -1
  19. package/packages/_vue2/dist/sdk.js +23 -22
  20. package/packages/_vue2/dist/src/blocks/button/button.vue.d.ts +19 -8
  21. package/packages/_vue2/dist/src/blocks/columns/columns.vue.d.ts +29 -174
  22. package/packages/_vue2/dist/src/blocks/custom-code/custom-code.vue.d.ts +9 -13
  23. package/packages/_vue2/dist/src/blocks/embed/embed.vue.d.ts +13 -20
  24. package/packages/_vue2/dist/src/blocks/fragment/fragment.vue.d.ts +1 -4
  25. package/packages/_vue2/dist/src/blocks/image/image.vue.d.ts +72 -0
  26. package/packages/_vue2/dist/src/blocks/img/img.vue.d.ts +8 -11
  27. package/packages/_vue2/dist/src/blocks/section/section.vue.d.ts +12 -7
  28. package/packages/_vue2/dist/src/blocks/symbol/symbol.vue.d.ts +15 -245
  29. package/packages/_vue2/dist/src/blocks/text/text.vue.d.ts +7 -4
  30. package/packages/_vue2/dist/src/blocks/video/video.vue.d.ts +42 -7
  31. package/packages/_vue2/dist/src/components/render-block/block-styles.vue.d.ts +18 -27
  32. package/packages/_vue2/dist/src/components/render-block/render-block.helpers.d.ts +0 -1
  33. package/packages/_vue2/dist/src/components/render-block/render-block.vue.d.ts +3 -86
  34. package/packages/_vue2/dist/src/components/render-block/render-component.vue.d.ts +3 -86
  35. package/packages/_vue2/dist/src/components/render-block/render-repeated-block.vue.d.ts +19 -84
  36. package/packages/_vue2/dist/src/components/render-blocks.vue.d.ts +23 -127
  37. package/packages/_vue2/dist/src/components/render-content/components/render-styles.vue.d.ts +15 -18
  38. package/packages/_vue2/dist/src/components/render-content/render-content.vue.d.ts +46 -212
  39. package/packages/_vue2/dist/src/components/render-inlined-styles.vue.d.ts +12 -11
  40. package/packages/_vue2/dist/src/constants/sdk-version.d.ts +1 -0
  41. package/packages/_vue2/dist/src/context/builder.context.d.ts +3 -2
  42. package/packages/_vue2/dist/src/context/types.d.ts +17 -2
  43. package/packages/_vue2/dist/src/functions/evaluate.d.ts +4 -3
  44. package/packages/_vue2/dist/src/functions/get-block-actions-handler.d.ts +1 -1
  45. package/packages/_vue2/dist/src/functions/get-block-actions.d.ts +1 -1
  46. package/packages/_vue2/dist/src/functions/get-processed-block.d.ts +2 -2
  47. package/packages/_vue2/dist/src/index.d.ts +1 -0
  48. package/packages/_vue2/dist/style.css +1 -1
  49. package/packages/_vue3/dist/block-styles.a1577ff9.cjs +1 -0
  50. package/packages/_vue3/dist/block-styles.ae0db517.js +71 -0
  51. package/packages/_vue3/dist/css.c52c28f5.js +74 -0
  52. package/packages/_vue3/dist/css.eaf664fa.cjs +6 -0
  53. package/packages/_vue3/dist/index.8ed3c046.cjs +29 -0
  54. package/packages/_vue3/dist/{index.45ab85e5.js → index.d8d44f06.js} +835 -806
  55. package/packages/_vue3/dist/render-block.8f200c30.cjs +3 -0
  56. package/packages/_vue3/dist/render-block.c70eab34.js +285 -0
  57. package/packages/_vue3/dist/render-component.023d5d67.cjs +1 -0
  58. package/packages/_vue3/dist/render-component.9b027ad2.js +42 -0
  59. package/packages/_vue3/dist/render-inlined-styles.0b6cafc4.js +32 -0
  60. package/packages/_vue3/dist/render-inlined-styles.e3ea32fb.cjs +1 -0
  61. package/packages/_vue3/dist/render-repeated-block.1743f160.cjs +1 -0
  62. package/packages/_vue3/dist/render-repeated-block.1b229997.js +39 -0
  63. package/packages/_vue3/dist/render-styles.70e1b259.cjs +31 -0
  64. package/packages/_vue3/dist/{render-styles.cf6faa29.js → render-styles.f8cb298d.js} +33 -33
  65. package/packages/_vue3/dist/sdk.cjs +1 -1
  66. package/packages/_vue3/dist/sdk.js +1 -1
  67. package/packages/_vue3/dist/src/blocks/button/button.vue.d.ts +19 -8
  68. package/packages/_vue3/dist/src/blocks/columns/columns.vue.d.ts +45 -91
  69. package/packages/_vue3/dist/src/blocks/custom-code/custom-code.vue.d.ts +16 -13
  70. package/packages/_vue3/dist/src/blocks/embed/embed.vue.d.ts +17 -20
  71. package/packages/_vue3/dist/src/blocks/fragment/fragment.vue.d.ts +1 -4
  72. package/packages/_vue3/dist/src/blocks/image/image.vue.d.ts +54 -14
  73. package/packages/_vue3/dist/src/blocks/img/img.vue.d.ts +27 -11
  74. package/packages/_vue3/dist/src/blocks/section/section.vue.d.ts +12 -7
  75. package/packages/_vue3/dist/src/blocks/symbol/symbol.vue.d.ts +25 -162
  76. package/packages/_vue3/dist/src/blocks/text/text.vue.d.ts +7 -4
  77. package/packages/_vue3/dist/src/blocks/video/video.vue.d.ts +42 -7
  78. package/packages/_vue3/dist/src/components/render-block/block-styles.vue.d.ts +18 -27
  79. package/packages/_vue3/dist/src/components/render-block/render-block.helpers.d.ts +0 -1
  80. package/packages/_vue3/dist/src/components/render-block/render-block.vue.d.ts +2 -2
  81. package/packages/_vue3/dist/src/components/render-block/render-component.vue.d.ts +2 -2
  82. package/packages/_vue3/dist/src/components/render-block/render-repeated-block.vue.d.ts +19 -8
  83. package/packages/_vue3/dist/src/components/render-blocks.vue.d.ts +23 -44
  84. package/packages/_vue3/dist/src/components/render-content/components/render-styles.vue.d.ts +15 -18
  85. package/packages/_vue3/dist/src/components/render-content/render-content.vue.d.ts +77 -129
  86. package/packages/_vue3/dist/src/components/render-inlined-styles.vue.d.ts +12 -11
  87. package/packages/_vue3/dist/src/constants/sdk-version.d.ts +1 -0
  88. package/packages/_vue3/dist/src/context/builder.context.d.ts +3 -2
  89. package/packages/_vue3/dist/src/context/types.d.ts +17 -2
  90. package/packages/_vue3/dist/src/functions/evaluate.d.ts +4 -3
  91. package/packages/_vue3/dist/src/functions/get-block-actions-handler.d.ts +1 -1
  92. package/packages/_vue3/dist/src/functions/get-block-actions.d.ts +1 -1
  93. package/packages/_vue3/dist/src/functions/get-processed-block.d.ts +2 -2
  94. package/packages/_vue3/dist/src/index.d.ts +1 -0
  95. package/packages/_vue3/dist/style.css +1 -1
  96. package/packages/_vue2/dist/block-styles.4667431d.js +0 -72
  97. package/packages/_vue2/dist/block-styles.7c2a87df.cjs +0 -1
  98. package/packages/_vue2/dist/css.468435de.js +0 -58
  99. package/packages/_vue2/dist/css.dce6e4eb.cjs +0 -6
  100. package/packages/_vue2/dist/index.78ba6586.cjs +0 -29
  101. package/packages/_vue2/dist/render-block.67e4dd65.cjs +0 -3
  102. package/packages/_vue2/dist/render-component.10d6c8d2.js +0 -37
  103. package/packages/_vue2/dist/render-component.3578089b.cjs +0 -1
  104. package/packages/_vue2/dist/render-inlined-styles.56373d13.cjs +0 -1
  105. package/packages/_vue2/dist/render-inlined-styles.942eb38d.js +0 -33
  106. package/packages/_vue2/dist/render-repeated-block.18d7fc6e.cjs +0 -1
  107. package/packages/_vue2/dist/render-repeated-block.1bb5c2fb.js +0 -42
  108. package/packages/_vue2/dist/render-styles.de7287b6.cjs +0 -31
  109. package/packages/_vue3/dist/block-styles.09955b0c.cjs +0 -1
  110. package/packages/_vue3/dist/block-styles.6bd36a5a.js +0 -69
  111. package/packages/_vue3/dist/css.3241302b.cjs +0 -6
  112. package/packages/_vue3/dist/css.81a21c5a.js +0 -58
  113. package/packages/_vue3/dist/index.cca81180.cjs +0 -29
  114. package/packages/_vue3/dist/render-block.33cc5768.cjs +0 -3
  115. package/packages/_vue3/dist/render-block.ec4c1913.js +0 -301
  116. package/packages/_vue3/dist/render-component.3bd8dc76.js +0 -26
  117. package/packages/_vue3/dist/render-component.c0d5e797.cjs +0 -1
  118. package/packages/_vue3/dist/render-inlined-styles.952d2fff.js +0 -32
  119. package/packages/_vue3/dist/render-inlined-styles.b55b6667.cjs +0 -1
  120. package/packages/_vue3/dist/render-repeated-block.263f0cec.js +0 -37
  121. package/packages/_vue3/dist/render-repeated-block.c3c9e926.cjs +0 -1
  122. package/packages/_vue3/dist/render-styles.d1ac3a18.cjs +0 -31
@@ -1,32 +1,23 @@
1
+ import type { BuilderContextInterface } from "../../context/types.js";
2
+ import type { BuilderBlock } from "../../types/builder-block.js";
1
3
  export type BlockStylesProps = {
2
4
  block: BuilderBlock;
3
5
  context: BuilderContextInterface;
4
6
  };
5
- import { BuilderContextInterface } from "../../context/types.js";
6
- import { BuilderBlock } from "../../types/builder-block.js";
7
- declare const _sfc_main: {
8
- name: string;
9
- components: {
10
- RenderInlinedStyles: {
11
- name: string;
12
- props: string[];
13
- data(): {
14
- TARGET: string;
15
- };
16
- computed: {
17
- tag(): string;
18
- injectedStyleScript(): any;
19
- };
20
- };
21
- };
22
- props: string[];
23
- data(): {
24
- TARGET: string;
25
- };
26
- computed: {
27
- useBlock(): any;
28
- canShowBlock(): any;
29
- css(): any;
30
- };
31
- };
7
+ declare const _sfc_main: import("vue").DefineComponent<Readonly<{
8
+ block?: any;
9
+ context?: any;
10
+ }>, unknown, {
11
+ TARGET: string;
12
+ }, {
13
+ useBlock(): BuilderBlock;
14
+ canShowBlock(): boolean;
15
+ css(): string;
16
+ }, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<Readonly<{
17
+ block?: any;
18
+ context?: any;
19
+ }>>>, {
20
+ readonly block?: any;
21
+ readonly context?: any;
22
+ }>;
32
23
  export default _sfc_main;
@@ -10,4 +10,3 @@ export declare const getRepeatItemData: ({ block, context, }: {
10
10
  block: BuilderBlock;
11
11
  context: BuilderContextInterface;
12
12
  }) => RepeatData[] | undefined;
13
- export declare const getProxyState: (context: BuilderContextInterface) => BuilderContextInterface['state'];
@@ -1,8 +1,8 @@
1
+ import type { BuilderContextInterface } from "../../context/types.js";
2
+ import type { BuilderBlock } from "../../types/builder-block.js";
1
3
  export type RenderBlockProps = {
2
4
  block: BuilderBlock;
3
5
  context: BuilderContextInterface;
4
6
  };
5
- import { BuilderContextInterface } from "../../context/types.js";
6
- import { BuilderBlock } from "../../types/builder-block.js";
7
7
  declare const _sfc_main: any;
8
8
  export default _sfc_main;
@@ -1,3 +1,5 @@
1
+ import type { BuilderBlock } from "../../types/builder-block.js";
2
+ import type { BuilderContextInterface } from "../../context/types.js";
1
3
  type ComponentOptions = {
2
4
  [index: string]: any;
3
5
  attributes?: {
@@ -10,7 +12,5 @@ export interface RenderComponentProps {
10
12
  blockChildren: BuilderBlock[];
11
13
  context: BuilderContextInterface;
12
14
  }
13
- import { BuilderBlock } from "../../types/builder-block.js";
14
- import { BuilderContextInterface } from "../../context/types.js";
15
15
  declare const _sfc_main: any;
16
16
  export default _sfc_main;
@@ -1,9 +1,20 @@
1
- declare const _sfc_main: {
2
- name: string;
3
- components: {
4
- RenderBlock: any;
5
- };
6
- props: string[];
7
- provide(): any;
8
- };
1
+ /**
2
+ * We can't make this a generic `ProvideContext` function because Vue 2 won't support root slots, e.g.
3
+ *
4
+ * ```vue
5
+ * <template>
6
+ * <slot></slot>
7
+ * </template>
8
+ * ```
9
+ */
10
+ declare const _sfc_main: import("vue").DefineComponent<Readonly<{
11
+ block?: any;
12
+ repeatContext?: any;
13
+ }>, unknown, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<Readonly<{
14
+ block?: any;
15
+ repeatContext?: any;
16
+ }>>>, {
17
+ readonly block?: any;
18
+ readonly repeatContext?: any;
19
+ }>;
9
20
  export default _sfc_main;
@@ -1,51 +1,30 @@
1
+ import type { BuilderBlock } from "../types/builder-block.js";
1
2
  export type RenderBlockProps = {
2
3
  blocks?: BuilderBlock[];
3
4
  parent?: string;
4
5
  path?: string;
5
6
  styleProp?: Record<string, any>;
6
7
  };
7
- import { BuilderBlock } from "../types/builder-block.js";
8
- declare const _sfc_main: {
9
- name: string;
10
- components: {
11
- RenderBlock: any;
12
- BlockStyles: {
13
- name: string;
14
- components: {
15
- RenderInlinedStyles: {
16
- name: string;
17
- props: string[];
18
- data(): {
19
- TARGET: string;
20
- };
21
- computed: {
22
- tag(): string;
23
- injectedStyleScript(): any;
24
- };
25
- };
26
- };
27
- props: string[];
28
- data(): {
29
- TARGET: string;
30
- };
31
- computed: {
32
- useBlock(): any;
33
- canShowBlock(): any;
34
- css(): any;
35
- };
36
- };
37
- };
38
- props: string[];
39
- inject: {
40
- builderContext: symbol;
41
- };
42
- computed: {
43
- className(): any;
44
- };
45
- methods: {
46
- onClick(): void;
47
- onMouseEnter(): void;
48
- _classStringToObject(str: any): {};
49
- };
50
- };
8
+ declare const _sfc_main: import("vue").DefineComponent<Readonly<{
9
+ blocks?: any;
10
+ parent?: any;
11
+ path?: any;
12
+ styleProp?: any;
13
+ }>, unknown, unknown, {
14
+ className(): string;
15
+ }, {
16
+ onClick(): void;
17
+ onMouseEnter(): void;
18
+ _classStringToObject(str: any): {};
19
+ }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<Readonly<{
20
+ blocks?: any;
21
+ parent?: any;
22
+ path?: any;
23
+ styleProp?: any;
24
+ }>>>, {
25
+ readonly blocks?: any;
26
+ readonly parent?: any;
27
+ readonly path?: any;
28
+ readonly styleProp?: any;
29
+ }>;
51
30
  export default _sfc_main;
@@ -1,19 +1,16 @@
1
- declare const _sfc_main: {
2
- name: string;
3
- components: {
4
- RenderInlinedStyles: {
5
- name: string;
6
- props: string[];
7
- data(): {
8
- TARGET: string;
9
- };
10
- computed: {
11
- tag(): string;
12
- injectedStyleScript(): any;
13
- };
14
- };
15
- };
16
- props: string[];
17
- data(): any;
18
- };
1
+ declare const _sfc_main: import("vue").DefineComponent<Readonly<{
2
+ cssCode?: any;
3
+ contentId?: any;
4
+ customFonts?: any;
5
+ }>, unknown, {
6
+ injectedStyles: string;
7
+ }, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<Readonly<{
8
+ cssCode?: any;
9
+ contentId?: any;
10
+ customFonts?: any;
11
+ }>>>, {
12
+ readonly cssCode?: any;
13
+ readonly contentId?: any;
14
+ readonly customFonts?: any;
15
+ }>;
19
16
  export default _sfc_main;
@@ -1,137 +1,85 @@
1
- import { BuilderRenderState } from "../../context/types.js";
2
- import { Breakpoints, BuilderContent } from "../../types/builder-content.js";
3
- import { Nullable } from "../../types/typescript.js";
4
- declare const _sfc_main: {
5
- name: string;
6
- components: {
7
- RenderContentStyles: {
8
- name: string;
9
- components: {
10
- RenderInlinedStyles: {
11
- name: string;
12
- props: string[];
13
- data(): {
14
- TARGET: string;
15
- };
16
- computed: {
17
- tag(): string;
18
- injectedStyleScript(): any;
19
- };
20
- };
21
- };
22
- props: string[];
23
- data(): any;
24
- };
25
- RenderBlocks: {
26
- name: string;
27
- components: {
28
- RenderBlock: any;
29
- BlockStyles: {
30
- name: string;
31
- components: {
32
- RenderInlinedStyles: {
33
- name: string;
34
- props: string[];
35
- data(): {
36
- TARGET: string;
37
- };
38
- computed: {
39
- tag(): string;
40
- injectedStyleScript(): any;
41
- };
42
- };
43
- };
44
- props: string[];
45
- data(): {
46
- TARGET: string;
47
- };
48
- computed: {
49
- useBlock(): any;
50
- canShowBlock(): any;
51
- css(): any;
52
- };
53
- };
54
- };
55
- props: string[];
56
- inject: {
57
- builderContext: symbol;
58
- };
59
- computed: {
60
- className(): any;
61
- };
62
- methods: {
63
- onClick(): void;
64
- onMouseEnter(): void;
65
- _classStringToObject(str: any): {};
66
- };
67
- };
1
+ import type { BuilderRenderState } from "../../context/types.js";
2
+ import type { Breakpoints, BuilderContent } from "../../types/builder-content.js";
3
+ import type { Nullable } from "../../types/typescript.js";
4
+ declare const _sfc_main: import("vue").DefineComponent<Readonly<{
5
+ data?: any;
6
+ context?: any;
7
+ content?: any;
8
+ canTrack?: any;
9
+ locale?: any;
10
+ customComponents?: any;
11
+ model?: any;
12
+ apiKey?: any;
13
+ includeRefs?: any;
14
+ apiVersion?: any;
15
+ }>, unknown, {
16
+ forceReRenderCount: number;
17
+ overrideContent: null;
18
+ useContent: Nullable<BuilderContent>;
19
+ update: number;
20
+ canTrackToUse: any;
21
+ contentState: {
22
+ [x: string]: unknown;
23
+ };
24
+ allRegisteredComponents: any;
25
+ httpReqsData: {};
26
+ clicked: boolean;
27
+ TARGET: string;
28
+ }, {
29
+ onUpdateHook0(): {
30
+ 0: any;
68
31
  };
69
- props: string[];
70
- data(): {
71
- forceReRenderCount: number;
72
- overrideContent: null;
73
- useContent: Nullable<BuilderContent>;
74
- update: number;
75
- canTrackToUse: any;
76
- contentState: {
32
+ onUpdateHook1(): {
33
+ 0: string | undefined;
34
+ 1: {
77
35
  [x: string]: unknown;
78
36
  };
79
- allRegisteredComponents: any;
80
- httpReqsData: {};
81
- clicked: boolean;
82
- TARGET: string;
83
37
  };
84
- provide(): {
85
- [x: symbol]: {
86
- content: any;
87
- state: any;
88
- setState: any;
89
- context: any;
90
- apiKey: any;
91
- apiVersion: any;
92
- registeredComponents: any;
93
- };
38
+ onUpdateHook2(): {
39
+ 0: {
40
+ [key: string]: string;
41
+ } | undefined;
94
42
  };
95
- mounted(): void;
96
- watch: {
97
- onUpdateHook0: {
98
- handler(): void;
99
- immediate: boolean;
100
- };
101
- onUpdateHook1: {
102
- handler(): void;
103
- immediate: boolean;
104
- };
105
- onUpdateHook2: {
106
- handler(): void;
107
- immediate: boolean;
108
- };
109
- onUpdateHook3: {
110
- handler(): void;
111
- immediate: boolean;
43
+ onUpdateHook3(): {
44
+ 0: {
45
+ [x: string]: unknown;
112
46
  };
113
47
  };
114
- unmounted(): void;
115
- computed: {
116
- onUpdateHook0(): any;
117
- onUpdateHook1(): any;
118
- onUpdateHook2(): any;
119
- onUpdateHook3(): any;
120
- };
121
- methods: {
122
- mergeNewContent(newContent: BuilderContent): void;
123
- setBreakpoints(breakpoints: Breakpoints): void;
124
- setContextState(newState: BuilderRenderState): void;
125
- processMessage(event: MessageEvent): void;
126
- evaluateJsCode(): void;
127
- onClick(event: any): void;
128
- evalExpression(expression: string): string;
129
- handleRequest({ url, key }: {
130
- key: string;
131
- url: string;
132
- }): void;
133
- runHttpRequests(): void;
134
- emitStateUpdate(): void;
135
- };
136
- };
48
+ }, {
49
+ mergeNewContent(newContent: BuilderContent): void;
50
+ setBreakpoints(breakpoints: Breakpoints): void;
51
+ contentSetState(newRootState: BuilderRenderState): void;
52
+ processMessage(event: MessageEvent): void;
53
+ evaluateJsCode(): void;
54
+ onClick(event: any): void;
55
+ evalExpression(expression: string): string;
56
+ handleRequest({ url, key }: {
57
+ key: string;
58
+ url: string;
59
+ }): void;
60
+ runHttpRequests(): void;
61
+ emitStateUpdate(): void;
62
+ }, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<Readonly<{
63
+ data?: any;
64
+ context?: any;
65
+ content?: any;
66
+ canTrack?: any;
67
+ locale?: any;
68
+ customComponents?: any;
69
+ model?: any;
70
+ apiKey?: any;
71
+ includeRefs?: any;
72
+ apiVersion?: any;
73
+ }>>>, {
74
+ readonly data?: any;
75
+ readonly context?: any;
76
+ readonly content?: any;
77
+ readonly canTrack?: any;
78
+ readonly locale?: any;
79
+ readonly customComponents?: any;
80
+ readonly model?: any;
81
+ readonly apiKey?: any;
82
+ readonly includeRefs?: any;
83
+ readonly apiVersion?: any;
84
+ }>;
137
85
  export default _sfc_main;
@@ -1,12 +1,13 @@
1
- declare const _sfc_main: {
2
- name: string;
3
- props: string[];
4
- data(): {
5
- TARGET: string;
6
- };
7
- computed: {
8
- tag(): string;
9
- injectedStyleScript(): any;
10
- };
11
- };
1
+ declare const _sfc_main: import("vue").DefineComponent<Readonly<{
2
+ styles?: any;
3
+ }>, unknown, {
4
+ TARGET: string;
5
+ }, {
6
+ tag(): any;
7
+ injectedStyleScript(): string;
8
+ }, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<Readonly<{
9
+ styles?: any;
10
+ }>>>, {
11
+ readonly styles?: any;
12
+ }>;
12
13
  export default _sfc_main;
@@ -0,0 +1 @@
1
+ export declare const SDK_VERSION = "0.3.1";
@@ -2,8 +2,9 @@ declare const _default: {
2
2
  Builder: {
3
3
  content: null;
4
4
  context: {};
5
- state: {};
6
- setState(): void;
5
+ localState: undefined;
6
+ rootSetState(): void;
7
+ rootState: {};
7
8
  apiKey: null;
8
9
  apiVersion: undefined;
9
10
  registeredComponents: {};
@@ -11,8 +11,23 @@ export type BuilderRenderContext = Record<string, unknown>;
11
11
  export interface BuilderContextInterface {
12
12
  content: Nullable<BuilderContent>;
13
13
  context: BuilderRenderContext;
14
- state: BuilderRenderState;
15
- setState?: (state: BuilderRenderState) => void;
14
+ /**
15
+ * The state of the application.
16
+ *
17
+ * NOTE: see `localState` below to understand how it is different from `rootState`.
18
+ */
19
+ rootState: BuilderRenderState;
20
+ /**
21
+ * Some frameworks have a `setState` function which needs to be invoked to notify
22
+ * the framework of state change. (other frameworks don't in which case it is `undefined')
23
+ */
24
+ rootSetState: ((rootState: BuilderRenderState) => void) | undefined;
25
+ /**
26
+ * The local state of the current component. This is different from `rootState` in that
27
+ * it can be a child state created by a repeater containing local state.
28
+ * The `rootState` is where all of the state mutations are actually stored.
29
+ */
30
+ localState: BuilderRenderState | undefined;
16
31
  apiKey: string | null;
17
32
  apiVersion: ApiVersion | undefined;
18
33
  registeredComponents: RegisteredComponents;
@@ -1,6 +1,7 @@
1
- import type { BuilderContextInterface } from '../context/types.js';
2
- export declare function evaluate({ code, context, state, event, isExpression, }: {
1
+ import type { BuilderContextInterface, BuilderRenderState } from '../context/types.js';
2
+ export declare function evaluate({ code, context, localState, rootState, rootSetState, event, isExpression, }: {
3
3
  code: string;
4
4
  event?: Event;
5
5
  isExpression?: boolean;
6
- } & Pick<BuilderContextInterface, 'state' | 'context'>): any;
6
+ } & Pick<BuilderContextInterface, 'localState' | 'context' | 'rootState' | 'rootSetState'>): any;
7
+ export declare function flattenState(rootState: Record<string | symbol, any>, localState: Record<string | symbol, any> | undefined, rootSetState: ((rootState: BuilderRenderState) => void) | undefined): BuilderRenderState;
@@ -2,7 +2,7 @@ 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
- } & Pick<BuilderContextInterface, 'state' | 'context'>;
5
+ } & Pick<BuilderContextInterface, 'localState' | 'context' | 'rootState' | 'rootSetState'>;
6
6
  type EventHandler = (event: Event) => any;
7
7
  export declare const createEventHandler: (value: string, options: Options) => EventHandler;
8
8
  export {};
@@ -5,5 +5,5 @@ type Actions = {
5
5
  };
6
6
  export declare function getBlockActions(options: {
7
7
  block: BuilderBlock;
8
- } & Pick<BuilderContextInterface, 'state' | 'context'>): Actions;
8
+ } & Pick<BuilderContextInterface, 'localState' | 'context' | 'rootState' | 'rootSetState'>): Actions;
9
9
  export {};
@@ -1,10 +1,10 @@
1
1
  import type { BuilderContextInterface } from '../context/types.js';
2
2
  import type { BuilderBlock } from '../types/builder-block.js';
3
- export declare function getProcessedBlock({ block, context, shouldEvaluateBindings, state, }: {
3
+ export declare function getProcessedBlock({ block, context, shouldEvaluateBindings, localState, rootState, rootSetState, }: {
4
4
  block: BuilderBlock;
5
5
  /**
6
6
  * In some cases, we want to avoid evaluating bindings and only want framework-specific block transformation. It is
7
7
  * also sometimes too early to consider bindings, e.g. when we might be looking at a repeated block.
8
8
  */
9
9
  shouldEvaluateBindings: boolean;
10
- } & Pick<BuilderContextInterface, 'state' | 'context'>): BuilderBlock;
10
+ } & Pick<BuilderContextInterface, 'localState' | 'context' | 'rootState' | 'rootSetState'>): BuilderBlock;
@@ -10,3 +10,4 @@ export * from './functions/get-builder-search-params/index.js';
10
10
  export { track } from './functions/track/index.js';
11
11
  export type { RegisteredComponent } from './context/types';
12
12
  export type { ComponentInfo } from './types/components';
13
+ export type { RenderContentProps } from './components/render-content/render-content.types.js';
@@ -1 +1 @@
1
- .button-1yj9n7yt24z[data-v-fa5dea7e]{all:unset}.div-2btisl9m7v3[data-v-4459bc28]{display:flex;line-height:normal}.div-2btisl9m7v3-2[data-v-4459bc28]{display:flex;flex-direction:column;align-items:stretch}.img-20vehov4ay6[data-v-b99a9c06]{opacity:1;transition:opacity .2s ease-in-out}.div-20vehov4ay6[data-v-b99a9c06]{width:100%;pointer-events:none;font-size:0}.div-20vehov4ay6-2[data-v-b99a9c06]{display:flex;flex-direction:column;align-items:stretch;position:absolute;top:0;left:0;width:100%;height:100%}.div-7fq9d0i380[data-v-81bad369]{display:flex;flex-direction:column;align-items:stretch}
1
+ .button-1yj9n7yt24z[data-v-3b72112d]{all:unset}.div-361b1o6wv2k[data-v-fae985f2]{display:flex;line-height:normal}.div-361b1o6wv2k-2[data-v-fae985f2]{display:flex;flex-direction:column;align-items:stretch}.img-7jvpanrlkn[data-v-034e3c7d]{opacity:1;transition:opacity .2s ease-in-out}.div-7jvpanrlkn[data-v-034e3c7d]{width:100%;pointer-events:none;font-size:0}.div-7jvpanrlkn-2[data-v-034e3c7d]{display:flex;flex-direction:column;align-items:stretch;position:absolute;top:0;left:0;width:100%;height:100%}.div-7fq9d0i380[data-v-ff3cb99b]{display:flex;flex-direction:column;align-items:stretch}
@@ -1,72 +0,0 @@
1
- import { T as k, c as i, g as p, a as u, n as y } from "./index.eb91dc82.js";
2
- import { g as _, c as o } from "./css.468435de.js";
3
- const f = () => import("./render-inlined-styles.942eb38d.js").then((e) => e.default).catch((e) => {
4
- throw console.error(
5
- "Error while attempting to dynamically import component RenderInlinedStyles at ../render-inlined-styles.vue",
6
- e
7
- ), e;
8
- }), S = {
9
- name: "block-styles",
10
- components: { RenderInlinedStyles: f },
11
- props: ["block", "context"],
12
- data() {
13
- return { TARGET: k };
14
- },
15
- computed: {
16
- useBlock() {
17
- return _({
18
- block: this.block,
19
- state: this.context.state,
20
- context: this.context.context,
21
- shouldEvaluateBindings: !0
22
- });
23
- },
24
- canShowBlock() {
25
- return i(this.useBlock.hide) ? !this.useBlock.hide : i(this.useBlock.show) ? this.useBlock.show : !0;
26
- },
27
- css() {
28
- var a;
29
- const e = this.useBlock.responsiveStyles, s = this.context.content, t = p(
30
- ((a = s == null ? void 0 : s.meta) == null ? void 0 : a.breakpoints) || {}
31
- ), l = e == null ? void 0 : e.large, r = e == null ? void 0 : e.medium, c = e == null ? void 0 : e.small, n = this.useBlock.id;
32
- if (!n)
33
- return "";
34
- const m = l ? o({
35
- className: n,
36
- styles: l
37
- }) : "", d = r ? o({
38
- className: n,
39
- styles: r,
40
- mediaQuery: u(
41
- "medium",
42
- t
43
- )
44
- }) : "", h = c ? o({
45
- className: n,
46
- styles: c,
47
- mediaQuery: u(
48
- "small",
49
- t
50
- )
51
- }) : "";
52
- return [m, d, h].join(" ");
53
- }
54
- }
55
- };
56
- var B = function() {
57
- var s = this, t = s._self._c;
58
- return s.TARGET !== "reactNative" && s.css && s.canShowBlock ? t("render-inlined-styles", { attrs: { styles: s.css } }) : s._e();
59
- }, g = [], v = /* @__PURE__ */ y(
60
- S,
61
- B,
62
- g,
63
- !1,
64
- null,
65
- null,
66
- null,
67
- null
68
- );
69
- const w = v.exports;
70
- export {
71
- w as default
72
- };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index.78ba6586.cjs"),r=require("./css.dce6e4eb.cjs"),h=()=>Promise.resolve().then(()=>require("./render-inlined-styles.56373d13.cjs")).then(e=>e.default).catch(e=>{throw console.error("Error while attempting to dynamically import component RenderInlinedStyles at ../render-inlined-styles.vue",e),e}),y={name:"block-styles",components:{RenderInlinedStyles:h},props:["block","context"],data(){return{TARGET:t.TARGET}},computed:{useBlock(){return r.getProcessedBlock({block:this.block,state:this.context.state,context:this.context.context,shouldEvaluateBindings:!0})},canShowBlock(){return t.checkIsDefined(this.useBlock.hide)?!this.useBlock.hide:t.checkIsDefined(this.useBlock.show)?this.useBlock.show:!0},css(){var a;const e=this.useBlock.responsiveStyles,s=this.context.content,n=t.getSizesForBreakpoints(((a=s==null?void 0:s.meta)==null?void 0:a.breakpoints)||{}),c=e==null?void 0:e.large,l=e==null?void 0:e.medium,i=e==null?void 0:e.small,o=this.useBlock.id;if(!o)return"";const d=c?r.createCssClass({className:o,styles:c}):"",u=l?r.createCssClass({className:o,styles:l,mediaQuery:t.getMaxWidthQueryForSize("medium",n)}):"",m=i?r.createCssClass({className:o,styles:i,mediaQuery:t.getMaxWidthQueryForSize("small",n)}):"";return[d,u,m].join(" ")}}};var k=function(){var s=this,n=s._self._c;return s.TARGET!=="reactNative"&&s.css&&s.canShowBlock?n("render-inlined-styles",{attrs:{styles:s.css}}):s._e()},S=[],p=t.normalizeComponent(y,k,S,!1,null,null,null,null);const _=p.exports;exports.default=_;