@builder.io/sdk-react 1.0.17 → 1.0.19-dev-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/browser/blocks-exports.cjs +14 -14
- package/lib/browser/blocks-exports.mjs +350 -339
- package/lib/browser/index.cjs +1 -1
- package/lib/browser/index.mjs +22 -21
- package/lib/browser/init.cjs +1 -0
- package/lib/browser/init.mjs +13 -0
- package/lib/browser/{server-entry-a7b75909.cjs → server-entry-1a86f409.cjs} +1 -1
- package/lib/browser/{server-entry-064a8b7f.js → server-entry-cfff49d1.js} +1 -1
- package/lib/browser/server-entry.cjs +1 -1
- package/lib/browser/server-entry.mjs +1 -1
- package/lib/edge/{blocks-1f59d1c0.cjs → blocks-0397d1b3.cjs} +9 -9
- package/lib/edge/{blocks-fe027bf7.js → blocks-055d1c68.js} +209 -223
- package/lib/edge/blocks-exports.cjs +1 -1
- package/lib/edge/blocks-exports.mjs +27 -13
- package/lib/edge/{button-8fdd068a.js → button-14d13356.js} +3 -3
- package/lib/edge/{button-36ac5d97.cjs → button-58695538.cjs} +1 -1
- package/lib/edge/{columns-4f789807.js → columns-41560f8a.js} +48 -47
- package/lib/edge/columns-88c413d0.cjs +28 -0
- package/lib/edge/{content-variants-a26825d5.js → content-variants-8d6bee85.js} +75 -75
- package/lib/edge/{content-variants-87f99284.cjs → content-variants-b0cbabea.cjs} +5 -5
- package/lib/edge/dynamic-blocks-exports.cjs +2 -0
- package/lib/edge/dynamic-blocks-exports.mjs +4 -1
- package/lib/edge/{dynamic-renderer-b29b45ca.cjs → dynamic-renderer-1c9f24c0.cjs} +1 -1
- package/lib/edge/dynamic-renderer-96ba4e48.js +8 -0
- package/lib/edge/form-489500da.cjs +1 -0
- package/lib/edge/{form-004ab04e.js → form-56a68fe5.js} +69 -58
- package/lib/edge/{get-class-prop-name-ee5eac9d.js → get-class-prop-name-859a7f60.js} +1 -1
- package/lib/edge/{get-class-prop-name-522545c4.cjs → get-class-prop-name-f1301669.cjs} +1 -1
- package/lib/edge/{image-0008c792.js → image-2cc909d9.js} +25 -25
- package/lib/edge/image-7e1361ce.cjs +17 -0
- package/lib/edge/{img-d311451e.cjs → img-0c1e53c0.cjs} +1 -1
- package/lib/edge/{img-5d36c59d.js → img-b4ff1bef.js} +1 -1
- package/lib/edge/index.cjs +1 -1
- package/lib/edge/index.mjs +22 -21
- package/lib/edge/init.cjs +1 -0
- package/lib/edge/init.mjs +13 -0
- package/lib/edge/{input-34a4e538.cjs → input-2103da14.cjs} +1 -1
- package/lib/edge/{input-211240f4.js → input-c6fee09c.js} +1 -1
- package/lib/edge/{select-a425b313.cjs → select-b8ad0a4c.cjs} +1 -1
- package/lib/edge/{select-e592f42a.js → select-f260d051.js} +1 -1
- package/lib/edge/{server-entry-04a076eb.cjs → server-entry-00891f33.cjs} +1 -1
- package/lib/edge/{server-entry-633c4fab.js → server-entry-d46a218d.js} +1 -1
- package/lib/edge/server-entry.cjs +1 -1
- package/lib/edge/server-entry.mjs +1 -1
- package/lib/edge/slot-6546a4c9.cjs +1 -0
- package/lib/edge/{slot-20e9bd0c.js → slot-6b53b8c4.js} +7 -6
- package/lib/edge/{symbol-8aa6a69b.js → symbol-324dadc8.js} +2 -2
- package/lib/edge/{symbol-441a42f8.cjs → symbol-636383eb.cjs} +1 -1
- package/lib/edge/video-64014cc4.cjs +1 -0
- package/lib/edge/{video-58c2cc8d.js → video-d02ff89b.js} +15 -15
- package/lib/node/blocks-exports.cjs +32 -72
- package/lib/node/blocks-exports.mjs +902 -1017
- package/lib/node/index.cjs +1 -1
- package/lib/node/index.mjs +24 -22
- package/lib/node/init.cjs +1 -0
- package/lib/node/init.mjs +9 -0
- package/lib/node/node-runtime-1ca09d03.js +137 -0
- package/lib/node/node-runtime-87cf9b13.cjs +41 -0
- package/lib/node/{server-entry-a2617044.js → server-entry-8c84ddbd.js} +1 -1
- package/lib/node/{server-entry-e66a06c7.cjs → server-entry-ff6fc2b4.cjs} +1 -1
- package/lib/node/server-entry.cjs +1 -1
- package/lib/node/server-entry.mjs +1 -1
- package/package.json +6 -1
- package/types/blocks/form/component-info.d.ts +2 -0
- package/types/blocks/form/form.d.ts +3 -0
- package/types/blocks/input/component-info.d.ts +2 -0
- package/types/blocks/input/input.d.ts +15 -0
- package/types/blocks/select/component-info.d.ts +2 -0
- package/types/blocks/select/select.d.ts +16 -0
- package/types/blocks/submit-button/component-info.d.ts +2 -0
- package/types/blocks/submit-button/submit-button.d.ts +10 -0
- package/types/components/content/components/context-updater.d.ts +5 -0
- package/types/components/dynamic-renderer.d.ts +3 -0
- package/types/constants/sdk-version.d.ts +1 -1
- package/types/context/index.d.ts +1 -0
- package/types/functions/evaluate/node-runtime/init.d.ts +10 -0
- package/types/functions/evaluate/node-runtime/node-runtime.d.ts +6 -0
- package/types/functions/get-content/types.d.ts +3 -3
- package/types/functions/get-react-native-block-styles.d.ts +15 -0
- package/types/functions/sanitize-react-native-block-styles.d.ts +3 -0
- package/types/functions/sanitize-rn-allowed-css.d.ts +8 -0
- package/types/index-helpers/blocks-exports.d.ts +4 -0
- package/types/node-runtime/index.d.ts +1 -0
- package/types/node-runtime/node-runtime.d.ts +9 -0
- package/types/node-runtime.d.ts +1 -0
- package/lib/edge/columns-36bdc015.cjs +0 -28
- package/lib/edge/dynamic-renderer-8b343325.js +0 -8
- package/lib/edge/form-6b599bb9.cjs +0 -1
- package/lib/edge/image-ee3dd857.cjs +0 -17
- package/lib/edge/slot-1547b467.cjs +0 -1
- package/lib/edge/video-e20dcbbc.cjs +0 -1
|
@@ -29,6 +29,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
29
29
|
var stdin_exports = {};
|
|
30
30
|
__export(stdin_exports, {
|
|
31
31
|
Blocks: () => Blocks,
|
|
32
|
+
BuilderContext: () => BuilderContext,
|
|
32
33
|
Button: () => Button,
|
|
33
34
|
Columns: () => Columns,
|
|
34
35
|
Content: () => Content,
|
|
@@ -56,3 +57,4 @@ const Text = import_blocks_exports.Text;
|
|
|
56
57
|
const Video = import_blocks_exports.Video;
|
|
57
58
|
const Blocks = (props) => isBrowser() ? /* @__PURE__ */ import_react.default.createElement(BrowserSdk.Blocks, { ...props }) : /* @__PURE__ */ import_react.default.createElement(import_blocks_exports.Blocks, { ...props });
|
|
58
59
|
const Content = (props) => isBrowser() ? /* @__PURE__ */ import_react.default.createElement(BrowserSdk.Content, { ...props }) : /* @__PURE__ */ import_react.default.createElement(import_blocks_exports.Content, { ...props });
|
|
60
|
+
const BuilderContext = import_blocks_exports.BuilderContext;
|
|
@@ -14,7 +14,8 @@ import {
|
|
|
14
14
|
Text as EdgeSdkText,
|
|
15
15
|
Video as EdgeSdkVideo,
|
|
16
16
|
Blocks as EdgeSdkBlocks,
|
|
17
|
-
Content as EdgeSdkContent
|
|
17
|
+
Content as EdgeSdkContent,
|
|
18
|
+
BuilderContext as EdgeSdkBuilderContext
|
|
18
19
|
} from "./blocks-exports.mjs";
|
|
19
20
|
const Button = EdgeSdkButton;
|
|
20
21
|
const Columns = EdgeSdkColumns;
|
|
@@ -26,8 +27,10 @@ const Text = EdgeSdkText;
|
|
|
26
27
|
const Video = EdgeSdkVideo;
|
|
27
28
|
const Blocks = (props) => isBrowser() ? /* @__PURE__ */ React.createElement(BrowserSdk.Blocks, { ...props }) : /* @__PURE__ */ React.createElement(EdgeSdkBlocks, { ...props });
|
|
28
29
|
const Content = (props) => isBrowser() ? /* @__PURE__ */ React.createElement(BrowserSdk.Content, { ...props }) : /* @__PURE__ */ React.createElement(EdgeSdkContent, { ...props });
|
|
30
|
+
const BuilderContext = EdgeSdkBuilderContext;
|
|
29
31
|
export {
|
|
30
32
|
Blocks,
|
|
33
|
+
BuilderContext,
|
|
31
34
|
Button,
|
|
32
35
|
Columns,
|
|
33
36
|
Content,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const t=require("react/jsx-runtime"),n=new Set(["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),a=e=>typeof e=="string"&&n.has(e.toLowerCase());function i(e){return t.jsx(t.Fragment,{children:a(e.TagName)?t.jsx(t.Fragment,{children:t.jsx(e.TagName,{...e.attributes,...e.actionAttributes})}):t.jsx(t.Fragment,{children:typeof e.TagName=="string"?t.jsx(e.TagName,{...e.attributes,...e.actionAttributes,children:e.children}):t.jsx(e.TagName,{...e.attributes,...e.actionAttributes,children:e.children})})})}exports.DynamicRenderer=i;
|
|
1
|
+
"use strict";const t=require("react/jsx-runtime"),n=new Set(["area","base","br","col","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"]),a=e=>typeof e=="string"&&n.has(e.toLowerCase());function i(e){return t.jsx(t.Fragment,{children:a(e.TagName)?t.jsx(t.Fragment,{children:t.jsx(e.TagName,{...e.attributes,...e.actionAttributes})}):t.jsx(t.Fragment,{children:typeof e.TagName=="string"?t.jsx(t.Fragment,{children:t.jsx(e.TagName,{...e.attributes,...e.actionAttributes,children:e.children})}):t.jsx(t.Fragment,{children:t.jsx(e.TagName,{...e.attributes,...e.actionAttributes,children:e.children})})})})}exports.DynamicRenderer=i;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as t, Fragment as n } from "react/jsx-runtime";
|
|
2
|
+
const i = /* @__PURE__ */ new Set(["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"]), a = (e) => typeof e == "string" && i.has(e.toLowerCase());
|
|
3
|
+
function c(e) {
|
|
4
|
+
return /* @__PURE__ */ t(n, { children: a(e.TagName) ? /* @__PURE__ */ t(n, { children: /* @__PURE__ */ t(e.TagName, { ...e.attributes, ...e.actionAttributes }) }) : /* @__PURE__ */ t(n, { children: typeof e.TagName == "string" ? /* @__PURE__ */ t(n, { children: /* @__PURE__ */ t(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) }) : /* @__PURE__ */ t(n, { children: /* @__PURE__ */ t(e.TagName, { ...e.attributes, ...e.actionAttributes, children: e.children }) }) }) });
|
|
5
|
+
}
|
|
6
|
+
export {
|
|
7
|
+
c as DynamicRenderer
|
|
8
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),v=require("react"),f=require("./blocks-0397d1b3.cjs"),P=require("./server-entry-00891f33.cjs");require("./blocks-exports.cjs");require("./get-class-prop-name-f1301669.cjs");require("./dynamic-renderer-1c9f24c0.cjs");const B=["production","qa","test","development","dev","cdn-qa","cloud","fast","cdn2","cdn-prod"],D=()=>{const e=process.env.NODE_ENV||"production";return B.includes(e)?e:"production"},A=(e,i,y)=>{const a=String.prototype.split.call(i,/[,[\].]+?/).filter(Boolean).reduce((c,b)=>c!=null?c[b]:c,e);return a===void 0||a===e?y:a};function O(e){var S,E;const i=v.useRef(null),[y,a]=v.useState(()=>"unsubmitted"),[c,b]=v.useState(()=>null),[J,M]=v.useState(()=>"");function T(o){var m,g;const u={...e.builderContext.rootState,...o};e.builderContext.rootSetState?(g=(m=e.builderContext).rootSetState)==null||g.call(m,u):e.builderContext.rootState=u}function h(){return P.isEditing()&&e.previewState||y}function q(o){var m;const u=e.sendWithJs||e.sendSubmissionsTo==="email";if(e.sendSubmissionsTo==="zapier")o.preventDefault();else if(u){if(!(e.action||e.sendSubmissionsTo==="email")){o.preventDefault();return}o.preventDefault();const g=o.currentTarget,k=e.customHeaders||{};let x;const N=new FormData(g),C=Array.from(o.currentTarget.querySelectorAll("input,select,textarea")).filter(t=>!!t.name).map(t=>{let n;const l=t.name;if(t instanceof HTMLInputElement)if(t.type==="radio"){if(t.checked)return n=t.name,{key:l,value:n}}else if(t.type==="checkbox")n=t.checked;else if(t.type==="number"||t.type==="range"){const s=t.valueAsNumber;isNaN(s)||(n=s)}else t.type==="file"?n=t.files:n=t.value;else n=t.value;return{key:l,value:n}});let d=e.contentType;if(e.sendSubmissionsTo==="email"&&(d="multipart/form-data"),Array.from(C).forEach(({value:t})=>{(t instanceof File||Array.isArray(t)&&t[0]instanceof File||t instanceof FileList)&&(d="multipart/form-data")}),d!=="application/json")x=N;else{const t={};Array.from(C).forEach(({value:n,key:l})=>{f.set(t,l,n)}),x=JSON.stringify(t)}d&&d!=="multipart/form-data"&&(u&&((m=e.action)!=null&&m.includes("zapier.com"))||(k["content-type"]=d));const j=new CustomEvent("presubmit",{detail:{body:x}});if(i.current&&(i.current.dispatchEvent(j),j.defaultPrevented))return;a("sending");const w=`${D()==="dev"?"http://localhost:5000":"https://builder.io"}/api/v1/form-submit?apiKey=${e.builderContext.apiKey}&to=${btoa(e.sendSubmissionsToEmail||"")}&name=${encodeURIComponent(e.name||"")}`;fetch(e.sendSubmissionsTo==="email"?w:e.action,{body:x,headers:k,method:e.method||"post"}).then(async t=>{let n;const l=t.headers.get("content-type");if(l&&l.indexOf("application/json")!==-1?n=await t.json():n=await t.text(),!t.ok&&e.errorMessagePath){let s=A(n,e.errorMessagePath);s&&(typeof s!="string"&&(s=JSON.stringify(s)),M(s),T({formErrorMessage:s}))}if(b(n),a(t.ok?"success":"error"),t.ok){const s=new CustomEvent("submit:success",{detail:{res:t,body:n}});if(i.current){if(i.current.dispatchEvent(s),s.defaultPrevented)return;e.resetFormOnSubmit!==!1&&i.current.reset()}if(e.successUrl)if(i.current){const F=new CustomEvent("route",{detail:{url:e.successUrl}});i.current.dispatchEvent(F),F.defaultPrevented||(location.href=e.successUrl)}else location.href=e.successUrl}},t=>{const n=new CustomEvent("submit:error",{detail:{error:t}});i.current&&(i.current.dispatchEvent(n),n.defaultPrevented)||(b(t),a("error"))})}}return r.jsxs(r.Fragment,{children:[" ",r.jsxs("form",{validate:e.validate,ref:i,action:!e.sendWithJs&&e.action,method:e.method,name:e.name,onSubmit:o=>q(o),...e.attributes,children:[" ",e.builderBlock&&e.builderBlock.children?r.jsx(r.Fragment,{children:(E=(S=e.builderBlock)==null?void 0:S.children)==null?void 0:E.map((o,u)=>r.jsx(f.Block,{block:o,context:e.builderContext,registeredComponents:e.builderComponents,linkComponent:e.builderLinkComponent},`form-block-${u}`))}):null," ",h()==="error"?r.jsx(r.Fragment,{children:r.jsx(f.Blocks,{path:"errorMessage",blocks:e.errorMessage,context:e.builderContext})}):null," ",h()==="sending"?r.jsx(r.Fragment,{children:r.jsx(f.Blocks,{path:"sendingMessage",blocks:e.sendingMessage,context:e.builderContext})}):null," ",h()==="error"&&c?r.jsx(r.Fragment,{children:r.jsxs("pre",{className:"builder-form-error-text pre-25b9edf0",children:[" ",JSON.stringify(c,null,2)," "]})}):null," ",h()==="success"?r.jsx(r.Fragment,{children:r.jsx(f.Blocks,{path:"successMessage",blocks:e.successMessage,context:e.builderContext})}):null," "]})," ",r.jsx("style",{children:".pre-25b9edf0 { padding: 10px; color: red; text-align: center; }"})," "]})}exports.default=O;
|
|
@@ -1,53 +1,54 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useRef as J, useState as
|
|
3
|
-
import { Block as O, Blocks as
|
|
4
|
-
import { isEditing as j } from "./server-entry-
|
|
5
|
-
import "./
|
|
6
|
-
import "./
|
|
1
|
+
import { jsxs as S, Fragment as m, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as J, useState as E } from "react";
|
|
3
|
+
import { Block as O, Blocks as x, set as U } from "./blocks-055d1c68.js";
|
|
4
|
+
import { isEditing as j } from "./server-entry-d46a218d.js";
|
|
5
|
+
import "./blocks-exports.mjs";
|
|
6
|
+
import "./get-class-prop-name-859a7f60.js";
|
|
7
|
+
import "./dynamic-renderer-96ba4e48.js";
|
|
7
8
|
const R = ["production", "qa", "test", "development", "dev", "cdn-qa", "cloud", "fast", "cdn2", "cdn-prod"], $ = () => {
|
|
8
9
|
const e = process.env.NODE_ENV || "production";
|
|
9
10
|
return R.includes(e) ? e : "production";
|
|
10
|
-
}, L = (e, i,
|
|
11
|
-
const
|
|
12
|
-
return
|
|
11
|
+
}, L = (e, i, y) => {
|
|
12
|
+
const a = String.prototype.split.call(i, /[,[\].]+?/).filter(Boolean).reduce((c, b) => c != null ? c[b] : c, e);
|
|
13
|
+
return a === void 0 || a === e ? y : a;
|
|
13
14
|
};
|
|
14
|
-
function
|
|
15
|
-
var
|
|
16
|
-
const i = J(null), [
|
|
15
|
+
function G(e) {
|
|
16
|
+
var C, k;
|
|
17
|
+
const i = J(null), [y, a] = E(() => "unsubmitted"), [c, b] = E(() => null), [q, F] = E(() => "");
|
|
17
18
|
function D(o) {
|
|
18
|
-
var
|
|
19
|
-
const
|
|
19
|
+
var f, g;
|
|
20
|
+
const l = {
|
|
20
21
|
...e.builderContext.rootState,
|
|
21
22
|
...o
|
|
22
23
|
};
|
|
23
|
-
e.builderContext.rootSetState ? (
|
|
24
|
+
e.builderContext.rootSetState ? (g = (f = e.builderContext).rootSetState) == null || g.call(f, l) : e.builderContext.rootState = l;
|
|
24
25
|
}
|
|
25
|
-
function
|
|
26
|
-
return j() && e.previewState ||
|
|
26
|
+
function h() {
|
|
27
|
+
return j() && e.previewState || y;
|
|
27
28
|
}
|
|
28
29
|
function P(o) {
|
|
29
|
-
var
|
|
30
|
-
const
|
|
30
|
+
var f;
|
|
31
|
+
const l = e.sendWithJs || e.sendSubmissionsTo === "email";
|
|
31
32
|
if (e.sendSubmissionsTo === "zapier")
|
|
32
33
|
o.preventDefault();
|
|
33
|
-
else if (
|
|
34
|
+
else if (l) {
|
|
34
35
|
if (!(e.action || e.sendSubmissionsTo === "email")) {
|
|
35
36
|
o.preventDefault();
|
|
36
37
|
return;
|
|
37
38
|
}
|
|
38
39
|
o.preventDefault();
|
|
39
|
-
const
|
|
40
|
-
let
|
|
41
|
-
const A = new FormData(
|
|
40
|
+
const g = o.currentTarget, M = e.customHeaders || {};
|
|
41
|
+
let v;
|
|
42
|
+
const A = new FormData(g), T = Array.from(
|
|
42
43
|
o.currentTarget.querySelectorAll("input,select,textarea")
|
|
43
44
|
).filter((t) => !!t.name).map((t) => {
|
|
44
45
|
let n;
|
|
45
|
-
const
|
|
46
|
+
const u = t.name;
|
|
46
47
|
if (t instanceof HTMLInputElement)
|
|
47
48
|
if (t.type === "radio") {
|
|
48
49
|
if (t.checked)
|
|
49
50
|
return n = t.name, {
|
|
50
|
-
key:
|
|
51
|
+
key: u,
|
|
51
52
|
value: n
|
|
52
53
|
};
|
|
53
54
|
} else if (t.type === "checkbox")
|
|
@@ -60,41 +61,41 @@ function _(e) {
|
|
|
60
61
|
else
|
|
61
62
|
n = t.value;
|
|
62
63
|
return {
|
|
63
|
-
key:
|
|
64
|
+
key: u,
|
|
64
65
|
value: n
|
|
65
66
|
};
|
|
66
67
|
});
|
|
67
68
|
let d = e.contentType;
|
|
68
|
-
if (e.sendSubmissionsTo === "email" && (d = "multipart/form-data"), Array.from(
|
|
69
|
+
if (e.sendSubmissionsTo === "email" && (d = "multipart/form-data"), Array.from(T).forEach(({ value: t }) => {
|
|
69
70
|
(t instanceof File || Array.isArray(t) && t[0] instanceof File || t instanceof FileList) && (d = "multipart/form-data");
|
|
70
71
|
}), d !== "application/json")
|
|
71
|
-
|
|
72
|
+
v = A;
|
|
72
73
|
else {
|
|
73
74
|
const t = {};
|
|
74
|
-
Array.from(
|
|
75
|
-
U(t,
|
|
76
|
-
}),
|
|
75
|
+
Array.from(T).forEach(({ value: n, key: u }) => {
|
|
76
|
+
U(t, u, n);
|
|
77
|
+
}), v = JSON.stringify(t);
|
|
77
78
|
}
|
|
78
|
-
d && d !== "multipart/form-data" && (
|
|
79
|
-
const
|
|
80
|
-
if (i.current && (i.current.dispatchEvent(
|
|
79
|
+
d && d !== "multipart/form-data" && (l && ((f = e.action) != null && f.includes("zapier.com")) || (M["content-type"] = d));
|
|
80
|
+
const N = new CustomEvent("presubmit", { detail: { body: v } });
|
|
81
|
+
if (i.current && (i.current.dispatchEvent(N), N.defaultPrevented))
|
|
81
82
|
return;
|
|
82
|
-
|
|
83
|
+
a("sending");
|
|
83
84
|
const B = `${$() === "dev" ? "http://localhost:5000" : "https://builder.io"}/api/v1/form-submit?apiKey=${e.builderContext.apiKey}&to=${btoa(
|
|
84
85
|
e.sendSubmissionsToEmail || ""
|
|
85
86
|
)}&name=${encodeURIComponent(e.name || "")}`;
|
|
86
87
|
fetch(
|
|
87
88
|
e.sendSubmissionsTo === "email" ? B : e.action,
|
|
88
|
-
{ body:
|
|
89
|
+
{ body: v, headers: M, method: e.method || "post" }
|
|
89
90
|
).then(
|
|
90
91
|
async (t) => {
|
|
91
92
|
let n;
|
|
92
|
-
const
|
|
93
|
-
if (
|
|
93
|
+
const u = t.headers.get("content-type");
|
|
94
|
+
if (u && u.indexOf("application/json") !== -1 ? n = await t.json() : n = await t.text(), !t.ok && e.errorMessagePath) {
|
|
94
95
|
let r = L(n, e.errorMessagePath);
|
|
95
96
|
r && (typeof r != "string" && (r = JSON.stringify(r)), F(r), D({ formErrorMessage: r }));
|
|
96
97
|
}
|
|
97
|
-
if (
|
|
98
|
+
if (b(n), a(t.ok ? "success" : "error"), t.ok) {
|
|
98
99
|
const r = new CustomEvent("submit:success", {
|
|
99
100
|
detail: { res: t, body: n }
|
|
100
101
|
});
|
|
@@ -105,10 +106,10 @@ function _(e) {
|
|
|
105
106
|
}
|
|
106
107
|
if (e.successUrl)
|
|
107
108
|
if (i.current) {
|
|
108
|
-
const
|
|
109
|
+
const w = new CustomEvent("route", {
|
|
109
110
|
detail: { url: e.successUrl }
|
|
110
111
|
});
|
|
111
|
-
i.current.dispatchEvent(
|
|
112
|
+
i.current.dispatchEvent(w), w.defaultPrevented || (location.href = e.successUrl);
|
|
112
113
|
} else
|
|
113
114
|
location.href = e.successUrl;
|
|
114
115
|
}
|
|
@@ -117,14 +118,14 @@ function _(e) {
|
|
|
117
118
|
const n = new CustomEvent("submit:error", {
|
|
118
119
|
detail: { error: t }
|
|
119
120
|
});
|
|
120
|
-
i.current && (i.current.dispatchEvent(n), n.defaultPrevented) || (
|
|
121
|
+
i.current && (i.current.dispatchEvent(n), n.defaultPrevented) || (b(t), a("error"));
|
|
121
122
|
}
|
|
122
123
|
);
|
|
123
124
|
}
|
|
124
125
|
}
|
|
125
|
-
return /* @__PURE__ */
|
|
126
|
+
return /* @__PURE__ */ S(m, { children: [
|
|
126
127
|
" ",
|
|
127
|
-
/* @__PURE__ */
|
|
128
|
+
/* @__PURE__ */ S(
|
|
128
129
|
"form",
|
|
129
130
|
{
|
|
130
131
|
validate: e.validate,
|
|
@@ -135,7 +136,8 @@ function _(e) {
|
|
|
135
136
|
onSubmit: (o) => P(o),
|
|
136
137
|
...e.attributes,
|
|
137
138
|
children: [
|
|
138
|
-
|
|
139
|
+
" ",
|
|
140
|
+
e.builderBlock && e.builderBlock.children ? /* @__PURE__ */ s(m, { children: (k = (C = e.builderBlock) == null ? void 0 : C.children) == null ? void 0 : k.map((o, l) => /* @__PURE__ */ s(
|
|
139
141
|
O,
|
|
140
142
|
{
|
|
141
143
|
block: o,
|
|
@@ -143,41 +145,50 @@ function _(e) {
|
|
|
143
145
|
registeredComponents: e.builderComponents,
|
|
144
146
|
linkComponent: e.builderLinkComponent
|
|
145
147
|
},
|
|
146
|
-
`form-block-${
|
|
148
|
+
`form-block-${l}`
|
|
147
149
|
)) }) : null,
|
|
148
|
-
|
|
149
|
-
|
|
150
|
+
" ",
|
|
151
|
+
h() === "error" ? /* @__PURE__ */ s(m, { children: /* @__PURE__ */ s(
|
|
152
|
+
x,
|
|
150
153
|
{
|
|
151
154
|
path: "errorMessage",
|
|
152
155
|
blocks: e.errorMessage,
|
|
153
156
|
context: e.builderContext
|
|
154
157
|
}
|
|
155
|
-
) : null,
|
|
156
|
-
|
|
157
|
-
|
|
158
|
+
) }) : null,
|
|
159
|
+
" ",
|
|
160
|
+
h() === "sending" ? /* @__PURE__ */ s(m, { children: /* @__PURE__ */ s(
|
|
161
|
+
x,
|
|
158
162
|
{
|
|
159
163
|
path: "sendingMessage",
|
|
160
164
|
blocks: e.sendingMessage,
|
|
161
165
|
context: e.builderContext
|
|
162
166
|
}
|
|
163
|
-
) : null,
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
+
) }) : null,
|
|
168
|
+
" ",
|
|
169
|
+
h() === "error" && c ? /* @__PURE__ */ s(m, { children: /* @__PURE__ */ S("pre", { className: "builder-form-error-text pre-25b9edf0", children: [
|
|
170
|
+
" ",
|
|
171
|
+
JSON.stringify(c, null, 2),
|
|
172
|
+
" "
|
|
173
|
+
] }) }) : null,
|
|
174
|
+
" ",
|
|
175
|
+
h() === "success" ? /* @__PURE__ */ s(m, { children: /* @__PURE__ */ s(
|
|
176
|
+
x,
|
|
167
177
|
{
|
|
168
178
|
path: "successMessage",
|
|
169
179
|
blocks: e.successMessage,
|
|
170
180
|
context: e.builderContext
|
|
171
181
|
}
|
|
172
|
-
) : null
|
|
182
|
+
) }) : null,
|
|
183
|
+
" "
|
|
173
184
|
]
|
|
174
185
|
}
|
|
175
186
|
),
|
|
176
187
|
" ",
|
|
177
|
-
/* @__PURE__ */
|
|
188
|
+
/* @__PURE__ */ s("style", { children: ".pre-25b9edf0 { padding: 10px; color: red; text-align: center; }" }),
|
|
178
189
|
" "
|
|
179
190
|
] });
|
|
180
191
|
}
|
|
181
192
|
export {
|
|
182
|
-
|
|
193
|
+
G as default
|
|
183
194
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("./server-entry-
|
|
1
|
+
"use strict";const e=require("./server-entry-00891f33.cjs"),s=()=>{switch(e.TARGET){case"react":case"reactNative":case"rsc":return"className";case"svelte":case"vue":case"solid":case"qwik":return"class"}};exports.getClassPropName=s;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as m, Fragment as l, jsx as a } from "react/jsx-runtime";
|
|
2
2
|
function g(e) {
|
|
3
3
|
return e.replace(/http(s)?:/, "");
|
|
4
4
|
}
|
|
@@ -33,37 +33,37 @@ function v(e) {
|
|
|
33
33
|
var c, r, u, f;
|
|
34
34
|
function i() {
|
|
35
35
|
var h;
|
|
36
|
-
const
|
|
37
|
-
if (!
|
|
36
|
+
const o = e.image || e.src;
|
|
37
|
+
if (!o || // We can auto add srcset for cdn.builder.io and shopify
|
|
38
38
|
// images, otherwise you can supply this prop manually
|
|
39
|
-
!(
|
|
39
|
+
!(o.match(/builder\.io/) || o.match(/cdn\.shopify\.com/)))
|
|
40
40
|
return e.srcset;
|
|
41
41
|
if (e.srcset && ((h = e.image) != null && h.includes("builder.io/api/v1/image"))) {
|
|
42
42
|
if (!e.srcset.includes(e.image.split("?")[0]))
|
|
43
|
-
return console.debug("Removed given srcset"), s(
|
|
43
|
+
return console.debug("Removed given srcset"), s(o);
|
|
44
44
|
} else if (e.image && !e.srcset)
|
|
45
|
-
return s(
|
|
46
|
-
return s(
|
|
45
|
+
return s(o);
|
|
46
|
+
return s(o);
|
|
47
47
|
}
|
|
48
48
|
function t() {
|
|
49
|
-
var
|
|
50
|
-
return (
|
|
49
|
+
var d;
|
|
50
|
+
return (d = i == null ? void 0 : i()) != null && d.match(/builder\.io/) && !e.noWebp ? i().replace(/\?/g, "?format=webp&") : "";
|
|
51
51
|
}
|
|
52
52
|
function n() {
|
|
53
|
-
const
|
|
53
|
+
const d = {
|
|
54
54
|
position: "absolute",
|
|
55
55
|
height: "100%",
|
|
56
56
|
width: "100%",
|
|
57
57
|
left: "0px",
|
|
58
58
|
top: "0px"
|
|
59
59
|
};
|
|
60
|
-
return e.aspectRatio ?
|
|
60
|
+
return e.aspectRatio ? d : void 0;
|
|
61
61
|
}
|
|
62
|
-
return /* @__PURE__ */
|
|
63
|
-
/* @__PURE__ */
|
|
64
|
-
/* @__PURE__ */
|
|
65
|
-
t() ? /* @__PURE__ */
|
|
66
|
-
/* @__PURE__ */
|
|
62
|
+
return /* @__PURE__ */ m(l, { children: [
|
|
63
|
+
/* @__PURE__ */ m(l, { children: [
|
|
64
|
+
/* @__PURE__ */ m("picture", { children: [
|
|
65
|
+
t() ? /* @__PURE__ */ a(l, { children: /* @__PURE__ */ a("source", { type: "image/webp", srcSet: t() }) }) : null,
|
|
66
|
+
/* @__PURE__ */ a(
|
|
67
67
|
"img",
|
|
68
68
|
{
|
|
69
69
|
loading: "lazy",
|
|
@@ -74,33 +74,33 @@ function v(e) {
|
|
|
74
74
|
objectFit: e.backgroundSize || "cover",
|
|
75
75
|
...n()
|
|
76
76
|
},
|
|
77
|
-
className: "builder-image" + (e.className ? " " + e.className : "") + " img-
|
|
77
|
+
className: "builder-image" + (e.className ? " " + e.className : "") + " img-0614da04",
|
|
78
78
|
src: e.image,
|
|
79
79
|
srcSet: i(),
|
|
80
80
|
sizes: e.sizes
|
|
81
81
|
}
|
|
82
82
|
)
|
|
83
83
|
] }),
|
|
84
|
-
e.aspectRatio && !((r = (c = e.builderBlock) == null ? void 0 : c.children) != null && r.length && e.fitContent) ? /* @__PURE__ */
|
|
84
|
+
e.aspectRatio && !((r = (c = e.builderBlock) == null ? void 0 : c.children) != null && r.length && e.fitContent) ? /* @__PURE__ */ a(l, { children: /* @__PURE__ */ a(
|
|
85
85
|
"div",
|
|
86
86
|
{
|
|
87
|
-
className: "builder-image-sizer div-
|
|
87
|
+
className: "builder-image-sizer div-0614da04",
|
|
88
88
|
style: {
|
|
89
89
|
paddingTop: e.aspectRatio * 100 + "%"
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
|
-
) : null,
|
|
93
|
-
(f = (u = e.builderBlock) == null ? void 0 : u.children) != null && f.length && e.fitContent ? /* @__PURE__ */
|
|
94
|
-
!e.fitContent && e.children ? /* @__PURE__ */
|
|
92
|
+
) }) : null,
|
|
93
|
+
(f = (u = e.builderBlock) == null ? void 0 : u.children) != null && f.length && e.fitContent ? /* @__PURE__ */ a(l, { children: e.children }) : null,
|
|
94
|
+
!e.fitContent && e.children ? /* @__PURE__ */ a(l, { children: /* @__PURE__ */ a("div", { className: "div-0614da04-2", children: e.children }) }) : null
|
|
95
95
|
] }),
|
|
96
|
-
/* @__PURE__ */
|
|
96
|
+
/* @__PURE__ */ a("style", { children: `.img-0614da04 {
|
|
97
97
|
opacity: 1;
|
|
98
98
|
transition: opacity 0.2s ease-in-out;
|
|
99
|
-
}.div-
|
|
99
|
+
}.div-0614da04 {
|
|
100
100
|
width: 100%;
|
|
101
101
|
pointer-events: none;
|
|
102
102
|
font-size: 0;
|
|
103
|
-
}.div-
|
|
103
|
+
}.div-0614da04-2 {
|
|
104
104
|
display: flex;
|
|
105
105
|
flex-direction: column;
|
|
106
106
|
align-items: stretch;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime");function f(e){return e.replace(/http(s)?:/,"")}function g(e="",i,t){const c=new RegExp("([?&])"+i+"=.*?(&|$)","i"),a=e.indexOf("?")!==-1?"&":"?";return e.match(c)?e.replace(c,"$1"+i+"="+encodeURIComponent(t)+"$2"):e+a+i+"="+encodeURIComponent(t)}function h(e,i){if(!e||!(e!=null&&e.match(/cdn\.shopify\.com/))||!i)return e;if(i==="master")return f(e);const t=e.match(/(_\d+x(\d+)?)?(\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif)(\?v=\d+)?)/i);if(t){const c=e.split(t[0]),a=t[3],r=i.match("x")?i:`${i}x`;return f(`${c[0]}_${r}${a}`)}return null}function d(e){if(!e)return e;const i=[100,200,400,800,1200,1600,2e3];if(e.match(/builder\.io/)){let t=e;const c=Number(e.split("?width=")[1]);return isNaN(c)||(t=`${t} ${c}w`),i.filter(a=>a!==c).map(a=>`${g(e,"width",a)} ${a}w`).concat([t]).join(", ")}return e.match(/cdn\.shopify\.com/)?i.map(t=>[h(e,`${t}x${t}`),t]).filter(([t])=>!!t).map(([t,c])=>`${t} ${c}w`).concat([e]).join(", "):e}function x(e){var a,r,s,m;function i(){var u;const o=e.image||e.src;if(!o||!(o.match(/builder\.io/)||o.match(/cdn\.shopify\.com/)))return e.srcset;if(e.srcset&&((u=e.image)!=null&&u.includes("builder.io/api/v1/image"))){if(!e.srcset.includes(e.image.split("?")[0]))return console.debug("Removed given srcset"),d(o)}else if(e.image&&!e.srcset)return d(o);return d(o)}function t(){var l;return(l=i==null?void 0:i())!=null&&l.match(/builder\.io/)&&!e.noWebp?i().replace(/\?/g,"?format=webp&"):""}function c(){const l={position:"absolute",height:"100%",width:"100%",left:"0px",top:"0px"};return e.aspectRatio?l:void 0}return n.jsxs(n.Fragment,{children:[n.jsxs(n.Fragment,{children:[n.jsxs("picture",{children:[t()?n.jsx(n.Fragment,{children:n.jsx("source",{type:"image/webp",srcSet:t()})}):null,n.jsx("img",{loading:"lazy",alt:e.altText,role:e.altText?void 0:"presentation",style:{objectPosition:e.backgroundPosition||"center",objectFit:e.backgroundSize||"cover",...c()},className:"builder-image"+(e.className?" "+e.className:"")+" img-0614da04",src:e.image,srcSet:i(),sizes:e.sizes})]}),e.aspectRatio&&!((r=(a=e.builderBlock)==null?void 0:a.children)!=null&&r.length&&e.fitContent)?n.jsx(n.Fragment,{children:n.jsx("div",{className:"builder-image-sizer div-0614da04",style:{paddingTop:e.aspectRatio*100+"%"}})}):null,(m=(s=e.builderBlock)==null?void 0:s.children)!=null&&m.length&&e.fitContent?n.jsx(n.Fragment,{children:e.children}):null,!e.fitContent&&e.children?n.jsx(n.Fragment,{children:n.jsx("div",{className:"div-0614da04-2",children:e.children})}):null]}),n.jsx("style",{children:`.img-0614da04 {
|
|
2
|
+
opacity: 1;
|
|
3
|
+
transition: opacity 0.2s ease-in-out;
|
|
4
|
+
}.div-0614da04 {
|
|
5
|
+
width: 100%;
|
|
6
|
+
pointer-events: none;
|
|
7
|
+
font-size: 0;
|
|
8
|
+
}.div-0614da04-2 {
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-direction: column;
|
|
11
|
+
align-items: stretch;
|
|
12
|
+
position: absolute;
|
|
13
|
+
top: 0;
|
|
14
|
+
left: 0;
|
|
15
|
+
width: 100%;
|
|
16
|
+
height: 100%;
|
|
17
|
+
}`})]})}exports.default=x;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),i=require("./server-entry-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),i=require("./server-entry-00891f33.cjs");function n(e){return t.jsx("img",{style:{objectFit:e.backgroundSize||"cover",objectPosition:e.backgroundPosition||"center"},alt:e.altText,src:e.imgSrc||e.image,...e.attributes},i.isEditing()&&e.imgSrc||"default-key")}exports.default=n;
|
package/lib/edge/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./blocks-exports.cjs"),e=require("./server-entry-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./blocks-exports.cjs"),e=require("./server-entry-00891f33.cjs");require("react");exports.Blocks=t.Blocks;exports.BuilderContext=t.BuilderContext;exports.Button=t.Button;exports.Columns=t.Columns;exports.Content=t.Content;exports.Fragment=t.Fragment;exports.Image=t.Image;exports.Section=t.Section;exports.Symbol=t.Symbol;exports.Text=t.Text;exports.Video=t.Video;exports._processContentResult=e._processContentResult;exports.createRegisterComponentMessage=e.createRegisterComponentMessage;exports.fetchBuilderProps=e.fetchBuilderProps;exports.fetchEntries=e.fetchEntries;exports.fetchOneEntry=e.fetchOneEntry;exports.getBuilderSearchParams=e.getBuilderSearchParams;exports.isEditing=e.isEditing;exports.isPreviewing=e.isPreviewing;exports.register=e.register;exports.setEditorSettings=e.setEditorSettings;exports.subscribeToEditor=e.subscribeToEditor;exports.track=e.track;
|
package/lib/edge/index.mjs
CHANGED
|
@@ -1,27 +1,28 @@
|
|
|
1
|
-
import { Blocks as o,
|
|
2
|
-
import { _processContentResult as
|
|
1
|
+
import { Blocks as o, BuilderContext as i, Button as s, Columns as n, Content as c, Fragment as g, Image as m, Section as a, Symbol as d, Text as l, Video as u } from "./blocks-exports.mjs";
|
|
2
|
+
import { _processContentResult as f, createRegisterComponentMessage as B, fetchBuilderProps as C, fetchEntries as E, fetchOneEntry as h, getBuilderSearchParams as x, isEditing as S, isPreviewing as b, register as P, setEditorSettings as k, subscribeToEditor as y, track as R } from "./server-entry-d46a218d.js";
|
|
3
3
|
import "react";
|
|
4
4
|
export {
|
|
5
5
|
o as Blocks,
|
|
6
|
-
i as
|
|
7
|
-
s as
|
|
8
|
-
n as
|
|
9
|
-
c as
|
|
10
|
-
g as
|
|
11
|
-
m as
|
|
12
|
-
a as
|
|
13
|
-
d as
|
|
14
|
-
l as
|
|
15
|
-
u as
|
|
16
|
-
f as
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
6
|
+
i as BuilderContext,
|
|
7
|
+
s as Button,
|
|
8
|
+
n as Columns,
|
|
9
|
+
c as Content,
|
|
10
|
+
g as Fragment,
|
|
11
|
+
m as Image,
|
|
12
|
+
a as Section,
|
|
13
|
+
d as Symbol,
|
|
14
|
+
l as Text,
|
|
15
|
+
u as Video,
|
|
16
|
+
f as _processContentResult,
|
|
17
|
+
B as createRegisterComponentMessage,
|
|
18
|
+
C as fetchBuilderProps,
|
|
19
|
+
E as fetchEntries,
|
|
20
|
+
h as fetchOneEntry,
|
|
21
|
+
x as getBuilderSearchParams,
|
|
21
22
|
S as isEditing,
|
|
22
23
|
b as isPreviewing,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
P as register,
|
|
25
|
+
k as setEditorSettings,
|
|
26
|
+
y as subscribeToEditor,
|
|
27
|
+
R as track
|
|
27
28
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var a=Object.create;var r=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var u=Object.getPrototypeOf,l=Object.prototype.hasOwnProperty;var m=(e,i,t,n)=>{if(i&&typeof i=="object"||typeof i=="function")for(let o of s(i))!l.call(e,o)&&o!==t&&r(e,o,{get:()=>i[o],enumerable:!(n=c(i,o))||n.enumerable});return e};var p=(e,i,t)=>(t=e!=null?a(u(e)):{},m(i||!e||!e.__esModule?r(t,"default",{value:e,enumerable:!0}):t,e));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const noop=()=>{};let safeDynamicRequire=noop;try{safeDynamicRequire=eval("require")}catch(e){}const initializeNodeRuntime=async()=>{await import("isolated-vm")};exports.initializeNodeRuntime=initializeNodeRuntime;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react"),u=require("./server-entry-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react"),u=require("./server-entry-00891f33.cjs");function a(e){return t.createElement("input",{...e.attributes,key:u.isEditing()&&e.defaultValue?e.defaultValue:"default-key",placeholder:e.placeholder,type:e.type,name:e.name,value:e.value,defaultValue:e.defaultValue,required:e.required})}exports.default=a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),l=require("react"),n=require("./server-entry-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),l=require("react"),n=require("./server-entry-00891f33.cjs");function i(e){var u;return l.createElement("select",{...e.attributes,value:e.value,key:n.isEditing()&&e.defaultValue?e.defaultValue:"default-key",defaultValue:e.defaultValue,name:e.name},(u=e.options)==null?void 0:u.map(t=>a.jsx("option",{value:t.value,children:t.name||t.value})))}exports.default=i;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as l } from "react/jsx-runtime";
|
|
2
2
|
import { createElement as u } from "react";
|
|
3
|
-
import { isEditing as m } from "./server-entry-
|
|
3
|
+
import { isEditing as m } from "./server-entry-d46a218d.js";
|
|
4
4
|
function d(e) {
|
|
5
5
|
var t;
|
|
6
6
|
return /* @__PURE__ */ u(
|