@builder.io/sdk-vue 5.0.1 → 5.1.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.
- package/lib/browser/{awaiter-ltuXxa1H.js → awaiter-NbFI2CU_.js} +1 -1
- package/lib/browser/{awaiter-EvoLkoA-.cjs → awaiter-YRNWppS-.cjs} +1 -1
- package/lib/browser/block-wrapper-7ZGQAl5W.cjs +1 -0
- package/lib/browser/block-wrapper-_4lEInw9.js +51 -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/component-ref-A2Q0eDCA.cjs +1 -0
- package/lib/browser/component-ref-S2rn5_QV.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/browser/get-block-properties-PbwnoRP4.cjs +1 -0
- package/lib/{edge/get-block-properties-oCaILy-t.js → browser/get-block-properties-Y9GlYFTe.js} +9 -7
- package/lib/browser/{index-ePDYAZ6K.js → index-HPQgrUEC.js} +427 -411
- package/lib/browser/index-OpNLmfCu.cjs +334 -0
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +1 -1
- package/lib/browser/{live-edit-chiC8ikS.js → live-edit-8F1riCsR.js} +1 -1
- package/lib/browser/{live-edit-DW8AQ7OF.cjs → live-edit-tMAUVH2B.cjs} +1 -1
- package/lib/browser/{repeated-block-xZMeXElb.js → repeated-block-C21nYjNB.js} +2 -2
- package/lib/browser/{repeated-block-2KQQbmA4.cjs → repeated-block-YesIuQQG.cjs} +1 -1
- package/lib/browser/{style-wrapper-WGd4Chxy.js → style-wrapper-6gB537kz.js} +1 -1
- package/lib/browser/{style-wrapper-qFjrPlxq.cjs → style-wrapper-toT_b35_.cjs} +1 -1
- package/lib/browser/style.css +1 -1
- package/lib/edge/{awaiter-oif9kJRe.cjs → awaiter-GbCbMdxs.cjs} +1 -1
- package/lib/edge/{awaiter-C9m9dHFI.js → awaiter-Z1Aho-Tf.js} +1 -1
- package/lib/edge/block-wrapper-SGs68mW-.cjs +1 -0
- package/lib/edge/block-wrapper-sP32aCJj.js +50 -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/component-ref-1HNLmjNP.cjs +1 -0
- package/lib/edge/component-ref-v3RKtvga.js +184 -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-iI7YmUch.js → edge/get-block-properties-O8BCJSao.js} +17 -17
- package/lib/edge/get-block-properties-ju6Fj919.cjs +1 -0
- package/lib/edge/{index-HFOGs4Hj.cjs → index-FjhQsct4.cjs} +16 -16
- package/lib/edge/{index-1frz5lkv.js → index-x6Hu33ce.js} +784 -768
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +1 -1
- package/lib/{node/live-edit-aXbmFIfP.cjs → edge/live-edit-VsbDXDK9.cjs} +1 -1
- package/lib/edge/{live-edit-zALqI-9F.js → live-edit-v7-_17wH.js} +1 -1
- package/lib/{node/repeated-block-mSU_Cjr_.js → edge/repeated-block-gmtzy89x.js} +2 -2
- package/lib/edge/{repeated-block-Ee9Tm3uw.cjs → repeated-block-ic1FaN4o.cjs} +1 -1
- package/lib/edge/{style-wrapper-c3dw8riH.js → style-wrapper-DFS-znzq.js} +1 -1
- package/lib/edge/{style-wrapper-4MZw2Z4C.cjs → style-wrapper-Xaty5j6j.cjs} +1 -1
- package/lib/edge/style.css +1 -1
- package/lib/node/{awaiter-zW9jRrYG.cjs → awaiter-7GQ8utUb.cjs} +1 -1
- package/lib/node/{awaiter-excNZ5hj.js → awaiter-MB_eWqp9.js} +1 -1
- package/lib/node/block-wrapper--M33E0VG.cjs +1 -0
- package/lib/node/block-wrapper-P5y87ZAx.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/component-ref-KETj2JRL.cjs +1 -0
- package/lib/node/component-ref-RUGITshe.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-Mb4zG5TJ.js → get-block-properties-Ec9Kj4p7.js} +18 -17
- package/lib/node/get-block-properties-Z9QEqFjm.cjs +1 -0
- package/lib/node/{index-eR1W_62s.js → index-TvY2gce_.js} +696 -894
- package/lib/node/{index-tfY1dYSa.cjs → index-WS6d-d4F.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/node/{live-edit-o65mqvJD.js → live-edit-61Hzovyk.js} +1 -1
- package/lib/{edge/live-edit-Iys2OcAx.cjs → node/live-edit-Jp1PzpUr.cjs} +1 -1
- package/lib/node/{repeated-block-37s5osdr.cjs → repeated-block-9JRCsGOV.cjs} +1 -1
- package/lib/{edge/repeated-block-7Kc2eLpq.js → node/repeated-block-Nh0O2sxg.js} +2 -2
- package/lib/node/should-force-browser-runtime-in-node-ghF-DZhu.js +503 -0
- package/lib/node/should-force-browser-runtime-in-node-xByMtVKh.cjs +48 -0
- package/lib/node/{style-wrapper-3JIrc4dO.cjs → style-wrapper-rXB6kp1P.cjs} +1 -1
- package/lib/node/{style-wrapper-5KYeK0ik.js → style-wrapper-y344qWFp.js} +10 -10
- package/lib/node/style.css +1 -1
- package/package.json +1 -1
- package/lib/browser/block-wrapper-7_N4V3w6.js +0 -44
- package/lib/browser/block-wrapper-RtyEgmfY.cjs +0 -1
- package/lib/browser/component-ref-TD-MkgTS.cjs +0 -1
- package/lib/browser/component-ref-br7lvgH4.js +0 -178
- package/lib/browser/get-block-properties-p2HBwDQ1.cjs +0 -1
- package/lib/browser/index-s0tL4FL7.cjs +0 -334
- package/lib/edge/block-wrapper-WxMXMCAh.js +0 -43
- package/lib/edge/block-wrapper-cR5tGys5.cjs +0 -1
- package/lib/edge/component-ref-m5Kyhqf9.cjs +0 -1
- package/lib/edge/component-ref-v_a0xkUh.js +0 -177
- package/lib/edge/get-block-properties-8MeUldw3.cjs +0 -1
- package/lib/node/block-wrapper-bkv_QgId.js +0 -43
- package/lib/node/block-wrapper-ywFGBqs7.cjs +0 -1
- package/lib/node/component-ref-RVkeY7E2.cjs +0 -1
- package/lib/node/component-ref-nfCUEPmF.js +0 -178
- package/lib/node/get-block-properties-o8p6cp5S.cjs +0 -1
- package/lib/node/should-force-browser-runtime-in-node-1vTKsoso.cjs +0 -48
- package/lib/node/should-force-browser-runtime-in-node-ikxWrCvn.js +0 -277
|
@@ -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-iI7YmUch.js → edge/get-block-properties-O8BCJSao.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-x6Hu33ce.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-FjhQsct4.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;
|