@builder.io/sdk-vue 0.5.5 → 0.5.6-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/package.json +20 -9
- package/packages/_vue2/dist/block-12099f71.js +189 -0
- package/packages/_vue2/dist/block-246063be.cjs +3 -0
- package/packages/_vue2/dist/block-styles-9360f05a.cjs +1 -0
- package/packages/_vue2/dist/block-styles-cfdd1b51.js +79 -0
- package/packages/_vue2/dist/block-wrapper-857a5d4f.cjs +1 -0
- package/packages/_vue2/dist/{block-wrapper.e10d56cd.js → block-wrapper-f852f3a4.js} +19 -16
- package/packages/_vue2/dist/{blocks-wrapper.ab7aade5.cjs → blocks-wrapper-87a5ef9b.cjs} +1 -1
- package/packages/_vue2/dist/{blocks-wrapper.77411b55.js → blocks-wrapper-98241c68.js} +1 -1
- package/packages/_vue2/dist/{component-ref.10096695.js → component-ref-47d34951.js} +29 -21
- package/packages/_vue2/dist/component-ref-b891d36b.cjs +1 -0
- package/packages/_vue2/dist/content-043dd197.cjs +1 -0
- package/packages/_vue2/dist/{content.ecfd43b5.js → content-ab735937.js} +36 -19
- package/packages/_vue2/dist/{css.cd48304d.cjs → css-03a9ebe6.cjs} +1 -1
- package/packages/_vue2/dist/{css.0bf8202b.js → css-8b11bb6e.js} +1 -1
- package/packages/_vue2/dist/enable-editor-04399d8f.cjs +1 -0
- package/packages/_vue2/dist/{enable-editor.e568289e.js → enable-editor-2d8d86f8.js} +28 -22
- package/packages/_vue2/dist/evaluate-6a213bca.cjs +1 -0
- package/packages/_vue2/dist/evaluate-c9d68bff.js +76 -0
- package/packages/_vue2/dist/get-block-actions-2b1bc20b.cjs +1 -0
- package/packages/_vue2/dist/get-block-actions-75e52f20.js +36 -0
- package/packages/_vue2/dist/get-block-properties-0e241c2c.cjs +1 -0
- package/packages/_vue2/dist/{get-block-properties.18d4c9b3.js → get-block-properties-f778ef2a.js} +2 -2
- package/packages/_vue2/dist/get-processed-block-41399170.cjs +1 -0
- package/packages/_vue2/dist/get-processed-block-940605b2.js +46 -0
- package/packages/_vue2/dist/helpers-327ed263.js +16 -0
- package/packages/_vue2/dist/helpers-4efe31ac.cjs +1 -0
- package/packages/_vue2/dist/index-537704ba.cjs +1 -0
- package/packages/_vue2/dist/{index.3df15bff.js → index-a089abc3.js} +590 -538
- package/packages/_vue2/dist/index-c1c356f8.cjs +32 -0
- package/packages/_vue2/dist/index-cc904f8c.js +10 -0
- package/packages/_vue2/dist/{inlined-script.43151e3b.js → inlined-script-5ac8fff7.js} +1 -1
- package/packages/_vue2/dist/{inlined-script.76b5aff1.cjs → inlined-script-73ce088c.cjs} +1 -1
- package/packages/_vue2/dist/inlined-styles-1d50f193.cjs +1 -0
- package/packages/_vue2/dist/{inlined-styles.52264f08.js → inlined-styles-3a327fbd.js} +1 -1
- package/packages/_vue2/dist/{interactive-element.f4f189d5.js → interactive-element-2aec4d6f.js} +12 -10
- package/packages/_vue2/dist/interactive-element-67792031.cjs +1 -0
- package/packages/_vue2/dist/main.cjs +1 -0
- package/packages/_vue2/dist/main.js +29 -0
- package/packages/_vue2/dist/node-runtime-25e8d976.js +93 -0
- package/packages/_vue2/dist/node-runtime-5a567c42.cjs +39 -0
- package/packages/_vue2/dist/repeated-block-5eb2f7c6.cjs +1 -0
- package/packages/_vue2/dist/{repeated-block.7ab5044a.js → repeated-block-a0f25ac2.js} +6 -6
- package/packages/_vue2/dist/src/blocks/columns/columns.vue.d.ts +2 -2
- package/packages/_vue2/dist/src/blocks/symbol/symbol.helpers.d.ts +1 -1
- package/packages/_vue2/dist/src/blocks/symbol/symbol.vue.d.ts +2 -2
- package/packages/_vue2/dist/src/components/block/block.helpers.d.ts +5 -2
- package/packages/_vue2/dist/src/components/block/block.vue.d.ts +2 -4
- package/packages/_vue2/dist/src/components/block/components/block-styles.vue.d.ts +5 -0
- package/packages/_vue2/dist/src/components/block/components/block-wrapper.vue.d.ts +3 -0
- package/packages/_vue2/dist/src/components/block/components/component-ref/component-ref.helpers.d.ts +3 -2
- package/packages/_vue2/dist/src/components/block/components/interactive-element.vue.d.ts +5 -0
- package/packages/_vue2/dist/src/components/blocks/blocks.vue.d.ts +9 -8
- package/packages/_vue2/dist/src/components/content/content.vue.d.ts +1 -0
- package/packages/_vue2/dist/src/components/content-variants/content-variants.types.d.ts +2 -0
- package/packages/_vue2/dist/src/components/content-variants/content-variants.vue.d.ts +3 -0
- package/packages/_vue2/dist/src/functions/evaluate/browser-runtime/browser.d.ts +4 -0
- package/packages/_vue2/dist/src/functions/evaluate/browser-runtime/index.d.ts +1 -0
- package/packages/_vue2/dist/src/functions/evaluate/evaluate.d.ts +6 -7
- package/packages/_vue2/dist/src/functions/evaluate/helpers.d.ts +18 -0
- package/packages/_vue2/dist/src/functions/evaluate/node-runtime/index.d.ts +1 -0
- package/packages/_vue2/dist/src/functions/evaluate/node-runtime/node-runtime.d.ts +2 -0
- package/packages/_vue2/dist/src/functions/fetch-builder-props.d.ts +39 -0
- package/packages/_vue2/dist/src/functions/get-block-actions-handler.d.ts +2 -5
- package/packages/_vue2/dist/src/functions/get-block-actions.d.ts +3 -3
- package/packages/_vue2/dist/src/functions/get-content/index.d.ts +20 -3
- package/packages/_vue2/dist/src/functions/get-processed-block.d.ts +5 -3
- package/packages/_vue2/dist/src/index-helpers/blocks-exports.d.ts +86 -2
- package/packages/_vue2/dist/src/index.d.ts +2 -1
- package/packages/_vue2/dist/src/types/builder-props.d.ts +15 -3
- package/packages/_vue2/dist/style.css +1 -1
- package/packages/_vue2/dist/{styles.2f94fa2c.js → styles-183aeb6b.js} +18 -18
- package/packages/_vue2/dist/{styles.4af0e072.cjs → styles-6e2cbe10.cjs} +5 -5
- package/packages/_vue3/dist/{block-wrapper.e41532b2.cjs → block-wrapper.500b81ef.cjs} +1 -1
- package/packages/_vue3/dist/{block-wrapper.d098d5ab.js → block-wrapper.5ca35adf.js} +2 -2
- package/packages/_vue3/dist/{component-ref.c6b3162f.js → component-ref.5764cdf2.js} +2 -2
- package/packages/_vue3/dist/{component-ref.33e78959.cjs → component-ref.67d028bc.cjs} +1 -1
- package/packages/_vue3/dist/{get-block-actions.fb7173e7.js → get-block-actions.0f635805.js} +1 -1
- package/packages/_vue3/dist/{get-block-actions.b792830e.cjs → get-block-actions.20d51d99.cjs} +1 -1
- package/packages/_vue3/dist/index.0db0f592.cjs +69 -0
- package/packages/_vue3/dist/{index.3d2e7780.js → index.f5a3101b.js} +607 -553
- package/packages/_vue3/dist/node-runtime.ba895a23.cjs +39 -0
- package/packages/_vue3/dist/node-runtime.dc2f1f18.js +93 -0
- package/packages/{_vue2/dist/non-node-runtime.ea934f1b.js → _vue3/dist/non-node-runtime.45773de4.js} +62 -64
- package/packages/_vue3/dist/{non-node-runtime.52df390c.cjs → non-node-runtime.c8fc465e.cjs} +8 -8
- package/packages/_vue3/dist/{repeated-block.b2f15408.js → repeated-block.238616b4.js} +2 -2
- package/packages/_vue3/dist/{repeated-block.af26c825.cjs → repeated-block.8ca9be30.cjs} +1 -1
- package/packages/_vue3/dist/sdk.cjs +1 -1
- package/packages/_vue3/dist/sdk.js +24 -19
- package/packages/_vue3/dist/src/blocks/symbol/symbol.helpers.d.ts +1 -1
- package/packages/_vue3/dist/src/functions/evaluate/browser-runtime/browser.d.ts +4 -0
- package/packages/_vue3/dist/src/functions/evaluate/browser-runtime/index.d.ts +1 -0
- package/packages/_vue3/dist/src/functions/evaluate/evaluate.d.ts +1 -5
- package/packages/_vue3/dist/src/functions/evaluate/helpers.d.ts +18 -0
- package/packages/{_vue2/dist/src/functions/evaluate/non-node-runtime → _vue3/dist/src/functions/evaluate/node-runtime}/index.d.ts +2 -2
- package/packages/_vue3/dist/src/functions/evaluate/node-runtime/node-runtime.d.ts +2 -0
- package/packages/_vue3/dist/src/functions/evaluate/non-node-runtime/non-node-runtime.d.ts +2 -2
- package/packages/_vue3/dist/src/functions/fetch-builder-props.d.ts +39 -0
- package/packages/_vue3/dist/src/functions/get-content/index.d.ts +20 -3
- package/packages/_vue3/dist/src/index-helpers/blocks-exports.d.ts +103 -2
- package/packages/_vue3/dist/src/index.d.ts +2 -1
- package/packages/_vue3/dist/style.css +1 -1
- package/packages/_vue2/dist/block-styles.551cd02d.js +0 -78
- package/packages/_vue2/dist/block-styles.a0d753a9.cjs +0 -1
- package/packages/_vue2/dist/block-wrapper.1275badd.cjs +0 -1
- package/packages/_vue2/dist/block.4281b61f.js +0 -179
- package/packages/_vue2/dist/block.b03a0eae.cjs +0 -3
- package/packages/_vue2/dist/component-ref.9d208992.cjs +0 -1
- package/packages/_vue2/dist/content.6d11463c.cjs +0 -1
- package/packages/_vue2/dist/enable-editor.4e78f6ed.cjs +0 -1
- package/packages/_vue2/dist/evaluate.7dcb5aad.cjs +0 -4
- package/packages/_vue2/dist/evaluate.f8bc6419.js +0 -79
- package/packages/_vue2/dist/get-block-actions.26e982e0.js +0 -36
- package/packages/_vue2/dist/get-block-actions.413b41fb.cjs +0 -1
- package/packages/_vue2/dist/get-block-properties.48e54355.cjs +0 -1
- package/packages/_vue2/dist/get-processed-block.a838cbff.cjs +0 -1
- package/packages/_vue2/dist/get-processed-block.d6b8a3e9.js +0 -53
- package/packages/_vue2/dist/index.9cfd3074.cjs +0 -32
- package/packages/_vue2/dist/inlined-styles.fc33e3c1.cjs +0 -1
- package/packages/_vue2/dist/interactive-element.5d4dffa8.cjs +0 -1
- package/packages/_vue2/dist/non-node-runtime.59649ad7.cjs +0 -21
- package/packages/_vue2/dist/repeated-block.c74eee80.cjs +0 -1
- package/packages/_vue2/dist/sdk.cjs +0 -1
- package/packages/_vue2/dist/sdk.js +0 -24
- package/packages/_vue2/dist/set.87eb0329.cjs +0 -1
- package/packages/_vue2/dist/set.b219ab0e.js +0 -9
- package/packages/_vue2/dist/src/functions/evaluate/non-node-runtime/non-node-runtime.d.ts +0 -2
- package/packages/_vue2/dist/src/functions/evaluate/types.d.ts +0 -11
- package/packages/_vue3/dist/index.d92378a5.cjs +0 -72
- package/packages/_vue3/dist/non-node-runtime.d120625e.js +0 -2476
- package/packages/_vue3/dist/src/functions/evaluate/acorn-interpreter.d.ts +0 -2
- package/packages/_vue3/dist/src/functions/evaluate/types.d.ts +0 -11
- /package/packages/_vue2/dist/{sdk.d.ts → index.d.ts} +0 -0
- /package/packages/{_vue2/dist/src/functions/evaluate → _vue3/dist/src/functions/evaluate/non-node-runtime}/acorn-interpreter.d.ts +0 -0
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { defineComponent as p } from "vue";
|
|
2
|
-
import { n as u,
|
|
2
|
+
import { n as u, d as y, e as x, B as v, C as S, F as _, I as T, S as I, h as C, j as w, V as k, k as F, m, s as g, T as R, o as E } from "./index-a089abc3.js";
|
|
3
3
|
const V = {
|
|
4
4
|
name: "Core:Button",
|
|
5
5
|
image: "https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13",
|
|
6
6
|
defaultStyles: {
|
|
7
|
+
// TODO: make min width more intuitive and set one
|
|
7
8
|
appearance: "none",
|
|
8
9
|
paddingTop: "15px",
|
|
9
10
|
paddingBottom: "15px",
|
|
@@ -33,6 +34,7 @@ const V = {
|
|
|
33
34
|
static: !0,
|
|
34
35
|
noWrap: !0
|
|
35
36
|
}, A = {
|
|
37
|
+
// TODO: ways to statically preprocess JSON for references, functions, etc
|
|
36
38
|
name: "Columns",
|
|
37
39
|
isRSC: !0,
|
|
38
40
|
inputs: [{
|
|
@@ -210,7 +212,7 @@ const V = {
|
|
|
210
212
|
});
|
|
211
213
|
}
|
|
212
214
|
const n = e.get("columns");
|
|
213
|
-
Array.isArray(n) &&
|
|
215
|
+
Array.isArray(n) && n.find((i) => i.get("width")) && (n.find((l) => !l.get("width")) || n.reduce((r, s) => r + s.get("width"), 0) !== 100) && t();
|
|
214
216
|
}
|
|
215
217
|
}, {
|
|
216
218
|
name: "space",
|
|
@@ -261,13 +263,13 @@ const V = {
|
|
|
261
263
|
function n(o, r = 6e4) {
|
|
262
264
|
return new Promise((s, c) => {
|
|
263
265
|
const d = document.createElement("img");
|
|
264
|
-
let
|
|
266
|
+
let h = !1;
|
|
265
267
|
d.onload = () => {
|
|
266
|
-
|
|
267
|
-
}, d.addEventListener("error", (
|
|
268
|
-
console.warn("Image load failed",
|
|
268
|
+
h = !0, s(d);
|
|
269
|
+
}, d.addEventListener("error", (f) => {
|
|
270
|
+
console.warn("Image load failed", f.error), c(f.error);
|
|
269
271
|
}), d.src = o, setTimeout(() => {
|
|
270
|
-
|
|
272
|
+
h || c(new Error("Image load timed out"));
|
|
271
273
|
}, r);
|
|
272
274
|
});
|
|
273
275
|
}
|
|
@@ -577,20 +579,20 @@ const V = {
|
|
|
577
579
|
}
|
|
578
580
|
}
|
|
579
581
|
});
|
|
580
|
-
var
|
|
582
|
+
var M = function() {
|
|
581
583
|
var t = this, n = t._self._c;
|
|
582
584
|
return t._self._setupProxy, n("div", { ref: "elem", staticClass: "builder-embed", domProps: { innerHTML: t._s(t.content) } });
|
|
583
|
-
},
|
|
585
|
+
}, q = [], B = /* @__PURE__ */ u(
|
|
584
586
|
N,
|
|
587
|
+
M,
|
|
585
588
|
q,
|
|
586
|
-
B,
|
|
587
589
|
!1,
|
|
588
590
|
null,
|
|
589
591
|
null,
|
|
590
592
|
null,
|
|
591
593
|
null
|
|
592
594
|
);
|
|
593
|
-
const K =
|
|
595
|
+
const K = B.exports, O = p({
|
|
594
596
|
name: "builder-img-component",
|
|
595
597
|
props: [
|
|
596
598
|
"backgroundSize",
|
|
@@ -621,6 +623,7 @@ var J = function() {
|
|
|
621
623
|
null
|
|
622
624
|
);
|
|
623
625
|
const X = G.exports, Q = {
|
|
626
|
+
// friendlyName?
|
|
624
627
|
name: "Raw:Img",
|
|
625
628
|
hideFromInsertMenu: !0,
|
|
626
629
|
image: "https://firebasestorage.googleapis.com/v0/b/builder-3b0a2.appspot.com/o/images%2Fbaseline-insert_photo-24px.svg?alt=media&token=4e5d0ef4-f5e8-4e57-b3a9-38d63a9b9dc4",
|
|
@@ -760,7 +763,7 @@ const ae = ne.exports, oe = {
|
|
|
760
763
|
const a = {};
|
|
761
764
|
(o = (l = e == null ? void 0 : e.data) == null ? void 0 : l.inputs) == null || o.forEach((s) => {
|
|
762
765
|
var c;
|
|
763
|
-
s.name && s.defaultValue !== void 0 && ((c = e == null ? void 0 : e.data)
|
|
766
|
+
s.name && s.defaultValue !== void 0 && ((c = e == null ? void 0 : e.data) != null && c.state) && e.data.state[s.name] === void 0 && (a[s.name] = s.defaultValue);
|
|
764
767
|
});
|
|
765
768
|
const i = {
|
|
766
769
|
...(r = e == null ? void 0 : e.data) == null ? void 0 : r.state,
|
|
@@ -783,22 +786,22 @@ const ae = ne.exports, oe = {
|
|
|
783
786
|
...t
|
|
784
787
|
},
|
|
785
788
|
meta: e == null ? void 0 : e.meta
|
|
786
|
-
} : void 0, se = () => import("./index.
|
|
789
|
+
} : void 0, se = () => import("./index-a089abc3.js").then((e) => e.M).then((e) => e.default).catch((e) => {
|
|
787
790
|
throw console.error(
|
|
788
791
|
"Error while attempting to dynamically import component Blocks at ../blocks/blocks.vue",
|
|
789
792
|
e
|
|
790
793
|
), e;
|
|
791
|
-
}), le = () => import("./styles.
|
|
794
|
+
}), le = () => import("./styles-183aeb6b.js").then((e) => e.default).catch((e) => {
|
|
792
795
|
throw console.error(
|
|
793
796
|
"Error while attempting to dynamically import component ContentStyles at ./components/styles.vue",
|
|
794
797
|
e
|
|
795
798
|
), e;
|
|
796
|
-
}), ce = () => import("./enable-editor.
|
|
799
|
+
}), ce = () => import("./enable-editor-2d8d86f8.js").then((e) => e.default).catch((e) => {
|
|
797
800
|
throw console.error(
|
|
798
801
|
"Error while attempting to dynamically import component EnableEditor at ./components/enable-editor.vue",
|
|
799
802
|
e
|
|
800
803
|
), e;
|
|
801
|
-
}), de = () => import("./inlined-script.
|
|
804
|
+
}), de = () => import("./inlined-script-5ac8fff7.js").then((e) => e.default).catch((e) => {
|
|
802
805
|
throw console.error(
|
|
803
806
|
"Error while attempting to dynamically import component InlinedScript at ../inlined-script.vue",
|
|
804
807
|
e
|
|
@@ -825,18 +828,26 @@ const ae = ne.exports, oe = {
|
|
|
825
828
|
"enrich",
|
|
826
829
|
"classNameProp",
|
|
827
830
|
"showContent",
|
|
831
|
+
"serverExecutor",
|
|
828
832
|
"isSsrAbTest"
|
|
829
833
|
],
|
|
830
834
|
data() {
|
|
831
835
|
var e, t;
|
|
832
836
|
return {
|
|
833
837
|
scriptStr: F({
|
|
838
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
834
839
|
variationId: (e = this.content) == null ? void 0 : e.testVariationId,
|
|
840
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion, @typescript-eslint/no-non-null-asserted-optional-chain
|
|
835
841
|
contentId: (t = this.content) == null ? void 0 : t.id
|
|
836
842
|
}),
|
|
837
843
|
registeredComponents: [
|
|
838
844
|
...b(),
|
|
839
|
-
|
|
845
|
+
// While this `components` object is deprecated, we must maintain support for it.
|
|
846
|
+
// Since users are able to override our default components, we need to make sure that we do not break such
|
|
847
|
+
// existing usage.
|
|
848
|
+
// This is why we spread `components` after the default Builder.io components, but before the `props.customComponents`,
|
|
849
|
+
// which is the new standard way of providing custom components, and must therefore take precedence.
|
|
850
|
+
...m,
|
|
840
851
|
...this.customComponents || []
|
|
841
852
|
].reduce(
|
|
842
853
|
(n, { component: a, ...i }) => ({
|
|
@@ -865,7 +876,12 @@ const ae = ne.exports, oe = {
|
|
|
865
876
|
apiVersion: this.apiVersion,
|
|
866
877
|
componentInfos: [
|
|
867
878
|
...b(),
|
|
868
|
-
|
|
879
|
+
// While this `components` object is deprecated, we must maintain support for it.
|
|
880
|
+
// Since users are able to override our default components, we need to make sure that we do not break such
|
|
881
|
+
// existing usage.
|
|
882
|
+
// This is why we spread `components` after the default Builder.io components, but before the `props.customComponents`,
|
|
883
|
+
// which is the new standard way of providing custom components, and must therefore take precedence.
|
|
884
|
+
...m,
|
|
869
885
|
...this.customComponents || []
|
|
870
886
|
].reduce(
|
|
871
887
|
(n, { component: a, ...i }) => ({
|
|
@@ -876,6 +892,7 @@ const ae = ne.exports, oe = {
|
|
|
876
892
|
),
|
|
877
893
|
inheritedStyles: {}
|
|
878
894
|
},
|
|
895
|
+
components: m,
|
|
879
896
|
TARGET: R
|
|
880
897
|
};
|
|
881
898
|
},
|
|
@@ -896,7 +913,7 @@ const ae = ne.exports, oe = {
|
|
|
896
913
|
var ue = function() {
|
|
897
914
|
var a, i, l, o, r, s, c;
|
|
898
915
|
var t = this, n = t._self._c;
|
|
899
|
-
return t._self._setupProxy, n("enable-editor", t._b({ attrs: { content: t.content, model: t.model, context: t.context, apiKey: t.apiKey, canTrack: t.canTrack, locale: t.locale, includeRefs: t.includeRefs, enrich: t.enrich, classNameProp: t.classNameProp, showContent: t.showContent, builderContextSignal: t.builderContextSignal } }, "enable-editor", {}, !1), [t.isSsrAbTest ? [n("inlined-script", { attrs: { scriptStr: t.scriptStr } })] : t._e(), t.TARGET !== "reactNative" ? [n("content-styles", { attrs: { contentId: (a = t.builderContextSignal.content) == null ? void 0 : a.id, cssCode: (l = (i = t.builderContextSignal.content) == null ? void 0 : i.data) == null ? void 0 : l.cssCode, customFonts: (r = (o = t.builderContextSignal.content) == null ? void 0 : o.data) == null ? void 0 : r.customFonts } })] : t._e(), n("blocks", { attrs: { blocks: (c = (s = t.builderContextSignal.content) == null ? void 0 : s.data) == null ? void 0 : c.blocks, context: t.builderContextSignal,
|
|
916
|
+
return t._self._setupProxy, n("enable-editor", t._b({ attrs: { content: t.content, model: t.model, context: t.context, apiKey: t.apiKey, canTrack: t.canTrack, locale: t.locale, includeRefs: t.includeRefs, enrich: t.enrich, classNameProp: t.classNameProp, showContent: t.showContent, builderContextSignal: t.builderContextSignal, serverExecutor: t.serverExecutor } }, "enable-editor", {}, !1), [t.isSsrAbTest ? [n("inlined-script", { attrs: { scriptStr: t.scriptStr } })] : t._e(), t.TARGET !== "reactNative" ? [n("content-styles", { attrs: { contentId: (a = t.builderContextSignal.content) == null ? void 0 : a.id, cssCode: (l = (i = t.builderContextSignal.content) == null ? void 0 : i.data) == null ? void 0 : l.cssCode, customFonts: (r = (o = t.builderContextSignal.content) == null ? void 0 : o.data) == null ? void 0 : r.customFonts } })] : t._e(), n("blocks", { attrs: { blocks: (c = (s = t.builderContextSignal.content) == null ? void 0 : s.data) == null ? void 0 : c.blocks, context: t.builderContextSignal, components: t.registeredComponents, serverExecutor: t.serverExecutor } })], 2);
|
|
900
917
|
}, me = [], he = /* @__PURE__ */ u(
|
|
901
918
|
pe,
|
|
902
919
|
ue,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const n=require("./index.
|
|
1
|
+
"use strict";const n=require("./index-c1c356f8.cjs"),o=e=>e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase(),c=e=>Object.entries(e).map(([r,s])=>{if(typeof s=="string")return`${o(r)}: ${s};`}).filter(n.checkIsDefined),a=e=>c(e).join(`
|
|
2
2
|
`),i=({mediaQuery:e,className:t,styles:r})=>{const s=`.${t} {
|
|
3
3
|
${a(r)}
|
|
4
4
|
}`;return e?`${e} {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as o } from "./index.
|
|
1
|
+
import { c as o } from "./index-a089abc3.js";
|
|
2
2
|
const c = (s) => s.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase(), n = (s) => Object.entries(s).map(([r, e]) => {
|
|
3
3
|
if (typeof e == "string")
|
|
4
4
|
return `${c(r)}: ${e};`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("vue"),p=require("./evaluate-6a213bca.cjs"),r=require("./index-c1c356f8.cjs");require("./helpers-4efe31ac.cjs");const v="UNKNOWN_VERSION",x=()=>{r.register("insertMenu",{name:"_default",default:!0,items:[{name:"Box"},{name:"Text"},{name:"Image"},{name:"Columns"},{name:"Core:Section"},{name:"Core:Button"},{name:"Embed"},{name:"Custom Code"}]})};let m=!1;const k=(n={})=>{var e,t;m||(m=!0,r.isBrowser()&&((e=window.parent)==null||e.postMessage({type:"builder.sdkInfo",data:{target:r.TARGET,version:v,supportsPatchUpdates:!1,supportsAddBlockScoping:!0,supportsCustomBreakpoints:!0}},"*"),(t=window.parent)==null||t.postMessage({type:"builder.updateContent",data:{options:n}},"*"),window.addEventListener("message",({data:i})=>{var o,s;if(i!=null&&i.type)switch(i.type){case"builder.evaluate":{const a=i.data.text,b=i.data.arguments||[],c=i.data.id,S=new Function(a);let d,l=null;try{d=S.apply(null,b)}catch(u){l=u}l?(o=window.parent)==null||o.postMessage({type:"builder.evaluateError",data:{id:c,error:l.message}},"*"):d&&typeof d.then=="function"?d.then(u=>{var h;(h=window.parent)==null||h.postMessage({type:"builder.evaluateResult",data:{id:c,result:u}},"*")}).catch(console.error):(s=window.parent)==null||s.postMessage({type:"builder.evaluateResult",data:{result:d,id:c}},"*");break}}})))};function f(n){return Math.round(n*1e3)/1e3}const R=(n,e,t=!0)=>{if(!(n instanceof HTMLElement))return null;let i=t?n:n.parentElement;do{if(!i)return null;if(e(i))return i}while(i=i.parentElement);return null},y=n=>R(n,e=>{const t=e.getAttribute("builder-id")||e.id;return(t==null?void 0:t.indexOf("builder-"))===0}),g=({event:n,target:e})=>{const t=e.getBoundingClientRect(),i=n.clientX-t.left,o=n.clientY-t.top,s=f(i/t.width),a=f(o/t.height);return{x:s,y:a}},w=n=>{const e=n.target,t=e&&y(e),i=(t==null?void 0:t.getAttribute("builder-id"))||(t==null?void 0:t.id);return{targetBuilderElement:i||void 0,metadata:{targetOffset:e?g({event:n,target:e}):void 0,builderTargetOffset:t?g({event:n,target:t}):void 0,builderElementIndex:t&&i?[].slice.call(document.getElementsByClassName(i)).indexOf(t):void 0}}},E=C.defineComponent({name:"enable-editor",props:["canTrack","builderContextSignal","model","context","serverExecutor","apiKey","showContent","classNameProp","content","locale","includeRefs","enrich"],data(){return{canTrackToUse:r.checkIsDefined(this.canTrack)?this.canTrack:!0,forceReRenderCount:0,lastUpdated:0,shouldSendResetCookie:!1,httpReqsData:{},clicked:!1,builderContext:r.builderContext}},provide(){const n=this;return{[r.builderContext.key]:n.builderContextSignal}},mounted(){var n,e;if(this.apiKey||r.logger.error("No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."),r.isBrowser()){if(r.isEditing()&&(this.forceReRenderCount=this.forceReRenderCount+1,window.addEventListener("message",this.processMessage),x(),k({...this.locale?{locale:this.locale}:{},...this.includeRefs?{includeRefs:this.includeRefs}:{},...this.enrich?{enrich:this.enrich}:{}}),Object.values(this.builderContextSignal.componentInfos).forEach(t=>{var o;const i=r.createRegisterComponentMessage(t);(o=window.parent)==null||o.postMessage(i,"*")}),window.addEventListener("builder:component:stateChangeListenerActivated",this.emitStateUpdate)),this.builderContextSignal.content){const t=(n=this.builderContextSignal.content)==null?void 0:n.testVariationId,i=(e=this.builderContextSignal.content)==null?void 0:e.id;r._track({type:"impression",canTrack:this.canTrackToUse,contentId:i,apiKey:this.apiKey,variationId:t!==i?t:void 0})}if(r.isPreviewing()){const t=new URL(location.href).searchParams,i=t.get("builder.preview"),o=t.get(`builder.preview.${i}`),s=t.get("apiKey")||t.get("builder.space");i===this.model&&s===this.apiKey&&(!this.content||o===this.content.id)&&r.fetchOneEntry({model:this.model,apiKey:this.apiKey,apiVersion:this.builderContextSignal.apiVersion}).then(a=>{a&&this.mergeNewContent(a)})}this.evaluateJsCode(),this.runHttpRequests(),this.emitStateUpdate()}},watch:{onUpdateHook0:{handler(){this.content&&this.mergeNewContent(this.content)},immediate:!0},onUpdateHook1:{handler(){},immediate:!0},onUpdateHook2:{handler(){this.evaluateJsCode()},immediate:!0},onUpdateHook3:{handler(){this.runHttpRequests()},immediate:!0},onUpdateHook4:{handler(){this.emitStateUpdate()},immediate:!0}},unmounted(){r.isBrowser()&&(window.removeEventListener("message",this.processMessage),window.removeEventListener("builder:component:stateChangeListenerActivated",this.emitStateUpdate))},computed:{onUpdateHook0(){return{0:this.content}},onUpdateHook1(){return{0:this.shouldSendResetCookie}},onUpdateHook2(){var n,e;return{0:(e=(n=this.builderContextSignal.content)==null?void 0:n.data)==null?void 0:e.jsCode,1:this.builderContextSignal.rootState}},onUpdateHook3(){var n,e;return{0:(e=(n=this.builderContextSignal.content)==null?void 0:n.data)==null?void 0:e.httpRequests}},onUpdateHook4(){return{0:this.builderContextSignal.rootState}}},methods:{mergeNewContent(n){var t,i,o,s,a;const e={...this.builderContextSignal.content,...n,data:{...(t=this.builderContextSignal.content)==null?void 0:t.data,...n==null?void 0:n.data},meta:{...(i=this.builderContextSignal.content)==null?void 0:i.meta,...n==null?void 0:n.meta,breakpoints:((o=n==null?void 0:n.meta)==null?void 0:o.breakpoints)||((a=(s=this.builderContextSignal.content)==null?void 0:s.meta)==null?void 0:a.breakpoints)}};this.builderContextSignal.content=e},processMessage(n){var t;const{data:e}=n;if(e)switch(e.type){case"builder.configureSdk":{const i=e.data,{breakpoints:o,contentId:s}=i;if(!s||s!==((t=this.builderContextSignal.content)==null?void 0:t.id))return;o&&this.mergeNewContent({meta:{breakpoints:o}}),this.forceReRenderCount=this.forceReRenderCount+1;break}case"builder.contentUpdate":{const i=e.data,o=i.key||i.alias||i.entry||i.modelName,s=i.data;o===this.model&&(this.mergeNewContent(s),this.forceReRenderCount=this.forceReRenderCount+1);break}}},evaluateJsCode(){var e,t;const n=(t=(e=this.builderContextSignal.content)==null?void 0:e.data)==null?void 0:t.jsCode;n&&p.evaluate({code:n,context:this.context||{},localState:void 0,rootState:this.builderContextSignal.rootState,rootSetState:this.builderContextSignal.rootSetState,serverExecutor:this.serverExecutor})},onClick(n){var e,t;if(this.builderContextSignal.content){const i=(e=this.builderContextSignal.content)==null?void 0:e.testVariationId,o=(t=this.builderContextSignal.content)==null?void 0:t.id;r._track({type:"click",canTrack:this.canTrackToUse,contentId:o,apiKey:this.apiKey,variationId:i!==o?i:void 0,...w(n),unique:!this.clicked})}this.clicked||(this.clicked=!0)},evalExpression(n){return n.replace(/{{([^}]+)}}/g,(e,t)=>p.evaluate({code:t,context:this.context||{},localState:void 0,rootState:this.builderContextSignal.rootState,rootSetState:this.builderContextSignal.rootSetState,serverExecutor:this.serverExecutor}))},handleRequest({url:n,key:e}){r.fetch(n).then(t=>t.json()).then(t=>{var o,s;const i={...this.builderContextSignal.rootState,[e]:t};(s=(o=this.builderContextSignal).rootSetState)==null||s.call(o,i),this.httpReqsData[e]=!0}).catch(t=>{console.error("error fetching dynamic data",n,t)})},runHttpRequests(){var e,t;const n=((t=(e=this.builderContextSignal.content)==null?void 0:e.data)==null?void 0:t.httpRequests)??{};Object.entries(n).forEach(([i,o])=>{if(o&&(!this.httpReqsData[i]||r.isEditing())){const s=this.evalExpression(o);this.handleRequest({url:s,key:i})}})},emitStateUpdate(){r.isEditing()&&window.dispatchEvent(new CustomEvent("builder:component:stateChange",{detail:{state:this.builderContextSignal.rootState,ref:{name:this.model}}}))},_classStringToObject(n){const e={};if(typeof n!="string")return e;const t=n.trim().split(/\s+/);for(const i of t)e[i]=!0;return e}}});var _=function(){var i;var e=this,t=e._self._c;return e._self._setupProxy,e.builderContextSignal.content?t("div",e._b({key:e.forceReRenderCount,ref:"elementRef",class:e._classStringToObject(e.classNameProp),attrs:{"builder-content-id":(i=e.builderContextSignal.content)==null?void 0:i.id,"builder-model":e.model},on:{click:function(o){return e.onClick(o)}}},"div",{...e.showContent?{}:{hidden:!0,"aria-hidden":!0}},!1),[e._t("default")],2):e._e()},U=[],I=r.normalizeComponent(E,_,U,!1,null,null,null,null);const T=I.exports;exports.default=T;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { defineComponent as R } from "vue";
|
|
2
|
-
import { e as m } from "./evaluate.
|
|
3
|
-
import { r as k, i as h, T as y, c as w,
|
|
2
|
+
import { e as m } from "./evaluate-c9d68bff.js";
|
|
3
|
+
import { r as k, i as h, T as y, c as w, p as f, l as E, d as u, _ as g, q as _, t as U, u as I, v as T, n as P } from "./index-a089abc3.js";
|
|
4
|
+
import "./helpers-327ed263.js";
|
|
4
5
|
const N = "UNKNOWN_VERSION", M = () => {
|
|
5
6
|
k("insertMenu", {
|
|
6
7
|
name: "_default",
|
|
@@ -25,7 +26,7 @@ const N = "UNKNOWN_VERSION", M = () => {
|
|
|
25
26
|
});
|
|
26
27
|
};
|
|
27
28
|
let b = !1;
|
|
28
|
-
const
|
|
29
|
+
const O = (n = {}) => {
|
|
29
30
|
var e, t;
|
|
30
31
|
b || (b = !0, h() && ((e = window.parent) == null || e.postMessage({
|
|
31
32
|
type: "builder.sdkInfo",
|
|
@@ -33,6 +34,8 @@ const H = (n = {}) => {
|
|
|
33
34
|
target: y,
|
|
34
35
|
version: N,
|
|
35
36
|
supportsPatchUpdates: !1,
|
|
37
|
+
// Supports builder-model="..." attribute which is needed to
|
|
38
|
+
// scope our '+ add block' button styling
|
|
36
39
|
supportsAddBlockScoping: !0,
|
|
37
40
|
supportsCustomBreakpoints: !0
|
|
38
41
|
}
|
|
@@ -45,7 +48,7 @@ const H = (n = {}) => {
|
|
|
45
48
|
data: i
|
|
46
49
|
}) => {
|
|
47
50
|
var o, s;
|
|
48
|
-
if (
|
|
51
|
+
if (i != null && i.type)
|
|
49
52
|
switch (i.type) {
|
|
50
53
|
case "builder.evaluate": {
|
|
51
54
|
const a = i.data.text, x = i.data.arguments || [], d = i.data.id, v = new Function(a);
|
|
@@ -85,7 +88,7 @@ const H = (n = {}) => {
|
|
|
85
88
|
function S(n) {
|
|
86
89
|
return Math.round(n * 1e3) / 1e3;
|
|
87
90
|
}
|
|
88
|
-
const
|
|
91
|
+
const H = (n, e, t = !0) => {
|
|
89
92
|
if (!(n instanceof HTMLElement))
|
|
90
93
|
return null;
|
|
91
94
|
let i = t ? n : n.parentElement;
|
|
@@ -96,9 +99,9 @@ const K = (n, e, t = !0) => {
|
|
|
96
99
|
return i;
|
|
97
100
|
} while (i = i.parentElement);
|
|
98
101
|
return null;
|
|
99
|
-
},
|
|
102
|
+
}, K = (n) => H(n, (e) => {
|
|
100
103
|
const t = e.getAttribute("builder-id") || e.id;
|
|
101
|
-
return
|
|
104
|
+
return (t == null ? void 0 : t.indexOf("builder-")) === 0;
|
|
102
105
|
}), C = ({
|
|
103
106
|
event: n,
|
|
104
107
|
target: e
|
|
@@ -109,7 +112,7 @@ const K = (n, e, t = !0) => {
|
|
|
109
112
|
y: a
|
|
110
113
|
};
|
|
111
114
|
}, q = (n) => {
|
|
112
|
-
const e = n.target, t = e &&
|
|
115
|
+
const e = n.target, t = e && K(e), i = (t == null ? void 0 : t.getAttribute("builder-id")) || (t == null ? void 0 : t.id);
|
|
113
116
|
return {
|
|
114
117
|
targetBuilderElement: i || void 0,
|
|
115
118
|
metadata: {
|
|
@@ -131,6 +134,7 @@ const K = (n, e, t = !0) => {
|
|
|
131
134
|
"builderContextSignal",
|
|
132
135
|
"model",
|
|
133
136
|
"context",
|
|
137
|
+
"serverExecutor",
|
|
134
138
|
"apiKey",
|
|
135
139
|
"showContent",
|
|
136
140
|
"classNameProp",
|
|
@@ -158,10 +162,10 @@ const K = (n, e, t = !0) => {
|
|
|
158
162
|
},
|
|
159
163
|
mounted() {
|
|
160
164
|
var n, e;
|
|
161
|
-
if (this.apiKey ||
|
|
165
|
+
if (this.apiKey || E.error(
|
|
162
166
|
"No API key provided to `RenderContent` component. This can cause issues. Please provide an API key using the `apiKey` prop."
|
|
163
167
|
), h()) {
|
|
164
|
-
if (u() && (this.forceReRenderCount = this.forceReRenderCount + 1, window.addEventListener("message", this.processMessage), M(),
|
|
168
|
+
if (u() && (this.forceReRenderCount = this.forceReRenderCount + 1, window.addEventListener("message", this.processMessage), M(), O({
|
|
165
169
|
...this.locale ? {
|
|
166
170
|
locale: this.locale
|
|
167
171
|
} : {},
|
|
@@ -190,7 +194,7 @@ const K = (n, e, t = !0) => {
|
|
|
190
194
|
variationId: t !== i ? t : void 0
|
|
191
195
|
});
|
|
192
196
|
}
|
|
193
|
-
if (
|
|
197
|
+
if (_()) {
|
|
194
198
|
const t = new URL(location.href).searchParams, i = t.get("builder.preview"), o = t.get(
|
|
195
199
|
`builder.preview.${i}`
|
|
196
200
|
), s = t.get("apiKey") || t.get("builder.space");
|
|
@@ -318,7 +322,8 @@ const K = (n, e, t = !0) => {
|
|
|
318
322
|
context: this.context || {},
|
|
319
323
|
localState: void 0,
|
|
320
324
|
rootState: this.builderContextSignal.rootState,
|
|
321
|
-
rootSetState: this.builderContextSignal.rootSetState
|
|
325
|
+
rootSetState: this.builderContextSignal.rootSetState,
|
|
326
|
+
serverExecutor: this.serverExecutor
|
|
322
327
|
});
|
|
323
328
|
},
|
|
324
329
|
onClick(n) {
|
|
@@ -345,7 +350,8 @@ const K = (n, e, t = !0) => {
|
|
|
345
350
|
context: this.context || {},
|
|
346
351
|
localState: void 0,
|
|
347
352
|
rootState: this.builderContextSignal.rootState,
|
|
348
|
-
rootSetState: this.builderContextSignal.rootSetState
|
|
353
|
+
rootSetState: this.builderContextSignal.rootSetState,
|
|
354
|
+
serverExecutor: this.serverExecutor
|
|
349
355
|
})
|
|
350
356
|
);
|
|
351
357
|
},
|
|
@@ -362,14 +368,14 @@ const K = (n, e, t = !0) => {
|
|
|
362
368
|
});
|
|
363
369
|
},
|
|
364
370
|
runHttpRequests() {
|
|
365
|
-
var e, t
|
|
366
|
-
const n = (
|
|
367
|
-
Object.entries(n).forEach(([
|
|
368
|
-
if (
|
|
369
|
-
const
|
|
371
|
+
var e, t;
|
|
372
|
+
const n = ((t = (e = this.builderContextSignal.content) == null ? void 0 : e.data) == null ? void 0 : t.httpRequests) ?? {};
|
|
373
|
+
Object.entries(n).forEach(([i, o]) => {
|
|
374
|
+
if (o && (!this.httpReqsData[i] || u())) {
|
|
375
|
+
const s = this.evalExpression(o);
|
|
370
376
|
this.handleRequest({
|
|
371
|
-
url:
|
|
372
|
-
key:
|
|
377
|
+
url: s,
|
|
378
|
+
key: i
|
|
373
379
|
});
|
|
374
380
|
}
|
|
375
381
|
});
|
|
@@ -421,7 +427,7 @@ var A = function() {
|
|
|
421
427
|
null,
|
|
422
428
|
null
|
|
423
429
|
);
|
|
424
|
-
const
|
|
430
|
+
const z = B.exports;
|
|
425
431
|
export {
|
|
426
|
-
|
|
432
|
+
z as default
|
|
427
433
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const i=require("./index-c1c356f8.cjs"),c=require("./helpers-4efe31ac.cjs"),d=({code:r,builder:e,context:s,event:t,localState:n,rootSetState:o,rootState:l})=>{const u=c.getFunctionArguments({builder:e,context:s,event:t,state:f(l,n,o)});return new Function(...u.map(([g])=>g),r)(...u.map(([,g])=>g))};function f(r,e,s){if(r===e)throw new Error("rootState === localState");return new Proxy(r,{get:(t,n)=>e&&n in e?e[n]:r[n],set:(t,n,o)=>{if(e&&n in e)throw new Error("Writing to local state is not allowed as it is read-only.");return r[n]=o,s==null||s(r),!0}})}function v({code:r,context:e,localState:s,rootState:t,rootSetState:n,event:o,isExpression:l=!0,serverExecutor:u}){if(r===""){i.logger.warn("Skipping evaluation of empty code block.");return}const g={isEditing:i.isEditing(),isBrowser:i.isBrowser(),isServer:!i.isBrowser(),getUserAttributes:()=>i.getUserAttributes()},w={code:l&&!(r.includes(";")||r.includes(" return ")||r.trim().startsWith("return "))?`return (${r});`:r,builder:g,context:e,event:o,rootSetState:n,rootState:t,localState:s};try{if(i.isBrowser())return d(w);if(console.log("serverExecutor",u),u)return u(w);i.logger.warn("No server executor was provided. Code evaluation will not work.");return}catch(a){i.logger.error("Failed code evaluation: "+a.message,{code:r});return}}exports.evaluate=v;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { l as g, d as f, i as w, w as c } from "./index-a089abc3.js";
|
|
2
|
+
import { g as m } from "./helpers-327ed263.js";
|
|
3
|
+
const v = ({
|
|
4
|
+
code: r,
|
|
5
|
+
builder: n,
|
|
6
|
+
context: i,
|
|
7
|
+
event: t,
|
|
8
|
+
localState: e,
|
|
9
|
+
rootSetState: u,
|
|
10
|
+
rootState: a
|
|
11
|
+
}) => {
|
|
12
|
+
const s = m({
|
|
13
|
+
builder: n,
|
|
14
|
+
context: i,
|
|
15
|
+
event: t,
|
|
16
|
+
state: b(a, e, u)
|
|
17
|
+
});
|
|
18
|
+
return new Function(...s.map(([o]) => o), r)(...s.map(([, o]) => o));
|
|
19
|
+
};
|
|
20
|
+
function b(r, n, i) {
|
|
21
|
+
if (r === n)
|
|
22
|
+
throw new Error("rootState === localState");
|
|
23
|
+
return new Proxy(r, {
|
|
24
|
+
get: (t, e) => n && e in n ? n[e] : r[e],
|
|
25
|
+
set: (t, e, u) => {
|
|
26
|
+
if (n && e in n)
|
|
27
|
+
throw new Error("Writing to local state is not allowed as it is read-only.");
|
|
28
|
+
return r[e] = u, i == null || i(r), !0;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
function p({
|
|
33
|
+
code: r,
|
|
34
|
+
context: n,
|
|
35
|
+
localState: i,
|
|
36
|
+
rootState: t,
|
|
37
|
+
rootSetState: e,
|
|
38
|
+
event: u,
|
|
39
|
+
isExpression: a = !0,
|
|
40
|
+
serverExecutor: s
|
|
41
|
+
}) {
|
|
42
|
+
if (r === "") {
|
|
43
|
+
g.warn("Skipping evaluation of empty code block.");
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
const o = {
|
|
47
|
+
isEditing: f(),
|
|
48
|
+
isBrowser: w(),
|
|
49
|
+
isServer: !w(),
|
|
50
|
+
getUserAttributes: () => c()
|
|
51
|
+
}, l = {
|
|
52
|
+
code: /* we disable this for cases where we definitely don't want a return */ a && !(r.includes(";") || r.includes(" return ") || r.trim().startsWith("return ")) ? `return (${r});` : r,
|
|
53
|
+
builder: o,
|
|
54
|
+
context: n,
|
|
55
|
+
event: u,
|
|
56
|
+
rootSetState: e,
|
|
57
|
+
rootState: t,
|
|
58
|
+
localState: i
|
|
59
|
+
};
|
|
60
|
+
try {
|
|
61
|
+
if (w())
|
|
62
|
+
return v(l);
|
|
63
|
+
if (console.log("serverExecutor", s), s)
|
|
64
|
+
return s(l);
|
|
65
|
+
g.warn("No server executor was provided. Code evaluation will not work.");
|
|
66
|
+
return;
|
|
67
|
+
} catch (d) {
|
|
68
|
+
g.error("Failed code evaluation: " + d.message, {
|
|
69
|
+
code: r
|
|
70
|
+
});
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
export {
|
|
75
|
+
p as e
|
|
76
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const i=require("./index-c1c356f8.cjs"),l=require("./evaluate-6a213bca.cjs"),u=e=>`v-on:${e.toLowerCase()}`,v=(e,n)=>o=>l.evaluate({code:e,event:o,isExpression:!1,...n});function f({block:e,stripPrefix:n,...o}){const a={},c=e.actions??{};for(const s in c){if(!c.hasOwnProperty(s))continue;const r=c[s];let t=u(s);if(n)switch(i.TARGET){case"vue2":case"vue3":t=t.replace("v-on:","");break;case"svelte":t=t.replace("on:","");break}a[t]=v(r,o)}return a}exports.getBlockActions=f;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { T as i } from "./index-a089abc3.js";
|
|
2
|
+
import { e as l } from "./evaluate-c9d68bff.js";
|
|
3
|
+
const v = (e) => `v-on:${e.toLowerCase()}`, p = (e, t) => (n) => l({
|
|
4
|
+
code: e,
|
|
5
|
+
event: n,
|
|
6
|
+
isExpression: !1,
|
|
7
|
+
...t
|
|
8
|
+
});
|
|
9
|
+
function m({
|
|
10
|
+
block: e,
|
|
11
|
+
stripPrefix: t,
|
|
12
|
+
...n
|
|
13
|
+
}) {
|
|
14
|
+
const c = {}, a = e.actions ?? {};
|
|
15
|
+
for (const s in a) {
|
|
16
|
+
if (!a.hasOwnProperty(s))
|
|
17
|
+
continue;
|
|
18
|
+
const r = a[s];
|
|
19
|
+
let o = v(s);
|
|
20
|
+
if (t)
|
|
21
|
+
switch (i) {
|
|
22
|
+
case "vue2":
|
|
23
|
+
case "vue3":
|
|
24
|
+
o = o.replace("v-on:", "");
|
|
25
|
+
break;
|
|
26
|
+
case "svelte":
|
|
27
|
+
o = o.replace("on:", "");
|
|
28
|
+
break;
|
|
29
|
+
}
|
|
30
|
+
c[o] = p(r, n);
|
|
31
|
+
}
|
|
32
|
+
return c;
|
|
33
|
+
}
|
|
34
|
+
export {
|
|
35
|
+
m as g
|
|
36
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const c=require("./index-c1c356f8.cjs"),n=require("./css-03a9ebe6.cjs");function i(e){const t={};if(typeof e!="string")return t;const s=e.trim().split(/\\s+/);for(const r of s)t[r]=!0;return t}function o(e){return e.class=i(e.class),e}const a=e=>({href:e.href});function u({block:e,context:t}){var r;const s={...a(e),...e.properties,"builder-id":e.id,style:e.style?l(e.style):void 0,class:[e.id,"builder-block",e.class,(r=e.properties)==null?void 0:r.class].filter(Boolean).join(" ")};return o(s)}function l(e){switch(c.TARGET){case"svelte":case"vue2":case"vue3":case"solid":return n.convertStyleMapToCSSArray(e).join(" ");case"qwik":case"reactNative":case"react":case"rsc":return e}}exports.getBlockProperties=u;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const c=require("./evaluate-6a213bca.cjs"),u=require("./index-c1c356f8.cjs"),a=(e,t,r)=>{if(Object(e)!==e)return e;const n=Array.isArray(t)?t:t.toString().match(/[^.[\]]+/g);return n.slice(0,-1).reduce((s,i,o)=>Object(s[i])===s[i]?s[i]:s[i]=Math.abs(Number(n[o+1]))>>0===+n[o+1]?[]:{},e)[n[n.length-1]]=r,e};const d=({block:e,...t})=>{if(!e.bindings)return e;const r=u.fastClone(e),n={...r,properties:{...r.properties},actions:{...r.actions}};for(const s in e.bindings){const i=e.bindings[s],o=c.evaluate({code:i,...t});a(n,s,o)}return n};function g({block:e,shouldEvaluateBindings:t,...r}){const n=e;return t?d({block:n,...r}):n}exports.getProcessedBlock=g;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { e as c } from "./evaluate-c9d68bff.js";
|
|
2
|
+
import { f as a } from "./index-a089abc3.js";
|
|
3
|
+
const u = (n, e, r) => {
|
|
4
|
+
if (Object(n) !== n)
|
|
5
|
+
return n;
|
|
6
|
+
const t = Array.isArray(e) ? e : e.toString().match(/[^.[\]]+/g);
|
|
7
|
+
return t.slice(0, -1).reduce((s, i, o) => Object(s[i]) === s[i] ? s[i] : s[i] = Math.abs(Number(t[o + 1])) >> 0 === +t[o + 1] ? [] : {}, n)[t[t.length - 1]] = r, n;
|
|
8
|
+
};
|
|
9
|
+
const f = ({
|
|
10
|
+
block: n,
|
|
11
|
+
...e
|
|
12
|
+
}) => {
|
|
13
|
+
if (!n.bindings)
|
|
14
|
+
return n;
|
|
15
|
+
const r = a(n), t = {
|
|
16
|
+
...r,
|
|
17
|
+
properties: {
|
|
18
|
+
...r.properties
|
|
19
|
+
},
|
|
20
|
+
actions: {
|
|
21
|
+
...r.actions
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
for (const s in n.bindings) {
|
|
25
|
+
const i = n.bindings[s], o = c({
|
|
26
|
+
code: i,
|
|
27
|
+
...e
|
|
28
|
+
});
|
|
29
|
+
u(t, s, o);
|
|
30
|
+
}
|
|
31
|
+
return t;
|
|
32
|
+
};
|
|
33
|
+
function p({
|
|
34
|
+
block: n,
|
|
35
|
+
shouldEvaluateBindings: e,
|
|
36
|
+
...r
|
|
37
|
+
}) {
|
|
38
|
+
const t = n;
|
|
39
|
+
return e ? f({
|
|
40
|
+
block: t,
|
|
41
|
+
...r
|
|
42
|
+
}) : t;
|
|
43
|
+
}
|
|
44
|
+
export {
|
|
45
|
+
p as g
|
|
46
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const s=({builder:t,context:e,event:n,state:r})=>Object.entries({state:r,Builder:t,builder:t,context:e,event:n});exports.getFunctionArguments=s;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-c1c356f8.cjs");require("vue");const r=async()=>{if(!e.isBrowser()&&!e.isNonNodeServer())return(await Promise.resolve().then(()=>require("./node-runtime-5a567c42.cjs"))).runInNode;e.logger.warn("nodeEvaluator should not be called in the browser or non-node server")};exports.evaluator=r;
|