@builder.io/sdk-vue 0.4.0 → 0.4.2
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 +1 -1
- package/packages/_vue2/dist/{block-styles.6046e541.js → block-styles.6a1d7394.js} +4 -4
- package/packages/_vue2/dist/{block-styles.5d12dd48.cjs → block-styles.cacb4849.cjs} +1 -1
- package/packages/{_vue3/dist/css.136ed67a.js → _vue2/dist/css.49cc4003.js} +2 -2
- package/packages/_vue2/dist/{css.1c33bc00.cjs → css.c26b7ab4.cjs} +1 -1
- package/packages/{_vue3/dist/evaluate.38cae9b6.js → _vue2/dist/evaluate.6ab6e7cb.js} +1 -1
- package/packages/_vue2/dist/{evaluate.1f3c9eb2.cjs → evaluate.7d21bb04.cjs} +1 -1
- package/packages/_vue2/dist/{index.75296c8a.js → index.2473a355.js} +61 -58
- package/packages/_vue2/dist/{index.d1a8c547.cjs → index.95d9006f.cjs} +8 -8
- package/packages/_vue2/dist/{render-block.0c043cce.js → render-block.22052bd8.js} +20 -33
- package/packages/_vue2/dist/render-block.9342f7b5.cjs +3 -0
- package/packages/_vue2/dist/{render-component.d72cfa86.js → render-component.ec485884.js} +3 -3
- package/packages/_vue2/dist/{render-component.89838d4a.cjs → render-component.f3cccaa9.cjs} +1 -1
- package/packages/_vue2/dist/{render-content.a8742da7.js → render-content.a6b17a6c.js} +270 -271
- package/packages/_vue2/dist/render-content.d53085e5.cjs +1 -0
- package/packages/_vue2/dist/{render-inlined-styles.57cb3887.js → render-inlined-styles.2286ef7c.js} +1 -1
- package/packages/_vue2/dist/{render-inlined-styles.80c83f3f.cjs → render-inlined-styles.b322c74a.cjs} +1 -1
- package/packages/_vue2/dist/render-repeated-block.253c96e6.cjs +1 -0
- package/packages/_vue2/dist/render-repeated-block.ac4f1559.js +38 -0
- package/packages/_vue2/dist/{render-styles.189908f8.cjs → render-styles.0cb949b0.cjs} +2 -2
- package/packages/_vue2/dist/{render-styles.0e5b622f.js → render-styles.a148b748.js} +2 -2
- package/packages/_vue2/dist/sdk.cjs +1 -1
- package/packages/_vue2/dist/sdk.js +11 -10
- package/packages/_vue2/dist/src/components/render-block/render-repeated-block.vue.d.ts +3 -1
- package/packages/_vue2/dist/src/components/render-content/render-content.vue.d.ts +27 -5
- package/packages/_vue2/dist/src/components/render-content-variants/render-content-variants.vue.d.ts +3 -3
- package/packages/_vue2/dist/src/constants/sdk-version.d.ts +1 -1
- package/packages/_vue2/dist/src/functions/get-builder-search-params/index.d.ts +6 -0
- package/packages/_vue2/dist/src/index.d.ts +1 -0
- package/packages/_vue2/dist/style.css +1 -1
- package/packages/_vue3/dist/{block-styles.10cf87f2.cjs → block-styles.5b949efb.cjs} +1 -1
- package/packages/_vue3/dist/{block-styles.bce8f3cd.js → block-styles.e91165b8.js} +4 -4
- package/packages/{_vue2/dist/css.6d40adbf.js → _vue3/dist/css.41ed2294.js} +2 -2
- package/packages/_vue3/dist/{css.ecfa9f0c.cjs → css.627e21ae.cjs} +4 -4
- package/packages/{_vue2/dist/evaluate.9b61c455.js → _vue3/dist/evaluate.0662f166.js} +1 -1
- package/packages/_vue3/dist/{evaluate.e68b2bb7.cjs → evaluate.da45a33b.cjs} +1 -1
- package/packages/_vue3/dist/{index.32c5f4e2.js → index.3a561c6a.js} +44 -42
- package/packages/_vue3/dist/{index.b0a65841.cjs → index.3e17c057.cjs} +7 -7
- package/packages/_vue3/dist/render-block.20c07cb1.cjs +3 -0
- package/packages/_vue3/dist/render-block.e9a2cb71.js +273 -0
- package/packages/_vue3/dist/{render-component.b3f51b9c.cjs → render-component.20ef18f7.cjs} +1 -1
- package/packages/_vue3/dist/{render-component.b49ee7fc.js → render-component.afa60a7b.js} +3 -3
- package/packages/_vue3/dist/{render-content.03e6b41b.js → render-content.20bd0f8d.js} +185 -186
- package/packages/_vue3/dist/render-content.e790eee5.cjs +1 -0
- package/packages/_vue3/dist/{render-inlined-styles.00a6f102.js → render-inlined-styles.0444f4fe.js} +1 -1
- package/packages/_vue3/dist/{render-inlined-styles.03a0b90a.cjs → render-inlined-styles.14d9ba36.cjs} +1 -1
- package/packages/_vue3/dist/render-repeated-block.5a245883.js +32 -0
- package/packages/_vue3/dist/render-repeated-block.75230844.cjs +1 -0
- package/packages/_vue3/dist/{render-styles.665ea958.js → render-styles.73c7ba5a.js} +2 -2
- package/packages/_vue3/dist/{render-styles.90c0cc7c.cjs → render-styles.bd7475f8.cjs} +2 -2
- package/packages/_vue3/dist/sdk.cjs +1 -1
- package/packages/_vue3/dist/sdk.js +11 -10
- package/packages/_vue3/dist/src/components/render-block/render-repeated-block.vue.d.ts +3 -1
- package/packages/_vue3/dist/src/components/render-content/render-content.vue.d.ts +36 -14
- package/packages/_vue3/dist/src/components/render-content-variants/render-content-variants.vue.d.ts +3 -3
- package/packages/_vue3/dist/src/constants/sdk-version.d.ts +1 -1
- package/packages/_vue3/dist/src/functions/get-builder-search-params/index.d.ts +6 -0
- package/packages/_vue3/dist/src/index.d.ts +1 -0
- package/packages/_vue3/dist/style.css +1 -1
- package/packages/_vue2/dist/render-block.aa8d982e.cjs +0 -3
- package/packages/_vue2/dist/render-content.0b8e6a43.cjs +0 -1
- package/packages/_vue2/dist/render-repeated-block.7a35249f.js +0 -45
- package/packages/_vue2/dist/render-repeated-block.aeeee917.cjs +0 -1
- package/packages/_vue3/dist/render-block.9e2345a9.cjs +0 -3
- package/packages/_vue3/dist/render-block.d226379d.js +0 -286
- package/packages/_vue3/dist/render-content.e7b1a19e.cjs +0 -1
- package/packages/_vue3/dist/render-repeated-block.671f867f.cjs +0 -1
- package/packages/_vue3/dist/render-repeated-block.a26cf553.js +0 -39
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineComponent as m } from "vue";
|
|
2
|
-
import { e as l } from "./evaluate.
|
|
3
|
-
import { T as u, n as d } from "./index.
|
|
4
|
-
import { a as h, g as p } from "./css.
|
|
5
|
-
const
|
|
2
|
+
import { e as l } from "./evaluate.6ab6e7cb.js";
|
|
3
|
+
import { T as u, n as d } from "./index.2473a355.js";
|
|
4
|
+
import { a as h, g as p } from "./css.49cc4003.js";
|
|
5
|
+
const f = (e) => `v-on:${e.toLowerCase()}`, k = (e, t) => (o) => l({
|
|
6
6
|
code: e,
|
|
7
7
|
context: t.context,
|
|
8
8
|
localState: t.localState,
|
|
@@ -11,14 +11,14 @@ const S = (e) => `v-on:${e.toLowerCase()}`, f = (e, t) => (o) => l({
|
|
|
11
11
|
event: o,
|
|
12
12
|
isExpression: !1
|
|
13
13
|
});
|
|
14
|
-
function
|
|
14
|
+
function S(e) {
|
|
15
15
|
var r;
|
|
16
16
|
const t = {}, o = (r = e.block.actions) != null ? r : {};
|
|
17
17
|
for (const n in o) {
|
|
18
18
|
if (!o.hasOwnProperty(n))
|
|
19
19
|
continue;
|
|
20
20
|
const c = o[n];
|
|
21
|
-
t[
|
|
21
|
+
t[f(n)] = k(c, e);
|
|
22
22
|
}
|
|
23
23
|
return t;
|
|
24
24
|
}
|
|
@@ -30,7 +30,7 @@ function b(e) {
|
|
|
30
30
|
builderBlock: e
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
|
-
function
|
|
33
|
+
function y(e) {
|
|
34
34
|
const t = {};
|
|
35
35
|
if (typeof e != "string")
|
|
36
36
|
return t;
|
|
@@ -39,8 +39,8 @@ function x(e) {
|
|
|
39
39
|
t[r] = !0;
|
|
40
40
|
return t;
|
|
41
41
|
}
|
|
42
|
-
function
|
|
43
|
-
return e.class =
|
|
42
|
+
function x(e) {
|
|
43
|
+
return e.class = y(e.class), e;
|
|
44
44
|
}
|
|
45
45
|
const g = (e) => ({ href: e.href });
|
|
46
46
|
function B(e) {
|
|
@@ -52,7 +52,7 @@ function B(e) {
|
|
|
52
52
|
style: v(e.style),
|
|
53
53
|
class: [e.id, "builder-block", e.class, (o = e.properties) == null ? void 0 : o.class].filter(Boolean).join(" ")
|
|
54
54
|
};
|
|
55
|
-
return
|
|
55
|
+
return x(t);
|
|
56
56
|
}
|
|
57
57
|
function v(e) {
|
|
58
58
|
if (!!e)
|
|
@@ -68,7 +68,7 @@ function v(e) {
|
|
|
68
68
|
return e;
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
|
-
const
|
|
71
|
+
const _ = [
|
|
72
72
|
"area",
|
|
73
73
|
"base",
|
|
74
74
|
"br",
|
|
@@ -84,7 +84,7 @@ const C = [
|
|
|
84
84
|
"source",
|
|
85
85
|
"track",
|
|
86
86
|
"wbr"
|
|
87
|
-
],
|
|
87
|
+
], C = (e) => typeof e == "string" && _.includes(e.toLowerCase()), w = ({
|
|
88
88
|
block: e,
|
|
89
89
|
context: t
|
|
90
90
|
}) => {
|
|
@@ -135,17 +135,17 @@ const C = [
|
|
|
135
135
|
},
|
|
136
136
|
block: r
|
|
137
137
|
}));
|
|
138
|
-
}, R = () => import("./block-styles.
|
|
138
|
+
}, R = () => import("./block-styles.6a1d7394.js").then((e) => e.default).catch((e) => {
|
|
139
139
|
throw console.error(
|
|
140
140
|
"Error while attempting to dynamically import component BlockStyles at ./block-styles.vue",
|
|
141
141
|
e
|
|
142
142
|
), e;
|
|
143
|
-
}), P = () => import("./render-repeated-block.
|
|
143
|
+
}), P = () => import("./render-repeated-block.ac4f1559.js").then((e) => e.default).catch((e) => {
|
|
144
144
|
throw console.error(
|
|
145
145
|
"Error while attempting to dynamically import component RenderRepeatedBlock at ./render-repeated-block.vue",
|
|
146
146
|
e
|
|
147
147
|
), e;
|
|
148
|
-
}), T = () => import("./render-component.
|
|
148
|
+
}), T = () => import("./render-component.ec485884.js").then((e) => e.default).catch((e) => {
|
|
149
149
|
throw console.error(
|
|
150
150
|
"Error while attempting to dynamically import component RenderComponent at ./render-component.vue",
|
|
151
151
|
e
|
|
@@ -165,7 +165,8 @@ const C = [
|
|
|
165
165
|
context: this.context
|
|
166
166
|
}),
|
|
167
167
|
Tag: this.block.tagName || "div",
|
|
168
|
-
|
|
168
|
+
childrenContext: this.context,
|
|
169
|
+
isEmptyHtmlElement: C
|
|
169
170
|
};
|
|
170
171
|
},
|
|
171
172
|
computed: {
|
|
@@ -189,7 +190,7 @@ const C = [
|
|
|
189
190
|
return "hide" in this.useBlock ? !this.useBlock.hide : "show" in this.useBlock ? this.useBlock.show : !0;
|
|
190
191
|
},
|
|
191
192
|
actions() {
|
|
192
|
-
return
|
|
193
|
+
return S({
|
|
193
194
|
block: this.useBlock,
|
|
194
195
|
rootState: this.context.rootState,
|
|
195
196
|
rootSetState: this.context.rootSetState,
|
|
@@ -206,20 +207,6 @@ const C = [
|
|
|
206
207
|
var t, o;
|
|
207
208
|
return !((t = this.component) != null && t.component) && !this.repeatItem ? (o = this.useBlock.children) != null ? o : [] : [];
|
|
208
209
|
},
|
|
209
|
-
childrenContext() {
|
|
210
|
-
const e = () => ({});
|
|
211
|
-
return {
|
|
212
|
-
apiKey: this.context.apiKey,
|
|
213
|
-
apiVersion: this.context.apiVersion,
|
|
214
|
-
localState: this.context.localState,
|
|
215
|
-
rootState: this.context.rootState,
|
|
216
|
-
rootSetState: this.context.rootSetState,
|
|
217
|
-
content: this.context.content,
|
|
218
|
-
context: this.context.context,
|
|
219
|
-
registeredComponents: this.context.registeredComponents,
|
|
220
|
-
inheritedStyles: e()
|
|
221
|
-
};
|
|
222
|
-
},
|
|
223
210
|
renderComponentProps() {
|
|
224
211
|
var e, t, o;
|
|
225
212
|
return {
|
|
@@ -270,7 +257,7 @@ var A = function() {
|
|
|
270
257
|
null,
|
|
271
258
|
null
|
|
272
259
|
);
|
|
273
|
-
const
|
|
260
|
+
const M = N.exports;
|
|
274
261
|
export {
|
|
275
|
-
|
|
262
|
+
M as default
|
|
276
263
|
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("vue"),u=require("./evaluate.7d21bb04.cjs"),d=require("./index.95d9006f.cjs"),s=require("./css.c26b7ab4.cjs"),m=e=>`v-on:${e.toLowerCase()}`,h=(e,t)=>o=>u.evaluate({code:e,context:t.context,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,event:o,isExpression:!1});function k(e){var r;const t={},o=(r=e.block.actions)!=null?r:{};for(const n in o){if(!o.hasOwnProperty(n))continue;const c=o[n];t[m(n)]=h(c,e)}return t}function f(e){var t;return{...(t=e.component)==null?void 0:t.options,...e.options,builderBlock:e}}function S(e){const t={};if(typeof e!="string")return t;const o=e.trim().split(/\\s+/);for(const r of o)t[r]=!0;return t}function b(e){return e.class=S(e.class),e}const v=e=>({href:e.href});function y(e){var o;const t={...v(e),...e.properties,"builder-id":e.id,style:g(e.style),class:[e.id,"builder-block",e.class,(o=e.properties)==null?void 0:o.class].filter(Boolean).join(" ")};return b(t)}function g(e){if(!!e)switch(d.TARGET){case"svelte":case"vue2":case"vue3":case"solid":return s.convertStyleMapToCSSArray(e).join(" ");case"qwik":case"reactNative":case"react":return e}}const x=["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],B=e=>typeof e=="string"&&x.includes(e.toLowerCase()),_=({block:e,context:t})=>{var n;const o=(n=s.getProcessedBlock({block:e,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,context:t.context,shouldEvaluateBindings:!1}).component)==null?void 0:n.name;if(!o)return null;const r=t.registeredComponents[o];if(r)return r;console.warn(`
|
|
2
|
+
Could not find a registered component named "${o}".
|
|
3
|
+
If you registered it, is the file that registered it imported by the file that needs to render it?`)},C=({block:e,context:t})=>{const{repeat:o,...r}=e;if(!(o!=null&&o.collection))return;const n=u.evaluate({code:o.collection,localState:t.localState,rootState:t.rootState,rootSetState:t.rootSetState,context:t.context});if(!Array.isArray(n))return;const c=o.collection.split(".").pop(),a=o.itemName||(c?c+"Item":"item");return n.map((i,l)=>({context:{...t,localState:{...t.localState,$index:l,$item:i,[a]:i,[`$${a}Index`]:l}},block:r}))},w=()=>Promise.resolve().then(()=>require("./block-styles.cacb4849.cjs")).then(e=>e.default).catch(e=>{throw console.error("Error while attempting to dynamically import component BlockStyles at ./block-styles.vue",e),e}),P=()=>Promise.resolve().then(()=>require("./render-repeated-block.253c96e6.cjs")).then(e=>e.default).catch(e=>{throw console.error("Error while attempting to dynamically import component RenderRepeatedBlock at ./render-repeated-block.vue",e),e}),E=()=>Promise.resolve().then(()=>require("./render-component.f3cccaa9.cjs")).then(e=>e.default).catch(e=>{throw console.error("Error while attempting to dynamically import component RenderComponent at ./render-component.vue",e),e}),R=p.defineComponent({name:"render-block",components:{RenderComponent:E,RenderRepeatedBlock:P,BlockStyles:w},props:["block","context"],data(){return{component:_({block:this.block,context:this.context}),Tag:this.block.tagName||"div",childrenContext:this.context,isEmptyHtmlElement:B}},computed:{repeatItem(){return C({block:this.block,context:this.context})},useBlock(){return this.repeatItem?this.block:s.getProcessedBlock({block:this.block,localState:this.context.localState,rootState:this.context.rootState,rootSetState:this.context.rootSetState,context:this.context.context,shouldEvaluateBindings:!0})},canShowBlock(){return"hide"in this.useBlock?!this.useBlock.hide:"show"in this.useBlock?this.useBlock.show:!0},actions(){return k({block:this.useBlock,rootState:this.context.rootState,rootSetState:this.context.rootSetState,localState:this.context.localState,context:this.context.context})},attributes(){return{...y(this.useBlock)}},childrenWithoutParentComponent(){var t,o;return!((t=this.component)!=null&&t.component)&&!this.repeatItem?(o=this.useBlock.children)!=null?o:[]:[]},renderComponentProps(){var e,t,o;return{blockChildren:(e=this.useBlock.children)!=null?e:[],componentRef:(t=this.component)==null?void 0:t.component,componentOptions:{...f(this.useBlock),...(o=this.component)!=null&&o.noWrap?{attributes:{...this.attributes,...this.actions}}:{}},context:this.childrenContext}}},methods:{stripVOn:function(t={}){return Object.keys(t).reduce((o,r)=>({...o,[r.replace("v-on:","")]:t[r]}),{})}}});var T=function(){var r;var t=this,o=t._self._c;return t._self._setupProxy,!Boolean(!((r=t.component)!=null&&r.noWrap))&&t.canShowBlock?o("render-component",t._b({},"render-component",t.renderComponentProps,!1)):t.isEmptyHtmlElement(t.Tag)&&t.canShowBlock?o(t.Tag,t._g(t._b({tag:"component"},"component",t.attributes,!1),t.stripVOn(t.actions))):!t.isEmptyHtmlElement(t.Tag)&&t.repeatItem&&t.canShowBlock?o("div",{staticClass:"vue2-root-element-workaround"},t._l(t.repeatItem,function(n,c){return o("render-repeated-block",{key:c,attrs:{repeatContext:n.context,block:n.block}})}),1):t.canShowBlock?o(t.Tag,t._g(t._b({tag:"component"},"component",t.attributes,!1),t.stripVOn(t.actions)),[o("render-component",t._b({},"render-component",t.renderComponentProps,!1)),t._l(t.childrenWithoutParentComponent,function(n,c){return o("render-block",{key:"render-block-"+n.id,attrs:{block:n,context:t.childrenContext}})}),t._l(t.childrenWithoutParentComponent,function(n,c){return o("block-styles",{key:"block-style-"+n.id,attrs:{block:n,context:t.childrenContext}})})],2):t._e()},j=[],O=d.normalizeComponent(R,T,j,!1,null,null,null,null);const A=O.exports;exports.default=A;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { defineComponent as c } from "vue";
|
|
2
|
-
import { n as l } from "./index.
|
|
3
|
-
const s = () => import("./block-styles.
|
|
2
|
+
import { n as l } from "./index.2473a355.js";
|
|
3
|
+
const s = () => import("./block-styles.6a1d7394.js").then((e) => e.default).catch((e) => {
|
|
4
4
|
throw console.error(
|
|
5
5
|
"Error while attempting to dynamically import component BlockStyles at ./block-styles.vue",
|
|
6
6
|
e
|
|
7
7
|
), e;
|
|
8
|
-
}), m = () => import("./render-block.
|
|
8
|
+
}), m = () => import("./render-block.22052bd8.js").then((e) => e.default).catch((e) => {
|
|
9
9
|
throw console.error(
|
|
10
10
|
"Error while attempting to dynamically import component RenderBlock at ./render-block.vue",
|
|
11
11
|
e
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("vue"),l=require("./index.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("vue"),l=require("./index.95d9006f.cjs"),s=()=>Promise.resolve().then(()=>require("./block-styles.cacb4849.cjs")).then(n=>n.default).catch(n=>{throw console.error("Error while attempting to dynamically import component BlockStyles at ./block-styles.vue",n),n}),i=()=>Promise.resolve().then(()=>require("./render-block.9342f7b5.cjs")).then(n=>n.default).catch(n=>{throw console.error("Error while attempting to dynamically import component RenderBlock at ./render-block.vue",n),n}),a=c.defineComponent({name:"render-component",components:{RenderBlock:i,BlockStyles:s},props:["componentRef","componentOptions","blockChildren","context"]});var m=function(){var e=this,t=e._self._c;return e._self._setupProxy,e.componentRef?t(e.componentRef,e._b({tag:"component"},"component",e.componentOptions,!1),[e._l(e.blockChildren,function(o,r){return t("render-block",{key:"render-block-"+o.id,attrs:{block:o,context:e.context}})}),e._l(e.blockChildren,function(o,r){return t("block-styles",{key:"block-style-"+o.id,attrs:{block:o,context:e.context}})})],2):e._e()},d=[],p=l.normalizeComponent(a,m,d,!1,null,null,null,null);const u=p.exports;exports.default=u;
|