@builder.io/sdk-vue 0.4.2 → 0.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/package.json +1 -1
  2. package/packages/_vue2/dist/{block-styles.cacb4849.cjs → block-styles.aaf62526.cjs} +1 -1
  3. package/packages/_vue2/dist/{block-styles.6a1d7394.js → block-styles.c38fdaef.js} +4 -4
  4. package/packages/_vue2/dist/{css.49cc4003.js → css.377600fa.js} +2 -2
  5. package/packages/{_vue3/dist/css.627e21ae.cjs → _vue2/dist/css.4a664d41.cjs} +1 -1
  6. package/packages/_vue2/dist/{evaluate.6ab6e7cb.js → evaluate.d2d16952.js} +1 -1
  7. package/packages/_vue2/dist/{evaluate.7d21bb04.cjs → evaluate.d837a845.cjs} +2 -2
  8. package/packages/_vue2/dist/{index.2473a355.js → index.1074d675.js} +102 -102
  9. package/packages/_vue2/dist/{index.95d9006f.cjs → index.3d5a7a37.cjs} +6 -6
  10. package/packages/_vue2/dist/{render-block.22052bd8.js → render-block.1ec27d4d.js} +6 -6
  11. package/packages/_vue2/dist/{render-block.9342f7b5.cjs → render-block.43f24cc4.cjs} +2 -2
  12. package/packages/_vue2/dist/{render-component.ec485884.js → render-component.82a8e6f7.js} +3 -3
  13. package/packages/_vue2/dist/{render-component.f3cccaa9.cjs → render-component.ba549c84.cjs} +1 -1
  14. package/packages/_vue2/dist/{render-content.d53085e5.cjs → render-content.2c57f5bb.cjs} +1 -1
  15. package/packages/_vue2/dist/{render-content.a6b17a6c.js → render-content.3afd4a46.js} +5 -5
  16. package/packages/_vue2/dist/{render-inlined-styles.b322c74a.cjs → render-inlined-styles.1ed1b531.cjs} +1 -1
  17. package/packages/_vue2/dist/{render-inlined-styles.2286ef7c.js → render-inlined-styles.f76aba42.js} +1 -1
  18. package/packages/_vue2/dist/{render-repeated-block.253c96e6.cjs → render-repeated-block.625e26fc.cjs} +1 -1
  19. package/packages/_vue2/dist/{render-repeated-block.ac4f1559.js → render-repeated-block.d3c2411b.js} +2 -2
  20. package/packages/_vue2/dist/{render-styles.a148b748.js → render-styles.7b01db22.js} +2 -2
  21. package/packages/_vue2/dist/{render-styles.0cb949b0.cjs → render-styles.f1413001.cjs} +3 -3
  22. package/packages/_vue2/dist/sdk.cjs +1 -1
  23. package/packages/_vue2/dist/sdk.js +1 -1
  24. package/packages/_vue2/dist/src/components/render-block/render-repeated-block.vue.d.ts +0 -9
  25. package/packages/_vue2/dist/src/constants/sdk-version.d.ts +1 -1
  26. package/packages/_vue3/dist/sdk.cjs +72 -1
  27. package/packages/_vue3/dist/sdk.js +3251 -22
  28. package/packages/_vue3/dist/src/components/render-block/render-repeated-block.vue.d.ts +0 -9
  29. package/packages/_vue3/dist/src/constants/sdk-version.d.ts +1 -1
  30. package/packages/_vue3/dist/style.css +1 -1
  31. package/packages/_vue2/dist/css.c26b7ab4.cjs +0 -6
  32. package/packages/_vue3/dist/block-styles.5b949efb.cjs +0 -1
  33. package/packages/_vue3/dist/block-styles.e91165b8.js +0 -72
  34. package/packages/_vue3/dist/css.41ed2294.js +0 -75
  35. package/packages/_vue3/dist/evaluate.0662f166.js +0 -63
  36. package/packages/_vue3/dist/evaluate.da45a33b.cjs +0 -4
  37. package/packages/_vue3/dist/index.3a561c6a.js +0 -1394
  38. package/packages/_vue3/dist/index.3e17c057.cjs +0 -32
  39. package/packages/_vue3/dist/render-block.20c07cb1.cjs +0 -3
  40. package/packages/_vue3/dist/render-block.e9a2cb71.js +0 -273
  41. package/packages/_vue3/dist/render-component.20ef18f7.cjs +0 -1
  42. package/packages/_vue3/dist/render-component.afa60a7b.js +0 -42
  43. package/packages/_vue3/dist/render-content.20bd0f8d.js +0 -1354
  44. package/packages/_vue3/dist/render-content.e790eee5.cjs +0 -1
  45. package/packages/_vue3/dist/render-inlined-styles.0444f4fe.js +0 -16
  46. package/packages/_vue3/dist/render-inlined-styles.14d9ba36.cjs +0 -1
  47. package/packages/_vue3/dist/render-repeated-block.5a245883.js +0 -32
  48. package/packages/_vue3/dist/render-repeated-block.75230844.cjs +0 -1
  49. package/packages/_vue3/dist/render-styles.73c7ba5a.js +0 -80
  50. package/packages/_vue3/dist/render-styles.bd7475f8.cjs +0 -31
@@ -1,12 +1,3 @@
1
- /**
2
- * We can't make this a generic `ProvideContext` function because Vue 2 won't support root slots, e.g.
3
- *
4
- * ```vue
5
- * <template>
6
- * <slot></slot>
7
- * </template>
8
- * ```
9
- */
10
1
  declare const _sfc_main: import("vue").DefineComponent<Readonly<{
11
2
  block?: any;
12
3
  repeatContext?: any;
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.4.2";
1
+ export declare const SDK_VERSION = "0.4.3";
@@ -1 +1 @@
1
- .button-361b1o6wv2k[data-v-a4481d84]{all:unset}.div-1eih9th5ow6[data-v-cc8d4c1f]{display:flex;line-height:normal}.div-1eih9th5ow6-2[data-v-cc8d4c1f]{display:flex;flex-direction:column;align-items:stretch}.img-256wrwn33ry[data-v-15a2d98b]{opacity:1;transition:opacity .2s ease-in-out}.div-256wrwn33ry[data-v-15a2d98b]{width:100%;pointer-events:none;font-size:0}.div-256wrwn33ry-2[data-v-15a2d98b]{display:flex;flex-direction:column;align-items:stretch;position:absolute;top:0;left:0;width:100%;height:100%}.div-4o9pb21oca6[data-v-07645c8e]{display:flex;flex-direction:column;align-items:stretch}
1
+ .button-361b1o6wv2k[data-v-e8a5e9df]{all:unset}.div-4o9pb21oca6[data-v-61bc5f3a]{display:flex;flex-direction:column;align-items:stretch}.div-1eih9th5ow6[data-v-df2fecd0]{display:flex;line-height:normal}.div-1eih9th5ow6-2[data-v-df2fecd0]{display:flex;flex-direction:column;align-items:stretch}.img-256wrwn33ry[data-v-f59f4313]{opacity:1;transition:opacity .2s ease-in-out}.div-256wrwn33ry[data-v-f59f4313]{width:100%;pointer-events:none;font-size:0}.div-256wrwn33ry-2[data-v-f59f4313]{display:flex;flex-direction:column;align-items:stretch;position:absolute;top:0;left:0;width:100%;height:100%}
@@ -1,6 +0,0 @@
1
- "use strict";const f=require("./evaluate.7d21bb04.cjs"),a=require("./index.95d9006f.cjs"),p=(e,t,n)=>{if(Object(e)!==e)return e;const s=Array.isArray(t)?t:t.toString().match(/[^.[\]]+/g);return s.slice(0,-1).reduce((c,r,o)=>Object(c[r])===c[r]?c[r]:c[r]=Math.abs(Number(s[o+1]))>>0===+s[o+1]?[]:{},e)[s[s.length-1]]=n,e};const g=({block:e,context:t,localState:n,rootState:s,rootSetState:c})=>{if(!e.bindings)return e;const r=a.fastClone(e),o={...r,properties:{...r.properties},actions:{...r.actions}};for(const i in e.bindings){const l=e.bindings[i],d=f.evaluate({code:l,localState:n,rootState:s,rootSetState:c,context:t});p(o,i,d)}return o};function C({block:e,context:t,shouldEvaluateBindings:n,localState:s,rootState:c,rootSetState:r}){const o=e;return n?g({block:o,localState:s,rootState:c,rootSetState:r,context:t}):o}const S=e=>e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g,"$1-$2").toLowerCase(),u=e=>Object.entries(e).map(([n,s])=>{if(typeof s=="string")return`${S(n)}: ${s};`}).filter(a.checkIsDefined),v=e=>u(e).join(`
2
- `),y=({mediaQuery:e,className:t,styles:n})=>{const s=`.${t} {
3
- ${v(n)}
4
- }`;return e?`${e} {
5
- ${s}
6
- }`:s};exports.convertStyleMapToCSSArray=u;exports.createCssClass=y;exports.getProcessedBlock=C;
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),t=require("./index.3e17c057.cjs"),r=require("./css.627e21ae.cjs");require("./evaluate.da45a33b.cjs");const y=()=>Promise.resolve().then(()=>require("./render-inlined-styles.14d9ba36.cjs")).then(e=>e.default).catch(e=>{throw console.error("Error while attempting to dynamically import component RenderInlinedStyles at ../render-inlined-styles.vue",e),e}),S=o.defineComponent({name:"block-styles",components:{RenderInlinedStyles:o.defineAsyncComponent(y)},props:["block","context"],data(){return{TARGET:t.TARGET}},computed:{useBlock(){return r.getProcessedBlock({block:this.block,localState:this.context.localState,rootState:this.context.rootState,rootSetState:this.context.rootSetState,context:this.context.context,shouldEvaluateBindings:!0})},canShowBlock(){return t.checkIsDefined(this.useBlock.hide)?!this.useBlock.hide:t.checkIsDefined(this.useBlock.show)?this.useBlock.show:!0},css(){var d;const e=this.useBlock.responsiveStyles,n=this.context.content,c=t.getSizesForBreakpoints(((d=n==null?void 0:n.meta)==null?void 0:d.breakpoints)||{}),l=e==null?void 0:e.large,i=e==null?void 0:e.medium,a=e==null?void 0:e.small,s=this.useBlock.id;if(!s)return"";const u=l?r.createCssClass({className:s,styles:l}):"",m=i?r.createCssClass({className:s,styles:i,mediaQuery:t.getMaxWidthQueryForSize("medium",c)}):"",h=a?r.createCssClass({className:s,styles:a,mediaQuery:t.getMaxWidthQueryForSize("small",c)}):"";return[u,m,h].join(" ")}}});function k(e,n,c,l,i,a){const s=o.resolveComponent("render-inlined-styles");return e.TARGET!=="reactNative"&&e.css&&e.canShowBlock?(o.openBlock(),o.createBlock(s,{key:0,styles:e.css},null,8,["styles"])):o.createCommentVNode("",!0)}const p=t._export_sfc(S,[["render",k]]);exports.default=p;
@@ -1,72 +0,0 @@
1
- import { defineComponent as h, defineAsyncComponent as S, resolveComponent as k, openBlock as y, createBlock as f, createCommentVNode as B } from "vue";
2
- import { T as g, c as i, g as C, a as d, _ } from "./index.3a561c6a.js";
3
- import { g as x, c } from "./css.41ed2294.js";
4
- import "./evaluate.0662f166.js";
5
- const b = () => import("./render-inlined-styles.0444f4fe.js").then((e) => e.default).catch((e) => {
6
- throw console.error(
7
- "Error while attempting to dynamically import component RenderInlinedStyles at ../render-inlined-styles.vue",
8
- e
9
- ), e;
10
- }), w = h({
11
- name: "block-styles",
12
- components: {
13
- RenderInlinedStyles: S(b)
14
- },
15
- props: ["block", "context"],
16
- data() {
17
- return { TARGET: g };
18
- },
19
- computed: {
20
- useBlock() {
21
- return x({
22
- block: this.block,
23
- localState: this.context.localState,
24
- rootState: this.context.rootState,
25
- rootSetState: this.context.rootSetState,
26
- context: this.context.context,
27
- shouldEvaluateBindings: !0
28
- });
29
- },
30
- canShowBlock() {
31
- return i(this.useBlock.hide) ? !this.useBlock.hide : i(this.useBlock.show) ? this.useBlock.show : !0;
32
- },
33
- css() {
34
- var a;
35
- const e = this.useBlock.responsiveStyles, s = this.context.content, o = C(
36
- ((a = s == null ? void 0 : s.meta) == null ? void 0 : a.breakpoints) || {}
37
- ), n = e == null ? void 0 : e.large, r = e == null ? void 0 : e.medium, l = e == null ? void 0 : e.small, t = this.useBlock.id;
38
- if (!t)
39
- return "";
40
- const m = n ? c({
41
- className: t,
42
- styles: n
43
- }) : "", u = r ? c({
44
- className: t,
45
- styles: r,
46
- mediaQuery: d(
47
- "medium",
48
- o
49
- )
50
- }) : "", p = l ? c({
51
- className: t,
52
- styles: l,
53
- mediaQuery: d(
54
- "small",
55
- o
56
- )
57
- }) : "";
58
- return [m, u, p].join(" ");
59
- }
60
- }
61
- });
62
- function v(e, s, o, n, r, l) {
63
- const t = k("render-inlined-styles");
64
- return e.TARGET !== "reactNative" && e.css && e.canShowBlock ? (y(), f(t, {
65
- key: 0,
66
- styles: e.css
67
- }, null, 8, ["styles"])) : B("", !0);
68
- }
69
- const $ = /* @__PURE__ */ _(w, [["render", v]]);
70
- export {
71
- $ as default
72
- };
@@ -1,75 +0,0 @@
1
- import { e as u } from "./evaluate.0662f166.js";
2
- import { f as p, c as l } from "./index.3a561c6a.js";
3
- const g = (e, t, n) => {
4
- if (Object(e) !== e)
5
- return e;
6
- const s = Array.isArray(t) ? t : t.toString().match(/[^.[\]]+/g);
7
- return s.slice(0, -1).reduce(
8
- (o, r, c) => Object(o[r]) === o[r] ? o[r] : o[r] = Math.abs(Number(s[c + 1])) >> 0 === +s[c + 1] ? [] : {},
9
- e
10
- )[s[s.length - 1]] = n, e;
11
- };
12
- const d = ({
13
- block: e,
14
- context: t,
15
- localState: n,
16
- rootState: s,
17
- rootSetState: o
18
- }) => {
19
- if (!e.bindings)
20
- return e;
21
- const r = p(e), c = {
22
- ...r,
23
- properties: { ...r.properties },
24
- actions: { ...r.actions }
25
- };
26
- for (const i in e.bindings) {
27
- const a = e.bindings[i], f = u({
28
- code: a,
29
- localState: n,
30
- rootState: s,
31
- rootSetState: o,
32
- context: t
33
- });
34
- g(c, i, f);
35
- }
36
- return c;
37
- };
38
- function v({
39
- block: e,
40
- context: t,
41
- shouldEvaluateBindings: n,
42
- localState: s,
43
- rootState: o,
44
- rootSetState: r
45
- }) {
46
- const c = e;
47
- return n ? d({
48
- block: c,
49
- localState: s,
50
- rootState: o,
51
- rootSetState: r,
52
- context: t
53
- }) : c;
54
- }
55
- const m = (e) => e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase(), C = (e) => Object.entries(e).map(([n, s]) => {
56
- if (typeof s == "string")
57
- return `${m(n)}: ${s};`;
58
- }).filter(l), $ = (e) => C(e).join(`
59
- `), A = ({
60
- mediaQuery: e,
61
- className: t,
62
- styles: n
63
- }) => {
64
- const s = `.${t} {
65
- ${$(n)}
66
- }`;
67
- return e ? `${e} {
68
- ${s}
69
- }` : s;
70
- };
71
- export {
72
- C as a,
73
- A as c,
74
- v as g
75
- };
@@ -1,63 +0,0 @@
1
- import { i as d, b as w } from "./index.3a561c6a.js";
2
- function h({
3
- code: n,
4
- context: r,
5
- localState: e,
6
- rootState: s,
7
- rootSetState: i,
8
- event: u,
9
- isExpression: c = !0
10
- }) {
11
- if (n === "") {
12
- console.warn("Skipping evaluation of empty code block.");
13
- return;
14
- }
15
- const t = {
16
- isEditing: d(),
17
- isBrowser: w(),
18
- isServer: !w()
19
- }, l = c && !(n.includes(";") || n.includes(" return ") || n.trim().startsWith("return ")) ? `return (${n});` : n;
20
- try {
21
- return new Function(
22
- "builder",
23
- "Builder",
24
- "state",
25
- "context",
26
- "event",
27
- l
28
- )(
29
- t,
30
- t,
31
- o(s, e, i),
32
- r,
33
- u
34
- );
35
- } catch (f) {
36
- console.warn(
37
- `Builder custom code error:
38
- While Evaluating:
39
- `,
40
- l,
41
- `
42
- `,
43
- f
44
- );
45
- }
46
- }
47
- function o(n, r, e) {
48
- if (n === r)
49
- throw new Error("rootState === localState");
50
- return new Proxy(n, {
51
- get: (s, i) => r && i in r ? r[i] : n[i],
52
- set: (s, i, u) => {
53
- if (r && i in r)
54
- throw new Error(
55
- "Writing to local state is not allowed as it is read-only."
56
- );
57
- return n[i] = u, e == null || e(n), !0;
58
- }
59
- });
60
- }
61
- export {
62
- h as e
63
- };
@@ -1,4 +0,0 @@
1
- "use strict";const t=require("./index.3e17c057.cjs");function f({code:n,context:r,localState:i,rootState:s,rootSetState:e,event:u,isExpression:w=!0}){if(n===""){console.warn("Skipping evaluation of empty code block.");return}const c={isEditing:t.isEditing(),isBrowser:t.isBrowser(),isServer:!t.isBrowser()},l=w&&!(n.includes(";")||n.includes(" return ")||n.trim().startsWith("return "))?`return (${n});`:n;try{return new Function("builder","Builder","state","context","event",l)(c,c,o(s,i,e),r,u)}catch(d){console.warn(`Builder custom code error:
2
- While Evaluating:
3
- `,l,`
4
- `,d)}}function o(n,r,i){if(n===r)throw new Error("rootState === localState");return new Proxy(n,{get:(s,e)=>r&&e in r?r[e]:n[e],set:(s,e,u)=>{if(r&&e in r)throw new Error("Writing to local state is not allowed as it is read-only.");return n[e]=u,i==null||i(n),!0}})}exports.evaluate=f;