@builder.io/sdk-react-nextjs 0.17.6 → 0.17.8
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/blocks-exports.cjs +1 -1
- package/lib/browser/blocks-exports.mjs +14 -12
- package/lib/browser/components/block/components/block-styles.cjs +1 -1
- package/lib/browser/components/block/components/block-styles.mjs +50 -42
- package/lib/browser/components/blocks/blocks-wrapper.cjs +2 -2
- package/lib/browser/components/blocks/blocks-wrapper.mjs +13 -13
- package/lib/browser/constants/device-sizes.cjs +1 -1
- package/lib/browser/constants/device-sizes.mjs +37 -20
- package/lib/browser/constants/sdk-version.cjs +1 -1
- package/lib/browser/constants/sdk-version.mjs +1 -1
- package/lib/browser/helpers/canTrack.cjs +1 -1
- package/lib/browser/helpers/canTrack.mjs +7 -3
- package/lib/browser/helpers/user-attributes.cjs +1 -0
- package/lib/browser/helpers/user-attributes.mjs +45 -0
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +32 -30
- package/lib/browser/scripts/init-editing.cjs +1 -1
- package/lib/browser/scripts/init-editing.mjs +14 -12
- package/lib/edge/blocks-exports.cjs +1 -1
- package/lib/edge/blocks-exports.mjs +14 -12
- package/lib/edge/components/block/components/block-styles.cjs +1 -1
- package/lib/edge/components/block/components/block-styles.mjs +50 -42
- package/lib/edge/components/blocks/blocks-wrapper.cjs +2 -2
- package/lib/edge/components/blocks/blocks-wrapper.mjs +13 -13
- package/lib/edge/constants/device-sizes.cjs +1 -1
- package/lib/edge/constants/device-sizes.mjs +37 -20
- package/lib/edge/constants/sdk-version.cjs +1 -1
- package/lib/edge/constants/sdk-version.mjs +1 -1
- package/lib/edge/helpers/canTrack.cjs +1 -1
- package/lib/edge/helpers/canTrack.mjs +7 -3
- package/lib/edge/helpers/user-attributes.cjs +1 -0
- package/lib/edge/helpers/user-attributes.mjs +45 -0
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +32 -30
- package/lib/edge/scripts/init-editing.cjs +1 -1
- package/lib/edge/scripts/init-editing.mjs +14 -12
- package/lib/node/blocks-exports.cjs +1 -1
- package/lib/node/blocks-exports.mjs +14 -12
- package/lib/node/components/block/components/block-styles.cjs +1 -1
- package/lib/node/components/block/components/block-styles.mjs +50 -42
- package/lib/node/components/blocks/blocks-wrapper.cjs +2 -2
- package/lib/node/components/blocks/blocks-wrapper.mjs +13 -13
- package/lib/node/constants/device-sizes.cjs +1 -1
- package/lib/node/constants/device-sizes.mjs +37 -20
- package/lib/node/constants/sdk-version.cjs +1 -1
- package/lib/node/constants/sdk-version.mjs +1 -1
- package/lib/node/helpers/canTrack.cjs +1 -1
- package/lib/node/helpers/canTrack.mjs +7 -3
- package/lib/node/helpers/user-attributes.cjs +1 -0
- package/lib/node/helpers/user-attributes.mjs +45 -0
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +32 -30
- package/lib/node/scripts/init-editing.cjs +1 -1
- package/lib/node/scripts/init-editing.mjs +14 -12
- package/package.json +1 -1
- package/types/cjs/blocks/personalization-container/component-info.d.ts +2 -0
- package/types/cjs/blocks/personalization-container/helpers/inlined-fns.d.ts +8 -0
- package/types/cjs/blocks/personalization-container/helpers.d.ts +27 -0
- package/types/cjs/blocks/personalization-container/index.d.ts +1 -0
- package/types/cjs/blocks/personalization-container/personalization-container.d.ts +4 -0
- package/types/cjs/blocks/personalization-container/personalization-container.types.d.ts +14 -0
- package/types/cjs/constants/device-sizes.d.ts +3 -2
- package/types/cjs/constants/sdk-version.d.ts +1 -1
- package/types/cjs/helpers/user-attributes.d.ts +17 -0
- package/types/cjs/index-helpers/blocks-exports.d.ts +1 -0
- package/types/cjs/types/builder-block.d.ts +0 -1
- package/types/cjs/types/builder-content.d.ts +1 -0
- package/types/cjs/types/input.d.ts +1 -0
- package/types/esm/blocks/personalization-container/component-info.d.ts +2 -0
- package/types/esm/blocks/personalization-container/helpers/inlined-fns.d.ts +8 -0
- package/types/esm/blocks/personalization-container/helpers.d.ts +27 -0
- package/types/esm/blocks/personalization-container/index.d.ts +1 -0
- package/types/esm/blocks/personalization-container/personalization-container.d.ts +4 -0
- package/types/esm/blocks/personalization-container/personalization-container.types.d.ts +14 -0
- package/types/esm/constants/device-sizes.d.ts +3 -2
- package/types/esm/constants/sdk-version.d.ts +1 -1
- package/types/esm/helpers/user-attributes.d.ts +17 -0
- package/types/esm/index-helpers/blocks-exports.d.ts +1 -0
- package/types/esm/types/builder-block.d.ts +0 -1
- package/types/esm/types/builder-content.d.ts +1 -0
- package/types/esm/types/input.d.ts +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./blocks/button/button.cjs"),t=require("./blocks/columns/columns.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./blocks/button/button.cjs"),t=require("./blocks/columns/columns.cjs"),r=require("./blocks/fragment/fragment.cjs"),o=require("./blocks/image/image.cjs"),n=require("./blocks/section/section.cjs"),s=require("./blocks/symbol/symbol.cjs"),i=require("./blocks/text/text.cjs"),u=require("./blocks/video/video.cjs"),c=require("./components/blocks/blocks.cjs"),l=require("./components/content-variants/content-variants.cjs"),q=require("./context/builder.context.cjs"),b=require("./helpers/user-attributes.cjs");exports.Button=e;exports.Columns=t;exports.Fragment=r;exports.Image=o;exports.Section=n;exports.Symbol=s;exports.Text=i;exports.Video=u;exports.Blocks=c;exports.Content=l;exports.BuilderContext=q;exports.setClientUserAttributes=b.setClientUserAttributes;
|
|
@@ -1,24 +1,26 @@
|
|
|
1
1
|
import { default as o } from "./blocks/button/button.mjs";
|
|
2
|
-
import { default as
|
|
2
|
+
import { default as a } from "./blocks/columns/columns.mjs";
|
|
3
3
|
import { default as l } from "./blocks/fragment/fragment.mjs";
|
|
4
|
-
import { default as
|
|
5
|
-
import { default as
|
|
4
|
+
import { default as s } from "./blocks/image/image.mjs";
|
|
5
|
+
import { default as x } from "./blocks/section/section.mjs";
|
|
6
6
|
import { default as p } from "./blocks/symbol/symbol.mjs";
|
|
7
7
|
import { default as i } from "./blocks/text/text.mjs";
|
|
8
|
-
import { default as
|
|
9
|
-
import { default as
|
|
10
|
-
import { default as
|
|
8
|
+
import { default as B } from "./blocks/video/video.mjs";
|
|
9
|
+
import { default as c } from "./components/blocks/blocks.mjs";
|
|
10
|
+
import { default as S } from "./components/content-variants/content-variants.mjs";
|
|
11
11
|
import { default as y } from "./context/builder.context.mjs";
|
|
12
|
+
import { setClientUserAttributes as F } from "./helpers/user-attributes.mjs";
|
|
12
13
|
export {
|
|
13
|
-
|
|
14
|
+
c as Blocks,
|
|
14
15
|
y as BuilderContext,
|
|
15
16
|
o as Button,
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
a as Columns,
|
|
18
|
+
S as Content,
|
|
18
19
|
l as Fragment,
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
s as Image,
|
|
21
|
+
x as Section,
|
|
21
22
|
p as Symbol,
|
|
22
23
|
i as Text,
|
|
23
|
-
|
|
24
|
+
B as Video,
|
|
25
|
+
F as setClientUserAttributes
|
|
24
26
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const a=require("react/jsx-runtime"),r=require("../../../constants/device-sizes.cjs"),$=require("../../../functions/camel-to-kebab-case.cjs"),o=require("../../../helpers/css.cjs"),B=require("../../../helpers/nullable.cjs"),w=require("../../inlined-styles.cjs");function W(i){const v=function(){const s=i.block;return B.checkIsDefined(s.hide)?!s.hide:B.checkIsDefined(s.show)?s.show:!0},u=function(){var k,x,g,b,f;const s=i.block,e=s.responsiveStyles,t=i.context.content,c=r.getSizesForBreakpoints(((k=t==null?void 0:t.meta)==null?void 0:k.breakpoints)||{}),z=!!((g=(x=t==null?void 0:t.meta)==null?void 0:x.breakpoints)!=null&&g.xsmall),d=e==null?void 0:e.large,y=e==null?void 0:e.medium,S=e==null?void 0:e.small,h=e==null?void 0:e.xsmall,n=s.id;if(!n)return"";const F=d?o.createCssClass({className:n,styles:d}):"",Q=y?o.createCssClass({className:n,styles:y,mediaQuery:r.getMaxWidthQueryForSize("medium",c)}):"",j=S?o.createCssClass({className:n,styles:S,mediaQuery:r.getMaxWidthQueryForSize("small",c)}):"",p=h&&z?o.createCssClass({className:n,styles:h,mediaQuery:r.getMaxWidthQueryForSize("xsmall",c)}):"",l=s.animations&&s.animations.find(m=>m.trigger==="hover");let C="";if(l){const m=((f=(b=l.steps)==null?void 0:b[1])==null?void 0:f.styles)||{};C=o.createCssClass({className:`${n}:hover`,styles:{...m,transition:`all ${l.duration}s ${$.camelToKebabCase(l.easing)}`,transitionDelay:l.delay?`${l.delay}s`:"0s"}})||""}return[F,Q,j,p,C].join(" ")};return a.jsx(a.Fragment,{children:u()&&v()?a.jsx(a.Fragment,{children:a.jsx(w,{id:"builderio-block",styles:u(),nonce:i.context.nonce})}):null})}module.exports=W;
|
|
@@ -1,68 +1,76 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { getSizesForBreakpoints as
|
|
3
|
-
import { camelToKebabCase as
|
|
4
|
-
import { createCssClass as
|
|
5
|
-
import { checkIsDefined as
|
|
6
|
-
import
|
|
7
|
-
function
|
|
8
|
-
const
|
|
9
|
-
const e =
|
|
10
|
-
return
|
|
11
|
-
},
|
|
12
|
-
var
|
|
13
|
-
const e =
|
|
14
|
-
((
|
|
15
|
-
),
|
|
1
|
+
import { jsx as c, Fragment as b } from "react/jsx-runtime";
|
|
2
|
+
import { getSizesForBreakpoints as D, getMaxWidthQueryForSize as m } from "../../../constants/device-sizes.mjs";
|
|
3
|
+
import { camelToKebabCase as I } from "../../../functions/camel-to-kebab-case.mjs";
|
|
4
|
+
import { createCssClass as n } from "../../../helpers/css.mjs";
|
|
5
|
+
import { checkIsDefined as C } from "../../../helpers/nullable.mjs";
|
|
6
|
+
import N from "../../inlined-styles.mjs";
|
|
7
|
+
function U(a) {
|
|
8
|
+
const v = function() {
|
|
9
|
+
const e = a.block;
|
|
10
|
+
return C(e.hide) ? !e.hide : C(e.show) ? e.show : !0;
|
|
11
|
+
}, d = function() {
|
|
12
|
+
var k, p, x, g, B;
|
|
13
|
+
const e = a.block, s = e.responsiveStyles, t = a.context.content, i = D(
|
|
14
|
+
((k = t == null ? void 0 : t.meta) == null ? void 0 : k.breakpoints) || {}
|
|
15
|
+
), Q = !!((x = (p = t == null ? void 0 : t.meta) == null ? void 0 : p.breakpoints) != null && x.xsmall), u = s == null ? void 0 : s.large, y = s == null ? void 0 : s.medium, S = s == null ? void 0 : s.small, f = s == null ? void 0 : s.xsmall, o = e.id;
|
|
16
16
|
if (!o)
|
|
17
17
|
return "";
|
|
18
|
-
const
|
|
18
|
+
const $ = u ? n({
|
|
19
19
|
className: o,
|
|
20
|
-
styles:
|
|
21
|
-
}) : "",
|
|
20
|
+
styles: u
|
|
21
|
+
}) : "", z = y ? n({
|
|
22
22
|
className: o,
|
|
23
|
-
styles:
|
|
24
|
-
mediaQuery:
|
|
23
|
+
styles: y,
|
|
24
|
+
mediaQuery: m(
|
|
25
25
|
"medium",
|
|
26
|
-
|
|
26
|
+
i
|
|
27
27
|
)
|
|
28
|
-
}) : "",
|
|
28
|
+
}) : "", F = S ? n({
|
|
29
29
|
className: o,
|
|
30
|
-
styles:
|
|
31
|
-
mediaQuery:
|
|
30
|
+
styles: S,
|
|
31
|
+
mediaQuery: m(
|
|
32
32
|
"small",
|
|
33
|
-
|
|
33
|
+
i
|
|
34
|
+
)
|
|
35
|
+
}) : "", j = f && Q ? n({
|
|
36
|
+
className: o,
|
|
37
|
+
styles: f,
|
|
38
|
+
mediaQuery: m(
|
|
39
|
+
"xsmall",
|
|
40
|
+
i
|
|
34
41
|
)
|
|
35
|
-
}) : "",
|
|
36
|
-
let
|
|
37
|
-
if (
|
|
38
|
-
const r = ((
|
|
39
|
-
|
|
42
|
+
}) : "", l = e.animations && e.animations.find((r) => r.trigger === "hover");
|
|
43
|
+
let h = "";
|
|
44
|
+
if (l) {
|
|
45
|
+
const r = ((B = (g = l.steps) == null ? void 0 : g[1]) == null ? void 0 : B.styles) || {};
|
|
46
|
+
h = n({
|
|
40
47
|
className: `${o}:hover`,
|
|
41
48
|
styles: {
|
|
42
49
|
...r,
|
|
43
|
-
transition: `all ${
|
|
44
|
-
|
|
50
|
+
transition: `all ${l.duration}s ${I(
|
|
51
|
+
l.easing
|
|
45
52
|
)}`,
|
|
46
|
-
transitionDelay:
|
|
53
|
+
transitionDelay: l.delay ? `${l.delay}s` : "0s"
|
|
47
54
|
}
|
|
48
55
|
}) || "";
|
|
49
56
|
}
|
|
50
57
|
return [
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
58
|
+
$,
|
|
59
|
+
z,
|
|
60
|
+
F,
|
|
61
|
+
j,
|
|
62
|
+
h
|
|
55
63
|
].join(" ");
|
|
56
64
|
};
|
|
57
|
-
return /* @__PURE__ */
|
|
58
|
-
|
|
65
|
+
return /* @__PURE__ */ c(b, { children: d() && v() ? /* @__PURE__ */ c(b, { children: /* @__PURE__ */ c(
|
|
66
|
+
N,
|
|
59
67
|
{
|
|
60
68
|
id: "builderio-block",
|
|
61
|
-
styles:
|
|
62
|
-
nonce:
|
|
69
|
+
styles: d(),
|
|
70
|
+
nonce: a.context.nonce
|
|
63
71
|
}
|
|
64
72
|
) }) : null });
|
|
65
73
|
}
|
|
66
74
|
export {
|
|
67
|
-
|
|
75
|
+
U as default
|
|
68
76
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
"use client";"use strict";const i=require("react/jsx-runtime"),
|
|
1
|
+
"use client";"use strict";const i=require("react/jsx-runtime"),r=require("react"),l=require("../../functions/is-editing.cjs");function u(e){const c=r.useRef(null);function o(){var t;return["builder-blocks",(t=e.blocks)!=null&&t.length?"":"no-blocks",e.classNameProp].filter(Boolean).join(" ")}function a(){if(!e.path)return;const t="this.",n="component.options.";return e.path.startsWith(t)?e.path.replace(t,""):e.path.startsWith(n)?e.path:`${n}${e.path||""}`}function s(){var t,n;l.isEditing()&&!((t=e.blocks)!=null&&t.length)&&((n=window.parent)==null||n.postMessage({type:"builder.clickEmptyBlocks",data:{parentElementId:e.parent,dataPath:a()}},"*"))}function d(){var t,n;l.isEditing()&&!((t=e.blocks)!=null&&t.length)&&((n=window.parent)==null||n.postMessage({type:"builder.hoverEmptyBlocks",data:{parentElementId:e.parent,dataPath:a()}},"*"))}return r.useEffect(()=>{},[]),i.jsxs(i.Fragment,{children:[i.jsx(e.BlocksWrapper,{ref:c,className:o()+" props-blocks-wrapper-78b0d3be","builder-path":a(),"builder-parent-id":e.parent,style:e.styleProp,onClick:t=>s(),onMouseEnter:t=>d(),onKeyPress:t=>s(),...e.BlocksWrapperProps,children:e.children}),i.jsx("style",{children:`.props-blocks-wrapper-78b0d3be {
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
align-items: stretch;
|
|
5
|
-
}`})]})}module.exports=
|
|
5
|
+
}`})]})}module.exports=u;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as d, Fragment as
|
|
3
|
-
import { useRef as f, useEffect as
|
|
2
|
+
import { jsxs as d, Fragment as h, jsx as r } from "react/jsx-runtime";
|
|
3
|
+
import { useRef as f, useEffect as u } from "react";
|
|
4
4
|
import { isEditing as i } from "../../functions/is-editing.mjs";
|
|
5
|
-
function
|
|
5
|
+
function k(e) {
|
|
6
6
|
const o = f(null);
|
|
7
|
-
function
|
|
7
|
+
function s() {
|
|
8
8
|
var t;
|
|
9
9
|
return [
|
|
10
10
|
"builder-blocks",
|
|
@@ -15,8 +15,8 @@ function b(e) {
|
|
|
15
15
|
function a() {
|
|
16
16
|
if (!e.path)
|
|
17
17
|
return;
|
|
18
|
-
const t = "component.options.";
|
|
19
|
-
return e.path.startsWith(t) ? e.path : `${
|
|
18
|
+
const t = "this.", n = "component.options.";
|
|
19
|
+
return e.path.startsWith(t) ? e.path.replace(t, "") : e.path.startsWith(n) ? e.path : `${n}${e.path || ""}`;
|
|
20
20
|
}
|
|
21
21
|
function l() {
|
|
22
22
|
var t, n;
|
|
@@ -31,7 +31,7 @@ function b(e) {
|
|
|
31
31
|
"*"
|
|
32
32
|
));
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function c() {
|
|
35
35
|
var t, n;
|
|
36
36
|
i() && !((t = e.blocks) != null && t.length) && ((n = window.parent) == null || n.postMessage(
|
|
37
37
|
{
|
|
@@ -44,24 +44,24 @@ function b(e) {
|
|
|
44
44
|
"*"
|
|
45
45
|
));
|
|
46
46
|
}
|
|
47
|
-
return
|
|
48
|
-
}, []), /* @__PURE__ */ d(
|
|
47
|
+
return u(() => {
|
|
48
|
+
}, []), /* @__PURE__ */ d(h, { children: [
|
|
49
49
|
/* @__PURE__ */ r(
|
|
50
50
|
e.BlocksWrapper,
|
|
51
51
|
{
|
|
52
52
|
ref: o,
|
|
53
|
-
className:
|
|
53
|
+
className: s() + " props-blocks-wrapper-78b0d3be",
|
|
54
54
|
"builder-path": a(),
|
|
55
55
|
"builder-parent-id": e.parent,
|
|
56
56
|
style: e.styleProp,
|
|
57
57
|
onClick: (t) => l(),
|
|
58
|
-
onMouseEnter: (t) =>
|
|
58
|
+
onMouseEnter: (t) => c(),
|
|
59
59
|
onKeyPress: (t) => l(),
|
|
60
60
|
...e.BlocksWrapperProps,
|
|
61
61
|
children: e.children
|
|
62
62
|
}
|
|
63
63
|
),
|
|
64
|
-
/* @__PURE__ */ r("style", { children: `.props-blocks-wrapper-
|
|
64
|
+
/* @__PURE__ */ r("style", { children: `.props-blocks-wrapper-78b0d3be {
|
|
65
65
|
display: flex;
|
|
66
66
|
flex-direction: column;
|
|
67
67
|
align-items: stretch;
|
|
@@ -69,5 +69,5 @@ function b(e) {
|
|
|
69
69
|
] });
|
|
70
70
|
}
|
|
71
71
|
export {
|
|
72
|
-
|
|
72
|
+
k as default
|
|
73
73
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("../functions/fast-clone.cjs"),r={xsmall:{min:0,default:160,max:320},small:{min:321,default:321,max:640},medium:{min:641,default:642,max:991},large:{min:990,default:991,max:1200}},x=(a,e=r)=>`@media (max-width: ${e[a].max}px)`,d=a=>{const e=u.fastClone(r);if(!a)return e;const{xsmall:m,small:t,medium:l}=a;if(m){const o=Math.floor(m/2);e.xsmall={max:m,min:o,default:o+1}}if(!t||!l)return e;const i=m?e.xsmall.max+1:Math.floor(t/2);e.small={max:t,min:i,default:i+1};const n=e.small.max+1;e.medium={max:l,min:n,default:n+1};const s=e.medium.max+1;return e.large={max:2e3,min:s,default:s+1},e};exports.getMaxWidthQueryForSize=x;exports.getSizesForBreakpoints=d;
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import { fastClone as
|
|
1
|
+
import { fastClone as r } from "../functions/fast-clone.mjs";
|
|
2
2
|
const o = {
|
|
3
|
+
xsmall: {
|
|
4
|
+
min: 0,
|
|
5
|
+
default: 160,
|
|
6
|
+
max: 320
|
|
7
|
+
},
|
|
3
8
|
small: {
|
|
4
|
-
min:
|
|
9
|
+
min: 321,
|
|
5
10
|
default: 321,
|
|
6
11
|
max: 640
|
|
7
12
|
},
|
|
@@ -15,34 +20,46 @@ const o = {
|
|
|
15
20
|
default: 991,
|
|
16
21
|
max: 1200
|
|
17
22
|
}
|
|
18
|
-
},
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
const
|
|
23
|
-
|
|
23
|
+
}, d = (a, m = o) => `@media (max-width: ${m[a].max}px)`, f = (a) => {
|
|
24
|
+
const m = r(o);
|
|
25
|
+
if (!a)
|
|
26
|
+
return m;
|
|
27
|
+
const {
|
|
28
|
+
xsmall: l,
|
|
29
|
+
small: e,
|
|
30
|
+
medium: t
|
|
31
|
+
} = a;
|
|
32
|
+
if (l) {
|
|
33
|
+
const x = Math.floor(l / 2);
|
|
34
|
+
m.xsmall = {
|
|
35
|
+
max: l,
|
|
36
|
+
min: x,
|
|
37
|
+
default: x + 1
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
if (!e || !t)
|
|
24
41
|
return m;
|
|
25
|
-
const
|
|
42
|
+
const i = l ? m.xsmall.max + 1 : Math.floor(e / 2);
|
|
26
43
|
m.small = {
|
|
27
|
-
max: a,
|
|
28
|
-
min: t,
|
|
29
|
-
default: t + 1
|
|
30
|
-
};
|
|
31
|
-
const i = m.small.max + 1;
|
|
32
|
-
m.medium = {
|
|
33
44
|
max: e,
|
|
34
45
|
min: i,
|
|
35
46
|
default: i + 1
|
|
36
47
|
};
|
|
37
|
-
const n = m.
|
|
48
|
+
const n = m.small.max + 1;
|
|
49
|
+
m.medium = {
|
|
50
|
+
max: t,
|
|
51
|
+
min: n,
|
|
52
|
+
default: n + 1
|
|
53
|
+
};
|
|
54
|
+
const s = m.medium.max + 1;
|
|
38
55
|
return m.large = {
|
|
39
56
|
max: 2e3,
|
|
40
57
|
// TODO: decide upper limit
|
|
41
|
-
min:
|
|
42
|
-
default:
|
|
58
|
+
min: s,
|
|
59
|
+
default: s + 1
|
|
43
60
|
}, m;
|
|
44
61
|
};
|
|
45
62
|
export {
|
|
46
|
-
|
|
47
|
-
|
|
63
|
+
d as getMaxWidthQueryForSize,
|
|
64
|
+
f as getSizesForBreakpoints
|
|
48
65
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="0.17.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="0.17.8";exports.SDK_VERSION=e;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./nullable.cjs"),u=require("./user-attributes.cjs"),s=e=>{const t=r.checkIsDefined(e)?e:!0;return u.userAttributesService.setCanTrack(t),t};exports.getDefaultCanTrack=s;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import { checkIsDefined as
|
|
2
|
-
|
|
1
|
+
import { checkIsDefined as r } from "./nullable.mjs";
|
|
2
|
+
import { userAttributesService as o } from "./user-attributes.mjs";
|
|
3
|
+
const c = (e) => {
|
|
4
|
+
const t = r(e) ? e : !0;
|
|
5
|
+
return o.setCanTrack(t), t;
|
|
6
|
+
};
|
|
3
7
|
export {
|
|
4
|
-
|
|
8
|
+
c as getDefaultCanTrack
|
|
5
9
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("../functions/is-browser.cjs"),n=require("./cookie.cjs"),s="builder.userAttributes";function c(){let t=!0;const r=new Set;return{setUserAttributes(e){if(!u.isBrowser())return;const i={...this.getUserAttributes(),...e};n.setCookie({name:s,value:JSON.stringify(i),canTrack:t}),r.forEach(b=>b(i))},getUserAttributes(){return u.isBrowser()?JSON.parse(n.getCookieSync({name:s,canTrack:t})||"{}"):{}},subscribeOnUserAttributesChange(e){return r.add(e),()=>{r.delete(e)}},setCanTrack(e){t=e}}}const o=c(),A=t=>{o.setUserAttributes(t)};exports.USER_ATTRIBUTES_COOKIE_NAME=s;exports.createUserAttributesService=c;exports.setClientUserAttributes=A;exports.userAttributesService=o;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { isBrowser as i } from "../functions/is-browser.mjs";
|
|
2
|
+
import { setCookie as o, getCookieSync as b } from "./cookie.mjs";
|
|
3
|
+
const u = "builder.userAttributes";
|
|
4
|
+
function c() {
|
|
5
|
+
let e = !0;
|
|
6
|
+
const r = /* @__PURE__ */ new Set();
|
|
7
|
+
return {
|
|
8
|
+
setUserAttributes(t) {
|
|
9
|
+
if (!i())
|
|
10
|
+
return;
|
|
11
|
+
const s = {
|
|
12
|
+
...this.getUserAttributes(),
|
|
13
|
+
...t
|
|
14
|
+
};
|
|
15
|
+
o({
|
|
16
|
+
name: u,
|
|
17
|
+
value: JSON.stringify(s),
|
|
18
|
+
canTrack: e
|
|
19
|
+
}), r.forEach((n) => n(s));
|
|
20
|
+
},
|
|
21
|
+
getUserAttributes() {
|
|
22
|
+
return i() ? JSON.parse(b({
|
|
23
|
+
name: u,
|
|
24
|
+
canTrack: e
|
|
25
|
+
}) || "{}") : {};
|
|
26
|
+
},
|
|
27
|
+
subscribeOnUserAttributesChange(t) {
|
|
28
|
+
return r.add(t), () => {
|
|
29
|
+
r.delete(t);
|
|
30
|
+
};
|
|
31
|
+
},
|
|
32
|
+
setCanTrack(t) {
|
|
33
|
+
e = t;
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
const A = c(), S = (e) => {
|
|
38
|
+
A.setUserAttributes(e);
|
|
39
|
+
};
|
|
40
|
+
export {
|
|
41
|
+
u as USER_ATTRIBUTES_COOKIE_NAME,
|
|
42
|
+
c as createUserAttributesService,
|
|
43
|
+
S as setClientUserAttributes,
|
|
44
|
+
A as userAttributesService
|
|
45
|
+
};
|
package/lib/browser/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./blocks/button/button.cjs"),r=require("./blocks/columns/columns.cjs"),i=require("./blocks/fragment/fragment.cjs"),s=require("./blocks/image/image.cjs"),n=require("./blocks/section/section.cjs"),o=require("./blocks/symbol/symbol.cjs"),c=require("./blocks/text/text.cjs"),u=require("./blocks/video/video.cjs"),g=require("./components/blocks/blocks.cjs"),d=require("./components/content-variants/content-variants.cjs"),q=require("./context/builder.context.cjs"),a=require("./functions/is-editing.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./blocks/button/button.cjs"),r=require("./blocks/columns/columns.cjs"),i=require("./blocks/fragment/fragment.cjs"),s=require("./blocks/image/image.cjs"),n=require("./blocks/section/section.cjs"),o=require("./blocks/symbol/symbol.cjs"),c=require("./blocks/text/text.cjs"),u=require("./blocks/video/video.cjs"),g=require("./components/blocks/blocks.cjs"),d=require("./components/content-variants/content-variants.cjs"),q=require("./context/builder.context.cjs"),a=require("./helpers/user-attributes.cjs"),l=require("./functions/is-editing.cjs"),b=require("./functions/is-previewing.cjs"),m=require("./functions/register-component.cjs"),E=require("./functions/register.cjs"),C=require("./functions/set-editor-settings.cjs"),f=require("./functions/get-builder-search-params/index.cjs"),h=require("./functions/track/index.cjs"),p=require("./helpers/subscribe-to-editor.cjs"),P=require("./functions/fetch-builder-props.cjs"),e=require("./functions/get-content/index.cjs");exports.Button=t;exports.Columns=r;exports.Fragment=i;exports.Image=s;exports.Section=n;exports.Symbol=o;exports.Text=c;exports.Video=u;exports.Blocks=g;exports.Content=d;exports.BuilderContext=q;exports.setClientUserAttributes=a.setClientUserAttributes;exports.isEditing=l.isEditing;exports.isPreviewing=b.isPreviewing;exports.createRegisterComponentMessage=m.createRegisterComponentMessage;exports.register=E.register;exports.setEditorSettings=C.setEditorSettings;exports.getBuilderSearchParams=f.getBuilderSearchParams;exports.track=h.track;exports.subscribeToEditor=p.subscribeToEditor;exports.fetchBuilderProps=P.fetchBuilderProps;exports._processContentResult=e._processContentResult;exports.fetchEntries=e.fetchEntries;exports.fetchOneEntry=e.fetchOneEntry;
|
package/lib/browser/index.mjs
CHANGED
|
@@ -1,46 +1,48 @@
|
|
|
1
|
-
import { default as
|
|
1
|
+
import { default as r } from "./blocks/button/button.mjs";
|
|
2
2
|
import { default as f } from "./blocks/columns/columns.mjs";
|
|
3
|
-
import { default as
|
|
3
|
+
import { default as a } from "./blocks/fragment/fragment.mjs";
|
|
4
4
|
import { default as p } from "./blocks/image/image.mjs";
|
|
5
|
-
import { default as
|
|
6
|
-
import { default as
|
|
5
|
+
import { default as i } from "./blocks/section/section.mjs";
|
|
6
|
+
import { default as u } from "./blocks/symbol/symbol.mjs";
|
|
7
7
|
import { default as n } from "./blocks/text/text.mjs";
|
|
8
8
|
import { default as g } from "./blocks/video/video.mjs";
|
|
9
|
-
import { default as
|
|
10
|
-
import { default as
|
|
11
|
-
import { default as
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
9
|
+
import { default as B } from "./components/blocks/blocks.mjs";
|
|
10
|
+
import { default as b } from "./components/content-variants/content-variants.mjs";
|
|
11
|
+
import { default as S } from "./context/builder.context.mjs";
|
|
12
|
+
import { setClientUserAttributes as k } from "./helpers/user-attributes.mjs";
|
|
13
|
+
import { isEditing as R } from "./functions/is-editing.mjs";
|
|
14
|
+
import { isPreviewing as v } from "./functions/is-previewing.mjs";
|
|
15
|
+
import { createRegisterComponentMessage as A } from "./functions/register-component.mjs";
|
|
16
|
+
import { register as I } from "./functions/register.mjs";
|
|
17
|
+
import { setEditorSettings as O } from "./functions/set-editor-settings.mjs";
|
|
17
18
|
import { getBuilderSearchParams as V } from "./functions/get-builder-search-params/index.mjs";
|
|
18
19
|
import { track as j } from "./functions/track/index.mjs";
|
|
19
20
|
import { subscribeToEditor as z } from "./helpers/subscribe-to-editor.mjs";
|
|
20
|
-
import { fetchBuilderProps as
|
|
21
|
-
import { _processContentResult as
|
|
21
|
+
import { fetchBuilderProps as G } from "./functions/fetch-builder-props.mjs";
|
|
22
|
+
import { _processContentResult as J, fetchEntries as K, fetchOneEntry as L } from "./functions/get-content/index.mjs";
|
|
22
23
|
export {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
B as Blocks,
|
|
25
|
+
S as BuilderContext,
|
|
26
|
+
r as Button,
|
|
26
27
|
f as Columns,
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
b as Content,
|
|
29
|
+
a as Fragment,
|
|
29
30
|
p as Image,
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
i as Section,
|
|
32
|
+
u as Symbol,
|
|
32
33
|
n as Text,
|
|
33
34
|
g as Video,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
J as _processContentResult,
|
|
36
|
+
A as createRegisterComponentMessage,
|
|
37
|
+
G as fetchBuilderProps,
|
|
38
|
+
K as fetchEntries,
|
|
39
|
+
L as fetchOneEntry,
|
|
39
40
|
V as getBuilderSearchParams,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
R as isEditing,
|
|
42
|
+
v as isPreviewing,
|
|
43
|
+
I as register,
|
|
44
|
+
k as setClientUserAttributes,
|
|
45
|
+
O as setEditorSettings,
|
|
44
46
|
z as subscribeToEditor,
|
|
45
47
|
j as track
|
|
46
48
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("../constants/sdk-version.cjs"),y=require("../constants/target.cjs"),b=require("../functions/is-browser.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("../constants/sdk-version.cjs"),y=require("../constants/target.cjs"),b=require("../functions/is-browser.cjs"),B=require("../functions/is-from-trusted-host.cjs"),M=require("../functions/register.cjs"),E=()=>{M.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 c=!1;const S=(o={})=>{var a,i;c||(c=!0,b.isBrowser()&&((a=window.parent)==null||a.postMessage({type:"builder.sdkInfo",data:{target:y.TARGET,version:f.SDK_VERSION,supportsPatchUpdates:!1,supportsAddBlockScoping:!0,supportsCustomBreakpoints:!0,supportsXSmallBreakpoint:!0,blockLevelPersonalization:!0}},"*"),(i=window.parent)==null||i.postMessage({type:"builder.updateContent",data:{options:o}},"*"),window.addEventListener("message",u=>{var d,l;if(!B.isFromTrustedHost(o.trustedHosts,u))return;const{data:e}=u;if(e!=null&&e.type)switch(e.type){case"builder.evaluate":{const g=e.data.text,m=e.data.arguments||[],r=e.data.id,w=new Function(g);let t,s=null;try{t=w.apply(null,m)}catch(n){s=n}s?(d=window.parent)==null||d.postMessage({type:"builder.evaluateError",data:{id:r,error:s.message}},"*"):t&&typeof t.then=="function"?t.then(n=>{var p;(p=window.parent)==null||p.postMessage({type:"builder.evaluateResult",data:{id:r,result:n}},"*")}).catch(console.error):(l=window.parent)==null||l.postMessage({type:"builder.evaluateResult",data:{result:t,id:r}},"*");break}}})))};exports.registerInsertMenu=E;exports.setupBrowserForEditing=S;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { SDK_VERSION as w } from "../constants/sdk-version.mjs";
|
|
2
2
|
import { TARGET as y } from "../constants/target.mjs";
|
|
3
3
|
import { isBrowser as b } from "../functions/is-browser.mjs";
|
|
4
|
-
import { isFromTrustedHost as
|
|
5
|
-
import { register as
|
|
4
|
+
import { isFromTrustedHost as B } from "../functions/is-from-trusted-host.mjs";
|
|
5
|
+
import { register as C } from "../functions/register.mjs";
|
|
6
6
|
const S = () => {
|
|
7
|
-
|
|
7
|
+
C("insertMenu", {
|
|
8
8
|
name: "_default",
|
|
9
9
|
default: !0,
|
|
10
10
|
items: [{
|
|
@@ -27,7 +27,7 @@ const S = () => {
|
|
|
27
27
|
});
|
|
28
28
|
};
|
|
29
29
|
let m = !1;
|
|
30
|
-
const
|
|
30
|
+
const x = (a = {}) => {
|
|
31
31
|
var n, i;
|
|
32
32
|
m || (m = !0, b() && ((n = window.parent) == null || n.postMessage({
|
|
33
33
|
type: "builder.sdkInfo",
|
|
@@ -38,16 +38,18 @@ const k = (o = {}) => {
|
|
|
38
38
|
// Supports builder-model="..." attribute which is needed to
|
|
39
39
|
// scope our '+ add block' button styling
|
|
40
40
|
supportsAddBlockScoping: !0,
|
|
41
|
-
supportsCustomBreakpoints: !0
|
|
41
|
+
supportsCustomBreakpoints: !0,
|
|
42
|
+
supportsXSmallBreakpoint: !0,
|
|
43
|
+
blockLevelPersonalization: !0
|
|
42
44
|
}
|
|
43
45
|
}, "*"), (i = window.parent) == null || i.postMessage({
|
|
44
46
|
type: "builder.updateContent",
|
|
45
47
|
data: {
|
|
46
|
-
options:
|
|
48
|
+
options: a
|
|
47
49
|
}
|
|
48
50
|
}, "*"), window.addEventListener("message", (u) => {
|
|
49
51
|
var p, d;
|
|
50
|
-
if (!
|
|
52
|
+
if (!B(a.trustedHosts, u))
|
|
51
53
|
return;
|
|
52
54
|
const {
|
|
53
55
|
data: e
|
|
@@ -59,8 +61,8 @@ const k = (o = {}) => {
|
|
|
59
61
|
let t, s = null;
|
|
60
62
|
try {
|
|
61
63
|
t = g.apply(null, f);
|
|
62
|
-
} catch (
|
|
63
|
-
s =
|
|
64
|
+
} catch (o) {
|
|
65
|
+
s = o;
|
|
64
66
|
}
|
|
65
67
|
s ? (p = window.parent) == null || p.postMessage({
|
|
66
68
|
type: "builder.evaluateError",
|
|
@@ -68,13 +70,13 @@ const k = (o = {}) => {
|
|
|
68
70
|
id: r,
|
|
69
71
|
error: s.message
|
|
70
72
|
}
|
|
71
|
-
}, "*") : t && typeof t.then == "function" ? t.then((
|
|
73
|
+
}, "*") : t && typeof t.then == "function" ? t.then((o) => {
|
|
72
74
|
var l;
|
|
73
75
|
(l = window.parent) == null || l.postMessage({
|
|
74
76
|
type: "builder.evaluateResult",
|
|
75
77
|
data: {
|
|
76
78
|
id: r,
|
|
77
|
-
result:
|
|
79
|
+
result: o
|
|
78
80
|
}
|
|
79
81
|
}, "*");
|
|
80
82
|
}).catch(console.error) : (d = window.parent) == null || d.postMessage({
|
|
@@ -91,5 +93,5 @@ const k = (o = {}) => {
|
|
|
91
93
|
};
|
|
92
94
|
export {
|
|
93
95
|
S as registerInsertMenu,
|
|
94
|
-
|
|
96
|
+
x as setupBrowserForEditing
|
|
95
97
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./blocks/button/button.cjs"),t=require("./blocks/columns/columns.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./blocks/button/button.cjs"),t=require("./blocks/columns/columns.cjs"),r=require("./blocks/fragment/fragment.cjs"),o=require("./blocks/image/image.cjs"),n=require("./blocks/section/section.cjs"),s=require("./blocks/symbol/symbol.cjs"),i=require("./blocks/text/text.cjs"),u=require("./blocks/video/video.cjs"),c=require("./components/blocks/blocks.cjs"),l=require("./components/content-variants/content-variants.cjs"),q=require("./context/builder.context.cjs"),b=require("./helpers/user-attributes.cjs");exports.Button=e;exports.Columns=t;exports.Fragment=r;exports.Image=o;exports.Section=n;exports.Symbol=s;exports.Text=i;exports.Video=u;exports.Blocks=c;exports.Content=l;exports.BuilderContext=q;exports.setClientUserAttributes=b.setClientUserAttributes;
|