@builder.io/sdk-vue 5.1.0 → 5.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/browser/{awaiter-GjRYxPnU.cjs → awaiter-Xj7xgU8A.cjs} +1 -1
- package/lib/browser/{awaiter-5WjT5CVy.js → awaiter-fiHMd9OX.js} +1 -1
- package/lib/browser/block-wrapper-2d_iPFQQ.js +51 -0
- package/lib/browser/block-wrapper-lKLgKxgH.cjs +1 -0
- package/lib/browser/blocks/form/form/form.vue.d.ts +3 -3
- package/lib/browser/blocks/form/input/input.vue.d.ts +3 -3
- package/lib/browser/blocks/symbol/symbol.helpers.d.ts +2 -0
- package/lib/browser/blocks/symbol/symbol.types.d.ts +2 -0
- package/lib/browser/component-ref-Bo_fwbYK.cjs +1 -0
- package/lib/browser/component-ref-YEfZKvMy.js +185 -0
- package/lib/browser/components/content/components/enable-editor.vue.d.ts +9 -9
- package/lib/browser/components/content/components/styles.vue.d.ts +3 -3
- package/lib/browser/components/content/content.vue.d.ts +9 -9
- package/lib/browser/components/content-variants/content-variants.vue.d.ts +9 -9
- package/lib/browser/components/inlined-script.vue.d.ts +3 -3
- package/lib/browser/components/inlined-styles.vue.d.ts +3 -3
- package/lib/browser/constants/sdk-version.d.ts +1 -1
- package/lib/browser/functions/evaluate/evaluate.d.ts +1 -1
- package/lib/browser/functions/evaluate/helpers.d.ts +9 -1
- package/lib/browser/functions/get-block-actions-handler.d.ts +2 -0
- package/lib/browser/functions/get-block-actions.d.ts +2 -0
- package/lib/{edge/get-block-properties--YFzBEV7.js → browser/get-block-properties-5nuoWf39.js} +9 -7
- package/lib/browser/get-block-properties-d-Ruoi4f.cjs +1 -0
- package/lib/browser/index-1GET5eOz.cjs +334 -0
- package/lib/browser/{index-EQdaCBDB.js → index-eVqO7_Qb.js} +475 -459
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +1 -1
- package/lib/browser/{live-edit-tO-V6Sv7.js → live-edit-9paJdIsz.js} +1 -1
- package/lib/browser/{live-edit-Jion_iv8.cjs → live-edit-ETOoXz63.cjs} +1 -1
- package/lib/browser/{repeated-block-kNj6mfjr.js → repeated-block-A24n6o-E.js} +2 -2
- package/lib/browser/{repeated-block-uNYlrd8d.cjs → repeated-block-RfWox6Ev.cjs} +1 -1
- package/lib/browser/{style-wrapper-jthdwC6f.cjs → style-wrapper-GTejPbe6.cjs} +1 -1
- package/lib/browser/{style-wrapper-CSSH3Epu.js → style-wrapper-tibcUSpL.js} +1 -1
- package/lib/edge/{awaiter-0PdAd6k-.cjs → awaiter-SdqgCFCT.cjs} +1 -1
- package/lib/edge/{awaiter-OJqvwrja.js → awaiter-rbgcBB2Y.js} +1 -1
- package/lib/edge/block-wrapper-DYh1gucy.js +50 -0
- package/lib/edge/block-wrapper-WT0fK9OQ.cjs +1 -0
- package/lib/edge/blocks/form/form/form.vue.d.ts +3 -3
- package/lib/edge/blocks/form/input/input.vue.d.ts +3 -3
- package/lib/edge/blocks/symbol/symbol.helpers.d.ts +2 -0
- package/lib/edge/blocks/symbol/symbol.types.d.ts +2 -0
- package/lib/edge/component-ref-14bWdw0y.js +184 -0
- package/lib/edge/component-ref-Ari_o8qM.cjs +1 -0
- package/lib/edge/components/content/components/enable-editor.vue.d.ts +9 -9
- package/lib/edge/components/content/components/styles.vue.d.ts +3 -3
- package/lib/edge/components/content/content.vue.d.ts +9 -9
- package/lib/edge/components/content-variants/content-variants.vue.d.ts +9 -9
- package/lib/edge/components/inlined-script.vue.d.ts +3 -3
- package/lib/edge/components/inlined-styles.vue.d.ts +3 -3
- package/lib/edge/constants/sdk-version.d.ts +1 -1
- package/lib/edge/functions/evaluate/evaluate.d.ts +1 -1
- package/lib/edge/functions/evaluate/helpers.d.ts +9 -1
- package/lib/edge/functions/get-block-actions-handler.d.ts +2 -0
- package/lib/edge/functions/get-block-actions.d.ts +2 -0
- package/lib/{browser/get-block-properties-dmm_DIxo.js → edge/get-block-properties-6j21Yx4_.js} +17 -17
- package/lib/edge/get-block-properties-kMAb8z5D.cjs +1 -0
- package/lib/edge/{index-ljVeDS39.cjs → index-2Armmtcs.cjs} +17 -17
- package/lib/edge/{index-Agn-gjHJ.js → index-unVH2XRb.js} +848 -832
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +1 -1
- package/lib/{node/live-edit-jWT4dXgM.cjs → edge/live-edit-gMqK1-U2.cjs} +1 -1
- package/lib/{node/live-edit-E90Rueqo.js → edge/live-edit-yXkE9pDV.js} +1 -1
- package/lib/{node/repeated-block-gCLdrEyt.js → edge/repeated-block-F4oPiI78.js} +2 -2
- package/lib/edge/{repeated-block-GaabRNMP.cjs → repeated-block-Y0Z3ldLT.cjs} +1 -1
- package/lib/edge/{style-wrapper-I1DS5PUP.js → style-wrapper-Ad7ABy2Z.js} +1 -1
- package/lib/edge/{style-wrapper-MIBe_b13.cjs → style-wrapper-sL972lDH.cjs} +1 -1
- package/lib/node/{awaiter-qP3UIYQS.js → awaiter-_ZqW9w8N.js} +1 -1
- package/lib/node/{awaiter-ZX8mvzyL.cjs → awaiter-i0lAEAYI.cjs} +1 -1
- package/lib/node/block-wrapper-Bv_s1rr1.cjs +1 -0
- package/lib/node/block-wrapper-CnMu7UjK.js +50 -0
- package/lib/node/blocks/form/form/form.vue.d.ts +3 -3
- package/lib/node/blocks/form/input/input.vue.d.ts +3 -3
- package/lib/node/blocks/symbol/symbol.helpers.d.ts +2 -0
- package/lib/node/blocks/symbol/symbol.types.d.ts +2 -0
- package/lib/node/component-ref-LWytt0tD.cjs +1 -0
- package/lib/node/component-ref-lU9WFg32.js +185 -0
- package/lib/node/components/content/components/enable-editor.vue.d.ts +9 -9
- package/lib/node/components/content/components/styles.vue.d.ts +3 -3
- package/lib/node/components/content/content.vue.d.ts +9 -9
- package/lib/node/components/content-variants/content-variants.vue.d.ts +9 -9
- package/lib/node/components/inlined-script.vue.d.ts +3 -3
- package/lib/node/components/inlined-styles.vue.d.ts +3 -3
- package/lib/node/constants/sdk-version.d.ts +1 -1
- package/lib/node/functions/evaluate/evaluate.d.ts +1 -1
- package/lib/node/functions/evaluate/helpers.d.ts +9 -1
- package/lib/node/functions/get-block-actions-handler.d.ts +2 -0
- package/lib/node/functions/get-block-actions.d.ts +2 -0
- package/lib/node/{get-block-properties-o5VoFlz_.js → get-block-properties-oSP4WCJG.js} +18 -17
- package/lib/node/get-block-properties-sdbm535D.cjs +1 -0
- package/lib/node/{index-SH8gdiHf.js → index-9Wxomhx_.js} +702 -900
- package/lib/node/{index-AumTeVyL.cjs → index-z7Ed9MEJ.cjs} +30 -30
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +11 -11
- package/lib/node/init.cjs +1 -1
- package/lib/node/init.mjs +1 -1
- package/lib/{edge/live-edit-TWpZ33A7.js → node/live-edit-ZjrPT1e_.js} +1 -1
- package/lib/{edge/live-edit-nHq1I7ij.cjs → node/live-edit-nQPgUSEF.cjs} +1 -1
- package/lib/node/{repeated-block-4pHYUEBM.cjs → repeated-block-G-7Wr2Ub.cjs} +1 -1
- package/lib/{edge/repeated-block-_wYfLmVg.js → node/repeated-block-zGwBOU59.js} +2 -2
- package/lib/node/{should-force-browser-runtime-in-node-5h08TaCf.js → should-force-browser-runtime-in-node-0jTQ7bdA.js} +261 -41
- package/lib/node/should-force-browser-runtime-in-node-kkE7IeZS.cjs +48 -0
- package/lib/node/{style-wrapper-7nh-8JLA.cjs → style-wrapper-QZvOi8Ur.cjs} +1 -1
- package/lib/node/{style-wrapper-1rHE_XSt.js → style-wrapper-QtIk1dHP.js} +10 -10
- package/package.json +1 -1
- package/lib/browser/block-wrapper-8v7I2JSB.cjs +0 -1
- package/lib/browser/block-wrapper-s3-0mqGr.js +0 -44
- package/lib/browser/component-ref-8g4g9kyF.js +0 -178
- package/lib/browser/component-ref-r7lSDLc0.cjs +0 -1
- package/lib/browser/get-block-properties-GPPIll7t.cjs +0 -1
- package/lib/browser/index-Treb985Y.cjs +0 -334
- package/lib/edge/block-wrapper-DfG53TBm.cjs +0 -1
- package/lib/edge/block-wrapper-LzMR5J5q.js +0 -43
- package/lib/edge/component-ref-30u-bbmm.js +0 -177
- package/lib/edge/component-ref-VTMpfeME.cjs +0 -1
- package/lib/edge/get-block-properties-yv9bFXVp.cjs +0 -1
- package/lib/node/block-wrapper-3FbaAWv9.js +0 -43
- package/lib/node/block-wrapper-mEOIfHOk.cjs +0 -1
- package/lib/node/component-ref-DHpSqIaD.cjs +0 -1
- package/lib/node/component-ref-MKSj3oym.js +0 -178
- package/lib/node/get-block-properties-b4xkM8mc.cjs +0 -1
- package/lib/node/should-force-browser-runtime-in-node-IsToRTN-.cjs +0 -48
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
declare const _default: import("vue").DefineComponent<Readonly<{
|
|
2
|
-
nonce?: any;
|
|
3
2
|
id?: any;
|
|
3
|
+
nonce?: any;
|
|
4
4
|
styles?: any;
|
|
5
5
|
}>, unknown, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<Readonly<{
|
|
6
|
-
nonce?: any;
|
|
7
6
|
id?: any;
|
|
7
|
+
nonce?: any;
|
|
8
8
|
styles?: any;
|
|
9
9
|
}>>>, {
|
|
10
|
-
readonly nonce?: any;
|
|
11
10
|
readonly id?: any;
|
|
11
|
+
readonly nonce?: any;
|
|
12
12
|
readonly styles?: any;
|
|
13
13
|
}, {}>;
|
|
14
14
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "5.
|
|
1
|
+
export declare const SDK_VERSION = "5.2.0";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { EvaluatorArgs } from './helpers';
|
|
2
2
|
type EvalValue = unknown;
|
|
3
3
|
export declare const getSimpleExpressionGetPath: (code: string) => any;
|
|
4
|
-
export declare function evaluate({ code, context, localState, rootState, rootSetState, event, isExpression }: EvaluatorArgs): EvalValue;
|
|
4
|
+
export declare function evaluate({ code, context, localState, rootState, rootSetState, event, isExpression, trackingContext }: EvaluatorArgs): EvalValue;
|
|
5
5
|
export {};
|
|
@@ -1,14 +1,22 @@
|
|
|
1
1
|
import type { BuilderContextInterface, BuilderRenderState } from '../../context/types';
|
|
2
2
|
import { getUserAttributes } from '../track/helpers';
|
|
3
|
+
export type TrackingContext = {
|
|
4
|
+
apiKey: string | null;
|
|
5
|
+
canTrack?: boolean;
|
|
6
|
+
contentId?: string;
|
|
7
|
+
variationId?: string;
|
|
8
|
+
};
|
|
3
9
|
export type EvaluatorArgs = Omit<ExecutorArgs, 'builder' | 'event'> & {
|
|
4
10
|
event?: Event;
|
|
5
11
|
isExpression?: boolean;
|
|
12
|
+
trackingContext?: TrackingContext;
|
|
6
13
|
};
|
|
7
14
|
export type BuilderGlobals = {
|
|
8
15
|
isEditing: boolean | undefined;
|
|
9
16
|
isBrowser: boolean | undefined;
|
|
10
17
|
isServer: boolean | undefined;
|
|
11
18
|
getUserAttributes: typeof getUserAttributes;
|
|
19
|
+
trackConversion: (amount?: number, customProperties?: Record<string, any>) => void;
|
|
12
20
|
};
|
|
13
21
|
export type ExecutorArgs = Pick<BuilderContextInterface, 'localState' | 'context' | 'rootState' | 'rootSetState'> & {
|
|
14
22
|
code: string;
|
|
@@ -20,7 +28,7 @@ export type FunctionArguments = ReturnType<typeof getFunctionArguments>;
|
|
|
20
28
|
export declare const getFunctionArguments: ({ builder, context, event, state }: Pick<ExecutorArgs, "context" | "builder" | "event"> & {
|
|
21
29
|
state: BuilderRenderState;
|
|
22
30
|
}) => [string, Event | BuilderRenderState | import("../../context/types").BuilderRenderContext | BuilderGlobals | undefined][];
|
|
23
|
-
export declare const getBuilderGlobals: () => BuilderGlobals;
|
|
31
|
+
export declare const getBuilderGlobals: (trackingContext?: TrackingContext) => BuilderGlobals;
|
|
24
32
|
export declare const parseCode: (code: string, { isExpression }: Pick<EvaluatorArgs, 'isExpression'>) => string;
|
|
25
33
|
export declare function flattenState({ rootState, localState, rootSetState }: {
|
|
26
34
|
rootState: Record<string | symbol, any>;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { BuilderContextInterface } from '../context/types';
|
|
2
2
|
import type { BuilderBlock } from '../types/builder-block';
|
|
3
|
+
import type { TrackingContext } from './evaluate/helpers';
|
|
3
4
|
type Options = {
|
|
4
5
|
block: BuilderBlock;
|
|
6
|
+
trackingContext?: TrackingContext;
|
|
5
7
|
} & Pick<BuilderContextInterface, 'localState' | 'context' | 'rootState' | 'rootSetState'>;
|
|
6
8
|
type EventHandler = (event: Event) => any;
|
|
7
9
|
export declare const createEventHandler: (value: string, options: Options) => EventHandler;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type { BuilderContextInterface } from '../context/types';
|
|
2
2
|
import type { BuilderBlock } from '../types/builder-block';
|
|
3
|
+
import type { TrackingContext } from './evaluate/helpers';
|
|
3
4
|
type Actions = {
|
|
4
5
|
[index: string]: (event: Event) => any;
|
|
5
6
|
};
|
|
6
7
|
export declare function getBlockActions(options: {
|
|
7
8
|
block: BuilderBlock;
|
|
8
9
|
stripPrefix?: boolean;
|
|
10
|
+
trackingContext?: TrackingContext;
|
|
9
11
|
} & Pick<BuilderContextInterface, 'localState' | 'context' | 'rootState' | 'rootSetState'>): Actions;
|
|
10
12
|
export {};
|
package/lib/{browser/get-block-properties-dmm_DIxo.js → edge/get-block-properties-6j21Yx4_.js}
RENAMED
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
|
|
3
|
-
const p = (e) => `v-on:${e.toLowerCase()}`, f = (e, t) => (r) => n({
|
|
1
|
+
import { e as s, T as c, g as i, a as l } from "./index-unVH2XRb.js";
|
|
2
|
+
const f = (e) => `v-on:${e.toLowerCase()}`, u = (e, t) => (r) => s({
|
|
4
3
|
code: e,
|
|
5
4
|
context: t.context,
|
|
6
5
|
localState: t.localState,
|
|
7
6
|
rootState: t.rootState,
|
|
8
7
|
rootSetState: t.rootSetState,
|
|
9
8
|
event: r,
|
|
10
|
-
isExpression: !1
|
|
9
|
+
isExpression: !1,
|
|
10
|
+
trackingContext: t.trackingContext
|
|
11
11
|
});
|
|
12
12
|
function g(e) {
|
|
13
13
|
const t = {}, r = e.block.actions ?? {};
|
|
14
|
-
for (const
|
|
15
|
-
if (!r.hasOwnProperty(
|
|
14
|
+
for (const a in r) {
|
|
15
|
+
if (!r.hasOwnProperty(a))
|
|
16
16
|
continue;
|
|
17
|
-
const
|
|
18
|
-
let
|
|
17
|
+
const n = r[a];
|
|
18
|
+
let o = f(a);
|
|
19
19
|
if (e.stripPrefix)
|
|
20
20
|
switch (c) {
|
|
21
21
|
case "vue":
|
|
22
|
-
|
|
22
|
+
o = o.replace("v-on:", "");
|
|
23
23
|
break;
|
|
24
24
|
case "svelte":
|
|
25
|
-
|
|
25
|
+
o = o.replace("on:", "");
|
|
26
26
|
break;
|
|
27
27
|
}
|
|
28
|
-
t[
|
|
28
|
+
t[o] = u(n, e);
|
|
29
29
|
}
|
|
30
30
|
return t;
|
|
31
31
|
}
|
|
32
|
-
function
|
|
32
|
+
function p({
|
|
33
33
|
properties: e
|
|
34
34
|
}) {
|
|
35
35
|
return e;
|
|
@@ -37,11 +37,11 @@ function u({
|
|
|
37
37
|
const v = (e) => ({
|
|
38
38
|
href: e.href
|
|
39
39
|
});
|
|
40
|
-
function
|
|
40
|
+
function S({
|
|
41
41
|
block: e,
|
|
42
42
|
context: t
|
|
43
43
|
}) {
|
|
44
|
-
var
|
|
44
|
+
var a;
|
|
45
45
|
const r = {
|
|
46
46
|
...v(e),
|
|
47
47
|
...e.properties,
|
|
@@ -50,15 +50,15 @@ function m({
|
|
|
50
50
|
block: e,
|
|
51
51
|
context: t
|
|
52
52
|
}),
|
|
53
|
-
[l()]: [e.id, "builder-block", e.class, (
|
|
53
|
+
[l()]: [e.id, "builder-block", e.class, (a = e.properties) == null ? void 0 : a.class].filter(Boolean).join(" ")
|
|
54
54
|
};
|
|
55
|
-
return
|
|
55
|
+
return p({
|
|
56
56
|
properties: r,
|
|
57
57
|
context: t,
|
|
58
58
|
block: e
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
61
|
export {
|
|
62
|
-
|
|
62
|
+
S as a,
|
|
63
63
|
g
|
|
64
64
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const a=require("./index-2Armmtcs.cjs"),c=e=>`v-on:${e.toLowerCase()}`,i=(e,t)=>r=>a.evaluate({code:e,context:t.context,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,event:r,isExpression:!1,trackingContext:t.trackingContext});function l(e){const t={},r=e.block.actions??{};for(const o in r){if(!r.hasOwnProperty(o))continue;const s=r[o];let n=c(o);if(e.stripPrefix)switch(a.TARGET){case"vue":n=n.replace("v-on:","");break;case"svelte":n=n.replace("on:","");break}t[n]=i(s,e)}return t}function u({properties:e}){return e}const f=e=>({href:e.href});function p({block:e,context:t}){var o;const r={...f(e),...e.properties,"builder-id":e.id,style:a.getStyle({block:e,context:t}),[a.getClassPropName()]:[e.id,"builder-block",e.class,(o=e.properties)==null?void 0:o.class].filter(Boolean).join(" ")};return u({properties:r,context:t,block:e})}exports.getBlockActions=l;exports.getBlockProperties=p;
|